/** * vis-network * https://visjs.github.io/vis-network/ * * A dynamic, browser-based visualization library. * * @version 0.0.0-no-version * @date 2025-06-29T19:44:20.690Z * * @copyright (c) 2011-2017 Almende B.V, http://almende.com * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs * * @license * vis.js is dual licensed under both * * 1. The Apache 2.0 License * http://www.apache.org/licenses/LICENSE-2.0 * * and * * 2. The MIT License * http://opensource.org/licenses/MIT * * vis.js may be distributed under either license. */ !function(g,A){"object"==typeof exports&&"undefined"!=typeof module?A(exports):"function"==typeof define&&define.amd?define(["exports"],A):A((g="undefined"!=typeof globalThis?globalThis:g||self).vis=g.vis||{})}(this,(function(g){var A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function C(g){return g&&g.__esModule&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g}var I=function(g){return g&&g.Math===Math&&g},t=I("object"==typeof globalThis&&globalThis)||I("object"==typeof window&&window)||I("object"==typeof self&&self)||I("object"==typeof A&&A)||function(){return this}()||A||Function("return this")(),e=function(g){try{return!!g()}catch(g){return!0}},i=!e((function(){var g=function(){}.bind();return"function"!=typeof g||g.hasOwnProperty("prototype")})),o=i,s=Function.prototype,n=s.apply,r=s.call,a="object"==typeof Reflect&&Reflect.apply||(o?r.bind(n):function(){return r.apply(n,arguments)}),d=i,h=Function.prototype,l=h.call,c=d&&h.bind.bind(l,l),u=d?c:function(g){return function(){return l.apply(g,arguments)}},p=u,f=p({}.toString),b=p("".slice),m=function(g){return b(f(g),8,-1)},v=m,y=u,w=function(g){if("Function"===v(g))return y(g)},x="object"==typeof document&&document.all,E={all:x,IS_HTMLDDA:void 0===x&&void 0!==x},O=E.all,T=E.IS_HTMLDDA?function(g){return"function"==typeof g||g===O}:function(g){return"function"==typeof g},D={},N=!e((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),k=i,R=Function.prototype.call,P=k?R.bind(R):function(){return R.apply(R,arguments)},M={},z={}.propertyIsEnumerable,B=Object.getOwnPropertyDescriptor,Z=B&&!z.call({1:2},1);M.f=Z?function(g){var A=B(this,g);return!!A&&A.enumerable}:z;var S,F,G=function(g,A){return{enumerable:!(1&g),configurable:!(2&g),writable:!(4&g),value:A}},L=e,j=m,V=Object,Y=u("".split),W=L((function(){return!V("z").propertyIsEnumerable(0)}))?function(g){return"String"===j(g)?Y(g,""):V(g)}:V,Q=function(g){return null==g},U=Q,K=TypeError,H=function(g){if(U(g))throw new K("Can't call method on "+g);return g},X=W,_=H,J=function(g){return X(_(g))},q=T,$=E.all,gg=E.IS_HTMLDDA?function(g){return"object"==typeof g?null!==g:q(g)||g===$}:function(g){return"object"==typeof g?null!==g:q(g)},Ag={},Cg=Ag,Ig=t,tg=T,eg=function(g){return tg(g)?g:void 0},ig=function(g,A){return arguments.length<2?eg(Cg[g])||eg(Ig[g]):Cg[g]&&Cg[g][A]||Ig[g]&&Ig[g][A]},og=u({}.isPrototypeOf),sg="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ng=t,rg=sg,ag=ng.process,dg=ng.Deno,hg=ag&&ag.versions||dg&&dg.version,lg=hg&&hg.v8;lg&&(F=(S=lg.split("."))[0]>0&&S[0]<4?1:+(S[0]+S[1])),!F&&rg&&(!(S=rg.match(/Edge\/(\d+)/))||S[1]>=74)&&(S=rg.match(/Chrome\/(\d+)/))&&(F=+S[1]);var cg=F,ug=cg,pg=e,fg=t.String,bg=!!Object.getOwnPropertySymbols&&!pg((function(){var g=Symbol("symbol detection");return!fg(g)||!(Object(g)instanceof Symbol)||!Symbol.sham&&ug&&ug<41})),mg=bg&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,vg=ig,yg=T,wg=og,xg=Object,Eg=mg?function(g){return"symbol"==typeof g}:function(g){var A=vg("Symbol");return yg(A)&&wg(A.prototype,xg(g))},Og=String,Tg=function(g){try{return Og(g)}catch(g){return"Object"}},Dg=T,Ng=Tg,kg=TypeError,Rg=function(g){if(Dg(g))return g;throw new kg(Ng(g)+" is not a function")},Pg=Rg,Mg=Q,zg=function(g,A){var C=g[A];return Mg(C)?void 0:Pg(C)},Bg=P,Zg=T,Sg=gg,Fg=TypeError,Gg={exports:{}},Lg=t,jg=Object.defineProperty,Vg=function(g,A){try{jg(Lg,g,{value:A,configurable:!0,writable:!0})}catch(C){Lg[g]=A}return A},Yg="__core-js_shared__",Wg=t[Yg]||Vg(Yg,{}),Qg=Wg;(Gg.exports=function(g,A){return Qg[g]||(Qg[g]=void 0!==A?A:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Ug=Gg.exports,Kg=H,Hg=Object,Xg=function(g){return Hg(Kg(g))},_g=Xg,Jg=u({}.hasOwnProperty),qg=Object.hasOwn||function(g,A){return Jg(_g(g),A)},$g=u,gA=0,AA=Math.random(),CA=$g(1..toString),IA=function(g){return"Symbol("+(void 0===g?"":g)+")_"+CA(++gA+AA,36)},tA=Ug,eA=qg,iA=IA,oA=bg,sA=mg,nA=t.Symbol,rA=tA("wks"),aA=sA?nA.for||nA:nA&&nA.withoutSetter||iA,dA=function(g){return eA(rA,g)||(rA[g]=oA&&eA(nA,g)?nA[g]:aA("Symbol."+g)),rA[g]},hA=P,lA=gg,cA=Eg,uA=zg,pA=function(g,A){var C,I;if("string"===A&&Zg(C=g.toString)&&!Sg(I=Bg(C,g)))return I;if(Zg(C=g.valueOf)&&!Sg(I=Bg(C,g)))return I;if("string"!==A&&Zg(C=g.toString)&&!Sg(I=Bg(C,g)))return I;throw new Fg("Can't convert object to primitive value")},fA=TypeError,bA=dA("toPrimitive"),mA=function(g,A){if(!lA(g)||cA(g))return g;var C,I=uA(g,bA);if(I){if(void 0===A&&(A="default"),C=hA(I,g,A),!lA(C)||cA(C))return C;throw new fA("Can't convert object to primitive value")}return void 0===A&&(A="number"),pA(g,A)},vA=Eg,yA=function(g){var A=mA(g,"string");return vA(A)?A:A+""},wA=gg,xA=t.document,EA=wA(xA)&&wA(xA.createElement),OA=function(g){return EA?xA.createElement(g):{}},TA=OA,DA=!N&&!e((function(){return 7!==Object.defineProperty(TA("div"),"a",{get:function(){return 7}}).a})),NA=N,kA=P,RA=M,PA=G,MA=J,zA=yA,BA=qg,ZA=DA,SA=Object.getOwnPropertyDescriptor;D.f=NA?SA:function(g,A){if(g=MA(g),A=zA(A),ZA)try{return SA(g,A)}catch(g){}if(BA(g,A))return PA(!kA(RA.f,g,A),g[A])};var FA=e,GA=T,LA=/#|\.prototype\./,jA=function(g,A){var C=YA[VA(g)];return C===QA||C!==WA&&(GA(A)?FA(A):!!A)},VA=jA.normalize=function(g){return String(g).replace(LA,".").toLowerCase()},YA=jA.data={},WA=jA.NATIVE="N",QA=jA.POLYFILL="P",UA=jA,KA=Rg,HA=i,XA=w(w.bind),_A=function(g,A){return KA(g),void 0===A?g:HA?XA(g,A):function(){return g.apply(A,arguments)}},JA={},qA=N&&e((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),$A=gg,gC=String,AC=TypeError,CC=function(g){if($A(g))return g;throw new AC(gC(g)+" is not an object")},IC=N,tC=DA,eC=qA,iC=CC,oC=yA,sC=TypeError,nC=Object.defineProperty,rC=Object.getOwnPropertyDescriptor,aC="enumerable",dC="configurable",hC="writable";JA.f=IC?eC?function(g,A,C){if(iC(g),A=oC(A),iC(C),"function"==typeof g&&"prototype"===A&&"value"in C&&hC in C&&!C[hC]){var I=rC(g,A);I&&I[hC]&&(g[A]=C.value,C={configurable:dC in C?C[dC]:I[dC],enumerable:aC in C?C[aC]:I[aC],writable:!1})}return nC(g,A,C)}:nC:function(g,A,C){if(iC(g),A=oC(A),iC(C),tC)try{return nC(g,A,C)}catch(g){}if("get"in C||"set"in C)throw new sC("Accessors not supported");return"value"in C&&(g[A]=C.value),g};var lC=JA,cC=G,uC=N?function(g,A,C){return lC.f(g,A,cC(1,C))}:function(g,A,C){return g[A]=C,g},pC=t,fC=a,bC=w,mC=T,vC=D.f,yC=UA,wC=Ag,xC=_A,EC=uC,OC=qg,TC=function(g){var A=function(C,I,t){if(this instanceof A){switch(arguments.length){case 0:return new g;case 1:return new g(C);case 2:return new g(C,I)}return new g(C,I,t)}return fC(g,this,arguments)};return A.prototype=g.prototype,A},DC=function(g,A){var C,I,t,e,i,o,s,n,r,a=g.target,d=g.global,h=g.stat,l=g.proto,c=d?pC:h?pC[a]:(pC[a]||{}).prototype,u=d?wC:wC[a]||EC(wC,a,{})[a],p=u.prototype;for(e in A)I=!(C=yC(d?e:a+(h?".":"#")+e,g.forced))&&c&&OC(c,e),o=u[e],I&&(s=g.dontCallGetSet?(r=vC(c,e))&&r.value:c[e]),i=I&&s?s:A[e],I&&typeof o==typeof i||(n=g.bind&&I?xC(i,pC):g.wrap&&I?TC(i):l&&mC(i)?bC(i):i,(g.sham||i&&i.sham||o&&o.sham)&&EC(n,"sham",!0),EC(u,e,n),l&&(OC(wC,t=a+"Prototype")||EC(wC,t,{}),EC(wC[t],e,i),g.real&&p&&(C||!p[e])&&EC(p,e,i)))},NC=Math.ceil,kC=Math.floor,RC=Math.trunc||function(g){var A=+g;return(A>0?kC:NC)(A)},PC=function(g){var A=+g;return A!=A||0===A?0:RC(A)},MC=PC,zC=Math.max,BC=Math.min,ZC=function(g,A){var C=MC(g);return C<0?zC(C+A,0):BC(C,A)},SC=PC,FC=Math.min,GC=function(g){return g>0?FC(SC(g),9007199254740991):0},LC=function(g){return GC(g.length)},jC=J,VC=ZC,YC=LC,WC=function(g){return function(A,C,I){var t,e=jC(A),i=YC(e),o=VC(I,i);if(g&&C!=C){for(;i>o;)if((t=e[o++])!=t)return!0}else for(;i>o;o++)if((g||o in e)&&e[o]===C)return g||o||0;return!g&&-1}},QC={includes:WC(!0),indexOf:WC(!1)},UC={},KC=qg,HC=J,XC=QC.indexOf,_C=UC,JC=u([].push),qC=function(g,A){var C,I=HC(g),t=0,e=[];for(C in I)!KC(_C,C)&&KC(I,C)&&JC(e,C);for(;A.length>t;)KC(I,C=A[t++])&&(~XC(e,C)||JC(e,C));return e},$C=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],gI=qC,AI=$C,CI=Object.keys||function(g){return gI(g,AI)},II={};II.f=Object.getOwnPropertySymbols;var tI=N,eI=u,iI=P,oI=e,sI=CI,nI=II,rI=M,aI=Xg,dI=W,hI=Object.assign,lI=Object.defineProperty,cI=eI([].concat),uI=!hI||oI((function(){if(tI&&1!==hI({b:1},hI(lI({},"a",{enumerable:!0,get:function(){lI(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var g={},A={},C=Symbol("assign detection"),I="abcdefghijklmnopqrst";return g[C]=7,I.split("").forEach((function(g){A[g]=g})),7!==hI({},g)[C]||sI(hI({},A)).join("")!==I}))?function(g,A){for(var C=aI(g),I=arguments.length,t=1,e=nI.f,i=rI.f;I>t;)for(var o,s=dI(arguments[t++]),n=e?cI(sI(s),e(s)):sI(s),r=n.length,a=0;r>a;)o=n[a++],tI&&!iI(i,s,o)||(C[o]=s[o]);return C}:hI,pI=uI;DC({target:"Object",stat:!0,arity:2,forced:Object.assign!==pI},{assign:pI});var fI=C(Ag.Object.assign),bI=u([].slice),mI=u,vI=Rg,yI=gg,wI=qg,xI=bI,EI=i,OI=Function,TI=mI([].concat),DI=mI([].join),NI={},kI=EI?OI.bind:function(g){var A=vI(this),C=A.prototype,I=xI(arguments,1),t=function(){var C=TI(I,xI(arguments));return this instanceof t?function(g,A,C){if(!wI(NI,A)){for(var I=[],t=0;t=.1;)l=+e[a++%i],l>r&&(l=r),h=Math.sqrt(l*l/(1+n*n)),h=o<0?-h:h,A+=h,C+=n*h,!0===d?g.lineTo(A,C):g.moveTo(A,C),r-=l,d=!d}const QI={circle:LI,dashedLine:WI,database:YI,diamond:function(g,A,C,I){g.beginPath(),g.lineTo(A,C+I),g.lineTo(A+I,C),g.lineTo(A,C-I),g.lineTo(A-I,C),g.closePath()},ellipse:VI,ellipse_vis:VI,hexagon:function(g,A,C,I){g.beginPath();const t=2*Math.PI/6;g.moveTo(A+I,C);for(let e=1;e<6;e++)g.lineTo(A+I*Math.cos(t*e),C+I*Math.sin(t*e));g.closePath()},roundRect:jI,square:function(g,A,C,I){g.beginPath(),g.rect(A-I,C-I,2*I,2*I),g.closePath()},star:function(g,A,C,I){g.beginPath(),C+=.1*(I*=.82);for(let t=0;t<10;t++){const e=t%2==0?1.3*I:.5*I;g.lineTo(A+e*Math.sin(2*t*Math.PI/10),C-e*Math.cos(2*t*Math.PI/10))}g.closePath()},triangle:function(g,A,C,I){g.beginPath(),C+=.275*(I*=1.15);const t=2*I,e=t/2,i=Math.sqrt(3)/6*t,o=Math.sqrt(t*t-e*e);g.moveTo(A,C-(o-i)),g.lineTo(A+e,C+i),g.lineTo(A-e,C+i),g.lineTo(A,C-(o-i)),g.closePath()},triangleDown:function(g,A,C,I){g.beginPath(),C-=.275*(I*=1.15);const t=2*I,e=t/2,i=Math.sqrt(3)/6*t,o=Math.sqrt(t*t-e*e);g.moveTo(A,C+(o-i)),g.lineTo(A+e,C-i),g.lineTo(A-e,C-i),g.lineTo(A,C+(o-i)),g.closePath()}};function UI(g,A){void 0===A&&(A={});var C=A.insertAt;if(g&&"undefined"!=typeof document){var I=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css","top"===C&&I.firstChild?I.insertBefore(t,I.firstChild):I.appendChild(t),t.styleSheet?t.styleSheet.cssText=g:t.appendChild(document.createTextNode(g))}}UI(".vis-overlay{bottom:0;left:0;position:absolute;right:0;top:0;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}");UI(".vis [class*=span]{min-height:0;width:auto}");UI('div.vis-color-picker{background-color:#fff;border-radius:15px;box-shadow:0 0 10px 0 rgba(0,0,0,.5);display:none;height:444px;left:30px;margin-left:30px;margin-top:-140px;padding:10px;position:absolute;top:0;width:310px;z-index:1}div.vis-color-picker div.vis-arrow{left:5px;position:absolute;top:147px}div.vis-color-picker div.vis-arrow:after,div.vis-color-picker div.vis-arrow:before{border:solid transparent;content:" ";height:0;pointer-events:none;position:absolute;right:100%;top:50%;width:0}div.vis-color-picker div.vis-arrow:after{border-color:hsla(0,0%,100%,0) #fff hsla(0,0%,100%,0) hsla(0,0%,100%,0);border-width:30px;margin-top:-30px}div.vis-color-picker div.vis-color{cursor:pointer;height:289px;position:absolute;width:289px}div.vis-color-picker div.vis-brightness{position:absolute;top:313px}div.vis-color-picker div.vis-opacity{position:absolute;top:350px}div.vis-color-picker div.vis-selector{background:#4c4c4c;background:-moz-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4c4c4c),color-stop(12%,#595959),color-stop(25%,#666),color-stop(39%,#474747),color-stop(50%,#2c2c2c),color-stop(51%,#000),color-stop(60%,#111),color-stop(76%,#2b2b2b),color-stop(91%,#1c1c1c),color-stop(100%,#131313));background:-webkit-linear-gradient(top,#4c4c4c,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313);background:-o-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-ms-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:linear-gradient(180deg,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313);border:1px solid #fff;border-radius:15px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#4c4c4c",endColorstr="#131313",GradientType=0);height:15px;left:137px;position:absolute;top:137px;width:15px}div.vis-color-picker div.vis-new-color{left:159px;padding-right:2px;text-align:right}div.vis-color-picker div.vis-initial-color,div.vis-color-picker div.vis-new-color{border:1px solid rgba(0,0,0,.1);border-radius:5px;color:rgba(0,0,0,.4);font-size:10px;height:20px;line-height:20px;position:absolute;top:380px;vertical-align:middle;width:140px}div.vis-color-picker div.vis-initial-color{left:10px;padding-left:2px;text-align:left}div.vis-color-picker div.vis-label{left:10px;position:absolute;width:300px}div.vis-color-picker div.vis-label.vis-brightness{top:300px}div.vis-color-picker div.vis-label.vis-opacity{top:338px}div.vis-color-picker div.vis-button{background-color:#f7f7f7;border:2px solid #d9d9d9;border-radius:10px;cursor:pointer;height:25px;line-height:25px;position:absolute;text-align:center;top:410px;vertical-align:middle;width:68px}div.vis-color-picker div.vis-button.vis-cancel{left:5px}div.vis-color-picker div.vis-button.vis-load{left:82px}div.vis-color-picker div.vis-button.vis-apply{left:159px}div.vis-color-picker div.vis-button.vis-save{left:236px}div.vis-color-picker input.vis-range{height:20px;width:290px}');UI('div.vis-configuration{display:block;float:left;font-size:12px;position:relative}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper:after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{background-color:#fff;border:2px solid #f7f8fa;border-radius:4px;display:block;left:10px;margin-top:20px;padding-left:5px;width:495px}div.vis-configuration.vis-config-button{background-color:#f7f8fa;border:2px solid #ceced0;border-radius:4px;cursor:pointer;display:block;height:25px;left:10px;line-height:25px;margin-bottom:30px;margin-top:20px;padding-left:5px;vertical-align:middle;width:495px}div.vis-configuration.vis-config-button.hover{background-color:#4588e6;border:2px solid #214373;color:#fff}div.vis-configuration.vis-config-item{display:block;float:left;height:25px;line-height:25px;vertical-align:middle;width:495px}div.vis-configuration.vis-config-item.vis-config-s2{background-color:#f7f8fa;border-radius:3px;left:10px;padding-left:5px}div.vis-configuration.vis-config-item.vis-config-s3{background-color:#e4e9f0;border-radius:3px;left:20px;padding-left:5px}div.vis-configuration.vis-config-item.vis-config-s4{background-color:#cfd8e6;border-radius:3px;left:30px;padding-left:5px}div.vis-configuration.vis-config-header{font-size:18px;font-weight:700}div.vis-configuration.vis-config-label{height:25px;line-height:25px;width:120px}div.vis-configuration.vis-config-label.vis-config-s3{width:110px}div.vis-configuration.vis-config-label.vis-config-s4{width:100px}div.vis-configuration.vis-config-colorBlock{border:1px solid #444;border-radius:2px;cursor:pointer;height:19px;margin:0;padding:0;top:1px;width:30px}input.vis-configuration.vis-config-checkbox{left:-5px}input.vis-configuration.vis-config-rangeinput{margin:0;padding:1px;pointer-events:none;position:relative;top:-5px;width:60px}input.vis-configuration.vis-config-range{-webkit-appearance:none;background-color:transparent;border:0 solid #fff;height:20px;width:300px}input.vis-configuration.vis-config-range::-webkit-slider-runnable-track{background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(180deg,#dedede 0,#c8c8c8 99%);border:1px solid #999;border-radius:3px;box-shadow:0 0 3px 0 #aaa;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#dedede",endColorstr="#c8c8c8",GradientType=0);height:5px;width:300px}input.vis-configuration.vis-config-range::-webkit-slider-thumb{-webkit-appearance:none;background:#3876c2;background:-moz-linear-gradient(top,#3876c2 0,#385380 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3876c2),color-stop(100%,#385380));background:-webkit-linear-gradient(top,#3876c2,#385380);background:-o-linear-gradient(top,#3876c2 0,#385380 100%);background:-ms-linear-gradient(top,#3876c2 0,#385380 100%);background:linear-gradient(180deg,#3876c2 0,#385380);border:1px solid #14334b;border-radius:50%;box-shadow:0 0 1px 0 #111927;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#3876c2",endColorstr="#385380",GradientType=0);height:17px;margin-top:-7px;width:17px}input.vis-configuration.vis-config-range:focus{outline:none}input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track{background:#9d9d9d;background:-moz-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#9d9d9d),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#9d9d9d,#c8c8c8 99%);background:-o-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:linear-gradient(180deg,#9d9d9d 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#9d9d9d",endColorstr="#c8c8c8",GradientType=0)}input.vis-configuration.vis-config-range::-moz-range-track{background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(180deg,#dedede 0,#c8c8c8 99%);border:1px solid #999;border-radius:3px;box-shadow:0 0 3px 0 #aaa;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#dedede",endColorstr="#c8c8c8",GradientType=0);height:10px;width:300px}input.vis-configuration.vis-config-range::-moz-range-thumb{background:#385380;border:none;border-radius:50%;height:16px;width:16px}input.vis-configuration.vis-config-range:-moz-focusring{outline:1px solid #fff;outline-offset:-1px}input.vis-configuration.vis-config-range::-ms-track{background:transparent;border-color:transparent;border-width:6px 0;color:transparent;height:5px;width:300px}input.vis-configuration.vis-config-range::-ms-fill-lower{background:#777;border-radius:10px}input.vis-configuration.vis-config-range::-ms-fill-upper{background:#ddd;border-radius:10px}input.vis-configuration.vis-config-range::-ms-thumb{background:#385380;border:none;border-radius:50%;height:16px;width:16px}input.vis-configuration.vis-config-range:focus::-ms-fill-lower{background:#888}input.vis-configuration.vis-config-range:focus::-ms-fill-upper{background:#ccc}.vis-configuration-popup{background:rgba(57,76,89,.85);border:2px solid #f2faff;border-radius:4px;color:#fff;font-size:14px;height:30px;line-height:30px;position:absolute;text-align:center;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out;width:150px}.vis-configuration-popup:after,.vis-configuration-popup:before{border:solid transparent;content:" ";height:0;left:100%;pointer-events:none;position:absolute;top:50%;width:0}.vis-configuration-popup:after{border-color:rgba(136,183,213,0) rgba(136,183,213,0) rgba(136,183,213,0) rgba(57,76,89,.85);border-width:8px;margin-top:-8px}.vis-configuration-popup:before{border-color:rgba(194,225,245,0) rgba(194,225,245,0) rgba(194,225,245,0) #f2faff;border-width:12px;margin-top:-12px}');UI("div.vis-tooltip{background-color:#f5f4ed;border:1px solid #808074;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;box-shadow:3px 3px 10px rgba(0,0,0,.2);color:#000;font-family:verdana;font-size:14px;padding:5px;pointer-events:none;position:absolute;visibility:hidden;white-space:nowrap;z-index:5}");var KI={exports:{}};!function(g){function A(g){if(g)return function(g){for(var C in A.prototype)g[C]=A.prototype[C];return g}(g)}g.exports=A,A.prototype.on=A.prototype.addEventListener=function(g,A){return this._callbacks=this._callbacks||{},(this._callbacks["$"+g]=this._callbacks["$"+g]||[]).push(A),this},A.prototype.once=function(g,A){function C(){this.off(g,C),A.apply(this,arguments)}return C.fn=A,this.on(g,C),this},A.prototype.off=A.prototype.removeListener=A.prototype.removeAllListeners=A.prototype.removeEventListener=function(g,A){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var C,I=this._callbacks["$"+g];if(!I)return this;if(1==arguments.length)return delete this._callbacks["$"+g],this;for(var t=0;t9007199254740991)throw JI("Maximum allowed index exceeded");return g},$I=yA,gt=JA,At=G,Ct=function(g,A,C){var I=$I(A);I in g?gt.f(g,I,At(0,C)):g[I]=C},It={};It[dA("toStringTag")]="z";var tt="[object z]"===String(It),et=tt,it=T,ot=m,st=dA("toStringTag"),nt=Object,rt="Arguments"===ot(function(){return arguments}()),at=et?ot:function(g){var A,C,I;return void 0===g?"Undefined":null===g?"Null":"string"==typeof(C=function(g,A){try{return g[A]}catch(g){}}(A=nt(g),st))?C:rt?ot(A):"Object"===(I=ot(A))&&it(A.callee)?"Arguments":I},dt=T,ht=Wg,lt=u(Function.toString);dt(ht.inspectSource)||(ht.inspectSource=function(g){return lt(g)});var ct=ht.inspectSource,ut=u,pt=e,ft=T,bt=at,mt=ct,vt=function(){},yt=[],wt=ig("Reflect","construct"),xt=/^\s*(?:class|function)\b/,Et=ut(xt.exec),Ot=!xt.test(vt),Tt=function(g){if(!ft(g))return!1;try{return wt(vt,yt,g),!0}catch(g){return!1}},Dt=function(g){if(!ft(g))return!1;switch(bt(g)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Ot||!!Et(xt,mt(g))}catch(g){return!0}};Dt.sham=!0;var Nt=!wt||pt((function(){var g;return Tt(Tt.call)||!Tt(Object)||!Tt((function(){g=!0}))||g}))?Dt:Tt,kt=_I,Rt=Nt,Pt=gg,Mt=dA("species"),zt=Array,Bt=function(g){var A;return kt(g)&&(A=g.constructor,(Rt(A)&&(A===zt||kt(A.prototype))||Pt(A)&&null===(A=A[Mt]))&&(A=void 0)),void 0===A?zt:A},Zt=function(g,A){return new(Bt(g))(0===A?0:A)},St=e,Ft=cg,Gt=dA("species"),Lt=function(g){return Ft>=51||!St((function(){var A=[];return(A.constructor={})[Gt]=function(){return{foo:1}},1!==A[g](Boolean).foo}))},jt=DC,Vt=e,Yt=_I,Wt=gg,Qt=Xg,Ut=LC,Kt=qI,Ht=Ct,Xt=Zt,_t=Lt,Jt=cg,qt=dA("isConcatSpreadable"),$t=Jt>=51||!Vt((function(){var g=[];return g[qt]=!1,g.concat()[0]!==g})),ge=function(g){if(!Wt(g))return!1;var A=g[qt];return void 0!==A?!!A:Yt(g)};jt({target:"Array",proto:!0,arity:1,forced:!$t||!_t("concat")},{concat:function(g){var A,C,I,t,e,i=Qt(this),o=Xt(i,0),s=0;for(A=-1,I=arguments.length;Ai;)oe.f(g,C=t[i++],I[C]);return g};var ae,de=ig("document","documentElement"),he=IA,le=Ug("keys"),ce=function(g){return le[g]||(le[g]=he(g))},ue=CC,pe=te,fe=$C,be=UC,me=de,ve=OA,ye="prototype",we="script",xe=ce("IE_PROTO"),Ee=function(){},Oe=function(g){return"<"+we+">"+g+""},Te=function(g){g.write(Oe("")),g.close();var A=g.parentWindow.Object;return g=null,A},De=function(){try{ae=new ActiveXObject("htmlfile")}catch(g){}var g,A,C;De="undefined"!=typeof document?document.domain&&ae?Te(ae):(A=ve("iframe"),C="java"+we+":",A.style.display="none",me.appendChild(A),A.src=String(C),(g=A.contentWindow.document).open(),g.write(Oe("document.F=Object")),g.close(),g.F):Te(ae);for(var I=fe.length;I--;)delete De[ye][fe[I]];return De()};be[xe]=!0;var Ne=Object.create||function(g,A){var C;return null!==g?(Ee[ye]=ue(g),C=new Ee,Ee[ye]=null,C[xe]=g):C=De(),void 0===A?C:pe.f(C,A)},ke={},Re=qC,Pe=$C.concat("length","prototype");ke.f=Object.getOwnPropertyNames||function(g){return Re(g,Pe)};var Me={},ze=ZC,Be=LC,Ze=Ct,Se=Array,Fe=Math.max,Ge=function(g,A,C){for(var I=Be(g),t=ze(A,I),e=ze(void 0===C?I:C,I),i=Se(Fe(e-t,0)),o=0;tf;f++)if((o||f in c)&&(h=u(d=c[f],f,l),g))if(A)m[f]=h;else if(h)switch(g){case 3:return!0;case 5:return d;case 6:return f;case 2:ji(m,d)}else switch(g){case 4:return!1;case 7:ji(m,d)}return e?-1:I||t?t:m}},Yi={forEach:Vi(0),map:Vi(1),filter:Vi(2),some:Vi(3),every:Vi(4),find:Vi(5),findIndex:Vi(6),filterReject:Vi(7)},Wi=DC,Qi=t,Ui=P,Ki=u,Hi=N,Xi=bg,_i=e,Ji=qg,qi=og,$i=CC,go=J,Ao=yA,Co=Ie,Io=G,to=Ne,eo=CI,io=ke,oo=Me,so=II,no=D,ro=JA,ao=te,ho=M,lo=Ue,co=He,uo=Ug,po=UC,fo=IA,bo=dA,mo=Xe,vo=ti,yo=ni,wo=fi,xo=Bi,Eo=Yi.forEach,Oo=ce("hidden"),To="Symbol",Do="prototype",No=xo.set,ko=xo.getterFor(To),Ro=Object[Do],Po=Qi.Symbol,Mo=Po&&Po[Do],zo=Qi.RangeError,Bo=Qi.TypeError,Zo=Qi.QObject,So=no.f,Fo=ro.f,Go=oo.f,Lo=ho.f,jo=Ki([].push),Vo=uo("symbols"),Yo=uo("op-symbols"),Wo=uo("wks"),Qo=!Zo||!Zo[Do]||!Zo[Do].findChild,Uo=function(g,A,C){var I=So(Ro,A);I&&delete Ro[A],Fo(g,A,C),I&&g!==Ro&&Fo(Ro,A,I)},Ko=Hi&&_i((function(){return 7!==to(Fo({},"a",{get:function(){return Fo(this,"a",{value:7}).a}})).a}))?Uo:Fo,Ho=function(g,A){var C=Vo[g]=to(Mo);return No(C,{type:To,tag:g,description:A}),Hi||(C.description=A),C},Xo=function(g,A,C){g===Ro&&Xo(Yo,A,C),$i(g);var I=Ao(A);return $i(C),Ji(Vo,I)?(C.enumerable?(Ji(g,Oo)&&g[Oo][I]&&(g[Oo][I]=!1),C=to(C,{enumerable:Io(0,!1)})):(Ji(g,Oo)||Fo(g,Oo,Io(1,{})),g[Oo][I]=!0),Ko(g,I,C)):Fo(g,I,C)},_o=function(g,A){$i(g);var C=go(A),I=eo(C).concat(gs(C));return Eo(I,(function(A){Hi&&!Ui(Jo,C,A)||Xo(g,A,C[A])})),g},Jo=function(g){var A=Ao(g),C=Ui(Lo,this,A);return!(this===Ro&&Ji(Vo,A)&&!Ji(Yo,A))&&(!(C||!Ji(this,A)||!Ji(Vo,A)||Ji(this,Oo)&&this[Oo][A])||C)},qo=function(g,A){var C=go(g),I=Ao(A);if(C!==Ro||!Ji(Vo,I)||Ji(Yo,I)){var t=So(C,I);return!t||!Ji(Vo,I)||Ji(C,Oo)&&C[Oo][I]||(t.enumerable=!0),t}},$o=function(g){var A=Go(go(g)),C=[];return Eo(A,(function(g){Ji(Vo,g)||Ji(po,g)||jo(C,g)})),C},gs=function(g){var A=g===Ro,C=Go(A?Yo:go(g)),I=[];return Eo(C,(function(g){!Ji(Vo,g)||A&&!Ji(Ro,g)||jo(I,Vo[g])})),I};Xi||(Po=function(){if(qi(Mo,this))throw new Bo("Symbol is not a constructor");var g=arguments.length&&void 0!==arguments[0]?Co(arguments[0]):void 0,A=fo(g),C=function(g){this===Ro&&Ui(C,Yo,g),Ji(this,Oo)&&Ji(this[Oo],A)&&(this[Oo][A]=!1);var I=Io(1,g);try{Ko(this,A,I)}catch(g){if(!(g instanceof zo))throw g;Uo(this,A,I)}};return Hi&&Qo&&Ko(Ro,A,{configurable:!0,set:C}),Ho(A,g)},lo(Mo=Po[Do],"toString",(function(){return ko(this).tag})),lo(Po,"withoutSetter",(function(g){return Ho(fo(g),g)})),ho.f=Jo,ro.f=Xo,ao.f=_o,no.f=qo,io.f=oo.f=$o,so.f=gs,mo.f=function(g){return Ho(bo(g),g)},Hi&&co(Mo,"description",{configurable:!0,get:function(){return ko(this).description}})),Wi({global:!0,constructor:!0,wrap:!0,forced:!Xi,sham:!Xi},{Symbol:Po}),Eo(eo(Wo),(function(g){vo(g)})),Wi({target:To,stat:!0,forced:!Xi},{useSetter:function(){Qo=!0},useSimple:function(){Qo=!1}}),Wi({target:"Object",stat:!0,forced:!Xi,sham:!Hi},{create:function(g,A){return void 0===A?to(g):_o(to(g),A)},defineProperty:Xo,defineProperties:_o,getOwnPropertyDescriptor:qo}),Wi({target:"Object",stat:!0,forced:!Xi},{getOwnPropertyNames:$o}),yo(),wo(Po,To),po[Oo]=!0;var As=bg&&!!Symbol.for&&!!Symbol.keyFor,Cs=DC,Is=ig,ts=qg,es=Ie,is=Ug,os=As,ss=is("string-to-symbol-registry"),ns=is("symbol-to-string-registry");Cs({target:"Symbol",stat:!0,forced:!os},{for:function(g){var A=es(g);if(ts(ss,A))return ss[A];var C=Is("Symbol")(A);return ss[A]=C,ns[C]=A,C}});var rs=DC,as=qg,ds=Eg,hs=Tg,ls=As,cs=Ug("symbol-to-string-registry");rs({target:"Symbol",stat:!0,forced:!ls},{keyFor:function(g){if(!ds(g))throw new TypeError(hs(g)+" is not a symbol");if(as(cs,g))return cs[g]}});var us=_I,ps=T,fs=m,bs=Ie,ms=u([].push),vs=DC,ys=ig,ws=a,xs=P,Es=u,Os=e,Ts=T,Ds=Eg,Ns=bI,ks=function(g){if(ps(g))return g;if(us(g)){for(var A=g.length,C=[],I=0;I=A.length)return g.target=void 0,Cr(void 0,!0);switch(C){case"keys":return Cr(I,!1);case"values":return Cr(A[I],!1)}return Cr([I,A[I]],!1)}),"values"),$n.Arguments=$n.Array;var ir={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},or=t,sr=at,nr=uC,rr=An,ar=dA("toStringTag");for(var dr in ir){var hr=or[dr],lr=hr&&hr.prototype;lr&&sr(lr)!==ar&&nr(lr,ar,dr),rr[dr]=rr.Array}var cr=gn,ur=C(cr),pr=DC,fr=_I,br=Nt,mr=gg,vr=ZC,yr=LC,wr=J,xr=Ct,Er=dA,Or=bI,Tr=Lt("slice"),Dr=Er("species"),Nr=Array,kr=Math.max;pr({target:"Array",proto:!0,forced:!Tr},{slice:function(g,A){var C,I,t,e=wr(this),i=yr(e),o=vr(g,i),s=vr(void 0===A?i:A,i);if(fr(e)&&(C=e.constructor,(br(C)&&(C===Nr||fr(C.prototype))||mr(C)&&null===(C=C[Dr]))&&(C=void 0),C===Nr||void 0===C))return Or(e,o,s);for(I=new(void 0===C?Nr:C)(kr(s-o,0)),t=0;o1?arguments[1]:void 0)}});var Ur=MI("Array").map,Kr=og,Hr=Ur,Xr=Array.prototype,_r=function(g){var A=g.map;return g===Xr||Kr(Xr,g)&&A===Xr.map?Hr:A},Jr=C(_r),qr=Xg,$r=CI;DC({target:"Object",stat:!0,forced:e((function(){$r(1)}))},{keys:function(g){return $r(qr(g))}});var ga=C(Ag.Object.keys),Aa=DC,Ca=Date,Ia=u(Ca.prototype.getTime);Aa({target:"Date",stat:!0},{now:function(){return Ia(new Ca)}});var ta=C(Ag.Date.now),ea=e,ia=function(g,A){var C=[][g];return!!C&&ea((function(){C.call(null,A||function(){return 1},1)}))},oa=Yi.forEach,sa=ia("forEach")?[].forEach:function(g){return oa(this,g,arguments.length>1?arguments[1]:void 0)};DC({target:"Array",proto:!0,forced:[].forEach!==sa},{forEach:sa});var na=MI("Array").forEach,ra=at,aa=qg,da=og,ha=na,la=Array.prototype,ca={DOMTokenList:!0,NodeList:!0},ua=function(g){var A=g.forEach;return g===la||da(la,g)&&A===la.forEach||aa(ca,ra(g))?ha:A},pa=C(ua),fa=DC,ba=_I,ma=u([].reverse),va=[1,2];fa({target:"Array",proto:!0,forced:String(va)===String(va.reverse())},{reverse:function(){return ba(this)&&(this.length=this.length),ma(this)}});var ya=MI("Array").reverse,wa=og,xa=ya,Ea=Array.prototype,Oa=function(g){var A=g.reverse;return g===Ea||wa(Ea,g)&&A===Ea.reverse?xa:A},Ta=C(Oa),Da=N,Na=_I,ka=TypeError,Ra=Object.getOwnPropertyDescriptor,Pa=Da&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(g){return g instanceof TypeError}}(),Ma=Tg,za=TypeError,Ba=function(g,A){if(!delete g[A])throw new za("Cannot delete property "+Ma(A)+" of "+Ma(g))},Za=DC,Sa=Xg,Fa=ZC,Ga=PC,La=LC,ja=Pa?function(g,A){if(Na(g)&&!Ra(g,"length").writable)throw new ka("Cannot set read only .length");return g.length=A}:function(g,A){return g.length=A},Va=qI,Ya=Zt,Wa=Ct,Qa=Ba,Ua=Lt("splice"),Ka=Math.max,Ha=Math.min;Za({target:"Array",proto:!0,forced:!Ua},{splice:function(g,A){var C,I,t,e,i,o,s=Sa(this),n=La(s),r=Fa(g,n),a=arguments.length;for(0===a?C=I=0:1===a?(C=0,I=n-r):(C=a-2,I=Ha(Ka(Ga(A),0),n-r)),Va(n+C-I),t=Ya(s,I),e=0;en-I+C;e--)Qa(s,e-1)}else if(C>I)for(e=n-I;e>r;e--)o=e+C-1,(i=e+I-1)in s?s[o]=s[i]:Qa(s,o);for(e=0;e1?arguments[1]:void 0)}});var Cd=MI("Array").includes,Id=gg,td=m,ed=dA("match"),id=function(g){var A;return Id(g)&&(void 0!==(A=g[ed])?!!A:"RegExp"===td(g))},od=TypeError,sd=dA("match"),nd=DC,rd=function(g){if(id(g))throw new od("The method doesn't accept regular expressions");return g},ad=H,dd=Ie,hd=function(g){var A=/./;try{"/./"[g](A)}catch(C){try{return A[sd]=!1,"/./"[g](A)}catch(g){}}return!1},ld=u("".indexOf);nd({target:"String",proto:!0,forced:!hd("includes")},{includes:function(g){return!!~ld(dd(ad(this)),dd(rd(g)),arguments.length>1?arguments[1]:void 0)}});var cd=MI("String").includes,ud=og,pd=Cd,fd=cd,bd=Array.prototype,md=String.prototype,vd=function(g){var A=g.includes;return g===bd||ud(bd,g)&&A===bd.includes?pd:"string"==typeof g||g===md||ud(md,g)&&A===md.includes?fd:A},yd=C(vd),wd=Xg,xd=pn,Ed=nn;DC({target:"Object",stat:!0,forced:e((function(){xd(1)})),sham:!Ed},{getPrototypeOf:function(g){return xd(wd(g))}});var Od=C(Ag.Object.getPrototypeOf),Td=MI("Array").concat,Dd=og,Nd=Td,kd=Array.prototype,Rd=function(g){var A=g.concat;return g===kd||Dd(kd,g)&&A===kd.concat?Nd:A},Pd=C(Rd),Md=Yi.filter;DC({target:"Array",proto:!0,forced:!Lt("filter")},{filter:function(g){return Md(this,g,arguments.length>1?arguments[1]:void 0)}});var zd=MI("Array").filter,Bd=og,Zd=zd,Sd=Array.prototype,Fd=function(g){var A=g.filter;return g===Sd||Bd(Sd,g)&&A===Sd.filter?Zd:A},Gd=C(Fd),Ld=N,jd=e,Vd=u,Yd=pn,Wd=CI,Qd=J,Ud=Vd(M.f),Kd=Vd([].push),Hd=Ld&&jd((function(){var g=Object.create(null);return g[2]=2,!Ud(g,2)})),Xd=function(g){return function(A){for(var C,I=Qd(A),t=Wd(I),e=Hd&&null===Yd(I),i=t.length,o=0,s=[];i>o;)C=t[o++],Ld&&!(e?C in I:Ud(I,C))||Kd(s,g?[C,I[C]]:I[C]);return s}},_d={entries:Xd(!0),values:Xd(!1)}.values;DC({target:"Object",stat:!0},{values:function(g){return _d(g)}});var Jd=C(Ag.Object.values),qd="\t\n\v\f\r                 \u2028\u2029\ufeff",$d=H,gh=Ie,Ah=qd,Ch=u("".replace),Ih=RegExp("^["+Ah+"]+"),th=RegExp("(^|[^"+Ah+"])["+Ah+"]+$"),eh=function(g){return function(A){var C=gh($d(A));return 1&g&&(C=Ch(C,Ih,"")),2&g&&(C=Ch(C,th,"$1")),C}},ih={start:eh(1),end:eh(2),trim:eh(3)},oh=t,sh=e,nh=u,rh=Ie,ah=ih.trim,dh=qd,hh=oh.parseInt,lh=oh.Symbol,ch=lh&&lh.iterator,uh=/^[+-]?0x/i,ph=nh(uh.exec),fh=8!==hh(dh+"08")||22!==hh(dh+"0x16")||ch&&!sh((function(){hh(Object(ch))}))?function(g,A){var C=ah(rh(g));return hh(C,A>>>0||(ph(uh,C)?16:10))}:hh;DC({global:!0,forced:parseInt!==fh},{parseInt:fh});var bh=C(Ag.parseInt),mh=DC,vh=QC.indexOf,yh=ia,wh=w([].indexOf),xh=!!wh&&1/wh([1],1,-0)<0;mh({target:"Array",proto:!0,forced:xh||!yh("indexOf")},{indexOf:function(g){var A=arguments.length>1?arguments[1]:void 0;return xh?wh(this,g,A)||0:vh(this,g,A)}});var Eh=MI("Array").indexOf,Oh=og,Th=Eh,Dh=Array.prototype,Nh=function(g){var A=g.indexOf;return g===Dh||Oh(Dh,g)&&A===Dh.indexOf?Th:A},kh=C(Nh);DC({target:"Object",stat:!0,sham:!N},{create:Ne});var Rh=Ag.Object,Ph=C((function(g,A){return Rh.create(g,A)})),Mh=Ag,zh=a;Mh.JSON||(Mh.JSON={stringify:JSON.stringify});var Bh=function(g,A,C){return zh(Mh.JSON.stringify,null,arguments)},Zh=C(Bh),Sh="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,Fh=TypeError,Gh=t,Lh=a,jh=T,Vh=Sh,Yh=sg,Wh=bI,Qh=function(g,A){if(gC,i=jh(I)?I:Uh(I),o=e?Wh(arguments,C):[],s=e?function(){Lh(i,this,o)}:i;return A?g(s,t):g(s)}:g},Xh=DC,_h=t,Jh=Hh(_h.setInterval,!0);Xh({global:!0,bind:!0,forced:_h.setInterval!==Jh},{setInterval:Jh});var qh=DC,$h=t,gl=Hh($h.setTimeout,!0);qh({global:!0,bind:!0,forced:$h.setTimeout!==gl},{setTimeout:gl});var Al=C(Ag.setTimeout),Cl=Xg,Il=ZC,tl=LC,el=function(g){for(var A=Cl(this),C=tl(A),I=arguments.length,t=Il(I>1?arguments[1]:void 0,C),e=I>2?arguments[2]:void 0,i=void 0===e?C:Il(e,C);i>t;)A[t++]=g;return A};DC({target:"Array",proto:!0},{fill:el});var il,ol=MI("Array").fill,sl=og,nl=ol,rl=Array.prototype,al=function(g){var A=g.fill;return g===rl||sl(rl,g)&&A===rl.fill?nl:A},dl=C(al); /*! Hammer.JS - v2.0.17-rc - 2019-12-16 * http://naver.github.io/egjs * * Forked By Naver egjs * Copyright (c) hammerjs * Licensed under the MIT license */ function hl(){return hl=Object.assign||function(g){for(var A=1;A-1}var Ac=function(){function g(g,A){this.manager=g,this.set(A)}var A=g.prototype;return A.set=function(g){g===Ol&&(g=this.compute()),El&&this.manager.element.style&&Pl[g]&&(this.manager.element.style[xl]=g),this.actions=g.toLowerCase().trim()},A.update=function(){this.set(this.manager.options.touchAction)},A.compute=function(){var g=[];return ql(this.manager.recognizers,(function(A){$l(A.options.enable,[A])&&(g=g.concat(A.getTouchAction()))})),function(g){if(gc(g,Nl))return Nl;var A=gc(g,kl),C=gc(g,Rl);return A&&C?Nl:A||C?A?kl:Rl:gc(g,Dl)?Dl:Tl}(g.join(" "))},A.preventDefaults=function(g){var A=g.srcEvent,C=g.offsetDirection;if(this.manager.session.prevented)A.preventDefault();else{var I=this.actions,t=gc(I,Nl)&&!Pl[Nl],e=gc(I,Rl)&&!Pl[Rl],i=gc(I,kl)&&!Pl[kl];if(t){var o=1===g.pointers.length,s=g.distance<2,n=g.deltaTime<250;if(o&&s&&n)return}if(!i||!e)return t||e&&C&Kl||i&&C&Hl?this.preventSrc(A):void 0}},A.preventSrc=function(g){this.manager.session.prevented=!0,g.preventDefault()},g}();function Cc(g,A){for(;g;){if(g===A)return!0;g=g.parentNode}return!1}function Ic(g){var A=g.length;if(1===A)return{x:ml(g[0].clientX),y:ml(g[0].clientY)};for(var C=0,I=0,t=0;t=vl(A)?g<0?Yl:Wl:A<0?Ql:Ul}function sc(g,A,C){return{x:A/g||0,y:C/g||0}}function nc(g,A){var C=g.session,I=A.pointers,t=I.length;C.firstInput||(C.firstInput=tc(A)),t>1&&!C.firstMultiple?C.firstMultiple=tc(A):1===t&&(C.firstMultiple=!1);var e=C.firstInput,i=C.firstMultiple,o=i?i.center:e.center,s=A.center=Ic(I);A.timeStamp=yl(),A.deltaTime=A.timeStamp-e.timeStamp,A.angle=ic(o,s),A.distance=ec(o,s),function(g,A){var C=A.center,I=g.offsetDelta||{},t=g.prevDelta||{},e=g.prevInput||{};A.eventType!==Gl&&e.eventType!==Ll||(t=g.prevDelta={x:e.deltaX||0,y:e.deltaY||0},I=g.offsetDelta={x:C.x,y:C.y}),A.deltaX=t.x+(C.x-I.x),A.deltaY=t.y+(C.y-I.y)}(C,A),A.offsetDirection=oc(A.deltaX,A.deltaY);var n,r,a=sc(A.deltaTime,A.deltaX,A.deltaY);A.overallVelocityX=a.x,A.overallVelocityY=a.y,A.overallVelocity=vl(a.x)>vl(a.y)?a.x:a.y,A.scale=i?(n=i.pointers,ec((r=I)[0],r[1],Jl)/ec(n[0],n[1],Jl)):1,A.rotation=i?function(g,A){return ic(A[1],A[0],Jl)+ic(g[1],g[0],Jl)}(i.pointers,I):0,A.maxPointers=C.prevInput?A.pointers.length>C.prevInput.maxPointers?A.pointers.length:C.prevInput.maxPointers:A.pointers.length,function(g,A){var C,I,t,e,i=g.lastInterval||A,o=A.timeStamp-i.timeStamp;if(A.eventType!==jl&&(o>Fl||void 0===i.velocity)){var s=A.deltaX-i.deltaX,n=A.deltaY-i.deltaY,r=sc(o,s,n);I=r.x,t=r.y,C=vl(r.x)>vl(r.y)?r.x:r.y,e=oc(s,n),g.lastInterval=A}else C=i.velocity,I=i.velocityX,t=i.velocityY,e=i.direction;A.velocity=C,A.velocityX=I,A.velocityY=t,A.direction=e}(C,A);var d,h=g.element,l=A.srcEvent;Cc(d=l.composedPath?l.composedPath()[0]:l.path?l.path[0]:l.target,h)&&(h=d),A.target=h}function rc(g,A,C){var I=C.pointers.length,t=C.changedPointers.length,e=A&Gl&&I-t==0,i=A&(Ll|jl)&&I-t==0;C.isFirst=!!e,C.isFinal=!!i,e&&(g.session={}),C.eventType=A,nc(g,C),g.emit("hammer.input",C),g.recognize(C),g.session.prevInput=C}function ac(g){return g.trim().split(/\s+/g)}function dc(g,A,C){ql(ac(A),(function(A){g.addEventListener(A,C,!1)}))}function hc(g,A,C){ql(ac(A),(function(A){g.removeEventListener(A,C,!1)}))}function lc(g){var A=g.ownerDocument||g;return A.defaultView||A.parentWindow||window}var cc=function(){function g(g,A){var C=this;this.manager=g,this.callback=A,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(A){$l(g.options.enable,[g])&&C.handler(A)},this.init()}var A=g.prototype;return A.handler=function(){},A.init=function(){this.evEl&&dc(this.element,this.evEl,this.domHandler),this.evTarget&&dc(this.target,this.evTarget,this.domHandler),this.evWin&&dc(lc(this.element),this.evWin,this.domHandler)},A.destroy=function(){this.evEl&&hc(this.element,this.evEl,this.domHandler),this.evTarget&&hc(this.target,this.evTarget,this.domHandler),this.evWin&&hc(lc(this.element),this.evWin,this.domHandler)},g}();function uc(g,A,C){if(g.indexOf&&!C)return g.indexOf(A);for(var I=0;IC[A]})):I.sort()),I}var xc={touchstart:Gl,touchmove:2,touchend:Ll,touchcancel:jl},Ec=function(g){function A(){var C;return A.prototype.evTarget="touchstart touchmove touchend touchcancel",(C=g.apply(this,arguments)||this).targetIds={},C}return ll(A,g),A.prototype.handler=function(g){var A=xc[g.type],C=Oc.call(this,g,A);C&&this.callback(this.manager,A,{pointers:C[0],changedPointers:C[1],pointerType:Zl,srcEvent:g})},A}(cc);function Oc(g,A){var C,I,t=yc(g.touches),e=this.targetIds;if(A&(2|Gl)&&1===t.length)return e[t[0].identifier]=!0,[t,t];var i=yc(g.changedTouches),o=[],s=this.target;if(I=t.filter((function(g){return Cc(g.target,s)})),A===Gl)for(C=0;C-1&&I.splice(g,1)}),Nc)}}function Rc(g,A){g&Gl?(this.primaryTouch=A.changedPointers[0].identifier,kc.call(this,A)):g&(Ll|jl)&&kc.call(this,A)}function Pc(g){for(var A=g.srcEvent.clientX,C=g.srcEvent.clientY,I=0;I-1&&this.requireFail.splice(A,1),this},A.hasRequireFailures=function(){return this.requireFail.length>0},A.canRecognizeWith=function(g){return!!this.simultaneous[g.id]},A.emit=function(g){var A=this,C=this.state;function I(C){A.manager.emit(C,g)}C<8&&I(A.options.event+Fc(C)),I(A.options.event),g.additionalEvent&&I(g.additionalEvent),C>=8&&I(A.options.event+Fc(C))},A.tryEmit=function(g){if(this.canEmit())return this.emit(g);this.state=Bc},A.canEmit=function(){for(var g=0;gA.threshold&&t&A.direction},C.attrTest=function(g){return jc.prototype.attrTest.call(this,g)&&(2&this.state||!(2&this.state)&&this.directionTest(g))},C.emit=function(A){this.pX=A.deltaX,this.pY=A.deltaY;var C=Vc(A.direction);C&&(A.additionalEvent=this.options.event+C),g.prototype.emit.call(this,A)},A}(jc),Wc=function(g){function A(A){return void 0===A&&(A={}),g.call(this,hl({event:"swipe",threshold:10,velocity:.3,direction:Kl|Hl,pointers:1},A))||this}ll(A,g);var C=A.prototype;return C.getTouchAction=function(){return Yc.prototype.getTouchAction.call(this)},C.attrTest=function(A){var C,I=this.options.direction;return I&(Kl|Hl)?C=A.overallVelocity:I&Kl?C=A.overallVelocityX:I&Hl&&(C=A.overallVelocityY),g.prototype.attrTest.call(this,A)&&I&A.offsetDirection&&A.distance>this.options.threshold&&A.maxPointers===this.options.pointers&&vl(C)>this.options.velocity&&A.eventType&Ll},C.emit=function(g){var A=Vc(g.offsetDirection);A&&this.manager.emit(this.options.event+A,g),this.manager.emit(this.options.event,g)},A}(jc),Qc=function(g){function A(A){return void 0===A&&(A={}),g.call(this,hl({event:"pinch",threshold:0,pointers:2},A))||this}ll(A,g);var C=A.prototype;return C.getTouchAction=function(){return[Nl]},C.attrTest=function(A){return g.prototype.attrTest.call(this,A)&&(Math.abs(A.scale-1)>this.options.threshold||2&this.state)},C.emit=function(A){if(1!==A.scale){var C=A.scale<1?"in":"out";A.additionalEvent=this.options.event+C}g.prototype.emit.call(this,A)},A}(jc),Uc=function(g){function A(A){return void 0===A&&(A={}),g.call(this,hl({event:"rotate",threshold:0,pointers:2},A))||this}ll(A,g);var C=A.prototype;return C.getTouchAction=function(){return[Nl]},C.attrTest=function(A){return g.prototype.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||2&this.state)},A}(jc),Kc=function(g){function A(A){var C;return void 0===A&&(A={}),(C=g.call(this,hl({event:"press",pointers:1,time:251,threshold:9},A))||this)._timer=null,C._input=null,C}ll(A,g);var C=A.prototype;return C.getTouchAction=function(){return[Tl]},C.process=function(g){var A=this,C=this.options,I=g.pointers.length===C.pointers,t=g.distanceC.time;if(this._input=g,!t||!I||g.eventType&(Ll|jl)&&!e)this.reset();else if(g.eventType&Gl)this.reset(),this._timer=setTimeout((function(){A.state=8,A.tryEmit()}),C.time);else if(g.eventType&Ll)return 8;return Bc},C.reset=function(){clearTimeout(this._timer)},C.emit=function(g){8===this.state&&(g&&g.eventType&Ll?this.manager.emit(this.options.event+"up",g):(this._input.timeStamp=yl(),this.manager.emit(this.options.event,this._input)))},A}(Gc),Hc={domEvents:!1,touchAction:Ol,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Xc=[[Uc,{enable:!1}],[Qc,{enable:!1},["rotate"]],[Wc,{direction:Kl}],[Yc,{direction:Kl},["swipe"]],[Lc],[Lc,{event:"doubletap",taps:2},["tap"]],[Kc]];function _c(g,A){var C,I=g.element;I.style&&(ql(g.options.cssProps,(function(t,e){C=wl(I.style,e),A?(g.oldCssProps[C]=I.style[C],I.style[C]=t):I.style[C]=g.oldCssProps[C]||""})),A||(g.oldCssProps={}))}var Jc=function(){function g(g,A){var C,I=this;this.options=pl({},Hc,A||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=new((C=this).options.inputClass||(zl?vc:Bl?Ec:Ml?Mc:Dc))(C,rc),this.touchAction=new Ac(this,this.options.touchAction),_c(this,!0),ql(this.options.recognizers,(function(g){var A=I.add(new g[0](g[1]));g[2]&&A.recognizeWith(g[2]),g[3]&&A.requireFailure(g[3])}),this)}var A=g.prototype;return A.set=function(g){return pl(this.options,g),g.touchAction&&this.touchAction.update(),g.inputTarget&&(this.input.destroy(),this.input.target=g.inputTarget,this.input.init()),this},A.stop=function(g){this.session.stopped=g?2:1},A.recognize=function(g){var A=this.session;if(!A.stopped){var C;this.touchAction.preventDefaults(g);var I=this.recognizers,t=A.curRecognizer;(!t||t&&8&t.state)&&(A.curRecognizer=null,t=null);for(var e=0;e\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",t=window.console&&(window.console.warn||window.console.log);return t&&t.call(window.console,I,C),g.apply(this,arguments)}}var Cu=Au((function(g,A,C){for(var I=Object.keys(A),t=0;t2)return ru(nu(A[0],A[1]),...Zr(A).call(A,2));const I=A[0],t=A[1];if(I instanceof Date&&t instanceof Date)return I.setTime(t.getTime()),I;for(const g of Yr(t))Object.prototype.propertyIsEnumerable.call(t,g)&&(t[g]===su?delete I[g]:null===I[g]||null===t[g]||"object"!=typeof I[g]||"object"!=typeof t[g]||Wr(I[g])||Wr(t[g])?I[g]=au(t[g]):I[g]=ru(I[g],t[g]));return I}function au(g){return Wr(g)?Jr(g).call(g,(g=>au(g))):"object"==typeof g&&null!==g?g instanceof Date?new Date(g.getTime()):ru({},g):g}function du(g){for(const A of ga(g))g[A]===su?delete g[A]:"object"==typeof g[A]&&null!==g[A]&&du(g[A])}function hu(){for(var g=arguments.length,A=new Array(g),C=0;C>>0,I-=g,I*=g,g=I>>>0,I-=g,g+=4294967296*I}return 2.3283064365386963e-10*(g>>>0)}}();let A=g(" "),C=g(" "),I=g(" ");for(let t=0;t{const g=2091639*A+2.3283064365386963e-10*t;return A=C,C=I,I=g-(t=0|g)};return e.uint32=()=>4294967296*e(),e.fract53=()=>e()+11102230246251565e-32*(2097152*e()|0),e.algorithm="Alea",e.seed=g,e.version="0.9",e}(A.length?A:[ta()])}const lu="undefined"!=typeof window?window.Hammer||ou:function(){return function(){const g=()=>{};return{on:g,off:g,destroy:g,emit:g,get:()=>({set:g})}}()};function cu(g){var A;this._cleanupQueue=[],this.active=!1,this._dom={container:g,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push((()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)}));const C=lu(this._dom.overlay);C.on("tap",GI(A=this._onTapOverlay).call(A,this)),this._cleanupQueue.push((()=>{C.destroy()}));const I=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];pa(I).call(I,(g=>{C.on(g,(g=>{g.srcEvent.stopPropagation()}))})),document&&document.body&&(this._onClick=A=>{(function(g,A){for(;g;){if(g===A)return!0;g=g.parentNode}return!1})(A.target,g)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push((()=>{document.body.removeEventListener("click",this._onClick)}))),this._escListener=g=>{("key"in g?"Escape"===g.key:27===g.keyCode)&&this.deactivate()}}HI(cu.prototype),cu.current=null,cu.prototype.destroy=function(){this.deactivate();for(const C of Ta(g=gd(A=this._cleanupQueue).call(A,0)).call(g)){var g,A;C()}},cu.prototype.activate=function(){cu.current&&cu.current.deactivate(),cu.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)},cu.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")},cu.prototype._onTapOverlay=function(g){this.activate(),g.srcEvent.stopPropagation()};const uu=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,pu=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,fu=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,bu=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function mu(g){if(g)for(;!0===g.hasChildNodes();){const A=g.firstChild;A&&(mu(A),g.removeChild(A))}}function vu(g){return g instanceof String||"string"==typeof g}function yu(g){return"object"==typeof g&&null!==g}function wu(g,A,C,I){let t=!1;!0===I&&(t=null===A[C]&&void 0!==g[C]),t?delete g[C]:g[C]=A[C]}function xu(g,A){let C=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(const I in g)if(void 0!==A[I])if(null===A[I]||"object"!=typeof A[I])wu(g,A,I,C);else{const t=g[I],e=A[I];yu(t)&&yu(e)&&xu(t,e,C)}}function Eu(g,A,C){let I=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Wr(C))throw new TypeError("Arrays are not supported by deepExtend");for(let t=0;t3&&void 0!==arguments[3]&&arguments[3];if(Wr(C))throw new TypeError("Arrays are not supported by deepExtend");for(const t in C)if(Object.prototype.hasOwnProperty.call(C,t)&&!yd(g).call(g,t))if(C[t]&&C[t].constructor===Object)void 0===A[t]&&(A[t]={}),A[t].constructor===Object?Tu(A[t],C[t]):wu(A,C,t,I);else if(Wr(C[t])){A[t]=[];for(let g=0;g2&&void 0!==arguments[2]&&arguments[2],I=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(const e in A)if(Object.prototype.hasOwnProperty.call(A,e)||!0===C)if("object"==typeof A[e]&&null!==A[e]&&Od(A[e])===Object.prototype)void 0===g[e]?g[e]=Tu({},A[e],C):"object"==typeof g[e]&&null!==g[e]&&Od(g[e])===Object.prototype?Tu(g[e],A[e],C):wu(g,A,e,I);else if(Wr(A[e])){var t;g[e]=Zr(t=A[e]).call(t)}else wu(g,A,e,I);return g}function Du(g,A){return[...g,A]}function Nu(g){return g.getBoundingClientRect().top}function ku(g,A){if(Wr(g)){const C=g.length;for(let I=0;I3&&void 0!==arguments[3]?arguments[3]:{};const t=function(g){return null!=g},e=function(g){return null!==g&&"object"==typeof g};if(!e(g))throw new Error("Parameter mergeTarget must be an object");if(!e(A))throw new Error("Parameter options must be an object");if(!t(C))throw new Error("Parameter option must have a value");if(!e(I))throw new Error("Parameter globalOptions must be an object");const i=A[C],o=e(I)&&!function(g){for(const A in g)if(Object.prototype.hasOwnProperty.call(g,A))return!1;return!0}(I)?I[C]:void 0,s=o?o.enabled:void 0;if(void 0===i)return;if("boolean"==typeof i)return e(g[C])||(g[C]={}),void(g[C].enabled=i);if(null===i&&!e(g[C])){if(!t(o))return;g[C]=Ph(o)}if(!e(i))return;let n=!0;void 0!==i.enabled?n=i.enabled:void 0!==s&&(n=o.enabled),function(g,A,C){e(g[C])||(g[C]={});const I=A[C],t=g[C];for(const g in I)Object.prototype.hasOwnProperty.call(I,g)&&(t[g]=I[g])}(g,A,C),g[C].enabled=n}const Vu={linear:g=>g,easeInQuad:g=>g*g,easeOutQuad:g=>g*(2-g),easeInOutQuad:g=>g<.5?2*g*g:(4-2*g)*g-1,easeInCubic:g=>g*g*g,easeOutCubic:g=>--g*g*g+1,easeInOutCubic:g=>g<.5?4*g*g*g:(g-1)*(2*g-2)*(2*g-2)+1,easeInQuart:g=>g*g*g*g,easeOutQuart:g=>1- --g*g*g*g,easeInOutQuart:g=>g<.5?8*g*g*g*g:1-8*--g*g*g*g,easeInQuint:g=>g*g*g*g*g,easeOutQuint:g=>1+--g*g*g*g*g,easeInOutQuint:g=>g<.5?16*g*g*g*g*g:1+16*--g*g*g*g*g};function Yu(g,A){let C;Wr(A)||(A=[A]);for(const I of g)if(I){C=I[A[0]];for(let g=1;g0&&void 0!==arguments[0]?arguments[0]:1;this.pixelRatio=g,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=()=>{},this.closeCallback=()=>{},this._create()}insertTo(g){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=g,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(g){if("function"!=typeof g)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=g}setCloseCallback(g){if("function"!=typeof g)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=g}_isColorString(g){if("string"==typeof g)return Wu[g]}setColor(g){let A,C=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"===g)return;const I=this._isColorString(g);if(void 0!==I&&(g=I),!0===vu(g)){if(!0===Gu(g)){const C=g.substr(4).substr(0,g.length-5).split(",");A={r:C[0],g:C[1],b:C[2],a:1}}else if(!0===function(g){return bu.test(g)}(g)){const C=g.substr(5).substr(0,g.length-6).split(",");A={r:C[0],g:C[1],b:C[2],a:C[3]}}else if(!0===Fu(g)){const C=Ru(g);A={r:C.r,g:C.g,b:C.b,a:1}}}else if(g instanceof Object&&void 0!==g.r&&void 0!==g.g&&void 0!==g.b){const C=void 0!==g.a?g.a:"1.0";A={r:g.r,g:g.g,b:g.b,a:C}}if(void 0===A)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+Zh(g));this._setColor(A,C)}show(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(){!0===(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.previousColor=fI({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",Al((()=>{void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0)}),0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(g){!0===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&(this.initialColor=fI({},g)),this.color=g;const A=Bu(g.r,g.g,g.b),C=2*Math.PI,I=this.r*A.s,t=this.centerCoordinates.x+I*Math.sin(C*A.h),e=this.centerCoordinates.y+I*Math.cos(C*A.h);this.colorPickerSelector.style.left=t-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=e-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(g)}_setOpacity(g){this.color.a=g/100,this._updatePicker(this.color)}_setBrightness(g){const A=Bu(this.color.r,this.color.g,this.color.b);A.v=g/100;const C=Zu(A.h,A.s,A.v);C.a=this.color.a,this.color=C,this._updatePicker()}_updatePicker(){let g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color;const A=Bu(g.r,g.g,g.b),C=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(C.webkitBackingStorePixelRatio||C.mozBackingStorePixelRatio||C.msBackingStorePixelRatio||C.oBackingStorePixelRatio||C.backingStorePixelRatio||1)),C.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const I=this.colorPickerCanvas.clientWidth,t=this.colorPickerCanvas.clientHeight;C.clearRect(0,0,I,t),C.putImageData(this.hueCircle,0,0),C.fillStyle="rgba(0,0,0,"+(1-A.v)+")",C.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),dl(C).call(C),this.brightnessRange.value=100*A.v,this.opacityRange.value=100*g.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){var g,A,C,I;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){const g=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const g=document.createElement("DIV");g.style.color="red",g.style.fontWeight="bold",g.style.padding="10px",g.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(g)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(g){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(g){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);const t=this;this.opacityRange.onchange=function(){t._setOpacity(this.value)},this.opacityRange.oninput=function(){t._setOpacity(this.value)},this.brightnessRange.onchange=function(){t._setBrightness(this.value)},this.brightnessRange.oninput=function(){t._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=GI(g=this._hide).call(g,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=GI(A=this._apply).call(A,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=GI(C=this._save).call(C,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=GI(I=this._loadLast).call(I,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new lu(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",(g=>{g.isFirst&&this._moveSelector(g)})),this.hammer.on("tap",(g=>{this._moveSelector(g)})),this.hammer.on("panstart",(g=>{this._moveSelector(g)})),this.hammer.on("panmove",(g=>{this._moveSelector(g)})),this.hammer.on("panend",(g=>{this._moveSelector(g)}))}_generateHueCircle(){if(!1===this.generated){const g=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1)),g.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const A=this.colorPickerCanvas.clientWidth,C=this.colorPickerCanvas.clientHeight;let I,t,e,i;g.clearRect(0,0,A,C),this.centerCoordinates={x:.5*A,y:.5*C},this.r=.49*A;const o=2*Math.PI/360,s=1/360,n=1/this.r;let r;for(e=0;e<360;e++)for(i=0;i3&&void 0!==arguments[3]?arguments[3]:1,t=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>!1;this.parent=g,this.changedOptions=[],this.container=A,this.allowCreation=!1,this.hideOption=t,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},fI(this.options,this.defaultOptions),this.configureOptions=C,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new Qu(I),this.wrapper=void 0}setOptions(g){if(void 0!==g){this.popupHistory={},this._removePopup();let A=!0;if("string"==typeof g)this.options.filter=g;else if(Wr(g))this.options.filter=g.join();else if("object"==typeof g){if(null==g)throw new TypeError("options cannot be null");void 0!==g.container&&(this.options.container=g.container),void 0!==Gd(g)&&(this.options.filter=Gd(g)),void 0!==g.showButton&&(this.options.showButton=g.showButton),void 0!==g.enabled&&(A=g.enabled)}else"boolean"==typeof g?(this.options.filter=!0,A=g):"function"==typeof g&&(this.options.filter=g,A=!0);!1===Gd(this.options)&&(A=!1),this.options.enabled=A}this._clean()}setModuleOptions(g){this.moduleOptions=g,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];const g=Gd(this.options);let A=0,C=!1;for(const I in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,I)&&(this.allowCreation=!1,C=!1,"function"==typeof g?(C=g(I,[]),C=C||this._handleObject(this.configureOptions[I],[I],!0)):!0!==g&&-1===kh(g).call(g,I)||(C=!0),!1!==C&&(this.allowCreation=!0,A>0&&this._makeItem([]),this._makeHeader(I),this._handleObject(this.configureOptions[I],[I])),A++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let g=0;g1?A-1:0),I=1;I{t.appendChild(g)})),this.domElements.push(t),this.domElements.length}return 0}_makeHeader(g){const A=document.createElement("div");A.className="vis-configuration vis-config-header",A.innerText=g,this._makeItem([],A)}_makeLabel(g,A){let C=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const I=document.createElement("div");if(I.className="vis-configuration vis-config-label vis-config-s"+A.length,!0===C){for(;I.firstChild;)I.removeChild(I.firstChild);I.appendChild(Uu("i","b",g))}else I.innerText=g+":";return I}_makeDropdown(g,A,C){const I=document.createElement("select");I.className="vis-configuration vis-config-select";let t=0;void 0!==A&&-1!==kh(g).call(g,A)&&(t=kh(g).call(g,A));for(let A=0;Ae&&1!==e&&(o.max=Math.ceil(A*g),n=o.max,s="range increased"),o.value=A}else o.value=I;const r=document.createElement("input");r.className="vis-configuration vis-config-rangeinput",r.value=o.value;const a=this;o.onchange=function(){r.value=this.value,a._update(Number(this.value),C)},o.oninput=function(){r.value=this.value};const d=this._makeLabel(C[C.length-1],C),h=this._makeItem(C,d,o,r);""!==s&&this.popupHistory[h]!==n&&(this.popupHistory[h]=n,this._setupPopup(s,h))}_makeButton(){if(!0===this.options.showButton){const g=document.createElement("div");g.className="vis-configuration vis-config-button",g.innerText="generate options",g.onclick=()=>{this._printOptions()},g.onmouseover=()=>{g.className="vis-configuration vis-config-button hover"},g.onmouseout=()=>{g.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(g)}}_setupPopup(g,A){if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:C,index:A}}}_removePopup(){void 0!==this.popupDiv.html&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(void 0!==this.popupDiv.html){const g=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=g.left+"px",this.popupDiv.html.style.top=g.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=Al((()=>{this.popupDiv.html.style.opacity=0}),1500),this.popupDiv.deleteTimeout=Al((()=>{this._removePopup()}),1800)}}_makeCheckbox(g,A,C){const I=document.createElement("input");I.type="checkbox",I.className="vis-configuration vis-config-checkbox",I.checked=g,void 0!==A&&(I.checked=A,A!==g&&("object"==typeof g?A!==g.enabled&&this.changedOptions.push({path:C,value:A}):this.changedOptions.push({path:C,value:A})));const t=this;I.onchange=function(){t._update(this.checked,C)};const e=this._makeLabel(C[C.length-1],C);this._makeItem(C,e,I)}_makeTextInput(g,A,C){const I=document.createElement("input");I.type="text",I.className="vis-configuration vis-config-text",I.value=A,A!==g&&this.changedOptions.push({path:C,value:A});const t=this;I.onchange=function(){t._update(this.value,C)};const e=this._makeLabel(C[C.length-1],C);this._makeItem(C,e,I)}_makeColorField(g,A,C){const I=g[1],t=document.createElement("div");"none"!==(A=void 0===A?I:A)?(t.className="vis-configuration vis-config-colorBlock",t.style.backgroundColor=A):t.className="vis-configuration vis-config-colorBlock none",A=void 0===A?I:A,t.onclick=()=>{this._showColorPicker(A,t,C)};const e=this._makeLabel(C[C.length-1],C);this._makeItem(C,e,t)}_showColorPicker(g,A,C){A.onclick=function(){},this.colorPicker.insertTo(A),this.colorPicker.show(),this.colorPicker.setColor(g),this.colorPicker.setUpdateCallback((g=>{const I="rgba("+g.r+","+g.g+","+g.b+","+g.a+")";A.style.backgroundColor=I,this._update(I,C)})),this.colorPicker.setCloseCallback((()=>{A.onclick=()=>{this._showColorPicker(g,A,C)}}))}_handleObject(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],C=arguments.length>2&&void 0!==arguments[2]&&arguments[2],I=!1;const t=Gd(this.options);let e=!1;for(const i in g)if(Object.prototype.hasOwnProperty.call(g,i)){I=!0;const o=g[i],s=Du(A,i);if("function"==typeof t&&(I=t(i,A),!1===I&&!Wr(o)&&"string"!=typeof o&&"boolean"!=typeof o&&o instanceof Object&&(this.allowCreation=!1,I=this._handleObject(o,s,!0),this.allowCreation=!1===C)),!1!==I){e=!0;const g=this._getValue(s);if(Wr(o))this._handleArray(o,g,s);else if("string"==typeof o)this._makeTextInput(o,g,s);else if("boolean"==typeof o)this._makeCheckbox(o,g,s);else if(o instanceof Object){if(!this.hideOption(A,i,this.moduleOptions))if(void 0!==o.enabled){const g=Du(s,"enabled"),A=this._getValue(g);if(!0===A){const g=this._makeLabel(i,s,!0);this._makeItem(s,g),e=this._handleObject(o,s)||e}else this._makeCheckbox(o,A,s)}else{const g=this._makeLabel(i,s,!0);this._makeItem(s,g),e=this._handleObject(o,s)||e}}else console.error("dont know how to handle",o,i,s)}}return e}_handleArray(g,A,C){"string"==typeof g[0]&&"color"===g[0]?(this._makeColorField(g,A,C),g[1]!==A&&this.changedOptions.push({path:C,value:A})):"string"==typeof g[0]?(this._makeDropdown(g,A,C),g[0]!==A&&this.changedOptions.push({path:C,value:A})):"number"==typeof g[0]&&(this._makeRange(g,A,C),g[0]!==A&&this.changedOptions.push({path:C,value:Number(A)}))}_update(g,A){const C=this._constructOptions(g,A);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",C),this.initialized=!0,this.parent.setOptions(C)}_constructOptions(g,A){let C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},I=C;g="false"!==(g="true"===g||g)&&g;for(let C=0;CI-this.padding&&(C=!0),t=C?this.x-A:this.x,e=i?this.y-g:this.y}else e=this.y-g,e+g+this.padding>C&&(e=C-g-this.padding),eI&&(t=I-A-this.padding),te.distance?" in "+g.printLocation(t.path,A,"")+"Perhaps it was misplaced? Matching option found at: "+g.printLocation(e.path,e.closestMatch,""):t.distance<=8?'. Did you mean "'+t.closestMatch+'"?'+g.printLocation(t.path,A):". Did you mean one of these: "+g.print(ga(C))+g.printLocation(I,A),console.error('%cUnknown option detected: "'+A+'"'+i,Xu),Hu=!0}static findInOptions(A,C,I){let t=arguments.length>3&&void 0!==arguments[3]&&arguments[3],e=1e9,i="",o=[];const s=A.toLowerCase();let n;for(const d in C){let h;if(void 0!==C[d].__type__&&!0===t){const t=g.findInOptions(A,C[d],Du(I,d));e>t.distance&&(i=t.closestMatch,o=t.path,e=t.distance,n=t.indexMatch)}else{var r;-1!==kh(r=d.toLowerCase()).call(r,s)&&(n=d),h=g.levenshteinDistance(A,d),e>h&&(i=d,o=Zr(a=I).call(a),e=h)}}var a;return{closestMatch:i,path:o,distance:e,indexMatch:n}}static printLocation(g,A){let C="\n\n"+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n")+"options = {\n";for(let A=0;A":!0,"--":!0},op="",sp=0,np="",rp="",ap=ep.NULL;function dp(){sp++,np=op.charAt(sp)}function hp(){return op.charAt(sp+1)}function lp(g){var A=g.charCodeAt(0);return A<47?35===A||46===A:A<59?A>47:A<91?A>64:A<96?95===A:A<123&&A>96}function cp(g,A){if(g||(g={}),A)for(var C in A)A.hasOwnProperty(C)&&(g[C]=A[C]);return g}function up(g,A,C){for(var I=A.split("."),t=g;I.length;){var e=I.shift();I.length?(t[e]||(t[e]={}),t=t[e]):t[e]=C}}function pp(g,A){for(var C,I,t=null,e=[g],i=g;i.parent;)e.push(i.parent),i=i.parent;if(i.nodes)for(C=0,I=i.nodes.length;C=0;C--){var o,s=e[C];s.nodes||(s.nodes=[]),-1===kh(o=s.nodes).call(o,t)&&s.nodes.push(t)}A.attr&&(t.attr=cp(t.attr,A.attr))}function fp(g,A){if(g.edges||(g.edges=[]),g.edges.push(A),g.edge){var C=cp({},g.edge);A.attr=cp(C,A.attr)}}function bp(g,A,C,I,t){var e={from:A,to:C,type:I};return g.edge&&(e.attr=cp({},g.edge)),e.attr=cp(e.attr||{},t),null!=t&&t.hasOwnProperty("arrows")&&null!=t.arrows&&(e.arrows={to:{enabled:!0,type:t.arrows.type}},t.arrows=null),e}function mp(){for(ap=ep.NULL,rp="";" "===np||"\t"===np||"\n"===np||"\r"===np;)dp();do{var g=!1;if("#"===np){for(var A=sp-1;" "===op.charAt(A)||"\t"===op.charAt(A);)A--;if("\n"===op.charAt(A)||""===op.charAt(A)){for(;""!=np&&"\n"!=np;)dp();g=!0}}if("/"===np&&"/"===hp()){for(;""!=np&&"\n"!=np;)dp();g=!0}if("/"===np&&"*"===hp()){for(;""!=np;){if("*"===np&&"/"===hp()){dp(),dp();break}dp()}g=!0}for(;" "===np||"\t"===np||"\n"===np||"\r"===np;)dp()}while(g);if(""!==np){var C=np+hp();if(ip[C])return ap=ep.DELIMITER,rp=C,dp(),void dp();if(ip[np])return ap=ep.DELIMITER,rp=np,void dp();if(lp(np)||"-"===np){for(rp+=np,dp();lp(np);)rp+=np,dp();return"false"===rp?rp=!1:"true"===rp?rp=!0:isNaN(Number(rp))||(rp=Number(rp)),void(ap=ep.IDENTIFIER)}if('"'===np){for(dp();""!=np&&('"'!=np||'"'===np&&'"'===hp());)'"'===np?(rp+=np,dp()):"\\"===np&&"n"===hp()?(rp+="\n",dp()):rp+=np,dp();if('"'!=np)throw Op('End of string " expected');return dp(),void(ap=ep.IDENTIFIER)}for(ap=ep.UNKNOWN;""!=np;)rp+=np,dp();throw new SyntaxError('Syntax error in part "'+Tp(rp,30)+'"')}ap=ep.DELIMITER}function vp(g){for(;""!==rp&&"}"!=rp;)yp(g),";"===rp&&mp()}function yp(g){var A=wp(g);if(A)xp(g,A);else{var C=function(g){if("node"===rp)return mp(),g.node=Ep(),"node";if("edge"===rp)return mp(),g.edge=Ep(),"edge";if("graph"===rp)return mp(),g.graph=Ep(),"graph";return null}(g);if(!C){if(ap!=ep.IDENTIFIER)throw Op("Identifier expected");var I=rp;if(mp(),"="===rp){if(mp(),ap!=ep.IDENTIFIER)throw Op("Identifier expected");g[I]=rp,mp()}else!function(g,A){var C={id:A},I=Ep();I&&(C.attr=I);pp(g,C),xp(g,A)}(g,I)}}}function wp(g){var A=null;if("subgraph"===rp&&((A={}).type="subgraph",mp(),ap===ep.IDENTIFIER&&(A.id=rp,mp())),"{"===rp){if(mp(),A||(A={}),A.parent=g,A.node=g.node,A.edge=g.edge,A.graph=g.graph,vp(A),"}"!=rp)throw Op("Angle bracket } expected");mp(),delete A.node,delete A.edge,delete A.graph,delete A.parent,g.subgraphs||(g.subgraphs=[]),g.subgraphs.push(A)}return A}function xp(g,A){for(;"->"===rp||"--"===rp;){var C,I=rp;mp();var t=wp(g);if(t)C=t;else{if(ap!=ep.IDENTIFIER)throw Op("Identifier or subgraph expected");pp(g,{id:C=rp}),mp()}fp(g,bp(g,A,C,I,Ep())),A=C}}function Ep(){for(var g,A,C=null,I={dashed:!0,solid:!1,dotted:[1,5]},t={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},e=new Array,i=new Array;"["===rp;){for(mp(),C={};""!==rp&&"]"!=rp;){if(ap!=ep.IDENTIFIER)throw Op("Attribute name expected");var o=rp;if(mp(),"="!=rp)throw Op("Equal sign = expected");if(mp(),ap!=ep.IDENTIFIER)throw Op("Attribute value expected");var s=rp;"style"===o&&(s=I[s]),"arrowhead"===o&&(o="arrows",s={to:{enabled:!0,type:t[s]}}),"arrowtail"===o&&(o="arrows",s={from:{enabled:!0,type:t[s]}}),e.push({attr:C,name:o,value:s}),i.push(o),mp(),","==rp&&mp()}if("]"!=rp)throw Op("Bracket ] expected");mp()}if(yd(i).call(i,"dir")){var n={arrows:{}};for(g=0;g"===g.type&&(A.arrows="to"),A};pa(t=C.edges).call(t,(function(g){var A,C,t,i,o,s,n;(A=g.from instanceof Object?g.from.nodes:{id:g.from},C=g.to instanceof Object?g.to.nodes:{id:g.to},g.from instanceof Object&&g.from.edges)&&pa(t=g.from.edges).call(t,(function(g){var A=e(g);I.edges.push(A)}));(o=C,s=function(A,C){var t=bp(I,A.id,C.id,g.type,g.attr),i=e(t);I.edges.push(i)},Wr(i=A)?pa(i).call(i,(function(g){Wr(o)?pa(o).call(o,(function(A){s(g,A)})):s(g,o)})):Wr(o)?pa(o).call(o,(function(g){s(i,g)})):s(i,o),g.to instanceof Object&&g.to.edges)&&pa(n=g.to.edges).call(n,(function(g){var A=e(g);I.edges.push(A)}))}))}return C.attr&&(I.options=C.attr),I}var Rp=Object.freeze({__proto__:null,DOTToGraph:kp,parseDOT:Cp});function Pp(g,A){var C;const I={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};null!=A&&(null!=A.fixed&&(I.nodes.fixed=A.fixed),null!=A.parseColor&&(I.nodes.parseColor=A.parseColor),null!=A.inheritColor&&(I.edges.inheritColor=A.inheritColor));const t=g.edges,e=Jr(t).call(t,(g=>{const A={from:g.source,id:g.id,to:g.target};return null!=g.attributes&&(A.attributes=g.attributes),null!=g.label&&(A.label=g.label),null!=g.attributes&&null!=g.attributes.title&&(A.title=g.attributes.title),"Directed"===g.type&&(A.arrows="to"),g.color&&!1===I.edges.inheritColor&&(A.color=g.color),A}));return{nodes:Jr(C=g.nodes).call(C,(g=>{const A={id:g.id,fixed:I.nodes.fixed&&null!=g.x&&null!=g.y};return null!=g.attributes&&(A.attributes=g.attributes),null!=g.label&&(A.label=g.label),null!=g.size&&(A.size=g.size),null!=g.attributes&&null!=g.attributes.title&&(A.title=g.attributes.title),null!=g.title&&(A.title=g.title),null!=g.x&&(A.x=g.x),null!=g.y&&(A.y=g.y),null!=g.color&&(!0===I.nodes.parseColor?A.color=g.color:A.color={background:g.color,border:g.color,highlight:{background:g.color,border:g.color},hover:{background:g.color,border:g.color}}),A})),edges:e}}var Mp=Object.freeze({__proto__:null,parseGephi:Pp});var zp=Object.freeze({__proto__:null,cn:{addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},cs:{addDescription:"Kluknutím do prázdného prostoru můžete přidat nový vrchol.",addEdge:"Přidat hranu",addNode:"Přidat vrchol",back:"Zpět",close:"Zavřít",createEdgeError:"Nelze připojit hranu ke shluku.",del:"Smazat výběr",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",editNode:"Upravit vrchol"},de:{addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzufügen",addNode:"Knoten hinzufügen",back:"Zurück",close:"Schließen",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",del:"Lösche Auswahl",deleteClusterError:"Cluster können nicht gelöscht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster können nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},en:{addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},es:{addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",addEdge:"Añadir arista",addNode:"Añadir nodo",back:"Atrás",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selección",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},fr:{addDescription:"Cliquez dans un endroit vide pour placer un nœud.",addEdge:"Ajouter un lien",addNode:"Ajouter un nœud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de créer un lien vers un cluster.",del:"Effacer la sélection",deleteClusterError:"Les clusters ne peuvent pas être effacés.",edgeDescription:"Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.",edit:"Éditer",editClusterError:"Les clusters ne peuvent pas être édités.",editEdge:"Éditer le lien",editEdgeDescription:"Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.",editNode:"Éditer le nœud"},it:{addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},nl:{addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},pt:{addDescription:"Clique em um espaço em branco para adicionar um novo nó",addEdge:"Adicionar aresta",addNode:"Adicionar nó",back:"Voltar",close:"Fechar",createEdgeError:"Não foi possível linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters não puderam ser removidos.",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",edit:"Editar",editClusterError:"Clusters não puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",editNode:"Editar nó"},ru:{addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},uk:{addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"}});class Bp{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;const g=this.image.width,A=this.image.height;this.width=g,this.height=A;const C=Math.floor(A/2),I=Math.floor(A/4),t=Math.floor(A/8),e=Math.floor(A/16),i=Math.floor(g/2),o=Math.floor(g/4),s=Math.floor(g/8),n=Math.floor(g/16);this.canvas.width=3*o,this.canvas.height=C,this.coordinates=[[0,0,i,C],[i,0,o,I],[i,I,s,t],[5*s,I,n,e]],this._fillMipMap()}initialized(){return void 0!==this.coordinates}_fillMipMap(){const g=this.canvas.getContext("2d"),A=this.coordinates[0];g.drawImage(this.image,A[0],A[1],A[2],A[3]);for(let A=1;A2){A*=.5;let i=0;for(;A>2&&i=this.NUM_ITERATIONS&&(i=this.NUM_ITERATIONS-1);const o=this.coordinates[i];g.drawImage(this.canvas,o[0],o[1],o[2],o[3],C,I,t,e)}else g.drawImage(this.image,C,I,t,e)}}class Zp{constructor(g){this.images={},this.imageBroken={},this.callback=g}_tryloadBrokenUrl(g,A,C){void 0!==g&&void 0!==C&&(void 0!==A?(C.image.onerror=()=>{console.error("Could not load brokenImage:",A)},C.image.src=A):console.warn("No broken url image defined"))}_redrawWithImage(g){this.callback&&this.callback(g)}load(g,A){const C=this.images[g];if(C)return C;const I=new Bp;return this.images[g]=I,I.image.onload=()=>{this._fixImageCoordinates(I.image),I.init(),this._redrawWithImage(I)},I.image.onerror=()=>{console.error("Could not load image:",g),this._tryloadBrokenUrl(g,A,I)},I.image.src=g,I}_fixImageCoordinates(g){0===g.width&&(document.body.appendChild(g),g.width=g.offsetWidth,g.height=g.offsetHeight,document.body.removeChild(g))}}var Sp={exports:{}},Fp=e((function(){if("function"==typeof ArrayBuffer){var g=new ArrayBuffer(8);Object.isExtensible(g)&&Object.defineProperty(g,"a",{value:8})}})),Gp=e,Lp=gg,jp=m,Vp=Fp,Yp=Object.isExtensible,Wp=Gp((function(){Yp(1)}))||Vp?function(g){return!!Lp(g)&&((!Vp||"ArrayBuffer"!==jp(g))&&(!Yp||Yp(g)))}:Yp,Qp=!e((function(){return Object.isExtensible(Object.preventExtensions({}))})),Up=DC,Kp=u,Hp=UC,Xp=gg,_p=qg,Jp=JA.f,qp=ke,$p=Me,gf=Wp,Af=Qp,Cf=!1,If=IA("meta"),tf=0,ef=function(g){Jp(g,If,{value:{objectID:"O"+tf++,weakData:{}}})},of=Sp.exports={enable:function(){of.enable=function(){},Cf=!0;var g=qp.f,A=Kp([].splice),C={};C[If]=1,g(C).length&&(qp.f=function(C){for(var I=g(C),t=0,e=I.length;te;e++)if((o=p(g[e]))&&zf(Lf,o))return o;return new Gf(!1)}I=Bf(g,t)}for(s=d?g.next:I.next;!(n=Nf(s,I)).done;){try{o=p(n.value)}catch(g){Sf(I,"throw",g)}if("object"==typeof o&&o&&zf(Lf,o))return o}return new Gf(!1)},Vf=og,Yf=TypeError,Wf=function(g,A){if(Vf(A,g))return g;throw new Yf("Incorrect invocation")},Qf=DC,Uf=t,Kf=sf,Hf=e,Xf=uC,_f=jf,Jf=Wf,qf=T,$f=gg,gb=Q,Ab=fi,Cb=JA.f,Ib=Yi.forEach,tb=N,eb=Bi.set,ib=Bi.getterFor,ob=function(g,A,C){var I,t=-1!==g.indexOf("Map"),e=-1!==g.indexOf("Weak"),i=t?"set":"add",o=Uf[g],s=o&&o.prototype,n={};if(tb&&qf(o)&&(e||s.forEach&&!Hf((function(){(new o).entries().next()})))){var r=(I=A((function(A,C){eb(Jf(A,r),{type:g,collection:new o}),gb(C)||_f(C,A[i],{that:A,AS_ENTRIES:t})}))).prototype,a=ib(g);Ib(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(g){var A="add"===g||"set"===g;!(g in s)||e&&"clear"===g||Xf(r,g,(function(C,I){var t=a(this).collection;if(!A&&e&&!$f(C))return"get"===g&&void 0;var i=t[g](0===C?0:C,I);return A?this:i}))})),e||Cb(r,"size",{configurable:!0,get:function(){return a(this).collection.size}})}else I=C.getConstructor(A,g,t,i),Kf.enable();return Ab(I,g,!1,!0),n[g]=I,Qf({global:!0,forced:!0},n),e||C.setStrong(I,g,t),I},sb=Ue,nb=function(g,A,C){for(var I in A)C&&C.unsafe&&g[I]?g[I]=A[I]:sb(g,I,A[I],C);return g},rb=ig,ab=He,db=N,hb=dA("species"),lb=Ne,cb=He,ub=nb,pb=_A,fb=Wf,bb=Q,mb=jf,vb=_n,yb=Jn,wb=function(g){var A=rb(g);db&&A&&!A[hb]&&ab(A,hb,{configurable:!0,get:function(){return this}})},xb=N,Eb=sf.fastKey,Ob=Bi.set,Tb=Bi.getterFor,Db={getConstructor:function(g,A,C,I){var t=g((function(g,t){fb(g,e),Ob(g,{type:A,index:lb(null),first:void 0,last:void 0,size:0}),xb||(g.size=0),bb(t)||mb(t,g[I],{that:g,AS_ENTRIES:C})})),e=t.prototype,i=Tb(A),o=function(g,A,C){var I,t,e=i(g),o=s(g,A);return o?o.value=C:(e.last=o={index:t=Eb(A,!0),key:A,value:C,previous:I=e.last,next:void 0,removed:!1},e.first||(e.first=o),I&&(I.next=o),xb?e.size++:g.size++,"F"!==t&&(e.index[t]=o)),g},s=function(g,A){var C,I=i(g),t=Eb(A);if("F"!==t)return I.index[t];for(C=I.first;C;C=C.next)if(C.key===A)return C};return ub(e,{clear:function(){for(var g=i(this),A=g.index,C=g.first;C;)C.removed=!0,C.previous&&(C.previous=C.previous.next=void 0),delete A[C.index],C=C.next;g.first=g.last=void 0,xb?g.size=0:this.size=0},delete:function(g){var A=this,C=i(A),I=s(A,g);if(I){var t=I.next,e=I.previous;delete C.index[I.index],I.removed=!0,e&&(e.next=t),t&&(t.previous=e),C.first===I&&(C.first=t),C.last===I&&(C.last=e),xb?C.size--:A.size--}return!!I},forEach:function(g){for(var A,C=i(this),I=pb(g,arguments.length>1?arguments[1]:void 0);A=A?A.next:C.first;)for(I(A.value,A.key,this);A&&A.removed;)A=A.previous},has:function(g){return!!s(this,g)}}),ub(e,C?{get:function(g){var A=s(this,g);return A&&A.value},set:function(g,A){return o(this,0===g?0:g,A)}}:{add:function(g){return o(this,g=0===g?0:g,g)}}),xb&&cb(e,"size",{configurable:!0,get:function(){return i(this).size}}),t},setStrong:function(g,A,C){var I=A+" Iterator",t=Tb(A),e=Tb(I);vb(g,A,(function(g,A){Ob(this,{type:I,target:g,state:t(g),kind:A,last:void 0})}),(function(){for(var g=e(this),A=g.kind,C=g.last;C&&C.removed;)C=C.previous;return g.target&&(g.last=C=C?C.next:g.state.first)?yb("keys"===A?C.key:"values"===A?C.value:[C.key,C.value],!1):(g.target=void 0,yb(void 0,!0))}),C?"entries":"values",!C,!0),wb(A)}};ob("Map",(function(g){return function(){return g(this,arguments.length?arguments[0]:void 0)}}),Db);var Nb=u,kb=PC,Rb=Ie,Pb=H,Mb=Nb("".charAt),zb=Nb("".charCodeAt),Bb=Nb("".slice),Zb=function(g){return function(A,C){var I,t,e=Rb(Pb(A)),i=kb(C),o=e.length;return i<0||i>=o?g?"":void 0:(I=zb(e,i))<55296||I>56319||i+1===o||(t=zb(e,i+1))<56320||t>57343?g?Mb(e,i):I:g?Bb(e,i,i+2):t-56320+(I-55296<<10)+65536}},Sb={codeAt:Zb(!1),charAt:Zb(!0)}.charAt,Fb=Ie,Gb=Bi,Lb=_n,jb=Jn,Vb="String Iterator",Yb=Gb.set,Wb=Gb.getterFor(Vb);Lb(String,"String",(function(g){Yb(this,{type:Vb,string:Fb(g),index:0})}),(function(){var g,A=Wb(this),C=A.string,I=A.index;return I>=C.length?jb(void 0,!0):(g=Sb(C,I),A.index+=g.length,jb(g,!1))}));var Qb=C(Ag.Map);class Ub{constructor(){this.clear(),this._defaultIndex=0,this._groupIndex=0,this._defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},fI(this.options,this.defaultOptions)}setOptions(g){const A=["useDefaultGroups"];if(void 0!==g)for(const C in g)if(Object.prototype.hasOwnProperty.call(g,C)&&-1===kh(A).call(A,C)){const A=g[C];this.add(C,A)}}clear(){this._groups=new Qb,this._groupNames=[]}get(g){let A=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],C=this._groups.get(g);if(void 0===C&&A)if(!1===this.options.useDefaultGroups&&this._groupNames.length>0){const A=this._groupIndex%this._groupNames.length;++this._groupIndex,C={},C.color=this._groups.get(this._groupNames[A]),this._groups.set(g,C)}else{const A=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,C={},C.color=this._defaultGroups[A],this._groups.set(g,C)}return C}add(g,A){return this._groups.has(g)||this._groupNames.push(g),this._groups.set(g,A),A}}DC({target:"Number",stat:!0},{isNaN:function(g){return g!=g}});var Kb=C(Ag.Number.isNaN),Hb=t.isFinite,Xb=Number.isFinite||function(g){return"number"==typeof g&&Hb(g)};DC({target:"Number",stat:!0},{isFinite:Xb});var _b=C(Ag.Number.isFinite),Jb=Yi.some;DC({target:"Array",proto:!0,forced:!ia("some")},{some:function(g){return Jb(this,g,arguments.length>1?arguments[1]:void 0)}});var qb=MI("Array").some,$b=og,gm=qb,Am=Array.prototype,Cm=function(g){var A=g.some;return g===Am||$b(Am,g)&&A===Am.some?gm:A},Im=C(Cm),tm=C(Ag.Object.getOwnPropertySymbols),em={exports:{}},im=DC,om=e,sm=J,nm=D.f,rm=N;im({target:"Object",stat:!0,forced:!rm||om((function(){nm(1)})),sham:!rm},{getOwnPropertyDescriptor:function(g,A){return nm(sm(g),A)}});var am=Ag.Object,dm=em.exports=function(g,A){return am.getOwnPropertyDescriptor(g,A)};am.getOwnPropertyDescriptor.sham&&(dm.sham=!0);var hm=C(em.exports),lm=Vr,cm=J,um=D,pm=Ct;DC({target:"Object",stat:!0,sham:!N},{getOwnPropertyDescriptors:function(g){for(var A,C,I=cm(g),t=um.f,e=lm(I),i={},o=0;e.length>o;)void 0!==(C=t(I,A=e[o++]))&&pm(i,A,C);return i}});var fm=C(Ag.Object.getOwnPropertyDescriptors),bm={exports:{}},mm=DC,vm=N,ym=te.f;mm({target:"Object",stat:!0,forced:Object.defineProperties!==ym,sham:!vm},{defineProperties:ym});var wm=Ag.Object,xm=bm.exports=function(g,A){return wm.defineProperties(g,A)};wm.defineProperties.sham&&(xm.sham=!0);var Em=C(bm.exports),Om={exports:{}},Tm=DC,Dm=N,Nm=JA.f;Tm({target:"Object",stat:!0,forced:Object.defineProperty!==Nm,sham:!Dm},{defineProperty:Nm});var km=Ag.Object,Rm=Om.exports=function(g,A,C){return km.defineProperty(g,A,C)};km.defineProperty.sham&&(Rm.sham=!0);var Pm=Om.exports,Mm=C(Pm),zm=dA,Bm=JA.f,Zm=zm("metadata"),Sm=Function.prototype;void 0===Sm[Zm]&&Bm(Sm,Zm,{value:null}),ti("asyncDispose"),ti("dispose"),ti("metadata");var Fm=cr,Gm=u,Lm=ig("Symbol"),jm=Lm.keyFor,Vm=Gm(Lm.prototype.valueOf),Ym=Lm.isRegisteredSymbol||function(g){try{return void 0!==jm(Vm(g))}catch(g){return!1}};DC({target:"Symbol",stat:!0},{isRegisteredSymbol:Ym});for(var Wm=Ug,Qm=ig,Um=u,Km=Eg,Hm=dA,Xm=Qm("Symbol"),_m=Xm.isWellKnownSymbol,Jm=Qm("Object","getOwnPropertyNames"),qm=Um(Xm.prototype.valueOf),$m=Wm("wks"),gv=0,Av=Jm(Xm),Cv=Av.length;gv=0:o>s;s+=n)s in i&&(t=C(t,i[s],s,e));return t}},fv={left:pv(!1),right:pv(!0)},bv="process"===m(t.process),mv=fv.left;DC({target:"Array",proto:!0,forced:!bv&&cg>79&&cg<83||!ia("reduce")},{reduce:function(g){var A=arguments.length;return mv(this,g,A,A>1?arguments[1]:void 0)}});var vv=MI("Array").reduce,yv=og,wv=vv,xv=Array.prototype,Ev=function(g){var A=g.reduce;return g===xv||yv(xv,g)&&A===xv.reduce?wv:A},Ov=C(Ev),Tv=_I,Dv=LC,Nv=qI,kv=_A,Rv=function(g,A,C,I,t,e,i,o){for(var s,n,r=t,a=0,d=!!i&&kv(i,o);a0&&Tv(s)?(n=Dv(s),r=Rv(g,A,s,n,r,e-1)-1):(Nv(r+1),g[r]=s),r++),a++;return r},Pv=Rv,Mv=Rg,zv=Xg,Bv=LC,Zv=Zt;DC({target:"Array",proto:!0},{flatMap:function(g){var A,C=zv(this),I=Bv(C);return Mv(g),(A=Zv(C,0)).length=Pv(A,C,C,I,0,1,g,arguments.length>1?arguments[1]:void 0),A}});var Sv=MI("Array").flatMap,Fv=og,Gv=Sv,Lv=Array.prototype,jv=function(g){var A=g.flatMap;return g===Lv||Fv(Lv,g)&&A===Lv.flatMap?Gv:A},Vv=C(jv),Yv=C(iv);ob("Set",(function(g){return function(){return g(this,arguments.length?arguments[0]:void 0)}}),Db);var Wv=C(Ag.Set),Qv=C(xf),Uv=Ge,Kv=Math.floor,Hv=function(g,A){var C=g.length,I=Kv(C/2);return C<8?Xv(g,A):_v(g,Hv(Uv(g,0,I),A),Hv(Uv(g,I),A),A)},Xv=function(g,A){for(var C,I,t=g.length,e=1;e0;)g[I]=g[--I];I!==e++&&(g[I]=C)}return g},_v=function(g,A,C,I){for(var t=A.length,e=C.length,i=0,o=0;i3)){if(ly)return!0;if(uy)return uy<603;var g,A,C,I,t="";for(g=65;g<76;g++){switch(A=String.fromCharCode(g),g){case 66:case 69:case 70:case 72:C=3;break;case 68:case 71:C=4;break;default:C=2}for(I=0;I<47;I++)py.push({k:A+I,v:C})}for(py.sort((function(g,A){return A.v-g.v})),I=0;Iny(C)?1:-1}}(g)),C=oy(t),I=0;IA(g)),g)}_add(g,A){null!=A&&this._target.add(this._transformItems(this._source.get(A.items)))}_update(g,A){null!=A&&this._target.update(this._transformItems(this._source.get(A.items)))}_remove(g,A){null!=A&&this._target.remove(this._transformItems(A.oldData))}}class hw{constructor(g){av(this,"_source",void 0),av(this,"_transformers",[]),this._source=g}filter(g){return this._transformers.push((A=>Gd(A).call(A,g))),this}map(g){return this._transformers.push((A=>Jr(A).call(A,g))),this}flatMap(g){return this._transformers.push((A=>Vv(A).call(A,g))),this}to(g){return new dw(this._source,this._transformers,g)}}function lw(g){return"string"==typeof g||"number"==typeof g}class cw{constructor(g){av(this,"delay",void 0),av(this,"max",void 0),av(this,"_queue",[]),av(this,"_timeout",null),av(this,"_extended",null),this.delay=null,this.max=1/0,this.setOptions(g)}setOptions(g){g&&void 0!==g.delay&&(this.delay=g.delay),g&&void 0!==g.max&&(this.max=g.max),this._flushIfNeeded()}static extend(g,A){const C=new cw(A);if(void 0!==g.flush)throw new Error("Target object already has a property flush");g.flush=()=>{C.flush()};const I=[{name:"flush",original:void 0}];if(A&&A.replace)for(let t=0;tthis.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&"number"==typeof this.delay&&(this._timeout=Al((()=>{this.flush()}),this.delay))}flush(){var g,A;pa(g=gd(A=this._queue).call(A,0)).call(g,(g=>{g.fn.apply(g.context||g.fn,g.args||[])}))}}class uw{constructor(){av(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),av(this,"subscribe",uw.prototype.on),av(this,"unsubscribe",uw.prototype.off)}_trigger(g,A,C){var I;if("*"===g)throw new Error("Cannot trigger event *");pa(I=[...this._subscribers[g],...this._subscribers["*"]]).call(I,(I=>{I(g,A,null!=C?C:null)}))}on(g,A){"function"==typeof A&&this._subscribers[g].push(A)}off(g,A){var C;this._subscribers[g]=Gd(C=this._subscribers[g]).call(C,(g=>g!==A))}}class pw{constructor(g){av(this,"_pairs",void 0),this._pairs=g}*[Yv](){for(const[g,A]of this._pairs)yield[g,A]}*entries(){for(const[g,A]of this._pairs)yield[g,A]}*keys(){for(const[g]of this._pairs)yield g}*values(){for(const[,g]of this._pairs)yield g}toIdArray(){var g;return Jr(g=[...this._pairs]).call(g,(g=>g[0]))}toItemArray(){var g;return Jr(g=[...this._pairs]).call(g,(g=>g[1]))}toEntryArray(){return[...this._pairs]}toObjectMap(){const g=Ph(null);for(const[A,C]of this._pairs)g[A]=C;return g}toMap(){return new Qb(this._pairs)}toIdSet(){return new Wv(this.toIdArray())}toItemSet(){return new Wv(this.toItemArray())}cache(){return new pw([...this._pairs])}distinct(g){const A=new Wv;for(const[C,I]of this._pairs)A.add(g(I,C));return A}filter(g){const A=this._pairs;return new pw({*[Yv](){for(const[C,I]of A)g(I,C)&&(yield[C,I])}})}forEach(g){for(const[A,C]of this._pairs)g(C,A)}map(g){const A=this._pairs;return new pw({*[Yv](){for(const[C,I]of A)yield[C,g(I,C)]}})}max(g){const A=Qv(this._pairs);let C=A.next();if(C.done)return null;let I=C.value[1],t=g(C.value[1],C.value[0]);for(;!(C=A.next()).done;){const[A,e]=C.value,i=g(e,A);i>t&&(t=i,I=e)}return I}min(g){const A=Qv(this._pairs);let C=A.next();if(C.done)return null;let I=C.value[1],t=g(C.value[1],C.value[0]);for(;!(C=A.next()).done;){const[A,e]=C.value,i=g(e,A);i{var A;return Qv(Ny(A=[...this._pairs]).call(A,((A,C)=>{let[I,t]=A,[e,i]=C;return g(t,i,I,e)})))}})}}class fw extends uw{get idProp(){return this._idProp}constructor(g,A){super(),av(this,"flush",void 0),av(this,"length",void 0),av(this,"_options",void 0),av(this,"_data",void 0),av(this,"_idProp",void 0),av(this,"_queue",null),g&&!Wr(g)&&(A=g,g=[]),this._options=A||{},this._data=new Qb,this.length=0,this._idProp=this._options.fieldId||"id",g&&g.length&&this.add(g),this.setOptions(A)}setOptions(g){g&&void 0!==g.queue&&(!1===g.queue?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=cw.extend(this,{replace:["add","update","remove"]})),g.queue&&"object"==typeof g.queue&&this._queue.setOptions(g.queue)))}add(g,A){const C=[];let I;if(Wr(g)){const A=Jr(g).call(g,(g=>g[this._idProp]));if(Im(A).call(A,(g=>this._data.has(g))))throw new Error("A duplicate id was found in the parameter array.");for(let A=0,t=g.length;A{const A=g[i];if(null!=A&&this._data.has(A)){const C=g,i=fI({},this._data.get(A)),o=this._updateItem(C);I.push(o),e.push(C),t.push(i)}else{const A=this._addItem(g);C.push(A)}};if(Wr(g))for(let A=0,C=g.length;A{const A=this._data.get(g[this._idProp]);if(null==A)throw new Error("Updating non-existent items is not allowed.");return{oldData:A,update:g}}))).call(C,(g=>{let{oldData:A,update:C}=g;const I=A[this._idProp],t=function(g){for(var A=arguments.length,C=new Array(A>1?A-1:0),I=1;Ig.id)),oldData:Jr(I).call(I,(g=>g.oldData)),data:Jr(I).call(I,(g=>g.updatedData))};return this._trigger("update",g,A),g.items}return[]}get(g,A){let C,I,t;lw(g)?(C=g,t=A):Wr(g)?(I=g,t=A):t=g;const e=t&&"Object"===t.returnType?"Object":"Array",i=t&&Gd(t),o=[];let s,n,r;if(null!=C)s=this._data.get(C),s&&i&&!i(s)&&(s=void 0);else if(null!=I)for(let g=0,A=I.length;g(A[C]=g[C],A)),{}):g}_sort(g,A){if("string"==typeof A){const C=A;Ny(g).call(g,((g,A)=>{const I=g[C],t=A[C];return I>t?1:IC)&&(A=t,C=e)}return A||null}min(g){let A=null,C=null;for(const t of Ky(I=this._data).call(I)){var I;const e=t[g];"number"==typeof e&&(null==C||ee(g)&&i(g)),null==I?this._data.get(t):this._data.get(I,t)}getIds(g){if(this._data.length){const A=Gd(this._options),C=null!=g?Gd(g):null;let I;return I=C?A?g=>A(g)&&C(g):C:A,this._data.getIds({filter:I,order:g&&g.order})}return[]}forEach(g,A){if(this._data){var C;const I=Gd(this._options),t=A&&Gd(A);let e;e=t?I?function(g){return I(g)&&t(g)}:t:I,pa(C=this._data).call(C,g,{filter:e,order:A&&A.order})}}map(g,A){if(this._data){var C;const I=Gd(this._options),t=A&&Gd(A);let e;return e=t?I?g=>I(g)&&t(g):t:I,Jr(C=this._data).call(C,g,{filter:e,order:A&&A.order})}return[]}getDataSet(){return this._data.getDataSet()}stream(g){var A;return this._data.stream(g||{[Yv]:GI(A=Fy(this._ids)).call(A,this._ids)})}dispose(){var g;null!==(g=this._data)&&void 0!==g&&g.off&&this._data.off("*",this._listener);const A="This data view has already been disposed of.",C={get:()=>{throw new Error(A)},set:()=>{throw new Error(A)},configurable:!1};for(const g of Yr(bw.prototype))Iw(this,g,C)}_onEvent(g,A,C){if(!A||!A.items||!this._data)return;const I=A.items,t=[],e=[],i=[],o=[],s=[],n=[];switch(g){case"add":for(let g=0,A=I.length;gA.x&&g.topA.y}function Vw(g){return"string"==typeof g&&""!==g}function Yw(g,A,C,I){let t=I.x,e=I.y;if("function"==typeof I.distanceToBorder){const C=I.distanceToBorder(g,A),i=Math.sin(A)*C,o=Math.cos(A)*C;o===C?(t+=C,e=I.y):i===C?(t=I.x,e-=C):(t+=o,e-=i)}else I.shape.width>I.shape.height?(t=I.x+.5*I.shape.width,e=I.y-C):(t=I.x+C,e=I.y-.5*I.shape.height);return{x:t,y:e}}class Ww{constructor(g){this.measureText=g,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(g,A){let C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal";void 0===this.lines[g]&&(this.lines[g]={width:0,height:0,blocks:[]});let I=A;void 0!==A&&""!==A||(I=" ");const t=this.measureText(I,C),e=fI({},Ky(t));e.text=A,e.width=t.width,e.mod=C,void 0!==A&&""!==A||(e.width=0),this.lines[g].blocks.push(e),this.lines[g].width+=e.width}curWidth(){const g=this.lines[this.current];return void 0===g?0:g.width}append(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,g,A)}newLine(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,g,A),this.current++}determineLineHeights(){for(let g=0;gg&&(g=I.width),A+=I.height}this.width=g,this.height=A}removeEmptyBlocks(){const g=[];for(let A=0;A"://,""://,""://,"":/<\/b>/,"":/<\/i>/,"":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/};class Uw{constructor(g){this.text=g,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}mod(){return 0===this.modStack.length?"normal":this.modStack[0]}modName(){return 0===this.modStack.length?"normal":"mono"===this.modStack[0]?"mono":this.bold&&this.ital?"boldital":this.bold?"bold":this.ital?"ital":void 0}emitBlock(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}add(g){" "===g&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=g&&(this.buffer+=g)}parseWS(g){return!!/[ \t]/.test(g)&&(this.mono?this.add(g):this.spacing=!0,!0)}setTag(g){this.emitBlock(),this[g]=!0,this.modStack.unshift(g)}unsetTag(g){this.emitBlock(),this[g]=!1,this.modStack.shift()}parseStartTag(g,A){return!(this.mono||this[g]||!this.match(A))&&(this.setTag(g),!0)}match(g){let A=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const[C,I]=this.prepareRegExp(g),t=C.test(this.text.substr(this.position,I));return t&&A&&(this.position+=I-1),t}parseEndTag(g,A,C){let I=this.mod()===g;return I="mono"===g?I&&this.mono:I&&!this.mono,!(!I||!this.match(A))&&(void 0!==C?(this.position===this.text.length-1||this.match(C,!1))&&this.unsetTag(g):this.unsetTag(g),!0)}replace(g,A){return!!this.match(g)&&(this.add(A),this.position+=length-1,!0)}prepareRegExp(g){let A,C;if(g instanceof RegExp)C=g,A=1;else{const I=Qw[g];C=void 0!==I?I:new RegExp(g),A=g.length}return[C,A]}}class Kw{constructor(g,A,C,I){this.ctx=g,this.parent=A,this.selected=C,this.hover=I;this.lines=new Ww(((A,t)=>{if(void 0===A)return 0;const e=this.parent.getFormattingValues(g,C,I,t);let i=0;if(""!==A){i=this.ctx.measureText(A).width}return{width:i,values:e}}))}process(g){if(!Vw(g))return this.lines.finalize();const A=this.parent.fontOptions;g=(g=g.replace(/\r\n/g,"\n")).replace(/\r/g,"\n");const C=String(g).split("\n"),I=C.length;if(A.multi)for(let g=0;g0)for(let g=0;g0)for(let g=0;g{if(/&/.test(g)){return A.replace(A.text,"<","<")||A.replace(A.text,"&","&")||A.add("&"),!0}return!1};for(;A.position")||A.parseStartTag("ital","")||A.parseStartTag("mono","")||A.parseEndTag("bold","")||A.parseEndTag("ital","")||A.parseEndTag("mono",""))||C(g)||A.add(g),A.position++}return A.emitBlock(),A.blocks}splitMarkdownBlocks(g){const A=new Uw(g);let C=!0;const I=g=>!!/\\/.test(g)&&(A.positionthis.parent.fontOptions.maxWdt}getLongestFit(g){let A="",C=0;for(;C1&&void 0!==arguments[1]?arguments[1]:"normal",C=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.parent.getFormattingValues(this.ctx,this.selected,this.hover,A);let I=(g=(g=g.replace(/^( +)/g,"$1\r")).replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r")).split("\r");for(;I.length>0;){let g=this.getLongestFit(I);if(0===g){const g=I[0],C=this.getLongestFitWord(g);this.lines.newLine(Zr(g).call(g,0,C),A),I[0]=Zr(g).call(g,C)}else{let t=g;" "===I[g-1]?g--:" "===I[t]&&t++;const e=Zr(I).call(I,0,g).join("");g==I.length&&C?this.lines.append(e,A):this.lines.newLine(e,A),I=Zr(I).call(I,t)}}}}const Hw=["bold","ital","boldital","mono"];class Xw{constructor(g,A){let C=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.body=g,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(A),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=C}setOptions(g){if(this.elementOptions=g,this.initFontOptions(g.font),Vw(g.label)?this.labelDirty=!0:g.label=void 0,void 0!==g.font&&null!==g.font)if("string"==typeof g.font)this.baseSize=this.fontOptions.size;else if("object"==typeof g.font){const A=g.font.size;void 0!==A&&(this.baseSize=A)}}initFontOptions(g){ku(Hw,(g=>{this.fontOptions[g]={}})),Xw.parseFontString(this.fontOptions,g)?this.fontOptions.vadjust=0:ku(g,((g,A)=>{null!=g&&"object"!=typeof g&&(this.fontOptions[A]=g)}))}static parseFontString(g,A){if(!A||"string"!=typeof A)return!1;const C=A.split(" ");return g.size=+C[0].replace("px",""),g.face=C[1],g.color=C[2],!0}constrain(g){const A={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},C=Yu(g,"widthConstraint");if("number"==typeof C)A.maxWdt=Number(C),A.minWdt=Number(C);else if("object"==typeof C){const C=Yu(g,["widthConstraint","maximum"]);"number"==typeof C&&(A.maxWdt=Number(C));const I=Yu(g,["widthConstraint","minimum"]);"number"==typeof I&&(A.minWdt=Number(I))}const I=Yu(g,"heightConstraint");if("number"==typeof I)A.minHgt=Number(I);else if("object"==typeof I){const C=Yu(g,["heightConstraint","minimum"]);"number"==typeof C&&(A.minHgt=Number(C));const I=Yu(g,["heightConstraint","valign"]);"string"==typeof I&&("top"!==I&&"bottom"!==I||(A.valign=I))}return A}update(g,A){this.setOptions(g,!0),this.propagateFonts(A),Tu(this.fontOptions,this.constrain(A)),this.fontOptions.chooser=Lw("label",A)}adjustSizes(g){const A=g?g.right+g.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=A,this.fontOptions.minWdt-=A);const C=g?g.top+g.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=C)}addFontOptionsToPile(g,A){for(let C=0;C{void 0!==g&&(Object.prototype.hasOwnProperty.call(A,C)||(-1!==kh(Hw).call(Hw,C)?A[C]={}:A[C]=g))}))}return A}getFontOption(g,A,C){let I;for(let t=0;t{I[A]=g})),I.size=Number(I.size),I.vadjust=Number(I.vadjust)}}draw(g,A,C,I,t){let e=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";if(void 0===this.elementOptions.label)return;let i=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&i=this.elementOptions.scaling.label.maxVisible&&(i=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(g,I,t,A,C,e),this._drawBackground(g),this._drawText(g,A,this.size.yLine,e,i))}_drawBackground(g){if(void 0!==this.fontOptions.background&&"none"!==this.fontOptions.background){g.fillStyle=this.fontOptions.background;const A=this.getSize();g.fillRect(A.left,A.top,A.width,A.height)}}_drawText(g,A,C){let I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"middle",t=arguments.length>4?arguments[4]:void 0;[A,C]=this._setAlignment(g,A,C,I),g.textAlign="left",A-=this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&("top"===this.fontOptions.valign&&(C-=(this.size.height-this.size.labelHeight)/2),"bottom"===this.fontOptions.valign&&(C+=(this.size.height-this.size.labelHeight)/2));for(let I=0;I0&&(g.lineWidth=o.strokeWidth,g.strokeStyle=n,g.lineJoin="round"),g.fillStyle=s,o.strokeWidth>0&&g.strokeText(o.text,A+I,C+o.vadjust),g.fillText(o.text,A+I,C+o.vadjust),I+=o.width}C+=e.height}}}_setAlignment(g,A,C,I){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&!1===this.pointToSelf){A=0,C=0;const I=2;"top"===this.fontOptions.align?(g.textBaseline="alphabetic",C-=2*I):"bottom"===this.fontOptions.align?(g.textBaseline="hanging",C+=2*I):g.textBaseline="middle"}else g.textBaseline=I;return[A,C]}_getColor(g,A,C){let I=g||"#000000",t=C||"#ffffff";if(A<=this.elementOptions.scaling.label.drawThreshold){const g=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-A)));I=Pu(I,g),t=Pu(t,g)}return[I,t]}getTextSize(g){let A=arguments.length>1&&void 0!==arguments[1]&&arguments[1],C=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._processLabel(g,A,C),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let g=this.size.left,A=this.size.top-1;if(this.isEdgeLabel){const C=.5*-this.size.width;switch(this.fontOptions.align){case"middle":g=C,A=.5*-this.size.height;break;case"top":g=C,A=-(this.size.height+2);break;case"bottom":g=C,A=2}}return{left:g,top:A,width:this.size.width,height:this.size.height}}calculateLabelSize(g,A,C){let I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,t=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,e=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";this._processLabel(g,A,C),this.size.left=I-.5*this.size.width,this.size.top=t-.5*this.size.height,this.size.yLine=t+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===e&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(g,A,C,I){const t=function(g,A,C){return"normal"===A?"mod"===C?"":g[C]:void 0!==g[A][C]?g[A][C]:g[C]},e={color:t(this.fontOptions,I,"color"),size:t(this.fontOptions,I,"size"),face:t(this.fontOptions,I,"face"),mod:t(this.fontOptions,I,"mod"),vadjust:t(this.fontOptions,I,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(A||C)&&("normal"===I&&!0===this.fontOptions.chooser&&this.elementOptions.labelHighlightBold?e.mod="bold":"function"==typeof this.fontOptions.chooser&&this.fontOptions.chooser(e,this.elementOptions.id,A,C));let i="";return void 0!==e.mod&&""!==e.mod&&(i+=e.mod+" "),i+=e.size+"px "+e.face,g.font=i.replace(/"/g,""),e.font=g.font,e.height=e.size,e}differentState(g,A){return g!==this.selectedState||A!==this.hoverState}_processLabelText(g,A,C,I){return new Kw(g,this,A,C).process(I)}_processLabel(g,A,C){if(!1===this.labelDirty&&!this.differentState(A,C))return;const I=this._processLabelText(g,A,C,this.elementOptions.label);this.fontOptions.minWdt>0&&I.width0&&I.height0&&(this.enableBorderDashes(g,A),g.stroke(),this.disableBorderDashes(g,A)),g.restore()}performFill(g,A){g.save(),g.fillStyle=A.color,this.enableShadow(g,A),dl(g).call(g),this.disableShadow(g,A),g.restore(),this.performStroke(g,A)}_addBoundingBoxMargin(g){this.boundingBox.left-=g,this.boundingBox.top-=g,this.boundingBox.bottom+=g,this.boundingBox.right+=g}_updateBoundingBox(g,A,C,I,t){void 0!==C&&this.resize(C,I,t),this.left=g-this.width/2,this.top=A-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}updateBoundingBox(g,A,C,I,t){this._updateBoundingBox(g,A,C,I,t)}getDimensionsFromLabel(g,A,C){this.textSize=this.labelModule.getTextSize(g,A,C);let I=this.textSize.width,t=this.textSize.height;return 0===I&&(I=14,t=14),{width:I,height:t}}}let Jw=class extends _w{constructor(g,A,C){super(g,A,C),this._setMargins(C)}resize(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(A,C)){const I=this.getDimensionsFromLabel(g,A,C);this.width=I.width+this.margin.right+this.margin.left,this.height=I.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(g,A,C,I,t,e){this.resize(g,I,t),this.left=A-this.width/2,this.top=C-this.height/2,this.initContextForDraw(g,e),jI(g,this.left,this.top,this.width,this.height,e.borderRadius),this.performFill(g,e),this.updateBoundingBox(A,C,g,I,t),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,I,t)}updateBoundingBox(g,A,C,I,t){this._updateBoundingBox(g,A,C,I,t);const e=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(e)}distanceToBorder(g,A){g&&this.resize(g);const C=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(A)),Math.abs(this.height/2/Math.sin(A)))+C}};class qw extends _w{constructor(g,A,C){super(g,A,C),this.labelOffset=0,this.selected=!1}setOptions(g,A,C){this.options=g,void 0===A&&void 0===C||this.setImages(A,C)}setImages(g,A){A&&this.selected?(this.imageObj=A,this.imageObjAlt=g):(this.imageObj=g,this.imageObjAlt=A)}switchImages(g){const A=g&&!this.selected||!g&&this.selected;if(this.selected=g,void 0!==this.imageObjAlt&&A){const g=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=g}}_getImagePadding(){const g={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){const A=this.options.imagePadding;"object"==typeof A?(g.top=A.top,g.right=A.right,g.bottom=A.bottom,g.left=A.left):(g.top=A,g.right=A,g.bottom=A,g.left=A)}return g}_resizeImage(){let g,A;if(!1===this.options.shapeProperties.useImageSize){let C=1,I=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?C=this.imageObj.width/this.imageObj.height:I=this.imageObj.height/this.imageObj.width),g=2*this.options.size*C,A=2*this.options.size*I}else{const C=this._getImagePadding();g=this.imageObj.width+C.left+C.right,A=this.imageObj.height+C.top+C.bottom}this.width=g,this.height=A,this.radius=.5*this.width}_drawRawCircle(g,A,C,I){this.initContextForDraw(g,I),LI(g,A,C,I.size),this.performFill(g,I)}_drawImageAtPosition(g,A){if(0!=this.imageObj.width){g.globalAlpha=void 0!==A.opacity?A.opacity:1,this.enableShadow(g,A);let C=1;!0===this.options.shapeProperties.interpolation&&(C=this.imageObj.width/this.width/this.body.view.scale);const I=this._getImagePadding(),t=this.left+I.left,e=this.top+I.top,i=this.width-I.left-I.right,o=this.height-I.top-I.bottom;this.imageObj.drawImageAtPosition(g,C,t,e,i,o),this.disableShadow(g,A)}}_drawImageLabel(g,A,C,I,t){let e=0;if(void 0!==this.height){e=.5*this.height;const A=this.labelModule.getTextSize(g,I,t);A.lineCount>=1&&(e+=A.height/2)}const i=C+e;this.options.label&&(this.labelOffset=e),this.labelModule.draw(g,A,i,I,t,"hanging")}}let $w=class extends qw{constructor(g,A,C){super(g,A,C),this._setMargins(C)}resize(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(A,C)){const I=this.getDimensionsFromLabel(g,A,C),t=Math.max(I.width+this.margin.right+this.margin.left,I.height+this.margin.top+this.margin.bottom);this.options.size=t/2,this.width=t,this.height=t,this.radius=this.width/2}}draw(g,A,C,I,t,e){this.resize(g,I,t),this.left=A-this.width/2,this.top=C-this.height/2,this._drawRawCircle(g,A,C,e),this.updateBoundingBox(A,C),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,C,I,t)}updateBoundingBox(g,A){this.boundingBox.top=A-this.options.size,this.boundingBox.left=g-this.options.size,this.boundingBox.right=g+this.options.size,this.boundingBox.bottom=A+this.options.size}distanceToBorder(g){return g&&this.resize(g),.5*this.width}};class gx extends qw{constructor(g,A,C,I,t){super(g,A,C),this.setImages(I,t)}resize(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){const g=2*this.options.size;return this.width=g,this.height=g,void(this.radius=.5*this.width)}this.needsRefresh(A,C)&&this._resizeImage()}draw(g,A,C,I,t,e){this.switchImages(I),this.resize();let i=A,o=C;"top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=A,this.top=C,i+=this.width/2,o+=this.height/2):(this.left=A-this.width/2,this.top=C-this.height/2),this._drawRawCircle(g,i,o,e),g.save(),g.clip(),this._drawImageAtPosition(g,e),g.restore(),this._drawImageLabel(g,i,o,I,t),this.updateBoundingBox(A,C)}updateBoundingBox(g,A){"top-left"===this.options.shapeProperties.coordinateOrigin?(this.boundingBox.top=A,this.boundingBox.left=g,this.boundingBox.right=g+2*this.options.size,this.boundingBox.bottom=A+2*this.options.size):(this.boundingBox.top=A-this.options.size,this.boundingBox.left=g-this.options.size,this.boundingBox.right=g+this.options.size,this.boundingBox.bottom=A+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}distanceToBorder(g){return g&&this.resize(g),.5*this.width}}class Ax extends _w{constructor(g,A,C){super(g,A,C)}resize(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover,I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{size:this.options.size};if(this.needsRefresh(A,C)){var t,e;this.labelModule.getTextSize(g,A,C);const i=2*I.size;this.width=null!==(t=this.customSizeWidth)&&void 0!==t?t:i,this.height=null!==(e=this.customSizeHeight)&&void 0!==e?e:i,this.radius=.5*this.width}}_drawShape(g,A,C,I,t,e,i,o){var s;return this.resize(g,e,i,o),this.left=I-this.width/2,this.top=t-this.height/2,this.initContextForDraw(g,o),(s=A,Object.prototype.hasOwnProperty.call(QI,s)?QI[s]:function(g){for(var A=arguments.length,C=new Array(A>1?A-1:0),I=1;I{if(void 0!==this.options.label){this.labelModule.calculateLabelSize(g,e,i,I,t,"hanging");const A=t+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(g,I,A,e,i,"hanging")}this.updateBoundingBox(I,t)}}}updateBoundingBox(g,A){this.boundingBox.top=A-this.options.size,this.boundingBox.left=g-this.options.size,this.boundingBox.right=g+this.options.size,this.boundingBox.bottom=A+this.options.size,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}function Cx(g,A){var C=ga(g);if(tm){var I=tm(g);A&&(I=Gd(I).call(I,(function(A){return hm(g,A).enumerable}))),C.push.apply(C,I)}return C}function Ix(g){for(var A=1;A{g.save(),A(),g.restore()}}return i.nodeDimensions&&(this.customSizeWidth=i.nodeDimensions.width,this.customSizeHeight=i.nodeDimensions.height),i}distanceToBorder(g,A){return this._distanceToBorder(g,A)}}class ex extends _w{constructor(g,A,C){super(g,A,C),this._setMargins(C)}resize(g,A,C){if(this.needsRefresh(A,C)){const I=this.getDimensionsFromLabel(g,A,C).width+this.margin.right+this.margin.left;this.width=I,this.height=I,this.radius=this.width/2}}draw(g,A,C,I,t,e){this.resize(g,I,t),this.left=A-this.width/2,this.top=C-this.height/2,this.initContextForDraw(g,e),YI(g,A-this.width/2,C-this.height/2,this.width,this.height),this.performFill(g,e),this.updateBoundingBox(A,C,g,I,t),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,I,t)}distanceToBorder(g,A){return this._distanceToBorder(g,A)}}let ix=class extends Ax{constructor(g,A,C){super(g,A,C)}draw(g,A,C,I,t,e){return this._drawShape(g,"diamond",4,A,C,I,t,e)}distanceToBorder(g,A){return this._distanceToBorder(g,A)}};class ox extends Ax{constructor(g,A,C){super(g,A,C)}draw(g,A,C,I,t,e){return this._drawShape(g,"circle",2,A,C,I,t,e)}distanceToBorder(g){return g&&this.resize(g),this.options.size}}class sx extends _w{constructor(g,A,C){super(g,A,C)}resize(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(A,C)){const I=this.getDimensionsFromLabel(g,A,C);this.height=2*I.height,this.width=I.width+I.height,this.radius=.5*this.width}}draw(g,A,C,I,t,e){this.resize(g,I,t),this.left=A-.5*this.width,this.top=C-.5*this.height,this.initContextForDraw(g,e),VI(g,this.left,this.top,this.width,this.height),this.performFill(g,e),this.updateBoundingBox(A,C,g,I,t),this.labelModule.draw(g,A,C,I,t)}distanceToBorder(g,A){g&&this.resize(g);const C=.5*this.width,I=.5*this.height,t=Math.sin(A)*C,e=Math.cos(A)*I;return C*I/Math.sqrt(t*t+e*e)}}class nx extends _w{constructor(g,A,C){super(g,A,C),this._setMargins(C)}resize(g,A,C){this.needsRefresh(A,C)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(g,A,C,I,t,e){return this.resize(g,I,t),this.options.icon.size=this.options.icon.size||50,this.left=A-this.width/2,this.top=C-this.height/2,this._icon(g,A,C,I,t,e),{drawExternalLabel:()=>{if(void 0!==this.options.label){const A=5;this.labelModule.draw(g,this.left+this.iconSize.width/2+this.margin.left,C+this.height/2+A,I)}this.updateBoundingBox(A,C)}}}updateBoundingBox(g,A){if(this.boundingBox.top=A-.5*this.options.icon.size,this.boundingBox.left=g-.5*this.options.icon.size,this.boundingBox.right=g+.5*this.options.icon.size,this.boundingBox.bottom=A+.5*this.options.icon.size,void 0!==this.options.label&&this.labelModule.size.width>0){const g=5;this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+g)}}_icon(g,A,C,I,t,e){const i=Number(this.options.icon.size);void 0!==this.options.icon.code?(g.font=[null!=this.options.icon.weight?this.options.icon.weight:I?"bold":"",(null!=this.options.icon.weight&&I?5:0)+i+"px",this.options.icon.face].join(" "),g.fillStyle=this.options.icon.color||"black",g.textAlign="center",g.textBaseline="middle",this.enableShadow(g,e),g.fillText(this.options.icon.code,A,C),this.disableShadow(g,e)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}distanceToBorder(g,A){return this._distanceToBorder(g,A)}}let rx=class extends qw{constructor(g,A,C,I,t){super(g,A,C),this.setImages(I,t)}resize(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){const g=2*this.options.size;return this.width=g,void(this.height=g)}this.needsRefresh(A,C)&&this._resizeImage()}draw(g,A,C,I,t,e){g.save(),this.switchImages(I),this.resize();let i=A,o=C;if("top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=A,this.top=C,i+=this.width/2,o+=this.height/2):(this.left=A-this.width/2,this.top=C-this.height/2),!0===this.options.shapeProperties.useBorderWithImage){const A=this.options.borderWidth,C=this.options.borderWidthSelected||2*this.options.borderWidth,i=(I?C:A)/this.body.view.scale;g.lineWidth=Math.min(this.width,i),g.beginPath();let o=I?this.options.color.highlight.border:t?this.options.color.hover.border:this.options.color.border,s=I?this.options.color.highlight.background:t?this.options.color.hover.background:this.options.color.background;void 0!==e.opacity&&(o=Pu(o,e.opacity),s=Pu(s,e.opacity)),g.strokeStyle=o,g.fillStyle=s,g.rect(this.left-.5*g.lineWidth,this.top-.5*g.lineWidth,this.width+g.lineWidth,this.height+g.lineWidth),dl(g).call(g),this.performStroke(g,e),g.closePath()}this._drawImageAtPosition(g,e),this._drawImageLabel(g,i,o,I,t),this.updateBoundingBox(A,C),g.restore()}updateBoundingBox(g,A){this.resize(),"top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=g,this.top=A):(this.left=g-this.width/2,this.top=A-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}distanceToBorder(g,A){return this._distanceToBorder(g,A)}};class ax extends Ax{constructor(g,A,C){super(g,A,C)}draw(g,A,C,I,t,e){return this._drawShape(g,"square",2,A,C,I,t,e)}distanceToBorder(g,A){return this._distanceToBorder(g,A)}}class dx extends Ax{constructor(g,A,C){super(g,A,C)}draw(g,A,C,I,t,e){return this._drawShape(g,"hexagon",4,A,C,I,t,e)}distanceToBorder(g,A){return this._distanceToBorder(g,A)}}class hx extends Ax{constructor(g,A,C){super(g,A,C)}draw(g,A,C,I,t,e){return this._drawShape(g,"star",4,A,C,I,t,e)}distanceToBorder(g,A){return this._distanceToBorder(g,A)}}class lx extends _w{constructor(g,A,C){super(g,A,C),this._setMargins(C)}resize(g,A,C){this.needsRefresh(A,C)&&(this.textSize=this.labelModule.getTextSize(g,A,C),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(g,A,C,I,t,e){this.resize(g,I,t),this.left=A-this.width/2,this.top=C-this.height/2,this.enableShadow(g,e),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,I,t),this.disableShadow(g,e),this.updateBoundingBox(A,C,g,I,t)}distanceToBorder(g,A){return this._distanceToBorder(g,A)}}let cx=class extends Ax{constructor(g,A,C){super(g,A,C)}draw(g,A,C,I,t,e){return this._drawShape(g,"triangle",3,A,C,I,t,e)}distanceToBorder(g,A){return this._distanceToBorder(g,A)}};class ux extends Ax{constructor(g,A,C){super(g,A,C)}draw(g,A,C,I,t,e){return this._drawShape(g,"triangleDown",3,A,C,I,t,e)}distanceToBorder(g,A){return this._distanceToBorder(g,A)}}function px(g,A){var C=ga(g);if(tm){var I=tm(g);A&&(I=Gd(I).call(I,(function(A){return hm(g,A).enumerable}))),C.push.apply(C,I)}return C}function fx(g){for(var A=1;Anull!=A[g]));i.push("font"),Ou(i,g,e),g.color=zu(g.color)}static parseOptions(g,A){let C=arguments.length>2&&void 0!==arguments[2]&&arguments[2],I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},t=arguments.length>4?arguments[4]:void 0;if(Ou(["color","fixed","shadow"],g,A,C),bx.checkMass(A),void 0!==g.opacity&&(bx.checkOpacity(g.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+g.opacity),g.opacity=void 0)),void 0!==A.opacity&&(bx.checkOpacity(A.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+A.opacity),A.opacity=void 0)),A.shapeProperties&&!bx.checkCoordinateOrigin(A.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+A.shapeProperties.coordinateOrigin),ju(g,A,"shadow",I),void 0!==A.color&&null!==A.color){const C=zu(A.color);xu(g.color,C)}else!0===C&&null===A.color&&(g.color=Lu(I.color));void 0!==A.fixed&&null!==A.fixed&&("boolean"==typeof A.fixed?(g.fixed.x=A.fixed,g.fixed.y=A.fixed):(void 0!==A.fixed.x&&"boolean"==typeof A.fixed.x&&(g.fixed.x=A.fixed.x),void 0!==A.fixed.y&&"boolean"==typeof A.fixed.y&&(g.fixed.y=A.fixed.y))),!0===C&&null===A.font&&(g.font=Lu(I.font)),bx.updateGroupOptions(g,A,t),void 0!==A.scaling&&ju(g.scaling,A.scaling,"label",I.scaling)}getFormattingValues(){const g={color:this.options.color.background,opacity:this.options.opacity,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};if(this.selected||this.hover?!0===this.chooser?this.selected?(null!=this.options.borderWidthSelected?g.borderWidth=this.options.borderWidthSelected:g.borderWidth*=2,g.color=this.options.color.highlight.background,g.borderColor=this.options.color.highlight.border,g.shadow=this.options.shadow.enabled):this.hover&&(g.color=this.options.color.hover.background,g.borderColor=this.options.color.hover.border,g.shadow=this.options.shadow.enabled):"function"==typeof this.chooser&&(this.chooser(g,this.options.id,this.selected,this.hover),!1===g.shadow&&(g.shadowColor===this.options.shadow.color&&g.shadowSize===this.options.shadow.size&&g.shadowX===this.options.shadow.x&&g.shadowY===this.options.shadow.y||(g.shadow=!0))):g.shadow=this.options.shadow.enabled,void 0!==this.options.opacity){const A=this.options.opacity;g.borderColor=Pu(g.borderColor,A),g.color=Pu(g.color,A),g.shadowColor=Pu(g.shadowColor,A)}return g}updateLabelModule(g){void 0!==this.options.label&&null!==this.options.label||(this.options.label=""),bx.updateGroupOptions(this.options,fx(fx({},g),{},{color:g&&g.color||this._localColor||void 0}),this.grouplist);const A=this.grouplist.get(this.options.group,!1),C=[g,this.options,A,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,C),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(g){if(g===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new Jw(this.options,this.body,this.labelModule);break;case"circle":this.shape=new $w(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new gx(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new tx(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new ex(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new ix(this.options,this.body,this.labelModule);break;case"dot":this.shape=new ox(this.options,this.body,this.labelModule);break;case"ellipse":default:this.shape=new sx(this.options,this.body,this.labelModule);break;case"icon":this.shape=new nx(this.options,this.body,this.labelModule);break;case"image":this.shape=new rx(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new ax(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new dx(this.options,this.body,this.labelModule);break;case"star":this.shape=new hx(this.options,this.body,this.labelModule);break;case"text":this.shape=new lx(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new cx(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new ux(this.options,this.body,this.labelModule)}this.needsRefresh()}select(){this.selected=!0,this.needsRefresh()}unselect(){this.selected=!1,this.needsRefresh()}needsRefresh(){this.shape.refreshNeeded=!0}getTitle(){return this.options.title}distanceToBorder(g,A){return this.shape.distanceToBorder(g,A)}isFixed(){return this.options.fixed.x&&this.options.fixed.y}isSelected(){return this.selected}getValue(){return this.options.value}getLabelSize(){return this.labelModule.size()}setValueRange(g,A,C){if(void 0!==this.options.value){const I=this.options.scaling.customScalingFunction(g,A,C,this.options.value),t=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){const g=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+I*g}this.options.size=this.options.scaling.min+I*t}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(g){const A=this.getFormattingValues();return this.shape.draw(g,this.x,this.y,this.selected,this.hover,A)||{}}updateBoundingBox(g){this.shape.updateBoundingBox(this.x,this.y,g)}resize(g){const A=this.getFormattingValues();this.shape.resize(g,this.selected,this.hover,A)}getItemsOnPoint(g){const A=[];return this.labelModule.visible()&&jw(this.labelModule.getSize(),g)&&A.push({nodeId:this.id,labelId:0}),jw(this.shape.boundingBox,g)&&A.push({nodeId:this.id}),A}isOverlappingWith(g){return this.shape.leftg.left&&this.shape.topg.top}isBoundingBoxOverlappingWith(g){return this.shape.boundingBox.leftg.left&&this.shape.boundingBox.topg.top}static checkMass(g,A){if(void 0!==g.mass&&g.mass<=0){let C="";void 0!==A&&(C=" in node id: "+A),console.error("%cNegative or zero mass disallowed"+C+", setting mass to 1.",gp),g.mass=1}}}class mx{constructor(g,A,C,I){var t;if(this.body=g,this.images=A,this.groups=C,this.layoutEngine=I,this.body.functions.createNode=GI(t=this.create).call(t,this),this.nodesListeners={add:(g,A)=>{this.add(A.items)},update:(g,A)=>{this.update(A.items,A.data,A.oldData)},remove:(g,A)=>{this.remove(A.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(g,A,C,I){if(A===g)return.5;{const C=1/(A-g);return Math.max(0,(I-g)*C)}}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1,coordinateOrigin:"center"},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=Lu(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var g,A;this.body.emitter.on("refreshNodes",GI(g=this.refresh).call(g,this)),this.body.emitter.on("refresh",GI(A=this.refresh).call(A,this)),this.body.emitter.on("destroy",(()=>{ku(this.nodesListeners,((g,A)=>{this.body.data.nodes&&this.body.data.nodes.off(A,g)})),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners}))}setOptions(g){if(void 0!==g){if(bx.parseOptions(this.options,g),void 0!==g.opacity&&(Kb(g.opacity)||!_b(g.opacity)||g.opacity<0||g.opacity>1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+g.opacity):this.options.opacity=g.opacity),void 0!==g.shape)for(const g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&this.body.nodes[g].updateShape();if(void 0!==g.font||void 0!==g.widthConstraint||void 0!==g.heightConstraint)for(const g of ga(this.body.nodes))this.body.nodes[g].updateLabelModule(),this.body.nodes[g].needsRefresh();if(void 0!==g.size)for(const g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&this.body.nodes[g].needsRefresh();void 0===g.hidden&&void 0===g.physics||this.body.emitter.emit("_dataChanged")}}setData(g){let A=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const C=this.body.data.nodes;if(vw("id",g))this.body.data.nodes=g;else if(Wr(g))this.body.data.nodes=new fw,this.body.data.nodes.add(g);else{if(g)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new fw}if(C&&ku(this.nodesListeners,(function(g,A){C.off(A,g)})),this.body.nodes={},this.body.data.nodes){const g=this;ku(this.nodesListeners,(function(A,C){g.body.data.nodes.on(C,A)}));const A=this.body.data.nodes.getIds();this.add(A,!0)}!1===A&&this.body.emitter.emit("_dataChanged")}add(g){let A,C=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const I=[];for(let C=0;C1&&void 0!==arguments[1]?arguments[1]:bx)(g,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let g=arguments.length>0&&void 0!==arguments[0]&&arguments[0];ku(this.body.nodes,((A,C)=>{const I=this.body.data.nodes.get(C);void 0!==I&&(!0===g&&A.setOptions({x:null,y:null}),A.setOptions({fixed:!1}),A.setOptions(I))}))}getPositions(g){const A={};if(void 0!==g){if(!0===Wr(g)){for(let C=0;C{this.body.emitter.emit("startSimulation")}),0)):console.error("Node id supplied to moveNode does not exist. Provided: ",g)}}var vx=DC,yx=Math.hypot,wx=Math.abs,xx=Math.sqrt;vx({target:"Math",stat:!0,arity:2,forced:!!yx&&yx(1/0,NaN)!==1/0},{hypot:function(g,A){for(var C,I,t=0,e=0,i=arguments.length,o=0;e0?(I=C/o)*I:C;return o===1/0?1/0:o*xx(t)}});var Ex=C(Ag.Math.hypot);class Ox{static transform(g,A){Wr(g)||(g=[g]);const C=A.point.x,I=A.point.y,t=A.angle,e=A.length;for(let A=0;A4&&void 0!==arguments[4]?arguments[4]:this.getViaNode();g.strokeStyle=this.getColor(g,A),g.lineWidth=A.width,!1!==A.dashes?this._drawDashedLine(g,A,t):this._drawLine(g,A,t)}_drawLine(g,A,C,I,t){if(this.from!=this.to)this._line(g,A,C,I,t);else{const[C,I,t]=this._getCircleData(g);this._circle(g,A,C,I,t)}}_drawDashedLine(g,A,C,I,t){g.lineCap="round";const e=Wr(A.dashes)?A.dashes:[5,5];if(void 0!==g.setLineDash){if(g.save(),g.setLineDash(e),g.lineDashOffset=0,this.from!=this.to)this._line(g,A,C);else{const[C,I,t]=this._getCircleData(g);this._circle(g,A,C,I,t)}g.setLineDash([0]),g.lineDashOffset=0,g.restore()}else{if(this.from!=this.to)WI(g,this.from.x,this.from.y,this.to.x,this.to.y,e);else{const[C,I,t]=this._getCircleData(g);this._circle(g,A,C,I,t)}this.enableShadow(g,A),g.stroke(),this.disableShadow(g,A)}}findBorderPosition(g,A,C){return this.from!=this.to?this._findBorderPosition(g,A,C):this._findBorderPositionCircle(g,A,C)}findBorderPositions(g){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,g),to:this._findBorderPosition(this.to,g)};{var A;const[C,I]=Zr(A=this._getCircleData(g)).call(A,0,2);return{from:this._findBorderPositionCircle(this.from,g,{x:C,y:I,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,g,{x:C,y:I,low:.6,high:.8,direction:1})}}}_getCircleData(g){const A=this.options.selfReference.size;void 0!==g&&void 0===this.from.shape.width&&this.from.shape.resize(g);const C=Yw(g,this.options.selfReference.angle,A,this.from);return[C.x,C.y,A]}_pointOnCircle(g,A,C,I){const t=2*I*Math.PI;return{x:g+C*Math.cos(t),y:A-C*Math.sin(t)}}_findBorderPositionCircle(g,A,C){const I=C.x,t=C.y;let e=C.low,i=C.high;const o=C.direction,s=this.options.selfReference.size;let n,r=.5*(e+i),a=0;!0===this.options.arrowStrikethrough&&(-1===o?a=this.options.endPointOffset.from:1===o&&(a=this.options.endPointOffset.to));let d=0;do{r=.5*(e+i),n=this._pointOnCircle(I,t,s,r);const C=Math.atan2(g.y-n.y,g.x-n.x),h=g.distanceToBorder(A,C)+a-Math.sqrt(Math.pow(n.x-g.x,2)+Math.pow(n.y-g.y,2));if(Math.abs(h)<.05)break;h>0?o>0?e=r:i=r:o>0?i=r:e=r,++d}while(e<=i&&d<10);return jx(jx({},n),{},{t:r})}getLineWidth(g,A){return!0===g?Math.max(this.selectionWidth,.3/this._body.view.scale):!0===A?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}getColor(g,A){if(!1!==A.inheritsColor){if("both"===A.inheritsColor&&this.from.id!==this.to.id){const C=g.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y);let I=this.from.options.color.highlight.border,t=this.to.options.color.highlight.border;return!1===this.from.selected&&!1===this.to.selected?(I=Pu(this.from.options.color.border,A.opacity),t=Pu(this.to.options.color.border,A.opacity)):!0===this.from.selected&&!1===this.to.selected?t=this.to.options.color.border:!1===this.from.selected&&!0===this.to.selected&&(I=this.from.options.color.border),C.addColorStop(0,I),C.addColorStop(1,t),C}return"to"===A.inheritsColor?Pu(this.to.options.color.border,A.opacity):Pu(this.from.options.color.border,A.opacity)}return Pu(A.color,A.opacity)}_circle(g,A,C,I,t){this.enableShadow(g,A);let e=0,i=2*Math.PI;if(!this.options.selfReference.renderBehindTheNode){const A=this.options.selfReference.angle,t=this.options.selfReference.angle+Math.PI,o=this._findBorderPositionCircle(this.from,g,{x:C,y:I,low:A,high:t,direction:-1}),s=this._findBorderPositionCircle(this.from,g,{x:C,y:I,low:A,high:t,direction:1});e=Math.atan2(o.y-I,o.x-C),i=Math.atan2(s.y-I,s.x-C)}g.beginPath(),g.arc(C,I,t,e,i,!1),g.stroke(),this.disableShadow(g,A)}getDistanceToEdge(g,A,C,I,t,e){if(this.from!=this.to)return this._getDistanceToEdge(g,A,C,I,t,e);{const[g,A,C]=this._getCircleData(void 0),I=g-t,i=A-e;return Math.abs(Math.sqrt(I*I+i*i)-C)}}_getDistanceToLine(g,A,C,I,t,e){const i=C-g,o=I-A;let s=((t-g)*i+(e-A)*o)/(i*i+o*o);s>1?s=1:s<0&&(s=0);const n=g+s*i-t,r=A+s*o-e;return Math.sqrt(n*n+r*r)}getArrowData(g,A,C,I,t,e){let i,o,s,n,r,a,d;const h=e.width;"from"===A?(s=this.from,n=this.to,r=e.fromArrowScale<0,a=Math.abs(e.fromArrowScale),d=e.fromArrowType):"to"===A?(s=this.to,n=this.from,r=e.toArrowScale<0,a=Math.abs(e.toArrowScale),d=e.toArrowType):(s=this.to,n=this.from,r=e.middleArrowScale<0,a=Math.abs(e.middleArrowScale),d=e.middleArrowType);const l=15*a+3*h;if(s!=n){const I=l/Ex(s.x-n.x,s.y-n.y);if("middle"!==A)if(!0===this.options.smooth.enabled){const t=this._findBorderPosition(s,g,{via:C}),e=this.getPoint(t.t+I*("from"===A?1:-1),C);i=Math.atan2(t.y-e.y,t.x-e.x),o=t}else i=Math.atan2(s.y-n.y,s.x-n.x),o=this._findBorderPosition(s,g);else{const g=(r?-I:I)/2,A=this.getPoint(.5+g,C),t=this.getPoint(.5-g,C);i=Math.atan2(A.y-t.y,A.x-t.x),o=this.getPoint(.5,C)}}else{const[C,I,t]=this._getCircleData(g);if("from"===A){const A=this.options.selfReference.angle,t=this.options.selfReference.angle+Math.PI,e=this._findBorderPositionCircle(this.from,g,{x:C,y:I,low:A,high:t,direction:-1});i=-2*e.t*Math.PI+1.5*Math.PI+.1*Math.PI,o=e}else if("to"===A){const A=this.options.selfReference.angle,t=this.options.selfReference.angle+Math.PI,e=this._findBorderPositionCircle(this.from,g,{x:C,y:I,low:A,high:t,direction:1});i=-2*e.t*Math.PI+1.5*Math.PI-1.1*Math.PI,o=e}else{const g=this.options.selfReference.angle/(2*Math.PI);o=this._pointOnCircle(C,I,t,g),i=-2*g*Math.PI+1.5*Math.PI+.1*Math.PI}}return{point:o,core:{x:o.x-.9*l*Math.cos(i),y:o.y-.9*l*Math.sin(i)},angle:i,length:l,type:d}}drawArrowHead(g,A,C,I,t){g.strokeStyle=this.getColor(g,A),g.fillStyle=g.strokeStyle,g.lineWidth=A.width;Gx.draw(g,t)&&(this.enableShadow(g,A),dl(g).call(g),this.disableShadow(g,A))}enableShadow(g,A){!0===A.shadow&&(g.shadowColor=A.shadowColor,g.shadowBlur=A.shadowSize,g.shadowOffsetX=A.shadowX,g.shadowOffsetY=A.shadowY)}disableShadow(g,A){!0===A.shadow&&(g.shadowColor="rgba(0,0,0,0)",g.shadowBlur=0,g.shadowOffsetX=0,g.shadowOffsetY=0)}drawBackground(g,A){if(!1!==A.background){const C={strokeStyle:g.strokeStyle,lineWidth:g.lineWidth,dashes:g.dashes};g.strokeStyle=A.backgroundColor,g.lineWidth=A.backgroundSize,this.setStrokeDashed(g,A.backgroundDashes),g.stroke(),g.strokeStyle=C.strokeStyle,g.lineWidth=C.lineWidth,g.dashes=C.dashes,this.setStrokeDashed(g,A.dashes)}}setStrokeDashed(g,A){if(!1!==A)if(void 0!==g.setLineDash){const C=Wr(A)?A:[5,5];g.setLineDash(C)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else void 0!==g.setLineDash?g.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}function Yx(g,A){var C=ga(g);if(tm){var I=tm(g);A&&(I=Gd(I).call(I,(function(A){return hm(g,A).enumerable}))),C.push.apply(C,I)}return C}function Wx(g){for(var A=1;A2&&void 0!==arguments[2]?arguments[2]:this._getViaCoordinates();let I,t,e=!1,i=1,o=0,s=this.to,n=this.options.endPointOffset?this.options.endPointOffset.to:0;g.id===this.from.id&&(s=this.from,e=!0,n=this.options.endPointOffset?this.options.endPointOffset.from:0),!1===this.options.arrowStrikethrough&&(n=0);let r=0;do{t=.5*(o+i),I=this.getPoint(t,C);const g=Math.atan2(s.y-I.y,s.x-I.x),a=s.distanceToBorder(A,g)+n-Math.sqrt(Math.pow(I.x-s.x,2)+Math.pow(I.y-s.y,2));if(Math.abs(a)<.2)break;a<0?!1===e?o=t:i=t:!1===e?i=t:o=t,++r}while(o<=i&&r<10);return Wx(Wx({},I),{},{t:t})}_getDistanceToBezierEdge(g,A,C,I,t,e,i){let o,s,n,r,a,d=1e9,h=g,l=A;for(s=1;s<10;s++)n=.1*s,r=Math.pow(1-n,2)*g+2*n*(1-n)*i.x+Math.pow(n,2)*C,a=Math.pow(1-n,2)*A+2*n*(1-n)*i.y+Math.pow(n,2)*I,s>0&&(o=this._getDistanceToLine(h,l,r,a,t,e),d=o{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(g){super.setOptions(g);let A=!1;this.options.physics!==g.physics&&(A=!0),this.options=g,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),!0===A&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],void 0===this.from||void 0===this.to||!1===this.options.physics||this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}cleanup(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),void 0!==this.via&&(delete this._body.nodes[this.via.id],this.via=void 0,!0)}setupSupportNode(){if(void 0===this.via){const g="edgeId:"+this.id,A=this._body.functions.createNode({id:g,shape:"circle",physics:!0,hidden:!0});this._body.nodes[g]=A,this.via=A,this.via.parentEdgeId=this.id,this.positionBezierNode()}}positionBezierNode(){void 0!==this.via&&void 0!==this.from&&void 0!==this.to?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):void 0!==this.via&&(this.via.x=0,this.via.y=0)}_line(g,A,C){this._bezierCurve(g,A,C)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.via;if(this.from===this.to){const[A,C,I]=this._getCircleData(),t=2*Math.PI*(1-g);return{x:A+I*Math.sin(t),y:C+I-I*(1-Math.cos(t))}}return{x:Math.pow(1-g,2)*this.fromPoint.x+2*g*(1-g)*A.x+Math.pow(g,2)*this.toPoint.x,y:Math.pow(1-g,2)*this.fromPoint.y+2*g*(1-g)*A.y+Math.pow(g,2)*this.toPoint.y}}_findBorderPosition(g,A){return this._findBorderPositionBezier(g,A,this.via)}_getDistanceToEdge(g,A,C,I,t,e){return this._getDistanceToBezierEdge(g,A,C,I,t,e,this.via)}}class Kx extends Qx{constructor(g,A,C){super(g,A,C)}_line(g,A,C){this._bezierCurve(g,A,C)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){const g=this.options.smooth.roundness,A=this.options.smooth.type;let C=Math.abs(this.from.x-this.to.x),I=Math.abs(this.from.y-this.to.y);if("discrete"===A||"diagonalCross"===A){let t,e;t=e=C<=I?g*I:g*C,this.from.x>this.to.x&&(t=-t),this.from.y>=this.to.y&&(e=-e);let i=this.from.x+t,o=this.from.y+e;return"discrete"===A&&(C<=I?i=Cthis.to.x&&(A=-A),this.from.y>=this.to.y&&(t=-t);let e=this.from.x+A,i=this.from.y+t;return C<=I?e=this.from.x<=this.to.x?this.to.xe?this.to.x:e:i=this.from.y>=this.to.y?this.to.y>i?this.to.y:i:this.to.y2&&void 0!==arguments[2]?arguments[2]:{};return this._findBorderPositionBezier(g,A,C.via)}_getDistanceToEdge(g,A,C,I,t,e){let i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(g,A,C,I,t,e,i)}getPoint(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates();const C=g;return{x:Math.pow(1-C,2)*this.fromPoint.x+2*C*(1-C)*A.x+Math.pow(C,2)*this.toPoint.x,y:Math.pow(1-C,2)*this.fromPoint.y+2*C*(1-C)*A.y+Math.pow(C,2)*this.toPoint.y}}}class Hx extends Qx{constructor(g,A,C){super(g,A,C)}_getDistanceToBezierEdge2(g,A,C,I,t,e,i,o){let s=1e9,n=g,r=A;const a=[0,0,0,0];for(let d=1;d<10;d++){const h=.1*d;a[0]=Math.pow(1-h,3),a[1]=3*h*Math.pow(1-h,2),a[2]=3*Math.pow(h,2)*(1-h),a[3]=Math.pow(h,3);const l=a[0]*g+a[1]*i.x+a[2]*o.x+a[3]*C,c=a[0]*A+a[1]*i.y+a[2]*o.y+a[3]*I;if(d>0){const g=this._getDistanceToLine(n,r,l,c,t,e);s=gMath.abs(A)||!0===this.options.smooth.forceDirection||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(I=this.from.y,e=this.to.y,C=this.from.x-i*g,t=this.to.x+i*g):(I=this.from.y-i*A,e=this.to.y+i*A,C=this.from.x,t=this.to.x),[{x:C,y:I},{x:t,y:e}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(g,A){return this._findBorderPositionBezier(g,A)}_getDistanceToEdge(g,A,C,I,t,e){let[i,o]=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(g,A,C,I,t,e,i,o)}getPoint(g){let[A,C]=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates();const I=g,t=[Math.pow(1-I,3),3*I*Math.pow(1-I,2),3*Math.pow(I,2)*(1-I),Math.pow(I,3)];return{x:t[0]*this.fromPoint.x+t[1]*A.x+t[2]*C.x+t[3]*this.toPoint.x,y:t[0]*this.fromPoint.y+t[1]*A.y+t[2]*C.y+t[3]*this.toPoint.y}}}class _x extends Vx{constructor(g,A,C){super(g,A,C)}_line(g,A){g.beginPath(),g.moveTo(this.fromPoint.x,this.fromPoint.y),g.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(g,A),g.stroke(),this.disableShadow(g,A)}getViaNode(){}getPoint(g){return{x:(1-g)*this.fromPoint.x+g*this.toPoint.x,y:(1-g)*this.fromPoint.y+g*this.toPoint.y}}_findBorderPosition(g,A){let C=this.to,I=this.from;g.id===this.from.id&&(C=this.from,I=this.to);const t=Math.atan2(C.y-I.y,C.x-I.x),e=C.x-I.x,i=C.y-I.y,o=Math.sqrt(e*e+i*i),s=(o-g.distanceToBorder(A,t))/o;return{x:(1-s)*I.x+s*C.x,y:(1-s)*I.y+s*C.y,t:0}}_getDistanceToEdge(g,A,C,I,t,e){return this._getDistanceToLine(g,A,C,I,t,e)}}class Jx{constructor(g,A,C,I,t){if(void 0===A)throw new Error("No body provided");this.options=Lu(I),this.globalOptions=I,this.defaultOptions=t,this.body=A,this.imagelist=C,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new Xw(this.body,this.options,!0),this.setOptions(g)}setOptions(g){if(!g)return;let A=void 0!==g.physics&&this.options.physics!==g.physics||void 0!==g.hidden&&(this.options.hidden||!1)!==(g.hidden||!1)||void 0!==g.from&&this.options.from!==g.from||void 0!==g.to&&this.options.to!==g.to;Jx.parseOptions(this.options,g,!0,this.globalOptions),void 0!==g.id&&(this.id=g.id),void 0!==g.from&&(this.fromId=g.from),void 0!==g.to&&(this.toId=g.to),void 0!==g.title&&(this.title=g.title),void 0!==g.value&&(g.value=Mw(g.value));const C=[g,this.options,this.defaultOptions];return this.chooser=Lw("edge",C),this.updateLabelModule(g),A=this.updateEdgeType()||A,this._setInteractionWidths(),this.connect(),A}static parseOptions(g,A){let C=arguments.length>2&&void 0!==arguments[2]&&arguments[2],I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},t=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Eu(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],g,A,C),void 0!==A.endPointOffset&&void 0!==A.endPointOffset.from&&(_b(A.endPointOffset.from)?g.endPointOffset.from=A.endPointOffset.from:(g.endPointOffset.from=void 0!==I.endPointOffset.from?I.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),void 0!==A.endPointOffset&&void 0!==A.endPointOffset.to&&(_b(A.endPointOffset.to)?g.endPointOffset.to=A.endPointOffset.to:(g.endPointOffset.to=void 0!==I.endPointOffset.to?I.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),Vw(A.label)?g.label=A.label:Vw(g.label)||(g.label=void 0),ju(g,A,"smooth",I),ju(g,A,"shadow",I),ju(g,A,"background",I),void 0!==A.dashes&&null!==A.dashes?g.dashes=A.dashes:!0===C&&null===A.dashes&&(g.dashes=Ph(I.dashes)),void 0!==A.scaling&&null!==A.scaling?(void 0!==A.scaling.min&&(g.scaling.min=A.scaling.min),void 0!==A.scaling.max&&(g.scaling.max=A.scaling.max),ju(g.scaling,A.scaling,"label",I.scaling)):!0===C&&null===A.scaling&&(g.scaling=Ph(I.scaling)),void 0!==A.arrows&&null!==A.arrows)if("string"==typeof A.arrows){const C=A.arrows.toLowerCase();g.arrows.to.enabled=-1!=kh(C).call(C,"to"),g.arrows.middle.enabled=-1!=kh(C).call(C,"middle"),g.arrows.from.enabled=-1!=kh(C).call(C,"from")}else{if("object"!=typeof A.arrows)throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+Zh(A.arrows));ju(g.arrows,A.arrows,"to",I.arrows),ju(g.arrows,A.arrows,"middle",I.arrows),ju(g.arrows,A.arrows,"from",I.arrows)}else!0===C&&null===A.arrows&&(g.arrows=Ph(I.arrows));if(void 0!==A.color&&null!==A.color){const e=vu(A.color)?{color:A.color,highlight:A.color,hover:A.color,inherit:!1,opacity:1}:A.color,i=g.color;if(t)Tu(i,I.color,!1,C);else for(const g in i)Object.prototype.hasOwnProperty.call(i,g)&&delete i[g];if(vu(i))i.color=i,i.highlight=i,i.hover=i,i.inherit=!1,void 0===e.opacity&&(i.opacity=1);else{let g=!1;void 0!==e.color&&(i.color=e.color,g=!0),void 0!==e.highlight&&(i.highlight=e.highlight,g=!0),void 0!==e.hover&&(i.hover=e.hover,g=!0),void 0!==e.inherit&&(i.inherit=e.inherit),void 0!==e.opacity&&(i.opacity=Math.min(1,Math.max(0,e.opacity))),!0===g?i.inherit=!1:void 0===i.inherit&&(i.inherit="from")}}else!0===C&&null===A.color&&(g.color=Lu(I.color));!0===C&&null===A.font&&(g.font=Lu(I.font)),Object.prototype.hasOwnProperty.call(A,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),g.selfReference.size=A.selfReferenceSize)}getFormattingValues(){const g=!0===this.options.arrows.to||!0===this.options.arrows.to.enabled,A=!0===this.options.arrows.from||!0===this.options.arrows.from.enabled,C=!0===this.options.arrows.middle||!0===this.options.arrows.middle.enabled,I=this.options.color.inherit,t={toArrow:g,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:C,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:A,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:I?void 0:this.options.color.color,inheritsColor:I,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(!0===this.chooser){if(this.selected){const g=this.options.selectionWidth;"function"==typeof g?t.width=g(t.width):"number"==typeof g&&(t.width+=g),t.width=Math.max(t.width,.3/this.body.view.scale),t.color=this.options.color.highlight,t.shadow=this.options.shadow.enabled}else if(this.hover){const g=this.options.hoverWidth;"function"==typeof g?t.width=g(t.width):"number"==typeof g&&(t.width+=g),t.width=Math.max(t.width,.3/this.body.view.scale),t.color=this.options.color.hover,t.shadow=this.options.shadow.enabled}}else"function"==typeof this.chooser&&(this.chooser(t,this.options.id,this.selected,this.hover),void 0!==t.color&&(t.inheritsColor=!1),!1===t.shadow&&(t.shadowColor===this.options.shadow.color&&t.shadowSize===this.options.shadow.size&&t.shadowX===this.options.shadow.x&&t.shadowY===this.options.shadow.y||(t.shadow=!0)));else t.shadow=this.options.shadow.enabled,t.width=Math.max(t.width,.3/this.body.view.scale);return t}updateLabelModule(g){const A=[g,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,A),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){const g=this.options.smooth;let A=!1,C=!0;return void 0!==this.edgeType&&((this.edgeType instanceof Ux&&!0===g.enabled&&"dynamic"===g.type||this.edgeType instanceof Xx&&!0===g.enabled&&"cubicBezier"===g.type||this.edgeType instanceof Kx&&!0===g.enabled&&"dynamic"!==g.type&&"cubicBezier"!==g.type||this.edgeType instanceof _x&&!1===g.type.enabled)&&(C=!1),!0===C&&(A=this.cleanup())),!0===C?!0===g.enabled?"dynamic"===g.type?(A=!0,this.edgeType=new Ux(this.options,this.body,this.labelModule)):"cubicBezier"===g.type?this.edgeType=new Xx(this.options,this.body,this.labelModule):this.edgeType=new Kx(this.options,this.body,this.labelModule):this.edgeType=new _x(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),A}connect(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=void 0!==this.from&&void 0!==this.to,!0===this.connected?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}disconnect(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}getTitle(){return this.title}isSelected(){return this.selected}getValue(){return this.options.value}setValueRange(g,A,C){if(void 0!==this.options.value){const I=this.options.scaling.customScalingFunction(g,A,C,this.options.value),t=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){const g=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+I*g}this.options.width=this.options.scaling.min+I*t}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}_setInteractionWidths(){"function"==typeof this.options.hoverWidth?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,"function"==typeof this.options.selectionWidth?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}draw(g){const A=this.getFormattingValues();if(A.hidden)return;const C=this.edgeType.getViaNode();this.edgeType.drawLine(g,A,this.selected,this.hover,C),this.drawLabel(g,C)}drawArrows(g){const A=this.getFormattingValues();if(A.hidden)return;const C=this.edgeType.getViaNode(),I={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,A.fromArrow&&(I.from=this.edgeType.getArrowData(g,"from",C,this.selected,this.hover,A),!1===A.arrowStrikethrough&&(this.edgeType.fromPoint=I.from.core),A.fromArrowSrc&&(I.from.image=this.imagelist.load(A.fromArrowSrc)),A.fromArrowImageWidth&&(I.from.imageWidth=A.fromArrowImageWidth),A.fromArrowImageHeight&&(I.from.imageHeight=A.fromArrowImageHeight)),A.toArrow&&(I.to=this.edgeType.getArrowData(g,"to",C,this.selected,this.hover,A),!1===A.arrowStrikethrough&&(this.edgeType.toPoint=I.to.core),A.toArrowSrc&&(I.to.image=this.imagelist.load(A.toArrowSrc)),A.toArrowImageWidth&&(I.to.imageWidth=A.toArrowImageWidth),A.toArrowImageHeight&&(I.to.imageHeight=A.toArrowImageHeight)),A.middleArrow&&(I.middle=this.edgeType.getArrowData(g,"middle",C,this.selected,this.hover,A),A.middleArrowSrc&&(I.middle.image=this.imagelist.load(A.middleArrowSrc)),A.middleArrowImageWidth&&(I.middle.imageWidth=A.middleArrowImageWidth),A.middleArrowImageHeight&&(I.middle.imageHeight=A.middleArrowImageHeight)),A.fromArrow&&this.edgeType.drawArrowHead(g,A,this.selected,this.hover,I.from),A.middleArrow&&this.edgeType.drawArrowHead(g,A,this.selected,this.hover,I.middle),A.toArrow&&this.edgeType.drawArrowHead(g,A,this.selected,this.hover,I.to)}drawLabel(g,A){if(void 0!==this.options.label){const C=this.from,I=this.to;let t;if(this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(g,this.selected,this.hover),C.id!=I.id){this.labelModule.pointToSelf=!1,t=this.edgeType.getPoint(.5,A),g.save();const C=this._getRotation(g);0!=C.angle&&(g.translate(C.x,C.y),g.rotate(C.angle)),this.labelModule.draw(g,t.x,t.y,this.selected,this.hover),g.restore()}else{this.labelModule.pointToSelf=!0;const A=Yw(g,this.options.selfReference.angle,this.options.selfReference.size,C);t=this._pointOnCircle(A.x,A.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(g,t.x,t.y,this.selected,this.hover)}}}getItemsOnPoint(g){const A=[];if(this.labelModule.visible()){const C=this._getRotation();jw(this.labelModule.getSize(),g,C)&&A.push({edgeId:this.id,labelId:0})}const C={left:g.x,top:g.y};return this.isOverlappingWith(C)&&A.push({edgeId:this.id}),A}isOverlappingWith(g){if(this.connected){const A=10,C=this.from.x,I=this.from.y,t=this.to.x,e=this.to.y,i=g.left,o=g.top;return this.edgeType.getDistanceToEdge(C,I,t,e,i,o)0&&e<0)&&(i+=Math.PI),I.angle=i,I}_pointOnCircle(g,A,C,I){return{x:g+C*Math.cos(I),y:A-C*Math.sin(I)}}select(){this.selected=!0}unselect(){this.selected=!1}cleanup(){return this.edgeType.cleanup()}remove(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}endPointsValid(){return void 0!==this.body.nodes[this.fromId]&&void 0!==this.body.nodes[this.toId]}}class qx{constructor(g,A,C){var I;this.body=g,this.images=A,this.groups=C,this.body.functions.createEdge=GI(I=this.create).call(I,this),this.edgesListeners={add:(g,A)=>{this.add(A.items)},update:(g,A)=>{this.update(A.items)},remove:(g,A)=>{this.remove(A.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},endPointOffset:{from:0,to:0},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(g,A,C,I){if(A===g)return.5;{const C=1/(A-g);return Math.max(0,(I-g)*C)}}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},Tu(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var g,A,C=this;this.body.emitter.on("_forceDisableDynamicCurves",(function(g){let A=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];"dynamic"===g&&(g="continuous");let I=!1;for(const A in C.body.edges)if(Object.prototype.hasOwnProperty.call(C.body.edges,A)){const t=C.body.edges[A],e=C.body.data.edges.get(A);if(null!=e){const A=e.smooth;void 0!==A&&!0===A.enabled&&"dynamic"===A.type&&(void 0===g?t.setOptions({smooth:!1}):t.setOptions({smooth:{type:g}}),I=!0)}}!0===A&&!0===I&&C.body.emitter.emit("_dataChanged")})),this.body.emitter.on("_dataUpdated",(()=>{this.reconnectEdges()})),this.body.emitter.on("refreshEdges",GI(g=this.refresh).call(g,this)),this.body.emitter.on("refresh",GI(A=this.refresh).call(A,this)),this.body.emitter.on("destroy",(()=>{ku(this.edgesListeners,((g,A)=>{this.body.data.edges&&this.body.data.edges.off(A,g)})),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners}))}setOptions(g){if(void 0!==g){Jx.parseOptions(this.options,g,!0,this.defaultOptions,!0);let A=!1;if(void 0!==g.smooth)for(const g in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,g)&&(A=this.body.edges[g].updateEdgeType()||A);if(void 0!==g.font)for(const g in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,g)&&this.body.edges[g].updateLabelModule();void 0===g.hidden&&void 0===g.physics&&!0!==A||this.body.emitter.emit("_dataChanged")}}setData(g){let A=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const C=this.body.data.edges;if(vw("id",g))this.body.data.edges=g;else if(Wr(g))this.body.data.edges=new fw,this.body.data.edges.add(g);else{if(g)throw new TypeError("Array or DataSet expected");this.body.data.edges=new fw}if(C&&ku(this.edgesListeners,((g,A)=>{C.off(A,g)})),this.body.edges={},this.body.data.edges){ku(this.edgesListeners,((g,A)=>{this.body.data.edges.on(A,g)}));const g=this.body.data.edges.getIds();this.add(g,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===A&&this.body.emitter.emit("_dataChanged")}add(g){let A=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const C=this.body.edges,I=this.body.data.edges;for(let A=0;A1&&void 0!==arguments[1])||arguments[1];if(0===g.length)return;const C=this.body.edges;ku(g,(g=>{const A=C[g];void 0!==A&&A.remove()})),A&&this.body.emitter.emit("_dataChanged")}refresh(){ku(this.body.edges,((g,A)=>{const C=this.body.data.edges.get(A);void 0!==C&&g.setOptions(C)}))}create(g){return new Jx(g,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let g;const A=this.body.nodes,C=this.body.edges;for(g in A)Object.prototype.hasOwnProperty.call(A,g)&&(A[g].edges=[]);for(g in C)if(Object.prototype.hasOwnProperty.call(C,g)){const A=C[g];A.from=null,A.to=null,A.connect()}}getConnectedNodes(g){const A=[];if(void 0!==this.body.edges[g]){const C=this.body.edges[g];void 0!==C.fromId&&A.push(C.fromId),void 0!==C.toId&&A.push(C.toId)}return A}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){const g=[];ku(this.body.edges,((A,C)=>{const I=this.body.nodes[A.toId],t=this.body.nodes[A.fromId];void 0!==I&&!0===I.isCluster||void 0!==t&&!0===t.isCluster||void 0!==I&&void 0!==t||g.push(C)})),this.remove(g,!1)}_addMissingEdges(){const g=this.body.data.edges;if(null==g)return;const A=this.body.edges,C=[];pa(g).call(g,((g,I)=>{void 0===A[I]&&C.push(I)})),this.add(C,!0)}}class $x{constructor(g,A,C){this.body=g,this.physicsBody=A,this.barnesHutTree,this.setOptions(C),this._rng=hu("BARNES HUT SOLVER")}setOptions(g){this.options=g,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}solve(){if(0!==this.options.gravitationalConstant&&this.physicsBody.physicsNodeIndices.length>0){let g;const A=this.body.nodes,C=this.physicsBody.physicsNodeIndices,I=C.length,t=this._formBarnesHutTree(A,C);this.barnesHutTree=t;for(let e=0;e0&&this._getForceContributions(t.root,g)}}_getForceContributions(g,A){this._getForceContribution(g.children.NW,A),this._getForceContribution(g.children.NE,A),this._getForceContribution(g.children.SW,A),this._getForceContribution(g.children.SE,A)}_getForceContribution(g,A){if(g.childrenCount>0){const C=g.centerOfMass.x-A.x,I=g.centerOfMass.y-A.y,t=Math.sqrt(C*C+I*I);t*g.calcSize>this.thetaInversed?this._calculateForces(t,C,I,A,g):4===g.childrenCount?this._getForceContributions(g,A):g.children.data.id!=A.id&&this._calculateForces(t,C,I,A,g)}}_calculateForces(g,A,C,I,t){0===g&&(A=g=.1),this.overlapAvoidanceFactor<1&&I.shape.radius&&(g=Math.max(.1+this.overlapAvoidanceFactor*I.shape.radius,g-I.shape.radius));const e=this.options.gravitationalConstant*t.mass*I.options.mass/Math.pow(g,3),i=A*e,o=C*e;this.physicsBody.forces[I.id].x+=i,this.physicsBody.forces[I.id].y+=o}_formBarnesHutTree(g,A){let C;const I=A.length;let t=g[A[0]].x,e=g[A[0]].y,i=g[A[0]].x,o=g[A[0]].y;for(let C=1;C0&&(si&&(i=s),no&&(o=n))}const s=Math.abs(i-t)-Math.abs(o-e);s>0?(e-=.5*s,o+=.5*s):(t+=.5*s,i-=.5*s);const n=Math.max(1e-5,Math.abs(i-t)),r=.5*n,a=.5*(t+i),d=.5*(e+o),h={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:a-r,maxX:a+r,minY:d-r,maxY:d+r},size:n,calcSize:1/n,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(h.root);for(let t=0;t0&&this._placeInTree(h.root,C);return h}_updateBranchMass(g,A){const C=g.centerOfMass,I=g.mass+A.options.mass,t=1/I;C.x=C.x*g.mass+A.x*A.options.mass,C.x*=t,C.y=C.y*g.mass+A.y*A.options.mass,C.y*=t,g.mass=I;const e=Math.max(Math.max(A.height,A.radius),A.width);g.maxWidth=g.maxWidthA.x?I.maxY>A.y?"NW":"SW":I.maxY>A.y?"NE":"SE",this._placeInRegion(g,A,t)}_placeInRegion(g,A,C){const I=g.children[C];switch(I.childrenCount){case 0:I.children.data=A,I.childrenCount=1,this._updateBranchMass(I,A);break;case 1:I.children.data.x===A.x&&I.children.data.y===A.y?(A.x+=this._rng(),A.y+=this._rng()):(this._splitBranch(I),this._placeInTree(I,A));break;case 4:this._placeInTree(I,A)}}_splitBranch(g){let A=null;1===g.childrenCount&&(A=g.children.data,g.mass=0,g.centerOfMass.x=0,g.centerOfMass.y=0),g.childrenCount=4,g.children.data=null,this._insertRegion(g,"NW"),this._insertRegion(g,"NE"),this._insertRegion(g,"SW"),this._insertRegion(g,"SE"),null!=A&&this._placeInTree(g,A)}_insertRegion(g,A){let C,I,t,e;const i=.5*g.size;switch(A){case"NW":C=g.range.minX,I=g.range.minX+i,t=g.range.minY,e=g.range.minY+i;break;case"NE":C=g.range.minX+i,I=g.range.maxX,t=g.range.minY,e=g.range.minY+i;break;case"SW":C=g.range.minX,I=g.range.minX+i,t=g.range.minY+i,e=g.range.maxY;break;case"SE":C=g.range.minX+i,I=g.range.maxX,t=g.range.minY+i,e=g.range.maxY}g.children[A]={centerOfMass:{x:0,y:0},mass:0,range:{minX:C,maxX:I,minY:t,maxY:e},size:.5*g.size,calcSize:2*g.calcSize,children:{data:null},maxWidth:0,level:g.level+1,childrenCount:0}}_debug(g,A){void 0!==this.barnesHutTree&&(g.lineWidth=1,this._drawBranch(this.barnesHutTree.root,g,A))}_drawBranch(g,A,C){void 0===C&&(C="#FF0000"),4===g.childrenCount&&(this._drawBranch(g.children.NW,A),this._drawBranch(g.children.NE,A),this._drawBranch(g.children.SE,A),this._drawBranch(g.children.SW,A)),A.strokeStyle=C,A.beginPath(),A.moveTo(g.range.minX,g.range.minY),A.lineTo(g.range.maxX,g.range.minY),A.stroke(),A.beginPath(),A.moveTo(g.range.maxX,g.range.minY),A.lineTo(g.range.maxX,g.range.maxY),A.stroke(),A.beginPath(),A.moveTo(g.range.maxX,g.range.maxY),A.lineTo(g.range.minX,g.range.maxY),A.stroke(),A.beginPath(),A.moveTo(g.range.minX,g.range.maxY),A.lineTo(g.range.minX,g.range.minY),A.stroke()}}class gE{constructor(g,A,C){this._rng=hu("REPULSION SOLVER"),this.body=g,this.physicsBody=A,this.setOptions(C)}setOptions(g){this.options=g}solve(){let g,A,C,I,t,e,i,o;const s=this.body.nodes,n=this.physicsBody.physicsNodeIndices,r=this.physicsBody.forces,a=this.options.nodeDistance,d=-2/3/a;for(let h=0;h0){const g=t.edges.length+1,e=this.options.centralGravity*g*t.options.mass;I[t.id].x=A*e,I[t.id].y=C*e}}}class oE{constructor(g){this.body=g,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},fI(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("initPhysics",(()=>{this.initPhysics()})),this.body.emitter.on("_layoutFailed",(()=>{this.layoutFailed=!0})),this.body.emitter.on("resetPhysics",(()=>{this.stopSimulation(),this.ready=!1})),this.body.emitter.on("disablePhysics",(()=>{this.physicsEnabled=!1,this.stopSimulation()})),this.body.emitter.on("restorePhysics",(()=>{this.setOptions(this.options),!0===this.ready&&this.startSimulation()})),this.body.emitter.on("startSimulation",(()=>{!0===this.ready&&this.startSimulation()})),this.body.emitter.on("stopSimulation",(()=>{this.stopSimulation()})),this.body.emitter.on("destroy",(()=>{this.stopSimulation(!1),this.body.emitter.off()})),this.body.emitter.on("_dataChanged",(()=>{this.updatePhysicsData()}))}setOptions(g){if(void 0!==g)if(!1===g)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(!0===g)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,Ou(["stabilization"],this.options,g),ju(this.options,g,"stabilization"),void 0===g.enabled&&(this.options.enabled=!0),!1===this.options.enabled&&(this.physicsEnabled=!1,this.stopSimulation());const A=this.options.wind;A&&(("number"!=typeof A.x||Kb(A.x))&&(A.x=0),("number"!=typeof A.y||Kb(A.y))&&(A.y=0)),this.timestep=this.options.timestep}this.init()}init(){let g;"forceAtlas2Based"===this.options.solver?(g=this.options.forceAtlas2Based,this.nodesSolver=new eE(this.body,this.physicsBody,g),this.edgesSolver=new CE(this.body,this.physicsBody,g),this.gravitySolver=new iE(this.body,this.physicsBody,g)):"repulsion"===this.options.solver?(g=this.options.repulsion,this.nodesSolver=new gE(this.body,this.physicsBody,g),this.edgesSolver=new CE(this.body,this.physicsBody,g),this.gravitySolver=new tE(this.body,this.physicsBody,g)):"hierarchicalRepulsion"===this.options.solver?(g=this.options.hierarchicalRepulsion,this.nodesSolver=new AE(this.body,this.physicsBody,g),this.edgesSolver=new IE(this.body,this.physicsBody,g),this.gravitySolver=new tE(this.body,this.physicsBody,g)):(g=this.options.barnesHut,this.nodesSolver=new $x(this.body,this.physicsBody,g),this.edgesSolver=new CE(this.body,this.physicsBody,g),this.gravitySolver=new tE(this.body,this.physicsBody,g)),this.modelOptions=g}initPhysics(){!0===this.physicsEnabled&&!0===this.options.enabled?!0===this.options.stabilization.enabled?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}startSimulation(){var g;!0===this.physicsEnabled&&!0===this.options.enabled?(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),void 0===this.viewFunction&&(this.viewFunction=GI(g=this.simulationStep).call(g,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}stopSimulation(){let g=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.stabilized=!0,!0===g&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,!0===g&&this.body.emitter.emit("_stopRendering"))}simulationStep(){const g=ta();this.physicsTick();(ta()-g<.4*this.simulationInterval||!0===this.runDoubleSpeed)&&!1===this.stabilized&&(this.physicsTick(),this.runDoubleSpeed=!0),!0===this.stabilized&&this.stopSimulation()}_emitStabilized(){let g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||!0===this.startedStabilization)&&Al((()=>{this.body.emitter.emit("stabilized",{iterations:g}),this.startedStabilization=!1,this.stabilizationIterations=0}),0)}physicsStep(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}adjustTimeStep(){!0===this._evaluateStepQuality()?this.timestep=1.2*this.timestep:this.timestep/1.2.3))return!1;return!0}moveNodes(){const g=this.physicsBody.physicsNodeIndices;let A=0,C=0;for(let I=0;II&&(g=g>0?I:-I),g}_performStep(g){const A=this.body.nodes[g],C=this.physicsBody.forces[g];this.options.wind&&(C.x+=this.options.wind.x,C.y+=this.options.wind.y);const I=this.physicsBody.velocities[g];this.previousStates[g]={x:A.x,y:A.y,vx:I.x,vy:I.y},!1===A.options.fixed.x?(I.x=this.calculateComponentVelocity(I.x,C.x,A.options.mass),A.x+=I.x*this.timestep):(C.x=0,I.x=0),!1===A.options.fixed.y?(I.y=this.calculateComponentVelocity(I.y,C.y,A.options.mass),A.y+=I.y*this.timestep):(C.y=0,I.y=0);return Math.sqrt(Math.pow(I.x,2)+Math.pow(I.y,2))}_freezeNodes(){const g=this.body.nodes;for(const A in g)if(Object.prototype.hasOwnProperty.call(g,A)&&g[A].x&&g[A].y){const C=g[A].options.fixed;this.freezeCache[A]={x:C.x,y:C.y},C.x=!0,C.y=!0}}_restoreFrozenNodes(){const g=this.body.nodes;for(const A in g)Object.prototype.hasOwnProperty.call(g,A)&&void 0!==this.freezeCache[A]&&(g[A].options.fixed.x=this.freezeCache[A].x,g[A].options.fixed.y=this.freezeCache[A].y);this.freezeCache={}}stabilize(){let g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.stabilization.iterations;"number"!=typeof g&&(g=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",g)),0!==this.physicsBody.physicsNodeIndices.length?(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=g,!0===this.options.stabilization.onlyDynamicEdges&&this._freezeNodes(),this.stabilizationIterations=0,Al((()=>this._stabilizationBatch()),0)):this.ready=!0}_startStabilizing(){return!0!==this.startedStabilization&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){const g=()=>!1===this.stabilized&&this.stabilizationIterations{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&A();let C=0;for(;g()&&C1&&void 0!==arguments[1]?arguments[1]:[],I=1e9,t=-1e9,e=1e9,i=-1e9;if(C.length>0)for(let o=0;oA.shape.boundingBox.left&&(e=A.shape.boundingBox.left),iA.shape.boundingBox.top&&(I=A.shape.boundingBox.top),t1&&void 0!==arguments[1]?arguments[1]:[],I=1e9,t=-1e9,e=1e9,i=-1e9;if(C.length>0)for(let o=0;oA.x&&(e=A.x),iA.y&&(I=A.y),t{delete this.containedEdges[g.id]})),ku(A.containedNodes,((g,A)=>{this.containedNodes[A]=g})),A.containedNodes={},ku(A.containedEdges,((g,A)=>{this.containedEdges[A]=g})),A.containedEdges={},ku(A.edges,(g=>{ku(this.edges,(A=>{var C,I;const t=kh(C=A.clusteringEdgeReplacingIds).call(C,g.id);-1!==t&&(ku(g.clusteringEdgeReplacingIds,(g=>{A.clusteringEdgeReplacingIds.push(g),this.body.edges[g].edgeReplacedById=A.id})),gd(I=A.clusteringEdgeReplacingIds).call(I,t,1))}))})),A.edges=[]}}class rE{constructor(g){this.body=g,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},fI(this.options,this.defaultOptions),this.body.emitter.on("_resetData",(()=>{this.clusteredNodes={},this.clusteredEdges={}}))}clusterByHubsize(g,A){void 0===g?g=this._getHubSize():"object"==typeof g&&(A=this._checkOptions(g),g=this._getHubSize());const C=[];for(let A=0;A=g&&C.push(I.id)}for(let g=0;g0&&void 0!==arguments[0]?arguments[0]:{},A=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===g.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");g=this._checkOptions(g);const C={},I={};ku(this.body.nodes,((A,t)=>{A.options&&!0===g.joinCondition(A.options)&&(C[t]=A,ku(A.edges,(g=>{void 0===this.clusteredEdges[g.id]&&(I[g.id]=g)})))})),this._cluster(C,I,g,A)}clusterByEdgeCount(g,A){let C=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];A=this._checkOptions(A);const I=[],t={};let e,i,o;for(let C=0;C0&&ga(n).length>0&&!0===C){const g=function(){for(let g=0;g1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(1,g,A)}clusterBridges(g){let A=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(2,g,A)}clusterByConnection(g,A){var C;let I=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===g)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[g])throw new Error("The nodeId given to clusterByConnection does not exist!");const t=this.body.nodes[g];void 0===(A=this._checkOptions(A,t)).clusterNodeProperties.x&&(A.clusterNodeProperties.x=t.x),void 0===A.clusterNodeProperties.y&&(A.clusterNodeProperties.y=t.y),void 0===A.clusterNodeProperties.fixed&&(A.clusterNodeProperties.fixed={},A.clusterNodeProperties.fixed.x=t.options.fixed.x,A.clusterNodeProperties.fixed.y=t.options.fixed.y);const e={},i={},o=t.id,s=sE.cloneOptions(t);e[o]=t;for(let g=0;g-1&&(i[C.id]=C)}}this._cluster(e,i,A,I)}_createClusterEdges(g,A,C,I){let t,e,i,o,s,n;const r=ga(g),a=[];for(let I=0;I0&&void 0!==arguments[0]?arguments[0]:{};return void 0===g.clusterEdgeProperties&&(g.clusterEdgeProperties={}),void 0===g.clusterNodeProperties&&(g.clusterNodeProperties={}),g}_cluster(g,A,C){let I=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const t=[];for(const A in g)Object.prototype.hasOwnProperty.call(g,A)&&void 0!==this.clusteredNodes[A]&&t.push(A);for(let A=0;At?C.x:t,e=C.yi?C.y:i;return{x:.5*(I+t),y:.5*(e+i)}}openCluster(g,A){let C=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===g)throw new Error("No clusterNodeId supplied to openCluster.");const I=this.body.nodes[g];if(void 0===I)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(!0!==I.isCluster||void 0===I.containedNodes||void 0===I.containedEdges)throw new Error("The node:"+g+" is not a valid cluster.");const t=this.findNode(g),e=kh(t).call(t,g)-1;if(e>=0){const A=t[e];return this.body.nodes[A]._openChildCluster(g),delete this.body.nodes[g],void(!0===C&&this.body.emitter.emit("_dataChanged"))}const i=I.containedNodes,o=I.containedEdges;if(void 0!==A&&void 0!==A.releaseFunction&&"function"==typeof A.releaseFunction){const g={},C={x:I.x,y:I.y};for(const A in i)if(Object.prototype.hasOwnProperty.call(i,A)){const C=this.body.nodes[A];g[A]={x:C.x,y:C.y}}const t=A.releaseFunction(C,g);for(const g in i)if(Object.prototype.hasOwnProperty.call(i,g)){const A=this.body.nodes[g];void 0!==t[g]&&(A.x=void 0===t[g].x?I.x:t[g].x,A.y=void 0===t[g].y?I.y:t[g].y)}}else ku(i,(function(g){!1===g.options.fixed.x&&(g.x=I.x),!1===g.options.fixed.y&&(g.y=I.y)}));for(const g in i)if(Object.prototype.hasOwnProperty.call(i,g)){const A=this.body.nodes[g];A.vx=I.vx,A.vy=I.vy,A.setOptions({physics:!0}),delete this.clusteredNodes[g]}const s=[];for(let g=0;g0&&t<100;){const g=A.pop();if(void 0===g)continue;const e=this.body.edges[g];if(void 0===e)continue;t++;const i=e.clusteringEdgeReplacingIds;if(void 0===i)I.push(g);else for(let g=0;gI&&(I=e.edges.length),g+=e.edges.length,A+=Math.pow(e.edges.length,2),C+=1}g/=C,A/=C;const t=A-Math.pow(g,2),e=Math.sqrt(t);let i=Math.floor(g+2*e);return i>I&&(i=I),i}_createClusteredEdge(g,A,C,I,t){const e=sE.cloneOptions(C,"edge");Tu(e,I),e.from=g,e.to=A,e.id="clusterEdge:"+nw(),void 0!==t&&Tu(e,t);const i=this.body.functions.createEdge(e);return i.clusteringEdgeReplacingIds=[C.id],i.connect(),this.body.edges[i.id]=i,i}_clusterEdges(g,A,C,I){if(A instanceof Jx){const g=A,C={};C[g.id]=g,A=C}if(g instanceof bx){const A=g,C={};C[A.id]=A,g=C}if(null==C)throw new Error("_clusterEdges: parameter clusterNode required");void 0===I&&(I=C.clusterEdgeProperties),this._createClusterEdges(g,A,C,I);for(const g in A)if(Object.prototype.hasOwnProperty.call(A,g)&&void 0!==this.body.edges[g]){const A=this.body.edges[g];this._backupEdgeOptions(A),A.setOptions({physics:!1})}for(const A in g)Object.prototype.hasOwnProperty.call(g,A)&&(this.clusteredNodes[A]={clusterId:C.id,node:this.body.nodes[A]},this.body.nodes[A].setOptions({physics:!1}))}_getClusterNodeForNode(g){if(void 0===g)return;const A=this.clusteredNodes[g];if(void 0===A)return;const C=A.clusterId;return void 0!==C?this.body.nodes[C]:void 0}_filter(g,A){const C=[];return ku(g,(g=>{A(g)&&C.push(g)})),C}_updateState(){let g;const A=[],C={},I=g=>{ku(this.body.nodes,(A=>{!0===A.isCluster&&g(A)}))};for(g in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,g))continue;void 0===this.body.nodes[g]&&A.push(g)}I((function(g){for(let C=0;C{const A=this.body.edges[g];void 0!==A&&A.endPointsValid()||(C[g]=g)})),I((function(g){ku(g.containedEdges,((g,A)=>{g.endPointsValid()||C[A]||(C[A]=A)}))})),ku(this.body.edges,((g,A)=>{let I=!0;const t=g.clusteringEdgeReplacingIds;if(void 0!==t){let g=0;ku(t,(A=>{const C=this.body.edges[A];void 0!==C&&C.endPointsValid()&&(g+=1)})),I=g>0}g.endPointsValid()&&I||(C[A]=A)})),I((g=>{ku(C,(A=>{delete g.containedEdges[A],ku(g.edges,((I,t)=>{I.id!==A?I.clusteringEdgeReplacingIds=this._filter(I.clusteringEdgeReplacingIds,(function(g){return!C[g]})):g.edges[t]=null})),g.edges=this._filter(g.edges,(function(g){return null!==g}))}))})),ku(C,(g=>{delete this.clusteredEdges[g]})),ku(C,(g=>{delete this.body.edges[g]}));ku(ga(this.body.edges),(g=>{const A=this.body.edges[g],C=this._isClusteredNode(A.fromId)||this._isClusteredNode(A.toId);if(C!==this._isClusteredEdge(A.id))if(C){const g=this._getClusterNodeForNode(A.fromId);void 0!==g&&this._clusterEdges(this.body.nodes[A.fromId],A,g);const C=this._getClusterNodeForNode(A.toId);void 0!==C&&this._clusterEdges(this.body.nodes[A.toId],A,C)}else delete this._clusterEdges[g],this._restoreEdge(A)}));let t=!1,e=!0;for(;e;){const g=[];I((function(A){const C=ga(A.containedNodes).length,I=!0===A.options.allowSingleNodeCluster;(I&&C<1||!I&&C<2)&&g.push(A.id)}));for(let A=0;A0,t=t||e}t&&this._updateState()}_isClusteredNode(g){return void 0!==this.clusteredNodes[g]}_isClusteredEdge(g){return void 0!==this.clusteredEdges[g]}}class aE{constructor(g,A){this.body=g,this.canvas=A,this.redrawRequested=!1,this.requestAnimationFrameRequestId=void 0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},fI(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var g;this.body.emitter.on("dragStart",(()=>{this.dragging=!0})),this.body.emitter.on("dragEnd",(()=>{this.dragging=!1})),this.body.emitter.on("zoom",(()=>{this.zooming=!0,window.clearTimeout(this.zoomTimeoutId),this.zoomTimeoutId=Al((()=>{var g;this.zooming=!1,GI(g=this._requestRedraw).call(g,this)()}),250)})),this.body.emitter.on("_resizeNodes",(()=>{this._resizeNodes()})),this.body.emitter.on("_redraw",(()=>{!1===this.renderingActive&&this._redraw()})),this.body.emitter.on("_blockRedraw",(()=>{this.allowRedraw=!1})),this.body.emitter.on("_allowRedraw",(()=>{this.allowRedraw=!0,this.redrawRequested=!1})),this.body.emitter.on("_requestRedraw",GI(g=this._requestRedraw).call(g,this)),this.body.emitter.on("_startRendering",(()=>{this.renderRequests+=1,this.renderingActive=!0,this._startRendering()})),this.body.emitter.on("_stopRendering",(()=>{this.renderRequests-=1,this.renderingActive=this.renderRequests>0,this.requestAnimationFrameRequestId=void 0})),this.body.emitter.on("destroy",(()=>{this.renderRequests=0,this.allowRedraw=!1,this.renderingActive=!1,window.cancelAnimationFrame(this.requestAnimationFrameRequestId),this.body.emitter.off()}))}setOptions(g){if(void 0!==g){Eu(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,g)}}_startRendering(){var g;!0===this.renderingActive&&(void 0===this.requestAnimationFrameRequestId&&(this.requestAnimationFrameRequestId=window.requestAnimationFrame(GI(g=this._renderStep).call(g,this),this.simulationInterval)))}_renderStep(){!0===this.renderingActive&&(this.requestAnimationFrameRequestId=void 0,this._startRendering(),this._redraw())}redraw(){this.body.emitter.emit("setSize"),this._redraw()}_requestRedraw(){!0!==this.redrawRequested&&!1===this.renderingActive&&!0===this.allowRedraw&&(this.redrawRequested=!0,window.requestAnimationFrame((()=>{this._redraw(!1)})))}_redraw(){let g=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!0===this.allowRedraw){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;const A={drawExternalLabels:null};0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),this.canvas.setTransform();const C=this.canvas.getContext(),I=this.canvas.frame.canvas.clientWidth,t=this.canvas.frame.canvas.clientHeight;if(C.clearRect(0,0,I,t),0===this.canvas.frame.clientWidth)return;if(C.save(),C.translate(this.body.view.translation.x,this.body.view.translation.y),C.scale(this.body.view.scale,this.body.view.scale),C.beginPath(),this.body.emitter.emit("beforeDrawing",C),C.closePath(),!1===g&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawEdges(C),!1===this.dragging||!0===this.dragging&&!1===this.options.hideNodesOnDrag){const{drawExternalLabels:I}=this._drawNodes(C,g);A.drawExternalLabels=I}!1===g&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawArrows(C),null!=A.drawExternalLabels&&A.drawExternalLabels(),!1===g&&this._drawSelectionBox(C),C.beginPath(),this.body.emitter.emit("afterDrawing",C),C.closePath(),C.restore(),!0===g&&C.clearRect(0,0,I,t)}}_resizeNodes(){this.canvas.setTransform();const g=this.canvas.getContext();g.save(),g.translate(this.body.view.translation.x,this.body.view.translation.y),g.scale(this.body.view.scale,this.body.view.scale);const A=this.body.nodes;let C;for(const I in A)Object.prototype.hasOwnProperty.call(A,I)&&(C=A[I],C.resize(g),C.updateBoundingBox(g,C.selected));g.restore()}_drawNodes(g){let A=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const C=this.body.nodes,I=this.body.nodeIndices;let t;const e=[],i=[],o=this.canvas.DOMtoCanvas({x:-20,y:-20}),s=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+20,y:this.canvas.frame.canvas.clientHeight+20}),n={top:o.y,left:o.x,bottom:s.y,right:s.x},r=[];for(let o=0;o{for(const g of r)g()}}}_drawEdges(g){const A=this.body.edges,C=this.body.edgeIndices;for(let I=0;I{0!==g.width&&(this.body.view.translation.x=.5*g.width),0!==g.height&&(this.body.view.translation.y=.5*g.height)})),this.body.emitter.on("setSize",GI(g=this.setSize).call(g,this)),this.body.emitter.on("destroy",(()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()}))}setOptions(g){if(void 0!==g){Eu(["width","height","autoResize"],this.options,g)}if(this._cleanUp(),!0===this.options.autoResize){var A;if(window.ResizeObserver){const g=new ResizeObserver((()=>{!0===this.setSize()&&this.body.emitter.emit("_requestRedraw")})),{frame:A}=this;g.observe(A),this._cleanupCallbacks.push((()=>{g.unobserve(A)}))}else{const g=dE((()=>{!0===this.setSize()&&this.body.emitter.emit("_requestRedraw")}),1e3);this._cleanupCallbacks.push((()=>{clearInterval(g)}))}const g=GI(A=this._onResize).call(A,this);window.addEventListener("resize",g),this._cleanupCallbacks.push((()=>{window.removeEventListener("resize",g)}))}}_cleanUp(){var g,A,C;pa(g=Ta(A=gd(C=this._cleanupCallbacks).call(C,0)).call(A)).call(g,(g=>{try{g()}catch(g){console.error(g)}}))}_onResize(){this.setSize(),this.body.emitter.emit("_redraw")}_getCameraState(){let g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pixelRatio;!0===this.initialized&&(this.cameraState.previousWidth=this.frame.canvas.width/g,this.cameraState.previousHeight=this.frame.canvas.height/g,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/g,y:.5*this.frame.canvas.height/g}))}_setCameraState(){if(void 0!==this.cameraState.scale&&0!==this.frame.canvas.clientWidth&&0!==this.frame.canvas.clientHeight&&0!==this.pixelRatio&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){const g=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,A=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight;let C=this.cameraState.scale;1!=g&&1!=A?C=.5*this.cameraState.scale*(g+A):1!=g?C=this.cameraState.scale*g:1!=A&&(C=this.cameraState.scale*A),this.body.view.scale=C;const I=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),t={x:I.x-this.cameraState.position.x,y:I.y-this.cameraState.position.y};this.body.view.translation.x+=t.x*this.body.view.scale,this.body.view.translation.y+=t.y*this.body.view.scale}}_prepareValue(g){if("number"==typeof g)return g+"px";if("string"==typeof g){if(-1!==kh(g).call(g,"%")||-1!==kh(g).call(g,"px"))return g;if(-1===kh(g).call(g,"%"))return g+"px"}throw new Error("Could not use the value supplied for width or height:"+g)}_create(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=0,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{const g=document.createElement("DIV");g.style.color="red",g.style.fontWeight="bold",g.style.padding="10px",g.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(g)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}_bindHammer(){void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new qu(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:qu.DIRECTION_ALL}),hE(this.hammer,(g=>{this.body.eventListeners.onTouch(g)})),this.hammer.on("tap",(g=>{this.body.eventListeners.onTap(g)})),this.hammer.on("doubletap",(g=>{this.body.eventListeners.onDoubleTap(g)})),this.hammer.on("press",(g=>{this.body.eventListeners.onHold(g)})),this.hammer.on("panstart",(g=>{this.body.eventListeners.onDragStart(g)})),this.hammer.on("panmove",(g=>{this.body.eventListeners.onDrag(g)})),this.hammer.on("panend",(g=>{this.body.eventListeners.onDragEnd(g)})),this.hammer.on("pinch",(g=>{this.body.eventListeners.onPinch(g)})),this.frame.canvas.addEventListener("wheel",(g=>{this.body.eventListeners.onMouseWheel(g)})),this.frame.canvas.addEventListener("mousemove",(g=>{this.body.eventListeners.onMouseMove(g)})),this.frame.canvas.addEventListener("contextmenu",(g=>{this.body.eventListeners.onContext(g)})),this.hammerFrame=new qu(this.frame),lE(this.hammerFrame,(g=>{this.body.eventListeners.onRelease(g)}))}setSize(){let g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.width,A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.height;g=this._prepareValue(g),A=this._prepareValue(A);let C=!1;const I=this.frame.canvas.width,t=this.frame.canvas.height,e=this.pixelRatio;if(this._setPixelRatio(),g!=this.options.width||A!=this.options.height||this.frame.style.width!=g||this.frame.style.height!=A)this._getCameraState(e),this.frame.style.width=g,this.frame.style.height=A,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=g,this.options.height=A,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},C=!0;else{const g=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),A=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);this.frame.canvas.width===g&&this.frame.canvas.height===A||this._getCameraState(e),this.frame.canvas.width!==g&&(this.frame.canvas.width=g,C=!0),this.frame.canvas.height!==A&&(this.frame.canvas.height=A,C=!0)}return!0===C&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(I/this.pixelRatio),oldHeight:Math.round(t/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,C}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){const g=this.getContext();if(void 0===g)throw new Error("Could not get canvax context");let A=1;"undefined"!=typeof window&&(A=window.devicePixelRatio||1);return A/(g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1)}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){const g=this.getContext();if(void 0===g)throw new Error("Could not get canvax context");g.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}_XconvertDOMtoCanvas(g){return(g-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(g){return g*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(g){return(g-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(g){return g*this.body.view.scale+this.body.view.translation.y}canvasToDOM(g){return{x:this._XconvertCanvasToDOM(g.x),y:this._YconvertCanvasToDOM(g.y)}}DOMtoCanvas(g){return{x:this._XconvertDOMtoCanvas(g.x),y:this._YconvertDOMtoCanvas(g.y)}}}class uE{constructor(g,A){var C,I;this.body=g,this.canvas=A,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",GI(C=this.fit).call(C,this)),this.body.emitter.on("animationFinished",(()=>{this.body.emitter.emit("_stopRendering")})),this.body.emitter.on("unlockNode",GI(I=this.releaseNode).call(I,this))}setOptions(){let g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=g}fit(g){let A=arguments.length>1&&void 0!==arguments[1]&&arguments[1];g=function(g,A){const C=fI({nodes:A,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},null!=g?g:{});if(!Wr(C.nodes))throw new TypeError("Nodes has to be an array of ids.");if(0===C.nodes.length&&(C.nodes=A),!("number"==typeof C.minZoomLevel&&C.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!("number"==typeof C.maxZoomLevel&&C.minZoomLevel<=C.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return C}(g,this.body.nodeIndices);const C=this.canvas.frame.canvas.clientWidth,I=this.canvas.frame.canvas.clientHeight;let t,e;if(0===C||0===I)e=1,t=sE.getRange(this.body.nodes,g.nodes);else if(!0===A){let A=0;for(const g in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,g)){!0===this.body.nodes[g].predefinedPosition&&(A+=1)}if(A>.5*this.body.nodeIndices.length)return void this.fit(g,!1);t=sE.getRange(this.body.nodes,g.nodes);e=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;e*=Math.min(C/600,I/600)}else{this.body.emitter.emit("_resizeNodes"),t=sE.getRange(this.body.nodes,g.nodes);const A=C/(1.1*Math.abs(t.maxX-t.minX)),i=I/(1.1*Math.abs(t.maxY-t.minY));e=A<=i?A:i}e>g.maxZoomLevel?e=g.maxZoomLevel:e1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==this.body.nodes[g]){const C={x:this.body.nodes[g].x,y:this.body.nodes[g].y};A.position=C,A.lockedOnNode=g,this.moveTo(A)}else console.error("Node: "+g+" cannot be found.")}moveTo(g){if(void 0!==g){if(null!=g.offset){if(null!=g.offset.x){if(g.offset.x=+g.offset.x,!_b(g.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else g.offset.x=0;if(null!=g.offset.y){if(g.offset.y=+g.offset.y,!_b(g.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else g.offset.x=0}else g.offset={x:0,y:0};if(null!=g.position){if(null!=g.position.x){if(g.position.x=+g.position.x,!_b(g.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else g.position.x=0;if(null!=g.position.y){if(g.position.y=+g.position.y,!_b(g.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else g.position.x=0}else g.position=this.getViewPosition();if(null!=g.scale){if(g.scale=+g.scale,!(g.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else g.scale=this.body.view.scale;void 0===g.animation&&(g.animation={duration:0}),!1===g.animation&&(g.animation={duration:0}),!0===g.animation&&(g.animation={}),void 0===g.animation.duration&&(g.animation.duration=1e3),void 0===g.animation.easingFunction&&(g.animation.easingFunction="easeInOutQuad"),this.animateView(g)}else g={}}animateView(g){if(void 0===g)return;this.animationEasingFunction=g.animation.easingFunction,this.releaseNode(),!0===g.locked&&(this.lockedOnNodeId=g.lockedOnNode,this.lockedOnNodeOffset=g.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=g.scale,this.body.view.scale=this.targetScale;const A=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),C=A.x-g.position.x,I=A.y-g.position.y;var t,e;(this.targetTranslation={x:this.sourceTranslation.x+C*this.targetScale+g.offset.x,y:this.sourceTranslation.y+I*this.targetScale+g.offset.y},0===g.animation.duration)?null!=this.lockedOnNodeId?(this.viewFunction=GI(t=this._lockedRedraw).call(t,this),this.body.emitter.on("initRedraw",this.viewFunction)):(this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw")):(this.animationSpeed=1/(60*g.animation.duration*.001)||1/60,this.animationEasingFunction=g.animation.easingFunction,this.viewFunction=GI(e=this._transitionRedraw).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))}_lockedRedraw(){const g=this.body.nodes[this.lockedOnNodeId].x,A=this.body.nodes[this.lockedOnNodeId].y,C=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),I=C.x-g,t=C.y-A,e=this.body.view.translation,i={x:e.x+I*this.body.view.scale+this.lockedOnNodeOffset.x,y:e.y+t*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=i}releaseNode(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}_transitionRedraw(){let g=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=!0===g?1:this.easingTime;const A=Vu[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*A,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*A,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*A},this.easingTime>=1){var C;if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,null!=this.lockedOnNodeId)this.viewFunction=GI(C=this._lockedRedraw).call(C,this),this.body.emitter.on("initRedraw",this.viewFunction);this.body.emitter.emit("animationFinished")}}getScale(){return this.body.view.scale}getViewPosition(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}function pE(g){var A,C=g&&g.preventDefault||!1,I=g&&g.container||window,t={},e={keydown:{},keyup:{}},i={};for(A=97;A<=122;A++)i[String.fromCharCode(A)]={code:A-97+65,shift:!1};for(A=65;A<=90;A++)i[String.fromCharCode(A)]={code:A,shift:!0};for(A=0;A<=9;A++)i[""+A]={code:48+A,shift:!1};for(A=1;A<=12;A++)i["F"+A]={code:111+A,shift:!1};for(A=0;A<=9;A++)i["num"+A]={code:96+A,shift:!1};i["num*"]={code:106,shift:!1},i["num+"]={code:107,shift:!1},i["num-"]={code:109,shift:!1},i["num/"]={code:111,shift:!1},i["num."]={code:110,shift:!1},i.left={code:37,shift:!1},i.up={code:38,shift:!1},i.right={code:39,shift:!1},i.down={code:40,shift:!1},i.space={code:32,shift:!1},i.enter={code:13,shift:!1},i.shift={code:16,shift:void 0},i.esc={code:27,shift:!1},i.backspace={code:8,shift:!1},i.tab={code:9,shift:!1},i.ctrl={code:17,shift:!1},i.alt={code:18,shift:!1},i.delete={code:46,shift:!1},i.pageup={code:33,shift:!1},i.pagedown={code:34,shift:!1},i["="]={code:187,shift:!1},i["-"]={code:189,shift:!1},i["]"]={code:221,shift:!1},i["["]={code:219,shift:!1};var o=function(g){n(g,"keydown")},s=function(g){n(g,"keyup")},n=function(g,A){if(void 0!==e[A][g.keyCode]){for(var I=e[A][g.keyCode],t=0;t{this.activated=!0,this.configureKeyboardBindings()})),this.body.emitter.on("deactivate",(()=>{this.activated=!1,this.configureKeyboardBindings()})),this.body.emitter.on("destroy",(()=>{void 0!==this.keycharm&&this.keycharm.destroy()})),this.options={}}setOptions(g){void 0!==g&&(this.options=g,this.create())}create(){!0===this.options.navigationButtons?!1===this.iconsCreated&&this.loadNavigationElements():!0===this.iconsCreated&&this.cleanNavigation(),this.configureKeyboardBindings()}cleanNavigation(){if(0!=this.navigationHammers.length){for(let g=0;g{this._stopMovement()})),this.navigationHammers.push(t),this.iconsCreated=!0}bindToRedraw(g){var A;void 0===this.boundFunctions[g]&&(this.boundFunctions[g]=GI(A=this[g]).call(A,this),this.body.emitter.on("initRedraw",this.boundFunctions[g]),this.body.emitter.emit("_startRendering"))}unbindFromRedraw(g){void 0!==this.boundFunctions[g]&&(this.body.emitter.off("initRedraw",this.boundFunctions[g]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[g])}_fit(){(new Date).valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=(new Date).valueOf())}_stopMovement(){for(const g in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,g)&&(this.body.emitter.off("initRedraw",this.boundFunctions[g]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}_moveUp(){this.body.view.translation.y+=this.options.keyboard.speed.y}_moveDown(){this.body.view.translation.y-=this.options.keyboard.speed.y}_moveLeft(){this.body.view.translation.x+=this.options.keyboard.speed.x}_moveRight(){this.body.view.translation.x-=this.options.keyboard.speed.x}_zoomIn(){const g=this.body.view.scale,A=this.body.view.scale*(1+this.options.keyboard.speed.zoom),C=this.body.view.translation,I=A/g,t=(1-I)*this.canvas.canvasViewCenter.x+C.x*I,e=(1-I)*this.canvas.canvasViewCenter.y+C.y*I;this.body.view.scale=A,this.body.view.translation={x:t,y:e},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}_zoomOut(){const g=this.body.view.scale,A=this.body.view.scale/(1+this.options.keyboard.speed.zoom),C=this.body.view.translation,I=A/g,t=(1-I)*this.canvas.canvasViewCenter.x+C.x*I,e=(1-I)*this.canvas.canvasViewCenter.y+C.y*I;this.body.view.scale=A,this.body.view.translation={x:t,y:e},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}configureKeyboardBindings(){var g,A,C,I,t,e,i,o,s,n,r,a,d,h,l,c,u,p,f,b,m,v,y,w;(void 0!==this.keycharm&&this.keycharm.destroy(),!0===this.options.keyboard.enabled)&&(!0===this.options.keyboard.bindToWindow?this.keycharm=pE({container:window,preventDefault:!0}):this.keycharm=pE({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),!0===this.activated&&(GI(g=this.keycharm).call(g,"up",(()=>{this.bindToRedraw("_moveUp")}),"keydown"),GI(A=this.keycharm).call(A,"down",(()=>{this.bindToRedraw("_moveDown")}),"keydown"),GI(C=this.keycharm).call(C,"left",(()=>{this.bindToRedraw("_moveLeft")}),"keydown"),GI(I=this.keycharm).call(I,"right",(()=>{this.bindToRedraw("_moveRight")}),"keydown"),GI(t=this.keycharm).call(t,"=",(()=>{this.bindToRedraw("_zoomIn")}),"keydown"),GI(e=this.keycharm).call(e,"num+",(()=>{this.bindToRedraw("_zoomIn")}),"keydown"),GI(i=this.keycharm).call(i,"num-",(()=>{this.bindToRedraw("_zoomOut")}),"keydown"),GI(o=this.keycharm).call(o,"-",(()=>{this.bindToRedraw("_zoomOut")}),"keydown"),GI(s=this.keycharm).call(s,"[",(()=>{this.bindToRedraw("_zoomOut")}),"keydown"),GI(n=this.keycharm).call(n,"]",(()=>{this.bindToRedraw("_zoomIn")}),"keydown"),GI(r=this.keycharm).call(r,"pageup",(()=>{this.bindToRedraw("_zoomIn")}),"keydown"),GI(a=this.keycharm).call(a,"pagedown",(()=>{this.bindToRedraw("_zoomOut")}),"keydown"),GI(d=this.keycharm).call(d,"up",(()=>{this.unbindFromRedraw("_moveUp")}),"keyup"),GI(h=this.keycharm).call(h,"down",(()=>{this.unbindFromRedraw("_moveDown")}),"keyup"),GI(l=this.keycharm).call(l,"left",(()=>{this.unbindFromRedraw("_moveLeft")}),"keyup"),GI(c=this.keycharm).call(c,"right",(()=>{this.unbindFromRedraw("_moveRight")}),"keyup"),GI(u=this.keycharm).call(u,"=",(()=>{this.unbindFromRedraw("_zoomIn")}),"keyup"),GI(p=this.keycharm).call(p,"num+",(()=>{this.unbindFromRedraw("_zoomIn")}),"keyup"),GI(f=this.keycharm).call(f,"num-",(()=>{this.unbindFromRedraw("_zoomOut")}),"keyup"),GI(b=this.keycharm).call(b,"-",(()=>{this.unbindFromRedraw("_zoomOut")}),"keyup"),GI(m=this.keycharm).call(m,"[",(()=>{this.unbindFromRedraw("_zoomOut")}),"keyup"),GI(v=this.keycharm).call(v,"]",(()=>{this.unbindFromRedraw("_zoomIn")}),"keyup"),GI(y=this.keycharm).call(y,"pageup",(()=>{this.unbindFromRedraw("_zoomIn")}),"keyup"),GI(w=this.keycharm).call(w,"pagedown",(()=>{this.unbindFromRedraw("_zoomOut")}),"keyup")))}}class bE{constructor(g,A,C){var I,t,e,i,o,s,n,r,a,d,h,l,c;this.body=g,this.canvas=A,this.selectionHandler=C,this.navigationHandler=new fE(g,A),this.body.eventListeners.onTap=GI(I=this.onTap).call(I,this),this.body.eventListeners.onTouch=GI(t=this.onTouch).call(t,this),this.body.eventListeners.onDoubleTap=GI(e=this.onDoubleTap).call(e,this),this.body.eventListeners.onHold=GI(i=this.onHold).call(i,this),this.body.eventListeners.onDragStart=GI(o=this.onDragStart).call(o,this),this.body.eventListeners.onDrag=GI(s=this.onDrag).call(s,this),this.body.eventListeners.onDragEnd=GI(n=this.onDragEnd).call(n,this),this.body.eventListeners.onMouseWheel=GI(r=this.onMouseWheel).call(r,this),this.body.eventListeners.onPinch=GI(a=this.onPinch).call(a,this),this.body.eventListeners.onMouseMove=GI(d=this.onMouseMove).call(d,this),this.body.eventListeners.onRelease=GI(h=this.onRelease).call(h,this),this.body.eventListeners.onContext=GI(l=this.onContext).call(l,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=GI(c=this.getPointer).call(c,this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0,autoFocus:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0,zoomSpeed:1},fI(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("destroy",(()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer}))}setOptions(g){if(void 0!==g){Ou(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,g),ju(this.options,g,"keyboard"),g.tooltip&&(fI(this.options.tooltip,g.tooltip),g.tooltip.color&&(this.options.tooltip.color=zu(g.tooltip.color)))}this.navigationHandler.setOptions(this.options)}getPointer(g){return{x:g.x-(A=this.canvas.frame.canvas,A.getBoundingClientRect().left),y:g.y-Nu(this.canvas.frame.canvas)};var A}onTouch(g){(new Date).valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(g.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}onTap(g){const A=this.getPointer(g.center),C=this.selectionHandler.options.multiselect&&(g.changedPointers[0].ctrlKey||g.changedPointers[0].metaKey);this.checkSelectionChanges(A,C),this.selectionHandler.commitAndEmit(A,g),this.selectionHandler.generateClickEvent("click",g,A)}onDoubleTap(g){const A=this.getPointer(g.center);this.selectionHandler.generateClickEvent("doubleClick",g,A)}onHold(g){const A=this.getPointer(g.center),C=this.selectionHandler.options.multiselect;this.checkSelectionChanges(A,C),this.selectionHandler.commitAndEmit(A,g),this.selectionHandler.generateClickEvent("click",g,A),this.selectionHandler.generateClickEvent("hold",g,A)}onRelease(g){if((new Date).valueOf()-this.touchTime>10){const A=this.getPointer(g.center);this.selectionHandler.generateClickEvent("release",g,A),this.touchTime=(new Date).valueOf()}}onContext(g){const A=this.getPointer({x:g.clientX,y:g.clientY});this.selectionHandler.generateClickEvent("oncontext",g,A)}checkSelectionChanges(g){!0===(arguments.length>1&&void 0!==arguments[1]&&arguments[1])?this.selectionHandler.selectAdditionalOnPoint(g):this.selectionHandler.selectOnPoint(g)}_determineDifference(g,A){const C=function(g,A){const C=[];for(let I=0;I{const A=g.node;!1===g.xFixed&&(A.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(g.x)+I)),!1===g.yFixed&&(A.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(g.y)+t))})),this.body.emitter.emit("startSimulation")}else{if(g.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",g,A,void 0,!0),void 0===this.drag.pointer)return void this.onDragStart(g);this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(A.x),y:this.canvas._YconvertDOMtoCanvas(A.y)},this.body.emitter.emit("_requestRedraw")}if(!0===this.options.dragView&&!g.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",g,A,void 0,!0),void 0===this.drag.pointer)return void this.onDragStart(g);const C=A.x-this.drag.pointer.x,I=A.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+C,y:this.drag.translation.y+I},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(g){if(this.drag.dragging=!1,this.body.selectionBox.show){var A;this.body.selectionBox.show=!1;const C=this.body.selectionBox.position,I={minX:Math.min(C.start.x,C.end.x),minY:Math.min(C.start.y,C.end.y),maxX:Math.max(C.start.x,C.end.x),maxY:Math.max(C.start.y,C.end.y)},t=Gd(A=this.body.nodeIndices).call(A,(g=>{const A=this.body.nodes[g];return A.x>=I.minX&&A.x<=I.maxX&&A.y>=I.minY&&A.y<=I.maxY}));pa(t).call(t,(g=>this.selectionHandler.selectObject(this.body.nodes[g])));const e=this.getPointer(g.center);this.selectionHandler.commitAndEmit(e,g),this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{const A=this.drag.selection;A&&A.length?(pa(A).call(A,(function(g){g.node.options.fixed.x=g.xFixed,g.node.options.fixed.y=g.yFixed})),this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}onPinch(g){const A=this.getPointer(g.center);this.drag.pinched=!0,void 0===this.pinch.scale&&(this.pinch.scale=1);const C=this.pinch.scale*g.scale;this.zoom(C,A)}zoom(g,A){if(!0===this.options.zoomView){const C=this.body.view.scale;let I;g<1e-5&&(g=1e-5),g>10&&(g=10),void 0!==this.drag&&!0===this.drag.dragging&&(I=this.canvas.DOMtoCanvas(this.drag.pointer));const t=this.body.view.translation,e=g/C,i=(1-e)*A.x+t.x*e,o=(1-e)*A.y+t.y*e;if(this.body.view.scale=g,this.body.view.translation={x:i,y:o},null!=I){const g=this.canvas.canvasToDOM(I);this.drag.pointer.x=g.x,this.drag.pointer.y=g.y}this.body.emitter.emit("_requestRedraw"),Cthis._checkShowPopup(A)),this.options.tooltipDelay))),!0===this.options.hover&&this.selectionHandler.hoverObject(g,A)}_checkShowPopup(g){const A=this.canvas._XconvertDOMtoCanvas(g.x),C=this.canvas._YconvertDOMtoCanvas(g.y),I={left:A,top:C,right:A,bottom:C},t=void 0===this.popupObj?void 0:this.popupObj.id;let e=!1,i="node";if(void 0===this.popupObj){const g=this.body.nodeIndices,A=this.body.nodes;let C;const t=[];for(let i=0;i0&&(this.popupObj=A[t[t.length-1]],e=!0)}if(void 0===this.popupObj&&!1===e){const g=this.body.edgeIndices,A=this.body.edges;let C;const t=[];for(let e=0;e0&&(this.popupObj=A[t[t.length-1]],i="edge")}void 0!==this.popupObj?this.popupObj.id!==t&&(void 0===this.popup&&(this.popup=new $u(this.canvas.frame)),this.popup.popupTargetType=i,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(g.x+3,g.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):void 0!==this.popup&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}_checkHidePopup(g){const A=this.selectionHandler._pointerToPositionObject(g);let C=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&(C=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(A),!0===C)){const A=this.selectionHandler.getNodeAt(g);C=void 0!==A&&A.id===this.popup.popupTargetId}}else void 0===this.selectionHandler.getNodeAt(g)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(C=this.body.edges[this.popup.popupTargetId].isOverlappingWith(A));!1===C&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}var mE=u,vE=nb,yE=sf.getWeakData,wE=Wf,xE=CC,EE=Q,OE=gg,TE=jf,DE=qg,NE=Bi.set,kE=Bi.getterFor,RE=Yi.find,PE=Yi.findIndex,ME=mE([].splice),zE=0,BE=function(g){return g.frozen||(g.frozen=new ZE)},ZE=function(){this.entries=[]},SE=function(g,A){return RE(g.entries,(function(g){return g[0]===A}))};ZE.prototype={get:function(g){var A=SE(this,g);if(A)return A[1]},has:function(g){return!!SE(this,g)},set:function(g,A){var C=SE(this,g);C?C[1]=A:this.entries.push([g,A])},delete:function(g){var A=PE(this.entries,(function(A){return A[0]===g}));return~A&&ME(this.entries,A,1),!!~A}};var FE,GE={getConstructor:function(g,A,C,I){var t=g((function(g,t){wE(g,e),NE(g,{type:A,id:zE++,frozen:void 0}),EE(t)||TE(t,g[I],{that:g,AS_ENTRIES:C})})),e=t.prototype,i=kE(A),o=function(g,A,C){var I=i(g),t=yE(xE(A),!0);return!0===t?BE(I).set(A,C):t[I.id]=C,g};return vE(e,{delete:function(g){var A=i(this);if(!OE(g))return!1;var C=yE(g);return!0===C?BE(A).delete(g):C&&DE(C,A.id)&&delete C[A.id]},has:function(g){var A=i(this);if(!OE(g))return!1;var C=yE(g);return!0===C?BE(A).has(g):C&&DE(C,A.id)}}),vE(e,C?{get:function(g){var A=i(this);if(OE(g)){var C=yE(g);return!0===C?BE(A).get(g):C?C[A.id]:void 0}},set:function(g,A){return o(this,g,A)}}:{add:function(g){return o(this,g,!0)}}),t}},LE=Qp,jE=t,VE=u,YE=nb,WE=sf,QE=ob,UE=GE,KE=gg,HE=Bi.enforce,XE=e,_E=vi,JE=Object,qE=Array.isArray,$E=JE.isExtensible,gO=JE.isFrozen,AO=JE.isSealed,CO=JE.freeze,IO=JE.seal,tO={},eO={},iO=!jE.ActiveXObject&&"ActiveXObject"in jE,oO=function(g){return function(){return g(this,arguments.length?arguments[0]:void 0)}},sO=QE("WeakMap",oO,UE),nO=sO.prototype,rO=VE(nO.set);if(_E)if(iO){FE=UE.getConstructor(oO,"WeakMap",!0),WE.enable();var aO=VE(nO.delete),dO=VE(nO.has),hO=VE(nO.get);YE(nO,{delete:function(g){if(KE(g)&&!$E(g)){var A=HE(this);return A.frozen||(A.frozen=new FE),aO(this,g)||A.frozen.delete(g)}return aO(this,g)},has:function(g){if(KE(g)&&!$E(g)){var A=HE(this);return A.frozen||(A.frozen=new FE),dO(this,g)||A.frozen.has(g)}return dO(this,g)},get:function(g){if(KE(g)&&!$E(g)){var A=HE(this);return A.frozen||(A.frozen=new FE),dO(this,g)?hO(this,g):A.frozen.get(g)}return hO(this,g)},set:function(g,A){if(KE(g)&&!$E(g)){var C=HE(this);C.frozen||(C.frozen=new FE),dO(this,g)?rO(this,g,A):C.frozen.set(g,A)}else rO(this,g,A);return this}})}else LE&&XE((function(){var g=CO([]);return rO(new sO,g,1),!gO(g)}))&&YE(nO,{set:function(g,A){var C;return qE(g)&&(gO(g)?C=tO:AO(g)&&(C=eO)),rO(this,g,A),C===tO&&CO(g),C===eO&&IO(g),this}});var lO,cO,uO,pO,fO,bO=C(Ag.WeakMap);function mO(g,A,C,I){if("a"===C&&!I)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof A?g!==A||!I:!A.has(g))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===C?I:"a"===C?I.call(g):I?I.value:A.get(g)}function vO(g,A,C,I,t){if("m"===I)throw new TypeError("Private method is not writable");if("a"===I&&!t)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof A?g!==A||!t:!A.has(g))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===I?t.call(g,C):t?t.value=C:A.set(g,C),C}function yO(g,A){const C=new Wv;for(const I of A)g.has(I)||C.add(I);return C}"function"==typeof SuppressedError&&SuppressedError;class wO{constructor(){lO.set(this,new Wv),cO.set(this,new Wv)}get size(){return mO(this,cO,"f").size}add(){for(var g=arguments.length,A=new Array(g),C=0;C0&&void 0!==arguments[0]?arguments[0]:()=>{};uO.set(this,new wO),pO.set(this,new wO),fO.set(this,void 0),vO(this,fO,g,"f")}get sizeNodes(){return mO(this,uO,"f").size}get sizeEdges(){return mO(this,pO,"f").size}getNodes(){return mO(this,uO,"f").getSelection()}getEdges(){return mO(this,pO,"f").getSelection()}addNodes(){mO(this,uO,"f").add(...arguments)}addEdges(){mO(this,pO,"f").add(...arguments)}deleteNodes(g){mO(this,uO,"f").delete(g)}deleteEdges(g){mO(this,pO,"f").delete(g)}clear(){mO(this,uO,"f").clear(),mO(this,pO,"f").clear()}commit(){const g={nodes:mO(this,uO,"f").commit(),edges:mO(this,pO,"f").commit()};for(var A=arguments.length,C=new Array(A),I=0;I{this.updateSelection()}))}setOptions(g){if(void 0!==g){Eu(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,g)}}selectOnPoint(g){let A=!1;if(!0===this.options.selectable){const C=this.getNodeAt(g)||this.getEdgeAt(g);this.unselectAll(),void 0!==C&&(A=this.selectObject(C)),this.body.emitter.emit("_requestRedraw")}return A}selectAdditionalOnPoint(g){let A=!1;if(!0===this.options.selectable){const C=this.getNodeAt(g)||this.getEdgeAt(g);void 0!==C&&(A=!0,!0===C.isSelected()?this.deselectObject(C):this.selectObject(C),this.body.emitter.emit("_requestRedraw"))}return A}_initBaseEvent(g,A){const C={};return C.pointer={DOM:{x:A.x,y:A.y},canvas:this.canvas.DOMtoCanvas(A)},C.event=g,C}generateClickEvent(g,A,C,I){let t=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const e=this._initBaseEvent(A,C);if(!0===t)e.nodes=[],e.edges=[];else{const g=this.getSelection();e.nodes=g.nodes,e.edges=g.edges}void 0!==I&&(e.previousSelection=I),"click"==g&&(e.items=this.getClickedItems(C)),void 0!==A.controlEdge&&(e.controlEdge=A.controlEdge),this.body.emitter.emit(g,e)}selectObject(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.selectConnectedEdges;return void 0!==g&&(g instanceof bx?(!0===A&&this._selectionAccumulator.addEdges(...g.edges),this._selectionAccumulator.addNodes(g)):this._selectionAccumulator.addEdges(g),!0)}deselectObject(g){!0===g.isSelected()&&(g.selected=!1,this._removeFromSelection(g))}_getAllNodesOverlappingWith(g){const A=[],C=this.body.nodes;for(let I=0;I1&&void 0!==arguments[1])||arguments[1];const C=this._pointerToPositionObject(g),I=this._getAllNodesOverlappingWith(C);return I.length>0?!0===A?this.body.nodes[I[I.length-1]]:I[I.length-1]:void 0}_getEdgesOverlappingWith(g,A){const C=this.body.edges;for(let I=0;I1&&void 0!==arguments[1])||arguments[1];const C=this.canvas.DOMtoCanvas(g);let I=10,t=null;const e=this.body.edges;for(let g=0;g0&&(this.generateClickEvent("deselectEdge",A,g,t),C=!0),I.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",A,g,t),C=!0),I.nodes.added.length>0&&(this.generateClickEvent("selectNode",A,g),C=!0),I.edges.added.length>0&&(this.generateClickEvent("selectEdge",A,g),C=!0),!0===C&&this.generateClickEvent("select",A,g)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var g;return Jr(g=this._selectionAccumulator.getNodes()).call(g,(g=>g.id))}getSelectedEdgeIds(){var g;return Jr(g=this._selectionAccumulator.getEdges()).call(g,(g=>g.id))}setSelection(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!g||!g.nodes&&!g.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((A.unselectAll||void 0===A.unselectAll)&&this.unselectAll(),g.nodes)for(const C of g.nodes){const g=this.body.nodes[C];if(!g)throw new RangeError('Node with id "'+C+'" not found');this.selectObject(g,A.highlightEdges)}if(g.edges)for(const A of g.edges){const g=this.body.edges[A];if(!g)throw new RangeError('Edge with id "'+A+'" not found');this.selectObject(g)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(g){let A=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!g||void 0===g.length)throw"Selection must be an array with ids";this.setSelection({nodes:g},{highlightEdges:A})}selectEdges(g){if(!g||void 0===g.length)throw"Selection must be an array with ids";this.setSelection({edges:g})}updateSelection(){for(const g in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,g.id)||this._selectionAccumulator.deleteNodes(g);for(const g in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,g.id)||this._selectionAccumulator.deleteEdges(g)}getClickedItems(g){const A=this.canvas.DOMtoCanvas(g),C=[],I=this.body.nodeIndices,t=this.body.nodes;for(let g=I.length-1;g>=0;g--){const e=t[I[g]].getItemsOnPoint(A);C.push.apply(C,e)}const e=this.body.edgeIndices,i=this.body.edges;for(let g=e.length-1;g>=0;g--){const I=i[e[g]].getItemsOnPoint(A);C.push.apply(C,I)}return C}}class OO{abstract(){throw new Error("Can't instantiate abstract class!")}fake_use(){}curveType(){return this.abstract()}getPosition(g){return this.fake_use(g),this.abstract()}setPosition(g,A){let C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.fake_use(g,A,C),this.abstract()}getTreeSize(g){return this.fake_use(g),this.abstract()}sort(g){this.fake_use(g),this.abstract()}fix(g,A){this.fake_use(g,A),this.abstract()}shift(g,A){this.fake_use(g,A),this.abstract()}}class TO extends OO{constructor(g){super(),this.layout=g}curveType(){return"horizontal"}getPosition(g){return g.x}setPosition(g,A){let C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==C&&this.layout.hierarchical.addToOrdering(g,C),g.x=A}getTreeSize(g){const A=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,g);return{min:A.min_x,max:A.max_x}}sort(g){Ny(g).call(g,(function(g,A){return g.x-A.x}))}fix(g,A){g.y=this.layout.options.hierarchical.levelSeparation*A,g.options.fixed.y=!0}shift(g,A){this.layout.body.nodes[g].x+=A}}class DO extends OO{constructor(g){super(),this.layout=g}curveType(){return"vertical"}getPosition(g){return g.y}setPosition(g,A){let C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==C&&this.layout.hierarchical.addToOrdering(g,C),g.y=A}getTreeSize(g){const A=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,g);return{min:A.min_y,max:A.max_y}}sort(g){Ny(g).call(g,(function(g,A){return g.y-A.y}))}fix(g,A){g.x=this.layout.options.hierarchical.levelSeparation*A,g.options.fixed.x=!0}shift(g,A){this.layout.body.nodes[g].y+=A}}var NO=Yi.every;DC({target:"Array",proto:!0,forced:!ia("every")},{every:function(g){return NO(this,g,arguments.length>1?arguments[1]:void 0)}});var kO=MI("Array").every,RO=og,PO=kO,MO=Array.prototype,zO=function(g){var A=g.every;return g===MO||RO(MO,g)&&A===MO.every?PO:A},BO=C(zO);function ZO(g,A){const C=new Wv;return pa(g).call(g,(g=>{var A;pa(A=g.edges).call(A,(g=>{g.connected&&C.add(g)}))})),pa(C).call(C,(g=>{const C=g.from.id,I=g.to.id;null==A[C]&&(A[C]=0),(null==A[I]||A[C]>=A[I])&&(A[I]=A[C]+1)})),A}function SO(g,A,C,I){var t;const e=Ph(null),i=Ov(t=[...Ky(I).call(I)]).call(t,((g,A)=>g+1+A.edges.length),0),o=C+"Id",s="to"===C?1:-1;for(const[t,a]of I){if(!I.has(t)||!g(a))continue;e[t]=0;const d=[a];let h,l=0;for(;h=d.pop();){var n,r;if(!I.has(t))continue;const g=e[h.id]+s;if(pa(n=Gd(r=h.edges).call(r,(g=>g.connected&&g.to!==g.from&&g[C]!==h&&I.has(g.toId)&&I.has(g.fromId)))).call(n,(I=>{const t=I[o],i=e[t];(null==i||A(g,i))&&(e[t]=g,d.push(I[C]))})),l>i)return ZO(I,e);++l}}return e}class FO{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(g,A){void 0===this.childrenReference[g]&&(this.childrenReference[g]=[]),this.childrenReference[g].push(A),void 0===this.parentReference[A]&&(this.parentReference[A]=[]),this.parentReference[A].push(g)}checkIfTree(){for(const g in this.parentReference)if(this.parentReference[g].length>1)return void(this.isTree=!1);this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(g,A){void 0!==A&&void 0===this.trees[g.id]&&(this.trees[g.id]=A,this.treeIndex=Math.max(A,this.treeIndex))}ensureLevel(g){void 0===this.levels[g]&&(this.levels[g]=0)}getMaxLevel(g){const A={},C=g=>{if(void 0!==A[g])return A[g];let I=this.levels[g];if(this.childrenReference[g]){const A=this.childrenReference[g];if(A.length>0)for(let g=0;gg-A));for(const g of I)A.set(g,C++);for(const g in this.levels)Object.prototype.hasOwnProperty.call(this.levels,g)&&(this.levels[g]=A.get(this.levels[g]))}getTreeSize(g,A){let C=1e9,I=-1e9,t=1e9,e=-1e9;for(const i in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,i)&&this.trees[i]===A){const A=g[i];C=Math.min(A.x,C),I=Math.max(A.x,I),t=Math.min(A.y,t),e=Math.max(A.y,e)}return{min_x:C,max_x:I,min_y:t,max_y:e}}hasSameParent(g,A){const C=this.parentReference[g.id],I=this.parentReference[A.id];if(void 0===C||void 0===I)return!1;for(let g=0;g{this.setupHierarchicalLayout()})),this.body.emitter.on("_dataLoaded",(()=>{this.layoutNetwork()})),this.body.emitter.on("_resetHierarchicalLayout",(()=>{this.setupHierarchicalLayout()})),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",(()=>{if(!0!==this.options.hierarchical.enabled)return;const g=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",g,!1)}))}setOptions(g,A){if(void 0!==g){const C=this.options.hierarchical,I=C.enabled;if(Eu(["randomSeed","improvedLayout","clusterThreshold"],this.options,g),ju(this.options,g,"hierarchical"),void 0!==g.randomSeed&&this._resetRNG(g.randomSeed),!0===C.enabled)return!0===I&&this.body.emitter.emit("refresh",!0),"RL"===C.direction||"DU"===C.direction?C.levelSeparation>0&&(C.levelSeparation*=-1):C.levelSeparation<0&&(C.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(A);if(!0===I)return this.body.emitter.emit("refresh"),Tu(A,this.optionsBackup)}return A}_resetRNG(g){this.initialRandomSeed=g,this._rng=hu(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(g){if(!0===this.options.hierarchical.enabled){const A=this.optionsBackup.physics;void 0===g.physics||!0===g.physics?(g.physics={enabled:void 0===A.enabled||A.enabled,solver:"hierarchicalRepulsion"},A.enabled=void 0===A.enabled||A.enabled,A.solver=A.solver||"barnesHut"):"object"==typeof g.physics?(A.enabled=void 0===g.physics.enabled||g.physics.enabled,A.solver=g.physics.solver||"barnesHut",g.physics.solver="hierarchicalRepulsion"):!1!==g.physics&&(A.solver="barnesHut",g.physics={solver:"hierarchicalRepulsion"});let C=this.direction.curveType();if(void 0===g.edges)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},g.edges={smooth:!1};else if(void 0===g.edges.smooth)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},g.edges.smooth=!1;else if("boolean"==typeof g.edges.smooth)this.optionsBackup.edges={smooth:g.edges.smooth},g.edges.smooth={enabled:g.edges.smooth,type:C};else{const A=g.edges.smooth;void 0!==A.type&&"dynamic"!==A.type&&(C=A.type),this.optionsBackup.edges={smooth:{enabled:void 0===A.enabled||A.enabled,type:void 0===A.type?"dynamic":A.type,roundness:void 0===A.roundness?.5:A.roundness,forceDirection:void 0!==A.forceDirection&&A.forceDirection}},g.edges.smooth={enabled:void 0===A.enabled||A.enabled,type:C,roundness:void 0===A.roundness?.5:A.roundness,forceDirection:void 0!==A.forceDirection&&A.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",C)}return g}positionInitially(g){if(!0!==this.options.hierarchical.enabled){this._resetRNG(this.initialRandomSeed);const A=g.length+50;for(let C=0;CI){const e=g.length;for(;g.length>I&&C<=A;){C+=1;const A=g.length;C%3==0?this.body.modules.clustering.clusterBridges(t):this.body.modules.clustering.clusterOutliers(t);if(A==g.length&&C%3!=0)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*e)})}C>A&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(g,this.body.edgeIndices,!0),this._shiftToCenter();const e=70;for(let A=0;A0){let g,A,C=!1,I=!1;for(A in this.lastNodeOnLevel={},this.hierarchical=new FO,this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,A)&&(g=this.body.nodes[A],void 0!==g.options.level?(C=!0,this.hierarchical.levels[A]=g.options.level):I=!0);if(!0===I&&!0===C)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");{if(!0===I){const g=this.options.hierarchical.sortMethod;"hubsize"===g?this._determineLevelsByHubsize():"directed"===g?this._determineLevelsDirected():"custom"===g&&this._determineLevelsCustomCallback()}for(const g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&this.hierarchical.ensureLevel(g);const g=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(g),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var g=this;let A=!1;const C={},I=(g,A)=>{const C=this.hierarchical.trees;for(const I in C)Object.prototype.hasOwnProperty.call(C,I)&&C[I]===g&&this.direction.shift(I,A)},t=()=>{const g=[];for(let A=0;A{if(!A[g.id]&&(A[g.id]=!0,this.hierarchical.childrenReference[g.id])){const C=this.hierarchical.childrenReference[g.id];if(C.length>0)for(let g=0;g1&&void 0!==arguments[1]?arguments[1]:1e9,I=1e9,t=1e9,e=1e9,i=-1e9;for(const o in A)if(Object.prototype.hasOwnProperty.call(A,o)){const s=g.body.nodes[o],n=g.hierarchical.levels[s.id],r=g.direction.getPosition(s),[a,d]=g._getSpaceAroundNode(s,A);I=Math.min(a,I),t=Math.min(d,t),n<=C&&(e=Math.min(r,e),i=Math.max(r,i))}return[e,i,I,t]},o=(g,A)=>{const C=this.hierarchical.getMaxLevel(g.id),I=this.hierarchical.getMaxLevel(A.id);return Math.min(C,I)},s=(g,A,C)=>{const I=this.hierarchical;for(let t=0;t1)for(let A=0;A2&&void 0!==arguments[2]&&arguments[2];const s=g.direction.getPosition(C),n=g.direction.getPosition(I),r=Math.abs(n-s),a=g.options.hierarchical.nodeSpacing;if(r>a){const s={},n={};e(C,s),e(I,n);const r=o(C,I),d=i(s,r),h=i(n,r),l=d[1],c=h[0],u=h[2];if(Math.abs(l-c)>a){let C=l-c+a;C<-u+a&&(C=-u+a),C<0&&(g._shiftBlock(I.id,C),A=!0,!0===t&&g._centerParent(I))}}},r=(g,I)=>{const t=I.id,o=I.edges,s=this.hierarchical.levels[I.id],n=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,r={},a=[];for(let g=0;g{let C=0;for(let I=0;I{let C=0;for(let I=0;I{let C=this.direction.getPosition(I);const t={};for(let I=0;I{const t=this.direction.getPosition(I);if(void 0===C[I.id]){const g={};e(I,g),C[I.id]=g}const o=i(C[I.id]),s=o[2],n=o[3],r=g-t;let a=0;r>0?a=Math.min(r,n-this.options.hierarchical.nodeSpacing):r<0&&(a=-Math.min(-r,s-this.options.hierarchical.nodeSpacing)),0!=a&&(this._shiftBlock(I.id,a),A=!0)})(c),c=l(g,o),(g=>{const C=this.direction.getPosition(I),[t,e]=this._getSpaceAroundNode(I),i=g-C;let o=C;i>0?o=Math.min(C+(e-this.options.hierarchical.nodeSpacing),g):i<0&&(o=Math.max(C-(t-this.options.hierarchical.nodeSpacing),g)),o!==C&&(this.direction.setPosition(I,o),A=!0)})(c)},a=g=>{let C=this.hierarchical.getLevels();C=Ta(C).call(C);for(let I=0;I{let C=this.hierarchical.getLevels();C=Ta(C).call(C);for(let I=0;I{for(const g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&this._centerParent(this.body.nodes[g])},l=()=>{let g=this.hierarchical.getLevels();g=Ta(g).call(g);for(let A=0;A{const g=t();let A=0;for(let C=0;C0&&Math.abs(i)0&&(i=this.direction.getPosition(I[g-1])+e),this.direction.setPosition(A,i,C),this._validatePositionAndContinue(A,C,i),t++}}}}_placeBranchNodes(g,A){var C;const I=this.hierarchical.childrenReference[g];if(void 0===I)return;const t=[];for(let g=0;gA&&void 0===this.positionedNodes[I.id]))return;{const A=this.options.hierarchical.nodeSpacing;let i;i=0===C?this.direction.getPosition(this.body.nodes[g]):this.direction.getPosition(t[C-1])+A,this.direction.setPosition(I,i,e),this._validatePositionAndContinue(I,e,i)}}const e=this._getCenterPosition(t);this.direction.setPosition(this.body.nodes[g],e,A)}_validatePositionAndContinue(g,A,C){if(this.hierarchical.isTree){if(void 0!==this.lastNodeOnLevel[A]){const I=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[A]]);if(C-I{var C;-1!==kh(C=this.body.edgeIndices).call(C,g.id)&&A.push(g)})),A}_getHubSizes(){const g={};ku(this.body.nodeIndices,(A=>{const C=this.body.nodes[A],I=this._getActiveEdges(C).length;g[I]=!0}));const A=[];return ku(g,(g=>{A.push(Number(g))})),Ny(A).call(A,(function(g,A){return A-g})),A}_determineLevelsByHubsize(){const g=(g,A)=>{this.hierarchical.levelDownstream(g,A)},A=this._getHubSizes();for(let C=0;C{const C=this.body.nodes[A];I===this._getActiveEdges(C).length&&this._crawlNetwork(g,A)}))}}_determineLevelsCustomCallback(){this._crawlNetwork(((g,A,C)=>{let I=this.hierarchical.levels[g.id];void 0===I&&(I=this.hierarchical.levels[g.id]=1e5);const t=(sE.cloneOptions(g,"node"),sE.cloneOptions(A,"node"),void sE.cloneOptions(C,"edge"));this.hierarchical.levels[A.id]=I+t})),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var g;const A=Ov(g=this.body.nodeIndices).call(g,((g,A)=>(g.set(A,this.body.nodes[A]),g)),new Qb);"roots"===this.options.hierarchical.shakeTowards?this.hierarchical.levels=function(g){return SO((A=>{var C,I;return BO(C=Gd(I=A.edges).call(I,(A=>g.has(A.toId)))).call(C,(g=>g.from===A))}),((g,A)=>A{var C,I;return BO(C=Gd(I=A.edges).call(I,(A=>g.has(A.toId)))).call(C,(g=>g.to===A))}),((g,A)=>A>g),"from",g)}(A),this.hierarchical.setMinLevelToZero()}_generateMap(){this._crawlNetwork(((g,A)=>{this.hierarchical.levels[A.id]>this.hierarchical.levels[g.id]&&this.hierarchical.addRelation(g.id,A.id)})),this.hierarchical.checkIfTree()}_crawlNetwork(){let g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},A=arguments.length>1?arguments[1]:void 0;const C={},I=(A,t)=>{if(void 0===C[A.id]){let e;this.hierarchical.setTreeIndex(A,t),C[A.id]=!0;const i=this._getActiveEdges(A);for(let C=0;C{if(C[g])return;C[g]=!0,this.direction.shift(g,A);const t=this.hierarchical.childrenReference[g];if(void 0!==t)for(let g=0;g{const C=this.hierarchical.parentReference[A];if(void 0!==C)for(let A=0;A{const C=this.hierarchical.parentReference[A];if(void 0!==C)for(let I=0;I{this._clean()})),this.body.emitter.on("_dataChanged",GI(t=this._restore).call(t,this)),this.body.emitter.on("_resetData",GI(e=this._restore).call(e,this))}_restore(){!1!==this.inMode&&(!0===this.options.initiallyActive?this.enableEditMode():this.disableEditMode())}setOptions(g,A,C){void 0!==A&&(void 0!==A.locale?this.options.locale=A.locale:this.options.locale=C.locale,void 0!==A.locales?this.options.locales=A.locales:this.options.locales=C.locales),void 0!==g&&("boolean"==typeof g?this.options.enabled=g:(this.options.enabled=!0,Tu(this.options,g)),!0===this.options.initiallyActive&&(this.editMode=!0),this._setup())}toggleEditMode(){!0===this.editMode?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),!0===this.guiEnabled&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),!0===this.guiEnabled&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},!0===this.guiEnabled){var g,A;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";const C=this.selectionHandler.getSelectedNodeCount(),I=this.selectionHandler.getSelectedEdgeCount(),t=C+I,e=this.options.locales[this.options.locale];let i=!1;!1!==this.options.addNode&&(this._createAddNodeButton(e),i=!0),!1!==this.options.addEdge&&(!0===i?this._createSeperator(1):i=!0,this._createAddEdgeButton(e)),1===C&&"function"==typeof this.options.editNode?(!0===i?this._createSeperator(2):i=!0,this._createEditNodeButton(e)):1===I&&0===C&&!1!==this.options.editEdge&&(!0===i?this._createSeperator(3):i=!0,this._createEditEdgeButton(e)),0!==t&&(C>0&&!1!==this.options.deleteNode||0===C&&!1!==this.options.deleteEdge)&&(!0===i&&this._createSeperator(4),this._createDeleteButton(e)),this._bindElementEvents(this.closeDiv,GI(g=this.toggleEditMode).call(g,this)),this._temporaryBindEvent("select",GI(A=this.showManipulatorToolbar).call(A,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var g;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addNode",!0===this.guiEnabled){var A;const g=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(g),this._createSeperator(),this._createDescription(g.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,GI(A=this.toggleEditMode).call(A,this))}this._temporaryBindEvent("click",GI(g=this._performAddNode).call(g,this))}editNode(){!0!==this.editMode&&this.enableEditMode(),this._clean();const g=this.selectionHandler.getSelectedNodes()[0];if(void 0!==g){if(this.inMode="editNode","function"!=typeof this.options.editNode)throw new Error("No function has been configured to handle the editing of nodes.");if(!0!==g.isCluster){const A=Tu({},g.options,!1);if(A.x=g.x,A.y=g.y,2!==this.options.editNode.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editNode(A,(g=>{null!=g&&"editNode"===this.inMode&&this.body.data.nodes.getDataSet().update(g),this.showManipulatorToolbar()}))}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}addEdgeMode(){var g,A,C,I,t;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addEdge",!0===this.guiEnabled){var e;const g=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(g),this._createSeperator(),this._createDescription(g.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,GI(e=this.toggleEditMode).call(e,this))}this._temporaryBindUI("onTouch",GI(g=this._handleConnect).call(g,this)),this._temporaryBindUI("onDragEnd",GI(A=this._finishConnect).call(A,this)),this._temporaryBindUI("onDrag",GI(C=this._dragControlNode).call(C,this)),this._temporaryBindUI("onRelease",GI(I=this._finishConnect).call(I,this)),this._temporaryBindUI("onDragStart",GI(t=this._dragStartEdge).call(t,this)),this._temporaryBindUI("onHold",(()=>{}))}editEdgeMode(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="editEdge","object"!=typeof this.options.editEdge||"function"!=typeof this.options.editEdge.editWithoutDrag||(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],void 0===this.edgeBeingEditedId)){if(!0===this.guiEnabled){var g;const A=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(A),this._createSeperator(),this._createDescription(A.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,GI(g=this.toggleEditMode).call(g,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],void 0!==this.edgeBeingEditedId){var A,C,I,t;const g=this.body.edges[this.edgeBeingEditedId],e=this._getNewTargetNode(g.from.x,g.from.y),i=this._getNewTargetNode(g.to.x,g.to.y);this.temporaryIds.nodes.push(e.id),this.temporaryIds.nodes.push(i.id),this.body.nodes[e.id]=e,this.body.nodeIndices.push(e.id),this.body.nodes[i.id]=i,this.body.nodeIndices.push(i.id),this._temporaryBindUI("onTouch",GI(A=this._controlNodeTouch).call(A,this)),this._temporaryBindUI("onTap",(()=>{})),this._temporaryBindUI("onHold",(()=>{})),this._temporaryBindUI("onDragStart",GI(C=this._controlNodeDragStart).call(C,this)),this._temporaryBindUI("onDrag",GI(I=this._controlNodeDrag).call(I,this)),this._temporaryBindUI("onDragEnd",GI(t=this._controlNodeDragEnd).call(t,this)),this._temporaryBindUI("onMouseMove",(()=>{})),this._temporaryBindEvent("beforeDrawing",(A=>{const C=g.edgeType.findBorderPositions(A);!1===e.selected&&(e.x=C.from.x,e.y=C.from.y),!1===i.selected&&(i.x=C.to.x,i.y=C.to.y)})),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}else{const g=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(g.from.id,g.to.id)}}deleteSelected(){!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="delete";const g=this.selectionHandler.getSelectedNodeIds(),A=this.selectionHandler.getSelectedEdgeIds();let C;if(g.length>0){for(let A=0;A0&&"function"==typeof this.options.deleteEdge&&(C=this.options.deleteEdge);if("function"==typeof C){const I={nodes:g,edges:A};if(2!==C.length)throw new Error("The function for delete does not support two arguments (data, callback)");C(I,(g=>{null!=g&&"delete"===this.inMode?(this.body.data.edges.getDataSet().remove(g.edges),this.body.data.nodes.getDataSet().remove(g.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().remove(A),this.body.data.nodes.getDataSet().remove(g),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}_setup(){!0===this.options.enabled?(this.guiEnabled=!0,this._createWrappers(),!1===this.editMode?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){var g,A;(void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",!0===this.editMode?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",!0===this.editMode?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv)&&(this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",null!==(g=null===(A=this.options.locales[this.options.locale])||void 0===A?void 0:A.close)&&void 0!==g?g:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}_getNewTargetNode(g,A){const C=Tu({},this.options.controlNodeStyle);C.id="targetNode"+nw(),C.hidden=!1,C.physics=!1,C.x=g,C.y=A;const I=this.body.functions.createNode(C);return I.shape.boundingBox={left:g,right:g,top:A,bottom:A},I}_createEditButton(){var g;this._clean(),this.manipulationDOM={},mu(this.editModeDiv);const A=this.options.locales[this.options.locale],C=this._createButton("editMode","vis-edit vis-edit-mode",A.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(C),this._bindElementEvents(C,GI(g=this.toggleEditMode).call(g,this))}_clean(){this.inMode=!1,!0===this.guiEnabled&&(mu(this.editModeDiv),mu(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(const A of gd(g=this._domEventListenerCleanupQueue).call(g,0)){var g;A()}}_removeManipulationDOM(){this._clean(),mu(this.manipulationDiv),mu(this.editModeDiv),mu(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}_createSeperator(){let g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+g]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+g].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+g])}_createAddNodeButton(g){var A;const C=this._createButton("addNode","vis-add",g.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(C),this._bindElementEvents(C,GI(A=this.addNodeMode).call(A,this))}_createAddEdgeButton(g){var A;const C=this._createButton("addEdge","vis-connect",g.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(C),this._bindElementEvents(C,GI(A=this.addEdgeMode).call(A,this))}_createEditNodeButton(g){var A;const C=this._createButton("editNode","vis-edit",g.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(C),this._bindElementEvents(C,GI(A=this.editNode).call(A,this))}_createEditEdgeButton(g){var A;const C=this._createButton("editEdge","vis-edit",g.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(C),this._bindElementEvents(C,GI(A=this.editEdgeMode).call(A,this))}_createDeleteButton(g){var A;let C;C=this.options.rtl?"vis-delete-rtl":"vis-delete";const I=this._createButton("delete",C,g.del||this.options.locales.en.del);this.manipulationDiv.appendChild(I),this._bindElementEvents(I,GI(A=this.deleteSelected).call(A,this))}_createBackButton(g){var A;const C=this._createButton("back","vis-back",g.back||this.options.locales.en.back);this.manipulationDiv.appendChild(C),this._bindElementEvents(C,GI(A=this.showManipulatorToolbar).call(A,this))}_createButton(g,A,C){let I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vis-label";return this.manipulationDOM[g+"Div"]=document.createElement("button"),this.manipulationDOM[g+"Div"].className="vis-button "+A,this.manipulationDOM[g+"Label"]=document.createElement("div"),this.manipulationDOM[g+"Label"].className=I,this.manipulationDOM[g+"Label"].innerText=C,this.manipulationDOM[g+"Div"].appendChild(this.manipulationDOM[g+"Label"]),this.manipulationDOM[g+"Div"]}_createDescription(g){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=g,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(g,A){this.temporaryEventFunctions.push({event:g,boundFunction:A}),this.body.emitter.on(g,A)}_temporaryBindUI(g,A){if(void 0===this.body.eventListeners[g])throw new Error("This UI function does not exist. Typo? You tried: "+g+" possible are: "+Zh(ga(this.body.eventListeners)));this.temporaryUIFunctions[g]=this.body.eventListeners[g],this.body.eventListeners[g]=A}_unbindTemporaryUIs(){for(const g in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,g)&&(this.body.eventListeners[g]=this.temporaryUIFunctions[g],delete this.temporaryUIFunctions[g]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let g=0;g{C.destroy()}));const I=g=>{let{keyCode:C,key:I}=g;"Enter"!==I&&" "!==I&&13!==C&&32!==C||A()};g.addEventListener("keyup",I,!1),this._domEventListenerCleanupQueue.push((()=>{g.removeEventListener("keyup",I,!1)}))}_cleanupTemporaryNodesAndEdges(){for(let C=0;C=0;g--)if(t[g]!==this.selectedControlNode.id){e=this.body.nodes[t[g]];break}if(void 0!==e&&void 0!==this.selectedControlNode)if(!0===e.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const g=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===g.id?this._performEditEdge(e.id,I.to.id):this._performEditEdge(I.from.id,e.id)}else I.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}_handleConnect(g){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(g.center),this.lastTouch.translation=fI({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;const A=this.lastTouch,C=this.selectionHandler.getNodeAt(A);if(void 0!==C)if(!0===C.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const g=this._getNewTargetNode(C.x,C.y);this.body.nodes[g.id]=g,this.body.nodeIndices.push(g.id);const A=this.body.functions.createEdge({id:"connectionEdge"+nw(),from:C.id,to:g.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[A.id]=A,this.body.edgeIndices.push(A.id),this.temporaryIds.nodes.push(g.id),this.temporaryIds.edges.push(A.id)}this.touchTime=(new Date).valueOf()}}_dragControlNode(g){const A=this.body.functions.getPointer(g.center),C=this.selectionHandler._pointerToPositionObject(A);let I;void 0!==this.temporaryIds.edges[0]&&(I=this.body.edges[this.temporaryIds.edges[0]].fromId);const t=this.selectionHandler._getAllNodesOverlappingWith(C);let e;for(let g=t.length-1;g>=0;g--){var i;if(-1===kh(i=this.temporaryIds.nodes).call(i,t[g])){e=this.body.nodes[t[g]];break}}if(g.controlEdge={from:I,to:e?e.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",g,A),void 0!==this.temporaryIds.nodes[0]){const g=this.body.nodes[this.temporaryIds.nodes[0]];g.x=this.canvas._XconvertDOMtoCanvas(A.x),g.y=this.canvas._YconvertDOMtoCanvas(A.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(g)}_finishConnect(g){const A=this.body.functions.getPointer(g.center),C=this.selectionHandler._pointerToPositionObject(A);let I;void 0!==this.temporaryIds.edges[0]&&(I=this.body.edges[this.temporaryIds.edges[0]].fromId);const t=this.selectionHandler._getAllNodesOverlappingWith(C);let e;for(let g=t.length-1;g>=0;g--){var i;if(-1===kh(i=this.temporaryIds.nodes).call(i,t[g])){e=this.body.nodes[t[g]];break}}this._cleanupTemporaryNodesAndEdges(),void 0!==e&&(!0===e.isCluster?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[I]&&void 0!==this.body.nodes[e.id]&&this._performAddEdge(I,e.id)),g.controlEdge={from:I,to:e?e.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",g,A),this.body.emitter.emit("_redraw")}_dragStartEdge(g){const A=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",g,A,void 0,!0)}_performAddNode(g){const A={id:nw(),x:g.pointer.canvas.x,y:g.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(A,(g=>{null!=g&&"addNode"===this.inMode&&this.body.data.nodes.getDataSet().add(g),this.showManipulatorToolbar()}))}else this.body.data.nodes.getDataSet().add(A),this.showManipulatorToolbar()}_performAddEdge(g,A){const C={from:g,to:A};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(C,(g=>{null!=g&&"addEdge"===this.inMode&&(this.body.data.edges.getDataSet().add(g),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().add(C),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(g,A){const C={id:this.edgeBeingEditedId,from:g,to:A,label:this.body.data.edges.get(this.edgeBeingEditedId).label};let I=this.options.editEdge;if("object"==typeof I&&(I=I.editWithoutDrag),"function"==typeof I){if(2!==I.length)throw new Error("The function for edit does not support two arguments (data, callback)");I(C,(g=>{null==g||"editEdge"!==this.inMode?(this.body.edges[C.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(g),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().update(C),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}const jO="string",VO="boolean",YO="number",WO="array",QO="object",UO=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],KO={borderWidth:{number:YO},borderWidthSelected:{number:YO,undefined:"undefined"},brokenImage:{string:jO,undefined:"undefined"},chosen:{label:{boolean:VO,function:"function"},node:{boolean:VO,function:"function"},__type__:{object:QO,boolean:VO}},color:{border:{string:jO},background:{string:jO},highlight:{border:{string:jO},background:{string:jO},__type__:{object:QO,string:jO}},hover:{border:{string:jO},background:{string:jO},__type__:{object:QO,string:jO}},__type__:{object:QO,string:jO}},opacity:{number:YO,undefined:"undefined"},fixed:{x:{boolean:VO},y:{boolean:VO},__type__:{object:QO,boolean:VO}},font:{align:{string:jO},color:{string:jO},size:{number:YO},face:{string:jO},background:{string:jO},strokeWidth:{number:YO},strokeColor:{string:jO},vadjust:{number:YO},multi:{boolean:VO,string:jO},bold:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},boldital:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},ital:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},mono:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},__type__:{object:QO,string:jO}},group:{string:jO,number:YO,undefined:"undefined"},heightConstraint:{minimum:{number:YO},valign:{string:jO},__type__:{object:QO,boolean:VO,number:YO}},hidden:{boolean:VO},icon:{face:{string:jO},code:{string:jO},size:{number:YO},color:{string:jO},weight:{string:jO,number:YO},__type__:{object:QO}},id:{string:jO,number:YO},image:{selected:{string:jO,undefined:"undefined"},unselected:{string:jO,undefined:"undefined"},__type__:{object:QO,string:jO}},imagePadding:{top:{number:YO},right:{number:YO},bottom:{number:YO},left:{number:YO},__type__:{object:QO,number:YO}},label:{string:jO,undefined:"undefined"},labelHighlightBold:{boolean:VO},level:{number:YO,undefined:"undefined"},margin:{top:{number:YO},right:{number:YO},bottom:{number:YO},left:{number:YO},__type__:{object:QO,number:YO}},mass:{number:YO},physics:{boolean:VO},scaling:{min:{number:YO},max:{number:YO},label:{enabled:{boolean:VO},min:{number:YO},max:{number:YO},maxVisible:{number:YO},drawThreshold:{number:YO},__type__:{object:QO,boolean:VO}},customScalingFunction:{function:"function"},__type__:{object:QO}},shadow:{enabled:{boolean:VO},color:{string:jO},size:{number:YO},x:{number:YO},y:{number:YO},__type__:{object:QO,boolean:VO}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:VO,array:WO},borderRadius:{number:YO},interpolation:{boolean:VO},useImageSize:{boolean:VO},useBorderWithImage:{boolean:VO},coordinateOrigin:{string:["center","top-left"]},__type__:{object:QO}},size:{number:YO},title:{string:jO,dom:"dom",undefined:"undefined"},value:{number:YO,undefined:"undefined"},widthConstraint:{minimum:{number:YO},maximum:{number:YO},__type__:{object:QO,boolean:VO,number:YO}},x:{number:YO},y:{number:YO},__type__:{object:QO}},HO={configure:{enabled:{boolean:VO},filter:{boolean:VO,string:jO,array:WO,function:"function"},container:{dom:"dom"},showButton:{boolean:VO},__type__:{object:QO,boolean:VO,string:jO,array:WO,function:"function"}},edges:{arrows:{to:{enabled:{boolean:VO},scaleFactor:{number:YO},type:{string:UO},imageHeight:{number:YO},imageWidth:{number:YO},src:{string:jO},__type__:{object:QO,boolean:VO}},middle:{enabled:{boolean:VO},scaleFactor:{number:YO},type:{string:UO},imageWidth:{number:YO},imageHeight:{number:YO},src:{string:jO},__type__:{object:QO,boolean:VO}},from:{enabled:{boolean:VO},scaleFactor:{number:YO},type:{string:UO},imageWidth:{number:YO},imageHeight:{number:YO},src:{string:jO},__type__:{object:QO,boolean:VO}},__type__:{string:["from","to","middle"],object:QO}},endPointOffset:{from:{number:YO},to:{number:YO},__type__:{object:QO,number:YO}},arrowStrikethrough:{boolean:VO},background:{enabled:{boolean:VO},color:{string:jO},size:{number:YO},dashes:{boolean:VO,array:WO},__type__:{object:QO,boolean:VO}},chosen:{label:{boolean:VO,function:"function"},edge:{boolean:VO,function:"function"},__type__:{object:QO,boolean:VO}},color:{color:{string:jO},highlight:{string:jO},hover:{string:jO},inherit:{string:["from","to","both"],boolean:VO},opacity:{number:YO},__type__:{object:QO,string:jO}},dashes:{boolean:VO,array:WO},font:{color:{string:jO},size:{number:YO},face:{string:jO},background:{string:jO},strokeWidth:{number:YO},strokeColor:{string:jO},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:YO},multi:{boolean:VO,string:jO},bold:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},boldital:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},ital:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},mono:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},__type__:{object:QO,string:jO}},hidden:{boolean:VO},hoverWidth:{function:"function",number:YO},label:{string:jO,undefined:"undefined"},labelHighlightBold:{boolean:VO},length:{number:YO,undefined:"undefined"},physics:{boolean:VO},scaling:{min:{number:YO},max:{number:YO},label:{enabled:{boolean:VO},min:{number:YO},max:{number:YO},maxVisible:{number:YO},drawThreshold:{number:YO},__type__:{object:QO,boolean:VO}},customScalingFunction:{function:"function"},__type__:{object:QO}},selectionWidth:{function:"function",number:YO},selfReferenceSize:{number:YO},selfReference:{size:{number:YO},angle:{number:YO},renderBehindTheNode:{boolean:VO},__type__:{object:QO}},shadow:{enabled:{boolean:VO},color:{string:jO},size:{number:YO},x:{number:YO},y:{number:YO},__type__:{object:QO,boolean:VO}},smooth:{enabled:{boolean:VO},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:YO},forceDirection:{string:["horizontal","vertical","none"],boolean:VO},__type__:{object:QO,boolean:VO}},title:{string:jO,undefined:"undefined"},width:{number:YO},widthConstraint:{maximum:{number:YO},__type__:{object:QO,boolean:VO,number:YO}},value:{number:YO,undefined:"undefined"},__type__:{object:QO}},groups:{useDefaultGroups:{boolean:VO},__any__:KO,__type__:{object:QO}},interaction:{dragNodes:{boolean:VO},dragView:{boolean:VO},hideEdgesOnDrag:{boolean:VO},hideEdgesOnZoom:{boolean:VO},hideNodesOnDrag:{boolean:VO},hover:{boolean:VO},keyboard:{enabled:{boolean:VO},speed:{x:{number:YO},y:{number:YO},zoom:{number:YO},__type__:{object:QO}},bindToWindow:{boolean:VO},autoFocus:{boolean:VO},__type__:{object:QO,boolean:VO}},multiselect:{boolean:VO},navigationButtons:{boolean:VO},selectable:{boolean:VO},selectConnectedEdges:{boolean:VO},hoverConnectedEdges:{boolean:VO},tooltipDelay:{number:YO},zoomView:{boolean:VO},zoomSpeed:{number:YO},__type__:{object:QO}},layout:{randomSeed:{undefined:"undefined",number:YO,string:jO},improvedLayout:{boolean:VO},clusterThreshold:{number:YO},hierarchical:{enabled:{boolean:VO},levelSeparation:{number:YO},nodeSpacing:{number:YO},treeSpacing:{number:YO},blockShifting:{boolean:VO},edgeMinimization:{boolean:VO},parentCentralization:{boolean:VO},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:QO,boolean:VO}},__type__:{object:QO}},manipulation:{enabled:{boolean:VO},initiallyActive:{boolean:VO},addNode:{boolean:VO,function:"function"},addEdge:{boolean:VO,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:QO,boolean:VO,function:"function"}},deleteNode:{boolean:VO,function:"function"},deleteEdge:{boolean:VO,function:"function"},controlNodeStyle:KO,__type__:{object:QO,boolean:VO}},nodes:KO,physics:{enabled:{boolean:VO},barnesHut:{theta:{number:YO},gravitationalConstant:{number:YO},centralGravity:{number:YO},springLength:{number:YO},springConstant:{number:YO},damping:{number:YO},avoidOverlap:{number:YO},__type__:{object:QO}},forceAtlas2Based:{theta:{number:YO},gravitationalConstant:{number:YO},centralGravity:{number:YO},springLength:{number:YO},springConstant:{number:YO},damping:{number:YO},avoidOverlap:{number:YO},__type__:{object:QO}},repulsion:{centralGravity:{number:YO},springLength:{number:YO},springConstant:{number:YO},nodeDistance:{number:YO},damping:{number:YO},__type__:{object:QO}},hierarchicalRepulsion:{centralGravity:{number:YO},springLength:{number:YO},springConstant:{number:YO},nodeDistance:{number:YO},damping:{number:YO},avoidOverlap:{number:YO},__type__:{object:QO}},maxVelocity:{number:YO},minVelocity:{number:YO},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:VO},iterations:{number:YO},updateInterval:{number:YO},onlyDynamicEdges:{boolean:VO},fit:{boolean:VO},__type__:{object:QO,boolean:VO}},timestep:{number:YO},adaptiveTimestep:{boolean:VO},wind:{x:{number:YO},y:{number:YO},__type__:{object:QO}},__type__:{object:QO,boolean:VO}},autoResize:{boolean:VO},clickToUse:{boolean:VO},locale:{string:jO},locales:{__any__:{any:"any"},__type__:{object:QO}},height:{string:jO},width:{string:jO},__type__:{object:QO}},XO={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"],shakeTowards:["leaves","roots"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},_O=(g,A,C)=>{var I;return!(!yd(g).call(g,"physics")||!yd(I=XO.physics.solver).call(I,A)||C.physics.solver===A||"wind"===A)};var JO=Object.freeze({__proto__:null,allOptions:HO,configuratorHideOption:_O,configureOptions:XO});class qO{constructor(){}getDistances(g,A,C){const I={},t=g.edges;for(let g=0;g2&&void 0!==arguments[2]&&arguments[2];const I=this.distanceSolver.getDistances(this.body,g,A);this._createL_matrix(I),this._createK_matrix(I),this._createE_matrix();let t=0;const e=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3));let i=1e9,o=0,s=0,n=0,r=0,a=0;for(;i>.01&&t1&&a<5;)a+=1,this._moveNode(o,s,n),[r,s,n]=this._getEnergy(o)}_getHighestEnergyNode(g){const A=this.body.nodeIndices,C=this.body.nodes;let I=0,t=A[0],e=0,i=0;for(let o=0;othis.body.emitter.emit("_requestRedraw"))),this.groups=new Ub,this.canvas=new cE(this.body),this.selectionHandler=new EO(this.body,this.canvas),this.interactionHandler=new bE(this.body,this.canvas,this.selectionHandler),this.view=new uE(this.body,this.canvas),this.renderer=new aE(this.body,this.canvas),this.physics=new oE(this.body),this.layoutEngine=new GO(this.body),this.clustering=new rE(this.body),this.manipulation=new LO(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new mx(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new qx(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new $O(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(C),this.setData(A)}HI(gT.prototype),gT.prototype.setOptions=function(g){if(null===g&&(g=void 0),void 0!==g){!0===Ap.validate(g,HO)&&console.error("%cErrors have been found in the supplied options object.",gp);if(Eu(["locale","locales","clickToUse"],this.options,g),void 0!==g.locale&&(g.locale=function(g,A){try{const[I,t]=A.split(/[-_ /]/,2),e=null!=I?I.toLowerCase():null,i=null!=t?t.toUpperCase():null;if(e&&i){const A=e+"-"+i;if(Object.prototype.hasOwnProperty.call(g,A))return A;var C;console.warn(Pd(C="Unknown variant ".concat(i," of language ")).call(C,e,"."))}if(e){const A=e;if(Object.prototype.hasOwnProperty.call(g,A))return A;console.warn("Unknown language ".concat(e))}return console.warn("Unknown locale ".concat(A,", falling back to English.")),"en"}catch(g){return console.error(g),console.warn("Unexpected error while normalizing locale ".concat(A,", falling back to English.")),"en"}}(g.locales||this.options.locales,g.locale)),g=this.layoutEngine.setOptions(g.layout,g),this.canvas.setOptions(g),this.groups.setOptions(g.groups),this.nodesHandler.setOptions(g.nodes),this.edgesHandler.setOptions(g.edges),this.physics.setOptions(g.physics),this.manipulation.setOptions(g.manipulation,g,this.options),this.interactionHandler.setOptions(g.interaction),this.renderer.setOptions(g.interaction),this.selectionHandler.setOptions(g.interaction),void 0!==g.groups&&this.body.emitter.emit("refreshNodes"),"configure"in g&&(this.configurator||(this.configurator=new Ju(this,this.body.container,XO,this.canvas.pixelRatio,_O)),this.configurator.setOptions(g.configure)),this.configurator&&!0===this.configurator.options.enabled){const g={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};Tu(g.nodes,this.nodesHandler.options),Tu(g.edges,this.edgesHandler.options),Tu(g.layout,this.layoutEngine.options),Tu(g.interaction,this.selectionHandler.options),Tu(g.interaction,this.renderer.options),Tu(g.interaction,this.interactionHandler.options),Tu(g.manipulation,this.manipulation.options),Tu(g.physics,this.physics.options),Tu(g.global,this.canvas.options),Tu(g.global,this.options),this.configurator.setModuleOptions(g)}void 0!==g.clickToUse?!0===g.clickToUse?void 0===this.activator&&(this.activator=new _u(this.canvas.frame),this.activator.on("change",(()=>{this.body.emitter.emit("activate")}))):(void 0!==this.activator&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}},gT.prototype._updateVisibleIndices=function(){const g=this.body.nodes,A=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(const A in g)Object.prototype.hasOwnProperty.call(g,A)&&(this.clustering._isClusteredNode(A)||!1!==g[A].options.hidden||this.body.nodeIndices.push(g[A].id));for(const C in A)if(Object.prototype.hasOwnProperty.call(A,C)){const I=A[C],t=g[I.fromId],e=g[I.toId],i=void 0!==t&&void 0!==e;!this.clustering._isClusteredEdge(C)&&!1===I.options.hidden&&i&&!1===t.options.hidden&&!1===e.options.hidden&&this.body.edgeIndices.push(I.id)}},gT.prototype.bindEventListeners=function(){this.body.emitter.on("_dataChanged",(()=>{this.edgesHandler._updateState(),this.body.emitter.emit("_dataUpdated")})),this.body.emitter.on("_dataUpdated",(()=>{this.clustering._updateState(),this._updateVisibleIndices(),this._updateValueRange(this.body.nodes),this._updateValueRange(this.body.edges),this.body.emitter.emit("startSimulation"),this.body.emitter.emit("_requestRedraw")}))},gT.prototype.setData=function(g){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),g&&g.dot&&(g.nodes||g.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(g&&g.options),g&&g.dot){console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");const A=kp(g.dot);this.setData(A)}else if(g&&g.gephi){console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");const A=Pp(g.gephi);this.setData(A)}else this.nodesHandler.setData(g&&g.nodes,!0),this.edgesHandler.setData(g&&g.edges,!0),this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")},gT.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(const g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&delete this.body.nodes[g];for(const g in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,g)&&delete this.body.edges[g];mu(this.body.container)},gT.prototype._updateValueRange=function(g){let A,C,I,t=0;for(A in g)if(Object.prototype.hasOwnProperty.call(g,A)){const e=g[A].getValue();void 0!==e&&(C=void 0===C?e:Math.min(e,C),I=void 0===I?e:Math.max(e,I),t+=e)}if(void 0!==C&&void 0!==I)for(A in g)Object.prototype.hasOwnProperty.call(g,A)&&g[A].setValueRange(C,I,t)},gT.prototype.isActive=function(){return!this.activator||this.activator.active},gT.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},gT.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},gT.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},gT.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},gT.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},gT.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},gT.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},gT.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},gT.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},gT.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},gT.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)},gT.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)},gT.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)},gT.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)},gT.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)},gT.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},gT.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},gT.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},gT.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},gT.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},gT.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},gT.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},gT.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},gT.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},gT.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},gT.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},gT.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)},gT.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},gT.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},gT.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},gT.prototype.getConnectedNodes=function(g){return void 0!==this.body.nodes[g]?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)},gT.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},gT.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},gT.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},gT.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},gT.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},gT.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},gT.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)},gT.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)},gT.prototype.getNodeAt=function(){const g=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return void 0!==g&&void 0!==g.id?g.id:g},gT.prototype.getEdgeAt=function(){const g=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return void 0!==g&&void 0!==g.id?g.id:g},gT.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},gT.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},gT.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()},gT.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},gT.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},gT.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},gT.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},gT.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},gT.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},gT.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},gT.prototype.getOptionsFromConfigurator=function(){let g={};return this.configurator&&(g=this.configurator.getOptions.apply(this.configurator)),g};const AT=kp;g.DataSet=fw,g.DataView=bw,g.Network=gT,g.NetworkImages=Zp,g.Queue=cw,g.data=yw,g.networkDOTParser=Rp,g.networkGephiParser=Mp,g.networkOptions=JO,g.parseDOTNetwork=AT,g.parseGephiNetwork=Pp})); //# sourceMappingURL=vis-network.min.js.map