@matdata/yasgui-graph-plugin 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var GraphPlugin=(()=>{var sC=Object.defineProperty;var Wh=Object.getOwnPropertyDescriptor;var Yh=Object.getOwnPropertyNames;var _h=Object.prototype.hasOwnProperty;var Kh=(I,e)=>{for(var g in e)sC(I,g,{get:e[g],enumerable:!0})},Uh=(I,e,g,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let A of Yh(e))!_h.call(I,A)&&A!==g&&sC(I,A,{get:()=>e[A],enumerable:!(t=Wh(e,A))||t.enumerable});return I};var Hh=I=>Uh(sC({},"__esModule",{value:!0}),I);var WM={};Kh(WM,{default:()=>jM});function Zo(I){let e=new Map;if(I&&I.getPrefixes){let t=I.getPrefixes();t&&typeof t=="object"&&Object.entries(t).forEach(([A,C])=>{C&&A&&e.set(C,A)})}return Object.entries({"http://www.w3.org/1999/02/22-rdf-syntax-ns#":"rdf","http://www.w3.org/2000/01/rdf-schema#":"rdfs","http://www.w3.org/2001/XMLSchema#":"xsd","http://www.w3.org/2002/07/owl#":"owl"}).forEach(([t,A])=>{e.has(t)||e.set(t,A)}),e}function dg(I,e){if(!I||typeof I!="string")return I;for(let[g,t]of e.entries())if(I.startsWith(g)){let A=I.substring(g.length);return`${t}:${A}`}return I}function Pt(I,e=50){return!I||typeof I!="string"||I.length<=e?I:I.substring(0,e-3)+"..."}function rC(I){return{autoResize:!0,width:"100%",height:"100%",physics:{enabled:!0,stabilization:{enabled:!0,iterations:200,updateInterval:25},barnesHut:{gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09}},interaction:{dragNodes:!0,dragView:!0,zoomView:!0,hover:!0,tooltipDelay:300},nodes:{shape:"dot",size:10,font:{size:12,color:I.text},borderWidth:1,borderWidthSelected:2,labelHighlightBold:!0},edges:{arrows:{to:{enabled:!0,scaleFactor:.6}},smooth:{enabled:!0,type:"dynamic"},font:{size:12,align:"middle",color:I.edgeLabel,background:I.edgeLabelBackground,strokeWidth:0},color:{color:I.edge}}}}function Lo(I){let e=[];return!I||!I.getBindings||I.getBindings().forEach(t=>{if(!t.subject||!t.predicate||!t.object)return;let A={subject:t.subject.value,predicate:t.predicate.value,object:{value:t.object.value,type:t.object.type||"uri",datatype:t.object.datatype,lang:t.object["xml:lang"]}};e.push(A)}),e}function aC(I,e,g){return I.uri&&I.uri.startsWith("_:")?g.blankNode:I.type==="literal"?g.literal:e.some(A=>A.predicate==="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"&&A.object.value===I.uri)?g.typeObject:g.uri}function Qh(I,e,g){let t=new Map,A=1;return I.forEach(C=>{if(!t.has(C.subject)){let n=C.subject.startsWith("_:"),o=n?C.subject:Pt(dg(C.subject,e));t.set(C.subject,{id:A++,uri:C.subject,label:o,color:aC({uri:C.subject,type:"uri"},I,g),type:"uri",fullValue:C.subject,title:n?C.subject:dg(C.subject,e)})}let i=C.object.value;if(!t.has(i)){let n=C.object.type==="literal",o=!n&&i.startsWith("_:"),s,r,a;n?(s=Pt(i),r=i,a=C.object.datatype?`"${i}"^^${dg(C.object.datatype,e)}`:`"${i}"`):o?(s=i,r=i,a=i):(s=Pt(dg(i,e)),r=i,a=dg(i,e)),t.set(i,{id:A++,uri:n?null:i,label:s,color:aC({uri:i,type:n?"literal":"uri"},I,g),type:n?"literal":"uri",fullValue:r,title:a})}}),t}function Xh(I,e,g){let t=[],A=new Set;return I.forEach(C=>{let i=e.get(C.subject),n=e.get(C.object.value);if(!i||!n)return;let o=`${i.id}-${C.predicate}-${n.id}`;A.has(o)||(A.add(o),t.push({id:`edge_${i.id}_${n.id}_${t.length}`,from:i.id,to:n.id,label:Pt(dg(C.predicate,g)),predicate:C.predicate,title:dg(C.predicate,g),arrows:"to"}))}),t}function dC(I,e,g){let t=Qh(I,e,g),A=Xh(I,t,e);return{nodes:Array.from(t.values()),edges:A}}var lC=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function D(I){return I&&I.__esModule&&Object.prototype.hasOwnProperty.call(I,"default")?I.default:I}var FA=function(I){return I&&I.Math===Math&&I},X=FA(typeof globalThis=="object"&&globalThis)||FA(typeof window=="object"&&window)||FA(typeof self=="object"&&self)||FA(typeof lC=="object"&&lC)||function(){return this}()||lC||Function("return this")(),z=function(I){try{return!!I()}catch(e){return!0}},Jh=z,gA=!Jh(function(){var I=function(){}.bind();return typeof I!="function"||I.hasOwnProperty("prototype")}),$h=gA,Sa=Function.prototype,Go=Sa.apply,Vo=Sa.call,VI=typeof Reflect=="object"&&Reflect.apply||($h?Vo.bind(Go):function(){return Vo.apply(Go,arguments)}),ka=gA,Ma=Function.prototype,pi=Ma.call,qh=ka&&Ma.bind.bind(pi,pi),Z=ka?qh:function(I){return function(){return pi.apply(I,arguments)}},Fa=Z,ec=Fa({}.toString),gc=Fa("".slice),sg=function(I){return gc(ec(I),8,-1)},tc=sg,Ac=Z,Hn=function(I){if(tc(I)==="Function")return Ac(I)},mi=typeof document=="object"&&document.all,Ic=typeof mi=="undefined"&&mi!==void 0,Ba={all:mi,IS_HTMLDDA:Ic},za=Ba,Cc=za.all,le=za.IS_HTMLDDA?function(I){return typeof I=="function"||I===Cc}:function(I){return typeof I=="function"},tA={},ic=z,ie=!ic(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),nc=gA,BA=Function.prototype.call,je=nc?BA.bind(BA):function(){return BA.apply(BA,arguments)},AA={},Za={}.propertyIsEnumerable,La=Object.getOwnPropertyDescriptor,oc=La&&!Za.call({1:2},1);AA.f=oc?function(e){var g=La(this,e);return!!g&&g.enumerable}:Za;var IA=function(I,e){return{enumerable:!(I&1),configurable:!(I&2),writable:!(I&4),value:e}},sc=Z,rc=z,ac=sg,hC=Object,dc=sc("".split),jI=rc(function(){return!hC("z").propertyIsEnumerable(0)})?function(I){return ac(I)==="String"?dc(I,""):hC(I)}:hC,ft=function(I){return I==null},lc=ft,hc=TypeError,CA=function(I){if(lc(I))throw new hc("Can't call method on "+I);return I},cc=jI,uc=CA,We=function(I){return cc(uc(I))},jo=le,Ga=Ba,fc=Ga.all,ce=Ga.IS_HTMLDDA?function(I){return typeof I=="object"?I!==null:jo(I)||I===fc}:function(I){return typeof I=="object"?I!==null:jo(I)},L={},cC=L,uC=X,pc=le,Wo=function(I){return pc(I)?I:void 0},Ye=function(I,e){return arguments.length<2?Wo(cC[I])||Wo(uC[I]):cC[I]&&cC[I][e]||uC[I]&&uC[I][e]},mc=Z,J=mc({}.isPrototypeOf),iA=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Va=X,fC=iA,Yo=Va.process,_o=Va.Deno,Ko=Yo&&Yo.versions||_o&&_o.version,Uo=Ko&&Ko.v8,Be,lI;Uo&&(Be=Uo.split("."),lI=Be[0]>0&&Be[0]<4?1:+(Be[0]+Be[1]));!lI&&fC&&(Be=fC.match(/Edge\/(\d+)/),(!Be||Be[1]>=74)&&(Be=fC.match(/Chrome\/(\d+)/),Be&&(lI=+Be[1])));var nA=lI,Ho=nA,vc=z,bc=X,yc=bc.String,pt=!!Object.getOwnPropertySymbols&&!vc(function(){var I=Symbol("symbol detection");return!yc(I)||!(Object(I)instanceof Symbol)||!Symbol.sham&&Ho&&Ho<41}),wc=pt,ja=wc&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ec=Ye,Tc=le,xc=J,Oc=ja,Pc=Object,oA=Oc?function(I){return typeof I=="symbol"}:function(I){var e=Ec("Symbol");return Tc(e)&&xc(e.prototype,Pc(I))},Dc=String,sA=function(I){try{return Dc(I)}catch(e){return"Object"}},Nc=le,Rc=sA,Sc=TypeError,Yg=function(I){if(Nc(I))return I;throw new Sc(Rc(I)+" is not a function")},kc=Yg,Mc=ft,Qn=function(I,e){var g=I[e];return Mc(g)?void 0:kc(g)},pC=je,mC=le,vC=ce,Fc=TypeError,Bc=function(I,e){var g,t;if(e==="string"&&mC(g=I.toString)&&!vC(t=pC(g,I))||mC(g=I.valueOf)&&!vC(t=pC(g,I))||e!=="string"&&mC(g=I.toString)&&!vC(t=pC(g,I)))return t;throw new Fc("Can't convert object to primitive value")},Wa={exports:{}},Qo=X,zc=Object.defineProperty,Zc=function(I,e){try{zc(Qo,I,{value:e,configurable:!0,writable:!0})}catch(g){Qo[I]=e}return e},Lc=X,Gc=Zc,Xo="__core-js_shared__",Vc=Lc[Xo]||Gc(Xo,{}),Xn=Vc,Jo=Xn;(Wa.exports=function(I,e){return Jo[I]||(Jo[I]=e!==void 0?e:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"\xA9 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 mt=Wa.exports,jc=CA,Wc=Object,xe=function(I){return Wc(jc(I))},Yc=Z,_c=xe,Kc=Yc({}.hasOwnProperty),ne=Object.hasOwn||function(e,g){return Kc(_c(e),g)},Uc=Z,Hc=0,Qc=Math.random(),Xc=Uc(1 .toString),WI=function(I){return"Symbol("+(I===void 0?"":I)+")_"+Xc(++Hc+Qc,36)},Jc=X,$c=mt,$o=ne,qc=WI,eu=pt,gu=ja,It=Jc.Symbol,bC=$c("wks"),tu=gu?It.for||It:It&&It.withoutSetter||qc,ee=function(I){return $o(bC,I)||(bC[I]=eu&&$o(It,I)?It[I]:tu("Symbol."+I)),bC[I]},Au=je,qo=ce,es=oA,Iu=Qn,Cu=Bc,iu=ee,nu=TypeError,ou=iu("toPrimitive"),su=function(I,e){if(!qo(I)||es(I))return I;var g=Iu(I,ou),t;if(g){if(e===void 0&&(e="default"),t=Au(g,I,e),!qo(t)||es(t))return t;throw new nu("Can't convert object to primitive value")}return e===void 0&&(e="number"),Cu(I,e)},ru=su,au=oA,YI=function(I){var e=ru(I,"string");return au(e)?e:e+""},du=X,gs=ce,vi=du.document,lu=gs(vi)&&gs(vi.createElement),Ya=function(I){return lu?vi.createElement(I):{}},hu=ie,cu=z,uu=Ya,_a=!hu&&!cu(function(){return Object.defineProperty(uu("div"),"a",{get:function(){return 7}}).a!==7}),fu=ie,pu=je,mu=AA,vu=IA,bu=We,yu=YI,wu=ne,Eu=_a,ts=Object.getOwnPropertyDescriptor;tA.f=fu?ts:function(e,g){if(e=bu(e),g=yu(g),Eu)try{return ts(e,g)}catch(t){}if(wu(e,g))return vu(!pu(mu.f,e,g),e[g])};var Tu=z,xu=le,Ou=/#|\.prototype\./,rA=function(I,e){var g=Du[Pu(I)];return g===Ru?!0:g===Nu?!1:xu(e)?Tu(e):!!e},Pu=rA.normalize=function(I){return String(I).replace(Ou,".").toLowerCase()},Du=rA.data={},Nu=rA.NATIVE="N",Ru=rA.POLYFILL="P",Su=rA,As=Hn,ku=Yg,Mu=gA,Fu=As(As.bind),aA=function(I,e){return ku(I),e===void 0?I:Mu?Fu(I,e):function(){return I.apply(e,arguments)}},Oe={},Bu=ie,zu=z,Ka=Bu&&zu(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Zu=ce,Lu=String,Gu=TypeError,rg=function(I){if(Zu(I))return I;throw new Gu(Lu(I)+" is not an object")},Vu=ie,ju=_a,Wu=Ka,zA=rg,Is=YI,Yu=TypeError,yC=Object.defineProperty,_u=Object.getOwnPropertyDescriptor,wC="enumerable",EC="configurable",TC="writable";Oe.f=Vu?Wu?function(e,g,t){if(zA(e),g=Is(g),zA(t),typeof e=="function"&&g==="prototype"&&"value"in t&&TC in t&&!t[TC]){var A=_u(e,g);A&&A[TC]&&(e[g]=t.value,t={configurable:EC in t?t[EC]:A[EC],enumerable:wC in t?t[wC]:A[wC],writable:!1})}return yC(e,g,t)}:yC:function(e,g,t){if(zA(e),g=Is(g),zA(t),ju)try{return yC(e,g,t)}catch(A){}if("get"in t||"set"in t)throw new Yu("Accessors not supported");return"value"in t&&(e[g]=t.value),e};var Ku=ie,Uu=Oe,Hu=IA,vt=Ku?function(I,e,g){return Uu.f(I,e,Hu(1,g))}:function(I,e,g){return I[e]=g,I},ZA=X,Qu=VI,Xu=Hn,Ju=le,$u=tA.f,qu=Su,$g=L,ef=aA,qg=vt,Cs=ne,gf=function(I){var e=function(g,t,A){if(this instanceof e){switch(arguments.length){case 0:return new I;case 1:return new I(g);case 2:return new I(g,t)}return new I(g,t,A)}return Qu(I,this,arguments)};return e.prototype=I.prototype,e},N=function(I,e){var g=I.target,t=I.global,A=I.stat,C=I.proto,i=t?ZA:A?ZA[g]:(ZA[g]||{}).prototype,n=t?$g:$g[g]||qg($g,g,{})[g],o=n.prototype,s,r,a,d,l,h,c,p,u;for(d in e)s=qu(t?d:g+(A?".":"#")+d,I.forced),r=!s&&i&&Cs(i,d),h=n[d],r&&(I.dontCallGetSet?(u=$u(i,d),c=u&&u.value):c=i[d]),l=r&&c?c:e[d],!(r&&typeof h==typeof l)&&(I.bind&&r?p=ef(l,ZA):I.wrap&&r?p=gf(l):C&&Ju(l)?p=Xu(l):p=l,(I.sham||l&&l.sham||h&&h.sham)&&qg(p,"sham",!0),qg(n,d,p),C&&(a=g+"Prototype",Cs($g,a)||qg($g,a,{}),qg($g[a],d,l),I.real&&o&&(s||!o[d])&&qg(o,d,l)))},tf=Math.ceil,Af=Math.floor,If=Math.trunc||function(e){var g=+e;return(g>0?Af:tf)(g)},Cf=If,_I=function(I){var e=+I;return e!==e||e===0?0:Cf(e)},nf=_I,of=Math.max,sf=Math.min,dA=function(I,e){var g=nf(I);return g<0?of(g+e,0):sf(g,e)},rf=_I,af=Math.min,df=function(I){return I>0?af(rf(I),9007199254740991):0},lf=df,Se=function(I){return lf(I.length)},hf=We,cf=dA,uf=Se,is=function(I){return function(e,g,t){var A=hf(e),C=uf(A),i=cf(t,C),n;if(I&&g!==g){for(;C>i;)if(n=A[i++],n!==n)return!0}else for(;C>i;i++)if((I||i in A)&&A[i]===g)return I||i||0;return!I&&-1}},Jn={includes:is(!0),indexOf:is(!1)},lA={},ff=Z,xC=ne,pf=We,mf=Jn.indexOf,vf=lA,ns=ff([].push),Ua=function(I,e){var g=pf(I),t=0,A=[],C;for(C in g)!xC(vf,C)&&xC(g,C)&&ns(A,C);for(;e.length>t;)xC(g,C=e[t++])&&(~mf(A,C)||ns(A,C));return A},$n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],bf=Ua,yf=$n,hA=Object.keys||function(e){return bf(e,yf)},cA={};cA.f=Object.getOwnPropertySymbols;var os=ie,wf=Z,Ef=je,Tf=z,OC=hA,xf=cA,Of=AA,Pf=xe,Df=jI,et=Object.assign,ss=Object.defineProperty,Nf=wf([].concat),Rf=!et||Tf(function(){if(os&&et({b:1},et(ss({},"a",{enumerable:!0,get:function(){ss(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var I={},e={},g=Symbol("assign detection"),t="abcdefghijklmnopqrst";return I[g]=7,t.split("").forEach(function(A){e[A]=A}),et({},I)[g]!==7||OC(et({},e)).join("")!==t})?function(e,g){for(var t=Pf(e),A=arguments.length,C=1,i=xf.f,n=Of.f;A>C;)for(var o=Df(arguments[C++]),s=i?Nf(OC(o),i(o)):OC(o),r=s.length,a=0,d;r>a;)d=s[a++],(!os||Ef(n,o,d))&&(t[d]=o[d]);return t}:et,Sf=N,rs=Rf;Sf({target:"Object",stat:!0,arity:2,forced:Object.assign!==rs},{assign:rs});var kf=L,Mf=kf.Object.assign,Ff=Mf,Bf=Ff,zf=Bf,q=D(zf),Zf=Z,KI=Zf([].slice),Ha=Z,Lf=Yg,Gf=ce,Vf=ne,as=KI,jf=gA,Qa=Function,Wf=Ha([].concat),Yf=Ha([].join),PC={},_f=function(I,e,g){if(!Vf(PC,e)){for(var t=[],A=0;A<e;A++)t[A]="a["+A+"]";PC[e]=Qa("C,a","return new C("+Yf(t,",")+")")}return PC[e](I,g)},Kf=jf?Qa.bind:function(e){var g=Lf(this),t=g.prototype,A=as(arguments,1),C=function(){var n=Wf(A,as(arguments));return this instanceof C?_f(g,n.length,n):g.apply(e,n)};return Gf(t)&&(C.prototype=t),C},Uf=N,ds=Kf;Uf({target:"Function",proto:!0,forced:Function.bind!==ds},{bind:ds});var Hf=L,Ie=function(I){return Hf[I+"Prototype"]},Qf=Ie,Xf=Qf("Function").bind,Jf=J,$f=Xf,DC=Function.prototype,qf=function(I){var e=I.bind;return I===DC||Jf(DC,I)&&e===DC.bind?$f:e},ep=qf,gp=ep,tp=gp,b=D(tp);function qn(I,e,g,t){I.beginPath(),I.arc(e,g,t,0,2*Math.PI,!1),I.closePath()}function Ap(I,e,g,t){I.beginPath(),I.rect(e-t,g-t,t*2,t*2),I.closePath()}function Ip(I,e,g,t){I.beginPath(),t*=1.15,g+=.275*t;let A=t*2,C=A/2,i=Math.sqrt(3)/6*A,n=Math.sqrt(A*A-C*C);I.moveTo(e,g-(n-i)),I.lineTo(e+C,g+i),I.lineTo(e-C,g+i),I.lineTo(e,g-(n-i)),I.closePath()}function Cp(I,e,g,t){I.beginPath(),t*=1.15,g-=.275*t;let A=t*2,C=A/2,i=Math.sqrt(3)/6*A,n=Math.sqrt(A*A-C*C);I.moveTo(e,g+(n-i)),I.lineTo(e+C,g-i),I.lineTo(e-C,g-i),I.lineTo(e,g+(n-i)),I.closePath()}function ip(I,e,g,t){I.beginPath(),t*=.82,g+=.1*t;for(let A=0;A<10;A++){let C=A%2===0?t*1.3:t*.5;I.lineTo(e+C*Math.sin(A*2*Math.PI/10),g-C*Math.cos(A*2*Math.PI/10))}I.closePath()}function np(I,e,g,t){I.beginPath(),I.lineTo(e,g+t),I.lineTo(e+t,g),I.lineTo(e,g-t),I.lineTo(e-t,g),I.closePath()}function Xa(I,e,g,t,A,C){let i=Math.PI/180;t-2*C<0&&(C=t/2),A-2*C<0&&(C=A/2),I.beginPath(),I.moveTo(e+C,g),I.lineTo(e+t-C,g),I.arc(e+t-C,g+C,C,i*270,i*360,!1),I.lineTo(e+t,g+A-C),I.arc(e+t-C,g+A-C,C,0,i*90,!1),I.lineTo(e+C,g+A),I.arc(e+C,g+A-C,C,i*90,i*180,!1),I.lineTo(e,g+C),I.arc(e+C,g+C,C,i*180,i*270,!1),I.closePath()}function bi(I,e,g,t,A){let C=.5522848,i=t/2*C,n=A/2*C,o=e+t,s=g+A,r=e+t/2,a=g+A/2;I.beginPath(),I.moveTo(e,a),I.bezierCurveTo(e,a-n,r-i,g,r,g),I.bezierCurveTo(r+i,g,o,a-n,o,a),I.bezierCurveTo(o,a+n,r+i,s,r,s),I.bezierCurveTo(r-i,s,e,a+n,e,a),I.closePath()}function Ja(I,e,g,t,A){let C=.3333333333333333,i=t,n=A*C,o=.5522848,s=i/2*o,r=n/2*o,a=e+i,d=g+n,l=e+i/2,h=g+n/2,c=g+(A-n/2),p=g+A;I.beginPath(),I.moveTo(a,h),I.bezierCurveTo(a,h+r,l+s,d,l,d),I.bezierCurveTo(l-s,d,e,h+r,e,h),I.bezierCurveTo(e,h-r,l-s,g,l,g),I.bezierCurveTo(l+s,g,a,h-r,a,h),I.lineTo(a,c),I.bezierCurveTo(a,c+r,l+s,p,l,p),I.bezierCurveTo(l-s,p,e,c+r,e,c),I.lineTo(e,h)}function $a(I,e,g,t,A,C){I.beginPath(),I.moveTo(e,g);let i=C.length,n=t-e,o=A-g,s=o/n,r=Math.sqrt(n*n+o*o),a=0,d=!0,l=0,h=+C[0];for(;r>=.1;)h=+C[a++%i],h>r&&(h=r),l=Math.sqrt(h*h/(1+s*s)),l=n<0?-l:l,e+=l,g+=s*l,d===!0?I.lineTo(e,g):I.moveTo(e,g),r-=h,d=!d}function op(I,e,g,t){I.beginPath();let A=6,C=Math.PI*2/A;I.moveTo(e+t,g);for(let i=1;i<A;i++)I.lineTo(e+t*Math.cos(C*i),g+t*Math.sin(C*i));I.closePath()}var ls={circle:qn,dashedLine:$a,database:Ja,diamond:np,ellipse:bi,ellipse_vis:bi,hexagon:op,roundRect:Xa,square:Ap,star:ip,triangle:Ip,triangleDown:Cp};function sp(I){return Object.prototype.hasOwnProperty.call(ls,I)?ls[I]:function(e){for(var g=arguments.length,t=new Array(g>1?g-1:0),A=1;A<g;A++)t[A-1]=arguments[A];CanvasRenderingContext2D.prototype[I].call(e,t)}}function _g(I,e){e===void 0&&(e={});var g=e.insertAt;if(!(!I||typeof document=="undefined")){var t=document.head||document.getElementsByTagName("head")[0],A=document.createElement("style");A.type="text/css",g==="top"&&t.firstChild?t.insertBefore(A,t.firstChild):t.appendChild(A),A.styleSheet?A.styleSheet.cssText=I:A.appendChild(document.createTextNode(I))}}var rp=`.vis-overlay {
1
+ "use strict";var TablePlugin=(()=>{var oC=Object.defineProperty;var Yh=Object.getOwnPropertyDescriptor;var Wh=Object.getOwnPropertyNames;var _h=Object.prototype.hasOwnProperty;var Kh=(I,e)=>{for(var g in e)oC(I,g,{get:e[g],enumerable:!0})},Uh=(I,e,g,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let A of Wh(e))!_h.call(I,A)&&A!==g&&oC(I,A,{get:()=>e[A],enumerable:!(t=Yh(e,A))||t.enumerable});return I};var Hh=I=>Uh(oC({},"__esModule",{value:!0}),I);var jM={};Kh(jM,{default:()=>VM});function zr(I){let e=new Map;if(I&&I.getPrefixes){let t=I.getPrefixes();t&&typeof t=="object"&&Object.entries(t).forEach(([A,C])=>{C&&A&&e.set(C,A)})}return Object.entries({"http://www.w3.org/1999/02/22-rdf-syntax-ns#":"rdf","http://www.w3.org/2000/01/rdf-schema#":"rdfs","http://www.w3.org/2001/XMLSchema#":"xsd","http://www.w3.org/2002/07/owl#":"owl"}).forEach(([t,A])=>{e.has(t)||e.set(t,A)}),e}function lg(I,e){if(!I||typeof I!="string")return I;for(let[g,t]of e.entries())if(I.startsWith(g)){let A=I.substring(g.length);return`${t}:${A}`}return I}function Pt(I,e=50){return!I||typeof I!="string"||I.length<=e?I:I.substring(0,e-3)+"..."}function sC(I){return{autoResize:!0,width:"100%",height:"100%",configure:{enabled:!1},physics:{enabled:!0,stabilization:{enabled:!0,iterations:200,updateInterval:25},barnesHut:{gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09}},interaction:{dragNodes:!0,dragView:!0,zoomView:!0,hover:!0,tooltipDelay:300},nodes:{shape:"dot",size:10,font:{size:12,color:I.text},borderWidth:1,borderWidthSelected:2,labelHighlightBold:!0},edges:{arrows:{to:{enabled:!0,scaleFactor:.6}},smooth:{enabled:!0,type:"dynamic",roundness:.5},font:{size:12,align:"middle",color:I.edgeLabel,background:I.edgeLabelBackground,strokeWidth:0},color:{color:I.edge}}}}function Zr(I){let e=[];return!I||!I.getBindings||I.getBindings().forEach(t=>{if(!t.subject||!t.predicate||!t.object)return;let A={subject:t.subject.value,predicate:t.predicate.value,object:{value:t.object.value,type:t.object.type||"uri",datatype:t.object.datatype,lang:t.object["xml:lang"]}};e.push(A)}),e}function aC(I,e,g){return I.uri&&I.uri.startsWith("_:")?g.blankNode:I.type==="literal"?g.literal:e.some(A=>A.predicate==="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"&&A.object.value===I.uri)?g.typeObject:g.uri}function Qh(I,e,g){let t=new Map,A=1;return I.forEach(C=>{if(!t.has(C.subject)){let n=C.subject.startsWith("_:"),r=n?C.subject:Pt(lg(C.subject,e));t.set(C.subject,{id:A++,uri:C.subject,label:r,color:aC({uri:C.subject,type:"uri"},I,g),type:"uri",fullValue:C.subject,title:n?C.subject:lg(C.subject,e)})}let i=C.object.value;if(!t.has(i)){let n=C.object.type==="literal",r=!n&&i.startsWith("_:"),o,s,a;n?(o=Pt(i),s=i,a=C.object.datatype?`"${i}"^^${lg(C.object.datatype,e)}`:`"${i}"`):r?(o=i,s=i,a=i):(o=Pt(lg(i,e)),s=i,a=lg(i,e)),t.set(i,{id:A++,uri:n?null:i,label:o,color:aC({uri:i,type:n?"literal":"uri"},I,g),type:n?"literal":"uri",fullValue:s,title:a})}}),t}function Xh(I,e,g){let t=[],A=new Set;return I.forEach(C=>{let i=e.get(C.subject),n=e.get(C.object.value);if(!i||!n)return;let r=`${i.id}-${C.predicate}-${n.id}`;A.has(r)||(A.add(r),t.push({id:`edge_${i.id}_${n.id}_${t.length}`,from:i.id,to:n.id,label:Pt(lg(C.predicate,g)),predicate:C.predicate,title:lg(C.predicate,g),arrows:"to"}))}),t}function dC(I,e,g){let t=Qh(I,e,g),A=Xh(I,t,e);return{nodes:Array.from(t.values()),edges:A}}var lC=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function D(I){return I&&I.__esModule&&Object.prototype.hasOwnProperty.call(I,"default")?I.default:I}var FA=function(I){return I&&I.Math===Math&&I},X=FA(typeof globalThis=="object"&&globalThis)||FA(typeof window=="object"&&window)||FA(typeof self=="object"&&self)||FA(typeof lC=="object"&&lC)||(function(){return this})()||lC||Function("return this")(),z=function(I){try{return!!I()}catch(e){return!0}},Jh=z,gA=!Jh(function(){var I=(function(){}).bind();return typeof I!="function"||I.hasOwnProperty("prototype")}),$h=gA,Sa=Function.prototype,Lr=Sa.apply,Gr=Sa.call,VI=typeof Reflect=="object"&&Reflect.apply||($h?Gr.bind(Lr):function(){return Gr.apply(Lr,arguments)}),ka=gA,Ma=Function.prototype,pi=Ma.call,qh=ka&&Ma.bind.bind(pi,pi),Z=ka?qh:function(I){return function(){return pi.apply(I,arguments)}},Fa=Z,ec=Fa({}.toString),gc=Fa("".slice),sg=function(I){return gc(ec(I),8,-1)},tc=sg,Ac=Z,Hn=function(I){if(tc(I)==="Function")return Ac(I)},mi=typeof document=="object"&&document.all,Ic=typeof mi=="undefined"&&mi!==void 0,Ba={all:mi,IS_HTMLDDA:Ic},za=Ba,Cc=za.all,le=za.IS_HTMLDDA?function(I){return typeof I=="function"||I===Cc}:function(I){return typeof I=="function"},tA={},ic=z,ie=!ic(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),nc=gA,BA=Function.prototype.call,je=nc?BA.bind(BA):function(){return BA.apply(BA,arguments)},AA={},Za={}.propertyIsEnumerable,La=Object.getOwnPropertyDescriptor,rc=La&&!Za.call({1:2},1);AA.f=rc?function(e){var g=La(this,e);return!!g&&g.enumerable}:Za;var IA=function(I,e){return{enumerable:!(I&1),configurable:!(I&2),writable:!(I&4),value:e}},oc=Z,sc=z,ac=sg,hC=Object,dc=oc("".split),jI=sc(function(){return!hC("z").propertyIsEnumerable(0)})?function(I){return ac(I)==="String"?dc(I,""):hC(I)}:hC,ft=function(I){return I==null},lc=ft,hc=TypeError,CA=function(I){if(lc(I))throw new hc("Can't call method on "+I);return I},cc=jI,uc=CA,Ye=function(I){return cc(uc(I))},Vr=le,Ga=Ba,fc=Ga.all,ce=Ga.IS_HTMLDDA?function(I){return typeof I=="object"?I!==null:Vr(I)||I===fc}:function(I){return typeof I=="object"?I!==null:Vr(I)},L={},cC=L,uC=X,pc=le,jr=function(I){return pc(I)?I:void 0},We=function(I,e){return arguments.length<2?jr(cC[I])||jr(uC[I]):cC[I]&&cC[I][e]||uC[I]&&uC[I][e]},mc=Z,J=mc({}.isPrototypeOf),iA=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Va=X,fC=iA,Yr=Va.process,Wr=Va.Deno,_r=Yr&&Yr.versions||Wr&&Wr.version,Kr=_r&&_r.v8,Be,lI;Kr&&(Be=Kr.split("."),lI=Be[0]>0&&Be[0]<4?1:+(Be[0]+Be[1]));!lI&&fC&&(Be=fC.match(/Edge\/(\d+)/),(!Be||Be[1]>=74)&&(Be=fC.match(/Chrome\/(\d+)/),Be&&(lI=+Be[1])));var nA=lI,Ur=nA,vc=z,bc=X,yc=bc.String,pt=!!Object.getOwnPropertySymbols&&!vc(function(){var I=Symbol("symbol detection");return!yc(I)||!(Object(I)instanceof Symbol)||!Symbol.sham&&Ur&&Ur<41}),wc=pt,ja=wc&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ec=We,Tc=le,xc=J,Oc=ja,Pc=Object,rA=Oc?function(I){return typeof I=="symbol"}:function(I){var e=Ec("Symbol");return Tc(e)&&xc(e.prototype,Pc(I))},Dc=String,oA=function(I){try{return Dc(I)}catch(e){return"Object"}},Nc=le,Rc=oA,Sc=TypeError,Wg=function(I){if(Nc(I))return I;throw new Sc(Rc(I)+" is not a function")},kc=Wg,Mc=ft,Qn=function(I,e){var g=I[e];return Mc(g)?void 0:kc(g)},pC=je,mC=le,vC=ce,Fc=TypeError,Bc=function(I,e){var g,t;if(e==="string"&&mC(g=I.toString)&&!vC(t=pC(g,I))||mC(g=I.valueOf)&&!vC(t=pC(g,I))||e!=="string"&&mC(g=I.toString)&&!vC(t=pC(g,I)))return t;throw new Fc("Can't convert object to primitive value")},Ya={exports:{}},Hr=X,zc=Object.defineProperty,Zc=function(I,e){try{zc(Hr,I,{value:e,configurable:!0,writable:!0})}catch(g){Hr[I]=e}return e},Lc=X,Gc=Zc,Qr="__core-js_shared__",Vc=Lc[Qr]||Gc(Qr,{}),Xn=Vc,Xr=Xn;(Ya.exports=function(I,e){return Xr[I]||(Xr[I]=e!==void 0?e:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"\xA9 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 mt=Ya.exports,jc=CA,Yc=Object,xe=function(I){return Yc(jc(I))},Wc=Z,_c=xe,Kc=Wc({}.hasOwnProperty),ne=Object.hasOwn||function(e,g){return Kc(_c(e),g)},Uc=Z,Hc=0,Qc=Math.random(),Xc=Uc(1 .toString),YI=function(I){return"Symbol("+(I===void 0?"":I)+")_"+Xc(++Hc+Qc,36)},Jc=X,$c=mt,Jr=ne,qc=YI,eu=pt,gu=ja,It=Jc.Symbol,bC=$c("wks"),tu=gu?It.for||It:It&&It.withoutSetter||qc,ee=function(I){return Jr(bC,I)||(bC[I]=eu&&Jr(It,I)?It[I]:tu("Symbol."+I)),bC[I]},Au=je,$r=ce,qr=rA,Iu=Qn,Cu=Bc,iu=ee,nu=TypeError,ru=iu("toPrimitive"),ou=function(I,e){if(!$r(I)||qr(I))return I;var g=Iu(I,ru),t;if(g){if(e===void 0&&(e="default"),t=Au(g,I,e),!$r(t)||qr(t))return t;throw new nu("Can't convert object to primitive value")}return e===void 0&&(e="number"),Cu(I,e)},su=ou,au=rA,WI=function(I){var e=su(I,"string");return au(e)?e:e+""},du=X,eo=ce,vi=du.document,lu=eo(vi)&&eo(vi.createElement),Wa=function(I){return lu?vi.createElement(I):{}},hu=ie,cu=z,uu=Wa,_a=!hu&&!cu(function(){return Object.defineProperty(uu("div"),"a",{get:function(){return 7}}).a!==7}),fu=ie,pu=je,mu=AA,vu=IA,bu=Ye,yu=WI,wu=ne,Eu=_a,go=Object.getOwnPropertyDescriptor;tA.f=fu?go:function(e,g){if(e=bu(e),g=yu(g),Eu)try{return go(e,g)}catch(t){}if(wu(e,g))return vu(!pu(mu.f,e,g),e[g])};var Tu=z,xu=le,Ou=/#|\.prototype\./,sA=function(I,e){var g=Du[Pu(I)];return g===Ru?!0:g===Nu?!1:xu(e)?Tu(e):!!e},Pu=sA.normalize=function(I){return String(I).replace(Ou,".").toLowerCase()},Du=sA.data={},Nu=sA.NATIVE="N",Ru=sA.POLYFILL="P",Su=sA,to=Hn,ku=Wg,Mu=gA,Fu=to(to.bind),aA=function(I,e){return ku(I),e===void 0?I:Mu?Fu(I,e):function(){return I.apply(e,arguments)}},Oe={},Bu=ie,zu=z,Ka=Bu&&zu(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Zu=ce,Lu=String,Gu=TypeError,ag=function(I){if(Zu(I))return I;throw new Gu(Lu(I)+" is not an object")},Vu=ie,ju=_a,Yu=Ka,zA=ag,Ao=WI,Wu=TypeError,yC=Object.defineProperty,_u=Object.getOwnPropertyDescriptor,wC="enumerable",EC="configurable",TC="writable";Oe.f=Vu?Yu?function(e,g,t){if(zA(e),g=Ao(g),zA(t),typeof e=="function"&&g==="prototype"&&"value"in t&&TC in t&&!t[TC]){var A=_u(e,g);A&&A[TC]&&(e[g]=t.value,t={configurable:EC in t?t[EC]:A[EC],enumerable:wC in t?t[wC]:A[wC],writable:!1})}return yC(e,g,t)}:yC:function(e,g,t){if(zA(e),g=Ao(g),zA(t),ju)try{return yC(e,g,t)}catch(A){}if("get"in t||"set"in t)throw new Wu("Accessors not supported");return"value"in t&&(e[g]=t.value),e};var Ku=ie,Uu=Oe,Hu=IA,vt=Ku?function(I,e,g){return Uu.f(I,e,Hu(1,g))}:function(I,e,g){return I[e]=g,I},ZA=X,Qu=VI,Xu=Hn,Ju=le,$u=tA.f,qu=Su,$g=L,ef=aA,qg=vt,Io=ne,gf=function(I){var e=function(g,t,A){if(this instanceof e){switch(arguments.length){case 0:return new I;case 1:return new I(g);case 2:return new I(g,t)}return new I(g,t,A)}return Qu(I,this,arguments)};return e.prototype=I.prototype,e},N=function(I,e){var g=I.target,t=I.global,A=I.stat,C=I.proto,i=t?ZA:A?ZA[g]:(ZA[g]||{}).prototype,n=t?$g:$g[g]||qg($g,g,{})[g],r=n.prototype,o,s,a,d,l,h,c,p,u;for(d in e)o=qu(t?d:g+(A?".":"#")+d,I.forced),s=!o&&i&&Io(i,d),h=n[d],s&&(I.dontCallGetSet?(u=$u(i,d),c=u&&u.value):c=i[d]),l=s&&c?c:e[d],!(s&&typeof h==typeof l)&&(I.bind&&s?p=ef(l,ZA):I.wrap&&s?p=gf(l):C&&Ju(l)?p=Xu(l):p=l,(I.sham||l&&l.sham||h&&h.sham)&&qg(p,"sham",!0),qg(n,d,p),C&&(a=g+"Prototype",Io($g,a)||qg($g,a,{}),qg($g[a],d,l),I.real&&r&&(o||!r[d])&&qg(r,d,l)))},tf=Math.ceil,Af=Math.floor,If=Math.trunc||function(e){var g=+e;return(g>0?Af:tf)(g)},Cf=If,_I=function(I){var e=+I;return e!==e||e===0?0:Cf(e)},nf=_I,rf=Math.max,of=Math.min,dA=function(I,e){var g=nf(I);return g<0?rf(g+e,0):of(g,e)},sf=_I,af=Math.min,df=function(I){return I>0?af(sf(I),9007199254740991):0},lf=df,Se=function(I){return lf(I.length)},hf=Ye,cf=dA,uf=Se,Co=function(I){return function(e,g,t){var A=hf(e),C=uf(A),i=cf(t,C),n;if(I&&g!==g){for(;C>i;)if(n=A[i++],n!==n)return!0}else for(;C>i;i++)if((I||i in A)&&A[i]===g)return I||i||0;return!I&&-1}},Jn={includes:Co(!0),indexOf:Co(!1)},lA={},ff=Z,xC=ne,pf=Ye,mf=Jn.indexOf,vf=lA,io=ff([].push),Ua=function(I,e){var g=pf(I),t=0,A=[],C;for(C in g)!xC(vf,C)&&xC(g,C)&&io(A,C);for(;e.length>t;)xC(g,C=e[t++])&&(~mf(A,C)||io(A,C));return A},$n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],bf=Ua,yf=$n,hA=Object.keys||function(e){return bf(e,yf)},cA={};cA.f=Object.getOwnPropertySymbols;var no=ie,wf=Z,Ef=je,Tf=z,OC=hA,xf=cA,Of=AA,Pf=xe,Df=jI,et=Object.assign,ro=Object.defineProperty,Nf=wf([].concat),Rf=!et||Tf(function(){if(no&&et({b:1},et(ro({},"a",{enumerable:!0,get:function(){ro(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var I={},e={},g=Symbol("assign detection"),t="abcdefghijklmnopqrst";return I[g]=7,t.split("").forEach(function(A){e[A]=A}),et({},I)[g]!==7||OC(et({},e)).join("")!==t})?function(e,g){for(var t=Pf(e),A=arguments.length,C=1,i=xf.f,n=Of.f;A>C;)for(var r=Df(arguments[C++]),o=i?Nf(OC(r),i(r)):OC(r),s=o.length,a=0,d;s>a;)d=o[a++],(!no||Ef(n,r,d))&&(t[d]=r[d]);return t}:et,Sf=N,oo=Rf;Sf({target:"Object",stat:!0,arity:2,forced:Object.assign!==oo},{assign:oo});var kf=L,Mf=kf.Object.assign,Ff=Mf,Bf=Ff,zf=Bf,q=D(zf),Zf=Z,KI=Zf([].slice),Ha=Z,Lf=Wg,Gf=ce,Vf=ne,so=KI,jf=gA,Qa=Function,Yf=Ha([].concat),Wf=Ha([].join),PC={},_f=function(I,e,g){if(!Vf(PC,e)){for(var t=[],A=0;A<e;A++)t[A]="a["+A+"]";PC[e]=Qa("C,a","return new C("+Wf(t,",")+")")}return PC[e](I,g)},Kf=jf?Qa.bind:function(e){var g=Lf(this),t=g.prototype,A=so(arguments,1),C=function(){var n=Yf(A,so(arguments));return this instanceof C?_f(g,n.length,n):g.apply(e,n)};return Gf(t)&&(C.prototype=t),C},Uf=N,ao=Kf;Uf({target:"Function",proto:!0,forced:Function.bind!==ao},{bind:ao});var Hf=L,Ie=function(I){return Hf[I+"Prototype"]},Qf=Ie,Xf=Qf("Function").bind,Jf=J,$f=Xf,DC=Function.prototype,qf=function(I){var e=I.bind;return I===DC||Jf(DC,I)&&e===DC.bind?$f:e},ep=qf,gp=ep,tp=gp,b=D(tp);function qn(I,e,g,t){I.beginPath(),I.arc(e,g,t,0,2*Math.PI,!1),I.closePath()}function Ap(I,e,g,t){I.beginPath(),I.rect(e-t,g-t,t*2,t*2),I.closePath()}function Ip(I,e,g,t){I.beginPath(),t*=1.15,g+=.275*t;let A=t*2,C=A/2,i=Math.sqrt(3)/6*A,n=Math.sqrt(A*A-C*C);I.moveTo(e,g-(n-i)),I.lineTo(e+C,g+i),I.lineTo(e-C,g+i),I.lineTo(e,g-(n-i)),I.closePath()}function Cp(I,e,g,t){I.beginPath(),t*=1.15,g-=.275*t;let A=t*2,C=A/2,i=Math.sqrt(3)/6*A,n=Math.sqrt(A*A-C*C);I.moveTo(e,g+(n-i)),I.lineTo(e+C,g-i),I.lineTo(e-C,g-i),I.lineTo(e,g+(n-i)),I.closePath()}function ip(I,e,g,t){I.beginPath(),t*=.82,g+=.1*t;for(let A=0;A<10;A++){let C=A%2===0?t*1.3:t*.5;I.lineTo(e+C*Math.sin(A*2*Math.PI/10),g-C*Math.cos(A*2*Math.PI/10))}I.closePath()}function np(I,e,g,t){I.beginPath(),I.lineTo(e,g+t),I.lineTo(e+t,g),I.lineTo(e,g-t),I.lineTo(e-t,g),I.closePath()}function Xa(I,e,g,t,A,C){let i=Math.PI/180;t-2*C<0&&(C=t/2),A-2*C<0&&(C=A/2),I.beginPath(),I.moveTo(e+C,g),I.lineTo(e+t-C,g),I.arc(e+t-C,g+C,C,i*270,i*360,!1),I.lineTo(e+t,g+A-C),I.arc(e+t-C,g+A-C,C,0,i*90,!1),I.lineTo(e+C,g+A),I.arc(e+C,g+A-C,C,i*90,i*180,!1),I.lineTo(e,g+C),I.arc(e+C,g+C,C,i*180,i*270,!1),I.closePath()}function bi(I,e,g,t,A){let C=.5522848,i=t/2*C,n=A/2*C,r=e+t,o=g+A,s=e+t/2,a=g+A/2;I.beginPath(),I.moveTo(e,a),I.bezierCurveTo(e,a-n,s-i,g,s,g),I.bezierCurveTo(s+i,g,r,a-n,r,a),I.bezierCurveTo(r,a+n,s+i,o,s,o),I.bezierCurveTo(s-i,o,e,a+n,e,a),I.closePath()}function Ja(I,e,g,t,A){let C=.3333333333333333,i=t,n=A*C,r=.5522848,o=i/2*r,s=n/2*r,a=e+i,d=g+n,l=e+i/2,h=g+n/2,c=g+(A-n/2),p=g+A;I.beginPath(),I.moveTo(a,h),I.bezierCurveTo(a,h+s,l+o,d,l,d),I.bezierCurveTo(l-o,d,e,h+s,e,h),I.bezierCurveTo(e,h-s,l-o,g,l,g),I.bezierCurveTo(l+o,g,a,h-s,a,h),I.lineTo(a,c),I.bezierCurveTo(a,c+s,l+o,p,l,p),I.bezierCurveTo(l-o,p,e,c+s,e,c),I.lineTo(e,h)}function $a(I,e,g,t,A,C){I.beginPath(),I.moveTo(e,g);let i=C.length,n=t-e,r=A-g,o=r/n,s=Math.sqrt(n*n+r*r),a=0,d=!0,l=0,h=+C[0];for(;s>=.1;)h=+C[a++%i],h>s&&(h=s),l=Math.sqrt(h*h/(1+o*o)),l=n<0?-l:l,e+=l,g+=o*l,d===!0?I.lineTo(e,g):I.moveTo(e,g),s-=h,d=!d}function rp(I,e,g,t){I.beginPath();let A=6,C=Math.PI*2/A;I.moveTo(e+t,g);for(let i=1;i<A;i++)I.lineTo(e+t*Math.cos(C*i),g+t*Math.sin(C*i));I.closePath()}var lo={circle:qn,dashedLine:$a,database:Ja,diamond:np,ellipse:bi,ellipse_vis:bi,hexagon:rp,roundRect:Xa,square:Ap,star:ip,triangle:Ip,triangleDown:Cp};function op(I){return Object.prototype.hasOwnProperty.call(lo,I)?lo[I]:function(e){for(var g=arguments.length,t=new Array(g>1?g-1:0),A=1;A<g;A++)t[A-1]=arguments[A];CanvasRenderingContext2D.prototype[I].call(e,t)}}function _g(I,e){e===void 0&&(e={});var g=e.insertAt;if(!(!I||typeof document=="undefined")){var t=document.head||document.getElementsByTagName("head")[0],A=document.createElement("style");A.type="text/css",g==="top"&&t.firstChild?t.insertBefore(A,t.firstChild):t.appendChild(A),A.styleSheet?A.styleSheet.cssText=I:A.appendChild(document.createTextNode(I))}}var sp=`.vis-overlay {
2
2
  position: absolute;
3
3
  top: 0px;
4
4
  right: 0px;
@@ -12,7 +12,7 @@ var GraphPlugin=(()=>{var sC=Object.defineProperty;var Wh=Object.getOwnPropertyD
12
12
  .vis-active {
13
13
  box-shadow: 0 0 10px #86d5f8;
14
14
  }
15
- `;_g(rp);var ap=`/* override some bootstrap styles screwing up the timelines css */
15
+ `;_g(sp);var ap=`/* override some bootstrap styles screwing up the timelines css */
16
16
 
17
17
  .vis [class*="span"] {
18
18
  min-height: 0;
@@ -627,12 +627,12 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper {
627
627
 
628
628
  z-index: 5;
629
629
  }
630
- `;_g(hp);var qa={exports:{}};(function(I){I.exports=e;function e(t){if(t)return g(t)}function g(t){for(var A in e.prototype)t[A]=e.prototype[A];return t}e.prototype.on=e.prototype.addEventListener=function(t,A){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(A),this},e.prototype.once=function(t,A){function C(){this.off(t,C),A.apply(this,arguments)}return C.fn=A,this.on(t,C),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,A){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var C=this._callbacks["$"+t];if(!C)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var i,n=0;n<C.length;n++)if(i=C[n],i===A||i.fn===A){C.splice(n,1);break}return C.length===0&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var A=new Array(arguments.length-1),C=this._callbacks["$"+t],i=1;i<arguments.length;i++)A[i-1]=arguments[i];if(C){C=C.slice(0);for(var i=0,n=C.length;i<n;++i)C[i].apply(this,A)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}})(qa);var cp=qa.exports,ed=D(cp),up=sg,Dg=Array.isArray||function(e){return up(e)==="Array"},fp=TypeError,pp=9007199254740991,eo=function(I){if(I>pp)throw fp("Maximum allowed index exceeded");return I},mp=YI,vp=Oe,bp=IA,uA=function(I,e,g){var t=mp(e);t in I?vp.f(I,t,bp(0,g)):I[t]=g},yp=ee,wp=yp("toStringTag"),gd={};gd[wp]="z";var go=String(gd)==="[object z]",Ep=go,Tp=le,II=sg,xp=ee,Op=xp("toStringTag"),Pp=Object,Dp=II(function(){return arguments}())==="Arguments",Np=function(I,e){try{return I[e]}catch(g){}},ag=Ep?II:function(I){var e,g,t;return I===void 0?"Undefined":I===null?"Null":typeof(g=Np(e=Pp(I),Op))=="string"?g:Dp?II(e):(t=II(e))==="Object"&&Tp(e.callee)?"Arguments":t},Rp=Z,Sp=le,yi=Xn,kp=Rp(Function.toString);Sp(yi.inspectSource)||(yi.inspectSource=function(I){return kp(I)});var Mp=yi.inspectSource,Fp=Z,Bp=z,td=le,zp=ag,Zp=Ye,Lp=Mp,Ad=function(){},Gp=[],Id=Zp("Reflect","construct"),to=/^\s*(?:class|function)\b/,Vp=Fp(to.exec),jp=!to.test(Ad),Dt=function(e){if(!td(e))return!1;try{return Id(Ad,Gp,e),!0}catch(g){return!1}},Cd=function(e){if(!td(e))return!1;switch(zp(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return jp||!!Vp(to,Lp(e))}catch(g){return!0}};Cd.sham=!0;var id=!Id||Bp(function(){var I;return Dt(Dt.call)||!Dt(Object)||!Dt(function(){I=!0})||I})?Cd:Dt,hs=Dg,Wp=id,Yp=ce,_p=ee,Kp=_p("species"),cs=Array,Up=function(I){var e;return hs(I)&&(e=I.constructor,Wp(e)&&(e===cs||hs(e.prototype))?e=void 0:Yp(e)&&(e=e[Kp],e===null&&(e=void 0))),e===void 0?cs:e},Hp=Up,UI=function(I,e){return new(Hp(I))(e===0?0:e)},Qp=z,Xp=ee,Jp=nA,$p=Xp("species"),fA=function(I){return Jp>=51||!Qp(function(){var e=[],g=e.constructor={};return g[$p]=function(){return{foo:1}},e[I](Boolean).foo!==1})},qp=N,em=z,gm=Dg,tm=ce,Am=xe,Im=Se,us=eo,fs=uA,Cm=UI,im=fA,nm=ee,om=nA,nd=nm("isConcatSpreadable"),sm=om>=51||!em(function(){var I=[];return I[nd]=!1,I.concat()[0]!==I}),rm=function(I){if(!tm(I))return!1;var e=I[nd];return e!==void 0?!!e:gm(I)},am=!sm||!im("concat");qp({target:"Array",proto:!0,arity:1,forced:am},{concat:function(e){var g=Am(this),t=Cm(g,0),A=0,C,i,n,o,s;for(C=-1,n=arguments.length;C<n;C++)if(s=C===-1?g:arguments[C],rm(s))for(o=Im(s),us(A+o),i=0;i<o;i++,A++)i in s&&fs(t,A,s[i]);else us(A+1),fs(t,A++,s);return t.length=A,t}});var dm=ag,lm=String,qe=function(I){if(dm(I)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return lm(I)},HI={},hm=ie,cm=Ka,um=Oe,fm=rg,pm=We,mm=hA;HI.f=hm&&!cm?Object.defineProperties:function(e,g){fm(e);for(var t=pm(g),A=mm(g),C=A.length,i=0,n;C>i;)um.f(e,n=A[i++],t[n]);return e};var vm=Ye,bm=vm("document","documentElement"),ym=mt,wm=WI,ps=ym("keys"),QI=function(I){return ps[I]||(ps[I]=wm(I))},Em=rg,Tm=HI,ms=$n,xm=lA,Om=bm,Pm=Ya,Dm=QI,vs=">",bs="<",wi="prototype",Ei="script",od=Dm("IE_PROTO"),NC=function(){},sd=function(I){return bs+Ei+vs+I+bs+"/"+Ei+vs},ys=function(I){I.write(sd("")),I.close();var e=I.parentWindow.Object;return I=null,e},Nm=function(){var I=Pm("iframe"),e="java"+Ei+":",g;return I.style.display="none",Om.appendChild(I),I.src=String(e),g=I.contentWindow.document,g.open(),g.write(sd("document.F=Object")),g.close(),g.F},LA,CI=function(){try{LA=new ActiveXObject("htmlfile")}catch(e){}CI=typeof document!="undefined"?document.domain&&LA?ys(LA):Nm():ys(LA);for(var I=ms.length;I--;)delete CI[wi][ms[I]];return CI()};xm[od]=!0;var pA=Object.create||function(e,g){var t;return e!==null?(NC[wi]=Em(e),t=new NC,NC[wi]=null,t[od]=e):t=CI(),g===void 0?t:Tm.f(t,g)},mA={},Rm=Ua,Sm=$n,km=Sm.concat("length","prototype");mA.f=Object.getOwnPropertyNames||function(e){return Rm(e,km)};var XI={},ws=dA,Mm=Se,Fm=uA,Bm=Array,zm=Math.max,rd=function(I,e,g){for(var t=Mm(I),A=ws(e,t),C=ws(g===void 0?t:g,t),i=Bm(zm(C-A,0)),n=0;A<C;A++,n++)Fm(i,n,I[A]);return i.length=n,i},Zm=sg,Lm=We,ad=mA.f,Gm=rd,dd=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Vm=function(I){try{return ad(I)}catch(e){return Gm(dd)}};XI.f=function(e){return dd&&Zm(e)==="Window"?Vm(e):ad(Lm(e))};var jm=vt,vA=function(I,e,g,t){return t&&t.enumerable?I[e]=g:jm(I,e,g),I},Wm=Oe,Ao=function(I,e,g){return Wm.f(I,e,g)},bA={},Ym=ee;bA.f=Ym;var Es=L,_m=ne,Km=bA,Um=Oe.f,$=function(I){var e=Es.Symbol||(Es.Symbol={});_m(e,I)||Um(e,I,{value:Km.f(I)})},Hm=je,Qm=Ye,Xm=ee,Jm=vA,ld=function(){var I=Qm("Symbol"),e=I&&I.prototype,g=e&&e.valueOf,t=Xm("toPrimitive");e&&!e[t]&&Jm(e,t,function(A){return Hm(g,this)},{arity:1})},$m=go,qm=ag,ev=$m?{}.toString:function(){return"[object "+qm(this)+"]"},gv=go,tv=Oe.f,Av=vt,Iv=ne,Cv=ev,iv=ee,Ts=iv("toStringTag"),bt=function(I,e,g,t){if(I){var A=g?I:I.prototype;Iv(A,Ts)||tv(A,Ts,{configurable:!0,value:e}),t&&!gv&&Av(A,"toString",Cv)}},nv=X,ov=le,xs=nv.WeakMap,hd=ov(xs)&&/native code/.test(String(xs)),sv=hd,cd=X,rv=ce,av=vt,RC=ne,SC=Xn,dv=QI,lv=lA,Os="Object already initialized",Ti=cd.TypeError,hv=cd.WeakMap,hI,Yt,cI,cv=function(I){return cI(I)?Yt(I):hI(I,{})},uv=function(I){return function(e){var g;if(!rv(e)||(g=Yt(e)).type!==I)throw new Ti("Incompatible receiver, "+I+" required");return g}};sv||SC.state?(Fe=SC.state||(SC.state=new hv),Fe.get=Fe.get,Fe.has=Fe.has,Fe.set=Fe.set,hI=function(I,e){if(Fe.has(I))throw new Ti(Os);return e.facade=I,Fe.set(I,e),e},Yt=function(I){return Fe.get(I)||{}},cI=function(I){return Fe.has(I)}):(Rg=dv("state"),lv[Rg]=!0,hI=function(I,e){if(RC(I,Rg))throw new Ti(Os);return e.facade=I,av(I,Rg,e),e},Yt=function(I){return RC(I,Rg)?I[Rg]:{}},cI=function(I){return RC(I,Rg)});var Fe,Rg,Kg={set:hI,get:Yt,has:cI,enforce:cv,getterFor:uv},fv=aA,pv=Z,mv=jI,vv=xe,bv=Se,yv=UI,Ps=pv([].push),lg=function(I){var e=I===1,g=I===2,t=I===3,A=I===4,C=I===6,i=I===7,n=I===5||C;return function(o,s,r,a){for(var d=vv(o),l=mv(d),h=fv(s,r),c=bv(l),p=0,u=a||yv,m=e?u(o,c):g||i?u(o,0):void 0,E,w;c>p;p++)if((n||p in l)&&(E=l[p],w=h(E,p,d),I))if(e)m[p]=w;else if(w)switch(I){case 3:return!0;case 5:return E;case 6:return p;case 2:Ps(m,E)}else switch(I){case 4:return!1;case 7:Ps(m,E)}return C?-1:t||A?A:m}},Ng={forEach:lg(0),map:lg(1),filter:lg(2),some:lg(3),every:lg(4),find:lg(5),findIndex:lg(6),filterReject:lg(7)},JI=N,$I=X,Io=je,wv=Z,at=ie,dt=pt,Ev=z,se=ne,Tv=J,xi=rg,qI=We,Co=YI,xv=qe,Oi=IA,_t=pA,ud=hA,Ov=mA,fd=XI,Pv=cA,pd=tA,md=Oe,Dv=HI,vd=AA,Ds=vA,Nv=Ao,io=mt,Rv=QI,bd=lA,Ns=WI,Sv=ee,kv=bA,Mv=$,Fv=ld,Bv=bt,yd=Kg,eC=Ng.forEach,Ee=Rv("hidden"),gC="Symbol",Kt="prototype",zv=yd.set,Rs=yd.getterFor(gC),Ge=Object[Kt],Fg=$I.Symbol,Ft=Fg&&Fg[Kt],Zv=$I.RangeError,Lv=$I.TypeError,kC=$I.QObject,wd=pd.f,Bg=md.f,Ed=fd.f,Gv=vd.f,Td=wv([].push),ig=io("symbols"),yA=io("op-symbols"),Vv=io("wks"),Pi=!kC||!kC[Kt]||!kC[Kt].findChild,xd=function(I,e,g){var t=wd(Ge,e);t&&delete Ge[e],Bg(I,e,g),t&&I!==Ge&&Bg(Ge,e,t)},Di=at&&Ev(function(){return _t(Bg({},"a",{get:function(){return Bg(this,"a",{value:7}).a}})).a!==7})?xd:Bg,MC=function(I,e){var g=ig[I]=_t(Ft);return zv(g,{type:gC,tag:I,description:e}),at||(g.description=e),g},tC=function(e,g,t){e===Ge&&tC(yA,g,t),xi(e);var A=Co(g);return xi(t),se(ig,A)?(t.enumerable?(se(e,Ee)&&e[Ee][A]&&(e[Ee][A]=!1),t=_t(t,{enumerable:Oi(0,!1)})):(se(e,Ee)||Bg(e,Ee,Oi(1,{})),e[Ee][A]=!0),Di(e,A,t)):Bg(e,A,t)},no=function(e,g){xi(e);var t=qI(g),A=ud(t).concat(Nd(t));return eC(A,function(C){(!at||Io(Od,t,C))&&tC(e,C,t[C])}),e},jv=function(e,g){return g===void 0?_t(e):no(_t(e),g)},Od=function(e){var g=Co(e),t=Io(Gv,this,g);return this===Ge&&se(ig,g)&&!se(yA,g)?!1:t||!se(this,g)||!se(ig,g)||se(this,Ee)&&this[Ee][g]?t:!0},Pd=function(e,g){var t=qI(e),A=Co(g);if(!(t===Ge&&se(ig,A)&&!se(yA,A))){var C=wd(t,A);return C&&se(ig,A)&&!(se(t,Ee)&&t[Ee][A])&&(C.enumerable=!0),C}},Dd=function(e){var g=Ed(qI(e)),t=[];return eC(g,function(A){!se(ig,A)&&!se(bd,A)&&Td(t,A)}),t},Nd=function(I){var e=I===Ge,g=Ed(e?yA:qI(I)),t=[];return eC(g,function(A){se(ig,A)&&(!e||se(Ge,A))&&Td(t,ig[A])}),t};dt||(Fg=function(){if(Tv(Ft,this))throw new Lv("Symbol is not a constructor");var e=!arguments.length||arguments[0]===void 0?void 0:xv(arguments[0]),g=Ns(e),t=function(A){this===Ge&&Io(t,yA,A),se(this,Ee)&&se(this[Ee],g)&&(this[Ee][g]=!1);var C=Oi(1,A);try{Di(this,g,C)}catch(i){if(!(i instanceof Zv))throw i;xd(this,g,C)}};return at&&Pi&&Di(Ge,g,{configurable:!0,set:t}),MC(g,e)},Ft=Fg[Kt],Ds(Ft,"toString",function(){return Rs(this).tag}),Ds(Fg,"withoutSetter",function(I){return MC(Ns(I),I)}),vd.f=Od,md.f=tC,Dv.f=no,pd.f=Pd,Ov.f=fd.f=Dd,Pv.f=Nd,kv.f=function(I){return MC(Sv(I),I)},at&&Nv(Ft,"description",{configurable:!0,get:function(){return Rs(this).description}}));JI({global:!0,constructor:!0,wrap:!0,forced:!dt,sham:!dt},{Symbol:Fg});eC(ud(Vv),function(I){Mv(I)});JI({target:gC,stat:!0,forced:!dt},{useSetter:function(){Pi=!0},useSimple:function(){Pi=!1}});JI({target:"Object",stat:!0,forced:!dt,sham:!at},{create:jv,defineProperty:tC,defineProperties:no,getOwnPropertyDescriptor:Pd});JI({target:"Object",stat:!0,forced:!dt},{getOwnPropertyNames:Dd});Fv();Bv(Fg,gC);bd[Ee]=!0;var Wv=pt,Rd=Wv&&!!Symbol.for&&!!Symbol.keyFor,Yv=N,_v=Ye,Kv=ne,Uv=qe,Sd=mt,Hv=Rd,FC=Sd("string-to-symbol-registry"),Qv=Sd("symbol-to-string-registry");Yv({target:"Symbol",stat:!0,forced:!Hv},{for:function(I){var e=Uv(I);if(Kv(FC,e))return FC[e];var g=_v("Symbol")(e);return FC[e]=g,Qv[g]=e,g}});var Xv=N,Jv=ne,$v=oA,qv=sA,eb=mt,gb=Rd,Ss=eb("symbol-to-string-registry");Xv({target:"Symbol",stat:!0,forced:!gb},{keyFor:function(e){if(!$v(e))throw new TypeError(qv(e)+" is not a symbol");if(Jv(Ss,e))return Ss[e]}});var tb=Z,ks=Dg,Ab=le,Ms=sg,Ib=qe,Fs=tb([].push),Cb=function(I){if(Ab(I))return I;if(ks(I)){for(var e=I.length,g=[],t=0;t<e;t++){var A=I[t];typeof A=="string"?Fs(g,A):(typeof A=="number"||Ms(A)==="Number"||Ms(A)==="String")&&Fs(g,Ib(A))}var C=g.length,i=!0;return function(n,o){if(i)return i=!1,o;if(ks(this))return o;for(var s=0;s<C;s++)if(g[s]===n)return o}}},ib=N,kd=Ye,Md=VI,nb=je,wA=Z,Fd=z,Bs=le,zs=oA,Bd=KI,ob=Cb,sb=pt,rb=String,bg=kd("JSON","stringify"),GA=wA(/./.exec),Zs=wA("".charAt),ab=wA("".charCodeAt),db=wA("".replace),lb=wA(1 .toString),hb=/[\uD800-\uDFFF]/g,Ls=/^[\uD800-\uDBFF]$/,Gs=/^[\uDC00-\uDFFF]$/,Vs=!sb||Fd(function(){var I=kd("Symbol")("stringify detection");return bg([I])!=="[null]"||bg({a:I})!=="{}"||bg(Object(I))!=="{}"}),js=Fd(function(){return bg("\uDF06\uD834")!=='"\\udf06\\ud834"'||bg("\uDEAD")!=='"\\udead"'}),cb=function(I,e){var g=Bd(arguments),t=ob(e);if(!(!Bs(t)&&(I===void 0||zs(I))))return g[1]=function(A,C){if(Bs(t)&&(C=nb(t,this,rb(A),C)),!zs(C))return C},Md(bg,null,g)},ub=function(I,e,g){var t=Zs(g,e-1),A=Zs(g,e+1);return GA(Ls,I)&&!GA(Gs,A)||GA(Gs,I)&&!GA(Ls,t)?"\\u"+lb(ab(I,0),16):I};bg&&ib({target:"JSON",stat:!0,arity:3,forced:Vs||js},{stringify:function(e,g,t){var A=Bd(arguments),C=Md(Vs?cb:bg,null,A);return js&&typeof C=="string"?db(C,hb,ub):C}});var fb=N,pb=pt,mb=z,zd=cA,vb=xe,bb=!pb||mb(function(){zd.f(1)});fb({target:"Object",stat:!0,forced:bb},{getOwnPropertySymbols:function(e){var g=zd.f;return g?g(vb(e)):[]}});var yb=$;yb("asyncIterator");var wb=$;wb("hasInstance");var Eb=$;Eb("isConcatSpreadable");var Tb=$;Tb("iterator");var xb=$;xb("match");var Ob=$;Ob("matchAll");var Pb=$;Pb("replace");var Db=$;Db("search");var Nb=$;Nb("species");var Rb=$;Rb("split");var Sb=$,kb=ld;Sb("toPrimitive");kb();var Mb=Ye,Fb=$,Bb=bt;Fb("toStringTag");Bb(Mb("Symbol"),"Symbol");var zb=$;zb("unscopables");var Zb=X,Lb=bt;Lb(Zb.JSON,"JSON",!0);var Gb=L,Vb=Gb.Symbol,yt={},Ni=ie,jb=ne,Zd=Function.prototype,Wb=Ni&&Object.getOwnPropertyDescriptor,oo=jb(Zd,"name"),Yb=oo&&function(){}.name==="something",_b=oo&&(!Ni||Ni&&Wb(Zd,"name").configurable),Kb={EXISTS:oo,PROPER:Yb,CONFIGURABLE:_b},Ub=z,Ld=!Ub(function(){function I(){}return I.prototype.constructor=null,Object.getPrototypeOf(new I)!==I.prototype}),Hb=ne,Qb=le,Xb=xe,Jb=QI,$b=Ld,Ws=Jb("IE_PROTO"),Ri=Object,qb=Ri.prototype,AC=$b?Ri.getPrototypeOf:function(I){var e=Xb(I);if(Hb(e,Ws))return e[Ws];var g=e.constructor;return Qb(g)&&e instanceof g?g.prototype:e instanceof Ri?qb:null},ey=z,gy=le,ty=ce,Ay=pA,Ys=AC,Iy=vA,Cy=ee,Si=Cy("iterator"),Gd=!1,gg,BC,zC;[].keys&&(zC=[].keys(),"next"in zC?(BC=Ys(Ys(zC)),BC!==Object.prototype&&(gg=BC)):Gd=!0);var iy=!ty(gg)||ey(function(){var I={};return gg[Si].call(I)!==I});iy?gg={}:gg=Ay(gg);gy(gg[Si])||Iy(gg,Si,function(){return this});var Vd={IteratorPrototype:gg,BUGGY_SAFARI_ITERATORS:Gd},ny=Vd.IteratorPrototype,oy=pA,sy=IA,ry=bt,ay=yt,dy=function(){return this},ly=function(I,e,g,t){var A=e+" Iterator";return I.prototype=oy(ny,{next:sy(+!t,g)}),ry(I,A,!1,!0),ay[A]=dy,I},hy=N,cy=je,jd=Kb,uy=ly,fy=AC,py=bt,_s=vA,my=ee,Ks=yt,Wd=Vd,vy=jd.PROPER;jd.CONFIGURABLE;Wd.IteratorPrototype;var VA=Wd.BUGGY_SAFARI_ITERATORS,ZC=my("iterator"),Us="keys",jA="values",Hs="entries",by=function(){return this},so=function(I,e,g,t,A,C,i){uy(g,e,t);var n=function(u){if(u===A&&d)return d;if(!VA&&u&&u in r)return r[u];switch(u){case Us:return function(){return new g(this,u)};case jA:return function(){return new g(this,u)};case Hs:return function(){return new g(this,u)}}return function(){return new g(this)}},o=e+" Iterator",s=!1,r=I.prototype,a=r[ZC]||r["@@iterator"]||A&&r[A],d=!VA&&a||n(A),l=e==="Array"&&r.entries||a,h,c,p;if(l&&(h=fy(l.call(new I)),h!==Object.prototype&&h.next&&(py(h,o,!0,!0),Ks[o]=by)),vy&&A===jA&&a&&a.name!==jA&&(s=!0,d=function(){return cy(a,this)}),A)if(c={values:n(jA),keys:C?d:n(Us),entries:n(Hs)},i)for(p in c)(VA||s||!(p in r))&&_s(r,p,c[p]);else hy({target:e,proto:!0,forced:VA||s},c);return i&&r[ZC]!==d&&_s(r,ZC,d,{name:A}),Ks[e]=d,c},ro=function(I,e){return{value:I,done:e}},yy=We,Qs=yt,Yd=Kg;Oe.f;var wy=so,WA=ro,_d="Array Iterator",Ey=Yd.set,Ty=Yd.getterFor(_d);wy(Array,"Array",function(I,e){Ey(this,{type:_d,target:yy(I),index:0,kind:e})},function(){var I=Ty(this),e=I.target,g=I.kind,t=I.index++;if(!e||t>=e.length)return I.target=void 0,WA(void 0,!0);switch(g){case"keys":return WA(t,!1);case"values":return WA(e[t],!1)}return WA([t,e[t]],!1)},"values");Qs.Arguments=Qs.Array;var xy={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},Oy=xy,Py=X,Dy=ag,Ny=vt,Xs=yt,Ry=ee,Js=Ry("toStringTag");for(YA in Oy)LC=Py[YA],_A=LC&&LC.prototype,_A&&Dy(_A)!==Js&&Ny(_A,Js,YA),Xs[YA]=Xs.Array;var LC,_A,YA,Sy=Vb,Kd=Sy,ky=Kd,My=D(ky),Fy=N,$s=Dg,By=id,zy=ce,qs=dA,Zy=Se,Ly=We,Gy=uA,Vy=ee,jy=fA,Wy=KI,Yy=jy("slice"),_y=Vy("species"),GC=Array,Ky=Math.max;Fy({target:"Array",proto:!0,forced:!Yy},{slice:function(e,g){var t=Ly(this),A=Zy(t),C=qs(e,A),i=qs(g===void 0?A:g,A),n,o,s;if($s(t)&&(n=t.constructor,By(n)&&(n===GC||$s(n.prototype))?n=void 0:zy(n)&&(n=n[_y],n===null&&(n=void 0)),n===GC||n===void 0))return Wy(t,C,i);for(o=new(n===void 0?GC:n)(Ky(i-C,0)),s=0;C<i;C++,s++)C in t&&Gy(o,s,t[C]);return o.length=s,o}});var Uy=Ie,Hy=Uy("Array").slice,Qy=J,Xy=Hy,VC=Array.prototype,Jy=function(I){var e=I.slice;return I===VC||Qy(VC,I)&&e===VC.slice?Xy:e},$y=Jy,qy=$y,e0=qy,Ze=D(e0),g0=Ye,t0=Z,A0=mA,I0=cA,C0=rg,i0=t0([].concat),Ud=g0("Reflect","ownKeys")||function(e){var g=A0.f(C0(e)),t=I0.f;return t?i0(g,t(e)):g},n0=N,o0=Ud;n0({target:"Reflect",stat:!0},{ownKeys:o0});var s0=L,r0=s0.Reflect.ownKeys,a0=r0,d0=a0,l0=d0,h0=D(l0),c0=N,u0=Dg;c0({target:"Array",stat:!0},{isArray:u0});var f0=L,p0=f0.Array.isArray,m0=p0,v0=m0,b0=v0,B=D(b0),y0=N,w0=Ng.map,E0=fA,T0=E0("map");y0({target:"Array",proto:!0,forced:!T0},{map:function(e){return w0(this,e,arguments.length>1?arguments[1]:void 0)}});var x0=Ie,O0=x0("Array").map,P0=J,D0=O0,jC=Array.prototype,N0=function(I){var e=I.map;return I===jC||P0(jC,I)&&e===jC.map?D0:e},R0=N0,S0=R0,k0=S0,ae=D(k0),M0=N,F0=xe,Hd=hA,B0=z,z0=B0(function(){Hd(1)});M0({target:"Object",stat:!0,forced:z0},{keys:function(e){return Hd(F0(e))}});var Z0=L,L0=Z0.Object.keys,G0=L0,V0=G0,j0=V0,U=D(j0),W0=N,Y0=Z,Qd=Date,_0=Y0(Qd.prototype.getTime);W0({target:"Date",stat:!0},{now:function(){return _0(new Qd)}});var K0=L,U0=K0.Date.now,H0=U0,Q0=H0,X0=Q0,uI=D(X0),J0=z,wt=function(I,e){var g=[][I];return!!g&&J0(function(){g.call(null,e||function(){return 1},1)})},$0=Ng.forEach,q0=wt,ew=q0("forEach"),gw=ew?[].forEach:function(e){return $0(this,e,arguments.length>1?arguments[1]:void 0)},tw=N,er=gw;tw({target:"Array",proto:!0,forced:[].forEach!==er},{forEach:er});var Aw=Ie,Iw=Aw("Array").forEach,Cw=Iw,iw=Cw,nw=ag,ow=ne,sw=J,rw=iw,WC=Array.prototype,aw={DOMTokenList:!0,NodeList:!0},dw=function(I){var e=I.forEach;return I===WC||sw(WC,I)&&e===WC.forEach||ow(aw,nw(I))?rw:e},lw=dw,F=D(lw),hw=N,cw=Z,uw=Dg,fw=cw([].reverse),gr=[1,2];hw({target:"Array",proto:!0,forced:String(gr)===String(gr.reverse())},{reverse:function(){return uw(this)&&(this.length=this.length),fw(this)}});var pw=Ie,mw=pw("Array").reverse,vw=J,bw=mw,YC=Array.prototype,yw=function(I){var e=I.reverse;return I===YC||vw(YC,I)&&e===YC.reverse?bw:e},ww=yw,Ew=ww,Tw=Ew,zg=D(Tw),xw=ie,Ow=Dg,Pw=TypeError,Dw=Object.getOwnPropertyDescriptor,Nw=xw&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(I){return I instanceof TypeError}}(),Rw=Nw?function(I,e){if(Ow(I)&&!Dw(I,"length").writable)throw new Pw("Cannot set read only .length");return I.length=e}:function(I,e){return I.length=e},tr=sA,Sw=TypeError,Xd=function(I,e){if(!delete I[e])throw new Sw("Cannot delete property "+tr(e)+" of "+tr(I))},kw=N,Mw=xe,Fw=dA,Bw=_I,zw=Se,Zw=Rw,Lw=eo,Gw=UI,Vw=uA,_C=Xd,jw=fA,Ww=jw("splice"),Yw=Math.max,_w=Math.min;kw({target:"Array",proto:!0,forced:!Ww},{splice:function(e,g){var t=Mw(this),A=zw(t),C=Fw(e,A),i=arguments.length,n,o,s,r,a,d;for(i===0?n=o=0:i===1?(n=0,o=A-C):(n=i-2,o=_w(Yw(Bw(g),0),A-C)),Lw(A+n-o),s=Gw(t,o),r=0;r<o;r++)a=C+r,a in t&&Vw(s,r,t[a]);if(s.length=o,n<o){for(r=C;r<A-o;r++)a=r+o,d=r+n,a in t?t[d]=t[a]:_C(t,d);for(r=A;r>A-o+n;r--)_C(t,r-1)}else if(n>o)for(r=A-o;r>C;r--)a=r+o-1,d=r+n-1,a in t?t[d]=t[a]:_C(t,d);for(r=0;r<n;r++)t[r+C]=arguments[r+2];return Zw(t,A-o+n),s}});var Kw=Ie,Uw=Kw("Array").splice,Hw=J,Qw=Uw,KC=Array.prototype,Xw=function(I){var e=I.splice;return I===KC||Hw(KC,I)&&e===KC.splice?Qw:e},Jw=Xw,$w=Jw,qw=$w,Ue=D(qw),eE=N,gE=Jn.includes,tE=z,AE=tE(function(){return!Array(1).includes()});eE({target:"Array",proto:!0,forced:AE},{includes:function(e){return gE(this,e,arguments.length>1?arguments[1]:void 0)}});var IE=Ie,CE=IE("Array").includes,iE=ce,nE=sg,oE=ee,sE=oE("match"),rE=function(I){var e;return iE(I)&&((e=I[sE])!==void 0?!!e:nE(I)==="RegExp")},aE=rE,dE=TypeError,lE=function(I){if(aE(I))throw new dE("The method doesn't accept regular expressions");return I},hE=ee,cE=hE("match"),uE=function(I){var e=/./;try{"/./"[I](e)}catch(g){try{return e[cE]=!1,"/./"[I](e)}catch(t){}}return!1},fE=N,pE=Z,mE=lE,vE=CA,Ar=qe,bE=uE,yE=pE("".indexOf);fE({target:"String",proto:!0,forced:!bE("includes")},{includes:function(e){return!!~yE(Ar(vE(this)),Ar(mE(e)),arguments.length>1?arguments[1]:void 0)}});var wE=Ie,EE=wE("String").includes,Ir=J,TE=CE,xE=EE,UC=Array.prototype,HC=String.prototype,OE=function(I){var e=I.includes;return I===UC||Ir(UC,I)&&e===UC.includes?TE:typeof I=="string"||I===HC||Ir(HC,I)&&e===HC.includes?xE:e},PE=OE,DE=PE,NE=DE,yg=D(NE),RE=N,SE=z,kE=xe,Jd=AC,ME=Ld,FE=SE(function(){Jd(1)});RE({target:"Object",stat:!0,forced:FE,sham:!ME},{getPrototypeOf:function(e){return Jd(kE(e))}});var BE=L,zE=BE.Object.getPrototypeOf,ZE=zE,LE=ZE,GE=LE,Cr=D(GE),VE=Ie,jE=VE("Array").concat,WE=J,YE=jE,QC=Array.prototype,_E=function(I){var e=I.concat;return I===QC||WE(QC,I)&&e===QC.concat?YE:e},KE=_E,UE=KE,HE=UE,$d=D(HE),QE=N,XE=Ng.filter,JE=fA,$E=JE("filter");QE({target:"Array",proto:!0,forced:!$E},{filter:function(e){return XE(this,e,arguments.length>1?arguments[1]:void 0)}});var qE=Ie,eT=qE("Array").filter,gT=J,tT=eT,XC=Array.prototype,AT=function(I){var e=I.filter;return I===XC||gT(XC,I)&&e===XC.filter?tT:e},IT=AT,CT=IT,iT=CT,te=D(iT),qd=ie,nT=z,el=Z,oT=AC,sT=hA,rT=We,aT=AA.f,gl=el(aT),dT=el([].push),lT=qd&&nT(function(){var I=Object.create(null);return I[2]=2,!gl(I,2)}),ir=function(I){return function(e){for(var g=rT(e),t=sT(g),A=lT&&oT(g)===null,C=t.length,i=0,n=[],o;C>i;)o=t[i++],(!qd||(A?o in g:gl(g,o)))&&dT(n,I?[o,g[o]]:g[o]);return n}},hT={entries:ir(!0),values:ir(!1)},cT=N,uT=hT.values;cT({target:"Object",stat:!0},{values:function(e){return uT(e)}});var fT=L,pT=fT.Object.values,mT=pT,vT=mT,bT=vT,yT=D(bT),ao=`
631
- \v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,wT=Z,ET=CA,TT=qe,ki=ao,nr=wT("".replace),xT=RegExp("^["+ki+"]+"),OT=RegExp("(^|[^"+ki+"])["+ki+"]+$"),JC=function(I){return function(e){var g=TT(ET(e));return I&1&&(g=nr(g,xT,"")),I&2&&(g=nr(g,OT,"$1")),g}},tl={start:JC(1),end:JC(2),trim:JC(3)},Al=X,PT=z,DT=Z,NT=qe,RT=tl.trim,or=ao,Zt=Al.parseInt,sr=Al.Symbol,rr=sr&&sr.iterator,Il=/^[+-]?0x/i,ST=DT(Il.exec),kT=Zt(or+"08")!==8||Zt(or+"0x16")!==22||rr&&!PT(function(){Zt(Object(rr))}),MT=kT?function(e,g){var t=RT(NT(e));return Zt(t,g>>>0||(ST(Il,t)?16:10))}:Zt,FT=N,ar=MT;FT({global:!0,forced:parseInt!==ar},{parseInt:ar});var BT=L,zT=BT.parseInt,ZT=zT,LT=ZT,GT=LT,ze=D(GT),VT=N,jT=Hn,WT=Jn.indexOf,YT=wt,Mi=jT([].indexOf),Cl=!!Mi&&1/Mi([1],1,-0)<0,_T=Cl||!YT("indexOf");VT({target:"Array",proto:!0,forced:_T},{indexOf:function(e){var g=arguments.length>1?arguments[1]:void 0;return Cl?Mi(this,e,g)||0:WT(this,e,g)}});var KT=Ie,UT=KT("Array").indexOf,HT=J,QT=UT,$C=Array.prototype,XT=function(I){var e=I.indexOf;return I===$C||HT($C,I)&&e===$C.indexOf?QT:e},JT=XT,$T=JT,qT=$T,G=D(qT),ex=N,gx=ie,tx=pA;ex({target:"Object",stat:!0,sham:!gx},{create:tx});var Ax=L,Ix=Ax.Object,Cx=function(e,g){return Ix.create(e,g)},ix=Cx,nx=ix,ox=nx,wg=D(ox),Fi=L,sx=VI;Fi.JSON||(Fi.JSON={stringify:JSON.stringify});var rx=function(e,g,t){return sx(Fi.JSON.stringify,null,arguments)},ax=rx,dx=ax,lx=dx,Et=D(lx),hx=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",cx=TypeError,ux=function(I,e){if(I<e)throw new cx("Not enough arguments");return I},il=X,fx=VI,px=le,mx=hx,vx=iA,bx=KI,yx=ux,wx=il.Function,Ex=/MSIE .\./.test(vx)||mx&&function(){var I=il.Bun.version.split(".");return I.length<3||I[0]==="0"&&(I[1]<3||I[1]==="3"&&I[2]==="0")}(),nl=function(I,e){var g=e?2:1;return Ex?function(t,A){var C=yx(arguments.length,1)>g,i=px(t)?t:wx(t),n=C?bx(arguments,g):[],o=C?function(){fx(i,this,n)}:i;return e?I(o,A):I(o)}:I},Tx=N,ol=X,xx=nl,dr=xx(ol.setInterval,!0);Tx({global:!0,bind:!0,forced:ol.setInterval!==dr},{setInterval:dr});var Ox=N,sl=X,Px=nl,lr=Px(sl.setTimeout,!0);Ox({global:!0,bind:!0,forced:sl.setTimeout!==lr},{setTimeout:lr});var Dx=L,Nx=Dx.setTimeout,Rx=Nx,He=D(Rx),Sx=xe,hr=dA,kx=Se,Mx=function(e){for(var g=Sx(this),t=kx(g),A=arguments.length,C=hr(A>1?arguments[1]:void 0,t),i=A>2?arguments[2]:void 0,n=i===void 0?t:hr(i,t);n>C;)g[C++]=e;return g},Fx=N,Bx=Mx;Fx({target:"Array",proto:!0},{fill:Bx});var zx=Ie,Zx=zx("Array").fill,Lx=J,Gx=Zx,qC=Array.prototype,Vx=function(I){var e=I.fill;return I===qC||Lx(qC,I)&&e===qC.fill?Gx:e},jx=Vx,Wx=jx,Yx=Wx,EA=D(Yx);function Ve(){return Ve=Object.assign||function(I){for(var e=1;e<arguments.length;e++){var g=arguments[e];for(var t in g)Object.prototype.hasOwnProperty.call(g,t)&&(I[t]=g[t])}return I},Ve.apply(this,arguments)}function ke(I,e){I.prototype=Object.create(e.prototype),I.prototype.constructor=I,I.__proto__=e}function KA(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}var Bi;typeof Object.assign!="function"?Bi=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var g=Object(e),t=1;t<arguments.length;t++){var A=arguments[t];if(A!=null)for(var C in A)A.hasOwnProperty(C)&&(g[C]=A[C])}return g}:Bi=Object.assign;var Gg=Bi,cr=["","webkit","Moz","MS","ms","o"],_x=typeof document=="undefined"?{style:{}}:document.createElement("div"),Kx="function",Ct=Math.round,Vg=Math.abs,lo=Date.now;function IC(I,e){for(var g,t,A=e[0].toUpperCase()+e.slice(1),C=0;C<cr.length;){if(g=cr[C],t=g?g+A:e,t in I)return t;C++}}var tg;typeof window=="undefined"?tg={}:tg=window;var rl=IC(_x.style,"touchAction"),al=rl!==void 0;function Ux(){if(!al)return!1;var I={},e=tg.CSS&&tg.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(g){return I[g]=e?tg.CSS.supports("touch-action",g):!0}),I}var dl="compute",ll="auto",zi="manipulation",Zg="none",Ut="pan-x",Ht="pan-y",UA=Ux(),Hx=/mobile|tablet|ip(ad|hone|od)|android/i,hl="ontouchstart"in tg,Qx=IC(tg,"PointerEvent")!==void 0,Xx=hl&&Hx.test(navigator.userAgent),TA="touch",Jx="pen",ho="mouse",$x="kinect",qx=25,be=1,Ug=2,Ae=4,Te=8,fI=1,xA=2,OA=4,PA=8,lt=16,Qe=xA|OA,Lg=PA|lt,cl=Qe|Lg,ul=["x","y"],pI=["clientX","clientY"];function Ag(I,e,g){var t;if(I)if(I.forEach)I.forEach(e,g);else if(I.length!==void 0)for(t=0;t<I.length;)e.call(g,I[t],t,I),t++;else for(t in I)I.hasOwnProperty(t)&&e.call(g,I[t],t,I)}function CC(I,e){return typeof I===Kx?I.apply(e&&e[0]||void 0,e):I}function kg(I,e){return I.indexOf(e)>-1}function eO(I){if(kg(I,Zg))return Zg;var e=kg(I,Ut),g=kg(I,Ht);return e&&g?Zg:e||g?e?Ut:Ht:kg(I,zi)?zi:ll}var fl=function(){function I(g,t){this.manager=g,this.set(t)}var e=I.prototype;return e.set=function(t){t===dl&&(t=this.compute()),al&&this.manager.element.style&&UA[t]&&(this.manager.element.style[rl]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return Ag(this.manager.recognizers,function(A){CC(A.options.enable,[A])&&(t=t.concat(A.getTouchAction()))}),eO(t.join(" "))},e.preventDefaults=function(t){var A=t.srcEvent,C=t.offsetDirection;if(this.manager.session.prevented){A.preventDefault();return}var i=this.actions,n=kg(i,Zg)&&!UA[Zg],o=kg(i,Ht)&&!UA[Ht],s=kg(i,Ut)&&!UA[Ut];if(n){var r=t.pointers.length===1,a=t.distance<2,d=t.deltaTime<250;if(r&&a&&d)return}if(!(s&&o)&&(n||o&&C&Qe||s&&C&Lg))return this.preventSrc(A)},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},I}();function co(I,e){for(;I;){if(I===e)return!0;I=I.parentNode}return!1}function pl(I){var e=I.length;if(e===1)return{x:Ct(I[0].clientX),y:Ct(I[0].clientY)};for(var g=0,t=0,A=0;A<e;)g+=I[A].clientX,t+=I[A].clientY,A++;return{x:Ct(g/e),y:Ct(t/e)}}function ur(I){for(var e=[],g=0;g<I.pointers.length;)e[g]={clientX:Ct(I.pointers[g].clientX),clientY:Ct(I.pointers[g].clientY)},g++;return{timeStamp:lo(),pointers:e,center:pl(e),deltaX:I.deltaX,deltaY:I.deltaY}}function mI(I,e,g){g||(g=ul);var t=e[g[0]]-I[g[0]],A=e[g[1]]-I[g[1]];return Math.sqrt(t*t+A*A)}function Zi(I,e,g){g||(g=ul);var t=e[g[0]]-I[g[0]],A=e[g[1]]-I[g[1]];return Math.atan2(A,t)*180/Math.PI}function ml(I,e){return I===e?fI:Vg(I)>=Vg(e)?I<0?xA:OA:e<0?PA:lt}function gO(I,e){var g=e.center,t=I.offsetDelta||{},A=I.prevDelta||{},C=I.prevInput||{};(e.eventType===be||C.eventType===Ae)&&(A=I.prevDelta={x:C.deltaX||0,y:C.deltaY||0},t=I.offsetDelta={x:g.x,y:g.y}),e.deltaX=A.x+(g.x-t.x),e.deltaY=A.y+(g.y-t.y)}function vl(I,e,g){return{x:e/I||0,y:g/I||0}}function tO(I,e){return mI(e[0],e[1],pI)/mI(I[0],I[1],pI)}function AO(I,e){return Zi(e[1],e[0],pI)+Zi(I[1],I[0],pI)}function IO(I,e){var g=I.lastInterval||e,t=e.timeStamp-g.timeStamp,A,C,i,n;if(e.eventType!==Te&&(t>qx||g.velocity===void 0)){var o=e.deltaX-g.deltaX,s=e.deltaY-g.deltaY,r=vl(t,o,s);C=r.x,i=r.y,A=Vg(r.x)>Vg(r.y)?r.x:r.y,n=ml(o,s),I.lastInterval=e}else A=g.velocity,C=g.velocityX,i=g.velocityY,n=g.direction;e.velocity=A,e.velocityX=C,e.velocityY=i,e.direction=n}function CO(I,e){var g=I.session,t=e.pointers,A=t.length;g.firstInput||(g.firstInput=ur(e)),A>1&&!g.firstMultiple?g.firstMultiple=ur(e):A===1&&(g.firstMultiple=!1);var C=g.firstInput,i=g.firstMultiple,n=i?i.center:C.center,o=e.center=pl(t);e.timeStamp=lo(),e.deltaTime=e.timeStamp-C.timeStamp,e.angle=Zi(n,o),e.distance=mI(n,o),gO(g,e),e.offsetDirection=ml(e.deltaX,e.deltaY);var s=vl(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=s.x,e.overallVelocityY=s.y,e.overallVelocity=Vg(s.x)>Vg(s.y)?s.x:s.y,e.scale=i?tO(i.pointers,t):1,e.rotation=i?AO(i.pointers,t):0,e.maxPointers=g.prevInput?e.pointers.length>g.prevInput.maxPointers?e.pointers.length:g.prevInput.maxPointers:e.pointers.length,IO(g,e);var r=I.element,a=e.srcEvent,d;a.composedPath?d=a.composedPath()[0]:a.path?d=a.path[0]:d=a.target,co(d,r)&&(r=d),e.target=r}function iO(I,e,g){var t=g.pointers.length,A=g.changedPointers.length,C=e&be&&t-A===0,i=e&(Ae|Te)&&t-A===0;g.isFirst=!!C,g.isFinal=!!i,C&&(I.session={}),g.eventType=e,CO(I,g),I.emit("hammer.input",g),I.recognize(g),I.session.prevInput=g}function Qt(I){return I.trim().split(/\s+/g)}function Lt(I,e,g){Ag(Qt(e),function(t){I.addEventListener(t,g,!1)})}function Gt(I,e,g){Ag(Qt(e),function(t){I.removeEventListener(t,g,!1)})}function fr(I){var e=I.ownerDocument||I;return e.defaultView||e.parentWindow||window}var Tt=function(){function I(g,t){var A=this;this.manager=g,this.callback=t,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(C){CC(g.options.enable,[g])&&A.handler(C)},this.init()}var e=I.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Lt(this.element,this.evEl,this.domHandler),this.evTarget&&Lt(this.target,this.evTarget,this.domHandler),this.evWin&&Lt(fr(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&Gt(this.element,this.evEl,this.domHandler),this.evTarget&&Gt(this.target,this.evTarget,this.domHandler),this.evWin&&Gt(fr(this.element),this.evWin,this.domHandler)},I}();function jg(I,e,g){if(I.indexOf&&!g)return I.indexOf(e);for(var t=0;t<I.length;){if(g&&I[t][g]==e||!g&&I[t]===e)return t;t++}return-1}var nO={pointerdown:be,pointermove:Ug,pointerup:Ae,pointercancel:Te,pointerout:Te},oO={2:TA,3:Jx,4:ho,5:$x},bl="pointerdown",yl="pointermove pointerup pointercancel";tg.MSPointerEvent&&!tg.PointerEvent&&(bl="MSPointerDown",yl="MSPointerMove MSPointerUp MSPointerCancel");var wl=function(I){ke(e,I);function e(){var t,A=e.prototype;return A.evEl=bl,A.evWin=yl,t=I.apply(this,arguments)||this,t.store=t.manager.session.pointerEvents=[],t}var g=e.prototype;return g.handler=function(A){var C=this.store,i=!1,n=A.type.toLowerCase().replace("ms",""),o=nO[n],s=oO[A.pointerType]||A.pointerType,r=s===TA,a=jg(C,A.pointerId,"pointerId");o&be&&(A.button===0||r)?a<0&&(C.push(A),a=C.length-1):o&(Ae|Te)&&(i=!0),!(a<0)&&(C[a]=A,this.callback(this.manager,o,{pointers:C,changedPointers:[A],pointerType:s,srcEvent:A}),i&&C.splice(a,1))},e}(Tt);function Xt(I){return Array.prototype.slice.call(I,0)}function uo(I,e,g){for(var t=[],A=[],C=0;C<I.length;){var i=e?I[C][e]:I[C];jg(A,i)<0&&t.push(I[C]),A[C]=i,C++}return g&&(e?t=t.sort(function(n,o){return n[e]>o[e]}):t=t.sort()),t}var sO={touchstart:be,touchmove:Ug,touchend:Ae,touchcancel:Te},rO="touchstart touchmove touchend touchcancel",fo=function(I){ke(e,I);function e(){var t;return e.prototype.evTarget=rO,t=I.apply(this,arguments)||this,t.targetIds={},t}var g=e.prototype;return g.handler=function(A){var C=sO[A.type],i=aO.call(this,A,C);i&&this.callback(this.manager,C,{pointers:i[0],changedPointers:i[1],pointerType:TA,srcEvent:A})},e}(Tt);function aO(I,e){var g=Xt(I.touches),t=this.targetIds;if(e&(be|Ug)&&g.length===1)return t[g[0].identifier]=!0,[g,g];var A,C,i=Xt(I.changedTouches),n=[],o=this.target;if(C=g.filter(function(s){return co(s.target,o)}),e===be)for(A=0;A<C.length;)t[C[A].identifier]=!0,A++;for(A=0;A<i.length;)t[i[A].identifier]&&n.push(i[A]),e&(Ae|Te)&&delete t[i[A].identifier],A++;if(n.length)return[uo(C.concat(n),"identifier",!0),n]}var dO={mousedown:be,mousemove:Ug,mouseup:Ae},lO="mousedown",hO="mousemove mouseup",po=function(I){ke(e,I);function e(){var t,A=e.prototype;return A.evEl=lO,A.evWin=hO,t=I.apply(this,arguments)||this,t.pressed=!1,t}var g=e.prototype;return g.handler=function(A){var C=dO[A.type];C&be&&A.button===0&&(this.pressed=!0),C&Ug&&A.which!==1&&(C=Ae),this.pressed&&(C&Ae&&(this.pressed=!1),this.callback(this.manager,C,{pointers:[A],changedPointers:[A],pointerType:ho,srcEvent:A}))},e}(Tt),cO=2500,pr=25;function mr(I){var e=I.changedPointers,g=e[0];if(g.identifier===this.primaryTouch){var t={x:g.clientX,y:g.clientY},A=this.lastTouches;this.lastTouches.push(t);var C=function(){var n=A.indexOf(t);n>-1&&A.splice(n,1)};setTimeout(C,cO)}}function uO(I,e){I&be?(this.primaryTouch=e.changedPointers[0].identifier,mr.call(this,e)):I&(Ae|Te)&&mr.call(this,e)}function fO(I){for(var e=I.srcEvent.clientX,g=I.srcEvent.clientY,t=0;t<this.lastTouches.length;t++){var A=this.lastTouches[t],C=Math.abs(e-A.x),i=Math.abs(g-A.y);if(C<=pr&&i<=pr)return!0}return!1}var El=function(){var I=function(e){ke(g,e);function g(A,C){var i;return i=e.call(this,A,C)||this,i.handler=function(n,o,s){var r=s.pointerType===TA,a=s.pointerType===ho;if(!(a&&s.sourceCapabilities&&s.sourceCapabilities.firesTouchEvents)){if(r)uO.call(KA(KA(i)),o,s);else if(a&&fO.call(KA(KA(i)),s))return;i.callback(n,o,s)}},i.touch=new fo(i.manager,i.handler),i.mouse=new po(i.manager,i.handler),i.primaryTouch=null,i.lastTouches=[],i}var t=g.prototype;return t.destroy=function(){this.touch.destroy(),this.mouse.destroy()},g}(Tt);return I}();function pO(I){var e,g=I.options.inputClass;return g?e=g:Qx?e=wl:Xx?e=fo:hl?e=El:e=po,new e(I,iO)}function it(I,e,g){return Array.isArray(I)?(Ag(I,g[e],g),!0):!1}var iI=1,Re=2,ht=4,Eg=8,Ig=Eg,Jt=16,_e=32,mO=1;function vO(){return mO++}function HA(I,e){var g=e.manager;return g?g.get(I):I}function vr(I){return I&Jt?"cancel":I&Eg?"end":I&ht?"move":I&Re?"start":""}var DA=function(){function I(g){g===void 0&&(g={}),this.options=Ve({enable:!0},g),this.id=vO(),this.manager=null,this.state=iI,this.simultaneous={},this.requireFail=[]}var e=I.prototype;return e.set=function(t){return Gg(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(it(t,"recognizeWith",this))return this;var A=this.simultaneous;return t=HA(t,this),A[t.id]||(A[t.id]=t,t.recognizeWith(this)),this},e.dropRecognizeWith=function(t){return it(t,"dropRecognizeWith",this)?this:(t=HA(t,this),delete this.simultaneous[t.id],this)},e.requireFailure=function(t){if(it(t,"requireFailure",this))return this;var A=this.requireFail;return t=HA(t,this),jg(A,t)===-1&&(A.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(it(t,"dropRequireFailure",this))return this;t=HA(t,this);var A=jg(this.requireFail,t);return A>-1&&this.requireFail.splice(A,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(t){var A=this,C=this.state;function i(n){A.manager.emit(n,t)}C<Eg&&i(A.options.event+vr(C)),i(A.options.event),t.additionalEvent&&i(t.additionalEvent),C>=Eg&&i(A.options.event+vr(C))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=_e},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(_e|iI)))return!1;t++}return!0},e.recognize=function(t){var A=Gg({},t);if(!CC(this.options.enable,[this,A])){this.reset(),this.state=_e;return}this.state&(Ig|Jt|_e)&&(this.state=iI),this.state=this.process(A),this.state&(Re|ht|Eg|Jt)&&this.tryEmit(A)},e.process=function(t){},e.getTouchAction=function(){},e.reset=function(){},I}(),Li=function(I){ke(e,I);function e(t){var A;return t===void 0&&(t={}),A=I.call(this,Ve({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,A.pTime=!1,A.pCenter=!1,A._timer=null,A._input=null,A.count=0,A}var g=e.prototype;return g.getTouchAction=function(){return[zi]},g.process=function(A){var C=this,i=this.options,n=A.pointers.length===i.pointers,o=A.distance<i.threshold,s=A.deltaTime<i.time;if(this.reset(),A.eventType&be&&this.count===0)return this.failTimeout();if(o&&s&&n){if(A.eventType!==Ae)return this.failTimeout();var r=this.pTime?A.timeStamp-this.pTime<i.interval:!0,a=!this.pCenter||mI(this.pCenter,A.center)<i.posThreshold;this.pTime=A.timeStamp,this.pCenter=A.center,!a||!r?this.count=1:this.count+=1,this._input=A;var d=this.count%i.taps;if(d===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){C.state=Ig,C.tryEmit()},i.interval),Re):Ig}return _e},g.failTimeout=function(){var A=this;return this._timer=setTimeout(function(){A.state=_e},this.options.interval),_e},g.reset=function(){clearTimeout(this._timer)},g.emit=function(){this.state===Ig&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(DA),ct=function(I){ke(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({pointers:1},t))||this}var g=e.prototype;return g.attrTest=function(A){var C=this.options.pointers;return C===0||A.pointers.length===C},g.process=function(A){var C=this.state,i=A.eventType,n=C&(Re|ht),o=this.attrTest(A);return n&&(i&Te||!o)?C|Jt:n||o?i&Ae?C|Eg:C&Re?C|ht:Re:_e},e}(DA);function Tl(I){return I===lt?"down":I===PA?"up":I===xA?"left":I===OA?"right":""}var mo=function(I){ke(e,I);function e(t){var A;return t===void 0&&(t={}),A=I.call(this,Ve({event:"pan",threshold:10,pointers:1,direction:cl},t))||this,A.pX=null,A.pY=null,A}var g=e.prototype;return g.getTouchAction=function(){var A=this.options.direction,C=[];return A&Qe&&C.push(Ht),A&Lg&&C.push(Ut),C},g.directionTest=function(A){var C=this.options,i=!0,n=A.distance,o=A.direction,s=A.deltaX,r=A.deltaY;return o&C.direction||(C.direction&Qe?(o=s===0?fI:s<0?xA:OA,i=s!==this.pX,n=Math.abs(A.deltaX)):(o=r===0?fI:r<0?PA:lt,i=r!==this.pY,n=Math.abs(A.deltaY))),A.direction=o,i&&n>C.threshold&&o&C.direction},g.attrTest=function(A){return ct.prototype.attrTest.call(this,A)&&(this.state&Re||!(this.state&Re)&&this.directionTest(A))},g.emit=function(A){this.pX=A.deltaX,this.pY=A.deltaY;var C=Tl(A.direction);C&&(A.additionalEvent=this.options.event+C),I.prototype.emit.call(this,A)},e}(ct),xl=function(I){ke(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({event:"swipe",threshold:10,velocity:.3,direction:Qe|Lg,pointers:1},t))||this}var g=e.prototype;return g.getTouchAction=function(){return mo.prototype.getTouchAction.call(this)},g.attrTest=function(A){var C=this.options.direction,i;return C&(Qe|Lg)?i=A.overallVelocity:C&Qe?i=A.overallVelocityX:C&Lg&&(i=A.overallVelocityY),I.prototype.attrTest.call(this,A)&&C&A.offsetDirection&&A.distance>this.options.threshold&&A.maxPointers===this.options.pointers&&Vg(i)>this.options.velocity&&A.eventType&Ae},g.emit=function(A){var C=Tl(A.offsetDirection);C&&this.manager.emit(this.options.event+C,A),this.manager.emit(this.options.event,A)},e}(ct),Ol=function(I){ke(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({event:"pinch",threshold:0,pointers:2},t))||this}var g=e.prototype;return g.getTouchAction=function(){return[Zg]},g.attrTest=function(A){return I.prototype.attrTest.call(this,A)&&(Math.abs(A.scale-1)>this.options.threshold||this.state&Re)},g.emit=function(A){if(A.scale!==1){var C=A.scale<1?"in":"out";A.additionalEvent=this.options.event+C}I.prototype.emit.call(this,A)},e}(ct),Pl=function(I){ke(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({event:"rotate",threshold:0,pointers:2},t))||this}var g=e.prototype;return g.getTouchAction=function(){return[Zg]},g.attrTest=function(A){return I.prototype.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||this.state&Re)},e}(ct),Dl=function(I){ke(e,I);function e(t){var A;return t===void 0&&(t={}),A=I.call(this,Ve({event:"press",pointers:1,time:251,threshold:9},t))||this,A._timer=null,A._input=null,A}var g=e.prototype;return g.getTouchAction=function(){return[ll]},g.process=function(A){var C=this,i=this.options,n=A.pointers.length===i.pointers,o=A.distance<i.threshold,s=A.deltaTime>i.time;if(this._input=A,!o||!n||A.eventType&(Ae|Te)&&!s)this.reset();else if(A.eventType&be)this.reset(),this._timer=setTimeout(function(){C.state=Ig,C.tryEmit()},i.time);else if(A.eventType&Ae)return Ig;return _e},g.reset=function(){clearTimeout(this._timer)},g.emit=function(A){this.state===Ig&&(A&&A.eventType&Ae?this.manager.emit(this.options.event+"up",A):(this._input.timeStamp=lo(),this.manager.emit(this.options.event,this._input)))},e}(DA),Nl={domEvents:!1,touchAction:dl,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},br=[[Pl,{enable:!1}],[Ol,{enable:!1},["rotate"]],[xl,{direction:Qe}],[mo,{direction:Qe},["swipe"]],[Li],[Li,{event:"doubletap",taps:2},["tap"]],[Dl]],bO=1,yr=2;function wr(I,e){var g=I.element;if(g.style){var t;Ag(I.options.cssProps,function(A,C){t=IC(g.style,C),e?(I.oldCssProps[t]=g.style[t],g.style[t]=A):g.style[t]=I.oldCssProps[t]||""}),e||(I.oldCssProps={})}}function yO(I,e){var g=document.createEvent("Event");g.initEvent(I,!0,!0),g.gesture=e,e.target.dispatchEvent(g)}var Er=function(){function I(g,t){var A=this;this.options=Gg({},Nl,t||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=pO(this),this.touchAction=new fl(this,this.options.touchAction),wr(this,!0),Ag(this.options.recognizers,function(C){var i=A.add(new C[0](C[1]));C[2]&&i.recognizeWith(C[2]),C[3]&&i.requireFailure(C[3])},this)}var e=I.prototype;return e.set=function(t){return Gg(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?yr:bO},e.recognize=function(t){var A=this.session;if(!A.stopped){this.touchAction.preventDefaults(t);var C,i=this.recognizers,n=A.curRecognizer;(!n||n&&n.state&Ig)&&(A.curRecognizer=null,n=null);for(var o=0;o<i.length;)C=i[o],A.stopped!==yr&&(!n||C===n||C.canRecognizeWith(n))?C.recognize(t):C.reset(),!n&&C.state&(Re|ht|Eg)&&(A.curRecognizer=C,n=C),o++}},e.get=function(t){if(t instanceof DA)return t;for(var A=this.recognizers,C=0;C<A.length;C++)if(A[C].options.event===t)return A[C];return null},e.add=function(t){if(it(t,"add",this))return this;var A=this.get(t.options.event);return A&&this.remove(A),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},e.remove=function(t){if(it(t,"remove",this))return this;var A=this.get(t);if(t){var C=this.recognizers,i=jg(C,A);i!==-1&&(C.splice(i,1),this.touchAction.update())}return this},e.on=function(t,A){if(t===void 0||A===void 0)return this;var C=this.handlers;return Ag(Qt(t),function(i){C[i]=C[i]||[],C[i].push(A)}),this},e.off=function(t,A){if(t===void 0)return this;var C=this.handlers;return Ag(Qt(t),function(i){A?C[i]&&C[i].splice(jg(C[i],A),1):delete C[i]}),this},e.emit=function(t,A){this.options.domEvents&&yO(t,A);var C=this.handlers[t]&&this.handlers[t].slice();if(!(!C||!C.length)){A.type=t,A.preventDefault=function(){A.srcEvent.preventDefault()};for(var i=0;i<C.length;)C[i](A),i++}},e.destroy=function(){this.element&&wr(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},I}(),wO={touchstart:be,touchmove:Ug,touchend:Ae,touchcancel:Te},EO="touchstart",TO="touchstart touchmove touchend touchcancel",xO=function(I){ke(e,I);function e(){var t,A=e.prototype;return A.evTarget=EO,A.evWin=TO,t=I.apply(this,arguments)||this,t.started=!1,t}var g=e.prototype;return g.handler=function(A){var C=wO[A.type];if(C===be&&(this.started=!0),!!this.started){var i=OO.call(this,A,C);C&(Ae|Te)&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,C,{pointers:i[0],changedPointers:i[1],pointerType:TA,srcEvent:A})}},e}(Tt);function OO(I,e){var g=Xt(I.touches),t=Xt(I.changedTouches);return e&(Ae|Te)&&(g=uo(g.concat(t),"identifier",!0)),[g,t]}function Rl(I,e,g){var t="DEPRECATED METHOD: "+e+`
630
+ `;_g(hp);var qa={exports:{}};(function(I){I.exports=e;function e(t){if(t)return g(t)}function g(t){for(var A in e.prototype)t[A]=e.prototype[A];return t}e.prototype.on=e.prototype.addEventListener=function(t,A){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(A),this},e.prototype.once=function(t,A){function C(){this.off(t,C),A.apply(this,arguments)}return C.fn=A,this.on(t,C),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,A){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var C=this._callbacks["$"+t];if(!C)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var i,n=0;n<C.length;n++)if(i=C[n],i===A||i.fn===A){C.splice(n,1);break}return C.length===0&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var A=new Array(arguments.length-1),C=this._callbacks["$"+t],i=1;i<arguments.length;i++)A[i-1]=arguments[i];if(C){C=C.slice(0);for(var i=0,n=C.length;i<n;++i)C[i].apply(this,A)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}})(qa);var cp=qa.exports,ed=D(cp),up=sg,Dg=Array.isArray||function(e){return up(e)==="Array"},fp=TypeError,pp=9007199254740991,er=function(I){if(I>pp)throw fp("Maximum allowed index exceeded");return I},mp=WI,vp=Oe,bp=IA,uA=function(I,e,g){var t=mp(e);t in I?vp.f(I,t,bp(0,g)):I[t]=g},yp=ee,wp=yp("toStringTag"),gd={};gd[wp]="z";var gr=String(gd)==="[object z]",Ep=gr,Tp=le,II=sg,xp=ee,Op=xp("toStringTag"),Pp=Object,Dp=II((function(){return arguments})())==="Arguments",Np=function(I,e){try{return I[e]}catch(g){}},dg=Ep?II:function(I){var e,g,t;return I===void 0?"Undefined":I===null?"Null":typeof(g=Np(e=Pp(I),Op))=="string"?g:Dp?II(e):(t=II(e))==="Object"&&Tp(e.callee)?"Arguments":t},Rp=Z,Sp=le,yi=Xn,kp=Rp(Function.toString);Sp(yi.inspectSource)||(yi.inspectSource=function(I){return kp(I)});var Mp=yi.inspectSource,Fp=Z,Bp=z,td=le,zp=dg,Zp=We,Lp=Mp,Ad=function(){},Gp=[],Id=Zp("Reflect","construct"),tr=/^\s*(?:class|function)\b/,Vp=Fp(tr.exec),jp=!tr.test(Ad),Dt=function(e){if(!td(e))return!1;try{return Id(Ad,Gp,e),!0}catch(g){return!1}},Cd=function(e){if(!td(e))return!1;switch(zp(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return jp||!!Vp(tr,Lp(e))}catch(g){return!0}};Cd.sham=!0;var id=!Id||Bp(function(){var I;return Dt(Dt.call)||!Dt(Object)||!Dt(function(){I=!0})||I})?Cd:Dt,ho=Dg,Yp=id,Wp=ce,_p=ee,Kp=_p("species"),co=Array,Up=function(I){var e;return ho(I)&&(e=I.constructor,Yp(e)&&(e===co||ho(e.prototype))?e=void 0:Wp(e)&&(e=e[Kp],e===null&&(e=void 0))),e===void 0?co:e},Hp=Up,UI=function(I,e){return new(Hp(I))(e===0?0:e)},Qp=z,Xp=ee,Jp=nA,$p=Xp("species"),fA=function(I){return Jp>=51||!Qp(function(){var e=[],g=e.constructor={};return g[$p]=function(){return{foo:1}},e[I](Boolean).foo!==1})},qp=N,em=z,gm=Dg,tm=ce,Am=xe,Im=Se,uo=er,fo=uA,Cm=UI,im=fA,nm=ee,rm=nA,nd=nm("isConcatSpreadable"),om=rm>=51||!em(function(){var I=[];return I[nd]=!1,I.concat()[0]!==I}),sm=function(I){if(!tm(I))return!1;var e=I[nd];return e!==void 0?!!e:gm(I)},am=!om||!im("concat");qp({target:"Array",proto:!0,arity:1,forced:am},{concat:function(e){var g=Am(this),t=Cm(g,0),A=0,C,i,n,r,o;for(C=-1,n=arguments.length;C<n;C++)if(o=C===-1?g:arguments[C],sm(o))for(r=Im(o),uo(A+r),i=0;i<r;i++,A++)i in o&&fo(t,A,o[i]);else uo(A+1),fo(t,A++,o);return t.length=A,t}});var dm=dg,lm=String,qe=function(I){if(dm(I)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return lm(I)},HI={},hm=ie,cm=Ka,um=Oe,fm=ag,pm=Ye,mm=hA;HI.f=hm&&!cm?Object.defineProperties:function(e,g){fm(e);for(var t=pm(g),A=mm(g),C=A.length,i=0,n;C>i;)um.f(e,n=A[i++],t[n]);return e};var vm=We,bm=vm("document","documentElement"),ym=mt,wm=YI,po=ym("keys"),QI=function(I){return po[I]||(po[I]=wm(I))},Em=ag,Tm=HI,mo=$n,xm=lA,Om=bm,Pm=Wa,Dm=QI,vo=">",bo="<",wi="prototype",Ei="script",rd=Dm("IE_PROTO"),NC=function(){},od=function(I){return bo+Ei+vo+I+bo+"/"+Ei+vo},yo=function(I){I.write(od("")),I.close();var e=I.parentWindow.Object;return I=null,e},Nm=function(){var I=Pm("iframe"),e="java"+Ei+":",g;return I.style.display="none",Om.appendChild(I),I.src=String(e),g=I.contentWindow.document,g.open(),g.write(od("document.F=Object")),g.close(),g.F},LA,CI=function(){try{LA=new ActiveXObject("htmlfile")}catch(e){}CI=typeof document!="undefined"?document.domain&&LA?yo(LA):Nm():yo(LA);for(var I=mo.length;I--;)delete CI[wi][mo[I]];return CI()};xm[rd]=!0;var pA=Object.create||function(e,g){var t;return e!==null?(NC[wi]=Em(e),t=new NC,NC[wi]=null,t[rd]=e):t=CI(),g===void 0?t:Tm.f(t,g)},mA={},Rm=Ua,Sm=$n,km=Sm.concat("length","prototype");mA.f=Object.getOwnPropertyNames||function(e){return Rm(e,km)};var XI={},wo=dA,Mm=Se,Fm=uA,Bm=Array,zm=Math.max,sd=function(I,e,g){for(var t=Mm(I),A=wo(e,t),C=wo(g===void 0?t:g,t),i=Bm(zm(C-A,0)),n=0;A<C;A++,n++)Fm(i,n,I[A]);return i.length=n,i},Zm=sg,Lm=Ye,ad=mA.f,Gm=sd,dd=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Vm=function(I){try{return ad(I)}catch(e){return Gm(dd)}};XI.f=function(e){return dd&&Zm(e)==="Window"?Vm(e):ad(Lm(e))};var jm=vt,vA=function(I,e,g,t){return t&&t.enumerable?I[e]=g:jm(I,e,g),I},Ym=Oe,Ar=function(I,e,g){return Ym.f(I,e,g)},bA={},Wm=ee;bA.f=Wm;var Eo=L,_m=ne,Km=bA,Um=Oe.f,$=function(I){var e=Eo.Symbol||(Eo.Symbol={});_m(e,I)||Um(e,I,{value:Km.f(I)})},Hm=je,Qm=We,Xm=ee,Jm=vA,ld=function(){var I=Qm("Symbol"),e=I&&I.prototype,g=e&&e.valueOf,t=Xm("toPrimitive");e&&!e[t]&&Jm(e,t,function(A){return Hm(g,this)},{arity:1})},$m=gr,qm=dg,ev=$m?{}.toString:function(){return"[object "+qm(this)+"]"},gv=gr,tv=Oe.f,Av=vt,Iv=ne,Cv=ev,iv=ee,To=iv("toStringTag"),bt=function(I,e,g,t){if(I){var A=g?I:I.prototype;Iv(A,To)||tv(A,To,{configurable:!0,value:e}),t&&!gv&&Av(A,"toString",Cv)}},nv=X,rv=le,xo=nv.WeakMap,hd=rv(xo)&&/native code/.test(String(xo)),ov=hd,cd=X,sv=ce,av=vt,RC=ne,SC=Xn,dv=QI,lv=lA,Oo="Object already initialized",Ti=cd.TypeError,hv=cd.WeakMap,hI,Wt,cI,cv=function(I){return cI(I)?Wt(I):hI(I,{})},uv=function(I){return function(e){var g;if(!sv(e)||(g=Wt(e)).type!==I)throw new Ti("Incompatible receiver, "+I+" required");return g}};ov||SC.state?(Fe=SC.state||(SC.state=new hv),Fe.get=Fe.get,Fe.has=Fe.has,Fe.set=Fe.set,hI=function(I,e){if(Fe.has(I))throw new Ti(Oo);return e.facade=I,Fe.set(I,e),e},Wt=function(I){return Fe.get(I)||{}},cI=function(I){return Fe.has(I)}):(Rg=dv("state"),lv[Rg]=!0,hI=function(I,e){if(RC(I,Rg))throw new Ti(Oo);return e.facade=I,av(I,Rg,e),e},Wt=function(I){return RC(I,Rg)?I[Rg]:{}},cI=function(I){return RC(I,Rg)});var Fe,Rg,Kg={set:hI,get:Wt,has:cI,enforce:cv,getterFor:uv},fv=aA,pv=Z,mv=jI,vv=xe,bv=Se,yv=UI,Po=pv([].push),hg=function(I){var e=I===1,g=I===2,t=I===3,A=I===4,C=I===6,i=I===7,n=I===5||C;return function(r,o,s,a){for(var d=vv(r),l=mv(d),h=fv(o,s),c=bv(l),p=0,u=a||yv,m=e?u(r,c):g||i?u(r,0):void 0,E,w;c>p;p++)if((n||p in l)&&(E=l[p],w=h(E,p,d),I))if(e)m[p]=w;else if(w)switch(I){case 3:return!0;case 5:return E;case 6:return p;case 2:Po(m,E)}else switch(I){case 4:return!1;case 7:Po(m,E)}return C?-1:t||A?A:m}},Ng={forEach:hg(0),map:hg(1),filter:hg(2),some:hg(3),every:hg(4),find:hg(5),findIndex:hg(6),filterReject:hg(7)},JI=N,$I=X,Ir=je,wv=Z,at=ie,dt=pt,Ev=z,oe=ne,Tv=J,xi=ag,qI=Ye,Cr=WI,xv=qe,Oi=IA,_t=pA,ud=hA,Ov=mA,fd=XI,Pv=cA,pd=tA,md=Oe,Dv=HI,vd=AA,Do=vA,Nv=Ar,ir=mt,Rv=QI,bd=lA,No=YI,Sv=ee,kv=bA,Mv=$,Fv=ld,Bv=bt,yd=Kg,eC=Ng.forEach,Ee=Rv("hidden"),gC="Symbol",Kt="prototype",zv=yd.set,Ro=yd.getterFor(gC),Ge=Object[Kt],Fg=$I.Symbol,Ft=Fg&&Fg[Kt],Zv=$I.RangeError,Lv=$I.TypeError,kC=$I.QObject,wd=pd.f,Bg=md.f,Ed=fd.f,Gv=vd.f,Td=wv([].push),ig=ir("symbols"),yA=ir("op-symbols"),Vv=ir("wks"),Pi=!kC||!kC[Kt]||!kC[Kt].findChild,xd=function(I,e,g){var t=wd(Ge,e);t&&delete Ge[e],Bg(I,e,g),t&&I!==Ge&&Bg(Ge,e,t)},Di=at&&Ev(function(){return _t(Bg({},"a",{get:function(){return Bg(this,"a",{value:7}).a}})).a!==7})?xd:Bg,MC=function(I,e){var g=ig[I]=_t(Ft);return zv(g,{type:gC,tag:I,description:e}),at||(g.description=e),g},tC=function(e,g,t){e===Ge&&tC(yA,g,t),xi(e);var A=Cr(g);return xi(t),oe(ig,A)?(t.enumerable?(oe(e,Ee)&&e[Ee][A]&&(e[Ee][A]=!1),t=_t(t,{enumerable:Oi(0,!1)})):(oe(e,Ee)||Bg(e,Ee,Oi(1,{})),e[Ee][A]=!0),Di(e,A,t)):Bg(e,A,t)},nr=function(e,g){xi(e);var t=qI(g),A=ud(t).concat(Nd(t));return eC(A,function(C){(!at||Ir(Od,t,C))&&tC(e,C,t[C])}),e},jv=function(e,g){return g===void 0?_t(e):nr(_t(e),g)},Od=function(e){var g=Cr(e),t=Ir(Gv,this,g);return this===Ge&&oe(ig,g)&&!oe(yA,g)?!1:t||!oe(this,g)||!oe(ig,g)||oe(this,Ee)&&this[Ee][g]?t:!0},Pd=function(e,g){var t=qI(e),A=Cr(g);if(!(t===Ge&&oe(ig,A)&&!oe(yA,A))){var C=wd(t,A);return C&&oe(ig,A)&&!(oe(t,Ee)&&t[Ee][A])&&(C.enumerable=!0),C}},Dd=function(e){var g=Ed(qI(e)),t=[];return eC(g,function(A){!oe(ig,A)&&!oe(bd,A)&&Td(t,A)}),t},Nd=function(I){var e=I===Ge,g=Ed(e?yA:qI(I)),t=[];return eC(g,function(A){oe(ig,A)&&(!e||oe(Ge,A))&&Td(t,ig[A])}),t};dt||(Fg=function(){if(Tv(Ft,this))throw new Lv("Symbol is not a constructor");var e=!arguments.length||arguments[0]===void 0?void 0:xv(arguments[0]),g=No(e),t=function(A){this===Ge&&Ir(t,yA,A),oe(this,Ee)&&oe(this[Ee],g)&&(this[Ee][g]=!1);var C=Oi(1,A);try{Di(this,g,C)}catch(i){if(!(i instanceof Zv))throw i;xd(this,g,C)}};return at&&Pi&&Di(Ge,g,{configurable:!0,set:t}),MC(g,e)},Ft=Fg[Kt],Do(Ft,"toString",function(){return Ro(this).tag}),Do(Fg,"withoutSetter",function(I){return MC(No(I),I)}),vd.f=Od,md.f=tC,Dv.f=nr,pd.f=Pd,Ov.f=fd.f=Dd,Pv.f=Nd,kv.f=function(I){return MC(Sv(I),I)},at&&Nv(Ft,"description",{configurable:!0,get:function(){return Ro(this).description}}));JI({global:!0,constructor:!0,wrap:!0,forced:!dt,sham:!dt},{Symbol:Fg});eC(ud(Vv),function(I){Mv(I)});JI({target:gC,stat:!0,forced:!dt},{useSetter:function(){Pi=!0},useSimple:function(){Pi=!1}});JI({target:"Object",stat:!0,forced:!dt,sham:!at},{create:jv,defineProperty:tC,defineProperties:nr,getOwnPropertyDescriptor:Pd});JI({target:"Object",stat:!0,forced:!dt},{getOwnPropertyNames:Dd});Fv();Bv(Fg,gC);bd[Ee]=!0;var Yv=pt,Rd=Yv&&!!Symbol.for&&!!Symbol.keyFor,Wv=N,_v=We,Kv=ne,Uv=qe,Sd=mt,Hv=Rd,FC=Sd("string-to-symbol-registry"),Qv=Sd("symbol-to-string-registry");Wv({target:"Symbol",stat:!0,forced:!Hv},{for:function(I){var e=Uv(I);if(Kv(FC,e))return FC[e];var g=_v("Symbol")(e);return FC[e]=g,Qv[g]=e,g}});var Xv=N,Jv=ne,$v=rA,qv=oA,eb=mt,gb=Rd,So=eb("symbol-to-string-registry");Xv({target:"Symbol",stat:!0,forced:!gb},{keyFor:function(e){if(!$v(e))throw new TypeError(qv(e)+" is not a symbol");if(Jv(So,e))return So[e]}});var tb=Z,ko=Dg,Ab=le,Mo=sg,Ib=qe,Fo=tb([].push),Cb=function(I){if(Ab(I))return I;if(ko(I)){for(var e=I.length,g=[],t=0;t<e;t++){var A=I[t];typeof A=="string"?Fo(g,A):(typeof A=="number"||Mo(A)==="Number"||Mo(A)==="String")&&Fo(g,Ib(A))}var C=g.length,i=!0;return function(n,r){if(i)return i=!1,r;if(ko(this))return r;for(var o=0;o<C;o++)if(g[o]===n)return r}}},ib=N,kd=We,Md=VI,nb=je,wA=Z,Fd=z,Bo=le,zo=rA,Bd=KI,rb=Cb,ob=pt,sb=String,yg=kd("JSON","stringify"),GA=wA(/./.exec),Zo=wA("".charAt),ab=wA("".charCodeAt),db=wA("".replace),lb=wA(1 .toString),hb=/[\uD800-\uDFFF]/g,Lo=/^[\uD800-\uDBFF]$/,Go=/^[\uDC00-\uDFFF]$/,Vo=!ob||Fd(function(){var I=kd("Symbol")("stringify detection");return yg([I])!=="[null]"||yg({a:I})!=="{}"||yg(Object(I))!=="{}"}),jo=Fd(function(){return yg("\uDF06\uD834")!=='"\\udf06\\ud834"'||yg("\uDEAD")!=='"\\udead"'}),cb=function(I,e){var g=Bd(arguments),t=rb(e);if(!(!Bo(t)&&(I===void 0||zo(I))))return g[1]=function(A,C){if(Bo(t)&&(C=nb(t,this,sb(A),C)),!zo(C))return C},Md(yg,null,g)},ub=function(I,e,g){var t=Zo(g,e-1),A=Zo(g,e+1);return GA(Lo,I)&&!GA(Go,A)||GA(Go,I)&&!GA(Lo,t)?"\\u"+lb(ab(I,0),16):I};yg&&ib({target:"JSON",stat:!0,arity:3,forced:Vo||jo},{stringify:function(e,g,t){var A=Bd(arguments),C=Md(Vo?cb:yg,null,A);return jo&&typeof C=="string"?db(C,hb,ub):C}});var fb=N,pb=pt,mb=z,zd=cA,vb=xe,bb=!pb||mb(function(){zd.f(1)});fb({target:"Object",stat:!0,forced:bb},{getOwnPropertySymbols:function(e){var g=zd.f;return g?g(vb(e)):[]}});var yb=$;yb("asyncIterator");var wb=$;wb("hasInstance");var Eb=$;Eb("isConcatSpreadable");var Tb=$;Tb("iterator");var xb=$;xb("match");var Ob=$;Ob("matchAll");var Pb=$;Pb("replace");var Db=$;Db("search");var Nb=$;Nb("species");var Rb=$;Rb("split");var Sb=$,kb=ld;Sb("toPrimitive");kb();var Mb=We,Fb=$,Bb=bt;Fb("toStringTag");Bb(Mb("Symbol"),"Symbol");var zb=$;zb("unscopables");var Zb=X,Lb=bt;Lb(Zb.JSON,"JSON",!0);var Gb=L,Vb=Gb.Symbol,yt={},Ni=ie,jb=ne,Zd=Function.prototype,Yb=Ni&&Object.getOwnPropertyDescriptor,rr=jb(Zd,"name"),Wb=rr&&(function(){}).name==="something",_b=rr&&(!Ni||Ni&&Yb(Zd,"name").configurable),Kb={EXISTS:rr,PROPER:Wb,CONFIGURABLE:_b},Ub=z,Ld=!Ub(function(){function I(){}return I.prototype.constructor=null,Object.getPrototypeOf(new I)!==I.prototype}),Hb=ne,Qb=le,Xb=xe,Jb=QI,$b=Ld,Yo=Jb("IE_PROTO"),Ri=Object,qb=Ri.prototype,AC=$b?Ri.getPrototypeOf:function(I){var e=Xb(I);if(Hb(e,Yo))return e[Yo];var g=e.constructor;return Qb(g)&&e instanceof g?g.prototype:e instanceof Ri?qb:null},ey=z,gy=le,ty=ce,Ay=pA,Wo=AC,Iy=vA,Cy=ee,Si=Cy("iterator"),Gd=!1,gg,BC,zC;[].keys&&(zC=[].keys(),"next"in zC?(BC=Wo(Wo(zC)),BC!==Object.prototype&&(gg=BC)):Gd=!0);var iy=!ty(gg)||ey(function(){var I={};return gg[Si].call(I)!==I});iy?gg={}:gg=Ay(gg);gy(gg[Si])||Iy(gg,Si,function(){return this});var Vd={IteratorPrototype:gg,BUGGY_SAFARI_ITERATORS:Gd},ny=Vd.IteratorPrototype,ry=pA,oy=IA,sy=bt,ay=yt,dy=function(){return this},ly=function(I,e,g,t){var A=e+" Iterator";return I.prototype=ry(ny,{next:oy(+!t,g)}),sy(I,A,!1,!0),ay[A]=dy,I},hy=N,cy=je,jd=Kb,uy=ly,fy=AC,py=bt,_o=vA,my=ee,Ko=yt,Yd=Vd,vy=jd.PROPER;jd.CONFIGURABLE;Yd.IteratorPrototype;var VA=Yd.BUGGY_SAFARI_ITERATORS,ZC=my("iterator"),Uo="keys",jA="values",Ho="entries",by=function(){return this},or=function(I,e,g,t,A,C,i){uy(g,e,t);var n=function(u){if(u===A&&d)return d;if(!VA&&u&&u in s)return s[u];switch(u){case Uo:return function(){return new g(this,u)};case jA:return function(){return new g(this,u)};case Ho:return function(){return new g(this,u)}}return function(){return new g(this)}},r=e+" Iterator",o=!1,s=I.prototype,a=s[ZC]||s["@@iterator"]||A&&s[A],d=!VA&&a||n(A),l=e==="Array"&&s.entries||a,h,c,p;if(l&&(h=fy(l.call(new I)),h!==Object.prototype&&h.next&&(py(h,r,!0,!0),Ko[r]=by)),vy&&A===jA&&a&&a.name!==jA&&(o=!0,d=function(){return cy(a,this)}),A)if(c={values:n(jA),keys:C?d:n(Uo),entries:n(Ho)},i)for(p in c)(VA||o||!(p in s))&&_o(s,p,c[p]);else hy({target:e,proto:!0,forced:VA||o},c);return i&&s[ZC]!==d&&_o(s,ZC,d,{name:A}),Ko[e]=d,c},sr=function(I,e){return{value:I,done:e}},yy=Ye,Qo=yt,Wd=Kg;Oe.f;var wy=or,YA=sr,_d="Array Iterator",Ey=Wd.set,Ty=Wd.getterFor(_d);wy(Array,"Array",function(I,e){Ey(this,{type:_d,target:yy(I),index:0,kind:e})},function(){var I=Ty(this),e=I.target,g=I.kind,t=I.index++;if(!e||t>=e.length)return I.target=void 0,YA(void 0,!0);switch(g){case"keys":return YA(t,!1);case"values":return YA(e[t],!1)}return YA([t,e[t]],!1)},"values");Qo.Arguments=Qo.Array;var xy={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},Oy=xy,Py=X,Dy=dg,Ny=vt,Xo=yt,Ry=ee,Jo=Ry("toStringTag");for(WA in Oy)LC=Py[WA],_A=LC&&LC.prototype,_A&&Dy(_A)!==Jo&&Ny(_A,Jo,WA),Xo[WA]=Xo.Array;var LC,_A,WA,Sy=Vb,Kd=Sy,ky=Kd,My=D(ky),Fy=N,$o=Dg,By=id,zy=ce,qo=dA,Zy=Se,Ly=Ye,Gy=uA,Vy=ee,jy=fA,Yy=KI,Wy=jy("slice"),_y=Vy("species"),GC=Array,Ky=Math.max;Fy({target:"Array",proto:!0,forced:!Wy},{slice:function(e,g){var t=Ly(this),A=Zy(t),C=qo(e,A),i=qo(g===void 0?A:g,A),n,r,o;if($o(t)&&(n=t.constructor,By(n)&&(n===GC||$o(n.prototype))?n=void 0:zy(n)&&(n=n[_y],n===null&&(n=void 0)),n===GC||n===void 0))return Yy(t,C,i);for(r=new(n===void 0?GC:n)(Ky(i-C,0)),o=0;C<i;C++,o++)C in t&&Gy(r,o,t[C]);return r.length=o,r}});var Uy=Ie,Hy=Uy("Array").slice,Qy=J,Xy=Hy,VC=Array.prototype,Jy=function(I){var e=I.slice;return I===VC||Qy(VC,I)&&e===VC.slice?Xy:e},$y=Jy,qy=$y,e0=qy,Ze=D(e0),g0=We,t0=Z,A0=mA,I0=cA,C0=ag,i0=t0([].concat),Ud=g0("Reflect","ownKeys")||function(e){var g=A0.f(C0(e)),t=I0.f;return t?i0(g,t(e)):g},n0=N,r0=Ud;n0({target:"Reflect",stat:!0},{ownKeys:r0});var o0=L,s0=o0.Reflect.ownKeys,a0=s0,d0=a0,l0=d0,h0=D(l0),c0=N,u0=Dg;c0({target:"Array",stat:!0},{isArray:u0});var f0=L,p0=f0.Array.isArray,m0=p0,v0=m0,b0=v0,B=D(b0),y0=N,w0=Ng.map,E0=fA,T0=E0("map");y0({target:"Array",proto:!0,forced:!T0},{map:function(e){return w0(this,e,arguments.length>1?arguments[1]:void 0)}});var x0=Ie,O0=x0("Array").map,P0=J,D0=O0,jC=Array.prototype,N0=function(I){var e=I.map;return I===jC||P0(jC,I)&&e===jC.map?D0:e},R0=N0,S0=R0,k0=S0,ae=D(k0),M0=N,F0=xe,Hd=hA,B0=z,z0=B0(function(){Hd(1)});M0({target:"Object",stat:!0,forced:z0},{keys:function(e){return Hd(F0(e))}});var Z0=L,L0=Z0.Object.keys,G0=L0,V0=G0,j0=V0,U=D(j0),Y0=N,W0=Z,Qd=Date,_0=W0(Qd.prototype.getTime);Y0({target:"Date",stat:!0},{now:function(){return _0(new Qd)}});var K0=L,U0=K0.Date.now,H0=U0,Q0=H0,X0=Q0,uI=D(X0),J0=z,wt=function(I,e){var g=[][I];return!!g&&J0(function(){g.call(null,e||function(){return 1},1)})},$0=Ng.forEach,q0=wt,ew=q0("forEach"),gw=ew?[].forEach:function(e){return $0(this,e,arguments.length>1?arguments[1]:void 0)},tw=N,es=gw;tw({target:"Array",proto:!0,forced:[].forEach!==es},{forEach:es});var Aw=Ie,Iw=Aw("Array").forEach,Cw=Iw,iw=Cw,nw=dg,rw=ne,ow=J,sw=iw,YC=Array.prototype,aw={DOMTokenList:!0,NodeList:!0},dw=function(I){var e=I.forEach;return I===YC||ow(YC,I)&&e===YC.forEach||rw(aw,nw(I))?sw:e},lw=dw,F=D(lw),hw=N,cw=Z,uw=Dg,fw=cw([].reverse),gs=[1,2];hw({target:"Array",proto:!0,forced:String(gs)===String(gs.reverse())},{reverse:function(){return uw(this)&&(this.length=this.length),fw(this)}});var pw=Ie,mw=pw("Array").reverse,vw=J,bw=mw,WC=Array.prototype,yw=function(I){var e=I.reverse;return I===WC||vw(WC,I)&&e===WC.reverse?bw:e},ww=yw,Ew=ww,Tw=Ew,zg=D(Tw),xw=ie,Ow=Dg,Pw=TypeError,Dw=Object.getOwnPropertyDescriptor,Nw=xw&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(I){return I instanceof TypeError}})(),Rw=Nw?function(I,e){if(Ow(I)&&!Dw(I,"length").writable)throw new Pw("Cannot set read only .length");return I.length=e}:function(I,e){return I.length=e},ts=oA,Sw=TypeError,Xd=function(I,e){if(!delete I[e])throw new Sw("Cannot delete property "+ts(e)+" of "+ts(I))},kw=N,Mw=xe,Fw=dA,Bw=_I,zw=Se,Zw=Rw,Lw=er,Gw=UI,Vw=uA,_C=Xd,jw=fA,Yw=jw("splice"),Ww=Math.max,_w=Math.min;kw({target:"Array",proto:!0,forced:!Yw},{splice:function(e,g){var t=Mw(this),A=zw(t),C=Fw(e,A),i=arguments.length,n,r,o,s,a,d;for(i===0?n=r=0:i===1?(n=0,r=A-C):(n=i-2,r=_w(Ww(Bw(g),0),A-C)),Lw(A+n-r),o=Gw(t,r),s=0;s<r;s++)a=C+s,a in t&&Vw(o,s,t[a]);if(o.length=r,n<r){for(s=C;s<A-r;s++)a=s+r,d=s+n,a in t?t[d]=t[a]:_C(t,d);for(s=A;s>A-r+n;s--)_C(t,s-1)}else if(n>r)for(s=A-r;s>C;s--)a=s+r-1,d=s+n-1,a in t?t[d]=t[a]:_C(t,d);for(s=0;s<n;s++)t[s+C]=arguments[s+2];return Zw(t,A-r+n),o}});var Kw=Ie,Uw=Kw("Array").splice,Hw=J,Qw=Uw,KC=Array.prototype,Xw=function(I){var e=I.splice;return I===KC||Hw(KC,I)&&e===KC.splice?Qw:e},Jw=Xw,$w=Jw,qw=$w,Ue=D(qw),eE=N,gE=Jn.includes,tE=z,AE=tE(function(){return!Array(1).includes()});eE({target:"Array",proto:!0,forced:AE},{includes:function(e){return gE(this,e,arguments.length>1?arguments[1]:void 0)}});var IE=Ie,CE=IE("Array").includes,iE=ce,nE=sg,rE=ee,oE=rE("match"),sE=function(I){var e;return iE(I)&&((e=I[oE])!==void 0?!!e:nE(I)==="RegExp")},aE=sE,dE=TypeError,lE=function(I){if(aE(I))throw new dE("The method doesn't accept regular expressions");return I},hE=ee,cE=hE("match"),uE=function(I){var e=/./;try{"/./"[I](e)}catch(g){try{return e[cE]=!1,"/./"[I](e)}catch(t){}}return!1},fE=N,pE=Z,mE=lE,vE=CA,As=qe,bE=uE,yE=pE("".indexOf);fE({target:"String",proto:!0,forced:!bE("includes")},{includes:function(e){return!!~yE(As(vE(this)),As(mE(e)),arguments.length>1?arguments[1]:void 0)}});var wE=Ie,EE=wE("String").includes,Is=J,TE=CE,xE=EE,UC=Array.prototype,HC=String.prototype,OE=function(I){var e=I.includes;return I===UC||Is(UC,I)&&e===UC.includes?TE:typeof I=="string"||I===HC||Is(HC,I)&&e===HC.includes?xE:e},PE=OE,DE=PE,NE=DE,wg=D(NE),RE=N,SE=z,kE=xe,Jd=AC,ME=Ld,FE=SE(function(){Jd(1)});RE({target:"Object",stat:!0,forced:FE,sham:!ME},{getPrototypeOf:function(e){return Jd(kE(e))}});var BE=L,zE=BE.Object.getPrototypeOf,ZE=zE,LE=ZE,GE=LE,Cs=D(GE),VE=Ie,jE=VE("Array").concat,YE=J,WE=jE,QC=Array.prototype,_E=function(I){var e=I.concat;return I===QC||YE(QC,I)&&e===QC.concat?WE:e},KE=_E,UE=KE,HE=UE,$d=D(HE),QE=N,XE=Ng.filter,JE=fA,$E=JE("filter");QE({target:"Array",proto:!0,forced:!$E},{filter:function(e){return XE(this,e,arguments.length>1?arguments[1]:void 0)}});var qE=Ie,eT=qE("Array").filter,gT=J,tT=eT,XC=Array.prototype,AT=function(I){var e=I.filter;return I===XC||gT(XC,I)&&e===XC.filter?tT:e},IT=AT,CT=IT,iT=CT,te=D(iT),qd=ie,nT=z,el=Z,rT=AC,oT=hA,sT=Ye,aT=AA.f,gl=el(aT),dT=el([].push),lT=qd&&nT(function(){var I=Object.create(null);return I[2]=2,!gl(I,2)}),is=function(I){return function(e){for(var g=sT(e),t=oT(g),A=lT&&rT(g)===null,C=t.length,i=0,n=[],r;C>i;)r=t[i++],(!qd||(A?r in g:gl(g,r)))&&dT(n,I?[r,g[r]]:g[r]);return n}},hT={entries:is(!0),values:is(!1)},cT=N,uT=hT.values;cT({target:"Object",stat:!0},{values:function(e){return uT(e)}});var fT=L,pT=fT.Object.values,mT=pT,vT=mT,bT=vT,yT=D(bT),ar=`
631
+ \v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,wT=Z,ET=CA,TT=qe,ki=ar,ns=wT("".replace),xT=RegExp("^["+ki+"]+"),OT=RegExp("(^|[^"+ki+"])["+ki+"]+$"),JC=function(I){return function(e){var g=TT(ET(e));return I&1&&(g=ns(g,xT,"")),I&2&&(g=ns(g,OT,"$1")),g}},tl={start:JC(1),end:JC(2),trim:JC(3)},Al=X,PT=z,DT=Z,NT=qe,RT=tl.trim,rs=ar,Zt=Al.parseInt,os=Al.Symbol,ss=os&&os.iterator,Il=/^[+-]?0x/i,ST=DT(Il.exec),kT=Zt(rs+"08")!==8||Zt(rs+"0x16")!==22||ss&&!PT(function(){Zt(Object(ss))}),MT=kT?function(e,g){var t=RT(NT(e));return Zt(t,g>>>0||(ST(Il,t)?16:10))}:Zt,FT=N,as=MT;FT({global:!0,forced:parseInt!==as},{parseInt:as});var BT=L,zT=BT.parseInt,ZT=zT,LT=ZT,GT=LT,ze=D(GT),VT=N,jT=Hn,YT=Jn.indexOf,WT=wt,Mi=jT([].indexOf),Cl=!!Mi&&1/Mi([1],1,-0)<0,_T=Cl||!WT("indexOf");VT({target:"Array",proto:!0,forced:_T},{indexOf:function(e){var g=arguments.length>1?arguments[1]:void 0;return Cl?Mi(this,e,g)||0:YT(this,e,g)}});var KT=Ie,UT=KT("Array").indexOf,HT=J,QT=UT,$C=Array.prototype,XT=function(I){var e=I.indexOf;return I===$C||HT($C,I)&&e===$C.indexOf?QT:e},JT=XT,$T=JT,qT=$T,G=D(qT),ex=N,gx=ie,tx=pA;ex({target:"Object",stat:!0,sham:!gx},{create:tx});var Ax=L,Ix=Ax.Object,Cx=function(e,g){return Ix.create(e,g)},ix=Cx,nx=ix,rx=nx,Eg=D(rx),Fi=L,ox=VI;Fi.JSON||(Fi.JSON={stringify:JSON.stringify});var sx=function(e,g,t){return ox(Fi.JSON.stringify,null,arguments)},ax=sx,dx=ax,lx=dx,Et=D(lx),hx=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",cx=TypeError,ux=function(I,e){if(I<e)throw new cx("Not enough arguments");return I},il=X,fx=VI,px=le,mx=hx,vx=iA,bx=KI,yx=ux,wx=il.Function,Ex=/MSIE .\./.test(vx)||mx&&(function(){var I=il.Bun.version.split(".");return I.length<3||I[0]==="0"&&(I[1]<3||I[1]==="3"&&I[2]==="0")})(),nl=function(I,e){var g=e?2:1;return Ex?function(t,A){var C=yx(arguments.length,1)>g,i=px(t)?t:wx(t),n=C?bx(arguments,g):[],r=C?function(){fx(i,this,n)}:i;return e?I(r,A):I(r)}:I},Tx=N,rl=X,xx=nl,ds=xx(rl.setInterval,!0);Tx({global:!0,bind:!0,forced:rl.setInterval!==ds},{setInterval:ds});var Ox=N,ol=X,Px=nl,ls=Px(ol.setTimeout,!0);Ox({global:!0,bind:!0,forced:ol.setTimeout!==ls},{setTimeout:ls});var Dx=L,Nx=Dx.setTimeout,Rx=Nx,He=D(Rx),Sx=xe,hs=dA,kx=Se,Mx=function(e){for(var g=Sx(this),t=kx(g),A=arguments.length,C=hs(A>1?arguments[1]:void 0,t),i=A>2?arguments[2]:void 0,n=i===void 0?t:hs(i,t);n>C;)g[C++]=e;return g},Fx=N,Bx=Mx;Fx({target:"Array",proto:!0},{fill:Bx});var zx=Ie,Zx=zx("Array").fill,Lx=J,Gx=Zx,qC=Array.prototype,Vx=function(I){var e=I.fill;return I===qC||Lx(qC,I)&&e===qC.fill?Gx:e},jx=Vx,Yx=jx,Wx=Yx,EA=D(Wx);function Ve(){return Ve=Object.assign||function(I){for(var e=1;e<arguments.length;e++){var g=arguments[e];for(var t in g)Object.prototype.hasOwnProperty.call(g,t)&&(I[t]=g[t])}return I},Ve.apply(this,arguments)}function ke(I,e){I.prototype=Object.create(e.prototype),I.prototype.constructor=I,I.__proto__=e}function KA(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}var Bi;typeof Object.assign!="function"?Bi=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var g=Object(e),t=1;t<arguments.length;t++){var A=arguments[t];if(A!=null)for(var C in A)A.hasOwnProperty(C)&&(g[C]=A[C])}return g}:Bi=Object.assign;var Gg=Bi,cs=["","webkit","Moz","MS","ms","o"],_x=typeof document=="undefined"?{style:{}}:document.createElement("div"),Kx="function",Ct=Math.round,Vg=Math.abs,dr=Date.now;function IC(I,e){for(var g,t,A=e[0].toUpperCase()+e.slice(1),C=0;C<cs.length;){if(g=cs[C],t=g?g+A:e,t in I)return t;C++}}var tg;typeof window=="undefined"?tg={}:tg=window;var sl=IC(_x.style,"touchAction"),al=sl!==void 0;function Ux(){if(!al)return!1;var I={},e=tg.CSS&&tg.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(g){return I[g]=e?tg.CSS.supports("touch-action",g):!0}),I}var dl="compute",ll="auto",zi="manipulation",Zg="none",Ut="pan-x",Ht="pan-y",UA=Ux(),Hx=/mobile|tablet|ip(ad|hone|od)|android/i,hl="ontouchstart"in tg,Qx=IC(tg,"PointerEvent")!==void 0,Xx=hl&&Hx.test(navigator.userAgent),TA="touch",Jx="pen",lr="mouse",$x="kinect",qx=25,be=1,Ug=2,Ae=4,Te=8,fI=1,xA=2,OA=4,PA=8,lt=16,Qe=xA|OA,Lg=PA|lt,cl=Qe|Lg,ul=["x","y"],pI=["clientX","clientY"];function Ag(I,e,g){var t;if(I)if(I.forEach)I.forEach(e,g);else if(I.length!==void 0)for(t=0;t<I.length;)e.call(g,I[t],t,I),t++;else for(t in I)I.hasOwnProperty(t)&&e.call(g,I[t],t,I)}function CC(I,e){return typeof I===Kx?I.apply(e&&e[0]||void 0,e):I}function kg(I,e){return I.indexOf(e)>-1}function eO(I){if(kg(I,Zg))return Zg;var e=kg(I,Ut),g=kg(I,Ht);return e&&g?Zg:e||g?e?Ut:Ht:kg(I,zi)?zi:ll}var fl=(function(){function I(g,t){this.manager=g,this.set(t)}var e=I.prototype;return e.set=function(t){t===dl&&(t=this.compute()),al&&this.manager.element.style&&UA[t]&&(this.manager.element.style[sl]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return Ag(this.manager.recognizers,function(A){CC(A.options.enable,[A])&&(t=t.concat(A.getTouchAction()))}),eO(t.join(" "))},e.preventDefaults=function(t){var A=t.srcEvent,C=t.offsetDirection;if(this.manager.session.prevented){A.preventDefault();return}var i=this.actions,n=kg(i,Zg)&&!UA[Zg],r=kg(i,Ht)&&!UA[Ht],o=kg(i,Ut)&&!UA[Ut];if(n){var s=t.pointers.length===1,a=t.distance<2,d=t.deltaTime<250;if(s&&a&&d)return}if(!(o&&r)&&(n||r&&C&Qe||o&&C&Lg))return this.preventSrc(A)},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},I})();function hr(I,e){for(;I;){if(I===e)return!0;I=I.parentNode}return!1}function pl(I){var e=I.length;if(e===1)return{x:Ct(I[0].clientX),y:Ct(I[0].clientY)};for(var g=0,t=0,A=0;A<e;)g+=I[A].clientX,t+=I[A].clientY,A++;return{x:Ct(g/e),y:Ct(t/e)}}function us(I){for(var e=[],g=0;g<I.pointers.length;)e[g]={clientX:Ct(I.pointers[g].clientX),clientY:Ct(I.pointers[g].clientY)},g++;return{timeStamp:dr(),pointers:e,center:pl(e),deltaX:I.deltaX,deltaY:I.deltaY}}function mI(I,e,g){g||(g=ul);var t=e[g[0]]-I[g[0]],A=e[g[1]]-I[g[1]];return Math.sqrt(t*t+A*A)}function Zi(I,e,g){g||(g=ul);var t=e[g[0]]-I[g[0]],A=e[g[1]]-I[g[1]];return Math.atan2(A,t)*180/Math.PI}function ml(I,e){return I===e?fI:Vg(I)>=Vg(e)?I<0?xA:OA:e<0?PA:lt}function gO(I,e){var g=e.center,t=I.offsetDelta||{},A=I.prevDelta||{},C=I.prevInput||{};(e.eventType===be||C.eventType===Ae)&&(A=I.prevDelta={x:C.deltaX||0,y:C.deltaY||0},t=I.offsetDelta={x:g.x,y:g.y}),e.deltaX=A.x+(g.x-t.x),e.deltaY=A.y+(g.y-t.y)}function vl(I,e,g){return{x:e/I||0,y:g/I||0}}function tO(I,e){return mI(e[0],e[1],pI)/mI(I[0],I[1],pI)}function AO(I,e){return Zi(e[1],e[0],pI)+Zi(I[1],I[0],pI)}function IO(I,e){var g=I.lastInterval||e,t=e.timeStamp-g.timeStamp,A,C,i,n;if(e.eventType!==Te&&(t>qx||g.velocity===void 0)){var r=e.deltaX-g.deltaX,o=e.deltaY-g.deltaY,s=vl(t,r,o);C=s.x,i=s.y,A=Vg(s.x)>Vg(s.y)?s.x:s.y,n=ml(r,o),I.lastInterval=e}else A=g.velocity,C=g.velocityX,i=g.velocityY,n=g.direction;e.velocity=A,e.velocityX=C,e.velocityY=i,e.direction=n}function CO(I,e){var g=I.session,t=e.pointers,A=t.length;g.firstInput||(g.firstInput=us(e)),A>1&&!g.firstMultiple?g.firstMultiple=us(e):A===1&&(g.firstMultiple=!1);var C=g.firstInput,i=g.firstMultiple,n=i?i.center:C.center,r=e.center=pl(t);e.timeStamp=dr(),e.deltaTime=e.timeStamp-C.timeStamp,e.angle=Zi(n,r),e.distance=mI(n,r),gO(g,e),e.offsetDirection=ml(e.deltaX,e.deltaY);var o=vl(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=o.x,e.overallVelocityY=o.y,e.overallVelocity=Vg(o.x)>Vg(o.y)?o.x:o.y,e.scale=i?tO(i.pointers,t):1,e.rotation=i?AO(i.pointers,t):0,e.maxPointers=g.prevInput?e.pointers.length>g.prevInput.maxPointers?e.pointers.length:g.prevInput.maxPointers:e.pointers.length,IO(g,e);var s=I.element,a=e.srcEvent,d;a.composedPath?d=a.composedPath()[0]:a.path?d=a.path[0]:d=a.target,hr(d,s)&&(s=d),e.target=s}function iO(I,e,g){var t=g.pointers.length,A=g.changedPointers.length,C=e&be&&t-A===0,i=e&(Ae|Te)&&t-A===0;g.isFirst=!!C,g.isFinal=!!i,C&&(I.session={}),g.eventType=e,CO(I,g),I.emit("hammer.input",g),I.recognize(g),I.session.prevInput=g}function Qt(I){return I.trim().split(/\s+/g)}function Lt(I,e,g){Ag(Qt(e),function(t){I.addEventListener(t,g,!1)})}function Gt(I,e,g){Ag(Qt(e),function(t){I.removeEventListener(t,g,!1)})}function fs(I){var e=I.ownerDocument||I;return e.defaultView||e.parentWindow||window}var Tt=(function(){function I(g,t){var A=this;this.manager=g,this.callback=t,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(C){CC(g.options.enable,[g])&&A.handler(C)},this.init()}var e=I.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Lt(this.element,this.evEl,this.domHandler),this.evTarget&&Lt(this.target,this.evTarget,this.domHandler),this.evWin&&Lt(fs(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&Gt(this.element,this.evEl,this.domHandler),this.evTarget&&Gt(this.target,this.evTarget,this.domHandler),this.evWin&&Gt(fs(this.element),this.evWin,this.domHandler)},I})();function jg(I,e,g){if(I.indexOf&&!g)return I.indexOf(e);for(var t=0;t<I.length;){if(g&&I[t][g]==e||!g&&I[t]===e)return t;t++}return-1}var nO={pointerdown:be,pointermove:Ug,pointerup:Ae,pointercancel:Te,pointerout:Te},rO={2:TA,3:Jx,4:lr,5:$x},bl="pointerdown",yl="pointermove pointerup pointercancel";tg.MSPointerEvent&&!tg.PointerEvent&&(bl="MSPointerDown",yl="MSPointerMove MSPointerUp MSPointerCancel");var wl=(function(I){ke(e,I);function e(){var t,A=e.prototype;return A.evEl=bl,A.evWin=yl,t=I.apply(this,arguments)||this,t.store=t.manager.session.pointerEvents=[],t}var g=e.prototype;return g.handler=function(A){var C=this.store,i=!1,n=A.type.toLowerCase().replace("ms",""),r=nO[n],o=rO[A.pointerType]||A.pointerType,s=o===TA,a=jg(C,A.pointerId,"pointerId");r&be&&(A.button===0||s)?a<0&&(C.push(A),a=C.length-1):r&(Ae|Te)&&(i=!0),!(a<0)&&(C[a]=A,this.callback(this.manager,r,{pointers:C,changedPointers:[A],pointerType:o,srcEvent:A}),i&&C.splice(a,1))},e})(Tt);function Xt(I){return Array.prototype.slice.call(I,0)}function cr(I,e,g){for(var t=[],A=[],C=0;C<I.length;){var i=e?I[C][e]:I[C];jg(A,i)<0&&t.push(I[C]),A[C]=i,C++}return g&&(e?t=t.sort(function(n,r){return n[e]>r[e]}):t=t.sort()),t}var oO={touchstart:be,touchmove:Ug,touchend:Ae,touchcancel:Te},sO="touchstart touchmove touchend touchcancel",ur=(function(I){ke(e,I);function e(){var t;return e.prototype.evTarget=sO,t=I.apply(this,arguments)||this,t.targetIds={},t}var g=e.prototype;return g.handler=function(A){var C=oO[A.type],i=aO.call(this,A,C);i&&this.callback(this.manager,C,{pointers:i[0],changedPointers:i[1],pointerType:TA,srcEvent:A})},e})(Tt);function aO(I,e){var g=Xt(I.touches),t=this.targetIds;if(e&(be|Ug)&&g.length===1)return t[g[0].identifier]=!0,[g,g];var A,C,i=Xt(I.changedTouches),n=[],r=this.target;if(C=g.filter(function(o){return hr(o.target,r)}),e===be)for(A=0;A<C.length;)t[C[A].identifier]=!0,A++;for(A=0;A<i.length;)t[i[A].identifier]&&n.push(i[A]),e&(Ae|Te)&&delete t[i[A].identifier],A++;if(n.length)return[cr(C.concat(n),"identifier",!0),n]}var dO={mousedown:be,mousemove:Ug,mouseup:Ae},lO="mousedown",hO="mousemove mouseup",fr=(function(I){ke(e,I);function e(){var t,A=e.prototype;return A.evEl=lO,A.evWin=hO,t=I.apply(this,arguments)||this,t.pressed=!1,t}var g=e.prototype;return g.handler=function(A){var C=dO[A.type];C&be&&A.button===0&&(this.pressed=!0),C&Ug&&A.which!==1&&(C=Ae),this.pressed&&(C&Ae&&(this.pressed=!1),this.callback(this.manager,C,{pointers:[A],changedPointers:[A],pointerType:lr,srcEvent:A}))},e})(Tt),cO=2500,ps=25;function ms(I){var e=I.changedPointers,g=e[0];if(g.identifier===this.primaryTouch){var t={x:g.clientX,y:g.clientY},A=this.lastTouches;this.lastTouches.push(t);var C=function(){var n=A.indexOf(t);n>-1&&A.splice(n,1)};setTimeout(C,cO)}}function uO(I,e){I&be?(this.primaryTouch=e.changedPointers[0].identifier,ms.call(this,e)):I&(Ae|Te)&&ms.call(this,e)}function fO(I){for(var e=I.srcEvent.clientX,g=I.srcEvent.clientY,t=0;t<this.lastTouches.length;t++){var A=this.lastTouches[t],C=Math.abs(e-A.x),i=Math.abs(g-A.y);if(C<=ps&&i<=ps)return!0}return!1}var El=(function(){var I=(function(e){ke(g,e);function g(A,C){var i;return i=e.call(this,A,C)||this,i.handler=function(n,r,o){var s=o.pointerType===TA,a=o.pointerType===lr;if(!(a&&o.sourceCapabilities&&o.sourceCapabilities.firesTouchEvents)){if(s)uO.call(KA(KA(i)),r,o);else if(a&&fO.call(KA(KA(i)),o))return;i.callback(n,r,o)}},i.touch=new ur(i.manager,i.handler),i.mouse=new fr(i.manager,i.handler),i.primaryTouch=null,i.lastTouches=[],i}var t=g.prototype;return t.destroy=function(){this.touch.destroy(),this.mouse.destroy()},g})(Tt);return I})();function pO(I){var e,g=I.options.inputClass;return g?e=g:Qx?e=wl:Xx?e=ur:hl?e=El:e=fr,new e(I,iO)}function it(I,e,g){return Array.isArray(I)?(Ag(I,g[e],g),!0):!1}var iI=1,Re=2,ht=4,Tg=8,Ig=Tg,Jt=16,_e=32,mO=1;function vO(){return mO++}function HA(I,e){var g=e.manager;return g?g.get(I):I}function vs(I){return I&Jt?"cancel":I&Tg?"end":I&ht?"move":I&Re?"start":""}var DA=(function(){function I(g){g===void 0&&(g={}),this.options=Ve({enable:!0},g),this.id=vO(),this.manager=null,this.state=iI,this.simultaneous={},this.requireFail=[]}var e=I.prototype;return e.set=function(t){return Gg(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(it(t,"recognizeWith",this))return this;var A=this.simultaneous;return t=HA(t,this),A[t.id]||(A[t.id]=t,t.recognizeWith(this)),this},e.dropRecognizeWith=function(t){return it(t,"dropRecognizeWith",this)?this:(t=HA(t,this),delete this.simultaneous[t.id],this)},e.requireFailure=function(t){if(it(t,"requireFailure",this))return this;var A=this.requireFail;return t=HA(t,this),jg(A,t)===-1&&(A.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(it(t,"dropRequireFailure",this))return this;t=HA(t,this);var A=jg(this.requireFail,t);return A>-1&&this.requireFail.splice(A,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(t){var A=this,C=this.state;function i(n){A.manager.emit(n,t)}C<Tg&&i(A.options.event+vs(C)),i(A.options.event),t.additionalEvent&&i(t.additionalEvent),C>=Tg&&i(A.options.event+vs(C))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=_e},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(_e|iI)))return!1;t++}return!0},e.recognize=function(t){var A=Gg({},t);if(!CC(this.options.enable,[this,A])){this.reset(),this.state=_e;return}this.state&(Ig|Jt|_e)&&(this.state=iI),this.state=this.process(A),this.state&(Re|ht|Tg|Jt)&&this.tryEmit(A)},e.process=function(t){},e.getTouchAction=function(){},e.reset=function(){},I})(),Li=(function(I){ke(e,I);function e(t){var A;return t===void 0&&(t={}),A=I.call(this,Ve({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,A.pTime=!1,A.pCenter=!1,A._timer=null,A._input=null,A.count=0,A}var g=e.prototype;return g.getTouchAction=function(){return[zi]},g.process=function(A){var C=this,i=this.options,n=A.pointers.length===i.pointers,r=A.distance<i.threshold,o=A.deltaTime<i.time;if(this.reset(),A.eventType&be&&this.count===0)return this.failTimeout();if(r&&o&&n){if(A.eventType!==Ae)return this.failTimeout();var s=this.pTime?A.timeStamp-this.pTime<i.interval:!0,a=!this.pCenter||mI(this.pCenter,A.center)<i.posThreshold;this.pTime=A.timeStamp,this.pCenter=A.center,!a||!s?this.count=1:this.count+=1,this._input=A;var d=this.count%i.taps;if(d===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){C.state=Ig,C.tryEmit()},i.interval),Re):Ig}return _e},g.failTimeout=function(){var A=this;return this._timer=setTimeout(function(){A.state=_e},this.options.interval),_e},g.reset=function(){clearTimeout(this._timer)},g.emit=function(){this.state===Ig&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e})(DA),ct=(function(I){ke(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({pointers:1},t))||this}var g=e.prototype;return g.attrTest=function(A){var C=this.options.pointers;return C===0||A.pointers.length===C},g.process=function(A){var C=this.state,i=A.eventType,n=C&(Re|ht),r=this.attrTest(A);return n&&(i&Te||!r)?C|Jt:n||r?i&Ae?C|Tg:C&Re?C|ht:Re:_e},e})(DA);function Tl(I){return I===lt?"down":I===PA?"up":I===xA?"left":I===OA?"right":""}var pr=(function(I){ke(e,I);function e(t){var A;return t===void 0&&(t={}),A=I.call(this,Ve({event:"pan",threshold:10,pointers:1,direction:cl},t))||this,A.pX=null,A.pY=null,A}var g=e.prototype;return g.getTouchAction=function(){var A=this.options.direction,C=[];return A&Qe&&C.push(Ht),A&Lg&&C.push(Ut),C},g.directionTest=function(A){var C=this.options,i=!0,n=A.distance,r=A.direction,o=A.deltaX,s=A.deltaY;return r&C.direction||(C.direction&Qe?(r=o===0?fI:o<0?xA:OA,i=o!==this.pX,n=Math.abs(A.deltaX)):(r=s===0?fI:s<0?PA:lt,i=s!==this.pY,n=Math.abs(A.deltaY))),A.direction=r,i&&n>C.threshold&&r&C.direction},g.attrTest=function(A){return ct.prototype.attrTest.call(this,A)&&(this.state&Re||!(this.state&Re)&&this.directionTest(A))},g.emit=function(A){this.pX=A.deltaX,this.pY=A.deltaY;var C=Tl(A.direction);C&&(A.additionalEvent=this.options.event+C),I.prototype.emit.call(this,A)},e})(ct),xl=(function(I){ke(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({event:"swipe",threshold:10,velocity:.3,direction:Qe|Lg,pointers:1},t))||this}var g=e.prototype;return g.getTouchAction=function(){return pr.prototype.getTouchAction.call(this)},g.attrTest=function(A){var C=this.options.direction,i;return C&(Qe|Lg)?i=A.overallVelocity:C&Qe?i=A.overallVelocityX:C&Lg&&(i=A.overallVelocityY),I.prototype.attrTest.call(this,A)&&C&A.offsetDirection&&A.distance>this.options.threshold&&A.maxPointers===this.options.pointers&&Vg(i)>this.options.velocity&&A.eventType&Ae},g.emit=function(A){var C=Tl(A.offsetDirection);C&&this.manager.emit(this.options.event+C,A),this.manager.emit(this.options.event,A)},e})(ct),Ol=(function(I){ke(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({event:"pinch",threshold:0,pointers:2},t))||this}var g=e.prototype;return g.getTouchAction=function(){return[Zg]},g.attrTest=function(A){return I.prototype.attrTest.call(this,A)&&(Math.abs(A.scale-1)>this.options.threshold||this.state&Re)},g.emit=function(A){if(A.scale!==1){var C=A.scale<1?"in":"out";A.additionalEvent=this.options.event+C}I.prototype.emit.call(this,A)},e})(ct),Pl=(function(I){ke(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({event:"rotate",threshold:0,pointers:2},t))||this}var g=e.prototype;return g.getTouchAction=function(){return[Zg]},g.attrTest=function(A){return I.prototype.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||this.state&Re)},e})(ct),Dl=(function(I){ke(e,I);function e(t){var A;return t===void 0&&(t={}),A=I.call(this,Ve({event:"press",pointers:1,time:251,threshold:9},t))||this,A._timer=null,A._input=null,A}var g=e.prototype;return g.getTouchAction=function(){return[ll]},g.process=function(A){var C=this,i=this.options,n=A.pointers.length===i.pointers,r=A.distance<i.threshold,o=A.deltaTime>i.time;if(this._input=A,!r||!n||A.eventType&(Ae|Te)&&!o)this.reset();else if(A.eventType&be)this.reset(),this._timer=setTimeout(function(){C.state=Ig,C.tryEmit()},i.time);else if(A.eventType&Ae)return Ig;return _e},g.reset=function(){clearTimeout(this._timer)},g.emit=function(A){this.state===Ig&&(A&&A.eventType&Ae?this.manager.emit(this.options.event+"up",A):(this._input.timeStamp=dr(),this.manager.emit(this.options.event,this._input)))},e})(DA),Nl={domEvents:!1,touchAction:dl,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},bs=[[Pl,{enable:!1}],[Ol,{enable:!1},["rotate"]],[xl,{direction:Qe}],[pr,{direction:Qe},["swipe"]],[Li],[Li,{event:"doubletap",taps:2},["tap"]],[Dl]],bO=1,ys=2;function ws(I,e){var g=I.element;if(g.style){var t;Ag(I.options.cssProps,function(A,C){t=IC(g.style,C),e?(I.oldCssProps[t]=g.style[t],g.style[t]=A):g.style[t]=I.oldCssProps[t]||""}),e||(I.oldCssProps={})}}function yO(I,e){var g=document.createEvent("Event");g.initEvent(I,!0,!0),g.gesture=e,e.target.dispatchEvent(g)}var Es=(function(){function I(g,t){var A=this;this.options=Gg({},Nl,t||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=pO(this),this.touchAction=new fl(this,this.options.touchAction),ws(this,!0),Ag(this.options.recognizers,function(C){var i=A.add(new C[0](C[1]));C[2]&&i.recognizeWith(C[2]),C[3]&&i.requireFailure(C[3])},this)}var e=I.prototype;return e.set=function(t){return Gg(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?ys:bO},e.recognize=function(t){var A=this.session;if(!A.stopped){this.touchAction.preventDefaults(t);var C,i=this.recognizers,n=A.curRecognizer;(!n||n&&n.state&Ig)&&(A.curRecognizer=null,n=null);for(var r=0;r<i.length;)C=i[r],A.stopped!==ys&&(!n||C===n||C.canRecognizeWith(n))?C.recognize(t):C.reset(),!n&&C.state&(Re|ht|Tg)&&(A.curRecognizer=C,n=C),r++}},e.get=function(t){if(t instanceof DA)return t;for(var A=this.recognizers,C=0;C<A.length;C++)if(A[C].options.event===t)return A[C];return null},e.add=function(t){if(it(t,"add",this))return this;var A=this.get(t.options.event);return A&&this.remove(A),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},e.remove=function(t){if(it(t,"remove",this))return this;var A=this.get(t);if(t){var C=this.recognizers,i=jg(C,A);i!==-1&&(C.splice(i,1),this.touchAction.update())}return this},e.on=function(t,A){if(t===void 0||A===void 0)return this;var C=this.handlers;return Ag(Qt(t),function(i){C[i]=C[i]||[],C[i].push(A)}),this},e.off=function(t,A){if(t===void 0)return this;var C=this.handlers;return Ag(Qt(t),function(i){A?C[i]&&C[i].splice(jg(C[i],A),1):delete C[i]}),this},e.emit=function(t,A){this.options.domEvents&&yO(t,A);var C=this.handlers[t]&&this.handlers[t].slice();if(!(!C||!C.length)){A.type=t,A.preventDefault=function(){A.srcEvent.preventDefault()};for(var i=0;i<C.length;)C[i](A),i++}},e.destroy=function(){this.element&&ws(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},I})(),wO={touchstart:be,touchmove:Ug,touchend:Ae,touchcancel:Te},EO="touchstart",TO="touchstart touchmove touchend touchcancel",xO=(function(I){ke(e,I);function e(){var t,A=e.prototype;return A.evTarget=EO,A.evWin=TO,t=I.apply(this,arguments)||this,t.started=!1,t}var g=e.prototype;return g.handler=function(A){var C=wO[A.type];if(C===be&&(this.started=!0),!!this.started){var i=OO.call(this,A,C);C&(Ae|Te)&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,C,{pointers:i[0],changedPointers:i[1],pointerType:TA,srcEvent:A})}},e})(Tt);function OO(I,e){var g=Xt(I.touches),t=Xt(I.changedTouches);return e&(Ae|Te)&&(g=cr(g.concat(t),"identifier",!0)),[g,t]}function Rl(I,e,g){var t="DEPRECATED METHOD: "+e+`
632
632
  `+g+` AT
633
- `;return function(){var A=new Error("get-stack-trace"),C=A&&A.stack?A.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",i=window.console&&(window.console.warn||window.console.log);return i&&i.call(window.console,t,C),I.apply(this,arguments)}}var Sl=Rl(function(I,e,g){for(var t=Object.keys(e),A=0;A<t.length;)(!g||g&&I[t[A]]===void 0)&&(I[t[A]]=e[t[A]]),A++;return I},"extend","Use `assign`."),PO=Rl(function(I,e){return Sl(I,e,!0)},"merge","Use `assign`.");function DO(I,e,g){var t=e.prototype,A;A=I.prototype=Object.create(t),A.constructor=I,A._super=t,g&&Gg(A,g)}function Tr(I,e){return function(){return I.apply(e,arguments)}}var kl=function(){var I=function(g,t){return t===void 0&&(t={}),new Er(g,Ve({recognizers:br.concat()},t))};return I.VERSION="2.0.17-rc",I.DIRECTION_ALL=cl,I.DIRECTION_DOWN=lt,I.DIRECTION_LEFT=xA,I.DIRECTION_RIGHT=OA,I.DIRECTION_UP=PA,I.DIRECTION_HORIZONTAL=Qe,I.DIRECTION_VERTICAL=Lg,I.DIRECTION_NONE=fI,I.DIRECTION_DOWN=lt,I.INPUT_START=be,I.INPUT_MOVE=Ug,I.INPUT_END=Ae,I.INPUT_CANCEL=Te,I.STATE_POSSIBLE=iI,I.STATE_BEGAN=Re,I.STATE_CHANGED=ht,I.STATE_ENDED=Eg,I.STATE_RECOGNIZED=Ig,I.STATE_CANCELLED=Jt,I.STATE_FAILED=_e,I.Manager=Er,I.Input=Tt,I.TouchAction=fl,I.TouchInput=fo,I.MouseInput=po,I.PointerEventInput=wl,I.TouchMouseInput=El,I.SingleTouchInput=xO,I.Recognizer=DA,I.AttrRecognizer=ct,I.Tap=Li,I.Pan=mo,I.Swipe=xl,I.Pinch=Ol,I.Rotate=Pl,I.Press=Dl,I.on=Lt,I.off=Gt,I.each=Ag,I.merge=PO,I.extend=Sl,I.bindFn=Tr,I.assign=Gg,I.inherit=DO,I.bindFn=Tr,I.prefixed=IC,I.toArray=Xt,I.inArray=jg,I.uniqueArray=uo,I.splitStr=Qt,I.boolOrFn=CC,I.hasParent=co,I.addEventListeners=Lt,I.removeEventListeners=Gt,I.defaults=Gg({},Nl,{preset:br}),I}();kl.defaults;var NO=kl,Ml=My("DELETE");function RO(I){for(var e=arguments.length,g=new Array(e>1?e-1:0),t=1;t<e;t++)g[t-1]=arguments[t];return Fl({},I,...g)}function Fl(){let I=vI(...arguments);return zl(I),I}function vI(){for(var I=arguments.length,e=new Array(I),g=0;g<I;g++)e[g]=arguments[g];if(e.length<2)return e[0];if(e.length>2)return vI(Fl(e[0],e[1]),...Ze(e).call(e,2));let t=e[0],A=e[1];if(t instanceof Date&&A instanceof Date)return t.setTime(A.getTime()),t;for(let C of h0(A))Object.prototype.propertyIsEnumerable.call(A,C)&&(A[C]===Ml?delete t[C]:t[C]!==null&&A[C]!==null&&typeof t[C]=="object"&&typeof A[C]=="object"&&!B(t[C])&&!B(A[C])?t[C]=vI(t[C],A[C]):t[C]=Bl(A[C]));return t}function Bl(I){return B(I)?ae(I).call(I,e=>Bl(e)):typeof I=="object"&&I!==null?I instanceof Date?new Date(I.getTime()):vI({},I):I}function zl(I){for(let e of U(I))I[e]===Ml?delete I[e]:typeof I[e]=="object"&&I[e]!==null&&zl(I[e])}function iC(){for(var I=arguments.length,e=new Array(I),g=0;g<I;g++)e[g]=arguments[g];return SO(e.length?e:[uI()])}function SO(I){let[e,g,t]=kO(I),A=1,C=()=>{let i=2091639*e+A*23283064365386963e-26;return e=g,g=t,t=i-(A=i|0)};return C.uint32=()=>C()*4294967296,C.fract53=()=>C()+(C()*2097152|0)*11102230246251565e-32,C.algorithm="Alea",C.seed=I,C.version="0.9",C}function kO(){let I=MO(),e=I(" "),g=I(" "),t=I(" ");for(let A=0;A<arguments.length;A++)e-=I(A<0||arguments.length<=A?void 0:arguments[A]),e<0&&(e+=1),g-=I(A<0||arguments.length<=A?void 0:arguments[A]),g<0&&(g+=1),t-=I(A<0||arguments.length<=A?void 0:arguments[A]),t<0&&(t+=1);return[e,g,t]}function MO(){let I=4022871197;return function(e){let g=e.toString();for(let t=0;t<g.length;t++){I+=g.charCodeAt(t);let A=.02519603282416938*I;I=A>>>0,A-=I,A*=I,I=A>>>0,A-=I,I+=A*4294967296}return(I>>>0)*23283064365386963e-26}}function FO(){let I=()=>{};return{on:I,off:I,destroy:I,emit:I,get(){return{set:I}}}}var vo=typeof window!="undefined"?window.Hammer||NO:function(){return FO()};function Ke(I){var e;this._cleanupQueue=[],this.active=!1,this._dom={container:I,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)});let g=vo(this._dom.overlay);g.on("tap",b(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{g.destroy()});let t=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];F(t).call(t,A=>{g.on(A,C=>{C.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=A=>{BO(A.target,I)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=A=>{("key"in A?A.key==="Escape":A.keyCode===27)&&this.deactivate()}}ed(Ke.prototype);Ke.current=null;Ke.prototype.destroy=function(){this.deactivate();for(let g of zg(I=Ue(e=this._cleanupQueue).call(e,0)).call(I)){var I,e;g()}};Ke.prototype.activate=function(){Ke.current&&Ke.current.deactivate(),Ke.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)};Ke.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")};Ke.prototype._onTapOverlay=function(I){this.activate(),I.srcEvent.stopPropagation()};function BO(I,e){for(;I;){if(I===e)return!0;I=I.parentNode}return!1}var zO=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ZO=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,LO=/^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,GO=/^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 ug(I){if(I)for(;I.hasChildNodes()===!0;){let e=I.firstChild;e&&(ug(e),I.removeChild(e))}}function pg(I){return I instanceof String||typeof I=="string"}function xr(I){return typeof I=="object"&&I!==null}function Wg(I,e,g,t){let A=!1;t===!0&&(A=e[g]===null&&I[g]!==void 0),A?delete I[g]:I[g]=e[g]}function Zl(I,e){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(let t in I)if(e[t]!==void 0)if(e[t]===null||typeof e[t]!="object")Wg(I,e,t,g);else{let A=I[t],C=e[t];xr(A)&&xr(C)&&Zl(A,C,g)}}function xt(I,e,g){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(B(g))throw new TypeError("Arrays are not supported by deepExtend");for(let A=0;A<I.length;A++){let C=I[A];if(Object.prototype.hasOwnProperty.call(g,C))if(g[C]&&g[C].constructor===Object)e[C]===void 0&&(e[C]={}),e[C].constructor===Object?_(e[C],g[C],!1,t):Wg(e,g,C,t);else{if(B(g[C]))throw new TypeError("Arrays are not supported by deepExtend");Wg(e,g,C,t)}}return e}function bI(I,e,g){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(B(g))throw new TypeError("Arrays are not supported by deepExtend");for(let A in g)if(Object.prototype.hasOwnProperty.call(g,A)&&!yg(I).call(I,A))if(g[A]&&g[A].constructor===Object)e[A]===void 0&&(e[A]={}),e[A].constructor===Object?_(e[A],g[A]):Wg(e,g,A,t);else if(B(g[A])){e[A]=[];for(let C=0;C<g[A].length;C++)e[A].push(g[A][C])}else Wg(e,g,A,t);return e}function _(I,e){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(let C in e)if(Object.prototype.hasOwnProperty.call(e,C)||g===!0)if(typeof e[C]=="object"&&e[C]!==null&&Cr(e[C])===Object.prototype)I[C]===void 0?I[C]=_({},e[C],g):typeof I[C]=="object"&&I[C]!==null&&Cr(I[C])===Object.prototype?_(I[C],e[C],g):Wg(I,e,C,t);else if(B(e[C])){var A;I[C]=Ze(A=e[C]).call(A)}else Wg(I,e,C,t);return I}function yI(I,e){return[...I,e]}function VO(I){return Ze(I).call(I)}function jO(I){return I.getBoundingClientRect().left}function WO(I){return I.getBoundingClientRect().top}function S(I,e){if(B(I)){let g=I.length;for(let t=0;t<g;t++)e(I[t],t,I)}else for(let g in I)Object.prototype.hasOwnProperty.call(I,g)&&e(I[g],g,I)}function bo(I){let e;switch(I.length){case 3:case 4:return e=ZO.exec(I),e?{r:ze(e[1]+e[1],16),g:ze(e[2]+e[2],16),b:ze(e[3]+e[3],16)}:null;case 6:case 7:return e=zO.exec(I),e?{r:ze(e[1],16),g:ze(e[2],16),b:ze(e[3],16)}:null;default:return null}}function Ne(I,e){if(yg(I).call(I,"rgba"))return I;if(yg(I).call(I,"rgb")){let g=I.substr(G(I).call(I,"(")+1).replace(")","").split(",");return"rgba("+g[0]+","+g[1]+","+g[2]+","+e+")"}else{let g=bo(I);return g==null?I:"rgba("+g.r+","+g.g+","+g.b+","+e+")"}}function Ll(I,e,g){var t;return"#"+Ze(t=((1<<24)+(I<<16)+(e<<8)+g).toString(16)).call(t,1)}function Gi(I,e){if(pg(I)){let t=I;if(Vl(t)){var g;let A=ae(g=t.substr(4).substr(0,t.length-5).split(",")).call(g,function(C){return ze(C)});t=Ll(A[0],A[1],A[2])}if(Gl(t)===!0){let A=YO(t),C={h:A.h,s:A.s*.8,v:Math.min(1,A.v*1.02)},i={h:A.h,s:Math.min(1,A.s*1.25),v:A.v*.8},n=Vi(i.h,i.s,i.v),o=Vi(C.h,C.s,C.v);return{background:t,border:n,highlight:{background:o,border:n},hover:{background:o,border:n}}}else return{background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else return e?{background:I.background||e.background,border:I.border||e.border,highlight:pg(I.highlight)?{border:I.highlight,background:I.highlight}:{background:I.highlight&&I.highlight.background||e.highlight.background,border:I.highlight&&I.highlight.border||e.highlight.border},hover:pg(I.hover)?{border:I.hover,background:I.hover}:{border:I.hover&&I.hover.border||e.hover.border,background:I.hover&&I.hover.background||e.hover.background}}:{background:I.background||void 0,border:I.border||void 0,highlight:pg(I.highlight)?{border:I.highlight,background:I.highlight}:{background:I.highlight&&I.highlight.background||void 0,border:I.highlight&&I.highlight.border||void 0},hover:pg(I.hover)?{border:I.hover,background:I.hover}:{border:I.hover&&I.hover.border||void 0,background:I.hover&&I.hover.background||void 0}}}function Bt(I,e,g){I=I/255,e=e/255,g=g/255;let t=Math.min(I,Math.min(e,g)),A=Math.max(I,Math.max(e,g));if(t===A)return{h:0,s:0,v:t};let C=I===t?e-g:g===t?I-e:g-I,n=60*((I===t?3:g===t?1:5)-C/(A-t))/360,o=(A-t)/A;return{h:n,s:o,v:A}}function nI(I,e,g){let t,A,C,i=Math.floor(I*6),n=I*6-i,o=g*(1-e),s=g*(1-n*e),r=g*(1-(1-n)*e);switch(i%6){case 0:t=g,A=r,C=o;break;case 1:t=s,A=g,C=o;break;case 2:t=o,A=g,C=r;break;case 3:t=o,A=s,C=g;break;case 4:t=r,A=o,C=g;break;case 5:t=g,A=o,C=s;break}return{r:Math.floor(t*255),g:Math.floor(A*255),b:Math.floor(C*255)}}function Vi(I,e,g){let t=nI(I,e,g);return Ll(t.r,t.g,t.b)}function YO(I){let e=bo(I);if(!e)throw new TypeError("'".concat(I,"' is not a valid color."));return Bt(e.r,e.g,e.b)}function Gl(I){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(I)}function Vl(I){return LO.test(I)}function _O(I){return GO.test(I)}function Tg(I){if(I===null||typeof I!="object")return null;if(I instanceof Element)return I;let e=wg(I);for(let g in I)Object.prototype.hasOwnProperty.call(I,g)&&typeof I[g]=="object"&&(e[g]=Tg(I[g]));return e}function De(I,e,g){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},A=function(l){return l!=null},C=function(l){return l!==null&&typeof l=="object"},i=function(l){for(let h in l)if(Object.prototype.hasOwnProperty.call(l,h))return!1;return!0};if(!C(I))throw new Error("Parameter mergeTarget must be an object");if(!C(e))throw new Error("Parameter options must be an object");if(!A(g))throw new Error("Parameter option must have a value");if(!C(t))throw new Error("Parameter globalOptions must be an object");let n=function(l,h,c){C(l[c])||(l[c]={});let p=h[c],u=l[c];for(let m in p)Object.prototype.hasOwnProperty.call(p,m)&&(u[m]=p[m])},o=e[g],r=C(t)&&!i(t)?t[g]:void 0,a=r?r.enabled:void 0;if(o===void 0)return;if(typeof o=="boolean"){C(I[g])||(I[g]={}),I[g].enabled=o;return}if(o===null&&!C(I[g]))if(A(r))I[g]=wg(r);else return;if(!C(o))return;let d=!0;o.enabled!==void 0?d=o.enabled:a!==void 0&&(d=r.enabled),n(I,e,g),I[g].enabled=d}var KO={linear(I){return I},easeInQuad(I){return I*I},easeOutQuad(I){return I*(2-I)},easeInOutQuad(I){return I<.5?2*I*I:-1+(4-2*I)*I},easeInCubic(I){return I*I*I},easeOutCubic(I){return--I*I*I+1},easeInOutCubic(I){return I<.5?4*I*I*I:(I-1)*(2*I-2)*(2*I-2)+1},easeInQuart(I){return I*I*I*I},easeOutQuart(I){return 1- --I*I*I*I},easeInOutQuart(I){return I<.5?8*I*I*I*I:1-8*--I*I*I*I},easeInQuint(I){return I*I*I*I*I},easeOutQuint(I){return 1+--I*I*I*I*I},easeInOutQuint(I){return I<.5?16*I*I*I*I*I:1+16*--I*I*I*I*I}};function fg(I,e){let g;B(e)||(e=[e]);for(let t of I)if(t){g=t[e[0]];for(let A=1;A<e.length;A++)g&&(g=g[e[A]]);if(typeof g!="undefined")break}return g}var UO={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"},HO=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.pixelRatio=e,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},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(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(e){if(typeof e=="function")this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}setCloseCallback(e){if(typeof e=="function")this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}_isColorString(e){if(typeof e=="string")return UO[e]}setColor(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==="none")return;let t,A=this._isColorString(e);if(A!==void 0&&(e=A),pg(e)===!0){if(Vl(e)===!0){let C=e.substr(4).substr(0,e.length-5).split(",");t={r:C[0],g:C[1],b:C[2],a:1}}else if(_O(e)===!0){let C=e.substr(5).substr(0,e.length-6).split(",");t={r:C[0],g:C[1],b:C[2],a:C[3]}}else if(Gl(e)===!0){let C=bo(e);t={r:C.r,g:C.g,b:C.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){let C=e.a!==void 0?e.a:"1.0";t={r:e.r,g:e.g,b:e.b,a:C}}if(t===void 0)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: "+Et(e));this._setColor(t,g)}show(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0&&(this.previousColor=q({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",He(()=>{this.closeCallback!==void 0&&(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(){this.previousColor!==void 0?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)===!0&&(this.initialColor=q({},e)),this.color=e;let t=Bt(e.r,e.g,e.b),A=2*Math.PI,C=this.r*t.s,i=this.centerCoordinates.x+C*Math.sin(A*t.h),n=this.centerCoordinates.y+C*Math.cos(A*t.h);this.colorPickerSelector.style.left=i-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=n-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}_setOpacity(e){this.color.a=e/100,this._updatePicker(this.color)}_setBrightness(e){let g=Bt(this.color.r,this.color.g,this.color.b);g.v=e/100;let t=nI(g.h,g.s,g.v);t.a=this.color.a,this.color=t,this._updatePicker()}_updatePicker(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color,g=Bt(e.r,e.g,e.b),t=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let A=this.colorPickerCanvas.clientWidth,C=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,A,C),t.putImageData(this.hueCircle,0,0),t.fillStyle="rgba(0,0,0,"+(1-g.v)+")",t.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),EA(t).call(t),this.brightnessRange.value=100*g.v,this.opacityRange.value=100*e.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 e,g,t,A;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){let i=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{let i=document.createElement("DIV");i.style.color="red",i.style.fontWeight="bold",i.style.padding="10px",i.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(i)}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(i){}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(i){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);let C=this;this.opacityRange.onchange=function(){C._setOpacity(this.value)},this.opacityRange.oninput=function(){C._setOpacity(this.value)},this.brightnessRange.onchange=function(){C._setBrightness(this.value)},this.brightnessRange.oninput=function(){C._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=b(e=this._hide).call(e,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=b(g=this._apply).call(g,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=b(t=this._save).call(t,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=b(A=this._loadLast).call(A,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 vo(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",e=>{e.isFirst&&this._moveSelector(e)}),this.hammer.on("tap",e=>{this._moveSelector(e)}),this.hammer.on("panstart",e=>{this._moveSelector(e)}),this.hammer.on("panmove",e=>{this._moveSelector(e)}),this.hammer.on("panend",e=>{this._moveSelector(e)})}_generateHueCircle(){if(this.generated===!1){let e=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let g=this.colorPickerCanvas.clientWidth,t=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,g,t);let A,C,i,n;this.centerCoordinates={x:g*.5,y:t*.5},this.r=.49*g;let o=2*Math.PI/360,s=1/360,r=1/this.r,a;for(i=0;i<360;i++)for(n=0;n<this.r;n++)A=this.centerCoordinates.x+n*Math.sin(o*i),C=this.centerCoordinates.y+n*Math.cos(o*i),a=nI(i*s,n*r,1),e.fillStyle="rgb("+a.r+","+a.g+","+a.b+")",e.fillRect(A-.5,C-.5,2,2);e.strokeStyle="rgba(0,0,0,1)",e.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),e.stroke(),this.hueCircle=e.getImageData(0,0,g,t)}this.generated=!0}_moveSelector(e){let g=this.colorPickerDiv.getBoundingClientRect(),t=e.center.x-g.left,A=e.center.y-g.top,C=.5*this.colorPickerDiv.clientHeight,i=.5*this.colorPickerDiv.clientWidth,n=t-i,o=A-C,s=Math.atan2(n,o),r=.98*Math.min(Math.sqrt(n*n+o*o),i),a=Math.cos(s)*r+C,d=Math.sin(s)*r+i;this.colorPickerSelector.style.top=a-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=d-.5*this.colorPickerSelector.clientWidth+"px";let l=s/(2*Math.PI);l=l<0?l+1:l;let h=r/this.r,c=Bt(this.color.r,this.color.g,this.color.b);c.h=l,c.s=h;let p=nI(c.h,c.s,c.v);p.a=this.color.a,this.color=p,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+")"}};function ji(){for(var I=arguments.length,e=new Array(I),g=0;g<I;g++)e[g]=arguments[g];if(e.length<1)throw new TypeError("Invalid arguments.");if(e.length===1)return document.createTextNode(e[0]);{let t=document.createElement(e[0]);return t.appendChild(ji(...Ze(e).call(e,1))),t}}var QO=class{constructor(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:()=>!1;this.parent=e,this.changedOptions=[],this.container=g,this.allowCreation=!1,this.hideOption=C,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},q(this.options,this.defaultOptions),this.configureOptions=t,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new HO(A),this.wrapper=void 0}setOptions(e){if(e!==void 0){this.popupHistory={},this._removePopup();let g=!0;if(typeof e=="string")this.options.filter=e;else if(B(e))this.options.filter=e.join();else if(typeof e=="object"){if(e==null)throw new TypeError("options cannot be null");e.container!==void 0&&(this.options.container=e.container),te(e)!==void 0&&(this.options.filter=te(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(g=e.enabled)}else typeof e=="boolean"?(this.options.filter=!0,g=e):typeof e=="function"&&(this.options.filter=e,g=!0);te(this.options)===!1&&(g=!1),this.options.enabled=g}this._clean()}setModuleOptions(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];let e=te(this.options),g=0,t=!1;for(let A in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,A)&&(this.allowCreation=!1,t=!1,typeof e=="function"?(t=e(A,[]),t=t||this._handleObject(this.configureOptions[A],[A],!0)):(e===!0||G(e).call(e,A)!==-1)&&(t=!0),t!==!1&&(this.allowCreation=!0,g>0&&this._makeItem([]),this._makeHeader(A),this._handleObject(this.configureOptions[A],[A])),g++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let e=0;e<this.domElements.length;e++)this.wrapper.appendChild(this.domElements[e]);this._showPopupIfNeeded()}_clean(){for(let e=0;e<this.domElements.length;e++)this.wrapper.removeChild(this.domElements[e]);this.wrapper!==void 0&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}_getValue(e){let g=this.moduleOptions;for(let t=0;t<e.length;t++)if(g[e[t]]!==void 0)g=g[e[t]];else{g=void 0;break}return g}_makeItem(e){if(this.allowCreation===!0){let C=document.createElement("div");C.className="vis-configuration vis-config-item vis-config-s"+e.length;for(var g=arguments.length,t=new Array(g>1?g-1:0),A=1;A<g;A++)t[A-1]=arguments[A];return F(t).call(t,i=>{C.appendChild(i)}),this.domElements.push(C),this.domElements.length}return 0}_makeHeader(e){let g=document.createElement("div");g.className="vis-configuration vis-config-header",g.innerText=e,this._makeItem([],g)}_makeLabel(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=document.createElement("div");if(A.className="vis-configuration vis-config-label vis-config-s"+g.length,t===!0){for(;A.firstChild;)A.removeChild(A.firstChild);A.appendChild(ji("i","b",e))}else A.innerText=e+":";return A}_makeDropdown(e,g,t){let A=document.createElement("select");A.className="vis-configuration vis-config-select";let C=0;g!==void 0&&G(e).call(e,g)!==-1&&(C=G(e).call(e,g));for(let o=0;o<e.length;o++){let s=document.createElement("option");s.value=e[o],o===C&&(s.selected="selected"),s.innerText=e[o],A.appendChild(s)}let i=this;A.onchange=function(){i._update(this.value,t)};let n=this._makeLabel(t[t.length-1],t);this._makeItem(t,n,A)}_makeRange(e,g,t){let A=e[0],C=e[1],i=e[2],n=e[3],o=document.createElement("input");o.className="vis-configuration vis-config-range";try{o.type="range",o.min=C,o.max=i}catch(c){}o.step=n;let s="",r=0;g!==void 0?(g<0&&g*1.2<C?(o.min=Math.ceil(g*1.2),r=o.min,s="range increased"):g/1.2<C&&(o.min=Math.ceil(g/1.2),r=o.min,s="range increased"),g*1.2>i&&i!==1&&(o.max=Math.ceil(g*1.2),r=o.max,s="range increased"),o.value=g):o.value=A;let a=document.createElement("input");a.className="vis-configuration vis-config-rangeinput",a.value=o.value;let d=this;o.onchange=function(){a.value=this.value,d._update(Number(this.value),t)},o.oninput=function(){a.value=this.value};let l=this._makeLabel(t[t.length-1],t),h=this._makeItem(t,l,o,a);s!==""&&this.popupHistory[h]!==r&&(this.popupHistory[h]=r,this._setupPopup(s,h))}_makeButton(){if(this.options.showButton===!0){let e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerText="generate options",e.onclick=()=>{this._printOptions()},e.onmouseover=()=>{e.className="vis-configuration vis-config-button hover"},e.onmouseout=()=>{e.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(e)}}_setupPopup(e,g){if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){let t=document.createElement("div");t.id="vis-configuration-popup",t.className="vis-configuration-popup",t.innerText=e,t.onclick=()=>{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:t,index:g}}}_removePopup(){this.popupDiv.html!==void 0&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(this.popupDiv.html!==void 0){let 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=He(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=He(()=>{this._removePopup()},1800)}}_makeCheckbox(e,g,t){let A=document.createElement("input");A.type="checkbox",A.className="vis-configuration vis-config-checkbox",A.checked=e,g!==void 0&&(A.checked=g,g!==e&&(typeof e=="object"?g!==e.enabled&&this.changedOptions.push({path:t,value:g}):this.changedOptions.push({path:t,value:g})));let C=this;A.onchange=function(){C._update(this.checked,t)};let i=this._makeLabel(t[t.length-1],t);this._makeItem(t,i,A)}_makeTextInput(e,g,t){let A=document.createElement("input");A.type="text",A.className="vis-configuration vis-config-text",A.value=g,g!==e&&this.changedOptions.push({path:t,value:g});let C=this;A.onchange=function(){C._update(this.value,t)};let i=this._makeLabel(t[t.length-1],t);this._makeItem(t,i,A)}_makeColorField(e,g,t){let A=e[1],C=document.createElement("div");g=g===void 0?A:g,g!=="none"?(C.className="vis-configuration vis-config-colorBlock",C.style.backgroundColor=g):C.className="vis-configuration vis-config-colorBlock none",g=g===void 0?A:g,C.onclick=()=>{this._showColorPicker(g,C,t)};let i=this._makeLabel(t[t.length-1],t);this._makeItem(t,i,C)}_showColorPicker(e,g,t){g.onclick=function(){},this.colorPicker.insertTo(g),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(A=>{let C="rgba("+A.r+","+A.g+","+A.b+","+A.a+")";g.style.backgroundColor=C,this._update(C,t)}),this.colorPicker.setCloseCallback(()=>{g.onclick=()=>{this._showColorPicker(e,g,t)}})}_handleObject(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=!1,C=te(this.options),i=!1;for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){A=!0;let o=e[n],s=yI(g,n);if(typeof C=="function"&&(A=C(n,g),A===!1&&!B(o)&&typeof o!="string"&&typeof o!="boolean"&&o instanceof Object&&(this.allowCreation=!1,A=this._handleObject(o,s,!0),this.allowCreation=t===!1)),A!==!1){i=!0;let r=this._getValue(s);if(B(o))this._handleArray(o,r,s);else if(typeof o=="string")this._makeTextInput(o,r,s);else if(typeof o=="boolean")this._makeCheckbox(o,r,s);else if(o instanceof Object){if(!this.hideOption(g,n,this.moduleOptions))if(o.enabled!==void 0){let a=yI(s,"enabled"),d=this._getValue(a);if(d===!0){let l=this._makeLabel(n,s,!0);this._makeItem(s,l),i=this._handleObject(o,s)||i}else this._makeCheckbox(o,d,s)}else{let a=this._makeLabel(n,s,!0);this._makeItem(s,a),i=this._handleObject(o,s)||i}}else console.error("dont know how to handle",o,n,s)}}return i}_handleArray(e,g,t){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,g,t),e[1]!==g&&this.changedOptions.push({path:t,value:g})):typeof e[0]=="string"?(this._makeDropdown(e,g,t),e[0]!==g&&this.changedOptions.push({path:t,value:g})):typeof e[0]=="number"&&(this._makeRange(e,g,t),e[0]!==g&&this.changedOptions.push({path:t,value:Number(g)}))}_update(e,g){let t=this._constructOptions(e,g);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",t),this.initialized=!0,this.parent.setOptions(t)}_constructOptions(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=t;e=e==="true"?!0:e,e=e==="false"?!1:e;for(let C=0;C<g.length;C++)g[C]!=="global"&&(A[g[C]]===void 0&&(A[g[C]]={}),C!==g.length-1?A=A[g[C]]:A[g[C]]=e);return t}_printOptions(){let e=this.getOptions();for(;this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(ji("pre","const options = "+Et(e,null,2)))}getOptions(){let e={};for(let g=0;g<this.changedOptions.length;g++)this._constructOptions(this.changedOptions[g].value,this.changedOptions[g].path,e);return e}},XO=class{constructor(e,g){this.container=e,this.overflowMethod=g||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}setPosition(e,g){this.x=ze(e),this.y=ze(g)}setText(e){if(e instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(e)}else this.frame.innerText=e}show(e){if(e===void 0&&(e=!0),e===!0){let g=this.frame.clientHeight,t=this.frame.clientWidth,A=this.frame.parentNode.clientHeight,C=this.frame.parentNode.clientWidth,i=0,n=0;if(this.overflowMethod=="flip"){let o=!1,s=!0;this.y-g<this.padding&&(s=!1),this.x+t>C-this.padding&&(o=!0),o?i=this.x-t:i=this.x,s?n=this.y-g:n=this.y}else n=this.y-g,n+g+this.padding>A&&(n=A-g-this.padding),n<this.padding&&(n=this.padding),i=this.x,i+t+this.padding>C&&(i=C-t-this.padding),i<this.padding&&(i=this.padding);this.frame.style.left=i+"px",this.frame.style.top=n+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}hide(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}destroy(){this.frame.parentNode.removeChild(this.frame)}},Nt=!1,Or,Wi="background: #FFeeee; color: #dd0000",JO=class Q{static validate(e,g,t){Nt=!1,Or=g;let A=g;return t!==void 0&&(A=g[t]),Q.parse(e,A,[]),Nt}static parse(e,g,t){for(let A in e)Object.prototype.hasOwnProperty.call(e,A)&&Q.check(A,e,g,t)}static check(e,g,t,A){if(t[e]===void 0&&t.__any__===void 0){Q.getSuggestion(e,t,A);return}let C=e,i=!0;t[e]===void 0&&t.__any__!==void 0&&(C="__any__",i=Q.getType(g[e])==="object");let n=t[C];i&&n.__type__!==void 0&&(n=n.__type__),Q.checkFields(e,g,t,C,n,A)}static checkFields(e,g,t,A,C,i){let n=function(r){console.error("%c"+r+Q.printLocation(i,e),Wi)},o=Q.getType(g[e]),s=C[o];s!==void 0?Q.getType(s)==="array"&&G(s).call(s,g[e])===-1?(n('Invalid option detected in "'+e+'". Allowed values are:'+Q.print(s)+' not "'+g[e]+'". '),Nt=!0):o==="object"&&A!=="__any__"&&(i=yI(i,e),Q.parse(g[e],t[A],i)):C.any===void 0&&(n('Invalid type received for "'+e+'". Expected: '+Q.print(U(C))+". Received ["+o+'] "'+g[e]+'"'),Nt=!0)}static getType(e){let g=typeof e;return g==="object"?e===null?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":B(e)?"array":e instanceof Date?"date":e.nodeType!==void 0?"dom":e._isAMomentObject===!0?"moment":"object":g==="number"?"number":g==="boolean"?"boolean":g==="string"?"string":g===void 0?"undefined":g}static getSuggestion(e,g,t){let A=Q.findInOptions(e,g,t,!1),C=Q.findInOptions(e,Or,[],!0),i=8,n=4,o;A.indexMatch!==void 0?o=" in "+Q.printLocation(A.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+A.indexMatch+`"?
633
+ `;return function(){var A=new Error("get-stack-trace"),C=A&&A.stack?A.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",i=window.console&&(window.console.warn||window.console.log);return i&&i.call(window.console,t,C),I.apply(this,arguments)}}var Sl=Rl(function(I,e,g){for(var t=Object.keys(e),A=0;A<t.length;)(!g||g&&I[t[A]]===void 0)&&(I[t[A]]=e[t[A]]),A++;return I},"extend","Use `assign`."),PO=Rl(function(I,e){return Sl(I,e,!0)},"merge","Use `assign`.");function DO(I,e,g){var t=e.prototype,A;A=I.prototype=Object.create(t),A.constructor=I,A._super=t,g&&Gg(A,g)}function Ts(I,e){return function(){return I.apply(e,arguments)}}var kl=(function(){var I=function(g,t){return t===void 0&&(t={}),new Es(g,Ve({recognizers:bs.concat()},t))};return I.VERSION="2.0.17-rc",I.DIRECTION_ALL=cl,I.DIRECTION_DOWN=lt,I.DIRECTION_LEFT=xA,I.DIRECTION_RIGHT=OA,I.DIRECTION_UP=PA,I.DIRECTION_HORIZONTAL=Qe,I.DIRECTION_VERTICAL=Lg,I.DIRECTION_NONE=fI,I.DIRECTION_DOWN=lt,I.INPUT_START=be,I.INPUT_MOVE=Ug,I.INPUT_END=Ae,I.INPUT_CANCEL=Te,I.STATE_POSSIBLE=iI,I.STATE_BEGAN=Re,I.STATE_CHANGED=ht,I.STATE_ENDED=Tg,I.STATE_RECOGNIZED=Ig,I.STATE_CANCELLED=Jt,I.STATE_FAILED=_e,I.Manager=Es,I.Input=Tt,I.TouchAction=fl,I.TouchInput=ur,I.MouseInput=fr,I.PointerEventInput=wl,I.TouchMouseInput=El,I.SingleTouchInput=xO,I.Recognizer=DA,I.AttrRecognizer=ct,I.Tap=Li,I.Pan=pr,I.Swipe=xl,I.Pinch=Ol,I.Rotate=Pl,I.Press=Dl,I.on=Lt,I.off=Gt,I.each=Ag,I.merge=PO,I.extend=Sl,I.bindFn=Ts,I.assign=Gg,I.inherit=DO,I.bindFn=Ts,I.prefixed=IC,I.toArray=Xt,I.inArray=jg,I.uniqueArray=cr,I.splitStr=Qt,I.boolOrFn=CC,I.hasParent=hr,I.addEventListeners=Lt,I.removeEventListeners=Gt,I.defaults=Gg({},Nl,{preset:bs}),I})();kl.defaults;var NO=kl,Ml=My("DELETE");function RO(I){for(var e=arguments.length,g=new Array(e>1?e-1:0),t=1;t<e;t++)g[t-1]=arguments[t];return Fl({},I,...g)}function Fl(){let I=vI(...arguments);return zl(I),I}function vI(){for(var I=arguments.length,e=new Array(I),g=0;g<I;g++)e[g]=arguments[g];if(e.length<2)return e[0];if(e.length>2)return vI(Fl(e[0],e[1]),...Ze(e).call(e,2));let t=e[0],A=e[1];if(t instanceof Date&&A instanceof Date)return t.setTime(A.getTime()),t;for(let C of h0(A))Object.prototype.propertyIsEnumerable.call(A,C)&&(A[C]===Ml?delete t[C]:t[C]!==null&&A[C]!==null&&typeof t[C]=="object"&&typeof A[C]=="object"&&!B(t[C])&&!B(A[C])?t[C]=vI(t[C],A[C]):t[C]=Bl(A[C]));return t}function Bl(I){return B(I)?ae(I).call(I,e=>Bl(e)):typeof I=="object"&&I!==null?I instanceof Date?new Date(I.getTime()):vI({},I):I}function zl(I){for(let e of U(I))I[e]===Ml?delete I[e]:typeof I[e]=="object"&&I[e]!==null&&zl(I[e])}function iC(){for(var I=arguments.length,e=new Array(I),g=0;g<I;g++)e[g]=arguments[g];return SO(e.length?e:[uI()])}function SO(I){let[e,g,t]=kO(I),A=1,C=()=>{let i=2091639*e+A*23283064365386963e-26;return e=g,g=t,t=i-(A=i|0)};return C.uint32=()=>C()*4294967296,C.fract53=()=>C()+(C()*2097152|0)*11102230246251565e-32,C.algorithm="Alea",C.seed=I,C.version="0.9",C}function kO(){let I=MO(),e=I(" "),g=I(" "),t=I(" ");for(let A=0;A<arguments.length;A++)e-=I(A<0||arguments.length<=A?void 0:arguments[A]),e<0&&(e+=1),g-=I(A<0||arguments.length<=A?void 0:arguments[A]),g<0&&(g+=1),t-=I(A<0||arguments.length<=A?void 0:arguments[A]),t<0&&(t+=1);return[e,g,t]}function MO(){let I=4022871197;return function(e){let g=e.toString();for(let t=0;t<g.length;t++){I+=g.charCodeAt(t);let A=.02519603282416938*I;I=A>>>0,A-=I,A*=I,I=A>>>0,A-=I,I+=A*4294967296}return(I>>>0)*23283064365386963e-26}}function FO(){let I=()=>{};return{on:I,off:I,destroy:I,emit:I,get(){return{set:I}}}}var mr=typeof window!="undefined"?window.Hammer||NO:function(){return FO()};function Ke(I){var e;this._cleanupQueue=[],this.active=!1,this._dom={container:I,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)});let g=mr(this._dom.overlay);g.on("tap",b(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{g.destroy()});let t=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];F(t).call(t,A=>{g.on(A,C=>{C.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=A=>{BO(A.target,I)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=A=>{("key"in A?A.key==="Escape":A.keyCode===27)&&this.deactivate()}}ed(Ke.prototype);Ke.current=null;Ke.prototype.destroy=function(){this.deactivate();for(let g of zg(I=Ue(e=this._cleanupQueue).call(e,0)).call(I)){var I,e;g()}};Ke.prototype.activate=function(){Ke.current&&Ke.current.deactivate(),Ke.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)};Ke.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")};Ke.prototype._onTapOverlay=function(I){this.activate(),I.srcEvent.stopPropagation()};function BO(I,e){for(;I;){if(I===e)return!0;I=I.parentNode}return!1}var zO=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ZO=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,LO=/^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,GO=/^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 fg(I){if(I)for(;I.hasChildNodes()===!0;){let e=I.firstChild;e&&(fg(e),I.removeChild(e))}}function mg(I){return I instanceof String||typeof I=="string"}function xs(I){return typeof I=="object"&&I!==null}function Yg(I,e,g,t){let A=!1;t===!0&&(A=e[g]===null&&I[g]!==void 0),A?delete I[g]:I[g]=e[g]}function Zl(I,e){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(let t in I)if(e[t]!==void 0)if(e[t]===null||typeof e[t]!="object")Yg(I,e,t,g);else{let A=I[t],C=e[t];xs(A)&&xs(C)&&Zl(A,C,g)}}function xt(I,e,g){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(B(g))throw new TypeError("Arrays are not supported by deepExtend");for(let A=0;A<I.length;A++){let C=I[A];if(Object.prototype.hasOwnProperty.call(g,C))if(g[C]&&g[C].constructor===Object)e[C]===void 0&&(e[C]={}),e[C].constructor===Object?_(e[C],g[C],!1,t):Yg(e,g,C,t);else{if(B(g[C]))throw new TypeError("Arrays are not supported by deepExtend");Yg(e,g,C,t)}}return e}function bI(I,e,g){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(B(g))throw new TypeError("Arrays are not supported by deepExtend");for(let A in g)if(Object.prototype.hasOwnProperty.call(g,A)&&!wg(I).call(I,A))if(g[A]&&g[A].constructor===Object)e[A]===void 0&&(e[A]={}),e[A].constructor===Object?_(e[A],g[A]):Yg(e,g,A,t);else if(B(g[A])){e[A]=[];for(let C=0;C<g[A].length;C++)e[A].push(g[A][C])}else Yg(e,g,A,t);return e}function _(I,e){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(let C in e)if(Object.prototype.hasOwnProperty.call(e,C)||g===!0)if(typeof e[C]=="object"&&e[C]!==null&&Cs(e[C])===Object.prototype)I[C]===void 0?I[C]=_({},e[C],g):typeof I[C]=="object"&&I[C]!==null&&Cs(I[C])===Object.prototype?_(I[C],e[C],g):Yg(I,e,C,t);else if(B(e[C])){var A;I[C]=Ze(A=e[C]).call(A)}else Yg(I,e,C,t);return I}function yI(I,e){return[...I,e]}function VO(I){return Ze(I).call(I)}function jO(I){return I.getBoundingClientRect().left}function YO(I){return I.getBoundingClientRect().top}function S(I,e){if(B(I)){let g=I.length;for(let t=0;t<g;t++)e(I[t],t,I)}else for(let g in I)Object.prototype.hasOwnProperty.call(I,g)&&e(I[g],g,I)}function vr(I){let e;switch(I.length){case 3:case 4:return e=ZO.exec(I),e?{r:ze(e[1]+e[1],16),g:ze(e[2]+e[2],16),b:ze(e[3]+e[3],16)}:null;case 6:case 7:return e=zO.exec(I),e?{r:ze(e[1],16),g:ze(e[2],16),b:ze(e[3],16)}:null;default:return null}}function Ne(I,e){if(wg(I).call(I,"rgba"))return I;if(wg(I).call(I,"rgb")){let g=I.substr(G(I).call(I,"(")+1).replace(")","").split(",");return"rgba("+g[0]+","+g[1]+","+g[2]+","+e+")"}else{let g=vr(I);return g==null?I:"rgba("+g.r+","+g.g+","+g.b+","+e+")"}}function Ll(I,e,g){var t;return"#"+Ze(t=((1<<24)+(I<<16)+(e<<8)+g).toString(16)).call(t,1)}function Gi(I,e){if(mg(I)){let t=I;if(Vl(t)){var g;let A=ae(g=t.substr(4).substr(0,t.length-5).split(",")).call(g,function(C){return ze(C)});t=Ll(A[0],A[1],A[2])}if(Gl(t)===!0){let A=WO(t),C={h:A.h,s:A.s*.8,v:Math.min(1,A.v*1.02)},i={h:A.h,s:Math.min(1,A.s*1.25),v:A.v*.8},n=Vi(i.h,i.s,i.v),r=Vi(C.h,C.s,C.v);return{background:t,border:n,highlight:{background:r,border:n},hover:{background:r,border:n}}}else return{background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else return e?{background:I.background||e.background,border:I.border||e.border,highlight:mg(I.highlight)?{border:I.highlight,background:I.highlight}:{background:I.highlight&&I.highlight.background||e.highlight.background,border:I.highlight&&I.highlight.border||e.highlight.border},hover:mg(I.hover)?{border:I.hover,background:I.hover}:{border:I.hover&&I.hover.border||e.hover.border,background:I.hover&&I.hover.background||e.hover.background}}:{background:I.background||void 0,border:I.border||void 0,highlight:mg(I.highlight)?{border:I.highlight,background:I.highlight}:{background:I.highlight&&I.highlight.background||void 0,border:I.highlight&&I.highlight.border||void 0},hover:mg(I.hover)?{border:I.hover,background:I.hover}:{border:I.hover&&I.hover.border||void 0,background:I.hover&&I.hover.background||void 0}}}function Bt(I,e,g){I=I/255,e=e/255,g=g/255;let t=Math.min(I,Math.min(e,g)),A=Math.max(I,Math.max(e,g));if(t===A)return{h:0,s:0,v:t};let C=I===t?e-g:g===t?I-e:g-I,n=60*((I===t?3:g===t?1:5)-C/(A-t))/360,r=(A-t)/A;return{h:n,s:r,v:A}}function nI(I,e,g){let t,A,C,i=Math.floor(I*6),n=I*6-i,r=g*(1-e),o=g*(1-n*e),s=g*(1-(1-n)*e);switch(i%6){case 0:t=g,A=s,C=r;break;case 1:t=o,A=g,C=r;break;case 2:t=r,A=g,C=s;break;case 3:t=r,A=o,C=g;break;case 4:t=s,A=r,C=g;break;case 5:t=g,A=r,C=o;break}return{r:Math.floor(t*255),g:Math.floor(A*255),b:Math.floor(C*255)}}function Vi(I,e,g){let t=nI(I,e,g);return Ll(t.r,t.g,t.b)}function WO(I){let e=vr(I);if(!e)throw new TypeError("'".concat(I,"' is not a valid color."));return Bt(e.r,e.g,e.b)}function Gl(I){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(I)}function Vl(I){return LO.test(I)}function _O(I){return GO.test(I)}function xg(I){if(I===null||typeof I!="object")return null;if(I instanceof Element)return I;let e=Eg(I);for(let g in I)Object.prototype.hasOwnProperty.call(I,g)&&typeof I[g]=="object"&&(e[g]=xg(I[g]));return e}function De(I,e,g){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},A=function(l){return l!=null},C=function(l){return l!==null&&typeof l=="object"},i=function(l){for(let h in l)if(Object.prototype.hasOwnProperty.call(l,h))return!1;return!0};if(!C(I))throw new Error("Parameter mergeTarget must be an object");if(!C(e))throw new Error("Parameter options must be an object");if(!A(g))throw new Error("Parameter option must have a value");if(!C(t))throw new Error("Parameter globalOptions must be an object");let n=function(l,h,c){C(l[c])||(l[c]={});let p=h[c],u=l[c];for(let m in p)Object.prototype.hasOwnProperty.call(p,m)&&(u[m]=p[m])},r=e[g],s=C(t)&&!i(t)?t[g]:void 0,a=s?s.enabled:void 0;if(r===void 0)return;if(typeof r=="boolean"){C(I[g])||(I[g]={}),I[g].enabled=r;return}if(r===null&&!C(I[g]))if(A(s))I[g]=Eg(s);else return;if(!C(r))return;let d=!0;r.enabled!==void 0?d=r.enabled:a!==void 0&&(d=s.enabled),n(I,e,g),I[g].enabled=d}var KO={linear(I){return I},easeInQuad(I){return I*I},easeOutQuad(I){return I*(2-I)},easeInOutQuad(I){return I<.5?2*I*I:-1+(4-2*I)*I},easeInCubic(I){return I*I*I},easeOutCubic(I){return--I*I*I+1},easeInOutCubic(I){return I<.5?4*I*I*I:(I-1)*(2*I-2)*(2*I-2)+1},easeInQuart(I){return I*I*I*I},easeOutQuart(I){return 1- --I*I*I*I},easeInOutQuart(I){return I<.5?8*I*I*I*I:1-8*--I*I*I*I},easeInQuint(I){return I*I*I*I*I},easeOutQuint(I){return 1+--I*I*I*I*I},easeInOutQuint(I){return I<.5?16*I*I*I*I*I:1+16*--I*I*I*I*I}};function pg(I,e){let g;B(e)||(e=[e]);for(let t of I)if(t){g=t[e[0]];for(let A=1;A<e.length;A++)g&&(g=g[e[A]]);if(typeof g!="undefined")break}return g}var UO={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"},HO=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.pixelRatio=e,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},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(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(e){if(typeof e=="function")this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}setCloseCallback(e){if(typeof e=="function")this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}_isColorString(e){if(typeof e=="string")return UO[e]}setColor(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==="none")return;let t,A=this._isColorString(e);if(A!==void 0&&(e=A),mg(e)===!0){if(Vl(e)===!0){let C=e.substr(4).substr(0,e.length-5).split(",");t={r:C[0],g:C[1],b:C[2],a:1}}else if(_O(e)===!0){let C=e.substr(5).substr(0,e.length-6).split(",");t={r:C[0],g:C[1],b:C[2],a:C[3]}}else if(Gl(e)===!0){let C=vr(e);t={r:C.r,g:C.g,b:C.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){let C=e.a!==void 0?e.a:"1.0";t={r:e.r,g:e.g,b:e.b,a:C}}if(t===void 0)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: "+Et(e));this._setColor(t,g)}show(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0&&(this.previousColor=q({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",He(()=>{this.closeCallback!==void 0&&(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(){this.previousColor!==void 0?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)===!0&&(this.initialColor=q({},e)),this.color=e;let t=Bt(e.r,e.g,e.b),A=2*Math.PI,C=this.r*t.s,i=this.centerCoordinates.x+C*Math.sin(A*t.h),n=this.centerCoordinates.y+C*Math.cos(A*t.h);this.colorPickerSelector.style.left=i-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=n-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}_setOpacity(e){this.color.a=e/100,this._updatePicker(this.color)}_setBrightness(e){let g=Bt(this.color.r,this.color.g,this.color.b);g.v=e/100;let t=nI(g.h,g.s,g.v);t.a=this.color.a,this.color=t,this._updatePicker()}_updatePicker(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color,g=Bt(e.r,e.g,e.b),t=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let A=this.colorPickerCanvas.clientWidth,C=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,A,C),t.putImageData(this.hueCircle,0,0),t.fillStyle="rgba(0,0,0,"+(1-g.v)+")",t.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),EA(t).call(t),this.brightnessRange.value=100*g.v,this.opacityRange.value=100*e.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 e,g,t,A;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){let i=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{let i=document.createElement("DIV");i.style.color="red",i.style.fontWeight="bold",i.style.padding="10px",i.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(i)}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(i){}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(i){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);let C=this;this.opacityRange.onchange=function(){C._setOpacity(this.value)},this.opacityRange.oninput=function(){C._setOpacity(this.value)},this.brightnessRange.onchange=function(){C._setBrightness(this.value)},this.brightnessRange.oninput=function(){C._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=b(e=this._hide).call(e,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=b(g=this._apply).call(g,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=b(t=this._save).call(t,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=b(A=this._loadLast).call(A,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 mr(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",e=>{e.isFirst&&this._moveSelector(e)}),this.hammer.on("tap",e=>{this._moveSelector(e)}),this.hammer.on("panstart",e=>{this._moveSelector(e)}),this.hammer.on("panmove",e=>{this._moveSelector(e)}),this.hammer.on("panend",e=>{this._moveSelector(e)})}_generateHueCircle(){if(this.generated===!1){let e=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let g=this.colorPickerCanvas.clientWidth,t=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,g,t);let A,C,i,n;this.centerCoordinates={x:g*.5,y:t*.5},this.r=.49*g;let r=2*Math.PI/360,o=1/360,s=1/this.r,a;for(i=0;i<360;i++)for(n=0;n<this.r;n++)A=this.centerCoordinates.x+n*Math.sin(r*i),C=this.centerCoordinates.y+n*Math.cos(r*i),a=nI(i*o,n*s,1),e.fillStyle="rgb("+a.r+","+a.g+","+a.b+")",e.fillRect(A-.5,C-.5,2,2);e.strokeStyle="rgba(0,0,0,1)",e.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),e.stroke(),this.hueCircle=e.getImageData(0,0,g,t)}this.generated=!0}_moveSelector(e){let g=this.colorPickerDiv.getBoundingClientRect(),t=e.center.x-g.left,A=e.center.y-g.top,C=.5*this.colorPickerDiv.clientHeight,i=.5*this.colorPickerDiv.clientWidth,n=t-i,r=A-C,o=Math.atan2(n,r),s=.98*Math.min(Math.sqrt(n*n+r*r),i),a=Math.cos(o)*s+C,d=Math.sin(o)*s+i;this.colorPickerSelector.style.top=a-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=d-.5*this.colorPickerSelector.clientWidth+"px";let l=o/(2*Math.PI);l=l<0?l+1:l;let h=s/this.r,c=Bt(this.color.r,this.color.g,this.color.b);c.h=l,c.s=h;let p=nI(c.h,c.s,c.v);p.a=this.color.a,this.color=p,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+")"}};function ji(){for(var I=arguments.length,e=new Array(I),g=0;g<I;g++)e[g]=arguments[g];if(e.length<1)throw new TypeError("Invalid arguments.");if(e.length===1)return document.createTextNode(e[0]);{let t=document.createElement(e[0]);return t.appendChild(ji(...Ze(e).call(e,1))),t}}var QO=class{constructor(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:()=>!1;this.parent=e,this.changedOptions=[],this.container=g,this.allowCreation=!1,this.hideOption=C,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},q(this.options,this.defaultOptions),this.configureOptions=t,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new HO(A),this.wrapper=void 0}setOptions(e){if(e!==void 0){this.popupHistory={},this._removePopup();let g=!0;if(typeof e=="string")this.options.filter=e;else if(B(e))this.options.filter=e.join();else if(typeof e=="object"){if(e==null)throw new TypeError("options cannot be null");e.container!==void 0&&(this.options.container=e.container),te(e)!==void 0&&(this.options.filter=te(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(g=e.enabled)}else typeof e=="boolean"?(this.options.filter=!0,g=e):typeof e=="function"&&(this.options.filter=e,g=!0);te(this.options)===!1&&(g=!1),this.options.enabled=g}this._clean()}setModuleOptions(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];let e=te(this.options),g=0,t=!1;for(let A in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,A)&&(this.allowCreation=!1,t=!1,typeof e=="function"?(t=e(A,[]),t=t||this._handleObject(this.configureOptions[A],[A],!0)):(e===!0||G(e).call(e,A)!==-1)&&(t=!0),t!==!1&&(this.allowCreation=!0,g>0&&this._makeItem([]),this._makeHeader(A),this._handleObject(this.configureOptions[A],[A])),g++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let e=0;e<this.domElements.length;e++)this.wrapper.appendChild(this.domElements[e]);this._showPopupIfNeeded()}_clean(){for(let e=0;e<this.domElements.length;e++)this.wrapper.removeChild(this.domElements[e]);this.wrapper!==void 0&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}_getValue(e){let g=this.moduleOptions;for(let t=0;t<e.length;t++)if(g[e[t]]!==void 0)g=g[e[t]];else{g=void 0;break}return g}_makeItem(e){if(this.allowCreation===!0){let C=document.createElement("div");C.className="vis-configuration vis-config-item vis-config-s"+e.length;for(var g=arguments.length,t=new Array(g>1?g-1:0),A=1;A<g;A++)t[A-1]=arguments[A];return F(t).call(t,i=>{C.appendChild(i)}),this.domElements.push(C),this.domElements.length}return 0}_makeHeader(e){let g=document.createElement("div");g.className="vis-configuration vis-config-header",g.innerText=e,this._makeItem([],g)}_makeLabel(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=document.createElement("div");if(A.className="vis-configuration vis-config-label vis-config-s"+g.length,t===!0){for(;A.firstChild;)A.removeChild(A.firstChild);A.appendChild(ji("i","b",e))}else A.innerText=e+":";return A}_makeDropdown(e,g,t){let A=document.createElement("select");A.className="vis-configuration vis-config-select";let C=0;g!==void 0&&G(e).call(e,g)!==-1&&(C=G(e).call(e,g));for(let r=0;r<e.length;r++){let o=document.createElement("option");o.value=e[r],r===C&&(o.selected="selected"),o.innerText=e[r],A.appendChild(o)}let i=this;A.onchange=function(){i._update(this.value,t)};let n=this._makeLabel(t[t.length-1],t);this._makeItem(t,n,A)}_makeRange(e,g,t){let A=e[0],C=e[1],i=e[2],n=e[3],r=document.createElement("input");r.className="vis-configuration vis-config-range";try{r.type="range",r.min=C,r.max=i}catch(c){}r.step=n;let o="",s=0;g!==void 0?(g<0&&g*1.2<C?(r.min=Math.ceil(g*1.2),s=r.min,o="range increased"):g/1.2<C&&(r.min=Math.ceil(g/1.2),s=r.min,o="range increased"),g*1.2>i&&i!==1&&(r.max=Math.ceil(g*1.2),s=r.max,o="range increased"),r.value=g):r.value=A;let a=document.createElement("input");a.className="vis-configuration vis-config-rangeinput",a.value=r.value;let d=this;r.onchange=function(){a.value=this.value,d._update(Number(this.value),t)},r.oninput=function(){a.value=this.value};let l=this._makeLabel(t[t.length-1],t),h=this._makeItem(t,l,r,a);o!==""&&this.popupHistory[h]!==s&&(this.popupHistory[h]=s,this._setupPopup(o,h))}_makeButton(){if(this.options.showButton===!0){let e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerText="generate options",e.onclick=()=>{this._printOptions()},e.onmouseover=()=>{e.className="vis-configuration vis-config-button hover"},e.onmouseout=()=>{e.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(e)}}_setupPopup(e,g){if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){let t=document.createElement("div");t.id="vis-configuration-popup",t.className="vis-configuration-popup",t.innerText=e,t.onclick=()=>{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:t,index:g}}}_removePopup(){this.popupDiv.html!==void 0&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(this.popupDiv.html!==void 0){let 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=He(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=He(()=>{this._removePopup()},1800)}}_makeCheckbox(e,g,t){let A=document.createElement("input");A.type="checkbox",A.className="vis-configuration vis-config-checkbox",A.checked=e,g!==void 0&&(A.checked=g,g!==e&&(typeof e=="object"?g!==e.enabled&&this.changedOptions.push({path:t,value:g}):this.changedOptions.push({path:t,value:g})));let C=this;A.onchange=function(){C._update(this.checked,t)};let i=this._makeLabel(t[t.length-1],t);this._makeItem(t,i,A)}_makeTextInput(e,g,t){let A=document.createElement("input");A.type="text",A.className="vis-configuration vis-config-text",A.value=g,g!==e&&this.changedOptions.push({path:t,value:g});let C=this;A.onchange=function(){C._update(this.value,t)};let i=this._makeLabel(t[t.length-1],t);this._makeItem(t,i,A)}_makeColorField(e,g,t){let A=e[1],C=document.createElement("div");g=g===void 0?A:g,g!=="none"?(C.className="vis-configuration vis-config-colorBlock",C.style.backgroundColor=g):C.className="vis-configuration vis-config-colorBlock none",g=g===void 0?A:g,C.onclick=()=>{this._showColorPicker(g,C,t)};let i=this._makeLabel(t[t.length-1],t);this._makeItem(t,i,C)}_showColorPicker(e,g,t){g.onclick=function(){},this.colorPicker.insertTo(g),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(A=>{let C="rgba("+A.r+","+A.g+","+A.b+","+A.a+")";g.style.backgroundColor=C,this._update(C,t)}),this.colorPicker.setCloseCallback(()=>{g.onclick=()=>{this._showColorPicker(e,g,t)}})}_handleObject(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=!1,C=te(this.options),i=!1;for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){A=!0;let r=e[n],o=yI(g,n);if(typeof C=="function"&&(A=C(n,g),A===!1&&!B(r)&&typeof r!="string"&&typeof r!="boolean"&&r instanceof Object&&(this.allowCreation=!1,A=this._handleObject(r,o,!0),this.allowCreation=t===!1)),A!==!1){i=!0;let s=this._getValue(o);if(B(r))this._handleArray(r,s,o);else if(typeof r=="string")this._makeTextInput(r,s,o);else if(typeof r=="boolean")this._makeCheckbox(r,s,o);else if(r instanceof Object){if(!this.hideOption(g,n,this.moduleOptions))if(r.enabled!==void 0){let a=yI(o,"enabled"),d=this._getValue(a);if(d===!0){let l=this._makeLabel(n,o,!0);this._makeItem(o,l),i=this._handleObject(r,o)||i}else this._makeCheckbox(r,d,o)}else{let a=this._makeLabel(n,o,!0);this._makeItem(o,a),i=this._handleObject(r,o)||i}}else console.error("dont know how to handle",r,n,o)}}return i}_handleArray(e,g,t){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,g,t),e[1]!==g&&this.changedOptions.push({path:t,value:g})):typeof e[0]=="string"?(this._makeDropdown(e,g,t),e[0]!==g&&this.changedOptions.push({path:t,value:g})):typeof e[0]=="number"&&(this._makeRange(e,g,t),e[0]!==g&&this.changedOptions.push({path:t,value:Number(g)}))}_update(e,g){let t=this._constructOptions(e,g);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",t),this.initialized=!0,this.parent.setOptions(t)}_constructOptions(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=t;e=e==="true"?!0:e,e=e==="false"?!1:e;for(let C=0;C<g.length;C++)g[C]!=="global"&&(A[g[C]]===void 0&&(A[g[C]]={}),C!==g.length-1?A=A[g[C]]:A[g[C]]=e);return t}_printOptions(){let e=this.getOptions();for(;this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(ji("pre","const options = "+Et(e,null,2)))}getOptions(){let e={};for(let g=0;g<this.changedOptions.length;g++)this._constructOptions(this.changedOptions[g].value,this.changedOptions[g].path,e);return e}},XO=class{constructor(e,g){this.container=e,this.overflowMethod=g||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}setPosition(e,g){this.x=ze(e),this.y=ze(g)}setText(e){if(e instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(e)}else this.frame.innerText=e}show(e){if(e===void 0&&(e=!0),e===!0){let g=this.frame.clientHeight,t=this.frame.clientWidth,A=this.frame.parentNode.clientHeight,C=this.frame.parentNode.clientWidth,i=0,n=0;if(this.overflowMethod=="flip"){let r=!1,o=!0;this.y-g<this.padding&&(o=!1),this.x+t>C-this.padding&&(r=!0),r?i=this.x-t:i=this.x,o?n=this.y-g:n=this.y}else n=this.y-g,n+g+this.padding>A&&(n=A-g-this.padding),n<this.padding&&(n=this.padding),i=this.x,i+t+this.padding>C&&(i=C-t-this.padding),i<this.padding&&(i=this.padding);this.frame.style.left=i+"px",this.frame.style.top=n+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}hide(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}destroy(){this.frame.parentNode.removeChild(this.frame)}},Nt=!1,Os,Yi="background: #FFeeee; color: #dd0000",JO=class Q{static validate(e,g,t){Nt=!1,Os=g;let A=g;return t!==void 0&&(A=g[t]),Q.parse(e,A,[]),Nt}static parse(e,g,t){for(let A in e)Object.prototype.hasOwnProperty.call(e,A)&&Q.check(A,e,g,t)}static check(e,g,t,A){if(t[e]===void 0&&t.__any__===void 0){Q.getSuggestion(e,t,A);return}let C=e,i=!0;t[e]===void 0&&t.__any__!==void 0&&(C="__any__",i=Q.getType(g[e])==="object");let n=t[C];i&&n.__type__!==void 0&&(n=n.__type__),Q.checkFields(e,g,t,C,n,A)}static checkFields(e,g,t,A,C,i){let n=function(s){console.error("%c"+s+Q.printLocation(i,e),Yi)},r=Q.getType(g[e]),o=C[r];o!==void 0?Q.getType(o)==="array"&&G(o).call(o,g[e])===-1?(n('Invalid option detected in "'+e+'". Allowed values are:'+Q.print(o)+' not "'+g[e]+'". '),Nt=!0):r==="object"&&A!=="__any__"&&(i=yI(i,e),Q.parse(g[e],t[A],i)):C.any===void 0&&(n('Invalid type received for "'+e+'". Expected: '+Q.print(U(C))+". Received ["+r+'] "'+g[e]+'"'),Nt=!0)}static getType(e){let g=typeof e;return g==="object"?e===null?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":B(e)?"array":e instanceof Date?"date":e.nodeType!==void 0?"dom":e._isAMomentObject===!0?"moment":"object":g==="number"?"number":g==="boolean"?"boolean":g==="string"?"string":g===void 0?"undefined":g}static getSuggestion(e,g,t){let A=Q.findInOptions(e,g,t,!1),C=Q.findInOptions(e,Os,[],!0),i=8,n=4,r;A.indexMatch!==void 0?r=" in "+Q.printLocation(A.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+A.indexMatch+`"?
634
634
 
635
- `:C.distance<=n&&A.distance>C.distance?o=" in "+Q.printLocation(A.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+Q.printLocation(C.path,C.closestMatch,""):A.distance<=i?o='. Did you mean "'+A.closestMatch+'"?'+Q.printLocation(A.path,e):o=". Did you mean one of these: "+Q.print(U(g))+Q.printLocation(t,e),console.error('%cUnknown option detected: "'+e+'"'+o,Wi),Nt=!0}static findInOptions(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,C=1e9,i="",n=[],o=e.toLowerCase(),s;for(let a in g){let d;if(g[a].__type__!==void 0&&A===!0){let l=Q.findInOptions(e,g[a],yI(t,a));C>l.distance&&(i=l.closestMatch,n=l.path,C=l.distance,s=l.indexMatch)}else{var r;G(r=a.toLowerCase()).call(r,o)!==-1&&(s=a),d=Q.levenshteinDistance(e,a),C>d&&(i=a,n=VO(t),C=d)}}return{closestMatch:i,path:n,distance:C,indexMatch:s}}static printLocation(e,g){let A=`
635
+ `:C.distance<=n&&A.distance>C.distance?r=" in "+Q.printLocation(A.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+Q.printLocation(C.path,C.closestMatch,""):A.distance<=i?r='. Did you mean "'+A.closestMatch+'"?'+Q.printLocation(A.path,e):r=". Did you mean one of these: "+Q.print(U(g))+Q.printLocation(t,e),console.error('%cUnknown option detected: "'+e+'"'+r,Yi),Nt=!0}static findInOptions(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,C=1e9,i="",n=[],r=e.toLowerCase(),o;for(let a in g){let d;if(g[a].__type__!==void 0&&A===!0){let l=Q.findInOptions(e,g[a],yI(t,a));C>l.distance&&(i=l.closestMatch,n=l.path,C=l.distance,o=l.indexMatch)}else{var s;G(s=a.toLowerCase()).call(s,r)!==-1&&(o=a),d=Q.levenshteinDistance(e,a),C>d&&(i=a,n=VO(t),C=d)}}return{closestMatch:i,path:n,distance:C,indexMatch:o}}static printLocation(e,g){let A=`
636
636
 
637
637
  `+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:`Problem value found at:
638
638
  `)+`options = {
@@ -641,16 +641,16 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper {
641
641
  `;for(let C=0;C<e.length+1;C++){for(let i=0;i<e.length-C;i++)A+=" ";A+=`}
642
642
  `}return A+`
643
643
 
644
- `}static print(e){return Et(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,g){if(e.length===0)return g.length;if(g.length===0)return e.length;let t=[],A;for(A=0;A<=g.length;A++)t[A]=[A];let C;for(C=0;C<=e.length;C++)t[0][C]=C;for(A=1;A<=g.length;A++)for(C=1;C<=e.length;C++)g.charAt(A-1)==e.charAt(C-1)?t[A][C]=t[A-1][C-1]:t[A][C]=Math.min(t[A-1][C-1]+1,Math.min(t[A][C-1]+1,t[A-1][C]+1));return t[g.length][e.length]}},$O=Ke,qO=QO,ot=vo,e1=XO,jl=Wi,g1=JO;function t1(I){return mg=I,i1()}var Wl={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},yo=wg(Wl);yo.color="color.color";yo.style="dashes";var me={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},Pr={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},mg="",ut=0,R="",P="",we=me.NULL;function A1(){ut=0,R=mg.charAt(0)}function oe(){ut++,R=mg.charAt(ut)}function gt(){return mg.charAt(ut+1)}function Dr(I){var e=I.charCodeAt(0);return e<47?e===35||e===46:e<59?e>47:e<91?e>64:e<96?e===95:e<123?e>96:!1}function Og(I,e){if(I||(I={}),e)for(var g in e)e.hasOwnProperty(g)&&(I[g]=e[g]);return I}function I1(I,e,g){for(var t=e.split("."),A=I;t.length;){var C=t.shift();t.length?(A[C]||(A[C]={}),A=A[C]):A[C]=g}}function Yl(I,e){for(var g,t,A=null,C=[I],i=I;i.parent;)C.push(i.parent),i=i.parent;if(i.nodes){for(g=0,t=i.nodes.length;g<t;g++)if(e.id===i.nodes[g].id){A=i.nodes[g];break}}for(A||(A={id:e.id},I.node&&(A.attr=Og(A.attr,I.node))),g=C.length-1;g>=0;g--){var n,o=C[g];o.nodes||(o.nodes=[]),G(n=o.nodes).call(n,A)===-1&&o.nodes.push(A)}e.attr&&(A.attr=Og(A.attr,e.attr))}function C1(I,e){if(I.edges||(I.edges=[]),I.edges.push(e),I.edge){var g=Og({},I.edge);e.attr=Og(g,e.attr)}}function _l(I,e,g,t,A){var C={from:e,to:g,type:t};return I.edge&&(C.attr=Og({},I.edge)),C.attr=Og(C.attr||{},A),A!=null&&A.hasOwnProperty("arrows")&&A.arrows!=null&&(C.arrows={to:{enabled:!0,type:A.arrows.type}},A.arrows=null),C}function K(){for(we=me.NULL,P="";R===" "||R===" "||R===`
645
- `||R==="\r";)oe();do{var I=!1;if(R==="#"){for(var e=ut-1;mg.charAt(e)===" "||mg.charAt(e)===" ";)e--;if(mg.charAt(e)===`
646
- `||mg.charAt(e)===""){for(;R!=""&&R!=`
647
- `;)oe();I=!0}}if(R==="/"&&gt()==="/"){for(;R!=""&&R!=`
648
- `;)oe();I=!0}if(R==="/"&&gt()==="*"){for(;R!="";)if(R==="*"&&gt()==="/"){oe(),oe();break}else oe();I=!0}for(;R===" "||R===" "||R===`
649
- `||R==="\r";)oe()}while(I);if(R===""){we=me.DELIMITER;return}var g=R+gt();if(Pr[g]){we=me.DELIMITER,P=g,oe(),oe();return}if(Pr[R]){we=me.DELIMITER,P=R,oe();return}if(Dr(R)||R==="-"){for(P+=R,oe();Dr(R);)P+=R,oe();P==="false"?P=!1:P==="true"?P=!0:isNaN(Number(P))||(P=Number(P)),we=me.IDENTIFIER;return}if(R==='"'){for(oe();R!=""&&(R!='"'||R==='"'&&gt()==='"');)R==='"'?(P+=R,oe()):R==="\\"&&gt()==="n"?(P+=`
650
- `,oe()):P+=R,oe();if(R!='"')throw ve('End of string " expected');oe(),we=me.IDENTIFIER;return}for(we=me.UNKNOWN;R!="";)P+=R,oe();throw new SyntaxError('Syntax error in part "'+Ql(P,30)+'"')}function i1(){var I={};if(A1(),K(),P==="strict"&&(I.strict=!0,K()),(P==="graph"||P==="digraph")&&(I.type=P,K()),we===me.IDENTIFIER&&(I.id=P,K()),P!="{")throw ve("Angle bracket { expected");if(K(),Kl(I),P!="}")throw ve("Angle bracket } expected");if(K(),P!=="")throw ve("End of file expected");return K(),delete I.node,delete I.edge,delete I.graph,I}function Kl(I){for(;P!==""&&P!="}";)n1(I),P===";"&&K()}function n1(I){var e=Ul(I);if(e){Hl(I,e);return}var g=o1(I);if(!g){if(we!=me.IDENTIFIER)throw ve("Identifier expected");var t=P;if(K(),P==="="){if(K(),we!=me.IDENTIFIER)throw ve("Identifier expected");I[t]=P,K()}else s1(I,t)}}function Ul(I){var e=null;if(P==="subgraph"&&(e={},e.type="subgraph",K(),we===me.IDENTIFIER&&(e.id=P,K())),P==="{"){if(K(),e||(e={}),e.parent=I,e.node=I.node,e.edge=I.edge,e.graph=I.graph,Kl(e),P!="}")throw ve("Angle bracket } expected");K(),delete e.node,delete e.edge,delete e.graph,delete e.parent,I.subgraphs||(I.subgraphs=[]),I.subgraphs.push(e)}return e}function o1(I){return P==="node"?(K(),I.node=Vt(),"node"):P==="edge"?(K(),I.edge=Vt(),"edge"):P==="graph"?(K(),I.graph=Vt(),"graph"):null}function s1(I,e){var g={id:e},t=Vt();t&&(g.attr=t),Yl(I,g),Hl(I,e)}function Hl(I,e){for(;P==="->"||P==="--";){var g,t=P;K();var A=Ul(I);if(A)g=A;else{if(we!=me.IDENTIFIER)throw ve("Identifier or subgraph expected");g=P,Yl(I,{id:g}),K()}var C=Vt(),i=_l(I,e,g,t,C);C1(I,i),e=g}}function Vt(){for(var I,e=null,g={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"},A=new Array,C=new Array;P==="[";){for(K(),e={};P!==""&&P!="]";){if(we!=me.IDENTIFIER)throw ve("Attribute name expected");var i=P;if(K(),P!="=")throw ve("Equal sign = expected");if(K(),we!=me.IDENTIFIER)throw ve("Attribute value expected");var n=P;i==="style"&&(n=g[n]);var o;i==="arrowhead"&&(o=t[n],i="arrows",n={to:{enabled:!0,type:o}}),i==="arrowtail"&&(o=t[n],i="arrows",n={from:{enabled:!0,type:o}}),A.push({attr:e,name:i,value:n}),C.push(i),K(),P==","&&K()}if(P!="]")throw ve("Bracket ] expected");K()}if(yg(C).call(C,"dir")){var s={};for(s.arrows={},I=0;I<A.length;I++)if(A[I].name==="arrows")if(A[I].value.to!=null)s.arrows.to=I;else if(A[I].value.from!=null)s.arrows.from=I;else throw ve("Invalid value of arrows");else A[I].name==="dir"&&(s.dir=I);var r=A[s.dir].value;if(!yg(C).call(C,"arrows"))if(r==="both")A.push({attr:A[s.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),s.arrows.to=A.length-1,A.push({attr:A[s.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),s.arrows.from=A.length-1;else if(r==="forward")A.push({attr:A[s.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),s.arrows.to=A.length-1;else if(r==="back")A.push({attr:A[s.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),s.arrows.from=A.length-1;else if(r==="none")A.push({attr:A[s.dir].attr,name:"arrows",value:""}),s.arrows.to=A.length-1;else throw ve('Invalid dir type "'+r+'"');var a,d;if(r==="both")s.arrows.to&&s.arrows.from?(d=A[s.arrows.to].value.to.type,a=A[s.arrows.from].value.from.type,A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}},Ue(A).call(A,s.arrows.from,1)):s.arrows.to?(d=A[s.arrows.to].value.to.type,a="arrow",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):s.arrows.from&&(d="arrow",a=A[s.arrows.from].value.from.type,A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}});else if(r==="back")s.arrows.to&&s.arrows.from?(d="",a=A[s.arrows.from].value.from.type,A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):s.arrows.to?(d="",a="arrow",s.arrows.from=s.arrows.to,A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):s.arrows.from&&(d="",a=A[s.arrows.from].value.from.type,A[s.arrows.to]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}),A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{from:{enabled:!0,type:A[s.arrows.from].value.from.type}}};else if(r==="none"){var l;s.arrows.to?l=s.arrows.to:l=s.arrows.from,A[l]={attr:A[l].attr,name:A[l].name,value:""}}else if(r==="forward")s.arrows.to&&s.arrows.from?(d=A[s.arrows.to].value.to.type,a="",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):s.arrows.to?(d=A[s.arrows.to].value.to.type,a="",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):s.arrows.from&&(d="arrow",a="",s.arrows.to=s.arrows.from,A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}),A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:A[s.arrows.to].value.to.type}}};else throw ve('Invalid dir type "'+r+'"');Ue(A).call(A,s.dir,1)}var h;if(yg(C).call(C,"penwidth")){var c=[];for(h=A.length,I=0;I<h;I++)A[I].name!=="width"&&(A[I].name==="penwidth"&&(A[I].name="width"),c.push(A[I]));A=c}for(h=A.length,I=0;I<h;I++)I1(A[I].attr,A[I].name,A[I].value);return e}function ve(I){return new SyntaxError(I+', got "'+Ql(P,30)+'" (char '+ut+")")}function Ql(I,e){return I.length<=e?I:I.substr(0,27)+"..."}function r1(I,e,g){B(I)?F(I).call(I,function(t){B(e)?F(e).call(e,function(A){g(t,A)}):g(t,e)}):B(e)?F(e).call(e,function(t){g(I,t)}):g(I,e)}function ei(I,e,g){for(var t=e.split("."),A=t.pop(),C=I,i=0;i<t.length;i++){var n=t[i];n in C||(C[n]={}),C=C[n]}return C[A]=g,I}function Nr(I,e){var g={};for(var t in I)if(I.hasOwnProperty(t)){var A=e[t];B(A)?F(A).call(A,function(C){ei(g,C,I[t])}):typeof A=="string"?ei(g,A,I[t]):ei(g,t,I[t])}return g}function a1(I){var e=t1(I),g={nodes:[],edges:[],options:{}};if(e.nodes){var t;F(t=e.nodes).call(t,function(i){var n={id:i.id,label:String(i.label||i.id)};Og(n,Nr(i.attr,Wl)),n.image&&(n.shape="image"),g.nodes.push(n)})}if(e.edges){var A,C=function(i){var n={from:i.from,to:i.to};return Og(n,Nr(i.attr,yo)),n.arrows==null&&i.type==="->"&&(n.arrows="to"),n};F(A=e.edges).call(A,function(i){var n,o;if(i.from instanceof Object?n=i.from.nodes:n={id:i.from},i.to instanceof Object?o=i.to.nodes:o={id:i.to},i.from instanceof Object&&i.from.edges){var s;F(s=i.from.edges).call(s,function(a){var d=C(a);g.edges.push(d)})}if(r1(n,o,function(a,d){var l=_l(g,a.id,d.id,i.type,i.attr),h=C(l);g.edges.push(h)}),i.to instanceof Object&&i.to.edges){var r;F(r=i.to.edges).call(r,function(a){var d=C(a);g.edges.push(d)})}})}return e.attr&&(g.options=e.attr),g}function d1(I,e){var g;let t={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};e!=null&&(e.fixed!=null&&(t.nodes.fixed=e.fixed),e.parseColor!=null&&(t.nodes.parseColor=e.parseColor),e.inheritColor!=null&&(t.edges.inheritColor=e.inheritColor));let A=I.edges,C=ae(A).call(A,n=>{let o={from:n.source,id:n.id,to:n.target};return n.attributes!=null&&(o.attributes=n.attributes),n.label!=null&&(o.label=n.label),n.attributes!=null&&n.attributes.title!=null&&(o.title=n.attributes.title),n.type==="Directed"&&(o.arrows="to"),n.color&&t.edges.inheritColor===!1&&(o.color=n.color),o});return{nodes:ae(g=I.nodes).call(g,n=>{let o={id:n.id,fixed:t.nodes.fixed&&n.x!=null&&n.y!=null};return n.attributes!=null&&(o.attributes=n.attributes),n.label!=null&&(o.label=n.label),n.size!=null&&(o.size=n.size),n.attributes!=null&&n.attributes.title!=null&&(o.title=n.attributes.title),n.title!=null&&(o.title=n.title),n.x!=null&&(o.x=n.x),n.y!=null&&(o.y=n.y),n.color!=null&&(t.nodes.parseColor===!0?o.color=n.color:o.color={background:n.color,border:n.color,highlight:{background:n.color,border:n.color},hover:{background:n.color,border:n.color}}),o}),edges:C}}var l1={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"},h1={addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzuf\xFCgen",addNode:"Knoten hinzuf\xFCgen",back:"Zur\xFCck",close:"Schlie\xDFen",createEdgeError:"Es ist nicht m\xF6glich, Kanten mit Clustern zu verbinden.",del:"L\xF6sche Auswahl",deleteClusterError:"Cluster k\xF6nnen nicht gel\xF6scht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster k\xF6nnen nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},c1={addDescription:"Haga clic en un lugar vac\xEDo para colocar un nuevo nodo.",addEdge:"A\xF1adir arista",addNode:"A\xF1adir nodo",back:"Atr\xE1s",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selecci\xF3n",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"},u1={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"},f1={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"},p1={addDescription:"Clique em um espa\xE7o em branco para adicionar um novo n\xF3",addEdge:"Adicionar aresta",addNode:"Adicionar n\xF3",back:"Voltar",close:"Fechar",createEdgeError:"N\xE3o foi poss\xEDvel linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters n\xE3o puderam ser removidos.",edgeDescription:"Clique em um n\xF3 e arraste a aresta at\xE9 outro n\xF3 para conect\xE1-los",edit:"Editar",editClusterError:"Clusters n\xE3o puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um n\xF3 para conect\xE1-los",editNode:"Editar n\xF3"},m1={addDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u0432 \u0441\u0432\u043E\u0431\u043E\u0434\u043D\u043E\u0435 \u043C\u0435\u0441\u0442\u043E, \u0447\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u0443\u0437\u0435\u043B.",addEdge:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u043E",addNode:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0443\u0437\u0435\u043B",back:"\u041D\u0430\u0437\u0430\u0434",close:"\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0442\u044C",createEdgeError:"\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u0430 \u0432 \u043A\u043B\u0430\u0441\u0442\u0435\u0440.",del:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435",deleteClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0443\u0434\u0430\u043B\u0435\u043D\u044B",edgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u0443\u0437\u0435\u043B \u0438 \u043F\u0440\u043E\u0442\u044F\u043D\u0438\u0442\u0435 \u0440\u0435\u0431\u0440\u043E \u043A \u0434\u0440\u0443\u0433\u043E\u043C\u0443 \u0443\u0437\u043B\u0443, \u0447\u0442\u043E\u0431\u044B \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0438\u0445.",edit:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C",editClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F.",editEdge:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0435\u0431\u0440\u043E",editEdgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u044B\u0435 \u0442\u043E\u0447\u043A\u0438 \u0438 \u043F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0438\u0445 \u0432 \u0443\u0437\u0435\u043B, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F \u043A \u043D\u0435\u043C\u0443.",editNode:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0443\u0437\u0435\u043B"},v1={addDescription:"\u5355\u51FB\u7A7A\u767D\u5904\u653E\u7F6E\u65B0\u8282\u70B9\u3002",addEdge:"\u6DFB\u52A0\u8FDE\u63A5\u7EBF",addNode:"\u6DFB\u52A0\u8282\u70B9",back:"\u8FD4\u56DE",close:"\u95DC\u9589",createEdgeError:"\u65E0\u6CD5\u5C06\u8FDE\u63A5\u7EBF\u8FDE\u63A5\u5230\u7FA4\u96C6\u3002",del:"\u5220\u9664\u9009\u5B9A",deleteClusterError:"\u65E0\u6CD5\u5220\u9664\u7FA4\u96C6\u3002",edgeDescription:"\u5355\u51FB\u67D0\u4E2A\u8282\u70B9\u5E76\u5C06\u8BE5\u8FDE\u63A5\u7EBF\u62D6\u52A8\u5230\u53E6\u4E00\u4E2A\u8282\u70B9\u4EE5\u8FDE\u63A5\u5B83\u4EEC\u3002",edit:"\u7F16\u8F91",editClusterError:"\u65E0\u6CD5\u7F16\u8F91\u7FA4\u96C6\u3002",editEdge:"\u7F16\u8F91\u8FDE\u63A5\u7EBF",editEdgeDescription:"\u5355\u51FB\u63A7\u5236\u8282\u70B9\u5E76\u5C06\u5B83\u4EEC\u62D6\u5230\u8282\u70B9\u4E0A\u8FDE\u63A5\u3002",editNode:"\u7F16\u8F91\u8282\u70B9"},b1={addDescription:"K\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0456\u043B\u044C\u043D\u0435 \u043C\u0456\u0441\u0446\u0435, \u0449\u043E\u0431 \u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u0432\u0443\u0437\u043E\u043B.",addEdge:"\u0414\u043E\u0434\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",addNode:"\u0414\u043E\u0434\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B",back:"\u041D\u0430\u0437\u0430\u0434",close:"\u0417\u0430\u043A\u0440\u0438\u0442\u0438",createEdgeError:"\u041D\u0435 \u043C\u043E\u0436\u043B\u0438\u0432\u043E \u043E\u0431'\u0454\u0434\u043D\u0430\u0442\u0438 \u043A\u0440\u0430\u0457 \u0432 \u0433\u0440\u0443\u043F\u0443.",del:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u043E\u0431\u0440\u0430\u043D\u0435",deleteClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435 \u043C\u043E\u0436\u0443\u0442\u044C \u0431\u0443\u0442\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u0456.",edgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0443\u0437\u043E\u043B \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u043A\u0440\u0430\u0439 \u0434\u043E \u0456\u043D\u0448\u043E\u0433\u043E \u0432\u0443\u0437\u043B\u0430, \u0449\u043E\u0431 \u0457\u0445 \u0437'\u0454\u0434\u043D\u0430\u0442\u0438.",edit:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438",editClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456 \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043D\u043D\u044F.",editEdge:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",editEdgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u0456 \u0442\u043E\u0447\u043A\u0438 \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u0457\u0445 \u0443 \u0432\u0443\u0437\u043E\u043B, \u0449\u043E\u0431 \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u0438\u0441\u044F \u0434\u043E \u043D\u044C\u043E\u0433\u043E.",editNode:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B"},y1={addDescription:"Cliquez dans un endroit vide pour placer un n\u0153ud.",addEdge:"Ajouter un lien",addNode:"Ajouter un n\u0153ud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de cr\xE9er un lien vers un cluster.",del:"Effacer la s\xE9lection",deleteClusterError:"Les clusters ne peuvent pas \xEAtre effac\xE9s.",edgeDescription:"Cliquez sur un n\u0153ud et glissez le lien vers un autre n\u0153ud pour les connecter.",edit:"\xC9diter",editClusterError:"Les clusters ne peuvent pas \xEAtre \xE9dit\xE9s.",editEdge:"\xC9diter le lien",editEdgeDescription:"Cliquez sur les points de contr\xF4le et glissez-les pour connecter un n\u0153ud.",editNode:"\xC9diter le n\u0153ud"},w1={addDescription:"Kluknut\xEDm do pr\xE1zdn\xE9ho prostoru m\u016F\u017Eete p\u0159idat nov\xFD vrchol.",addEdge:"P\u0159idat hranu",addNode:"P\u0159idat vrchol",back:"Zp\u011Bt",close:"Zav\u0159\xEDt",createEdgeError:"Nelze p\u0159ipojit hranu ke shluku.",del:"Smazat v\xFDb\u011Br",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"P\u0159eta\u017Een\xEDm z jednoho vrcholu do druh\xE9ho m\u016F\u017Eete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"P\u0159eta\u017Een\xEDm kontroln\xEDho vrcholu hrany ji m\u016F\u017Eete p\u0159ipojit k jin\xE9mu vrcholu.",editNode:"Upravit vrchol"},E1=Object.freeze({__proto__:null,cn:v1,cs:w1,de:h1,en:l1,es:c1,fr:y1,it:u1,nl:f1,pt:p1,ru:m1,uk:b1});function T1(I,e){try{let[t,A]=e.split(/[-_ /]/,2),C=t!=null?t.toLowerCase():null,i=A!=null?A.toUpperCase():null;if(C&&i){let n=C+"-"+i;if(Object.prototype.hasOwnProperty.call(I,n))return n;var g;console.warn($d(g="Unknown variant ".concat(i," of language ")).call(g,C,"."))}if(C){let n=C;if(Object.prototype.hasOwnProperty.call(I,n))return n;console.warn("Unknown language ".concat(C))}return console.warn("Unknown locale ".concat(e,", falling back to English.")),"en"}catch(t){return console.error(t),console.warn("Unexpected error while normalizing locale ".concat(e,", falling back to English.")),"en"}}var Yi=class{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;let e=this.image.width,g=this.image.height;this.width=e,this.height=g;let t=Math.floor(g/2),A=Math.floor(g/4),C=Math.floor(g/8),i=Math.floor(g/16),n=Math.floor(e/2),o=Math.floor(e/4),s=Math.floor(e/8),r=Math.floor(e/16);this.canvas.width=3*o,this.canvas.height=t,this.coordinates=[[0,0,n,t],[n,0,o,A],[n,A,s,C],[5*s,A,r,i]],this._fillMipMap()}initialized(){return this.coordinates!==void 0}_fillMipMap(){let e=this.canvas.getContext("2d"),g=this.coordinates[0];e.drawImage(this.image,g[0],g[1],g[2],g[3]);for(let t=1;t<this.NUM_ITERATIONS;t++){let A=this.coordinates[t-1],C=this.coordinates[t];e.drawImage(this.canvas,A[0],A[1],A[2],A[3],C[0],C[1],C[2],C[3])}}drawImageAtPosition(e,g,t,A,C,i){if(this.initialized())if(g>2){g*=.5;let n=0;for(;g>2&&n<this.NUM_ITERATIONS;)g*=.5,n+=1;n>=this.NUM_ITERATIONS&&(n=this.NUM_ITERATIONS-1);let o=this.coordinates[n];e.drawImage(this.canvas,o[0],o[1],o[2],o[3],t,A,C,i)}else e.drawImage(this.image,t,A,C,i)}},_i=class{constructor(e){this.images={},this.imageBroken={},this.callback=e}_tryloadBrokenUrl(e,g,t){if(!(e===void 0||t===void 0)){if(g===void 0){console.warn("No broken url image defined");return}t.image.onerror=()=>{console.error("Could not load brokenImage:",g)},t.image.src=g}}_redrawWithImage(e){this.callback&&this.callback(e)}load(e,g){let t=this.images[e];if(t)return t;let A=new Yi;return this.images[e]=A,A.image.onload=()=>{this._fixImageCoordinates(A.image),A.init(),this._redrawWithImage(A)},A.image.onerror=()=>{console.error("Could not load image:",e),this._tryloadBrokenUrl(e,g,A)},A.image.src=e,A}_fixImageCoordinates(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}},Xl={exports:{}},x1=z,O1=x1(function(){if(typeof ArrayBuffer=="function"){var I=new ArrayBuffer(8);Object.isExtensible(I)&&Object.defineProperty(I,"a",{value:8})}}),P1=z,D1=ce,N1=sg,Rr=O1,oI=Object.isExtensible,R1=P1(function(){oI(1)}),S1=R1||Rr?function(e){return!D1(e)||Rr&&N1(e)==="ArrayBuffer"?!1:oI?oI(e):!0}:oI,k1=z,Jl=!k1(function(){return Object.isExtensible(Object.preventExtensions({}))}),M1=N,F1=Z,B1=lA,z1=ce,wo=ne,Z1=Oe.f,Sr=mA,L1=XI,Eo=S1,G1=WI,V1=Jl,$l=!1,ng=G1("meta"),j1=0,To=function(I){Z1(I,ng,{value:{objectID:"O"+j1++,weakData:{}}})},W1=function(I,e){if(!z1(I))return typeof I=="symbol"?I:(typeof I=="string"?"S":"P")+I;if(!wo(I,ng)){if(!Eo(I))return"F";if(!e)return"E";To(I)}return I[ng].objectID},Y1=function(I,e){if(!wo(I,ng)){if(!Eo(I))return!0;if(!e)return!1;To(I)}return I[ng].weakData},_1=function(I){return V1&&$l&&Eo(I)&&!wo(I,ng)&&To(I),I},K1=function(){U1.enable=function(){},$l=!0;var I=Sr.f,e=F1([].splice),g={};g[ng]=1,I(g).length&&(Sr.f=function(t){for(var A=I(t),C=0,i=A.length;C<i;C++)if(A[C]===ng){e(A,C,1);break}return A},M1({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:L1.f}))},U1=Xl.exports={enable:K1,fastKey:W1,getWeakData:Y1,onFreeze:_1};B1[ng]=!0;var nC=Xl.exports,H1=ee,Q1=yt,X1=H1("iterator"),J1=Array.prototype,$1=function(I){return I!==void 0&&(Q1.Array===I||J1[X1]===I)},q1=ag,kr=Qn,eP=ft,gP=yt,tP=ee,AP=tP("iterator"),ql=function(I){if(!eP(I))return kr(I,AP)||kr(I,"@@iterator")||gP[q1(I)]},IP=je,CP=Yg,iP=rg,nP=sA,oP=ql,sP=TypeError,eh=function(I,e){var g=arguments.length<2?oP(I):e;if(CP(g))return iP(IP(g,I));throw new sP(nP(I)+" is not iterable")},rP=je,Mr=rg,aP=Qn,dP=function(I,e,g){var t,A;Mr(I);try{if(t=aP(I,"return"),!t){if(e==="throw")throw g;return g}t=rP(t,I)}catch(C){A=!0,t=C}if(e==="throw")throw g;if(A)throw t;return Mr(t),g},lP=aA,hP=je,cP=rg,uP=sA,fP=$1,pP=Se,Fr=J,mP=eh,vP=ql,Br=dP,bP=TypeError,sI=function(I,e){this.stopped=I,this.result=e},zr=sI.prototype,xo=function(I,e,g){var t=g&&g.that,A=!!(g&&g.AS_ENTRIES),C=!!(g&&g.IS_RECORD),i=!!(g&&g.IS_ITERATOR),n=!!(g&&g.INTERRUPTED),o=lP(e,t),s,r,a,d,l,h,c,p=function(m){return s&&Br(s,"normal",m),new sI(!0,m)},u=function(m){return A?(cP(m),n?o(m[0],m[1],p):o(m[0],m[1])):n?o(m,p):o(m)};if(C)s=I.iterator;else if(i)s=I;else{if(r=vP(I),!r)throw new bP(uP(I)+" is not iterable");if(fP(r)){for(a=0,d=pP(I);d>a;a++)if(l=u(I[a]),l&&Fr(zr,l))return l;return new sI(!1)}s=mP(I,r)}for(h=C?I.next:s.next;!(c=hP(h,s)).done;){try{l=u(c.value)}catch(m){Br(s,"throw",m)}if(typeof l=="object"&&l&&Fr(zr,l))return l}return new sI(!1)},yP=J,wP=TypeError,Oo=function(I,e){if(yP(e,I))return I;throw new wP("Incorrect invocation")},EP=N,TP=X,xP=nC,OP=z,PP=vt,DP=xo,NP=Oo,RP=le,SP=ce,kP=ft,MP=bt,FP=Oe.f,BP=Ng.forEach,zP=ie,gh=Kg,ZP=gh.set,LP=gh.getterFor,Po=function(I,e,g){var t=I.indexOf("Map")!==-1,A=I.indexOf("Weak")!==-1,C=t?"set":"add",i=TP[I],n=i&&i.prototype,o={},s;if(!zP||!RP(i)||!(A||n.forEach&&!OP(function(){new i().entries().next()})))s=g.getConstructor(e,I,t,C),xP.enable();else{s=e(function(d,l){ZP(NP(d,r),{type:I,collection:new i}),kP(l)||DP(l,d[C],{that:d,AS_ENTRIES:t})});var r=s.prototype,a=LP(I);BP(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(d){var l=d==="add"||d==="set";d in n&&!(A&&d==="clear")&&PP(r,d,function(h,c){var p=a(this).collection;if(!l&&A&&!SP(h))return d==="get"?void 0:!1;var u=p[d](h===0?0:h,c);return l?this:u})}),A||FP(r,"size",{configurable:!0,get:function(){return a(this).collection.size}})}return MP(s,I,!1,!0),o[I]=s,EP({global:!0,forced:!0},o),A||g.setStrong(s,I,t),s},GP=vA,Do=function(I,e,g){for(var t in e)g&&g.unsafe&&I[t]?I[t]=e[t]:GP(I,t,e[t],g);return I},VP=Ye,jP=Ao,WP=ee,YP=ie,Zr=WP("species"),_P=function(I){var e=VP(I);YP&&e&&!e[Zr]&&jP(e,Zr,{configurable:!0,get:function(){return this}})},KP=pA,UP=Ao,Lr=Do,HP=aA,QP=Oo,XP=ft,JP=xo,$P=so,QA=ro,qP=_P,Rt=ie,Gr=nC.fastKey,th=Kg,Vr=th.set,gi=th.getterFor,Ah={getConstructor:function(I,e,g,t){var A=I(function(s,r){QP(s,C),Vr(s,{type:e,index:KP(null),first:void 0,last:void 0,size:0}),Rt||(s.size=0),XP(r)||JP(r,s[t],{that:s,AS_ENTRIES:g})}),C=A.prototype,i=gi(e),n=function(s,r,a){var d=i(s),l=o(s,r),h,c;return l?l.value=a:(d.last=l={index:c=Gr(r,!0),key:r,value:a,previous:h=d.last,next:void 0,removed:!1},d.first||(d.first=l),h&&(h.next=l),Rt?d.size++:s.size++,c!=="F"&&(d.index[c]=l)),s},o=function(s,r){var a=i(s),d=Gr(r),l;if(d!=="F")return a.index[d];for(l=a.first;l;l=l.next)if(l.key===r)return l};return Lr(C,{clear:function(){for(var r=this,a=i(r),d=a.index,l=a.first;l;)l.removed=!0,l.previous&&(l.previous=l.previous.next=void 0),delete d[l.index],l=l.next;a.first=a.last=void 0,Rt?a.size=0:r.size=0},delete:function(s){var r=this,a=i(r),d=o(r,s);if(d){var l=d.next,h=d.previous;delete a.index[d.index],d.removed=!0,h&&(h.next=l),l&&(l.previous=h),a.first===d&&(a.first=l),a.last===d&&(a.last=h),Rt?a.size--:r.size--}return!!d},forEach:function(r){for(var a=i(this),d=HP(r,arguments.length>1?arguments[1]:void 0),l;l=l?l.next:a.first;)for(d(l.value,l.key,this);l&&l.removed;)l=l.previous},has:function(r){return!!o(this,r)}}),Lr(C,g?{get:function(r){var a=o(this,r);return a&&a.value},set:function(r,a){return n(this,r===0?0:r,a)}}:{add:function(r){return n(this,r=r===0?0:r,r)}}),Rt&&UP(C,"size",{configurable:!0,get:function(){return i(this).size}}),A},setStrong:function(I,e,g){var t=e+" Iterator",A=gi(e),C=gi(t);$P(I,e,function(i,n){Vr(this,{type:t,target:i,state:A(i),kind:n,last:void 0})},function(){for(var i=C(this),n=i.kind,o=i.last;o&&o.removed;)o=o.previous;return!i.target||!(i.last=o=o?o.next:i.state.first)?(i.target=void 0,QA(void 0,!0)):QA(n==="keys"?o.key:n==="values"?o.value:[o.key,o.value],!1)},g?"entries":"values",!g,!0),qP(e)}},eD=Po,gD=Ah;eD("Map",function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},gD);var No=Z,tD=_I,AD=qe,ID=CA,CD=No("".charAt),jr=No("".charCodeAt),iD=No("".slice),Wr=function(I){return function(e,g){var t=AD(ID(e)),A=tD(g),C=t.length,i,n;return A<0||A>=C?I?"":void 0:(i=jr(t,A),i<55296||i>56319||A+1===C||(n=jr(t,A+1))<56320||n>57343?I?CD(t,A):i:I?iD(t,A,A+2):(i-55296<<10)+(n-56320)+65536)}},nD={codeAt:Wr(!1),charAt:Wr(!0)},oD=nD.charAt,sD=qe,Ih=Kg,rD=so,Yr=ro,Ch="String Iterator",aD=Ih.set,dD=Ih.getterFor(Ch);rD(String,"String",function(I){aD(this,{type:Ch,string:sD(I),index:0})},function(){var e=dD(this),g=e.string,t=e.index,A;return t>=g.length?Yr(void 0,!0):(A=oD(g,t),e.index+=A.length,Yr(A,!1))});var lD=L,hD=lD.Map,cD=hD,uD=cD,fD=uD,NA=D(fD),Ki=class{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},q(this.options,this.defaultOptions)}setOptions(e){let g=["useDefaultGroups"];if(e!==void 0){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&G(g).call(g,t)===-1){let A=e[t];this.add(t,A)}}}clear(){this._groups=new NA,this._groupNames=[]}get(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this._groups.get(e);if(t===void 0&&g)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){let A=this._groupIndex%this._groupNames.length;++this._groupIndex,t={},t.color=this._groups.get(this._groupNames[A]),this._groups.set(e,t)}else{let A=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,t={},t.color=this._defaultGroups[A],this._groups.set(e,t)}return t}add(e,g){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,g),g}},pD=N;pD({target:"Number",stat:!0},{isNaN:function(e){return e!==e}});var mD=L,vD=mD.Number.isNaN,bD=vD,yD=bD,wD=yD,Ui=D(wD),ED=X,TD=ED.isFinite,xD=Number.isFinite||function(e){return typeof e=="number"&&TD(e)},OD=N,PD=xD;OD({target:"Number",stat:!0},{isFinite:PD});var DD=L,ND=DD.Number.isFinite,RD=ND,SD=RD,kD=SD,Mg=D(kD),MD=N,FD=Ng.some,BD=wt,zD=BD("some");MD({target:"Array",proto:!0,forced:!zD},{some:function(e){return FD(this,e,arguments.length>1?arguments[1]:void 0)}});var ZD=Ie,LD=ZD("Array").some,GD=J,VD=LD,ti=Array.prototype,jD=function(I){var e=I.some;return I===ti||GD(ti,I)&&e===ti.some?VD:e},WD=jD,YD=WD,_D=YD,ih=D(_D),KD=L,UD=KD.Object.getOwnPropertySymbols,HD=UD,QD=HD,XD=QD,Xe=D(XD),nh={exports:{}},JD=N,$D=z,qD=We,oh=tA.f,sh=ie,e2=!sh||$D(function(){oh(1)});JD({target:"Object",stat:!0,forced:e2,sham:!sh},{getOwnPropertyDescriptor:function(e,g){return oh(qD(e),g)}});var g2=L,rh=g2.Object,t2=nh.exports=function(e,g){return rh.getOwnPropertyDescriptor(e,g)};rh.getOwnPropertyDescriptor.sham&&(t2.sham=!0);var A2=nh.exports,I2=A2,C2=I2,i2=C2,eg=D(i2),n2=N,o2=ie,s2=Ud,r2=We,a2=tA,d2=uA;n2({target:"Object",stat:!0,sham:!o2},{getOwnPropertyDescriptors:function(e){for(var g=r2(e),t=a2.f,A=s2(g),C={},i=0,n,o;A.length>i;)o=t(g,n=A[i++]),o!==void 0&&d2(C,n,o);return C}});var l2=L,h2=l2.Object.getOwnPropertyDescriptors,c2=h2,u2=c2,f2=u2,Je=D(f2),ah={exports:{}},p2=N,m2=ie,_r=HI.f;p2({target:"Object",stat:!0,forced:Object.defineProperties!==_r,sham:!m2},{defineProperties:_r});var v2=L,dh=v2.Object,b2=ah.exports=function(e,g){return dh.defineProperties(e,g)};dh.defineProperties.sham&&(b2.sham=!0);var y2=ah.exports,w2=y2,E2=w2,T2=E2,RA=D(T2),lh={exports:{}},x2=N,O2=ie,Kr=Oe.f;x2({target:"Object",stat:!0,forced:Object.defineProperty!==Kr,sham:!O2},{defineProperty:Kr});var P2=L,hh=P2.Object,D2=lh.exports=function(e,g,t){return hh.defineProperty(e,g,t)};hh.defineProperty.sham&&(D2.sham=!0);var N2=lh.exports,R2=N2,ch=R2,S2=ch,k2=S2,M2=k2,F2=M2,B2=F2,z2=D(B2),Z2=ee,L2=Oe.f,Ur=Z2("metadata"),Hr=Function.prototype;Hr[Ur]===void 0&&L2(Hr,Ur,{value:null});var G2=$;G2("asyncDispose");var V2=$;V2("dispose");var j2=$;j2("metadata");var W2=Kd,Y2=W2,_2=Ye,K2=Z,Ro=_2("Symbol"),U2=Ro.keyFor,H2=K2(Ro.prototype.valueOf),uh=Ro.isRegisteredSymbol||function(e){try{return U2(H2(e))!==void 0}catch(g){return!1}},Q2=N,X2=uh;Q2({target:"Symbol",stat:!0},{isRegisteredSymbol:X2});var J2=mt,fh=Ye,$2=Z,q2=oA,eN=ee,wI=fh("Symbol"),Qr=wI.isWellKnownSymbol,ph=fh("Object","getOwnPropertyNames"),gN=$2(wI.prototype.valueOf),Xr=J2("wks");for(XA=0,Ai=ph(wI),Jr=Ai.length;XA<Jr;XA++)try{Ii=Ai[XA],q2(wI[Ii])&&eN(Ii)}catch(I){}var Ii,XA,Ai,Jr,mh=function(e){if(Qr&&Qr(e))return!0;try{for(var g=gN(e),t=0,A=ph(Xr),C=A.length;t<C;t++)if(Xr[A[t]]==g)return!0}catch(i){}return!1},tN=N,AN=mh;tN({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:AN});var IN=$;IN("matcher");var CN=$;CN("observable");var iN=N,nN=uh;iN({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:nN});var oN=N,sN=mh;oN({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:sN});var rN=$;rN("metadataKey");var aN=$;aN("patternMatch");var dN=$;dN("replaceAll");var lN=Y2,hN=lN,cN=hN,JA=D(cN),uN=bA,fN=uN.f("iterator"),pN=fN,vh=pN,mN=vh,vN=mN,bN=vN,yN=bN,wN=yN,EN=D(wN);function $t(I){"@babel/helpers - typeof";return $t=typeof JA=="function"&&typeof EN=="symbol"?function(e){return typeof e}:function(e){return e&&typeof JA=="function"&&e.constructor===JA&&e!==JA.prototype?"symbol":typeof e},$t(I)}var TN=bA,xN=TN.f("toPrimitive"),ON=xN,PN=ON,DN=PN,NN=DN,RN=NN,SN=RN,kN=SN,MN=D(kN);function FN(I,e){if($t(I)!=="object"||I===null)return I;var g=I[MN];if(g!==void 0){var t=g.call(I,e||"default");if($t(t)!=="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(I)}function BN(I){var e=FN(I,"string");return $t(e)==="symbol"?e:String(e)}function ge(I,e,g){return e=BN(e),e in I?z2(I,e,{value:g,enumerable:!0,configurable:!0,writable:!0}):I[e]=g,I}var zN=Yg,ZN=xe,LN=jI,GN=Se,VN=TypeError,$r=function(I){return function(e,g,t,A){zN(g);var C=ZN(e),i=LN(C),n=GN(C),o=I?n-1:0,s=I?-1:1;if(t<2)for(;;){if(o in i){A=i[o],o+=s;break}if(o+=s,I?o<0:n<=o)throw new VN("Reduce of empty array with no initial value")}for(;I?o>=0:n>o;o+=s)o in i&&(A=g(A,i[o],o,C));return A}},jN={left:$r(!1),right:$r(!0)},WN=X,YN=sg,_N=YN(WN.process)==="process",KN=N,UN=jN.left,HN=wt,qr=nA,QN=_N,XN=!QN&&qr>79&&qr<83,JN=XN||!HN("reduce");KN({target:"Array",proto:!0,forced:JN},{reduce:function(e){var g=arguments.length;return UN(this,e,g,g>1?arguments[1]:void 0)}});var $N=Ie,qN=$N("Array").reduce,eR=J,gR=qN,Ci=Array.prototype,tR=function(I){var e=I.reduce;return I===Ci||eR(Ci,I)&&e===Ci.reduce?gR:e},AR=tR,IR=AR,CR=IR,So=D(CR),iR=Dg,nR=Se,oR=eo,sR=aA,bh=function(I,e,g,t,A,C,i,n){for(var o=A,s=0,r=i?sR(i,n):!1,a,d;s<t;)s in g&&(a=r?r(g[s],s,e):g[s],C>0&&iR(a)?(d=nR(a),o=bh(I,e,a,d,o,C-1)-1):(oR(o+1),I[o]=a),o++),s++;return o},rR=bh,aR=N,dR=rR,lR=Yg,hR=xe,cR=Se,uR=UI;aR({target:"Array",proto:!0},{flatMap:function(e){var g=hR(this),t=cR(g),A;return lR(e),A=uR(g,0),A.length=dR(A,g,g,t,0,1,e,arguments.length>1?arguments[1]:void 0),A}});var fR=Ie,gF=fR("Array").flatMap;var tF=Array.prototype;var pR=vh,nt=D(pR),mR=Po,vR=Ah;mR("Set",function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},vR);var bR=L,yR=bR.Set,wR=yR,ER=wR,TR=ER,Le=D(TR),xR=eh,OR=xR,PR=OR,DR=PR,NR=DR,RR=NR,SR=RR,kR=SR,MR=kR,FR=MR,ii=D(FR),ea=rd,BR=Math.floor,Hi=function(I,e){var g=I.length,t=BR(g/2);return g<8?zR(I,e):ZR(I,Hi(ea(I,0,t),e),Hi(ea(I,t),e),e)},zR=function(I,e){for(var g=I.length,t=1,A,C;t<g;){for(C=t,A=I[t];C&&e(I[C-1],A)>0;)I[C]=I[--C];C!==t++&&(I[C]=A)}return I},ZR=function(I,e,g,t){for(var A=e.length,C=g.length,i=0,n=0;i<A||n<C;)I[i+n]=i<A&&n<C?t(e[i],g[n])<=0?e[i++]:g[n++]:i<A?e[i++]:g[n++];return I},LR=Hi,GR=iA,ga=GR.match(/firefox\/(\d+)/i),VR=!!ga&&+ga[1],jR=iA,WR=/MSIE|Trident/.test(jR),YR=iA,ta=YR.match(/AppleWebKit\/(\d+)\./),_R=!!ta&&+ta[1],KR=N,yh=Z,UR=Yg,HR=xe,Aa=Se,QR=Xd,Ia=qe,ko=z,XR=LR,JR=wt,Ca=VR,$R=WR,ia=nA,na=_R,vg=[],oa=yh(vg.sort),qR=yh(vg.push),eS=ko(function(){vg.sort(void 0)}),gS=ko(function(){vg.sort(null)}),tS=JR("sort"),wh=!ko(function(){if(ia)return ia<70;if(!(Ca&&Ca>3)){if($R)return!0;if(na)return na<603;var I="",e,g,t,A;for(e=65;e<76;e++){switch(g=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(A=0;A<47;A++)vg.push({k:g+A,v:t})}for(vg.sort(function(C,i){return i.v-C.v}),A=0;A<vg.length;A++)g=vg[A].k.charAt(0),I.charAt(I.length-1)!==g&&(I+=g);return I!=="DGBEFHACIJK"}}),AS=eS||!gS||!tS||!wh,IS=function(I){return function(e,g){return g===void 0?-1:e===void 0?1:I!==void 0?+I(e,g)||0:Ia(e)>Ia(g)?1:-1}};KR({target:"Array",proto:!0,forced:AS},{sort:function(e){e!==void 0&&UR(e);var g=HR(this);if(wh)return e===void 0?oa(g):oa(g,e);var t=[],A=Aa(g),C,i;for(i=0;i<A;i++)i in g&&qR(t,g[i]);for(XR(t,IS(e)),C=Aa(t),i=0;i<C;)g[i]=t[i++];for(;i<A;)QR(g,i++);return g}});var CS=Ie,iS=CS("Array").sort,nS=J,oS=iS,ni=Array.prototype,sS=function(I){var e=I.sort;return I===ni||nS(ni,I)&&e===ni.sort?oS:e},rS=sS,aS=rS,dS=aS,Cg=D(dS),lS=Ie,hS=lS("Array").keys,cS=hS,uS=cS,fS=ag,pS=ne,mS=J,vS=uS,oi=Array.prototype,bS={DOMTokenList:!0,NodeList:!0},yS=function(I){var e=I.keys;return I===oi||mS(oi,I)&&e===oi.keys||pS(bS,fS(I))?vS:e},wS=yS,tt=D(wS),ES=Ie,TS=ES("Array").values,xS=TS,OS=xS,PS=ag,DS=ne,NS=J,RS=OS,si=Array.prototype,SS={DOMTokenList:!0,NodeList:!0},kS=function(I){var e=I.values;return I===si||NS(si,I)&&e===si.values||DS(SS,PS(I))?RS:e},MS=kS,EI=D(MS),FS=Ie,BS=FS("Array").entries,zS=BS,ZS=zS,LS=ag,GS=ne,VS=J,jS=ZS,ri=Array.prototype,WS={DOMTokenList:!0,NodeList:!0},YS=function(I){var e=I.entries;return I===ri||VS(ri,I)&&e===ri.entries||GS(WS,LS(I))?jS:e},_S=YS,KS=D(_S),US=ch,SA=D(US),$A,HS=new Uint8Array(16);function QS(){if(!$A&&($A=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!$A))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return $A(HS)}var re=[];for(let I=0;I<256;++I)re.push((I+256).toString(16).slice(1));function XS(I,e=0){return re[I[e+0]]+re[I[e+1]]+re[I[e+2]]+re[I[e+3]]+"-"+re[I[e+4]]+re[I[e+5]]+"-"+re[I[e+6]]+re[I[e+7]]+"-"+re[I[e+8]]+re[I[e+9]]+"-"+re[I[e+10]]+re[I[e+11]]+re[I[e+12]]+re[I[e+13]]+re[I[e+14]]+re[I[e+15]]}var JS=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),sa={randomUUID:JS};function st(I,e,g){if(sa.randomUUID&&!e&&!I)return sa.randomUUID();I=I||{};let t=I.random||(I.rng||QS)();if(t[6]=t[6]&15|64,t[8]=t[8]&63|128,e){g=g||0;for(let A=0;A<16;++A)e[g+A]=t[A];return e}return XS(t)}function ra(I,e){var g=U(I);if(Xe){var t=Xe(I);e&&(t=te(t).call(t,function(A){return eg(I,A).enumerable})),g.push.apply(g,t)}return g}function aa(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=ra(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):Je?RA(I,Je(A)):F(t=ra(Object(A))).call(t,function(C){SA(I,C,eg(A,C))})}return I}function da(I){return typeof I=="string"||typeof I=="number"}var Qi=class I{constructor(e){ge(this,"delay",void 0),ge(this,"max",void 0),ge(this,"_queue",[]),ge(this,"_timeout",null),ge(this,"_extended",null),this.delay=null,this.max=1/0,this.setOptions(e)}setOptions(e){e&&typeof e.delay!="undefined"&&(this.delay=e.delay),e&&typeof e.max!="undefined"&&(this.max=e.max),this._flushIfNeeded()}static extend(e,g){let t=new I(g);if(e.flush!==void 0)throw new Error("Target object already has a property flush");e.flush=()=>{t.flush()};let A=[{name:"flush",original:void 0}];if(g&&g.replace)for(let C=0;C<g.replace.length;C++){let i=g.replace[C];A.push({name:i,original:e[i]}),t.replace(e,i)}return t._extended={object:e,methods:A},t}destroy(){if(this.flush(),this._extended){let e=this._extended.object,g=this._extended.methods;for(let t=0;t<g.length;t++){let A=g[t];A.original?e[A.name]=A.original:delete e[A.name]}this._extended=null}}replace(e,g){let t=this,A=e[g];if(!A)throw new Error("Method "+g+" undefined");e[g]=function(){for(var C=arguments.length,i=new Array(C),n=0;n<C;n++)i[n]=arguments[n];t.queue({args:i,fn:A,context:this})}}queue(e){typeof e=="function"?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}_flushIfNeeded(){this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=He(()=>{this.flush()},this.delay))}flush(){var e,g;F(e=Ue(g=this._queue).call(g,0)).call(e,t=>{t.fn.apply(t.context||t.fn,t.args||[])})}},Xi=class I{constructor(){ge(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),ge(this,"subscribe",I.prototype.on),ge(this,"unsubscribe",I.prototype.off)}_trigger(e,g,t){var A;if(e==="*")throw new Error("Cannot trigger event *");F(A=[...this._subscribers[e],...this._subscribers["*"]]).call(A,C=>{C(e,g,t!=null?t:null)})}on(e,g){typeof g=="function"&&this._subscribers[e].push(g)}off(e,g){var t;this._subscribers[e]=te(t=this._subscribers[e]).call(t,A=>A!==g)}},TI=class I{constructor(e){ge(this,"_pairs",void 0),this._pairs=e}*[nt](){for(let[e,g]of this._pairs)yield[e,g]}*entries(){for(let[e,g]of this._pairs)yield[e,g]}*keys(){for(let[e]of this._pairs)yield e}*values(){for(let[,e]of this._pairs)yield e}toIdArray(){var e;return ae(e=[...this._pairs]).call(e,g=>g[0])}toItemArray(){var e;return ae(e=[...this._pairs]).call(e,g=>g[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){let e=wg(null);for(let[g,t]of this._pairs)e[g]=t;return e}toMap(){return new NA(this._pairs)}toIdSet(){return new Le(this.toIdArray())}toItemSet(){return new Le(this.toItemArray())}cache(){return new I([...this._pairs])}distinct(e){let g=new Le;for(let[t,A]of this._pairs)g.add(e(A,t));return g}filter(e){let g=this._pairs;return new I({*[nt](){for(let[t,A]of g)e(A,t)&&(yield[t,A])}})}forEach(e){for(let[g,t]of this._pairs)e(t,g)}map(e){let g=this._pairs;return new I({*[nt](){for(let[t,A]of g)yield[t,e(A,t)]}})}max(e){let g=ii(this._pairs),t=g.next();if(t.done)return null;let A=t.value[1],C=e(t.value[1],t.value[0]);for(;!(t=g.next()).done;){let[i,n]=t.value,o=e(n,i);o>C&&(C=o,A=n)}return A}min(e){let g=ii(this._pairs),t=g.next();if(t.done)return null;let A=t.value[1],C=e(t.value[1],t.value[0]);for(;!(t=g.next()).done;){let[i,n]=t.value,o=e(n,i);o<C&&(C=o,A=n)}return A}reduce(e,g){for(let[t,A]of this._pairs)g=e(g,A,t);return g}sort(e){return new I({[nt]:()=>{var g;return ii(Cg(g=[...this._pairs]).call(g,(t,A)=>{let[C,i]=t,[n,o]=A;return e(i,o,C,n)}))}})}};function $S(I,e){return I[e]==null&&(I[e]=st()),I}var Pg=class extends Xi{get idProp(){return this._idProp}constructor(e,g){super(),ge(this,"flush",void 0),ge(this,"length",void 0),ge(this,"_options",void 0),ge(this,"_data",void 0),ge(this,"_idProp",void 0),ge(this,"_queue",null),e&&!B(e)&&(g=e,e=[]),this._options=g||{},this._data=new NA,this.length=0,this._idProp=this._options.fieldId||"id",e&&e.length&&this.add(e),this.setOptions(g)}setOptions(e){e&&e.queue!==void 0&&(e.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=Qi.extend(this,{replace:["add","update","remove"]})),e.queue&&typeof e.queue=="object"&&this._queue.setOptions(e.queue)))}add(e,g){let t=[],A;if(B(e)){let C=ae(e).call(e,i=>i[this._idProp]);if(ih(C).call(C,i=>this._data.has(i)))throw new Error("A duplicate id was found in the parameter array.");for(let i=0,n=e.length;i<n;i++)A=this._addItem(e[i]),t.push(A)}else if(e&&typeof e=="object")A=this._addItem(e),t.push(A);else throw new Error("Unknown dataType");return t.length&&this._trigger("add",{items:t},g),t}update(e,g){let t=[],A=[],C=[],i=[],n=this._idProp,o=s=>{let r=s[n];if(r!=null&&this._data.has(r)){let a=s,d=q({},this._data.get(r)),l=this._updateItem(a);A.push(l),i.push(a),C.push(d)}else{let a=this._addItem(s);t.push(a)}};if(B(e))for(let s=0,r=e.length;s<r;s++)e[s]&&typeof e[s]=="object"?o(e[s]):console.warn("Ignoring input item, which is not an object at index "+s);else if(e&&typeof e=="object")o(e);else throw new Error("Unknown dataType");if(t.length&&this._trigger("add",{items:t},g),A.length){let s={items:A,oldData:C,data:i};this._trigger("update",s,g)}return $d(t).call(t,A)}updateOnly(e,g){var t;B(e)||(e=[e]);let A=ae(t=ae(e).call(e,C=>{let i=this._data.get(C[this._idProp]);if(i==null)throw new Error("Updating non-existent items is not allowed.");return{oldData:i,update:C}})).call(t,C=>{let{oldData:i,update:n}=C,o=i[this._idProp],s=RO(i,n);return this._data.set(o,s),{id:o,oldData:i,updatedData:s}});if(A.length){let C={items:ae(A).call(A,i=>i.id),oldData:ae(A).call(A,i=>i.oldData),data:ae(A).call(A,i=>i.updatedData)};return this._trigger("update",C,g),C.items}else return[]}get(e,g){let t,A,C;da(e)?(t=e,C=g):B(e)?(A=e,C=g):C=e;let i=C&&C.returnType==="Object"?"Object":"Array",n=C&&te(C),o=[],s,r,a;if(t!=null)s=this._data.get(t),s&&n&&!n(s)&&(s=void 0);else if(A!=null)for(let h=0,c=A.length;h<c;h++)s=this._data.get(A[h]),s!=null&&(!n||n(s))&&o.push(s);else{var d;r=[...tt(d=this._data).call(d)];for(let h=0,c=r.length;h<c;h++)a=r[h],s=this._data.get(a),s!=null&&(!n||n(s))&&o.push(s)}if(C&&C.order&&t==null&&this._sort(o,C.order),C&&C.fields){let h=C.fields;if(t!=null&&s!=null)s=this._filterFields(s,h);else for(let c=0,p=o.length;c<p;c++)o[c]=this._filterFields(o[c],h)}if(i=="Object"){let h={};for(let c=0,p=o.length;c<p;c++){let u=o[c],m=u[this._idProp];h[m]=u}return h}else if(t!=null){var l;return(l=s)!==null&&l!==void 0?l:null}else return o}getIds(e){let g=this._data,t=e&&te(e),A=e&&e.order,C=[...tt(g).call(g)],i=[];if(t)if(A){let n=[];for(let o=0,s=C.length;o<s;o++){let r=C[o],a=this._data.get(r);a!=null&&t(a)&&n.push(a)}this._sort(n,A);for(let o=0,s=n.length;o<s;o++)i.push(n[o][this._idProp])}else for(let n=0,o=C.length;n<o;n++){let s=C[n],r=this._data.get(s);r!=null&&t(r)&&i.push(r[this._idProp])}else if(A){let n=[];for(let o=0,s=C.length;o<s;o++){let r=C[o];n.push(g.get(r))}this._sort(n,A);for(let o=0,s=n.length;o<s;o++)i.push(n[o][this._idProp])}else for(let n=0,o=C.length;n<o;n++){let s=C[n],r=g.get(s);r!=null&&i.push(r[this._idProp])}return i}getDataSet(){return this}forEach(e,g){let t=g&&te(g),A=this._data,C=[...tt(A).call(A)];if(g&&g.order){let i=this.get(g);for(let n=0,o=i.length;n<o;n++){let s=i[n],r=s[this._idProp];e(s,r)}}else for(let i=0,n=C.length;i<n;i++){let o=C[i],s=this._data.get(o);s!=null&&(!t||t(s))&&e(s,o)}}map(e,g){let t=g&&te(g),A=[],C=this._data,i=[...tt(C).call(C)];for(let n=0,o=i.length;n<o;n++){let s=i[n],r=this._data.get(s);r!=null&&(!t||t(r))&&A.push(e(r,s))}return g&&g.order&&this._sort(A,g.order),A}_filterFields(e,g){var t;return e&&So(t=B(g)?g:U(g)).call(t,(A,C)=>(A[C]=e[C],A),{})}_sort(e,g){if(typeof g=="string"){let t=g;Cg(e).call(e,(A,C)=>{let i=A[t],n=C[t];return i>n?1:i<n?-1:0})}else if(typeof g=="function")Cg(e).call(e,g);else throw new TypeError("Order must be a function or a string")}remove(e,g){let t=[],A=[],C=B(e)?e:[e];for(let i=0,n=C.length;i<n;i++){let o=this._remove(C[i]);if(o){let s=o[this._idProp];s!=null&&(t.push(s),A.push(o))}}return t.length&&this._trigger("remove",{items:t,oldData:A},g),t}_remove(e){let g;if(da(e)?g=e:e&&typeof e=="object"&&(g=e[this._idProp]),g!=null&&this._data.has(g)){let t=this._data.get(g)||null;return this._data.delete(g),--this.length,t}return null}clear(e){var g;let t=[...tt(g=this._data).call(g)],A=[];for(let C=0,i=t.length;C<i;C++)A.push(this._data.get(t[C]));return this._data.clear(),this.length=0,this._trigger("remove",{items:t,oldData:A},e),t}max(e){let g=null,t=null;for(let C of EI(A=this._data).call(A)){var A;let i=C[e];typeof i=="number"&&(t==null||i>t)&&(g=C,t=i)}return g||null}min(e){let g=null,t=null;for(let C of EI(A=this._data).call(A)){var A;let i=C[e];typeof i=="number"&&(t==null||i<t)&&(g=C,t=i)}return g||null}distinct(e){let g=this._data,t=[...tt(g).call(g)],A=[],C=0;for(let i=0,n=t.length;i<n;i++){let o=t[i],r=g.get(o)[e],a=!1;for(let d=0;d<C;d++)if(A[d]==r){a=!0;break}!a&&r!==void 0&&(A[C]=r,C++)}return A}_addItem(e){let g=$S(e,this._idProp),t=g[this._idProp];if(this._data.has(t))throw new Error("Cannot add item: item with id "+t+" already exists");return this._data.set(t,g),++this.length,t}_updateItem(e){let g=e[this._idProp];if(g==null)throw new Error("Cannot update item: item has no id (item: "+Et(e)+")");let t=this._data.get(g);if(!t)throw new Error("Cannot update item: no item with id "+g+" found");return this._data.set(g,aa(aa({},t),e)),g}stream(e){if(e){let t=this._data;return new TI({*[nt](){for(let A of e){let C=t.get(A);C!=null&&(yield[A,C])}}})}else{var g;return new TI({[nt]:b(g=KS(this._data)).call(g,this._data)})}}};function qS(I,e){return typeof e=="object"&&e!==null&&I===e.idProp&&typeof e.add=="function"&&typeof e.clear=="function"&&typeof e.distinct=="function"&&typeof F(e)=="function"&&typeof e.get=="function"&&typeof e.getDataSet=="function"&&typeof e.getIds=="function"&&typeof e.length=="number"&&typeof ae(e)=="function"&&typeof e.max=="function"&&typeof e.min=="function"&&typeof e.off=="function"&&typeof e.on=="function"&&typeof e.remove=="function"&&typeof e.setOptions=="function"&&typeof e.stream=="function"&&typeof e.update=="function"&&typeof e.updateOnly=="function"}function Eh(I,e){return typeof e=="object"&&e!==null&&I===e.idProp&&typeof F(e)=="function"&&typeof e.get=="function"&&typeof e.getDataSet=="function"&&typeof e.getIds=="function"&&typeof e.length=="number"&&typeof ae(e)=="function"&&typeof e.off=="function"&&typeof e.on=="function"&&typeof e.stream=="function"&&qS(I,e.getDataSet())}var Th=X,ek=z,gk=Z,tk=qe,Ak=tl.trim,Ik=ao,Ck=gk("".charAt),xI=Th.parseFloat,la=Th.Symbol,ha=la&&la.iterator,ik=1/xI(Ik+"-0")!==-1/0||ha&&!ek(function(){xI(Object(ha))}),nk=ik?function(e){var g=Ak(tk(e)),t=xI(g);return t===0&&Ck(g,0)==="-"?-0:t}:xI,ok=N,ca=nk;ok({global:!0,forced:parseFloat!==ca},{parseFloat:ca});var sk=L,rk=sk.parseFloat,ak=rk,dk=ak,lk=dk,xh=D(lk),hk=N,ck=z,uk=XI.f,fk=ck(function(){return!Object.getOwnPropertyNames(1)});hk({target:"Object",stat:!0,forced:fk},{getOwnPropertyNames:uk});var pk=L,mk=pk.Object,vk=function(e){return mk.getOwnPropertyNames(e)},bk=vk,yk=bk,wk=yk,Ek=D(wk);function Mo(I,e){let g=["node","edge","label"],t=!0,A=fg(e,"chosen");if(typeof A=="boolean")t=A;else if(typeof A=="object"){if(G(g).call(g,I)===-1)throw new Error("choosify: subOption '"+I+"' should be one of '"+g.join("', '")+"'");let C=fg(e,["chosen",I]);(typeof C=="boolean"||typeof C=="function")&&(t=C)}return t}function Ji(I,e,g){if(I.width<=0||I.height<=0)return!1;if(g!==void 0){let C={x:e.x-g.x,y:e.y-g.y};if(g.angle!==0){let i=-g.angle;e={x:Math.cos(i)*C.x-Math.sin(i)*C.y,y:Math.sin(i)*C.x+Math.cos(i)*C.y}}else e=C}let t=I.x+I.width,A=I.y+I.width;return I.left<e.x&&t>e.x&&I.top<e.y&&A>e.y}function OI(I){return typeof I=="string"&&I!==""}function Oh(I,e,g,t){let A=t.x,C=t.y;if(typeof t.distanceToBorder=="function"){let i=t.distanceToBorder(I,e),n=Math.sin(e)*i,o=Math.cos(e)*i;o===i?(A+=i,C=t.y):n===i?(A=t.x,C-=i):(A+=o,C-=n)}else t.shape.width>t.shape.height?(A=t.x+t.shape.width*.5,C=t.y-g):(A=t.x+g,C=t.y-t.shape.height*.5);return{x:A,y:C}}var $i=class{constructor(e){this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});let A=g;(g===void 0||g==="")&&(A=" ");let C=this.measureText(A,t),i=q({},EI(C));i.text=g,i.width=C.width,i.mod=t,(g===void 0||g==="")&&(i.width=0),this.lines[e].blocks.push(i),this.lines[e].width+=i.width}curWidth(){let e=this.lines[this.current];return e===void 0?0:e.width}append(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,g)}newLine(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,g),this.current++}determineLineHeights(){for(let e=0;e<this.lines.length;e++){let g=this.lines[e],t=0;if(g.blocks!==void 0)for(let A=0;A<g.blocks.length;A++){let C=g.blocks[A];t<C.height&&(t=C.height)}g.height=t}}determineLabelSize(){let e=0,g=0;for(let t=0;t<this.lines.length;t++){let A=this.lines[t];A.width>e&&(e=A.width),g+=A.height}this.width=e,this.height=g}removeEmptyBlocks(){let e=[];for(let g=0;g<this.lines.length;g++){let t=this.lines[g];if(t.blocks.length===0||g===this.lines.length-1&&t.width===0)continue;let A={};q(A,t),A.blocks=[];let C,i=[];for(let n=0;n<t.blocks.length;n++){let o=t.blocks[n];o.width!==0?i.push(o):C===void 0&&(C=o)}i.length===0&&C!==void 0&&i.push(C),A.blocks=i,e.push(A)}return e}finalize(){this.determineLineHeights(),this.determineLabelSize();let e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}},Tk={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},PI=class{constructor(e){this.text=e,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}mod(){return this.modStack.length===0?"normal":this.modStack[0]}modName(){if(this.modStack.length===0)return"normal";if(this.modStack[0]==="mono")return"mono";if(this.bold&&this.ital)return"boldital";if(this.bold)return"bold";if(this.ital)return"ital"}emitBlock(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}add(e){e===" "&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1),e!=" "&&(this.buffer+=e)}parseWS(e){return/[ \t]/.test(e)?(this.mono?this.add(e):this.spacing=!0,!0):!1}setTag(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}unsetTag(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}parseStartTag(e,g){return!this.mono&&!this[e]&&this.match(g)?(this.setTag(e),!0):!1}match(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,[t,A]=this.prepareRegExp(e),C=t.test(this.text.substr(this.position,A));return C&&g&&(this.position+=A-1),C}parseEndTag(e,g,t){let A=this.mod()===e;return e==="mono"?A=A&&this.mono:A=A&&!this.mono,A&&this.match(g)?(t!==void 0?(this.position===this.text.length-1||this.match(t,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}replace(e,g){return this.match(e)?(this.add(g),this.position+=length-1,!0):!1}prepareRegExp(e){let g,t;if(e instanceof RegExp)t=e,g=1;else{let A=Tk[e];A!==void 0?t=A:t=new RegExp(e),g=e.length}return[t,g]}},qi=class{constructor(e,g,t,A){this.ctx=e,this.parent=g,this.selected=t,this.hover=A;let C=(i,n)=>{if(i===void 0)return 0;let o=this.parent.getFormattingValues(e,t,A,n),s=0;return i!==""&&(s=this.ctx.measureText(i).width),{width:s,values:o}};this.lines=new $i(C)}process(e){if(!OI(e))return this.lines.finalize();let g=this.parent.fontOptions;e=e.replace(/\r\n/g,`
644
+ `}static print(e){return Et(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,g){if(e.length===0)return g.length;if(g.length===0)return e.length;let t=[],A;for(A=0;A<=g.length;A++)t[A]=[A];let C;for(C=0;C<=e.length;C++)t[0][C]=C;for(A=1;A<=g.length;A++)for(C=1;C<=e.length;C++)g.charAt(A-1)==e.charAt(C-1)?t[A][C]=t[A-1][C-1]:t[A][C]=Math.min(t[A-1][C-1]+1,Math.min(t[A][C-1]+1,t[A-1][C]+1));return t[g.length][e.length]}},$O=Ke,qO=QO,rt=mr,e1=XO,jl=Yi,g1=JO;function t1(I){return vg=I,i1()}var Yl={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},br=Eg(Yl);br.color="color.color";br.style="dashes";var me={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},Ps={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},vg="",ut=0,R="",P="",we=me.NULL;function A1(){ut=0,R=vg.charAt(0)}function re(){ut++,R=vg.charAt(ut)}function gt(){return vg.charAt(ut+1)}function Ds(I){var e=I.charCodeAt(0);return e<47?e===35||e===46:e<59?e>47:e<91?e>64:e<96?e===95:e<123?e>96:!1}function Pg(I,e){if(I||(I={}),e)for(var g in e)e.hasOwnProperty(g)&&(I[g]=e[g]);return I}function I1(I,e,g){for(var t=e.split("."),A=I;t.length;){var C=t.shift();t.length?(A[C]||(A[C]={}),A=A[C]):A[C]=g}}function Wl(I,e){for(var g,t,A=null,C=[I],i=I;i.parent;)C.push(i.parent),i=i.parent;if(i.nodes){for(g=0,t=i.nodes.length;g<t;g++)if(e.id===i.nodes[g].id){A=i.nodes[g];break}}for(A||(A={id:e.id},I.node&&(A.attr=Pg(A.attr,I.node))),g=C.length-1;g>=0;g--){var n,r=C[g];r.nodes||(r.nodes=[]),G(n=r.nodes).call(n,A)===-1&&r.nodes.push(A)}e.attr&&(A.attr=Pg(A.attr,e.attr))}function C1(I,e){if(I.edges||(I.edges=[]),I.edges.push(e),I.edge){var g=Pg({},I.edge);e.attr=Pg(g,e.attr)}}function _l(I,e,g,t,A){var C={from:e,to:g,type:t};return I.edge&&(C.attr=Pg({},I.edge)),C.attr=Pg(C.attr||{},A),A!=null&&A.hasOwnProperty("arrows")&&A.arrows!=null&&(C.arrows={to:{enabled:!0,type:A.arrows.type}},A.arrows=null),C}function K(){for(we=me.NULL,P="";R===" "||R===" "||R===`
645
+ `||R==="\r";)re();do{var I=!1;if(R==="#"){for(var e=ut-1;vg.charAt(e)===" "||vg.charAt(e)===" ";)e--;if(vg.charAt(e)===`
646
+ `||vg.charAt(e)===""){for(;R!=""&&R!=`
647
+ `;)re();I=!0}}if(R==="/"&&gt()==="/"){for(;R!=""&&R!=`
648
+ `;)re();I=!0}if(R==="/"&&gt()==="*"){for(;R!="";)if(R==="*"&&gt()==="/"){re(),re();break}else re();I=!0}for(;R===" "||R===" "||R===`
649
+ `||R==="\r";)re()}while(I);if(R===""){we=me.DELIMITER;return}var g=R+gt();if(Ps[g]){we=me.DELIMITER,P=g,re(),re();return}if(Ps[R]){we=me.DELIMITER,P=R,re();return}if(Ds(R)||R==="-"){for(P+=R,re();Ds(R);)P+=R,re();P==="false"?P=!1:P==="true"?P=!0:isNaN(Number(P))||(P=Number(P)),we=me.IDENTIFIER;return}if(R==='"'){for(re();R!=""&&(R!='"'||R==='"'&&gt()==='"');)R==='"'?(P+=R,re()):R==="\\"&&gt()==="n"?(P+=`
650
+ `,re()):P+=R,re();if(R!='"')throw ve('End of string " expected');re(),we=me.IDENTIFIER;return}for(we=me.UNKNOWN;R!="";)P+=R,re();throw new SyntaxError('Syntax error in part "'+Ql(P,30)+'"')}function i1(){var I={};if(A1(),K(),P==="strict"&&(I.strict=!0,K()),(P==="graph"||P==="digraph")&&(I.type=P,K()),we===me.IDENTIFIER&&(I.id=P,K()),P!="{")throw ve("Angle bracket { expected");if(K(),Kl(I),P!="}")throw ve("Angle bracket } expected");if(K(),P!=="")throw ve("End of file expected");return K(),delete I.node,delete I.edge,delete I.graph,I}function Kl(I){for(;P!==""&&P!="}";)n1(I),P===";"&&K()}function n1(I){var e=Ul(I);if(e){Hl(I,e);return}var g=r1(I);if(!g){if(we!=me.IDENTIFIER)throw ve("Identifier expected");var t=P;if(K(),P==="="){if(K(),we!=me.IDENTIFIER)throw ve("Identifier expected");I[t]=P,K()}else o1(I,t)}}function Ul(I){var e=null;if(P==="subgraph"&&(e={},e.type="subgraph",K(),we===me.IDENTIFIER&&(e.id=P,K())),P==="{"){if(K(),e||(e={}),e.parent=I,e.node=I.node,e.edge=I.edge,e.graph=I.graph,Kl(e),P!="}")throw ve("Angle bracket } expected");K(),delete e.node,delete e.edge,delete e.graph,delete e.parent,I.subgraphs||(I.subgraphs=[]),I.subgraphs.push(e)}return e}function r1(I){return P==="node"?(K(),I.node=Vt(),"node"):P==="edge"?(K(),I.edge=Vt(),"edge"):P==="graph"?(K(),I.graph=Vt(),"graph"):null}function o1(I,e){var g={id:e},t=Vt();t&&(g.attr=t),Wl(I,g),Hl(I,e)}function Hl(I,e){for(;P==="->"||P==="--";){var g,t=P;K();var A=Ul(I);if(A)g=A;else{if(we!=me.IDENTIFIER)throw ve("Identifier or subgraph expected");g=P,Wl(I,{id:g}),K()}var C=Vt(),i=_l(I,e,g,t,C);C1(I,i),e=g}}function Vt(){for(var I,e=null,g={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"},A=new Array,C=new Array;P==="[";){for(K(),e={};P!==""&&P!="]";){if(we!=me.IDENTIFIER)throw ve("Attribute name expected");var i=P;if(K(),P!="=")throw ve("Equal sign = expected");if(K(),we!=me.IDENTIFIER)throw ve("Attribute value expected");var n=P;i==="style"&&(n=g[n]);var r;i==="arrowhead"&&(r=t[n],i="arrows",n={to:{enabled:!0,type:r}}),i==="arrowtail"&&(r=t[n],i="arrows",n={from:{enabled:!0,type:r}}),A.push({attr:e,name:i,value:n}),C.push(i),K(),P==","&&K()}if(P!="]")throw ve("Bracket ] expected");K()}if(wg(C).call(C,"dir")){var o={};for(o.arrows={},I=0;I<A.length;I++)if(A[I].name==="arrows")if(A[I].value.to!=null)o.arrows.to=I;else if(A[I].value.from!=null)o.arrows.from=I;else throw ve("Invalid value of arrows");else A[I].name==="dir"&&(o.dir=I);var s=A[o.dir].value;if(!wg(C).call(C,"arrows"))if(s==="both")A.push({attr:A[o.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),o.arrows.to=A.length-1,A.push({attr:A[o.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),o.arrows.from=A.length-1;else if(s==="forward")A.push({attr:A[o.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),o.arrows.to=A.length-1;else if(s==="back")A.push({attr:A[o.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),o.arrows.from=A.length-1;else if(s==="none")A.push({attr:A[o.dir].attr,name:"arrows",value:""}),o.arrows.to=A.length-1;else throw ve('Invalid dir type "'+s+'"');var a,d;if(s==="both")o.arrows.to&&o.arrows.from?(d=A[o.arrows.to].value.to.type,a=A[o.arrows.from].value.from.type,A[o.arrows.to]={attr:A[o.arrows.to].attr,name:A[o.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}},Ue(A).call(A,o.arrows.from,1)):o.arrows.to?(d=A[o.arrows.to].value.to.type,a="arrow",A[o.arrows.to]={attr:A[o.arrows.to].attr,name:A[o.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):o.arrows.from&&(d="arrow",a=A[o.arrows.from].value.from.type,A[o.arrows.from]={attr:A[o.arrows.from].attr,name:A[o.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}});else if(s==="back")o.arrows.to&&o.arrows.from?(d="",a=A[o.arrows.from].value.from.type,A[o.arrows.from]={attr:A[o.arrows.from].attr,name:A[o.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):o.arrows.to?(d="",a="arrow",o.arrows.from=o.arrows.to,A[o.arrows.from]={attr:A[o.arrows.from].attr,name:A[o.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):o.arrows.from&&(d="",a=A[o.arrows.from].value.from.type,A[o.arrows.to]={attr:A[o.arrows.from].attr,name:A[o.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}),A[o.arrows.from]={attr:A[o.arrows.from].attr,name:A[o.arrows.from].name,value:{from:{enabled:!0,type:A[o.arrows.from].value.from.type}}};else if(s==="none"){var l;o.arrows.to?l=o.arrows.to:l=o.arrows.from,A[l]={attr:A[l].attr,name:A[l].name,value:""}}else if(s==="forward")o.arrows.to&&o.arrows.from?(d=A[o.arrows.to].value.to.type,a="",A[o.arrows.to]={attr:A[o.arrows.to].attr,name:A[o.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):o.arrows.to?(d=A[o.arrows.to].value.to.type,a="",A[o.arrows.to]={attr:A[o.arrows.to].attr,name:A[o.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):o.arrows.from&&(d="arrow",a="",o.arrows.to=o.arrows.from,A[o.arrows.to]={attr:A[o.arrows.to].attr,name:A[o.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}),A[o.arrows.to]={attr:A[o.arrows.to].attr,name:A[o.arrows.to].name,value:{to:{enabled:!0,type:A[o.arrows.to].value.to.type}}};else throw ve('Invalid dir type "'+s+'"');Ue(A).call(A,o.dir,1)}var h;if(wg(C).call(C,"penwidth")){var c=[];for(h=A.length,I=0;I<h;I++)A[I].name!=="width"&&(A[I].name==="penwidth"&&(A[I].name="width"),c.push(A[I]));A=c}for(h=A.length,I=0;I<h;I++)I1(A[I].attr,A[I].name,A[I].value);return e}function ve(I){return new SyntaxError(I+', got "'+Ql(P,30)+'" (char '+ut+")")}function Ql(I,e){return I.length<=e?I:I.substr(0,27)+"..."}function s1(I,e,g){B(I)?F(I).call(I,function(t){B(e)?F(e).call(e,function(A){g(t,A)}):g(t,e)}):B(e)?F(e).call(e,function(t){g(I,t)}):g(I,e)}function ei(I,e,g){for(var t=e.split("."),A=t.pop(),C=I,i=0;i<t.length;i++){var n=t[i];n in C||(C[n]={}),C=C[n]}return C[A]=g,I}function Ns(I,e){var g={};for(var t in I)if(I.hasOwnProperty(t)){var A=e[t];B(A)?F(A).call(A,function(C){ei(g,C,I[t])}):typeof A=="string"?ei(g,A,I[t]):ei(g,t,I[t])}return g}function a1(I){var e=t1(I),g={nodes:[],edges:[],options:{}};if(e.nodes){var t;F(t=e.nodes).call(t,function(i){var n={id:i.id,label:String(i.label||i.id)};Pg(n,Ns(i.attr,Yl)),n.image&&(n.shape="image"),g.nodes.push(n)})}if(e.edges){var A,C=function(i){var n={from:i.from,to:i.to};return Pg(n,Ns(i.attr,br)),n.arrows==null&&i.type==="->"&&(n.arrows="to"),n};F(A=e.edges).call(A,function(i){var n,r;if(i.from instanceof Object?n=i.from.nodes:n={id:i.from},i.to instanceof Object?r=i.to.nodes:r={id:i.to},i.from instanceof Object&&i.from.edges){var o;F(o=i.from.edges).call(o,function(a){var d=C(a);g.edges.push(d)})}if(s1(n,r,function(a,d){var l=_l(g,a.id,d.id,i.type,i.attr),h=C(l);g.edges.push(h)}),i.to instanceof Object&&i.to.edges){var s;F(s=i.to.edges).call(s,function(a){var d=C(a);g.edges.push(d)})}})}return e.attr&&(g.options=e.attr),g}function d1(I,e){var g;let t={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};e!=null&&(e.fixed!=null&&(t.nodes.fixed=e.fixed),e.parseColor!=null&&(t.nodes.parseColor=e.parseColor),e.inheritColor!=null&&(t.edges.inheritColor=e.inheritColor));let A=I.edges,C=ae(A).call(A,n=>{let r={from:n.source,id:n.id,to:n.target};return n.attributes!=null&&(r.attributes=n.attributes),n.label!=null&&(r.label=n.label),n.attributes!=null&&n.attributes.title!=null&&(r.title=n.attributes.title),n.type==="Directed"&&(r.arrows="to"),n.color&&t.edges.inheritColor===!1&&(r.color=n.color),r});return{nodes:ae(g=I.nodes).call(g,n=>{let r={id:n.id,fixed:t.nodes.fixed&&n.x!=null&&n.y!=null};return n.attributes!=null&&(r.attributes=n.attributes),n.label!=null&&(r.label=n.label),n.size!=null&&(r.size=n.size),n.attributes!=null&&n.attributes.title!=null&&(r.title=n.attributes.title),n.title!=null&&(r.title=n.title),n.x!=null&&(r.x=n.x),n.y!=null&&(r.y=n.y),n.color!=null&&(t.nodes.parseColor===!0?r.color=n.color:r.color={background:n.color,border:n.color,highlight:{background:n.color,border:n.color},hover:{background:n.color,border:n.color}}),r}),edges:C}}var l1={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"},h1={addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzuf\xFCgen",addNode:"Knoten hinzuf\xFCgen",back:"Zur\xFCck",close:"Schlie\xDFen",createEdgeError:"Es ist nicht m\xF6glich, Kanten mit Clustern zu verbinden.",del:"L\xF6sche Auswahl",deleteClusterError:"Cluster k\xF6nnen nicht gel\xF6scht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster k\xF6nnen nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},c1={addDescription:"Haga clic en un lugar vac\xEDo para colocar un nuevo nodo.",addEdge:"A\xF1adir arista",addNode:"A\xF1adir nodo",back:"Atr\xE1s",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selecci\xF3n",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"},u1={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"},f1={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"},p1={addDescription:"Clique em um espa\xE7o em branco para adicionar um novo n\xF3",addEdge:"Adicionar aresta",addNode:"Adicionar n\xF3",back:"Voltar",close:"Fechar",createEdgeError:"N\xE3o foi poss\xEDvel linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters n\xE3o puderam ser removidos.",edgeDescription:"Clique em um n\xF3 e arraste a aresta at\xE9 outro n\xF3 para conect\xE1-los",edit:"Editar",editClusterError:"Clusters n\xE3o puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um n\xF3 para conect\xE1-los",editNode:"Editar n\xF3"},m1={addDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u0432 \u0441\u0432\u043E\u0431\u043E\u0434\u043D\u043E\u0435 \u043C\u0435\u0441\u0442\u043E, \u0447\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u0443\u0437\u0435\u043B.",addEdge:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u043E",addNode:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0443\u0437\u0435\u043B",back:"\u041D\u0430\u0437\u0430\u0434",close:"\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0442\u044C",createEdgeError:"\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u0430 \u0432 \u043A\u043B\u0430\u0441\u0442\u0435\u0440.",del:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435",deleteClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0443\u0434\u0430\u043B\u0435\u043D\u044B",edgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u0443\u0437\u0435\u043B \u0438 \u043F\u0440\u043E\u0442\u044F\u043D\u0438\u0442\u0435 \u0440\u0435\u0431\u0440\u043E \u043A \u0434\u0440\u0443\u0433\u043E\u043C\u0443 \u0443\u0437\u043B\u0443, \u0447\u0442\u043E\u0431\u044B \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0438\u0445.",edit:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C",editClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F.",editEdge:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0435\u0431\u0440\u043E",editEdgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u044B\u0435 \u0442\u043E\u0447\u043A\u0438 \u0438 \u043F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0438\u0445 \u0432 \u0443\u0437\u0435\u043B, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F \u043A \u043D\u0435\u043C\u0443.",editNode:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0443\u0437\u0435\u043B"},v1={addDescription:"\u5355\u51FB\u7A7A\u767D\u5904\u653E\u7F6E\u65B0\u8282\u70B9\u3002",addEdge:"\u6DFB\u52A0\u8FDE\u63A5\u7EBF",addNode:"\u6DFB\u52A0\u8282\u70B9",back:"\u8FD4\u56DE",close:"\u95DC\u9589",createEdgeError:"\u65E0\u6CD5\u5C06\u8FDE\u63A5\u7EBF\u8FDE\u63A5\u5230\u7FA4\u96C6\u3002",del:"\u5220\u9664\u9009\u5B9A",deleteClusterError:"\u65E0\u6CD5\u5220\u9664\u7FA4\u96C6\u3002",edgeDescription:"\u5355\u51FB\u67D0\u4E2A\u8282\u70B9\u5E76\u5C06\u8BE5\u8FDE\u63A5\u7EBF\u62D6\u52A8\u5230\u53E6\u4E00\u4E2A\u8282\u70B9\u4EE5\u8FDE\u63A5\u5B83\u4EEC\u3002",edit:"\u7F16\u8F91",editClusterError:"\u65E0\u6CD5\u7F16\u8F91\u7FA4\u96C6\u3002",editEdge:"\u7F16\u8F91\u8FDE\u63A5\u7EBF",editEdgeDescription:"\u5355\u51FB\u63A7\u5236\u8282\u70B9\u5E76\u5C06\u5B83\u4EEC\u62D6\u5230\u8282\u70B9\u4E0A\u8FDE\u63A5\u3002",editNode:"\u7F16\u8F91\u8282\u70B9"},b1={addDescription:"K\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0456\u043B\u044C\u043D\u0435 \u043C\u0456\u0441\u0446\u0435, \u0449\u043E\u0431 \u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u0432\u0443\u0437\u043E\u043B.",addEdge:"\u0414\u043E\u0434\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",addNode:"\u0414\u043E\u0434\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B",back:"\u041D\u0430\u0437\u0430\u0434",close:"\u0417\u0430\u043A\u0440\u0438\u0442\u0438",createEdgeError:"\u041D\u0435 \u043C\u043E\u0436\u043B\u0438\u0432\u043E \u043E\u0431'\u0454\u0434\u043D\u0430\u0442\u0438 \u043A\u0440\u0430\u0457 \u0432 \u0433\u0440\u0443\u043F\u0443.",del:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u043E\u0431\u0440\u0430\u043D\u0435",deleteClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435 \u043C\u043E\u0436\u0443\u0442\u044C \u0431\u0443\u0442\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u0456.",edgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0443\u0437\u043E\u043B \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u043A\u0440\u0430\u0439 \u0434\u043E \u0456\u043D\u0448\u043E\u0433\u043E \u0432\u0443\u0437\u043B\u0430, \u0449\u043E\u0431 \u0457\u0445 \u0437'\u0454\u0434\u043D\u0430\u0442\u0438.",edit:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438",editClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456 \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043D\u043D\u044F.",editEdge:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",editEdgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u0456 \u0442\u043E\u0447\u043A\u0438 \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u0457\u0445 \u0443 \u0432\u0443\u0437\u043E\u043B, \u0449\u043E\u0431 \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u0438\u0441\u044F \u0434\u043E \u043D\u044C\u043E\u0433\u043E.",editNode:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B"},y1={addDescription:"Cliquez dans un endroit vide pour placer un n\u0153ud.",addEdge:"Ajouter un lien",addNode:"Ajouter un n\u0153ud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de cr\xE9er un lien vers un cluster.",del:"Effacer la s\xE9lection",deleteClusterError:"Les clusters ne peuvent pas \xEAtre effac\xE9s.",edgeDescription:"Cliquez sur un n\u0153ud et glissez le lien vers un autre n\u0153ud pour les connecter.",edit:"\xC9diter",editClusterError:"Les clusters ne peuvent pas \xEAtre \xE9dit\xE9s.",editEdge:"\xC9diter le lien",editEdgeDescription:"Cliquez sur les points de contr\xF4le et glissez-les pour connecter un n\u0153ud.",editNode:"\xC9diter le n\u0153ud"},w1={addDescription:"Kluknut\xEDm do pr\xE1zdn\xE9ho prostoru m\u016F\u017Eete p\u0159idat nov\xFD vrchol.",addEdge:"P\u0159idat hranu",addNode:"P\u0159idat vrchol",back:"Zp\u011Bt",close:"Zav\u0159\xEDt",createEdgeError:"Nelze p\u0159ipojit hranu ke shluku.",del:"Smazat v\xFDb\u011Br",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"P\u0159eta\u017Een\xEDm z jednoho vrcholu do druh\xE9ho m\u016F\u017Eete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"P\u0159eta\u017Een\xEDm kontroln\xEDho vrcholu hrany ji m\u016F\u017Eete p\u0159ipojit k jin\xE9mu vrcholu.",editNode:"Upravit vrchol"},E1=Object.freeze({__proto__:null,cn:v1,cs:w1,de:h1,en:l1,es:c1,fr:y1,it:u1,nl:f1,pt:p1,ru:m1,uk:b1});function T1(I,e){try{let[t,A]=e.split(/[-_ /]/,2),C=t!=null?t.toLowerCase():null,i=A!=null?A.toUpperCase():null;if(C&&i){let n=C+"-"+i;if(Object.prototype.hasOwnProperty.call(I,n))return n;var g;console.warn($d(g="Unknown variant ".concat(i," of language ")).call(g,C,"."))}if(C){let n=C;if(Object.prototype.hasOwnProperty.call(I,n))return n;console.warn("Unknown language ".concat(C))}return console.warn("Unknown locale ".concat(e,", falling back to English.")),"en"}catch(t){return console.error(t),console.warn("Unexpected error while normalizing locale ".concat(e,", falling back to English.")),"en"}}var Wi=class{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;let e=this.image.width,g=this.image.height;this.width=e,this.height=g;let t=Math.floor(g/2),A=Math.floor(g/4),C=Math.floor(g/8),i=Math.floor(g/16),n=Math.floor(e/2),r=Math.floor(e/4),o=Math.floor(e/8),s=Math.floor(e/16);this.canvas.width=3*r,this.canvas.height=t,this.coordinates=[[0,0,n,t],[n,0,r,A],[n,A,o,C],[5*o,A,s,i]],this._fillMipMap()}initialized(){return this.coordinates!==void 0}_fillMipMap(){let e=this.canvas.getContext("2d"),g=this.coordinates[0];e.drawImage(this.image,g[0],g[1],g[2],g[3]);for(let t=1;t<this.NUM_ITERATIONS;t++){let A=this.coordinates[t-1],C=this.coordinates[t];e.drawImage(this.canvas,A[0],A[1],A[2],A[3],C[0],C[1],C[2],C[3])}}drawImageAtPosition(e,g,t,A,C,i){if(this.initialized())if(g>2){g*=.5;let n=0;for(;g>2&&n<this.NUM_ITERATIONS;)g*=.5,n+=1;n>=this.NUM_ITERATIONS&&(n=this.NUM_ITERATIONS-1);let r=this.coordinates[n];e.drawImage(this.canvas,r[0],r[1],r[2],r[3],t,A,C,i)}else e.drawImage(this.image,t,A,C,i)}},_i=class{constructor(e){this.images={},this.imageBroken={},this.callback=e}_tryloadBrokenUrl(e,g,t){if(!(e===void 0||t===void 0)){if(g===void 0){console.warn("No broken url image defined");return}t.image.onerror=()=>{console.error("Could not load brokenImage:",g)},t.image.src=g}}_redrawWithImage(e){this.callback&&this.callback(e)}load(e,g){let t=this.images[e];if(t)return t;let A=new Wi;return this.images[e]=A,A.image.onload=()=>{this._fixImageCoordinates(A.image),A.init(),this._redrawWithImage(A)},A.image.onerror=()=>{console.error("Could not load image:",e),this._tryloadBrokenUrl(e,g,A)},A.image.src=e,A}_fixImageCoordinates(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}},Xl={exports:{}},x1=z,O1=x1(function(){if(typeof ArrayBuffer=="function"){var I=new ArrayBuffer(8);Object.isExtensible(I)&&Object.defineProperty(I,"a",{value:8})}}),P1=z,D1=ce,N1=sg,Rs=O1,rI=Object.isExtensible,R1=P1(function(){rI(1)}),S1=R1||Rs?function(e){return!D1(e)||Rs&&N1(e)==="ArrayBuffer"?!1:rI?rI(e):!0}:rI,k1=z,Jl=!k1(function(){return Object.isExtensible(Object.preventExtensions({}))}),M1=N,F1=Z,B1=lA,z1=ce,yr=ne,Z1=Oe.f,Ss=mA,L1=XI,wr=S1,G1=YI,V1=Jl,$l=!1,ng=G1("meta"),j1=0,Er=function(I){Z1(I,ng,{value:{objectID:"O"+j1++,weakData:{}}})},Y1=function(I,e){if(!z1(I))return typeof I=="symbol"?I:(typeof I=="string"?"S":"P")+I;if(!yr(I,ng)){if(!wr(I))return"F";if(!e)return"E";Er(I)}return I[ng].objectID},W1=function(I,e){if(!yr(I,ng)){if(!wr(I))return!0;if(!e)return!1;Er(I)}return I[ng].weakData},_1=function(I){return V1&&$l&&wr(I)&&!yr(I,ng)&&Er(I),I},K1=function(){U1.enable=function(){},$l=!0;var I=Ss.f,e=F1([].splice),g={};g[ng]=1,I(g).length&&(Ss.f=function(t){for(var A=I(t),C=0,i=A.length;C<i;C++)if(A[C]===ng){e(A,C,1);break}return A},M1({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:L1.f}))},U1=Xl.exports={enable:K1,fastKey:Y1,getWeakData:W1,onFreeze:_1};B1[ng]=!0;var nC=Xl.exports,H1=ee,Q1=yt,X1=H1("iterator"),J1=Array.prototype,$1=function(I){return I!==void 0&&(Q1.Array===I||J1[X1]===I)},q1=dg,ks=Qn,eP=ft,gP=yt,tP=ee,AP=tP("iterator"),ql=function(I){if(!eP(I))return ks(I,AP)||ks(I,"@@iterator")||gP[q1(I)]},IP=je,CP=Wg,iP=ag,nP=oA,rP=ql,oP=TypeError,eh=function(I,e){var g=arguments.length<2?rP(I):e;if(CP(g))return iP(IP(g,I));throw new oP(nP(I)+" is not iterable")},sP=je,Ms=ag,aP=Qn,dP=function(I,e,g){var t,A;Ms(I);try{if(t=aP(I,"return"),!t){if(e==="throw")throw g;return g}t=sP(t,I)}catch(C){A=!0,t=C}if(e==="throw")throw g;if(A)throw t;return Ms(t),g},lP=aA,hP=je,cP=ag,uP=oA,fP=$1,pP=Se,Fs=J,mP=eh,vP=ql,Bs=dP,bP=TypeError,oI=function(I,e){this.stopped=I,this.result=e},zs=oI.prototype,Tr=function(I,e,g){var t=g&&g.that,A=!!(g&&g.AS_ENTRIES),C=!!(g&&g.IS_RECORD),i=!!(g&&g.IS_ITERATOR),n=!!(g&&g.INTERRUPTED),r=lP(e,t),o,s,a,d,l,h,c,p=function(m){return o&&Bs(o,"normal",m),new oI(!0,m)},u=function(m){return A?(cP(m),n?r(m[0],m[1],p):r(m[0],m[1])):n?r(m,p):r(m)};if(C)o=I.iterator;else if(i)o=I;else{if(s=vP(I),!s)throw new bP(uP(I)+" is not iterable");if(fP(s)){for(a=0,d=pP(I);d>a;a++)if(l=u(I[a]),l&&Fs(zs,l))return l;return new oI(!1)}o=mP(I,s)}for(h=C?I.next:o.next;!(c=hP(h,o)).done;){try{l=u(c.value)}catch(m){Bs(o,"throw",m)}if(typeof l=="object"&&l&&Fs(zs,l))return l}return new oI(!1)},yP=J,wP=TypeError,xr=function(I,e){if(yP(e,I))return I;throw new wP("Incorrect invocation")},EP=N,TP=X,xP=nC,OP=z,PP=vt,DP=Tr,NP=xr,RP=le,SP=ce,kP=ft,MP=bt,FP=Oe.f,BP=Ng.forEach,zP=ie,gh=Kg,ZP=gh.set,LP=gh.getterFor,Or=function(I,e,g){var t=I.indexOf("Map")!==-1,A=I.indexOf("Weak")!==-1,C=t?"set":"add",i=TP[I],n=i&&i.prototype,r={},o;if(!zP||!RP(i)||!(A||n.forEach&&!OP(function(){new i().entries().next()})))o=g.getConstructor(e,I,t,C),xP.enable();else{o=e(function(d,l){ZP(NP(d,s),{type:I,collection:new i}),kP(l)||DP(l,d[C],{that:d,AS_ENTRIES:t})});var s=o.prototype,a=LP(I);BP(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(d){var l=d==="add"||d==="set";d in n&&!(A&&d==="clear")&&PP(s,d,function(h,c){var p=a(this).collection;if(!l&&A&&!SP(h))return d==="get"?void 0:!1;var u=p[d](h===0?0:h,c);return l?this:u})}),A||FP(s,"size",{configurable:!0,get:function(){return a(this).collection.size}})}return MP(o,I,!1,!0),r[I]=o,EP({global:!0,forced:!0},r),A||g.setStrong(o,I,t),o},GP=vA,Pr=function(I,e,g){for(var t in e)g&&g.unsafe&&I[t]?I[t]=e[t]:GP(I,t,e[t],g);return I},VP=We,jP=Ar,YP=ee,WP=ie,Zs=YP("species"),_P=function(I){var e=VP(I);WP&&e&&!e[Zs]&&jP(e,Zs,{configurable:!0,get:function(){return this}})},KP=pA,UP=Ar,Ls=Pr,HP=aA,QP=xr,XP=ft,JP=Tr,$P=or,QA=sr,qP=_P,Rt=ie,Gs=nC.fastKey,th=Kg,Vs=th.set,gi=th.getterFor,Ah={getConstructor:function(I,e,g,t){var A=I(function(o,s){QP(o,C),Vs(o,{type:e,index:KP(null),first:void 0,last:void 0,size:0}),Rt||(o.size=0),XP(s)||JP(s,o[t],{that:o,AS_ENTRIES:g})}),C=A.prototype,i=gi(e),n=function(o,s,a){var d=i(o),l=r(o,s),h,c;return l?l.value=a:(d.last=l={index:c=Gs(s,!0),key:s,value:a,previous:h=d.last,next:void 0,removed:!1},d.first||(d.first=l),h&&(h.next=l),Rt?d.size++:o.size++,c!=="F"&&(d.index[c]=l)),o},r=function(o,s){var a=i(o),d=Gs(s),l;if(d!=="F")return a.index[d];for(l=a.first;l;l=l.next)if(l.key===s)return l};return Ls(C,{clear:function(){for(var s=this,a=i(s),d=a.index,l=a.first;l;)l.removed=!0,l.previous&&(l.previous=l.previous.next=void 0),delete d[l.index],l=l.next;a.first=a.last=void 0,Rt?a.size=0:s.size=0},delete:function(o){var s=this,a=i(s),d=r(s,o);if(d){var l=d.next,h=d.previous;delete a.index[d.index],d.removed=!0,h&&(h.next=l),l&&(l.previous=h),a.first===d&&(a.first=l),a.last===d&&(a.last=h),Rt?a.size--:s.size--}return!!d},forEach:function(s){for(var a=i(this),d=HP(s,arguments.length>1?arguments[1]:void 0),l;l=l?l.next:a.first;)for(d(l.value,l.key,this);l&&l.removed;)l=l.previous},has:function(s){return!!r(this,s)}}),Ls(C,g?{get:function(s){var a=r(this,s);return a&&a.value},set:function(s,a){return n(this,s===0?0:s,a)}}:{add:function(s){return n(this,s=s===0?0:s,s)}}),Rt&&UP(C,"size",{configurable:!0,get:function(){return i(this).size}}),A},setStrong:function(I,e,g){var t=e+" Iterator",A=gi(e),C=gi(t);$P(I,e,function(i,n){Vs(this,{type:t,target:i,state:A(i),kind:n,last:void 0})},function(){for(var i=C(this),n=i.kind,r=i.last;r&&r.removed;)r=r.previous;return!i.target||!(i.last=r=r?r.next:i.state.first)?(i.target=void 0,QA(void 0,!0)):QA(n==="keys"?r.key:n==="values"?r.value:[r.key,r.value],!1)},g?"entries":"values",!g,!0),qP(e)}},eD=Or,gD=Ah;eD("Map",function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},gD);var Dr=Z,tD=_I,AD=qe,ID=CA,CD=Dr("".charAt),js=Dr("".charCodeAt),iD=Dr("".slice),Ys=function(I){return function(e,g){var t=AD(ID(e)),A=tD(g),C=t.length,i,n;return A<0||A>=C?I?"":void 0:(i=js(t,A),i<55296||i>56319||A+1===C||(n=js(t,A+1))<56320||n>57343?I?CD(t,A):i:I?iD(t,A,A+2):(i-55296<<10)+(n-56320)+65536)}},nD={codeAt:Ys(!1),charAt:Ys(!0)},rD=nD.charAt,oD=qe,Ih=Kg,sD=or,Ws=sr,Ch="String Iterator",aD=Ih.set,dD=Ih.getterFor(Ch);sD(String,"String",function(I){aD(this,{type:Ch,string:oD(I),index:0})},function(){var e=dD(this),g=e.string,t=e.index,A;return t>=g.length?Ws(void 0,!0):(A=rD(g,t),e.index+=A.length,Ws(A,!1))});var lD=L,hD=lD.Map,cD=hD,uD=cD,fD=uD,NA=D(fD),Ki=class{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},q(this.options,this.defaultOptions)}setOptions(e){let g=["useDefaultGroups"];if(e!==void 0){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&G(g).call(g,t)===-1){let A=e[t];this.add(t,A)}}}clear(){this._groups=new NA,this._groupNames=[]}get(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this._groups.get(e);if(t===void 0&&g)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){let A=this._groupIndex%this._groupNames.length;++this._groupIndex,t={},t.color=this._groups.get(this._groupNames[A]),this._groups.set(e,t)}else{let A=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,t={},t.color=this._defaultGroups[A],this._groups.set(e,t)}return t}add(e,g){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,g),g}},pD=N;pD({target:"Number",stat:!0},{isNaN:function(e){return e!==e}});var mD=L,vD=mD.Number.isNaN,bD=vD,yD=bD,wD=yD,Ui=D(wD),ED=X,TD=ED.isFinite,xD=Number.isFinite||function(e){return typeof e=="number"&&TD(e)},OD=N,PD=xD;OD({target:"Number",stat:!0},{isFinite:PD});var DD=L,ND=DD.Number.isFinite,RD=ND,SD=RD,kD=SD,Mg=D(kD),MD=N,FD=Ng.some,BD=wt,zD=BD("some");MD({target:"Array",proto:!0,forced:!zD},{some:function(e){return FD(this,e,arguments.length>1?arguments[1]:void 0)}});var ZD=Ie,LD=ZD("Array").some,GD=J,VD=LD,ti=Array.prototype,jD=function(I){var e=I.some;return I===ti||GD(ti,I)&&e===ti.some?VD:e},YD=jD,WD=YD,_D=WD,ih=D(_D),KD=L,UD=KD.Object.getOwnPropertySymbols,HD=UD,QD=HD,XD=QD,Xe=D(XD),nh={exports:{}},JD=N,$D=z,qD=Ye,rh=tA.f,oh=ie,e2=!oh||$D(function(){rh(1)});JD({target:"Object",stat:!0,forced:e2,sham:!oh},{getOwnPropertyDescriptor:function(e,g){return rh(qD(e),g)}});var g2=L,sh=g2.Object,t2=nh.exports=function(e,g){return sh.getOwnPropertyDescriptor(e,g)};sh.getOwnPropertyDescriptor.sham&&(t2.sham=!0);var A2=nh.exports,I2=A2,C2=I2,i2=C2,eg=D(i2),n2=N,r2=ie,o2=Ud,s2=Ye,a2=tA,d2=uA;n2({target:"Object",stat:!0,sham:!r2},{getOwnPropertyDescriptors:function(e){for(var g=s2(e),t=a2.f,A=o2(g),C={},i=0,n,r;A.length>i;)r=t(g,n=A[i++]),r!==void 0&&d2(C,n,r);return C}});var l2=L,h2=l2.Object.getOwnPropertyDescriptors,c2=h2,u2=c2,f2=u2,Je=D(f2),ah={exports:{}},p2=N,m2=ie,_s=HI.f;p2({target:"Object",stat:!0,forced:Object.defineProperties!==_s,sham:!m2},{defineProperties:_s});var v2=L,dh=v2.Object,b2=ah.exports=function(e,g){return dh.defineProperties(e,g)};dh.defineProperties.sham&&(b2.sham=!0);var y2=ah.exports,w2=y2,E2=w2,T2=E2,RA=D(T2),lh={exports:{}},x2=N,O2=ie,Ks=Oe.f;x2({target:"Object",stat:!0,forced:Object.defineProperty!==Ks,sham:!O2},{defineProperty:Ks});var P2=L,hh=P2.Object,D2=lh.exports=function(e,g,t){return hh.defineProperty(e,g,t)};hh.defineProperty.sham&&(D2.sham=!0);var N2=lh.exports,R2=N2,ch=R2,S2=ch,k2=S2,M2=k2,F2=M2,B2=F2,z2=D(B2),Z2=ee,L2=Oe.f,Us=Z2("metadata"),Hs=Function.prototype;Hs[Us]===void 0&&L2(Hs,Us,{value:null});var G2=$;G2("asyncDispose");var V2=$;V2("dispose");var j2=$;j2("metadata");var Y2=Kd,W2=Y2,_2=We,K2=Z,Nr=_2("Symbol"),U2=Nr.keyFor,H2=K2(Nr.prototype.valueOf),uh=Nr.isRegisteredSymbol||function(e){try{return U2(H2(e))!==void 0}catch(g){return!1}},Q2=N,X2=uh;Q2({target:"Symbol",stat:!0},{isRegisteredSymbol:X2});var J2=mt,fh=We,$2=Z,q2=rA,eN=ee,wI=fh("Symbol"),Qs=wI.isWellKnownSymbol,ph=fh("Object","getOwnPropertyNames"),gN=$2(wI.prototype.valueOf),Xs=J2("wks");for(XA=0,Ai=ph(wI),Js=Ai.length;XA<Js;XA++)try{Ii=Ai[XA],q2(wI[Ii])&&eN(Ii)}catch(I){}var Ii,XA,Ai,Js,mh=function(e){if(Qs&&Qs(e))return!0;try{for(var g=gN(e),t=0,A=ph(Xs),C=A.length;t<C;t++)if(Xs[A[t]]==g)return!0}catch(i){}return!1},tN=N,AN=mh;tN({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:AN});var IN=$;IN("matcher");var CN=$;CN("observable");var iN=N,nN=uh;iN({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:nN});var rN=N,oN=mh;rN({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:oN});var sN=$;sN("metadataKey");var aN=$;aN("patternMatch");var dN=$;dN("replaceAll");var lN=W2,hN=lN,cN=hN,JA=D(cN),uN=bA,fN=uN.f("iterator"),pN=fN,vh=pN,mN=vh,vN=mN,bN=vN,yN=bN,wN=yN,EN=D(wN);function $t(I){"@babel/helpers - typeof";return $t=typeof JA=="function"&&typeof EN=="symbol"?function(e){return typeof e}:function(e){return e&&typeof JA=="function"&&e.constructor===JA&&e!==JA.prototype?"symbol":typeof e},$t(I)}var TN=bA,xN=TN.f("toPrimitive"),ON=xN,PN=ON,DN=PN,NN=DN,RN=NN,SN=RN,kN=SN,MN=D(kN);function FN(I,e){if($t(I)!=="object"||I===null)return I;var g=I[MN];if(g!==void 0){var t=g.call(I,e||"default");if($t(t)!=="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(I)}function BN(I){var e=FN(I,"string");return $t(e)==="symbol"?e:String(e)}function ge(I,e,g){return e=BN(e),e in I?z2(I,e,{value:g,enumerable:!0,configurable:!0,writable:!0}):I[e]=g,I}var zN=Wg,ZN=xe,LN=jI,GN=Se,VN=TypeError,$s=function(I){return function(e,g,t,A){zN(g);var C=ZN(e),i=LN(C),n=GN(C),r=I?n-1:0,o=I?-1:1;if(t<2)for(;;){if(r in i){A=i[r],r+=o;break}if(r+=o,I?r<0:n<=r)throw new VN("Reduce of empty array with no initial value")}for(;I?r>=0:n>r;r+=o)r in i&&(A=g(A,i[r],r,C));return A}},jN={left:$s(!1),right:$s(!0)},YN=X,WN=sg,_N=WN(YN.process)==="process",KN=N,UN=jN.left,HN=wt,qs=nA,QN=_N,XN=!QN&&qs>79&&qs<83,JN=XN||!HN("reduce");KN({target:"Array",proto:!0,forced:JN},{reduce:function(e){var g=arguments.length;return UN(this,e,g,g>1?arguments[1]:void 0)}});var $N=Ie,qN=$N("Array").reduce,eR=J,gR=qN,Ci=Array.prototype,tR=function(I){var e=I.reduce;return I===Ci||eR(Ci,I)&&e===Ci.reduce?gR:e},AR=tR,IR=AR,CR=IR,Rr=D(CR),iR=Dg,nR=Se,rR=er,oR=aA,bh=function(I,e,g,t,A,C,i,n){for(var r=A,o=0,s=i?oR(i,n):!1,a,d;o<t;)o in g&&(a=s?s(g[o],o,e):g[o],C>0&&iR(a)?(d=nR(a),r=bh(I,e,a,d,r,C-1)-1):(rR(r+1),I[r]=a),r++),o++;return r},sR=bh,aR=N,dR=sR,lR=Wg,hR=xe,cR=Se,uR=UI;aR({target:"Array",proto:!0},{flatMap:function(e){var g=hR(this),t=cR(g),A;return lR(e),A=uR(g,0),A.length=dR(A,g,g,t,0,1,e,arguments.length>1?arguments[1]:void 0),A}});var fR=Ie,eF=fR("Array").flatMap;var gF=Array.prototype;var pR=vh,nt=D(pR),mR=Or,vR=Ah;mR("Set",function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},vR);var bR=L,yR=bR.Set,wR=yR,ER=wR,TR=ER,Le=D(TR),xR=eh,OR=xR,PR=OR,DR=PR,NR=DR,RR=NR,SR=RR,kR=SR,MR=kR,FR=MR,ii=D(FR),ea=sd,BR=Math.floor,Hi=function(I,e){var g=I.length,t=BR(g/2);return g<8?zR(I,e):ZR(I,Hi(ea(I,0,t),e),Hi(ea(I,t),e),e)},zR=function(I,e){for(var g=I.length,t=1,A,C;t<g;){for(C=t,A=I[t];C&&e(I[C-1],A)>0;)I[C]=I[--C];C!==t++&&(I[C]=A)}return I},ZR=function(I,e,g,t){for(var A=e.length,C=g.length,i=0,n=0;i<A||n<C;)I[i+n]=i<A&&n<C?t(e[i],g[n])<=0?e[i++]:g[n++]:i<A?e[i++]:g[n++];return I},LR=Hi,GR=iA,ga=GR.match(/firefox\/(\d+)/i),VR=!!ga&&+ga[1],jR=iA,YR=/MSIE|Trident/.test(jR),WR=iA,ta=WR.match(/AppleWebKit\/(\d+)\./),_R=!!ta&&+ta[1],KR=N,yh=Z,UR=Wg,HR=xe,Aa=Se,QR=Xd,Ia=qe,Sr=z,XR=LR,JR=wt,Ca=VR,$R=YR,ia=nA,na=_R,bg=[],ra=yh(bg.sort),qR=yh(bg.push),eS=Sr(function(){bg.sort(void 0)}),gS=Sr(function(){bg.sort(null)}),tS=JR("sort"),wh=!Sr(function(){if(ia)return ia<70;if(!(Ca&&Ca>3)){if($R)return!0;if(na)return na<603;var I="",e,g,t,A;for(e=65;e<76;e++){switch(g=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(A=0;A<47;A++)bg.push({k:g+A,v:t})}for(bg.sort(function(C,i){return i.v-C.v}),A=0;A<bg.length;A++)g=bg[A].k.charAt(0),I.charAt(I.length-1)!==g&&(I+=g);return I!=="DGBEFHACIJK"}}),AS=eS||!gS||!tS||!wh,IS=function(I){return function(e,g){return g===void 0?-1:e===void 0?1:I!==void 0?+I(e,g)||0:Ia(e)>Ia(g)?1:-1}};KR({target:"Array",proto:!0,forced:AS},{sort:function(e){e!==void 0&&UR(e);var g=HR(this);if(wh)return e===void 0?ra(g):ra(g,e);var t=[],A=Aa(g),C,i;for(i=0;i<A;i++)i in g&&qR(t,g[i]);for(XR(t,IS(e)),C=Aa(t),i=0;i<C;)g[i]=t[i++];for(;i<A;)QR(g,i++);return g}});var CS=Ie,iS=CS("Array").sort,nS=J,rS=iS,ni=Array.prototype,oS=function(I){var e=I.sort;return I===ni||nS(ni,I)&&e===ni.sort?rS:e},sS=oS,aS=sS,dS=aS,Cg=D(dS),lS=Ie,hS=lS("Array").keys,cS=hS,uS=cS,fS=dg,pS=ne,mS=J,vS=uS,ri=Array.prototype,bS={DOMTokenList:!0,NodeList:!0},yS=function(I){var e=I.keys;return I===ri||mS(ri,I)&&e===ri.keys||pS(bS,fS(I))?vS:e},wS=yS,tt=D(wS),ES=Ie,TS=ES("Array").values,xS=TS,OS=xS,PS=dg,DS=ne,NS=J,RS=OS,oi=Array.prototype,SS={DOMTokenList:!0,NodeList:!0},kS=function(I){var e=I.values;return I===oi||NS(oi,I)&&e===oi.values||DS(SS,PS(I))?RS:e},MS=kS,EI=D(MS),FS=Ie,BS=FS("Array").entries,zS=BS,ZS=zS,LS=dg,GS=ne,VS=J,jS=ZS,si=Array.prototype,YS={DOMTokenList:!0,NodeList:!0},WS=function(I){var e=I.entries;return I===si||VS(si,I)&&e===si.entries||GS(YS,LS(I))?jS:e},_S=WS,KS=D(_S),US=ch,SA=D(US),$A,HS=new Uint8Array(16);function QS(){if(!$A&&($A=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!$A))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return $A(HS)}var se=[];for(let I=0;I<256;++I)se.push((I+256).toString(16).slice(1));function XS(I,e=0){return se[I[e+0]]+se[I[e+1]]+se[I[e+2]]+se[I[e+3]]+"-"+se[I[e+4]]+se[I[e+5]]+"-"+se[I[e+6]]+se[I[e+7]]+"-"+se[I[e+8]]+se[I[e+9]]+"-"+se[I[e+10]]+se[I[e+11]]+se[I[e+12]]+se[I[e+13]]+se[I[e+14]]+se[I[e+15]]}var JS=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),oa={randomUUID:JS};function ot(I,e,g){if(oa.randomUUID&&!e&&!I)return oa.randomUUID();I=I||{};let t=I.random||(I.rng||QS)();if(t[6]=t[6]&15|64,t[8]=t[8]&63|128,e){g=g||0;for(let A=0;A<16;++A)e[g+A]=t[A];return e}return XS(t)}function sa(I,e){var g=U(I);if(Xe){var t=Xe(I);e&&(t=te(t).call(t,function(A){return eg(I,A).enumerable})),g.push.apply(g,t)}return g}function aa(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=sa(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):Je?RA(I,Je(A)):F(t=sa(Object(A))).call(t,function(C){SA(I,C,eg(A,C))})}return I}function da(I){return typeof I=="string"||typeof I=="number"}var Qi=class I{constructor(e){ge(this,"delay",void 0),ge(this,"max",void 0),ge(this,"_queue",[]),ge(this,"_timeout",null),ge(this,"_extended",null),this.delay=null,this.max=1/0,this.setOptions(e)}setOptions(e){e&&typeof e.delay!="undefined"&&(this.delay=e.delay),e&&typeof e.max!="undefined"&&(this.max=e.max),this._flushIfNeeded()}static extend(e,g){let t=new I(g);if(e.flush!==void 0)throw new Error("Target object already has a property flush");e.flush=()=>{t.flush()};let A=[{name:"flush",original:void 0}];if(g&&g.replace)for(let C=0;C<g.replace.length;C++){let i=g.replace[C];A.push({name:i,original:e[i]}),t.replace(e,i)}return t._extended={object:e,methods:A},t}destroy(){if(this.flush(),this._extended){let e=this._extended.object,g=this._extended.methods;for(let t=0;t<g.length;t++){let A=g[t];A.original?e[A.name]=A.original:delete e[A.name]}this._extended=null}}replace(e,g){let t=this,A=e[g];if(!A)throw new Error("Method "+g+" undefined");e[g]=function(){for(var C=arguments.length,i=new Array(C),n=0;n<C;n++)i[n]=arguments[n];t.queue({args:i,fn:A,context:this})}}queue(e){typeof e=="function"?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}_flushIfNeeded(){this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=He(()=>{this.flush()},this.delay))}flush(){var e,g;F(e=Ue(g=this._queue).call(g,0)).call(e,t=>{t.fn.apply(t.context||t.fn,t.args||[])})}},Xi=class I{constructor(){ge(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),ge(this,"subscribe",I.prototype.on),ge(this,"unsubscribe",I.prototype.off)}_trigger(e,g,t){var A;if(e==="*")throw new Error("Cannot trigger event *");F(A=[...this._subscribers[e],...this._subscribers["*"]]).call(A,C=>{C(e,g,t!=null?t:null)})}on(e,g){typeof g=="function"&&this._subscribers[e].push(g)}off(e,g){var t;this._subscribers[e]=te(t=this._subscribers[e]).call(t,A=>A!==g)}},TI=class I{constructor(e){ge(this,"_pairs",void 0),this._pairs=e}*[nt](){for(let[e,g]of this._pairs)yield[e,g]}*entries(){for(let[e,g]of this._pairs)yield[e,g]}*keys(){for(let[e]of this._pairs)yield e}*values(){for(let[,e]of this._pairs)yield e}toIdArray(){var e;return ae(e=[...this._pairs]).call(e,g=>g[0])}toItemArray(){var e;return ae(e=[...this._pairs]).call(e,g=>g[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){let e=Eg(null);for(let[g,t]of this._pairs)e[g]=t;return e}toMap(){return new NA(this._pairs)}toIdSet(){return new Le(this.toIdArray())}toItemSet(){return new Le(this.toItemArray())}cache(){return new I([...this._pairs])}distinct(e){let g=new Le;for(let[t,A]of this._pairs)g.add(e(A,t));return g}filter(e){let g=this._pairs;return new I({*[nt](){for(let[t,A]of g)e(A,t)&&(yield[t,A])}})}forEach(e){for(let[g,t]of this._pairs)e(t,g)}map(e){let g=this._pairs;return new I({*[nt](){for(let[t,A]of g)yield[t,e(A,t)]}})}max(e){let g=ii(this._pairs),t=g.next();if(t.done)return null;let A=t.value[1],C=e(t.value[1],t.value[0]);for(;!(t=g.next()).done;){let[i,n]=t.value,r=e(n,i);r>C&&(C=r,A=n)}return A}min(e){let g=ii(this._pairs),t=g.next();if(t.done)return null;let A=t.value[1],C=e(t.value[1],t.value[0]);for(;!(t=g.next()).done;){let[i,n]=t.value,r=e(n,i);r<C&&(C=r,A=n)}return A}reduce(e,g){for(let[t,A]of this._pairs)g=e(g,A,t);return g}sort(e){return new I({[nt]:()=>{var g;return ii(Cg(g=[...this._pairs]).call(g,(t,A)=>{let[C,i]=t,[n,r]=A;return e(i,r,C,n)}))}})}};function $S(I,e){return I[e]==null&&(I[e]=ot()),I}var rg=class extends Xi{get idProp(){return this._idProp}constructor(e,g){super(),ge(this,"flush",void 0),ge(this,"length",void 0),ge(this,"_options",void 0),ge(this,"_data",void 0),ge(this,"_idProp",void 0),ge(this,"_queue",null),e&&!B(e)&&(g=e,e=[]),this._options=g||{},this._data=new NA,this.length=0,this._idProp=this._options.fieldId||"id",e&&e.length&&this.add(e),this.setOptions(g)}setOptions(e){e&&e.queue!==void 0&&(e.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=Qi.extend(this,{replace:["add","update","remove"]})),e.queue&&typeof e.queue=="object"&&this._queue.setOptions(e.queue)))}add(e,g){let t=[],A;if(B(e)){let C=ae(e).call(e,i=>i[this._idProp]);if(ih(C).call(C,i=>this._data.has(i)))throw new Error("A duplicate id was found in the parameter array.");for(let i=0,n=e.length;i<n;i++)A=this._addItem(e[i]),t.push(A)}else if(e&&typeof e=="object")A=this._addItem(e),t.push(A);else throw new Error("Unknown dataType");return t.length&&this._trigger("add",{items:t},g),t}update(e,g){let t=[],A=[],C=[],i=[],n=this._idProp,r=o=>{let s=o[n];if(s!=null&&this._data.has(s)){let a=o,d=q({},this._data.get(s)),l=this._updateItem(a);A.push(l),i.push(a),C.push(d)}else{let a=this._addItem(o);t.push(a)}};if(B(e))for(let o=0,s=e.length;o<s;o++)e[o]&&typeof e[o]=="object"?r(e[o]):console.warn("Ignoring input item, which is not an object at index "+o);else if(e&&typeof e=="object")r(e);else throw new Error("Unknown dataType");if(t.length&&this._trigger("add",{items:t},g),A.length){let o={items:A,oldData:C,data:i};this._trigger("update",o,g)}return $d(t).call(t,A)}updateOnly(e,g){var t;B(e)||(e=[e]);let A=ae(t=ae(e).call(e,C=>{let i=this._data.get(C[this._idProp]);if(i==null)throw new Error("Updating non-existent items is not allowed.");return{oldData:i,update:C}})).call(t,C=>{let{oldData:i,update:n}=C,r=i[this._idProp],o=RO(i,n);return this._data.set(r,o),{id:r,oldData:i,updatedData:o}});if(A.length){let C={items:ae(A).call(A,i=>i.id),oldData:ae(A).call(A,i=>i.oldData),data:ae(A).call(A,i=>i.updatedData)};return this._trigger("update",C,g),C.items}else return[]}get(e,g){let t,A,C;da(e)?(t=e,C=g):B(e)?(A=e,C=g):C=e;let i=C&&C.returnType==="Object"?"Object":"Array",n=C&&te(C),r=[],o,s,a;if(t!=null)o=this._data.get(t),o&&n&&!n(o)&&(o=void 0);else if(A!=null)for(let h=0,c=A.length;h<c;h++)o=this._data.get(A[h]),o!=null&&(!n||n(o))&&r.push(o);else{var d;s=[...tt(d=this._data).call(d)];for(let h=0,c=s.length;h<c;h++)a=s[h],o=this._data.get(a),o!=null&&(!n||n(o))&&r.push(o)}if(C&&C.order&&t==null&&this._sort(r,C.order),C&&C.fields){let h=C.fields;if(t!=null&&o!=null)o=this._filterFields(o,h);else for(let c=0,p=r.length;c<p;c++)r[c]=this._filterFields(r[c],h)}if(i=="Object"){let h={};for(let c=0,p=r.length;c<p;c++){let u=r[c],m=u[this._idProp];h[m]=u}return h}else if(t!=null){var l;return(l=o)!==null&&l!==void 0?l:null}else return r}getIds(e){let g=this._data,t=e&&te(e),A=e&&e.order,C=[...tt(g).call(g)],i=[];if(t)if(A){let n=[];for(let r=0,o=C.length;r<o;r++){let s=C[r],a=this._data.get(s);a!=null&&t(a)&&n.push(a)}this._sort(n,A);for(let r=0,o=n.length;r<o;r++)i.push(n[r][this._idProp])}else for(let n=0,r=C.length;n<r;n++){let o=C[n],s=this._data.get(o);s!=null&&t(s)&&i.push(s[this._idProp])}else if(A){let n=[];for(let r=0,o=C.length;r<o;r++){let s=C[r];n.push(g.get(s))}this._sort(n,A);for(let r=0,o=n.length;r<o;r++)i.push(n[r][this._idProp])}else for(let n=0,r=C.length;n<r;n++){let o=C[n],s=g.get(o);s!=null&&i.push(s[this._idProp])}return i}getDataSet(){return this}forEach(e,g){let t=g&&te(g),A=this._data,C=[...tt(A).call(A)];if(g&&g.order){let i=this.get(g);for(let n=0,r=i.length;n<r;n++){let o=i[n],s=o[this._idProp];e(o,s)}}else for(let i=0,n=C.length;i<n;i++){let r=C[i],o=this._data.get(r);o!=null&&(!t||t(o))&&e(o,r)}}map(e,g){let t=g&&te(g),A=[],C=this._data,i=[...tt(C).call(C)];for(let n=0,r=i.length;n<r;n++){let o=i[n],s=this._data.get(o);s!=null&&(!t||t(s))&&A.push(e(s,o))}return g&&g.order&&this._sort(A,g.order),A}_filterFields(e,g){var t;return e&&Rr(t=B(g)?g:U(g)).call(t,(A,C)=>(A[C]=e[C],A),{})}_sort(e,g){if(typeof g=="string"){let t=g;Cg(e).call(e,(A,C)=>{let i=A[t],n=C[t];return i>n?1:i<n?-1:0})}else if(typeof g=="function")Cg(e).call(e,g);else throw new TypeError("Order must be a function or a string")}remove(e,g){let t=[],A=[],C=B(e)?e:[e];for(let i=0,n=C.length;i<n;i++){let r=this._remove(C[i]);if(r){let o=r[this._idProp];o!=null&&(t.push(o),A.push(r))}}return t.length&&this._trigger("remove",{items:t,oldData:A},g),t}_remove(e){let g;if(da(e)?g=e:e&&typeof e=="object"&&(g=e[this._idProp]),g!=null&&this._data.has(g)){let t=this._data.get(g)||null;return this._data.delete(g),--this.length,t}return null}clear(e){var g;let t=[...tt(g=this._data).call(g)],A=[];for(let C=0,i=t.length;C<i;C++)A.push(this._data.get(t[C]));return this._data.clear(),this.length=0,this._trigger("remove",{items:t,oldData:A},e),t}max(e){let g=null,t=null;for(let C of EI(A=this._data).call(A)){var A;let i=C[e];typeof i=="number"&&(t==null||i>t)&&(g=C,t=i)}return g||null}min(e){let g=null,t=null;for(let C of EI(A=this._data).call(A)){var A;let i=C[e];typeof i=="number"&&(t==null||i<t)&&(g=C,t=i)}return g||null}distinct(e){let g=this._data,t=[...tt(g).call(g)],A=[],C=0;for(let i=0,n=t.length;i<n;i++){let r=t[i],s=g.get(r)[e],a=!1;for(let d=0;d<C;d++)if(A[d]==s){a=!0;break}!a&&s!==void 0&&(A[C]=s,C++)}return A}_addItem(e){let g=$S(e,this._idProp),t=g[this._idProp];if(this._data.has(t))throw new Error("Cannot add item: item with id "+t+" already exists");return this._data.set(t,g),++this.length,t}_updateItem(e){let g=e[this._idProp];if(g==null)throw new Error("Cannot update item: item has no id (item: "+Et(e)+")");let t=this._data.get(g);if(!t)throw new Error("Cannot update item: no item with id "+g+" found");return this._data.set(g,aa(aa({},t),e)),g}stream(e){if(e){let t=this._data;return new TI({*[nt](){for(let A of e){let C=t.get(A);C!=null&&(yield[A,C])}}})}else{var g;return new TI({[nt]:b(g=KS(this._data)).call(g,this._data)})}}};function qS(I,e){return typeof e=="object"&&e!==null&&I===e.idProp&&typeof e.add=="function"&&typeof e.clear=="function"&&typeof e.distinct=="function"&&typeof F(e)=="function"&&typeof e.get=="function"&&typeof e.getDataSet=="function"&&typeof e.getIds=="function"&&typeof e.length=="number"&&typeof ae(e)=="function"&&typeof e.max=="function"&&typeof e.min=="function"&&typeof e.off=="function"&&typeof e.on=="function"&&typeof e.remove=="function"&&typeof e.setOptions=="function"&&typeof e.stream=="function"&&typeof e.update=="function"&&typeof e.updateOnly=="function"}function Eh(I,e){return typeof e=="object"&&e!==null&&I===e.idProp&&typeof F(e)=="function"&&typeof e.get=="function"&&typeof e.getDataSet=="function"&&typeof e.getIds=="function"&&typeof e.length=="number"&&typeof ae(e)=="function"&&typeof e.off=="function"&&typeof e.on=="function"&&typeof e.stream=="function"&&qS(I,e.getDataSet())}var Th=X,ek=z,gk=Z,tk=qe,Ak=tl.trim,Ik=ar,Ck=gk("".charAt),xI=Th.parseFloat,la=Th.Symbol,ha=la&&la.iterator,ik=1/xI(Ik+"-0")!==-1/0||ha&&!ek(function(){xI(Object(ha))}),nk=ik?function(e){var g=Ak(tk(e)),t=xI(g);return t===0&&Ck(g,0)==="-"?-0:t}:xI,rk=N,ca=nk;rk({global:!0,forced:parseFloat!==ca},{parseFloat:ca});var ok=L,sk=ok.parseFloat,ak=sk,dk=ak,lk=dk,xh=D(lk),hk=N,ck=z,uk=XI.f,fk=ck(function(){return!Object.getOwnPropertyNames(1)});hk({target:"Object",stat:!0,forced:fk},{getOwnPropertyNames:uk});var pk=L,mk=pk.Object,vk=function(e){return mk.getOwnPropertyNames(e)},bk=vk,yk=bk,wk=yk,Ek=D(wk);function kr(I,e){let g=["node","edge","label"],t=!0,A=pg(e,"chosen");if(typeof A=="boolean")t=A;else if(typeof A=="object"){if(G(g).call(g,I)===-1)throw new Error("choosify: subOption '"+I+"' should be one of '"+g.join("', '")+"'");let C=pg(e,["chosen",I]);(typeof C=="boolean"||typeof C=="function")&&(t=C)}return t}function Ji(I,e,g){if(I.width<=0||I.height<=0)return!1;if(g!==void 0){let C={x:e.x-g.x,y:e.y-g.y};if(g.angle!==0){let i=-g.angle;e={x:Math.cos(i)*C.x-Math.sin(i)*C.y,y:Math.sin(i)*C.x+Math.cos(i)*C.y}}else e=C}let t=I.x+I.width,A=I.y+I.width;return I.left<e.x&&t>e.x&&I.top<e.y&&A>e.y}function OI(I){return typeof I=="string"&&I!==""}function Oh(I,e,g,t){let A=t.x,C=t.y;if(typeof t.distanceToBorder=="function"){let i=t.distanceToBorder(I,e),n=Math.sin(e)*i,r=Math.cos(e)*i;r===i?(A+=i,C=t.y):n===i?(A=t.x,C-=i):(A+=r,C-=n)}else t.shape.width>t.shape.height?(A=t.x+t.shape.width*.5,C=t.y-g):(A=t.x+g,C=t.y-t.shape.height*.5);return{x:A,y:C}}var $i=class{constructor(e){this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});let A=g;(g===void 0||g==="")&&(A=" ");let C=this.measureText(A,t),i=q({},EI(C));i.text=g,i.width=C.width,i.mod=t,(g===void 0||g==="")&&(i.width=0),this.lines[e].blocks.push(i),this.lines[e].width+=i.width}curWidth(){let e=this.lines[this.current];return e===void 0?0:e.width}append(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,g)}newLine(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,g),this.current++}determineLineHeights(){for(let e=0;e<this.lines.length;e++){let g=this.lines[e],t=0;if(g.blocks!==void 0)for(let A=0;A<g.blocks.length;A++){let C=g.blocks[A];t<C.height&&(t=C.height)}g.height=t}}determineLabelSize(){let e=0,g=0;for(let t=0;t<this.lines.length;t++){let A=this.lines[t];A.width>e&&(e=A.width),g+=A.height}this.width=e,this.height=g}removeEmptyBlocks(){let e=[];for(let g=0;g<this.lines.length;g++){let t=this.lines[g];if(t.blocks.length===0||g===this.lines.length-1&&t.width===0)continue;let A={};q(A,t),A.blocks=[];let C,i=[];for(let n=0;n<t.blocks.length;n++){let r=t.blocks[n];r.width!==0?i.push(r):C===void 0&&(C=r)}i.length===0&&C!==void 0&&i.push(C),A.blocks=i,e.push(A)}return e}finalize(){this.determineLineHeights(),this.determineLabelSize();let e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}},Tk={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},PI=class{constructor(e){this.text=e,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}mod(){return this.modStack.length===0?"normal":this.modStack[0]}modName(){if(this.modStack.length===0)return"normal";if(this.modStack[0]==="mono")return"mono";if(this.bold&&this.ital)return"boldital";if(this.bold)return"bold";if(this.ital)return"ital"}emitBlock(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}add(e){e===" "&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1),e!=" "&&(this.buffer+=e)}parseWS(e){return/[ \t]/.test(e)?(this.mono?this.add(e):this.spacing=!0,!0):!1}setTag(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}unsetTag(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}parseStartTag(e,g){return!this.mono&&!this[e]&&this.match(g)?(this.setTag(e),!0):!1}match(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,[t,A]=this.prepareRegExp(e),C=t.test(this.text.substr(this.position,A));return C&&g&&(this.position+=A-1),C}parseEndTag(e,g,t){let A=this.mod()===e;return e==="mono"?A=A&&this.mono:A=A&&!this.mono,A&&this.match(g)?(t!==void 0?(this.position===this.text.length-1||this.match(t,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}replace(e,g){return this.match(e)?(this.add(g),this.position+=length-1,!0):!1}prepareRegExp(e){let g,t;if(e instanceof RegExp)t=e,g=1;else{let A=Tk[e];A!==void 0?t=A:t=new RegExp(e),g=e.length}return[t,g]}},qi=class{constructor(e,g,t,A){this.ctx=e,this.parent=g,this.selected=t,this.hover=A;let C=(i,n)=>{if(i===void 0)return 0;let r=this.parent.getFormattingValues(e,t,A,n),o=0;return i!==""&&(o=this.ctx.measureText(i).width),{width:o,values:r}};this.lines=new $i(C)}process(e){if(!OI(e))return this.lines.finalize();let g=this.parent.fontOptions;e=e.replace(/\r\n/g,`
651
651
  `),e=e.replace(/\r/g,`
652
652
  `);let t=String(e).split(`
653
- `),A=t.length;if(g.multi)for(let C=0;C<A;C++){let i=this.splitBlocks(t[C],g.multi);if(i!==void 0){if(i.length===0){this.lines.newLine("");continue}if(g.maxWdt>0)for(let n=0;n<i.length;n++){let o=i[n].mod,s=i[n].text;this.splitStringIntoLines(s,o,!0)}else for(let n=0;n<i.length;n++){let o=i[n].mod,s=i[n].text;this.lines.append(s,o)}this.lines.newLine()}}else if(g.maxWdt>0)for(let C=0;C<A;C++)this.splitStringIntoLines(t[C]);else for(let C=0;C<A;C++)this.lines.newLine(t[C]);return this.lines.finalize()}decodeMarkupSystem(e){let g="none";return e==="markdown"||e==="md"?g="markdown":(e===!0||e==="html")&&(g="html"),g}splitHtmlBlocks(e){let g=new PI(e),t=A=>/&/.test(A)?(g.replace(g.text,"&lt;","<")||g.replace(g.text,"&amp;","&")||g.add("&"),!0):!1;for(;g.position<g.text.length;){let A=g.text.charAt(g.position);g.parseWS(A)||/</.test(A)&&(g.parseStartTag("bold","<b>")||g.parseStartTag("ital","<i>")||g.parseStartTag("mono","<code>")||g.parseEndTag("bold","</b>")||g.parseEndTag("ital","</i>")||g.parseEndTag("mono","</code>"))||t(A)||g.add(A),g.position++}return g.emitBlock(),g.blocks}splitMarkdownBlocks(e){let g=new PI(e),t=!0,A=C=>/\\/.test(C)?(g.position<this.text.length+1&&(g.position++,C=this.text.charAt(g.position),/ \t/.test(C)?g.spacing=!0:(g.add(C),t=!1)),!0):!1;for(;g.position<g.text.length;){let C=g.text.charAt(g.position);g.parseWS(C)||A(C)||(t||g.spacing)&&(g.parseStartTag("bold","*")||g.parseStartTag("ital","_")||g.parseStartTag("mono","`"))||g.parseEndTag("bold","*","afterBold")||g.parseEndTag("ital","_","afterItal")||g.parseEndTag("mono","`","afterMono")||(g.add(C),t=!1),g.position++}return g.emitBlock(),g.blocks}splitBlocks(e,g){let t=this.decodeMarkupSystem(g);if(t==="none")return[{text:e,mod:"normal"}];if(t==="markdown")return this.splitMarkdownBlocks(e);if(t==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){let g=this.ctx.measureText(e).width;return this.lines.curWidth()+g>this.parent.fontOptions.maxWdt}getLongestFit(e){let g="",t=0;for(;t<e.length;){let C=g+(g===""?"":" ")+e[t];if(this.overMaxWidth(C))break;g=C,t++}return t}getLongestFitWord(e){let g=0;for(;g<e.length&&!this.overMaxWidth(Ze(e).call(e,0,g));)g++;return g}splitStringIntoLines(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,g),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let A=e.split("\r");for(;A.length>0;){let C=this.getLongestFit(A);if(C===0){let i=A[0],n=this.getLongestFitWord(i);this.lines.newLine(Ze(i).call(i,0,n),g),A[0]=Ze(i).call(i,n)}else{let i=C;A[C-1]===" "?C--:A[i]===" "&&i++;let n=Ze(A).call(A,0,C).join("");C==A.length&&t?this.lines.append(n,g):this.lines.newLine(n,g),A=Ze(A).call(A,i)}}}},St=["bold","ital","boldital","mono"],DI=class I{constructor(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(g),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=t}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),OI(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){let g=e.font.size;g!==void 0&&(this.baseSize=g)}}}initFontOptions(e){if(S(St,g=>{this.fontOptions[g]={}}),I.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}S(e,(g,t)=>{g!=null&&typeof g!="object"&&(this.fontOptions[t]=g)})}static parseFontString(e,g){if(!g||typeof g!="string")return!1;let t=g.split(" ");return e.size=+t[0].replace("px",""),e.face=t[1],e.color=t[2],!0}constrain(e){let g={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},t=fg(e,"widthConstraint");if(typeof t=="number")g.maxWdt=Number(t),g.minWdt=Number(t);else if(typeof t=="object"){let C=fg(e,["widthConstraint","maximum"]);typeof C=="number"&&(g.maxWdt=Number(C));let i=fg(e,["widthConstraint","minimum"]);typeof i=="number"&&(g.minWdt=Number(i))}let A=fg(e,"heightConstraint");if(typeof A=="number")g.minHgt=Number(A);else if(typeof A=="object"){let C=fg(e,["heightConstraint","minimum"]);typeof C=="number"&&(g.minHgt=Number(C));let i=fg(e,["heightConstraint","valign"]);typeof i=="string"&&(i==="top"||i==="bottom")&&(g.valign=i)}return g}update(e,g){this.setOptions(e,!0),this.propagateFonts(g),_(this.fontOptions,this.constrain(g)),this.fontOptions.chooser=Mo("label",g)}adjustSizes(e){let g=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=g,this.fontOptions.minWdt-=g);let t=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=t)}addFontOptionsToPile(e,g){for(let t=0;t<g.length;++t)this.addFontToPile(e,g[t])}addFontToPile(e,g){if(g===void 0||g.font===void 0||g.font===null)return;let t=g.font;e.push(t)}getBasicOptions(e){let g={};for(let t=0;t<e.length;++t){let A=e[t],C={};I.parseFontString(C,A)&&(A=C),S(A,(i,n)=>{i!==void 0&&(Object.prototype.hasOwnProperty.call(g,n)||(G(St).call(St,n)!==-1?g[n]={}:g[n]=i))})}return g}getFontOption(e,g,t){let A;for(let C=0;C<e.length;++C){let i=e[C];if(Object.prototype.hasOwnProperty.call(i,g)){if(A=i[g],A==null)continue;let n={};if(I.parseFontString(n,A)&&(A=n),Object.prototype.hasOwnProperty.call(A,t))return A[t]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,t))return this.fontOptions[t];throw new Error("Did not find value for multi-font for property: '"+t+"'")}getFontOptions(e,g){let t={},A=["color","size","face","mod","vadjust"];for(let C=0;C<A.length;++C){let i=A[C];t[i]=this.getFontOption(e,g,i)}return t}propagateFonts(e){let g=[];this.addFontOptionsToPile(g,e),this.fontOptions=this.getBasicOptions(g);for(let t=0;t<St.length;++t){let A=St[t],C=this.fontOptions[A],i=this.getFontOptions(g,A);S(i,(n,o)=>{C[o]=n}),C.size=Number(C.size),C.vadjust=Number(C.vadjust)}}draw(e,g,t,A,C){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label===void 0)return;let n=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&n<this.elementOptions.scaling.label.drawThreshold-1||(n>=this.elementOptions.scaling.label.maxVisible&&(n=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,A,C,g,t,i),this._drawBackground(e),this._drawText(e,g,this.size.yLine,i,n))}_drawBackground(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;let g=this.getSize();e.fillRect(g.left,g.top,g.width,g.height)}}_drawText(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",C=arguments.length>4?arguments[4]:void 0;[g,t]=this._setAlignment(e,g,t,A),e.textAlign="left",g=g-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(t-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(t+=(this.size.height-this.size.labelHeight)/2));for(let i=0;i<this.lineCount;i++){let n=this.lines[i];if(n&&n.blocks){let o=0;this.isEdgeLabel||this.fontOptions.align==="center"?o+=(this.size.width-n.width)/2:this.fontOptions.align==="right"&&(o+=this.size.width-n.width);for(let s=0;s<n.blocks.length;s++){let r=n.blocks[s];e.font=r.font;let[a,d]=this._getColor(r.color,C,r.strokeColor);r.strokeWidth>0&&(e.lineWidth=r.strokeWidth,e.strokeStyle=d,e.lineJoin="round"),e.fillStyle=a,r.strokeWidth>0&&e.strokeText(r.text,g+o,t+r.vadjust),e.fillText(r.text,g+o,t+r.vadjust),o+=r.width}t+=n.height}}}_setAlignment(e,g,t,A){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){g=0,t=0;let C=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",t-=2*C):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",t+=2*C):e.textBaseline="middle"}else e.textBaseline=A;return[g,t]}_getColor(e,g,t){let A=e||"#000000",C=t||"#ffffff";if(g<=this.elementOptions.scaling.label.drawThreshold){let i=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-g)));A=Ne(A,i),C=Ne(C,i)}return[A,C]}getTextSize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,g,t),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let g=this.size.left,t=this.size.top-.5*2;if(this.isEdgeLabel){let C=-this.size.width*.5;switch(this.fontOptions.align){case"middle":g=C,t=-this.size.height*.5;break;case"top":g=C,t=-(this.size.height+2);break;case"bottom":g=C,t=2;break}}return{left:g,top:t,width:this.size.width,height:this.size.height}}calculateLabelSize(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,g,t),this.size.left=A-this.size.width*.5,this.size.top=C-this.size.height*.5,this.size.yLine=C+(1-this.lineCount)*.5*this.fontOptions.size,i==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(e,g,t,A){let C=function(o,s,r){return s==="normal"?r==="mod"?"":o[r]:o[s][r]!==void 0?o[s][r]:o[r]},i={color:C(this.fontOptions,A,"color"),size:C(this.fontOptions,A,"size"),face:C(this.fontOptions,A,"face"),mod:C(this.fontOptions,A,"mod"),vadjust:C(this.fontOptions,A,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(g||t)&&(A==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?i.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(i,this.elementOptions.id,g,t));let n="";return i.mod!==void 0&&i.mod!==""&&(n+=i.mod+" "),n+=i.size+"px "+i.face,e.font=n.replace(/"/g,""),i.font=e.font,i.height=i.size,i}differentState(e,g){return e!==this.selectedState||g!==this.hoverState}_processLabelText(e,g,t,A){return new qi(e,this,g,t).process(A)}_processLabel(e,g,t){if(this.labelDirty===!1&&!this.differentState(g,t))return;let A=this._processLabelText(e,g,t,this.elementOptions.label);this.fontOptions.minWdt>0&&A.width<this.fontOptions.minWdt&&(A.width=this.fontOptions.minWdt),this.size.labelHeight=A.height,this.fontOptions.minHgt>0&&A.height<this.fontOptions.minHgt&&(A.height=this.fontOptions.minHgt),this.lines=A.lines,this.lineCount=A.lines.length,this.size.width=A.width,this.size.height=A.height,this.selectedState=g,this.hoverState=t,this.labelDirty=!1}visible(){return!(this.size.width===0||this.size.height===0||this.elementOptions.label===void 0||this.fontOptions.size*this.body.view.scale<this.elementOptions.scaling.label.drawThreshold-1)}},og=class{constructor(e,g,t){this.body=g,this.labelModule=t,this.setOptions(e),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.margin=void 0,this.refreshNeeded=!0,this.boundingBox={top:0,left:0,right:0,bottom:0}}setOptions(e){this.options=e}_setMargins(e){this.margin={},this.options.margin&&(typeof this.options.margin=="object"?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),e.adjustSizes(this.margin)}_distanceToBorder(e,g){let t=this.options.borderWidth;return e&&this.resize(e),Math.min(Math.abs(this.width/2/Math.cos(g)),Math.abs(this.height/2/Math.sin(g)))+t}enableShadow(e,g){g.shadow&&(e.shadowColor=g.shadowColor,e.shadowBlur=g.shadowSize,e.shadowOffsetX=g.shadowX,e.shadowOffsetY=g.shadowY)}disableShadow(e,g){g.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}enableBorderDashes(e,g){if(g.borderDashes!==!1)if(e.setLineDash!==void 0){let t=g.borderDashes;t===!0&&(t=[5,15]),e.setLineDash(t)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,g.borderDashes=!1}disableBorderDashes(e,g){g.borderDashes!==!1&&(e.setLineDash!==void 0?e.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,g.borderDashes=!1))}needsRefresh(e,g){return this.refreshNeeded===!0?(this.refreshNeeded=!1,!0):this.width===void 0||this.labelModule.differentState(e,g)}initContextForDraw(e,g){let t=g.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,t),e.strokeStyle=g.borderColor,e.fillStyle=g.color}performStroke(e,g){let t=g.borderWidth/this.body.view.scale;e.save(),t>0&&(this.enableBorderDashes(e,g),e.stroke(),this.disableBorderDashes(e,g)),e.restore()}performFill(e,g){e.save(),e.fillStyle=g.color,this.enableShadow(e,g),EA(e).call(e),this.disableShadow(e,g),e.restore(),this.performStroke(e,g)}_addBoundingBoxMargin(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}_updateBoundingBox(e,g,t,A,C){t!==void 0&&this.resize(t,A,C),this.left=e-this.width/2,this.top=g-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(e,g,t,A,C){this._updateBoundingBox(e,g,t,A,C)}getDimensionsFromLabel(e,g,t){this.textSize=this.labelModule.getTextSize(e,g,t);let A=this.textSize.width,C=this.textSize.height,i=14;return A===0&&(A=i,C=i),{width:A,height:C}}},xk=class extends og{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(g,t)){let A=this.getDimensionsFromLabel(e,g,t);this.width=A.width+this.margin.right+this.margin.left,this.height=A.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width/2,this.top=t-this.height/2,this.initContextForDraw(e,i),Xa(e,this.left,this.top,this.width,this.height,i.borderRadius),this.performFill(e,i),this.updateBoundingBox(g,t,e,A,C),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,C)}updateBoundingBox(e,g,t,A,C){this._updateBoundingBox(e,g,t,A,C);let i=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(i)}distanceToBorder(e,g){e&&this.resize(e);let t=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(g)),Math.abs(this.height/2/Math.sin(g)))+t}},qt=class extends og{constructor(e,g,t){super(e,g,t),this.labelOffset=0,this.selected=!1}setOptions(e,g,t){this.options=e,g===void 0&&t===void 0||this.setImages(g,t)}setImages(e,g){g&&this.selected?(this.imageObj=g,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=g)}switchImages(e){let g=e&&!this.selected||!e&&this.selected;if(this.selected=e,this.imageObjAlt!==void 0&&g){let t=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=t}}_getImagePadding(){let e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){let g=this.options.imagePadding;typeof g=="object"?(e.top=g.top,e.right=g.right,e.bottom=g.bottom,e.left=g.left):(e.top=g,e.right=g,e.bottom=g,e.left=g)}return e}_resizeImage(){let e,g;if(this.options.shapeProperties.useImageSize===!1){let t=1,A=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?t=this.imageObj.width/this.imageObj.height:A=this.imageObj.height/this.imageObj.width),e=this.options.size*2*t,g=this.options.size*2*A}else{let t=this._getImagePadding();e=this.imageObj.width+t.left+t.right,g=this.imageObj.height+t.top+t.bottom}this.width=e,this.height=g,this.radius=.5*this.width}_drawRawCircle(e,g,t,A){this.initContextForDraw(e,A),qn(e,g,t,A.size),this.performFill(e,A)}_drawImageAtPosition(e,g){if(this.imageObj.width!=0){e.globalAlpha=g.opacity!==void 0?g.opacity:1,this.enableShadow(e,g);let t=1;this.options.shapeProperties.interpolation===!0&&(t=this.imageObj.width/this.width/this.body.view.scale);let A=this._getImagePadding(),C=this.left+A.left,i=this.top+A.top,n=this.width-A.left-A.right,o=this.height-A.top-A.bottom;this.imageObj.drawImageAtPosition(e,t,C,i,n,o),this.disableShadow(e,g)}}_drawImageLabel(e,g,t,A,C){let i=0;if(this.height!==void 0){i=this.height*.5;let o=this.labelModule.getTextSize(e,A,C);o.lineCount>=1&&(i+=o.height/2)}let n=t+i;this.options.label&&(this.labelOffset=i),this.labelModule.draw(e,g,n,A,C,"hanging")}},Ok=class extends qt{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(g,t)){let A=this.getDimensionsFromLabel(e,g,t),C=Math.max(A.width+this.margin.right+this.margin.left,A.height+this.margin.top+this.margin.bottom);this.options.size=C/2,this.width=C,this.height=C,this.radius=this.width/2}}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width/2,this.top=t-this.height/2,this._drawRawCircle(e,g,t,i),this.updateBoundingBox(g,t),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,t,A,C)}updateBoundingBox(e,g){this.boundingBox.top=g-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=g+this.options.size}distanceToBorder(e){return e&&this.resize(e),this.width*.5}},en=class extends qt{constructor(e,g,t,A,C){super(e,g,t),this.setImages(A,C)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){let C=this.options.size*2;this.width=C,this.height=C,this.radius=.5*this.width;return}this.needsRefresh(g,t)&&this._resizeImage()}draw(e,g,t,A,C,i){this.switchImages(A),this.resize();let n=g,o=t;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=g,this.top=t,n+=this.width/2,o+=this.height/2):(this.left=g-this.width/2,this.top=t-this.height/2),this._drawRawCircle(e,n,o,i),e.save(),e.clip(),this._drawImageAtPosition(e,i),e.restore(),this._drawImageLabel(e,n,o,A,C),this.updateBoundingBox(g,t)}updateBoundingBox(e,g){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=g,this.boundingBox.left=e,this.boundingBox.right=e+this.options.size*2,this.boundingBox.bottom=g+this.options.size*2):(this.boundingBox.top=g-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=g+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(e){return e&&this.resize(e),this.width*.5}},$e=class extends og{constructor(e,g,t){super(e,g,t)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(g,t)){var C,i;this.labelModule.getTextSize(e,g,t);let n=2*A.size;this.width=(C=this.customSizeWidth)!==null&&C!==void 0?C:n,this.height=(i=this.customSizeHeight)!==null&&i!==void 0?i:n,this.radius=.5*this.width}}_drawShape(e,g,t,A,C,i,n,o){return this.resize(e,i,n,o),this.left=A-this.width/2,this.top=C-this.height/2,this.initContextForDraw(e,o),sp(g)(e,A,C,o.size),this.performFill(e,o),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(i?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",e.fillText(this.options.icon.code,A,C)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(e,i,n,A,C,"hanging");let s=C+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,A,s,i,n,"hanging")}this.updateBoundingBox(A,C)}}}updateBoundingBox(e,g){this.boundingBox.top=g-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=g+this.options.size,this.options.label!==void 0&&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 ua(I,e){var g=U(I);if(Xe){var t=Xe(I);e&&(t=te(t).call(t,function(A){return eg(I,A).enumerable})),g.push.apply(g,t)}return g}function Pk(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=ua(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):Je?RA(I,Je(A)):F(t=ua(Object(A))).call(t,function(C){SA(I,C,eg(A,C))})}return I}var gn=class extends $e{constructor(e,g,t,A){super(e,g,t,A),this.ctxRenderer=A}draw(e,g,t,A,C,i){this.resize(e,A,C,i),this.left=g-this.width/2,this.top=t-this.height/2,e.save();let n=this.ctxRenderer({ctx:e,id:this.options.id,x:g,y:t,state:{selected:A,hover:C},style:Pk({},i),label:this.options.label});if(n.drawNode!=null&&n.drawNode(),e.restore(),n.drawExternalLabel){let o=n.drawExternalLabel;n.drawExternalLabel=()=>{e.save(),o(),e.restore()}}return n.nodeDimensions&&(this.customSizeWidth=n.nodeDimensions.width,this.customSizeHeight=n.nodeDimensions.height),n}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},tn=class extends og{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e,g,t){if(this.needsRefresh(g,t)){let C=this.getDimensionsFromLabel(e,g,t).width+this.margin.right+this.margin.left;this.width=C,this.height=C,this.radius=this.width/2}}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width/2,this.top=t-this.height/2,this.initContextForDraw(e,i),Ja(e,g-this.width/2,t-this.height/2,this.width,this.height),this.performFill(e,i),this.updateBoundingBox(g,t,e,A,C),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,C)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},Dk=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"diamond",4,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},An=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"circle",2,g,t,A,C,i)}distanceToBorder(e){return e&&this.resize(e),this.options.size}},NI=class extends og{constructor(e,g,t){super(e,g,t)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(g,t)){let A=this.getDimensionsFromLabel(e,g,t);this.height=A.height*2,this.width=A.width+A.height,this.radius=.5*this.width}}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width*.5,this.top=t-this.height*.5,this.initContextForDraw(e,i),bi(e,this.left,this.top,this.width,this.height),this.performFill(e,i),this.updateBoundingBox(g,t,e,A,C),this.labelModule.draw(e,g,t,A,C)}distanceToBorder(e,g){e&&this.resize(e);let t=this.width*.5,A=this.height*.5,C=Math.sin(g)*t,i=Math.cos(g)*A;return t*A/Math.sqrt(C*C+i*i)}},In=class extends og{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e,g,t){this.needsRefresh(g,t)&&(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(e,g,t,A,C,i){return this.resize(e,A,C),this.options.icon.size=this.options.icon.size||50,this.left=g-this.width/2,this.top=t-this.height/2,this._icon(e,g,t,A,C,i),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,t+this.height/2+5,A),this.updateBoundingBox(g,t)}}}updateBoundingBox(e,g){this.boundingBox.top=g-this.options.icon.size*.5,this.boundingBox.left=e-this.options.icon.size*.5,this.boundingBox.right=e+this.options.icon.size*.5,this.boundingBox.bottom=g+this.options.icon.size*.5,this.options.label!==void 0&&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+5))}_icon(e,g,t,A,C,i){let n=Number(this.options.icon.size);this.options.icon.code!==void 0?(e.font=[this.options.icon.weight!=null?this.options.icon.weight:A?"bold":"",(this.options.icon.weight!=null&&A?5:0)+n+"px",this.options.icon.face].join(" "),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,i),e.fillText(this.options.icon.code,g,t),this.disableShadow(e,i)):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(e,g){return this._distanceToBorder(e,g)}},Nk=class extends qt{constructor(e,g,t,A,C){super(e,g,t),this.setImages(A,C)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){let C=this.options.size*2;this.width=C,this.height=C;return}this.needsRefresh(g,t)&&this._resizeImage()}draw(e,g,t,A,C,i){e.save(),this.switchImages(A),this.resize();let n=g,o=t;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=g,this.top=t,n+=this.width/2,o+=this.height/2):(this.left=g-this.width/2,this.top=t-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){let s=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth,a=(A?r:s)/this.body.view.scale;e.lineWidth=Math.min(this.width,a),e.beginPath();let d=A?this.options.color.highlight.border:C?this.options.color.hover.border:this.options.color.border,l=A?this.options.color.highlight.background:C?this.options.color.hover.background:this.options.color.background;i.opacity!==void 0&&(d=Ne(d,i.opacity),l=Ne(l,i.opacity)),e.strokeStyle=d,e.fillStyle=l,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),EA(e).call(e),this.performStroke(e,i),e.closePath()}this._drawImageAtPosition(e,i),this._drawImageLabel(e,n,o,A,C),this.updateBoundingBox(g,t),e.restore()}updateBoundingBox(e,g){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=e,this.top=g):(this.left=e-this.width/2,this.top=g-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,this.options.label!==void 0&&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(e,g){return this._distanceToBorder(e,g)}},Cn=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"square",2,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},nn=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"hexagon",4,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},on=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"star",4,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},sn=class extends og{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e,g,t){this.needsRefresh(g,t)&&(this.textSize=this.labelModule.getTextSize(e,g,t),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(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width/2,this.top=t-this.height/2,this.enableShadow(e,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,C),this.disableShadow(e,i),this.updateBoundingBox(g,t,e,A,C)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},Rk=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"triangle",3,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},rn=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"triangleDown",3,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}};function fa(I,e){var g=U(I);if(Xe){var t=Xe(I);e&&(t=te(t).call(t,function(A){return eg(I,A).enumerable})),g.push.apply(g,t)}return g}function pa(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=fa(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):Je?RA(I,Je(A)):F(t=fa(Object(A))).call(t,function(C){SA(I,C,eg(A,C))})}return I}var pe=class I{constructor(e,g,t,A,C,i){this.options=Tg(C),this.globalOptions=C,this.defaultOptions=i,this.body=g,this.edges=[],this.id=void 0,this.imagelist=t,this.grouplist=A,this.x=void 0,this.y=void 0,this.baseSize=this.options.size,this.baseFontSize=this.options.font.size,this.predefinedPosition=!1,this.selected=!1,this.hover=!1,this.labelModule=new DI(this.body,this.options,!1),this.setOptions(e)}attachEdge(e){var g;G(g=this.edges).call(g,e)===-1&&this.edges.push(e)}detachEdge(e){var g;let t=G(g=this.edges).call(g,e);if(t!=-1){var A;Ue(A=this.edges).call(A,t,1)}}setOptions(e){let g=this.options.shape;if(!e)return;if(typeof e.color!="undefined"&&(this._localColor=e.color),e.id!==void 0&&(this.id=e.id),this.id===void 0)throw new Error("Node must have an id");I.checkMass(e,this.id),e.x!==void 0&&(e.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=ze(e.x),this.predefinedPosition=!0)),e.y!==void 0&&(e.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=ze(e.y),this.predefinedPosition=!0)),e.size!==void 0&&(this.baseSize=e.size),e.value!==void 0&&(e.value=xh(e.value)),I.parseOptions(this.options,e,!0,this.globalOptions,this.grouplist);let t=[e,this.options,this.defaultOptions];return this.chooser=Mo("node",t),this._load_images(),this.updateLabelModule(e),e.opacity!==void 0&&I.checkOpacity(e.opacity)&&(this.options.opacity=e.opacity),this.updateShape(g),e.hidden!==void 0||e.physics!==void 0}_load_images(){if((this.options.shape==="circularImage"||this.options.shape==="image")&&this.options.image===void 0)throw new Error("Option image must be defined for node type '"+this.options.shape+"'");if(this.options.image!==void 0){if(this.imagelist===void 0)throw new Error("Internal Error: No images provided");if(typeof this.options.image=="string")this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id);else{if(this.options.image.unselected===void 0)throw new Error("No unselected image provided");this.imageObj=this.imagelist.load(this.options.image.unselected,this.options.brokenImage,this.id),this.options.image.selected!==void 0?this.imageObjAlt=this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id):this.imageObjAlt=void 0}}}static checkOpacity(e){return 0<=e&&e<=1}static checkCoordinateOrigin(e){return e===void 0||e==="center"||e==="top-left"}static updateGroupOptions(e,g,t){var A;if(t===void 0)return;let C=e.group;if(g!==void 0&&g.group!==void 0&&C!==g.group)throw new Error("updateGroupOptions: group values in options don't match.");if(!(typeof C=="number"||typeof C=="string"&&C!=""))return;let n=t.get(C);n.opacity!==void 0&&g.opacity===void 0&&(I.checkOpacity(n.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+n.opacity),n.opacity=void 0));let o=te(A=Ek(g)).call(A,s=>g[s]!=null);o.push("font"),bI(o,e,n),e.color=Gi(e.color)}static parseOptions(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},C=arguments.length>4?arguments[4]:void 0;if(bI(["color","fixed","shadow"],e,g,t),I.checkMass(g),e.opacity!==void 0&&(I.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),g.opacity!==void 0&&(I.checkOpacity(g.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+g.opacity),g.opacity=void 0)),g.shapeProperties&&!I.checkCoordinateOrigin(g.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+g.shapeProperties.coordinateOrigin),De(e,g,"shadow",A),g.color!==void 0&&g.color!==null){let n=Gi(g.color);Zl(e.color,n)}else t===!0&&g.color===null&&(e.color=Tg(A.color));g.fixed!==void 0&&g.fixed!==null&&(typeof g.fixed=="boolean"?(e.fixed.x=g.fixed,e.fixed.y=g.fixed):(g.fixed.x!==void 0&&typeof g.fixed.x=="boolean"&&(e.fixed.x=g.fixed.x),g.fixed.y!==void 0&&typeof g.fixed.y=="boolean"&&(e.fixed.y=g.fixed.y))),t===!0&&g.font===null&&(e.font=Tg(A.font)),I.updateGroupOptions(e,g,C),g.scaling!==void 0&&De(e.scaling,g.scaling,"label",A.scaling)}getFormattingValues(){let e={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?this.chooser===!0?this.selected?(this.options.borderWidthSelected!=null?e.borderWidth=this.options.borderWidthSelected:e.borderWidth*=2,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):typeof this.chooser=="function"&&(this.chooser(e,this.options.id,this.selected,this.hover),e.shadow===!1&&(e.shadowColor!==this.options.shadow.color||e.shadowSize!==this.options.shadow.size||e.shadowX!==this.options.shadow.x||e.shadowY!==this.options.shadow.y)&&(e.shadow=!0)):e.shadow=this.options.shadow.enabled,this.options.opacity!==void 0){let g=this.options.opacity;e.borderColor=Ne(e.borderColor,g),e.color=Ne(e.color,g),e.shadowColor=Ne(e.shadowColor,g)}return e}updateLabelModule(e){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),I.updateGroupOptions(this.options,pa(pa({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);let g=this.grouplist.get(this.options.group,!1),t=[e,this.options,g,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new xk(this.options,this.body,this.labelModule);break;case"circle":this.shape=new Ok(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new en(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new gn(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new tn(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new Dk(this.options,this.body,this.labelModule);break;case"dot":this.shape=new An(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new NI(this.options,this.body,this.labelModule);break;case"icon":this.shape=new In(this.options,this.body,this.labelModule);break;case"image":this.shape=new Nk(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new Cn(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new nn(this.options,this.body,this.labelModule);break;case"star":this.shape=new on(this.options,this.body,this.labelModule);break;case"text":this.shape=new sn(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new Rk(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new rn(this.options,this.body,this.labelModule);break;default:this.shape=new NI(this.options,this.body,this.labelModule);break}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(e,g){return this.shape.distanceToBorder(e,g)}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(e,g,t){if(this.options.value!==void 0){let A=this.options.scaling.customScalingFunction(e,g,t,this.options.value),C=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){let i=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+A*i}this.options.size=this.options.scaling.min+A*C}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(e){let g=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,g)||{}}updateBoundingBox(e){this.shape.updateBoundingBox(this.x,this.y,e)}resize(e){let g=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,g)}getItemsOnPoint(e){let g=[];return this.labelModule.visible()&&Ji(this.labelModule.getSize(),e)&&g.push({nodeId:this.id,labelId:0}),Ji(this.shape.boundingBox,e)&&g.push({nodeId:this.id}),g}isOverlappingWith(e){return this.shape.left<e.right&&this.shape.left+this.shape.width>e.left&&this.shape.top<e.bottom&&this.shape.top+this.shape.height>e.top}isBoundingBoxOverlappingWith(e){return this.shape.boundingBox.left<e.right&&this.shape.boundingBox.right>e.left&&this.shape.boundingBox.top<e.bottom&&this.shape.boundingBox.bottom>e.top}static checkMass(e,g){if(e.mass!==void 0&&e.mass<=0){let t="";g!==void 0&&(t=" in node id: "+g),console.error("%cNegative or zero mass disallowed"+t+", setting mass to 1.",jl),e.mass=1}}},an=class{constructor(e,g,t,A){var C;if(this.body=e,this.images=g,this.groups=t,this.layoutEngine=A,this.body.functions.createNode=b(C=this.create).call(C,this),this.nodesListeners={add:(i,n)=>{this.add(n.items)},update:(i,n)=>{this.update(n.items,n.data,n.oldData)},remove:(i,n)=>{this.remove(n.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(i,n,o,s){if(n===i)return .5;{let r=1/(n-i);return Math.max(0,(s-i)*r)}}},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=Tg(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,g;this.body.emitter.on("refreshNodes",b(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",b(g=this.refresh).call(g,this)),this.body.emitter.on("destroy",()=>{S(this.nodesListeners,(t,A)=>{this.body.data.nodes&&this.body.data.nodes.off(A,t)}),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners})}setOptions(e){if(e!==void 0){if(pe.parseOptions(this.options,e),e.opacity!==void 0&&(Ui(e.opacity)||!Mg(e.opacity)||e.opacity<0||e.opacity>1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(let g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&this.body.nodes[g].updateShape();if(typeof e.font!="undefined"||typeof e.widthConstraint!="undefined"||typeof e.heightConstraint!="undefined")for(let g of U(this.body.nodes))this.body.nodes[g].updateLabelModule(),this.body.nodes[g].needsRefresh();if(e.size!==void 0)for(let g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&this.body.nodes[g].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.data.nodes;if(Eh("id",e))this.body.data.nodes=e;else if(B(e))this.body.data.nodes=new Pg,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new Pg;else throw new TypeError("Array or DataSet expected");if(t&&S(this.nodesListeners,function(A,C){t.off(C,A)}),this.body.nodes={},this.body.data.nodes){let A=this;S(this.nodesListeners,function(i,n){A.body.data.nodes.on(n,i)});let C=this.body.data.nodes.getIds();this.add(C,!0)}g===!1&&this.body.emitter.emit("_dataChanged")}add(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t,A=[];for(let C=0;C<e.length;C++){t=e[C];let i=this.body.data.nodes.get(t),n=this.create(i);A.push(n),this.body.nodes[t]=n}this.layoutEngine.positionInitially(A),g===!1&&this.body.emitter.emit("_dataChanged")}update(e,g,t){let A=this.body.nodes,C=!1;for(let i=0;i<e.length;i++){let n=e[i],o=A[n],s=g[i];o!==void 0?o.setOptions(s)&&(C=!0):(C=!0,o=this.create(s),A[n]=o)}!C&&t!==void 0&&(C=ih(g).call(g,function(i,n){let o=t[n];return o&&o.level!==i.level})),C===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}remove(e){let g=this.body.nodes;for(let t=0;t<e.length;t++){let A=e[t];delete g[A]}this.body.emitter.emit("_dataChanged")}create(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pe;return new g(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;S(this.body.nodes,(g,t)=>{let A=this.body.data.nodes.get(t);A!==void 0&&(e===!0&&g.setOptions({x:null,y:null}),g.setOptions({fixed:!1}),g.setOptions(A))})}getPositions(e){let g={};if(e!==void 0){if(B(e)===!0){for(let t=0;t<e.length;t++)if(this.body.nodes[e[t]]!==void 0){let A=this.body.nodes[e[t]];g[e[t]]={x:Math.round(A.x),y:Math.round(A.y)}}}else if(this.body.nodes[e]!==void 0){let t=this.body.nodes[e];g[e]={x:Math.round(t.x),y:Math.round(t.y)}}}else for(let t=0;t<this.body.nodeIndices.length;t++){let A=this.body.nodes[this.body.nodeIndices[t]];g[this.body.nodeIndices[t]]={x:Math.round(A.x),y:Math.round(A.y)}}return g}getPosition(e){if(e==null)throw new TypeError("No id was specified for getPosition method.");if(this.body.nodes[e]==null)throw new ReferenceError("NodeId provided for getPosition does not exist. Provided: ".concat(e));return{x:Math.round(this.body.nodes[e].x),y:Math.round(this.body.nodes[e].y)}}storePositions(){let e=[],g=this.body.data.nodes.getDataSet();for(let t of g.get()){let A=t.id,C=this.body.nodes[A],i=Math.round(C.x),n=Math.round(C.y);(t.x!==i||t.y!==n)&&e.push({id:A,x:i,y:n})}g.update(e)}getBoundingBox(e){if(this.body.nodes[e]!==void 0)return this.body.nodes[e].shape.boundingBox}getConnectedNodes(e,g){let t=[];if(this.body.nodes[e]!==void 0){let A=this.body.nodes[e],C={};for(let i=0;i<A.edges.length;i++){let n=A.edges[i];g!=="to"&&n.toId==A.id?C[n.fromId]===void 0&&(t.push(n.fromId),C[n.fromId]=!0):g!=="from"&&n.fromId==A.id&&C[n.toId]===void 0&&(t.push(n.toId),C[n.toId]=!0)}}return t}getConnectedEdges(e){let g=[];if(this.body.nodes[e]!==void 0){let t=this.body.nodes[e];for(let A=0;A<t.edges.length;A++)g.push(t.edges[A].id)}else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return g}moveNode(e,g,t){this.body.nodes[e]!==void 0?(this.body.nodes[e].x=Number(g),this.body.nodes[e].y=Number(t),He(()=>{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}},Sk=N,ma=Math.hypot,kk=Math.abs,Mk=Math.sqrt,Fk=!!ma&&ma(1/0,NaN)!==1/0;Sk({target:"Math",stat:!0,arity:2,forced:Fk},{hypot:function(e,g){for(var t=0,A=0,C=arguments.length,i=0,n,o;A<C;)n=kk(arguments[A++]),i<n?(o=i/n,t=t*o*o+1,i=n):n>0?(o=n/i,t+=o*o):t+=n;return i===1/0?1/0:i*Mk(t)}});var Bk=L,zk=Bk.Math.hypot,Zk=zk,Lk=Zk,Gk=Lk,Vk=D(Gk),H=class{static transform(e,g){B(e)||(e=[e]);let t=g.point.x,A=g.point.y,C=g.angle,i=g.length;for(let n=0;n<e.length;++n){let o=e[n],s=o.x*Math.cos(C)-o.y*Math.sin(C),r=o.x*Math.sin(C)+o.y*Math.cos(C);o.x=t+i*s,o.y=A+i*r}}static drawPath(e,g){e.beginPath(),e.moveTo(g[0].x,g[0].y);for(let t=1;t<g.length;++t)e.lineTo(g[t].x,g[t].y);e.closePath()}},jk=class extends H{static draw(e,g){if(g.image){e.save(),e.translate(g.point.x,g.point.y),e.rotate(Math.PI/2+g.angle);let t=g.imageWidth!=null?g.imageWidth:g.image.width,A=g.imageHeight!=null?g.imageHeight:g.image.height;g.image.drawImageAtPosition(e,1,-t/2,0,t,A),e.restore()}return!1}},dn=class extends H{static draw(e,g){let t=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return H.transform(t,g),H.drawPath(e,t),!0}},ln=class{static draw(e,g){let t=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return H.transform(t,g),H.drawPath(e,t),!0}},hn=class{static draw(e,g){let t={x:-.4,y:0};H.transform(t,g),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";let A=Math.PI,C=g.angle-A/2,i=g.angle+A/2;return e.beginPath(),e.arc(t.x,t.y,g.length*.4,C,i,!1),e.stroke(),!0}},cn=class{static draw(e,g){let t={x:-.3,y:0};H.transform(t,g),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";let A=Math.PI,C=g.angle+A/2,i=g.angle+3*A/2;return e.beginPath(),e.arc(t.x,t.y,g.length*.4,C,i,!1),e.stroke(),!0}},un=class{static draw(e,g){let t=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return H.transform(t,g),H.drawPath(e,t),!0}},fn=class{static draw(e,g){let t=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return H.transform(t,g),H.drawPath(e,t),!0}},pn=class{static draw(e,g){let t={x:-.4,y:0};return H.transform(t,g),qn(e,t.x,t.y,g.length*.4),!0}},mn=class{static draw(e,g){let t=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return H.transform(t,g),H.drawPath(e,t),!0}},vn=class{static draw(e,g){let t=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return H.transform(t,g),H.drawPath(e,t),!0}},bn=class{static draw(e,g){let t=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return H.transform(t,g),H.drawPath(e,t),!0}},yn=class{static draw(e,g){let t=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return H.transform(t,g),H.drawPath(e,t),!0}},RI=class{static draw(e,g){let t;switch(g.type&&(t=g.type.toLowerCase()),t){case"image":return jk.draw(e,g);case"circle":return pn.draw(e,g);case"box":return vn.draw(e,g);case"crow":return ln.draw(e,g);case"curve":return hn.draw(e,g);case"diamond":return bn.draw(e,g);case"inv_curve":return cn.draw(e,g);case"triangle":return un.draw(e,g);case"inv_triangle":return fn.draw(e,g);case"bar":return mn.draw(e,g);case"vee":return yn.draw(e,g);case"arrow":default:return dn.draw(e,g)}}};function va(I,e){var g=U(I);if(Xe){var t=Xe(I);e&&(t=te(t).call(t,function(A){return eg(I,A).enumerable})),g.push.apply(g,t)}return g}function ba(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=va(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):Je?RA(I,Je(A)):F(t=va(Object(A))).call(t,function(C){SA(I,C,eg(A,C))})}return I}var SI=class{constructor(e,g,t){this._body=g,this._labelModule=t,this.color={},this.colorDirty=!0,this.hoverWidth=1.5,this.selectionWidth=2,this.setOptions(e),this.fromPoint=this.from,this.toPoint=this.to}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to]}cleanup(){return!1}setOptions(e){this.options=e,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.id=this.options.id}drawLine(e,g,t,A){let C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,g),e.lineWidth=g.width,g.dashes!==!1?this._drawDashedLine(e,g,C):this._drawLine(e,g,C)}_drawLine(e,g,t,A,C){if(this.from!=this.to)this._line(e,g,t,A,C);else{let[i,n,o]=this._getCircleData(e);this._circle(e,g,i,n,o)}}_drawDashedLine(e,g,t,A,C){e.lineCap="round";let i=B(g.dashes)?g.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(i),e.lineDashOffset=0,this.from!=this.to)this._line(e,g,t);else{let[n,o,s]=this._getCircleData(e);this._circle(e,g,n,o,s)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)$a(e,this.from.x,this.from.y,this.to.x,this.to.y,i);else{let[n,o,s]=this._getCircleData(e);this._circle(e,g,n,o,s)}this.enableShadow(e,g),e.stroke(),this.disableShadow(e,g)}}findBorderPosition(e,g,t){return this.from!=this.to?this._findBorderPosition(e,g,t):this._findBorderPositionCircle(e,g,t)}findBorderPositions(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};{var g;let[t,A]=Ze(g=this._getCircleData(e)).call(g,0,2);return{from:this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:.6,high:.8,direction:1})}}}_getCircleData(e){let g=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);let t=Oh(e,this.options.selfReference.angle,g,this.from);return[t.x,t.y,g]}_pointOnCircle(e,g,t,A){let C=A*2*Math.PI;return{x:e+t*Math.cos(C),y:g-t*Math.sin(C)}}_findBorderPositionCircle(e,g,t){let A=t.x,C=t.y,i=t.low,n=t.high,o=t.direction,s=10,r=this.options.selfReference.size,a=.05,d,l=(i+n)*.5,h=0;this.options.arrowStrikethrough===!0&&(o===-1?h=this.options.endPointOffset.from:o===1&&(h=this.options.endPointOffset.to));let c=0;do{l=(i+n)*.5,d=this._pointOnCircle(A,C,r,l);let p=Math.atan2(e.y-d.y,e.x-d.x),u=e.distanceToBorder(g,p)+h,m=Math.sqrt(Math.pow(d.x-e.x,2)+Math.pow(d.y-e.y,2)),E=u-m;if(Math.abs(E)<a)break;E>0?o>0?i=l:n=l:o>0?n=l:i=l,++c}while(i<=n&&c<s);return ba(ba({},d),{},{t:l})}getLineWidth(e,g){return e===!0?Math.max(this.selectionWidth,.3/this._body.view.scale):g===!0?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}getColor(e,g){if(g.inheritsColor!==!1){if(g.inheritsColor==="both"&&this.from.id!==this.to.id){let t=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),A=this.from.options.color.highlight.border,C=this.to.options.color.highlight.border;return this.from.selected===!1&&this.to.selected===!1?(A=Ne(this.from.options.color.border,g.opacity),C=Ne(this.to.options.color.border,g.opacity)):this.from.selected===!0&&this.to.selected===!1?C=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(A=this.from.options.color.border),t.addColorStop(0,A),t.addColorStop(1,C),t}return g.inheritsColor==="to"?Ne(this.to.options.color.border,g.opacity):Ne(this.from.options.color.border,g.opacity)}else return Ne(g.color,g.opacity)}_circle(e,g,t,A,C){this.enableShadow(e,g);let i=0,n=Math.PI*2;if(!this.options.selfReference.renderBehindTheNode){let o=this.options.selfReference.angle,s=this.options.selfReference.angle+Math.PI,r=this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:o,high:s,direction:-1}),a=this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:o,high:s,direction:1});i=Math.atan2(r.y-A,r.x-t),n=Math.atan2(a.y-A,a.x-t)}e.beginPath(),e.arc(t,A,C,i,n,!1),e.stroke(),this.disableShadow(e,g)}getDistanceToEdge(e,g,t,A,C,i){if(this.from!=this.to)return this._getDistanceToEdge(e,g,t,A,C,i);{let[n,o,s]=this._getCircleData(void 0),r=n-C,a=o-i;return Math.abs(Math.sqrt(r*r+a*a)-s)}}_getDistanceToLine(e,g,t,A,C,i){let n=t-e,o=A-g,s=n*n+o*o,r=((C-e)*n+(i-g)*o)/s;r>1?r=1:r<0&&(r=0);let a=e+r*n,d=g+r*o,l=a-C,h=d-i;return Math.sqrt(l*l+h*h)}getArrowData(e,g,t,A,C,i){let n,o,s,r,a,d,l,h=i.width;g==="from"?(s=this.from,r=this.to,a=i.fromArrowScale<0,d=Math.abs(i.fromArrowScale),l=i.fromArrowType):g==="to"?(s=this.to,r=this.from,a=i.toArrowScale<0,d=Math.abs(i.toArrowScale),l=i.toArrowType):(s=this.to,r=this.from,a=i.middleArrowScale<0,d=Math.abs(i.middleArrowScale),l=i.middleArrowType);let c=15*d+3*h;if(s!=r){let E=Vk(s.x-r.x,s.y-r.y),w=c/E;if(g!=="middle")if(this.options.smooth.enabled===!0){let O=this._findBorderPosition(s,e,{via:t}),M=this.getPoint(O.t+w*(g==="from"?1:-1),t);n=Math.atan2(O.y-M.y,O.x-M.x),o=O}else n=Math.atan2(s.y-r.y,s.x-r.x),o=this._findBorderPosition(s,e);else{let O=(a?-w:w)/2,M=this.getPoint(.5+O,t),k=this.getPoint(.5-O,t);n=Math.atan2(M.y-k.y,M.x-k.x),o=this.getPoint(.5,t)}}else{let[E,w,O]=this._getCircleData(e);if(g==="from"){let M=this.options.selfReference.angle,k=this.options.selfReference.angle+Math.PI,V=this._findBorderPositionCircle(this.from,e,{x:E,y:w,low:M,high:k,direction:-1});n=V.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,o=V}else if(g==="to"){let M=this.options.selfReference.angle,k=this.options.selfReference.angle+Math.PI,V=this._findBorderPositionCircle(this.from,e,{x:E,y:w,low:M,high:k,direction:1});n=V.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,o=V}else{let M=this.options.selfReference.angle/(2*Math.PI);o=this._pointOnCircle(E,w,O,M),n=M*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}let p=o.x-c*.9*Math.cos(n),u=o.y-c*.9*Math.sin(n);return{point:o,core:{x:p,y:u},angle:n,length:c,type:l}}drawArrowHead(e,g,t,A,C){e.strokeStyle=this.getColor(e,g),e.fillStyle=e.strokeStyle,e.lineWidth=g.width,RI.draw(e,C)&&(this.enableShadow(e,g),EA(e).call(e),this.disableShadow(e,g))}enableShadow(e,g){g.shadow===!0&&(e.shadowColor=g.shadowColor,e.shadowBlur=g.shadowSize,e.shadowOffsetX=g.shadowX,e.shadowOffsetY=g.shadowY)}disableShadow(e,g){g.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}drawBackground(e,g){if(g.background!==!1){let t={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=g.backgroundColor,e.lineWidth=g.backgroundSize,this.setStrokeDashed(e,g.backgroundDashes),e.stroke(),e.strokeStyle=t.strokeStyle,e.lineWidth=t.lineWidth,e.dashes=t.dashes,this.setStrokeDashed(e,g.dashes)}}setStrokeDashed(e,g){if(g!==!1)if(e.setLineDash!==void 0){let t=B(g)?g:[5,5];e.setLineDash(t)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else e.setLineDash!==void 0?e.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}};function ya(I,e){var g=U(I);if(Xe){var t=Xe(I);e&&(t=te(t).call(t,function(A){return eg(I,A).enumerable})),g.push.apply(g,t)}return g}function wa(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=ya(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):Je?RA(I,Je(A)):F(t=ya(Object(A))).call(t,function(C){SA(I,C,eg(A,C))})}return I}var eA=class extends SI{constructor(e,g,t){super(e,g,t)}_findBorderPositionBezier(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates(),A=10,C=.2,i=!1,n=1,o=0,s=this.to,r,a,d=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(s=this.from,i=!0,d=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(d=0);let l=0;do{a=(o+n)*.5,r=this.getPoint(a,t);let h=Math.atan2(s.y-r.y,s.x-r.x),c=s.distanceToBorder(g,h)+d,p=Math.sqrt(Math.pow(r.x-s.x,2)+Math.pow(r.y-s.y,2)),u=c-p;if(Math.abs(u)<C)break;u<0?i===!1?o=a:n=a:i===!1?n=a:o=a,++l}while(o<=n&&l<A);return wa(wa({},r),{},{t:a})}_getDistanceToBezierEdge(e,g,t,A,C,i,n){let o=1e9,s,r,a,d,l,h=e,c=g;for(r=1;r<10;r++)a=.1*r,d=Math.pow(1-a,2)*e+2*a*(1-a)*n.x+Math.pow(a,2)*t,l=Math.pow(1-a,2)*g+2*a*(1-a)*n.y+Math.pow(a,2)*A,r>0&&(s=this._getDistanceToLine(h,c,d,l,C,i),o=s<o?s:o),h=d,c=l;return o}_bezierCurve(e,g,t,A){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),t!=null&&t.x!=null?A!=null&&A.x!=null?e.bezierCurveTo(t.x,t.y,A.x,A.y,this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(t.x,t.y,this.toPoint.x,this.toPoint.y):e.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(e,g),this.enableShadow(e,g),e.stroke(),this.disableShadow(e,g)}getViaNode(){return this._getViaCoordinates()}},kI=class extends eA{constructor(e,g,t){super(e,g,t),this.via=this.via,this._boundFunction=()=>{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(e){super.setOptions(e);let g=!1;this.options.physics!==e.physics&&(g=!0),this.options=e,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(),g===!0&&(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],this.from===void 0||this.to===void 0||this.options.physics===!1?this.via.setOptions({physics:!1}):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),this.via!==void 0?(delete this._body.nodes[this.via.id],this.via=void 0,!0):!1}setupSupportNode(){if(this.via===void 0){let e="edgeId:"+this.id,g=this._body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this._body.nodes[e]=g,this.via=g,this.via.parentEdgeId=this.id,this.positionBezierNode()}}positionBezierNode(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}_line(e,g,t){this._bezierCurve(e,g,t)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){let[t,A,C]=this._getCircleData(),i=2*Math.PI*(1-e);return{x:t+C*Math.sin(i),y:A+C-C*(1-Math.cos(i))}}else return{x:Math.pow(1-e,2)*this.fromPoint.x+2*e*(1-e)*g.x+Math.pow(e,2)*this.toPoint.x,y:Math.pow(1-e,2)*this.fromPoint.y+2*e*(1-e)*g.y+Math.pow(e,2)*this.toPoint.y}}_findBorderPosition(e,g){return this._findBorderPositionBezier(e,g,this.via)}_getDistanceToEdge(e,g,t,A,C,i){return this._getDistanceToBezierEdge(e,g,t,A,C,i,this.via)}},MI=class extends eA{constructor(e,g,t){super(e,g,t)}_line(e,g,t){this._bezierCurve(e,g,t)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){let e=this.options.smooth.roundness,g=this.options.smooth.type,t=Math.abs(this.from.x-this.to.x),A=Math.abs(this.from.y-this.to.y);if(g==="discrete"||g==="diagonalCross"){let C,i;t<=A?C=i=e*A:C=i=e*t,this.from.x>this.to.x&&(C=-C),this.from.y>=this.to.y&&(i=-i);let n=this.from.x+C,o=this.from.y+i;return g==="discrete"&&(t<=A?n=t<e*A?this.from.x:n:o=A<e*t?this.from.y:o),{x:n,y:o}}else if(g==="straightCross"){let C=(1-e)*t,i=(1-e)*A;return t<=A?(C=0,this.from.y<this.to.y&&(i=-i)):(this.from.x<this.to.x&&(C=-C),i=0),{x:this.to.x+C,y:this.to.y+i}}else if(g==="horizontal"){let C=(1-e)*t;return this.from.x<this.to.x&&(C=-C),{x:this.to.x+C,y:this.from.y}}else if(g==="vertical"){let C=(1-e)*A;return this.from.y<this.to.y&&(C=-C),{x:this.from.x,y:this.to.y+C}}else if(g==="curvedCW"){t=this.to.x-this.from.x,A=this.from.y-this.to.y;let C=Math.sqrt(t*t+A*A),i=Math.PI,o=(Math.atan2(A,t)+(e*.5+.5)*i)%(2*i);return{x:this.from.x+(e*.5+.5)*C*Math.sin(o),y:this.from.y+(e*.5+.5)*C*Math.cos(o)}}else if(g==="curvedCCW"){t=this.to.x-this.from.x,A=this.from.y-this.to.y;let C=Math.sqrt(t*t+A*A),i=Math.PI,o=(Math.atan2(A,t)+(-e*.5+.5)*i)%(2*i);return{x:this.from.x+(e*.5+.5)*C*Math.sin(o),y:this.from.y+(e*.5+.5)*C*Math.cos(o)}}else{let C,i;t<=A?C=i=e*A:C=i=e*t,this.from.x>this.to.x&&(C=-C),this.from.y>=this.to.y&&(i=-i);let n=this.from.x+C,o=this.from.y+i;return t<=A?this.from.x<=this.to.x?n=this.to.x<n?this.to.x:n:n=this.to.x>n?this.to.x:n:this.from.y>=this.to.y?o=this.to.y>o?this.to.y:o:o=this.to.y<o?this.to.y:o,{x:n,y:o}}}_findBorderPosition(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,g,t.via)}_getDistanceToEdge(e,g,t,A,C,i){let n=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,g,t,A,C,i,n)}getPoint(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),t=e,A=Math.pow(1-t,2)*this.fromPoint.x+2*t*(1-t)*g.x+Math.pow(t,2)*this.toPoint.x,C=Math.pow(1-t,2)*this.fromPoint.y+2*t*(1-t)*g.y+Math.pow(t,2)*this.toPoint.y;return{x:A,y:C}}},wn=class extends eA{constructor(e,g,t){super(e,g,t)}_getDistanceToBezierEdge2(e,g,t,A,C,i,n,o){let s=1e9,r=e,a=g,d=[0,0,0,0];for(let l=1;l<10;l++){let h=.1*l;d[0]=Math.pow(1-h,3),d[1]=3*h*Math.pow(1-h,2),d[2]=3*Math.pow(h,2)*(1-h),d[3]=Math.pow(h,3);let c=d[0]*e+d[1]*n.x+d[2]*o.x+d[3]*t,p=d[0]*g+d[1]*n.y+d[2]*o.y+d[3]*A;if(l>0){let u=this._getDistanceToLine(r,a,c,p,C,i);s=u<s?u:s}r=c,a=p}return s}},FI=class extends wn{constructor(e,g,t){super(e,g,t)}_line(e,g,t){let A=t[0],C=t[1];this._bezierCurve(e,g,A,C)}_getViaCoordinates(){let e=this.from.x-this.to.x,g=this.from.y-this.to.y,t,A,C,i,n=this.options.smooth.roundness;return(Math.abs(e)>Math.abs(g)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(A=this.from.y,i=this.to.y,t=this.from.x-n*e,C=this.to.x+n*e):(A=this.from.y-n*g,i=this.to.y+n*g,t=this.from.x,C=this.to.x),[{x:t,y:A},{x:C,y:i}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(e,g){return this._findBorderPositionBezier(e,g)}_getDistanceToEdge(e,g,t,A,C,i){let[n,o]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,g,t,A,C,i,n,o)}getPoint(e){let[g,t]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),A=e,C=[Math.pow(1-A,3),3*A*Math.pow(1-A,2),3*Math.pow(A,2)*(1-A),Math.pow(A,3)],i=C[0]*this.fromPoint.x+C[1]*g.x+C[2]*t.x+C[3]*this.toPoint.x,n=C[0]*this.fromPoint.y+C[1]*g.y+C[2]*t.y+C[3]*this.toPoint.y;return{x:i,y:n}}},BI=class extends SI{constructor(e,g,t){super(e,g,t)}_line(e,g){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,g),e.stroke(),this.disableShadow(e,g)}getViaNode(){}getPoint(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}_findBorderPosition(e,g){let t=this.to,A=this.from;e.id===this.from.id&&(t=this.from,A=this.to);let C=Math.atan2(t.y-A.y,t.x-A.x),i=t.x-A.x,n=t.y-A.y,o=Math.sqrt(i*i+n*n),s=e.distanceToBorder(g,C),r=(o-s)/o;return{x:(1-r)*A.x+r*t.x,y:(1-r)*A.y+r*t.y,t:0}}_getDistanceToEdge(e,g,t,A,C,i){return this._getDistanceToLine(e,g,t,A,C,i)}},xg=class I{constructor(e,g,t,A,C){if(g===void 0)throw new Error("No body provided");this.options=Tg(A),this.globalOptions=A,this.defaultOptions=C,this.body=g,this.imagelist=t,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 DI(this.body,this.options,!0),this.setOptions(e)}setOptions(e){if(!e)return;let g=typeof e.physics!="undefined"&&this.options.physics!==e.physics||typeof e.hidden!="undefined"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from!="undefined"&&this.options.from!==e.from||typeof e.to!="undefined"&&this.options.to!==e.to;I.parseOptions(this.options,e,!0,this.globalOptions),e.id!==void 0&&(this.id=e.id),e.from!==void 0&&(this.fromId=e.from),e.to!==void 0&&(this.toId=e.to),e.title!==void 0&&(this.title=e.title),e.value!==void 0&&(e.value=xh(e.value));let t=[e,this.options,this.defaultOptions];return this.chooser=Mo("edge",t),this.updateLabelModule(e),g=this.updateEdgeType()||g,this._setInteractionWidths(),this.connect(),g}static parseOptions(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(xt(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],e,g,t),g.endPointOffset!==void 0&&g.endPointOffset.from!==void 0&&(Mg(g.endPointOffset.from)?e.endPointOffset.from=g.endPointOffset.from:(e.endPointOffset.from=A.endPointOffset.from!==void 0?A.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),g.endPointOffset!==void 0&&g.endPointOffset.to!==void 0&&(Mg(g.endPointOffset.to)?e.endPointOffset.to=g.endPointOffset.to:(e.endPointOffset.to=A.endPointOffset.to!==void 0?A.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),OI(g.label)?e.label=g.label:OI(e.label)||(e.label=void 0),De(e,g,"smooth",A),De(e,g,"shadow",A),De(e,g,"background",A),g.dashes!==void 0&&g.dashes!==null?e.dashes=g.dashes:t===!0&&g.dashes===null&&(e.dashes=wg(A.dashes)),g.scaling!==void 0&&g.scaling!==null?(g.scaling.min!==void 0&&(e.scaling.min=g.scaling.min),g.scaling.max!==void 0&&(e.scaling.max=g.scaling.max),De(e.scaling,g.scaling,"label",A.scaling)):t===!0&&g.scaling===null&&(e.scaling=wg(A.scaling)),g.arrows!==void 0&&g.arrows!==null)if(typeof g.arrows=="string"){let n=g.arrows.toLowerCase();e.arrows.to.enabled=G(n).call(n,"to")!=-1,e.arrows.middle.enabled=G(n).call(n,"middle")!=-1,e.arrows.from.enabled=G(n).call(n,"from")!=-1}else if(typeof g.arrows=="object")De(e.arrows,g.arrows,"to",A.arrows),De(e.arrows,g.arrows,"middle",A.arrows),De(e.arrows,g.arrows,"from",A.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+Et(g.arrows));else t===!0&&g.arrows===null&&(e.arrows=wg(A.arrows));if(g.color!==void 0&&g.color!==null){let n=pg(g.color)?{color:g.color,highlight:g.color,hover:g.color,inherit:!1,opacity:1}:g.color,o=e.color;if(C)_(o,A.color,!1,t);else for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&delete o[s];if(pg(o))o.color=o,o.highlight=o,o.hover=o,o.inherit=!1,n.opacity===void 0&&(o.opacity=1);else{let s=!1;n.color!==void 0&&(o.color=n.color,s=!0),n.highlight!==void 0&&(o.highlight=n.highlight,s=!0),n.hover!==void 0&&(o.hover=n.hover,s=!0),n.inherit!==void 0&&(o.inherit=n.inherit),n.opacity!==void 0&&(o.opacity=Math.min(1,Math.max(0,n.opacity))),s===!0?o.inherit=!1:o.inherit===void 0&&(o.inherit="from")}}else t===!0&&g.color===null&&(e.color=Tg(A.color));t===!0&&g.font===null&&(e.font=Tg(A.font)),Object.prototype.hasOwnProperty.call(g,"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}"),e.selfReference.size=g.selfReferenceSize)}getFormattingValues(){let e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,g=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,t=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,A=this.options.color.inherit,C={toArrow:e,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:t,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:g,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:A?void 0:this.options.color.color,inheritsColor:A,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(this.chooser===!0){if(this.selected){let i=this.options.selectionWidth;typeof i=="function"?C.width=i(C.width):typeof i=="number"&&(C.width+=i),C.width=Math.max(C.width,.3/this.body.view.scale),C.color=this.options.color.highlight,C.shadow=this.options.shadow.enabled}else if(this.hover){let i=this.options.hoverWidth;typeof i=="function"?C.width=i(C.width):typeof i=="number"&&(C.width+=i),C.width=Math.max(C.width,.3/this.body.view.scale),C.color=this.options.color.hover,C.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(C,this.options.id,this.selected,this.hover),C.color!==void 0&&(C.inheritsColor=!1),C.shadow===!1&&(C.shadowColor!==this.options.shadow.color||C.shadowSize!==this.options.shadow.size||C.shadowX!==this.options.shadow.x||C.shadowY!==this.options.shadow.y)&&(C.shadow=!0));else C.shadow=this.options.shadow.enabled,C.width=Math.max(C.width,.3/this.body.view.scale);return C}updateLabelModule(e){let g=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,g),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){let e=this.options.smooth,g=!1,t=!0;return this.edgeType!==void 0&&((this.edgeType instanceof kI&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof FI&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof MI&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof BI&&e.type.enabled===!1)&&(t=!1),t===!0&&(g=this.cleanup())),t===!0?e.enabled===!0?e.type==="dynamic"?(g=!0,this.edgeType=new kI(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new FI(this.options,this.body,this.labelModule):this.edgeType=new MI(this.options,this.body,this.labelModule):this.edgeType=new BI(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),g}connect(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=this.from!==void 0&&this.to!==void 0,this.connected===!0?(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(e,g,t){if(this.options.value!==void 0){let A=this.options.scaling.customScalingFunction(e,g,t,this.options.value),C=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){let i=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+A*i}this.options.width=this.options.scaling.min+A*C}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}_setInteractionWidths(){typeof this.options.hoverWidth=="function"?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth=="function"?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}draw(e){let g=this.getFormattingValues();if(g.hidden)return;let t=this.edgeType.getViaNode();this.edgeType.drawLine(e,g,this.selected,this.hover,t),this.drawLabel(e,t)}drawArrows(e){let g=this.getFormattingValues();if(g.hidden)return;let t=this.edgeType.getViaNode(),A={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,g.fromArrow&&(A.from=this.edgeType.getArrowData(e,"from",t,this.selected,this.hover,g),g.arrowStrikethrough===!1&&(this.edgeType.fromPoint=A.from.core),g.fromArrowSrc&&(A.from.image=this.imagelist.load(g.fromArrowSrc)),g.fromArrowImageWidth&&(A.from.imageWidth=g.fromArrowImageWidth),g.fromArrowImageHeight&&(A.from.imageHeight=g.fromArrowImageHeight)),g.toArrow&&(A.to=this.edgeType.getArrowData(e,"to",t,this.selected,this.hover,g),g.arrowStrikethrough===!1&&(this.edgeType.toPoint=A.to.core),g.toArrowSrc&&(A.to.image=this.imagelist.load(g.toArrowSrc)),g.toArrowImageWidth&&(A.to.imageWidth=g.toArrowImageWidth),g.toArrowImageHeight&&(A.to.imageHeight=g.toArrowImageHeight)),g.middleArrow&&(A.middle=this.edgeType.getArrowData(e,"middle",t,this.selected,this.hover,g),g.middleArrowSrc&&(A.middle.image=this.imagelist.load(g.middleArrowSrc)),g.middleArrowImageWidth&&(A.middle.imageWidth=g.middleArrowImageWidth),g.middleArrowImageHeight&&(A.middle.imageHeight=g.middleArrowImageHeight)),g.fromArrow&&this.edgeType.drawArrowHead(e,g,this.selected,this.hover,A.from),g.middleArrow&&this.edgeType.drawArrowHead(e,g,this.selected,this.hover,A.middle),g.toArrow&&this.edgeType.drawArrowHead(e,g,this.selected,this.hover,A.to)}drawLabel(e,g){if(this.options.label!==void 0){let t=this.from,A=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);let C;if(t.id!=A.id){this.labelModule.pointToSelf=!1,C=this.edgeType.getPoint(.5,g),e.save();let i=this._getRotation(e);i.angle!=0&&(e.translate(i.x,i.y),e.rotate(i.angle)),this.labelModule.draw(e,C.x,C.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;let i=Oh(e,this.options.selfReference.angle,this.options.selfReference.size,t);C=this._pointOnCircle(i.x,i.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,C.x,C.y,this.selected,this.hover)}}}getItemsOnPoint(e){let g=[];if(this.labelModule.visible()){let A=this._getRotation();Ji(this.labelModule.getSize(),e,A)&&g.push({edgeId:this.id,labelId:0})}let t={left:e.x,top:e.y};return this.isOverlappingWith(t)&&g.push({edgeId:this.id}),g}isOverlappingWith(e){if(this.connected){let t=this.from.x,A=this.from.y,C=this.to.x,i=this.to.y,n=e.left,o=e.top;return this.edgeType.getDistanceToEdge(t,A,C,i,n,o)<10}else return!1}_getRotation(e){let g=this.edgeType.getViaNode(),t=this.edgeType.getPoint(.5,g);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,t.x,t.y);let A={x:t.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return A;let C=this.from.y-this.to.y,i=this.from.x-this.to.x,n=Math.atan2(C,i);return(n<-1&&i<0||n>0&&i<0)&&(n+=Math.PI),A.angle=n,A}_pointOnCircle(e,g,t,A){return{x:e+t*Math.cos(A),y:g-t*Math.sin(A)}}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 this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}},En=class{constructor(e,g,t){var A;this.body=e,this.images=g,this.groups=t,this.body.functions.createEdge=b(A=this.create).call(A,this),this.edgesListeners={add:(C,i)=>{this.add(i.items)},update:(C,i)=>{this.update(i.items)},remove:(C,i)=>{this.remove(i.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(C,i,n,o){if(i===C)return .5;{let s=1/(i-C);return Math.max(0,(o-C)*s)}}},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},_(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e=this,g,t;this.body.emitter.on("_forceDisableDynamicCurves",function(A){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;A==="dynamic"&&(A="continuous");let i=!1;for(let n in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,n)){let o=e.body.edges[n],s=e.body.data.edges.get(n);if(s!=null){let r=s.smooth;r!==void 0&&r.enabled===!0&&r.type==="dynamic"&&(A===void 0?o.setOptions({smooth:!1}):o.setOptions({smooth:{type:A}}),i=!0)}}C===!0&&i===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",()=>{this.reconnectEdges()}),this.body.emitter.on("refreshEdges",b(g=this.refresh).call(g,this)),this.body.emitter.on("refresh",b(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",()=>{S(this.edgesListeners,(A,C)=>{this.body.data.edges&&this.body.data.edges.off(C,A)}),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners})}setOptions(e){if(e!==void 0){xg.parseOptions(this.options,e,!0,this.defaultOptions,!0);let g=!1;if(e.smooth!==void 0)for(let t in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,t)&&(g=this.body.edges[t].updateEdgeType()||g);if(e.font!==void 0)for(let t in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,t)&&this.body.edges[t].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||g===!0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.data.edges;if(Eh("id",e))this.body.data.edges=e;else if(B(e))this.body.data.edges=new Pg,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new Pg;else throw new TypeError("Array or DataSet expected");if(t&&S(this.edgesListeners,(A,C)=>{t.off(C,A)}),this.body.edges={},this.body.data.edges){S(this.edgesListeners,(C,i)=>{this.body.data.edges.on(i,C)});let A=this.body.data.edges.getIds();this.add(A,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),g===!1&&this.body.emitter.emit("_dataChanged")}add(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.edges,A=this.body.data.edges;for(let C=0;C<e.length;C++){let i=e[C],n=t[i];n&&n.disconnect();let o=A.get(i,{showInternalIds:!0});t[i]=this.create(o)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),g===!1&&this.body.emitter.emit("_dataChanged")}update(e){let g=this.body.edges,t=this.body.data.edges,A=!1;for(let C=0;C<e.length;C++){let i=e[C],n=t.get(i),o=g[i];o!==void 0?(o.disconnect(),A=o.setOptions(n)||A,o.connect()):(this.body.edges[i]=this.create(n),A=!0)}A===!0?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}remove(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length===0)return;let t=this.body.edges;S(e,A=>{let C=t[A];C!==void 0&&C.remove()}),g&&this.body.emitter.emit("_dataChanged")}refresh(){S(this.body.edges,(e,g)=>{let t=this.body.data.edges.get(g);t!==void 0&&e.setOptions(t)})}create(e){return new xg(e,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let e,g=this.body.nodes,t=this.body.edges;for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(g[e].edges=[]);for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let A=t[e];A.from=null,A.to=null,A.connect()}}getConnectedNodes(e){let g=[];if(this.body.edges[e]!==void 0){let t=this.body.edges[e];t.fromId!==void 0&&g.push(t.fromId),t.toId!==void 0&&g.push(t.toId)}return g}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){let e=[];S(this.body.edges,(g,t)=>{let A=this.body.nodes[g.toId],C=this.body.nodes[g.fromId];A!==void 0&&A.isCluster===!0||C!==void 0&&C.isCluster===!0||(A===void 0||C===void 0)&&e.push(t)}),this.remove(e,!1)}_addMissingEdges(){let e=this.body.data.edges;if(e==null)return;let g=this.body.edges,t=[];F(e).call(e,(A,C)=>{g[C]===void 0&&t.push(C)}),this.add(t,!0)}},zI=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.barnesHutTree,this.setOptions(t),this._rng=iC("BARNES HUT SOLVER")}setOptions(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}solve(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){let e,g=this.body.nodes,t=this.physicsBody.physicsNodeIndices,A=t.length,C=this._formBarnesHutTree(g,t);this.barnesHutTree=C;for(let i=0;i<A;i++)e=g[t[i]],e.options.mass>0&&this._getForceContributions(C.root,e)}}_getForceContributions(e,g){this._getForceContribution(e.children.NW,g),this._getForceContribution(e.children.NE,g),this._getForceContribution(e.children.SW,g),this._getForceContribution(e.children.SE,g)}_getForceContribution(e,g){if(e.childrenCount>0){let t=e.centerOfMass.x-g.x,A=e.centerOfMass.y-g.y,C=Math.sqrt(t*t+A*A);C*e.calcSize>this.thetaInversed?this._calculateForces(C,t,A,g,e):e.childrenCount===4?this._getForceContributions(e,g):e.children.data.id!=g.id&&this._calculateForces(C,t,A,g,e)}}_calculateForces(e,g,t,A,C){e===0&&(e=.1,g=e),this.overlapAvoidanceFactor<1&&A.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*A.shape.radius,e-A.shape.radius));let i=this.options.gravitationalConstant*C.mass*A.options.mass/Math.pow(e,3),n=g*i,o=t*i;this.physicsBody.forces[A.id].x+=n,this.physicsBody.forces[A.id].y+=o}_formBarnesHutTree(e,g){let t,A=g.length,C=e[g[0]].x,i=e[g[0]].y,n=e[g[0]].x,o=e[g[0]].y;for(let p=1;p<A;p++){let u=e[g[p]],m=u.x,E=u.y;u.options.mass>0&&(m<C&&(C=m),m>n&&(n=m),E<i&&(i=E),E>o&&(o=E))}let s=Math.abs(n-C)-Math.abs(o-i);s>0?(i-=.5*s,o+=.5*s):(C+=.5*s,n-=.5*s);let a=Math.max(1e-5,Math.abs(n-C)),d=.5*a,l=.5*(C+n),h=.5*(i+o),c={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:l-d,maxX:l+d,minY:h-d,maxY:h+d},size:a,calcSize:1/a,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(c.root);for(let p=0;p<A;p++)t=e[g[p]],t.options.mass>0&&this._placeInTree(c.root,t);return c}_updateBranchMass(e,g){let t=e.centerOfMass,A=e.mass+g.options.mass,C=1/A;t.x=t.x*e.mass+g.x*g.options.mass,t.x*=C,t.y=t.y*e.mass+g.y*g.options.mass,t.y*=C,e.mass=A;let i=Math.max(Math.max(g.height,g.radius),g.width);e.maxWidth=e.maxWidth<i?i:e.maxWidth}_placeInTree(e,g,t){(t!=!0||t===void 0)&&this._updateBranchMass(e,g);let A=e.children.NW.range,C;A.maxX>g.x?A.maxY>g.y?C="NW":C="SW":A.maxY>g.y?C="NE":C="SE",this._placeInRegion(e,g,C)}_placeInRegion(e,g,t){let A=e.children[t];switch(A.childrenCount){case 0:A.children.data=g,A.childrenCount=1,this._updateBranchMass(A,g);break;case 1:A.children.data.x===g.x&&A.children.data.y===g.y?(g.x+=this._rng(),g.y+=this._rng()):(this._splitBranch(A),this._placeInTree(A,g));break;case 4:this._placeInTree(A,g);break}}_splitBranch(e){let g=null;e.childrenCount===1&&(g=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),g!=null&&this._placeInTree(e,g)}_insertRegion(e,g){let t,A,C,i,n=.5*e.size;switch(g){case"NW":t=e.range.minX,A=e.range.minX+n,C=e.range.minY,i=e.range.minY+n;break;case"NE":t=e.range.minX+n,A=e.range.maxX,C=e.range.minY,i=e.range.minY+n;break;case"SW":t=e.range.minX,A=e.range.minX+n,C=e.range.minY+n,i=e.range.maxY;break;case"SE":t=e.range.minX+n,A=e.range.maxX,C=e.range.minY+n,i=e.range.maxY;break}e.children[g]={centerOfMass:{x:0,y:0},mass:0,range:{minX:t,maxX:A,minY:C,maxY:i},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}_debug(e,g){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,g))}_drawBranch(e,g,t){t===void 0&&(t="#FF0000"),e.childrenCount===4&&(this._drawBranch(e.children.NW,g),this._drawBranch(e.children.NE,g),this._drawBranch(e.children.SE,g),this._drawBranch(e.children.SW,g)),g.strokeStyle=t,g.beginPath(),g.moveTo(e.range.minX,e.range.minY),g.lineTo(e.range.maxX,e.range.minY),g.stroke(),g.beginPath(),g.moveTo(e.range.maxX,e.range.minY),g.lineTo(e.range.maxX,e.range.maxY),g.stroke(),g.beginPath(),g.moveTo(e.range.maxX,e.range.maxY),g.lineTo(e.range.minX,e.range.maxY),g.stroke(),g.beginPath(),g.moveTo(e.range.minX,e.range.maxY),g.lineTo(e.range.minX,e.range.minY),g.stroke()}},Tn=class{constructor(e,g,t){this._rng=iC("REPULSION SOLVER"),this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e}solve(){let e,g,t,A,C,i,n,o,s=this.body.nodes,r=this.physicsBody.physicsNodeIndices,a=this.physicsBody.forces,d=this.options.nodeDistance,l=-2/3/d,h=4/3;for(let c=0;c<r.length-1;c++){n=s[r[c]];for(let p=c+1;p<r.length;p++)o=s[r[p]],e=o.x-n.x,g=o.y-n.y,t=Math.sqrt(e*e+g*g),t===0&&(t=.1*this._rng(),e=t),t<2*d&&(t<.5*d?i=1:i=l*t+h,i=i/t,A=e*i,C=g*i,a[n.id].x-=A,a[n.id].y-=C,a[o.id].x+=A,a[o.id].y+=C)}}},xn=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}solve(){let e=this.body.nodes,g=this.physicsBody.physicsNodeIndices,t=this.physicsBody.forces,A=this.options.nodeDistance;for(let C=0;C<g.length-1;C++){let i=e[g[C]];for(let n=C+1;n<g.length;n++){let o=e[g[n]];if(i.level===o.level){let s=A+this.overlapAvoidanceFactor*((i.shape.radius||0)/2+(o.shape.radius||0)/2),r=o.x-i.x,a=o.y-i.y,d=Math.sqrt(r*r+a*a),l=.05,h;d<s?h=-Math.pow(l*d,2)+Math.pow(l*s,2):h=0,d!==0&&(h=h/d);let c=r*h,p=a*h;t[i.id].x-=c,t[i.id].y-=p,t[o.id].x+=c,t[o.id].y+=p}}}}},jt=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e}solve(){let e,g,t=this.physicsBody.physicsEdgeIndices,A=this.body.edges,C,i,n;for(let o=0;o<t.length;o++)g=A[t[o]],g.connected===!0&&g.toId!==g.fromId&&this.body.nodes[g.toId]!==void 0&&this.body.nodes[g.fromId]!==void 0&&(g.edgeType.via!==void 0?(e=g.options.length===void 0?this.options.springLength:g.options.length,C=g.to,i=g.edgeType.via,n=g.from,this._calculateSpringForce(C,i,.5*e),this._calculateSpringForce(i,n,.5*e)):(e=g.options.length===void 0?this.options.springLength*1.5:g.options.length,this._calculateSpringForce(g.from,g.to,e)))}_calculateSpringForce(e,g,t){let A=e.x-g.x,C=e.y-g.y,i=Math.max(Math.sqrt(A*A+C*C),.01),n=this.options.springConstant*(t-i)/i,o=A*n,s=C*n;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=o,this.physicsBody.forces[e.id].y+=s),this.physicsBody.forces[g.id]!==void 0&&(this.physicsBody.forces[g.id].x-=o,this.physicsBody.forces[g.id].y-=s)}},On=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e}solve(){let e,g,t,A,C,i,n,o,s=this.body.edges,r=.5,a=this.physicsBody.physicsEdgeIndices,d=this.physicsBody.physicsNodeIndices,l=this.physicsBody.forces;for(let w=0;w<d.length;w++){let O=d[w];l[O].springFx=0,l[O].springFy=0}for(let w=0;w<a.length;w++)g=s[a[w]],g.connected===!0&&(e=g.options.length===void 0?this.options.springLength:g.options.length,t=g.from.x-g.to.x,A=g.from.y-g.to.y,o=Math.sqrt(t*t+A*A),o=o===0?.01:o,n=this.options.springConstant*(e-o)/o,C=t*n,i=A*n,g.to.level!=g.from.level?(l[g.toId]!==void 0&&(l[g.toId].springFx-=C,l[g.toId].springFy-=i),l[g.fromId]!==void 0&&(l[g.fromId].springFx+=C,l[g.fromId].springFy+=i)):(l[g.toId]!==void 0&&(l[g.toId].x-=r*C,l[g.toId].y-=r*i),l[g.fromId]!==void 0&&(l[g.fromId].x+=r*C,l[g.fromId].y+=r*i)));n=1;let h,c;for(let w=0;w<d.length;w++){let O=d[w];h=Math.min(n,Math.max(-n,l[O].springFx)),c=Math.min(n,Math.max(-n,l[O].springFy)),l[O].x+=h,l[O].y+=c}let p=0,u=0;for(let w=0;w<d.length;w++){let O=d[w];p+=l[O].x,u+=l[O].y}let m=p/d.length,E=u/d.length;for(let w=0;w<d.length;w++){let O=d[w];l[O].x-=m,l[O].y-=E}}},rt=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e}solve(){let e,g,t,A,C=this.body.nodes,i=this.physicsBody.physicsNodeIndices,n=this.physicsBody.forces;for(let o=0;o<i.length;o++){let s=i[o];A=C[s],e=-A.x,g=-A.y,t=Math.sqrt(e*e+g*g),this._calculateForces(t,e,g,n,A)}}_calculateForces(e,g,t,A,C){let i=e===0?0:this.options.centralGravity/e;A[C.id].x=g*i,A[C.id].y=t*i}},Pn=class extends zI{constructor(e,g,t){super(e,g,t),this._rng=iC("FORCE ATLAS 2 BASED REPULSION SOLVER")}_calculateForces(e,g,t,A,C){e===0&&(e=.1*this._rng(),g=e),this.overlapAvoidanceFactor<1&&A.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*A.shape.radius,e-A.shape.radius));let i=A.edges.length+1,n=this.options.gravitationalConstant*C.mass*A.options.mass*i/Math.pow(e,2),o=g*n,s=t*n;this.physicsBody.forces[A.id].x+=o,this.physicsBody.forces[A.id].y+=s}},Dn=class extends rt{constructor(e,g,t){super(e,g,t)}_calculateForces(e,g,t,A,C){if(e>0){let i=C.edges.length+1,n=this.options.centralGravity*i*C.options.mass;A[C.id].x=g*n,A[C.id].y=t*n}}},Nn=class{constructor(e){this.body=e,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}},q(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),this.ready===!0&&this.startSimulation()}),this.body.emitter.on("startSimulation",()=>{this.ready===!0&&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(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,bI(["stabilization"],this.options,e),De(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());let g=this.options.wind;g&&((typeof g.x!="number"||Ui(g.x))&&(g.x=0),(typeof g.y!="number"||Ui(g.y))&&(g.y=0)),this.timestep=this.options.timestep}this.init()}init(){let e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new Pn(this.body,this.physicsBody,e),this.edgesSolver=new jt(this.body,this.physicsBody,e),this.gravitySolver=new Dn(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new Tn(this.body,this.physicsBody,e),this.edgesSolver=new jt(this.body,this.physicsBody,e),this.gravitySolver=new rt(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new xn(this.body,this.physicsBody,e),this.edgesSolver=new On(this.body,this.physicsBody,e),this.gravitySolver=new rt(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new zI(this.body,this.physicsBody,e),this.edgesSolver=new jt(this.body,this.physicsBody,e),this.gravitySolver=new rt(this.body,this.physicsBody,e)),this.modelOptions=e}initPhysics(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?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(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),this.viewFunction===void 0){var e;this.viewFunction=b(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}stopSimulation(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}simulationStep(){let e=uI();this.physicsTick(),(uI()-e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}_emitStabilized(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&He(()=>{this.body.emitter.emit("stabilized",{iterations:e}),this.startedStabilization=!1,this.stabilizationIterations=0},0)}physicsStep(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}adjustTimeStep(){this._evaluateStepQuality()===!0?this.timestep=1.2*this.timestep:this.timestep/1.2<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/1.2))}physicsTick(){this._startStabilizing(),this.stabilized!==!0&&(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0?(this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.physicsStep(),this.revert(),this.timestep=.5*this.timestep,this.physicsStep(),this.physicsStep(),this.adjustTimeStep()):this.physicsStep(),this.adaptiveCounter+=1):(this.timestep=this.options.timestep,this.physicsStep()),this.stabilized===!0&&this.revert(),this.stabilizationIterations++)}updatePhysicsData(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];let e=this.body.nodes,g=this.body.edges;for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&e[t].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[t].id);for(let t in g)Object.prototype.hasOwnProperty.call(g,t)&&g[t].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(g[t].id);for(let t=0;t<this.physicsBody.physicsNodeIndices.length;t++){let A=this.physicsBody.physicsNodeIndices[t];this.physicsBody.forces[A]={x:0,y:0},this.physicsBody.velocities[A]===void 0&&(this.physicsBody.velocities[A]={x:0,y:0})}for(let t in this.physicsBody.velocities)e[t]===void 0&&delete this.physicsBody.velocities[t]}revert(){let e=U(this.previousStates),g=this.body.nodes,t=this.physicsBody.velocities;this.referenceState={};for(let A=0;A<e.length;A++){let C=e[A];g[C]!==void 0?g[C].options.physics===!0&&(this.referenceState[C]={positions:{x:g[C].x,y:g[C].y}},t[C].x=this.previousStates[C].vx,t[C].y=this.previousStates[C].vy,g[C].x=this.previousStates[C].x,g[C].y=this.previousStates[C].y):delete this.previousStates[C]}}_evaluateStepQuality(){let e,g,t,A=this.body.nodes,C=this.referenceState,i=.3;for(let n in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,n)&&A[n]!==void 0&&(e=A[n].x-C[n].positions.x,g=A[n].y-C[n].positions.y,t=Math.sqrt(Math.pow(e,2)+Math.pow(g,2)),t>i))return!1;return!0}moveNodes(){let e=this.physicsBody.physicsNodeIndices,g=0,t=0,A=5;for(let C=0;C<e.length;C++){let i=e[C],n=this._performStep(i);g=Math.max(g,n),t+=n}this.adaptiveTimestepEnabled=t/e.length<A,this.stabilized=g<this.options.minVelocity}calculateComponentVelocity(e,g,t){let A=this.modelOptions.damping*e,C=(g-A)/t;e+=C*this.timestep;let i=this.options.maxVelocity||1e9;return Math.abs(e)>i&&(e=e>0?i:-i),e}_performStep(e){let g=this.body.nodes[e],t=this.physicsBody.forces[e];this.options.wind&&(t.x+=this.options.wind.x,t.y+=this.options.wind.y);let A=this.physicsBody.velocities[e];return this.previousStates[e]={x:g.x,y:g.y,vx:A.x,vy:A.y},g.options.fixed.x===!1?(A.x=this.calculateComponentVelocity(A.x,t.x,g.options.mass),g.x+=A.x*this.timestep):(t.x=0,A.x=0),g.options.fixed.y===!1?(A.y=this.calculateComponentVelocity(A.y,t.y,g.options.mass),g.y+=A.y*this.timestep):(t.y=0,A.y=0),Math.sqrt(Math.pow(A.x,2)+Math.pow(A.y,2))}_freezeNodes(){let e=this.body.nodes;for(let g in e)if(Object.prototype.hasOwnProperty.call(e,g)&&e[g].x&&e[g].y){let t=e[g].options.fixed;this.freezeCache[g]={x:t.x,y:t.y},t.x=!0,t.y=!0}}_restoreFrozenNodes(){let e=this.body.nodes;for(let g in e)Object.prototype.hasOwnProperty.call(e,g)&&this.freezeCache[g]!==void 0&&(e[g].options.fixed.x=this.freezeCache[g].x,e[g].options.fixed.y=this.freezeCache[g].y);this.freezeCache={}}stabilize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof e!="number"&&(e=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",e)),this.physicsBody.physicsNodeIndices.length===0){this.ready=!0;return}this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,He(()=>this._stabilizationBatch(),0)}_startStabilizing(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){let e=()=>this.stabilized===!1&&this.stabilizationIterations<this.targetIterations,g=()=>{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&g();let t=0;for(;e()&&t<this.options.stabilization.updateInterval;)this.physicsTick(),t++;if(g(),e()){var A;He(b(A=this._stabilizationBatch).call(A,this),0)}else this._finalizeStabilization()}_finalizeStabilization(){this.body.emitter.emit("_allowRedraw"),this.options.stabilization.fit===!0&&this.body.emitter.emit("fit"),this.options.stabilization.onlyDynamicEdges===!0&&this._restoreFrozenNodes(),this.body.emitter.emit("stabilizationIterationsDone"),this.body.emitter.emit("_requestRedraw"),this.stabilized===!0?this._emitStabilized():this.startSimulation(),this.ready=!0}_drawForces(e){for(let g=0;g<this.physicsBody.physicsNodeIndices.length;g++){let t=this.physicsBody.physicsNodeIndices[g],A=this.body.nodes[t],C=this.physicsBody.forces[t],i=20,n=.03,o=Math.sqrt(Math.pow(C.x,2)+Math.pow(C.x,2)),s=Math.min(Math.max(5,o),15),r=3*s,a=Vi((180-Math.min(1,Math.max(0,n*o))*180)/360,1,1),d={x:A.x+i*C.x,y:A.y+i*C.y};e.lineWidth=s,e.strokeStyle=a,e.beginPath(),e.moveTo(A.x,A.y),e.lineTo(d.x,d.y),e.stroke();let l=Math.atan2(C.y,C.x);e.fillStyle=a,RI.draw(e,{type:"arrow",point:d,angle:l,length:r}),EA(e).call(e)}}},de=class{constructor(){}static getRange(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=1e9,A=-1e9,C=1e9,i=-1e9,n;if(g.length>0)for(let o=0;o<g.length;o++)n=e[g[o]],C>n.shape.boundingBox.left&&(C=n.shape.boundingBox.left),i<n.shape.boundingBox.right&&(i=n.shape.boundingBox.right),t>n.shape.boundingBox.top&&(t=n.shape.boundingBox.top),A<n.shape.boundingBox.bottom&&(A=n.shape.boundingBox.bottom);return C===1e9&&i===-1e9&&t===1e9&&A===-1e9&&(t=0,A=0,C=0,i=0),{minX:C,maxX:i,minY:t,maxY:A}}static getRangeCore(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=1e9,A=-1e9,C=1e9,i=-1e9,n;if(g.length>0)for(let o=0;o<g.length;o++)n=e[g[o]],C>n.x&&(C=n.x),i<n.x&&(i=n.x),t>n.y&&(t=n.y),A<n.y&&(A=n.y);return C===1e9&&i===-1e9&&t===1e9&&A===-1e9&&(t=0,A=0,C=0,i=0),{minX:C,maxX:i,minY:t,maxY:A}}static findCenter(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}static cloneOptions(e,g){let t={};return g===void 0||g==="node"?(_(t,e.options,!0),t.x=e.x,t.y=e.y,t.amountOfConnections=e.edges.length):_(t,e.options,!0),t}},Rn=class extends pe{constructor(e,g,t,A,C,i){super(e,g,t,A,C,i),this.isCluster=!0,this.containedNodes={},this.containedEdges={}}_openChildCluster(e){let g=this.body.nodes[e];if(this.containedNodes[e]===void 0)throw new Error("node with id: "+e+" not in current cluster");if(!g.isCluster)throw new Error("node with id: "+e+" is not a cluster");delete this.containedNodes[e],S(g.edges,t=>{delete this.containedEdges[t.id]}),S(g.containedNodes,(t,A)=>{this.containedNodes[A]=t}),g.containedNodes={},S(g.containedEdges,(t,A)=>{this.containedEdges[A]=t}),g.containedEdges={},S(g.edges,t=>{S(this.edges,A=>{var C,i;let n=G(C=A.clusteringEdgeReplacingIds).call(C,t.id);n!==-1&&(S(t.clusteringEdgeReplacingIds,o=>{A.clusteringEdgeReplacingIds.push(o),this.body.edges[o].edgeReplacedById=A.id}),Ue(i=A.clusteringEdgeReplacingIds).call(i,n,1))})}),g.edges=[]}},Sn=class{constructor(e){this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},q(this.options,this.defaultOptions),this.body.emitter.on("_resetData",()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(e,g){e===void 0?e=this._getHubSize():typeof e=="object"&&(g=this._checkOptions(e),e=this._getHubSize());let t=[];for(let A=0;A<this.body.nodeIndices.length;A++){let C=this.body.nodes[this.body.nodeIndices[A]];C.edges.length>=e&&t.push(C.id)}for(let A=0;A<t.length;A++)this.clusterByConnection(t[A],g,!0);this.body.emitter.emit("_dataChanged")}cluster(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);let t={},A={};S(this.body.nodes,(C,i)=>{C.options&&e.joinCondition(C.options)===!0&&(t[i]=C,S(C.edges,n=>{this.clusteredEdges[n.id]===void 0&&(A[n.id]=n)}))}),this._cluster(t,A,e,g)}clusterByEdgeCount(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;g=this._checkOptions(g);let A=[],C={},i,n,o;for(let s=0;s<this.body.nodeIndices.length;s++){let r={},a={},d=this.body.nodeIndices[s],l=this.body.nodes[d];if(C[d]===void 0){o=0,n=[];for(let h=0;h<l.edges.length;h++)i=l.edges[h],this.clusteredEdges[i.id]===void 0&&(i.toId!==i.fromId&&o++,n.push(i));if(o===e){let h=function(p){if(g.joinCondition===void 0||g.joinCondition===null)return!0;let u=de.cloneOptions(p);return g.joinCondition(u)},c=!0;for(let p=0;p<n.length;p++){i=n[p];let u=this._getConnectedId(i,d);if(h(l))a[i.id]=i,r[d]=l,r[u]=this.body.nodes[u],C[d]=!0;else{c=!1;break}}if(U(r).length>0&&U(a).length>0&&c===!0){let u=function(){for(let m=0;m<A.length;++m)for(let E in r)if(A[m].nodes[E]!==void 0)return A[m]}();if(u!==void 0){for(let m in r)u.nodes[m]===void 0&&(u.nodes[m]=r[m]);for(let m in a)u.edges[m]===void 0&&(u.edges[m]=a[m])}else A.push({nodes:r,edges:a})}}}}for(let s=0;s<A.length;s++)this._cluster(A[s].nodes,A[s].edges,g,!1);t===!0&&this.body.emitter.emit("_dataChanged")}clusterOutliers(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,g)}clusterBridges(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,g)}clusterByConnection(e,g){var t;let A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No nodeId supplied to clusterByConnection!");if(this.body.nodes[e]===void 0)throw new Error("The nodeId given to clusterByConnection does not exist!");let C=this.body.nodes[e];g=this._checkOptions(g,C),g.clusterNodeProperties.x===void 0&&(g.clusterNodeProperties.x=C.x),g.clusterNodeProperties.y===void 0&&(g.clusterNodeProperties.y=C.y),g.clusterNodeProperties.fixed===void 0&&(g.clusterNodeProperties.fixed={},g.clusterNodeProperties.fixed.x=C.options.fixed.x,g.clusterNodeProperties.fixed.y=C.options.fixed.y);let i={},n={},o=C.id,s=de.cloneOptions(C);i[o]=C;for(let a=0;a<C.edges.length;a++){let d=C.edges[a];if(this.clusteredEdges[d.id]===void 0){let l=this._getConnectedId(d,o);if(this.clusteredNodes[l]===void 0)if(l!==o)if(g.joinCondition===void 0)n[d.id]=d,i[l]=this.body.nodes[l];else{let h=de.cloneOptions(this.body.nodes[l]);g.joinCondition(s,h)===!0&&(n[d.id]=d,i[l]=this.body.nodes[l])}else n[d.id]=d}}let r=ae(t=U(i)).call(t,function(a){return i[a].id});for(let a in i){if(!Object.prototype.hasOwnProperty.call(i,a))continue;let d=i[a];for(let l=0;l<d.edges.length;l++){let h=d.edges[l];G(r).call(r,this._getConnectedId(h,d.id))>-1&&(n[h.id]=h)}}this._cluster(i,n,g,A)}_createClusterEdges(e,g,t,A){let C,i,n,o,s,r,a=U(e),d=[];for(let c=0;c<a.length;c++){i=a[c],n=e[i];for(let p=0;p<n.edges.length;p++)C=n.edges[p],this.clusteredEdges[C.id]===void 0&&(C.toId==C.fromId?g[C.id]=C:C.toId==i?(o=t.id,s=C.fromId,r=s):(o=C.toId,s=t.id,r=o),e[r]===void 0&&d.push({edge:C,fromId:s,toId:o}))}let l=[],h=function(c){for(let p=0;p<l.length;p++){let u=l[p],m=c.fromId===u.fromId&&c.toId===u.toId,E=c.fromId===u.toId&&c.toId===u.fromId;if(m||E)return u}return null};for(let c=0;c<d.length;c++){let p=d[c],u=p.edge,m=h(p);m===null?(m=this._createClusteredEdge(p.fromId,p.toId,u,A),l.push(m)):m.clusteringEdgeReplacingIds.push(u.id),this.body.edges[u.id].edgeReplacedById=m.id,this._backupEdgeOptions(u),u.setOptions({physics:!1})}}_checkOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}_cluster(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,C=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.clusteredNodes[r]!==void 0&&C.push(r);for(let r=0;r<C.length;++r)delete e[C[r]];if(U(e).length==0||U(e).length==1&&t.clusterNodeProperties.allowSingleNodeCluster!=!0)return;let i=_({},t.clusterNodeProperties);if(t.processProperties!==void 0){let r=[];for(let d in e)if(Object.prototype.hasOwnProperty.call(e,d)){let l=de.cloneOptions(e[d]);r.push(l)}let a=[];for(let d in g)if(Object.prototype.hasOwnProperty.call(g,d)&&d.substr(0,12)!=="clusterEdge:"){let l=de.cloneOptions(g[d],"edge");a.push(l)}if(i=t.processProperties(i,r,a),!i)throw new Error("The processProperties function does not return properties!")}i.id===void 0&&(i.id="cluster:"+st());let n=i.id;i.label===void 0&&(i.label="cluster");let o;i.x===void 0&&(o=this._getClusterPosition(e),i.x=o.x),i.y===void 0&&(o===void 0&&(o=this._getClusterPosition(e)),i.y=o.y),i.id=n;let s=this.body.functions.createNode(i,Rn);s.containedNodes=e,s.containedEdges=g,s.clusterEdgeProperties=t.clusterEdgeProperties,this.body.nodes[i.id]=s,this._clusterEdges(e,g,i,t.clusterEdgeProperties),i.id=void 0,A===!0&&this.body.emitter.emit("_dataChanged")}_backupEdgeOptions(e){this.clusteredEdges[e.id]===void 0&&(this.clusteredEdges[e.id]={physics:e.options.physics})}_restoreEdge(e){let g=this.clusteredEdges[e.id];g!==void 0&&(e.setOptions({physics:g.physics}),delete this.clusteredEdges[e.id])}isCluster(e){return this.body.nodes[e]!==void 0?this.body.nodes[e].isCluster===!0:(console.error("Node does not exist."),!1)}_getClusterPosition(e){let g=U(e),t=e[g[0]].x,A=e[g[0]].x,C=e[g[0]].y,i=e[g[0]].y,n;for(let o=1;o<g.length;o++)n=e[g[o]],t=n.x<t?n.x:t,A=n.x>A?n.x:A,C=n.y<C?n.y:C,i=n.y>i?n.y:i;return{x:.5*(t+A),y:.5*(C+i)}}openCluster(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");let A=this.body.nodes[e];if(A===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(A.isCluster!==!0||A.containedNodes===void 0||A.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");let C=this.findNode(e),i=G(C).call(C,e)-1;if(i>=0){let r=C[i];this.body.nodes[r]._openChildCluster(e),delete this.body.nodes[e],t===!0&&this.body.emitter.emit("_dataChanged");return}let n=A.containedNodes,o=A.containedEdges;if(g!==void 0&&g.releaseFunction!==void 0&&typeof g.releaseFunction=="function"){let r={},a={x:A.x,y:A.y};for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){let h=this.body.nodes[l];r[l]={x:h.x,y:h.y}}let d=g.releaseFunction(a,r);for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){let h=this.body.nodes[l];d[l]!==void 0&&(h.x=d[l].x===void 0?A.x:d[l].x,h.y=d[l].y===void 0?A.y:d[l].y)}}else S(n,function(r){r.options.fixed.x===!1&&(r.x=A.x),r.options.fixed.y===!1&&(r.y=A.y)});for(let r in n)if(Object.prototype.hasOwnProperty.call(n,r)){let a=this.body.nodes[r];a.vx=A.vx,a.vy=A.vy,a.setOptions({physics:!0}),delete this.clusteredNodes[r]}let s=[];for(let r=0;r<A.edges.length;r++)s.push(A.edges[r]);for(let r=0;r<s.length;r++){let a=s[r],d=this._getConnectedId(a,e),l=this.clusteredNodes[d];for(let h=0;h<a.clusteringEdgeReplacingIds.length;h++){let c=a.clusteringEdgeReplacingIds[h],p=this.body.edges[c];if(p!==void 0)if(l!==void 0){let u=this.body.nodes[l.clusterId];u.containedEdges[p.id]=p,delete o[p.id];let m=p.fromId,E=p.toId;p.toId==d?E=l.clusterId:m=l.clusterId,this._createClusteredEdge(m,E,p,u.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(p)}a.remove()}for(let r in o)Object.prototype.hasOwnProperty.call(o,r)&&this._restoreEdge(o[r]);delete this.body.nodes[e],t===!0&&this.body.emitter.emit("_dataChanged")}getNodesInCluster(e){let g=[];if(this.isCluster(e)===!0){let t=this.body.nodes[e].containedNodes;for(let A in t)Object.prototype.hasOwnProperty.call(t,A)&&g.push(this.body.nodes[A].id)}return g}findNode(e){let g=[],A=0,C;for(;this.clusteredNodes[e]!==void 0&&A<100;){if(C=this.body.nodes[e],C===void 0)return[];g.push(C.id),e=this.clusteredNodes[e].clusterId,A++}return C=this.body.nodes[e],C===void 0?[]:(g.push(C.id),zg(g).call(g),g)}updateClusteredNode(e,g){if(e===void 0)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(g===void 0)throw new Error("No newOptions supplied to updateClusteredNode.");if(this.body.nodes[e]===void 0)throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist.");this.body.nodes[e].setOptions(g),this.body.emitter.emit("_dataChanged")}updateEdge(e,g){if(e===void 0)throw new Error("No startEdgeId supplied to updateEdge.");if(g===void 0)throw new Error("No newOptions supplied to updateEdge.");if(this.body.edges[e]===void 0)throw new Error("The startEdgeId supplied to updateEdge does not exist.");let t=this.getClusteredEdges(e);for(let A=0;A<t.length;A++)this.body.edges[t[A]].setOptions(g);this.body.emitter.emit("_dataChanged")}getClusteredEdges(e){let g=[],A=0;for(;e!==void 0&&this.body.edges[e]!==void 0&&A<100;)g.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,A++;return zg(g).call(g),g}getBaseEdge(e){return this.getBaseEdges(e)[0]}getBaseEdges(e){let g=[e],t=[],A=[],C=100,i=0;for(;g.length>0&&i<C;){let n=g.pop();if(n===void 0)continue;let o=this.body.edges[n];if(o===void 0)continue;i++;let s=o.clusteringEdgeReplacingIds;if(s===void 0)A.push(n);else for(let r=0;r<s.length;++r){let a=s[r];G(g).call(g,s)!==-1||G(t).call(t,s)!==-1||g.push(a)}t.push(n)}return A}_getConnectedId(e,g){return e.toId!=g?e.toId:(e.fromId!=g,e.fromId)}_getHubSize(){let e=0,g=0,t=0,A=0;for(let o=0;o<this.body.nodeIndices.length;o++){let s=this.body.nodes[this.body.nodeIndices[o]];s.edges.length>A&&(A=s.edges.length),e+=s.edges.length,g+=Math.pow(s.edges.length,2),t+=1}e=e/t,g=g/t;let C=g-Math.pow(e,2),i=Math.sqrt(C),n=Math.floor(e+2*i);return n>A&&(n=A),n}_createClusteredEdge(e,g,t,A,C){let i=de.cloneOptions(t,"edge");_(i,A),i.from=e,i.to=g,i.id="clusterEdge:"+st(),C!==void 0&&_(i,C);let n=this.body.functions.createEdge(i);return n.clusteringEdgeReplacingIds=[t.id],n.connect(),this.body.edges[n.id]=n,n}_clusterEdges(e,g,t,A){if(g instanceof xg){let C=g,i={};i[C.id]=C,g=i}if(e instanceof pe){let C=e,i={};i[C.id]=C,e=i}if(t==null)throw new Error("_clusterEdges: parameter clusterNode required");A===void 0&&(A=t.clusterEdgeProperties),this._createClusterEdges(e,g,t,A);for(let C in g)if(Object.prototype.hasOwnProperty.call(g,C)&&this.body.edges[C]!==void 0){let i=this.body.edges[C];this._backupEdgeOptions(i),i.setOptions({physics:!1})}for(let C in e)Object.prototype.hasOwnProperty.call(e,C)&&(this.clusteredNodes[C]={clusterId:t.id,node:this.body.nodes[C]},this.body.nodes[C].setOptions({physics:!1}))}_getClusterNodeForNode(e){if(e===void 0)return;let g=this.clusteredNodes[e];if(g===void 0)return;let t=g.clusterId;if(t!==void 0)return this.body.nodes[t]}_filter(e,g){let t=[];return S(e,A=>{g(A)&&t.push(A)}),t}_updateState(){let e,g=[],t={},A=o=>{S(this.body.nodes,s=>{s.isCluster===!0&&o(s)})};for(e in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,e))continue;this.body.nodes[e]===void 0&&g.push(e)}A(function(o){for(let s=0;s<g.length;s++)delete o.containedNodes[g[s]]});for(let o=0;o<g.length;o++)delete this.clusteredNodes[g[o]];S(this.clusteredEdges,o=>{let s=this.body.edges[o];(s===void 0||!s.endPointsValid())&&(t[o]=o)}),A(function(o){S(o.containedEdges,(s,r)=>{!s.endPointsValid()&&!t[r]&&(t[r]=r)})}),S(this.body.edges,(o,s)=>{let r=!0,a=o.clusteringEdgeReplacingIds;if(a!==void 0){let d=0;S(a,l=>{let h=this.body.edges[l];h!==void 0&&h.endPointsValid()&&(d+=1)}),r=d>0}(!o.endPointsValid()||!r)&&(t[s]=s)}),A(o=>{S(t,s=>{delete o.containedEdges[s],S(o.edges,(r,a)=>{if(r.id===s){o.edges[a]=null;return}r.clusteringEdgeReplacingIds=this._filter(r.clusteringEdgeReplacingIds,function(d){return!t[d]})}),o.edges=this._filter(o.edges,function(r){return r!==null})})}),S(t,o=>{delete this.clusteredEdges[o]}),S(t,o=>{delete this.body.edges[o]});let C=U(this.body.edges);S(C,o=>{let s=this.body.edges[o],r=this._isClusteredNode(s.fromId)||this._isClusteredNode(s.toId);if(r!==this._isClusteredEdge(s.id))if(r){let a=this._getClusterNodeForNode(s.fromId);a!==void 0&&this._clusterEdges(this.body.nodes[s.fromId],s,a);let d=this._getClusterNodeForNode(s.toId);d!==void 0&&this._clusterEdges(this.body.nodes[s.toId],s,d)}else delete this._clusterEdges[o],this._restoreEdge(s)});let i=!1,n=!0;for(;n;){let o=[];A(function(s){let r=U(s.containedNodes).length,a=s.options.allowSingleNodeCluster===!0;(a&&r<1||!a&&r<2)&&o.push(s.id)});for(let s=0;s<o.length;++s)this.openCluster(o[s],{},!1);n=o.length>0,i=i||n}i&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}},kn=class{constructor(e,g){this.body=e,this.canvas=g,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},q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;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=He(()=>{var g;this.zooming=!1,b(g=this._requestRedraw).call(g,this)()},250)}),this.body.emitter.on("_resizeNodes",()=>{this._resizeNodes()}),this.body.emitter.on("_redraw",()=>{this.renderingActive===!1&&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",b(e=this._requestRedraw).call(e,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(e){e!==void 0&&xt(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,e)}_startRendering(){if(this.renderingActive===!0&&this.requestAnimationFrameRequestId===void 0){var e;this.requestAnimationFrameRequestId=window.requestAnimationFrame(b(e=this._renderStep).call(e,this),this.simulationInterval)}}_renderStep(){this.renderingActive===!0&&(this.requestAnimationFrameRequestId=void 0,this._startRendering(),this._redraw())}redraw(){this.body.emitter.emit("setSize"),this._redraw()}_requestRedraw(){this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,window.requestAnimationFrame(()=>{this._redraw(!1)}))}_redraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;let g={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();let t=this.canvas.getContext(),A=this.canvas.frame.canvas.clientWidth,C=this.canvas.frame.canvas.clientHeight;if(t.clearRect(0,0,A,C),this.canvas.frame.clientWidth===0)return;if(t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale),t.beginPath(),this.body.emitter.emit("beforeDrawing",t),t.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(t),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){let{drawExternalLabels:i}=this._drawNodes(t,e);g.drawExternalLabels=i}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(t),g.drawExternalLabels!=null&&g.drawExternalLabels(),e===!1&&this._drawSelectionBox(t),t.beginPath(),this.body.emitter.emit("afterDrawing",t),t.closePath(),t.restore(),e===!0&&t.clearRect(0,0,A,C)}}_resizeNodes(){this.canvas.setTransform();let e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);let g=this.body.nodes,t;for(let A in g)Object.prototype.hasOwnProperty.call(g,A)&&(t=g[A],t.resize(e),t.updateBoundingBox(e,t.selected));e.restore()}_drawNodes(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.nodes,A=this.body.nodeIndices,C,i=[],n=[],o=20,s=this.canvas.DOMtoCanvas({x:-o,y:-o}),r=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+o,y:this.canvas.frame.canvas.clientHeight+o}),a={top:s.y,left:s.x,bottom:r.y,right:r.x},d=[];for(let p=0;p<A.length;p++)if(C=t[A[p]],C.hover)n.push(A[p]);else if(C.isSelected())i.push(A[p]);else if(g===!0){let u=C.draw(e);u.drawExternalLabel!=null&&d.push(u.drawExternalLabel)}else if(C.isBoundingBoxOverlappingWith(a)===!0){let u=C.draw(e);u.drawExternalLabel!=null&&d.push(u.drawExternalLabel)}else C.updateBoundingBox(e,C.selected);let l,h=i.length,c=n.length;for(l=0;l<h;l++){C=t[i[l]];let p=C.draw(e);p.drawExternalLabel!=null&&d.push(p.drawExternalLabel)}for(l=0;l<c;l++){C=t[n[l]];let p=C.draw(e);p.drawExternalLabel!=null&&d.push(p.drawExternalLabel)}return{drawExternalLabels:()=>{for(let p of d)p()}}}_drawEdges(e){let g=this.body.edges,t=this.body.edgeIndices;for(let A=0;A<t.length;A++){let C=g[t[A]];C.connected===!0&&C.draw(e)}}_drawArrows(e){let g=this.body.edges,t=this.body.edgeIndices;for(let A=0;A<t.length;A++){let C=g[t[A]];C.connected===!0&&C.drawArrows(e)}}_drawSelectionBox(e){if(this.body.selectionBox.show){e.beginPath();let g=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,t=this.body.selectionBox.position.end.y-this.body.selectionBox.position.start.y;e.rect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,g,t),e.fillStyle="rgba(151, 194, 252, 0.2)",e.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,g,t),e.strokeStyle="rgba(151, 194, 252, 1)",e.stroke()}else e.closePath()}},Wk=L,Yk=Wk.setInterval,_k=Yk,Kk=D(_k);function ZI(I,e){e.inputHandler=function(g){g.isFirst&&e(g)},I.on("hammer.input",e.inputHandler)}function Ph(I,e){return e.inputHandler=function(g){g.isFinal&&e(g)},I.on("hammer.input",e.inputHandler)}var Mn=class{constructor(e){this.body=e,this.pixelRatio=1,this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this._cleanupCallbacks=[],this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.once("resize",g=>{g.width!==0&&(this.body.view.translation.x=g.width*.5),g.height!==0&&(this.body.view.translation.y=g.height*.5)}),this.body.emitter.on("setSize",b(e=this.setSize).call(e,this)),this.body.emitter.on("destroy",()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()})}setOptions(e){if(e!==void 0&&xt(["width","height","autoResize"],this.options,e),this._cleanUp(),this.options.autoResize===!0){var g;if(window.ResizeObserver){let A=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")}),{frame:C}=this;A.observe(C),this._cleanupCallbacks.push(()=>{A.unobserve(C)})}else{let A=Kk(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(()=>{clearInterval(A)})}let t=b(g=this._onResize).call(g,this);window.addEventListener("resize",t),this._cleanupCallbacks.push(()=>{window.removeEventListener("resize",t)})}}_cleanUp(){var e,g,t;F(e=zg(g=Ue(t=this._cleanupCallbacks).call(t,0)).call(g)).call(e,A=>{try{A()}catch(C){console.error(C)}})}_onResize(){this.setSize(),this.body.emitter.emit("_redraw")}_getCameraState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}_setCameraState(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){let e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,g=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,t=this.cameraState.scale;e!=1&&g!=1?t=this.cameraState.scale*.5*(e+g):e!=1?t=this.cameraState.scale*e:g!=1&&(t=this.cameraState.scale*g),this.body.view.scale=t;let A=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),C={x:A.x-this.cameraState.position.x,y:A.y-this.cameraState.position.y};this.body.view.translation.x+=C.x*this.body.view.scale,this.body.view.translation.y+=C.y*this.body.view.scale}}_prepareValue(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(G(e).call(e,"%")!==-1||G(e).call(e,"px")!==-1)return e;if(G(e).call(e,"%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}_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{let e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}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(){this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new ot(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:ot.DIRECTION_ALL}),ZI(this.hammer,e=>{this.body.eventListeners.onTouch(e)}),this.hammer.on("tap",e=>{this.body.eventListeners.onTap(e)}),this.hammer.on("doubletap",e=>{this.body.eventListeners.onDoubleTap(e)}),this.hammer.on("press",e=>{this.body.eventListeners.onHold(e)}),this.hammer.on("panstart",e=>{this.body.eventListeners.onDragStart(e)}),this.hammer.on("panmove",e=>{this.body.eventListeners.onDrag(e)}),this.hammer.on("panend",e=>{this.body.eventListeners.onDragEnd(e)}),this.hammer.on("pinch",e=>{this.body.eventListeners.onPinch(e)}),this.frame.canvas.addEventListener("wheel",e=>{this.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("mousemove",e=>{this.body.eventListeners.onMouseMove(e)}),this.frame.canvas.addEventListener("contextmenu",e=>{this.body.eventListeners.onContext(e)}),this.hammerFrame=new ot(this.frame),Ph(this.hammerFrame,e=>{this.body.eventListeners.onRelease(e)})}setSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),g=this._prepareValue(g);let t=!1,A=this.frame.canvas.width,C=this.frame.canvas.height,i=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||g!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=g)this._getCameraState(i),this.frame.style.width=e,this.frame.style.height=g,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=e,this.options.height=g,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},t=!0;else{let n=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),o=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==n||this.frame.canvas.height!==o)&&this._getCameraState(i),this.frame.canvas.width!==n&&(this.frame.canvas.width=n,t=!0),this.frame.canvas.height!==o&&(this.frame.canvas.height=o,t=!0)}return t===!0&&(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(A/this.pixelRatio),oldHeight:Math.round(C/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,t}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){let e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");let g=1;typeof window!="undefined"&&(g=window.devicePixelRatio||1);let t=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return g/t}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){let e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}_XconvertDOMtoCanvas(e){return(e-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(e){return(e-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.y}canvasToDOM(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}DOMtoCanvas(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}};function Uk(I,e){let g=q({nodes:e,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},I!=null?I:{});if(!B(g.nodes))throw new TypeError("Nodes has to be an array of ids.");if(g.nodes.length===0&&(g.nodes=e),!(typeof g.minZoomLevel=="number"&&g.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof g.maxZoomLevel=="number"&&g.minZoomLevel<=g.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return g}var Fn=class{constructor(e,g){var t,A;this.body=e,this.canvas=g,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",b(t=this.fit).call(t,this)),this.body.emitter.on("animationFinished",()=>{this.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",b(A=this.releaseNode).call(A,this))}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}fit(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=Uk(e,this.body.nodeIndices);let t=this.canvas.frame.canvas.clientWidth,A=this.canvas.frame.canvas.clientHeight,C,i;if(t===0||A===0)i=1,C=de.getRange(this.body.nodes,e.nodes);else if(g===!0){let s=0;for(let d in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,d)&&this.body.nodes[d].predefinedPosition===!0&&(s+=1);if(s>.5*this.body.nodeIndices.length){this.fit(e,!1);return}C=de.getRange(this.body.nodes,e.nodes),i=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;let a=Math.min(t/600,A/600);i*=a}else{this.body.emitter.emit("_resizeNodes"),C=de.getRange(this.body.nodes,e.nodes);let s=Math.abs(C.maxX-C.minX)*1.1,r=Math.abs(C.maxY-C.minY)*1.1,a=t/s,d=A/r;i=a<=d?a:d}i>e.maxZoomLevel?i=e.maxZoomLevel:i<e.minZoomLevel&&(i=e.minZoomLevel);let o={position:de.findCenter(C),scale:i,animation:e.animation};this.moveTo(o)}focus(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){let t={x:this.body.nodes[e].x,y:this.body.nodes[e].y};g.position=t,g.lockedOnNode=e,this.moveTo(g)}else console.error("Node: "+e+" cannot be found.")}moveTo(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!Mg(e.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!Mg(e.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!Mg(e.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!Mg(e.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}animateView(e){if(e===void 0)return;this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;let g=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),t={x:g.x-e.position.x,y:g.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+t.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+t.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var A;this.viewFunction=b(A=this._lockedRedraw).call(A,this),this.body.emitter.on("initRedraw",this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else{var C;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=b(C=this._transitionRedraw).call(C,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}_lockedRedraw(){let e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},g=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),t={x:g.x-e.x,y:g.y-e.y},A=this.body.view.translation,C={x:A.x+t.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:A.y+t.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=C}releaseNode(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}_transitionRedraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;let g=KO[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*g,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*g,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*g},this.easingTime>=1){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var t;this.viewFunction=b(t=this._lockedRedraw).call(t,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})}},Hk=`div.vis-network div.vis-navigation div.vis-button {
653
+ `),A=t.length;if(g.multi)for(let C=0;C<A;C++){let i=this.splitBlocks(t[C],g.multi);if(i!==void 0){if(i.length===0){this.lines.newLine("");continue}if(g.maxWdt>0)for(let n=0;n<i.length;n++){let r=i[n].mod,o=i[n].text;this.splitStringIntoLines(o,r,!0)}else for(let n=0;n<i.length;n++){let r=i[n].mod,o=i[n].text;this.lines.append(o,r)}this.lines.newLine()}}else if(g.maxWdt>0)for(let C=0;C<A;C++)this.splitStringIntoLines(t[C]);else for(let C=0;C<A;C++)this.lines.newLine(t[C]);return this.lines.finalize()}decodeMarkupSystem(e){let g="none";return e==="markdown"||e==="md"?g="markdown":(e===!0||e==="html")&&(g="html"),g}splitHtmlBlocks(e){let g=new PI(e),t=A=>/&/.test(A)?(g.replace(g.text,"&lt;","<")||g.replace(g.text,"&amp;","&")||g.add("&"),!0):!1;for(;g.position<g.text.length;){let A=g.text.charAt(g.position);g.parseWS(A)||/</.test(A)&&(g.parseStartTag("bold","<b>")||g.parseStartTag("ital","<i>")||g.parseStartTag("mono","<code>")||g.parseEndTag("bold","</b>")||g.parseEndTag("ital","</i>")||g.parseEndTag("mono","</code>"))||t(A)||g.add(A),g.position++}return g.emitBlock(),g.blocks}splitMarkdownBlocks(e){let g=new PI(e),t=!0,A=C=>/\\/.test(C)?(g.position<this.text.length+1&&(g.position++,C=this.text.charAt(g.position),/ \t/.test(C)?g.spacing=!0:(g.add(C),t=!1)),!0):!1;for(;g.position<g.text.length;){let C=g.text.charAt(g.position);g.parseWS(C)||A(C)||(t||g.spacing)&&(g.parseStartTag("bold","*")||g.parseStartTag("ital","_")||g.parseStartTag("mono","`"))||g.parseEndTag("bold","*","afterBold")||g.parseEndTag("ital","_","afterItal")||g.parseEndTag("mono","`","afterMono")||(g.add(C),t=!1),g.position++}return g.emitBlock(),g.blocks}splitBlocks(e,g){let t=this.decodeMarkupSystem(g);if(t==="none")return[{text:e,mod:"normal"}];if(t==="markdown")return this.splitMarkdownBlocks(e);if(t==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){let g=this.ctx.measureText(e).width;return this.lines.curWidth()+g>this.parent.fontOptions.maxWdt}getLongestFit(e){let g="",t=0;for(;t<e.length;){let C=g+(g===""?"":" ")+e[t];if(this.overMaxWidth(C))break;g=C,t++}return t}getLongestFitWord(e){let g=0;for(;g<e.length&&!this.overMaxWidth(Ze(e).call(e,0,g));)g++;return g}splitStringIntoLines(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,g),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let A=e.split("\r");for(;A.length>0;){let C=this.getLongestFit(A);if(C===0){let i=A[0],n=this.getLongestFitWord(i);this.lines.newLine(Ze(i).call(i,0,n),g),A[0]=Ze(i).call(i,n)}else{let i=C;A[C-1]===" "?C--:A[i]===" "&&i++;let n=Ze(A).call(A,0,C).join("");C==A.length&&t?this.lines.append(n,g):this.lines.newLine(n,g),A=Ze(A).call(A,i)}}}},St=["bold","ital","boldital","mono"],DI=class I{constructor(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(g),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=t}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),OI(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){let g=e.font.size;g!==void 0&&(this.baseSize=g)}}}initFontOptions(e){if(S(St,g=>{this.fontOptions[g]={}}),I.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}S(e,(g,t)=>{g!=null&&typeof g!="object"&&(this.fontOptions[t]=g)})}static parseFontString(e,g){if(!g||typeof g!="string")return!1;let t=g.split(" ");return e.size=+t[0].replace("px",""),e.face=t[1],e.color=t[2],!0}constrain(e){let g={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},t=pg(e,"widthConstraint");if(typeof t=="number")g.maxWdt=Number(t),g.minWdt=Number(t);else if(typeof t=="object"){let C=pg(e,["widthConstraint","maximum"]);typeof C=="number"&&(g.maxWdt=Number(C));let i=pg(e,["widthConstraint","minimum"]);typeof i=="number"&&(g.minWdt=Number(i))}let A=pg(e,"heightConstraint");if(typeof A=="number")g.minHgt=Number(A);else if(typeof A=="object"){let C=pg(e,["heightConstraint","minimum"]);typeof C=="number"&&(g.minHgt=Number(C));let i=pg(e,["heightConstraint","valign"]);typeof i=="string"&&(i==="top"||i==="bottom")&&(g.valign=i)}return g}update(e,g){this.setOptions(e,!0),this.propagateFonts(g),_(this.fontOptions,this.constrain(g)),this.fontOptions.chooser=kr("label",g)}adjustSizes(e){let g=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=g,this.fontOptions.minWdt-=g);let t=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=t)}addFontOptionsToPile(e,g){for(let t=0;t<g.length;++t)this.addFontToPile(e,g[t])}addFontToPile(e,g){if(g===void 0||g.font===void 0||g.font===null)return;let t=g.font;e.push(t)}getBasicOptions(e){let g={};for(let t=0;t<e.length;++t){let A=e[t],C={};I.parseFontString(C,A)&&(A=C),S(A,(i,n)=>{i!==void 0&&(Object.prototype.hasOwnProperty.call(g,n)||(G(St).call(St,n)!==-1?g[n]={}:g[n]=i))})}return g}getFontOption(e,g,t){let A;for(let C=0;C<e.length;++C){let i=e[C];if(Object.prototype.hasOwnProperty.call(i,g)){if(A=i[g],A==null)continue;let n={};if(I.parseFontString(n,A)&&(A=n),Object.prototype.hasOwnProperty.call(A,t))return A[t]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,t))return this.fontOptions[t];throw new Error("Did not find value for multi-font for property: '"+t+"'")}getFontOptions(e,g){let t={},A=["color","size","face","mod","vadjust"];for(let C=0;C<A.length;++C){let i=A[C];t[i]=this.getFontOption(e,g,i)}return t}propagateFonts(e){let g=[];this.addFontOptionsToPile(g,e),this.fontOptions=this.getBasicOptions(g);for(let t=0;t<St.length;++t){let A=St[t],C=this.fontOptions[A],i=this.getFontOptions(g,A);S(i,(n,r)=>{C[r]=n}),C.size=Number(C.size),C.vadjust=Number(C.vadjust)}}draw(e,g,t,A,C){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label===void 0)return;let n=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&n<this.elementOptions.scaling.label.drawThreshold-1||(n>=this.elementOptions.scaling.label.maxVisible&&(n=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,A,C,g,t,i),this._drawBackground(e),this._drawText(e,g,this.size.yLine,i,n))}_drawBackground(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;let g=this.getSize();e.fillRect(g.left,g.top,g.width,g.height)}}_drawText(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",C=arguments.length>4?arguments[4]:void 0;[g,t]=this._setAlignment(e,g,t,A),e.textAlign="left",g=g-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(t-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(t+=(this.size.height-this.size.labelHeight)/2));for(let i=0;i<this.lineCount;i++){let n=this.lines[i];if(n&&n.blocks){let r=0;this.isEdgeLabel||this.fontOptions.align==="center"?r+=(this.size.width-n.width)/2:this.fontOptions.align==="right"&&(r+=this.size.width-n.width);for(let o=0;o<n.blocks.length;o++){let s=n.blocks[o];e.font=s.font;let[a,d]=this._getColor(s.color,C,s.strokeColor);s.strokeWidth>0&&(e.lineWidth=s.strokeWidth,e.strokeStyle=d,e.lineJoin="round"),e.fillStyle=a,s.strokeWidth>0&&e.strokeText(s.text,g+r,t+s.vadjust),e.fillText(s.text,g+r,t+s.vadjust),r+=s.width}t+=n.height}}}_setAlignment(e,g,t,A){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){g=0,t=0;let C=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",t-=2*C):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",t+=2*C):e.textBaseline="middle"}else e.textBaseline=A;return[g,t]}_getColor(e,g,t){let A=e||"#000000",C=t||"#ffffff";if(g<=this.elementOptions.scaling.label.drawThreshold){let i=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-g)));A=Ne(A,i),C=Ne(C,i)}return[A,C]}getTextSize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,g,t),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let g=this.size.left,t=this.size.top-.5*2;if(this.isEdgeLabel){let C=-this.size.width*.5;switch(this.fontOptions.align){case"middle":g=C,t=-this.size.height*.5;break;case"top":g=C,t=-(this.size.height+2);break;case"bottom":g=C,t=2;break}}return{left:g,top:t,width:this.size.width,height:this.size.height}}calculateLabelSize(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,g,t),this.size.left=A-this.size.width*.5,this.size.top=C-this.size.height*.5,this.size.yLine=C+(1-this.lineCount)*.5*this.fontOptions.size,i==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(e,g,t,A){let C=function(r,o,s){return o==="normal"?s==="mod"?"":r[s]:r[o][s]!==void 0?r[o][s]:r[s]},i={color:C(this.fontOptions,A,"color"),size:C(this.fontOptions,A,"size"),face:C(this.fontOptions,A,"face"),mod:C(this.fontOptions,A,"mod"),vadjust:C(this.fontOptions,A,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(g||t)&&(A==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?i.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(i,this.elementOptions.id,g,t));let n="";return i.mod!==void 0&&i.mod!==""&&(n+=i.mod+" "),n+=i.size+"px "+i.face,e.font=n.replace(/"/g,""),i.font=e.font,i.height=i.size,i}differentState(e,g){return e!==this.selectedState||g!==this.hoverState}_processLabelText(e,g,t,A){return new qi(e,this,g,t).process(A)}_processLabel(e,g,t){if(this.labelDirty===!1&&!this.differentState(g,t))return;let A=this._processLabelText(e,g,t,this.elementOptions.label);this.fontOptions.minWdt>0&&A.width<this.fontOptions.minWdt&&(A.width=this.fontOptions.minWdt),this.size.labelHeight=A.height,this.fontOptions.minHgt>0&&A.height<this.fontOptions.minHgt&&(A.height=this.fontOptions.minHgt),this.lines=A.lines,this.lineCount=A.lines.length,this.size.width=A.width,this.size.height=A.height,this.selectedState=g,this.hoverState=t,this.labelDirty=!1}visible(){return!(this.size.width===0||this.size.height===0||this.elementOptions.label===void 0||this.fontOptions.size*this.body.view.scale<this.elementOptions.scaling.label.drawThreshold-1)}},og=class{constructor(e,g,t){this.body=g,this.labelModule=t,this.setOptions(e),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.margin=void 0,this.refreshNeeded=!0,this.boundingBox={top:0,left:0,right:0,bottom:0}}setOptions(e){this.options=e}_setMargins(e){this.margin={},this.options.margin&&(typeof this.options.margin=="object"?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),e.adjustSizes(this.margin)}_distanceToBorder(e,g){let t=this.options.borderWidth;return e&&this.resize(e),Math.min(Math.abs(this.width/2/Math.cos(g)),Math.abs(this.height/2/Math.sin(g)))+t}enableShadow(e,g){g.shadow&&(e.shadowColor=g.shadowColor,e.shadowBlur=g.shadowSize,e.shadowOffsetX=g.shadowX,e.shadowOffsetY=g.shadowY)}disableShadow(e,g){g.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}enableBorderDashes(e,g){if(g.borderDashes!==!1)if(e.setLineDash!==void 0){let t=g.borderDashes;t===!0&&(t=[5,15]),e.setLineDash(t)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,g.borderDashes=!1}disableBorderDashes(e,g){g.borderDashes!==!1&&(e.setLineDash!==void 0?e.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,g.borderDashes=!1))}needsRefresh(e,g){return this.refreshNeeded===!0?(this.refreshNeeded=!1,!0):this.width===void 0||this.labelModule.differentState(e,g)}initContextForDraw(e,g){let t=g.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,t),e.strokeStyle=g.borderColor,e.fillStyle=g.color}performStroke(e,g){let t=g.borderWidth/this.body.view.scale;e.save(),t>0&&(this.enableBorderDashes(e,g),e.stroke(),this.disableBorderDashes(e,g)),e.restore()}performFill(e,g){e.save(),e.fillStyle=g.color,this.enableShadow(e,g),EA(e).call(e),this.disableShadow(e,g),e.restore(),this.performStroke(e,g)}_addBoundingBoxMargin(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}_updateBoundingBox(e,g,t,A,C){t!==void 0&&this.resize(t,A,C),this.left=e-this.width/2,this.top=g-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(e,g,t,A,C){this._updateBoundingBox(e,g,t,A,C)}getDimensionsFromLabel(e,g,t){this.textSize=this.labelModule.getTextSize(e,g,t);let A=this.textSize.width,C=this.textSize.height,i=14;return A===0&&(A=i,C=i),{width:A,height:C}}},xk=class extends og{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(g,t)){let A=this.getDimensionsFromLabel(e,g,t);this.width=A.width+this.margin.right+this.margin.left,this.height=A.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width/2,this.top=t-this.height/2,this.initContextForDraw(e,i),Xa(e,this.left,this.top,this.width,this.height,i.borderRadius),this.performFill(e,i),this.updateBoundingBox(g,t,e,A,C),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,C)}updateBoundingBox(e,g,t,A,C){this._updateBoundingBox(e,g,t,A,C);let i=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(i)}distanceToBorder(e,g){e&&this.resize(e);let t=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(g)),Math.abs(this.height/2/Math.sin(g)))+t}},qt=class extends og{constructor(e,g,t){super(e,g,t),this.labelOffset=0,this.selected=!1}setOptions(e,g,t){this.options=e,g===void 0&&t===void 0||this.setImages(g,t)}setImages(e,g){g&&this.selected?(this.imageObj=g,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=g)}switchImages(e){let g=e&&!this.selected||!e&&this.selected;if(this.selected=e,this.imageObjAlt!==void 0&&g){let t=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=t}}_getImagePadding(){let e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){let g=this.options.imagePadding;typeof g=="object"?(e.top=g.top,e.right=g.right,e.bottom=g.bottom,e.left=g.left):(e.top=g,e.right=g,e.bottom=g,e.left=g)}return e}_resizeImage(){let e,g;if(this.options.shapeProperties.useImageSize===!1){let t=1,A=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?t=this.imageObj.width/this.imageObj.height:A=this.imageObj.height/this.imageObj.width),e=this.options.size*2*t,g=this.options.size*2*A}else{let t=this._getImagePadding();e=this.imageObj.width+t.left+t.right,g=this.imageObj.height+t.top+t.bottom}this.width=e,this.height=g,this.radius=.5*this.width}_drawRawCircle(e,g,t,A){this.initContextForDraw(e,A),qn(e,g,t,A.size),this.performFill(e,A)}_drawImageAtPosition(e,g){if(this.imageObj.width!=0){e.globalAlpha=g.opacity!==void 0?g.opacity:1,this.enableShadow(e,g);let t=1;this.options.shapeProperties.interpolation===!0&&(t=this.imageObj.width/this.width/this.body.view.scale);let A=this._getImagePadding(),C=this.left+A.left,i=this.top+A.top,n=this.width-A.left-A.right,r=this.height-A.top-A.bottom;this.imageObj.drawImageAtPosition(e,t,C,i,n,r),this.disableShadow(e,g)}}_drawImageLabel(e,g,t,A,C){let i=0;if(this.height!==void 0){i=this.height*.5;let r=this.labelModule.getTextSize(e,A,C);r.lineCount>=1&&(i+=r.height/2)}let n=t+i;this.options.label&&(this.labelOffset=i),this.labelModule.draw(e,g,n,A,C,"hanging")}},Ok=class extends qt{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(g,t)){let A=this.getDimensionsFromLabel(e,g,t),C=Math.max(A.width+this.margin.right+this.margin.left,A.height+this.margin.top+this.margin.bottom);this.options.size=C/2,this.width=C,this.height=C,this.radius=this.width/2}}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width/2,this.top=t-this.height/2,this._drawRawCircle(e,g,t,i),this.updateBoundingBox(g,t),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,t,A,C)}updateBoundingBox(e,g){this.boundingBox.top=g-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=g+this.options.size}distanceToBorder(e){return e&&this.resize(e),this.width*.5}},en=class extends qt{constructor(e,g,t,A,C){super(e,g,t),this.setImages(A,C)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){let C=this.options.size*2;this.width=C,this.height=C,this.radius=.5*this.width;return}this.needsRefresh(g,t)&&this._resizeImage()}draw(e,g,t,A,C,i){this.switchImages(A),this.resize();let n=g,r=t;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=g,this.top=t,n+=this.width/2,r+=this.height/2):(this.left=g-this.width/2,this.top=t-this.height/2),this._drawRawCircle(e,n,r,i),e.save(),e.clip(),this._drawImageAtPosition(e,i),e.restore(),this._drawImageLabel(e,n,r,A,C),this.updateBoundingBox(g,t)}updateBoundingBox(e,g){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=g,this.boundingBox.left=e,this.boundingBox.right=e+this.options.size*2,this.boundingBox.bottom=g+this.options.size*2):(this.boundingBox.top=g-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=g+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(e){return e&&this.resize(e),this.width*.5}},$e=class extends og{constructor(e,g,t){super(e,g,t)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(g,t)){var C,i;this.labelModule.getTextSize(e,g,t);let n=2*A.size;this.width=(C=this.customSizeWidth)!==null&&C!==void 0?C:n,this.height=(i=this.customSizeHeight)!==null&&i!==void 0?i:n,this.radius=.5*this.width}}_drawShape(e,g,t,A,C,i,n,r){return this.resize(e,i,n,r),this.left=A-this.width/2,this.top=C-this.height/2,this.initContextForDraw(e,r),op(g)(e,A,C,r.size),this.performFill(e,r),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(i?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",e.fillText(this.options.icon.code,A,C)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(e,i,n,A,C,"hanging");let o=C+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,A,o,i,n,"hanging")}this.updateBoundingBox(A,C)}}}updateBoundingBox(e,g){this.boundingBox.top=g-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=g+this.options.size,this.options.label!==void 0&&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 ua(I,e){var g=U(I);if(Xe){var t=Xe(I);e&&(t=te(t).call(t,function(A){return eg(I,A).enumerable})),g.push.apply(g,t)}return g}function Pk(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=ua(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):Je?RA(I,Je(A)):F(t=ua(Object(A))).call(t,function(C){SA(I,C,eg(A,C))})}return I}var gn=class extends $e{constructor(e,g,t,A){super(e,g,t,A),this.ctxRenderer=A}draw(e,g,t,A,C,i){this.resize(e,A,C,i),this.left=g-this.width/2,this.top=t-this.height/2,e.save();let n=this.ctxRenderer({ctx:e,id:this.options.id,x:g,y:t,state:{selected:A,hover:C},style:Pk({},i),label:this.options.label});if(n.drawNode!=null&&n.drawNode(),e.restore(),n.drawExternalLabel){let r=n.drawExternalLabel;n.drawExternalLabel=()=>{e.save(),r(),e.restore()}}return n.nodeDimensions&&(this.customSizeWidth=n.nodeDimensions.width,this.customSizeHeight=n.nodeDimensions.height),n}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},tn=class extends og{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e,g,t){if(this.needsRefresh(g,t)){let C=this.getDimensionsFromLabel(e,g,t).width+this.margin.right+this.margin.left;this.width=C,this.height=C,this.radius=this.width/2}}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width/2,this.top=t-this.height/2,this.initContextForDraw(e,i),Ja(e,g-this.width/2,t-this.height/2,this.width,this.height),this.performFill(e,i),this.updateBoundingBox(g,t,e,A,C),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,C)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},Dk=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"diamond",4,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},An=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"circle",2,g,t,A,C,i)}distanceToBorder(e){return e&&this.resize(e),this.options.size}},NI=class extends og{constructor(e,g,t){super(e,g,t)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(g,t)){let A=this.getDimensionsFromLabel(e,g,t);this.height=A.height*2,this.width=A.width+A.height,this.radius=.5*this.width}}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width*.5,this.top=t-this.height*.5,this.initContextForDraw(e,i),bi(e,this.left,this.top,this.width,this.height),this.performFill(e,i),this.updateBoundingBox(g,t,e,A,C),this.labelModule.draw(e,g,t,A,C)}distanceToBorder(e,g){e&&this.resize(e);let t=this.width*.5,A=this.height*.5,C=Math.sin(g)*t,i=Math.cos(g)*A;return t*A/Math.sqrt(C*C+i*i)}},In=class extends og{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e,g,t){this.needsRefresh(g,t)&&(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(e,g,t,A,C,i){return this.resize(e,A,C),this.options.icon.size=this.options.icon.size||50,this.left=g-this.width/2,this.top=t-this.height/2,this._icon(e,g,t,A,C,i),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,t+this.height/2+5,A),this.updateBoundingBox(g,t)}}}updateBoundingBox(e,g){this.boundingBox.top=g-this.options.icon.size*.5,this.boundingBox.left=e-this.options.icon.size*.5,this.boundingBox.right=e+this.options.icon.size*.5,this.boundingBox.bottom=g+this.options.icon.size*.5,this.options.label!==void 0&&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+5))}_icon(e,g,t,A,C,i){let n=Number(this.options.icon.size);this.options.icon.code!==void 0?(e.font=[this.options.icon.weight!=null?this.options.icon.weight:A?"bold":"",(this.options.icon.weight!=null&&A?5:0)+n+"px",this.options.icon.face].join(" "),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,i),e.fillText(this.options.icon.code,g,t),this.disableShadow(e,i)):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(e,g){return this._distanceToBorder(e,g)}},Nk=class extends qt{constructor(e,g,t,A,C){super(e,g,t),this.setImages(A,C)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){let C=this.options.size*2;this.width=C,this.height=C;return}this.needsRefresh(g,t)&&this._resizeImage()}draw(e,g,t,A,C,i){e.save(),this.switchImages(A),this.resize();let n=g,r=t;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=g,this.top=t,n+=this.width/2,r+=this.height/2):(this.left=g-this.width/2,this.top=t-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){let o=this.options.borderWidth,s=this.options.borderWidthSelected||2*this.options.borderWidth,a=(A?s:o)/this.body.view.scale;e.lineWidth=Math.min(this.width,a),e.beginPath();let d=A?this.options.color.highlight.border:C?this.options.color.hover.border:this.options.color.border,l=A?this.options.color.highlight.background:C?this.options.color.hover.background:this.options.color.background;i.opacity!==void 0&&(d=Ne(d,i.opacity),l=Ne(l,i.opacity)),e.strokeStyle=d,e.fillStyle=l,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),EA(e).call(e),this.performStroke(e,i),e.closePath()}this._drawImageAtPosition(e,i),this._drawImageLabel(e,n,r,A,C),this.updateBoundingBox(g,t),e.restore()}updateBoundingBox(e,g){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=e,this.top=g):(this.left=e-this.width/2,this.top=g-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,this.options.label!==void 0&&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(e,g){return this._distanceToBorder(e,g)}},Cn=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"square",2,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},nn=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"hexagon",4,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},rn=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"star",4,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},on=class extends og{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e,g,t){this.needsRefresh(g,t)&&(this.textSize=this.labelModule.getTextSize(e,g,t),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(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width/2,this.top=t-this.height/2,this.enableShadow(e,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,C),this.disableShadow(e,i),this.updateBoundingBox(g,t,e,A,C)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},Rk=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"triangle",3,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},sn=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"triangleDown",3,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}};function fa(I,e){var g=U(I);if(Xe){var t=Xe(I);e&&(t=te(t).call(t,function(A){return eg(I,A).enumerable})),g.push.apply(g,t)}return g}function pa(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=fa(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):Je?RA(I,Je(A)):F(t=fa(Object(A))).call(t,function(C){SA(I,C,eg(A,C))})}return I}var pe=class I{constructor(e,g,t,A,C,i){this.options=xg(C),this.globalOptions=C,this.defaultOptions=i,this.body=g,this.edges=[],this.id=void 0,this.imagelist=t,this.grouplist=A,this.x=void 0,this.y=void 0,this.baseSize=this.options.size,this.baseFontSize=this.options.font.size,this.predefinedPosition=!1,this.selected=!1,this.hover=!1,this.labelModule=new DI(this.body,this.options,!1),this.setOptions(e)}attachEdge(e){var g;G(g=this.edges).call(g,e)===-1&&this.edges.push(e)}detachEdge(e){var g;let t=G(g=this.edges).call(g,e);if(t!=-1){var A;Ue(A=this.edges).call(A,t,1)}}setOptions(e){let g=this.options.shape;if(!e)return;if(typeof e.color!="undefined"&&(this._localColor=e.color),e.id!==void 0&&(this.id=e.id),this.id===void 0)throw new Error("Node must have an id");I.checkMass(e,this.id),e.x!==void 0&&(e.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=ze(e.x),this.predefinedPosition=!0)),e.y!==void 0&&(e.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=ze(e.y),this.predefinedPosition=!0)),e.size!==void 0&&(this.baseSize=e.size),e.value!==void 0&&(e.value=xh(e.value)),I.parseOptions(this.options,e,!0,this.globalOptions,this.grouplist);let t=[e,this.options,this.defaultOptions];return this.chooser=kr("node",t),this._load_images(),this.updateLabelModule(e),e.opacity!==void 0&&I.checkOpacity(e.opacity)&&(this.options.opacity=e.opacity),this.updateShape(g),e.hidden!==void 0||e.physics!==void 0}_load_images(){if((this.options.shape==="circularImage"||this.options.shape==="image")&&this.options.image===void 0)throw new Error("Option image must be defined for node type '"+this.options.shape+"'");if(this.options.image!==void 0){if(this.imagelist===void 0)throw new Error("Internal Error: No images provided");if(typeof this.options.image=="string")this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id);else{if(this.options.image.unselected===void 0)throw new Error("No unselected image provided");this.imageObj=this.imagelist.load(this.options.image.unselected,this.options.brokenImage,this.id),this.options.image.selected!==void 0?this.imageObjAlt=this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id):this.imageObjAlt=void 0}}}static checkOpacity(e){return 0<=e&&e<=1}static checkCoordinateOrigin(e){return e===void 0||e==="center"||e==="top-left"}static updateGroupOptions(e,g,t){var A;if(t===void 0)return;let C=e.group;if(g!==void 0&&g.group!==void 0&&C!==g.group)throw new Error("updateGroupOptions: group values in options don't match.");if(!(typeof C=="number"||typeof C=="string"&&C!=""))return;let n=t.get(C);n.opacity!==void 0&&g.opacity===void 0&&(I.checkOpacity(n.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+n.opacity),n.opacity=void 0));let r=te(A=Ek(g)).call(A,o=>g[o]!=null);r.push("font"),bI(r,e,n),e.color=Gi(e.color)}static parseOptions(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},C=arguments.length>4?arguments[4]:void 0;if(bI(["color","fixed","shadow"],e,g,t),I.checkMass(g),e.opacity!==void 0&&(I.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),g.opacity!==void 0&&(I.checkOpacity(g.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+g.opacity),g.opacity=void 0)),g.shapeProperties&&!I.checkCoordinateOrigin(g.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+g.shapeProperties.coordinateOrigin),De(e,g,"shadow",A),g.color!==void 0&&g.color!==null){let n=Gi(g.color);Zl(e.color,n)}else t===!0&&g.color===null&&(e.color=xg(A.color));g.fixed!==void 0&&g.fixed!==null&&(typeof g.fixed=="boolean"?(e.fixed.x=g.fixed,e.fixed.y=g.fixed):(g.fixed.x!==void 0&&typeof g.fixed.x=="boolean"&&(e.fixed.x=g.fixed.x),g.fixed.y!==void 0&&typeof g.fixed.y=="boolean"&&(e.fixed.y=g.fixed.y))),t===!0&&g.font===null&&(e.font=xg(A.font)),I.updateGroupOptions(e,g,C),g.scaling!==void 0&&De(e.scaling,g.scaling,"label",A.scaling)}getFormattingValues(){let e={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?this.chooser===!0?this.selected?(this.options.borderWidthSelected!=null?e.borderWidth=this.options.borderWidthSelected:e.borderWidth*=2,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):typeof this.chooser=="function"&&(this.chooser(e,this.options.id,this.selected,this.hover),e.shadow===!1&&(e.shadowColor!==this.options.shadow.color||e.shadowSize!==this.options.shadow.size||e.shadowX!==this.options.shadow.x||e.shadowY!==this.options.shadow.y)&&(e.shadow=!0)):e.shadow=this.options.shadow.enabled,this.options.opacity!==void 0){let g=this.options.opacity;e.borderColor=Ne(e.borderColor,g),e.color=Ne(e.color,g),e.shadowColor=Ne(e.shadowColor,g)}return e}updateLabelModule(e){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),I.updateGroupOptions(this.options,pa(pa({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);let g=this.grouplist.get(this.options.group,!1),t=[e,this.options,g,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new xk(this.options,this.body,this.labelModule);break;case"circle":this.shape=new Ok(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new en(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new gn(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new tn(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new Dk(this.options,this.body,this.labelModule);break;case"dot":this.shape=new An(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new NI(this.options,this.body,this.labelModule);break;case"icon":this.shape=new In(this.options,this.body,this.labelModule);break;case"image":this.shape=new Nk(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new Cn(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new nn(this.options,this.body,this.labelModule);break;case"star":this.shape=new rn(this.options,this.body,this.labelModule);break;case"text":this.shape=new on(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new Rk(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new sn(this.options,this.body,this.labelModule);break;default:this.shape=new NI(this.options,this.body,this.labelModule);break}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(e,g){return this.shape.distanceToBorder(e,g)}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(e,g,t){if(this.options.value!==void 0){let A=this.options.scaling.customScalingFunction(e,g,t,this.options.value),C=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){let i=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+A*i}this.options.size=this.options.scaling.min+A*C}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(e){let g=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,g)||{}}updateBoundingBox(e){this.shape.updateBoundingBox(this.x,this.y,e)}resize(e){let g=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,g)}getItemsOnPoint(e){let g=[];return this.labelModule.visible()&&Ji(this.labelModule.getSize(),e)&&g.push({nodeId:this.id,labelId:0}),Ji(this.shape.boundingBox,e)&&g.push({nodeId:this.id}),g}isOverlappingWith(e){return this.shape.left<e.right&&this.shape.left+this.shape.width>e.left&&this.shape.top<e.bottom&&this.shape.top+this.shape.height>e.top}isBoundingBoxOverlappingWith(e){return this.shape.boundingBox.left<e.right&&this.shape.boundingBox.right>e.left&&this.shape.boundingBox.top<e.bottom&&this.shape.boundingBox.bottom>e.top}static checkMass(e,g){if(e.mass!==void 0&&e.mass<=0){let t="";g!==void 0&&(t=" in node id: "+g),console.error("%cNegative or zero mass disallowed"+t+", setting mass to 1.",jl),e.mass=1}}},an=class{constructor(e,g,t,A){var C;if(this.body=e,this.images=g,this.groups=t,this.layoutEngine=A,this.body.functions.createNode=b(C=this.create).call(C,this),this.nodesListeners={add:(i,n)=>{this.add(n.items)},update:(i,n)=>{this.update(n.items,n.data,n.oldData)},remove:(i,n)=>{this.remove(n.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(i,n,r,o){if(n===i)return .5;{let s=1/(n-i);return Math.max(0,(o-i)*s)}}},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=xg(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,g;this.body.emitter.on("refreshNodes",b(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",b(g=this.refresh).call(g,this)),this.body.emitter.on("destroy",()=>{S(this.nodesListeners,(t,A)=>{this.body.data.nodes&&this.body.data.nodes.off(A,t)}),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners})}setOptions(e){if(e!==void 0){if(pe.parseOptions(this.options,e),e.opacity!==void 0&&(Ui(e.opacity)||!Mg(e.opacity)||e.opacity<0||e.opacity>1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(let g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&this.body.nodes[g].updateShape();if(typeof e.font!="undefined"||typeof e.widthConstraint!="undefined"||typeof e.heightConstraint!="undefined")for(let g of U(this.body.nodes))this.body.nodes[g].updateLabelModule(),this.body.nodes[g].needsRefresh();if(e.size!==void 0)for(let g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&this.body.nodes[g].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.data.nodes;if(Eh("id",e))this.body.data.nodes=e;else if(B(e))this.body.data.nodes=new rg,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new rg;else throw new TypeError("Array or DataSet expected");if(t&&S(this.nodesListeners,function(A,C){t.off(C,A)}),this.body.nodes={},this.body.data.nodes){let A=this;S(this.nodesListeners,function(i,n){A.body.data.nodes.on(n,i)});let C=this.body.data.nodes.getIds();this.add(C,!0)}g===!1&&this.body.emitter.emit("_dataChanged")}add(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t,A=[];for(let C=0;C<e.length;C++){t=e[C];let i=this.body.data.nodes.get(t),n=this.create(i);A.push(n),this.body.nodes[t]=n}this.layoutEngine.positionInitially(A),g===!1&&this.body.emitter.emit("_dataChanged")}update(e,g,t){let A=this.body.nodes,C=!1;for(let i=0;i<e.length;i++){let n=e[i],r=A[n],o=g[i];r!==void 0?r.setOptions(o)&&(C=!0):(C=!0,r=this.create(o),A[n]=r)}!C&&t!==void 0&&(C=ih(g).call(g,function(i,n){let r=t[n];return r&&r.level!==i.level})),C===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}remove(e){let g=this.body.nodes;for(let t=0;t<e.length;t++){let A=e[t];delete g[A]}this.body.emitter.emit("_dataChanged")}create(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pe;return new g(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;S(this.body.nodes,(g,t)=>{let A=this.body.data.nodes.get(t);A!==void 0&&(e===!0&&g.setOptions({x:null,y:null}),g.setOptions({fixed:!1}),g.setOptions(A))})}getPositions(e){let g={};if(e!==void 0){if(B(e)===!0){for(let t=0;t<e.length;t++)if(this.body.nodes[e[t]]!==void 0){let A=this.body.nodes[e[t]];g[e[t]]={x:Math.round(A.x),y:Math.round(A.y)}}}else if(this.body.nodes[e]!==void 0){let t=this.body.nodes[e];g[e]={x:Math.round(t.x),y:Math.round(t.y)}}}else for(let t=0;t<this.body.nodeIndices.length;t++){let A=this.body.nodes[this.body.nodeIndices[t]];g[this.body.nodeIndices[t]]={x:Math.round(A.x),y:Math.round(A.y)}}return g}getPosition(e){if(e==null)throw new TypeError("No id was specified for getPosition method.");if(this.body.nodes[e]==null)throw new ReferenceError("NodeId provided for getPosition does not exist. Provided: ".concat(e));return{x:Math.round(this.body.nodes[e].x),y:Math.round(this.body.nodes[e].y)}}storePositions(){let e=[],g=this.body.data.nodes.getDataSet();for(let t of g.get()){let A=t.id,C=this.body.nodes[A],i=Math.round(C.x),n=Math.round(C.y);(t.x!==i||t.y!==n)&&e.push({id:A,x:i,y:n})}g.update(e)}getBoundingBox(e){if(this.body.nodes[e]!==void 0)return this.body.nodes[e].shape.boundingBox}getConnectedNodes(e,g){let t=[];if(this.body.nodes[e]!==void 0){let A=this.body.nodes[e],C={};for(let i=0;i<A.edges.length;i++){let n=A.edges[i];g!=="to"&&n.toId==A.id?C[n.fromId]===void 0&&(t.push(n.fromId),C[n.fromId]=!0):g!=="from"&&n.fromId==A.id&&C[n.toId]===void 0&&(t.push(n.toId),C[n.toId]=!0)}}return t}getConnectedEdges(e){let g=[];if(this.body.nodes[e]!==void 0){let t=this.body.nodes[e];for(let A=0;A<t.edges.length;A++)g.push(t.edges[A].id)}else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return g}moveNode(e,g,t){this.body.nodes[e]!==void 0?(this.body.nodes[e].x=Number(g),this.body.nodes[e].y=Number(t),He(()=>{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}},Sk=N,ma=Math.hypot,kk=Math.abs,Mk=Math.sqrt,Fk=!!ma&&ma(1/0,NaN)!==1/0;Sk({target:"Math",stat:!0,arity:2,forced:Fk},{hypot:function(e,g){for(var t=0,A=0,C=arguments.length,i=0,n,r;A<C;)n=kk(arguments[A++]),i<n?(r=i/n,t=t*r*r+1,i=n):n>0?(r=n/i,t+=r*r):t+=n;return i===1/0?1/0:i*Mk(t)}});var Bk=L,zk=Bk.Math.hypot,Zk=zk,Lk=Zk,Gk=Lk,Vk=D(Gk),H=class{static transform(e,g){B(e)||(e=[e]);let t=g.point.x,A=g.point.y,C=g.angle,i=g.length;for(let n=0;n<e.length;++n){let r=e[n],o=r.x*Math.cos(C)-r.y*Math.sin(C),s=r.x*Math.sin(C)+r.y*Math.cos(C);r.x=t+i*o,r.y=A+i*s}}static drawPath(e,g){e.beginPath(),e.moveTo(g[0].x,g[0].y);for(let t=1;t<g.length;++t)e.lineTo(g[t].x,g[t].y);e.closePath()}},jk=class extends H{static draw(e,g){if(g.image){e.save(),e.translate(g.point.x,g.point.y),e.rotate(Math.PI/2+g.angle);let t=g.imageWidth!=null?g.imageWidth:g.image.width,A=g.imageHeight!=null?g.imageHeight:g.image.height;g.image.drawImageAtPosition(e,1,-t/2,0,t,A),e.restore()}return!1}},dn=class extends H{static draw(e,g){let t=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return H.transform(t,g),H.drawPath(e,t),!0}},ln=class{static draw(e,g){let t=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return H.transform(t,g),H.drawPath(e,t),!0}},hn=class{static draw(e,g){let t={x:-.4,y:0};H.transform(t,g),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";let A=Math.PI,C=g.angle-A/2,i=g.angle+A/2;return e.beginPath(),e.arc(t.x,t.y,g.length*.4,C,i,!1),e.stroke(),!0}},cn=class{static draw(e,g){let t={x:-.3,y:0};H.transform(t,g),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";let A=Math.PI,C=g.angle+A/2,i=g.angle+3*A/2;return e.beginPath(),e.arc(t.x,t.y,g.length*.4,C,i,!1),e.stroke(),!0}},un=class{static draw(e,g){let t=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return H.transform(t,g),H.drawPath(e,t),!0}},fn=class{static draw(e,g){let t=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return H.transform(t,g),H.drawPath(e,t),!0}},pn=class{static draw(e,g){let t={x:-.4,y:0};return H.transform(t,g),qn(e,t.x,t.y,g.length*.4),!0}},mn=class{static draw(e,g){let t=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return H.transform(t,g),H.drawPath(e,t),!0}},vn=class{static draw(e,g){let t=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return H.transform(t,g),H.drawPath(e,t),!0}},bn=class{static draw(e,g){let t=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return H.transform(t,g),H.drawPath(e,t),!0}},yn=class{static draw(e,g){let t=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return H.transform(t,g),H.drawPath(e,t),!0}},RI=class{static draw(e,g){let t;switch(g.type&&(t=g.type.toLowerCase()),t){case"image":return jk.draw(e,g);case"circle":return pn.draw(e,g);case"box":return vn.draw(e,g);case"crow":return ln.draw(e,g);case"curve":return hn.draw(e,g);case"diamond":return bn.draw(e,g);case"inv_curve":return cn.draw(e,g);case"triangle":return un.draw(e,g);case"inv_triangle":return fn.draw(e,g);case"bar":return mn.draw(e,g);case"vee":return yn.draw(e,g);default:return dn.draw(e,g)}}};function va(I,e){var g=U(I);if(Xe){var t=Xe(I);e&&(t=te(t).call(t,function(A){return eg(I,A).enumerable})),g.push.apply(g,t)}return g}function ba(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=va(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):Je?RA(I,Je(A)):F(t=va(Object(A))).call(t,function(C){SA(I,C,eg(A,C))})}return I}var SI=class{constructor(e,g,t){this._body=g,this._labelModule=t,this.color={},this.colorDirty=!0,this.hoverWidth=1.5,this.selectionWidth=2,this.setOptions(e),this.fromPoint=this.from,this.toPoint=this.to}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to]}cleanup(){return!1}setOptions(e){this.options=e,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.id=this.options.id}drawLine(e,g,t,A){let C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,g),e.lineWidth=g.width,g.dashes!==!1?this._drawDashedLine(e,g,C):this._drawLine(e,g,C)}_drawLine(e,g,t,A,C){if(this.from!=this.to)this._line(e,g,t,A,C);else{let[i,n,r]=this._getCircleData(e);this._circle(e,g,i,n,r)}}_drawDashedLine(e,g,t,A,C){e.lineCap="round";let i=B(g.dashes)?g.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(i),e.lineDashOffset=0,this.from!=this.to)this._line(e,g,t);else{let[n,r,o]=this._getCircleData(e);this._circle(e,g,n,r,o)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)$a(e,this.from.x,this.from.y,this.to.x,this.to.y,i);else{let[n,r,o]=this._getCircleData(e);this._circle(e,g,n,r,o)}this.enableShadow(e,g),e.stroke(),this.disableShadow(e,g)}}findBorderPosition(e,g,t){return this.from!=this.to?this._findBorderPosition(e,g,t):this._findBorderPositionCircle(e,g,t)}findBorderPositions(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};{var g;let[t,A]=Ze(g=this._getCircleData(e)).call(g,0,2);return{from:this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:.6,high:.8,direction:1})}}}_getCircleData(e){let g=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);let t=Oh(e,this.options.selfReference.angle,g,this.from);return[t.x,t.y,g]}_pointOnCircle(e,g,t,A){let C=A*2*Math.PI;return{x:e+t*Math.cos(C),y:g-t*Math.sin(C)}}_findBorderPositionCircle(e,g,t){let A=t.x,C=t.y,i=t.low,n=t.high,r=t.direction,o=10,s=this.options.selfReference.size,a=.05,d,l=(i+n)*.5,h=0;this.options.arrowStrikethrough===!0&&(r===-1?h=this.options.endPointOffset.from:r===1&&(h=this.options.endPointOffset.to));let c=0;do{l=(i+n)*.5,d=this._pointOnCircle(A,C,s,l);let p=Math.atan2(e.y-d.y,e.x-d.x),u=e.distanceToBorder(g,p)+h,m=Math.sqrt(Math.pow(d.x-e.x,2)+Math.pow(d.y-e.y,2)),E=u-m;if(Math.abs(E)<a)break;E>0?r>0?i=l:n=l:r>0?n=l:i=l,++c}while(i<=n&&c<o);return ba(ba({},d),{},{t:l})}getLineWidth(e,g){return e===!0?Math.max(this.selectionWidth,.3/this._body.view.scale):g===!0?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}getColor(e,g){if(g.inheritsColor!==!1){if(g.inheritsColor==="both"&&this.from.id!==this.to.id){let t=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),A=this.from.options.color.highlight.border,C=this.to.options.color.highlight.border;return this.from.selected===!1&&this.to.selected===!1?(A=Ne(this.from.options.color.border,g.opacity),C=Ne(this.to.options.color.border,g.opacity)):this.from.selected===!0&&this.to.selected===!1?C=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(A=this.from.options.color.border),t.addColorStop(0,A),t.addColorStop(1,C),t}return g.inheritsColor==="to"?Ne(this.to.options.color.border,g.opacity):Ne(this.from.options.color.border,g.opacity)}else return Ne(g.color,g.opacity)}_circle(e,g,t,A,C){this.enableShadow(e,g);let i=0,n=Math.PI*2;if(!this.options.selfReference.renderBehindTheNode){let r=this.options.selfReference.angle,o=this.options.selfReference.angle+Math.PI,s=this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:r,high:o,direction:-1}),a=this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:r,high:o,direction:1});i=Math.atan2(s.y-A,s.x-t),n=Math.atan2(a.y-A,a.x-t)}e.beginPath(),e.arc(t,A,C,i,n,!1),e.stroke(),this.disableShadow(e,g)}getDistanceToEdge(e,g,t,A,C,i){if(this.from!=this.to)return this._getDistanceToEdge(e,g,t,A,C,i);{let[n,r,o]=this._getCircleData(void 0),s=n-C,a=r-i;return Math.abs(Math.sqrt(s*s+a*a)-o)}}_getDistanceToLine(e,g,t,A,C,i){let n=t-e,r=A-g,o=n*n+r*r,s=((C-e)*n+(i-g)*r)/o;s>1?s=1:s<0&&(s=0);let a=e+s*n,d=g+s*r,l=a-C,h=d-i;return Math.sqrt(l*l+h*h)}getArrowData(e,g,t,A,C,i){let n,r,o,s,a,d,l,h=i.width;g==="from"?(o=this.from,s=this.to,a=i.fromArrowScale<0,d=Math.abs(i.fromArrowScale),l=i.fromArrowType):g==="to"?(o=this.to,s=this.from,a=i.toArrowScale<0,d=Math.abs(i.toArrowScale),l=i.toArrowType):(o=this.to,s=this.from,a=i.middleArrowScale<0,d=Math.abs(i.middleArrowScale),l=i.middleArrowType);let c=15*d+3*h;if(o!=s){let E=Vk(o.x-s.x,o.y-s.y),w=c/E;if(g!=="middle")if(this.options.smooth.enabled===!0){let O=this._findBorderPosition(o,e,{via:t}),M=this.getPoint(O.t+w*(g==="from"?1:-1),t);n=Math.atan2(O.y-M.y,O.x-M.x),r=O}else n=Math.atan2(o.y-s.y,o.x-s.x),r=this._findBorderPosition(o,e);else{let O=(a?-w:w)/2,M=this.getPoint(.5+O,t),k=this.getPoint(.5-O,t);n=Math.atan2(M.y-k.y,M.x-k.x),r=this.getPoint(.5,t)}}else{let[E,w,O]=this._getCircleData(e);if(g==="from"){let M=this.options.selfReference.angle,k=this.options.selfReference.angle+Math.PI,V=this._findBorderPositionCircle(this.from,e,{x:E,y:w,low:M,high:k,direction:-1});n=V.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,r=V}else if(g==="to"){let M=this.options.selfReference.angle,k=this.options.selfReference.angle+Math.PI,V=this._findBorderPositionCircle(this.from,e,{x:E,y:w,low:M,high:k,direction:1});n=V.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,r=V}else{let M=this.options.selfReference.angle/(2*Math.PI);r=this._pointOnCircle(E,w,O,M),n=M*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}let p=r.x-c*.9*Math.cos(n),u=r.y-c*.9*Math.sin(n);return{point:r,core:{x:p,y:u},angle:n,length:c,type:l}}drawArrowHead(e,g,t,A,C){e.strokeStyle=this.getColor(e,g),e.fillStyle=e.strokeStyle,e.lineWidth=g.width,RI.draw(e,C)&&(this.enableShadow(e,g),EA(e).call(e),this.disableShadow(e,g))}enableShadow(e,g){g.shadow===!0&&(e.shadowColor=g.shadowColor,e.shadowBlur=g.shadowSize,e.shadowOffsetX=g.shadowX,e.shadowOffsetY=g.shadowY)}disableShadow(e,g){g.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}drawBackground(e,g){if(g.background!==!1){let t={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=g.backgroundColor,e.lineWidth=g.backgroundSize,this.setStrokeDashed(e,g.backgroundDashes),e.stroke(),e.strokeStyle=t.strokeStyle,e.lineWidth=t.lineWidth,e.dashes=t.dashes,this.setStrokeDashed(e,g.dashes)}}setStrokeDashed(e,g){if(g!==!1)if(e.setLineDash!==void 0){let t=B(g)?g:[5,5];e.setLineDash(t)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else e.setLineDash!==void 0?e.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}};function ya(I,e){var g=U(I);if(Xe){var t=Xe(I);e&&(t=te(t).call(t,function(A){return eg(I,A).enumerable})),g.push.apply(g,t)}return g}function wa(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=ya(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):Je?RA(I,Je(A)):F(t=ya(Object(A))).call(t,function(C){SA(I,C,eg(A,C))})}return I}var eA=class extends SI{constructor(e,g,t){super(e,g,t)}_findBorderPositionBezier(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates(),A=10,C=.2,i=!1,n=1,r=0,o=this.to,s,a,d=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(o=this.from,i=!0,d=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(d=0);let l=0;do{a=(r+n)*.5,s=this.getPoint(a,t);let h=Math.atan2(o.y-s.y,o.x-s.x),c=o.distanceToBorder(g,h)+d,p=Math.sqrt(Math.pow(s.x-o.x,2)+Math.pow(s.y-o.y,2)),u=c-p;if(Math.abs(u)<C)break;u<0?i===!1?r=a:n=a:i===!1?n=a:r=a,++l}while(r<=n&&l<A);return wa(wa({},s),{},{t:a})}_getDistanceToBezierEdge(e,g,t,A,C,i,n){let r=1e9,o,s,a,d,l,h=e,c=g;for(s=1;s<10;s++)a=.1*s,d=Math.pow(1-a,2)*e+2*a*(1-a)*n.x+Math.pow(a,2)*t,l=Math.pow(1-a,2)*g+2*a*(1-a)*n.y+Math.pow(a,2)*A,s>0&&(o=this._getDistanceToLine(h,c,d,l,C,i),r=o<r?o:r),h=d,c=l;return r}_bezierCurve(e,g,t,A){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),t!=null&&t.x!=null?A!=null&&A.x!=null?e.bezierCurveTo(t.x,t.y,A.x,A.y,this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(t.x,t.y,this.toPoint.x,this.toPoint.y):e.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(e,g),this.enableShadow(e,g),e.stroke(),this.disableShadow(e,g)}getViaNode(){return this._getViaCoordinates()}},kI=class extends eA{constructor(e,g,t){super(e,g,t),this.via=this.via,this._boundFunction=()=>{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(e){super.setOptions(e);let g=!1;this.options.physics!==e.physics&&(g=!0),this.options=e,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(),g===!0&&(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],this.from===void 0||this.to===void 0||this.options.physics===!1?this.via.setOptions({physics:!1}):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),this.via!==void 0?(delete this._body.nodes[this.via.id],this.via=void 0,!0):!1}setupSupportNode(){if(this.via===void 0){let e="edgeId:"+this.id,g=this._body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this._body.nodes[e]=g,this.via=g,this.via.parentEdgeId=this.id,this.positionBezierNode()}}positionBezierNode(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}_line(e,g,t){this._bezierCurve(e,g,t)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){let[t,A,C]=this._getCircleData(),i=2*Math.PI*(1-e);return{x:t+C*Math.sin(i),y:A+C-C*(1-Math.cos(i))}}else return{x:Math.pow(1-e,2)*this.fromPoint.x+2*e*(1-e)*g.x+Math.pow(e,2)*this.toPoint.x,y:Math.pow(1-e,2)*this.fromPoint.y+2*e*(1-e)*g.y+Math.pow(e,2)*this.toPoint.y}}_findBorderPosition(e,g){return this._findBorderPositionBezier(e,g,this.via)}_getDistanceToEdge(e,g,t,A,C,i){return this._getDistanceToBezierEdge(e,g,t,A,C,i,this.via)}},MI=class extends eA{constructor(e,g,t){super(e,g,t)}_line(e,g,t){this._bezierCurve(e,g,t)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){let e=this.options.smooth.roundness,g=this.options.smooth.type,t=Math.abs(this.from.x-this.to.x),A=Math.abs(this.from.y-this.to.y);if(g==="discrete"||g==="diagonalCross"){let C,i;t<=A?C=i=e*A:C=i=e*t,this.from.x>this.to.x&&(C=-C),this.from.y>=this.to.y&&(i=-i);let n=this.from.x+C,r=this.from.y+i;return g==="discrete"&&(t<=A?n=t<e*A?this.from.x:n:r=A<e*t?this.from.y:r),{x:n,y:r}}else if(g==="straightCross"){let C=(1-e)*t,i=(1-e)*A;return t<=A?(C=0,this.from.y<this.to.y&&(i=-i)):(this.from.x<this.to.x&&(C=-C),i=0),{x:this.to.x+C,y:this.to.y+i}}else if(g==="horizontal"){let C=(1-e)*t;return this.from.x<this.to.x&&(C=-C),{x:this.to.x+C,y:this.from.y}}else if(g==="vertical"){let C=(1-e)*A;return this.from.y<this.to.y&&(C=-C),{x:this.from.x,y:this.to.y+C}}else if(g==="curvedCW"){t=this.to.x-this.from.x,A=this.from.y-this.to.y;let C=Math.sqrt(t*t+A*A),i=Math.PI,r=(Math.atan2(A,t)+(e*.5+.5)*i)%(2*i);return{x:this.from.x+(e*.5+.5)*C*Math.sin(r),y:this.from.y+(e*.5+.5)*C*Math.cos(r)}}else if(g==="curvedCCW"){t=this.to.x-this.from.x,A=this.from.y-this.to.y;let C=Math.sqrt(t*t+A*A),i=Math.PI,r=(Math.atan2(A,t)+(-e*.5+.5)*i)%(2*i);return{x:this.from.x+(e*.5+.5)*C*Math.sin(r),y:this.from.y+(e*.5+.5)*C*Math.cos(r)}}else{let C,i;t<=A?C=i=e*A:C=i=e*t,this.from.x>this.to.x&&(C=-C),this.from.y>=this.to.y&&(i=-i);let n=this.from.x+C,r=this.from.y+i;return t<=A?this.from.x<=this.to.x?n=this.to.x<n?this.to.x:n:n=this.to.x>n?this.to.x:n:this.from.y>=this.to.y?r=this.to.y>r?this.to.y:r:r=this.to.y<r?this.to.y:r,{x:n,y:r}}}_findBorderPosition(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,g,t.via)}_getDistanceToEdge(e,g,t,A,C,i){let n=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,g,t,A,C,i,n)}getPoint(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),t=e,A=Math.pow(1-t,2)*this.fromPoint.x+2*t*(1-t)*g.x+Math.pow(t,2)*this.toPoint.x,C=Math.pow(1-t,2)*this.fromPoint.y+2*t*(1-t)*g.y+Math.pow(t,2)*this.toPoint.y;return{x:A,y:C}}},wn=class extends eA{constructor(e,g,t){super(e,g,t)}_getDistanceToBezierEdge2(e,g,t,A,C,i,n,r){let o=1e9,s=e,a=g,d=[0,0,0,0];for(let l=1;l<10;l++){let h=.1*l;d[0]=Math.pow(1-h,3),d[1]=3*h*Math.pow(1-h,2),d[2]=3*Math.pow(h,2)*(1-h),d[3]=Math.pow(h,3);let c=d[0]*e+d[1]*n.x+d[2]*r.x+d[3]*t,p=d[0]*g+d[1]*n.y+d[2]*r.y+d[3]*A;if(l>0){let u=this._getDistanceToLine(s,a,c,p,C,i);o=u<o?u:o}s=c,a=p}return o}},FI=class extends wn{constructor(e,g,t){super(e,g,t)}_line(e,g,t){let A=t[0],C=t[1];this._bezierCurve(e,g,A,C)}_getViaCoordinates(){let e=this.from.x-this.to.x,g=this.from.y-this.to.y,t,A,C,i,n=this.options.smooth.roundness;return(Math.abs(e)>Math.abs(g)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(A=this.from.y,i=this.to.y,t=this.from.x-n*e,C=this.to.x+n*e):(A=this.from.y-n*g,i=this.to.y+n*g,t=this.from.x,C=this.to.x),[{x:t,y:A},{x:C,y:i}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(e,g){return this._findBorderPositionBezier(e,g)}_getDistanceToEdge(e,g,t,A,C,i){let[n,r]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,g,t,A,C,i,n,r)}getPoint(e){let[g,t]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),A=e,C=[Math.pow(1-A,3),3*A*Math.pow(1-A,2),3*Math.pow(A,2)*(1-A),Math.pow(A,3)],i=C[0]*this.fromPoint.x+C[1]*g.x+C[2]*t.x+C[3]*this.toPoint.x,n=C[0]*this.fromPoint.y+C[1]*g.y+C[2]*t.y+C[3]*this.toPoint.y;return{x:i,y:n}}},BI=class extends SI{constructor(e,g,t){super(e,g,t)}_line(e,g){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,g),e.stroke(),this.disableShadow(e,g)}getViaNode(){}getPoint(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}_findBorderPosition(e,g){let t=this.to,A=this.from;e.id===this.from.id&&(t=this.from,A=this.to);let C=Math.atan2(t.y-A.y,t.x-A.x),i=t.x-A.x,n=t.y-A.y,r=Math.sqrt(i*i+n*n),o=e.distanceToBorder(g,C),s=(r-o)/r;return{x:(1-s)*A.x+s*t.x,y:(1-s)*A.y+s*t.y,t:0}}_getDistanceToEdge(e,g,t,A,C,i){return this._getDistanceToLine(e,g,t,A,C,i)}},Og=class I{constructor(e,g,t,A,C){if(g===void 0)throw new Error("No body provided");this.options=xg(A),this.globalOptions=A,this.defaultOptions=C,this.body=g,this.imagelist=t,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 DI(this.body,this.options,!0),this.setOptions(e)}setOptions(e){if(!e)return;let g=typeof e.physics!="undefined"&&this.options.physics!==e.physics||typeof e.hidden!="undefined"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from!="undefined"&&this.options.from!==e.from||typeof e.to!="undefined"&&this.options.to!==e.to;I.parseOptions(this.options,e,!0,this.globalOptions),e.id!==void 0&&(this.id=e.id),e.from!==void 0&&(this.fromId=e.from),e.to!==void 0&&(this.toId=e.to),e.title!==void 0&&(this.title=e.title),e.value!==void 0&&(e.value=xh(e.value));let t=[e,this.options,this.defaultOptions];return this.chooser=kr("edge",t),this.updateLabelModule(e),g=this.updateEdgeType()||g,this._setInteractionWidths(),this.connect(),g}static parseOptions(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(xt(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],e,g,t),g.endPointOffset!==void 0&&g.endPointOffset.from!==void 0&&(Mg(g.endPointOffset.from)?e.endPointOffset.from=g.endPointOffset.from:(e.endPointOffset.from=A.endPointOffset.from!==void 0?A.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),g.endPointOffset!==void 0&&g.endPointOffset.to!==void 0&&(Mg(g.endPointOffset.to)?e.endPointOffset.to=g.endPointOffset.to:(e.endPointOffset.to=A.endPointOffset.to!==void 0?A.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),OI(g.label)?e.label=g.label:OI(e.label)||(e.label=void 0),De(e,g,"smooth",A),De(e,g,"shadow",A),De(e,g,"background",A),g.dashes!==void 0&&g.dashes!==null?e.dashes=g.dashes:t===!0&&g.dashes===null&&(e.dashes=Eg(A.dashes)),g.scaling!==void 0&&g.scaling!==null?(g.scaling.min!==void 0&&(e.scaling.min=g.scaling.min),g.scaling.max!==void 0&&(e.scaling.max=g.scaling.max),De(e.scaling,g.scaling,"label",A.scaling)):t===!0&&g.scaling===null&&(e.scaling=Eg(A.scaling)),g.arrows!==void 0&&g.arrows!==null)if(typeof g.arrows=="string"){let n=g.arrows.toLowerCase();e.arrows.to.enabled=G(n).call(n,"to")!=-1,e.arrows.middle.enabled=G(n).call(n,"middle")!=-1,e.arrows.from.enabled=G(n).call(n,"from")!=-1}else if(typeof g.arrows=="object")De(e.arrows,g.arrows,"to",A.arrows),De(e.arrows,g.arrows,"middle",A.arrows),De(e.arrows,g.arrows,"from",A.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+Et(g.arrows));else t===!0&&g.arrows===null&&(e.arrows=Eg(A.arrows));if(g.color!==void 0&&g.color!==null){let n=mg(g.color)?{color:g.color,highlight:g.color,hover:g.color,inherit:!1,opacity:1}:g.color,r=e.color;if(C)_(r,A.color,!1,t);else for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&delete r[o];if(mg(r))r.color=r,r.highlight=r,r.hover=r,r.inherit=!1,n.opacity===void 0&&(r.opacity=1);else{let o=!1;n.color!==void 0&&(r.color=n.color,o=!0),n.highlight!==void 0&&(r.highlight=n.highlight,o=!0),n.hover!==void 0&&(r.hover=n.hover,o=!0),n.inherit!==void 0&&(r.inherit=n.inherit),n.opacity!==void 0&&(r.opacity=Math.min(1,Math.max(0,n.opacity))),o===!0?r.inherit=!1:r.inherit===void 0&&(r.inherit="from")}}else t===!0&&g.color===null&&(e.color=xg(A.color));t===!0&&g.font===null&&(e.font=xg(A.font)),Object.prototype.hasOwnProperty.call(g,"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}"),e.selfReference.size=g.selfReferenceSize)}getFormattingValues(){let e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,g=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,t=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,A=this.options.color.inherit,C={toArrow:e,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:t,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:g,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:A?void 0:this.options.color.color,inheritsColor:A,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(this.chooser===!0){if(this.selected){let i=this.options.selectionWidth;typeof i=="function"?C.width=i(C.width):typeof i=="number"&&(C.width+=i),C.width=Math.max(C.width,.3/this.body.view.scale),C.color=this.options.color.highlight,C.shadow=this.options.shadow.enabled}else if(this.hover){let i=this.options.hoverWidth;typeof i=="function"?C.width=i(C.width):typeof i=="number"&&(C.width+=i),C.width=Math.max(C.width,.3/this.body.view.scale),C.color=this.options.color.hover,C.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(C,this.options.id,this.selected,this.hover),C.color!==void 0&&(C.inheritsColor=!1),C.shadow===!1&&(C.shadowColor!==this.options.shadow.color||C.shadowSize!==this.options.shadow.size||C.shadowX!==this.options.shadow.x||C.shadowY!==this.options.shadow.y)&&(C.shadow=!0));else C.shadow=this.options.shadow.enabled,C.width=Math.max(C.width,.3/this.body.view.scale);return C}updateLabelModule(e){let g=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,g),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){let e=this.options.smooth,g=!1,t=!0;return this.edgeType!==void 0&&((this.edgeType instanceof kI&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof FI&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof MI&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof BI&&e.type.enabled===!1)&&(t=!1),t===!0&&(g=this.cleanup())),t===!0?e.enabled===!0?e.type==="dynamic"?(g=!0,this.edgeType=new kI(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new FI(this.options,this.body,this.labelModule):this.edgeType=new MI(this.options,this.body,this.labelModule):this.edgeType=new BI(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),g}connect(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=this.from!==void 0&&this.to!==void 0,this.connected===!0?(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(e,g,t){if(this.options.value!==void 0){let A=this.options.scaling.customScalingFunction(e,g,t,this.options.value),C=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){let i=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+A*i}this.options.width=this.options.scaling.min+A*C}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}_setInteractionWidths(){typeof this.options.hoverWidth=="function"?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth=="function"?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}draw(e){let g=this.getFormattingValues();if(g.hidden)return;let t=this.edgeType.getViaNode();this.edgeType.drawLine(e,g,this.selected,this.hover,t),this.drawLabel(e,t)}drawArrows(e){let g=this.getFormattingValues();if(g.hidden)return;let t=this.edgeType.getViaNode(),A={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,g.fromArrow&&(A.from=this.edgeType.getArrowData(e,"from",t,this.selected,this.hover,g),g.arrowStrikethrough===!1&&(this.edgeType.fromPoint=A.from.core),g.fromArrowSrc&&(A.from.image=this.imagelist.load(g.fromArrowSrc)),g.fromArrowImageWidth&&(A.from.imageWidth=g.fromArrowImageWidth),g.fromArrowImageHeight&&(A.from.imageHeight=g.fromArrowImageHeight)),g.toArrow&&(A.to=this.edgeType.getArrowData(e,"to",t,this.selected,this.hover,g),g.arrowStrikethrough===!1&&(this.edgeType.toPoint=A.to.core),g.toArrowSrc&&(A.to.image=this.imagelist.load(g.toArrowSrc)),g.toArrowImageWidth&&(A.to.imageWidth=g.toArrowImageWidth),g.toArrowImageHeight&&(A.to.imageHeight=g.toArrowImageHeight)),g.middleArrow&&(A.middle=this.edgeType.getArrowData(e,"middle",t,this.selected,this.hover,g),g.middleArrowSrc&&(A.middle.image=this.imagelist.load(g.middleArrowSrc)),g.middleArrowImageWidth&&(A.middle.imageWidth=g.middleArrowImageWidth),g.middleArrowImageHeight&&(A.middle.imageHeight=g.middleArrowImageHeight)),g.fromArrow&&this.edgeType.drawArrowHead(e,g,this.selected,this.hover,A.from),g.middleArrow&&this.edgeType.drawArrowHead(e,g,this.selected,this.hover,A.middle),g.toArrow&&this.edgeType.drawArrowHead(e,g,this.selected,this.hover,A.to)}drawLabel(e,g){if(this.options.label!==void 0){let t=this.from,A=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);let C;if(t.id!=A.id){this.labelModule.pointToSelf=!1,C=this.edgeType.getPoint(.5,g),e.save();let i=this._getRotation(e);i.angle!=0&&(e.translate(i.x,i.y),e.rotate(i.angle)),this.labelModule.draw(e,C.x,C.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;let i=Oh(e,this.options.selfReference.angle,this.options.selfReference.size,t);C=this._pointOnCircle(i.x,i.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,C.x,C.y,this.selected,this.hover)}}}getItemsOnPoint(e){let g=[];if(this.labelModule.visible()){let A=this._getRotation();Ji(this.labelModule.getSize(),e,A)&&g.push({edgeId:this.id,labelId:0})}let t={left:e.x,top:e.y};return this.isOverlappingWith(t)&&g.push({edgeId:this.id}),g}isOverlappingWith(e){if(this.connected){let t=this.from.x,A=this.from.y,C=this.to.x,i=this.to.y,n=e.left,r=e.top;return this.edgeType.getDistanceToEdge(t,A,C,i,n,r)<10}else return!1}_getRotation(e){let g=this.edgeType.getViaNode(),t=this.edgeType.getPoint(.5,g);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,t.x,t.y);let A={x:t.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return A;let C=this.from.y-this.to.y,i=this.from.x-this.to.x,n=Math.atan2(C,i);return(n<-1&&i<0||n>0&&i<0)&&(n+=Math.PI),A.angle=n,A}_pointOnCircle(e,g,t,A){return{x:e+t*Math.cos(A),y:g-t*Math.sin(A)}}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 this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}},En=class{constructor(e,g,t){var A;this.body=e,this.images=g,this.groups=t,this.body.functions.createEdge=b(A=this.create).call(A,this),this.edgesListeners={add:(C,i)=>{this.add(i.items)},update:(C,i)=>{this.update(i.items)},remove:(C,i)=>{this.remove(i.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(C,i,n,r){if(i===C)return .5;{let o=1/(i-C);return Math.max(0,(r-C)*o)}}},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},_(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e=this,g,t;this.body.emitter.on("_forceDisableDynamicCurves",function(A){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;A==="dynamic"&&(A="continuous");let i=!1;for(let n in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,n)){let r=e.body.edges[n],o=e.body.data.edges.get(n);if(o!=null){let s=o.smooth;s!==void 0&&s.enabled===!0&&s.type==="dynamic"&&(A===void 0?r.setOptions({smooth:!1}):r.setOptions({smooth:{type:A}}),i=!0)}}C===!0&&i===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",()=>{this.reconnectEdges()}),this.body.emitter.on("refreshEdges",b(g=this.refresh).call(g,this)),this.body.emitter.on("refresh",b(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",()=>{S(this.edgesListeners,(A,C)=>{this.body.data.edges&&this.body.data.edges.off(C,A)}),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners})}setOptions(e){if(e!==void 0){Og.parseOptions(this.options,e,!0,this.defaultOptions,!0);let g=!1;if(e.smooth!==void 0)for(let t in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,t)&&(g=this.body.edges[t].updateEdgeType()||g);if(e.font!==void 0)for(let t in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,t)&&this.body.edges[t].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||g===!0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.data.edges;if(Eh("id",e))this.body.data.edges=e;else if(B(e))this.body.data.edges=new rg,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new rg;else throw new TypeError("Array or DataSet expected");if(t&&S(this.edgesListeners,(A,C)=>{t.off(C,A)}),this.body.edges={},this.body.data.edges){S(this.edgesListeners,(C,i)=>{this.body.data.edges.on(i,C)});let A=this.body.data.edges.getIds();this.add(A,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),g===!1&&this.body.emitter.emit("_dataChanged")}add(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.edges,A=this.body.data.edges;for(let C=0;C<e.length;C++){let i=e[C],n=t[i];n&&n.disconnect();let r=A.get(i,{showInternalIds:!0});t[i]=this.create(r)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),g===!1&&this.body.emitter.emit("_dataChanged")}update(e){let g=this.body.edges,t=this.body.data.edges,A=!1;for(let C=0;C<e.length;C++){let i=e[C],n=t.get(i),r=g[i];r!==void 0?(r.disconnect(),A=r.setOptions(n)||A,r.connect()):(this.body.edges[i]=this.create(n),A=!0)}A===!0?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}remove(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length===0)return;let t=this.body.edges;S(e,A=>{let C=t[A];C!==void 0&&C.remove()}),g&&this.body.emitter.emit("_dataChanged")}refresh(){S(this.body.edges,(e,g)=>{let t=this.body.data.edges.get(g);t!==void 0&&e.setOptions(t)})}create(e){return new Og(e,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let e,g=this.body.nodes,t=this.body.edges;for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(g[e].edges=[]);for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let A=t[e];A.from=null,A.to=null,A.connect()}}getConnectedNodes(e){let g=[];if(this.body.edges[e]!==void 0){let t=this.body.edges[e];t.fromId!==void 0&&g.push(t.fromId),t.toId!==void 0&&g.push(t.toId)}return g}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){let e=[];S(this.body.edges,(g,t)=>{let A=this.body.nodes[g.toId],C=this.body.nodes[g.fromId];A!==void 0&&A.isCluster===!0||C!==void 0&&C.isCluster===!0||(A===void 0||C===void 0)&&e.push(t)}),this.remove(e,!1)}_addMissingEdges(){let e=this.body.data.edges;if(e==null)return;let g=this.body.edges,t=[];F(e).call(e,(A,C)=>{g[C]===void 0&&t.push(C)}),this.add(t,!0)}},zI=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.barnesHutTree,this.setOptions(t),this._rng=iC("BARNES HUT SOLVER")}setOptions(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}solve(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){let e,g=this.body.nodes,t=this.physicsBody.physicsNodeIndices,A=t.length,C=this._formBarnesHutTree(g,t);this.barnesHutTree=C;for(let i=0;i<A;i++)e=g[t[i]],e.options.mass>0&&this._getForceContributions(C.root,e)}}_getForceContributions(e,g){this._getForceContribution(e.children.NW,g),this._getForceContribution(e.children.NE,g),this._getForceContribution(e.children.SW,g),this._getForceContribution(e.children.SE,g)}_getForceContribution(e,g){if(e.childrenCount>0){let t=e.centerOfMass.x-g.x,A=e.centerOfMass.y-g.y,C=Math.sqrt(t*t+A*A);C*e.calcSize>this.thetaInversed?this._calculateForces(C,t,A,g,e):e.childrenCount===4?this._getForceContributions(e,g):e.children.data.id!=g.id&&this._calculateForces(C,t,A,g,e)}}_calculateForces(e,g,t,A,C){e===0&&(e=.1,g=e),this.overlapAvoidanceFactor<1&&A.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*A.shape.radius,e-A.shape.radius));let i=this.options.gravitationalConstant*C.mass*A.options.mass/Math.pow(e,3),n=g*i,r=t*i;this.physicsBody.forces[A.id].x+=n,this.physicsBody.forces[A.id].y+=r}_formBarnesHutTree(e,g){let t,A=g.length,C=e[g[0]].x,i=e[g[0]].y,n=e[g[0]].x,r=e[g[0]].y;for(let p=1;p<A;p++){let u=e[g[p]],m=u.x,E=u.y;u.options.mass>0&&(m<C&&(C=m),m>n&&(n=m),E<i&&(i=E),E>r&&(r=E))}let o=Math.abs(n-C)-Math.abs(r-i);o>0?(i-=.5*o,r+=.5*o):(C+=.5*o,n-=.5*o);let a=Math.max(1e-5,Math.abs(n-C)),d=.5*a,l=.5*(C+n),h=.5*(i+r),c={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:l-d,maxX:l+d,minY:h-d,maxY:h+d},size:a,calcSize:1/a,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(c.root);for(let p=0;p<A;p++)t=e[g[p]],t.options.mass>0&&this._placeInTree(c.root,t);return c}_updateBranchMass(e,g){let t=e.centerOfMass,A=e.mass+g.options.mass,C=1/A;t.x=t.x*e.mass+g.x*g.options.mass,t.x*=C,t.y=t.y*e.mass+g.y*g.options.mass,t.y*=C,e.mass=A;let i=Math.max(Math.max(g.height,g.radius),g.width);e.maxWidth=e.maxWidth<i?i:e.maxWidth}_placeInTree(e,g,t){(t!=!0||t===void 0)&&this._updateBranchMass(e,g);let A=e.children.NW.range,C;A.maxX>g.x?A.maxY>g.y?C="NW":C="SW":A.maxY>g.y?C="NE":C="SE",this._placeInRegion(e,g,C)}_placeInRegion(e,g,t){let A=e.children[t];switch(A.childrenCount){case 0:A.children.data=g,A.childrenCount=1,this._updateBranchMass(A,g);break;case 1:A.children.data.x===g.x&&A.children.data.y===g.y?(g.x+=this._rng(),g.y+=this._rng()):(this._splitBranch(A),this._placeInTree(A,g));break;case 4:this._placeInTree(A,g);break}}_splitBranch(e){let g=null;e.childrenCount===1&&(g=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),g!=null&&this._placeInTree(e,g)}_insertRegion(e,g){let t,A,C,i,n=.5*e.size;switch(g){case"NW":t=e.range.minX,A=e.range.minX+n,C=e.range.minY,i=e.range.minY+n;break;case"NE":t=e.range.minX+n,A=e.range.maxX,C=e.range.minY,i=e.range.minY+n;break;case"SW":t=e.range.minX,A=e.range.minX+n,C=e.range.minY+n,i=e.range.maxY;break;case"SE":t=e.range.minX+n,A=e.range.maxX,C=e.range.minY+n,i=e.range.maxY;break}e.children[g]={centerOfMass:{x:0,y:0},mass:0,range:{minX:t,maxX:A,minY:C,maxY:i},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}_debug(e,g){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,g))}_drawBranch(e,g,t){t===void 0&&(t="#FF0000"),e.childrenCount===4&&(this._drawBranch(e.children.NW,g),this._drawBranch(e.children.NE,g),this._drawBranch(e.children.SE,g),this._drawBranch(e.children.SW,g)),g.strokeStyle=t,g.beginPath(),g.moveTo(e.range.minX,e.range.minY),g.lineTo(e.range.maxX,e.range.minY),g.stroke(),g.beginPath(),g.moveTo(e.range.maxX,e.range.minY),g.lineTo(e.range.maxX,e.range.maxY),g.stroke(),g.beginPath(),g.moveTo(e.range.maxX,e.range.maxY),g.lineTo(e.range.minX,e.range.maxY),g.stroke(),g.beginPath(),g.moveTo(e.range.minX,e.range.maxY),g.lineTo(e.range.minX,e.range.minY),g.stroke()}},Tn=class{constructor(e,g,t){this._rng=iC("REPULSION SOLVER"),this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e}solve(){let e,g,t,A,C,i,n,r,o=this.body.nodes,s=this.physicsBody.physicsNodeIndices,a=this.physicsBody.forces,d=this.options.nodeDistance,l=-2/3/d,h=4/3;for(let c=0;c<s.length-1;c++){n=o[s[c]];for(let p=c+1;p<s.length;p++)r=o[s[p]],e=r.x-n.x,g=r.y-n.y,t=Math.sqrt(e*e+g*g),t===0&&(t=.1*this._rng(),e=t),t<2*d&&(t<.5*d?i=1:i=l*t+h,i=i/t,A=e*i,C=g*i,a[n.id].x-=A,a[n.id].y-=C,a[r.id].x+=A,a[r.id].y+=C)}}},xn=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}solve(){let e=this.body.nodes,g=this.physicsBody.physicsNodeIndices,t=this.physicsBody.forces,A=this.options.nodeDistance;for(let C=0;C<g.length-1;C++){let i=e[g[C]];for(let n=C+1;n<g.length;n++){let r=e[g[n]];if(i.level===r.level){let o=A+this.overlapAvoidanceFactor*((i.shape.radius||0)/2+(r.shape.radius||0)/2),s=r.x-i.x,a=r.y-i.y,d=Math.sqrt(s*s+a*a),l=.05,h;d<o?h=-Math.pow(l*d,2)+Math.pow(l*o,2):h=0,d!==0&&(h=h/d);let c=s*h,p=a*h;t[i.id].x-=c,t[i.id].y-=p,t[r.id].x+=c,t[r.id].y+=p}}}}},jt=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e}solve(){let e,g,t=this.physicsBody.physicsEdgeIndices,A=this.body.edges,C,i,n;for(let r=0;r<t.length;r++)g=A[t[r]],g.connected===!0&&g.toId!==g.fromId&&this.body.nodes[g.toId]!==void 0&&this.body.nodes[g.fromId]!==void 0&&(g.edgeType.via!==void 0?(e=g.options.length===void 0?this.options.springLength:g.options.length,C=g.to,i=g.edgeType.via,n=g.from,this._calculateSpringForce(C,i,.5*e),this._calculateSpringForce(i,n,.5*e)):(e=g.options.length===void 0?this.options.springLength*1.5:g.options.length,this._calculateSpringForce(g.from,g.to,e)))}_calculateSpringForce(e,g,t){let A=e.x-g.x,C=e.y-g.y,i=Math.max(Math.sqrt(A*A+C*C),.01),n=this.options.springConstant*(t-i)/i,r=A*n,o=C*n;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=r,this.physicsBody.forces[e.id].y+=o),this.physicsBody.forces[g.id]!==void 0&&(this.physicsBody.forces[g.id].x-=r,this.physicsBody.forces[g.id].y-=o)}},On=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e}solve(){let e,g,t,A,C,i,n,r,o=this.body.edges,s=.5,a=this.physicsBody.physicsEdgeIndices,d=this.physicsBody.physicsNodeIndices,l=this.physicsBody.forces;for(let w=0;w<d.length;w++){let O=d[w];l[O].springFx=0,l[O].springFy=0}for(let w=0;w<a.length;w++)g=o[a[w]],g.connected===!0&&(e=g.options.length===void 0?this.options.springLength:g.options.length,t=g.from.x-g.to.x,A=g.from.y-g.to.y,r=Math.sqrt(t*t+A*A),r=r===0?.01:r,n=this.options.springConstant*(e-r)/r,C=t*n,i=A*n,g.to.level!=g.from.level?(l[g.toId]!==void 0&&(l[g.toId].springFx-=C,l[g.toId].springFy-=i),l[g.fromId]!==void 0&&(l[g.fromId].springFx+=C,l[g.fromId].springFy+=i)):(l[g.toId]!==void 0&&(l[g.toId].x-=s*C,l[g.toId].y-=s*i),l[g.fromId]!==void 0&&(l[g.fromId].x+=s*C,l[g.fromId].y+=s*i)));n=1;let h,c;for(let w=0;w<d.length;w++){let O=d[w];h=Math.min(n,Math.max(-n,l[O].springFx)),c=Math.min(n,Math.max(-n,l[O].springFy)),l[O].x+=h,l[O].y+=c}let p=0,u=0;for(let w=0;w<d.length;w++){let O=d[w];p+=l[O].x,u+=l[O].y}let m=p/d.length,E=u/d.length;for(let w=0;w<d.length;w++){let O=d[w];l[O].x-=m,l[O].y-=E}}},st=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e}solve(){let e,g,t,A,C=this.body.nodes,i=this.physicsBody.physicsNodeIndices,n=this.physicsBody.forces;for(let r=0;r<i.length;r++){let o=i[r];A=C[o],e=-A.x,g=-A.y,t=Math.sqrt(e*e+g*g),this._calculateForces(t,e,g,n,A)}}_calculateForces(e,g,t,A,C){let i=e===0?0:this.options.centralGravity/e;A[C.id].x=g*i,A[C.id].y=t*i}},Pn=class extends zI{constructor(e,g,t){super(e,g,t),this._rng=iC("FORCE ATLAS 2 BASED REPULSION SOLVER")}_calculateForces(e,g,t,A,C){e===0&&(e=.1*this._rng(),g=e),this.overlapAvoidanceFactor<1&&A.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*A.shape.radius,e-A.shape.radius));let i=A.edges.length+1,n=this.options.gravitationalConstant*C.mass*A.options.mass*i/Math.pow(e,2),r=g*n,o=t*n;this.physicsBody.forces[A.id].x+=r,this.physicsBody.forces[A.id].y+=o}},Dn=class extends st{constructor(e,g,t){super(e,g,t)}_calculateForces(e,g,t,A,C){if(e>0){let i=C.edges.length+1,n=this.options.centralGravity*i*C.options.mass;A[C.id].x=g*n,A[C.id].y=t*n}}},Nn=class{constructor(e){this.body=e,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}},q(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),this.ready===!0&&this.startSimulation()}),this.body.emitter.on("startSimulation",()=>{this.ready===!0&&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(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,bI(["stabilization"],this.options,e),De(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());let g=this.options.wind;g&&((typeof g.x!="number"||Ui(g.x))&&(g.x=0),(typeof g.y!="number"||Ui(g.y))&&(g.y=0)),this.timestep=this.options.timestep}this.init()}init(){let e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new Pn(this.body,this.physicsBody,e),this.edgesSolver=new jt(this.body,this.physicsBody,e),this.gravitySolver=new Dn(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new Tn(this.body,this.physicsBody,e),this.edgesSolver=new jt(this.body,this.physicsBody,e),this.gravitySolver=new st(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new xn(this.body,this.physicsBody,e),this.edgesSolver=new On(this.body,this.physicsBody,e),this.gravitySolver=new st(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new zI(this.body,this.physicsBody,e),this.edgesSolver=new jt(this.body,this.physicsBody,e),this.gravitySolver=new st(this.body,this.physicsBody,e)),this.modelOptions=e}initPhysics(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?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(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),this.viewFunction===void 0){var e;this.viewFunction=b(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}stopSimulation(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}simulationStep(){let e=uI();this.physicsTick(),(uI()-e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}_emitStabilized(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&He(()=>{this.body.emitter.emit("stabilized",{iterations:e}),this.startedStabilization=!1,this.stabilizationIterations=0},0)}physicsStep(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}adjustTimeStep(){this._evaluateStepQuality()===!0?this.timestep=1.2*this.timestep:this.timestep/1.2<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/1.2))}physicsTick(){this._startStabilizing(),this.stabilized!==!0&&(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0?(this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.physicsStep(),this.revert(),this.timestep=.5*this.timestep,this.physicsStep(),this.physicsStep(),this.adjustTimeStep()):this.physicsStep(),this.adaptiveCounter+=1):(this.timestep=this.options.timestep,this.physicsStep()),this.stabilized===!0&&this.revert(),this.stabilizationIterations++)}updatePhysicsData(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];let e=this.body.nodes,g=this.body.edges;for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&e[t].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[t].id);for(let t in g)Object.prototype.hasOwnProperty.call(g,t)&&g[t].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(g[t].id);for(let t=0;t<this.physicsBody.physicsNodeIndices.length;t++){let A=this.physicsBody.physicsNodeIndices[t];this.physicsBody.forces[A]={x:0,y:0},this.physicsBody.velocities[A]===void 0&&(this.physicsBody.velocities[A]={x:0,y:0})}for(let t in this.physicsBody.velocities)e[t]===void 0&&delete this.physicsBody.velocities[t]}revert(){let e=U(this.previousStates),g=this.body.nodes,t=this.physicsBody.velocities;this.referenceState={};for(let A=0;A<e.length;A++){let C=e[A];g[C]!==void 0?g[C].options.physics===!0&&(this.referenceState[C]={positions:{x:g[C].x,y:g[C].y}},t[C].x=this.previousStates[C].vx,t[C].y=this.previousStates[C].vy,g[C].x=this.previousStates[C].x,g[C].y=this.previousStates[C].y):delete this.previousStates[C]}}_evaluateStepQuality(){let e,g,t,A=this.body.nodes,C=this.referenceState,i=.3;for(let n in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,n)&&A[n]!==void 0&&(e=A[n].x-C[n].positions.x,g=A[n].y-C[n].positions.y,t=Math.sqrt(Math.pow(e,2)+Math.pow(g,2)),t>i))return!1;return!0}moveNodes(){let e=this.physicsBody.physicsNodeIndices,g=0,t=0,A=5;for(let C=0;C<e.length;C++){let i=e[C],n=this._performStep(i);g=Math.max(g,n),t+=n}this.adaptiveTimestepEnabled=t/e.length<A,this.stabilized=g<this.options.minVelocity}calculateComponentVelocity(e,g,t){let A=this.modelOptions.damping*e,C=(g-A)/t;e+=C*this.timestep;let i=this.options.maxVelocity||1e9;return Math.abs(e)>i&&(e=e>0?i:-i),e}_performStep(e){let g=this.body.nodes[e],t=this.physicsBody.forces[e];this.options.wind&&(t.x+=this.options.wind.x,t.y+=this.options.wind.y);let A=this.physicsBody.velocities[e];return this.previousStates[e]={x:g.x,y:g.y,vx:A.x,vy:A.y},g.options.fixed.x===!1?(A.x=this.calculateComponentVelocity(A.x,t.x,g.options.mass),g.x+=A.x*this.timestep):(t.x=0,A.x=0),g.options.fixed.y===!1?(A.y=this.calculateComponentVelocity(A.y,t.y,g.options.mass),g.y+=A.y*this.timestep):(t.y=0,A.y=0),Math.sqrt(Math.pow(A.x,2)+Math.pow(A.y,2))}_freezeNodes(){let e=this.body.nodes;for(let g in e)if(Object.prototype.hasOwnProperty.call(e,g)&&e[g].x&&e[g].y){let t=e[g].options.fixed;this.freezeCache[g]={x:t.x,y:t.y},t.x=!0,t.y=!0}}_restoreFrozenNodes(){let e=this.body.nodes;for(let g in e)Object.prototype.hasOwnProperty.call(e,g)&&this.freezeCache[g]!==void 0&&(e[g].options.fixed.x=this.freezeCache[g].x,e[g].options.fixed.y=this.freezeCache[g].y);this.freezeCache={}}stabilize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof e!="number"&&(e=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",e)),this.physicsBody.physicsNodeIndices.length===0){this.ready=!0;return}this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,He(()=>this._stabilizationBatch(),0)}_startStabilizing(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){let e=()=>this.stabilized===!1&&this.stabilizationIterations<this.targetIterations,g=()=>{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&g();let t=0;for(;e()&&t<this.options.stabilization.updateInterval;)this.physicsTick(),t++;if(g(),e()){var A;He(b(A=this._stabilizationBatch).call(A,this),0)}else this._finalizeStabilization()}_finalizeStabilization(){this.body.emitter.emit("_allowRedraw"),this.options.stabilization.fit===!0&&this.body.emitter.emit("fit"),this.options.stabilization.onlyDynamicEdges===!0&&this._restoreFrozenNodes(),this.body.emitter.emit("stabilizationIterationsDone"),this.body.emitter.emit("_requestRedraw"),this.stabilized===!0?this._emitStabilized():this.startSimulation(),this.ready=!0}_drawForces(e){for(let g=0;g<this.physicsBody.physicsNodeIndices.length;g++){let t=this.physicsBody.physicsNodeIndices[g],A=this.body.nodes[t],C=this.physicsBody.forces[t],i=20,n=.03,r=Math.sqrt(Math.pow(C.x,2)+Math.pow(C.x,2)),o=Math.min(Math.max(5,r),15),s=3*o,a=Vi((180-Math.min(1,Math.max(0,n*r))*180)/360,1,1),d={x:A.x+i*C.x,y:A.y+i*C.y};e.lineWidth=o,e.strokeStyle=a,e.beginPath(),e.moveTo(A.x,A.y),e.lineTo(d.x,d.y),e.stroke();let l=Math.atan2(C.y,C.x);e.fillStyle=a,RI.draw(e,{type:"arrow",point:d,angle:l,length:s}),EA(e).call(e)}}},de=class{constructor(){}static getRange(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=1e9,A=-1e9,C=1e9,i=-1e9,n;if(g.length>0)for(let r=0;r<g.length;r++)n=e[g[r]],C>n.shape.boundingBox.left&&(C=n.shape.boundingBox.left),i<n.shape.boundingBox.right&&(i=n.shape.boundingBox.right),t>n.shape.boundingBox.top&&(t=n.shape.boundingBox.top),A<n.shape.boundingBox.bottom&&(A=n.shape.boundingBox.bottom);return C===1e9&&i===-1e9&&t===1e9&&A===-1e9&&(t=0,A=0,C=0,i=0),{minX:C,maxX:i,minY:t,maxY:A}}static getRangeCore(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=1e9,A=-1e9,C=1e9,i=-1e9,n;if(g.length>0)for(let r=0;r<g.length;r++)n=e[g[r]],C>n.x&&(C=n.x),i<n.x&&(i=n.x),t>n.y&&(t=n.y),A<n.y&&(A=n.y);return C===1e9&&i===-1e9&&t===1e9&&A===-1e9&&(t=0,A=0,C=0,i=0),{minX:C,maxX:i,minY:t,maxY:A}}static findCenter(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}static cloneOptions(e,g){let t={};return g===void 0||g==="node"?(_(t,e.options,!0),t.x=e.x,t.y=e.y,t.amountOfConnections=e.edges.length):_(t,e.options,!0),t}},Rn=class extends pe{constructor(e,g,t,A,C,i){super(e,g,t,A,C,i),this.isCluster=!0,this.containedNodes={},this.containedEdges={}}_openChildCluster(e){let g=this.body.nodes[e];if(this.containedNodes[e]===void 0)throw new Error("node with id: "+e+" not in current cluster");if(!g.isCluster)throw new Error("node with id: "+e+" is not a cluster");delete this.containedNodes[e],S(g.edges,t=>{delete this.containedEdges[t.id]}),S(g.containedNodes,(t,A)=>{this.containedNodes[A]=t}),g.containedNodes={},S(g.containedEdges,(t,A)=>{this.containedEdges[A]=t}),g.containedEdges={},S(g.edges,t=>{S(this.edges,A=>{var C,i;let n=G(C=A.clusteringEdgeReplacingIds).call(C,t.id);n!==-1&&(S(t.clusteringEdgeReplacingIds,r=>{A.clusteringEdgeReplacingIds.push(r),this.body.edges[r].edgeReplacedById=A.id}),Ue(i=A.clusteringEdgeReplacingIds).call(i,n,1))})}),g.edges=[]}},Sn=class{constructor(e){this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},q(this.options,this.defaultOptions),this.body.emitter.on("_resetData",()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(e,g){e===void 0?e=this._getHubSize():typeof e=="object"&&(g=this._checkOptions(e),e=this._getHubSize());let t=[];for(let A=0;A<this.body.nodeIndices.length;A++){let C=this.body.nodes[this.body.nodeIndices[A]];C.edges.length>=e&&t.push(C.id)}for(let A=0;A<t.length;A++)this.clusterByConnection(t[A],g,!0);this.body.emitter.emit("_dataChanged")}cluster(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);let t={},A={};S(this.body.nodes,(C,i)=>{C.options&&e.joinCondition(C.options)===!0&&(t[i]=C,S(C.edges,n=>{this.clusteredEdges[n.id]===void 0&&(A[n.id]=n)}))}),this._cluster(t,A,e,g)}clusterByEdgeCount(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;g=this._checkOptions(g);let A=[],C={},i,n,r;for(let o=0;o<this.body.nodeIndices.length;o++){let s={},a={},d=this.body.nodeIndices[o],l=this.body.nodes[d];if(C[d]===void 0){r=0,n=[];for(let h=0;h<l.edges.length;h++)i=l.edges[h],this.clusteredEdges[i.id]===void 0&&(i.toId!==i.fromId&&r++,n.push(i));if(r===e){let h=function(p){if(g.joinCondition===void 0||g.joinCondition===null)return!0;let u=de.cloneOptions(p);return g.joinCondition(u)},c=!0;for(let p=0;p<n.length;p++){i=n[p];let u=this._getConnectedId(i,d);if(h(l))a[i.id]=i,s[d]=l,s[u]=this.body.nodes[u],C[d]=!0;else{c=!1;break}}if(U(s).length>0&&U(a).length>0&&c===!0){let u=function(){for(let m=0;m<A.length;++m)for(let E in s)if(A[m].nodes[E]!==void 0)return A[m]}();if(u!==void 0){for(let m in s)u.nodes[m]===void 0&&(u.nodes[m]=s[m]);for(let m in a)u.edges[m]===void 0&&(u.edges[m]=a[m])}else A.push({nodes:s,edges:a})}}}}for(let o=0;o<A.length;o++)this._cluster(A[o].nodes,A[o].edges,g,!1);t===!0&&this.body.emitter.emit("_dataChanged")}clusterOutliers(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,g)}clusterBridges(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,g)}clusterByConnection(e,g){var t;let A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No nodeId supplied to clusterByConnection!");if(this.body.nodes[e]===void 0)throw new Error("The nodeId given to clusterByConnection does not exist!");let C=this.body.nodes[e];g=this._checkOptions(g,C),g.clusterNodeProperties.x===void 0&&(g.clusterNodeProperties.x=C.x),g.clusterNodeProperties.y===void 0&&(g.clusterNodeProperties.y=C.y),g.clusterNodeProperties.fixed===void 0&&(g.clusterNodeProperties.fixed={},g.clusterNodeProperties.fixed.x=C.options.fixed.x,g.clusterNodeProperties.fixed.y=C.options.fixed.y);let i={},n={},r=C.id,o=de.cloneOptions(C);i[r]=C;for(let a=0;a<C.edges.length;a++){let d=C.edges[a];if(this.clusteredEdges[d.id]===void 0){let l=this._getConnectedId(d,r);if(this.clusteredNodes[l]===void 0)if(l!==r)if(g.joinCondition===void 0)n[d.id]=d,i[l]=this.body.nodes[l];else{let h=de.cloneOptions(this.body.nodes[l]);g.joinCondition(o,h)===!0&&(n[d.id]=d,i[l]=this.body.nodes[l])}else n[d.id]=d}}let s=ae(t=U(i)).call(t,function(a){return i[a].id});for(let a in i){if(!Object.prototype.hasOwnProperty.call(i,a))continue;let d=i[a];for(let l=0;l<d.edges.length;l++){let h=d.edges[l];G(s).call(s,this._getConnectedId(h,d.id))>-1&&(n[h.id]=h)}}this._cluster(i,n,g,A)}_createClusterEdges(e,g,t,A){let C,i,n,r,o,s,a=U(e),d=[];for(let c=0;c<a.length;c++){i=a[c],n=e[i];for(let p=0;p<n.edges.length;p++)C=n.edges[p],this.clusteredEdges[C.id]===void 0&&(C.toId==C.fromId?g[C.id]=C:C.toId==i?(r=t.id,o=C.fromId,s=o):(r=C.toId,o=t.id,s=r),e[s]===void 0&&d.push({edge:C,fromId:o,toId:r}))}let l=[],h=function(c){for(let p=0;p<l.length;p++){let u=l[p],m=c.fromId===u.fromId&&c.toId===u.toId,E=c.fromId===u.toId&&c.toId===u.fromId;if(m||E)return u}return null};for(let c=0;c<d.length;c++){let p=d[c],u=p.edge,m=h(p);m===null?(m=this._createClusteredEdge(p.fromId,p.toId,u,A),l.push(m)):m.clusteringEdgeReplacingIds.push(u.id),this.body.edges[u.id].edgeReplacedById=m.id,this._backupEdgeOptions(u),u.setOptions({physics:!1})}}_checkOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}_cluster(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,C=[];for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&this.clusteredNodes[s]!==void 0&&C.push(s);for(let s=0;s<C.length;++s)delete e[C[s]];if(U(e).length==0||U(e).length==1&&t.clusterNodeProperties.allowSingleNodeCluster!=!0)return;let i=_({},t.clusterNodeProperties);if(t.processProperties!==void 0){let s=[];for(let d in e)if(Object.prototype.hasOwnProperty.call(e,d)){let l=de.cloneOptions(e[d]);s.push(l)}let a=[];for(let d in g)if(Object.prototype.hasOwnProperty.call(g,d)&&d.substr(0,12)!=="clusterEdge:"){let l=de.cloneOptions(g[d],"edge");a.push(l)}if(i=t.processProperties(i,s,a),!i)throw new Error("The processProperties function does not return properties!")}i.id===void 0&&(i.id="cluster:"+ot());let n=i.id;i.label===void 0&&(i.label="cluster");let r;i.x===void 0&&(r=this._getClusterPosition(e),i.x=r.x),i.y===void 0&&(r===void 0&&(r=this._getClusterPosition(e)),i.y=r.y),i.id=n;let o=this.body.functions.createNode(i,Rn);o.containedNodes=e,o.containedEdges=g,o.clusterEdgeProperties=t.clusterEdgeProperties,this.body.nodes[i.id]=o,this._clusterEdges(e,g,i,t.clusterEdgeProperties),i.id=void 0,A===!0&&this.body.emitter.emit("_dataChanged")}_backupEdgeOptions(e){this.clusteredEdges[e.id]===void 0&&(this.clusteredEdges[e.id]={physics:e.options.physics})}_restoreEdge(e){let g=this.clusteredEdges[e.id];g!==void 0&&(e.setOptions({physics:g.physics}),delete this.clusteredEdges[e.id])}isCluster(e){return this.body.nodes[e]!==void 0?this.body.nodes[e].isCluster===!0:(console.error("Node does not exist."),!1)}_getClusterPosition(e){let g=U(e),t=e[g[0]].x,A=e[g[0]].x,C=e[g[0]].y,i=e[g[0]].y,n;for(let r=1;r<g.length;r++)n=e[g[r]],t=n.x<t?n.x:t,A=n.x>A?n.x:A,C=n.y<C?n.y:C,i=n.y>i?n.y:i;return{x:.5*(t+A),y:.5*(C+i)}}openCluster(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");let A=this.body.nodes[e];if(A===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(A.isCluster!==!0||A.containedNodes===void 0||A.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");let C=this.findNode(e),i=G(C).call(C,e)-1;if(i>=0){let s=C[i];this.body.nodes[s]._openChildCluster(e),delete this.body.nodes[e],t===!0&&this.body.emitter.emit("_dataChanged");return}let n=A.containedNodes,r=A.containedEdges;if(g!==void 0&&g.releaseFunction!==void 0&&typeof g.releaseFunction=="function"){let s={},a={x:A.x,y:A.y};for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){let h=this.body.nodes[l];s[l]={x:h.x,y:h.y}}let d=g.releaseFunction(a,s);for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){let h=this.body.nodes[l];d[l]!==void 0&&(h.x=d[l].x===void 0?A.x:d[l].x,h.y=d[l].y===void 0?A.y:d[l].y)}}else S(n,function(s){s.options.fixed.x===!1&&(s.x=A.x),s.options.fixed.y===!1&&(s.y=A.y)});for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s)){let a=this.body.nodes[s];a.vx=A.vx,a.vy=A.vy,a.setOptions({physics:!0}),delete this.clusteredNodes[s]}let o=[];for(let s=0;s<A.edges.length;s++)o.push(A.edges[s]);for(let s=0;s<o.length;s++){let a=o[s],d=this._getConnectedId(a,e),l=this.clusteredNodes[d];for(let h=0;h<a.clusteringEdgeReplacingIds.length;h++){let c=a.clusteringEdgeReplacingIds[h],p=this.body.edges[c];if(p!==void 0)if(l!==void 0){let u=this.body.nodes[l.clusterId];u.containedEdges[p.id]=p,delete r[p.id];let m=p.fromId,E=p.toId;p.toId==d?E=l.clusterId:m=l.clusterId,this._createClusteredEdge(m,E,p,u.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(p)}a.remove()}for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&this._restoreEdge(r[s]);delete this.body.nodes[e],t===!0&&this.body.emitter.emit("_dataChanged")}getNodesInCluster(e){let g=[];if(this.isCluster(e)===!0){let t=this.body.nodes[e].containedNodes;for(let A in t)Object.prototype.hasOwnProperty.call(t,A)&&g.push(this.body.nodes[A].id)}return g}findNode(e){let g=[],A=0,C;for(;this.clusteredNodes[e]!==void 0&&A<100;){if(C=this.body.nodes[e],C===void 0)return[];g.push(C.id),e=this.clusteredNodes[e].clusterId,A++}return C=this.body.nodes[e],C===void 0?[]:(g.push(C.id),zg(g).call(g),g)}updateClusteredNode(e,g){if(e===void 0)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(g===void 0)throw new Error("No newOptions supplied to updateClusteredNode.");if(this.body.nodes[e]===void 0)throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist.");this.body.nodes[e].setOptions(g),this.body.emitter.emit("_dataChanged")}updateEdge(e,g){if(e===void 0)throw new Error("No startEdgeId supplied to updateEdge.");if(g===void 0)throw new Error("No newOptions supplied to updateEdge.");if(this.body.edges[e]===void 0)throw new Error("The startEdgeId supplied to updateEdge does not exist.");let t=this.getClusteredEdges(e);for(let A=0;A<t.length;A++)this.body.edges[t[A]].setOptions(g);this.body.emitter.emit("_dataChanged")}getClusteredEdges(e){let g=[],A=0;for(;e!==void 0&&this.body.edges[e]!==void 0&&A<100;)g.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,A++;return zg(g).call(g),g}getBaseEdge(e){return this.getBaseEdges(e)[0]}getBaseEdges(e){let g=[e],t=[],A=[],C=100,i=0;for(;g.length>0&&i<C;){let n=g.pop();if(n===void 0)continue;let r=this.body.edges[n];if(r===void 0)continue;i++;let o=r.clusteringEdgeReplacingIds;if(o===void 0)A.push(n);else for(let s=0;s<o.length;++s){let a=o[s];G(g).call(g,o)!==-1||G(t).call(t,o)!==-1||g.push(a)}t.push(n)}return A}_getConnectedId(e,g){return e.toId!=g?e.toId:(e.fromId!=g,e.fromId)}_getHubSize(){let e=0,g=0,t=0,A=0;for(let r=0;r<this.body.nodeIndices.length;r++){let o=this.body.nodes[this.body.nodeIndices[r]];o.edges.length>A&&(A=o.edges.length),e+=o.edges.length,g+=Math.pow(o.edges.length,2),t+=1}e=e/t,g=g/t;let C=g-Math.pow(e,2),i=Math.sqrt(C),n=Math.floor(e+2*i);return n>A&&(n=A),n}_createClusteredEdge(e,g,t,A,C){let i=de.cloneOptions(t,"edge");_(i,A),i.from=e,i.to=g,i.id="clusterEdge:"+ot(),C!==void 0&&_(i,C);let n=this.body.functions.createEdge(i);return n.clusteringEdgeReplacingIds=[t.id],n.connect(),this.body.edges[n.id]=n,n}_clusterEdges(e,g,t,A){if(g instanceof Og){let C=g,i={};i[C.id]=C,g=i}if(e instanceof pe){let C=e,i={};i[C.id]=C,e=i}if(t==null)throw new Error("_clusterEdges: parameter clusterNode required");A===void 0&&(A=t.clusterEdgeProperties),this._createClusterEdges(e,g,t,A);for(let C in g)if(Object.prototype.hasOwnProperty.call(g,C)&&this.body.edges[C]!==void 0){let i=this.body.edges[C];this._backupEdgeOptions(i),i.setOptions({physics:!1})}for(let C in e)Object.prototype.hasOwnProperty.call(e,C)&&(this.clusteredNodes[C]={clusterId:t.id,node:this.body.nodes[C]},this.body.nodes[C].setOptions({physics:!1}))}_getClusterNodeForNode(e){if(e===void 0)return;let g=this.clusteredNodes[e];if(g===void 0)return;let t=g.clusterId;if(t!==void 0)return this.body.nodes[t]}_filter(e,g){let t=[];return S(e,A=>{g(A)&&t.push(A)}),t}_updateState(){let e,g=[],t={},A=r=>{S(this.body.nodes,o=>{o.isCluster===!0&&r(o)})};for(e in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,e))continue;this.body.nodes[e]===void 0&&g.push(e)}A(function(r){for(let o=0;o<g.length;o++)delete r.containedNodes[g[o]]});for(let r=0;r<g.length;r++)delete this.clusteredNodes[g[r]];S(this.clusteredEdges,r=>{let o=this.body.edges[r];(o===void 0||!o.endPointsValid())&&(t[r]=r)}),A(function(r){S(r.containedEdges,(o,s)=>{!o.endPointsValid()&&!t[s]&&(t[s]=s)})}),S(this.body.edges,(r,o)=>{let s=!0,a=r.clusteringEdgeReplacingIds;if(a!==void 0){let d=0;S(a,l=>{let h=this.body.edges[l];h!==void 0&&h.endPointsValid()&&(d+=1)}),s=d>0}(!r.endPointsValid()||!s)&&(t[o]=o)}),A(r=>{S(t,o=>{delete r.containedEdges[o],S(r.edges,(s,a)=>{if(s.id===o){r.edges[a]=null;return}s.clusteringEdgeReplacingIds=this._filter(s.clusteringEdgeReplacingIds,function(d){return!t[d]})}),r.edges=this._filter(r.edges,function(s){return s!==null})})}),S(t,r=>{delete this.clusteredEdges[r]}),S(t,r=>{delete this.body.edges[r]});let C=U(this.body.edges);S(C,r=>{let o=this.body.edges[r],s=this._isClusteredNode(o.fromId)||this._isClusteredNode(o.toId);if(s!==this._isClusteredEdge(o.id))if(s){let a=this._getClusterNodeForNode(o.fromId);a!==void 0&&this._clusterEdges(this.body.nodes[o.fromId],o,a);let d=this._getClusterNodeForNode(o.toId);d!==void 0&&this._clusterEdges(this.body.nodes[o.toId],o,d)}else delete this._clusterEdges[r],this._restoreEdge(o)});let i=!1,n=!0;for(;n;){let r=[];A(function(o){let s=U(o.containedNodes).length,a=o.options.allowSingleNodeCluster===!0;(a&&s<1||!a&&s<2)&&r.push(o.id)});for(let o=0;o<r.length;++o)this.openCluster(r[o],{},!1);n=r.length>0,i=i||n}i&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}},kn=class{constructor(e,g){this.body=e,this.canvas=g,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},q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;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=He(()=>{var g;this.zooming=!1,b(g=this._requestRedraw).call(g,this)()},250)}),this.body.emitter.on("_resizeNodes",()=>{this._resizeNodes()}),this.body.emitter.on("_redraw",()=>{this.renderingActive===!1&&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",b(e=this._requestRedraw).call(e,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(e){e!==void 0&&xt(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,e)}_startRendering(){if(this.renderingActive===!0&&this.requestAnimationFrameRequestId===void 0){var e;this.requestAnimationFrameRequestId=window.requestAnimationFrame(b(e=this._renderStep).call(e,this),this.simulationInterval)}}_renderStep(){this.renderingActive===!0&&(this.requestAnimationFrameRequestId=void 0,this._startRendering(),this._redraw())}redraw(){this.body.emitter.emit("setSize"),this._redraw()}_requestRedraw(){this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,window.requestAnimationFrame(()=>{this._redraw(!1)}))}_redraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;let g={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();let t=this.canvas.getContext(),A=this.canvas.frame.canvas.clientWidth,C=this.canvas.frame.canvas.clientHeight;if(t.clearRect(0,0,A,C),this.canvas.frame.clientWidth===0)return;if(t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale),t.beginPath(),this.body.emitter.emit("beforeDrawing",t),t.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(t),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){let{drawExternalLabels:i}=this._drawNodes(t,e);g.drawExternalLabels=i}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(t),g.drawExternalLabels!=null&&g.drawExternalLabels(),e===!1&&this._drawSelectionBox(t),t.beginPath(),this.body.emitter.emit("afterDrawing",t),t.closePath(),t.restore(),e===!0&&t.clearRect(0,0,A,C)}}_resizeNodes(){this.canvas.setTransform();let e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);let g=this.body.nodes,t;for(let A in g)Object.prototype.hasOwnProperty.call(g,A)&&(t=g[A],t.resize(e),t.updateBoundingBox(e,t.selected));e.restore()}_drawNodes(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.nodes,A=this.body.nodeIndices,C,i=[],n=[],r=20,o=this.canvas.DOMtoCanvas({x:-r,y:-r}),s=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+r,y:this.canvas.frame.canvas.clientHeight+r}),a={top:o.y,left:o.x,bottom:s.y,right:s.x},d=[];for(let p=0;p<A.length;p++)if(C=t[A[p]],C.hover)n.push(A[p]);else if(C.isSelected())i.push(A[p]);else if(g===!0){let u=C.draw(e);u.drawExternalLabel!=null&&d.push(u.drawExternalLabel)}else if(C.isBoundingBoxOverlappingWith(a)===!0){let u=C.draw(e);u.drawExternalLabel!=null&&d.push(u.drawExternalLabel)}else C.updateBoundingBox(e,C.selected);let l,h=i.length,c=n.length;for(l=0;l<h;l++){C=t[i[l]];let p=C.draw(e);p.drawExternalLabel!=null&&d.push(p.drawExternalLabel)}for(l=0;l<c;l++){C=t[n[l]];let p=C.draw(e);p.drawExternalLabel!=null&&d.push(p.drawExternalLabel)}return{drawExternalLabels:()=>{for(let p of d)p()}}}_drawEdges(e){let g=this.body.edges,t=this.body.edgeIndices;for(let A=0;A<t.length;A++){let C=g[t[A]];C.connected===!0&&C.draw(e)}}_drawArrows(e){let g=this.body.edges,t=this.body.edgeIndices;for(let A=0;A<t.length;A++){let C=g[t[A]];C.connected===!0&&C.drawArrows(e)}}_drawSelectionBox(e){if(this.body.selectionBox.show){e.beginPath();let g=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,t=this.body.selectionBox.position.end.y-this.body.selectionBox.position.start.y;e.rect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,g,t),e.fillStyle="rgba(151, 194, 252, 0.2)",e.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,g,t),e.strokeStyle="rgba(151, 194, 252, 1)",e.stroke()}else e.closePath()}},Yk=L,Wk=Yk.setInterval,_k=Wk,Kk=D(_k);function ZI(I,e){e.inputHandler=function(g){g.isFirst&&e(g)},I.on("hammer.input",e.inputHandler)}function Ph(I,e){return e.inputHandler=function(g){g.isFinal&&e(g)},I.on("hammer.input",e.inputHandler)}var Mn=class{constructor(e){this.body=e,this.pixelRatio=1,this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this._cleanupCallbacks=[],this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.once("resize",g=>{g.width!==0&&(this.body.view.translation.x=g.width*.5),g.height!==0&&(this.body.view.translation.y=g.height*.5)}),this.body.emitter.on("setSize",b(e=this.setSize).call(e,this)),this.body.emitter.on("destroy",()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()})}setOptions(e){if(e!==void 0&&xt(["width","height","autoResize"],this.options,e),this._cleanUp(),this.options.autoResize===!0){var g;if(window.ResizeObserver){let A=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")}),{frame:C}=this;A.observe(C),this._cleanupCallbacks.push(()=>{A.unobserve(C)})}else{let A=Kk(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(()=>{clearInterval(A)})}let t=b(g=this._onResize).call(g,this);window.addEventListener("resize",t),this._cleanupCallbacks.push(()=>{window.removeEventListener("resize",t)})}}_cleanUp(){var e,g,t;F(e=zg(g=Ue(t=this._cleanupCallbacks).call(t,0)).call(g)).call(e,A=>{try{A()}catch(C){console.error(C)}})}_onResize(){this.setSize(),this.body.emitter.emit("_redraw")}_getCameraState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}_setCameraState(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){let e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,g=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,t=this.cameraState.scale;e!=1&&g!=1?t=this.cameraState.scale*.5*(e+g):e!=1?t=this.cameraState.scale*e:g!=1&&(t=this.cameraState.scale*g),this.body.view.scale=t;let A=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),C={x:A.x-this.cameraState.position.x,y:A.y-this.cameraState.position.y};this.body.view.translation.x+=C.x*this.body.view.scale,this.body.view.translation.y+=C.y*this.body.view.scale}}_prepareValue(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(G(e).call(e,"%")!==-1||G(e).call(e,"px")!==-1)return e;if(G(e).call(e,"%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}_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{let e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}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(){this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new rt(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:rt.DIRECTION_ALL}),ZI(this.hammer,e=>{this.body.eventListeners.onTouch(e)}),this.hammer.on("tap",e=>{this.body.eventListeners.onTap(e)}),this.hammer.on("doubletap",e=>{this.body.eventListeners.onDoubleTap(e)}),this.hammer.on("press",e=>{this.body.eventListeners.onHold(e)}),this.hammer.on("panstart",e=>{this.body.eventListeners.onDragStart(e)}),this.hammer.on("panmove",e=>{this.body.eventListeners.onDrag(e)}),this.hammer.on("panend",e=>{this.body.eventListeners.onDragEnd(e)}),this.hammer.on("pinch",e=>{this.body.eventListeners.onPinch(e)}),this.frame.canvas.addEventListener("wheel",e=>{this.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("mousemove",e=>{this.body.eventListeners.onMouseMove(e)}),this.frame.canvas.addEventListener("contextmenu",e=>{this.body.eventListeners.onContext(e)}),this.hammerFrame=new rt(this.frame),Ph(this.hammerFrame,e=>{this.body.eventListeners.onRelease(e)})}setSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),g=this._prepareValue(g);let t=!1,A=this.frame.canvas.width,C=this.frame.canvas.height,i=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||g!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=g)this._getCameraState(i),this.frame.style.width=e,this.frame.style.height=g,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=e,this.options.height=g,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},t=!0;else{let n=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),r=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==n||this.frame.canvas.height!==r)&&this._getCameraState(i),this.frame.canvas.width!==n&&(this.frame.canvas.width=n,t=!0),this.frame.canvas.height!==r&&(this.frame.canvas.height=r,t=!0)}return t===!0&&(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(A/this.pixelRatio),oldHeight:Math.round(C/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,t}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){let e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");let g=1;typeof window!="undefined"&&(g=window.devicePixelRatio||1);let t=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return g/t}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){let e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}_XconvertDOMtoCanvas(e){return(e-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(e){return(e-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.y}canvasToDOM(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}DOMtoCanvas(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}};function Uk(I,e){let g=q({nodes:e,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},I!=null?I:{});if(!B(g.nodes))throw new TypeError("Nodes has to be an array of ids.");if(g.nodes.length===0&&(g.nodes=e),!(typeof g.minZoomLevel=="number"&&g.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof g.maxZoomLevel=="number"&&g.minZoomLevel<=g.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return g}var Fn=class{constructor(e,g){var t,A;this.body=e,this.canvas=g,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",b(t=this.fit).call(t,this)),this.body.emitter.on("animationFinished",()=>{this.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",b(A=this.releaseNode).call(A,this))}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}fit(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=Uk(e,this.body.nodeIndices);let t=this.canvas.frame.canvas.clientWidth,A=this.canvas.frame.canvas.clientHeight,C,i;if(t===0||A===0)i=1,C=de.getRange(this.body.nodes,e.nodes);else if(g===!0){let o=0;for(let d in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,d)&&this.body.nodes[d].predefinedPosition===!0&&(o+=1);if(o>.5*this.body.nodeIndices.length){this.fit(e,!1);return}C=de.getRange(this.body.nodes,e.nodes),i=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;let a=Math.min(t/600,A/600);i*=a}else{this.body.emitter.emit("_resizeNodes"),C=de.getRange(this.body.nodes,e.nodes);let o=Math.abs(C.maxX-C.minX)*1.1,s=Math.abs(C.maxY-C.minY)*1.1,a=t/o,d=A/s;i=a<=d?a:d}i>e.maxZoomLevel?i=e.maxZoomLevel:i<e.minZoomLevel&&(i=e.minZoomLevel);let r={position:de.findCenter(C),scale:i,animation:e.animation};this.moveTo(r)}focus(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){let t={x:this.body.nodes[e].x,y:this.body.nodes[e].y};g.position=t,g.lockedOnNode=e,this.moveTo(g)}else console.error("Node: "+e+" cannot be found.")}moveTo(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!Mg(e.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!Mg(e.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!Mg(e.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!Mg(e.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}animateView(e){if(e===void 0)return;this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;let g=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),t={x:g.x-e.position.x,y:g.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+t.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+t.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var A;this.viewFunction=b(A=this._lockedRedraw).call(A,this),this.body.emitter.on("initRedraw",this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else{var C;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=b(C=this._transitionRedraw).call(C,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}_lockedRedraw(){let e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},g=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),t={x:g.x-e.x,y:g.y-e.y},A=this.body.view.translation,C={x:A.x+t.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:A.y+t.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=C}releaseNode(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}_transitionRedraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;let g=KO[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*g,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*g,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*g},this.easingTime>=1){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var t;this.viewFunction=b(t=this._lockedRedraw).call(t,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})}},Hk=`div.vis-network div.vis-navigation div.vis-button {
654
654
  width: 34px;
655
655
  height: 34px;
656
656
  -moz-border-radius: 17px;
@@ -711,7 +711,7 @@ div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends {
711
711
  bottom: 50px;
712
712
  right: 15px;
713
713
  }
714
- `;_g(Hk);function Ea(I){var e=I&&I.preventDefault||!1,g=I&&I.container||window,t={},A={keydown:{},keyup:{}},C={},i;for(i=97;i<=122;i++)C[String.fromCharCode(i)]={code:65+(i-97),shift:!1};for(i=65;i<=90;i++)C[String.fromCharCode(i)]={code:i,shift:!0};for(i=0;i<=9;i++)C[""+i]={code:48+i,shift:!1};for(i=1;i<=12;i++)C["F"+i]={code:111+i,shift:!1};for(i=0;i<=9;i++)C["num"+i]={code:96+i,shift:!1};C["num*"]={code:106,shift:!1},C["num+"]={code:107,shift:!1},C["num-"]={code:109,shift:!1},C["num/"]={code:111,shift:!1},C["num."]={code:110,shift:!1},C.left={code:37,shift:!1},C.up={code:38,shift:!1},C.right={code:39,shift:!1},C.down={code:40,shift:!1},C.space={code:32,shift:!1},C.enter={code:13,shift:!1},C.shift={code:16,shift:void 0},C.esc={code:27,shift:!1},C.backspace={code:8,shift:!1},C.tab={code:9,shift:!1},C.ctrl={code:17,shift:!1},C.alt={code:18,shift:!1},C.delete={code:46,shift:!1},C.pageup={code:33,shift:!1},C.pagedown={code:34,shift:!1},C["="]={code:187,shift:!1},C["-"]={code:189,shift:!1},C["]"]={code:221,shift:!1},C["["]={code:219,shift:!1};var n=function(r){s(r,"keydown")},o=function(r){s(r,"keyup")},s=function(r,a){if(A[a][r.keyCode]!==void 0){for(var d=A[a][r.keyCode],l=0;l<d.length;l++)(d[l].shift===void 0||d[l].shift==!0&&r.shiftKey==!0||d[l].shift==!1&&r.shiftKey==!1)&&d[l].fn(r);e==!0&&r.preventDefault()}};return t.bind=function(r,a,d){if(d===void 0&&(d="keydown"),C[r]===void 0)throw new Error("unsupported key: "+r);A[d][C[r].code]===void 0&&(A[d][C[r].code]=[]),A[d][C[r].code].push({fn:a,shift:C[r].shift})},t.bindAll=function(r,a){a===void 0&&(a="keydown");for(var d in C)C.hasOwnProperty(d)&&t.bind(d,r,a)},t.getKey=function(r){for(var a in C)if(C.hasOwnProperty(a)){if(r.shiftKey==!0&&C[a].shift==!0&&r.keyCode==C[a].code)return a;if(r.shiftKey==!1&&C[a].shift==!1&&r.keyCode==C[a].code)return a;if(r.keyCode==C[a].code&&a=="shift")return a}return"unknown key, currently not supported"},t.unbind=function(r,a,d){if(d===void 0&&(d="keydown"),C[r]===void 0)throw new Error("unsupported key: "+r);if(a!==void 0){var l=[],h=A[d][C[r].code];if(h!==void 0)for(var c=0;c<h.length;c++)h[c].fn==a&&h[c].shift==C[r].shift||l.push(A[d][C[r].code][c]);A[d][C[r].code]=l}else A[d][C[r].code]=[]},t.reset=function(){A={keydown:{},keyup:{}}},t.destroy=function(){A={keydown:{},keyup:{}},g.removeEventListener("keydown",n,!0),g.removeEventListener("keyup",o,!0)},g.addEventListener("keydown",n,!0),g.addEventListener("keyup",o,!0),t}var Bn=class{constructor(e,g){this.body=e,this.canvas=g,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",()=>{this.activated=!0,this.configureKeyboardBindings()}),this.body.emitter.on("deactivate",()=>{this.activated=!1,this.configureKeyboardBindings()}),this.body.emitter.on("destroy",()=>{this.keycharm!==void 0&&this.keycharm.destroy()}),this.options={}}setOptions(e){e!==void 0&&(this.options=e,this.create())}create(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}cleanNavigation(){if(this.navigationHammers.length!=0){for(let e=0;e<this.navigationHammers.length;e++)this.navigationHammers[e].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}loadNavigationElements(){this.cleanNavigation(),this.navigationDOM={};let e=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],g=["_moveUp","_moveDown","_moveLeft","_moveRight","_zoomIn","_zoomOut","_fit"];this.navigationDOM.wrapper=document.createElement("div"),this.navigationDOM.wrapper.className="vis-navigation",this.canvas.frame.appendChild(this.navigationDOM.wrapper);for(let i=0;i<e.length;i++){this.navigationDOM[e[i]]=document.createElement("div"),this.navigationDOM[e[i]].className="vis-button vis-"+e[i],this.navigationDOM.wrapper.appendChild(this.navigationDOM[e[i]]);let n=new ot(this.navigationDOM[e[i]]);if(g[i]==="_fit"){var t;ZI(n,b(t=this._fit).call(t,this))}else{var A;ZI(n,b(A=this.bindToRedraw).call(A,this,g[i]))}this.navigationHammers.push(n)}let C=new ot(this.canvas.frame);Ph(C,()=>{this._stopMovement()}),this.navigationHammers.push(C),this.iconsCreated=!0}bindToRedraw(e){if(this.boundFunctions[e]===void 0){var g;this.boundFunctions[e]=b(g=this[e]).call(g,this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering")}}unbindFromRedraw(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}_fit(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}_stopMovement(){for(let e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),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(){let e=this.body.view.scale,g=this.body.view.scale*(1+this.options.keyboard.speed.zoom),t=this.body.view.translation,A=g/e,C=(1-A)*this.canvas.canvasViewCenter.x+t.x*A,i=(1-A)*this.canvas.canvasViewCenter.y+t.y*A;this.body.view.scale=g,this.body.view.translation={x:C,y:i},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}_zoomOut(){let e=this.body.view.scale,g=this.body.view.scale/(1+this.options.keyboard.speed.zoom),t=this.body.view.translation,A=g/e,C=(1-A)*this.canvas.canvasViewCenter.x+t.x*A,i=(1-A)*this.canvas.canvasViewCenter.y+t.y*A;this.body.view.scale=g,this.body.view.translation={x:C,y:i},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}configureKeyboardBindings(){if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=Ea({container:window,preventDefault:!0}):this.keycharm=Ea({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var e,g,t,A,C,i,n,o,s,r,a,d,l,h,c,p,u,m,E,w,O,M,k,V;b(e=this.keycharm).call(e,"up",()=>{this.bindToRedraw("_moveUp")},"keydown"),b(g=this.keycharm).call(g,"down",()=>{this.bindToRedraw("_moveDown")},"keydown"),b(t=this.keycharm).call(t,"left",()=>{this.bindToRedraw("_moveLeft")},"keydown"),b(A=this.keycharm).call(A,"right",()=>{this.bindToRedraw("_moveRight")},"keydown"),b(C=this.keycharm).call(C,"=",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(i=this.keycharm).call(i,"num+",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(n=this.keycharm).call(n,"num-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(o=this.keycharm).call(o,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(s=this.keycharm).call(s,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(r=this.keycharm).call(r,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(a=this.keycharm).call(a,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(d=this.keycharm).call(d,"pagedown",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(l=this.keycharm).call(l,"up",()=>{this.unbindFromRedraw("_moveUp")},"keyup"),b(h=this.keycharm).call(h,"down",()=>{this.unbindFromRedraw("_moveDown")},"keyup"),b(c=this.keycharm).call(c,"left",()=>{this.unbindFromRedraw("_moveLeft")},"keyup"),b(p=this.keycharm).call(p,"right",()=>{this.unbindFromRedraw("_moveRight")},"keyup"),b(u=this.keycharm).call(u,"=",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(m=this.keycharm).call(m,"num+",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(E=this.keycharm).call(E,"num-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),b(w=this.keycharm).call(w,"-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),b(O=this.keycharm).call(O,"[",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),b(M=this.keycharm).call(M,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(k=this.keycharm).call(k,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(V=this.keycharm).call(V,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")}}},zn=class{constructor(e,g,t){var A,C,i,n,o,s,r,a,d,l,h,c,p;this.body=e,this.canvas=g,this.selectionHandler=t,this.navigationHandler=new Bn(e,g),this.body.eventListeners.onTap=b(A=this.onTap).call(A,this),this.body.eventListeners.onTouch=b(C=this.onTouch).call(C,this),this.body.eventListeners.onDoubleTap=b(i=this.onDoubleTap).call(i,this),this.body.eventListeners.onHold=b(n=this.onHold).call(n,this),this.body.eventListeners.onDragStart=b(o=this.onDragStart).call(o,this),this.body.eventListeners.onDrag=b(s=this.onDrag).call(s,this),this.body.eventListeners.onDragEnd=b(r=this.onDragEnd).call(r,this),this.body.eventListeners.onMouseWheel=b(a=this.onMouseWheel).call(a,this),this.body.eventListeners.onPinch=b(d=this.onPinch).call(d,this),this.body.eventListeners.onMouseMove=b(l=this.onMouseMove).call(l,this),this.body.eventListeners.onRelease=b(h=this.onRelease).call(h,this),this.body.eventListeners.onContext=b(c=this.onContext).call(c,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=b(p=this.getPointer).call(p,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},q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("destroy",()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer})}setOptions(e){e!==void 0&&(bI(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),De(this.options,e,"keyboard"),e.tooltip&&(q(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=Gi(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-jO(this.canvas.frame.canvas),y:e.y-WO(this.canvas.frame.canvas)}}onTouch(e){new Date().valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}onTap(e){let g=this.getPointer(e.center),t=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(g,t),this.selectionHandler.commitAndEmit(g,e),this.selectionHandler.generateClickEvent("click",e,g)}onDoubleTap(e){let g=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,g)}onHold(e){let g=this.getPointer(e.center),t=this.selectionHandler.options.multiselect;this.checkSelectionChanges(g,t),this.selectionHandler.commitAndEmit(g,e),this.selectionHandler.generateClickEvent("click",e,g),this.selectionHandler.generateClickEvent("hold",e,g)}onRelease(e){if(new Date().valueOf()-this.touchTime>10){let g=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,g),this.touchTime=new Date().valueOf()}}onContext(e){let g=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,g)}checkSelectionChanges(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}_determineDifference(e,g){let t=function(A,C){let i=[];for(let n=0;n<A.length;n++){let o=A[n];G(C).call(C,o)===-1&&i.push(o)}return i};return{nodes:t(e.nodes,g.nodes),edges:t(e.edges,g.edges)}}onDragStart(e){if(this.drag.dragging)return;this.drag.pointer===void 0&&this.onTouch(e);let g=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=q({},this.body.view.translation),this.drag.nodeId=void 0,e.srcEvent.shiftKey){this.body.selectionBox.show=!0;let t=this.getPointer(e.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)}}else if(g!==void 0&&this.options.dragNodes===!0){this.drag.nodeId=g.id,g.isSelected()===!1&&this.selectionHandler.setSelection({nodes:[g.id]}),this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer);for(let t of this.selectionHandler.getSelectedNodes()){let A={id:t.id,node:t,x:t.x,y:t.y,xFixed:t.options.fixed.x,yFixed:t.options.fixed.y};t.options.fixed.x=!0,t.options.fixed.y=!0,this.drag.selection.push(A)}}else this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer,void 0,!0)}onDrag(e){if(this.drag.pinched===!0)return;this.body.emitter.emit("unlockNode");let g=this.getPointer(e.center),t=this.drag.selection;if(t&&t.length&&this.options.dragNodes===!0){this.selectionHandler.generateClickEvent("dragging",e,g);let A=g.x-this.drag.pointer.x,C=g.y-this.drag.pointer.y;F(t).call(t,i=>{let n=i.node;i.xFixed===!1&&(n.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(i.x)+A)),i.yFixed===!1&&(n.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(i.y)+C))}),this.body.emitter.emit("startSimulation")}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,g,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(g.x),y:this.canvas._YconvertDOMtoCanvas(g.y)},this.body.emitter.emit("_requestRedraw")}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,g,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}let A=g.x-this.drag.pointer.x,C=g.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+A,y:this.drag.translation.y+C},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(e){if(this.drag.dragging=!1,this.body.selectionBox.show){var g;this.body.selectionBox.show=!1;let t=this.body.selectionBox.position,A={minX:Math.min(t.start.x,t.end.x),minY:Math.min(t.start.y,t.end.y),maxX:Math.max(t.start.x,t.end.x),maxY:Math.max(t.start.y,t.end.y)},C=te(g=this.body.nodeIndices).call(g,n=>{let o=this.body.nodes[n];return o.x>=A.minX&&o.x<=A.maxX&&o.y>=A.minY&&o.y<=A.maxY});F(C).call(C,n=>this.selectionHandler.selectObject(this.body.nodes[n]));let i=this.getPointer(e.center);this.selectionHandler.commitAndEmit(i,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{let t=this.drag.selection;t&&t.length?(F(t).call(t,function(A){A.node.options.fixed.x=A.xFixed,A.node.options.fixed.y=A.yFixed}),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}onPinch(e){let g=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);let t=this.pinch.scale*e.scale;this.zoom(t,g)}zoom(e,g){if(this.options.zoomView===!0){let t=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);let A;this.drag!==void 0&&this.drag.dragging===!0&&(A=this.canvas.DOMtoCanvas(this.drag.pointer));let C=this.body.view.translation,i=e/t,n=(1-i)*g.x+C.x*i,o=(1-i)*g.y+C.y*i;if(this.body.view.scale=e,this.body.view.translation={x:n,y:o},A!=null){let s=this.canvas.canvasToDOM(A);this.drag.pointer.x=s.x,this.drag.pointer.y=s.y}this.body.emitter.emit("_requestRedraw"),t<e?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:g}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:g})}}onMouseWheel(e){if(this.options.zoomView===!0){if(e.deltaY!==0){let g=this.body.view.scale;g*=1+(e.deltaY<0?1:-1)*(this.options.zoomSpeed*.1);let t=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(g,t)}e.preventDefault()}}onMouseMove(e){let g=this.getPointer({x:e.clientX,y:e.clientY}),t=!1;this.popup!==void 0&&(this.popup.hidden===!1&&this._checkHidePopup(g),this.popup.hidden===!1&&(t=!0,this.popup.setPosition(g.x+3,g.y-5),this.popup.show())),this.options.keyboard.autoFocus&&this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),t===!1&&(this.popupTimer!==void 0&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=He(()=>this._checkShowPopup(g),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,g)}_checkShowPopup(e){let g=this.canvas._XconvertDOMtoCanvas(e.x),t=this.canvas._YconvertDOMtoCanvas(e.y),A={left:g,top:t,right:g,bottom:t},C=this.popupObj===void 0?void 0:this.popupObj.id,i=!1,n="node";if(this.popupObj===void 0){let o=this.body.nodeIndices,s=this.body.nodes,r,a=[];for(let d=0;d<o.length;d++)r=s[o[d]],r.isOverlappingWith(A)===!0&&(i=!0,r.getTitle()!==void 0&&a.push(o[d]));a.length>0&&(this.popupObj=s[a[a.length-1]],i=!0)}if(this.popupObj===void 0&&i===!1){let o=this.body.edgeIndices,s=this.body.edges,r,a=[];for(let d=0;d<o.length;d++)r=s[o[d]],r.isOverlappingWith(A)===!0&&r.connected===!0&&r.getTitle()!==void 0&&a.push(o[d]);a.length>0&&(this.popupObj=s[a[a.length-1]],n="edge")}this.popupObj!==void 0?this.popupObj.id!==C&&(this.popup===void 0&&(this.popup=new e1(this.canvas.frame)),this.popup.popupTargetType=n,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}_checkHidePopup(e){let g=this.selectionHandler._pointerToPositionObject(e),t=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(t=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(g),t===!0)){let A=this.selectionHandler.getNodeAt(e);t=A===void 0?!1:A.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(t=this.body.edges[this.popup.popupTargetId].isOverlappingWith(g));t===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}},Qk=Z,Ta=Do,qA=nC.getWeakData,Xk=Oo,Jk=rg,$k=ft,ai=ce,qk=xo,Dh=Ng,xa=ne,Nh=Kg,eM=Nh.set,gM=Nh.getterFor,tM=Dh.find,AM=Dh.findIndex,IM=Qk([].splice),CM=0,eI=function(I){return I.frozen||(I.frozen=new Rh)},Rh=function(){this.entries=[]},di=function(I,e){return tM(I.entries,function(g){return g[0]===e})};Rh.prototype={get:function(I){var e=di(this,I);if(e)return e[1]},has:function(I){return!!di(this,I)},set:function(I,e){var g=di(this,I);g?g[1]=e:this.entries.push([I,e])},delete:function(I){var e=AM(this.entries,function(g){return g[0]===I});return~e&&IM(this.entries,e,1),!!~e}};var iM={getConstructor:function(I,e,g,t){var A=I(function(o,s){Xk(o,C),eM(o,{type:e,id:CM++,frozen:void 0}),$k(s)||qk(s,o[t],{that:o,AS_ENTRIES:g})}),C=A.prototype,i=gM(e),n=function(o,s,r){var a=i(o),d=qA(Jk(s),!0);return d===!0?eI(a).set(s,r):d[a.id]=r,o};return Ta(C,{delete:function(o){var s=i(this);if(!ai(o))return!1;var r=qA(o);return r===!0?eI(s).delete(o):r&&xa(r,s.id)&&delete r[s.id]},has:function(s){var r=i(this);if(!ai(s))return!1;var a=qA(s);return a===!0?eI(r).has(s):a&&xa(a,r.id)}}),Ta(C,g?{get:function(s){var r=i(this);if(ai(s)){var a=qA(s);return a===!0?eI(r).get(s):a?a[r.id]:void 0}},set:function(s,r){return n(this,s,r)}}:{add:function(s){return n(this,s,!0)}}),A}},nM=Jl,Oa=X,rI=Z,Pa=Do,oM=nC,sM=Po,Sh=iM,gI=ce,tI=Kg.enforce,rM=z,aM=hd,kA=Object,dM=Array.isArray,AI=kA.isExtensible,kh=kA.isFrozen,lM=kA.isSealed,Mh=kA.freeze,hM=kA.seal,Da={},Na={},cM=!Oa.ActiveXObject&&"ActiveXObject"in Oa,kt,Fh=function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},Bh=sM("WeakMap",Fh,Sh),At=Bh.prototype,aI=rI(At.set),uM=function(){return nM&&rM(function(){var I=Mh([]);return aI(new Bh,I,1),!kh(I)})};aM&&(cM?(kt=Sh.getConstructor(Fh,"WeakMap",!0),oM.enable(),li=rI(At.delete),Mt=rI(At.has),hi=rI(At.get),Pa(At,{delete:function(I){if(gI(I)&&!AI(I)){var e=tI(this);return e.frozen||(e.frozen=new kt),li(this,I)||e.frozen.delete(I)}return li(this,I)},has:function(e){if(gI(e)&&!AI(e)){var g=tI(this);return g.frozen||(g.frozen=new kt),Mt(this,e)||g.frozen.has(e)}return Mt(this,e)},get:function(e){if(gI(e)&&!AI(e)){var g=tI(this);return g.frozen||(g.frozen=new kt),Mt(this,e)?hi(this,e):g.frozen.get(e)}return hi(this,e)},set:function(e,g){if(gI(e)&&!AI(e)){var t=tI(this);t.frozen||(t.frozen=new kt),Mt(this,e)?aI(this,e,g):t.frozen.set(e,g)}else aI(this,e,g);return this}})):uM()&&Pa(At,{set:function(e,g){var t;return dM(e)&&(kh(e)?t=Da:lM(e)&&(t=Na)),aI(this,e,g),t===Da&&Mh(e),t===Na&&hM(e),this}}));var li,Mt,hi,fM=L,pM=fM.WeakMap,mM=pM,vM=mM,bM=vM,Wt=D(bM);function Y(I,e,g,t){if(g==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?I!==e||!t:!e.has(I))throw new TypeError("Cannot read private member from an object whose class did not declare it");return g==="m"?t:g==="a"?t.call(I):t?t.value:e.get(I)}function Zn(I,e,g,t,A){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!A)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?I!==e||!A:!e.has(I))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?A.call(I,g):A?A.value=g:e.set(I,g),g}var Sg,Pe,hg,cg,dI;function Ra(I,e){let g=new Le;for(let t of e)I.has(t)||g.add(t);return g}var LI=class{constructor(){Sg.set(this,new Le),Pe.set(this,new Le)}get size(){return Y(this,Pe,"f").size}add(){for(var e=arguments.length,g=new Array(e),t=0;t<e;t++)g[t]=arguments[t];for(let A of g)Y(this,Pe,"f").add(A)}delete(){for(var e=arguments.length,g=new Array(e),t=0;t<e;t++)g[t]=arguments[t];for(let A of g)Y(this,Pe,"f").delete(A)}clear(){Y(this,Pe,"f").clear()}getSelection(){return[...Y(this,Pe,"f")]}getChanges(){return{added:[...Ra(Y(this,Sg,"f"),Y(this,Pe,"f"))],deleted:[...Ra(Y(this,Pe,"f"),Y(this,Sg,"f"))],previous:[...new Le(Y(this,Sg,"f"))],current:[...new Le(Y(this,Pe,"f"))]}}commit(){let e=this.getChanges();Zn(this,Sg,Y(this,Pe,"f"),"f"),Zn(this,Pe,new Le(Y(this,Sg,"f")),"f");for(let g of e.added)g.select();for(let g of e.deleted)g.unselect();return e}};Sg=new Wt,Pe=new Wt;var Ln=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};hg.set(this,new LI),cg.set(this,new LI),dI.set(this,void 0),Zn(this,dI,e,"f")}get sizeNodes(){return Y(this,hg,"f").size}get sizeEdges(){return Y(this,cg,"f").size}getNodes(){return Y(this,hg,"f").getSelection()}getEdges(){return Y(this,cg,"f").getSelection()}addNodes(){Y(this,hg,"f").add(...arguments)}addEdges(){Y(this,cg,"f").add(...arguments)}deleteNodes(e){Y(this,hg,"f").delete(e)}deleteEdges(e){Y(this,cg,"f").delete(e)}clear(){Y(this,hg,"f").clear(),Y(this,cg,"f").clear()}commit(){let e={nodes:Y(this,hg,"f").commit(),edges:Y(this,cg,"f").commit()};for(var g=arguments.length,t=new Array(g),A=0;A<g;A++)t[A]=arguments[A];return Y(this,dI,"f").call(this,e,...t),e}};hg=new Wt,cg=new Wt,dI=new Wt;var Gn=class{constructor(e,g){this.body=e,this.canvas=g,this._selectionAccumulator=new Ln,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},q(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",()=>{this.updateSelection()})}setOptions(e){e!==void 0&&xt(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,e)}selectOnPoint(e){let g=!1;if(this.options.selectable===!0){let t=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),t!==void 0&&(g=this.selectObject(t)),this.body.emitter.emit("_requestRedraw")}return g}selectAdditionalOnPoint(e){let g=!1;if(this.options.selectable===!0){let t=this.getNodeAt(e)||this.getEdgeAt(e);t!==void 0&&(g=!0,t.isSelected()===!0?this.deselectObject(t):this.selectObject(t),this.body.emitter.emit("_requestRedraw"))}return g}_initBaseEvent(e,g){let t={};return t.pointer={DOM:{x:g.x,y:g.y},canvas:this.canvas.DOMtoCanvas(g)},t.event=e,t}generateClickEvent(e,g,t,A){let C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,i=this._initBaseEvent(g,t);if(C===!0)i.nodes=[],i.edges=[];else{let n=this.getSelection();i.nodes=n.nodes,i.edges=n.edges}A!==void 0&&(i.previousSelection=A),e=="click"&&(i.items=this.getClickedItems(t)),g.controlEdge!==void 0&&(i.controlEdge=g.controlEdge),this.body.emitter.emit(e,i)}selectObject(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return e!==void 0?(e instanceof pe?(g===!0&&this._selectionAccumulator.addEdges(...e.edges),this._selectionAccumulator.addNodes(e)):this._selectionAccumulator.addEdges(e),!0):!1}deselectObject(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}_getAllNodesOverlappingWith(e){let g=[],t=this.body.nodes;for(let A=0;A<this.body.nodeIndices.length;A++){let C=this.body.nodeIndices[A];t[C].isOverlappingWith(e)&&g.push(C)}return g}_pointerToPositionObject(e){let g=this.canvas.DOMtoCanvas(e);return{left:g.x-1,top:g.y+1,right:g.x+1,bottom:g.y-1}}getNodeAt(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this._pointerToPositionObject(e),A=this._getAllNodesOverlappingWith(t);if(A.length>0)return g===!0?this.body.nodes[A[A.length-1]]:A[A.length-1]}_getEdgesOverlappingWith(e,g){let t=this.body.edges;for(let A=0;A<this.body.edgeIndices.length;A++){let C=this.body.edgeIndices[A];t[C].isOverlappingWith(e)&&g.push(C)}}_getAllEdgesOverlappingWith(e){let g=[];return this._getEdgesOverlappingWith(e,g),g}getEdgeAt(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this.canvas.DOMtoCanvas(e),A=10,C=null,i=this.body.edges;for(let n=0;n<this.body.edgeIndices.length;n++){let o=this.body.edgeIndices[n],s=i[o];if(s.connected){let r=s.from.x,a=s.from.y,d=s.to.x,l=s.to.y,h=s.edgeType.getDistanceToEdge(r,a,d,l,t.x,t.y);h<A&&(C=o,A=h)}}if(C!==null)return g===!0?this.body.edges[C]:C}_addToHover(e){e instanceof pe?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}_removeFromSelection(e){e instanceof pe?(this._selectionAccumulator.deleteNodes(e),this._selectionAccumulator.deleteEdges(...e.edges)):this._selectionAccumulator.deleteEdges(e)}unselectAll(){this._selectionAccumulator.clear()}getSelectedNodeCount(){return this._selectionAccumulator.sizeNodes}getSelectedEdgeCount(){return this._selectionAccumulator.sizeEdges}_hoverConnectedEdges(e){for(let g=0;g<e.edges.length;g++){let t=e.edges[g];t.hover=!0,this._addToHover(t)}}emitBlurEvent(e,g,t){let A=this._initBaseEvent(e,g);t.hover===!0&&(t.hover=!1,t instanceof pe?(A.node=t.id,this.body.emitter.emit("blurNode",A)):(A.edge=t.id,this.body.emitter.emit("blurEdge",A)))}emitHoverEvent(e,g,t){let A=this._initBaseEvent(e,g),C=!1;return t.hover===!1&&(t.hover=!0,this._addToHover(t),C=!0,t instanceof pe?(A.node=t.id,this.body.emitter.emit("hoverNode",A)):(A.edge=t.id,this.body.emitter.emit("hoverEdge",A))),C}hoverObject(e,g){let t=this.getNodeAt(g);t===void 0&&(t=this.getEdgeAt(g));let A=!1;for(let C in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,C)&&(t===void 0||t instanceof pe&&t.id!=C||t instanceof xg)&&(this.emitBlurEvent(e,g,this.hoverObj.nodes[C]),delete this.hoverObj.nodes[C],A=!0);for(let C in this.hoverObj.edges)Object.prototype.hasOwnProperty.call(this.hoverObj.edges,C)&&(A===!0?(this.hoverObj.edges[C].hover=!1,delete this.hoverObj.edges[C]):(t===void 0||t instanceof xg&&t.id!=C||t instanceof pe&&!t.hover)&&(this.emitBlurEvent(e,g,this.hoverObj.edges[C]),delete this.hoverObj.edges[C],A=!0));if(t!==void 0){let C=U(this.hoverObj.edges).length,i=U(this.hoverObj.nodes).length,n=t instanceof xg&&C===0&&i===0,o=t instanceof pe&&C===0&&i===0;(A||n||o)&&(A=this.emitHoverEvent(e,g,t)),t instanceof pe&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(t)}A===!0&&this.body.emitter.emit("_requestRedraw")}commitWithoutEmitting(){this._selectionAccumulator.commit()}commitAndEmit(e,g){let t=!1,A=this._selectionAccumulator.commit(),C={nodes:A.nodes.previous,edges:A.edges.previous};A.edges.deleted.length>0&&(this.generateClickEvent("deselectEdge",g,e,C),t=!0),A.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",g,e,C),t=!0),A.nodes.added.length>0&&(this.generateClickEvent("selectNode",g,e),t=!0),A.edges.added.length>0&&(this.generateClickEvent("selectEdge",g,e),t=!0),t===!0&&this.generateClickEvent("select",g,e)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var e;return ae(e=this._selectionAccumulator.getNodes()).call(e,g=>g.id)}getSelectedEdgeIds(){var e;return ae(e=this._selectionAccumulator.getEdges()).call(e,g=>g.id)}setSelection(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((g.unselectAll||g.unselectAll===void 0)&&this.unselectAll(),e.nodes)for(let t of e.nodes){let A=this.body.nodes[t];if(!A)throw new RangeError('Node with id "'+t+'" not found');this.selectObject(A,g.highlightEdges)}if(e.edges)for(let t of e.edges){let A=this.body.edges[t];if(!A)throw new RangeError('Edge with id "'+t+'" not found');this.selectObject(A)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:g})}selectEdges(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}updateSelection(){for(let e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(let e in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,e.id)||this._selectionAccumulator.deleteEdges(e)}getClickedItems(e){let g=this.canvas.DOMtoCanvas(e),t=[],A=this.body.nodeIndices,C=this.body.nodes;for(let o=A.length-1;o>=0;o--){let r=C[A[o]].getItemsOnPoint(g);t.push.apply(t,r)}let i=this.body.edgeIndices,n=this.body.edges;for(let o=i.length-1;o>=0;o--){let r=n[i[o]].getItemsOnPoint(g);t.push.apply(t,r)}return t}},GI=class{abstract(){throw new Error("Can't instantiate abstract class!")}fake_use(){}curveType(){return this.abstract()}getPosition(e){return this.fake_use(e),this.abstract()}setPosition(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,g,t),this.abstract()}getTreeSize(e){return this.fake_use(e),this.abstract()}sort(e){this.fake_use(e),this.abstract()}fix(e,g){this.fake_use(e,g),this.abstract()}shift(e,g){this.fake_use(e,g),this.abstract()}},Vn=class extends GI{constructor(e){super(),this.layout=e}curveType(){return"horizontal"}getPosition(e){return e.x}setPosition(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;t!==void 0&&this.layout.hierarchical.addToOrdering(e,t),e.x=g}getTreeSize(e){let g=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:g.min_x,max:g.max_x}}sort(e){Cg(e).call(e,function(g,t){return g.x-t.x})}fix(e,g){e.y=this.layout.options.hierarchical.levelSeparation*g,e.options.fixed.y=!0}shift(e,g){this.layout.body.nodes[e].x+=g}},jn=class extends GI{constructor(e){super(),this.layout=e}curveType(){return"vertical"}getPosition(e){return e.y}setPosition(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;t!==void 0&&this.layout.hierarchical.addToOrdering(e,t),e.y=g}getTreeSize(e){let g=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:g.min_y,max:g.max_y}}sort(e){Cg(e).call(e,function(g,t){return g.y-t.y})}fix(e,g){e.x=this.layout.options.hierarchical.levelSeparation*g,e.options.fixed.x=!0}shift(e,g){this.layout.body.nodes[e].y+=g}},yM=N,wM=Ng.every,EM=wt,TM=EM("every");yM({target:"Array",proto:!0,forced:!TM},{every:function(e){return wM(this,e,arguments.length>1?arguments[1]:void 0)}});var xM=Ie,OM=xM("Array").every,PM=J,DM=OM,ci=Array.prototype,NM=function(I){var e=I.every;return I===ci||PM(ci,I)&&e===ci.every?DM:e},RM=NM,SM=RM,kM=SM,zh=D(kM);function MM(I,e){let g=new Le;return F(I).call(I,t=>{var A;F(A=t.edges).call(A,C=>{C.connected&&g.add(C)})}),F(g).call(g,t=>{let A=t.from.id,C=t.to.id;e[A]==null&&(e[A]=0),(e[C]==null||e[A]>=e[C])&&(e[C]=e[A]+1)}),e}function FM(I){return Zh(e=>{var g,t;return zh(g=te(t=e.edges).call(t,A=>I.has(A.toId))).call(g,A=>A.to===e)},(e,g)=>g>e,"from",I)}function BM(I){return Zh(e=>{var g,t;return zh(g=te(t=e.edges).call(t,A=>I.has(A.toId))).call(g,A=>A.from===e)},(e,g)=>g<e,"to",I)}function Zh(I,e,g,t){var A;let C=wg(null),i=So(A=[...EI(t).call(t)]).call(A,(a,d)=>a+1+d.edges.length,0),n=g+"Id",o=g==="to"?1:-1;for(let[a,d]of t){if(!t.has(a)||!I(d))continue;C[a]=0;let l=[d],h=0,c;for(;c=l.pop();){var s,r;if(!t.has(a))continue;let p=C[c.id]+o;if(F(s=te(r=c.edges).call(r,u=>u.connected&&u.to!==u.from&&u[g]!==c&&t.has(u.toId)&&t.has(u.fromId))).call(s,u=>{let m=u[n],E=C[m];(E==null||e(p,E))&&(C[m]=p,l.push(u[g]))}),h>i)return MM(t,C);++h}}return C}var Wn=class{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(e,g){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(g),this.parentReference[g]===void 0&&(this.parentReference[g]=[]),this.parentReference[g].push(e)}checkIfTree(){for(let e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(e,g){g!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=g,this.treeIndex=Math.max(g,this.treeIndex))}ensureLevel(e){this.levels[e]===void 0&&(this.levels[e]=0)}getMaxLevel(e){let g={},t=A=>{if(g[A]!==void 0)return g[A];let C=this.levels[A];if(this.childrenReference[A]){let i=this.childrenReference[A];if(i.length>0)for(let n=0;n<i.length;n++)C=Math.max(C,t(i[n]))}return g[A]=C,C};return t(e)}levelDownstream(e,g){this.levels[g.id]===void 0&&(this.levels[e.id]===void 0&&(this.levels[e.id]=0),this.levels[g.id]=this.levels[e.id]+1)}setMinLevelToZero(){var e;let g=new NA,t=0,A=Cg(e=[...new Le(yT(this.levels))]).call(e,(C,i)=>C-i);for(let C of A)g.set(C,t++);for(let C in this.levels)Object.prototype.hasOwnProperty.call(this.levels,C)&&(this.levels[C]=g.get(this.levels[C]))}getTreeSize(e,g){let t=1e9,A=-1e9,C=1e9,i=-1e9;for(let n in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,n)&&this.trees[n]===g){let o=e[n];t=Math.min(o.x,t),A=Math.max(o.x,A),C=Math.min(o.y,C),i=Math.max(o.y,i)}return{min_x:t,max_x:A,min_y:C,max_y:i}}hasSameParent(e,g){let t=this.parentReference[e.id],A=this.parentReference[g.id];if(t===void 0||A===void 0)return!1;for(let C=0;C<t.length;C++)for(let i=0;i<A.length;i++)if(t[C]==A[i])return!0;return!1}inSameSubNetwork(e,g){return this.trees[e.id]===this.trees[g.id]}getLevels(){return U(this.distributionOrdering)}addToOrdering(e,g){this.distributionOrdering[g]===void 0&&(this.distributionOrdering[g]=[]);let t=!1,A=this.distributionOrdering[g];for(let C in A)if(A[C]===e){t=!0;break}t||(this.distributionOrdering[g].push(e),this.distributionIndex[e.id]=this.distributionOrdering[g].length-1)}},Yn=class{constructor(e){this.body=e,this._resetRNG(Math.random()+":"+uI()),this.setPhysics=!1,this.options={},this.optionsBackup={physics:{}},this.defaultOptions={randomSeed:void 0,improvedLayout:!0,clusterThreshold:150,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:"UD",sortMethod:"hubsize"}},q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("_dataChanged",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",()=>{this.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",()=>{if(this.options.hierarchical.enabled!==!0)return;let e=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",e,!1)})}setOptions(e,g){if(e!==void 0){let t=this.options.hierarchical,A=t.enabled;if(xt(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),De(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),t.enabled===!0)return A===!0&&this.body.emitter.emit("refresh",!0),t.direction==="RL"||t.direction==="DU"?t.levelSeparation>0&&(t.levelSeparation*=-1):t.levelSeparation<0&&(t.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(g);if(A===!0)return this.body.emitter.emit("refresh"),_(g,this.optionsBackup)}return g}_resetRNG(e){this.initialRandomSeed=e,this._rng=iC(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(e){if(this.options.hierarchical.enabled===!0){let g=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:g.enabled===void 0?!0:g.enabled,solver:"hierarchicalRepulsion"},g.enabled=g.enabled===void 0?!0:g.enabled,g.solver=g.solver||"barnesHut"):typeof e.physics=="object"?(g.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,g.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(g.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});let t=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if(typeof e.edges.smooth=="boolean")this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:t};else{let A=e.edges.smooth;A.type!==void 0&&A.type!=="dynamic"&&(t=A.type),this.optionsBackup.edges={smooth:{enabled:A.enabled===void 0?!0:A.enabled,type:A.type===void 0?"dynamic":A.type,roundness:A.roundness===void 0?.5:A.roundness,forceDirection:A.forceDirection===void 0?!1:A.forceDirection}},e.edges.smooth={enabled:A.enabled===void 0?!0:A.enabled,type:t,roundness:A.roundness===void 0?.5:A.roundness,forceDirection:A.forceDirection===void 0?!1:A.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",t)}return e}positionInitially(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);let g=e.length+50;for(let t=0;t<e.length;t++){let A=e[t],C=2*Math.PI*this._rng();A.x===void 0&&(A.x=g*Math.cos(C)),A.y===void 0&&(A.y=g*Math.sin(C))}}}layoutNetwork(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){let e=this.body.nodeIndices,g=0;for(let t=0;t<e.length;t++)this.body.nodes[e[t]].predefinedPosition===!0&&(g+=1);if(g<.5*e.length){let A=0,C=this.options.clusterThreshold,i={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(e.length>C){let o=e.length;for(;e.length>C&&A<=10;){A+=1;let s=e.length;A%3===0?this.body.modules.clustering.clusterBridges(i):this.body.modules.clustering.clusterOutliers(i);let r=e.length;if(s==r&&A%3!==0){this._declusterAll(),this.body.emitter.emit("_layoutFailed"),console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*o)})}A>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();let n=70;for(let o=0;o<e.length;o++){let s=this.body.nodes[e[o]];s.predefinedPosition===!1&&(s.x+=(.5-this._rng())*n,s.y+=(.5-this._rng())*n)}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}_shiftToCenter(){let e=de.getRangeCore(this.body.nodes,this.body.nodeIndices),g=de.findCenter(e);for(let t=0;t<this.body.nodeIndices.length;t++){let A=this.body.nodes[this.body.nodeIndices[t]];A.x-=g.x,A.y-=g.y}}_declusterAll(){let e=!0;for(;e===!0;){e=!1;for(let g=0;g<this.body.nodeIndices.length;g++)this.body.nodes[this.body.nodeIndices[g]].isCluster===!0&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[g],{},!1));e===!0&&this.body.emitter.emit("_dataChanged")}}getSeed(){return this.initialRandomSeed}setupHierarchicalLayout(){if(this.options.hierarchical.enabled===!0&&this.body.nodeIndices.length>0){let e,g,t=!1,A=!1;this.lastNodeOnLevel={},this.hierarchical=new Wn;for(g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&(e=this.body.nodes[g],e.options.level!==void 0?(t=!0,this.hierarchical.levels[g]=e.options.level):A=!0);if(A===!0&&t===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");{if(A===!0){let i=this.options.hierarchical.sortMethod;i==="hubsize"?this._determineLevelsByHubsize():i==="directed"?this._determineLevelsDirected():i==="custom"&&this._determineLevelsCustomCallback()}for(let i in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,i)&&this.hierarchical.ensureLevel(i);let C=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(C),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var e=this;let g=!1,t={},A=()=>{let u=i(),m=0;for(let E=0;E<u.length-1;E++){let w=u[E].max-u[E+1].min;m+=w+this.options.hierarchical.treeSpacing,C(E+1,m)}},C=(u,m)=>{let E=this.hierarchical.trees;for(let w in E)Object.prototype.hasOwnProperty.call(E,w)&&E[w]===u&&this.direction.shift(w,m)},i=()=>{let u=[];for(let m=0;m<this.hierarchical.numTrees();m++)u.push(this.direction.getTreeSize(m));return u},n=(u,m)=>{if(!m[u.id]&&(m[u.id]=!0,this.hierarchical.childrenReference[u.id])){let E=this.hierarchical.childrenReference[u.id];if(E.length>0)for(let w=0;w<E.length;w++)n(this.body.nodes[E[w]],m)}},o=function(u){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,E=1e9,w=1e9,O=1e9,M=-1e9;for(let k in u)if(Object.prototype.hasOwnProperty.call(u,k)){let V=e.body.nodes[k],ye=e.hierarchical.levels[V.id],ue=e.direction.getPosition(V),[Hg,Qg]=e._getSpaceAroundNode(V,u);E=Math.min(Hg,E),w=Math.min(Qg,w),ye<=m&&(O=Math.min(ue,O),M=Math.max(ue,M))}return[O,M,E,w]},s=(u,m)=>{let E=this.hierarchical.getMaxLevel(u.id),w=this.hierarchical.getMaxLevel(m.id);return Math.min(E,w)},r=(u,m,E)=>{let w=this.hierarchical;for(let O=0;O<m.length;O++){let M=m[O],k=w.distributionOrdering[M];if(k.length>1)for(let V=0;V<k.length-1;V++){let ye=k[V],ue=k[V+1];w.hasSameParent(ye,ue)&&w.inSameSubNetwork(ye,ue)&&u(ye,ue,E)}}},a=function(u,m){let E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,w=e.direction.getPosition(u),O=e.direction.getPosition(m),M=Math.abs(O-w),k=e.options.hierarchical.nodeSpacing;if(M>k){let V={},ye={};n(u,V),n(m,ye);let ue=s(u,m),Hg=o(V,ue),Qg=o(ye,ue),MA=Hg[1],Xg=Qg[0],Ce=Qg[2];if(Math.abs(MA-Xg)>k){let W=MA-Xg+k;W<-Ce+k&&(W=-Ce+k),W<0&&(e._shiftBlock(m.id,W),g=!0,E===!0&&e._centerParent(m))}}},d=(u,m)=>{let E=m.id,w=m.edges,O=this.hierarchical.levels[m.id],M=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,k={},V=[];for(let Ce=0;Ce<w.length;Ce++){let j=w[Ce];if(j.toId!=j.fromId){let W=j.toId==E?j.from:j.to;k[w[Ce].id]=W,this.hierarchical.levels[W.id]<O&&V.push(j)}}let ye=(Ce,j)=>{let W=0;for(let he=0;he<j.length;he++)if(k[j[he].id]!==void 0){let fe=this.direction.getPosition(k[j[he].id])-Ce;W+=fe/Math.sqrt(fe*fe+M)}return W},ue=(Ce,j)=>{let W=0;for(let he=0;he<j.length;he++)if(k[j[he].id]!==void 0){let fe=this.direction.getPosition(k[j[he].id])-Ce;W-=M*Math.pow(fe*fe+M,-1.5)}return W},Hg=(Ce,j)=>{let W=this.direction.getPosition(m),he={};for(let fe=0;fe<Ce;fe++){let Me=ye(W,j),Jg=ue(W,j),Ot=40,jh=Math.max(-Ot,Math.min(Ot,Math.round(Me/Jg)));if(W=W-jh,he[W]!==void 0)break;he[W]=fe}return W},Qg=Ce=>{let j=this.direction.getPosition(m);if(t[m.id]===void 0){let Ot={};n(m,Ot),t[m.id]=Ot}let W=o(t[m.id]),he=W[2],fe=W[3],Me=Ce-j,Jg=0;Me>0?Jg=Math.min(Me,fe-this.options.hierarchical.nodeSpacing):Me<0&&(Jg=-Math.min(-Me,he-this.options.hierarchical.nodeSpacing)),Jg!=0&&(this._shiftBlock(m.id,Jg),g=!0)},MA=Ce=>{let j=this.direction.getPosition(m),[W,he]=this._getSpaceAroundNode(m),fe=Ce-j,Me=j;fe>0?Me=Math.min(j+(he-this.options.hierarchical.nodeSpacing),Ce):fe<0&&(Me=Math.max(j-(W-this.options.hierarchical.nodeSpacing),Ce)),Me!==j&&(this.direction.setPosition(m,Me),g=!0)},Xg=Hg(u,V);Qg(Xg),Xg=Hg(u,w),MA(Xg)},l=u=>{let m=this.hierarchical.getLevels();m=zg(m).call(m);for(let E=0;E<u;E++){g=!1;for(let w=0;w<m.length;w++){let O=m[w],M=this.hierarchical.distributionOrdering[O];for(let k=0;k<M.length;k++)d(1e3,M[k])}if(g!==!0)break}},h=u=>{let m=this.hierarchical.getLevels();m=zg(m).call(m);for(let E=0;E<u&&(g=!1,r(a,m,!0),g===!0);E++);},c=()=>{for(let u in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,u)&&this._centerParent(this.body.nodes[u])},p=()=>{let u=this.hierarchical.getLevels();u=zg(u).call(u);for(let m=0;m<u.length;m++){let E=u[m],w=this.hierarchical.distributionOrdering[E];for(let O=0;O<w.length;O++)this._centerParent(w[O])}};this.options.hierarchical.blockShifting===!0&&(h(5),c()),this.options.hierarchical.edgeMinimization===!0&&l(20),this.options.hierarchical.parentCentralization===!0&&p(),A()}_getSpaceAroundNode(e,g){let t=!0;g===void 0&&(t=!1);let A=this.hierarchical.levels[e.id];if(A!==void 0){let C=this.hierarchical.distributionIndex[e.id],i=this.direction.getPosition(e),n=this.hierarchical.distributionOrdering[A],o=1e9,s=1e9;if(C!==0){let r=n[C-1];if(t===!0&&g[r.id]===void 0||t===!1){let a=this.direction.getPosition(r);o=i-a}}if(C!=n.length-1){let r=n[C+1];if(t===!0&&g[r.id]===void 0||t===!1){let a=this.direction.getPosition(r);s=Math.min(s,a-i)}}return[o,s]}else return[0,0]}_centerParent(e){if(this.hierarchical.parentReference[e.id]){let g=this.hierarchical.parentReference[e.id];for(let t=0;t<g.length;t++){let A=g[t],C=this.body.nodes[A],i=this.hierarchical.childrenReference[A];if(i!==void 0){let n=this._getCenterPosition(i),o=this.direction.getPosition(C),[s,r]=this._getSpaceAroundNode(C),a=o-n;(a<0&&Math.abs(a)<r-this.options.hierarchical.nodeSpacing||a>0&&Math.abs(a)<s-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(C,n)}}}}_placeNodesByHierarchy(e){this.positionedNodes={};for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var g;let A=U(e[t]);A=this._indexArrayToNodes(A),Cg(g=this.direction).call(g,A);let C=0;for(let i=0;i<A.length;i++){let n=A[i];if(this.positionedNodes[n.id]===void 0){let o=this.options.hierarchical.nodeSpacing,s=o*C;C>0&&(s=this.direction.getPosition(A[i-1])+o),this.direction.setPosition(n,s,t),this._validatePositionAndContinue(n,t,s),C++}}}}_placeBranchNodes(e,g){var t;let A=this.hierarchical.childrenReference[e];if(A===void 0)return;let C=[];for(let n=0;n<A.length;n++)C.push(this.body.nodes[A[n]]);Cg(t=this.direction).call(t,C);for(let n=0;n<C.length;n++){let o=C[n],s=this.hierarchical.levels[o.id];if(s>g&&this.positionedNodes[o.id]===void 0){let r=this.options.hierarchical.nodeSpacing,a;n===0?a=this.direction.getPosition(this.body.nodes[e]):a=this.direction.getPosition(C[n-1])+r,this.direction.setPosition(o,a,s),this._validatePositionAndContinue(o,s,a)}else return}let i=this._getCenterPosition(C);this.direction.setPosition(this.body.nodes[e],i,g)}_validatePositionAndContinue(e,g,t){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[g]!==void 0){let A=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[g]]);if(t-A<this.options.hierarchical.nodeSpacing){let C=A+this.options.hierarchical.nodeSpacing-t,i=this._findCommonParent(this.lastNodeOnLevel[g],e.id);this._shiftBlock(i.withChild,C)}}this.lastNodeOnLevel[g]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,g)}}_indexArrayToNodes(e){let g=[];for(let t=0;t<e.length;t++)g.push(this.body.nodes[e[t]]);return g}_getDistribution(){let e={},g,t;for(g in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,g)){t=this.body.nodes[g];let A=this.hierarchical.levels[g]===void 0?0:this.hierarchical.levels[g];this.direction.fix(t,A),e[A]===void 0&&(e[A]={}),e[A][g]=t}return e}_getActiveEdges(e){let g=[];return S(e.edges,t=>{var A;G(A=this.body.edgeIndices).call(A,t.id)!==-1&&g.push(t)}),g}_getHubSizes(){let e={},g=this.body.nodeIndices;S(g,A=>{let C=this.body.nodes[A],i=this._getActiveEdges(C).length;e[i]=!0});let t=[];return S(e,A=>{t.push(Number(A))}),Cg(t).call(t,function(A,C){return C-A}),t}_determineLevelsByHubsize(){let e=(t,A)=>{this.hierarchical.levelDownstream(t,A)},g=this._getHubSizes();for(let t=0;t<g.length;++t){let A=g[t];if(A===0)break;S(this.body.nodeIndices,C=>{let i=this.body.nodes[C];A===this._getActiveEdges(i).length&&this._crawlNetwork(e,C)})}}_determineLevelsCustomCallback(){let g=function(A,C,i){},t=(A,C,i)=>{let n=this.hierarchical.levels[A.id];n===void 0&&(n=this.hierarchical.levels[A.id]=1e5);let o=g(de.cloneOptions(A,"node"),de.cloneOptions(C,"node"),de.cloneOptions(i,"edge"));this.hierarchical.levels[C.id]=n+o};this._crawlNetwork(t),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;let g=So(e=this.body.nodeIndices).call(e,(t,A)=>(t.set(A,this.body.nodes[A]),t),new NA);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=BM(g):this.hierarchical.levels=FM(g),this.hierarchical.setMinLevelToZero()}_generateMap(){let e=(g,t)=>{this.hierarchical.levels[t.id]>this.hierarchical.levels[g.id]&&this.hierarchical.addRelation(g.id,t.id)};this._crawlNetwork(e),this.hierarchical.checkIfTree()}_crawlNetwork(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},g=arguments.length>1?arguments[1]:void 0,t={},A=(C,i)=>{if(t[C.id]===void 0){this.hierarchical.setTreeIndex(C,i),t[C.id]=!0;let n,o=this._getActiveEdges(C);for(let s=0;s<o.length;s++){let r=o[s];r.connected===!0&&(r.toId==C.id?n=r.from:n=r.to,C.id!=n.id&&(e(C,n,r),A(n,i)))}}};if(g===void 0){let C=0;for(let i=0;i<this.body.nodeIndices.length;i++){let n=this.body.nodeIndices[i];if(t[n]===void 0){let o=this.body.nodes[n];A(o,C),C+=1}}}else{let C=this.body.nodes[g];if(C===void 0){console.error("Node not found:",g);return}A(C)}}_shiftBlock(e,g){let t={},A=C=>{if(t[C])return;t[C]=!0,this.direction.shift(C,g);let i=this.hierarchical.childrenReference[C];if(i!==void 0)for(let n=0;n<i.length;n++)A(i[n])};A(e)}_findCommonParent(e,g){let t={},A=(i,n)=>{let o=this.hierarchical.parentReference[n];if(o!==void 0)for(let s=0;s<o.length;s++){let r=o[s];i[r]=!0,A(i,r)}},C=(i,n)=>{let o=this.hierarchical.parentReference[n];if(o!==void 0)for(let s=0;s<o.length;s++){let r=o[s];if(i[r]!==void 0)return{foundParent:r,withChild:n};let a=C(i,r);if(a.foundParent!==null)return a}return{foundParent:null,withChild:n}};return A(t,e),C(t,g)}setDirectionStrategy(){this.options.hierarchical.direction==="UD"||this.options.hierarchical.direction==="DU"?this.direction=new Vn(this):this.direction=new jn(this)}_getCenterPosition(e){let g=1e9,t=-1e9;for(let A=0;A<e.length;A++){let C;if(e[A].id!==void 0)C=e[A];else{let n=e[A];C=this.body.nodes[n]}let i=this.direction.getPosition(C);g=Math.min(g,i),t=Math.max(t,i)}return .5*(g+t)}},zM=`div.vis-network div.vis-manipulation {
714
+ `;_g(Hk);function Ea(I){var e=I&&I.preventDefault||!1,g=I&&I.container||window,t={},A={keydown:{},keyup:{}},C={},i;for(i=97;i<=122;i++)C[String.fromCharCode(i)]={code:65+(i-97),shift:!1};for(i=65;i<=90;i++)C[String.fromCharCode(i)]={code:i,shift:!0};for(i=0;i<=9;i++)C[""+i]={code:48+i,shift:!1};for(i=1;i<=12;i++)C["F"+i]={code:111+i,shift:!1};for(i=0;i<=9;i++)C["num"+i]={code:96+i,shift:!1};C["num*"]={code:106,shift:!1},C["num+"]={code:107,shift:!1},C["num-"]={code:109,shift:!1},C["num/"]={code:111,shift:!1},C["num."]={code:110,shift:!1},C.left={code:37,shift:!1},C.up={code:38,shift:!1},C.right={code:39,shift:!1},C.down={code:40,shift:!1},C.space={code:32,shift:!1},C.enter={code:13,shift:!1},C.shift={code:16,shift:void 0},C.esc={code:27,shift:!1},C.backspace={code:8,shift:!1},C.tab={code:9,shift:!1},C.ctrl={code:17,shift:!1},C.alt={code:18,shift:!1},C.delete={code:46,shift:!1},C.pageup={code:33,shift:!1},C.pagedown={code:34,shift:!1},C["="]={code:187,shift:!1},C["-"]={code:189,shift:!1},C["]"]={code:221,shift:!1},C["["]={code:219,shift:!1};var n=function(s){o(s,"keydown")},r=function(s){o(s,"keyup")},o=function(s,a){if(A[a][s.keyCode]!==void 0){for(var d=A[a][s.keyCode],l=0;l<d.length;l++)(d[l].shift===void 0||d[l].shift==!0&&s.shiftKey==!0||d[l].shift==!1&&s.shiftKey==!1)&&d[l].fn(s);e==!0&&s.preventDefault()}};return t.bind=function(s,a,d){if(d===void 0&&(d="keydown"),C[s]===void 0)throw new Error("unsupported key: "+s);A[d][C[s].code]===void 0&&(A[d][C[s].code]=[]),A[d][C[s].code].push({fn:a,shift:C[s].shift})},t.bindAll=function(s,a){a===void 0&&(a="keydown");for(var d in C)C.hasOwnProperty(d)&&t.bind(d,s,a)},t.getKey=function(s){for(var a in C)if(C.hasOwnProperty(a)){if(s.shiftKey==!0&&C[a].shift==!0&&s.keyCode==C[a].code)return a;if(s.shiftKey==!1&&C[a].shift==!1&&s.keyCode==C[a].code)return a;if(s.keyCode==C[a].code&&a=="shift")return a}return"unknown key, currently not supported"},t.unbind=function(s,a,d){if(d===void 0&&(d="keydown"),C[s]===void 0)throw new Error("unsupported key: "+s);if(a!==void 0){var l=[],h=A[d][C[s].code];if(h!==void 0)for(var c=0;c<h.length;c++)h[c].fn==a&&h[c].shift==C[s].shift||l.push(A[d][C[s].code][c]);A[d][C[s].code]=l}else A[d][C[s].code]=[]},t.reset=function(){A={keydown:{},keyup:{}}},t.destroy=function(){A={keydown:{},keyup:{}},g.removeEventListener("keydown",n,!0),g.removeEventListener("keyup",r,!0)},g.addEventListener("keydown",n,!0),g.addEventListener("keyup",r,!0),t}var Bn=class{constructor(e,g){this.body=e,this.canvas=g,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",()=>{this.activated=!0,this.configureKeyboardBindings()}),this.body.emitter.on("deactivate",()=>{this.activated=!1,this.configureKeyboardBindings()}),this.body.emitter.on("destroy",()=>{this.keycharm!==void 0&&this.keycharm.destroy()}),this.options={}}setOptions(e){e!==void 0&&(this.options=e,this.create())}create(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}cleanNavigation(){if(this.navigationHammers.length!=0){for(let e=0;e<this.navigationHammers.length;e++)this.navigationHammers[e].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}loadNavigationElements(){this.cleanNavigation(),this.navigationDOM={};let e=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],g=["_moveUp","_moveDown","_moveLeft","_moveRight","_zoomIn","_zoomOut","_fit"];this.navigationDOM.wrapper=document.createElement("div"),this.navigationDOM.wrapper.className="vis-navigation",this.canvas.frame.appendChild(this.navigationDOM.wrapper);for(let i=0;i<e.length;i++){this.navigationDOM[e[i]]=document.createElement("div"),this.navigationDOM[e[i]].className="vis-button vis-"+e[i],this.navigationDOM.wrapper.appendChild(this.navigationDOM[e[i]]);let n=new rt(this.navigationDOM[e[i]]);if(g[i]==="_fit"){var t;ZI(n,b(t=this._fit).call(t,this))}else{var A;ZI(n,b(A=this.bindToRedraw).call(A,this,g[i]))}this.navigationHammers.push(n)}let C=new rt(this.canvas.frame);Ph(C,()=>{this._stopMovement()}),this.navigationHammers.push(C),this.iconsCreated=!0}bindToRedraw(e){if(this.boundFunctions[e]===void 0){var g;this.boundFunctions[e]=b(g=this[e]).call(g,this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering")}}unbindFromRedraw(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}_fit(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}_stopMovement(){for(let e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),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(){let e=this.body.view.scale,g=this.body.view.scale*(1+this.options.keyboard.speed.zoom),t=this.body.view.translation,A=g/e,C=(1-A)*this.canvas.canvasViewCenter.x+t.x*A,i=(1-A)*this.canvas.canvasViewCenter.y+t.y*A;this.body.view.scale=g,this.body.view.translation={x:C,y:i},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}_zoomOut(){let e=this.body.view.scale,g=this.body.view.scale/(1+this.options.keyboard.speed.zoom),t=this.body.view.translation,A=g/e,C=(1-A)*this.canvas.canvasViewCenter.x+t.x*A,i=(1-A)*this.canvas.canvasViewCenter.y+t.y*A;this.body.view.scale=g,this.body.view.translation={x:C,y:i},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}configureKeyboardBindings(){if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=Ea({container:window,preventDefault:!0}):this.keycharm=Ea({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var e,g,t,A,C,i,n,r,o,s,a,d,l,h,c,p,u,m,E,w,O,M,k,V;b(e=this.keycharm).call(e,"up",()=>{this.bindToRedraw("_moveUp")},"keydown"),b(g=this.keycharm).call(g,"down",()=>{this.bindToRedraw("_moveDown")},"keydown"),b(t=this.keycharm).call(t,"left",()=>{this.bindToRedraw("_moveLeft")},"keydown"),b(A=this.keycharm).call(A,"right",()=>{this.bindToRedraw("_moveRight")},"keydown"),b(C=this.keycharm).call(C,"=",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(i=this.keycharm).call(i,"num+",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(n=this.keycharm).call(n,"num-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(r=this.keycharm).call(r,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(o=this.keycharm).call(o,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(s=this.keycharm).call(s,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(a=this.keycharm).call(a,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(d=this.keycharm).call(d,"pagedown",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(l=this.keycharm).call(l,"up",()=>{this.unbindFromRedraw("_moveUp")},"keyup"),b(h=this.keycharm).call(h,"down",()=>{this.unbindFromRedraw("_moveDown")},"keyup"),b(c=this.keycharm).call(c,"left",()=>{this.unbindFromRedraw("_moveLeft")},"keyup"),b(p=this.keycharm).call(p,"right",()=>{this.unbindFromRedraw("_moveRight")},"keyup"),b(u=this.keycharm).call(u,"=",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(m=this.keycharm).call(m,"num+",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(E=this.keycharm).call(E,"num-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),b(w=this.keycharm).call(w,"-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),b(O=this.keycharm).call(O,"[",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),b(M=this.keycharm).call(M,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(k=this.keycharm).call(k,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(V=this.keycharm).call(V,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")}}},zn=class{constructor(e,g,t){var A,C,i,n,r,o,s,a,d,l,h,c,p;this.body=e,this.canvas=g,this.selectionHandler=t,this.navigationHandler=new Bn(e,g),this.body.eventListeners.onTap=b(A=this.onTap).call(A,this),this.body.eventListeners.onTouch=b(C=this.onTouch).call(C,this),this.body.eventListeners.onDoubleTap=b(i=this.onDoubleTap).call(i,this),this.body.eventListeners.onHold=b(n=this.onHold).call(n,this),this.body.eventListeners.onDragStart=b(r=this.onDragStart).call(r,this),this.body.eventListeners.onDrag=b(o=this.onDrag).call(o,this),this.body.eventListeners.onDragEnd=b(s=this.onDragEnd).call(s,this),this.body.eventListeners.onMouseWheel=b(a=this.onMouseWheel).call(a,this),this.body.eventListeners.onPinch=b(d=this.onPinch).call(d,this),this.body.eventListeners.onMouseMove=b(l=this.onMouseMove).call(l,this),this.body.eventListeners.onRelease=b(h=this.onRelease).call(h,this),this.body.eventListeners.onContext=b(c=this.onContext).call(c,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=b(p=this.getPointer).call(p,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},q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("destroy",()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer})}setOptions(e){e!==void 0&&(bI(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),De(this.options,e,"keyboard"),e.tooltip&&(q(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=Gi(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-jO(this.canvas.frame.canvas),y:e.y-YO(this.canvas.frame.canvas)}}onTouch(e){new Date().valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}onTap(e){let g=this.getPointer(e.center),t=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(g,t),this.selectionHandler.commitAndEmit(g,e),this.selectionHandler.generateClickEvent("click",e,g)}onDoubleTap(e){let g=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,g)}onHold(e){let g=this.getPointer(e.center),t=this.selectionHandler.options.multiselect;this.checkSelectionChanges(g,t),this.selectionHandler.commitAndEmit(g,e),this.selectionHandler.generateClickEvent("click",e,g),this.selectionHandler.generateClickEvent("hold",e,g)}onRelease(e){if(new Date().valueOf()-this.touchTime>10){let g=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,g),this.touchTime=new Date().valueOf()}}onContext(e){let g=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,g)}checkSelectionChanges(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}_determineDifference(e,g){let t=function(A,C){let i=[];for(let n=0;n<A.length;n++){let r=A[n];G(C).call(C,r)===-1&&i.push(r)}return i};return{nodes:t(e.nodes,g.nodes),edges:t(e.edges,g.edges)}}onDragStart(e){if(this.drag.dragging)return;this.drag.pointer===void 0&&this.onTouch(e);let g=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=q({},this.body.view.translation),this.drag.nodeId=void 0,e.srcEvent.shiftKey){this.body.selectionBox.show=!0;let t=this.getPointer(e.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)}}else if(g!==void 0&&this.options.dragNodes===!0){this.drag.nodeId=g.id,g.isSelected()===!1&&this.selectionHandler.setSelection({nodes:[g.id]}),this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer);for(let t of this.selectionHandler.getSelectedNodes()){let A={id:t.id,node:t,x:t.x,y:t.y,xFixed:t.options.fixed.x,yFixed:t.options.fixed.y};t.options.fixed.x=!0,t.options.fixed.y=!0,this.drag.selection.push(A)}}else this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer,void 0,!0)}onDrag(e){if(this.drag.pinched===!0)return;this.body.emitter.emit("unlockNode");let g=this.getPointer(e.center),t=this.drag.selection;if(t&&t.length&&this.options.dragNodes===!0){this.selectionHandler.generateClickEvent("dragging",e,g);let A=g.x-this.drag.pointer.x,C=g.y-this.drag.pointer.y;F(t).call(t,i=>{let n=i.node;i.xFixed===!1&&(n.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(i.x)+A)),i.yFixed===!1&&(n.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(i.y)+C))}),this.body.emitter.emit("startSimulation")}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,g,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(g.x),y:this.canvas._YconvertDOMtoCanvas(g.y)},this.body.emitter.emit("_requestRedraw")}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,g,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}let A=g.x-this.drag.pointer.x,C=g.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+A,y:this.drag.translation.y+C},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(e){if(this.drag.dragging=!1,this.body.selectionBox.show){var g;this.body.selectionBox.show=!1;let t=this.body.selectionBox.position,A={minX:Math.min(t.start.x,t.end.x),minY:Math.min(t.start.y,t.end.y),maxX:Math.max(t.start.x,t.end.x),maxY:Math.max(t.start.y,t.end.y)},C=te(g=this.body.nodeIndices).call(g,n=>{let r=this.body.nodes[n];return r.x>=A.minX&&r.x<=A.maxX&&r.y>=A.minY&&r.y<=A.maxY});F(C).call(C,n=>this.selectionHandler.selectObject(this.body.nodes[n]));let i=this.getPointer(e.center);this.selectionHandler.commitAndEmit(i,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{let t=this.drag.selection;t&&t.length?(F(t).call(t,function(A){A.node.options.fixed.x=A.xFixed,A.node.options.fixed.y=A.yFixed}),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}onPinch(e){let g=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);let t=this.pinch.scale*e.scale;this.zoom(t,g)}zoom(e,g){if(this.options.zoomView===!0){let t=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);let A;this.drag!==void 0&&this.drag.dragging===!0&&(A=this.canvas.DOMtoCanvas(this.drag.pointer));let C=this.body.view.translation,i=e/t,n=(1-i)*g.x+C.x*i,r=(1-i)*g.y+C.y*i;if(this.body.view.scale=e,this.body.view.translation={x:n,y:r},A!=null){let o=this.canvas.canvasToDOM(A);this.drag.pointer.x=o.x,this.drag.pointer.y=o.y}this.body.emitter.emit("_requestRedraw"),t<e?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:g}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:g})}}onMouseWheel(e){if(this.options.zoomView===!0){if(e.deltaY!==0){let g=this.body.view.scale;g*=1+(e.deltaY<0?1:-1)*(this.options.zoomSpeed*.1);let t=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(g,t)}e.preventDefault()}}onMouseMove(e){let g=this.getPointer({x:e.clientX,y:e.clientY}),t=!1;this.popup!==void 0&&(this.popup.hidden===!1&&this._checkHidePopup(g),this.popup.hidden===!1&&(t=!0,this.popup.setPosition(g.x+3,g.y-5),this.popup.show())),this.options.keyboard.autoFocus&&this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),t===!1&&(this.popupTimer!==void 0&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=He(()=>this._checkShowPopup(g),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,g)}_checkShowPopup(e){let g=this.canvas._XconvertDOMtoCanvas(e.x),t=this.canvas._YconvertDOMtoCanvas(e.y),A={left:g,top:t,right:g,bottom:t},C=this.popupObj===void 0?void 0:this.popupObj.id,i=!1,n="node";if(this.popupObj===void 0){let r=this.body.nodeIndices,o=this.body.nodes,s,a=[];for(let d=0;d<r.length;d++)s=o[r[d]],s.isOverlappingWith(A)===!0&&(i=!0,s.getTitle()!==void 0&&a.push(r[d]));a.length>0&&(this.popupObj=o[a[a.length-1]],i=!0)}if(this.popupObj===void 0&&i===!1){let r=this.body.edgeIndices,o=this.body.edges,s,a=[];for(let d=0;d<r.length;d++)s=o[r[d]],s.isOverlappingWith(A)===!0&&s.connected===!0&&s.getTitle()!==void 0&&a.push(r[d]);a.length>0&&(this.popupObj=o[a[a.length-1]],n="edge")}this.popupObj!==void 0?this.popupObj.id!==C&&(this.popup===void 0&&(this.popup=new e1(this.canvas.frame)),this.popup.popupTargetType=n,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}_checkHidePopup(e){let g=this.selectionHandler._pointerToPositionObject(e),t=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(t=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(g),t===!0)){let A=this.selectionHandler.getNodeAt(e);t=A===void 0?!1:A.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(t=this.body.edges[this.popup.popupTargetId].isOverlappingWith(g));t===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}},Qk=Z,Ta=Pr,qA=nC.getWeakData,Xk=xr,Jk=ag,$k=ft,ai=ce,qk=Tr,Dh=Ng,xa=ne,Nh=Kg,eM=Nh.set,gM=Nh.getterFor,tM=Dh.find,AM=Dh.findIndex,IM=Qk([].splice),CM=0,eI=function(I){return I.frozen||(I.frozen=new Rh)},Rh=function(){this.entries=[]},di=function(I,e){return tM(I.entries,function(g){return g[0]===e})};Rh.prototype={get:function(I){var e=di(this,I);if(e)return e[1]},has:function(I){return!!di(this,I)},set:function(I,e){var g=di(this,I);g?g[1]=e:this.entries.push([I,e])},delete:function(I){var e=AM(this.entries,function(g){return g[0]===I});return~e&&IM(this.entries,e,1),!!~e}};var iM={getConstructor:function(I,e,g,t){var A=I(function(r,o){Xk(r,C),eM(r,{type:e,id:CM++,frozen:void 0}),$k(o)||qk(o,r[t],{that:r,AS_ENTRIES:g})}),C=A.prototype,i=gM(e),n=function(r,o,s){var a=i(r),d=qA(Jk(o),!0);return d===!0?eI(a).set(o,s):d[a.id]=s,r};return Ta(C,{delete:function(r){var o=i(this);if(!ai(r))return!1;var s=qA(r);return s===!0?eI(o).delete(r):s&&xa(s,o.id)&&delete s[o.id]},has:function(o){var s=i(this);if(!ai(o))return!1;var a=qA(o);return a===!0?eI(s).has(o):a&&xa(a,s.id)}}),Ta(C,g?{get:function(o){var s=i(this);if(ai(o)){var a=qA(o);return a===!0?eI(s).get(o):a?a[s.id]:void 0}},set:function(o,s){return n(this,o,s)}}:{add:function(o){return n(this,o,!0)}}),A}},nM=Jl,Oa=X,sI=Z,Pa=Pr,rM=nC,oM=Or,Sh=iM,gI=ce,tI=Kg.enforce,sM=z,aM=hd,kA=Object,dM=Array.isArray,AI=kA.isExtensible,kh=kA.isFrozen,lM=kA.isSealed,Mh=kA.freeze,hM=kA.seal,Da={},Na={},cM=!Oa.ActiveXObject&&"ActiveXObject"in Oa,kt,Fh=function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},Bh=oM("WeakMap",Fh,Sh),At=Bh.prototype,aI=sI(At.set),uM=function(){return nM&&sM(function(){var I=Mh([]);return aI(new Bh,I,1),!kh(I)})};aM&&(cM?(kt=Sh.getConstructor(Fh,"WeakMap",!0),rM.enable(),li=sI(At.delete),Mt=sI(At.has),hi=sI(At.get),Pa(At,{delete:function(I){if(gI(I)&&!AI(I)){var e=tI(this);return e.frozen||(e.frozen=new kt),li(this,I)||e.frozen.delete(I)}return li(this,I)},has:function(e){if(gI(e)&&!AI(e)){var g=tI(this);return g.frozen||(g.frozen=new kt),Mt(this,e)||g.frozen.has(e)}return Mt(this,e)},get:function(e){if(gI(e)&&!AI(e)){var g=tI(this);return g.frozen||(g.frozen=new kt),Mt(this,e)?hi(this,e):g.frozen.get(e)}return hi(this,e)},set:function(e,g){if(gI(e)&&!AI(e)){var t=tI(this);t.frozen||(t.frozen=new kt),Mt(this,e)?aI(this,e,g):t.frozen.set(e,g)}else aI(this,e,g);return this}})):uM()&&Pa(At,{set:function(e,g){var t;return dM(e)&&(kh(e)?t=Da:lM(e)&&(t=Na)),aI(this,e,g),t===Da&&Mh(e),t===Na&&hM(e),this}}));var li,Mt,hi,fM=L,pM=fM.WeakMap,mM=pM,vM=mM,bM=vM,Yt=D(bM);function W(I,e,g,t){if(g==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?I!==e||!t:!e.has(I))throw new TypeError("Cannot read private member from an object whose class did not declare it");return g==="m"?t:g==="a"?t.call(I):t?t.value:e.get(I)}function Zn(I,e,g,t,A){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!A)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?I!==e||!A:!e.has(I))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?A.call(I,g):A?A.value=g:e.set(I,g),g}var Sg,Pe,cg,ug,dI;function Ra(I,e){let g=new Le;for(let t of e)I.has(t)||g.add(t);return g}var LI=class{constructor(){Sg.set(this,new Le),Pe.set(this,new Le)}get size(){return W(this,Pe,"f").size}add(){for(var e=arguments.length,g=new Array(e),t=0;t<e;t++)g[t]=arguments[t];for(let A of g)W(this,Pe,"f").add(A)}delete(){for(var e=arguments.length,g=new Array(e),t=0;t<e;t++)g[t]=arguments[t];for(let A of g)W(this,Pe,"f").delete(A)}clear(){W(this,Pe,"f").clear()}getSelection(){return[...W(this,Pe,"f")]}getChanges(){return{added:[...Ra(W(this,Sg,"f"),W(this,Pe,"f"))],deleted:[...Ra(W(this,Pe,"f"),W(this,Sg,"f"))],previous:[...new Le(W(this,Sg,"f"))],current:[...new Le(W(this,Pe,"f"))]}}commit(){let e=this.getChanges();Zn(this,Sg,W(this,Pe,"f"),"f"),Zn(this,Pe,new Le(W(this,Sg,"f")),"f");for(let g of e.added)g.select();for(let g of e.deleted)g.unselect();return e}};Sg=new Yt,Pe=new Yt;var Ln=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};cg.set(this,new LI),ug.set(this,new LI),dI.set(this,void 0),Zn(this,dI,e,"f")}get sizeNodes(){return W(this,cg,"f").size}get sizeEdges(){return W(this,ug,"f").size}getNodes(){return W(this,cg,"f").getSelection()}getEdges(){return W(this,ug,"f").getSelection()}addNodes(){W(this,cg,"f").add(...arguments)}addEdges(){W(this,ug,"f").add(...arguments)}deleteNodes(e){W(this,cg,"f").delete(e)}deleteEdges(e){W(this,ug,"f").delete(e)}clear(){W(this,cg,"f").clear(),W(this,ug,"f").clear()}commit(){let e={nodes:W(this,cg,"f").commit(),edges:W(this,ug,"f").commit()};for(var g=arguments.length,t=new Array(g),A=0;A<g;A++)t[A]=arguments[A];return W(this,dI,"f").call(this,e,...t),e}};cg=new Yt,ug=new Yt,dI=new Yt;var Gn=class{constructor(e,g){this.body=e,this.canvas=g,this._selectionAccumulator=new Ln,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},q(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",()=>{this.updateSelection()})}setOptions(e){e!==void 0&&xt(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,e)}selectOnPoint(e){let g=!1;if(this.options.selectable===!0){let t=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),t!==void 0&&(g=this.selectObject(t)),this.body.emitter.emit("_requestRedraw")}return g}selectAdditionalOnPoint(e){let g=!1;if(this.options.selectable===!0){let t=this.getNodeAt(e)||this.getEdgeAt(e);t!==void 0&&(g=!0,t.isSelected()===!0?this.deselectObject(t):this.selectObject(t),this.body.emitter.emit("_requestRedraw"))}return g}_initBaseEvent(e,g){let t={};return t.pointer={DOM:{x:g.x,y:g.y},canvas:this.canvas.DOMtoCanvas(g)},t.event=e,t}generateClickEvent(e,g,t,A){let C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,i=this._initBaseEvent(g,t);if(C===!0)i.nodes=[],i.edges=[];else{let n=this.getSelection();i.nodes=n.nodes,i.edges=n.edges}A!==void 0&&(i.previousSelection=A),e=="click"&&(i.items=this.getClickedItems(t)),g.controlEdge!==void 0&&(i.controlEdge=g.controlEdge),this.body.emitter.emit(e,i)}selectObject(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return e!==void 0?(e instanceof pe?(g===!0&&this._selectionAccumulator.addEdges(...e.edges),this._selectionAccumulator.addNodes(e)):this._selectionAccumulator.addEdges(e),!0):!1}deselectObject(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}_getAllNodesOverlappingWith(e){let g=[],t=this.body.nodes;for(let A=0;A<this.body.nodeIndices.length;A++){let C=this.body.nodeIndices[A];t[C].isOverlappingWith(e)&&g.push(C)}return g}_pointerToPositionObject(e){let g=this.canvas.DOMtoCanvas(e);return{left:g.x-1,top:g.y+1,right:g.x+1,bottom:g.y-1}}getNodeAt(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this._pointerToPositionObject(e),A=this._getAllNodesOverlappingWith(t);if(A.length>0)return g===!0?this.body.nodes[A[A.length-1]]:A[A.length-1]}_getEdgesOverlappingWith(e,g){let t=this.body.edges;for(let A=0;A<this.body.edgeIndices.length;A++){let C=this.body.edgeIndices[A];t[C].isOverlappingWith(e)&&g.push(C)}}_getAllEdgesOverlappingWith(e){let g=[];return this._getEdgesOverlappingWith(e,g),g}getEdgeAt(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this.canvas.DOMtoCanvas(e),A=10,C=null,i=this.body.edges;for(let n=0;n<this.body.edgeIndices.length;n++){let r=this.body.edgeIndices[n],o=i[r];if(o.connected){let s=o.from.x,a=o.from.y,d=o.to.x,l=o.to.y,h=o.edgeType.getDistanceToEdge(s,a,d,l,t.x,t.y);h<A&&(C=r,A=h)}}if(C!==null)return g===!0?this.body.edges[C]:C}_addToHover(e){e instanceof pe?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}_removeFromSelection(e){e instanceof pe?(this._selectionAccumulator.deleteNodes(e),this._selectionAccumulator.deleteEdges(...e.edges)):this._selectionAccumulator.deleteEdges(e)}unselectAll(){this._selectionAccumulator.clear()}getSelectedNodeCount(){return this._selectionAccumulator.sizeNodes}getSelectedEdgeCount(){return this._selectionAccumulator.sizeEdges}_hoverConnectedEdges(e){for(let g=0;g<e.edges.length;g++){let t=e.edges[g];t.hover=!0,this._addToHover(t)}}emitBlurEvent(e,g,t){let A=this._initBaseEvent(e,g);t.hover===!0&&(t.hover=!1,t instanceof pe?(A.node=t.id,this.body.emitter.emit("blurNode",A)):(A.edge=t.id,this.body.emitter.emit("blurEdge",A)))}emitHoverEvent(e,g,t){let A=this._initBaseEvent(e,g),C=!1;return t.hover===!1&&(t.hover=!0,this._addToHover(t),C=!0,t instanceof pe?(A.node=t.id,this.body.emitter.emit("hoverNode",A)):(A.edge=t.id,this.body.emitter.emit("hoverEdge",A))),C}hoverObject(e,g){let t=this.getNodeAt(g);t===void 0&&(t=this.getEdgeAt(g));let A=!1;for(let C in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,C)&&(t===void 0||t instanceof pe&&t.id!=C||t instanceof Og)&&(this.emitBlurEvent(e,g,this.hoverObj.nodes[C]),delete this.hoverObj.nodes[C],A=!0);for(let C in this.hoverObj.edges)Object.prototype.hasOwnProperty.call(this.hoverObj.edges,C)&&(A===!0?(this.hoverObj.edges[C].hover=!1,delete this.hoverObj.edges[C]):(t===void 0||t instanceof Og&&t.id!=C||t instanceof pe&&!t.hover)&&(this.emitBlurEvent(e,g,this.hoverObj.edges[C]),delete this.hoverObj.edges[C],A=!0));if(t!==void 0){let C=U(this.hoverObj.edges).length,i=U(this.hoverObj.nodes).length,n=t instanceof Og&&C===0&&i===0,r=t instanceof pe&&C===0&&i===0;(A||n||r)&&(A=this.emitHoverEvent(e,g,t)),t instanceof pe&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(t)}A===!0&&this.body.emitter.emit("_requestRedraw")}commitWithoutEmitting(){this._selectionAccumulator.commit()}commitAndEmit(e,g){let t=!1,A=this._selectionAccumulator.commit(),C={nodes:A.nodes.previous,edges:A.edges.previous};A.edges.deleted.length>0&&(this.generateClickEvent("deselectEdge",g,e,C),t=!0),A.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",g,e,C),t=!0),A.nodes.added.length>0&&(this.generateClickEvent("selectNode",g,e),t=!0),A.edges.added.length>0&&(this.generateClickEvent("selectEdge",g,e),t=!0),t===!0&&this.generateClickEvent("select",g,e)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var e;return ae(e=this._selectionAccumulator.getNodes()).call(e,g=>g.id)}getSelectedEdgeIds(){var e;return ae(e=this._selectionAccumulator.getEdges()).call(e,g=>g.id)}setSelection(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((g.unselectAll||g.unselectAll===void 0)&&this.unselectAll(),e.nodes)for(let t of e.nodes){let A=this.body.nodes[t];if(!A)throw new RangeError('Node with id "'+t+'" not found');this.selectObject(A,g.highlightEdges)}if(e.edges)for(let t of e.edges){let A=this.body.edges[t];if(!A)throw new RangeError('Edge with id "'+t+'" not found');this.selectObject(A)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:g})}selectEdges(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}updateSelection(){for(let e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(let e in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,e.id)||this._selectionAccumulator.deleteEdges(e)}getClickedItems(e){let g=this.canvas.DOMtoCanvas(e),t=[],A=this.body.nodeIndices,C=this.body.nodes;for(let r=A.length-1;r>=0;r--){let s=C[A[r]].getItemsOnPoint(g);t.push.apply(t,s)}let i=this.body.edgeIndices,n=this.body.edges;for(let r=i.length-1;r>=0;r--){let s=n[i[r]].getItemsOnPoint(g);t.push.apply(t,s)}return t}},GI=class{abstract(){throw new Error("Can't instantiate abstract class!")}fake_use(){}curveType(){return this.abstract()}getPosition(e){return this.fake_use(e),this.abstract()}setPosition(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,g,t),this.abstract()}getTreeSize(e){return this.fake_use(e),this.abstract()}sort(e){this.fake_use(e),this.abstract()}fix(e,g){this.fake_use(e,g),this.abstract()}shift(e,g){this.fake_use(e,g),this.abstract()}},Vn=class extends GI{constructor(e){super(),this.layout=e}curveType(){return"horizontal"}getPosition(e){return e.x}setPosition(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;t!==void 0&&this.layout.hierarchical.addToOrdering(e,t),e.x=g}getTreeSize(e){let g=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:g.min_x,max:g.max_x}}sort(e){Cg(e).call(e,function(g,t){return g.x-t.x})}fix(e,g){e.y=this.layout.options.hierarchical.levelSeparation*g,e.options.fixed.y=!0}shift(e,g){this.layout.body.nodes[e].x+=g}},jn=class extends GI{constructor(e){super(),this.layout=e}curveType(){return"vertical"}getPosition(e){return e.y}setPosition(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;t!==void 0&&this.layout.hierarchical.addToOrdering(e,t),e.y=g}getTreeSize(e){let g=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:g.min_y,max:g.max_y}}sort(e){Cg(e).call(e,function(g,t){return g.y-t.y})}fix(e,g){e.x=this.layout.options.hierarchical.levelSeparation*g,e.options.fixed.x=!0}shift(e,g){this.layout.body.nodes[e].y+=g}},yM=N,wM=Ng.every,EM=wt,TM=EM("every");yM({target:"Array",proto:!0,forced:!TM},{every:function(e){return wM(this,e,arguments.length>1?arguments[1]:void 0)}});var xM=Ie,OM=xM("Array").every,PM=J,DM=OM,ci=Array.prototype,NM=function(I){var e=I.every;return I===ci||PM(ci,I)&&e===ci.every?DM:e},RM=NM,SM=RM,kM=SM,zh=D(kM);function MM(I,e){let g=new Le;return F(I).call(I,t=>{var A;F(A=t.edges).call(A,C=>{C.connected&&g.add(C)})}),F(g).call(g,t=>{let A=t.from.id,C=t.to.id;e[A]==null&&(e[A]=0),(e[C]==null||e[A]>=e[C])&&(e[C]=e[A]+1)}),e}function FM(I){return Zh(e=>{var g,t;return zh(g=te(t=e.edges).call(t,A=>I.has(A.toId))).call(g,A=>A.to===e)},(e,g)=>g>e,"from",I)}function BM(I){return Zh(e=>{var g,t;return zh(g=te(t=e.edges).call(t,A=>I.has(A.toId))).call(g,A=>A.from===e)},(e,g)=>g<e,"to",I)}function Zh(I,e,g,t){var A;let C=Eg(null),i=Rr(A=[...EI(t).call(t)]).call(A,(a,d)=>a+1+d.edges.length,0),n=g+"Id",r=g==="to"?1:-1;for(let[a,d]of t){if(!t.has(a)||!I(d))continue;C[a]=0;let l=[d],h=0,c;for(;c=l.pop();){var o,s;if(!t.has(a))continue;let p=C[c.id]+r;if(F(o=te(s=c.edges).call(s,u=>u.connected&&u.to!==u.from&&u[g]!==c&&t.has(u.toId)&&t.has(u.fromId))).call(o,u=>{let m=u[n],E=C[m];(E==null||e(p,E))&&(C[m]=p,l.push(u[g]))}),h>i)return MM(t,C);++h}}return C}var Yn=class{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(e,g){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(g),this.parentReference[g]===void 0&&(this.parentReference[g]=[]),this.parentReference[g].push(e)}checkIfTree(){for(let e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(e,g){g!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=g,this.treeIndex=Math.max(g,this.treeIndex))}ensureLevel(e){this.levels[e]===void 0&&(this.levels[e]=0)}getMaxLevel(e){let g={},t=A=>{if(g[A]!==void 0)return g[A];let C=this.levels[A];if(this.childrenReference[A]){let i=this.childrenReference[A];if(i.length>0)for(let n=0;n<i.length;n++)C=Math.max(C,t(i[n]))}return g[A]=C,C};return t(e)}levelDownstream(e,g){this.levels[g.id]===void 0&&(this.levels[e.id]===void 0&&(this.levels[e.id]=0),this.levels[g.id]=this.levels[e.id]+1)}setMinLevelToZero(){var e;let g=new NA,t=0,A=Cg(e=[...new Le(yT(this.levels))]).call(e,(C,i)=>C-i);for(let C of A)g.set(C,t++);for(let C in this.levels)Object.prototype.hasOwnProperty.call(this.levels,C)&&(this.levels[C]=g.get(this.levels[C]))}getTreeSize(e,g){let t=1e9,A=-1e9,C=1e9,i=-1e9;for(let n in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,n)&&this.trees[n]===g){let r=e[n];t=Math.min(r.x,t),A=Math.max(r.x,A),C=Math.min(r.y,C),i=Math.max(r.y,i)}return{min_x:t,max_x:A,min_y:C,max_y:i}}hasSameParent(e,g){let t=this.parentReference[e.id],A=this.parentReference[g.id];if(t===void 0||A===void 0)return!1;for(let C=0;C<t.length;C++)for(let i=0;i<A.length;i++)if(t[C]==A[i])return!0;return!1}inSameSubNetwork(e,g){return this.trees[e.id]===this.trees[g.id]}getLevels(){return U(this.distributionOrdering)}addToOrdering(e,g){this.distributionOrdering[g]===void 0&&(this.distributionOrdering[g]=[]);let t=!1,A=this.distributionOrdering[g];for(let C in A)if(A[C]===e){t=!0;break}t||(this.distributionOrdering[g].push(e),this.distributionIndex[e.id]=this.distributionOrdering[g].length-1)}},Wn=class{constructor(e){this.body=e,this._resetRNG(Math.random()+":"+uI()),this.setPhysics=!1,this.options={},this.optionsBackup={physics:{}},this.defaultOptions={randomSeed:void 0,improvedLayout:!0,clusterThreshold:150,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:"UD",sortMethod:"hubsize"}},q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("_dataChanged",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",()=>{this.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",()=>{if(this.options.hierarchical.enabled!==!0)return;let e=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",e,!1)})}setOptions(e,g){if(e!==void 0){let t=this.options.hierarchical,A=t.enabled;if(xt(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),De(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),t.enabled===!0)return A===!0&&this.body.emitter.emit("refresh",!0),t.direction==="RL"||t.direction==="DU"?t.levelSeparation>0&&(t.levelSeparation*=-1):t.levelSeparation<0&&(t.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(g);if(A===!0)return this.body.emitter.emit("refresh"),_(g,this.optionsBackup)}return g}_resetRNG(e){this.initialRandomSeed=e,this._rng=iC(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(e){if(this.options.hierarchical.enabled===!0){let g=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:g.enabled===void 0?!0:g.enabled,solver:"hierarchicalRepulsion"},g.enabled=g.enabled===void 0?!0:g.enabled,g.solver=g.solver||"barnesHut"):typeof e.physics=="object"?(g.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,g.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(g.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});let t=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if(typeof e.edges.smooth=="boolean")this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:t};else{let A=e.edges.smooth;A.type!==void 0&&A.type!=="dynamic"&&(t=A.type),this.optionsBackup.edges={smooth:{enabled:A.enabled===void 0?!0:A.enabled,type:A.type===void 0?"dynamic":A.type,roundness:A.roundness===void 0?.5:A.roundness,forceDirection:A.forceDirection===void 0?!1:A.forceDirection}},e.edges.smooth={enabled:A.enabled===void 0?!0:A.enabled,type:t,roundness:A.roundness===void 0?.5:A.roundness,forceDirection:A.forceDirection===void 0?!1:A.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",t)}return e}positionInitially(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);let g=e.length+50;for(let t=0;t<e.length;t++){let A=e[t],C=2*Math.PI*this._rng();A.x===void 0&&(A.x=g*Math.cos(C)),A.y===void 0&&(A.y=g*Math.sin(C))}}}layoutNetwork(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){let e=this.body.nodeIndices,g=0;for(let t=0;t<e.length;t++)this.body.nodes[e[t]].predefinedPosition===!0&&(g+=1);if(g<.5*e.length){let A=0,C=this.options.clusterThreshold,i={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(e.length>C){let r=e.length;for(;e.length>C&&A<=10;){A+=1;let o=e.length;A%3===0?this.body.modules.clustering.clusterBridges(i):this.body.modules.clustering.clusterOutliers(i);let s=e.length;if(o==s&&A%3!==0){this._declusterAll(),this.body.emitter.emit("_layoutFailed"),console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*r)})}A>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();let n=70;for(let r=0;r<e.length;r++){let o=this.body.nodes[e[r]];o.predefinedPosition===!1&&(o.x+=(.5-this._rng())*n,o.y+=(.5-this._rng())*n)}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}_shiftToCenter(){let e=de.getRangeCore(this.body.nodes,this.body.nodeIndices),g=de.findCenter(e);for(let t=0;t<this.body.nodeIndices.length;t++){let A=this.body.nodes[this.body.nodeIndices[t]];A.x-=g.x,A.y-=g.y}}_declusterAll(){let e=!0;for(;e===!0;){e=!1;for(let g=0;g<this.body.nodeIndices.length;g++)this.body.nodes[this.body.nodeIndices[g]].isCluster===!0&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[g],{},!1));e===!0&&this.body.emitter.emit("_dataChanged")}}getSeed(){return this.initialRandomSeed}setupHierarchicalLayout(){if(this.options.hierarchical.enabled===!0&&this.body.nodeIndices.length>0){let e,g,t=!1,A=!1;this.lastNodeOnLevel={},this.hierarchical=new Yn;for(g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&(e=this.body.nodes[g],e.options.level!==void 0?(t=!0,this.hierarchical.levels[g]=e.options.level):A=!0);if(A===!0&&t===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");{if(A===!0){let i=this.options.hierarchical.sortMethod;i==="hubsize"?this._determineLevelsByHubsize():i==="directed"?this._determineLevelsDirected():i==="custom"&&this._determineLevelsCustomCallback()}for(let i in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,i)&&this.hierarchical.ensureLevel(i);let C=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(C),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var e=this;let g=!1,t={},A=()=>{let u=i(),m=0;for(let E=0;E<u.length-1;E++){let w=u[E].max-u[E+1].min;m+=w+this.options.hierarchical.treeSpacing,C(E+1,m)}},C=(u,m)=>{let E=this.hierarchical.trees;for(let w in E)Object.prototype.hasOwnProperty.call(E,w)&&E[w]===u&&this.direction.shift(w,m)},i=()=>{let u=[];for(let m=0;m<this.hierarchical.numTrees();m++)u.push(this.direction.getTreeSize(m));return u},n=(u,m)=>{if(!m[u.id]&&(m[u.id]=!0,this.hierarchical.childrenReference[u.id])){let E=this.hierarchical.childrenReference[u.id];if(E.length>0)for(let w=0;w<E.length;w++)n(this.body.nodes[E[w]],m)}},r=function(u){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,E=1e9,w=1e9,O=1e9,M=-1e9;for(let k in u)if(Object.prototype.hasOwnProperty.call(u,k)){let V=e.body.nodes[k],ye=e.hierarchical.levels[V.id],ue=e.direction.getPosition(V),[Hg,Qg]=e._getSpaceAroundNode(V,u);E=Math.min(Hg,E),w=Math.min(Qg,w),ye<=m&&(O=Math.min(ue,O),M=Math.max(ue,M))}return[O,M,E,w]},o=(u,m)=>{let E=this.hierarchical.getMaxLevel(u.id),w=this.hierarchical.getMaxLevel(m.id);return Math.min(E,w)},s=(u,m,E)=>{let w=this.hierarchical;for(let O=0;O<m.length;O++){let M=m[O],k=w.distributionOrdering[M];if(k.length>1)for(let V=0;V<k.length-1;V++){let ye=k[V],ue=k[V+1];w.hasSameParent(ye,ue)&&w.inSameSubNetwork(ye,ue)&&u(ye,ue,E)}}},a=function(u,m){let E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,w=e.direction.getPosition(u),O=e.direction.getPosition(m),M=Math.abs(O-w),k=e.options.hierarchical.nodeSpacing;if(M>k){let V={},ye={};n(u,V),n(m,ye);let ue=o(u,m),Hg=r(V,ue),Qg=r(ye,ue),MA=Hg[1],Xg=Qg[0],Ce=Qg[2];if(Math.abs(MA-Xg)>k){let Y=MA-Xg+k;Y<-Ce+k&&(Y=-Ce+k),Y<0&&(e._shiftBlock(m.id,Y),g=!0,E===!0&&e._centerParent(m))}}},d=(u,m)=>{let E=m.id,w=m.edges,O=this.hierarchical.levels[m.id],M=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,k={},V=[];for(let Ce=0;Ce<w.length;Ce++){let j=w[Ce];if(j.toId!=j.fromId){let Y=j.toId==E?j.from:j.to;k[w[Ce].id]=Y,this.hierarchical.levels[Y.id]<O&&V.push(j)}}let ye=(Ce,j)=>{let Y=0;for(let he=0;he<j.length;he++)if(k[j[he].id]!==void 0){let fe=this.direction.getPosition(k[j[he].id])-Ce;Y+=fe/Math.sqrt(fe*fe+M)}return Y},ue=(Ce,j)=>{let Y=0;for(let he=0;he<j.length;he++)if(k[j[he].id]!==void 0){let fe=this.direction.getPosition(k[j[he].id])-Ce;Y-=M*Math.pow(fe*fe+M,-1.5)}return Y},Hg=(Ce,j)=>{let Y=this.direction.getPosition(m),he={};for(let fe=0;fe<Ce;fe++){let Me=ye(Y,j),Jg=ue(Y,j),Ot=40,jh=Math.max(-Ot,Math.min(Ot,Math.round(Me/Jg)));if(Y=Y-jh,he[Y]!==void 0)break;he[Y]=fe}return Y},Qg=Ce=>{let j=this.direction.getPosition(m);if(t[m.id]===void 0){let Ot={};n(m,Ot),t[m.id]=Ot}let Y=r(t[m.id]),he=Y[2],fe=Y[3],Me=Ce-j,Jg=0;Me>0?Jg=Math.min(Me,fe-this.options.hierarchical.nodeSpacing):Me<0&&(Jg=-Math.min(-Me,he-this.options.hierarchical.nodeSpacing)),Jg!=0&&(this._shiftBlock(m.id,Jg),g=!0)},MA=Ce=>{let j=this.direction.getPosition(m),[Y,he]=this._getSpaceAroundNode(m),fe=Ce-j,Me=j;fe>0?Me=Math.min(j+(he-this.options.hierarchical.nodeSpacing),Ce):fe<0&&(Me=Math.max(j-(Y-this.options.hierarchical.nodeSpacing),Ce)),Me!==j&&(this.direction.setPosition(m,Me),g=!0)},Xg=Hg(u,V);Qg(Xg),Xg=Hg(u,w),MA(Xg)},l=u=>{let m=this.hierarchical.getLevels();m=zg(m).call(m);for(let E=0;E<u;E++){g=!1;for(let w=0;w<m.length;w++){let O=m[w],M=this.hierarchical.distributionOrdering[O];for(let k=0;k<M.length;k++)d(1e3,M[k])}if(g!==!0)break}},h=u=>{let m=this.hierarchical.getLevels();m=zg(m).call(m);for(let E=0;E<u&&(g=!1,s(a,m,!0),g===!0);E++);},c=()=>{for(let u in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,u)&&this._centerParent(this.body.nodes[u])},p=()=>{let u=this.hierarchical.getLevels();u=zg(u).call(u);for(let m=0;m<u.length;m++){let E=u[m],w=this.hierarchical.distributionOrdering[E];for(let O=0;O<w.length;O++)this._centerParent(w[O])}};this.options.hierarchical.blockShifting===!0&&(h(5),c()),this.options.hierarchical.edgeMinimization===!0&&l(20),this.options.hierarchical.parentCentralization===!0&&p(),A()}_getSpaceAroundNode(e,g){let t=!0;g===void 0&&(t=!1);let A=this.hierarchical.levels[e.id];if(A!==void 0){let C=this.hierarchical.distributionIndex[e.id],i=this.direction.getPosition(e),n=this.hierarchical.distributionOrdering[A],r=1e9,o=1e9;if(C!==0){let s=n[C-1];if(t===!0&&g[s.id]===void 0||t===!1){let a=this.direction.getPosition(s);r=i-a}}if(C!=n.length-1){let s=n[C+1];if(t===!0&&g[s.id]===void 0||t===!1){let a=this.direction.getPosition(s);o=Math.min(o,a-i)}}return[r,o]}else return[0,0]}_centerParent(e){if(this.hierarchical.parentReference[e.id]){let g=this.hierarchical.parentReference[e.id];for(let t=0;t<g.length;t++){let A=g[t],C=this.body.nodes[A],i=this.hierarchical.childrenReference[A];if(i!==void 0){let n=this._getCenterPosition(i),r=this.direction.getPosition(C),[o,s]=this._getSpaceAroundNode(C),a=r-n;(a<0&&Math.abs(a)<s-this.options.hierarchical.nodeSpacing||a>0&&Math.abs(a)<o-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(C,n)}}}}_placeNodesByHierarchy(e){this.positionedNodes={};for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var g;let A=U(e[t]);A=this._indexArrayToNodes(A),Cg(g=this.direction).call(g,A);let C=0;for(let i=0;i<A.length;i++){let n=A[i];if(this.positionedNodes[n.id]===void 0){let r=this.options.hierarchical.nodeSpacing,o=r*C;C>0&&(o=this.direction.getPosition(A[i-1])+r),this.direction.setPosition(n,o,t),this._validatePositionAndContinue(n,t,o),C++}}}}_placeBranchNodes(e,g){var t;let A=this.hierarchical.childrenReference[e];if(A===void 0)return;let C=[];for(let n=0;n<A.length;n++)C.push(this.body.nodes[A[n]]);Cg(t=this.direction).call(t,C);for(let n=0;n<C.length;n++){let r=C[n],o=this.hierarchical.levels[r.id];if(o>g&&this.positionedNodes[r.id]===void 0){let s=this.options.hierarchical.nodeSpacing,a;n===0?a=this.direction.getPosition(this.body.nodes[e]):a=this.direction.getPosition(C[n-1])+s,this.direction.setPosition(r,a,o),this._validatePositionAndContinue(r,o,a)}else return}let i=this._getCenterPosition(C);this.direction.setPosition(this.body.nodes[e],i,g)}_validatePositionAndContinue(e,g,t){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[g]!==void 0){let A=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[g]]);if(t-A<this.options.hierarchical.nodeSpacing){let C=A+this.options.hierarchical.nodeSpacing-t,i=this._findCommonParent(this.lastNodeOnLevel[g],e.id);this._shiftBlock(i.withChild,C)}}this.lastNodeOnLevel[g]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,g)}}_indexArrayToNodes(e){let g=[];for(let t=0;t<e.length;t++)g.push(this.body.nodes[e[t]]);return g}_getDistribution(){let e={},g,t;for(g in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,g)){t=this.body.nodes[g];let A=this.hierarchical.levels[g]===void 0?0:this.hierarchical.levels[g];this.direction.fix(t,A),e[A]===void 0&&(e[A]={}),e[A][g]=t}return e}_getActiveEdges(e){let g=[];return S(e.edges,t=>{var A;G(A=this.body.edgeIndices).call(A,t.id)!==-1&&g.push(t)}),g}_getHubSizes(){let e={},g=this.body.nodeIndices;S(g,A=>{let C=this.body.nodes[A],i=this._getActiveEdges(C).length;e[i]=!0});let t=[];return S(e,A=>{t.push(Number(A))}),Cg(t).call(t,function(A,C){return C-A}),t}_determineLevelsByHubsize(){let e=(t,A)=>{this.hierarchical.levelDownstream(t,A)},g=this._getHubSizes();for(let t=0;t<g.length;++t){let A=g[t];if(A===0)break;S(this.body.nodeIndices,C=>{let i=this.body.nodes[C];A===this._getActiveEdges(i).length&&this._crawlNetwork(e,C)})}}_determineLevelsCustomCallback(){let g=function(A,C,i){},t=(A,C,i)=>{let n=this.hierarchical.levels[A.id];n===void 0&&(n=this.hierarchical.levels[A.id]=1e5);let r=g(de.cloneOptions(A,"node"),de.cloneOptions(C,"node"),de.cloneOptions(i,"edge"));this.hierarchical.levels[C.id]=n+r};this._crawlNetwork(t),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;let g=Rr(e=this.body.nodeIndices).call(e,(t,A)=>(t.set(A,this.body.nodes[A]),t),new NA);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=BM(g):this.hierarchical.levels=FM(g),this.hierarchical.setMinLevelToZero()}_generateMap(){let e=(g,t)=>{this.hierarchical.levels[t.id]>this.hierarchical.levels[g.id]&&this.hierarchical.addRelation(g.id,t.id)};this._crawlNetwork(e),this.hierarchical.checkIfTree()}_crawlNetwork(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},g=arguments.length>1?arguments[1]:void 0,t={},A=(C,i)=>{if(t[C.id]===void 0){this.hierarchical.setTreeIndex(C,i),t[C.id]=!0;let n,r=this._getActiveEdges(C);for(let o=0;o<r.length;o++){let s=r[o];s.connected===!0&&(s.toId==C.id?n=s.from:n=s.to,C.id!=n.id&&(e(C,n,s),A(n,i)))}}};if(g===void 0){let C=0;for(let i=0;i<this.body.nodeIndices.length;i++){let n=this.body.nodeIndices[i];if(t[n]===void 0){let r=this.body.nodes[n];A(r,C),C+=1}}}else{let C=this.body.nodes[g];if(C===void 0){console.error("Node not found:",g);return}A(C)}}_shiftBlock(e,g){let t={},A=C=>{if(t[C])return;t[C]=!0,this.direction.shift(C,g);let i=this.hierarchical.childrenReference[C];if(i!==void 0)for(let n=0;n<i.length;n++)A(i[n])};A(e)}_findCommonParent(e,g){let t={},A=(i,n)=>{let r=this.hierarchical.parentReference[n];if(r!==void 0)for(let o=0;o<r.length;o++){let s=r[o];i[s]=!0,A(i,s)}},C=(i,n)=>{let r=this.hierarchical.parentReference[n];if(r!==void 0)for(let o=0;o<r.length;o++){let s=r[o];if(i[s]!==void 0)return{foundParent:s,withChild:n};let a=C(i,s);if(a.foundParent!==null)return a}return{foundParent:null,withChild:n}};return A(t,e),C(t,g)}setDirectionStrategy(){this.options.hierarchical.direction==="UD"||this.options.hierarchical.direction==="DU"?this.direction=new Vn(this):this.direction=new jn(this)}_getCenterPosition(e){let g=1e9,t=-1e9;for(let A=0;A<e.length;A++){let C;if(e[A].id!==void 0)C=e[A];else{let n=e[A];C=this.body.nodes[n]}let i=this.direction.getPosition(C);g=Math.min(g,i),t=Math.max(t,i)}return .5*(g+t)}},zM=`div.vis-network div.vis-manipulation {
715
715
  box-sizing: content-box;
716
716
 
717
717
  border-width: 0;
@@ -905,14 +905,14 @@ div.network-navigation_wrapper {
905
905
  height: 100%;
906
906
  }
907
907
  */
908
- `;_g(zM);var _n=class{constructor(e,g,t,A){var C,i;this.body=e,this.canvas=g,this.selectionHandler=t,this.interactionHandler=A,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this._domEventListenerCleanupQueue=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},q(this.options,this.defaultOptions),this.body.emitter.on("destroy",()=>{this._clean()}),this.body.emitter.on("_dataChanged",b(C=this._restore).call(C,this)),this.body.emitter.on("_resetData",b(i=this._restore).call(i,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(e,g,t){g!==void 0&&(g.locale!==void 0?this.options.locale=g.locale:this.options.locale=t.locale,g.locales!==void 0?this.options.locales=g.locales:this.options.locales=t.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,_(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}toggleEditMode(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var e,g;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";let t=this.selectionHandler.getSelectedNodeCount(),A=this.selectionHandler.getSelectedEdgeCount(),C=t+A,i=this.options.locales[this.options.locale],n=!1;this.options.addNode!==!1&&(this._createAddNodeButton(i),n=!0),this.options.addEdge!==!1&&(n===!0?this._createSeperator(1):n=!0,this._createAddEdgeButton(i)),t===1&&typeof this.options.editNode=="function"?(n===!0?this._createSeperator(2):n=!0,this._createEditNodeButton(i)):A===1&&t===0&&this.options.editEdge!==!1&&(n===!0?this._createSeperator(3):n=!0,this._createEditEdgeButton(i)),C!==0&&(t>0&&this.options.deleteNode!==!1?(n===!0&&this._createSeperator(4),this._createDeleteButton(i)):t===0&&this.options.deleteEdge!==!1&&(n===!0&&this._createSeperator(4),this._createDeleteButton(i))),this._bindElementEvents(this.closeDiv,b(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",b(g=this.showManipulatorToolbar).call(g,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var g;let t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,b(g=this.toggleEditMode).call(g,this))}this._temporaryBindEvent("click",b(e=this._performAddNode).call(e,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();let e=this.selectionHandler.getSelectedNodes()[0];if(e!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(e.isCluster!==!0){let g=_({},e.options,!1);if(g.x=e.x,g.y=e.y,this.options.editNode.length===2)this.options.editNode(g,t=>{t!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(t),this.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}addEdgeMode(){var e,g,t,A,C;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var i;let n=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(n),this._createSeperator(),this._createDescription(n.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,b(i=this.toggleEditMode).call(i,this))}this._temporaryBindUI("onTouch",b(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",b(g=this._finishConnect).call(g,this)),this._temporaryBindUI("onDrag",b(t=this._dragControlNode).call(t,this)),this._temporaryBindUI("onRelease",b(A=this._finishConnect).call(A,this)),this._temporaryBindUI("onDragStart",b(C=this._dragStartEdge).call(C,this)),this._temporaryBindUI("onHold",()=>{})}editEdgeMode(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",typeof this.options.editEdge=="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){let i=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(i.from.id,i.to.id);return}if(this.guiEnabled===!0){var e;let i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,b(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var g,t,A,C;let i=this.body.edges[this.edgeBeingEditedId],n=this._getNewTargetNode(i.from.x,i.from.y),o=this._getNewTargetNode(i.to.x,i.to.y);this.temporaryIds.nodes.push(n.id),this.temporaryIds.nodes.push(o.id),this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id),this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id),this._temporaryBindUI("onTouch",b(g=this._controlNodeTouch).call(g,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",b(t=this._controlNodeDragStart).call(t,this)),this._temporaryBindUI("onDrag",b(A=this._controlNodeDrag).call(A,this)),this._temporaryBindUI("onDragEnd",b(C=this._controlNodeDragEnd).call(C,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",s=>{let r=i.edgeType.findBorderPositions(s);n.selected===!1&&(n.x=r.from.x,n.y=r.from.y),o.selected===!1&&(o.x=r.to.x,o.y=r.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";let e=this.selectionHandler.getSelectedNodeIds(),g=this.selectionHandler.getSelectedEdgeIds(),t;if(e.length>0){for(let A=0;A<e.length;A++)if(this.body.nodes[e[A]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode=="function"&&(t=this.options.deleteNode)}else g.length>0&&typeof this.options.deleteEdge=="function"&&(t=this.options.deleteEdge);if(typeof t=="function"){let A={nodes:e,edges:g};if(t.length===2)t(A,C=>{C!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(C.edges),this.body.data.nodes.getDataSet().remove(C.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(g),this.body.data.nodes.getDataSet().remove(e),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}_setup(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){if(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0){var e,g;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(g=this.options.locales[this.options.locale])===null||g===void 0?void 0:g.close)!==null&&e!==void 0?e:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}_getNewTargetNode(e,g){let t=_({},this.options.controlNodeStyle);t.id="targetNode"+st(),t.hidden=!1,t.physics=!1,t.x=e,t.y=g;let A=this.body.functions.createNode(t);return A.shape.boundingBox={left:e,right:e,top:g,bottom:g},A}_createEditButton(){var e;this._clean(),this.manipulationDOM={},ug(this.editModeDiv);let g=this.options.locales[this.options.locale],t=this._createButton("editMode","vis-edit vis-edit-mode",g.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(t),this._bindElementEvents(t,b(e=this.toggleEditMode).call(e,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(ug(this.editModeDiv),ug(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(let g of Ue(e=this._domEventListenerCleanupQueue).call(e,0)){var e;g()}}_removeManipulationDOM(){this._clean(),ug(this.manipulationDiv),ug(this.editModeDiv),ug(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 e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}_createAddNodeButton(e){var g;let t=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.addNodeMode).call(g,this))}_createAddEdgeButton(e){var g;let t=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.addEdgeMode).call(g,this))}_createEditNodeButton(e){var g;let t=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.editNode).call(g,this))}_createEditEdgeButton(e){var g;let t=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.editEdgeMode).call(g,this))}_createDeleteButton(e){var g;let t;this.options.rtl?t="vis-delete-rtl":t="vis-delete";let A=this._createButton("delete",t,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,b(g=this.deleteSelected).call(g,this))}_createBackButton(e){var g;let t=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.showManipulatorToolbar).call(g,this))}_createButton(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("button"),this.manipulationDOM[e+"Div"].className="vis-button "+g,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=A,this.manipulationDOM[e+"Label"].innerText=t,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}_createDescription(e){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(e,g){this.temporaryEventFunctions.push({event:e,boundFunction:g}),this.body.emitter.on(e,g)}_temporaryBindUI(e,g){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=g;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+Et(U(this.body.eventListeners)))}_unbindTemporaryUIs(){for(let e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let e=0;e<this.temporaryEventFunctions.length;e++){let g=this.temporaryEventFunctions[e].event,t=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(g,t)}this.temporaryEventFunctions=[]}_bindElementEvents(e,g){let t=new ot(e,{});ZI(t,g),this._domEventListenerCleanupQueue.push(()=>{t.destroy()});let A=C=>{let{keyCode:i,key:n}=C;(n==="Enter"||n===" "||i===13||i===32)&&g()};e.addEventListener("keyup",A,!1),this._domEventListenerCleanupQueue.push(()=>{e.removeEventListener("keyup",A,!1)})}_cleanupTemporaryNodesAndEdges(){for(let C=0;C<this.temporaryIds.edges.length;C++){var e;this.body.edges[this.temporaryIds.edges[C]].disconnect(),delete this.body.edges[this.temporaryIds.edges[C]];let i=G(e=this.body.edgeIndices).call(e,this.temporaryIds.edges[C]);if(i!==-1){var g;Ue(g=this.body.edgeIndices).call(g,i,1)}}for(let C=0;C<this.temporaryIds.nodes.length;C++){var t;delete this.body.nodes[this.temporaryIds.nodes[C]];let i=G(t=this.body.nodeIndices).call(t,this.temporaryIds.nodes[C]);if(i!==-1){var A;Ue(A=this.body.nodeIndices).call(A,i,1)}}this.temporaryIds={nodes:[],edges:[]}}_controlNodeTouch(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=q({},this.body.view.translation)}_controlNodeDragStart(){let e=this.lastTouch,g=this.selectionHandler._pointerToPositionObject(e),t=this.body.nodes[this.temporaryIds.nodes[0]],A=this.body.nodes[this.temporaryIds.nodes[1]],C=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;let i=t.isOverlappingWith(g),n=A.isOverlappingWith(g);i===!0?(this.selectedControlNode=t,C.edgeType.from=t):n===!0&&(this.selectedControlNode=A,C.edgeType.to=A),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}_controlNodeDrag(e){this.body.emitter.emit("disablePhysics");let g=this.body.functions.getPointer(e.center),t=this.canvas.DOMtoCanvas(g);this.selectedControlNode!==void 0?(this.selectedControlNode.x=t.x,this.selectedControlNode.y=t.y):this.interactionHandler.onDrag(e),this.body.emitter.emit("_redraw")}_controlNodeDragEnd(e){let g=this.body.functions.getPointer(e.center),t=this.selectionHandler._pointerToPositionObject(g),A=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode===void 0)return;this.selectionHandler.unselectAll();let C=this.selectionHandler._getAllNodesOverlappingWith(t),i;for(let n=C.length-1;n>=0;n--)if(C[n]!==this.selectedControlNode.id){i=this.body.nodes[C[n]];break}if(i!==void 0&&this.selectedControlNode!==void 0)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let n=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===n.id?this._performEditEdge(i.id,A.to.id):this._performEditEdge(A.from.id,i.id)}else A.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}_handleConnect(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=q({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;let g=this.lastTouch,t=this.selectionHandler.getNodeAt(g);if(t!==void 0)if(t.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let A=this._getNewTargetNode(t.x,t.y);this.body.nodes[A.id]=A,this.body.nodeIndices.push(A.id);let C=this.body.functions.createEdge({id:"connectionEdge"+st(),from:t.id,to:A.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[C.id]=C,this.body.edgeIndices.push(C.id),this.temporaryIds.nodes.push(A.id),this.temporaryIds.edges.push(C.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(e){let g=this.body.functions.getPointer(e.center),t=this.selectionHandler._pointerToPositionObject(g),A;this.temporaryIds.edges[0]!==void 0&&(A=this.body.edges[this.temporaryIds.edges[0]].fromId);let C=this.selectionHandler._getAllNodesOverlappingWith(t),i;for(let o=C.length-1;o>=0;o--){var n;if(G(n=this.temporaryIds.nodes).call(n,C[o])===-1){i=this.body.nodes[C[o]];break}}if(e.controlEdge={from:A,to:i?i.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,g),this.temporaryIds.nodes[0]!==void 0){let o=this.body.nodes[this.temporaryIds.nodes[0]];o.x=this.canvas._XconvertDOMtoCanvas(g.x),o.y=this.canvas._YconvertDOMtoCanvas(g.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}_finishConnect(e){let g=this.body.functions.getPointer(e.center),t=this.selectionHandler._pointerToPositionObject(g),A;this.temporaryIds.edges[0]!==void 0&&(A=this.body.edges[this.temporaryIds.edges[0]].fromId);let C=this.selectionHandler._getAllNodesOverlappingWith(t),i;for(let o=C.length-1;o>=0;o--){var n;if(G(n=this.temporaryIds.nodes).call(n,C[o])===-1){i=this.body.nodes[C[o]];break}}this._cleanupTemporaryNodesAndEdges(),i!==void 0&&(i.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[A]!==void 0&&this.body.nodes[i.id]!==void 0&&this._performAddEdge(A,i.id)),e.controlEdge={from:A,to:i?i.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,g),this.body.emitter.emit("_redraw")}_dragStartEdge(e){let g=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,g,void 0,!0)}_performAddNode(e){let g={id:st(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(g,t=>{t!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(t),this.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(g),this.showManipulatorToolbar()}_performAddEdge(e,g){let t={from:e,to:g};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(t,A=>{A!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(A),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(t),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(e,g){let t={id:this.edgeBeingEditedId,from:e,to:g,label:this.body.data.edges.get(this.edgeBeingEditedId).label},A=this.options.editEdge;if(typeof A=="object"&&(A=A.editWithoutDrag),typeof A=="function")if(A.length===2)A(t,C=>{C==null||this.inMode!=="editEdge"?(this.body.edges[t.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(C),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(t),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},y="string",v="boolean",f="number",zt="array",x="object",Lh="dom",ZM="any",ui=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],fi={borderWidth:{number:f},borderWidthSelected:{number:f,undefined:"undefined"},brokenImage:{string:y,undefined:"undefined"},chosen:{label:{boolean:v,function:"function"},node:{boolean:v,function:"function"},__type__:{object:x,boolean:v}},color:{border:{string:y},background:{string:y},highlight:{border:{string:y},background:{string:y},__type__:{object:x,string:y}},hover:{border:{string:y},background:{string:y},__type__:{object:x,string:y}},__type__:{object:x,string:y}},opacity:{number:f,undefined:"undefined"},fixed:{x:{boolean:v},y:{boolean:v},__type__:{object:x,boolean:v}},font:{align:{string:y},color:{string:y},size:{number:f},face:{string:y},background:{string:y},strokeWidth:{number:f},strokeColor:{string:y},vadjust:{number:f},multi:{boolean:v,string:y},bold:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},boldital:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},ital:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},mono:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},__type__:{object:x,string:y}},group:{string:y,number:f,undefined:"undefined"},heightConstraint:{minimum:{number:f},valign:{string:y},__type__:{object:x,boolean:v,number:f}},hidden:{boolean:v},icon:{face:{string:y},code:{string:y},size:{number:f},color:{string:y},weight:{string:y,number:f},__type__:{object:x}},id:{string:y,number:f},image:{selected:{string:y,undefined:"undefined"},unselected:{string:y,undefined:"undefined"},__type__:{object:x,string:y}},imagePadding:{top:{number:f},right:{number:f},bottom:{number:f},left:{number:f},__type__:{object:x,number:f}},label:{string:y,undefined:"undefined"},labelHighlightBold:{boolean:v},level:{number:f,undefined:"undefined"},margin:{top:{number:f},right:{number:f},bottom:{number:f},left:{number:f},__type__:{object:x,number:f}},mass:{number:f},physics:{boolean:v},scaling:{min:{number:f},max:{number:f},label:{enabled:{boolean:v},min:{number:f},max:{number:f},maxVisible:{number:f},drawThreshold:{number:f},__type__:{object:x,boolean:v}},customScalingFunction:{function:"function"},__type__:{object:x}},shadow:{enabled:{boolean:v},color:{string:y},size:{number:f},x:{number:f},y:{number:f},__type__:{object:x,boolean:v}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:v,array:zt},borderRadius:{number:f},interpolation:{boolean:v},useImageSize:{boolean:v},useBorderWithImage:{boolean:v},coordinateOrigin:{string:["center","top-left"]},__type__:{object:x}},size:{number:f},title:{string:y,dom:Lh,undefined:"undefined"},value:{number:f,undefined:"undefined"},widthConstraint:{minimum:{number:f},maximum:{number:f},__type__:{object:x,boolean:v,number:f}},x:{number:f},y:{number:f},__type__:{object:x}},LM={configure:{enabled:{boolean:v},filter:{boolean:v,string:y,array:zt,function:"function"},container:{dom:Lh},showButton:{boolean:v},__type__:{object:x,boolean:v,string:y,array:zt,function:"function"}},edges:{arrows:{to:{enabled:{boolean:v},scaleFactor:{number:f},type:{string:ui},imageHeight:{number:f},imageWidth:{number:f},src:{string:y},__type__:{object:x,boolean:v}},middle:{enabled:{boolean:v},scaleFactor:{number:f},type:{string:ui},imageWidth:{number:f},imageHeight:{number:f},src:{string:y},__type__:{object:x,boolean:v}},from:{enabled:{boolean:v},scaleFactor:{number:f},type:{string:ui},imageWidth:{number:f},imageHeight:{number:f},src:{string:y},__type__:{object:x,boolean:v}},__type__:{string:["from","to","middle"],object:x}},endPointOffset:{from:{number:f},to:{number:f},__type__:{object:x,number:f}},arrowStrikethrough:{boolean:v},background:{enabled:{boolean:v},color:{string:y},size:{number:f},dashes:{boolean:v,array:zt},__type__:{object:x,boolean:v}},chosen:{label:{boolean:v,function:"function"},edge:{boolean:v,function:"function"},__type__:{object:x,boolean:v}},color:{color:{string:y},highlight:{string:y},hover:{string:y},inherit:{string:["from","to","both"],boolean:v},opacity:{number:f},__type__:{object:x,string:y}},dashes:{boolean:v,array:zt},font:{color:{string:y},size:{number:f},face:{string:y},background:{string:y},strokeWidth:{number:f},strokeColor:{string:y},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:f},multi:{boolean:v,string:y},bold:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},boldital:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},ital:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},mono:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},__type__:{object:x,string:y}},hidden:{boolean:v},hoverWidth:{function:"function",number:f},label:{string:y,undefined:"undefined"},labelHighlightBold:{boolean:v},length:{number:f,undefined:"undefined"},physics:{boolean:v},scaling:{min:{number:f},max:{number:f},label:{enabled:{boolean:v},min:{number:f},max:{number:f},maxVisible:{number:f},drawThreshold:{number:f},__type__:{object:x,boolean:v}},customScalingFunction:{function:"function"},__type__:{object:x}},selectionWidth:{function:"function",number:f},selfReferenceSize:{number:f},selfReference:{size:{number:f},angle:{number:f},renderBehindTheNode:{boolean:v},__type__:{object:x}},shadow:{enabled:{boolean:v},color:{string:y},size:{number:f},x:{number:f},y:{number:f},__type__:{object:x,boolean:v}},smooth:{enabled:{boolean:v},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:f},forceDirection:{string:["horizontal","vertical","none"],boolean:v},__type__:{object:x,boolean:v}},title:{string:y,undefined:"undefined"},width:{number:f},widthConstraint:{maximum:{number:f},__type__:{object:x,boolean:v,number:f}},value:{number:f,undefined:"undefined"},__type__:{object:x}},groups:{useDefaultGroups:{boolean:v},__any__:fi,__type__:{object:x}},interaction:{dragNodes:{boolean:v},dragView:{boolean:v},hideEdgesOnDrag:{boolean:v},hideEdgesOnZoom:{boolean:v},hideNodesOnDrag:{boolean:v},hover:{boolean:v},keyboard:{enabled:{boolean:v},speed:{x:{number:f},y:{number:f},zoom:{number:f},__type__:{object:x}},bindToWindow:{boolean:v},autoFocus:{boolean:v},__type__:{object:x,boolean:v}},multiselect:{boolean:v},navigationButtons:{boolean:v},selectable:{boolean:v},selectConnectedEdges:{boolean:v},hoverConnectedEdges:{boolean:v},tooltipDelay:{number:f},zoomView:{boolean:v},zoomSpeed:{number:f},__type__:{object:x}},layout:{randomSeed:{undefined:"undefined",number:f,string:y},improvedLayout:{boolean:v},clusterThreshold:{number:f},hierarchical:{enabled:{boolean:v},levelSeparation:{number:f},nodeSpacing:{number:f},treeSpacing:{number:f},blockShifting:{boolean:v},edgeMinimization:{boolean:v},parentCentralization:{boolean:v},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:x,boolean:v}},__type__:{object:x}},manipulation:{enabled:{boolean:v},initiallyActive:{boolean:v},addNode:{boolean:v,function:"function"},addEdge:{boolean:v,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:x,boolean:v,function:"function"}},deleteNode:{boolean:v,function:"function"},deleteEdge:{boolean:v,function:"function"},controlNodeStyle:fi,__type__:{object:x,boolean:v}},nodes:fi,physics:{enabled:{boolean:v},barnesHut:{theta:{number:f},gravitationalConstant:{number:f},centralGravity:{number:f},springLength:{number:f},springConstant:{number:f},damping:{number:f},avoidOverlap:{number:f},__type__:{object:x}},forceAtlas2Based:{theta:{number:f},gravitationalConstant:{number:f},centralGravity:{number:f},springLength:{number:f},springConstant:{number:f},damping:{number:f},avoidOverlap:{number:f},__type__:{object:x}},repulsion:{centralGravity:{number:f},springLength:{number:f},springConstant:{number:f},nodeDistance:{number:f},damping:{number:f},__type__:{object:x}},hierarchicalRepulsion:{centralGravity:{number:f},springLength:{number:f},springConstant:{number:f},nodeDistance:{number:f},damping:{number:f},avoidOverlap:{number:f},__type__:{object:x}},maxVelocity:{number:f},minVelocity:{number:f},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:v},iterations:{number:f},updateInterval:{number:f},onlyDynamicEdges:{boolean:v},fit:{boolean:v},__type__:{object:x,boolean:v}},timestep:{number:f},adaptiveTimestep:{boolean:v},wind:{x:{number:f},y:{number:f},__type__:{object:x}},__type__:{object:x,boolean:v}},autoResize:{boolean:v},clickToUse:{boolean:v},locale:{string:y},locales:{__any__:{any:ZM},__type__:{object:x}},height:{string:y},width:{string:y},__type__:{object:x}},Gh={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]}}},GM=(I,e,g)=>{var t;return!!(yg(I).call(I,"physics")&&yg(t=Gh.physics.solver).call(t,e)&&g.physics.solver!==e&&e!=="wind")};var Kn=class{constructor(){}getDistances(e,g,t){let A={},C=e.edges;for(let n=0;n<g.length;n++){let o=g[n],s={};A[o]=s;for(let r=0;r<g.length;r++)s[g[r]]=n==r?0:1e9}for(let n=0;n<t.length;n++){let o=C[t[n]];o.connected===!0&&A[o.fromId]!==void 0&&A[o.toId]!==void 0&&(A[o.fromId][o.toId]=1,A[o.toId][o.fromId]=1)}let i=g.length;for(let n=0;n<i;n++){let o=g[n],s=A[o];for(let r=0;r<i-1;r++){let a=g[r],d=A[a];for(let l=r+1;l<i;l++){let h=g[l],c=A[h],p=Math.min(d[h],d[o]+s[h]);d[h]=p,c[a]=p}}}return A}},Un=class{constructor(e,g,t){this.body=e,this.springLength=g,this.springConstant=t,this.distanceSolver=new Kn}setOptions(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}solve(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=this.distanceSolver.getDistances(this.body,e,g);this._createL_matrix(A),this._createK_matrix(A),this._createE_matrix();let C=.01,i=1,n=0,o=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),s=5,r=1e9,a=0,d=0,l=0,h=0,c=0;for(;r>C&&n<o;)for(n+=1,[a,r,d,l]=this._getHighestEnergyNode(t),h=r,c=0;h>i&&c<s;)c+=1,this._moveNode(a,d,l),[h,d,l]=this._getEnergy(a)}_getHighestEnergyNode(e){let g=this.body.nodeIndices,t=this.body.nodes,A=0,C=g[0],i=0,n=0;for(let o=0;o<g.length;o++){let s=g[o];if(t[s].predefinedPosition!==!0||t[s].isCluster===!0&&e===!0||t[s].options.fixed.x!==!0||t[s].options.fixed.y!==!0){let[r,a,d]=this._getEnergy(s);A<r&&(A=r,C=s,i=a,n=d)}}return[C,A,i,n]}_getEnergy(e){let[g,t]=this.E_sums[e];return[Math.sqrt(g**2+t**2),g,t]}_moveNode(e,g,t){let A=this.body.nodeIndices,C=this.body.nodes,i=0,n=0,o=0,s=C[e].x,r=C[e].y,a=this.K_matrix[e],d=this.L_matrix[e];for(let w=0;w<A.length;w++){let O=A[w];if(O!==e){let M=C[O].x,k=C[O].y,V=a[O],ye=d[O],ue=1/((s-M)**2+(r-k)**2)**1.5;i+=V*(1-ye*(r-k)**2*ue),n+=V*(ye*(s-M)*(r-k)*ue),o+=V*(1-ye*(s-M)**2*ue)}}let l=i,h=n,c=g,p=o,u=t,m=(c/l+u/h)/(h/l-p/h),E=-(h*m+c)/l;C[e].x+=E,C[e].y+=m,this._updateE_matrix(e)}_createL_matrix(e){let g=this.body.nodeIndices,t=this.springLength;this.L_matrix=[];for(let A=0;A<g.length;A++){this.L_matrix[g[A]]={};for(let C=0;C<g.length;C++)this.L_matrix[g[A]][g[C]]=t*e[g[A]][g[C]]}}_createK_matrix(e){let g=this.body.nodeIndices,t=this.springConstant;this.K_matrix=[];for(let A=0;A<g.length;A++){this.K_matrix[g[A]]={};for(let C=0;C<g.length;C++)this.K_matrix[g[A]][g[C]]=t*e[g[A]][g[C]]**-2}}_createE_matrix(){let e=this.body.nodeIndices,g=this.body.nodes;this.E_matrix={},this.E_sums={};for(let t=0;t<e.length;t++)this.E_matrix[e[t]]=[];for(let t=0;t<e.length;t++){let A=e[t],C=g[A].x,i=g[A].y,n=0,o=0;for(let s=t;s<e.length;s++){let r=e[s];if(r!==A){let a=g[r].x,d=g[r].y,l=1/Math.sqrt((C-a)**2+(i-d)**2);this.E_matrix[A][s]=[this.K_matrix[A][r]*(C-a-this.L_matrix[A][r]*(C-a)*l),this.K_matrix[A][r]*(i-d-this.L_matrix[A][r]*(i-d)*l)],this.E_matrix[r][t]=this.E_matrix[A][s],n+=this.E_matrix[A][s][0],o+=this.E_matrix[A][s][1]}}this.E_sums[A]=[n,o]}}_updateE_matrix(e){let g=this.body.nodeIndices,t=this.body.nodes,A=this.E_matrix[e],C=this.K_matrix[e],i=this.L_matrix[e],n=t[e].x,o=t[e].y,s=0,r=0;for(let a=0;a<g.length;a++){let d=g[a];if(d!==e){let l=A[a],h=l[0],c=l[1],p=t[d].x,u=t[d].y,m=1/Math.sqrt((n-p)**2+(o-u)**2),E=C[d]*(n-p-i[d]*(n-p)*m),w=C[d]*(o-u-i[d]*(o-u)*m);A[a]=[E,w],s+=E,r+=w;let O=this.E_sums[d];O[0]+=E-h,O[1]+=w-c}}this.E_sums[e]=[s,r]}};function T(I,e,g){var t,A,C,i;if(!(this instanceof T))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:E1,clickToUse:!1},q(this.options,this.defaultOptions),this.body={container:I,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:b(t=this.on).call(t,this),off:b(A=this.off).call(A,this),emit:b(C=this.emit).call(C,this),once:b(i=this.once).call(i,this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}},selectionBox:{show:!1,position:{start:{x:0,y:0},end:{x:0,y:0}}}},this.bindEventListeners(),this.images=new _i(()=>this.body.emitter.emit("_requestRedraw")),this.groups=new Ki,this.canvas=new Mn(this.body),this.selectionHandler=new Gn(this.body,this.canvas),this.interactionHandler=new zn(this.body,this.canvas,this.selectionHandler),this.view=new Fn(this.body,this.canvas),this.renderer=new kn(this.body,this.canvas),this.physics=new Nn(this.body),this.layoutEngine=new Yn(this.body),this.clustering=new Sn(this.body),this.manipulation=new _n(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new an(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new En(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new Un(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(g),this.setData(e)}ed(T.prototype);T.prototype.setOptions=function(I){if(I===null&&(I=void 0),I!==void 0){if(g1.validate(I,LM)===!0&&console.error("%cErrors have been found in the supplied options object.",jl),xt(["locale","locales","clickToUse"],this.options,I),I.locale!==void 0&&(I.locale=T1(I.locales||this.options.locales,I.locale)),I=this.layoutEngine.setOptions(I.layout,I),this.canvas.setOptions(I),this.groups.setOptions(I.groups),this.nodesHandler.setOptions(I.nodes),this.edgesHandler.setOptions(I.edges),this.physics.setOptions(I.physics),this.manipulation.setOptions(I.manipulation,I,this.options),this.interactionHandler.setOptions(I.interaction),this.renderer.setOptions(I.interaction),this.selectionHandler.setOptions(I.interaction),I.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in I&&(this.configurator||(this.configurator=new qO(this,this.body.container,Gh,this.canvas.pixelRatio,GM)),this.configurator.setOptions(I.configure)),this.configurator&&this.configurator.options.enabled===!0){let t={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};_(t.nodes,this.nodesHandler.options),_(t.edges,this.edgesHandler.options),_(t.layout,this.layoutEngine.options),_(t.interaction,this.selectionHandler.options),_(t.interaction,this.renderer.options),_(t.interaction,this.interactionHandler.options),_(t.manipulation,this.manipulation.options),_(t.physics,this.physics.options),_(t.global,this.canvas.options),_(t.global,this.options),this.configurator.setModuleOptions(t)}I.clickToUse!==void 0?I.clickToUse===!0?this.activator===void 0&&(this.activator=new $O(this.canvas.frame),this.activator.on("change",()=>{this.body.emitter.emit("activate")})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}};T.prototype._updateVisibleIndices=function(){let I=this.body.nodes,e=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(let g in I)Object.prototype.hasOwnProperty.call(I,g)&&!this.clustering._isClusteredNode(g)&&I[g].options.hidden===!1&&this.body.nodeIndices.push(I[g].id);for(let g in e)if(Object.prototype.hasOwnProperty.call(e,g)){let t=e[g],A=I[t.fromId],C=I[t.toId],i=A!==void 0&&C!==void 0;!this.clustering._isClusteredEdge(g)&&t.options.hidden===!1&&i&&A.options.hidden===!1&&C.options.hidden===!1&&this.body.edgeIndices.push(t.id)}};T.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")})};T.prototype.setData=function(I){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),I&&I.dot&&(I.nodes||I.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(I&&I.options),I&&I.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);");let e=a1(I.dot);this.setData(e);return}else if(I&&I.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);");let e=d1(I.gephi);this.setData(e);return}else this.nodesHandler.setData(I&&I.nodes,!0),this.edgesHandler.setData(I&&I.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")};T.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(let I in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,I)&&delete this.body.nodes[I];for(let I in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,I)&&delete this.body.edges[I];ug(this.body.container)};T.prototype._updateValueRange=function(I){let e,g,t,A=0;for(e in I)if(Object.prototype.hasOwnProperty.call(I,e)){let C=I[e].getValue();C!==void 0&&(g=g===void 0?C:Math.min(C,g),t=t===void 0?C:Math.max(C,t),A+=C)}if(g!==void 0&&t!==void 0)for(e in I)Object.prototype.hasOwnProperty.call(I,e)&&I[e].setValueRange(g,t,A)};T.prototype.isActive=function(){return!this.activator||this.activator.active};T.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)};T.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)};T.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)};T.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)};T.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)};T.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)};T.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)};T.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)};T.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)};T.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)};T.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)};T.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)};T.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)};T.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)};T.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)};T.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)};T.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)};T.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)};T.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)};T.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)};T.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)};T.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)};T.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)};T.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)};T.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)};T.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)};T.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)};T.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)};T.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)};T.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)};T.prototype.getConnectedNodes=function(I){return this.body.nodes[I]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)};T.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)};T.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)};T.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)};T.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)};T.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)};T.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)};T.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)};T.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)};T.prototype.getNodeAt=function(){let I=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return I!==void 0&&I.id!==void 0?I.id:I};T.prototype.getEdgeAt=function(){let I=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return I!==void 0&&I.id!==void 0?I.id:I};T.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)};T.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)};T.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()};T.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)};T.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)};T.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)};T.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)};T.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)};T.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)};T.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)};T.prototype.getOptionsFromConfigurator=function(){let I={};return this.configurator&&(I=this.configurator.getOptions.apply(this.configurator)),I};function oC(){return document.documentElement.getAttribute("data-theme")||"light"}function Fo(I){return I==="dark"?{uri:"#97C2FC",literal:"#a6c8a6ff",blankNode:"#888888",typeObject:"#e15b13ff",text:"#e0e0e0",edge:"#666666",edgeLabel:"#cccccc",edgeLabelBackground:"rgba(30, 30, 30, 0.8)"}:{uri:"#97C2FC",literal:"#a6c8a6ff",blankNode:"#c5c5c5ff",typeObject:"#e15b13ff",text:"#000000",edge:"#cccccc",edgeLabel:"#666666",edgeLabelBackground:"rgba(255, 255, 255, 0.8)"}}function Vh(I){let e=new MutationObserver(g=>{g.forEach(t=>{if(t.attributeName==="data-theme"){let A=oC();I(A)}})});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),e}function VM(){return{Network:T,DataSet:Pg}}var Bo=class{constructor(e){this.yasr=e,this.network=null,this.currentTheme=oC(),this.themeObserver=null}static get priority(){return 20}static get label(){return"Graph"}canHandleResults(){if(!this.yasr||!this.yasr.results)return!1;let e=this.yasr.results;if(e.getBindings&&typeof e.getBindings=="function"){let g=e.getBindings();if(g&&g.length>0){let t=g[0];return t.subject!==void 0&&t.predicate!==void 0&&t.object!==void 0}}return!1}draw(){this.yasr.resultsEl.innerHTML="";try{let e=Lo(this.yasr.results);if(!e||e.length===0){this.yasr.resultsEl.innerHTML='<div style="padding: 20px; text-align: center; color: #666;">No graph data to visualize</div>';return}let g=Zo(this.yasr);this.currentTheme=oC();let t=Fo(this.currentTheme),{nodes:A,edges:C}=dC(e,g,t),i=document.createElement("div");i.id="yasgui-graph-plugin-container",i.style.width="100%",i.style.minHeight="500px",i.style.height="100%",i.style.position="relative",i.style.overflow="hidden",this.yasr.resultsEl.appendChild(i);let{Network:n,DataSet:o}=VM(),s=new o(A),r=new o(C),a=rC(t);this.nodesDataSet=s,this.edgesDataSet=r,this.triples=e,this.prefixMap=g,this.network=new n(i,{nodes:s,edges:r},a),this.network.once("afterDrawing",()=>{let h=document.querySelector(".orientation-horizontal")!==null;i.style.height=h?"80vh":"50vh"}),this.networkReady=!1,this.network.on("stabilizationIterationsDone",()=>{this.network.setOptions({physics:{enabled:!0}}),this.networkReady=!0}),this.themeObserver||(this.themeObserver=Vh(h=>{this.applyTheme(h)}));let d=document.createElement("div");d.style.position="absolute",d.style.top="10px",d.style.right="10px",d.style.zIndex="10000",d.style.display="flex",d.style.gap="10px",d.style.pointerEvents="auto",i.appendChild(d);let l=document.createElement("button");l.textContent="Zoom to Fit",l.style.padding="8px 12px",l.style.background="#4CAF50",l.style.color="white",l.style.border="none",l.style.borderRadius="4px",l.style.cursor="pointer",l.style.fontSize="14px",l.style.boxShadow="0 2px 4px rgba(0,0,0,0.2)",l.onmouseover=()=>l.style.background="#45a049",l.onmouseout=()=>l.style.background="#4CAF50",l.onclick=()=>{this.network&&this.network.fit({animation:{duration:300,easingFunction:"easeInOutQuad"}})},d.appendChild(l),e.length>1e3&&console.warn("Large graph detected (>1000 triples). Rendering may be slow.")}catch(e){console.error("Error rendering graph:",e),this.yasr.resultsEl.innerHTML='<div style="padding: 20px; color: red;">Error rendering graph. See console for details.</div>'}}applyTheme(e){if(!this.network||!this.nodesDataSet||!this.triples||!this.prefixMap)return;this.currentTheme=e;let g=Fo(e),{nodes:t,edges:A}=dC(this.triples,this.prefixMap,g);this.nodesDataSet.clear(),this.nodesDataSet.add(t),this.edgesDataSet.clear(),this.edgesDataSet.add(A);let C=rC(g);this.network.setOptions(C)}getIcon(){let e=document.createElement("div");return e.setAttribute("aria-label","Graph visualization"),e.style.display="inline-flex",e.style.alignItems="center",e.style.justifyContent="center",e.innerHTML=`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
908
+ `;_g(zM);var _n=class{constructor(e,g,t,A){var C,i;this.body=e,this.canvas=g,this.selectionHandler=t,this.interactionHandler=A,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this._domEventListenerCleanupQueue=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},q(this.options,this.defaultOptions),this.body.emitter.on("destroy",()=>{this._clean()}),this.body.emitter.on("_dataChanged",b(C=this._restore).call(C,this)),this.body.emitter.on("_resetData",b(i=this._restore).call(i,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(e,g,t){g!==void 0&&(g.locale!==void 0?this.options.locale=g.locale:this.options.locale=t.locale,g.locales!==void 0?this.options.locales=g.locales:this.options.locales=t.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,_(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}toggleEditMode(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var e,g;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";let t=this.selectionHandler.getSelectedNodeCount(),A=this.selectionHandler.getSelectedEdgeCount(),C=t+A,i=this.options.locales[this.options.locale],n=!1;this.options.addNode!==!1&&(this._createAddNodeButton(i),n=!0),this.options.addEdge!==!1&&(n===!0?this._createSeperator(1):n=!0,this._createAddEdgeButton(i)),t===1&&typeof this.options.editNode=="function"?(n===!0?this._createSeperator(2):n=!0,this._createEditNodeButton(i)):A===1&&t===0&&this.options.editEdge!==!1&&(n===!0?this._createSeperator(3):n=!0,this._createEditEdgeButton(i)),C!==0&&(t>0&&this.options.deleteNode!==!1?(n===!0&&this._createSeperator(4),this._createDeleteButton(i)):t===0&&this.options.deleteEdge!==!1&&(n===!0&&this._createSeperator(4),this._createDeleteButton(i))),this._bindElementEvents(this.closeDiv,b(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",b(g=this.showManipulatorToolbar).call(g,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var g;let t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,b(g=this.toggleEditMode).call(g,this))}this._temporaryBindEvent("click",b(e=this._performAddNode).call(e,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();let e=this.selectionHandler.getSelectedNodes()[0];if(e!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(e.isCluster!==!0){let g=_({},e.options,!1);if(g.x=e.x,g.y=e.y,this.options.editNode.length===2)this.options.editNode(g,t=>{t!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(t),this.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}addEdgeMode(){var e,g,t,A,C;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var i;let n=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(n),this._createSeperator(),this._createDescription(n.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,b(i=this.toggleEditMode).call(i,this))}this._temporaryBindUI("onTouch",b(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",b(g=this._finishConnect).call(g,this)),this._temporaryBindUI("onDrag",b(t=this._dragControlNode).call(t,this)),this._temporaryBindUI("onRelease",b(A=this._finishConnect).call(A,this)),this._temporaryBindUI("onDragStart",b(C=this._dragStartEdge).call(C,this)),this._temporaryBindUI("onHold",()=>{})}editEdgeMode(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",typeof this.options.editEdge=="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){let i=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(i.from.id,i.to.id);return}if(this.guiEnabled===!0){var e;let i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,b(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var g,t,A,C;let i=this.body.edges[this.edgeBeingEditedId],n=this._getNewTargetNode(i.from.x,i.from.y),r=this._getNewTargetNode(i.to.x,i.to.y);this.temporaryIds.nodes.push(n.id),this.temporaryIds.nodes.push(r.id),this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id),this.body.nodes[r.id]=r,this.body.nodeIndices.push(r.id),this._temporaryBindUI("onTouch",b(g=this._controlNodeTouch).call(g,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",b(t=this._controlNodeDragStart).call(t,this)),this._temporaryBindUI("onDrag",b(A=this._controlNodeDrag).call(A,this)),this._temporaryBindUI("onDragEnd",b(C=this._controlNodeDragEnd).call(C,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",o=>{let s=i.edgeType.findBorderPositions(o);n.selected===!1&&(n.x=s.from.x,n.y=s.from.y),r.selected===!1&&(r.x=s.to.x,r.y=s.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";let e=this.selectionHandler.getSelectedNodeIds(),g=this.selectionHandler.getSelectedEdgeIds(),t;if(e.length>0){for(let A=0;A<e.length;A++)if(this.body.nodes[e[A]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode=="function"&&(t=this.options.deleteNode)}else g.length>0&&typeof this.options.deleteEdge=="function"&&(t=this.options.deleteEdge);if(typeof t=="function"){let A={nodes:e,edges:g};if(t.length===2)t(A,C=>{C!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(C.edges),this.body.data.nodes.getDataSet().remove(C.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(g),this.body.data.nodes.getDataSet().remove(e),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}_setup(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){if(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0){var e,g;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(g=this.options.locales[this.options.locale])===null||g===void 0?void 0:g.close)!==null&&e!==void 0?e:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}_getNewTargetNode(e,g){let t=_({},this.options.controlNodeStyle);t.id="targetNode"+ot(),t.hidden=!1,t.physics=!1,t.x=e,t.y=g;let A=this.body.functions.createNode(t);return A.shape.boundingBox={left:e,right:e,top:g,bottom:g},A}_createEditButton(){var e;this._clean(),this.manipulationDOM={},fg(this.editModeDiv);let g=this.options.locales[this.options.locale],t=this._createButton("editMode","vis-edit vis-edit-mode",g.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(t),this._bindElementEvents(t,b(e=this.toggleEditMode).call(e,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(fg(this.editModeDiv),fg(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(let g of Ue(e=this._domEventListenerCleanupQueue).call(e,0)){var e;g()}}_removeManipulationDOM(){this._clean(),fg(this.manipulationDiv),fg(this.editModeDiv),fg(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 e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}_createAddNodeButton(e){var g;let t=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.addNodeMode).call(g,this))}_createAddEdgeButton(e){var g;let t=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.addEdgeMode).call(g,this))}_createEditNodeButton(e){var g;let t=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.editNode).call(g,this))}_createEditEdgeButton(e){var g;let t=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.editEdgeMode).call(g,this))}_createDeleteButton(e){var g;let t;this.options.rtl?t="vis-delete-rtl":t="vis-delete";let A=this._createButton("delete",t,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,b(g=this.deleteSelected).call(g,this))}_createBackButton(e){var g;let t=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.showManipulatorToolbar).call(g,this))}_createButton(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("button"),this.manipulationDOM[e+"Div"].className="vis-button "+g,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=A,this.manipulationDOM[e+"Label"].innerText=t,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}_createDescription(e){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(e,g){this.temporaryEventFunctions.push({event:e,boundFunction:g}),this.body.emitter.on(e,g)}_temporaryBindUI(e,g){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=g;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+Et(U(this.body.eventListeners)))}_unbindTemporaryUIs(){for(let e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let e=0;e<this.temporaryEventFunctions.length;e++){let g=this.temporaryEventFunctions[e].event,t=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(g,t)}this.temporaryEventFunctions=[]}_bindElementEvents(e,g){let t=new rt(e,{});ZI(t,g),this._domEventListenerCleanupQueue.push(()=>{t.destroy()});let A=C=>{let{keyCode:i,key:n}=C;(n==="Enter"||n===" "||i===13||i===32)&&g()};e.addEventListener("keyup",A,!1),this._domEventListenerCleanupQueue.push(()=>{e.removeEventListener("keyup",A,!1)})}_cleanupTemporaryNodesAndEdges(){for(let C=0;C<this.temporaryIds.edges.length;C++){var e;this.body.edges[this.temporaryIds.edges[C]].disconnect(),delete this.body.edges[this.temporaryIds.edges[C]];let i=G(e=this.body.edgeIndices).call(e,this.temporaryIds.edges[C]);if(i!==-1){var g;Ue(g=this.body.edgeIndices).call(g,i,1)}}for(let C=0;C<this.temporaryIds.nodes.length;C++){var t;delete this.body.nodes[this.temporaryIds.nodes[C]];let i=G(t=this.body.nodeIndices).call(t,this.temporaryIds.nodes[C]);if(i!==-1){var A;Ue(A=this.body.nodeIndices).call(A,i,1)}}this.temporaryIds={nodes:[],edges:[]}}_controlNodeTouch(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=q({},this.body.view.translation)}_controlNodeDragStart(){let e=this.lastTouch,g=this.selectionHandler._pointerToPositionObject(e),t=this.body.nodes[this.temporaryIds.nodes[0]],A=this.body.nodes[this.temporaryIds.nodes[1]],C=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;let i=t.isOverlappingWith(g),n=A.isOverlappingWith(g);i===!0?(this.selectedControlNode=t,C.edgeType.from=t):n===!0&&(this.selectedControlNode=A,C.edgeType.to=A),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}_controlNodeDrag(e){this.body.emitter.emit("disablePhysics");let g=this.body.functions.getPointer(e.center),t=this.canvas.DOMtoCanvas(g);this.selectedControlNode!==void 0?(this.selectedControlNode.x=t.x,this.selectedControlNode.y=t.y):this.interactionHandler.onDrag(e),this.body.emitter.emit("_redraw")}_controlNodeDragEnd(e){let g=this.body.functions.getPointer(e.center),t=this.selectionHandler._pointerToPositionObject(g),A=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode===void 0)return;this.selectionHandler.unselectAll();let C=this.selectionHandler._getAllNodesOverlappingWith(t),i;for(let n=C.length-1;n>=0;n--)if(C[n]!==this.selectedControlNode.id){i=this.body.nodes[C[n]];break}if(i!==void 0&&this.selectedControlNode!==void 0)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let n=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===n.id?this._performEditEdge(i.id,A.to.id):this._performEditEdge(A.from.id,i.id)}else A.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}_handleConnect(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=q({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;let g=this.lastTouch,t=this.selectionHandler.getNodeAt(g);if(t!==void 0)if(t.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let A=this._getNewTargetNode(t.x,t.y);this.body.nodes[A.id]=A,this.body.nodeIndices.push(A.id);let C=this.body.functions.createEdge({id:"connectionEdge"+ot(),from:t.id,to:A.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[C.id]=C,this.body.edgeIndices.push(C.id),this.temporaryIds.nodes.push(A.id),this.temporaryIds.edges.push(C.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(e){let g=this.body.functions.getPointer(e.center),t=this.selectionHandler._pointerToPositionObject(g),A;this.temporaryIds.edges[0]!==void 0&&(A=this.body.edges[this.temporaryIds.edges[0]].fromId);let C=this.selectionHandler._getAllNodesOverlappingWith(t),i;for(let r=C.length-1;r>=0;r--){var n;if(G(n=this.temporaryIds.nodes).call(n,C[r])===-1){i=this.body.nodes[C[r]];break}}if(e.controlEdge={from:A,to:i?i.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,g),this.temporaryIds.nodes[0]!==void 0){let r=this.body.nodes[this.temporaryIds.nodes[0]];r.x=this.canvas._XconvertDOMtoCanvas(g.x),r.y=this.canvas._YconvertDOMtoCanvas(g.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}_finishConnect(e){let g=this.body.functions.getPointer(e.center),t=this.selectionHandler._pointerToPositionObject(g),A;this.temporaryIds.edges[0]!==void 0&&(A=this.body.edges[this.temporaryIds.edges[0]].fromId);let C=this.selectionHandler._getAllNodesOverlappingWith(t),i;for(let r=C.length-1;r>=0;r--){var n;if(G(n=this.temporaryIds.nodes).call(n,C[r])===-1){i=this.body.nodes[C[r]];break}}this._cleanupTemporaryNodesAndEdges(),i!==void 0&&(i.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[A]!==void 0&&this.body.nodes[i.id]!==void 0&&this._performAddEdge(A,i.id)),e.controlEdge={from:A,to:i?i.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,g),this.body.emitter.emit("_redraw")}_dragStartEdge(e){let g=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,g,void 0,!0)}_performAddNode(e){let g={id:ot(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(g,t=>{t!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(t),this.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(g),this.showManipulatorToolbar()}_performAddEdge(e,g){let t={from:e,to:g};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(t,A=>{A!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(A),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(t),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(e,g){let t={id:this.edgeBeingEditedId,from:e,to:g,label:this.body.data.edges.get(this.edgeBeingEditedId).label},A=this.options.editEdge;if(typeof A=="object"&&(A=A.editWithoutDrag),typeof A=="function")if(A.length===2)A(t,C=>{C==null||this.inMode!=="editEdge"?(this.body.edges[t.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(C),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(t),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},y="string",v="boolean",f="number",zt="array",x="object",Lh="dom",ZM="any",ui=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],fi={borderWidth:{number:f},borderWidthSelected:{number:f,undefined:"undefined"},brokenImage:{string:y,undefined:"undefined"},chosen:{label:{boolean:v,function:"function"},node:{boolean:v,function:"function"},__type__:{object:x,boolean:v}},color:{border:{string:y},background:{string:y},highlight:{border:{string:y},background:{string:y},__type__:{object:x,string:y}},hover:{border:{string:y},background:{string:y},__type__:{object:x,string:y}},__type__:{object:x,string:y}},opacity:{number:f,undefined:"undefined"},fixed:{x:{boolean:v},y:{boolean:v},__type__:{object:x,boolean:v}},font:{align:{string:y},color:{string:y},size:{number:f},face:{string:y},background:{string:y},strokeWidth:{number:f},strokeColor:{string:y},vadjust:{number:f},multi:{boolean:v,string:y},bold:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},boldital:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},ital:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},mono:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},__type__:{object:x,string:y}},group:{string:y,number:f,undefined:"undefined"},heightConstraint:{minimum:{number:f},valign:{string:y},__type__:{object:x,boolean:v,number:f}},hidden:{boolean:v},icon:{face:{string:y},code:{string:y},size:{number:f},color:{string:y},weight:{string:y,number:f},__type__:{object:x}},id:{string:y,number:f},image:{selected:{string:y,undefined:"undefined"},unselected:{string:y,undefined:"undefined"},__type__:{object:x,string:y}},imagePadding:{top:{number:f},right:{number:f},bottom:{number:f},left:{number:f},__type__:{object:x,number:f}},label:{string:y,undefined:"undefined"},labelHighlightBold:{boolean:v},level:{number:f,undefined:"undefined"},margin:{top:{number:f},right:{number:f},bottom:{number:f},left:{number:f},__type__:{object:x,number:f}},mass:{number:f},physics:{boolean:v},scaling:{min:{number:f},max:{number:f},label:{enabled:{boolean:v},min:{number:f},max:{number:f},maxVisible:{number:f},drawThreshold:{number:f},__type__:{object:x,boolean:v}},customScalingFunction:{function:"function"},__type__:{object:x}},shadow:{enabled:{boolean:v},color:{string:y},size:{number:f},x:{number:f},y:{number:f},__type__:{object:x,boolean:v}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:v,array:zt},borderRadius:{number:f},interpolation:{boolean:v},useImageSize:{boolean:v},useBorderWithImage:{boolean:v},coordinateOrigin:{string:["center","top-left"]},__type__:{object:x}},size:{number:f},title:{string:y,dom:Lh,undefined:"undefined"},value:{number:f,undefined:"undefined"},widthConstraint:{minimum:{number:f},maximum:{number:f},__type__:{object:x,boolean:v,number:f}},x:{number:f},y:{number:f},__type__:{object:x}},LM={configure:{enabled:{boolean:v},filter:{boolean:v,string:y,array:zt,function:"function"},container:{dom:Lh},showButton:{boolean:v},__type__:{object:x,boolean:v,string:y,array:zt,function:"function"}},edges:{arrows:{to:{enabled:{boolean:v},scaleFactor:{number:f},type:{string:ui},imageHeight:{number:f},imageWidth:{number:f},src:{string:y},__type__:{object:x,boolean:v}},middle:{enabled:{boolean:v},scaleFactor:{number:f},type:{string:ui},imageWidth:{number:f},imageHeight:{number:f},src:{string:y},__type__:{object:x,boolean:v}},from:{enabled:{boolean:v},scaleFactor:{number:f},type:{string:ui},imageWidth:{number:f},imageHeight:{number:f},src:{string:y},__type__:{object:x,boolean:v}},__type__:{string:["from","to","middle"],object:x}},endPointOffset:{from:{number:f},to:{number:f},__type__:{object:x,number:f}},arrowStrikethrough:{boolean:v},background:{enabled:{boolean:v},color:{string:y},size:{number:f},dashes:{boolean:v,array:zt},__type__:{object:x,boolean:v}},chosen:{label:{boolean:v,function:"function"},edge:{boolean:v,function:"function"},__type__:{object:x,boolean:v}},color:{color:{string:y},highlight:{string:y},hover:{string:y},inherit:{string:["from","to","both"],boolean:v},opacity:{number:f},__type__:{object:x,string:y}},dashes:{boolean:v,array:zt},font:{color:{string:y},size:{number:f},face:{string:y},background:{string:y},strokeWidth:{number:f},strokeColor:{string:y},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:f},multi:{boolean:v,string:y},bold:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},boldital:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},ital:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},mono:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},__type__:{object:x,string:y}},hidden:{boolean:v},hoverWidth:{function:"function",number:f},label:{string:y,undefined:"undefined"},labelHighlightBold:{boolean:v},length:{number:f,undefined:"undefined"},physics:{boolean:v},scaling:{min:{number:f},max:{number:f},label:{enabled:{boolean:v},min:{number:f},max:{number:f},maxVisible:{number:f},drawThreshold:{number:f},__type__:{object:x,boolean:v}},customScalingFunction:{function:"function"},__type__:{object:x}},selectionWidth:{function:"function",number:f},selfReferenceSize:{number:f},selfReference:{size:{number:f},angle:{number:f},renderBehindTheNode:{boolean:v},__type__:{object:x}},shadow:{enabled:{boolean:v},color:{string:y},size:{number:f},x:{number:f},y:{number:f},__type__:{object:x,boolean:v}},smooth:{enabled:{boolean:v},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:f},forceDirection:{string:["horizontal","vertical","none"],boolean:v},__type__:{object:x,boolean:v}},title:{string:y,undefined:"undefined"},width:{number:f},widthConstraint:{maximum:{number:f},__type__:{object:x,boolean:v,number:f}},value:{number:f,undefined:"undefined"},__type__:{object:x}},groups:{useDefaultGroups:{boolean:v},__any__:fi,__type__:{object:x}},interaction:{dragNodes:{boolean:v},dragView:{boolean:v},hideEdgesOnDrag:{boolean:v},hideEdgesOnZoom:{boolean:v},hideNodesOnDrag:{boolean:v},hover:{boolean:v},keyboard:{enabled:{boolean:v},speed:{x:{number:f},y:{number:f},zoom:{number:f},__type__:{object:x}},bindToWindow:{boolean:v},autoFocus:{boolean:v},__type__:{object:x,boolean:v}},multiselect:{boolean:v},navigationButtons:{boolean:v},selectable:{boolean:v},selectConnectedEdges:{boolean:v},hoverConnectedEdges:{boolean:v},tooltipDelay:{number:f},zoomView:{boolean:v},zoomSpeed:{number:f},__type__:{object:x}},layout:{randomSeed:{undefined:"undefined",number:f,string:y},improvedLayout:{boolean:v},clusterThreshold:{number:f},hierarchical:{enabled:{boolean:v},levelSeparation:{number:f},nodeSpacing:{number:f},treeSpacing:{number:f},blockShifting:{boolean:v},edgeMinimization:{boolean:v},parentCentralization:{boolean:v},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:x,boolean:v}},__type__:{object:x}},manipulation:{enabled:{boolean:v},initiallyActive:{boolean:v},addNode:{boolean:v,function:"function"},addEdge:{boolean:v,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:x,boolean:v,function:"function"}},deleteNode:{boolean:v,function:"function"},deleteEdge:{boolean:v,function:"function"},controlNodeStyle:fi,__type__:{object:x,boolean:v}},nodes:fi,physics:{enabled:{boolean:v},barnesHut:{theta:{number:f},gravitationalConstant:{number:f},centralGravity:{number:f},springLength:{number:f},springConstant:{number:f},damping:{number:f},avoidOverlap:{number:f},__type__:{object:x}},forceAtlas2Based:{theta:{number:f},gravitationalConstant:{number:f},centralGravity:{number:f},springLength:{number:f},springConstant:{number:f},damping:{number:f},avoidOverlap:{number:f},__type__:{object:x}},repulsion:{centralGravity:{number:f},springLength:{number:f},springConstant:{number:f},nodeDistance:{number:f},damping:{number:f},__type__:{object:x}},hierarchicalRepulsion:{centralGravity:{number:f},springLength:{number:f},springConstant:{number:f},nodeDistance:{number:f},damping:{number:f},avoidOverlap:{number:f},__type__:{object:x}},maxVelocity:{number:f},minVelocity:{number:f},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:v},iterations:{number:f},updateInterval:{number:f},onlyDynamicEdges:{boolean:v},fit:{boolean:v},__type__:{object:x,boolean:v}},timestep:{number:f},adaptiveTimestep:{boolean:v},wind:{x:{number:f},y:{number:f},__type__:{object:x}},__type__:{object:x,boolean:v}},autoResize:{boolean:v},clickToUse:{boolean:v},locale:{string:y},locales:{__any__:{any:ZM},__type__:{object:x}},height:{string:y},width:{string:y},__type__:{object:x}},Gh={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]}}},GM=(I,e,g)=>{var t;return!!(wg(I).call(I,"physics")&&wg(t=Gh.physics.solver).call(t,e)&&g.physics.solver!==e&&e!=="wind")};var Kn=class{constructor(){}getDistances(e,g,t){let A={},C=e.edges;for(let n=0;n<g.length;n++){let r=g[n],o={};A[r]=o;for(let s=0;s<g.length;s++)o[g[s]]=n==s?0:1e9}for(let n=0;n<t.length;n++){let r=C[t[n]];r.connected===!0&&A[r.fromId]!==void 0&&A[r.toId]!==void 0&&(A[r.fromId][r.toId]=1,A[r.toId][r.fromId]=1)}let i=g.length;for(let n=0;n<i;n++){let r=g[n],o=A[r];for(let s=0;s<i-1;s++){let a=g[s],d=A[a];for(let l=s+1;l<i;l++){let h=g[l],c=A[h],p=Math.min(d[h],d[r]+o[h]);d[h]=p,c[a]=p}}}return A}},Un=class{constructor(e,g,t){this.body=e,this.springLength=g,this.springConstant=t,this.distanceSolver=new Kn}setOptions(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}solve(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=this.distanceSolver.getDistances(this.body,e,g);this._createL_matrix(A),this._createK_matrix(A),this._createE_matrix();let C=.01,i=1,n=0,r=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),o=5,s=1e9,a=0,d=0,l=0,h=0,c=0;for(;s>C&&n<r;)for(n+=1,[a,s,d,l]=this._getHighestEnergyNode(t),h=s,c=0;h>i&&c<o;)c+=1,this._moveNode(a,d,l),[h,d,l]=this._getEnergy(a)}_getHighestEnergyNode(e){let g=this.body.nodeIndices,t=this.body.nodes,A=0,C=g[0],i=0,n=0;for(let r=0;r<g.length;r++){let o=g[r];if(t[o].predefinedPosition!==!0||t[o].isCluster===!0&&e===!0||t[o].options.fixed.x!==!0||t[o].options.fixed.y!==!0){let[s,a,d]=this._getEnergy(o);A<s&&(A=s,C=o,i=a,n=d)}}return[C,A,i,n]}_getEnergy(e){let[g,t]=this.E_sums[e];return[Math.sqrt(g**2+t**2),g,t]}_moveNode(e,g,t){let A=this.body.nodeIndices,C=this.body.nodes,i=0,n=0,r=0,o=C[e].x,s=C[e].y,a=this.K_matrix[e],d=this.L_matrix[e];for(let w=0;w<A.length;w++){let O=A[w];if(O!==e){let M=C[O].x,k=C[O].y,V=a[O],ye=d[O],ue=1/((o-M)**2+(s-k)**2)**1.5;i+=V*(1-ye*(s-k)**2*ue),n+=V*(ye*(o-M)*(s-k)*ue),r+=V*(1-ye*(o-M)**2*ue)}}let l=i,h=n,c=g,p=r,u=t,m=(c/l+u/h)/(h/l-p/h),E=-(h*m+c)/l;C[e].x+=E,C[e].y+=m,this._updateE_matrix(e)}_createL_matrix(e){let g=this.body.nodeIndices,t=this.springLength;this.L_matrix=[];for(let A=0;A<g.length;A++){this.L_matrix[g[A]]={};for(let C=0;C<g.length;C++)this.L_matrix[g[A]][g[C]]=t*e[g[A]][g[C]]}}_createK_matrix(e){let g=this.body.nodeIndices,t=this.springConstant;this.K_matrix=[];for(let A=0;A<g.length;A++){this.K_matrix[g[A]]={};for(let C=0;C<g.length;C++)this.K_matrix[g[A]][g[C]]=t*e[g[A]][g[C]]**-2}}_createE_matrix(){let e=this.body.nodeIndices,g=this.body.nodes;this.E_matrix={},this.E_sums={};for(let t=0;t<e.length;t++)this.E_matrix[e[t]]=[];for(let t=0;t<e.length;t++){let A=e[t],C=g[A].x,i=g[A].y,n=0,r=0;for(let o=t;o<e.length;o++){let s=e[o];if(s!==A){let a=g[s].x,d=g[s].y,l=1/Math.sqrt((C-a)**2+(i-d)**2);this.E_matrix[A][o]=[this.K_matrix[A][s]*(C-a-this.L_matrix[A][s]*(C-a)*l),this.K_matrix[A][s]*(i-d-this.L_matrix[A][s]*(i-d)*l)],this.E_matrix[s][t]=this.E_matrix[A][o],n+=this.E_matrix[A][o][0],r+=this.E_matrix[A][o][1]}}this.E_sums[A]=[n,r]}}_updateE_matrix(e){let g=this.body.nodeIndices,t=this.body.nodes,A=this.E_matrix[e],C=this.K_matrix[e],i=this.L_matrix[e],n=t[e].x,r=t[e].y,o=0,s=0;for(let a=0;a<g.length;a++){let d=g[a];if(d!==e){let l=A[a],h=l[0],c=l[1],p=t[d].x,u=t[d].y,m=1/Math.sqrt((n-p)**2+(r-u)**2),E=C[d]*(n-p-i[d]*(n-p)*m),w=C[d]*(r-u-i[d]*(r-u)*m);A[a]=[E,w],o+=E,s+=w;let O=this.E_sums[d];O[0]+=E-h,O[1]+=w-c}}this.E_sums[e]=[o,s]}};function T(I,e,g){var t,A,C,i;if(!(this instanceof T))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:E1,clickToUse:!1},q(this.options,this.defaultOptions),this.body={container:I,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:b(t=this.on).call(t,this),off:b(A=this.off).call(A,this),emit:b(C=this.emit).call(C,this),once:b(i=this.once).call(i,this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}},selectionBox:{show:!1,position:{start:{x:0,y:0},end:{x:0,y:0}}}},this.bindEventListeners(),this.images=new _i(()=>this.body.emitter.emit("_requestRedraw")),this.groups=new Ki,this.canvas=new Mn(this.body),this.selectionHandler=new Gn(this.body,this.canvas),this.interactionHandler=new zn(this.body,this.canvas,this.selectionHandler),this.view=new Fn(this.body,this.canvas),this.renderer=new kn(this.body,this.canvas),this.physics=new Nn(this.body),this.layoutEngine=new Wn(this.body),this.clustering=new Sn(this.body),this.manipulation=new _n(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new an(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new En(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new Un(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(g),this.setData(e)}ed(T.prototype);T.prototype.setOptions=function(I){if(I===null&&(I=void 0),I!==void 0){if(g1.validate(I,LM)===!0&&console.error("%cErrors have been found in the supplied options object.",jl),xt(["locale","locales","clickToUse"],this.options,I),I.locale!==void 0&&(I.locale=T1(I.locales||this.options.locales,I.locale)),I=this.layoutEngine.setOptions(I.layout,I),this.canvas.setOptions(I),this.groups.setOptions(I.groups),this.nodesHandler.setOptions(I.nodes),this.edgesHandler.setOptions(I.edges),this.physics.setOptions(I.physics),this.manipulation.setOptions(I.manipulation,I,this.options),this.interactionHandler.setOptions(I.interaction),this.renderer.setOptions(I.interaction),this.selectionHandler.setOptions(I.interaction),I.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in I&&(this.configurator||(this.configurator=new qO(this,this.body.container,Gh,this.canvas.pixelRatio,GM)),this.configurator.setOptions(I.configure)),this.configurator&&this.configurator.options.enabled===!0){let t={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};_(t.nodes,this.nodesHandler.options),_(t.edges,this.edgesHandler.options),_(t.layout,this.layoutEngine.options),_(t.interaction,this.selectionHandler.options),_(t.interaction,this.renderer.options),_(t.interaction,this.interactionHandler.options),_(t.manipulation,this.manipulation.options),_(t.physics,this.physics.options),_(t.global,this.canvas.options),_(t.global,this.options),this.configurator.setModuleOptions(t)}I.clickToUse!==void 0?I.clickToUse===!0?this.activator===void 0&&(this.activator=new $O(this.canvas.frame),this.activator.on("change",()=>{this.body.emitter.emit("activate")})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}};T.prototype._updateVisibleIndices=function(){let I=this.body.nodes,e=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(let g in I)Object.prototype.hasOwnProperty.call(I,g)&&!this.clustering._isClusteredNode(g)&&I[g].options.hidden===!1&&this.body.nodeIndices.push(I[g].id);for(let g in e)if(Object.prototype.hasOwnProperty.call(e,g)){let t=e[g],A=I[t.fromId],C=I[t.toId],i=A!==void 0&&C!==void 0;!this.clustering._isClusteredEdge(g)&&t.options.hidden===!1&&i&&A.options.hidden===!1&&C.options.hidden===!1&&this.body.edgeIndices.push(t.id)}};T.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")})};T.prototype.setData=function(I){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),I&&I.dot&&(I.nodes||I.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(I&&I.options),I&&I.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);");let e=a1(I.dot);this.setData(e);return}else if(I&&I.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);");let e=d1(I.gephi);this.setData(e);return}else this.nodesHandler.setData(I&&I.nodes,!0),this.edgesHandler.setData(I&&I.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")};T.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(let I in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,I)&&delete this.body.nodes[I];for(let I in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,I)&&delete this.body.edges[I];fg(this.body.container)};T.prototype._updateValueRange=function(I){let e,g,t,A=0;for(e in I)if(Object.prototype.hasOwnProperty.call(I,e)){let C=I[e].getValue();C!==void 0&&(g=g===void 0?C:Math.min(C,g),t=t===void 0?C:Math.max(C,t),A+=C)}if(g!==void 0&&t!==void 0)for(e in I)Object.prototype.hasOwnProperty.call(I,e)&&I[e].setValueRange(g,t,A)};T.prototype.isActive=function(){return!this.activator||this.activator.active};T.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)};T.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)};T.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)};T.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)};T.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)};T.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)};T.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)};T.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)};T.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)};T.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)};T.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)};T.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)};T.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)};T.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)};T.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)};T.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)};T.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)};T.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)};T.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)};T.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)};T.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)};T.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)};T.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)};T.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)};T.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)};T.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)};T.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)};T.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)};T.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)};T.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)};T.prototype.getConnectedNodes=function(I){return this.body.nodes[I]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)};T.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)};T.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)};T.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)};T.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)};T.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)};T.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)};T.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)};T.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)};T.prototype.getNodeAt=function(){let I=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return I!==void 0&&I.id!==void 0?I.id:I};T.prototype.getEdgeAt=function(){let I=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return I!==void 0&&I.id!==void 0?I.id:I};T.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)};T.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)};T.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()};T.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)};T.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)};T.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)};T.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)};T.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)};T.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)};T.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)};T.prototype.getOptionsFromConfigurator=function(){let I={};return this.configurator&&(I=this.configurator.getOptions.apply(this.configurator)),I};function rC(){return document.documentElement.getAttribute("data-theme")||"light"}function Mr(I){let e=getComputedStyle(document.documentElement);return{uri:e.getPropertyValue("--yasgui-graph-uri").trim()||"#97C2FC",literal:e.getPropertyValue("--yasgui-graph-literal").trim()||"#a6c8a6ff",blankNode:e.getPropertyValue("--yasgui-graph-blank-node").trim()||(I==="dark"?"#888888":"#c5c5c5ff"),typeObject:e.getPropertyValue("--yasgui-graph-type-object").trim()||"#e15b13ff",text:e.getPropertyValue("--yasgui-graph-text").trim()||(I==="dark"?"#e0e0e0":"#000000"),edge:e.getPropertyValue("--yasgui-graph-edge").trim()||(I==="dark"?"#666666":"#cccccc"),edgeLabel:e.getPropertyValue("--yasgui-graph-edge-label").trim()||(I==="dark"?"#cccccc":"#666666"),edgeLabelBackground:e.getPropertyValue("--yasgui-graph-edge-label-bg").trim()||(I==="dark"?"rgba(30, 30, 30, 0.8)":"rgba(255, 255, 255, 0.8)"),background:e.getPropertyValue("--yasgui-graph-background").trim()||(I==="dark"?"#1e1e1e":"#ffffff")}}function Vh(I){let e=new MutationObserver(g=>{g.forEach(t=>{if(t.attributeName==="data-theme"){let A=rC();I(A)}})});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),e}var Fr=class{constructor(e){this.yasr=e,this.network=null,this.currentTheme=rC(),this.themeObserver=null,this.nodesDataSet=null,this.edgesDataSet=null,this.triples=null,this.prefixMap=null}static get priority(){return 20}static get label(){return"Graph"}canHandleResults(){if(!this.yasr||!this.yasr.results)return!1;let e=this.yasr.results;if(e.getBindings&&typeof e.getBindings=="function"){let g=e.getBindings();if(g&&g.length>0){let t=g[0];return t.subject!==void 0&&t.predicate!==void 0&&t.object!==void 0}}return!1}draw(){this.yasr.resultsEl.innerHTML="";try{if(this.triples=Zr(this.yasr.results),!this.triples||this.triples.length===0){let r=document.createElement("div");r.className="yasgui-graph-plugin-empty-state",r.textContent="No graph data to visualize",this.yasr.resultsEl.appendChild(r);return}this.triples.length>1e3&&console.warn("Large graph detected (>1000 triples). Rendering may be slow."),this.prefixMap=zr(this.yasr),this.currentTheme=rC();let e=Mr(this.currentTheme),{nodes:g,edges:t}=dC(this.triples,this.prefixMap,e),A=document.createElement("div");A.className="yasgui-graph-plugin-container",A.id="yasgui-graph-plugin-container",this.yasr.resultsEl.appendChild(A),this.nodesDataSet=new rg(g),this.edgesDataSet=new rg(t);let C=sC(e);this.network=new T(A,{nodes:this.nodesDataSet,edges:this.edgesDataSet},C),this.applyCanvasBackground(e.background),this.network.on("stabilizationIterationsDone",()=>{this.network.setOptions({physics:{enabled:!0}}),this.network.fit({maxZoomLevel:1e3})}),this.themeObserver||(this.themeObserver=Vh(r=>{this.applyTheme(r)}));let i=document.createElement("div");i.className="yasgui-graph-controls",A.appendChild(i);let n=document.createElement("button");n.className="yasgui-graph-button",n.textContent="Zoom to Fit",n.onclick=()=>{this.network&&this.network.fit({maxZoomLevel:1e3,animation:{duration:300,easingFunction:"easeInOutQuad"}})},i.appendChild(n)}catch(e){console.error("Error rendering graph:",e);let g=document.createElement("div");g.className="yasgui-graph-plugin-error",g.textContent="Error rendering graph. See console for details.",this.yasr.resultsEl.appendChild(g)}}applyTheme(e){if(!this.network||!this.nodesDataSet||!this.triples||!this.prefixMap)return;this.currentTheme=e;let g=Mr(e),{nodes:t,edges:A}=dC(this.triples,this.prefixMap,g);this.nodesDataSet.clear(),this.nodesDataSet.add(t),this.edgesDataSet.clear(),this.edgesDataSet.add(A);let C=sC(g);this.network.setOptions(C),this.applyCanvasBackground(g.background)}applyCanvasBackground(e){this.network&&this.network.body&&this.network.body.container&&this.network.body.container.style.setProperty("--yasgui-graph-canvas-bg",e)}getIcon(){let e=document.createElement("div");return e.className="yasgui-graph-icon",e.setAttribute("aria-label","Graph visualization"),e.innerHTML=`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
909
909
  <circle cx="3" cy="3" r="2" />
910
910
  <circle cx="13" cy="3" r="2" />
911
911
  <circle cx="8" cy="13" r="2" />
912
912
  <line x1="4.5" y1="4" x2="7" y2="11.5" stroke="currentColor" stroke-width="1.5" />
913
913
  <line x1="11.5" y1="4" x2="9" y2="11.5" stroke="currentColor" stroke-width="1.5" />
914
914
  <line x1="5" y1="3" x2="11" y2="3" stroke="currentColor" stroke-width="1.5" />
915
- </svg>`,e}destroy(){this.themeObserver&&(this.themeObserver.disconnect(),this.themeObserver=null),this.network&&(this.network.destroy(),this.network=null)}},zo=Bo;typeof window!="undefined"&&window.Yasgui&&window.Yasgui.Yasr&&window.Yasgui.Yasr.registerPlugin("Graph",zo);var jM=zo;return Hh(WM);})();
915
+ </svg>`,e}destroy(){this.themeObserver&&(this.themeObserver.disconnect(),this.themeObserver=null),this.network&&(this.network.destroy(),this.network=null)}},Br=Fr;typeof window!="undefined"&&window.Yasgui&&window.Yasgui.Yasr&&window.Yasgui.Yasr.registerPlugin("Graph",Br);var VM=Br;return Hh(jM);})();
916
916
  /*! Bundled license information:
917
917
 
918
918
  vis-network/standalone/esm/vis-network.js: