/** * vis-network * https://visjs.github.io/vis-network/ * * A dynamic, browser-based visualization library. * * @version 9.1.9 * @date 2023-11-03T01:44:38.007Z * * @copyright (c) 2011-2017 Almende B.V, http://almende.com * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs * * @license * vis.js is dual licensed under both * * 1. The Apache 2.0 License * http://www.apache.org/licenses/LICENSE-2.0 * * and * * 2. The MIT License * http://opensource.org/licenses/MIT * * vis.js may be distributed under either license. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).vis=t.vis||{})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var n=function(t){return t&&t.Math===Math&&t},o=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||e||Function("return this")(),r=function(t){try{return!!t()}catch(t){return!0}},s=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),a=s,h=Function.prototype,l=h.apply,d=h.call,c="object"==typeof Reflect&&Reflect.apply||(a?d.bind(l):function(){return d.apply(l,arguments)}),u=s,f=Function.prototype,p=f.call,v=u&&f.bind.bind(p,p),g=u?v:function(t){return function(){return p.apply(t,arguments)}},y=g,m=y({}.toString),b=y("".slice),w=function(t){return b(m(t),8,-1)},k=w,_=g,x=function(t){if("Function"===k(t))return _(t)},E="object"==typeof document&&document.all,O={all:E,IS_HTMLDDA:void 0===E&&void 0!==E},C=O.all,S=O.IS_HTMLDDA?function(t){return"function"==typeof t||t===C}:function(t){return"function"==typeof t},T={},M=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),P=s,D=Function.prototype.call,I=P?D.bind(D):function(){return D.apply(D,arguments)},B={},N={}.propertyIsEnumerable,F=Object.getOwnPropertyDescriptor,z=F&&!N.call({1:2},1);B.f=z?function(t){var e=F(this,t);return!!e&&e.enumerable}:N;var A,j,R=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},L=r,H=w,W=Object,q=g("".split),V=L((function(){return!W("z").propertyIsEnumerable(0)}))?function(t){return"String"===H(t)?q(t,""):W(t)}:W,U=function(t){return null==t},Y=U,X=TypeError,G=function(t){if(Y(t))throw new X("Can't call method on "+t);return t},K=V,$=G,Z=function(t){return K($(t))},Q=S,J=O.all,tt=O.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:Q(t)||t===J}:function(t){return"object"==typeof t?null!==t:Q(t)},et={},it=et,nt=o,ot=S,rt=function(t){return ot(t)?t:void 0},st=function(t,e){return arguments.length<2?rt(it[t])||rt(nt[t]):it[t]&&it[t][e]||nt[t]&&nt[t][e]},at=g({}.isPrototypeOf),ht="undefined"!=typeof navigator&&String(navigator.userAgent)||"",lt=o,dt=ht,ct=lt.process,ut=lt.Deno,ft=ct&&ct.versions||ut&&ut.version,pt=ft&&ft.v8;pt&&(j=(A=pt.split("."))[0]>0&&A[0]<4?1:+(A[0]+A[1])),!j&&dt&&(!(A=dt.match(/Edge\/(\d+)/))||A[1]>=74)&&(A=dt.match(/Chrome\/(\d+)/))&&(j=+A[1]);var vt=j,gt=vt,yt=r,mt=o.String,bt=!!Object.getOwnPropertySymbols&&!yt((function(){var t=Symbol("symbol detection");return!mt(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&>&><41})),wt=bt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,kt=st,_t=S,xt=at,Et=Object,Ot=wt?function(t){return"symbol"==typeof t}:function(t){var e=kt("Symbol");return _t(e)&&xt(e.prototype,Et(t))},Ct=String,St=function(t){try{return Ct(t)}catch(t){return"Object"}},Tt=S,Mt=St,Pt=TypeError,Dt=function(t){if(Tt(t))return t;throw new Pt(Mt(t)+" is not a function")},It=Dt,Bt=U,Nt=function(t,e){var i=t[e];return Bt(i)?void 0:It(i)},Ft=I,zt=S,At=tt,jt=TypeError,Rt={exports:{}},Lt=o,Ht=Object.defineProperty,Wt=function(t,e){try{Ht(Lt,t,{value:e,configurable:!0,writable:!0})}catch(i){Lt[t]=e}return e},qt="__core-js_shared__",Vt=o[qt]||Wt(qt,{}),Ut=Vt;(Rt.exports=function(t,e){return Ut[t]||(Ut[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Yt=Rt.exports,Xt=G,Gt=Object,Kt=function(t){return Gt(Xt(t))},$t=Kt,Zt=g({}.hasOwnProperty),Qt=Object.hasOwn||function(t,e){return Zt($t(t),e)},Jt=g,te=0,ee=Math.random(),ie=Jt(1..toString),ne=function(t){return"Symbol("+(void 0===t?"":t)+")_"+ie(++te+ee,36)},oe=Yt,re=Qt,se=ne,ae=bt,he=wt,le=o.Symbol,de=oe("wks"),ce=he?le.for||le:le&&le.withoutSetter||se,ue=function(t){return re(de,t)||(de[t]=ae&&re(le,t)?le[t]:ce("Symbol."+t)),de[t]},fe=I,pe=tt,ve=Ot,ge=Nt,ye=function(t,e){var i,n;if("string"===e&&zt(i=t.toString)&&!At(n=Ft(i,t)))return n;if(zt(i=t.valueOf)&&!At(n=Ft(i,t)))return n;if("string"!==e&&zt(i=t.toString)&&!At(n=Ft(i,t)))return n;throw new jt("Can't convert object to primitive value")},me=TypeError,be=ue("toPrimitive"),we=function(t,e){if(!pe(t)||ve(t))return t;var i,n=ge(t,be);if(n){if(void 0===e&&(e="default"),i=fe(n,t,e),!pe(i)||ve(i))return i;throw new me("Can't convert object to primitive value")}return void 0===e&&(e="number"),ye(t,e)},ke=Ot,_e=function(t){var e=we(t,"string");return ke(e)?e:e+""},xe=tt,Ee=o.document,Oe=xe(Ee)&&xe(Ee.createElement),Ce=function(t){return Oe?Ee.createElement(t):{}},Se=Ce,Te=!M&&!r((function(){return 7!==Object.defineProperty(Se("div"),"a",{get:function(){return 7}}).a})),Me=M,Pe=I,De=B,Ie=R,Be=Z,Ne=_e,Fe=Qt,ze=Te,Ae=Object.getOwnPropertyDescriptor;T.f=Me?Ae:function(t,e){if(t=Be(t),e=Ne(e),ze)try{return Ae(t,e)}catch(t){}if(Fe(t,e))return Ie(!Pe(De.f,t,e),t[e])};var je=r,Re=S,Le=/#|\.prototype\./,He=function(t,e){var i=qe[We(t)];return i===Ue||i!==Ve&&(Re(e)?je(e):!!e)},We=He.normalize=function(t){return String(t).replace(Le,".").toLowerCase()},qe=He.data={},Ve=He.NATIVE="N",Ue=He.POLYFILL="P",Ye=He,Xe=Dt,Ge=s,Ke=x(x.bind),$e=function(t,e){return Xe(t),void 0===e?t:Ge?Ke(t,e):function(){return t.apply(e,arguments)}},Ze={},Qe=M&&r((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Je=tt,ti=String,ei=TypeError,ii=function(t){if(Je(t))return t;throw new ei(ti(t)+" is not an object")},ni=M,oi=Te,ri=Qe,si=ii,ai=_e,hi=TypeError,li=Object.defineProperty,di=Object.getOwnPropertyDescriptor,ci="enumerable",ui="configurable",fi="writable";Ze.f=ni?ri?function(t,e,i){if(si(t),e=ai(e),si(i),"function"==typeof t&&"prototype"===e&&"value"in i&&fi in i&&!i[fi]){var n=di(t,e);n&&n[fi]&&(t[e]=i.value,i={configurable:ui in i?i[ui]:n[ui],enumerable:ci in i?i[ci]:n[ci],writable:!1})}return li(t,e,i)}:li:function(t,e,i){if(si(t),e=ai(e),si(i),oi)try{return li(t,e,i)}catch(t){}if("get"in i||"set"in i)throw new hi("Accessors not supported");return"value"in i&&(t[e]=i.value),t};var pi=Ze,vi=R,gi=M?function(t,e,i){return pi.f(t,e,vi(1,i))}:function(t,e,i){return t[e]=i,t},yi=o,mi=c,bi=x,wi=S,ki=T.f,_i=Ye,xi=et,Ei=$e,Oi=gi,Ci=Qt,Si=function(t){var e=function(i,n,o){if(this instanceof e){switch(arguments.length){case 0:return new t;case 1:return new t(i);case 2:return new t(i,n)}return new t(i,n,o)}return mi(t,this,arguments)};return e.prototype=t.prototype,e},Ti=function(t,e){var i,n,o,r,s,a,h,l,d,c=t.target,u=t.global,f=t.stat,p=t.proto,v=u?yi:f?yi[c]:(yi[c]||{}).prototype,g=u?xi:xi[c]||Oi(xi,c,{})[c],y=g.prototype;for(r in e)n=!(i=_i(u?r:c+(f?".":"#")+r,t.forced))&&v&&Ci(v,r),a=g[r],n&&(h=t.dontCallGetSet?(d=ki(v,r))&&d.value:v[r]),s=n&&h?h:e[r],n&&typeof a==typeof s||(l=t.bind&&n?Ei(s,yi):t.wrap&&n?Si(s):p&&wi(s)?bi(s):s,(t.sham||s&&s.sham||a&&a.sham)&&Oi(l,"sham",!0),Oi(g,r,l),p&&(Ci(xi,o=c+"Prototype")||Oi(xi,o,{}),Oi(xi[o],r,s),t.real&&y&&(i||!y[r])&&Oi(y,r,s)))},Mi=Math.ceil,Pi=Math.floor,Di=Math.trunc||function(t){var e=+t;return(e>0?Pi:Mi)(e)},Ii=function(t){var e=+t;return e!=e||0===e?0:Di(e)},Bi=Ii,Ni=Math.max,Fi=Math.min,zi=function(t,e){var i=Bi(t);return i<0?Ni(i+e,0):Fi(i,e)},Ai=Ii,ji=Math.min,Ri=function(t){return t>0?ji(Ai(t),9007199254740991):0},Li=function(t){return Ri(t.length)},Hi=Z,Wi=zi,qi=Li,Vi=function(t){return function(e,i,n){var o,r=Hi(e),s=qi(r),a=Wi(n,s);if(t&&i!=i){for(;s>a;)if((o=r[a++])!=o)return!0}else for(;s>a;a++)if((t||a in r)&&r[a]===i)return t||a||0;return!t&&-1}},Ui={includes:Vi(!0),indexOf:Vi(!1)},Yi={},Xi=Qt,Gi=Z,Ki=Ui.indexOf,$i=Yi,Zi=g([].push),Qi=function(t,e){var i,n=Gi(t),o=0,r=[];for(i in n)!Xi($i,i)&&Xi(n,i)&&Zi(r,i);for(;e.length>o;)Xi(n,i=e[o++])&&(~Ki(r,i)||Zi(r,i));return r},Ji=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],tn=Qi,en=Ji,nn=Object.keys||function(t){return tn(t,en)},on={};on.f=Object.getOwnPropertySymbols;var rn=M,sn=g,an=I,hn=r,ln=nn,dn=on,cn=B,un=Kt,fn=V,pn=Object.assign,vn=Object.defineProperty,gn=sn([].concat),yn=!pn||hn((function(){if(rn&&1!==pn({b:1},pn(vn({},"a",{enumerable:!0,get:function(){vn(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},i=Symbol("assign detection"),n="abcdefghijklmnopqrst";return t[i]=7,n.split("").forEach((function(t){e[t]=t})),7!==pn({},t)[i]||ln(pn({},e)).join("")!==n}))?function(t,e){for(var i=un(t),n=arguments.length,o=1,r=dn.f,s=cn.f;n>o;)for(var a,h=fn(arguments[o++]),l=r?gn(ln(h),r(h)):ln(h),d=l.length,c=0;d>c;)a=l[c++],rn&&!an(s,h,a)||(i[a]=h[a]);return i}:pn,mn=yn;Ti({target:"Object",stat:!0,arity:2,forced:Object.assign!==mn},{assign:mn});var bn=i(et.Object.assign),wn=g([].slice),kn=g,_n=Dt,xn=tt,En=Qt,On=wn,Cn=s,Sn=Function,Tn=kn([].concat),Mn=kn([].join),Pn={},Dn=Cn?Sn.bind:function(t){var e=_n(this),i=e.prototype,n=On(arguments,1),o=function(){var i=Tn(n,On(arguments));return this instanceof o?function(t,e,i){if(!En(Pn,e)){for(var n=[],o=0;o=.1;)(p=+r[c++%s])>d&&(p=d),f=Math.sqrt(p*p/(1+l*l)),e+=f=a<0?-f:f,i+=l*f,!0===u?t.lineTo(e,i):t.moveTo(e,i),d-=p,u=!u}var Xn={circle:Wn,dashedLine:Yn,database:Un,diamond:function(t,e,i,n){t.beginPath(),t.lineTo(e,i+n),t.lineTo(e+n,i),t.lineTo(e,i-n),t.lineTo(e-n,i),t.closePath()},ellipse:Vn,ellipse_vis:Vn,hexagon:function(t,e,i,n){t.beginPath();var o=2*Math.PI/6;t.moveTo(e+n,i);for(var r=1;r<6;r++)t.lineTo(e+n*Math.cos(o*r),i+n*Math.sin(o*r));t.closePath()},roundRect:qn,square:function(t,e,i,n){t.beginPath(),t.rect(e-n,i-n,2*n,2*n),t.closePath()},star:function(t,e,i,n){t.beginPath(),i+=.1*(n*=.82);for(var o=0;o<10;o++){var r=o%2==0?1.3*n:.5*n;t.lineTo(e+r*Math.sin(2*o*Math.PI/10),i-r*Math.cos(2*o*Math.PI/10))}t.closePath()},triangle:function(t,e,i,n){t.beginPath(),i+=.275*(n*=1.15);var o=2*n,r=o/2,s=Math.sqrt(3)/6*o,a=Math.sqrt(o*o-r*r);t.moveTo(e,i-(a-s)),t.lineTo(e+r,i+s),t.lineTo(e-r,i+s),t.lineTo(e,i-(a-s)),t.closePath()},triangleDown:function(t,e,i,n){t.beginPath(),i-=.275*(n*=1.15);var o=2*n,r=o/2,s=Math.sqrt(3)/6*o,a=Math.sqrt(o*o-r*r);t.moveTo(e,i+(a-s)),t.lineTo(e+r,i-s),t.lineTo(e-r,i-s),t.lineTo(e,i+(a-s)),t.closePath()}};var Gn={exports:{}};!function(t){function e(t){if(t)return function(t){for(var i in e.prototype)t[i]=e.prototype[i];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function i(){this.off(t,i),e.apply(this,arguments)}return i.fn=e,this.on(t,i),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o=a?t?"":void 0:(n=yo(r,s))<55296||n>56319||s+1===a||(o=yo(r,s+1))<56320||o>57343?t?go(r,s):n:t?mo(r,s,s+2):o-56320+(n-55296<<10)+65536}},wo={codeAt:bo(!1),charAt:bo(!0)},ko=S,_o=o.WeakMap,xo=ko(_o)&&/native code/.test(String(_o)),Eo=ne,Oo=Yt("keys"),Co=function(t){return Oo[t]||(Oo[t]=Eo(t))},So=xo,To=o,Mo=tt,Po=gi,Do=Qt,Io=Vt,Bo=Co,No=Yi,Fo="Object already initialized",zo=To.TypeError,Ao=To.WeakMap;if(So||Io.state){var jo=Io.state||(Io.state=new Ao);jo.get=jo.get,jo.has=jo.has,jo.set=jo.set,Zn=function(t,e){if(jo.has(t))throw new zo(Fo);return e.facade=t,jo.set(t,e),e},Qn=function(t){return jo.get(t)||{}},Jn=function(t){return jo.has(t)}}else{var Ro=Bo("state");No[Ro]=!0,Zn=function(t,e){if(Do(t,Ro))throw new zo(Fo);return e.facade=t,Po(t,Ro,e),e},Qn=function(t){return Do(t,Ro)?t[Ro]:{}},Jn=function(t){return Do(t,Ro)}}var Lo={set:Zn,get:Qn,has:Jn,enforce:function(t){return Jn(t)?Qn(t):Zn(t,{})},getterFor:function(t){return function(e){var i;if(!Mo(e)||(i=Qn(e)).type!==t)throw new zo("Incompatible receiver, "+t+" required");return i}}},Ho=M,Wo=Qt,qo=Function.prototype,Vo=Ho&&Object.getOwnPropertyDescriptor,Uo=Wo(qo,"name"),Yo={EXISTS:Uo,PROPER:Uo&&"something"===function(){}.name,CONFIGURABLE:Uo&&(!Ho||Ho&&Vo(qo,"name").configurable)},Xo={},Go=M,Ko=Qe,$o=Ze,Zo=ii,Qo=Z,Jo=nn;Xo.f=Go&&!Ko?Object.defineProperties:function(t,e){Zo(t);for(var i,n=Qo(e),o=Jo(e),r=o.length,s=0;r>s;)$o.f(t,i=o[s++],n[i]);return t};var tr,er=st("document","documentElement"),ir=ii,nr=Xo,or=Ji,rr=Yi,sr=er,ar=Ce,hr="prototype",lr="script",dr=Co("IE_PROTO"),cr=function(){},ur=function(t){return"<"+lr+">"+t+""},fr=function(t){t.write(ur("")),t.close();var e=t.parentWindow.Object;return t=null,e},pr=function(){try{tr=new ActiveXObject("htmlfile")}catch(t){}var t,e,i;pr="undefined"!=typeof document?document.domain&&tr?fr(tr):(e=ar("iframe"),i="java"+lr+":",e.style.display="none",sr.appendChild(e),e.src=String(i),(t=e.contentWindow.document).open(),t.write(ur("document.F=Object")),t.close(),t.F):fr(tr);for(var n=or.length;n--;)delete pr[hr][or[n]];return pr()};rr[dr]=!0;var vr,gr,yr,mr=Object.create||function(t,e){var i;return null!==t?(cr[hr]=ir(t),i=new cr,cr[hr]=null,i[dr]=t):i=pr(),void 0===e?i:nr.f(i,e)},br=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),wr=Qt,kr=S,_r=Kt,xr=br,Er=Co("IE_PROTO"),Or=Object,Cr=Or.prototype,Sr=xr?Or.getPrototypeOf:function(t){var e=_r(t);if(wr(e,Er))return e[Er];var i=e.constructor;return kr(i)&&e instanceof i?i.prototype:e instanceof Or?Cr:null},Tr=gi,Mr=function(t,e,i,n){return n&&n.enumerable?t[e]=i:Tr(t,e,i),t},Pr=r,Dr=S,Ir=tt,Br=mr,Nr=Sr,Fr=Mr,zr=ue("iterator"),Ar=!1;[].keys&&("next"in(yr=[].keys())?(gr=Nr(Nr(yr)))!==Object.prototype&&(vr=gr):Ar=!0);var jr=!Ir(vr)||Pr((function(){var t={};return vr[zr].call(t)!==t}));Dr((vr=jr?{}:Br(vr))[zr])||Fr(vr,zr,(function(){return this}));var Rr={IteratorPrototype:vr,BUGGY_SAFARI_ITERATORS:Ar},Lr=ao,Hr=to?{}.toString:function(){return"[object "+Lr(this)+"]"},Wr=to,qr=Ze.f,Vr=gi,Ur=Qt,Yr=Hr,Xr=ue("toStringTag"),Gr=function(t,e,i,n){if(t){var o=i?t:t.prototype;Ur(o,Xr)||qr(o,Xr,{configurable:!0,value:e}),n&&!Wr&&Vr(o,"toString",Yr)}},Kr={},$r=Rr.IteratorPrototype,Zr=mr,Qr=R,Jr=Gr,ts=Kr,es=function(){return this},is=g,ns=Dt,os=S,rs=String,ss=TypeError,as=function(t,e,i){try{return is(ns(Object.getOwnPropertyDescriptor(t,e)[i]))}catch(t){}},hs=ii,ls=function(t){if("object"==typeof t||os(t))return t;throw new ss("Can't set "+rs(t)+" as a prototype")},ds=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=as(Object.prototype,"__proto__","set"))(i,[]),e=i instanceof Array}catch(t){}return function(i,n){return hs(i),ls(n),e?t(i,n):i.__proto__=n,i}}():void 0),cs=Ti,us=I,fs=Yo,ps=function(t,e,i,n){var o=e+" Iterator";return t.prototype=Zr($r,{next:Qr(+!n,i)}),Jr(t,o,!1,!0),ts[o]=es,t},vs=Sr,gs=Gr,ys=Mr,ms=Kr,bs=Rr,ws=fs.PROPER,ks=bs.BUGGY_SAFARI_ITERATORS,_s=ue("iterator"),xs="keys",Es="values",Os="entries",Cs=function(){return this},Ss=function(t,e,i,n,o,r,s){ps(i,e,n);var a,h,l,d=function(t){if(t===o&&v)return v;if(!ks&&t&&t in f)return f[t];switch(t){case xs:case Es:case Os:return function(){return new i(this,t)}}return function(){return new i(this)}},c=e+" Iterator",u=!1,f=t.prototype,p=f[_s]||f["@@iterator"]||o&&f[o],v=!ks&&p||d(o),g="Array"===e&&f.entries||p;if(g&&(a=vs(g.call(new t)))!==Object.prototype&&a.next&&(gs(a,c,!0,!0),ms[c]=Cs),ws&&o===Es&&p&&p.name!==Es&&(u=!0,v=function(){return us(p,this)}),o)if(h={values:d(Es),keys:r?v:d(xs),entries:d(Os)},s)for(l in h)(ks||u||!(l in f))&&ys(f,l,h[l]);else cs({target:e,proto:!0,forced:ks||u},h);return s&&f[_s]!==v&&ys(f,_s,v,{name:o}),ms[e]=v,h},Ts=function(t,e){return{value:t,done:e}},Ms=wo.charAt,Ps=co,Ds=Lo,Is=Ss,Bs=Ts,Ns="String Iterator",Fs=Ds.set,zs=Ds.getterFor(Ns);Is(String,"String",(function(t){Fs(this,{type:Ns,string:Ps(t),index:0})}),(function(){var t,e=zs(this),i=e.string,n=e.index;return n>=i.length?Bs(void 0,!0):(t=Ms(i,n),e.index+=t.length,Bs(t,!1))}));var As=I,js=ii,Rs=Nt,Ls=function(t,e,i){var n,o;js(t);try{if(!(n=Rs(t,"return"))){if("throw"===e)throw i;return i}n=As(n,t)}catch(t){o=!0,n=t}if("throw"===e)throw i;if(o)throw n;return js(n),i},Hs=ii,Ws=Ls,qs=Kr,Vs=ue("iterator"),Us=Array.prototype,Ys=function(t){return void 0!==t&&(qs.Array===t||Us[Vs]===t)},Xs=S,Gs=Vt,Ks=g(Function.toString);Xs(Gs.inspectSource)||(Gs.inspectSource=function(t){return Ks(t)});var $s=Gs.inspectSource,Zs=g,Qs=r,Js=S,ta=ao,ea=$s,ia=function(){},na=[],oa=st("Reflect","construct"),ra=/^\s*(?:class|function)\b/,sa=Zs(ra.exec),aa=!ra.test(ia),ha=function(t){if(!Js(t))return!1;try{return oa(ia,na,t),!0}catch(t){return!1}},la=function(t){if(!Js(t))return!1;switch(ta(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return aa||!!sa(ra,ea(t))}catch(t){return!0}};la.sham=!0;var da=!oa||Qs((function(){var t;return ha(ha.call)||!ha(Object)||!ha((function(){t=!0}))||t}))?la:ha,ca=_e,ua=Ze,fa=R,pa=function(t,e,i){var n=ca(e);n in t?ua.f(t,n,fa(0,i)):t[n]=i},va=ao,ga=Nt,ya=U,ma=Kr,ba=ue("iterator"),wa=function(t){if(!ya(t))return ga(t,ba)||ga(t,"@@iterator")||ma[va(t)]},ka=I,_a=Dt,xa=ii,Ea=St,Oa=wa,Ca=TypeError,Sa=function(t,e){var i=arguments.length<2?Oa(t):e;if(_a(i))return xa(ka(i,t));throw new Ca(Ea(t)+" is not iterable")},Ta=$e,Ma=I,Pa=Kt,Da=function(t,e,i,n){try{return n?e(Hs(i)[0],i[1]):e(i)}catch(e){Ws(t,"throw",e)}},Ia=Ys,Ba=da,Na=Li,Fa=pa,za=Sa,Aa=wa,ja=Array,Ra=ue("iterator"),La=!1;try{var Ha=0,Wa={next:function(){return{done:!!Ha++}},return:function(){La=!0}};Wa[Ra]=function(){return this},Array.from(Wa,(function(){throw 2}))}catch(t){}var qa=function(t,e){try{if(!e&&!La)return!1}catch(t){return!1}var i=!1;try{var n={};n[Ra]=function(){return{next:function(){return{done:i=!0}}}},t(n)}catch(t){}return i},Va=function(t){var e=Pa(t),i=Ba(this),n=arguments.length,o=n>1?arguments[1]:void 0,r=void 0!==o;r&&(o=Ta(o,n>2?arguments[2]:void 0));var s,a,h,l,d,c,u=Aa(e),f=0;if(!u||this===ja&&Ia(u))for(s=Na(e),a=i?new this(s):ja(s);s>f;f++)c=r?o(e[f],f):e[f],Fa(a,f,c);else for(d=(l=za(e,u)).next,a=i?new this:[];!(h=Ma(d,l)).done;f++)c=r?Da(l,o,[h.value,f],!0):h.value,Fa(a,f,c);return a.length=f,a};Ti({target:"Array",stat:!0,forced:!qa((function(t){Array.from(t)}))},{from:Va});var Ua=et.Array.from,Ya=i(Ua),Xa=Z,Ga=Kr,Ka=Lo;Ze.f;var $a=Ss,Za=Ts,Qa="Array Iterator",Ja=Ka.set,th=Ka.getterFor(Qa);$a(Array,"Array",(function(t,e){Ja(this,{type:Qa,target:Xa(t),index:0,kind:e})}),(function(){var t=th(this),e=t.target,i=t.kind,n=t.index++;if(!e||n>=e.length)return t.target=void 0,Za(void 0,!0);switch(i){case"keys":return Za(n,!1);case"values":return Za(e[n],!1)}return Za([n,e[n]],!1)}),"values"),Ga.Arguments=Ga.Array;var eh=wa,ih={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},nh=o,oh=ao,rh=gi,sh=Kr,ah=ue("toStringTag");for(var hh in ih){var lh=nh[hh],dh=lh&&lh.prototype;dh&&oh(dh)!==ah&&rh(dh,ah,hh),sh[hh]=sh.Array}var ch=eh,uh=i(ch),fh=i(ch);function ph(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var vh={exports:{}},gh=Ti,yh=M,mh=Ze.f;gh({target:"Object",stat:!0,forced:Object.defineProperty!==mh,sham:!yh},{defineProperty:mh});var bh=et.Object,wh=vh.exports=function(t,e,i){return bh.defineProperty(t,e,i)};bh.defineProperty.sham&&(wh.sham=!0);var kh=vh.exports,_h=kh,xh=i(_h),Eh=w,Oh=Array.isArray||function(t){return"Array"===Eh(t)},Ch=TypeError,Sh=function(t){if(t>9007199254740991)throw Ch("Maximum allowed index exceeded");return t},Th=Oh,Mh=da,Ph=tt,Dh=ue("species"),Ih=Array,Bh=function(t){var e;return Th(t)&&(e=t.constructor,(Mh(e)&&(e===Ih||Th(e.prototype))||Ph(e)&&null===(e=e[Dh]))&&(e=void 0)),void 0===e?Ih:e},Nh=function(t,e){return new(Bh(t))(0===e?0:e)},Fh=r,zh=vt,Ah=ue("species"),jh=function(t){return zh>=51||!Fh((function(){var e=[];return(e.constructor={})[Ah]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Rh=Ti,Lh=r,Hh=Oh,Wh=tt,qh=Kt,Vh=Li,Uh=Sh,Yh=pa,Xh=Nh,Gh=jh,Kh=vt,$h=ue("isConcatSpreadable"),Zh=Kh>=51||!Lh((function(){var t=[];return t[$h]=!1,t.concat()[0]!==t})),Qh=function(t){if(!Wh(t))return!1;var e=t[$h];return void 0!==e?!!e:Hh(t)};Rh({target:"Array",proto:!0,arity:1,forced:!Zh||!Gh("concat")},{concat:function(t){var e,i,n,o,r,s=qh(this),a=Xh(s,0),h=0;for(e=-1,n=arguments.length;em;m++)if((a||m in v)&&(f=g(u=v[m],m,p),t))if(e)w[m]=f;else if(f)switch(t){case 3:return!0;case 5:return u;case 6:return m;case 2:Bl(w,u)}else switch(t){case 4:return!1;case 7:Bl(w,u)}return r?-1:n||o?o:w}},Fl={forEach:Nl(0),map:Nl(1),filter:Nl(2),some:Nl(3),every:Nl(4),find:Nl(5),findIndex:Nl(6),filterReject:Nl(7)},zl=Ti,Al=o,jl=I,Rl=g,Ll=M,Hl=bt,Wl=r,ql=Qt,Vl=at,Ul=ii,Yl=Z,Xl=_e,Gl=co,Kl=R,$l=mr,Zl=nn,Ql=Jh,Jl=il,td=on,ed=T,id=Ze,nd=Xo,od=B,rd=Mr,sd=vl,ad=Yt,hd=Yi,ld=ne,dd=ue,cd=gl,ud=_l,fd=Sl,pd=Gr,vd=Lo,gd=Fl.forEach,yd=Co("hidden"),md="Symbol",bd="prototype",wd=vd.set,kd=vd.getterFor(md),_d=Object[bd],xd=Al.Symbol,Ed=xd&&xd[bd],Od=Al.RangeError,Cd=Al.TypeError,Sd=Al.QObject,Td=ed.f,Md=id.f,Pd=Jl.f,Dd=od.f,Id=Rl([].push),Bd=ad("symbols"),Nd=ad("op-symbols"),Fd=ad("wks"),zd=!Sd||!Sd[bd]||!Sd[bd].findChild,Ad=function(t,e,i){var n=Td(_d,e);n&&delete _d[e],Md(t,e,i),n&&t!==_d&&Md(_d,e,n)},jd=Ll&&Wl((function(){return 7!==$l(Md({},"a",{get:function(){return Md(this,"a",{value:7}).a}})).a}))?Ad:Md,Rd=function(t,e){var i=Bd[t]=$l(Ed);return wd(i,{type:md,tag:t,description:e}),Ll||(i.description=e),i},Ld=function(t,e,i){t===_d&&Ld(Nd,e,i),Ul(t);var n=Xl(e);return Ul(i),ql(Bd,n)?(i.enumerable?(ql(t,yd)&&t[yd][n]&&(t[yd][n]=!1),i=$l(i,{enumerable:Kl(0,!1)})):(ql(t,yd)||Md(t,yd,Kl(1,{})),t[yd][n]=!0),jd(t,n,i)):Md(t,n,i)},Hd=function(t,e){Ul(t);var i=Yl(e),n=Zl(i).concat(Ud(i));return gd(n,(function(e){Ll&&!jl(Wd,i,e)||Ld(t,e,i[e])})),t},Wd=function(t){var e=Xl(t),i=jl(Dd,this,e);return!(this===_d&&ql(Bd,e)&&!ql(Nd,e))&&(!(i||!ql(this,e)||!ql(Bd,e)||ql(this,yd)&&this[yd][e])||i)},qd=function(t,e){var i=Yl(t),n=Xl(e);if(i!==_d||!ql(Bd,n)||ql(Nd,n)){var o=Td(i,n);return!o||!ql(Bd,n)||ql(i,yd)&&i[yd][n]||(o.enumerable=!0),o}},Vd=function(t){var e=Pd(Yl(t)),i=[];return gd(e,(function(t){ql(Bd,t)||ql(hd,t)||Id(i,t)})),i},Ud=function(t){var e=t===_d,i=Pd(e?Nd:Yl(t)),n=[];return gd(i,(function(t){!ql(Bd,t)||e&&!ql(_d,t)||Id(n,Bd[t])})),n};Hl||(xd=function(){if(Vl(Ed,this))throw new Cd("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?Gl(arguments[0]):void 0,e=ld(t),i=function(t){this===_d&&jl(i,Nd,t),ql(this,yd)&&ql(this[yd],e)&&(this[yd][e]=!1);var n=Kl(1,t);try{jd(this,e,n)}catch(t){if(!(t instanceof Od))throw t;Ad(this,e,n)}};return Ll&&zd&&jd(_d,e,{configurable:!0,set:i}),Rd(e,t)},rd(Ed=xd[bd],"toString",(function(){return kd(this).tag})),rd(xd,"withoutSetter",(function(t){return Rd(ld(t),t)})),od.f=Wd,id.f=Ld,nd.f=Hd,ed.f=qd,Ql.f=Jl.f=Vd,td.f=Ud,cd.f=function(t){return Rd(dd(t),t)},Ll&&sd(Ed,"description",{configurable:!0,get:function(){return kd(this).description}})),zl({global:!0,constructor:!0,wrap:!0,forced:!Hl,sham:!Hl},{Symbol:xd}),gd(Zl(Fd),(function(t){ud(t)})),zl({target:md,stat:!0,forced:!Hl},{useSetter:function(){zd=!0},useSimple:function(){zd=!1}}),zl({target:"Object",stat:!0,forced:!Hl,sham:!Ll},{create:function(t,e){return void 0===e?$l(t):Hd($l(t),e)},defineProperty:Ld,defineProperties:Hd,getOwnPropertyDescriptor:qd}),zl({target:"Object",stat:!0,forced:!Hl},{getOwnPropertyNames:Vd}),fd(),pd(xd,md),hd[yd]=!0;var Yd=bt&&!!Symbol.for&&!!Symbol.keyFor,Xd=Ti,Gd=st,Kd=Qt,$d=co,Zd=Yt,Qd=Yd,Jd=Zd("string-to-symbol-registry"),tc=Zd("symbol-to-string-registry");Xd({target:"Symbol",stat:!0,forced:!Qd},{for:function(t){var e=$d(t);if(Kd(Jd,e))return Jd[e];var i=Gd("Symbol")(e);return Jd[e]=i,tc[i]=e,i}});var ec=Ti,ic=Qt,nc=Ot,oc=St,rc=Yd,sc=Yt("symbol-to-string-registry");ec({target:"Symbol",stat:!0,forced:!rc},{keyFor:function(t){if(!nc(t))throw new TypeError(oc(t)+" is not a symbol");if(ic(sc,t))return sc[t]}});var ac=Oh,hc=S,lc=w,dc=co,cc=g([].push),uc=Ti,fc=st,pc=c,vc=I,gc=g,yc=r,mc=S,bc=Ot,wc=wn,kc=function(t){if(hc(t))return t;if(ac(t)){for(var e=t.length,i=[],n=0;nt.length)&&(e=t.length);for(var i=0,n=new Array(e);i1?arguments[1]:void 0)}});var Bf=Nn("Array").map,Nf=at,Ff=Bf,zf=Array.prototype,Af=function(t){var e=t.map;return t===zf||Nf(zf,t)&&e===zf.map?Ff:e},jf=i(Af),Rf=Kt,Lf=nn;Ti({target:"Object",stat:!0,forced:r((function(){Lf(1)}))},{keys:function(t){return Lf(Rf(t))}});var Hf=i(et.Object.keys),Wf=Ti,qf=Date,Vf=g(qf.prototype.getTime);Wf({target:"Date",stat:!0},{now:function(){return Vf(new qf)}});var Uf=i(et.Date.now),Yf=r,Xf=function(t,e){var i=[][t];return!!i&&Yf((function(){i.call(null,e||function(){return 1},1)}))},Gf=Fl.forEach,Kf=Xf("forEach")?[].forEach:function(t){return Gf(this,t,arguments.length>1?arguments[1]:void 0)};Ti({target:"Array",proto:!0,forced:[].forEach!==Kf},{forEach:Kf});var $f=Nn("Array").forEach,Zf=ao,Qf=Qt,Jf=at,tp=$f,ep=Array.prototype,ip={DOMTokenList:!0,NodeList:!0},np=function(t){var e=t.forEach;return t===ep||Jf(ep,t)&&e===ep.forEach||Qf(ip,Zf(t))?tp:e},op=i(np),rp=Ti,sp=Oh,ap=g([].reverse),hp=[1,2];rp({target:"Array",proto:!0,forced:String(hp)===String(hp.reverse())},{reverse:function(){return sp(this)&&(this.length=this.length),ap(this)}});var lp=Nn("Array").reverse,dp=at,cp=lp,up=Array.prototype,fp=function(t){var e=t.reverse;return t===up||dp(up,t)&&e===up.reverse?cp:e},pp=fp,vp=i(pp),gp=St,yp=TypeError,mp=function(t,e){if(!delete t[e])throw new yp("Cannot delete property "+gp(e)+" of "+gp(t))},bp=Ti,wp=Kt,kp=zi,_p=Ii,xp=Li,Ep=Pu,Op=Sh,Cp=Nh,Sp=pa,Tp=mp,Mp=jh("splice"),Pp=Math.max,Dp=Math.min;bp({target:"Array",proto:!0,forced:!Mp},{splice:function(t,e){var i,n,o,r,s,a,h=wp(this),l=xp(h),d=kp(t,l),c=arguments.length;for(0===c?i=n=0:1===c?(i=0,n=l-d):(i=c-2,n=Dp(Pp(_p(e),0),l-d)),Op(l+i-n),o=Cp(h,n),r=0;rl-n+i;r--)Tp(h,r-1)}else if(i>n)for(r=l-n;r>d;r--)a=r+i-1,(s=r+n-1)in h?h[a]=h[s]:Tp(h,a);for(r=0;r1?arguments[1]:void 0)}});var Rp=Nn("Array").includes,Lp=tt,Hp=w,Wp=ue("match"),qp=function(t){var e;return Lp(t)&&(void 0!==(e=t[Wp])?!!e:"RegExp"===Hp(t))},Vp=TypeError,Up=ue("match"),Yp=Ti,Xp=function(t){if(qp(t))throw new Vp("The method doesn't accept regular expressions");return t},Gp=G,Kp=co,$p=function(t){var e=/./;try{"/./"[t](e)}catch(i){try{return e[Up]=!1,"/./"[t](e)}catch(t){}}return!1},Zp=g("".indexOf);Yp({target:"String",proto:!0,forced:!$p("includes")},{includes:function(t){return!!~Zp(Kp(Gp(this)),Kp(Xp(t)),arguments.length>1?arguments[1]:void 0)}});var Qp=Nn("String").includes,Jp=at,tv=Rp,ev=Qp,iv=Array.prototype,nv=String.prototype,ov=function(t){var e=t.includes;return t===iv||Jp(iv,t)&&e===iv.includes?tv:"string"==typeof t||t===nv||Jp(nv,t)&&e===nv.includes?ev:e},rv=i(ov),sv=Kt,av=Sr,hv=br;Ti({target:"Object",stat:!0,forced:r((function(){av(1)})),sham:!hv},{getPrototypeOf:function(t){return av(sv(t))}});var lv=et.Object.getPrototypeOf,dv=i(lv),cv=Fl.filter;Ti({target:"Array",proto:!0,forced:!jh("filter")},{filter:function(t){return cv(this,t,arguments.length>1?arguments[1]:void 0)}});var uv=Nn("Array").filter,fv=at,pv=uv,vv=Array.prototype,gv=function(t){var e=t.filter;return t===vv||fv(vv,t)&&e===vv.filter?pv:e},yv=i(gv),mv=M,bv=r,wv=g,kv=Sr,_v=nn,xv=Z,Ev=wv(B.f),Ov=wv([].push),Cv=mv&&bv((function(){var t=Object.create(null);return t[2]=2,!Ev(t,2)})),Sv=function(t){return function(e){for(var i,n=xv(e),o=_v(n),r=Cv&&null===kv(n),s=o.length,a=0,h=[];s>a;)i=o[a++],mv&&!(r?i in n:Ev(n,i))||Ov(h,t?[i,n[i]]:n[i]);return h}},Tv={entries:Sv(!0),values:Sv(!1)},Mv=Tv.values;Ti({target:"Object",stat:!0},{values:function(t){return Mv(t)}});var Pv=i(et.Object.values),Dv="\t\n\v\f\r                 \u2028\u2029\ufeff",Iv=G,Bv=co,Nv=Dv,Fv=g("".replace),zv=RegExp("^["+Nv+"]+"),Av=RegExp("(^|[^"+Nv+"])["+Nv+"]+$"),jv=function(t){return function(e){var i=Bv(Iv(e));return 1&t&&(i=Fv(i,zv,"")),2&t&&(i=Fv(i,Av,"$1")),i}},Rv={start:jv(1),end:jv(2),trim:jv(3)},Lv=o,Hv=r,Wv=g,qv=co,Vv=Rv.trim,Uv=Dv,Yv=Lv.parseInt,Xv=Lv.Symbol,Gv=Xv&&Xv.iterator,Kv=/^[+-]?0x/i,$v=Wv(Kv.exec),Zv=8!==Yv(Uv+"08")||22!==Yv(Uv+"0x16")||Gv&&!Hv((function(){Yv(Object(Gv))}))?function(t,e){var i=Vv(qv(t));return Yv(i,e>>>0||($v(Kv,i)?16:10))}:Yv;Ti({global:!0,forced:parseInt!==Zv},{parseInt:Zv});var Qv=i(et.parseInt),Jv=Ti,tg=Ui.indexOf,eg=Xf,ig=x([].indexOf),ng=!!ig&&1/ig([1],1,-0)<0;Jv({target:"Array",proto:!0,forced:ng||!eg("indexOf")},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return ng?ig(this,t,e)||0:tg(this,t,e)}});var og=Nn("Array").indexOf,rg=at,sg=og,ag=Array.prototype,hg=function(t){var e=t.indexOf;return t===ag||rg(ag,t)&&e===ag.indexOf?sg:e},lg=i(hg),dg=Tv.entries;Ti({target:"Object",stat:!0},{entries:function(t){return dg(t)}});var cg=i(et.Object.entries);Ti({target:"Object",stat:!0,sham:!M},{create:mr});var ug=et.Object,fg=function(t,e){return ug.create(t,e)},pg=i(fg),vg=et,gg=c;vg.JSON||(vg.JSON={stringify:JSON.stringify});var yg=function(t,e,i){return gg(vg.JSON.stringify,null,arguments)},mg=i(yg),bg="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,wg=TypeError,kg=function(t,e){if(ti,s=Eg(n)?n:Mg(n),a=r?Sg(arguments,i):[],h=r?function(){xg(s,this,a)}:s;return e?t(h,o):t(h)}:t},Ig=Ti,Bg=o,Ng=Dg(Bg.setInterval,!0);Ig({global:!0,bind:!0,forced:Bg.setInterval!==Ng},{setInterval:Ng});var Fg=Ti,zg=o,Ag=Dg(zg.setTimeout,!0);Fg({global:!0,bind:!0,forced:zg.setTimeout!==Ag},{setTimeout:Ag});var jg=i(et.setTimeout),Rg=Kt,Lg=zi,Hg=Li,Wg=function(t){for(var e=Rg(this),i=Hg(e),n=arguments.length,o=Lg(n>1?arguments[1]:void 0,i),r=n>2?arguments[2]:void 0,s=void 0===r?i:Lg(r,i);s>o;)e[o++]=t;return e};Ti({target:"Array",proto:!0},{fill:Wg});var qg,Vg=Nn("Array").fill,Ug=at,Yg=Vg,Xg=Array.prototype,Gg=function(t){var e=t.fill;return t===Xg||Ug(Xg,t)&&e===Xg.fill?Yg:e},Kg=i(Gg);function $g(){return $g=Object.assign||function(t){for(var e=1;e-1}var jy=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===ly&&(t=this.compute()),hy&&this.manager.element.style&&vy[t]&&(this.manager.element.style[ay]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return Fy(this.manager.recognizers,(function(e){zy(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(Ay(t,uy))return uy;var e=Ay(t,fy),i=Ay(t,py);return e&&i?uy:e||i?e?fy:py:Ay(t,cy)?cy:dy}(t.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,o=Ay(n,uy)&&!vy[uy],r=Ay(n,py)&&!vy[py],s=Ay(n,fy)&&!vy[fy];if(o){var a=1===t.pointers.length,h=t.distance<2,l=t.deltaTime<250;if(a&&h&&l)return}if(!s||!r)return o||r&&i&Py||s&&i&Dy?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function Ry(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Ly(t){var e=t.length;if(1===e)return{x:ny(t[0].clientX),y:ny(t[0].clientY)};for(var i=0,n=0,o=0;o=oy(e)?t<0?Cy:Sy:e<0?Ty:My}function Uy(t,e,i){return{x:e/t||0,y:i/t||0}}function Yy(t,e){var i=t.session,n=e.pointers,o=n.length;i.firstInput||(i.firstInput=Hy(e)),o>1&&!i.firstMultiple?i.firstMultiple=Hy(e):1===o&&(i.firstMultiple=!1);var r=i.firstInput,s=i.firstMultiple,a=s?s.center:r.center,h=e.center=Ly(n);e.timeStamp=ry(),e.deltaTime=e.timeStamp-r.timeStamp,e.angle=qy(a,h),e.distance=Wy(a,h),function(t,e){var i=e.center,n=t.offsetDelta||{},o=t.prevDelta||{},r=t.prevInput||{};e.eventType!==_y&&r.eventType!==xy||(o=t.prevDelta={x:r.deltaX||0,y:r.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=o.x+(i.x-n.x),e.deltaY=o.y+(i.y-n.y)}(i,e),e.offsetDirection=Vy(e.deltaX,e.deltaY);var l,d,c=Uy(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=oy(c.x)>oy(c.y)?c.x:c.y,e.scale=s?(l=s.pointers,Wy((d=n)[0],d[1],Ny)/Wy(l[0],l[1],Ny)):1,e.rotation=s?function(t,e){return qy(e[1],e[0],Ny)+qy(t[1],t[0],Ny)}(s.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,o,r,s=t.lastInterval||e,a=e.timeStamp-s.timeStamp;if(e.eventType!==Ey&&(a>ky||void 0===s.velocity)){var h=e.deltaX-s.deltaX,l=e.deltaY-s.deltaY,d=Uy(a,h,l);n=d.x,o=d.y,i=oy(d.x)>oy(d.y)?d.x:d.y,r=Vy(h,l),t.lastInterval=e}else i=s.velocity,n=s.velocityX,o=s.velocityY,r=s.direction;e.velocity=i,e.velocityX=n,e.velocityY=o,e.direction=r}(i,e);var u,f=t.element,p=e.srcEvent;Ry(u=p.composedPath?p.composedPath()[0]:p.path?p.path[0]:p.target,f)&&(f=u),e.target=f}function Xy(t,e,i){var n=i.pointers.length,o=i.changedPointers.length,r=e&_y&&n-o==0,s=e&(xy|Ey)&&n-o==0;i.isFirst=!!r,i.isFinal=!!s,r&&(t.session={}),i.eventType=e,Yy(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function Gy(t){return t.trim().split(/\s+/g)}function Ky(t,e,i){Fy(Gy(e),(function(e){t.addEventListener(e,i,!1)}))}function $y(t,e,i){Fy(Gy(e),(function(e){t.removeEventListener(e,i,!1)}))}function Zy(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||window}var Qy=function(){function t(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){zy(t.options.enable,[t])&&i.handler(e)},this.init()}var e=t.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Ky(this.element,this.evEl,this.domHandler),this.evTarget&&Ky(this.target,this.evTarget,this.domHandler),this.evWin&&Ky(Zy(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&$y(this.element,this.evEl,this.domHandler),this.evTarget&&$y(this.target,this.evTarget,this.domHandler),this.evWin&&$y(Zy(this.element),this.evWin,this.domHandler)},t}();function Jy(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;ni[e]})):n.sort()),n}var am={touchstart:_y,touchmove:2,touchend:xy,touchcancel:Ey},hm=function(t){function e(){var i;return e.prototype.evTarget="touchstart touchmove touchend touchcancel",(i=t.apply(this,arguments)||this).targetIds={},i}return Zg(e,t),e.prototype.handler=function(t){var e=am[t.type],i=lm.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:by,srcEvent:t})},e}(Qy);function lm(t,e){var i,n,o=rm(t.touches),r=this.targetIds;if(e&(2|_y)&&1===o.length)return r[o[0].identifier]=!0,[o,o];var s=rm(t.changedTouches),a=[],h=this.target;if(n=o.filter((function(t){return Ry(t.target,h)})),e===_y)for(i=0;i-1&&n.splice(t,1)}),um)}}function pm(t,e){t&_y?(this.primaryTouch=e.changedPointers[0].identifier,fm.call(this,e)):t&(xy|Ey)&&fm.call(this,e)}function vm(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n-1&&this.requireFail.splice(e,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i<8&&n(e.options.event+km(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=8&&n(e.options.event+km(i))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=mm},e.canEmit=function(){for(var t=0;te.threshold&&o&e.direction},i.attrTest=function(t){return Em.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},i.emit=function(e){this.pX=e.deltaX,this.pY=e.deltaY;var i=Om(e.direction);i&&(e.additionalEvent=this.options.event+i),t.prototype.emit.call(this,e)},e}(Em),Sm=function(t){function e(e){return void 0===e&&(e={}),t.call(this,$g({event:"swipe",threshold:10,velocity:.3,direction:Py|Dy,pointers:1},e))||this}Zg(e,t);var i=e.prototype;return i.getTouchAction=function(){return Cm.prototype.getTouchAction.call(this)},i.attrTest=function(e){var i,n=this.options.direction;return n&(Py|Dy)?i=e.overallVelocity:n&Py?i=e.overallVelocityX:n&Dy&&(i=e.overallVelocityY),t.prototype.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers===this.options.pointers&&oy(i)>this.options.velocity&&e.eventType&xy},i.emit=function(t){var e=Om(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)},e}(Em),Tm=function(t){function e(e){return void 0===e&&(e={}),t.call(this,$g({event:"pinch",threshold:0,pointers:2},e))||this}Zg(e,t);var i=e.prototype;return i.getTouchAction=function(){return[uy]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},i.emit=function(e){if(1!==e.scale){var i=e.scale<1?"in":"out";e.additionalEvent=this.options.event+i}t.prototype.emit.call(this,e)},e}(Em),Mm=function(t){function e(e){return void 0===e&&(e={}),t.call(this,$g({event:"rotate",threshold:0,pointers:2},e))||this}Zg(e,t);var i=e.prototype;return i.getTouchAction=function(){return[uy]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)},e}(Em),Pm=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,$g({event:"press",pointers:1,time:251,threshold:9},e))||this)._timer=null,i._input=null,i}Zg(e,t);var i=e.prototype;return i.getTouchAction=function(){return[dy]},i.process=function(t){var e=this,i=this.options,n=t.pointers.length===i.pointers,o=t.distancei.time;if(this._input=t,!o||!n||t.eventType&(xy|Ey)&&!r)this.reset();else if(t.eventType&_y)this.reset(),this._timer=setTimeout((function(){e.state=8,e.tryEmit()}),i.time);else if(t.eventType&xy)return 8;return mm},i.reset=function(){clearTimeout(this._timer)},i.emit=function(t){8===this.state&&(t&&t.eventType&xy?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=ry(),this.manager.emit(this.options.event,this._input)))},e}(_m),Dm={domEvents:!1,touchAction:ly,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Im=[[Mm,{enable:!1}],[Tm,{enable:!1},["rotate"]],[Sm,{direction:Py}],[Cm,{direction:Py},["swipe"]],[xm],[xm,{event:"doubletap",taps:2},["tap"]],[Pm]];function Bm(t,e){var i,n=t.element;n.style&&(Fy(t.options.cssProps,(function(o,r){i=sy(n.style,r),e?(t.oldCssProps[i]=n.style[i],n.style[i]=o):n.style[i]=t.oldCssProps[i]||""})),e||(t.oldCssProps={}))}var Nm=function(){function t(t,e){var i,n=this;this.options=ty({},Dm,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((i=this).options.inputClass||(yy?om:my?hm:gy?gm:cm))(i,Xy),this.touchAction=new jy(this,this.options.touchAction),Bm(this,!0),Fy(this.options.recognizers,(function(t){var e=n.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}var e=t.prototype;return e.set=function(t){return ty(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?2:1},e.recognize=function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,o=e.curRecognizer;(!o||o&&8&o.state)&&(e.curRecognizer=null,o=null);for(var r=0;r\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,n,i),t.apply(this,arguments)}}var Rm=jm((function(t,e,i){for(var n=Object.keys(e),o=0;o=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,r=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw r}}}}function Ym(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i1?i-1:0),o=1;o2)return $m.apply(void 0,_f(n=[Km(e[0],e[1])]).call(n,vf(xf(e).call(e,2))));var o=e[0],r=e[1];if(o instanceof Date&&r instanceof Date)return o.setTime(r.getTime()),o;var s,a=Um(Pf(r));try{for(a.s();!(s=a.n()).done;){var h=s.value;Object.prototype.propertyIsEnumerable.call(r,h)&&(r[h]===Xm?delete o[h]:null===o[h]||null===r[h]||"object"!==bu(o[h])||"object"!==bu(r[h])||Df(o[h])||Df(r[h])?o[h]=Zm(r[h]):o[h]=$m(o[h],r[h]))}}catch(t){a.e(t)}finally{a.f()}return o}function Zm(t){return Df(t)?jf(t).call(t,(function(t){return Zm(t)})):"object"===bu(t)&&null!==t?t instanceof Date?new Date(t.getTime()):$m({},t):t}function Qm(t){for(var e=0,i=Hf(t);e>>0,t=(o*=t)>>>0,t+=4294967296*(o-=t)}return 2.3283064365386963e-10*(t>>>0)}}(),e=t(" "),i=t(" "),n=t(" "),o=0;o2&&void 0!==arguments[2]&&arguments[2];for(var n in t)if(void 0!==e[n])if(null===e[n]||"object"!==bu(e[n]))cb(t,e,n,i);else{var o=t[n],r=e[n];db(o)&&db(r)&&ub(o,r,i)}}var fb=bn;function pb(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Df(i))throw new TypeError("Arrays are not supported by deepExtend");for(var o=0;o3&&void 0!==arguments[3]&&arguments[3];if(Df(i))throw new TypeError("Arrays are not supported by deepExtend");for(var o in i)if(Object.prototype.hasOwnProperty.call(i,o)&&!rv(t).call(t,o))if(i[o]&&i[o].constructor===Object)void 0===e[o]&&(e[o]={}),e[o].constructor===Object?gb(e[o],i[o]):cb(e,i,o,n);else if(Df(i[o])){e[o]=[];for(var r=0;r2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)||!0===i)if("object"===bu(e[o])&&null!==e[o]&&dv(e[o])===Object.prototype)void 0===t[o]?t[o]=gb({},e[o],i):"object"===bu(t[o])&&null!==t[o]&&dv(t[o])===Object.prototype?gb(t[o],e[o],i):cb(t,e,o,n);else if(Df(e[o])){var r;t[o]=xf(r=e[o]).call(r)}else cb(t,e,o,n);return t}function yb(t,e){var i;return _f(i=[]).call(i,vf(t),[e])}function mb(t){return xf(t).call(t)}function bb(t){return t.getBoundingClientRect().left}function wb(t){return t.getBoundingClientRect().top}function kb(t,e){if(Df(t))for(var i=t.length,n=0;n3&&void 0!==arguments[3]?arguments[3]:{},o=function(t){return null!=t},r=function(t){return null!==t&&"object"===bu(t)};if(!r(t))throw new Error("Parameter mergeTarget must be an object");if(!r(e))throw new Error("Parameter options must be an object");if(!o(i))throw new Error("Parameter option must have a value");if(!r(n))throw new Error("Parameter globalOptions must be an object");var s=e[i],a=r(n)&&!function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}(n)?n[i]:void 0,h=a?a.enabled:void 0;if(void 0!==s){if("boolean"==typeof s)return r(t[i])||(t[i]={}),void(t[i].enabled=s);if(null===s&&!r(t[i])){if(!o(a))return;t[i]=pg(a)}if(r(s)){var l=!0;void 0!==s.enabled?l=s.enabled:void 0!==h&&(l=a.enabled),function(t,e,i){r(t[i])||(t[i]={});var n=e[i],o=t[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(o[s]=n[s])}(t,e,i),t[i].enabled=l}}}var jb={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}};function Rb(t,e){var i;Df(e)||(e=[e]);var n,o=Um(t);try{for(o.s();!(n=o.n()).done;){var r=n.value;if(r){i=r[e[0]];for(var s=1;s0&&void 0!==arguments[0]?arguments[0]:1;ph(this,t),this.pixelRatio=e,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=function(){},this.closeCallback=function(){},this._create()}return xu(t,[{key:"insertTo",value:function(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}},{key:"setCloseCallback",value:function(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}},{key:"_isColorString",value:function(t){if("string"==typeof t)return Lb[t]}},{key:"setColor",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"!==t){var i,n=this._isColorString(t);if(void 0!==n&&(t=n),!0===lb(t)){if(!0===Nb(t)){var o=t.substr(4).substr(0,t.length-5).split(",");i={r:o[0],g:o[1],b:o[2],a:1}}else if(!0===Fb(t)){var r=t.substr(5).substr(0,t.length-6).split(",");i={r:r[0],g:r[1],b:r[2],a:r[3]}}else if(!0===Bb(t)){var s=Eb(t);i={r:s.r,g:s.g,b:s.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){var a=void 0!==t.a?t.a:"1.0";i={r:t.r,g:t.g,b:t.b,a:a}}if(void 0===i)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: "+mg(t));this._setColor(i,e)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var t=this;!0===(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.previousColor=bn({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",jg((function(){void 0!==t.closeCallback&&(t.closeCallback(),t.closeCallback=void 0)}),0)}},{key:"_save",value:function(){this.updateCallback(this.color),this.applied=!1,this._hide()}},{key:"_apply",value:function(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}},{key:"_loadLast",value:function(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}},{key:"_setColor",value:function(t){!0===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&(this.initialColor=bn({},t)),this.color=t;var e=Tb(t.r,t.g,t.b),i=2*Math.PI,n=this.r*e.s,o=this.centerCoordinates.x+n*Math.sin(i*e.h),r=this.centerCoordinates.y+n*Math.cos(i*e.h);this.colorPickerSelector.style.left=o-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=r-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(t)}},{key:"_setOpacity",value:function(t){this.color.a=t/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(t){var e=Tb(this.color.r,this.color.g,this.color.b);e.v=t/100;var i=Pb(e.h,e.s,e.v);i.a=this.color.a,this.color=i,this._updatePicker()}},{key:"_updatePicker",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,e=Tb(t.r,t.g,t.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(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);var n=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,n,o),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-e.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),Kg(i).call(i),this.brightnessRange.value=100*e.v,this.opacityRange.value=100*t.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+")"}},{key:"_setSize",value:function(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}},{key:"_create",value:function(){var t,e,i,n;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){var 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{var r=document.createElement("DIV");r.style.color="red",r.style.fontWeight="bold",r.style.padding="10px",r.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(r)}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(t){}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(t){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var 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=Hn(t=this._hide).call(t,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=Hn(e=this._apply).call(e,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=Hn(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=Hn(n=this._loadLast).call(n,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)}},{key:"_bindHammer",value:function(){var t=this;this.drag={},this.pinch={},this.hammer=new tb(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",(function(e){e.isFirst&&t._moveSelector(e)})),this.hammer.on("tap",(function(e){t._moveSelector(e)})),this.hammer.on("panstart",(function(e){t._moveSelector(e)})),this.hammer.on("panmove",(function(e){t._moveSelector(e)})),this.hammer.on("panend",(function(e){t._moveSelector(e)}))}},{key:"_generateHueCircle",value:function(){if(!1===this.generated){var t=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var e,i,n,o,r=this.colorPickerCanvas.clientWidth,s=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,r,s),this.centerCoordinates={x:.5*r,y:.5*s},this.r=.49*r;var a,h=2*Math.PI/360,l=1/this.r;for(n=0;n<360;n++)for(o=0;o3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return!1};ph(this,t),this.parent=e,this.changedOptions=[],this.container=i,this.allowCreation=!1,this.hideOption=r,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},bn(this.options,this.defaultOptions),this.configureOptions=n,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new Hb(o),this.wrapper=void 0}return xu(t,[{key:"setOptions",value:function(t){if(void 0!==t){this.popupHistory={},this._removePopup();var e=!0;if("string"==typeof t)this.options.filter=t;else if(Df(t))this.options.filter=t.join();else if("object"===bu(t)){if(null==t)throw new TypeError("options cannot be null");void 0!==t.container&&(this.options.container=t.container),void 0!==yv(t)&&(this.options.filter=yv(t)),void 0!==t.showButton&&(this.options.showButton=t.showButton),void 0!==t.enabled&&(e=t.enabled)}else"boolean"==typeof t?(this.options.filter=!0,e=t):"function"==typeof t&&(this.options.filter=t,e=!0);!1===yv(this.options)&&(e=!1),this.options.enabled=e}this._clean()}},{key:"setModuleOptions",value:function(t){this.moduleOptions=t,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){this._clean(),this.changedOptions=[];var t=yv(this.options),e=0,i=!1;for(var n in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,n)&&(this.allowCreation=!1,i=!1,"function"==typeof t?i=(i=t(n,[]))||this._handleObject(this.configureOptions[n],[n],!0):!0!==t&&-1===lg(t).call(t,n)||(i=!0),!1!==i&&(this.allowCreation=!0,e>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),e++);this._makeButton(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var t=0;t1?i-1:0),o=1;o2&&void 0!==arguments[2]&&arguments[2],n=document.createElement("div");if(n.className="vis-configuration vis-config-label vis-config-s"+e.length,!0===i){for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(Wb("i","b",t))}else n.innerText=t+":";return n}},{key:"_makeDropdown",value:function(t,e,i){var n=document.createElement("select");n.className="vis-configuration vis-config-select";var o=0;void 0!==e&&-1!==lg(t).call(t,e)&&(o=lg(t).call(t,e));for(var r=0;rr&&1!==r&&(a.max=Math.ceil(e*d),l=a.max,h="range increased"),a.value=e}else a.value=n;var c=document.createElement("input");c.className="vis-configuration vis-config-rangeinput",c.value=a.value;var u=this;a.onchange=function(){c.value=this.value,u._update(Number(this.value),i)},a.oninput=function(){c.value=this.value};var f=this._makeLabel(i[i.length-1],i),p=this._makeItem(i,f,a,c);""!==h&&this.popupHistory[p]!==l&&(this.popupHistory[p]=l,this._setupPopup(h,p))}},{key:"_makeButton",value:function(){var t=this;if(!0===this.options.showButton){var e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerText="generate options",e.onclick=function(){t._printOptions()},e.onmouseover=function(){e.className="vis-configuration vis-config-button hover"},e.onmouseout=function(){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)}}},{key:"_setupPopup",value:function(t,e){var i=this;if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!1,o=yv(this.options),r=!1;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){n=!0;var a=t[s],h=yb(e,s);if("function"==typeof o&&!1===(n=o(s,e))&&!Df(a)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,n=this._handleObject(a,h,!0),this.allowCreation=!1===i),!1!==n){r=!0;var l=this._getValue(h);if(Df(a))this._handleArray(a,l,h);else if("string"==typeof a)this._makeTextInput(a,l,h);else if("boolean"==typeof a)this._makeCheckbox(a,l,h);else if(a instanceof Object){if(!this.hideOption(e,s,this.moduleOptions))if(void 0!==a.enabled){var d=yb(h,"enabled"),c=this._getValue(d);if(!0===c){var u=this._makeLabel(s,h,!0);this._makeItem(h,u),r=this._handleObject(a,h)||r}else this._makeCheckbox(a,c,h)}else{var f=this._makeLabel(s,h,!0);this._makeItem(h,f),r=this._handleObject(a,h)||r}}else console.error("dont know how to handle",a,s,h)}}return r}},{key:"_handleArray",value:function(t,e,i){"string"==typeof t[0]&&"color"===t[0]?(this._makeColorField(t,e,i),t[1]!==e&&this.changedOptions.push({path:i,value:e})):"string"==typeof t[0]?(this._makeDropdown(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:e})):"number"==typeof t[0]&&(this._makeRange(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:Number(e)}))}},{key:"_update",value:function(t,e){var i=this._constructOptions(t,e);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)}},{key:"_constructOptions",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i;t="false"!==(t="true"===t||t)&&t;for(var o=0;oo-this.padding&&(a=!0),r=a?this.x-i:this.x,s=h?this.y-e:this.y}else(s=this.y-e)+e+this.padding>n&&(s=n-e-this.padding),so&&(r=o-i-this.padding),rs.distance?" in "+t.printLocation(r.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+t.printLocation(s.path,s.closestMatch,""):r.distance<=8?'. Did you mean "'+r.closestMatch+'"?'+t.printLocation(r.path,e):". Did you mean one of these: "+t.print(Hf(i))+t.printLocation(n,e),console.error('%cUnknown option detected: "'+e+'"'+o,Xb),Yb=!0}},{key:"findInOptions",value:function(e,i,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=1e9,s="",a=[],h=e.toLowerCase(),l=void 0;for(var d in i){var c=void 0;if(void 0!==i[d].__type__&&!0===o){var u=t.findInOptions(e,i[d],yb(n,d));r>u.distance&&(s=u.closestMatch,a=u.path,r=u.distance,l=u.indexMatch)}else{var f;-1!==lg(f=d.toLowerCase()).call(f,h)&&(l=d),r>(c=t.levenshteinDistance(e,d))&&(s=d,a=mb(n),r=c)}}return{closestMatch:s,path:a,distance:r,indexMatch:l}}},{key:"printLocation",value:function(t,e){for(var i="\n\n"+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n")+"options = {\n",n=0;n0)return"before"==n?Math.max(0,h-1):h;if(o(s,e)<0&&o(a,e)>0)return"before"==n?h:Math.min(t.length-1,h+1);o(s,e)<0?d=h+1:c=h-1,l++}return-1},bridgeObject:zb,copyAndExtendArray:yb,copyArray:mb,deepExtend:gb,deepObjectAssign:Km,easingFunctions:jb,equalArray:function(t,e){if(t.length!==e.length)return!1;for(var i=0,n=t.length;i0&&void 0!==arguments[0]?arguments[0]:window.event,e=null;return t&&(t.target?e=t.target:t.srcElement&&(e=t.srcElement)),e instanceof Element&&(null==e.nodeType||3!=e.nodeType||(e=e.parentNode)instanceof Element)?e:null},getType:function(t){var e=bu(t);return"object"===e?null===t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":Df(t)?"Array":t instanceof Date?"Date":"Object":"number"===e?"Number":"boolean"===e?"Boolean":"string"===e?"String":void 0===e?"undefined":e},hasParent:function(t,e){for(var i=t;i;){if(i===e)return!0;if(!i.parentNode)return!1;i=i.parentNode}return!1},hexToHSV:Ib,hexToRGB:Eb,insertSort:function(t,e){for(var i=0;i0&&e(n,t[o-1])<0;o--)t[o]=t[o-1];t[o]=n}return t},isDate:function(t){if(t instanceof Date)return!0;if(lb(t)){if(ib.exec(t))return!0;if(!isNaN(Date.parse(t)))return!0}return!1},isNumber:ab,isObject:db,isString:lb,isValidHex:Bb,isValidRGB:Nb,isValidRGBA:Fb,mergeOptions:Ab,option:xb,overrideOpacity:Ob,parseColor:Sb,preventDefault:function(t){t||(t=window.event),t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},pureDeepObjectAssign:Gm,recursiveDOMDelete:hb,removeClassName:function(t,e){var i=t.className.split(" "),n=e.split(" ");i=yv(i).call(i,(function(t){return!rv(n).call(n,t)})),t.className=i.join(" ")},removeCssText:function(t,e){for(var i=Mb(e),n=0,o=Hf(i);n2?i-2:0),o=2;o":!0,"--":!0},hw="",lw=0,dw="",cw="",uw=sw.NULL;function fw(){lw++,dw=hw.charAt(lw)}function pw(){return hw.charAt(lw+1)}function vw(t){var e=t.charCodeAt(0);return e<47?35===e||46===e:e<59?e>47:e<91?e>64:e<96?95===e:e<123&&e>96}function gw(t,e){if(t||(t={}),e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function yw(t,e,i){for(var n=e.split("."),o=t;n.length;){var r=n.shift();n.length?(o[r]||(o[r]={}),o=o[r]):o[r]=i}}function mw(t,e){for(var i,n,o=null,r=[t],s=t;s.parent;)r.push(s.parent),s=s.parent;if(s.nodes)for(i=0,n=s.nodes.length;i=0;i--){var a,h=r[i];h.nodes||(h.nodes=[]),-1===lg(a=h.nodes).call(a,o)&&h.nodes.push(o)}e.attr&&(o.attr=gw(o.attr,e.attr))}function bw(t,e){if(t.edges||(t.edges=[]),t.edges.push(e),t.edge){var i=gw({},t.edge);e.attr=gw(i,e.attr)}}function ww(t,e,i,n,o){var r={from:e,to:i,type:n};return t.edge&&(r.attr=gw({},t.edge)),r.attr=gw(r.attr||{},o),null!=o&&o.hasOwnProperty("arrows")&&null!=o.arrows&&(r.arrows={to:{enabled:!0,type:o.arrows.type}},o.arrows=null),r}function kw(){for(uw=sw.NULL,cw="";" "===dw||"\t"===dw||"\n"===dw||"\r"===dw;)fw();do{var t=!1;if("#"===dw){for(var e=lw-1;" "===hw.charAt(e)||"\t"===hw.charAt(e);)e--;if("\n"===hw.charAt(e)||""===hw.charAt(e)){for(;""!=dw&&"\n"!=dw;)fw();t=!0}}if("/"===dw&&"/"===pw()){for(;""!=dw&&"\n"!=dw;)fw();t=!0}if("/"===dw&&"*"===pw()){for(;""!=dw;){if("*"===dw&&"/"===pw()){fw(),fw();break}fw()}t=!0}for(;" "===dw||"\t"===dw||"\n"===dw||"\r"===dw;)fw()}while(t);if(""!==dw){var i=dw+pw();if(aw[i])return uw=sw.DELIMITER,cw=i,fw(),void fw();if(aw[dw])return uw=sw.DELIMITER,cw=dw,void fw();if(vw(dw)||"-"===dw){for(cw+=dw,fw();vw(dw);)cw+=dw,fw();return"false"===cw?cw=!1:"true"===cw?cw=!0:isNaN(Number(cw))||(cw=Number(cw)),void(uw=sw.IDENTIFIER)}if('"'===dw){for(fw();""!=dw&&('"'!=dw||'"'===dw&&'"'===pw());)'"'===dw?(cw+=dw,fw()):"\\"===dw&&"n"===pw()?(cw+="\n",fw()):cw+=dw,fw();if('"'!=dw)throw Sw('End of string " expected');return fw(),void(uw=sw.IDENTIFIER)}for(uw=sw.UNKNOWN;""!=dw;)cw+=dw,fw();throw new SyntaxError('Syntax error in part "'+Tw(cw,30)+'"')}uw=sw.DELIMITER}function _w(t){for(;""!==cw&&"}"!=cw;)xw(t),";"===cw&&kw()}function xw(t){var e=Ew(t);if(e)Ow(t,e);else{var i=function(t){if("node"===cw)return kw(),t.node=Cw(),"node";if("edge"===cw)return kw(),t.edge=Cw(),"edge";if("graph"===cw)return kw(),t.graph=Cw(),"graph";return null}(t);if(!i){if(uw!=sw.IDENTIFIER)throw Sw("Identifier expected");var n=cw;if(kw(),"="===cw){if(kw(),uw!=sw.IDENTIFIER)throw Sw("Identifier expected");t[n]=cw,kw()}else!function(t,e){var i={id:e},n=Cw();n&&(i.attr=n);mw(t,i),Ow(t,e)}(t,n)}}}function Ew(t){var e=null;if("subgraph"===cw&&((e={}).type="subgraph",kw(),uw===sw.IDENTIFIER&&(e.id=cw,kw())),"{"===cw){if(kw(),e||(e={}),e.parent=t,e.node=t.node,e.edge=t.edge,e.graph=t.graph,_w(e),"}"!=cw)throw Sw("Angle bracket } expected");kw(),delete e.node,delete e.edge,delete e.graph,delete e.parent,t.subgraphs||(t.subgraphs=[]),t.subgraphs.push(e)}return e}function Ow(t,e){for(;"->"===cw||"--"===cw;){var i,n=cw;kw();var o=Ew(t);if(o)i=o;else{if(uw!=sw.IDENTIFIER)throw Sw("Identifier or subgraph expected");mw(t,{id:i=cw}),kw()}bw(t,ww(t,e,i,n,Cw())),e=i}}function Cw(){for(var t,e,i=null,n={dashed:!0,solid:!1,dotted:[1,5]},o={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;"["===cw;){for(kw(),i={};""!==cw&&"]"!=cw;){if(uw!=sw.IDENTIFIER)throw Sw("Attribute name expected");var a=cw;if(kw(),"="!=cw)throw Sw("Equal sign = expected");if(kw(),uw!=sw.IDENTIFIER)throw Sw("Attribute value expected");var h=cw;"style"===a&&(h=n[h]),"arrowhead"===a&&(a="arrows",h={to:{enabled:!0,type:o[h]}}),"arrowtail"===a&&(a="arrows",h={from:{enabled:!0,type:o[h]}}),r.push({attr:i,name:a,value:h}),s.push(a),kw(),","==cw&&kw()}if("]"!=cw)throw Sw("Bracket ] expected");kw()}if(rv(s).call(s,"dir")){var l={arrows:{}};for(t=0;t"===t.type&&(e.arrows="to"),e};op(o=i.edges).call(o,(function(t){var e,i,o,s,a,h,l;(e=t.from instanceof Object?t.from.nodes:{id:t.from},i=t.to instanceof Object?t.to.nodes:{id:t.to},t.from instanceof Object&&t.from.edges)&&op(o=t.from.edges).call(o,(function(t){var e=r(t);n.edges.push(e)}));(a=i,h=function(e,i){var o=ww(n,e.id,i.id,t.type,t.attr),s=r(o);n.edges.push(s)},Df(s=e)?op(s).call(s,(function(t){Df(a)?op(a).call(a,(function(e){h(t,e)})):h(t,a)})):Df(a)?op(a).call(a,(function(t){h(s,t)})):h(s,a),t.to instanceof Object&&t.to.edges)&&op(l=t.to.edges).call(l,(function(t){var e=r(t);n.edges.push(e)}))}))}return i.attr&&(n.options=i.attr),n}var Iw=Object.freeze({__proto__:null,DOTToGraph:Dw,parseDOT:nw});function Bw(t,e){var i,n={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};null!=e&&(null!=e.fixed&&(n.nodes.fixed=e.fixed),null!=e.parseColor&&(n.nodes.parseColor=e.parseColor),null!=e.inheritColor&&(n.edges.inheritColor=e.inheritColor));var o=t.edges,r=jf(o).call(o,(function(t){var e={from:t.source,id:t.id,to:t.target};return null!=t.attributes&&(e.attributes=t.attributes),null!=t.label&&(e.label=t.label),null!=t.attributes&&null!=t.attributes.title&&(e.title=t.attributes.title),"Directed"===t.type&&(e.arrows="to"),t.color&&!1===n.edges.inheritColor&&(e.color=t.color),e}));return{nodes:jf(i=t.nodes).call(i,(function(t){var e={id:t.id,fixed:n.nodes.fixed&&null!=t.x&&null!=t.y};return null!=t.attributes&&(e.attributes=t.attributes),null!=t.label&&(e.label=t.label),null!=t.size&&(e.size=t.size),null!=t.attributes&&null!=t.attributes.title&&(e.title=t.attributes.title),null!=t.title&&(e.title=t.title),null!=t.x&&(e.x=t.x),null!=t.y&&(e.y=t.y),null!=t.color&&(!0===n.nodes.parseColor?e.color=t.color:e.color={background:t.color,border:t.color,highlight:{background:t.color,border:t.color},hover:{background:t.color,border:t.color}}),e})),edges:r}}var Nw=Object.freeze({__proto__:null,parseGephi:Bw}),Fw=Object.freeze({__proto__:null,cn:{addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},cs:{addDescription:"Kluknutím do prázdného prostoru můžete přidat nový vrchol.",addEdge:"Přidat hranu",addNode:"Přidat vrchol",back:"Zpět",close:"Zavřít",createEdgeError:"Nelze připojit hranu ke shluku.",del:"Smazat výběr",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",editNode:"Upravit vrchol"},de:{addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzufügen",addNode:"Knoten hinzufügen",back:"Zurück",close:"Schließen",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",del:"Lösche Auswahl",deleteClusterError:"Cluster können nicht gelöscht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster können nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},en:{addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},es:{addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",addEdge:"Añadir arista",addNode:"Añadir nodo",back:"Atrás",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selección",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},fr:{addDescription:"Cliquez dans un endroit vide pour placer un nœud.",addEdge:"Ajouter un lien",addNode:"Ajouter un nœud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de créer un lien vers un cluster.",del:"Effacer la sélection",deleteClusterError:"Les clusters ne peuvent pas être effacés.",edgeDescription:"Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.",edit:"Éditer",editClusterError:"Les clusters ne peuvent pas être édités.",editEdge:"Éditer le lien",editEdgeDescription:"Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.",editNode:"Éditer le nœud"},it:{addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},nl:{addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},pt:{addDescription:"Clique em um espaço em branco para adicionar um novo nó",addEdge:"Adicionar aresta",addNode:"Adicionar nó",back:"Voltar",close:"Fechar",createEdgeError:"Não foi possível linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters não puderam ser removidos.",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",edit:"Editar",editClusterError:"Clusters não puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",editNode:"Editar nó"},ru:{addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},uk:{addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"}});var zw=function(){function t(){ph(this,t),this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}return xu(t,[{key:"init",value:function(){if(!this.initialized()){this.src=this.image.src;var t=this.image.width,e=this.image.height;this.width=t,this.height=e;var i=Math.floor(e/2),n=Math.floor(e/4),o=Math.floor(e/8),r=Math.floor(e/16),s=Math.floor(t/2),a=Math.floor(t/4),h=Math.floor(t/8),l=Math.floor(t/16);this.canvas.width=3*a,this.canvas.height=i,this.coordinates=[[0,0,s,i],[s,0,a,n],[s,n,h,o],[5*h,n,l,r]],this._fillMipMap()}}},{key:"initialized",value:function(){return void 0!==this.coordinates}},{key:"_fillMipMap",value:function(){var t=this.canvas.getContext("2d"),e=this.coordinates[0];t.drawImage(this.image,e[0],e[1],e[2],e[3]);for(var i=1;i2){e*=.5;for(var s=0;e>2&&s=this.NUM_ITERATIONS&&(s=this.NUM_ITERATIONS-1);var a=this.coordinates[s];t.drawImage(this.canvas,a[0],a[1],a[2],a[3],i,n,o,r)}else t.drawImage(this.image,i,n,o,r)}}]),t}(),Aw=function(){function t(e){ph(this,t),this.images={},this.imageBroken={},this.callback=e}return xu(t,[{key:"_tryloadBrokenUrl",value:function(t,e,i){void 0!==t&&void 0!==i&&(void 0!==e?(i.image.onerror=function(){console.error("Could not load brokenImage:",e)},i.image.src=e):console.warn("No broken url image defined"))}},{key:"_redrawWithImage",value:function(t){this.callback&&this.callback(t)}},{key:"load",value:function(t,e){var i=this,n=this.images[t];if(n)return n;var o=new zw;return this.images[t]=o,o.image.onload=function(){i._fixImageCoordinates(o.image),o.init(),i._redrawWithImage(o)},o.image.onerror=function(){console.error("Could not load image:",t),i._tryloadBrokenUrl(t,e,o)},o.image.src=t,o}},{key:"_fixImageCoordinates",value:function(t){0===t.width&&(document.body.appendChild(t),t.width=t.offsetWidth,t.height=t.offsetHeight,document.body.removeChild(t))}}]),t}(),jw={exports:{}},Rw=r((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),Lw=r,Hw=tt,Ww=w,qw=Rw,Vw=Object.isExtensible,Uw=Lw((function(){Vw(1)}))||qw?function(t){return!!Hw(t)&&((!qw||"ArrayBuffer"!==Ww(t))&&(!Vw||Vw(t)))}:Vw,Yw=!r((function(){return Object.isExtensible(Object.preventExtensions({}))})),Xw=Ti,Gw=g,Kw=Yi,$w=tt,Zw=Qt,Qw=Ze.f,Jw=Jh,tk=il,ek=Uw,ik=Yw,nk=!1,ok=ne("meta"),rk=0,sk=function(t){Qw(t,ok,{value:{objectID:"O"+rk++,weakData:{}}})},ak=jw.exports={enable:function(){ak.enable=function(){},nk=!0;var t=Jw.f,e=Gw([].splice),i={};i[ok]=1,t(i).length&&(Jw.f=function(i){for(var n=t(i),o=0,r=n.length;or;r++)if((a=y(t[r]))&&vk(kk,a))return a;return new wk(!1)}n=gk(t,o)}for(h=u?t.next:n.next;!(l=dk(h,n)).done;){try{a=y(l.value)}catch(t){mk(n,"throw",t)}if("object"==typeof a&&a&&vk(kk,a))return a}return new wk(!1)},xk=at,Ek=TypeError,Ok=function(t,e){if(xk(e,t))return t;throw new Ek("Incorrect invocation")},Ck=Ti,Sk=o,Tk=hk,Mk=r,Pk=gi,Dk=_k,Ik=Ok,Bk=S,Nk=tt,Fk=U,zk=Gr,Ak=Ze.f,jk=Fl.forEach,Rk=M,Lk=Lo.set,Hk=Lo.getterFor,Wk=function(t,e,i){var n,o=-1!==t.indexOf("Map"),r=-1!==t.indexOf("Weak"),s=o?"set":"add",a=Sk[t],h=a&&a.prototype,l={};if(Rk&&Bk(a)&&(r||h.forEach&&!Mk((function(){(new a).entries().next()})))){var d=(n=e((function(e,i){Lk(Ik(e,d),{type:t,collection:new a}),Fk(i)||Dk(i,e[s],{that:e,AS_ENTRIES:o})}))).prototype,c=Hk(t);jk(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(t){var e="add"===t||"set"===t;!(t in h)||r&&"clear"===t||Pk(d,t,(function(i,n){var o=c(this).collection;if(!e&&r&&!Nk(i))return"get"===t&&void 0;var s=o[t](0===i?0:i,n);return e?this:s}))})),r||Ak(d,"size",{configurable:!0,get:function(){return c(this).collection.size}})}else n=i.getConstructor(e,t,o,s),Tk.enable();return zk(n,t,!1,!0),l[t]=n,Ck({global:!0,forced:!0},l),r||i.setStrong(n,t,o),n},qk=Mr,Vk=function(t,e,i){for(var n in e)i&&i.unsafe&&t[n]?t[n]=e[n]:qk(t,n,e[n],i);return t},Uk=st,Yk=vl,Xk=M,Gk=ue("species"),Kk=function(t){var e=Uk(t);Xk&&e&&!e[Gk]&&Yk(e,Gk,{configurable:!0,get:function(){return this}})},$k=mr,Zk=vl,Qk=Vk,Jk=$e,t_=Ok,e_=U,i_=_k,n_=Ss,o_=Ts,r_=Kk,s_=M,a_=hk.fastKey,h_=Lo.set,l_=Lo.getterFor,d_={getConstructor:function(t,e,i,n){var o=t((function(t,o){t_(t,r),h_(t,{type:e,index:$k(null),first:void 0,last:void 0,size:0}),s_||(t.size=0),e_(o)||i_(o,t[n],{that:t,AS_ENTRIES:i})})),r=o.prototype,s=l_(e),a=function(t,e,i){var n,o,r=s(t),a=h(t,e);return a?a.value=i:(r.last=a={index:o=a_(e,!0),key:e,value:i,previous:n=r.last,next:void 0,removed:!1},r.first||(r.first=a),n&&(n.next=a),s_?r.size++:t.size++,"F"!==o&&(r.index[o]=a)),t},h=function(t,e){var i,n=s(t),o=a_(e);if("F"!==o)return n.index[o];for(i=n.first;i;i=i.next)if(i.key===e)return i};return Qk(r,{clear:function(){for(var t=s(this),e=t.index,i=t.first;i;)i.removed=!0,i.previous&&(i.previous=i.previous.next=void 0),delete e[i.index],i=i.next;t.first=t.last=void 0,s_?t.size=0:this.size=0},delete:function(t){var e=this,i=s(e),n=h(e,t);if(n){var o=n.next,r=n.previous;delete i.index[n.index],n.removed=!0,r&&(r.next=o),o&&(o.previous=r),i.first===n&&(i.first=o),i.last===n&&(i.last=r),s_?i.size--:e.size--}return!!n},forEach:function(t){for(var e,i=s(this),n=Jk(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:i.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!h(this,t)}}),Qk(r,i?{get:function(t){var e=h(this,t);return e&&e.value},set:function(t,e){return a(this,0===t?0:t,e)}}:{add:function(t){return a(this,t=0===t?0:t,t)}}),s_&&Zk(r,"size",{configurable:!0,get:function(){return s(this).size}}),o},setStrong:function(t,e,i){var n=e+" Iterator",o=l_(e),r=l_(n);n_(t,e,(function(t,e){h_(this,{type:n,target:t,state:o(t),kind:e,last:void 0})}),(function(){for(var t=r(this),e=t.kind,i=t.last;i&&i.removed;)i=i.previous;return t.target&&(t.last=i=i?i.next:t.state.first)?o_("keys"===e?i.key:"values"===e?i.value:[i.key,i.value],!1):(t.target=void 0,o_(void 0,!0))}),i?"entries":"values",!i,!0),r_(e)}};Wk("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),d_);var c_=i(et.Map),u_=function(){function t(){ph(this,t),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},bn(this.options,this.defaultOptions)}return xu(t,[{key:"setOptions",value:function(t){var e=["useDefaultGroups"];if(void 0!==t)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&-1===lg(e).call(e,i)){var n=t[i];this.add(i,n)}}},{key:"clear",value:function(){this._groups=new c_,this._groupNames=[]}},{key:"get",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this._groups.get(t);if(void 0===i&&e)if(!1===this.options.useDefaultGroups&&this._groupNames.length>0){var n=this._groupIndex%this._groupNames.length;++this._groupIndex,(i={}).color=this._groups.get(this._groupNames[n]),this._groups.set(t,i)}else{var o=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,(i={}).color=this._defaultGroups[o],this._groups.set(t,i)}return i}},{key:"add",value:function(t,e){return this._groups.has(t)||this._groupNames.push(t),this._groups.set(t,e),e}}]),t}();Ti({target:"Number",stat:!0},{isNaN:function(t){return t!=t}});var f_=i(et.Number.isNaN),p_=o.isFinite,v_=Number.isFinite||function(t){return"number"==typeof t&&p_(t)};Ti({target:"Number",stat:!0},{isFinite:v_});var g_=i(et.Number.isFinite),y_=Fl.some;Ti({target:"Array",proto:!0,forced:!Xf("some")},{some:function(t){return y_(this,t,arguments.length>1?arguments[1]:void 0)}});var m_=Nn("Array").some,b_=at,w_=m_,k_=Array.prototype,__=function(t){var e=t.some;return t===k_||b_(k_,t)&&e===k_.some?w_:e},x_=i(__);function E_(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var O_=fg,C_=i(O_);Ti({target:"Object",stat:!0},{setPrototypeOf:ds});var S_=et.Object.setPrototypeOf,T_=i(S_),M_=i(Ln);function P_(t,e){var i;return P_=T_?M_(i=T_).call(i):function(t,e){return t.__proto__=e,t},P_(t,e)}function D_(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=C_(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),xh(t,"prototype",{writable:!1}),e&&P_(t,e)}function I_(t,e){if(e&&("object"===bu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return E_(t)}var B_=lv,N_=i(B_);function F_(t){var e;return F_=T_?M_(e=N_).call(e):function(t){return t.__proto__||N_(t)},F_(t)}function z_(t,e,i){return(e=ku(e))in t?xh(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var A_={exports:{}},j_={exports:{}};!function(t){var e=pu,i=yu;function n(o){return t.exports=n="function"==typeof e&&"symbol"==typeof i?function(t){return typeof t}:function(t){return t&&"function"==typeof e&&t.constructor===e&&t!==e.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,n(o)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(j_);var R_=j_.exports,L_=np,H_=Qt,W_=Mf,q_=T,V_=Ze,U_=tt,Y_=gi,X_=Error,G_=g("".replace),K_=String(new X_("zxcasd").stack),$_=/\n\s*at [^:]*:[^\n]*/,Z_=$_.test(K_),Q_=R,J_=!r((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",Q_(1,7)),7!==t.stack)})),tx=gi,ex=function(t,e){if(Z_&&"string"==typeof t&&!X_.prepareStackTrace)for(;e--;)t=G_(t,$_,"");return t},ix=J_,nx=Error.captureStackTrace,ox=co,rx=Ti,sx=at,ax=Sr,hx=ds,lx=function(t,e,i){for(var n=W_(e),o=V_.f,r=q_.f,s=0;s2&&fx(i,arguments[2]);var o=[];return vx(t,bx,{that:o}),cx(i,"errors",o),i};hx?hx(wx,mx):lx(wx,mx,{name:!0});var kx=wx.prototype=dx(mx.prototype,{constructor:ux(1,wx),message:ux(1,""),name:ux(1,"AggregateError")});rx({global:!0,constructor:!0,arity:2},{AggregateError:wx});var _x,xx,Ex,Ox,Cx="process"===w(o.process),Sx=da,Tx=St,Mx=TypeError,Px=function(t){if(Sx(t))return t;throw new Mx(Tx(t)+" is not a constructor")},Dx=ii,Ix=Px,Bx=U,Nx=ue("species"),Fx=function(t,e){var i,n=Dx(t).constructor;return void 0===n||Bx(i=Dx(n)[Nx])?e:Ix(i)},zx=/(?:ipad|iphone|ipod).*applewebkit/i.test(ht),Ax=o,jx=c,Rx=$e,Lx=S,Hx=Qt,Wx=r,qx=er,Vx=wn,Ux=Ce,Yx=kg,Xx=zx,Gx=Cx,Kx=Ax.setImmediate,$x=Ax.clearImmediate,Zx=Ax.process,Qx=Ax.Dispatch,Jx=Ax.Function,tE=Ax.MessageChannel,eE=Ax.String,iE=0,nE={},oE="onreadystatechange";Wx((function(){_x=Ax.location}));var rE=function(t){if(Hx(nE,t)){var e=nE[t];delete nE[t],e()}},sE=function(t){return function(){rE(t)}},aE=function(t){rE(t.data)},hE=function(t){Ax.postMessage(eE(t),_x.protocol+"//"+_x.host)};Kx&&$x||(Kx=function(t){Yx(arguments.length,1);var e=Lx(t)?t:Jx(t),i=Vx(arguments,1);return nE[++iE]=function(){jx(e,void 0,i)},xx(iE),iE},$x=function(t){delete nE[t]},Gx?xx=function(t){Zx.nextTick(sE(t))}:Qx&&Qx.now?xx=function(t){Qx.now(sE(t))}:tE&&!Xx?(Ox=(Ex=new tE).port2,Ex.port1.onmessage=aE,xx=Rx(Ox.postMessage,Ox)):Ax.addEventListener&&Lx(Ax.postMessage)&&!Ax.importScripts&&_x&&"file:"!==_x.protocol&&!Wx(hE)?(xx=hE,Ax.addEventListener("message",aE,!1)):xx=oE in Ux("script")?function(t){qx.appendChild(Ux("script"))[oE]=function(){qx.removeChild(this),rE(t)}}:function(t){setTimeout(sE(t),0)});var lE={set:Kx,clear:$x},dE=function(){this.head=null,this.tail=null};dE.prototype={add:function(t){var e={item:t,next:null},i=this.tail;i?i.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}};var cE,uE,fE,pE,vE,gE=dE,yE=/ipad|iphone|ipod/i.test(ht)&&"undefined"!=typeof Pebble,mE=/web0s(?!.*chrome)/i.test(ht),bE=o,wE=$e,kE=T.f,_E=lE.set,xE=gE,EE=zx,OE=yE,CE=mE,SE=Cx,TE=bE.MutationObserver||bE.WebKitMutationObserver,ME=bE.document,PE=bE.process,DE=bE.Promise,IE=kE(bE,"queueMicrotask"),BE=IE&&IE.value;if(!BE){var NE=new xE,FE=function(){var t,e;for(SE&&(t=PE.domain)&&t.exit();e=NE.get();)try{e()}catch(t){throw NE.head&&cE(),t}t&&t.enter()};EE||SE||CE||!TE||!ME?!OE&&DE&&DE.resolve?((pE=DE.resolve(void 0)).constructor=DE,vE=wE(pE.then,pE),cE=function(){vE(FE)}):SE?cE=function(){PE.nextTick(FE)}:(_E=wE(_E,bE),cE=function(){_E(FE)}):(uE=!0,fE=ME.createTextNode(""),new TE(FE).observe(fE,{characterData:!0}),cE=function(){fE.data=uE=!uE}),BE=function(t){NE.head||cE(),NE.add(t)}}var zE=BE,AE=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},jE=o.Promise,RE="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,LE=!RE&&!Cx&&"object"==typeof window&&"object"==typeof document,HE=o,WE=jE,qE=S,VE=Ye,UE=$s,YE=ue,XE=LE,GE=RE,KE=vt,$E=WE&&WE.prototype,ZE=YE("species"),QE=!1,JE=qE(HE.PromiseRejectionEvent),tO=VE("Promise",(function(){var t=UE(WE),e=t!==String(WE);if(!e&&66===KE)return!0;if(!$E.catch||!$E.finally)return!0;if(!KE||KE<51||!/native code/.test(t)){var i=new WE((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((i.constructor={})[ZE]=n,!(QE=i.then((function(){}))instanceof n))return!0}return!e&&(XE||GE)&&!JE})),eO={CONSTRUCTOR:tO,REJECTION_EVENT:JE,SUBCLASSING:QE},iO={},nO=Dt,oO=TypeError,rO=function(t){var e,i;this.promise=new t((function(t,n){if(void 0!==e||void 0!==i)throw new oO("Bad Promise constructor");e=t,i=n})),this.resolve=nO(e),this.reject=nO(i)};iO.f=function(t){return new rO(t)};var sO,aO,hO=Ti,lO=Cx,dO=o,cO=I,uO=Mr,fO=Gr,pO=Kk,vO=Dt,gO=S,yO=tt,mO=Ok,bO=Fx,wO=lE.set,kO=zE,_O=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}},xO=AE,EO=gE,OO=Lo,CO=jE,SO=eO,TO=iO,MO="Promise",PO=SO.CONSTRUCTOR,DO=SO.REJECTION_EVENT,IO=OO.getterFor(MO),BO=OO.set,NO=CO&&CO.prototype,FO=CO,zO=NO,AO=dO.TypeError,jO=dO.document,RO=dO.process,LO=TO.f,HO=LO,WO=!!(jO&&jO.createEvent&&dO.dispatchEvent),qO="unhandledrejection",VO=function(t){var e;return!(!yO(t)||!gO(e=t.then))&&e},UO=function(t,e){var i,n,o,r=e.value,s=1===e.state,a=s?t.ok:t.fail,h=t.resolve,l=t.reject,d=t.domain;try{a?(s||(2===e.rejection&&$O(e),e.rejection=1),!0===a?i=r:(d&&d.enter(),i=a(r),d&&(d.exit(),o=!0)),i===t.promise?l(new AO("Promise-chain cycle")):(n=VO(i))?cO(n,i,h,l):h(i)):l(r)}catch(t){d&&!o&&d.exit(),l(t)}},YO=function(t,e){t.notified||(t.notified=!0,kO((function(){for(var i,n=t.reactions;i=n.get();)UO(i,t);t.notified=!1,e&&!t.rejection&&GO(t)})))},XO=function(t,e,i){var n,o;WO?((n=jO.createEvent("Event")).promise=e,n.reason=i,n.initEvent(t,!1,!0),dO.dispatchEvent(n)):n={promise:e,reason:i},!DO&&(o=dO["on"+t])?o(n):t===qO&&_O("Unhandled promise rejection",i)},GO=function(t){cO(wO,dO,(function(){var e,i=t.facade,n=t.value;if(KO(t)&&(e=xO((function(){lO?RO.emit("unhandledRejection",n,i):XO(qO,i,n)})),t.rejection=lO||KO(t)?2:1,e.error))throw e.value}))},KO=function(t){return 1!==t.rejection&&!t.parent},$O=function(t){cO(wO,dO,(function(){var e=t.facade;lO?RO.emit("rejectionHandled",e):XO("rejectionhandled",e,t.value)}))},ZO=function(t,e,i){return function(n){t(e,n,i)}},QO=function(t,e,i){t.done||(t.done=!0,i&&(t=i),t.value=e,t.state=2,YO(t,!0))},JO=function(t,e,i){if(!t.done){t.done=!0,i&&(t=i);try{if(t.facade===e)throw new AO("Promise can't be resolved itself");var n=VO(e);n?kO((function(){var i={done:!1};try{cO(n,e,ZO(JO,i,t),ZO(QO,i,t))}catch(e){QO(i,e,t)}})):(t.value=e,t.state=1,YO(t,!1))}catch(e){QO({done:!1},e,t)}}};PO&&(zO=(FO=function(t){mO(this,zO),vO(t),cO(sO,this);var e=IO(this);try{t(ZO(JO,e),ZO(QO,e))}catch(t){QO(e,t)}}).prototype,(sO=function(t){BO(this,{type:MO,done:!1,notified:!1,parent:!1,reactions:new EO,rejection:!1,state:0,value:void 0})}).prototype=uO(zO,"then",(function(t,e){var i=IO(this),n=LO(bO(this,FO));return i.parent=!0,n.ok=!gO(t)||t,n.fail=gO(e)&&e,n.domain=lO?RO.domain:void 0,0===i.state?i.reactions.add(n):kO((function(){UO(n,i)})),n.promise})),aO=function(){var t=new sO,e=IO(t);this.promise=t,this.resolve=ZO(JO,e),this.reject=ZO(QO,e)},TO.f=LO=function(t){return t===FO||undefined===t?new aO(t):HO(t)}),hO({global:!0,constructor:!0,wrap:!0,forced:PO},{Promise:FO}),fO(FO,MO,!1,!0),pO(MO);var tC=jE,eC=eO.CONSTRUCTOR||!qa((function(t){tC.all(t).then(void 0,(function(){}))})),iC=I,nC=Dt,oC=iO,rC=AE,sC=_k;Ti({target:"Promise",stat:!0,forced:eC},{all:function(t){var e=this,i=oC.f(e),n=i.resolve,o=i.reject,r=rC((function(){var i=nC(e.resolve),r=[],s=0,a=1;sC(t,(function(t){var h=s++,l=!1;a++,iC(i,e,t).then((function(t){l||(l=!0,r[h]=t,--a||n(r))}),o)})),--a||n(r)}));return r.error&&o(r.value),i.promise}});var aC=Ti,hC=eO.CONSTRUCTOR;jE&&jE.prototype,aC({target:"Promise",proto:!0,forced:hC,real:!0},{catch:function(t){return this.then(void 0,t)}});var lC=I,dC=Dt,cC=iO,uC=AE,fC=_k;Ti({target:"Promise",stat:!0,forced:eC},{race:function(t){var e=this,i=cC.f(e),n=i.reject,o=uC((function(){var o=dC(e.resolve);fC(t,(function(t){lC(o,e,t).then(i.resolve,n)}))}));return o.error&&n(o.value),i.promise}});var pC=I,vC=iO;Ti({target:"Promise",stat:!0,forced:eO.CONSTRUCTOR},{reject:function(t){var e=vC.f(this);return pC(e.reject,void 0,t),e.promise}});var gC=ii,yC=tt,mC=iO,bC=function(t,e){if(gC(t),yC(e)&&e.constructor===t)return e;var i=mC.f(t);return(0,i.resolve)(e),i.promise},wC=Ti,kC=jE,_C=eO.CONSTRUCTOR,xC=bC,EC=st("Promise"),OC=!_C;wC({target:"Promise",stat:!0,forced:true},{resolve:function(t){return xC(OC&&this===EC?kC:this,t)}});var CC=I,SC=Dt,TC=iO,MC=AE,PC=_k;Ti({target:"Promise",stat:!0,forced:eC},{allSettled:function(t){var e=this,i=TC.f(e),n=i.resolve,o=i.reject,r=MC((function(){var i=SC(e.resolve),o=[],r=0,s=1;PC(t,(function(t){var a=r++,h=!1;s++,CC(i,e,t).then((function(t){h||(h=!0,o[a]={status:"fulfilled",value:t},--s||n(o))}),(function(t){h||(h=!0,o[a]={status:"rejected",reason:t},--s||n(o))}))})),--s||n(o)}));return r.error&&o(r.value),i.promise}});var DC=I,IC=Dt,BC=st,NC=iO,FC=AE,zC=_k,AC="No one promise resolved";Ti({target:"Promise",stat:!0,forced:eC},{any:function(t){var e=this,i=BC("AggregateError"),n=NC.f(e),o=n.resolve,r=n.reject,s=FC((function(){var n=IC(e.resolve),s=[],a=0,h=1,l=!1;zC(t,(function(t){var d=a++,c=!1;h++,DC(n,e,t).then((function(t){c||l||(l=!0,o(t))}),(function(t){c||l||(c=!0,s[d]=t,--h||r(new i(s,AC)))}))})),--h||r(new i(s,AC))}));return s.error&&r(s.value),n.promise}});var jC=Ti,RC=jE,LC=r,HC=st,WC=S,qC=Fx,VC=bC,UC=RC&&RC.prototype;jC({target:"Promise",proto:!0,real:!0,forced:!!RC&&LC((function(){UC.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=qC(this,HC("Promise")),i=WC(t);return this.then(i?function(i){return VC(e,t()).then((function(){return i}))}:t,i?function(i){return VC(e,t()).then((function(){throw i}))}:t)}});var YC=et.Promise,XC=iO;Ti({target:"Promise",stat:!0},{withResolvers:function(){var t=XC.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var GC=YC,KC=iO,$C=AE;Ti({target:"Promise",stat:!0,forced:!0},{try:function(t){var e=KC.f(this),i=$C(t);return(i.error?e.reject:e.resolve)(i.value),e.promise}});var ZC=GC,QC=pp;!function(t){var e=R_.default,i=_h,n=pu,o=O_,r=B_,s=L_,a=Lu,h=S_,l=ZC,d=QC,c=lf;function u(){t.exports=u=function(){return p},t.exports.__esModule=!0,t.exports.default=t.exports;var f,p={},v=Object.prototype,g=v.hasOwnProperty,y=i||function(t,e,i){t[e]=i.value},m="function"==typeof n?n:{},b=m.iterator||"@@iterator",w=m.asyncIterator||"@@asyncIterator",k=m.toStringTag||"@@toStringTag";function _(t,e,n){return i(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{_({},"")}catch(f){_=function(t,e,i){return t[e]=i}}function x(t,e,i,n){var r=e&&e.prototype instanceof P?e:P,s=o(r.prototype),a=new W(n||[]);return y(s,"_invoke",{value:j(t,i,a)}),s}function E(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}p.wrap=x;var O="suspendedStart",C="suspendedYield",S="executing",T="completed",M={};function P(){}function D(){}function I(){}var B={};_(B,b,(function(){return this}));var N=r&&r(r(q([])));N&&N!==v&&g.call(N,b)&&(B=N);var F=I.prototype=P.prototype=o(B);function z(t){var e;s(e=["next","throw","return"]).call(e,(function(e){_(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,i){function n(o,r,s,a){var h=E(t[o],t,r);if("throw"!==h.type){var l=h.arg,d=l.value;return d&&"object"==e(d)&&g.call(d,"__await")?i.resolve(d.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):i.resolve(d).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,a)}))}a(h.arg)}var o;y(this,"_invoke",{value:function(t,e){function r(){return new i((function(i,o){n(t,e,i,o)}))}return o=o?o.then(r,r):r()}})}function j(t,e,i){var n=O;return function(o,r){if(n===S)throw new Error("Generator is already running");if(n===T){if("throw"===o)throw r;return{value:f,done:!0}}for(i.method=o,i.arg=r;;){var s=i.delegate;if(s){var a=R(s,i);if(a){if(a===M)continue;return a}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===O)throw n=T,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=S;var h=E(t,e,i);if("normal"===h.type){if(n=i.done?T:C,h.arg===M)continue;return{value:h.arg,done:i.done}}"throw"===h.type&&(n=T,i.method="throw",i.arg=h.arg)}}}function R(t,e){var i=e.method,n=t.iterator[i];if(n===f)return e.delegate=null,"throw"===i&&t.iterator.return&&(e.method="return",e.arg=f,R(t,e),"throw"===e.method)||"return"!==i&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+i+"' method")),M;var o=E(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,M;var r=o.arg;return r?r.done?(e[t.resultName]=r.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=f),e.delegate=null,M):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,M)}function L(t){var e,i={tryLoc:t[0]};1 in t&&(i.catchLoc=t[1]),2 in t&&(i.finallyLoc=t[2],i.afterLoc=t[3]),a(e=this.tryEntries).call(e,i)}function H(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function W(t){this.tryEntries=[{tryLoc:"root"}],s(t).call(t,L,this),this.reset(!0)}function q(t){if(t||""===t){var i=t[b];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--n){var o=this.tryEntries[n],r=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=g.call(o,"catchLoc"),a=g.call(o,"finallyLoc");if(s&&a){if(this.prev=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&g.call(n,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),H(i),M}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var o=n.arg;H(i)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:q(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=f),M}},p}t.exports=u,t.exports.__esModule=!0,t.exports.default=t.exports}(A_);var JC=(0,A_.exports)(),tS=JC;try{regeneratorRuntime=JC}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=JC:Function("r","regeneratorRuntime = r")(JC)}var eS=i(tS),iS=Dt,nS=Kt,oS=V,rS=Li,sS=TypeError,aS=function(t){return function(e,i,n,o){iS(i);var r=nS(e),s=oS(r),a=rS(r),h=t?a-1:0,l=t?-1:1;if(n<2)for(;;){if(h in s){o=s[h],h+=l;break}if(h+=l,t?h<0:a<=h)throw new sS("Reduce of empty array with no initial value")}for(;t?h>=0:a>h;h+=l)h in s&&(o=i(o,s[h],h,r));return o}},hS={left:aS(!1),right:aS(!0)}.left;Ti({target:"Array",proto:!0,forced:!Cx&&vt>79&&vt<83||!Xf("reduce")},{reduce:function(t){var e=arguments.length;return hS(this,t,e,e>1?arguments[1]:void 0)}});var lS=Nn("Array").reduce,dS=at,cS=lS,uS=Array.prototype,fS=function(t){var e=t.reduce;return t===uS||dS(uS,t)&&e===uS.reduce?cS:e},pS=i(fS),vS=Oh,gS=Li,yS=Sh,mS=$e,bS=function(t,e,i,n,o,r,s,a){for(var h,l,d=o,c=0,u=!!s&&mS(s,a);c0&&vS(h)?(l=gS(h),d=bS(t,e,h,l,d,r-1)-1):(yS(d+1),t[d]=h),d++),c++;return d},wS=bS,kS=Dt,_S=Kt,xS=Li,ES=Nh;Ti({target:"Array",proto:!0},{flatMap:function(t){var e,i=_S(this),n=xS(i);return kS(t),(e=ES(i,0)).length=wS(e,i,i,n,0,1,t,arguments.length>1?arguments[1]:void 0),e}});var OS=Nn("Array").flatMap,CS=at,SS=OS,TS=Array.prototype,MS=function(t){var e=t.flatMap;return t===TS||CS(TS,t)&&e===TS.flatMap?SS:e},PS=i(MS);Wk("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),d_);var DS=i(et.Set),IS=i(gu),BS=i(Sa),NS=hl,FS=Math.floor,zS=function(t,e){var i=t.length,n=FS(i/2);return i<8?AS(t,e):jS(t,zS(NS(t,0,n),e),zS(NS(t,n),e),e)},AS=function(t,e){for(var i,n,o=t.length,r=1;r0;)t[n]=t[--n];n!==r++&&(t[n]=i)}return t},jS=function(t,e,i,n){for(var o=e.length,r=i.length,s=0,a=0;s3)){if(iT)return!0;if(oT)return oT<603;var t,e,i,n,o="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:i=3;break;case 68:case 71:i=4;break;default:i=2}for(n=0;n<47;n++)rT.push({k:e+n,v:i})}for(rT.sort((function(t,e){return e.v-t.v})),n=0;nZS(i)?1:-1}}(t)),i=KS(o),n=0;na;)void 0!==(i=o(n,e=r[a++]))&&kM(s,e,i);return s}});var _M=i(et.Object.getOwnPropertyDescriptors),xM={exports:{}},EM=Ti,OM=M,CM=Xo.f;EM({target:"Object",stat:!0,forced:Object.defineProperties!==CM,sham:!OM},{defineProperties:CM});var SM=et.Object,TM=xM.exports=function(t,e){return SM.defineProperties(t,e)};SM.defineProperties.sham&&(TM.sham=!0);var MM=i(xM.exports);let PM;const DM=new Uint8Array(16);function IM(){if(!PM&&(PM="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!PM))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return PM(DM)}const BM=[];for(let t=0;t<256;++t)BM.push((t+256).toString(16).slice(1));var NM,FM={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function zM(t,e,i){if(FM.randomUUID&&!e&&!t)return FM.randomUUID();const n=(t=t||{}).random||(t.rng||IM)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){i=i||0;for(let t=0;t<16;++t)e[i+t]=n[t];return e}return function(t,e=0){return BM[t[e+0]]+BM[t[e+1]]+BM[t[e+2]]+BM[t[e+3]]+"-"+BM[t[e+4]]+BM[t[e+5]]+"-"+BM[t[e+6]]+BM[t[e+7]]+"-"+BM[t[e+8]]+BM[t[e+9]]+"-"+BM[t[e+10]]+BM[t[e+11]]+BM[t[e+12]]+BM[t[e+13]]+BM[t[e+14]]+BM[t[e+15]]}(n)}function AM(t,e){var i=Hf(t);if(aM){var n=aM(t);e&&(n=yv(n).call(n,(function(e){return yM(t,e).enumerable}))),i.push.apply(i,n)}return i}function jM(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,r=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw r}}}}function HM(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);ithis.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&"number"==typeof this.delay&&(this._timeout=jg((function(){t.flush()}),this.delay))}},{key:"flush",value:function(){var t,e;op(t=Ap(e=this._queue).call(e,0)).call(t,(function(t){t.fn.apply(t.context||t.fn,t.args||[])}))}}],[{key:"extend",value:function(e,i){var n=new t(i);if(void 0!==e.flush)throw new Error("Target object already has a property flush");e.flush=function(){n.flush()};var o=[{name:"flush",original:void 0}];if(i&&i.replace)for(var r=0;ro&&(o=h,n=a)}return n}},{key:"min",value:function(t){var e=BS(this._pairs),i=e.next();if(i.done)return null;for(var n=i.value[1],o=t(i.value[1],i.value[0]);!(i=e.next()).done;){var r=pf(i.value,2),s=r[0],a=r[1],h=t(a,s);ho?1:no)&&(n=s,o=a)}}catch(t){r.e(t)}finally{r.f()}return n||null}},{key:"min",value:function(t){var e,i,n=null,o=null,r=LM(FT(e=this._data).call(e));try{for(r.s();!(i=r.n()).done;){var s=i.value,a=s[t];"number"==typeof a&&(null==o||ae.x&&t.tope.y}function mP(t){return"string"==typeof t&&""!==t}function bP(t,e,i,n){var o=n.x,r=n.y;if("function"==typeof n.distanceToBorder){var s=n.distanceToBorder(t,e),a=Math.sin(e)*s,h=Math.cos(e)*s;h===s?(o+=s,r=n.y):a===s?(o=n.x,r-=s):(o+=h,r-=a)}else n.shape.width>n.shape.height?(o=n.x+.5*n.shape.width,r=n.y-i):(o=n.x+i,r=n.y-.5*n.shape.height);return{x:o,y:r}}var wP=function(){function t(e){ph(this,t),this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}return xu(t,[{key:"_add",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal";void 0===this.lines[t]&&(this.lines[t]={width:0,height:0,blocks:[]});var n=e;void 0!==e&&""!==e||(n=" ");var o=this.measureText(n,i),r=bn({},FT(o));r.text=e,r.width=o.width,r.mod=i,void 0!==e&&""!==e||(r.width=0),this.lines[t].blocks.push(r),this.lines[t].width+=r.width}},{key:"curWidth",value:function(){var t=this.lines[this.current];return void 0===t?0:t.width}},{key:"append",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,t,e)}},{key:"newLine",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,t,e),this.current++}},{key:"determineLineHeights",value:function(){for(var t=0;tt&&(t=n.width),e+=n.height}this.width=t,this.height=e}},{key:"removeEmptyBlocks",value:function(){for(var t=[],e=0;e"://,""://,""://,"":/<\/b>/,"":/<\/i>/,"":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},_P=function(){function t(e){ph(this,t),this.text=e,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}return xu(t,[{key:"mod",value:function(){return 0===this.modStack.length?"normal":this.modStack[0]}},{key:"modName",value:function(){return 0===this.modStack.length?"normal":"mono"===this.modStack[0]?"mono":this.bold&&this.ital?"boldital":this.bold?"bold":this.ital?"ital":void 0}},{key:"emitBlock",value:function(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}},{key:"add",value:function(t){" "===t&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=t&&(this.buffer+=t)}},{key:"parseWS",value:function(t){return!!/[ \t]/.test(t)&&(this.mono?this.add(t):this.spacing=!0,!0)}},{key:"setTag",value:function(t){this.emitBlock(),this[t]=!0,this.modStack.unshift(t)}},{key:"unsetTag",value:function(t){this.emitBlock(),this[t]=!1,this.modStack.shift()}},{key:"parseStartTag",value:function(t,e){return!(this.mono||this[t]||!this.match(e))&&(this.setTag(t),!0)}},{key:"match",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=pf(this.prepareRegExp(t),2),n=i[0],o=i[1],r=n.test(this.text.substr(this.position,o));return r&&e&&(this.position+=o-1),r}},{key:"parseEndTag",value:function(t,e,i){var n=this.mod()===t;return!(!(n="mono"===t?n&&this.mono:n&&!this.mono)||!this.match(e))&&(void 0!==i?(this.position===this.text.length-1||this.match(i,!1))&&this.unsetTag(t):this.unsetTag(t),!0)}},{key:"replace",value:function(t,e){return!!this.match(t)&&(this.add(e),this.position+=length-1,!0)}},{key:"prepareRegExp",value:function(t){var e,i;if(t instanceof RegExp)i=t,e=1;else{var n=kP[t];i=void 0!==n?n:new RegExp(t),e=t.length}return[i,e]}}]),t}(),xP=function(){function t(e,i,n,o){var r=this;ph(this,t),this.ctx=e,this.parent=i,this.selected=n,this.hover=o;this.lines=new wP((function(t,i){if(void 0===t)return 0;var s=r.parent.getFormattingValues(e,n,o,i),a=0;""!==t&&(a=r.ctx.measureText(t).width);return{width:a,values:s}}))}return xu(t,[{key:"process",value:function(t){if(!mP(t))return this.lines.finalize();var e=this.parent.fontOptions;t=(t=t.replace(/\r\n/g,"\n")).replace(/\r/g,"\n");var i=String(t).split("\n"),n=i.length;if(e.multi)for(var o=0;o0)for(var s=0;s0)for(var u=0;u")||e.parseStartTag("ital","")||e.parseStartTag("mono","")||e.parseEndTag("bold","")||e.parseEndTag("ital","")||e.parseEndTag("mono",""))||i(n)||e.add(n),e.position++}return e.emitBlock(),e.blocks}},{key:"splitMarkdownBlocks",value:function(t){for(var e=this,i=new _P(t),n=!0,o=function(t){return!!/\\/.test(t)&&(i.positionthis.parent.fontOptions.maxWdt}},{key:"getLongestFit",value:function(t){for(var e="",i=0;i1&&void 0!==arguments[1]?arguments[1]:"normal",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.parent.getFormattingValues(this.ctx,this.selected,this.hover,e);for(var n=(t=(t=t.replace(/^( +)/g,"$1\r")).replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r")).split("\r");n.length>0;){var o=this.getLongestFit(n);if(0===o){var r=n[0],s=this.getLongestFitWord(r);this.lines.newLine(xf(r).call(r,0,s),e),n[0]=xf(r).call(r,s)}else{var a=o;" "===n[o-1]?o--:" "===n[a]&&a++;var h=xf(n).call(n,0,o).join("");o==n.length&&i?this.lines.append(h,e):this.lines.newLine(h,e),n=xf(n).call(n,a)}}}}]),t}(),EP=["bold","ital","boldital","mono"],OP=function(){function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];ph(this,t),this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(i),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=n}return xu(t,[{key:"setOptions",value:function(t){if(this.elementOptions=t,this.initFontOptions(t.font),mP(t.label)?this.labelDirty=!0:t.label=void 0,void 0!==t.font&&null!==t.font)if("string"==typeof t.font)this.baseSize=this.fontOptions.size;else if("object"===bu(t.font)){var e=t.font.size;void 0!==e&&(this.baseSize=e)}}},{key:"initFontOptions",value:function(e){var i=this;kb(EP,(function(t){i.fontOptions[t]={}})),t.parseFontString(this.fontOptions,e)?this.fontOptions.vadjust=0:kb(e,(function(t,e){null!=t&&"object"!==bu(t)&&(i.fontOptions[e]=t)}))}},{key:"constrain",value:function(t){var e={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=Rb(t,"widthConstraint");if("number"==typeof i)e.maxWdt=Number(i),e.minWdt=Number(i);else if("object"===bu(i)){var n=Rb(t,["widthConstraint","maximum"]);"number"==typeof n&&(e.maxWdt=Number(n));var o=Rb(t,["widthConstraint","minimum"]);"number"==typeof o&&(e.minWdt=Number(o))}var r=Rb(t,"heightConstraint");if("number"==typeof r)e.minHgt=Number(r);else if("object"===bu(r)){var s=Rb(t,["heightConstraint","minimum"]);"number"==typeof s&&(e.minHgt=Number(s));var a=Rb(t,["heightConstraint","valign"]);"string"==typeof a&&("top"!==a&&"bottom"!==a||(e.valign=a))}return e}},{key:"update",value:function(t,e){this.setOptions(t,!0),this.propagateFonts(e),gb(this.fontOptions,this.constrain(e)),this.fontOptions.chooser=gP("label",e)}},{key:"adjustSizes",value:function(t){var e=t?t.right+t.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=e,this.fontOptions.minWdt-=e);var i=t?t.top+t.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}},{key:"addFontOptionsToPile",value:function(t,e){for(var i=0;i5&&void 0!==arguments[5]?arguments[5]:"middle";if(void 0!==this.elementOptions.label){var s=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&s=this.elementOptions.scaling.label.maxVisible&&(s=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(t,n,o,e,i,r),this._drawBackground(t),this._drawText(t,e,this.size.yLine,r,s))}}},{key:"_drawBackground",value:function(t){if(void 0!==this.fontOptions.background&&"none"!==this.fontOptions.background){t.fillStyle=this.fontOptions.background;var e=this.getSize();t.fillRect(e.left,e.top,e.width,e.height)}}},{key:"_drawText",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"middle",o=arguments.length>4?arguments[4]:void 0,r=pf(this._setAlignment(t,e,i,n),2);e=r[0],i=r[1],t.textAlign="left",e-=this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&("top"===this.fontOptions.valign&&(i-=(this.size.height-this.size.labelHeight)/2),"bottom"===this.fontOptions.valign&&(i+=(this.size.height-this.size.labelHeight)/2));for(var s=0;s0&&(t.lineWidth=d.strokeWidth,t.strokeStyle=f,t.lineJoin="round"),t.fillStyle=u,d.strokeWidth>0&&t.strokeText(d.text,e+h,i+d.vadjust),t.fillText(d.text,e+h,i+d.vadjust),h+=d.width}i+=a.height}}}},{key:"_setAlignment",value:function(t,e,i,n){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&!1===this.pointToSelf){e=0,i=0;"top"===this.fontOptions.align?(t.textBaseline="alphabetic",i-=4):"bottom"===this.fontOptions.align?(t.textBaseline="hanging",i+=4):t.textBaseline="middle"}else t.textBaseline=n;return[e,i]}},{key:"_getColor",value:function(t,e,i){var n=t||"#000000",o=i||"#ffffff";if(e<=this.elementOptions.scaling.label.drawThreshold){var r=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-e)));n=Ob(n,r),o=Ob(o,r)}return[n,o]}},{key:"getTextSize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._processLabel(t,e,i),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}},{key:"getSize",value:function(){var t=this.size.left,e=this.size.top-1;if(this.isEdgeLabel){var i=.5*-this.size.width;switch(this.fontOptions.align){case"middle":t=i,e=.5*-this.size.height;break;case"top":t=i,e=-(this.size.height+2);break;case"bottom":t=i,e=2}}return{left:t,top:e,width:this.size.width,height:this.size.height}}},{key:"calculateLabelSize",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";this._processLabel(t,e,i),this.size.left=n-.5*this.size.width,this.size.top=o-.5*this.size.height,this.size.yLine=o+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===r&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}},{key:"getFormattingValues",value:function(t,e,i,n){var o=function(t,e,i){return"normal"===e?"mod"===i?"":t[i]:void 0!==t[e][i]?t[e][i]:t[i]},r={color:o(this.fontOptions,n,"color"),size:o(this.fontOptions,n,"size"),face:o(this.fontOptions,n,"face"),mod:o(this.fontOptions,n,"mod"),vadjust:o(this.fontOptions,n,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(e||i)&&("normal"===n&&!0===this.fontOptions.chooser&&this.elementOptions.labelHighlightBold?r.mod="bold":"function"==typeof this.fontOptions.chooser&&this.fontOptions.chooser(r,this.elementOptions.id,e,i));var s="";return void 0!==r.mod&&""!==r.mod&&(s+=r.mod+" "),s+=r.size+"px "+r.face,t.font=s.replace(/"/g,""),r.font=t.font,r.height=r.size,r}},{key:"differentState",value:function(t,e){return t!==this.selectedState||e!==this.hoverState}},{key:"_processLabelText",value:function(t,e,i,n){return new xP(t,this,e,i).process(n)}},{key:"_processLabel",value:function(t,e,i){if(!1!==this.labelDirty||this.differentState(e,i)){var n=this._processLabelText(t,e,i,this.elementOptions.label);this.fontOptions.minWdt>0&&n.width0&&n.height0&&(this.enableBorderDashes(t,e),t.stroke(),this.disableBorderDashes(t,e)),t.restore()}},{key:"performFill",value:function(t,e){t.save(),t.fillStyle=e.color,this.enableShadow(t,e),Kg(t).call(t),this.disableShadow(t,e),t.restore(),this.performStroke(t,e)}},{key:"_addBoundingBoxMargin",value:function(t){this.boundingBox.left-=t,this.boundingBox.top-=t,this.boundingBox.bottom+=t,this.boundingBox.right+=t}},{key:"_updateBoundingBox",value:function(t,e,i,n,o){void 0!==i&&this.resize(i,n,o),this.left=t-this.width/2,this.top=e-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}},{key:"updateBoundingBox",value:function(t,e,i,n,o){this._updateBoundingBox(t,e,i,n,o)}},{key:"getDimensionsFromLabel",value:function(t,e,i){this.textSize=this.labelModule.getTextSize(t,e,i);var n=this.textSize.width,o=this.textSize.height;return 0===n&&(n=14,o=14),{width:n,height:o}}}]),t}();function SP(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var TP=function(t){D_(i,t);var e=SP(i);function i(t,n,o){var r;return ph(this,i),(r=e.call(this,t,n,o))._setMargins(o),r}return xu(i,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(e,i)){var n=this.getDimensionsFromLabel(t,e,i);this.width=n.width+this.margin.right+this.margin.left,this.height=n.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}},{key:"draw",value:function(t,e,i,n,o,r){this.resize(t,n,o),this.left=e-this.width/2,this.top=i-this.height/2,this.initContextForDraw(t,r),qn(t,this.left,this.top,this.width,this.height,r.borderRadius),this.performFill(t,r),this.updateBoundingBox(e,i,t,n,o),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,o)}},{key:"updateBoundingBox",value:function(t,e,i,n,o){this._updateBoundingBox(t,e,i,n,o);var r=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(r)}},{key:"distanceToBorder",value:function(t,e){t&&this.resize(t);var i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(e)),Math.abs(this.height/2/Math.sin(e)))+i}}]),i}(CP);function MP(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var PP=function(t){D_(i,t);var e=MP(i);function i(t,n,o){var r;return ph(this,i),(r=e.call(this,t,n,o)).labelOffset=0,r.selected=!1,r}return xu(i,[{key:"setOptions",value:function(t,e,i){this.options=t,void 0===e&&void 0===i||this.setImages(e,i)}},{key:"setImages",value:function(t,e){e&&this.selected?(this.imageObj=e,this.imageObjAlt=t):(this.imageObj=t,this.imageObjAlt=e)}},{key:"switchImages",value:function(t){var e=t&&!this.selected||!t&&this.selected;if(this.selected=t,void 0!==this.imageObjAlt&&e){var i=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=i}}},{key:"_getImagePadding",value:function(){var t={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){var e=this.options.imagePadding;"object"==bu(e)?(t.top=e.top,t.right=e.right,t.bottom=e.bottom,t.left=e.left):(t.top=e,t.right=e,t.bottom=e,t.left=e)}return t}},{key:"_resizeImage",value:function(){var t,e;if(!1===this.options.shapeProperties.useImageSize){var i=1,n=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?i=this.imageObj.width/this.imageObj.height:n=this.imageObj.height/this.imageObj.width),t=2*this.options.size*i,e=2*this.options.size*n}else{var o=this._getImagePadding();t=this.imageObj.width+o.left+o.right,e=this.imageObj.height+o.top+o.bottom}this.width=t,this.height=e,this.radius=.5*this.width}},{key:"_drawRawCircle",value:function(t,e,i,n){this.initContextForDraw(t,n),Wn(t,e,i,n.size),this.performFill(t,n)}},{key:"_drawImageAtPosition",value:function(t,e){if(0!=this.imageObj.width){t.globalAlpha=void 0!==e.opacity?e.opacity:1,this.enableShadow(t,e);var i=1;!0===this.options.shapeProperties.interpolation&&(i=this.imageObj.width/this.width/this.body.view.scale);var n=this._getImagePadding(),o=this.left+n.left,r=this.top+n.top,s=this.width-n.left-n.right,a=this.height-n.top-n.bottom;this.imageObj.drawImageAtPosition(t,i,o,r,s,a),this.disableShadow(t,e)}}},{key:"_drawImageLabel",value:function(t,e,i,n,o){var r=0;if(void 0!==this.height){r=.5*this.height;var s=this.labelModule.getTextSize(t,n,o);s.lineCount>=1&&(r+=s.height/2)}var a=i+r;this.options.label&&(this.labelOffset=r),this.labelModule.draw(t,e,a,n,o,"hanging")}}]),i}(CP);function DP(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var IP=function(t){D_(i,t);var e=DP(i);function i(t,n,o){var r;return ph(this,i),(r=e.call(this,t,n,o))._setMargins(o),r}return xu(i,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(e,i)){var n=this.getDimensionsFromLabel(t,e,i),o=Math.max(n.width+this.margin.right+this.margin.left,n.height+this.margin.top+this.margin.bottom);this.options.size=o/2,this.width=o,this.height=o,this.radius=this.width/2}}},{key:"draw",value:function(t,e,i,n,o,r){this.resize(t,n,o),this.left=e-this.width/2,this.top=i-this.height/2,this._drawRawCircle(t,e,i,r),this.updateBoundingBox(e,i),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,i,n,o)}},{key:"updateBoundingBox",value:function(t,e){this.boundingBox.top=e-this.options.size,this.boundingBox.left=t-this.options.size,this.boundingBox.right=t+this.options.size,this.boundingBox.bottom=e+this.options.size}},{key:"distanceToBorder",value:function(t){return t&&this.resize(t),.5*this.width}}]),i}(PP);function BP(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var NP=function(t){D_(i,t);var e=BP(i);function i(t,n,o,r,s){var a;return ph(this,i),(a=e.call(this,t,n,o)).setImages(r,s),a}return xu(i,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){var n=2*this.options.size;return this.width=n,this.height=n,void(this.radius=.5*this.width)}this.needsRefresh(e,i)&&this._resizeImage()}},{key:"draw",value:function(t,e,i,n,o,r){this.switchImages(n),this.resize();var s=e,a=i;"top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=e,this.top=i,s+=this.width/2,a+=this.height/2):(this.left=e-this.width/2,this.top=i-this.height/2),this._drawRawCircle(t,s,a,r),t.save(),t.clip(),this._drawImageAtPosition(t,r),t.restore(),this._drawImageLabel(t,s,a,n,o),this.updateBoundingBox(e,i)}},{key:"updateBoundingBox",value:function(t,e){"top-left"===this.options.shapeProperties.coordinateOrigin?(this.boundingBox.top=e,this.boundingBox.left=t,this.boundingBox.right=t+2*this.options.size,this.boundingBox.bottom=e+2*this.options.size):(this.boundingBox.top=e-this.options.size,this.boundingBox.left=t-this.options.size,this.boundingBox.right=t+this.options.size,this.boundingBox.bottom=e+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)}},{key:"distanceToBorder",value:function(t){return t&&this.resize(t),.5*this.width}}]),i}(PP);function FP(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var zP=function(t){D_(i,t);var e=FP(i);function i(t,n,o){return ph(this,i),e.call(this,t,n,o)}return xu(i,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{size:this.options.size};if(this.needsRefresh(e,i)){var o,r;this.labelModule.getTextSize(t,e,i);var s=2*n.size;this.width=null!==(o=this.customSizeWidth)&&void 0!==o?o:s,this.height=null!==(r=this.customSizeHeight)&&void 0!==r?r:s,this.radius=.5*this.width}}},{key:"_drawShape",value:function(t,e,i,n,o,r,s,a){var h,l=this;return this.resize(t,r,s,a),this.left=n-this.width/2,this.top=o-this.height/2,this.initContextForDraw(t,a),(h=e,Object.prototype.hasOwnProperty.call(Xn,h)?Xn[h]:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n0&&(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))}}]),i}(CP);function AP(t,e){var i=Hf(t);if(aM){var n=aM(t);e&&(n=yv(n).call(n,(function(e){return yM(t,e).enumerable}))),i.push.apply(i,n)}return i}function jP(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(e,i)){var n=this.getDimensionsFromLabel(t,e,i);this.height=2*n.height,this.width=n.width+n.height,this.radius=.5*this.width}}},{key:"draw",value:function(t,e,i,n,o,r){this.resize(t,n,o),this.left=e-.5*this.width,this.top=i-.5*this.height,this.initContextForDraw(t,r),Vn(t,this.left,this.top,this.width,this.height),this.performFill(t,r),this.updateBoundingBox(e,i,t,n,o),this.labelModule.draw(t,e,i,n,o)}},{key:"distanceToBorder",value:function(t,e){t&&this.resize(t);var i=.5*this.width,n=.5*this.height,o=Math.sin(e)*i,r=Math.cos(e)*n;return i*n/Math.sqrt(o*o+r*r)}}]),i}(CP);function KP(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var $P=function(t){D_(i,t);var e=KP(i);function i(t,n,o){var r;return ph(this,i),(r=e.call(this,t,n,o))._setMargins(o),r}return xu(i,[{key:"resize",value:function(t,e,i){this.needsRefresh(e,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)}},{key:"draw",value:function(t,e,i,n,o,r){var s=this;return this.resize(t,n,o),this.options.icon.size=this.options.icon.size||50,this.left=e-this.width/2,this.top=i-this.height/2,this._icon(t,e,i,n,o,r),{drawExternalLabel:function(){if(void 0!==s.options.label){s.labelModule.draw(t,s.left+s.iconSize.width/2+s.margin.left,i+s.height/2+5,n)}s.updateBoundingBox(e,i)}}}},{key:"updateBoundingBox",value:function(t,e){if(this.boundingBox.top=e-.5*this.options.icon.size,this.boundingBox.left=t-.5*this.options.icon.size,this.boundingBox.right=t+.5*this.options.icon.size,this.boundingBox.bottom=e+.5*this.options.icon.size,void 0!==this.options.label&&this.labelModule.size.width>0){this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5)}}},{key:"_icon",value:function(t,e,i,n,o,r){var s=Number(this.options.icon.size);void 0!==this.options.icon.code?(t.font=[null!=this.options.icon.weight?this.options.icon.weight:n?"bold":"",(null!=this.options.icon.weight&&n?5:0)+s+"px",this.options.icon.face].join(" "),t.fillStyle=this.options.icon.color||"black",t.textAlign="center",t.textBaseline="middle",this.enableShadow(t,r),t.fillText(this.options.icon.code,e,i),this.disableShadow(t,r)):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.")}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),i}(CP);function ZP(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var QP=function(t){D_(i,t);var e=ZP(i);function i(t,n,o,r,s){var a;return ph(this,i),(a=e.call(this,t,n,o)).setImages(r,s),a}return xu(i,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){var n=2*this.options.size;return this.width=n,void(this.height=n)}this.needsRefresh(e,i)&&this._resizeImage()}},{key:"draw",value:function(t,e,i,n,o,r){t.save(),this.switchImages(n),this.resize();var s=e,a=i;if("top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=e,this.top=i,s+=this.width/2,a+=this.height/2):(this.left=e-this.width/2,this.top=i-this.height/2),!0===this.options.shapeProperties.useBorderWithImage){var h=this.options.borderWidth,l=this.options.borderWidthSelected||2*this.options.borderWidth,d=(n?l:h)/this.body.view.scale;t.lineWidth=Math.min(this.width,d),t.beginPath();var c=n?this.options.color.highlight.border:o?this.options.color.hover.border:this.options.color.border,u=n?this.options.color.highlight.background:o?this.options.color.hover.background:this.options.color.background;void 0!==r.opacity&&(c=Ob(c,r.opacity),u=Ob(u,r.opacity)),t.strokeStyle=c,t.fillStyle=u,t.rect(this.left-.5*t.lineWidth,this.top-.5*t.lineWidth,this.width+t.lineWidth,this.height+t.lineWidth),Kg(t).call(t),this.performStroke(t,r),t.closePath()}this._drawImageAtPosition(t,r),this._drawImageLabel(t,s,a,n,o),this.updateBoundingBox(e,i),t.restore()}},{key:"updateBoundingBox",value:function(t,e){this.resize(),"top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=t,this.top=e):(this.left=t-this.width/2,this.top=e-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),i}(PP);function JP(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var tD=function(t){D_(i,t);var e=JP(i);function i(t,n,o){return ph(this,i),e.call(this,t,n,o)}return xu(i,[{key:"draw",value:function(t,e,i,n,o,r){return this._drawShape(t,"square",2,e,i,n,o,r)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),i}(zP);function eD(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var iD=function(t){D_(i,t);var e=eD(i);function i(t,n,o){return ph(this,i),e.call(this,t,n,o)}return xu(i,[{key:"draw",value:function(t,e,i,n,o,r){return this._drawShape(t,"hexagon",4,e,i,n,o,r)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),i}(zP);function nD(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var oD=function(t){D_(i,t);var e=nD(i);function i(t,n,o){return ph(this,i),e.call(this,t,n,o)}return xu(i,[{key:"draw",value:function(t,e,i,n,o,r){return this._drawShape(t,"star",4,e,i,n,o,r)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),i}(zP);function rD(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var sD=function(t){D_(i,t);var e=rD(i);function i(t,n,o){var r;return ph(this,i),(r=e.call(this,t,n,o))._setMargins(o),r}return xu(i,[{key:"resize",value:function(t,e,i){this.needsRefresh(e,i)&&(this.textSize=this.labelModule.getTextSize(t,e,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)}},{key:"draw",value:function(t,e,i,n,o,r){this.resize(t,n,o),this.left=e-this.width/2,this.top=i-this.height/2,this.enableShadow(t,r),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,o),this.disableShadow(t,r),this.updateBoundingBox(e,i,t,n,o)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),i}(CP);function aD(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var hD=function(t){D_(i,t);var e=aD(i);function i(t,n,o){return ph(this,i),e.call(this,t,n,o)}return xu(i,[{key:"draw",value:function(t,e,i,n,o,r){return this._drawShape(t,"triangle",3,e,i,n,o,r)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),i}(zP);function lD(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var dD=function(t){D_(i,t);var e=lD(i);function i(t,n,o){return ph(this,i),e.call(this,t,n,o)}return xu(i,[{key:"draw",value:function(t,e,i,n,o,r){return this._drawShape(t,"triangleDown",3,e,i,n,o,r)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),i}(zP);function cD(t,e){var i=Hf(t);if(aM){var n=aM(t);e&&(n=yv(n).call(n,(function(e){return yM(t,e).enumerable}))),i.push.apply(i,n)}return i}function uD(t){for(var e=1;et.left&&this.shape.topt.top}},{key:"isBoundingBoxOverlappingWith",value:function(t){return this.shape.boundingBox.leftt.left&&this.shape.boundingBox.topt.top}}],[{key:"checkOpacity",value:function(t){return 0<=t&&t<=1}},{key:"checkCoordinateOrigin",value:function(t){return void 0===t||"center"===t||"top-left"===t}},{key:"updateGroupOptions",value:function(e,i,n){var o;if(void 0!==n){var r=e.group;if(void 0!==i&&void 0!==i.group&&r!==i.group)throw new Error("updateGroupOptions: group values in options don't match.");if("number"==typeof r||"string"==typeof r&&""!=r){var s=n.get(r);void 0!==s.opacity&&void 0===i.opacity&&(t.checkOpacity(s.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+s.opacity),s.opacity=void 0));var a=yv(o=vP(i)).call(o,(function(t){return null!=i[t]}));a.push("font"),vb(a,e,s),e.color=Sb(e.color)}}}},{key:"parseOptions",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4?arguments[4]:void 0;if(vb(["color","fixed","shadow"],e,i,n),t.checkMass(i),void 0!==e.opacity&&(t.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),void 0!==i.opacity&&(t.checkOpacity(i.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+i.opacity),i.opacity=void 0)),i.shapeProperties&&!t.checkCoordinateOrigin(i.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+i.shapeProperties.coordinateOrigin),Ab(e,i,"shadow",o),void 0!==i.color&&null!==i.color){var s=Sb(i.color);ub(e.color,s)}else!0===n&&null===i.color&&(e.color=zb(o.color));void 0!==i.fixed&&null!==i.fixed&&("boolean"==typeof i.fixed?(e.fixed.x=i.fixed,e.fixed.y=i.fixed):(void 0!==i.fixed.x&&"boolean"==typeof i.fixed.x&&(e.fixed.x=i.fixed.x),void 0!==i.fixed.y&&"boolean"==typeof i.fixed.y&&(e.fixed.y=i.fixed.y))),!0===n&&null===i.font&&(e.font=zb(o.font)),t.updateGroupOptions(e,i,r),void 0!==i.scaling&&Ab(e.scaling,i.scaling,"label",o.scaling)}},{key:"checkMass",value:function(t,e){if(void 0!==t.mass&&t.mass<=0){var i="";void 0!==e&&(i=" in node id: "+e),console.error("%cNegative or zero mass disallowed"+i+", setting mass to 1.",tw),t.mass=1}}}]),t}();function pD(t,e){var i=void 0!==gf&&fh(t)||t["@@iterator"];if(!i){if(Df(t)||(i=function(t,e){var i;if(!t)return;if("string"==typeof t)return vD(t,e);var n=xf(i=Object.prototype.toString.call(t)).call(i,8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Ya(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vD(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,r=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw r}}}}function vD(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+t.opacity):this.options.opacity=t.opacity),void 0!==t.shape)for(var e in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&this.body.nodes[e].updateShape();if(void 0!==t.font||void 0!==t.widthConstraint||void 0!==t.heightConstraint)for(var i=0,n=Hf(this.body.nodes);i1&&void 0!==arguments[1]&&arguments[1],i=this.body.data.nodes;if(ZM("id",t))this.body.data.nodes=t;else if(Df(t))this.body.data.nodes=new GM,this.body.data.nodes.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new GM}if(i&&kb(this.nodesListeners,(function(t,e){i.off(e,t)})),this.body.nodes={},this.body.data.nodes){var n=this;kb(this.nodesListeners,(function(t,e){n.body.data.nodes.on(e,t)}));var o=this.body.data.nodes.getIds();this.add(o,!0)}!1===e&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(t){for(var e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:fD)(t,this.body,this.images,this.groups,this.options,this.defaultOptions)}},{key:"refresh",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];kb(this.body.nodes,(function(i,n){var o=t.body.data.nodes.get(n);void 0!==o&&(!0===e&&i.setOptions({x:null,y:null}),i.setOptions({fixed:!1}),i.setOptions(o))}))}},{key:"getPositions",value:function(t){var e={};if(void 0!==t){if(!0===Df(t)){for(var i=0;i0?(n=i/a)*n:i;return a===1/0?1/0:a*PD(o)}});var DD=i(et.Math.hypot);function ID(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var BD=function(){function t(){ph(this,t)}return xu(t,null,[{key:"transform",value:function(t,e){Df(t)||(t=[t]);for(var i=e.point.x,n=e.point.y,o=e.angle,r=e.length,s=0;s4&&void 0!==arguments[4]?arguments[4]:this.getViaNode();t.strokeStyle=this.getColor(t,e),t.lineWidth=e.width,!1!==e.dashes?this._drawDashedLine(t,e,o):this._drawLine(t,e,o)}},{key:"_drawLine",value:function(t,e,i,n,o){if(this.from!=this.to)this._line(t,e,i,n,o);else{var r=pf(this._getCircleData(t),3),s=r[0],a=r[1],h=r[2];this._circle(t,e,s,a,h)}}},{key:"_drawDashedLine",value:function(t,e,i,n,o){t.lineCap="round";var r=Df(e.dashes)?e.dashes:[5,5];if(void 0!==t.setLineDash){if(t.save(),t.setLineDash(r),t.lineDashOffset=0,this.from!=this.to)this._line(t,e,i);else{var s=pf(this._getCircleData(t),3),a=s[0],h=s[1],l=s[2];this._circle(t,e,a,h,l)}t.setLineDash([0]),t.lineDashOffset=0,t.restore()}else{if(this.from!=this.to)Yn(t,this.from.x,this.from.y,this.to.x,this.to.y,r);else{var d=pf(this._getCircleData(t),3),c=d[0],u=d[1],f=d[2];this._circle(t,e,c,u,f)}this.enableShadow(t,e),t.stroke(),this.disableShadow(t,e)}}},{key:"findBorderPosition",value:function(t,e,i){return this.from!=this.to?this._findBorderPosition(t,e,i):this._findBorderPositionCircle(t,e,i)}},{key:"findBorderPositions",value:function(t){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,t),to:this._findBorderPosition(this.to,t)};var e,i=pf(xf(e=this._getCircleData(t)).call(e,0,2),2),n=i[0],o=i[1];return{from:this._findBorderPositionCircle(this.from,t,{x:n,y:o,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,t,{x:n,y:o,low:.6,high:.8,direction:1})}}},{key:"_getCircleData",value:function(t){var e=this.options.selfReference.size;void 0!==t&&void 0===this.from.shape.width&&this.from.shape.resize(t);var i=bP(t,this.options.selfReference.angle,e,this.from);return[i.x,i.y,e]}},{key:"_pointOnCircle",value:function(t,e,i,n){var o=2*n*Math.PI;return{x:t+i*Math.cos(o),y:e-i*Math.sin(o)}}},{key:"_findBorderPositionCircle",value:function(t,e,i){var n,o=i.x,r=i.y,s=i.low,a=i.high,h=i.direction,l=this.options.selfReference.size,d=.5*(s+a),c=0;!0===this.options.arrowStrikethrough&&(-1===h?c=this.options.endPointOffset.from:1===h&&(c=this.options.endPointOffset.to));var u=0;do{d=.5*(s+a),n=this._pointOnCircle(o,r,l,d);var f=Math.atan2(t.y-n.y,t.x-n.x),p=t.distanceToBorder(e,f)+c-Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2));if(Math.abs(p)<.05)break;p>0?h>0?s=d:a=d:h>0?a=d:s=d,++u}while(s<=a&&u<10);return GD(GD({},n),{},{t:d})}},{key:"getLineWidth",value:function(t,e){return!0===t?Math.max(this.selectionWidth,.3/this._body.view.scale):!0===e?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}},{key:"getColor",value:function(t,e){if(!1!==e.inheritsColor){if("both"===e.inheritsColor&&this.from.id!==this.to.id){var i=t.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),n=this.from.options.color.highlight.border,o=this.to.options.color.highlight.border;return!1===this.from.selected&&!1===this.to.selected?(n=Ob(this.from.options.color.border,e.opacity),o=Ob(this.to.options.color.border,e.opacity)):!0===this.from.selected&&!1===this.to.selected?o=this.to.options.color.border:!1===this.from.selected&&!0===this.to.selected&&(n=this.from.options.color.border),i.addColorStop(0,n),i.addColorStop(1,o),i}return"to"===e.inheritsColor?Ob(this.to.options.color.border,e.opacity):Ob(this.from.options.color.border,e.opacity)}return Ob(e.color,e.opacity)}},{key:"_circle",value:function(t,e,i,n,o){this.enableShadow(t,e);var r=0,s=2*Math.PI;if(!this.options.selfReference.renderBehindTheNode){var a=this.options.selfReference.angle,h=this.options.selfReference.angle+Math.PI,l=this._findBorderPositionCircle(this.from,t,{x:i,y:n,low:a,high:h,direction:-1}),d=this._findBorderPositionCircle(this.from,t,{x:i,y:n,low:a,high:h,direction:1});r=Math.atan2(l.y-n,l.x-i),s=Math.atan2(d.y-n,d.x-i)}t.beginPath(),t.arc(i,n,o,r,s,!1),t.stroke(),this.disableShadow(t,e)}},{key:"getDistanceToEdge",value:function(t,e,i,n,o,r){if(this.from!=this.to)return this._getDistanceToEdge(t,e,i,n,o,r);var s=pf(this._getCircleData(void 0),3),a=s[0],h=s[1],l=s[2],d=a-o,c=h-r;return Math.abs(Math.sqrt(d*d+c*c)-l)}},{key:"_getDistanceToLine",value:function(t,e,i,n,o,r){var s=i-t,a=n-e,h=((o-t)*s+(r-e)*a)/(s*s+a*a);h>1?h=1:h<0&&(h=0);var l=t+h*s-o,d=e+h*a-r;return Math.sqrt(l*l+d*d)}},{key:"getArrowData",value:function(t,e,i,n,o,r){var s,a,h,l,d,c,u,f=r.width;"from"===e?(h=this.from,l=this.to,d=r.fromArrowScale<0,c=Math.abs(r.fromArrowScale),u=r.fromArrowType):"to"===e?(h=this.to,l=this.from,d=r.toArrowScale<0,c=Math.abs(r.toArrowScale),u=r.toArrowType):(h=this.to,l=this.from,d=r.middleArrowScale<0,c=Math.abs(r.middleArrowScale),u=r.middleArrowType);var p=15*c+3*f;if(h!=l){var v=p/DD(h.x-l.x,h.y-l.y);if("middle"!==e)if(!0===this.options.smooth.enabled){var g=this._findBorderPosition(h,t,{via:i}),y=this.getPoint(g.t+v*("from"===e?1:-1),i);s=Math.atan2(g.y-y.y,g.x-y.x),a=g}else s=Math.atan2(h.y-l.y,h.x-l.x),a=this._findBorderPosition(h,t);else{var m=(d?-v:v)/2,b=this.getPoint(.5+m,i),w=this.getPoint(.5-m,i);s=Math.atan2(b.y-w.y,b.x-w.x),a=this.getPoint(.5,i)}}else{var k=pf(this._getCircleData(t),3),_=k[0],x=k[1],E=k[2];if("from"===e){var O=this.options.selfReference.angle,C=this.options.selfReference.angle+Math.PI,S=this._findBorderPositionCircle(this.from,t,{x:_,y:x,low:O,high:C,direction:-1});s=-2*S.t*Math.PI+1.5*Math.PI+.1*Math.PI,a=S}else if("to"===e){var T=this.options.selfReference.angle,M=this.options.selfReference.angle+Math.PI,P=this._findBorderPositionCircle(this.from,t,{x:_,y:x,low:T,high:M,direction:1});s=-2*P.t*Math.PI+1.5*Math.PI-1.1*Math.PI,a=P}else{var D=this.options.selfReference.angle/(2*Math.PI);a=this._pointOnCircle(_,x,E,D),s=-2*D*Math.PI+1.5*Math.PI+.1*Math.PI}}return{point:a,core:{x:a.x-.9*p*Math.cos(s),y:a.y-.9*p*Math.sin(s)},angle:s,length:p,type:u}}},{key:"drawArrowHead",value:function(t,e,i,n,o){t.strokeStyle=this.getColor(t,e),t.fillStyle=t.strokeStyle,t.lineWidth=e.width,YD.draw(t,o)&&(this.enableShadow(t,e),Kg(t).call(t),this.disableShadow(t,e))}},{key:"enableShadow",value:function(t,e){!0===e.shadow&&(t.shadowColor=e.shadowColor,t.shadowBlur=e.shadowSize,t.shadowOffsetX=e.shadowX,t.shadowOffsetY=e.shadowY)}},{key:"disableShadow",value:function(t,e){!0===e.shadow&&(t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0)}},{key:"drawBackground",value:function(t,e){if(!1!==e.background){var i={strokeStyle:t.strokeStyle,lineWidth:t.lineWidth,dashes:t.dashes};t.strokeStyle=e.backgroundColor,t.lineWidth=e.backgroundSize,this.setStrokeDashed(t,e.backgroundDashes),t.stroke(),t.strokeStyle=i.strokeStyle,t.lineWidth=i.lineWidth,t.dashes=i.dashes,this.setStrokeDashed(t,e.dashes)}}},{key:"setStrokeDashed",value:function(t,e){if(!1!==e)if(void 0!==t.setLineDash){var i=Df(e)?e:[5,5];t.setLineDash(i)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else void 0!==t.setLineDash?t.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}]),t}();function $D(t,e){var i=Hf(t);if(aM){var n=aM(t);e&&(n=yv(n).call(n,(function(e){return yM(t,e).enumerable}))),i.push.apply(i,n)}return i}function ZD(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:this._getViaCoordinates(),r=!1,s=1,a=0,h=this.to,l=this.options.endPointOffset?this.options.endPointOffset.to:0;t.id===this.from.id&&(h=this.from,r=!0,l=this.options.endPointOffset?this.options.endPointOffset.from:0),!1===this.options.arrowStrikethrough&&(l=0);var d=0;do{n=.5*(a+s),i=this.getPoint(n,o);var c=Math.atan2(h.y-i.y,h.x-i.x),u=h.distanceToBorder(e,c)+l-Math.sqrt(Math.pow(i.x-h.x,2)+Math.pow(i.y-h.y,2));if(Math.abs(u)<.2)break;u<0?!1===r?a=n:s=n:!1===r?s=n:a=n,++d}while(a<=s&&d<10);return ZD(ZD({},i),{},{t:n})}},{key:"_getDistanceToBezierEdge",value:function(t,e,i,n,o,r,s){var a,h,l,d,c,u=1e9,f=t,p=e;for(h=1;h<10;h++)l=.1*h,d=Math.pow(1-l,2)*t+2*l*(1-l)*s.x+Math.pow(l,2)*i,c=Math.pow(1-l,2)*e+2*l*(1-l)*s.y+Math.pow(l,2)*n,h>0&&(u=(a=this._getDistanceToLine(f,p,d,c,o,r))1&&void 0!==arguments[1]?arguments[1]:this.via;if(this.from===this.to){var i=pf(this._getCircleData(),3),n=i[0],o=i[1],r=i[2],s=2*Math.PI*(1-t);return{x:n+r*Math.sin(s),y:o+r-r*(1-Math.cos(s))}}return{x:Math.pow(1-t,2)*this.fromPoint.x+2*t*(1-t)*e.x+Math.pow(t,2)*this.toPoint.x,y:Math.pow(1-t,2)*this.fromPoint.y+2*t*(1-t)*e.y+Math.pow(t,2)*this.toPoint.y}}},{key:"_findBorderPosition",value:function(t,e){return this._findBorderPositionBezier(t,e,this.via)}},{key:"_getDistanceToEdge",value:function(t,e,i,n,o,r){return this._getDistanceToBezierEdge(t,e,i,n,o,r,this.via)}}]),i}(JD);function iI(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var nI=function(t){D_(i,t);var e=iI(i);function i(t,n,o){return ph(this,i),e.call(this,t,n,o)}return xu(i,[{key:"_line",value:function(t,e,i){this._bezierCurve(t,e,i)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var t,e,i=this.options.smooth.roundness,n=this.options.smooth.type,o=Math.abs(this.from.x-this.to.x),r=Math.abs(this.from.y-this.to.y);if("discrete"===n||"diagonalCross"===n){var s,a;s=a=o<=r?i*r:i*o,this.from.x>this.to.x&&(s=-s),this.from.y>=this.to.y&&(a=-a);var h=this.from.x+s,l=this.from.y+a;return"discrete"===n&&(o<=r?h=othis.to.x&&(t=-t),this.from.y>=this.to.y&&(e=-e);var w=this.from.x+t,k=this.from.y+e;return o<=r?w=this.from.x<=this.to.x?this.to.xw?this.to.x:w:k=this.from.y>=this.to.y?this.to.y>k?this.to.y:k:this.to.y2&&void 0!==arguments[2]?arguments[2]:{};return this._findBorderPositionBezier(t,e,i.via)}},{key:"_getDistanceToEdge",value:function(t,e,i,n,o,r){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(t,e,i,n,o,r,s)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),i=t;return{x:Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*e.x+Math.pow(i,2)*this.toPoint.x,y:Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*e.y+Math.pow(i,2)*this.toPoint.y}}}]),i}(JD);function oI(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var rI=function(t){D_(i,t);var e=oI(i);function i(t,n,o){return ph(this,i),e.call(this,t,n,o)}return xu(i,[{key:"_getDistanceToBezierEdge2",value:function(t,e,i,n,o,r,s,a){for(var h=1e9,l=t,d=e,c=[0,0,0,0],u=1;u<10;u++){var f=.1*u;c[0]=Math.pow(1-f,3),c[1]=3*f*Math.pow(1-f,2),c[2]=3*Math.pow(f,2)*(1-f),c[3]=Math.pow(f,3);var p=c[0]*t+c[1]*s.x+c[2]*a.x+c[3]*i,v=c[0]*e+c[1]*s.y+c[2]*a.y+c[3]*n;if(u>0){var g=this._getDistanceToLine(l,d,p,v,o,r);h=gMath.abs(r)||!0===this.options.smooth.forceDirection||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(e=this.from.y,n=this.to.y,t=this.from.x-s*o,i=this.to.x+s*o):(e=this.from.y-s*r,n=this.to.y+s*r,t=this.from.x,i=this.to.x),[{x:t,y:e},{x:i,y:n}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(t,e){return this._findBorderPositionBezier(t,e)}},{key:"_getDistanceToEdge",value:function(t,e,i,n,o,r){var s=pf(arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates(),2),a=s[0],h=s[1];return this._getDistanceToBezierEdge2(t,e,i,n,o,r,a,h)}},{key:"getPoint",value:function(t){var e=pf(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),2),i=e[0],n=e[1],o=t,r=[Math.pow(1-o,3),3*o*Math.pow(1-o,2),3*Math.pow(o,2)*(1-o),Math.pow(o,3)];return{x:r[0]*this.fromPoint.x+r[1]*i.x+r[2]*n.x+r[3]*this.toPoint.x,y:r[0]*this.fromPoint.y+r[1]*i.y+r[2]*n.y+r[3]*this.toPoint.y}}}]),i}(rI);function hI(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var lI=function(t){D_(i,t);var e=hI(i);function i(t,n,o){return ph(this,i),e.call(this,t,n,o)}return xu(i,[{key:"_line",value:function(t,e){t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),t.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(t,e),t.stroke(),this.disableShadow(t,e)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(t){return{x:(1-t)*this.fromPoint.x+t*this.toPoint.x,y:(1-t)*this.fromPoint.y+t*this.toPoint.y}}},{key:"_findBorderPosition",value:function(t,e){var i=this.to,n=this.from;t.id===this.from.id&&(i=this.from,n=this.to);var o=Math.atan2(i.y-n.y,i.x-n.x),r=i.x-n.x,s=i.y-n.y,a=Math.sqrt(r*r+s*s),h=(a-t.distanceToBorder(e,o))/a;return{x:(1-h)*n.x+h*i.x,y:(1-h)*n.y+h*i.y,t:0}}},{key:"_getDistanceToEdge",value:function(t,e,i,n,o,r){return this._getDistanceToLine(t,e,i,n,o,r)}}]),i}(KD),dI=function(){function t(e,i,n,o,r){if(ph(this,t),void 0===i)throw new Error("No body provided");this.options=zb(o),this.globalOptions=o,this.defaultOptions=r,this.body=i,this.imagelist=n,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 OP(this.body,this.options,!0),this.setOptions(e)}return xu(t,[{key:"setOptions",value:function(e){if(e){var i=void 0!==e.physics&&this.options.physics!==e.physics||void 0!==e.hidden&&(this.options.hidden||!1)!==(e.hidden||!1)||void 0!==e.from&&this.options.from!==e.from||void 0!==e.to&&this.options.to!==e.to;t.parseOptions(this.options,e,!0,this.globalOptions),void 0!==e.id&&(this.id=e.id),void 0!==e.from&&(this.fromId=e.from),void 0!==e.to&&(this.toId=e.to),void 0!==e.title&&(this.title=e.title),void 0!==e.value&&(e.value=lP(e.value));var n=[e,this.options,this.defaultOptions];return this.chooser=gP("edge",n),this.updateLabelModule(e),i=this.updateEdgeType()||i,this._setInteractionWidths(),this.connect(),i}}},{key:"getFormattingValues",value:function(){var t=!0===this.options.arrows.to||!0===this.options.arrows.to.enabled,e=!0===this.options.arrows.from||!0===this.options.arrows.from.enabled,i=!0===this.options.arrows.middle||!0===this.options.arrows.middle.enabled,n=this.options.color.inherit,o={toArrow:t,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:e,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:n?void 0:this.options.color.color,inheritsColor:n,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(!0===this.chooser){if(this.selected){var r=this.options.selectionWidth;"function"==typeof r?o.width=r(o.width):"number"==typeof r&&(o.width+=r),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.highlight,o.shadow=this.options.shadow.enabled}else if(this.hover){var s=this.options.hoverWidth;"function"==typeof s?o.width=s(o.width):"number"==typeof s&&(o.width+=s),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.hover,o.shadow=this.options.shadow.enabled}}else"function"==typeof this.chooser&&(this.chooser(o,this.options.id,this.selected,this.hover),void 0!==o.color&&(o.inheritsColor=!1),!1===o.shadow&&(o.shadowColor===this.options.shadow.color&&o.shadowSize===this.options.shadow.size&&o.shadowX===this.options.shadow.x&&o.shadowY===this.options.shadow.y||(o.shadow=!0)));else o.shadow=this.options.shadow.enabled,o.width=Math.max(o.width,.3/this.body.view.scale);return o}},{key:"updateLabelModule",value:function(t){var e=[t,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,e),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var t=this.options.smooth,e=!1,i=!0;return void 0!==this.edgeType&&((this.edgeType instanceof eI&&!0===t.enabled&&"dynamic"===t.type||this.edgeType instanceof aI&&!0===t.enabled&&"cubicBezier"===t.type||this.edgeType instanceof nI&&!0===t.enabled&&"dynamic"!==t.type&&"cubicBezier"!==t.type||this.edgeType instanceof lI&&!1===t.type.enabled)&&(i=!1),!0===i&&(e=this.cleanup())),!0===i?!0===t.enabled?"dynamic"===t.type?(e=!0,this.edgeType=new eI(this.options,this.body,this.labelModule)):"cubicBezier"===t.type?this.edgeType=new aI(this.options,this.body,this.labelModule):this.edgeType=new nI(this.options,this.body,this.labelModule):this.edgeType=new lI(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),e}},{key:"connect",value:function(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=void 0!==this.from&&void 0!==this.to,!0===this.connected?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}},{key:"disconnect",value:function(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}},{key:"getTitle",value:function(){return this.title}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"setValueRange",value:function(t,e,i){if(void 0!==this.options.value){var n=this.options.scaling.customScalingFunction(t,e,i,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){var r=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*r}this.options.width=this.options.scaling.min+n*o}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}},{key:"_setInteractionWidths",value:function(){"function"==typeof this.options.hoverWidth?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,"function"==typeof this.options.selectionWidth?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}},{key:"draw",value:function(t){var e=this.getFormattingValues();if(!e.hidden){var i=this.edgeType.getViaNode();this.edgeType.drawLine(t,e,this.selected,this.hover,i),this.drawLabel(t,i)}}},{key:"drawArrows",value:function(t){var e=this.getFormattingValues();if(!e.hidden){var i=this.edgeType.getViaNode(),n={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,e.fromArrow&&(n.from=this.edgeType.getArrowData(t,"from",i,this.selected,this.hover,e),!1===e.arrowStrikethrough&&(this.edgeType.fromPoint=n.from.core),e.fromArrowSrc&&(n.from.image=this.imagelist.load(e.fromArrowSrc)),e.fromArrowImageWidth&&(n.from.imageWidth=e.fromArrowImageWidth),e.fromArrowImageHeight&&(n.from.imageHeight=e.fromArrowImageHeight)),e.toArrow&&(n.to=this.edgeType.getArrowData(t,"to",i,this.selected,this.hover,e),!1===e.arrowStrikethrough&&(this.edgeType.toPoint=n.to.core),e.toArrowSrc&&(n.to.image=this.imagelist.load(e.toArrowSrc)),e.toArrowImageWidth&&(n.to.imageWidth=e.toArrowImageWidth),e.toArrowImageHeight&&(n.to.imageHeight=e.toArrowImageHeight)),e.middleArrow&&(n.middle=this.edgeType.getArrowData(t,"middle",i,this.selected,this.hover,e),e.middleArrowSrc&&(n.middle.image=this.imagelist.load(e.middleArrowSrc)),e.middleArrowImageWidth&&(n.middle.imageWidth=e.middleArrowImageWidth),e.middleArrowImageHeight&&(n.middle.imageHeight=e.middleArrowImageHeight)),e.fromArrow&&this.edgeType.drawArrowHead(t,e,this.selected,this.hover,n.from),e.middleArrow&&this.edgeType.drawArrowHead(t,e,this.selected,this.hover,n.middle),e.toArrow&&this.edgeType.drawArrowHead(t,e,this.selected,this.hover,n.to)}}},{key:"drawLabel",value:function(t,e){if(void 0!==this.options.label){var i,n=this.from,o=this.to;if(this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(t,this.selected,this.hover),n.id!=o.id){this.labelModule.pointToSelf=!1,i=this.edgeType.getPoint(.5,e),t.save();var r=this._getRotation(t);0!=r.angle&&(t.translate(r.x,r.y),t.rotate(r.angle)),this.labelModule.draw(t,i.x,i.y,this.selected,this.hover),t.restore()}else{this.labelModule.pointToSelf=!0;var s=bP(t,this.options.selfReference.angle,this.options.selfReference.size,n);i=this._pointOnCircle(s.x,s.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(t,i.x,i.y,this.selected,this.hover)}}}},{key:"getItemsOnPoint",value:function(t){var e=[];if(this.labelModule.visible()){var i=this._getRotation();yP(this.labelModule.getSize(),t,i)&&e.push({edgeId:this.id,labelId:0})}var n={left:t.x,top:t.y};return this.isOverlappingWith(n)&&e.push({edgeId:this.id}),e}},{key:"isOverlappingWith",value:function(t){if(this.connected){var e=this.from.x,i=this.from.y,n=this.to.x,o=this.to.y,r=t.left,s=t.top;return this.edgeType.getDistanceToEdge(e,i,n,o,r,s)<10}return!1}},{key:"_getRotation",value:function(t){var e=this.edgeType.getViaNode(),i=this.edgeType.getPoint(.5,e);void 0!==t&&this.labelModule.calculateLabelSize(t,this.selected,this.hover,i.x,i.y);var n={x:i.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible())return n;if("horizontal"===this.options.font.align)return n;var o=this.from.y-this.to.y,r=this.from.x-this.to.x,s=Math.atan2(o,r);return(s<-1&&r<0||s>0&&r<0)&&(s+=Math.PI),n.angle=s,n}},{key:"_pointOnCircle",value:function(t,e,i,n){return{x:t+i*Math.cos(n),y:e-i*Math.sin(n)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}},{key:"remove",value:function(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}},{key:"endPointsValid",value:function(){return void 0!==this.body.nodes[this.fromId]&&void 0!==this.body.nodes[this.toId]}}],[{key:"parseOptions",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(pb(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],t,e,i),void 0!==e.endPointOffset&&void 0!==e.endPointOffset.from&&(g_(e.endPointOffset.from)?t.endPointOffset.from=e.endPointOffset.from:(t.endPointOffset.from=void 0!==n.endPointOffset.from?n.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),void 0!==e.endPointOffset&&void 0!==e.endPointOffset.to&&(g_(e.endPointOffset.to)?t.endPointOffset.to=e.endPointOffset.to:(t.endPointOffset.to=void 0!==n.endPointOffset.to?n.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),mP(e.label)?t.label=e.label:mP(t.label)||(t.label=void 0),Ab(t,e,"smooth",n),Ab(t,e,"shadow",n),Ab(t,e,"background",n),void 0!==e.dashes&&null!==e.dashes?t.dashes=e.dashes:!0===i&&null===e.dashes&&(t.dashes=pg(n.dashes)),void 0!==e.scaling&&null!==e.scaling?(void 0!==e.scaling.min&&(t.scaling.min=e.scaling.min),void 0!==e.scaling.max&&(t.scaling.max=e.scaling.max),Ab(t.scaling,e.scaling,"label",n.scaling)):!0===i&&null===e.scaling&&(t.scaling=pg(n.scaling)),void 0!==e.arrows&&null!==e.arrows)if("string"==typeof e.arrows){var r=e.arrows.toLowerCase();t.arrows.to.enabled=-1!=lg(r).call(r,"to"),t.arrows.middle.enabled=-1!=lg(r).call(r,"middle"),t.arrows.from.enabled=-1!=lg(r).call(r,"from")}else{if("object"!==bu(e.arrows))throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+mg(e.arrows));Ab(t.arrows,e.arrows,"to",n.arrows),Ab(t.arrows,e.arrows,"middle",n.arrows),Ab(t.arrows,e.arrows,"from",n.arrows)}else!0===i&&null===e.arrows&&(t.arrows=pg(n.arrows));if(void 0!==e.color&&null!==e.color){var s=lb(e.color)?{color:e.color,highlight:e.color,hover:e.color,inherit:!1,opacity:1}:e.color,a=t.color;if(o)gb(a,n.color,!1,i);else for(var h in a)Object.prototype.hasOwnProperty.call(a,h)&&delete a[h];if(lb(a))a.color=a,a.highlight=a,a.hover=a,a.inherit=!1,void 0===s.opacity&&(a.opacity=1);else{var l=!1;void 0!==s.color&&(a.color=s.color,l=!0),void 0!==s.highlight&&(a.highlight=s.highlight,l=!0),void 0!==s.hover&&(a.hover=s.hover,l=!0),void 0!==s.inherit&&(a.inherit=s.inherit),void 0!==s.opacity&&(a.opacity=Math.min(1,Math.max(0,s.opacity))),!0===l?a.inherit=!1:void 0===a.inherit&&(a.inherit="from")}}else!0===i&&null===e.color&&(t.color=zb(n.color));!0===i&&null===e.font&&(t.font=zb(n.font)),Object.prototype.hasOwnProperty.call(e,"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}"),t.selfReference.size=e.selfReferenceSize)}}]),t}(),cI=function(){function t(e,i,n){var o,r=this;ph(this,t),this.body=e,this.images=i,this.groups=n,this.body.functions.createEdge=Hn(o=this.create).call(o,this),this.edgesListeners={add:function(t,e){r.add(e.items)},update:function(t,e){r.update(e.items)},remove:function(t,e){r.remove(e.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(t,e,i,n){if(e===t)return.5;var o=1/(e-t);return Math.max(0,(n-t)*o)}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},gb(this.options,this.defaultOptions),this.bindEventListeners()}return xu(t,[{key:"bindEventListeners",value:function(){var t,e,i=this;this.body.emitter.on("_forceDisableDynamicCurves",(function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];"dynamic"===t&&(t="continuous");var n=!1;for(var o in i.body.edges)if(Object.prototype.hasOwnProperty.call(i.body.edges,o)){var r=i.body.edges[o],s=i.body.data.edges.get(o);if(null!=s){var a=s.smooth;void 0!==a&&!0===a.enabled&&"dynamic"===a.type&&(void 0===t?r.setOptions({smooth:!1}):r.setOptions({smooth:{type:t}}),n=!0)}}!0===e&&!0===n&&i.body.emitter.emit("_dataChanged")})),this.body.emitter.on("_dataUpdated",(function(){i.reconnectEdges()})),this.body.emitter.on("refreshEdges",Hn(t=this.refresh).call(t,this)),this.body.emitter.on("refresh",Hn(e=this.refresh).call(e,this)),this.body.emitter.on("destroy",(function(){kb(i.edgesListeners,(function(t,e){i.body.data.edges&&i.body.data.edges.off(e,t)})),delete i.body.functions.createEdge,delete i.edgesListeners.add,delete i.edgesListeners.update,delete i.edgesListeners.remove,delete i.edgesListeners}))}},{key:"setOptions",value:function(t){if(void 0!==t){dI.parseOptions(this.options,t,!0,this.defaultOptions,!0);var e=!1;if(void 0!==t.smooth)for(var i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&(e=this.body.edges[i].updateEdgeType()||e);if(void 0!==t.font)for(var n in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,n)&&this.body.edges[n].updateLabelModule();void 0===t.hidden&&void 0===t.physics&&!0!==e||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.body.data.edges;if(ZM("id",t))this.body.data.edges=t;else if(Df(t))this.body.data.edges=new GM,this.body.data.edges.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.edges=new GM}if(n&&kb(this.edgesListeners,(function(t,e){n.off(e,t)})),this.body.edges={},this.body.data.edges){kb(this.edgesListeners,(function(t,i){e.body.data.edges.on(i,t)}));var o=this.body.data.edges.getIds();this.add(o,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===i&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.body.edges,n=this.body.data.edges,o=0;o1&&void 0!==arguments[1])||arguments[1];if(0!==t.length){var i=this.body.edges;kb(t,(function(t){var e=i[t];void 0!==e&&e.remove()})),e&&this.body.emitter.emit("_dataChanged")}}},{key:"refresh",value:function(){var t=this;kb(this.body.edges,(function(e,i){var n=t.body.data.edges.get(i);void 0!==n&&e.setOptions(n)}))}},{key:"create",value:function(t){return new dI(t,this.body,this.images,this.options,this.defaultOptions)}},{key:"reconnectEdges",value:function(){var t,e=this.body.nodes,i=this.body.edges;for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(e[t].edges=[]);for(t in i)if(Object.prototype.hasOwnProperty.call(i,t)){var n=i[t];n.from=null,n.to=null,n.connect()}}},{key:"getConnectedNodes",value:function(t){var e=[];if(void 0!==this.body.edges[t]){var i=this.body.edges[t];void 0!==i.fromId&&e.push(i.fromId),void 0!==i.toId&&e.push(i.toId)}return e}},{key:"_updateState",value:function(){this._addMissingEdges(),this._removeInvalidEdges()}},{key:"_removeInvalidEdges",value:function(){var t=this,e=[];kb(this.body.edges,(function(i,n){var o=t.body.nodes[i.toId],r=t.body.nodes[i.fromId];void 0!==o&&!0===o.isCluster||void 0!==r&&!0===r.isCluster||void 0!==o&&void 0!==r||e.push(n)})),this.remove(e,!1)}},{key:"_addMissingEdges",value:function(){var t=this.body.data.edges;if(null!=t){var e=this.body.edges,i=[];op(t).call(t,(function(t,n){void 0===e[n]&&i.push(n)})),this.add(i,!0)}}}]),t}(),uI=function(){function t(e,i,n){ph(this,t),this.body=e,this.physicsBody=i,this.barnesHutTree,this.setOptions(n),this._rng=Jm("BARNES HUT SOLVER")}return xu(t,[{key:"setOptions",value:function(t){this.options=t,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}},{key:"solve",value:function(){if(0!==this.options.gravitationalConstant&&this.physicsBody.physicsNodeIndices.length>0){var t,e=this.body.nodes,i=this.physicsBody.physicsNodeIndices,n=i.length,o=this._formBarnesHutTree(e,i);this.barnesHutTree=o;for(var r=0;r0&&this._getForceContributions(o.root,t)}}},{key:"_getForceContributions",value:function(t,e){this._getForceContribution(t.children.NW,e),this._getForceContribution(t.children.NE,e),this._getForceContribution(t.children.SW,e),this._getForceContribution(t.children.SE,e)}},{key:"_getForceContribution",value:function(t,e){if(t.childrenCount>0){var i=t.centerOfMass.x-e.x,n=t.centerOfMass.y-e.y,o=Math.sqrt(i*i+n*n);o*t.calcSize>this.thetaInversed?this._calculateForces(o,i,n,e,t):4===t.childrenCount?this._getForceContributions(t,e):t.children.data.id!=e.id&&this._calculateForces(o,i,n,e,t)}}},{key:"_calculateForces",value:function(t,e,i,n,o){0===t&&(e=t=.1),this.overlapAvoidanceFactor<1&&n.shape.radius&&(t=Math.max(.1+this.overlapAvoidanceFactor*n.shape.radius,t-n.shape.radius));var r=this.options.gravitationalConstant*o.mass*n.options.mass/Math.pow(t,3),s=e*r,a=i*r;this.physicsBody.forces[n.id].x+=s,this.physicsBody.forces[n.id].y+=a}},{key:"_formBarnesHutTree",value:function(t,e){for(var i,n=e.length,o=t[e[0]].x,r=t[e[0]].y,s=t[e[0]].x,a=t[e[0]].y,h=1;h0&&(ds&&(s=d),ca&&(a=c))}var u=Math.abs(s-o)-Math.abs(a-r);u>0?(r-=.5*u,a+=.5*u):(o+=.5*u,s-=.5*u);var f=Math.max(1e-5,Math.abs(s-o)),p=.5*f,v=.5*(o+s),g=.5*(r+a),y={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:v-p,maxX:v+p,minY:g-p,maxY:g+p},size:f,calcSize:1/f,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(y.root);for(var m=0;m0&&this._placeInTree(y.root,i);return y}},{key:"_updateBranchMass",value:function(t,e){var i=t.centerOfMass,n=t.mass+e.options.mass,o=1/n;i.x=i.x*t.mass+e.x*e.options.mass,i.x*=o,i.y=i.y*t.mass+e.y*e.options.mass,i.y*=o,t.mass=n;var r=Math.max(Math.max(e.height,e.radius),e.width);t.maxWidth=t.maxWidthe.x?o.maxY>e.y?"NW":"SW":o.maxY>e.y?"NE":"SE",this._placeInRegion(t,e,n)}},{key:"_placeInRegion",value:function(t,e,i){var n=t.children[i];switch(n.childrenCount){case 0:n.children.data=e,n.childrenCount=1,this._updateBranchMass(n,e);break;case 1:n.children.data.x===e.x&&n.children.data.y===e.y?(e.x+=this._rng(),e.y+=this._rng()):(this._splitBranch(n),this._placeInTree(n,e));break;case 4:this._placeInTree(n,e)}}},{key:"_splitBranch",value:function(t){var e=null;1===t.childrenCount&&(e=t.children.data,t.mass=0,t.centerOfMass.x=0,t.centerOfMass.y=0),t.childrenCount=4,t.children.data=null,this._insertRegion(t,"NW"),this._insertRegion(t,"NE"),this._insertRegion(t,"SW"),this._insertRegion(t,"SE"),null!=e&&this._placeInTree(t,e)}},{key:"_insertRegion",value:function(t,e){var i,n,o,r,s=.5*t.size;switch(e){case"NW":i=t.range.minX,n=t.range.minX+s,o=t.range.minY,r=t.range.minY+s;break;case"NE":i=t.range.minX+s,n=t.range.maxX,o=t.range.minY,r=t.range.minY+s;break;case"SW":i=t.range.minX,n=t.range.minX+s,o=t.range.minY+s,r=t.range.maxY;break;case"SE":i=t.range.minX+s,n=t.range.maxX,o=t.range.minY+s,r=t.range.maxY}t.children[e]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:n,minY:o,maxY:r},size:.5*t.size,calcSize:2*t.calcSize,children:{data:null},maxWidth:0,level:t.level+1,childrenCount:0}}},{key:"_debug",value:function(t,e){void 0!==this.barnesHutTree&&(t.lineWidth=1,this._drawBranch(this.barnesHutTree.root,t,e))}},{key:"_drawBranch",value:function(t,e,i){void 0===i&&(i="#FF0000"),4===t.childrenCount&&(this._drawBranch(t.children.NW,e),this._drawBranch(t.children.NE,e),this._drawBranch(t.children.SE,e),this._drawBranch(t.children.SW,e)),e.strokeStyle=i,e.beginPath(),e.moveTo(t.range.minX,t.range.minY),e.lineTo(t.range.maxX,t.range.minY),e.stroke(),e.beginPath(),e.moveTo(t.range.maxX,t.range.minY),e.lineTo(t.range.maxX,t.range.maxY),e.stroke(),e.beginPath(),e.moveTo(t.range.maxX,t.range.maxY),e.lineTo(t.range.minX,t.range.maxY),e.stroke(),e.beginPath(),e.moveTo(t.range.minX,t.range.maxY),e.lineTo(t.range.minX,t.range.minY),e.stroke()}}]),t}(),fI=function(){function t(e,i,n){ph(this,t),this._rng=Jm("REPULSION SOLVER"),this.body=e,this.physicsBody=i,this.setOptions(n)}return xu(t,[{key:"setOptions",value:function(t){this.options=t}},{key:"solve",value:function(){for(var t,e,i,n,o,r,s,a,h=this.body.nodes,l=this.physicsBody.physicsNodeIndices,d=this.physicsBody.forces,c=this.options.nodeDistance,u=-2/3/c,f=0;f0){var r=o.edges.length+1,s=this.options.centralGravity*r*o.options.mass;n[o.id].x=e*s,n[o.id].y=i*s}}}]),i}(yI),_I=function(){function t(e){ph(this,t),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}},bn(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return xu(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("initPhysics",(function(){t.initPhysics()})),this.body.emitter.on("_layoutFailed",(function(){t.layoutFailed=!0})),this.body.emitter.on("resetPhysics",(function(){t.stopSimulation(),t.ready=!1})),this.body.emitter.on("disablePhysics",(function(){t.physicsEnabled=!1,t.stopSimulation()})),this.body.emitter.on("restorePhysics",(function(){t.setOptions(t.options),!0===t.ready&&t.startSimulation()})),this.body.emitter.on("startSimulation",(function(){!0===t.ready&&t.startSimulation()})),this.body.emitter.on("stopSimulation",(function(){t.stopSimulation()})),this.body.emitter.on("destroy",(function(){t.stopSimulation(!1),t.body.emitter.off()})),this.body.emitter.on("_dataChanged",(function(){t.updatePhysicsData()}))}},{key:"setOptions",value:function(t){if(void 0!==t)if(!1===t)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(!0===t)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,vb(["stabilization"],this.options,t),Ab(this.options,t,"stabilization"),void 0===t.enabled&&(this.options.enabled=!0),!1===this.options.enabled&&(this.physicsEnabled=!1,this.stopSimulation());var e=this.options.wind;e&&(("number"!=typeof e.x||f_(e.x))&&(e.x=0),("number"!=typeof e.y||f_(e.y))&&(e.y=0)),this.timestep=this.options.timestep}this.init()}},{key:"init",value:function(){var t;"forceAtlas2Based"===this.options.solver?(t=this.options.forceAtlas2Based,this.nodesSolver=new bI(this.body,this.physicsBody,t),this.edgesSolver=new vI(this.body,this.physicsBody,t),this.gravitySolver=new kI(this.body,this.physicsBody,t)):"repulsion"===this.options.solver?(t=this.options.repulsion,this.nodesSolver=new fI(this.body,this.physicsBody,t),this.edgesSolver=new vI(this.body,this.physicsBody,t),this.gravitySolver=new yI(this.body,this.physicsBody,t)):"hierarchicalRepulsion"===this.options.solver?(t=this.options.hierarchicalRepulsion,this.nodesSolver=new pI(this.body,this.physicsBody,t),this.edgesSolver=new gI(this.body,this.physicsBody,t),this.gravitySolver=new yI(this.body,this.physicsBody,t)):(t=this.options.barnesHut,this.nodesSolver=new uI(this.body,this.physicsBody,t),this.edgesSolver=new vI(this.body,this.physicsBody,t),this.gravitySolver=new yI(this.body,this.physicsBody,t)),this.modelOptions=t}},{key:"initPhysics",value:function(){!0===this.physicsEnabled&&!0===this.options.enabled?!0===this.options.stabilization.enabled?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}},{key:"startSimulation",value:function(){var t;!0===this.physicsEnabled&&!0===this.options.enabled?(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),void 0===this.viewFunction&&(this.viewFunction=Hn(t=this.simulationStep).call(t,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.stabilized=!0,!0===t&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,!0===t&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var t=Uf();this.physicsTick(),(Uf()-t<.4*this.simulationInterval||!0===this.runDoubleSpeed)&&!1===this.stabilized&&(this.physicsTick(),this.runDoubleSpeed=!0),!0===this.stabilized&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||!0===this.startedStabilization)&&jg((function(){t.body.emitter.emit("stabilized",{iterations:e}),t.startedStabilization=!1,t.stabilizationIterations=0}),0)}},{key:"physicsStep",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}},{key:"adjustTimeStep",value:function(){!0===this._evaluateStepQuality()?this.timestep=1.2*this.timestep:this.timestep/1.2.3))return!1;return!0}},{key:"moveNodes",value:function(){for(var t=this.physicsBody.physicsNodeIndices,e=0,i=0,n=0;nn&&(t=t>0?n:-n),t}},{key:"_performStep",value:function(t){var e=this.body.nodes[t],i=this.physicsBody.forces[t];this.options.wind&&(i.x+=this.options.wind.x,i.y+=this.options.wind.y);var n=this.physicsBody.velocities[t];return this.previousStates[t]={x:e.x,y:e.y,vx:n.x,vy:n.y},!1===e.options.fixed.x?(n.x=this.calculateComponentVelocity(n.x,i.x,e.options.mass),e.x+=n.x*this.timestep):(i.x=0,n.x=0),!1===e.options.fixed.y?(n.y=this.calculateComponentVelocity(n.y,i.y,e.options.mass),e.y+=n.y*this.timestep):(i.y=0,n.y=0),Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2))}},{key:"_freezeNodes",value:function(){var t=this.body.nodes;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&t[e].x&&t[e].y){var i=t[e].options.fixed;this.freezeCache[e]={x:i.x,y:i.y},i.x=!0,i.y=!0}}},{key:"_restoreFrozenNodes",value:function(){var t=this.body.nodes;for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&void 0!==this.freezeCache[e]&&(t[e].options.fixed.x=this.freezeCache[e].x,t[e].options.fixed.y=this.freezeCache[e].y);this.freezeCache={}}},{key:"stabilize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.stabilization.iterations;"number"!=typeof e&&(e=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",e)),0!==this.physicsBody.physicsNodeIndices.length?(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,!0===this.options.stabilization.onlyDynamicEdges&&this._freezeNodes(),this.stabilizationIterations=0,jg((function(){return t._stabilizationBatch()}),0)):this.ready=!0}},{key:"_startStabilizing",value:function(){return!0!==this.startedStabilization&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}},{key:"_stabilizationBatch",value:function(){var t=this,e=function(){return!1===t.stabilized&&t.stabilizationIterations1&&void 0!==arguments[1]?arguments[1]:[],n=1e9,o=-1e9,r=1e9,s=-1e9;if(i.length>0)for(var a=0;a(e=t[i[a]]).shape.boundingBox.left&&(r=e.shape.boundingBox.left),se.shape.boundingBox.top&&(n=e.shape.boundingBox.top),o1&&void 0!==arguments[1]?arguments[1]:[],n=1e9,o=-1e9,r=1e9,s=-1e9;if(i.length>0)for(var a=0;a(e=t[i[a]]).x&&(r=e.x),se.y&&(n=e.y),o=t&&i.push(o.id)}for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{},i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===e.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);var n={},o={};kb(this.body.nodes,(function(i,r){i.options&&!0===e.joinCondition(i.options)&&(n[r]=i,kb(i.edges,(function(e){void 0===t.clusteredEdges[e.id]&&(o[e.id]=e)})))})),this._cluster(n,o,e,i)}},{key:"clusterByEdgeCount",value:function(t,e){var i=this,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e=this._checkOptions(e);for(var o,r,s,a=[],h={},l=function(){var n={},l={},c=i.body.nodeIndices[d],u=i.body.nodes[c];if(void 0===h[c]){s=0,r=[];for(var f=0;f0&&Hf(l).length>0&&!0===v){var m=function(){for(var t=0;t1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(1,t,e)}},{key:"clusterBridges",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(2,t,e)}},{key:"clusterByConnection",value:function(t,e){var i,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===t)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[t])throw new Error("The nodeId given to clusterByConnection does not exist!");var o=this.body.nodes[t];void 0===(e=this._checkOptions(e,o)).clusterNodeProperties.x&&(e.clusterNodeProperties.x=o.x),void 0===e.clusterNodeProperties.y&&(e.clusterNodeProperties.y=o.y),void 0===e.clusterNodeProperties.fixed&&(e.clusterNodeProperties.fixed={},e.clusterNodeProperties.fixed.x=o.options.fixed.x,e.clusterNodeProperties.fixed.y=o.options.fixed.y);var r={},s={},a=o.id,h=xI.cloneOptions(o);r[a]=o;for(var l=0;l-1&&(s[y.id]=y)}this._cluster(r,s,e,n)}},{key:"_createClusterEdges",value:function(t,e,i,n){for(var o,r,s,a,h,l,d=Hf(t),c=[],u=0;u0&&void 0!==arguments[0]?arguments[0]:{};return void 0===t.clusterEdgeProperties&&(t.clusterEdgeProperties={}),void 0===t.clusterNodeProperties&&(t.clusterNodeProperties={}),t}},{key:"_cluster",value:function(t,e,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&void 0!==this.clusteredNodes[r]&&o.push(r);for(var s=0;so?e.x:o,r=e.ys?e.y:s;return{x:.5*(n+o),y:.5*(r+s)}}},{key:"openCluster",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===t)throw new Error("No clusterNodeId supplied to openCluster.");var n=this.body.nodes[t];if(void 0===n)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(!0!==n.isCluster||void 0===n.containedNodes||void 0===n.containedEdges)throw new Error("The node:"+t+" is not a valid cluster.");var o=this.findNode(t),r=lg(o).call(o,t)-1;if(r>=0){var s=o[r];return this.body.nodes[s]._openChildCluster(t),delete this.body.nodes[t],void(!0===i&&this.body.emitter.emit("_dataChanged"))}var a=n.containedNodes,h=n.containedEdges;if(void 0!==e&&void 0!==e.releaseFunction&&"function"==typeof e.releaseFunction){var l={},d={x:n.x,y:n.y};for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c)){var u=this.body.nodes[c];l[c]={x:u.x,y:u.y}}var f=e.releaseFunction(d,l);for(var p in a)if(Object.prototype.hasOwnProperty.call(a,p)){var v=this.body.nodes[p];void 0!==f[p]&&(v.x=void 0===f[p].x?n.x:f[p].x,v.y=void 0===f[p].y?n.y:f[p].y)}}else kb(a,(function(t){!1===t.options.fixed.x&&(t.x=n.x),!1===t.options.fixed.y&&(t.y=n.y)}));for(var g in a)if(Object.prototype.hasOwnProperty.call(a,g)){var y=this.body.nodes[g];y.vx=n.vx,y.vy=n.vy,y.setOptions({physics:!0}),delete this.clusteredNodes[g]}for(var m=[],b=0;b0&&o<100;){var r=e.pop();if(void 0!==r){var s=this.body.edges[r];if(void 0!==s){o++;var a=s.clusteringEdgeReplacingIds;if(void 0===a)n.push(r);else for(var h=0;hn&&(n=r.edges.length),t+=r.edges.length,e+=Math.pow(r.edges.length,2),i+=1}t/=i;var s=(e/=i)-Math.pow(t,2),a=Math.sqrt(s),h=Math.floor(t+2*a);return h>n&&(h=n),h}},{key:"_createClusteredEdge",value:function(t,e,i,n,o){var r=xI.cloneOptions(i,"edge");gb(r,n),r.from=t,r.to=e,r.id="clusterEdge:"+zM(),void 0!==o&&gb(r,o);var s=this.body.functions.createEdge(r);return s.clusteringEdgeReplacingIds=[i.id],s.connect(),this.body.edges[s.id]=s,s}},{key:"_clusterEdges",value:function(t,e,i,n){if(e instanceof dI){var o=e,r={};r[o.id]=o,e=r}if(t instanceof fD){var s=t,a={};a[s.id]=s,t=a}if(null==i)throw new Error("_clusterEdges: parameter clusterNode required");for(var h in void 0===n&&(n=i.clusterEdgeProperties),this._createClusterEdges(t,e,i,n),e)if(Object.prototype.hasOwnProperty.call(e,h)&&void 0!==this.body.edges[h]){var l=this.body.edges[h];this._backupEdgeOptions(l),l.setOptions({physics:!1})}for(var d in t)Object.prototype.hasOwnProperty.call(t,d)&&(this.clusteredNodes[d]={clusterId:i.id,node:this.body.nodes[d]},this.body.nodes[d].setOptions({physics:!1}))}},{key:"_getClusterNodeForNode",value:function(t){if(void 0!==t){var e=this.clusteredNodes[t];if(void 0!==e){var i=e.clusterId;if(void 0!==i)return this.body.nodes[i]}}}},{key:"_filter",value:function(t,e){var i=[];return kb(t,(function(t){e(t)&&i.push(t)})),i}},{key:"_updateState",value:function(){var t,e=this,i=[],n={},o=function(t){kb(e.body.nodes,(function(e){!0===e.isCluster&&t(e)}))};for(t in this.clusteredNodes){if(Object.prototype.hasOwnProperty.call(this.clusteredNodes,t))void 0===this.body.nodes[t]&&i.push(t)}o((function(t){for(var e=0;e0}t.endPointsValid()&&o||(n[i]=i)})),o((function(t){kb(n,(function(i){delete t.containedEdges[i],kb(t.edges,(function(o,r){o.id!==i?o.clusteringEdgeReplacingIds=e._filter(o.clusteringEdgeReplacingIds,(function(t){return!n[t]})):t.edges[r]=null})),t.edges=e._filter(t.edges,(function(t){return null!==t}))}))})),kb(n,(function(t){delete e.clusteredEdges[t]})),kb(n,(function(t){delete e.body.edges[t]})),kb(Hf(this.body.edges),(function(t){var i=e.body.edges[t],n=e._isClusteredNode(i.fromId)||e._isClusteredNode(i.toId);if(n!==e._isClusteredEdge(i.id))if(n){var o=e._getClusterNodeForNode(i.fromId);void 0!==o&&e._clusterEdges(e.body.nodes[i.fromId],i,o);var r=e._getClusterNodeForNode(i.toId);void 0!==r&&e._clusterEdges(e.body.nodes[i.toId],i,r)}else delete e._clusterEdges[t],e._restoreEdge(i)}));for(var s=!1,a=!0,h=function(){var t=[];o((function(e){var i=Hf(e.containedNodes).length,n=!0===e.options.allowSingleNodeCluster;(n&&i<1||!n&&i<2)&&t.push(e.id)}));for(var i=0;i0,s=s||a};a;)h();s&&this._updateState()}},{key:"_isClusteredNode",value:function(t){return void 0!==this.clusteredNodes[t]}},{key:"_isClusteredEdge",value:function(t){return void 0!==this.clusteredEdges[t]}}]),t}();var SI=function(){function t(e,i){var n;ph(this,t),void 0!==window&&(n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),window.requestAnimationFrame=void 0===n?function(t){t()}:n,this.body=e,this.canvas=i,this.redrawRequested=!1,this.renderTimer=void 0,this.requiresTimeout=!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},bn(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return xu(t,[{key:"bindEventListeners",value:function(){var t,e=this;this.body.emitter.on("dragStart",(function(){e.dragging=!0})),this.body.emitter.on("dragEnd",(function(){e.dragging=!1})),this.body.emitter.on("zoom",(function(){e.zooming=!0,window.clearTimeout(e.zoomTimeoutId),e.zoomTimeoutId=jg((function(){var t;e.zooming=!1,Hn(t=e._requestRedraw).call(t,e)()}),250)})),this.body.emitter.on("_resizeNodes",(function(){e._resizeNodes()})),this.body.emitter.on("_redraw",(function(){!1===e.renderingActive&&e._redraw()})),this.body.emitter.on("_blockRedraw",(function(){e.allowRedraw=!1})),this.body.emitter.on("_allowRedraw",(function(){e.allowRedraw=!0,e.redrawRequested=!1})),this.body.emitter.on("_requestRedraw",Hn(t=this._requestRedraw).call(t,this)),this.body.emitter.on("_startRendering",(function(){e.renderRequests+=1,e.renderingActive=!0,e._startRendering()})),this.body.emitter.on("_stopRendering",(function(){e.renderRequests-=1,e.renderingActive=e.renderRequests>0,e.renderTimer=void 0})),this.body.emitter.on("destroy",(function(){e.renderRequests=0,e.allowRedraw=!1,e.renderingActive=!1,!0===e.requiresTimeout?clearTimeout(e.renderTimer):window.cancelAnimationFrame(e.renderTimer),e.body.emitter.off()}))}},{key:"setOptions",value:function(t){if(void 0!==t){pb(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,t)}}},{key:"_requestNextFrame",value:function(t,e){if("undefined"!=typeof window){var i,n=window;return!0===this.requiresTimeout?i=jg(t,e):n.requestAnimationFrame&&(i=n.requestAnimationFrame(t)),i}}},{key:"_startRendering",value:function(){var t;!0===this.renderingActive&&(void 0===this.renderTimer&&(this.renderTimer=this._requestNextFrame(Hn(t=this._renderStep).call(t,this),this.simulationInterval)))}},{key:"_renderStep",value:function(){!0===this.renderingActive&&(this.renderTimer=void 0,!0===this.requiresTimeout&&this._startRendering(),this._redraw(),!1===this.requiresTimeout&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var t=this;!0!==this.redrawRequested&&!1===this.renderingActive&&!0===this.allowRedraw&&(this.redrawRequested=!0,this._requestNextFrame((function(){t._redraw(!1)}),0))}},{key:"_redraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!0===this.allowRedraw){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var e={drawExternalLabels:null};0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),this.canvas.setTransform();var i=this.canvas.getContext(),n=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(i.clearRect(0,0,n,o),0===this.canvas.frame.clientWidth)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(),!1===t&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawEdges(i),!1===this.dragging||!0===this.dragging&&!1===this.options.hideNodesOnDrag){var r=this._drawNodes(i,t).drawExternalLabels;e.drawExternalLabels=r}!1===t&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawArrows(i),null!=e.drawExternalLabels&&e.drawExternalLabels(),!1===t&&this._drawSelectionBox(i),i.beginPath(),this.body.emitter.emit("afterDrawing",i),i.closePath(),i.restore(),!0===t&&i.clearRect(0,0,n,o)}}},{key:"_resizeNodes",value:function(){this.canvas.setTransform();var t=this.canvas.getContext();t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale);var e,i=this.body.nodes;for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&((e=i[n]).resize(t),e.updateBoundingBox(t,e.selected));t.restore()}},{key:"_drawNodes",value:function(t){for(var e,i,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=this.body.nodes,r=this.body.nodeIndices,s=[],a=[],h=this.canvas.DOMtoCanvas({x:-20,y:-20}),l=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+20,y:this.canvas.frame.canvas.clientHeight+20}),d={top:h.y,left:h.x,bottom:l.y,right:l.x},c=[],u=0;u0&&void 0!==arguments[0]?arguments[0]:this.pixelRatio;!0===this.initialized&&(this.cameraState.previousWidth=this.frame.canvas.width/t,this.cameraState.previousHeight=this.frame.canvas.height/t,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/t,y:.5*this.frame.canvas.height/t}))}},{key:"_setCameraState",value:function(){if(void 0!==this.cameraState.scale&&0!==this.frame.canvas.clientWidth&&0!==this.frame.canvas.clientHeight&&0!==this.pixelRatio&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){var t=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,e=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,i=this.cameraState.scale;1!=t&&1!=e?i=.5*this.cameraState.scale*(t+e):1!=t?i=this.cameraState.scale*t:1!=e&&(i=this.cameraState.scale*e),this.body.view.scale=i;var n=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),o={x:n.x-this.cameraState.position.x,y:n.y-this.cameraState.position.y};this.body.view.translation.x+=o.x*this.body.view.scale,this.body.view.translation.y+=o.y*this.body.view.scale}}},{key:"_prepareValue",value:function(t){if("number"==typeof t)return t+"px";if("string"==typeof t){if(-1!==lg(t).call(t,"%")||-1!==lg(t).call(t,"px"))return t;if(-1===lg(t).call(t,"%"))return t+"px"}throw new Error("Could not use the value supplied for width or height:"+t)}},{key:"_create",value:function(){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{var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(t)}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()}},{key:"_bindHammer",value:function(){var t=this;void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new Qb(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:Qb.DIRECTION_ALL}),MI(this.hammer,(function(e){t.body.eventListeners.onTouch(e)})),this.hammer.on("tap",(function(e){t.body.eventListeners.onTap(e)})),this.hammer.on("doubletap",(function(e){t.body.eventListeners.onDoubleTap(e)})),this.hammer.on("press",(function(e){t.body.eventListeners.onHold(e)})),this.hammer.on("panstart",(function(e){t.body.eventListeners.onDragStart(e)})),this.hammer.on("panmove",(function(e){t.body.eventListeners.onDrag(e)})),this.hammer.on("panend",(function(e){t.body.eventListeners.onDragEnd(e)})),this.hammer.on("pinch",(function(e){t.body.eventListeners.onPinch(e)})),this.frame.canvas.addEventListener("wheel",(function(e){t.body.eventListeners.onMouseWheel(e)})),this.frame.canvas.addEventListener("mousemove",(function(e){t.body.eventListeners.onMouseMove(e)})),this.frame.canvas.addEventListener("contextmenu",(function(e){t.body.eventListeners.onContext(e)})),this.hammerFrame=new Qb(this.frame),PI(this.hammerFrame,(function(e){t.body.eventListeners.onRelease(e)}))}},{key:"setSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.width,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.height;t=this._prepareValue(t),e=this._prepareValue(e);var i=!1,n=this.frame.canvas.width,o=this.frame.canvas.height,r=this.pixelRatio;if(this._setPixelRatio(),t!=this.options.width||e!=this.options.height||this.frame.style.width!=t||this.frame.style.height!=e)this._getCameraState(r),this.frame.style.width=t,this.frame.style.height=e,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=t,this.options.height=e,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},i=!0;else{var s=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),a=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);this.frame.canvas.width===s&&this.frame.canvas.height===a||this._getCameraState(r),this.frame.canvas.width!==s&&(this.frame.canvas.width=s,i=!0),this.frame.canvas.height!==a&&(this.frame.canvas.height=a,i=!0)}return!0===i&&(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(n/this.pixelRatio),oldHeight:Math.round(o/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}},{key:"getContext",value:function(){return this.frame.canvas.getContext("2d")}},{key:"_determinePixelRatio",value:function(){var t=this.getContext();if(void 0===t)throw new Error("Could not get canvax context");var e=1;return"undefined"!=typeof window&&(e=window.devicePixelRatio||1),e/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}},{key:"_setPixelRatio",value:function(){this.pixelRatio=this._determinePixelRatio()}},{key:"setTransform",value:function(){var t=this.getContext();if(void 0===t)throw new Error("Could not get canvax context");t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}},{key:"_XconvertDOMtoCanvas",value:function(t){return(t-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(t){return t*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(t){return(t-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(t){return t*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(t){return{x:this._XconvertCanvasToDOM(t.x),y:this._YconvertCanvasToDOM(t.y)}}},{key:"DOMtoCanvas",value:function(t){return{x:this._XconvertDOMtoCanvas(t.x),y:this._YconvertDOMtoCanvas(t.y)}}}]),t}();var II=function(){function t(e,i){var n,o,r=this;ph(this,t),this.body=e,this.canvas=i,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",Hn(n=this.fit).call(n,this)),this.body.emitter.on("animationFinished",(function(){r.body.emitter.emit("_stopRendering")})),this.body.emitter.on("unlockNode",Hn(o=this.releaseNode).call(o,this))}return xu(t,[{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t}},{key:"fit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t=function(t,e){var i=bn({nodes:e,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},null!=t?t:{});if(!Df(i.nodes))throw new TypeError("Nodes has to be an array of ids.");if(0===i.nodes.length&&(i.nodes=e),!("number"==typeof i.minZoomLevel&&i.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!("number"==typeof i.maxZoomLevel&&i.minZoomLevel<=i.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return i}(t,this.body.nodeIndices);var i,n,o=this.canvas.frame.canvas.clientWidth,r=this.canvas.frame.canvas.clientHeight;if(0===o||0===r)n=1,i=xI.getRange(this.body.nodes,t.nodes);else if(!0===e){var s=0;for(var a in this.body.nodes){if(Object.prototype.hasOwnProperty.call(this.body.nodes,a))!0===this.body.nodes[a].predefinedPosition&&(s+=1)}if(s>.5*this.body.nodeIndices.length)return void this.fit(t,!1);i=xI.getRange(this.body.nodes,t.nodes),n=12.662/(this.body.nodeIndices.length+7.4147)+.0964822,n*=Math.min(o/600,r/600)}else{this.body.emitter.emit("_resizeNodes"),i=xI.getRange(this.body.nodes,t.nodes);var h=o/(1.1*Math.abs(i.maxX-i.minX)),l=r/(1.1*Math.abs(i.maxY-i.minY));n=h<=l?h:l}n>t.maxZoomLevel?n=t.maxZoomLevel:n1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==this.body.nodes[t]){var i={x:this.body.nodes[t].x,y:this.body.nodes[t].y};e.position=i,e.lockedOnNode=t,this.moveTo(e)}else console.error("Node: "+t+" cannot be found.")}},{key:"moveTo",value:function(t){if(void 0!==t){if(null!=t.offset){if(null!=t.offset.x){if(t.offset.x=+t.offset.x,!g_(t.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else t.offset.x=0;if(null!=t.offset.y){if(t.offset.y=+t.offset.y,!g_(t.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else t.offset.x=0}else t.offset={x:0,y:0};if(null!=t.position){if(null!=t.position.x){if(t.position.x=+t.position.x,!g_(t.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else t.position.x=0;if(null!=t.position.y){if(t.position.y=+t.position.y,!g_(t.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else t.position.x=0}else t.position=this.getViewPosition();if(null!=t.scale){if(t.scale=+t.scale,!(t.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else t.scale=this.body.view.scale;void 0===t.animation&&(t.animation={duration:0}),!1===t.animation&&(t.animation={duration:0}),!0===t.animation&&(t.animation={}),void 0===t.animation.duration&&(t.animation.duration=1e3),void 0===t.animation.easingFunction&&(t.animation.easingFunction="easeInOutQuad"),this.animateView(t)}else t={}}},{key:"animateView",value:function(t){if(void 0!==t){this.animationEasingFunction=t.animation.easingFunction,this.releaseNode(),!0===t.locked&&(this.lockedOnNodeId=t.lockedOnNode,this.lockedOnNodeOffset=t.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=t.scale,this.body.view.scale=this.targetScale;var e,i,n=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),o=n.x-t.position.x,r=n.y-t.position.y;if(this.targetTranslation={x:this.sourceTranslation.x+o*this.targetScale+t.offset.x,y:this.sourceTranslation.y+r*this.targetScale+t.offset.y},0===t.animation.duration)if(null!=this.lockedOnNodeId)this.viewFunction=Hn(e=this._lockedRedraw).call(e,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 this.animationSpeed=1/(60*t.animation.duration*.001)||1/60,this.animationEasingFunction=t.animation.easingFunction,this.viewFunction=Hn(i=this._transitionRedraw).call(i,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}},{key:"_lockedRedraw",value:function(){var t=this.body.nodes[this.lockedOnNodeId].x,e=this.body.nodes[this.lockedOnNodeId].y,i=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),n=i.x-t,o=i.y-e,r=this.body.view.translation,s={x:r.x+n*this.body.view.scale+this.lockedOnNodeOffset.x,y:r.y+o*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=s}},{key:"releaseNode",value:function(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=!0===t?1:this.easingTime;var e=jb[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*e,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*e,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*e},this.easingTime>=1){var i;if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,null!=this.lockedOnNodeId)this.viewFunction=Hn(i=this._lockedRedraw).call(i,this),this.body.emitter.on("initRedraw",this.viewFunction);this.body.emitter.emit("animationFinished")}}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),t}();function BI(t){var e,i=t&&t.preventDefault||!1,n=t&&t.container||window,o={},r={keydown:{},keyup:{}},s={};for(e=97;e<=122;e++)s[String.fromCharCode(e)]={code:e-97+65,shift:!1};for(e=65;e<=90;e++)s[String.fromCharCode(e)]={code:e,shift:!0};for(e=0;e<=9;e++)s[""+e]={code:48+e,shift:!1};for(e=1;e<=12;e++)s["F"+e]={code:111+e,shift:!1};for(e=0;e<=9;e++)s["num"+e]={code:96+e,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(t){l(t,"keydown")},h=function(t){l(t,"keyup")},l=function(t,e){if(void 0!==r[e][t.keyCode]){for(var n=r[e][t.keyCode],o=0;o700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=(new Date).valueOf())}},{key:"_stopMovement",value:function(){for(var t in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,t)&&(this.body.emitter.off("initRedraw",this.boundFunctions[t]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}},{key:"_moveUp",value:function(){this.body.view.translation.y+=this.options.keyboard.speed.y}},{key:"_moveDown",value:function(){this.body.view.translation.y-=this.options.keyboard.speed.y}},{key:"_moveLeft",value:function(){this.body.view.translation.x+=this.options.keyboard.speed.x}},{key:"_moveRight",value:function(){this.body.view.translation.x-=this.options.keyboard.speed.x}},{key:"_zoomIn",value:function(){var t=this.body.view.scale,e=this.body.view.scale*(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,n=e/t,o=(1-n)*this.canvas.canvasViewCenter.x+i.x*n,r=(1-n)*this.canvas.canvasViewCenter.y+i.y*n;this.body.view.scale=e,this.body.view.translation={x:o,y:r},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}},{key:"_zoomOut",value:function(){var t=this.body.view.scale,e=this.body.view.scale/(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,n=e/t,o=(1-n)*this.canvas.canvasViewCenter.x+i.x*n,r=(1-n)*this.canvas.canvasViewCenter.y+i.y*n;this.body.view.scale=e,this.body.view.translation={x:o,y:r},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}},{key:"configureKeyboardBindings",value:function(){var t,e,i,n,o,r,s,a,h,l,d,c,u,f,p,v,g,y,m,b,w,k,_,x,E=this;(void 0!==this.keycharm&&this.keycharm.destroy(),!0===this.options.keyboard.enabled)&&(!0===this.options.keyboard.bindToWindow?this.keycharm=BI({container:window,preventDefault:!0}):this.keycharm=BI({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),!0===this.activated&&(Hn(t=this.keycharm).call(t,"up",(function(){E.bindToRedraw("_moveUp")}),"keydown"),Hn(e=this.keycharm).call(e,"down",(function(){E.bindToRedraw("_moveDown")}),"keydown"),Hn(i=this.keycharm).call(i,"left",(function(){E.bindToRedraw("_moveLeft")}),"keydown"),Hn(n=this.keycharm).call(n,"right",(function(){E.bindToRedraw("_moveRight")}),"keydown"),Hn(o=this.keycharm).call(o,"=",(function(){E.bindToRedraw("_zoomIn")}),"keydown"),Hn(r=this.keycharm).call(r,"num+",(function(){E.bindToRedraw("_zoomIn")}),"keydown"),Hn(s=this.keycharm).call(s,"num-",(function(){E.bindToRedraw("_zoomOut")}),"keydown"),Hn(a=this.keycharm).call(a,"-",(function(){E.bindToRedraw("_zoomOut")}),"keydown"),Hn(h=this.keycharm).call(h,"[",(function(){E.bindToRedraw("_zoomOut")}),"keydown"),Hn(l=this.keycharm).call(l,"]",(function(){E.bindToRedraw("_zoomIn")}),"keydown"),Hn(d=this.keycharm).call(d,"pageup",(function(){E.bindToRedraw("_zoomIn")}),"keydown"),Hn(c=this.keycharm).call(c,"pagedown",(function(){E.bindToRedraw("_zoomOut")}),"keydown"),Hn(u=this.keycharm).call(u,"up",(function(){E.unbindFromRedraw("_moveUp")}),"keyup"),Hn(f=this.keycharm).call(f,"down",(function(){E.unbindFromRedraw("_moveDown")}),"keyup"),Hn(p=this.keycharm).call(p,"left",(function(){E.unbindFromRedraw("_moveLeft")}),"keyup"),Hn(v=this.keycharm).call(v,"right",(function(){E.unbindFromRedraw("_moveRight")}),"keyup"),Hn(g=this.keycharm).call(g,"=",(function(){E.unbindFromRedraw("_zoomIn")}),"keyup"),Hn(y=this.keycharm).call(y,"num+",(function(){E.unbindFromRedraw("_zoomIn")}),"keyup"),Hn(m=this.keycharm).call(m,"num-",(function(){E.unbindFromRedraw("_zoomOut")}),"keyup"),Hn(b=this.keycharm).call(b,"-",(function(){E.unbindFromRedraw("_zoomOut")}),"keyup"),Hn(w=this.keycharm).call(w,"[",(function(){E.unbindFromRedraw("_zoomOut")}),"keyup"),Hn(k=this.keycharm).call(k,"]",(function(){E.unbindFromRedraw("_zoomIn")}),"keyup"),Hn(_=this.keycharm).call(_,"pageup",(function(){E.unbindFromRedraw("_zoomIn")}),"keyup"),Hn(x=this.keycharm).call(x,"pagedown",(function(){E.unbindFromRedraw("_zoomOut")}),"keyup")))}}]),t}();function zI(t,e){var i=void 0!==gf&&fh(t)||t["@@iterator"];if(!i){if(Df(t)||(i=function(t,e){var i;if(!t)return;if("string"==typeof t)return AI(t,e);var n=xf(i=Object.prototype.toString.call(t)).call(i,8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Ya(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return AI(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,r=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw r}}}}function AI(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i50&&(this.drag.pointer=this.getPointer(t.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}},{key:"onTap",value:function(t){var e=this.getPointer(t.center),i=this.selectionHandler.options.multiselect&&(t.changedPointers[0].ctrlKey||t.changedPointers[0].metaKey);this.checkSelectionChanges(e,i),this.selectionHandler.commitAndEmit(e,t),this.selectionHandler.generateClickEvent("click",t,e)}},{key:"onDoubleTap",value:function(t){var e=this.getPointer(t.center);this.selectionHandler.generateClickEvent("doubleClick",t,e)}},{key:"onHold",value:function(t){var e=this.getPointer(t.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(e,i),this.selectionHandler.commitAndEmit(e,t),this.selectionHandler.generateClickEvent("click",t,e),this.selectionHandler.generateClickEvent("hold",t,e)}},{key:"onRelease",value:function(t){if((new Date).valueOf()-this.touchTime>10){var e=this.getPointer(t.center);this.selectionHandler.generateClickEvent("release",t,e),this.touchTime=(new Date).valueOf()}}},{key:"onContext",value:function(t){var e=this.getPointer({x:t.clientX,y:t.clientY});this.selectionHandler.generateClickEvent("oncontext",t,e)}},{key:"checkSelectionChanges",value:function(t){!0===(arguments.length>1&&void 0!==arguments[1]&&arguments[1])?this.selectionHandler.selectAdditionalOnPoint(t):this.selectionHandler.selectOnPoint(t)}},{key:"_determineDifference",value:function(t,e){var i=function(t,e){for(var i=[],n=0;n=o.minX&&i.x<=o.maxX&&i.y>=o.minY&&i.y<=o.maxY}));op(r).call(r,(function(t){return e.selectionHandler.selectObject(e.body.nodes[t])}));var s=this.getPointer(t.center);this.selectionHandler.commitAndEmit(s,t),this.selectionHandler.generateClickEvent("dragEnd",t,this.getPointer(t.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{var a=this.drag.selection;a&&a.length?(op(a).call(a,(function(t){t.node.options.fixed.x=t.xFixed,t.node.options.fixed.y=t.yFixed})),this.selectionHandler.generateClickEvent("dragEnd",t,this.getPointer(t.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",t,this.getPointer(t.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}},{key:"onPinch",value:function(t){var e=this.getPointer(t.center);this.drag.pinched=!0,void 0===this.pinch.scale&&(this.pinch.scale=1);var i=this.pinch.scale*t.scale;this.zoom(i,e)}},{key:"zoom",value:function(t,e){if(!0===this.options.zoomView){var i=this.body.view.scale;t<1e-5&&(t=1e-5),t>10&&(t=10);var n=void 0;void 0!==this.drag&&!0===this.drag.dragging&&(n=this.canvas.DOMtoCanvas(this.drag.pointer));var o=this.body.view.translation,r=t/i,s=(1-r)*e.x+o.x*r,a=(1-r)*e.y+o.y*r;if(this.body.view.scale=t,this.body.view.translation={x:s,y:a},null!=n){var h=this.canvas.canvasToDOM(n);this.drag.pointer.x=h.x,this.drag.pointer.y=h.y}this.body.emitter.emit("_requestRedraw"),i0&&(this.popupObj=l[d[d.length-1]],r=!0)}if(void 0===this.popupObj&&!1===r){for(var u,f=this.body.edgeIndices,p=this.body.edges,v=[],g=0;g0&&(this.popupObj=p[v[v.length-1]],s="edge")}void 0!==this.popupObj?this.popupObj.id!==o&&(void 0===this.popup&&(this.popup=new Jb(this.canvas.frame)),this.popup.popupTargetType=s,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(t.x+3,t.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):void 0!==this.popup&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}},{key:"_checkHidePopup",value:function(t){var e=this.selectionHandler._pointerToPositionObject(t),i=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&!0===(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(e))){var n=this.selectionHandler.getNodeAt(t);i=void 0!==n&&n.id===this.popup.popupTargetId}}else void 0===this.selectionHandler.getNodeAt(t)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(e));!1===i&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),t}(),RI=g,LI=Vk,HI=hk.getWeakData,WI=Ok,qI=ii,VI=U,UI=tt,YI=_k,XI=Qt,GI=Lo.set,KI=Lo.getterFor,$I=Fl.find,ZI=Fl.findIndex,QI=RI([].splice),JI=0,tB=function(t){return t.frozen||(t.frozen=new eB)},eB=function(){this.entries=[]},iB=function(t,e){return $I(t.entries,(function(t){return t[0]===e}))};eB.prototype={get:function(t){var e=iB(this,t);if(e)return e[1]},has:function(t){return!!iB(this,t)},set:function(t,e){var i=iB(this,t);i?i[1]=e:this.entries.push([t,e])},delete:function(t){var e=ZI(this.entries,(function(e){return e[0]===t}));return~e&&QI(this.entries,e,1),!!~e}};var nB,oB={getConstructor:function(t,e,i,n){var o=t((function(t,o){WI(t,r),GI(t,{type:e,id:JI++,frozen:void 0}),VI(o)||YI(o,t[n],{that:t,AS_ENTRIES:i})})),r=o.prototype,s=KI(e),a=function(t,e,i){var n=s(t),o=HI(qI(e),!0);return!0===o?tB(n).set(e,i):o[n.id]=i,t};return LI(r,{delete:function(t){var e=s(this);if(!UI(t))return!1;var i=HI(t);return!0===i?tB(e).delete(t):i&&XI(i,e.id)&&delete i[e.id]},has:function(t){var e=s(this);if(!UI(t))return!1;var i=HI(t);return!0===i?tB(e).has(t):i&&XI(i,e.id)}}),LI(r,i?{get:function(t){var e=s(this);if(UI(t)){var i=HI(t);return!0===i?tB(e).get(t):i?i[e.id]:void 0}},set:function(t,e){return a(this,t,e)}}:{add:function(t){return a(this,t,!0)}}),o}},rB=Yw,sB=o,aB=g,hB=Vk,lB=hk,dB=Wk,cB=oB,uB=tt,fB=Lo.enforce,pB=r,vB=xo,gB=Object,yB=Array.isArray,mB=gB.isExtensible,bB=gB.isFrozen,wB=gB.isSealed,kB=gB.freeze,_B=gB.seal,xB={},EB={},OB=!sB.ActiveXObject&&"ActiveXObject"in sB,CB=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},SB=dB("WeakMap",CB,cB),TB=SB.prototype,MB=aB(TB.set);if(vB)if(OB){nB=cB.getConstructor(CB,"WeakMap",!0),lB.enable();var PB=aB(TB.delete),DB=aB(TB.has),IB=aB(TB.get);hB(TB,{delete:function(t){if(uB(t)&&!mB(t)){var e=fB(this);return e.frozen||(e.frozen=new nB),PB(this,t)||e.frozen.delete(t)}return PB(this,t)},has:function(t){if(uB(t)&&!mB(t)){var e=fB(this);return e.frozen||(e.frozen=new nB),DB(this,t)||e.frozen.has(t)}return DB(this,t)},get:function(t){if(uB(t)&&!mB(t)){var e=fB(this);return e.frozen||(e.frozen=new nB),DB(this,t)?IB(this,t):e.frozen.get(t)}return IB(this,t)},set:function(t,e){if(uB(t)&&!mB(t)){var i=fB(this);i.frozen||(i.frozen=new nB),DB(this,t)?MB(this,t,e):i.frozen.set(t,e)}else MB(this,t,e);return this}})}else rB&&pB((function(){var t=kB([]);return MB(new SB,t,1),!bB(t)}))&&hB(TB,{set:function(t,e){var i;return yB(t)&&(bB(t)?i=xB:wB(t)&&(i=EB)),MB(this,t,e),i===xB&&kB(t),i===EB&&_B(t),this}});var BB,NB,FB,zB,AB,jB=i(et.WeakMap);function RB(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)}function LB(t,e,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(t,i):o?o.value=i:e.set(t,i),i}function HB(t,e){var i=void 0!==gf&&fh(t)||t["@@iterator"];if(!i){if(Df(t)||(i=function(t,e){var i;if(!t)return;if("string"==typeof t)return WB(t,e);var n=xf(i=Object.prototype.toString.call(t)).call(i,8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Ya(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return WB(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,r=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw r}}}}function WB(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:function(){};ph(this,t),FB.set(this,new VB),zB.set(this,new VB),AB.set(this,void 0),LB(this,AB,e,"f")}return xu(t,[{key:"sizeNodes",get:function(){return RB(this,FB,"f").size}},{key:"sizeEdges",get:function(){return RB(this,zB,"f").size}},{key:"getNodes",value:function(){return RB(this,FB,"f").getSelection()}},{key:"getEdges",value:function(){return RB(this,zB,"f").getSelection()}},{key:"addNodes",value:function(){var t;(t=RB(this,FB,"f")).add.apply(t,arguments)}},{key:"addEdges",value:function(){var t;(t=RB(this,zB,"f")).add.apply(t,arguments)}},{key:"deleteNodes",value:function(t){RB(this,FB,"f").delete(t)}},{key:"deleteEdges",value:function(t){RB(this,zB,"f").delete(t)}},{key:"clear",value:function(){RB(this,FB,"f").clear(),RB(this,zB,"f").clear()}},{key:"commit",value:function(){for(var t,e,i={nodes:RB(this,FB,"f").commit(),edges:RB(this,zB,"f").commit()},n=arguments.length,o=new Array(n),r=0;r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,r=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw r}}}}function XB(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i4&&void 0!==arguments[4]&&arguments[4],r=this._initBaseEvent(e,i);if(!0===o)r.nodes=[],r.edges=[];else{var s=this.getSelection();r.nodes=s.nodes,r.edges=s.edges}void 0!==n&&(r.previousSelection=n),"click"==t&&(r.items=this.getClickedItems(i)),void 0!==e.controlEdge&&(r.controlEdge=e.controlEdge),this.body.emitter.emit(t,r)}},{key:"selectObject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.selectConnectedEdges;if(void 0!==t){if(t instanceof fD){var i;if(!0===e)(i=this._selectionAccumulator).addEdges.apply(i,vf(t.edges));this._selectionAccumulator.addNodes(t)}else this._selectionAccumulator.addEdges(t);return!0}return!1}},{key:"deselectObject",value:function(t){!0===t.isSelected()&&(t.selected=!1,this._removeFromSelection(t))}},{key:"_getAllNodesOverlappingWith",value:function(t){for(var e=[],i=this.body.nodes,n=0;n1&&void 0!==arguments[1])||arguments[1],i=this._pointerToPositionObject(t),n=this._getAllNodesOverlappingWith(i);return n.length>0?!0===e?this.body.nodes[n[n.length-1]]:n[n.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(t,e){for(var i=this.body.edges,n=0;n1&&void 0!==arguments[1])||arguments[1],i=this.canvas.DOMtoCanvas(t),n=10,o=null,r=this.body.edges,s=0;s0&&(this.generateClickEvent("deselectEdge",e,t,o),i=!0),n.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",e,t,o),i=!0),n.nodes.added.length>0&&(this.generateClickEvent("selectNode",e,t),i=!0),n.edges.added.length>0&&(this.generateClickEvent("selectEdge",e,t),i=!0),!0===i&&this.generateClickEvent("select",e,t)}},{key:"getSelection",value:function(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}},{key:"getSelectedNodes",value:function(){return this._selectionAccumulator.getNodes()}},{key:"getSelectedEdges",value:function(){return this._selectionAccumulator.getEdges()}},{key:"getSelectedNodeIds",value:function(){var t;return jf(t=this._selectionAccumulator.getNodes()).call(t,(function(t){return t.id}))}},{key:"getSelectedEdgeIds",value:function(){var t;return jf(t=this._selectionAccumulator.getEdges()).call(t,(function(t){return t.id}))}},{key:"setSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||!t.nodes&&!t.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((e.unselectAll||void 0===e.unselectAll)&&this.unselectAll(),t.nodes){var i,n=YB(t.nodes);try{for(n.s();!(i=n.n()).done;){var o=i.value,r=this.body.nodes[o];if(!r)throw new RangeError('Node with id "'+o+'" not found');this.selectObject(r,e.highlightEdges)}}catch(t){n.e(t)}finally{n.f()}}if(t.edges){var s,a=YB(t.edges);try{for(a.s();!(s=a.n()).done;){var h=s.value,l=this.body.edges[h];if(!l)throw new RangeError('Edge with id "'+h+'" not found');this.selectObject(l)}}catch(t){a.e(t)}finally{a.f()}}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}},{key:"selectNodes",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t||void 0===t.length)throw"Selection must be an array with ids";this.setSelection({nodes:t},{highlightEdges:e})}},{key:"selectEdges",value:function(t){if(!t||void 0===t.length)throw"Selection must be an array with ids";this.setSelection({edges:t})}},{key:"updateSelection",value:function(){for(var t in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,t.id)||this._selectionAccumulator.deleteNodes(t);for(var e in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,e.id)||this._selectionAccumulator.deleteEdges(e)}},{key:"getClickedItems",value:function(t){for(var e=this.canvas.DOMtoCanvas(t),i=[],n=this.body.nodeIndices,o=this.body.nodes,r=n.length-1;r>=0;r--){var s=o[n[r]].getItemsOnPoint(e);i.push.apply(i,s)}for(var a=this.body.edgeIndices,h=this.body.edges,l=a.length-1;l>=0;l--){var d=h[a[l]].getItemsOnPoint(e);i.push.apply(i,d)}return i}}]),t}();function KB(t){var e=function(){if("undefined"==typeof Reflect||!sM)return!1;if(sM.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(sM(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=F_(t);if(e){var o=F_(this).constructor;i=sM(n,arguments,o)}else i=n.apply(this,arguments);return I_(this,i)}}var $B=function(){function t(){ph(this,t)}return xu(t,[{key:"abstract",value:function(){throw new Error("Can't instantiate abstract class!")}},{key:"fake_use",value:function(){}},{key:"curveType",value:function(){return this.abstract()}},{key:"getPosition",value:function(t){return this.fake_use(t),this.abstract()}},{key:"setPosition",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.fake_use(t,e,i),this.abstract()}},{key:"getTreeSize",value:function(t){return this.fake_use(t),this.abstract()}},{key:"sort",value:function(t){this.fake_use(t),this.abstract()}},{key:"fix",value:function(t,e){this.fake_use(t,e),this.abstract()}},{key:"shift",value:function(t,e){this.fake_use(t,e),this.abstract()}}]),t}(),ZB=function(t){D_(i,t);var e=KB(i);function i(t){var n;return ph(this,i),(n=e.call(this)).layout=t,n}return xu(i,[{key:"curveType",value:function(){return"horizontal"}},{key:"getPosition",value:function(t){return t.x}},{key:"setPosition",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==i&&this.layout.hierarchical.addToOrdering(t,i),t.x=e}},{key:"getTreeSize",value:function(t){var e=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,t);return{min:e.min_x,max:e.max_x}}},{key:"sort",value:function(t){yT(t).call(t,(function(t,e){return t.x-e.x}))}},{key:"fix",value:function(t,e){t.y=this.layout.options.hierarchical.levelSeparation*e,t.options.fixed.y=!0}},{key:"shift",value:function(t,e){this.layout.body.nodes[t].x+=e}}]),i}($B),QB=function(t){D_(i,t);var e=KB(i);function i(t){var n;return ph(this,i),(n=e.call(this)).layout=t,n}return xu(i,[{key:"curveType",value:function(){return"vertical"}},{key:"getPosition",value:function(t){return t.y}},{key:"setPosition",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==i&&this.layout.hierarchical.addToOrdering(t,i),t.y=e}},{key:"getTreeSize",value:function(t){var e=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,t);return{min:e.min_y,max:e.max_y}}},{key:"sort",value:function(t){yT(t).call(t,(function(t,e){return t.y-e.y}))}},{key:"fix",value:function(t,e){t.x=this.layout.options.hierarchical.levelSeparation*e,t.options.fixed.x=!0}},{key:"shift",value:function(t,e){this.layout.body.nodes[t].y+=e}}]),i}($B),JB=Fl.every;Ti({target:"Array",proto:!0,forced:!Xf("every")},{every:function(t){return JB(this,t,arguments.length>1?arguments[1]:void 0)}});var tN=Nn("Array").every,eN=at,iN=tN,nN=Array.prototype,oN=function(t){var e=t.every;return t===nN||eN(nN,t)&&e===nN.every?iN:e},rN=i(oN);function sN(t,e){var i=void 0!==gf&&fh(t)||t["@@iterator"];if(!i){if(Df(t)||(i=function(t,e){var i;if(!t)return;if("string"==typeof t)return aN(t,e);var n=xf(i=Object.prototype.toString.call(t)).call(i,8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Ya(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aN(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,r=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw r}}}}function aN(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=e[n])&&(e[n]=e[i]+1)})),e}function lN(t,e,i,n){var o,r,s=pg(null),a=pS(o=vf(FT(n).call(n))).call(o,(function(t,e){return t+1+e.edges.length}),0),h=i+"Id",l="to"===i?1:-1,d=sN(n);try{var c,u=function(){var o=pf(r.value,2),d=o[0],c=o[1];if(!n.has(d)||!t(c))return 0;s[d]=0;for(var u,f,p=[c],v=0,g=function(){var t,o;if(!n.has(d))return 0;var r=s[u.id]+l;if(op(t=yv(o=u.edges).call(o,(function(t){return t.connected&&t.to!==t.from&&t[i]!==u&&n.has(t.toId)&&n.has(t.fromId)}))).call(t,(function(t){var n=t[h],o=s[n];(null==o||e(r,o))&&(s[n]=r,p.push(t[i]))})),v>a)return{v:{v:hN(n,s)}};++v};u=p.pop();)if(0!==(f=g())&&f)return f.v};for(d.s();!(r=d.n()).done;)if(0!==(c=u())&&c)return c.v}catch(t){d.e(t)}finally{d.f()}return s}var dN=function(){function t(){ph(this,t),this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}return xu(t,[{key:"addRelation",value:function(t,e){void 0===this.childrenReference[t]&&(this.childrenReference[t]=[]),this.childrenReference[t].push(e),void 0===this.parentReference[e]&&(this.parentReference[e]=[]),this.parentReference[e].push(t)}},{key:"checkIfTree",value:function(){for(var t in this.parentReference)if(this.parentReference[t].length>1)return void(this.isTree=!1);this.isTree=!0}},{key:"numTrees",value:function(){return this.treeIndex+1}},{key:"setTreeIndex",value:function(t,e){void 0!==e&&void 0===this.trees[t.id]&&(this.trees[t.id]=e,this.treeIndex=Math.max(e,this.treeIndex))}},{key:"ensureLevel",value:function(t){void 0===this.levels[t]&&(this.levels[t]=0)}},{key:"getMaxLevel",value:function(t){var e=this,i={};return function t(n){if(void 0!==i[n])return i[n];var o=e.levels[n];if(e.childrenReference[n]){var r=e.childrenReference[n];if(r.length>0)for(var s=0;s0&&(i.levelSeparation*=-1):i.levelSeparation<0&&(i.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(e);if(!0===n)return this.body.emitter.emit("refresh"),gb(e,this.optionsBackup)}return e}},{key:"_resetRNG",value:function(t){this.initialRandomSeed=t,this._rng=Jm(this.initialRandomSeed)}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(t){if(!0===this.options.hierarchical.enabled){var e=this.optionsBackup.physics;void 0===t.physics||!0===t.physics?(t.physics={enabled:void 0===e.enabled||e.enabled,solver:"hierarchicalRepulsion"},e.enabled=void 0===e.enabled||e.enabled,e.solver=e.solver||"barnesHut"):"object"===bu(t.physics)?(e.enabled=void 0===t.physics.enabled||t.physics.enabled,e.solver=t.physics.solver||"barnesHut",t.physics.solver="hierarchicalRepulsion"):!1!==t.physics&&(e.solver="barnesHut",t.physics={solver:"hierarchicalRepulsion"});var i=this.direction.curveType();if(void 0===t.edges)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},t.edges={smooth:!1};else if(void 0===t.edges.smooth)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},t.edges.smooth=!1;else if("boolean"==typeof t.edges.smooth)this.optionsBackup.edges={smooth:t.edges.smooth},t.edges.smooth={enabled:t.edges.smooth,type:i};else{var n=t.edges.smooth;void 0!==n.type&&"dynamic"!==n.type&&(i=n.type),this.optionsBackup.edges={smooth:{enabled:void 0===n.enabled||n.enabled,type:void 0===n.type?"dynamic":n.type,roundness:void 0===n.roundness?.5:n.roundness,forceDirection:void 0!==n.forceDirection&&n.forceDirection}},t.edges.smooth={enabled:void 0===n.enabled||n.enabled,type:i,roundness:void 0===n.roundness?.5:n.roundness,forceDirection:void 0!==n.forceDirection&&n.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",i)}return t}},{key:"positionInitially",value:function(t){if(!0!==this.options.hierarchical.enabled){this._resetRNG(this.initialRandomSeed);for(var e=t.length+50,i=0;io){for(var s=t.length;t.length>o&&n<=10;){n+=1;var a=t.length;if(n%3==0?this.body.modules.clustering.clusterBridges(r):this.body.modules.clustering.clusterOutliers(r),a==t.length&&n%3!=0)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*s)})}n>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(t,this.body.edgeIndices,!0),this._shiftToCenter();for(var h=0;h0){var t,e,i=!1,n=!1;for(e in this.lastNodeOnLevel={},this.hierarchical=new dN,this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&(void 0!==(t=this.body.nodes[e]).options.level?(i=!0,this.hierarchical.levels[e]=t.options.level):n=!0);if(!0===n&&!0===i)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");if(!0===n){var o=this.options.hierarchical.sortMethod;"hubsize"===o?this._determineLevelsByHubsize():"directed"===o?this._determineLevelsDirected():"custom"===o&&this._determineLevelsCustomCallback()}for(var r in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,r)&&this.hierarchical.ensureLevel(r);var s=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(s),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var t=this,e=!1,i={},n=function(e,i){var n=t.hierarchical.trees;for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&n[o]===e&&t.direction.shift(o,i)},o=function(){for(var e=[],i=0;i0)for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:1e9,n=1e9,o=1e9,r=1e9,s=-1e9;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var h=t.body.nodes[a],l=t.hierarchical.levels[h.id],d=t.direction.getPosition(h),c=pf(t._getSpaceAroundNode(h,e),2),u=c[0],f=c[1];n=Math.min(u,n),o=Math.min(f,o),l<=i&&(r=Math.min(d,r),s=Math.max(d,s))}return[r,s,n,o]},a=function(e,i,n){for(var o=t.hierarchical,r=0;r1)for(var h=0;h2&&void 0!==arguments[2]&&arguments[2],a=t.direction.getPosition(i),h=t.direction.getPosition(n),l=Math.abs(h-a),d=t.options.hierarchical.nodeSpacing;if(l>d){var c={},u={};r(i,c),r(n,u);var f=function(e,i){var n=t.hierarchical.getMaxLevel(e.id),o=t.hierarchical.getMaxLevel(i.id);return Math.min(n,o)}(i,n),p=s(c,f),v=s(u,f),g=p[1],y=v[0],m=v[2];if(Math.abs(g-y)>d){var b=g-y+d;b<-m+d&&(b=-m+d),b<0&&(t._shiftBlock(n.id,b),e=!0,!0===o&&t._centerParent(n))}}},l=function(n,o){for(var a=o.id,h=o.edges,l=t.hierarchical.levels[o.id],d=t.options.hierarchical.levelSeparation*t.options.hierarchical.levelSeparation,c={},u=[],f=0;f0?f=Math.min(u,c-t.options.hierarchical.nodeSpacing):u<0&&(f=-Math.min(-u,d-t.options.hierarchical.nodeSpacing)),0!=f&&(t._shiftBlock(o.id,f),e=!0)}(b),function(i){var n=t.direction.getPosition(o),r=pf(t._getSpaceAroundNode(o),2),s=r[0],a=r[1],h=i-n,l=n;h>0?l=Math.min(n+(a-t.options.hierarchical.nodeSpacing),i):h<0&&(l=Math.max(n-(s-t.options.hierarchical.nodeSpacing),i)),l!==n&&(t.direction.setPosition(o,l),e=!0)}(b=m(n,h))};!0===this.options.hierarchical.blockShifting&&(function(i){var n=t.hierarchical.getLevels();n=vp(n).call(n);for(var o=0;o0&&Math.abs(c)0&&(h=this.direction.getPosition(n[r-1])+a),this.direction.setPosition(s,h,e),this._validatePositionAndContinue(s,e,h),o++}}}}},{key:"_placeBranchNodes",value:function(t,e){var i,n=this.hierarchical.childrenReference[t];if(void 0!==n){for(var o=[],r=0;re&&void 0===this.positionedNodes[a.id]))return;var l=this.options.hierarchical.nodeSpacing,d=void 0;d=0===s?this.direction.getPosition(this.body.nodes[t]):this.direction.getPosition(o[s-1])+l,this.direction.setPosition(a,d,h),this._validatePositionAndContinue(a,h,d)}var c=this._getCenterPosition(o);this.direction.setPosition(this.body.nodes[t],c,e)}}},{key:"_validatePositionAndContinue",value:function(t,e,i){if(this.hierarchical.isTree){if(void 0!==this.lastNodeOnLevel[e]){var n=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[e]]);if(i-nt}),"from",t)}(i),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_generateMap",value:function(){var t=this;this._crawlNetwork((function(e,i){t.hierarchical.levels[i.id]>t.hierarchical.levels[e.id]&&t.hierarchical.addRelation(e.id,i.id)})),this.hierarchical.checkIfTree()}},{key:"_crawlNetwork",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},i=arguments.length>1?arguments[1]:void 0,n={},o=function i(o,r){if(void 0===n[o.id]){var s;t.hierarchical.setTreeIndex(o,r),n[o.id]=!0;for(var a=t._getActiveEdges(o),h=0;h=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,r=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw r}}}}function fN(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&!1!==this.options.deleteNode||0===i&&!1!==this.options.deleteEdge)&&(!0===s&&this._createSeperator(4),this._createDeleteButton(r)),this._bindElementEvents(this.closeDiv,Hn(t=this.toggleEditMode).call(t,this)),this._temporaryBindEvent("select",Hn(e=this.showManipulatorToolbar).call(e,this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){var t;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addNode",!0===this.guiEnabled){var e,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,Hn(e=this.toggleEditMode).call(e,this))}this._temporaryBindEvent("click",Hn(t=this._performAddNode).call(t,this))}},{key:"editNode",value:function(){var t=this;!0!==this.editMode&&this.enableEditMode(),this._clean();var e=this.selectionHandler.getSelectedNodes()[0];if(void 0!==e){if(this.inMode="editNode","function"!=typeof this.options.editNode)throw new Error("No function has been configured to handle the editing of nodes.");if(!0!==e.isCluster){var i=gb({},e.options,!1);if(i.x=e.x,i.y=e.y,2!==this.options.editNode.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editNode(i,(function(e){null!=e&&"editNode"===t.inMode&&t.body.data.nodes.getDataSet().update(e),t.showManipulatorToolbar()}))}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){var t,e,i,n,o;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addEdge",!0===this.guiEnabled){var r,s=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(s),this._createSeperator(),this._createDescription(s.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,Hn(r=this.toggleEditMode).call(r,this))}this._temporaryBindUI("onTouch",Hn(t=this._handleConnect).call(t,this)),this._temporaryBindUI("onDragEnd",Hn(e=this._finishConnect).call(e,this)),this._temporaryBindUI("onDrag",Hn(i=this._dragControlNode).call(i,this)),this._temporaryBindUI("onRelease",Hn(n=this._finishConnect).call(n,this)),this._temporaryBindUI("onDragStart",Hn(o=this._dragStartEdge).call(o,this)),this._temporaryBindUI("onHold",(function(){}))}},{key:"editEdgeMode",value:function(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="editEdge","object"!==bu(this.options.editEdge)||"function"!=typeof this.options.editEdge.editWithoutDrag||(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],void 0===this.edgeBeingEditedId)){if(!0===this.guiEnabled){var t,e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,Hn(t=this.toggleEditMode).call(t,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],void 0!==this.edgeBeingEditedId){var i,n,o,r,s=this.body.edges[this.edgeBeingEditedId],a=this._getNewTargetNode(s.from.x,s.from.y),h=this._getNewTargetNode(s.to.x,s.to.y);this.temporaryIds.nodes.push(a.id),this.temporaryIds.nodes.push(h.id),this.body.nodes[a.id]=a,this.body.nodeIndices.push(a.id),this.body.nodes[h.id]=h,this.body.nodeIndices.push(h.id),this._temporaryBindUI("onTouch",Hn(i=this._controlNodeTouch).call(i,this)),this._temporaryBindUI("onTap",(function(){})),this._temporaryBindUI("onHold",(function(){})),this._temporaryBindUI("onDragStart",Hn(n=this._controlNodeDragStart).call(n,this)),this._temporaryBindUI("onDrag",Hn(o=this._controlNodeDrag).call(o,this)),this._temporaryBindUI("onDragEnd",Hn(r=this._controlNodeDragEnd).call(r,this)),this._temporaryBindUI("onMouseMove",(function(){})),this._temporaryBindEvent("beforeDrawing",(function(t){var e=s.edgeType.findBorderPositions(t);!1===a.selected&&(a.x=e.from.x,a.y=e.from.y),!1===h.selected&&(h.x=e.to.x,h.y=e.to.y)})),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}else{var l=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(l.from.id,l.to.id)}}},{key:"deleteSelected",value:function(){var t=this;!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="delete";var e=this.selectionHandler.getSelectedNodeIds(),i=this.selectionHandler.getSelectedEdgeIds(),n=void 0;if(e.length>0){for(var o=0;o0&&"function"==typeof this.options.deleteEdge&&(n=this.options.deleteEdge);if("function"==typeof n){var r={nodes:e,edges:i};if(2!==n.length)throw new Error("The function for delete does not support two arguments (data, callback)");n(r,(function(e){null!=e&&"delete"===t.inMode?(t.body.data.edges.getDataSet().remove(e.edges),t.body.data.nodes.getDataSet().remove(e.nodes),t.body.emitter.emit("startSimulation"),t.showManipulatorToolbar()):(t.body.emitter.emit("startSimulation"),t.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().remove(i),this.body.data.nodes.getDataSet().remove(e),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){!0===this.options.enabled?(this.guiEnabled=!0,this._createWrappers(),!1===this.editMode?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){var t,e;(void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",!0===this.editMode?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",!0===this.editMode?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv)&&(this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",null!==(t=null===(e=this.options.locales[this.options.locale])||void 0===e?void 0:e.close)&&void 0!==t?t:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}},{key:"_getNewTargetNode",value:function(t,e){var i=gb({},this.options.controlNodeStyle);i.id="targetNode"+zM(),i.hidden=!1,i.physics=!1,i.x=t,i.y=e;var n=this.body.functions.createNode(i);return n.shape.boundingBox={left:t,right:t,top:e,bottom:e},n}},{key:"_createEditButton",value:function(){var t;this._clean(),this.manipulationDOM={},hb(this.editModeDiv);var e=this.options.locales[this.options.locale],i=this._createButton("editMode","vis-edit vis-edit-mode",e.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(i),this._bindElementEvents(i,Hn(t=this.toggleEditMode).call(t,this))}},{key:"_clean",value:function(){this.inMode=!1,!0===this.guiEnabled&&(hb(this.editModeDiv),hb(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanupDOMEventListeners",value:function(){var t,e,i=uN(Ap(t=this._domEventListenerCleanupQueue).call(t,0));try{for(i.s();!(e=i.n()).done;){(0,e.value)()}}catch(t){i.e(t)}finally{i.f()}}},{key:"_removeManipulationDOM",value:function(){this._clean(),hb(this.manipulationDiv),hb(this.editModeDiv),hb(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}},{key:"_createSeperator",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+t]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+t].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+t])}},{key:"_createAddNodeButton",value:function(t){var e,i=this._createButton("addNode","vis-add",t.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,Hn(e=this.addNodeMode).call(e,this))}},{key:"_createAddEdgeButton",value:function(t){var e,i=this._createButton("addEdge","vis-connect",t.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,Hn(e=this.addEdgeMode).call(e,this))}},{key:"_createEditNodeButton",value:function(t){var e,i=this._createButton("editNode","vis-edit",t.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,Hn(e=this.editNode).call(e,this))}},{key:"_createEditEdgeButton",value:function(t){var e,i=this._createButton("editEdge","vis-edit",t.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,Hn(e=this.editEdgeMode).call(e,this))}},{key:"_createDeleteButton",value:function(t){var e,i;i=this.options.rtl?"vis-delete-rtl":"vis-delete";var n=this._createButton("delete",i,t.del||this.options.locales.en.del);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,Hn(e=this.deleteSelected).call(e,this))}},{key:"_createBackButton",value:function(t){var e,i=this._createButton("back","vis-back",t.back||this.options.locales.en.back);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,Hn(e=this.showManipulatorToolbar).call(e,this))}},{key:"_createButton",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vis-label";return this.manipulationDOM[t+"Div"]=document.createElement("button"),this.manipulationDOM[t+"Div"].className="vis-button "+e,this.manipulationDOM[t+"Label"]=document.createElement("div"),this.manipulationDOM[t+"Label"].className=n,this.manipulationDOM[t+"Label"].innerText=i,this.manipulationDOM[t+"Div"].appendChild(this.manipulationDOM[t+"Label"]),this.manipulationDOM[t+"Div"]}},{key:"_createDescription",value:function(t){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=t,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}},{key:"_temporaryBindEvent",value:function(t,e){this.temporaryEventFunctions.push({event:t,boundFunction:e}),this.body.emitter.on(t,e)}},{key:"_temporaryBindUI",value:function(t,e){if(void 0===this.body.eventListeners[t])throw new Error("This UI function does not exist. Typo? You tried: "+t+" possible are: "+mg(Hf(this.body.eventListeners)));this.temporaryUIFunctions[t]=this.body.eventListeners[t],this.body.eventListeners[t]=e}},{key:"_unbindTemporaryUIs",value:function(){for(var t in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,t)&&(this.body.eventListeners[t]=this.temporaryUIFunctions[t],delete this.temporaryUIFunctions[t]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var t=0;t=0;s--)if(o[s]!==this.selectedControlNode.id){r=this.body.nodes[o[s]];break}if(void 0!==r&&void 0!==this.selectedControlNode)if(!0===r.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var a=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===a.id?this._performEditEdge(r.id,n.to.id):this._performEditEdge(n.from.id,r.id)}else n.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(t){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(t.center),this.lastTouch.translation=bn({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;var e=this.lastTouch,i=this.selectionHandler.getNodeAt(e);if(void 0!==i)if(!0===i.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var n=this._getNewTargetNode(i.x,i.y);this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id);var o=this.body.functions.createEdge({id:"connectionEdge"+zM(),from:i.id,to:n.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[o.id]=o,this.body.edgeIndices.push(o.id),this.temporaryIds.nodes.push(n.id),this.temporaryIds.edges.push(o.id)}this.touchTime=(new Date).valueOf()}}},{key:"_dragControlNode",value:function(t){var e=this.body.functions.getPointer(t.center),i=this.selectionHandler._pointerToPositionObject(e),n=void 0;void 0!==this.temporaryIds.edges[0]&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var o=this.selectionHandler._getAllNodesOverlappingWith(i),r=void 0,s=o.length-1;s>=0;s--){var a;if(-1===lg(a=this.temporaryIds.nodes).call(a,o[s])){r=this.body.nodes[o[s]];break}}if(t.controlEdge={from:n,to:r?r.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",t,e),void 0!==this.temporaryIds.nodes[0]){var h=this.body.nodes[this.temporaryIds.nodes[0]];h.x=this.canvas._XconvertDOMtoCanvas(e.x),h.y=this.canvas._YconvertDOMtoCanvas(e.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(t)}},{key:"_finishConnect",value:function(t){var e=this.body.functions.getPointer(t.center),i=this.selectionHandler._pointerToPositionObject(e),n=void 0;void 0!==this.temporaryIds.edges[0]&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var o=this.selectionHandler._getAllNodesOverlappingWith(i),r=void 0,s=o.length-1;s>=0;s--){var a;if(-1===lg(a=this.temporaryIds.nodes).call(a,o[s])){r=this.body.nodes[o[s]];break}}this._cleanupTemporaryNodesAndEdges(),void 0!==r&&(!0===r.isCluster?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[n]&&void 0!==this.body.nodes[r.id]&&this._performAddEdge(n,r.id)),t.controlEdge={from:n,to:r?r.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",t,e),this.body.emitter.emit("_redraw")}},{key:"_dragStartEdge",value:function(t){var e=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",t,e,void 0,!0)}},{key:"_performAddNode",value:function(t){var e=this,i={id:zM(),x:t.pointer.canvas.x,y:t.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(i,(function(t){null!=t&&"addNode"===e.inMode&&e.body.data.nodes.getDataSet().add(t),e.showManipulatorToolbar()}))}else this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(t,e){var i=this,n={from:t,to:e};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(n,(function(t){null!=t&&"addEdge"===i.inMode&&(i.body.data.edges.getDataSet().add(t),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().add(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(t,e){var i=this,n={id:this.edgeBeingEditedId,from:t,to:e,label:this.body.data.edges.get(this.edgeBeingEditedId).label},o=this.options.editEdge;if("object"===bu(o)&&(o=o.editWithoutDrag),"function"==typeof o){if(2!==o.length)throw new Error("The function for edit does not support two arguments (data, callback)");o(n,(function(t){null==t||"editEdge"!==i.inMode?(i.body.edges[n.id].updateEdgeType(),i.body.emitter.emit("_redraw"),i.showManipulatorToolbar()):(i.body.data.edges.getDataSet().update(t),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().update(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),t}(),vN="string",gN="boolean",yN="number",mN="array",bN="object",wN=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],kN={borderWidth:{number:yN},borderWidthSelected:{number:yN,undefined:"undefined"},brokenImage:{string:vN,undefined:"undefined"},chosen:{label:{boolean:gN,function:"function"},node:{boolean:gN,function:"function"},__type__:{object:bN,boolean:gN}},color:{border:{string:vN},background:{string:vN},highlight:{border:{string:vN},background:{string:vN},__type__:{object:bN,string:vN}},hover:{border:{string:vN},background:{string:vN},__type__:{object:bN,string:vN}},__type__:{object:bN,string:vN}},opacity:{number:yN,undefined:"undefined"},fixed:{x:{boolean:gN},y:{boolean:gN},__type__:{object:bN,boolean:gN}},font:{align:{string:vN},color:{string:vN},size:{number:yN},face:{string:vN},background:{string:vN},strokeWidth:{number:yN},strokeColor:{string:vN},vadjust:{number:yN},multi:{boolean:gN,string:vN},bold:{color:{string:vN},size:{number:yN},face:{string:vN},mod:{string:vN},vadjust:{number:yN},__type__:{object:bN,string:vN}},boldital:{color:{string:vN},size:{number:yN},face:{string:vN},mod:{string:vN},vadjust:{number:yN},__type__:{object:bN,string:vN}},ital:{color:{string:vN},size:{number:yN},face:{string:vN},mod:{string:vN},vadjust:{number:yN},__type__:{object:bN,string:vN}},mono:{color:{string:vN},size:{number:yN},face:{string:vN},mod:{string:vN},vadjust:{number:yN},__type__:{object:bN,string:vN}},__type__:{object:bN,string:vN}},group:{string:vN,number:yN,undefined:"undefined"},heightConstraint:{minimum:{number:yN},valign:{string:vN},__type__:{object:bN,boolean:gN,number:yN}},hidden:{boolean:gN},icon:{face:{string:vN},code:{string:vN},size:{number:yN},color:{string:vN},weight:{string:vN,number:yN},__type__:{object:bN}},id:{string:vN,number:yN},image:{selected:{string:vN,undefined:"undefined"},unselected:{string:vN,undefined:"undefined"},__type__:{object:bN,string:vN}},imagePadding:{top:{number:yN},right:{number:yN},bottom:{number:yN},left:{number:yN},__type__:{object:bN,number:yN}},label:{string:vN,undefined:"undefined"},labelHighlightBold:{boolean:gN},level:{number:yN,undefined:"undefined"},margin:{top:{number:yN},right:{number:yN},bottom:{number:yN},left:{number:yN},__type__:{object:bN,number:yN}},mass:{number:yN},physics:{boolean:gN},scaling:{min:{number:yN},max:{number:yN},label:{enabled:{boolean:gN},min:{number:yN},max:{number:yN},maxVisible:{number:yN},drawThreshold:{number:yN},__type__:{object:bN,boolean:gN}},customScalingFunction:{function:"function"},__type__:{object:bN}},shadow:{enabled:{boolean:gN},color:{string:vN},size:{number:yN},x:{number:yN},y:{number:yN},__type__:{object:bN,boolean:gN}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:gN,array:mN},borderRadius:{number:yN},interpolation:{boolean:gN},useImageSize:{boolean:gN},useBorderWithImage:{boolean:gN},coordinateOrigin:{string:["center","top-left"]},__type__:{object:bN}},size:{number:yN},title:{string:vN,dom:"dom",undefined:"undefined"},value:{number:yN,undefined:"undefined"},widthConstraint:{minimum:{number:yN},maximum:{number:yN},__type__:{object:bN,boolean:gN,number:yN}},x:{number:yN},y:{number:yN},__type__:{object:bN}},_N={configure:{enabled:{boolean:gN},filter:{boolean:gN,string:vN,array:mN,function:"function"},container:{dom:"dom"},showButton:{boolean:gN},__type__:{object:bN,boolean:gN,string:vN,array:mN,function:"function"}},edges:{arrows:{to:{enabled:{boolean:gN},scaleFactor:{number:yN},type:{string:wN},imageHeight:{number:yN},imageWidth:{number:yN},src:{string:vN},__type__:{object:bN,boolean:gN}},middle:{enabled:{boolean:gN},scaleFactor:{number:yN},type:{string:wN},imageWidth:{number:yN},imageHeight:{number:yN},src:{string:vN},__type__:{object:bN,boolean:gN}},from:{enabled:{boolean:gN},scaleFactor:{number:yN},type:{string:wN},imageWidth:{number:yN},imageHeight:{number:yN},src:{string:vN},__type__:{object:bN,boolean:gN}},__type__:{string:["from","to","middle"],object:bN}},endPointOffset:{from:{number:yN},to:{number:yN},__type__:{object:bN,number:yN}},arrowStrikethrough:{boolean:gN},background:{enabled:{boolean:gN},color:{string:vN},size:{number:yN},dashes:{boolean:gN,array:mN},__type__:{object:bN,boolean:gN}},chosen:{label:{boolean:gN,function:"function"},edge:{boolean:gN,function:"function"},__type__:{object:bN,boolean:gN}},color:{color:{string:vN},highlight:{string:vN},hover:{string:vN},inherit:{string:["from","to","both"],boolean:gN},opacity:{number:yN},__type__:{object:bN,string:vN}},dashes:{boolean:gN,array:mN},font:{color:{string:vN},size:{number:yN},face:{string:vN},background:{string:vN},strokeWidth:{number:yN},strokeColor:{string:vN},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:yN},multi:{boolean:gN,string:vN},bold:{color:{string:vN},size:{number:yN},face:{string:vN},mod:{string:vN},vadjust:{number:yN},__type__:{object:bN,string:vN}},boldital:{color:{string:vN},size:{number:yN},face:{string:vN},mod:{string:vN},vadjust:{number:yN},__type__:{object:bN,string:vN}},ital:{color:{string:vN},size:{number:yN},face:{string:vN},mod:{string:vN},vadjust:{number:yN},__type__:{object:bN,string:vN}},mono:{color:{string:vN},size:{number:yN},face:{string:vN},mod:{string:vN},vadjust:{number:yN},__type__:{object:bN,string:vN}},__type__:{object:bN,string:vN}},hidden:{boolean:gN},hoverWidth:{function:"function",number:yN},label:{string:vN,undefined:"undefined"},labelHighlightBold:{boolean:gN},length:{number:yN,undefined:"undefined"},physics:{boolean:gN},scaling:{min:{number:yN},max:{number:yN},label:{enabled:{boolean:gN},min:{number:yN},max:{number:yN},maxVisible:{number:yN},drawThreshold:{number:yN},__type__:{object:bN,boolean:gN}},customScalingFunction:{function:"function"},__type__:{object:bN}},selectionWidth:{function:"function",number:yN},selfReferenceSize:{number:yN},selfReference:{size:{number:yN},angle:{number:yN},renderBehindTheNode:{boolean:gN},__type__:{object:bN}},shadow:{enabled:{boolean:gN},color:{string:vN},size:{number:yN},x:{number:yN},y:{number:yN},__type__:{object:bN,boolean:gN}},smooth:{enabled:{boolean:gN},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:yN},forceDirection:{string:["horizontal","vertical","none"],boolean:gN},__type__:{object:bN,boolean:gN}},title:{string:vN,undefined:"undefined"},width:{number:yN},widthConstraint:{maximum:{number:yN},__type__:{object:bN,boolean:gN,number:yN}},value:{number:yN,undefined:"undefined"},__type__:{object:bN}},groups:{useDefaultGroups:{boolean:gN},__any__:kN,__type__:{object:bN}},interaction:{dragNodes:{boolean:gN},dragView:{boolean:gN},hideEdgesOnDrag:{boolean:gN},hideEdgesOnZoom:{boolean:gN},hideNodesOnDrag:{boolean:gN},hover:{boolean:gN},keyboard:{enabled:{boolean:gN},speed:{x:{number:yN},y:{number:yN},zoom:{number:yN},__type__:{object:bN}},bindToWindow:{boolean:gN},autoFocus:{boolean:gN},__type__:{object:bN,boolean:gN}},multiselect:{boolean:gN},navigationButtons:{boolean:gN},selectable:{boolean:gN},selectConnectedEdges:{boolean:gN},hoverConnectedEdges:{boolean:gN},tooltipDelay:{number:yN},zoomView:{boolean:gN},zoomSpeed:{number:yN},__type__:{object:bN}},layout:{randomSeed:{undefined:"undefined",number:yN,string:vN},improvedLayout:{boolean:gN},clusterThreshold:{number:yN},hierarchical:{enabled:{boolean:gN},levelSeparation:{number:yN},nodeSpacing:{number:yN},treeSpacing:{number:yN},blockShifting:{boolean:gN},edgeMinimization:{boolean:gN},parentCentralization:{boolean:gN},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:bN,boolean:gN}},__type__:{object:bN}},manipulation:{enabled:{boolean:gN},initiallyActive:{boolean:gN},addNode:{boolean:gN,function:"function"},addEdge:{boolean:gN,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:bN,boolean:gN,function:"function"}},deleteNode:{boolean:gN,function:"function"},deleteEdge:{boolean:gN,function:"function"},controlNodeStyle:kN,__type__:{object:bN,boolean:gN}},nodes:kN,physics:{enabled:{boolean:gN},barnesHut:{theta:{number:yN},gravitationalConstant:{number:yN},centralGravity:{number:yN},springLength:{number:yN},springConstant:{number:yN},damping:{number:yN},avoidOverlap:{number:yN},__type__:{object:bN}},forceAtlas2Based:{theta:{number:yN},gravitationalConstant:{number:yN},centralGravity:{number:yN},springLength:{number:yN},springConstant:{number:yN},damping:{number:yN},avoidOverlap:{number:yN},__type__:{object:bN}},repulsion:{centralGravity:{number:yN},springLength:{number:yN},springConstant:{number:yN},nodeDistance:{number:yN},damping:{number:yN},__type__:{object:bN}},hierarchicalRepulsion:{centralGravity:{number:yN},springLength:{number:yN},springConstant:{number:yN},nodeDistance:{number:yN},damping:{number:yN},avoidOverlap:{number:yN},__type__:{object:bN}},maxVelocity:{number:yN},minVelocity:{number:yN},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:gN},iterations:{number:yN},updateInterval:{number:yN},onlyDynamicEdges:{boolean:gN},fit:{boolean:gN},__type__:{object:bN,boolean:gN}},timestep:{number:yN},adaptiveTimestep:{boolean:gN},wind:{x:{number:yN},y:{number:yN},__type__:{object:bN}},__type__:{object:bN,boolean:gN}},autoResize:{boolean:gN},clickToUse:{boolean:gN},locale:{string:vN},locales:{__any__:{any:"any"},__type__:{object:bN}},height:{string:vN},width:{string:vN},__type__:{object:bN}},xN={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]}}},EN=function(t,e,i){var n;return!(!rv(t).call(t,"physics")||!rv(n=xN.physics.solver).call(n,e)||i.physics.solver===e||"wind"===e)},ON=Object.freeze({__proto__:null,allOptions:_N,configuratorHideOption:EN,configureOptions:xN}),CN=function(){function t(){ph(this,t)}return xu(t,[{key:"getDistances",value:function(t,e,i){for(var n={},o=t.edges,r=0;r2&&void 0!==arguments[2]&&arguments[2],n=this.distanceSolver.getDistances(this.body,t,e);this._createL_matrix(n),this._createK_matrix(n),this._createE_matrix();for(var o=0,r=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),s=1e9,a=0,h=0,l=0,d=0,c=0;s>.01&&o1&&c<5;){c+=1,this._moveNode(a,h,l);var f=pf(this._getEnergy(a),3);d=f[0],h=f[1],l=f[2]}}}},{key:"_getHighestEnergyNode",value:function(t){for(var e=this.body.nodeIndices,i=this.body.nodes,n=0,o=e[0],r=0,s=0,a=0;a0?(n=e[t].redundant[0],e[t].redundant.shift()):(n=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(n)):(n=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(n)),e[t].used.push(n),n}Kn(TN.prototype),TN.prototype.setOptions=function(t){var e=this;if(null===t&&(t=void 0),void 0!==t){!0===ew.validate(t,_N)&&console.error("%cErrors have been found in the supplied options object.",tw);if(pb(["locale","locales","clickToUse"],this.options,t),void 0!==t.locale&&(t.locale=function(t,e){try{var i=pf(e.split(/[-_ /]/,2),2),n=i[0],o=i[1],r=null!=n?n.toLowerCase():null,s=null!=o?o.toUpperCase():null;if(r&&s){var a,h=r+"-"+s;if(Object.prototype.hasOwnProperty.call(t,h))return h;console.warn(_f(a="Unknown variant ".concat(s," of language ")).call(a,r,"."))}if(r){var l=r;if(Object.prototype.hasOwnProperty.call(t,l))return l;console.warn("Unknown language ".concat(r))}return console.warn("Unknown locale ".concat(e,", falling back to English.")),"en"}catch(t){return console.error(t),console.warn("Unexpected error while normalizing locale ".concat(e,", falling back to English.")),"en"}}(t.locales||this.options.locales,t.locale)),t=this.layoutEngine.setOptions(t.layout,t),this.canvas.setOptions(t),this.groups.setOptions(t.groups),this.nodesHandler.setOptions(t.nodes),this.edgesHandler.setOptions(t.edges),this.physics.setOptions(t.physics),this.manipulation.setOptions(t.manipulation,t,this.options),this.interactionHandler.setOptions(t.interaction),this.renderer.setOptions(t.interaction),this.selectionHandler.setOptions(t.interaction),void 0!==t.groups&&this.body.emitter.emit("refreshNodes"),"configure"in t&&(this.configurator||(this.configurator=new Zb(this,this.body.container,xN,this.canvas.pixelRatio,EN)),this.configurator.setOptions(t.configure)),this.configurator&&!0===this.configurator.options.enabled){var i={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};gb(i.nodes,this.nodesHandler.options),gb(i.edges,this.edgesHandler.options),gb(i.layout,this.layoutEngine.options),gb(i.interaction,this.selectionHandler.options),gb(i.interaction,this.renderer.options),gb(i.interaction,this.interactionHandler.options),gb(i.manipulation,this.manipulation.options),gb(i.physics,this.physics.options),gb(i.global,this.canvas.options),gb(i.global,this.options),this.configurator.setModuleOptions(i)}void 0!==t.clickToUse?!0===t.clickToUse?void 0===this.activator&&(this.activator=new Kb(this.canvas.frame),this.activator.on("change",(function(){e.body.emitter.emit("activate")}))):(void 0!==this.activator&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}},TN.prototype._updateVisibleIndices=function(){var t=this.body.nodes,e=this.body.edges;for(var i in this.body.nodeIndices=[],this.body.edgeIndices=[],t)Object.prototype.hasOwnProperty.call(t,i)&&(this.clustering._isClusteredNode(i)||!1!==t[i].options.hidden||this.body.nodeIndices.push(t[i].id));for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=e[n],r=t[o.fromId],s=t[o.toId],a=void 0!==r&&void 0!==s;!this.clustering._isClusteredEdge(n)&&!1===o.options.hidden&&a&&!1===r.options.hidden&&!1===s.options.hidden&&this.body.edgeIndices.push(o.id)}},TN.prototype.bindEventListeners=function(){var t=this;this.body.emitter.on("_dataChanged",(function(){t.edgesHandler._updateState(),t.body.emitter.emit("_dataUpdated")})),this.body.emitter.on("_dataUpdated",(function(){t.clustering._updateState(),t._updateVisibleIndices(),t._updateValueRange(t.body.nodes),t._updateValueRange(t.body.edges),t.body.emitter.emit("startSimulation"),t.body.emitter.emit("_requestRedraw")}))},TN.prototype.setData=function(t){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),t&&t.dot&&(t.nodes||t.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(t&&t.options),t&&t.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);");var e=Dw(t.dot);this.setData(e)}else if(t&&t.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);");var i=Bw(t.gephi);this.setData(i)}else this.nodesHandler.setData(t&&t.nodes,!0),this.edgesHandler.setData(t&&t.edges,!0),this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")},TN.prototype.destroy=function(){for(var t in 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,this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&delete this.body.nodes[t];for(var e in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,e)&&delete this.body.edges[e];hb(this.body.container)},TN.prototype._updateValueRange=function(t){var e,i=void 0,n=void 0,o=0;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e].getValue();void 0!==r&&(i=void 0===i?r:Math.min(r,i),n=void 0===n?r:Math.max(r,n),o+=r)}if(void 0!==i&&void 0!==n)for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&t[e].setValueRange(i,n,o)},TN.prototype.isActive=function(){return!this.activator||this.activator.active},TN.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},TN.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},TN.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},TN.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},TN.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},TN.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},TN.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},TN.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},TN.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},TN.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},TN.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)},TN.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)},TN.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)},TN.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)},TN.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)},TN.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},TN.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},TN.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},TN.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},TN.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},TN.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},TN.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},TN.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},TN.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},TN.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},TN.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},TN.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)},TN.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},TN.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},TN.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},TN.prototype.getConnectedNodes=function(t){return void 0!==this.body.nodes[t]?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)},TN.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},TN.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},TN.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},TN.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},TN.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},TN.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},TN.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)},TN.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)},TN.prototype.getNodeAt=function(){var t=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return void 0!==t&&void 0!==t.id?t.id:t},TN.prototype.getEdgeAt=function(){var t=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return void 0!==t&&void 0!==t.id?t.id:t},TN.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},TN.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},TN.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()},TN.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},TN.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},TN.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},TN.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},TN.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},TN.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},TN.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},TN.prototype.getOptionsFromConfigurator=function(){var t={};return this.configurator&&(t=this.configurator.getOptions.apply(this.configurator)),t};var IN=Object.freeze({__proto__:null,cleanupElements:PN,drawBar:function(t,e,i,n,o,r,s,a){if(0!=n){n<0&&(e-=n*=-1);var h=DN("rect",r,s);h.setAttributeNS(null,"x",t-.5*i),h.setAttributeNS(null,"y",e),h.setAttributeNS(null,"width",i),h.setAttributeNS(null,"height",n),h.setAttributeNS(null,"class",o),a&&h.setAttributeNS(null,"style",a)}},drawPoint:function(t,e,i,n,o,r){var s;if("circle"==i.style?((s=DN("circle",n,o)).setAttributeNS(null,"cx",t),s.setAttributeNS(null,"cy",e),s.setAttributeNS(null,"r",.5*i.size)):((s=DN("rect",n,o)).setAttributeNS(null,"x",t-.5*i.size),s.setAttributeNS(null,"y",e-.5*i.size),s.setAttributeNS(null,"width",i.size),s.setAttributeNS(null,"height",i.size)),void 0!==i.styles&&s.setAttributeNS(null,"style",i.styles),s.setAttributeNS(null,"class",i.className+" vis-point"),r){var a=DN("text",n,o);r.xOffset&&(t+=r.xOffset),r.yOffset&&(e+=r.yOffset),r.content&&(a.textContent=r.content),r.className&&a.setAttributeNS(null,"class",r.className+" vis-label"),a.setAttributeNS(null,"x",t),a.setAttributeNS(null,"y",e)}return s},getDOMElement:function(t,e,i,n){var o;return Object.prototype.hasOwnProperty.call(e,t)?e[t].redundant.length>0?(o=e[t].redundant[0],e[t].redundant.shift()):(o=document.createElement(t),void 0!==n?i.insertBefore(o,n):i.appendChild(o)):(o=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==n?i.insertBefore(o,n):i.appendChild(o)),e[t].used.push(o),o},getSVGElement:DN,prepareElements:MN,resetElements:function(t){MN(t),PN(t),MN(t)}}),BN={Images:Aw,dotparser:Iw,gephiParser:Nw,allOptions:ON,convertDot:Dw,convertGephi:Bw},NN=Object.freeze({__proto__:null,DOMutil:IN,DataSet:GM,DataView:KM,Hammer:Qb,Network:TN,Queue:UM,data:QM,keycharm:NI,network:BN,util:iw});t.DOMutil=IN,t.DataSet=GM,t.DataView=KM,t.Hammer=Qb,t.Network=TN,t.Queue=UM,t.data=QM,t.default=NN,t.keycharm=NI,t.network=BN,t.util=iw,Object.defineProperty(t,"__esModule",{value:!0})})); //# sourceMappingURL=vis-network.min.js.map