"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[502],{33450(gR,tE,ur){ur.d(tE,{Network:()=>F});var Zt=ur(22172);/**
 * vis-network
 * https://visjs.github.io/vis-network/
 *
 * A dynamic, browser-based visualization library.
 *
 * @version 10.0.2
 * @date    2025-09-15T17:48:13.838Z
 *
 * @copyright (c) 2011-2017 Almende B.V, http://almende.com
 * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
 *
 * @license
 * vis.js is dual licensed under both
 *
 *   1. The Apache 2.0 License
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *   and
 *
 *   2. The MIT License
 *      http://opensource.org/licenses/MIT
 *
 * vis.js may be distributed under either license.
 */var su=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof ur.g<"u"?ur.g:typeof self<"u"?self:{};function L(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ou={},Pi,au;function ae(){if(au)return Pi;au=1;var n=function(e){return e&&e.Math===Math&&e};return Pi=n(typeof globalThis=="object"&&globalThis)||n(typeof window=="object"&&window)||n(typeof self=="object"&&self)||n(typeof su=="object"&&su)||n(typeof Pi=="object"&&Pi)||function(){return this}()||Function("return this")(),Pi}var Kr,du;function U(){return du||(du=1,Kr=function(n){try{return!!n()}catch{return!0}}),Kr}var Yr,lu;function Ci(){if(lu)return Yr;lu=1;var n=U();return Yr=!n(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Yr}var Xr,hu;function cr(){if(hu)return Xr;hu=1;var n=Ci(),e=Function.prototype,t=e.apply,i=e.call;return Xr=typeof Reflect=="object"&&Reflect.apply||(n?i.bind(t):function(){return i.apply(t,arguments)}),Xr}var Zr,uu;function G(){if(uu)return Zr;uu=1;var n=Ci(),e=Function.prototype,t=e.call,i=n&&e.bind.bind(t,t);return Zr=n?i:function(r){return function(){return t.apply(r,arguments)}},Zr}var Jr,cu;function Ze(){if(cu)return Jr;cu=1;var n=G(),e=n({}.toString),t=n("".slice);return Jr=function(i){return t(e(i),8,-1)},Jr}var Qr,fu;function en(){if(fu)return Qr;fu=1;var n=Ze(),e=G();return Qr=function(t){if(n(t)==="Function")return e(t)},Qr}var tn,pu;function we(){if(pu)return tn;pu=1;var n=typeof document=="object"&&document.all;return tn=typeof n>"u"&&n!==void 0?function(e){return typeof e=="function"||e===n}:function(e){return typeof e=="function"},tn}var rn={},nn,gu;function fe(){if(gu)return nn;gu=1;var n=U();return nn=!n(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),nn}var sn,vu;function De(){if(vu)return sn;vu=1;var n=Ci(),e=Function.prototype.call;return sn=n?e.bind(e):function(){return e.apply(e,arguments)},sn}var on={},mu;function fr(){if(mu)return on;mu=1;var n={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,t=e&&!n.call({1:2},1);return on.f=t?function(r){var s=e(this,r);return!!s&&s.enumerable}:n,on}var an,yu;function xi(){return yu||(yu=1,an=function(n,e){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:e}}),an}var dn,bu;function pr(){if(bu)return dn;bu=1;var n=G(),e=U(),t=Ze(),i=Object,r=n("".split);return dn=e(function(){return!i("z").propertyIsEnumerable(0)})?function(s){return t(s)==="String"?r(s,""):i(s)}:i,dn}var ln,wu;function Jt(){return wu||(wu=1,ln=function(n){return n==null}),ln}var hn,_u;function rt(){if(_u)return hn;_u=1;var n=Jt(),e=TypeError;return hn=function(t){if(n(t))throw new e("Can't call method on "+t);return t},hn}var un,Eu;function Ue(){if(Eu)return un;Eu=1;var n=pr(),e=rt();return un=function(t){return n(e(t))},un}var cn,Su;function _e(){if(Su)return cn;Su=1;var n=we();return cn=function(e){return typeof e=="object"?e!==null:n(e)},cn}var fn,Ou;function Z(){return Ou||(Ou=1,fn={}),fn}var pn,Iu;function Ne(){if(Iu)return pn;Iu=1;var n=Z(),e=ae(),t=we(),i=function(r){return t(r)?r:void 0};return pn=function(r,s){return arguments.length<2?i(n[r])||i(e[r]):n[r]&&n[r][s]||e[r]&&e[r][s]},pn}var gn,Tu;function ge(){if(Tu)return gn;Tu=1;var n=G();return gn=n({}.isPrototypeOf),gn}var vn,Pu;function Qt(){if(Pu)return vn;Pu=1;var n=ae(),e=n.navigator,t=e&&e.userAgent;return vn=t?String(t):"",vn}var mn,Cu;function Ri(){if(Cu)return mn;Cu=1;var n=ae(),e=Qt(),t=n.process,i=n.Deno,r=t&&t.versions||i&&i.version,s=r&&r.v8,o,a;return s&&(o=s.split("."),a=o[0]>0&&o[0]<4?1:+(o[0]+o[1])),!a&&e&&(o=e.match(/Edge\/(\d+)/),(!o||o[1]>=74)&&(o=e.match(/Chrome\/(\d+)/),o&&(a=+o[1]))),mn=a,mn}var yn,xu;function ei(){if(xu)return yn;xu=1;var n=Ri(),e=U(),t=ae(),i=t.String;return yn=!!Object.getOwnPropertySymbols&&!e(function(){var r=Symbol("symbol detection");return!i(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&n&&n<41}),yn}var bn,Ru;function Du(){if(Ru)return bn;Ru=1;var n=ei();return bn=n&&!Symbol.sham&&typeof Symbol.iterator=="symbol",bn}var wn,Mu;function Di(){if(Mu)return wn;Mu=1;var n=Ne(),e=we(),t=ge(),i=Du(),r=Object;return wn=i?function(s){return typeof s=="symbol"}:function(s){var o=n("Symbol");return e(o)&&t(o.prototype,r(s))},wn}var _n,qu;function ti(){if(qu)return _n;qu=1;var n=String;return _n=function(e){try{return n(e)}catch{return"Object"}},_n}var En,ku;function nt(){if(ku)return En;ku=1;var n=we(),e=ti(),t=TypeError;return En=function(i){if(n(i))return i;throw new t(e(i)+" is not a function")},En}var Sn,Fu;function On(){if(Fu)return Sn;Fu=1;var n=nt(),e=Jt();return Sn=function(t,i){var r=t[i];return e(r)?void 0:n(r)},Sn}var In,Nu;function iE(){if(Nu)return In;Nu=1;var n=De(),e=we(),t=_e(),i=TypeError;return In=function(r,s){var o,a;if(s==="string"&&e(o=r.toString)&&!t(a=n(o,r))||e(o=r.valueOf)&&!t(a=n(o,r))||s!=="string"&&e(o=r.toString)&&!t(a=n(o,r)))return a;throw new i("Can't convert object to primitive value")},In}var Tn={exports:{}},Pn,Au;function ii(){return Au||(Au=1,Pn=!0),Pn}var Cn,Bu;function rE(){if(Bu)return Cn;Bu=1;var n=ae(),e=Object.defineProperty;return Cn=function(t,i){try{e(n,t,{value:i,configurable:!0,writable:!0})}catch{n[t]=i}return i},Cn}var zu;function xn(){if(zu)return Tn.exports;zu=1;var n=ii(),e=ae(),t=rE(),i="__core-js_shared__",r=Tn.exports=e[i]||t(i,{});return(r.versions||(r.versions=[])).push({version:"3.44.0",mode:n?"pure":"global",copyright:"\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.44.0/LICENSE",source:"https://github.com/zloirock/core-js"}),Tn.exports}var Rn,Lu;function ri(){if(Lu)return Rn;Lu=1;var n=xn();return Rn=function(e,t){return n[e]||(n[e]=t||{})},Rn}var Dn,ju;function Ae(){if(ju)return Dn;ju=1;var n=rt(),e=Object;return Dn=function(t){return e(n(t))},Dn}var Mn,$u;function Se(){if($u)return Mn;$u=1;var n=G(),e=Ae(),t=n({}.hasOwnProperty);return Mn=Object.hasOwn||function(r,s){return t(e(r),s)},Mn}var qn,Hu;function gr(){if(Hu)return qn;Hu=1;var n=G(),e=0,t=Math.random(),i=n(1.1.toString);return qn=function(r){return"Symbol("+(r===void 0?"":r)+")_"+i(++e+t,36)},qn}var kn,Wu;function ve(){if(Wu)return kn;Wu=1;var n=ae(),e=ri(),t=Se(),i=gr(),r=ei(),s=Du(),o=n.Symbol,a=e("wks"),d=s?o.for||o:o&&o.withoutSetter||i;return kn=function(l){return t(a,l)||(a[l]=r&&t(o,l)?o[l]:d("Symbol."+l)),a[l]},kn}var Fn,Vu;function Uu(){if(Vu)return Fn;Vu=1;var n=De(),e=_e(),t=Di(),i=On(),r=iE(),s=ve(),o=TypeError,a=s("toPrimitive");return Fn=function(d,l){if(!e(d)||t(d))return d;var h=i(d,a),u;if(h){if(l===void 0&&(l="default"),u=n(h,d,l),!e(u)||t(u))return u;throw new o("Can't convert object to primitive value")}return l===void 0&&(l="number"),r(d,l)},Fn}var Nn,Gu;function An(){if(Gu)return Nn;Gu=1;var n=Uu(),e=Di();return Nn=function(t){var i=n(t,"string");return e(i)?i:i+""},Nn}var Bn,Ku;function Yu(){if(Ku)return Bn;Ku=1;var n=ae(),e=_e(),t=n.document,i=e(t)&&e(t.createElement);return Bn=function(r){return i?t.createElement(r):{}},Bn}var zn,Xu;function Zu(){if(Xu)return zn;Xu=1;var n=fe(),e=U(),t=Yu();return zn=!n&&!e(function(){return Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a!==7}),zn}var Ju;function vr(){if(Ju)return rn;Ju=1;var n=fe(),e=De(),t=fr(),i=xi(),r=Ue(),s=An(),o=Se(),a=Zu(),d=Object.getOwnPropertyDescriptor;return rn.f=n?d:function(h,u){if(h=r(h),u=s(u),a)try{return d(h,u)}catch{}if(o(h,u))return i(!e(t.f,h,u),h[u])},rn}var Ln,Qu;function nE(){if(Qu)return Ln;Qu=1;var n=U(),e=we(),t=/#|\.prototype\./,i=function(d,l){var h=s[r(d)];return h===a?!0:h===o?!1:e(l)?n(l):!!l},r=i.normalize=function(d){return String(d).replace(t,".").toLowerCase()},s=i.data={},o=i.NATIVE="N",a=i.POLYFILL="P";return Ln=i,Ln}var jn,ec;function mr(){if(ec)return jn;ec=1;var n=en(),e=nt(),t=Ci(),i=n(n.bind);return jn=function(r,s){return e(r),s===void 0?r:t?i(r,s):function(){return r.apply(s,arguments)}},jn}var $n={},Hn,tc;function ic(){if(tc)return Hn;tc=1;var n=fe(),e=U();return Hn=n&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Hn}var Wn,rc;function Je(){if(rc)return Wn;rc=1;var n=_e(),e=String,t=TypeError;return Wn=function(i){if(n(i))return i;throw new t(e(i)+" is not an object")},Wn}var nc;function Be(){if(nc)return $n;nc=1;var n=fe(),e=Zu(),t=ic(),i=Je(),r=An(),s=TypeError,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,d="enumerable",l="configurable",h="writable";return $n.f=n?t?function(c,f,p){if(i(c),f=r(f),i(p),typeof c=="function"&&f==="prototype"&&"value"in p&&h in p&&!p[h]){var g=a(c,f);g&&g[h]&&(c[f]=p.value,p={configurable:l in p?p[l]:g[l],enumerable:d in p?p[d]:g[d],writable:!1})}return o(c,f,p)}:o:function(c,f,p){if(i(c),f=r(f),i(p),e)try{return o(c,f,p)}catch{}if("get"in p||"set"in p)throw new s("Accessors not supported");return"value"in p&&(c[f]=p.value),c},$n}var Vn,sc;function ni(){if(sc)return Vn;sc=1;var n=fe(),e=Be(),t=xi();return Vn=n?function(i,r,s){return e.f(i,r,t(1,s))}:function(i,r,s){return i[r]=s,i},Vn}var Un,oc;function B(){if(oc)return Un;oc=1;var n=ae(),e=cr(),t=en(),i=we(),r=vr().f,s=nE(),o=Z(),a=mr(),d=ni(),l=Se(),h=function(u){var c=function(f,p,g){if(this instanceof c){switch(arguments.length){case 0:return new u;case 1:return new u(f);case 2:return new u(f,p)}return new u(f,p,g)}return e(u,this,arguments)};return c.prototype=u.prototype,c};return Un=function(u,c){var f=u.target,p=u.global,g=u.stat,b=u.proto,m=p?n:g?n[f]:n[f]&&n[f].prototype,v=p?o:o[f]||d(o,f,{})[f],w=v.prototype,y,_,O,T,E,I,P,M,x;for(T in c)y=s(p?T:f+(g?".":"#")+T,u.forced),_=!y&&m&&l(m,T),I=v[T],_&&(u.dontCallGetSet?(x=r(m,T),P=x&&x.value):P=m[T]),E=_&&P?P:c[T],!(!y&&!b&&typeof I==typeof E)&&(u.bind&&_?M=a(E,n):u.wrap&&_?M=h(E):b&&i(E)?M=t(E):M=E,(u.sham||E&&E.sham||I&&I.sham)&&d(M,"sham",!0),d(v,T,M),b&&(O=f+"Prototype",l(o,O)||d(o,O,{}),d(o[O],T,E),u.real&&w&&(y||!w[T])&&d(w,T,E)))},Un}var Gn,ac;function sE(){if(ac)return Gn;ac=1;var n=Math.ceil,e=Math.floor;return Gn=Math.trunc||function(i){var r=+i;return(r>0?e:n)(r)},Gn}var Kn,dc;function si(){if(dc)return Kn;dc=1;var n=sE();return Kn=function(e){var t=+e;return t!==t||t===0?0:n(t)},Kn}var Yn,lc;function yr(){if(lc)return Yn;lc=1;var n=si(),e=Math.max,t=Math.min;return Yn=function(i,r){var s=n(i);return s<0?e(s+r,0):t(s,r)},Yn}var Xn,hc;function uc(){if(hc)return Xn;hc=1;var n=si(),e=Math.min;return Xn=function(t){var i=n(t);return i>0?e(i,9007199254740991):0},Xn}var Zn,cc;function st(){if(cc)return Zn;cc=1;var n=uc();return Zn=function(e){return n(e.length)},Zn}var Jn,fc;function Qn(){if(fc)return Jn;fc=1;var n=Ue(),e=yr(),t=st(),i=function(r){return function(s,o,a){var d=n(s),l=t(d);if(l===0)return!r&&-1;var h=e(a,l),u;if(r&&o!==o){for(;l>h;)if(u=d[h++],u!==u)return!0}else for(;l>h;h++)if((r||h in d)&&d[h]===o)return r||h||0;return!r&&-1}};return Jn={includes:i(!0),indexOf:i(!1)},Jn}var es,pc;function Mi(){return pc||(pc=1,es={}),es}var ts,gc;function vc(){if(gc)return ts;gc=1;var n=G(),e=Se(),t=Ue(),i=Qn().indexOf,r=Mi(),s=n([].push);return ts=function(o,a){var d=t(o),l=0,h=[],u;for(u in d)!e(r,u)&&e(d,u)&&s(h,u);for(;a.length>l;)e(d,u=a[l++])&&(~i(h,u)||s(h,u));return h},ts}var is,mc;function rs(){return mc||(mc=1,is=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),is}var ns,yc;function qi(){if(yc)return ns;yc=1;var n=vc(),e=rs();return ns=Object.keys||function(i){return n(i,e)},ns}var ss={},bc;function br(){return bc||(bc=1,ss.f=Object.getOwnPropertySymbols),ss}var os,wc;function oE(){if(wc)return os;wc=1;var n=fe(),e=G(),t=De(),i=U(),r=qi(),s=br(),o=fr(),a=Ae(),d=pr(),l=Object.assign,h=Object.defineProperty,u=e([].concat);return os=!l||i(function(){if(n&&l({b:1},l(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var c={},f={},p=Symbol("assign detection"),g="abcdefghijklmnopqrst";return c[p]=7,g.split("").forEach(function(b){f[b]=b}),l({},c)[p]!==7||r(l({},f)).join("")!==g})?function(f,p){for(var g=a(f),b=arguments.length,m=1,v=s.f,w=o.f;b>m;)for(var y=d(arguments[m++]),_=v?u(r(y),v(y)):r(y),O=_.length,T=0,E;O>T;)E=_[T++],(!n||t(w,y,E))&&(g[E]=y[E]);return g}:l,os}var _c;function aE(){if(_c)return ou;_c=1;var n=B(),e=oE();return n({target:"Object",stat:!0,arity:2,forced:Object.assign!==e},{assign:e}),ou}var as,Ec;function dE(){if(Ec)return as;Ec=1,aE();var n=Z();return as=n.Object.assign,as}var ds,Sc;function lE(){if(Sc)return ds;Sc=1;var n=dE();return ds=n,ds}var ls,Oc;function hE(){return Oc||(Oc=1,ls=lE()),ls}var uE=hE(),me=L(uE),Ic={},hs,Tc;function oi(){if(Tc)return hs;Tc=1;var n=G();return hs=n([].slice),hs}var us,Pc;function cE(){if(Pc)return us;Pc=1;var n=G(),e=nt(),t=_e(),i=Se(),r=oi(),s=Ci(),o=Function,a=n([].concat),d=n([].join),l={},h=function(u,c,f){if(!i(l,c)){for(var p=[],g=0;g<c;g++)p[g]="a["+g+"]";l[c]=o("C,a","return new C("+d(p,",")+")")}return l[c](u,f)};return us=s?o.bind:function(c){var f=e(this),p=f.prototype,g=r(arguments,1),b=function(){var v=a(g,r(arguments));return this instanceof b?h(f,v.length,v):f.apply(c,v)};return t(p)&&(b.prototype=p),b},us}var Cc;function fE(){if(Cc)return Ic;Cc=1;var n=B(),e=cE();return n({target:"Function",proto:!0,forced:Function.bind!==e},{bind:e}),Ic}var cs,xc;function Oe(){if(xc)return cs;xc=1;var n=ae(),e=Z();return cs=function(t,i){var r=e[t+"Prototype"],s=r&&r[i];if(s)return s;var o=n[t],a=o&&o.prototype;return a&&a[i]},cs}var fs,Rc;function pE(){if(Rc)return fs;Rc=1,fE();var n=Oe();return fs=n("Function","bind"),fs}var ps,Dc;function gE(){if(Dc)return ps;Dc=1;var n=ge(),e=pE(),t=Function.prototype;return ps=function(i){var r=i.bind;return i===t||n(t,i)&&r===t.bind?e:r},ps}var gs,Mc;function vE(){if(Mc)return gs;Mc=1;var n=gE();return gs=n,gs}var vs,qc;function mE(){return qc||(qc=1,vs=vE()),vs}var yE=mE(),D=L(yE);function ms(n,e,t,i){n.beginPath(),n.arc(e,t,i,0,2*Math.PI,!1),n.closePath()}function bE(n,e,t,i){n.beginPath(),n.rect(e-i,t-i,i*2,i*2),n.closePath()}function wE(n,e,t,i){n.beginPath(),i*=1.15,t+=.275*i;const r=i*2,s=r/2,o=Math.sqrt(3)/6*r,a=Math.sqrt(r*r-s*s);n.moveTo(e,t-(a-o)),n.lineTo(e+s,t+o),n.lineTo(e-s,t+o),n.lineTo(e,t-(a-o)),n.closePath()}function _E(n,e,t,i){n.beginPath(),i*=1.15,t-=.275*i;const r=i*2,s=r/2,o=Math.sqrt(3)/6*r,a=Math.sqrt(r*r-s*s);n.moveTo(e,t+(a-o)),n.lineTo(e+s,t-o),n.lineTo(e-s,t-o),n.lineTo(e,t+(a-o)),n.closePath()}function EE(n,e,t,i){n.beginPath(),i*=.82,t+=.1*i;for(let r=0;r<10;r++){const s=r%2===0?i*1.3:i*.5;n.lineTo(e+s*Math.sin(r*2*Math.PI/10),t-s*Math.cos(r*2*Math.PI/10))}n.closePath()}function SE(n,e,t,i){n.beginPath(),n.lineTo(e,t+i),n.lineTo(e+i,t),n.lineTo(e,t-i),n.lineTo(e-i,t),n.closePath()}function kc(n,e,t,i,r,s){const o=Math.PI/180;i-2*s<0&&(s=i/2),r-2*s<0&&(s=r/2),n.beginPath(),n.moveTo(e+s,t),n.lineTo(e+i-s,t),n.arc(e+i-s,t+s,s,o*270,o*360,!1),n.lineTo(e+i,t+r-s),n.arc(e+i-s,t+r-s,s,0,o*90,!1),n.lineTo(e+s,t+r),n.arc(e+s,t+r-s,s,o*90,o*180,!1),n.lineTo(e,t+s),n.arc(e+s,t+s,s,o*180,o*270,!1),n.closePath()}function ys(n,e,t,i,r){const s=.5522848,o=i/2*s,a=r/2*s,d=e+i,l=t+r,h=e+i/2,u=t+r/2;n.beginPath(),n.moveTo(e,u),n.bezierCurveTo(e,u-a,h-o,t,h,t),n.bezierCurveTo(h+o,t,d,u-a,d,u),n.bezierCurveTo(d,u+a,h+o,l,h,l),n.bezierCurveTo(h-o,l,e,u+a,e,u),n.closePath()}function Fc(n,e,t,i,r){const s=.3333333333333333,o=i,a=r*s,d=.5522848,l=o/2*d,h=a/2*d,u=e+o,c=t+a,f=e+o/2,p=t+a/2,g=t+(r-a/2),b=t+r;n.beginPath(),n.moveTo(u,p),n.bezierCurveTo(u,p+h,f+l,c,f,c),n.bezierCurveTo(f-l,c,e,p+h,e,p),n.bezierCurveTo(e,p-h,f-l,t,f,t),n.bezierCurveTo(f+l,t,u,p-h,u,p),n.lineTo(u,g),n.bezierCurveTo(u,g+h,f+l,b,f,b),n.bezierCurveTo(f-l,b,e,g+h,e,g),n.lineTo(e,p)}function Nc(n,e,t,i,r,s){n.beginPath(),n.moveTo(e,t);const o=s.length,a=i-e,d=r-t,l=d/a;let h=Math.sqrt(a*a+d*d),u=0,c=!0,f=0,p=+s[0];for(;h>=.1;)p=+s[u++%o],p>h&&(p=h),f=Math.sqrt(p*p/(1+l*l)),f=a<0?-f:f,e+=f,t+=l*f,c===!0?n.lineTo(e,t):n.moveTo(e,t),h-=p,c=!c}function OE(n,e,t,i){n.beginPath();const r=6,s=Math.PI*2/r;n.moveTo(e+i,t);for(let o=1;o<r;o++)n.lineTo(e+i*Math.cos(s*o),t+i*Math.sin(s*o));n.closePath()}const Ac={circle:ms,dashedLine:Nc,database:Fc,diamond:SE,ellipse:ys,ellipse_vis:ys,hexagon:OE,roundRect:kc,square:bE,star:EE,triangle:wE,triangleDown:_E};function IE(n){return Object.prototype.hasOwnProperty.call(Ac,n)?Ac[n]:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];CanvasRenderingContext2D.prototype[n].call(e,i)}}var bs={exports:{}},Bc;function TE(){return Bc||(Bc=1,function(n){n.exports=e;function e(i){if(i)return t(i)}function t(i){for(var r in e.prototype)i[r]=e.prototype[r];return i}e.prototype.on=e.prototype.addEventListener=function(i,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(r),this},e.prototype.once=function(i,r){function s(){this.off(i,s),r.apply(this,arguments)}return s.fn=r,this.on(i,s),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(i,r){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var s=this._callbacks["$"+i];if(!s)return this;if(arguments.length==1)return delete this._callbacks["$"+i],this;for(var o,a=0;a<s.length;a++)if(o=s[a],o===r||o.fn===r){s.splice(a,1);break}return s.length===0&&delete this._callbacks["$"+i],this},e.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),s=this._callbacks["$"+i],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(s){s=s.slice(0);for(var o=0,a=s.length;o<a;++o)s[o].apply(this,r)}return this},e.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]},e.prototype.hasListeners=function(i){return!!this.listeners(i).length}}(bs)),bs.exports}var PE=TE(),zc=L(PE),Lc={},ws,jc;function Pt(){if(jc)return ws;jc=1;var n=Ze();return ws=Array.isArray||function(t){return n(t)==="Array"},ws}var _s,$c;function Hc(){if($c)return _s;$c=1;var n=TypeError,e=9007199254740991;return _s=function(t){if(t>e)throw n("Maximum allowed index exceeded");return t},_s}var Es,Wc;function wr(){if(Wc)return Es;Wc=1;var n=fe(),e=Be(),t=xi();return Es=function(i,r,s){n?e.f(i,r,t(0,s)):i[r]=s},Es}var Ss,Vc;function Os(){if(Vc)return Ss;Vc=1;var n=ve(),e=n("toStringTag"),t={};return t[e]="z",Ss=String(t)==="[object z]",Ss}var Is,Uc;function ai(){if(Uc)return Is;Uc=1;var n=Os(),e=we(),t=Ze(),i=ve(),r=i("toStringTag"),s=Object,o=t(function(){return arguments}())==="Arguments",a=function(d,l){try{return d[l]}catch{}};return Is=n?t:function(d){var l,h,u;return d===void 0?"Undefined":d===null?"Null":typeof(h=a(l=s(d),r))=="string"?h:o?t(l):(u=t(l))==="Object"&&e(l.callee)?"Arguments":u},Is}var Ts,Gc;function CE(){if(Gc)return Ts;Gc=1;var n=G(),e=we(),t=xn(),i=n(Function.toString);return e(t.inspectSource)||(t.inspectSource=function(r){return i(r)}),Ts=t.inspectSource,Ts}var Ps,Kc;function Yc(){if(Kc)return Ps;Kc=1;var n=G(),e=U(),t=we(),i=ai(),r=Ne(),s=CE(),o=function(){},a=r("Reflect","construct"),d=/^\s*(?:class|function)\b/,l=n(d.exec),h=!d.test(o),u=function(p){if(!t(p))return!1;try{return a(o,[],p),!0}catch{return!1}},c=function(p){if(!t(p))return!1;switch(i(p)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!l(d,s(p))}catch{return!0}};return c.sham=!0,Ps=!a||e(function(){var f;return u(u.call)||!u(Object)||!u(function(){f=!0})||f})?c:u,Ps}var Cs,Xc;function xE(){if(Xc)return Cs;Xc=1;var n=Pt(),e=Yc(),t=_e(),i=ve(),r=i("species"),s=Array;return Cs=function(o){var a;return n(o)&&(a=o.constructor,e(a)&&(a===s||n(a.prototype))?a=void 0:t(a)&&(a=a[r],a===null&&(a=void 0))),a===void 0?s:a},Cs}var xs,Zc;function Rs(){if(Zc)return xs;Zc=1;var n=xE();return xs=function(e,t){return new(n(e))(t===0?0:t)},xs}var Ds,Jc;function ki(){if(Jc)return Ds;Jc=1;var n=U(),e=ve(),t=Ri(),i=e("species");return Ds=function(r){return t>=51||!n(function(){var s=[],o=s.constructor={};return o[i]=function(){return{foo:1}},s[r](Boolean).foo!==1})},Ds}var Qc;function ef(){if(Qc)return Lc;Qc=1;var n=B(),e=U(),t=Pt(),i=_e(),r=Ae(),s=st(),o=Hc(),a=wr(),d=Rs(),l=ki(),h=ve(),u=Ri(),c=h("isConcatSpreadable"),f=u>=51||!e(function(){var b=[];return b[c]=!1,b.concat()[0]!==b}),p=function(b){if(!i(b))return!1;var m=b[c];return m!==void 0?!!m:t(b)},g=!f||!l("concat");return n({target:"Array",proto:!0,arity:1,forced:g},{concat:function(m){var v=r(this),w=d(v,0),y=0,_,O,T,E,I;for(_=-1,T=arguments.length;_<T;_++)if(I=_===-1?v:arguments[_],p(I))for(E=s(I),o(y+E),O=0;O<E;O++,y++)O in I&&a(w,y,I[O]);else o(y+1),a(w,y++,I);return w.length=y,w}}),Lc}var tf={},rf={},Ms,nf;function ze(){if(nf)return Ms;nf=1;var n=ai(),e=String;return Ms=function(t){if(n(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(t)},Ms}var qs={},sf;function ks(){if(sf)return qs;sf=1;var n=fe(),e=ic(),t=Be(),i=Je(),r=Ue(),s=qi();return qs.f=n&&!e?Object.defineProperties:function(a,d){i(a);for(var l=r(d),h=s(d),u=h.length,c=0,f;u>c;)t.f(a,f=h[c++],l[f]);return a},qs}var Fs,of;function RE(){if(of)return Fs;of=1;var n=Ne();return Fs=n("document","documentElement"),Fs}var Ns,af;function _r(){if(af)return Ns;af=1;var n=ri(),e=gr(),t=n("keys");return Ns=function(i){return t[i]||(t[i]=e(i))},Ns}var As,df;function Fi(){if(df)return As;df=1;var n=Je(),e=ks(),t=rs(),i=Mi(),r=RE(),s=Yu(),o=_r(),a=">",d="<",l="prototype",h="script",u=o("IE_PROTO"),c=function(){},f=function(v){return d+h+a+v+d+"/"+h+a},p=function(v){v.write(f("")),v.close();var w=v.parentWindow.Object;return v=null,w},g=function(){var v=s("iframe"),w="java"+h+":",y;return v.style.display="none",r.appendChild(v),v.src=String(w),y=v.contentWindow.document,y.open(),y.write(f("document.F=Object")),y.close(),y.F},b,m=function(){try{b=new ActiveXObject("htmlfile")}catch{}m=typeof document<"u"?document.domain&&b?p(b):g():p(b);for(var v=t.length;v--;)delete m[l][t[v]];return m()};return i[u]=!0,As=Object.create||function(w,y){var _;return w!==null?(c[l]=n(w),_=new c,c[l]=null,_[u]=w):_=m(),y===void 0?_:e.f(_,y)},As}var Bs={},lf;function Er(){if(lf)return Bs;lf=1;var n=vc(),e=rs(),t=e.concat("length","prototype");return Bs.f=Object.getOwnPropertyNames||function(r){return n(r,t)},Bs}var zs={},hf;function Ls(){if(hf)return zs;hf=1;var n=Ze(),e=Ue(),t=Er().f,i=oi(),r=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(o){try{return t(o)}catch{return i(r)}};return zs.f=function(a){return r&&n(a)==="Window"?s(a):t(e(a))},zs}var js,uf;function Ni(){if(uf)return js;uf=1;var n=ni();return js=function(e,t,i,r){return r&&r.enumerable?e[t]=i:n(e,t,i),e},js}var $s,cf;function Hs(){if(cf)return $s;cf=1;var n=Be();return $s=function(e,t,i){return n.f(e,t,i)},$s}var Ws={},ff;function Sr(){if(ff)return Ws;ff=1;var n=ve();return Ws.f=n,Ws}var Vs,pf;function le(){if(pf)return Vs;pf=1;var n=Z(),e=Se(),t=Sr(),i=Be().f;return Vs=function(r){var s=n.Symbol||(n.Symbol={});e(s,r)||i(s,r,{value:t.f(r)})},Vs}var Us,gf;function vf(){if(gf)return Us;gf=1;var n=De(),e=Ne(),t=ve(),i=Ni();return Us=function(){var r=e("Symbol"),s=r&&r.prototype,o=s&&s.valueOf,a=t("toPrimitive");s&&!s[a]&&i(s,a,function(d){return n(o,this)},{arity:1})},Us}var Gs,mf;function DE(){if(mf)return Gs;mf=1;var n=Os(),e=ai();return Gs=n?{}.toString:function(){return"[object "+e(this)+"]"},Gs}var Ks,yf;function Ct(){if(yf)return Ks;yf=1;var n=Os(),e=Be().f,t=ni(),i=Se(),r=DE(),s=ve(),o=s("toStringTag");return Ks=function(a,d,l,h){var u=l?a:a&&a.prototype;u&&(i(u,o)||e(u,o,{configurable:!0,value:d}),h&&!n&&t(u,"toString",r))},Ks}var Ys,bf;function wf(){if(bf)return Ys;bf=1;var n=ae(),e=we(),t=n.WeakMap;return Ys=e(t)&&/native code/.test(String(t)),Ys}var Xs,_f;function xt(){if(_f)return Xs;_f=1;var n=wf(),e=ae(),t=_e(),i=ni(),r=Se(),s=xn(),o=_r(),a=Mi(),d="Object already initialized",l=e.TypeError,h=e.WeakMap,u,c,f,p=function(v){return f(v)?c(v):u(v,{})},g=function(v){return function(w){var y;if(!t(w)||(y=c(w)).type!==v)throw new l("Incompatible receiver, "+v+" required");return y}};if(n||s.state){var b=s.state||(s.state=new h);b.get=b.get,b.has=b.has,b.set=b.set,u=function(v,w){if(b.has(v))throw new l(d);return w.facade=v,b.set(v,w),w},c=function(v){return b.get(v)||{}},f=function(v){return b.has(v)}}else{var m=o("state");a[m]=!0,u=function(v,w){if(r(v,m))throw new l(d);return w.facade=v,i(v,m,w),w},c=function(v){return r(v,m)?v[m]:{}},f=function(v){return r(v,m)}}return Xs={set:u,get:c,has:f,enforce:p,getterFor:g},Xs}var Zs,Ef;function ft(){if(Ef)return Zs;Ef=1;var n=mr(),e=G(),t=pr(),i=Ae(),r=st(),s=Rs(),o=e([].push),a=function(d){var l=d===1,h=d===2,u=d===3,c=d===4,f=d===6,p=d===7,g=d===5||f;return function(b,m,v,w){for(var y=i(b),_=t(y),O=r(_),T=n(m,v),E=0,I=w||s,P=l?I(b,O):h||p?I(b,0):void 0,M,x;O>E;E++)if((g||E in _)&&(M=_[E],x=T(M,E,y),d))if(l)P[E]=x;else if(x)switch(d){case 3:return!0;case 5:return M;case 6:return E;case 2:o(P,M)}else switch(d){case 4:return!1;case 7:o(P,M)}return f?-1:u||c?c:P}};return Zs={forEach:a(0),map:a(1),filter:a(2),some:a(3),every:a(4),find:a(5),findIndex:a(6),filterReject:a(7)},Zs}var Sf;function ME(){if(Sf)return rf;Sf=1;var n=B(),e=ae(),t=De(),i=G(),r=ii(),s=fe(),o=ei(),a=U(),d=Se(),l=ge(),h=Je(),u=Ue(),c=An(),f=ze(),p=xi(),g=Fi(),b=qi(),m=Er(),v=Ls(),w=br(),y=vr(),_=Be(),O=ks(),T=fr(),E=Ni(),I=Hs(),P=ri(),M=_r(),x=Mi(),C=gr(),k=ve(),N=Sr(),W=le(),j=vf(),ee=Ct(),ne=xt(),be=ft().forEach,X=M("hidden"),Te="Symbol",We="prototype",Xe=ne.set,dr=ne.getterFor(Te),Ve=Object[We],Yt=e.Symbol,lr=Yt&&Yt[We],hR=e.RangeError,uR=e.TypeError,Qh=e.QObject,U0=y.f,Xt=_.f,G0=v.f,cR=T.f,K0=i([].push),ct=P("symbols"),hr=P("op-symbols"),fR=P("wks"),eu=!Qh||!Qh[We]||!Qh[We].findChild,Y0=function(se,V,K){var Y=U0(Ve,V);Y&&delete Ve[V],Xt(se,V,K),Y&&se!==Ve&&Xt(Ve,V,Y)},tu=s&&a(function(){return g(Xt({},"a",{get:function(){return Xt(this,"a",{value:7}).a}})).a!==7})?Y0:Xt,iu=function(se,V){var K=ct[se]=g(lr);return Xe(K,{type:Te,tag:se,description:V}),s||(K.description=V),K},Gr=function(V,K,Y){V===Ve&&Gr(hr,K,Y),h(V);var oe=c(K);return h(Y),d(ct,oe)?(Y.enumerable?(d(V,X)&&V[X][oe]&&(V[X][oe]=!1),Y=g(Y,{enumerable:p(0,!1)})):(d(V,X)||Xt(V,X,p(1,g(null))),V[X][oe]=!0),tu(V,oe,Y)):Xt(V,oe,Y)},ru=function(V,K){h(V);var Y=u(K),oe=b(Y).concat(J0(Y));return be(oe,function(Fe){(!s||t(nu,Y,Fe))&&Gr(V,Fe,Y[Fe])}),V},pR=function(V,K){return K===void 0?g(V):ru(g(V),K)},nu=function(V){var K=c(V),Y=t(cR,this,K);return this===Ve&&d(ct,K)&&!d(hr,K)?!1:Y||!d(this,K)||!d(ct,K)||d(this,X)&&this[X][K]?Y:!0},X0=function(V,K){var Y=u(V),oe=c(K);if(!(Y===Ve&&d(ct,oe)&&!d(hr,oe))){var Fe=U0(Y,oe);return Fe&&d(ct,oe)&&!(d(Y,X)&&Y[X][oe])&&(Fe.enumerable=!0),Fe}},Z0=function(V){var K=G0(u(V)),Y=[];return be(K,function(oe){!d(ct,oe)&&!d(x,oe)&&K0(Y,oe)}),Y},J0=function(se){var V=se===Ve,K=G0(V?hr:u(se)),Y=[];return be(K,function(oe){d(ct,oe)&&(!V||d(Ve,oe))&&K0(Y,ct[oe])}),Y};return o||(Yt=function(){if(l(lr,this))throw new uR("Symbol is not a constructor");var V=!arguments.length||arguments[0]===void 0?void 0:f(arguments[0]),K=C(V),Y=function(oe){var Fe=this===void 0?e:this;Fe===Ve&&t(Y,hr,oe),d(Fe,X)&&d(Fe[X],K)&&(Fe[X][K]=!1);var Q0=p(1,oe);try{tu(Fe,K,Q0)}catch(eE){if(!(eE instanceof hR))throw eE;Y0(Fe,K,Q0)}};return s&&eu&&tu(Ve,K,{configurable:!0,set:Y}),iu(K,V)},lr=Yt[We],E(lr,"toString",function(){return dr(this).tag}),E(Yt,"withoutSetter",function(se){return iu(C(se),se)}),T.f=nu,_.f=Gr,O.f=ru,y.f=X0,m.f=v.f=Z0,w.f=J0,N.f=function(se){return iu(k(se),se)},s&&(I(lr,"description",{configurable:!0,get:function(){return dr(this).description}}),r||E(Ve,"propertyIsEnumerable",nu,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!o,sham:!o},{Symbol:Yt}),be(b(fR),function(se){W(se)}),n({target:Te,stat:!0,forced:!o},{useSetter:function(){eu=!0},useSimple:function(){eu=!1}}),n({target:"Object",stat:!0,forced:!o,sham:!s},{create:pR,defineProperty:Gr,defineProperties:ru,getOwnPropertyDescriptor:X0}),n({target:"Object",stat:!0,forced:!o},{getOwnPropertyNames:Z0}),j(),ee(Yt,Te),x[X]=!0,rf}var Of={},Js,If;function Tf(){if(If)return Js;If=1;var n=ei();return Js=n&&!!Symbol.for&&!!Symbol.keyFor,Js}var Pf;function qE(){if(Pf)return Of;Pf=1;var n=B(),e=Ne(),t=Se(),i=ze(),r=ri(),s=Tf(),o=r("string-to-symbol-registry"),a=r("symbol-to-string-registry");return n({target:"Symbol",stat:!0,forced:!s},{for:function(d){var l=i(d);if(t(o,l))return o[l];var h=e("Symbol")(l);return o[l]=h,a[h]=l,h}}),Of}var Cf={},xf;function kE(){if(xf)return Cf;xf=1;var n=B(),e=Se(),t=Di(),i=ti(),r=ri(),s=Tf(),o=r("symbol-to-string-registry");return n({target:"Symbol",stat:!0,forced:!s},{keyFor:function(d){if(!t(d))throw new TypeError(i(d)+" is not a symbol");if(e(o,d))return o[d]}}),Cf}var Rf={},Qs,Df;function FE(){if(Df)return Qs;Df=1;var n=G(),e=Pt(),t=we(),i=Ze(),r=ze(),s=n([].push);return Qs=function(o){if(t(o))return o;if(e(o)){for(var a=o.length,d=[],l=0;l<a;l++){var h=o[l];typeof h=="string"?s(d,h):(typeof h=="number"||i(h)==="Number"||i(h)==="String")&&s(d,r(h))}var u=d.length,c=!0;return function(f,p){if(c)return c=!1,p;if(e(this))return p;for(var g=0;g<u;g++)if(d[g]===f)return p}}},Qs}var Mf;function qf(){if(Mf)return Rf;Mf=1;var n=B(),e=Ne(),t=cr(),i=De(),r=G(),s=U(),o=we(),a=Di(),d=oi(),l=FE(),h=ei(),u=String,c=e("JSON","stringify"),f=r(/./.exec),p=r("".charAt),g=r("".charCodeAt),b=r("".replace),m=r(1.1.toString),v=/[\uD800-\uDFFF]/g,w=/^[\uD800-\uDBFF]$/,y=/^[\uDC00-\uDFFF]$/,_=!h||s(function(){var I=e("Symbol")("stringify detection");return c([I])!=="[null]"||c({a:I})!=="{}"||c(Object(I))!=="{}"}),O=s(function(){return c("\uDF06\uD834")!=='"\\udf06\\ud834"'||c("\uDEAD")!=='"\\udead"'}),T=function(I,P){var M=d(arguments),x=l(P);if(!(!o(x)&&(I===void 0||a(I))))return M[1]=function(C,k){if(o(x)&&(k=i(x,this,u(C),k)),!a(k))return k},t(c,null,M)},E=function(I,P,M){var x=p(M,P-1),C=p(M,P+1);return f(w,I)&&!f(y,C)||f(y,I)&&!f(w,x)?"\\u"+m(g(I,0),16):I};return c&&n({target:"JSON",stat:!0,arity:3,forced:_||O},{stringify:function(P,M,x){var C=d(arguments),k=t(_?T:c,null,C);return O&&typeof k=="string"?b(k,v,E):k}}),Rf}var kf={},Ff;function NE(){if(Ff)return kf;Ff=1;var n=B(),e=ei(),t=U(),i=br(),r=Ae(),s=!e||t(function(){i.f(1)});return n({target:"Object",stat:!0,forced:s},{getOwnPropertySymbols:function(a){var d=i.f;return d?d(r(a)):[]}}),kf}var Nf;function Af(){return Nf||(Nf=1,ME(),qE(),kE(),qf(),NE()),tf}var Bf={},zf;function Lf(){if(zf)return Bf;zf=1;var n=le();return n("asyncDispose"),Bf}var jf={},$f;function AE(){if($f)return jf;$f=1;var n=le();return n("asyncIterator"),jf}var Hf={},Wf;function Vf(){if(Wf)return Hf;Wf=1;var n=le();return n("dispose"),Hf}var Uf={},Gf;function BE(){if(Gf)return Uf;Gf=1;var n=le();return n("hasInstance"),Uf}var Kf={},Yf;function zE(){if(Yf)return Kf;Yf=1;var n=le();return n("isConcatSpreadable"),Kf}var Xf={},Zf;function Jf(){if(Zf)return Xf;Zf=1;var n=le();return n("iterator"),Xf}var Qf={},ep;function LE(){if(ep)return Qf;ep=1;var n=le();return n("match"),Qf}var tp={},ip;function jE(){if(ip)return tp;ip=1;var n=le();return n("matchAll"),tp}var rp={},np;function $E(){if(np)return rp;np=1;var n=le();return n("replace"),rp}var sp={},op;function HE(){if(op)return sp;op=1;var n=le();return n("search"),sp}var ap={},dp;function WE(){if(dp)return ap;dp=1;var n=le();return n("species"),ap}var lp={},hp;function VE(){if(hp)return lp;hp=1;var n=le();return n("split"),lp}var up={},cp;function fp(){if(cp)return up;cp=1;var n=le(),e=vf();return n("toPrimitive"),e(),up}var pp={},gp;function UE(){if(gp)return pp;gp=1;var n=Ne(),e=le(),t=Ct();return e("toStringTag"),t(n("Symbol"),"Symbol"),pp}var vp={},mp;function GE(){if(mp)return vp;mp=1;var n=le();return n("unscopables"),vp}var yp={},bp;function KE(){if(bp)return yp;bp=1;var n=ae(),e=Ct();return e(n.JSON,"JSON",!0),yp}var eo,wp;function YE(){if(wp)return eo;wp=1,ef(),Af(),Lf(),AE(),Vf(),BE(),zE(),Jf(),LE(),jE(),$E(),HE(),WE(),VE(),fp(),UE(),GE(),KE();var n=Z();return eo=n.Symbol,eo}var _p={},to,Ep;function io(){return Ep||(Ep=1,to=function(){}),to}var ro,Sp;function di(){return Sp||(Sp=1,ro={}),ro}var no,Op;function XE(){if(Op)return no;Op=1;var n=fe(),e=Se(),t=Function.prototype,i=n&&Object.getOwnPropertyDescriptor,r=e(t,"name"),s=r&&function(){}.name==="something",o=r&&(!n||n&&i(t,"name").configurable);return no={EXISTS:r,PROPER:s,CONFIGURABLE:o},no}var so,Ip;function Tp(){if(Ip)return so;Ip=1;var n=U();return so=!n(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),so}var oo,Pp;function Or(){if(Pp)return oo;Pp=1;var n=Se(),e=we(),t=Ae(),i=_r(),r=Tp(),s=i("IE_PROTO"),o=Object,a=o.prototype;return oo=r?o.getPrototypeOf:function(d){var l=t(d);if(n(l,s))return l[s];var h=l.constructor;return e(h)&&l instanceof h?h.prototype:l instanceof o?a:null},oo}var ao,Cp;function xp(){if(Cp)return ao;Cp=1;var n=U(),e=we(),t=_e(),i=Fi(),r=Or(),s=Ni(),o=ve(),a=ii(),d=o("iterator"),l=!1,h,u,c;[].keys&&(c=[].keys(),"next"in c?(u=r(r(c)),u!==Object.prototype&&(h=u)):l=!0);var f=!t(h)||n(function(){var p={};return h[d].call(p)!==p});return f?h={}:a&&(h=i(h)),e(h[d])||s(h,d,function(){return this}),ao={IteratorPrototype:h,BUGGY_SAFARI_ITERATORS:l},ao}var lo,Rp;function ZE(){if(Rp)return lo;Rp=1;var n=xp().IteratorPrototype,e=Fi(),t=xi(),i=Ct(),r=di(),s=function(){return this};return lo=function(o,a,d,l){var h=a+" Iterator";return o.prototype=e(n,{next:t(+!l,d)}),i(o,h,!1,!0),r[h]=s,o},lo}var ho,Dp;function JE(){if(Dp)return ho;Dp=1;var n=G(),e=nt();return ho=function(t,i,r){try{return n(e(Object.getOwnPropertyDescriptor(t,i)[r]))}catch{}},ho}var uo,Mp;function QE(){if(Mp)return uo;Mp=1;var n=_e();return uo=function(e){return n(e)||e===null},uo}var co,qp;function eS(){if(qp)return co;qp=1;var n=QE(),e=String,t=TypeError;return co=function(i){if(n(i))return i;throw new t("Can't set "+e(i)+" as a prototype")},co}var fo,kp;function tS(){if(kp)return fo;kp=1;var n=JE(),e=_e(),t=rt(),i=eS();return fo=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,s={},o;try{o=n(Object.prototype,"__proto__","set"),o(s,[]),r=s instanceof Array}catch{}return function(d,l){return t(d),i(l),e(d)&&(r?o(d,l):d.__proto__=l),d}}():void 0),fo}var po,Fp;function go(){if(Fp)return po;Fp=1;var n=B(),e=De(),t=ii(),i=XE(),r=we(),s=ZE(),o=Or(),a=tS(),d=Ct(),l=ni(),h=Ni(),u=ve(),c=di(),f=xp(),p=i.PROPER,g=i.CONFIGURABLE,b=f.IteratorPrototype,m=f.BUGGY_SAFARI_ITERATORS,v=u("iterator"),w="keys",y="values",_="entries",O=function(){return this};return po=function(T,E,I,P,M,x,C){s(I,E,P);var k=function(Xe){if(Xe===M&&ne)return ne;if(!m&&Xe&&Xe in j)return j[Xe];switch(Xe){case w:return function(){return new I(this,Xe)};case y:return function(){return new I(this,Xe)};case _:return function(){return new I(this,Xe)}}return function(){return new I(this)}},N=E+" Iterator",W=!1,j=T.prototype,ee=j[v]||j["@@iterator"]||M&&j[M],ne=!m&&ee||k(M),be=E==="Array"&&j.entries||ee,X,Te,We;if(be&&(X=o(be.call(new T)),X!==Object.prototype&&X.next&&(!t&&o(X)!==b&&(a?a(X,b):r(X[v])||h(X,v,O)),d(X,N,!0,!0),t&&(c[N]=O))),p&&M===y&&ee&&ee.name!==y&&(!t&&g?l(j,"name",y):(W=!0,ne=function(){return e(ee,this)})),M)if(Te={values:k(y),keys:x?ne:k(w),entries:k(_)},C)for(We in Te)(m||W||!(We in j))&&h(j,We,Te[We]);else n({target:E,proto:!0,forced:m||W},Te);return(!t||C)&&j[v]!==ne&&h(j,v,ne,{name:M}),c[E]=ne,Te},po}var vo,Np;function mo(){return Np||(Np=1,vo=function(n,e){return{value:n,done:e}}),vo}var yo,Ap;function li(){if(Ap)return yo;Ap=1;var n=Ue(),e=io(),t=di(),i=xt(),r=Be().f,s=go(),o=mo(),a=ii(),d=fe(),l="Array Iterator",h=i.set,u=i.getterFor(l);yo=s(Array,"Array",function(f,p){h(this,{type:l,target:n(f),index:0,kind:p})},function(){var f=u(this),p=f.target,g=f.index++;if(!p||g>=p.length)return f.target=null,o(void 0,!0);switch(f.kind){case"keys":return o(g,!1);case"values":return o(p[g],!1)}return o([g,p[g]],!1)},"values");var c=t.Arguments=t.Array;if(e("keys"),e("values"),e("entries"),!a&&d&&c.name!=="values")try{r(c,"name",{value:"values"})}catch{}return yo}var bo,Bp;function iS(){return Bp||(Bp=1,bo={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}),bo}var zp;function hi(){if(zp)return _p;zp=1,li();var n=iS(),e=ae(),t=Ct(),i=di();for(var r in n)t(e[r],r),i[r]=i.Array;return _p}var wo,Lp;function jp(){if(Lp)return wo;Lp=1;var n=YE();return hi(),wo=n,wo}var _o,$p;function rS(){return $p||($p=1,_o=jp()),_o}var nS=rS(),sS=L(nS),Hp={},Wp;function oS(){if(Wp)return Hp;Wp=1;var n=B(),e=Pt(),t=Yc(),i=_e(),r=yr(),s=st(),o=Ue(),a=wr(),d=ve(),l=ki(),h=oi(),u=l("slice"),c=d("species"),f=Array,p=Math.max;return n({target:"Array",proto:!0,forced:!u},{slice:function(b,m){var v=o(this),w=s(v),y=r(b,w),_=r(m===void 0?w:m,w),O,T,E;if(e(v)&&(O=v.constructor,t(O)&&(O===f||e(O.prototype))?O=void 0:i(O)&&(O=O[c],O===null&&(O=void 0)),O===f||O===void 0))return h(v,y,_);for(T=new(O===void 0?f:O)(p(_-y,0)),E=0;y<_;y++,E++)y in v&&a(T,E,v[y]);return T.length=E,T}}),Hp}var Eo,Vp;function aS(){if(Vp)return Eo;Vp=1,oS();var n=Oe();return Eo=n("Array","slice"),Eo}var So,Up;function dS(){if(Up)return So;Up=1;var n=ge(),e=aS(),t=Array.prototype;return So=function(i){var r=i.slice;return i===t||n(t,i)&&r===t.slice?e:r},So}var Oo,Gp;function lS(){if(Gp)return Oo;Gp=1;var n=dS();return Oo=n,Oo}var Io,Kp;function hS(){return Kp||(Kp=1,Io=lS()),Io}var uS=hS(),Qe=L(uS),To,Yp;function cS(){if(Yp)return To;Yp=1;var n=Ne(),e=G(),t=Er(),i=br(),r=Je(),s=e([].concat);return To=n("Reflect","ownKeys")||function(a){var d=t.f(r(a)),l=i.f;return l?s(d,l(a)):d},To}var Xp={},Zp;function fS(){if(Zp)return Xp;Zp=1;var n=B(),e=Pt();return n({target:"Array",stat:!0},{isArray:e}),Xp}var Po,Jp;function pS(){if(Jp)return Po;Jp=1,fS();var n=Z();return Po=n.Array.isArray,Po}var Co,Qp;function gS(){if(Qp)return Co;Qp=1;var n=pS();return Co=n,Co}var xo,eg;function vS(){return eg||(eg=1,xo=gS()),xo}var mS=vS(),he=L(mS),tg={},ig;function yS(){if(ig)return tg;ig=1;var n=B(),e=ft().map,t=ki(),i=t("map");return n({target:"Array",proto:!0,forced:!i},{map:function(s){return e(this,s,arguments.length>1?arguments[1]:void 0)}}),tg}var Ro,rg;function bS(){if(rg)return Ro;rg=1,yS();var n=Oe();return Ro=n("Array","map"),Ro}var Do,ng;function wS(){if(ng)return Do;ng=1;var n=ge(),e=bS(),t=Array.prototype;return Do=function(i){var r=i.map;return i===t||n(t,i)&&r===t.map?e:r},Do}var Mo,sg;function _S(){if(sg)return Mo;sg=1;var n=wS();return Mo=n,Mo}var qo,og;function ES(){return og||(og=1,qo=_S()),qo}var SS=ES(),ui=L(SS),ag={},dg;function OS(){if(dg)return ag;dg=1;var n=B(),e=Ae(),t=qi(),i=U(),r=i(function(){t(1)});return n({target:"Object",stat:!0,forced:r},{keys:function(o){return t(e(o))}}),ag}var ko,lg;function IS(){if(lg)return ko;lg=1,OS();var n=Z();return ko=n.Object.keys,ko}var Fo,hg;function TS(){if(hg)return Fo;hg=1;var n=IS();return Fo=n,Fo}var No,ug;function PS(){return ug||(ug=1,No=TS()),No}var CS=PS(),ue=L(CS),cg={},fg;function xS(){if(fg)return cg;fg=1;var n=B(),e=G(),t=Date,i=e(t.prototype.getTime);return n({target:"Date",stat:!0},{now:function(){return i(new t)}}),cg}var Ao,pg;function RS(){if(pg)return Ao;pg=1,xS();var n=Z();return Ao=n.Date.now,Ao}var Bo,gg;function DS(){if(gg)return Bo;gg=1;var n=RS();return Bo=n,Bo}var zo,vg;function MS(){return vg||(vg=1,zo=DS()),zo}var qS=MS(),Ir=L(qS),mg={},Lo,yg;function ci(){if(yg)return Lo;yg=1;var n=U();return Lo=function(e,t){var i=[][e];return!!i&&n(function(){i.call(null,t||function(){return 1},1)})},Lo}var jo,bg;function kS(){if(bg)return jo;bg=1;var n=ft().forEach,e=ci(),t=e("forEach");return jo=t?[].forEach:function(r){return n(this,r,arguments.length>1?arguments[1]:void 0)},jo}var wg;function FS(){if(wg)return mg;wg=1;var n=B(),e=kS();return n({target:"Array",proto:!0,forced:[].forEach!==e},{forEach:e}),mg}var $o,_g;function NS(){if(_g)return $o;_g=1,FS();var n=Oe();return $o=n("Array","forEach"),$o}var Ho,Eg;function AS(){if(Eg)return Ho;Eg=1;var n=NS();return Ho=n,Ho}var Wo,Sg;function BS(){if(Sg)return Wo;Sg=1;var n=ai(),e=Se(),t=ge(),i=AS(),r=Array.prototype,s={DOMTokenList:!0,NodeList:!0};return Wo=function(o){var a=o.forEach;return o===r||t(r,o)&&a===r.forEach||e(s,n(o))?i:a},Wo}var Vo,Og;function zS(){return Og||(Og=1,Vo=BS()),Vo}var LS=zS(),Q=L(LS),Ig={},Tg;function jS(){if(Tg)return Ig;Tg=1;var n=B(),e=G(),t=Pt(),i=e([].reverse),r=[1,2];return n({target:"Array",proto:!0,forced:String(r)===String(r.reverse())},{reverse:function(){return t(this)&&(this.length=this.length),i(this)}}),Ig}var Uo,Pg;function $S(){if(Pg)return Uo;Pg=1,jS();var n=Oe();return Uo=n("Array","reverse"),Uo}var Go,Cg;function HS(){if(Cg)return Go;Cg=1;var n=ge(),e=$S(),t=Array.prototype;return Go=function(i){var r=i.reverse;return i===t||n(t,i)&&r===t.reverse?e:r},Go}var Ko,xg;function WS(){if(xg)return Ko;xg=1;var n=HS();return Ko=n,Ko}var Yo,Rg;function VS(){return Rg||(Rg=1,Yo=WS()),Yo}var US=VS(),Rt=L(US),Dg={},Xo,Mg;function GS(){if(Mg)return Xo;Mg=1;var n=fe(),e=Pt(),t=TypeError,i=Object.getOwnPropertyDescriptor,r=n&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(s){return s instanceof TypeError}}();return Xo=r?function(s,o){if(e(s)&&!i(s,"length").writable)throw new t("Cannot set read only .length");return s.length=o}:function(s,o){return s.length=o},Xo}var Zo,qg;function kg(){if(qg)return Zo;qg=1;var n=ti(),e=TypeError;return Zo=function(t,i){if(!delete t[i])throw new e("Cannot delete property "+n(i)+" of "+n(t))},Zo}var Fg;function KS(){if(Fg)return Dg;Fg=1;var n=B(),e=Ae(),t=yr(),i=si(),r=st(),s=GS(),o=Hc(),a=Rs(),d=wr(),l=kg(),h=ki(),u=h("splice"),c=Math.max,f=Math.min;return n({target:"Array",proto:!0,forced:!u},{splice:function(g,b){var m=e(this),v=r(m),w=t(g,v),y=arguments.length,_,O,T,E,I,P;for(y===0?_=O=0:y===1?(_=0,O=v-w):(_=y-2,O=f(c(i(b),0),v-w)),o(v+_-O),T=a(m,O),E=0;E<O;E++)I=w+E,I in m&&d(T,E,m[I]);if(T.length=O,_<O){for(E=w;E<v-O;E++)I=E+O,P=E+_,I in m?m[P]=m[I]:l(m,P);for(E=v;E>v-O+_;E--)l(m,E-1)}else if(_>O)for(E=v-O;E>w;E--)I=E+O-1,P=E+_-1,I in m?m[P]=m[I]:l(m,P);for(E=0;E<_;E++)m[E+w]=arguments[E+2];return s(m,v-O+_),T}}),Dg}var Jo,Ng;function YS(){if(Ng)return Jo;Ng=1,KS();var n=Oe();return Jo=n("Array","splice"),Jo}var Qo,Ag;function XS(){if(Ag)return Qo;Ag=1;var n=ge(),e=YS(),t=Array.prototype;return Qo=function(i){var r=i.splice;return i===t||n(t,i)&&r===t.splice?e:r},Qo}var ea,Bg;function ZS(){if(Bg)return ea;Bg=1;var n=XS();return ea=n,ea}var ta,zg;function JS(){return zg||(zg=1,ta=ZS()),ta}var QS=JS(),ot=L(QS),Lg={},jg;function e1(){if(jg)return Lg;jg=1;var n=B(),e=Qn().includes,t=U(),i=io(),r=t(function(){return!Array(1).includes()});return n({target:"Array",proto:!0,forced:r},{includes:function(o){return e(this,o,arguments.length>1?arguments[1]:void 0)}}),i("includes"),Lg}var ia,$g;function t1(){if($g)return ia;$g=1,e1();var n=Oe();return ia=n("Array","includes"),ia}var Hg={},ra,Wg;function i1(){if(Wg)return ra;Wg=1;var n=_e(),e=Ze(),t=ve(),i=t("match");return ra=function(r){var s;return n(r)&&((s=r[i])!==void 0?!!s:e(r)==="RegExp")},ra}var na,Vg;function r1(){if(Vg)return na;Vg=1;var n=i1(),e=TypeError;return na=function(t){if(n(t))throw new e("The method doesn't accept regular expressions");return t},na}var sa,Ug;function n1(){if(Ug)return sa;Ug=1;var n=ve(),e=n("match");return sa=function(t){var i=/./;try{"/./"[t](i)}catch{try{return i[e]=!1,"/./"[t](i)}catch{}}return!1},sa}var Gg;function s1(){if(Gg)return Hg;Gg=1;var n=B(),e=G(),t=r1(),i=rt(),r=ze(),s=n1(),o=e("".indexOf);return n({target:"String",proto:!0,forced:!s("includes")},{includes:function(d){return!!~o(r(i(this)),r(t(d)),arguments.length>1?arguments[1]:void 0)}}),Hg}var oa,Kg;function o1(){if(Kg)return oa;Kg=1,s1();var n=Oe();return oa=n("String","includes"),oa}var aa,Yg;function a1(){if(Yg)return aa;Yg=1;var n=ge(),e=t1(),t=o1(),i=Array.prototype,r=String.prototype;return aa=function(s){var o=s.includes;return s===i||n(i,s)&&o===i.includes?e:typeof s=="string"||s===r||n(r,s)&&o===r.includes?t:o},aa}var da,Xg;function d1(){if(Xg)return da;Xg=1;var n=a1();return da=n,da}var la,Zg;function l1(){return Zg||(Zg=1,la=d1()),la}var h1=l1(),pt=L(h1),Jg={},Qg;function u1(){if(Qg)return Jg;Qg=1;var n=B(),e=U(),t=Ae(),i=Or(),r=Tp(),s=e(function(){i(1)});return n({target:"Object",stat:!0,forced:s,sham:!r},{getPrototypeOf:function(a){return i(t(a))}}),Jg}var ha,ev;function c1(){if(ev)return ha;ev=1,u1();var n=Z();return ha=n.Object.getPrototypeOf,ha}var ua,tv;function f1(){if(tv)return ua;tv=1;var n=c1();return ua=n,ua}var ca,iv;function p1(){return iv||(iv=1,ca=f1()),ca}var g1=p1(),rv=L(g1),fa,nv;function v1(){if(nv)return fa;nv=1,ef();var n=Oe();return fa=n("Array","concat"),fa}var pa,sv;function m1(){if(sv)return pa;sv=1;var n=ge(),e=v1(),t=Array.prototype;return pa=function(i){var r=i.concat;return i===t||n(t,i)&&r===t.concat?e:r},pa}var ga,ov;function y1(){if(ov)return ga;ov=1;var n=m1();return ga=n,ga}var va,av;function b1(){return av||(av=1,va=y1()),va}var w1=b1(),_1=L(w1),dv={},lv;function E1(){if(lv)return dv;lv=1;var n=B(),e=ft().filter,t=ki(),i=t("filter");return n({target:"Array",proto:!0,forced:!i},{filter:function(s){return e(this,s,arguments.length>1?arguments[1]:void 0)}}),dv}var ma,hv;function S1(){if(hv)return ma;hv=1,E1();var n=Oe();return ma=n("Array","filter"),ma}var ya,uv;function O1(){if(uv)return ya;uv=1;var n=ge(),e=S1(),t=Array.prototype;return ya=function(i){var r=i.filter;return i===t||n(t,i)&&r===t.filter?e:r},ya}var ba,cv;function I1(){if(cv)return ba;cv=1;var n=O1();return ba=n,ba}var wa,fv;function T1(){return fv||(fv=1,wa=I1()),wa}var P1=T1(),Me=L(P1),pv={},_a,gv;function C1(){if(gv)return _a;gv=1;var n=fe(),e=U(),t=G(),i=Or(),r=qi(),s=Ue(),o=fr().f,a=t(o),d=t([].push),l=n&&e(function(){var u=Object.create(null);return u[2]=2,!a(u,2)}),h=function(u){return function(c){for(var f=s(c),p=r(f),g=l&&i(f)===null,b=p.length,m=0,v=[],w;b>m;)w=p[m++],(!n||(g?w in f:a(f,w)))&&d(v,u?[w,f[w]]:f[w]);return v}};return _a={entries:h(!0),values:h(!1)},_a}var vv;function x1(){if(vv)return pv;vv=1;var n=B(),e=C1().values;return n({target:"Object",stat:!0},{values:function(i){return e(i)}}),pv}var Ea,mv;function R1(){if(mv)return Ea;mv=1,x1();var n=Z();return Ea=n.Object.values,Ea}var Sa,yv;function D1(){if(yv)return Sa;yv=1;var n=R1();return Sa=n,Sa}var Oa,bv;function M1(){return bv||(bv=1,Oa=D1()),Oa}var q1=M1(),k1=L(q1),wv={},Ia,_v;function Ta(){return _v||(_v=1,Ia=`	
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`),Ia}var Pa,Ev;function Sv(){if(Ev)return Pa;Ev=1;var n=G(),e=rt(),t=ze(),i=Ta(),r=n("".replace),s=RegExp("^["+i+"]+"),o=RegExp("(^|[^"+i+"])["+i+"]+$"),a=function(d){return function(l){var h=t(e(l));return d&1&&(h=r(h,s,"")),d&2&&(h=r(h,o,"$1")),h}};return Pa={start:a(1),end:a(2),trim:a(3)},Pa}var Ca,Ov;function F1(){if(Ov)return Ca;Ov=1;var n=ae(),e=U(),t=G(),i=ze(),r=Sv().trim,s=Ta(),o=n.parseInt,a=n.Symbol,d=a&&a.iterator,l=/^[+-]?0x/i,h=t(l.exec),u=o(s+"08")!==8||o(s+"0x16")!==22||d&&!e(function(){o(Object(d))});return Ca=u?function(f,p){var g=r(i(f));return o(g,p>>>0||(h(l,g)?16:10))}:o,Ca}var Iv;function N1(){if(Iv)return wv;Iv=1;var n=B(),e=F1();return n({global:!0,forced:parseInt!==e},{parseInt:e}),wv}var xa,Tv;function A1(){if(Tv)return xa;Tv=1,N1();var n=Z();return xa=n.parseInt,xa}var Ra,Pv;function B1(){if(Pv)return Ra;Pv=1;var n=A1();return Ra=n,Ra}var Da,Cv;function z1(){return Cv||(Cv=1,Da=B1()),Da}var L1=z1(),Ge=L(L1),xv={},Rv;function j1(){if(Rv)return xv;Rv=1;var n=B(),e=en(),t=Qn().indexOf,i=ci(),r=e([].indexOf),s=!!r&&1/r([1],1,-0)<0,o=s||!i("indexOf");return n({target:"Array",proto:!0,forced:o},{indexOf:function(d){var l=arguments.length>1?arguments[1]:void 0;return s?r(this,d,l)||0:t(this,d,l)}}),xv}var Ma,Dv;function $1(){if(Dv)return Ma;Dv=1,j1();var n=Oe();return Ma=n("Array","indexOf"),Ma}var qa,Mv;function H1(){if(Mv)return qa;Mv=1;var n=ge(),e=$1(),t=Array.prototype;return qa=function(i){var r=i.indexOf;return i===t||n(t,i)&&r===t.indexOf?e:r},qa}var ka,qv;function W1(){if(qv)return ka;qv=1;var n=H1();return ka=n,ka}var Fa,kv;function V1(){return kv||(kv=1,Fa=W1()),Fa}var U1=V1(),J=L(U1),Fv={},Nv;function G1(){if(Nv)return Fv;Nv=1;var n=B(),e=fe(),t=Fi();return n({target:"Object",stat:!0,sham:!e},{create:t}),Fv}var Na,Av;function K1(){if(Av)return Na;Av=1,G1();var n=Z(),e=n.Object;return Na=function(i,r){return e.create(i,r)},Na}var Aa,Bv;function Y1(){if(Bv)return Aa;Bv=1;var n=K1();return Aa=n,Aa}var Ba,zv;function X1(){return zv||(zv=1,Ba=Y1()),Ba}var Z1=X1(),Dt=L(Z1),Lv={},za,jv;function J1(){if(jv)return za;jv=1;var n=si(),e=ze(),t=rt(),i=RangeError;return za=function(s){var o=e(t(this)),a="",d=n(s);if(d<0||d===1/0)throw new i("Wrong number of repetitions");for(;d>0;(d>>>=1)&&(o+=o))d&1&&(a+=o);return a},za}var La,$v;function Q1(){if($v)return La;$v=1;var n=G(),e=uc(),t=ze(),i=J1(),r=rt(),s=n(i),o=n("".slice),a=Math.ceil,d=function(l){return function(h,u,c){var f=t(r(h)),p=e(u),g=f.length,b=c===void 0?" ":t(c),m,v;return p<=g||b===""?f:(m=p-g,v=s(b,a(m/b.length)),v.length>m&&(v=o(v,0,m)),l?f+v:v+f)}};return La={start:d(!1),end:d(!0)},La}var ja,Hv;function eO(){if(Hv)return ja;Hv=1;var n=G(),e=U(),t=Q1().start,i=RangeError,r=isFinite,s=Math.abs,o=Date.prototype,a=o.toISOString,d=n(o.getTime),l=n(o.getUTCDate),h=n(o.getUTCFullYear),u=n(o.getUTCHours),c=n(o.getUTCMilliseconds),f=n(o.getUTCMinutes),p=n(o.getUTCMonth),g=n(o.getUTCSeconds);return ja=e(function(){return a.call(new Date(-5e13-1))!=="0385-07-25T07:06:39.999Z"})||!e(function(){a.call(new Date(NaN))})?function(){if(!r(d(this)))throw new i("Invalid time value");var m=this,v=h(m),w=c(m),y=v<0?"-":v>9999?"+":"";return y+t(s(v),y?6:4,0)+"-"+t(p(m)+1,2,0)+"-"+t(l(m),2,0)+"T"+t(u(m),2,0)+":"+t(f(m),2,0)+":"+t(g(m),2,0)+"."+t(w,3,0)+"Z"}:a,ja}var Wv;function tO(){if(Wv)return Lv;Wv=1;var n=B(),e=De(),t=Ae(),i=Uu(),r=eO(),s=Ze(),o=U(),a=o(function(){return new Date(NaN).toJSON()!==null||e(Date.prototype.toJSON,{toISOString:function(){return 1}})!==1});return n({target:"Date",proto:!0,forced:a},{toJSON:function(l){var h=t(this),u=i(h,"number");return typeof u=="number"&&!isFinite(u)?null:!("toISOString"in h)&&s(h)==="Date"?e(r,h):h.toISOString()}}),Lv}var $a,Vv;function iO(){if(Vv)return $a;Vv=1,tO(),qf();var n=Z(),e=cr();return n.JSON||(n.JSON={stringify:JSON.stringify}),$a=function(i,r,s){return e(n.JSON.stringify,null,arguments)},$a}var Ha,Uv;function rO(){if(Uv)return Ha;Uv=1;var n=iO();return Ha=n,Ha}var Wa,Gv;function nO(){return Gv||(Gv=1,Wa=rO()),Wa}var sO=nO(),Ai=L(sO),Kv={},Yv={},Va,Xv;function Zv(){if(Xv)return Va;Xv=1;var n=ae(),e=Qt(),t=Ze(),i=function(r){return e.slice(0,r.length)===r};return Va=function(){return i("Bun/")?"BUN":i("Cloudflare-Workers")?"CLOUDFLARE":i("Deno/")?"DENO":i("Node.js/")?"NODE":n.Bun&&typeof Bun.version=="string"?"BUN":n.Deno&&typeof Deno.version=="object"?"DENO":t(n.process)==="process"?"NODE":n.window&&n.document?"BROWSER":"REST"}(),Va}var Ua,Jv;function oO(){if(Jv)return Ua;Jv=1;var n=TypeError;return Ua=function(e,t){if(e<t)throw new n("Not enough arguments");return e},Ua}var Ga,Qv;function em(){if(Qv)return Ga;Qv=1;var n=ae(),e=cr(),t=we(),i=Zv(),r=Qt(),s=oi(),o=oO(),a=n.Function,d=/MSIE .\./.test(r)||i==="BUN"&&function(){var l=n.Bun.version.split(".");return l.length<3||l[0]==="0"&&(l[1]<3||l[1]==="3"&&l[2]==="0")}();return Ga=function(l,h){var u=h?2:1;return d?function(c,f){var p=o(arguments.length,1)>u,g=t(c)?c:a(c),b=p?s(arguments,u):[],m=p?function(){e(g,this,b)}:g;return h?l(m,f):l(m)}:l},Ga}var tm;function aO(){if(tm)return Yv;tm=1;var n=B(),e=ae(),t=em(),i=t(e.setInterval,!0);return n({global:!0,bind:!0,forced:e.setInterval!==i},{setInterval:i}),Yv}var im={},rm;function dO(){if(rm)return im;rm=1;var n=B(),e=ae(),t=em(),i=t(e.setTimeout,!0);return n({global:!0,bind:!0,forced:e.setTimeout!==i},{setTimeout:i}),im}var nm;function sm(){return nm||(nm=1,aO(),dO()),Kv}var Ka,om;function lO(){if(om)return Ka;om=1,sm();var n=Z();return Ka=n.setTimeout,Ka}var Ya,am;function hO(){return am||(am=1,Ya=lO()),Ya}var uO=hO(),at=L(uO),dm={},Xa,lm;function cO(){if(lm)return Xa;lm=1;var n=Ae(),e=yr(),t=st();return Xa=function(r){for(var s=n(this),o=t(s),a=arguments.length,d=e(a>1?arguments[1]:void 0,o),l=a>2?arguments[2]:void 0,h=l===void 0?o:e(l,o);h>d;)s[d++]=r;return s},Xa}var hm;function fO(){if(hm)return dm;hm=1;var n=B(),e=cO(),t=io();return n({target:"Array",proto:!0},{fill:e}),t("fill"),dm}var Za,um;function pO(){if(um)return Za;um=1,fO();var n=Oe();return Za=n("Array","fill"),Za}var Ja,cm;function gO(){if(cm)return Ja;cm=1;var n=ge(),e=pO(),t=Array.prototype;return Ja=function(i){var r=i.fill;return i===t||n(t,i)&&r===t.fill?e:r},Ja}var Qa,fm;function vO(){if(fm)return Qa;fm=1;var n=gO();return Qa=n,Qa}var ed,pm;function mO(){return pm||(pm=1,ed=vO()),ed}var yO=mO(),Bi=L(yO);/*! Hammer.JS - v2.0.17-rc - 2019-12-16
 * http://naver.github.io/egjs
 *
 * Forked By Naver egjs
 * Copyright (c) hammerjs
 * Licensed under the MIT license */function Ke(){return Ke=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Ke.apply(this,arguments)}function Le(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}function Tr(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}var td;typeof Object.assign!="function"?td=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var r=arguments[i];if(r!=null)for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])}return t}:td=Object.assign;var Mt=td,gm=["","webkit","Moz","MS","ms","o"],bO=typeof document>"u"?{style:{}}:document.createElement("div"),wO="function",fi=Math.round,qt=Math.abs,id=Date.now;function Pr(n,e){for(var t,i,r=e[0].toUpperCase()+e.slice(1),s=0;s<gm.length;){if(t=gm[s],i=t?t+r:e,i in n)return i;s++}}var dt;typeof window>"u"?dt={}:dt=window;var vm=Pr(bO.style,"touchAction"),mm=vm!==void 0;function _O(){if(!mm)return!1;var n={},e=dt.CSS&&dt.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return n[t]=e?dt.CSS.supports("touch-action",t):!0}),n}var ym="compute",bm="auto",rd="manipulation",kt="none",zi="pan-x",Li="pan-y",Cr=_O(),EO=/mobile|tablet|ip(ad|hone|od)|android/i,wm="ontouchstart"in dt,SO=Pr(dt,"PointerEvent")!==void 0,OO=wm&&EO.test(navigator.userAgent),ji="touch",IO="pen",nd="mouse",TO="kinect",PO=25,Pe=1,Ft=2,ye=4,qe=8,xr=1,$i=2,Hi=4,Wi=8,pi=16,et=$i|Hi,Nt=Wi|pi,_m=et|Nt,Em=["x","y"],Rr=["clientX","clientY"];function lt(n,e,t){var i;if(n)if(n.forEach)n.forEach(e,t);else if(n.length!==void 0)for(i=0;i<n.length;)e.call(t,n[i],i,n),i++;else for(i in n)n.hasOwnProperty(i)&&e.call(t,n[i],i,n)}function Dr(n,e){return typeof n===wO?n.apply(e&&e[0]||void 0,e):n}function At(n,e){return n.indexOf(e)>-1}function CO(n){if(At(n,kt))return kt;var e=At(n,zi),t=At(n,Li);return e&&t?kt:e||t?e?zi:Li:At(n,rd)?rd:bm}var Sm=function(){function n(t,i){this.manager=t,this.set(i)}var e=n.prototype;return e.set=function(i){i===ym&&(i=this.compute()),mm&&this.manager.element.style&&Cr[i]&&(this.manager.element.style[vm]=i),this.actions=i.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var i=[];return lt(this.manager.recognizers,function(r){Dr(r.options.enable,[r])&&(i=i.concat(r.getTouchAction()))}),CO(i.join(" "))},e.preventDefaults=function(i){var r=i.srcEvent,s=i.offsetDirection;if(this.manager.session.prevented){r.preventDefault();return}var o=this.actions,a=At(o,kt)&&!Cr[kt],d=At(o,Li)&&!Cr[Li],l=At(o,zi)&&!Cr[zi];if(a){var h=i.pointers.length===1,u=i.distance<2,c=i.deltaTime<250;if(h&&u&&c)return}if(!(l&&d)&&(a||d&&s&et||l&&s&Nt))return this.preventSrc(r)},e.preventSrc=function(i){this.manager.session.prevented=!0,i.preventDefault()},n}();function sd(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function Om(n){var e=n.length;if(e===1)return{x:fi(n[0].clientX),y:fi(n[0].clientY)};for(var t=0,i=0,r=0;r<e;)t+=n[r].clientX,i+=n[r].clientY,r++;return{x:fi(t/e),y:fi(i/e)}}function Im(n){for(var e=[],t=0;t<n.pointers.length;)e[t]={clientX:fi(n.pointers[t].clientX),clientY:fi(n.pointers[t].clientY)},t++;return{timeStamp:id(),pointers:e,center:Om(e),deltaX:n.deltaX,deltaY:n.deltaY}}function Mr(n,e,t){t||(t=Em);var i=e[t[0]]-n[t[0]],r=e[t[1]]-n[t[1]];return Math.sqrt(i*i+r*r)}function od(n,e,t){t||(t=Em);var i=e[t[0]]-n[t[0]],r=e[t[1]]-n[t[1]];return Math.atan2(r,i)*180/Math.PI}function Tm(n,e){return n===e?xr:qt(n)>=qt(e)?n<0?$i:Hi:e<0?Wi:pi}function xO(n,e){var t=e.center,i=n.offsetDelta||{},r=n.prevDelta||{},s=n.prevInput||{};(e.eventType===Pe||s.eventType===ye)&&(r=n.prevDelta={x:s.deltaX||0,y:s.deltaY||0},i=n.offsetDelta={x:t.x,y:t.y}),e.deltaX=r.x+(t.x-i.x),e.deltaY=r.y+(t.y-i.y)}function Pm(n,e,t){return{x:e/n||0,y:t/n||0}}function RO(n,e){return Mr(e[0],e[1],Rr)/Mr(n[0],n[1],Rr)}function DO(n,e){return od(e[1],e[0],Rr)+od(n[1],n[0],Rr)}function MO(n,e){var t=n.lastInterval||e,i=e.timeStamp-t.timeStamp,r,s,o,a;if(e.eventType!==qe&&(i>PO||t.velocity===void 0)){var d=e.deltaX-t.deltaX,l=e.deltaY-t.deltaY,h=Pm(i,d,l);s=h.x,o=h.y,r=qt(h.x)>qt(h.y)?h.x:h.y,a=Tm(d,l),n.lastInterval=e}else r=t.velocity,s=t.velocityX,o=t.velocityY,a=t.direction;e.velocity=r,e.velocityX=s,e.velocityY=o,e.direction=a}function qO(n,e){var t=n.session,i=e.pointers,r=i.length;t.firstInput||(t.firstInput=Im(e)),r>1&&!t.firstMultiple?t.firstMultiple=Im(e):r===1&&(t.firstMultiple=!1);var s=t.firstInput,o=t.firstMultiple,a=o?o.center:s.center,d=e.center=Om(i);e.timeStamp=id(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=od(a,d),e.distance=Mr(a,d),xO(t,e),e.offsetDirection=Tm(e.deltaX,e.deltaY);var l=Pm(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=l.x,e.overallVelocityY=l.y,e.overallVelocity=qt(l.x)>qt(l.y)?l.x:l.y,e.scale=o?RO(o.pointers,i):1,e.rotation=o?DO(o.pointers,i):0,e.maxPointers=t.prevInput?e.pointers.length>t.prevInput.maxPointers?e.pointers.length:t.prevInput.maxPointers:e.pointers.length,MO(t,e);var h=n.element,u=e.srcEvent,c;u.composedPath?c=u.composedPath()[0]:u.path?c=u.path[0]:c=u.target,sd(c,h)&&(h=c),e.target=h}function kO(n,e,t){var i=t.pointers.length,r=t.changedPointers.length,s=e&Pe&&i-r===0,o=e&(ye|qe)&&i-r===0;t.isFirst=!!s,t.isFinal=!!o,s&&(n.session={}),t.eventType=e,qO(n,t),n.emit("hammer.input",t),n.recognize(t),n.session.prevInput=t}function Vi(n){return n.trim().split(/\s+/g)}function Ui(n,e,t){lt(Vi(e),function(i){n.addEventListener(i,t,!1)})}function Gi(n,e,t){lt(Vi(e),function(i){n.removeEventListener(i,t,!1)})}function Cm(n){var e=n.ownerDocument||n;return e.defaultView||e.parentWindow||window}var gi=function(){function n(t,i){var r=this;this.manager=t,this.callback=i,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(s){Dr(t.options.enable,[t])&&r.handler(s)},this.init()}var e=n.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Ui(this.element,this.evEl,this.domHandler),this.evTarget&&Ui(this.target,this.evTarget,this.domHandler),this.evWin&&Ui(Cm(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&Gi(this.element,this.evEl,this.domHandler),this.evTarget&&Gi(this.target,this.evTarget,this.domHandler),this.evWin&&Gi(Cm(this.element),this.evWin,this.domHandler)},n}();function Bt(n,e,t){if(n.indexOf&&!t)return n.indexOf(e);for(var i=0;i<n.length;){if(t&&n[i][t]==e||!t&&n[i]===e)return i;i++}return-1}var FO={pointerdown:Pe,pointermove:Ft,pointerup:ye,pointercancel:qe,pointerout:qe},NO={2:ji,3:IO,4:nd,5:TO},xm="pointerdown",Rm="pointermove pointerup pointercancel";dt.MSPointerEvent&&!dt.PointerEvent&&(xm="MSPointerDown",Rm="MSPointerMove MSPointerUp MSPointerCancel");var Dm=function(n){Le(e,n);function e(){var i,r=e.prototype;return r.evEl=xm,r.evWin=Rm,i=n.apply(this,arguments)||this,i.store=i.manager.session.pointerEvents=[],i}var t=e.prototype;return t.handler=function(r){var s=this.store,o=!1,a=r.type.toLowerCase().replace("ms",""),d=FO[a],l=NO[r.pointerType]||r.pointerType,h=l===ji,u=Bt(s,r.pointerId,"pointerId");d&Pe&&(r.button===0||h)?u<0&&(s.push(r),u=s.length-1):d&(ye|qe)&&(o=!0),!(u<0)&&(s[u]=r,this.callback(this.manager,d,{pointers:s,changedPointers:[r],pointerType:l,srcEvent:r}),o&&s.splice(u,1))},e}(gi);function Ki(n){return Array.prototype.slice.call(n,0)}function ad(n,e,t){for(var i=[],r=[],s=0;s<n.length;){var o=e?n[s][e]:n[s];Bt(r,o)<0&&i.push(n[s]),r[s]=o,s++}return t&&(e?i=i.sort(function(a,d){return a[e]>d[e]}):i=i.sort()),i}var AO={touchstart:Pe,touchmove:Ft,touchend:ye,touchcancel:qe},BO="touchstart touchmove touchend touchcancel",dd=function(n){Le(e,n);function e(){var i;return e.prototype.evTarget=BO,i=n.apply(this,arguments)||this,i.targetIds={},i}var t=e.prototype;return t.handler=function(r){var s=AO[r.type],o=zO.call(this,r,s);o&&this.callback(this.manager,s,{pointers:o[0],changedPointers:o[1],pointerType:ji,srcEvent:r})},e}(gi);function zO(n,e){var t=Ki(n.touches),i=this.targetIds;if(e&(Pe|Ft)&&t.length===1)return i[t[0].identifier]=!0,[t,t];var r,s,o=Ki(n.changedTouches),a=[],d=this.target;if(s=t.filter(function(l){return sd(l.target,d)}),e===Pe)for(r=0;r<s.length;)i[s[r].identifier]=!0,r++;for(r=0;r<o.length;)i[o[r].identifier]&&a.push(o[r]),e&(ye|qe)&&delete i[o[r].identifier],r++;if(a.length)return[ad(s.concat(a),"identifier",!0),a]}var LO={mousedown:Pe,mousemove:Ft,mouseup:ye},jO="mousedown",$O="mousemove mouseup",ld=function(n){Le(e,n);function e(){var i,r=e.prototype;return r.evEl=jO,r.evWin=$O,i=n.apply(this,arguments)||this,i.pressed=!1,i}var t=e.prototype;return t.handler=function(r){var s=LO[r.type];s&Pe&&r.button===0&&(this.pressed=!0),s&Ft&&r.which!==1&&(s=ye),this.pressed&&(s&ye&&(this.pressed=!1),this.callback(this.manager,s,{pointers:[r],changedPointers:[r],pointerType:nd,srcEvent:r}))},e}(gi),HO=2500,Mm=25;function qm(n){var e=n.changedPointers,t=e[0];if(t.identifier===this.primaryTouch){var i={x:t.clientX,y:t.clientY},r=this.lastTouches;this.lastTouches.push(i);var s=function(){var a=r.indexOf(i);a>-1&&r.splice(a,1)};setTimeout(s,HO)}}function WO(n,e){n&Pe?(this.primaryTouch=e.changedPointers[0].identifier,qm.call(this,e)):n&(ye|qe)&&qm.call(this,e)}function VO(n){for(var e=n.srcEvent.clientX,t=n.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],s=Math.abs(e-r.x),o=Math.abs(t-r.y);if(s<=Mm&&o<=Mm)return!0}return!1}var km=function(){var n=function(e){Le(t,e);function t(r,s){var o;return o=e.call(this,r,s)||this,o.handler=function(a,d,l){var h=l.pointerType===ji,u=l.pointerType===nd;if(!(u&&l.sourceCapabilities&&l.sourceCapabilities.firesTouchEvents)){if(h)WO.call(Tr(Tr(o)),d,l);else if(u&&VO.call(Tr(Tr(o)),l))return;o.callback(a,d,l)}},o.touch=new dd(o.manager,o.handler),o.mouse=new ld(o.manager,o.handler),o.primaryTouch=null,o.lastTouches=[],o}var i=t.prototype;return i.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(gi);return n}();function UO(n){var e,t=n.options.inputClass;return t?e=t:SO?e=Dm:OO?e=dd:wm?e=km:e=ld,new e(n,kO)}function vi(n,e,t){return Array.isArray(n)?(lt(n,t[e],t),!0):!1}var qr=1,je=2,mi=4,gt=8,ht=gt,Yi=16,tt=32,GO=1;function KO(){return GO++}function kr(n,e){var t=e.manager;return t?t.get(n):n}function Fm(n){return n&Yi?"cancel":n&gt?"end":n&mi?"move":n&je?"start":""}var Xi=function(){function n(t){t===void 0&&(t={}),this.options=Ke({enable:!0},t),this.id=KO(),this.manager=null,this.state=qr,this.simultaneous={},this.requireFail=[]}var e=n.prototype;return e.set=function(i){return Mt(this.options,i),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(i){if(vi(i,"recognizeWith",this))return this;var r=this.simultaneous;return i=kr(i,this),r[i.id]||(r[i.id]=i,i.recognizeWith(this)),this},e.dropRecognizeWith=function(i){return vi(i,"dropRecognizeWith",this)?this:(i=kr(i,this),delete this.simultaneous[i.id],this)},e.requireFailure=function(i){if(vi(i,"requireFailure",this))return this;var r=this.requireFail;return i=kr(i,this),Bt(r,i)===-1&&(r.push(i),i.requireFailure(this)),this},e.dropRequireFailure=function(i){if(vi(i,"dropRequireFailure",this))return this;i=kr(i,this);var r=Bt(this.requireFail,i);return r>-1&&this.requireFail.splice(r,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(i){return!!this.simultaneous[i.id]},e.emit=function(i){var r=this,s=this.state;function o(a){r.manager.emit(a,i)}s<gt&&o(r.options.event+Fm(s)),o(r.options.event),i.additionalEvent&&o(i.additionalEvent),s>=gt&&o(r.options.event+Fm(s))},e.tryEmit=function(i){if(this.canEmit())return this.emit(i);this.state=tt},e.canEmit=function(){for(var i=0;i<this.requireFail.length;){if(!(this.requireFail[i].state&(tt|qr)))return!1;i++}return!0},e.recognize=function(i){var r=Mt({},i);if(!Dr(this.options.enable,[this,r])){this.reset(),this.state=tt;return}this.state&(ht|Yi|tt)&&(this.state=qr),this.state=this.process(r),this.state&(je|mi|gt|Yi)&&this.tryEmit(r)},e.process=function(i){},e.getTouchAction=function(){},e.reset=function(){},n}(),hd=function(n){Le(e,n);function e(i){var r;return i===void 0&&(i={}),r=n.call(this,Ke({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},i))||this,r.pTime=!1,r.pCenter=!1,r._timer=null,r._input=null,r.count=0,r}var t=e.prototype;return t.getTouchAction=function(){return[rd]},t.process=function(r){var s=this,o=this.options,a=r.pointers.length===o.pointers,d=r.distance<o.threshold,l=r.deltaTime<o.time;if(this.reset(),r.eventType&Pe&&this.count===0)return this.failTimeout();if(d&&l&&a){if(r.eventType!==ye)return this.failTimeout();var h=this.pTime?r.timeStamp-this.pTime<o.interval:!0,u=!this.pCenter||Mr(this.pCenter,r.center)<o.posThreshold;this.pTime=r.timeStamp,this.pCenter=r.center,!u||!h?this.count=1:this.count+=1,this._input=r;var c=this.count%o.taps;if(c===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){s.state=ht,s.tryEmit()},o.interval),je):ht}return tt},t.failTimeout=function(){var r=this;return this._timer=setTimeout(function(){r.state=tt},this.options.interval),tt},t.reset=function(){clearTimeout(this._timer)},t.emit=function(){this.state===ht&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(Xi),yi=function(n){Le(e,n);function e(i){return i===void 0&&(i={}),n.call(this,Ke({pointers:1},i))||this}var t=e.prototype;return t.attrTest=function(r){var s=this.options.pointers;return s===0||r.pointers.length===s},t.process=function(r){var s=this.state,o=r.eventType,a=s&(je|mi),d=this.attrTest(r);return a&&(o&qe||!d)?s|Yi:a||d?o&ye?s|gt:s&je?s|mi:je:tt},e}(Xi);function Nm(n){return n===pi?"down":n===Wi?"up":n===$i?"left":n===Hi?"right":""}var ud=function(n){Le(e,n);function e(i){var r;return i===void 0&&(i={}),r=n.call(this,Ke({event:"pan",threshold:10,pointers:1,direction:_m},i))||this,r.pX=null,r.pY=null,r}var t=e.prototype;return t.getTouchAction=function(){var r=this.options.direction,s=[];return r&et&&s.push(Li),r&Nt&&s.push(zi),s},t.directionTest=function(r){var s=this.options,o=!0,a=r.distance,d=r.direction,l=r.deltaX,h=r.deltaY;return d&s.direction||(s.direction&et?(d=l===0?xr:l<0?$i:Hi,o=l!==this.pX,a=Math.abs(r.deltaX)):(d=h===0?xr:h<0?Wi:pi,o=h!==this.pY,a=Math.abs(r.deltaY))),r.direction=d,o&&a>s.threshold&&d&s.direction},t.attrTest=function(r){return yi.prototype.attrTest.call(this,r)&&(this.state&je||!(this.state&je)&&this.directionTest(r))},t.emit=function(r){this.pX=r.deltaX,this.pY=r.deltaY;var s=Nm(r.direction);s&&(r.additionalEvent=this.options.event+s),n.prototype.emit.call(this,r)},e}(yi),Am=function(n){Le(e,n);function e(i){return i===void 0&&(i={}),n.call(this,Ke({event:"swipe",threshold:10,velocity:.3,direction:et|Nt,pointers:1},i))||this}var t=e.prototype;return t.getTouchAction=function(){return ud.prototype.getTouchAction.call(this)},t.attrTest=function(r){var s=this.options.direction,o;return s&(et|Nt)?o=r.overallVelocity:s&et?o=r.overallVelocityX:s&Nt&&(o=r.overallVelocityY),n.prototype.attrTest.call(this,r)&&s&r.offsetDirection&&r.distance>this.options.threshold&&r.maxPointers===this.options.pointers&&qt(o)>this.options.velocity&&r.eventType&ye},t.emit=function(r){var s=Nm(r.offsetDirection);s&&this.manager.emit(this.options.event+s,r),this.manager.emit(this.options.event,r)},e}(yi),Bm=function(n){Le(e,n);function e(i){return i===void 0&&(i={}),n.call(this,Ke({event:"pinch",threshold:0,pointers:2},i))||this}var t=e.prototype;return t.getTouchAction=function(){return[kt]},t.attrTest=function(r){return n.prototype.attrTest.call(this,r)&&(Math.abs(r.scale-1)>this.options.threshold||this.state&je)},t.emit=function(r){if(r.scale!==1){var s=r.scale<1?"in":"out";r.additionalEvent=this.options.event+s}n.prototype.emit.call(this,r)},e}(yi),zm=function(n){Le(e,n);function e(i){return i===void 0&&(i={}),n.call(this,Ke({event:"rotate",threshold:0,pointers:2},i))||this}var t=e.prototype;return t.getTouchAction=function(){return[kt]},t.attrTest=function(r){return n.prototype.attrTest.call(this,r)&&(Math.abs(r.rotation)>this.options.threshold||this.state&je)},e}(yi),Lm=function(n){Le(e,n);function e(i){var r;return i===void 0&&(i={}),r=n.call(this,Ke({event:"press",pointers:1,time:251,threshold:9},i))||this,r._timer=null,r._input=null,r}var t=e.prototype;return t.getTouchAction=function(){return[bm]},t.process=function(r){var s=this,o=this.options,a=r.pointers.length===o.pointers,d=r.distance<o.threshold,l=r.deltaTime>o.time;if(this._input=r,!d||!a||r.eventType&(ye|qe)&&!l)this.reset();else if(r.eventType&Pe)this.reset(),this._timer=setTimeout(function(){s.state=ht,s.tryEmit()},o.time);else if(r.eventType&ye)return ht;return tt},t.reset=function(){clearTimeout(this._timer)},t.emit=function(r){this.state===ht&&(r&&r.eventType&ye?this.manager.emit(this.options.event+"up",r):(this._input.timeStamp=id(),this.manager.emit(this.options.event,this._input)))},e}(Xi),jm={domEvents:!1,touchAction:ym,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},$m=[[zm,{enable:!1}],[Bm,{enable:!1},["rotate"]],[Am,{direction:et}],[ud,{direction:et},["swipe"]],[hd],[hd,{event:"doubletap",taps:2},["tap"]],[Lm]],YO=1,Hm=2;function Wm(n,e){var t=n.element;if(t.style){var i;lt(n.options.cssProps,function(r,s){i=Pr(t.style,s),e?(n.oldCssProps[i]=t.style[i],t.style[i]=r):t.style[i]=n.oldCssProps[i]||""}),e||(n.oldCssProps={})}}function XO(n,e){var t=document.createEvent("Event");t.initEvent(n,!0,!0),t.gesture=e,e.target.dispatchEvent(t)}var Vm=function(){function n(t,i){var r=this;this.options=Mt({},jm,i||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=UO(this),this.touchAction=new Sm(this,this.options.touchAction),Wm(this,!0),lt(this.options.recognizers,function(s){var o=r.add(new s[0](s[1]));s[2]&&o.recognizeWith(s[2]),s[3]&&o.requireFailure(s[3])},this)}var e=n.prototype;return e.set=function(i){return Mt(this.options,i),i.touchAction&&this.touchAction.update(),i.inputTarget&&(this.input.destroy(),this.input.target=i.inputTarget,this.input.init()),this},e.stop=function(i){this.session.stopped=i?Hm:YO},e.recognize=function(i){var r=this.session;if(!r.stopped){this.touchAction.preventDefaults(i);var s,o=this.recognizers,a=r.curRecognizer;(!a||a&&a.state&ht)&&(r.curRecognizer=null,a=null);for(var d=0;d<o.length;)s=o[d],r.stopped!==Hm&&(!a||s===a||s.canRecognizeWith(a))?s.recognize(i):s.reset(),!a&&s.state&(je|mi|gt)&&(r.curRecognizer=s,a=s),d++}},e.get=function(i){if(i instanceof Xi)return i;for(var r=this.recognizers,s=0;s<r.length;s++)if(r[s].options.event===i)return r[s];return null},e.add=function(i){if(vi(i,"add",this))return this;var r=this.get(i.options.event);return r&&this.remove(r),this.recognizers.push(i),i.manager=this,this.touchAction.update(),i},e.remove=function(i){if(vi(i,"remove",this))return this;var r=this.get(i);if(i){var s=this.recognizers,o=Bt(s,r);o!==-1&&(s.splice(o,1),this.touchAction.update())}return this},e.on=function(i,r){if(i===void 0||r===void 0)return this;var s=this.handlers;return lt(Vi(i),function(o){s[o]=s[o]||[],s[o].push(r)}),this},e.off=function(i,r){if(i===void 0)return this;var s=this.handlers;return lt(Vi(i),function(o){r?s[o]&&s[o].splice(Bt(s[o],r),1):delete s[o]}),this},e.emit=function(i,r){this.options.domEvents&&XO(i,r);var s=this.handlers[i]&&this.handlers[i].slice();if(!(!s||!s.length)){r.type=i,r.preventDefault=function(){r.srcEvent.preventDefault()};for(var o=0;o<s.length;)s[o](r),o++}},e.destroy=function(){this.element&&Wm(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},n}(),ZO={touchstart:Pe,touchmove:Ft,touchend:ye,touchcancel:qe},JO="touchstart",QO="touchstart touchmove touchend touchcancel",eI=function(n){Le(e,n);function e(){var i,r=e.prototype;return r.evTarget=JO,r.evWin=QO,i=n.apply(this,arguments)||this,i.started=!1,i}var t=e.prototype;return t.handler=function(r){var s=ZO[r.type];if(s===Pe&&(this.started=!0),!!this.started){var o=tI.call(this,r,s);s&(ye|qe)&&o[0].length-o[1].length===0&&(this.started=!1),this.callback(this.manager,s,{pointers:o[0],changedPointers:o[1],pointerType:ji,srcEvent:r})}},e}(gi);function tI(n,e){var t=Ki(n.touches),i=Ki(n.changedTouches);return e&(ye|qe)&&(t=ad(t.concat(i),"identifier",!0)),[t,i]}function Um(n,e,t){var i="DEPRECATED METHOD: "+e+`
`+t+` AT 
`;return function(){var r=new Error("get-stack-trace"),s=r&&r.stack?r.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,i,s),n.apply(this,arguments)}}var Gm=Um(function(n,e,t){for(var i=Object.keys(e),r=0;r<i.length;)(!t||t&&n[i[r]]===void 0)&&(n[i[r]]=e[i[r]]),r++;return n},"extend","Use `assign`."),iI=Um(function(n,e){return Gm(n,e,!0)},"merge","Use `assign`.");function rI(n,e,t){var i=e.prototype,r;r=n.prototype=Object.create(i),r.constructor=n,r._super=i,t&&Mt(r,t)}function Km(n,e){return function(){return n.apply(e,arguments)}}var Ym=function(){var n=function(t,i){return i===void 0&&(i={}),new Vm(t,Ke({recognizers:$m.concat()},i))};return n.VERSION="2.0.17-rc",n.DIRECTION_ALL=_m,n.DIRECTION_DOWN=pi,n.DIRECTION_LEFT=$i,n.DIRECTION_RIGHT=Hi,n.DIRECTION_UP=Wi,n.DIRECTION_HORIZONTAL=et,n.DIRECTION_VERTICAL=Nt,n.DIRECTION_NONE=xr,n.DIRECTION_DOWN=pi,n.INPUT_START=Pe,n.INPUT_MOVE=Ft,n.INPUT_END=ye,n.INPUT_CANCEL=qe,n.STATE_POSSIBLE=qr,n.STATE_BEGAN=je,n.STATE_CHANGED=mi,n.STATE_ENDED=gt,n.STATE_RECOGNIZED=ht,n.STATE_CANCELLED=Yi,n.STATE_FAILED=tt,n.Manager=Vm,n.Input=gi,n.TouchAction=Sm,n.TouchInput=dd,n.MouseInput=ld,n.PointerEventInput=Dm,n.TouchMouseInput=km,n.SingleTouchInput=eI,n.Recognizer=Xi,n.AttrRecognizer=yi,n.Tap=hd,n.Pan=ud,n.Swipe=Am,n.Pinch=Bm,n.Rotate=zm,n.Press=Lm,n.on=Ui,n.off=Gi,n.each=lt,n.merge=iI,n.extend=Gm,n.bindFn=Km,n.assign=Mt,n.inherit=rI,n.bindFn=Km,n.prefixed=Pr,n.toArray=Ki,n.inArray=Bt,n.uniqueArray=ad,n.splitStr=Vi,n.boolOrFn=Dr,n.hasParent=sd,n.addEventListeners=Ui,n.removeEventListeners=Gi,n.defaults=Mt({},jm,{preset:$m}),n}();Ym.defaults,sS("DELETE");function Fr(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return nI(e.length?e:[Ir()])}function nI(n){let[e,t,i]=sI(n),r=1;const s=()=>{const o=2091639*e+r*23283064365386963e-26;return e=t,t=i,i=o-(r=o|0)};return s.uint32=()=>s()*4294967296,s.fract53=()=>s()+(s()*2097152|0)*11102230246251565e-32,s.algorithm="Alea",s.seed=n,s.version="0.9",s}function sI(){const n=oI();let e=n(" "),t=n(" "),i=n(" ");for(let r=0;r<arguments.length;r++)e-=n(r<0||arguments.length<=r?void 0:arguments[r]),e<0&&(e+=1),t-=n(r<0||arguments.length<=r?void 0:arguments[r]),t<0&&(t+=1),i-=n(r<0||arguments.length<=r?void 0:arguments[r]),i<0&&(i+=1);return[e,t,i]}function oI(){let n=4022871197;return function(e){const t=e.toString();for(let i=0;i<t.length;i++){n+=t.charCodeAt(i);let r=.02519603282416938*n;n=r>>>0,r-=n,r*=n,n=r>>>0,r-=n,n+=r*4294967296}return(n>>>0)*23283064365386963e-26}}function aI(){const n=()=>{};return{on:n,off:n,destroy:n,emit:n,get(){return{set:n}}}}const cd=typeof window<"u"?window.Hammer||Ym:function(){return aI()};function it(n){var e;this._cleanupQueue=[],this.active=!1,this._dom={container:n,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});const t=cd(this._dom.overlay);t.on("tap",D(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{t.destroy()});const i=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];Q(i).call(i,r=>{t.on(r,s=>{s.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=r=>{dI(r.target,n)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=r=>{("key"in r?r.key==="Escape":r.keyCode===27)&&this.deactivate()}}zc(it.prototype),it.current=null,it.prototype.destroy=function(){this.deactivate();for(const t of Rt(n=ot(e=this._cleanupQueue).call(e,0)).call(n)){var n,e;t()}},it.prototype.activate=function(){it.current&&it.current.deactivate(),it.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)},it.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")},it.prototype._onTapOverlay=function(n){this.activate(),n.srcEvent.stopPropagation()};function dI(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}const lI=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,hI=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,uI=/^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,cI=/^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 vt(n){if(n)for(;n.hasChildNodes()===!0;){const e=n.firstChild;e&&(vt(e),n.removeChild(e))}}function bi(n){return n instanceof String||typeof n=="string"}function Xm(n){return typeof n=="object"&&n!==null}function zt(n,e,t,i){let r=!1;i===!0&&(r=e[t]===null&&n[t]!==void 0),r?delete n[t]:n[t]=e[t]}function Zm(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(const i in n)if(e[i]!==void 0)if(e[i]===null||typeof e[i]!="object")zt(n,e,i,t);else{const r=n[i],s=e[i];Xm(r)&&Xm(s)&&Zm(r,s,t)}}function wi(n,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(he(t))throw new TypeError("Arrays are not supported by deepExtend");for(let r=0;r<n.length;r++){const s=n[r];if(Object.prototype.hasOwnProperty.call(t,s))if(t[s]&&t[s].constructor===Object)e[s]===void 0&&(e[s]={}),e[s].constructor===Object?te(e[s],t[s],!1,i):zt(e,t,s,i);else{if(he(t[s]))throw new TypeError("Arrays are not supported by deepExtend");zt(e,t,s,i)}}return e}function Nr(n,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(he(t))throw new TypeError("Arrays are not supported by deepExtend");for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&!pt(n).call(n,r))if(t[r]&&t[r].constructor===Object)e[r]===void 0&&(e[r]={}),e[r].constructor===Object?te(e[r],t[r]):zt(e,t,r,i);else if(he(t[r])){e[r]=[];for(let s=0;s<t[r].length;s++)e[r].push(t[r][s])}else zt(e,t,r,i);return e}function te(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)||t===!0)if(typeof e[s]=="object"&&e[s]!==null&&rv(e[s])===Object.prototype)n[s]===void 0?n[s]=te({},e[s],t):typeof n[s]=="object"&&n[s]!==null&&rv(n[s])===Object.prototype?te(n[s],e[s],t):zt(n,e,s,i);else if(he(e[s])){var r;n[s]=Qe(r=e[s]).call(r)}else zt(n,e,s,i);return n}function Ar(n,e){return[...n,e]}function fI(n){return Qe(n).call(n)}function pI(n){return n.getBoundingClientRect().left}function gI(n){return n.getBoundingClientRect().top}function H(n,e){if(he(n)){const t=n.length;for(let i=0;i<t;i++)e(n[i],i,n)}else for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e(n[t],t,n)}function fd(n){let e;switch(n.length){case 3:case 4:return e=hI.exec(n),e?{r:Ge(e[1]+e[1],16),g:Ge(e[2]+e[2],16),b:Ge(e[3]+e[3],16)}:null;case 6:case 7:return e=lI.exec(n),e?{r:Ge(e[1],16),g:Ge(e[2],16),b:Ge(e[3],16)}:null;default:return null}}function $e(n,e){if(pt(n).call(n,"rgba"))return n;if(pt(n).call(n,"rgb")){const t=n.substr(J(n).call(n,"(")+1).replace(")","").split(",");return"rgba("+t[0]+","+t[1]+","+t[2]+","+e+")"}else{const t=fd(n);return t==null?n:"rgba("+t.r+","+t.g+","+t.b+","+e+")"}}function Jm(n,e,t){var i;return"#"+Qe(i=((1<<24)+(n<<16)+(e<<8)+t).toString(16)).call(i,1)}function pd(n,e){if(bi(n)){let i=n;if(ey(i)){var t;const r=ui(t=i.substr(4).substr(0,i.length-5).split(",")).call(t,function(s){return Ge(s)});i=Jm(r[0],r[1],r[2])}if(Qm(i)===!0){const r=vI(i),s={h:r.h,s:r.s*.8,v:Math.min(1,r.v*1.02)},o={h:r.h,s:Math.min(1,r.s*1.25),v:r.v*.8},a=gd(o.h,o.s,o.v),d=gd(s.h,s.s,s.v);return{background:i,border:a,highlight:{background:d,border:a},hover:{background:d,border:a}}}else return{background:i,border:i,highlight:{background:i,border:i},hover:{background:i,border:i}}}else return{background:n.background||void 0,border:n.border||void 0,highlight:bi(n.highlight)?{border:n.highlight,background:n.highlight}:{background:n.highlight&&n.highlight.background||void 0,border:n.highlight&&n.highlight.border||void 0},hover:bi(n.hover)?{border:n.hover,background:n.hover}:{border:n.hover&&n.hover.border||void 0,background:n.hover&&n.hover.background||void 0}}}function Zi(n,e,t){n=n/255,e=e/255,t=t/255;const i=Math.min(n,Math.min(e,t)),r=Math.max(n,Math.max(e,t));if(i===r)return{h:0,s:0,v:i};const s=n===i?e-t:t===i?n-e:t-n,a=60*((n===i?3:t===i?1:5)-s/(r-i))/360,d=(r-i)/r;return{h:a,s:d,v:r}}function Br(n,e,t){let i,r,s;const o=Math.floor(n*6),a=n*6-o,d=t*(1-e),l=t*(1-a*e),h=t*(1-(1-a)*e);switch(o%6){case 0:i=t,r=h,s=d;break;case 1:i=l,r=t,s=d;break;case 2:i=d,r=t,s=h;break;case 3:i=d,r=l,s=t;break;case 4:i=h,r=d,s=t;break;case 5:i=t,r=d,s=l;break}return{r:Math.floor(i*255),g:Math.floor(r*255),b:Math.floor(s*255)}}function gd(n,e,t){const i=Br(n,e,t);return Jm(i.r,i.g,i.b)}function vI(n){const e=fd(n);if(!e)throw new TypeError("'".concat(n,"' is not a valid color."));return Zi(e.r,e.g,e.b)}function Qm(n){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(n)}function ey(n){return uI.test(n)}function mI(n){return cI.test(n)}function mt(n){if(n===null||typeof n!="object")return null;if(n instanceof Element)return n;const e=Dt(n);for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&typeof n[t]=="object"&&(e[t]=mt(n[t]));return e}function He(n,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=function(f){return f!=null},s=function(f){return f!==null&&typeof f=="object"},o=function(f){for(const p in f)if(Object.prototype.hasOwnProperty.call(f,p))return!1;return!0};if(!s(n))throw new Error("Parameter mergeTarget must be an object");if(!s(e))throw new Error("Parameter options must be an object");if(!r(t))throw new Error("Parameter option must have a value");if(!s(i))throw new Error("Parameter globalOptions must be an object");const a=function(f,p,g){s(f[g])||(f[g]={});const b=p[g],m=f[g];for(const v in b)Object.prototype.hasOwnProperty.call(b,v)&&(m[v]=b[v])},d=e[t],h=s(i)&&!o(i)?i[t]:void 0,u=h?h.enabled:void 0;if(d===void 0)return;if(typeof d=="boolean"){s(n[t])||(n[t]={}),n[t].enabled=d;return}if(d===null&&!s(n[t]))if(r(h))n[t]=Dt(h);else return;if(!s(d))return;let c=!0;d.enabled!==void 0?c=d.enabled:u!==void 0&&(c=h.enabled),a(n,e,t),n[t].enabled=c}const yI={linear(n){return n},easeInQuad(n){return n*n},easeOutQuad(n){return n*(2-n)},easeInOutQuad(n){return n<.5?2*n*n:-1+(4-2*n)*n},easeInCubic(n){return n*n*n},easeOutCubic(n){return--n*n*n+1},easeInOutCubic(n){return n<.5?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1},easeInQuart(n){return n*n*n*n},easeOutQuart(n){return 1- --n*n*n*n},easeInOutQuart(n){return n<.5?8*n*n*n*n:1-8*--n*n*n*n},easeInQuint(n){return n*n*n*n*n},easeOutQuint(n){return 1+--n*n*n*n*n},easeInOutQuint(n){return n<.5?16*n*n*n*n*n:1+16*--n*n*n*n*n}};function yt(n,e){let t;he(e)||(e=[e]);for(const i of n)if(i){t=i[e[0]];for(let r=1;r<e.length;r++)t&&(t=t[e[r]]);if(typeof t<"u")break}return t}const bI={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"};let wI=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 bI[e]}setColor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==="none")return;let i;const r=this._isColorString(e);if(r!==void 0&&(e=r),bi(e)===!0){if(ey(e)===!0){const s=e.substr(4).substr(0,e.length-5).split(",");i={r:s[0],g:s[1],b:s[2],a:1}}else if(mI(e)===!0){const s=e.substr(5).substr(0,e.length-6).split(",");i={r:s[0],g:s[1],b:s[2],a:s[3]}}else if(Qm(e)===!0){const s=fd(e);i={r:s.r,g:s.g,b:s.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){const s=e.a!==void 0?e.a:"1.0";i={r:e.r,g:e.g,b:e.b,a:s}}if(i===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: "+Ai(e));this._setColor(i,t)}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=me({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",at(()=>{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=me({},e)),this.color=e;const i=Zi(e.r,e.g,e.b),r=2*Math.PI,s=this.r*i.s,o=this.centerCoordinates.x+s*Math.sin(r*i.h),a=this.centerCoordinates.y+s*Math.cos(r*i.h);this.colorPickerSelector.style.left=o-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=a-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}_setOpacity(e){this.color.a=e/100,this._updatePicker(this.color)}_setBrightness(e){const t=Zi(this.color.r,this.color.g,this.color.b);t.v=e/100;const i=Br(t.h,t.s,t.v);i.a=this.color.a,this.color=i,this._updatePicker()}_updatePicker(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color;const t=Zi(e.r,e.g,e.b),i=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const r=this.colorPickerCanvas.clientWidth,s=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,r,s),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-t.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),Bi(i).call(i),this.brightnessRange.value=100*t.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,t,i,r;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){const o=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const o=document.createElement("DIV");o.style.color="red",o.style.fontWeight="bold",o.style.padding="10px",o.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(o)}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{}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{}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);const s=this;this.opacityRange.onchange=function(){s._setOpacity(this.value)},this.opacityRange.oninput=function(){s._setOpacity(this.value)},this.brightnessRange.onchange=function(){s._setBrightness(this.value)},this.brightnessRange.oninput=function(){s._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=D(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=D(t=this._apply).call(t,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=D(i=this._save).call(i,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=D(r=this._loadLast).call(r,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 cd(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){const 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);const t=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,i);let r,s,o,a;this.centerCoordinates={x:t*.5,y:i*.5},this.r=.49*t;const d=2*Math.PI/360,l=1/360,h=1/this.r;let u;for(o=0;o<360;o++)for(a=0;a<this.r;a++)r=this.centerCoordinates.x+a*Math.sin(d*o),s=this.centerCoordinates.y+a*Math.cos(d*o),u=Br(o*l,a*h,1),e.fillStyle="rgb("+u.r+","+u.g+","+u.b+")",e.fillRect(r-.5,s-.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,t,i)}this.generated=!0}_moveSelector(e){const t=this.colorPickerDiv.getBoundingClientRect(),i=e.center.x-t.left,r=e.center.y-t.top,s=.5*this.colorPickerDiv.clientHeight,o=.5*this.colorPickerDiv.clientWidth,a=i-o,d=r-s,l=Math.atan2(a,d),h=.98*Math.min(Math.sqrt(a*a+d*d),o),u=Math.cos(l)*h+s,c=Math.sin(l)*h+o;this.colorPickerSelector.style.top=u-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=c-.5*this.colorPickerSelector.clientWidth+"px";let f=l/(2*Math.PI);f=f<0?f+1:f;const p=h/this.r,g=Zi(this.color.r,this.color.g,this.color.b);g.h=f,g.s=p;const b=Br(g.h,g.s,g.v);b.a=this.color.a,this.color=b,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 vd(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];if(e.length<1)throw new TypeError("Invalid arguments.");if(e.length===1)return document.createTextNode(e[0]);{const i=document.createElement(e[0]);return i.appendChild(vd(...Qe(e).call(e,1))),i}}let _I=class{constructor(e,t,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:()=>!1;this.parent=e,this.changedOptions=[],this.container=t,this.allowCreation=!1,this.hideOption=s,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},me(this.options,this.defaultOptions),this.configureOptions=i,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new wI(r),this.wrapper=void 0}setOptions(e){if(e!==void 0){this.popupHistory={},this._removePopup();let t=!0;if(typeof e=="string")this.options.filter=e;else if(he(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),Me(e)!==void 0&&(this.options.filter=Me(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(t=e.enabled)}else typeof e=="boolean"?(this.options.filter=!0,t=e):typeof e=="function"&&(this.options.filter=e,t=!0);Me(this.options)===!1&&(t=!1),this.options.enabled=t}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=[];const e=Me(this.options);let t=0,i=!1;for(const r in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,r)&&(this.allowCreation=!1,i=!1,typeof e=="function"?(i=e(r,[]),i=i||this._handleObject(this.configureOptions[r],[r],!0)):(e===!0||J(e).call(e,r)!==-1)&&(i=!0),i!==!1&&(this.allowCreation=!0,t>0&&this._makeItem([]),this._makeHeader(r),this._handleObject(this.configureOptions[r],[r])),t++);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 t=this.moduleOptions;for(let i=0;i<e.length;i++)if(t[e[i]]!==void 0)t=t[e[i]];else{t=void 0;break}return t}_makeItem(e){if(this.allowCreation===!0){const s=document.createElement("div");s.className="vis-configuration vis-config-item vis-config-s"+e.length;for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return Q(i).call(i,o=>{s.appendChild(o)}),this.domElements.push(s),this.domElements.length}return 0}_makeHeader(e){const t=document.createElement("div");t.className="vis-configuration vis-config-header",t.innerText=e,this._makeItem([],t)}_makeLabel(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const r=document.createElement("div");if(r.className="vis-configuration vis-config-label vis-config-s"+t.length,i===!0){for(;r.firstChild;)r.removeChild(r.firstChild);r.appendChild(vd("i","b",e))}else r.innerText=e+":";return r}_makeDropdown(e,t,i){const r=document.createElement("select");r.className="vis-configuration vis-config-select";let s=0;t!==void 0&&J(e).call(e,t)!==-1&&(s=J(e).call(e,t));for(let d=0;d<e.length;d++){const l=document.createElement("option");l.value=e[d],d===s&&(l.selected="selected"),l.innerText=e[d],r.appendChild(l)}const o=this;r.onchange=function(){o._update(this.value,i)};const a=this._makeLabel(i[i.length-1],i);this._makeItem(i,a,r)}_makeRange(e,t,i){const r=e[0],s=e[1],o=e[2],a=e[3],d=document.createElement("input");d.className="vis-configuration vis-config-range";try{d.type="range",d.min=s,d.max=o}catch{}d.step=a;let l="",h=0;t!==void 0?(t<0&&t*1.2<s?(d.min=Math.ceil(t*1.2),h=d.min,l="range increased"):t/1.2<s&&(d.min=Math.ceil(t/1.2),h=d.min,l="range increased"),t*1.2>o&&o!==1&&(d.max=Math.ceil(t*1.2),h=d.max,l="range increased"),d.value=t):d.value=r;const u=document.createElement("input");u.className="vis-configuration vis-config-rangeinput",u.value=d.value;const c=this;d.onchange=function(){u.value=this.value,c._update(Number(this.value),i)},d.oninput=function(){u.value=this.value};const f=this._makeLabel(i[i.length-1],i),p=this._makeItem(i,f,d,u);l!==""&&this.popupHistory[p]!==h&&(this.popupHistory[p]=h,this._setupPopup(l,p))}_makeButton(){if(this.options.showButton===!0){const 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,t){if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){const i=document.createElement("div");i.id="vis-configuration-popup",i.className="vis-configuration-popup",i.innerText=e,i.onclick=()=>{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:i,index:t}}}_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){const t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=at(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=at(()=>{this._removePopup()},1800)}}_makeCheckbox(e,t,i){const r=document.createElement("input");r.type="checkbox",r.className="vis-configuration vis-config-checkbox",r.checked=e,t!==void 0&&(r.checked=t,t!==e&&(typeof e=="object"?t!==e.enabled&&this.changedOptions.push({path:i,value:t}):this.changedOptions.push({path:i,value:t})));const s=this;r.onchange=function(){s._update(this.checked,i)};const o=this._makeLabel(i[i.length-1],i);this._makeItem(i,o,r)}_makeTextInput(e,t,i){const r=document.createElement("input");r.type="text",r.className="vis-configuration vis-config-text",r.value=t,t!==e&&this.changedOptions.push({path:i,value:t});const s=this;r.onchange=function(){s._update(this.value,i)};const o=this._makeLabel(i[i.length-1],i);this._makeItem(i,o,r)}_makeColorField(e,t,i){const r=e[1],s=document.createElement("div");t=t===void 0?r:t,t!=="none"?(s.className="vis-configuration vis-config-colorBlock",s.style.backgroundColor=t):s.className="vis-configuration vis-config-colorBlock none",t=t===void 0?r:t,s.onclick=()=>{this._showColorPicker(t,s,i)};const o=this._makeLabel(i[i.length-1],i);this._makeItem(i,o,s)}_showColorPicker(e,t,i){t.onclick=function(){},this.colorPicker.insertTo(t),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(r=>{const s="rgba("+r.r+","+r.g+","+r.b+","+r.a+")";t.style.backgroundColor=s,this._update(s,i)}),this.colorPicker.setCloseCallback(()=>{t.onclick=()=>{this._showColorPicker(e,t,i)}})}_handleObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=!1;const s=Me(this.options);let o=!1;for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){r=!0;const d=e[a],l=Ar(t,a);if(typeof s=="function"&&(r=s(a,t),r===!1&&!he(d)&&typeof d!="string"&&typeof d!="boolean"&&d instanceof Object&&(this.allowCreation=!1,r=this._handleObject(d,l,!0),this.allowCreation=i===!1)),r!==!1){o=!0;const h=this._getValue(l);if(he(d))this._handleArray(d,h,l);else if(typeof d=="string")this._makeTextInput(d,h,l);else if(typeof d=="boolean")this._makeCheckbox(d,h,l);else if(d instanceof Object){if(!this.hideOption(t,a,this.moduleOptions))if(d.enabled!==void 0){const u=Ar(l,"enabled"),c=this._getValue(u);if(c===!0){const f=this._makeLabel(a,l,!0);this._makeItem(l,f),o=this._handleObject(d,l)||o}else this._makeCheckbox(d,c,l)}else{const u=this._makeLabel(a,l,!0);this._makeItem(l,u),o=this._handleObject(d,l)||o}}else console.error("dont know how to handle",d,a,l)}}return o}_handleArray(e,t,i){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,t,i),e[1]!==t&&this.changedOptions.push({path:i,value:t})):typeof e[0]=="string"?(this._makeDropdown(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:t})):typeof e[0]=="number"&&(this._makeRange(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:Number(t)}))}_update(e,t){const i=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}_constructOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=i;e=e==="true"?!0:e,e=e==="false"?!1:e;for(let s=0;s<t.length;s++)t[s]!=="global"&&(r[t[s]]===void 0&&(r[t[s]]={}),s!==t.length-1?r=r[t[s]]:r[t[s]]=e);return i}_printOptions(){const e=this.getOptions();for(;this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(vd("pre","const options = "+Ai(e,null,2)))}getOptions(){const e={};for(let t=0;t<this.changedOptions.length;t++)this._constructOptions(this.changedOptions[t].value,this.changedOptions[t].path,e);return e}},EI=class{constructor(e,t){this.container=e,this.overflowMethod=t||"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,t){this.x=Ge(e),this.y=Ge(t)}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){const t=this.frame.clientHeight,i=this.frame.clientWidth,r=this.frame.parentNode.clientHeight,s=this.frame.parentNode.clientWidth;let o=0,a=0;if(this.overflowMethod=="flip"){let d=!1,l=!0;this.y-t<this.padding&&(l=!1),this.x+i>s-this.padding&&(d=!0),d?o=this.x-i:o=this.x,l?a=this.y-t:a=this.y}else a=this.y-t,a+t+this.padding>r&&(a=r-t-this.padding),a<this.padding&&(a=this.padding),o=this.x,o+i+this.padding>s&&(o=s-i-this.padding),o<this.padding&&(o=this.padding);this.frame.style.left=o+"px",this.frame.style.top=a+"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)}},Ji=!1,ty;const md="background: #FFeeee; color: #dd0000";let SI=class ce{static validate(e,t,i){Ji=!1,ty=t;let r=t;return i!==void 0&&(r=t[i]),ce.parse(e,r,[]),Ji}static parse(e,t,i){for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&ce.check(r,e,t,i)}static check(e,t,i,r){if(i[e]===void 0&&i.__any__===void 0){ce.getSuggestion(e,i,r);return}let s=e,o=!0;i[e]===void 0&&i.__any__!==void 0&&(s="__any__",o=ce.getType(t[e])==="object");let a=i[s];o&&a.__type__!==void 0&&(a=a.__type__),ce.checkFields(e,t,i,s,a,r)}static checkFields(e,t,i,r,s,o){const a=function(h){console.error("%c"+h+ce.printLocation(o,e),md)},d=ce.getType(t[e]),l=s[d];l!==void 0?ce.getType(l)==="array"&&J(l).call(l,t[e])===-1?(a('Invalid option detected in "'+e+'". Allowed values are:'+ce.print(l)+' not "'+t[e]+'". '),Ji=!0):d==="object"&&r!=="__any__"&&(o=Ar(o,e),ce.parse(t[e],i[r],o)):s.any===void 0&&(a('Invalid type received for "'+e+'". Expected: '+ce.print(ue(s))+". Received ["+d+'] "'+t[e]+'"'),Ji=!0)}static getType(e){const t=typeof e;return t==="object"?e===null?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":he(e)?"array":e instanceof Date?"date":e.nodeType!==void 0?"dom":e._isAMomentObject===!0?"moment":"object":t==="number"?"number":t==="boolean"?"boolean":t==="string"?"string":t===void 0?"undefined":t}static getSuggestion(e,t,i){const r=ce.findInOptions(e,t,i,!1),s=ce.findInOptions(e,ty,[],!0),o=8,a=4;let d;r.indexMatch!==void 0?d=" in "+ce.printLocation(r.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+r.indexMatch+`"?

`:s.distance<=a&&r.distance>s.distance?d=" in "+ce.printLocation(r.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+ce.printLocation(s.path,s.closestMatch,""):r.distance<=o?d='. Did you mean "'+r.closestMatch+'"?'+ce.printLocation(r.path,e):d=". Did you mean one of these: "+ce.print(ue(t))+ce.printLocation(i,e),console.error('%cUnknown option detected: "'+e+'"'+d,md),Ji=!0}static findInOptions(e,t,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=1e9,o="",a=[];const d=e.toLowerCase();let l;for(const u in t){let c;if(t[u].__type__!==void 0&&r===!0){const f=ce.findInOptions(e,t[u],Ar(i,u));s>f.distance&&(o=f.closestMatch,a=f.path,s=f.distance,l=f.indexMatch)}else{var h;J(h=u.toLowerCase()).call(h,d)!==-1&&(l=u),c=ce.levenshteinDistance(e,u),s>c&&(o=u,a=fI(i),s=c)}}return{closestMatch:o,path:a,distance:s,indexMatch:l}}static printLocation(e,t){let r=`

`+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:`Problem value found at: 
`)+`options = {
`;for(let s=0;s<e.length;s++){for(let o=0;o<s+1;o++)r+="  ";r+=e[s]+`: {
`}for(let s=0;s<e.length+1;s++)r+="  ";r+=t+`
`;for(let s=0;s<e.length+1;s++){for(let o=0;o<e.length-s;o++)r+="  ";r+=`}
`}return r+`

`}static print(e){return Ai(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;const i=[];let r;for(r=0;r<=t.length;r++)i[r]=[r];let s;for(s=0;s<=e.length;s++)i[0][s]=s;for(r=1;r<=t.length;r++)for(s=1;s<=e.length;s++)t.charAt(r-1)==e.charAt(s-1)?i[r][s]=i[r-1][s-1]:i[r][s]=Math.min(i[r-1][s-1]+1,Math.min(i[r][s-1]+1,i[r-1][s]+1));return i[t.length][e.length]}};const OI=it,II=_I,_i=cd,TI=EI,iy=md,PI=SI;function ry(n){return bt=n,DI()}var ny={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},yd=Dt(ny);yd.color="color.color",yd.style="dashes";var Ce={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},sy={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},bt="",Ei=0,$="",z="",ke=Ce.NULL;function CI(){Ei=0,$=bt.charAt(0)}function Ee(){Ei++,$=bt.charAt(Ei)}function Si(){return bt.charAt(Ei+1)}function oy(n){var e=n.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 wt(n,e){if(n||(n={}),e)for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function xI(n,e,t){for(var i=e.split("."),r=n;i.length;){var s=i.shift();i.length?(r[s]||(r[s]={}),r=r[s]):r[s]=t}}function ay(n,e){for(var t,i,r=null,s=[n],o=n;o.parent;)s.push(o.parent),o=o.parent;if(o.nodes){for(t=0,i=o.nodes.length;t<i;t++)if(e.id===o.nodes[t].id){r=o.nodes[t];break}}for(r||(r={id:e.id},n.node&&(r.attr=wt(r.attr,n.node))),t=s.length-1;t>=0;t--){var a,d=s[t];d.nodes||(d.nodes=[]),J(a=d.nodes).call(a,r)===-1&&d.nodes.push(r)}e.attr&&(r.attr=wt(r.attr,e.attr))}function RI(n,e){if(n.edges||(n.edges=[]),n.edges.push(e),n.edge){var t=wt({},n.edge);e.attr=wt(t,e.attr)}}function dy(n,e,t,i,r){var s={from:e,to:t,type:i};return n.edge&&(s.attr=wt({},n.edge)),s.attr=wt(s.attr||{},r),r!=null&&r.hasOwnProperty("arrows")&&r.arrows!=null&&(s.arrows={to:{enabled:!0,type:r.arrows.type}},r.arrows=null),s}function ie(){for(ke=Ce.NULL,z="";$===" "||$==="	"||$===`
`||$==="\r";)Ee();do{var n=!1;if($==="#"){for(var e=Ei-1;bt.charAt(e)===" "||bt.charAt(e)==="	";)e--;if(bt.charAt(e)===`
`||bt.charAt(e)===""){for(;$!=""&&$!=`
`;)Ee();n=!0}}if($==="/"&&Si()==="/"){for(;$!=""&&$!=`
`;)Ee();n=!0}if($==="/"&&Si()==="*"){for(;$!="";)if($==="*"&&Si()==="/"){Ee(),Ee();break}else Ee();n=!0}for(;$===" "||$==="	"||$===`
`||$==="\r";)Ee()}while(n);if($===""){ke=Ce.DELIMITER;return}var t=$+Si();if(sy[t]){ke=Ce.DELIMITER,z=t,Ee(),Ee();return}if(sy[$]){ke=Ce.DELIMITER,z=$,Ee();return}if(oy($)||$==="-"){for(z+=$,Ee();oy($);)z+=$,Ee();z==="false"?z=!1:z==="true"?z=!0:isNaN(Number(z))||(z=Number(z)),ke=Ce.IDENTIFIER;return}if($==='"'){for(Ee();$!=""&&($!='"'||$==='"'&&Si()==='"');)$==='"'?(z+=$,Ee()):$==="\\"&&Si()==="n"?(z+=`
`,Ee()):z+=$,Ee();if($!='"')throw xe('End of string " expected');Ee(),ke=Ce.IDENTIFIER;return}for(ke=Ce.UNKNOWN;$!="";)z+=$,Ee();throw new SyntaxError('Syntax error in part "'+cy(z,30)+'"')}function DI(){var n={};if(CI(),ie(),z==="strict"&&(n.strict=!0,ie()),(z==="graph"||z==="digraph")&&(n.type=z,ie()),ke===Ce.IDENTIFIER&&(n.id=z,ie()),z!="{")throw xe("Angle bracket { expected");if(ie(),ly(n),z!="}")throw xe("Angle bracket } expected");if(ie(),z!=="")throw xe("End of file expected");return ie(),delete n.node,delete n.edge,delete n.graph,n}function ly(n){for(;z!==""&&z!="}";)MI(n),z===";"&&ie()}function MI(n){var e=hy(n);if(e){uy(n,e);return}var t=qI(n);if(!t){if(ke!=Ce.IDENTIFIER)throw xe("Identifier expected");var i=z;if(ie(),z==="="){if(ie(),ke!=Ce.IDENTIFIER)throw xe("Identifier expected");n[i]=z,ie()}else kI(n,i)}}function hy(n){var e=null;if(z==="subgraph"&&(e={},e.type="subgraph",ie(),ke===Ce.IDENTIFIER&&(e.id=z,ie())),z==="{"){if(ie(),e||(e={}),e.parent=n,e.node=n.node,e.edge=n.edge,e.graph=n.graph,ly(e),z!="}")throw xe("Angle bracket } expected");ie(),delete e.node,delete e.edge,delete e.graph,delete e.parent,n.subgraphs||(n.subgraphs=[]),n.subgraphs.push(e)}return e}function qI(n){return z==="node"?(ie(),n.node=Qi(),"node"):z==="edge"?(ie(),n.edge=Qi(),"edge"):z==="graph"?(ie(),n.graph=Qi(),"graph"):null}function kI(n,e){var t={id:e},i=Qi();i&&(t.attr=i),ay(n,t),uy(n,e)}function uy(n,e){for(;z==="->"||z==="--";){var t,i=z;ie();var r=hy(n);if(r)t=r;else{if(ke!=Ce.IDENTIFIER)throw xe("Identifier or subgraph expected");t=z,ay(n,{id:t}),ie()}var s=Qi(),o=dy(n,e,t,i,s);RI(n,o),e=t}}function Qi(){for(var n,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},i={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},r=new Array,s=new Array;z==="[";){for(ie(),e={};z!==""&&z!="]";){if(ke!=Ce.IDENTIFIER)throw xe("Attribute name expected");var o=z;if(ie(),z!="=")throw xe("Equal sign = expected");if(ie(),ke!=Ce.IDENTIFIER)throw xe("Attribute value expected");var a=z;o==="style"&&(a=t[a]);var d;o==="arrowhead"&&(d=i[a],o="arrows",a={to:{enabled:!0,type:d}}),o==="arrowtail"&&(d=i[a],o="arrows",a={from:{enabled:!0,type:d}}),r.push({attr:e,name:o,value:a}),s.push(o),ie(),z==","&&ie()}if(z!="]")throw xe("Bracket ] expected");ie()}if(pt(s).call(s,"dir")){var l={};for(l.arrows={},n=0;n<r.length;n++)if(r[n].name==="arrows")if(r[n].value.to!=null)l.arrows.to=n;else if(r[n].value.from!=null)l.arrows.from=n;else throw xe("Invalid value of arrows");else r[n].name==="dir"&&(l.dir=n);var h=r[l.dir].value;if(!pt(s).call(s,"arrows"))if(h==="both")r.push({attr:r[l.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),l.arrows.to=r.length-1,r.push({attr:r[l.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),l.arrows.from=r.length-1;else if(h==="forward")r.push({attr:r[l.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),l.arrows.to=r.length-1;else if(h==="back")r.push({attr:r[l.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),l.arrows.from=r.length-1;else if(h==="none")r.push({attr:r[l.dir].attr,name:"arrows",value:""}),l.arrows.to=r.length-1;else throw xe('Invalid dir type "'+h+'"');var u,c;if(h==="both")l.arrows.to&&l.arrows.from?(c=r[l.arrows.to].value.to.type,u=r[l.arrows.from].value.from.type,r[l.arrows.to]={attr:r[l.arrows.to].attr,name:r[l.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}},ot(r).call(r,l.arrows.from,1)):l.arrows.to?(c=r[l.arrows.to].value.to.type,u="arrow",r[l.arrows.to]={attr:r[l.arrows.to].attr,name:r[l.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}}):l.arrows.from&&(c="arrow",u=r[l.arrows.from].value.from.type,r[l.arrows.from]={attr:r[l.arrows.from].attr,name:r[l.arrows.from].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}});else if(h==="back")l.arrows.to&&l.arrows.from?(c="",u=r[l.arrows.from].value.from.type,r[l.arrows.from]={attr:r[l.arrows.from].attr,name:r[l.arrows.from].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}}):l.arrows.to?(c="",u="arrow",l.arrows.from=l.arrows.to,r[l.arrows.from]={attr:r[l.arrows.from].attr,name:r[l.arrows.from].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}}):l.arrows.from&&(c="",u=r[l.arrows.from].value.from.type,r[l.arrows.to]={attr:r[l.arrows.from].attr,name:r[l.arrows.from].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}}),r[l.arrows.from]={attr:r[l.arrows.from].attr,name:r[l.arrows.from].name,value:{from:{enabled:!0,type:r[l.arrows.from].value.from.type}}};else if(h==="none"){var f;l.arrows.to?f=l.arrows.to:f=l.arrows.from,r[f]={attr:r[f].attr,name:r[f].name,value:""}}else if(h==="forward")l.arrows.to&&l.arrows.from?(c=r[l.arrows.to].value.to.type,u="",r[l.arrows.to]={attr:r[l.arrows.to].attr,name:r[l.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}}):l.arrows.to?(c=r[l.arrows.to].value.to.type,u="",r[l.arrows.to]={attr:r[l.arrows.to].attr,name:r[l.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}}):l.arrows.from&&(c="arrow",u="",l.arrows.to=l.arrows.from,r[l.arrows.to]={attr:r[l.arrows.to].attr,name:r[l.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:u}}}),r[l.arrows.to]={attr:r[l.arrows.to].attr,name:r[l.arrows.to].name,value:{to:{enabled:!0,type:r[l.arrows.to].value.to.type}}};else throw xe('Invalid dir type "'+h+'"');ot(r).call(r,l.dir,1)}var p;if(pt(s).call(s,"penwidth")){var g=[];for(p=r.length,n=0;n<p;n++)r[n].name!=="width"&&(r[n].name==="penwidth"&&(r[n].name="width"),g.push(r[n]));r=g}for(p=r.length,n=0;n<p;n++)xI(r[n].attr,r[n].name,r[n].value);return e}function xe(n){return new SyntaxError(n+', got "'+cy(z,30)+'" (char '+Ei+")")}function cy(n,e){return n.length<=e?n:n.substr(0,27)+"..."}function FI(n,e,t){he(n)?Q(n).call(n,function(i){he(e)?Q(e).call(e,function(r){t(i,r)}):t(i,e)}):he(e)?Q(e).call(e,function(i){t(n,i)}):t(n,e)}function bd(n,e,t){for(var i=e.split("."),r=i.pop(),s=n,o=0;o<i.length;o++){var a=i[o];a in s||(s[a]={}),s=s[a]}return s[r]=t,n}function fy(n,e){var t={};for(var i in n)if(n.hasOwnProperty(i)){var r=e[i];he(r)?Q(r).call(r,function(s){bd(t,s,n[i])}):typeof r=="string"?bd(t,r,n[i]):bd(t,i,n[i])}return t}function py(n){var e=ry(n),t={nodes:[],edges:[],options:{}};if(e.nodes){var i;Q(i=e.nodes).call(i,function(o){var a={id:o.id,label:String(o.label||o.id)};wt(a,fy(o.attr,ny)),a.image&&(a.shape="image"),t.nodes.push(a)})}if(e.edges){var r,s=function(o){var a={from:o.from,to:o.to};return wt(a,fy(o.attr,yd)),a.arrows==null&&o.type==="->"&&(a.arrows="to"),a};Q(r=e.edges).call(r,function(o){var a,d;if(o.from instanceof Object?a=o.from.nodes:a={id:o.from},o.to instanceof Object?d=o.to.nodes:d={id:o.to},o.from instanceof Object&&o.from.edges){var l;Q(l=o.from.edges).call(l,function(u){var c=s(u);t.edges.push(c)})}if(FI(a,d,function(u,c){var f=dy(t,u.id,c.id,o.type,o.attr),p=s(f);t.edges.push(p)}),o.to instanceof Object&&o.to.edges){var h;Q(h=o.to.edges).call(h,function(u){var c=s(u);t.edges.push(c)})}})}return e.attr&&(t.options=e.attr),t}var vR=Object.freeze({__proto__:null,DOTToGraph:py,parseDOT:ry});function gy(n,e){var t;const i={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};e!=null&&(e.fixed!=null&&(i.nodes.fixed=e.fixed),e.parseColor!=null&&(i.nodes.parseColor=e.parseColor),e.inheritColor!=null&&(i.edges.inheritColor=e.inheritColor));const r=n.edges,s=ui(r).call(r,a=>{const d={from:a.source,id:a.id,to:a.target};return a.attributes!=null&&(d.attributes=a.attributes),a.label!=null&&(d.label=a.label),a.attributes!=null&&a.attributes.title!=null&&(d.title=a.attributes.title),a.type==="Directed"&&(d.arrows="to"),a.color&&i.edges.inheritColor===!1&&(d.color=a.color),d});return{nodes:ui(t=n.nodes).call(t,a=>{const d={id:a.id,fixed:i.nodes.fixed&&a.x!=null&&a.y!=null};return a.attributes!=null&&(d.attributes=a.attributes),a.label!=null&&(d.label=a.label),a.size!=null&&(d.size=a.size),a.attributes!=null&&a.attributes.title!=null&&(d.title=a.attributes.title),a.title!=null&&(d.title=a.title),a.x!=null&&(d.x=a.x),a.y!=null&&(d.y=a.y),a.color!=null&&(i.nodes.parseColor===!0?d.color=a.color:d.color={background:a.color,border:a.color,highlight:{background:a.color,border:a.color},hover:{background:a.color,border:a.color}}),d}),edges:s}}var mR=Object.freeze({__proto__:null,parseGephi:gy}),NI=Object.freeze({__proto__:null,cn:{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"},cs:{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"},de:{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"},en:{addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},es:{addDescription:"Haga clic en un lugar vac\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"},fr:{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"},it:{addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},nl:{addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},pt:{addDescription:"Clique em um espa\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"},ru:{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"},uk:{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"}});function AI(n,e){try{const[i,r]=e.split(/[-_ /]/,2),s=i!=null?i.toLowerCase():null,o=r!=null?r.toUpperCase():null;if(s&&o){const a=s+"-"+o;if(Object.prototype.hasOwnProperty.call(n,a))return a;var t;console.warn(_1(t="Unknown variant ".concat(o," of language ")).call(t,s,"."))}if(s){const a=s;if(Object.prototype.hasOwnProperty.call(n,a))return a;console.warn("Unknown language ".concat(s))}return console.warn("Unknown locale ".concat(e,", falling back to English.")),"en"}catch(i){return console.error(i),console.warn("Unexpected error while normalizing locale ".concat(e,", falling back to English.")),"en"}}class BI{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;const e=this.image.width,t=this.image.height;this.width=e,this.height=t;const i=Math.floor(t/2),r=Math.floor(t/4),s=Math.floor(t/8),o=Math.floor(t/16),a=Math.floor(e/2),d=Math.floor(e/4),l=Math.floor(e/8),h=Math.floor(e/16);this.canvas.width=3*d,this.canvas.height=i,this.coordinates=[[0,0,a,i],[a,0,d,r],[a,r,l,s],[5*l,r,h,o]],this._fillMipMap()}initialized(){return this.coordinates!==void 0}_fillMipMap(){const e=this.canvas.getContext("2d"),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(let i=1;i<this.NUM_ITERATIONS;i++){const r=this.coordinates[i-1],s=this.coordinates[i];e.drawImage(this.canvas,r[0],r[1],r[2],r[3],s[0],s[1],s[2],s[3])}}drawImageAtPosition(e,t,i,r,s,o){if(this.initialized())if(t>2){t*=.5;let a=0;for(;t>2&&a<this.NUM_ITERATIONS;)t*=.5,a+=1;a>=this.NUM_ITERATIONS&&(a=this.NUM_ITERATIONS-1);const d=this.coordinates[a];e.drawImage(this.canvas,d[0],d[1],d[2],d[3],i,r,s,o)}else e.drawImage(this.image,i,r,s,o)}}class zI{constructor(e){this.images={},this.imageBroken={},this.callback=e}_tryloadBrokenUrl(e,t,i){if(!(e===void 0||i===void 0)){if(t===void 0){console.warn("No broken url image defined");return}i.image.onerror=()=>{console.error("Could not load brokenImage:",t)},i.image.src=t}}_redrawWithImage(e){this.callback&&this.callback(e)}load(e,t){const i=this.images[e];if(i)return i;const r=new BI;return this.images[e]=r,r.image.onload=()=>{this._fixImageCoordinates(r.image),r.init(),this._redrawWithImage(r)},r.image.onerror=()=>{console.error("Could not load image:",e),this._tryloadBrokenUrl(e,t,r)},r.image.src=e,r}_fixImageCoordinates(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}var vy={},my={},wd={exports:{}},_d,yy;function LI(){if(yy)return _d;yy=1;var n=U();return _d=n(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}),_d}var Ed,by;function jI(){if(by)return Ed;by=1;var n=U(),e=_e(),t=Ze(),i=LI(),r=Object.isExtensible,s=n(function(){});return Ed=s||i?function(a){return!e(a)||i&&t(a)==="ArrayBuffer"?!1:r?r(a):!0}:r,Ed}var Sd,wy;function _y(){if(wy)return Sd;wy=1;var n=U();return Sd=!n(function(){return Object.isExtensible(Object.preventExtensions({}))}),Sd}var Ey;function zr(){if(Ey)return wd.exports;Ey=1;var n=B(),e=G(),t=Mi(),i=_e(),r=Se(),s=Be().f,o=Er(),a=Ls(),d=jI(),l=gr(),h=_y(),u=!1,c=l("meta"),f=0,p=function(y){s(y,c,{value:{objectID:"O"+f++,weakData:{}}})},g=function(y,_){if(!i(y))return typeof y=="symbol"?y:(typeof y=="string"?"S":"P")+y;if(!r(y,c)){if(!d(y))return"F";if(!_)return"E";p(y)}return y[c].objectID},b=function(y,_){if(!r(y,c)){if(!d(y))return!0;if(!_)return!1;p(y)}return y[c].weakData},m=function(y){return h&&u&&d(y)&&!r(y,c)&&p(y),y},v=function(){w.enable=function(){},u=!0;var y=o.f,_=e([].splice),O={};O[c]=1,y(O).length&&(o.f=function(T){for(var E=y(T),I=0,P=E.length;I<P;I++)if(E[I]===c){_(E,I,1);break}return E},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:a.f}))},w=wd.exports={enable:v,fastKey:g,getWeakData:b,onFreeze:m};return t[c]=!0,wd.exports}var Od,Sy;function $I(){if(Sy)return Od;Sy=1;var n=ve(),e=di(),t=n("iterator"),i=Array.prototype;return Od=function(r){return r!==void 0&&(e.Array===r||i[t]===r)},Od}var Id,Oy;function Iy(){if(Oy)return Id;Oy=1;var n=ai(),e=On(),t=Jt(),i=di(),r=ve(),s=r("iterator");return Id=function(o){if(!t(o))return e(o,s)||e(o,"@@iterator")||i[n(o)]},Id}var Td,Ty;function HI(){if(Ty)return Td;Ty=1;var n=De(),e=nt(),t=Je(),i=ti(),r=Iy(),s=TypeError;return Td=function(o,a){var d=arguments.length<2?r(o):a;if(e(d))return t(n(d,o));throw new s(i(o)+" is not iterable")},Td}var Pd,Py;function Cd(){if(Py)return Pd;Py=1;var n=De(),e=Je(),t=On();return Pd=function(i,r,s){var o,a;e(i);try{if(o=t(i,"return"),!o){if(r==="throw")throw s;return s}o=n(o,i)}catch(d){a=!0,o=d}if(r==="throw")throw s;if(a)throw o;return e(o),s},Pd}var xd,Cy;function Lr(){if(Cy)return xd;Cy=1;var n=mr(),e=De(),t=Je(),i=ti(),r=$I(),s=st(),o=ge(),a=HI(),d=Iy(),l=Cd(),h=TypeError,u=function(f,p){this.stopped=f,this.result=p},c=u.prototype;return xd=function(f,p,g){var b=g&&g.that,m=!!(g&&g.AS_ENTRIES),v=!!(g&&g.IS_RECORD),w=!!(g&&g.IS_ITERATOR),y=!!(g&&g.INTERRUPTED),_=n(p,b),O,T,E,I,P,M,x,C=function(N){return O&&l(O,"normal"),new u(!0,N)},k=function(N){return m?(t(N),y?_(N[0],N[1],C):_(N[0],N[1])):y?_(N,C):_(N)};if(v)O=f.iterator;else if(w)O=f;else{if(T=d(f),!T)throw new h(i(f)+" is not iterable");if(r(T)){for(E=0,I=s(f);I>E;E++)if(P=k(f[E]),P&&o(c,P))return P;return new u(!1)}O=a(f,T)}for(M=v?f.next:O.next;!(x=e(M,O)).done;){try{P=k(x.value)}catch(N){l(O,"throw",N)}if(typeof P=="object"&&P&&o(c,P))return P}return new u(!1)},xd}var Rd,xy;function Dd(){if(xy)return Rd;xy=1;var n=ge(),e=TypeError;return Rd=function(t,i){if(n(i,t))return t;throw new e("Incorrect invocation")},Rd}var Md,Ry;function qd(){if(Ry)return Md;Ry=1;var n=B(),e=ae(),t=zr(),i=U(),r=ni(),s=Lr(),o=Dd(),a=we(),d=_e(),l=Jt(),h=Ct(),u=Be().f,c=ft().forEach,f=fe(),p=xt(),g=p.set,b=p.getterFor;return Md=function(m,v,w){var y=m.indexOf("Map")!==-1,_=m.indexOf("Weak")!==-1,O=y?"set":"add",T=e[m],E=T&&T.prototype,I={},P;if(!f||!a(T)||!(_||E.forEach&&!i(function(){new T().entries().next()})))P=w.getConstructor(v,m,y,O),t.enable();else{P=v(function(C,k){g(o(C,M),{type:m,collection:new T}),l(k)||s(k,C[O],{that:C,AS_ENTRIES:y})});var M=P.prototype,x=b(m);c(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(C){var k=C==="add"||C==="set";C in E&&!(_&&C==="clear")&&r(M,C,function(N,W){var j=x(this).collection;if(!k&&_&&!d(N))return C==="get"?void 0:!1;var ee=j[C](N===0?0:N,W);return k?this:ee})}),_||u(M,"size",{configurable:!0,get:function(){return x(this).collection.size}})}return h(P,m,!1,!0),I[m]=P,n({global:!0,forced:!0},I),_||w.setStrong(P,m,y),P},Md}var kd,Dy;function Fd(){if(Dy)return kd;Dy=1;var n=Ni();return kd=function(e,t,i){for(var r in t)i&&i.unsafe&&e[r]?e[r]=t[r]:n(e,r,t[r],i);return e},kd}var Nd,My;function WI(){if(My)return Nd;My=1;var n=Ne(),e=Hs(),t=ve(),i=fe(),r=t("species");return Nd=function(s){var o=n(s);i&&o&&!o[r]&&e(o,r,{configurable:!0,get:function(){return this}})},Nd}var Ad,qy;function ky(){if(qy)return Ad;qy=1;var n=Fi(),e=Hs(),t=Fd(),i=mr(),r=Dd(),s=Jt(),o=Lr(),a=go(),d=mo(),l=WI(),h=fe(),u=zr().fastKey,c=xt(),f=c.set,p=c.getterFor;return Ad={getConstructor:function(g,b,m,v){var w=g(function(E,I){r(E,y),f(E,{type:b,index:n(null),first:null,last:null,size:0}),h||(E.size=0),s(I)||o(I,E[v],{that:E,AS_ENTRIES:m})}),y=w.prototype,_=p(b),O=function(E,I,P){var M=_(E),x=T(E,I),C,k;return x?x.value=P:(M.last=x={index:k=u(I,!0),key:I,value:P,previous:C=M.last,next:null,removed:!1},M.first||(M.first=x),C&&(C.next=x),h?M.size++:E.size++,k!=="F"&&(M.index[k]=x)),E},T=function(E,I){var P=_(E),M=u(I),x;if(M!=="F")return P.index[M];for(x=P.first;x;x=x.next)if(x.key===I)return x};return t(y,{clear:function(){for(var I=this,P=_(I),M=P.first;M;)M.removed=!0,M.previous&&(M.previous=M.previous.next=null),M=M.next;P.first=P.last=null,P.index=n(null),h?P.size=0:I.size=0},delete:function(E){var I=this,P=_(I),M=T(I,E);if(M){var x=M.next,C=M.previous;delete P.index[M.index],M.removed=!0,C&&(C.next=x),x&&(x.previous=C),P.first===M&&(P.first=x),P.last===M&&(P.last=C),h?P.size--:I.size--}return!!M},forEach:function(I){for(var P=_(this),M=i(I,arguments.length>1?arguments[1]:void 0),x;x=x?x.next:P.first;)for(M(x.value,x.key,this);x&&x.removed;)x=x.previous},has:function(I){return!!T(this,I)}}),t(y,m?{get:function(I){var P=T(this,I);return P&&P.value},set:function(I,P){return O(this,I===0?0:I,P)}}:{add:function(I){return O(this,I=I===0?0:I,I)}}),h&&e(y,"size",{configurable:!0,get:function(){return _(this).size}}),w},setStrong:function(g,b,m){var v=b+" Iterator",w=p(b),y=p(v);a(g,b,function(_,O){f(this,{type:v,target:_,state:w(_),kind:O,last:null})},function(){for(var _=y(this),O=_.kind,T=_.last;T&&T.removed;)T=T.previous;return!_.target||!(_.last=T=T?T.next:_.state.first)?(_.target=null,d(void 0,!0)):d(O==="keys"?T.key:O==="values"?T.value:[T.key,T.value],!1)},m?"entries":"values",!m,!0),l(b)}},Ad}var Fy;function VI(){if(Fy)return my;Fy=1;var n=qd(),e=ky();return n("Map",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},e),my}var Ny;function UI(){return Ny||(Ny=1,VI()),vy}var Ay={},Bd,By;function zy(){return By||(By=1,Bd=function(n,e){return e===1?function(t,i){return t[n](i)}:function(t,i,r){return t[n](i,r)}}),Bd}var zd,Ly;function GI(){if(Ly)return zd;Ly=1;var n=Ne(),e=zy(),t=n("Map");return zd={Map:t,set:e("set",2),get:e("get",1),has:e("has",1),remove:e("delete",1),proto:t.prototype},zd}var jy;function KI(){if(jy)return Ay;jy=1;var n=B(),e=G(),t=nt(),i=rt(),r=Lr(),s=GI(),o=ii(),a=U(),d=s.Map,l=s.has,h=s.get,u=s.set,c=e([].push),f=o||a(function(){return d.groupBy("ab",function(p){return p}).get("a").length!==1});return n({target:"Map",stat:!0,forced:o||f},{groupBy:function(g,b){i(g),t(b);var m=new d,v=0;return r(g,function(w){var y=b(w,v++);l(m,y)?c(h(m,y),w):u(m,y,[w])}),m}}),Ay}var $y={},Ld,Hy;function YI(){if(Hy)return Ld;Hy=1;var n=G(),e=si(),t=ze(),i=rt(),r=n("".charAt),s=n("".charCodeAt),o=n("".slice),a=function(d){return function(l,h){var u=t(i(l)),c=e(h),f=u.length,p,g;return c<0||c>=f?d?"":void 0:(p=s(u,c),p<55296||p>56319||c+1===f||(g=s(u,c+1))<56320||g>57343?d?r(u,c):p:d?o(u,c,c+2):(p-55296<<10)+(g-56320)+65536)}};return Ld={codeAt:a(!1),charAt:a(!0)},Ld}var Wy;function jd(){if(Wy)return $y;Wy=1;var n=YI().charAt,e=ze(),t=xt(),i=go(),r=mo(),s="String Iterator",o=t.set,a=t.getterFor(s);return i(String,"String",function(d){o(this,{type:s,string:e(d),index:0})},function(){var l=a(this),h=l.string,u=l.index,c;return u>=h.length?r(void 0,!0):(c=n(h,u),l.index+=c.length,r(c,!1))}),$y}var $d,Vy;function XI(){if(Vy)return $d;Vy=1,li(),UI(),KI(),jd();var n=Z();return $d=n.Map,$d}var Hd,Uy;function ZI(){if(Uy)return Hd;Uy=1;var n=XI();return hi(),Hd=n,Hd}var Wd,Gy;function JI(){return Gy||(Gy=1,Wd=ZI()),Wd}var QI=JI(),Vd=L(QI);class eT{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},me(this.options,this.defaultOptions)}setOptions(e){const t=["useDefaultGroups"];if(e!==void 0){for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&J(t).call(t,i)===-1){const r=e[i];this.add(i,r)}}}clear(){this._groups=new Vd,this._groupNames=[]}get(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this._groups.get(e);if(i===void 0&&t)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){const r=this._groupIndex%this._groupNames.length;++this._groupIndex,i={},i.color=this._groups.get(this._groupNames[r]),this._groups.set(e,i)}else{const r=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,i={},i.color=this._defaultGroups[r],this._groups.set(e,i)}return i}add(e,t){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,t),t}}var Ky={},Yy;function tT(){if(Yy)return Ky;Yy=1;var n=B();return n({target:"Number",stat:!0},{isNaN:function(t){return t!==t}}),Ky}var Ud,Xy;function iT(){if(Xy)return Ud;Xy=1,tT();var n=Z();return Ud=n.Number.isNaN,Ud}var Gd,Zy;function rT(){if(Zy)return Gd;Zy=1;var n=iT();return Gd=n,Gd}var Kd,Jy;function nT(){return Jy||(Jy=1,Kd=rT()),Kd}var sT=nT(),Yd=L(sT),Qy={},Xd,eb;function oT(){if(eb)return Xd;eb=1;var n=ae(),e=n.isFinite;return Xd=Number.isFinite||function(i){return typeof i=="number"&&e(i)},Xd}var tb;function aT(){if(tb)return Qy;tb=1;var n=B(),e=oT();return n({target:"Number",stat:!0},{isFinite:e}),Qy}var Zd,ib;function dT(){if(ib)return Zd;ib=1,aT();var n=Z();return Zd=n.Number.isFinite,Zd}var Jd,rb;function lT(){if(rb)return Jd;rb=1;var n=dT();return Jd=n,Jd}var Qd,nb;function hT(){return nb||(nb=1,Qd=lT()),Qd}var uT=hT(),Lt=L(uT),sb={},ob;function cT(){if(ob)return sb;ob=1;var n=B(),e=ft().some,t=ci(),i=t("some");return n({target:"Array",proto:!0,forced:!i},{some:function(s){return e(this,s,arguments.length>1?arguments[1]:void 0)}}),sb}var el,ab;function fT(){if(ab)return el;ab=1,cT();var n=Oe();return el=n("Array","some"),el}var tl,db;function pT(){if(db)return tl;db=1;var n=ge(),e=fT(),t=Array.prototype;return tl=function(i){var r=i.some;return i===t||n(t,i)&&r===t.some?e:r},tl}var il,lb;function gT(){if(lb)return il;lb=1;var n=pT();return il=n,il}var rl,hb;function vT(){return hb||(hb=1,rl=gT()),rl}var mT=vT(),yT=L(mT),nl={exports:{}},ub={},cb;function bT(){if(cb)return ub;cb=1;var n=B(),e=fe(),t=Be().f;return n({target:"Object",stat:!0,forced:Object.defineProperty!==t,sham:!e},{defineProperty:t}),ub}var fb;function wT(){if(fb)return nl.exports;fb=1,bT();var n=Z(),e=n.Object,t=nl.exports=function(r,s,o){return e.defineProperty(r,s,o)};return e.defineProperty.sham&&(t.sham=!0),nl.exports}var sl,pb;function gb(){if(pb)return sl;pb=1;var n=wT();return sl=n,sl}var ol,vb;function _T(){if(vb)return ol;vb=1;var n=gb();return ol=n,ol}var al,mb;function ET(){if(mb)return al;mb=1;var n=_T();return al=n,al}var dl,yb;function ST(){return yb||(yb=1,dl=ET()),dl}var OT=ST(),IT=L(OT),bb={},wb;function TT(){if(wb)return bb;wb=1;var n=ve(),e=Be().f,t=n("metadata"),i=Function.prototype;return i[t]===void 0&&e(i,t,{value:null}),bb}var _b={},Eb;function PT(){return Eb||(Eb=1,Lf()),_b}var Sb={},Ob;function CT(){return Ob||(Ob=1,Vf()),Sb}var Ib={},Tb;function xT(){if(Tb)return Ib;Tb=1;var n=le();return n("metadata"),Ib}var ll,Pb;function RT(){if(Pb)return ll;Pb=1;var n=jp();return TT(),PT(),CT(),xT(),ll=n,ll}var Cb={},hl,xb;function Rb(){if(xb)return hl;xb=1;var n=Ne(),e=G(),t=n("Symbol"),i=t.keyFor,r=e(t.prototype.valueOf);return hl=t.isRegisteredSymbol||function(o){try{return i(r(o))!==void 0}catch{return!1}},hl}var Db;function DT(){if(Db)return Cb;Db=1;var n=B(),e=Rb();return n({target:"Symbol",stat:!0},{isRegisteredSymbol:e}),Cb}var Mb={},ul,qb;function kb(){if(qb)return ul;qb=1;for(var n=ri(),e=Ne(),t=G(),i=Di(),r=ve(),s=e("Symbol"),o=s.isWellKnownSymbol,a=e("Object","getOwnPropertyNames"),d=t(s.prototype.valueOf),l=n("wks"),h=0,u=a(s),c=u.length;h<c;h++)try{var f=u[h];i(s[f])&&r(f)}catch{}return ul=function(g){if(o&&o(g))return!0;try{for(var b=d(g),m=0,v=a(l),w=v.length;m<w;m++)if(l[v[m]]==b)return!0}catch{}return!1},ul}var Fb;function MT(){if(Fb)return Mb;Fb=1;var n=B(),e=kb();return n({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:e}),Mb}var Nb={},Ab;function qT(){if(Ab)return Nb;Ab=1;var n=le();return n("customMatcher"),Nb}var Bb={},zb;function kT(){if(zb)return Bb;zb=1;var n=le();return n("observable"),Bb}var Lb={},jb;function FT(){if(jb)return Lb;jb=1;var n=B(),e=Rb();return n({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:e}),Lb}var $b={},Hb;function NT(){if(Hb)return $b;Hb=1;var n=B(),e=kb();return n({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:e}),$b}var Wb={},Vb;function AT(){if(Vb)return Wb;Vb=1;var n=le();return n("matcher"),Wb}var Ub={},Gb;function BT(){if(Gb)return Ub;Gb=1;var n=le();return n("metadataKey"),Ub}var Kb={},Yb;function zT(){if(Yb)return Kb;Yb=1;var n=le();return n("patternMatch"),Kb}var Xb={},Zb;function LT(){if(Zb)return Xb;Zb=1;var n=le();return n("replaceAll"),Xb}var cl,Jb;function jT(){if(Jb)return cl;Jb=1;var n=RT();return DT(),MT(),qT(),kT(),FT(),NT(),AT(),BT(),zT(),LT(),cl=n,cl}var fl,Qb;function $T(){return Qb||(Qb=1,fl=jT()),fl}var HT=$T(),jr=L(HT),pl,ew;function WT(){if(ew)return pl;ew=1,li(),jd(),Jf();var n=Sr();return pl=n.f("iterator"),pl}var gl,tw;function VT(){if(tw)return gl;tw=1;var n=WT();return hi(),gl=n,gl}var vl,iw;function UT(){if(iw)return vl;iw=1;var n=VT();return vl=n,vl}var ml,rw;function GT(){if(rw)return ml;rw=1;var n=UT();return ml=n,ml}var yl,nw;function KT(){return nw||(nw=1,yl=GT()),yl}var YT=KT(),XT=L(YT);function er(n){"@babel/helpers - typeof";return er=typeof jr=="function"&&typeof XT=="symbol"?function(e){return typeof e}:function(e){return e&&typeof jr=="function"&&e.constructor===jr&&e!==jr.prototype?"symbol":typeof e},er(n)}var bl,sw;function ZT(){if(sw)return bl;sw=1,fp();var n=Sr();return bl=n.f("toPrimitive"),bl}var wl,ow;function JT(){if(ow)return wl;ow=1;var n=ZT();return wl=n,wl}var _l,aw;function QT(){if(aw)return _l;aw=1;var n=JT();return _l=n,_l}var El,dw;function eP(){if(dw)return El;dw=1;var n=QT();return El=n,El}var Sl,lw;function tP(){return lw||(lw=1,Sl=eP()),Sl}var iP=tP(),rP=L(iP);function nP(n,e){if(er(n)!="object"||!n)return n;var t=n[rP];if(t!==void 0){var i=t.call(n,e);if(er(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function sP(n){var e=nP(n,"string");return er(e)=="symbol"?e:e+""}function ut(n,e,t){return(e=sP(e))in n?IT(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var hw={},Ol,uw;function oP(){if(uw)return Ol;uw=1;var n=ae(),e=U(),t=G(),i=ze(),r=Sv().trim,s=Ta(),o=t("".charAt),a=n.parseFloat,d=n.Symbol,l=d&&d.iterator,h=1/a(s+"-0")!==-1/0||l&&!e(function(){a(Object(l))});return Ol=h?function(c){var f=r(i(c)),p=a(f);return p===0&&o(f,0)==="-"?-0:p}:a,Ol}var cw;function aP(){if(cw)return hw;cw=1;var n=B(),e=oP();return n({global:!0,forced:parseFloat!==e},{parseFloat:e}),hw}var Il,fw;function dP(){if(fw)return Il;fw=1,aP();var n=Z();return Il=n.parseFloat,Il}var Tl,pw;function lP(){if(pw)return Tl;pw=1;var n=dP();return Tl=n,Tl}var Pl,gw;function hP(){return gw||(gw=1,Pl=lP()),Pl}var uP=hP(),vw=L(uP),mw={},yw;function cP(){if(yw)return mw;yw=1;var n=B(),e=U(),t=Ls().f,i=e(function(){return!Object.getOwnPropertyNames(1)});return n({target:"Object",stat:!0,forced:i},{getOwnPropertyNames:t}),mw}var Cl,bw;function fP(){if(bw)return Cl;bw=1,cP();var n=Z(),e=n.Object;return Cl=function(i){return e.getOwnPropertyNames(i)},Cl}var xl,ww;function pP(){if(ww)return xl;ww=1;var n=fP();return xl=n,xl}var Rl,_w;function gP(){return _w||(_w=1,Rl=pP()),Rl}var vP=gP(),mP=L(vP),Dl,Ew;function yP(){if(Ew)return Dl;Ew=1,Af();var n=Z();return Dl=n.Object.getOwnPropertySymbols,Dl}var Ml,Sw;function bP(){if(Sw)return Ml;Sw=1;var n=yP();return Ml=n,Ml}var ql,Ow;function wP(){return Ow||(Ow=1,ql=bP()),ql}var _P=wP(),_t=L(_P),kl={exports:{}},Iw={},Tw;function EP(){if(Tw)return Iw;Tw=1;var n=B(),e=U(),t=Ue(),i=vr().f,r=fe(),s=!r||e(function(){i(1)});return n({target:"Object",stat:!0,forced:s,sham:!r},{getOwnPropertyDescriptor:function(a,d){return i(t(a),d)}}),Iw}var Pw;function SP(){if(Pw)return kl.exports;Pw=1,EP();var n=Z(),e=n.Object,t=kl.exports=function(r,s){return e.getOwnPropertyDescriptor(r,s)};return e.getOwnPropertyDescriptor.sham&&(t.sham=!0),kl.exports}var Fl,Cw;function OP(){if(Cw)return Fl;Cw=1;var n=SP();return Fl=n,Fl}var Nl,xw;function IP(){return xw||(xw=1,Nl=OP()),Nl}var TP=IP(),Et=L(TP),Rw={},Dw;function PP(){if(Dw)return Rw;Dw=1;var n=B(),e=fe(),t=cS(),i=Ue(),r=vr(),s=wr();return n({target:"Object",stat:!0,sham:!e},{getOwnPropertyDescriptors:function(a){for(var d=i(a),l=r.f,h=t(d),u={},c=0,f,p;h.length>c;)p=l(d,f=h[c++]),p!==void 0&&s(u,f,p);return u}}),Rw}var Al,Mw;function CP(){if(Mw)return Al;Mw=1,PP();var n=Z();return Al=n.Object.getOwnPropertyDescriptors,Al}var Bl,qw;function xP(){if(qw)return Bl;qw=1;var n=CP();return Bl=n,Bl}var zl,kw;function RP(){return kw||(kw=1,zl=xP()),zl}var DP=RP(),St=L(DP),Ll={exports:{}},Fw={},Nw;function MP(){if(Nw)return Fw;Nw=1;var n=B(),e=fe(),t=ks().f;return n({target:"Object",stat:!0,forced:Object.defineProperties!==t,sham:!e},{defineProperties:t}),Fw}var Aw;function qP(){if(Aw)return Ll.exports;Aw=1,MP();var n=Z(),e=n.Object,t=Ll.exports=function(r,s){return e.defineProperties(r,s)};return e.defineProperties.sham&&(t.sham=!0),Ll.exports}var jl,Bw;function kP(){if(Bw)return jl;Bw=1;var n=qP();return jl=n,jl}var $l,zw;function FP(){return zw||(zw=1,$l=kP()),$l}var NP=FP(),$r=L(NP),Hl,Lw;function AP(){return Lw||(Lw=1,Hl=gb()),Hl}var BP=AP(),Hr=L(BP);function Wl(n,e){const t=["node","edge","label"];let i=!0;const r=yt(e,"chosen");if(typeof r=="boolean")i=r;else if(typeof r=="object"){if(J(t).call(t,n)===-1)throw new Error("choosify: subOption '"+n+"' should be one of '"+t.join("', '")+"'");const s=yt(e,["chosen",n]);(typeof s=="boolean"||typeof s=="function")&&(i=s)}return i}function Vl(n,e,t){if(n.width<=0||n.height<=0)return!1;if(t!==void 0){const s={x:e.x-t.x,y:e.y-t.y};if(t.angle!==0){const o=-t.angle;e={x:Math.cos(o)*s.x-Math.sin(o)*s.y,y:Math.sin(o)*s.x+Math.cos(o)*s.y}}else e=s}const i=n.x+n.width,r=n.y+n.width;return n.left<e.x&&i>e.x&&n.top<e.y&&r>e.y}function Wr(n){return typeof n=="string"&&n!==""}function jw(n,e,t,i){let r=i.x,s=i.y;if(typeof i.distanceToBorder=="function"){const o=i.distanceToBorder(n,e),a=Math.sin(e)*o,d=Math.cos(e)*o;d===o?(r+=o,s=i.y):a===o?(r=i.x,s-=o):(r+=d,s-=a)}else i.shape.width>i.shape.height?(r=i.x+i.shape.width*.5,s=i.y-t):(r=i.x+t,s=i.y-i.shape.height*.5);return{x:r,y:s}}var Ul,$w;function zP(){if($w)return Ul;$w=1,li();var n=Oe();return Ul=n("Array","values"),Ul}var Gl,Hw;function LP(){if(Hw)return Gl;Hw=1;var n=zP();return Gl=n,Gl}var Kl,Ww;function jP(){if(Ww)return Kl;Ww=1,hi();var n=ai(),e=Se(),t=ge(),i=LP(),r=Array.prototype,s={DOMTokenList:!0,NodeList:!0};return Kl=function(o){var a=o.values;return o===r||t(r,o)&&a===r.values||e(s,n(o))?i:a},Kl}var Yl,Vw;function $P(){return Vw||(Vw=1,Yl=jP()),Yl}var HP=$P(),Uw=L(HP);class WP{constructor(e){this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});let r=t;(t===void 0||t==="")&&(r=" ");const s=this.measureText(r,i),o=me({},Uw(s));o.text=t,o.width=s.width,o.mod=i,(t===void 0||t==="")&&(o.width=0),this.lines[e].blocks.push(o),this.lines[e].width+=o.width}curWidth(){const e=this.lines[this.current];return e===void 0?0:e.width}append(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t)}newLine(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t),this.current++}determineLineHeights(){for(let e=0;e<this.lines.length;e++){const t=this.lines[e];let i=0;if(t.blocks!==void 0)for(let r=0;r<t.blocks.length;r++){const s=t.blocks[r];i<s.height&&(i=s.height)}t.height=i}}determineLabelSize(){let e=0,t=0;for(let i=0;i<this.lines.length;i++){const r=this.lines[i];r.width>e&&(e=r.width),t+=r.height}this.width=e,this.height=t}removeEmptyBlocks(){const e=[];for(let t=0;t<this.lines.length;t++){const i=this.lines[t];if(i.blocks.length===0||t===this.lines.length-1&&i.width===0)continue;const r={};me(r,i),r.blocks=[];let s;const o=[];for(let a=0;a<i.blocks.length;a++){const d=i.blocks[a];d.width!==0?o.push(d):s===void 0&&(s=d)}o.length===0&&s!==void 0&&o.push(s),r.blocks=o,e.push(r)}return e}finalize(){this.determineLineHeights(),this.determineLabelSize();const e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}}const VP={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/};class Gw{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,t){return!this.mono&&!this[e]&&this.match(t)?(this.setTag(e),!0):!1}match(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const[i,r]=this.prepareRegExp(e),s=i.test(this.text.substr(this.position,r));return s&&t&&(this.position+=r-1),s}parseEndTag(e,t,i){let r=this.mod()===e;return e==="mono"?r=r&&this.mono:r=r&&!this.mono,r&&this.match(t)?(i!==void 0?(this.position===this.text.length-1||this.match(i,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}replace(e,t){return this.match(e)?(this.add(t),this.position+=length-1,!0):!1}prepareRegExp(e){let t,i;if(e instanceof RegExp)i=e,t=1;else{const r=VP[e];r!==void 0?i=r:i=new RegExp(e),t=e.length}return[i,t]}}class UP{constructor(e,t,i,r){this.ctx=e,this.parent=t,this.selected=i,this.hover=r;const s=(o,a)=>{if(o===void 0)return 0;const d=this.parent.getFormattingValues(e,i,r,a);let l=0;return o!==""&&(l=this.ctx.measureText(o).width),{width:l,values:d}};this.lines=new WP(s)}process(e){if(!Wr(e))return this.lines.finalize();const t=this.parent.fontOptions;e=e.replace(/\r\n/g,`
`),e=e.replace(/\r/g,`
`);const i=String(e).split(`
`),r=i.length;if(t.multi)for(let s=0;s<r;s++){const o=this.splitBlocks(i[s],t.multi);if(o!==void 0){if(o.length===0){this.lines.newLine("");continue}if(t.maxWdt>0)for(let a=0;a<o.length;a++){const d=o[a].mod,l=o[a].text;this.splitStringIntoLines(l,d,!0)}else for(let a=0;a<o.length;a++){const d=o[a].mod,l=o[a].text;this.lines.append(l,d)}this.lines.newLine()}}else if(t.maxWdt>0)for(let s=0;s<r;s++)this.splitStringIntoLines(i[s]);else for(let s=0;s<r;s++)this.lines.newLine(i[s]);return this.lines.finalize()}decodeMarkupSystem(e){let t="none";return e==="markdown"||e==="md"?t="markdown":(e===!0||e==="html")&&(t="html"),t}splitHtmlBlocks(e){const t=new Gw(e),i=r=>/&/.test(r)?(t.replace(t.text,"&lt;","<")||t.replace(t.text,"&amp;","&")||t.add("&"),!0):!1;for(;t.position<t.text.length;){const r=t.text.charAt(t.position);t.parseWS(r)||/</.test(r)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||i(r)||t.add(r),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){const t=new Gw(e);let i=!0;const r=s=>/\\/.test(s)?(t.position<this.text.length+1&&(t.position++,s=this.text.charAt(t.position),/ \t/.test(s)?t.spacing=!0:(t.add(s),i=!1)),!0):!1;for(;t.position<t.text.length;){const s=t.text.charAt(t.position);t.parseWS(s)||r(s)||(i||t.spacing)&&(t.parseStartTag("bold","*")||t.parseStartTag("ital","_")||t.parseStartTag("mono","`"))||t.parseEndTag("bold","*","afterBold")||t.parseEndTag("ital","_","afterItal")||t.parseEndTag("mono","`","afterMono")||(t.add(s),i=!1),t.position++}return t.emitBlock(),t.blocks}splitBlocks(e,t){const i=this.decodeMarkupSystem(t);if(i==="none")return[{text:e,mod:"normal"}];if(i==="markdown")return this.splitMarkdownBlocks(e);if(i==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){const t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}getLongestFit(e){let t="",i=0;for(;i<e.length;){const s=t+(t===""?"":" ")+e[i];if(this.overMaxWidth(s))break;t=s,i++}return i}getLongestFitWord(e){let t=0;for(;t<e.length&&!this.overMaxWidth(Qe(e).call(e,0,t));)t++;return t}splitStringIntoLines(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let r=e.split("\r");for(;r.length>0;){let s=this.getLongestFit(r);if(s===0){const o=r[0],a=this.getLongestFitWord(o);this.lines.newLine(Qe(o).call(o,0,a),t),r[0]=Qe(o).call(o,a)}else{let o=s;r[s-1]===" "?s--:r[o]===" "&&o++;const a=Qe(r).call(r,0,s).join("");s==r.length&&i?this.lines.append(a,t):this.lines.newLine(a,t),r=Qe(r).call(r,o)}}}}const tr=["bold","ital","boldital","mono"];class Oi{constructor(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=i}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),Wr(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"){const t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){if(H(tr,t=>{this.fontOptions[t]={}}),Oi.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}H(e,(t,i)=>{t!=null&&typeof t!="object"&&(this.fontOptions[i]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;const i=t.split(" ");return e.size=+i[0].replace("px",""),e.face=i[1],e.color=i[2],!0}constrain(e){const t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=yt(e,"widthConstraint");if(typeof i=="number")t.maxWdt=Number(i),t.minWdt=Number(i);else if(typeof i=="object"){const s=yt(e,["widthConstraint","maximum"]);typeof s=="number"&&(t.maxWdt=Number(s));const o=yt(e,["widthConstraint","minimum"]);typeof o=="number"&&(t.minWdt=Number(o))}const r=yt(e,"heightConstraint");if(typeof r=="number")t.minHgt=Number(r);else if(typeof r=="object"){const s=yt(e,["heightConstraint","minimum"]);typeof s=="number"&&(t.minHgt=Number(s));const o=yt(e,["heightConstraint","valign"]);typeof o=="string"&&(o==="top"||o==="bottom")&&(t.valign=o)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),te(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=Wl("label",t)}adjustSizes(e){const t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);const i=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}addFontOptionsToPile(e,t){for(let i=0;i<t.length;++i)this.addFontToPile(e,t[i])}addFontToPile(e,t){if(t===void 0||t.font===void 0||t.font===null)return;const i=t.font;e.push(i)}getBasicOptions(e){const t={};for(let i=0;i<e.length;++i){let r=e[i];const s={};Oi.parseFontString(s,r)&&(r=s),H(r,(o,a)=>{o!==void 0&&(Object.prototype.hasOwnProperty.call(t,a)||(J(tr).call(tr,a)!==-1?t[a]={}:t[a]=o))})}return t}getFontOption(e,t,i){let r;for(let s=0;s<e.length;++s){const o=e[s];if(Object.prototype.hasOwnProperty.call(o,t)){if(r=o[t],r==null)continue;const a={};if(Oi.parseFontString(a,r)&&(r=a),Object.prototype.hasOwnProperty.call(r,i))return r[i]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,i))return this.fontOptions[i];throw new Error("Did not find value for multi-font for property: '"+i+"'")}getFontOptions(e,t){const i={},r=["color","size","face","mod","vadjust"];for(let s=0;s<r.length;++s){const o=r[s];i[o]=this.getFontOption(e,t,o)}return i}propagateFonts(e){const t=[];this.addFontOptionsToPile(t,e),this.fontOptions=this.getBasicOptions(t);for(let i=0;i<tr.length;++i){const r=tr[i],s=this.fontOptions[r],o=this.getFontOptions(t,r);H(o,(a,d)=>{s[d]=a}),s.size=Number(s.size),s.vadjust=Number(s.vadjust)}}draw(e,t,i,r,s){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label===void 0)return;let a=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&a<this.elementOptions.scaling.label.drawThreshold-1||(a>=this.elementOptions.scaling.label.maxVisible&&(a=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,r,s,t,i,o),this._drawBackground(e),this._drawText(e,t,this.size.yLine,o,a))}_drawBackground(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;const t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}_drawText(e,t,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",s=arguments.length>4?arguments[4]:void 0;[t,i]=this._setAlignment(e,t,i,r),e.textAlign="left",t=t-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(i-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(i+=(this.size.height-this.size.labelHeight)/2));for(let o=0;o<this.lineCount;o++){const a=this.lines[o];if(a&&a.blocks){let d=0;this.isEdgeLabel||this.fontOptions.align==="center"?d+=(this.size.width-a.width)/2:this.fontOptions.align==="right"&&(d+=this.size.width-a.width);for(let l=0;l<a.blocks.length;l++){const h=a.blocks[l];e.font=h.font;const[u,c]=this._getColor(h.color,s,h.strokeColor);h.strokeWidth>0&&(e.lineWidth=h.strokeWidth,e.strokeStyle=c,e.lineJoin="round"),e.fillStyle=u,h.strokeWidth>0&&e.strokeText(h.text,t+d,i+h.vadjust),e.fillText(h.text,t+d,i+h.vadjust),d+=h.width}i+=a.height}}}_setAlignment(e,t,i,r){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){t=0,i=0;const s=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",i-=2*s):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",i+=2*s):e.textBaseline="middle"}else e.textBaseline=r;return[t,i]}_getColor(e,t,i){let r=e||"#000000",s=i||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){const o=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));r=$e(r,o),s=$e(s,o)}return[r,s]}getTextSize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,t,i),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let t=this.size.left,i=this.size.top-.5*2;if(this.isEdgeLabel){const s=-this.size.width*.5;switch(this.fontOptions.align){case"middle":t=s,i=-this.size.height*.5;break;case"top":t=s,i=-(this.size.height+2);break;case"bottom":t=s,i=2;break}}return{left:t,top:i,width:this.size.width,height:this.size.height}}calculateLabelSize(e,t,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,t,i),this.size.left=r-this.size.width*.5,this.size.top=s-this.size.height*.5,this.size.yLine=s+(1-this.lineCount)*.5*this.fontOptions.size,o==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(e,t,i,r){const s=function(d,l,h){return l==="normal"?h==="mod"?"":d[h]:d[l][h]!==void 0?d[l][h]:d[h]},o={color:s(this.fontOptions,r,"color"),size:s(this.fontOptions,r,"size"),face:s(this.fontOptions,r,"face"),mod:s(this.fontOptions,r,"mod"),vadjust:s(this.fontOptions,r,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||i)&&(r==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?o.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(o,this.elementOptions.id,t,i));let a="";return o.mod!==void 0&&o.mod!==""&&(a+=o.mod+" "),a+=o.size+"px "+o.face,e.font=a.replace(/"/g,""),o.font=e.font,o.height=o.size,o}differentState(e,t){return e!==this.selectedState||t!==this.hoverState}_processLabelText(e,t,i,r){return new UP(e,this,t,i).process(r)}_processLabel(e,t,i){if(this.labelDirty===!1&&!this.differentState(t,i))return;const r=this._processLabelText(e,t,i,this.elementOptions.label);this.fontOptions.minWdt>0&&r.width<this.fontOptions.minWdt&&(r.width=this.fontOptions.minWdt),this.size.labelHeight=r.height,this.fontOptions.minHgt>0&&r.height<this.fontOptions.minHgt&&(r.height=this.fontOptions.minHgt),this.lines=r.lines,this.lineCount=r.lines.length,this.size.width=r.width,this.size.height=r.height,this.selectedState=t,this.hoverState=i,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)}}class jt{constructor(e,t,i){this.body=t,this.labelModule=i,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,t){const i=this.options.borderWidth;return e&&this.resize(e),Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+i}enableShadow(e,t){t.shadow&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}enableBorderDashes(e,t){if(t.borderDashes!==!1)if(e.setLineDash!==void 0){let i=t.borderDashes;i===!0&&(i=[5,15]),e.setLineDash(i)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1}disableBorderDashes(e,t){t.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,t.borderDashes=!1))}needsRefresh(e,t){return this.refreshNeeded===!0?(this.refreshNeeded=!1,!0):this.width===void 0||this.labelModule.differentState(e,t)}initContextForDraw(e,t){const i=t.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,i),e.strokeStyle=t.borderColor,e.fillStyle=t.color}performStroke(e,t){const i=t.borderWidth/this.body.view.scale;e.save(),i>0&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}performFill(e,t){e.save(),e.fillStyle=t.color,this.enableShadow(e,t),Bi(e).call(e),this.disableShadow(e,t),e.restore(),this.performStroke(e,t)}_addBoundingBoxMargin(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}_updateBoundingBox(e,t,i,r,s){i!==void 0&&this.resize(i,r,s),this.left=e-this.width/2,this.top=t-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,t,i,r,s){this._updateBoundingBox(e,t,i,r,s)}getDimensionsFromLabel(e,t,i){this.textSize=this.labelModule.getTextSize(e,t,i);let r=this.textSize.width,s=this.textSize.height;const o=14;return r===0&&(r=o,s=o),{width:r,height:s}}}let GP=class extends jt{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,i)){const r=this.getDimensionsFromLabel(e,t,i);this.width=r.width+this.margin.right+this.margin.left,this.height=r.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(e,t,i,r,s,o){this.resize(e,r,s),this.left=t-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,o),kc(e,this.left,this.top,this.width,this.height,o.borderRadius),this.performFill(e,o),this.updateBoundingBox(t,i,e,r,s),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,r,s)}updateBoundingBox(e,t,i,r,s){this._updateBoundingBox(e,t,i,r,s);const o=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(o)}distanceToBorder(e,t){e&&this.resize(e);const i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+i}};class Xl extends jt{constructor(e,t,i){super(e,t,i),this.labelOffset=0,this.selected=!1}setOptions(e,t,i){this.options=e,t===void 0&&i===void 0||this.setImages(t,i)}setImages(e,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=t)}switchImages(e){const t=e&&!this.selected||!e&&this.selected;if(this.selected=e,this.imageObjAlt!==void 0&&t){const i=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=i}}_getImagePadding(){const e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){const t=this.options.imagePadding;typeof t=="object"?(e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left):(e.top=t,e.right=t,e.bottom=t,e.left=t)}return e}_resizeImage(){let e,t;if(this.options.shapeProperties.useImageSize===!1){let i=1,r=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?i=this.imageObj.width/this.imageObj.height:r=this.imageObj.height/this.imageObj.width),e=this.options.size*2*i,t=this.options.size*2*r}else{const i=this._getImagePadding();e=this.imageObj.width+i.left+i.right,t=this.imageObj.height+i.top+i.bottom}this.width=e,this.height=t,this.radius=.5*this.width}_drawRawCircle(e,t,i,r){this.initContextForDraw(e,r),ms(e,t,i,r.size),this.performFill(e,r)}_drawImageAtPosition(e,t){if(this.imageObj.width!=0){e.globalAlpha=t.opacity!==void 0?t.opacity:1,this.enableShadow(e,t);let i=1;this.options.shapeProperties.interpolation===!0&&(i=this.imageObj.width/this.width/this.body.view.scale);const r=this._getImagePadding(),s=this.left+r.left,o=this.top+r.top,a=this.width-r.left-r.right,d=this.height-r.top-r.bottom;this.imageObj.drawImageAtPosition(e,i,s,o,a,d),this.disableShadow(e,t)}}_drawImageLabel(e,t,i,r,s){let o=0;if(this.height!==void 0){o=this.height*.5;const d=this.labelModule.getTextSize(e,r,s);d.lineCount>=1&&(o+=d.height/2)}const a=i+o;this.options.label&&(this.labelOffset=o),this.labelModule.draw(e,t,a,r,s,"hanging")}}let KP=class extends Xl{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,i)){const r=this.getDimensionsFromLabel(e,t,i),s=Math.max(r.width+this.margin.right+this.margin.left,r.height+this.margin.top+this.margin.bottom);this.options.size=s/2,this.width=s,this.height=s,this.radius=this.width/2}}draw(e,t,i,r,s,o){this.resize(e,r,s),this.left=t-this.width/2,this.top=i-this.height/2,this._drawRawCircle(e,t,i,o),this.updateBoundingBox(t,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,i,r,s)}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size}distanceToBorder(e){return e&&this.resize(e),this.width*.5}};class YP extends Xl{constructor(e,t,i,r,s){super(e,t,i),this.setImages(r,s)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=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){const s=this.options.size*2;this.width=s,this.height=s,this.radius=.5*this.width;return}this.needsRefresh(t,i)&&this._resizeImage()}draw(e,t,i,r,s,o){this.switchImages(r),this.resize();let a=t,d=i;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=i,a+=this.width/2,d+=this.height/2):(this.left=t-this.width/2,this.top=i-this.height/2),this._drawRawCircle(e,a,d,o),e.save(),e.clip(),this._drawImageAtPosition(e,o),e.restore(),this._drawImageLabel(e,a,d,r,s),this.updateBoundingBox(t,i)}updateBoundingBox(e,t){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=t,this.boundingBox.left=e,this.boundingBox.right=e+this.options.size*2,this.boundingBox.bottom=t+this.options.size*2):(this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+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}}class Ot extends jt{constructor(e,t,i){super(e,t,i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,i)){var s,o;this.labelModule.getTextSize(e,t,i);const a=2*r.size;this.width=(s=this.customSizeWidth)!==null&&s!==void 0?s:a,this.height=(o=this.customSizeHeight)!==null&&o!==void 0?o:a,this.radius=.5*this.width}}_drawShape(e,t,i,r,s,o,a,d){return this.resize(e,o,a,d),this.left=r-this.width/2,this.top=s-this.height/2,this.initContextForDraw(e,d),IE(t)(e,r,s,d.size),this.performFill(e,d),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(o?"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,r,s)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(e,o,a,r,s,"hanging");const l=s+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,r,l,o,a,"hanging")}this.updateBoundingBox(r,s)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+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 Kw(n,e){var t=ue(n);if(_t){var i=_t(n);e&&(i=Me(i).call(i,function(r){return Et(n,r).enumerable})),t.push.apply(t,i)}return t}function XP(n){for(var e=1;e<arguments.length;e++){var t,i,r=arguments[e]!=null?arguments[e]:{};e%2?Q(t=Kw(Object(r),!0)).call(t,function(s){ut(n,s,r[s])}):St?$r(n,St(r)):Q(i=Kw(Object(r))).call(i,function(s){Hr(n,s,Et(r,s))})}return n}class ZP extends Ot{constructor(e,t,i,r){super(e,t,i,r),this.ctxRenderer=r}draw(e,t,i,r,s,o){this.resize(e,r,s,o),this.left=t-this.width/2,this.top=i-this.height/2,e.save();const a=this.ctxRenderer({ctx:e,id:this.options.id,x:t,y:i,state:{selected:r,hover:s},style:XP({},o),label:this.options.label});if(a.drawNode!=null&&a.drawNode(),e.restore(),a.drawExternalLabel){const d=a.drawExternalLabel;a.drawExternalLabel=()=>{e.save(),d(),e.restore()}}return a.nodeDimensions&&(this.customSizeWidth=a.nodeDimensions.width,this.customSizeHeight=a.nodeDimensions.height),a}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class JP extends jt{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){if(this.needsRefresh(t,i)){const s=this.getDimensionsFromLabel(e,t,i).width+this.margin.right+this.margin.left;this.width=s,this.height=s,this.radius=this.width/2}}draw(e,t,i,r,s,o){this.resize(e,r,s),this.left=t-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,o),Fc(e,t-this.width/2,i-this.height/2,this.width,this.height),this.performFill(e,o),this.updateBoundingBox(t,i,e,r,s),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,r,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let QP=class extends Ot{constructor(e,t,i){super(e,t,i)}draw(e,t,i,r,s,o){return this._drawShape(e,"diamond",4,t,i,r,s,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class eC extends Ot{constructor(e,t,i){super(e,t,i)}draw(e,t,i,r,s,o){return this._drawShape(e,"circle",2,t,i,r,s,o)}distanceToBorder(e){return e&&this.resize(e),this.options.size}}class Yw extends jt{constructor(e,t,i){super(e,t,i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,i)){const r=this.getDimensionsFromLabel(e,t,i);this.height=r.height*2,this.width=r.width+r.height,this.radius=.5*this.width}}draw(e,t,i,r,s,o){this.resize(e,r,s),this.left=t-this.width*.5,this.top=i-this.height*.5,this.initContextForDraw(e,o),ys(e,this.left,this.top,this.width,this.height),this.performFill(e,o),this.updateBoundingBox(t,i,e,r,s),this.labelModule.draw(e,t,i,r,s)}distanceToBorder(e,t){e&&this.resize(e);const i=this.width*.5,r=this.height*.5,s=Math.sin(t)*i,o=Math.cos(t)*r;return i*r/Math.sqrt(s*s+o*o)}}class tC extends jt{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){this.needsRefresh(t,i)&&(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,t,i,r,s,o){return this.resize(e,r,s),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=i-this.height/2,this._icon(e,t,i,r,s,o),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,i+this.height/2+5,r),this.updateBoundingBox(t,i)}}}updateBoundingBox(e,t){this.boundingBox.top=t-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=t+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,t,i,r,s,o){const a=Number(this.options.icon.size);this.options.icon.code!==void 0?(e.font=[this.options.icon.weight!=null?this.options.icon.weight:r?"bold":"",(this.options.icon.weight!=null&&r?5:0)+a+"px",this.options.icon.face].join(" "),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,o),e.fillText(this.options.icon.code,t,i),this.disableShadow(e,o)):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,t){return this._distanceToBorder(e,t)}}let iC=class extends Xl{constructor(e,t,i,r,s){super(e,t,i),this.setImages(r,s)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=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){const s=this.options.size*2;this.width=s,this.height=s;return}this.needsRefresh(t,i)&&this._resizeImage()}draw(e,t,i,r,s,o){e.save(),this.switchImages(r),this.resize();let a=t,d=i;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=i,a+=this.width/2,d+=this.height/2):(this.left=t-this.width/2,this.top=i-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){const l=this.options.borderWidth,h=this.options.borderWidthSelected||2*this.options.borderWidth,u=(r?h:l)/this.body.view.scale;e.lineWidth=Math.min(this.width,u),e.beginPath();let c=r?this.options.color.highlight.border:s?this.options.color.hover.border:this.options.color.border,f=r?this.options.color.highlight.background:s?this.options.color.hover.background:this.options.color.background;o.opacity!==void 0&&(c=$e(c,o.opacity),f=$e(f,o.opacity)),e.strokeStyle=c,e.fillStyle=f,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),Bi(e).call(e),this.performStroke(e,o),e.closePath()}this._drawImageAtPosition(e,o),this._drawImageLabel(e,a,d,r,s),this.updateBoundingBox(t,i),e.restore()}updateBoundingBox(e,t){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=e,this.top=t):(this.left=e-this.width/2,this.top=t-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,t){return this._distanceToBorder(e,t)}};class rC extends Ot{constructor(e,t,i){super(e,t,i)}draw(e,t,i,r,s,o){return this._drawShape(e,"square",2,t,i,r,s,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class nC extends Ot{constructor(e,t,i){super(e,t,i)}draw(e,t,i,r,s,o){return this._drawShape(e,"hexagon",4,t,i,r,s,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class sC extends Ot{constructor(e,t,i){super(e,t,i)}draw(e,t,i,r,s,o){return this._drawShape(e,"star",4,t,i,r,s,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class oC extends jt{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){this.needsRefresh(t,i)&&(this.textSize=this.labelModule.getTextSize(e,t,i),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,t,i,r,s,o){this.resize(e,r,s),this.left=t-this.width/2,this.top=i-this.height/2,this.enableShadow(e,o),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,r,s),this.disableShadow(e,o),this.updateBoundingBox(t,i,e,r,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let aC=class extends Ot{constructor(e,t,i){super(e,t,i)}draw(e,t,i,r,s,o){return this._drawShape(e,"triangle",3,t,i,r,s,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class dC extends Ot{constructor(e,t,i){super(e,t,i)}draw(e,t,i,r,s,o){return this._drawShape(e,"triangleDown",3,t,i,r,s,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}function Xw(n,e){var t=ue(n);if(_t){var i=_t(n);e&&(i=Me(i).call(i,function(r){return Et(n,r).enumerable})),t.push.apply(t,i)}return t}function Zw(n){for(var e=1;e<arguments.length;e++){var t,i,r=arguments[e]!=null?arguments[e]:{};e%2?Q(t=Xw(Object(r),!0)).call(t,function(s){ut(n,s,r[s])}):St?$r(n,St(r)):Q(i=Xw(Object(r))).call(i,function(s){Hr(n,s,Et(r,s))})}return n}class de{constructor(e,t,i,r,s,o){this.options=mt(s),this.globalOptions=s,this.defaultOptions=o,this.body=t,this.edges=[],this.id=void 0,this.imagelist=i,this.grouplist=r,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 Oi(this.body,this.options,!1),this.setOptions(e)}attachEdge(e){var t;J(t=this.edges).call(t,e)===-1&&this.edges.push(e)}detachEdge(e){var t;const i=J(t=this.edges).call(t,e);if(i!=-1){var r;ot(r=this.edges).call(r,i,1)}}setOptions(e){const t=this.options.shape;if(!e)return;if(typeof e.color<"u"&&(this._localColor=e.color),e.id!==void 0&&(this.id=e.id),this.id===void 0)throw new Error("Node must have an id");de.checkMass(e,this.id),e.x!==void 0&&(e.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=Ge(e.x),this.predefinedPosition=!0)),e.y!==void 0&&(e.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=Ge(e.y),this.predefinedPosition=!0)),e.size!==void 0&&(this.baseSize=e.size),e.value!==void 0&&(e.value=vw(e.value)),de.parseOptions(this.options,e,!0,this.globalOptions,this.grouplist);const i=[e,this.options,this.defaultOptions];return this.chooser=Wl("node",i),this._load_images(),this.updateLabelModule(e),e.opacity!==void 0&&de.checkOpacity(e.opacity)&&(this.options.opacity=e.opacity),this.updateShape(t),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,t,i){var r;if(i===void 0)return;const s=e.group;if(t!==void 0&&t.group!==void 0&&s!==t.group)throw new Error("updateGroupOptions: group values in options don't match.");if(!(typeof s=="number"||typeof s=="string"&&s!=""))return;const a=i.get(s);a.opacity!==void 0&&t.opacity===void 0&&(de.checkOpacity(a.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+a.opacity),a.opacity=void 0));const d=Me(r=mP(t)).call(r,l=>t[l]!=null);d.push("font"),Nr(d,e,a),e.color=pd(e.color)}static parseOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=arguments.length>4?arguments[4]:void 0;if(Nr(["color","fixed","shadow"],e,t,i),de.checkMass(t),e.opacity!==void 0&&(de.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),t.opacity!==void 0&&(de.checkOpacity(t.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+t.opacity),t.opacity=void 0)),t.shapeProperties&&!de.checkCoordinateOrigin(t.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+t.shapeProperties.coordinateOrigin),He(e,t,"shadow",r),t.color!==void 0&&t.color!==null){const a=pd(t.color);Zm(e.color,a)}else i===!0&&t.color===null&&(e.color=mt(r.color));t.fixed!==void 0&&t.fixed!==null&&(typeof t.fixed=="boolean"?(e.fixed.x=t.fixed,e.fixed.y=t.fixed):(t.fixed.x!==void 0&&typeof t.fixed.x=="boolean"&&(e.fixed.x=t.fixed.x),t.fixed.y!==void 0&&typeof t.fixed.y=="boolean"&&(e.fixed.y=t.fixed.y))),i===!0&&t.font===null&&(e.font=mt(r.font)),de.updateGroupOptions(e,t,s),t.scaling!==void 0&&He(e.scaling,t.scaling,"label",r.scaling)}getFormattingValues(){const 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){const t=this.options.opacity;e.borderColor=$e(e.borderColor,t),e.color=$e(e.color,t),e.shadowColor=$e(e.shadowColor,t)}return e}updateLabelModule(e){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),de.updateGroupOptions(this.options,Zw(Zw({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);const t=this.grouplist.get(this.options.group,!1),i=[e,this.options,t,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,i),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 GP(this.options,this.body,this.labelModule);break;case"circle":this.shape=new KP(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new YP(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new ZP(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new JP(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new QP(this.options,this.body,this.labelModule);break;case"dot":this.shape=new eC(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new Yw(this.options,this.body,this.labelModule);break;case"icon":this.shape=new tC(this.options,this.body,this.labelModule);break;case"image":this.shape=new iC(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new rC(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new nC(this.options,this.body,this.labelModule);break;case"star":this.shape=new sC(this.options,this.body,this.labelModule);break;case"text":this.shape=new oC(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new aC(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new dC(this.options,this.body,this.labelModule);break;default:this.shape=new Yw(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,t){return this.shape.distanceToBorder(e,t)}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,t,i){if(this.options.value!==void 0){const r=this.options.scaling.customScalingFunction(e,t,i,this.options.value),s=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const o=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+r*o}this.options.size=this.options.scaling.min+r*s}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(e){const t=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,t)||{}}updateBoundingBox(e){this.shape.updateBoundingBox(this.x,this.y,e)}resize(e){const t=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,t)}getItemsOnPoint(e){const t=[];return this.labelModule.visible()&&Vl(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),Vl(this.shape.boundingBox,e)&&t.push({nodeId:this.id}),t}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,t){if(e.mass!==void 0&&e.mass<=0){let i="";t!==void 0&&(i=" in node id: "+t),console.error("%cNegative or zero mass disallowed"+i+", setting mass to 1.",iy),e.mass=1}}}class lC{constructor(e,t,i,r){var s;if(this.body=e,this.images=t,this.groups=i,this.layoutEngine=r,this.body.functions.createNode=D(s=this.create).call(s,this),this.nodesListeners={add:(o,a)=>{this.add(a.items)},update:(o,a)=>{this.update(a.items,a.data,a.oldData)},remove:(o,a)=>{this.remove(a.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(o,a,d,l){if(a===o)return .5;{const h=1/(a-o);return Math.max(0,(l-o)*h)}}},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=mt(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,t;this.body.emitter.on("refreshNodes",D(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",D(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",()=>{H(this.nodesListeners,(i,r)=>{this.body.data.nodes&&this.body.data.nodes.off(r,i)}),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(de.parseOptions(this.options,e),e.opacity!==void 0&&(Yd(e.opacity)||!Lt(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(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(typeof e.font<"u"||typeof e.widthConstraint<"u"||typeof e.heightConstraint<"u")for(const t of ue(this.body.nodes))this.body.nodes[t].updateLabelModule(),this.body.nodes[t].needsRefresh();if(e.size!==void 0)for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.data.nodes;if((0,Zt.isDataViewLike)("id",e))this.body.data.nodes=e;else if(he(e))this.body.data.nodes=new Zt.DataSet,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new Zt.DataSet;else throw new TypeError("Array or DataSet expected");if(i&&H(this.nodesListeners,function(r,s){i.off(s,r)}),this.body.nodes={},this.body.data.nodes){const r=this;H(this.nodesListeners,function(o,a){r.body.data.nodes.on(a,o)});const s=this.body.data.nodes.getIds();this.add(s,!0)}t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i;const r=[];for(let s=0;s<e.length;s++){i=e[s];const o=this.body.data.nodes.get(i),a=this.create(o);r.push(a),this.body.nodes[i]=a}this.layoutEngine.positionInitially(r),t===!1&&this.body.emitter.emit("_dataChanged")}update(e,t,i){const r=this.body.nodes;let s=!1;for(let o=0;o<e.length;o++){const a=e[o];let d=r[a];const l=t[o];d!==void 0?d.setOptions(l)&&(s=!0):(s=!0,d=this.create(l),r[a]=d)}!s&&i!==void 0&&(s=yT(t).call(t,function(o,a){const d=i[a];return d&&d.level!==o.level})),s===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}remove(e){const t=this.body.nodes;for(let i=0;i<e.length;i++){const r=e[i];delete t[r]}this.body.emitter.emit("_dataChanged")}create(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:de;return new t(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;H(this.body.nodes,(t,i)=>{const r=this.body.data.nodes.get(i);r!==void 0&&(e===!0&&t.setOptions({x:null,y:null}),t.setOptions({fixed:!1}),t.setOptions(r))})}getPositions(e){const t={};if(e!==void 0){if(he(e)===!0){for(let i=0;i<e.length;i++)if(this.body.nodes[e[i]]!==void 0){const r=this.body.nodes[e[i]];t[e[i]]={x:Math.round(r.x),y:Math.round(r.y)}}}else if(this.body.nodes[e]!==void 0){const i=this.body.nodes[e];t[e]={x:Math.round(i.x),y:Math.round(i.y)}}}else for(let i=0;i<this.body.nodeIndices.length;i++){const r=this.body.nodes[this.body.nodeIndices[i]];t[this.body.nodeIndices[i]]={x:Math.round(r.x),y:Math.round(r.y)}}return t}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(){const e=[],t=this.body.data.nodes.getDataSet();for(const i of t.get()){const r=i.id,s=this.body.nodes[r],o=Math.round(s.x),a=Math.round(s.y);(i.x!==o||i.y!==a)&&e.push({id:r,x:o,y:a})}t.update(e)}getBoundingBox(e){if(this.body.nodes[e]!==void 0)return this.body.nodes[e].shape.boundingBox}getConnectedNodes(e,t){const i=[];if(this.body.nodes[e]!==void 0){const r=this.body.nodes[e],s={};for(let o=0;o<r.edges.length;o++){const a=r.edges[o];t!=="to"&&a.toId==r.id?s[a.fromId]===void 0&&(i.push(a.fromId),s[a.fromId]=!0):t!=="from"&&a.fromId==r.id&&s[a.toId]===void 0&&(i.push(a.toId),s[a.toId]=!0)}}return i}getConnectedEdges(e){const t=[];if(this.body.nodes[e]!==void 0){const i=this.body.nodes[e];for(let r=0;r<i.edges.length;r++)t.push(i.edges[r].id)}else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return t}moveNode(e,t,i){this.body.nodes[e]!==void 0?(this.body.nodes[e].x=Number(t),this.body.nodes[e].y=Number(i),at(()=>{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}}var Jw={},Qw;function hC(){if(Qw)return Jw;Qw=1;var n=B(),e=Math.hypot,t=Math.abs,i=Math.sqrt,r=!!e&&e(1/0,NaN)!==1/0;return n({target:"Math",stat:!0,arity:2,forced:r},{hypot:function(o,a){for(var d=0,l=0,h=arguments.length,u=0,c,f;l<h;)c=t(arguments[l++]),u<c?(f=u/c,d=d*f*f+1,u=c):c>0?(f=c/u,d+=f*f):d+=c;return u===1/0?1/0:u*i(d)}}),Jw}var Zl,e_;function uC(){if(e_)return Zl;e_=1,hC();var n=Z();return Zl=n.Math.hypot,Zl}var Jl,t_;function cC(){if(t_)return Jl;t_=1;var n=uC();return Jl=n,Jl}var Ql,i_;function fC(){return i_||(i_=1,Ql=cC()),Ql}var pC=fC(),gC=L(pC);class pe{static transform(e,t){he(e)||(e=[e]);const i=t.point.x,r=t.point.y,s=t.angle,o=t.length;for(let a=0;a<e.length;++a){const d=e[a],l=d.x*Math.cos(s)-d.y*Math.sin(s),h=d.x*Math.sin(s)+d.y*Math.cos(s);d.x=i+o*l,d.y=r+o*h}}static drawPath(e,t){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(let i=1;i<t.length;++i)e.lineTo(t[i].x,t[i].y);e.closePath()}}let vC=class extends pe{static draw(e,t){if(t.image){e.save(),e.translate(t.point.x,t.point.y),e.rotate(Math.PI/2+t.angle);const i=t.imageWidth!=null?t.imageWidth:t.image.width,r=t.imageHeight!=null?t.imageHeight:t.image.height;t.image.drawImageAtPosition(e,1,-i/2,0,i,r),e.restore()}return!1}};class mC extends pe{static draw(e,t){const i=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return pe.transform(i,t),pe.drawPath(e,i),!0}}class yC{static draw(e,t){const i=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return pe.transform(i,t),pe.drawPath(e,i),!0}}class bC{static draw(e,t){const i={x:-.4,y:0};pe.transform(i,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";const r=Math.PI,s=t.angle-r/2,o=t.angle+r/2;return e.beginPath(),e.arc(i.x,i.y,t.length*.4,s,o,!1),e.stroke(),!0}}class wC{static draw(e,t){const i={x:-.3,y:0};pe.transform(i,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";const r=Math.PI,s=t.angle+r/2,o=t.angle+3*r/2;return e.beginPath(),e.arc(i.x,i.y,t.length*.4,s,o,!1),e.stroke(),!0}}class _C{static draw(e,t){const i=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return pe.transform(i,t),pe.drawPath(e,i),!0}}class EC{static draw(e,t){const i=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return pe.transform(i,t),pe.drawPath(e,i),!0}}class SC{static draw(e,t){const i={x:-.4,y:0};return pe.transform(i,t),ms(e,i.x,i.y,t.length*.4),!0}}class OC{static draw(e,t){const i=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return pe.transform(i,t),pe.drawPath(e,i),!0}}class IC{static draw(e,t){const i=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return pe.transform(i,t),pe.drawPath(e,i),!0}}class TC{static draw(e,t){const i=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return pe.transform(i,t),pe.drawPath(e,i),!0}}class PC{static draw(e,t){const i=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return pe.transform(i,t),pe.drawPath(e,i),!0}}class r_{static draw(e,t){let i;switch(t.type&&(i=t.type.toLowerCase()),i){case"image":return vC.draw(e,t);case"circle":return SC.draw(e,t);case"box":return IC.draw(e,t);case"crow":return yC.draw(e,t);case"curve":return bC.draw(e,t);case"diamond":return TC.draw(e,t);case"inv_curve":return wC.draw(e,t);case"triangle":return _C.draw(e,t);case"inv_triangle":return EC.draw(e,t);case"bar":return OC.draw(e,t);case"vee":return PC.draw(e,t);case"arrow":default:return mC.draw(e,t)}}}function n_(n,e){var t=ue(n);if(_t){var i=_t(n);e&&(i=Me(i).call(i,function(r){return Et(n,r).enumerable})),t.push.apply(t,i)}return t}function s_(n){for(var e=1;e<arguments.length;e++){var t,i,r=arguments[e]!=null?arguments[e]:{};e%2?Q(t=n_(Object(r),!0)).call(t,function(s){ut(n,s,r[s])}):St?$r(n,St(r)):Q(i=n_(Object(r))).call(i,function(s){Hr(n,s,Et(r,s))})}return n}class o_{constructor(e,t,i){ut(this,"color",{}),ut(this,"colorDirty",!0),ut(this,"hoverWidth",1.5),ut(this,"selectionWidth",2),this._body=t,this._labelModule=i,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,t,i,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,t),e.lineWidth=t.width,t.dashes!==!1?this._drawDashedLine(e,t,s):this._drawLine(e,t,s)}_drawLine(e,t,i,r,s){if(this.from!=this.to)this._line(e,t,i,r,s);else{const[o,a,d]=this._getCircleData(e);this._circle(e,t,o,a,d)}}_drawDashedLine(e,t,i,r,s){e.lineCap="round";const o=he(t.dashes)?t.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(o),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,i);else{const[a,d,l]=this._getCircleData(e);this._circle(e,t,a,d,l)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)Nc(e,this.from.x,this.from.y,this.to.x,this.to.y,o);else{const[a,d,l]=this._getCircleData(e);this._circle(e,t,a,d,l)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}findBorderPosition(e,t,i){return this.from!=this.to?this._findBorderPosition(e,t,i):this._findBorderPositionCircle(e,t,i)}findBorderPositions(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};{var t;const[i,r]=Qe(t=this._getCircleData(e)).call(t,0,2);return{from:this._findBorderPositionCircle(this.from,e,{x:i,y:r,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:i,y:r,low:.6,high:.8,direction:1})}}}_getCircleData(e){const t=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);const i=jw(e,this.options.selfReference.angle,t,this.from);return[i.x,i.y,t]}_pointOnCircle(e,t,i,r){const s=r*2*Math.PI;return{x:e+i*Math.cos(s),y:t-i*Math.sin(s)}}_findBorderPositionCircle(e,t,i){const r=i.x,s=i.y;let o=i.low,a=i.high;const d=i.direction,l=10,h=this.options.selfReference.size,u=.05;let c,f=(o+a)*.5,p=0;this.options.arrowStrikethrough===!0&&(d===-1?p=this.options.endPointOffset.from:d===1&&(p=this.options.endPointOffset.to));let g=0;do{f=(o+a)*.5,c=this._pointOnCircle(r,s,h,f);const b=Math.atan2(e.y-c.y,e.x-c.x),m=e.distanceToBorder(t,b)+p,v=Math.sqrt(Math.pow(c.x-e.x,2)+Math.pow(c.y-e.y,2)),w=m-v;if(Math.abs(w)<u)break;w>0?d>0?o=f:a=f:d>0?a=f:o=f,++g}while(o<=a&&g<l);return s_(s_({},c),{},{t:f})}getLineWidth(e,t){return e===!0?Math.max(this.selectionWidth,.3/this._body.view.scale):t===!0?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}getColor(e,t){if(t.inheritsColor!==!1){if(t.inheritsColor==="both"&&this.from.id!==this.to.id){const i=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y);let r=this.from.options.color.highlight.border,s=this.to.options.color.highlight.border;return this.from.selected===!1&&this.to.selected===!1?(r=$e(this.from.options.color.border,t.opacity),s=$e(this.to.options.color.border,t.opacity)):this.from.selected===!0&&this.to.selected===!1?s=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(r=this.from.options.color.border),i.addColorStop(0,r),i.addColorStop(1,s),i}return t.inheritsColor==="to"?$e(this.to.options.color.border,t.opacity):$e(this.from.options.color.border,t.opacity)}else return $e(t.color,t.opacity)}_circle(e,t,i,r,s){this.enableShadow(e,t);let o=0,a=Math.PI*2;if(!this.options.selfReference.renderBehindTheNode){const d=this.options.selfReference.angle,l=this.options.selfReference.angle+Math.PI,h=this._findBorderPositionCircle(this.from,e,{x:i,y:r,low:d,high:l,direction:-1}),u=this._findBorderPositionCircle(this.from,e,{x:i,y:r,low:d,high:l,direction:1});o=Math.atan2(h.y-r,h.x-i),a=Math.atan2(u.y-r,u.x-i)}e.beginPath(),e.arc(i,r,s,o,a,!1),e.stroke(),this.disableShadow(e,t)}getDistanceToEdge(e,t,i,r,s,o){if(this.from!=this.to)return this._getDistanceToEdge(e,t,i,r,s,o);{const[a,d,l]=this._getCircleData(void 0),h=a-s,u=d-o;return Math.abs(Math.sqrt(h*h+u*u)-l)}}_getDistanceToLine(e,t,i,r,s,o){const a=i-e,d=r-t,l=a*a+d*d;let h=((s-e)*a+(o-t)*d)/l;h>1?h=1:h<0&&(h=0);const u=e+h*a,c=t+h*d,f=u-s,p=c-o;return Math.sqrt(f*f+p*p)}getArrowData(e,t,i,r,s,o){let a,d,l,h,u,c,f;const p=o.width;t==="from"?(l=this.from,h=this.to,u=o.fromArrowScale<0,c=Math.abs(o.fromArrowScale),f=o.fromArrowType):t==="to"?(l=this.to,h=this.from,u=o.toArrowScale<0,c=Math.abs(o.toArrowScale),f=o.toArrowType):(l=this.to,h=this.from,u=o.middleArrowScale<0,c=Math.abs(o.middleArrowScale),f=o.middleArrowType);const g=15*c+3*p;if(l!=h){const w=gC(l.x-h.x,l.y-h.y),y=g/w;if(t!=="middle")if(this.options.smooth.enabled===!0){const _=this._findBorderPosition(l,e,{via:i}),O=this.getPoint(_.t+y*(t==="from"?1:-1),i);a=Math.atan2(_.y-O.y,_.x-O.x),d=_}else a=Math.atan2(l.y-h.y,l.x-h.x),d=this._findBorderPosition(l,e);else{const _=(u?-y:y)/2,O=this.getPoint(.5+_,i),T=this.getPoint(.5-_,i);a=Math.atan2(O.y-T.y,O.x-T.x),d=this.getPoint(.5,i)}}else{const[w,y,_]=this._getCircleData(e);if(t==="from"){const O=this.options.selfReference.angle,T=this.options.selfReference.angle+Math.PI,E=this._findBorderPositionCircle(this.from,e,{x:w,y,low:O,high:T,direction:-1});a=E.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,d=E}else if(t==="to"){const O=this.options.selfReference.angle,T=this.options.selfReference.angle+Math.PI,E=this._findBorderPositionCircle(this.from,e,{x:w,y,low:O,high:T,direction:1});a=E.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,d=E}else{const O=this.options.selfReference.angle/(2*Math.PI);d=this._pointOnCircle(w,y,_,O),a=O*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}const b=d.x-g*.9*Math.cos(a),m=d.y-g*.9*Math.sin(a);return{point:d,core:{x:b,y:m},angle:a,length:g,type:f}}drawArrowHead(e,t,i,r,s){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width,r_.draw(e,s)&&(this.enableShadow(e,t),Bi(e).call(e),this.disableShadow(e,t))}enableShadow(e,t){t.shadow===!0&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}drawBackground(e,t){if(t.background!==!1){const i={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=t.backgroundColor,e.lineWidth=t.backgroundSize,this.setStrokeDashed(e,t.backgroundDashes),e.stroke(),e.strokeStyle=i.strokeStyle,e.lineWidth=i.lineWidth,e.dashes=i.dashes,this.setStrokeDashed(e,t.dashes)}}setStrokeDashed(e,t){if(t!==!1)if(e.setLineDash!==void 0){const i=he(t)?t:[5,5];e.setLineDash(i)}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 a_(n,e){var t=ue(n);if(_t){var i=_t(n);e&&(i=Me(i).call(i,function(r){return Et(n,r).enumerable})),t.push.apply(t,i)}return t}function d_(n){for(var e=1;e<arguments.length;e++){var t,i,r=arguments[e]!=null?arguments[e]:{};e%2?Q(t=a_(Object(r),!0)).call(t,function(s){ut(n,s,r[s])}):St?$r(n,St(r)):Q(i=a_(Object(r))).call(i,function(s){Hr(n,s,Et(r,s))})}return n}class eh extends o_{constructor(e,t,i){super(e,t,i)}_findBorderPositionBezier(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates();const r=10,s=.2;let o=!1,a=1,d=0,l=this.to,h,u,c=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(l=this.from,o=!0,c=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(c=0);let f=0;do{u=(d+a)*.5,h=this.getPoint(u,i);const p=Math.atan2(l.y-h.y,l.x-h.x),g=l.distanceToBorder(t,p)+c,b=Math.sqrt(Math.pow(h.x-l.x,2)+Math.pow(h.y-l.y,2)),m=g-b;if(Math.abs(m)<s)break;m<0?o===!1?d=u:a=u:o===!1?a=u:d=u,++f}while(d<=a&&f<r);return d_(d_({},h),{},{t:u})}_getDistanceToBezierEdge(e,t,i,r,s,o,a){let d=1e9,l,h,u,c,f,p=e,g=t;for(h=1;h<10;h++)u=.1*h,c=Math.pow(1-u,2)*e+2*u*(1-u)*a.x+Math.pow(u,2)*i,f=Math.pow(1-u,2)*t+2*u*(1-u)*a.y+Math.pow(u,2)*r,h>0&&(l=this._getDistanceToLine(p,g,c,f,s,o),d=l<d?l:d),p=c,g=f;return d}_bezierCurve(e,t,i,r){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),i!=null&&i.x!=null?r!=null&&r.x!=null?e.bezierCurveTo(i.x,i.y,r.x,r.y,this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(i.x,i.y,this.toPoint.x,this.toPoint.y):e.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(e,t),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}getViaNode(){return this._getViaCoordinates()}}class l_ extends eh{constructor(e,t,i){super(e,t,i),ut(this,"via",this.via),this._boundFunction=()=>{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(e){super.setOptions(e);let t=!1;this.options.physics!==e.physics&&(t=!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(),t===!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){const e="edgeId:"+this.id,t=this._body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this._body.nodes[e]=t,this.via=t,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,t,i){this._bezierCurve(e,t,i)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){const[i,r,s]=this._getCircleData(),o=2*Math.PI*(1-e);return{x:i+s*Math.sin(o),y:r+s-s*(1-Math.cos(o))}}else return{x:Math.pow(1-e,2)*this.fromPoint.x+2*e*(1-e)*t.x+Math.pow(e,2)*this.toPoint.x,y:Math.pow(1-e,2)*this.fromPoint.y+2*e*(1-e)*t.y+Math.pow(e,2)*this.toPoint.y}}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t,this.via)}_getDistanceToEdge(e,t,i,r,s,o){return this._getDistanceToBezierEdge(e,t,i,r,s,o,this.via)}}class h_ extends eh{constructor(e,t,i){super(e,t,i)}_line(e,t,i){this._bezierCurve(e,t,i)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){const e=this.options.smooth.roundness,t=this.options.smooth.type;let i=Math.abs(this.from.x-this.to.x),r=Math.abs(this.from.y-this.to.y);if(t==="discrete"||t==="diagonalCross"){let s,o;i<=r?s=o=e*r:s=o=e*i,this.from.x>this.to.x&&(s=-s),this.from.y>=this.to.y&&(o=-o);let a=this.from.x+s,d=this.from.y+o;return t==="discrete"&&(i<=r?a=i<e*r?this.from.x:a:d=r<e*i?this.from.y:d),{x:a,y:d}}else if(t==="straightCross"){let s=(1-e)*i,o=(1-e)*r;return i<=r?(s=0,this.from.y<this.to.y&&(o=-o)):(this.from.x<this.to.x&&(s=-s),o=0),{x:this.to.x+s,y:this.to.y+o}}else if(t==="horizontal"){let s=(1-e)*i;return this.from.x<this.to.x&&(s=-s),{x:this.to.x+s,y:this.from.y}}else if(t==="vertical"){let s=(1-e)*r;return this.from.y<this.to.y&&(s=-s),{x:this.from.x,y:this.to.y+s}}else if(t==="curvedCW"){i=this.to.x-this.from.x,r=this.from.y-this.to.y;const s=Math.sqrt(i*i+r*r),o=Math.PI,d=(Math.atan2(r,i)+(e*.5+.5)*o)%(2*o);return{x:this.from.x+(e*.5+.5)*s*Math.sin(d),y:this.from.y+(e*.5+.5)*s*Math.cos(d)}}else if(t==="curvedCCW"){i=this.to.x-this.from.x,r=this.from.y-this.to.y;const s=Math.sqrt(i*i+r*r),o=Math.PI,d=(Math.atan2(r,i)+(-e*.5+.5)*o)%(2*o);return{x:this.from.x+(e*.5+.5)*s*Math.sin(d),y:this.from.y+(e*.5+.5)*s*Math.cos(d)}}else{let s,o;i<=r?s=o=e*r:s=o=e*i,this.from.x>this.to.x&&(s=-s),this.from.y>=this.to.y&&(o=-o);let a=this.from.x+s,d=this.from.y+o;return i<=r?this.from.x<=this.to.x?a=this.to.x<a?this.to.x:a:a=this.to.x>a?this.to.x:a:this.from.y>=this.to.y?d=this.to.y>d?this.to.y:d:d=this.to.y<d?this.to.y:d,{x:a,y:d}}}_findBorderPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,t,i.via)}_getDistanceToEdge(e,t,i,r,s,o){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,i,r,s,o,a)}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const i=e,r=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*t.x+Math.pow(i,2)*this.toPoint.x,s=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*t.y+Math.pow(i,2)*this.toPoint.y;return{x:r,y:s}}}class CC extends eh{constructor(e,t,i){super(e,t,i)}_getDistanceToBezierEdge2(e,t,i,r,s,o,a,d){let l=1e9,h=e,u=t;const c=[0,0,0,0];for(let f=1;f<10;f++){const p=.1*f;c[0]=Math.pow(1-p,3),c[1]=3*p*Math.pow(1-p,2),c[2]=3*Math.pow(p,2)*(1-p),c[3]=Math.pow(p,3);const g=c[0]*e+c[1]*a.x+c[2]*d.x+c[3]*i,b=c[0]*t+c[1]*a.y+c[2]*d.y+c[3]*r;if(f>0){const m=this._getDistanceToLine(h,u,g,b,s,o);l=m<l?m:l}h=g,u=b}return l}}class u_ extends CC{constructor(e,t,i){super(e,t,i)}_line(e,t,i){const r=i[0],s=i[1];this._bezierCurve(e,t,r,s)}_getViaCoordinates(){const e=this.from.x-this.to.x,t=this.from.y-this.to.y;let i,r,s,o;const a=this.options.smooth.roundness;return(Math.abs(e)>Math.abs(t)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(r=this.from.y,o=this.to.y,i=this.from.x-a*e,s=this.to.x+a*e):(r=this.from.y-a*t,o=this.to.y+a*t,i=this.from.x,s=this.to.x),[{x:i,y:r},{x:s,y:o}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t)}_getDistanceToEdge(e,t,i,r,s,o){let[a,d]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,t,i,r,s,o,a,d)}getPoint(e){let[t,i]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const r=e,s=[Math.pow(1-r,3),3*r*Math.pow(1-r,2),3*Math.pow(r,2)*(1-r),Math.pow(r,3)],o=s[0]*this.fromPoint.x+s[1]*t.x+s[2]*i.x+s[3]*this.toPoint.x,a=s[0]*this.fromPoint.y+s[1]*t.y+s[2]*i.y+s[3]*this.toPoint.y;return{x:o,y:a}}}class c_ extends o_{constructor(e,t,i){super(e,t,i)}_line(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}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,t){let i=this.to,r=this.from;e.id===this.from.id&&(i=this.from,r=this.to);const s=Math.atan2(i.y-r.y,i.x-r.x),o=i.x-r.x,a=i.y-r.y,d=Math.sqrt(o*o+a*a),l=e.distanceToBorder(t,s),h=(d-l)/d;return{x:(1-h)*r.x+h*i.x,y:(1-h)*r.y+h*i.y,t:0}}_getDistanceToEdge(e,t,i,r,s,o){return this._getDistanceToLine(e,t,i,r,s,o)}}class It{constructor(e,t,i,r,s){if(t===void 0)throw new Error("No body provided");this.options=mt(r),this.globalOptions=r,this.defaultOptions=s,this.body=t,this.imagelist=i,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 Oi(this.body,this.options,!0),this.setOptions(e)}setOptions(e){if(!e)return;let t=typeof e.physics<"u"&&this.options.physics!==e.physics||typeof e.hidden<"u"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from<"u"&&this.options.from!==e.from||typeof e.to<"u"&&this.options.to!==e.to;It.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=vw(e.value));const i=[e,this.options,this.defaultOptions];return this.chooser=Wl("edge",i),this.updateLabelModule(e),t=this.updateEdgeType()||t,this._setInteractionWidths(),this.connect(),t}static parseOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(wi(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],e,t,i),t.endPointOffset!==void 0&&t.endPointOffset.from!==void 0&&(Lt(t.endPointOffset.from)?e.endPointOffset.from=t.endPointOffset.from:(e.endPointOffset.from=r.endPointOffset.from!==void 0?r.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),t.endPointOffset!==void 0&&t.endPointOffset.to!==void 0&&(Lt(t.endPointOffset.to)?e.endPointOffset.to=t.endPointOffset.to:(e.endPointOffset.to=r.endPointOffset.to!==void 0?r.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),Wr(t.label)?e.label=t.label:Wr(e.label)||(e.label=void 0),He(e,t,"smooth",r),He(e,t,"shadow",r),He(e,t,"background",r),t.dashes!==void 0&&t.dashes!==null?e.dashes=t.dashes:i===!0&&t.dashes===null&&(e.dashes=Dt(r.dashes)),t.scaling!==void 0&&t.scaling!==null?(t.scaling.min!==void 0&&(e.scaling.min=t.scaling.min),t.scaling.max!==void 0&&(e.scaling.max=t.scaling.max),He(e.scaling,t.scaling,"label",r.scaling)):i===!0&&t.scaling===null&&(e.scaling=Dt(r.scaling)),t.arrows!==void 0&&t.arrows!==null)if(typeof t.arrows=="string"){const a=t.arrows.toLowerCase();e.arrows.to.enabled=J(a).call(a,"to")!=-1,e.arrows.middle.enabled=J(a).call(a,"middle")!=-1,e.arrows.from.enabled=J(a).call(a,"from")!=-1}else if(typeof t.arrows=="object")He(e.arrows,t.arrows,"to",r.arrows),He(e.arrows,t.arrows,"middle",r.arrows),He(e.arrows,t.arrows,"from",r.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+Ai(t.arrows));else i===!0&&t.arrows===null&&(e.arrows=Dt(r.arrows));if(t.color!==void 0&&t.color!==null){const a=bi(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,d=e.color;if(s)te(d,r.color,!1,i);else for(const l in d)Object.prototype.hasOwnProperty.call(d,l)&&delete d[l];if(bi(d))d.color=d,d.highlight=d,d.hover=d,d.inherit=!1,a.opacity===void 0&&(d.opacity=1);else{let l=!1;a.color!==void 0&&(d.color=a.color,l=!0),a.highlight!==void 0&&(d.highlight=a.highlight,l=!0),a.hover!==void 0&&(d.hover=a.hover,l=!0),a.inherit!==void 0&&(d.inherit=a.inherit),a.opacity!==void 0&&(d.opacity=Math.min(1,Math.max(0,a.opacity))),l===!0?d.inherit=!1:d.inherit===void 0&&(d.inherit="from")}}else i===!0&&t.color===null&&(e.color=mt(r.color));i===!0&&t.font===null&&(e.font=mt(r.font)),Object.prototype.hasOwnProperty.call(t,"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=t.selfReferenceSize)}getFormattingValues(){const e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,t=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,i=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,r=this.options.color.inherit,s={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:i,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:t,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:r?void 0:this.options.color.color,inheritsColor:r,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){const o=this.options.selectionWidth;typeof o=="function"?s.width=o(s.width):typeof o=="number"&&(s.width+=o),s.width=Math.max(s.width,.3/this.body.view.scale),s.color=this.options.color.highlight,s.shadow=this.options.shadow.enabled}else if(this.hover){const o=this.options.hoverWidth;typeof o=="function"?s.width=o(s.width):typeof o=="number"&&(s.width+=o),s.width=Math.max(s.width,.3/this.body.view.scale),s.color=this.options.color.hover,s.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(s,this.options.id,this.selected,this.hover),s.color!==void 0&&(s.inheritsColor=!1),s.shadow===!1&&(s.shadowColor!==this.options.shadow.color||s.shadowSize!==this.options.shadow.size||s.shadowX!==this.options.shadow.x||s.shadowY!==this.options.shadow.y)&&(s.shadow=!0));else s.shadow=this.options.shadow.enabled,s.width=Math.max(s.width,.3/this.body.view.scale);return s}updateLabelModule(e){const t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){const e=this.options.smooth;let t=!1,i=!0;return this.edgeType!==void 0&&((this.edgeType instanceof l_&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof u_&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof h_&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof c_&&e.type.enabled===!1)&&(i=!1),i===!0&&(t=this.cleanup())),i===!0?e.enabled===!0?e.type==="dynamic"?(t=!0,this.edgeType=new l_(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new u_(this.options,this.body,this.labelModule):this.edgeType=new h_(this.options,this.body,this.labelModule):this.edgeType=new c_(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}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,t,i){if(this.options.value!==void 0){const r=this.options.scaling.customScalingFunction(e,t,i,this.options.value),s=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const o=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+r*o}this.options.width=this.options.scaling.min+r*s}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){const t=this.getFormattingValues();if(t.hidden)return;const i=this.edgeType.getViaNode();this.edgeType.drawLine(e,t,this.selected,this.hover,i),this.drawLabel(e,i)}drawArrows(e){const t=this.getFormattingValues();if(t.hidden)return;const i=this.edgeType.getViaNode(),r={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(r.from=this.edgeType.getArrowData(e,"from",i,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.fromPoint=r.from.core),t.fromArrowSrc&&(r.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(r.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(r.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(r.to=this.edgeType.getArrowData(e,"to",i,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.toPoint=r.to.core),t.toArrowSrc&&(r.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(r.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(r.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(r.middle=this.edgeType.getArrowData(e,"middle",i,this.selected,this.hover,t),t.middleArrowSrc&&(r.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(r.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(r.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,r.from),t.middleArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,r.middle),t.toArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,r.to)}drawLabel(e,t){if(this.options.label!==void 0){const i=this.from,r=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);let s;if(i.id!=r.id){this.labelModule.pointToSelf=!1,s=this.edgeType.getPoint(.5,t),e.save();const o=this._getRotation(e);o.angle!=0&&(e.translate(o.x,o.y),e.rotate(o.angle)),this.labelModule.draw(e,s.x,s.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;const o=jw(e,this.options.selfReference.angle,this.options.selfReference.size,i);s=this._pointOnCircle(o.x,o.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,s.x,s.y,this.selected,this.hover)}}}getItemsOnPoint(e){const t=[];if(this.labelModule.visible()){const r=this._getRotation();Vl(this.labelModule.getSize(),e,r)&&t.push({edgeId:this.id,labelId:0})}const i={left:e.x,top:e.y};return this.isOverlappingWith(i)&&t.push({edgeId:this.id}),t}isOverlappingWith(e){if(this.connected){const i=this.from.x,r=this.from.y,s=this.to.x,o=this.to.y,a=e.left,d=e.top;return this.edgeType.getDistanceToEdge(i,r,s,o,a,d)<10}else return!1}_getRotation(e){const t=this.edgeType.getViaNode(),i=this.edgeType.getPoint(.5,t);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,i.x,i.y);const r={x:i.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return r;const s=this.from.y-this.to.y,o=this.from.x-this.to.x;let a=Math.atan2(s,o);return(a<-1&&o<0||a>0&&o<0)&&(a+=Math.PI),r.angle=a,r}_pointOnCircle(e,t,i,r){return{x:e+i*Math.cos(r),y:t-i*Math.sin(r)}}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}}class xC{constructor(e,t,i){var r;this.body=e,this.images=t,this.groups=i,this.body.functions.createEdge=D(r=this.create).call(r,this),this.edgesListeners={add:(s,o)=>{this.add(o.items)},update:(s,o)=>{this.update(o.items)},remove:(s,o)=>{this.remove(o.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(s,o,a,d){if(o===s)return .5;{const l=1/(o-s);return Math.max(0,(d-s)*l)}}},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},te(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e=this,t,i;this.body.emitter.on("_forceDisableDynamicCurves",function(r){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;r==="dynamic"&&(r="continuous");let o=!1;for(const a in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,a)){const d=e.body.edges[a],l=e.body.data.edges.get(a);if(l!=null){const h=l.smooth;h!==void 0&&h.enabled===!0&&h.type==="dynamic"&&(r===void 0?d.setOptions({smooth:!1}):d.setOptions({smooth:{type:r}}),o=!0)}}s===!0&&o===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",()=>{this.reconnectEdges()}),this.body.emitter.on("refreshEdges",D(t=this.refresh).call(t,this)),this.body.emitter.on("refresh",D(i=this.refresh).call(i,this)),this.body.emitter.on("destroy",()=>{H(this.edgesListeners,(r,s)=>{this.body.data.edges&&this.body.data.edges.off(s,r)}),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){It.parseOptions(this.options,e,!0,this.defaultOptions,!0);let t=!1;if(e.smooth!==void 0)for(const i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&(t=this.body.edges[i].updateEdgeType()||t);if(e.font!==void 0)for(const i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&this.body.edges[i].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||t===!0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.data.edges;if((0,Zt.isDataViewLike)("id",e))this.body.data.edges=e;else if(he(e))this.body.data.edges=new Zt.DataSet,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new Zt.DataSet;else throw new TypeError("Array or DataSet expected");if(i&&H(this.edgesListeners,(r,s)=>{i.off(s,r)}),this.body.edges={},this.body.data.edges){H(this.edgesListeners,(s,o)=>{this.body.data.edges.on(o,s)});const r=this.body.data.edges.getIds();this.add(r,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.edges,r=this.body.data.edges;for(let s=0;s<e.length;s++){const o=e[s],a=i[o];a&&a.disconnect();const d=r.get(o,{showInternalIds:!0});i[o]=this.create(d)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),t===!1&&this.body.emitter.emit("_dataChanged")}update(e){const t=this.body.edges,i=this.body.data.edges;let r=!1;for(let s=0;s<e.length;s++){const o=e[s],a=i.get(o),d=t[o];d!==void 0?(d.disconnect(),r=d.setOptions(a)||r,d.connect()):(this.body.edges[o]=this.create(a),r=!0)}r===!0?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}remove(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length===0)return;const i=this.body.edges;H(e,r=>{const s=i[r];s!==void 0&&s.remove()}),t&&this.body.emitter.emit("_dataChanged")}refresh(){H(this.body.edges,(e,t)=>{const i=this.body.data.edges.get(t);i!==void 0&&e.setOptions(i)})}create(e){return new It(e,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let e;const t=this.body.nodes,i=this.body.edges;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e].edges=[]);for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)){const r=i[e];r.from=null,r.to=null,r.connect()}}getConnectedNodes(e){const t=[];if(this.body.edges[e]!==void 0){const i=this.body.edges[e];i.fromId!==void 0&&t.push(i.fromId),i.toId!==void 0&&t.push(i.toId)}return t}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){const e=[];H(this.body.edges,(t,i)=>{const r=this.body.nodes[t.toId],s=this.body.nodes[t.fromId];r!==void 0&&r.isCluster===!0||s!==void 0&&s.isCluster===!0||(r===void 0||s===void 0)&&e.push(i)}),this.remove(e,!1)}_addMissingEdges(){const e=this.body.data.edges;if(e==null)return;const t=this.body.edges,i=[];Q(e).call(e,(r,s)=>{t[s]===void 0&&i.push(s)}),this.add(i,!0)}}class f_{constructor(e,t,i){this.body=e,this.physicsBody=t,this.barnesHutTree,this.setOptions(i),this._rng=Fr("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;const t=this.body.nodes,i=this.physicsBody.physicsNodeIndices,r=i.length,s=this._formBarnesHutTree(t,i);this.barnesHutTree=s;for(let o=0;o<r;o++)e=t[i[o]],e.options.mass>0&&this._getForceContributions(s.root,e)}}_getForceContributions(e,t){this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)}_getForceContribution(e,t){if(e.childrenCount>0){const i=e.centerOfMass.x-t.x,r=e.centerOfMass.y-t.y,s=Math.sqrt(i*i+r*r);s*e.calcSize>this.thetaInversed?this._calculateForces(s,i,r,t,e):e.childrenCount===4?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(s,i,r,t,e)}}_calculateForces(e,t,i,r,s){e===0&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&r.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*r.shape.radius,e-r.shape.radius));const o=this.options.gravitationalConstant*s.mass*r.options.mass/Math.pow(e,3),a=t*o,d=i*o;this.physicsBody.forces[r.id].x+=a,this.physicsBody.forces[r.id].y+=d}_formBarnesHutTree(e,t){let i;const r=t.length;let s=e[t[0]].x,o=e[t[0]].y,a=e[t[0]].x,d=e[t[0]].y;for(let b=1;b<r;b++){const m=e[t[b]],v=m.x,w=m.y;m.options.mass>0&&(v<s&&(s=v),v>a&&(a=v),w<o&&(o=w),w>d&&(d=w))}const l=Math.abs(a-s)-Math.abs(d-o);l>0?(o-=.5*l,d+=.5*l):(s+=.5*l,a-=.5*l);const u=Math.max(1e-5,Math.abs(a-s)),c=.5*u,f=.5*(s+a),p=.5*(o+d),g={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:f-c,maxX:f+c,minY:p-c,maxY:p+c},size:u,calcSize:1/u,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(g.root);for(let b=0;b<r;b++)i=e[t[b]],i.options.mass>0&&this._placeInTree(g.root,i);return g}_updateBranchMass(e,t){const i=e.centerOfMass,r=e.mass+t.options.mass,s=1/r;i.x=i.x*e.mass+t.x*t.options.mass,i.x*=s,i.y=i.y*e.mass+t.y*t.options.mass,i.y*=s,e.mass=r;const o=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidth<o?o:e.maxWidth}_placeInTree(e,t,i){(i!=!0||i===void 0)&&this._updateBranchMass(e,t);const r=e.children.NW.range;let s;r.maxX>t.x?r.maxY>t.y?s="NW":s="SW":r.maxY>t.y?s="NE":s="SE",this._placeInRegion(e,t,s)}_placeInRegion(e,t,i){const r=e.children[i];switch(r.childrenCount){case 0:r.children.data=t,r.childrenCount=1,this._updateBranchMass(r,t);break;case 1:r.children.data.x===t.x&&r.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(r),this._placeInTree(r,t));break;case 4:this._placeInTree(r,t);break}}_splitBranch(e){let t=null;e.childrenCount===1&&(t=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"),t!=null&&this._placeInTree(e,t)}_insertRegion(e,t){let i,r,s,o;const a=.5*e.size;switch(t){case"NW":i=e.range.minX,r=e.range.minX+a,s=e.range.minY,o=e.range.minY+a;break;case"NE":i=e.range.minX+a,r=e.range.maxX,s=e.range.minY,o=e.range.minY+a;break;case"SW":i=e.range.minX,r=e.range.minX+a,s=e.range.minY+a,o=e.range.maxY;break;case"SE":i=e.range.minX+a,r=e.range.maxX,s=e.range.minY+a,o=e.range.maxY;break}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:r,minY:s,maxY:o},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}_debug(e,t){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}_drawBranch(e,t,i){i===void 0&&(i="#FF0000"),e.childrenCount===4&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=i,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}class RC{constructor(e,t,i){this._rng=Fr("REPULSION SOLVER"),this.body=e,this.physicsBody=t,this.setOptions(i)}setOptions(e){this.options=e}solve(){let e,t,i,r,s,o,a,d;const l=this.body.nodes,h=this.physicsBody.physicsNodeIndices,u=this.physicsBody.forces,c=this.options.nodeDistance,f=-2/3/c,p=4/3;for(let g=0;g<h.length-1;g++){a=l[h[g]];for(let b=g+1;b<h.length;b++)d=l[h[b]],e=d.x-a.x,t=d.y-a.y,i=Math.sqrt(e*e+t*t),i===0&&(i=.1*this._rng(),e=i),i<2*c&&(i<.5*c?o=1:o=f*i+p,o=o/i,r=e*o,s=t*o,u[a.id].x-=r,u[a.id].y-=s,u[d.id].x+=r,u[d.id].y+=s)}}}class DC{constructor(e,t,i){this.body=e,this.physicsBody=t,this.setOptions(i)}setOptions(e){this.options=e,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}solve(){const e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,i=this.physicsBody.forces,r=this.options.nodeDistance;for(let s=0;s<t.length-1;s++){const o=e[t[s]];for(let a=s+1;a<t.length;a++){const d=e[t[a]];if(o.level===d.level){const l=r+this.overlapAvoidanceFactor*((o.shape.radius||0)/2+(d.shape.radius||0)/2),h=d.x-o.x,u=d.y-o.y,c=Math.sqrt(h*h+u*u),f=.05;let p;c<l?p=-Math.pow(f*c,2)+Math.pow(f*l,2):p=0,c!==0&&(p=p/c);const g=h*p,b=u*p;i[o.id].x-=g,i[o.id].y-=b,i[d.id].x+=g,i[d.id].y+=b}}}}}class th{constructor(e,t,i){this.body=e,this.physicsBody=t,this.setOptions(i)}setOptions(e){this.options=e}solve(){let e,t;const i=this.physicsBody.physicsEdgeIndices,r=this.body.edges;let s,o,a;for(let d=0;d<i.length;d++)t=r[i[d]],t.connected===!0&&t.toId!==t.fromId&&this.body.nodes[t.toId]!==void 0&&this.body.nodes[t.fromId]!==void 0&&(t.edgeType.via!==void 0?(e=t.options.length===void 0?this.options.springLength:t.options.length,s=t.to,o=t.edgeType.via,a=t.from,this._calculateSpringForce(s,o,.5*e),this._calculateSpringForce(o,a,.5*e)):(e=t.options.length===void 0?this.options.springLength*1.5:t.options.length,this._calculateSpringForce(t.from,t.to,e)))}_calculateSpringForce(e,t,i){const r=e.x-t.x,s=e.y-t.y,o=Math.max(Math.sqrt(r*r+s*s),.01),a=this.options.springConstant*(i-o)/o,d=r*a,l=s*a;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=d,this.physicsBody.forces[e.id].y+=l),this.physicsBody.forces[t.id]!==void 0&&(this.physicsBody.forces[t.id].x-=d,this.physicsBody.forces[t.id].y-=l)}}class MC{constructor(e,t,i){this.body=e,this.physicsBody=t,this.setOptions(i)}setOptions(e){this.options=e}solve(){let e,t,i,r,s,o,a,d;const l=this.body.edges,h=.5,u=this.physicsBody.physicsEdgeIndices,c=this.physicsBody.physicsNodeIndices,f=this.physicsBody.forces;for(let y=0;y<c.length;y++){const _=c[y];f[_].springFx=0,f[_].springFy=0}for(let y=0;y<u.length;y++)t=l[u[y]],t.connected===!0&&(e=t.options.length===void 0?this.options.springLength:t.options.length,i=t.from.x-t.to.x,r=t.from.y-t.to.y,d=Math.sqrt(i*i+r*r),d=d===0?.01:d,a=this.options.springConstant*(e-d)/d,s=i*a,o=r*a,t.to.level!=t.from.level?(f[t.toId]!==void 0&&(f[t.toId].springFx-=s,f[t.toId].springFy-=o),f[t.fromId]!==void 0&&(f[t.fromId].springFx+=s,f[t.fromId].springFy+=o)):(f[t.toId]!==void 0&&(f[t.toId].x-=h*s,f[t.toId].y-=h*o),f[t.fromId]!==void 0&&(f[t.fromId].x+=h*s,f[t.fromId].y+=h*o)));a=1;let p,g;for(let y=0;y<c.length;y++){const _=c[y];p=Math.min(a,Math.max(-a,f[_].springFx)),g=Math.min(a,Math.max(-a,f[_].springFy)),f[_].x+=p,f[_].y+=g}let b=0,m=0;for(let y=0;y<c.length;y++){const _=c[y];b+=f[_].x,m+=f[_].y}const v=b/c.length,w=m/c.length;for(let y=0;y<c.length;y++){const _=c[y];f[_].x-=v,f[_].y-=w}}}class Vr{constructor(e,t,i){this.body=e,this.physicsBody=t,this.setOptions(i)}setOptions(e){this.options=e}solve(){let e,t,i,r;const s=this.body.nodes,o=this.physicsBody.physicsNodeIndices,a=this.physicsBody.forces;for(let d=0;d<o.length;d++){const l=o[d];r=s[l],e=-r.x,t=-r.y,i=Math.sqrt(e*e+t*t),this._calculateForces(i,e,t,a,r)}}_calculateForces(e,t,i,r,s){const o=e===0?0:this.options.centralGravity/e;r[s.id].x=t*o,r[s.id].y=i*o}}class qC extends f_{constructor(e,t,i){super(e,t,i),this._rng=Fr("FORCE ATLAS 2 BASED REPULSION SOLVER")}_calculateForces(e,t,i,r,s){e===0&&(e=.1*this._rng(),t=e),this.overlapAvoidanceFactor<1&&r.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*r.shape.radius,e-r.shape.radius));const o=r.edges.length+1,a=this.options.gravitationalConstant*s.mass*r.options.mass*o/Math.pow(e,2),d=t*a,l=i*a;this.physicsBody.forces[r.id].x+=d,this.physicsBody.forces[r.id].y+=l}}class kC extends Vr{constructor(e,t,i){super(e,t,i)}_calculateForces(e,t,i,r,s){if(e>0){const o=s.edges.length+1,a=this.options.centralGravity*o*s.options.mass;r[s.id].x=t*a,r[s.id].y=i*a}}}class FC{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}},me(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,Nr(["stabilization"],this.options,e),He(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());const t=this.options.wind;t&&((typeof t.x!="number"||Yd(t.x))&&(t.x=0),(typeof t.y!="number"||Yd(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}init(){let e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new qC(this.body,this.physicsBody,e),this.edgesSolver=new th(this.body,this.physicsBody,e),this.gravitySolver=new kC(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new RC(this.body,this.physicsBody,e),this.edgesSolver=new th(this.body,this.physicsBody,e),this.gravitySolver=new Vr(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new DC(this.body,this.physicsBody,e),this.edgesSolver=new MC(this.body,this.physicsBody,e),this.gravitySolver=new Vr(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new f_(this.body,this.physicsBody,e),this.edgesSolver=new th(this.body,this.physicsBody,e),this.gravitySolver=new Vr(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=D(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(){const e=Ir();this.physicsTick(),(Ir()-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)&&at(()=>{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=[];const e=this.body.nodes,t=this.body.edges;for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&e[i].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[i].id);for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&t[i].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(t[i].id);for(let i=0;i<this.physicsBody.physicsNodeIndices.length;i++){const r=this.physicsBody.physicsNodeIndices[i];this.physicsBody.forces[r]={x:0,y:0},this.physicsBody.velocities[r]===void 0&&(this.physicsBody.velocities[r]={x:0,y:0})}for(const i in this.physicsBody.velocities)e[i]===void 0&&delete this.physicsBody.velocities[i]}revert(){const e=ue(this.previousStates),t=this.body.nodes,i=this.physicsBody.velocities;this.referenceState={};for(let r=0;r<e.length;r++){const s=e[r];t[s]!==void 0?t[s].options.physics===!0&&(this.referenceState[s]={positions:{x:t[s].x,y:t[s].y}},i[s].x=this.previousStates[s].vx,i[s].y=this.previousStates[s].vy,t[s].x=this.previousStates[s].x,t[s].y=this.previousStates[s].y):delete this.previousStates[s]}}_evaluateStepQuality(){let e,t,i;const r=this.body.nodes,s=this.referenceState,o=.3;for(const a in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,a)&&r[a]!==void 0&&(e=r[a].x-s[a].positions.x,t=r[a].y-s[a].positions.y,i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),i>o))return!1;return!0}moveNodes(){const e=this.physicsBody.physicsNodeIndices;let t=0,i=0;const r=5;for(let s=0;s<e.length;s++){const o=e[s],a=this._performStep(o);t=Math.max(t,a),i+=a}this.adaptiveTimestepEnabled=i/e.length<r,this.stabilized=t<this.options.minVelocity}calculateComponentVelocity(e,t,i){const r=this.modelOptions.damping*e,s=(t-r)/i;e+=s*this.timestep;const o=this.options.maxVelocity||1e9;return Math.abs(e)>o&&(e=e>0?o:-o),e}_performStep(e){const t=this.body.nodes[e],i=this.physicsBody.forces[e];this.options.wind&&(i.x+=this.options.wind.x,i.y+=this.options.wind.y);const r=this.physicsBody.velocities[e];return this.previousStates[e]={x:t.x,y:t.y,vx:r.x,vy:r.y},t.options.fixed.x===!1?(r.x=this.calculateComponentVelocity(r.x,i.x,t.options.mass),t.x+=r.x*this.timestep):(i.x=0,r.x=0),t.options.fixed.y===!1?(r.y=this.calculateComponentVelocity(r.y,i.y,t.options.mass),t.y+=r.y*this.timestep):(i.y=0,r.y=0),Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))}_freezeNodes(){const e=this.body.nodes;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t].x&&e[t].y){const i=e[t].options.fixed;this.freezeCache[t]={x:i.x,y:i.y},i.x=!0,i.y=!0}}_restoreFrozenNodes(){const e=this.body.nodes;for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.freezeCache[t]!==void 0&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].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,at(()=>this._stabilizationBatch(),0)}_startStabilizing(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){const e=()=>this.stabilized===!1&&this.stabilizationIterations<this.targetIterations,t=()=>{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&t();let i=0;for(;e()&&i<this.options.stabilization.updateInterval;)this.physicsTick(),i++;if(t(),e()){var r;at(D(r=this._stabilizationBatch).call(r,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 t=0;t<this.physicsBody.physicsNodeIndices.length;t++){const i=this.physicsBody.physicsNodeIndices[t],r=this.body.nodes[i],s=this.physicsBody.forces[i],o=20,a=.03,d=Math.sqrt(Math.pow(s.x,2)+Math.pow(s.x,2)),l=Math.min(Math.max(5,d),15),h=3*l,u=gd((180-Math.min(1,Math.max(0,a*d))*180)/360,1,1),c={x:r.x+o*s.x,y:r.y+o*s.y};e.lineWidth=l,e.strokeStyle=u,e.beginPath(),e.moveTo(r.x,r.y),e.lineTo(c.x,c.y),e.stroke();const f=Math.atan2(s.y,s.x);e.fillStyle=u,r_.draw(e,{type:"arrow",point:c,angle:f,length:h}),Bi(e).call(e)}}}const Ie=[];for(let n=0;n<256;++n)Ie.push((n+256).toString(16).slice(1));function NC(n,e=0){return(Ie[n[e+0]]+Ie[n[e+1]]+Ie[n[e+2]]+Ie[n[e+3]]+"-"+Ie[n[e+4]]+Ie[n[e+5]]+"-"+Ie[n[e+6]]+Ie[n[e+7]]+"-"+Ie[n[e+8]]+Ie[n[e+9]]+"-"+Ie[n[e+10]]+Ie[n[e+11]]+Ie[n[e+12]]+Ie[n[e+13]]+Ie[n[e+14]]+Ie[n[e+15]]).toLowerCase()}let ih;const AC=new Uint8Array(16);function BC(){if(!ih){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ih=crypto.getRandomValues.bind(crypto)}return ih(AC)}var p_={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function zC(n,e,t){n=n||{};const i=n.random??n.rng?.()??BC();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,NC(i)}function ir(n,e,t){return p_.randomUUID&&!n?p_.randomUUID():zC(n)}class Re{constructor(){}static getRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=1e9,r=-1e9,s=1e9,o=-1e9,a;if(t.length>0)for(let d=0;d<t.length;d++)a=e[t[d]],s>a.shape.boundingBox.left&&(s=a.shape.boundingBox.left),o<a.shape.boundingBox.right&&(o=a.shape.boundingBox.right),i>a.shape.boundingBox.top&&(i=a.shape.boundingBox.top),r<a.shape.boundingBox.bottom&&(r=a.shape.boundingBox.bottom);return s===1e9&&o===-1e9&&i===1e9&&r===-1e9&&(i=0,r=0,s=0,o=0),{minX:s,maxX:o,minY:i,maxY:r}}static getRangeCore(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=1e9,r=-1e9,s=1e9,o=-1e9,a;if(t.length>0)for(let d=0;d<t.length;d++)a=e[t[d]],s>a.x&&(s=a.x),o<a.x&&(o=a.x),i>a.y&&(i=a.y),r<a.y&&(r=a.y);return s===1e9&&o===-1e9&&i===1e9&&r===-1e9&&(i=0,r=0,s=0,o=0),{minX:s,maxX:o,minY:i,maxY:r}}static findCenter(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}static cloneOptions(e,t){const i={};return t===void 0||t==="node"?(te(i,e.options,!0),i.x=e.x,i.y=e.y,i.amountOfConnections=e.edges.length):te(i,e.options,!0),i}}class LC extends de{constructor(e,t,i,r,s,o){super(e,t,i,r,s,o),this.isCluster=!0,this.containedNodes={},this.containedEdges={}}_openChildCluster(e){const t=this.body.nodes[e];if(this.containedNodes[e]===void 0)throw new Error("node with id: "+e+" not in current cluster");if(!t.isCluster)throw new Error("node with id: "+e+" is not a cluster");delete this.containedNodes[e],H(t.edges,i=>{delete this.containedEdges[i.id]}),H(t.containedNodes,(i,r)=>{this.containedNodes[r]=i}),t.containedNodes={},H(t.containedEdges,(i,r)=>{this.containedEdges[r]=i}),t.containedEdges={},H(t.edges,i=>{H(this.edges,r=>{var s,o;const a=J(s=r.clusteringEdgeReplacingIds).call(s,i.id);a!==-1&&(H(i.clusteringEdgeReplacingIds,d=>{r.clusteringEdgeReplacingIds.push(d),this.body.edges[d].edgeReplacedById=r.id}),ot(o=r.clusteringEdgeReplacingIds).call(o,a,1))})}),t.edges=[]}}class jC{constructor(e){this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},me(this.options,this.defaultOptions),this.body.emitter.on("_resetData",()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(e,t){e===void 0?e=this._getHubSize():typeof e=="object"&&(t=this._checkOptions(e),e=this._getHubSize());const i=[];for(let r=0;r<this.body.nodeIndices.length;r++){const s=this.body.nodes[this.body.nodeIndices[r]];s.edges.length>=e&&i.push(s.id)}for(let r=0;r<i.length;r++)this.clusterByConnection(i[r],t,!0);this.body.emitter.emit("_dataChanged")}cluster(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=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);const i={},r={};H(this.body.nodes,(s,o)=>{s.options&&e.joinCondition(s.options)===!0&&(i[o]=s,H(s.edges,a=>{this.clusteredEdges[a.id]===void 0&&(r[a.id]=a)}))}),this._cluster(i,r,e,t)}clusterByEdgeCount(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;t=this._checkOptions(t);const r=[],s={};let o,a,d;for(let l=0;l<this.body.nodeIndices.length;l++){const h={},u={},c=this.body.nodeIndices[l],f=this.body.nodes[c];if(s[c]===void 0){d=0,a=[];for(let p=0;p<f.edges.length;p++)o=f.edges[p],this.clusteredEdges[o.id]===void 0&&(o.toId!==o.fromId&&d++,a.push(o));if(d===e){const p=function(b){if(t.joinCondition===void 0||t.joinCondition===null)return!0;const m=Re.cloneOptions(b);return t.joinCondition(m)};let g=!0;for(let b=0;b<a.length;b++){o=a[b];const m=this._getConnectedId(o,c);if(p(f))u[o.id]=o,h[c]=f,h[m]=this.body.nodes[m],s[c]=!0;else{g=!1;break}}if(ue(h).length>0&&ue(u).length>0&&g===!0){const m=function(){for(let v=0;v<r.length;++v)for(const w in h)if(r[v].nodes[w]!==void 0)return r[v]}();if(m!==void 0){for(const v in h)m.nodes[v]===void 0&&(m.nodes[v]=h[v]);for(const v in u)m.edges[v]===void 0&&(m.edges[v]=u[v])}else r.push({nodes:h,edges:u})}}}}for(let l=0;l<r.length;l++)this._cluster(r[l].nodes,r[l].edges,t,!1);i===!0&&this.body.emitter.emit("_dataChanged")}clusterOutliers(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,t)}clusterBridges(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,t)}clusterByConnection(e,t){var i;let r=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!");const s=this.body.nodes[e];t=this._checkOptions(t,s),t.clusterNodeProperties.x===void 0&&(t.clusterNodeProperties.x=s.x),t.clusterNodeProperties.y===void 0&&(t.clusterNodeProperties.y=s.y),t.clusterNodeProperties.fixed===void 0&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=s.options.fixed.x,t.clusterNodeProperties.fixed.y=s.options.fixed.y);const o={},a={},d=s.id,l=Re.cloneOptions(s);o[d]=s;for(let u=0;u<s.edges.length;u++){const c=s.edges[u];if(this.clusteredEdges[c.id]===void 0){const f=this._getConnectedId(c,d);if(this.clusteredNodes[f]===void 0)if(f!==d)if(t.joinCondition===void 0)a[c.id]=c,o[f]=this.body.nodes[f];else{const p=Re.cloneOptions(this.body.nodes[f]);t.joinCondition(l,p)===!0&&(a[c.id]=c,o[f]=this.body.nodes[f])}else a[c.id]=c}}const h=ui(i=ue(o)).call(i,function(u){return o[u].id});for(const u in o){if(!Object.prototype.hasOwnProperty.call(o,u))continue;const c=o[u];for(let f=0;f<c.edges.length;f++){const p=c.edges[f];J(h).call(h,this._getConnectedId(p,c.id))>-1&&(a[p.id]=p)}}this._cluster(o,a,t,r)}_createClusterEdges(e,t,i,r){let s,o,a,d,l,h;const u=ue(e),c=[];for(let g=0;g<u.length;g++){o=u[g],a=e[o];for(let b=0;b<a.edges.length;b++)s=a.edges[b],this.clusteredEdges[s.id]===void 0&&(s.toId==s.fromId?t[s.id]=s:s.toId==o?(d=i.id,l=s.fromId,h=l):(d=s.toId,l=i.id,h=d),e[h]===void 0&&c.push({edge:s,fromId:l,toId:d}))}const f=[],p=function(g){for(let b=0;b<f.length;b++){const m=f[b],v=g.fromId===m.fromId&&g.toId===m.toId,w=g.fromId===m.toId&&g.toId===m.fromId;if(v||w)return m}return null};for(let g=0;g<c.length;g++){const b=c[g],m=b.edge;let v=p(b);v===null?(v=this._createClusteredEdge(b.fromId,b.toId,m,r),f.push(v)):v.clusteringEdgeReplacingIds.push(m.id),this.body.edges[m.id].edgeReplacedById=v.id,this._backupEdgeOptions(m),m.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,t,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;const s=[];for(const h in e)Object.prototype.hasOwnProperty.call(e,h)&&this.clusteredNodes[h]!==void 0&&s.push(h);for(let h=0;h<s.length;++h)delete e[s[h]];if(ue(e).length==0||ue(e).length==1&&i.clusterNodeProperties.allowSingleNodeCluster!=!0)return;let o=te({},i.clusterNodeProperties);if(i.processProperties!==void 0){const h=[];for(const c in e)if(Object.prototype.hasOwnProperty.call(e,c)){const f=Re.cloneOptions(e[c]);h.push(f)}const u=[];for(const c in t)if(Object.prototype.hasOwnProperty.call(t,c)&&c.substr(0,12)!=="clusterEdge:"){const f=Re.cloneOptions(t[c],"edge");u.push(f)}if(o=i.processProperties(o,h,u),!o)throw new Error("The processProperties function does not return properties!")}o.id===void 0&&(o.id="cluster:"+ir());const a=o.id;o.label===void 0&&(o.label="cluster");let d;o.x===void 0&&(d=this._getClusterPosition(e),o.x=d.x),o.y===void 0&&(d===void 0&&(d=this._getClusterPosition(e)),o.y=d.y),o.id=a;const l=this.body.functions.createNode(o,LC);l.containedNodes=e,l.containedEdges=t,l.clusterEdgeProperties=i.clusterEdgeProperties,this.body.nodes[o.id]=l,this._clusterEdges(e,t,o,i.clusterEdgeProperties),o.id=void 0,r===!0&&this.body.emitter.emit("_dataChanged")}_backupEdgeOptions(e){this.clusteredEdges[e.id]===void 0&&(this.clusteredEdges[e.id]={physics:e.options.physics})}_restoreEdge(e){const t=this.clusteredEdges[e.id];t!==void 0&&(e.setOptions({physics:t.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){const t=ue(e);let i=e[t[0]].x,r=e[t[0]].x,s=e[t[0]].y,o=e[t[0]].y,a;for(let d=1;d<t.length;d++)a=e[t[d]],i=a.x<i?a.x:i,r=a.x>r?a.x:r,s=a.y<s?a.y:s,o=a.y>o?a.y:o;return{x:.5*(i+r),y:.5*(s+o)}}openCluster(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");const r=this.body.nodes[e];if(r===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(r.isCluster!==!0||r.containedNodes===void 0||r.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");const s=this.findNode(e),o=J(s).call(s,e)-1;if(o>=0){const h=s[o];this.body.nodes[h]._openChildCluster(e),delete this.body.nodes[e],i===!0&&this.body.emitter.emit("_dataChanged");return}const a=r.containedNodes,d=r.containedEdges;if(t!==void 0&&t.releaseFunction!==void 0&&typeof t.releaseFunction=="function"){const h={},u={x:r.x,y:r.y};for(const f in a)if(Object.prototype.hasOwnProperty.call(a,f)){const p=this.body.nodes[f];h[f]={x:p.x,y:p.y}}const c=t.releaseFunction(u,h);for(const f in a)if(Object.prototype.hasOwnProperty.call(a,f)){const p=this.body.nodes[f];c[f]!==void 0&&(p.x=c[f].x===void 0?r.x:c[f].x,p.y=c[f].y===void 0?r.y:c[f].y)}}else H(a,function(h){h.options.fixed.x===!1&&(h.x=r.x),h.options.fixed.y===!1&&(h.y=r.y)});for(const h in a)if(Object.prototype.hasOwnProperty.call(a,h)){const u=this.body.nodes[h];u.vx=r.vx,u.vy=r.vy,u.setOptions({physics:!0}),delete this.clusteredNodes[h]}const l=[];for(let h=0;h<r.edges.length;h++)l.push(r.edges[h]);for(let h=0;h<l.length;h++){const u=l[h],c=this._getConnectedId(u,e),f=this.clusteredNodes[c];for(let p=0;p<u.clusteringEdgeReplacingIds.length;p++){const g=u.clusteringEdgeReplacingIds[p],b=this.body.edges[g];if(b!==void 0)if(f!==void 0){const m=this.body.nodes[f.clusterId];m.containedEdges[b.id]=b,delete d[b.id];let v=b.fromId,w=b.toId;b.toId==c?w=f.clusterId:v=f.clusterId,this._createClusteredEdge(v,w,b,m.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(b)}u.remove()}for(const h in d)Object.prototype.hasOwnProperty.call(d,h)&&this._restoreEdge(d[h]);delete this.body.nodes[e],i===!0&&this.body.emitter.emit("_dataChanged")}getNodesInCluster(e){const t=[];if(this.isCluster(e)===!0){const i=this.body.nodes[e].containedNodes;for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&t.push(this.body.nodes[r].id)}return t}findNode(e){const t=[];let r=0,s;for(;this.clusteredNodes[e]!==void 0&&r<100;){if(s=this.body.nodes[e],s===void 0)return[];t.push(s.id),e=this.clusteredNodes[e].clusterId,r++}return s=this.body.nodes[e],s===void 0?[]:(t.push(s.id),Rt(t).call(t),t)}updateClusteredNode(e,t){if(e===void 0)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(t===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(t),this.body.emitter.emit("_dataChanged")}updateEdge(e,t){if(e===void 0)throw new Error("No startEdgeId supplied to updateEdge.");if(t===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.");const i=this.getClusteredEdges(e);for(let r=0;r<i.length;r++)this.body.edges[i[r]].setOptions(t);this.body.emitter.emit("_dataChanged")}getClusteredEdges(e){const t=[];let r=0;for(;e!==void 0&&this.body.edges[e]!==void 0&&r<100;)t.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,r++;return Rt(t).call(t),t}getBaseEdge(e){return this.getBaseEdges(e)[0]}getBaseEdges(e){const t=[e],i=[],r=[],s=100;let o=0;for(;t.length>0&&o<s;){const a=t.pop();if(a===void 0)continue;const d=this.body.edges[a];if(d===void 0)continue;o++;const l=d.clusteringEdgeReplacingIds;if(l===void 0)r.push(a);else for(let h=0;h<l.length;++h){const u=l[h];J(t).call(t,l)!==-1||J(i).call(i,l)!==-1||t.push(u)}i.push(a)}return r}_getConnectedId(e,t){return e.toId!=t?e.toId:(e.fromId!=t,e.fromId)}_getHubSize(){let e=0,t=0,i=0,r=0;for(let d=0;d<this.body.nodeIndices.length;d++){const l=this.body.nodes[this.body.nodeIndices[d]];l.edges.length>r&&(r=l.edges.length),e+=l.edges.length,t+=Math.pow(l.edges.length,2),i+=1}e=e/i,t=t/i;const s=t-Math.pow(e,2),o=Math.sqrt(s);let a=Math.floor(e+2*o);return a>r&&(a=r),a}_createClusteredEdge(e,t,i,r,s){const o=Re.cloneOptions(i,"edge");te(o,r),o.from=e,o.to=t,o.id="clusterEdge:"+ir(),s!==void 0&&te(o,s);const a=this.body.functions.createEdge(o);return a.clusteringEdgeReplacingIds=[i.id],a.connect(),this.body.edges[a.id]=a,a}_clusterEdges(e,t,i,r){if(t instanceof It){const s=t,o={};o[s.id]=s,t=o}if(e instanceof de){const s=e,o={};o[s.id]=s,e=o}if(i==null)throw new Error("_clusterEdges: parameter clusterNode required");r===void 0&&(r=i.clusterEdgeProperties),this._createClusterEdges(e,t,i,r);for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&this.body.edges[s]!==void 0){const o=this.body.edges[s];this._backupEdgeOptions(o),o.setOptions({physics:!1})}for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(this.clusteredNodes[s]={clusterId:i.id,node:this.body.nodes[s]},this.body.nodes[s].setOptions({physics:!1}))}_getClusterNodeForNode(e){if(e===void 0)return;const t=this.clusteredNodes[e];if(t===void 0)return;const i=t.clusterId;if(i!==void 0)return this.body.nodes[i]}_filter(e,t){const i=[];return H(e,r=>{t(r)&&i.push(r)}),i}_updateState(){let e;const t=[],i={},r=d=>{H(this.body.nodes,l=>{l.isCluster===!0&&d(l)})};for(e in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,e))continue;this.body.nodes[e]===void 0&&t.push(e)}r(function(d){for(let l=0;l<t.length;l++)delete d.containedNodes[t[l]]});for(let d=0;d<t.length;d++)delete this.clusteredNodes[t[d]];H(this.clusteredEdges,d=>{const l=this.body.edges[d];(l===void 0||!l.endPointsValid())&&(i[d]=d)}),r(function(d){H(d.containedEdges,(l,h)=>{!l.endPointsValid()&&!i[h]&&(i[h]=h)})}),H(this.body.edges,(d,l)=>{let h=!0;const u=d.clusteringEdgeReplacingIds;if(u!==void 0){let c=0;H(u,f=>{const p=this.body.edges[f];p!==void 0&&p.endPointsValid()&&(c+=1)}),h=c>0}(!d.endPointsValid()||!h)&&(i[l]=l)}),r(d=>{H(i,l=>{delete d.containedEdges[l],H(d.edges,(h,u)=>{if(h.id===l){d.edges[u]=null;return}h.clusteringEdgeReplacingIds=this._filter(h.clusteringEdgeReplacingIds,function(c){return!i[c]})}),d.edges=this._filter(d.edges,function(h){return h!==null})})}),H(i,d=>{delete this.clusteredEdges[d]}),H(i,d=>{delete this.body.edges[d]});const s=ue(this.body.edges);H(s,d=>{const l=this.body.edges[d],h=this._isClusteredNode(l.fromId)||this._isClusteredNode(l.toId);if(h!==this._isClusteredEdge(l.id))if(h){const u=this._getClusterNodeForNode(l.fromId);u!==void 0&&this._clusterEdges(this.body.nodes[l.fromId],l,u);const c=this._getClusterNodeForNode(l.toId);c!==void 0&&this._clusterEdges(this.body.nodes[l.toId],l,c)}else delete this._clusterEdges[d],this._restoreEdge(l)});let o=!1,a=!0;for(;a;){const d=[];r(function(l){const h=ue(l.containedNodes).length,u=l.options.allowSingleNodeCluster===!0;(u&&h<1||!u&&h<2)&&d.push(l.id)});for(let l=0;l<d.length;++l)this.openCluster(d[l],{},!1);a=d.length>0,o=o||a}o&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}}class $C{constructor(e,t){this.body=e,this.canvas=t,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},me(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=at(()=>{var t;this.zooming=!1,D(t=this._requestRedraw).call(t,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",D(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&&wi(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,e)}_startRendering(){if(this.renderingActive===!0&&this.requestAnimationFrameRequestId===void 0){var e;this.requestAnimationFrameRequestId=window.requestAnimationFrame(D(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;const t={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();const i=this.canvas.getContext(),r=this.canvas.frame.canvas.clientWidth,s=this.canvas.frame.canvas.clientHeight;if(i.clearRect(0,0,r,s),this.canvas.frame.clientWidth===0)return;if(i.save(),i.translate(this.body.view.translation.x,this.body.view.translation.y),i.scale(this.body.view.scale,this.body.view.scale),i.beginPath(),this.body.emitter.emit("beforeDrawing",i),i.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(i),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){const{drawExternalLabels:o}=this._drawNodes(i,e);t.drawExternalLabels=o}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(i),t.drawExternalLabels!=null&&t.drawExternalLabels(),e===!1&&this._drawSelectionBox(i),i.beginPath(),this.body.emitter.emit("afterDrawing",i),i.closePath(),i.restore(),e===!0&&i.clearRect(0,0,r,s)}}_resizeNodes(){this.canvas.setTransform();const 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);const t=this.body.nodes;let i;for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i=t[r],i.resize(e),i.updateBoundingBox(e,i.selected));e.restore()}_drawNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.nodes,r=this.body.nodeIndices;let s;const o=[],a=[],d=20,l=this.canvas.DOMtoCanvas({x:-d,y:-d}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+d,y:this.canvas.frame.canvas.clientHeight+d}),u={top:l.y,left:l.x,bottom:h.y,right:h.x},c=[];for(let b=0;b<r.length;b++)if(s=i[r[b]],s.hover)a.push(r[b]);else if(s.isSelected())o.push(r[b]);else if(t===!0){const m=s.draw(e);m.drawExternalLabel!=null&&c.push(m.drawExternalLabel)}else if(s.isBoundingBoxOverlappingWith(u)===!0){const m=s.draw(e);m.drawExternalLabel!=null&&c.push(m.drawExternalLabel)}else s.updateBoundingBox(e,s.selected);let f;const p=o.length,g=a.length;for(f=0;f<p;f++){s=i[o[f]];const b=s.draw(e);b.drawExternalLabel!=null&&c.push(b.drawExternalLabel)}for(f=0;f<g;f++){s=i[a[f]];const b=s.draw(e);b.drawExternalLabel!=null&&c.push(b.drawExternalLabel)}return{drawExternalLabels:()=>{for(const b of c)b()}}}_drawEdges(e){const t=this.body.edges,i=this.body.edgeIndices;for(let r=0;r<i.length;r++){const s=t[i[r]];s.connected===!0&&s.draw(e)}}_drawArrows(e){const t=this.body.edges,i=this.body.edgeIndices;for(let r=0;r<i.length;r++){const s=t[i[r]];s.connected===!0&&s.drawArrows(e)}}_drawSelectionBox(e){if(this.body.selectionBox.show){e.beginPath();const t=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,i=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,t,i),e.fillStyle="rgba(151, 194, 252, 0.2)",e.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,t,i),e.strokeStyle="rgba(151, 194, 252, 1)",e.stroke()}else e.closePath()}}var rh,g_;function HC(){if(g_)return rh;g_=1,sm();var n=Z();return rh=n.setInterval,rh}var nh,v_;function WC(){return v_||(v_=1,nh=HC()),nh}var VC=WC(),UC=L(VC);function Ur(n,e){e.inputHandler=function(t){t.isFirst&&e(t)},n.on("hammer.input",e.inputHandler)}function m_(n,e){return e.inputHandler=function(t){t.isFinal&&e(t)},n.on("hammer.input",e.inputHandler)}class GC{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%"},me(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.once("resize",t=>{t.width!==0&&(this.body.view.translation.x=t.width*.5),t.height!==0&&(this.body.view.translation.y=t.height*.5)}),this.body.emitter.on("setSize",D(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&&wi(["width","height","autoResize"],this.options,e),this._cleanUp(),this.options.autoResize===!0){var t;if(window.ResizeObserver){const r=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")}),{frame:s}=this;r.observe(s),this._cleanupCallbacks.push(()=>{r.unobserve(s)})}else{const r=UC(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(()=>{clearInterval(r)})}const i=D(t=this._onResize).call(t,this);window.addEventListener("resize",i),this._cleanupCallbacks.push(()=>{window.removeEventListener("resize",i)})}}_cleanUp(){var e,t,i;Q(e=Rt(t=ot(i=this._cleanupCallbacks).call(i,0)).call(t)).call(e,r=>{try{r()}catch(s){console.error(s)}})}_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){const e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight;let i=this.cameraState.scale;e!=1&&t!=1?i=this.cameraState.scale*.5*(e+t):e!=1?i=this.cameraState.scale*e:t!=1&&(i=this.cameraState.scale*t),this.body.view.scale=i;const r=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),s={x:r.x-this.cameraState.position.x,y:r.y-this.cameraState.position.y};this.body.view.translation.x+=s.x*this.body.view.scale,this.body.view.translation.y+=s.y*this.body.view.scale}}_prepareValue(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(J(e).call(e,"%")!==-1||J(e).call(e,"px")!==-1)return e;if(J(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{const 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 _i(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:_i.DIRECTION_ALL}),Ur(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 _i(this.frame),m_(this.hammerFrame,e=>{this.body.eventListeners.onRelease(e)})}setSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);let i=!1;const r=this.frame.canvas.width,s=this.frame.canvas.height,o=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t)this._getCameraState(o),this.frame.style.width=e,this.frame.style.height=t,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=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},i=!0;else{const a=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),d=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==a||this.frame.canvas.height!==d)&&this._getCameraState(o),this.frame.canvas.width!==a&&(this.frame.canvas.width=a,i=!0),this.frame.canvas.height!==d&&(this.frame.canvas.height=d,i=!0)}return i===!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(r/this.pixelRatio),oldHeight:Math.round(s/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){const e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");let t=1;typeof window<"u"&&(t=window.devicePixelRatio||1);const i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){const 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 KC(n,e){const t=me({nodes:e,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},n??{});if(!he(t.nodes))throw new TypeError("Nodes has to be an array of ids.");if(t.nodes.length===0&&(t.nodes=e),!(typeof t.minZoomLevel=="number"&&t.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof t.maxZoomLevel=="number"&&t.minZoomLevel<=t.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return t}class YC{constructor(e,t){var i,r;this.body=e,this.canvas=t,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",D(i=this.fit).call(i,this)),this.body.emitter.on("animationFinished",()=>{this.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",D(r=this.releaseNode).call(r,this))}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}fit(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=KC(e,this.body.nodeIndices);const i=this.canvas.frame.canvas.clientWidth,r=this.canvas.frame.canvas.clientHeight;let s,o;if(i===0||r===0)o=1,s=Re.getRange(this.body.nodes,e.nodes);else if(t===!0){let l=0;for(const c in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,c)&&this.body.nodes[c].predefinedPosition===!0&&(l+=1);if(l>.5*this.body.nodeIndices.length){this.fit(e,!1);return}s=Re.getRange(this.body.nodes,e.nodes),o=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;const u=Math.min(i/600,r/600);o*=u}else{this.body.emitter.emit("_resizeNodes"),s=Re.getRange(this.body.nodes,e.nodes);const l=Math.abs(s.maxX-s.minX)*1.1,h=Math.abs(s.maxY-s.minY)*1.1,u=i/l,c=r/h;o=u<=c?u:c}o>e.maxZoomLevel?o=e.maxZoomLevel:o<e.minZoomLevel&&(o=e.minZoomLevel);const d={position:Re.findCenter(s),scale:o,animation:e.animation};this.moveTo(d)}focus(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){const i={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=i,t.lockedOnNode=e,this.moveTo(t)}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,!Lt(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,!Lt(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,!Lt(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,!Lt(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;const t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.position.x,y:t.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var r;this.viewFunction=D(r=this._lockedRedraw).call(r,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 s;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=D(s=this._transitionRedraw).call(s,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}_lockedRedraw(){const e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.x,y:t.y-e.y},r=this.body.view.translation,s={x:r.x+i.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:r.y+i.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=s}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;const t=yI[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var i;this.viewFunction=D(i=this._lockedRedraw).call(i,this),this.body.emitter.on("initRedraw",this.viewFunction)}this.body.emitter.emit("animationFinished")}}getScale(){return this.body.view.scale}getViewPosition(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}function y_(n){var e=n&&n.preventDefault||!1,t=n&&n.container||window,i={},r={keydown:{},keyup:{}},s={},o;for(o=97;o<=122;o++)s[String.fromCharCode(o)]={code:65+(o-97),shift:!1};for(o=65;o<=90;o++)s[String.fromCharCode(o)]={code:o,shift:!0};for(o=0;o<=9;o++)s[""+o]={code:48+o,shift:!1};for(o=1;o<=12;o++)s["F"+o]={code:111+o,shift:!1};for(o=0;o<=9;o++)s["num"+o]={code:96+o,shift:!1};s["num*"]={code:106,shift:!1},s["num+"]={code:107,shift:!1},s["num-"]={code:109,shift:!1},s["num/"]={code:111,shift:!1},s["num."]={code:110,shift:!1},s.left={code:37,shift:!1},s.up={code:38,shift:!1},s.right={code:39,shift:!1},s.down={code:40,shift:!1},s.space={code:32,shift:!1},s.enter={code:13,shift:!1},s.shift={code:16,shift:void 0},s.esc={code:27,shift:!1},s.backspace={code:8,shift:!1},s.tab={code:9,shift:!1},s.ctrl={code:17,shift:!1},s.alt={code:18,shift:!1},s.delete={code:46,shift:!1},s.pageup={code:33,shift:!1},s.pagedown={code:34,shift:!1},s["="]={code:187,shift:!1},s["-"]={code:189,shift:!1},s["]"]={code:221,shift:!1},s["["]={code:219,shift:!1};var a=function(h){l(h,"keydown")},d=function(h){l(h,"keyup")},l=function(h,u){if(r[u][h.keyCode]!==void 0){for(var c=r[u][h.keyCode],f=0;f<c.length;f++)(c[f].shift===void 0||c[f].shift==!0&&h.shiftKey==!0||c[f].shift==!1&&h.shiftKey==!1)&&c[f].fn(h);e==!0&&h.preventDefault()}};return i.bind=function(h,u,c){if(c===void 0&&(c="keydown"),s[h]===void 0)throw new Error("unsupported key: "+h);r[c][s[h].code]===void 0&&(r[c][s[h].code]=[]),r[c][s[h].code].push({fn:u,shift:s[h].shift})},i.bindAll=function(h,u){u===void 0&&(u="keydown");for(var c in s)s.hasOwnProperty(c)&&i.bind(c,h,u)},i.getKey=function(h){for(var u in s)if(s.hasOwnProperty(u)){if(h.shiftKey==!0&&s[u].shift==!0&&h.keyCode==s[u].code)return u;if(h.shiftKey==!1&&s[u].shift==!1&&h.keyCode==s[u].code)return u;if(h.keyCode==s[u].code&&u=="shift")return u}return"unknown key, currently not supported"},i.unbind=function(h,u,c){if(c===void 0&&(c="keydown"),s[h]===void 0)throw new Error("unsupported key: "+h);if(u!==void 0){var f=[],p=r[c][s[h].code];if(p!==void 0)for(var g=0;g<p.length;g++)p[g].fn==u&&p[g].shift==s[h].shift||f.push(r[c][s[h].code][g]);r[c][s[h].code]=f}else r[c][s[h].code]=[]},i.reset=function(){r={keydown:{},keyup:{}}},i.destroy=function(){r={keydown:{},keyup:{}},t.removeEventListener("keydown",a,!0),t.removeEventListener("keyup",d,!0)},t.addEventListener("keydown",a,!0),t.addEventListener("keyup",d,!0),i}class XC{constructor(e,t){this.body=e,this.canvas=t,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={};const e=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],t=["_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 o=0;o<e.length;o++){this.navigationDOM[e[o]]=document.createElement("div"),this.navigationDOM[e[o]].className="vis-button vis-"+e[o],this.navigationDOM.wrapper.appendChild(this.navigationDOM[e[o]]);const a=new _i(this.navigationDOM[e[o]]);if(t[o]==="_fit"){var i;Ur(a,D(i=this._fit).call(i,this))}else{var r;Ur(a,D(r=this.bindToRedraw).call(r,this,t[o]))}this.navigationHammers.push(a)}const s=new _i(this.canvas.frame);m_(s,()=>{this._stopMovement()}),this.navigationHammers.push(s),this.iconsCreated=!0}bindToRedraw(e){if(this.boundFunctions[e]===void 0){var t;this.boundFunctions[e]=D(t=this[e]).call(t,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(const 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(){const e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,r=t/e,s=(1-r)*this.canvas.canvasViewCenter.x+i.x*r,o=(1-r)*this.canvas.canvasViewCenter.y+i.y*r;this.body.view.scale=t,this.body.view.translation={x:s,y:o},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}_zoomOut(){const e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,r=t/e,s=(1-r)*this.canvas.canvasViewCenter.x+i.x*r,o=(1-r)*this.canvas.canvasViewCenter.y+i.y*r;this.body.view.scale=t,this.body.view.translation={x:s,y:o},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=y_({container:window,preventDefault:!0}):this.keycharm=y_({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var e,t,i,r,s,o,a,d,l,h,u,c,f,p,g,b,m,v,w,y,_,O,T,E;D(e=this.keycharm).call(e,"up",()=>{this.bindToRedraw("_moveUp")},"keydown"),D(t=this.keycharm).call(t,"down",()=>{this.bindToRedraw("_moveDown")},"keydown"),D(i=this.keycharm).call(i,"left",()=>{this.bindToRedraw("_moveLeft")},"keydown"),D(r=this.keycharm).call(r,"right",()=>{this.bindToRedraw("_moveRight")},"keydown"),D(s=this.keycharm).call(s,"=",()=>{this.bindToRedraw("_zoomIn")},"keydown"),D(o=this.keycharm).call(o,"num+",()=>{this.bindToRedraw("_zoomIn")},"keydown"),D(a=this.keycharm).call(a,"num-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),D(d=this.keycharm).call(d,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),D(l=this.keycharm).call(l,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),D(h=this.keycharm).call(h,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),D(u=this.keycharm).call(u,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),D(c=this.keycharm).call(c,"pagedown",()=>{this.bindToRedraw("_zoomOut")},"keydown"),D(f=this.keycharm).call(f,"up",()=>{this.unbindFromRedraw("_moveUp")},"keyup"),D(p=this.keycharm).call(p,"down",()=>{this.unbindFromRedraw("_moveDown")},"keyup"),D(g=this.keycharm).call(g,"left",()=>{this.unbindFromRedraw("_moveLeft")},"keyup"),D(b=this.keycharm).call(b,"right",()=>{this.unbindFromRedraw("_moveRight")},"keyup"),D(m=this.keycharm).call(m,"=",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),D(v=this.keycharm).call(v,"num+",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),D(w=this.keycharm).call(w,"num-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),D(y=this.keycharm).call(y,"-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),D(_=this.keycharm).call(_,"[",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),D(O=this.keycharm).call(O,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),D(T=this.keycharm).call(T,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),D(E=this.keycharm).call(E,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")}}}class ZC{constructor(e,t,i){var r,s,o,a,d,l,h,u,c,f,p,g,b;this.body=e,this.canvas=t,this.selectionHandler=i,this.navigationHandler=new XC(e,t),this.body.eventListeners.onTap=D(r=this.onTap).call(r,this),this.body.eventListeners.onTouch=D(s=this.onTouch).call(s,this),this.body.eventListeners.onDoubleTap=D(o=this.onDoubleTap).call(o,this),this.body.eventListeners.onHold=D(a=this.onHold).call(a,this),this.body.eventListeners.onDragStart=D(d=this.onDragStart).call(d,this),this.body.eventListeners.onDrag=D(l=this.onDrag).call(l,this),this.body.eventListeners.onDragEnd=D(h=this.onDragEnd).call(h,this),this.body.eventListeners.onMouseWheel=D(u=this.onMouseWheel).call(u,this),this.body.eventListeners.onPinch=D(c=this.onPinch).call(c,this),this.body.eventListeners.onMouseMove=D(f=this.onMouseMove).call(f,this),this.body.eventListeners.onRelease=D(p=this.onRelease).call(p,this),this.body.eventListeners.onContext=D(g=this.onContext).call(g,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=D(b=this.getPointer).call(b,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},me(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&&(Nr(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),He(this.options,e,"keyboard"),e.tooltip&&(me(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=pd(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-pI(this.canvas.frame.canvas),y:e.y-gI(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){const t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,i),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t)}onDoubleTap(e){const t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,t)}onHold(e){const t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,i),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t),this.selectionHandler.generateClickEvent("hold",e,t)}onRelease(e){if(new Date().valueOf()-this.touchTime>10){const t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,t),this.touchTime=new Date().valueOf()}}onContext(e){const t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,t)}checkSelectionChanges(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}_determineDifference(e,t){const i=function(r,s){const o=[];for(let a=0;a<r.length;a++){const d=r[a];J(s).call(s,d)===-1&&o.push(d)}return o};return{nodes:i(e.nodes,t.nodes),edges:i(e.edges,t.edges)}}onDragStart(e){if(this.drag.dragging)return;this.drag.pointer===void 0&&this.onTouch(e);const t=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=me({},this.body.view.translation),this.drag.nodeId=void 0,e.srcEvent.shiftKey){this.body.selectionBox.show=!0;const i=this.getPointer(e.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(i.x),y:this.canvas._YconvertDOMtoCanvas(i.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(i.x),y:this.canvas._YconvertDOMtoCanvas(i.y)}}else if(t!==void 0&&this.options.dragNodes===!0){this.drag.nodeId=t.id,t.isSelected()===!1&&this.selectionHandler.setSelection({nodes:[t.id]}),this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer);for(const i of this.selectionHandler.getSelectedNodes()){const r={id:i.id,node:i,x:i.x,y:i.y,xFixed:i.options.fixed.x,yFixed:i.options.fixed.y};i.options.fixed.x=!0,i.options.fixed.y=!0,this.drag.selection.push(r)}}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");const t=this.getPointer(e.center),i=this.drag.selection;if(i&&i.length&&this.options.dragNodes===!0){this.selectionHandler.generateClickEvent("dragging",e,t);const r=t.x-this.drag.pointer.x,s=t.y-this.drag.pointer.y;Q(i).call(i,o=>{const a=o.node;o.xFixed===!1&&(a.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(o.x)+r)),o.yFixed===!1&&(a.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(o.y)+s))}),this.body.emitter.emit("startSimulation")}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.emitter.emit("_requestRedraw")}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}const r=t.x-this.drag.pointer.x,s=t.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+r,y:this.drag.translation.y+s},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(e){if(this.drag.dragging=!1,this.body.selectionBox.show){var t;this.body.selectionBox.show=!1;const i=this.body.selectionBox.position,r={minX:Math.min(i.start.x,i.end.x),minY:Math.min(i.start.y,i.end.y),maxX:Math.max(i.start.x,i.end.x),maxY:Math.max(i.start.y,i.end.y)},s=Me(t=this.body.nodeIndices).call(t,a=>{const d=this.body.nodes[a];return d.x>=r.minX&&d.x<=r.maxX&&d.y>=r.minY&&d.y<=r.maxY});Q(s).call(s,a=>this.selectionHandler.selectObject(this.body.nodes[a]));const o=this.getPointer(e.center);this.selectionHandler.commitAndEmit(o,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{const i=this.drag.selection;i&&i.length?(Q(i).call(i,function(r){r.node.options.fixed.x=r.xFixed,r.node.options.fixed.y=r.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){const t=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);const i=this.pinch.scale*e.scale;this.zoom(i,t)}zoom(e,t){if(this.options.zoomView===!0){const i=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);let r;this.drag!==void 0&&this.drag.dragging===!0&&(r=this.canvas.DOMtoCanvas(this.drag.pointer));const s=this.body.view.translation,o=e/i,a=(1-o)*t.x+s.x*o,d=(1-o)*t.y+s.y*o;if(this.body.view.scale=e,this.body.view.translation={x:a,y:d},r!=null){const l=this.canvas.canvasToDOM(r);this.drag.pointer.x=l.x,this.drag.pointer.y=l.y}this.body.emitter.emit("_requestRedraw"),i<e?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:t}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:t})}}onMouseWheel(e){if(this.options.zoomView===!0){if(e.deltaY!==0){let t=this.body.view.scale;t*=1+(e.deltaY<0?1:-1)*(this.options.zoomSpeed*.1);const i=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(t,i)}e.preventDefault()}}onMouseMove(e){const t=this.getPointer({x:e.clientX,y:e.clientY});let i=!1;this.popup!==void 0&&(this.popup.hidden===!1&&this._checkHidePopup(t),this.popup.hidden===!1&&(i=!0,this.popup.setPosition(t.x+3,t.y-5),this.popup.show())),this.options.keyboard.autoFocus&&this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),i===!1&&(this.popupTimer!==void 0&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=at(()=>this._checkShowPopup(t),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,t)}_checkShowPopup(e){const t=this.canvas._XconvertDOMtoCanvas(e.x),i=this.canvas._YconvertDOMtoCanvas(e.y),r={left:t,top:i,right:t,bottom:i},s=this.popupObj===void 0?void 0:this.popupObj.id;let o=!1,a="node";if(this.popupObj===void 0){const d=this.body.nodeIndices,l=this.body.nodes;let h;const u=[];for(let c=0;c<d.length;c++)h=l[d[c]],h.isOverlappingWith(r)===!0&&(o=!0,h.getTitle()!==void 0&&u.push(d[c]));u.length>0&&(this.popupObj=l[u[u.length-1]],o=!0)}if(this.popupObj===void 0&&o===!1){const d=this.body.edgeIndices,l=this.body.edges;let h;const u=[];for(let c=0;c<d.length;c++)h=l[d[c]],h.isOverlappingWith(r)===!0&&h.connected===!0&&h.getTitle()!==void 0&&u.push(d[c]);u.length>0&&(this.popupObj=l[u[u.length-1]],a="edge")}this.popupObj!==void 0?this.popupObj.id!==s&&(this.popup===void 0&&(this.popup=new TI(this.canvas.frame)),this.popup.popupTargetType=a,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){const t=this.selectionHandler._pointerToPositionObject(e);let i=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),i===!0)){const r=this.selectionHandler.getNodeAt(e);i=r===void 0?!1:r.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));i===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}var b_={},w_={},__;function JC(){if(__)return w_;__=1;var n=qd(),e=ky();return n("Set",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},e),w_}var E_;function QC(){return E_||(E_=1,JC()),b_}var S_={},sh,O_;function $t(){if(O_)return sh;O_=1;var n=ti(),e=TypeError;return sh=function(t){if(typeof t=="object"&&"size"in t&&"has"in t&&"add"in t&&"delete"in t&&"keys"in t)return t;throw new e(n(t)+" is not a set")},sh}var oh,I_;function Ht(){if(I_)return oh;I_=1;var n=Ne(),e=zy(),t=n("Set"),i=t.prototype;return oh={Set:t,add:e("add",1),has:e("has",1),remove:e("delete",1),proto:i},oh}var ah,T_;function Wt(){if(T_)return ah;T_=1;var n=De();return ah=function(e,t,i){for(var r=i?e:e.iterator,s=e.next,o,a;!(o=n(s,r)).done;)if(a=t(o.value),a!==void 0)return a},ah}var dh,P_;function rr(){if(P_)return dh;P_=1;var n=Wt();return dh=function(e,t,i){return i?n(e.keys(),t,!0):e.forEach(t)},dh}var lh,C_;function hh(){if(C_)return lh;C_=1;var n=Ht(),e=rr(),t=n.Set,i=n.add;return lh=function(r){var s=new t;return e(r,function(o){i(s,o)}),s},lh}var uh,x_;function nr(){return x_||(x_=1,uh=function(n){return n.size}),uh}var ch,R_;function ex(){return R_||(R_=1,ch=function(n){return{iterator:n,next:n.next,done:!1}}),ch}var fh,D_;function Vt(){if(D_)return fh;D_=1;var n=nt(),e=Je(),t=De(),i=si(),r=ex(),s="Invalid size",o=RangeError,a=TypeError,d=Math.max,l=function(h,u){this.set=h,this.size=d(u,0),this.has=n(h.has),this.keys=n(h.keys)};return l.prototype={getIterator:function(){return r(e(t(this.keys,this.set)))},includes:function(h){return t(this.has,this.set,h)}},fh=function(h){e(h);var u=+h.size;if(u!==u)throw new a(s);var c=i(u);if(c<0)throw new o(s);return new l(h,c)},fh}var ph,M_;function tx(){if(M_)return ph;M_=1;var n=$t(),e=Ht(),t=hh(),i=nr(),r=Vt(),s=rr(),o=Wt(),a=e.has,d=e.remove;return ph=function(h){var u=n(this),c=r(h),f=t(u);return i(u)<=c.size?s(u,function(p){c.includes(p)&&d(f,p)}):o(c.getIterator(),function(p){a(f,p)&&d(f,p)}),f},ph}var gh,q_;function Ut(){return q_||(q_=1,gh=function(){return!1}),gh}var k_;function ix(){if(k_)return S_;k_=1;var n=B(),e=tx(),t=U(),i=Ut(),r=!i("difference",function(o){return o.size===0}),s=r||t(function(){var o={size:1,has:function(){return!0},keys:function(){var d=0;return{next:function(){var l=d++>1;return a.has(1)&&a.clear(),{done:l,value:2}}}}},a=new Set([1,2,3,4]);return a.difference(o).size!==3});return n({target:"Set",proto:!0,real:!0,forced:s},{difference:e}),S_}var F_={},vh,N_;function rx(){if(N_)return vh;N_=1;var n=$t(),e=Ht(),t=nr(),i=Vt(),r=rr(),s=Wt(),o=e.Set,a=e.add,d=e.has;return vh=function(h){var u=n(this),c=i(h),f=new o;return t(u)>c.size?s(c.getIterator(),function(p){d(u,p)&&a(f,p)}):r(u,function(p){c.includes(p)&&a(f,p)}),f},vh}var A_;function nx(){if(A_)return F_;A_=1;var n=B(),e=U(),t=rx(),i=Ut(),r=!i("intersection",function(s){return s.size===2&&s.has(1)&&s.has(2)})||e(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});return n({target:"Set",proto:!0,real:!0,forced:r},{intersection:t}),F_}var B_={},mh,z_;function sx(){if(z_)return mh;z_=1;var n=$t(),e=Ht().has,t=nr(),i=Vt(),r=rr(),s=Wt(),o=Cd();return mh=function(d){var l=n(this),h=i(d);if(t(l)<=h.size)return r(l,function(c){if(h.includes(c))return!1},!0)!==!1;var u=h.getIterator();return s(u,function(c){if(e(l,c))return o(u,"normal",!1)})!==!1},mh}var L_;function ox(){if(L_)return B_;L_=1;var n=B(),e=sx(),t=Ut(),i=!t("isDisjointFrom",function(r){return!r});return n({target:"Set",proto:!0,real:!0,forced:i},{isDisjointFrom:e}),B_}var j_={},yh,$_;function ax(){if($_)return yh;$_=1;var n=$t(),e=nr(),t=rr(),i=Vt();return yh=function(s){var o=n(this),a=i(s);return e(o)>a.size?!1:t(o,function(d){if(!a.includes(d))return!1},!0)!==!1},yh}var H_;function dx(){if(H_)return j_;H_=1;var n=B(),e=ax(),t=Ut(),i=!t("isSubsetOf",function(r){return r});return n({target:"Set",proto:!0,real:!0,forced:i},{isSubsetOf:e}),j_}var W_={},bh,V_;function lx(){if(V_)return bh;V_=1;var n=$t(),e=Ht().has,t=nr(),i=Vt(),r=Wt(),s=Cd();return bh=function(a){var d=n(this),l=i(a);if(t(d)<l.size)return!1;var h=l.getIterator();return r(h,function(u){if(!e(d,u))return s(h,"normal",!1)})!==!1},bh}var U_;function hx(){if(U_)return W_;U_=1;var n=B(),e=lx(),t=Ut(),i=!t("isSupersetOf",function(r){return!r});return n({target:"Set",proto:!0,real:!0,forced:i},{isSupersetOf:e}),W_}var G_={},wh,K_;function ux(){if(K_)return wh;K_=1;var n=$t(),e=Ht(),t=hh(),i=Vt(),r=Wt(),s=e.add,o=e.has,a=e.remove;return wh=function(l){var h=n(this),u=i(l).getIterator(),c=t(h);return r(u,function(f){o(h,f)?a(c,f):s(c,f)}),c},wh}var _h,Y_;function X_(){return Y_||(Y_=1,_h=function(n){try{var e=new Set,t={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return e.clear(),e.add(4),function(){return{done:!0}}}})}},i=e[n](t);return i.size===1&&i.values().next().value===4}catch{return!1}}),_h}var Z_;function cx(){if(Z_)return G_;Z_=1;var n=B(),e=ux(),t=X_(),i=Ut(),r=!i("symmetricDifference")||!t("symmetricDifference");return n({target:"Set",proto:!0,real:!0,forced:r},{symmetricDifference:e}),G_}var J_={},Eh,Q_;function fx(){if(Q_)return Eh;Q_=1;var n=$t(),e=Ht().add,t=hh(),i=Vt(),r=Wt();return Eh=function(o){var a=n(this),d=i(o).getIterator(),l=t(a);return r(d,function(h){e(l,h)}),l},Eh}var e0;function px(){if(e0)return J_;e0=1;var n=B(),e=fx(),t=X_(),i=Ut(),r=!i("union")||!t("union");return n({target:"Set",proto:!0,real:!0,forced:r},{union:e}),J_}var Sh,t0;function gx(){if(t0)return Sh;t0=1,li(),QC(),ix(),nx(),ox(),dx(),hx(),cx(),px(),jd();var n=Z();return Sh=n.Set,Sh}var Oh,i0;function vx(){if(i0)return Oh;i0=1;var n=gx();return hi(),Oh=n,Oh}var Ih,r0;function mx(){return r0||(r0=1,Ih=vx()),Ih}var yx=mx(),Tt=L(yx),n0={},s0={},Th,o0;function bx(){if(o0)return Th;o0=1;var n=G(),e=Fd(),t=zr().getWeakData,i=Dd(),r=Je(),s=Jt(),o=_e(),a=Lr(),d=ft(),l=Se(),h=xt(),u=h.set,c=h.getterFor,f=d.find,p=d.findIndex,g=n([].splice),b=0,m=function(y){return y.frozen||(y.frozen=new v)},v=function(){this.entries=[]},w=function(y,_){return f(y.entries,function(O){return O[0]===_})};return v.prototype={get:function(y){var _=w(this,y);if(_)return _[1]},has:function(y){return!!w(this,y)},set:function(y,_){var O=w(this,y);O?O[1]=_:this.entries.push([y,_])},delete:function(y){var _=p(this.entries,function(O){return O[0]===y});return~_&&g(this.entries,_,1),!!~_}},Th={getConstructor:function(y,_,O,T){var E=y(function(x,C){i(x,I),u(x,{type:_,id:b++,frozen:null}),s(C)||a(C,x[T],{that:x,AS_ENTRIES:O})}),I=E.prototype,P=c(_),M=function(x,C,k){var N=P(x),W=t(r(C),!0);return W===!0?m(N).set(C,k):W[N.id]=k,x};return e(I,{delete:function(x){var C=P(this);if(!o(x))return!1;var k=t(x);return k===!0?m(C).delete(x):k&&l(k,C.id)&&delete k[C.id]},has:function(C){var k=P(this);if(!o(C))return!1;var N=t(C);return N===!0?m(k).has(C):N&&l(N,k.id)}}),e(I,O?{get:function(C){var k=P(this);if(o(C)){var N=t(C);if(N===!0)return m(k).get(C);if(N)return N[k.id]}},set:function(C,k){return M(this,C,k)}}:{add:function(C){return M(this,C,!0)}}),E}},Th}var a0;function wx(){if(a0)return s0;a0=1;var n=_y(),e=ae(),t=G(),i=Fd(),r=zr(),s=qd(),o=bx(),a=_e(),d=xt().enforce,l=U(),h=wf(),u=Object,c=Array.isArray,f=u.isExtensible,p=u.isFrozen,g=u.isSealed,b=u.freeze,m=u.seal,v=!e.ActiveXObject&&"ActiveXObject"in e,w,y=function(x){return function(){return x(this,arguments.length?arguments[0]:void 0)}},_=s("WeakMap",y,o),O=_.prototype,T=t(O.set),E=function(){return n&&l(function(){var x=b([]);return T(new _,x,1),!p(x)})};if(h)if(v){w=o.getConstructor(y,"WeakMap",!0),r.enable();var I=t(O.delete),P=t(O.has),M=t(O.get);i(O,{delete:function(x){if(a(x)&&!f(x)){var C=d(this);return C.frozen||(C.frozen=new w),I(this,x)||C.frozen.delete(x)}return I(this,x)},has:function(C){if(a(C)&&!f(C)){var k=d(this);return k.frozen||(k.frozen=new w),P(this,C)||k.frozen.has(C)}return P(this,C)},get:function(C){if(a(C)&&!f(C)){var k=d(this);return k.frozen||(k.frozen=new w),P(this,C)?M(this,C):k.frozen.get(C)}return M(this,C)},set:function(C,k){if(a(C)&&!f(C)){var N=d(this);N.frozen||(N.frozen=new w),P(this,C)?T(this,C,k):N.frozen.set(C,k)}else T(this,C,k);return this}})}else E()&&i(O,{set:function(C,k){var N;return c(C)&&(p(C)?N=b:g(C)&&(N=m)),T(this,C,k),N&&N(C),this}});return s0}var d0;function _x(){return d0||(d0=1,wx()),n0}var Ph,l0;function Ex(){if(l0)return Ph;l0=1,li(),_x();var n=Z();return Ph=n.WeakMap,Ph}var Ch,h0;function Sx(){if(h0)return Ch;h0=1;var n=Ex();return hi(),Ch=n,Ch}var xh,u0;function Ox(){return u0||(u0=1,xh=Sx()),xh}var Ix=Ox(),sr=L(Ix);function or(n,e,t){Tx(n,e),e.set(n,t)}function Tx(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Rh(n,e,t){return n.set(c0(n,e),t),t}function re(n,e){return n.get(c0(n,e))}function c0(n,e,t){if(typeof n=="function"?n===e:n.has(e))return arguments.length<3?e:t;throw new TypeError("Private element is not present on this object")}function f0(n,e){const t=new Tt;for(const i of e)n.has(i)||t.add(i);return t}var Ii=new sr,Ye=new sr;class p0{constructor(){or(this,Ii,new Tt),or(this,Ye,new Tt)}get size(){return re(Ye,this).size}add(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(const r of t)re(Ye,this).add(r)}delete(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(const r of t)re(Ye,this).delete(r)}clear(){re(Ye,this).clear()}getSelection(){return[...re(Ye,this)]}getChanges(){return{added:[...f0(re(Ii,this),re(Ye,this))],deleted:[...f0(re(Ye,this),re(Ii,this))],previous:[...new Tt(re(Ii,this))],current:[...new Tt(re(Ye,this))]}}commit(){const e=this.getChanges();Rh(Ii,this,re(Ye,this)),Rh(Ye,this,new Tt(re(Ii,this)));for(const t of e.added)t.select();for(const t of e.deleted)t.unselect();return e}}var Gt=new sr,Kt=new sr,Dh=new sr;class Px{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};or(this,Gt,new p0),or(this,Kt,new p0),or(this,Dh,void 0),Rh(Dh,this,e)}get sizeNodes(){return re(Gt,this).size}get sizeEdges(){return re(Kt,this).size}getNodes(){return re(Gt,this).getSelection()}getEdges(){return re(Kt,this).getSelection()}addNodes(){re(Gt,this).add(...arguments)}addEdges(){re(Kt,this).add(...arguments)}deleteNodes(e){re(Gt,this).delete(e)}deleteEdges(e){re(Kt,this).delete(e)}clear(){re(Gt,this).clear(),re(Kt,this).clear()}commit(){const e={nodes:re(Gt,this).commit(),edges:re(Kt,this).commit()};for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return re(Dh,this).call(this,e,...i),e}}class Cx{constructor(e,t){this.body=e,this.canvas=t,this._selectionAccumulator=new Px,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},me(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",()=>{this.updateSelection()})}setOptions(e){e!==void 0&&wi(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,e)}selectOnPoint(e){let t=!1;if(this.options.selectable===!0){const i=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),i!==void 0&&(t=this.selectObject(i)),this.body.emitter.emit("_requestRedraw")}return t}selectAdditionalOnPoint(e){let t=!1;if(this.options.selectable===!0){const i=this.getNodeAt(e)||this.getEdgeAt(e);i!==void 0&&(t=!0,i.isSelected()===!0?this.deselectObject(i):this.selectObject(i),this.body.emitter.emit("_requestRedraw"))}return t}_initBaseEvent(e,t){const i={};return i.pointer={DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},i.event=e,i}generateClickEvent(e,t,i,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;const o=this._initBaseEvent(t,i);if(s===!0)o.nodes=[],o.edges=[];else{const a=this.getSelection();o.nodes=a.nodes,o.edges=a.edges}r!==void 0&&(o.previousSelection=r),e=="click"&&(o.items=this.getClickedItems(i)),t.controlEdge!==void 0&&(o.controlEdge=t.controlEdge),this.body.emitter.emit(e,o)}selectObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return e!==void 0?(e instanceof de?(t===!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){const t=[],i=this.body.nodes;for(let r=0;r<this.body.nodeIndices.length;r++){const s=this.body.nodeIndices[r];i[s].isOverlappingWith(e)&&t.push(s)}return t}_pointerToPositionObject(e){const t=this.canvas.DOMtoCanvas(e);return{left:t.x-1,top:t.y+1,right:t.x+1,bottom:t.y-1}}getNodeAt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const i=this._pointerToPositionObject(e),r=this._getAllNodesOverlappingWith(i);if(r.length>0)return t===!0?this.body.nodes[r[r.length-1]]:r[r.length-1]}_getEdgesOverlappingWith(e,t){const i=this.body.edges;for(let r=0;r<this.body.edgeIndices.length;r++){const s=this.body.edgeIndices[r];i[s].isOverlappingWith(e)&&t.push(s)}}_getAllEdgesOverlappingWith(e){const t=[];return this._getEdgesOverlappingWith(e,t),t}getEdgeAt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const i=this.canvas.DOMtoCanvas(e);let r=10,s=null;const o=this.body.edges;for(let a=0;a<this.body.edgeIndices.length;a++){const d=this.body.edgeIndices[a],l=o[d];if(l.connected){const h=l.from.x,u=l.from.y,c=l.to.x,f=l.to.y,p=l.edgeType.getDistanceToEdge(h,u,c,f,i.x,i.y);p<r&&(s=d,r=p)}}if(s!==null)return t===!0?this.body.edges[s]:s}_addToHover(e){e instanceof de?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}_removeFromSelection(e){e instanceof de?(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 t=0;t<e.edges.length;t++){const i=e.edges[t];i.hover=!0,this._addToHover(i)}}emitBlurEvent(e,t,i){const r=this._initBaseEvent(e,t);i.hover===!0&&(i.hover=!1,i instanceof de?(r.node=i.id,this.body.emitter.emit("blurNode",r)):(r.edge=i.id,this.body.emitter.emit("blurEdge",r)))}emitHoverEvent(e,t,i){const r=this._initBaseEvent(e,t);let s=!1;return i.hover===!1&&(i.hover=!0,this._addToHover(i),s=!0,i instanceof de?(r.node=i.id,this.body.emitter.emit("hoverNode",r)):(r.edge=i.id,this.body.emitter.emit("hoverEdge",r))),s}hoverObject(e,t){let i=this.getNodeAt(t);i===void 0&&(i=this.getEdgeAt(t));let r=!1;for(const s in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,s)&&(i===void 0||i instanceof de&&i.id!=s||i instanceof It)&&(this.emitBlurEvent(e,t,this.hoverObj.nodes[s]),delete this.hoverObj.nodes[s],r=!0);for(const s in this.hoverObj.edges)Object.prototype.hasOwnProperty.call(this.hoverObj.edges,s)&&(r===!0?(this.hoverObj.edges[s].hover=!1,delete this.hoverObj.edges[s]):(i===void 0||i instanceof It&&i.id!=s||i instanceof de&&!i.hover)&&(this.emitBlurEvent(e,t,this.hoverObj.edges[s]),delete this.hoverObj.edges[s],r=!0));if(i!==void 0){const s=ue(this.hoverObj.edges).length,o=ue(this.hoverObj.nodes).length,a=i instanceof It&&s===0&&o===0,d=i instanceof de&&s===0&&o===0;(r||a||d)&&(r=this.emitHoverEvent(e,t,i)),i instanceof de&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(i)}r===!0&&this.body.emitter.emit("_requestRedraw")}commitWithoutEmitting(){this._selectionAccumulator.commit()}commitAndEmit(e,t){let i=!1;const r=this._selectionAccumulator.commit(),s={nodes:r.nodes.previous,edges:r.edges.previous};r.edges.deleted.length>0&&(this.generateClickEvent("deselectEdge",t,e,s),i=!0),r.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,e,s),i=!0),r.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,e),i=!0),r.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,e),i=!0),i===!0&&this.generateClickEvent("select",t,e)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var e;return ui(e=this._selectionAccumulator.getNodes()).call(e,t=>t.id)}getSelectedEdgeIds(){var e;return ui(e=this._selectionAccumulator.getEdges()).call(e,t=>t.id)}setSelection(e){let t=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((t.unselectAll||t.unselectAll===void 0)&&this.unselectAll(),e.nodes)for(const i of e.nodes){const r=this.body.nodes[i];if(!r)throw new RangeError('Node with id "'+i+'" not found');this.selectObject(r,t.highlightEdges)}if(e.edges)for(const i of e.edges){const r=this.body.edges[i];if(!r)throw new RangeError('Edge with id "'+i+'" not found');this.selectObject(r)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(e){let t=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:t})}selectEdges(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}updateSelection(){for(const e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(const e in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,e.id)||this._selectionAccumulator.deleteEdges(e)}getClickedItems(e){const t=this.canvas.DOMtoCanvas(e),i=[],r=this.body.nodeIndices,s=this.body.nodes;for(let d=r.length-1;d>=0;d--){const h=s[r[d]].getItemsOnPoint(t);i.push.apply(i,h)}const o=this.body.edgeIndices,a=this.body.edges;for(let d=o.length-1;d>=0;d--){const h=a[o[d]].getItemsOnPoint(t);i.push.apply(i,h)}return i}}var g0={},Mh,v0;function xx(){if(v0)return Mh;v0=1;var n=oi(),e=Math.floor,t=function(i,r){var s=i.length;if(s<8)for(var o=1,a,d;o<s;){for(d=o,a=i[o];d&&r(i[d-1],a)>0;)i[d]=i[--d];d!==o++&&(i[d]=a)}else for(var l=e(s/2),h=t(n(i,0,l),r),u=t(n(i,l),r),c=h.length,f=u.length,p=0,g=0;p<c||g<f;)i[p+g]=p<c&&g<f?r(h[p],u[g])<=0?h[p++]:u[g++]:p<c?h[p++]:u[g++];return i};return Mh=t,Mh}var qh,m0;function Rx(){if(m0)return qh;m0=1;var n=Qt(),e=n.match(/firefox\/(\d+)/i);return qh=!!e&&+e[1],qh}var kh,y0;function Dx(){if(y0)return kh;y0=1;var n=Qt();return kh=/MSIE|Trident/.test(n),kh}var Fh,b0;function Mx(){if(b0)return Fh;b0=1;var n=Qt(),e=n.match(/AppleWebKit\/(\d+)\./);return Fh=!!e&&+e[1],Fh}var w0;function qx(){if(w0)return g0;w0=1;var n=B(),e=G(),t=nt(),i=Ae(),r=st(),s=kg(),o=ze(),a=U(),d=xx(),l=ci(),h=Rx(),u=Dx(),c=Ri(),f=Mx(),p=[],g=e(p.sort),b=e(p.push),m=a(function(){p.sort(void 0)}),v=a(function(){p.sort(null)}),w=l("sort"),y=!a(function(){if(c)return c<70;if(!(h&&h>3)){if(u)return!0;if(f)return f<603;var T="",E,I,P,M;for(E=65;E<76;E++){switch(I=String.fromCharCode(E),E){case 66:case 69:case 70:case 72:P=3;break;case 68:case 71:P=4;break;default:P=2}for(M=0;M<47;M++)p.push({k:I+M,v:P})}for(p.sort(function(x,C){return C.v-x.v}),M=0;M<p.length;M++)I=p[M].k.charAt(0),T.charAt(T.length-1)!==I&&(T+=I);return T!=="DGBEFHACIJK"}}),_=m||!v||!w||!y,O=function(T){return function(E,I){return I===void 0?-1:E===void 0?1:T!==void 0?+T(E,I)||0:o(E)>o(I)?1:-1}};return n({target:"Array",proto:!0,forced:_},{sort:function(E){E!==void 0&&t(E);var I=i(this);if(y)return E===void 0?g(I):g(I,E);var P=[],M=r(I),x,C;for(C=0;C<M;C++)C in I&&b(P,I[C]);for(d(P,O(E)),x=r(P),C=0;C<x;)I[C]=P[C++];for(;C<M;)s(I,C++);return I}}),g0}var Nh,_0;function kx(){if(_0)return Nh;_0=1,qx();var n=Oe();return Nh=n("Array","sort"),Nh}var Ah,E0;function Fx(){if(E0)return Ah;E0=1;var n=ge(),e=kx(),t=Array.prototype;return Ah=function(i){var r=i.sort;return i===t||n(t,i)&&r===t.sort?e:r},Ah}var Bh,S0;function Nx(){if(S0)return Bh;S0=1;var n=Fx();return Bh=n,Bh}var zh,O0;function Ax(){return O0||(O0=1,zh=Nx()),zh}var Bx=Ax(),Ti=L(Bx),I0={},Lh,T0;function zx(){if(T0)return Lh;T0=1;var n=nt(),e=Ae(),t=pr(),i=st(),r=TypeError,s="Reduce of empty array with no initial value",o=function(a){return function(d,l,h,u){var c=e(d),f=t(c),p=i(c);if(n(l),p===0&&h<2)throw new r(s);var g=a?p-1:0,b=a?-1:1;if(h<2)for(;;){if(g in f){u=f[g],g+=b;break}if(g+=b,a?g<0:p<=g)throw new r(s)}for(;a?g>=0:p>g;g+=b)g in f&&(u=l(u,f[g],g,c));return u}};return Lh={left:o(!1),right:o(!0)},Lh}var jh,P0;function Lx(){if(P0)return jh;P0=1;var n=Zv();return jh=n==="NODE",jh}var C0;function jx(){if(C0)return I0;C0=1;var n=B(),e=zx().left,t=ci(),i=Ri(),r=Lx(),s=!r&&i>79&&i<83,o=s||!t("reduce");return n({target:"Array",proto:!0,forced:o},{reduce:function(d){var l=arguments.length;return e(this,d,l,l>1?arguments[1]:void 0)}}),I0}var $h,x0;function $x(){if(x0)return $h;x0=1,jx();var n=Oe();return $h=n("Array","reduce"),$h}var Hh,R0;function Hx(){if(R0)return Hh;R0=1;var n=ge(),e=$x(),t=Array.prototype;return Hh=function(i){var r=i.reduce;return i===t||n(t,i)&&r===t.reduce?e:r},Hh}var Wh,D0;function Wx(){if(D0)return Wh;D0=1;var n=Hx();return Wh=n,Wh}var Vh,M0;function Vx(){return M0||(M0=1,Vh=Wx()),Vh}var Ux=Vx(),q0=L(Ux);class k0{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,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,t,i),this.abstract()}getTreeSize(e){return this.fake_use(e),this.abstract()}sort(e){this.fake_use(e),this.abstract()}fix(e,t){this.fake_use(e,t),this.abstract()}shift(e,t){this.fake_use(e,t),this.abstract()}}class Gx extends k0{constructor(e){super(),this.layout=e}curveType(){return"horizontal"}getPosition(e){return e.x}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;i!==void 0&&this.layout.hierarchical.addToOrdering(e,i),e.x=t}getTreeSize(e){const t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_x,max:t.max_x}}sort(e){Ti(e).call(e,function(t,i){return t.x-i.x})}fix(e,t){e.y=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.y=!0}shift(e,t){this.layout.body.nodes[e].x+=t}}class Kx extends k0{constructor(e){super(),this.layout=e}curveType(){return"vertical"}getPosition(e){return e.y}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;i!==void 0&&this.layout.hierarchical.addToOrdering(e,i),e.y=t}getTreeSize(e){const t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_y,max:t.max_y}}sort(e){Ti(e).call(e,function(t,i){return t.y-i.y})}fix(e,t){e.x=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.x=!0}shift(e,t){this.layout.body.nodes[e].y+=t}}var F0={},N0;function Yx(){if(N0)return F0;N0=1;var n=B(),e=ft().every,t=ci(),i=t("every");return n({target:"Array",proto:!0,forced:!i},{every:function(s){return e(this,s,arguments.length>1?arguments[1]:void 0)}}),F0}var Uh,A0;function Xx(){if(A0)return Uh;A0=1,Yx();var n=Oe();return Uh=n("Array","every"),Uh}var Gh,B0;function Zx(){if(B0)return Gh;B0=1;var n=ge(),e=Xx(),t=Array.prototype;return Gh=function(i){var r=i.every;return i===t||n(t,i)&&r===t.every?e:r},Gh}var Kh,z0;function Jx(){if(z0)return Kh;z0=1;var n=Zx();return Kh=n,Kh}var Yh,L0;function Qx(){return L0||(L0=1,Yh=Jx()),Yh}var eR=Qx(),j0=L(eR);function tR(n,e){const t=new Tt;return Q(n).call(n,i=>{var r;Q(r=i.edges).call(r,s=>{s.connected&&t.add(s)})}),Q(t).call(t,i=>{const r=i.from.id,s=i.to.id;e[r]==null&&(e[r]=0),(e[s]==null||e[r]>=e[s])&&(e[s]=e[r]+1)}),e}function iR(n){return $0(e=>{var t,i;return j0(t=Me(i=e.edges).call(i,r=>n.has(r.toId))).call(t,r=>r.to===e)},(e,t)=>t>e,"from",n)}function rR(n){return $0(e=>{var t,i;return j0(t=Me(i=e.edges).call(i,r=>n.has(r.toId))).call(t,r=>r.from===e)},(e,t)=>t<e,"to",n)}function $0(n,e,t,i){var r;const s=Dt(null),o=q0(r=[...Uw(i).call(i)]).call(r,(u,c)=>u+1+c.edges.length,0),a=t+"Id",d=t==="to"?1:-1;for(const[u,c]of i){if(!i.has(u)||!n(c))continue;s[u]=0;const f=[c];let p=0,g;for(;g=f.pop();){var l,h;if(!i.has(u))continue;const b=s[g.id]+d;if(Q(l=Me(h=g.edges).call(h,m=>m.connected&&m.to!==m.from&&m[t]!==g&&i.has(m.toId)&&i.has(m.fromId))).call(l,m=>{const v=m[a],w=s[v];(w==null||e(b,w))&&(s[v]=b,f.push(m[t]))}),p>o)return tR(i,s);++p}}return s}class nR{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(e,t){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(t),this.parentReference[t]===void 0&&(this.parentReference[t]=[]),this.parentReference[t].push(e)}checkIfTree(){for(const e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(e,t){t!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}ensureLevel(e){this.levels[e]===void 0&&(this.levels[e]=0)}getMaxLevel(e){const t={},i=r=>{if(t[r]!==void 0)return t[r];let s=this.levels[r];if(this.childrenReference[r]){const o=this.childrenReference[r];if(o.length>0)for(let a=0;a<o.length;a++)s=Math.max(s,i(o[a]))}return t[r]=s,s};return i(e)}levelDownstream(e,t){this.levels[t.id]===void 0&&(this.levels[e.id]===void 0&&(this.levels[e.id]=0),this.levels[t.id]=this.levels[e.id]+1)}setMinLevelToZero(){var e;const t=new Vd;let i=0;const r=Ti(e=[...new Tt(k1(this.levels))]).call(e,(s,o)=>s-o);for(const s of r)t.set(s,i++);for(const s in this.levels)Object.prototype.hasOwnProperty.call(this.levels,s)&&(this.levels[s]=t.get(this.levels[s]))}getTreeSize(e,t){let i=1e9,r=-1e9,s=1e9,o=-1e9;for(const a in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,a)&&this.trees[a]===t){const d=e[a];i=Math.min(d.x,i),r=Math.max(d.x,r),s=Math.min(d.y,s),o=Math.max(d.y,o)}return{min_x:i,max_x:r,min_y:s,max_y:o}}hasSameParent(e,t){const i=this.parentReference[e.id],r=this.parentReference[t.id];if(i===void 0||r===void 0)return!1;for(let s=0;s<i.length;s++)for(let o=0;o<r.length;o++)if(i[s]==r[o])return!0;return!1}inSameSubNetwork(e,t){return this.trees[e.id]===this.trees[t.id]}getLevels(){return ue(this.distributionOrdering)}addToOrdering(e,t){this.distributionOrdering[t]===void 0&&(this.distributionOrdering[t]=[]);let i=!1;const r=this.distributionOrdering[t];for(const s in r)if(r[s]===e){i=!0;break}i||(this.distributionOrdering[t].push(e),this.distributionIndex[e.id]=this.distributionOrdering[t].length-1)}}class sR{constructor(e){this.body=e,this._resetRNG(Math.random()+":"+Ir()),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"}},me(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;const e=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",e,!1)})}setOptions(e,t){if(e!==void 0){const i=this.options.hierarchical,r=i.enabled;if(wi(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),He(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),i.enabled===!0)return r===!0&&this.body.emitter.emit("refresh",!0),i.direction==="RL"||i.direction==="DU"?i.levelSeparation>0&&(i.levelSeparation*=-1):i.levelSeparation<0&&(i.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(r===!0)return this.body.emitter.emit("refresh"),te(t,this.optionsBackup)}return t}_resetRNG(e){this.initialRandomSeed=e,this._rng=Fr(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(e){if(this.options.hierarchical.enabled===!0){const t=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:t.enabled===void 0?!0:t.enabled,solver:"hierarchicalRepulsion"},t.enabled=t.enabled===void 0?!0:t.enabled,t.solver=t.solver||"barnesHut"):typeof e.physics=="object"?(t.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,t.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(t.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});let i=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:i};else{const r=e.edges.smooth;r.type!==void 0&&r.type!=="dynamic"&&(i=r.type),this.optionsBackup.edges={smooth:{enabled:r.enabled===void 0?!0:r.enabled,type:r.type===void 0?"dynamic":r.type,roundness:r.roundness===void 0?.5:r.roundness,forceDirection:r.forceDirection===void 0?!1:r.forceDirection}},e.edges.smooth={enabled:r.enabled===void 0?!0:r.enabled,type:i,roundness:r.roundness===void 0?.5:r.roundness,forceDirection:r.forceDirection===void 0?!1:r.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",i)}return e}positionInitially(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);const t=e.length+50;for(let i=0;i<e.length;i++){const r=e[i],s=2*Math.PI*this._rng();r.x===void 0&&(r.x=t*Math.cos(s)),r.y===void 0&&(r.y=t*Math.sin(s))}}}layoutNetwork(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){const e=this.body.nodeIndices;let t=0;for(let i=0;i<e.length;i++)this.body.nodes[e[i]].predefinedPosition===!0&&(t+=1);if(t<.5*e.length){let r=0;const s=this.options.clusterThreshold,o={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(e.length>s){const d=e.length;for(;e.length>s&&r<=10;){r+=1;const l=e.length;r%3===0?this.body.modules.clustering.clusterBridges(o):this.body.modules.clustering.clusterOutliers(o);const h=e.length;if(l==h&&r%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*d)})}r>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();const a=70;for(let d=0;d<e.length;d++){const l=this.body.nodes[e[d]];l.predefinedPosition===!1&&(l.x+=(.5-this._rng())*a,l.y+=(.5-this._rng())*a)}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}_shiftToCenter(){const e=Re.getRangeCore(this.body.nodes,this.body.nodeIndices),t=Re.findCenter(e);for(let i=0;i<this.body.nodeIndices.length;i++){const r=this.body.nodes[this.body.nodeIndices[i]];r.x-=t.x,r.y-=t.y}}_declusterAll(){let e=!0;for(;e===!0;){e=!1;for(let t=0;t<this.body.nodeIndices.length;t++)this.body.nodes[this.body.nodeIndices[t]].isCluster===!0&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[t],{},!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,t,i=!1,r=!1;this.lastNodeOnLevel={},this.hierarchical=new nR;for(t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(e=this.body.nodes[t],e.options.level!==void 0?(i=!0,this.hierarchical.levels[t]=e.options.level):r=!0);if(r===!0&&i===!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(r===!0){const o=this.options.hierarchical.sortMethod;o==="hubsize"?this._determineLevelsByHubsize():o==="directed"?this._determineLevelsDirected():o==="custom"&&this._determineLevelsCustomCallback()}for(const o in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,o)&&this.hierarchical.ensureLevel(o);const s=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(s),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var e=this;let t=!1;const i={},r=()=>{const m=o();let v=0;for(let w=0;w<m.length-1;w++){const y=m[w].max-m[w+1].min;v+=y+this.options.hierarchical.treeSpacing,s(w+1,v)}},s=(m,v)=>{const w=this.hierarchical.trees;for(const y in w)Object.prototype.hasOwnProperty.call(w,y)&&w[y]===m&&this.direction.shift(y,v)},o=()=>{const m=[];for(let v=0;v<this.hierarchical.numTrees();v++)m.push(this.direction.getTreeSize(v));return m},a=(m,v)=>{if(!v[m.id]&&(v[m.id]=!0,this.hierarchical.childrenReference[m.id])){const w=this.hierarchical.childrenReference[m.id];if(w.length>0)for(let y=0;y<w.length;y++)a(this.body.nodes[w[y]],v)}},d=function(m){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,w=1e9,y=1e9,_=1e9,O=-1e9;for(const T in m)if(Object.prototype.hasOwnProperty.call(m,T)){const E=e.body.nodes[T],I=e.hierarchical.levels[E.id],P=e.direction.getPosition(E),[M,x]=e._getSpaceAroundNode(E,m);w=Math.min(M,w),y=Math.min(x,y),I<=v&&(_=Math.min(P,_),O=Math.max(P,O))}return[_,O,w,y]},l=(m,v)=>{const w=this.hierarchical.getMaxLevel(m.id),y=this.hierarchical.getMaxLevel(v.id);return Math.min(w,y)},h=(m,v,w)=>{const y=this.hierarchical;for(let _=0;_<v.length;_++){const O=v[_],T=y.distributionOrdering[O];if(T.length>1)for(let E=0;E<T.length-1;E++){const I=T[E],P=T[E+1];y.hasSameParent(I,P)&&y.inSameSubNetwork(I,P)&&m(I,P,w)}}},u=function(m,v){let w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const y=e.direction.getPosition(m),_=e.direction.getPosition(v),O=Math.abs(_-y),T=e.options.hierarchical.nodeSpacing;if(O>T){const E={},I={};a(m,E),a(v,I);const P=l(m,v),M=d(E,P),x=d(I,P),C=M[1],k=x[0],N=x[2];if(Math.abs(C-k)>T){let j=C-k+T;j<-N+T&&(j=-N+T),j<0&&(e._shiftBlock(v.id,j),t=!0,w===!0&&e._centerParent(v))}}},c=(m,v)=>{const w=v.id,y=v.edges,_=this.hierarchical.levels[v.id],O=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,T={},E=[];for(let N=0;N<y.length;N++){const W=y[N];if(W.toId!=W.fromId){const j=W.toId==w?W.from:W.to;T[y[N].id]=j,this.hierarchical.levels[j.id]<_&&E.push(W)}}const I=(N,W)=>{let j=0;for(let ee=0;ee<W.length;ee++)if(T[W[ee].id]!==void 0){const ne=this.direction.getPosition(T[W[ee].id])-N;j+=ne/Math.sqrt(ne*ne+O)}return j},P=(N,W)=>{let j=0;for(let ee=0;ee<W.length;ee++)if(T[W[ee].id]!==void 0){const ne=this.direction.getPosition(T[W[ee].id])-N;j-=O*Math.pow(ne*ne+O,-1.5)}return j},M=(N,W)=>{let j=this.direction.getPosition(v);const ee={};for(let ne=0;ne<N;ne++){const be=I(j,W),X=P(j,W),Te=40,We=Math.max(-Te,Math.min(Te,Math.round(be/X)));if(j=j-We,ee[j]!==void 0)break;ee[j]=ne}return j},x=N=>{const W=this.direction.getPosition(v);if(i[v.id]===void 0){const Te={};a(v,Te),i[v.id]=Te}const j=d(i[v.id]),ee=j[2],ne=j[3],be=N-W;let X=0;be>0?X=Math.min(be,ne-this.options.hierarchical.nodeSpacing):be<0&&(X=-Math.min(-be,ee-this.options.hierarchical.nodeSpacing)),X!=0&&(this._shiftBlock(v.id,X),t=!0)},C=N=>{const W=this.direction.getPosition(v),[j,ee]=this._getSpaceAroundNode(v),ne=N-W;let be=W;ne>0?be=Math.min(W+(ee-this.options.hierarchical.nodeSpacing),N):ne<0&&(be=Math.max(W-(j-this.options.hierarchical.nodeSpacing),N)),be!==W&&(this.direction.setPosition(v,be),t=!0)};let k=M(m,E);x(k),k=M(m,y),C(k)},f=m=>{let v=this.hierarchical.getLevels();v=Rt(v).call(v);for(let w=0;w<m;w++){t=!1;for(let y=0;y<v.length;y++){const _=v[y],O=this.hierarchical.distributionOrdering[_];for(let T=0;T<O.length;T++)c(1e3,O[T])}if(t!==!0)break}},p=m=>{let v=this.hierarchical.getLevels();v=Rt(v).call(v);for(let w=0;w<m&&(t=!1,h(u,v,!0),t===!0);w++);},g=()=>{for(const m in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,m)&&this._centerParent(this.body.nodes[m])},b=()=>{let m=this.hierarchical.getLevels();m=Rt(m).call(m);for(let v=0;v<m.length;v++){const w=m[v],y=this.hierarchical.distributionOrdering[w];for(let _=0;_<y.length;_++)this._centerParent(y[_])}};this.options.hierarchical.blockShifting===!0&&(p(5),g()),this.options.hierarchical.edgeMinimization===!0&&f(20),this.options.hierarchical.parentCentralization===!0&&b(),r()}_getSpaceAroundNode(e,t){let i=!0;t===void 0&&(i=!1);const r=this.hierarchical.levels[e.id];if(r!==void 0){const s=this.hierarchical.distributionIndex[e.id],o=this.direction.getPosition(e),a=this.hierarchical.distributionOrdering[r];let d=1e9,l=1e9;if(s!==0){const h=a[s-1];if(i===!0&&t[h.id]===void 0||i===!1){const u=this.direction.getPosition(h);d=o-u}}if(s!=a.length-1){const h=a[s+1];if(i===!0&&t[h.id]===void 0||i===!1){const u=this.direction.getPosition(h);l=Math.min(l,u-o)}}return[d,l]}else return[0,0]}_centerParent(e){if(this.hierarchical.parentReference[e.id]){const t=this.hierarchical.parentReference[e.id];for(let i=0;i<t.length;i++){const r=t[i],s=this.body.nodes[r],o=this.hierarchical.childrenReference[r];if(o!==void 0){const a=this._getCenterPosition(o),d=this.direction.getPosition(s),[l,h]=this._getSpaceAroundNode(s),u=d-a;(u<0&&Math.abs(u)<h-this.options.hierarchical.nodeSpacing||u>0&&Math.abs(u)<l-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(s,a)}}}}_placeNodesByHierarchy(e){this.positionedNodes={};for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var t;let r=ue(e[i]);r=this._indexArrayToNodes(r),Ti(t=this.direction).call(t,r);let s=0;for(let o=0;o<r.length;o++){const a=r[o];if(this.positionedNodes[a.id]===void 0){const d=this.options.hierarchical.nodeSpacing;let l=d*s;s>0&&(l=this.direction.getPosition(r[o-1])+d),this.direction.setPosition(a,l,i),this._validatePositionAndContinue(a,i,l),s++}}}}_placeBranchNodes(e,t){var i;const r=this.hierarchical.childrenReference[e];if(r===void 0)return;const s=[];for(let a=0;a<r.length;a++)s.push(this.body.nodes[r[a]]);Ti(i=this.direction).call(i,s);for(let a=0;a<s.length;a++){const d=s[a],l=this.hierarchical.levels[d.id];if(l>t&&this.positionedNodes[d.id]===void 0){const h=this.options.hierarchical.nodeSpacing;let u;a===0?u=this.direction.getPosition(this.body.nodes[e]):u=this.direction.getPosition(s[a-1])+h,this.direction.setPosition(d,u,l),this._validatePositionAndContinue(d,l,u)}else return}const o=this._getCenterPosition(s);this.direction.setPosition(this.body.nodes[e],o,t)}_validatePositionAndContinue(e,t,i){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[t]!==void 0){const r=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(i-r<this.options.hierarchical.nodeSpacing){const s=r+this.options.hierarchical.nodeSpacing-i,o=this._findCommonParent(this.lastNodeOnLevel[t],e.id);this._shiftBlock(o.withChild,s)}}this.lastNodeOnLevel[t]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,t)}}_indexArrayToNodes(e){const t=[];for(let i=0;i<e.length;i++)t.push(this.body.nodes[e[i]]);return t}_getDistribution(){const e={};let t,i;for(t in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,t)){i=this.body.nodes[t];const r=this.hierarchical.levels[t]===void 0?0:this.hierarchical.levels[t];this.direction.fix(i,r),e[r]===void 0&&(e[r]={}),e[r][t]=i}return e}_getActiveEdges(e){const t=[];return H(e.edges,i=>{var r;J(r=this.body.edgeIndices).call(r,i.id)!==-1&&t.push(i)}),t}_getHubSizes(){const e={},t=this.body.nodeIndices;H(t,r=>{const s=this.body.nodes[r],o=this._getActiveEdges(s).length;e[o]=!0});const i=[];return H(e,r=>{i.push(Number(r))}),Ti(i).call(i,function(r,s){return s-r}),i}_determineLevelsByHubsize(){const e=(i,r)=>{this.hierarchical.levelDownstream(i,r)},t=this._getHubSizes();for(let i=0;i<t.length;++i){const r=t[i];if(r===0)break;H(this.body.nodeIndices,s=>{const o=this.body.nodes[s];r===this._getActiveEdges(o).length&&this._crawlNetwork(e,s)})}}_determineLevelsCustomCallback(){const t=function(r,s,o){},i=(r,s,o)=>{let a=this.hierarchical.levels[r.id];a===void 0&&(a=this.hierarchical.levels[r.id]=1e5);const d=t(Re.cloneOptions(r,"node"),Re.cloneOptions(s,"node"),Re.cloneOptions(o,"edge"));this.hierarchical.levels[s.id]=a+d};this._crawlNetwork(i),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;const t=q0(e=this.body.nodeIndices).call(e,(i,r)=>(i.set(r,this.body.nodes[r]),i),new Vd);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=rR(t):this.hierarchical.levels=iR(t),this.hierarchical.setMinLevelToZero()}_generateMap(){const e=(t,i)=>{this.hierarchical.levels[i.id]>this.hierarchical.levels[t.id]&&this.hierarchical.addRelation(t.id,i.id)};this._crawlNetwork(e),this.hierarchical.checkIfTree()}_crawlNetwork(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},t=arguments.length>1?arguments[1]:void 0;const i={},r=(s,o)=>{if(i[s.id]===void 0){this.hierarchical.setTreeIndex(s,o),i[s.id]=!0;let a;const d=this._getActiveEdges(s);for(let l=0;l<d.length;l++){const h=d[l];h.connected===!0&&(h.toId==s.id?a=h.from:a=h.to,s.id!=a.id&&(e(s,a,h),r(a,o)))}}};if(t===void 0){let s=0;for(let o=0;o<this.body.nodeIndices.length;o++){const a=this.body.nodeIndices[o];if(i[a]===void 0){const d=this.body.nodes[a];r(d,s),s+=1}}}else{const s=this.body.nodes[t];if(s===void 0){console.error("Node not found:",t);return}r(s)}}_shiftBlock(e,t){const i={},r=s=>{if(i[s])return;i[s]=!0,this.direction.shift(s,t);const o=this.hierarchical.childrenReference[s];if(o!==void 0)for(let a=0;a<o.length;a++)r(o[a])};r(e)}_findCommonParent(e,t){const i={},r=(o,a)=>{const d=this.hierarchical.parentReference[a];if(d!==void 0)for(let l=0;l<d.length;l++){const h=d[l];o[h]=!0,r(o,h)}},s=(o,a)=>{const d=this.hierarchical.parentReference[a];if(d!==void 0)for(let l=0;l<d.length;l++){const h=d[l];if(o[h]!==void 0)return{foundParent:h,withChild:a};const u=s(o,h);if(u.foundParent!==null)return u}return{foundParent:null,withChild:a}};return r(i,e),s(i,t)}setDirectionStrategy(){this.options.hierarchical.direction==="UD"||this.options.hierarchical.direction==="DU"?this.direction=new Gx(this):this.direction=new Kx(this)}_getCenterPosition(e){let t=1e9,i=-1e9;for(let r=0;r<e.length;r++){let s;if(e[r].id!==void 0)s=e[r];else{const a=e[r];s=this.body.nodes[a]}const o=this.direction.getPosition(s);t=Math.min(t,o),i=Math.max(i,o)}return .5*(t+i)}}class oR{constructor(e,t,i,r){var s,o;this.body=e,this.canvas=t,this.selectionHandler=i,this.interactionHandler=r,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}},me(this.options,this.defaultOptions),this.body.emitter.on("destroy",()=>{this._clean()}),this.body.emitter.on("_dataChanged",D(s=this._restore).call(s,this)),this.body.emitter.on("_resetData",D(o=this._restore).call(o,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(e,t,i){t!==void 0&&(t.locale!==void 0?this.options.locale=t.locale:this.options.locale=i.locale,t.locales!==void 0?this.options.locales=t.locales:this.options.locales=i.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,te(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,t;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";const i=this.selectionHandler.getSelectedNodeCount(),r=this.selectionHandler.getSelectedEdgeCount(),s=i+r,o=this.options.locales[this.options.locale];let a=!1;this.options.addNode!==!1&&(this._createAddNodeButton(o),a=!0),this.options.addEdge!==!1&&(a===!0?this._createSeperator(1):a=!0,this._createAddEdgeButton(o)),i===1&&typeof this.options.editNode=="function"?(a===!0?this._createSeperator(2):a=!0,this._createEditNodeButton(o)):r===1&&i===0&&this.options.editEdge!==!1&&(a===!0?this._createSeperator(3):a=!0,this._createEditEdgeButton(o)),s!==0&&(i>0&&this.options.deleteNode!==!1?(a===!0&&this._createSeperator(4),this._createDeleteButton(o)):i===0&&this.options.deleteEdge!==!1&&(a===!0&&this._createSeperator(4),this._createDeleteButton(o))),this._bindElementEvents(this.closeDiv,D(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",D(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var t;const i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,D(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",D(e=this._performAddNode).call(e,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();const e=this.selectionHandler.getSelectedNodes()[0];if(e!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(e.isCluster!==!0){const t=te({},e.options,!1);if(t.x=e.x,t.y=e.y,this.options.editNode.length===2)this.options.editNode(t,i=>{i!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(i),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,t,i,r,s;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var o;const a=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(a),this._createSeperator(),this._createDescription(a.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,D(o=this.toggleEditMode).call(o,this))}this._temporaryBindUI("onTouch",D(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",D(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",D(i=this._dragControlNode).call(i,this)),this._temporaryBindUI("onRelease",D(r=this._finishConnect).call(r,this)),this._temporaryBindUI("onDragStart",D(s=this._dragStartEdge).call(s,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)){const o=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(o.from.id,o.to.id);return}if(this.guiEnabled===!0){var e;const o=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(o),this._createSeperator(),this._createDescription(o.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,D(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var t,i,r,s;const o=this.body.edges[this.edgeBeingEditedId],a=this._getNewTargetNode(o.from.x,o.from.y),d=this._getNewTargetNode(o.to.x,o.to.y);this.temporaryIds.nodes.push(a.id),this.temporaryIds.nodes.push(d.id),this.body.nodes[a.id]=a,this.body.nodeIndices.push(a.id),this.body.nodes[d.id]=d,this.body.nodeIndices.push(d.id),this._temporaryBindUI("onTouch",D(t=this._controlNodeTouch).call(t,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",D(i=this._controlNodeDragStart).call(i,this)),this._temporaryBindUI("onDrag",D(r=this._controlNodeDrag).call(r,this)),this._temporaryBindUI("onDragEnd",D(s=this._controlNodeDragEnd).call(s,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",l=>{const h=o.edgeType.findBorderPositions(l);a.selected===!1&&(a.x=h.from.x,a.y=h.from.y),d.selected===!1&&(d.x=h.to.x,d.y=h.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";const e=this.selectionHandler.getSelectedNodeIds(),t=this.selectionHandler.getSelectedEdgeIds();let i;if(e.length>0){for(let r=0;r<e.length;r++)if(this.body.nodes[e[r]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode=="function"&&(i=this.options.deleteNode)}else t.length>0&&typeof this.options.deleteEdge=="function"&&(i=this.options.deleteEdge);if(typeof i=="function"){const r={nodes:e,edges:t};if(i.length===2)i(r,s=>{s!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(s.edges),this.body.data.nodes.getDataSet().remove(s.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(t),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,t;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(t=this.options.locales[this.options.locale])===null||t===void 0?void 0:t.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,t){const i=te({},this.options.controlNodeStyle);i.id="targetNode"+ir(),i.hidden=!1,i.physics=!1,i.x=e,i.y=t;const r=this.body.functions.createNode(i);return r.shape.boundingBox={left:e,right:e,top:t,bottom:t},r}_createEditButton(){var e;this._clean(),this.manipulationDOM={},vt(this.editModeDiv);const t=this.options.locales[this.options.locale],i=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(i),this._bindElementEvents(i,D(e=this.toggleEditMode).call(e,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(vt(this.editModeDiv),vt(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(const t of ot(e=this._domEventListenerCleanupQueue).call(e,0)){var e;t()}}_removeManipulationDOM(){this._clean(),vt(this.manipulationDiv),vt(this.editModeDiv),vt(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 t;const i=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,D(t=this.addNodeMode).call(t,this))}_createAddEdgeButton(e){var t;const i=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,D(t=this.addEdgeMode).call(t,this))}_createEditNodeButton(e){var t;const i=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,D(t=this.editNode).call(t,this))}_createEditEdgeButton(e){var t;const i=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,D(t=this.editEdgeMode).call(t,this))}_createDeleteButton(e){var t;let i;this.options.rtl?i="vis-delete-rtl":i="vis-delete";const r=this._createButton("delete",i,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,D(t=this.deleteSelected).call(t,this))}_createBackButton(e){var t;const i=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,D(t=this.showManipulatorToolbar).call(t,this))}_createButton(e,t,i){let r=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 "+t,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=r,this.manipulationDOM[e+"Label"].innerText=i,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,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}_temporaryBindUI(e,t){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+Ai(ue(this.body.eventListeners)))}_unbindTemporaryUIs(){for(const 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++){const t=this.temporaryEventFunctions[e].event,i=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(t,i)}this.temporaryEventFunctions=[]}_bindElementEvents(e,t){const i=new _i(e,{});Ur(i,t),this._domEventListenerCleanupQueue.push(()=>{i.destroy()});const r=s=>{let{keyCode:o,key:a}=s;(a==="Enter"||a===" "||o===13||o===32)&&t()};e.addEventListener("keyup",r,!1),this._domEventListenerCleanupQueue.push(()=>{e.removeEventListener("keyup",r,!1)})}_cleanupTemporaryNodesAndEdges(){for(let s=0;s<this.temporaryIds.edges.length;s++){var e;this.body.edges[this.temporaryIds.edges[s]].disconnect(),delete this.body.edges[this.temporaryIds.edges[s]];const o=J(e=this.body.edgeIndices).call(e,this.temporaryIds.edges[s]);if(o!==-1){var t;ot(t=this.body.edgeIndices).call(t,o,1)}}for(let s=0;s<this.temporaryIds.nodes.length;s++){var i;delete this.body.nodes[this.temporaryIds.nodes[s]];const o=J(i=this.body.nodeIndices).call(i,this.temporaryIds.nodes[s]);if(o!==-1){var r;ot(r=this.body.nodeIndices).call(r,o,1)}}this.temporaryIds={nodes:[],edges:[]}}_controlNodeTouch(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=me({},this.body.view.translation)}_controlNodeDragStart(){const e=this.lastTouch,t=this.selectionHandler._pointerToPositionObject(e),i=this.body.nodes[this.temporaryIds.nodes[0]],r=this.body.nodes[this.temporaryIds.nodes[1]],s=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;const o=i.isOverlappingWith(t),a=r.isOverlappingWith(t);o===!0?(this.selectedControlNode=i,s.edgeType.from=i):a===!0&&(this.selectedControlNode=r,s.edgeType.to=r),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}_controlNodeDrag(e){this.body.emitter.emit("disablePhysics");const t=this.body.functions.getPointer(e.center),i=this.canvas.DOMtoCanvas(t);this.selectedControlNode!==void 0?(this.selectedControlNode.x=i.x,this.selectedControlNode.y=i.y):this.interactionHandler.onDrag(e),this.body.emitter.emit("_redraw")}_controlNodeDragEnd(e){const t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t),r=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode===void 0)return;this.selectionHandler.unselectAll();const s=this.selectionHandler._getAllNodesOverlappingWith(i);let o;for(let a=s.length-1;a>=0;a--)if(s[a]!==this.selectedControlNode.id){o=this.body.nodes[s[a]];break}if(o!==void 0&&this.selectedControlNode!==void 0)if(o.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const a=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===a.id?this._performEditEdge(o.id,r.to.id):this._performEditEdge(r.from.id,o.id)}else r.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=me({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;const t=this.lastTouch,i=this.selectionHandler.getNodeAt(t);if(i!==void 0)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const r=this._getNewTargetNode(i.x,i.y);this.body.nodes[r.id]=r,this.body.nodeIndices.push(r.id);const s=this.body.functions.createEdge({id:"connectionEdge"+ir(),from:i.id,to:r.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[s.id]=s,this.body.edgeIndices.push(s.id),this.temporaryIds.nodes.push(r.id),this.temporaryIds.edges.push(s.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(e){const t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t);let r;this.temporaryIds.edges[0]!==void 0&&(r=this.body.edges[this.temporaryIds.edges[0]].fromId);const s=this.selectionHandler._getAllNodesOverlappingWith(i);let o;for(let d=s.length-1;d>=0;d--){var a;if(J(a=this.temporaryIds.nodes).call(a,s[d])===-1){o=this.body.nodes[s[d]];break}}if(e.controlEdge={from:r,to:o?o.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,t),this.temporaryIds.nodes[0]!==void 0){const d=this.body.nodes[this.temporaryIds.nodes[0]];d.x=this.canvas._XconvertDOMtoCanvas(t.x),d.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}_finishConnect(e){const t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t);let r;this.temporaryIds.edges[0]!==void 0&&(r=this.body.edges[this.temporaryIds.edges[0]].fromId);const s=this.selectionHandler._getAllNodesOverlappingWith(i);let o;for(let d=s.length-1;d>=0;d--){var a;if(J(a=this.temporaryIds.nodes).call(a,s[d])===-1){o=this.body.nodes[s[d]];break}}this._cleanupTemporaryNodesAndEdges(),o!==void 0&&(o.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[r]!==void 0&&this.body.nodes[o.id]!==void 0&&this._performAddEdge(r,o.id)),e.controlEdge={from:r,to:o?o.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,t),this.body.emitter.emit("_redraw")}_dragStartEdge(e){const t=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,t,void 0,!0)}_performAddNode(e){const t={id:ir(),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(t,i=>{i!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(i),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(t),this.showManipulatorToolbar()}_performAddEdge(e,t){const i={from:e,to:t};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(i,r=>{r!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(r),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(i),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(e,t){const i={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label};let r=this.options.editEdge;if(typeof r=="object"&&(r=r.editWithoutDrag),typeof r=="function")if(r.length===2)r(i,s=>{s==null||this.inMode!=="editEdge"?(this.body.edges[i.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(s),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(i),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}const q="string",R="boolean",S="number",ar="array",A="object",H0="dom",aR="any",Xh=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],Zh={borderWidth:{number:S},borderWidthSelected:{number:S,undefined:"undefined"},brokenImage:{string:q,undefined:"undefined"},chosen:{label:{boolean:R,function:"function"},node:{boolean:R,function:"function"},__type__:{object:A,boolean:R}},color:{border:{string:q},background:{string:q},highlight:{border:{string:q},background:{string:q},__type__:{object:A,string:q}},hover:{border:{string:q},background:{string:q},__type__:{object:A,string:q}},__type__:{object:A,string:q}},opacity:{number:S,undefined:"undefined"},fixed:{x:{boolean:R},y:{boolean:R},__type__:{object:A,boolean:R}},font:{align:{string:q},color:{string:q},size:{number:S},face:{string:q},background:{string:q},strokeWidth:{number:S},strokeColor:{string:q},vadjust:{number:S},multi:{boolean:R,string:q},bold:{color:{string:q},size:{number:S},face:{string:q},mod:{string:q},vadjust:{number:S},__type__:{object:A,string:q}},boldital:{color:{string:q},size:{number:S},face:{string:q},mod:{string:q},vadjust:{number:S},__type__:{object:A,string:q}},ital:{color:{string:q},size:{number:S},face:{string:q},mod:{string:q},vadjust:{number:S},__type__:{object:A,string:q}},mono:{color:{string:q},size:{number:S},face:{string:q},mod:{string:q},vadjust:{number:S},__type__:{object:A,string:q}},__type__:{object:A,string:q}},group:{string:q,number:S,undefined:"undefined"},heightConstraint:{minimum:{number:S},valign:{string:q},__type__:{object:A,boolean:R,number:S}},hidden:{boolean:R},icon:{face:{string:q},code:{string:q},size:{number:S},color:{string:q},weight:{string:q,number:S},__type__:{object:A}},id:{string:q,number:S},image:{selected:{string:q,undefined:"undefined"},unselected:{string:q,undefined:"undefined"},__type__:{object:A,string:q}},imagePadding:{top:{number:S},right:{number:S},bottom:{number:S},left:{number:S},__type__:{object:A,number:S}},label:{string:q,undefined:"undefined"},labelHighlightBold:{boolean:R},level:{number:S,undefined:"undefined"},margin:{top:{number:S},right:{number:S},bottom:{number:S},left:{number:S},__type__:{object:A,number:S}},mass:{number:S},physics:{boolean:R},scaling:{min:{number:S},max:{number:S},label:{enabled:{boolean:R},min:{number:S},max:{number:S},maxVisible:{number:S},drawThreshold:{number:S},__type__:{object:A,boolean:R}},customScalingFunction:{function:"function"},__type__:{object:A}},shadow:{enabled:{boolean:R},color:{string:q},size:{number:S},x:{number:S},y:{number:S},__type__:{object:A,boolean:R}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:R,array:ar},borderRadius:{number:S},interpolation:{boolean:R},useImageSize:{boolean:R},useBorderWithImage:{boolean:R},coordinateOrigin:{string:["center","top-left"]},__type__:{object:A}},size:{number:S},title:{string:q,dom:H0,undefined:"undefined"},value:{number:S,undefined:"undefined"},widthConstraint:{minimum:{number:S},maximum:{number:S},__type__:{object:A,boolean:R,number:S}},x:{number:S},y:{number:S},__type__:{object:A}},W0={configure:{enabled:{boolean:R},filter:{boolean:R,string:q,array:ar,function:"function"},container:{dom:H0},showButton:{boolean:R},__type__:{object:A,boolean:R,string:q,array:ar,function:"function"}},edges:{arrows:{to:{enabled:{boolean:R},scaleFactor:{number:S},type:{string:Xh},imageHeight:{number:S},imageWidth:{number:S},src:{string:q},__type__:{object:A,boolean:R}},middle:{enabled:{boolean:R},scaleFactor:{number:S},type:{string:Xh},imageWidth:{number:S},imageHeight:{number:S},src:{string:q},__type__:{object:A,boolean:R}},from:{enabled:{boolean:R},scaleFactor:{number:S},type:{string:Xh},imageWidth:{number:S},imageHeight:{number:S},src:{string:q},__type__:{object:A,boolean:R}},__type__:{string:["from","to","middle"],object:A}},endPointOffset:{from:{number:S},to:{number:S},__type__:{object:A,number:S}},arrowStrikethrough:{boolean:R},background:{enabled:{boolean:R},color:{string:q},size:{number:S},dashes:{boolean:R,array:ar},__type__:{object:A,boolean:R}},chosen:{label:{boolean:R,function:"function"},edge:{boolean:R,function:"function"},__type__:{object:A,boolean:R}},color:{color:{string:q},highlight:{string:q},hover:{string:q},inherit:{string:["from","to","both"],boolean:R},opacity:{number:S},__type__:{object:A,string:q}},dashes:{boolean:R,array:ar},font:{color:{string:q},size:{number:S},face:{string:q},background:{string:q},strokeWidth:{number:S},strokeColor:{string:q},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:S},multi:{boolean:R,string:q},bold:{color:{string:q},size:{number:S},face:{string:q},mod:{string:q},vadjust:{number:S},__type__:{object:A,string:q}},boldital:{color:{string:q},size:{number:S},face:{string:q},mod:{string:q},vadjust:{number:S},__type__:{object:A,string:q}},ital:{color:{string:q},size:{number:S},face:{string:q},mod:{string:q},vadjust:{number:S},__type__:{object:A,string:q}},mono:{color:{string:q},size:{number:S},face:{string:q},mod:{string:q},vadjust:{number:S},__type__:{object:A,string:q}},__type__:{object:A,string:q}},hidden:{boolean:R},hoverWidth:{function:"function",number:S},label:{string:q,undefined:"undefined"},labelHighlightBold:{boolean:R},length:{number:S,undefined:"undefined"},physics:{boolean:R},scaling:{min:{number:S},max:{number:S},label:{enabled:{boolean:R},min:{number:S},max:{number:S},maxVisible:{number:S},drawThreshold:{number:S},__type__:{object:A,boolean:R}},customScalingFunction:{function:"function"},__type__:{object:A}},selectionWidth:{function:"function",number:S},selfReferenceSize:{number:S},selfReference:{size:{number:S},angle:{number:S},renderBehindTheNode:{boolean:R},__type__:{object:A}},shadow:{enabled:{boolean:R},color:{string:q},size:{number:S},x:{number:S},y:{number:S},__type__:{object:A,boolean:R}},smooth:{enabled:{boolean:R},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:S},forceDirection:{string:["horizontal","vertical","none"],boolean:R},__type__:{object:A,boolean:R}},title:{string:q,undefined:"undefined"},width:{number:S},widthConstraint:{maximum:{number:S},__type__:{object:A,boolean:R,number:S}},value:{number:S,undefined:"undefined"},__type__:{object:A}},groups:{useDefaultGroups:{boolean:R},__any__:Zh,__type__:{object:A}},interaction:{dragNodes:{boolean:R},dragView:{boolean:R},hideEdgesOnDrag:{boolean:R},hideEdgesOnZoom:{boolean:R},hideNodesOnDrag:{boolean:R},hover:{boolean:R},keyboard:{enabled:{boolean:R},speed:{x:{number:S},y:{number:S},zoom:{number:S},__type__:{object:A}},bindToWindow:{boolean:R},autoFocus:{boolean:R},__type__:{object:A,boolean:R}},multiselect:{boolean:R},navigationButtons:{boolean:R},selectable:{boolean:R},selectConnectedEdges:{boolean:R},hoverConnectedEdges:{boolean:R},tooltipDelay:{number:S},zoomView:{boolean:R},zoomSpeed:{number:S},__type__:{object:A}},layout:{randomSeed:{undefined:"undefined",number:S,string:q},improvedLayout:{boolean:R},clusterThreshold:{number:S},hierarchical:{enabled:{boolean:R},levelSeparation:{number:S},nodeSpacing:{number:S},treeSpacing:{number:S},blockShifting:{boolean:R},edgeMinimization:{boolean:R},parentCentralization:{boolean:R},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:A,boolean:R}},__type__:{object:A}},manipulation:{enabled:{boolean:R},initiallyActive:{boolean:R},addNode:{boolean:R,function:"function"},addEdge:{boolean:R,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:A,boolean:R,function:"function"}},deleteNode:{boolean:R,function:"function"},deleteEdge:{boolean:R,function:"function"},controlNodeStyle:Zh,__type__:{object:A,boolean:R}},nodes:Zh,physics:{enabled:{boolean:R},barnesHut:{theta:{number:S},gravitationalConstant:{number:S},centralGravity:{number:S},springLength:{number:S},springConstant:{number:S},damping:{number:S},avoidOverlap:{number:S},__type__:{object:A}},forceAtlas2Based:{theta:{number:S},gravitationalConstant:{number:S},centralGravity:{number:S},springLength:{number:S},springConstant:{number:S},damping:{number:S},avoidOverlap:{number:S},__type__:{object:A}},repulsion:{centralGravity:{number:S},springLength:{number:S},springConstant:{number:S},nodeDistance:{number:S},damping:{number:S},__type__:{object:A}},hierarchicalRepulsion:{centralGravity:{number:S},springLength:{number:S},springConstant:{number:S},nodeDistance:{number:S},damping:{number:S},avoidOverlap:{number:S},__type__:{object:A}},maxVelocity:{number:S},minVelocity:{number:S},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:R},iterations:{number:S},updateInterval:{number:S},onlyDynamicEdges:{boolean:R},fit:{boolean:R},__type__:{object:A,boolean:R}},timestep:{number:S},adaptiveTimestep:{boolean:R},wind:{x:{number:S},y:{number:S},__type__:{object:A}},__type__:{object:A,boolean:R}},autoResize:{boolean:R},clickToUse:{boolean:R},locale:{string:q},locales:{__any__:{any:aR},__type__:{object:A}},height:{string:q},width:{string:q},__type__:{object:A}},Jh={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]}}},V0=(n,e,t)=>{var i;return!!(pt(n).call(n,"physics")&&pt(i=Jh.physics.solver).call(i,e)&&t.physics.solver!==e&&e!=="wind")};var RR=Object.freeze({__proto__:null,allOptions:W0,configuratorHideOption:V0,configureOptions:Jh});class dR{constructor(){}getDistances(e,t,i){const r={},s=e.edges;for(let a=0;a<t.length;a++){const d=t[a],l={};r[d]=l;for(let h=0;h<t.length;h++)l[t[h]]=a==h?0:1e9}for(let a=0;a<i.length;a++){const d=s[i[a]];d.connected===!0&&r[d.fromId]!==void 0&&r[d.toId]!==void 0&&(r[d.fromId][d.toId]=1,r[d.toId][d.fromId]=1)}const o=t.length;for(let a=0;a<o;a++){const d=t[a],l=r[d];for(let h=0;h<o-1;h++){const u=t[h],c=r[u];for(let f=h+1;f<o;f++){const p=t[f],g=r[p],b=Math.min(c[p],c[d]+l[p]);c[p]=b,g[u]=b}}}return r}}class lR{constructor(e,t,i){this.body=e,this.springLength=t,this.springConstant=i,this.distanceSolver=new dR}setOptions(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}solve(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const r=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(r),this._createK_matrix(r),this._createE_matrix();const s=.01,o=1;let a=0;const d=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),l=5;let h=1e9,u=0,c=0,f=0,p=0,g=0;for(;h>s&&a<d;)for(a+=1,[u,h,c,f]=this._getHighestEnergyNode(i),p=h,g=0;p>o&&g<l;)g+=1,this._moveNode(u,c,f),[p,c,f]=this._getEnergy(u)}_getHighestEnergyNode(e){const t=this.body.nodeIndices,i=this.body.nodes;let r=0,s=t[0],o=0,a=0;for(let d=0;d<t.length;d++){const l=t[d];if(i[l].predefinedPosition!==!0||i[l].isCluster===!0&&e===!0||i[l].options.fixed.x!==!0||i[l].options.fixed.y!==!0){const[h,u,c]=this._getEnergy(l);r<h&&(r=h,s=l,o=u,a=c)}}return[s,r,o,a]}_getEnergy(e){const[t,i]=this.E_sums[e];return[Math.sqrt(t**2+i**2),t,i]}_moveNode(e,t,i){const r=this.body.nodeIndices,s=this.body.nodes;let o=0,a=0,d=0;const l=s[e].x,h=s[e].y,u=this.K_matrix[e],c=this.L_matrix[e];for(let y=0;y<r.length;y++){const _=r[y];if(_!==e){const O=s[_].x,T=s[_].y,E=u[_],I=c[_],P=1/((l-O)**2+(h-T)**2)**1.5;o+=E*(1-I*(h-T)**2*P),a+=E*(I*(l-O)*(h-T)*P),d+=E*(1-I*(l-O)**2*P)}}const f=o,p=a,g=t,b=d,m=i,v=(g/f+m/p)/(p/f-b/p),w=-(p*v+g)/f;s[e].x+=w,s[e].y+=v,this._updateE_matrix(e)}_createL_matrix(e){const t=this.body.nodeIndices,i=this.springLength;this.L_matrix=[];for(let r=0;r<t.length;r++){this.L_matrix[t[r]]={};for(let s=0;s<t.length;s++)this.L_matrix[t[r]][t[s]]=i*e[t[r]][t[s]]}}_createK_matrix(e){const t=this.body.nodeIndices,i=this.springConstant;this.K_matrix=[];for(let r=0;r<t.length;r++){this.K_matrix[t[r]]={};for(let s=0;s<t.length;s++)this.K_matrix[t[r]][t[s]]=i*e[t[r]][t[s]]**-2}}_createE_matrix(){const e=this.body.nodeIndices,t=this.body.nodes;this.E_matrix={},this.E_sums={};for(let i=0;i<e.length;i++)this.E_matrix[e[i]]=[];for(let i=0;i<e.length;i++){const r=e[i],s=t[r].x,o=t[r].y;let a=0,d=0;for(let l=i;l<e.length;l++){const h=e[l];if(h!==r){const u=t[h].x,c=t[h].y,f=1/Math.sqrt((s-u)**2+(o-c)**2);this.E_matrix[r][l]=[this.K_matrix[r][h]*(s-u-this.L_matrix[r][h]*(s-u)*f),this.K_matrix[r][h]*(o-c-this.L_matrix[r][h]*(o-c)*f)],this.E_matrix[h][i]=this.E_matrix[r][l],a+=this.E_matrix[r][l][0],d+=this.E_matrix[r][l][1]}}this.E_sums[r]=[a,d]}}_updateE_matrix(e){const t=this.body.nodeIndices,i=this.body.nodes,r=this.E_matrix[e],s=this.K_matrix[e],o=this.L_matrix[e],a=i[e].x,d=i[e].y;let l=0,h=0;for(let u=0;u<t.length;u++){const c=t[u];if(c!==e){const f=r[u],p=f[0],g=f[1],b=i[c].x,m=i[c].y,v=1/Math.sqrt((a-b)**2+(d-m)**2),w=s[c]*(a-b-o[c]*(a-b)*v),y=s[c]*(d-m-o[c]*(d-m)*v);r[u]=[w,y],l+=w,h+=y;const _=this.E_sums[c];_[0]+=w-p,_[1]+=y-g}}this.E_sums[e]=[l,h]}}function F(n,e,t){var i,r,s,o;if(!(this instanceof F))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:NI,clickToUse:!1},me(this.options,this.defaultOptions),this.body={container:n,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:D(i=this.on).call(i,this),off:D(r=this.off).call(r,this),emit:D(s=this.emit).call(s,this),once:D(o=this.once).call(o,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 zI(()=>this.body.emitter.emit("_requestRedraw")),this.groups=new eT,this.canvas=new GC(this.body),this.selectionHandler=new Cx(this.body,this.canvas),this.interactionHandler=new ZC(this.body,this.canvas,this.selectionHandler),this.view=new YC(this.body,this.canvas),this.renderer=new $C(this.body,this.canvas),this.physics=new FC(this.body),this.layoutEngine=new sR(this.body),this.clustering=new jC(this.body),this.manipulation=new oR(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new lC(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new xC(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new lR(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(t),this.setData(e)}zc(F.prototype),F.prototype.setOptions=function(n){if(n===null&&(n=void 0),n!==void 0){if(PI.validate(n,W0)===!0&&console.error("%cErrors have been found in the supplied options object.",iy),wi(["locale","locales","clickToUse"],this.options,n),n.locale!==void 0&&(n.locale=AI(n.locales||this.options.locales,n.locale)),n=this.layoutEngine.setOptions(n.layout,n),this.canvas.setOptions(n),this.groups.setOptions(n.groups),this.nodesHandler.setOptions(n.nodes),this.edgesHandler.setOptions(n.edges),this.physics.setOptions(n.physics),this.manipulation.setOptions(n.manipulation,n,this.options),this.interactionHandler.setOptions(n.interaction),this.renderer.setOptions(n.interaction),this.selectionHandler.setOptions(n.interaction),n.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in n&&(this.configurator||(this.configurator=new II(this,this.body.container,Jh,this.canvas.pixelRatio,V0)),this.configurator.setOptions(n.configure)),this.configurator&&this.configurator.options.enabled===!0){const i={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};te(i.nodes,this.nodesHandler.options),te(i.edges,this.edgesHandler.options),te(i.layout,this.layoutEngine.options),te(i.interaction,this.selectionHandler.options),te(i.interaction,this.renderer.options),te(i.interaction,this.interactionHandler.options),te(i.manipulation,this.manipulation.options),te(i.physics,this.physics.options),te(i.global,this.canvas.options),te(i.global,this.options),this.configurator.setModuleOptions(i)}n.clickToUse!==void 0?n.clickToUse===!0?this.activator===void 0&&(this.activator=new OI(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")}},F.prototype._updateVisibleIndices=function(){const n=this.body.nodes,e=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&!this.clustering._isClusteredNode(t)&&n[t].options.hidden===!1&&this.body.nodeIndices.push(n[t].id);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const i=e[t],r=n[i.fromId],s=n[i.toId],o=r!==void 0&&s!==void 0;!this.clustering._isClusteredEdge(t)&&i.options.hidden===!1&&o&&r.options.hidden===!1&&s.options.hidden===!1&&this.body.edgeIndices.push(i.id)}},F.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")})},F.prototype.setData=function(n){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),n&&n.dot&&(n.nodes||n.edges))throw new SyntaxError('Data must contain either parameter "dot" or  parameter pair "nodes" and "edges", but not both.');if(this.setOptions(n&&n.options),n&&n.dot){console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");const e=py(n.dot);this.setData(e);return}else if(n&&n.gephi){console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");const e=gy(n.gephi);this.setData(e);return}else this.nodesHandler.setData(n&&n.nodes,!0),this.edgesHandler.setData(n&&n.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")},F.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(const n in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,n)&&delete this.body.nodes[n];for(const n in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,n)&&delete this.body.edges[n];vt(this.body.container)},F.prototype._updateValueRange=function(n){let e,t,i,r=0;for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const s=n[e].getValue();s!==void 0&&(t=t===void 0?s:Math.min(s,t),i=i===void 0?s:Math.max(s,i),r+=s)}if(t!==void 0&&i!==void 0)for(e in n)Object.prototype.hasOwnProperty.call(n,e)&&n[e].setValueRange(t,i,r)},F.prototype.isActive=function(){return!this.activator||this.activator.active},F.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},F.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},F.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},F.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},F.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},F.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},F.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},F.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},F.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},F.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},F.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)},F.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)},F.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)},F.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)},F.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)},F.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},F.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},F.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},F.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},F.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},F.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},F.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},F.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},F.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},F.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},F.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},F.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)},F.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},F.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},F.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},F.prototype.getConnectedNodes=function(n){return this.body.nodes[n]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)},F.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},F.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},F.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},F.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},F.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},F.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},F.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)},F.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)},F.prototype.getNodeAt=function(){const n=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return n!==void 0&&n.id!==void 0?n.id:n},F.prototype.getEdgeAt=function(){const n=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return n!==void 0&&n.id!==void 0?n.id:n},F.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},F.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},F.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()},F.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},F.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},F.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},F.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},F.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},F.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},F.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},F.prototype.getOptionsFromConfigurator=function(){let n={};return this.configurator&&(n=this.configurator.getOptions.apply(this.configurator)),n};const DR=null}}]);

//# sourceMappingURL=vis-network.d342a2cf5576b846a3d2.js.map