/*
* @nebula.js/sn-network-chart v1.2.0
* Copyright (c) 2026 QLIK
* Released under the MIT license.
*/

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["sn-network-chart"]=e(t.stardust)}(this,function(t){"use strict";const e=["Node Identifier","Node Label","Node Parent","Node Group"],i=["Node Identifier - a field in the dataset which should be presented as a node in the network diagram. these control the actual elements presented in the network diagram.","Node Label - controls what field holds the data that described the nodes in the network diagram. The field content will be presented as label.","Node Parent - is used to determine the ancestor node for the individual nodes. This field will be used for describing the relationships between network elements.","Node Group - is a field which describes groups of a node in the network. This is used to apply the same color to several nodes."],n=["Tooltip","Node size","Edge size"];const o={version:"1.2.0",qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:7,qHeight:1400}]},showTitles:!1,title:"",subtitle:"",footnote:"",edgeType:"dynamic",displayEdgeLabel:!1,posEdgeLabel:"top",nodeShape:"dot",shadowMode:!1};
/**
   * vis-data
   * http://visjs.org/
   *
   * Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
   *
   * @version 8.0.4
   * @date    2026-05-07T14:01:00.852Z
   *
   * @copyright (c) 2011-2017 Almende B.V, http://almende.com
   * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
   *
   * @license
   * vis.js is dual licensed under both
   *
   *   1. The Apache 2.0 License
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   *   and
   *
   *   2. The MIT License
   *      http://opensource.org/licenses/MIT
   *
   * vis.js may be distributed under either license.
   */var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var a,h,d,c,l,u,f,p,g,v,m,y,b,w,_,x,E={exports:{}},O={};function S(){if(h)return a;h=1;var t=function(t){return t&&t.Math===Math&&t};return a=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof r&&r)||t("object"==typeof a&&a)||function(){return this}()||Function("return this")()}function C(){return c?d:(c=1,d=function(t){try{return!!t()}catch(t){return!0}})}function T(){return u?l:(u=1,l=!C()(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))}function k(){if(p)return f;p=1;var t=T(),e=Function.prototype,i=e.apply,n=e.call;return f="object"==typeof Reflect&&Reflect.apply||(t?n.bind(i):function(){return n.apply(i,arguments)}),f}function D(){if(v)return g;v=1;var t=T(),e=Function.prototype,i=e.call,n=t&&e.bind.bind(i,i);return g=t?n:function(t){return function(){return i.apply(t,arguments)}},g}function I(){if(y)return m;y=1;var t=D(),e=t({}.toString),i=t("".slice);return m=function(t){return i(e(t),8,-1)},m}function P(){if(w)return b;w=1;var t=I(),e=D();return b=function(i){if("Function"===t(i))return e(i)}}function M(){if(x)return _;x=1;var t="object"==typeof document&&document.all;return _=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(t){return"function"==typeof t}}var N,F,z,A,B={};function j(){return F?N:(F=1,N=!C()(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function R(){if(A)return z;A=1;var t=T(),e=Function.prototype.call;return z=t?e.bind(e):function(){return e.apply(e,arguments)},z}var L,H,W,q,V,U,Y,X,G,K,Z,Q,J,$,tt,et,it,nt,ot,rt,st,at,ht,dt,ct,lt,ut,ft,pt,gt,vt,mt,yt,bt,wt,_t,xt,Et={};function Ot(){if(L)return Et;L=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,i=e&&!t.call({1:2},1);return Et.f=i?function(t){var i=e(this,t);return!!i&&i.enumerable}:t,Et}function St(){return W?H:(W=1,H=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}})}function Ct(){if(V)return q;V=1;var t=D(),e=C(),i=I(),n=Object,o=t("".split);return q=e(function(){return!n("z").propertyIsEnumerable(0)})?function(t){return"String"===i(t)?o(t,""):n(t)}:n,q}function Tt(){return Y||(Y=1,U=function(t){return null==t}),U}function kt(){if(G)return X;G=1;var t=Tt(),e=TypeError;return X=function(i){if(t(i))throw new e("Can't call method on "+i);return i},X}function Dt(){if(Z)return K;Z=1;var t=Ct(),e=kt();return K=function(i){return t(e(i))},K}function It(){if(J)return Q;J=1;var t=M();return Q=function(e){return"object"==typeof e?null!==e:t(e)},Q}function Pt(){return tt?$:(tt=1,$={})}function Mt(){if(it)return et;it=1;var t=Pt(),e=S(),i=M(),n=function(t){return i(t)?t:void 0};return et=function(i,o){return arguments.length<2?n(t[i])||n(e[i]):t[i]&&t[i][o]||e[i]&&e[i][o]},et}function Nt(){return ot?nt:(ot=1,nt=D()({}.isPrototypeOf))}function Ft(){if(st)return rt;st=1;var t=S().navigator,e=t&&t.userAgent;return rt=e?String(e):""}function zt(){if(ht)return at;ht=1;var t,e,i=S(),n=Ft(),o=i.process,r=i.Deno,s=o&&o.versions||r&&r.version,a=s&&s.v8;return a&&(e=(t=a.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!e&&n&&(!(t=n.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=n.match(/Chrome\/(\d+)/))&&(e=+t[1]),at=e}function At(){if(ct)return dt;ct=1;var t=zt(),e=C(),i=S().String;return dt=!!Object.getOwnPropertySymbols&&!e(function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&t&&t<41}),dt}function Bt(){return ut?lt:(ut=1,lt=At()&&!Symbol.sham&&"symbol"==typeof Symbol.iterator)}function jt(){if(pt)return ft;pt=1;var t=Mt(),e=M(),i=Nt(),n=Object;return ft=Bt()?function(t){return"symbol"==typeof t}:function(o){var r=t("Symbol");return e(r)&&i(r.prototype,n(o))},ft}function Rt(){if(vt)return gt;vt=1;var t=String;return gt=function(e){try{return t(e)}catch(t){return"Object"}}}function Lt(){if(yt)return mt;yt=1;var t=M(),e=Rt(),i=TypeError;return mt=function(n){if(t(n))return n;throw new i(e(n)+" is not a function")}}function Ht(){if(wt)return bt;wt=1;var t=Lt(),e=Tt();return bt=function(i,n){var o=i[n];return e(o)?void 0:t(o)}}function Wt(){if(xt)return _t;xt=1;var t=R(),e=M(),i=It(),n=TypeError;return _t=function(o,r){var s,a;if("string"===r&&e(s=o.toString)&&!i(a=t(s,o)))return a;if(e(s=o.valueOf)&&!i(a=t(s,o)))return a;if("string"!==r&&e(s=o.toString)&&!i(a=t(s,o)))return a;throw new n("Can't convert object to primitive value")}}var qt,Vt,Ut,Yt,Xt,Gt,Kt,Zt,Qt,Jt,$t,te,ee,ie,ne,oe,re,se,ae,he,de,ce,le,ue,fe,pe,ge,ve,me={exports:{}};function ye(){return Vt?qt:(Vt=1,qt=!0)}function be(){if(Yt)return Ut;Yt=1;var t=S(),e=Object.defineProperty;return Ut=function(i,n){try{e(t,i,{value:n,configurable:!0,writable:!0})}catch(e){t[i]=n}return n}}function we(){if(Xt)return me.exports;Xt=1;var t=ye(),e=S(),i=be(),n="__core-js_shared__",o=me.exports=e[n]||i(n,{});return(o.versions||(o.versions=[])).push({version:"3.44.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.44.0/LICENSE",source:"https://github.com/zloirock/core-js"}),me.exports}function _e(){if(Kt)return Gt;Kt=1;var t=we();return Gt=function(e,i){return t[e]||(t[e]=i||{})}}function xe(){if(Qt)return Zt;Qt=1;var t=kt(),e=Object;return Zt=function(i){return e(t(i))}}function Ee(){if($t)return Jt;$t=1;var t=D(),e=xe(),i=t({}.hasOwnProperty);return Jt=Object.hasOwn||function(t,n){return i(e(t),n)},Jt}function Oe(){if(ee)return te;ee=1;var t=D(),e=0,i=Math.random(),n=t(1.1.toString);return te=function(t){return"Symbol("+(void 0===t?"":t)+")_"+n(++e+i,36)}}function Se(){if(ne)return ie;ne=1;var t=S(),e=_e(),i=Ee(),n=Oe(),o=At(),r=Bt(),s=t.Symbol,a=e("wks"),h=r?s.for||s:s&&s.withoutSetter||n;return ie=function(t){return i(a,t)||(a[t]=o&&i(s,t)?s[t]:h("Symbol."+t)),a[t]}}function Ce(){if(re)return oe;re=1;var t=R(),e=It(),i=jt(),n=Ht(),o=Wt(),r=TypeError,s=Se()("toPrimitive");return oe=function(a,h){if(!e(a)||i(a))return a;var d,c=n(a,s);if(c){if(void 0===h&&(h="default"),d=t(c,a,h),!e(d)||i(d))return d;throw new r("Can't convert object to primitive value")}return void 0===h&&(h="number"),o(a,h)}}function Te(){if(ae)return se;ae=1;var t=Ce(),e=jt();return se=function(i){var n=t(i,"string");return e(n)?n:n+""}}function ke(){if(de)return he;de=1;var t=S(),e=It(),i=t.document,n=e(i)&&e(i.createElement);return he=function(t){return n?i.createElement(t):{}},he}function De(){if(le)return ce;le=1;var t=j(),e=C(),i=ke();return ce=!t&&!e(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})}function Ie(){if(ue)return B;ue=1;var t=j(),e=R(),i=Ot(),n=St(),o=Dt(),r=Te(),s=Ee(),a=De(),h=Object.getOwnPropertyDescriptor;return B.f=t?h:function(t,d){if(t=o(t),d=r(d),a)try{return h(t,d)}catch(t){}if(s(t,d))return n(!e(i.f,t,d),t[d])},B}function Pe(){if(pe)return fe;pe=1;var t=C(),e=M(),i=/#|\.prototype\./,n=function(i,n){var h=r[o(i)];return h===a||h!==s&&(e(n)?t(n):!!n)},o=n.normalize=function(t){return String(t).replace(i,".").toLowerCase()},r=n.data={},s=n.NATIVE="N",a=n.POLYFILL="P";return fe=n}function Me(){if(ve)return ge;ve=1;var t=P(),e=Lt(),i=T(),n=t(t.bind);return ge=function(t,o){return e(t),void 0===o?t:i?n(t,o):function(){return t.apply(o,arguments)}},ge}var Ne,Fe,ze,Ae,Be,je,Re,Le,He,We,qe,Ve,Ue,Ye,Xe,Ge,Ke,Ze,Qe,Je={};function $e(){return Fe?Ne:(Fe=1,Ne=j()&&C()(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}))}function ti(){if(Ae)return ze;Ae=1;var t=It(),e=String,i=TypeError;return ze=function(n){if(t(n))return n;throw new i(e(n)+" is not an object")}}function ei(){if(Be)return Je;Be=1;var t=j(),e=De(),i=$e(),n=ti(),o=Te(),r=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,h="enumerable",d="configurable",c="writable";return Je.f=t?i?function(t,e,i){if(n(t),e=o(e),n(i),"function"==typeof t&&"prototype"===e&&"value"in i&&c in i&&!i[c]){var r=a(t,e);r&&r[c]&&(t[e]=i.value,i={configurable:d in i?i[d]:r[d],enumerable:h in i?i[h]:r[h],writable:!1})}return s(t,e,i)}:s:function(t,i,a){if(n(t),i=o(i),n(a),e)try{return s(t,i,a)}catch(t){}if("get"in a||"set"in a)throw new r("Accessors not supported");return"value"in a&&(t[i]=a.value),t},Je}function ii(){if(Re)return je;Re=1;var t=j(),e=ei(),i=St();return je=t?function(t,n,o){return e.f(t,n,i(1,o))}:function(t,e,i){return t[e]=i,t},je}function ni(){if(He)return Le;He=1;var t=S(),e=k(),i=P(),n=M(),o=Ie().f,r=Pe(),s=Pt(),a=Me(),h=ii(),d=Ee(),c=function(t){var i=function(n,o,r){if(this instanceof i){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,o)}return new t(n,o,r)}return e(t,this,arguments)};return i.prototype=t.prototype,i};return Le=function(e,l){var u,f,p,g,v,m,y,b,w,_=e.target,x=e.global,E=e.stat,O=e.proto,S=x?t:E?t[_]:t[_]&&t[_].prototype,C=x?s:s[_]||h(s,_,{})[_],T=C.prototype;for(g in l)f=!(u=r(x?g:_+(E?".":"#")+g,e.forced))&&S&&d(S,g),m=C[g],f&&(y=e.dontCallGetSet?(w=o(S,g))&&w.value:S[g]),v=f&&y?y:l[g],(u||O||typeof m!=typeof v)&&(b=e.bind&&f?a(v,t):e.wrap&&f?c(v):O&&n(v)?i(v):v,(e.sham||v&&v.sham||m&&m.sham)&&h(b,"sham",!0),h(C,g,b),O&&(d(s,p=_+"Prototype")||h(s,p,{}),h(s[p],g,v),e.real&&T&&(u||!T[g])&&h(T,g,v)))}}function oi(){if(We)return O;We=1;var t=ni(),e=j(),i=ei().f;return t({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!e},{defineProperty:i}),O}function ri(){if(qe)return E.exports;qe=1,oi();var t=Pt().Object,e=E.exports=function(e,i,n){return t.defineProperty(e,i,n)};return t.defineProperty.sham&&(e.sham=!0),E.exports}function si(){return Ue?Ve:(Ue=1,Ve=ri())}function ai(){return Xe?Ye:(Xe=1,Ye=si())}function hi(){return Ke?Ge:(Ke=1,Ge=ai())}function di(){return Qe?Ze:(Qe=1,Ze=hi())}var ci,li,ui,fi,pi,gi,vi,mi,yi,bi,wi,_i,xi,Ei,Oi,Si,Ci,Ti,ki,Di,Ii,Pi,Mi,Ni,Fi,zi,Ai,Bi,ji,Ri=s(di()),Li={};function Hi(){if(li)return ci;li=1;var t=I();return ci=Array.isArray||function(e){return"Array"===t(e)}}function Wi(){if(fi)return ui;fi=1;var t=Math.ceil,e=Math.floor;return ui=Math.trunc||function(i){var n=+i;return(n>0?e:t)(n)}}function qi(){if(gi)return pi;gi=1;var t=Wi();return pi=function(e){var i=+e;return i!=i||0===i?0:t(i)},pi}function Vi(){if(mi)return vi;mi=1;var t=qi(),e=Math.min;return vi=function(i){var n=t(i);return n>0?e(n,9007199254740991):0}}function Ui(){if(bi)return yi;bi=1;var t=Vi();return yi=function(e){return t(e.length)}}function Yi(){if(_i)return wi;_i=1;var t=TypeError;return wi=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e},wi}function Xi(){if(Ei)return xi;Ei=1;var t=j(),e=ei(),i=St();return xi=function(n,o,r){t?e.f(n,o,i(0,r)):n[o]=r},xi}function Gi(){if(Si)return Oi;Si=1;var t={};return t[Se()("toStringTag")]="z",Oi="[object z]"===String(t)}function Ki(){if(Ti)return Ci;Ti=1;var t=Gi(),e=M(),i=I(),n=Se()("toStringTag"),o=Object,r="Arguments"===i(function(){return arguments}());return Ci=t?i:function(t){var s,a,h;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(a=function(t,e){try{return t[e]}catch(t){}}(s=o(t),n))?a:r?i(s):"Object"===(h=i(s))&&e(s.callee)?"Arguments":h},Ci}function Zi(){if(Di)return ki;Di=1;var t=D(),e=M(),i=we(),n=t(Function.toString);return e(i.inspectSource)||(i.inspectSource=function(t){return n(t)}),ki=i.inspectSource}function Qi(){if(Pi)return Ii;Pi=1;var t=D(),e=C(),i=M(),n=Ki(),o=Mt(),r=Zi(),s=function(){},a=o("Reflect","construct"),h=/^\s*(?:class|function)\b/,d=t(h.exec),c=!h.test(s),l=function(t){if(!i(t))return!1;try{return a(s,[],t),!0}catch(t){return!1}},u=function(t){if(!i(t))return!1;switch(n(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return c||!!d(h,r(t))}catch(t){return!0}};return u.sham=!0,Ii=!a||e(function(){var t;return l(l.call)||!l(Object)||!l(function(){t=!0})||t})?u:l}function Ji(){if(Ni)return Mi;Ni=1;var t=Hi(),e=Qi(),i=It(),n=Se()("species"),o=Array;return Mi=function(r){var s;return t(r)&&(s=r.constructor,(e(s)&&(s===o||t(s.prototype))||i(s)&&null===(s=s[n]))&&(s=void 0)),void 0===s?o:s}}function $i(){if(zi)return Fi;zi=1;var t=Ji();return Fi=function(e,i){return new(t(e))(0===i?0:i)}}function tn(){if(Bi)return Ai;Bi=1;var t=C(),e=Se(),i=zt(),n=e("species");return Ai=function(e){return i>=51||!t(function(){var t=[];return(t.constructor={})[n]=function(){return{foo:1}},1!==t[e](Boolean).foo})},Ai}function en(){if(ji)return Li;ji=1;var t=ni(),e=C(),i=Hi(),n=It(),o=xe(),r=Ui(),s=Yi(),a=Xi(),h=$i(),d=tn(),c=Se(),l=zt(),u=c("isConcatSpreadable"),f=l>=51||!e(function(){var t=[];return t[u]=!1,t.concat()[0]!==t}),p=function(t){if(!n(t))return!1;var e=t[u];return void 0!==e?!!e:i(t)};return t({target:"Array",proto:!0,arity:1,forced:!f||!d("concat")},{concat:function(t){var e,i,n,d,c,l=o(this),u=h(l,0),f=0;for(e=-1,n=arguments.length;e<n;e++)if(p(c=-1===e?l:arguments[e]))for(d=r(c),s(f+d),i=0;i<d;i++,f++)i in c&&a(u,f,c[i]);else s(f+1),a(u,f++,c);return u.length=f,u}}),Li}var nn,on,rn={},sn={};function an(){if(on)return nn;on=1;var t=Ki(),e=String;return nn=function(i){if("Symbol"===t(i))throw new TypeError("Cannot convert a Symbol value to a string");return e(i)}}var hn,dn,cn,ln,un,fn,pn,gn,vn,mn,yn,bn,wn,_n,xn,En,On,Sn,Cn,Tn={};function kn(){if(dn)return hn;dn=1;var t=qi(),e=Math.max,i=Math.min;return hn=function(n,o){var r=t(n);return r<0?e(r+o,0):i(r,o)},hn}function Dn(){if(ln)return cn;ln=1;var t=Dt(),e=kn(),i=Ui(),n=function(n){return function(o,r,s){var a=t(o),h=i(a);if(0===h)return!n&&-1;var d,c=e(s,h);if(n&&r!=r){for(;h>c;)if((d=a[c++])!=d)return!0}else for(;h>c;c++)if((n||c in a)&&a[c]===r)return n||c||0;return!n&&-1}};return cn={includes:n(!0),indexOf:n(!1)}}function In(){return fn?un:(fn=1,un={})}function Pn(){if(gn)return pn;gn=1;var t=D(),e=Ee(),i=Dt(),n=Dn().indexOf,o=In(),r=t([].push);return pn=function(t,s){var a,h=i(t),d=0,c=[];for(a in h)!e(o,a)&&e(h,a)&&r(c,a);for(;s.length>d;)e(h,a=s[d++])&&(~n(c,a)||r(c,a));return c},pn}function Mn(){return mn?vn:(mn=1,vn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}function Nn(){if(bn)return yn;bn=1;var t=Pn(),e=Mn();return yn=Object.keys||function(i){return t(i,e)}}function Fn(){if(wn)return Tn;wn=1;var t=j(),e=$e(),i=ei(),n=ti(),o=Dt(),r=Nn();return Tn.f=t&&!e?Object.defineProperties:function(t,e){n(t);for(var s,a=o(e),h=r(e),d=h.length,c=0;d>c;)i.f(t,s=h[c++],a[s]);return t},Tn}function zn(){return xn?_n:(xn=1,_n=Mt()("document","documentElement"))}function An(){if(On)return En;On=1;var t=_e(),e=Oe(),i=t("keys");return En=function(t){return i[t]||(i[t]=e(t))}}function Bn(){if(Cn)return Sn;Cn=1;var t,e=ti(),i=Fn(),n=Mn(),o=In(),r=zn(),s=ke(),a="prototype",h="script",d=An()("IE_PROTO"),c=function(){},l=function(t){return"<"+h+">"+t+"</"+h+">"},u=function(t){t.write(l("")),t.close();var e=t.parentWindow.Object;return t=null,e},f=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var e,i,o;f="undefined"!=typeof document?document.domain&&t?u(t):(i=s("iframe"),o="java"+h+":",i.style.display="none",r.appendChild(i),i.src=String(o),(e=i.contentWindow.document).open(),e.write(l("document.F=Object")),e.close(),e.F):u(t);for(var d=n.length;d--;)delete f[a][n[d]];return f()};return o[d]=!0,Sn=Object.create||function(t,n){var o;return null!==t?(c[a]=e(t),o=new c,c[a]=null,o[d]=t):o=f(),void 0===n?o:i.f(o,n)}}var jn,Rn={};function Ln(){if(jn)return Rn;jn=1;var t=Pn(),e=Mn().concat("length","prototype");return Rn.f=Object.getOwnPropertyNames||function(i){return t(i,e)},Rn}var Hn,Wn,qn,Vn={};function Un(){return Wn?Hn:(Wn=1,Hn=D()([].slice))}function Yn(){if(qn)return Vn;qn=1;var t=I(),e=Dt(),i=Ln().f,n=Un(),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];return Vn.f=function(r){return o&&"Window"===t(r)?function(t){try{return i(t)}catch(t){return n(o)}}(r):i(e(r))},Vn}var Xn,Gn,Kn,Zn,Qn,Jn={};function $n(){return Xn||(Xn=1,Jn.f=Object.getOwnPropertySymbols),Jn}function to(){if(Kn)return Gn;Kn=1;var t=ii();return Gn=function(e,i,n,o){return o&&o.enumerable?e[i]=n:t(e,i,n),e}}function eo(){if(Qn)return Zn;Qn=1;var t=ei();return Zn=function(e,i,n){return t.f(e,i,n)}}var io,no,oo,ro,so,ao,ho,co,lo,uo,fo,po,go,vo,mo,yo,bo={};function wo(){if(io)return bo;io=1;var t=Se();return bo.f=t,bo}function _o(){if(oo)return no;oo=1;var t=Pt(),e=Ee(),i=wo(),n=ei().f;return no=function(o){var r=t.Symbol||(t.Symbol={});e(r,o)||n(r,o,{value:i.f(o)})}}function xo(){if(so)return ro;so=1;var t=R(),e=Mt(),i=Se(),n=to();return ro=function(){var o=e("Symbol"),r=o&&o.prototype,s=r&&r.valueOf,a=i("toPrimitive");r&&!r[a]&&n(r,a,function(e){return t(s,this)},{arity:1})}}function Eo(){if(ho)return ao;ho=1;var t=Gi(),e=Ki();return ao=t?{}.toString:function(){return"[object "+e(this)+"]"}}function Oo(){if(lo)return co;lo=1;var t=Gi(),e=ei().f,i=ii(),n=Ee(),o=Eo(),r=Se()("toStringTag");return co=function(s,a,h,d){var c=h?s:s&&s.prototype;c&&(n(c,r)||e(c,r,{configurable:!0,value:a}),d&&!t&&i(c,"toString",o))},co}function So(){if(fo)return uo;fo=1;var t=S(),e=M(),i=t.WeakMap;return uo=e(i)&&/native code/.test(String(i))}function Co(){if(go)return po;go=1;var t,e,i,n=So(),o=S(),r=It(),s=ii(),a=Ee(),h=we(),d=An(),c=In(),l="Object already initialized",u=o.TypeError,f=o.WeakMap;if(n||h.state){var p=h.state||(h.state=new f);p.get=p.get,p.has=p.has,p.set=p.set,t=function(t,e){if(p.has(t))throw new u(l);return e.facade=t,p.set(t,e),e},e=function(t){return p.get(t)||{}},i=function(t){return p.has(t)}}else{var g=d("state");c[g]=!0,t=function(t,e){if(a(t,g))throw new u(l);return e.facade=t,s(t,g,e),e},e=function(t){return a(t,g)?t[g]:{}},i=function(t){return a(t,g)}}return po={set:t,get:e,has:i,enforce:function(n){return i(n)?e(n):t(n,{})},getterFor:function(t){return function(i){var n;if(!r(i)||(n=e(i)).type!==t)throw new u("Incompatible receiver, "+t+" required");return n}}},po}function To(){if(mo)return vo;mo=1;var t=Me(),e=D(),i=Ct(),n=xe(),o=Ui(),r=$i(),s=e([].push),a=function(e){var a=1===e,h=2===e,d=3===e,c=4===e,l=6===e,u=7===e,f=5===e||l;return function(p,g,v,m){for(var y,b,w=n(p),_=i(w),x=o(_),E=t(g,v),O=0,S=m||r,C=a?S(p,x):h||u?S(p,0):void 0;x>O;O++)if((f||O in _)&&(b=E(y=_[O],O,w),e))if(a)C[O]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return O;case 2:s(C,y)}else switch(e){case 4:return!1;case 7:s(C,y)}return l?-1:d||c?c:C}};return vo={forEach:a(0),map:a(1),filter:a(2),some:a(3),every:a(4),find:a(5),findIndex:a(6),filterReject:a(7)}}var ko,Do,Io,Po={};function Mo(){return Do?ko:(Do=1,ko=At()&&!!Symbol.for&&!!Symbol.keyFor)}var No,Fo={};var zo,Ao,Bo,jo={};function Ro(){if(Ao)return zo;Ao=1;var t=D(),e=Hi(),i=M(),n=I(),o=an(),r=t([].push);return zo=function(t){if(i(t))return t;if(e(t)){for(var s=t.length,a=[],h=0;h<s;h++){var d=t[h];"string"==typeof d?r(a,d):"number"!=typeof d&&"Number"!==n(d)&&"String"!==n(d)||r(a,o(d))}var c=a.length,l=!0;return function(t,i){if(l)return l=!1,i;if(e(this))return i;for(var n=0;n<c;n++)if(a[n]===t)return i}}},zo}function Lo(){if(Bo)return jo;Bo=1;var t=ni(),e=Mt(),i=k(),n=R(),o=D(),r=C(),s=M(),a=jt(),h=Un(),d=Ro(),c=At(),l=String,u=e("JSON","stringify"),f=o(/./.exec),p=o("".charAt),g=o("".charCodeAt),v=o("".replace),m=o(1.1.toString),y=/[\uD800-\uDFFF]/g,b=/^[\uD800-\uDBFF]$/,w=/^[\uDC00-\uDFFF]$/,_=!c||r(function(){var t=e("Symbol")("stringify detection");return"[null]"!==u([t])||"{}"!==u({a:t})||"{}"!==u(Object(t))}),x=r(function(){return'"\\udf06\\ud834"'!==u("\udf06\ud834")||'"\\udead"'!==u("\udead")}),E=function(t,e){var o=h(arguments),r=d(e);if(s(r)||void 0!==t&&!a(t))return o[1]=function(t,e){if(s(r)&&(e=n(r,this,l(t),e)),!a(e))return e},i(u,null,o)},O=function(t,e,i){var n=p(i,e-1),o=p(i,e+1);return f(b,t)&&!f(w,o)||f(w,t)&&!f(b,n)?"\\u"+m(g(t,0),16):t};return u&&t({target:"JSON",stat:!0,arity:3,forced:_||x},{stringify:function(t,e,n){var o=h(arguments),r=i(_?E:u,null,o);return x&&"string"==typeof r?v(r,y,O):r}}),jo}var Ho,Wo,qo={};function Vo(){return Wo||(Wo=1,function(){if(yo)return sn;yo=1;var t=ni(),e=S(),i=R(),n=D(),o=ye(),r=j(),s=At(),a=C(),h=Ee(),d=Nt(),c=ti(),l=Dt(),u=Te(),f=an(),p=St(),g=Bn(),v=Nn(),m=Ln(),y=Yn(),b=$n(),w=Ie(),_=ei(),x=Fn(),E=Ot(),O=to(),T=eo(),k=_e(),I=An(),P=In(),M=Oe(),N=Se(),F=wo(),z=_o(),A=xo(),B=Oo(),L=Co(),H=To().forEach,W=I("hidden"),q="Symbol",V="prototype",U=L.set,Y=L.getterFor(q),X=Object[V],G=e.Symbol,K=G&&G[V],Z=e.RangeError,Q=e.TypeError,J=e.QObject,$=w.f,tt=_.f,et=y.f,it=E.f,nt=n([].push),ot=k("symbols"),rt=k("op-symbols"),st=k("wks"),at=!J||!J[V]||!J[V].findChild,ht=function(t,e,i){var n=$(X,e);n&&delete X[e],tt(t,e,i),n&&t!==X&&tt(X,e,n)},dt=r&&a(function(){return 7!==g(tt({},"a",{get:function(){return tt(this,"a",{value:7}).a}})).a})?ht:tt,ct=function(t,e){var i=ot[t]=g(K);return U(i,{type:q,tag:t,description:e}),r||(i.description=e),i},lt=function(t,e,i){t===X&&lt(rt,e,i),c(t);var n=u(e);return c(i),h(ot,n)?(i.enumerable?(h(t,W)&&t[W][n]&&(t[W][n]=!1),i=g(i,{enumerable:p(0,!1)})):(h(t,W)||tt(t,W,p(1,g(null))),t[W][n]=!0),dt(t,n,i)):tt(t,n,i)},ut=function(t,e){c(t);var n=l(e),o=v(n).concat(vt(n));return H(o,function(e){r&&!i(ft,n,e)||lt(t,e,n[e])}),t},ft=function(t){var e=u(t),n=i(it,this,e);return!(this===X&&h(ot,e)&&!h(rt,e))&&(!(n||!h(this,e)||!h(ot,e)||h(this,W)&&this[W][e])||n)},pt=function(t,e){var i=l(t),n=u(e);if(i!==X||!h(ot,n)||h(rt,n)){var o=$(i,n);return!o||!h(ot,n)||h(i,W)&&i[W][n]||(o.enumerable=!0),o}},gt=function(t){var e=et(l(t)),i=[];return H(e,function(t){h(ot,t)||h(P,t)||nt(i,t)}),i},vt=function(t){var e=t===X,i=et(e?rt:l(t)),n=[];return H(i,function(t){!h(ot,t)||e&&!h(X,t)||nt(n,ot[t])}),n};s||(G=function(){if(d(K,this))throw new Q("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?f(arguments[0]):void 0,n=M(t),o=function(t){var r=void 0===this?e:this;r===X&&i(o,rt,t),h(r,W)&&h(r[W],n)&&(r[W][n]=!1);var s=p(1,t);try{dt(r,n,s)}catch(t){if(!(t instanceof Z))throw t;ht(r,n,s)}};return r&&at&&dt(X,n,{configurable:!0,set:o}),ct(n,t)},O(K=G[V],"toString",function(){return Y(this).tag}),O(G,"withoutSetter",function(t){return ct(M(t),t)}),E.f=ft,_.f=lt,x.f=ut,w.f=pt,m.f=y.f=gt,b.f=vt,F.f=function(t){return ct(N(t),t)},r&&(T(K,"description",{configurable:!0,get:function(){return Y(this).description}}),o||O(X,"propertyIsEnumerable",ft,{unsafe:!0}))),t({global:!0,constructor:!0,wrap:!0,forced:!s,sham:!s},{Symbol:G}),H(v(st),function(t){z(t)}),t({target:q,stat:!0,forced:!s},{useSetter:function(){at=!0},useSimple:function(){at=!1}}),t({target:"Object",stat:!0,forced:!s,sham:!r},{create:function(t,e){return void 0===e?g(t):ut(g(t),e)},defineProperty:lt,defineProperties:ut,getOwnPropertyDescriptor:pt}),t({target:"Object",stat:!0,forced:!s},{getOwnPropertyNames:gt}),A(),B(G,q),P[W]=!0}(),function(){if(Io)return Po;Io=1;var t=ni(),e=Mt(),i=Ee(),n=an(),o=_e(),r=Mo(),s=o("string-to-symbol-registry"),a=o("symbol-to-string-registry");t({target:"Symbol",stat:!0,forced:!r},{for:function(t){var o=n(t);if(i(s,o))return s[o];var r=e("Symbol")(o);return s[o]=r,a[r]=o,r}})}(),function(){if(No)return Fo;No=1;var t=ni(),e=Ee(),i=jt(),n=Rt(),o=_e(),r=Mo(),s=o("symbol-to-string-registry");t({target:"Symbol",stat:!0,forced:!r},{keyFor:function(t){if(!i(t))throw new TypeError(n(t)+" is not a symbol");if(e(s,t))return s[t]}})}(),Lo(),function(){if(Ho)return qo;Ho=1;var t=ni(),e=At(),i=C(),n=$n(),o=xe();t({target:"Object",stat:!0,forced:!e||i(function(){n.f(1)})},{getOwnPropertySymbols:function(t){var e=n.f;return e?e(o(t)):[]}})}()),rn}var Uo,Yo={};function Xo(){return Uo||(Uo=1,_o()("asyncDispose")),Yo}var Go;var Ko,Zo={};function Qo(){return Ko||(Ko=1,_o()("dispose")),Zo}var Jo;var $o;var tr,er={};function ir(){return tr||(tr=1,_o()("iterator")),er}var nr;var or;var rr;var sr;var ar;var hr;var dr,cr={};function lr(){if(dr)return cr;dr=1;var t=_o(),e=xo();return t("toPrimitive"),e(),cr}var ur,fr={};var pr;var gr,vr,mr,yr={};function br(){return mr?vr:(mr=1,en(),Vo(),Xo(),Go||(Go=1,_o()("asyncIterator")),Qo(),Jo||(Jo=1,_o()("hasInstance")),$o||($o=1,_o()("isConcatSpreadable")),ir(),nr||(nr=1,_o()("match")),or||(or=1,_o()("matchAll")),rr||(rr=1,_o()("replace")),sr||(sr=1,_o()("search")),ar||(ar=1,_o()("species")),hr||(hr=1,_o()("split")),lr(),function(){if(ur)return fr;ur=1;var t=Mt(),e=_o(),i=Oo();e("toStringTag"),i(t("Symbol"),"Symbol")}(),pr||(pr=1,_o()("unscopables")),function(){if(gr)return yr;gr=1;var t=S();Oo()(t.JSON,"JSON",!0)}(),vr=Pt().Symbol)}var wr,_r,xr,Er,Or,Sr,Cr,Tr,kr,Dr,Ir,Pr,Mr,Nr,Fr,zr,Ar,Br,jr,Rr,Lr,Hr,Wr,qr,Vr,Ur,Yr,Xr,Gr,Kr,Zr,Qr,Jr,$r={};function ts(){return _r?wr:(_r=1,wr=function(){})}function es(){return Er?xr:(Er=1,xr={})}function is(){if(Sr)return Or;Sr=1;var t=j(),e=Ee(),i=Function.prototype,n=t&&Object.getOwnPropertyDescriptor,o=e(i,"name"),r=o&&"something"===function(){}.name,s=o&&(!t||t&&n(i,"name").configurable);return Or={EXISTS:o,PROPER:r,CONFIGURABLE:s}}function ns(){return Tr?Cr:(Tr=1,Cr=!C()(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))}function os(){if(Dr)return kr;Dr=1;var t=Ee(),e=M(),i=xe(),n=An(),o=ns(),r=n("IE_PROTO"),s=Object,a=s.prototype;return kr=o?s.getPrototypeOf:function(n){var o=i(n);if(t(o,r))return o[r];var h=o.constructor;return e(h)&&o instanceof h?h.prototype:o instanceof s?a:null},kr}function rs(){if(Pr)return Ir;Pr=1;var t,e,i,n=C(),o=M(),r=It(),s=Bn(),a=os(),h=to(),d=Se(),c=ye(),l=d("iterator"),u=!1;return[].keys&&("next"in(i=[].keys())?(e=a(a(i)))!==Object.prototype&&(t=e):u=!0),!r(t)||n(function(){var e={};return t[l].call(e)!==e})?t={}:c&&(t=s(t)),o(t[l])||h(t,l,function(){return this}),Ir={IteratorPrototype:t,BUGGY_SAFARI_ITERATORS:u}}function ss(){if(Nr)return Mr;Nr=1;var t=rs().IteratorPrototype,e=Bn(),i=St(),n=Oo(),o=es(),r=function(){return this};return Mr=function(s,a,h,d){var c=a+" Iterator";return s.prototype=e(t,{next:i(+!d,h)}),n(s,c,!1,!0),o[c]=r,s},Mr}function as(){if(zr)return Fr;zr=1;var t=D(),e=Lt();return Fr=function(i,n,o){try{return t(e(Object.getOwnPropertyDescriptor(i,n)[o]))}catch(t){}},Fr}function hs(){if(Br)return Ar;Br=1;var t=It();return Ar=function(e){return t(e)||null===e}}function ds(){if(Rr)return jr;Rr=1;var t=hs(),e=String,i=TypeError;return jr=function(n){if(t(n))return n;throw new i("Can't set "+e(n)+" as a prototype")}}function cs(){if(Hr)return Lr;Hr=1;var t=as(),e=It(),i=kt(),n=ds();return Lr=Object.setPrototypeOf||("__proto__"in{}?function(){var o,r=!1,s={};try{(o=t(Object.prototype,"__proto__","set"))(s,[]),r=s instanceof Array}catch(t){}return function(t,s){return i(t),n(s),e(t)?(r?o(t,s):t.__proto__=s,t):t}}():void 0)}function ls(){if(qr)return Wr;qr=1;var t=ni(),e=R(),i=ye(),n=is(),o=M(),r=ss(),s=os(),a=cs(),h=Oo(),d=ii(),c=to(),l=Se(),u=es(),f=rs(),p=n.PROPER,g=n.CONFIGURABLE,v=f.IteratorPrototype,m=f.BUGGY_SAFARI_ITERATORS,y=l("iterator"),b="keys",w="values",_="entries",x=function(){return this};return Wr=function(n,l,f,E,O,S,C){r(f,l,E);var T,k,D,I=function(t){if(t===O&&z)return z;if(!m&&t&&t in N)return N[t];switch(t){case b:case w:case _:return function(){return new f(this,t)}}return function(){return new f(this)}},P=l+" Iterator",M=!1,N=n.prototype,F=N[y]||N["@@iterator"]||O&&N[O],z=!m&&F||I(O),A="Array"===l&&N.entries||F;if(A&&(T=s(A.call(new n)))!==Object.prototype&&T.next&&(i||s(T)===v||(a?a(T,v):o(T[y])||c(T,y,x)),h(T,P,!0,!0),i&&(u[P]=x)),p&&O===w&&F&&F.name!==w&&(!i&&g?d(N,"name",w):(M=!0,z=function(){return e(F,this)})),O)if(k={values:I(w),keys:S?z:I(b),entries:I(_)},C)for(D in k)(m||M||!(D in N))&&c(N,D,k[D]);else t({target:l,proto:!0,forced:m||M},k);return i&&!C||N[y]===z||c(N,y,z,{name:O}),u[l]=z,k},Wr}function us(){return Ur?Vr:(Ur=1,Vr=function(t,e){return{value:t,done:e}})}function fs(){if(Xr)return Yr;Xr=1;var t=Dt(),e=ts(),i=es(),n=Co(),o=ei().f,r=ls(),s=us(),a=ye(),h=j(),d="Array Iterator",c=n.set,l=n.getterFor(d);Yr=r(Array,"Array",function(e,i){c(this,{type:d,target:t(e),index:0,kind:i})},function(){var t=l(this),e=t.target,i=t.index++;if(!e||i>=e.length)return t.target=null,s(void 0,!0);switch(t.kind){case"keys":return s(i,!1);case"values":return s(e[i],!1)}return s([i,e[i]],!1)},"values");var u=i.Arguments=i.Array;if(e("keys"),e("values"),e("entries"),!a&&h&&"values"!==u.name)try{o(u,"name",{value:"values"})}catch(t){}return Yr}function ps(){return Kr?Gr:(Kr=1,Gr={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})}function gs(){if(Zr)return $r;Zr=1,fs();var t=ps(),e=S(),i=Oo(),n=es();for(var o in t)i(e[o],o),n[o]=n.Array;return $r}function vs(){if(Jr)return Qr;Jr=1;var t=br();return gs(),Qr=t}var ms,ys={};var bs;var ws;var _s,xs,Es;function Os(){if(Es)return xs;Es=1;var t=vs();return function(){if(ms)return ys;ms=1;var t=Se(),e=ei().f,i=t("metadata"),n=Function.prototype;void 0===n[i]&&e(n,i,{value:null})}(),bs||(bs=1,Xo()),ws||(ws=1,Qo()),_s||(_s=1,_o()("metadata")),xs=t}var Ss,Cs,Ts;function ks(){if(Cs)return Ss;Cs=1;var t=Mt(),e=D(),i=t("Symbol"),n=i.keyFor,o=e(i.prototype.valueOf);return Ss=i.isRegisteredSymbol||function(t){try{return void 0!==n(o(t))}catch(t){return!1}}}var Ds,Is,Ps;function Ms(){if(Is)return Ds;Is=1;for(var t=_e(),e=Mt(),i=D(),n=jt(),o=Se(),r=e("Symbol"),s=r.isWellKnownSymbol,a=e("Object","getOwnPropertyNames"),h=i(r.prototype.valueOf),d=t("wks"),c=0,l=a(r),u=l.length;c<u;c++)try{var f=l[c];n(r[f])&&o(f)}catch(t){}return Ds=function(t){if(s&&s(t))return!0;try{for(var e=h(t),i=0,n=a(d),o=n.length;i<o;i++)if(d[n[i]]==e)return!0}catch(t){}return!1},Ds}var Ns;var Fs;var zs;var As;var Bs;var js;var Rs;var Ls,Hs,Ws,qs,Vs;function Us(){if(Ws)return Hs;Ws=1;var t=Os();return Ts||(Ts=1,ni()({target:"Symbol",stat:!0},{isRegisteredSymbol:ks()})),Ps||(Ps=1,ni()({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:Ms()})),Ns||(Ns=1,_o()("customMatcher")),Fs||(Fs=1,_o()("observable")),zs||(zs=1,ni()({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:ks()})),As||(As=1,ni()({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:Ms()})),Bs||(Bs=1,_o()("matcher")),js||(js=1,_o()("metadataKey")),Rs||(Rs=1,_o()("patternMatch")),Ls||(Ls=1,_o()("replaceAll")),Hs=t}function Ys(){return Vs?qs:(Vs=1,qs=Us())}var Xs,Gs,Ks,Zs,Qs,Js,$s,ta,ea,ia,na,oa,ra,sa=s(Ys()),aa={};function ha(){if(Gs)return Xs;Gs=1;var t=D(),e=qi(),i=an(),n=kt(),o=t("".charAt),r=t("".charCodeAt),s=t("".slice),a=function(t){return function(a,h){var d,c,l=i(n(a)),u=e(h),f=l.length;return u<0||u>=f?t?"":void 0:(d=r(l,u))<55296||d>56319||u+1===f||(c=r(l,u+1))<56320||c>57343?t?o(l,u):d:t?s(l,u,u+2):c-56320+(d-55296<<10)+65536}};return Xs={codeAt:a(!1),charAt:a(!0)}}function da(){if(Ks)return aa;Ks=1;var t=ha().charAt,e=an(),i=Co(),n=ls(),o=us(),r="String Iterator",s=i.set,a=i.getterFor(r);return n(String,"String",function(t){s(this,{type:r,string:e(t),index:0})},function(){var e,i=a(this),n=i.string,r=i.index;return r>=n.length?o(void 0,!0):(e=t(n,r),i.index+=e.length,o(e,!1))}),aa}function ca(){return Qs?Zs:(Qs=1,fs(),da(),ir(),Zs=wo().f("iterator"))}function la(){if($s)return Js;$s=1;var t=ca();return gs(),Js=t}function ua(){return ea?ta:(ea=1,ta=la())}function fa(){return na?ia:(na=1,ia=ua())}function pa(){return ra?oa:(ra=1,oa=fa())}var ga,va,ma,ya,ba,wa,_a,xa,Ea,Oa,Sa=s(pa());function Ca(t){return Ca="function"==typeof sa&&"symbol"==typeof Sa?function(t){return typeof t}:function(t){return t&&"function"==typeof sa&&t.constructor===sa&&t!==sa.prototype?"symbol":typeof t},Ca(t)}function Ta(){return va?ga:(va=1,lr(),ga=wo().f("toPrimitive"))}function ka(){return ya?ma:(ya=1,ma=Ta())}function Da(){return wa?ba:(wa=1,ba=ka())}function Ia(){return xa?_a:(xa=1,_a=Da())}function Pa(){return Oa?Ea:(Oa=1,Ea=Ia())}var Ma=s(Pa());function Na(t){var e=function(t,e){if("object"!=Ca(t)||!t)return t;var i=t[Ma];if(void 0!==i){var n=i.call(t,e);if("object"!=Ca(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ca(e)?e:e+""}function Fa(t,e,i){return(e=Na(e))in t?Ri(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var za,Aa,Ba,ja,Ra,La,Ha,Wa,qa,Va,Ua,Ya,Xa,Ga={};function Ka(){if(Aa)return za;Aa=1;var t=D(),e=Lt(),i=It(),n=Ee(),o=Un(),r=T(),s=Function,a=t([].concat),h=t([].join),d={};return za=r?s.bind:function(t){var r=e(this),c=r.prototype,l=o(arguments,1),u=function(){var e=a(l,o(arguments));return this instanceof u?function(t,e,i){if(!n(d,e)){for(var o=[],r=0;r<e;r++)o[r]="a["+r+"]";d[e]=s("C,a","return new C("+h(o,",")+")")}return d[e](t,i)}(r,e.length,e):r.apply(t,e)};return i(c)&&(u.prototype=c),u},za}function Za(){if(Ra)return ja;Ra=1;var t=S(),e=Pt();return ja=function(i,n){var o=e[i+"Prototype"],r=o&&o[n];if(r)return r;var s=t[i],a=s&&s.prototype;return a&&a[n]}}function Qa(){return Ha?La:(Ha=1,function(){if(Ba)return Ga;Ba=1;var t=ni(),e=Ka();t({target:"Function",proto:!0,forced:Function.bind!==e},{bind:e})}(),La=Za()("Function","bind"))}function Ja(){if(qa)return Wa;qa=1;var t=Nt(),e=Qa(),i=Function.prototype;return Wa=function(n){var o=n.bind;return n===i||t(i,n)&&o===i.bind?e:o},Wa}function $a(){return Ua?Va:(Ua=1,Va=Ja())}var th,eh,ih,nh,oh,rh,sh,ah,hh,dh,ch,lh,uh,fh,ph,gh,vh,mh=s(Xa?Ya:(Xa=1,Ya=$a())),yh={};function bh(){if(eh)return th;eh=1;var t=Lt(),e=xe(),i=Ct(),n=Ui(),o=TypeError,r="Reduce of empty array with no initial value",s=function(s){return function(a,h,d,c){var l=e(a),u=i(l),f=n(l);if(t(h),0===f&&d<2)throw new o(r);var p=s?f-1:0,g=s?-1:1;if(d<2)for(;;){if(p in u){c=u[p],p+=g;break}if(p+=g,s?p<0:f<=p)throw new o(r)}for(;s?p>=0:f>p;p+=g)p in u&&(c=h(c,u[p],p,l));return c}};return th={left:s(!1),right:s(!0)}}function wh(){if(nh)return ih;nh=1;var t=C();return ih=function(e,i){var n=[][e];return!!n&&t(function(){n.call(null,i||function(){return 1},1)})}}function _h(){if(rh)return oh;rh=1;var t=S(),e=Ft(),i=I(),n=function(t){return e.slice(0,t.length)===t};return oh=n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":t.Bun&&"string"==typeof Bun.version?"BUN":t.Deno&&"object"==typeof Deno.version?"DENO":"process"===i(t.process)?"NODE":t.window&&t.document?"BROWSER":"REST"}function xh(){return ah?sh:(ah=1,sh="NODE"===_h())}function Eh(){return ch?dh:(ch=1,function(){if(hh)return yh;hh=1;var t=ni(),e=bh().left,i=wh(),n=zt();t({target:"Array",proto:!0,forced:!xh()&&n>79&&n<83||!i("reduce")},{reduce:function(t){var i=arguments.length;return e(this,t,i,i>1?arguments[1]:void 0)}})}(),dh=Za()("Array","reduce"))}function Oh(){if(uh)return lh;uh=1;var t=Nt(),e=Eh(),i=Array.prototype;return lh=function(n){var o=n.reduce;return n===i||t(i,n)&&o===i.reduce?e:o},lh}function Sh(){return ph?fh:(ph=1,fh=Oh())}var Ch,Th,kh,Dh,Ih,Ph,Mh,Nh,Fh,zh=s(vh?gh:(vh=1,gh=Sh())),Ah={};function Bh(){return kh?Th:(kh=1,function(){if(Ch)return Ah;Ch=1;var t=ni(),e=To().filter;t({target:"Array",proto:!0,forced:!tn()("filter")},{filter:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}})}(),Th=Za()("Array","filter"))}function jh(){if(Ih)return Dh;Ih=1;var t=Nt(),e=Bh(),i=Array.prototype;return Dh=function(n){var o=n.filter;return n===i||t(i,n)&&o===i.filter?e:o},Dh}function Rh(){return Mh?Ph:(Mh=1,Ph=jh())}var Lh,Hh,Wh,qh,Vh,Uh,Yh,Xh,Gh,Kh=s(Fh?Nh:(Fh=1,Nh=Rh())),Zh={};function Qh(){return Wh?Hh:(Wh=1,function(){if(Lh)return Zh;Lh=1;var t=ni(),e=To().map;t({target:"Array",proto:!0,forced:!tn()("map")},{map:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}})}(),Hh=Za()("Array","map"))}function Jh(){if(Vh)return qh;Vh=1;var t=Nt(),e=Qh(),i=Array.prototype;return qh=function(n){var o=n.map;return n===i||t(i,n)&&o===i.map?e:o},qh}function $h(){return Yh?Uh:(Yh=1,Uh=Jh())}var td,ed,id=s(Gh?Xh:(Gh=1,Xh=$h()));var nd,od,rd,sd,ad,hd,dd,cd,ld,ud=s(ed?td:(ed=1,td=vs())),fd={};function pd(){return rd?od:(rd=1,function(){if(nd)return fd;nd=1;var t=ni(),e=Hi(),i=Qi(),n=It(),o=kn(),r=Ui(),s=Dt(),a=Xi(),h=Se(),d=tn(),c=Un(),l=d("slice"),u=h("species"),f=Array,p=Math.max;t({target:"Array",proto:!0,forced:!l},{slice:function(t,h){var d,l,g,v=s(this),m=r(v),y=o(t,m),b=o(void 0===h?m:h,m);if(e(v)&&(d=v.constructor,(i(d)&&(d===f||e(d.prototype))||n(d)&&null===(d=d[u]))&&(d=void 0),d===f||void 0===d))return c(v,y,b);for(l=new(void 0===d?f:d)(p(b-y,0)),g=0;y<b;y++,g++)y in v&&a(l,g,v[y]);return l.length=g,l}})}(),od=Za()("Array","slice"))}function gd(){if(ad)return sd;ad=1;var t=Nt(),e=pd(),i=Array.prototype;return sd=function(n){var o=n.slice;return n===i||t(i,n)&&o===i.slice?e:o},sd}function vd(){return dd?hd:(dd=1,hd=gd())}var md,yd,bd,wd,_d,xd,Ed,Od,Sd,Cd=s(ld?cd:(ld=1,cd=vd()));function Td(){if(yd)return md;yd=1;var t=Mt(),e=D(),i=Ln(),n=$n(),o=ti(),r=e([].concat);return md=t("Reflect","ownKeys")||function(t){var e=i.f(o(t)),s=n.f;return s?r(e,s(t)):e},md}function kd(){return _d?wd:(_d=1,bd||(bd=1,ni()({target:"Reflect",stat:!0},{ownKeys:Td()})),wd=Pt().Reflect.ownKeys)}function Dd(){return Ed?xd:(Ed=1,xd=kd())}var Id,Pd,Md,Nd,Fd,zd,Ad,Bd=s(Sd?Od:(Sd=1,Od=Dd()));function jd(){return Md?Pd:(Md=1,Id||(Id=1,ni()({target:"Array",stat:!0},{isArray:Hi()})),Pd=Pt().Array.isArray)}function Rd(){return Fd?Nd:(Fd=1,Nd=jd())}var Ld,Hd,Wd,qd,Vd,Ud,Yd,Xd=s(Ad?zd:(Ad=1,zd=Rd())),Gd={};function Kd(){return Wd?Hd:(Wd=1,function(){if(Ld)return Gd;Ld=1;var t=ni(),e=xe(),i=Nn();t({target:"Object",stat:!0,forced:C()(function(){i(1)})},{keys:function(t){return i(e(t))}})}(),Hd=Pt().Object.keys)}function Zd(){return Vd?qd:(Vd=1,qd=Kd())}var Qd,Jd,$d,tc,ec,ic,nc,oc,rc,sc,ac,hc=s(Yd?Ud:(Yd=1,Ud=Zd())),dc={};function cc(){if(Jd)return Qd;Jd=1;var t=To().forEach,e=wh()("forEach");return Qd=e?[].forEach:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)},Qd}function lc(){return ec?tc:(ec=1,function(){if($d)return dc;$d=1;var t=ni(),e=cc();t({target:"Array",proto:!0,forced:[].forEach!==e},{forEach:e})}(),tc=Za()("Array","forEach"))}function uc(){return nc?ic:(nc=1,ic=lc())}function fc(){if(rc)return oc;rc=1;var t=Ki(),e=Ee(),i=Nt(),n=uc(),o=Array.prototype,r={DOMTokenList:!0,NodeList:!0};return oc=function(s){var a=s.forEach;return s===o||i(o,s)&&a===o.forEach||e(r,t(s))?n:a},oc}var pc,gc,vc,mc,yc,bc,wc,_c,xc,Ec=s(ac?sc:(ac=1,sc=fc())),Oc={};function Sc(){return vc?gc:(vc=1,function(){if(pc)return Oc;pc=1;var t=ni(),e=D(),i=Hi(),n=e([].reverse),o=[1,2];t({target:"Array",proto:!0,forced:String(o)===String(o.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),n(this)}})}(),gc=Za()("Array","reverse"))}function Cc(){if(yc)return mc;yc=1;var t=Nt(),e=Sc(),i=Array.prototype;return mc=function(n){var o=n.reverse;return n===i||t(i,n)&&o===i.reverse?e:o},mc}function Tc(){return wc?bc:(wc=1,bc=Cc())}var kc,Dc,Ic,Pc,Mc,Nc,Fc,zc,Ac,Bc,jc,Rc,Lc,Hc=s(xc?_c:(xc=1,_c=Tc())),Wc={};function qc(){if(Dc)return kc;Dc=1;var t=j(),e=Hi(),i=TypeError,n=Object.getOwnPropertyDescriptor,o=t&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();return kc=o?function(t,o){if(e(t)&&!n(t,"length").writable)throw new i("Cannot set read only .length");return t.length=o}:function(t,e){return t.length=e}}function Vc(){if(Pc)return Ic;Pc=1;var t=Rt(),e=TypeError;return Ic=function(i,n){if(!delete i[n])throw new e("Cannot delete property "+t(n)+" of "+t(i))}}function Uc(){return Fc?Nc:(Fc=1,function(){if(Mc)return Wc;Mc=1;var t=ni(),e=xe(),i=kn(),n=qi(),o=Ui(),r=qc(),s=Yi(),a=$i(),h=Xi(),d=Vc(),c=tn()("splice"),l=Math.max,u=Math.min;t({target:"Array",proto:!0,forced:!c},{splice:function(t,c){var f,p,g,v,m,y,b=e(this),w=o(b),_=i(t,w),x=arguments.length;for(0===x?f=p=0:1===x?(f=0,p=w-_):(f=x-2,p=u(l(n(c),0),w-_)),s(w+f-p),g=a(b,p),v=0;v<p;v++)(m=_+v)in b&&h(g,v,b[m]);if(g.length=p,f<p){for(v=_;v<w-p;v++)y=v+f,(m=v+p)in b?b[y]=b[m]:d(b,y);for(v=w;v>w-p+f;v--)d(b,v-1)}else if(f>p)for(v=w-p;v>_;v--)y=v+f-1,(m=v+p-1)in b?b[y]=b[m]:d(b,y);for(v=0;v<f;v++)b[v+_]=arguments[v+2];return r(b,w-p+f),g}})}(),Nc=Za()("Array","splice"))}function Yc(){if(Ac)return zc;Ac=1;var t=Nt(),e=Uc(),i=Array.prototype;return zc=function(n){var o=n.splice;return n===i||t(i,n)&&o===i.splice?e:o},zc}function Xc(){return jc?Bc:(jc=1,Bc=Yc())}var Gc,Kc,Zc,Qc,Jc,$c,tl,el,il,nl=s(Lc?Rc:(Lc=1,Rc=Xc())),ol={};function rl(){if(Kc)return Gc;Kc=1;var t=j(),e=D(),i=R(),n=C(),o=Nn(),r=$n(),s=Ot(),a=xe(),h=Ct(),d=Object.assign,c=Object.defineProperty,l=e([].concat);return Gc=!d||n(function(){if(t&&1!==d({b:1},d(c({},"a",{enumerable:!0,get:function(){c(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},i={},n=Symbol("assign detection"),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(t){i[t]=t}),7!==d({},e)[n]||o(d({},i)).join("")!==r})?function(e,n){for(var d=a(e),c=arguments.length,u=1,f=r.f,p=s.f;c>u;)for(var g,v=h(arguments[u++]),m=f?l(o(v),f(v)):o(v),y=m.length,b=0;y>b;)g=m[b++],t&&!i(p,v,g)||(d[g]=v[g]);return d}:d,Gc}function sl(){return Jc?Qc:(Jc=1,function(){if(Zc)return ol;Zc=1;var t=ni(),e=rl();t({target:"Object",stat:!0,arity:2,forced:Object.assign!==e},{assign:e})}(),Qc=Pt().Object.assign)}function al(){return tl?$c:(tl=1,$c=sl())}var hl,dl,cl,ll,ul,fl,pl,gl,vl=s(il?el:(il=1,el=al()));function ml(){return dl?hl:(dl=1,en(),hl=Za()("Array","concat"))}function yl(){if(ll)return cl;ll=1;var t=Nt(),e=ml(),i=Array.prototype;return cl=function(n){var o=n.concat;return n===i||t(i,n)&&o===i.concat?e:o},cl}function bl(){return fl?ul:(fl=1,ul=yl())}var wl,_l,xl,El,Ol,Sl,Cl,Tl=s(gl?pl:(gl=1,pl=bl()));function kl(){if(xl)return _l;xl=1,wl||(wl=1,ni()({target:"Object",stat:!0,sham:!j()},{create:Bn()}));var t=Pt().Object;return _l=function(e,i){return t.create(e,i)}}function Dl(){return Ol?El:(Ol=1,El=kl())}var Il,Pl,Ml,Nl,Fl,zl,Al,Bl,jl,Rl,Ll,Hl,Wl,ql=s(Cl?Sl:(Cl=1,Sl=Dl())),Vl={};function Ul(){if(Pl)return Il;Pl=1;var t=qi(),e=an(),i=kt(),n=RangeError;return Il=function(o){var r=e(i(this)),s="",a=t(o);if(a<0||a===1/0)throw new n("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(r+=r))1&a&&(s+=r);return s}}function Yl(){if(Nl)return Ml;Nl=1;var t=D(),e=Vi(),i=an(),n=Ul(),o=kt(),r=t(n),s=t("".slice),a=Math.ceil,h=function(t){return function(n,h,d){var c,l,u=i(o(n)),f=e(h),p=u.length,g=void 0===d?" ":i(d);return f<=p||""===g?u:((l=r(g,a((c=f-p)/g.length))).length>c&&(l=s(l,0,c)),t?u+l:l+u)}};return Ml={start:h(!1),end:h(!0)}}function Xl(){if(zl)return Fl;zl=1;var t=D(),e=C(),i=Yl().start,n=RangeError,o=isFinite,r=Math.abs,s=Date.prototype,a=s.toISOString,h=t(s.getTime),d=t(s.getUTCDate),c=t(s.getUTCFullYear),l=t(s.getUTCHours),u=t(s.getUTCMilliseconds),f=t(s.getUTCMinutes),p=t(s.getUTCMonth),g=t(s.getUTCSeconds);return Fl=e(function(){return"0385-07-25T07:06:39.999Z"!==a.call(new Date(-50000000000001))})||!e(function(){a.call(new Date(NaN))})?function(){if(!o(h(this)))throw new n("Invalid time value");var t=this,e=c(t),s=u(t),a=e<0?"-":e>9999?"+":"";return a+i(r(e),a?6:4,0)+"-"+i(p(t)+1,2,0)+"-"+i(d(t),2,0)+"T"+i(l(t),2,0)+":"+i(f(t),2,0)+":"+i(g(t),2,0)+"."+i(s,3,0)+"Z"}:a}function Gl(){if(jl)return Bl;jl=1,function(){if(Al)return Vl;Al=1;var t=ni(),e=R(),i=xe(),n=Ce(),o=Xl(),r=I();t({target:"Date",proto:!0,forced:C()(function(){return null!==new Date(NaN).toJSON()||1!==e(Date.prototype.toJSON,{toISOString:function(){return 1}})})},{toJSON:function(t){var s=i(this),a=n(s,"number");return"number"!=typeof a||isFinite(a)?"toISOString"in s||"Date"!==r(s)?s.toISOString():e(o,s):null}})}(),Lo();var t=Pt(),e=k();return t.JSON||(t.JSON={stringify:JSON.stringify}),Bl=function(i,n,o){return e(t.JSON.stringify,null,arguments)},Bl}function Kl(){return Ll?Rl:(Ll=1,Rl=Gl())}var Zl,Ql,Jl,$l,tu,eu=s(Wl?Hl:(Wl=1,Hl=Kl())),iu={},nu={};function ou(){if(Ql)return Zl;Ql=1;var t=TypeError;return Zl=function(e,i){if(e<i)throw new t("Not enough arguments");return e}}function ru(){if($l)return Jl;$l=1;var t,e=S(),i=k(),n=M(),o=_h(),r=Ft(),s=Un(),a=ou(),h=e.Function,d=/MSIE .\./.test(r)||"BUN"===o&&((t=e.Bun.version.split(".")).length<3||"0"===t[0]&&(t[1]<3||"3"===t[1]&&"0"===t[2]));return Jl=function(t,e){var o=e?2:1;return d?function(r,d){var c=a(arguments.length,1)>o,l=n(r)?r:h(r),u=c?s(arguments,o):[],f=c?function(){i(l,this,u)}:l;return e?t(f,d):t(f)}:t},Jl}var su,au,hu,du,cu,lu,uu={};function fu(){return au||(au=1,function(){if(tu)return nu;tu=1;var t=ni(),e=S(),i=ru()(e.setInterval,!0);t({global:!0,bind:!0,forced:e.setInterval!==i},{setInterval:i})}(),function(){if(su)return uu;su=1;var t=ni(),e=S(),i=ru()(e.setTimeout,!0);t({global:!0,bind:!0,forced:e.setTimeout!==i},{setTimeout:i})}()),iu}function pu(){return du?hu:(du=1,fu(),hu=Pt().setTimeout)}var gu,vu=s(lu?cu:(lu=1,cu=pu())),mu={exports:{}};function yu(){return gu||(gu=1,function(t){function e(t){if(t)return function(t){return Object.assign(t,e.prototype),t._callbacks=new Map,t}(t);this._callbacks=new Map}e.prototype.on=function(t,e){const i=this._callbacks.get(t)??[];return i.push(e),this._callbacks.set(t,i),this},e.prototype.once=function(t,e){const i=(...n)=>{this.off(t,i),e.apply(this,n)};return i.fn=e,this.on(t,i),this},e.prototype.off=function(t,e){if(void 0===t&&void 0===e)return this._callbacks.clear(),this;if(void 0===e)return this._callbacks.delete(t),this;const i=this._callbacks.get(t);if(i){for(const[t,n]of i.entries())if(n===e||n.fn===e){i.splice(t,1);break}0===i.length?this._callbacks.delete(t):this._callbacks.set(t,i)}return this},e.prototype.emit=function(t,...e){const i=this._callbacks.get(t);if(i){const t=[...i];for(const i of t)i.apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks.get(t)??[]},e.prototype.listenerCount=function(t){if(t)return this.listeners(t).length;let e=0;for(const t of this._callbacks.values())e+=t.length;return e},e.prototype.hasListeners=function(t){return this.listenerCount(t)>0},e.prototype.addEventListener=e.prototype.on,e.prototype.removeListener=e.prototype.off,e.prototype.removeEventListener=e.prototype.off,e.prototype.removeAllListeners=e.prototype.off,t.exports=e}(mu)),mu.exports}var bu,wu=s(yu());
/*! Hammer.JS - v2.0.17-rc - 2019-12-16
   * http://naver.github.io/egjs
   *
   * Forked By Naver egjs
   * Copyright (c) hammerjs
   * Licensed under the MIT license */
function _u(){return _u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},_u.apply(this,arguments)}function xu(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function Eu(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}bu="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o])}return e}:Object.assign;var Ou,Su=bu,Cu=["","webkit","Moz","MS","ms","o"],Tu="undefined"==typeof document?{style:{}}:document.createElement("div"),ku=Math.round,Du=Math.abs,Iu=Date.now;function Pu(t,e){for(var i,n,o=e[0].toUpperCase()+e.slice(1),r=0;r<Cu.length;){if((n=(i=Cu[r])?i+o:e)in t)return n;r++}}Ou="undefined"==typeof window?{}:window;var Mu=Pu(Tu.style,"touchAction"),Nu=void 0!==Mu;var Fu="compute",zu="auto",Au="manipulation",Bu="none",ju="pan-x",Ru="pan-y",Lu=function(){if(!Nu)return!1;var t={},e=Ou.CSS&&Ou.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(i){return t[i]=!e||Ou.CSS.supports("touch-action",i)}),t}(),Hu="ontouchstart"in Ou,Wu=void 0!==Pu(Ou,"PointerEvent"),qu=Hu&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),Vu="touch",Uu="mouse",Yu=16,Xu=24,Gu=["x","y"],Ku=["clientX","clientY"];function Zu(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(void 0!==t.length)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function Qu(t,e){return"function"==typeof t?t.apply(e&&e[0]||void 0,e):t}function Ju(t,e){return t.indexOf(e)>-1}var $u=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===Fu&&(t=this.compute()),Nu&&this.manager.element.style&&Lu[t]&&(this.manager.element.style[Mu]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return Zu(this.manager.recognizers,function(e){Qu(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),function(t){if(Ju(t,Bu))return Bu;var e=Ju(t,ju),i=Ju(t,Ru);return e&&i?Bu:e||i?e?ju:Ru:Ju(t,Au)?Au:zu}(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=Ju(n,Bu)&&!Lu[Bu],r=Ju(n,Ru)&&!Lu[Ru],s=Ju(n,ju)&&!Lu[ju];if(o){var a=1===t.pointers.length,h=t.distance<2,d=t.deltaTime<250;if(a&&h&&d)return}if(!s||!r)return o||r&&6&i||s&&i&Xu?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function tf(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function ef(t){var e=t.length;if(1===e)return{x:ku(t[0].clientX),y:ku(t[0].clientY)};for(var i=0,n=0,o=0;o<e;)i+=t[o].clientX,n+=t[o].clientY,o++;return{x:ku(i/e),y:ku(n/e)}}function nf(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:ku(t.pointers[i].clientX),clientY:ku(t.pointers[i].clientY)},i++;return{timeStamp:Iu(),pointers:e,center:ef(e),deltaX:t.deltaX,deltaY:t.deltaY}}function of(t,e,i){i||(i=Gu);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return Math.sqrt(n*n+o*o)}function rf(t,e,i){i||(i=Gu);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return 180*Math.atan2(o,n)/Math.PI}function sf(t,e){return t===e?1:Du(t)>=Du(e)?t<0?2:4:e<0?8:Yu}function af(t,e,i){return{x:e/t||0,y:i/t||0}}function hf(t,e){var i=t.session,n=e.pointers,o=n.length;i.firstInput||(i.firstInput=nf(e)),o>1&&!i.firstMultiple?i.firstMultiple=nf(e):1===o&&(i.firstMultiple=!1);var r=i.firstInput,s=i.firstMultiple,a=s?s.center:r.center,h=e.center=ef(n);e.timeStamp=Iu(),e.deltaTime=e.timeStamp-r.timeStamp,e.angle=rf(a,h),e.distance=of(a,h),function(t,e){var i=e.center,n=t.offsetDelta||{},o=t.prevDelta||{},r=t.prevInput||{};1!==e.eventType&&4!==r.eventType||(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=sf(e.deltaX,e.deltaY);var d,c,l=af(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=l.x,e.overallVelocityY=l.y,e.overallVelocity=Du(l.x)>Du(l.y)?l.x:l.y,e.scale=s?(d=s.pointers,of((c=n)[0],c[1],Ku)/of(d[0],d[1],Ku)):1,e.rotation=s?function(t,e){return rf(e[1],e[0],Ku)+rf(t[1],t[0],Ku)}(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(8!==e.eventType&&(a>25||void 0===s.velocity)){var h=e.deltaX-s.deltaX,d=e.deltaY-s.deltaY,c=af(a,h,d);n=c.x,o=c.y,i=Du(c.x)>Du(c.y)?c.x:c.y,r=sf(h,d),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;tf(u=p.composedPath?p.composedPath()[0]:p.path?p.path[0]:p.target,f)&&(f=u),e.target=f}function df(t,e,i){var n=i.pointers.length,o=i.changedPointers.length,r=1&e&&n-o===0,s=12&e&&n-o===0;i.isFirst=!!r,i.isFinal=!!s,r&&(t.session={}),i.eventType=e,hf(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function cf(t){return t.trim().split(/\s+/g)}function lf(t,e,i){Zu(cf(e),function(e){t.addEventListener(e,i,!1)})}function uf(t,e,i){Zu(cf(e),function(e){t.removeEventListener(e,i,!1)})}function ff(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||window}var pf=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){Qu(t.options.enable,[t])&&i.handler(e)},this.init()}var e=t.prototype;return e.handler=function(){},e.init=function(){this.evEl&&lf(this.element,this.evEl,this.domHandler),this.evTarget&&lf(this.target,this.evTarget,this.domHandler),this.evWin&&lf(ff(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&uf(this.element,this.evEl,this.domHandler),this.evTarget&&uf(this.target,this.evTarget,this.domHandler),this.evWin&&uf(ff(this.element),this.evWin,this.domHandler)},t}();function gf(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}var vf={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},mf={2:Vu,3:"pen",4:Uu,5:"kinect"},yf="pointerdown",bf="pointermove pointerup pointercancel";Ou.MSPointerEvent&&!Ou.PointerEvent&&(yf="MSPointerDown",bf="MSPointerMove MSPointerUp MSPointerCancel");var wf=function(t){function e(){var i,n=e.prototype;return n.evEl=yf,n.evWin=bf,(i=t.apply(this,arguments)||this).store=i.manager.session.pointerEvents=[],i}return xu(e,t),e.prototype.handler=function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),o=vf[n],r=mf[t.pointerType]||t.pointerType,s=r===Vu,a=gf(e,t.pointerId,"pointerId");1&o&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):12&o&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,o,{pointers:e,changedPointers:[t],pointerType:r,srcEvent:t}),i&&e.splice(a,1))},e}(pf);function _f(t){return Array.prototype.slice.call(t,0)}function xf(t,e,i){for(var n=[],o=[],r=0;r<t.length;){var s=e?t[r][e]:t[r];gf(o,s)<0&&n.push(t[r]),o[r]=s,r++}return i&&(n=e?n.sort(function(t,i){return t[e]>i[e]}):n.sort()),n}var Ef={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Of=function(t){function e(){var i;return e.prototype.evTarget="touchstart touchmove touchend touchcancel",(i=t.apply(this,arguments)||this).targetIds={},i}return xu(e,t),e.prototype.handler=function(t){var e=Ef[t.type],i=Sf.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:Vu,srcEvent:t})},e}(pf);function Sf(t,e){var i,n,o=_f(t.touches),r=this.targetIds;if(3&e&&1===o.length)return r[o[0].identifier]=!0,[o,o];var s=_f(t.changedTouches),a=[],h=this.target;if(n=o.filter(function(t){return tf(t.target,h)}),1===e)for(i=0;i<n.length;)r[n[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),12&e&&delete r[s[i].identifier],i++;return a.length?[xf(n.concat(a),"identifier",!0),a]:void 0}var Cf={mousedown:1,mousemove:2,mouseup:4},Tf=function(t){function e(){var i,n=e.prototype;return n.evEl="mousedown",n.evWin="mousemove mouseup",(i=t.apply(this,arguments)||this).pressed=!1,i}return xu(e,t),e.prototype.handler=function(t){var e=Cf[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:Uu,srcEvent:t}))},e}(pf);function kf(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY},n=this.lastTouches;this.lastTouches.push(i);setTimeout(function(){var t=n.indexOf(i);t>-1&&n.splice(t,1)},2500)}}function Df(t,e){1&t?(this.primaryTouch=e.changedPointers[0].identifier,kf.call(this,e)):12&t&&kf.call(this,e)}function If(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var o=this.lastTouches[n],r=Math.abs(e-o.x),s=Math.abs(i-o.y);if(r<=25&&s<=25)return!0}return!1}var Pf=function(){return function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).handler=function(t,e,i){var o=i.pointerType===Vu,r=i.pointerType===Uu;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(o)Df.call(Eu(Eu(n)),e,i);else if(r&&If.call(Eu(Eu(n)),i))return;n.callback(t,e,i)}},n.touch=new Of(n.manager,n.handler),n.mouse=new Tf(n.manager,n.handler),n.primaryTouch=null,n.lastTouches=[],n}return xu(e,t),e.prototype.destroy=function(){this.touch.destroy(),this.mouse.destroy()},e}(pf)}();function Mf(t,e,i){return!!Array.isArray(t)&&(Zu(t,i[e],i),!0)}var Nf=32,Ff=1;function zf(t,e){var i=e.manager;return i?i.get(t):t}function Af(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}var Bf=function(){function t(t){void 0===t&&(t={}),this.options=_u({enable:!0},t),this.id=Ff++,this.manager=null,this.state=1,this.simultaneous={},this.requireFail=[]}var e=t.prototype;return e.set=function(t){return Su(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(Mf(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=zf(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},e.dropRecognizeWith=function(t){return Mf(t,"dropRecognizeWith",this)||(t=zf(t,this),delete this.simultaneous[t.id]),this},e.requireFailure=function(t){if(Mf(t,"requireFailure",this))return this;var e=this.requireFail;return-1===gf(e,t=zf(t,this))&&(e.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(Mf(t,"dropRequireFailure",this))return this;t=zf(t,this);var e=gf(this.requireFail,t);return e>-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+Af(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=8&&n(e.options.event+Af(i))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=Nf},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},e.recognize=function(t){var e=Su({},t);if(!Qu(this.options.enable,[this,e]))return this.reset(),void(this.state=Nf);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},e.process=function(t){},e.getTouchAction=function(){},e.reset=function(){},t}(),jf=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,_u({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},e))||this).pTime=!1,i.pCenter=!1,i._timer=null,i._input=null,i.count=0,i}xu(e,t);var i=e.prototype;return i.getTouchAction=function(){return[Au]},i.process=function(t){var e=this,i=this.options,n=t.pointers.length===i.pointers,o=t.distance<i.threshold,r=t.deltaTime<i.time;if(this.reset(),1&t.eventType&&0===this.count)return this.failTimeout();if(o&&r&&n){if(4!==t.eventType)return this.failTimeout();var s=!this.pTime||t.timeStamp-this.pTime<i.interval,a=!this.pCenter||of(this.pCenter,t.center)<i.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&s?this.count+=1:this.count=1,this._input=t,0===this.count%i.taps)return this.hasRequireFailures()?(this._timer=setTimeout(function(){e.state=8,e.tryEmit()},i.interval),2):8}return Nf},i.failTimeout=function(){var t=this;return this._timer=setTimeout(function(){t.state=Nf},this.options.interval),Nf},i.reset=function(){clearTimeout(this._timer)},i.emit=function(){8===this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(Bf),Rf=function(t){function e(e){return void 0===e&&(e={}),t.call(this,_u({pointers:1},e))||this}xu(e,t);var i=e.prototype;return i.attrTest=function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},i.process=function(t){var e=this.state,i=t.eventType,n=6&e,o=this.attrTest(t);return n&&(8&i||!o)?16|e:n||o?4&i?8|e:2&e?4|e:2:Nf},e}(Bf);function Lf(t){return t===Yu?"down":8===t?"up":2===t?"left":4===t?"right":""}var Hf=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,_u({event:"pan",threshold:10,pointers:1,direction:30},e))||this).pX=null,i.pY=null,i}xu(e,t);var i=e.prototype;return i.getTouchAction=function(){var t=this.options.direction,e=[];return 6&t&&e.push(Ru),t&Xu&&e.push(ju),e},i.directionTest=function(t){var e=this.options,i=!0,n=t.distance,o=t.direction,r=t.deltaX,s=t.deltaY;return o&e.direction||(6&e.direction?(o=0===r?1:r<0?2:4,i=r!==this.pX,n=Math.abs(t.deltaX)):(o=0===s?1:s<0?8:Yu,i=s!==this.pY,n=Math.abs(t.deltaY))),t.direction=o,i&&n>e.threshold&&o&e.direction},i.attrTest=function(t){return Rf.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=Lf(e.direction);i&&(e.additionalEvent=this.options.event+i),t.prototype.emit.call(this,e)},e}(Rf),Wf=function(t){function e(e){return void 0===e&&(e={}),t.call(this,_u({event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},e))||this}xu(e,t);var i=e.prototype;return i.getTouchAction=function(){return Hf.prototype.getTouchAction.call(this)},i.attrTest=function(e){var i,n=this.options.direction;return 30&n?i=e.overallVelocity:6&n?i=e.overallVelocityX:n&Xu&&(i=e.overallVelocityY),t.prototype.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers===this.options.pointers&&Du(i)>this.options.velocity&&4&e.eventType},i.emit=function(t){var e=Lf(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)},e}(Rf),qf=function(t){function e(e){return void 0===e&&(e={}),t.call(this,_u({event:"pinch",threshold:0,pointers:2},e))||this}xu(e,t);var i=e.prototype;return i.getTouchAction=function(){return[Bu]},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}(Rf),Vf=function(t){function e(e){return void 0===e&&(e={}),t.call(this,_u({event:"rotate",threshold:0,pointers:2},e))||this}xu(e,t);var i=e.prototype;return i.getTouchAction=function(){return[Bu]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)},e}(Rf),Uf=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,_u({event:"press",pointers:1,time:251,threshold:9},e))||this)._timer=null,i._input=null,i}xu(e,t);var i=e.prototype;return i.getTouchAction=function(){return[zu]},i.process=function(t){var e=this,i=this.options,n=t.pointers.length===i.pointers,o=t.distance<i.threshold,r=t.deltaTime>i.time;if(this._input=t,!o||!n||12&t.eventType&&!r)this.reset();else if(1&t.eventType)this.reset(),this._timer=setTimeout(function(){e.state=8,e.tryEmit()},i.time);else if(4&t.eventType)return 8;return Nf},i.reset=function(){clearTimeout(this._timer)},i.emit=function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=Iu(),this.manager.emit(this.options.event,this._input)))},e}(Bf),Yf={domEvents:!1,touchAction:Fu,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Xf=[[Vf,{enable:!1}],[qf,{enable:!1},["rotate"]],[Wf,{direction:6}],[Hf,{direction:6},["swipe"]],[jf],[jf,{event:"doubletap",taps:2},["tap"]],[Uf]];function Gf(t,e){var i,n=t.element;n.style&&(Zu(t.options.cssProps,function(o,r){i=Pu(n.style,r),e?(t.oldCssProps[i]=n.style[i],n.style[i]=o):n.style[i]=t.oldCssProps[i]||""}),e||(t.oldCssProps={}))}var Kf=function(){function t(t,e){var i,n=this;this.options=Su({},Yf,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||(Wu?wf:qu?Of:Hu?Pf:Tf))(i,df),this.touchAction=new $u(this,this.options.touchAction),Gf(this,!0),Zu(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 Su(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<n.length;)i=n[r],2===e.stopped||o&&i!==o&&!i.canRecognizeWith(o)?i.reset():i.recognize(t),!o&&14&i.state&&(e.curRecognizer=i,o=i),r++}},e.get=function(t){if(t instanceof Bf)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event===t)return e[i];return null},e.add=function(t){if(Mf(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},e.remove=function(t){if(Mf(t,"remove",this))return this;var e=this.get(t);if(t){var i=this.recognizers,n=gf(i,e);-1!==n&&(i.splice(n,1),this.touchAction.update())}return this},e.on=function(t,e){if(void 0===t||void 0===e)return this;var i=this.handlers;return Zu(cf(t),function(t){i[t]=i[t]||[],i[t].push(e)}),this},e.off=function(t,e){if(void 0===t)return this;var i=this.handlers;return Zu(cf(t),function(t){e?i[t]&&i[t].splice(gf(i[t],e),1):delete i[t]}),this},e.emit=function(t,e){this.options.domEvents&&function(t,e){var i=document.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}(t,e);var i=this.handlers[t]&&this.handlers[t].slice();if(i&&i.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var n=0;n<i.length;)i[n](e),n++}},e.destroy=function(){this.element&&Gf(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},t}(),Zf={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Qf=function(t){function e(){var i,n=e.prototype;return n.evTarget="touchstart",n.evWin="touchstart touchmove touchend touchcancel",(i=t.apply(this,arguments)||this).started=!1,i}return xu(e,t),e.prototype.handler=function(t){var e=Zf[t.type];if(1===e&&(this.started=!0),this.started){var i=Jf.call(this,t,e);12&e&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:Vu,srcEvent:t})}},e}(pf);function Jf(t,e){var i=_f(t.touches),n=_f(t.changedTouches);return 12&e&&(i=xf(i.concat(n),"identifier",!0)),[i,n]}function $f(t,e,i){var n="DEPRECATED METHOD: "+e+"\n"+i+" AT \n";return function(){var e=new Error("get-stack-trace"),i=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,n,i),t.apply(this,arguments)}}var tp=$f(function(t,e,i){for(var n=Object.keys(e),o=0;o<n.length;)(!i||i&&void 0===t[n[o]])&&(t[n[o]]=e[n[o]]),o++;return t},"extend","Use `assign`."),ep=$f(function(t,e){return tp(t,e,!0)},"merge","Use `assign`.");function ip(t,e,i){var n,o=e.prototype;(n=t.prototype=Object.create(o)).constructor=t,n._super=o,i&&Su(n,i)}function np(t,e){return function(){return t.apply(e,arguments)}}var op=function(){var t=function(t,e){return void 0===e&&(e={}),new Kf(t,_u({recognizers:Xf.concat()},e))};return t.VERSION="2.0.17-rc",t.DIRECTION_ALL=30,t.DIRECTION_DOWN=Yu,t.DIRECTION_LEFT=2,t.DIRECTION_RIGHT=4,t.DIRECTION_UP=8,t.DIRECTION_HORIZONTAL=6,t.DIRECTION_VERTICAL=Xu,t.DIRECTION_NONE=1,t.DIRECTION_DOWN=Yu,t.INPUT_START=1,t.INPUT_MOVE=2,t.INPUT_END=4,t.INPUT_CANCEL=8,t.STATE_POSSIBLE=1,t.STATE_BEGAN=2,t.STATE_CHANGED=4,t.STATE_ENDED=8,t.STATE_RECOGNIZED=8,t.STATE_CANCELLED=16,t.STATE_FAILED=Nf,t.Manager=Kf,t.Input=pf,t.TouchAction=$u,t.TouchInput=Of,t.MouseInput=Tf,t.PointerEventInput=wf,t.TouchMouseInput=Pf,t.SingleTouchInput=Qf,t.Recognizer=Bf,t.AttrRecognizer=Rf,t.Tap=jf,t.Pan=Hf,t.Swipe=Wf,t.Pinch=qf,t.Rotate=Vf,t.Press=Uf,t.on=lf,t.off=uf,t.each=Zu,t.merge=ep,t.extend=tp,t.bindFn=np,t.assign=Su,t.inherit=ip,t.bindFn=np,t.prefixed=Pu,t.toArray=_f,t.inArray=gf,t.uniqueArray=xf,t.splitStr=cf,t.boolOrFn=Qu,t.hasParent=tf,t.addEventListeners=lf,t.removeEventListeners=uf,t.defaults=Su({},Yf,{preset:Xf}),t}();const rp=ud("DELETE");function sp(){const t=ap(...arguments);return dp(t),t}function ap(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];if(e.length<2)return e[0];if(e.length>2)return ap(sp(e[0],e[1]),...Cd(e).call(e,2));const n=e[0],o=e[1];if(n instanceof Date&&o instanceof Date)return n.setTime(o.getTime()),n;for(const t of Bd(o))Object.prototype.propertyIsEnumerable.call(o,t)&&(o[t]===rp?delete n[t]:null===n[t]||null===o[t]||"object"!=typeof n[t]||"object"!=typeof o[t]||Xd(n[t])||Xd(o[t])?n[t]=hp(o[t]):n[t]=ap(n[t],o[t]));return n}function hp(t){return Xd(t)?id(t).call(t,t=>hp(t)):"object"==typeof t&&null!==t?t instanceof Date?new Date(t.getTime()):ap({},t):t}function dp(t){for(const e of hc(t))t[e]===rp?delete t[e]:"object"==typeof t[e]&&null!==t[e]&&dp(t[e])}const cp="undefined"!=typeof window?window.Hammer||op:function(){return function(){const t=()=>{};return{on:t,off:t,destroy:t,emit:t,get:()=>({set:t})}}()};function lp(t){var e;this._cleanupQueue=[],this.active=!1,this._dom={container:t,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});const i=cp(this._dom.overlay);i.on("tap",mh(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{i.destroy()});const n=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];Ec(n).call(n,t=>{i.on(t,t=>{t.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=e=>{(function(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1})(e.target,t)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=t=>{("key"in t?"Escape"===t.key:27===t.keyCode)&&this.deactivate()}}var up,fp,pp,gp,vp,mp;function yp(){return fp?up:(fp=1,Vo(),up=Pt().Object.getOwnPropertySymbols)}function bp(){return gp?pp:(gp=1,pp=yp())}wu(lp.prototype),lp.current=null,lp.prototype.destroy=function(){this.deactivate();for(const i of Hc(t=nl(e=this._cleanupQueue).call(e,0)).call(t)){var t,e;i()}},lp.prototype.activate=function(){lp.current&&lp.current.deactivate(),lp.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)},lp.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")},lp.prototype._onTapOverlay=function(t){this.activate(),t.srcEvent.stopPropagation()};var wp,_p,xp,Ep,Op,Sp,Cp=s(mp?vp:(mp=1,vp=bp())),Tp={exports:{}},kp={};function Dp(){if(_p)return Tp.exports;_p=1,function(){if(wp)return kp;wp=1;var t=ni(),e=C(),i=Dt(),n=Ie().f,o=j();t({target:"Object",stat:!0,forced:!o||e(function(){n(1)}),sham:!o},{getOwnPropertyDescriptor:function(t,e){return n(i(t),e)}})}();var t=Pt().Object,e=Tp.exports=function(e,i){return t.getOwnPropertyDescriptor(e,i)};return t.getOwnPropertyDescriptor.sham&&(e.sham=!0),Tp.exports}function Ip(){return Ep?xp:(Ep=1,xp=Dp())}var Pp,Mp,Np,Fp,zp,Ap,Bp,jp=s(Sp?Op:(Sp=1,Op=Ip())),Rp={};function Lp(){return Np?Mp:(Np=1,function(){if(Pp)return Rp;Pp=1;var t=ni(),e=j(),i=Td(),n=Dt(),o=Ie(),r=Xi();t({target:"Object",stat:!0,sham:!e},{getOwnPropertyDescriptors:function(t){for(var e,s,a=n(t),h=o.f,d=i(a),c={},l=0;d.length>l;)void 0!==(s=h(a,e=d[l++]))&&r(c,e,s);return c}})}(),Mp=Pt().Object.getOwnPropertyDescriptors)}function Hp(){return zp?Fp:(zp=1,Fp=Lp())}var Wp,qp,Vp,Up,Yp,Xp,Gp=s(Bp?Ap:(Bp=1,Ap=Hp())),Kp={exports:{}},Zp={};function Qp(){if(Wp)return Zp;Wp=1;var t=ni(),e=j(),i=Fn().f;return t({target:"Object",stat:!0,forced:Object.defineProperties!==i,sham:!e},{defineProperties:i}),Zp}function Jp(){if(qp)return Kp.exports;qp=1,Qp();var t=Pt().Object,e=Kp.exports=function(e,i){return t.defineProperties(e,i)};return t.defineProperties.sham&&(e.sham=!0),Kp.exports}function $p(){return Up?Vp:(Up=1,Vp=Jp())}var tg,eg,ig=s(Xp?Yp:(Xp=1,Yp=$p()));var ng,og,rg,sg,ag,hg,dg,cg,lg,ug,fg,pg,gg,vg,mg,yg,bg,wg,_g,xg,Eg,Og,Sg,Cg,Tg,kg,Dg,Ig,Pg,Mg=s(eg?tg:(eg=1,tg=si())),Ng={},Fg={exports:{}};function zg(){return og?ng:(og=1,ng=C()(function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))}function Ag(){if(sg)return rg;sg=1;var t=C(),e=It(),i=I(),n=zg(),o=Object.isExtensible,r=t(function(){});return rg=r||n?function(t){return!!e(t)&&((!n||"ArrayBuffer"!==i(t))&&(!o||o(t)))}:o,rg}function Bg(){return hg?ag:(hg=1,ag=!C()(function(){return Object.isExtensible(Object.preventExtensions({}))}))}function jg(){if(dg)return Fg.exports;dg=1;var t=ni(),e=D(),i=In(),n=It(),o=Ee(),r=ei().f,s=Ln(),a=Yn(),h=Ag(),d=Oe(),c=Bg(),l=!1,u=d("meta"),f=0,p=function(t){r(t,u,{value:{objectID:"O"+f++,weakData:{}}})},g=Fg.exports={enable:function(){g.enable=function(){},l=!0;var i=s.f,n=e([].splice),o={};o[u]=1,i(o).length&&(s.f=function(t){for(var e=i(t),o=0,r=e.length;o<r;o++)if(e[o]===u){n(e,o,1);break}return e},t({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:a.f}))},fastKey:function(t,e){if(!n(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,u)){if(!h(t))return"F";if(!e)return"E";p(t)}return t[u].objectID},getWeakData:function(t,e){if(!o(t,u)){if(!h(t))return!0;if(!e)return!1;p(t)}return t[u].weakData},onFreeze:function(t){return c&&l&&h(t)&&!o(t,u)&&p(t),t}};return i[u]=!0,Fg.exports}function Rg(){if(lg)return cg;lg=1;var t=Se(),e=es(),i=t("iterator"),n=Array.prototype;return cg=function(t){return void 0!==t&&(e.Array===t||n[i]===t)},cg}function Lg(){if(fg)return ug;fg=1;var t=Ki(),e=Ht(),i=Tt(),n=es(),o=Se()("iterator");return ug=function(r){if(!i(r))return e(r,o)||e(r,"@@iterator")||n[t(r)]},ug}function Hg(){if(gg)return pg;gg=1;var t=R(),e=Lt(),i=ti(),n=Rt(),o=Lg(),r=TypeError;return pg=function(s,a){var h=arguments.length<2?o(s):a;if(e(h))return i(t(h,s));throw new r(n(s)+" is not iterable")},pg}function Wg(){if(mg)return vg;mg=1;var t=R(),e=ti(),i=Ht();return vg=function(n,o,r){var s,a;e(n);try{if(!(s=i(n,"return"))){if("throw"===o)throw r;return r}s=t(s,n)}catch(t){a=!0,s=t}if("throw"===o)throw r;if(a)throw s;return e(s),r},vg}function qg(){if(bg)return yg;bg=1;var t=Me(),e=R(),i=ti(),n=Rt(),o=Rg(),r=Ui(),s=Nt(),a=Hg(),h=Lg(),d=Wg(),c=TypeError,l=function(t,e){this.stopped=t,this.result=e},u=l.prototype;return yg=function(f,p,g){var v,m,y,b,w,_,x,E=g&&g.that,O=!(!g||!g.AS_ENTRIES),S=!(!g||!g.IS_RECORD),C=!(!g||!g.IS_ITERATOR),T=!(!g||!g.INTERRUPTED),k=t(p,E),D=function(t){return v&&d(v,"normal"),new l(!0,t)},I=function(t){return O?(i(t),T?k(t[0],t[1],D):k(t[0],t[1])):T?k(t,D):k(t)};if(S)v=f.iterator;else if(C)v=f;else{if(!(m=h(f)))throw new c(n(f)+" is not iterable");if(o(m)){for(y=0,b=r(f);b>y;y++)if((w=I(f[y]))&&s(u,w))return w;return new l(!1)}v=a(f,m)}for(_=S?f.next:v.next;!(x=e(_,v)).done;){try{w=I(x.value)}catch(t){d(v,"throw",t)}if("object"==typeof w&&w&&s(u,w))return w}return new l(!1)},yg}function Vg(){if(_g)return wg;_g=1;var t=Nt(),e=TypeError;return wg=function(i,n){if(t(n,i))return i;throw new e("Incorrect invocation")},wg}function Ug(){if(Eg)return xg;Eg=1;var t=ni(),e=S(),i=jg(),n=C(),o=ii(),r=qg(),s=Vg(),a=M(),h=It(),d=Tt(),c=Oo(),l=ei().f,u=To().forEach,f=j(),p=Co(),g=p.set,v=p.getterFor;return xg=function(p,m,y){var b,w=-1!==p.indexOf("Map"),_=-1!==p.indexOf("Weak"),x=w?"set":"add",E=e[p],O=E&&E.prototype,S={};if(f&&a(E)&&(_||O.forEach&&!n(function(){(new E).entries().next()}))){var C=(b=m(function(t,e){g(s(t,C),{type:p,collection:new E}),d(e)||r(e,t[x],{that:t,AS_ENTRIES:w})})).prototype,T=v(p);u(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(t){var e="add"===t||"set"===t;!(t in O)||_&&"clear"===t||o(C,t,function(i,n){var o=T(this).collection;if(!e&&_&&!h(i))return"get"===t&&void 0;var r=o[t](0===i?0:i,n);return e?this:r})}),_||l(C,"size",{configurable:!0,get:function(){return T(this).collection.size}})}else b=y.getConstructor(m,p,w,x),i.enable();return c(b,p,!1,!0),S[p]=b,t({global:!0,forced:!0},S),_||y.setStrong(b,p,w),b},xg}function Yg(){if(Sg)return Og;Sg=1;var t=to();return Og=function(e,i,n){for(var o in i)n&&n.unsafe&&e[o]?e[o]=i[o]:t(e,o,i[o],n);return e}}function Xg(){if(Tg)return Cg;Tg=1;var t=Mt(),e=eo(),i=Se(),n=j(),o=i("species");return Cg=function(i){var r=t(i);n&&r&&!r[o]&&e(r,o,{configurable:!0,get:function(){return this}})}}function Gg(){if(Dg)return kg;Dg=1;var t=Bn(),e=eo(),i=Yg(),n=Me(),o=Vg(),r=Tt(),s=qg(),a=ls(),h=us(),d=Xg(),c=j(),l=jg().fastKey,u=Co(),f=u.set,p=u.getterFor;return kg={getConstructor:function(a,h,d,u){var g=a(function(e,i){o(e,v),f(e,{type:h,index:t(null),first:null,last:null,size:0}),c||(e.size=0),r(i)||s(i,e[u],{that:e,AS_ENTRIES:d})}),v=g.prototype,m=p(h),y=function(t,e,i){var n,o,r=m(t),s=b(t,e);return s?s.value=i:(r.last=s={index:o=l(e,!0),key:e,value:i,previous:n=r.last,next:null,removed:!1},r.first||(r.first=s),n&&(n.next=s),c?r.size++:t.size++,"F"!==o&&(r.index[o]=s)),t},b=function(t,e){var i,n=m(t),o=l(e);if("F"!==o)return n.index[o];for(i=n.first;i;i=i.next)if(i.key===e)return i};return i(v,{clear:function(){for(var e=m(this),i=e.first;i;)i.removed=!0,i.previous&&(i.previous=i.previous.next=null),i=i.next;e.first=e.last=null,e.index=t(null),c?e.size=0:this.size=0},delete:function(t){var e=this,i=m(e),n=b(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),c?i.size--:e.size--}return!!n},forEach:function(t){for(var e,i=m(this),o=n(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:i.first;)for(o(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!b(this,t)}}),i(v,d?{get:function(t){var e=b(this,t);return e&&e.value},set:function(t,e){return y(this,0===t?0:t,e)}}:{add:function(t){return y(this,t=0===t?0:t,t)}}),c&&e(v,"size",{configurable:!0,get:function(){return m(this).size}}),g},setStrong:function(t,e,i){var n=e+" Iterator",o=p(e),r=p(n);a(t,e,function(t,e){f(this,{type:n,target:t,state:o(t),kind:e,last:null})},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)?h("keys"===e?i.key:"values"===e?i.value:[i.key,i.value],!1):(t.target=null,h(void 0,!0))},i?"entries":"values",!i,!0),d(e)}},kg}function Kg(){return Pg||(Pg=1,Ig||(Ig=1,Ug()("Map",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},Gg()))),Ng}var Zg,Qg,Jg,$g,tv,ev,iv,nv,ov,rv,sv,av={};function hv(){return Qg||(Qg=1,Zg=function(t,e){return 1===e?function(e,i){return e[t](i)}:function(e,i,n){return e[t](i,n)}}),Zg}function dv(){if($g)return Jg;$g=1;var t=Mt(),e=hv(),i=t("Map");return Jg={Map:i,set:e("set",2),get:e("get",1),has:e("has",1),remove:e("delete",1),proto:i.prototype}}function cv(){return iv?ev:(iv=1,fs(),Kg(),function(){if(tv)return av;tv=1;var t=ni(),e=D(),i=Lt(),n=kt(),o=qg(),r=dv(),s=ye(),a=C(),h=r.Map,d=r.has,c=r.get,l=r.set,u=e([].push),f=s||a(function(){return 1!==h.groupBy("ab",function(t){return t}).get("a").length});t({target:"Map",stat:!0,forced:s||f},{groupBy:function(t,e){n(t),i(e);var r=new h,s=0;return o(t,function(t){var i=e(t,s++);d(r,i)?u(c(r,i),t):l(r,i,[t])}),r}})}(),da(),ev=Pt().Map)}function lv(){if(ov)return nv;ov=1;var t=cv();return gs(),nv=t}var uv,fv,pv,gv,vv,mv,yv,bv,wv,_v=s(sv?rv:(sv=1,rv=lv())),xv={};function Ev(){return pv?fv:(pv=1,function(){if(uv)return xv;uv=1;var t=ni(),e=To().some;t({target:"Array",proto:!0,forced:!wh()("some")},{some:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}})}(),fv=Za()("Array","some"))}function Ov(){if(vv)return gv;vv=1;var t=Nt(),e=Ev(),i=Array.prototype;return gv=function(n){var o=n.some;return n===i||t(i,n)&&o===i.some?e:o},gv}function Sv(){return yv?mv:(yv=1,mv=Ov())}var Cv,Tv,kv,Dv,Iv,Pv,Mv,Nv,Fv=s(wv?bv:(wv=1,bv=Sv()));function zv(){return Tv?Cv:(Tv=1,fs(),Cv=Za()("Array","keys"))}function Av(){return Dv?kv:(Dv=1,kv=zv())}function Bv(){if(Pv)return Iv;Pv=1,gs();var t=Ki(),e=Ee(),i=Nt(),n=Av(),o=Array.prototype,r={DOMTokenList:!0,NodeList:!0};return Iv=function(s){var a=s.keys;return s===o||i(o,s)&&a===o.keys||e(r,t(s))?n:a},Iv}var jv,Rv,Lv,Hv,Wv,qv,Vv,Uv,Yv,Xv,Gv,Kv,Zv,Qv,Jv,$v,tm,em=s(Nv?Mv:(Nv=1,Mv=Bv())),im={};function nm(){if(Rv)return jv;Rv=1;var t=Un(),e=Math.floor,i=function(n,o){var r=n.length;if(r<8)for(var s,a,h=1;h<r;){for(a=h,s=n[h];a&&o(n[a-1],s)>0;)n[a]=n[--a];a!==h++&&(n[a]=s)}else for(var d=e(r/2),c=i(t(n,0,d),o),l=i(t(n,d),o),u=c.length,f=l.length,p=0,g=0;p<u||g<f;)n[p+g]=p<u&&g<f?o(c[p],l[g])<=0?c[p++]:l[g++]:p<u?c[p++]:l[g++];return n};return jv=i}function om(){if(Hv)return Lv;Hv=1;var t=Ft().match(/firefox\/(\d+)/i);return Lv=!!t&&+t[1]}function rm(){return qv?Wv:(qv=1,Wv=/MSIE|Trident/.test(Ft()))}function sm(){if(Uv)return Vv;Uv=1;var t=Ft().match(/AppleWebKit\/(\d+)\./);return Vv=!!t&&+t[1]}function am(){if(Yv)return im;Yv=1;var t=ni(),e=D(),i=Lt(),n=xe(),o=Ui(),r=Vc(),s=an(),a=C(),h=nm(),d=wh(),c=om(),l=rm(),u=zt(),f=sm(),p=[],g=e(p.sort),v=e(p.push),m=a(function(){p.sort(void 0)}),y=a(function(){p.sort(null)}),b=d("sort"),w=!a(function(){if(u)return u<70;if(!(c&&c>3)){if(l)return!0;if(f)return f<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++)p.push({k:e+n,v:i})}for(p.sort(function(t,e){return e.v-t.v}),n=0;n<p.length;n++)e=p[n].k.charAt(0),o.charAt(o.length-1)!==e&&(o+=e);return"DGBEFHACIJK"!==o}});return t({target:"Array",proto:!0,forced:m||!y||!b||!w},{sort:function(t){void 0!==t&&i(t);var e=n(this);if(w)return void 0===t?g(e):g(e,t);var a,d,c=[],l=o(e);for(d=0;d<l;d++)d in e&&v(c,e[d]);for(h(c,function(t){return function(e,i){return void 0===i?-1:void 0===e?1:void 0!==t?+t(e,i)||0:s(e)>s(i)?1:-1}}(t)),a=o(c),d=0;d<a;)e[d]=c[d++];for(;d<l;)r(e,d++);return e}}),im}function hm(){return Gv?Xv:(Gv=1,am(),Xv=Za()("Array","sort"))}function dm(){if(Zv)return Kv;Zv=1;var t=Nt(),e=hm(),i=Array.prototype;return Kv=function(n){var o=n.sort;return n===i||t(i,n)&&o===i.sort?e:o},Kv}function cm(){return Jv?Qv:(Jv=1,Qv=dm())}var lm,um,fm,pm,gm,vm,mm,ym,bm=s(tm?$v:(tm=1,$v=cm()));function wm(){return um?lm:(um=1,fs(),lm=Za()("Array","values"))}function _m(){return pm?fm:(pm=1,fm=wm())}function xm(){if(vm)return gm;vm=1,gs();var t=Ki(),e=Ee(),i=Nt(),n=_m(),o=Array.prototype,r={DOMTokenList:!0,NodeList:!0};return gm=function(s){var a=s.values;return s===o||i(o,s)&&a===o.values||e(r,t(s))?n:a},gm}var Em,Om,Sm=s(ym?mm:(ym=1,mm=xm()));var Cm,Tm,km,Dm,Im,Pm,Mm,Nm,Fm=s(Om?Em:(Om=1,Em=la()));function zm(){return Tm?Cm:(Tm=1,fs(),Cm=Za()("Array","entries"))}function Am(){return Dm?km:(Dm=1,km=zm())}function Bm(){if(Pm)return Im;Pm=1,gs();var t=Ki(),e=Ee(),i=Nt(),n=Am(),o=Array.prototype,r={DOMTokenList:!0,NodeList:!0};return Im=function(s){var a=s.entries;return s===o||i(o,s)&&a===o.entries||e(r,t(s))?n:a},Im}var jm=s(Nm?Mm:(Nm=1,Mm=Bm()));const Rm=[];for(let t=0;t<256;++t)Rm.push((t+256).toString(16).slice(1));const Lm=new Uint8Array(16);function Hm(t,e,i){return crypto.randomUUID?crypto.randomUUID():function(t){t=t||{};const e=t.random??t.rng?.()??crypto.getRandomValues(Lm);if(e.length<16)throw new Error("Random bytes length must be >= 16");return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(t,e=0){return(Rm[t[e+0]]+Rm[t[e+1]]+Rm[t[e+2]]+Rm[t[e+3]]+"-"+Rm[t[e+4]]+Rm[t[e+5]]+"-"+Rm[t[e+6]]+Rm[t[e+7]]+"-"+Rm[t[e+8]]+Rm[t[e+9]]+"-"+Rm[t[e+10]]+Rm[t[e+11]]+Rm[t[e+12]]+Rm[t[e+13]]+Rm[t[e+14]]+Rm[t[e+15]]).toLowerCase()}(e)}(t)}function Wm(t){return"string"==typeof t||"number"==typeof t}class qm{constructor(t){Fa(this,"_queue",[]),Fa(this,"_timeout",null),Fa(this,"_extended",null),this.delay=null,this.max=1/0,this.setOptions(t)}setOptions(t){t&&void 0!==t.delay&&(this.delay=t.delay),t&&void 0!==t.max&&(this.max=t.max),this._flushIfNeeded()}static extend(t,e){const i=new qm(e);if(void 0!==t.flush)throw new Error("Target object already has a property flush");t.flush=()=>{i.flush()};const n=[{name:"flush",original:void 0}];if(e&&e.replace)for(let o=0;o<e.replace.length;o++){const r=e.replace[o];n.push({name:r,original:t[r]}),i.replace(t,r)}return i._extended={object:t,methods:n},i}destroy(){if(this.flush(),this._extended){const t=this._extended.object,e=this._extended.methods;for(let i=0;i<e.length;i++){const n=e[i];n.original?t[n.name]=n.original:delete t[n.name]}this._extended=null}}replace(t,e){const i=this,n=t[e];if(!n)throw new Error("Method "+e+" undefined");t[e]=function(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];i.queue({args:e,fn:n,context:this})}}queue(t){"function"==typeof t?this._queue.push({fn:t}):this._queue.push(t),this._flushIfNeeded()}_flushIfNeeded(){this._queue.length>this.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&"number"==typeof this.delay&&(this._timeout=vu(()=>{this.flush()},this.delay))}flush(){var t,e;Ec(t=nl(e=this._queue).call(e,0)).call(t,t=>{t.fn.apply(t.context||t.fn,t.args||[])})}}class Vm{constructor(){Fa(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),Fa(this,"subscribe",Vm.prototype.on),Fa(this,"unsubscribe",Vm.prototype.off)}_trigger(t,e,i){var n;if("*"===t)throw new Error("Cannot trigger event *");Ec(n=[...this._subscribers[t],...this._subscribers["*"]]).call(n,n=>{n(t,e,null!=i?i:null)})}on(t,e){"function"==typeof e&&this._subscribers[t].push(e)}off(t,e){var i;this._subscribers[t]=Kh(i=this._subscribers[t]).call(i,t=>t!==e)}}var Um,Ym,Xm={};function Gm(){return Ym||(Ym=1,Um||(Um=1,Ug()("Set",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},Gg()))),Xm}var Km,Zm,Qm,Jm,$m,ty,ey,iy,ny,oy,ry,sy,ay,hy,dy,cy,ly,uy,fy,py,gy,vy={};function my(){if(Zm)return Km;Zm=1;var t=Rt(),e=TypeError;return Km=function(i){if("object"==typeof i&&"size"in i&&"has"in i&&"add"in i&&"delete"in i&&"keys"in i)return i;throw new e(t(i)+" is not a set")},Km}function yy(){if(Jm)return Qm;Jm=1;var t=Mt(),e=hv(),i=t("Set"),n=i.prototype;return Qm={Set:i,add:e("add",1),has:e("has",1),remove:e("delete",1),proto:n}}function by(){if(ty)return $m;ty=1;var t=R();return $m=function(e,i,n){for(var o,r,s=n?e:e.iterator,a=e.next;!(o=t(a,s)).done;)if(void 0!==(r=i(o.value)))return r},$m}function wy(){if(iy)return ey;iy=1;var t=by();return ey=function(e,i,n){return n?t(e.keys(),i,!0):e.forEach(i)},ey}function _y(){if(oy)return ny;oy=1;var t=yy(),e=wy(),i=t.Set,n=t.add;return ny=function(t){var o=new i;return e(t,function(t){n(o,t)}),o},ny}function xy(){return sy||(sy=1,ry=function(t){return t.size}),ry}function Ey(){return hy?ay:(hy=1,ay=function(t){return{iterator:t,next:t.next,done:!1}})}function Oy(){if(cy)return dy;cy=1;var t=Lt(),e=ti(),i=R(),n=qi(),o=Ey(),r="Invalid size",s=RangeError,a=TypeError,h=Math.max,d=function(e,i){this.set=e,this.size=h(i,0),this.has=t(e.has),this.keys=t(e.keys)};return d.prototype={getIterator:function(){return o(e(i(this.keys,this.set)))},includes:function(t){return i(this.has,this.set,t)}},dy=function(t){e(t);var i=+t.size;if(i!=i)throw new a(r);var o=n(i);if(o<0)throw new s(r);return new d(t,o)}}function Sy(){if(uy)return ly;uy=1;var t=my(),e=yy(),i=_y(),n=xy(),o=Oy(),r=wy(),s=by(),a=e.has,h=e.remove;return ly=function(e){var d=t(this),c=o(e),l=i(d);return n(d)<=c.size?r(d,function(t){c.includes(t)&&h(l,t)}):s(c.getIterator(),function(t){a(l,t)&&h(l,t)}),l}}function Cy(){return py?fy:(py=1,fy=function(){return!1})}var Ty,ky,Dy,Iy={};function Py(){if(ky)return Ty;ky=1;var t=my(),e=yy(),i=xy(),n=Oy(),o=wy(),r=by(),s=e.Set,a=e.add,h=e.has;return Ty=function(e){var d=t(this),c=n(e),l=new s;return i(d)>c.size?r(c.getIterator(),function(t){h(d,t)&&a(l,t)}):o(d,function(t){c.includes(t)&&a(l,t)}),l}}var My,Ny,Fy,zy={};function Ay(){if(Ny)return My;Ny=1;var t=my(),e=yy().has,i=xy(),n=Oy(),o=wy(),r=by(),s=Wg();return My=function(a){var h=t(this),d=n(a);if(i(h)<=d.size)return!1!==o(h,function(t){if(d.includes(t))return!1},!0);var c=d.getIterator();return!1!==r(c,function(t){if(e(h,t))return s(c,"normal",!1)})},My}var By,jy,Ry,Ly={};function Hy(){if(jy)return By;jy=1;var t=my(),e=xy(),i=wy(),n=Oy();return By=function(o){var r=t(this),s=n(o);return!(e(r)>s.size)&&!1!==i(r,function(t){if(!s.includes(t))return!1},!0)}}var Wy,qy,Vy,Uy={};function Yy(){if(qy)return Wy;qy=1;var t=my(),e=yy().has,i=xy(),n=Oy(),o=by(),r=Wg();return Wy=function(s){var a=t(this),h=n(s);if(i(a)<h.size)return!1;var d=h.getIterator();return!1!==o(d,function(t){if(!e(a,t))return r(d,"normal",!1)})},Wy}var Xy,Gy,Ky,Zy,Qy,Jy={};function $y(){if(Gy)return Xy;Gy=1;var t=my(),e=yy(),i=_y(),n=Oy(),o=by(),r=e.add,s=e.has,a=e.remove;return Xy=function(e){var h=t(this),d=n(e).getIterator(),c=i(h);return o(d,function(t){s(h,t)?a(c,t):r(c,t)}),c}}function tb(){return Zy?Ky:(Zy=1,Ky=function(t){try{var e=new Set,i={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return e.clear(),e.add(4),function(){return{done:!0}}}})}},n=e[t](i);return 1===n.size&&4===n.values().next().value}catch(t){return!1}})}var eb,ib,nb,ob,rb,sb,ab,hb,db,cb={};function lb(){if(ib)return eb;ib=1;var t=my(),e=yy().add,i=_y(),n=Oy(),o=by();return eb=function(r){var s=t(this),a=n(r).getIterator(),h=i(s);return o(a,function(t){e(h,t)}),h},eb}function ub(){return rb?ob:(rb=1,fs(),Gm(),function(){if(gy)return vy;gy=1;var t=ni(),e=Sy(),i=C(),n=!Cy()("difference",function(t){return 0===t.size})||i(function(){var t={size:1,has:function(){return!0},keys:function(){var t=0;return{next:function(){var i=t++>1;return e.has(1)&&e.clear(),{done:i,value:2}}}}},e=new Set([1,2,3,4]);return 3!==e.difference(t).size});t({target:"Set",proto:!0,real:!0,forced:n},{difference:e})}(),function(){if(Dy)return Iy;Dy=1;var t=ni(),e=C(),i=Py();t({target:"Set",proto:!0,real:!0,forced:!Cy()("intersection",function(t){return 2===t.size&&t.has(1)&&t.has(2)})||e(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:i})}(),function(){if(Fy)return zy;Fy=1;var t=ni(),e=Ay();t({target:"Set",proto:!0,real:!0,forced:!Cy()("isDisjointFrom",function(t){return!t})},{isDisjointFrom:e})}(),function(){if(Ry)return Ly;Ry=1;var t=ni(),e=Hy();t({target:"Set",proto:!0,real:!0,forced:!Cy()("isSubsetOf",function(t){return t})},{isSubsetOf:e})}(),function(){if(Vy)return Uy;Vy=1;var t=ni(),e=Yy();t({target:"Set",proto:!0,real:!0,forced:!Cy()("isSupersetOf",function(t){return!t})},{isSupersetOf:e})}(),function(){if(Qy)return Jy;Qy=1;var t=ni(),e=$y(),i=tb();t({target:"Set",proto:!0,real:!0,forced:!Cy()("symmetricDifference")||!i("symmetricDifference")},{symmetricDifference:e})}(),function(){if(nb)return cb;nb=1;var t=ni(),e=lb(),i=tb();t({target:"Set",proto:!0,real:!0,forced:!Cy()("union")||!i("union")},{union:e})}(),da(),ob=Pt().Set)}function fb(){if(ab)return sb;ab=1;var t=ub();return gs(),sb=t}var pb,gb,vb,mb,yb,bb,wb,_b,xb,Eb,Ob,Sb,Cb=s(db?hb:(db=1,hb=fb()));function Tb(){return gb?pb:(gb=1,fs(),da(),pb=Hg())}function kb(){if(mb)return vb;mb=1;var t=Tb();return gs(),vb=t}function Db(){return bb?yb:(bb=1,yb=kb())}function Ib(){return _b?wb:(_b=1,wb=Db())}function Pb(){return Eb?xb:(Eb=1,xb=Ib())}var Mb=s(Sb?Ob:(Sb=1,Ob=Pb()));class Nb{constructor(t){this._pairs=t}*[Fm](){for(const[t,e]of this._pairs)yield[t,e]}*entries(){for(const[t,e]of this._pairs)yield[t,e]}*keys(){for(const[t]of this._pairs)yield t}*values(){for(const[,t]of this._pairs)yield t}toIdArray(){var t;return id(t=[...this._pairs]).call(t,t=>t[0])}toItemArray(){var t;return id(t=[...this._pairs]).call(t,t=>t[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){const t=ql(null);for(const[e,i]of this._pairs)t[e]=i;return t}toMap(){return new _v(this._pairs)}toIdSet(){return new Cb(this.toIdArray())}toItemSet(){return new Cb(this.toItemArray())}cache(){return new Nb([...this._pairs])}distinct(t){const e=new Cb;for(const[i,n]of this._pairs)e.add(t(n,i));return e}filter(t){const e=this._pairs;return new Nb({*[Fm](){for(const[i,n]of e)t(n,i)&&(yield[i,n])}})}forEach(t){for(const[e,i]of this._pairs)t(i,e)}map(t){const e=this._pairs;return new Nb({*[Fm](){for(const[i,n]of e)yield[i,t(n,i)]}})}max(t){const e=Mb(this._pairs);let i=e.next();if(i.done)return null;let n=i.value[1],o=t(i.value[1],i.value[0]);for(;!(i=e.next()).done;){const[e,r]=i.value,s=t(r,e);s>o&&(o=s,n=r)}return n}min(t){const e=Mb(this._pairs);let i=e.next();if(i.done)return null;let n=i.value[1],o=t(i.value[1],i.value[0]);for(;!(i=e.next()).done;){const[e,r]=i.value,s=t(r,e);s<o&&(o=s,n=r)}return n}reduce(t,e){for(const[i,n]of this._pairs)e=t(e,n,i);return e}sort(t){return new Nb({[Fm]:()=>{var e;return Mb(bm(e=[...this._pairs]).call(e,(e,i)=>{let[n,o]=e,[r,s]=i;return t(o,s,n,r)}))}})}}function Fb(t,e){var i=hc(t);if(Cp){var n=Cp(t);e&&(n=Kh(n).call(n,function(e){return jp(t,e).enumerable})),i.push.apply(i,n)}return i}function zb(t){for(var e=1;e<arguments.length;e++){var i,n,o=null!=arguments[e]?arguments[e]:{};e%2?Ec(i=Fb(Object(o),!0)).call(i,function(e){Fa(t,e,o[e])}):Gp?ig(t,Gp(o)):Ec(n=Fb(Object(o))).call(n,function(e){Mg(t,e,jp(o,e))})}return t}class Ab extends Vm{get idProp(){return this._idProp}constructor(t,e){super(),Fa(this,"_queue",null),t&&!Xd(t)&&(e=t,t=[]),this._options=e||{},this._data=new _v,this.length=0,this._idProp=this._options.fieldId||"id",t&&t.length&&this.add(t),this.setOptions(e)}setOptions(t){t&&void 0!==t.queue&&(!1===t.queue?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=qm.extend(this,{replace:["add","update","remove"]})),t.queue&&"object"==typeof t.queue&&this._queue.setOptions(t.queue)))}add(t,e){const i=[];let n;if(Xd(t)){const e=id(t).call(t,t=>t[this._idProp]);if(Fv(e).call(e,t=>this._data.has(t)))throw new Error("A duplicate id was found in the parameter array.");for(let e=0,o=t.length;e<o;e++)n=this._addItem(t[e]),i.push(n)}else{if(!t||"object"!=typeof t)throw new Error("Unknown dataType");n=this._addItem(t),i.push(n)}return i.length&&this._trigger("add",{items:i},e),i}update(t,e){const i=[],n=[],o=[],r=[],s=this._idProp,a=t=>{const e=t[s];if(null!=e&&this._data.has(e)){const i=t,s=vl({},this._data.get(e)),a=this._updateItem(i);n.push(a),r.push(i),o.push(s)}else{const e=this._addItem(t);i.push(e)}};if(Xd(t))for(let e=0,i=t.length;e<i;e++)t[e]&&"object"==typeof t[e]?a(t[e]):console.warn("Ignoring input item, which is not an object at index "+e);else{if(!t||"object"!=typeof t)throw new Error("Unknown dataType");a(t)}if(i.length&&this._trigger("add",{items:i},e),n.length){const t={items:n,oldData:o,data:r};this._trigger("update",t,e)}return Tl(i).call(i,n)}updateOnly(t,e){var i;Xd(t)||(t=[t]);const n=id(i=id(t).call(t,t=>{const e=this._data.get(t[this._idProp]);if(null==e)throw new Error("Updating non-existent items is not allowed.");return{oldData:e,update:t}})).call(i,t=>{let{oldData:e,update:i}=t;const n=e[this._idProp],o=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return sp({},t,...i)}(e,i);return this._data.set(n,o),{id:n,oldData:e,updatedData:o}});if(n.length){const t={items:id(n).call(n,t=>t.id),oldData:id(n).call(n,t=>t.oldData),data:id(n).call(n,t=>t.updatedData)};return this._trigger("update",t,e),t.items}return[]}get(t,e){let i,n,o;Wm(t)?(i=t,o=e):Xd(t)?(n=t,o=e):o=t;const r=o&&"Object"===o.returnType?"Object":"Array",s=o&&Kh(o),a=[];let h,d,c;if(null!=i)h=this._data.get(i),h&&s&&!s(h)&&(h=void 0);else if(null!=n)for(let t=0,e=n.length;t<e;t++)h=this._data.get(n[t]),null==h||s&&!s(h)||a.push(h);else{var l;d=[...em(l=this._data).call(l)];for(let t=0,e=d.length;t<e;t++)c=d[t],h=this._data.get(c),null==h||s&&!s(h)||a.push(h)}if(o&&o.order&&null==i&&this._sort(a,o.order),o&&o.fields){const t=o.fields;if(null!=i&&null!=h)h=this._filterFields(h,t);else for(let e=0,i=a.length;e<i;e++)a[e]=this._filterFields(a[e],t)}if("Object"==r){const t={};for(let e=0,i=a.length;e<i;e++){const i=a[e];t[i[this._idProp]]=i}return t}return null!=i?null!=h?h:null:a}getIds(t){const e=this._data,i=t&&Kh(t),n=t&&t.order,o=[...em(e).call(e)],r=[];if(i)if(n){const t=[];for(let e=0,n=o.length;e<n;e++){const n=o[e],r=this._data.get(n);null!=r&&i(r)&&t.push(r)}this._sort(t,n);for(let e=0,i=t.length;e<i;e++)r.push(t[e][this._idProp])}else for(let t=0,e=o.length;t<e;t++){const e=o[t],n=this._data.get(e);null!=n&&i(n)&&r.push(n[this._idProp])}else if(n){const t=[];for(let i=0,n=o.length;i<n;i++){const n=o[i];t.push(e.get(n))}this._sort(t,n);for(let e=0,i=t.length;e<i;e++)r.push(t[e][this._idProp])}else for(let t=0,i=o.length;t<i;t++){const i=o[t],n=e.get(i);null!=n&&r.push(n[this._idProp])}return r}getDataSet(){return this}forEach(t,e){const i=e&&Kh(e),n=this._data,o=[...em(n).call(n)];if(e&&e.order){const i=this.get(e);for(let e=0,n=i.length;e<n;e++){const n=i[e];t(n,n[this._idProp])}}else for(let e=0,n=o.length;e<n;e++){const n=o[e],r=this._data.get(n);null==r||i&&!i(r)||t(r,n)}}map(t,e){const i=e&&Kh(e),n=[],o=this._data,r=[...em(o).call(o)];for(let e=0,o=r.length;e<o;e++){const o=r[e],s=this._data.get(o);null==s||i&&!i(s)||n.push(t(s,o))}return e&&e.order&&this._sort(n,e.order),n}_filterFields(t,e){var i;return t?zh(i=Xd(e)?e:hc(e)).call(i,(e,i)=>(e[i]=t[i],e),{}):t}_sort(t,e){if("string"==typeof e){const i=e;bm(t).call(t,(t,e)=>{const n=t[i],o=e[i];return n>o?1:n<o?-1:0})}else{if("function"!=typeof e)throw new TypeError("Order must be a function or a string");bm(t).call(t,e)}}remove(t,e){const i=[],n=[],o=Xd(t)?t:[t];for(let t=0,e=o.length;t<e;t++){const e=this._remove(o[t]);if(e){const t=e[this._idProp];null!=t&&(i.push(t),n.push(e))}}return i.length&&this._trigger("remove",{items:i,oldData:n},e),i}_remove(t){let e;if(Wm(t)?e=t:t&&"object"==typeof t&&(e=t[this._idProp]),null!=e&&this._data.has(e)){const t=this._data.get(e)||null;return this._data.delete(e),--this.length,t}return null}clear(t){var e;const i=[...em(e=this._data).call(e)],n=[];for(let t=0,e=i.length;t<e;t++)n.push(this._data.get(i[t]));return this._data.clear(),this.length=0,this._trigger("remove",{items:i,oldData:n},t),i}max(t){let e=null,i=null;for(const o of Sm(n=this._data).call(n)){var n;const r=o[t];"number"==typeof r&&(null==i||r>i)&&(e=o,i=r)}return e||null}min(t){let e=null,i=null;for(const o of Sm(n=this._data).call(n)){var n;const r=o[t];"number"==typeof r&&(null==i||r<i)&&(e=o,i=r)}return e||null}distinct(t){const e=this._data,i=[...em(e).call(e)],n=[];let o=0;for(let r=0,s=i.length;r<s;r++){const s=i[r],a=e.get(s)[t];let h=!1;for(let t=0;t<o;t++)if(n[t]==a){h=!0;break}h||void 0===a||(n[o]=a,o++)}return n}_addItem(t){const e=function(t,e){return null==t[e]&&(t[e]=Hm()),t}(t,this._idProp),i=e[this._idProp];if(this._data.has(i))throw new Error("Cannot add item: item with id "+i+" already exists");return this._data.set(i,e),++this.length,i}_updateItem(t){const e=t[this._idProp];if(null==e)throw new Error("Cannot update item: item has no id (item: "+eu(t)+")");const i=this._data.get(e);if(!i)throw new Error("Cannot update item: no item with id "+e+" found");return this._data.set(e,zb(zb({},i),t)),e}stream(t){if(t){const e=this._data;return new Nb({*[Fm](){for(const i of t){const t=e.get(i);null!=t&&(yield[i,t])}}})}var e;return new Nb({[Fm]:mh(e=jm(this._data)).call(e,this._data)})}}function Bb(t,e){return"object"==typeof e&&null!==e&&t===e.idProp&&"function"==typeof Ec(e)&&"function"==typeof e.get&&"function"==typeof e.getDataSet&&"function"==typeof e.getIds&&"number"==typeof e.length&&"function"==typeof id(e)&&"function"==typeof e.off&&"function"==typeof e.on&&"function"==typeof e.stream&&function(t,e){return"object"==typeof e&&null!==e&&t===e.idProp&&"function"==typeof e.add&&"function"==typeof e.clear&&"function"==typeof e.distinct&&"function"==typeof Ec(e)&&"function"==typeof e.get&&"function"==typeof e.getDataSet&&"function"==typeof e.getIds&&"number"==typeof e.length&&"function"==typeof id(e)&&"function"==typeof e.max&&"function"==typeof e.min&&"function"==typeof e.off&&"function"==typeof e.on&&"function"==typeof e.remove&&"function"==typeof e.setOptions&&"function"==typeof e.stream&&"function"==typeof e.update&&"function"==typeof e.updateOnly}(t,e.getDataSet())}var jb="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Rb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Lb,Hb,Wb,qb,Vb,Ub,Yb,Xb,Gb,Kb,Zb,Qb,Jb,$b,tw,ew,iw={};function nw(){if(Hb)return Lb;Hb=1;var t=function(t){return t&&t.Math===Math&&t};return Lb=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof jb&&jb)||t("object"==typeof Lb&&Lb)||function(){return this}()||Function("return this")()}function ow(){return qb?Wb:(qb=1,Wb=function(t){try{return!!t()}catch(t){return!0}})}function rw(){return Ub?Vb:(Ub=1,Vb=!ow()(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))}function sw(){if(Xb)return Yb;Xb=1;var t=rw(),e=Function.prototype,i=e.apply,n=e.call;return Yb="object"==typeof Reflect&&Reflect.apply||(t?n.bind(i):function(){return n.apply(i,arguments)}),Yb}function aw(){if(Kb)return Gb;Kb=1;var t=rw(),e=Function.prototype,i=e.call,n=t&&e.bind.bind(i,i);return Gb=t?n:function(t){return function(){return i.apply(t,arguments)}},Gb}function hw(){if(Qb)return Zb;Qb=1;var t=aw(),e=t({}.toString),i=t("".slice);return Zb=function(t){return i(e(t),8,-1)},Zb}function dw(){if($b)return Jb;$b=1;var t=hw(),e=aw();return Jb=function(i){if("Function"===t(i))return e(i)}}function cw(){if(ew)return tw;ew=1;var t="object"==typeof document&&document.all;return tw=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(t){return"function"==typeof t}}var lw,uw,fw,pw,gw={};function vw(){return uw?lw:(uw=1,lw=!ow()(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function mw(){if(pw)return fw;pw=1;var t=rw(),e=Function.prototype.call;return fw=t?e.bind(e):function(){return e.apply(e,arguments)},fw}var yw,bw,ww,_w,xw,Ew,Ow,Sw,Cw,Tw,kw,Dw,Iw,Pw,Mw,Nw,Fw,zw,Aw,Bw,jw,Rw,Lw,Hw,Ww,qw,Vw,Uw,Yw,Xw,Gw,Kw,Zw,Qw,Jw,$w,t_,e_={};function i_(){if(yw)return e_;yw=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,i=e&&!t.call({1:2},1);return e_.f=i?function(t){var i=e(this,t);return!!i&&i.enumerable}:t,e_}function n_(){return ww?bw:(ww=1,bw=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}})}function o_(){if(xw)return _w;xw=1;var t=aw(),e=ow(),i=hw(),n=Object,o=t("".split);return _w=e(function(){return!n("z").propertyIsEnumerable(0)})?function(t){return"String"===i(t)?o(t,""):n(t)}:n,_w}function r_(){return Ow||(Ow=1,Ew=function(t){return null==t}),Ew}function s_(){if(Cw)return Sw;Cw=1;var t=r_(),e=TypeError;return Sw=function(i){if(t(i))throw new e("Can't call method on "+i);return i},Sw}function a_(){if(kw)return Tw;kw=1;var t=o_(),e=s_();return Tw=function(i){return t(e(i))},Tw}function h_(){if(Iw)return Dw;Iw=1;var t=cw();return Dw=function(e){return"object"==typeof e?null!==e:t(e)},Dw}function d_(){return Mw?Pw:(Mw=1,Pw={})}function c_(){if(Fw)return Nw;Fw=1;var t=d_(),e=nw(),i=cw(),n=function(t){return i(t)?t:void 0};return Nw=function(i,o){return arguments.length<2?n(t[i])||n(e[i]):t[i]&&t[i][o]||e[i]&&e[i][o]},Nw}function l_(){return Aw?zw:(Aw=1,zw=aw()({}.isPrototypeOf))}function u_(){if(jw)return Bw;jw=1;var t=nw().navigator,e=t&&t.userAgent;return Bw=e?String(e):""}function f_(){if(Lw)return Rw;Lw=1;var t,e,i=nw(),n=u_(),o=i.process,r=i.Deno,s=o&&o.versions||r&&r.version,a=s&&s.v8;return a&&(e=(t=a.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!e&&n&&(!(t=n.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=n.match(/Chrome\/(\d+)/))&&(e=+t[1]),Rw=e}function p_(){if(Ww)return Hw;Ww=1;var t=f_(),e=ow(),i=nw().String;return Hw=!!Object.getOwnPropertySymbols&&!e(function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&t&&t<41}),Hw}function g_(){return Vw?qw:(Vw=1,qw=p_()&&!Symbol.sham&&"symbol"==typeof Symbol.iterator)}function v_(){if(Yw)return Uw;Yw=1;var t=c_(),e=cw(),i=l_(),n=Object;return Uw=g_()?function(t){return"symbol"==typeof t}:function(o){var r=t("Symbol");return e(r)&&i(r.prototype,n(o))},Uw}function m_(){if(Gw)return Xw;Gw=1;var t=String;return Xw=function(e){try{return t(e)}catch(t){return"Object"}}}function y_(){if(Zw)return Kw;Zw=1;var t=cw(),e=m_(),i=TypeError;return Kw=function(n){if(t(n))return n;throw new i(e(n)+" is not a function")}}function b_(){if(Jw)return Qw;Jw=1;var t=y_(),e=r_();return Qw=function(i,n){var o=i[n];return e(o)?void 0:t(o)}}function w_(){if(t_)return $w;t_=1;var t=mw(),e=cw(),i=h_(),n=TypeError;return $w=function(o,r){var s,a;if("string"===r&&e(s=o.toString)&&!i(a=t(s,o)))return a;if(e(s=o.valueOf)&&!i(a=t(s,o)))return a;if("string"!==r&&e(s=o.toString)&&!i(a=t(s,o)))return a;throw new n("Can't convert object to primitive value")}}var __,x_,E_,O_,S_,C_,T_,k_,D_,I_,P_,M_,N_,F_,z_,A_,B_,j_,R_,L_,H_,W_,q_,V_,U_,Y_,X_,G_,K_={exports:{}};function Z_(){return x_?__:(x_=1,__=!0)}function Q_(){if(O_)return E_;O_=1;var t=nw(),e=Object.defineProperty;return E_=function(i,n){try{e(t,i,{value:n,configurable:!0,writable:!0})}catch(e){t[i]=n}return n}}function J_(){if(S_)return K_.exports;S_=1;var t=Z_(),e=nw(),i=Q_(),n="__core-js_shared__",o=K_.exports=e[n]||i(n,{});return(o.versions||(o.versions=[])).push({version:"3.44.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.44.0/LICENSE",source:"https://github.com/zloirock/core-js"}),K_.exports}function $_(){if(T_)return C_;T_=1;var t=J_();return C_=function(e,i){return t[e]||(t[e]=i||{})}}function tx(){if(D_)return k_;D_=1;var t=s_(),e=Object;return k_=function(i){return e(t(i))}}function ex(){if(P_)return I_;P_=1;var t=aw(),e=tx(),i=t({}.hasOwnProperty);return I_=Object.hasOwn||function(t,n){return i(e(t),n)},I_}function ix(){if(N_)return M_;N_=1;var t=aw(),e=0,i=Math.random(),n=t(1.1.toString);return M_=function(t){return"Symbol("+(void 0===t?"":t)+")_"+n(++e+i,36)}}function nx(){if(z_)return F_;z_=1;var t=nw(),e=$_(),i=ex(),n=ix(),o=p_(),r=g_(),s=t.Symbol,a=e("wks"),h=r?s.for||s:s&&s.withoutSetter||n;return F_=function(t){return i(a,t)||(a[t]=o&&i(s,t)?s[t]:h("Symbol."+t)),a[t]}}function ox(){if(B_)return A_;B_=1;var t=mw(),e=h_(),i=v_(),n=b_(),o=w_(),r=TypeError,s=nx()("toPrimitive");return A_=function(a,h){if(!e(a)||i(a))return a;var d,c=n(a,s);if(c){if(void 0===h&&(h="default"),d=t(c,a,h),!e(d)||i(d))return d;throw new r("Can't convert object to primitive value")}return void 0===h&&(h="number"),o(a,h)}}function rx(){if(R_)return j_;R_=1;var t=ox(),e=v_();return j_=function(i){var n=t(i,"string");return e(n)?n:n+""}}function sx(){if(H_)return L_;H_=1;var t=nw(),e=h_(),i=t.document,n=e(i)&&e(i.createElement);return L_=function(t){return n?i.createElement(t):{}},L_}function ax(){if(q_)return W_;q_=1;var t=vw(),e=ow(),i=sx();return W_=!t&&!e(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})}function hx(){if(V_)return gw;V_=1;var t=vw(),e=mw(),i=i_(),n=n_(),o=a_(),r=rx(),s=ex(),a=ax(),h=Object.getOwnPropertyDescriptor;return gw.f=t?h:function(t,d){if(t=o(t),d=r(d),a)try{return h(t,d)}catch(t){}if(s(t,d))return n(!e(i.f,t,d),t[d])},gw}function dx(){if(Y_)return U_;Y_=1;var t=ow(),e=cw(),i=/#|\.prototype\./,n=function(i,n){var h=r[o(i)];return h===a||h!==s&&(e(n)?t(n):!!n)},o=n.normalize=function(t){return String(t).replace(i,".").toLowerCase()},r=n.data={},s=n.NATIVE="N",a=n.POLYFILL="P";return U_=n}function cx(){if(G_)return X_;G_=1;var t=dw(),e=y_(),i=rw(),n=t(t.bind);return X_=function(t,o){return e(t),void 0===o?t:i?n(t,o):function(){return t.apply(o,arguments)}},X_}var lx,ux,fx,px,gx,vx,mx,yx,bx,wx,_x,xx,Ex,Ox,Sx,Cx,Tx,kx,Dx,Ix,Px,Mx,Nx,Fx,zx,Ax,Bx,jx,Rx,Lx={};function Hx(){return ux?lx:(ux=1,lx=vw()&&ow()(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}))}function Wx(){if(px)return fx;px=1;var t=h_(),e=String,i=TypeError;return fx=function(n){if(t(n))return n;throw new i(e(n)+" is not an object")}}function qx(){if(gx)return Lx;gx=1;var t=vw(),e=ax(),i=Hx(),n=Wx(),o=rx(),r=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,h="enumerable",d="configurable",c="writable";return Lx.f=t?i?function(t,e,i){if(n(t),e=o(e),n(i),"function"==typeof t&&"prototype"===e&&"value"in i&&c in i&&!i[c]){var r=a(t,e);r&&r[c]&&(t[e]=i.value,i={configurable:d in i?i[d]:r[d],enumerable:h in i?i[h]:r[h],writable:!1})}return s(t,e,i)}:s:function(t,i,a){if(n(t),i=o(i),n(a),e)try{return s(t,i,a)}catch(t){}if("get"in a||"set"in a)throw new r("Accessors not supported");return"value"in a&&(t[i]=a.value),t},Lx}function Vx(){if(mx)return vx;mx=1;var t=vw(),e=qx(),i=n_();return vx=t?function(t,n,o){return e.f(t,n,i(1,o))}:function(t,e,i){return t[e]=i,t},vx}function Ux(){if(bx)return yx;bx=1;var t=nw(),e=sw(),i=dw(),n=cw(),o=hx().f,r=dx(),s=d_(),a=cx(),h=Vx(),d=ex(),c=function(t){var i=function(n,o,r){if(this instanceof i){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,o)}return new t(n,o,r)}return e(t,this,arguments)};return i.prototype=t.prototype,i};return yx=function(e,l){var u,f,p,g,v,m,y,b,w,_=e.target,x=e.global,E=e.stat,O=e.proto,S=x?t:E?t[_]:t[_]&&t[_].prototype,C=x?s:s[_]||h(s,_,{})[_],T=C.prototype;for(g in l)f=!(u=r(x?g:_+(E?".":"#")+g,e.forced))&&S&&d(S,g),m=C[g],f&&(y=e.dontCallGetSet?(w=o(S,g))&&w.value:S[g]),v=f&&y?y:l[g],(u||O||typeof m!=typeof v)&&(b=e.bind&&f?a(v,t):e.wrap&&f?c(v):O&&n(v)?i(v):v,(e.sham||v&&v.sham||m&&m.sham)&&h(b,"sham",!0),h(C,g,b),O&&(d(s,p=_+"Prototype")||h(s,p,{}),h(s[p],g,v),e.real&&T&&(u||!T[g])&&h(T,g,v)))}}function Yx(){if(_x)return wx;_x=1;var t=Math.ceil,e=Math.floor;return wx=Math.trunc||function(i){var n=+i;return(n>0?e:t)(n)}}function Xx(){if(Ex)return xx;Ex=1;var t=Yx();return xx=function(e){var i=+e;return i!=i||0===i?0:t(i)},xx}function Gx(){if(Sx)return Ox;Sx=1;var t=Xx(),e=Math.max,i=Math.min;return Ox=function(n,o){var r=t(n);return r<0?e(r+o,0):i(r,o)},Ox}function Kx(){if(Tx)return Cx;Tx=1;var t=Xx(),e=Math.min;return Cx=function(i){var n=t(i);return n>0?e(n,9007199254740991):0}}function Zx(){if(Dx)return kx;Dx=1;var t=Kx();return kx=function(e){return t(e.length)}}function Qx(){if(Px)return Ix;Px=1;var t=a_(),e=Gx(),i=Zx(),n=function(n){return function(o,r,s){var a=t(o),h=i(a);if(0===h)return!n&&-1;var d,c=e(s,h);if(n&&r!=r){for(;h>c;)if((d=a[c++])!=d)return!0}else for(;h>c;c++)if((n||c in a)&&a[c]===r)return n||c||0;return!n&&-1}};return Ix={includes:n(!0),indexOf:n(!1)}}function Jx(){return Nx?Mx:(Nx=1,Mx={})}function $x(){if(zx)return Fx;zx=1;var t=aw(),e=ex(),i=a_(),n=Qx().indexOf,o=Jx(),r=t([].push);return Fx=function(t,s){var a,h=i(t),d=0,c=[];for(a in h)!e(o,a)&&e(h,a)&&r(c,a);for(;s.length>d;)e(h,a=s[d++])&&(~n(c,a)||r(c,a));return c},Fx}function tE(){return Bx?Ax:(Bx=1,Ax=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}function eE(){if(Rx)return jx;Rx=1;var t=$x(),e=tE();return jx=Object.keys||function(i){return t(i,e)}}var iE,nE,oE,rE,sE,aE,hE,dE,cE,lE,uE={};function fE(){return iE||(iE=1,uE.f=Object.getOwnPropertySymbols),uE}function pE(){if(oE)return nE;oE=1;var t=vw(),e=aw(),i=mw(),n=ow(),o=eE(),r=fE(),s=i_(),a=tx(),h=o_(),d=Object.assign,c=Object.defineProperty,l=e([].concat);return nE=!d||n(function(){if(t&&1!==d({b:1},d(c({},"a",{enumerable:!0,get:function(){c(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},i={},n=Symbol("assign detection"),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(t){i[t]=t}),7!==d({},e)[n]||o(d({},i)).join("")!==r})?function(e,n){for(var d=a(e),c=arguments.length,u=1,f=r.f,p=s.f;c>u;)for(var g,v=h(arguments[u++]),m=f?l(o(v),f(v)):o(v),y=m.length,b=0;y>b;)g=m[b++],t&&!i(p,v,g)||(d[g]=v[g]);return d}:d,nE}function gE(){return aE?sE:(aE=1,function(){if(rE)return iw;rE=1;var t=Ux(),e=pE();t({target:"Object",stat:!0,arity:2,forced:Object.assign!==e},{assign:e})}(),sE=d_().Object.assign)}function vE(){return dE?hE:(dE=1,hE=gE())}var mE,yE,bE,wE,_E,xE,EE,OE,SE,CE,TE,kE,DE,IE,PE,ME=Rb(lE?cE:(lE=1,cE=vE())),NE={};function FE(){return yE?mE:(yE=1,mE=aw()([].slice))}function zE(){if(wE)return bE;wE=1;var t=aw(),e=y_(),i=h_(),n=ex(),o=FE(),r=rw(),s=Function,a=t([].concat),h=t([].join),d={};return bE=r?s.bind:function(t){var r=e(this),c=r.prototype,l=o(arguments,1),u=function(){var e=a(l,o(arguments));return this instanceof u?function(t,e,i){if(!n(d,e)){for(var o=[],r=0;r<e;r++)o[r]="a["+r+"]";d[e]=s("C,a","return new C("+h(o,",")+")")}return d[e](t,i)}(r,e.length,e):r.apply(t,e)};return i(c)&&(u.prototype=c),u},bE}function AE(){if(EE)return xE;EE=1;var t=nw(),e=d_();return xE=function(i,n){var o=e[i+"Prototype"],r=o&&o[n];if(r)return r;var s=t[i],a=s&&s.prototype;return a&&a[n]}}function BE(){return SE?OE:(SE=1,function(){if(_E)return NE;_E=1;var t=Ux(),e=zE();t({target:"Function",proto:!0,forced:Function.bind!==e},{bind:e})}(),OE=AE()("Function","bind"))}function jE(){if(TE)return CE;TE=1;var t=l_(),e=BE(),i=Function.prototype;return CE=function(n){var o=n.bind;return n===i||t(i,n)&&o===i.bind?e:o},CE}function RE(){return DE?kE:(DE=1,kE=jE())}var LE=Rb(PE?IE:(PE=1,IE=RE()));function HE(t,e,i,n){t.beginPath(),t.arc(e,i,n,0,2*Math.PI,!1),t.closePath()}function WE(t,e,i,n,o,r){const s=Math.PI/180;n-2*r<0&&(r=n/2),o-2*r<0&&(r=o/2),t.beginPath(),t.moveTo(e+r,i),t.lineTo(e+n-r,i),t.arc(e+n-r,i+r,r,270*s,360*s,!1),t.lineTo(e+n,i+o-r),t.arc(e+n-r,i+o-r,r,0,90*s,!1),t.lineTo(e+r,i+o),t.arc(e+r,i+o-r,r,90*s,180*s,!1),t.lineTo(e,i+r),t.arc(e+r,i+r,r,180*s,270*s,!1),t.closePath()}function qE(t,e,i,n,o){const r=.5522848,s=n/2*r,a=o/2*r,h=e+n,d=i+o,c=e+n/2,l=i+o/2;t.beginPath(),t.moveTo(e,l),t.bezierCurveTo(e,l-a,c-s,i,c,i),t.bezierCurveTo(c+s,i,h,l-a,h,l),t.bezierCurveTo(h,l+a,c+s,d,c,d),t.bezierCurveTo(c-s,d,e,l+a,e,l),t.closePath()}function VE(t,e,i,n,o){const r=o*(1/3),s=.5522848,a=n/2*s,h=r/2*s,d=e+n,c=i+r,l=e+n/2,u=i+r/2,f=i+(o-r/2),p=i+o;t.beginPath(),t.moveTo(d,u),t.bezierCurveTo(d,u+h,l+a,c,l,c),t.bezierCurveTo(l-a,c,e,u+h,e,u),t.bezierCurveTo(e,u-h,l-a,i,l,i),t.bezierCurveTo(l+a,i,d,u-h,d,u),t.lineTo(d,f),t.bezierCurveTo(d,f+h,l+a,p,l,p),t.bezierCurveTo(l-a,p,e,f+h,e,f),t.lineTo(e,u)}function UE(t,e,i,n,o,r){t.beginPath(),t.moveTo(e,i);const s=r.length,a=n-e,h=o-i,d=h/a;let c=Math.sqrt(a*a+h*h),l=0,u=!0,f=0,p=+r[0];for(;c>=.1;)p=+r[l++%s],p>c&&(p=c),f=Math.sqrt(p*p/(1+d*d)),f=a<0?-f:f,e+=f,i+=d*f,!0===u?t.lineTo(e,i):t.moveTo(e,i),c-=p,u=!u}const YE={circle:HE,dashedLine:UE,database:VE,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:qE,ellipse_vis:qE,hexagon:function(t,e,i,n){t.beginPath();const o=2*Math.PI/6;t.moveTo(e+n,i);for(let r=1;r<6;r++)t.lineTo(e+n*Math.cos(o*r),i+n*Math.sin(o*r));t.closePath()},roundRect:WE,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(let o=0;o<10;o++){const 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);const 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);const 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 XE,GE={exports:{}};var KE,ZE,QE,JE,$E,tO,eO,iO,nO,oO,rO,sO,aO,hO,dO,cO,lO,uO,fO,pO,gO,vO=(XE||(XE=1,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<n.length;o++)if((i=n[o])===e||i.fn===e){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),i=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(i){n=0;for(var o=(i=i.slice(0)).length;n<o;++n)i[n].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}}(GE)),GE.exports),mO=Rb(vO),yO={};function bO(){if(ZE)return KE;ZE=1;var t=hw();return KE=Array.isArray||function(e){return"Array"===t(e)}}function wO(){if(JE)return QE;JE=1;var t=TypeError;return QE=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e},QE}function _O(){if(tO)return $E;tO=1;var t=vw(),e=qx(),i=n_();return $E=function(n,o,r){t?e.f(n,o,i(0,r)):n[o]=r},$E}function xO(){if(iO)return eO;iO=1;var t={};return t[nx()("toStringTag")]="z",eO="[object z]"===String(t)}function EO(){if(oO)return nO;oO=1;var t=xO(),e=cw(),i=hw(),n=nx()("toStringTag"),o=Object,r="Arguments"===i(function(){return arguments}());return nO=t?i:function(t){var s,a,h;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(a=function(t,e){try{return t[e]}catch(t){}}(s=o(t),n))?a:r?i(s):"Object"===(h=i(s))&&e(s.callee)?"Arguments":h},nO}function OO(){if(sO)return rO;sO=1;var t=aw(),e=cw(),i=J_(),n=t(Function.toString);return e(i.inspectSource)||(i.inspectSource=function(t){return n(t)}),rO=i.inspectSource}function SO(){if(hO)return aO;hO=1;var t=aw(),e=ow(),i=cw(),n=EO(),o=c_(),r=OO(),s=function(){},a=o("Reflect","construct"),h=/^\s*(?:class|function)\b/,d=t(h.exec),c=!h.test(s),l=function(t){if(!i(t))return!1;try{return a(s,[],t),!0}catch(t){return!1}},u=function(t){if(!i(t))return!1;switch(n(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return c||!!d(h,r(t))}catch(t){return!0}};return u.sham=!0,aO=!a||e(function(){var t;return l(l.call)||!l(Object)||!l(function(){t=!0})||t})?u:l}function CO(){if(cO)return dO;cO=1;var t=bO(),e=SO(),i=h_(),n=nx()("species"),o=Array;return dO=function(r){var s;return t(r)&&(s=r.constructor,(e(s)&&(s===o||t(s.prototype))||i(s)&&null===(s=s[n]))&&(s=void 0)),void 0===s?o:s}}function TO(){if(uO)return lO;uO=1;var t=CO();return lO=function(e,i){return new(t(e))(0===i?0:i)}}function kO(){if(pO)return fO;pO=1;var t=ow(),e=nx(),i=f_(),n=e("species");return fO=function(e){return i>=51||!t(function(){var t=[];return(t.constructor={})[n]=function(){return{foo:1}},1!==t[e](Boolean).foo})},fO}function DO(){if(gO)return yO;gO=1;var t=Ux(),e=ow(),i=bO(),n=h_(),o=tx(),r=Zx(),s=wO(),a=_O(),h=TO(),d=kO(),c=nx(),l=f_(),u=c("isConcatSpreadable"),f=l>=51||!e(function(){var t=[];return t[u]=!1,t.concat()[0]!==t}),p=function(t){if(!n(t))return!1;var e=t[u];return void 0!==e?!!e:i(t)};return t({target:"Array",proto:!0,arity:1,forced:!f||!d("concat")},{concat:function(t){var e,i,n,d,c,l=o(this),u=h(l,0),f=0;for(e=-1,n=arguments.length;e<n;e++)if(p(c=-1===e?l:arguments[e]))for(d=r(c),s(f+d),i=0;i<d;i++,f++)i in c&&a(u,f,c[i]);else s(f+1),a(u,f++,c);return u.length=f,u}}),yO}var IO,PO,MO={},NO={};function FO(){if(PO)return IO;PO=1;var t=EO(),e=String;return IO=function(i){if("Symbol"===t(i))throw new TypeError("Cannot convert a Symbol value to a string");return e(i)}}var zO,AO,BO,jO,RO,LO,HO,WO={};function qO(){if(zO)return WO;zO=1;var t=vw(),e=Hx(),i=qx(),n=Wx(),o=a_(),r=eE();return WO.f=t&&!e?Object.defineProperties:function(t,e){n(t);for(var s,a=o(e),h=r(e),d=h.length,c=0;d>c;)i.f(t,s=h[c++],a[s]);return t},WO}function VO(){return BO?AO:(BO=1,AO=c_()("document","documentElement"))}function UO(){if(RO)return jO;RO=1;var t=$_(),e=ix(),i=t("keys");return jO=function(t){return i[t]||(i[t]=e(t))}}function YO(){if(HO)return LO;HO=1;var t,e=Wx(),i=qO(),n=tE(),o=Jx(),r=VO(),s=sx(),a="prototype",h="script",d=UO()("IE_PROTO"),c=function(){},l=function(t){return"<"+h+">"+t+"</"+h+">"},u=function(t){t.write(l("")),t.close();var e=t.parentWindow.Object;return t=null,e},f=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var e,i,o;f="undefined"!=typeof document?document.domain&&t?u(t):(i=s("iframe"),o="java"+h+":",i.style.display="none",r.appendChild(i),i.src=String(o),(e=i.contentWindow.document).open(),e.write(l("document.F=Object")),e.close(),e.F):u(t);for(var d=n.length;d--;)delete f[a][n[d]];return f()};return o[d]=!0,LO=Object.create||function(t,n){var o;return null!==t?(c[a]=e(t),o=new c,c[a]=null,o[d]=t):o=f(),void 0===n?o:i.f(o,n)}}var XO,GO={};function KO(){if(XO)return GO;XO=1;var t=$x(),e=tE().concat("length","prototype");return GO.f=Object.getOwnPropertyNames||function(i){return t(i,e)},GO}var ZO,QO,JO,$O,tS,eS={};function iS(){if(ZO)return eS;ZO=1;var t=hw(),e=a_(),i=KO().f,n=FE(),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];return eS.f=function(r){return o&&"Window"===t(r)?function(t){try{return i(t)}catch(t){return n(o)}}(r):i(e(r))},eS}function nS(){if(JO)return QO;JO=1;var t=Vx();return QO=function(e,i,n,o){return o&&o.enumerable?e[i]=n:t(e,i,n),e}}function oS(){if(tS)return $O;tS=1;var t=qx();return $O=function(e,i,n){return t.f(e,i,n)}}var rS,sS,aS,hS,dS,cS,lS,uS,fS,pS,gS,vS,mS,yS,bS,wS,_S={};function xS(){if(rS)return _S;rS=1;var t=nx();return _S.f=t,_S}function ES(){if(aS)return sS;aS=1;var t=d_(),e=ex(),i=xS(),n=qx().f;return sS=function(o){var r=t.Symbol||(t.Symbol={});e(r,o)||n(r,o,{value:i.f(o)})}}function OS(){if(dS)return hS;dS=1;var t=mw(),e=c_(),i=nx(),n=nS();return hS=function(){var o=e("Symbol"),r=o&&o.prototype,s=r&&r.valueOf,a=i("toPrimitive");r&&!r[a]&&n(r,a,function(e){return t(s,this)},{arity:1})}}function SS(){if(lS)return cS;lS=1;var t=xO(),e=EO();return cS=t?{}.toString:function(){return"[object "+e(this)+"]"}}function CS(){if(fS)return uS;fS=1;var t=xO(),e=qx().f,i=Vx(),n=ex(),o=SS(),r=nx()("toStringTag");return uS=function(s,a,h,d){var c=h?s:s&&s.prototype;c&&(n(c,r)||e(c,r,{configurable:!0,value:a}),d&&!t&&i(c,"toString",o))},uS}function TS(){if(gS)return pS;gS=1;var t=nw(),e=cw(),i=t.WeakMap;return pS=e(i)&&/native code/.test(String(i))}function kS(){if(mS)return vS;mS=1;var t,e,i,n=TS(),o=nw(),r=h_(),s=Vx(),a=ex(),h=J_(),d=UO(),c=Jx(),l="Object already initialized",u=o.TypeError,f=o.WeakMap;if(n||h.state){var p=h.state||(h.state=new f);p.get=p.get,p.has=p.has,p.set=p.set,t=function(t,e){if(p.has(t))throw new u(l);return e.facade=t,p.set(t,e),e},e=function(t){return p.get(t)||{}},i=function(t){return p.has(t)}}else{var g=d("state");c[g]=!0,t=function(t,e){if(a(t,g))throw new u(l);return e.facade=t,s(t,g,e),e},e=function(t){return a(t,g)?t[g]:{}},i=function(t){return a(t,g)}}return vS={set:t,get:e,has:i,enforce:function(n){return i(n)?e(n):t(n,{})},getterFor:function(t){return function(i){var n;if(!r(i)||(n=e(i)).type!==t)throw new u("Incompatible receiver, "+t+" required");return n}}},vS}function DS(){if(bS)return yS;bS=1;var t=cx(),e=aw(),i=o_(),n=tx(),o=Zx(),r=TO(),s=e([].push),a=function(e){var a=1===e,h=2===e,d=3===e,c=4===e,l=6===e,u=7===e,f=5===e||l;return function(p,g,v,m){for(var y,b,w=n(p),_=i(w),x=o(_),E=t(g,v),O=0,S=m||r,C=a?S(p,x):h||u?S(p,0):void 0;x>O;O++)if((f||O in _)&&(b=E(y=_[O],O,w),e))if(a)C[O]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return O;case 2:s(C,y)}else switch(e){case 4:return!1;case 7:s(C,y)}return l?-1:d||c?c:C}};return yS={forEach:a(0),map:a(1),filter:a(2),some:a(3),every:a(4),find:a(5),findIndex:a(6),filterReject:a(7)}}var IS,PS,MS,NS={};function FS(){return PS?IS:(PS=1,IS=p_()&&!!Symbol.for&&!!Symbol.keyFor)}var zS,AS={};var BS,jS,RS,LS={};function HS(){if(jS)return BS;jS=1;var t=aw(),e=bO(),i=cw(),n=hw(),o=FO(),r=t([].push);return BS=function(t){if(i(t))return t;if(e(t)){for(var s=t.length,a=[],h=0;h<s;h++){var d=t[h];"string"==typeof d?r(a,d):"number"!=typeof d&&"Number"!==n(d)&&"String"!==n(d)||r(a,o(d))}var c=a.length,l=!0;return function(t,i){if(l)return l=!1,i;if(e(this))return i;for(var n=0;n<c;n++)if(a[n]===t)return i}}},BS}function WS(){if(RS)return LS;RS=1;var t=Ux(),e=c_(),i=sw(),n=mw(),o=aw(),r=ow(),s=cw(),a=v_(),h=FE(),d=HS(),c=p_(),l=String,u=e("JSON","stringify"),f=o(/./.exec),p=o("".charAt),g=o("".charCodeAt),v=o("".replace),m=o(1.1.toString),y=/[\uD800-\uDFFF]/g,b=/^[\uD800-\uDBFF]$/,w=/^[\uDC00-\uDFFF]$/,_=!c||r(function(){var t=e("Symbol")("stringify detection");return"[null]"!==u([t])||"{}"!==u({a:t})||"{}"!==u(Object(t))}),x=r(function(){return'"\\udf06\\ud834"'!==u("\udf06\ud834")||'"\\udead"'!==u("\udead")}),E=function(t,e){var o=h(arguments),r=d(e);if(s(r)||void 0!==t&&!a(t))return o[1]=function(t,e){if(s(r)&&(e=n(r,this,l(t),e)),!a(e))return e},i(u,null,o)},O=function(t,e,i){var n=p(i,e-1),o=p(i,e+1);return f(b,t)&&!f(w,o)||f(w,t)&&!f(b,n)?"\\u"+m(g(t,0),16):t};return u&&t({target:"JSON",stat:!0,arity:3,forced:_||x},{stringify:function(t,e,n){var o=h(arguments),r=i(_?E:u,null,o);return x&&"string"==typeof r?v(r,y,O):r}}),LS}var qS,VS,US={};function YS(){return VS||(VS=1,function(){if(wS)return NO;wS=1;var t=Ux(),e=nw(),i=mw(),n=aw(),o=Z_(),r=vw(),s=p_(),a=ow(),h=ex(),d=l_(),c=Wx(),l=a_(),u=rx(),f=FO(),p=n_(),g=YO(),v=eE(),m=KO(),y=iS(),b=fE(),w=hx(),_=qx(),x=qO(),E=i_(),O=nS(),S=oS(),C=$_(),T=UO(),k=Jx(),D=ix(),I=nx(),P=xS(),M=ES(),N=OS(),F=CS(),z=kS(),A=DS().forEach,B=T("hidden"),j="Symbol",R="prototype",L=z.set,H=z.getterFor(j),W=Object[R],q=e.Symbol,V=q&&q[R],U=e.RangeError,Y=e.TypeError,X=e.QObject,G=w.f,K=_.f,Z=y.f,Q=E.f,J=n([].push),$=C("symbols"),tt=C("op-symbols"),et=C("wks"),it=!X||!X[R]||!X[R].findChild,nt=function(t,e,i){var n=G(W,e);n&&delete W[e],K(t,e,i),n&&t!==W&&K(W,e,n)},ot=r&&a(function(){return 7!==g(K({},"a",{get:function(){return K(this,"a",{value:7}).a}})).a})?nt:K,rt=function(t,e){var i=$[t]=g(V);return L(i,{type:j,tag:t,description:e}),r||(i.description=e),i},st=function(t,e,i){t===W&&st(tt,e,i),c(t);var n=u(e);return c(i),h($,n)?(i.enumerable?(h(t,B)&&t[B][n]&&(t[B][n]=!1),i=g(i,{enumerable:p(0,!1)})):(h(t,B)||K(t,B,p(1,g(null))),t[B][n]=!0),ot(t,n,i)):K(t,n,i)},at=function(t,e){c(t);var n=l(e),o=v(n).concat(lt(n));return A(o,function(e){r&&!i(ht,n,e)||st(t,e,n[e])}),t},ht=function(t){var e=u(t),n=i(Q,this,e);return!(this===W&&h($,e)&&!h(tt,e))&&(!(n||!h(this,e)||!h($,e)||h(this,B)&&this[B][e])||n)},dt=function(t,e){var i=l(t),n=u(e);if(i!==W||!h($,n)||h(tt,n)){var o=G(i,n);return!o||!h($,n)||h(i,B)&&i[B][n]||(o.enumerable=!0),o}},ct=function(t){var e=Z(l(t)),i=[];return A(e,function(t){h($,t)||h(k,t)||J(i,t)}),i},lt=function(t){var e=t===W,i=Z(e?tt:l(t)),n=[];return A(i,function(t){!h($,t)||e&&!h(W,t)||J(n,$[t])}),n};s||(q=function(){if(d(V,this))throw new Y("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?f(arguments[0]):void 0,n=D(t),o=function(t){var r=void 0===this?e:this;r===W&&i(o,tt,t),h(r,B)&&h(r[B],n)&&(r[B][n]=!1);var s=p(1,t);try{ot(r,n,s)}catch(t){if(!(t instanceof U))throw t;nt(r,n,s)}};return r&&it&&ot(W,n,{configurable:!0,set:o}),rt(n,t)},O(V=q[R],"toString",function(){return H(this).tag}),O(q,"withoutSetter",function(t){return rt(D(t),t)}),E.f=ht,_.f=st,x.f=at,w.f=dt,m.f=y.f=ct,b.f=lt,P.f=function(t){return rt(I(t),t)},r&&(S(V,"description",{configurable:!0,get:function(){return H(this).description}}),o||O(W,"propertyIsEnumerable",ht,{unsafe:!0}))),t({global:!0,constructor:!0,wrap:!0,forced:!s,sham:!s},{Symbol:q}),A(v(et),function(t){M(t)}),t({target:j,stat:!0,forced:!s},{useSetter:function(){it=!0},useSimple:function(){it=!1}}),t({target:"Object",stat:!0,forced:!s,sham:!r},{create:function(t,e){return void 0===e?g(t):at(g(t),e)},defineProperty:st,defineProperties:at,getOwnPropertyDescriptor:dt}),t({target:"Object",stat:!0,forced:!s},{getOwnPropertyNames:ct}),N(),F(q,j),k[B]=!0}(),function(){if(MS)return NS;MS=1;var t=Ux(),e=c_(),i=ex(),n=FO(),o=$_(),r=FS(),s=o("string-to-symbol-registry"),a=o("symbol-to-string-registry");t({target:"Symbol",stat:!0,forced:!r},{for:function(t){var o=n(t);if(i(s,o))return s[o];var r=e("Symbol")(o);return s[o]=r,a[r]=o,r}})}(),function(){if(zS)return AS;zS=1;var t=Ux(),e=ex(),i=v_(),n=m_(),o=$_(),r=FS(),s=o("symbol-to-string-registry");t({target:"Symbol",stat:!0,forced:!r},{keyFor:function(t){if(!i(t))throw new TypeError(n(t)+" is not a symbol");if(e(s,t))return s[t]}})}(),WS(),function(){if(qS)return US;qS=1;var t=Ux(),e=p_(),i=ow(),n=fE(),o=tx();t({target:"Object",stat:!0,forced:!e||i(function(){n.f(1)})},{getOwnPropertySymbols:function(t){var e=n.f;return e?e(o(t)):[]}})}()),MO}var XS,GS={};function KS(){return XS||(XS=1,ES()("asyncDispose")),GS}var ZS;var QS,JS={};function $S(){return QS||(QS=1,ES()("dispose")),JS}var tC;var eC;var iC,nC={};function oC(){return iC||(iC=1,ES()("iterator")),nC}var rC;var sC;var aC;var hC;var dC;var cC;var lC,uC={};function fC(){if(lC)return uC;lC=1;var t=ES(),e=OS();return t("toPrimitive"),e(),uC}var pC,gC={};var vC;var mC,yC,bC,wC={};function _C(){return bC?yC:(bC=1,DO(),YS(),KS(),ZS||(ZS=1,ES()("asyncIterator")),$S(),tC||(tC=1,ES()("hasInstance")),eC||(eC=1,ES()("isConcatSpreadable")),oC(),rC||(rC=1,ES()("match")),sC||(sC=1,ES()("matchAll")),aC||(aC=1,ES()("replace")),hC||(hC=1,ES()("search")),dC||(dC=1,ES()("species")),cC||(cC=1,ES()("split")),fC(),function(){if(pC)return gC;pC=1;var t=c_(),e=ES(),i=CS();e("toStringTag"),i(t("Symbol"),"Symbol")}(),vC||(vC=1,ES()("unscopables")),function(){if(mC)return wC;mC=1;var t=nw();CS()(t.JSON,"JSON",!0)}(),yC=d_().Symbol)}var xC,EC,OC,SC,CC,TC,kC,DC,IC,PC,MC,NC,FC,zC,AC,BC,jC,RC,LC,HC,WC,qC,VC,UC,YC,XC,GC,KC,ZC,QC,JC,$C,tT,eT,iT,nT={};function oT(){return EC?xC:(EC=1,xC=function(){})}function rT(){return SC?OC:(SC=1,OC={})}function sT(){if(TC)return CC;TC=1;var t=vw(),e=ex(),i=Function.prototype,n=t&&Object.getOwnPropertyDescriptor,o=e(i,"name"),r=o&&"something"===function(){}.name,s=o&&(!t||t&&n(i,"name").configurable);return CC={EXISTS:o,PROPER:r,CONFIGURABLE:s}}function aT(){return DC?kC:(DC=1,kC=!ow()(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))}function hT(){if(PC)return IC;PC=1;var t=ex(),e=cw(),i=tx(),n=UO(),o=aT(),r=n("IE_PROTO"),s=Object,a=s.prototype;return IC=o?s.getPrototypeOf:function(n){var o=i(n);if(t(o,r))return o[r];var h=o.constructor;return e(h)&&o instanceof h?h.prototype:o instanceof s?a:null},IC}function dT(){if(NC)return MC;NC=1;var t,e,i,n=ow(),o=cw(),r=h_(),s=YO(),a=hT(),h=nS(),d=nx(),c=Z_(),l=d("iterator"),u=!1;return[].keys&&("next"in(i=[].keys())?(e=a(a(i)))!==Object.prototype&&(t=e):u=!0),!r(t)||n(function(){var e={};return t[l].call(e)!==e})?t={}:c&&(t=s(t)),o(t[l])||h(t,l,function(){return this}),MC={IteratorPrototype:t,BUGGY_SAFARI_ITERATORS:u}}function cT(){if(zC)return FC;zC=1;var t=dT().IteratorPrototype,e=YO(),i=n_(),n=CS(),o=rT(),r=function(){return this};return FC=function(s,a,h,d){var c=a+" Iterator";return s.prototype=e(t,{next:i(+!d,h)}),n(s,c,!1,!0),o[c]=r,s},FC}function lT(){if(BC)return AC;BC=1;var t=aw(),e=y_();return AC=function(i,n,o){try{return t(e(Object.getOwnPropertyDescriptor(i,n)[o]))}catch(t){}},AC}function uT(){if(RC)return jC;RC=1;var t=h_();return jC=function(e){return t(e)||null===e}}function fT(){if(HC)return LC;HC=1;var t=uT(),e=String,i=TypeError;return LC=function(n){if(t(n))return n;throw new i("Can't set "+e(n)+" as a prototype")}}function pT(){if(qC)return WC;qC=1;var t=lT(),e=h_(),i=s_(),n=fT();return WC=Object.setPrototypeOf||("__proto__"in{}?function(){var o,r=!1,s={};try{(o=t(Object.prototype,"__proto__","set"))(s,[]),r=s instanceof Array}catch(t){}return function(t,s){return i(t),n(s),e(t)?(r?o(t,s):t.__proto__=s,t):t}}():void 0)}function gT(){if(UC)return VC;UC=1;var t=Ux(),e=mw(),i=Z_(),n=sT(),o=cw(),r=cT(),s=hT(),a=pT(),h=CS(),d=Vx(),c=nS(),l=nx(),u=rT(),f=dT(),p=n.PROPER,g=n.CONFIGURABLE,v=f.IteratorPrototype,m=f.BUGGY_SAFARI_ITERATORS,y=l("iterator"),b="keys",w="values",_="entries",x=function(){return this};return VC=function(n,l,f,E,O,S,C){r(f,l,E);var T,k,D,I=function(t){if(t===O&&z)return z;if(!m&&t&&t in N)return N[t];switch(t){case b:case w:case _:return function(){return new f(this,t)}}return function(){return new f(this)}},P=l+" Iterator",M=!1,N=n.prototype,F=N[y]||N["@@iterator"]||O&&N[O],z=!m&&F||I(O),A="Array"===l&&N.entries||F;if(A&&(T=s(A.call(new n)))!==Object.prototype&&T.next&&(i||s(T)===v||(a?a(T,v):o(T[y])||c(T,y,x)),h(T,P,!0,!0),i&&(u[P]=x)),p&&O===w&&F&&F.name!==w&&(!i&&g?d(N,"name",w):(M=!0,z=function(){return e(F,this)})),O)if(k={values:I(w),keys:S?z:I(b),entries:I(_)},C)for(D in k)(m||M||!(D in N))&&c(N,D,k[D]);else t({target:l,proto:!0,forced:m||M},k);return i&&!C||N[y]===z||c(N,y,z,{name:O}),u[l]=z,k},VC}function vT(){return XC?YC:(XC=1,YC=function(t,e){return{value:t,done:e}})}function mT(){if(KC)return GC;KC=1;var t=a_(),e=oT(),i=rT(),n=kS(),o=qx().f,r=gT(),s=vT(),a=Z_(),h=vw(),d="Array Iterator",c=n.set,l=n.getterFor(d);GC=r(Array,"Array",function(e,i){c(this,{type:d,target:t(e),index:0,kind:i})},function(){var t=l(this),e=t.target,i=t.index++;if(!e||i>=e.length)return t.target=null,s(void 0,!0);switch(t.kind){case"keys":return s(i,!1);case"values":return s(e[i],!1)}return s([i,e[i]],!1)},"values");var u=i.Arguments=i.Array;if(e("keys"),e("values"),e("entries"),!a&&h&&"values"!==u.name)try{o(u,"name",{value:"values"})}catch(t){}return GC}function yT(){return QC?ZC:(QC=1,ZC={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})}function bT(){if(JC)return nT;JC=1,mT();var t=yT(),e=nw(),i=CS(),n=rT();for(var o in t)i(e[o],o),n[o]=n.Array;return nT}function wT(){if(tT)return $C;tT=1;var t=_C();return bT(),$C=t}var _T,xT,ET,OT,ST,CT,TT,kT,DT,IT=Rb(iT?eT:(iT=1,eT=wT())),PT={};function MT(){return ET?xT:(ET=1,function(){if(_T)return PT;_T=1;var t=Ux(),e=bO(),i=SO(),n=h_(),o=Gx(),r=Zx(),s=a_(),a=_O(),h=nx(),d=kO(),c=FE(),l=d("slice"),u=h("species"),f=Array,p=Math.max;t({target:"Array",proto:!0,forced:!l},{slice:function(t,h){var d,l,g,v=s(this),m=r(v),y=o(t,m),b=o(void 0===h?m:h,m);if(e(v)&&(d=v.constructor,(i(d)&&(d===f||e(d.prototype))||n(d)&&null===(d=d[u]))&&(d=void 0),d===f||void 0===d))return c(v,y,b);for(l=new(void 0===d?f:d)(p(b-y,0)),g=0;y<b;y++,g++)y in v&&a(l,g,v[y]);return l.length=g,l}})}(),xT=AE()("Array","slice"))}function NT(){if(ST)return OT;ST=1;var t=l_(),e=MT(),i=Array.prototype;return OT=function(n){var o=n.slice;return n===i||t(i,n)&&o===i.slice?e:o},OT}function FT(){return TT?CT:(TT=1,CT=NT())}var zT,AT,BT=Rb(DT?kT:(DT=1,kT=FT()));function jT(){if(AT)return zT;AT=1;var t=c_(),e=aw(),i=KO(),n=fE(),o=Wx(),r=e([].concat);return zT=t("Reflect","ownKeys")||function(t){var e=i.f(o(t)),s=n.f;return s?r(e,s(t)):e},zT}var RT,LT,HT,WT,qT,VT,UT;function YT(){return HT?LT:(HT=1,RT||(RT=1,Ux()({target:"Array",stat:!0},{isArray:bO()})),LT=d_().Array.isArray)}function XT(){return qT?WT:(qT=1,WT=YT())}var GT,KT,ZT,QT,JT,$T,tk,ek,ik,nk=Rb(UT?VT:(UT=1,VT=XT())),ok={};function rk(){return ZT?KT:(ZT=1,function(){if(GT)return ok;GT=1;var t=Ux(),e=DS().map;t({target:"Array",proto:!0,forced:!kO()("map")},{map:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}})}(),KT=AE()("Array","map"))}function sk(){if(JT)return QT;JT=1;var t=l_(),e=rk(),i=Array.prototype;return QT=function(n){var o=n.map;return n===i||t(i,n)&&o===i.map?e:o},QT}function ak(){return tk?$T:(tk=1,$T=sk())}var hk,dk,ck,lk,uk,fk,pk,gk=Rb(ik?ek:(ik=1,ek=ak())),vk={};function mk(){return ck?dk:(ck=1,function(){if(hk)return vk;hk=1;var t=Ux(),e=tx(),i=eE();t({target:"Object",stat:!0,forced:ow()(function(){i(1)})},{keys:function(t){return i(e(t))}})}(),dk=d_().Object.keys)}function yk(){return uk?lk:(uk=1,lk=mk())}var bk,wk,_k,xk,Ek,Ok,Sk,Ck=Rb(pk?fk:(pk=1,fk=yk())),Tk={};function kk(){return _k?wk:(_k=1,function(){if(bk)return Tk;bk=1;var t=Ux(),e=Date,i=aw()(e.prototype.getTime);t({target:"Date",stat:!0},{now:function(){return i(new e)}})}(),wk=d_().Date.now)}function Dk(){return Ek?xk:(Ek=1,xk=kk())}var Ik,Pk,Mk,Nk,Fk,zk,Ak,Bk,jk,Rk,Lk,Hk,Wk,qk=Rb(Sk?Ok:(Sk=1,Ok=Dk())),Vk={};function Uk(){if(Pk)return Ik;Pk=1;var t=ow();return Ik=function(e,i){var n=[][e];return!!n&&t(function(){n.call(null,i||function(){return 1},1)})}}function Yk(){if(Nk)return Mk;Nk=1;var t=DS().forEach,e=Uk()("forEach");return Mk=e?[].forEach:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)},Mk}function Xk(){return Ak?zk:(Ak=1,function(){if(Fk)return Vk;Fk=1;var t=Ux(),e=Yk();t({target:"Array",proto:!0,forced:[].forEach!==e},{forEach:e})}(),zk=AE()("Array","forEach"))}function Gk(){return jk?Bk:(jk=1,Bk=Xk())}function Kk(){if(Lk)return Rk;Lk=1;var t=EO(),e=ex(),i=l_(),n=Gk(),o=Array.prototype,r={DOMTokenList:!0,NodeList:!0};return Rk=function(s){var a=s.forEach;return s===o||i(o,s)&&a===o.forEach||e(r,t(s))?n:a},Rk}var Zk,Qk,Jk,$k,tD,eD,iD,nD,oD,rD=Rb(Wk?Hk:(Wk=1,Hk=Kk())),sD={};function aD(){return Jk?Qk:(Jk=1,function(){if(Zk)return sD;Zk=1;var t=Ux(),e=aw(),i=bO(),n=e([].reverse),o=[1,2];t({target:"Array",proto:!0,forced:String(o)===String(o.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),n(this)}})}(),Qk=AE()("Array","reverse"))}function hD(){if(tD)return $k;tD=1;var t=l_(),e=aD(),i=Array.prototype;return $k=function(n){var o=n.reverse;return n===i||t(i,n)&&o===i.reverse?e:o},$k}function dD(){return iD?eD:(iD=1,eD=hD())}var cD,lD,uD,fD,pD,gD,vD,mD,yD,bD,wD,_D,xD,ED=Rb(oD?nD:(oD=1,nD=dD())),OD={};function SD(){if(lD)return cD;lD=1;var t=vw(),e=bO(),i=TypeError,n=Object.getOwnPropertyDescriptor,o=t&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();return cD=o?function(t,o){if(e(t)&&!n(t,"length").writable)throw new i("Cannot set read only .length");return t.length=o}:function(t,e){return t.length=e}}function CD(){if(fD)return uD;fD=1;var t=m_(),e=TypeError;return uD=function(i,n){if(!delete i[n])throw new e("Cannot delete property "+t(n)+" of "+t(i))}}function TD(){return vD?gD:(vD=1,function(){if(pD)return OD;pD=1;var t=Ux(),e=tx(),i=Gx(),n=Xx(),o=Zx(),r=SD(),s=wO(),a=TO(),h=_O(),d=CD(),c=kO()("splice"),l=Math.max,u=Math.min;t({target:"Array",proto:!0,forced:!c},{splice:function(t,c){var f,p,g,v,m,y,b=e(this),w=o(b),_=i(t,w),x=arguments.length;for(0===x?f=p=0:1===x?(f=0,p=w-_):(f=x-2,p=u(l(n(c),0),w-_)),s(w+f-p),g=a(b,p),v=0;v<p;v++)(m=_+v)in b&&h(g,v,b[m]);if(g.length=p,f<p){for(v=_;v<w-p;v++)y=v+f,(m=v+p)in b?b[y]=b[m]:d(b,y);for(v=w;v>w-p+f;v--)d(b,v-1)}else if(f>p)for(v=w-p;v>_;v--)y=v+f-1,(m=v+p-1)in b?b[y]=b[m]:d(b,y);for(v=0;v<f;v++)b[v+_]=arguments[v+2];return r(b,w-p+f),g}})}(),gD=AE()("Array","splice"))}function kD(){if(yD)return mD;yD=1;var t=l_(),e=TD(),i=Array.prototype;return mD=function(n){var o=n.splice;return n===i||t(i,n)&&o===i.splice?e:o},mD}function DD(){return wD?bD:(wD=1,bD=kD())}var ID,PD,MD,ND=Rb(xD?_D:(xD=1,_D=DD())),FD={};function zD(){return MD?PD:(MD=1,function(){if(ID)return FD;ID=1;var t=Ux(),e=Qx().includes,i=ow(),n=oT();t({target:"Array",proto:!0,forced:i(function(){return!Array(1).includes()})},{includes:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}}),n("includes")}(),PD=AE()("Array","includes"))}var AD,BD,jD,RD,LD,HD,WD,qD,VD,UD,YD,XD,GD,KD,ZD,QD={};function JD(){if(BD)return AD;BD=1;var t=h_(),e=hw(),i=nx()("match");return AD=function(n){var o;return t(n)&&(void 0!==(o=n[i])?!!o:"RegExp"===e(n))},AD}function $D(){if(RD)return jD;RD=1;var t=JD(),e=TypeError;return jD=function(i){if(t(i))throw new e("The method doesn't accept regular expressions");return i},jD}function tI(){if(HD)return LD;HD=1;var t=nx()("match");return LD=function(e){var i=/./;try{"/./"[e](i)}catch(n){try{return i[t]=!1,"/./"[e](i)}catch(t){}}return!1}}function eI(){return VD?qD:(VD=1,function(){if(WD)return QD;WD=1;var t=Ux(),e=aw(),i=$D(),n=s_(),o=FO(),r=tI(),s=e("".indexOf);t({target:"String",proto:!0,forced:!r("includes")},{includes:function(t){return!!~s(o(n(this)),o(i(t)),arguments.length>1?arguments[1]:void 0)}})}(),qD=AE()("String","includes"))}function iI(){if(YD)return UD;YD=1;var t=l_(),e=zD(),i=eI(),n=Array.prototype,o=String.prototype;return UD=function(r){var s=r.includes;return r===n||t(n,r)&&s===n.includes?e:"string"==typeof r||r===o||t(o,r)&&s===o.includes?i:s},UD}function nI(){return GD?XD:(GD=1,XD=iI())}var oI,rI,sI,aI,hI,dI,cI,lI=Rb(ZD?KD:(ZD=1,KD=nI())),uI={};function fI(){return sI?rI:(sI=1,function(){if(oI)return uI;oI=1;var t=Ux(),e=ow(),i=tx(),n=hT(),o=aT();t({target:"Object",stat:!0,forced:e(function(){n(1)}),sham:!o},{getPrototypeOf:function(t){return n(i(t))}})}(),rI=d_().Object.getPrototypeOf)}function pI(){return hI?aI:(hI=1,aI=fI())}var gI,vI,mI,yI,bI,wI,_I,xI,EI=Rb(cI?dI:(cI=1,dI=pI()));function OI(){return vI?gI:(vI=1,DO(),gI=AE()("Array","concat"))}function SI(){if(yI)return mI;yI=1;var t=l_(),e=OI(),i=Array.prototype;return mI=function(n){var o=n.concat;return n===i||t(i,n)&&o===i.concat?e:o},mI}function CI(){return wI?bI:(wI=1,bI=SI())}var TI,kI,DI,II,PI,MI,NI,FI,zI,AI=Rb(xI?_I:(xI=1,_I=CI())),BI={};function jI(){return DI?kI:(DI=1,function(){if(TI)return BI;TI=1;var t=Ux(),e=DS().filter;t({target:"Array",proto:!0,forced:!kO()("filter")},{filter:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}})}(),kI=AE()("Array","filter"))}function RI(){if(PI)return II;PI=1;var t=l_(),e=jI(),i=Array.prototype;return II=function(n){var o=n.filter;return n===i||t(i,n)&&o===i.filter?e:o},II}function LI(){return NI?MI:(NI=1,MI=RI())}var HI,WI,qI,VI,UI,YI,XI,GI,KI,ZI=Rb(zI?FI:(zI=1,FI=LI())),QI={};function JI(){if(WI)return HI;WI=1;var t=vw(),e=ow(),i=aw(),n=hT(),o=eE(),r=a_(),s=i(i_().f),a=i([].push),h=t&&e(function(){var t=Object.create(null);return t[2]=2,!s(t,2)}),d=function(e){return function(i){for(var d,c=r(i),l=o(c),u=h&&null===n(c),f=l.length,p=0,g=[];f>p;)d=l[p++],t&&!(u?d in c:s(c,d))||a(g,e?[d,c[d]]:c[d]);return g}};return HI={entries:d(!0),values:d(!1)}}function $I(){return UI?VI:(UI=1,function(){if(qI)return QI;qI=1;var t=Ux(),e=JI().values;t({target:"Object",stat:!0},{values:function(t){return e(t)}})}(),VI=d_().Object.values)}function tP(){return XI?YI:(XI=1,YI=$I())}var eP,iP,nP,oP,rP,sP,aP,hP,dP,cP,lP,uP,fP,pP=Rb(KI?GI:(KI=1,GI=tP())),gP={};function vP(){return iP?eP:(iP=1,eP="\t\n\v\f\r                　\u2028\u2029\ufeff")}function mP(){if(oP)return nP;oP=1;var t=aw(),e=s_(),i=FO(),n=vP(),o=t("".replace),r=RegExp("^["+n+"]+"),s=RegExp("(^|[^"+n+"])["+n+"]+$"),a=function(t){return function(n){var a=i(e(n));return 1&t&&(a=o(a,r,"")),2&t&&(a=o(a,s,"$1")),a}};return nP={start:a(1),end:a(2),trim:a(3)}}function yP(){if(sP)return rP;sP=1;var t=nw(),e=ow(),i=aw(),n=FO(),o=mP().trim,r=vP(),s=t.parseInt,a=t.Symbol,h=a&&a.iterator,d=/^[+-]?0x/i,c=i(d.exec),l=8!==s(r+"08")||22!==s(r+"0x16")||h&&!e(function(){s(Object(h))});return rP=l?function(t,e){var i=o(n(t));return s(i,e>>>0||(c(d,i)?16:10))}:s,rP}function bP(){return dP?hP:(dP=1,function(){if(aP)return gP;aP=1;var t=Ux(),e=yP();t({global:!0,forced:parseInt!==e},{parseInt:e})}(),hP=d_().parseInt)}function wP(){return lP?cP:(lP=1,cP=bP())}var _P,xP,EP,OP,SP,CP,TP,kP,DP,IP=Rb(fP?uP:(fP=1,uP=wP())),PP={};function MP(){return EP?xP:(EP=1,function(){if(_P)return PP;_P=1;var t=Ux(),e=dw(),i=Qx().indexOf,n=Uk(),o=e([].indexOf),r=!!o&&1/o([1],1,-0)<0;t({target:"Array",proto:!0,forced:r||!n("indexOf")},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return r?o(this,t,e)||0:i(this,t,e)}})}(),xP=AE()("Array","indexOf"))}function NP(){if(SP)return OP;SP=1;var t=l_(),e=MP(),i=Array.prototype;return OP=function(n){var o=n.indexOf;return n===i||t(i,n)&&o===i.indexOf?e:o},OP}function FP(){return TP?CP:(TP=1,CP=NP())}var zP,AP,BP,jP,RP,LP,HP,WP=Rb(DP?kP:(DP=1,kP=FP()));function qP(){if(BP)return AP;BP=1,zP||(zP=1,Ux()({target:"Object",stat:!0,sham:!vw()},{create:YO()}));var t=d_().Object;return AP=function(e,i){return t.create(e,i)}}function VP(){return RP?jP:(RP=1,jP=qP())}var UP,YP,XP,GP,KP,ZP,QP,JP,$P,tM,eM,iM,nM,oM=Rb(HP?LP:(HP=1,LP=VP())),rM={};function sM(){if(YP)return UP;YP=1;var t=Xx(),e=FO(),i=s_(),n=RangeError;return UP=function(o){var r=e(i(this)),s="",a=t(o);if(a<0||a===1/0)throw new n("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(r+=r))1&a&&(s+=r);return s}}function aM(){if(GP)return XP;GP=1;var t=aw(),e=Kx(),i=FO(),n=sM(),o=s_(),r=t(n),s=t("".slice),a=Math.ceil,h=function(t){return function(n,h,d){var c,l,u=i(o(n)),f=e(h),p=u.length,g=void 0===d?" ":i(d);return f<=p||""===g?u:((l=r(g,a((c=f-p)/g.length))).length>c&&(l=s(l,0,c)),t?u+l:l+u)}};return XP={start:h(!1),end:h(!0)}}function hM(){if(ZP)return KP;ZP=1;var t=aw(),e=ow(),i=aM().start,n=RangeError,o=isFinite,r=Math.abs,s=Date.prototype,a=s.toISOString,h=t(s.getTime),d=t(s.getUTCDate),c=t(s.getUTCFullYear),l=t(s.getUTCHours),u=t(s.getUTCMilliseconds),f=t(s.getUTCMinutes),p=t(s.getUTCMonth),g=t(s.getUTCSeconds);return KP=e(function(){return"0385-07-25T07:06:39.999Z"!==a.call(new Date(-50000000000001))})||!e(function(){a.call(new Date(NaN))})?function(){if(!o(h(this)))throw new n("Invalid time value");var t=this,e=c(t),s=u(t),a=e<0?"-":e>9999?"+":"";return a+i(r(e),a?6:4,0)+"-"+i(p(t)+1,2,0)+"-"+i(d(t),2,0)+"T"+i(l(t),2,0)+":"+i(f(t),2,0)+":"+i(g(t),2,0)+"."+i(s,3,0)+"Z"}:a}function dM(){if($P)return JP;$P=1,function(){if(QP)return rM;QP=1;var t=Ux(),e=mw(),i=tx(),n=ox(),o=hM(),r=hw();t({target:"Date",proto:!0,forced:ow()(function(){return null!==new Date(NaN).toJSON()||1!==e(Date.prototype.toJSON,{toISOString:function(){return 1}})})},{toJSON:function(t){var s=i(this),a=n(s,"number");return"number"!=typeof a||isFinite(a)?"toISOString"in s||"Date"!==r(s)?s.toISOString():e(o,s):null}})}(),WS();var t=d_(),e=sw();return t.JSON||(t.JSON={stringify:JSON.stringify}),JP=function(i,n,o){return e(t.JSON.stringify,null,arguments)},JP}function cM(){return eM?tM:(eM=1,tM=dM())}var lM,uM,fM,pM,gM,vM,mM,yM=Rb(nM?iM:(nM=1,iM=cM())),bM={},wM={};function _M(){if(uM)return lM;uM=1;var t=nw(),e=u_(),i=hw(),n=function(t){return e.slice(0,t.length)===t};return lM=n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":t.Bun&&"string"==typeof Bun.version?"BUN":t.Deno&&"object"==typeof Deno.version?"DENO":"process"===i(t.process)?"NODE":t.window&&t.document?"BROWSER":"REST"}function xM(){if(pM)return fM;pM=1;var t=TypeError;return fM=function(e,i){if(e<i)throw new t("Not enough arguments");return e}}function EM(){if(vM)return gM;vM=1;var t,e=nw(),i=sw(),n=cw(),o=_M(),r=u_(),s=FE(),a=xM(),h=e.Function,d=/MSIE .\./.test(r)||"BUN"===o&&((t=e.Bun.version.split(".")).length<3||"0"===t[0]&&(t[1]<3||"3"===t[1]&&"0"===t[2]));return gM=function(t,e){var o=e?2:1;return d?function(r,d){var c=a(arguments.length,1)>o,l=n(r)?r:h(r),u=c?s(arguments,o):[],f=c?function(){i(l,this,u)}:l;return e?t(f,d):t(f)}:t},gM}var OM,SM,CM,TM,kM,DM,IM={};function PM(){return SM||(SM=1,function(){if(mM)return wM;mM=1;var t=Ux(),e=nw(),i=EM()(e.setInterval,!0);t({global:!0,bind:!0,forced:e.setInterval!==i},{setInterval:i})}(),function(){if(OM)return IM;OM=1;var t=Ux(),e=nw(),i=EM()(e.setTimeout,!0);t({global:!0,bind:!0,forced:e.setTimeout!==i},{setTimeout:i})}()),bM}function MM(){return TM?CM:(TM=1,PM(),CM=d_().setTimeout)}var NM,FM,zM,AM,BM,jM,RM,LM,HM,WM,qM,VM=Rb(DM?kM:(DM=1,kM=MM())),UM={};function YM(){if(FM)return NM;FM=1;var t=tx(),e=Gx(),i=Zx();return NM=function(n){for(var o=t(this),r=i(o),s=arguments.length,a=e(s>1?arguments[1]:void 0,r),h=s>2?arguments[2]:void 0,d=void 0===h?r:e(h,r);d>a;)o[a++]=n;return o},NM}function XM(){return BM?AM:(BM=1,function(){if(zM)return UM;zM=1;var t=Ux(),e=YM(),i=oT();t({target:"Array",proto:!0},{fill:e}),i("fill")}(),AM=AE()("Array","fill"))}function GM(){if(RM)return jM;RM=1;var t=l_(),e=XM(),i=Array.prototype;return jM=function(n){var o=n.fill;return n===i||t(i,n)&&o===i.fill?e:o},jM}function KM(){return HM?LM:(HM=1,LM=GM())}var ZM,QM=Rb(qM?WM:(qM=1,WM=KM()));
/*! Hammer.JS - v2.0.17-rc - 2019-12-16
   * http://naver.github.io/egjs
   *
   * Forked By Naver egjs
   * Copyright (c) hammerjs
   * Licensed under the MIT license */
function JM(){return JM=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},JM.apply(this,arguments)}function $M(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function tN(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}ZM="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o])}return e}:Object.assign;var eN,iN=ZM,nN=["","webkit","Moz","MS","ms","o"],oN="undefined"==typeof document?{style:{}}:document.createElement("div"),rN=Math.round,sN=Math.abs,aN=Date.now;function hN(t,e){for(var i,n,o=e[0].toUpperCase()+e.slice(1),r=0;r<nN.length;){if((n=(i=nN[r])?i+o:e)in t)return n;r++}}eN="undefined"==typeof window?{}:window;var dN=hN(oN.style,"touchAction"),cN=void 0!==dN;var lN="compute",uN="auto",fN="manipulation",pN="none",gN="pan-x",vN="pan-y",mN=function(){if(!cN)return!1;var t={},e=eN.CSS&&eN.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(i){return t[i]=!e||eN.CSS.supports("touch-action",i)}),t}(),yN="ontouchstart"in eN,bN=void 0!==hN(eN,"PointerEvent"),wN=yN&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),_N="touch",xN="mouse",EN=16,ON=24,SN=["x","y"],CN=["clientX","clientY"];function TN(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(void 0!==t.length)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function kN(t,e){return"function"==typeof t?t.apply(e&&e[0]||void 0,e):t}function DN(t,e){return t.indexOf(e)>-1}var IN=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===lN&&(t=this.compute()),cN&&this.manager.element.style&&mN[t]&&(this.manager.element.style[dN]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return TN(this.manager.recognizers,function(e){kN(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),function(t){if(DN(t,pN))return pN;var e=DN(t,gN),i=DN(t,vN);return e&&i?pN:e||i?e?gN:vN:DN(t,fN)?fN:uN}(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=DN(n,pN)&&!mN[pN],r=DN(n,vN)&&!mN[vN],s=DN(n,gN)&&!mN[gN];if(o){var a=1===t.pointers.length,h=t.distance<2,d=t.deltaTime<250;if(a&&h&&d)return}if(!s||!r)return o||r&&6&i||s&&i&ON?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function PN(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function MN(t){var e=t.length;if(1===e)return{x:rN(t[0].clientX),y:rN(t[0].clientY)};for(var i=0,n=0,o=0;o<e;)i+=t[o].clientX,n+=t[o].clientY,o++;return{x:rN(i/e),y:rN(n/e)}}function NN(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:rN(t.pointers[i].clientX),clientY:rN(t.pointers[i].clientY)},i++;return{timeStamp:aN(),pointers:e,center:MN(e),deltaX:t.deltaX,deltaY:t.deltaY}}function FN(t,e,i){i||(i=SN);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return Math.sqrt(n*n+o*o)}function zN(t,e,i){i||(i=SN);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return 180*Math.atan2(o,n)/Math.PI}function AN(t,e){return t===e?1:sN(t)>=sN(e)?t<0?2:4:e<0?8:EN}function BN(t,e,i){return{x:e/t||0,y:i/t||0}}function jN(t,e){var i=t.session,n=e.pointers,o=n.length;i.firstInput||(i.firstInput=NN(e)),o>1&&!i.firstMultiple?i.firstMultiple=NN(e):1===o&&(i.firstMultiple=!1);var r=i.firstInput,s=i.firstMultiple,a=s?s.center:r.center,h=e.center=MN(n);e.timeStamp=aN(),e.deltaTime=e.timeStamp-r.timeStamp,e.angle=zN(a,h),e.distance=FN(a,h),function(t,e){var i=e.center,n=t.offsetDelta||{},o=t.prevDelta||{},r=t.prevInput||{};1!==e.eventType&&4!==r.eventType||(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=AN(e.deltaX,e.deltaY);var d,c,l=BN(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=l.x,e.overallVelocityY=l.y,e.overallVelocity=sN(l.x)>sN(l.y)?l.x:l.y,e.scale=s?(d=s.pointers,FN((c=n)[0],c[1],CN)/FN(d[0],d[1],CN)):1,e.rotation=s?function(t,e){return zN(e[1],e[0],CN)+zN(t[1],t[0],CN)}(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(8!==e.eventType&&(a>25||void 0===s.velocity)){var h=e.deltaX-s.deltaX,d=e.deltaY-s.deltaY,c=BN(a,h,d);n=c.x,o=c.y,i=sN(c.x)>sN(c.y)?c.x:c.y,r=AN(h,d),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;PN(u=p.composedPath?p.composedPath()[0]:p.path?p.path[0]:p.target,f)&&(f=u),e.target=f}function RN(t,e,i){var n=i.pointers.length,o=i.changedPointers.length,r=1&e&&n-o===0,s=12&e&&n-o===0;i.isFirst=!!r,i.isFinal=!!s,r&&(t.session={}),i.eventType=e,jN(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function LN(t){return t.trim().split(/\s+/g)}function HN(t,e,i){TN(LN(e),function(e){t.addEventListener(e,i,!1)})}function WN(t,e,i){TN(LN(e),function(e){t.removeEventListener(e,i,!1)})}function qN(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||window}var VN=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){kN(t.options.enable,[t])&&i.handler(e)},this.init()}var e=t.prototype;return e.handler=function(){},e.init=function(){this.evEl&&HN(this.element,this.evEl,this.domHandler),this.evTarget&&HN(this.target,this.evTarget,this.domHandler),this.evWin&&HN(qN(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&WN(this.element,this.evEl,this.domHandler),this.evTarget&&WN(this.target,this.evTarget,this.domHandler),this.evWin&&WN(qN(this.element),this.evWin,this.domHandler)},t}();function UN(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}var YN={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},XN={2:_N,3:"pen",4:xN,5:"kinect"},GN="pointerdown",KN="pointermove pointerup pointercancel";eN.MSPointerEvent&&!eN.PointerEvent&&(GN="MSPointerDown",KN="MSPointerMove MSPointerUp MSPointerCancel");var ZN=function(t){function e(){var i,n=e.prototype;return n.evEl=GN,n.evWin=KN,(i=t.apply(this,arguments)||this).store=i.manager.session.pointerEvents=[],i}return $M(e,t),e.prototype.handler=function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),o=YN[n],r=XN[t.pointerType]||t.pointerType,s=r===_N,a=UN(e,t.pointerId,"pointerId");1&o&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):12&o&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,o,{pointers:e,changedPointers:[t],pointerType:r,srcEvent:t}),i&&e.splice(a,1))},e}(VN);function QN(t){return Array.prototype.slice.call(t,0)}function JN(t,e,i){for(var n=[],o=[],r=0;r<t.length;){var s=e?t[r][e]:t[r];UN(o,s)<0&&n.push(t[r]),o[r]=s,r++}return i&&(n=e?n.sort(function(t,i){return t[e]>i[e]}):n.sort()),n}var $N={touchstart:1,touchmove:2,touchend:4,touchcancel:8},tF=function(t){function e(){var i;return e.prototype.evTarget="touchstart touchmove touchend touchcancel",(i=t.apply(this,arguments)||this).targetIds={},i}return $M(e,t),e.prototype.handler=function(t){var e=$N[t.type],i=eF.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:_N,srcEvent:t})},e}(VN);function eF(t,e){var i,n,o=QN(t.touches),r=this.targetIds;if(3&e&&1===o.length)return r[o[0].identifier]=!0,[o,o];var s=QN(t.changedTouches),a=[],h=this.target;if(n=o.filter(function(t){return PN(t.target,h)}),1===e)for(i=0;i<n.length;)r[n[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),12&e&&delete r[s[i].identifier],i++;return a.length?[JN(n.concat(a),"identifier",!0),a]:void 0}var iF={mousedown:1,mousemove:2,mouseup:4},nF=function(t){function e(){var i,n=e.prototype;return n.evEl="mousedown",n.evWin="mousemove mouseup",(i=t.apply(this,arguments)||this).pressed=!1,i}return $M(e,t),e.prototype.handler=function(t){var e=iF[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:xN,srcEvent:t}))},e}(VN);function oF(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY},n=this.lastTouches;this.lastTouches.push(i);setTimeout(function(){var t=n.indexOf(i);t>-1&&n.splice(t,1)},2500)}}function rF(t,e){1&t?(this.primaryTouch=e.changedPointers[0].identifier,oF.call(this,e)):12&t&&oF.call(this,e)}function sF(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var o=this.lastTouches[n],r=Math.abs(e-o.x),s=Math.abs(i-o.y);if(r<=25&&s<=25)return!0}return!1}var aF=function(){return function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).handler=function(t,e,i){var o=i.pointerType===_N,r=i.pointerType===xN;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(o)rF.call(tN(tN(n)),e,i);else if(r&&sF.call(tN(tN(n)),i))return;n.callback(t,e,i)}},n.touch=new tF(n.manager,n.handler),n.mouse=new nF(n.manager,n.handler),n.primaryTouch=null,n.lastTouches=[],n}return $M(e,t),e.prototype.destroy=function(){this.touch.destroy(),this.mouse.destroy()},e}(VN)}();function hF(t,e,i){return!!Array.isArray(t)&&(TN(t,i[e],i),!0)}var dF=32,cF=1;function lF(t,e){var i=e.manager;return i?i.get(t):t}function uF(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}var fF=function(){function t(t){void 0===t&&(t={}),this.options=JM({enable:!0},t),this.id=cF++,this.manager=null,this.state=1,this.simultaneous={},this.requireFail=[]}var e=t.prototype;return e.set=function(t){return iN(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(hF(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=lF(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},e.dropRecognizeWith=function(t){return hF(t,"dropRecognizeWith",this)||(t=lF(t,this),delete this.simultaneous[t.id]),this},e.requireFailure=function(t){if(hF(t,"requireFailure",this))return this;var e=this.requireFail;return-1===UN(e,t=lF(t,this))&&(e.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(hF(t,"dropRequireFailure",this))return this;t=lF(t,this);var e=UN(this.requireFail,t);return e>-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+uF(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=8&&n(e.options.event+uF(i))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=dF},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},e.recognize=function(t){var e=iN({},t);if(!kN(this.options.enable,[this,e]))return this.reset(),void(this.state=dF);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},e.process=function(t){},e.getTouchAction=function(){},e.reset=function(){},t}(),pF=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,JM({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},e))||this).pTime=!1,i.pCenter=!1,i._timer=null,i._input=null,i.count=0,i}$M(e,t);var i=e.prototype;return i.getTouchAction=function(){return[fN]},i.process=function(t){var e=this,i=this.options,n=t.pointers.length===i.pointers,o=t.distance<i.threshold,r=t.deltaTime<i.time;if(this.reset(),1&t.eventType&&0===this.count)return this.failTimeout();if(o&&r&&n){if(4!==t.eventType)return this.failTimeout();var s=!this.pTime||t.timeStamp-this.pTime<i.interval,a=!this.pCenter||FN(this.pCenter,t.center)<i.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&s?this.count+=1:this.count=1,this._input=t,0===this.count%i.taps)return this.hasRequireFailures()?(this._timer=setTimeout(function(){e.state=8,e.tryEmit()},i.interval),2):8}return dF},i.failTimeout=function(){var t=this;return this._timer=setTimeout(function(){t.state=dF},this.options.interval),dF},i.reset=function(){clearTimeout(this._timer)},i.emit=function(){8===this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(fF),gF=function(t){function e(e){return void 0===e&&(e={}),t.call(this,JM({pointers:1},e))||this}$M(e,t);var i=e.prototype;return i.attrTest=function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},i.process=function(t){var e=this.state,i=t.eventType,n=6&e,o=this.attrTest(t);return n&&(8&i||!o)?16|e:n||o?4&i?8|e:2&e?4|e:2:dF},e}(fF);function vF(t){return t===EN?"down":8===t?"up":2===t?"left":4===t?"right":""}var mF=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,JM({event:"pan",threshold:10,pointers:1,direction:30},e))||this).pX=null,i.pY=null,i}$M(e,t);var i=e.prototype;return i.getTouchAction=function(){var t=this.options.direction,e=[];return 6&t&&e.push(vN),t&ON&&e.push(gN),e},i.directionTest=function(t){var e=this.options,i=!0,n=t.distance,o=t.direction,r=t.deltaX,s=t.deltaY;return o&e.direction||(6&e.direction?(o=0===r?1:r<0?2:4,i=r!==this.pX,n=Math.abs(t.deltaX)):(o=0===s?1:s<0?8:EN,i=s!==this.pY,n=Math.abs(t.deltaY))),t.direction=o,i&&n>e.threshold&&o&e.direction},i.attrTest=function(t){return gF.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=vF(e.direction);i&&(e.additionalEvent=this.options.event+i),t.prototype.emit.call(this,e)},e}(gF),yF=function(t){function e(e){return void 0===e&&(e={}),t.call(this,JM({event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},e))||this}$M(e,t);var i=e.prototype;return i.getTouchAction=function(){return mF.prototype.getTouchAction.call(this)},i.attrTest=function(e){var i,n=this.options.direction;return 30&n?i=e.overallVelocity:6&n?i=e.overallVelocityX:n&ON&&(i=e.overallVelocityY),t.prototype.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers===this.options.pointers&&sN(i)>this.options.velocity&&4&e.eventType},i.emit=function(t){var e=vF(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)},e}(gF),bF=function(t){function e(e){return void 0===e&&(e={}),t.call(this,JM({event:"pinch",threshold:0,pointers:2},e))||this}$M(e,t);var i=e.prototype;return i.getTouchAction=function(){return[pN]},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}(gF),wF=function(t){function e(e){return void 0===e&&(e={}),t.call(this,JM({event:"rotate",threshold:0,pointers:2},e))||this}$M(e,t);var i=e.prototype;return i.getTouchAction=function(){return[pN]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)},e}(gF),_F=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,JM({event:"press",pointers:1,time:251,threshold:9},e))||this)._timer=null,i._input=null,i}$M(e,t);var i=e.prototype;return i.getTouchAction=function(){return[uN]},i.process=function(t){var e=this,i=this.options,n=t.pointers.length===i.pointers,o=t.distance<i.threshold,r=t.deltaTime>i.time;if(this._input=t,!o||!n||12&t.eventType&&!r)this.reset();else if(1&t.eventType)this.reset(),this._timer=setTimeout(function(){e.state=8,e.tryEmit()},i.time);else if(4&t.eventType)return 8;return dF},i.reset=function(){clearTimeout(this._timer)},i.emit=function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=aN(),this.manager.emit(this.options.event,this._input)))},e}(fF),xF={domEvents:!1,touchAction:lN,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},EF=[[wF,{enable:!1}],[bF,{enable:!1},["rotate"]],[yF,{direction:6}],[mF,{direction:6},["swipe"]],[pF],[pF,{event:"doubletap",taps:2},["tap"]],[_F]];function OF(t,e){var i,n=t.element;n.style&&(TN(t.options.cssProps,function(o,r){i=hN(n.style,r),e?(t.oldCssProps[i]=n.style[i],n.style[i]=o):n.style[i]=t.oldCssProps[i]||""}),e||(t.oldCssProps={}))}var SF=function(){function t(t,e){var i,n=this;this.options=iN({},xF,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||(bN?ZN:wN?tF:yN?aF:nF))(i,RN),this.touchAction=new IN(this,this.options.touchAction),OF(this,!0),TN(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 iN(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<n.length;)i=n[r],2===e.stopped||o&&i!==o&&!i.canRecognizeWith(o)?i.reset():i.recognize(t),!o&&14&i.state&&(e.curRecognizer=i,o=i),r++}},e.get=function(t){if(t instanceof fF)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event===t)return e[i];return null},e.add=function(t){if(hF(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},e.remove=function(t){if(hF(t,"remove",this))return this;var e=this.get(t);if(t){var i=this.recognizers,n=UN(i,e);-1!==n&&(i.splice(n,1),this.touchAction.update())}return this},e.on=function(t,e){if(void 0===t||void 0===e)return this;var i=this.handlers;return TN(LN(t),function(t){i[t]=i[t]||[],i[t].push(e)}),this},e.off=function(t,e){if(void 0===t)return this;var i=this.handlers;return TN(LN(t),function(t){e?i[t]&&i[t].splice(UN(i[t],e),1):delete i[t]}),this},e.emit=function(t,e){this.options.domEvents&&function(t,e){var i=document.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}(t,e);var i=this.handlers[t]&&this.handlers[t].slice();if(i&&i.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var n=0;n<i.length;)i[n](e),n++}},e.destroy=function(){this.element&&OF(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},t}(),CF={touchstart:1,touchmove:2,touchend:4,touchcancel:8},TF=function(t){function e(){var i,n=e.prototype;return n.evTarget="touchstart",n.evWin="touchstart touchmove touchend touchcancel",(i=t.apply(this,arguments)||this).started=!1,i}return $M(e,t),e.prototype.handler=function(t){var e=CF[t.type];if(1===e&&(this.started=!0),this.started){var i=kF.call(this,t,e);12&e&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:_N,srcEvent:t})}},e}(VN);function kF(t,e){var i=QN(t.touches),n=QN(t.changedTouches);return 12&e&&(i=JN(i.concat(n),"identifier",!0)),[i,n]}function DF(t,e,i){var n="DEPRECATED METHOD: "+e+"\n"+i+" AT \n";return function(){var e=new Error("get-stack-trace"),i=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,n,i),t.apply(this,arguments)}}var IF=DF(function(t,e,i){for(var n=Object.keys(e),o=0;o<n.length;)(!i||i&&void 0===t[n[o]])&&(t[n[o]]=e[n[o]]),o++;return t},"extend","Use `assign`."),PF=DF(function(t,e){return IF(t,e,!0)},"merge","Use `assign`.");function MF(t,e,i){var n,o=e.prototype;(n=t.prototype=Object.create(o)).constructor=t,n._super=o,i&&iN(n,i)}function NF(t,e){return function(){return t.apply(e,arguments)}}var FF=function(){var t=function(t,e){return void 0===e&&(e={}),new SF(t,JM({recognizers:EF.concat()},e))};return t.VERSION="2.0.17-rc",t.DIRECTION_ALL=30,t.DIRECTION_DOWN=EN,t.DIRECTION_LEFT=2,t.DIRECTION_RIGHT=4,t.DIRECTION_UP=8,t.DIRECTION_HORIZONTAL=6,t.DIRECTION_VERTICAL=ON,t.DIRECTION_NONE=1,t.DIRECTION_DOWN=EN,t.INPUT_START=1,t.INPUT_MOVE=2,t.INPUT_END=4,t.INPUT_CANCEL=8,t.STATE_POSSIBLE=1,t.STATE_BEGAN=2,t.STATE_CHANGED=4,t.STATE_ENDED=8,t.STATE_RECOGNIZED=8,t.STATE_CANCELLED=16,t.STATE_FAILED=dF,t.Manager=SF,t.Input=VN,t.TouchAction=IN,t.TouchInput=tF,t.MouseInput=nF,t.PointerEventInput=ZN,t.TouchMouseInput=aF,t.SingleTouchInput=TF,t.Recognizer=fF,t.AttrRecognizer=gF,t.Tap=pF,t.Pan=mF,t.Swipe=yF,t.Pinch=bF,t.Rotate=wF,t.Press=_F,t.on=HN,t.off=WN,t.each=TN,t.merge=PF,t.extend=IF,t.bindFn=NF,t.assign=iN,t.inherit=MF,t.bindFn=NF,t.prefixed=hN,t.toArray=QN,t.inArray=UN,t.uniqueArray=JN,t.splitStr=LN,t.boolOrFn=kN,t.hasParent=PN,t.addEventListeners=HN,t.removeEventListeners=WN,t.defaults=iN({},xF,{preset:EF}),t}();function zF(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){let[e,i,n]=function(){const t=function(){let t=4022871197;return function(e){const i=e.toString();for(let e=0;e<i.length;e++){t+=i.charCodeAt(e);let n=.02519603282416938*t;t=n>>>0,n-=t,n*=t,t=n>>>0,n-=t,t+=4294967296*n}return 2.3283064365386963e-10*(t>>>0)}}();let e=t(" "),i=t(" "),n=t(" ");for(let o=0;o<arguments.length;o++)e-=t(o<0||arguments.length<=o?void 0:arguments[o]),e<0&&(e+=1),i-=t(o<0||arguments.length<=o?void 0:arguments[o]),i<0&&(i+=1),n-=t(o<0||arguments.length<=o?void 0:arguments[o]),n<0&&(n+=1);return[e,i,n]}(t),o=1;const r=()=>{const t=2091639*e+2.3283064365386963e-10*o;return e=i,i=n,n=t-(o=0|t)};return r.uint32=()=>4294967296*r(),r.fract53=()=>r()+11102230246251565e-32*(2097152*r()|0),r.algorithm="Alea",r.seed=t,r.version="0.9",r}(e.length?e:[qk()])}FF.defaults,IT("DELETE");const AF="undefined"!=typeof window?window.Hammer||FF:function(){return function(){const t=()=>{};return{on:t,off:t,destroy:t,emit:t,get:()=>({set:t})}}()};function BF(t){var e;this._cleanupQueue=[],this.active=!1,this._dom={container:t,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});const i=AF(this._dom.overlay);i.on("tap",LE(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{i.destroy()});const n=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];rD(n).call(n,t=>{i.on(t,t=>{t.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=e=>{(function(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1})(e.target,t)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=t=>{("key"in t?"Escape"===t.key:27===t.keyCode)&&this.deactivate()}}mO(BF.prototype),BF.current=null,BF.prototype.destroy=function(){this.deactivate();for(const i of ED(t=ND(e=this._cleanupQueue).call(e,0)).call(t)){var t,e;i()}},BF.prototype.activate=function(){BF.current&&BF.current.deactivate(),BF.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)},BF.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")},BF.prototype._onTapOverlay=function(t){this.activate(),t.srcEvent.stopPropagation()};const jF=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,RF=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,LF=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,HF=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function WF(t){if(t)for(;!0===t.hasChildNodes();){const e=t.firstChild;e&&(WF(e),t.removeChild(e))}}function qF(t){return t instanceof String||"string"==typeof t}function VF(t){return"object"==typeof t&&null!==t}function UF(t,e,i,n){let o=!1;!0===n&&(o=null===e[i]&&void 0!==t[i]),o?delete t[i]:t[i]=e[i]}function YF(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(const n in t)if(void 0!==e[n])if(null===e[n]||"object"!=typeof e[n])UF(t,e,n,i);else{const o=t[n],r=e[n];VF(o)&&VF(r)&&YF(o,r,i)}}function XF(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(nk(i))throw new TypeError("Arrays are not supported by deepExtend");for(let o=0;o<t.length;o++){const r=t[o];if(Object.prototype.hasOwnProperty.call(i,r))if(i[r]&&i[r].constructor===Object)void 0===e[r]&&(e[r]={}),e[r].constructor===Object?KF(e[r],i[r],!1,n):UF(e,i,r,n);else{if(nk(i[r]))throw new TypeError("Arrays are not supported by deepExtend");UF(e,i,r,n)}}return e}function GF(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(nk(i))throw new TypeError("Arrays are not supported by deepExtend");for(const o in i)if(Object.prototype.hasOwnProperty.call(i,o)&&!lI(t).call(t,o))if(i[o]&&i[o].constructor===Object)void 0===e[o]&&(e[o]={}),e[o].constructor===Object?KF(e[o],i[o]):UF(e,i,o,n);else if(nk(i[o])){e[o]=[];for(let t=0;t<i[o].length;t++)e[o].push(i[o][t])}else UF(e,i,o,n);return e}function KF(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)||!0===i)if("object"==typeof e[r]&&null!==e[r]&&EI(e[r])===Object.prototype)void 0===t[r]?t[r]=KF({},e[r],i):"object"==typeof t[r]&&null!==t[r]&&EI(t[r])===Object.prototype?KF(t[r],e[r],i):UF(t,e,r,n);else if(nk(e[r])){var o;t[r]=BT(o=e[r]).call(o)}else UF(t,e,r,n);return t}function ZF(t,e){return[...t,e]}function QF(t){return BT(t).call(t)}function JF(t){return t.getBoundingClientRect().top}function $F(t,e){if(nk(t)){const i=t.length;for(let n=0;n<i;n++)e(t[n],n,t)}else for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&e(t[i],i,t)}function tz(t){let e;switch(t.length){case 3:case 4:return e=RF.exec(t),e?{r:IP(e[1]+e[1],16),g:IP(e[2]+e[2],16),b:IP(e[3]+e[3],16)}:null;case 6:case 7:return e=jF.exec(t),e?{r:IP(e[1],16),g:IP(e[2],16),b:IP(e[3],16)}:null;default:return null}}function ez(t,e){if(lI(t).call(t,"rgba"))return t;if(lI(t).call(t,"rgb")){const i=t.substr(WP(t).call(t,"(")+1).replace(")","").split(",");return"rgba("+i[0]+","+i[1]+","+i[2]+","+e+")"}{const i=tz(t);return null==i?t:"rgba("+i.r+","+i.g+","+i.b+","+e+")"}}function iz(t,e,i){var n;return"#"+BT(n=((1<<24)+(t<<16)+(e<<8)+i).toString(16)).call(n,1)}function nz(t,e){if(qF(t)){let e=t;if(hz(e)){var i;const t=gk(i=e.substr(4).substr(0,e.length-5).split(",")).call(i,function(t){return IP(t)});e=iz(t[0],t[1],t[2])}if(!0===az(e)){const t=function(t){const e=tz(t);if(!e)throw new TypeError("'".concat(t,"' is not a valid color."));return oz(e.r,e.g,e.b)}(e),i={h:t.h,s:.8*t.s,v:Math.min(1,1.02*t.v)},n={h:t.h,s:Math.min(1,1.25*t.s),v:.8*t.v},o=sz(n.h,n.s,n.v),r=sz(i.h,i.s,i.v);return{background:e,border:o,highlight:{background:r,border:o},hover:{background:r,border:o}}}return{background:e,border:e,highlight:{background:e,border:e},hover:{background:e,border:e}}}return{background:t.background||void 0,border:t.border||void 0,highlight:qF(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||void 0,border:t.highlight&&t.highlight.border||void 0},hover:qF(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||void 0,background:t.hover&&t.hover.background||void 0}}}function oz(t,e,i){t/=255,e/=255,i/=255;const n=Math.min(t,Math.min(e,i)),o=Math.max(t,Math.max(e,i));if(n===o)return{h:0,s:0,v:n};return{h:60*((t===n?3:i===n?1:5)-(t===n?e-i:i===n?t-e:i-t)/(o-n))/360,s:(o-n)/o,v:o}}function rz(t,e,i){let n,o,r;const s=Math.floor(6*t),a=6*t-s,h=i*(1-e),d=i*(1-a*e),c=i*(1-(1-a)*e);switch(s%6){case 0:n=i,o=c,r=h;break;case 1:n=d,o=i,r=h;break;case 2:n=h,o=i,r=c;break;case 3:n=h,o=d,r=i;break;case 4:n=c,o=h,r=i;break;case 5:n=i,o=h,r=d}return{r:Math.floor(255*n),g:Math.floor(255*o),b:Math.floor(255*r)}}function sz(t,e,i){const n=rz(t,e,i);return iz(n.r,n.g,n.b)}function az(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)}function hz(t){return LF.test(t)}function dz(t){if(null===t||"object"!=typeof t)return null;if(t instanceof Element)return t;const e=oM(t);for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&"object"==typeof t[i]&&(e[i]=dz(t[i]));return e}function cz(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=function(t){return null!=t},r=function(t){return null!==t&&"object"==typeof 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");const s=e[i],a=r(n)&&!function(t){for(const 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)return;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]=oM(a)}if(!r(s))return;let d=!0;void 0!==s.enabled?d=s.enabled:void 0!==h&&(d=a.enabled),function(t,e,i){r(t[i])||(t[i]={});const n=e[i],o=t[i];for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(o[t]=n[t])}(t,e,i),t[i].enabled=d}const lz={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:(4-2*t)*t-1,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1- --t*t*t*t,easeInOutQuart:t=>t<.5?8*t*t*t*t:1-8*--t*t*t*t,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1+--t*t*t*t*t,easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t};function uz(t,e){let i;nk(e)||(e=[e]);for(const n of t)if(n){i=n[e[0]];for(let t=1;t<e.length;t++)i&&(i=i[e[t]]);if(void 0!==i)break}return i}const fz={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"};let pz=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.pixelRatio=t,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=()=>{},this.closeCallback=()=>{},this._create()}insertTo(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}setCloseCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}_isColorString(t){if("string"==typeof t)return fz[t]}setColor(t){let e,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"===t)return;const n=this._isColorString(t);if(void 0!==n&&(t=n),!0===qF(t)){if(!0===hz(t)){const i=t.substr(4).substr(0,t.length-5).split(",");e={r:i[0],g:i[1],b:i[2],a:1}}else if(!0===function(t){return HF.test(t)}(t)){const i=t.substr(5).substr(0,t.length-6).split(",");e={r:i[0],g:i[1],b:i[2],a:i[3]}}else if(!0===az(t)){const i=tz(t);e={r:i.r,g:i.g,b:i.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){const i=void 0!==t.a?t.a:"1.0";e={r:t.r,g:t.g,b:t.b,a:i}}if(void 0===e)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: "+yM(t));this._setColor(e,i)}show(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(){!0===(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.previousColor=ME({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",VM(()=>{void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0)},0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(t){!0===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&(this.initialColor=ME({},t)),this.color=t;const e=oz(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)}_setOpacity(t){this.color.a=t/100,this._updatePicker(this.color)}_setBrightness(t){const e=oz(this.color.r,this.color.g,this.color.b);e.v=t/100;const i=rz(e.h,e.s,e.v);i.a=this.color.a,this.color=i,this._updatePicker()}_updatePicker(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color;const e=oz(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);const 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),QM(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+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){var 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){const t=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const 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.colorPickerCanvas.appendChild(t)}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);const o=this;this.opacityRange.onchange=function(){o._setOpacity(this.value)},this.opacityRange.oninput=function(){o._setOpacity(this.value)},this.brightnessRange.onchange=function(){o._setBrightness(this.value)},this.brightnessRange.oninput=function(){o._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=LE(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=LE(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=LE(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=LE(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)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new AF(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",t=>{t.isFirst&&this._moveSelector(t)}),this.hammer.on("tap",t=>{this._moveSelector(t)}),this.hammer.on("panstart",t=>{this._moveSelector(t)}),this.hammer.on("panmove",t=>{this._moveSelector(t)}),this.hammer.on("panend",t=>{this._moveSelector(t)})}_generateHueCircle(){if(!1===this.generated){const 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);const e=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;let n,o,r,s;t.clearRect(0,0,e,i),this.centerCoordinates={x:.5*e,y:.5*i},this.r=.49*e;const a=2*Math.PI/360,h=1/360,d=1/this.r;let c;for(r=0;r<360;r++)for(s=0;s<this.r;s++)n=this.centerCoordinates.x+s*Math.sin(a*r),o=this.centerCoordinates.y+s*Math.cos(a*r),c=rz(r*h,s*d,1),t.fillStyle="rgb("+c.r+","+c.g+","+c.b+")",t.fillRect(n-.5,o-.5,2,2);t.strokeStyle="rgba(0,0,0,1)",t.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),t.stroke(),this.hueCircle=t.getImageData(0,0,e,i)}this.generated=!0}_moveSelector(t){const e=this.colorPickerDiv.getBoundingClientRect(),i=t.center.x-e.left,n=t.center.y-e.top,o=.5*this.colorPickerDiv.clientHeight,r=.5*this.colorPickerDiv.clientWidth,s=i-r,a=n-o,h=Math.atan2(s,a),d=.98*Math.min(Math.sqrt(s*s+a*a),r),c=Math.cos(h)*d+o,l=Math.sin(h)*d+r;this.colorPickerSelector.style.top=c-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=l-.5*this.colorPickerSelector.clientWidth+"px";let u=h/(2*Math.PI);u=u<0?u+1:u;const f=d/this.r,p=oz(this.color.r,this.color.g,this.color.b);p.h=u,p.s=f;const g=rz(p.h,p.s,p.v);g.a=this.color.a,this.color=g,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}};function gz(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];if(e.length<1)throw new TypeError("Invalid arguments.");if(1===e.length)return document.createTextNode(e[0]);{const t=document.createElement(e[0]);return t.appendChild(gz(...BT(e).call(e,1))),t}}let vz,mz=!1;const yz="background: #FFeeee; color: #dd0000";const bz=BF,wz=class{constructor(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>!1;this.parent=t,this.changedOptions=[],this.container=e,this.allowCreation=!1,this.hideOption=o,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},ME(this.options,this.defaultOptions),this.configureOptions=i,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new pz(n),this.wrapper=void 0}setOptions(t){if(void 0!==t){this.popupHistory={},this._removePopup();let e=!0;if("string"==typeof t)this.options.filter=t;else if(nk(t))this.options.filter=t.join();else if("object"==typeof t){if(null==t)throw new TypeError("options cannot be null");void 0!==t.container&&(this.options.container=t.container),void 0!==ZI(t)&&(this.options.filter=ZI(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===ZI(this.options)&&(e=!1),this.options.enabled=e}this._clean()}setModuleOptions(t){this.moduleOptions=t,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];const t=ZI(this.options);let e=0,i=!1;for(const n in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,n)&&(this.allowCreation=!1,i=!1,"function"==typeof t?(i=t(n,[]),i=i||this._handleObject(this.configureOptions[n],[n],!0)):!0!==t&&-1===WP(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()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let t=0;t<this.domElements.length;t++)this.wrapper.appendChild(this.domElements[t]);this._showPopupIfNeeded()}_clean(){for(let t=0;t<this.domElements.length;t++)this.wrapper.removeChild(this.domElements[t]);void 0!==this.wrapper&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}_getValue(t){let e=this.moduleOptions;for(let i=0;i<t.length;i++){if(void 0===e[t[i]]){e=void 0;break}e=e[t[i]]}return e}_makeItem(t){if(!0===this.allowCreation){const o=document.createElement("div");o.className="vis-configuration vis-config-item vis-config-s"+t.length;for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return rD(i).call(i,t=>{o.appendChild(t)}),this.domElements.push(o),this.domElements.length}return 0}_makeHeader(t){const e=document.createElement("div");e.className="vis-configuration vis-config-header",e.innerText=t,this._makeItem([],e)}_makeLabel(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const 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(gz("i","b",t))}else n.innerText=t+":";return n}_makeDropdown(t,e,i){const n=document.createElement("select");n.className="vis-configuration vis-config-select";let o=0;void 0!==e&&-1!==WP(t).call(t,e)&&(o=WP(t).call(t,e));for(let e=0;e<t.length;e++){const i=document.createElement("option");i.value=t[e],e===o&&(i.selected="selected"),i.innerText=t[e],n.appendChild(i)}const r=this;n.onchange=function(){r._update(this.value,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,n)}_makeRange(t,e,i){const n=t[0],o=t[1],r=t[2],s=t[3],a=document.createElement("input");a.className="vis-configuration vis-config-range";try{a.type="range",a.min=o,a.max=r}catch(t){}a.step=s;let h="",d=0;if(void 0!==e){const t=1.2;e<0&&e*t<o?(a.min=Math.ceil(e*t),d=a.min,h="range increased"):e/t<o&&(a.min=Math.ceil(e/t),d=a.min,h="range increased"),e*t>r&&1!==r&&(a.max=Math.ceil(e*t),d=a.max,h="range increased"),a.value=e}else a.value=n;const c=document.createElement("input");c.className="vis-configuration vis-config-rangeinput",c.value=a.value;const l=this;a.onchange=function(){c.value=this.value,l._update(Number(this.value),i)},a.oninput=function(){c.value=this.value};const u=this._makeLabel(i[i.length-1],i),f=this._makeItem(i,u,a,c);""!==h&&this.popupHistory[f]!==d&&(this.popupHistory[f]=d,this._setupPopup(h,f))}_makeButton(){if(!0===this.options.showButton){const t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerText="generate options",t.onclick=()=>{this._printOptions()},t.onmouseover=()=>{t.className="vis-configuration vis-config-button hover"},t.onmouseout=()=>{t.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(t)}}_setupPopup(t,e){if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter<this.popupLimit){const i=document.createElement("div");i.id="vis-configuration-popup",i.className="vis-configuration-popup",i.innerText=t,i.onclick=()=>{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:i,index:e}}}_removePopup(){void 0!==this.popupDiv.html&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(void 0!==this.popupDiv.html){const t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=VM(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=VM(()=>{this._removePopup()},1800)}}_makeCheckbox(t,e,i){const n=document.createElement("input");n.type="checkbox",n.className="vis-configuration vis-config-checkbox",n.checked=t,void 0!==e&&(n.checked=e,e!==t&&("object"==typeof t?e!==t.enabled&&this.changedOptions.push({path:i,value:e}):this.changedOptions.push({path:i,value:e})));const o=this;n.onchange=function(){o._update(this.checked,i)};const r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,n)}_makeTextInput(t,e,i){const n=document.createElement("input");n.type="text",n.className="vis-configuration vis-config-text",n.value=e,e!==t&&this.changedOptions.push({path:i,value:e});const o=this;n.onchange=function(){o._update(this.value,i)};const r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,n)}_makeColorField(t,e,i){const n=t[1],o=document.createElement("div");"none"!==(e=void 0===e?n:e)?(o.className="vis-configuration vis-config-colorBlock",o.style.backgroundColor=e):o.className="vis-configuration vis-config-colorBlock none",e=void 0===e?n:e,o.onclick=()=>{this._showColorPicker(e,o,i)};const r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,o)}_showColorPicker(t,e,i){e.onclick=function(){},this.colorPicker.insertTo(e),this.colorPicker.show(),this.colorPicker.setColor(t),this.colorPicker.setUpdateCallback(t=>{const n="rgba("+t.r+","+t.g+","+t.b+","+t.a+")";e.style.backgroundColor=n,this._update(n,i)}),this.colorPicker.setCloseCallback(()=>{e.onclick=()=>{this._showColorPicker(t,e,i)}})}_handleObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!1;const o=ZI(this.options);let r=!1;for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){n=!0;const a=t[s],h=ZF(e,s);if("function"==typeof o&&(n=o(s,e),!1===n&&!nk(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;const t=this._getValue(h);if(nk(a))this._handleArray(a,t,h);else if("string"==typeof a)this._makeTextInput(a,t,h);else if("boolean"==typeof a)this._makeCheckbox(a,t,h);else if(a instanceof Object){if(!this.hideOption(e,s,this.moduleOptions))if(void 0!==a.enabled){const t=ZF(h,"enabled"),e=this._getValue(t);if(!0===e){const t=this._makeLabel(s,h,!0);this._makeItem(h,t),r=this._handleObject(a,h)||r}else this._makeCheckbox(a,e,h)}else{const t=this._makeLabel(s,h,!0);this._makeItem(h,t),r=this._handleObject(a,h)||r}}else console.error("dont know how to handle",a,s,h)}}return r}_handleArray(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)}))}_update(t,e){const 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)}_constructOptions(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i;t="false"!==(t="true"===t||t)&&t;for(let i=0;i<e.length;i++)"global"!==e[i]&&(void 0===n[e[i]]&&(n[e[i]]={}),i!==e.length-1?n=n[e[i]]:n[e[i]]=t);return i}_printOptions(){const t=this.getOptions();for(;this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(gz("pre","const options = "+yM(t,null,2)))}getOptions(){const t={};for(let e=0;e<this.changedOptions.length;e++)this._constructOptions(this.changedOptions[e].value,this.changedOptions[e].path,t);return t}},_z=AF,xz=class{constructor(t,e){this.container=t,this.overflowMethod=e||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}setPosition(t,e){this.x=IP(t),this.y=IP(e)}setText(t){if(t instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(t)}else this.frame.innerText=t}show(t){if(void 0===t&&(t=!0),!0===t){const t=this.frame.clientHeight,e=this.frame.clientWidth,i=this.frame.parentNode.clientHeight,n=this.frame.parentNode.clientWidth;let o=0,r=0;if("flip"==this.overflowMethod){let i=!1,s=!0;this.y-t<this.padding&&(s=!1),this.x+e>n-this.padding&&(i=!0),o=i?this.x-e:this.x,r=s?this.y-t:this.y}else r=this.y-t,r+t+this.padding>i&&(r=i-t-this.padding),r<this.padding&&(r=this.padding),o=this.x,o+e+this.padding>n&&(o=n-e-this.padding),o<this.padding&&(o=this.padding);this.frame.style.left=o+"px",this.frame.style.top=r+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}hide(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}destroy(){this.frame.parentNode.removeChild(this.frame)}},Ez=yz,Oz=class t{static validate(e,i,n){mz=!1,vz=i;let o=i;return void 0!==n&&(o=i[n]),t.parse(e,o,[]),mz}static parse(e,i,n){for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.check(o,e,i,n)}static check(e,i,n,o){if(void 0===n[e]&&void 0===n.__any__)return void t.getSuggestion(e,n,o);let r=e,s=!0;void 0===n[e]&&void 0!==n.__any__&&(r="__any__",s="object"===t.getType(i[e]));let a=n[r];s&&void 0!==a.__type__&&(a=a.__type__),t.checkFields(e,i,n,r,a,o)}static checkFields(e,i,n,o,r,s){const a=function(i){console.error("%c"+i+t.printLocation(s,e),yz)},h=t.getType(i[e]),d=r[h];void 0!==d?"array"===t.getType(d)&&-1===WP(d).call(d,i[e])?(a('Invalid option detected in "'+e+'". Allowed values are:'+t.print(d)+' not "'+i[e]+'". '),mz=!0):"object"===h&&"__any__"!==o&&(s=ZF(s,e),t.parse(i[e],n[o],s)):void 0===r.any&&(a('Invalid type received for "'+e+'". Expected: '+t.print(Ck(r))+". Received ["+h+'] "'+i[e]+'"'),mz=!0)}static getType(t){const e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":nk(t)?"array":t instanceof Date?"date":void 0!==t.nodeType?"dom":!0===t._isAMomentObject?"moment":"object":"number"===e?"number":"boolean"===e?"boolean":"string"===e?"string":void 0===e?"undefined":e}static getSuggestion(e,i,n){const o=t.findInOptions(e,i,n,!1),r=t.findInOptions(e,vz,[],!0);let s;s=void 0!==o.indexMatch?" in "+t.printLocation(o.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+o.indexMatch+'"?\n\n':r.distance<=4&&o.distance>r.distance?" in "+t.printLocation(o.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+t.printLocation(r.path,r.closestMatch,""):o.distance<=8?'. Did you mean "'+o.closestMatch+'"?'+t.printLocation(o.path,e):". Did you mean one of these: "+t.print(Ck(i))+t.printLocation(n,e),console.error('%cUnknown option detected: "'+e+'"'+s,yz),mz=!0}static findInOptions(e,i,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=1e9,s="",a=[];const h=e.toLowerCase();let d;for(const l in i){let u;if(void 0!==i[l].__type__&&!0===o){const o=t.findInOptions(e,i[l],ZF(n,l));r>o.distance&&(s=o.closestMatch,a=o.path,r=o.distance,d=o.indexMatch)}else{var c;-1!==WP(c=l.toLowerCase()).call(c,h)&&(d=l),u=t.levenshteinDistance(e,l),r>u&&(s=l,a=QF(n),r=u)}}return{closestMatch:s,path:a,distance:r,indexMatch:d}}static printLocation(t,e){let i="\n\n"+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n")+"options = {\n";for(let e=0;e<t.length;e++){for(let t=0;t<e+1;t++)i+="  ";i+=t[e]+": {\n"}for(let e=0;e<t.length+1;e++)i+="  ";i+=e+"\n";for(let e=0;e<t.length+1;e++){for(let n=0;n<t.length-e;n++)i+="  ";i+="}\n"}return i+"\n\n"}static print(t){return yM(t).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const i=[];let n,o;for(n=0;n<=e.length;n++)i[n]=[n];for(o=0;o<=t.length;o++)i[0][o]=o;for(n=1;n<=e.length;n++)for(o=1;o<=t.length;o++)e.charAt(n-1)==t.charAt(o-1)?i[n][o]=i[n-1][o-1]:i[n][o]=Math.min(i[n-1][o-1]+1,Math.min(i[n][o-1]+1,i[n-1][o]+1));return i[e.length][t.length]}};function Sz(t){return Iz=t,function(){var t={};Pz=0,void(Mz=Iz.charAt(0)),qz(),"strict"===Nz&&(t.strict=!0,qz());"graph"!==Nz&&"digraph"!==Nz||(t.type=Nz,qz());Fz===kz.IDENTIFIER&&(t.id=Nz,qz());if("{"!=Nz)throw Kz("Angle bracket { expected");if(qz(),Vz(t),"}"!=Nz)throw Kz("Angle bracket } expected");if(qz(),""!==Nz)throw Kz("End of file expected");return qz(),delete t.node,delete t.edge,delete t.graph,t}()}var Cz={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},Tz=oM(Cz);Tz.color="color.color",Tz.style="dashes";var kz={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},Dz={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},Iz="",Pz=0,Mz="",Nz="",Fz=kz.NULL;function zz(){Pz++,Mz=Iz.charAt(Pz)}function Az(){return Iz.charAt(Pz+1)}function Bz(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 jz(t,e){if(t||(t={}),e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function Rz(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 Lz(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<n;i++)if(e.id===s.nodes[i].id){o=s.nodes[i];break}for(o||(o={id:e.id},t.node&&(o.attr=jz(o.attr,t.node))),i=r.length-1;i>=0;i--){var a,h=r[i];h.nodes||(h.nodes=[]),-1===WP(a=h.nodes).call(a,o)&&h.nodes.push(o)}e.attr&&(o.attr=jz(o.attr,e.attr))}function Hz(t,e){if(t.edges||(t.edges=[]),t.edges.push(e),t.edge){var i=jz({},t.edge);e.attr=jz(i,e.attr)}}function Wz(t,e,i,n,o){var r={from:e,to:i,type:n};return t.edge&&(r.attr=jz({},t.edge)),r.attr=jz(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 qz(){for(Fz=kz.NULL,Nz="";" "===Mz||"\t"===Mz||"\n"===Mz||"\r"===Mz;)zz();do{var t=!1;if("#"===Mz){for(var e=Pz-1;" "===Iz.charAt(e)||"\t"===Iz.charAt(e);)e--;if("\n"===Iz.charAt(e)||""===Iz.charAt(e)){for(;""!=Mz&&"\n"!=Mz;)zz();t=!0}}if("/"===Mz&&"/"===Az()){for(;""!=Mz&&"\n"!=Mz;)zz();t=!0}if("/"===Mz&&"*"===Az()){for(;""!=Mz;){if("*"===Mz&&"/"===Az()){zz(),zz();break}zz()}t=!0}for(;" "===Mz||"\t"===Mz||"\n"===Mz||"\r"===Mz;)zz()}while(t);if(""!==Mz){var i=Mz+Az();if(Dz[i])return Fz=kz.DELIMITER,Nz=i,zz(),void zz();if(Dz[Mz])return Fz=kz.DELIMITER,Nz=Mz,void zz();if(Bz(Mz)||"-"===Mz){for(Nz+=Mz,zz();Bz(Mz);)Nz+=Mz,zz();return"false"===Nz?Nz=!1:"true"===Nz?Nz=!0:isNaN(Number(Nz))||(Nz=Number(Nz)),void(Fz=kz.IDENTIFIER)}if('"'===Mz){for(zz();""!=Mz&&('"'!=Mz||'"'===Mz&&'"'===Az());)'"'===Mz?(Nz+=Mz,zz()):"\\"===Mz&&"n"===Az()?(Nz+="\n",zz()):Nz+=Mz,zz();if('"'!=Mz)throw Kz('End of string " expected');return zz(),void(Fz=kz.IDENTIFIER)}for(Fz=kz.UNKNOWN;""!=Mz;)Nz+=Mz,zz();throw new SyntaxError('Syntax error in part "'+Zz(Nz,30)+'"')}Fz=kz.DELIMITER}function Vz(t){for(;""!==Nz&&"}"!=Nz;)Uz(t),";"===Nz&&qz()}function Uz(t){var e=Yz(t);if(e)Xz(t,e);else{var i=function(t){if("node"===Nz)return qz(),t.node=Gz(),"node";if("edge"===Nz)return qz(),t.edge=Gz(),"edge";if("graph"===Nz)return qz(),t.graph=Gz(),"graph";return null}(t);if(!i){if(Fz!=kz.IDENTIFIER)throw Kz("Identifier expected");var n=Nz;if(qz(),"="===Nz){if(qz(),Fz!=kz.IDENTIFIER)throw Kz("Identifier expected");t[n]=Nz,qz()}else!function(t,e){var i={id:e},n=Gz();n&&(i.attr=n);Lz(t,i),Xz(t,e)}(t,n)}}}function Yz(t){var e=null;if("subgraph"===Nz&&((e={}).type="subgraph",qz(),Fz===kz.IDENTIFIER&&(e.id=Nz,qz())),"{"===Nz){if(qz(),e||(e={}),e.parent=t,e.node=t.node,e.edge=t.edge,e.graph=t.graph,Vz(e),"}"!=Nz)throw Kz("Angle bracket } expected");qz(),delete e.node,delete e.edge,delete e.graph,delete e.parent,t.subgraphs||(t.subgraphs=[]),t.subgraphs.push(e)}return e}function Xz(t,e){for(;"->"===Nz||"--"===Nz;){var i,n=Nz;qz();var o=Yz(t);if(o)i=o;else{if(Fz!=kz.IDENTIFIER)throw Kz("Identifier or subgraph expected");Lz(t,{id:i=Nz}),qz()}Hz(t,Wz(t,e,i,n,Gz())),e=i}}function Gz(){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;"["===Nz;){for(qz(),i={};""!==Nz&&"]"!=Nz;){if(Fz!=kz.IDENTIFIER)throw Kz("Attribute name expected");var a=Nz;if(qz(),"="!=Nz)throw Kz("Equal sign = expected");if(qz(),Fz!=kz.IDENTIFIER)throw Kz("Attribute value expected");var h=Nz;"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),qz(),","==Nz&&qz()}if("]"!=Nz)throw Kz("Bracket ] expected");qz()}if(lI(s).call(s,"dir")){var d={arrows:{}};for(t=0;t<r.length;t++)if("arrows"===r[t].name)if(null!=r[t].value.to)d.arrows.to=t;else{if(null==r[t].value.from)throw Kz("Invalid value of arrows");d.arrows.from=t}else"dir"===r[t].name&&(d.dir=t);var c,l,u=r[d.dir].value;if(!lI(s).call(s,"arrows"))if("both"===u)r.push({attr:r[d.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),d.arrows.to=r.length-1,r.push({attr:r[d.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),d.arrows.from=r.length-1;else if("forward"===u)r.push({attr:r[d.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),d.arrows.to=r.length-1;else if("back"===u)r.push({attr:r[d.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),d.arrows.from=r.length-1;else{if("none"!==u)throw Kz('Invalid dir type "'+u+'"');r.push({attr:r[d.dir].attr,name:"arrows",value:""}),d.arrows.to=r.length-1}if("both"===u)d.arrows.to&&d.arrows.from?(l=r[d.arrows.to].value.to.type,c=r[d.arrows.from].value.from.type,r[d.arrows.to]={attr:r[d.arrows.to].attr,name:r[d.arrows.to].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:c}}},ND(r).call(r,d.arrows.from,1)):d.arrows.to?(l=r[d.arrows.to].value.to.type,c="arrow",r[d.arrows.to]={attr:r[d.arrows.to].attr,name:r[d.arrows.to].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:c}}}):d.arrows.from&&(l="arrow",c=r[d.arrows.from].value.from.type,r[d.arrows.from]={attr:r[d.arrows.from].attr,name:r[d.arrows.from].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:c}}});else if("back"===u)d.arrows.to&&d.arrows.from?(l="",c=r[d.arrows.from].value.from.type,r[d.arrows.from]={attr:r[d.arrows.from].attr,name:r[d.arrows.from].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:c}}}):d.arrows.to?(l="",c="arrow",d.arrows.from=d.arrows.to,r[d.arrows.from]={attr:r[d.arrows.from].attr,name:r[d.arrows.from].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:c}}}):d.arrows.from&&(l="",c=r[d.arrows.from].value.from.type,r[d.arrows.to]={attr:r[d.arrows.from].attr,name:r[d.arrows.from].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:c}}}),r[d.arrows.from]={attr:r[d.arrows.from].attr,name:r[d.arrows.from].name,value:{from:{enabled:!0,type:r[d.arrows.from].value.from.type}}};else if("none"===u){var f;r[f=d.arrows.to?d.arrows.to:d.arrows.from]={attr:r[f].attr,name:r[f].name,value:""}}else{if("forward"!==u)throw Kz('Invalid dir type "'+u+'"');d.arrows.to&&d.arrows.from||d.arrows.to?(l=r[d.arrows.to].value.to.type,c="",r[d.arrows.to]={attr:r[d.arrows.to].attr,name:r[d.arrows.to].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:c}}}):d.arrows.from&&(l="arrow",c="",d.arrows.to=d.arrows.from,r[d.arrows.to]={attr:r[d.arrows.to].attr,name:r[d.arrows.to].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:c}}}),r[d.arrows.to]={attr:r[d.arrows.to].attr,name:r[d.arrows.to].name,value:{to:{enabled:!0,type:r[d.arrows.to].value.to.type}}}}ND(r).call(r,d.dir,1)}if(lI(s).call(s,"penwidth")){var p=[];for(e=r.length,t=0;t<e;t++)"width"!==r[t].name&&("penwidth"===r[t].name&&(r[t].name="width"),p.push(r[t]));r=p}for(e=r.length,t=0;t<e;t++)Rz(r[t].attr,r[t].name,r[t].value);return i}function Kz(t){return new SyntaxError(t+', got "'+Zz(Nz,30)+'" (char '+Pz+")")}function Zz(t,e){return t.length<=e?t:t.substr(0,27)+"..."}function Qz(t,e,i){for(var n=e.split("."),o=n.pop(),r=t,s=0;s<n.length;s++){var a=n[s];a in r||(r[a]={}),r=r[a]}return r[o]=i,t}function Jz(t,e){var i={};for(var n in t)if(t.hasOwnProperty(n)){var o=e[n];nk(o)?rD(o).call(o,function(e){Qz(i,e,t[n])}):Qz(i,"string"==typeof o?o:n,t[n])}return i}function $z(t){var e,i=Sz(t),n={nodes:[],edges:[],options:{}};i.nodes&&rD(e=i.nodes).call(e,function(t){var e={id:t.id,label:String(t.label||t.id)};jz(e,Jz(t.attr,Cz)),e.image&&(e.shape="image"),n.nodes.push(e)});if(i.edges){var o,r=function(t){var e={from:t.from,to:t.to};return jz(e,Jz(t.attr,Tz)),null==e.arrows&&"->"===t.type&&(e.arrows="to"),e};rD(o=i.edges).call(o,function(t){var e,i,o,s,a,h,d;(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)&&rD(o=t.from.edges).call(o,function(t){var e=r(t);n.edges.push(e)});(a=i,h=function(e,i){var o=Wz(n,e.id,i.id,t.type,t.attr),s=r(o);n.edges.push(s)},nk(s=e)?rD(s).call(s,function(t){nk(a)?rD(a).call(a,function(e){h(t,e)}):h(t,a)}):nk(a)?rD(a).call(a,function(t){h(s,t)}):h(s,a),t.to instanceof Object&&t.to.edges)&&rD(d=t.to.edges).call(d,function(t){var e=r(t);n.edges.push(e)})})}return i.attr&&(n.options=i.attr),n}var tA=Object.freeze({__proto__:null,cn:{addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},cs:{addDescription:"Kluknutím do prázdného prostoru můžete přidat nový vrchol.",addEdge:"Přidat hranu",addNode:"Přidat vrchol",back:"Zpět",close:"Zavřít",createEdgeError:"Nelze připojit hranu ke shluku.",del:"Smazat výběr",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",editNode:"Upravit vrchol"},de:{addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzufügen",addNode:"Knoten hinzufügen",back:"Zurück",close:"Schließen",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",del:"Lösche Auswahl",deleteClusterError:"Cluster können nicht gelöscht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster können nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},en:{addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},es:{addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",addEdge:"Añadir arista",addNode:"Añadir nodo",back:"Atrás",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selección",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},fr:{addDescription:"Cliquez dans un endroit vide pour placer un nœud.",addEdge:"Ajouter un lien",addNode:"Ajouter un nœud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de créer un lien vers un cluster.",del:"Effacer la sélection",deleteClusterError:"Les clusters ne peuvent pas être effacés.",edgeDescription:"Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.",edit:"Éditer",editClusterError:"Les clusters ne peuvent pas être édités.",editEdge:"Éditer le lien",editEdgeDescription:"Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.",editNode:"Éditer le nœud"},it:{addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},nl:{addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},pt:{addDescription:"Clique em um espaço em branco para adicionar um novo nó",addEdge:"Adicionar aresta",addNode:"Adicionar nó",back:"Voltar",close:"Fechar",createEdgeError:"Não foi possível linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters não puderam ser removidos.",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",edit:"Editar",editClusterError:"Clusters não puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",editNode:"Editar nó"},ru:{addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},uk:{addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"}});class eA{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;const t=this.image.width,e=this.image.height;this.width=t,this.height=e;const 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),d=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,d,r]],this._fillMipMap()}initialized(){return void 0!==this.coordinates}_fillMipMap(){const t=this.canvas.getContext("2d"),e=this.coordinates[0];t.drawImage(this.image,e[0],e[1],e[2],e[3]);for(let e=1;e<this.NUM_ITERATIONS;e++){const i=this.coordinates[e-1],n=this.coordinates[e];t.drawImage(this.canvas,i[0],i[1],i[2],i[3],n[0],n[1],n[2],n[3])}}drawImageAtPosition(t,e,i,n,o,r){if(this.initialized())if(e>2){e*=.5;let s=0;for(;e>2&&s<this.NUM_ITERATIONS;)e*=.5,s+=1;s>=this.NUM_ITERATIONS&&(s=this.NUM_ITERATIONS-1);const 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)}}class iA{constructor(t){this.images={},this.imageBroken={},this.callback=t}_tryloadBrokenUrl(t,e,i){void 0!==t&&void 0!==i&&(void 0!==e?(i.image.onerror=()=>{console.error("Could not load brokenImage:",e)},i.image.src=e):console.warn("No broken url image defined"))}_redrawWithImage(t){this.callback&&this.callback(t)}load(t,e){const i=this.images[t];if(i)return i;const n=new eA;return this.images[t]=n,n.image.onload=()=>{this._fixImageCoordinates(n.image),n.init(),this._redrawWithImage(n)},n.image.onerror=()=>{console.error("Could not load image:",t),this._tryloadBrokenUrl(t,e,n)},n.image.src=t,n}_fixImageCoordinates(t){0===t.width&&(document.body.appendChild(t),t.width=t.offsetWidth,t.height=t.offsetHeight,document.body.removeChild(t))}}var nA,oA,rA,sA,aA,hA,dA,cA,lA,uA,fA,pA,gA,vA,mA,yA,bA,wA,_A,xA,EA,OA,SA,CA,TA,kA,DA,IA,PA,MA={},NA={exports:{}};function FA(){return oA?nA:(oA=1,nA=ow()(function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))}function zA(){if(sA)return rA;sA=1;var t=ow(),e=h_(),i=hw(),n=FA(),o=Object.isExtensible,r=t(function(){});return rA=r||n?function(t){return!!e(t)&&((!n||"ArrayBuffer"!==i(t))&&(!o||o(t)))}:o,rA}function AA(){return hA?aA:(hA=1,aA=!ow()(function(){return Object.isExtensible(Object.preventExtensions({}))}))}function BA(){if(dA)return NA.exports;dA=1;var t=Ux(),e=aw(),i=Jx(),n=h_(),o=ex(),r=qx().f,s=KO(),a=iS(),h=zA(),d=ix(),c=AA(),l=!1,u=d("meta"),f=0,p=function(t){r(t,u,{value:{objectID:"O"+f++,weakData:{}}})},g=NA.exports={enable:function(){g.enable=function(){},l=!0;var i=s.f,n=e([].splice),o={};o[u]=1,i(o).length&&(s.f=function(t){for(var e=i(t),o=0,r=e.length;o<r;o++)if(e[o]===u){n(e,o,1);break}return e},t({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:a.f}))},fastKey:function(t,e){if(!n(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,u)){if(!h(t))return"F";if(!e)return"E";p(t)}return t[u].objectID},getWeakData:function(t,e){if(!o(t,u)){if(!h(t))return!0;if(!e)return!1;p(t)}return t[u].weakData},onFreeze:function(t){return c&&l&&h(t)&&!o(t,u)&&p(t),t}};return i[u]=!0,NA.exports}function jA(){if(lA)return cA;lA=1;var t=nx(),e=rT(),i=t("iterator"),n=Array.prototype;return cA=function(t){return void 0!==t&&(e.Array===t||n[i]===t)},cA}function RA(){if(fA)return uA;fA=1;var t=EO(),e=b_(),i=r_(),n=rT(),o=nx()("iterator");return uA=function(r){if(!i(r))return e(r,o)||e(r,"@@iterator")||n[t(r)]},uA}function LA(){if(gA)return pA;gA=1;var t=mw(),e=y_(),i=Wx(),n=m_(),o=RA(),r=TypeError;return pA=function(s,a){var h=arguments.length<2?o(s):a;if(e(h))return i(t(h,s));throw new r(n(s)+" is not iterable")},pA}function HA(){if(mA)return vA;mA=1;var t=mw(),e=Wx(),i=b_();return vA=function(n,o,r){var s,a;e(n);try{if(!(s=i(n,"return"))){if("throw"===o)throw r;return r}s=t(s,n)}catch(t){a=!0,s=t}if("throw"===o)throw r;if(a)throw s;return e(s),r},vA}function WA(){if(bA)return yA;bA=1;var t=cx(),e=mw(),i=Wx(),n=m_(),o=jA(),r=Zx(),s=l_(),a=LA(),h=RA(),d=HA(),c=TypeError,l=function(t,e){this.stopped=t,this.result=e},u=l.prototype;return yA=function(f,p,g){var v,m,y,b,w,_,x,E=g&&g.that,O=!(!g||!g.AS_ENTRIES),S=!(!g||!g.IS_RECORD),C=!(!g||!g.IS_ITERATOR),T=!(!g||!g.INTERRUPTED),k=t(p,E),D=function(t){return v&&d(v,"normal"),new l(!0,t)},I=function(t){return O?(i(t),T?k(t[0],t[1],D):k(t[0],t[1])):T?k(t,D):k(t)};if(S)v=f.iterator;else if(C)v=f;else{if(!(m=h(f)))throw new c(n(f)+" is not iterable");if(o(m)){for(y=0,b=r(f);b>y;y++)if((w=I(f[y]))&&s(u,w))return w;return new l(!1)}v=a(f,m)}for(_=S?f.next:v.next;!(x=e(_,v)).done;){try{w=I(x.value)}catch(t){d(v,"throw",t)}if("object"==typeof w&&w&&s(u,w))return w}return new l(!1)},yA}function qA(){if(_A)return wA;_A=1;var t=l_(),e=TypeError;return wA=function(i,n){if(t(n,i))return i;throw new e("Incorrect invocation")},wA}function VA(){if(EA)return xA;EA=1;var t=Ux(),e=nw(),i=BA(),n=ow(),o=Vx(),r=WA(),s=qA(),a=cw(),h=h_(),d=r_(),c=CS(),l=qx().f,u=DS().forEach,f=vw(),p=kS(),g=p.set,v=p.getterFor;return xA=function(p,m,y){var b,w=-1!==p.indexOf("Map"),_=-1!==p.indexOf("Weak"),x=w?"set":"add",E=e[p],O=E&&E.prototype,S={};if(f&&a(E)&&(_||O.forEach&&!n(function(){(new E).entries().next()}))){var C=(b=m(function(t,e){g(s(t,C),{type:p,collection:new E}),d(e)||r(e,t[x],{that:t,AS_ENTRIES:w})})).prototype,T=v(p);u(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(t){var e="add"===t||"set"===t;!(t in O)||_&&"clear"===t||o(C,t,function(i,n){var o=T(this).collection;if(!e&&_&&!h(i))return"get"===t&&void 0;var r=o[t](0===i?0:i,n);return e?this:r})}),_||l(C,"size",{configurable:!0,get:function(){return T(this).collection.size}})}else b=y.getConstructor(m,p,w,x),i.enable();return c(b,p,!1,!0),S[p]=b,t({global:!0,forced:!0},S),_||y.setStrong(b,p,w),b}}function UA(){if(SA)return OA;SA=1;var t=nS();return OA=function(e,i,n){for(var o in i)n&&n.unsafe&&e[o]?e[o]=i[o]:t(e,o,i[o],n);return e}}function YA(){if(TA)return CA;TA=1;var t=c_(),e=oS(),i=nx(),n=vw(),o=i("species");return CA=function(i){var r=t(i);n&&r&&!r[o]&&e(r,o,{configurable:!0,get:function(){return this}})}}function XA(){if(DA)return kA;DA=1;var t=YO(),e=oS(),i=UA(),n=cx(),o=qA(),r=r_(),s=WA(),a=gT(),h=vT(),d=YA(),c=vw(),l=BA().fastKey,u=kS(),f=u.set,p=u.getterFor;return kA={getConstructor:function(a,h,d,u){var g=a(function(e,i){o(e,v),f(e,{type:h,index:t(null),first:null,last:null,size:0}),c||(e.size=0),r(i)||s(i,e[u],{that:e,AS_ENTRIES:d})}),v=g.prototype,m=p(h),y=function(t,e,i){var n,o,r=m(t),s=b(t,e);return s?s.value=i:(r.last=s={index:o=l(e,!0),key:e,value:i,previous:n=r.last,next:null,removed:!1},r.first||(r.first=s),n&&(n.next=s),c?r.size++:t.size++,"F"!==o&&(r.index[o]=s)),t},b=function(t,e){var i,n=m(t),o=l(e);if("F"!==o)return n.index[o];for(i=n.first;i;i=i.next)if(i.key===e)return i};return i(v,{clear:function(){for(var e=m(this),i=e.first;i;)i.removed=!0,i.previous&&(i.previous=i.previous.next=null),i=i.next;e.first=e.last=null,e.index=t(null),c?e.size=0:this.size=0},delete:function(t){var e=this,i=m(e),n=b(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),c?i.size--:e.size--}return!!n},forEach:function(t){for(var e,i=m(this),o=n(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:i.first;)for(o(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!b(this,t)}}),i(v,d?{get:function(t){var e=b(this,t);return e&&e.value},set:function(t,e){return y(this,0===t?0:t,e)}}:{add:function(t){return y(this,t=0===t?0:t,t)}}),c&&e(v,"size",{configurable:!0,get:function(){return m(this).size}}),g},setStrong:function(t,e,i){var n=e+" Iterator",o=p(e),r=p(n);a(t,e,function(t,e){f(this,{type:n,target:t,state:o(t),kind:e,last:null})},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)?h("keys"===e?i.key:"values"===e?i.value:[i.key,i.value],!1):(t.target=null,h(void 0,!0))},i?"entries":"values",!i,!0),d(e)}},kA}function GA(){return PA||(PA=1,IA||(IA=1,VA()("Map",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},XA()))),MA}var KA,ZA,QA,JA,$A,tB={};function eB(){return ZA||(ZA=1,KA=function(t,e){return 1===e?function(e,i){return e[t](i)}:function(e,i,n){return e[t](i,n)}}),KA}function iB(){if(JA)return QA;JA=1;var t=c_(),e=eB(),i=t("Map");return QA={Map:i,set:e("set",2),get:e("get",1),has:e("has",1),remove:e("delete",1),proto:i.prototype}}var nB,oB,rB,sB,aB,hB,dB,cB,lB,uB={};function fB(){if(oB)return nB;oB=1;var t=aw(),e=Xx(),i=FO(),n=s_(),o=t("".charAt),r=t("".charCodeAt),s=t("".slice),a=function(t){return function(a,h){var d,c,l=i(n(a)),u=e(h),f=l.length;return u<0||u>=f?t?"":void 0:(d=r(l,u))<55296||d>56319||u+1===f||(c=r(l,u+1))<56320||c>57343?t?o(l,u):d:t?s(l,u,u+2):c-56320+(d-55296<<10)+65536}};return nB={codeAt:a(!1),charAt:a(!0)}}function pB(){if(rB)return uB;rB=1;var t=fB().charAt,e=FO(),i=kS(),n=gT(),o=vT(),r="String Iterator",s=i.set,a=i.getterFor(r);return n(String,"String",function(t){s(this,{type:r,string:e(t),index:0})},function(){var e,i=a(this),n=i.string,r=i.index;return r>=n.length?o(void 0,!0):(e=t(n,r),i.index+=e.length,o(e,!1))}),uB}function gB(){return aB?sB:(aB=1,mT(),GA(),function(){if($A)return tB;$A=1;var t=Ux(),e=aw(),i=y_(),n=s_(),o=WA(),r=iB(),s=Z_(),a=ow(),h=r.Map,d=r.has,c=r.get,l=r.set,u=e([].push),f=s||a(function(){return 1!==h.groupBy("ab",function(t){return t}).get("a").length});t({target:"Map",stat:!0,forced:s||f},{groupBy:function(t,e){n(t),i(e);var r=new h,s=0;return o(t,function(t){var i=e(t,s++);d(r,i)?u(c(r,i),t):l(r,i,[t])}),r}})}(),pB(),sB=d_().Map)}function vB(){if(dB)return hB;dB=1;var t=gB();return bT(),hB=t}var mB=Rb(lB?cB:(lB=1,cB=vB()));class yB{constructor(){this.clear(),this._defaultIndex=0,this._groupIndex=0,this._defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},ME(this.options,this.defaultOptions)}setOptions(t){const e=["useDefaultGroups"];if(void 0!==t)for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&-1===WP(e).call(e,i)){const e=t[i];this.add(i,e)}}clear(){this._groups=new mB,this._groupNames=[]}get(t){let 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){const e=this._groupIndex%this._groupNames.length;++this._groupIndex,i={},i.color=this._groups.get(this._groupNames[e]),this._groups.set(t,i)}else{const e=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,i={},i.color=this._defaultGroups[e],this._groups.set(t,i)}return i}add(t,e){return this._groups.has(t)||this._groupNames.push(t),this._groups.set(t,e),e}}var bB,wB,_B,xB,EB,OB,SB;function CB(){return _B?wB:(_B=1,bB||(bB=1,Ux()({target:"Number",stat:!0},{isNaN:function(t){return t!=t}})),wB=d_().Number.isNaN)}function TB(){return EB?xB:(EB=1,xB=CB())}var kB,DB,IB,PB,MB,NB,FB,zB,AB,BB=Rb(SB?OB:(SB=1,OB=TB()));function jB(){if(DB)return kB;DB=1;var t=nw().isFinite;return kB=Number.isFinite||function(e){return"number"==typeof e&&t(e)},kB}function RB(){return MB?PB:(MB=1,IB||(IB=1,Ux()({target:"Number",stat:!0},{isFinite:jB()})),PB=d_().Number.isFinite)}function LB(){return FB?NB:(FB=1,NB=RB())}var HB,WB,qB,VB,UB,YB,XB,GB,KB,ZB=Rb(AB?zB:(AB=1,zB=LB())),QB={};function JB(){return qB?WB:(qB=1,function(){if(HB)return QB;HB=1;var t=Ux(),e=DS().some;t({target:"Array",proto:!0,forced:!Uk()("some")},{some:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}})}(),WB=AE()("Array","some"))}function $B(){if(UB)return VB;UB=1;var t=l_(),e=JB(),i=Array.prototype;return VB=function(n){var o=n.some;return n===i||t(i,n)&&o===i.some?e:o},VB}function tj(){return XB?YB:(XB=1,YB=$B())}var ej,ij,nj,oj,rj,sj,aj,hj,dj,cj,lj=Rb(KB?GB:(KB=1,GB=tj())),uj={exports:{}},fj={};function pj(){if(ej)return fj;ej=1;var t=Ux(),e=vw(),i=qx().f;return t({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!e},{defineProperty:i}),fj}function gj(){if(ij)return uj.exports;ij=1,pj();var t=d_().Object,e=uj.exports=function(e,i,n){return t.defineProperty(e,i,n)};return t.defineProperty.sham&&(e.sham=!0),uj.exports}function vj(){return oj?nj:(oj=1,nj=gj())}function mj(){return sj?rj:(sj=1,rj=vj())}function yj(){return hj?aj:(hj=1,aj=mj())}function bj(){return cj?dj:(cj=1,dj=yj())}var wj,_j=Rb(bj()),xj={};var Ej;var Oj;var Sj,Cj,Tj;function kj(){if(Tj)return Cj;Tj=1;var t=wT();return function(){if(wj)return xj;wj=1;var t=nx(),e=qx().f,i=t("metadata"),n=Function.prototype;void 0===n[i]&&e(n,i,{value:null})}(),Ej||(Ej=1,KS()),Oj||(Oj=1,$S()),Sj||(Sj=1,ES()("metadata")),Cj=t}var Dj,Ij,Pj;function Mj(){if(Ij)return Dj;Ij=1;var t=c_(),e=aw(),i=t("Symbol"),n=i.keyFor,o=e(i.prototype.valueOf);return Dj=i.isRegisteredSymbol||function(t){try{return void 0!==n(o(t))}catch(t){return!1}}}var Nj,Fj,zj;function Aj(){if(Fj)return Nj;Fj=1;for(var t=$_(),e=c_(),i=aw(),n=v_(),o=nx(),r=e("Symbol"),s=r.isWellKnownSymbol,a=e("Object","getOwnPropertyNames"),h=i(r.prototype.valueOf),d=t("wks"),c=0,l=a(r),u=l.length;c<u;c++)try{var f=l[c];n(r[f])&&o(f)}catch(t){}return Nj=function(t){if(s&&s(t))return!0;try{for(var e=h(t),i=0,n=a(d),o=n.length;i<o;i++)if(d[n[i]]==e)return!0}catch(t){}return!1},Nj}var Bj;var jj;var Rj;var Lj;var Hj;var Wj;var qj;var Vj,Uj,Yj,Xj,Gj;function Kj(){if(Yj)return Uj;Yj=1;var t=kj();return Pj||(Pj=1,Ux()({target:"Symbol",stat:!0},{isRegisteredSymbol:Mj()})),zj||(zj=1,Ux()({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:Aj()})),Bj||(Bj=1,ES()("customMatcher")),jj||(jj=1,ES()("observable")),Rj||(Rj=1,Ux()({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:Mj()})),Lj||(Lj=1,Ux()({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:Aj()})),Hj||(Hj=1,ES()("matcher")),Wj||(Wj=1,ES()("metadataKey")),qj||(qj=1,ES()("patternMatch")),Vj||(Vj=1,ES()("replaceAll")),Uj=t}function Zj(){return Gj?Xj:(Gj=1,Xj=Kj())}var Qj,Jj,$j,tR,eR,iR,nR,oR,rR,sR,aR=Rb(Zj());function hR(){return Jj?Qj:(Jj=1,mT(),pB(),oC(),Qj=xS().f("iterator"))}function dR(){if(tR)return $j;tR=1;var t=hR();return bT(),$j=t}function cR(){return iR?eR:(iR=1,eR=dR())}function lR(){return oR?nR:(oR=1,nR=cR())}function uR(){return sR?rR:(sR=1,rR=lR())}var fR,pR,gR,vR,mR,yR,bR,wR,_R,xR,ER=Rb(uR());function OR(t){return OR="function"==typeof aR&&"symbol"==typeof ER?function(t){return typeof t}:function(t){return t&&"function"==typeof aR&&t.constructor===aR&&t!==aR.prototype?"symbol":typeof t},OR(t)}function SR(){return pR?fR:(pR=1,fC(),fR=xS().f("toPrimitive"))}function CR(){return vR?gR:(vR=1,gR=SR())}function TR(){return yR?mR:(yR=1,mR=CR())}function kR(){return wR?bR:(wR=1,bR=TR())}function DR(){return xR?_R:(xR=1,_R=kR())}var IR=Rb(DR());function PR(t){var e=function(t,e){if("object"!=OR(t)||!t)return t;var i=t[IR];if(void 0!==i){var n=i.call(t,e);if("object"!=OR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==OR(e)?e:e+""}function MR(t,e,i){return(e=PR(e))in t?_j(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var NR,FR,zR,AR,BR,jR,RR,LR,HR,WR={};function qR(){if(FR)return NR;FR=1;var t=nw(),e=ow(),i=aw(),n=FO(),o=mP().trim,r=vP(),s=i("".charAt),a=t.parseFloat,h=t.Symbol,d=h&&h.iterator,c=1/a(r+"-0")!=-1/0||d&&!e(function(){a(Object(d))});return NR=c?function(t){var e=o(n(t)),i=a(e);return 0===i&&"-"===s(e,0)?-0:i}:a,NR}function VR(){return BR?AR:(BR=1,function(){if(zR)return WR;zR=1;var t=Ux(),e=qR();t({global:!0,forced:parseFloat!==e},{parseFloat:e})}(),AR=d_().parseFloat)}function UR(){return RR?jR:(RR=1,jR=VR())}var YR,XR,GR,KR,ZR,QR,JR,$R=Rb(HR?LR:(HR=1,LR=UR())),tL={};function eL(){if(YR)return tL;YR=1;var t=Ux(),e=ow(),i=iS().f;return t({target:"Object",stat:!0,forced:e(function(){return!Object.getOwnPropertyNames(1)})},{getOwnPropertyNames:i}),tL}function iL(){if(GR)return XR;GR=1,eL();var t=d_().Object;return XR=function(e){return t.getOwnPropertyNames(e)},XR}function nL(){return ZR?KR:(ZR=1,KR=iL())}var oL,rL,sL,aL,hL,dL,cL=Rb(JR?QR:(JR=1,QR=nL()));function lL(){return rL?oL:(rL=1,YS(),oL=d_().Object.getOwnPropertySymbols)}function uL(){return aL?sL:(aL=1,sL=lL())}var fL,pL,gL,vL,mL,yL,bL=Rb(dL?hL:(dL=1,hL=uL())),wL={exports:{}},_L={};function xL(){if(pL)return wL.exports;pL=1,function(){if(fL)return _L;fL=1;var t=Ux(),e=ow(),i=a_(),n=hx().f,o=vw();t({target:"Object",stat:!0,forced:!o||e(function(){n(1)}),sham:!o},{getOwnPropertyDescriptor:function(t,e){return n(i(t),e)}})}();var t=d_().Object,e=wL.exports=function(e,i){return t.getOwnPropertyDescriptor(e,i)};return t.getOwnPropertyDescriptor.sham&&(e.sham=!0),wL.exports}function EL(){return vL?gL:(vL=1,gL=xL())}var OL,SL,CL,TL,kL,DL,IL,PL=Rb(yL?mL:(yL=1,mL=EL())),ML={};function NL(){return CL?SL:(CL=1,function(){if(OL)return ML;OL=1;var t=Ux(),e=vw(),i=jT(),n=a_(),o=hx(),r=_O();t({target:"Object",stat:!0,sham:!e},{getOwnPropertyDescriptors:function(t){for(var e,s,a=n(t),h=o.f,d=i(a),c={},l=0;d.length>l;)void 0!==(s=h(a,e=d[l++]))&&r(c,e,s);return c}})}(),SL=d_().Object.getOwnPropertyDescriptors)}function FL(){return kL?TL:(kL=1,TL=NL())}var zL,AL,BL,jL,RL,LL,HL=Rb(IL?DL:(IL=1,DL=FL())),WL={exports:{}},qL={};function VL(){if(zL)return qL;zL=1;var t=Ux(),e=vw(),i=qO().f;return t({target:"Object",stat:!0,forced:Object.defineProperties!==i,sham:!e},{defineProperties:i}),qL}function UL(){if(AL)return WL.exports;AL=1,VL();var t=d_().Object,e=WL.exports=function(e,i){return t.defineProperties(e,i)};return t.defineProperties.sham&&(e.sham=!0),WL.exports}function YL(){return jL?BL:(jL=1,BL=UL())}var XL,GL,KL=Rb(LL?RL:(LL=1,RL=YL()));var ZL,QL,JL,$L,tH,eH,iH,nH,oH=Rb(GL?XL:(GL=1,XL=vj()));function rH(t,e){const i=["node","edge","label"];let n=!0;const o=uz(e,"chosen");if("boolean"==typeof o)n=o;else if("object"==typeof o){if(-1===WP(i).call(i,t))throw new Error("choosify: subOption '"+t+"' should be one of '"+i.join("', '")+"'");const o=uz(e,["chosen",t]);"boolean"!=typeof o&&"function"!=typeof o||(n=o)}return n}function sH(t,e,i){if(t.width<=0||t.height<=0)return!1;if(void 0!==i){const t={x:e.x-i.x,y:e.y-i.y};if(0!==i.angle){const n=-i.angle;e={x:Math.cos(n)*t.x-Math.sin(n)*t.y,y:Math.sin(n)*t.x+Math.cos(n)*t.y}}else e=t}const n=t.x+t.width,o=t.y+t.width;return t.left<e.x&&n>e.x&&t.top<e.y&&o>e.y}function aH(t){return"string"==typeof t&&""!==t}function hH(t,e,i,n){let o=n.x,r=n.y;if("function"==typeof n.distanceToBorder){const i=n.distanceToBorder(t,e),s=Math.sin(e)*i,a=Math.cos(e)*i;a===i?(o+=i,r=n.y):s===i?(o=n.x,r-=i):(o+=a,r-=s)}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}}function dH(){return QL?ZL:(QL=1,mT(),ZL=AE()("Array","values"))}function cH(){return $L?JL:($L=1,JL=dH())}function lH(){if(eH)return tH;eH=1,bT();var t=EO(),e=ex(),i=l_(),n=cH(),o=Array.prototype,r={DOMTokenList:!0,NodeList:!0};return tH=function(s){var a=s.values;return s===o||i(o,s)&&a===o.values||e(r,t(s))?n:a},tH}var uH=Rb(nH?iH:(nH=1,iH=lH()));class fH{constructor(t){this.measureText=t,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal";void 0===this.lines[t]&&(this.lines[t]={width:0,height:0,blocks:[]});let n=e;void 0!==e&&""!==e||(n=" ");const o=this.measureText(n,i),r=ME({},uH(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}curWidth(){const t=this.lines[this.current];return void 0===t?0:t.width}append(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,t,e)}newLine(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,t,e),this.current++}determineLineHeights(){for(let t=0;t<this.lines.length;t++){const e=this.lines[t];let i=0;if(void 0!==e.blocks)for(let t=0;t<e.blocks.length;t++){const n=e.blocks[t];i<n.height&&(i=n.height)}e.height=i}}determineLabelSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.width>t&&(t=n.width),e+=n.height}this.width=t,this.height=e}removeEmptyBlocks(){const t=[];for(let e=0;e<this.lines.length;e++){const i=this.lines[e];if(0===i.blocks.length)continue;if(e===this.lines.length-1&&0===i.width)continue;const n={};let o;ME(n,i),n.blocks=[];const r=[];for(let t=0;t<i.blocks.length;t++){const e=i.blocks[t];0!==e.width?r.push(e):void 0===o&&(o=e)}0===r.length&&void 0!==o&&r.push(o),n.blocks=r,t.push(n)}return t}finalize(){this.determineLineHeights(),this.determineLabelSize();const t=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:t}}}const pH={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/};class gH{constructor(t){this.text=t,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}mod(){return 0===this.modStack.length?"normal":this.modStack[0]}modName(){return 0===this.modStack.length?"normal":"mono"===this.modStack[0]?"mono":this.bold&&this.ital?"boldital":this.bold?"bold":this.ital?"ital":void 0}emitBlock(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}add(t){" "===t&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=t&&(this.buffer+=t)}parseWS(t){return!!/[ \t]/.test(t)&&(this.mono?this.add(t):this.spacing=!0,!0)}setTag(t){this.emitBlock(),this[t]=!0,this.modStack.unshift(t)}unsetTag(t){this.emitBlock(),this[t]=!1,this.modStack.shift()}parseStartTag(t,e){return!(this.mono||this[t]||!this.match(e))&&(this.setTag(t),!0)}match(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const[i,n]=this.prepareRegExp(t),o=i.test(this.text.substr(this.position,n));return o&&e&&(this.position+=n-1),o}parseEndTag(t,e,i){let n=this.mod()===t;return n="mono"===t?n&&this.mono:n&&!this.mono,!(!n||!this.match(e))&&(void 0!==i?(this.position===this.text.length-1||this.match(i,!1))&&this.unsetTag(t):this.unsetTag(t),!0)}replace(t,e){return!!this.match(t)&&(this.add(e),this.position+=length-1,!0)}prepareRegExp(t){let e,i;if(t instanceof RegExp)i=t,e=1;else{const n=pH[t];i=void 0!==n?n:new RegExp(t),e=t.length}return[i,e]}}class vH{constructor(t,e,i,n){this.ctx=t,this.parent=e,this.selected=i,this.hover=n;this.lines=new fH((e,o)=>{if(void 0===e)return 0;const r=this.parent.getFormattingValues(t,i,n,o);let s=0;if(""!==e){s=this.ctx.measureText(e).width}return{width:s,values:r}})}process(t){if(!aH(t))return this.lines.finalize();const e=this.parent.fontOptions;t=(t=t.replace(/\r\n/g,"\n")).replace(/\r/g,"\n");const i=String(t).split("\n"),n=i.length;if(e.multi)for(let t=0;t<n;t++){const n=this.splitBlocks(i[t],e.multi);if(void 0!==n)if(0!==n.length){if(e.maxWdt>0)for(let t=0;t<n.length;t++){const e=n[t].mod,i=n[t].text;this.splitStringIntoLines(i,e,!0)}else for(let t=0;t<n.length;t++){const e=n[t].mod,i=n[t].text;this.lines.append(i,e)}this.lines.newLine()}else this.lines.newLine("")}else if(e.maxWdt>0)for(let t=0;t<n;t++)this.splitStringIntoLines(i[t]);else for(let t=0;t<n;t++)this.lines.newLine(i[t]);return this.lines.finalize()}decodeMarkupSystem(t){let e="none";return"markdown"===t||"md"===t?e="markdown":!0!==t&&"html"!==t||(e="html"),e}splitHtmlBlocks(t){const e=new gH(t),i=t=>{if(/&/.test(t)){return e.replace(e.text,"&lt;","<")||e.replace(e.text,"&amp;","&")||e.add("&"),!0}return!1};for(;e.position<e.text.length;){const t=e.text.charAt(e.position);e.parseWS(t)||/</.test(t)&&(e.parseStartTag("bold","<b>")||e.parseStartTag("ital","<i>")||e.parseStartTag("mono","<code>")||e.parseEndTag("bold","</b>")||e.parseEndTag("ital","</i>")||e.parseEndTag("mono","</code>"))||i(t)||e.add(t),e.position++}return e.emitBlock(),e.blocks}splitMarkdownBlocks(t){const e=new gH(t);let i=!0;const n=t=>!!/\\/.test(t)&&(e.position<this.text.length+1&&(e.position++,t=this.text.charAt(e.position),/ \t/.test(t)?e.spacing=!0:(e.add(t),i=!1)),!0);for(;e.position<e.text.length;){const t=e.text.charAt(e.position);e.parseWS(t)||n(t)||(i||e.spacing)&&(e.parseStartTag("bold","*")||e.parseStartTag("ital","_")||e.parseStartTag("mono","`"))||e.parseEndTag("bold","*","afterBold")||e.parseEndTag("ital","_","afterItal")||e.parseEndTag("mono","`","afterMono")||(e.add(t),i=!1),e.position++}return e.emitBlock(),e.blocks}splitBlocks(t,e){const i=this.decodeMarkupSystem(e);return"none"===i?[{text:t,mod:"normal"}]:"markdown"===i?this.splitMarkdownBlocks(t):"html"===i?this.splitHtmlBlocks(t):void 0}overMaxWidth(t){const e=this.ctx.measureText(t).width;return this.lines.curWidth()+e>this.parent.fontOptions.maxWdt}getLongestFit(t){let e="",i=0;for(;i<t.length;){const n=e+(""===e?"":" ")+t[i];if(this.overMaxWidth(n))break;e=n,i++}return i}getLongestFitWord(t){let e=0;for(;e<t.length&&!this.overMaxWidth(BT(t).call(t,0,e));)e++;return e}splitStringIntoLines(t){let e=arguments.length>1&&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);let n=(t=(t=t.replace(/^( +)/g,"$1\r")).replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r")).split("\r");for(;n.length>0;){let t=this.getLongestFit(n);if(0===t){const t=n[0],i=this.getLongestFitWord(t);this.lines.newLine(BT(t).call(t,0,i),e),n[0]=BT(t).call(t,i)}else{let o=t;" "===n[t-1]?t--:" "===n[o]&&o++;const r=BT(n).call(n,0,t).join("");t==n.length&&i?this.lines.append(r,e):this.lines.newLine(r,e),n=BT(n).call(n,o)}}}}const mH=["bold","ital","boldital","mono"];class yH{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.body=t,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(e),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=i}setOptions(t){if(this.elementOptions=t,this.initFontOptions(t.font),aH(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"==typeof t.font){const e=t.font.size;void 0!==e&&(this.baseSize=e)}}initFontOptions(t){$F(mH,t=>{this.fontOptions[t]={}}),yH.parseFontString(this.fontOptions,t)?this.fontOptions.vadjust=0:$F(t,(t,e)=>{null!=t&&"object"!=typeof t&&(this.fontOptions[e]=t)})}static parseFontString(t,e){if(!e||"string"!=typeof e)return!1;const i=e.split(" ");return t.size=+i[0].replace("px",""),t.face=i[1],t.color=i[2],!0}constrain(t){const e={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=uz(t,"widthConstraint");if("number"==typeof i)e.maxWdt=Number(i),e.minWdt=Number(i);else if("object"==typeof i){const i=uz(t,["widthConstraint","maximum"]);"number"==typeof i&&(e.maxWdt=Number(i));const n=uz(t,["widthConstraint","minimum"]);"number"==typeof n&&(e.minWdt=Number(n))}const n=uz(t,"heightConstraint");if("number"==typeof n)e.minHgt=Number(n);else if("object"==typeof n){const i=uz(t,["heightConstraint","minimum"]);"number"==typeof i&&(e.minHgt=Number(i));const n=uz(t,["heightConstraint","valign"]);"string"==typeof n&&("top"!==n&&"bottom"!==n||(e.valign=n))}return e}update(t,e){this.setOptions(t,!0),this.propagateFonts(e),KF(this.fontOptions,this.constrain(e)),this.fontOptions.chooser=rH("label",e)}adjustSizes(t){const e=t?t.right+t.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=e,this.fontOptions.minWdt-=e);const i=t?t.top+t.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}addFontOptionsToPile(t,e){for(let i=0;i<e.length;++i)this.addFontToPile(t,e[i])}addFontToPile(t,e){if(void 0===e)return;if(void 0===e.font||null===e.font)return;const i=e.font;t.push(i)}getBasicOptions(t){const e={};for(let i=0;i<t.length;++i){let n=t[i];const o={};yH.parseFontString(o,n)&&(n=o),$F(n,(t,i)=>{void 0!==t&&(Object.prototype.hasOwnProperty.call(e,i)||(-1!==WP(mH).call(mH,i)?e[i]={}:e[i]=t))})}return e}getFontOption(t,e,i){let n;for(let o=0;o<t.length;++o){const r=t[o];if(Object.prototype.hasOwnProperty.call(r,e)){if(n=r[e],null==n)continue;const t={};if(yH.parseFontString(t,n)&&(n=t),Object.prototype.hasOwnProperty.call(n,i))return n[i]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,i))return this.fontOptions[i];throw new Error("Did not find value for multi-font for property: '"+i+"'")}getFontOptions(t,e){const i={},n=["color","size","face","mod","vadjust"];for(let o=0;o<n.length;++o){const r=n[o];i[r]=this.getFontOption(t,e,r)}return i}propagateFonts(t){const e=[];this.addFontOptionsToPile(e,t),this.fontOptions=this.getBasicOptions(e);for(let t=0;t<mH.length;++t){const i=mH[t],n=this.fontOptions[i];$F(this.getFontOptions(e,i),(t,e)=>{n[e]=t}),n.size=Number(n.size),n.vadjust=Number(n.vadjust)}}draw(t,e,i,n,o){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";if(void 0===this.elementOptions.label)return;let s=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&s<this.elementOptions.scaling.label.drawThreshold-1||(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))}_drawBackground(t){if(void 0!==this.fontOptions.background&&"none"!==this.fontOptions.background){t.fillStyle=this.fontOptions.background;const e=this.getSize();t.fillRect(e.left,e.top,e.width,e.height)}}_drawText(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"middle",o=arguments.length>4?arguments[4]:void 0;[e,i]=this._setAlignment(t,e,i,n),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(let n=0;n<this.lineCount;n++){const r=this.lines[n];if(r&&r.blocks){let n=0;this.isEdgeLabel||"center"===this.fontOptions.align?n+=(this.size.width-r.width)/2:"right"===this.fontOptions.align&&(n+=this.size.width-r.width);for(let s=0;s<r.blocks.length;s++){const a=r.blocks[s];t.font=a.font;const[h,d]=this._getColor(a.color,o,a.strokeColor);a.strokeWidth>0&&(t.lineWidth=a.strokeWidth,t.strokeStyle=d,t.lineJoin="round"),t.fillStyle=h,a.strokeWidth>0&&t.strokeText(a.text,e+n,i+a.vadjust),t.fillText(a.text,e+n,i+a.vadjust),n+=a.width}i+=r.height}}}_setAlignment(t,e,i,n){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&!1===this.pointToSelf){e=0,i=0;const n=2;"top"===this.fontOptions.align?(t.textBaseline="alphabetic",i-=2*n):"bottom"===this.fontOptions.align?(t.textBaseline="hanging",i+=2*n):t.textBaseline="middle"}else t.textBaseline=n;return[e,i]}_getColor(t,e,i){let n=t||"#000000",o=i||"#ffffff";if(e<=this.elementOptions.scaling.label.drawThreshold){const t=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-e)));n=ez(n,t),o=ez(o,t)}return[n,o]}getTextSize(t){let 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}}getSize(){let t=this.size.left,e=this.size.top-1;if(this.isEdgeLabel){const 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}}calculateLabelSize(t,e,i){let 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)}getFormattingValues(t,e,i,n){const 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));let 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}differentState(t,e){return t!==this.selectedState||e!==this.hoverState}_processLabelText(t,e,i,n){return new vH(t,this,e,i).process(n)}_processLabel(t,e,i){if(!1===this.labelDirty&&!this.differentState(e,i))return;const n=this._processLabelText(t,e,i,this.elementOptions.label);this.fontOptions.minWdt>0&&n.width<this.fontOptions.minWdt&&(n.width=this.fontOptions.minWdt),this.size.labelHeight=n.height,this.fontOptions.minHgt>0&&n.height<this.fontOptions.minHgt&&(n.height=this.fontOptions.minHgt),this.lines=n.lines,this.lineCount=n.lines.length,this.size.width=n.width,this.size.height=n.height,this.selectedState=e,this.hoverState=i,this.labelDirty=!1}visible(){if(0===this.size.width||0===this.size.height||void 0===this.elementOptions.label)return!1;return!(this.fontOptions.size*this.body.view.scale<this.elementOptions.scaling.label.drawThreshold-1)}}class bH{constructor(t,e,i){this.body=e,this.labelModule=i,this.setOptions(t),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.margin=void 0,this.refreshNeeded=!0,this.boundingBox={top:0,left:0,right:0,bottom:0}}setOptions(t){this.options=t}_setMargins(t){this.margin={},this.options.margin&&("object"==typeof this.options.margin?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),t.adjustSizes(this.margin)}_distanceToBorder(t,e){const i=this.options.borderWidth;return t&&this.resize(t),Math.min(Math.abs(this.width/2/Math.cos(e)),Math.abs(this.height/2/Math.sin(e)))+i}enableShadow(t,e){e.shadow&&(t.shadowColor=e.shadowColor,t.shadowBlur=e.shadowSize,t.shadowOffsetX=e.shadowX,t.shadowOffsetY=e.shadowY)}disableShadow(t,e){e.shadow&&(t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0)}enableBorderDashes(t,e){if(!1!==e.borderDashes)if(void 0!==t.setLineDash){let i=e.borderDashes;!0===i&&(i=[5,15]),t.setLineDash(i)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,e.borderDashes=!1}disableBorderDashes(t,e){!1!==e.borderDashes&&(void 0!==t.setLineDash?t.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,e.borderDashes=!1))}needsRefresh(t,e){return!0===this.refreshNeeded?(this.refreshNeeded=!1,!0):void 0===this.width||this.labelModule.differentState(t,e)}initContextForDraw(t,e){const i=e.borderWidth/this.body.view.scale;t.lineWidth=Math.min(this.width,i),t.strokeStyle=e.borderColor,t.fillStyle=e.color}performStroke(t,e){const i=e.borderWidth/this.body.view.scale;t.save(),i>0&&(this.enableBorderDashes(t,e),t.stroke(),this.disableBorderDashes(t,e)),t.restore()}performFill(t,e){t.save(),t.fillStyle=e.color,this.enableShadow(t,e),QM(t).call(t),this.disableShadow(t,e),t.restore(),this.performStroke(t,e)}_addBoundingBoxMargin(t){this.boundingBox.left-=t,this.boundingBox.top-=t,this.boundingBox.bottom+=t,this.boundingBox.right+=t}_updateBoundingBox(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}updateBoundingBox(t,e,i,n,o){this._updateBoundingBox(t,e,i,n,o)}getDimensionsFromLabel(t,e,i){this.textSize=this.labelModule.getTextSize(t,e,i);let n=this.textSize.width,o=this.textSize.height;return 0===n&&(n=14,o=14),{width:n,height:o}}}let wH=class extends bH{constructor(t,e,i){super(t,e,i),this._setMargins(i)}resize(t){let 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)){const 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}}draw(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),WE(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)}updateBoundingBox(t,e,i,n,o){this._updateBoundingBox(t,e,i,n,o);const r=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(r)}distanceToBorder(t,e){t&&this.resize(t);const i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(e)),Math.abs(this.height/2/Math.sin(e)))+i}};class _H extends bH{constructor(t,e,i){super(t,e,i),this.labelOffset=0,this.selected=!1}setOptions(t,e,i){this.options=t,void 0===e&&void 0===i||this.setImages(e,i)}setImages(t,e){e&&this.selected?(this.imageObj=e,this.imageObjAlt=t):(this.imageObj=t,this.imageObjAlt=e)}switchImages(t){const e=t&&!this.selected||!t&&this.selected;if(this.selected=t,void 0!==this.imageObjAlt&&e){const t=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=t}}_getImagePadding(){const t={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){const e=this.options.imagePadding;"object"==typeof 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}_resizeImage(){let t,e;if(!1===this.options.shapeProperties.useImageSize){let 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{const i=this._getImagePadding();t=this.imageObj.width+i.left+i.right,e=this.imageObj.height+i.top+i.bottom}this.width=t,this.height=e,this.radius=.5*this.width}_drawRawCircle(t,e,i,n){this.initContextForDraw(t,n),HE(t,e,i,n.size),this.performFill(t,n)}_drawImageAtPosition(t,e){if(0!=this.imageObj.width){t.globalAlpha=void 0!==e.opacity?e.opacity:1,this.enableShadow(t,e);let i=1;!0===this.options.shapeProperties.interpolation&&(i=this.imageObj.width/this.width/this.body.view.scale);const 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)}}_drawImageLabel(t,e,i,n,o){let r=0;if(void 0!==this.height){r=.5*this.height;const e=this.labelModule.getTextSize(t,n,o);e.lineCount>=1&&(r+=e.height/2)}const s=i+r;this.options.label&&(this.labelOffset=r),this.labelModule.draw(t,e,s,n,o,"hanging")}}let xH=class extends _H{constructor(t,e,i){super(t,e,i),this._setMargins(i)}resize(t){let 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)){const 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}}draw(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)}updateBoundingBox(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}distanceToBorder(t){return t&&this.resize(t),.5*this.width}};class EH extends _H{constructor(t,e,i,n,o){super(t,e,i),this.setImages(n,o)}resize(t){let 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){const t=2*this.options.size;return this.width=t,this.height=t,void(this.radius=.5*this.width)}this.needsRefresh(e,i)&&this._resizeImage()}draw(t,e,i,n,o,r){this.switchImages(n),this.resize();let 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)}updateBoundingBox(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)}distanceToBorder(t){return t&&this.resize(t),.5*this.width}}class OH extends bH{resize(t){let 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);const 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}}_drawShape(t,e,i,n,o,r,s,a){var h;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(YE,h)?YE[h]:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];CanvasRenderingContext2D.prototype[h].call(t,i)})(t,n,o,a.size),this.performFill(t,a),void 0!==this.options.icon&&void 0!==this.options.icon.code&&(t.font=(r?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),t.fillStyle=this.options.icon.color||"black",t.textAlign="center",t.textBaseline="middle",t.fillText(this.options.icon.code,n,o)),{drawExternalLabel:()=>{if(void 0!==this.options.label){this.labelModule.calculateLabelSize(t,r,s,n,o,"hanging");const e=o+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(t,n,e,r,s,"hanging")}this.updateBoundingBox(n,o)}}}updateBoundingBox(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,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}function SH(t,e){var i=Ck(t);if(bL){var n=bL(t);e&&(n=ZI(n).call(n,function(e){return PL(t,e).enumerable})),i.push.apply(i,n)}return i}function CH(t){for(var e=1;e<arguments.length;e++){var i,n,o=null!=arguments[e]?arguments[e]:{};e%2?rD(i=SH(Object(o),!0)).call(i,function(e){MR(t,e,o[e])}):HL?KL(t,HL(o)):rD(n=SH(Object(o))).call(n,function(e){oH(t,e,PL(o,e))})}return t}class TH extends OH{constructor(t,e,i,n){super(t,e,i,n),this.ctxRenderer=n}draw(t,e,i,n,o,r){this.resize(t,n,o,r),this.left=e-this.width/2,this.top=i-this.height/2,t.save();const s=this.ctxRenderer({ctx:t,id:this.options.id,x:e,y:i,state:{selected:n,hover:o},style:CH({},r),label:this.options.label});if(null!=s.drawNode&&s.drawNode(),t.restore(),s.drawExternalLabel){const e=s.drawExternalLabel;s.drawExternalLabel=()=>{t.save(),e(),t.restore()}}return s.nodeDimensions&&(this.customSizeWidth=s.nodeDimensions.width,this.customSizeHeight=s.nodeDimensions.height),s}distanceToBorder(t,e){return this._distanceToBorder(t,e)}}class kH extends bH{constructor(t,e,i){super(t,e,i),this._setMargins(i)}resize(t,e,i){if(this.needsRefresh(e,i)){const n=this.getDimensionsFromLabel(t,e,i).width+this.margin.right+this.margin.left;this.width=n,this.height=n,this.radius=this.width/2}}draw(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),VE(t,e-this.width/2,i-this.height/2,this.width,this.height),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)}distanceToBorder(t,e){return this._distanceToBorder(t,e)}}let DH=class extends OH{draw(t,e,i,n,o,r){return this._drawShape(t,"diamond",4,e,i,n,o,r)}distanceToBorder(t,e){return this._distanceToBorder(t,e)}};class IH extends OH{draw(t,e,i,n,o,r){return this._drawShape(t,"circle",2,e,i,n,o,r)}distanceToBorder(t){return t&&this.resize(t),this.options.size}}class PH extends bH{resize(t){let 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)){const n=this.getDimensionsFromLabel(t,e,i);this.height=2*n.height,this.width=n.width+n.height,this.radius=.5*this.width}}draw(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),qE(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)}distanceToBorder(t,e){t&&this.resize(t);const 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)}}class MH extends bH{constructor(t,e,i){super(t,e,i),this._setMargins(i)}resize(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)}draw(t,e,i,n,o,r){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:()=>{if(void 0!==this.options.label){const e=5;this.labelModule.draw(t,this.left+this.iconSize.width/2+this.margin.left,i+this.height/2+e,n)}this.updateBoundingBox(e,i)}}}updateBoundingBox(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){const t=5;this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+t)}}_icon(t,e,i,n,o,r){const 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.")}distanceToBorder(t,e){return this._distanceToBorder(t,e)}}let NH=class extends _H{constructor(t,e,i,n,o){super(t,e,i),this.setImages(n,o)}resize(t){let 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){const t=2*this.options.size;return this.width=t,void(this.height=t)}this.needsRefresh(e,i)&&this._resizeImage()}draw(t,e,i,n,o,r){t.save(),this.switchImages(n),this.resize();let 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){const e=this.options.borderWidth,i=this.options.borderWidthSelected||2*this.options.borderWidth,s=(n?i:e)/this.body.view.scale;t.lineWidth=Math.min(this.width,s),t.beginPath();let a=n?this.options.color.highlight.border:o?this.options.color.hover.border:this.options.color.border,h=n?this.options.color.highlight.background:o?this.options.color.hover.background:this.options.color.background;void 0!==r.opacity&&(a=ez(a,r.opacity),h=ez(h,r.opacity)),t.strokeStyle=a,t.fillStyle=h,t.rect(this.left-.5*t.lineWidth,this.top-.5*t.lineWidth,this.width+t.lineWidth,this.height+t.lineWidth),QM(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()}updateBoundingBox(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))}distanceToBorder(t,e){return this._distanceToBorder(t,e)}};class FH extends OH{draw(t,e,i,n,o,r){return this._drawShape(t,"square",2,e,i,n,o,r)}distanceToBorder(t,e){return this._distanceToBorder(t,e)}}class zH extends OH{draw(t,e,i,n,o,r){return this._drawShape(t,"hexagon",4,e,i,n,o,r)}distanceToBorder(t,e){return this._distanceToBorder(t,e)}}class AH extends OH{draw(t,e,i,n,o,r){return this._drawShape(t,"star",4,e,i,n,o,r)}distanceToBorder(t,e){return this._distanceToBorder(t,e)}}class BH extends bH{constructor(t,e,i){super(t,e,i),this._setMargins(i)}resize(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)}draw(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)}distanceToBorder(t,e){return this._distanceToBorder(t,e)}}let jH=class extends OH{draw(t,e,i,n,o,r){return this._drawShape(t,"triangle",3,e,i,n,o,r)}distanceToBorder(t,e){return this._distanceToBorder(t,e)}};class RH extends OH{draw(t,e,i,n,o,r){return this._drawShape(t,"triangleDown",3,e,i,n,o,r)}distanceToBorder(t,e){return this._distanceToBorder(t,e)}}function LH(t,e){var i=Ck(t);if(bL){var n=bL(t);e&&(n=ZI(n).call(n,function(e){return PL(t,e).enumerable})),i.push.apply(i,n)}return i}function HH(t){for(var e=1;e<arguments.length;e++){var i,n,o=null!=arguments[e]?arguments[e]:{};e%2?rD(i=LH(Object(o),!0)).call(i,function(e){MR(t,e,o[e])}):HL?KL(t,HL(o)):rD(n=LH(Object(o))).call(n,function(e){oH(t,e,PL(o,e))})}return t}class WH{constructor(t,e,i,n,o,r){this.options=dz(o),this.globalOptions=o,this.defaultOptions=r,this.body=e,this.edges=[],this.id=void 0,this.imagelist=i,this.grouplist=n,this.x=void 0,this.y=void 0,this.baseSize=this.options.size,this.baseFontSize=this.options.font.size,this.predefinedPosition=!1,this.selected=!1,this.hover=!1,this.labelModule=new yH(this.body,this.options,!1),this.setOptions(t)}attachEdge(t){var e;-1===WP(e=this.edges).call(e,t)&&this.edges.push(t)}detachEdge(t){var e;const i=WP(e=this.edges).call(e,t);var n;-1!=i&&ND(n=this.edges).call(n,i,1)}setOptions(t){const e=this.options.shape;if(!t)return;if(void 0!==t.color&&(this._localColor=t.color),void 0!==t.id&&(this.id=t.id),void 0===this.id)throw new Error("Node must have an id");WH.checkMass(t,this.id),void 0!==t.x&&(null===t.x?(this.x=void 0,this.predefinedPosition=!1):(this.x=IP(t.x),this.predefinedPosition=!0)),void 0!==t.y&&(null===t.y?(this.y=void 0,this.predefinedPosition=!1):(this.y=IP(t.y),this.predefinedPosition=!0)),void 0!==t.size&&(this.baseSize=t.size),void 0!==t.value&&(t.value=$R(t.value)),WH.parseOptions(this.options,t,!0,this.globalOptions,this.grouplist);const i=[t,this.options,this.defaultOptions];return this.chooser=rH("node",i),this._load_images(),this.updateLabelModule(t),void 0!==t.opacity&&WH.checkOpacity(t.opacity)&&(this.options.opacity=t.opacity),this.updateShape(e),void 0!==t.hidden||void 0!==t.physics}_load_images(){if(("circularImage"===this.options.shape||"image"===this.options.shape)&&void 0===this.options.image)throw new Error("Option image must be defined for node type '"+this.options.shape+"'");if(void 0!==this.options.image){if(void 0===this.imagelist)throw new Error("Internal Error: No images provided");if("string"==typeof this.options.image)this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id);else{if(void 0===this.options.image.unselected)throw new Error("No unselected image provided");this.imageObj=this.imagelist.load(this.options.image.unselected,this.options.brokenImage,this.id),void 0!==this.options.image.selected?this.imageObjAlt=this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id):this.imageObjAlt=void 0}}}static checkOpacity(t){return 0<=t&&t<=1}static checkCoordinateOrigin(t){return void 0===t||"center"===t||"top-left"===t}static updateGroupOptions(t,e,i){var n;if(void 0===i)return;const o=t.group;if(void 0!==e&&void 0!==e.group&&o!==e.group)throw new Error("updateGroupOptions: group values in options don't match.");if(!("number"==typeof o||"string"==typeof o&&""!=o))return;const r=i.get(o);void 0!==r.opacity&&void 0===e.opacity&&(WH.checkOpacity(r.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+r.opacity),r.opacity=void 0));const s=ZI(n=cL(e)).call(n,t=>null!=e[t]);s.push("font"),GF(s,t,r),t.color=nz(t.color)}static parseOptions(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0;if(GF(["color","fixed","shadow"],t,e,i),WH.checkMass(e),void 0!==t.opacity&&(WH.checkOpacity(t.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+t.opacity),t.opacity=void 0)),void 0!==e.opacity&&(WH.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),e.shapeProperties&&!WH.checkCoordinateOrigin(e.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+e.shapeProperties.coordinateOrigin),cz(t,e,"shadow",n),void 0!==e.color&&null!==e.color){const i=nz(e.color);YF(t.color,i)}else!0===i&&null===e.color&&(t.color=dz(n.color));void 0!==e.fixed&&null!==e.fixed&&("boolean"==typeof e.fixed?(t.fixed.x=e.fixed,t.fixed.y=e.fixed):(void 0!==e.fixed.x&&"boolean"==typeof e.fixed.x&&(t.fixed.x=e.fixed.x),void 0!==e.fixed.y&&"boolean"==typeof e.fixed.y&&(t.fixed.y=e.fixed.y))),!0===i&&null===e.font&&(t.font=dz(n.font)),WH.updateGroupOptions(t,e,o),void 0!==e.scaling&&cz(t.scaling,e.scaling,"label",n.scaling)}getFormattingValues(){const t={color:this.options.color.background,opacity:this.options.opacity,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};if(this.selected||this.hover?!0===this.chooser?this.selected?(null!=this.options.borderWidthSelected?t.borderWidth=this.options.borderWidthSelected:t.borderWidth*=2,t.color=this.options.color.highlight.background,t.borderColor=this.options.color.highlight.border,t.shadow=this.options.shadow.enabled):this.hover&&(t.color=this.options.color.hover.background,t.borderColor=this.options.color.hover.border,t.shadow=this.options.shadow.enabled):"function"==typeof this.chooser&&(this.chooser(t,this.options.id,this.selected,this.hover),!1===t.shadow&&(t.shadowColor===this.options.shadow.color&&t.shadowSize===this.options.shadow.size&&t.shadowX===this.options.shadow.x&&t.shadowY===this.options.shadow.y||(t.shadow=!0))):t.shadow=this.options.shadow.enabled,void 0!==this.options.opacity){const e=this.options.opacity;t.borderColor=ez(t.borderColor,e),t.color=ez(t.color,e),t.shadowColor=ez(t.shadowColor,e)}return t}updateLabelModule(t){void 0!==this.options.label&&null!==this.options.label||(this.options.label=""),WH.updateGroupOptions(this.options,HH(HH({},t),{},{color:t&&t.color||this._localColor||void 0}),this.grouplist);const e=this.grouplist.get(this.options.group,!1),i=[t,this.options,e,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,i),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(t){if(t===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new wH(this.options,this.body,this.labelModule);break;case"circle":this.shape=new xH(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new EH(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new TH(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new kH(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new DH(this.options,this.body,this.labelModule);break;case"dot":this.shape=new IH(this.options,this.body,this.labelModule);break;case"ellipse":default:this.shape=new PH(this.options,this.body,this.labelModule);break;case"icon":this.shape=new MH(this.options,this.body,this.labelModule);break;case"image":this.shape=new NH(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new FH(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new zH(this.options,this.body,this.labelModule);break;case"star":this.shape=new AH(this.options,this.body,this.labelModule);break;case"text":this.shape=new BH(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new jH(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new RH(this.options,this.body,this.labelModule)}this.needsRefresh()}select(){this.selected=!0,this.needsRefresh()}unselect(){this.selected=!1,this.needsRefresh()}needsRefresh(){this.shape.refreshNeeded=!0}getTitle(){return this.options.title}distanceToBorder(t,e){return this.shape.distanceToBorder(t,e)}isFixed(){return this.options.fixed.x&&this.options.fixed.y}isSelected(){return this.selected}getValue(){return this.options.value}getLabelSize(){return this.labelModule.size()}setValueRange(t,e,i){if(void 0!==this.options.value){const 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){const t=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*t}this.options.size=this.options.scaling.min+n*o}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(t){const e=this.getFormattingValues();return this.shape.draw(t,this.x,this.y,this.selected,this.hover,e)||{}}updateBoundingBox(t){this.shape.updateBoundingBox(this.x,this.y,t)}resize(t){const e=this.getFormattingValues();this.shape.resize(t,this.selected,this.hover,e)}getItemsOnPoint(t){const e=[];return this.labelModule.visible()&&sH(this.labelModule.getSize(),t)&&e.push({nodeId:this.id,labelId:0}),sH(this.shape.boundingBox,t)&&e.push({nodeId:this.id}),e}isOverlappingWith(t){return this.shape.left<t.right&&this.shape.left+this.shape.width>t.left&&this.shape.top<t.bottom&&this.shape.top+this.shape.height>t.top}isBoundingBoxOverlappingWith(t){return this.shape.boundingBox.left<t.right&&this.shape.boundingBox.right>t.left&&this.shape.boundingBox.top<t.bottom&&this.shape.boundingBox.bottom>t.top}static checkMass(t,e){if(void 0!==t.mass&&t.mass<=0){let i="";void 0!==e&&(i=" in node id: "+e),console.error("%cNegative or zero mass disallowed"+i+", setting mass to 1.",Ez),t.mass=1}}}class qH{constructor(t,e,i,n){var o;if(this.body=t,this.images=e,this.groups=i,this.layoutEngine=n,this.body.functions.createNode=LE(o=this.create).call(o,this),this.nodesListeners={add:(t,e)=>{this.add(e.items)},update:(t,e)=>{this.update(e.items,e.data,e.oldData)},remove:(t,e)=>{this.remove(e.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(t,e,i,n){if(e===t)return.5;{const i=1/(e-t);return Math.max(0,(n-t)*i)}}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1,coordinateOrigin:"center"},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=dz(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var t,e;this.body.emitter.on("refreshNodes",LE(t=this.refresh).call(t,this)),this.body.emitter.on("refresh",LE(e=this.refresh).call(e,this)),this.body.emitter.on("destroy",()=>{$F(this.nodesListeners,(t,e)=>{this.body.data.nodes&&this.body.data.nodes.off(e,t)}),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners})}setOptions(t){if(void 0!==t){if(WH.parseOptions(this.options,t),void 0!==t.opacity&&(BB(t.opacity)||!ZB(t.opacity)||t.opacity<0||t.opacity>1?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(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(void 0!==t.font||void 0!==t.widthConstraint||void 0!==t.heightConstraint)for(const t of Ck(this.body.nodes))this.body.nodes[t].updateLabelModule(),this.body.nodes[t].needsRefresh();if(void 0!==t.size)for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].needsRefresh();void 0===t.hidden&&void 0===t.physics||this.body.emitter.emit("_dataChanged")}}setData(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=this.body.data.nodes;if(Bb("id",t))this.body.data.nodes=t;else if(nk(t))this.body.data.nodes=new Ab,this.body.data.nodes.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new Ab}if(i&&$F(this.nodesListeners,function(t,e){i.off(e,t)}),this.body.nodes={},this.body.data.nodes){const t=this;$F(this.nodesListeners,function(e,i){t.body.data.nodes.on(i,e)});const e=this.body.data.nodes.getIds();this.add(e,!0)}!1===e&&this.body.emitter.emit("_dataChanged")}add(t){let e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=[];for(let i=0;i<t.length;i++){e=t[i];const o=this.body.data.nodes.get(e),r=this.create(o);n.push(r),this.body.nodes[e]=r}this.layoutEngine.positionInitially(n),!1===i&&this.body.emitter.emit("_dataChanged")}update(t,e,i){const n=this.body.nodes;let o=!1;for(let i=0;i<t.length;i++){const r=t[i];let s=n[r];const a=e[i];void 0!==s?s.setOptions(a)&&(o=!0):(o=!0,s=this.create(a),n[r]=s)}o||void 0===i||(o=lj(e).call(e,function(t,e){const n=i[e];return n&&n.level!==t.level})),!0===o?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}remove(t){const e=this.body.nodes;for(let i=0;i<t.length;i++){delete e[t[i]]}this.body.emitter.emit("_dataChanged")}create(t){return new(arguments.length>1&&void 0!==arguments[1]?arguments[1]:WH)(t,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];$F(this.body.nodes,(e,i)=>{const n=this.body.data.nodes.get(i);void 0!==n&&(!0===t&&e.setOptions({x:null,y:null}),e.setOptions({fixed:!1}),e.setOptions(n))})}getPositions(t){const e={};if(void 0!==t){if(!0===nk(t)){for(let i=0;i<t.length;i++)if(void 0!==this.body.nodes[t[i]]){const n=this.body.nodes[t[i]];e[t[i]]={x:Math.round(n.x),y:Math.round(n.y)}}}else if(void 0!==this.body.nodes[t]){const i=this.body.nodes[t];e[t]={x:Math.round(i.x),y:Math.round(i.y)}}}else for(let t=0;t<this.body.nodeIndices.length;t++){const i=this.body.nodes[this.body.nodeIndices[t]];e[this.body.nodeIndices[t]]={x:Math.round(i.x),y:Math.round(i.y)}}return e}getPosition(t){if(null==t)throw new TypeError("No id was specified for getPosition method.");if(null==this.body.nodes[t])throw new ReferenceError("NodeId provided for getPosition does not exist. Provided: ".concat(t));return{x:Math.round(this.body.nodes[t].x),y:Math.round(this.body.nodes[t].y)}}storePositions(){const t=[],e=this.body.data.nodes.getDataSet();for(const i of e.get()){const e=i.id,n=this.body.nodes[e],o=Math.round(n.x),r=Math.round(n.y);i.x===o&&i.y===r||t.push({id:e,x:o,y:r})}e.update(t)}getBoundingBox(t){if(void 0!==this.body.nodes[t])return this.body.nodes[t].shape.boundingBox}getConnectedNodes(t,e){const i=[];if(void 0!==this.body.nodes[t]){const n=this.body.nodes[t],o={};for(let t=0;t<n.edges.length;t++){const r=n.edges[t];"to"!==e&&r.toId==n.id?void 0===o[r.fromId]&&(i.push(r.fromId),o[r.fromId]=!0):"from"!==e&&r.fromId==n.id&&void 0===o[r.toId]&&(i.push(r.toId),o[r.toId]=!0)}}return i}getConnectedEdges(t){const e=[];if(void 0!==this.body.nodes[t]){const i=this.body.nodes[t];for(let t=0;t<i.edges.length;t++)e.push(i.edges[t].id)}else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ",t);return e}moveNode(t,e,i){void 0!==this.body.nodes[t]?(this.body.nodes[t].x=Number(e),this.body.nodes[t].y=Number(i),VM(()=>{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",t)}}var VH,UH,YH,XH,GH,KH,ZH,QH={};function JH(){return YH?UH:(YH=1,function(){if(VH)return QH;VH=1;var t=Ux(),e=Math.hypot,i=Math.abs,n=Math.sqrt;t({target:"Math",stat:!0,arity:2,forced:!!e&&e(1/0,NaN)!==1/0},{hypot:function(t,e){for(var o,r,s=0,a=0,h=arguments.length,d=0;a<h;)d<(o=i(arguments[a++]))?(s=s*(r=d/o)*r+1,d=o):s+=o>0?(r=o/d)*r:o;return d===1/0?1/0:d*n(s)}})}(),UH=d_().Math.hypot)}function $H(){return GH?XH:(GH=1,XH=JH())}var tW=Rb(ZH?KH:(ZH=1,KH=$H()));class eW{static transform(t,e){nk(t)||(t=[t]);const i=e.point.x,n=e.point.y,o=e.angle,r=e.length;for(let e=0;e<t.length;++e){const s=t[e],a=s.x*Math.cos(o)-s.y*Math.sin(o),h=s.x*Math.sin(o)+s.y*Math.cos(o);s.x=i+r*a,s.y=n+r*h}}static drawPath(t,e){t.beginPath(),t.moveTo(e[0].x,e[0].y);for(let i=1;i<e.length;++i)t.lineTo(e[i].x,e[i].y);t.closePath()}}let iW=class extends eW{static draw(t,e){if(e.image){t.save(),t.translate(e.point.x,e.point.y),t.rotate(Math.PI/2+e.angle);const i=null!=e.imageWidth?e.imageWidth:e.image.width,n=null!=e.imageHeight?e.imageHeight:e.image.height;e.image.drawImageAtPosition(t,1,-i/2,0,i,n),t.restore()}return!1}};class nW extends eW{static draw(t,e){const i=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return eW.transform(i,e),eW.drawPath(t,i),!0}}class oW{static draw(t,e){const i=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return eW.transform(i,e),eW.drawPath(t,i),!0}}class rW{static draw(t,e){const i={x:-.4,y:0};eW.transform(i,e),t.strokeStyle=t.fillStyle,t.fillStyle="rgba(0, 0, 0, 0)";const n=Math.PI,o=e.angle-n/2,r=e.angle+n/2;return t.beginPath(),t.arc(i.x,i.y,.4*e.length,o,r,!1),t.stroke(),!0}}class sW{static draw(t,e){const i={x:-.3,y:0};eW.transform(i,e),t.strokeStyle=t.fillStyle,t.fillStyle="rgba(0, 0, 0, 0)";const n=Math.PI,o=e.angle+n/2,r=e.angle+3*n/2;return t.beginPath(),t.arc(i.x,i.y,.4*e.length,o,r,!1),t.stroke(),!0}}class aW{static draw(t,e){const i=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return eW.transform(i,e),eW.drawPath(t,i),!0}}class hW{static draw(t,e){const i=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return eW.transform(i,e),eW.drawPath(t,i),!0}}class dW{static draw(t,e){const i={x:-.4,y:0};return eW.transform(i,e),HE(t,i.x,i.y,.4*e.length),!0}}class cW{static draw(t,e){const i=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return eW.transform(i,e),eW.drawPath(t,i),!0}}class lW{static draw(t,e){const i=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return eW.transform(i,e),eW.drawPath(t,i),!0}}class uW{static draw(t,e){const i=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return eW.transform(i,e),eW.drawPath(t,i),!0}}class fW{static draw(t,e){const i=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return eW.transform(i,e),eW.drawPath(t,i),!0}}class pW{static draw(t,e){let i;switch(e.type&&(i=e.type.toLowerCase()),i){case"image":return iW.draw(t,e);case"circle":return dW.draw(t,e);case"box":return lW.draw(t,e);case"crow":return oW.draw(t,e);case"curve":return rW.draw(t,e);case"diamond":return uW.draw(t,e);case"inv_curve":return sW.draw(t,e);case"triangle":return aW.draw(t,e);case"inv_triangle":return hW.draw(t,e);case"bar":return cW.draw(t,e);case"vee":return fW.draw(t,e);default:return nW.draw(t,e)}}}function gW(t,e){var i=Ck(t);if(bL){var n=bL(t);e&&(n=ZI(n).call(n,function(e){return PL(t,e).enumerable})),i.push.apply(i,n)}return i}function vW(t){for(var e=1;e<arguments.length;e++){var i,n,o=null!=arguments[e]?arguments[e]:{};e%2?rD(i=gW(Object(o),!0)).call(i,function(e){MR(t,e,o[e])}):HL?KL(t,HL(o)):rD(n=gW(Object(o))).call(n,function(e){oH(t,e,PL(o,e))})}return t}class mW{constructor(t,e,i){MR(this,"color",{}),MR(this,"colorDirty",!0),MR(this,"hoverWidth",1.5),MR(this,"selectionWidth",2),this._body=e,this._labelModule=i,this.setOptions(t),this.fromPoint=this.from,this.toPoint=this.to}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to]}cleanup(){return!1}setOptions(t){this.options=t,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.id=this.options.id}drawLine(t,e,i,n){let o=arguments.length>4&&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)}_drawLine(t,e,i,n,o){if(this.from!=this.to)this._line(t,e,i,n,o);else{const[i,n,o]=this._getCircleData(t);this._circle(t,e,i,n,o)}}_drawDashedLine(t,e,i,n,o){t.lineCap="round";const r=nk(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{const[i,n,o]=this._getCircleData(t);this._circle(t,e,i,n,o)}t.setLineDash([0]),t.lineDashOffset=0,t.restore()}else{if(this.from!=this.to)UE(t,this.from.x,this.from.y,this.to.x,this.to.y,r);else{const[i,n,o]=this._getCircleData(t);this._circle(t,e,i,n,o)}this.enableShadow(t,e),t.stroke(),this.disableShadow(t,e)}}findBorderPosition(t,e,i){return this.from!=this.to?this._findBorderPosition(t,e,i):this._findBorderPositionCircle(t,e,i)}findBorderPositions(t){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,t),to:this._findBorderPosition(this.to,t)};{var e;const[i,n]=BT(e=this._getCircleData(t)).call(e,0,2);return{from:this._findBorderPositionCircle(this.from,t,{x:i,y:n,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,t,{x:i,y:n,low:.6,high:.8,direction:1})}}}_getCircleData(t){const e=this.options.selfReference.size;void 0!==t&&void 0===this.from.shape.width&&this.from.shape.resize(t);const i=hH(t,this.options.selfReference.angle,e,this.from);return[i.x,i.y,e]}_pointOnCircle(t,e,i,n){const o=2*n*Math.PI;return{x:t+i*Math.cos(o),y:e-i*Math.sin(o)}}_findBorderPositionCircle(t,e,i){const n=i.x,o=i.y;let r=i.low,s=i.high;const a=i.direction,h=this.options.selfReference.size;let d,c=.5*(r+s),l=0;!0===this.options.arrowStrikethrough&&(-1===a?l=this.options.endPointOffset.from:1===a&&(l=this.options.endPointOffset.to));let u=0;do{c=.5*(r+s),d=this._pointOnCircle(n,o,h,c);const i=Math.atan2(t.y-d.y,t.x-d.x),f=t.distanceToBorder(e,i)+l-Math.sqrt(Math.pow(d.x-t.x,2)+Math.pow(d.y-t.y,2));if(Math.abs(f)<.05)break;f>0?a>0?r=c:s=c:a>0?s=c:r=c,++u}while(r<=s&&u<10);return vW(vW({},d),{},{t:c})}getLineWidth(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)}getColor(t,e){if(!1!==e.inheritsColor){if("both"===e.inheritsColor&&this.from.id!==this.to.id){const i=t.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y);let n=this.from.options.color.highlight.border,o=this.to.options.color.highlight.border;return!1===this.from.selected&&!1===this.to.selected?(n=ez(this.from.options.color.border,e.opacity),o=ez(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?ez(this.to.options.color.border,e.opacity):ez(this.from.options.color.border,e.opacity)}return ez(e.color,e.opacity)}_circle(t,e,i,n,o){this.enableShadow(t,e);let r=0,s=2*Math.PI;if(!this.options.selfReference.renderBehindTheNode){const e=this.options.selfReference.angle,o=this.options.selfReference.angle+Math.PI,a=this._findBorderPositionCircle(this.from,t,{x:i,y:n,low:e,high:o,direction:-1}),h=this._findBorderPositionCircle(this.from,t,{x:i,y:n,low:e,high:o,direction:1});r=Math.atan2(a.y-n,a.x-i),s=Math.atan2(h.y-n,h.x-i)}t.beginPath(),t.arc(i,n,o,r,s,!1),t.stroke(),this.disableShadow(t,e)}getDistanceToEdge(t,e,i,n,o,r){if(this.from!=this.to)return this._getDistanceToEdge(t,e,i,n,o,r);{const[t,e,i]=this._getCircleData(void 0),n=t-o,s=e-r;return Math.abs(Math.sqrt(n*n+s*s)-i)}}_getDistanceToLine(t,e,i,n,o,r){const s=i-t,a=n-e;let h=((o-t)*s+(r-e)*a)/(s*s+a*a);h>1?h=1:h<0&&(h=0);const d=t+h*s-o,c=e+h*a-r;return Math.sqrt(d*d+c*c)}getArrowData(t,e,i,n,o,r){let s,a,h,d,c,l,u;const f=r.width;"from"===e?(h=this.from,d=this.to,c=r.fromArrowScale<0,l=Math.abs(r.fromArrowScale),u=r.fromArrowType):"to"===e?(h=this.to,d=this.from,c=r.toArrowScale<0,l=Math.abs(r.toArrowScale),u=r.toArrowType):(h=this.to,d=this.from,c=r.middleArrowScale<0,l=Math.abs(r.middleArrowScale),u=r.middleArrowType);const p=15*l+3*f;if(h!=d){const n=p/tW(h.x-d.x,h.y-d.y);if("middle"!==e)if(!0===this.options.smooth.enabled){const o=this._findBorderPosition(h,t,{via:i}),r=this.getPoint(o.t+n*("from"===e?1:-1),i);s=Math.atan2(o.y-r.y,o.x-r.x),a=o}else s=Math.atan2(h.y-d.y,h.x-d.x),a=this._findBorderPosition(h,t);else{const t=(c?-n:n)/2,e=this.getPoint(.5+t,i),o=this.getPoint(.5-t,i);s=Math.atan2(e.y-o.y,e.x-o.x),a=this.getPoint(.5,i)}}else{const[i,n,o]=this._getCircleData(t);if("from"===e){const e=this.options.selfReference.angle,o=this.options.selfReference.angle+Math.PI,r=this._findBorderPositionCircle(this.from,t,{x:i,y:n,low:e,high:o,direction:-1});s=-2*r.t*Math.PI+1.5*Math.PI+.1*Math.PI,a=r}else if("to"===e){const e=this.options.selfReference.angle,o=this.options.selfReference.angle+Math.PI,r=this._findBorderPositionCircle(this.from,t,{x:i,y:n,low:e,high:o,direction:1});s=-2*r.t*Math.PI+1.5*Math.PI-1.1*Math.PI,a=r}else{const t=this.options.selfReference.angle/(2*Math.PI);a=this._pointOnCircle(i,n,o,t),s=-2*t*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}}drawArrowHead(t,e,i,n,o){t.strokeStyle=this.getColor(t,e),t.fillStyle=t.strokeStyle,t.lineWidth=e.width;pW.draw(t,o)&&(this.enableShadow(t,e),QM(t).call(t),this.disableShadow(t,e))}enableShadow(t,e){!0===e.shadow&&(t.shadowColor=e.shadowColor,t.shadowBlur=e.shadowSize,t.shadowOffsetX=e.shadowX,t.shadowOffsetY=e.shadowY)}disableShadow(t,e){!0===e.shadow&&(t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0)}drawBackground(t,e){if(!1!==e.background){const 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)}}setStrokeDashed(t,e){if(!1!==e)if(void 0!==t.setLineDash){const i=nk(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.")}}function yW(t,e){var i=Ck(t);if(bL){var n=bL(t);e&&(n=ZI(n).call(n,function(e){return PL(t,e).enumerable})),i.push.apply(i,n)}return i}function bW(t){for(var e=1;e<arguments.length;e++){var i,n,o=null!=arguments[e]?arguments[e]:{};e%2?rD(i=yW(Object(o),!0)).call(i,function(e){MR(t,e,o[e])}):HL?KL(t,HL(o)):rD(n=yW(Object(o))).call(n,function(e){oH(t,e,PL(o,e))})}return t}class wW extends mW{_findBorderPositionBezier(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._getViaCoordinates();let n,o,r=!1,s=1,a=0,h=this.to,d=this.options.endPointOffset?this.options.endPointOffset.to:0;t.id===this.from.id&&(h=this.from,r=!0,d=this.options.endPointOffset?this.options.endPointOffset.from:0),!1===this.options.arrowStrikethrough&&(d=0);let c=0;do{o=.5*(a+s),n=this.getPoint(o,i);const t=Math.atan2(h.y-n.y,h.x-n.x),l=h.distanceToBorder(e,t)+d-Math.sqrt(Math.pow(n.x-h.x,2)+Math.pow(n.y-h.y,2));if(Math.abs(l)<.2)break;l<0?!1===r?a=o:s=o:!1===r?s=o:a=o,++c}while(a<=s&&c<10);return bW(bW({},n),{},{t:o})}_getDistanceToBezierEdge(t,e,i,n,o,r,s){let a,h,d,c,l,u=1e9,f=t,p=e;for(h=1;h<10;h++)d=.1*h,c=Math.pow(1-d,2)*t+2*d*(1-d)*s.x+Math.pow(d,2)*i,l=Math.pow(1-d,2)*e+2*d*(1-d)*s.y+Math.pow(d,2)*n,h>0&&(a=this._getDistanceToLine(f,p,c,l,o,r),u=a<u?a:u),f=c,p=l;return u}_bezierCurve(t,e,i,n){t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),null!=i&&null!=i.x?null!=n&&null!=n.x?t.bezierCurveTo(i.x,i.y,n.x,n.y,this.toPoint.x,this.toPoint.y):t.quadraticCurveTo(i.x,i.y,this.toPoint.x,this.toPoint.y):t.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(t,e),this.enableShadow(t,e),t.stroke(),this.disableShadow(t,e)}getViaNode(){return this._getViaCoordinates()}}class _W extends wW{constructor(t,e,i){super(t,e,i),MR(this,"via",this.via),this._boundFunction=()=>{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(t){super.setOptions(t);let e=!1;this.options.physics!==t.physics&&(e=!0),this.options=t,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),!0===e&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],void 0===this.from||void 0===this.to||!1===this.options.physics||this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}cleanup(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),void 0!==this.via&&(delete this._body.nodes[this.via.id],this.via=void 0,!0)}setupSupportNode(){if(void 0===this.via){const t="edgeId:"+this.id,e=this._body.functions.createNode({id:t,shape:"circle",physics:!0,hidden:!0});this._body.nodes[t]=e,this.via=e,this.via.parentEdgeId=this.id,this.positionBezierNode()}}positionBezierNode(){void 0!==this.via&&void 0!==this.from&&void 0!==this.to?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):void 0!==this.via&&(this.via.x=0,this.via.y=0)}_line(t,e,i){this._bezierCurve(t,e,i)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.via;if(this.from===this.to){const[e,i,n]=this._getCircleData(),o=2*Math.PI*(1-t);return{x:e+n*Math.sin(o),y:i+n-n*(1-Math.cos(o))}}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}}_findBorderPosition(t,e){return this._findBorderPositionBezier(t,e,this.via)}_getDistanceToEdge(t,e,i,n,o,r){return this._getDistanceToBezierEdge(t,e,i,n,o,r,this.via)}}class xW extends wW{_line(t,e,i){this._bezierCurve(t,e,i)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){const t=this.options.smooth.roundness,e=this.options.smooth.type;let i=Math.abs(this.from.x-this.to.x),n=Math.abs(this.from.y-this.to.y);if("discrete"===e||"diagonalCross"===e){let o,r;o=r=i<=n?t*n:t*i,this.from.x>this.to.x&&(o=-o),this.from.y>=this.to.y&&(r=-r);let s=this.from.x+o,a=this.from.y+r;return"discrete"===e&&(i<=n?s=i<t*n?this.from.x:s:a=n<t*i?this.from.y:a),{x:s,y:a}}if("straightCross"===e){let e=(1-t)*i,o=(1-t)*n;return i<=n?(e=0,this.from.y<this.to.y&&(o=-o)):(this.from.x<this.to.x&&(e=-e),o=0),{x:this.to.x+e,y:this.to.y+o}}if("horizontal"===e){let e=(1-t)*i;return this.from.x<this.to.x&&(e=-e),{x:this.to.x+e,y:this.from.y}}if("vertical"===e){let e=(1-t)*n;return this.from.y<this.to.y&&(e=-e),{x:this.from.x,y:this.to.y+e}}if("curvedCW"===e){i=this.to.x-this.from.x,n=this.from.y-this.to.y;const e=Math.sqrt(i*i+n*n),o=Math.PI,r=(Math.atan2(n,i)+(.5*t+.5)*o)%(2*o);return{x:this.from.x+(.5*t+.5)*e*Math.sin(r),y:this.from.y+(.5*t+.5)*e*Math.cos(r)}}if("curvedCCW"===e){i=this.to.x-this.from.x,n=this.from.y-this.to.y;const e=Math.sqrt(i*i+n*n),o=Math.PI,r=(Math.atan2(n,i)+(.5*-t+.5)*o)%(2*o);return{x:this.from.x+(.5*t+.5)*e*Math.sin(r),y:this.from.y+(.5*t+.5)*e*Math.cos(r)}}{let e,o;e=o=i<=n?t*n:t*i,this.from.x>this.to.x&&(e=-e),this.from.y>=this.to.y&&(o=-o);let r=this.from.x+e,s=this.from.y+o;return i<=n?r=this.from.x<=this.to.x?this.to.x<r?this.to.x:r:this.to.x>r?this.to.x:r:s=this.from.y>=this.to.y?this.to.y>s?this.to.y:s:this.to.y<s?this.to.y:s,{x:r,y:s}}}_findBorderPosition(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._findBorderPositionBezier(t,e,i.via)}_getDistanceToEdge(t,e,i,n,o,r){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(t,e,i,n,o,r,s)}getPoint(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates();const 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}}}class EW extends wW{_getDistanceToBezierEdge2(t,e,i,n,o,r,s,a){let h=1e9,d=t,c=e;const l=[0,0,0,0];for(let u=1;u<10;u++){const f=.1*u;l[0]=Math.pow(1-f,3),l[1]=3*f*Math.pow(1-f,2),l[2]=3*Math.pow(f,2)*(1-f),l[3]=Math.pow(f,3);const p=l[0]*t+l[1]*s.x+l[2]*a.x+l[3]*i,g=l[0]*e+l[1]*s.y+l[2]*a.y+l[3]*n;if(u>0){const t=this._getDistanceToLine(d,c,p,g,o,r);h=t<h?t:h}d=p,c=g}return h}}class OW extends EW{_line(t,e,i){const n=i[0],o=i[1];this._bezierCurve(t,e,n,o)}_getViaCoordinates(){const t=this.from.x-this.to.x,e=this.from.y-this.to.y;let i,n,o,r;const s=this.options.smooth.roundness;return(Math.abs(t)>Math.abs(e)||!0===this.options.smooth.forceDirection||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(n=this.from.y,r=this.to.y,i=this.from.x-s*t,o=this.to.x+s*t):(n=this.from.y-s*e,r=this.to.y+s*e,i=this.from.x,o=this.to.x),[{x:i,y:n},{x:o,y:r}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(t,e){return this._findBorderPositionBezier(t,e)}_getDistanceToEdge(t,e,i,n,o,r){let[s,a]=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(t,e,i,n,o,r,s,a)}getPoint(t){let[e,i]=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates();const n=t,o=[Math.pow(1-n,3),3*n*Math.pow(1-n,2),3*Math.pow(n,2)*(1-n),Math.pow(n,3)];return{x:o[0]*this.fromPoint.x+o[1]*e.x+o[2]*i.x+o[3]*this.toPoint.x,y:o[0]*this.fromPoint.y+o[1]*e.y+o[2]*i.y+o[3]*this.toPoint.y}}}class SW extends mW{_line(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)}getViaNode(){}getPoint(t){return{x:(1-t)*this.fromPoint.x+t*this.toPoint.x,y:(1-t)*this.fromPoint.y+t*this.toPoint.y}}_findBorderPosition(t,e){let i=this.to,n=this.from;t.id===this.from.id&&(i=this.from,n=this.to);const 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}}_getDistanceToEdge(t,e,i,n,o,r){return this._getDistanceToLine(t,e,i,n,o,r)}}class CW{constructor(t,e,i,n,o){if(void 0===e)throw new Error("No body provided");this.options=dz(n),this.globalOptions=n,this.defaultOptions=o,this.body=e,this.imagelist=i,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new yH(this.body,this.options,!0),this.setOptions(t)}setOptions(t){if(!t)return;let e=void 0!==t.physics&&this.options.physics!==t.physics||void 0!==t.hidden&&(this.options.hidden||!1)!==(t.hidden||!1)||void 0!==t.from&&this.options.from!==t.from||void 0!==t.to&&this.options.to!==t.to;CW.parseOptions(this.options,t,!0,this.globalOptions),void 0!==t.id&&(this.id=t.id),void 0!==t.from&&(this.fromId=t.from),void 0!==t.to&&(this.toId=t.to),void 0!==t.title&&(this.title=t.title),void 0!==t.value&&(t.value=$R(t.value));const i=[t,this.options,this.defaultOptions];return this.chooser=rH("edge",i),this.updateLabelModule(t),e=this.updateEdgeType()||e,this._setInteractionWidths(),this.connect(),e}static parseOptions(t,e){let 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(XF(["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&&(ZB(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&&(ZB(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"))),aH(e.label)?t.label=e.label:aH(t.label)||(t.label=void 0),cz(t,e,"smooth",n),cz(t,e,"shadow",n),cz(t,e,"background",n),void 0!==e.dashes&&null!==e.dashes?t.dashes=e.dashes:!0===i&&null===e.dashes&&(t.dashes=oM(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),cz(t.scaling,e.scaling,"label",n.scaling)):!0===i&&null===e.scaling&&(t.scaling=oM(n.scaling)),void 0!==e.arrows&&null!==e.arrows)if("string"==typeof e.arrows){const i=e.arrows.toLowerCase();t.arrows.to.enabled=-1!=WP(i).call(i,"to"),t.arrows.middle.enabled=-1!=WP(i).call(i,"middle"),t.arrows.from.enabled=-1!=WP(i).call(i,"from")}else{if("object"!=typeof e.arrows)throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+yM(e.arrows));cz(t.arrows,e.arrows,"to",n.arrows),cz(t.arrows,e.arrows,"middle",n.arrows),cz(t.arrows,e.arrows,"from",n.arrows)}else!0===i&&null===e.arrows&&(t.arrows=oM(n.arrows));if(void 0!==e.color&&null!==e.color){const r=qF(e.color)?{color:e.color,highlight:e.color,hover:e.color,inherit:!1,opacity:1}:e.color,s=t.color;if(o)KF(s,n.color,!1,i);else for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&delete s[t];if(qF(s))s.color=s,s.highlight=s,s.hover=s,s.inherit=!1,void 0===r.opacity&&(s.opacity=1);else{let t=!1;void 0!==r.color&&(s.color=r.color,t=!0),void 0!==r.highlight&&(s.highlight=r.highlight,t=!0),void 0!==r.hover&&(s.hover=r.hover,t=!0),void 0!==r.inherit&&(s.inherit=r.inherit),void 0!==r.opacity&&(s.opacity=Math.min(1,Math.max(0,r.opacity))),!0===t?s.inherit=!1:void 0===s.inherit&&(s.inherit="from")}}else!0===i&&null===e.color&&(t.color=dz(n.color));!0===i&&null===e.font&&(t.font=dz(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)}getFormattingValues(){const 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){const t=this.options.selectionWidth;"function"==typeof t?o.width=t(o.width):"number"==typeof t&&(o.width+=t),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){const t=this.options.hoverWidth;"function"==typeof t?o.width=t(o.width):"number"==typeof t&&(o.width+=t),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}updateLabelModule(t){const e=[t,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,e),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){const t=this.options.smooth;let e=!1,i=!0;return void 0!==this.edgeType&&((this.edgeType instanceof _W&&!0===t.enabled&&"dynamic"===t.type||this.edgeType instanceof OW&&!0===t.enabled&&"cubicBezier"===t.type||this.edgeType instanceof xW&&!0===t.enabled&&"dynamic"!==t.type&&"cubicBezier"!==t.type||this.edgeType instanceof SW&&!1===t.type.enabled)&&(i=!1),!0===i&&(e=this.cleanup())),!0===i?!0===t.enabled?"dynamic"===t.type?(e=!0,this.edgeType=new _W(this.options,this.body,this.labelModule)):"cubicBezier"===t.type?this.edgeType=new OW(this.options,this.body,this.labelModule):this.edgeType=new xW(this.options,this.body,this.labelModule):this.edgeType=new SW(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),e}connect(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=void 0!==this.from&&void 0!==this.to,!0===this.connected?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}disconnect(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}getTitle(){return this.title}isSelected(){return this.selected}getValue(){return this.options.value}setValueRange(t,e,i){if(void 0!==this.options.value){const 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){const t=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*t}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()}_setInteractionWidths(){"function"==typeof this.options.hoverWidth?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,"function"==typeof this.options.selectionWidth?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}draw(t){const e=this.getFormattingValues();if(e.hidden)return;const i=this.edgeType.getViaNode();this.edgeType.drawLine(t,e,this.selected,this.hover,i),this.drawLabel(t,i)}drawArrows(t){const e=this.getFormattingValues();if(e.hidden)return;const 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)}drawLabel(t,e){if(void 0!==this.options.label){const i=this.from,n=this.to;let o;if(this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(t,this.selected,this.hover),i.id!=n.id){this.labelModule.pointToSelf=!1,o=this.edgeType.getPoint(.5,e),t.save();const i=this._getRotation(t);0!=i.angle&&(t.translate(i.x,i.y),t.rotate(i.angle)),this.labelModule.draw(t,o.x,o.y,this.selected,this.hover),t.restore()}else{this.labelModule.pointToSelf=!0;const e=hH(t,this.options.selfReference.angle,this.options.selfReference.size,i);o=this._pointOnCircle(e.x,e.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(t,o.x,o.y,this.selected,this.hover)}}}getItemsOnPoint(t){const e=[];if(this.labelModule.visible()){const i=this._getRotation();sH(this.labelModule.getSize(),t,i)&&e.push({edgeId:this.id,labelId:0})}const i={left:t.x,top:t.y};return this.isOverlappingWith(i)&&e.push({edgeId:this.id}),e}isOverlappingWith(t){if(this.connected){const e=10,i=this.from.x,n=this.from.y,o=this.to.x,r=this.to.y,s=t.left,a=t.top;return this.edgeType.getDistanceToEdge(i,n,o,r,s,a)<e}return!1}_getRotation(t){const 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);const 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;const o=this.from.y-this.to.y,r=this.from.x-this.to.x;let s=Math.atan2(o,r);return(s<-1&&r<0||s>0&&r<0)&&(s+=Math.PI),n.angle=s,n}_pointOnCircle(t,e,i,n){return{x:t+i*Math.cos(n),y:e-i*Math.sin(n)}}select(){this.selected=!0}unselect(){this.selected=!1}cleanup(){return this.edgeType.cleanup()}remove(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}endPointsValid(){return void 0!==this.body.nodes[this.fromId]&&void 0!==this.body.nodes[this.toId]}}class TW{constructor(t,e,i){var n;this.body=t,this.images=e,this.groups=i,this.body.functions.createEdge=LE(n=this.create).call(n,this),this.edgesListeners={add:(t,e)=>{this.add(e.items)},update:(t,e)=>{this.update(e.items)},remove:(t,e)=>{this.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;{const i=1/(e-t);return Math.max(0,(n-t)*i)}}},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},KF(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var t,e,i=this;this.body.emitter.on("_forceDisableDynamicCurves",function(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];"dynamic"===t&&(t="continuous");let n=!1;for(const e in i.body.edges)if(Object.prototype.hasOwnProperty.call(i.body.edges,e)){const o=i.body.edges[e],r=i.body.data.edges.get(e);if(null!=r){const e=r.smooth;void 0!==e&&!0===e.enabled&&"dynamic"===e.type&&(void 0===t?o.setOptions({smooth:!1}):o.setOptions({smooth:{type:t}}),n=!0)}}!0===e&&!0===n&&i.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",()=>{this.reconnectEdges()}),this.body.emitter.on("refreshEdges",LE(t=this.refresh).call(t,this)),this.body.emitter.on("refresh",LE(e=this.refresh).call(e,this)),this.body.emitter.on("destroy",()=>{$F(this.edgesListeners,(t,e)=>{this.body.data.edges&&this.body.data.edges.off(e,t)}),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners})}setOptions(t){if(void 0!==t){CW.parseOptions(this.options,t,!0,this.defaultOptions,!0);let e=!1;if(void 0!==t.smooth)for(const t in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,t)&&(e=this.body.edges[t].updateEdgeType()||e);if(void 0!==t.font)for(const t in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,t)&&this.body.edges[t].updateLabelModule();void 0===t.hidden&&void 0===t.physics&&!0!==e||this.body.emitter.emit("_dataChanged")}}setData(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=this.body.data.edges;if(Bb("id",t))this.body.data.edges=t;else if(nk(t))this.body.data.edges=new Ab,this.body.data.edges.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.edges=new Ab}if(i&&$F(this.edgesListeners,(t,e)=>{i.off(e,t)}),this.body.edges={},this.body.data.edges){$F(this.edgesListeners,(t,e)=>{this.body.data.edges.on(e,t)});const t=this.body.data.edges.getIds();this.add(t,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===e&&this.body.emitter.emit("_dataChanged")}add(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=this.body.edges,n=this.body.data.edges;for(let e=0;e<t.length;e++){const o=t[e],r=i[o];r&&r.disconnect();const s=n.get(o,{showInternalIds:!0});i[o]=this.create(s)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===e&&this.body.emitter.emit("_dataChanged")}update(t){const e=this.body.edges,i=this.body.data.edges;let n=!1;for(let o=0;o<t.length;o++){const r=t[o],s=i.get(r),a=e[r];void 0!==a?(a.disconnect(),n=a.setOptions(s)||n,a.connect()):(this.body.edges[r]=this.create(s),n=!0)}!0===n?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}remove(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(0===t.length)return;const i=this.body.edges;$F(t,t=>{const e=i[t];void 0!==e&&e.remove()}),e&&this.body.emitter.emit("_dataChanged")}refresh(){$F(this.body.edges,(t,e)=>{const i=this.body.data.edges.get(e);void 0!==i&&t.setOptions(i)})}create(t){return new CW(t,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let t;const 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)){const e=i[t];e.from=null,e.to=null,e.connect()}}getConnectedNodes(t){const e=[];if(void 0!==this.body.edges[t]){const i=this.body.edges[t];void 0!==i.fromId&&e.push(i.fromId),void 0!==i.toId&&e.push(i.toId)}return e}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){const t=[];$F(this.body.edges,(e,i)=>{const n=this.body.nodes[e.toId],o=this.body.nodes[e.fromId];void 0!==n&&!0===n.isCluster||void 0!==o&&!0===o.isCluster||void 0!==n&&void 0!==o||t.push(i)}),this.remove(t,!1)}_addMissingEdges(){const t=this.body.data.edges;if(null==t)return;const e=this.body.edges,i=[];rD(t).call(t,(t,n)=>{void 0===e[n]&&i.push(n)}),this.add(i,!0)}}class kW{constructor(t,e,i){this.body=t,this.physicsBody=e,this.setOptions(i),this._rng=zF("BARNES HUT SOLVER")}setOptions(t){this.options=t,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}solve(){if(0!==this.options.gravitationalConstant&&this.physicsBody.physicsNodeIndices.length>0){let t;const e=this.body.nodes,i=this.physicsBody.physicsNodeIndices,n=i.length,o=this._formBarnesHutTree(e,i);this.barnesHutTree=o;for(let r=0;r<n;r++)t=e[i[r]],t.options.mass>0&&this._getForceContributions(o.root,t)}}_getForceContributions(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)}_getForceContribution(t,e){if(t.childrenCount>0){const 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)}}_calculateForces(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));const 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}_formBarnesHutTree(t,e){let i;const n=e.length;let o=t[e[0]].x,r=t[e[0]].y,s=t[e[0]].x,a=t[e[0]].y;for(let i=1;i<n;i++){const n=t[e[i]],h=n.x,d=n.y;n.options.mass>0&&(h<o&&(o=h),h>s&&(s=h),d<r&&(r=d),d>a&&(a=d))}const h=Math.abs(s-o)-Math.abs(a-r);h>0?(r-=.5*h,a+=.5*h):(o+=.5*h,s-=.5*h);const d=Math.max(1e-5,Math.abs(s-o)),c=.5*d,l=.5*(o+s),u=.5*(r+a),f={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:l-c,maxX:l+c,minY:u-c,maxY:u+c},size:d,calcSize:1/d,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(f.root);for(let o=0;o<n;o++)i=t[e[o]],i.options.mass>0&&this._placeInTree(f.root,i);return f}_updateBranchMass(t,e){const 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;const r=Math.max(Math.max(e.height,e.radius),e.width);t.maxWidth=t.maxWidth<r?r:t.maxWidth}_placeInTree(t,e,i){1==i&&void 0!==i||this._updateBranchMass(t,e);const n=t.children.NW.range;let o;o=n.maxX>e.x?n.maxY>e.y?"NW":"SW":n.maxY>e.y?"NE":"SE",this._placeInRegion(t,e,o)}_placeInRegion(t,e,i){const 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)}}_splitBranch(t){let 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)}_insertRegion(t,e){let i,n,o,r;const 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}}_debug(t,e){void 0!==this.barnesHutTree&&(t.lineWidth=1,this._drawBranch(this.barnesHutTree.root,t,e))}_drawBranch(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()}}class DW{constructor(t,e,i){this._rng=zF("REPULSION SOLVER"),this.body=t,this.physicsBody=e,this.setOptions(i)}setOptions(t){this.options=t}solve(){let t,e,i,n,o,r,s,a;const h=this.body.nodes,d=this.physicsBody.physicsNodeIndices,c=this.physicsBody.forces,l=this.options.nodeDistance,u=-2/3/l,f=4/3;for(let p=0;p<d.length-1;p++){s=h[d[p]];for(let g=p+1;g<d.length;g++)a=h[d[g]],t=a.x-s.x,e=a.y-s.y,i=Math.sqrt(t*t+e*e),0===i&&(i=.1*this._rng(),t=i),i<2*l&&(r=i<.5*l?1:u*i+f,r/=i,n=t*r,o=e*r,c[s.id].x-=n,c[s.id].y-=o,c[a.id].x+=n,c[a.id].y+=o)}}}class IW{constructor(t,e,i){this.body=t,this.physicsBody=e,this.setOptions(i)}setOptions(t){this.options=t,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}solve(){const t=this.body.nodes,e=this.physicsBody.physicsNodeIndices,i=this.physicsBody.forces,n=this.options.nodeDistance;for(let o=0;o<e.length-1;o++){const r=t[e[o]];for(let s=o+1;s<e.length;s++){const o=t[e[s]];if(r.level===o.level){const t=n+this.overlapAvoidanceFactor*((r.shape.radius||0)/2+(o.shape.radius||0)/2),e=o.x-r.x,s=o.y-r.y,a=Math.sqrt(e*e+s*s),h=.05;let d;d=a<t?-Math.pow(h*a,2)+Math.pow(h*t,2):0,0!==a&&(d/=a);const c=e*d,l=s*d;i[r.id].x-=c,i[r.id].y-=l,i[o.id].x+=c,i[o.id].y+=l}}}}}class PW{constructor(t,e,i){this.body=t,this.physicsBody=e,this.setOptions(i)}setOptions(t){this.options=t}solve(){let t,e;const i=this.physicsBody.physicsEdgeIndices,n=this.body.edges;let o,r,s;for(let a=0;a<i.length;a++)e=n[i[a]],!0===e.connected&&e.toId!==e.fromId&&void 0!==this.body.nodes[e.toId]&&void 0!==this.body.nodes[e.fromId]&&(void 0!==e.edgeType.via?(t=void 0===e.options.length?this.options.springLength:e.options.length,o=e.to,r=e.edgeType.via,s=e.from,this._calculateSpringForce(o,r,.5*t),this._calculateSpringForce(r,s,.5*t)):(t=void 0===e.options.length?1.5*this.options.springLength:e.options.length,this._calculateSpringForce(e.from,e.to,t)))}_calculateSpringForce(t,e,i){const n=t.x-e.x,o=t.y-e.y,r=Math.max(Math.sqrt(n*n+o*o),.01),s=this.options.springConstant*(i-r)/r,a=n*s,h=o*s;void 0!==this.physicsBody.forces[t.id]&&(this.physicsBody.forces[t.id].x+=a,this.physicsBody.forces[t.id].y+=h),void 0!==this.physicsBody.forces[e.id]&&(this.physicsBody.forces[e.id].x-=a,this.physicsBody.forces[e.id].y-=h)}}class MW{constructor(t,e,i){this.body=t,this.physicsBody=e,this.setOptions(i)}setOptions(t){this.options=t}solve(){let t,e,i,n,o,r,s,a;const h=this.body.edges,d=.5,c=this.physicsBody.physicsEdgeIndices,l=this.physicsBody.physicsNodeIndices,u=this.physicsBody.forces;for(let t=0;t<l.length;t++){const e=l[t];u[e].springFx=0,u[e].springFy=0}for(let l=0;l<c.length;l++)e=h[c[l]],!0===e.connected&&(t=void 0===e.options.length?this.options.springLength:e.options.length,i=e.from.x-e.to.x,n=e.from.y-e.to.y,a=Math.sqrt(i*i+n*n),a=0===a?.01:a,s=this.options.springConstant*(t-a)/a,o=i*s,r=n*s,e.to.level!=e.from.level?(void 0!==u[e.toId]&&(u[e.toId].springFx-=o,u[e.toId].springFy-=r),void 0!==u[e.fromId]&&(u[e.fromId].springFx+=o,u[e.fromId].springFy+=r)):(void 0!==u[e.toId]&&(u[e.toId].x-=d*o,u[e.toId].y-=d*r),void 0!==u[e.fromId]&&(u[e.fromId].x+=d*o,u[e.fromId].y+=d*r)));let f,p;s=1;for(let t=0;t<l.length;t++){const e=l[t];f=Math.min(s,Math.max(-s,u[e].springFx)),p=Math.min(s,Math.max(-s,u[e].springFy)),u[e].x+=f,u[e].y+=p}let g=0,v=0;for(let t=0;t<l.length;t++){const e=l[t];g+=u[e].x,v+=u[e].y}const m=g/l.length,y=v/l.length;for(let t=0;t<l.length;t++){const e=l[t];u[e].x-=m,u[e].y-=y}}}class NW{constructor(t,e,i){this.body=t,this.physicsBody=e,this.setOptions(i)}setOptions(t){this.options=t}solve(){let t,e,i,n;const o=this.body.nodes,r=this.physicsBody.physicsNodeIndices,s=this.physicsBody.forces;for(let a=0;a<r.length;a++){n=o[r[a]],t=-n.x,e=-n.y,i=Math.sqrt(t*t+e*e),this._calculateForces(i,t,e,s,n)}}_calculateForces(t,e,i,n,o){const r=0===t?0:this.options.centralGravity/t;n[o.id].x=e*r,n[o.id].y=i*r}}class FW extends kW{constructor(t,e,i){super(t,e,i),this._rng=zF("FORCE ATLAS 2 BASED REPULSION SOLVER")}_calculateForces(t,e,i,n,o){0===t&&(e=t=.1*this._rng()),this.overlapAvoidanceFactor<1&&n.shape.radius&&(t=Math.max(.1+this.overlapAvoidanceFactor*n.shape.radius,t-n.shape.radius));const r=n.edges.length+1,s=this.options.gravitationalConstant*o.mass*n.options.mass*r/Math.pow(t,2),a=e*s,h=i*s;this.physicsBody.forces[n.id].x+=a,this.physicsBody.forces[n.id].y+=h}}class zW extends NW{_calculateForces(t,e,i,n,o){if(t>0){const t=o.edges.length+1,r=this.options.centralGravity*t*o.options.mass;n[o.id].x=e*r,n[o.id].y=i*r}}}class AW{constructor(t){this.body=t,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},ME(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("initPhysics",()=>{this.initPhysics()}),this.body.emitter.on("_layoutFailed",()=>{this.layoutFailed=!0}),this.body.emitter.on("resetPhysics",()=>{this.stopSimulation(),this.ready=!1}),this.body.emitter.on("disablePhysics",()=>{this.physicsEnabled=!1,this.stopSimulation()}),this.body.emitter.on("restorePhysics",()=>{this.setOptions(this.options),!0===this.ready&&this.startSimulation()}),this.body.emitter.on("startSimulation",()=>{!0===this.ready&&this.startSimulation()}),this.body.emitter.on("stopSimulation",()=>{this.stopSimulation()}),this.body.emitter.on("destroy",()=>{this.stopSimulation(!1),this.body.emitter.off()}),this.body.emitter.on("_dataChanged",()=>{this.updatePhysicsData()})}setOptions(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,GF(["stabilization"],this.options,t),cz(this.options,t,"stabilization"),void 0===t.enabled&&(this.options.enabled=!0),!1===this.options.enabled&&(this.physicsEnabled=!1,this.stopSimulation());const e=this.options.wind;e&&(("number"!=typeof e.x||BB(e.x))&&(e.x=0),("number"!=typeof e.y||BB(e.y))&&(e.y=0)),this.timestep=this.options.timestep}this.init()}init(){let t;"forceAtlas2Based"===this.options.solver?(t=this.options.forceAtlas2Based,this.nodesSolver=new FW(this.body,this.physicsBody,t),this.edgesSolver=new PW(this.body,this.physicsBody,t),this.gravitySolver=new zW(this.body,this.physicsBody,t)):"repulsion"===this.options.solver?(t=this.options.repulsion,this.nodesSolver=new DW(this.body,this.physicsBody,t),this.edgesSolver=new PW(this.body,this.physicsBody,t),this.gravitySolver=new NW(this.body,this.physicsBody,t)):"hierarchicalRepulsion"===this.options.solver?(t=this.options.hierarchicalRepulsion,this.nodesSolver=new IW(this.body,this.physicsBody,t),this.edgesSolver=new MW(this.body,this.physicsBody,t),this.gravitySolver=new NW(this.body,this.physicsBody,t)):(t=this.options.barnesHut,this.nodesSolver=new kW(this.body,this.physicsBody,t),this.edgesSolver=new PW(this.body,this.physicsBody,t),this.gravitySolver=new NW(this.body,this.physicsBody,t)),this.modelOptions=t}initPhysics(){!0===this.physicsEnabled&&!0===this.options.enabled?!0===this.options.stabilization.enabled?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}startSimulation(){var 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=LE(t=this.simulationStep).call(t,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}stopSimulation(){let 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"))}simulationStep(){const t=qk();this.physicsTick();(qk()-t<.4*this.simulationInterval||!0===this.runDoubleSpeed)&&!1===this.stabilized&&(this.physicsTick(),this.runDoubleSpeed=!0),!0===this.stabilized&&this.stopSimulation()}_emitStabilized(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||!0===this.startedStabilization)&&VM(()=>{this.body.emitter.emit("stabilized",{iterations:t}),this.startedStabilization=!1,this.stabilizationIterations=0},0)}physicsStep(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}adjustTimeStep(){!0===this._evaluateStepQuality()?this.timestep=1.2*this.timestep:this.timestep/1.2<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/1.2))}physicsTick(){if(this._startStabilizing(),!0!==this.stabilized){if(!0===this.adaptiveTimestep&&!0===this.adaptiveTimestepEnabled){this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.physicsStep(),this.revert(),this.timestep=.5*this.timestep,this.physicsStep(),this.physicsStep(),this.adjustTimeStep()):this.physicsStep(),this.adaptiveCounter+=1}else this.timestep=this.options.timestep,this.physicsStep();!0===this.stabilized&&this.revert(),this.stabilizationIterations++}}updatePhysicsData(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];const t=this.body.nodes,e=this.body.edges;for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&!0===t[e].options.physics&&this.physicsBody.physicsNodeIndices.push(t[e].id);for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&!0===e[t].options.physics&&this.physicsBody.physicsEdgeIndices.push(e[t].id);for(let t=0;t<this.physicsBody.physicsNodeIndices.length;t++){const e=this.physicsBody.physicsNodeIndices[t];this.physicsBody.forces[e]={x:0,y:0},void 0===this.physicsBody.velocities[e]&&(this.physicsBody.velocities[e]={x:0,y:0})}for(const e in this.physicsBody.velocities)void 0===t[e]&&delete this.physicsBody.velocities[e]}revert(){const t=Ck(this.previousStates),e=this.body.nodes,i=this.physicsBody.velocities;this.referenceState={};for(let n=0;n<t.length;n++){const o=t[n];void 0!==e[o]?!0===e[o].options.physics&&(this.referenceState[o]={positions:{x:e[o].x,y:e[o].y}},i[o].x=this.previousStates[o].vx,i[o].y=this.previousStates[o].vy,e[o].x=this.previousStates[o].x,e[o].y=this.previousStates[o].y):delete this.previousStates[o]}}_evaluateStepQuality(){let t,e,i;const n=this.body.nodes,o=this.referenceState;for(const r in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,r)&&void 0!==n[r]&&(t=n[r].x-o[r].positions.x,e=n[r].y-o[r].positions.y,i=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),i>.3))return!1;return!0}moveNodes(){const t=this.physicsBody.physicsNodeIndices;let e=0,i=0;for(let n=0;n<t.length;n++){const o=t[n],r=this._performStep(o);e=Math.max(e,r),i+=r}this.adaptiveTimestepEnabled=i/t.length<5,this.stabilized=e<this.options.minVelocity}calculateComponentVelocity(t,e,i){t+=(e-this.modelOptions.damping*t)/i*this.timestep;const n=this.options.maxVelocity||1e9;return Math.abs(t)>n&&(t=t>0?n:-n),t}_performStep(t){const 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);const n=this.physicsBody.velocities[t];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);return Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2))}_freezeNodes(){const t=this.body.nodes;for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&t[e].x&&t[e].y){const i=t[e].options.fixed;this.freezeCache[e]={x:i.x,y:i.y},i.x=!0,i.y=!0}}_restoreFrozenNodes(){const t=this.body.nodes;for(const 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={}}stabilize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.stabilization.iterations;"number"!=typeof t&&(t=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",t)),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=t,!0===this.options.stabilization.onlyDynamicEdges&&this._freezeNodes(),this.stabilizationIterations=0,VM(()=>this._stabilizationBatch(),0)):this.ready=!0}_startStabilizing(){return!0!==this.startedStabilization&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){const t=()=>!1===this.stabilized&&this.stabilizationIterations<this.targetIterations,e=()=>{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&e();let i=0;for(;t()&&i<this.options.stabilization.updateInterval;)this.physicsTick(),i++;var n;(e(),t())?VM(LE(n=this._stabilizationBatch).call(n,this),0):this._finalizeStabilization()}_finalizeStabilization(){this.body.emitter.emit("_allowRedraw"),!0===this.options.stabilization.fit&&this.body.emitter.emit("fit"),!0===this.options.stabilization.onlyDynamicEdges&&this._restoreFrozenNodes(),this.body.emitter.emit("stabilizationIterationsDone"),this.body.emitter.emit("_requestRedraw"),!0===this.stabilized?this._emitStabilized():this.startSimulation(),this.ready=!0}_drawForces(t){for(let e=0;e<this.physicsBody.physicsNodeIndices.length;e++){const i=this.physicsBody.physicsNodeIndices[e],n=this.body.nodes[i],o=this.physicsBody.forces[i],r=20,s=.03,a=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.x,2)),h=Math.min(Math.max(5,a),15),d=3*h,c=sz((180-180*Math.min(1,Math.max(0,s*a)))/360,1,1),l={x:n.x+r*o.x,y:n.y+r*o.y};t.lineWidth=h,t.strokeStyle=c,t.beginPath(),t.moveTo(n.x,n.y),t.lineTo(l.x,l.y),t.stroke();const u=Math.atan2(o.y,o.x);t.fillStyle=c,pW.draw(t,{type:"arrow",point:l,angle:u,length:d}),QM(t).call(t)}}}const BW=[];for(let t=0;t<256;++t)BW.push((t+256).toString(16).slice(1));const jW=new Uint8Array(16);function RW(t,e,i){return crypto.randomUUID?crypto.randomUUID():function(t){t=t||{};const e=t.random??t.rng?.()??crypto.getRandomValues(jW);if(e.length<16)throw new Error("Random bytes length must be >= 16");return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(t,e=0){return(BW[t[e+0]]+BW[t[e+1]]+BW[t[e+2]]+BW[t[e+3]]+"-"+BW[t[e+4]]+BW[t[e+5]]+"-"+BW[t[e+6]]+BW[t[e+7]]+"-"+BW[t[e+8]]+BW[t[e+9]]+"-"+BW[t[e+10]]+BW[t[e+11]]+BW[t[e+12]]+BW[t[e+13]]+BW[t[e+14]]+BW[t[e+15]]).toLowerCase()}(e)}(t)}class LW{static getRange(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=1e9,o=-1e9,r=1e9,s=-1e9;if(i.length>0)for(let a=0;a<i.length;a++)e=t[i[a]],r>e.shape.boundingBox.left&&(r=e.shape.boundingBox.left),s<e.shape.boundingBox.right&&(s=e.shape.boundingBox.right),n>e.shape.boundingBox.top&&(n=e.shape.boundingBox.top),o<e.shape.boundingBox.bottom&&(o=e.shape.boundingBox.bottom);return 1e9===r&&-1e9===s&&1e9===n&&-1e9===o&&(n=0,o=0,r=0,s=0),{minX:r,maxX:s,minY:n,maxY:o}}static getRangeCore(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=1e9,o=-1e9,r=1e9,s=-1e9;if(i.length>0)for(let a=0;a<i.length;a++)e=t[i[a]],r>e.x&&(r=e.x),s<e.x&&(s=e.x),n>e.y&&(n=e.y),o<e.y&&(o=e.y);return 1e9===r&&-1e9===s&&1e9===n&&-1e9===o&&(n=0,o=0,r=0,s=0),{minX:r,maxX:s,minY:n,maxY:o}}static findCenter(t){return{x:.5*(t.maxX+t.minX),y:.5*(t.maxY+t.minY)}}static cloneOptions(t,e){const i={};return void 0===e||"node"===e?(KF(i,t.options,!0),i.x=t.x,i.y=t.y,i.amountOfConnections=t.edges.length):KF(i,t.options,!0),i}}class HW extends WH{constructor(t,e,i,n,o,r){super(t,e,i,n,o,r),this.isCluster=!0,this.containedNodes={},this.containedEdges={}}_openChildCluster(t){const e=this.body.nodes[t];if(void 0===this.containedNodes[t])throw new Error("node with id: "+t+" not in current cluster");if(!e.isCluster)throw new Error("node with id: "+t+" is not a cluster");delete this.containedNodes[t],$F(e.edges,t=>{delete this.containedEdges[t.id]}),$F(e.containedNodes,(t,e)=>{this.containedNodes[e]=t}),e.containedNodes={},$F(e.containedEdges,(t,e)=>{this.containedEdges[e]=t}),e.containedEdges={},$F(e.edges,t=>{$F(this.edges,e=>{var i,n;const o=WP(i=e.clusteringEdgeReplacingIds).call(i,t.id);-1!==o&&($F(t.clusteringEdgeReplacingIds,t=>{e.clusteringEdgeReplacingIds.push(t),this.body.edges[t].edgeReplacedById=e.id}),ND(n=e.clusteringEdgeReplacingIds).call(n,o,1))})}),e.edges=[]}}class WW{constructor(t){this.body=t,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},ME(this.options,this.defaultOptions),this.body.emitter.on("_resetData",()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(t,e){void 0===t?t=this._getHubSize():"object"==typeof t&&(e=this._checkOptions(t),t=this._getHubSize());const i=[];for(let e=0;e<this.body.nodeIndices.length;e++){const n=this.body.nodes[this.body.nodeIndices[e]];n.edges.length>=t&&i.push(n.id)}for(let t=0;t<i.length;t++)this.clusterByConnection(i[t],e,!0);this.body.emitter.emit("_dataChanged")}cluster(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===t.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");t=this._checkOptions(t);const i={},n={};$F(this.body.nodes,(e,o)=>{e.options&&!0===t.joinCondition(e.options)&&(i[o]=e,$F(e.edges,t=>{void 0===this.clusteredEdges[t.id]&&(n[t.id]=t)}))}),this._cluster(i,n,t,e)}clusterByEdgeCount(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e=this._checkOptions(e);const n=[],o={};let r,s,a;for(let i=0;i<this.body.nodeIndices.length;i++){const h={},d={},c=this.body.nodeIndices[i],l=this.body.nodes[c];if(void 0===o[c]){a=0,s=[];for(let t=0;t<l.edges.length;t++)r=l.edges[t],void 0===this.clusteredEdges[r.id]&&(r.toId!==r.fromId&&a++,s.push(r));if(a===t){const t=function(t){if(void 0===e.joinCondition||null===e.joinCondition)return!0;const i=LW.cloneOptions(t);return e.joinCondition(i)};let i=!0;for(let e=0;e<s.length;e++){r=s[e];const n=this._getConnectedId(r,c);if(!t(l)){i=!1;break}d[r.id]=r,h[c]=l,h[n]=this.body.nodes[n],o[c]=!0}if(Ck(h).length>0&&Ck(d).length>0&&!0===i){const t=function(){for(let t=0;t<n.length;++t)for(const e in h)if(void 0!==n[t].nodes[e])return n[t]}();if(void 0!==t){for(const e in h)void 0===t.nodes[e]&&(t.nodes[e]=h[e]);for(const e in d)void 0===t.edges[e]&&(t.edges[e]=d[e])}else n.push({nodes:h,edges:d})}}}}for(let t=0;t<n.length;t++)this._cluster(n[t].nodes,n[t].edges,e,!1);!0===i&&this.body.emitter.emit("_dataChanged")}clusterOutliers(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(1,t,e)}clusterBridges(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(2,t,e)}clusterByConnection(t,e){var i;let 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!");const 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);const r={},s={},a=o.id,h=LW.cloneOptions(o);r[a]=o;for(let t=0;t<o.edges.length;t++){const i=o.edges[t];if(void 0===this.clusteredEdges[i.id]){const t=this._getConnectedId(i,a);if(void 0===this.clusteredNodes[t])if(t!==a)if(void 0===e.joinCondition)s[i.id]=i,r[t]=this.body.nodes[t];else{const n=LW.cloneOptions(this.body.nodes[t]);!0===e.joinCondition(h,n)&&(s[i.id]=i,r[t]=this.body.nodes[t])}else s[i.id]=i}}const d=gk(i=Ck(r)).call(i,function(t){return r[t].id});for(const t in r){if(!Object.prototype.hasOwnProperty.call(r,t))continue;const e=r[t];for(let t=0;t<e.edges.length;t++){const i=e.edges[t];WP(d).call(d,this._getConnectedId(i,e.id))>-1&&(s[i.id]=i)}}this._cluster(r,s,e,n)}_createClusterEdges(t,e,i,n){let o,r,s,a,h,d;const c=Ck(t),l=[];for(let n=0;n<c.length;n++){r=c[n],s=t[r];for(let n=0;n<s.edges.length;n++)o=s.edges[n],void 0===this.clusteredEdges[o.id]&&(o.toId==o.fromId?e[o.id]=o:o.toId==r?(a=i.id,h=o.fromId,d=h):(a=o.toId,h=i.id,d=a),void 0===t[d]&&l.push({edge:o,fromId:h,toId:a}))}const u=[],f=function(t){for(let e=0;e<u.length;e++){const i=u[e],n=t.fromId===i.fromId&&t.toId===i.toId,o=t.fromId===i.toId&&t.toId===i.fromId;if(n||o)return i}return null};for(let t=0;t<l.length;t++){const e=l[t],i=e.edge;let o=f(e);null===o?(o=this._createClusteredEdge(e.fromId,e.toId,i,n),u.push(o)):o.clusteringEdgeReplacingIds.push(i.id),this.body.edges[i.id].edgeReplacedById=o.id,this._backupEdgeOptions(i),i.setOptions({physics:!1})}}_checkOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0===t.clusterEdgeProperties&&(t.clusterEdgeProperties={}),void 0===t.clusterNodeProperties&&(t.clusterNodeProperties={}),t}_cluster(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const o=[];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&void 0!==this.clusteredNodes[e]&&o.push(e);for(let e=0;e<o.length;++e)delete t[o[e]];if(0==Ck(t).length)return;if(1==Ck(t).length&&1!=i.clusterNodeProperties.allowSingleNodeCluster)return;let r=KF({},i.clusterNodeProperties);if(void 0!==i.processProperties){const n=[];for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const i=LW.cloneOptions(t[e]);n.push(i)}const o=[];for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"clusterEdge:"!==t.substr(0,12)){const i=LW.cloneOptions(e[t],"edge");o.push(i)}if(r=i.processProperties(r,n,o),!r)throw new Error("The processProperties function does not return properties!")}void 0===r.id&&(r.id="cluster:"+RW());const s=r.id;let a;void 0===r.label&&(r.label="cluster"),void 0===r.x&&(a=this._getClusterPosition(t),r.x=a.x),void 0===r.y&&(void 0===a&&(a=this._getClusterPosition(t)),r.y=a.y),r.id=s;const h=this.body.functions.createNode(r,HW);h.containedNodes=t,h.containedEdges=e,h.clusterEdgeProperties=i.clusterEdgeProperties,this.body.nodes[r.id]=h,this._clusterEdges(t,e,r,i.clusterEdgeProperties),r.id=void 0,!0===n&&this.body.emitter.emit("_dataChanged")}_backupEdgeOptions(t){void 0===this.clusteredEdges[t.id]&&(this.clusteredEdges[t.id]={physics:t.options.physics})}_restoreEdge(t){const e=this.clusteredEdges[t.id];void 0!==e&&(t.setOptions({physics:e.physics}),delete this.clusteredEdges[t.id])}isCluster(t){return void 0!==this.body.nodes[t]?!0===this.body.nodes[t].isCluster:(console.error("Node does not exist."),!1)}_getClusterPosition(t){const e=Ck(t);let i,n=t[e[0]].x,o=t[e[0]].x,r=t[e[0]].y,s=t[e[0]].y;for(let a=1;a<e.length;a++)i=t[e[a]],n=i.x<n?i.x:n,o=i.x>o?i.x:o,r=i.y<r?i.y:r,s=i.y>s?i.y:s;return{x:.5*(n+o),y:.5*(r+s)}}openCluster(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===t)throw new Error("No clusterNodeId supplied to openCluster.");const 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.");const o=this.findNode(t),r=WP(o).call(o,t)-1;if(r>=0){const e=o[r];return this.body.nodes[e]._openChildCluster(t),delete this.body.nodes[t],void(!0===i&&this.body.emitter.emit("_dataChanged"))}const s=n.containedNodes,a=n.containedEdges;if(void 0!==e&&void 0!==e.releaseFunction&&"function"==typeof e.releaseFunction){const t={},i={x:n.x,y:n.y};for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)){const i=this.body.nodes[e];t[e]={x:i.x,y:i.y}}const o=e.releaseFunction(i,t);for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)){const e=this.body.nodes[t];void 0!==o[t]&&(e.x=void 0===o[t].x?n.x:o[t].x,e.y=void 0===o[t].y?n.y:o[t].y)}}else $F(s,function(t){!1===t.options.fixed.x&&(t.x=n.x),!1===t.options.fixed.y&&(t.y=n.y)});for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)){const e=this.body.nodes[t];e.vx=n.vx,e.vy=n.vy,e.setOptions({physics:!0}),delete this.clusteredNodes[t]}const h=[];for(let t=0;t<n.edges.length;t++)h.push(n.edges[t]);for(let e=0;e<h.length;e++){const i=h[e],n=this._getConnectedId(i,t),o=this.clusteredNodes[n];for(let t=0;t<i.clusteringEdgeReplacingIds.length;t++){const e=i.clusteringEdgeReplacingIds[t],r=this.body.edges[e];if(void 0!==r)if(void 0!==o){const t=this.body.nodes[o.clusterId];t.containedEdges[r.id]=r,delete a[r.id];let e=r.fromId,i=r.toId;r.toId==n?i=o.clusterId:e=o.clusterId,this._createClusteredEdge(e,i,r,t.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(r)}i.remove()}for(const t in a)Object.prototype.hasOwnProperty.call(a,t)&&this._restoreEdge(a[t]);delete this.body.nodes[t],!0===i&&this.body.emitter.emit("_dataChanged")}getNodesInCluster(t){const e=[];if(!0===this.isCluster(t)){const i=this.body.nodes[t].containedNodes;for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&e.push(this.body.nodes[t].id)}return e}findNode(t){const e=[];let i,n=0;for(;void 0!==this.clusteredNodes[t]&&n<100;){if(i=this.body.nodes[t],void 0===i)return[];e.push(i.id),t=this.clusteredNodes[t].clusterId,n++}return i=this.body.nodes[t],void 0===i?[]:(e.push(i.id),ED(e).call(e),e)}updateClusteredNode(t,e){if(void 0===t)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(void 0===e)throw new Error("No newOptions supplied to updateClusteredNode.");if(void 0===this.body.nodes[t])throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist.");this.body.nodes[t].setOptions(e),this.body.emitter.emit("_dataChanged")}updateEdge(t,e){if(void 0===t)throw new Error("No startEdgeId supplied to updateEdge.");if(void 0===e)throw new Error("No newOptions supplied to updateEdge.");if(void 0===this.body.edges[t])throw new Error("The startEdgeId supplied to updateEdge does not exist.");const i=this.getClusteredEdges(t);for(let t=0;t<i.length;t++){this.body.edges[i[t]].setOptions(e)}this.body.emitter.emit("_dataChanged")}getClusteredEdges(t){const e=[];let i=0;for(;void 0!==t&&void 0!==this.body.edges[t]&&i<100;)e.push(this.body.edges[t].id),t=this.body.edges[t].edgeReplacedById,i++;return ED(e).call(e),e}getBaseEdge(t){return this.getBaseEdges(t)[0]}getBaseEdges(t){const e=[t],i=[],n=[];let o=0;for(;e.length>0&&o<100;){const t=e.pop();if(void 0===t)continue;const r=this.body.edges[t];if(void 0===r)continue;o++;const s=r.clusteringEdgeReplacingIds;if(void 0===s)n.push(t);else for(let t=0;t<s.length;++t){const n=s[t];-1===WP(e).call(e,s)&&-1===WP(i).call(i,s)&&e.push(n)}i.push(t)}return n}_getConnectedId(t,e){return t.toId!=e?t.toId:(t.fromId,t.fromId)}_getHubSize(){let t=0,e=0,i=0,n=0;for(let o=0;o<this.body.nodeIndices.length;o++){const r=this.body.nodes[this.body.nodeIndices[o]];r.edges.length>n&&(n=r.edges.length),t+=r.edges.length,e+=Math.pow(r.edges.length,2),i+=1}t/=i,e/=i;const o=e-Math.pow(t,2),r=Math.sqrt(o);let s=Math.floor(t+2*r);return s>n&&(s=n),s}_createClusteredEdge(t,e,i,n,o){const r=LW.cloneOptions(i,"edge");KF(r,n),r.from=t,r.to=e,r.id="clusterEdge:"+RW(),void 0!==o&&KF(r,o);const s=this.body.functions.createEdge(r);return s.clusteringEdgeReplacingIds=[i.id],s.connect(),this.body.edges[s.id]=s,s}_clusterEdges(t,e,i,n){if(e instanceof CW){const t=e,i={};i[t.id]=t,e=i}if(t instanceof WH){const e=t,i={};i[e.id]=e,t=i}if(null==i)throw new Error("_clusterEdges: parameter clusterNode required");void 0===n&&(n=i.clusterEdgeProperties),this._createClusterEdges(t,e,i,n);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&void 0!==this.body.edges[t]){const e=this.body.edges[t];this._backupEdgeOptions(e),e.setOptions({physics:!1})}for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.clusteredNodes[e]={clusterId:i.id,node:this.body.nodes[e]},this.body.nodes[e].setOptions({physics:!1}))}_getClusterNodeForNode(t){if(void 0===t)return;const e=this.clusteredNodes[t];if(void 0===e)return;const i=e.clusterId;return void 0!==i?this.body.nodes[i]:void 0}_filter(t,e){const i=[];return $F(t,t=>{e(t)&&i.push(t)}),i}_updateState(){let t;const e=[],i={},n=t=>{$F(this.body.nodes,e=>{!0===e.isCluster&&t(e)})};for(t in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,t))continue;void 0===this.body.nodes[t]&&e.push(t)}n(function(t){for(let i=0;i<e.length;i++)delete t.containedNodes[e[i]]});for(let t=0;t<e.length;t++)delete this.clusteredNodes[e[t]];$F(this.clusteredEdges,t=>{const e=this.body.edges[t];void 0!==e&&e.endPointsValid()||(i[t]=t)}),n(function(t){$F(t.containedEdges,(t,e)=>{t.endPointsValid()||i[e]||(i[e]=e)})}),$F(this.body.edges,(t,e)=>{let n=!0;const o=t.clusteringEdgeReplacingIds;if(void 0!==o){let t=0;$F(o,e=>{const i=this.body.edges[e];void 0!==i&&i.endPointsValid()&&(t+=1)}),n=t>0}t.endPointsValid()&&n||(i[e]=e)}),n(t=>{$F(i,e=>{delete t.containedEdges[e],$F(t.edges,(n,o)=>{n.id!==e?n.clusteringEdgeReplacingIds=this._filter(n.clusteringEdgeReplacingIds,function(t){return!i[t]}):t.edges[o]=null}),t.edges=this._filter(t.edges,function(t){return null!==t})})}),$F(i,t=>{delete this.clusteredEdges[t]}),$F(i,t=>{delete this.body.edges[t]});$F(Ck(this.body.edges),t=>{const e=this.body.edges[t],i=this._isClusteredNode(e.fromId)||this._isClusteredNode(e.toId);if(i!==this._isClusteredEdge(e.id))if(i){const t=this._getClusterNodeForNode(e.fromId);void 0!==t&&this._clusterEdges(this.body.nodes[e.fromId],e,t);const i=this._getClusterNodeForNode(e.toId);void 0!==i&&this._clusterEdges(this.body.nodes[e.toId],e,i)}else delete this._clusterEdges[t],this._restoreEdge(e)});let o=!1,r=!0;for(;r;){const t=[];n(function(e){const i=Ck(e.containedNodes).length,n=!0===e.options.allowSingleNodeCluster;(n&&i<1||!n&&i<2)&&t.push(e.id)});for(let e=0;e<t.length;++e)this.openCluster(t[e],{},!1);r=t.length>0,o=o||r}o&&this._updateState()}_isClusteredNode(t){return void 0!==this.clusteredNodes[t]}_isClusteredEdge(t){return void 0!==this.clusteredEdges[t]}}class qW{constructor(t,e){this.body=t,this.canvas=e,this.redrawRequested=!1,this.requestAnimationFrameRequestId=void 0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},ME(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var t;this.body.emitter.on("dragStart",()=>{this.dragging=!0}),this.body.emitter.on("dragEnd",()=>{this.dragging=!1}),this.body.emitter.on("zoom",()=>{this.zooming=!0,window.clearTimeout(this.zoomTimeoutId),this.zoomTimeoutId=VM(()=>{var t;this.zooming=!1,LE(t=this._requestRedraw).call(t,this)()},250)}),this.body.emitter.on("_resizeNodes",()=>{this._resizeNodes()}),this.body.emitter.on("_redraw",()=>{!1===this.renderingActive&&this._redraw()}),this.body.emitter.on("_blockRedraw",()=>{this.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",()=>{this.allowRedraw=!0,this.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",LE(t=this._requestRedraw).call(t,this)),this.body.emitter.on("_startRendering",()=>{this.renderRequests+=1,this.renderingActive=!0,this._startRendering()}),this.body.emitter.on("_stopRendering",()=>{this.renderRequests-=1,this.renderingActive=this.renderRequests>0,this.requestAnimationFrameRequestId=void 0}),this.body.emitter.on("destroy",()=>{this.renderRequests=0,this.allowRedraw=!1,this.renderingActive=!1,window.cancelAnimationFrame(this.requestAnimationFrameRequestId),this.body.emitter.off()})}setOptions(t){if(void 0!==t){XF(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,t)}}_startRendering(){var t;!0===this.renderingActive&&(void 0===this.requestAnimationFrameRequestId&&(this.requestAnimationFrameRequestId=window.requestAnimationFrame(LE(t=this._renderStep).call(t,this),this.simulationInterval)))}_renderStep(){!0===this.renderingActive&&(this.requestAnimationFrameRequestId=void 0,this._startRendering(),this._redraw())}redraw(){this.body.emitter.emit("setSize"),this._redraw()}_requestRedraw(){!0!==this.redrawRequested&&!1===this.renderingActive&&!0===this.allowRedraw&&(this.redrawRequested=!0,window.requestAnimationFrame(()=>{this._redraw(!1)}))}_redraw(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!0===this.allowRedraw){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;const e={drawExternalLabels:null};0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),this.canvas.setTransform();const 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){const{drawExternalLabels:n}=this._drawNodes(i,t);e.drawExternalLabels=n}!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)}}_resizeNodes(){this.canvas.setTransform();const 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);const e=this.body.nodes;let i;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i=e[n],i.resize(t),i.updateBoundingBox(t,i.selected));t.restore()}_drawNodes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=this.body.nodes,n=this.body.nodeIndices;let o;const r=[],s=[],a=this.canvas.DOMtoCanvas({x:-20,y:-20}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+20,y:this.canvas.frame.canvas.clientHeight+20}),d={top:a.y,left:a.x,bottom:h.y,right:h.x},c=[];for(let a=0;a<n.length;a++)if(o=i[n[a]],o.hover)s.push(n[a]);else if(o.isSelected())r.push(n[a]);else if(!0===e){const e=o.draw(t);null!=e.drawExternalLabel&&c.push(e.drawExternalLabel)}else if(!0===o.isBoundingBoxOverlappingWith(d)){const e=o.draw(t);null!=e.drawExternalLabel&&c.push(e.drawExternalLabel)}else o.updateBoundingBox(t,o.selected);let l;const u=r.length,f=s.length;for(l=0;l<u;l++){o=i[r[l]];const e=o.draw(t);null!=e.drawExternalLabel&&c.push(e.drawExternalLabel)}for(l=0;l<f;l++){o=i[s[l]];const e=o.draw(t);null!=e.drawExternalLabel&&c.push(e.drawExternalLabel)}return{drawExternalLabels:()=>{for(const t of c)t()}}}_drawEdges(t){const e=this.body.edges,i=this.body.edgeIndices;for(let n=0;n<i.length;n++){const o=e[i[n]];!0===o.connected&&o.draw(t)}}_drawArrows(t){const e=this.body.edges,i=this.body.edgeIndices;for(let n=0;n<i.length;n++){const o=e[i[n]];!0===o.connected&&o.drawArrows(t)}}_drawSelectionBox(t){if(this.body.selectionBox.show){t.beginPath();const e=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,i=this.body.selectionBox.position.end.y-this.body.selectionBox.position.start.y;t.rect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,e,i),t.fillStyle="rgba(151, 194, 252, 0.2)",t.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,e,i),t.strokeStyle="rgba(151, 194, 252, 1)",t.stroke()}else t.closePath()}}var VW,UW,YW,XW;function GW(){return UW?VW:(UW=1,PM(),VW=d_().setInterval)}var KW=Rb(XW?YW:(XW=1,YW=GW()));function ZW(t,e){e.inputHandler=function(t){t.isFirst&&e(t)},t.on("hammer.input",e.inputHandler)}function QW(t,e){return e.inputHandler=function(t){t.isFinal&&e(t)},t.on("hammer.input",e.inputHandler)}class JW{constructor(t){this.body=t,this.pixelRatio=1,this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this._cleanupCallbacks=[],this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},ME(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var t;this.body.emitter.once("resize",t=>{0!==t.width&&(this.body.view.translation.x=.5*t.width),0!==t.height&&(this.body.view.translation.y=.5*t.height)}),this.body.emitter.on("setSize",LE(t=this.setSize).call(t,this)),this.body.emitter.on("destroy",()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()})}setOptions(t){if(void 0!==t){XF(["width","height","autoResize"],this.options,t)}if(this._cleanUp(),!0===this.options.autoResize){var e;if(window.ResizeObserver){const t=new ResizeObserver(()=>{!0===this.setSize()&&this.body.emitter.emit("_requestRedraw")}),{frame:e}=this;t.observe(e),this._cleanupCallbacks.push(()=>{t.unobserve(e)})}else{const t=KW(()=>{!0===this.setSize()&&this.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(()=>{clearInterval(t)})}const t=LE(e=this._onResize).call(e,this);window.addEventListener("resize",t),this._cleanupCallbacks.push(()=>{window.removeEventListener("resize",t)})}}_cleanUp(){var t,e,i;rD(t=ED(e=ND(i=this._cleanupCallbacks).call(i,0)).call(e)).call(t,t=>{try{t()}catch(t){console.error(t)}})}_onResize(){this.setSize(),this.body.emitter.emit("_redraw")}_getCameraState(){let t=arguments.length>0&&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}))}_setCameraState(){if(void 0!==this.cameraState.scale&&0!==this.frame.canvas.clientWidth&&0!==this.frame.canvas.clientHeight&&0!==this.pixelRatio&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){const t=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,e=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight;let 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;const 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}}_prepareValue(t){if("number"==typeof t)return t+"px";if("string"==typeof t){if(-1!==WP(t).call(t,"%")||-1!==WP(t).call(t,"px"))return t;if(-1===WP(t).call(t,"%"))return t+"px"}throw new Error("Could not use the value supplied for width or height:"+t)}_create(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=0,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{const 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()}_bindHammer(){void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new _z(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:_z.DIRECTION_ALL}),ZW(this.hammer,t=>{this.body.eventListeners.onTouch(t)}),this.hammer.on("tap",t=>{this.body.eventListeners.onTap(t)}),this.hammer.on("doubletap",t=>{this.body.eventListeners.onDoubleTap(t)}),this.hammer.on("press",t=>{this.body.eventListeners.onHold(t)}),this.hammer.on("panstart",t=>{this.body.eventListeners.onDragStart(t)}),this.hammer.on("panmove",t=>{this.body.eventListeners.onDrag(t)}),this.hammer.on("panend",t=>{this.body.eventListeners.onDragEnd(t)}),this.hammer.on("pinch",t=>{this.body.eventListeners.onPinch(t)}),this.frame.canvas.addEventListener("wheel",t=>{this.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("mousemove",t=>{this.body.eventListeners.onMouseMove(t)}),this.frame.canvas.addEventListener("contextmenu",t=>{this.body.eventListeners.onContext(t)}),this.hammerFrame=new _z(this.frame),QW(this.hammerFrame,t=>{this.body.eventListeners.onRelease(t)})}setSize(){let 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);let i=!1;const 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{const t=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),e=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);this.frame.canvas.width===t&&this.frame.canvas.height===e||this._getCameraState(r),this.frame.canvas.width!==t&&(this.frame.canvas.width=t,i=!0),this.frame.canvas.height!==e&&(this.frame.canvas.height=e,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}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){const t=this.getContext();if(void 0===t)throw new Error("Could not get canvax context");let e=1;"undefined"!=typeof window&&(e=window.devicePixelRatio||1);return e/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){const 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)}_XconvertDOMtoCanvas(t){return(t-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(t){return t*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(t){return(t-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(t){return t*this.body.view.scale+this.body.view.translation.y}canvasToDOM(t){return{x:this._XconvertCanvasToDOM(t.x),y:this._YconvertCanvasToDOM(t.y)}}DOMtoCanvas(t){return{x:this._XconvertDOMtoCanvas(t.x),y:this._YconvertDOMtoCanvas(t.y)}}}class $W{constructor(t,e){var i,n;this.body=t,this.canvas=e,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",LE(i=this.fit).call(i,this)),this.body.emitter.on("animationFinished",()=>{this.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",LE(n=this.releaseNode).call(n,this))}setOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t}fit(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t=function(t,e){const i=ME({nodes:e,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},null!=t?t:{});if(!nk(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);const i=this.canvas.frame.canvas.clientWidth,n=this.canvas.frame.canvas.clientHeight;let o,r;if(0===i||0===n)r=1,o=LW.getRange(this.body.nodes,t.nodes);else if(!0===e){let e=0;for(const t in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,t)){!0===this.body.nodes[t].predefinedPosition&&(e+=1)}if(e>.5*this.body.nodeIndices.length)return void this.fit(t,!1);o=LW.getRange(this.body.nodes,t.nodes);r=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;r*=Math.min(i/600,n/600)}else{this.body.emitter.emit("_resizeNodes"),o=LW.getRange(this.body.nodes,t.nodes);const e=i/(1.1*Math.abs(o.maxX-o.minX)),s=n/(1.1*Math.abs(o.maxY-o.minY));r=e<=s?e:s}r>t.maxZoomLevel?r=t.maxZoomLevel:r<t.minZoomLevel&&(r=t.minZoomLevel);const s={position:LW.findCenter(o),scale:r,animation:t.animation};this.moveTo(s)}focus(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==this.body.nodes[t]){const 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.")}moveTo(t){if(void 0!==t){if(null!=t.offset){if(null!=t.offset.x){if(t.offset.x=+t.offset.x,!ZB(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,!ZB(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,!ZB(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,!ZB(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={}}animateView(t){if(void 0===t)return;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;const e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i=e.x-t.position.x,n=e.y-t.position.y;var o,r;(this.targetTranslation={x:this.sourceTranslation.x+i*this.targetScale+t.offset.x,y:this.sourceTranslation.y+n*this.targetScale+t.offset.y},0===t.animation.duration)?null!=this.lockedOnNodeId?(this.viewFunction=LE(o=this._lockedRedraw).call(o,this),this.body.emitter.on("initRedraw",this.viewFunction)):(this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw")):(this.animationSpeed=1/(60*t.animation.duration*.001)||1/60,this.animationEasingFunction=t.animation.easingFunction,this.viewFunction=LE(r=this._transitionRedraw).call(r,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))}_lockedRedraw(){const 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}releaseNode(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}_transitionRedraw(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=!0===t?1:this.easingTime;const e=lz[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=LE(i=this._lockedRedraw).call(i,this),this.body.emitter.on("initRedraw",this.viewFunction);this.body.emitter.emit("animationFinished")}}getScale(){return this.body.view.scale}getViewPosition(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}function tq(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){d(t,"keydown")},h=function(t){d(t,"keyup")},d=function(t,e){if(void 0!==r[e][t.keyCode]){for(var n=r[e][t.keyCode],o=0;o<n.length;o++)(void 0===n[o].shift||1==n[o].shift&&1==t.shiftKey||0==n[o].shift&&0==t.shiftKey)&&n[o].fn(t);1==i&&t.preventDefault()}};return o.bind=function(t,e,i){if(void 0===i&&(i="keydown"),void 0===s[t])throw new Error("unsupported key: "+t);void 0===r[i][s[t].code]&&(r[i][s[t].code]=[]),r[i][s[t].code].push({fn:e,shift:s[t].shift})},o.bindAll=function(t,e){for(var i in void 0===e&&(e="keydown"),s)s.hasOwnProperty(i)&&o.bind(i,t,e)},o.getKey=function(t){for(var e in s)if(s.hasOwnProperty(e)){if(1==t.shiftKey&&1==s[e].shift&&t.keyCode==s[e].code)return e;if(0==t.shiftKey&&0==s[e].shift&&t.keyCode==s[e].code)return e;if(t.keyCode==s[e].code&&"shift"==e)return e}return"unknown key, currently not supported"},o.unbind=function(t,e,i){if(void 0===i&&(i="keydown"),void 0===s[t])throw new Error("unsupported key: "+t);if(void 0!==e){var n=[],o=r[i][s[t].code];if(void 0!==o)for(var a=0;a<o.length;a++)o[a].fn==e&&o[a].shift==s[t].shift||n.push(r[i][s[t].code][a]);r[i][s[t].code]=n}else r[i][s[t].code]=[]},o.reset=function(){r={keydown:{},keyup:{}}},o.destroy=function(){r={keydown:{},keyup:{}},n.removeEventListener("keydown",a,!0),n.removeEventListener("keyup",h,!0)},n.addEventListener("keydown",a,!0),n.addEventListener("keyup",h,!0),o}class eq{constructor(t,e){this.body=t,this.canvas=e,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",()=>{this.activated=!0,this.configureKeyboardBindings()}),this.body.emitter.on("deactivate",()=>{this.activated=!1,this.configureKeyboardBindings()}),this.body.emitter.on("destroy",()=>{void 0!==this.keycharm&&this.keycharm.destroy()}),this.options={}}setOptions(t){void 0!==t&&(this.options=t,this.create())}create(){!0===this.options.navigationButtons?!1===this.iconsCreated&&this.loadNavigationElements():!0===this.iconsCreated&&this.cleanNavigation(),this.configureKeyboardBindings()}cleanNavigation(){if(0!=this.navigationHammers.length){for(let t=0;t<this.navigationHammers.length;t++)this.navigationHammers[t].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}loadNavigationElements(){this.cleanNavigation(),this.navigationDOM={};const t=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],e=["_moveUp","_moveDown","_moveLeft","_moveRight","_zoomIn","_zoomOut","_fit"];this.navigationDOM.wrapper=document.createElement("div"),this.navigationDOM.wrapper.className="vis-navigation",this.canvas.frame.appendChild(this.navigationDOM.wrapper);for(let o=0;o<t.length;o++){this.navigationDOM[t[o]]=document.createElement("div"),this.navigationDOM[t[o]].className="vis-button vis-"+t[o],this.navigationDOM.wrapper.appendChild(this.navigationDOM[t[o]]);const r=new _z(this.navigationDOM[t[o]]);var i,n;if("_fit"===e[o])ZW(r,LE(i=this._fit).call(i,this));else ZW(r,LE(n=this.bindToRedraw).call(n,this,e[o]));this.navigationHammers.push(r)}const o=new _z(this.canvas.frame);QW(o,()=>{this._stopMovement()}),this.navigationHammers.push(o),this.iconsCreated=!0}bindToRedraw(t){var e;void 0===this.boundFunctions[t]&&(this.boundFunctions[t]=LE(e=this[t]).call(e,this),this.body.emitter.on("initRedraw",this.boundFunctions[t]),this.body.emitter.emit("_startRendering"))}unbindFromRedraw(t){void 0!==this.boundFunctions[t]&&(this.body.emitter.off("initRedraw",this.boundFunctions[t]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[t])}_fit(){(new Date).valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=(new Date).valueOf())}_stopMovement(){for(const 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={}}_moveUp(){this.body.view.translation.y+=this.options.keyboard.speed.y}_moveDown(){this.body.view.translation.y-=this.options.keyboard.speed.y}_moveLeft(){this.body.view.translation.x+=this.options.keyboard.speed.x}_moveRight(){this.body.view.translation.x-=this.options.keyboard.speed.x}_zoomIn(){const 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})}_zoomOut(){const 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})}configureKeyboardBindings(){var t,e,i,n,o,r,s,a,h,d,c,l,u,f,p,g,v,m,y,b,w,_,x,E;(void 0!==this.keycharm&&this.keycharm.destroy(),!0===this.options.keyboard.enabled)&&(!0===this.options.keyboard.bindToWindow?this.keycharm=tq({container:window,preventDefault:!0}):this.keycharm=tq({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),!0===this.activated&&(LE(t=this.keycharm).call(t,"up",()=>{this.bindToRedraw("_moveUp")},"keydown"),LE(e=this.keycharm).call(e,"down",()=>{this.bindToRedraw("_moveDown")},"keydown"),LE(i=this.keycharm).call(i,"left",()=>{this.bindToRedraw("_moveLeft")},"keydown"),LE(n=this.keycharm).call(n,"right",()=>{this.bindToRedraw("_moveRight")},"keydown"),LE(o=this.keycharm).call(o,"=",()=>{this.bindToRedraw("_zoomIn")},"keydown"),LE(r=this.keycharm).call(r,"num+",()=>{this.bindToRedraw("_zoomIn")},"keydown"),LE(s=this.keycharm).call(s,"num-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),LE(a=this.keycharm).call(a,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),LE(h=this.keycharm).call(h,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),LE(d=this.keycharm).call(d,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),LE(c=this.keycharm).call(c,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),LE(l=this.keycharm).call(l,"pagedown",()=>{this.bindToRedraw("_zoomOut")},"keydown"),LE(u=this.keycharm).call(u,"up",()=>{this.unbindFromRedraw("_moveUp")},"keyup"),LE(f=this.keycharm).call(f,"down",()=>{this.unbindFromRedraw("_moveDown")},"keyup"),LE(p=this.keycharm).call(p,"left",()=>{this.unbindFromRedraw("_moveLeft")},"keyup"),LE(g=this.keycharm).call(g,"right",()=>{this.unbindFromRedraw("_moveRight")},"keyup"),LE(v=this.keycharm).call(v,"=",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),LE(m=this.keycharm).call(m,"num+",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),LE(y=this.keycharm).call(y,"num-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),LE(b=this.keycharm).call(b,"-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),LE(w=this.keycharm).call(w,"[",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),LE(_=this.keycharm).call(_,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),LE(x=this.keycharm).call(x,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),LE(E=this.keycharm).call(E,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")))}}class iq{constructor(t,e,i){var n,o,r,s,a,h,d,c,l,u,f,p,g;this.body=t,this.canvas=e,this.selectionHandler=i,this.navigationHandler=new eq(t,e),this.body.eventListeners.onTap=LE(n=this.onTap).call(n,this),this.body.eventListeners.onTouch=LE(o=this.onTouch).call(o,this),this.body.eventListeners.onDoubleTap=LE(r=this.onDoubleTap).call(r,this),this.body.eventListeners.onHold=LE(s=this.onHold).call(s,this),this.body.eventListeners.onDragStart=LE(a=this.onDragStart).call(a,this),this.body.eventListeners.onDrag=LE(h=this.onDrag).call(h,this),this.body.eventListeners.onDragEnd=LE(d=this.onDragEnd).call(d,this),this.body.eventListeners.onMouseWheel=LE(c=this.onMouseWheel).call(c,this),this.body.eventListeners.onPinch=LE(l=this.onPinch).call(l,this),this.body.eventListeners.onMouseMove=LE(u=this.onMouseMove).call(u,this),this.body.eventListeners.onRelease=LE(f=this.onRelease).call(f,this),this.body.eventListeners.onContext=LE(p=this.onContext).call(p,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=LE(g=this.getPointer).call(g,this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0,autoFocus:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0,zoomSpeed:1},ME(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("destroy",()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer})}setOptions(t){if(void 0!==t){GF(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,t),cz(this.options,t,"keyboard"),t.tooltip&&(ME(this.options.tooltip,t.tooltip),t.tooltip.color&&(this.options.tooltip.color=nz(t.tooltip.color)))}this.navigationHandler.setOptions(this.options)}getPointer(t){return{x:t.x-(e=this.canvas.frame.canvas,e.getBoundingClientRect().left),y:t.y-JF(this.canvas.frame.canvas)};var e}onTouch(t){(new Date).valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(t.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}onTap(t){const 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)}onDoubleTap(t){const e=this.getPointer(t.center);this.selectionHandler.generateClickEvent("doubleClick",t,e)}onHold(t){const 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)}onRelease(t){if((new Date).valueOf()-this.touchTime>10){const e=this.getPointer(t.center);this.selectionHandler.generateClickEvent("release",t,e),this.touchTime=(new Date).valueOf()}}onContext(t){const e=this.getPointer({x:t.clientX,y:t.clientY});this.selectionHandler.generateClickEvent("oncontext",t,e)}checkSelectionChanges(t){!0===(arguments.length>1&&void 0!==arguments[1]&&arguments[1])?this.selectionHandler.selectAdditionalOnPoint(t):this.selectionHandler.selectOnPoint(t)}_determineDifference(t,e){const i=function(t,e){const i=[];for(let n=0;n<t.length;n++){const o=t[n];-1===WP(e).call(e,o)&&i.push(o)}return i};return{nodes:i(t.nodes,e.nodes),edges:i(t.edges,e.edges)}}onDragStart(t){if(this.drag.dragging)return;void 0===this.drag.pointer&&this.onTouch(t);const e=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=ME({},this.body.view.translation),this.drag.nodeId=void 0,t.srcEvent.shiftKey){this.body.selectionBox.show=!0;const e=this.getPointer(t.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(e.x),y:this.canvas._YconvertDOMtoCanvas(e.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(e.x),y:this.canvas._YconvertDOMtoCanvas(e.y)}}else if(void 0!==e&&!0===this.options.dragNodes){this.drag.nodeId=e.id,!1===e.isSelected()&&this.selectionHandler.setSelection({nodes:[e.id]}),this.selectionHandler.generateClickEvent("dragStart",t,this.drag.pointer);for(const t of this.selectionHandler.getSelectedNodes()){const e={id:t.id,node:t,x:t.x,y:t.y,xFixed:t.options.fixed.x,yFixed:t.options.fixed.y};t.options.fixed.x=!0,t.options.fixed.y=!0,this.drag.selection.push(e)}}else this.selectionHandler.generateClickEvent("dragStart",t,this.drag.pointer,void 0,!0)}onDrag(t){if(!0===this.drag.pinched)return;this.body.emitter.emit("unlockNode");const e=this.getPointer(t.center),i=this.drag.selection;if(i&&i.length&&!0===this.options.dragNodes){this.selectionHandler.generateClickEvent("dragging",t,e);const n=e.x-this.drag.pointer.x,o=e.y-this.drag.pointer.y;rD(i).call(i,t=>{const e=t.node;!1===t.xFixed&&(e.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(t.x)+n)),!1===t.yFixed&&(e.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(t.y)+o))}),this.body.emitter.emit("startSimulation")}else{if(t.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",t,e,void 0,!0),void 0===this.drag.pointer)return void this.onDragStart(t);this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(e.x),y:this.canvas._YconvertDOMtoCanvas(e.y)},this.body.emitter.emit("_requestRedraw")}if(!0===this.options.dragView&&!t.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",t,e,void 0,!0),void 0===this.drag.pointer)return void this.onDragStart(t);const i=e.x-this.drag.pointer.x,n=e.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+i,y:this.drag.translation.y+n},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(t){if(this.drag.dragging=!1,this.body.selectionBox.show){var e;this.body.selectionBox.show=!1;const i=this.body.selectionBox.position,n={minX:Math.min(i.start.x,i.end.x),minY:Math.min(i.start.y,i.end.y),maxX:Math.max(i.start.x,i.end.x),maxY:Math.max(i.start.y,i.end.y)},o=ZI(e=this.body.nodeIndices).call(e,t=>{const e=this.body.nodes[t];return e.x>=n.minX&&e.x<=n.maxX&&e.y>=n.minY&&e.y<=n.maxY});rD(o).call(o,t=>this.selectionHandler.selectObject(this.body.nodes[t]));const r=this.getPointer(t.center);this.selectionHandler.commitAndEmit(r,t),this.selectionHandler.generateClickEvent("dragEnd",t,this.getPointer(t.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{const e=this.drag.selection;e&&e.length?(rD(e).call(e,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"))}}onPinch(t){const e=this.getPointer(t.center);this.drag.pinched=!0,void 0===this.pinch.scale&&(this.pinch.scale=1);const i=this.pinch.scale*t.scale;this.zoom(i,e)}zoom(t,e){if(!0===this.options.zoomView){const i=this.body.view.scale;let n;t<1e-5&&(t=1e-5),t>10&&(t=10),void 0!==this.drag&&!0===this.drag.dragging&&(n=this.canvas.DOMtoCanvas(this.drag.pointer));const 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){const t=this.canvas.canvasToDOM(n);this.drag.pointer.x=t.x,this.drag.pointer.y=t.y}this.body.emitter.emit("_requestRedraw"),i<t?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:e}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:e})}}onMouseWheel(t){if(!0===this.options.zoomView){if(0!==t.deltaY){let e=this.body.view.scale;e*=1+(t.deltaY<0?1:-1)*(.1*this.options.zoomSpeed);const i=this.getPointer({x:t.clientX,y:t.clientY});this.zoom(e,i)}t.preventDefault()}}onMouseMove(t){const e=this.getPointer({x:t.clientX,y:t.clientY});let i=!1;void 0!==this.popup&&(!1===this.popup.hidden&&this._checkHidePopup(e),!1===this.popup.hidden&&(i=!0,this.popup.setPosition(e.x+3,e.y-5),this.popup.show())),this.options.keyboard.autoFocus&&!1===this.options.keyboard.bindToWindow&&!0===this.options.keyboard.enabled&&this.canvas.frame.focus(),!1===i&&(void 0!==this.popupTimer&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=VM(()=>this._checkShowPopup(e),this.options.tooltipDelay))),!0===this.options.hover&&this.selectionHandler.hoverObject(t,e)}_checkShowPopup(t){const e=this.canvas._XconvertDOMtoCanvas(t.x),i=this.canvas._YconvertDOMtoCanvas(t.y),n={left:e,top:i,right:e,bottom:i},o=void 0===this.popupObj?void 0:this.popupObj.id;let r=!1,s="node";if(void 0===this.popupObj){const t=this.body.nodeIndices,e=this.body.nodes;let i;const o=[];for(let s=0;s<t.length;s++)i=e[t[s]],!0===i.isOverlappingWith(n)&&(r=!0,void 0!==i.getTitle()&&o.push(t[s]));o.length>0&&(this.popupObj=e[o[o.length-1]],r=!0)}if(void 0===this.popupObj&&!1===r){const t=this.body.edgeIndices,e=this.body.edges;let i;const o=[];for(let r=0;r<t.length;r++)i=e[t[r]],!0===i.isOverlappingWith(n)&&!0===i.connected&&void 0!==i.getTitle()&&o.push(t[r]);o.length>0&&(this.popupObj=e[o[o.length-1]],s="edge")}void 0!==this.popupObj?this.popupObj.id!==o&&(void 0===this.popup&&(this.popup=new xz(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"))}_checkHidePopup(t){const e=this.selectionHandler._pointerToPositionObject(t);let i=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(e),!0===i)){const e=this.selectionHandler.getNodeAt(t);i=void 0!==e&&e.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"))}}var nq,oq,rq={};function sq(){return oq||(oq=1,nq||(nq=1,VA()("Set",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},XA()))),rq}var aq,hq,dq,cq,lq,uq,fq,pq,gq,vq,mq,yq,bq,wq,_q,xq,Eq,Oq,Sq,Cq,Tq,kq={};function Dq(){if(hq)return aq;hq=1;var t=m_(),e=TypeError;return aq=function(i){if("object"==typeof i&&"size"in i&&"has"in i&&"add"in i&&"delete"in i&&"keys"in i)return i;throw new e(t(i)+" is not a set")},aq}function Iq(){if(cq)return dq;cq=1;var t=c_(),e=eB(),i=t("Set"),n=i.prototype;return dq={Set:i,add:e("add",1),has:e("has",1),remove:e("delete",1),proto:n}}function Pq(){if(uq)return lq;uq=1;var t=mw();return lq=function(e,i,n){for(var o,r,s=n?e:e.iterator,a=e.next;!(o=t(a,s)).done;)if(void 0!==(r=i(o.value)))return r},lq}function Mq(){if(pq)return fq;pq=1;var t=Pq();return fq=function(e,i,n){return n?t(e.keys(),i,!0):e.forEach(i)},fq}function Nq(){if(vq)return gq;vq=1;var t=Iq(),e=Mq(),i=t.Set,n=t.add;return gq=function(t){var o=new i;return e(t,function(t){n(o,t)}),o},gq}function Fq(){return yq||(yq=1,mq=function(t){return t.size}),mq}function zq(){return wq?bq:(wq=1,bq=function(t){return{iterator:t,next:t.next,done:!1}})}function Aq(){if(xq)return _q;xq=1;var t=y_(),e=Wx(),i=mw(),n=Xx(),o=zq(),r="Invalid size",s=RangeError,a=TypeError,h=Math.max,d=function(e,i){this.set=e,this.size=h(i,0),this.has=t(e.has),this.keys=t(e.keys)};return d.prototype={getIterator:function(){return o(e(i(this.keys,this.set)))},includes:function(t){return i(this.has,this.set,t)}},_q=function(t){e(t);var i=+t.size;if(i!=i)throw new a(r);var o=n(i);if(o<0)throw new s(r);return new d(t,o)}}function Bq(){if(Oq)return Eq;Oq=1;var t=Dq(),e=Iq(),i=Nq(),n=Fq(),o=Aq(),r=Mq(),s=Pq(),a=e.has,h=e.remove;return Eq=function(e){var d=t(this),c=o(e),l=i(d);return n(d)<=c.size?r(d,function(t){c.includes(t)&&h(l,t)}):s(c.getIterator(),function(t){a(l,t)&&h(l,t)}),l}}function jq(){return Cq?Sq:(Cq=1,Sq=function(){return!1})}var Rq,Lq,Hq,Wq={};function qq(){if(Lq)return Rq;Lq=1;var t=Dq(),e=Iq(),i=Fq(),n=Aq(),o=Mq(),r=Pq(),s=e.Set,a=e.add,h=e.has;return Rq=function(e){var d=t(this),c=n(e),l=new s;return i(d)>c.size?r(c.getIterator(),function(t){h(d,t)&&a(l,t)}):o(d,function(t){c.includes(t)&&a(l,t)}),l}}var Vq,Uq,Yq,Xq={};function Gq(){if(Uq)return Vq;Uq=1;var t=Dq(),e=Iq().has,i=Fq(),n=Aq(),o=Mq(),r=Pq(),s=HA();return Vq=function(a){var h=t(this),d=n(a);if(i(h)<=d.size)return!1!==o(h,function(t){if(d.includes(t))return!1},!0);var c=d.getIterator();return!1!==r(c,function(t){if(e(h,t))return s(c,"normal",!1)})},Vq}var Kq,Zq,Qq,Jq={};function $q(){if(Zq)return Kq;Zq=1;var t=Dq(),e=Fq(),i=Mq(),n=Aq();return Kq=function(o){var r=t(this),s=n(o);return!(e(r)>s.size)&&!1!==i(r,function(t){if(!s.includes(t))return!1},!0)}}var tV,eV,iV,nV={};function oV(){if(eV)return tV;eV=1;var t=Dq(),e=Iq().has,i=Fq(),n=Aq(),o=Pq(),r=HA();return tV=function(s){var a=t(this),h=n(s);if(i(a)<h.size)return!1;var d=h.getIterator();return!1!==o(d,function(t){if(!e(a,t))return r(d,"normal",!1)})},tV}var rV,sV,aV,hV,dV,cV={};function lV(){if(sV)return rV;sV=1;var t=Dq(),e=Iq(),i=Nq(),n=Aq(),o=Pq(),r=e.add,s=e.has,a=e.remove;return rV=function(e){var h=t(this),d=n(e).getIterator(),c=i(h);return o(d,function(t){s(h,t)?a(c,t):r(c,t)}),c}}function uV(){return hV?aV:(hV=1,aV=function(t){try{var e=new Set,i={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return e.clear(),e.add(4),function(){return{done:!0}}}})}},n=e[t](i);return 1===n.size&&4===n.values().next().value}catch(t){return!1}})}var fV,pV,gV,vV,mV,yV,bV,wV,_V,xV={};function EV(){if(pV)return fV;pV=1;var t=Dq(),e=Iq().add,i=Nq(),n=Aq(),o=Pq();return fV=function(r){var s=t(this),a=n(r).getIterator(),h=i(s);return o(a,function(t){e(h,t)}),h},fV}function OV(){return mV?vV:(mV=1,mT(),sq(),function(){if(Tq)return kq;Tq=1;var t=Ux(),e=Bq(),i=ow(),n=!jq()("difference",function(t){return 0===t.size})||i(function(){var t={size:1,has:function(){return!0},keys:function(){var t=0;return{next:function(){var i=t++>1;return e.has(1)&&e.clear(),{done:i,value:2}}}}},e=new Set([1,2,3,4]);return 3!==e.difference(t).size});t({target:"Set",proto:!0,real:!0,forced:n},{difference:e})}(),function(){if(Hq)return Wq;Hq=1;var t=Ux(),e=ow(),i=qq();t({target:"Set",proto:!0,real:!0,forced:!jq()("intersection",function(t){return 2===t.size&&t.has(1)&&t.has(2)})||e(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:i})}(),function(){if(Yq)return Xq;Yq=1;var t=Ux(),e=Gq();t({target:"Set",proto:!0,real:!0,forced:!jq()("isDisjointFrom",function(t){return!t})},{isDisjointFrom:e})}(),function(){if(Qq)return Jq;Qq=1;var t=Ux(),e=$q();t({target:"Set",proto:!0,real:!0,forced:!jq()("isSubsetOf",function(t){return t})},{isSubsetOf:e})}(),function(){if(iV)return nV;iV=1;var t=Ux(),e=oV();t({target:"Set",proto:!0,real:!0,forced:!jq()("isSupersetOf",function(t){return!t})},{isSupersetOf:e})}(),function(){if(dV)return cV;dV=1;var t=Ux(),e=lV(),i=uV();t({target:"Set",proto:!0,real:!0,forced:!jq()("symmetricDifference")||!i("symmetricDifference")},{symmetricDifference:e})}(),function(){if(gV)return xV;gV=1;var t=Ux(),e=EV(),i=uV();t({target:"Set",proto:!0,real:!0,forced:!jq()("union")||!i("union")},{union:e})}(),pB(),vV=d_().Set)}function SV(){if(bV)return yV;bV=1;var t=OV();return bT(),yV=t}var CV,TV,kV,DV,IV,PV,MV,NV,FV,zV,AV=Rb(_V?wV:(_V=1,wV=SV())),BV={},jV={};function RV(){if(TV)return CV;TV=1;var t=aw(),e=UA(),i=BA().getWeakData,n=qA(),o=Wx(),r=r_(),s=h_(),a=WA(),h=DS(),d=ex(),c=kS(),l=c.set,u=c.getterFor,f=h.find,p=h.findIndex,g=t([].splice),v=0,m=function(t){return t.frozen||(t.frozen=new y)},y=function(){this.entries=[]},b=function(t,e){return f(t.entries,function(t){return t[0]===e})};return y.prototype={get:function(t){var e=b(this,t);if(e)return e[1]},has:function(t){return!!b(this,t)},set:function(t,e){var i=b(this,t);i?i[1]=e:this.entries.push([t,e])},delete:function(t){var e=p(this.entries,function(e){return e[0]===t});return~e&&g(this.entries,e,1),!!~e}},CV={getConstructor:function(t,h,c,f){var p=t(function(t,e){n(t,g),l(t,{type:h,id:v++,frozen:null}),r(e)||a(e,t[f],{that:t,AS_ENTRIES:c})}),g=p.prototype,y=u(h),b=function(t,e,n){var r=y(t),s=i(o(e),!0);return!0===s?m(r).set(e,n):s[r.id]=n,t};return e(g,{delete:function(t){var e=y(this);if(!s(t))return!1;var n=i(t);return!0===n?m(e).delete(t):n&&d(n,e.id)&&delete n[e.id]},has:function(t){var e=y(this);if(!s(t))return!1;var n=i(t);return!0===n?m(e).has(t):n&&d(n,e.id)}}),e(g,c?{get:function(t){var e=y(this);if(s(t)){var n=i(t);if(!0===n)return m(e).get(t);if(n)return n[e.id]}},set:function(t,e){return b(this,t,e)}}:{add:function(t){return b(this,t,!0)}}),p}},CV}function LV(){return DV||(DV=1,function(){if(kV)return jV;kV=1;var t,e=AA(),i=nw(),n=aw(),o=UA(),r=BA(),s=VA(),a=RV(),h=h_(),d=kS().enforce,c=ow(),l=TS(),u=Object,f=Array.isArray,p=u.isExtensible,g=u.isFrozen,v=u.isSealed,m=u.freeze,y=u.seal,b=!i.ActiveXObject&&"ActiveXObject"in i,w=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},_=s("WeakMap",w,a),x=_.prototype,E=n(x.set);if(l)if(b){t=a.getConstructor(w,"WeakMap",!0),r.enable();var O=n(x.delete),S=n(x.has),C=n(x.get);o(x,{delete:function(e){if(h(e)&&!p(e)){var i=d(this);return i.frozen||(i.frozen=new t),O(this,e)||i.frozen.delete(e)}return O(this,e)},has:function(e){if(h(e)&&!p(e)){var i=d(this);return i.frozen||(i.frozen=new t),S(this,e)||i.frozen.has(e)}return S(this,e)},get:function(e){if(h(e)&&!p(e)){var i=d(this);return i.frozen||(i.frozen=new t),S(this,e)?C(this,e):i.frozen.get(e)}return C(this,e)},set:function(e,i){if(h(e)&&!p(e)){var n=d(this);n.frozen||(n.frozen=new t),S(this,e)?E(this,e,i):n.frozen.set(e,i)}else E(this,e,i);return this}})}else e&&c(function(){var t=m([]);return E(new _,t,1),!g(t)})&&o(x,{set:function(t,e){var i;return f(t)&&(g(t)?i=m:v(t)&&(i=y)),E(this,t,e),i&&i(t),this}})}()),BV}function HV(){return PV?IV:(PV=1,mT(),LV(),IV=d_().WeakMap)}function WV(){if(NV)return MV;NV=1;var t=HV();return bT(),MV=t}var qV=Rb(zV?FV:(zV=1,FV=WV()));function VV(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function UV(t,e,i){return t.set(XV(t,e),i),i}function YV(t,e){return t.get(XV(t,e))}function XV(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}function GV(t,e){const i=new AV;for(const n of e)t.has(n)||i.add(n);return i}var KV=new qV,ZV=new qV;class QV{constructor(){VV(this,KV,new AV),VV(this,ZV,new AV)}get size(){return YV(ZV,this).size}add(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];for(const t of e)YV(ZV,this).add(t)}delete(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];for(const t of e)YV(ZV,this).delete(t)}clear(){YV(ZV,this).clear()}getSelection(){return[...YV(ZV,this)]}getChanges(){return{added:[...GV(YV(KV,this),YV(ZV,this))],deleted:[...GV(YV(ZV,this),YV(KV,this))],previous:[...new AV(YV(KV,this))],current:[...new AV(YV(ZV,this))]}}commit(){const t=this.getChanges();UV(KV,this,YV(ZV,this)),UV(ZV,this,new AV(YV(KV,this)));for(const e of t.added)e.select();for(const e of t.deleted)e.unselect();return t}}var JV=new qV,$V=new qV,tU=new qV;class eU{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{};VV(this,JV,new QV),VV(this,$V,new QV),VV(this,tU,void 0),UV(tU,this,t)}get sizeNodes(){return YV(JV,this).size}get sizeEdges(){return YV($V,this).size}getNodes(){return YV(JV,this).getSelection()}getEdges(){return YV($V,this).getSelection()}addNodes(){YV(JV,this).add(...arguments)}addEdges(){YV($V,this).add(...arguments)}deleteNodes(t){YV(JV,this).delete(t)}deleteEdges(t){YV($V,this).delete(t)}clear(){YV(JV,this).clear(),YV($V,this).clear()}commit(){const t={nodes:YV(JV,this).commit(),edges:YV($V,this).commit()};for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return YV(tU,this).call(this,t,...i),t}}class iU{constructor(t,e){this.body=t,this.canvas=e,this._selectionAccumulator=new eU,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},ME(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",()=>{this.updateSelection()})}setOptions(t){if(void 0!==t){XF(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,t)}}selectOnPoint(t){let e=!1;if(!0===this.options.selectable){const i=this.getNodeAt(t)||this.getEdgeAt(t);this.unselectAll(),void 0!==i&&(e=this.selectObject(i)),this.body.emitter.emit("_requestRedraw")}return e}selectAdditionalOnPoint(t){let e=!1;if(!0===this.options.selectable){const i=this.getNodeAt(t)||this.getEdgeAt(t);void 0!==i&&(e=!0,!0===i.isSelected()?this.deselectObject(i):this.selectObject(i),this.body.emitter.emit("_requestRedraw"))}return e}_initBaseEvent(t,e){const i={};return i.pointer={DOM:{x:e.x,y:e.y},canvas:this.canvas.DOMtoCanvas(e)},i.event=t,i}generateClickEvent(t,e,i,n){let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const r=this._initBaseEvent(e,i);if(!0===o)r.nodes=[],r.edges=[];else{const t=this.getSelection();r.nodes=t.nodes,r.edges=t.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)}selectObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.selectConnectedEdges;return void 0!==t&&(t instanceof WH?(!0===e&&this._selectionAccumulator.addEdges(...t.edges),this._selectionAccumulator.addNodes(t)):this._selectionAccumulator.addEdges(t),!0)}deselectObject(t){!0===t.isSelected()&&(t.selected=!1,this._removeFromSelection(t))}_getAllNodesOverlappingWith(t){const e=[],i=this.body.nodes;for(let n=0;n<this.body.nodeIndices.length;n++){const o=this.body.nodeIndices[n];i[o].isOverlappingWith(t)&&e.push(o)}return e}_pointerToPositionObject(t){const e=this.canvas.DOMtoCanvas(t);return{left:e.x-1,top:e.y+1,right:e.x+1,bottom:e.y-1}}getNodeAt(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const 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}_getEdgesOverlappingWith(t,e){const i=this.body.edges;for(let n=0;n<this.body.edgeIndices.length;n++){const o=this.body.edgeIndices[n];i[o].isOverlappingWith(t)&&e.push(o)}}_getAllEdgesOverlappingWith(t){const e=[];return this._getEdgesOverlappingWith(t,e),e}getEdgeAt(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=this.canvas.DOMtoCanvas(t);let n=10,o=null;const r=this.body.edges;for(let t=0;t<this.body.edgeIndices.length;t++){const e=this.body.edgeIndices[t],s=r[e];if(s.connected){const t=s.from.x,r=s.from.y,a=s.to.x,h=s.to.y,d=s.edgeType.getDistanceToEdge(t,r,a,h,i.x,i.y);d<n&&(o=e,n=d)}}return null!==o?!0===e?this.body.edges[o]:o:void 0}_addToHover(t){t instanceof WH?this.hoverObj.nodes[t.id]=t:this.hoverObj.edges[t.id]=t}_removeFromSelection(t){t instanceof WH?(this._selectionAccumulator.deleteNodes(t),this._selectionAccumulator.deleteEdges(...t.edges)):this._selectionAccumulator.deleteEdges(t)}unselectAll(){this._selectionAccumulator.clear()}getSelectedNodeCount(){return this._selectionAccumulator.sizeNodes}getSelectedEdgeCount(){return this._selectionAccumulator.sizeEdges}_hoverConnectedEdges(t){for(let e=0;e<t.edges.length;e++){const i=t.edges[e];i.hover=!0,this._addToHover(i)}}emitBlurEvent(t,e,i){const n=this._initBaseEvent(t,e);!0===i.hover&&(i.hover=!1,i instanceof WH?(n.node=i.id,this.body.emitter.emit("blurNode",n)):(n.edge=i.id,this.body.emitter.emit("blurEdge",n)))}emitHoverEvent(t,e,i){const n=this._initBaseEvent(t,e);let o=!1;return!1===i.hover&&(i.hover=!0,this._addToHover(i),o=!0,i instanceof WH?(n.node=i.id,this.body.emitter.emit("hoverNode",n)):(n.edge=i.id,this.body.emitter.emit("hoverEdge",n))),o}hoverObject(t,e){let i=this.getNodeAt(e);void 0===i&&(i=this.getEdgeAt(e));let n=!1;for(const o in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,o)&&(void 0===i||i instanceof WH&&i.id!=o||i instanceof CW)&&(this.emitBlurEvent(t,e,this.hoverObj.nodes[o]),delete this.hoverObj.nodes[o],n=!0);for(const o in this.hoverObj.edges)Object.prototype.hasOwnProperty.call(this.hoverObj.edges,o)&&(!0===n?(this.hoverObj.edges[o].hover=!1,delete this.hoverObj.edges[o]):(void 0===i||i instanceof CW&&i.id!=o||i instanceof WH&&!i.hover)&&(this.emitBlurEvent(t,e,this.hoverObj.edges[o]),delete this.hoverObj.edges[o],n=!0));if(void 0!==i){const o=Ck(this.hoverObj.edges).length,r=Ck(this.hoverObj.nodes).length;(n||i instanceof CW&&0===o&&0===r||i instanceof WH&&0===o&&0===r)&&(n=this.emitHoverEvent(t,e,i)),i instanceof WH&&!0===this.options.hoverConnectedEdges&&this._hoverConnectedEdges(i)}!0===n&&this.body.emitter.emit("_requestRedraw")}commitWithoutEmitting(){this._selectionAccumulator.commit()}commitAndEmit(t,e){let i=!1;const n=this._selectionAccumulator.commit(),o={nodes:n.nodes.previous,edges:n.edges.previous};n.edges.deleted.length>0&&(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)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var t;return gk(t=this._selectionAccumulator.getNodes()).call(t,t=>t.id)}getSelectedEdgeIds(){var t;return gk(t=this._selectionAccumulator.getEdges()).call(t,t=>t.id)}setSelection(t){let 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)for(const i of t.nodes){const t=this.body.nodes[i];if(!t)throw new RangeError('Node with id "'+i+'" not found');this.selectObject(t,e.highlightEdges)}if(t.edges)for(const e of t.edges){const t=this.body.edges[e];if(!t)throw new RangeError('Edge with id "'+e+'" not found');this.selectObject(t)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(t){let 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})}selectEdges(t){if(!t||void 0===t.length)throw"Selection must be an array with ids";this.setSelection({edges:t})}updateSelection(){for(const t in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,t.id)||this._selectionAccumulator.deleteNodes(t);for(const t in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,t.id)||this._selectionAccumulator.deleteEdges(t)}getClickedItems(t){const e=this.canvas.DOMtoCanvas(t),i=[],n=this.body.nodeIndices,o=this.body.nodes;for(let t=n.length-1;t>=0;t--){const r=o[n[t]].getItemsOnPoint(e);i.push.apply(i,r)}const r=this.body.edgeIndices,s=this.body.edges;for(let t=r.length-1;t>=0;t--){const n=s[r[t]].getItemsOnPoint(e);i.push.apply(i,n)}return i}}var nU,oU,rU,sU,aU,hU,dU,cU,lU,uU,fU,pU,gU,vU,mU,yU,bU,wU={};function _U(){if(oU)return nU;oU=1;var t=FE(),e=Math.floor,i=function(n,o){var r=n.length;if(r<8)for(var s,a,h=1;h<r;){for(a=h,s=n[h];a&&o(n[a-1],s)>0;)n[a]=n[--a];a!==h++&&(n[a]=s)}else for(var d=e(r/2),c=i(t(n,0,d),o),l=i(t(n,d),o),u=c.length,f=l.length,p=0,g=0;p<u||g<f;)n[p+g]=p<u&&g<f?o(c[p],l[g])<=0?c[p++]:l[g++]:p<u?c[p++]:l[g++];return n};return nU=i}function xU(){if(sU)return rU;sU=1;var t=u_().match(/firefox\/(\d+)/i);return rU=!!t&&+t[1]}function EU(){return hU?aU:(hU=1,aU=/MSIE|Trident/.test(u_()))}function OU(){if(cU)return dU;cU=1;var t=u_().match(/AppleWebKit\/(\d+)\./);return dU=!!t&&+t[1]}function SU(){if(lU)return wU;lU=1;var t=Ux(),e=aw(),i=y_(),n=tx(),o=Zx(),r=CD(),s=FO(),a=ow(),h=_U(),d=Uk(),c=xU(),l=EU(),u=f_(),f=OU(),p=[],g=e(p.sort),v=e(p.push),m=a(function(){p.sort(void 0)}),y=a(function(){p.sort(null)}),b=d("sort"),w=!a(function(){if(u)return u<70;if(!(c&&c>3)){if(l)return!0;if(f)return f<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++)p.push({k:e+n,v:i})}for(p.sort(function(t,e){return e.v-t.v}),n=0;n<p.length;n++)e=p[n].k.charAt(0),o.charAt(o.length-1)!==e&&(o+=e);return"DGBEFHACIJK"!==o}});return t({target:"Array",proto:!0,forced:m||!y||!b||!w},{sort:function(t){void 0!==t&&i(t);var e=n(this);if(w)return void 0===t?g(e):g(e,t);var a,d,c=[],l=o(e);for(d=0;d<l;d++)d in e&&v(c,e[d]);for(h(c,function(t){return function(e,i){return void 0===i?-1:void 0===e?1:void 0!==t?+t(e,i)||0:s(e)>s(i)?1:-1}}(t)),a=o(c),d=0;d<a;)e[d]=c[d++];for(;d<l;)r(e,d++);return e}}),wU}function CU(){return fU?uU:(fU=1,SU(),uU=AE()("Array","sort"))}function TU(){if(gU)return pU;gU=1;var t=l_(),e=CU(),i=Array.prototype;return pU=function(n){var o=n.sort;return n===i||t(i,n)&&o===i.sort?e:o},pU}function kU(){return mU?vU:(mU=1,vU=TU())}var DU,IU,PU,MU,NU,FU,zU,AU,BU,jU,RU,LU,HU,WU=Rb(bU?yU:(bU=1,yU=kU())),qU={};function VU(){if(IU)return DU;IU=1;var t=y_(),e=tx(),i=o_(),n=Zx(),o=TypeError,r="Reduce of empty array with no initial value",s=function(s){return function(a,h,d,c){var l=e(a),u=i(l),f=n(l);if(t(h),0===f&&d<2)throw new o(r);var p=s?f-1:0,g=s?-1:1;if(d<2)for(;;){if(p in u){c=u[p],p+=g;break}if(p+=g,s?p<0:f<=p)throw new o(r)}for(;s?p>=0:f>p;p+=g)p in u&&(c=h(c,u[p],p,l));return c}};return DU={left:s(!1),right:s(!0)}}function UU(){return MU?PU:(MU=1,PU="NODE"===_M())}function YU(){return zU?FU:(zU=1,function(){if(NU)return qU;NU=1;var t=Ux(),e=VU().left,i=Uk(),n=f_();t({target:"Array",proto:!0,forced:!UU()&&n>79&&n<83||!i("reduce")},{reduce:function(t){var i=arguments.length;return e(this,t,i,i>1?arguments[1]:void 0)}})}(),FU=AE()("Array","reduce"))}function XU(){if(BU)return AU;BU=1;var t=l_(),e=YU(),i=Array.prototype;return AU=function(n){var o=n.reduce;return n===i||t(i,n)&&o===i.reduce?e:o},AU}function GU(){return RU?jU:(RU=1,jU=XU())}var KU=Rb(HU?LU:(HU=1,LU=GU()));class ZU{abstract(){throw new Error("Can't instantiate abstract class!")}fake_use(){}curveType(){return this.abstract()}getPosition(t){return this.fake_use(t),this.abstract()}setPosition(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.fake_use(t,e,i),this.abstract()}getTreeSize(t){return this.fake_use(t),this.abstract()}sort(t){this.fake_use(t),this.abstract()}fix(t,e){this.fake_use(t,e),this.abstract()}shift(t,e){this.fake_use(t,e),this.abstract()}}class QU extends ZU{constructor(t){super(),this.layout=t}curveType(){return"horizontal"}getPosition(t){return t.x}setPosition(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==i&&this.layout.hierarchical.addToOrdering(t,i),t.x=e}getTreeSize(t){const e=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,t);return{min:e.min_x,max:e.max_x}}sort(t){WU(t).call(t,function(t,e){return t.x-e.x})}fix(t,e){t.y=this.layout.options.hierarchical.levelSeparation*e,t.options.fixed.y=!0}shift(t,e){this.layout.body.nodes[t].x+=e}}class JU extends ZU{constructor(t){super(),this.layout=t}curveType(){return"vertical"}getPosition(t){return t.y}setPosition(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==i&&this.layout.hierarchical.addToOrdering(t,i),t.y=e}getTreeSize(t){const e=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,t);return{min:e.min_y,max:e.max_y}}sort(t){WU(t).call(t,function(t,e){return t.y-e.y})}fix(t,e){t.x=this.layout.options.hierarchical.levelSeparation*e,t.options.fixed.x=!0}shift(t,e){this.layout.body.nodes[t].y+=e}}var $U,tY,eY,iY,nY,oY,rY,sY,aY,hY={};function dY(){return eY?tY:(eY=1,function(){if($U)return hY;$U=1;var t=Ux(),e=DS().every;t({target:"Array",proto:!0,forced:!Uk()("every")},{every:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}})}(),tY=AE()("Array","every"))}function cY(){if(nY)return iY;nY=1;var t=l_(),e=dY(),i=Array.prototype;return iY=function(n){var o=n.every;return n===i||t(i,n)&&o===i.every?e:o},iY}function lY(){return rY?oY:(rY=1,oY=cY())}var uY=Rb(aY?sY:(aY=1,sY=lY()));function fY(t,e){const i=new AV;return rD(t).call(t,t=>{var e;rD(e=t.edges).call(e,t=>{t.connected&&i.add(t)})}),rD(i).call(i,t=>{const i=t.from.id,n=t.to.id;null==e[i]&&(e[i]=0),(null==e[n]||e[i]>=e[n])&&(e[n]=e[i]+1)}),e}function pY(t,e,i,n){var o;const r=oM(null),s=KU(o=[...uH(n).call(n)]).call(o,(t,e)=>t+1+e.edges.length,0),a=i+"Id",h="to"===i?1:-1;for(const[o,l]of n){if(!n.has(o)||!t(l))continue;r[o]=0;const u=[l];let f,p=0;for(;f=u.pop();){var d,c;if(!n.has(o))continue;const t=r[f.id]+h;if(rD(d=ZI(c=f.edges).call(c,t=>t.connected&&t.to!==t.from&&t[i]!==f&&n.has(t.toId)&&n.has(t.fromId))).call(d,n=>{const o=n[a],s=r[o];(null==s||e(t,s))&&(r[o]=t,u.push(n[i]))}),p>s)return fY(n,r);++p}}return r}class gY{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(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)}checkIfTree(){for(const t in this.parentReference)if(this.parentReference[t].length>1)return void(this.isTree=!1);this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(t,e){void 0!==e&&void 0===this.trees[t.id]&&(this.trees[t.id]=e,this.treeIndex=Math.max(e,this.treeIndex))}ensureLevel(t){void 0===this.levels[t]&&(this.levels[t]=0)}getMaxLevel(t){const e={},i=t=>{if(void 0!==e[t])return e[t];let n=this.levels[t];if(this.childrenReference[t]){const e=this.childrenReference[t];if(e.length>0)for(let t=0;t<e.length;t++)n=Math.max(n,i(e[t]))}return e[t]=n,n};return i(t)}levelDownstream(t,e){void 0===this.levels[e.id]&&(void 0===this.levels[t.id]&&(this.levels[t.id]=0),this.levels[e.id]=this.levels[t.id]+1)}setMinLevelToZero(){var t;const e=new mB;let i=0;const n=WU(t=[...new AV(pP(this.levels))]).call(t,(t,e)=>t-e);for(const t of n)e.set(t,i++);for(const t in this.levels)Object.prototype.hasOwnProperty.call(this.levels,t)&&(this.levels[t]=e.get(this.levels[t]))}getTreeSize(t,e){let i=1e9,n=-1e9,o=1e9,r=-1e9;for(const s in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,s)&&this.trees[s]===e){const e=t[s];i=Math.min(e.x,i),n=Math.max(e.x,n),o=Math.min(e.y,o),r=Math.max(e.y,r)}return{min_x:i,max_x:n,min_y:o,max_y:r}}hasSameParent(t,e){const i=this.parentReference[t.id],n=this.parentReference[e.id];if(void 0===i||void 0===n)return!1;for(let t=0;t<i.length;t++)for(let e=0;e<n.length;e++)if(i[t]==n[e])return!0;return!1}inSameSubNetwork(t,e){return this.trees[t.id]===this.trees[e.id]}getLevels(){return Ck(this.distributionOrdering)}addToOrdering(t,e){void 0===this.distributionOrdering[e]&&(this.distributionOrdering[e]=[]);let i=!1;const n=this.distributionOrdering[e];for(const e in n)if(n[e]===t){i=!0;break}i||(this.distributionOrdering[e].push(t),this.distributionIndex[t.id]=this.distributionOrdering[e].length-1)}}class vY{constructor(t){this.body=t,this._resetRNG(Math.random()+":"+qk()),this.setPhysics=!1,this.options={},this.optionsBackup={physics:{}},this.defaultOptions={randomSeed:void 0,improvedLayout:!0,clusterThreshold:150,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:"UD",sortMethod:"hubsize"}},ME(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("_dataChanged",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",()=>{this.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",()=>{if(!0!==this.options.hierarchical.enabled)return;const t=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",t,!1)})}setOptions(t,e){if(void 0!==t){const i=this.options.hierarchical,n=i.enabled;if(XF(["randomSeed","improvedLayout","clusterThreshold"],this.options,t),cz(this.options,t,"hierarchical"),void 0!==t.randomSeed&&this._resetRNG(t.randomSeed),!0===i.enabled)return!0===n&&this.body.emitter.emit("refresh",!0),"RL"===i.direction||"DU"===i.direction?i.levelSeparation>0&&(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"),KF(e,this.optionsBackup)}return e}_resetRNG(t){this.initialRandomSeed=t,this._rng=zF(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(t){if(!0===this.options.hierarchical.enabled){const 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"==typeof 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"});let 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{const e=t.edges.smooth;void 0!==e.type&&"dynamic"!==e.type&&(i=e.type),this.optionsBackup.edges={smooth:{enabled:void 0===e.enabled||e.enabled,type:void 0===e.type?"dynamic":e.type,roundness:void 0===e.roundness?.5:e.roundness,forceDirection:void 0!==e.forceDirection&&e.forceDirection}},t.edges.smooth={enabled:void 0===e.enabled||e.enabled,type:i,roundness:void 0===e.roundness?.5:e.roundness,forceDirection:void 0!==e.forceDirection&&e.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",i)}return t}positionInitially(t){if(!0!==this.options.hierarchical.enabled){this._resetRNG(this.initialRandomSeed);const e=t.length+50;for(let i=0;i<t.length;i++){const n=t[i],o=2*Math.PI*this._rng();void 0===n.x&&(n.x=e*Math.cos(o)),void 0===n.y&&(n.y=e*Math.sin(o))}}}layoutNetwork(){if(!0!==this.options.hierarchical.enabled&&!0===this.options.improvedLayout){const t=this.body.nodeIndices;let e=0;for(let i=0;i<t.length;i++){!0===this.body.nodes[t[i]].predefinedPosition&&(e+=1)}if(e<.5*t.length){const e=10;let i=0;const n=this.options.clusterThreshold,o={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(t.length>n){const r=t.length;for(;t.length>n&&i<=e;){i+=1;const e=t.length;i%3==0?this.body.modules.clustering.clusterBridges(o):this.body.modules.clustering.clusterOutliers(o);if(e==t.length&&i%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*r)})}i>e&&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();const r=70;for(let e=0;e<t.length;e++){const i=this.body.nodes[t[e]];!1===i.predefinedPosition&&(i.x+=(.5-this._rng())*r,i.y+=(.5-this._rng())*r)}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}_shiftToCenter(){const t=LW.getRangeCore(this.body.nodes,this.body.nodeIndices),e=LW.findCenter(t);for(let t=0;t<this.body.nodeIndices.length;t++){const i=this.body.nodes[this.body.nodeIndices[t]];i.x-=e.x,i.y-=e.y}}_declusterAll(){let t=!0;for(;!0===t;){t=!1;for(let e=0;e<this.body.nodeIndices.length;e++)!0===this.body.nodes[this.body.nodeIndices[e]].isCluster&&(t=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[e],{},!1));!0===t&&this.body.emitter.emit("_dataChanged")}}getSeed(){return this.initialRandomSeed}setupHierarchicalLayout(){if(!0===this.options.hierarchical.enabled&&this.body.nodeIndices.length>0){let t,e,i=!1,n=!1;for(e in this.lastNodeOnLevel={},this.hierarchical=new gY,this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&(t=this.body.nodes[e],void 0!==t.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){const t=this.options.hierarchical.sortMethod;"hubsize"===t?this._determineLevelsByHubsize():"directed"===t?this._determineLevelsDirected():"custom"===t&&this._determineLevelsCustomCallback()}for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.hierarchical.ensureLevel(t);const t=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(t),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var t=this;let e=!1;const i={},n=(t,e)=>{const i=this.hierarchical.trees;for(const n in i)Object.prototype.hasOwnProperty.call(i,n)&&i[n]===t&&this.direction.shift(n,e)},o=()=>{const t=[];for(let e=0;e<this.hierarchical.numTrees();e++)t.push(this.direction.getTreeSize(e));return t},r=(t,e)=>{if(!e[t.id]&&(e[t.id]=!0,this.hierarchical.childrenReference[t.id])){const i=this.hierarchical.childrenReference[t.id];if(i.length>0)for(let t=0;t<i.length;t++)r(this.body.nodes[i[t]],e)}},s=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e9,n=1e9,o=1e9,r=1e9,s=-1e9;for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const h=t.body.nodes[a],d=t.hierarchical.levels[h.id],c=t.direction.getPosition(h),[l,u]=t._getSpaceAroundNode(h,e);n=Math.min(l,n),o=Math.min(u,o),d<=i&&(r=Math.min(c,r),s=Math.max(c,s))}return[r,s,n,o]},a=(t,e)=>{const i=this.hierarchical.getMaxLevel(t.id),n=this.hierarchical.getMaxLevel(e.id);return Math.min(i,n)},h=(t,e,i)=>{const n=this.hierarchical;for(let o=0;o<e.length;o++){const r=e[o],s=n.distributionOrdering[r];if(s.length>1)for(let e=0;e<s.length-1;e++){const o=s[e],r=s[e+1];n.hasSameParent(o,r)&&n.inSameSubNetwork(o,r)&&t(o,r,i)}}},d=function(i,n){let o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const h=t.direction.getPosition(i),d=t.direction.getPosition(n),c=Math.abs(d-h),l=t.options.hierarchical.nodeSpacing;if(c>l){const h={},d={};r(i,h),r(n,d);const c=a(i,n),u=s(h,c),f=s(d,c),p=u[1],g=f[0],v=f[2];if(Math.abs(p-g)>l){let i=p-g+l;i<-v+l&&(i=-v+l),i<0&&(t._shiftBlock(n.id,i),e=!0,!0===o&&t._centerParent(n))}}},c=(t,n)=>{const o=n.id,a=n.edges,h=this.hierarchical.levels[n.id],d=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,c={},l=[];for(let t=0;t<a.length;t++){const e=a[t];if(e.toId!=e.fromId){const i=e.toId==o?e.from:e.to;c[a[t].id]=i,this.hierarchical.levels[i.id]<h&&l.push(e)}}const u=(t,e)=>{let i=0;for(let n=0;n<e.length;n++)if(void 0!==c[e[n].id]){const o=this.direction.getPosition(c[e[n].id])-t;i+=o/Math.sqrt(o*o+d)}return i},f=(t,e)=>{let i=0;for(let n=0;n<e.length;n++)if(void 0!==c[e[n].id]){const o=this.direction.getPosition(c[e[n].id])-t;i-=d*Math.pow(o*o+d,-1.5)}return i},p=(t,e)=>{let i=this.direction.getPosition(n);const o={};for(let n=0;n<t;n++){const t=u(i,e),r=f(i,e),s=40;if(i-=Math.max(-s,Math.min(s,Math.round(t/r))),void 0!==o[i])break;o[i]=n}return i};let g=p(t,l);(t=>{const o=this.direction.getPosition(n);if(void 0===i[n.id]){const t={};r(n,t),i[n.id]=t}const a=s(i[n.id]),h=a[2],d=a[3],c=t-o;let l=0;c>0?l=Math.min(c,d-this.options.hierarchical.nodeSpacing):c<0&&(l=-Math.min(-c,h-this.options.hierarchical.nodeSpacing)),0!=l&&(this._shiftBlock(n.id,l),e=!0)})(g),g=p(t,a),(t=>{const i=this.direction.getPosition(n),[o,r]=this._getSpaceAroundNode(n),s=t-i;let a=i;s>0?a=Math.min(i+(r-this.options.hierarchical.nodeSpacing),t):s<0&&(a=Math.max(i-(o-this.options.hierarchical.nodeSpacing),t)),a!==i&&(this.direction.setPosition(n,a),e=!0)})(g)},l=t=>{let i=this.hierarchical.getLevels();i=ED(i).call(i);for(let n=0;n<t;n++){e=!1;for(let t=0;t<i.length;t++){const e=i[t],n=this.hierarchical.distributionOrdering[e];for(let t=0;t<n.length;t++)c(1e3,n[t])}if(!0!==e)break}},u=t=>{let i=this.hierarchical.getLevels();i=ED(i).call(i);for(let n=0;n<t&&(e=!1,h(d,i,!0),!0===e);n++);},f=()=>{for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this._centerParent(this.body.nodes[t])},p=()=>{let t=this.hierarchical.getLevels();t=ED(t).call(t);for(let e=0;e<t.length;e++){const i=t[e],n=this.hierarchical.distributionOrdering[i];for(let t=0;t<n.length;t++)this._centerParent(n[t])}};!0===this.options.hierarchical.blockShifting&&(u(5),f()),!0===this.options.hierarchical.edgeMinimization&&l(20),!0===this.options.hierarchical.parentCentralization&&p(),(()=>{const t=o();let e=0;for(let i=0;i<t.length-1;i++){e+=t[i].max-t[i+1].min+this.options.hierarchical.treeSpacing,n(i+1,e)}})()}_getSpaceAroundNode(t,e){let i=!0;void 0===e&&(i=!1);const n=this.hierarchical.levels[t.id];if(void 0!==n){const o=this.hierarchical.distributionIndex[t.id],r=this.direction.getPosition(t),s=this.hierarchical.distributionOrdering[n];let a=1e9,h=1e9;if(0!==o){const t=s[o-1];if(!0===i&&void 0===e[t.id]||!1===i){a=r-this.direction.getPosition(t)}}if(o!=s.length-1){const t=s[o+1];if(!0===i&&void 0===e[t.id]||!1===i){const e=this.direction.getPosition(t);h=Math.min(h,e-r)}}return[a,h]}return[0,0]}_centerParent(t){if(this.hierarchical.parentReference[t.id]){const e=this.hierarchical.parentReference[t.id];for(let t=0;t<e.length;t++){const i=e[t],n=this.body.nodes[i],o=this.hierarchical.childrenReference[i];if(void 0!==o){const t=this._getCenterPosition(o),e=this.direction.getPosition(n),[i,r]=this._getSpaceAroundNode(n),s=e-t;(s<0&&Math.abs(s)<r-this.options.hierarchical.nodeSpacing||s>0&&Math.abs(s)<i-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(n,t)}}}}_placeNodesByHierarchy(t){this.positionedNodes={};for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var e;let n=Ck(t[i]);n=this._indexArrayToNodes(n),WU(e=this.direction).call(e,n);let o=0;for(let t=0;t<n.length;t++){const e=n[t];if(void 0===this.positionedNodes[e.id]){const r=this.options.hierarchical.nodeSpacing;let s=r*o;o>0&&(s=this.direction.getPosition(n[t-1])+r),this.direction.setPosition(e,s,i),this._validatePositionAndContinue(e,i,s),o++}}}}_placeBranchNodes(t,e){var i;const n=this.hierarchical.childrenReference[t];if(void 0===n)return;const o=[];for(let t=0;t<n.length;t++)o.push(this.body.nodes[n[t]]);WU(i=this.direction).call(i,o);for(let i=0;i<o.length;i++){const n=o[i],r=this.hierarchical.levels[n.id];if(!(r>e&&void 0===this.positionedNodes[n.id]))return;{const e=this.options.hierarchical.nodeSpacing;let s;s=0===i?this.direction.getPosition(this.body.nodes[t]):this.direction.getPosition(o[i-1])+e,this.direction.setPosition(n,s,r),this._validatePositionAndContinue(n,r,s)}}const r=this._getCenterPosition(o);this.direction.setPosition(this.body.nodes[t],r,e)}_validatePositionAndContinue(t,e,i){if(this.hierarchical.isTree){if(void 0!==this.lastNodeOnLevel[e]){const n=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[e]]);if(i-n<this.options.hierarchical.nodeSpacing){const o=n+this.options.hierarchical.nodeSpacing-i,r=this._findCommonParent(this.lastNodeOnLevel[e],t.id);this._shiftBlock(r.withChild,o)}}this.lastNodeOnLevel[e]=t.id,this.positionedNodes[t.id]=!0,this._placeBranchNodes(t.id,e)}}_indexArrayToNodes(t){const e=[];for(let i=0;i<t.length;i++)e.push(this.body.nodes[t[i]]);return e}_getDistribution(){const t={};let e,i;for(e in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,e)){i=this.body.nodes[e];const n=void 0===this.hierarchical.levels[e]?0:this.hierarchical.levels[e];this.direction.fix(i,n),void 0===t[n]&&(t[n]={}),t[n][e]=i}return t}_getActiveEdges(t){const e=[];return $F(t.edges,t=>{var i;-1!==WP(i=this.body.edgeIndices).call(i,t.id)&&e.push(t)}),e}_getHubSizes(){const t={};$F(this.body.nodeIndices,e=>{const i=this.body.nodes[e],n=this._getActiveEdges(i).length;t[n]=!0});const e=[];return $F(t,t=>{e.push(Number(t))}),WU(e).call(e,function(t,e){return e-t}),e}_determineLevelsByHubsize(){const t=(t,e)=>{this.hierarchical.levelDownstream(t,e)},e=this._getHubSizes();for(let i=0;i<e.length;++i){const n=e[i];if(0===n)break;$F(this.body.nodeIndices,e=>{const i=this.body.nodes[e];n===this._getActiveEdges(i).length&&this._crawlNetwork(t,e)})}}_determineLevelsCustomCallback(){this._crawlNetwork((t,e,i)=>{let n=this.hierarchical.levels[t.id];void 0===n&&(n=this.hierarchical.levels[t.id]=1e5);const o=(LW.cloneOptions(t,"node"),LW.cloneOptions(e,"node"),void LW.cloneOptions(i,"edge"));this.hierarchical.levels[e.id]=n+o}),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var t;const e=KU(t=this.body.nodeIndices).call(t,(t,e)=>(t.set(e,this.body.nodes[e]),t),new mB);"roots"===this.options.hierarchical.shakeTowards?this.hierarchical.levels=function(t){return pY(e=>{var i,n;return uY(i=ZI(n=e.edges).call(n,e=>t.has(e.toId))).call(i,t=>t.from===e)},(t,e)=>e<t,"to",t)}(e):this.hierarchical.levels=function(t){return pY(e=>{var i,n;return uY(i=ZI(n=e.edges).call(n,e=>t.has(e.toId))).call(i,t=>t.to===e)},(t,e)=>e>t,"from",t)}(e),this.hierarchical.setMinLevelToZero()}_generateMap(){this._crawlNetwork((t,e)=>{this.hierarchical.levels[e.id]>this.hierarchical.levels[t.id]&&this.hierarchical.addRelation(t.id,e.id)}),this.hierarchical.checkIfTree()}_crawlNetwork(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},e=arguments.length>1?arguments[1]:void 0;const i={},n=(e,o)=>{if(void 0===i[e.id]){let r;this.hierarchical.setTreeIndex(e,o),i[e.id]=!0;const s=this._getActiveEdges(e);for(let i=0;i<s.length;i++){const a=s[i];!0===a.connected&&(r=a.toId==e.id?a.from:a.to,e.id!=r.id&&(t(e,r,a),n(r,o)))}}};if(void 0===e){let t=0;for(let e=0;e<this.body.nodeIndices.length;e++){const o=this.body.nodeIndices[e];if(void 0===i[o]){const e=this.body.nodes[o];n(e,t),t+=1}}}else{const t=this.body.nodes[e];if(void 0===t)return void console.error("Node not found:",e);n(t)}}_shiftBlock(t,e){const i={},n=t=>{if(i[t])return;i[t]=!0,this.direction.shift(t,e);const o=this.hierarchical.childrenReference[t];if(void 0!==o)for(let t=0;t<o.length;t++)n(o[t])};n(t)}_findCommonParent(t,e){const i={},n=(t,e)=>{const i=this.hierarchical.parentReference[e];if(void 0!==i)for(let e=0;e<i.length;e++){const o=i[e];t[o]=!0,n(t,o)}},o=(t,e)=>{const i=this.hierarchical.parentReference[e];if(void 0!==i)for(let n=0;n<i.length;n++){const r=i[n];if(void 0!==t[r])return{foundParent:r,withChild:e};const s=o(t,r);if(null!==s.foundParent)return s}return{foundParent:null,withChild:e}};return n(i,t),o(i,e)}setDirectionStrategy(){const t="UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction;this.direction=t?new QU(this):new JU(this)}_getCenterPosition(t){let e=1e9,i=-1e9;for(let n=0;n<t.length;n++){let o;if(void 0!==t[n].id)o=t[n];else{const e=t[n];o=this.body.nodes[e]}const r=this.direction.getPosition(o);e=Math.min(e,r),i=Math.max(i,r)}return.5*(e+i)}}class mY{constructor(t,e,i,n){var o,r;this.body=t,this.canvas=e,this.selectionHandler=i,this.interactionHandler=n,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this._domEventListenerCleanupQueue=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},ME(this.options,this.defaultOptions),this.body.emitter.on("destroy",()=>{this._clean()}),this.body.emitter.on("_dataChanged",LE(o=this._restore).call(o,this)),this.body.emitter.on("_resetData",LE(r=this._restore).call(r,this))}_restore(){!1!==this.inMode&&(!0===this.options.initiallyActive?this.enableEditMode():this.disableEditMode())}setOptions(t,e,i){void 0!==e&&(void 0!==e.locale?this.options.locale=e.locale:this.options.locale=i.locale,void 0!==e.locales?this.options.locales=e.locales:this.options.locales=i.locales),void 0!==t&&("boolean"==typeof t?this.options.enabled=t:(this.options.enabled=!0,KF(this.options,t)),!0===this.options.initiallyActive&&(this.editMode=!0),this._setup())}toggleEditMode(){!0===this.editMode?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),!0===this.guiEnabled&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),!0===this.guiEnabled&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},!0===this.guiEnabled){var t,e;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";const i=this.selectionHandler.getSelectedNodeCount(),n=this.selectionHandler.getSelectedEdgeCount(),o=i+n,r=this.options.locales[this.options.locale];let s=!1;!1!==this.options.addNode&&(this._createAddNodeButton(r),s=!0),!1!==this.options.addEdge&&(!0===s?this._createSeperator(1):s=!0,this._createAddEdgeButton(r)),1===i&&"function"==typeof this.options.editNode?(!0===s?this._createSeperator(2):s=!0,this._createEditNodeButton(r)):1===n&&0===i&&!1!==this.options.editEdge&&(!0===s?this._createSeperator(3):s=!0,this._createEditEdgeButton(r)),0!==o&&(i>0&&!1!==this.options.deleteNode||0===i&&!1!==this.options.deleteEdge)&&(!0===s&&this._createSeperator(4),this._createDeleteButton(r)),this._bindElementEvents(this.closeDiv,LE(t=this.toggleEditMode).call(t,this)),this._temporaryBindEvent("select",LE(e=this.showManipulatorToolbar).call(e,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var t;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addNode",!0===this.guiEnabled){var e;const t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,LE(e=this.toggleEditMode).call(e,this))}this._temporaryBindEvent("click",LE(t=this._performAddNode).call(t,this))}editNode(){!0!==this.editMode&&this.enableEditMode(),this._clean();const t=this.selectionHandler.getSelectedNodes()[0];if(void 0!==t){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!==t.isCluster){const e=KF({},t.options,!1);if(e.x=t.x,e.y=t.y,2!==this.options.editNode.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editNode(e,t=>{null!=t&&"editNode"===this.inMode&&this.body.data.nodes.getDataSet().update(t),this.showManipulatorToolbar()})}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}addEdgeMode(){var t,e,i,n,o;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addEdge",!0===this.guiEnabled){var r;const t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,LE(r=this.toggleEditMode).call(r,this))}this._temporaryBindUI("onTouch",LE(t=this._handleConnect).call(t,this)),this._temporaryBindUI("onDragEnd",LE(e=this._finishConnect).call(e,this)),this._temporaryBindUI("onDrag",LE(i=this._dragControlNode).call(i,this)),this._temporaryBindUI("onRelease",LE(n=this._finishConnect).call(n,this)),this._temporaryBindUI("onDragStart",LE(o=this._dragStartEdge).call(o,this)),this._temporaryBindUI("onHold",()=>{})}editEdgeMode(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="editEdge","object"==typeof this.options.editEdge&&"function"==typeof this.options.editEdge.editWithoutDrag&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],void 0!==this.edgeBeingEditedId)){const t=this.body.edges[this.edgeBeingEditedId];return void this._performEditEdge(t.from.id,t.to.id)}if(!0===this.guiEnabled){var t;const 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,LE(t=this.toggleEditMode).call(t,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],void 0!==this.edgeBeingEditedId){var e,i,n,o;const t=this.body.edges[this.edgeBeingEditedId],r=this._getNewTargetNode(t.from.x,t.from.y),s=this._getNewTargetNode(t.to.x,t.to.y);this.temporaryIds.nodes.push(r.id),this.temporaryIds.nodes.push(s.id),this.body.nodes[r.id]=r,this.body.nodeIndices.push(r.id),this.body.nodes[s.id]=s,this.body.nodeIndices.push(s.id),this._temporaryBindUI("onTouch",LE(e=this._controlNodeTouch).call(e,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",LE(i=this._controlNodeDragStart).call(i,this)),this._temporaryBindUI("onDrag",LE(n=this._controlNodeDrag).call(n,this)),this._temporaryBindUI("onDragEnd",LE(o=this._controlNodeDragEnd).call(o,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",e=>{const i=t.edgeType.findBorderPositions(e);!1===r.selected&&(r.x=i.from.x,r.y=i.from.y),!1===s.selected&&(s.x=i.to.x,s.y=i.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="delete";const t=this.selectionHandler.getSelectedNodeIds(),e=this.selectionHandler.getSelectedEdgeIds();let i;if(t.length>0){for(let e=0;e<t.length;e++)if(!0===this.body.nodes[t[e]].isCluster)return void alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);"function"==typeof this.options.deleteNode&&(i=this.options.deleteNode)}else e.length>0&&"function"==typeof this.options.deleteEdge&&(i=this.options.deleteEdge);if("function"==typeof i){const n={nodes:t,edges:e};if(2!==i.length)throw new Error("The function for delete does not support two arguments (data, callback)");i(n,t=>{null!=t&&"delete"===this.inMode?(this.body.data.edges.getDataSet().remove(t.edges),this.body.data.nodes.getDataSet().remove(t.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().remove(e),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}_setup(){!0===this.options.enabled?(this.guiEnabled=!0,this._createWrappers(),!1===this.editMode?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){var 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))}_getNewTargetNode(t,e){const i=KF({},this.options.controlNodeStyle);i.id="targetNode"+RW(),i.hidden=!1,i.physics=!1,i.x=t,i.y=e;const n=this.body.functions.createNode(i);return n.shape.boundingBox={left:t,right:t,top:e,bottom:e},n}_createEditButton(){var t;this._clean(),this.manipulationDOM={},WF(this.editModeDiv);const 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,LE(t=this.toggleEditMode).call(t,this))}_clean(){this.inMode=!1,!0===this.guiEnabled&&(WF(this.editModeDiv),WF(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(const e of ND(t=this._domEventListenerCleanupQueue).call(t,0)){var t;e()}}_removeManipulationDOM(){this._clean(),WF(this.manipulationDiv),WF(this.editModeDiv),WF(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}_createSeperator(){let 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])}_createAddNodeButton(t){var e;const i=this._createButton("addNode","vis-add",t.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,LE(e=this.addNodeMode).call(e,this))}_createAddEdgeButton(t){var e;const i=this._createButton("addEdge","vis-connect",t.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,LE(e=this.addEdgeMode).call(e,this))}_createEditNodeButton(t){var e;const i=this._createButton("editNode","vis-edit",t.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,LE(e=this.editNode).call(e,this))}_createEditEdgeButton(t){var e;const i=this._createButton("editEdge","vis-edit",t.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,LE(e=this.editEdgeMode).call(e,this))}_createDeleteButton(t){var e;let i;i=this.options.rtl?"vis-delete-rtl":"vis-delete";const n=this._createButton("delete",i,t.del||this.options.locales.en.del);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,LE(e=this.deleteSelected).call(e,this))}_createBackButton(t){var e;const i=this._createButton("back","vis-back",t.back||this.options.locales.en.back);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,LE(e=this.showManipulatorToolbar).call(e,this))}_createButton(t,e,i){let 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"]}_createDescription(t){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=t,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(t,e){this.temporaryEventFunctions.push({event:t,boundFunction:e}),this.body.emitter.on(t,e)}_temporaryBindUI(t,e){if(void 0===this.body.eventListeners[t])throw new Error("This UI function does not exist. Typo? You tried: "+t+" possible are: "+yM(Ck(this.body.eventListeners)));this.temporaryUIFunctions[t]=this.body.eventListeners[t],this.body.eventListeners[t]=e}_unbindTemporaryUIs(){for(const t in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,t)&&(this.body.eventListeners[t]=this.temporaryUIFunctions[t],delete this.temporaryUIFunctions[t]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let t=0;t<this.temporaryEventFunctions.length;t++){const e=this.temporaryEventFunctions[t].event,i=this.temporaryEventFunctions[t].boundFunction;this.body.emitter.off(e,i)}this.temporaryEventFunctions=[]}_bindElementEvents(t,e){const i=new _z(t,{});ZW(i,e),this._domEventListenerCleanupQueue.push(()=>{i.destroy()});const n=t=>{let{keyCode:i,key:n}=t;"Enter"!==n&&" "!==n&&13!==i&&32!==i||e()};t.addEventListener("keyup",n,!1),this._domEventListenerCleanupQueue.push(()=>{t.removeEventListener("keyup",n,!1)})}_cleanupTemporaryNodesAndEdges(){for(let i=0;i<this.temporaryIds.edges.length;i++){var t;this.body.edges[this.temporaryIds.edges[i]].disconnect(),delete this.body.edges[this.temporaryIds.edges[i]];const n=WP(t=this.body.edgeIndices).call(t,this.temporaryIds.edges[i]);var e;if(-1!==n)ND(e=this.body.edgeIndices).call(e,n,1)}for(let t=0;t<this.temporaryIds.nodes.length;t++){var i;delete this.body.nodes[this.temporaryIds.nodes[t]];const e=WP(i=this.body.nodeIndices).call(i,this.temporaryIds.nodes[t]);var n;if(-1!==e)ND(n=this.body.nodeIndices).call(n,e,1)}this.temporaryIds={nodes:[],edges:[]}}_controlNodeTouch(t){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(t.center),this.lastTouch.translation=ME({},this.body.view.translation)}_controlNodeDragStart(){const t=this.lastTouch,e=this.selectionHandler._pointerToPositionObject(t),i=this.body.nodes[this.temporaryIds.nodes[0]],n=this.body.nodes[this.temporaryIds.nodes[1]],o=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;const r=i.isOverlappingWith(e),s=n.isOverlappingWith(e);!0===r?(this.selectedControlNode=i,o.edgeType.from=i):!0===s&&(this.selectedControlNode=n,o.edgeType.to=n),void 0!==this.selectedControlNode&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}_controlNodeDrag(t){this.body.emitter.emit("disablePhysics");const e=this.body.functions.getPointer(t.center),i=this.canvas.DOMtoCanvas(e);void 0!==this.selectedControlNode?(this.selectedControlNode.x=i.x,this.selectedControlNode.y=i.y):this.interactionHandler.onDrag(t),this.body.emitter.emit("_redraw")}_controlNodeDragEnd(t){const e=this.body.functions.getPointer(t.center),i=this.selectionHandler._pointerToPositionObject(e),n=this.body.edges[this.edgeBeingEditedId];if(void 0===this.selectedControlNode)return;this.selectionHandler.unselectAll();const o=this.selectionHandler._getAllNodesOverlappingWith(i);let r;for(let t=o.length-1;t>=0;t--)if(o[t]!==this.selectedControlNode.id){r=this.body.nodes[o[t]];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{const t=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===t.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")}_handleConnect(t){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(t.center),this.lastTouch.translation=ME({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;const 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{const t=this._getNewTargetNode(i.x,i.y);this.body.nodes[t.id]=t,this.body.nodeIndices.push(t.id);const e=this.body.functions.createEdge({id:"connectionEdge"+RW(),from:i.id,to:t.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[e.id]=e,this.body.edgeIndices.push(e.id),this.temporaryIds.nodes.push(t.id),this.temporaryIds.edges.push(e.id)}this.touchTime=(new Date).valueOf()}}_dragControlNode(t){const e=this.body.functions.getPointer(t.center),i=this.selectionHandler._pointerToPositionObject(e);let n;void 0!==this.temporaryIds.edges[0]&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);const o=this.selectionHandler._getAllNodesOverlappingWith(i);let r;for(let t=o.length-1;t>=0;t--){var s;if(-1===WP(s=this.temporaryIds.nodes).call(s,o[t])){r=this.body.nodes[o[t]];break}}if(t.controlEdge={from:n,to:r?r.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",t,e),void 0!==this.temporaryIds.nodes[0]){const t=this.body.nodes[this.temporaryIds.nodes[0]];t.x=this.canvas._XconvertDOMtoCanvas(e.x),t.y=this.canvas._YconvertDOMtoCanvas(e.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(t)}_finishConnect(t){const e=this.body.functions.getPointer(t.center),i=this.selectionHandler._pointerToPositionObject(e);let n;void 0!==this.temporaryIds.edges[0]&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);const o=this.selectionHandler._getAllNodesOverlappingWith(i);let r;for(let t=o.length-1;t>=0;t--){var s;if(-1===WP(s=this.temporaryIds.nodes).call(s,o[t])){r=this.body.nodes[o[t]];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")}_dragStartEdge(t){const e=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",t,e,void 0,!0)}_performAddNode(t){const e={id:RW(),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(e,t=>{null!=t&&"addNode"===this.inMode&&this.body.data.nodes.getDataSet().add(t),this.showManipulatorToolbar()})}else this.body.data.nodes.getDataSet().add(e),this.showManipulatorToolbar()}_performAddEdge(t,e){const i={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(i,t=>{null!=t&&"addEdge"===this.inMode&&(this.body.data.edges.getDataSet().add(t),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().add(i),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(t,e){const i={id:this.edgeBeingEditedId,from:t,to:e,label:this.body.data.edges.get(this.edgeBeingEditedId).label};let n=this.options.editEdge;if("object"==typeof n&&(n=n.editWithoutDrag),"function"==typeof n){if(2!==n.length)throw new Error("The function for edit does not support two arguments (data, callback)");n(i,t=>{null==t||"editEdge"!==this.inMode?(this.body.edges[i.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(t),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().update(i),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}const yY="string",bY="boolean",wY="number",_Y="array",xY="object",EY=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],OY={borderWidth:{number:wY},borderWidthSelected:{number:wY,undefined:"undefined"},brokenImage:{string:yY,undefined:"undefined"},chosen:{label:{boolean:bY,function:"function"},node:{boolean:bY,function:"function"},__type__:{object:xY,boolean:bY}},color:{border:{string:yY},background:{string:yY},highlight:{border:{string:yY},background:{string:yY},__type__:{object:xY,string:yY}},hover:{border:{string:yY},background:{string:yY},__type__:{object:xY,string:yY}},__type__:{object:xY,string:yY}},opacity:{number:wY,undefined:"undefined"},fixed:{x:{boolean:bY},y:{boolean:bY},__type__:{object:xY,boolean:bY}},font:{align:{string:yY},color:{string:yY},size:{number:wY},face:{string:yY},background:{string:yY},strokeWidth:{number:wY},strokeColor:{string:yY},vadjust:{number:wY},multi:{boolean:bY,string:yY},bold:{color:{string:yY},size:{number:wY},face:{string:yY},mod:{string:yY},vadjust:{number:wY},__type__:{object:xY,string:yY}},boldital:{color:{string:yY},size:{number:wY},face:{string:yY},mod:{string:yY},vadjust:{number:wY},__type__:{object:xY,string:yY}},ital:{color:{string:yY},size:{number:wY},face:{string:yY},mod:{string:yY},vadjust:{number:wY},__type__:{object:xY,string:yY}},mono:{color:{string:yY},size:{number:wY},face:{string:yY},mod:{string:yY},vadjust:{number:wY},__type__:{object:xY,string:yY}},__type__:{object:xY,string:yY}},group:{string:yY,number:wY,undefined:"undefined"},heightConstraint:{minimum:{number:wY},valign:{string:yY},__type__:{object:xY,boolean:bY,number:wY}},hidden:{boolean:bY},icon:{face:{string:yY},code:{string:yY},size:{number:wY},color:{string:yY},weight:{string:yY,number:wY},__type__:{object:xY}},id:{string:yY,number:wY},image:{selected:{string:yY,undefined:"undefined"},unselected:{string:yY,undefined:"undefined"},__type__:{object:xY,string:yY}},imagePadding:{top:{number:wY},right:{number:wY},bottom:{number:wY},left:{number:wY},__type__:{object:xY,number:wY}},label:{string:yY,undefined:"undefined"},labelHighlightBold:{boolean:bY},level:{number:wY,undefined:"undefined"},margin:{top:{number:wY},right:{number:wY},bottom:{number:wY},left:{number:wY},__type__:{object:xY,number:wY}},mass:{number:wY},physics:{boolean:bY},scaling:{min:{number:wY},max:{number:wY},label:{enabled:{boolean:bY},min:{number:wY},max:{number:wY},maxVisible:{number:wY},drawThreshold:{number:wY},__type__:{object:xY,boolean:bY}},customScalingFunction:{function:"function"},__type__:{object:xY}},shadow:{enabled:{boolean:bY},color:{string:yY},size:{number:wY},x:{number:wY},y:{number:wY},__type__:{object:xY,boolean:bY}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:bY,array:_Y},borderRadius:{number:wY},interpolation:{boolean:bY},useImageSize:{boolean:bY},useBorderWithImage:{boolean:bY},coordinateOrigin:{string:["center","top-left"]},__type__:{object:xY}},size:{number:wY},title:{string:yY,dom:"dom",undefined:"undefined"},value:{number:wY,undefined:"undefined"},widthConstraint:{minimum:{number:wY},maximum:{number:wY},__type__:{object:xY,boolean:bY,number:wY}},x:{number:wY},y:{number:wY},__type__:{object:xY}},SY={configure:{enabled:{boolean:bY},filter:{boolean:bY,string:yY,array:_Y,function:"function"},container:{dom:"dom"},showButton:{boolean:bY},__type__:{object:xY,boolean:bY,string:yY,array:_Y,function:"function"}},edges:{arrows:{to:{enabled:{boolean:bY},scaleFactor:{number:wY},type:{string:EY},imageHeight:{number:wY},imageWidth:{number:wY},src:{string:yY},__type__:{object:xY,boolean:bY}},middle:{enabled:{boolean:bY},scaleFactor:{number:wY},type:{string:EY},imageWidth:{number:wY},imageHeight:{number:wY},src:{string:yY},__type__:{object:xY,boolean:bY}},from:{enabled:{boolean:bY},scaleFactor:{number:wY},type:{string:EY},imageWidth:{number:wY},imageHeight:{number:wY},src:{string:yY},__type__:{object:xY,boolean:bY}},__type__:{string:["from","to","middle"],object:xY}},endPointOffset:{from:{number:wY},to:{number:wY},__type__:{object:xY,number:wY}},arrowStrikethrough:{boolean:bY},background:{enabled:{boolean:bY},color:{string:yY},size:{number:wY},dashes:{boolean:bY,array:_Y},__type__:{object:xY,boolean:bY}},chosen:{label:{boolean:bY,function:"function"},edge:{boolean:bY,function:"function"},__type__:{object:xY,boolean:bY}},color:{color:{string:yY},highlight:{string:yY},hover:{string:yY},inherit:{string:["from","to","both"],boolean:bY},opacity:{number:wY},__type__:{object:xY,string:yY}},dashes:{boolean:bY,array:_Y},font:{color:{string:yY},size:{number:wY},face:{string:yY},background:{string:yY},strokeWidth:{number:wY},strokeColor:{string:yY},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:wY},multi:{boolean:bY,string:yY},bold:{color:{string:yY},size:{number:wY},face:{string:yY},mod:{string:yY},vadjust:{number:wY},__type__:{object:xY,string:yY}},boldital:{color:{string:yY},size:{number:wY},face:{string:yY},mod:{string:yY},vadjust:{number:wY},__type__:{object:xY,string:yY}},ital:{color:{string:yY},size:{number:wY},face:{string:yY},mod:{string:yY},vadjust:{number:wY},__type__:{object:xY,string:yY}},mono:{color:{string:yY},size:{number:wY},face:{string:yY},mod:{string:yY},vadjust:{number:wY},__type__:{object:xY,string:yY}},__type__:{object:xY,string:yY}},hidden:{boolean:bY},hoverWidth:{function:"function",number:wY},label:{string:yY,undefined:"undefined"},labelHighlightBold:{boolean:bY},length:{number:wY,undefined:"undefined"},physics:{boolean:bY},scaling:{min:{number:wY},max:{number:wY},label:{enabled:{boolean:bY},min:{number:wY},max:{number:wY},maxVisible:{number:wY},drawThreshold:{number:wY},__type__:{object:xY,boolean:bY}},customScalingFunction:{function:"function"},__type__:{object:xY}},selectionWidth:{function:"function",number:wY},selfReferenceSize:{number:wY},selfReference:{size:{number:wY},angle:{number:wY},renderBehindTheNode:{boolean:bY},__type__:{object:xY}},shadow:{enabled:{boolean:bY},color:{string:yY},size:{number:wY},x:{number:wY},y:{number:wY},__type__:{object:xY,boolean:bY}},smooth:{enabled:{boolean:bY},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:wY},forceDirection:{string:["horizontal","vertical","none"],boolean:bY},__type__:{object:xY,boolean:bY}},title:{string:yY,undefined:"undefined"},width:{number:wY},widthConstraint:{maximum:{number:wY},__type__:{object:xY,boolean:bY,number:wY}},value:{number:wY,undefined:"undefined"},__type__:{object:xY}},groups:{useDefaultGroups:{boolean:bY},__any__:OY,__type__:{object:xY}},interaction:{dragNodes:{boolean:bY},dragView:{boolean:bY},hideEdgesOnDrag:{boolean:bY},hideEdgesOnZoom:{boolean:bY},hideNodesOnDrag:{boolean:bY},hover:{boolean:bY},keyboard:{enabled:{boolean:bY},speed:{x:{number:wY},y:{number:wY},zoom:{number:wY},__type__:{object:xY}},bindToWindow:{boolean:bY},autoFocus:{boolean:bY},__type__:{object:xY,boolean:bY}},multiselect:{boolean:bY},navigationButtons:{boolean:bY},selectable:{boolean:bY},selectConnectedEdges:{boolean:bY},hoverConnectedEdges:{boolean:bY},tooltipDelay:{number:wY},zoomView:{boolean:bY},zoomSpeed:{number:wY},__type__:{object:xY}},layout:{randomSeed:{undefined:"undefined",number:wY,string:yY},improvedLayout:{boolean:bY},clusterThreshold:{number:wY},hierarchical:{enabled:{boolean:bY},levelSeparation:{number:wY},nodeSpacing:{number:wY},treeSpacing:{number:wY},blockShifting:{boolean:bY},edgeMinimization:{boolean:bY},parentCentralization:{boolean:bY},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:xY,boolean:bY}},__type__:{object:xY}},manipulation:{enabled:{boolean:bY},initiallyActive:{boolean:bY},addNode:{boolean:bY,function:"function"},addEdge:{boolean:bY,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:xY,boolean:bY,function:"function"}},deleteNode:{boolean:bY,function:"function"},deleteEdge:{boolean:bY,function:"function"},controlNodeStyle:OY,__type__:{object:xY,boolean:bY}},nodes:OY,physics:{enabled:{boolean:bY},barnesHut:{theta:{number:wY},gravitationalConstant:{number:wY},centralGravity:{number:wY},springLength:{number:wY},springConstant:{number:wY},damping:{number:wY},avoidOverlap:{number:wY},__type__:{object:xY}},forceAtlas2Based:{theta:{number:wY},gravitationalConstant:{number:wY},centralGravity:{number:wY},springLength:{number:wY},springConstant:{number:wY},damping:{number:wY},avoidOverlap:{number:wY},__type__:{object:xY}},repulsion:{centralGravity:{number:wY},springLength:{number:wY},springConstant:{number:wY},nodeDistance:{number:wY},damping:{number:wY},__type__:{object:xY}},hierarchicalRepulsion:{centralGravity:{number:wY},springLength:{number:wY},springConstant:{number:wY},nodeDistance:{number:wY},damping:{number:wY},avoidOverlap:{number:wY},__type__:{object:xY}},maxVelocity:{number:wY},minVelocity:{number:wY},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:bY},iterations:{number:wY},updateInterval:{number:wY},onlyDynamicEdges:{boolean:bY},fit:{boolean:bY},__type__:{object:xY,boolean:bY}},timestep:{number:wY},adaptiveTimestep:{boolean:bY},wind:{x:{number:wY},y:{number:wY},__type__:{object:xY}},__type__:{object:xY,boolean:bY}},autoResize:{boolean:bY},clickToUse:{boolean:bY},locale:{string:yY},locales:{__any__:{any:"any"},__type__:{object:xY}},height:{string:yY},width:{string:yY},__type__:{object:xY}},CY={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]}}},TY=(t,e,i)=>{var n;return!(!lI(t).call(t,"physics")||!lI(n=CY.physics.solver).call(n,e)||i.physics.solver===e||"wind"===e)};class kY{getDistances(t,e,i){const n={},o=t.edges;for(let t=0;t<e.length;t++){const i={};n[e[t]]=i;for(let n=0;n<e.length;n++)i[e[n]]=t==n?0:1e9}for(let t=0;t<i.length;t++){const e=o[i[t]];!0===e.connected&&void 0!==n[e.fromId]&&void 0!==n[e.toId]&&(n[e.fromId][e.toId]=1,n[e.toId][e.fromId]=1)}const r=e.length;for(let t=0;t<r;t++){const i=e[t],o=n[i];for(let t=0;t<r-1;t++){const s=e[t],a=n[s];for(let h=t+1;h<r;h++){const t=e[h],r=n[t],d=Math.min(a[t],a[i]+o[t]);a[t]=d,r[s]=d}}}return n}}class DY{constructor(t,e,i){this.body=t,this.springLength=e,this.springConstant=i,this.distanceSolver=new kY}setOptions(t){t&&(t.springLength&&(this.springLength=t.springLength),t.springConstant&&(this.springConstant=t.springConstant))}solve(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=this.distanceSolver.getDistances(this.body,t,e);this._createL_matrix(n),this._createK_matrix(n),this._createE_matrix();let o=0;const r=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3));let s=1e9,a=0,h=0,d=0,c=0,l=0;for(;s>.01&&o<r;)for(o+=1,[a,s,h,d]=this._getHighestEnergyNode(i),c=s,l=0;c>1&&l<5;)l+=1,this._moveNode(a,h,d),[c,h,d]=this._getEnergy(a)}_getHighestEnergyNode(t){const e=this.body.nodeIndices,i=this.body.nodes;let n=0,o=e[0],r=0,s=0;for(let a=0;a<e.length;a++){const h=e[a];if(!0!==i[h].predefinedPosition||!0===i[h].isCluster&&!0===t||!0!==i[h].options.fixed.x||!0!==i[h].options.fixed.y){const[t,e,i]=this._getEnergy(h);n<t&&(n=t,o=h,r=e,s=i)}}return[o,n,r,s]}_getEnergy(t){const[e,i]=this.E_sums[t];return[Math.sqrt(e**2+i**2),e,i]}_moveNode(t,e,i){const n=this.body.nodeIndices,o=this.body.nodes;let r=0,s=0,a=0;const h=o[t].x,d=o[t].y,c=this.K_matrix[t],l=this.L_matrix[t];for(let e=0;e<n.length;e++){const i=n[e];if(i!==t){const t=o[i].x,e=o[i].y,n=c[i],u=l[i],f=1/((h-t)**2+(d-e)**2)**1.5;r+=n*(1-u*(d-e)**2*f),s+=n*(u*(h-t)*(d-e)*f),a+=n*(1-u*(h-t)**2*f)}}const u=(e/r+i/s)/(s/r-a/s),f=-(s*u+e)/r;o[t].x+=f,o[t].y+=u,this._updateE_matrix(t)}_createL_matrix(t){const e=this.body.nodeIndices,i=this.springLength;this.L_matrix=[];for(let n=0;n<e.length;n++){this.L_matrix[e[n]]={};for(let o=0;o<e.length;o++)this.L_matrix[e[n]][e[o]]=i*t[e[n]][e[o]]}}_createK_matrix(t){const e=this.body.nodeIndices,i=this.springConstant;this.K_matrix=[];for(let n=0;n<e.length;n++){this.K_matrix[e[n]]={};for(let o=0;o<e.length;o++)this.K_matrix[e[n]][e[o]]=i*t[e[n]][e[o]]**-2}}_createE_matrix(){const t=this.body.nodeIndices,e=this.body.nodes;this.E_matrix={},this.E_sums={};for(let e=0;e<t.length;e++)this.E_matrix[t[e]]=[];for(let i=0;i<t.length;i++){const n=t[i],o=e[n].x,r=e[n].y;let s=0,a=0;for(let h=i;h<t.length;h++){const d=t[h];if(d!==n){const t=e[d].x,c=e[d].y,l=1/Math.sqrt((o-t)**2+(r-c)**2);this.E_matrix[n][h]=[this.K_matrix[n][d]*(o-t-this.L_matrix[n][d]*(o-t)*l),this.K_matrix[n][d]*(r-c-this.L_matrix[n][d]*(r-c)*l)],this.E_matrix[d][i]=this.E_matrix[n][h],s+=this.E_matrix[n][h][0],a+=this.E_matrix[n][h][1]}}this.E_sums[n]=[s,a]}}_updateE_matrix(t){const e=this.body.nodeIndices,i=this.body.nodes,n=this.E_matrix[t],o=this.K_matrix[t],r=this.L_matrix[t],s=i[t].x,a=i[t].y;let h=0,d=0;for(let c=0;c<e.length;c++){const l=e[c];if(l!==t){const t=n[c],e=t[0],u=t[1],f=i[l].x,p=i[l].y,g=1/Math.sqrt((s-f)**2+(a-p)**2),v=o[l]*(s-f-r[l]*(s-f)*g),m=o[l]*(a-p-r[l]*(a-p)*g);n[c]=[v,m],h+=v,d+=m;const y=this.E_sums[l];y[0]+=v-e,y[1]+=m-u}}this.E_sums[t]=[h,d]}}function IY(t,e,i){var n,o,r,s;if(!(this instanceof IY))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:tA,clickToUse:!1},ME(this.options,this.defaultOptions),this.body={container:t,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:LE(n=this.on).call(n,this),off:LE(o=this.off).call(o,this),emit:LE(r=this.emit).call(r,this),once:LE(s=this.once).call(s,this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}},selectionBox:{show:!1,position:{start:{x:0,y:0},end:{x:0,y:0}}}},this.bindEventListeners(),this.images=new iA(()=>this.body.emitter.emit("_requestRedraw")),this.groups=new yB,this.canvas=new JW(this.body),this.selectionHandler=new iU(this.body,this.canvas),this.interactionHandler=new iq(this.body,this.canvas,this.selectionHandler),this.view=new $W(this.body,this.canvas),this.renderer=new qW(this.body,this.canvas),this.physics=new AW(this.body),this.layoutEngine=new vY(this.body),this.clustering=new WW(this.body),this.manipulation=new mY(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new qH(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new TW(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new DY(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(i),this.setData(e)}mO(IY.prototype),IY.prototype.setOptions=function(t){if(null===t&&(t=void 0),void 0!==t){!0===Oz.validate(t,SY)&&console.error("%cErrors have been found in the supplied options object.",Ez);if(XF(["locale","locales","clickToUse"],this.options,t),void 0!==t.locale&&(t.locale=function(t,e){try{const[n,o]=e.split(/[-_ /]/,2),r=null!=n?n.toLowerCase():null,s=null!=o?o.toUpperCase():null;if(r&&s){const e=r+"-"+s;if(Object.prototype.hasOwnProperty.call(t,e))return e;var i;console.warn(AI(i="Unknown variant ".concat(s," of language ")).call(i,r,"."))}if(r){const e=r;if(Object.prototype.hasOwnProperty.call(t,e))return e;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 wz(this,this.body.container,CY,this.canvas.pixelRatio,TY)),this.configurator.setOptions(t.configure)),this.configurator&&!0===this.configurator.options.enabled){const t={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};KF(t.nodes,this.nodesHandler.options),KF(t.edges,this.edgesHandler.options),KF(t.layout,this.layoutEngine.options),KF(t.interaction,this.selectionHandler.options),KF(t.interaction,this.renderer.options),KF(t.interaction,this.interactionHandler.options),KF(t.manipulation,this.manipulation.options),KF(t.physics,this.physics.options),KF(t.global,this.canvas.options),KF(t.global,this.options),this.configurator.setModuleOptions(t)}void 0!==t.clickToUse?!0===t.clickToUse?void 0===this.activator&&(this.activator=new bz(this.canvas.frame),this.activator.on("change",()=>{this.body.emitter.emit("activate")})):(void 0!==this.activator&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}},IY.prototype._updateVisibleIndices=function(){const t=this.body.nodes,e=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.clustering._isClusteredNode(e)||!1!==t[e].options.hidden||this.body.nodeIndices.push(t[e].id));for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const n=e[i],o=t[n.fromId],r=t[n.toId],s=void 0!==o&&void 0!==r;!this.clustering._isClusteredEdge(i)&&!1===n.options.hidden&&s&&!1===o.options.hidden&&!1===r.options.hidden&&this.body.edgeIndices.push(n.id)}},IY.prototype.bindEventListeners=function(){this.body.emitter.on("_dataChanged",()=>{this.edgesHandler._updateState(),this.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",()=>{this.clustering._updateState(),this._updateVisibleIndices(),this._updateValueRange(this.body.nodes),this._updateValueRange(this.body.edges),this.body.emitter.emit("startSimulation"),this.body.emitter.emit("_requestRedraw")})},IY.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);");const e=$z(t.dot);return void this.setData(e)}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);");const e=function(t){var e;let{fixed:i=!1,inheritColor:n=!1,parseColor:o=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=t.edges,s=gk(r).call(r,t=>{const 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&&(e.color=t.color),e});return{nodes:gk(e=t.nodes).call(e,t=>{const e={id:t.id,fixed:i&&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&&(e.color=!0===o?t.color:{background:t.color,border:t.color,highlight:{background:t.color,border:t.color},hover:{background:t.color,border:t.color}}),e}),edges:s}}(t.gephi);return void this.setData(e)}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")},IY.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&delete this.body.nodes[t];for(const t in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,t)&&delete this.body.edges[t];WF(this.body.container)},IY.prototype._updateValueRange=function(t){let e,i,n,o=0;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const 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)},IY.prototype.isActive=function(){return!this.activator||this.activator.active},IY.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},IY.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},IY.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},IY.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},IY.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},IY.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},IY.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},IY.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},IY.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},IY.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},IY.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)},IY.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)},IY.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)},IY.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)},IY.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)},IY.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},IY.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},IY.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},IY.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},IY.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},IY.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},IY.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},IY.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},IY.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},IY.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},IY.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},IY.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)},IY.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},IY.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},IY.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},IY.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)},IY.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},IY.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},IY.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},IY.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},IY.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},IY.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},IY.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)},IY.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)},IY.prototype.getNodeAt=function(){const t=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return void 0!==t&&void 0!==t.id?t.id:t},IY.prototype.getEdgeAt=function(){const t=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return void 0!==t&&void 0!==t.id?t.id:t},IY.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},IY.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},IY.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()},IY.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},IY.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},IY.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},IY.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},IY.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},IY.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},IY.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},IY.prototype.getOptionsFromConfigurator=function(){let t={};return this.configurator&&(t=this.configurator.getOptions.apply(this.configurator)),t};function PY(t,e){const i=document.createElement("div"),n=document.createElement("span"),o=document.createTextNode(t),r=document.createElement("b"),s=document.createTextNode(e);return n.appendChild(o),r.appendChild(s),i.appendChild(n),i.appendChild(r),i}function MY({element:t,layout:e,theme:i,selections:n,constraints:o}){return new Promise(r=>{const s=i.getDataColorPalettes()[0],a=e.qHyperCube.qDimensionInfo.length,h=e.qHyperCube.qMeasureInfo.length;var d=e.qHyperCube.qDataPages[0],c="network-container_"+e.qInfo.qId;if(d&&d.qMatrix){t.textContent="";const i=document.createElement("div");i.setAttribute("id",c),i.classList.add("sn-network-top"),o.passive&&i.classList.add("is-edit-mode"),t.append(i);var l=d.qMatrix.map(function(t){const e=t[1].qText;let i;const n={id:t[0].qText,eNum:t[0].qElemNumber,label:e,parentid:t[2].qText};if(4===a&&(i=t[3].qText,n.group=i),h>0){const s=t[a];if(function(t){return t.qText&&!(t.qIsNull||""==t.qText.trim())}(s)){const t=s.qText;n.title=(o=t,(r=document.createElement("span")).appendChild(document.createTextNode(o)),r.innerHTML)}else if(h>1){const o=t[a+1].qText;n.title=function({name:t,groupNumber:e,nodeMeasure:i}){const n=document.createElement("div"),o=PY("Name: ",t),r=PY("Group number: ",e),s=PY("Node measure: ",i);return n.appendChild(o),n.appendChild(r),n.appendChild(s),n}({name:e,groupNumber:i,nodeMeasure:o})}}var o,r;return h>1&&t[a+1].qNum&&(n.nodeValue=t[a+1].qNum),h>2&&t[a+2].qNum&&(n.edgeValue=t[a+2].qNum),n}),u=[],f=[],p=[];const w={};for(let t=0;t<l.length;t++)if(e.displayEdgeLabel&&void 0!==l[t].edgeValue?p.push({from:l[t].id,to:l[t].parentid,value:l[t].edgeValue,label:`${l[t].edgeValue}`}):p.push({from:l[t].id,to:l[t].parentid,value:l[t].edgeValue}),-1===u.indexOf(l[t].id)){u.push(l[t].id);var g={id:l[t].id,eNum:l[t].eNum,label:l[t].label,title:l[t].title,group:l[t].group,value:l[t].nodeValue};f.push(g),w[g.group]={}}const _=s.colors[Math.min(Object.keys(w).length-1,s.colors.length-1)];Object.keys(w).forEach(function(t,e){w[t].color=function(t,e){return e[t%e.length]}(e,_)});var v={nodes:f,edges:p},m=document.getElementById(c),y={groups:w,layout:{randomSeed:34545},nodes:{shape:e.nodeShape,shadow:e.shadowMode},edges:{shadow:e.shadowMode,font:{align:e.posEdgeLabel},smooth:{type:e.edgeType}},interaction:{hideEdgesOnDrag:!0,selectable:!o.active&&!o.select,tooltipDelay:100,multiselect:!0,selectConnectedEdges:!0},physics:{forceAtlas2Based:{gravitationalConstant:-100,centralGravity:.005,springLength:230,springConstant:.18},maxVelocity:146,solver:"forceAtlas2Based",timestep:.35,stabilization:{iterations:150}}},b=new IY(m,v,y);b.fit(),b.on("select",function(t){if(Object.prototype.hasOwnProperty.call(t,"nodes")&&!o.active&&!o.select){const t=b.getSelectedNodes();if(t.length>0){var e=t.map(t=>b.getConnectedNodes(t));e.push(t);var i=e.flat();const o=[];i.forEach(function(t){var e;v.nodes.forEach(function(i){i.id===t&&"-"!==t&&(e=i.eNum)}),void 0!==e&&-1===o.indexOf(e)&&o.push(e)}),n.isActive()||n.begin("/qHyperCubeDef"),n.select({method:"selectHyperCubeValues",params:["/qHyperCubeDef",0,o,!1]})}}}),b.on("stabilizationIterationsDone",function(){b.stopSimulation(),r(b)})}else r()})}return function(t,e){void 0===e&&(e={});var i=e.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}('.is-edit-mode > div {\n  pointer-events: none;\n}\n\n.sn-network-top {\n  height: 100%;\n  width: 100%;\n  overflow: "auto";\n  cursor: default;\n}\n\n.vis-tooltip {\n  position: absolute;\n  background-color: #333;\n  opacity: 0.95;\n  border-radius: 5px;\n  color: #eee;\n  padding: 10px;\n  max-width: 200px;\n}\n\n.qlik-network-chart-italic-property {\n  font-style: italic;\n}\n'),function(){return{qae:{properties:o,data:{targets:[{path:"/qHyperCubeDef",dimensions:{min:3,max:4,description:(t,i)=>e[i]},measures:{min:0,max:3,description:(t,e)=>n[e]}}]}},component(){const e=t.useStaleLayout(),i=t.useElement(),n=t.useTheme(),o=t.useRect(),r=t.useConstraints(),s=t.useSelections(),[a,h]=t.useState();t.useEffect(()=>{a&&a.fit()},[o.width,o.height]),t.usePromise(()=>MY({element:i,layout:e,theme:n,constraints:r,selections:s}).then(t=>h(t)),[e,i,n.name(),r])},ext:{definition:{type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{disabledRef:"",items:{helpDesc:{component:"text",style:"qlik-network-chart-italic-property",label:function(t,e){var n;return e.getDimensions().forEach((e,i)=>{e.qDef.cId===t.qDef.cId&&(n=i)}),i[n]}}}},measures:{disabledRef:""}}},sorting:{uses:"sorting"},addons:{uses:"addons",items:{dataHandling:{uses:"dataHandling"}}},settings:{type:"items",uses:"settings",items:{presentation:{type:"items",grouped:!1,translation:"properties.presentation",items:{edgeType:{ref:"edgeType",type:"string",component:"dropdown",label:"Edge Type",options:[{value:"dynamic"},{value:"continuous"},{value:"discrete"},{value:"diagonalCross"},{value:"straightCross"},{value:"horizontal"},{value:"vertical"},{value:"curvedCW"},{value:"curvedCCW"},{value:"cubicBezier"}],defaultValue:"dynamic"},displayEdgeLabel:{ref:"displayEdgeLabel",type:"boolean",component:"switch",label:"Display Edge Value",options:[{value:!0,label:"On"},{value:!1,label:"Off"}],defaultValue:!1},posEdgeLabel:{ref:"posEdgeLabel",type:"string",component:"dropdown",label:"Position Edge Label",options:[{value:"top"},{value:"middle"},{value:"bottom"},{value:"horizontal"}],defaultValue:"top"},nodeShape:{ref:"nodeShape",type:"string",component:"dropdown",label:"Node Shape",options:[{value:"dot"},{value:"square"},{value:"star"},{value:"triangle"},{value:"triangleDown"},{value:"diamond"}],defaultValue:"dot"},shadowMode:{ref:"shadowMode",type:"boolean",component:"switch",label:"Display Shadow",options:[{value:!0,label:"On"},{value:!1,label:"Off"}],defaultValue:!1}}}}},about:{component:"items",label:"About",items:{header:{label:"Network chart",style:"header",component:"text"},paragraph1:{label:"Network chart is Qlik Sense chart which\n              allows you to draw a network of connected\n              nodes and edges from a data set to a sheet.",component:"text"},paragraph2:{label:"Network chart is based upon an extension created by Michael Laenen.",component:"text"}}}}},support:{export:!0,snapshot:!0,exportData:!0},snapshot:{canTakeSnapshot:!0}}}}});
//# sourceMappingURL=sn-network-chart.js.map
