@nuxt/devtools-nightly 2.5.0-beta.2-29150288.5c8decd → 2.6.0-29186511.e07326b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/chunks/module-main.mjs +95 -16
  2. package/dist/client/200.html +23 -23
  3. package/dist/client/404.html +23 -23
  4. package/dist/client/_nuxt/__blank-n1wcnoye.js +1 -0
  5. package/dist/client/_nuxt/{analyze-build-c8n8w1is.js → analyze-build-eb2jljrx.js} +1 -1
  6. package/dist/client/_nuxt/{assets-f19dtlim.js → assets-lcjozkfp.js} +1 -1
  7. package/dist/client/_nuxt/builds/latest.json +1 -1
  8. package/dist/client/_nuxt/builds/meta/485dba79-e785-451e-b739-caf93777cba1.json +1 -0
  9. package/dist/client/_nuxt/{client-jlcyzfwz.js → client-oeqdl4pb.js} +1 -1
  10. package/dist/client/_nuxt/{code-diff.vue-iuef2e0d.js → code-diff.vue-kz2j54xj.js} +1 -1
  11. package/dist/client/_nuxt/{code-snippets.vue-lcv571et.js → code-snippets.vue-g8lturap.js} +1 -1
  12. package/dist/client/_nuxt/{components-e0sl8q7l.js → components-oqwebfbz.js} +1 -1
  13. package/dist/client/_nuxt/{composable-item.vue-cywhx0x4.js → composable-item.vue-k0gann02.js} +1 -1
  14. package/dist/client/_nuxt/{custom-_name_-o9cvmxyw.js → custom-_name_-e1p69zsn.js} +1 -1
  15. package/dist/client/_nuxt/d4l1qhkt.js +15 -0
  16. package/dist/client/_nuxt/{data-schema-button.vue-mqkicq6m.js → data-schema-button.vue-dflbw7il.js} +1 -1
  17. package/dist/client/_nuxt/{data-schema-drawer-hogf5xu5.js → data-schema-drawer-htrhb3ga.js} +1 -1
  18. package/dist/client/_nuxt/{debug-ivuffd74.js → debug-evmunf4x.js} +1 -1
  19. package/dist/client/_nuxt/{default-pbh9q2kx.js → default-iipg6xeh.js} +1 -1
  20. package/dist/client/_nuxt/{duration-display.vue-l7hutejt.js → duration-display.vue-mr4ha0rw.js} +1 -1
  21. package/dist/client/_nuxt/{entry.css-gmgc8zz6.css → entry.css-mloq4mxl.css} +1 -1
  22. package/dist/client/_nuxt/{error-404-co9kq9bc.js → error-404-395jj60f.js} +1 -1
  23. package/dist/client/_nuxt/error-404.css-nshsg2y9.css +1 -0
  24. package/dist/client/_nuxt/{error-500-ch0d12ts.js → error-500-f3t39pcr.js} +1 -1
  25. package/dist/client/_nuxt/error-500.css-oevnk76c.css +1 -0
  26. package/dist/client/_nuxt/{error-k6e8l2nx.js → error-jjca60v0.js} +1 -1
  27. package/dist/client/_nuxt/{filepath-item.vue-nec1tiua.js → filepath-item.vue-4k76zrib.js} +1 -1
  28. package/dist/client/_nuxt/full-h3i61hq3.js +1 -0
  29. package/dist/client/_nuxt/{help-fab.vue-j4hsr7fl.js → help-fab.vue-ees8gnes.js} +1 -1
  30. package/dist/client/_nuxt/{hooks-jal8g45d.js → hooks-ifmd0zhh.js} +1 -1
  31. package/dist/client/_nuxt/{imports-g135ykem.js → imports-m6pbzd1d.js} +1 -1
  32. package/dist/client/_nuxt/{index-fmhuvr9r.js → index-kgyi2yh2.js} +1 -1
  33. package/dist/client/_nuxt/{launch-page.vue-cj56ksf6.js → launch-page.vue-fo50xgr8.js} +1 -1
  34. package/dist/client/_nuxt/{modules-jbycp970.js → modules-lur27hsf.js} +1 -1
  35. package/dist/client/_nuxt/nbadge-fj2rm1de.js +1 -0
  36. package/dist/client/_nuxt/{ncheckbox.vue-ez8ceehj.js → ncheckbox.vue-abcszb90.js} +1 -1
  37. package/dist/client/_nuxt/{ncode-block.vue-lge6rogf.js → ncode-block.vue-ctkw4rc7.js} +1 -1
  38. package/dist/client/_nuxt/{ndrawer.vue-nl4kbgle.js → ndrawer.vue-ca2zwgda.js} +1 -1
  39. package/dist/client/_nuxt/{ndropdown.vue-j5j0m6g1.js → ndropdown.vue-o1mu73dz.js} +1 -1
  40. package/dist/client/_nuxt/{nicon-title.vue-d27ih16g.js → nicon-title.vue-ejocqf9t.js} +1 -1
  41. package/dist/client/_nuxt/{nlink.vue-chc4mw8i.js → nlink.vue-fnwgqjjw.js} +1 -1
  42. package/dist/client/_nuxt/{nmarkdown.vue-isat7p33.js → nmarkdown.vue-mk2gi3ky.js} +1 -1
  43. package/dist/client/_nuxt/{nnavbar.vue-m6u99xdq.js → nnavbar.vue-m11od8rw.js} +1 -1
  44. package/dist/client/_nuxt/none-k1h4kfsw.js +1 -0
  45. package/dist/client/_nuxt/nsection-block-bwf4iqfa.js +1 -0
  46. package/dist/client/_nuxt/nsection-block.css-h1lgpwgm.css +1 -0
  47. package/dist/client/_nuxt/{nselect-tabs.vue-cv6z1jnp.js → nselect-tabs.vue-gag62xdh.js} +1 -1
  48. package/dist/client/_nuxt/{nselect.vue-d6agf93x.js → nselect.vue-o7hxp3e6.js} +1 -1
  49. package/dist/client/_nuxt/{nswitch.vue-f07mzo8x.js → nswitch.vue-bpoo3j7g.js} +1 -1
  50. package/dist/client/_nuxt/{open-graph-nws9tgvm.js → open-graph-h8b4acc0.js} +2 -2
  51. package/dist/client/_nuxt/{open-graph.css-e21qzmvj.css → open-graph.css-me89qec1.css} +1 -1
  52. package/dist/client/_nuxt/overview-npodpo3o.js +1 -0
  53. package/dist/client/_nuxt/{pages-f84avxfp.js → pages-n4rr3gbz.js} +1 -1
  54. package/dist/client/_nuxt/{payload-boaifw7u.js → payload-ocm11zrm.js} +1 -1
  55. package/dist/client/_nuxt/pinia-dtjw247y.js +1 -0
  56. package/dist/client/_nuxt/{plugins-em732omz.js → plugins-nkdqxcsm.js} +1 -1
  57. package/dist/client/_nuxt/{render-tree-iwcxj33n.js → render-tree-bh2a86yu.js} +1 -1
  58. package/dist/client/_nuxt/{runtime-configs-ey41sy4o.js → runtime-configs-nwpys25e.js} +1 -1
  59. package/dist/client/_nuxt/{server-discovery-e88v81qh.js → server-discovery-d79uydc8.js} +1 -1
  60. package/dist/client/_nuxt/{server-route-inputs.vue-clci6g9v.js → server-route-inputs.vue-o0mqxezh.js} +1 -1
  61. package/dist/client/_nuxt/{server-routes-gecli2i0.js → server-routes-ciamn551.js} +1 -1
  62. package/dist/client/_nuxt/{server-tasks-c37ave67.js → server-tasks-matzavvi.js} +1 -1
  63. package/dist/client/_nuxt/{settings-e0w9xf3z.js → settings-mfmb06ev.js} +1 -1
  64. package/dist/client/_nuxt/{stacktrace-list.vue-g9vgsi1y.js → stacktrace-list.vue-hmslf77s.js} +1 -1
  65. package/dist/client/_nuxt/{state-components-finoop9s.js → state-components-hy3y7bn1.js} +1 -1
  66. package/dist/client/_nuxt/{state-editor.vue-fvagydt1.js → state-editor.vue-jo1mwgo8.js} +1 -1
  67. package/dist/client/_nuxt/{state-modules-jhjy9g0e.js → state-modules-mkxs0qt2.js} +1 -1
  68. package/dist/client/_nuxt/{storage-glu460fx.js → storage-jardulnr.js} +1 -1
  69. package/dist/client/_nuxt/{terminals-gid5bjyv.js → terminals-ddhazyzf.js} +1 -1
  70. package/dist/client/_nuxt/{timeline-b26y3n4n.js → timeline-nvota7i2.js} +1 -1
  71. package/dist/client/_nuxt/timeline.css-otdwftpy.css +1 -0
  72. package/dist/client/_nuxt/{unocss-runtime-n76zvjc0.js → unocss-runtime-cdytntxi.js} +1 -1
  73. package/dist/client/_nuxt/vendor/json-editor-vue-m9gzt21j.js +3869 -0
  74. package/dist/client/_nuxt/vendor/{quicktype-core-lhaz4hgj.js → quicktype-core-dsrweb93.js} +3 -3
  75. package/dist/client/_nuxt/vendor/{shiki-hjqm7vcp.js → shiki-imfwxqoq.js} +16 -16
  76. package/dist/client/_nuxt/vendor/unocss-oyl7opas.js +2 -0
  77. package/dist/client/_nuxt/vendor/vis-n7jjo36l.js +89 -0
  78. package/dist/client/_nuxt/{virtual-files-k71pao6g.js → virtual-files-b4evb9va.js} +1 -1
  79. package/dist/client/_nuxt/{vue-devtools-mn79zusm.js → vue-devtools-nfxlq1k4.js} +2 -2
  80. package/dist/client/_nuxt/{vue-virtual-scroller.esm-nuoya9vo.js → vue-virtual-scroller.esm-k5helfir.js} +1 -1
  81. package/dist/client/index.html +23 -23
  82. package/dist/module.json +1 -1
  83. package/dist/webcomponents/index.mjs +15 -15
  84. package/package.json +36 -36
  85. package/dist/client/_nuxt/__blank-mumgdw29.js +0 -1
  86. package/dist/client/_nuxt/builds/meta/27eb4014-aa91-4d5c-a619-e937951c559e.json +0 -1
  87. package/dist/client/_nuxt/error-404.css-elh6uwdu.css +0 -1
  88. package/dist/client/_nuxt/error-500.css-bxkdntg7.css +0 -1
  89. package/dist/client/_nuxt/full-bpxo9637.js +0 -1
  90. package/dist/client/_nuxt/h0tvruov.js +0 -15
  91. package/dist/client/_nuxt/nbadge-j82qwdzi.js +0 -1
  92. package/dist/client/_nuxt/none-abku8qqc.js +0 -1
  93. package/dist/client/_nuxt/nsection-block-mv0zng0n.js +0 -1
  94. package/dist/client/_nuxt/nsection-block.css-e7kbjm7k.css +0 -1
  95. package/dist/client/_nuxt/overview-i4bvonsm.js +0 -1
  96. package/dist/client/_nuxt/pinia-kf0d3irp.js +0 -1
  97. package/dist/client/_nuxt/timeline.css-pdb8jvzb.css +0 -1
  98. package/dist/client/_nuxt/vendor/json-editor-vue-pb6xqf2y.js +0 -3857
  99. package/dist/client/_nuxt/vendor/unocss-k776m6tm.js +0 -2
  100. package/dist/client/_nuxt/vendor/vis-gqe7ml2e.js +0 -98
@@ -0,0 +1,89 @@
1
+ /**
2
+ * vis-data
3
+ * http://visjs.org/
4
+ *
5
+ * Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
6
+ *
7
+ * @version 7.1.9
8
+ * @date 2023-11-24T17:53:34.179Z
9
+ *
10
+ * @copyright (c) 2011-2017 Almende B.V, http://almende.com
11
+ * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
12
+ *
13
+ * @license
14
+ * vis.js is dual licensed under both
15
+ *
16
+ * 1. The Apache 2.0 License
17
+ * http://www.apache.org/licenses/LICENSE-2.0
18
+ *
19
+ * and
20
+ *
21
+ * 2. The MIT License
22
+ * http://opensource.org/licenses/MIT
23
+ *
24
+ * vis.js may be distributed under either license.
25
+ */function el(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var nd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function R(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Kb={exports:{}},Ss=function(i){return i&&i.Math===Math&&i},ne=Ss(typeof globalThis=="object"&&globalThis)||Ss(typeof window=="object"&&window)||Ss(typeof self=="object"&&self)||Ss(typeof nd=="object"&&nd)||function(){return this}()||nd||Function("return this")(),Y=function(i){try{return!!i()}catch{return!0}},CS=Y,Po=!CS(function(){var i=function(){}.bind();return typeof i!="function"||i.hasOwnProperty("prototype")}),xS=Po,Gb=Function.prototype,Jf=Gb.apply,Qf=Gb.call,mn=typeof Reflect=="object"&&Reflect.apply||(xS?Qf.bind(Jf):function(){return Qf.apply(Jf,arguments)}),Yb=Po,qb=Function.prototype,pc=qb.call,AS=Yb&&qb.bind.bind(pc,pc),te=Yb?AS:function(i){return function(){return pc.apply(i,arguments)}},Xb=te,DS=Xb({}.toString),MS=Xb("".slice),Fr=function(i){return MS(DS(i),8,-1)},kS=Fr,RS=te,Zb=function(i){if(kS(i)==="Function")return RS(i)},gc=typeof document=="object"&&document.all,NS=typeof gc>"u"&&gc!==void 0,Jb={all:gc,IS_HTMLDDA:NS},Qb=Jb,FS=Qb.all,ue=Qb.IS_HTMLDDA?function(i){return typeof i=="function"||i===FS}:function(i){return typeof i=="function"},yi={},BS=Y,De=!BS(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),LS=Po,Os=Function.prototype.call,Me=LS?Os.bind(Os):function(){return Os.apply(Os,arguments)},tl={},e$={}.propertyIsEnumerable,t$=Object.getOwnPropertyDescriptor,jS=t$&&!e$.call({1:2},1);tl.f=jS?function(e){var t=t$(this,e);return!!t&&t.enumerable}:e$;var mi=function(i,e){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:e}},zS=te,HS=Y,WS=Fr,od=Object,VS=zS("".split),rl=HS(function(){return!od("z").propertyIsEnumerable(0)})?function(i){return WS(i)==="String"?VS(i,""):od(i)}:od,bn=function(i){return i==null},US=bn,KS=TypeError,_u=function(i){if(US(i))throw new KS("Can't call method on "+i);return i},GS=rl,YS=_u,Kt=function(i){return GS(YS(i))},ev=ue,r$=Jb,qS=r$.all,Be=r$.IS_HTMLDDA?function(i){return typeof i=="object"?i!==null:ev(i)||i===qS}:function(i){return typeof i=="object"?i!==null:ev(i)},oe={},sd=oe,ad=ne,XS=ue,tv=function(i){return XS(i)?i:void 0},Ze=function(i,e){return arguments.length<2?tv(sd[i])||tv(ad[i]):sd[i]&&sd[i][e]||ad[i]&&ad[i][e]},ZS=te,Se=ZS({}.isPrototypeOf),Br=typeof navigator<"u"&&String(navigator.userAgent)||"",i$=ne,ld=Br,rv=i$.process,iv=i$.Deno,nv=rv&&rv.versions||iv&&iv.version,ov=nv&&nv.v8,Ot,Pa;ov&&(Ot=ov.split("."),Pa=Ot[0]>0&&Ot[0]<4?1:+(Ot[0]+Ot[1]));!Pa&&ld&&(Ot=ld.match(/Edge\/(\d+)/),(!Ot||Ot[1]>=74)&&(Ot=ld.match(/Chrome\/(\d+)/),Ot&&(Pa=+Ot[1])));var $n=Pa,sv=$n,JS=Y,QS=ne,eO=QS.String,wn=!!Object.getOwnPropertySymbols&&!JS(function(){var i=Symbol("symbol detection");return!eO(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&sv&&sv<41}),tO=wn,n$=tO&&!Symbol.sham&&typeof Symbol.iterator=="symbol",rO=Ze,iO=ue,nO=Se,oO=n$,sO=Object,Co=oO?function(i){return typeof i=="symbol"}:function(i){var e=rO("Symbol");return iO(e)&&nO(e.prototype,sO(i))},aO=String,En=function(i){try{return aO(i)}catch{return"Object"}},lO=ue,dO=En,hO=TypeError,lt=function(i){if(lO(i))return i;throw new hO(dO(i)+" is not a function")},cO=lt,uO=bn,Su=function(i,e){var t=i[e];return uO(t)?void 0:cO(t)},dd=Me,hd=ue,cd=Be,fO=TypeError,vO=function(i,e){var t,r;if(e==="string"&&hd(t=i.toString)&&!cd(r=dd(t,i))||hd(t=i.valueOf)&&!cd(r=dd(t,i))||e!=="string"&&hd(t=i.toString)&&!cd(r=dd(t,i)))return r;throw new fO("Can't convert object to primitive value")},o$={exports:{}},pO=!0,av=ne,gO=Object.defineProperty,yO=function(i,e){try{gO(av,i,{value:e,configurable:!0,writable:!0})}catch{av[i]=e}return e},mO=ne,bO=yO,lv="__core-js_shared__",$O=mO[lv]||bO(lv,{}),Ou=$O,dv=Ou;(o$.exports=function(i,e){return dv[i]||(dv[i]=e!==void 0?e:{})})("versions",[]).push({version:"3.33.2",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE",source:"https://github.com/zloirock/core-js"});var _n=o$.exports,wO=_u,EO=Object,dt=function(i){return EO(wO(i))},_O=te,SO=dt,OO=_O({}.hasOwnProperty),Oe=Object.hasOwn||function(e,t){return OO(SO(e),t)},TO=te,IO=0,PO=Math.random(),CO=TO(1 .toString),il=function(i){return"Symbol("+(i===void 0?"":i)+")_"+CO(++IO+PO,36)},xO=ne,AO=_n,hv=Oe,DO=il,MO=wn,kO=n$,zi=xO.Symbol,ud=AO("wks"),RO=kO?zi.for||zi:zi&&zi.withoutSetter||DO,ae=function(i){return hv(ud,i)||(ud[i]=MO&&hv(zi,i)?zi[i]:RO("Symbol."+i)),ud[i]},NO=Me,cv=Be,uv=Co,FO=Su,BO=vO,LO=ae,jO=TypeError,zO=LO("toPrimitive"),HO=function(i,e){if(!cv(i)||uv(i))return i;var t=FO(i,zO),r;if(t){if(e===void 0&&(e="default"),r=NO(t,i,e),!cv(r)||uv(r))return r;throw new jO("Can't convert object to primitive value")}return e===void 0&&(e="number"),BO(i,e)},WO=HO,VO=Co,nl=function(i){var e=WO(i,"string");return VO(e)?e:e+""},UO=ne,fv=Be,yc=UO.document,KO=fv(yc)&&fv(yc.createElement),Tu=function(i){return KO?yc.createElement(i):{}},GO=De,YO=Y,qO=Tu,s$=!GO&&!YO(function(){return Object.defineProperty(qO("div"),"a",{get:function(){return 7}}).a!==7}),XO=De,ZO=Me,JO=tl,QO=mi,eT=Kt,tT=nl,rT=Oe,iT=s$,vv=Object.getOwnPropertyDescriptor;yi.f=XO?vv:function(e,t){if(e=eT(e),t=tT(t),iT)try{return vv(e,t)}catch{}if(rT(e,t))return QO(!ZO(JO.f,e,t),e[t])};var nT=Y,oT=ue,sT=/#|\.prototype\./,xo=function(i,e){var t=lT[aT(i)];return t===hT?!0:t===dT?!1:oT(e)?nT(e):!!e},aT=xo.normalize=function(i){return String(i).replace(sT,".").toLowerCase()},lT=xo.data={},dT=xo.NATIVE="N",hT=xo.POLYFILL="P",a$=xo,pv=Zb,cT=lt,uT=Po,fT=pv(pv.bind),Lr=function(i,e){return cT(i),e===void 0?i:uT?fT(i,e):function(){return i.apply(e,arguments)}},ht={},vT=De,pT=Y,l$=vT&&pT(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),gT=Be,yT=String,mT=TypeError,vt=function(i){if(gT(i))return i;throw new mT(yT(i)+" is not an object")},bT=De,$T=s$,wT=l$,Ts=vt,gv=nl,ET=TypeError,fd=Object.defineProperty,_T=Object.getOwnPropertyDescriptor,vd="enumerable",pd="configurable",gd="writable";ht.f=bT?wT?function(e,t,r){if(Ts(e),t=gv(t),Ts(r),typeof e=="function"&&t==="prototype"&&"value"in r&&gd in r&&!r[gd]){var n=_T(e,t);n&&n[gd]&&(e[t]=r.value,r={configurable:pd in r?r[pd]:n[pd],enumerable:vd in r?r[vd]:n[vd],writable:!1})}return fd(e,t,r)}:fd:function(e,t,r){if(Ts(e),t=gv(t),Ts(r),$T)try{return fd(e,t,r)}catch{}if("get"in r||"set"in r)throw new ET("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var ST=De,OT=ht,TT=mi,ur=ST?function(i,e,t){return OT.f(i,e,TT(1,t))}:function(i,e,t){return i[e]=t,i},Is=ne,IT=mn,PT=Zb,CT=ue,xT=yi.f,AT=a$,Ci=oe,DT=Lr,xi=ur,yv=Oe,MT=function(i){var e=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new i;case 1:return new i(t);case 2:return new i(t,r)}return new i(t,r,n)}return IT(i,this,arguments)};return e.prototype=i.prototype,e},M=function(i,e){var t=i.target,r=i.global,n=i.stat,o=i.proto,s=r?Is:n?Is[t]:(Is[t]||{}).prototype,a=r?Ci:Ci[t]||xi(Ci,t,{})[t],l=a.prototype,d,h,c,u,f,v,y,g,p;for(u in e)d=AT(r?u:t+(n?".":"#")+u,i.forced),h=!d&&s&&yv(s,u),v=a[u],h&&(i.dontCallGetSet?(p=xT(s,u),y=p&&p.value):y=s[u]),f=h&&y?y:e[u],!(h&&typeof v==typeof f)&&(i.bind&&h?g=DT(f,Is):i.wrap&&h?g=MT(f):o&&CT(f)?g=PT(f):g=f,(i.sham||f&&f.sham||v&&v.sham)&&xi(g,"sham",!0),xi(a,u,g),o&&(c=t+"Prototype",yv(Ci,c)||xi(Ci,c,{}),xi(Ci[c],u,f),i.real&&l&&(d||!l[u])&&xi(l,u,f)))},kT=M,RT=De,mv=ht.f;kT({target:"Object",stat:!0,forced:Object.defineProperty!==mv,sham:!RT},{defineProperty:mv});var NT=oe,d$=NT.Object,FT=Kb.exports=function(e,t,r){return d$.defineProperty(e,t,r)};d$.defineProperty.sham&&(FT.sham=!0);var BT=Kb.exports,LT=BT,h$=LT,jT=h$,zT=jT,HT=zT,WT=HT,c$=WT,ol=R(c$),VT=Fr,jr=Array.isArray||function(e){return VT(e)==="Array"},UT=Math.ceil,KT=Math.floor,GT=Math.trunc||function(e){var t=+e;return(t>0?KT:UT)(t)},YT=GT,sl=function(i){var e=+i;return e!==e||e===0?0:YT(e)},qT=sl,XT=Math.min,ZT=function(i){return i>0?XT(qT(i),9007199254740991):0},JT=ZT,pt=function(i){return JT(i.length)},QT=TypeError,eI=9007199254740991,al=function(i){if(i>eI)throw QT("Maximum allowed index exceeded");return i},tI=nl,rI=ht,iI=mi,Sn=function(i,e,t){var r=tI(e);r in i?rI.f(i,r,iI(0,t)):i[r]=t},nI=ae,oI=nI("toStringTag"),u$={};u$[oI]="z";var Iu=String(u$)==="[object z]",sI=Iu,aI=ue,ca=Fr,lI=ae,dI=lI("toStringTag"),hI=Object,cI=ca(function(){return arguments}())==="Arguments",uI=function(i,e){try{return i[e]}catch{}},fr=sI?ca:function(i){var e,t,r;return i===void 0?"Undefined":i===null?"Null":typeof(t=uI(e=hI(i),dI))=="string"?t:cI?ca(e):(r=ca(e))==="Object"&&aI(e.callee)?"Arguments":r},fI=te,vI=ue,mc=Ou,pI=fI(Function.toString);vI(mc.inspectSource)||(mc.inspectSource=function(i){return pI(i)});var f$=mc.inspectSource,gI=te,yI=Y,v$=ue,mI=fr,bI=Ze,$I=f$,p$=function(){},wI=[],g$=bI("Reflect","construct"),Pu=/^\s*(?:class|function)\b/,EI=gI(Pu.exec),_I=!Pu.test(p$),Hn=function(e){if(!v$(e))return!1;try{return g$(p$,wI,e),!0}catch{return!1}},y$=function(e){if(!v$(e))return!1;switch(mI(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _I||!!EI(Pu,$I(e))}catch{return!0}};y$.sham=!0;var ll=!g$||yI(function(){var i;return Hn(Hn.call)||!Hn(Object)||!Hn(function(){i=!0})||i})?y$:Hn,bv=jr,SI=ll,OI=Be,TI=ae,II=TI("species"),$v=Array,PI=function(i){var e;return bv(i)&&(e=i.constructor,SI(e)&&(e===$v||bv(e.prototype))?e=void 0:OI(e)&&(e=e[II],e===null&&(e=void 0))),e===void 0?$v:e},CI=PI,dl=function(i,e){return new(CI(i))(e===0?0:e)},xI=Y,AI=ae,DI=$n,MI=AI("species"),Ao=function(i){return DI>=51||!xI(function(){var e=[],t=e.constructor={};return t[MI]=function(){return{foo:1}},e[i](Boolean).foo!==1})},kI=M,RI=Y,NI=jr,FI=Be,BI=dt,LI=pt,wv=al,Ev=Sn,jI=dl,zI=Ao,HI=ae,WI=$n,m$=HI("isConcatSpreadable"),VI=WI>=51||!RI(function(){var i=[];return i[m$]=!1,i.concat()[0]!==i}),UI=function(i){if(!FI(i))return!1;var e=i[m$];return e!==void 0?!!e:NI(i)},KI=!VI||!zI("concat");kI({target:"Array",proto:!0,forced:KI},{concat:function(e){var t=BI(this),r=jI(t,0),n=0,o,s,a,l,d;for(o=-1,a=arguments.length;o<a;o++)if(d=o===-1?t:arguments[o],UI(d))for(l=LI(d),wv(n+l),s=0;s<l;s++,n++)s in d&&Ev(r,n,d[s]);else wv(n+1),Ev(r,n++,d);return r.length=n,r}});var GI=fr,YI=String,bi=function(i){if(GI(i)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return YI(i)},hl={},qI=sl,XI=Math.max,ZI=Math.min,cl=function(i,e){var t=qI(i);return t<0?XI(t+e,0):ZI(t,e)},JI=Kt,QI=cl,eP=pt,tP=function(i){return function(e,t,r){var n=JI(e),o=eP(n),s=QI(r,o),a;if(i&&t!==t){for(;o>s;)if(a=n[s++],a!==a)return!0}else for(;o>s;s++)if((i||s in n)&&n[s]===t)return i||s||0;return!i&&-1}},rP={indexOf:tP(!1)},Do={},iP=te,yd=Oe,nP=Kt,oP=rP.indexOf,sP=Do,_v=iP([].push),b$=function(i,e){var t=nP(i),r=0,n=[],o;for(o in t)!yd(sP,o)&&yd(t,o)&&_v(n,o);for(;e.length>r;)yd(t,o=e[r++])&&(~oP(n,o)||_v(n,o));return n},Cu=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],aP=b$,lP=Cu,ul=Object.keys||function(e){return aP(e,lP)},dP=De,hP=l$,cP=ht,uP=vt,fP=Kt,vP=ul;hl.f=dP&&!hP?Object.defineProperties:function(e,t){uP(e);for(var r=fP(t),n=vP(t),o=n.length,s=0,a;o>s;)cP.f(e,a=n[s++],r[a]);return e};var pP=Ze,$$=pP("document","documentElement"),gP=_n,yP=il,Sv=gP("keys"),fl=function(i){return Sv[i]||(Sv[i]=yP(i))},mP=vt,bP=hl,Ov=Cu,$P=Do,wP=$$,EP=Tu,_P=fl,Tv=">",Iv="<",bc="prototype",$c="script",w$=_P("IE_PROTO"),md=function(){},E$=function(i){return Iv+$c+Tv+i+Iv+"/"+$c+Tv},Pv=function(i){i.write(E$("")),i.close();var e=i.parentWindow.Object;return i=null,e},SP=function(){var i=EP("iframe"),e="java"+$c+":",t;return i.style.display="none",wP.appendChild(i),i.src=String(e),t=i.contentWindow.document,t.open(),t.write(E$("document.F=Object")),t.close(),t.F},Ps,ua=function(){try{Ps=new ActiveXObject("htmlfile")}catch{}ua=typeof document<"u"?document.domain&&Ps?Pv(Ps):SP():Pv(Ps);for(var i=Ov.length;i--;)delete ua[bc][Ov[i]];return ua()};$P[w$]=!0;var $i=Object.create||function(e,t){var r;return e!==null?(md[bc]=mP(e),r=new md,md[bc]=null,r[w$]=e):r=ua(),t===void 0?r:bP.f(r,t)},Mo={},OP=b$,TP=Cu,IP=TP.concat("length","prototype");Mo.f=Object.getOwnPropertyNames||function(e){return OP(e,IP)};var xu={},Cv=cl,PP=pt,CP=Sn,xP=Array,AP=Math.max,_$=function(i,e,t){for(var r=PP(i),n=Cv(e,r),o=Cv(t===void 0?r:t,r),s=xP(AP(o-n,0)),a=0;n<o;n++,a++)CP(s,a,i[n]);return s.length=a,s},DP=Fr,MP=Kt,S$=Mo.f,kP=_$,O$=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],RP=function(i){try{return S$(i)}catch{return kP(O$)}};xu.f=function(e){return O$&&DP(e)==="Window"?RP(e):S$(MP(e))};var ko={};ko.f=Object.getOwnPropertySymbols;var NP=ur,On=function(i,e,t,r){return r&&r.enumerable?i[e]=t:NP(i,e,t),i},FP=ht,Au=function(i,e,t){return FP.f(i,e,t)},Ro={},BP=ae;Ro.f=BP;var xv=oe,LP=Oe,jP=Ro,zP=ht.f,fe=function(i){var e=xv.Symbol||(xv.Symbol={});LP(e,i)||zP(e,i,{value:jP.f(i)})},HP=Me,WP=Ze,VP=ae,UP=On,T$=function(){var i=WP("Symbol"),e=i&&i.prototype,t=e&&e.valueOf,r=VP("toPrimitive");e&&!e[r]&&UP(e,r,function(n){return HP(t,this)},{})},KP=Iu,GP=fr,YP=KP?{}.toString:function(){return"[object "+GP(this)+"]"},qP=Iu,XP=ht.f,ZP=ur,JP=Oe,QP=YP,eC=ae,Av=eC("toStringTag"),wi=function(i,e,t,r){if(i){var n=t?i:i.prototype;JP(n,Av)||XP(n,Av,{configurable:!0,value:e}),r&&!qP&&ZP(n,"toString",QP)}},tC=ne,rC=ue,Dv=tC.WeakMap,iC=rC(Dv)&&/native code/.test(String(Dv)),nC=iC,I$=ne,oC=Be,sC=ur,bd=Oe,$d=Ou,aC=fl,lC=Do,Mv="Object already initialized",wc=I$.TypeError,dC=I$.WeakMap,Ca,ho,xa,hC=function(i){return xa(i)?ho(i):Ca(i,{})},cC=function(i){return function(e){var t;if(!oC(e)||(t=ho(e)).type!==i)throw new wc("Incompatible receiver, "+i+" required");return t}};if(nC||$d.state){var Ft=$d.state||($d.state=new dC);Ft.get=Ft.get,Ft.has=Ft.has,Ft.set=Ft.set,Ca=function(i,e){if(Ft.has(i))throw new wc(Mv);return e.facade=i,Ft.set(i,e),e},ho=function(i){return Ft.get(i)||{}},xa=function(i){return Ft.has(i)}}else{var Ai=aC("state");lC[Ai]=!0,Ca=function(i,e){if(bd(i,Ai))throw new wc(Mv);return e.facade=i,sC(i,Ai,e),e},ho=function(i){return bd(i,Ai)?i[Ai]:{}},xa=function(i){return bd(i,Ai)}}var Tn={set:Ca,get:ho,has:xa,enforce:hC,getterFor:cC},uC=Lr,fC=te,vC=rl,pC=dt,gC=pt,yC=dl,kv=fC([].push),Cs=function(i){var e=i===1,t=i===2,r=i===3,n=i===4,o=i===6,s=i===7,a=i===5||o;return function(l,d,h,c){for(var u=pC(l),f=vC(u),v=uC(d,h),y=gC(f),g=0,p=c||yC,m=e?p(l,y):t||s?p(l,0):void 0,$,E;y>g;g++)if((a||g in f)&&($=f[g],E=v($,g,u),i))if(e)m[g]=E;else if(E)switch(i){case 3:return!0;case 5:return $;case 6:return g;case 2:kv(m,$)}else switch(i){case 4:return!1;case 7:kv(m,$)}return o?-1:r||n?n:m}},In={forEach:Cs(0),map:Cs(1),filter:Cs(2),some:Cs(3)},vl=M,No=ne,Du=Me,mC=te,nn=De,on=wn,bC=Y,xe=Oe,$C=Se,Ec=vt,pl=Kt,Mu=nl,wC=bi,_c=mi,co=$i,P$=ul,EC=Mo,C$=xu,_C=ko,x$=yi,A$=ht,SC=hl,D$=tl,Rv=On,OC=Au,ku=_n,TC=fl,M$=Do,Nv=il,IC=ae,PC=Ro,CC=fe,xC=T$,AC=wi,k$=Tn,gl=In.forEach,rt=TC("hidden"),yl="Symbol",uo="prototype",DC=k$.set,Fv=k$.getterFor(yl),Ct=Object[uo],Jr=No.Symbol,qn=Jr&&Jr[uo],MC=No.RangeError,kC=No.TypeError,wd=No.QObject,R$=x$.f,Qr=A$.f,N$=C$.f,RC=D$.f,F$=mC([].push),lr=ku("symbols"),Fo=ku("op-symbols"),NC=ku("wks"),Sc=!wd||!wd[uo]||!wd[uo].findChild,B$=function(i,e,t){var r=R$(Ct,e);r&&delete Ct[e],Qr(i,e,t),r&&i!==Ct&&Qr(Ct,e,r)},Oc=nn&&bC(function(){return co(Qr({},"a",{get:function(){return Qr(this,"a",{value:7}).a}})).a!==7})?B$:Qr,Ed=function(i,e){var t=lr[i]=co(qn);return DC(t,{type:yl,tag:i,description:e}),nn||(t.description=e),t},ml=function(e,t,r){e===Ct&&ml(Fo,t,r),Ec(e);var n=Mu(t);return Ec(r),xe(lr,n)?(r.enumerable?(xe(e,rt)&&e[rt][n]&&(e[rt][n]=!1),r=co(r,{enumerable:_c(0,!1)})):(xe(e,rt)||Qr(e,rt,_c(1,{})),e[rt][n]=!0),Oc(e,n,r)):Qr(e,n,r)},Ru=function(e,t){Ec(e);var r=pl(t),n=P$(r).concat(H$(r));return gl(n,function(o){(!nn||Du(L$,r,o))&&ml(e,o,r[o])}),e},FC=function(e,t){return t===void 0?co(e):Ru(co(e),t)},L$=function(e){var t=Mu(e),r=Du(RC,this,t);return this===Ct&&xe(lr,t)&&!xe(Fo,t)?!1:r||!xe(this,t)||!xe(lr,t)||xe(this,rt)&&this[rt][t]?r:!0},j$=function(e,t){var r=pl(e),n=Mu(t);if(!(r===Ct&&xe(lr,n)&&!xe(Fo,n))){var o=R$(r,n);return o&&xe(lr,n)&&!(xe(r,rt)&&r[rt][n])&&(o.enumerable=!0),o}},z$=function(e){var t=N$(pl(e)),r=[];return gl(t,function(n){!xe(lr,n)&&!xe(M$,n)&&F$(r,n)}),r},H$=function(i){var e=i===Ct,t=N$(e?Fo:pl(i)),r=[];return gl(t,function(n){xe(lr,n)&&(!e||xe(Ct,n))&&F$(r,lr[n])}),r};on||(Jr=function(){if($C(qn,this))throw new kC("Symbol is not a constructor");var e=!arguments.length||arguments[0]===void 0?void 0:wC(arguments[0]),t=Nv(e),r=function(n){var o=this===void 0?No:this;o===Ct&&Du(r,Fo,n),xe(o,rt)&&xe(o[rt],t)&&(o[rt][t]=!1);var s=_c(1,n);try{Oc(o,t,s)}catch(a){if(!(a instanceof MC))throw a;B$(o,t,s)}};return nn&&Sc&&Oc(Ct,t,{configurable:!0,set:r}),Ed(t,e)},qn=Jr[uo],Rv(qn,"toString",function(){return Fv(this).tag}),Rv(Jr,"withoutSetter",function(i){return Ed(Nv(i),i)}),D$.f=L$,A$.f=ml,SC.f=Ru,x$.f=j$,EC.f=C$.f=z$,_C.f=H$,PC.f=function(i){return Ed(IC(i),i)},nn&&OC(qn,"description",{configurable:!0,get:function(){return Fv(this).description}}));vl({global:!0,wrap:!0,forced:!on,sham:!on},{Symbol:Jr});gl(P$(NC),function(i){CC(i)});vl({target:yl,stat:!0,forced:!on},{useSetter:function(){Sc=!0},useSimple:function(){Sc=!1}});vl({target:"Object",stat:!0,forced:!on,sham:!nn},{create:FC,defineProperty:ml,defineProperties:Ru,getOwnPropertyDescriptor:j$});vl({target:"Object",stat:!0,forced:!on},{getOwnPropertyNames:z$});xC();AC(Jr,yl);M$[rt]=!0;var BC=wn,W$=BC&&!!Symbol.for&&!!Symbol.keyFor,LC=M,jC=Ze,zC=Oe,HC=bi,V$=_n,WC=W$,_d=V$("string-to-symbol-registry"),VC=V$("symbol-to-string-registry");LC({target:"Symbol",stat:!0,forced:!WC},{for:function(i){var e=HC(i);if(zC(_d,e))return _d[e];var t=jC("Symbol")(e);return _d[e]=t,VC[t]=e,t}});var UC=M,KC=Oe,GC=Co,YC=En,qC=_n,XC=W$,Bv=qC("symbol-to-string-registry");UC({target:"Symbol",stat:!0,forced:!XC},{keyFor:function(e){if(!GC(e))throw new TypeError(YC(e)+" is not a symbol");if(KC(Bv,e))return Bv[e]}});var ZC=te,Bo=ZC([].slice),JC=te,Lv=jr,QC=ue,jv=Fr,ex=bi,zv=JC([].push),tx=function(i){if(QC(i))return i;if(Lv(i)){for(var e=i.length,t=[],r=0;r<e;r++){var n=i[r];typeof n=="string"?zv(t,n):(typeof n=="number"||jv(n)==="Number"||jv(n)==="String")&&zv(t,ex(n))}var o=t.length,s=!0;return function(a,l){if(s)return s=!1,l;if(Lv(this))return l;for(var d=0;d<o;d++)if(t[d]===a)return l}}},rx=M,U$=Ze,K$=mn,ix=Me,Lo=te,G$=Y,Hv=ue,Wv=Co,Y$=Bo,nx=tx,ox=wn,sx=String,Or=U$("JSON","stringify"),xs=Lo(/./.exec),Vv=Lo("".charAt),ax=Lo("".charCodeAt),lx=Lo("".replace),dx=Lo(1 .toString),hx=/[\uD800-\uDFFF]/g,Uv=/^[\uD800-\uDBFF]$/,Kv=/^[\uDC00-\uDFFF]$/,Gv=!ox||G$(function(){var i=U$("Symbol")("stringify detection");return Or([i])!=="[null]"||Or({a:i})!=="{}"||Or(Object(i))!=="{}"}),Yv=G$(function(){return Or("\uDF06\uD834")!=='"\\udf06\\ud834"'||Or("\uDEAD")!=='"\\udead"'}),cx=function(i,e){var t=Y$(arguments),r=nx(e);if(!(!Hv(r)&&(i===void 0||Wv(i))))return t[1]=function(n,o){if(Hv(r)&&(o=ix(r,this,sx(n),o)),!Wv(o))return o},K$(Or,null,t)},ux=function(i,e,t){var r=Vv(t,e-1),n=Vv(t,e+1);return xs(Uv,i)&&!xs(Kv,n)||xs(Kv,i)&&!xs(Uv,r)?"\\u"+dx(ax(i,0),16):i};Or&&rx({target:"JSON",stat:!0,forced:Gv||Yv},{stringify:function(e,t,r){var n=Y$(arguments),o=K$(Gv?cx:Or,null,n);return Yv&&typeof o=="string"?lx(o,hx,ux):o}});var fx=M,vx=wn,px=Y,q$=ko,gx=dt,yx=!vx||px(function(){q$.f(1)});fx({target:"Object",stat:!0,forced:yx},{getOwnPropertySymbols:function(e){var t=q$.f;return t?t(gx(e)):[]}});var mx=fe;mx("asyncIterator");var bx=fe;bx("hasInstance");var $x=fe;$x("isConcatSpreadable");var wx=fe;wx("iterator");var Ex=fe;Ex("match");var _x=fe;_x("matchAll");var Sx=fe;Sx("replace");var Ox=fe;Ox("search");var Tx=fe;Tx("species");var Ix=fe;Ix("split");var Px=fe,Cx=T$;Px("toPrimitive");Cx();var xx=Ze,Ax=fe,Dx=wi;Ax("toStringTag");Dx(xx("Symbol"),"Symbol");var Mx=fe;Mx("unscopables");var kx=ne,Rx=wi;Rx(kx.JSON,"JSON",!0);var Nx=oe,Fx=Nx.Symbol,Pn={},Tc=De,Bx=Oe,X$=Function.prototype,Lx=Tc&&Object.getOwnPropertyDescriptor,Z$=Bx(X$,"name"),jx=Z$&&function(){}.name==="something";Z$&&(!Tc||Tc&&Lx(X$,"name").configurable);var zx={PROPER:jx},Hx=Y,J$=!Hx(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype}),Wx=Oe,Vx=ue,Ux=dt,Kx=fl,Gx=J$,qv=Kx("IE_PROTO"),Ic=Object,Yx=Ic.prototype,bl=Gx?Ic.getPrototypeOf:function(i){var e=Ux(i);if(Wx(e,qv))return e[qv];var t=e.constructor;return Vx(t)&&e instanceof t?t.prototype:e instanceof Ic?Yx:null},qx=Y,Xx=ue,Zx=Be,Jx=$i,Xv=bl,Qx=On,eA=ae,Pc=eA("iterator"),Q$=!1,Jt,Sd,Od;[].keys&&(Od=[].keys(),"next"in Od?(Sd=Xv(Xv(Od)),Sd!==Object.prototype&&(Jt=Sd)):Q$=!0);var tA=!Zx(Jt)||qx(function(){var i={};return Jt[Pc].call(i)!==i});tA?Jt={}:Jt=Jx(Jt);Xx(Jt[Pc])||Qx(Jt,Pc,function(){return this});var e1={IteratorPrototype:Jt,BUGGY_SAFARI_ITERATORS:Q$},rA=e1.IteratorPrototype,iA=$i,nA=mi,oA=wi,sA=Pn,aA=function(){return this},lA=function(i,e,t,r){var n=e+" Iterator";return i.prototype=iA(rA,{next:nA(+!r,t)}),oA(i,n,!1,!0),sA[n]=aA,i},dA=te,hA=lt,cA=function(i,e,t){try{return dA(hA(Object.getOwnPropertyDescriptor(i,e)[t]))}catch{}},uA=ue,fA=String,vA=TypeError,pA=function(i){if(typeof i=="object"||uA(i))return i;throw new vA("Can't set "+fA(i)+" as a prototype")},gA=cA,yA=vt,mA=pA,t1=Object.setPrototypeOf||("__proto__"in{}?function(){var i=!1,e={},t;try{t=gA(Object.prototype,"__proto__","set"),t(e,[]),i=e instanceof Array}catch{}return function(n,o){return yA(n),mA(o),i?t(n,o):n.__proto__=o,n}}():void 0),bA=M,$A=Me,wA=zx,EA=lA,_A=bl,SA=wi,Zv=On,OA=ae,Jv=Pn,TA=e1,IA=wA.PROPER,As=TA.BUGGY_SAFARI_ITERATORS,Td=OA("iterator"),Qv="keys",Ds="values",ep="entries",PA=function(){return this},Nu=function(i,e,t,r,n,o,s){EA(t,e,r);var a=function(p){if(p===n&&u)return u;if(!As&&p&&p in h)return h[p];switch(p){case Qv:return function(){return new t(this,p)};case Ds:return function(){return new t(this,p)};case ep:return function(){return new t(this,p)}}return function(){return new t(this)}},l=e+" Iterator",d=!1,h=i.prototype,c=h[Td]||h["@@iterator"]||n&&h[n],u=!As&&c||a(n),f=e==="Array"&&h.entries||c,v,y,g;if(f&&(v=_A(f.call(new i)),v!==Object.prototype&&v.next&&(SA(v,l,!0,!0),Jv[l]=PA)),IA&&n===Ds&&c&&c.name!==Ds&&(d=!0,u=function(){return $A(c,this)}),n)if(y={values:a(Ds),keys:o?u:a(Qv),entries:a(ep)},s)for(g in y)(As||d||!(g in h))&&Zv(h,g,y[g]);else bA({target:e,proto:!0,forced:As||d},y);return s&&h[Td]!==u&&Zv(h,Td,u,{}),Jv[e]=u,y},Fu=function(i,e){return{value:i,done:e}},CA=Kt,tp=Pn,r1=Tn;ht.f;var xA=Nu,Ms=Fu,i1="Array Iterator",AA=r1.set,DA=r1.getterFor(i1);xA(Array,"Array",function(i,e){AA(this,{type:i1,target:CA(i),index:0,kind:e})},function(){var i=DA(this),e=i.target,t=i.index++;if(!e||t>=e.length)return i.target=void 0,Ms(void 0,!0);switch(i.kind){case"keys":return Ms(t,!1);case"values":return Ms(e[t],!1)}return Ms([t,e[t]],!1)},"values");tp.Arguments=tp.Array;var MA={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},kA=MA,RA=ne,NA=fr,FA=ur,rp=Pn,BA=ae,ip=BA("toStringTag");for(var Id in kA){var np=RA[Id],Pd=np&&np.prototype;Pd&&NA(Pd)!==ip&&FA(Pd,ip,Id),rp[Id]=rp.Array}var LA=Fx,n1=LA,jA=ae,zA=ht.f,op=jA("metadata"),sp=Function.prototype;sp[op]===void 0&&zA(sp,op,{value:null});var HA=fe;HA("asyncDispose");var WA=fe;WA("dispose");var VA=fe;VA("metadata");var UA=n1,KA=UA,GA=Ze,YA=te,Bu=GA("Symbol"),qA=Bu.keyFor,XA=YA(Bu.prototype.valueOf),o1=Bu.isRegisteredSymbol||function(e){try{return qA(XA(e))!==void 0}catch{return!1}},ZA=M,JA=o1;ZA({target:"Symbol",stat:!0},{isRegisteredSymbol:JA});var QA=_n,s1=Ze,eD=te,tD=Co,rD=ae,Aa=s1("Symbol"),ap=Aa.isWellKnownSymbol,a1=s1("Object","getOwnPropertyNames"),iD=eD(Aa.prototype.valueOf),lp=QA("wks");for(var Cd=0,dp=a1(Aa),nD=dp.length;Cd<nD;Cd++)try{var hp=dp[Cd];tD(Aa[hp])&&rD(hp)}catch{}var l1=function(e){if(ap&&ap(e))return!0;try{for(var t=iD(e),r=0,n=a1(lp),o=n.length;r<o;r++)if(lp[n[r]]==t)return!0}catch{}return!1},oD=M,sD=l1;oD({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:sD});var aD=fe;aD("matcher");var lD=fe;lD("observable");var dD=M,hD=o1;dD({target:"Symbol",stat:!0},{isRegistered:hD});var cD=M,uD=l1;cD({target:"Symbol",stat:!0,forced:!0},{isWellKnown:uD});var fD=fe;fD("metadataKey");var vD=fe;vD("patternMatch");var pD=fe;pD("replaceAll");var gD=KA,yD=gD,Lu=yD,Hi=R(Lu),ju=te,mD=sl,bD=bi,$D=_u,wD=ju("".charAt),cp=ju("".charCodeAt),ED=ju("".slice),_D=function(i){return function(e,t){var r=bD($D(e)),n=mD(t),o=r.length,s,a;return n<0||n>=o?i?"":void 0:(s=cp(r,n),s<55296||s>56319||n+1===o||(a=cp(r,n+1))<56320||a>57343?i?wD(r,n):s:i?ED(r,n,n+2):(s-55296<<10)+(a-56320)+65536)}},SD={charAt:_D(!0)},OD=SD.charAt,TD=bi,d1=Tn,ID=Nu,up=Fu,h1="String Iterator",PD=d1.set,CD=d1.getterFor(h1);ID(String,"String",function(i){PD(this,{type:h1,string:TD(i),index:0})},function(){var e=CD(this),t=e.string,r=e.index,n;return r>=t.length?up(void 0,!0):(n=OD(t,r),e.index+=n.length,up(n,!1))});var xD=Ro,AD=xD.f("iterator"),DD=AD,c1=DD,MD=c1,kD=MD,RD=kD,ND=RD,u1=ND,FD=R(u1);function sn(i){"@babel/helpers - typeof";return sn=typeof Hi=="function"&&typeof FD=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Hi=="function"&&e.constructor===Hi&&e!==Hi.prototype?"symbol":typeof e},sn(i)}var BD=Ro,LD=BD.f("toPrimitive"),jD=LD,zD=jD,HD=zD,WD=HD,VD=WD,UD=VD,KD=UD,GD=R(KD);function YD(i,e){if(sn(i)!=="object"||i===null)return i;var t=i[GD];if(t!==void 0){var r=t.call(i,e);if(sn(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function f1(i){var e=YD(i,"string");return sn(e)==="symbol"?e:String(e)}function fp(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),ol(i,f1(r.key),r)}}function $l(i,e,t){return e&&fp(i.prototype,e),t&&fp(i,t),ol(i,"prototype",{writable:!1}),i}function Tr(i,e,t){return e=f1(e),e in i?ol(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var v1=te,qD=lt,XD=Be,ZD=Oe,vp=Bo,JD=Po,p1=Function,QD=v1([].concat),eM=v1([].join),xd={},tM=function(i,e,t){if(!ZD(xd,e)){for(var r=[],n=0;n<e;n++)r[n]="a["+n+"]";xd[e]=p1("C,a","return new C("+eM(r,",")+")")}return xd[e](i,t)},g1=JD?p1.bind:function(e){var t=qD(this),r=t.prototype,n=vp(arguments,1),o=function(){var a=QD(n,vp(arguments));return this instanceof o?tM(t,a.length,a):t.apply(e,a)};return XD(r)&&(o.prototype=r),o},rM=M,pp=g1;rM({target:"Function",proto:!0,forced:Function.bind!==pp},{bind:pp});var iM=ne,nM=oe,He=function(i,e){var t=nM[i+"Prototype"],r=t&&t[e];if(r)return r;var n=iM[i],o=n&&n.prototype;return o&&o[e]},oM=He,sM=oM("Function","bind"),aM=Se,lM=sM,Ad=Function.prototype,dM=function(i){var e=i.bind;return i===Ad||aM(Ad,i)&&e===Ad.bind?lM:e},hM=dM,y1=hM,cM=y1,m1=R(cM),uM=lt,fM=dt,vM=rl,pM=pt,gM=TypeError,yM=function(i){return function(e,t,r,n){uM(t);var o=fM(e),s=vM(o),a=pM(o),l=i?a-1:0,d=i?-1:1;if(r<2)for(;;){if(l in s){n=s[l],l+=d;break}if(l+=d,i?l<0:a<=l)throw new gM("Reduce of empty array with no initial value")}for(;i?l>=0:a>l;l+=d)l in s&&(n=t(n,s[l],l,o));return n}},mM={left:yM(!1)},bM=Y,wl=function(i,e){var t=[][i];return!!t&&bM(function(){t.call(null,e||function(){return 1},1)})},$M=ne,wM=Fr,jo=wM($M.process)==="process",EM=M,_M=mM.left,SM=wl,gp=$n,OM=jo,TM=!OM&&gp>79&&gp<83,IM=TM||!SM("reduce");EM({target:"Array",proto:!0,forced:IM},{reduce:function(e){var t=arguments.length;return _M(this,e,t,t>1?arguments[1]:void 0)}});var PM=He,CM=PM("Array","reduce"),xM=Se,AM=CM,Dd=Array.prototype,DM=function(i){var e=i.reduce;return i===Dd||xM(Dd,i)&&e===Dd.reduce?AM:e},MM=DM,kM=MM,RM=kM,NM=R(RM),FM=M,BM=In.filter,LM=Ao,jM=LM("filter");FM({target:"Array",proto:!0,forced:!jM},{filter:function(e){return BM(this,e,arguments.length>1?arguments[1]:void 0)}});var zM=He,HM=zM("Array","filter"),WM=Se,VM=HM,Md=Array.prototype,UM=function(i){var e=i.filter;return i===Md||WM(Md,i)&&e===Md.filter?VM:e},KM=UM,GM=KM,YM=GM,Wi=R(YM),qM=M,XM=In.map,ZM=Ao,JM=ZM("map");qM({target:"Array",proto:!0,forced:!JM},{map:function(e){return XM(this,e,arguments.length>1?arguments[1]:void 0)}});var QM=He,ek=QM("Array","map"),tk=Se,rk=ek,kd=Array.prototype,ik=function(i){var e=i.map;return i===kd||tk(kd,i)&&e===kd.map?rk:e},nk=ik,ok=nk,sk=ok,Tt=R(sk),ak=jr,lk=pt,dk=al,hk=Lr,b1=function(i,e,t,r,n,o,s,a){for(var l=n,d=0,h=s?hk(s,a):!1,c,u;d<r;)d in t&&(c=h?h(t[d],d,e):t[d],o>0&&ak(c)?(u=lk(c),l=b1(i,e,c,u,l,o-1)-1):(dk(l+1),i[l]=c),l++),d++;return l},ck=b1,uk=M,fk=ck,vk=lt,pk=dt,gk=pt,yk=dl;uk({target:"Array",proto:!0},{flatMap:function(e){var t=pk(this),r=gk(t),n;return vk(e),n=yk(t,0),n.length=fk(n,t,t,r,0,1,e,arguments.length>1?arguments[1]:void 0),n}});var mk=He;mk("Array","flatMap");var bk=Me,yp=vt,$k=Su,$1=function(i,e,t){var r,n;yp(i);try{if(r=$k(i,"return"),!r){if(e==="throw")throw t;return t}r=bk(r,i)}catch(o){n=!0,r=o}if(e==="throw")throw t;if(n)throw r;return yp(r),t},wk=vt,Ek=$1,_k=function(i,e,t,r){try{return r?e(wk(t)[0],t[1]):e(t)}catch(n){Ek(i,"throw",n)}},Sk=ae,Ok=Pn,Tk=Sk("iterator"),Ik=Array.prototype,w1=function(i){return i!==void 0&&(Ok.Array===i||Ik[Tk]===i)},Pk=fr,mp=Su,Ck=bn,xk=Pn,Ak=ae,Dk=Ak("iterator"),El=function(i){if(!Ck(i))return mp(i,Dk)||mp(i,"@@iterator")||xk[Pk(i)]},Mk=Me,kk=lt,Rk=vt,Nk=En,Fk=El,Bk=TypeError,zu=function(i,e){var t=arguments.length<2?Fk(i):e;if(kk(t))return Rk(Mk(t,i));throw new Bk(Nk(i)+" is not iterable")},Lk=Lr,jk=Me,zk=dt,Hk=_k,Wk=w1,Vk=ll,Uk=pt,bp=Sn,Kk=zu,Gk=El,$p=Array,Yk=function(e){var t=zk(e),r=Vk(this),n=arguments.length,o=n>1?arguments[1]:void 0,s=o!==void 0;s&&(o=Lk(o,n>2?arguments[2]:void 0));var a=Gk(t),l=0,d,h,c,u,f,v;if(a&&!(this===$p&&Wk(a)))for(u=Kk(t,a),f=u.next,h=r?new this:[];!(c=jk(f,u)).done;l++)v=s?Hk(u,o,[c.value,l],!0):c.value,bp(h,l,v);else for(d=Uk(t),h=r?new this(d):$p(d);d>l;l++)v=s?o(t[l],l):t[l],bp(h,l,v);return h.length=l,h},qk=ae,E1=qk("iterator"),_1=!1;try{var Xk=0,wp={next:function(){return{done:!!Xk++}},return:function(){_1=!0}};wp[E1]=function(){return this},Array.from(wp,function(){throw 2})}catch{}var S1=function(i,e){try{if(!e&&!_1)return!1}catch{return!1}var t=!1;try{var r={};r[E1]=function(){return{next:function(){return{done:t=!0}}}},i(r)}catch{}return t},Zk=M,Jk=Yk,Qk=S1,eR=!Qk(function(i){Array.from(i)});Zk({target:"Array",stat:!0,forced:eR},{from:Jk});var tR=oe,rR=tR.Array.from,iR=rR,O1=iR,nR=O1,Hu=R(nR),oR=El,sR=oR,aR=sR,lR=aR,dR=lR,hR=dR,cR=hR,uR=cR,T1=uR,I1=R(T1),fR=T1,Wu=R(fR),vR=M,pR=jr;vR({target:"Array",stat:!0},{isArray:pR});var gR=oe,yR=gR.Array.isArray,mR=yR,P1=mR,bR=P1,$R=bR,wR=$R,ER=wR,_R=ER,C1=R(_R);function SR(i){if(C1(i))return i}var OR=De,TR=jr,IR=TypeError,PR=Object.getOwnPropertyDescriptor,CR=OR&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(i){return i instanceof TypeError}}(),x1=CR?function(i,e){if(TR(i)&&!PR(i,"length").writable)throw new IR("Cannot set read only .length");return i.length=e}:function(i,e){return i.length=e},xR=M,AR=dt,DR=pt,MR=x1,kR=al,RR=Y,NR=RR(function(){return[].push.call({length:4294967296},1)!==4294967297}),FR=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(i){return i instanceof TypeError}},BR=NR||!FR();xR({target:"Array",proto:!0,forced:BR},{push:function(e){var t=AR(this),r=DR(t),n=arguments.length;kR(r+n);for(var o=0;o<n;o++)t[r]=arguments[o],r++;return MR(t,r),r}});var LR=He,jR=LR("Array","push"),zR=Se,HR=jR,Rd=Array.prototype,WR=function(i){var e=i.push;return i===Rd||zR(Rd,i)&&e===Rd.push?HR:e},VR=WR,UR=VR,KR=UR,GR=KR,YR=GR,qR=YR,A1=qR,XR=R(A1);function ZR(i,e){var t=i==null?null:typeof Hi<"u"&&I1(i)||i["@@iterator"];if(t!=null){var r,n,o,s,a=[],l=!0,d=!1;try{if(o=(t=t.call(i)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=o.call(t)).done)&&(XR(a).call(a,r.value),a.length!==e);l=!0);}catch(h){d=!0,n=h}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(d)throw n}}return a}}var JR=M,Ep=jr,QR=ll,eN=Be,_p=cl,tN=pt,rN=Kt,iN=Sn,nN=ae,oN=Ao,sN=Bo,aN=oN("slice"),lN=nN("species"),Nd=Array,dN=Math.max;JR({target:"Array",proto:!0,forced:!aN},{slice:function(e,t){var r=rN(this),n=tN(r),o=_p(e,n),s=_p(t===void 0?n:t,n),a,l,d;if(Ep(r)&&(a=r.constructor,QR(a)&&(a===Nd||Ep(a.prototype))?a=void 0:eN(a)&&(a=a[lN],a===null&&(a=void 0)),a===Nd||a===void 0))return sN(r,o,s);for(l=new(a===void 0?Nd:a)(dN(s-o,0)),d=0;o<s;o++,d++)o in r&&iN(l,d,r[o]);return l.length=d,l}});var hN=He,cN=hN("Array","slice"),uN=Se,fN=cN,Fd=Array.prototype,vN=function(i){var e=i.slice;return i===Fd||uN(Fd,i)&&e===Fd.slice?fN:e},pN=vN,D1=pN,gN=D1,yN=gN,mN=yN,bN=mN,M1=bN,$N=R(M1),wN=O1,EN=wN,_N=EN,SN=_N,ON=SN,k1=R(ON);function Cc(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}function R1(i,e){var t;if(i){if(typeof i=="string")return Cc(i,e);var r=$N(t=Object.prototype.toString.call(i)).call(t,8,-1);if(r==="Object"&&i.constructor&&(r=i.constructor.name),r==="Map"||r==="Set")return k1(i);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cc(i,e)}}function TN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
26
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qe(i,e){return SR(i)||ZR(i,e)||R1(i,e)||TN()}function IN(i){if(C1(i))return Cc(i)}function PN(i){if(typeof Hi<"u"&&I1(i)!=null||i["@@iterator"]!=null)return k1(i)}function CN(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
27
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function it(i){return IN(i)||PN(i)||R1(i)||CN()}var xN=n1,_l=R(xN),AN=He,DN=AN("Array","concat"),MN=Se,kN=DN,Bd=Array.prototype,RN=function(i){var e=i.concat;return i===Bd||MN(Bd,i)&&e===Bd.concat?kN:e},NN=RN,FN=NN,BN=FN,Sl=R(BN),LN=D1,Ol=R(LN),jN=Ze,zN=te,HN=Mo,WN=ko,VN=vt,UN=zN([].concat),Vu=jN("Reflect","ownKeys")||function(e){var t=HN.f(VN(e)),r=WN.f;return r?UN(t,r(e)):t},KN=M,GN=Vu;KN({target:"Reflect",stat:!0},{ownKeys:GN});var YN=oe,qN=YN.Reflect.ownKeys,XN=qN,ZN=XN,JN=ZN,QN=R(JN),e2=P1,ut=R(e2),t2=M,r2=dt,N1=ul,i2=Y,n2=i2(function(){N1(1)});t2({target:"Object",stat:!0,forced:n2},{keys:function(e){return N1(r2(e))}});var o2=oe,s2=o2.Object.keys,a2=s2,l2=a2,d2=l2,Uu=R(d2),h2=In.forEach,c2=wl,u2=c2("forEach"),f2=u2?[].forEach:function(e){return h2(this,e,arguments.length>1?arguments[1]:void 0)},v2=M,Sp=f2;v2({target:"Array",proto:!0,forced:[].forEach!==Sp},{forEach:Sp});var p2=He,g2=p2("Array","forEach"),y2=g2,m2=y2,b2=fr,$2=Oe,w2=Se,E2=m2,Ld=Array.prototype,_2={DOMTokenList:!0,NodeList:!0},F1=function(i){var e=i.forEach;return i===Ld||w2(Ld,i)&&e===Ld.forEach||$2(_2,b2(i))?E2:e},S2=F1,li=R(S2),O2=M,T2=te,I2=jr,P2=T2([].reverse),Op=[1,2];O2({target:"Array",proto:!0,forced:String(Op)===String(Op.reverse())},{reverse:function(){return I2(this)&&(this.length=this.length),P2(this)}});var C2=He,x2=C2("Array","reverse"),A2=Se,D2=x2,jd=Array.prototype,M2=function(i){var e=i.reverse;return i===jd||A2(jd,i)&&e===jd.reverse?D2:e},k2=M2,B1=k2,R2=B1,N2=R(R2),Tp=En,F2=TypeError,L1=function(i,e){if(!delete i[e])throw new F2("Cannot delete property "+Tp(e)+" of "+Tp(i))},B2=M,L2=dt,j2=cl,z2=sl,H2=pt,W2=x1,V2=al,U2=dl,K2=Sn,zd=L1,G2=Ao,Y2=G2("splice"),q2=Math.max,X2=Math.min;B2({target:"Array",proto:!0,forced:!Y2},{splice:function(e,t){var r=L2(this),n=H2(r),o=j2(e,n),s=arguments.length,a,l,d,h,c,u;for(s===0?a=l=0:s===1?(a=0,l=n-o):(a=s-2,l=X2(q2(z2(t),0),n-o)),V2(n+a-l),d=U2(r,l),h=0;h<l;h++)c=o+h,c in r&&K2(d,h,r[c]);if(d.length=l,a<l){for(h=o;h<n-l;h++)c=h+l,u=h+a,c in r?r[u]=r[c]:zd(r,u);for(h=n;h>n-l+a;h--)zd(r,h-1)}else if(a>l)for(h=n-l;h>o;h--)c=h+l-1,u=h+a-1,c in r?r[u]=r[c]:zd(r,u);for(h=0;h<a;h++)r[h+o]=arguments[h+2];return W2(r,n-l+a),d}});var Z2=He,J2=Z2("Array","splice"),Q2=Se,eF=J2,Hd=Array.prototype,tF=function(i){var e=i.splice;return i===Hd||Q2(Hd,i)&&e===Hd.splice?eF:e},rF=tF,iF=rF,nF=iF,j1=R(nF),Ip=De,oF=te,sF=Me,aF=Y,Wd=ul,lF=ko,dF=tl,hF=dt,cF=rl,Di=Object.assign,Pp=Object.defineProperty,uF=oF([].concat),fF=!Di||aF(function(){if(Ip&&Di({b:1},Di(Pp({},"a",{enumerable:!0,get:function(){Pp(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var i={},e={},t=Symbol("assign detection"),r="abcdefghijklmnopqrst";return i[t]=7,r.split("").forEach(function(n){e[n]=n}),Di({},i)[t]!==7||Wd(Di({},e)).join("")!==r})?function(e,t){for(var r=hF(e),n=arguments.length,o=1,s=lF.f,a=dF.f;n>o;)for(var l=cF(arguments[o++]),d=s?uF(Wd(l),s(l)):Wd(l),h=d.length,c=0,u;h>c;)u=d[c++],(!Ip||sF(a,l,u))&&(r[u]=l[u]);return r}:Di,vF=M,Cp=fF;vF({target:"Object",stat:!0,forced:Object.assign!==Cp},{assign:Cp});var pF=oe,gF=pF.Object.assign,yF=gF,mF=yF,bF=mF,$F=R(bF),wF=M,EF=Y,_F=dt,z1=bl,SF=J$,OF=EF(function(){z1(1)});wF({target:"Object",stat:!0,forced:OF,sham:!SF},{getPrototypeOf:function(e){return z1(_F(e))}});var TF=oe,IF=TF.Object.getPrototypeOf,PF=IF,CF=PF,xF=M,AF=De,DF=$i;xF({target:"Object",stat:!0,sham:!AF},{create:DF});var MF=oe,kF=MF.Object,RF=function(e,t){return kF.create(e,t)},NF=RF,H1=NF,FF=H1,BF=R(FF),xc=oe,LF=mn;xc.JSON||(xc.JSON={stringify:JSON.stringify});var jF=function(e,t,r){return LF(xc.JSON.stringify,null,arguments)},zF=jF,HF=zF,WF=HF,VF=R(WF),UF=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",KF=TypeError,W1=function(i,e){if(i<e)throw new KF("Not enough arguments");return i},V1=ne,GF=mn,YF=ue,qF=UF,XF=Br,ZF=Bo,JF=W1,QF=V1.Function,eB=/MSIE .\./.test(XF)||qF&&function(){var i=V1.Bun.version.split(".");return i.length<3||i[0]==="0"&&(i[1]<3||i[1]==="3"&&i[2]==="0")}(),U1=function(i,e){var t=e?2:1;return eB?function(r,n){var o=JF(arguments.length,1)>t,s=YF(r)?r:QF(r),a=o?ZF(arguments,t):[],l=o?function(){GF(s,this,a)}:s;return e?i(l,n):i(l)}:i},tB=M,K1=ne,rB=U1,xp=rB(K1.setInterval,!0);tB({global:!0,bind:!0,forced:K1.setInterval!==xp},{setInterval:xp});var iB=M,G1=ne,nB=U1,Ap=nB(G1.setTimeout,!0);iB({global:!0,bind:!0,forced:G1.setTimeout!==Ap},{setTimeout:Ap});var oB=oe,sB=oB.setTimeout,aB=sB,lB=R(aB),Y1={exports:{}};(function(i){function e(r){if(r)return t(r);this._callbacks=new Map}function t(r){return Object.assign(r,e.prototype),r._callbacks=new Map,r}e.prototype.on=function(r,n){const o=this._callbacks.get(r)??[];return o.push(n),this._callbacks.set(r,o),this},e.prototype.once=function(r,n){const o=(...s)=>{this.off(r,o),n.apply(this,s)};return o.fn=n,this.on(r,o),this},e.prototype.off=function(r,n){if(r===void 0&&n===void 0)return this._callbacks.clear(),this;if(n===void 0)return this._callbacks.delete(r),this;const o=this._callbacks.get(r);if(o){for(const[s,a]of o.entries())if(a===n||a.fn===n){o.splice(s,1);break}o.length===0?this._callbacks.delete(r):this._callbacks.set(r,o)}return this},e.prototype.emit=function(r,...n){const o=this._callbacks.get(r);if(o){const s=[...o];for(const a of s)a.apply(this,n)}return this},e.prototype.listeners=function(r){return this._callbacks.get(r)??[]},e.prototype.listenerCount=function(r){if(r)return this.listeners(r).length;let n=0;for(const o of this._callbacks.values())n+=o.length;return n},e.prototype.hasListeners=function(r){return this.listenerCount(r)>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,i.exports=e})(Y1);var dB=Y1.exports,hB=R(dB);/*! Hammer.JS - v2.0.17-rc - 2019-12-16
28
+ * http://naver.github.io/egjs
29
+ *
30
+ * Forked By Naver egjs
31
+ * Copyright (c) hammerjs
32
+ * Licensed under the MIT license */function At(){return At=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},At.apply(this,arguments)}function Et(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.__proto__=e}function ks(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}var Ac;typeof Object.assign!="function"?Ac=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;r<arguments.length;r++){var n=arguments[r];if(n!=null)for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])}return t}:Ac=Object.assign;var di=Ac,Dp=["","webkit","Moz","MS","ms","o"],cB=typeof document>"u"?{style:{}}:document.createElement("div"),uB="function",Vi=Math.round,hi=Math.abs,Ku=Date.now;function Tl(i,e){for(var t,r,n=e[0].toUpperCase()+e.slice(1),o=0;o<Dp.length;){if(t=Dp[o],r=t?t+n:e,r in i)return r;o++}}var Qt;typeof window>"u"?Qt={}:Qt=window;var q1=Tl(cB.style,"touchAction"),X1=q1!==void 0;function fB(){if(!X1)return!1;var i={},e=Qt.CSS&&Qt.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return i[t]=e?Qt.CSS.supports("touch-action",t):!0}),i}var Z1="compute",J1="auto",Dc="manipulation",ei="none",fo="pan-x",vo="pan-y",Rs=fB(),vB=/mobile|tablet|ip(ad|hone|od)|android/i,Q1="ontouchstart"in Qt,pB=Tl(Qt,"PointerEvent")!==void 0,gB=Q1&&vB.test(navigator.userAgent),zo="touch",yB="pen",Gu="mouse",mB="kinect",bB=25,qe=1,Ei=2,we=4,st=8,Da=1,Ho=2,Wo=4,Vo=8,an=16,Vt=Ho|Wo,ti=Vo|an,ew=Vt|ti,tw=["x","y"],Ma=["clientX","clientY"];function er(i,e,t){var r;if(i)if(i.forEach)i.forEach(e,t);else if(i.length!==void 0)for(r=0;r<i.length;)e.call(t,i[r],r,i),r++;else for(r in i)i.hasOwnProperty(r)&&e.call(t,i[r],r,i)}function Il(i,e){return typeof i===uB?i.apply(e&&e[0]||void 0,e):i}function qr(i,e){return i.indexOf(e)>-1}function $B(i){if(qr(i,ei))return ei;var e=qr(i,fo),t=qr(i,vo);return e&&t?ei:e||t?e?fo:vo:qr(i,Dc)?Dc:J1}var rw=function(){function i(t,r){this.manager=t,this.set(r)}var e=i.prototype;return e.set=function(r){r===Z1&&(r=this.compute()),X1&&this.manager.element.style&&Rs[r]&&(this.manager.element.style[q1]=r),this.actions=r.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var r=[];return er(this.manager.recognizers,function(n){Il(n.options.enable,[n])&&(r=r.concat(n.getTouchAction()))}),$B(r.join(" "))},e.preventDefaults=function(r){var n=r.srcEvent,o=r.offsetDirection;if(this.manager.session.prevented){n.preventDefault();return}var s=this.actions,a=qr(s,ei)&&!Rs[ei],l=qr(s,vo)&&!Rs[vo],d=qr(s,fo)&&!Rs[fo];if(a){var h=r.pointers.length===1,c=r.distance<2,u=r.deltaTime<250;if(h&&c&&u)return}if(!(d&&l)&&(a||l&&o&Vt||d&&o&ti))return this.preventSrc(n)},e.preventSrc=function(r){this.manager.session.prevented=!0,r.preventDefault()},i}();function Yu(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}function iw(i){var e=i.length;if(e===1)return{x:Vi(i[0].clientX),y:Vi(i[0].clientY)};for(var t=0,r=0,n=0;n<e;)t+=i[n].clientX,r+=i[n].clientY,n++;return{x:Vi(t/e),y:Vi(r/e)}}function Mp(i){for(var e=[],t=0;t<i.pointers.length;)e[t]={clientX:Vi(i.pointers[t].clientX),clientY:Vi(i.pointers[t].clientY)},t++;return{timeStamp:Ku(),pointers:e,center:iw(e),deltaX:i.deltaX,deltaY:i.deltaY}}function ka(i,e,t){t||(t=tw);var r=e[t[0]]-i[t[0]],n=e[t[1]]-i[t[1]];return Math.sqrt(r*r+n*n)}function Mc(i,e,t){t||(t=tw);var r=e[t[0]]-i[t[0]],n=e[t[1]]-i[t[1]];return Math.atan2(n,r)*180/Math.PI}function nw(i,e){return i===e?Da:hi(i)>=hi(e)?i<0?Ho:Wo:e<0?Vo:an}function wB(i,e){var t=e.center,r=i.offsetDelta||{},n=i.prevDelta||{},o=i.prevInput||{};(e.eventType===qe||o.eventType===we)&&(n=i.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=i.offsetDelta={x:t.x,y:t.y}),e.deltaX=n.x+(t.x-r.x),e.deltaY=n.y+(t.y-r.y)}function ow(i,e,t){return{x:e/i||0,y:t/i||0}}function EB(i,e){return ka(e[0],e[1],Ma)/ka(i[0],i[1],Ma)}function _B(i,e){return Mc(e[1],e[0],Ma)+Mc(i[1],i[0],Ma)}function SB(i,e){var t=i.lastInterval||e,r=e.timeStamp-t.timeStamp,n,o,s,a;if(e.eventType!==st&&(r>bB||t.velocity===void 0)){var l=e.deltaX-t.deltaX,d=e.deltaY-t.deltaY,h=ow(r,l,d);o=h.x,s=h.y,n=hi(h.x)>hi(h.y)?h.x:h.y,a=nw(l,d),i.lastInterval=e}else n=t.velocity,o=t.velocityX,s=t.velocityY,a=t.direction;e.velocity=n,e.velocityX=o,e.velocityY=s,e.direction=a}function OB(i,e){var t=i.session,r=e.pointers,n=r.length;t.firstInput||(t.firstInput=Mp(e)),n>1&&!t.firstMultiple?t.firstMultiple=Mp(e):n===1&&(t.firstMultiple=!1);var o=t.firstInput,s=t.firstMultiple,a=s?s.center:o.center,l=e.center=iw(r);e.timeStamp=Ku(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=Mc(a,l),e.distance=ka(a,l),wB(t,e),e.offsetDirection=nw(e.deltaX,e.deltaY);var d=ow(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=d.x,e.overallVelocityY=d.y,e.overallVelocity=hi(d.x)>hi(d.y)?d.x:d.y,e.scale=s?EB(s.pointers,r):1,e.rotation=s?_B(s.pointers,r):0,e.maxPointers=t.prevInput?e.pointers.length>t.prevInput.maxPointers?e.pointers.length:t.prevInput.maxPointers:e.pointers.length,SB(t,e);var h=i.element,c=e.srcEvent,u;c.composedPath?u=c.composedPath()[0]:c.path?u=c.path[0]:u=c.target,Yu(u,h)&&(h=u),e.target=h}function TB(i,e,t){var r=t.pointers.length,n=t.changedPointers.length,o=e&qe&&r-n===0,s=e&(we|st)&&r-n===0;t.isFirst=!!o,t.isFinal=!!s,o&&(i.session={}),t.eventType=e,OB(i,t),i.emit("hammer.input",t),i.recognize(t),i.session.prevInput=t}function po(i){return i.trim().split(/\s+/g)}function Qn(i,e,t){er(po(e),function(r){i.addEventListener(r,t,!1)})}function eo(i,e,t){er(po(e),function(r){i.removeEventListener(r,t,!1)})}function kp(i){var e=i.ownerDocument||i;return e.defaultView||e.parentWindow||window}var Cn=function(){function i(t,r){var n=this;this.manager=t,this.callback=r,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(o){Il(t.options.enable,[t])&&n.handler(o)},this.init()}var e=i.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Qn(this.element,this.evEl,this.domHandler),this.evTarget&&Qn(this.target,this.evTarget,this.domHandler),this.evWin&&Qn(kp(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&eo(this.element,this.evEl,this.domHandler),this.evTarget&&eo(this.target,this.evTarget,this.domHandler),this.evWin&&eo(kp(this.element),this.evWin,this.domHandler)},i}();function ci(i,e,t){if(i.indexOf&&!t)return i.indexOf(e);for(var r=0;r<i.length;){if(t&&i[r][t]==e||!t&&i[r]===e)return r;r++}return-1}var IB={pointerdown:qe,pointermove:Ei,pointerup:we,pointercancel:st,pointerout:st},PB={2:zo,3:yB,4:Gu,5:mB},sw="pointerdown",aw="pointermove pointerup pointercancel";Qt.MSPointerEvent&&!Qt.PointerEvent&&(sw="MSPointerDown",aw="MSPointerMove MSPointerUp MSPointerCancel");var lw=function(i){Et(e,i);function e(){var r,n=e.prototype;return n.evEl=sw,n.evWin=aw,r=i.apply(this,arguments)||this,r.store=r.manager.session.pointerEvents=[],r}var t=e.prototype;return t.handler=function(n){var o=this.store,s=!1,a=n.type.toLowerCase().replace("ms",""),l=IB[a],d=PB[n.pointerType]||n.pointerType,h=d===zo,c=ci(o,n.pointerId,"pointerId");l&qe&&(n.button===0||h)?c<0&&(o.push(n),c=o.length-1):l&(we|st)&&(s=!0),!(c<0)&&(o[c]=n,this.callback(this.manager,l,{pointers:o,changedPointers:[n],pointerType:d,srcEvent:n}),s&&o.splice(c,1))},e}(Cn);function go(i){return Array.prototype.slice.call(i,0)}function qu(i,e,t){for(var r=[],n=[],o=0;o<i.length;){var s=e?i[o][e]:i[o];ci(n,s)<0&&r.push(i[o]),n[o]=s,o++}return t&&(e?r=r.sort(function(a,l){return a[e]>l[e]}):r=r.sort()),r}var CB={touchstart:qe,touchmove:Ei,touchend:we,touchcancel:st},xB="touchstart touchmove touchend touchcancel",Xu=function(i){Et(e,i);function e(){var r;return e.prototype.evTarget=xB,r=i.apply(this,arguments)||this,r.targetIds={},r}var t=e.prototype;return t.handler=function(n){var o=CB[n.type],s=AB.call(this,n,o);s&&this.callback(this.manager,o,{pointers:s[0],changedPointers:s[1],pointerType:zo,srcEvent:n})},e}(Cn);function AB(i,e){var t=go(i.touches),r=this.targetIds;if(e&(qe|Ei)&&t.length===1)return r[t[0].identifier]=!0,[t,t];var n,o,s=go(i.changedTouches),a=[],l=this.target;if(o=t.filter(function(d){return Yu(d.target,l)}),e===qe)for(n=0;n<o.length;)r[o[n].identifier]=!0,n++;for(n=0;n<s.length;)r[s[n].identifier]&&a.push(s[n]),e&(we|st)&&delete r[s[n].identifier],n++;if(a.length)return[qu(o.concat(a),"identifier",!0),a]}var DB={mousedown:qe,mousemove:Ei,mouseup:we},MB="mousedown",kB="mousemove mouseup",Zu=function(i){Et(e,i);function e(){var r,n=e.prototype;return n.evEl=MB,n.evWin=kB,r=i.apply(this,arguments)||this,r.pressed=!1,r}var t=e.prototype;return t.handler=function(n){var o=DB[n.type];o&qe&&n.button===0&&(this.pressed=!0),o&Ei&&n.which!==1&&(o=we),this.pressed&&(o&we&&(this.pressed=!1),this.callback(this.manager,o,{pointers:[n],changedPointers:[n],pointerType:Gu,srcEvent:n}))},e}(Cn),RB=2500,Rp=25;function Np(i){var e=i.changedPointers,t=e[0];if(t.identifier===this.primaryTouch){var r={x:t.clientX,y:t.clientY},n=this.lastTouches;this.lastTouches.push(r);var o=function(){var a=n.indexOf(r);a>-1&&n.splice(a,1)};setTimeout(o,RB)}}function NB(i,e){i&qe?(this.primaryTouch=e.changedPointers[0].identifier,Np.call(this,e)):i&(we|st)&&Np.call(this,e)}function FB(i){for(var e=i.srcEvent.clientX,t=i.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var n=this.lastTouches[r],o=Math.abs(e-n.x),s=Math.abs(t-n.y);if(o<=Rp&&s<=Rp)return!0}return!1}var dw=function(){var i=function(e){Et(t,e);function t(n,o){var s;return s=e.call(this,n,o)||this,s.handler=function(a,l,d){var h=d.pointerType===zo,c=d.pointerType===Gu;if(!(c&&d.sourceCapabilities&&d.sourceCapabilities.firesTouchEvents)){if(h)NB.call(ks(ks(s)),l,d);else if(c&&FB.call(ks(ks(s)),d))return;s.callback(a,l,d)}},s.touch=new Xu(s.manager,s.handler),s.mouse=new Zu(s.manager,s.handler),s.primaryTouch=null,s.lastTouches=[],s}var r=t.prototype;return r.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Cn);return i}();function BB(i){var e,t=i.options.inputClass;return t?e=t:pB?e=lw:gB?e=Xu:Q1?e=dw:e=Zu,new e(i,TB)}function Ui(i,e,t){return Array.isArray(i)?(er(i,t[e],t),!0):!1}var fa=1,$t=2,ln=4,Ir=8,tr=Ir,yo=16,zt=32,LB=1;function jB(){return LB++}function Ns(i,e){var t=e.manager;return t?t.get(i):i}function Fp(i){return i&yo?"cancel":i&Ir?"end":i&ln?"move":i&$t?"start":""}var Uo=function(){function i(t){t===void 0&&(t={}),this.options=At({enable:!0},t),this.id=jB(),this.manager=null,this.state=fa,this.simultaneous={},this.requireFail=[]}var e=i.prototype;return e.set=function(r){return di(this.options,r),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(r){if(Ui(r,"recognizeWith",this))return this;var n=this.simultaneous;return r=Ns(r,this),n[r.id]||(n[r.id]=r,r.recognizeWith(this)),this},e.dropRecognizeWith=function(r){return Ui(r,"dropRecognizeWith",this)?this:(r=Ns(r,this),delete this.simultaneous[r.id],this)},e.requireFailure=function(r){if(Ui(r,"requireFailure",this))return this;var n=this.requireFail;return r=Ns(r,this),ci(n,r)===-1&&(n.push(r),r.requireFailure(this)),this},e.dropRequireFailure=function(r){if(Ui(r,"dropRequireFailure",this))return this;r=Ns(r,this);var n=ci(this.requireFail,r);return n>-1&&this.requireFail.splice(n,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(r){return!!this.simultaneous[r.id]},e.emit=function(r){var n=this,o=this.state;function s(a){n.manager.emit(a,r)}o<Ir&&s(n.options.event+Fp(o)),s(n.options.event),r.additionalEvent&&s(r.additionalEvent),o>=Ir&&s(n.options.event+Fp(o))},e.tryEmit=function(r){if(this.canEmit())return this.emit(r);this.state=zt},e.canEmit=function(){for(var r=0;r<this.requireFail.length;){if(!(this.requireFail[r].state&(zt|fa)))return!1;r++}return!0},e.recognize=function(r){var n=di({},r);if(!Il(this.options.enable,[this,n])){this.reset(),this.state=zt;return}this.state&(tr|yo|zt)&&(this.state=fa),this.state=this.process(n),this.state&($t|ln|Ir|yo)&&this.tryEmit(n)},e.process=function(r){},e.getTouchAction=function(){},e.reset=function(){},i}(),kc=function(i){Et(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,At({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},r))||this,n.pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}var t=e.prototype;return t.getTouchAction=function(){return[Dc]},t.process=function(n){var o=this,s=this.options,a=n.pointers.length===s.pointers,l=n.distance<s.threshold,d=n.deltaTime<s.time;if(this.reset(),n.eventType&qe&&this.count===0)return this.failTimeout();if(l&&d&&a){if(n.eventType!==we)return this.failTimeout();var h=this.pTime?n.timeStamp-this.pTime<s.interval:!0,c=!this.pCenter||ka(this.pCenter,n.center)<s.posThreshold;this.pTime=n.timeStamp,this.pCenter=n.center,!c||!h?this.count=1:this.count+=1,this._input=n;var u=this.count%s.taps;if(u===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){o.state=tr,o.tryEmit()},s.interval),$t):tr}return zt},t.failTimeout=function(){var n=this;return this._timer=setTimeout(function(){n.state=zt},this.options.interval),zt},t.reset=function(){clearTimeout(this._timer)},t.emit=function(){this.state===tr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(Uo),dn=function(i){Et(e,i);function e(r){return r===void 0&&(r={}),i.call(this,At({pointers:1},r))||this}var t=e.prototype;return t.attrTest=function(n){var o=this.options.pointers;return o===0||n.pointers.length===o},t.process=function(n){var o=this.state,s=n.eventType,a=o&($t|ln),l=this.attrTest(n);return a&&(s&st||!l)?o|yo:a||l?s&we?o|Ir:o&$t?o|ln:$t:zt},e}(Uo);function hw(i){return i===an?"down":i===Vo?"up":i===Ho?"left":i===Wo?"right":""}var Ju=function(i){Et(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,At({event:"pan",threshold:10,pointers:1,direction:ew},r))||this,n.pX=null,n.pY=null,n}var t=e.prototype;return t.getTouchAction=function(){var n=this.options.direction,o=[];return n&Vt&&o.push(vo),n&ti&&o.push(fo),o},t.directionTest=function(n){var o=this.options,s=!0,a=n.distance,l=n.direction,d=n.deltaX,h=n.deltaY;return l&o.direction||(o.direction&Vt?(l=d===0?Da:d<0?Ho:Wo,s=d!==this.pX,a=Math.abs(n.deltaX)):(l=h===0?Da:h<0?Vo:an,s=h!==this.pY,a=Math.abs(n.deltaY))),n.direction=l,s&&a>o.threshold&&l&o.direction},t.attrTest=function(n){return dn.prototype.attrTest.call(this,n)&&(this.state&$t||!(this.state&$t)&&this.directionTest(n))},t.emit=function(n){this.pX=n.deltaX,this.pY=n.deltaY;var o=hw(n.direction);o&&(n.additionalEvent=this.options.event+o),i.prototype.emit.call(this,n)},e}(dn),cw=function(i){Et(e,i);function e(r){return r===void 0&&(r={}),i.call(this,At({event:"swipe",threshold:10,velocity:.3,direction:Vt|ti,pointers:1},r))||this}var t=e.prototype;return t.getTouchAction=function(){return Ju.prototype.getTouchAction.call(this)},t.attrTest=function(n){var o=this.options.direction,s;return o&(Vt|ti)?s=n.overallVelocity:o&Vt?s=n.overallVelocityX:o&ti&&(s=n.overallVelocityY),i.prototype.attrTest.call(this,n)&&o&n.offsetDirection&&n.distance>this.options.threshold&&n.maxPointers===this.options.pointers&&hi(s)>this.options.velocity&&n.eventType&we},t.emit=function(n){var o=hw(n.offsetDirection);o&&this.manager.emit(this.options.event+o,n),this.manager.emit(this.options.event,n)},e}(dn),uw=function(i){Et(e,i);function e(r){return r===void 0&&(r={}),i.call(this,At({event:"pinch",threshold:0,pointers:2},r))||this}var t=e.prototype;return t.getTouchAction=function(){return[ei]},t.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.scale-1)>this.options.threshold||this.state&$t)},t.emit=function(n){if(n.scale!==1){var o=n.scale<1?"in":"out";n.additionalEvent=this.options.event+o}i.prototype.emit.call(this,n)},e}(dn),fw=function(i){Et(e,i);function e(r){return r===void 0&&(r={}),i.call(this,At({event:"rotate",threshold:0,pointers:2},r))||this}var t=e.prototype;return t.getTouchAction=function(){return[ei]},t.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.rotation)>this.options.threshold||this.state&$t)},e}(dn),vw=function(i){Et(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,At({event:"press",pointers:1,time:251,threshold:9},r))||this,n._timer=null,n._input=null,n}var t=e.prototype;return t.getTouchAction=function(){return[J1]},t.process=function(n){var o=this,s=this.options,a=n.pointers.length===s.pointers,l=n.distance<s.threshold,d=n.deltaTime>s.time;if(this._input=n,!l||!a||n.eventType&(we|st)&&!d)this.reset();else if(n.eventType&qe)this.reset(),this._timer=setTimeout(function(){o.state=tr,o.tryEmit()},s.time);else if(n.eventType&we)return tr;return zt},t.reset=function(){clearTimeout(this._timer)},t.emit=function(n){this.state===tr&&(n&&n.eventType&we?this.manager.emit(this.options.event+"up",n):(this._input.timeStamp=Ku(),this.manager.emit(this.options.event,this._input)))},e}(Uo),pw={domEvents:!1,touchAction:Z1,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Bp=[[fw,{enable:!1}],[uw,{enable:!1},["rotate"]],[cw,{direction:Vt}],[Ju,{direction:Vt},["swipe"]],[kc],[kc,{event:"doubletap",taps:2},["tap"]],[vw]],zB=1,Lp=2;function jp(i,e){var t=i.element;if(t.style){var r;er(i.options.cssProps,function(n,o){r=Tl(t.style,o),e?(i.oldCssProps[r]=t.style[r],t.style[r]=n):t.style[r]=i.oldCssProps[r]||""}),e||(i.oldCssProps={})}}function HB(i,e){var t=document.createEvent("Event");t.initEvent(i,!0,!0),t.gesture=e,e.target.dispatchEvent(t)}var zp=function(){function i(t,r){var n=this;this.options=di({},pw,r||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=BB(this),this.touchAction=new rw(this,this.options.touchAction),jp(this,!0),er(this.options.recognizers,function(o){var s=n.add(new o[0](o[1]));o[2]&&s.recognizeWith(o[2]),o[3]&&s.requireFailure(o[3])},this)}var e=i.prototype;return e.set=function(r){return di(this.options,r),r.touchAction&&this.touchAction.update(),r.inputTarget&&(this.input.destroy(),this.input.target=r.inputTarget,this.input.init()),this},e.stop=function(r){this.session.stopped=r?Lp:zB},e.recognize=function(r){var n=this.session;if(!n.stopped){this.touchAction.preventDefaults(r);var o,s=this.recognizers,a=n.curRecognizer;(!a||a&&a.state&tr)&&(n.curRecognizer=null,a=null);for(var l=0;l<s.length;)o=s[l],n.stopped!==Lp&&(!a||o===a||o.canRecognizeWith(a))?o.recognize(r):o.reset(),!a&&o.state&($t|ln|Ir)&&(n.curRecognizer=o,a=o),l++}},e.get=function(r){if(r instanceof Uo)return r;for(var n=this.recognizers,o=0;o<n.length;o++)if(n[o].options.event===r)return n[o];return null},e.add=function(r){if(Ui(r,"add",this))return this;var n=this.get(r.options.event);return n&&this.remove(n),this.recognizers.push(r),r.manager=this,this.touchAction.update(),r},e.remove=function(r){if(Ui(r,"remove",this))return this;var n=this.get(r);if(r){var o=this.recognizers,s=ci(o,n);s!==-1&&(o.splice(s,1),this.touchAction.update())}return this},e.on=function(r,n){if(r===void 0||n===void 0)return this;var o=this.handlers;return er(po(r),function(s){o[s]=o[s]||[],o[s].push(n)}),this},e.off=function(r,n){if(r===void 0)return this;var o=this.handlers;return er(po(r),function(s){n?o[s]&&o[s].splice(ci(o[s],n),1):delete o[s]}),this},e.emit=function(r,n){this.options.domEvents&&HB(r,n);var o=this.handlers[r]&&this.handlers[r].slice();if(!(!o||!o.length)){n.type=r,n.preventDefault=function(){n.srcEvent.preventDefault()};for(var s=0;s<o.length;)o[s](n),s++}},e.destroy=function(){this.element&&jp(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},i}(),WB={touchstart:qe,touchmove:Ei,touchend:we,touchcancel:st},VB="touchstart",UB="touchstart touchmove touchend touchcancel",KB=function(i){Et(e,i);function e(){var r,n=e.prototype;return n.evTarget=VB,n.evWin=UB,r=i.apply(this,arguments)||this,r.started=!1,r}var t=e.prototype;return t.handler=function(n){var o=WB[n.type];if(o===qe&&(this.started=!0),!!this.started){var s=GB.call(this,n,o);o&(we|st)&&s[0].length-s[1].length===0&&(this.started=!1),this.callback(this.manager,o,{pointers:s[0],changedPointers:s[1],pointerType:zo,srcEvent:n})}},e}(Cn);function GB(i,e){var t=go(i.touches),r=go(i.changedTouches);return e&(we|st)&&(t=qu(t.concat(r),"identifier",!0)),[t,r]}function gw(i,e,t){var r="DEPRECATED METHOD: "+e+`
33
+ `+t+` AT
34
+ `;return function(){var n=new Error("get-stack-trace"),o=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=window.console&&(window.console.warn||window.console.log);return s&&s.call(window.console,r,o),i.apply(this,arguments)}}var yw=gw(function(i,e,t){for(var r=Object.keys(e),n=0;n<r.length;)(!t||t&&i[r[n]]===void 0)&&(i[r[n]]=e[r[n]]),n++;return i},"extend","Use `assign`."),YB=gw(function(i,e){return yw(i,e,!0)},"merge","Use `assign`.");function qB(i,e,t){var r=e.prototype,n;n=i.prototype=Object.create(r),n.constructor=i,n._super=r,t&&di(n,t)}function Hp(i,e){return function(){return i.apply(e,arguments)}}var XB=function(){var i=function(t,r){return r===void 0&&(r={}),new zp(t,At({recognizers:Bp.concat()},r))};return i.VERSION="2.0.17-rc",i.DIRECTION_ALL=ew,i.DIRECTION_DOWN=an,i.DIRECTION_LEFT=Ho,i.DIRECTION_RIGHT=Wo,i.DIRECTION_UP=Vo,i.DIRECTION_HORIZONTAL=Vt,i.DIRECTION_VERTICAL=ti,i.DIRECTION_NONE=Da,i.DIRECTION_DOWN=an,i.INPUT_START=qe,i.INPUT_MOVE=Ei,i.INPUT_END=we,i.INPUT_CANCEL=st,i.STATE_POSSIBLE=fa,i.STATE_BEGAN=$t,i.STATE_CHANGED=ln,i.STATE_ENDED=Ir,i.STATE_RECOGNIZED=tr,i.STATE_CANCELLED=yo,i.STATE_FAILED=zt,i.Manager=zp,i.Input=Cn,i.TouchAction=rw,i.TouchInput=Xu,i.MouseInput=Zu,i.PointerEventInput=lw,i.TouchMouseInput=dw,i.SingleTouchInput=KB,i.Recognizer=Uo,i.AttrRecognizer=dn,i.Tap=kc,i.Pan=Ju,i.Swipe=cw,i.Pinch=uw,i.Rotate=fw,i.Press=vw,i.on=Qn,i.off=eo,i.each=er,i.merge=YB,i.extend=yw,i.bindFn=Hp,i.assign=di,i.inherit=qB,i.bindFn=Hp,i.prefixed=Tl,i.toArray=go,i.inArray=ci,i.uniqueArray=qu,i.splitStr=po,i.boolOrFn=Il,i.hasParent=Yu,i.addEventListeners=Qn,i.removeEventListeners=eo,i.defaults=di({},pw,{preset:Bp}),i}(),ZB=XB;function mw(i,e){var t=typeof _l<"u"&&Wu(i)||i["@@iterator"];if(!t){if(ut(i)||(t=JB(i))||e){t&&(i=t);var r=0,n=function(){};return{s:n,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(d){throw d},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
35
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){t=t.call(i)},n:function(){var d=t.next();return o=d.done,d},e:function(d){s=!0,a=d},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw a}}}}function JB(i,e){var t;if(i){if(typeof i=="string")return Wp(i,e);var r=Ol(t=Object.prototype.toString.call(i)).call(t,8,-1);if(r==="Object"&&i.constructor&&(r=i.constructor.name),r==="Map"||r==="Set")return Hu(i);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wp(i,e)}}function Wp(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}var bw=_l("DELETE");function QB(i){for(var e,t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return $w.apply(void 0,Sl(e=[{},i]).call(e,r))}function $w(){var i=Ra.apply(void 0,arguments);return Ew(i),i}function Ra(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];if(e.length<2)return e[0];if(e.length>2){var r;return Ra.apply(void 0,Sl(r=[$w(e[0],e[1])]).call(r,it(Ol(e).call(e,2))))}var n=e[0],o=e[1];if(n instanceof Date&&o instanceof Date)return n.setTime(o.getTime()),n;var s=mw(QN(o)),a;try{for(s.s();!(a=s.n()).done;){var l=a.value;Object.prototype.propertyIsEnumerable.call(o,l)&&(o[l]===bw?delete n[l]:n[l]!==null&&o[l]!==null&&typeof n[l]=="object"&&typeof o[l]=="object"&&!ut(n[l])&&!ut(o[l])?n[l]=Ra(n[l],o[l]):n[l]=ww(o[l]))}}catch(d){s.e(d)}finally{s.f()}return n}function ww(i){return ut(i)?Tt(i).call(i,function(e){return ww(e)}):typeof i=="object"&&i!==null?i instanceof Date?new Date(i.getTime()):Ra({},i):i}function Ew(i){for(var e=0,t=Uu(i);e<t.length;e++){var r=t[e];i[r]===bw?delete i[r]:typeof i[r]=="object"&&i[r]!==null&&Ew(i[r])}}function eL(){var i=function(){};return{on:i,off:i,destroy:i,emit:i,get(){return{set:i}}}}var tL=typeof window<"u"?window.Hammer||ZB:function(){return eL()};function Zt(i){var e=this,t;this._cleanupQueue=[],this.active=!1,this._dom={container:i,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(function(){e._dom.overlay.parentNode.removeChild(e._dom.overlay)});var r=tL(this._dom.overlay);r.on("tap",m1(t=this._onTapOverlay).call(t,this)),this._cleanupQueue.push(function(){r.destroy()});var n=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];li(n).call(n,function(o){r.on(o,function(s){s.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=function(o){rL(o.target,i)||e.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(function(){document.body.removeEventListener("click",e._onClick)})),this._escListener=function(o){("key"in o?o.key==="Escape":o.keyCode===27)&&e.deactivate()}}hB(Zt.prototype);Zt.current=null;Zt.prototype.destroy=function(){var i,e;this.deactivate();var t=mw(N2(i=j1(e=this._cleanupQueue).call(e,0)).call(i)),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;n()}}catch(o){t.e(o)}finally{t.f()}};Zt.prototype.activate=function(){Zt.current&&Zt.current.deactivate(),Zt.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)};Zt.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")};Zt.prototype._onTapOverlay=function(i){this.activate(),i.srcEvent.stopPropagation()};function rL(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}var iL=ll,nL=En,oL=TypeError,_w=function(i){if(iL(i))return i;throw new oL(nL(i)+" is not a constructor")},sL=M,aL=Ze,Vd=mn,lL=g1,Vp=_w,dL=vt,Up=Be,hL=$i,Sw=Y,Qu=aL("Reflect","construct"),cL=Object.prototype,uL=[].push,Ow=Sw(function(){function i(){}return!(Qu(function(){},[],i)instanceof i)}),Tw=!Sw(function(){Qu(function(){})}),Kp=Ow||Tw;sL({target:"Reflect",stat:!0,forced:Kp,sham:Kp},{construct:function(e,t){Vp(e),dL(t);var r=arguments.length<3?e:Vp(arguments[2]);if(Tw&&!Ow)return Qu(e,t,r);if(e===r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return Vd(uL,n,t),new(Vd(lL,e,n))}var o=r.prototype,s=hL(Up(o)?o:cL),a=Vd(e,s,t);return Up(a)?a:s}});var fL=oe,vL=fL.Reflect.construct,pL=vL,gL=pL,yL=gL,va=R(yL),mL=oe,bL=mL.Object.getOwnPropertySymbols,$L=bL,wL=$L,EL=wL,Gp=R(EL),Iw={exports:{}},_L=M,SL=Y,OL=Kt,Pw=yi.f,Cw=De,TL=!Cw||SL(function(){Pw(1)});_L({target:"Object",stat:!0,forced:TL,sham:!Cw},{getOwnPropertyDescriptor:function(e,t){return Pw(OL(e),t)}});var IL=oe,xw=IL.Object,PL=Iw.exports=function(e,t){return xw.getOwnPropertyDescriptor(e,t)};xw.getOwnPropertyDescriptor.sham&&(PL.sham=!0);var CL=Iw.exports,xL=CL,AL=xL,DL=AL,Aw=R(DL),ML=M,kL=De,RL=Vu,NL=Kt,FL=yi,BL=Sn;ML({target:"Object",stat:!0,sham:!kL},{getOwnPropertyDescriptors:function(e){for(var t=NL(e),r=FL.f,n=RL(t),o={},s=0,a,l;n.length>s;)l=r(t,a=n[s++]),l!==void 0&&BL(o,a,l);return o}});var LL=oe,jL=LL.Object.getOwnPropertyDescriptors,zL=jL,HL=zL,WL=HL,Yp=R(WL),Dw={exports:{}},VL=M,UL=De,qp=hl.f;VL({target:"Object",stat:!0,forced:Object.defineProperties!==qp,sham:!UL},{defineProperties:qp});var KL=oe,Mw=KL.Object,GL=Dw.exports=function(e,t){return Mw.defineProperties(e,t)};Mw.defineProperties.sham&&(GL.sham=!0);var YL=Dw.exports,qL=YL,XL=qL,ZL=XL,JL=R(ZL),QL=h$,ej=R(QL);function kw(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}var tj=H1,rj=tj,ij=rj,nj=ij,Rw=nj,oj=R(Rw),sj=M,aj=t1;sj({target:"Object",stat:!0},{setPrototypeOf:aj});var lj=oe,dj=lj.Object.setPrototypeOf,hj=dj,cj=hj,uj=cj,fj=uj,vj=fj,pj=vj,Nw=pj,Rc=R(Nw),gj=y1,yj=gj,mj=yj,bj=mj,$j=bj,Fw=R($j);function Nc(i,e){var t;return Nc=Rc?Fw(t=Rc).call(t):function(n,o){return n.__proto__=o,n},Nc(i,e)}function wj(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=oj(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),ol(i,"prototype",{writable:!1}),e&&Nc(i,e)}function Ej(i,e){if(e&&(sn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kw(i)}var _j=CF,Sj=_j,Oj=Sj,Tj=Oj,Bw=Tj,Xp=R(Bw);function Na(i){var e;return Na=Rc?Fw(e=Xp).call(e):function(r){return r.__proto__||Xp(r)},Na(i)}var Lw={exports:{}},jw={exports:{}};(function(i){var e=Lu,t=u1;function r(n){"@babel/helpers - typeof";return i.exports=r=typeof e=="function"&&typeof t=="symbol"?function(o){return typeof o}:function(o){return o&&typeof e=="function"&&o.constructor===e&&o!==e.prototype?"symbol":typeof o},i.exports.__esModule=!0,i.exports.default=i.exports,r(n)}i.exports=r,i.exports.__esModule=!0,i.exports.default=i.exports})(jw);var Ij=jw.exports,Pj=F1,Cj=Pj,xj=Cj,Aj=xj,Dj=Aj,Zp=Oe,Mj=Vu,kj=yi,Rj=ht,Nj=function(i,e,t){for(var r=Mj(e),n=Rj.f,o=kj.f,s=0;s<r.length;s++){var a=r[s];!Zp(i,a)&&!(t&&Zp(t,a))&&n(i,a,o(e,a))}},Fj=Be,Bj=ur,Lj=function(i,e){Fj(e)&&"cause"in e&&Bj(i,"cause",e.cause)},jj=te,zw=Error,zj=jj("".replace),Hj=function(i){return String(new zw(i).stack)}("zxcasd"),Hw=/\n\s*at [^:]*:[^\n]*/,Wj=Hw.test(Hj),Vj=function(i,e){if(Wj&&typeof i=="string"&&!zw.prepareStackTrace)for(;e--;)i=zj(i,Hw,"");return i},Uj=Y,Kj=mi,Gj=!Uj(function(){var i=new Error("a");return"stack"in i?(Object.defineProperty(i,"stack",Kj(1,7)),i.stack!==7):!0}),Yj=ur,qj=Vj,Xj=Gj,Jp=Error.captureStackTrace,Zj=function(i,e,t,r){Xj&&(Jp?Jp(i,e):Yj(i,"stack",qj(t,r)))},Jj=Lr,Qj=Me,ez=vt,tz=En,rz=w1,iz=pt,Qp=Se,nz=zu,oz=El,eg=$1,sz=TypeError,pa=function(i,e){this.stopped=i,this.result=e},tg=pa.prototype,_i=function(i,e,t){var r=t&&t.that,n=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),s=!!(t&&t.IS_ITERATOR),a=!!(t&&t.INTERRUPTED),l=Jj(e,r),d,h,c,u,f,v,y,g=function(m){return d&&eg(d,"normal",m),new pa(!0,m)},p=function(m){return n?(ez(m),a?l(m[0],m[1],g):l(m[0],m[1])):a?l(m,g):l(m)};if(o)d=i.iterator;else if(s)d=i;else{if(h=oz(i),!h)throw new sz(tz(i)+" is not iterable");if(rz(h)){for(c=0,u=iz(i);u>c;c++)if(f=p(i[c]),f&&Qp(tg,f))return f;return new pa(!1)}d=nz(i,h)}for(v=o?i.next:d.next;!(y=Qj(v,d)).done;){try{f=p(y.value)}catch(m){eg(d,"throw",m)}if(typeof f=="object"&&f&&Qp(tg,f))return f}return new pa(!1)},az=bi,lz=function(i,e){return i===void 0?arguments.length<2?"":e:az(i)},dz=M,hz=Se,cz=bl,Fa=t1,uz=Nj,Ww=$i,Ud=ur,Kd=mi,fz=Lj,vz=Zj,pz=_i,gz=lz,yz=ae,mz=yz("toStringTag"),Ba=Error,bz=[].push,hn=function(e,t){var r=hz(Gd,this),n;Fa?n=Fa(new Ba,r?cz(this):Gd):(n=r?this:Ww(Gd),Ud(n,mz,"Error")),t!==void 0&&Ud(n,"message",gz(t)),vz(n,hn,n.stack,1),arguments.length>2&&fz(n,arguments[2]);var o=[];return pz(e,bz,{that:o}),Ud(n,"errors",o),n};Fa?Fa(hn,Ba):uz(hn,Ba,{name:!0});var Gd=hn.prototype=Ww(Ba.prototype,{constructor:Kd(1,hn),message:Kd(1,""),name:Kd(1,"AggregateError")});dz({global:!0},{AggregateError:hn});var $z=Ze,wz=Au,Ez=ae,_z=De,rg=Ez("species"),Vw=function(i){var e=$z(i);_z&&e&&!e[rg]&&wz(e,rg,{configurable:!0,get:function(){return this}})},Sz=Se,Oz=TypeError,ef=function(i,e){if(Sz(e,i))return i;throw new Oz("Incorrect invocation")},ig=vt,Tz=_w,Iz=bn,Pz=ae,Cz=Pz("species"),Uw=function(i,e){var t=ig(i).constructor,r;return t===void 0||Iz(r=ig(t)[Cz])?e:Tz(r)},xz=Br,Kw=/(?:ipad|iphone|ipod).*applewebkit/i.test(xz),ft=ne,Az=mn,Dz=Lr,ng=ue,Mz=Oe,Gw=Y,og=$$,kz=Bo,sg=Tu,Rz=W1,Nz=Kw,Fz=jo,Fc=ft.setImmediate,ag=ft.clearImmediate,Bz=ft.process,Yd=ft.Dispatch,Lz=ft.Function,lg=ft.MessageChannel,jz=ft.String,qd=0,to={},dg="onreadystatechange",mo,Kr,Xd,Zd;Gw(function(){mo=ft.location});var tf=function(i){if(Mz(to,i)){var e=to[i];delete to[i],e()}},Jd=function(i){return function(){tf(i)}},hg=function(i){tf(i.data)},cg=function(i){ft.postMessage(jz(i),mo.protocol+"//"+mo.host)};(!Fc||!ag)&&(Fc=function(e){Rz(arguments.length,1);var t=ng(e)?e:Lz(e),r=kz(arguments,1);return to[++qd]=function(){Az(t,void 0,r)},Kr(qd),qd},ag=function(e){delete to[e]},Fz?Kr=function(i){Bz.nextTick(Jd(i))}:Yd&&Yd.now?Kr=function(i){Yd.now(Jd(i))}:lg&&!Nz?(Xd=new lg,Zd=Xd.port2,Xd.port1.onmessage=hg,Kr=Dz(Zd.postMessage,Zd)):ft.addEventListener&&ng(ft.postMessage)&&!ft.importScripts&&mo&&mo.protocol!=="file:"&&!Gw(cg)?(Kr=cg,ft.addEventListener("message",hg,!1)):dg in sg("script")?Kr=function(i){og.appendChild(sg("script"))[dg]=function(){og.removeChild(this),tf(i)}}:Kr=function(i){setTimeout(Jd(i),0)});var Yw={set:Fc},qw=function(){this.head=null,this.tail=null};qw.prototype={add:function(i){var e={item:i,next:null},t=this.tail;t?t.next=e:this.head=e,this.tail=e},get:function(){var i=this.head;if(i){var e=this.head=i.next;return e===null&&(this.tail=null),i.item}}};var Xw=qw,zz=Br,Hz=/ipad|iphone|ipod/i.test(zz)&&typeof Pebble<"u",Wz=Br,Vz=/web0s(?!.*chrome)/i.test(Wz),ui=ne,ug=Lr,Uz=yi.f,Qd=Yw.set,Kz=Xw,Gz=Kw,Yz=Hz,qz=Vz,eh=jo,fg=ui.MutationObserver||ui.WebKitMutationObserver,vg=ui.document,pg=ui.process,Fs=ui.Promise,gg=Uz(ui,"queueMicrotask"),Bc=gg&&gg.value,Mi,th,rh,Bs,yg;if(!Bc){var Ls=new Kz,js=function(){var i,e;for(eh&&(i=pg.domain)&&i.exit();e=Ls.get();)try{e()}catch(t){throw Ls.head&&Mi(),t}i&&i.enter()};!Gz&&!eh&&!qz&&fg&&vg?(th=!0,rh=vg.createTextNode(""),new fg(js).observe(rh,{characterData:!0}),Mi=function(){rh.data=th=!th}):!Yz&&Fs&&Fs.resolve?(Bs=Fs.resolve(void 0),Bs.constructor=Fs,yg=ug(Bs.then,Bs),Mi=function(){yg(js)}):eh?Mi=function(){pg.nextTick(js)}:(Qd=ug(Qd,ui),Mi=function(){Qd(js)}),Bc=function(i){Ls.head||Mi(),Ls.add(i)}}var Xz=Bc,Zz=function(i,e){try{arguments.length===1?console.error(i):console.error(i,e)}catch{}},xn=function(i){try{return{error:!1,value:i()}}catch(e){return{error:!0,value:e}}},Jz=ne,An=Jz.Promise,Zw=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",Qz=Zw,e3=jo,t3=!Qz&&!e3&&typeof window=="object"&&typeof document=="object",r3=ne,ro=An,i3=ue,n3=a$,o3=f$,s3=ae,a3=t3,l3=Zw,ih=$n,mg=ro&&ro.prototype,d3=s3("species"),bg=!1,Jw=i3(r3.PromiseRejectionEvent),h3=n3("Promise",function(){var i=o3(ro),e=i!==String(ro);if(!e&&ih===66||!(mg.catch&&mg.finally))return!0;if(!ih||ih<51||!/native code/.test(i)){var t=new ro(function(o){o(1)}),r=function(o){o(function(){},function(){})},n=t.constructor={};if(n[d3]=r,bg=t.then(function(){})instanceof r,!bg)return!0}return!e&&(a3||l3)&&!Jw}),Ko={CONSTRUCTOR:h3,REJECTION_EVENT:Jw},Gt={},$g=lt,c3=TypeError,u3=function(i){var e,t;this.promise=new i(function(r,n){if(e!==void 0||t!==void 0)throw new c3("Bad Promise constructor");e=r,t=n}),this.resolve=$g(e),this.reject=$g(t)};Gt.f=function(i){return new u3(i)};var f3=M,La=jo,Mr=ne,Go=Me,v3=On,p3=wi,g3=Vw,y3=lt,Lc=ue,m3=Be,b3=ef,$3=Uw,Qw=Yw.set,rf=Xz,w3=Zz,E3=xn,_3=Xw,e0=Tn,jc=An,t0=Ko,r0=Gt,Pl="Promise",i0=t0.CONSTRUCTOR,S3=t0.REJECTION_EVENT,nh=e0.getterFor(Pl),O3=e0.set,T3=jc&&jc.prototype,Ki=jc,oh=T3,n0=Mr.TypeError,zc=Mr.document,nf=Mr.process,Hc=r0.f,I3=Hc,P3=!!(zc&&zc.createEvent&&Mr.dispatchEvent),o0="unhandledrejection",C3="rejectionhandled",wg=0,s0=1,x3=2,of=1,a0=2,zs,Eg,A3,l0=function(i){var e;return m3(i)&&Lc(e=i.then)?e:!1},d0=function(i,e){var t=e.value,r=e.state===s0,n=r?i.ok:i.fail,o=i.resolve,s=i.reject,a=i.domain,l,d,h;try{n?(r||(e.rejection===a0&&M3(e),e.rejection=of),n===!0?l=t:(a&&a.enter(),l=n(t),a&&(a.exit(),h=!0)),l===i.promise?s(new n0("Promise-chain cycle")):(d=l0(l))?Go(d,l,o,s):o(l)):s(t)}catch(c){a&&!h&&a.exit(),s(c)}},h0=function(i,e){i.notified||(i.notified=!0,rf(function(){for(var t=i.reactions,r;r=t.get();)d0(r,i);i.notified=!1,e&&!i.rejection&&D3(i)}))},c0=function(i,e,t){var r,n;P3?(r=zc.createEvent("Event"),r.promise=e,r.reason=t,r.initEvent(i,!1,!0),Mr.dispatchEvent(r)):r={promise:e,reason:t},!S3&&(n=Mr["on"+i])?n(r):i===o0&&w3("Unhandled promise rejection",t)},D3=function(i){Go(Qw,Mr,function(){var e=i.facade,t=i.value,r=_g(i),n;if(r&&(n=E3(function(){La?nf.emit("unhandledRejection",t,e):c0(o0,e,t)}),i.rejection=La||_g(i)?a0:of,n.error))throw n.value})},_g=function(i){return i.rejection!==of&&!i.parent},M3=function(i){Go(Qw,Mr,function(){var e=i.facade;La?nf.emit("rejectionHandled",e):c0(C3,e,i.value)})},Gi=function(i,e,t){return function(r){i(e,r,t)}},Ji=function(i,e,t){i.done||(i.done=!0,t&&(i=t),i.value=e,i.state=x3,h0(i,!0))},Wc=function(i,e,t){if(!i.done){i.done=!0,t&&(i=t);try{if(i.facade===e)throw new n0("Promise can't be resolved itself");var r=l0(e);r?rf(function(){var n={done:!1};try{Go(r,e,Gi(Wc,n,i),Gi(Ji,n,i))}catch(o){Ji(n,o,i)}}):(i.value=e,i.state=s0,h0(i,!1))}catch(n){Ji({done:!1},n,i)}}};i0&&(Ki=function(e){b3(this,oh),y3(e),Go(zs,this);var t=nh(this);try{e(Gi(Wc,t),Gi(Ji,t))}catch(r){Ji(t,r)}},oh=Ki.prototype,zs=function(e){O3(this,{type:Pl,done:!1,notified:!1,parent:!1,reactions:new _3,rejection:!1,state:wg,value:void 0})},zs.prototype=v3(oh,"then",function(e,t){var r=nh(this),n=Hc($3(this,Ki));return r.parent=!0,n.ok=Lc(e)?e:!0,n.fail=Lc(t)&&t,n.domain=La?nf.domain:void 0,r.state===wg?r.reactions.add(n):rf(function(){d0(n,r)}),n.promise}),Eg=function(){var i=new zs,e=nh(i);this.promise=i,this.resolve=Gi(Wc,e),this.reject=Gi(Ji,e)},r0.f=Hc=function(i){return i===Ki||i===A3?new Eg(i):I3(i)});f3({global:!0,wrap:!0,forced:i0},{Promise:Ki});p3(Ki,Pl,!1,!0);g3(Pl);var k3=An,R3=S1,N3=Ko.CONSTRUCTOR,Cl=N3||!R3(function(i){k3.all(i).then(void 0,function(){})}),F3=M,B3=Me,L3=lt,j3=Gt,z3=xn,H3=_i,W3=Cl;F3({target:"Promise",stat:!0,forced:W3},{all:function(e){var t=this,r=j3.f(t),n=r.resolve,o=r.reject,s=z3(function(){var a=L3(t.resolve),l=[],d=0,h=1;H3(e,function(c){var u=d++,f=!1;h++,B3(a,t,c).then(function(v){f||(f=!0,l[u]=v,--h||n(l))},o)}),--h||n(l)});return s.error&&o(s.value),r.promise}});var V3=M,U3=Ko.CONSTRUCTOR,Sg=An;Sg&&Sg.prototype;V3({target:"Promise",proto:!0,forced:U3,real:!0},{catch:function(i){return this.then(void 0,i)}});var K3=M,G3=Me,Y3=lt,q3=Gt,X3=xn,Z3=_i,J3=Cl;K3({target:"Promise",stat:!0,forced:J3},{race:function(e){var t=this,r=q3.f(t),n=r.reject,o=X3(function(){var s=Y3(t.resolve);Z3(e,function(a){G3(s,t,a).then(r.resolve,n)})});return o.error&&n(o.value),r.promise}});var Q3=M,e5=Me,t5=Gt,r5=Ko.CONSTRUCTOR;Q3({target:"Promise",stat:!0,forced:r5},{reject:function(e){var t=t5.f(this);return e5(t.reject,void 0,e),t.promise}});var i5=vt,n5=Be,o5=Gt,u0=function(i,e){if(i5(i),n5(e)&&e.constructor===i)return e;var t=o5.f(i),r=t.resolve;return r(e),t.promise},s5=M,a5=Ze,l5=pO,d5=An,h5=Ko.CONSTRUCTOR,c5=u0,u5=a5("Promise"),f5=!h5;s5({target:"Promise",stat:!0,forced:l5},{resolve:function(e){return c5(f5&&this===u5?d5:this,e)}});var v5=M,p5=Me,g5=lt,y5=Gt,m5=xn,b5=_i,$5=Cl;v5({target:"Promise",stat:!0,forced:$5},{allSettled:function(e){var t=this,r=y5.f(t),n=r.resolve,o=r.reject,s=m5(function(){var a=g5(t.resolve),l=[],d=0,h=1;b5(e,function(c){var u=d++,f=!1;h++,p5(a,t,c).then(function(v){f||(f=!0,l[u]={status:"fulfilled",value:v},--h||n(l))},function(v){f||(f=!0,l[u]={status:"rejected",reason:v},--h||n(l))})}),--h||n(l)});return s.error&&o(s.value),r.promise}});var w5=M,E5=Me,_5=lt,S5=Ze,O5=Gt,T5=xn,I5=_i,P5=Cl,Og="No one promise resolved";w5({target:"Promise",stat:!0,forced:P5},{any:function(e){var t=this,r=S5("AggregateError"),n=O5.f(t),o=n.resolve,s=n.reject,a=T5(function(){var l=_5(t.resolve),d=[],h=0,c=1,u=!1;I5(e,function(f){var v=h++,y=!1;c++,E5(l,t,f).then(function(g){y||u||(u=!0,o(g))},function(g){y||u||(y=!0,d[v]=g,--c||s(new r(d,Og)))})}),--c||s(new r(d,Og))});return a.error&&s(a.value),n.promise}});var C5=M,Vc=An,x5=Y,A5=Ze,D5=ue,M5=Uw,Tg=u0,k5=Vc&&Vc.prototype,R5=!!Vc&&x5(function(){k5.finally.call({then:function(){}},function(){})});C5({target:"Promise",proto:!0,real:!0,forced:R5},{finally:function(i){var e=M5(this,A5("Promise")),t=D5(i);return this.then(t?function(r){return Tg(e,i()).then(function(){return r})}:i,t?function(r){return Tg(e,i()).then(function(){throw r})}:i)}});var N5=oe,F5=N5.Promise,B5=F5,L5=B5,j5=M,z5=Gt;j5({target:"Promise",stat:!0},{withResolvers:function(){var e=z5.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}});var H5=L5,W5=H5,V5=M,U5=Gt,K5=xn;V5({target:"Promise",stat:!0,forced:!0},{try:function(i){var e=U5.f(this),t=K5(i);return(t.error?e.reject:e.resolve)(t.value),e.promise}});var G5=W5,Y5=G5,q5=Y5,X5=B1,Z5=X5,J5=Z5,Q5=J5,eH=Q5;(function(i){var e=Ij.default,t=c$,r=Lu,n=Rw,o=Bw,s=Dj,a=A1,l=Nw,d=q5,h=eH,c=M1;function u(){i.exports=u=function(){return v},i.exports.__esModule=!0,i.exports.default=i.exports;var f,v={},y=Object.prototype,g=y.hasOwnProperty,p=t||function(I,S,O){I[S]=O.value},m=typeof r=="function"?r:{},$=m.iterator||"@@iterator",E=m.asyncIterator||"@@asyncIterator",P=m.toStringTag||"@@toStringTag";function D(I,S,O){return t(I,S,{value:O,enumerable:!0,configurable:!0,writable:!0}),I[S]}try{D({},"")}catch{D=function(O,A,j){return O[A]=j}}function L(I,S,O,A){var j=S&&S.prototype instanceof ct?S:ct,F=n(j.prototype),ge=new rd(A||[]);return p(F,"_invoke",{value:ed(I,O,ge)}),F}function W(I,S,O){try{return{type:"normal",arg:I.call(S,O)}}catch(A){return{type:"throw",arg:A}}}v.wrap=L;var se="suspendedStart",le="suspendedYield",Ve="executing",ke="completed",Re={};function ct(){}function re(){}function V(){}var G={};D(G,$,function(){return this});var be=o,$e=be&&be(be(id([])));$e&&$e!==y&&g.call($e,$)&&(G=$e);var Pe=V.prototype=ct.prototype=n(G);function Xt(I){var S;s(S=["next","throw","return"]).call(S,function(O){D(I,O,function(A){return this._invoke(O,A)})})}function Nt(I,S){function O(j,F,ge,Ue){var Je=W(I[j],I,F);if(Je.type!=="throw"){var Vr=Je.arg,gr=Vr.value;return gr&&e(gr)=="object"&&g.call(gr,"__await")?S.resolve(gr.__await).then(function(Ur){O("next",Ur,ge,Ue)},function(Ur){O("throw",Ur,ge,Ue)}):S.resolve(gr).then(function(Ur){Vr.value=Ur,ge(Vr)},function(Ur){return O("throw",Ur,ge,Ue)})}Ue(Je.arg)}var A;p(this,"_invoke",{value:function(F,ge){function Ue(){return new S(function(Je,Vr){O(F,ge,Je,Vr)})}return A=A?A.then(Ue,Ue):Ue()}})}function ed(I,S,O){var A=se;return function(j,F){if(A===Ve)throw new Error("Generator is already running");if(A===ke){if(j==="throw")throw F;return{value:f,done:!0}}for(O.method=j,O.arg=F;;){var ge=O.delegate;if(ge){var Ue=Zf(ge,O);if(Ue){if(Ue===Re)continue;return Ue}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(A===se)throw A=ke,O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);A=Ve;var Je=W(I,S,O);if(Je.type==="normal"){if(A=O.done?ke:le,Je.arg===Re)continue;return{value:Je.arg,done:O.done}}Je.type==="throw"&&(A=ke,O.method="throw",O.arg=Je.arg)}}}function Zf(I,S){var O=S.method,A=I.iterator[O];if(A===f)return S.delegate=null,O==="throw"&&I.iterator.return&&(S.method="return",S.arg=f,Zf(I,S),S.method==="throw")||O!=="return"&&(S.method="throw",S.arg=new TypeError("The iterator does not provide a '"+O+"' method")),Re;var j=W(A,I.iterator,S.arg);if(j.type==="throw")return S.method="throw",S.arg=j.arg,S.delegate=null,Re;var F=j.arg;return F?F.done?(S[I.resultName]=F.value,S.next=I.nextLoc,S.method!=="return"&&(S.method="next",S.arg=f),S.delegate=null,Re):F:(S.method="throw",S.arg=new TypeError("iterator result is not an object"),S.delegate=null,Re)}function PS(I){var S,O={tryLoc:I[0]};1 in I&&(O.catchLoc=I[1]),2 in I&&(O.finallyLoc=I[2],O.afterLoc=I[3]),a(S=this.tryEntries).call(S,O)}function td(I){var S=I.completion||{};S.type="normal",delete S.arg,I.completion=S}function rd(I){this.tryEntries=[{tryLoc:"root"}],s(I).call(I,PS,this),this.reset(!0)}function id(I){if(I||I===""){var S=I[$];if(S)return S.call(I);if(typeof I.next=="function")return I;if(!isNaN(I.length)){var O=-1,A=function j(){for(;++O<I.length;)if(g.call(I,O))return j.value=I[O],j.done=!1,j;return j.value=f,j.done=!0,j};return A.next=A}}throw new TypeError(e(I)+" is not iterable")}return re.prototype=V,p(Pe,"constructor",{value:V,configurable:!0}),p(V,"constructor",{value:re,configurable:!0}),re.displayName=D(V,P,"GeneratorFunction"),v.isGeneratorFunction=function(I){var S=typeof I=="function"&&I.constructor;return!!S&&(S===re||(S.displayName||S.name)==="GeneratorFunction")},v.mark=function(I){return l?l(I,V):(I.__proto__=V,D(I,P,"GeneratorFunction")),I.prototype=n(Pe),I},v.awrap=function(I){return{__await:I}},Xt(Nt.prototype),D(Nt.prototype,E,function(){return this}),v.AsyncIterator=Nt,v.async=function(I,S,O,A,j){j===void 0&&(j=d);var F=new Nt(L(I,S,O,A),j);return v.isGeneratorFunction(S)?F:F.next().then(function(ge){return ge.done?ge.value:F.next()})},Xt(Pe),D(Pe,P,"Generator"),D(Pe,$,function(){return this}),D(Pe,"toString",function(){return"[object Generator]"}),v.keys=function(I){var S=Object(I),O=[];for(var A in S)a(O).call(O,A);return h(O).call(O),function j(){for(;O.length;){var F=O.pop();if(F in S)return j.value=F,j.done=!1,j}return j.done=!0,j}},v.values=id,rd.prototype={constructor:rd,reset:function(S){var O;if(this.prev=0,this.next=0,this.sent=this._sent=f,this.done=!1,this.delegate=null,this.method="next",this.arg=f,s(O=this.tryEntries).call(O,td),!S)for(var A in this)A.charAt(0)==="t"&&g.call(this,A)&&!isNaN(+c(A).call(A,1))&&(this[A]=f)},stop:function(){this.done=!0;var S=this.tryEntries[0].completion;if(S.type==="throw")throw S.arg;return this.rval},dispatchException:function(S){if(this.done)throw S;var O=this;function A(Vr,gr){return ge.type="throw",ge.arg=S,O.next=Vr,gr&&(O.method="next",O.arg=f),!!gr}for(var j=this.tryEntries.length-1;j>=0;--j){var F=this.tryEntries[j],ge=F.completion;if(F.tryLoc==="root")return A("end");if(F.tryLoc<=this.prev){var Ue=g.call(F,"catchLoc"),Je=g.call(F,"finallyLoc");if(Ue&&Je){if(this.prev<F.catchLoc)return A(F.catchLoc,!0);if(this.prev<F.finallyLoc)return A(F.finallyLoc)}else if(Ue){if(this.prev<F.catchLoc)return A(F.catchLoc,!0)}else{if(!Je)throw new Error("try statement without catch or finally");if(this.prev<F.finallyLoc)return A(F.finallyLoc)}}}},abrupt:function(S,O){for(var A=this.tryEntries.length-1;A>=0;--A){var j=this.tryEntries[A];if(j.tryLoc<=this.prev&&g.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var F=j;break}}F&&(S==="break"||S==="continue")&&F.tryLoc<=O&&O<=F.finallyLoc&&(F=null);var ge=F?F.completion:{};return ge.type=S,ge.arg=O,F?(this.method="next",this.next=F.finallyLoc,Re):this.complete(ge)},complete:function(S,O){if(S.type==="throw")throw S.arg;return S.type==="break"||S.type==="continue"?this.next=S.arg:S.type==="return"?(this.rval=this.arg=S.arg,this.method="return",this.next="end"):S.type==="normal"&&O&&(this.next=O),Re},finish:function(S){for(var O=this.tryEntries.length-1;O>=0;--O){var A=this.tryEntries[O];if(A.finallyLoc===S)return this.complete(A.completion,A.afterLoc),td(A),Re}},catch:function(S){for(var O=this.tryEntries.length-1;O>=0;--O){var A=this.tryEntries[O];if(A.tryLoc===S){var j=A.completion;if(j.type==="throw"){var F=j.arg;td(A)}return F}}throw new Error("illegal catch attempt")},delegateYield:function(S,O,A){return this.delegate={iterator:id(S),resultName:O,nextLoc:A},this.method==="next"&&(this.arg=f),Re}},v}i.exports=u,i.exports.__esModule=!0,i.exports.default=i.exports})(Lw);var tH=Lw.exports,ga=tH(),rH=ga;try{regeneratorRuntime=ga}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=ga:Function("r","regeneratorRuntime = r")(ga)}var et=R(rH),f0={exports:{}},iH=Y,nH=iH(function(){if(typeof ArrayBuffer=="function"){var i=new ArrayBuffer(8);Object.isExtensible(i)&&Object.defineProperty(i,"a",{value:8})}}),oH=Y,sH=Be,aH=Fr,Ig=nH,ya=Object.isExtensible,lH=oH(function(){ya(1)}),dH=lH||Ig?function(e){return!sH(e)||Ig&&aH(e)==="ArrayBuffer"?!1:ya?ya(e):!0}:ya,hH=Y,cH=!hH(function(){return Object.isExtensible(Object.preventExtensions({}))}),uH=M,fH=te,vH=Do,pH=Be,sf=Oe,gH=ht.f,Pg=Mo,yH=xu,af=dH,mH=il,bH=cH,v0=!1,dr=mH("meta"),$H=0,lf=function(i){gH(i,dr,{value:{objectID:"O"+$H++,weakData:{}}})},wH=function(i,e){if(!pH(i))return typeof i=="symbol"?i:(typeof i=="string"?"S":"P")+i;if(!sf(i,dr)){if(!af(i))return"F";if(!e)return"E";lf(i)}return i[dr].objectID},EH=function(i,e){if(!sf(i,dr)){if(!af(i))return!0;if(!e)return!1;lf(i)}return i[dr].weakData},_H=function(i){return bH&&v0&&af(i)&&!sf(i,dr)&&lf(i),i},SH=function(){OH.enable=function(){},v0=!0;var i=Pg.f,e=fH([].splice),t={};t[dr]=1,i(t).length&&(Pg.f=function(r){for(var n=i(r),o=0,s=n.length;o<s;o++)if(n[o]===dr){e(n,o,1);break}return n},uH({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:yH.f}))},OH=f0.exports={enable:SH,fastKey:wH,getWeakData:EH,onFreeze:_H};vH[dr]=!0;var p0=f0.exports,TH=M,IH=ne,PH=p0,CH=Y,xH=ur,AH=_i,DH=ef,MH=ue,kH=Be,RH=bn,NH=wi,FH=ht.f,BH=In.forEach,LH=De,g0=Tn,jH=g0.set,zH=g0.getterFor,y0=function(i,e,t){var r=i.indexOf("Map")!==-1,n=i.indexOf("Weak")!==-1,o=r?"set":"add",s=IH[i],a=s&&s.prototype,l={},d;if(!LH||!MH(s)||!(n||a.forEach&&!CH(function(){new s().entries().next()})))d=t.getConstructor(e,i,r,o),PH.enable();else{d=e(function(u,f){jH(DH(u,h),{type:i,collection:new s}),RH(f)||AH(f,u[o],{that:u,AS_ENTRIES:r})});var h=d.prototype,c=zH(i);BH(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(u){var f=u==="add"||u==="set";u in a&&!(n&&u==="clear")&&xH(h,u,function(v,y){var g=c(this).collection;if(!f&&n&&!kH(v))return u==="get"?void 0:!1;var p=g[u](v===0?0:v,y);return f?this:p})}),n||FH(h,"size",{configurable:!0,get:function(){return c(this).collection.size}})}return NH(d,i,!1,!0),l[i]=d,TH({global:!0,forced:!0},l),n||t.setStrong(d,i,r),d},HH=On,WH=function(i,e,t){for(var r in e)t&&t.unsafe&&i[r]?i[r]=e[r]:HH(i,r,e[r],t);return i},VH=$i,UH=Au,Cg=WH,KH=Lr,GH=ef,YH=bn,qH=_i,XH=Nu,Hs=Fu,ZH=Vw,Wn=De,xg=p0.fastKey,m0=Tn,Ag=m0.set,sh=m0.getterFor,b0={getConstructor:function(i,e,t,r){var n=i(function(d,h){GH(d,o),Ag(d,{type:e,index:VH(null),first:void 0,last:void 0,size:0}),Wn||(d.size=0),YH(h)||qH(h,d[r],{that:d,AS_ENTRIES:t})}),o=n.prototype,s=sh(e),a=function(d,h,c){var u=s(d),f=l(d,h),v,y;return f?f.value=c:(u.last=f={index:y=xg(h,!0),key:h,value:c,previous:v=u.last,next:void 0,removed:!1},u.first||(u.first=f),v&&(v.next=f),Wn?u.size++:d.size++,y!=="F"&&(u.index[y]=f)),d},l=function(d,h){var c=s(d),u=xg(h),f;if(u!=="F")return c.index[u];for(f=c.first;f;f=f.next)if(f.key===h)return f};return Cg(o,{clear:function(){for(var h=this,c=s(h),u=c.index,f=c.first;f;)f.removed=!0,f.previous&&(f.previous=f.previous.next=void 0),delete u[f.index],f=f.next;c.first=c.last=void 0,Wn?c.size=0:h.size=0},delete:function(d){var h=this,c=s(h),u=l(h,d);if(u){var f=u.next,v=u.previous;delete c.index[u.index],u.removed=!0,v&&(v.next=f),f&&(f.previous=v),c.first===u&&(c.first=f),c.last===u&&(c.last=v),Wn?c.size--:h.size--}return!!u},forEach:function(h){for(var c=s(this),u=KH(h,arguments.length>1?arguments[1]:void 0),f;f=f?f.next:c.first;)for(u(f.value,f.key,this);f&&f.removed;)f=f.previous},has:function(h){return!!l(this,h)}}),Cg(o,t?{get:function(h){var c=l(this,h);return c&&c.value},set:function(h,c){return a(this,h===0?0:h,c)}}:{add:function(h){return a(this,h=h===0?0:h,h)}}),Wn&&UH(o,"size",{configurable:!0,get:function(){return s(this).size}}),n},setStrong:function(i,e,t){var r=e+" Iterator",n=sh(e),o=sh(r);XH(i,e,function(s,a){Ag(this,{type:r,target:s,state:n(s),kind:a,last:void 0})},function(){for(var s=o(this),a=s.kind,l=s.last;l&&l.removed;)l=l.previous;return!s.target||!(s.last=l=l?l.next:s.state.first)?(s.target=void 0,Hs(void 0,!0)):Hs(a==="keys"?l.key:a==="values"?l.value:[l.key,l.value],!1)},t?"entries":"values",!t,!0),ZH(e)}},JH=y0,QH=b0;JH("Map",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},QH);var eW=oe,tW=eW.Map,rW=tW,iW=rW,nW=iW,$0=R(nW),oW=M,sW=In.some,aW=wl,lW=aW("some");oW({target:"Array",proto:!0,forced:!lW},{some:function(e){return sW(this,e,arguments.length>1?arguments[1]:void 0)}});var dW=He,hW=dW("Array","some"),cW=Se,uW=hW,ah=Array.prototype,fW=function(i){var e=i.some;return i===ah||cW(ah,i)&&e===ah.some?uW:e},vW=fW,pW=vW,gW=pW,yW=R(gW),mW=He,bW=mW("Array","keys"),$W=bW,wW=$W,EW=fr,_W=Oe,SW=Se,OW=wW,lh=Array.prototype,TW={DOMTokenList:!0,NodeList:!0},IW=function(i){var e=i.keys;return i===lh||SW(lh,i)&&e===lh.keys||_W(TW,EW(i))?OW:e},PW=IW,ki=R(PW),Dg=_$,CW=Math.floor,Uc=function(i,e){var t=i.length,r=CW(t/2);return t<8?xW(i,e):AW(i,Uc(Dg(i,0,r),e),Uc(Dg(i,r),e),e)},xW=function(i,e){for(var t=i.length,r=1,n,o;r<t;){for(o=r,n=i[r];o&&e(i[o-1],n)>0;)i[o]=i[--o];o!==r++&&(i[o]=n)}return i},AW=function(i,e,t,r){for(var n=e.length,o=t.length,s=0,a=0;s<n||a<o;)i[s+a]=s<n&&a<o?r(e[s],t[a])<=0?e[s++]:t[a++]:s<n?e[s++]:t[a++];return i},DW=Uc,MW=Br,Mg=MW.match(/firefox\/(\d+)/i),kW=!!Mg&&+Mg[1],RW=Br,NW=/MSIE|Trident/.test(RW),FW=Br,kg=FW.match(/AppleWebKit\/(\d+)\./),BW=!!kg&&+kg[1],LW=M,w0=te,jW=lt,zW=dt,Rg=pt,HW=L1,Ng=bi,df=Y,WW=DW,VW=wl,Fg=kW,UW=NW,Bg=$n,Lg=BW,Er=[],jg=w0(Er.sort),KW=w0(Er.push),GW=df(function(){Er.sort(void 0)}),YW=df(function(){Er.sort(null)}),qW=VW("sort"),E0=!df(function(){if(Bg)return Bg<70;if(!(Fg&&Fg>3)){if(UW)return!0;if(Lg)return Lg<603;var i="",e,t,r,n;for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)Er.push({k:t+n,v:r})}for(Er.sort(function(o,s){return s.v-o.v}),n=0;n<Er.length;n++)t=Er[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return i!=="DGBEFHACIJK"}}),XW=GW||!YW||!qW||!E0,ZW=function(i){return function(e,t){return t===void 0?-1:e===void 0?1:i!==void 0?+i(e,t)||0:Ng(e)>Ng(t)?1:-1}};LW({target:"Array",proto:!0,forced:XW},{sort:function(e){e!==void 0&&jW(e);var t=zW(this);if(E0)return e===void 0?jg(t):jg(t,e);var r=[],n=Rg(t),o,s;for(s=0;s<n;s++)s in t&&KW(r,t[s]);for(WW(r,ZW(e)),o=Rg(r),s=0;s<o;)t[s]=r[s++];for(;s<n;)HW(t,s++);return t}});var JW=He,QW=JW("Array","sort"),e4=Se,t4=QW,dh=Array.prototype,r4=function(i){var e=i.sort;return i===dh||e4(dh,i)&&e===dh.sort?t4:e},i4=r4,n4=i4,o4=n4,Kc=R(o4),s4=He,a4=s4("Array","values"),l4=a4,d4=l4,h4=fr,c4=Oe,u4=Se,f4=d4,hh=Array.prototype,v4={DOMTokenList:!0,NodeList:!0},p4=function(i){var e=i.values;return i===hh||u4(hh,i)&&e===hh.values||c4(v4,h4(i))?f4:e},g4=p4,zg=R(g4),y4=c1,Yi=R(y4),m4=He,b4=m4("Array","entries"),$4=b4,w4=$4,E4=fr,_4=Oe,S4=Se,O4=w4,ch=Array.prototype,T4={DOMTokenList:!0,NodeList:!0},I4=function(i){var e=i.entries;return i===ch||S4(ch,i)&&e===ch.entries||_4(T4,E4(i))?O4:e},P4=I4,C4=R(P4);let Ws;const x4=new Uint8Array(16);function A4(){if(!Ws&&(Ws=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ws))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ws(x4)}const Ne=[];for(let i=0;i<256;++i)Ne.push((i+256).toString(16).slice(1));function D4(i,e=0){return Ne[i[e+0]]+Ne[i[e+1]]+Ne[i[e+2]]+Ne[i[e+3]]+"-"+Ne[i[e+4]]+Ne[i[e+5]]+"-"+Ne[i[e+6]]+Ne[i[e+7]]+"-"+Ne[i[e+8]]+Ne[i[e+9]]+"-"+Ne[i[e+10]]+Ne[i[e+11]]+Ne[i[e+12]]+Ne[i[e+13]]+Ne[i[e+14]]+Ne[i[e+15]]}const M4=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var Hg={randomUUID:M4};function k4(i,e,t){if(Hg.randomUUID&&!i)return Hg.randomUUID();i=i||{};const r=i.random||(i.rng||A4)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,D4(r)}function Wg(i){return typeof i=="string"||typeof i=="number"}var R4=function(){function i(e){el(this,i),Tr(this,"_queue",[]),Tr(this,"_timeout",null),Tr(this,"_extended",null),this.delay=null,this.max=1/0,this.setOptions(e)}return $l(i,[{key:"setOptions",value:function(t){t&&typeof t.delay<"u"&&(this.delay=t.delay),t&&typeof t.max<"u"&&(this.max=t.max),this._flushIfNeeded()}},{key:"destroy",value:function(){if(this.flush(),this._extended){for(var t=this._extended.object,r=this._extended.methods,n=0;n<r.length;n++){var o=r[n];o.original?t[o.name]=o.original:delete t[o.name]}this._extended=null}}},{key:"replace",value:function(t,r){var n=this,o=t[r];if(!o)throw new Error("Method "+r+" undefined");t[r]=function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];n.queue({args:a,fn:o,context:this})}}},{key:"queue",value:function(t){typeof t=="function"?this._queue.push({fn:t}):this._queue.push(t),this._flushIfNeeded()}},{key:"_flushIfNeeded",value:function(){var t=this;this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=lB(function(){t.flush()},this.delay))}},{key:"flush",value:function(){var t,r;li(t=j1(r=this._queue).call(r,0)).call(t,function(n){n.fn.apply(n.context||n.fn,n.args||[])})}}],[{key:"extend",value:function(t,r){var n=new i(r);if(t.flush!==void 0)throw new Error("Target object already has a property flush");t.flush=function(){n.flush()};var o=[{name:"flush",original:void 0}];if(r&&r.replace)for(var s=0;s<r.replace.length;s++){var a=r.replace[s];o.push({name:a,original:t[a]}),n.replace(t,a)}return n._extended={object:t,methods:o},n}}]),i}(),N4=function(){function i(){el(this,i),Tr(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),Tr(this,"subscribe",i.prototype.on),Tr(this,"unsubscribe",i.prototype.off)}return $l(i,[{key:"_trigger",value:function(t,r,n){var o,s;if(t==="*")throw new Error("Cannot trigger event *");li(o=Sl(s=[]).call(s,it(this._subscribers[t]),it(this._subscribers["*"]))).call(o,function(a){a(t,r,n??null)})}},{key:"on",value:function(t,r){typeof r=="function"&&this._subscribers[t].push(r)}},{key:"off",value:function(t,r){var n;this._subscribers[t]=Wi(n=this._subscribers[t]).call(n,function(o){return o!==r})}}]),i}(),F4=y0,B4=b0;F4("Set",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},B4);var L4=oe,j4=L4.Set,z4=j4,H4=z4,W4=H4,uh=R(W4),V4=zu,U4=V4,K4=U4,G4=K4,Y4=G4,q4=Y4,X4=q4,Z4=X4,J4=Z4,Q4=J4,fh=R(Q4);function Bt(i,e){var t=typeof _l<"u"&&Wu(i)||i["@@iterator"];if(!t){if(ut(i)||(t=eV(i))||e){t&&(i=t);var r=0,n=function(){};return{s:n,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(d){throw d},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
36
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){t=t.call(i)},n:function(){var d=t.next();return o=d.done,d},e:function(d){s=!0,a=d},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw a}}}}function eV(i,e){var t;if(i){if(typeof i=="string")return Vg(i,e);var r=Ol(t=Object.prototype.toString.call(i)).call(t,8,-1);if(r==="Object"&&i.constructor&&(r=i.constructor.name),r==="Map"||r==="Set")return Hu(i);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vg(i,e)}}function Vg(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}var Ug=function(i){function e(t){el(this,e),this._pairs=t}return $l(e,[{key:i,value:et.mark(function t(){var r,n,o,s,a;return et.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:r=Bt(this._pairs),d.prev=1,r.s();case 3:if((n=r.n()).done){d.next=9;break}return o=Qe(n.value,2),s=o[0],a=o[1],d.next=7,[s,a];case 7:d.next=3;break;case 9:d.next=14;break;case 11:d.prev=11,d.t0=d.catch(1),r.e(d.t0);case 14:return d.prev=14,r.f(),d.finish(14);case 17:case"end":return d.stop()}},t,this,[[1,11,14,17]])})},{key:"entries",value:et.mark(function t(){var r,n,o,s,a;return et.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:r=Bt(this._pairs),d.prev=1,r.s();case 3:if((n=r.n()).done){d.next=9;break}return o=Qe(n.value,2),s=o[0],a=o[1],d.next=7,[s,a];case 7:d.next=3;break;case 9:d.next=14;break;case 11:d.prev=11,d.t0=d.catch(1),r.e(d.t0);case 14:return d.prev=14,r.f(),d.finish(14);case 17:case"end":return d.stop()}},t,this,[[1,11,14,17]])})},{key:"keys",value:et.mark(function t(){var r,n,o,s;return et.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:r=Bt(this._pairs),l.prev=1,r.s();case 3:if((n=r.n()).done){l.next=9;break}return o=Qe(n.value,1),s=o[0],l.next=7,s;case 7:l.next=3;break;case 9:l.next=14;break;case 11:l.prev=11,l.t0=l.catch(1),r.e(l.t0);case 14:return l.prev=14,r.f(),l.finish(14);case 17:case"end":return l.stop()}},t,this,[[1,11,14,17]])})},{key:"values",value:et.mark(function t(){var r,n,o,s;return et.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:r=Bt(this._pairs),l.prev=1,r.s();case 3:if((n=r.n()).done){l.next=9;break}return o=Qe(n.value,2),s=o[1],l.next=7,s;case 7:l.next=3;break;case 9:l.next=14;break;case 11:l.prev=11,l.t0=l.catch(1),r.e(l.t0);case 14:return l.prev=14,r.f(),l.finish(14);case 17:case"end":return l.stop()}},t,this,[[1,11,14,17]])})},{key:"toIdArray",value:function(){var r;return Tt(r=it(this._pairs)).call(r,function(n){return n[0]})}},{key:"toItemArray",value:function(){var r;return Tt(r=it(this._pairs)).call(r,function(n){return n[1]})}},{key:"toEntryArray",value:function(){return it(this._pairs)}},{key:"toObjectMap",value:function(){var r=BF(null),n=Bt(this._pairs),o;try{for(n.s();!(o=n.n()).done;){var s=Qe(o.value,2),a=s[0],l=s[1];r[a]=l}}catch(d){n.e(d)}finally{n.f()}return r}},{key:"toMap",value:function(){return new $0(this._pairs)}},{key:"toIdSet",value:function(){return new uh(this.toIdArray())}},{key:"toItemSet",value:function(){return new uh(this.toItemArray())}},{key:"cache",value:function(){return new e(it(this._pairs))}},{key:"distinct",value:function(r){var n=new uh,o=Bt(this._pairs),s;try{for(o.s();!(s=o.n()).done;){var a=Qe(s.value,2),l=a[0],d=a[1];n.add(r(d,l))}}catch(h){o.e(h)}finally{o.f()}return n}},{key:"filter",value:function(r){var n=this._pairs;return new e({[Yi](){return et.mark(function o(){var s,a,l,d,h;return et.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:s=Bt(n),u.prev=1,s.s();case 3:if((a=s.n()).done){u.next=10;break}if(l=Qe(a.value,2),d=l[0],h=l[1],!r(h,d)){u.next=8;break}return u.next=8,[d,h];case 8:u.next=3;break;case 10:u.next=15;break;case 12:u.prev=12,u.t0=u.catch(1),s.e(u.t0);case 15:return u.prev=15,s.f(),u.finish(15);case 18:case"end":return u.stop()}},o,null,[[1,12,15,18]])})()}})}},{key:"forEach",value:function(r){var n=Bt(this._pairs),o;try{for(n.s();!(o=n.n()).done;){var s=Qe(o.value,2),a=s[0],l=s[1];r(l,a)}}catch(d){n.e(d)}finally{n.f()}}},{key:"map",value:function(r){var n=this._pairs;return new e({[Yi](){return et.mark(function o(){var s,a,l,d,h;return et.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:s=Bt(n),u.prev=1,s.s();case 3:if((a=s.n()).done){u.next=9;break}return l=Qe(a.value,2),d=l[0],h=l[1],u.next=7,[d,r(h,d)];case 7:u.next=3;break;case 9:u.next=14;break;case 11:u.prev=11,u.t0=u.catch(1),s.e(u.t0);case 14:return u.prev=14,s.f(),u.finish(14);case 17:case"end":return u.stop()}},o,null,[[1,11,14,17]])})()}})}},{key:"max",value:function(r){var n=fh(this._pairs),o=n.next();if(o.done)return null;for(var s=o.value[1],a=r(o.value[1],o.value[0]);!(o=n.next()).done;){var l=Qe(o.value,2),d=l[0],h=l[1],c=r(h,d);c>a&&(a=c,s=h)}return s}},{key:"min",value:function(r){var n=fh(this._pairs),o=n.next();if(o.done)return null;for(var s=o.value[1],a=r(o.value[1],o.value[0]);!(o=n.next()).done;){var l=Qe(o.value,2),d=l[0],h=l[1],c=r(h,d);c<a&&(a=c,s=h)}return s}},{key:"reduce",value:function(r,n){var o=Bt(this._pairs),s;try{for(o.s();!(s=o.n()).done;){var a=Qe(s.value,2),l=a[0],d=a[1];n=r(n,d,l)}}catch(h){o.e(h)}finally{o.f()}return n}},{key:"sort",value:function(r){var n=this;return new e({[Yi]:function(){var o;return fh(Kc(o=it(n._pairs)).call(o,function(s,a){var l=Qe(s,2),d=l[0],h=l[1],c=Qe(a,2),u=c[0],f=c[1];return r(h,f,d,u)}))}})}}]),e}(Yi);function Kg(i,e){var t=Uu(i);if(Gp){var r=Gp(i);e&&(r=Wi(r).call(r,function(n){return Aw(i,n).enumerable})),t.push.apply(t,r)}return t}function Gg(i){for(var e=1;e<arguments.length;e++){var t,r,n=arguments[e]!=null?arguments[e]:{};e%2?li(t=Kg(Object(n),!0)).call(t,function(o){Tr(i,o,n[o])}):Yp?JL(i,Yp(n)):li(r=Kg(Object(n))).call(r,function(o){ej(i,o,Aw(n,o))})}return i}function vh(i,e){var t=typeof _l<"u"&&Wu(i)||i["@@iterator"];if(!t){if(ut(i)||(t=tV(i))||e){t&&(i=t);var r=0,n=function(){};return{s:n,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(d){throw d},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
37
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){t=t.call(i)},n:function(){var d=t.next();return o=d.done,d},e:function(d){s=!0,a=d},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw a}}}}function tV(i,e){var t;if(i){if(typeof i=="string")return Yg(i,e);var r=Ol(t=Object.prototype.toString.call(i)).call(t,8,-1);if(r==="Object"&&i.constructor&&(r=i.constructor.name),r==="Map"||r==="Set")return Hu(i);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yg(i,e)}}function Yg(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}function rV(i){var e=iV();return function(){var r=Na(i),n;if(e){var o=Na(this).constructor;n=va(r,arguments,o)}else n=r.apply(this,arguments);return Ej(this,n)}}function iV(){if(typeof Reflect>"u"||!va||va.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(va(Boolean,[],function(){})),!0}catch{return!1}}function nV(i,e){return i[e]==null&&(i[e]=k4()),i}var ja=function(i){wj(t,i);var e=rV(t);function t(r,n){var o;return el(this,t),o=e.call(this),Tr(kw(o),"_queue",null),r&&!ut(r)&&(n=r,r=[]),o._options=n||{},o._data=new $0,o.length=0,o._idProp=o._options.fieldId||"id",r&&r.length&&o.add(r),o.setOptions(n),o}return $l(t,[{key:"idProp",get:function(){return this._idProp}},{key:"setOptions",value:function(n){n&&n.queue!==void 0&&(n.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=R4.extend(this,{replace:["add","update","remove"]})),n.queue&&typeof n.queue=="object"&&this._queue.setOptions(n.queue)))}},{key:"add",value:function(n,o){var s=this,a=[],l;if(ut(n)){var d=Tt(n).call(n,function(u){return u[s._idProp]});if(yW(d).call(d,function(u){return s._data.has(u)}))throw new Error("A duplicate id was found in the parameter array.");for(var h=0,c=n.length;h<c;h++)l=this._addItem(n[h]),a.push(l)}else if(n&&typeof n=="object")l=this._addItem(n),a.push(l);else throw new Error("Unknown dataType");return a.length&&this._trigger("add",{items:a},o),a}},{key:"update",value:function(n,o){var s=this,a=[],l=[],d=[],h=[],c=this._idProp,u=function(p){var m=p[c];if(m!=null&&s._data.has(m)){var $=p,E=$F({},s._data.get(m)),P=s._updateItem($);l.push(P),h.push($),d.push(E)}else{var D=s._addItem(p);a.push(D)}};if(ut(n))for(var f=0,v=n.length;f<v;f++)n[f]&&typeof n[f]=="object"?u(n[f]):console.warn("Ignoring input item, which is not an object at index "+f);else if(n&&typeof n=="object")u(n);else throw new Error("Unknown dataType");if(a.length&&this._trigger("add",{items:a},o),l.length){var y={items:l,oldData:d,data:h};this._trigger("update",y,o)}return Sl(a).call(a,l)}},{key:"updateOnly",value:function(n,o){var s,a=this;ut(n)||(n=[n]);var l=Tt(s=Tt(n).call(n,function(h){var c=a._data.get(h[a._idProp]);if(c==null)throw new Error("Updating non-existent items is not allowed.");return{oldData:c,update:h}})).call(s,function(h){var c=h.oldData,u=h.update,f=c[a._idProp],v=QB(c,u);return a._data.set(f,v),{id:f,oldData:c,updatedData:v}});if(l.length){var d={items:Tt(l).call(l,function(h){return h.id}),oldData:Tt(l).call(l,function(h){return h.oldData}),data:Tt(l).call(l,function(h){return h.updatedData})};return this._trigger("update",d,o),d.items}else return[]}},{key:"get",value:function(n,o){var s=void 0,a=void 0,l=void 0;Wg(n)?(s=n,l=o):ut(n)?(a=n,l=o):l=n;var d=l&&l.returnType==="Object"?"Object":"Array",h=l&&Wi(l),c=[],u=void 0,f=void 0,v=void 0;if(s!=null)u=this._data.get(s),u&&h&&!h(u)&&(u=void 0);else if(a!=null)for(var y=0,g=a.length;y<g;y++)u=this._data.get(a[y]),u!=null&&(!h||h(u))&&c.push(u);else{var p;f=it(ki(p=this._data).call(p));for(var m=0,$=f.length;m<$;m++)v=f[m],u=this._data.get(v),u!=null&&(!h||h(u))&&c.push(u)}if(l&&l.order&&s==null&&this._sort(c,l.order),l&&l.fields){var E=l.fields;if(s!=null&&u!=null)u=this._filterFields(u,E);else for(var P=0,D=c.length;P<D;P++)c[P]=this._filterFields(c[P],E)}if(d=="Object"){for(var L={},W=0,se=c.length;W<se;W++){var le=c[W],Ve=le[this._idProp];L[Ve]=le}return L}else if(s!=null){var ke;return(ke=u)!==null&&ke!==void 0?ke:null}else return c}},{key:"getIds",value:function(n){var o=this._data,s=n&&Wi(n),a=n&&n.order,l=it(ki(o).call(o)),d=[];if(s)if(a){for(var h=[],c=0,u=l.length;c<u;c++){var f=l[c],v=this._data.get(f);v!=null&&s(v)&&h.push(v)}this._sort(h,a);for(var y=0,g=h.length;y<g;y++)d.push(h[y][this._idProp])}else for(var p=0,m=l.length;p<m;p++){var $=l[p],E=this._data.get($);E!=null&&s(E)&&d.push(E[this._idProp])}else if(a){for(var P=[],D=0,L=l.length;D<L;D++){var W=l[D];P.push(o.get(W))}this._sort(P,a);for(var se=0,le=P.length;se<le;se++)d.push(P[se][this._idProp])}else for(var Ve=0,ke=l.length;Ve<ke;Ve++){var Re=l[Ve],ct=o.get(Re);ct!=null&&d.push(ct[this._idProp])}return d}},{key:"getDataSet",value:function(){return this}},{key:"forEach",value:function(n,o){var s=o&&Wi(o),a=this._data,l=it(ki(a).call(a));if(o&&o.order)for(var d=this.get(o),h=0,c=d.length;h<c;h++){var u=d[h],f=u[this._idProp];n(u,f)}else for(var v=0,y=l.length;v<y;v++){var g=l[v],p=this._data.get(g);p!=null&&(!s||s(p))&&n(p,g)}}},{key:"map",value:function(n,o){for(var s=o&&Wi(o),a=[],l=this._data,d=it(ki(l).call(l)),h=0,c=d.length;h<c;h++){var u=d[h],f=this._data.get(u);f!=null&&(!s||s(f))&&a.push(n(f,u))}return o&&o.order&&this._sort(a,o.order),a}},{key:"_filterFields",value:function(n,o){var s;return n&&NM(s=ut(o)?o:Uu(o)).call(s,function(a,l){return a[l]=n[l],a},{})}},{key:"_sort",value:function(n,o){if(typeof o=="string"){var s=o;Kc(n).call(n,function(a,l){var d=a[s],h=l[s];return d>h?1:d<h?-1:0})}else if(typeof o=="function")Kc(n).call(n,o);else throw new TypeError("Order must be a function or a string")}},{key:"remove",value:function(n,o){for(var s=[],a=[],l=ut(n)?n:[n],d=0,h=l.length;d<h;d++){var c=this._remove(l[d]);if(c){var u=c[this._idProp];u!=null&&(s.push(u),a.push(c))}}return s.length&&this._trigger("remove",{items:s,oldData:a},o),s}},{key:"_remove",value:function(n){var o;if(Wg(n)?o=n:n&&typeof n=="object"&&(o=n[this._idProp]),o!=null&&this._data.has(o)){var s=this._data.get(o)||null;return this._data.delete(o),--this.length,s}return null}},{key:"clear",value:function(n){for(var o,s=it(ki(o=this._data).call(o)),a=[],l=0,d=s.length;l<d;l++)a.push(this._data.get(s[l]));return this._data.clear(),this.length=0,this._trigger("remove",{items:s,oldData:a},n),s}},{key:"max",value:function(n){var o,s=null,a=null,l=vh(zg(o=this._data).call(o)),d;try{for(l.s();!(d=l.n()).done;){var h=d.value,c=h[n];typeof c=="number"&&(a==null||c>a)&&(s=h,a=c)}}catch(u){l.e(u)}finally{l.f()}return s||null}},{key:"min",value:function(n){var o,s=null,a=null,l=vh(zg(o=this._data).call(o)),d;try{for(l.s();!(d=l.n()).done;){var h=d.value,c=h[n];typeof c=="number"&&(a==null||c<a)&&(s=h,a=c)}}catch(u){l.e(u)}finally{l.f()}return s||null}},{key:"distinct",value:function(n){for(var o=this._data,s=it(ki(o).call(o)),a=[],l=0,d=0,h=s.length;d<h;d++){for(var c=s[d],u=o.get(c),f=u[n],v=!1,y=0;y<l;y++)if(a[y]==f){v=!0;break}!v&&f!==void 0&&(a[l]=f,l++)}return a}},{key:"_addItem",value:function(n){var o=nV(n,this._idProp),s=o[this._idProp];if(this._data.has(s))throw new Error("Cannot add item: item with id "+s+" already exists");return this._data.set(s,o),++this.length,s}},{key:"_updateItem",value:function(n){var o=n[this._idProp];if(o==null)throw new Error("Cannot update item: item has no id (item: "+VF(n)+")");var s=this._data.get(o);if(!s)throw new Error("Cannot update item: no item with id "+o+" found");return this._data.set(o,Gg(Gg({},s),n)),o}},{key:"stream",value:function(n){if(n){var o=this._data;return new Ug({[Yi](){return et.mark(function a(){var l,d,h,c;return et.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:l=vh(n),f.prev=1,l.s();case 3:if((d=l.n()).done){f.next=11;break}if(h=d.value,c=o.get(h),c==null){f.next=9;break}return f.next=9,[h,c];case 9:f.next=3;break;case 11:f.next=16;break;case 13:f.prev=13,f.t0=f.catch(1),l.e(f.t0);case 16:return f.prev=16,l.f(),f.finish(16);case 19:case"end":return f.stop()}},a,null,[[1,13,16,19]])})()}})}else{var s;return new Ug({[Yi]:m1(s=C4(this._data)).call(s,this._data)})}}}]),t}(N4);function oV(i,e){return typeof e=="object"&&e!==null&&i===e.idProp&&typeof e.add=="function"&&typeof e.clear=="function"&&typeof e.distinct=="function"&&typeof li(e)=="function"&&typeof e.get=="function"&&typeof e.getDataSet=="function"&&typeof e.getIds=="function"&&typeof e.length=="number"&&typeof Tt(e)=="function"&&typeof e.max=="function"&&typeof e.min=="function"&&typeof e.off=="function"&&typeof e.on=="function"&&typeof e.remove=="function"&&typeof e.setOptions=="function"&&typeof e.stream=="function"&&typeof e.update=="function"&&typeof e.updateOnly=="function"}function _0(i,e){return typeof e=="object"&&e!==null&&i===e.idProp&&typeof li(e)=="function"&&typeof e.get=="function"&&typeof e.getDataSet=="function"&&typeof e.getIds=="function"&&typeof e.length=="number"&&typeof Tt(e)=="function"&&typeof e.off=="function"&&typeof e.on=="function"&&typeof e.stream=="function"&&oV(i,e.getDataSet())}/**
38
+ * vis-network
39
+ * https://visjs.github.io/vis-network/
40
+ *
41
+ * A dynamic, browser-based visualization library.
42
+ *
43
+ * @version 9.1.13
44
+ * @date 2025-06-28T12:43:17.849Z
45
+ *
46
+ * @copyright (c) 2011-2017 Almende B.V, http://almende.com
47
+ * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
48
+ *
49
+ * @license
50
+ * vis.js is dual licensed under both
51
+ *
52
+ * 1. The Apache 2.0 License
53
+ * http://www.apache.org/licenses/LICENSE-2.0
54
+ *
55
+ * and
56
+ *
57
+ * 2. The MIT License
58
+ * http://opensource.org/licenses/MIT
59
+ *
60
+ * vis.js may be distributed under either license.
61
+ */var ph=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function B(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Vs=function(i){return i&&i.Math===Math&&i},ve=Vs(typeof globalThis=="object"&&globalThis)||Vs(typeof window=="object"&&window)||Vs(typeof self=="object"&&self)||Vs(typeof ph=="object"&&ph)||function(){return this}()||ph||Function("return this")(),U=function(i){try{return!!i()}catch{return!0}},sV=U,Yo=!sV(function(){var i=function(){}.bind();return typeof i!="function"||i.hasOwnProperty("prototype")}),aV=Yo,S0=Function.prototype,qg=S0.apply,Xg=S0.call,xl=typeof Reflect=="object"&&Reflect.apply||(aV?Xg.bind(qg):function(){return Xg.apply(qg,arguments)}),O0=Yo,T0=Function.prototype,Gc=T0.call,lV=O0&&T0.bind.bind(Gc,Gc),K=O0?lV:function(i){return function(){return Gc.apply(i,arguments)}},I0=K,dV=I0({}.toString),hV=I0("".slice),vr=function(i){return hV(dV(i),8,-1)},cV=vr,uV=K,hf=function(i){if(cV(i)==="Function")return uV(i)},Yc=typeof document=="object"&&document.all,fV=typeof Yc>"u"&&Yc!==void 0,P0={all:Yc,IS_HTMLDDA:fV},C0=P0,vV=C0.all,Le=C0.IS_HTMLDDA?function(i){return typeof i=="function"||i===vV}:function(i){return typeof i=="function"},qo={},pV=U,Ie=!pV(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),gV=Yo,Us=Function.prototype.call,Mt=gV?Us.bind(Us):function(){return Us.apply(Us,arguments)},Xo={},x0={}.propertyIsEnumerable,A0=Object.getOwnPropertyDescriptor,yV=A0&&!x0.call({1:2},1);Xo.f=yV?function(e){var t=A0(this,e);return!!t&&t.enumerable}:x0;var Zo=function(i,e){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:e}},mV=K,bV=U,$V=vr,gh=Object,wV=mV("".split),Al=bV(function(){return!gh("z").propertyIsEnumerable(0)})?function(i){return $V(i)==="String"?wV(i,""):gh(i)}:gh,Dn=function(i){return i==null},EV=Dn,_V=TypeError,Jo=function(i){if(EV(i))throw new _V("Can't call method on "+i);return i},SV=Al,OV=Jo,kt=function(i){return SV(OV(i))},Zg=Le,D0=P0,TV=D0.all,We=D0.IS_HTMLDDA?function(i){return typeof i=="object"?i!==null:Zg(i)||i===TV}:function(i){return typeof i=="object"?i!==null:Zg(i)},X={},yh=X,mh=ve,IV=Le,Jg=function(i){return IV(i)?i:void 0},Rt=function(i,e){return arguments.length<2?Jg(yh[i])||Jg(mh[i]):yh[i]&&yh[i][e]||mh[i]&&mh[i][e]},PV=K,Te=PV({}.isPrototypeOf),Qo=typeof navigator<"u"&&String(navigator.userAgent)||"",M0=ve,bh=Qo,Qg=M0.process,ey=M0.Deno,ty=Qg&&Qg.versions||ey&&ey.version,ry=ty&&ty.v8,It,za;ry&&(It=ry.split("."),za=It[0]>0&&It[0]<4?1:+(It[0]+It[1]));!za&&bh&&(It=bh.match(/Edge\/(\d+)/),(!It||It[1]>=74)&&(It=bh.match(/Chrome\/(\d+)/),It&&(za=+It[1])));var es=za,iy=es,CV=U,xV=ve,AV=xV.String,Mn=!!Object.getOwnPropertySymbols&&!CV(function(){var i=Symbol("symbol detection");return!AV(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&iy&&iy<41}),DV=Mn,k0=DV&&!Symbol.sham&&typeof Symbol.iterator=="symbol",MV=Rt,kV=Le,RV=Te,NV=k0,FV=Object,ts=NV?function(i){return typeof i=="symbol"}:function(i){var e=MV("Symbol");return kV(e)&&RV(e.prototype,FV(i))},BV=String,rs=function(i){try{return BV(i)}catch{return"Object"}},LV=Le,jV=rs,zV=TypeError,kn=function(i){if(LV(i))return i;throw new zV(jV(i)+" is not a function")},HV=kn,WV=Dn,cf=function(i,e){var t=i[e];return WV(t)?void 0:HV(t)},$h=Mt,wh=Le,Eh=We,VV=TypeError,UV=function(i,e){var t,r;if(e==="string"&&wh(t=i.toString)&&!Eh(r=$h(t,i))||wh(t=i.valueOf)&&!Eh(r=$h(t,i))||e!=="string"&&wh(t=i.toString)&&!Eh(r=$h(t,i)))return r;throw new VV("Can't convert object to primitive value")},R0={exports:{}},ny=ve,KV=Object.defineProperty,GV=function(i,e){try{KV(ny,i,{value:e,configurable:!0,writable:!0})}catch{ny[i]=e}return e},YV=ve,qV=GV,oy="__core-js_shared__",XV=YV[oy]||qV(oy,{}),uf=XV,sy=uf;(R0.exports=function(i,e){return sy[i]||(sy[i]=e!==void 0?e:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Rn=R0.exports,ZV=Jo,JV=Object,_t=function(i){return JV(ZV(i))},QV=K,e6=_t,t6=QV({}.hasOwnProperty),je=Object.hasOwn||function(e,t){return t6(e6(e),t)},r6=K,i6=0,n6=Math.random(),o6=r6(1 .toString),Dl=function(i){return"Symbol("+(i===void 0?"":i)+")_"+o6(++i6+n6,36)},s6=ve,a6=Rn,ay=je,l6=Dl,d6=Mn,h6=k0,qi=s6.Symbol,_h=a6("wks"),c6=h6?qi.for||qi:qi&&qi.withoutSetter||l6,me=function(i){return ay(_h,i)||(_h[i]=d6&&ay(qi,i)?qi[i]:c6("Symbol."+i)),_h[i]},u6=Mt,ly=We,dy=ts,f6=cf,v6=UV,p6=me,g6=TypeError,y6=p6("toPrimitive"),m6=function(i,e){if(!ly(i)||dy(i))return i;var t=f6(i,y6),r;if(t){if(e===void 0&&(e="default"),r=u6(t,i,e),!ly(r)||dy(r))return r;throw new g6("Can't convert object to primitive value")}return e===void 0&&(e="number"),v6(i,e)},b6=m6,$6=ts,Ml=function(i){var e=b6(i,"string");return $6(e)?e:e+""},w6=ve,hy=We,qc=w6.document,E6=hy(qc)&&hy(qc.createElement),N0=function(i){return E6?qc.createElement(i):{}},_6=Ie,S6=U,O6=N0,F0=!_6&&!S6(function(){return Object.defineProperty(O6("div"),"a",{get:function(){return 7}}).a!==7}),T6=Ie,I6=Mt,P6=Xo,C6=Zo,x6=kt,A6=Ml,D6=je,M6=F0,cy=Object.getOwnPropertyDescriptor;qo.f=T6?cy:function(e,t){if(e=x6(e),t=A6(t),M6)try{return cy(e,t)}catch{}if(D6(e,t))return C6(!I6(P6.f,e,t),e[t])};var k6=U,R6=Le,N6=/#|\.prototype\./,is=function(i,e){var t=B6[F6(i)];return t===j6?!0:t===L6?!1:R6(e)?k6(e):!!e},F6=is.normalize=function(i){return String(i).replace(N6,".").toLowerCase()},B6=is.data={},L6=is.NATIVE="N",j6=is.POLYFILL="P",z6=is,uy=hf,H6=kn,W6=Yo,V6=uy(uy.bind),kl=function(i,e){return H6(i),e===void 0?i:W6?V6(i,e):function(){return i.apply(e,arguments)}},gt={},U6=Ie,K6=U,B0=U6&&K6(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),G6=We,Y6=String,q6=TypeError,pr=function(i){if(G6(i))return i;throw new q6(Y6(i)+" is not an object")},X6=Ie,Z6=F0,J6=B0,Ks=pr,fy=Ml,Q6=TypeError,Sh=Object.defineProperty,eU=Object.getOwnPropertyDescriptor,Oh="enumerable",Th="configurable",Ih="writable";gt.f=X6?J6?function(e,t,r){if(Ks(e),t=fy(t),Ks(r),typeof e=="function"&&t==="prototype"&&"value"in r&&Ih in r&&!r[Ih]){var n=eU(e,t);n&&n[Ih]&&(e[t]=r.value,r={configurable:Th in r?r[Th]:n[Th],enumerable:Oh in r?r[Oh]:n[Oh],writable:!1})}return Sh(e,t,r)}:Sh:function(e,t,r){if(Ks(e),t=fy(t),Ks(r),Z6)try{return Sh(e,t,r)}catch{}if("get"in r||"set"in r)throw new Q6("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var tU=Ie,rU=gt,iU=Zo,Nn=tU?function(i,e,t){return rU.f(i,e,iU(1,t))}:function(i,e,t){return i[e]=t,i},Gs=ve,nU=xl,oU=hf,sU=Le,aU=qo.f,lU=z6,Ri=X,dU=kl,Ni=Nn,vy=je,hU=function(i){var e=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new i;case 1:return new i(t);case 2:return new i(t,r)}return new i(t,r,n)}return nU(i,this,arguments)};return e.prototype=i.prototype,e},N=function(i,e){var t=i.target,r=i.global,n=i.stat,o=i.proto,s=r?Gs:n?Gs[t]:(Gs[t]||{}).prototype,a=r?Ri:Ri[t]||Ni(Ri,t,{})[t],l=a.prototype,d,h,c,u,f,v,y,g,p;for(u in e)d=lU(r?u:t+(n?".":"#")+u,i.forced),h=!d&&s&&vy(s,u),v=a[u],h&&(i.dontCallGetSet?(p=aU(s,u),y=p&&p.value):y=s[u]),f=h&&y?y:e[u],!(h&&typeof v==typeof f)&&(i.bind&&h?g=dU(f,Gs):i.wrap&&h?g=hU(f):o&&sU(f)?g=oU(f):g=f,(i.sham||f&&f.sham||v&&v.sham)&&Ni(g,"sham",!0),Ni(a,u,g),o&&(c=t+"Prototype",vy(Ri,c)||Ni(Ri,c,{}),Ni(Ri[c],u,f),i.real&&l&&(d||!l[u])&&Ni(l,u,f)))},cU=Math.ceil,uU=Math.floor,fU=Math.trunc||function(e){var t=+e;return(t>0?uU:cU)(t)},vU=fU,Rl=function(i){var e=+i;return e!==e||e===0?0:vU(e)},pU=Rl,gU=Math.max,yU=Math.min,ns=function(i,e){var t=pU(i);return t<0?gU(t+e,0):yU(t,e)},mU=Rl,bU=Math.min,$U=function(i){return i>0?bU(mU(i),9007199254740991):0},wU=$U,Yt=function(i){return wU(i.length)},EU=kt,_U=ns,SU=Yt,py=function(i){return function(e,t,r){var n=EU(e),o=SU(n),s=_U(r,o),a;if(i&&t!==t){for(;o>s;)if(a=n[s++],a!==a)return!0}else for(;o>s;s++)if((i||s in n)&&n[s]===t)return i||s||0;return!i&&-1}},ff={includes:py(!0),indexOf:py(!1)},os={},OU=K,Ph=je,TU=kt,IU=ff.indexOf,PU=os,gy=OU([].push),L0=function(i,e){var t=TU(i),r=0,n=[],o;for(o in t)!Ph(PU,o)&&Ph(t,o)&&gy(n,o);for(;e.length>r;)Ph(t,o=e[r++])&&(~IU(n,o)||gy(n,o));return n},vf=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],CU=L0,xU=vf,ss=Object.keys||function(e){return CU(e,xU)},as={};as.f=Object.getOwnPropertySymbols;var yy=Ie,AU=K,DU=Mt,MU=U,Ch=ss,kU=as,RU=Xo,NU=_t,FU=Al,Fi=Object.assign,my=Object.defineProperty,BU=AU([].concat),LU=!Fi||MU(function(){if(yy&&Fi({b:1},Fi(my({},"a",{enumerable:!0,get:function(){my(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var i={},e={},t=Symbol("assign detection"),r="abcdefghijklmnopqrst";return i[t]=7,r.split("").forEach(function(n){e[n]=n}),Fi({},i)[t]!==7||Ch(Fi({},e)).join("")!==r})?function(e,t){for(var r=NU(e),n=arguments.length,o=1,s=kU.f,a=RU.f;n>o;)for(var l=FU(arguments[o++]),d=s?BU(Ch(l),s(l)):Ch(l),h=d.length,c=0,u;h>c;)u=d[c++],(!yy||DU(a,l,u))&&(r[u]=l[u]);return r}:Fi,jU=N,by=LU;jU({target:"Object",stat:!0,forced:Object.assign!==by},{assign:by});var zU=X,HU=zU.Object.assign,WU=HU,VU=WU,UU=VU,Ee=B(UU),KU=K,Nl=KU([].slice),j0=K,GU=kn,YU=We,qU=je,$y=Nl,XU=Yo,z0=Function,ZU=j0([].concat),JU=j0([].join),xh={},QU=function(i,e,t){if(!qU(xh,e)){for(var r=[],n=0;n<e;n++)r[n]="a["+n+"]";xh[e]=z0("C,a","return new C("+JU(r,",")+")")}return xh[e](i,t)},e8=XU?z0.bind:function(e){var t=GU(this),r=t.prototype,n=$y(arguments,1),o=function(){var a=ZU(n,$y(arguments));return this instanceof o?QU(t,a.length,a):t.apply(e,a)};return YU(r)&&(o.prototype=r),o},t8=N,wy=e8;t8({target:"Function",proto:!0,forced:Function.bind!==wy},{bind:wy});var r8=X,ze=function(i){return r8[i+"Prototype"]},i8=ze,n8=i8("Function").bind,o8=Te,s8=n8,Ah=Function.prototype,a8=function(i){var e=i.bind;return i===Ah||o8(Ah,i)&&e===Ah.bind?s8:e},l8=a8,d8=l8,h8=d8,_=B(h8);function pf(i,e,t,r){i.beginPath(),i.arc(e,t,r,0,2*Math.PI,!1),i.closePath()}function c8(i,e,t,r){i.beginPath(),i.rect(e-r,t-r,r*2,r*2),i.closePath()}function u8(i,e,t,r){i.beginPath(),r*=1.15,t+=.275*r;const n=r*2,o=n/2,s=Math.sqrt(3)/6*n,a=Math.sqrt(n*n-o*o);i.moveTo(e,t-(a-s)),i.lineTo(e+o,t+s),i.lineTo(e-o,t+s),i.lineTo(e,t-(a-s)),i.closePath()}function f8(i,e,t,r){i.beginPath(),r*=1.15,t-=.275*r;const n=r*2,o=n/2,s=Math.sqrt(3)/6*n,a=Math.sqrt(n*n-o*o);i.moveTo(e,t+(a-s)),i.lineTo(e+o,t-s),i.lineTo(e-o,t-s),i.lineTo(e,t+(a-s)),i.closePath()}function v8(i,e,t,r){i.beginPath(),r*=.82,t+=.1*r;for(let n=0;n<10;n++){const o=n%2===0?r*1.3:r*.5;i.lineTo(e+o*Math.sin(n*2*Math.PI/10),t-o*Math.cos(n*2*Math.PI/10))}i.closePath()}function p8(i,e,t,r){i.beginPath(),i.lineTo(e,t+r),i.lineTo(e+r,t),i.lineTo(e,t-r),i.lineTo(e-r,t),i.closePath()}function H0(i,e,t,r,n,o){const s=Math.PI/180;r-2*o<0&&(o=r/2),n-2*o<0&&(o=n/2),i.beginPath(),i.moveTo(e+o,t),i.lineTo(e+r-o,t),i.arc(e+r-o,t+o,o,s*270,s*360,!1),i.lineTo(e+r,t+n-o),i.arc(e+r-o,t+n-o,o,0,s*90,!1),i.lineTo(e+o,t+n),i.arc(e+o,t+n-o,o,s*90,s*180,!1),i.lineTo(e,t+o),i.arc(e+o,t+o,o,s*180,s*270,!1),i.closePath()}function Xc(i,e,t,r,n){const o=.5522848,s=r/2*o,a=n/2*o,l=e+r,d=t+n,h=e+r/2,c=t+n/2;i.beginPath(),i.moveTo(e,c),i.bezierCurveTo(e,c-a,h-s,t,h,t),i.bezierCurveTo(h+s,t,l,c-a,l,c),i.bezierCurveTo(l,c+a,h+s,d,h,d),i.bezierCurveTo(h-s,d,e,c+a,e,c),i.closePath()}function W0(i,e,t,r,n){const o=.3333333333333333,s=r,a=n*o,l=.5522848,d=s/2*l,h=a/2*l,c=e+s,u=t+a,f=e+s/2,v=t+a/2,y=t+(n-a/2),g=t+n;i.beginPath(),i.moveTo(c,v),i.bezierCurveTo(c,v+h,f+d,u,f,u),i.bezierCurveTo(f-d,u,e,v+h,e,v),i.bezierCurveTo(e,v-h,f-d,t,f,t),i.bezierCurveTo(f+d,t,c,v-h,c,v),i.lineTo(c,y),i.bezierCurveTo(c,y+h,f+d,g,f,g),i.bezierCurveTo(f-d,g,e,y+h,e,y),i.lineTo(e,v)}function V0(i,e,t,r,n,o){i.beginPath(),i.moveTo(e,t);const s=o.length,a=r-e,l=n-t,d=l/a;let h=Math.sqrt(a*a+l*l),c=0,u=!0,f=0,v=+o[0];for(;h>=.1;)v=+o[c++%s],v>h&&(v=h),f=Math.sqrt(v*v/(1+d*d)),f=a<0?-f:f,e+=f,t+=d*f,u===!0?i.lineTo(e,t):i.moveTo(e,t),h-=v,u=!u}function g8(i,e,t,r){i.beginPath();const n=6,o=Math.PI*2/n;i.moveTo(e+r,t);for(let s=1;s<n;s++)i.lineTo(e+r*Math.cos(o*s),t+r*Math.sin(o*s));i.closePath()}const Ey={circle:pf,dashedLine:V0,database:W0,diamond:p8,ellipse:Xc,ellipse_vis:Xc,hexagon:g8,roundRect:H0,square:c8,star:v8,triangle:u8,triangleDown:f8};function y8(i){return Object.prototype.hasOwnProperty.call(Ey,i)?Ey[i]:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];CanvasRenderingContext2D.prototype[i].call(e,r)}}var U0={exports:{}};(function(i){i.exports=e;function e(r){if(r)return t(r)}function t(r){for(var n in e.prototype)r[n]=e.prototype[n];return r}e.prototype.on=e.prototype.addEventListener=function(r,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(n),this},e.prototype.once=function(r,n){function o(){this.off(r,o),n.apply(this,arguments)}return o.fn=n,this.on(r,o),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(r,n){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var o=this._callbacks["$"+r];if(!o)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var s,a=0;a<o.length;a++)if(s=o[a],s===n||s.fn===n){o.splice(a,1);break}return o.length===0&&delete this._callbacks["$"+r],this},e.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var n=new Array(arguments.length-1),o=this._callbacks["$"+r],s=1;s<arguments.length;s++)n[s-1]=arguments[s];if(o){o=o.slice(0);for(var s=0,a=o.length;s<a;++s)o[s].apply(this,n)}return this},e.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]},e.prototype.hasListeners=function(r){return!!this.listeners(r).length}})(U0);var m8=U0.exports,K0=B(m8),b8=vr,Si=Array.isArray||function(e){return b8(e)==="Array"},$8=TypeError,w8=9007199254740991,G0=function(i){if(i>w8)throw $8("Maximum allowed index exceeded");return i},E8=Ml,_8=gt,S8=Zo,ls=function(i,e,t){var r=E8(e);r in i?_8.f(i,r,S8(0,t)):i[r]=t},O8=me,T8=O8("toStringTag"),Y0={};Y0[T8]="z";var gf=String(Y0)==="[object z]",I8=gf,P8=Le,ma=vr,C8=me,x8=C8("toStringTag"),A8=Object,D8=ma(function(){return arguments}())==="Arguments",M8=function(i,e){try{return i[e]}catch{}},Oi=I8?ma:function(i){var e,t,r;return i===void 0?"Undefined":i===null?"Null":typeof(t=M8(e=A8(i),x8))=="string"?t:D8?ma(e):(r=ma(e))==="Object"&&P8(e.callee)?"Arguments":r},k8=K,R8=Le,Zc=uf,N8=k8(Function.toString);R8(Zc.inspectSource)||(Zc.inspectSource=function(i){return N8(i)});var F8=Zc.inspectSource,B8=K,L8=U,q0=Le,j8=Oi,z8=Rt,H8=F8,X0=function(){},W8=[],Z0=z8("Reflect","construct"),yf=/^\s*(?:class|function)\b/,V8=B8(yf.exec),U8=!yf.test(X0),Vn=function(e){if(!q0(e))return!1;try{return Z0(X0,W8,e),!0}catch{return!1}},J0=function(e){if(!q0(e))return!1;switch(j8(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return U8||!!V8(yf,H8(e))}catch{return!0}};J0.sham=!0;var Q0=!Z0||L8(function(){var i;return Vn(Vn.call)||!Vn(Object)||!Vn(function(){i=!0})||i})?J0:Vn,_y=Si,K8=Q0,G8=We,Y8=me,q8=Y8("species"),Sy=Array,X8=function(i){var e;return _y(i)&&(e=i.constructor,K8(e)&&(e===Sy||_y(e.prototype))?e=void 0:G8(e)&&(e=e[q8],e===null&&(e=void 0))),e===void 0?Sy:e},Z8=X8,mf=function(i,e){return new(Z8(i))(e===0?0:e)},J8=U,Q8=me,e9=es,t9=Q8("species"),ds=function(i){return e9>=51||!J8(function(){var e=[],t=e.constructor={};return t[t9]=function(){return{foo:1}},e[i](Boolean).foo!==1})},r9=N,i9=U,n9=Si,o9=We,s9=_t,a9=Yt,Oy=G0,Ty=ls,l9=mf,d9=ds,h9=me,c9=es,eE=h9("isConcatSpreadable"),u9=c9>=51||!i9(function(){var i=[];return i[eE]=!1,i.concat()[0]!==i}),f9=function(i){if(!o9(i))return!1;var e=i[eE];return e!==void 0?!!e:n9(i)},v9=!u9||!d9("concat");r9({target:"Array",proto:!0,forced:v9},{concat:function(e){var t=s9(this),r=l9(t,0),n=0,o,s,a,l,d;for(o=-1,a=arguments.length;o<a;o++)if(d=o===-1?t:arguments[o],f9(d))for(l=a9(d),Oy(n+l),s=0;s<l;s++,n++)s in d&&Ty(r,n,d[s]);else Oy(n+1),Ty(r,n++,d);return r.length=n,r}});var p9=Oi,g9=String,qt=function(i){if(p9(i)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return g9(i)},Fl={},y9=Ie,m9=B0,b9=gt,$9=pr,w9=kt,E9=ss;Fl.f=y9&&!m9?Object.defineProperties:function(e,t){$9(e);for(var r=w9(t),n=E9(t),o=n.length,s=0,a;o>s;)b9.f(e,a=n[s++],r[a]);return e};var _9=Rt,S9=_9("document","documentElement"),O9=Rn,T9=Dl,Iy=O9("keys"),Bl=function(i){return Iy[i]||(Iy[i]=T9(i))},I9=pr,P9=Fl,Py=vf,C9=os,x9=S9,A9=N0,D9=Bl,Cy=">",xy="<",Jc="prototype",Qc="script",tE=D9("IE_PROTO"),Dh=function(){},rE=function(i){return xy+Qc+Cy+i+xy+"/"+Qc+Cy},Ay=function(i){i.write(rE("")),i.close();var e=i.parentWindow.Object;return i=null,e},M9=function(){var i=A9("iframe"),e="java"+Qc+":",t;return i.style.display="none",x9.appendChild(i),i.src=String(e),t=i.contentWindow.document,t.open(),t.write(rE("document.F=Object")),t.close(),t.F},Ys,ba=function(){try{Ys=new ActiveXObject("htmlfile")}catch{}ba=typeof document<"u"?document.domain&&Ys?Ay(Ys):M9():Ay(Ys);for(var i=Py.length;i--;)delete ba[Jc][Py[i]];return ba()};C9[tE]=!0;var hs=Object.create||function(e,t){var r;return e!==null?(Dh[Jc]=I9(e),r=new Dh,Dh[Jc]=null,r[tE]=e):r=ba(),t===void 0?r:P9.f(r,t)},cs={},k9=L0,R9=vf,N9=R9.concat("length","prototype");cs.f=Object.getOwnPropertyNames||function(e){return k9(e,N9)};var Ll={},Dy=ns,F9=Yt,B9=ls,L9=Array,j9=Math.max,iE=function(i,e,t){for(var r=F9(i),n=Dy(e,r),o=Dy(t===void 0?r:t,r),s=L9(j9(o-n,0)),a=0;n<o;n++,a++)B9(s,a,i[n]);return s.length=a,s},z9=vr,H9=kt,nE=cs.f,W9=iE,oE=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],V9=function(i){try{return nE(i)}catch{return W9(oE)}};Ll.f=function(e){return oE&&z9(e)==="Window"?V9(e):nE(H9(e))};var U9=Nn,us=function(i,e,t,r){return r&&r.enumerable?i[e]=t:U9(i,e,t),i},K9=gt,bf=function(i,e,t){return K9.f(i,e,t)},fs={},G9=me;fs.f=G9;var My=X,Y9=je,q9=fs,X9=gt.f,pe=function(i){var e=My.Symbol||(My.Symbol={});Y9(e,i)||X9(e,i,{value:q9.f(i)})},Z9=Mt,J9=Rt,Q9=me,eK=us,sE=function(){var i=J9("Symbol"),e=i&&i.prototype,t=e&&e.valueOf,r=Q9("toPrimitive");e&&!e[r]&&eK(e,r,function(n){return Z9(t,this)},{})},tK=gf,rK=Oi,iK=tK?{}.toString:function(){return"[object "+rK(this)+"]"},nK=gf,oK=gt.f,sK=Nn,aK=je,lK=iK,dK=me,ky=dK("toStringTag"),Fn=function(i,e,t,r){if(i){var n=t?i:i.prototype;aK(n,ky)||oK(n,ky,{configurable:!0,value:e}),r&&!nK&&sK(n,"toString",lK)}},hK=ve,cK=Le,Ry=hK.WeakMap,aE=cK(Ry)&&/native code/.test(String(Ry)),uK=aE,lE=ve,fK=We,vK=Nn,Mh=je,kh=uf,pK=Bl,gK=os,Ny="Object already initialized",eu=lE.TypeError,yK=lE.WeakMap,Ha,bo,Wa,mK=function(i){return Wa(i)?bo(i):Ha(i,{})},bK=function(i){return function(e){var t;if(!fK(e)||(t=bo(e)).type!==i)throw new eu("Incompatible receiver, "+i+" required");return t}};if(uK||kh.state){var Lt=kh.state||(kh.state=new yK);Lt.get=Lt.get,Lt.has=Lt.has,Lt.set=Lt.set,Ha=function(i,e){if(Lt.has(i))throw new eu(Ny);return e.facade=i,Lt.set(i,e),e},bo=function(i){return Lt.get(i)||{}},Wa=function(i){return Lt.has(i)}}else{var Bi=pK("state");gK[Bi]=!0,Ha=function(i,e){if(Mh(i,Bi))throw new eu(Ny);return e.facade=i,vK(i,Bi,e),e},bo=function(i){return Mh(i,Bi)?i[Bi]:{}},Wa=function(i){return Mh(i,Bi)}}var Ti={set:Ha,get:bo,has:Wa,enforce:mK,getterFor:bK},$K=kl,wK=K,EK=Al,_K=_t,SK=Yt,OK=mf,Fy=wK([].push),Gr=function(i){var e=i===1,t=i===2,r=i===3,n=i===4,o=i===6,s=i===7,a=i===5||o;return function(l,d,h,c){for(var u=_K(l),f=EK(u),v=$K(d,h),y=SK(f),g=0,p=c||OK,m=e?p(l,y):t||s?p(l,0):void 0,$,E;y>g;g++)if((a||g in f)&&($=f[g],E=v($,g,u),i))if(e)m[g]=E;else if(E)switch(i){case 3:return!0;case 5:return $;case 6:return g;case 2:Fy(m,$)}else switch(i){case 4:return!1;case 7:Fy(m,$)}return o?-1:r||n?n:m}},zr={forEach:Gr(0),map:Gr(1),filter:Gr(2),some:Gr(3),every:Gr(4),find:Gr(5),findIndex:Gr(6)},jl=N,zl=ve,$f=Mt,TK=K,cn=Ie,un=Mn,IK=U,Ae=je,PK=Te,tu=pr,Hl=kt,wf=Ml,CK=qt,ru=Zo,$o=hs,dE=ss,xK=cs,hE=Ll,AK=as,cE=qo,uE=gt,DK=Fl,fE=Xo,By=us,MK=bf,Ef=Rn,kK=Bl,vE=os,Ly=Dl,RK=me,NK=fs,FK=pe,BK=sE,LK=Fn,pE=Ti,Wl=zr.forEach,nt=kK("hidden"),Vl="Symbol",wo="prototype",jK=pE.set,jy=pE.getterFor(Vl),xt=Object[wo],ri=zl.Symbol,Xn=ri&&ri[wo],zK=zl.RangeError,HK=zl.TypeError,Rh=zl.QObject,gE=cE.f,ii=uE.f,yE=hE.f,WK=fE.f,mE=TK([].push),hr=Ef("symbols"),vs=Ef("op-symbols"),VK=Ef("wks"),iu=!Rh||!Rh[wo]||!Rh[wo].findChild,bE=function(i,e,t){var r=gE(xt,e);r&&delete xt[e],ii(i,e,t),r&&i!==xt&&ii(xt,e,r)},nu=cn&&IK(function(){return $o(ii({},"a",{get:function(){return ii(this,"a",{value:7}).a}})).a!==7})?bE:ii,Nh=function(i,e){var t=hr[i]=$o(Xn);return jK(t,{type:Vl,tag:i,description:e}),cn||(t.description=e),t},Ul=function(e,t,r){e===xt&&Ul(vs,t,r),tu(e);var n=wf(t);return tu(r),Ae(hr,n)?(r.enumerable?(Ae(e,nt)&&e[nt][n]&&(e[nt][n]=!1),r=$o(r,{enumerable:ru(0,!1)})):(Ae(e,nt)||ii(e,nt,ru(1,{})),e[nt][n]=!0),nu(e,n,r)):ii(e,n,r)},_f=function(e,t){tu(e);var r=Hl(t),n=dE(r).concat(_E(r));return Wl(n,function(o){(!cn||$f($E,r,o))&&Ul(e,o,r[o])}),e},UK=function(e,t){return t===void 0?$o(e):_f($o(e),t)},$E=function(e){var t=wf(e),r=$f(WK,this,t);return this===xt&&Ae(hr,t)&&!Ae(vs,t)?!1:r||!Ae(this,t)||!Ae(hr,t)||Ae(this,nt)&&this[nt][t]?r:!0},wE=function(e,t){var r=Hl(e),n=wf(t);if(!(r===xt&&Ae(hr,n)&&!Ae(vs,n))){var o=gE(r,n);return o&&Ae(hr,n)&&!(Ae(r,nt)&&r[nt][n])&&(o.enumerable=!0),o}},EE=function(e){var t=yE(Hl(e)),r=[];return Wl(t,function(n){!Ae(hr,n)&&!Ae(vE,n)&&mE(r,n)}),r},_E=function(i){var e=i===xt,t=yE(e?vs:Hl(i)),r=[];return Wl(t,function(n){Ae(hr,n)&&(!e||Ae(xt,n))&&mE(r,hr[n])}),r};un||(ri=function(){if(PK(Xn,this))throw new HK("Symbol is not a constructor");var e=!arguments.length||arguments[0]===void 0?void 0:CK(arguments[0]),t=Ly(e),r=function(n){this===xt&&$f(r,vs,n),Ae(this,nt)&&Ae(this[nt],t)&&(this[nt][t]=!1);var o=ru(1,n);try{nu(this,t,o)}catch(s){if(!(s instanceof zK))throw s;bE(this,t,o)}};return cn&&iu&&nu(xt,t,{configurable:!0,set:r}),Nh(t,e)},Xn=ri[wo],By(Xn,"toString",function(){return jy(this).tag}),By(ri,"withoutSetter",function(i){return Nh(Ly(i),i)}),fE.f=$E,uE.f=Ul,DK.f=_f,cE.f=wE,xK.f=hE.f=EE,AK.f=_E,NK.f=function(i){return Nh(RK(i),i)},cn&&MK(Xn,"description",{configurable:!0,get:function(){return jy(this).description}}));jl({global:!0,wrap:!0,forced:!un,sham:!un},{Symbol:ri});Wl(dE(VK),function(i){FK(i)});jl({target:Vl,stat:!0,forced:!un},{useSetter:function(){iu=!0},useSimple:function(){iu=!1}});jl({target:"Object",stat:!0,forced:!un,sham:!cn},{create:UK,defineProperty:Ul,defineProperties:_f,getOwnPropertyDescriptor:wE});jl({target:"Object",stat:!0,forced:!un},{getOwnPropertyNames:EE});BK();LK(ri,Vl);vE[nt]=!0;var KK=Mn,SE=KK&&!!Symbol.for&&!!Symbol.keyFor,GK=N,YK=Rt,qK=je,XK=qt,OE=Rn,ZK=SE,Fh=OE("string-to-symbol-registry"),JK=OE("symbol-to-string-registry");GK({target:"Symbol",stat:!0,forced:!ZK},{for:function(i){var e=XK(i);if(qK(Fh,e))return Fh[e];var t=YK("Symbol")(e);return Fh[e]=t,JK[t]=e,t}});var QK=N,eG=je,tG=ts,rG=rs,iG=Rn,nG=SE,zy=iG("symbol-to-string-registry");QK({target:"Symbol",stat:!0,forced:!nG},{keyFor:function(e){if(!tG(e))throw new TypeError(rG(e)+" is not a symbol");if(eG(zy,e))return zy[e]}});var oG=K,Hy=Si,sG=Le,Wy=vr,aG=qt,Vy=oG([].push),lG=function(i){if(sG(i))return i;if(Hy(i)){for(var e=i.length,t=[],r=0;r<e;r++){var n=i[r];typeof n=="string"?Vy(t,n):(typeof n=="number"||Wy(n)==="Number"||Wy(n)==="String")&&Vy(t,aG(n))}var o=t.length,s=!0;return function(a,l){if(s)return s=!1,l;if(Hy(this))return l;for(var d=0;d<o;d++)if(t[d]===a)return l}}},dG=N,TE=Rt,IE=xl,hG=Mt,ps=K,PE=U,Uy=Le,Ky=ts,CE=Nl,cG=lG,uG=Mn,fG=String,Pr=TE("JSON","stringify"),qs=ps(/./.exec),Gy=ps("".charAt),vG=ps("".charCodeAt),pG=ps("".replace),gG=ps(1 .toString),yG=/[\uD800-\uDFFF]/g,Yy=/^[\uD800-\uDBFF]$/,qy=/^[\uDC00-\uDFFF]$/,Xy=!uG||PE(function(){var i=TE("Symbol")("stringify detection");return Pr([i])!=="[null]"||Pr({a:i})!=="{}"||Pr(Object(i))!=="{}"}),Zy=PE(function(){return Pr("\uDF06\uD834")!=='"\\udf06\\ud834"'||Pr("\uDEAD")!=='"\\udead"'}),mG=function(i,e){var t=CE(arguments),r=cG(e);if(!(!Uy(r)&&(i===void 0||Ky(i))))return t[1]=function(n,o){if(Uy(r)&&(o=hG(r,this,fG(n),o)),!Ky(o))return o},IE(Pr,null,t)},bG=function(i,e,t){var r=Gy(t,e-1),n=Gy(t,e+1);return qs(Yy,i)&&!qs(qy,n)||qs(qy,i)&&!qs(Yy,r)?"\\u"+gG(vG(i,0),16):i};Pr&&dG({target:"JSON",stat:!0,forced:Xy||Zy},{stringify:function(e,t,r){var n=CE(arguments),o=IE(Xy?mG:Pr,null,n);return Zy&&typeof o=="string"?pG(o,yG,bG):o}});var $G=N,wG=Mn,EG=U,xE=as,_G=_t,SG=!wG||EG(function(){xE.f(1)});$G({target:"Object",stat:!0,forced:SG},{getOwnPropertySymbols:function(e){var t=xE.f;return t?t(_G(e)):[]}});var OG=pe;OG("asyncIterator");var TG=pe;TG("hasInstance");var IG=pe;IG("isConcatSpreadable");var PG=pe;PG("iterator");var CG=pe;CG("match");var xG=pe;xG("matchAll");var AG=pe;AG("replace");var DG=pe;DG("search");var MG=pe;MG("species");var kG=pe;kG("split");var RG=pe,NG=sE;RG("toPrimitive");NG();var FG=Rt,BG=pe,LG=Fn;BG("toStringTag");LG(FG("Symbol"),"Symbol");var jG=pe;jG("unscopables");var zG=ve,HG=Fn;HG(zG.JSON,"JSON",!0);var WG=X,VG=WG.Symbol,Bn={},ou=Ie,UG=je,AE=Function.prototype,KG=ou&&Object.getOwnPropertyDescriptor,DE=UG(AE,"name"),GG=DE&&function(){}.name==="something";DE&&(!ou||ou&&KG(AE,"name").configurable);var YG={PROPER:GG},qG=U,ME=!qG(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype}),XG=je,ZG=Le,JG=_t,QG=Bl,e7=ME,Jy=QG("IE_PROTO"),su=Object,t7=su.prototype,Kl=e7?su.getPrototypeOf:function(i){var e=JG(i);if(XG(e,Jy))return e[Jy];var t=e.constructor;return ZG(t)&&e instanceof t?t.prototype:e instanceof su?t7:null},r7=U,i7=Le,n7=We,o7=hs,Qy=Kl,s7=us,a7=me,au=a7("iterator"),kE=!1,rr,Bh,Lh;[].keys&&(Lh=[].keys(),"next"in Lh?(Bh=Qy(Qy(Lh)),Bh!==Object.prototype&&(rr=Bh)):kE=!0);var l7=!n7(rr)||r7(function(){var i={};return rr[au].call(i)!==i});l7?rr={}:rr=o7(rr);i7(rr[au])||s7(rr,au,function(){return this});var RE={IteratorPrototype:rr,BUGGY_SAFARI_ITERATORS:kE},d7=RE.IteratorPrototype,h7=hs,c7=Zo,u7=Fn,f7=Bn,v7=function(){return this},p7=function(i,e,t,r){var n=e+" Iterator";return i.prototype=h7(d7,{next:c7(+!r,t)}),u7(i,n,!1,!0),f7[n]=v7,i},g7=N,y7=Mt,m7=YG,b7=p7,$7=Kl,w7=Fn,em=us,E7=me,tm=Bn,_7=RE,S7=m7.PROPER,Xs=_7.BUGGY_SAFARI_ITERATORS,jh=E7("iterator"),rm="keys",Zs="values",im="entries",O7=function(){return this},Sf=function(i,e,t,r,n,o,s){b7(t,e,r);var a=function(p){if(p===n&&u)return u;if(!Xs&&p&&p in h)return h[p];switch(p){case rm:return function(){return new t(this,p)};case Zs:return function(){return new t(this,p)};case im:return function(){return new t(this,p)}}return function(){return new t(this)}},l=e+" Iterator",d=!1,h=i.prototype,c=h[jh]||h["@@iterator"]||n&&h[n],u=!Xs&&c||a(n),f=e==="Array"&&h.entries||c,v,y,g;if(f&&(v=$7(f.call(new i)),v!==Object.prototype&&v.next&&(w7(v,l,!0,!0),tm[l]=O7)),S7&&n===Zs&&c&&c.name!==Zs&&(d=!0,u=function(){return y7(c,this)}),n)if(y={values:a(Zs),keys:o?u:a(rm),entries:a(im)},s)for(g in y)(Xs||d||!(g in h))&&em(h,g,y[g]);else g7({target:e,proto:!0,forced:Xs||d},y);return s&&h[jh]!==u&&em(h,jh,u,{}),tm[e]=u,y},Of=function(i,e){return{value:i,done:e}},T7=kt,nm=Bn,NE=Ti;gt.f;var I7=Sf,Js=Of,FE="Array Iterator",P7=NE.set,C7=NE.getterFor(FE);I7(Array,"Array",function(i,e){P7(this,{type:FE,target:T7(i),index:0,kind:e})},function(){var i=C7(this),e=i.target,t=i.kind,r=i.index++;if(!e||r>=e.length)return i.target=void 0,Js(void 0,!0);switch(t){case"keys":return Js(r,!1);case"values":return Js(e[r],!1)}return Js([r,e[r]],!1)},"values");nm.Arguments=nm.Array;var x7={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},A7=x7,D7=ve,M7=Oi,k7=Nn,om=Bn,R7=me,sm=R7("toStringTag");for(var zh in A7){var am=D7[zh],Hh=am&&am.prototype;Hh&&M7(Hh)!==sm&&k7(Hh,sm,zh),om[zh]=om.Array}var N7=VG,BE=N7,F7=BE,B7=B(F7),L7=N,lm=Si,j7=Q0,z7=We,dm=ns,H7=Yt,W7=kt,V7=ls,U7=me,K7=ds,G7=Nl,Y7=K7("slice"),q7=U7("species"),Wh=Array,X7=Math.max;L7({target:"Array",proto:!0,forced:!Y7},{slice:function(e,t){var r=W7(this),n=H7(r),o=dm(e,n),s=dm(t===void 0?n:t,n),a,l,d;if(lm(r)&&(a=r.constructor,j7(a)&&(a===Wh||lm(a.prototype))?a=void 0:z7(a)&&(a=a[q7],a===null&&(a=void 0)),a===Wh||a===void 0))return G7(r,o,s);for(l=new(a===void 0?Wh:a)(X7(s-o,0)),d=0;o<s;o++,d++)o in r&&V7(l,d,r[o]);return l.length=d,l}});var Z7=ze,J7=Z7("Array").slice,Q7=Te,eY=J7,Vh=Array.prototype,tY=function(i){var e=i.slice;return i===Vh||Q7(Vh,i)&&e===Vh.slice?eY:e},rY=tY,iY=rY,nY=iY,jt=B(nY),oY=Rt,sY=K,aY=cs,lY=as,dY=pr,hY=sY([].concat),cY=oY("Reflect","ownKeys")||function(e){var t=aY.f(dY(e)),r=lY.f;return r?hY(t,r(e)):t},uY=N,fY=Si;uY({target:"Array",stat:!0},{isArray:fY});var vY=X,pY=vY.Array.isArray,gY=pY,yY=gY,mY=yY,ce=B(mY),bY=N,$Y=zr.map,wY=ds,EY=wY("map");bY({target:"Array",proto:!0,forced:!EY},{map:function(e){return $Y(this,e,arguments.length>1?arguments[1]:void 0)}});var _Y=ze,SY=_Y("Array").map,OY=Te,TY=SY,Uh=Array.prototype,IY=function(i){var e=i.map;return i===Uh||OY(Uh,i)&&e===Uh.map?TY:e},PY=IY,CY=PY,xY=CY,fn=B(xY),AY=N,DY=_t,LE=ss,MY=U,kY=MY(function(){LE(1)});AY({target:"Object",stat:!0,forced:kY},{keys:function(e){return LE(DY(e))}});var RY=X,NY=RY.Object.keys,FY=NY,BY=FY,LY=BY,he=B(LY),jY=N,zY=K,jE=Date,HY=zY(jE.prototype.getTime);jY({target:"Date",stat:!0},{now:function(){return HY(new jE)}});var WY=X,VY=WY.Date.now,UY=VY,KY=UY,GY=KY,Va=B(GY),YY=U,Ln=function(i,e){var t=[][i];return!!t&&YY(function(){t.call(null,e||function(){return 1},1)})},qY=zr.forEach,XY=Ln,ZY=XY("forEach"),JY=ZY?[].forEach:function(e){return qY(this,e,arguments.length>1?arguments[1]:void 0)},QY=N,hm=JY;QY({target:"Array",proto:!0,forced:[].forEach!==hm},{forEach:hm});var eq=ze,tq=eq("Array").forEach,rq=tq,iq=rq,nq=Oi,oq=je,sq=Te,aq=iq,Kh=Array.prototype,lq={DOMTokenList:!0,NodeList:!0},dq=function(i){var e=i.forEach;return i===Kh||sq(Kh,i)&&e===Kh.forEach||oq(lq,nq(i))?aq:e},hq=dq,Z=B(hq),cq=N,uq=K,fq=Si,vq=uq([].reverse),cm=[1,2];cq({target:"Array",proto:!0,forced:String(cm)===String(cm.reverse())},{reverse:function(){return fq(this)&&(this.length=this.length),vq(this)}});var pq=ze,gq=pq("Array").reverse,yq=Te,mq=gq,Gh=Array.prototype,bq=function(i){var e=i.reverse;return i===Gh||yq(Gh,i)&&e===Gh.reverse?mq:e},$q=bq,wq=$q,Eq=wq,ni=B(Eq),_q=Ie,Sq=Si,Oq=TypeError,Tq=Object.getOwnPropertyDescriptor,Iq=_q&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(i){return i instanceof TypeError}}(),Pq=Iq?function(i,e){if(Sq(i)&&!Tq(i,"length").writable)throw new Oq("Cannot set read only .length");return i.length=e}:function(i,e){return i.length=e},um=rs,Cq=TypeError,zE=function(i,e){if(!delete i[e])throw new Cq("Cannot delete property "+um(e)+" of "+um(i))},xq=N,Aq=_t,Dq=ns,Mq=Rl,kq=Yt,Rq=Pq,Nq=G0,Fq=mf,Bq=ls,Yh=zE,Lq=ds,jq=Lq("splice"),zq=Math.max,Hq=Math.min;xq({target:"Array",proto:!0,forced:!jq},{splice:function(e,t){var r=Aq(this),n=kq(r),o=Dq(e,n),s=arguments.length,a,l,d,h,c,u;for(s===0?a=l=0:s===1?(a=0,l=n-o):(a=s-2,l=Hq(zq(Mq(t),0),n-o)),Nq(n+a-l),d=Fq(r,l),h=0;h<l;h++)c=o+h,c in r&&Bq(d,h,r[c]);if(d.length=l,a<l){for(h=o;h<n-l;h++)c=h+l,u=h+a,c in r?r[u]=r[c]:Yh(r,u);for(h=n;h>n-l+a;h--)Yh(r,h-1)}else if(a>l)for(h=n-l;h>o;h--)c=h+l-1,u=h+a-1,c in r?r[u]=r[c]:Yh(r,u);for(h=0;h<a;h++)r[h+o]=arguments[h+2];return Rq(r,n-l+a),d}});var Wq=ze,Vq=Wq("Array").splice,Uq=Te,Kq=Vq,qh=Array.prototype,Gq=function(i){var e=i.splice;return i===qh||Uq(qh,i)&&e===qh.splice?Kq:e},Yq=Gq,qq=Yq,Xq=qq,ir=B(Xq),Zq=N,Jq=ff.includes,Qq=U,eX=Qq(function(){return!Array(1).includes()});Zq({target:"Array",proto:!0,forced:eX},{includes:function(e){return Jq(this,e,arguments.length>1?arguments[1]:void 0)}});var tX=ze,rX=tX("Array").includes,iX=We,nX=vr,oX=me,sX=oX("match"),aX=function(i){var e;return iX(i)&&((e=i[sX])!==void 0?!!e:nX(i)==="RegExp")},lX=aX,dX=TypeError,hX=function(i){if(lX(i))throw new dX("The method doesn't accept regular expressions");return i},cX=me,uX=cX("match"),fX=function(i){var e=/./;try{"/./"[i](e)}catch{try{return e[uX]=!1,"/./"[i](e)}catch{}}return!1},vX=N,pX=K,gX=hX,yX=Jo,fm=qt,mX=fX,bX=pX("".indexOf);vX({target:"String",proto:!0,forced:!mX("includes")},{includes:function(e){return!!~bX(fm(yX(this)),fm(gX(e)),arguments.length>1?arguments[1]:void 0)}});var $X=ze,wX=$X("String").includes,vm=Te,EX=rX,_X=wX,Xh=Array.prototype,Zh=String.prototype,SX=function(i){var e=i.includes;return i===Xh||vm(Xh,i)&&e===Xh.includes?EX:typeof i=="string"||i===Zh||vm(Zh,i)&&e===Zh.includes?_X:e},OX=SX,TX=OX,IX=TX,Cr=B(IX),PX=N,CX=U,xX=_t,HE=Kl,AX=ME,DX=CX(function(){HE(1)});PX({target:"Object",stat:!0,forced:DX,sham:!AX},{getPrototypeOf:function(e){return HE(xX(e))}});var MX=X,kX=MX.Object.getPrototypeOf,RX=kX,NX=RX,FX=NX,pm=B(FX),BX=ze,LX=BX("Array").concat,jX=Te,zX=LX,Jh=Array.prototype,HX=function(i){var e=i.concat;return i===Jh||jX(Jh,i)&&e===Jh.concat?zX:e},WX=HX,VX=WX,UX=VX,KX=B(UX),GX=N,YX=zr.filter,qX=ds,XX=qX("filter");GX({target:"Array",proto:!0,forced:!XX},{filter:function(e){return YX(this,e,arguments.length>1?arguments[1]:void 0)}});var ZX=ze,JX=ZX("Array").filter,QX=Te,eZ=JX,Qh=Array.prototype,tZ=function(i){var e=i.filter;return i===Qh||QX(Qh,i)&&e===Qh.filter?eZ:e},rZ=tZ,iZ=rZ,nZ=iZ,ot=B(nZ),WE=Ie,oZ=U,VE=K,sZ=Kl,aZ=ss,lZ=kt,dZ=Xo.f,UE=VE(dZ),hZ=VE([].push),cZ=WE&&oZ(function(){var i=Object.create(null);return i[2]=2,!UE(i,2)}),uZ=function(i){return function(e){for(var t=lZ(e),r=aZ(t),n=cZ&&sZ(t)===null,o=r.length,s=0,a=[],l;o>s;)l=r[s++],(!WE||(n?l in t:UE(t,l)))&&hZ(a,i?[l,t[l]]:t[l]);return a}},fZ={values:uZ(!1)},vZ=N,pZ=fZ.values;vZ({target:"Object",stat:!0},{values:function(e){return pZ(e)}});var gZ=X,yZ=gZ.Object.values,mZ=yZ,bZ=mZ,$Z=bZ,wZ=B($Z),Tf=`
62
+ \v\f\r                 \u2028\u2029\uFEFF`,EZ=K,_Z=Jo,SZ=qt,lu=Tf,gm=EZ("".replace),OZ=RegExp("^["+lu+"]+"),TZ=RegExp("(^|[^"+lu+"])["+lu+"]+$"),IZ=function(i){return function(e){var t=SZ(_Z(e));return i&1&&(t=gm(t,OZ,"")),i&2&&(t=gm(t,TZ,"$1")),t}},KE={trim:IZ(3)},GE=ve,PZ=U,CZ=K,xZ=qt,AZ=KE.trim,ym=Tf,io=GE.parseInt,mm=GE.Symbol,bm=mm&&mm.iterator,YE=/^[+-]?0x/i,DZ=CZ(YE.exec),MZ=io(ym+"08")!==8||io(ym+"0x16")!==22||bm&&!PZ(function(){io(Object(bm))}),kZ=MZ?function(e,t){var r=AZ(xZ(e));return io(r,t>>>0||(DZ(YE,r)?16:10))}:io,RZ=N,$m=kZ;RZ({global:!0,forced:parseInt!==$m},{parseInt:$m});var NZ=X,FZ=NZ.parseInt,BZ=FZ,LZ=BZ,jZ=LZ,Pt=B(jZ),zZ=N,HZ=hf,WZ=ff.indexOf,VZ=Ln,du=HZ([].indexOf),qE=!!du&&1/du([1],1,-0)<0,UZ=qE||!VZ("indexOf");zZ({target:"Array",proto:!0,forced:UZ},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return qE?du(this,e,t)||0:WZ(this,e,t)}});var KZ=ze,GZ=KZ("Array").indexOf,YZ=Te,qZ=GZ,ec=Array.prototype,XZ=function(i){var e=i.indexOf;return i===ec||YZ(ec,i)&&e===ec.indexOf?qZ:e},ZZ=XZ,JZ=ZZ,QZ=JZ,q=B(QZ),eJ=N,tJ=Ie,rJ=hs;eJ({target:"Object",stat:!0,sham:!tJ},{create:rJ});var iJ=X,nJ=iJ.Object,oJ=function(e,t){return nJ.create(e,t)},sJ=oJ,aJ=sJ,lJ=aJ,oi=B(lJ),hu=X,dJ=xl;hu.JSON||(hu.JSON={stringify:JSON.stringify});var hJ=function(e,t,r){return dJ(hu.JSON.stringify,null,arguments)},cJ=hJ,uJ=cJ,fJ=uJ,gs=B(fJ),vJ=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",pJ=TypeError,gJ=function(i,e){if(i<e)throw new pJ("Not enough arguments");return i},XE=ve,yJ=xl,mJ=Le,bJ=vJ,$J=Qo,wJ=Nl,EJ=gJ,_J=XE.Function,SJ=/MSIE .\./.test($J)||bJ&&function(){var i=XE.Bun.version.split(".");return i.length<3||i[0]==="0"&&(i[1]<3||i[1]==="3"&&i[2]==="0")}(),ZE=function(i,e){var t=e?2:1;return SJ?function(r,n){var o=EJ(arguments.length,1)>t,s=mJ(r)?r:_J(r),a=o?wJ(arguments,t):[],l=o?function(){yJ(s,this,a)}:s;return e?i(l,n):i(l)}:i},OJ=N,JE=ve,TJ=ZE,wm=TJ(JE.setInterval,!0);OJ({global:!0,bind:!0,forced:JE.setInterval!==wm},{setInterval:wm});var IJ=N,QE=ve,PJ=ZE,Em=PJ(QE.setTimeout,!0);IJ({global:!0,bind:!0,forced:QE.setTimeout!==Em},{setTimeout:Em});var CJ=X,xJ=CJ.setTimeout,AJ=xJ,nr=B(AJ),DJ=_t,_m=ns,MJ=Yt,kJ=function(e){for(var t=DJ(this),r=MJ(t),n=arguments.length,o=_m(n>1?arguments[1]:void 0,r),s=n>2?arguments[2]:void 0,a=s===void 0?r:_m(s,r);a>o;)t[o++]=e;return t},RJ=N,NJ=kJ;RJ({target:"Array",proto:!0},{fill:NJ});var FJ=ze,BJ=FJ("Array").fill,LJ=Te,jJ=BJ,tc=Array.prototype,zJ=function(i){var e=i.fill;return i===tc||LJ(tc,i)&&e===tc.fill?jJ:e},HJ=zJ,WJ=HJ,VJ=WJ,ys=B(VJ);/*! Hammer.JS - v2.0.17-rc - 2019-12-16
63
+ * http://naver.github.io/egjs
64
+ *
65
+ * Forked By Naver egjs
66
+ * Copyright (c) hammerjs
67
+ * Licensed under the MIT license */function Dt(){return Dt=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Dt.apply(this,arguments)}function St(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.__proto__=e}function Qs(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}var cu;typeof Object.assign!="function"?cu=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;r<arguments.length;r++){var n=arguments[r];if(n!=null)for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])}return t}:cu=Object.assign;var fi=cu,Sm=["","webkit","Moz","MS","ms","o"],UJ=typeof document>"u"?{style:{}}:document.createElement("div"),KJ="function",Xi=Math.round,vi=Math.abs,If=Date.now;function Gl(i,e){for(var t,r,n=e[0].toUpperCase()+e.slice(1),o=0;o<Sm.length;){if(t=Sm[o],r=t?t+n:e,r in i)return r;o++}}var or;typeof window>"u"?or={}:or=window;var e_=Gl(UJ.style,"touchAction"),t_=e_!==void 0;function GJ(){if(!t_)return!1;var i={},e=or.CSS&&or.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return i[t]=e?or.CSS.supports("touch-action",t):!0}),i}var r_="compute",i_="auto",uu="manipulation",si="none",Eo="pan-x",_o="pan-y",ea=GJ(),YJ=/mobile|tablet|ip(ad|hone|od)|android/i,n_="ontouchstart"in or,qJ=Gl(or,"PointerEvent")!==void 0,XJ=n_&&YJ.test(navigator.userAgent),ms="touch",ZJ="pen",Pf="mouse",JJ="kinect",QJ=25,Xe=1,Ii=2,_e=4,at=8,Ua=1,bs=2,$s=4,ws=8,vn=16,Ut=bs|$s,ai=ws|vn,o_=Ut|ai,s_=["x","y"],Ka=["clientX","clientY"];function sr(i,e,t){var r;if(i)if(i.forEach)i.forEach(e,t);else if(i.length!==void 0)for(r=0;r<i.length;)e.call(t,i[r],r,i),r++;else for(r in i)i.hasOwnProperty(r)&&e.call(t,i[r],r,i)}function Yl(i,e){return typeof i===KJ?i.apply(e&&e[0]||void 0,e):i}function Xr(i,e){return i.indexOf(e)>-1}function eQ(i){if(Xr(i,si))return si;var e=Xr(i,Eo),t=Xr(i,_o);return e&&t?si:e||t?e?Eo:_o:Xr(i,uu)?uu:i_}var a_=function(){function i(t,r){this.manager=t,this.set(r)}var e=i.prototype;return e.set=function(r){r===r_&&(r=this.compute()),t_&&this.manager.element.style&&ea[r]&&(this.manager.element.style[e_]=r),this.actions=r.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var r=[];return sr(this.manager.recognizers,function(n){Yl(n.options.enable,[n])&&(r=r.concat(n.getTouchAction()))}),eQ(r.join(" "))},e.preventDefaults=function(r){var n=r.srcEvent,o=r.offsetDirection;if(this.manager.session.prevented){n.preventDefault();return}var s=this.actions,a=Xr(s,si)&&!ea[si],l=Xr(s,_o)&&!ea[_o],d=Xr(s,Eo)&&!ea[Eo];if(a){var h=r.pointers.length===1,c=r.distance<2,u=r.deltaTime<250;if(h&&c&&u)return}if(!(d&&l)&&(a||l&&o&Ut||d&&o&ai))return this.preventSrc(n)},e.preventSrc=function(r){this.manager.session.prevented=!0,r.preventDefault()},i}();function Cf(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}function l_(i){var e=i.length;if(e===1)return{x:Xi(i[0].clientX),y:Xi(i[0].clientY)};for(var t=0,r=0,n=0;n<e;)t+=i[n].clientX,r+=i[n].clientY,n++;return{x:Xi(t/e),y:Xi(r/e)}}function Om(i){for(var e=[],t=0;t<i.pointers.length;)e[t]={clientX:Xi(i.pointers[t].clientX),clientY:Xi(i.pointers[t].clientY)},t++;return{timeStamp:If(),pointers:e,center:l_(e),deltaX:i.deltaX,deltaY:i.deltaY}}function Ga(i,e,t){t||(t=s_);var r=e[t[0]]-i[t[0]],n=e[t[1]]-i[t[1]];return Math.sqrt(r*r+n*n)}function fu(i,e,t){t||(t=s_);var r=e[t[0]]-i[t[0]],n=e[t[1]]-i[t[1]];return Math.atan2(n,r)*180/Math.PI}function d_(i,e){return i===e?Ua:vi(i)>=vi(e)?i<0?bs:$s:e<0?ws:vn}function tQ(i,e){var t=e.center,r=i.offsetDelta||{},n=i.prevDelta||{},o=i.prevInput||{};(e.eventType===Xe||o.eventType===_e)&&(n=i.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=i.offsetDelta={x:t.x,y:t.y}),e.deltaX=n.x+(t.x-r.x),e.deltaY=n.y+(t.y-r.y)}function h_(i,e,t){return{x:e/i||0,y:t/i||0}}function rQ(i,e){return Ga(e[0],e[1],Ka)/Ga(i[0],i[1],Ka)}function iQ(i,e){return fu(e[1],e[0],Ka)+fu(i[1],i[0],Ka)}function nQ(i,e){var t=i.lastInterval||e,r=e.timeStamp-t.timeStamp,n,o,s,a;if(e.eventType!==at&&(r>QJ||t.velocity===void 0)){var l=e.deltaX-t.deltaX,d=e.deltaY-t.deltaY,h=h_(r,l,d);o=h.x,s=h.y,n=vi(h.x)>vi(h.y)?h.x:h.y,a=d_(l,d),i.lastInterval=e}else n=t.velocity,o=t.velocityX,s=t.velocityY,a=t.direction;e.velocity=n,e.velocityX=o,e.velocityY=s,e.direction=a}function oQ(i,e){var t=i.session,r=e.pointers,n=r.length;t.firstInput||(t.firstInput=Om(e)),n>1&&!t.firstMultiple?t.firstMultiple=Om(e):n===1&&(t.firstMultiple=!1);var o=t.firstInput,s=t.firstMultiple,a=s?s.center:o.center,l=e.center=l_(r);e.timeStamp=If(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=fu(a,l),e.distance=Ga(a,l),tQ(t,e),e.offsetDirection=d_(e.deltaX,e.deltaY);var d=h_(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=d.x,e.overallVelocityY=d.y,e.overallVelocity=vi(d.x)>vi(d.y)?d.x:d.y,e.scale=s?rQ(s.pointers,r):1,e.rotation=s?iQ(s.pointers,r):0,e.maxPointers=t.prevInput?e.pointers.length>t.prevInput.maxPointers?e.pointers.length:t.prevInput.maxPointers:e.pointers.length,nQ(t,e);var h=i.element,c=e.srcEvent,u;c.composedPath?u=c.composedPath()[0]:c.path?u=c.path[0]:u=c.target,Cf(u,h)&&(h=u),e.target=h}function sQ(i,e,t){var r=t.pointers.length,n=t.changedPointers.length,o=e&Xe&&r-n===0,s=e&(_e|at)&&r-n===0;t.isFirst=!!o,t.isFinal=!!s,o&&(i.session={}),t.eventType=e,oQ(i,t),i.emit("hammer.input",t),i.recognize(t),i.session.prevInput=t}function So(i){return i.trim().split(/\s+/g)}function no(i,e,t){sr(So(e),function(r){i.addEventListener(r,t,!1)})}function oo(i,e,t){sr(So(e),function(r){i.removeEventListener(r,t,!1)})}function Tm(i){var e=i.ownerDocument||i;return e.defaultView||e.parentWindow||window}var jn=function(){function i(t,r){var n=this;this.manager=t,this.callback=r,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(o){Yl(t.options.enable,[t])&&n.handler(o)},this.init()}var e=i.prototype;return e.handler=function(){},e.init=function(){this.evEl&&no(this.element,this.evEl,this.domHandler),this.evTarget&&no(this.target,this.evTarget,this.domHandler),this.evWin&&no(Tm(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&oo(this.element,this.evEl,this.domHandler),this.evTarget&&oo(this.target,this.evTarget,this.domHandler),this.evWin&&oo(Tm(this.element),this.evWin,this.domHandler)},i}();function pi(i,e,t){if(i.indexOf&&!t)return i.indexOf(e);for(var r=0;r<i.length;){if(t&&i[r][t]==e||!t&&i[r]===e)return r;r++}return-1}var aQ={pointerdown:Xe,pointermove:Ii,pointerup:_e,pointercancel:at,pointerout:at},lQ={2:ms,3:ZJ,4:Pf,5:JJ},c_="pointerdown",u_="pointermove pointerup pointercancel";or.MSPointerEvent&&!or.PointerEvent&&(c_="MSPointerDown",u_="MSPointerMove MSPointerUp MSPointerCancel");var f_=function(i){St(e,i);function e(){var r,n=e.prototype;return n.evEl=c_,n.evWin=u_,r=i.apply(this,arguments)||this,r.store=r.manager.session.pointerEvents=[],r}var t=e.prototype;return t.handler=function(n){var o=this.store,s=!1,a=n.type.toLowerCase().replace("ms",""),l=aQ[a],d=lQ[n.pointerType]||n.pointerType,h=d===ms,c=pi(o,n.pointerId,"pointerId");l&Xe&&(n.button===0||h)?c<0&&(o.push(n),c=o.length-1):l&(_e|at)&&(s=!0),!(c<0)&&(o[c]=n,this.callback(this.manager,l,{pointers:o,changedPointers:[n],pointerType:d,srcEvent:n}),s&&o.splice(c,1))},e}(jn);function Oo(i){return Array.prototype.slice.call(i,0)}function xf(i,e,t){for(var r=[],n=[],o=0;o<i.length;){var s=e?i[o][e]:i[o];pi(n,s)<0&&r.push(i[o]),n[o]=s,o++}return t&&(e?r=r.sort(function(a,l){return a[e]>l[e]}):r=r.sort()),r}var dQ={touchstart:Xe,touchmove:Ii,touchend:_e,touchcancel:at},hQ="touchstart touchmove touchend touchcancel",Af=function(i){St(e,i);function e(){var r;return e.prototype.evTarget=hQ,r=i.apply(this,arguments)||this,r.targetIds={},r}var t=e.prototype;return t.handler=function(n){var o=dQ[n.type],s=cQ.call(this,n,o);s&&this.callback(this.manager,o,{pointers:s[0],changedPointers:s[1],pointerType:ms,srcEvent:n})},e}(jn);function cQ(i,e){var t=Oo(i.touches),r=this.targetIds;if(e&(Xe|Ii)&&t.length===1)return r[t[0].identifier]=!0,[t,t];var n,o,s=Oo(i.changedTouches),a=[],l=this.target;if(o=t.filter(function(d){return Cf(d.target,l)}),e===Xe)for(n=0;n<o.length;)r[o[n].identifier]=!0,n++;for(n=0;n<s.length;)r[s[n].identifier]&&a.push(s[n]),e&(_e|at)&&delete r[s[n].identifier],n++;if(a.length)return[xf(o.concat(a),"identifier",!0),a]}var uQ={mousedown:Xe,mousemove:Ii,mouseup:_e},fQ="mousedown",vQ="mousemove mouseup",Df=function(i){St(e,i);function e(){var r,n=e.prototype;return n.evEl=fQ,n.evWin=vQ,r=i.apply(this,arguments)||this,r.pressed=!1,r}var t=e.prototype;return t.handler=function(n){var o=uQ[n.type];o&Xe&&n.button===0&&(this.pressed=!0),o&Ii&&n.which!==1&&(o=_e),this.pressed&&(o&_e&&(this.pressed=!1),this.callback(this.manager,o,{pointers:[n],changedPointers:[n],pointerType:Pf,srcEvent:n}))},e}(jn),pQ=2500,Im=25;function Pm(i){var e=i.changedPointers,t=e[0];if(t.identifier===this.primaryTouch){var r={x:t.clientX,y:t.clientY},n=this.lastTouches;this.lastTouches.push(r);var o=function(){var a=n.indexOf(r);a>-1&&n.splice(a,1)};setTimeout(o,pQ)}}function gQ(i,e){i&Xe?(this.primaryTouch=e.changedPointers[0].identifier,Pm.call(this,e)):i&(_e|at)&&Pm.call(this,e)}function yQ(i){for(var e=i.srcEvent.clientX,t=i.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var n=this.lastTouches[r],o=Math.abs(e-n.x),s=Math.abs(t-n.y);if(o<=Im&&s<=Im)return!0}return!1}var v_=function(){var i=function(e){St(t,e);function t(n,o){var s;return s=e.call(this,n,o)||this,s.handler=function(a,l,d){var h=d.pointerType===ms,c=d.pointerType===Pf;if(!(c&&d.sourceCapabilities&&d.sourceCapabilities.firesTouchEvents)){if(h)gQ.call(Qs(Qs(s)),l,d);else if(c&&yQ.call(Qs(Qs(s)),d))return;s.callback(a,l,d)}},s.touch=new Af(s.manager,s.handler),s.mouse=new Df(s.manager,s.handler),s.primaryTouch=null,s.lastTouches=[],s}var r=t.prototype;return r.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(jn);return i}();function mQ(i){var e,t=i.options.inputClass;return t?e=t:qJ?e=f_:XJ?e=Af:n_?e=v_:e=Df,new e(i,sQ)}function Zi(i,e,t){return Array.isArray(i)?(sr(i,t[e],t),!0):!1}var $a=1,wt=2,pn=4,xr=8,ar=xr,To=16,Ht=32,bQ=1;function $Q(){return bQ++}function ta(i,e){var t=e.manager;return t?t.get(i):i}function Cm(i){return i&To?"cancel":i&xr?"end":i&pn?"move":i&wt?"start":""}var Es=function(){function i(t){t===void 0&&(t={}),this.options=Dt({enable:!0},t),this.id=$Q(),this.manager=null,this.state=$a,this.simultaneous={},this.requireFail=[]}var e=i.prototype;return e.set=function(r){return fi(this.options,r),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(r){if(Zi(r,"recognizeWith",this))return this;var n=this.simultaneous;return r=ta(r,this),n[r.id]||(n[r.id]=r,r.recognizeWith(this)),this},e.dropRecognizeWith=function(r){return Zi(r,"dropRecognizeWith",this)?this:(r=ta(r,this),delete this.simultaneous[r.id],this)},e.requireFailure=function(r){if(Zi(r,"requireFailure",this))return this;var n=this.requireFail;return r=ta(r,this),pi(n,r)===-1&&(n.push(r),r.requireFailure(this)),this},e.dropRequireFailure=function(r){if(Zi(r,"dropRequireFailure",this))return this;r=ta(r,this);var n=pi(this.requireFail,r);return n>-1&&this.requireFail.splice(n,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(r){return!!this.simultaneous[r.id]},e.emit=function(r){var n=this,o=this.state;function s(a){n.manager.emit(a,r)}o<xr&&s(n.options.event+Cm(o)),s(n.options.event),r.additionalEvent&&s(r.additionalEvent),o>=xr&&s(n.options.event+Cm(o))},e.tryEmit=function(r){if(this.canEmit())return this.emit(r);this.state=Ht},e.canEmit=function(){for(var r=0;r<this.requireFail.length;){if(!(this.requireFail[r].state&(Ht|$a)))return!1;r++}return!0},e.recognize=function(r){var n=fi({},r);if(!Yl(this.options.enable,[this,n])){this.reset(),this.state=Ht;return}this.state&(ar|To|Ht)&&(this.state=$a),this.state=this.process(n),this.state&(wt|pn|xr|To)&&this.tryEmit(n)},e.process=function(r){},e.getTouchAction=function(){},e.reset=function(){},i}(),vu=function(i){St(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,Dt({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},r))||this,n.pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}var t=e.prototype;return t.getTouchAction=function(){return[uu]},t.process=function(n){var o=this,s=this.options,a=n.pointers.length===s.pointers,l=n.distance<s.threshold,d=n.deltaTime<s.time;if(this.reset(),n.eventType&Xe&&this.count===0)return this.failTimeout();if(l&&d&&a){if(n.eventType!==_e)return this.failTimeout();var h=this.pTime?n.timeStamp-this.pTime<s.interval:!0,c=!this.pCenter||Ga(this.pCenter,n.center)<s.posThreshold;this.pTime=n.timeStamp,this.pCenter=n.center,!c||!h?this.count=1:this.count+=1,this._input=n;var u=this.count%s.taps;if(u===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){o.state=ar,o.tryEmit()},s.interval),wt):ar}return Ht},t.failTimeout=function(){var n=this;return this._timer=setTimeout(function(){n.state=Ht},this.options.interval),Ht},t.reset=function(){clearTimeout(this._timer)},t.emit=function(){this.state===ar&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(Es),gn=function(i){St(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Dt({pointers:1},r))||this}var t=e.prototype;return t.attrTest=function(n){var o=this.options.pointers;return o===0||n.pointers.length===o},t.process=function(n){var o=this.state,s=n.eventType,a=o&(wt|pn),l=this.attrTest(n);return a&&(s&at||!l)?o|To:a||l?s&_e?o|xr:o&wt?o|pn:wt:Ht},e}(Es);function p_(i){return i===vn?"down":i===ws?"up":i===bs?"left":i===$s?"right":""}var Mf=function(i){St(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,Dt({event:"pan",threshold:10,pointers:1,direction:o_},r))||this,n.pX=null,n.pY=null,n}var t=e.prototype;return t.getTouchAction=function(){var n=this.options.direction,o=[];return n&Ut&&o.push(_o),n&ai&&o.push(Eo),o},t.directionTest=function(n){var o=this.options,s=!0,a=n.distance,l=n.direction,d=n.deltaX,h=n.deltaY;return l&o.direction||(o.direction&Ut?(l=d===0?Ua:d<0?bs:$s,s=d!==this.pX,a=Math.abs(n.deltaX)):(l=h===0?Ua:h<0?ws:vn,s=h!==this.pY,a=Math.abs(n.deltaY))),n.direction=l,s&&a>o.threshold&&l&o.direction},t.attrTest=function(n){return gn.prototype.attrTest.call(this,n)&&(this.state&wt||!(this.state&wt)&&this.directionTest(n))},t.emit=function(n){this.pX=n.deltaX,this.pY=n.deltaY;var o=p_(n.direction);o&&(n.additionalEvent=this.options.event+o),i.prototype.emit.call(this,n)},e}(gn),g_=function(i){St(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Dt({event:"swipe",threshold:10,velocity:.3,direction:Ut|ai,pointers:1},r))||this}var t=e.prototype;return t.getTouchAction=function(){return Mf.prototype.getTouchAction.call(this)},t.attrTest=function(n){var o=this.options.direction,s;return o&(Ut|ai)?s=n.overallVelocity:o&Ut?s=n.overallVelocityX:o&ai&&(s=n.overallVelocityY),i.prototype.attrTest.call(this,n)&&o&n.offsetDirection&&n.distance>this.options.threshold&&n.maxPointers===this.options.pointers&&vi(s)>this.options.velocity&&n.eventType&_e},t.emit=function(n){var o=p_(n.offsetDirection);o&&this.manager.emit(this.options.event+o,n),this.manager.emit(this.options.event,n)},e}(gn),y_=function(i){St(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Dt({event:"pinch",threshold:0,pointers:2},r))||this}var t=e.prototype;return t.getTouchAction=function(){return[si]},t.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.scale-1)>this.options.threshold||this.state&wt)},t.emit=function(n){if(n.scale!==1){var o=n.scale<1?"in":"out";n.additionalEvent=this.options.event+o}i.prototype.emit.call(this,n)},e}(gn),m_=function(i){St(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Dt({event:"rotate",threshold:0,pointers:2},r))||this}var t=e.prototype;return t.getTouchAction=function(){return[si]},t.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.rotation)>this.options.threshold||this.state&wt)},e}(gn),b_=function(i){St(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,Dt({event:"press",pointers:1,time:251,threshold:9},r))||this,n._timer=null,n._input=null,n}var t=e.prototype;return t.getTouchAction=function(){return[i_]},t.process=function(n){var o=this,s=this.options,a=n.pointers.length===s.pointers,l=n.distance<s.threshold,d=n.deltaTime>s.time;if(this._input=n,!l||!a||n.eventType&(_e|at)&&!d)this.reset();else if(n.eventType&Xe)this.reset(),this._timer=setTimeout(function(){o.state=ar,o.tryEmit()},s.time);else if(n.eventType&_e)return ar;return Ht},t.reset=function(){clearTimeout(this._timer)},t.emit=function(n){this.state===ar&&(n&&n.eventType&_e?this.manager.emit(this.options.event+"up",n):(this._input.timeStamp=If(),this.manager.emit(this.options.event,this._input)))},e}(Es),$_={domEvents:!1,touchAction:r_,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},xm=[[m_,{enable:!1}],[y_,{enable:!1},["rotate"]],[g_,{direction:Ut}],[Mf,{direction:Ut},["swipe"]],[vu],[vu,{event:"doubletap",taps:2},["tap"]],[b_]],wQ=1,Am=2;function Dm(i,e){var t=i.element;if(t.style){var r;sr(i.options.cssProps,function(n,o){r=Gl(t.style,o),e?(i.oldCssProps[r]=t.style[r],t.style[r]=n):t.style[r]=i.oldCssProps[r]||""}),e||(i.oldCssProps={})}}function EQ(i,e){var t=document.createEvent("Event");t.initEvent(i,!0,!0),t.gesture=e,e.target.dispatchEvent(t)}var Mm=function(){function i(t,r){var n=this;this.options=fi({},$_,r||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=mQ(this),this.touchAction=new a_(this,this.options.touchAction),Dm(this,!0),sr(this.options.recognizers,function(o){var s=n.add(new o[0](o[1]));o[2]&&s.recognizeWith(o[2]),o[3]&&s.requireFailure(o[3])},this)}var e=i.prototype;return e.set=function(r){return fi(this.options,r),r.touchAction&&this.touchAction.update(),r.inputTarget&&(this.input.destroy(),this.input.target=r.inputTarget,this.input.init()),this},e.stop=function(r){this.session.stopped=r?Am:wQ},e.recognize=function(r){var n=this.session;if(!n.stopped){this.touchAction.preventDefaults(r);var o,s=this.recognizers,a=n.curRecognizer;(!a||a&&a.state&ar)&&(n.curRecognizer=null,a=null);for(var l=0;l<s.length;)o=s[l],n.stopped!==Am&&(!a||o===a||o.canRecognizeWith(a))?o.recognize(r):o.reset(),!a&&o.state&(wt|pn|xr)&&(n.curRecognizer=o,a=o),l++}},e.get=function(r){if(r instanceof Es)return r;for(var n=this.recognizers,o=0;o<n.length;o++)if(n[o].options.event===r)return n[o];return null},e.add=function(r){if(Zi(r,"add",this))return this;var n=this.get(r.options.event);return n&&this.remove(n),this.recognizers.push(r),r.manager=this,this.touchAction.update(),r},e.remove=function(r){if(Zi(r,"remove",this))return this;var n=this.get(r);if(r){var o=this.recognizers,s=pi(o,n);s!==-1&&(o.splice(s,1),this.touchAction.update())}return this},e.on=function(r,n){if(r===void 0||n===void 0)return this;var o=this.handlers;return sr(So(r),function(s){o[s]=o[s]||[],o[s].push(n)}),this},e.off=function(r,n){if(r===void 0)return this;var o=this.handlers;return sr(So(r),function(s){n?o[s]&&o[s].splice(pi(o[s],n),1):delete o[s]}),this},e.emit=function(r,n){this.options.domEvents&&EQ(r,n);var o=this.handlers[r]&&this.handlers[r].slice();if(!(!o||!o.length)){n.type=r,n.preventDefault=function(){n.srcEvent.preventDefault()};for(var s=0;s<o.length;)o[s](n),s++}},e.destroy=function(){this.element&&Dm(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},i}(),_Q={touchstart:Xe,touchmove:Ii,touchend:_e,touchcancel:at},SQ="touchstart",OQ="touchstart touchmove touchend touchcancel",TQ=function(i){St(e,i);function e(){var r,n=e.prototype;return n.evTarget=SQ,n.evWin=OQ,r=i.apply(this,arguments)||this,r.started=!1,r}var t=e.prototype;return t.handler=function(n){var o=_Q[n.type];if(o===Xe&&(this.started=!0),!!this.started){var s=IQ.call(this,n,o);o&(_e|at)&&s[0].length-s[1].length===0&&(this.started=!1),this.callback(this.manager,o,{pointers:s[0],changedPointers:s[1],pointerType:ms,srcEvent:n})}},e}(jn);function IQ(i,e){var t=Oo(i.touches),r=Oo(i.changedTouches);return e&(_e|at)&&(t=xf(t.concat(r),"identifier",!0)),[t,r]}function w_(i,e,t){var r="DEPRECATED METHOD: "+e+`
68
+ `+t+` AT
69
+ `;return function(){var n=new Error("get-stack-trace"),o=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=window.console&&(window.console.warn||window.console.log);return s&&s.call(window.console,r,o),i.apply(this,arguments)}}var E_=w_(function(i,e,t){for(var r=Object.keys(e),n=0;n<r.length;)(!t||t&&i[r[n]]===void 0)&&(i[r[n]]=e[r[n]]),n++;return i},"extend","Use `assign`."),PQ=w_(function(i,e){return E_(i,e,!0)},"merge","Use `assign`.");function CQ(i,e,t){var r=e.prototype,n;n=i.prototype=Object.create(r),n.constructor=i,n._super=r,t&&fi(n,t)}function km(i,e){return function(){return i.apply(e,arguments)}}var __=function(){var i=function(t,r){return r===void 0&&(r={}),new Mm(t,Dt({recognizers:xm.concat()},r))};return i.VERSION="2.0.17-rc",i.DIRECTION_ALL=o_,i.DIRECTION_DOWN=vn,i.DIRECTION_LEFT=bs,i.DIRECTION_RIGHT=$s,i.DIRECTION_UP=ws,i.DIRECTION_HORIZONTAL=Ut,i.DIRECTION_VERTICAL=ai,i.DIRECTION_NONE=Ua,i.DIRECTION_DOWN=vn,i.INPUT_START=Xe,i.INPUT_MOVE=Ii,i.INPUT_END=_e,i.INPUT_CANCEL=at,i.STATE_POSSIBLE=$a,i.STATE_BEGAN=wt,i.STATE_CHANGED=pn,i.STATE_ENDED=xr,i.STATE_RECOGNIZED=ar,i.STATE_CANCELLED=To,i.STATE_FAILED=Ht,i.Manager=Mm,i.Input=jn,i.TouchAction=a_,i.TouchInput=Af,i.MouseInput=Df,i.PointerEventInput=f_,i.TouchMouseInput=v_,i.SingleTouchInput=TQ,i.Recognizer=Es,i.AttrRecognizer=gn,i.Tap=vu,i.Pan=Mf,i.Swipe=g_,i.Pinch=y_,i.Rotate=m_,i.Press=b_,i.on=no,i.off=oo,i.each=sr,i.merge=PQ,i.extend=E_,i.bindFn=km,i.assign=fi,i.inherit=CQ,i.bindFn=km,i.prefixed=Gl,i.toArray=Oo,i.inArray=pi,i.uniqueArray=xf,i.splitStr=So,i.boolOrFn=Yl,i.hasParent=Cf,i.addEventListeners=no,i.removeEventListeners=oo,i.defaults=fi({},$_,{preset:xm}),i}();__.defaults;var xQ=__;B7("DELETE");function ql(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return AQ(e.length?e:[Va()])}function AQ(i){let[e,t,r]=DQ(i),n=1;const o=()=>{const s=2091639*e+n*23283064365386963e-26;return e=t,t=r,r=s-(n=s|0)};return o.uint32=()=>o()*4294967296,o.fract53=()=>o()+(o()*2097152|0)*11102230246251565e-32,o.algorithm="Alea",o.seed=i,o.version="0.9",o}function DQ(){const i=MQ();let e=i(" "),t=i(" "),r=i(" ");for(let n=0;n<arguments.length;n++)e-=i(n<0||arguments.length<=n?void 0:arguments[n]),e<0&&(e+=1),t-=i(n<0||arguments.length<=n?void 0:arguments[n]),t<0&&(t+=1),r-=i(n<0||arguments.length<=n?void 0:arguments[n]),r<0&&(r+=1);return[e,t,r]}function MQ(){let i=4022871197;return function(e){const t=e.toString();for(let r=0;r<t.length;r++){i+=t.charCodeAt(r);let n=.02519603282416938*i;i=n>>>0,n-=i,n*=i,i=n>>>0,n-=i,i+=n*4294967296}return(i>>>0)*23283064365386963e-26}}function kQ(){const i=()=>{};return{on:i,off:i,destroy:i,emit:i,get(){return{set:i}}}}const kf=typeof window<"u"?window.Hammer||xQ:function(){return kQ()};function Wt(i){var e;this._cleanupQueue=[],this.active=!1,this._dom={container:i,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});const t=kf(this._dom.overlay);t.on("tap",_(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{t.destroy()});const r=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];Z(r).call(r,n=>{t.on(n,o=>{o.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=n=>{RQ(n.target,i)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=n=>{("key"in n?n.key==="Escape":n.keyCode===27)&&this.deactivate()}}K0(Wt.prototype);Wt.current=null;Wt.prototype.destroy=function(){this.deactivate();for(const t of ni(i=ir(e=this._cleanupQueue).call(e,0)).call(i)){var i,e;t()}};Wt.prototype.activate=function(){Wt.current&&Wt.current.deactivate(),Wt.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)};Wt.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")};Wt.prototype._onTapOverlay=function(i){this.activate(),i.srcEvent.stopPropagation()};function RQ(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}const NQ=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,FQ=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,BQ=/^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,LQ=/^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 br(i){if(i)for(;i.hasChildNodes()===!0;){const e=i.firstChild;e&&(br(e),i.removeChild(e))}}function Qi(i){return i instanceof String||typeof i=="string"}function Rm(i){return typeof i=="object"&&i!==null}function gi(i,e,t,r){let n=!1;r===!0&&(n=e[t]===null&&i[t]!==void 0),n?delete i[t]:i[t]=e[t]}function S_(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(const r in i)if(e[r]!==void 0)if(e[r]===null||typeof e[r]!="object")gi(i,e,r,t);else{const n=i[r],o=e[r];Rm(n)&&Rm(o)&&S_(n,o,t)}}function zn(i,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(ce(t))throw new TypeError("Arrays are not supported by deepExtend");for(let n=0;n<i.length;n++){const o=i[n];if(Object.prototype.hasOwnProperty.call(t,o))if(t[o]&&t[o].constructor===Object)e[o]===void 0&&(e[o]={}),e[o].constructor===Object?Q(e[o],t[o],!1,r):gi(e,t,o,r);else{if(ce(t[o]))throw new TypeError("Arrays are not supported by deepExtend");gi(e,t,o,r)}}return e}function Ya(i,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(ce(t))throw new TypeError("Arrays are not supported by deepExtend");for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&!Cr(i).call(i,n))if(t[n]&&t[n].constructor===Object)e[n]===void 0&&(e[n]={}),e[n].constructor===Object?Q(e[n],t[n]):gi(e,t,n,r);else if(ce(t[n])){e[n]=[];for(let o=0;o<t[n].length;o++)e[n].push(t[n][o])}else gi(e,t,n,r);return e}function Q(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)||t===!0)if(typeof e[o]=="object"&&e[o]!==null&&pm(e[o])===Object.prototype)i[o]===void 0?i[o]=Q({},e[o],t):typeof i[o]=="object"&&i[o]!==null&&pm(i[o])===Object.prototype?Q(i[o],e[o],t):gi(i,e,o,r);else if(ce(e[o])){var n;i[o]=jt(n=e[o]).call(n)}else gi(i,e,o,r);return i}function qa(i,e){return[...i,e]}function jQ(i){return jt(i).call(i)}function zQ(i){return i.getBoundingClientRect().left}function HQ(i){return i.getBoundingClientRect().top}function H(i,e){if(ce(i)){const t=i.length;for(let r=0;r<t;r++)e(i[r],r,i)}else for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&e(i[t],t,i)}function Rf(i){let e;switch(i.length){case 3:case 4:return e=FQ.exec(i),e?{r:Pt(e[1]+e[1],16),g:Pt(e[2]+e[2],16),b:Pt(e[3]+e[3],16)}:null;case 6:case 7:return e=NQ.exec(i),e?{r:Pt(e[1],16),g:Pt(e[2],16),b:Pt(e[3],16)}:null;default:return null}}function bt(i,e){if(Cr(i).call(i,"rgba"))return i;if(Cr(i).call(i,"rgb")){const t=i.substr(q(i).call(i,"(")+1).replace(")","").split(",");return"rgba("+t[0]+","+t[1]+","+t[2]+","+e+")"}else{const t=Rf(i);return t==null?i:"rgba("+t.r+","+t.g+","+t.b+","+e+")"}}function O_(i,e,t){var r;return"#"+jt(r=((1<<24)+(i<<16)+(e<<8)+t).toString(16)).call(r,1)}function pu(i,e){if(Qi(i)){let r=i;if(I_(r)){var t;const n=fn(t=r.substr(4).substr(0,r.length-5).split(",")).call(t,function(o){return Pt(o)});r=O_(n[0],n[1],n[2])}if(T_(r)===!0){const n=WQ(r),o={h:n.h,s:n.s*.8,v:Math.min(1,n.v*1.02)},s={h:n.h,s:Math.min(1,n.s*1.25),v:n.v*.8},a=gu(s.h,s.s,s.v),l=gu(o.h,o.s,o.v);return{background:r,border:a,highlight:{background:l,border:a},hover:{background:l,border:a}}}else return{background:r,border:r,highlight:{background:r,border:r},hover:{background:r,border:r}}}else return{background:i.background||void 0,border:i.border||void 0,highlight:Qi(i.highlight)?{border:i.highlight,background:i.highlight}:{background:i.highlight&&i.highlight.background||void 0,border:i.highlight&&i.highlight.border||void 0},hover:Qi(i.hover)?{border:i.hover,background:i.hover}:{border:i.hover&&i.hover.border||void 0,background:i.hover&&i.hover.background||void 0}}}function Zn(i,e,t){i=i/255,e=e/255,t=t/255;const r=Math.min(i,Math.min(e,t)),n=Math.max(i,Math.max(e,t));if(r===n)return{h:0,s:0,v:r};const o=i===r?e-t:t===r?i-e:t-i,a=60*((i===r?3:t===r?1:5)-o/(n-r))/360,l=(n-r)/n;return{h:a,s:l,v:n}}function wa(i,e,t){let r,n,o;const s=Math.floor(i*6),a=i*6-s,l=t*(1-e),d=t*(1-a*e),h=t*(1-(1-a)*e);switch(s%6){case 0:r=t,n=h,o=l;break;case 1:r=d,n=t,o=l;break;case 2:r=l,n=t,o=h;break;case 3:r=l,n=d,o=t;break;case 4:r=h,n=l,o=t;break;case 5:r=t,n=l,o=d;break}return{r:Math.floor(r*255),g:Math.floor(n*255),b:Math.floor(o*255)}}function gu(i,e,t){const r=wa(i,e,t);return O_(r.r,r.g,r.b)}function WQ(i){const e=Rf(i);if(!e)throw new TypeError("'".concat(i,"' is not a valid color."));return Zn(e.r,e.g,e.b)}function T_(i){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(i)}function I_(i){return BQ.test(i)}function VQ(i){return LQ.test(i)}function Ar(i){if(i===null||typeof i!="object")return null;if(i instanceof Element)return i;const e=oi(i);for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&typeof i[t]=="object"&&(e[t]=Ar(i[t]));return e}function mt(i,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const n=function(f){return f!=null},o=function(f){return f!==null&&typeof f=="object"},s=function(f){for(const v in f)if(Object.prototype.hasOwnProperty.call(f,v))return!1;return!0};if(!o(i))throw new Error("Parameter mergeTarget must be an object");if(!o(e))throw new Error("Parameter options must be an object");if(!n(t))throw new Error("Parameter option must have a value");if(!o(r))throw new Error("Parameter globalOptions must be an object");const a=function(f,v,y){o(f[y])||(f[y]={});const g=v[y],p=f[y];for(const m in g)Object.prototype.hasOwnProperty.call(g,m)&&(p[m]=g[m])},l=e[t],h=o(r)&&!s(r)?r[t]:void 0,c=h?h.enabled:void 0;if(l===void 0)return;if(typeof l=="boolean"){o(i[t])||(i[t]={}),i[t].enabled=l;return}if(l===null&&!o(i[t]))if(n(h))i[t]=oi(h);else return;if(!o(l))return;let u=!0;l.enabled!==void 0?u=l.enabled:c!==void 0&&(u=h.enabled),a(i,e,t),i[t].enabled=u}const UQ={linear(i){return i},easeInQuad(i){return i*i},easeOutQuad(i){return i*(2-i)},easeInOutQuad(i){return i<.5?2*i*i:-1+(4-2*i)*i},easeInCubic(i){return i*i*i},easeOutCubic(i){return--i*i*i+1},easeInOutCubic(i){return i<.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1},easeInQuart(i){return i*i*i*i},easeOutQuart(i){return 1- --i*i*i*i},easeInOutQuart(i){return i<.5?8*i*i*i*i:1-8*--i*i*i*i},easeInQuint(i){return i*i*i*i*i},easeOutQuint(i){return 1+--i*i*i*i*i},easeInOutQuint(i){return i<.5?16*i*i*i*i*i:1+16*--i*i*i*i*i}};function $r(i,e){let t;ce(e)||(e=[e]);for(const r of i)if(r){t=r[e[0]];for(let n=1;n<e.length;n++)t&&(t=t[e[n]]);if(typeof t<"u")break}return t}const KQ={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 GQ=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.pixelRatio=e,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=()=>{},this.closeCallback=()=>{},this._create()}insertTo(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(e){if(typeof e=="function")this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}setCloseCallback(e){if(typeof e=="function")this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}_isColorString(e){if(typeof e=="string")return KQ[e]}setColor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==="none")return;let r;const n=this._isColorString(e);if(n!==void 0&&(e=n),Qi(e)===!0){if(I_(e)===!0){const o=e.substr(4).substr(0,e.length-5).split(",");r={r:o[0],g:o[1],b:o[2],a:1}}else if(VQ(e)===!0){const o=e.substr(5).substr(0,e.length-6).split(",");r={r:o[0],g:o[1],b:o[2],a:o[3]}}else if(T_(e)===!0){const o=Rf(e);r={r:o.r,g:o.g,b:o.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){const o=e.a!==void 0?e.a:"1.0";r={r:e.r,g:e.g,b:e.b,a:o}}if(r===void 0)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+gs(e));this._setColor(r,t)}show(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0&&(this.previousColor=Ee({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",nr(()=>{this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0)},0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){this.previousColor!==void 0?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)===!0&&(this.initialColor=Ee({},e)),this.color=e;const r=Zn(e.r,e.g,e.b),n=2*Math.PI,o=this.r*r.s,s=this.centerCoordinates.x+o*Math.sin(n*r.h),a=this.centerCoordinates.y+o*Math.cos(n*r.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=a-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}_setOpacity(e){this.color.a=e/100,this._updatePicker(this.color)}_setBrightness(e){const t=Zn(this.color.r,this.color.g,this.color.b);t.v=e/100;const r=wa(t.h,t.s,t.v);r.a=this.color.a,this.color=r,this._updatePicker()}_updatePicker(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color;const t=Zn(e.r,e.g,e.b),r=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1)),r.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const n=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;r.clearRect(0,0,n,o),r.putImageData(this.hueCircle,0,0),r.fillStyle="rgba(0,0,0,"+(1-t.v)+")",r.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),ys(r).call(r),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){var e,t,r,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 s=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const s=document.createElement("DIV");s.style.color="red",s.style.fontWeight="bold",s.style.padding="10px",s.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(s)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch{}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch{}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);const 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=_(e=this._hide).call(e,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=_(t=this._apply).call(t,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=_(r=this._save).call(r,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=_(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 kf(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",e=>{e.isFirst&&this._moveSelector(e)}),this.hammer.on("tap",e=>{this._moveSelector(e)}),this.hammer.on("panstart",e=>{this._moveSelector(e)}),this.hammer.on("panmove",e=>{this._moveSelector(e)}),this.hammer.on("panend",e=>{this._moveSelector(e)})}_generateHueCircle(){if(this.generated===!1){const e=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const t=this.colorPickerCanvas.clientWidth,r=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,r);let n,o,s,a;this.centerCoordinates={x:t*.5,y:r*.5},this.r=.49*t;const l=2*Math.PI/360,d=1/360,h=1/this.r;let c;for(s=0;s<360;s++)for(a=0;a<this.r;a++)n=this.centerCoordinates.x+a*Math.sin(l*s),o=this.centerCoordinates.y+a*Math.cos(l*s),c=wa(s*d,a*h,1),e.fillStyle="rgb("+c.r+","+c.g+","+c.b+")",e.fillRect(n-.5,o-.5,2,2);e.strokeStyle="rgba(0,0,0,1)",e.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),e.stroke(),this.hueCircle=e.getImageData(0,0,t,r)}this.generated=!0}_moveSelector(e){const t=this.colorPickerDiv.getBoundingClientRect(),r=e.center.x-t.left,n=e.center.y-t.top,o=.5*this.colorPickerDiv.clientHeight,s=.5*this.colorPickerDiv.clientWidth,a=r-s,l=n-o,d=Math.atan2(a,l),h=.98*Math.min(Math.sqrt(a*a+l*l),s),c=Math.cos(d)*h+o,u=Math.sin(d)*h+s;this.colorPickerSelector.style.top=c-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=u-.5*this.colorPickerSelector.clientWidth+"px";let f=d/(2*Math.PI);f=f<0?f+1:f;const v=h/this.r,y=Zn(this.color.r,this.color.g,this.color.b);y.h=f,y.s=v;const g=wa(y.h,y.s,y.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 yu(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];if(e.length<1)throw new TypeError("Invalid arguments.");if(e.length===1)return document.createTextNode(e[0]);{const r=document.createElement(e[0]);return r.appendChild(yu(...jt(e).call(e,1))),r}}let YQ=class{constructor(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:()=>!1;this.parent=e,this.changedOptions=[],this.container=t,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},Ee(this.options,this.defaultOptions),this.configureOptions=r,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new GQ(n),this.wrapper=void 0}setOptions(e){if(e!==void 0){this.popupHistory={},this._removePopup();let t=!0;if(typeof e=="string")this.options.filter=e;else if(ce(e))this.options.filter=e.join();else if(typeof e=="object"){if(e==null)throw new TypeError("options cannot be null");e.container!==void 0&&(this.options.container=e.container),ot(e)!==void 0&&(this.options.filter=ot(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(t=e.enabled)}else typeof e=="boolean"?(this.options.filter=!0,t=e):typeof e=="function"&&(this.options.filter=e,t=!0);ot(this.options)===!1&&(t=!1),this.options.enabled=t}this._clean()}setModuleOptions(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];const e=ot(this.options);let t=0,r=!1;for(const n in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,n)&&(this.allowCreation=!1,r=!1,typeof e=="function"?(r=e(n,[]),r=r||this._handleObject(this.configureOptions[n],[n],!0)):(e===!0||q(e).call(e,n)!==-1)&&(r=!0),r!==!1&&(this.allowCreation=!0,t>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),t++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let e=0;e<this.domElements.length;e++)this.wrapper.appendChild(this.domElements[e]);this._showPopupIfNeeded()}_clean(){for(let e=0;e<this.domElements.length;e++)this.wrapper.removeChild(this.domElements[e]);this.wrapper!==void 0&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}_getValue(e){let t=this.moduleOptions;for(let r=0;r<e.length;r++)if(t[e[r]]!==void 0)t=t[e[r]];else{t=void 0;break}return t}_makeItem(e){if(this.allowCreation===!0){const o=document.createElement("div");o.className="vis-configuration vis-config-item vis-config-s"+e.length;for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return Z(r).call(r,s=>{o.appendChild(s)}),this.domElements.push(o),this.domElements.length}return 0}_makeHeader(e){const t=document.createElement("div");t.className="vis-configuration vis-config-header",t.innerText=e,this._makeItem([],t)}_makeLabel(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const n=document.createElement("div");if(n.className="vis-configuration vis-config-label vis-config-s"+t.length,r===!0){for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(yu("i","b",e))}else n.innerText=e+":";return n}_makeDropdown(e,t,r){const n=document.createElement("select");n.className="vis-configuration vis-config-select";let o=0;t!==void 0&&q(e).call(e,t)!==-1&&(o=q(e).call(e,t));for(let l=0;l<e.length;l++){const d=document.createElement("option");d.value=e[l],l===o&&(d.selected="selected"),d.innerText=e[l],n.appendChild(d)}const s=this;n.onchange=function(){s._update(this.value,r)};const a=this._makeLabel(r[r.length-1],r);this._makeItem(r,a,n)}_makeRange(e,t,r){const n=e[0],o=e[1],s=e[2],a=e[3],l=document.createElement("input");l.className="vis-configuration vis-config-range";try{l.type="range",l.min=o,l.max=s}catch{}l.step=a;let d="",h=0;t!==void 0?(t<0&&t*1.2<o?(l.min=Math.ceil(t*1.2),h=l.min,d="range increased"):t/1.2<o&&(l.min=Math.ceil(t/1.2),h=l.min,d="range increased"),t*1.2>s&&s!==1&&(l.max=Math.ceil(t*1.2),h=l.max,d="range increased"),l.value=t):l.value=n;const c=document.createElement("input");c.className="vis-configuration vis-config-rangeinput",c.value=l.value;const u=this;l.onchange=function(){c.value=this.value,u._update(Number(this.value),r)},l.oninput=function(){c.value=this.value};const f=this._makeLabel(r[r.length-1],r),v=this._makeItem(r,f,l,c);d!==""&&this.popupHistory[v]!==h&&(this.popupHistory[v]=h,this._setupPopup(d,v))}_makeButton(){if(this.options.showButton===!0){const e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerText="generate options",e.onclick=()=>{this._printOptions()},e.onmouseover=()=>{e.className="vis-configuration vis-config-button hover"},e.onmouseout=()=>{e.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(e)}}_setupPopup(e,t){if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){const r=document.createElement("div");r.id="vis-configuration-popup",r.className="vis-configuration-popup",r.innerText=e,r.onclick=()=>{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:r,index:t}}}_removePopup(){this.popupDiv.html!==void 0&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(this.popupDiv.html!==void 0){const t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=nr(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=nr(()=>{this._removePopup()},1800)}}_makeCheckbox(e,t,r){const n=document.createElement("input");n.type="checkbox",n.className="vis-configuration vis-config-checkbox",n.checked=e,t!==void 0&&(n.checked=t,t!==e&&(typeof e=="object"?t!==e.enabled&&this.changedOptions.push({path:r,value:t}):this.changedOptions.push({path:r,value:t})));const o=this;n.onchange=function(){o._update(this.checked,r)};const s=this._makeLabel(r[r.length-1],r);this._makeItem(r,s,n)}_makeTextInput(e,t,r){const n=document.createElement("input");n.type="text",n.className="vis-configuration vis-config-text",n.value=t,t!==e&&this.changedOptions.push({path:r,value:t});const o=this;n.onchange=function(){o._update(this.value,r)};const s=this._makeLabel(r[r.length-1],r);this._makeItem(r,s,n)}_makeColorField(e,t,r){const n=e[1],o=document.createElement("div");t=t===void 0?n:t,t!=="none"?(o.className="vis-configuration vis-config-colorBlock",o.style.backgroundColor=t):o.className="vis-configuration vis-config-colorBlock none",t=t===void 0?n:t,o.onclick=()=>{this._showColorPicker(t,o,r)};const s=this._makeLabel(r[r.length-1],r);this._makeItem(r,s,o)}_showColorPicker(e,t,r){t.onclick=function(){},this.colorPicker.insertTo(t),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(n=>{const o="rgba("+n.r+","+n.g+","+n.b+","+n.a+")";t.style.backgroundColor=o,this._update(o,r)}),this.colorPicker.setCloseCallback(()=>{t.onclick=()=>{this._showColorPicker(e,t,r)}})}_handleObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=!1;const o=ot(this.options);let s=!1;for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){n=!0;const l=e[a],d=qa(t,a);if(typeof o=="function"&&(n=o(a,t),n===!1&&!ce(l)&&typeof l!="string"&&typeof l!="boolean"&&l instanceof Object&&(this.allowCreation=!1,n=this._handleObject(l,d,!0),this.allowCreation=r===!1)),n!==!1){s=!0;const h=this._getValue(d);if(ce(l))this._handleArray(l,h,d);else if(typeof l=="string")this._makeTextInput(l,h,d);else if(typeof l=="boolean")this._makeCheckbox(l,h,d);else if(l instanceof Object){if(!this.hideOption(t,a,this.moduleOptions))if(l.enabled!==void 0){const c=qa(d,"enabled"),u=this._getValue(c);if(u===!0){const f=this._makeLabel(a,d,!0);this._makeItem(d,f),s=this._handleObject(l,d)||s}else this._makeCheckbox(l,u,d)}else{const c=this._makeLabel(a,d,!0);this._makeItem(d,c),s=this._handleObject(l,d)||s}}else console.error("dont know how to handle",l,a,d)}}return s}_handleArray(e,t,r){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,t,r),e[1]!==t&&this.changedOptions.push({path:r,value:t})):typeof e[0]=="string"?(this._makeDropdown(e,t,r),e[0]!==t&&this.changedOptions.push({path:r,value:t})):typeof e[0]=="number"&&(this._makeRange(e,t,r),e[0]!==t&&this.changedOptions.push({path:r,value:Number(t)}))}_update(e,t){const r=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",r),this.initialized=!0,this.parent.setOptions(r)}_constructOptions(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=r;e=e==="true"?!0:e,e=e==="false"?!1:e;for(let o=0;o<t.length;o++)t[o]!=="global"&&(n[t[o]]===void 0&&(n[t[o]]={}),o!==t.length-1?n=n[t[o]]:n[t[o]]=e);return r}_printOptions(){const e=this.getOptions();for(;this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(yu("pre","const options = "+gs(e,null,2)))}getOptions(){const e={};for(let t=0;t<this.changedOptions.length;t++)this._constructOptions(this.changedOptions[t].value,this.changedOptions[t].path,e);return e}},qQ=class{constructor(e,t){this.container=e,this.overflowMethod=t||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}setPosition(e,t){this.x=Pt(e),this.y=Pt(t)}setText(e){if(e instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(e)}else this.frame.innerText=e}show(e){if(e===void 0&&(e=!0),e===!0){const t=this.frame.clientHeight,r=this.frame.clientWidth,n=this.frame.parentNode.clientHeight,o=this.frame.parentNode.clientWidth;let s=0,a=0;if(this.overflowMethod=="flip"){let l=!1,d=!0;this.y-t<this.padding&&(d=!1),this.x+r>o-this.padding&&(l=!0),l?s=this.x-r:s=this.x,d?a=this.y-t:a=this.y}else a=this.y-t,a+t+this.padding>n&&(a=n-t-this.padding),a<this.padding&&(a=this.padding),s=this.x,s+r+this.padding>o&&(s=o-r-this.padding),s<this.padding&&(s=this.padding);this.frame.style.left=s+"px",this.frame.style.top=a+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}hide(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}destroy(){this.frame.parentNode.removeChild(this.frame)}},Un=!1,Nm;const mu="background: #FFeeee; color: #dd0000";let XQ=class de{static validate(e,t,r){Un=!1,Nm=t;let n=t;return r!==void 0&&(n=t[r]),de.parse(e,n,[]),Un}static parse(e,t,r){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&de.check(n,e,t,r)}static check(e,t,r,n){if(r[e]===void 0&&r.__any__===void 0){de.getSuggestion(e,r,n);return}let o=e,s=!0;r[e]===void 0&&r.__any__!==void 0&&(o="__any__",s=de.getType(t[e])==="object");let a=r[o];s&&a.__type__!==void 0&&(a=a.__type__),de.checkFields(e,t,r,o,a,n)}static checkFields(e,t,r,n,o,s){const a=function(h){console.error("%c"+h+de.printLocation(s,e),mu)},l=de.getType(t[e]),d=o[l];d!==void 0?de.getType(d)==="array"&&q(d).call(d,t[e])===-1?(a('Invalid option detected in "'+e+'". Allowed values are:'+de.print(d)+' not "'+t[e]+'". '),Un=!0):l==="object"&&n!=="__any__"&&(s=qa(s,e),de.parse(t[e],r[n],s)):o.any===void 0&&(a('Invalid type received for "'+e+'". Expected: '+de.print(he(o))+". Received ["+l+'] "'+t[e]+'"'),Un=!0)}static getType(e){const t=typeof e;return t==="object"?e===null?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":ce(e)?"array":e instanceof Date?"date":e.nodeType!==void 0?"dom":e._isAMomentObject===!0?"moment":"object":t==="number"?"number":t==="boolean"?"boolean":t==="string"?"string":t===void 0?"undefined":t}static getSuggestion(e,t,r){const n=de.findInOptions(e,t,r,!1),o=de.findInOptions(e,Nm,[],!0),s=8,a=4;let l;n.indexMatch!==void 0?l=" in "+de.printLocation(n.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+n.indexMatch+`"?
70
+
71
+ `:o.distance<=a&&n.distance>o.distance?l=" in "+de.printLocation(n.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+de.printLocation(o.path,o.closestMatch,""):n.distance<=s?l='. Did you mean "'+n.closestMatch+'"?'+de.printLocation(n.path,e):l=". Did you mean one of these: "+de.print(he(t))+de.printLocation(r,e),console.error('%cUnknown option detected: "'+e+'"'+l,mu),Un=!0}static findInOptions(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=1e9,s="",a=[];const l=e.toLowerCase();let d;for(const c in t){let u;if(t[c].__type__!==void 0&&n===!0){const f=de.findInOptions(e,t[c],qa(r,c));o>f.distance&&(s=f.closestMatch,a=f.path,o=f.distance,d=f.indexMatch)}else{var h;q(h=c.toLowerCase()).call(h,l)!==-1&&(d=c),u=de.levenshteinDistance(e,c),o>u&&(s=c,a=jQ(r),o=u)}}return{closestMatch:s,path:a,distance:o,indexMatch:d}}static printLocation(e,t){let n=`
72
+
73
+ `+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:`Problem value found at:
74
+ `)+`options = {
75
+ `;for(let o=0;o<e.length;o++){for(let s=0;s<o+1;s++)n+=" ";n+=e[o]+`: {
76
+ `}for(let o=0;o<e.length+1;o++)n+=" ";n+=t+`
77
+ `;for(let o=0;o<e.length+1;o++){for(let s=0;s<e.length-o;s++)n+=" ";n+=`}
78
+ `}return n+`
79
+
80
+ `}static print(e){return gs(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;const r=[];let n;for(n=0;n<=t.length;n++)r[n]=[n];let o;for(o=0;o<=e.length;o++)r[0][o]=o;for(n=1;n<=t.length;n++)for(o=1;o<=e.length;o++)t.charAt(n-1)==e.charAt(o-1)?r[n][o]=r[n-1][o-1]:r[n][o]=Math.min(r[n-1][o-1]+1,Math.min(r[n][o-1]+1,r[n-1][o]+1));return r[t.length][e.length]}};const ZQ=Wt,JQ=YQ,en=kf,QQ=qQ,P_=mu,eee=XQ;function tee(i){return _r=i,oee()}var C_={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},Nf=oi(C_);Nf.color="color.color";Nf.style="dashes";var Ke={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},Fm={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},_r="",yn=0,z="",k="",tt=Ke.NULL;function ree(){yn=0,z=_r.charAt(0)}function Ce(){yn++,z=_r.charAt(yn)}function Li(){return _r.charAt(yn+1)}function Bm(i){var e=i.charCodeAt(0);return e<47?e===35||e===46:e<59?e>47:e<91?e>64:e<96?e===95:e<123?e>96:!1}function kr(i,e){if(i||(i={}),e)for(var t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return i}function iee(i,e,t){for(var r=e.split("."),n=i;r.length;){var o=r.shift();r.length?(n[o]||(n[o]={}),n=n[o]):n[o]=t}}function x_(i,e){for(var t,r,n=null,o=[i],s=i;s.parent;)o.push(s.parent),s=s.parent;if(s.nodes){for(t=0,r=s.nodes.length;t<r;t++)if(e.id===s.nodes[t].id){n=s.nodes[t];break}}for(n||(n={id:e.id},i.node&&(n.attr=kr(n.attr,i.node))),t=o.length-1;t>=0;t--){var a,l=o[t];l.nodes||(l.nodes=[]),q(a=l.nodes).call(a,n)===-1&&l.nodes.push(n)}e.attr&&(n.attr=kr(n.attr,e.attr))}function nee(i,e){if(i.edges||(i.edges=[]),i.edges.push(e),i.edge){var t=kr({},i.edge);e.attr=kr(t,e.attr)}}function A_(i,e,t,r,n){var o={from:e,to:t,type:r};return i.edge&&(o.attr=kr({},i.edge)),o.attr=kr(o.attr||{},n),n!=null&&n.hasOwnProperty("arrows")&&n.arrows!=null&&(o.arrows={to:{enabled:!0,type:n.arrows.type}},n.arrows=null),o}function ee(){for(tt=Ke.NULL,k="";z===" "||z===" "||z===`
81
+ `||z==="\r";)Ce();do{var i=!1;if(z==="#"){for(var e=yn-1;_r.charAt(e)===" "||_r.charAt(e)===" ";)e--;if(_r.charAt(e)===`
82
+ `||_r.charAt(e)===""){for(;z!=""&&z!=`
83
+ `;)Ce();i=!0}}if(z==="/"&&Li()==="/"){for(;z!=""&&z!=`
84
+ `;)Ce();i=!0}if(z==="/"&&Li()==="*"){for(;z!="";)if(z==="*"&&Li()==="/"){Ce(),Ce();break}else Ce();i=!0}for(;z===" "||z===" "||z===`
85
+ `||z==="\r";)Ce()}while(i);if(z===""){tt=Ke.DELIMITER;return}var t=z+Li();if(Fm[t]){tt=Ke.DELIMITER,k=t,Ce(),Ce();return}if(Fm[z]){tt=Ke.DELIMITER,k=z,Ce();return}if(Bm(z)||z==="-"){for(k+=z,Ce();Bm(z);)k+=z,Ce();k==="false"?k=!1:k==="true"?k=!0:isNaN(Number(k))||(k=Number(k)),tt=Ke.IDENTIFIER;return}if(z==='"'){for(Ce();z!=""&&(z!='"'||z==='"'&&Li()==='"');)z==='"'?(k+=z,Ce()):z==="\\"&&Li()==="n"?(k+=`
86
+ `,Ce()):k+=z,Ce();if(z!='"')throw Ge('End of string " expected');Ce(),tt=Ke.IDENTIFIER;return}for(tt=Ke.UNKNOWN;z!="";)k+=z,Ce();throw new SyntaxError('Syntax error in part "'+R_(k,30)+'"')}function oee(){var i={};if(ree(),ee(),k==="strict"&&(i.strict=!0,ee()),(k==="graph"||k==="digraph")&&(i.type=k,ee()),tt===Ke.IDENTIFIER&&(i.id=k,ee()),k!="{")throw Ge("Angle bracket { expected");if(ee(),D_(i),k!="}")throw Ge("Angle bracket } expected");if(ee(),k!=="")throw Ge("End of file expected");return ee(),delete i.node,delete i.edge,delete i.graph,i}function D_(i){for(;k!==""&&k!="}";)see(i),k===";"&&ee()}function see(i){var e=M_(i);if(e){k_(i,e);return}var t=aee(i);if(!t){if(tt!=Ke.IDENTIFIER)throw Ge("Identifier expected");var r=k;if(ee(),k==="="){if(ee(),tt!=Ke.IDENTIFIER)throw Ge("Identifier expected");i[r]=k,ee()}else lee(i,r)}}function M_(i){var e=null;if(k==="subgraph"&&(e={},e.type="subgraph",ee(),tt===Ke.IDENTIFIER&&(e.id=k,ee())),k==="{"){if(ee(),e||(e={}),e.parent=i,e.node=i.node,e.edge=i.edge,e.graph=i.graph,D_(e),k!="}")throw Ge("Angle bracket } expected");ee(),delete e.node,delete e.edge,delete e.graph,delete e.parent,i.subgraphs||(i.subgraphs=[]),i.subgraphs.push(e)}return e}function aee(i){return k==="node"?(ee(),i.node=so(),"node"):k==="edge"?(ee(),i.edge=so(),"edge"):k==="graph"?(ee(),i.graph=so(),"graph"):null}function lee(i,e){var t={id:e},r=so();r&&(t.attr=r),x_(i,t),k_(i,e)}function k_(i,e){for(;k==="->"||k==="--";){var t,r=k;ee();var n=M_(i);if(n)t=n;else{if(tt!=Ke.IDENTIFIER)throw Ge("Identifier or subgraph expected");t=k,x_(i,{id:t}),ee()}var o=so(),s=A_(i,e,t,r,o);nee(i,s),e=t}}function so(){for(var i,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},r={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},n=new Array,o=new Array;k==="[";){for(ee(),e={};k!==""&&k!="]";){if(tt!=Ke.IDENTIFIER)throw Ge("Attribute name expected");var s=k;if(ee(),k!="=")throw Ge("Equal sign = expected");if(ee(),tt!=Ke.IDENTIFIER)throw Ge("Attribute value expected");var a=k;s==="style"&&(a=t[a]);var l;s==="arrowhead"&&(l=r[a],s="arrows",a={to:{enabled:!0,type:l}}),s==="arrowtail"&&(l=r[a],s="arrows",a={from:{enabled:!0,type:l}}),n.push({attr:e,name:s,value:a}),o.push(s),ee(),k==","&&ee()}if(k!="]")throw Ge("Bracket ] expected");ee()}if(Cr(o).call(o,"dir")){var d={};for(d.arrows={},i=0;i<n.length;i++)if(n[i].name==="arrows")if(n[i].value.to!=null)d.arrows.to=i;else if(n[i].value.from!=null)d.arrows.from=i;else throw Ge("Invalid value of arrows");else n[i].name==="dir"&&(d.dir=i);var h=n[d.dir].value;if(!Cr(o).call(o,"arrows"))if(h==="both")n.push({attr:n[d.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),d.arrows.to=n.length-1,n.push({attr:n[d.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),d.arrows.from=n.length-1;else if(h==="forward")n.push({attr:n[d.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),d.arrows.to=n.length-1;else if(h==="back")n.push({attr:n[d.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),d.arrows.from=n.length-1;else if(h==="none")n.push({attr:n[d.dir].attr,name:"arrows",value:""}),d.arrows.to=n.length-1;else throw Ge('Invalid dir type "'+h+'"');var c,u;if(h==="both")d.arrows.to&&d.arrows.from?(u=n[d.arrows.to].value.to.type,c=n[d.arrows.from].value.from.type,n[d.arrows.to]={attr:n[d.arrows.to].attr,name:n[d.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}},ir(n).call(n,d.arrows.from,1)):d.arrows.to?(u=n[d.arrows.to].value.to.type,c="arrow",n[d.arrows.to]={attr:n[d.arrows.to].attr,name:n[d.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):d.arrows.from&&(u="arrow",c=n[d.arrows.from].value.from.type,n[d.arrows.from]={attr:n[d.arrows.from].attr,name:n[d.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}});else if(h==="back")d.arrows.to&&d.arrows.from?(u="",c=n[d.arrows.from].value.from.type,n[d.arrows.from]={attr:n[d.arrows.from].attr,name:n[d.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):d.arrows.to?(u="",c="arrow",d.arrows.from=d.arrows.to,n[d.arrows.from]={attr:n[d.arrows.from].attr,name:n[d.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):d.arrows.from&&(u="",c=n[d.arrows.from].value.from.type,n[d.arrows.to]={attr:n[d.arrows.from].attr,name:n[d.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}),n[d.arrows.from]={attr:n[d.arrows.from].attr,name:n[d.arrows.from].name,value:{from:{enabled:!0,type:n[d.arrows.from].value.from.type}}};else if(h==="none"){var f;d.arrows.to?f=d.arrows.to:f=d.arrows.from,n[f]={attr:n[f].attr,name:n[f].name,value:""}}else if(h==="forward")d.arrows.to&&d.arrows.from?(u=n[d.arrows.to].value.to.type,c="",n[d.arrows.to]={attr:n[d.arrows.to].attr,name:n[d.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):d.arrows.to?(u=n[d.arrows.to].value.to.type,c="",n[d.arrows.to]={attr:n[d.arrows.to].attr,name:n[d.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):d.arrows.from&&(u="arrow",c="",d.arrows.to=d.arrows.from,n[d.arrows.to]={attr:n[d.arrows.to].attr,name:n[d.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}),n[d.arrows.to]={attr:n[d.arrows.to].attr,name:n[d.arrows.to].name,value:{to:{enabled:!0,type:n[d.arrows.to].value.to.type}}};else throw Ge('Invalid dir type "'+h+'"');ir(n).call(n,d.dir,1)}var v;if(Cr(o).call(o,"penwidth")){var y=[];for(v=n.length,i=0;i<v;i++)n[i].name!=="width"&&(n[i].name==="penwidth"&&(n[i].name="width"),y.push(n[i]));n=y}for(v=n.length,i=0;i<v;i++)iee(n[i].attr,n[i].name,n[i].value);return e}function Ge(i){return new SyntaxError(i+', got "'+R_(k,30)+'" (char '+yn+")")}function R_(i,e){return i.length<=e?i:i.substr(0,27)+"..."}function dee(i,e,t){ce(i)?Z(i).call(i,function(r){ce(e)?Z(e).call(e,function(n){t(r,n)}):t(r,e)}):ce(e)?Z(e).call(e,function(r){t(i,r)}):t(i,e)}function rc(i,e,t){for(var r=e.split("."),n=r.pop(),o=i,s=0;s<r.length;s++){var a=r[s];a in o||(o[a]={}),o=o[a]}return o[n]=t,i}function Lm(i,e){var t={};for(var r in i)if(i.hasOwnProperty(r)){var n=e[r];ce(n)?Z(n).call(n,function(o){rc(t,o,i[r])}):typeof n=="string"?rc(t,n,i[r]):rc(t,r,i[r])}return t}function hee(i){var e=tee(i),t={nodes:[],edges:[],options:{}};if(e.nodes){var r;Z(r=e.nodes).call(r,function(s){var a={id:s.id,label:String(s.label||s.id)};kr(a,Lm(s.attr,C_)),a.image&&(a.shape="image"),t.nodes.push(a)})}if(e.edges){var n,o=function(s){var a={from:s.from,to:s.to};return kr(a,Lm(s.attr,Nf)),a.arrows==null&&s.type==="->"&&(a.arrows="to"),a};Z(n=e.edges).call(n,function(s){var a,l;if(s.from instanceof Object?a=s.from.nodes:a={id:s.from},s.to instanceof Object?l=s.to.nodes:l={id:s.to},s.from instanceof Object&&s.from.edges){var d;Z(d=s.from.edges).call(d,function(c){var u=o(c);t.edges.push(u)})}if(dee(a,l,function(c,u){var f=A_(t,c.id,u.id,s.type,s.attr),v=o(f);t.edges.push(v)}),s.to instanceof Object&&s.to.edges){var h;Z(h=s.to.edges).call(h,function(c){var u=o(c);t.edges.push(u)})}})}return e.attr&&(t.options=e.attr),t}function cee(i,e){var t;const r={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};e!=null&&(e.fixed!=null&&(r.nodes.fixed=e.fixed),e.parseColor!=null&&(r.nodes.parseColor=e.parseColor),e.inheritColor!=null&&(r.edges.inheritColor=e.inheritColor));const n=i.edges,o=fn(n).call(n,a=>{const l={from:a.source,id:a.id,to:a.target};return a.attributes!=null&&(l.attributes=a.attributes),a.label!=null&&(l.label=a.label),a.attributes!=null&&a.attributes.title!=null&&(l.title=a.attributes.title),a.type==="Directed"&&(l.arrows="to"),a.color&&r.edges.inheritColor===!1&&(l.color=a.color),l});return{nodes:fn(t=i.nodes).call(t,a=>{const l={id:a.id,fixed:r.nodes.fixed&&a.x!=null&&a.y!=null};return a.attributes!=null&&(l.attributes=a.attributes),a.label!=null&&(l.label=a.label),a.size!=null&&(l.size=a.size),a.attributes!=null&&a.attributes.title!=null&&(l.title=a.attributes.title),a.title!=null&&(l.title=a.title),a.x!=null&&(l.x=a.x),a.y!=null&&(l.y=a.y),a.color!=null&&(r.nodes.parseColor===!0?l.color=a.color:l.color={background:a.color,border:a.color,highlight:{background:a.color,border:a.color},hover:{background:a.color,border:a.color}}),l}),edges:o}}const uee={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"},fee={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"},vee={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"},pee={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"},gee={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"},yee={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ó"},mee={addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},bee={addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},$ee={addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"},wee={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"},Eee={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"};var _ee=Object.freeze({__proto__:null,cn:bee,cs:Eee,de:fee,en:uee,es:vee,fr:wee,it:pee,nl:gee,pt:yee,ru:mee,uk:$ee});function See(i,e){try{const[r,n]=e.split(/[-_ /]/,2),o=r!=null?r.toLowerCase():null,s=n!=null?n.toUpperCase():null;if(o&&s){const a=o+"-"+s;if(Object.prototype.hasOwnProperty.call(i,a))return a;var t;console.warn(KX(t="Unknown variant ".concat(s," of language ")).call(t,o,"."))}if(o){const a=o;if(Object.prototype.hasOwnProperty.call(i,a))return a;console.warn("Unknown language ".concat(o))}return console.warn("Unknown locale ".concat(e,", falling back to English.")),"en"}catch(r){return console.error(r),console.warn("Unexpected error while normalizing locale ".concat(e,", falling back to English.")),"en"}}class Oee{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;const e=this.image.width,t=this.image.height;this.width=e,this.height=t;const r=Math.floor(t/2),n=Math.floor(t/4),o=Math.floor(t/8),s=Math.floor(t/16),a=Math.floor(e/2),l=Math.floor(e/4),d=Math.floor(e/8),h=Math.floor(e/16);this.canvas.width=3*l,this.canvas.height=r,this.coordinates=[[0,0,a,r],[a,0,l,n],[a,n,d,o],[5*d,n,h,s]],this._fillMipMap()}initialized(){return this.coordinates!==void 0}_fillMipMap(){const e=this.canvas.getContext("2d"),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(let r=1;r<this.NUM_ITERATIONS;r++){const n=this.coordinates[r-1],o=this.coordinates[r];e.drawImage(this.canvas,n[0],n[1],n[2],n[3],o[0],o[1],o[2],o[3])}}drawImageAtPosition(e,t,r,n,o,s){if(this.initialized())if(t>2){t*=.5;let a=0;for(;t>2&&a<this.NUM_ITERATIONS;)t*=.5,a+=1;a>=this.NUM_ITERATIONS&&(a=this.NUM_ITERATIONS-1);const l=this.coordinates[a];e.drawImage(this.canvas,l[0],l[1],l[2],l[3],r,n,o,s)}else e.drawImage(this.image,r,n,o,s)}}class Tee{constructor(e){this.images={},this.imageBroken={},this.callback=e}_tryloadBrokenUrl(e,t,r){if(!(e===void 0||r===void 0)){if(t===void 0){console.warn("No broken url image defined");return}r.image.onerror=()=>{console.error("Could not load brokenImage:",t)},r.image.src=t}}_redrawWithImage(e){this.callback&&this.callback(e)}load(e,t){const r=this.images[e];if(r)return r;const n=new Oee;return this.images[e]=n,n.image.onload=()=>{this._fixImageCoordinates(n.image),n.init(),this._redrawWithImage(n)},n.image.onerror=()=>{console.error("Could not load image:",e),this._tryloadBrokenUrl(e,t,n)},n.image.src=e,n}_fixImageCoordinates(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}var N_={exports:{}},Iee=U,Pee=Iee(function(){if(typeof ArrayBuffer=="function"){var i=new ArrayBuffer(8);Object.isExtensible(i)&&Object.defineProperty(i,"a",{value:8})}}),Cee=U,xee=We,Aee=vr,jm=Pee,Ea=Object.isExtensible,Dee=Cee(function(){Ea(1)}),Mee=Dee||jm?function(e){return!xee(e)||jm&&Aee(e)==="ArrayBuffer"?!1:Ea?Ea(e):!0}:Ea,kee=U,F_=!kee(function(){return Object.isExtensible(Object.preventExtensions({}))}),Ree=N,Nee=K,Fee=os,Bee=We,Ff=je,Lee=gt.f,zm=cs,jee=Ll,Bf=Mee,zee=Dl,Hee=F_,B_=!1,cr=zee("meta"),Wee=0,Lf=function(i){Lee(i,cr,{value:{objectID:"O"+Wee++,weakData:{}}})},Vee=function(i,e){if(!Bee(i))return typeof i=="symbol"?i:(typeof i=="string"?"S":"P")+i;if(!Ff(i,cr)){if(!Bf(i))return"F";if(!e)return"E";Lf(i)}return i[cr].objectID},Uee=function(i,e){if(!Ff(i,cr)){if(!Bf(i))return!0;if(!e)return!1;Lf(i)}return i[cr].weakData},Kee=function(i){return Hee&&B_&&Bf(i)&&!Ff(i,cr)&&Lf(i),i},Gee=function(){Yee.enable=function(){},B_=!0;var i=zm.f,e=Nee([].splice),t={};t[cr]=1,i(t).length&&(zm.f=function(r){for(var n=i(r),o=0,s=n.length;o<s;o++)if(n[o]===cr){e(n,o,1);break}return n},Ree({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:jee.f}))},Yee=N_.exports={enable:Gee,fastKey:Vee,getWeakData:Uee,onFreeze:Kee};Fee[cr]=!0;var Xl=N_.exports,qee=me,Xee=Bn,Zee=qee("iterator"),Jee=Array.prototype,Qee=function(i){return i!==void 0&&(Xee.Array===i||Jee[Zee]===i)},ete=Oi,Hm=cf,tte=Dn,rte=Bn,ite=me,nte=ite("iterator"),L_=function(i){if(!tte(i))return Hm(i,nte)||Hm(i,"@@iterator")||rte[ete(i)]},ote=Mt,ste=kn,ate=pr,lte=rs,dte=L_,hte=TypeError,cte=function(i,e){var t=arguments.length<2?dte(i):e;if(ste(t))return ate(ote(t,i));throw new hte(lte(i)+" is not iterable")},ute=Mt,Wm=pr,fte=cf,vte=function(i,e,t){var r,n;Wm(i);try{if(r=fte(i,"return"),!r){if(e==="throw")throw t;return t}r=ute(r,i)}catch(o){n=!0,r=o}if(e==="throw")throw t;if(n)throw r;return Wm(r),t},pte=kl,gte=Mt,yte=pr,mte=rs,bte=Qee,$te=Yt,Vm=Te,wte=cte,Ete=L_,Um=vte,_te=TypeError,_a=function(i,e){this.stopped=i,this.result=e},Km=_a.prototype,jf=function(i,e,t){var r=t&&t.that,n=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),s=!!(t&&t.IS_ITERATOR),a=!!(t&&t.INTERRUPTED),l=pte(e,r),d,h,c,u,f,v,y,g=function(m){return d&&Um(d,"normal",m),new _a(!0,m)},p=function(m){return n?(yte(m),a?l(m[0],m[1],g):l(m[0],m[1])):a?l(m,g):l(m)};if(o)d=i.iterator;else if(s)d=i;else{if(h=Ete(i),!h)throw new _te(mte(i)+" is not iterable");if(bte(h)){for(c=0,u=$te(i);u>c;c++)if(f=p(i[c]),f&&Vm(Km,f))return f;return new _a(!1)}d=wte(i,h)}for(v=o?i.next:d.next;!(y=gte(v,d)).done;){try{f=p(y.value)}catch(m){Um(d,"throw",m)}if(typeof f=="object"&&f&&Vm(Km,f))return f}return new _a(!1)},Ste=Te,Ote=TypeError,zf=function(i,e){if(Ste(e,i))return i;throw new Ote("Incorrect invocation")},Tte=N,Ite=ve,Pte=Xl,Cte=U,xte=Nn,Ate=jf,Dte=zf,Mte=Le,kte=We,Rte=Dn,Nte=Fn,Fte=gt.f,Bte=zr.forEach,Lte=Ie,j_=Ti,jte=j_.set,zte=j_.getterFor,Hf=function(i,e,t){var r=i.indexOf("Map")!==-1,n=i.indexOf("Weak")!==-1,o=r?"set":"add",s=Ite[i],a=s&&s.prototype,l={},d;if(!Lte||!Mte(s)||!(n||a.forEach&&!Cte(function(){new s().entries().next()})))d=t.getConstructor(e,i,r,o),Pte.enable();else{d=e(function(u,f){jte(Dte(u,h),{type:i,collection:new s}),Rte(f)||Ate(f,u[o],{that:u,AS_ENTRIES:r})});var h=d.prototype,c=zte(i);Bte(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(u){var f=u==="add"||u==="set";u in a&&!(n&&u==="clear")&&xte(h,u,function(v,y){var g=c(this).collection;if(!f&&n&&!kte(v))return u==="get"?void 0:!1;var p=g[u](v===0?0:v,y);return f?this:p})}),n||Fte(h,"size",{configurable:!0,get:function(){return c(this).collection.size}})}return Nte(d,i,!1,!0),l[i]=d,Tte({global:!0,forced:!0},l),n||t.setStrong(d,i,r),d},Hte=us,Wf=function(i,e,t){for(var r in e)t&&t.unsafe&&i[r]?i[r]=e[r]:Hte(i,r,e[r],t);return i},Wte=Rt,Vte=bf,Ute=me,Kte=Ie,Gm=Ute("species"),Gte=function(i){var e=Wte(i);Kte&&e&&!e[Gm]&&Vte(e,Gm,{configurable:!0,get:function(){return this}})},Yte=hs,qte=bf,Ym=Wf,Xte=kl,Zte=zf,Jte=Dn,Qte=jf,ere=Sf,ra=Of,tre=Gte,Kn=Ie,qm=Xl.fastKey,z_=Ti,Xm=z_.set,ic=z_.getterFor,H_={getConstructor:function(i,e,t,r){var n=i(function(d,h){Zte(d,o),Xm(d,{type:e,index:Yte(null),first:void 0,last:void 0,size:0}),Kn||(d.size=0),Jte(h)||Qte(h,d[r],{that:d,AS_ENTRIES:t})}),o=n.prototype,s=ic(e),a=function(d,h,c){var u=s(d),f=l(d,h),v,y;return f?f.value=c:(u.last=f={index:y=qm(h,!0),key:h,value:c,previous:v=u.last,next:void 0,removed:!1},u.first||(u.first=f),v&&(v.next=f),Kn?u.size++:d.size++,y!=="F"&&(u.index[y]=f)),d},l=function(d,h){var c=s(d),u=qm(h),f;if(u!=="F")return c.index[u];for(f=c.first;f;f=f.next)if(f.key===h)return f};return Ym(o,{clear:function(){for(var h=this,c=s(h),u=c.index,f=c.first;f;)f.removed=!0,f.previous&&(f.previous=f.previous.next=void 0),delete u[f.index],f=f.next;c.first=c.last=void 0,Kn?c.size=0:h.size=0},delete:function(d){var h=this,c=s(h),u=l(h,d);if(u){var f=u.next,v=u.previous;delete c.index[u.index],u.removed=!0,v&&(v.next=f),f&&(f.previous=v),c.first===u&&(c.first=f),c.last===u&&(c.last=v),Kn?c.size--:h.size--}return!!u},forEach:function(h){for(var c=s(this),u=Xte(h,arguments.length>1?arguments[1]:void 0),f;f=f?f.next:c.first;)for(u(f.value,f.key,this);f&&f.removed;)f=f.previous},has:function(h){return!!l(this,h)}}),Ym(o,t?{get:function(h){var c=l(this,h);return c&&c.value},set:function(h,c){return a(this,h===0?0:h,c)}}:{add:function(h){return a(this,h=h===0?0:h,h)}}),Kn&&qte(o,"size",{configurable:!0,get:function(){return s(this).size}}),n},setStrong:function(i,e,t){var r=e+" Iterator",n=ic(e),o=ic(r);ere(i,e,function(s,a){Xm(this,{type:r,target:s,state:n(s),kind:a,last:void 0})},function(){for(var s=o(this),a=s.kind,l=s.last;l&&l.removed;)l=l.previous;return!s.target||!(s.last=l=l?l.next:s.state.first)?(s.target=void 0,ra(void 0,!0)):ra(a==="keys"?l.key:a==="values"?l.value:[l.key,l.value],!1)},t?"entries":"values",!t,!0),tre(e)}},rre=Hf,ire=H_;rre("Map",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},ire);var Vf=K,nre=Rl,ore=qt,sre=Jo,are=Vf("".charAt),Zm=Vf("".charCodeAt),lre=Vf("".slice),dre=function(i){return function(e,t){var r=ore(sre(e)),n=nre(t),o=r.length,s,a;return n<0||n>=o?i?"":void 0:(s=Zm(r,n),s<55296||s>56319||n+1===o||(a=Zm(r,n+1))<56320||a>57343?i?are(r,n):s:i?lre(r,n,n+2):(s-55296<<10)+(a-56320)+65536)}},hre={charAt:dre(!0)},cre=hre.charAt,ure=qt,W_=Ti,fre=Sf,Jm=Of,V_="String Iterator",vre=W_.set,pre=W_.getterFor(V_);fre(String,"String",function(i){vre(this,{type:V_,string:ure(i),index:0})},function(){var e=pre(this),t=e.string,r=e.index,n;return r>=t.length?Jm(void 0,!0):(n=cre(t,r),e.index+=n.length,Jm(n,!1))});var gre=X,yre=gre.Map,mre=yre,bre=mre,$re=bre,Uf=B($re);class wre{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},Ee(this.options,this.defaultOptions)}setOptions(e){const t=["useDefaultGroups"];if(e!==void 0){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&q(t).call(t,r)===-1){const n=e[r];this.add(r,n)}}}clear(){this._groups=new Uf,this._groupNames=[]}get(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this._groups.get(e);if(r===void 0&&t)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){const n=this._groupIndex%this._groupNames.length;++this._groupIndex,r={},r.color=this._groups.get(this._groupNames[n]),this._groups.set(e,r)}else{const n=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,r={},r.color=this._defaultGroups[n],this._groups.set(e,r)}return r}add(e,t){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,t),t}}var Ere=N;Ere({target:"Number",stat:!0},{isNaN:function(e){return e!==e}});var _re=X,Sre=_re.Number.isNaN,Ore=Sre,Tre=Ore,Ire=Tre,bu=B(Ire),Pre=ve,Cre=Pre.isFinite,xre=Number.isFinite||function(e){return typeof e=="number"&&Cre(e)},Are=N,Dre=xre;Are({target:"Number",stat:!0},{isFinite:Dre});var Mre=X,kre=Mre.Number.isFinite,Rre=kre,Nre=Rre,Fre=Nre,Zr=B(Fre),Bre=N,Lre=zr.some,jre=Ln,zre=jre("some");Bre({target:"Array",proto:!0,forced:!zre},{some:function(e){return Lre(this,e,arguments.length>1?arguments[1]:void 0)}});var Hre=ze,Wre=Hre("Array").some,Vre=Te,Ure=Wre,nc=Array.prototype,Kre=function(i){var e=i.some;return i===nc||Vre(nc,i)&&e===nc.some?Ure:e},Gre=Kre,Yre=Gre,qre=Yre,Xre=B(qre),U_={exports:{}},Zre=N,Jre=Ie,Qm=gt.f;Zre({target:"Object",stat:!0,forced:Object.defineProperty!==Qm,sham:!Jre},{defineProperty:Qm});var Qre=X,K_=Qre.Object,eie=U_.exports=function(e,t,r){return K_.defineProperty(e,t,r)};K_.defineProperty.sham&&(eie.sham=!0);var tie=U_.exports,rie=tie,G_=rie,iie=G_,nie=iie,oie=nie,sie=oie,aie=sie,lie=B(aie),die=me,hie=gt.f,eb=die("metadata"),tb=Function.prototype;tb[eb]===void 0&&hie(tb,eb,{value:null});var cie=pe;cie("asyncDispose");var uie=pe;uie("dispose");var fie=pe;fie("metadata");var vie=BE,pie=vie,gie=Rt,yie=K,Kf=gie("Symbol"),mie=Kf.keyFor,bie=yie(Kf.prototype.valueOf),Y_=Kf.isRegisteredSymbol||function(e){try{return mie(bie(e))!==void 0}catch{return!1}},$ie=N,wie=Y_;$ie({target:"Symbol",stat:!0},{isRegisteredSymbol:wie});var Eie=Rn,q_=Rt,_ie=K,Sie=ts,Oie=me,Xa=q_("Symbol"),rb=Xa.isWellKnownSymbol,X_=q_("Object","getOwnPropertyNames"),Tie=_ie(Xa.prototype.valueOf),ib=Eie("wks");for(var oc=0,nb=X_(Xa),Iie=nb.length;oc<Iie;oc++)try{var ob=nb[oc];Sie(Xa[ob])&&Oie(ob)}catch{}var Z_=function(e){if(rb&&rb(e))return!0;try{for(var t=Tie(e),r=0,n=X_(ib),o=n.length;r<o;r++)if(ib[n[r]]==t)return!0}catch{}return!1},Pie=N,Cie=Z_;Pie({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:Cie});var xie=pe;xie("matcher");var Aie=pe;Aie("observable");var Die=N,Mie=Y_;Die({target:"Symbol",stat:!0},{isRegistered:Mie});var kie=N,Rie=Z_;kie({target:"Symbol",stat:!0,forced:!0},{isWellKnown:Rie});var Nie=pe;Nie("metadataKey");var Fie=pe;Fie("patternMatch");var Bie=pe;Bie("replaceAll");var Lie=pie,jie=Lie,zie=jie,ia=B(zie),Hie=fs,Wie=Hie.f("iterator"),Vie=Wie,Uie=Vie,Kie=Uie,Gie=Kie,Yie=Gie,qie=Yie,Xie=qie,Zie=B(Xie);function Io(i){"@babel/helpers - typeof";return Io=typeof ia=="function"&&typeof Zie=="symbol"?function(e){return typeof e}:function(e){return e&&typeof ia=="function"&&e.constructor===ia&&e!==ia.prototype?"symbol":typeof e},Io(i)}var Jie=fs,Qie=Jie.f("toPrimitive"),ene=Qie,tne=ene,rne=tne,ine=rne,nne=ine,one=nne,sne=one,ane=B(sne);function lne(i,e){if(Io(i)!=="object"||i===null)return i;var t=i[ane];if(t!==void 0){var r=t.call(i,e);if(Io(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function dne(i){var e=lne(i,"string");return Io(e)==="symbol"?e:String(e)}function Zl(i,e,t){return e=dne(e),e in i?lie(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var J_=ve,hne=U,cne=K,une=qt,fne=KE.trim,vne=Tf,pne=cne("".charAt),Za=J_.parseFloat,sb=J_.Symbol,ab=sb&&sb.iterator,gne=1/Za(vne+"-0")!==-1/0||ab&&!hne(function(){Za(Object(ab))}),yne=gne?function(e){var t=fne(une(e)),r=Za(t);return r===0&&pne(t,0)==="-"?-0:r}:Za,mne=N,lb=yne;mne({global:!0,forced:parseFloat!==lb},{parseFloat:lb});var bne=X,$ne=bne.parseFloat,wne=$ne,Ene=wne,_ne=Ene,Q_=B(_ne),Sne=N,One=U,Tne=Ll.f,Ine=One(function(){return!Object.getOwnPropertyNames(1)});Sne({target:"Object",stat:!0,forced:Ine},{getOwnPropertyNames:Tne});var Pne=X,Cne=Pne.Object,xne=function(e){return Cne.getOwnPropertyNames(e)},Ane=xne,Dne=Ane,Mne=Dne,kne=B(Mne),Rne=X,Nne=Rne.Object.getOwnPropertySymbols,Fne=Nne,Bne=Fne,Lne=Bne,Rr=B(Lne),eS={exports:{}},jne=N,zne=U,Hne=kt,tS=qo.f,rS=Ie,Wne=!rS||zne(function(){tS(1)});jne({target:"Object",stat:!0,forced:Wne,sham:!rS},{getOwnPropertyDescriptor:function(e,t){return tS(Hne(e),t)}});var Vne=X,iS=Vne.Object,Une=eS.exports=function(e,t){return iS.getOwnPropertyDescriptor(e,t)};iS.getOwnPropertyDescriptor.sham&&(Une.sham=!0);var Kne=eS.exports,Gne=Kne,Yne=Gne,qne=Yne,Hr=B(qne),Xne=N,Zne=Ie,Jne=cY,Qne=kt,eoe=qo,toe=ls;Xne({target:"Object",stat:!0,sham:!Zne},{getOwnPropertyDescriptors:function(e){for(var t=Qne(e),r=eoe.f,n=Jne(t),o={},s=0,a,l;n.length>s;)l=r(t,a=n[s++]),l!==void 0&&toe(o,a,l);return o}});var roe=X,ioe=roe.Object.getOwnPropertyDescriptors,noe=ioe,ooe=noe,soe=ooe,Nr=B(soe),nS={exports:{}},aoe=N,loe=Ie,db=Fl.f;aoe({target:"Object",stat:!0,forced:Object.defineProperties!==db,sham:!loe},{defineProperties:db});var doe=X,oS=doe.Object,hoe=nS.exports=function(e,t){return oS.defineProperties(e,t)};oS.defineProperties.sham&&(hoe.sham=!0);var coe=nS.exports,uoe=coe,foe=uoe,voe=foe,Jl=B(voe),poe=G_,Ql=B(poe);function Gf(i,e){const t=["node","edge","label"];let r=!0;const n=$r(e,"chosen");if(typeof n=="boolean")r=n;else if(typeof n=="object"){if(q(t).call(t,i)===-1)throw new Error("choosify: subOption '"+i+"' should be one of '"+t.join("', '")+"'");const o=$r(e,["chosen",i]);(typeof o=="boolean"||typeof o=="function")&&(r=o)}return r}function $u(i,e,t){if(i.width<=0||i.height<=0)return!1;if(t!==void 0){const o={x:e.x-t.x,y:e.y-t.y};if(t.angle!==0){const s=-t.angle;e={x:Math.cos(s)*o.x-Math.sin(s)*o.y,y:Math.sin(s)*o.x+Math.cos(s)*o.y}}else e=o}const r=i.x+i.width,n=i.y+i.width;return i.left<e.x&&r>e.x&&i.top<e.y&&n>e.y}function Ja(i){return typeof i=="string"&&i!==""}function sS(i,e,t,r){let n=r.x,o=r.y;if(typeof r.distanceToBorder=="function"){const s=r.distanceToBorder(i,e),a=Math.sin(e)*s,l=Math.cos(e)*s;l===s?(n+=s,o=r.y):a===s?(n=r.x,o-=s):(n+=l,o-=a)}else r.shape.width>r.shape.height?(n=r.x+r.shape.width*.5,o=r.y-t):(n=r.x+t,o=r.y-r.shape.height*.5);return{x:n,y:o}}var goe=ze,yoe=goe("Array").values,moe=yoe,boe=moe,$oe=Oi,woe=je,Eoe=Te,_oe=boe,sc=Array.prototype,Soe={DOMTokenList:!0,NodeList:!0},Ooe=function(i){var e=i.values;return i===sc||Eoe(sc,i)&&e===sc.values||woe(Soe,$oe(i))?_oe:e},Toe=Ooe,aS=B(Toe);class Ioe{constructor(e){this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});let n=t;(t===void 0||t==="")&&(n=" ");const o=this.measureText(n,r),s=Ee({},aS(o));s.text=t,s.width=o.width,s.mod=r,(t===void 0||t==="")&&(s.width=0),this.lines[e].blocks.push(s),this.lines[e].width+=s.width}curWidth(){const e=this.lines[this.current];return e===void 0?0:e.width}append(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t)}newLine(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t),this.current++}determineLineHeights(){for(let e=0;e<this.lines.length;e++){const t=this.lines[e];let r=0;if(t.blocks!==void 0)for(let n=0;n<t.blocks.length;n++){const o=t.blocks[n];r<o.height&&(r=o.height)}t.height=r}}determineLabelSize(){let e=0,t=0;for(let r=0;r<this.lines.length;r++){const n=this.lines[r];n.width>e&&(e=n.width),t+=n.height}this.width=e,this.height=t}removeEmptyBlocks(){const e=[];for(let t=0;t<this.lines.length;t++){const r=this.lines[t];if(r.blocks.length===0||t===this.lines.length-1&&r.width===0)continue;const n={};Ee(n,r),n.blocks=[];let o;const s=[];for(let a=0;a<r.blocks.length;a++){const l=r.blocks[a];l.width!==0?s.push(l):o===void 0&&(o=l)}s.length===0&&o!==void 0&&s.push(o),n.blocks=s,e.push(n)}return e}finalize(){this.determineLineHeights(),this.determineLabelSize();const e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}}const Poe={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/};class hb{constructor(e){this.text=e,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}mod(){return this.modStack.length===0?"normal":this.modStack[0]}modName(){if(this.modStack.length===0)return"normal";if(this.modStack[0]==="mono")return"mono";if(this.bold&&this.ital)return"boldital";if(this.bold)return"bold";if(this.ital)return"ital"}emitBlock(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}add(e){e===" "&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1),e!=" "&&(this.buffer+=e)}parseWS(e){return/[ \t]/.test(e)?(this.mono?this.add(e):this.spacing=!0,!0):!1}setTag(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}unsetTag(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}parseStartTag(e,t){return!this.mono&&!this[e]&&this.match(t)?(this.setTag(e),!0):!1}match(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const[r,n]=this.prepareRegExp(e),o=r.test(this.text.substr(this.position,n));return o&&t&&(this.position+=n-1),o}parseEndTag(e,t,r){let n=this.mod()===e;return e==="mono"?n=n&&this.mono:n=n&&!this.mono,n&&this.match(t)?(r!==void 0?(this.position===this.text.length-1||this.match(r,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}replace(e,t){return this.match(e)?(this.add(t),this.position+=length-1,!0):!1}prepareRegExp(e){let t,r;if(e instanceof RegExp)r=e,t=1;else{const n=Poe[e];n!==void 0?r=n:r=new RegExp(e),t=e.length}return[r,t]}}class Coe{constructor(e,t,r,n){this.ctx=e,this.parent=t,this.selected=r,this.hover=n;const o=(s,a)=>{if(s===void 0)return 0;const l=this.parent.getFormattingValues(e,r,n,a);let d=0;return s!==""&&(d=this.ctx.measureText(s).width),{width:d,values:l}};this.lines=new Ioe(o)}process(e){if(!Ja(e))return this.lines.finalize();const t=this.parent.fontOptions;e=e.replace(/\r\n/g,`
87
+ `),e=e.replace(/\r/g,`
88
+ `);const r=String(e).split(`
89
+ `),n=r.length;if(t.multi)for(let o=0;o<n;o++){const s=this.splitBlocks(r[o],t.multi);if(s!==void 0){if(s.length===0){this.lines.newLine("");continue}if(t.maxWdt>0)for(let a=0;a<s.length;a++){const l=s[a].mod,d=s[a].text;this.splitStringIntoLines(d,l,!0)}else for(let a=0;a<s.length;a++){const l=s[a].mod,d=s[a].text;this.lines.append(d,l)}this.lines.newLine()}}else if(t.maxWdt>0)for(let o=0;o<n;o++)this.splitStringIntoLines(r[o]);else for(let o=0;o<n;o++)this.lines.newLine(r[o]);return this.lines.finalize()}decodeMarkupSystem(e){let t="none";return e==="markdown"||e==="md"?t="markdown":(e===!0||e==="html")&&(t="html"),t}splitHtmlBlocks(e){const t=new hb(e),r=n=>/&/.test(n)?(t.replace(t.text,"&lt;","<")||t.replace(t.text,"&amp;","&")||t.add("&"),!0):!1;for(;t.position<t.text.length;){const n=t.text.charAt(t.position);t.parseWS(n)||/</.test(n)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||r(n)||t.add(n),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){const t=new hb(e);let r=!0;const n=o=>/\\/.test(o)?(t.position<this.text.length+1&&(t.position++,o=this.text.charAt(t.position),/ \t/.test(o)?t.spacing=!0:(t.add(o),r=!1)),!0):!1;for(;t.position<t.text.length;){const o=t.text.charAt(t.position);t.parseWS(o)||n(o)||(r||t.spacing)&&(t.parseStartTag("bold","*")||t.parseStartTag("ital","_")||t.parseStartTag("mono","`"))||t.parseEndTag("bold","*","afterBold")||t.parseEndTag("ital","_","afterItal")||t.parseEndTag("mono","`","afterMono")||(t.add(o),r=!1),t.position++}return t.emitBlock(),t.blocks}splitBlocks(e,t){const r=this.decodeMarkupSystem(t);if(r==="none")return[{text:e,mod:"normal"}];if(r==="markdown")return this.splitMarkdownBlocks(e);if(r==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){const t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}getLongestFit(e){let t="",r=0;for(;r<e.length;){const o=t+(t===""?"":" ")+e[r];if(this.overMaxWidth(o))break;t=o,r++}return r}getLongestFitWord(e){let t=0;for(;t<e.length&&!this.overMaxWidth(jt(e).call(e,0,t));)t++;return t}splitStringIntoLines(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let n=e.split("\r");for(;n.length>0;){let o=this.getLongestFit(n);if(o===0){const s=n[0],a=this.getLongestFitWord(s);this.lines.newLine(jt(s).call(s,0,a),t),n[0]=jt(s).call(s,a)}else{let s=o;n[o-1]===" "?o--:n[s]===" "&&s++;const a=jt(n).call(n,0,o).join("");o==n.length&&r?this.lines.append(a,t):this.lines.newLine(a,t),n=jt(n).call(n,s)}}}}const Gn=["bold","ital","boldital","mono"];class tn{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=r}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),Ja(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){const t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){if(H(Gn,t=>{this.fontOptions[t]={}}),tn.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}H(e,(t,r)=>{t!=null&&typeof t!="object"&&(this.fontOptions[r]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;const r=t.split(" ");return e.size=+r[0].replace("px",""),e.face=r[1],e.color=r[2],!0}constrain(e){const t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},r=$r(e,"widthConstraint");if(typeof r=="number")t.maxWdt=Number(r),t.minWdt=Number(r);else if(typeof r=="object"){const o=$r(e,["widthConstraint","maximum"]);typeof o=="number"&&(t.maxWdt=Number(o));const s=$r(e,["widthConstraint","minimum"]);typeof s=="number"&&(t.minWdt=Number(s))}const n=$r(e,"heightConstraint");if(typeof n=="number")t.minHgt=Number(n);else if(typeof n=="object"){const o=$r(e,["heightConstraint","minimum"]);typeof o=="number"&&(t.minHgt=Number(o));const s=$r(e,["heightConstraint","valign"]);typeof s=="string"&&(s==="top"||s==="bottom")&&(t.valign=s)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),Q(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=Gf("label",t)}adjustSizes(e){const t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);const r=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=r)}addFontOptionsToPile(e,t){for(let r=0;r<t.length;++r)this.addFontToPile(e,t[r])}addFontToPile(e,t){if(t===void 0||t.font===void 0||t.font===null)return;const r=t.font;e.push(r)}getBasicOptions(e){const t={};for(let r=0;r<e.length;++r){let n=e[r];const o={};tn.parseFontString(o,n)&&(n=o),H(n,(s,a)=>{s!==void 0&&(Object.prototype.hasOwnProperty.call(t,a)||(q(Gn).call(Gn,a)!==-1?t[a]={}:t[a]=s))})}return t}getFontOption(e,t,r){let n;for(let o=0;o<e.length;++o){const s=e[o];if(Object.prototype.hasOwnProperty.call(s,t)){if(n=s[t],n==null)continue;const a={};if(tn.parseFontString(a,n)&&(n=a),Object.prototype.hasOwnProperty.call(n,r))return n[r]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,r))return this.fontOptions[r];throw new Error("Did not find value for multi-font for property: '"+r+"'")}getFontOptions(e,t){const r={},n=["color","size","face","mod","vadjust"];for(let o=0;o<n.length;++o){const s=n[o];r[s]=this.getFontOption(e,t,s)}return r}propagateFonts(e){const t=[];this.addFontOptionsToPile(t,e),this.fontOptions=this.getBasicOptions(t);for(let r=0;r<Gn.length;++r){const n=Gn[r],o=this.fontOptions[n],s=this.getFontOptions(t,n);H(s,(a,l)=>{o[l]=a}),o.size=Number(o.size),o.vadjust=Number(o.vadjust)}}draw(e,t,r,n,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label===void 0)return;let a=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&a<this.elementOptions.scaling.label.drawThreshold-1||(a>=this.elementOptions.scaling.label.maxVisible&&(a=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,n,o,t,r,s),this._drawBackground(e),this._drawText(e,t,this.size.yLine,s,a))}_drawBackground(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;const t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}_drawText(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",o=arguments.length>4?arguments[4]:void 0;[t,r]=this._setAlignment(e,t,r,n),e.textAlign="left",t=t-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(r-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(r+=(this.size.height-this.size.labelHeight)/2));for(let s=0;s<this.lineCount;s++){const a=this.lines[s];if(a&&a.blocks){let l=0;this.isEdgeLabel||this.fontOptions.align==="center"?l+=(this.size.width-a.width)/2:this.fontOptions.align==="right"&&(l+=this.size.width-a.width);for(let d=0;d<a.blocks.length;d++){const h=a.blocks[d];e.font=h.font;const[c,u]=this._getColor(h.color,o,h.strokeColor);h.strokeWidth>0&&(e.lineWidth=h.strokeWidth,e.strokeStyle=u,e.lineJoin="round"),e.fillStyle=c,h.strokeWidth>0&&e.strokeText(h.text,t+l,r+h.vadjust),e.fillText(h.text,t+l,r+h.vadjust),l+=h.width}r+=a.height}}}_setAlignment(e,t,r,n){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){t=0,r=0;const o=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",r-=2*o):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",r+=2*o):e.textBaseline="middle"}else e.textBaseline=n;return[t,r]}_getColor(e,t,r){let n=e||"#000000",o=r||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){const s=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));n=bt(n,s),o=bt(o,s)}return[n,o]}getTextSize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,t,r),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let t=this.size.left,r=this.size.top-.5*2;if(this.isEdgeLabel){const o=-this.size.width*.5;switch(this.fontOptions.align){case"middle":t=o,r=-this.size.height*.5;break;case"top":t=o,r=-(this.size.height+2);break;case"bottom":t=o,r=2;break}}return{left:t,top:r,width:this.size.width,height:this.size.height}}calculateLabelSize(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,t,r),this.size.left=n-this.size.width*.5,this.size.top=o-this.size.height*.5,this.size.yLine=o+(1-this.lineCount)*.5*this.fontOptions.size,s==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(e,t,r,n){const o=function(l,d,h){return d==="normal"?h==="mod"?"":l[h]:l[d][h]!==void 0?l[d][h]:l[h]},s={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};(t||r)&&(n==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?s.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(s,this.elementOptions.id,t,r));let a="";return s.mod!==void 0&&s.mod!==""&&(a+=s.mod+" "),a+=s.size+"px "+s.face,e.font=a.replace(/"/g,""),s.font=e.font,s.height=s.size,s}differentState(e,t){return e!==this.selectedState||t!==this.hoverState}_processLabelText(e,t,r,n){return new Coe(e,this,t,r).process(n)}_processLabel(e,t,r){if(this.labelDirty===!1&&!this.differentState(t,r))return;const n=this._processLabelText(e,t,r,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=t,this.hoverState=r,this.labelDirty=!1}visible(){return!(this.size.width===0||this.size.height===0||this.elementOptions.label===void 0||this.fontOptions.size*this.body.view.scale<this.elementOptions.scaling.label.drawThreshold-1)}}class Pi{constructor(e,t,r){this.body=t,this.labelModule=r,this.setOptions(e),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.margin=void 0,this.refreshNeeded=!0,this.boundingBox={top:0,left:0,right:0,bottom:0}}setOptions(e){this.options=e}_setMargins(e){this.margin={},this.options.margin&&(typeof this.options.margin=="object"?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),e.adjustSizes(this.margin)}_distanceToBorder(e,t){const r=this.options.borderWidth;return e&&this.resize(e),Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+r}enableShadow(e,t){t.shadow&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}enableBorderDashes(e,t){if(t.borderDashes!==!1)if(e.setLineDash!==void 0){let r=t.borderDashes;r===!0&&(r=[5,15]),e.setLineDash(r)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1}disableBorderDashes(e,t){t.borderDashes!==!1&&(e.setLineDash!==void 0?e.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1))}needsRefresh(e,t){return this.refreshNeeded===!0?(this.refreshNeeded=!1,!0):this.width===void 0||this.labelModule.differentState(e,t)}initContextForDraw(e,t){const r=t.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,r),e.strokeStyle=t.borderColor,e.fillStyle=t.color}performStroke(e,t){const r=t.borderWidth/this.body.view.scale;e.save(),r>0&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}performFill(e,t){e.save(),e.fillStyle=t.color,this.enableShadow(e,t),ys(e).call(e),this.disableShadow(e,t),e.restore(),this.performStroke(e,t)}_addBoundingBoxMargin(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}_updateBoundingBox(e,t,r,n,o){r!==void 0&&this.resize(r,n,o),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}updateBoundingBox(e,t,r,n,o){this._updateBoundingBox(e,t,r,n,o)}getDimensionsFromLabel(e,t,r){this.textSize=this.labelModule.getTextSize(e,t,r);let n=this.textSize.width,o=this.textSize.height;const s=14;return n===0&&(n=s,o=s),{width:n,height:o}}}let xoe=class extends Pi{constructor(e,t,r){super(e,t,r),this._setMargins(r)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,r)){const n=this.getDimensionsFromLabel(e,t,r);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(e,t,r,n,o,s){this.resize(e,n,o),this.left=t-this.width/2,this.top=r-this.height/2,this.initContextForDraw(e,s),H0(e,this.left,this.top,this.width,this.height,s.borderRadius),this.performFill(e,s),this.updateBoundingBox(t,r,e,n,o),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,o)}updateBoundingBox(e,t,r,n,o){this._updateBoundingBox(e,t,r,n,o);const s=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(s)}distanceToBorder(e,t){e&&this.resize(e);const r=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+r}};class Yf extends Pi{constructor(e,t,r){super(e,t,r),this.labelOffset=0,this.selected=!1}setOptions(e,t,r){this.options=e,t===void 0&&r===void 0||this.setImages(t,r)}setImages(e,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=t)}switchImages(e){const t=e&&!this.selected||!e&&this.selected;if(this.selected=e,this.imageObjAlt!==void 0&&t){const r=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=r}}_getImagePadding(){const e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){const t=this.options.imagePadding;typeof t=="object"?(e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left):(e.top=t,e.right=t,e.bottom=t,e.left=t)}return e}_resizeImage(){let e,t;if(this.options.shapeProperties.useImageSize===!1){let r=1,n=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?r=this.imageObj.width/this.imageObj.height:n=this.imageObj.height/this.imageObj.width),e=this.options.size*2*r,t=this.options.size*2*n}else{const r=this._getImagePadding();e=this.imageObj.width+r.left+r.right,t=this.imageObj.height+r.top+r.bottom}this.width=e,this.height=t,this.radius=.5*this.width}_drawRawCircle(e,t,r,n){this.initContextForDraw(e,n),pf(e,t,r,n.size),this.performFill(e,n)}_drawImageAtPosition(e,t){if(this.imageObj.width!=0){e.globalAlpha=t.opacity!==void 0?t.opacity:1,this.enableShadow(e,t);let r=1;this.options.shapeProperties.interpolation===!0&&(r=this.imageObj.width/this.width/this.body.view.scale);const n=this._getImagePadding(),o=this.left+n.left,s=this.top+n.top,a=this.width-n.left-n.right,l=this.height-n.top-n.bottom;this.imageObj.drawImageAtPosition(e,r,o,s,a,l),this.disableShadow(e,t)}}_drawImageLabel(e,t,r,n,o){let s=0;if(this.height!==void 0){s=this.height*.5;const l=this.labelModule.getTextSize(e,n,o);l.lineCount>=1&&(s+=l.height/2)}const a=r+s;this.options.label&&(this.labelOffset=s),this.labelModule.draw(e,t,a,n,o,"hanging")}}let Aoe=class extends Yf{constructor(e,t,r){super(e,t,r),this._setMargins(r)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,r)){const n=this.getDimensionsFromLabel(e,t,r),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(e,t,r,n,o,s){this.resize(e,n,o),this.left=t-this.width/2,this.top=r-this.height/2,this._drawRawCircle(e,t,r,s),this.updateBoundingBox(t,r),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,r,n,o)}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size}distanceToBorder(e){return e&&this.resize(e),this.width*.5}};class Doe extends Yf{constructor(e,t,r,n,o){super(e,t,r),this.setImages(n,o)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){const o=this.options.size*2;this.width=o,this.height=o,this.radius=.5*this.width;return}this.needsRefresh(t,r)&&this._resizeImage()}draw(e,t,r,n,o,s){this.switchImages(n),this.resize();let a=t,l=r;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=r,a+=this.width/2,l+=this.height/2):(this.left=t-this.width/2,this.top=r-this.height/2),this._drawRawCircle(e,a,l,s),e.save(),e.clip(),this._drawImageAtPosition(e,s),e.restore(),this._drawImageLabel(e,a,l,n,o),this.updateBoundingBox(t,r)}updateBoundingBox(e,t){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=t,this.boundingBox.left=e,this.boundingBox.right=e+this.options.size*2,this.boundingBox.bottom=t+this.options.size*2):(this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}distanceToBorder(e){return e&&this.resize(e),this.width*.5}}class Wr extends Pi{constructor(e,t,r){super(e,t,r)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,r)){var o,s;this.labelModule.getTextSize(e,t,r);const a=2*n.size;this.width=(o=this.customSizeWidth)!==null&&o!==void 0?o:a,this.height=(s=this.customSizeHeight)!==null&&s!==void 0?s:a,this.radius=.5*this.width}}_drawShape(e,t,r,n,o,s,a,l){return this.resize(e,s,a,l),this.left=n-this.width/2,this.top=o-this.height/2,this.initContextForDraw(e,l),y8(t)(e,n,o,l.size),this.performFill(e,l),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(s?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",e.fillText(this.options.icon.code,n,o)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(e,s,a,n,o,"hanging");const d=o+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,n,d,s,a,"hanging")}this.updateBoundingBox(n,o)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}function cb(i,e){var t=he(i);if(Rr){var r=Rr(i);e&&(r=ot(r).call(r,function(n){return Hr(i,n).enumerable})),t.push.apply(t,r)}return t}function Moe(i){for(var e=1;e<arguments.length;e++){var t,r,n=arguments[e]!=null?arguments[e]:{};e%2?Z(t=cb(Object(n),!0)).call(t,function(o){Zl(i,o,n[o])}):Nr?Jl(i,Nr(n)):Z(r=cb(Object(n))).call(r,function(o){Ql(i,o,Hr(n,o))})}return i}class koe extends Wr{constructor(e,t,r,n){super(e,t,r,n),this.ctxRenderer=n}draw(e,t,r,n,o,s){this.resize(e,n,o,s),this.left=t-this.width/2,this.top=r-this.height/2,e.save();const a=this.ctxRenderer({ctx:e,id:this.options.id,x:t,y:r,state:{selected:n,hover:o},style:Moe({},s),label:this.options.label});if(a.drawNode!=null&&a.drawNode(),e.restore(),a.drawExternalLabel){const l=a.drawExternalLabel;a.drawExternalLabel=()=>{e.save(),l(),e.restore()}}return a.nodeDimensions&&(this.customSizeWidth=a.nodeDimensions.width,this.customSizeHeight=a.nodeDimensions.height),a}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class Roe extends Pi{constructor(e,t,r){super(e,t,r),this._setMargins(r)}resize(e,t,r){if(this.needsRefresh(t,r)){const o=this.getDimensionsFromLabel(e,t,r).width+this.margin.right+this.margin.left;this.width=o,this.height=o,this.radius=this.width/2}}draw(e,t,r,n,o,s){this.resize(e,n,o),this.left=t-this.width/2,this.top=r-this.height/2,this.initContextForDraw(e,s),W0(e,t-this.width/2,r-this.height/2,this.width,this.height),this.performFill(e,s),this.updateBoundingBox(t,r,e,n,o),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let Noe=class extends Wr{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,o,s){return this._drawShape(e,"diamond",4,t,r,n,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class Foe extends Wr{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,o,s){return this._drawShape(e,"circle",2,t,r,n,o,s)}distanceToBorder(e){return e&&this.resize(e),this.options.size}}class ub extends Pi{constructor(e,t,r){super(e,t,r)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,r)){const n=this.getDimensionsFromLabel(e,t,r);this.height=n.height*2,this.width=n.width+n.height,this.radius=.5*this.width}}draw(e,t,r,n,o,s){this.resize(e,n,o),this.left=t-this.width*.5,this.top=r-this.height*.5,this.initContextForDraw(e,s),Xc(e,this.left,this.top,this.width,this.height),this.performFill(e,s),this.updateBoundingBox(t,r,e,n,o),this.labelModule.draw(e,t,r,n,o)}distanceToBorder(e,t){e&&this.resize(e);const r=this.width*.5,n=this.height*.5,o=Math.sin(t)*r,s=Math.cos(t)*n;return r*n/Math.sqrt(o*o+s*s)}}class Boe extends Pi{constructor(e,t,r){super(e,t,r),this._setMargins(r)}resize(e,t,r){this.needsRefresh(t,r)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,r,n,o,s){return this.resize(e,n,o),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=r-this.height/2,this._icon(e,t,r,n,o,s),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,r+this.height/2+5,n),this.updateBoundingBox(t,r)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.icon.size*.5,this.boundingBox.left=e-this.options.icon.size*.5,this.boundingBox.right=e+this.options.icon.size*.5,this.boundingBox.bottom=t+this.options.icon.size*.5,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5))}_icon(e,t,r,n,o,s){const a=Number(this.options.icon.size);this.options.icon.code!==void 0?(e.font=[this.options.icon.weight!=null?this.options.icon.weight:n?"bold":"",(this.options.icon.weight!=null&&n?5:0)+a+"px",this.options.icon.face].join(" "),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,s),e.fillText(this.options.icon.code,t,r),this.disableShadow(e,s)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let Loe=class extends Yf{constructor(e,t,r,n,o){super(e,t,r),this.setImages(n,o)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){const o=this.options.size*2;this.width=o,this.height=o;return}this.needsRefresh(t,r)&&this._resizeImage()}draw(e,t,r,n,o,s){e.save(),this.switchImages(n),this.resize();let a=t,l=r;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=r,a+=this.width/2,l+=this.height/2):(this.left=t-this.width/2,this.top=r-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){const d=this.options.borderWidth,h=this.options.borderWidthSelected||2*this.options.borderWidth,c=(n?h:d)/this.body.view.scale;e.lineWidth=Math.min(this.width,c),e.beginPath();let u=n?this.options.color.highlight.border:o?this.options.color.hover.border:this.options.color.border,f=n?this.options.color.highlight.background:o?this.options.color.hover.background:this.options.color.background;s.opacity!==void 0&&(u=bt(u,s.opacity),f=bt(f,s.opacity)),e.strokeStyle=u,e.fillStyle=f,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),ys(e).call(e),this.performStroke(e,s),e.closePath()}this._drawImageAtPosition(e,s),this._drawImageLabel(e,a,l,n,o),this.updateBoundingBox(t,r),e.restore()}updateBoundingBox(e,t){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=e,this.top=t):(this.left=e-this.width/2,this.top=t-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class joe extends Wr{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,o,s){return this._drawShape(e,"square",2,t,r,n,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class zoe extends Wr{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,o,s){return this._drawShape(e,"hexagon",4,t,r,n,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class Hoe extends Wr{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,o,s){return this._drawShape(e,"star",4,t,r,n,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class Woe extends Pi{constructor(e,t,r){super(e,t,r),this._setMargins(r)}resize(e,t,r){this.needsRefresh(t,r)&&(this.textSize=this.labelModule.getTextSize(e,t,r),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,r,n,o,s){this.resize(e,n,o),this.left=t-this.width/2,this.top=r-this.height/2,this.enableShadow(e,s),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,o),this.disableShadow(e,s),this.updateBoundingBox(t,r,e,n,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let Voe=class extends Wr{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,o,s){return this._drawShape(e,"triangle",3,t,r,n,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class Uoe extends Wr{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,o,s){return this._drawShape(e,"triangleDown",3,t,r,n,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}function fb(i,e){var t=he(i);if(Rr){var r=Rr(i);e&&(r=ot(r).call(r,function(n){return Hr(i,n).enumerable})),t.push.apply(t,r)}return t}function vb(i){for(var e=1;e<arguments.length;e++){var t,r,n=arguments[e]!=null?arguments[e]:{};e%2?Z(t=fb(Object(n),!0)).call(t,function(o){Zl(i,o,n[o])}):Nr?Jl(i,Nr(n)):Z(r=fb(Object(n))).call(r,function(o){Ql(i,o,Hr(n,o))})}return i}class ie{constructor(e,t,r,n,o,s){this.options=Ar(o),this.globalOptions=o,this.defaultOptions=s,this.body=t,this.edges=[],this.id=void 0,this.imagelist=r,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 tn(this.body,this.options,!1),this.setOptions(e)}attachEdge(e){var t;q(t=this.edges).call(t,e)===-1&&this.edges.push(e)}detachEdge(e){var t;const r=q(t=this.edges).call(t,e);if(r!=-1){var n;ir(n=this.edges).call(n,r,1)}}setOptions(e){const t=this.options.shape;if(!e)return;if(typeof e.color<"u"&&(this._localColor=e.color),e.id!==void 0&&(this.id=e.id),this.id===void 0)throw new Error("Node must have an id");ie.checkMass(e,this.id),e.x!==void 0&&(e.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=Pt(e.x),this.predefinedPosition=!0)),e.y!==void 0&&(e.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=Pt(e.y),this.predefinedPosition=!0)),e.size!==void 0&&(this.baseSize=e.size),e.value!==void 0&&(e.value=Q_(e.value)),ie.parseOptions(this.options,e,!0,this.globalOptions,this.grouplist);const r=[e,this.options,this.defaultOptions];return this.chooser=Gf("node",r),this._load_images(),this.updateLabelModule(e),e.opacity!==void 0&&ie.checkOpacity(e.opacity)&&(this.options.opacity=e.opacity),this.updateShape(t),e.hidden!==void 0||e.physics!==void 0}_load_images(){if((this.options.shape==="circularImage"||this.options.shape==="image")&&this.options.image===void 0)throw new Error("Option image must be defined for node type '"+this.options.shape+"'");if(this.options.image!==void 0){if(this.imagelist===void 0)throw new Error("Internal Error: No images provided");if(typeof this.options.image=="string")this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id);else{if(this.options.image.unselected===void 0)throw new Error("No unselected image provided");this.imageObj=this.imagelist.load(this.options.image.unselected,this.options.brokenImage,this.id),this.options.image.selected!==void 0?this.imageObjAlt=this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id):this.imageObjAlt=void 0}}}static checkOpacity(e){return 0<=e&&e<=1}static checkCoordinateOrigin(e){return e===void 0||e==="center"||e==="top-left"}static updateGroupOptions(e,t,r){var n;if(r===void 0)return;const o=e.group;if(t!==void 0&&t.group!==void 0&&o!==t.group)throw new Error("updateGroupOptions: group values in options don't match.");if(!(typeof o=="number"||typeof o=="string"&&o!=""))return;const a=r.get(o);a.opacity!==void 0&&t.opacity===void 0&&(ie.checkOpacity(a.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+a.opacity),a.opacity=void 0));const l=ot(n=kne(t)).call(n,d=>t[d]!=null);l.push("font"),Ya(l,e,a),e.color=pu(e.color)}static parseOptions(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0;if(Ya(["color","fixed","shadow"],e,t,r),ie.checkMass(t),e.opacity!==void 0&&(ie.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),t.opacity!==void 0&&(ie.checkOpacity(t.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+t.opacity),t.opacity=void 0)),t.shapeProperties&&!ie.checkCoordinateOrigin(t.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+t.shapeProperties.coordinateOrigin),mt(e,t,"shadow",n),t.color!==void 0&&t.color!==null){const a=pu(t.color);S_(e.color,a)}else r===!0&&t.color===null&&(e.color=Ar(n.color));t.fixed!==void 0&&t.fixed!==null&&(typeof t.fixed=="boolean"?(e.fixed.x=t.fixed,e.fixed.y=t.fixed):(t.fixed.x!==void 0&&typeof t.fixed.x=="boolean"&&(e.fixed.x=t.fixed.x),t.fixed.y!==void 0&&typeof t.fixed.y=="boolean"&&(e.fixed.y=t.fixed.y))),r===!0&&t.font===null&&(e.font=Ar(n.font)),ie.updateGroupOptions(e,t,o),t.scaling!==void 0&&mt(e.scaling,t.scaling,"label",n.scaling)}getFormattingValues(){const e={color:this.options.color.background,opacity:this.options.opacity,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};if(this.selected||this.hover?this.chooser===!0?this.selected?(this.options.borderWidthSelected!=null?e.borderWidth=this.options.borderWidthSelected:e.borderWidth*=2,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):typeof this.chooser=="function"&&(this.chooser(e,this.options.id,this.selected,this.hover),e.shadow===!1&&(e.shadowColor!==this.options.shadow.color||e.shadowSize!==this.options.shadow.size||e.shadowX!==this.options.shadow.x||e.shadowY!==this.options.shadow.y)&&(e.shadow=!0)):e.shadow=this.options.shadow.enabled,this.options.opacity!==void 0){const t=this.options.opacity;e.borderColor=bt(e.borderColor,t),e.color=bt(e.color,t),e.shadowColor=bt(e.shadowColor,t)}return e}updateLabelModule(e){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),ie.updateGroupOptions(this.options,vb(vb({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);const t=this.grouplist.get(this.options.group,!1),r=[e,this.options,t,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,r),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new xoe(this.options,this.body,this.labelModule);break;case"circle":this.shape=new Aoe(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new Doe(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new koe(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new Roe(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new Noe(this.options,this.body,this.labelModule);break;case"dot":this.shape=new Foe(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new ub(this.options,this.body,this.labelModule);break;case"icon":this.shape=new Boe(this.options,this.body,this.labelModule);break;case"image":this.shape=new Loe(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new joe(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new zoe(this.options,this.body,this.labelModule);break;case"star":this.shape=new Hoe(this.options,this.body,this.labelModule);break;case"text":this.shape=new Woe(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new Voe(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new Uoe(this.options,this.body,this.labelModule);break;default:this.shape=new ub(this.options,this.body,this.labelModule);break}this.needsRefresh()}select(){this.selected=!0,this.needsRefresh()}unselect(){this.selected=!1,this.needsRefresh()}needsRefresh(){this.shape.refreshNeeded=!0}getTitle(){return this.options.title}distanceToBorder(e,t){return this.shape.distanceToBorder(e,t)}isFixed(){return this.options.fixed.x&&this.options.fixed.y}isSelected(){return this.selected}getValue(){return this.options.value}getLabelSize(){return this.labelModule.size()}setValueRange(e,t,r){if(this.options.value!==void 0){const n=this.options.scaling.customScalingFunction(e,t,r,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*s}this.options.size=this.options.scaling.min+n*o}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(e){const t=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,t)||{}}updateBoundingBox(e){this.shape.updateBoundingBox(this.x,this.y,e)}resize(e){const t=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,t)}getItemsOnPoint(e){const t=[];return this.labelModule.visible()&&$u(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),$u(this.shape.boundingBox,e)&&t.push({nodeId:this.id}),t}isOverlappingWith(e){return this.shape.left<e.right&&this.shape.left+this.shape.width>e.left&&this.shape.top<e.bottom&&this.shape.top+this.shape.height>e.top}isBoundingBoxOverlappingWith(e){return this.shape.boundingBox.left<e.right&&this.shape.boundingBox.right>e.left&&this.shape.boundingBox.top<e.bottom&&this.shape.boundingBox.bottom>e.top}static checkMass(e,t){if(e.mass!==void 0&&e.mass<=0){let r="";t!==void 0&&(r=" in node id: "+t),console.error("%cNegative or zero mass disallowed"+r+", setting mass to 1.",P_),e.mass=1}}}class Koe{constructor(e,t,r,n){var o;if(this.body=e,this.images=t,this.groups=r,this.layoutEngine=n,this.body.functions.createNode=_(o=this.create).call(o,this),this.nodesListeners={add:(s,a)=>{this.add(a.items)},update:(s,a)=>{this.update(a.items,a.data,a.oldData)},remove:(s,a)=>{this.remove(a.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(s,a,l,d){if(a===s)return .5;{const h=1/(a-s);return Math.max(0,(d-s)*h)}}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1,coordinateOrigin:"center"},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=Ar(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,t;this.body.emitter.on("refreshNodes",_(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",_(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",()=>{H(this.nodesListeners,(r,n)=>{this.body.data.nodes&&this.body.data.nodes.off(n,r)}),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners})}setOptions(e){if(e!==void 0){if(ie.parseOptions(this.options,e),e.opacity!==void 0&&(bu(e.opacity)||!Zr(e.opacity)||e.opacity<0||e.opacity>1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(typeof e.font<"u"||typeof e.widthConstraint<"u"||typeof e.heightConstraint<"u")for(const t of he(this.body.nodes))this.body.nodes[t].updateLabelModule(),this.body.nodes[t].needsRefresh();if(e.size!==void 0)for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.body.data.nodes;if(_0("id",e))this.body.data.nodes=e;else if(ce(e))this.body.data.nodes=new ja,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new ja;else throw new TypeError("Array or DataSet expected");if(r&&H(this.nodesListeners,function(n,o){r.off(o,n)}),this.body.nodes={},this.body.data.nodes){const n=this;H(this.nodesListeners,function(s,a){n.body.data.nodes.on(a,s)});const o=this.body.data.nodes.getIds();this.add(o,!0)}t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r;const n=[];for(let o=0;o<e.length;o++){r=e[o];const s=this.body.data.nodes.get(r),a=this.create(s);n.push(a),this.body.nodes[r]=a}this.layoutEngine.positionInitially(n),t===!1&&this.body.emitter.emit("_dataChanged")}update(e,t,r){const n=this.body.nodes;let o=!1;for(let s=0;s<e.length;s++){const a=e[s];let l=n[a];const d=t[s];l!==void 0?l.setOptions(d)&&(o=!0):(o=!0,l=this.create(d),n[a]=l)}!o&&r!==void 0&&(o=Xre(t).call(t,function(s,a){const l=r[a];return l&&l.level!==s.level})),o===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}remove(e){const t=this.body.nodes;for(let r=0;r<e.length;r++){const n=e[r];delete t[n]}this.body.emitter.emit("_dataChanged")}create(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ie;return new t(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;H(this.body.nodes,(t,r)=>{const n=this.body.data.nodes.get(r);n!==void 0&&(e===!0&&t.setOptions({x:null,y:null}),t.setOptions({fixed:!1}),t.setOptions(n))})}getPositions(e){const t={};if(e!==void 0){if(ce(e)===!0){for(let r=0;r<e.length;r++)if(this.body.nodes[e[r]]!==void 0){const n=this.body.nodes[e[r]];t[e[r]]={x:Math.round(n.x),y:Math.round(n.y)}}}else if(this.body.nodes[e]!==void 0){const r=this.body.nodes[e];t[e]={x:Math.round(r.x),y:Math.round(r.y)}}}else for(let r=0;r<this.body.nodeIndices.length;r++){const n=this.body.nodes[this.body.nodeIndices[r]];t[this.body.nodeIndices[r]]={x:Math.round(n.x),y:Math.round(n.y)}}return t}getPosition(e){if(e==null)throw new TypeError("No id was specified for getPosition method.");if(this.body.nodes[e]==null)throw new ReferenceError("NodeId provided for getPosition does not exist. Provided: ".concat(e));return{x:Math.round(this.body.nodes[e].x),y:Math.round(this.body.nodes[e].y)}}storePositions(){const e=[],t=this.body.data.nodes.getDataSet();for(const r of t.get()){const n=r.id,o=this.body.nodes[n],s=Math.round(o.x),a=Math.round(o.y);(r.x!==s||r.y!==a)&&e.push({id:n,x:s,y:a})}t.update(e)}getBoundingBox(e){if(this.body.nodes[e]!==void 0)return this.body.nodes[e].shape.boundingBox}getConnectedNodes(e,t){const r=[];if(this.body.nodes[e]!==void 0){const n=this.body.nodes[e],o={};for(let s=0;s<n.edges.length;s++){const a=n.edges[s];t!=="to"&&a.toId==n.id?o[a.fromId]===void 0&&(r.push(a.fromId),o[a.fromId]=!0):t!=="from"&&a.fromId==n.id&&o[a.toId]===void 0&&(r.push(a.toId),o[a.toId]=!0)}}return r}getConnectedEdges(e){const t=[];if(this.body.nodes[e]!==void 0){const r=this.body.nodes[e];for(let n=0;n<r.edges.length;n++)t.push(r.edges[n].id)}else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return t}moveNode(e,t,r){this.body.nodes[e]!==void 0?(this.body.nodes[e].x=Number(t),this.body.nodes[e].y=Number(r),nr(()=>{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}}var Goe=N,pb=Math.hypot,Yoe=Math.abs,qoe=Math.sqrt,Xoe=!!pb&&pb(1/0,NaN)!==1/0;Goe({target:"Math",stat:!0,forced:Xoe},{hypot:function(e,t){for(var r=0,n=0,o=arguments.length,s=0,a,l;n<o;)a=Yoe(arguments[n++]),s<a?(l=s/a,r=r*l*l+1,s=a):a>0?(l=a/s,r+=l*l):r+=a;return s===1/0?1/0:s*qoe(r)}});var Zoe=X,Joe=Zoe.Math.hypot,Qoe=Joe,ese=Qoe,tse=ese,rse=B(tse);class ye{static transform(e,t){ce(e)||(e=[e]);const r=t.point.x,n=t.point.y,o=t.angle,s=t.length;for(let a=0;a<e.length;++a){const l=e[a],d=l.x*Math.cos(o)-l.y*Math.sin(o),h=l.x*Math.sin(o)+l.y*Math.cos(o);l.x=r+s*d,l.y=n+s*h}}static drawPath(e,t){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(let r=1;r<t.length;++r)e.lineTo(t[r].x,t[r].y);e.closePath()}}let ise=class extends ye{static draw(e,t){if(t.image){e.save(),e.translate(t.point.x,t.point.y),e.rotate(Math.PI/2+t.angle);const r=t.imageWidth!=null?t.imageWidth:t.image.width,n=t.imageHeight!=null?t.imageHeight:t.image.height;t.image.drawImageAtPosition(e,1,-r/2,0,r,n),e.restore()}return!1}};class nse extends ye{static draw(e,t){const r=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return ye.transform(r,t),ye.drawPath(e,r),!0}}class ose{static draw(e,t){const r=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return ye.transform(r,t),ye.drawPath(e,r),!0}}class sse{static draw(e,t){const r={x:-.4,y:0};ye.transform(r,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";const n=Math.PI,o=t.angle-n/2,s=t.angle+n/2;return e.beginPath(),e.arc(r.x,r.y,t.length*.4,o,s,!1),e.stroke(),!0}}class ase{static draw(e,t){const r={x:-.3,y:0};ye.transform(r,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";const n=Math.PI,o=t.angle+n/2,s=t.angle+3*n/2;return e.beginPath(),e.arc(r.x,r.y,t.length*.4,o,s,!1),e.stroke(),!0}}class lse{static draw(e,t){const r=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return ye.transform(r,t),ye.drawPath(e,r),!0}}class dse{static draw(e,t){const r=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return ye.transform(r,t),ye.drawPath(e,r),!0}}class hse{static draw(e,t){const r={x:-.4,y:0};return ye.transform(r,t),pf(e,r.x,r.y,t.length*.4),!0}}class cse{static draw(e,t){const r=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return ye.transform(r,t),ye.drawPath(e,r),!0}}class use{static draw(e,t){const r=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return ye.transform(r,t),ye.drawPath(e,r),!0}}class fse{static draw(e,t){const r=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return ye.transform(r,t),ye.drawPath(e,r),!0}}class vse{static draw(e,t){const r=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return ye.transform(r,t),ye.drawPath(e,r),!0}}class lS{static draw(e,t){let r;switch(t.type&&(r=t.type.toLowerCase()),r){case"image":return ise.draw(e,t);case"circle":return hse.draw(e,t);case"box":return use.draw(e,t);case"crow":return ose.draw(e,t);case"curve":return sse.draw(e,t);case"diamond":return fse.draw(e,t);case"inv_curve":return ase.draw(e,t);case"triangle":return lse.draw(e,t);case"inv_triangle":return dse.draw(e,t);case"bar":return cse.draw(e,t);case"vee":return vse.draw(e,t);case"arrow":default:return nse.draw(e,t)}}}function gb(i,e){var t=he(i);if(Rr){var r=Rr(i);e&&(r=ot(r).call(r,function(n){return Hr(i,n).enumerable})),t.push.apply(t,r)}return t}function yb(i){for(var e=1;e<arguments.length;e++){var t,r,n=arguments[e]!=null?arguments[e]:{};e%2?Z(t=gb(Object(n),!0)).call(t,function(o){Zl(i,o,n[o])}):Nr?Jl(i,Nr(n)):Z(r=gb(Object(n))).call(r,function(o){Ql(i,o,Hr(n,o))})}return i}class dS{constructor(e,t,r){this._body=t,this._labelModule=r,this.color={},this.colorDirty=!0,this.hoverWidth=1.5,this.selectionWidth=2,this.setOptions(e),this.fromPoint=this.from,this.toPoint=this.to}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to]}cleanup(){return!1}setOptions(e){this.options=e,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.id=this.options.id}drawLine(e,t,r,n){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,t),e.lineWidth=t.width,t.dashes!==!1?this._drawDashedLine(e,t,o):this._drawLine(e,t,o)}_drawLine(e,t,r,n,o){if(this.from!=this.to)this._line(e,t,r,n,o);else{const[s,a,l]=this._getCircleData(e);this._circle(e,t,s,a,l)}}_drawDashedLine(e,t,r,n,o){e.lineCap="round";const s=ce(t.dashes)?t.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(s),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,r);else{const[a,l,d]=this._getCircleData(e);this._circle(e,t,a,l,d)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)V0(e,this.from.x,this.from.y,this.to.x,this.to.y,s);else{const[a,l,d]=this._getCircleData(e);this._circle(e,t,a,l,d)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}findBorderPosition(e,t,r){return this.from!=this.to?this._findBorderPosition(e,t,r):this._findBorderPositionCircle(e,t,r)}findBorderPositions(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};{var t;const[r,n]=jt(t=this._getCircleData(e)).call(t,0,2);return{from:this._findBorderPositionCircle(this.from,e,{x:r,y:n,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:r,y:n,low:.6,high:.8,direction:1})}}}_getCircleData(e){const t=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);const r=sS(e,this.options.selfReference.angle,t,this.from);return[r.x,r.y,t]}_pointOnCircle(e,t,r,n){const o=n*2*Math.PI;return{x:e+r*Math.cos(o),y:t-r*Math.sin(o)}}_findBorderPositionCircle(e,t,r){const n=r.x,o=r.y;let s=r.low,a=r.high;const l=r.direction,d=10,h=this.options.selfReference.size,c=.05;let u,f=(s+a)*.5,v=0;this.options.arrowStrikethrough===!0&&(l===-1?v=this.options.endPointOffset.from:l===1&&(v=this.options.endPointOffset.to));let y=0;do{f=(s+a)*.5,u=this._pointOnCircle(n,o,h,f);const g=Math.atan2(e.y-u.y,e.x-u.x),p=e.distanceToBorder(t,g)+v,m=Math.sqrt(Math.pow(u.x-e.x,2)+Math.pow(u.y-e.y,2)),$=p-m;if(Math.abs($)<c)break;$>0?l>0?s=f:a=f:l>0?a=f:s=f,++y}while(s<=a&&y<d);return yb(yb({},u),{},{t:f})}getLineWidth(e,t){return e===!0?Math.max(this.selectionWidth,.3/this._body.view.scale):t===!0?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}getColor(e,t){if(t.inheritsColor!==!1){if(t.inheritsColor==="both"&&this.from.id!==this.to.id){const r=e.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 this.from.selected===!1&&this.to.selected===!1?(n=bt(this.from.options.color.border,t.opacity),o=bt(this.to.options.color.border,t.opacity)):this.from.selected===!0&&this.to.selected===!1?o=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(n=this.from.options.color.border),r.addColorStop(0,n),r.addColorStop(1,o),r}return t.inheritsColor==="to"?bt(this.to.options.color.border,t.opacity):bt(this.from.options.color.border,t.opacity)}else return bt(t.color,t.opacity)}_circle(e,t,r,n,o){this.enableShadow(e,t);let s=0,a=Math.PI*2;if(!this.options.selfReference.renderBehindTheNode){const l=this.options.selfReference.angle,d=this.options.selfReference.angle+Math.PI,h=this._findBorderPositionCircle(this.from,e,{x:r,y:n,low:l,high:d,direction:-1}),c=this._findBorderPositionCircle(this.from,e,{x:r,y:n,low:l,high:d,direction:1});s=Math.atan2(h.y-n,h.x-r),a=Math.atan2(c.y-n,c.x-r)}e.beginPath(),e.arc(r,n,o,s,a,!1),e.stroke(),this.disableShadow(e,t)}getDistanceToEdge(e,t,r,n,o,s){if(this.from!=this.to)return this._getDistanceToEdge(e,t,r,n,o,s);{const[a,l,d]=this._getCircleData(void 0),h=a-o,c=l-s;return Math.abs(Math.sqrt(h*h+c*c)-d)}}_getDistanceToLine(e,t,r,n,o,s){const a=r-e,l=n-t,d=a*a+l*l;let h=((o-e)*a+(s-t)*l)/d;h>1?h=1:h<0&&(h=0);const c=e+h*a,u=t+h*l,f=c-o,v=u-s;return Math.sqrt(f*f+v*v)}getArrowData(e,t,r,n,o,s){let a,l,d,h,c,u,f;const v=s.width;t==="from"?(d=this.from,h=this.to,c=s.fromArrowScale<0,u=Math.abs(s.fromArrowScale),f=s.fromArrowType):t==="to"?(d=this.to,h=this.from,c=s.toArrowScale<0,u=Math.abs(s.toArrowScale),f=s.toArrowType):(d=this.to,h=this.from,c=s.middleArrowScale<0,u=Math.abs(s.middleArrowScale),f=s.middleArrowType);const y=15*u+3*v;if(d!=h){const $=rse(d.x-h.x,d.y-h.y),E=y/$;if(t!=="middle")if(this.options.smooth.enabled===!0){const P=this._findBorderPosition(d,e,{via:r}),D=this.getPoint(P.t+E*(t==="from"?1:-1),r);a=Math.atan2(P.y-D.y,P.x-D.x),l=P}else a=Math.atan2(d.y-h.y,d.x-h.x),l=this._findBorderPosition(d,e);else{const P=(c?-E:E)/2,D=this.getPoint(.5+P,r),L=this.getPoint(.5-P,r);a=Math.atan2(D.y-L.y,D.x-L.x),l=this.getPoint(.5,r)}}else{const[$,E,P]=this._getCircleData(e);if(t==="from"){const D=this.options.selfReference.angle,L=this.options.selfReference.angle+Math.PI,W=this._findBorderPositionCircle(this.from,e,{x:$,y:E,low:D,high:L,direction:-1});a=W.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,l=W}else if(t==="to"){const D=this.options.selfReference.angle,L=this.options.selfReference.angle+Math.PI,W=this._findBorderPositionCircle(this.from,e,{x:$,y:E,low:D,high:L,direction:1});a=W.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,l=W}else{const D=this.options.selfReference.angle/(2*Math.PI);l=this._pointOnCircle($,E,P,D),a=D*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}const g=l.x-y*.9*Math.cos(a),p=l.y-y*.9*Math.sin(a);return{point:l,core:{x:g,y:p},angle:a,length:y,type:f}}drawArrowHead(e,t,r,n,o){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width,lS.draw(e,o)&&(this.enableShadow(e,t),ys(e).call(e),this.disableShadow(e,t))}enableShadow(e,t){t.shadow===!0&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}drawBackground(e,t){if(t.background!==!1){const r={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=t.backgroundColor,e.lineWidth=t.backgroundSize,this.setStrokeDashed(e,t.backgroundDashes),e.stroke(),e.strokeStyle=r.strokeStyle,e.lineWidth=r.lineWidth,e.dashes=r.dashes,this.setStrokeDashed(e,t.dashes)}}setStrokeDashed(e,t){if(t!==!1)if(e.setLineDash!==void 0){const r=ce(t)?t:[5,5];e.setLineDash(r)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else e.setLineDash!==void 0?e.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}function mb(i,e){var t=he(i);if(Rr){var r=Rr(i);e&&(r=ot(r).call(r,function(n){return Hr(i,n).enumerable})),t.push.apply(t,r)}return t}function bb(i){for(var e=1;e<arguments.length;e++){var t,r,n=arguments[e]!=null?arguments[e]:{};e%2?Z(t=mb(Object(n),!0)).call(t,function(o){Zl(i,o,n[o])}):Nr?Jl(i,Nr(n)):Z(r=mb(Object(n))).call(r,function(o){Ql(i,o,Hr(n,o))})}return i}class qf extends dS{constructor(e,t,r){super(e,t,r)}_findBorderPositionBezier(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates();const n=10,o=.2;let s=!1,a=1,l=0,d=this.to,h,c,u=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(d=this.from,s=!0,u=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(u=0);let f=0;do{c=(l+a)*.5,h=this.getPoint(c,r);const v=Math.atan2(d.y-h.y,d.x-h.x),y=d.distanceToBorder(t,v)+u,g=Math.sqrt(Math.pow(h.x-d.x,2)+Math.pow(h.y-d.y,2)),p=y-g;if(Math.abs(p)<o)break;p<0?s===!1?l=c:a=c:s===!1?a=c:l=c,++f}while(l<=a&&f<n);return bb(bb({},h),{},{t:c})}_getDistanceToBezierEdge(e,t,r,n,o,s,a){let l=1e9,d,h,c,u,f,v=e,y=t;for(h=1;h<10;h++)c=.1*h,u=Math.pow(1-c,2)*e+2*c*(1-c)*a.x+Math.pow(c,2)*r,f=Math.pow(1-c,2)*t+2*c*(1-c)*a.y+Math.pow(c,2)*n,h>0&&(d=this._getDistanceToLine(v,y,u,f,o,s),l=d<l?d:l),v=u,y=f;return l}_bezierCurve(e,t,r,n){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),r!=null&&r.x!=null?n!=null&&n.x!=null?e.bezierCurveTo(r.x,r.y,n.x,n.y,this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(r.x,r.y,this.toPoint.x,this.toPoint.y):e.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(e,t),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}getViaNode(){return this._getViaCoordinates()}}class $b extends qf{constructor(e,t,r){super(e,t,r),this.via=this.via,this._boundFunction=()=>{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(e){super.setOptions(e);let t=!1;this.options.physics!==e.physics&&(t=!0),this.options=e,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),t===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.from===void 0||this.to===void 0||this.options.physics===!1?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}cleanup(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),this.via!==void 0?(delete this._body.nodes[this.via.id],this.via=void 0,!0):!1}setupSupportNode(){if(this.via===void 0){const e="edgeId:"+this.id,t=this._body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this._body.nodes[e]=t,this.via=t,this.via.parentEdgeId=this.id,this.positionBezierNode()}}positionBezierNode(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}_line(e,t,r){this._bezierCurve(e,t,r)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){const[r,n,o]=this._getCircleData(),s=2*Math.PI*(1-e);return{x:r+o*Math.sin(s),y:n+o-o*(1-Math.cos(s))}}else return{x:Math.pow(1-e,2)*this.fromPoint.x+2*e*(1-e)*t.x+Math.pow(e,2)*this.toPoint.x,y:Math.pow(1-e,2)*this.fromPoint.y+2*e*(1-e)*t.y+Math.pow(e,2)*this.toPoint.y}}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t,this.via)}_getDistanceToEdge(e,t,r,n,o,s){return this._getDistanceToBezierEdge(e,t,r,n,o,s,this.via)}}class wb extends qf{constructor(e,t,r){super(e,t,r)}_line(e,t,r){this._bezierCurve(e,t,r)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){const e=this.options.smooth.roundness,t=this.options.smooth.type;let r=Math.abs(this.from.x-this.to.x),n=Math.abs(this.from.y-this.to.y);if(t==="discrete"||t==="diagonalCross"){let o,s;r<=n?o=s=e*n:o=s=e*r,this.from.x>this.to.x&&(o=-o),this.from.y>=this.to.y&&(s=-s);let a=this.from.x+o,l=this.from.y+s;return t==="discrete"&&(r<=n?a=r<e*n?this.from.x:a:l=n<e*r?this.from.y:l),{x:a,y:l}}else if(t==="straightCross"){let o=(1-e)*r,s=(1-e)*n;return r<=n?(o=0,this.from.y<this.to.y&&(s=-s)):(this.from.x<this.to.x&&(o=-o),s=0),{x:this.to.x+o,y:this.to.y+s}}else if(t==="horizontal"){let o=(1-e)*r;return this.from.x<this.to.x&&(o=-o),{x:this.to.x+o,y:this.from.y}}else if(t==="vertical"){let o=(1-e)*n;return this.from.y<this.to.y&&(o=-o),{x:this.from.x,y:this.to.y+o}}else if(t==="curvedCW"){r=this.to.x-this.from.x,n=this.from.y-this.to.y;const o=Math.sqrt(r*r+n*n),s=Math.PI,l=(Math.atan2(n,r)+(e*.5+.5)*s)%(2*s);return{x:this.from.x+(e*.5+.5)*o*Math.sin(l),y:this.from.y+(e*.5+.5)*o*Math.cos(l)}}else if(t==="curvedCCW"){r=this.to.x-this.from.x,n=this.from.y-this.to.y;const o=Math.sqrt(r*r+n*n),s=Math.PI,l=(Math.atan2(n,r)+(-e*.5+.5)*s)%(2*s);return{x:this.from.x+(e*.5+.5)*o*Math.sin(l),y:this.from.y+(e*.5+.5)*o*Math.cos(l)}}else{let o,s;r<=n?o=s=e*n:o=s=e*r,this.from.x>this.to.x&&(o=-o),this.from.y>=this.to.y&&(s=-s);let a=this.from.x+o,l=this.from.y+s;return r<=n?this.from.x<=this.to.x?a=this.to.x<a?this.to.x:a:a=this.to.x>a?this.to.x:a:this.from.y>=this.to.y?l=this.to.y>l?this.to.y:l:l=this.to.y<l?this.to.y:l,{x:a,y:l}}}_findBorderPosition(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,t,r.via)}_getDistanceToEdge(e,t,r,n,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,r,n,o,s,a)}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const r=e,n=Math.pow(1-r,2)*this.fromPoint.x+2*r*(1-r)*t.x+Math.pow(r,2)*this.toPoint.x,o=Math.pow(1-r,2)*this.fromPoint.y+2*r*(1-r)*t.y+Math.pow(r,2)*this.toPoint.y;return{x:n,y:o}}}class pse extends qf{constructor(e,t,r){super(e,t,r)}_getDistanceToBezierEdge2(e,t,r,n,o,s,a,l){let d=1e9,h=e,c=t;const u=[0,0,0,0];for(let f=1;f<10;f++){const v=.1*f;u[0]=Math.pow(1-v,3),u[1]=3*v*Math.pow(1-v,2),u[2]=3*Math.pow(v,2)*(1-v),u[3]=Math.pow(v,3);const y=u[0]*e+u[1]*a.x+u[2]*l.x+u[3]*r,g=u[0]*t+u[1]*a.y+u[2]*l.y+u[3]*n;if(f>0){const p=this._getDistanceToLine(h,c,y,g,o,s);d=p<d?p:d}h=y,c=g}return d}}class Eb extends pse{constructor(e,t,r){super(e,t,r)}_line(e,t,r){const n=r[0],o=r[1];this._bezierCurve(e,t,n,o)}_getViaCoordinates(){const e=this.from.x-this.to.x,t=this.from.y-this.to.y;let r,n,o,s;const a=this.options.smooth.roundness;return(Math.abs(e)>Math.abs(t)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(n=this.from.y,s=this.to.y,r=this.from.x-a*e,o=this.to.x+a*e):(n=this.from.y-a*t,s=this.to.y+a*t,r=this.from.x,o=this.to.x),[{x:r,y:n},{x:o,y:s}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t)}_getDistanceToEdge(e,t,r,n,o,s){let[a,l]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,t,r,n,o,s,a,l)}getPoint(e){let[t,r]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const n=e,o=[Math.pow(1-n,3),3*n*Math.pow(1-n,2),3*Math.pow(n,2)*(1-n),Math.pow(n,3)],s=o[0]*this.fromPoint.x+o[1]*t.x+o[2]*r.x+o[3]*this.toPoint.x,a=o[0]*this.fromPoint.y+o[1]*t.y+o[2]*r.y+o[3]*this.toPoint.y;return{x:s,y:a}}}class _b extends dS{constructor(e,t,r){super(e,t,r)}_line(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}getViaNode(){}getPoint(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}_findBorderPosition(e,t){let r=this.to,n=this.from;e.id===this.from.id&&(r=this.from,n=this.to);const o=Math.atan2(r.y-n.y,r.x-n.x),s=r.x-n.x,a=r.y-n.y,l=Math.sqrt(s*s+a*a),d=e.distanceToBorder(t,o),h=(l-d)/l;return{x:(1-h)*n.x+h*r.x,y:(1-h)*n.y+h*r.y,t:0}}_getDistanceToEdge(e,t,r,n,o,s){return this._getDistanceToLine(e,t,r,n,o,s)}}class Dr{constructor(e,t,r,n,o){if(t===void 0)throw new Error("No body provided");this.options=Ar(n),this.globalOptions=n,this.defaultOptions=o,this.body=t,this.imagelist=r,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 tn(this.body,this.options,!0),this.setOptions(e)}setOptions(e){if(!e)return;let t=typeof e.physics<"u"&&this.options.physics!==e.physics||typeof e.hidden<"u"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from<"u"&&this.options.from!==e.from||typeof e.to<"u"&&this.options.to!==e.to;Dr.parseOptions(this.options,e,!0,this.globalOptions),e.id!==void 0&&(this.id=e.id),e.from!==void 0&&(this.fromId=e.from),e.to!==void 0&&(this.toId=e.to),e.title!==void 0&&(this.title=e.title),e.value!==void 0&&(e.value=Q_(e.value));const r=[e,this.options,this.defaultOptions];return this.chooser=Gf("edge",r),this.updateLabelModule(e),t=this.updateEdgeType()||t,this._setInteractionWidths(),this.connect(),t}static parseOptions(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(zn(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],e,t,r),t.endPointOffset!==void 0&&t.endPointOffset.from!==void 0&&(Zr(t.endPointOffset.from)?e.endPointOffset.from=t.endPointOffset.from:(e.endPointOffset.from=n.endPointOffset.from!==void 0?n.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),t.endPointOffset!==void 0&&t.endPointOffset.to!==void 0&&(Zr(t.endPointOffset.to)?e.endPointOffset.to=t.endPointOffset.to:(e.endPointOffset.to=n.endPointOffset.to!==void 0?n.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),Ja(t.label)?e.label=t.label:Ja(e.label)||(e.label=void 0),mt(e,t,"smooth",n),mt(e,t,"shadow",n),mt(e,t,"background",n),t.dashes!==void 0&&t.dashes!==null?e.dashes=t.dashes:r===!0&&t.dashes===null&&(e.dashes=oi(n.dashes)),t.scaling!==void 0&&t.scaling!==null?(t.scaling.min!==void 0&&(e.scaling.min=t.scaling.min),t.scaling.max!==void 0&&(e.scaling.max=t.scaling.max),mt(e.scaling,t.scaling,"label",n.scaling)):r===!0&&t.scaling===null&&(e.scaling=oi(n.scaling)),t.arrows!==void 0&&t.arrows!==null)if(typeof t.arrows=="string"){const a=t.arrows.toLowerCase();e.arrows.to.enabled=q(a).call(a,"to")!=-1,e.arrows.middle.enabled=q(a).call(a,"middle")!=-1,e.arrows.from.enabled=q(a).call(a,"from")!=-1}else if(typeof t.arrows=="object")mt(e.arrows,t.arrows,"to",n.arrows),mt(e.arrows,t.arrows,"middle",n.arrows),mt(e.arrows,t.arrows,"from",n.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+gs(t.arrows));else r===!0&&t.arrows===null&&(e.arrows=oi(n.arrows));if(t.color!==void 0&&t.color!==null){const a=Qi(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,l=e.color;if(o)Q(l,n.color,!1,r);else for(const d in l)Object.prototype.hasOwnProperty.call(l,d)&&delete l[d];if(Qi(l))l.color=l,l.highlight=l,l.hover=l,l.inherit=!1,a.opacity===void 0&&(l.opacity=1);else{let d=!1;a.color!==void 0&&(l.color=a.color,d=!0),a.highlight!==void 0&&(l.highlight=a.highlight,d=!0),a.hover!==void 0&&(l.hover=a.hover,d=!0),a.inherit!==void 0&&(l.inherit=a.inherit),a.opacity!==void 0&&(l.opacity=Math.min(1,Math.max(0,a.opacity))),d===!0?l.inherit=!1:l.inherit===void 0&&(l.inherit="from")}}else r===!0&&t.color===null&&(e.color=Ar(n.color));r===!0&&t.font===null&&(e.font=Ar(n.font)),Object.prototype.hasOwnProperty.call(t,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),e.selfReference.size=t.selfReferenceSize)}getFormattingValues(){const e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,t=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,r=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,n=this.options.color.inherit,o={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:r,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color: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(this.chooser===!0){if(this.selected){const s=this.options.selectionWidth;typeof s=="function"?o.width=s(o.width):typeof s=="number"&&(o.width+=s),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 s=this.options.hoverWidth;typeof s=="function"?o.width=s(o.width):typeof s=="number"&&(o.width+=s),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.hover,o.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(o,this.options.id,this.selected,this.hover),o.color!==void 0&&(o.inheritsColor=!1),o.shadow===!1&&(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(e){const t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){const e=this.options.smooth;let t=!1,r=!0;return this.edgeType!==void 0&&((this.edgeType instanceof $b&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof Eb&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof wb&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof _b&&e.type.enabled===!1)&&(r=!1),r===!0&&(t=this.cleanup())),r===!0?e.enabled===!0?e.type==="dynamic"?(t=!0,this.edgeType=new $b(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new Eb(this.options,this.body,this.labelModule):this.edgeType=new wb(this.options,this.body,this.labelModule):this.edgeType=new _b(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}connect(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=this.from!==void 0&&this.to!==void 0,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}disconnect(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}getTitle(){return this.title}isSelected(){return this.selected}getValue(){return this.options.value}setValueRange(e,t,r){if(this.options.value!==void 0){const n=this.options.scaling.customScalingFunction(e,t,r,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*s}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(){typeof this.options.hoverWidth=="function"?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth=="function"?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}draw(e){const t=this.getFormattingValues();if(t.hidden)return;const r=this.edgeType.getViaNode();this.edgeType.drawLine(e,t,this.selected,this.hover,r),this.drawLabel(e,r)}drawArrows(e){const t=this.getFormattingValues();if(t.hidden)return;const r=this.edgeType.getViaNode(),n={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(n.from=this.edgeType.getArrowData(e,"from",r,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.fromPoint=n.from.core),t.fromArrowSrc&&(n.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(n.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(n.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(n.to=this.edgeType.getArrowData(e,"to",r,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.toPoint=n.to.core),t.toArrowSrc&&(n.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(n.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(n.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(n.middle=this.edgeType.getArrowData(e,"middle",r,this.selected,this.hover,t),t.middleArrowSrc&&(n.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(n.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(n.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,n.from),t.middleArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,n.middle),t.toArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,n.to)}drawLabel(e,t){if(this.options.label!==void 0){const r=this.from,n=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);let o;if(r.id!=n.id){this.labelModule.pointToSelf=!1,o=this.edgeType.getPoint(.5,t),e.save();const s=this._getRotation(e);s.angle!=0&&(e.translate(s.x,s.y),e.rotate(s.angle)),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;const s=sS(e,this.options.selfReference.angle,this.options.selfReference.size,r);o=this._pointOnCircle(s.x,s.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover)}}}getItemsOnPoint(e){const t=[];if(this.labelModule.visible()){const n=this._getRotation();$u(this.labelModule.getSize(),e,n)&&t.push({edgeId:this.id,labelId:0})}const r={left:e.x,top:e.y};return this.isOverlappingWith(r)&&t.push({edgeId:this.id}),t}isOverlappingWith(e){if(this.connected){const r=this.from.x,n=this.from.y,o=this.to.x,s=this.to.y,a=e.left,l=e.top;return this.edgeType.getDistanceToEdge(r,n,o,s,a,l)<10}else return!1}_getRotation(e){const t=this.edgeType.getViaNode(),r=this.edgeType.getPoint(.5,t);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,r.x,r.y);const n={x:r.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return n;const o=this.from.y-this.to.y,s=this.from.x-this.to.x;let a=Math.atan2(o,s);return(a<-1&&s<0||a>0&&s<0)&&(a+=Math.PI),n.angle=a,n}_pointOnCircle(e,t,r,n){return{x:e+r*Math.cos(n),y:t-r*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 this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}}class gse{constructor(e,t,r){var n;this.body=e,this.images=t,this.groups=r,this.body.functions.createEdge=_(n=this.create).call(n,this),this.edgesListeners={add:(o,s)=>{this.add(s.items)},update:(o,s)=>{this.update(s.items)},remove:(o,s)=>{this.remove(s.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(o,s,a,l){if(s===o)return .5;{const d=1/(s-o);return Math.max(0,(l-o)*d)}}},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},Q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e=this,t,r;this.body.emitter.on("_forceDisableDynamicCurves",function(n){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;n==="dynamic"&&(n="continuous");let s=!1;for(const a in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,a)){const l=e.body.edges[a],d=e.body.data.edges.get(a);if(d!=null){const h=d.smooth;h!==void 0&&h.enabled===!0&&h.type==="dynamic"&&(n===void 0?l.setOptions({smooth:!1}):l.setOptions({smooth:{type:n}}),s=!0)}}o===!0&&s===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",()=>{this.reconnectEdges()}),this.body.emitter.on("refreshEdges",_(t=this.refresh).call(t,this)),this.body.emitter.on("refresh",_(r=this.refresh).call(r,this)),this.body.emitter.on("destroy",()=>{H(this.edgesListeners,(n,o)=>{this.body.data.edges&&this.body.data.edges.off(o,n)}),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners})}setOptions(e){if(e!==void 0){Dr.parseOptions(this.options,e,!0,this.defaultOptions,!0);let t=!1;if(e.smooth!==void 0)for(const r in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,r)&&(t=this.body.edges[r].updateEdgeType()||t);if(e.font!==void 0)for(const r in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,r)&&this.body.edges[r].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||t===!0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.body.data.edges;if(_0("id",e))this.body.data.edges=e;else if(ce(e))this.body.data.edges=new ja,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new ja;else throw new TypeError("Array or DataSet expected");if(r&&H(this.edgesListeners,(n,o)=>{r.off(o,n)}),this.body.edges={},this.body.data.edges){H(this.edgesListeners,(o,s)=>{this.body.data.edges.on(s,o)});const n=this.body.data.edges.getIds();this.add(n,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.body.edges,n=this.body.data.edges;for(let o=0;o<e.length;o++){const s=e[o],a=r[s];a&&a.disconnect();const l=n.get(s,{showInternalIds:!0});r[s]=this.create(l)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),t===!1&&this.body.emitter.emit("_dataChanged")}update(e){const t=this.body.edges,r=this.body.data.edges;let n=!1;for(let o=0;o<e.length;o++){const s=e[o],a=r.get(s),l=t[s];l!==void 0?(l.disconnect(),n=l.setOptions(a)||n,l.connect()):(this.body.edges[s]=this.create(a),n=!0)}n===!0?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}remove(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length===0)return;const r=this.body.edges;H(e,n=>{const o=r[n];o!==void 0&&o.remove()}),t&&this.body.emitter.emit("_dataChanged")}refresh(){H(this.body.edges,(e,t)=>{const r=this.body.data.edges.get(t);r!==void 0&&e.setOptions(r)})}create(e){return new Dr(e,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let e;const t=this.body.nodes,r=this.body.edges;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e].edges=[]);for(e in r)if(Object.prototype.hasOwnProperty.call(r,e)){const n=r[e];n.from=null,n.to=null,n.connect()}}getConnectedNodes(e){const t=[];if(this.body.edges[e]!==void 0){const r=this.body.edges[e];r.fromId!==void 0&&t.push(r.fromId),r.toId!==void 0&&t.push(r.toId)}return t}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){const e=[];H(this.body.edges,(t,r)=>{const n=this.body.nodes[t.toId],o=this.body.nodes[t.fromId];n!==void 0&&n.isCluster===!0||o!==void 0&&o.isCluster===!0||(n===void 0||o===void 0)&&e.push(r)}),this.remove(e,!1)}_addMissingEdges(){const e=this.body.data.edges;if(e==null)return;const t=this.body.edges,r=[];Z(e).call(e,(n,o)=>{t[o]===void 0&&r.push(o)}),this.add(r,!0)}}class hS{constructor(e,t,r){this.body=e,this.physicsBody=t,this.barnesHutTree,this.setOptions(r),this._rng=ql("BARNES HUT SOLVER")}setOptions(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}solve(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){let e;const t=this.body.nodes,r=this.physicsBody.physicsNodeIndices,n=r.length,o=this._formBarnesHutTree(t,r);this.barnesHutTree=o;for(let s=0;s<n;s++)e=t[r[s]],e.options.mass>0&&this._getForceContributions(o.root,e)}}_getForceContributions(e,t){this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)}_getForceContribution(e,t){if(e.childrenCount>0){const r=e.centerOfMass.x-t.x,n=e.centerOfMass.y-t.y,o=Math.sqrt(r*r+n*n);o*e.calcSize>this.thetaInversed?this._calculateForces(o,r,n,t,e):e.childrenCount===4?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(o,r,n,t,e)}}_calculateForces(e,t,r,n,o){e===0&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&n.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*n.shape.radius,e-n.shape.radius));const s=this.options.gravitationalConstant*o.mass*n.options.mass/Math.pow(e,3),a=t*s,l=r*s;this.physicsBody.forces[n.id].x+=a,this.physicsBody.forces[n.id].y+=l}_formBarnesHutTree(e,t){let r;const n=t.length;let o=e[t[0]].x,s=e[t[0]].y,a=e[t[0]].x,l=e[t[0]].y;for(let g=1;g<n;g++){const p=e[t[g]],m=p.x,$=p.y;p.options.mass>0&&(m<o&&(o=m),m>a&&(a=m),$<s&&(s=$),$>l&&(l=$))}const d=Math.abs(a-o)-Math.abs(l-s);d>0?(s-=.5*d,l+=.5*d):(o+=.5*d,a-=.5*d);const c=Math.max(1e-5,Math.abs(a-o)),u=.5*c,f=.5*(o+a),v=.5*(s+l),y={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:f-u,maxX:f+u,minY:v-u,maxY:v+u},size:c,calcSize:1/c,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(y.root);for(let g=0;g<n;g++)r=e[t[g]],r.options.mass>0&&this._placeInTree(y.root,r);return y}_updateBranchMass(e,t){const r=e.centerOfMass,n=e.mass+t.options.mass,o=1/n;r.x=r.x*e.mass+t.x*t.options.mass,r.x*=o,r.y=r.y*e.mass+t.y*t.options.mass,r.y*=o,e.mass=n;const s=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidth<s?s:e.maxWidth}_placeInTree(e,t,r){(r!=!0||r===void 0)&&this._updateBranchMass(e,t);const n=e.children.NW.range;let o;n.maxX>t.x?n.maxY>t.y?o="NW":o="SW":n.maxY>t.y?o="NE":o="SE",this._placeInRegion(e,t,o)}_placeInRegion(e,t,r){const n=e.children[r];switch(n.childrenCount){case 0:n.children.data=t,n.childrenCount=1,this._updateBranchMass(n,t);break;case 1:n.children.data.x===t.x&&n.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(n),this._placeInTree(n,t));break;case 4:this._placeInTree(n,t);break}}_splitBranch(e){let t=null;e.childrenCount===1&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),t!=null&&this._placeInTree(e,t)}_insertRegion(e,t){let r,n,o,s;const a=.5*e.size;switch(t){case"NW":r=e.range.minX,n=e.range.minX+a,o=e.range.minY,s=e.range.minY+a;break;case"NE":r=e.range.minX+a,n=e.range.maxX,o=e.range.minY,s=e.range.minY+a;break;case"SW":r=e.range.minX,n=e.range.minX+a,o=e.range.minY+a,s=e.range.maxY;break;case"SE":r=e.range.minX+a,n=e.range.maxX,o=e.range.minY+a,s=e.range.maxY;break}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:r,maxX:n,minY:o,maxY:s},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}_debug(e,t){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}_drawBranch(e,t,r){r===void 0&&(r="#FF0000"),e.childrenCount===4&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=r,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}class yse{constructor(e,t,r){this._rng=ql("REPULSION SOLVER"),this.body=e,this.physicsBody=t,this.setOptions(r)}setOptions(e){this.options=e}solve(){let e,t,r,n,o,s,a,l;const d=this.body.nodes,h=this.physicsBody.physicsNodeIndices,c=this.physicsBody.forces,u=this.options.nodeDistance,f=-2/3/u,v=4/3;for(let y=0;y<h.length-1;y++){a=d[h[y]];for(let g=y+1;g<h.length;g++)l=d[h[g]],e=l.x-a.x,t=l.y-a.y,r=Math.sqrt(e*e+t*t),r===0&&(r=.1*this._rng(),e=r),r<2*u&&(r<.5*u?s=1:s=f*r+v,s=s/r,n=e*s,o=t*s,c[a.id].x-=n,c[a.id].y-=o,c[l.id].x+=n,c[l.id].y+=o)}}}class mse{constructor(e,t,r){this.body=e,this.physicsBody=t,this.setOptions(r)}setOptions(e){this.options=e,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}solve(){const e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,r=this.physicsBody.forces,n=this.options.nodeDistance;for(let o=0;o<t.length-1;o++){const s=e[t[o]];for(let a=o+1;a<t.length;a++){const l=e[t[a]];if(s.level===l.level){const d=n+this.overlapAvoidanceFactor*((s.shape.radius||0)/2+(l.shape.radius||0)/2),h=l.x-s.x,c=l.y-s.y,u=Math.sqrt(h*h+c*c),f=.05;let v;u<d?v=-Math.pow(f*u,2)+Math.pow(f*d,2):v=0,u!==0&&(v=v/u);const y=h*v,g=c*v;r[s.id].x-=y,r[s.id].y-=g,r[l.id].x+=y,r[l.id].y+=g}}}}}class ac{constructor(e,t,r){this.body=e,this.physicsBody=t,this.setOptions(r)}setOptions(e){this.options=e}solve(){let e,t;const r=this.physicsBody.physicsEdgeIndices,n=this.body.edges;let o,s,a;for(let l=0;l<r.length;l++)t=n[r[l]],t.connected===!0&&t.toId!==t.fromId&&this.body.nodes[t.toId]!==void 0&&this.body.nodes[t.fromId]!==void 0&&(t.edgeType.via!==void 0?(e=t.options.length===void 0?this.options.springLength:t.options.length,o=t.to,s=t.edgeType.via,a=t.from,this._calculateSpringForce(o,s,.5*e),this._calculateSpringForce(s,a,.5*e)):(e=t.options.length===void 0?this.options.springLength*1.5:t.options.length,this._calculateSpringForce(t.from,t.to,e)))}_calculateSpringForce(e,t,r){const n=e.x-t.x,o=e.y-t.y,s=Math.max(Math.sqrt(n*n+o*o),.01),a=this.options.springConstant*(r-s)/s,l=n*a,d=o*a;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=l,this.physicsBody.forces[e.id].y+=d),this.physicsBody.forces[t.id]!==void 0&&(this.physicsBody.forces[t.id].x-=l,this.physicsBody.forces[t.id].y-=d)}}class bse{constructor(e,t,r){this.body=e,this.physicsBody=t,this.setOptions(r)}setOptions(e){this.options=e}solve(){let e,t,r,n,o,s,a,l;const d=this.body.edges,h=.5,c=this.physicsBody.physicsEdgeIndices,u=this.physicsBody.physicsNodeIndices,f=this.physicsBody.forces;for(let E=0;E<u.length;E++){const P=u[E];f[P].springFx=0,f[P].springFy=0}for(let E=0;E<c.length;E++)t=d[c[E]],t.connected===!0&&(e=t.options.length===void 0?this.options.springLength:t.options.length,r=t.from.x-t.to.x,n=t.from.y-t.to.y,l=Math.sqrt(r*r+n*n),l=l===0?.01:l,a=this.options.springConstant*(e-l)/l,o=r*a,s=n*a,t.to.level!=t.from.level?(f[t.toId]!==void 0&&(f[t.toId].springFx-=o,f[t.toId].springFy-=s),f[t.fromId]!==void 0&&(f[t.fromId].springFx+=o,f[t.fromId].springFy+=s)):(f[t.toId]!==void 0&&(f[t.toId].x-=h*o,f[t.toId].y-=h*s),f[t.fromId]!==void 0&&(f[t.fromId].x+=h*o,f[t.fromId].y+=h*s)));a=1;let v,y;for(let E=0;E<u.length;E++){const P=u[E];v=Math.min(a,Math.max(-a,f[P].springFx)),y=Math.min(a,Math.max(-a,f[P].springFy)),f[P].x+=v,f[P].y+=y}let g=0,p=0;for(let E=0;E<u.length;E++){const P=u[E];g+=f[P].x,p+=f[P].y}const m=g/u.length,$=p/u.length;for(let E=0;E<u.length;E++){const P=u[E];f[P].x-=m,f[P].y-=$}}}class Sa{constructor(e,t,r){this.body=e,this.physicsBody=t,this.setOptions(r)}setOptions(e){this.options=e}solve(){let e,t,r,n;const o=this.body.nodes,s=this.physicsBody.physicsNodeIndices,a=this.physicsBody.forces;for(let l=0;l<s.length;l++){const d=s[l];n=o[d],e=-n.x,t=-n.y,r=Math.sqrt(e*e+t*t),this._calculateForces(r,e,t,a,n)}}_calculateForces(e,t,r,n,o){const s=e===0?0:this.options.centralGravity/e;n[o.id].x=t*s,n[o.id].y=r*s}}class $se extends hS{constructor(e,t,r){super(e,t,r),this._rng=ql("FORCE ATLAS 2 BASED REPULSION SOLVER")}_calculateForces(e,t,r,n,o){e===0&&(e=.1*this._rng(),t=e),this.overlapAvoidanceFactor<1&&n.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*n.shape.radius,e-n.shape.radius));const s=n.edges.length+1,a=this.options.gravitationalConstant*o.mass*n.options.mass*s/Math.pow(e,2),l=t*a,d=r*a;this.physicsBody.forces[n.id].x+=l,this.physicsBody.forces[n.id].y+=d}}class wse extends Sa{constructor(e,t,r){super(e,t,r)}_calculateForces(e,t,r,n,o){if(e>0){const s=o.edges.length+1,a=this.options.centralGravity*s*o.options.mass;n[o.id].x=t*a,n[o.id].y=r*a}}}class Ese{constructor(e){this.body=e,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},Ee(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("initPhysics",()=>{this.initPhysics()}),this.body.emitter.on("_layoutFailed",()=>{this.layoutFailed=!0}),this.body.emitter.on("resetPhysics",()=>{this.stopSimulation(),this.ready=!1}),this.body.emitter.on("disablePhysics",()=>{this.physicsEnabled=!1,this.stopSimulation()}),this.body.emitter.on("restorePhysics",()=>{this.setOptions(this.options),this.ready===!0&&this.startSimulation()}),this.body.emitter.on("startSimulation",()=>{this.ready===!0&&this.startSimulation()}),this.body.emitter.on("stopSimulation",()=>{this.stopSimulation()}),this.body.emitter.on("destroy",()=>{this.stopSimulation(!1),this.body.emitter.off()}),this.body.emitter.on("_dataChanged",()=>{this.updatePhysicsData()})}setOptions(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,Ya(["stabilization"],this.options,e),mt(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());const t=this.options.wind;t&&((typeof t.x!="number"||bu(t.x))&&(t.x=0),(typeof t.y!="number"||bu(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}init(){let e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new $se(this.body,this.physicsBody,e),this.edgesSolver=new ac(this.body,this.physicsBody,e),this.gravitySolver=new wse(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new yse(this.body,this.physicsBody,e),this.edgesSolver=new ac(this.body,this.physicsBody,e),this.gravitySolver=new Sa(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new mse(this.body,this.physicsBody,e),this.edgesSolver=new bse(this.body,this.physicsBody,e),this.gravitySolver=new Sa(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new hS(this.body,this.physicsBody,e),this.edgesSolver=new ac(this.body,this.physicsBody,e),this.gravitySolver=new Sa(this.body,this.physicsBody,e)),this.modelOptions=e}initPhysics(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}startSimulation(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),this.viewFunction===void 0){var e;this.viewFunction=_(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}stopSimulation(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}simulationStep(){const e=Va();this.physicsTick(),(Va()-e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}_emitStabilized(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&nr(()=>{this.body.emitter.emit("stabilized",{iterations:e}),this.startedStabilization=!1,this.stabilizationIterations=0},0)}physicsStep(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}adjustTimeStep(){this._evaluateStepQuality()===!0?this.timestep=1.2*this.timestep:this.timestep/1.2<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/1.2))}physicsTick(){this._startStabilizing(),this.stabilized!==!0&&(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0?(this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.physicsStep(),this.revert(),this.timestep=.5*this.timestep,this.physicsStep(),this.physicsStep(),this.adjustTimeStep()):this.physicsStep(),this.adaptiveCounter+=1):(this.timestep=this.options.timestep,this.physicsStep()),this.stabilized===!0&&this.revert(),this.stabilizationIterations++)}updatePhysicsData(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];const e=this.body.nodes,t=this.body.edges;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&e[r].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[r].id);for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&t[r].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(t[r].id);for(let r=0;r<this.physicsBody.physicsNodeIndices.length;r++){const n=this.physicsBody.physicsNodeIndices[r];this.physicsBody.forces[n]={x:0,y:0},this.physicsBody.velocities[n]===void 0&&(this.physicsBody.velocities[n]={x:0,y:0})}for(const r in this.physicsBody.velocities)e[r]===void 0&&delete this.physicsBody.velocities[r]}revert(){const e=he(this.previousStates),t=this.body.nodes,r=this.physicsBody.velocities;this.referenceState={};for(let n=0;n<e.length;n++){const o=e[n];t[o]!==void 0?t[o].options.physics===!0&&(this.referenceState[o]={positions:{x:t[o].x,y:t[o].y}},r[o].x=this.previousStates[o].vx,r[o].y=this.previousStates[o].vy,t[o].x=this.previousStates[o].x,t[o].y=this.previousStates[o].y):delete this.previousStates[o]}}_evaluateStepQuality(){let e,t,r;const n=this.body.nodes,o=this.referenceState,s=.3;for(const a in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,a)&&n[a]!==void 0&&(e=n[a].x-o[a].positions.x,t=n[a].y-o[a].positions.y,r=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),r>s))return!1;return!0}moveNodes(){const e=this.physicsBody.physicsNodeIndices;let t=0,r=0;const n=5;for(let o=0;o<e.length;o++){const s=e[o],a=this._performStep(s);t=Math.max(t,a),r+=a}this.adaptiveTimestepEnabled=r/e.length<n,this.stabilized=t<this.options.minVelocity}calculateComponentVelocity(e,t,r){const n=this.modelOptions.damping*e,o=(t-n)/r;e+=o*this.timestep;const s=this.options.maxVelocity||1e9;return Math.abs(e)>s&&(e=e>0?s:-s),e}_performStep(e){const t=this.body.nodes[e],r=this.physicsBody.forces[e];this.options.wind&&(r.x+=this.options.wind.x,r.y+=this.options.wind.y);const n=this.physicsBody.velocities[e];return this.previousStates[e]={x:t.x,y:t.y,vx:n.x,vy:n.y},t.options.fixed.x===!1?(n.x=this.calculateComponentVelocity(n.x,r.x,t.options.mass),t.x+=n.x*this.timestep):(r.x=0,n.x=0),t.options.fixed.y===!1?(n.y=this.calculateComponentVelocity(n.y,r.y,t.options.mass),t.y+=n.y*this.timestep):(r.y=0,n.y=0),Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2))}_freezeNodes(){const e=this.body.nodes;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t].x&&e[t].y){const r=e[t].options.fixed;this.freezeCache[t]={x:r.x,y:r.y},r.x=!0,r.y=!0}}_restoreFrozenNodes(){const e=this.body.nodes;for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.freezeCache[t]!==void 0&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}stabilize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof e!="number"&&(e=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",e)),this.physicsBody.physicsNodeIndices.length===0){this.ready=!0;return}this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,nr(()=>this._stabilizationBatch(),0)}_startStabilizing(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){const e=()=>this.stabilized===!1&&this.stabilizationIterations<this.targetIterations,t=()=>{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&t();let r=0;for(;e()&&r<this.options.stabilization.updateInterval;)this.physicsTick(),r++;if(t(),e()){var n;nr(_(n=this._stabilizationBatch).call(n,this),0)}else this._finalizeStabilization()}_finalizeStabilization(){this.body.emitter.emit("_allowRedraw"),this.options.stabilization.fit===!0&&this.body.emitter.emit("fit"),this.options.stabilization.onlyDynamicEdges===!0&&this._restoreFrozenNodes(),this.body.emitter.emit("stabilizationIterationsDone"),this.body.emitter.emit("_requestRedraw"),this.stabilized===!0?this._emitStabilized():this.startSimulation(),this.ready=!0}_drawForces(e){for(let t=0;t<this.physicsBody.physicsNodeIndices.length;t++){const r=this.physicsBody.physicsNodeIndices[t],n=this.body.nodes[r],o=this.physicsBody.forces[r],s=20,a=.03,l=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.x,2)),d=Math.min(Math.max(5,l),15),h=3*d,c=gu((180-Math.min(1,Math.max(0,a*l))*180)/360,1,1),u={x:n.x+s*o.x,y:n.y+s*o.y};e.lineWidth=d,e.strokeStyle=c,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(u.x,u.y),e.stroke();const f=Math.atan2(o.y,o.x);e.fillStyle=c,lS.draw(e,{type:"arrow",point:u,angle:f,length:h}),ys(e).call(e)}}}let na;const _se=new Uint8Array(16);function Sse(){if(!na&&(na=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!na))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return na(_se)}const Fe=[];for(let i=0;i<256;++i)Fe.push((i+256).toString(16).slice(1));function Ose(i,e=0){return Fe[i[e+0]]+Fe[i[e+1]]+Fe[i[e+2]]+Fe[i[e+3]]+"-"+Fe[i[e+4]]+Fe[i[e+5]]+"-"+Fe[i[e+6]]+Fe[i[e+7]]+"-"+Fe[i[e+8]]+Fe[i[e+9]]+"-"+Fe[i[e+10]]+Fe[i[e+11]]+Fe[i[e+12]]+Fe[i[e+13]]+Fe[i[e+14]]+Fe[i[e+15]]}const Tse=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var Sb={randomUUID:Tse};function ao(i,e,t){if(Sb.randomUUID&&!i)return Sb.randomUUID();i=i||{};const r=i.random||(i.rng||Sse)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ose(r)}class Ye{constructor(){}static getRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=1e9,n=-1e9,o=1e9,s=-1e9,a;if(t.length>0)for(let l=0;l<t.length;l++)a=e[t[l]],o>a.shape.boundingBox.left&&(o=a.shape.boundingBox.left),s<a.shape.boundingBox.right&&(s=a.shape.boundingBox.right),r>a.shape.boundingBox.top&&(r=a.shape.boundingBox.top),n<a.shape.boundingBox.bottom&&(n=a.shape.boundingBox.bottom);return o===1e9&&s===-1e9&&r===1e9&&n===-1e9&&(r=0,n=0,o=0,s=0),{minX:o,maxX:s,minY:r,maxY:n}}static getRangeCore(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=1e9,n=-1e9,o=1e9,s=-1e9,a;if(t.length>0)for(let l=0;l<t.length;l++)a=e[t[l]],o>a.x&&(o=a.x),s<a.x&&(s=a.x),r>a.y&&(r=a.y),n<a.y&&(n=a.y);return o===1e9&&s===-1e9&&r===1e9&&n===-1e9&&(r=0,n=0,o=0,s=0),{minX:o,maxX:s,minY:r,maxY:n}}static findCenter(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}static cloneOptions(e,t){const r={};return t===void 0||t==="node"?(Q(r,e.options,!0),r.x=e.x,r.y=e.y,r.amountOfConnections=e.edges.length):Q(r,e.options,!0),r}}class Ise extends ie{constructor(e,t,r,n,o,s){super(e,t,r,n,o,s),this.isCluster=!0,this.containedNodes={},this.containedEdges={}}_openChildCluster(e){const t=this.body.nodes[e];if(this.containedNodes[e]===void 0)throw new Error("node with id: "+e+" not in current cluster");if(!t.isCluster)throw new Error("node with id: "+e+" is not a cluster");delete this.containedNodes[e],H(t.edges,r=>{delete this.containedEdges[r.id]}),H(t.containedNodes,(r,n)=>{this.containedNodes[n]=r}),t.containedNodes={},H(t.containedEdges,(r,n)=>{this.containedEdges[n]=r}),t.containedEdges={},H(t.edges,r=>{H(this.edges,n=>{var o,s;const a=q(o=n.clusteringEdgeReplacingIds).call(o,r.id);a!==-1&&(H(r.clusteringEdgeReplacingIds,l=>{n.clusteringEdgeReplacingIds.push(l),this.body.edges[l].edgeReplacedById=n.id}),ir(s=n.clusteringEdgeReplacingIds).call(s,a,1))})}),t.edges=[]}}class Pse{constructor(e){this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},Ee(this.options,this.defaultOptions),this.body.emitter.on("_resetData",()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(e,t){e===void 0?e=this._getHubSize():typeof e=="object"&&(t=this._checkOptions(e),e=this._getHubSize());const r=[];for(let n=0;n<this.body.nodeIndices.length;n++){const o=this.body.nodes[this.body.nodeIndices[n]];o.edges.length>=e&&r.push(o.id)}for(let n=0;n<r.length;n++)this.clusterByConnection(r[n],t,!0);this.body.emitter.emit("_dataChanged")}cluster(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);const r={},n={};H(this.body.nodes,(o,s)=>{o.options&&e.joinCondition(o.options)===!0&&(r[s]=o,H(o.edges,a=>{this.clusteredEdges[a.id]===void 0&&(n[a.id]=a)}))}),this._cluster(r,n,e,t)}clusterByEdgeCount(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;t=this._checkOptions(t);const n=[],o={};let s,a,l;for(let d=0;d<this.body.nodeIndices.length;d++){const h={},c={},u=this.body.nodeIndices[d],f=this.body.nodes[u];if(o[u]===void 0){l=0,a=[];for(let v=0;v<f.edges.length;v++)s=f.edges[v],this.clusteredEdges[s.id]===void 0&&(s.toId!==s.fromId&&l++,a.push(s));if(l===e){const v=function(g){if(t.joinCondition===void 0||t.joinCondition===null)return!0;const p=Ye.cloneOptions(g);return t.joinCondition(p)};let y=!0;for(let g=0;g<a.length;g++){s=a[g];const p=this._getConnectedId(s,u);if(v(f))c[s.id]=s,h[u]=f,h[p]=this.body.nodes[p],o[u]=!0;else{y=!1;break}}if(he(h).length>0&&he(c).length>0&&y===!0){const p=function(){for(let m=0;m<n.length;++m)for(const $ in h)if(n[m].nodes[$]!==void 0)return n[m]}();if(p!==void 0){for(const m in h)p.nodes[m]===void 0&&(p.nodes[m]=h[m]);for(const m in c)p.edges[m]===void 0&&(p.edges[m]=c[m])}else n.push({nodes:h,edges:c})}}}}for(let d=0;d<n.length;d++)this._cluster(n[d].nodes,n[d].edges,t,!1);r===!0&&this.body.emitter.emit("_dataChanged")}clusterOutliers(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,t)}clusterBridges(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,t)}clusterByConnection(e,t){var r;let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No nodeId supplied to clusterByConnection!");if(this.body.nodes[e]===void 0)throw new Error("The nodeId given to clusterByConnection does not exist!");const o=this.body.nodes[e];t=this._checkOptions(t,o),t.clusterNodeProperties.x===void 0&&(t.clusterNodeProperties.x=o.x),t.clusterNodeProperties.y===void 0&&(t.clusterNodeProperties.y=o.y),t.clusterNodeProperties.fixed===void 0&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=o.options.fixed.x,t.clusterNodeProperties.fixed.y=o.options.fixed.y);const s={},a={},l=o.id,d=Ye.cloneOptions(o);s[l]=o;for(let c=0;c<o.edges.length;c++){const u=o.edges[c];if(this.clusteredEdges[u.id]===void 0){const f=this._getConnectedId(u,l);if(this.clusteredNodes[f]===void 0)if(f!==l)if(t.joinCondition===void 0)a[u.id]=u,s[f]=this.body.nodes[f];else{const v=Ye.cloneOptions(this.body.nodes[f]);t.joinCondition(d,v)===!0&&(a[u.id]=u,s[f]=this.body.nodes[f])}else a[u.id]=u}}const h=fn(r=he(s)).call(r,function(c){return s[c].id});for(const c in s){if(!Object.prototype.hasOwnProperty.call(s,c))continue;const u=s[c];for(let f=0;f<u.edges.length;f++){const v=u.edges[f];q(h).call(h,this._getConnectedId(v,u.id))>-1&&(a[v.id]=v)}}this._cluster(s,a,t,n)}_createClusterEdges(e,t,r,n){let o,s,a,l,d,h;const c=he(e),u=[];for(let y=0;y<c.length;y++){s=c[y],a=e[s];for(let g=0;g<a.edges.length;g++)o=a.edges[g],this.clusteredEdges[o.id]===void 0&&(o.toId==o.fromId?t[o.id]=o:o.toId==s?(l=r.id,d=o.fromId,h=d):(l=o.toId,d=r.id,h=l),e[h]===void 0&&u.push({edge:o,fromId:d,toId:l}))}const f=[],v=function(y){for(let g=0;g<f.length;g++){const p=f[g],m=y.fromId===p.fromId&&y.toId===p.toId,$=y.fromId===p.toId&&y.toId===p.fromId;if(m||$)return p}return null};for(let y=0;y<u.length;y++){const g=u[y],p=g.edge;let m=v(g);m===null?(m=this._createClusteredEdge(g.fromId,g.toId,p,n),f.push(m)):m.clusteringEdgeReplacingIds.push(p.id),this.body.edges[p.id].edgeReplacedById=m.id,this._backupEdgeOptions(p),p.setOptions({physics:!1})}}_checkOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}_cluster(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;const o=[];for(const h in e)Object.prototype.hasOwnProperty.call(e,h)&&this.clusteredNodes[h]!==void 0&&o.push(h);for(let h=0;h<o.length;++h)delete e[o[h]];if(he(e).length==0||he(e).length==1&&r.clusterNodeProperties.allowSingleNodeCluster!=!0)return;let s=Q({},r.clusterNodeProperties);if(r.processProperties!==void 0){const h=[];for(const u in e)if(Object.prototype.hasOwnProperty.call(e,u)){const f=Ye.cloneOptions(e[u]);h.push(f)}const c=[];for(const u in t)if(Object.prototype.hasOwnProperty.call(t,u)&&u.substr(0,12)!=="clusterEdge:"){const f=Ye.cloneOptions(t[u],"edge");c.push(f)}if(s=r.processProperties(s,h,c),!s)throw new Error("The processProperties function does not return properties!")}s.id===void 0&&(s.id="cluster:"+ao());const a=s.id;s.label===void 0&&(s.label="cluster");let l;s.x===void 0&&(l=this._getClusterPosition(e),s.x=l.x),s.y===void 0&&(l===void 0&&(l=this._getClusterPosition(e)),s.y=l.y),s.id=a;const d=this.body.functions.createNode(s,Ise);d.containedNodes=e,d.containedEdges=t,d.clusterEdgeProperties=r.clusterEdgeProperties,this.body.nodes[s.id]=d,this._clusterEdges(e,t,s,r.clusterEdgeProperties),s.id=void 0,n===!0&&this.body.emitter.emit("_dataChanged")}_backupEdgeOptions(e){this.clusteredEdges[e.id]===void 0&&(this.clusteredEdges[e.id]={physics:e.options.physics})}_restoreEdge(e){const t=this.clusteredEdges[e.id];t!==void 0&&(e.setOptions({physics:t.physics}),delete this.clusteredEdges[e.id])}isCluster(e){return this.body.nodes[e]!==void 0?this.body.nodes[e].isCluster===!0:(console.error("Node does not exist."),!1)}_getClusterPosition(e){const t=he(e);let r=e[t[0]].x,n=e[t[0]].x,o=e[t[0]].y,s=e[t[0]].y,a;for(let l=1;l<t.length;l++)a=e[t[l]],r=a.x<r?a.x:r,n=a.x>n?a.x:n,o=a.y<o?a.y:o,s=a.y>s?a.y:s;return{x:.5*(r+n),y:.5*(o+s)}}openCluster(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");const n=this.body.nodes[e];if(n===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(n.isCluster!==!0||n.containedNodes===void 0||n.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");const o=this.findNode(e),s=q(o).call(o,e)-1;if(s>=0){const h=o[s];this.body.nodes[h]._openChildCluster(e),delete this.body.nodes[e],r===!0&&this.body.emitter.emit("_dataChanged");return}const a=n.containedNodes,l=n.containedEdges;if(t!==void 0&&t.releaseFunction!==void 0&&typeof t.releaseFunction=="function"){const h={},c={x:n.x,y:n.y};for(const f in a)if(Object.prototype.hasOwnProperty.call(a,f)){const v=this.body.nodes[f];h[f]={x:v.x,y:v.y}}const u=t.releaseFunction(c,h);for(const f in a)if(Object.prototype.hasOwnProperty.call(a,f)){const v=this.body.nodes[f];u[f]!==void 0&&(v.x=u[f].x===void 0?n.x:u[f].x,v.y=u[f].y===void 0?n.y:u[f].y)}}else H(a,function(h){h.options.fixed.x===!1&&(h.x=n.x),h.options.fixed.y===!1&&(h.y=n.y)});for(const h in a)if(Object.prototype.hasOwnProperty.call(a,h)){const c=this.body.nodes[h];c.vx=n.vx,c.vy=n.vy,c.setOptions({physics:!0}),delete this.clusteredNodes[h]}const d=[];for(let h=0;h<n.edges.length;h++)d.push(n.edges[h]);for(let h=0;h<d.length;h++){const c=d[h],u=this._getConnectedId(c,e),f=this.clusteredNodes[u];for(let v=0;v<c.clusteringEdgeReplacingIds.length;v++){const y=c.clusteringEdgeReplacingIds[v],g=this.body.edges[y];if(g!==void 0)if(f!==void 0){const p=this.body.nodes[f.clusterId];p.containedEdges[g.id]=g,delete l[g.id];let m=g.fromId,$=g.toId;g.toId==u?$=f.clusterId:m=f.clusterId,this._createClusteredEdge(m,$,g,p.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(g)}c.remove()}for(const h in l)Object.prototype.hasOwnProperty.call(l,h)&&this._restoreEdge(l[h]);delete this.body.nodes[e],r===!0&&this.body.emitter.emit("_dataChanged")}getNodesInCluster(e){const t=[];if(this.isCluster(e)===!0){const r=this.body.nodes[e].containedNodes;for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.push(this.body.nodes[n].id)}return t}findNode(e){const t=[];let n=0,o;for(;this.clusteredNodes[e]!==void 0&&n<100;){if(o=this.body.nodes[e],o===void 0)return[];t.push(o.id),e=this.clusteredNodes[e].clusterId,n++}return o=this.body.nodes[e],o===void 0?[]:(t.push(o.id),ni(t).call(t),t)}updateClusteredNode(e,t){if(e===void 0)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(t===void 0)throw new Error("No newOptions supplied to updateClusteredNode.");if(this.body.nodes[e]===void 0)throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist.");this.body.nodes[e].setOptions(t),this.body.emitter.emit("_dataChanged")}updateEdge(e,t){if(e===void 0)throw new Error("No startEdgeId supplied to updateEdge.");if(t===void 0)throw new Error("No newOptions supplied to updateEdge.");if(this.body.edges[e]===void 0)throw new Error("The startEdgeId supplied to updateEdge does not exist.");const r=this.getClusteredEdges(e);for(let n=0;n<r.length;n++)this.body.edges[r[n]].setOptions(t);this.body.emitter.emit("_dataChanged")}getClusteredEdges(e){const t=[];let n=0;for(;e!==void 0&&this.body.edges[e]!==void 0&&n<100;)t.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,n++;return ni(t).call(t),t}getBaseEdge(e){return this.getBaseEdges(e)[0]}getBaseEdges(e){const t=[e],r=[],n=[],o=100;let s=0;for(;t.length>0&&s<o;){const a=t.pop();if(a===void 0)continue;const l=this.body.edges[a];if(l===void 0)continue;s++;const d=l.clusteringEdgeReplacingIds;if(d===void 0)n.push(a);else for(let h=0;h<d.length;++h){const c=d[h];q(t).call(t,d)!==-1||q(r).call(r,d)!==-1||t.push(c)}r.push(a)}return n}_getConnectedId(e,t){return e.toId!=t?e.toId:(e.fromId!=t,e.fromId)}_getHubSize(){let e=0,t=0,r=0,n=0;for(let l=0;l<this.body.nodeIndices.length;l++){const d=this.body.nodes[this.body.nodeIndices[l]];d.edges.length>n&&(n=d.edges.length),e+=d.edges.length,t+=Math.pow(d.edges.length,2),r+=1}e=e/r,t=t/r;const o=t-Math.pow(e,2),s=Math.sqrt(o);let a=Math.floor(e+2*s);return a>n&&(a=n),a}_createClusteredEdge(e,t,r,n,o){const s=Ye.cloneOptions(r,"edge");Q(s,n),s.from=e,s.to=t,s.id="clusterEdge:"+ao(),o!==void 0&&Q(s,o);const a=this.body.functions.createEdge(s);return a.clusteringEdgeReplacingIds=[r.id],a.connect(),this.body.edges[a.id]=a,a}_clusterEdges(e,t,r,n){if(t instanceof Dr){const o=t,s={};s[o.id]=o,t=s}if(e instanceof ie){const o=e,s={};s[o.id]=o,e=s}if(r==null)throw new Error("_clusterEdges: parameter clusterNode required");n===void 0&&(n=r.clusterEdgeProperties),this._createClusterEdges(e,t,r,n);for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&this.body.edges[o]!==void 0){const s=this.body.edges[o];this._backupEdgeOptions(s),s.setOptions({physics:!1})}for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(this.clusteredNodes[o]={clusterId:r.id,node:this.body.nodes[o]},this.body.nodes[o].setOptions({physics:!1}))}_getClusterNodeForNode(e){if(e===void 0)return;const t=this.clusteredNodes[e];if(t===void 0)return;const r=t.clusterId;if(r!==void 0)return this.body.nodes[r]}_filter(e,t){const r=[];return H(e,n=>{t(n)&&r.push(n)}),r}_updateState(){let e;const t=[],r={},n=l=>{H(this.body.nodes,d=>{d.isCluster===!0&&l(d)})};for(e in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,e))continue;this.body.nodes[e]===void 0&&t.push(e)}n(function(l){for(let d=0;d<t.length;d++)delete l.containedNodes[t[d]]});for(let l=0;l<t.length;l++)delete this.clusteredNodes[t[l]];H(this.clusteredEdges,l=>{const d=this.body.edges[l];(d===void 0||!d.endPointsValid())&&(r[l]=l)}),n(function(l){H(l.containedEdges,(d,h)=>{!d.endPointsValid()&&!r[h]&&(r[h]=h)})}),H(this.body.edges,(l,d)=>{let h=!0;const c=l.clusteringEdgeReplacingIds;if(c!==void 0){let u=0;H(c,f=>{const v=this.body.edges[f];v!==void 0&&v.endPointsValid()&&(u+=1)}),h=u>0}(!l.endPointsValid()||!h)&&(r[d]=d)}),n(l=>{H(r,d=>{delete l.containedEdges[d],H(l.edges,(h,c)=>{if(h.id===d){l.edges[c]=null;return}h.clusteringEdgeReplacingIds=this._filter(h.clusteringEdgeReplacingIds,function(u){return!r[u]})}),l.edges=this._filter(l.edges,function(h){return h!==null})})}),H(r,l=>{delete this.clusteredEdges[l]}),H(r,l=>{delete this.body.edges[l]});const o=he(this.body.edges);H(o,l=>{const d=this.body.edges[l],h=this._isClusteredNode(d.fromId)||this._isClusteredNode(d.toId);if(h!==this._isClusteredEdge(d.id))if(h){const c=this._getClusterNodeForNode(d.fromId);c!==void 0&&this._clusterEdges(this.body.nodes[d.fromId],d,c);const u=this._getClusterNodeForNode(d.toId);u!==void 0&&this._clusterEdges(this.body.nodes[d.toId],d,u)}else delete this._clusterEdges[l],this._restoreEdge(d)});let s=!1,a=!0;for(;a;){const l=[];n(function(d){const h=he(d.containedNodes).length,c=d.options.allowSingleNodeCluster===!0;(c&&h<1||!c&&h<2)&&l.push(d.id)});for(let d=0;d<l.length;++d)this.openCluster(l[d],{},!1);a=l.length>0,s=s||a}s&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}}class Cse{constructor(e,t){this.body=e,this.canvas=t,this.redrawRequested=!1,this.requestAnimationFrameRequestId=void 0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},Ee(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.on("dragStart",()=>{this.dragging=!0}),this.body.emitter.on("dragEnd",()=>{this.dragging=!1}),this.body.emitter.on("zoom",()=>{this.zooming=!0,window.clearTimeout(this.zoomTimeoutId),this.zoomTimeoutId=nr(()=>{var t;this.zooming=!1,_(t=this._requestRedraw).call(t,this)()},250)}),this.body.emitter.on("_resizeNodes",()=>{this._resizeNodes()}),this.body.emitter.on("_redraw",()=>{this.renderingActive===!1&&this._redraw()}),this.body.emitter.on("_blockRedraw",()=>{this.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",()=>{this.allowRedraw=!0,this.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",_(e=this._requestRedraw).call(e,this)),this.body.emitter.on("_startRendering",()=>{this.renderRequests+=1,this.renderingActive=!0,this._startRendering()}),this.body.emitter.on("_stopRendering",()=>{this.renderRequests-=1,this.renderingActive=this.renderRequests>0,this.requestAnimationFrameRequestId=void 0}),this.body.emitter.on("destroy",()=>{this.renderRequests=0,this.allowRedraw=!1,this.renderingActive=!1,window.cancelAnimationFrame(this.requestAnimationFrameRequestId),this.body.emitter.off()})}setOptions(e){e!==void 0&&zn(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,e)}_startRendering(){if(this.renderingActive===!0&&this.requestAnimationFrameRequestId===void 0){var e;this.requestAnimationFrameRequestId=window.requestAnimationFrame(_(e=this._renderStep).call(e,this),this.simulationInterval)}}_renderStep(){this.renderingActive===!0&&(this.requestAnimationFrameRequestId=void 0,this._startRendering(),this._redraw())}redraw(){this.body.emitter.emit("setSize"),this._redraw()}_requestRedraw(){this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,window.requestAnimationFrame(()=>{this._redraw(!1)}))}_redraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;const t={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();const r=this.canvas.getContext(),n=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(r.clearRect(0,0,n,o),this.canvas.frame.clientWidth===0)return;if(r.save(),r.translate(this.body.view.translation.x,this.body.view.translation.y),r.scale(this.body.view.scale,this.body.view.scale),r.beginPath(),this.body.emitter.emit("beforeDrawing",r),r.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(r),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){const{drawExternalLabels:s}=this._drawNodes(r,e);t.drawExternalLabels=s}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(r),t.drawExternalLabels!=null&&t.drawExternalLabels(),e===!1&&this._drawSelectionBox(r),r.beginPath(),this.body.emitter.emit("afterDrawing",r),r.closePath(),r.restore(),e===!0&&r.clearRect(0,0,n,o)}}_resizeNodes(){this.canvas.setTransform();const e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);const t=this.body.nodes;let r;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r=t[n],r.resize(e),r.updateBoundingBox(e,r.selected));e.restore()}_drawNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.body.nodes,n=this.body.nodeIndices;let o;const s=[],a=[],l=20,d=this.canvas.DOMtoCanvas({x:-l,y:-l}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+l,y:this.canvas.frame.canvas.clientHeight+l}),c={top:d.y,left:d.x,bottom:h.y,right:h.x},u=[];for(let g=0;g<n.length;g++)if(o=r[n[g]],o.hover)a.push(n[g]);else if(o.isSelected())s.push(n[g]);else if(t===!0){const p=o.draw(e);p.drawExternalLabel!=null&&u.push(p.drawExternalLabel)}else if(o.isBoundingBoxOverlappingWith(c)===!0){const p=o.draw(e);p.drawExternalLabel!=null&&u.push(p.drawExternalLabel)}else o.updateBoundingBox(e,o.selected);let f;const v=s.length,y=a.length;for(f=0;f<v;f++){o=r[s[f]];const g=o.draw(e);g.drawExternalLabel!=null&&u.push(g.drawExternalLabel)}for(f=0;f<y;f++){o=r[a[f]];const g=o.draw(e);g.drawExternalLabel!=null&&u.push(g.drawExternalLabel)}return{drawExternalLabels:()=>{for(const g of u)g()}}}_drawEdges(e){const t=this.body.edges,r=this.body.edgeIndices;for(let n=0;n<r.length;n++){const o=t[r[n]];o.connected===!0&&o.draw(e)}}_drawArrows(e){const t=this.body.edges,r=this.body.edgeIndices;for(let n=0;n<r.length;n++){const o=t[r[n]];o.connected===!0&&o.drawArrows(e)}}_drawSelectionBox(e){if(this.body.selectionBox.show){e.beginPath();const t=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,r=this.body.selectionBox.position.end.y-this.body.selectionBox.position.start.y;e.rect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,t,r),e.fillStyle="rgba(151, 194, 252, 0.2)",e.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,t,r),e.strokeStyle="rgba(151, 194, 252, 1)",e.stroke()}else e.closePath()}}var xse=X,Ase=xse.setInterval,Dse=Ase,Mse=B(Dse);function Qa(i,e){e.inputHandler=function(t){t.isFirst&&e(t)},i.on("hammer.input",e.inputHandler)}function cS(i,e){return e.inputHandler=function(t){t.isFinal&&e(t)},i.on("hammer.input",e.inputHandler)}class kse{constructor(e){this.body=e,this.pixelRatio=1,this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this._cleanupCallbacks=[],this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},Ee(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.once("resize",t=>{t.width!==0&&(this.body.view.translation.x=t.width*.5),t.height!==0&&(this.body.view.translation.y=t.height*.5)}),this.body.emitter.on("setSize",_(e=this.setSize).call(e,this)),this.body.emitter.on("destroy",()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()})}setOptions(e){if(e!==void 0&&zn(["width","height","autoResize"],this.options,e),this._cleanUp(),this.options.autoResize===!0){var t;if(window.ResizeObserver){const n=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")}),{frame:o}=this;n.observe(o),this._cleanupCallbacks.push(()=>{n.unobserve(o)})}else{const n=Mse(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(()=>{clearInterval(n)})}const r=_(t=this._onResize).call(t,this);window.addEventListener("resize",r),this._cleanupCallbacks.push(()=>{window.removeEventListener("resize",r)})}}_cleanUp(){var e,t,r;Z(e=ni(t=ir(r=this._cleanupCallbacks).call(r,0)).call(t)).call(e,n=>{try{n()}catch(o){console.error(o)}})}_onResize(){this.setSize(),this.body.emitter.emit("_redraw")}_getCameraState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}_setCameraState(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){const e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight;let r=this.cameraState.scale;e!=1&&t!=1?r=this.cameraState.scale*.5*(e+t):e!=1?r=this.cameraState.scale*e:t!=1&&(r=this.cameraState.scale*t),this.body.view.scale=r;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(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(q(e).call(e,"%")!==-1||q(e).call(e,"px")!==-1)return e;if(q(e).call(e,"%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}_create(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=0,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{const e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}_bindHammer(){this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new en(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:en.DIRECTION_ALL}),Qa(this.hammer,e=>{this.body.eventListeners.onTouch(e)}),this.hammer.on("tap",e=>{this.body.eventListeners.onTap(e)}),this.hammer.on("doubletap",e=>{this.body.eventListeners.onDoubleTap(e)}),this.hammer.on("press",e=>{this.body.eventListeners.onHold(e)}),this.hammer.on("panstart",e=>{this.body.eventListeners.onDragStart(e)}),this.hammer.on("panmove",e=>{this.body.eventListeners.onDrag(e)}),this.hammer.on("panend",e=>{this.body.eventListeners.onDragEnd(e)}),this.hammer.on("pinch",e=>{this.body.eventListeners.onPinch(e)}),this.frame.canvas.addEventListener("wheel",e=>{this.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("mousemove",e=>{this.body.eventListeners.onMouseMove(e)}),this.frame.canvas.addEventListener("contextmenu",e=>{this.body.eventListeners.onContext(e)}),this.hammerFrame=new en(this.frame),cS(this.hammerFrame,e=>{this.body.eventListeners.onRelease(e)})}setSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);let r=!1;const n=this.frame.canvas.width,o=this.frame.canvas.height,s=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t)this._getCameraState(s),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},r=!0;else{const a=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),l=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==a||this.frame.canvas.height!==l)&&this._getCameraState(s),this.frame.canvas.width!==a&&(this.frame.canvas.width=a,r=!0),this.frame.canvas.height!==l&&(this.frame.canvas.height=l,r=!0)}return r===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(n/this.pixelRatio),oldHeight:Math.round(o/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,r}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){const e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");let t=1;typeof window<"u"&&(t=window.devicePixelRatio||1);const r=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/r}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){const e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}_XconvertDOMtoCanvas(e){return(e-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(e){return(e-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.y}canvasToDOM(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}DOMtoCanvas(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}function Rse(i,e){const t=Ee({nodes:e,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},i??{});if(!ce(t.nodes))throw new TypeError("Nodes has to be an array of ids.");if(t.nodes.length===0&&(t.nodes=e),!(typeof t.minZoomLevel=="number"&&t.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof t.maxZoomLevel=="number"&&t.minZoomLevel<=t.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return t}class Nse{constructor(e,t){var r,n;this.body=e,this.canvas=t,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",_(r=this.fit).call(r,this)),this.body.emitter.on("animationFinished",()=>{this.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",_(n=this.releaseNode).call(n,this))}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}fit(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=Rse(e,this.body.nodeIndices);const r=this.canvas.frame.canvas.clientWidth,n=this.canvas.frame.canvas.clientHeight;let o,s;if(r===0||n===0)s=1,o=Ye.getRange(this.body.nodes,e.nodes);else if(t===!0){let d=0;for(const u in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,u)&&this.body.nodes[u].predefinedPosition===!0&&(d+=1);if(d>.5*this.body.nodeIndices.length){this.fit(e,!1);return}o=Ye.getRange(this.body.nodes,e.nodes),s=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;const c=Math.min(r/600,n/600);s*=c}else{this.body.emitter.emit("_resizeNodes"),o=Ye.getRange(this.body.nodes,e.nodes);const d=Math.abs(o.maxX-o.minX)*1.1,h=Math.abs(o.maxY-o.minY)*1.1,c=r/d,u=n/h;s=c<=u?c:u}s>e.maxZoomLevel?s=e.maxZoomLevel:s<e.minZoomLevel&&(s=e.minZoomLevel);const l={position:Ye.findCenter(o),scale:s,animation:e.animation};this.moveTo(l)}focus(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){const r={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=r,t.lockedOnNode=e,this.moveTo(t)}else console.error("Node: "+e+" cannot be found.")}moveTo(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!Zr(e.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!Zr(e.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!Zr(e.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!Zr(e.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}animateView(e){if(e===void 0)return;this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;const t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),r={x:t.x-e.position.x,y:t.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+r.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+r.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var n;this.viewFunction=_(n=this._lockedRedraw).call(n,this),this.body.emitter.on("initRedraw",this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else{var o;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=_(o=this._transitionRedraw).call(o,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}_lockedRedraw(){const e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),r={x:t.x-e.x,y:t.y-e.y},n=this.body.view.translation,o={x:n.x+r.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:n.y+r.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=o}releaseNode(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}_transitionRedraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;const t=UQ[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var r;this.viewFunction=_(r=this._lockedRedraw).call(r,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 Ob(i){var e=i&&i.preventDefault||!1,t=i&&i.container||window,r={},n={keydown:{},keyup:{}},o={},s;for(s=97;s<=122;s++)o[String.fromCharCode(s)]={code:65+(s-97),shift:!1};for(s=65;s<=90;s++)o[String.fromCharCode(s)]={code:s,shift:!0};for(s=0;s<=9;s++)o[""+s]={code:48+s,shift:!1};for(s=1;s<=12;s++)o["F"+s]={code:111+s,shift:!1};for(s=0;s<=9;s++)o["num"+s]={code:96+s,shift:!1};o["num*"]={code:106,shift:!1},o["num+"]={code:107,shift:!1},o["num-"]={code:109,shift:!1},o["num/"]={code:111,shift:!1},o["num."]={code:110,shift:!1},o.left={code:37,shift:!1},o.up={code:38,shift:!1},o.right={code:39,shift:!1},o.down={code:40,shift:!1},o.space={code:32,shift:!1},o.enter={code:13,shift:!1},o.shift={code:16,shift:void 0},o.esc={code:27,shift:!1},o.backspace={code:8,shift:!1},o.tab={code:9,shift:!1},o.ctrl={code:17,shift:!1},o.alt={code:18,shift:!1},o.delete={code:46,shift:!1},o.pageup={code:33,shift:!1},o.pagedown={code:34,shift:!1},o["="]={code:187,shift:!1},o["-"]={code:189,shift:!1},o["]"]={code:221,shift:!1},o["["]={code:219,shift:!1};var a=function(h){d(h,"keydown")},l=function(h){d(h,"keyup")},d=function(h,c){if(n[c][h.keyCode]!==void 0){for(var u=n[c][h.keyCode],f=0;f<u.length;f++)(u[f].shift===void 0||u[f].shift==!0&&h.shiftKey==!0||u[f].shift==!1&&h.shiftKey==!1)&&u[f].fn(h);e==!0&&h.preventDefault()}};return r.bind=function(h,c,u){if(u===void 0&&(u="keydown"),o[h]===void 0)throw new Error("unsupported key: "+h);n[u][o[h].code]===void 0&&(n[u][o[h].code]=[]),n[u][o[h].code].push({fn:c,shift:o[h].shift})},r.bindAll=function(h,c){c===void 0&&(c="keydown");for(var u in o)o.hasOwnProperty(u)&&r.bind(u,h,c)},r.getKey=function(h){for(var c in o)if(o.hasOwnProperty(c)){if(h.shiftKey==!0&&o[c].shift==!0&&h.keyCode==o[c].code)return c;if(h.shiftKey==!1&&o[c].shift==!1&&h.keyCode==o[c].code)return c;if(h.keyCode==o[c].code&&c=="shift")return c}return"unknown key, currently not supported"},r.unbind=function(h,c,u){if(u===void 0&&(u="keydown"),o[h]===void 0)throw new Error("unsupported key: "+h);if(c!==void 0){var f=[],v=n[u][o[h].code];if(v!==void 0)for(var y=0;y<v.length;y++)v[y].fn==c&&v[y].shift==o[h].shift||f.push(n[u][o[h].code][y]);n[u][o[h].code]=f}else n[u][o[h].code]=[]},r.reset=function(){n={keydown:{},keyup:{}}},r.destroy=function(){n={keydown:{},keyup:{}},t.removeEventListener("keydown",a,!0),t.removeEventListener("keyup",l,!0)},t.addEventListener("keydown",a,!0),t.addEventListener("keyup",l,!0),r}class Fse{constructor(e,t){this.body=e,this.canvas=t,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",()=>{this.activated=!0,this.configureKeyboardBindings()}),this.body.emitter.on("deactivate",()=>{this.activated=!1,this.configureKeyboardBindings()}),this.body.emitter.on("destroy",()=>{this.keycharm!==void 0&&this.keycharm.destroy()}),this.options={}}setOptions(e){e!==void 0&&(this.options=e,this.create())}create(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}cleanNavigation(){if(this.navigationHammers.length!=0){for(let e=0;e<this.navigationHammers.length;e++)this.navigationHammers[e].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}loadNavigationElements(){this.cleanNavigation(),this.navigationDOM={};const e=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],t=["_moveUp","_moveDown","_moveLeft","_moveRight","_zoomIn","_zoomOut","_fit"];this.navigationDOM.wrapper=document.createElement("div"),this.navigationDOM.wrapper.className="vis-navigation",this.canvas.frame.appendChild(this.navigationDOM.wrapper);for(let s=0;s<e.length;s++){this.navigationDOM[e[s]]=document.createElement("div"),this.navigationDOM[e[s]].className="vis-button vis-"+e[s],this.navigationDOM.wrapper.appendChild(this.navigationDOM[e[s]]);const a=new en(this.navigationDOM[e[s]]);if(t[s]==="_fit"){var r;Qa(a,_(r=this._fit).call(r,this))}else{var n;Qa(a,_(n=this.bindToRedraw).call(n,this,t[s]))}this.navigationHammers.push(a)}const o=new en(this.canvas.frame);cS(o,()=>{this._stopMovement()}),this.navigationHammers.push(o),this.iconsCreated=!0}bindToRedraw(e){if(this.boundFunctions[e]===void 0){var t;this.boundFunctions[e]=_(t=this[e]).call(t,this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering")}}unbindFromRedraw(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}_fit(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}_stopMovement(){for(const e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}_moveUp(){this.body.view.translation.y+=this.options.keyboard.speed.y}_moveDown(){this.body.view.translation.y-=this.options.keyboard.speed.y}_moveLeft(){this.body.view.translation.x+=this.options.keyboard.speed.x}_moveRight(){this.body.view.translation.x-=this.options.keyboard.speed.x}_zoomIn(){const e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),r=this.body.view.translation,n=t/e,o=(1-n)*this.canvas.canvasViewCenter.x+r.x*n,s=(1-n)*this.canvas.canvasViewCenter.y+r.y*n;this.body.view.scale=t,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}_zoomOut(){const e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),r=this.body.view.translation,n=t/e,o=(1-n)*this.canvas.canvasViewCenter.x+r.x*n,s=(1-n)*this.canvas.canvasViewCenter.y+r.y*n;this.body.view.scale=t,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}configureKeyboardBindings(){if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=Ob({container:window,preventDefault:!0}):this.keycharm=Ob({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var e,t,r,n,o,s,a,l,d,h,c,u,f,v,y,g,p,m,$,E,P,D,L,W;_(e=this.keycharm).call(e,"up",()=>{this.bindToRedraw("_moveUp")},"keydown"),_(t=this.keycharm).call(t,"down",()=>{this.bindToRedraw("_moveDown")},"keydown"),_(r=this.keycharm).call(r,"left",()=>{this.bindToRedraw("_moveLeft")},"keydown"),_(n=this.keycharm).call(n,"right",()=>{this.bindToRedraw("_moveRight")},"keydown"),_(o=this.keycharm).call(o,"=",()=>{this.bindToRedraw("_zoomIn")},"keydown"),_(s=this.keycharm).call(s,"num+",()=>{this.bindToRedraw("_zoomIn")},"keydown"),_(a=this.keycharm).call(a,"num-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),_(l=this.keycharm).call(l,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),_(d=this.keycharm).call(d,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),_(h=this.keycharm).call(h,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),_(c=this.keycharm).call(c,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),_(u=this.keycharm).call(u,"pagedown",()=>{this.bindToRedraw("_zoomOut")},"keydown"),_(f=this.keycharm).call(f,"up",()=>{this.unbindFromRedraw("_moveUp")},"keyup"),_(v=this.keycharm).call(v,"down",()=>{this.unbindFromRedraw("_moveDown")},"keyup"),_(y=this.keycharm).call(y,"left",()=>{this.unbindFromRedraw("_moveLeft")},"keyup"),_(g=this.keycharm).call(g,"right",()=>{this.unbindFromRedraw("_moveRight")},"keyup"),_(p=this.keycharm).call(p,"=",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),_(m=this.keycharm).call(m,"num+",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),_($=this.keycharm).call($,"num-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),_(E=this.keycharm).call(E,"-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),_(P=this.keycharm).call(P,"[",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),_(D=this.keycharm).call(D,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),_(L=this.keycharm).call(L,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),_(W=this.keycharm).call(W,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")}}}class Bse{constructor(e,t,r){var n,o,s,a,l,d,h,c,u,f,v,y,g;this.body=e,this.canvas=t,this.selectionHandler=r,this.navigationHandler=new Fse(e,t),this.body.eventListeners.onTap=_(n=this.onTap).call(n,this),this.body.eventListeners.onTouch=_(o=this.onTouch).call(o,this),this.body.eventListeners.onDoubleTap=_(s=this.onDoubleTap).call(s,this),this.body.eventListeners.onHold=_(a=this.onHold).call(a,this),this.body.eventListeners.onDragStart=_(l=this.onDragStart).call(l,this),this.body.eventListeners.onDrag=_(d=this.onDrag).call(d,this),this.body.eventListeners.onDragEnd=_(h=this.onDragEnd).call(h,this),this.body.eventListeners.onMouseWheel=_(c=this.onMouseWheel).call(c,this),this.body.eventListeners.onPinch=_(u=this.onPinch).call(u,this),this.body.eventListeners.onMouseMove=_(f=this.onMouseMove).call(f,this),this.body.eventListeners.onRelease=_(v=this.onRelease).call(v,this),this.body.eventListeners.onContext=_(y=this.onContext).call(y,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=_(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},Ee(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("destroy",()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer})}setOptions(e){e!==void 0&&(Ya(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),mt(this.options,e,"keyboard"),e.tooltip&&(Ee(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=pu(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-zQ(this.canvas.frame.canvas),y:e.y-HQ(this.canvas.frame.canvas)}}onTouch(e){new Date().valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}onTap(e){const t=this.getPointer(e.center),r=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,r),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t)}onDoubleTap(e){const t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,t)}onHold(e){const t=this.getPointer(e.center),r=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,r),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t),this.selectionHandler.generateClickEvent("hold",e,t)}onRelease(e){if(new Date().valueOf()-this.touchTime>10){const t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,t),this.touchTime=new Date().valueOf()}}onContext(e){const t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,t)}checkSelectionChanges(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}_determineDifference(e,t){const r=function(n,o){const s=[];for(let a=0;a<n.length;a++){const l=n[a];q(o).call(o,l)===-1&&s.push(l)}return s};return{nodes:r(e.nodes,t.nodes),edges:r(e.edges,t.edges)}}onDragStart(e){if(this.drag.dragging)return;this.drag.pointer===void 0&&this.onTouch(e);const t=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=Ee({},this.body.view.translation),this.drag.nodeId=void 0,e.srcEvent.shiftKey){this.body.selectionBox.show=!0;const r=this.getPointer(e.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(r.x),y:this.canvas._YconvertDOMtoCanvas(r.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(r.x),y:this.canvas._YconvertDOMtoCanvas(r.y)}}else if(t!==void 0&&this.options.dragNodes===!0){this.drag.nodeId=t.id,t.isSelected()===!1&&this.selectionHandler.setSelection({nodes:[t.id]}),this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer);for(const r of this.selectionHandler.getSelectedNodes()){const n={id:r.id,node:r,x:r.x,y:r.y,xFixed:r.options.fixed.x,yFixed:r.options.fixed.y};r.options.fixed.x=!0,r.options.fixed.y=!0,this.drag.selection.push(n)}}else this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer,void 0,!0)}onDrag(e){if(this.drag.pinched===!0)return;this.body.emitter.emit("unlockNode");const t=this.getPointer(e.center),r=this.drag.selection;if(r&&r.length&&this.options.dragNodes===!0){this.selectionHandler.generateClickEvent("dragging",e,t);const n=t.x-this.drag.pointer.x,o=t.y-this.drag.pointer.y;Z(r).call(r,s=>{const a=s.node;s.xFixed===!1&&(a.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(s.x)+n)),s.yFixed===!1&&(a.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(s.y)+o))}),this.body.emitter.emit("startSimulation")}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.emitter.emit("_requestRedraw")}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}const n=t.x-this.drag.pointer.x,o=t.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+n,y:this.drag.translation.y+o},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(e){if(this.drag.dragging=!1,this.body.selectionBox.show){var t;this.body.selectionBox.show=!1;const r=this.body.selectionBox.position,n={minX:Math.min(r.start.x,r.end.x),minY:Math.min(r.start.y,r.end.y),maxX:Math.max(r.start.x,r.end.x),maxY:Math.max(r.start.y,r.end.y)},o=ot(t=this.body.nodeIndices).call(t,a=>{const l=this.body.nodes[a];return l.x>=n.minX&&l.x<=n.maxX&&l.y>=n.minY&&l.y<=n.maxY});Z(o).call(o,a=>this.selectionHandler.selectObject(this.body.nodes[a]));const s=this.getPointer(e.center);this.selectionHandler.commitAndEmit(s,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{const r=this.drag.selection;r&&r.length?(Z(r).call(r,function(n){n.node.options.fixed.x=n.xFixed,n.node.options.fixed.y=n.yFixed}),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}onPinch(e){const t=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);const r=this.pinch.scale*e.scale;this.zoom(r,t)}zoom(e,t){if(this.options.zoomView===!0){const r=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);let n;this.drag!==void 0&&this.drag.dragging===!0&&(n=this.canvas.DOMtoCanvas(this.drag.pointer));const o=this.body.view.translation,s=e/r,a=(1-s)*t.x+o.x*s,l=(1-s)*t.y+o.y*s;if(this.body.view.scale=e,this.body.view.translation={x:a,y:l},n!=null){const d=this.canvas.canvasToDOM(n);this.drag.pointer.x=d.x,this.drag.pointer.y=d.y}this.body.emitter.emit("_requestRedraw"),r<e?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:t}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:t})}}onMouseWheel(e){if(this.options.zoomView===!0){if(e.deltaY!==0){let t=this.body.view.scale;t*=1+(e.deltaY<0?1:-1)*(this.options.zoomSpeed*.1);const r=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(t,r)}e.preventDefault()}}onMouseMove(e){const t=this.getPointer({x:e.clientX,y:e.clientY});let r=!1;this.popup!==void 0&&(this.popup.hidden===!1&&this._checkHidePopup(t),this.popup.hidden===!1&&(r=!0,this.popup.setPosition(t.x+3,t.y-5),this.popup.show())),this.options.keyboard.autoFocus&&this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),r===!1&&(this.popupTimer!==void 0&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=nr(()=>this._checkShowPopup(t),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,t)}_checkShowPopup(e){const t=this.canvas._XconvertDOMtoCanvas(e.x),r=this.canvas._YconvertDOMtoCanvas(e.y),n={left:t,top:r,right:t,bottom:r},o=this.popupObj===void 0?void 0:this.popupObj.id;let s=!1,a="node";if(this.popupObj===void 0){const l=this.body.nodeIndices,d=this.body.nodes;let h;const c=[];for(let u=0;u<l.length;u++)h=d[l[u]],h.isOverlappingWith(n)===!0&&(s=!0,h.getTitle()!==void 0&&c.push(l[u]));c.length>0&&(this.popupObj=d[c[c.length-1]],s=!0)}if(this.popupObj===void 0&&s===!1){const l=this.body.edgeIndices,d=this.body.edges;let h;const c=[];for(let u=0;u<l.length;u++)h=d[l[u]],h.isOverlappingWith(n)===!0&&h.connected===!0&&h.getTitle()!==void 0&&c.push(l[u]);c.length>0&&(this.popupObj=d[c[c.length-1]],a="edge")}this.popupObj!==void 0?this.popupObj.id!==o&&(this.popup===void 0&&(this.popup=new QQ(this.canvas.frame)),this.popup.popupTargetType=a,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}_checkHidePopup(e){const t=this.selectionHandler._pointerToPositionObject(e);let r=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(r=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),r===!0)){const n=this.selectionHandler.getNodeAt(e);r=n===void 0?!1:n.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(r=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));r===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}var Lse=Hf,jse=H_;Lse("Set",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},jse);var zse=X,Hse=zse.Set,Wse=Hse,Vse=Wse,Use=Vse,wr=B(Use),Kse=K,Tb=Wf,oa=Xl.getWeakData,Gse=zf,Yse=pr,qse=Dn,lc=We,Xse=jf,uS=zr,Ib=je,fS=Ti,Zse=fS.set,Jse=fS.getterFor,Qse=uS.find,eae=uS.findIndex,tae=Kse([].splice),rae=0,sa=function(i){return i.frozen||(i.frozen=new vS)},vS=function(){this.entries=[]},dc=function(i,e){return Qse(i.entries,function(t){return t[0]===e})};vS.prototype={get:function(i){var e=dc(this,i);if(e)return e[1]},has:function(i){return!!dc(this,i)},set:function(i,e){var t=dc(this,i);t?t[1]=e:this.entries.push([i,e])},delete:function(i){var e=eae(this.entries,function(t){return t[0]===i});return~e&&tae(this.entries,e,1),!!~e}};var iae={getConstructor:function(i,e,t,r){var n=i(function(l,d){Gse(l,o),Zse(l,{type:e,id:rae++,frozen:void 0}),qse(d)||Xse(d,l[r],{that:l,AS_ENTRIES:t})}),o=n.prototype,s=Jse(e),a=function(l,d,h){var c=s(l),u=oa(Yse(d),!0);return u===!0?sa(c).set(d,h):u[c.id]=h,l};return Tb(o,{delete:function(l){var d=s(this);if(!lc(l))return!1;var h=oa(l);return h===!0?sa(d).delete(l):h&&Ib(h,d.id)&&delete h[d.id]},has:function(d){var h=s(this);if(!lc(d))return!1;var c=oa(d);return c===!0?sa(h).has(d):c&&Ib(c,h.id)}}),Tb(o,t?{get:function(d){var h=s(this);if(lc(d)){var c=oa(d);return c===!0?sa(h).get(d):c?c[h.id]:void 0}},set:function(d,h){return a(this,d,h)}}:{add:function(d){return a(this,d,!0)}}),n}},nae=F_,Pb=ve,Oa=K,Cb=Wf,oae=Xl,sae=Hf,pS=iae,aa=We,la=Ti.enforce,aae=U,lae=aE,_s=Object,dae=Array.isArray,da=_s.isExtensible,gS=_s.isFrozen,hae=_s.isSealed,yS=_s.freeze,cae=_s.seal,xb={},Ab={},uae=!Pb.ActiveXObject&&"ActiveXObject"in Pb,Yn,mS=function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},bS=sae("WeakMap",mS,pS),ji=bS.prototype,Ta=Oa(ji.set),fae=function(){return nae&&aae(function(){var i=yS([]);return Ta(new bS,i,1),!gS(i)})};if(lae)if(uae){Yn=pS.getConstructor(mS,"WeakMap",!0),oae.enable();var Db=Oa(ji.delete),ha=Oa(ji.has),Mb=Oa(ji.get);Cb(ji,{delete:function(i){if(aa(i)&&!da(i)){var e=la(this);return e.frozen||(e.frozen=new Yn),Db(this,i)||e.frozen.delete(i)}return Db(this,i)},has:function(e){if(aa(e)&&!da(e)){var t=la(this);return t.frozen||(t.frozen=new Yn),ha(this,e)||t.frozen.has(e)}return ha(this,e)},get:function(e){if(aa(e)&&!da(e)){var t=la(this);return t.frozen||(t.frozen=new Yn),ha(this,e)?Mb(this,e):t.frozen.get(e)}return Mb(this,e)},set:function(e,t){if(aa(e)&&!da(e)){var r=la(this);r.frozen||(r.frozen=new Yn),ha(this,e)?Ta(this,e,t):r.frozen.set(e,t)}else Ta(this,e,t);return this}})}else fae()&&Cb(ji,{set:function(e,t){var r;return dae(e)&&(gS(e)?r=xb:hae(e)&&(r=Ab)),Ta(this,e,t),r===xb&&yS(e),r===Ab&&cae(e),this}});var vae=X,pae=vae.WeakMap,gae=pae,yae=gae,mae=yae,lo=B(mae);function J(i,e,t,r){if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)}function wu(i,e,t,r,n){if(typeof e=="function"?i!==e||!0:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(i,t),t}var Yr,yt,yr,mr,Ia;function kb(i,e){const t=new wr;for(const r of e)i.has(r)||t.add(r);return t}class Rb{constructor(){Yr.set(this,new wr),yt.set(this,new wr)}get size(){return J(this,yt,"f").size}add(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(const n of t)J(this,yt,"f").add(n)}delete(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(const n of t)J(this,yt,"f").delete(n)}clear(){J(this,yt,"f").clear()}getSelection(){return[...J(this,yt,"f")]}getChanges(){return{added:[...kb(J(this,Yr,"f"),J(this,yt,"f"))],deleted:[...kb(J(this,yt,"f"),J(this,Yr,"f"))],previous:[...new wr(J(this,Yr,"f"))],current:[...new wr(J(this,yt,"f"))]}}commit(){const e=this.getChanges();wu(this,Yr,J(this,yt,"f")),wu(this,yt,new wr(J(this,Yr,"f")));for(const t of e.added)t.select();for(const t of e.deleted)t.unselect();return e}}Yr=new lo,yt=new lo;class bae{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};yr.set(this,new Rb),mr.set(this,new Rb),Ia.set(this,void 0),wu(this,Ia,e)}get sizeNodes(){return J(this,yr,"f").size}get sizeEdges(){return J(this,mr,"f").size}getNodes(){return J(this,yr,"f").getSelection()}getEdges(){return J(this,mr,"f").getSelection()}addNodes(){J(this,yr,"f").add(...arguments)}addEdges(){J(this,mr,"f").add(...arguments)}deleteNodes(e){J(this,yr,"f").delete(e)}deleteEdges(e){J(this,mr,"f").delete(e)}clear(){J(this,yr,"f").clear(),J(this,mr,"f").clear()}commit(){const e={nodes:J(this,yr,"f").commit(),edges:J(this,mr,"f").commit()};for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return J(this,Ia,"f").call(this,e,...r),e}}yr=new lo,mr=new lo,Ia=new lo;class $ae{constructor(e,t){this.body=e,this.canvas=t,this._selectionAccumulator=new bae,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},Ee(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",()=>{this.updateSelection()})}setOptions(e){e!==void 0&&zn(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,e)}selectOnPoint(e){let t=!1;if(this.options.selectable===!0){const r=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),r!==void 0&&(t=this.selectObject(r)),this.body.emitter.emit("_requestRedraw")}return t}selectAdditionalOnPoint(e){let t=!1;if(this.options.selectable===!0){const r=this.getNodeAt(e)||this.getEdgeAt(e);r!==void 0&&(t=!0,r.isSelected()===!0?this.deselectObject(r):this.selectObject(r),this.body.emitter.emit("_requestRedraw"))}return t}_initBaseEvent(e,t){const r={};return r.pointer={DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},r.event=e,r}generateClickEvent(e,t,r,n){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;const s=this._initBaseEvent(t,r);if(o===!0)s.nodes=[],s.edges=[];else{const a=this.getSelection();s.nodes=a.nodes,s.edges=a.edges}n!==void 0&&(s.previousSelection=n),e=="click"&&(s.items=this.getClickedItems(r)),t.controlEdge!==void 0&&(s.controlEdge=t.controlEdge),this.body.emitter.emit(e,s)}selectObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return e!==void 0?(e instanceof ie?(t===!0&&this._selectionAccumulator.addEdges(...e.edges),this._selectionAccumulator.addNodes(e)):this._selectionAccumulator.addEdges(e),!0):!1}deselectObject(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}_getAllNodesOverlappingWith(e){const t=[],r=this.body.nodes;for(let n=0;n<this.body.nodeIndices.length;n++){const o=this.body.nodeIndices[n];r[o].isOverlappingWith(e)&&t.push(o)}return t}_pointerToPositionObject(e){const t=this.canvas.DOMtoCanvas(e);return{left:t.x-1,top:t.y+1,right:t.x+1,bottom:t.y-1}}getNodeAt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const r=this._pointerToPositionObject(e),n=this._getAllNodesOverlappingWith(r);if(n.length>0)return t===!0?this.body.nodes[n[n.length-1]]:n[n.length-1]}_getEdgesOverlappingWith(e,t){const r=this.body.edges;for(let n=0;n<this.body.edgeIndices.length;n++){const o=this.body.edgeIndices[n];r[o].isOverlappingWith(e)&&t.push(o)}}_getAllEdgesOverlappingWith(e){const t=[];return this._getEdgesOverlappingWith(e,t),t}getEdgeAt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const r=this.canvas.DOMtoCanvas(e);let n=10,o=null;const s=this.body.edges;for(let a=0;a<this.body.edgeIndices.length;a++){const l=this.body.edgeIndices[a],d=s[l];if(d.connected){const h=d.from.x,c=d.from.y,u=d.to.x,f=d.to.y,v=d.edgeType.getDistanceToEdge(h,c,u,f,r.x,r.y);v<n&&(o=l,n=v)}}if(o!==null)return t===!0?this.body.edges[o]:o}_addToHover(e){e instanceof ie?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}_removeFromSelection(e){e instanceof ie?(this._selectionAccumulator.deleteNodes(e),this._selectionAccumulator.deleteEdges(...e.edges)):this._selectionAccumulator.deleteEdges(e)}unselectAll(){this._selectionAccumulator.clear()}getSelectedNodeCount(){return this._selectionAccumulator.sizeNodes}getSelectedEdgeCount(){return this._selectionAccumulator.sizeEdges}_hoverConnectedEdges(e){for(let t=0;t<e.edges.length;t++){const r=e.edges[t];r.hover=!0,this._addToHover(r)}}emitBlurEvent(e,t,r){const n=this._initBaseEvent(e,t);r.hover===!0&&(r.hover=!1,r instanceof ie?(n.node=r.id,this.body.emitter.emit("blurNode",n)):(n.edge=r.id,this.body.emitter.emit("blurEdge",n)))}emitHoverEvent(e,t,r){const n=this._initBaseEvent(e,t);let o=!1;return r.hover===!1&&(r.hover=!0,this._addToHover(r),o=!0,r instanceof ie?(n.node=r.id,this.body.emitter.emit("hoverNode",n)):(n.edge=r.id,this.body.emitter.emit("hoverEdge",n))),o}hoverObject(e,t){let r=this.getNodeAt(t);r===void 0&&(r=this.getEdgeAt(t));let n=!1;for(const o in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,o)&&(r===void 0||r instanceof ie&&r.id!=o||r instanceof Dr)&&(this.emitBlurEvent(e,t,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)&&(n===!0?(this.hoverObj.edges[o].hover=!1,delete this.hoverObj.edges[o]):(r===void 0||r instanceof Dr&&r.id!=o||r instanceof ie&&!r.hover)&&(this.emitBlurEvent(e,t,this.hoverObj.edges[o]),delete this.hoverObj.edges[o],n=!0));if(r!==void 0){const o=he(this.hoverObj.edges).length,s=he(this.hoverObj.nodes).length,a=r instanceof Dr&&o===0&&s===0,l=r instanceof ie&&o===0&&s===0;(n||a||l)&&(n=this.emitHoverEvent(e,t,r)),r instanceof ie&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(r)}n===!0&&this.body.emitter.emit("_requestRedraw")}commitWithoutEmitting(){this._selectionAccumulator.commit()}commitAndEmit(e,t){let r=!1;const n=this._selectionAccumulator.commit(),o={nodes:n.nodes.previous,edges:n.edges.previous};n.edges.deleted.length>0&&(this.generateClickEvent("deselectEdge",t,e,o),r=!0),n.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,e,o),r=!0),n.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,e),r=!0),n.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,e),r=!0),r===!0&&this.generateClickEvent("select",t,e)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var e;return fn(e=this._selectionAccumulator.getNodes()).call(e,t=>t.id)}getSelectedEdgeIds(){var e;return fn(e=this._selectionAccumulator.getEdges()).call(e,t=>t.id)}setSelection(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((t.unselectAll||t.unselectAll===void 0)&&this.unselectAll(),e.nodes)for(const r of e.nodes){const n=this.body.nodes[r];if(!n)throw new RangeError('Node with id "'+r+'" not found');this.selectObject(n,t.highlightEdges)}if(e.edges)for(const r of e.edges){const n=this.body.edges[r];if(!n)throw new RangeError('Edge with id "'+r+'" not found');this.selectObject(n)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:t})}selectEdges(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}updateSelection(){for(const e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(const e in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,e.id)||this._selectionAccumulator.deleteEdges(e)}getClickedItems(e){const t=this.canvas.DOMtoCanvas(e),r=[],n=this.body.nodeIndices,o=this.body.nodes;for(let l=n.length-1;l>=0;l--){const h=o[n[l]].getItemsOnPoint(t);r.push.apply(r,h)}const s=this.body.edgeIndices,a=this.body.edges;for(let l=s.length-1;l>=0;l--){const h=a[s[l]].getItemsOnPoint(t);r.push.apply(r,h)}return r}}var Nb=iE,wae=Math.floor,Eu=function(i,e){var t=i.length,r=wae(t/2);return t<8?Eae(i,e):_ae(i,Eu(Nb(i,0,r),e),Eu(Nb(i,r),e),e)},Eae=function(i,e){for(var t=i.length,r=1,n,o;r<t;){for(o=r,n=i[r];o&&e(i[o-1],n)>0;)i[o]=i[--o];o!==r++&&(i[o]=n)}return i},_ae=function(i,e,t,r){for(var n=e.length,o=t.length,s=0,a=0;s<n||a<o;)i[s+a]=s<n&&a<o?r(e[s],t[a])<=0?e[s++]:t[a++]:s<n?e[s++]:t[a++];return i},Sae=Eu,Oae=Qo,Fb=Oae.match(/firefox\/(\d+)/i),Tae=!!Fb&&+Fb[1],Iae=Qo,Pae=/MSIE|Trident/.test(Iae),Cae=Qo,Bb=Cae.match(/AppleWebKit\/(\d+)\./),xae=!!Bb&&+Bb[1],Aae=N,$S=K,Dae=kn,Mae=_t,Lb=Yt,kae=zE,jb=qt,Xf=U,Rae=Sae,Nae=Ln,zb=Tae,Fae=Pae,Hb=es,Wb=xae,Sr=[],Vb=$S(Sr.sort),Bae=$S(Sr.push),Lae=Xf(function(){Sr.sort(void 0)}),jae=Xf(function(){Sr.sort(null)}),zae=Nae("sort"),wS=!Xf(function(){if(Hb)return Hb<70;if(!(zb&&zb>3)){if(Fae)return!0;if(Wb)return Wb<603;var i="",e,t,r,n;for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)Sr.push({k:t+n,v:r})}for(Sr.sort(function(o,s){return s.v-o.v}),n=0;n<Sr.length;n++)t=Sr[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return i!=="DGBEFHACIJK"}}),Hae=Lae||!jae||!zae||!wS,Wae=function(i){return function(e,t){return t===void 0?-1:e===void 0?1:i!==void 0?+i(e,t)||0:jb(e)>jb(t)?1:-1}};Aae({target:"Array",proto:!0,forced:Hae},{sort:function(e){e!==void 0&&Dae(e);var t=Mae(this);if(wS)return e===void 0?Vb(t):Vb(t,e);var r=[],n=Lb(t),o,s;for(s=0;s<n;s++)s in t&&Bae(r,t[s]);for(Rae(r,Wae(e)),o=Lb(r),s=0;s<o;)t[s]=r[s++];for(;s<n;)kae(t,s++);return t}});var Vae=ze,Uae=Vae("Array").sort,Kae=Te,Gae=Uae,hc=Array.prototype,Yae=function(i){var e=i.sort;return i===hc||Kae(hc,i)&&e===hc.sort?Gae:e},qae=Yae,Xae=qae,Zae=Xae,rn=B(Zae),Jae=kn,Qae=_t,ele=Al,tle=Yt,rle=TypeError,ile=function(i){return function(e,t,r,n){Jae(t);var o=Qae(e),s=ele(o),a=tle(o),l=i?a-1:0,d=i?-1:1;if(r<2)for(;;){if(l in s){n=s[l],l+=d;break}if(l+=d,i?l<0:a<=l)throw new rle("Reduce of empty array with no initial value")}for(;i?l>=0:a>l;l+=d)l in s&&(n=t(n,s[l],l,o));return n}},nle={left:ile(!1)},ole=ve,sle=vr,ale=sle(ole.process)==="process",lle=N,dle=nle.left,hle=Ln,Ub=es,cle=ale,ule=!cle&&Ub>79&&Ub<83,fle=ule||!hle("reduce");lle({target:"Array",proto:!0,forced:fle},{reduce:function(e){var t=arguments.length;return dle(this,e,t,t>1?arguments[1]:void 0)}});var vle=ze,ple=vle("Array").reduce,gle=Te,yle=ple,cc=Array.prototype,mle=function(i){var e=i.reduce;return i===cc||gle(cc,i)&&e===cc.reduce?yle:e},ble=mle,$le=ble,wle=$le,ES=B(wle);class _S{abstract(){throw new Error("Can't instantiate abstract class!")}fake_use(){}curveType(){return this.abstract()}getPosition(e){return this.fake_use(e),this.abstract()}setPosition(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,t,r),this.abstract()}getTreeSize(e){return this.fake_use(e),this.abstract()}sort(e){this.fake_use(e),this.abstract()}fix(e,t){this.fake_use(e,t),this.abstract()}shift(e,t){this.fake_use(e,t),this.abstract()}}class Ele extends _S{constructor(e){super(),this.layout=e}curveType(){return"horizontal"}getPosition(e){return e.x}setPosition(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;r!==void 0&&this.layout.hierarchical.addToOrdering(e,r),e.x=t}getTreeSize(e){const t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_x,max:t.max_x}}sort(e){rn(e).call(e,function(t,r){return t.x-r.x})}fix(e,t){e.y=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.y=!0}shift(e,t){this.layout.body.nodes[e].x+=t}}class _le extends _S{constructor(e){super(),this.layout=e}curveType(){return"vertical"}getPosition(e){return e.y}setPosition(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;r!==void 0&&this.layout.hierarchical.addToOrdering(e,r),e.y=t}getTreeSize(e){const t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_y,max:t.max_y}}sort(e){rn(e).call(e,function(t,r){return t.y-r.y})}fix(e,t){e.x=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.x=!0}shift(e,t){this.layout.body.nodes[e].y+=t}}var Sle=N,Ole=zr.every,Tle=Ln,Ile=Tle("every");Sle({target:"Array",proto:!0,forced:!Ile},{every:function(e){return Ole(this,e,arguments.length>1?arguments[1]:void 0)}});var Ple=ze,Cle=Ple("Array").every,xle=Te,Ale=Cle,uc=Array.prototype,Dle=function(i){var e=i.every;return i===uc||xle(uc,i)&&e===uc.every?Ale:e},Mle=Dle,kle=Mle,Rle=kle,SS=B(Rle);function Nle(i,e){const t=new wr;return Z(i).call(i,r=>{var n;Z(n=r.edges).call(n,o=>{o.connected&&t.add(o)})}),Z(t).call(t,r=>{const n=r.from.id,o=r.to.id;e[n]==null&&(e[n]=0),(e[o]==null||e[n]>=e[o])&&(e[o]=e[n]+1)}),e}function Fle(i){return OS(e=>{var t,r;return SS(t=ot(r=e.edges).call(r,n=>i.has(n.toId))).call(t,n=>n.to===e)},(e,t)=>t>e,"from",i)}function Ble(i){return OS(e=>{var t,r;return SS(t=ot(r=e.edges).call(r,n=>i.has(n.toId))).call(t,n=>n.from===e)},(e,t)=>t<e,"to",i)}function OS(i,e,t,r){var n;const o=oi(null),s=ES(n=[...aS(r).call(r)]).call(n,(c,u)=>c+1+u.edges.length,0),a=t+"Id",l=t==="to"?1:-1;for(const[c,u]of r){if(!r.has(c)||!i(u))continue;o[c]=0;const f=[u];let v=0,y;for(;y=f.pop();){var d,h;if(!r.has(c))continue;const g=o[y.id]+l;if(Z(d=ot(h=y.edges).call(h,p=>p.connected&&p.to!==p.from&&p[t]!==y&&r.has(p.toId)&&r.has(p.fromId))).call(d,p=>{const m=p[a],$=o[m];($==null||e(g,$))&&(o[m]=g,f.push(p[t]))}),v>s)return Nle(r,o);++v}}return o}class Lle{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(e,t){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(t),this.parentReference[t]===void 0&&(this.parentReference[t]=[]),this.parentReference[t].push(e)}checkIfTree(){for(const e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(e,t){t!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}ensureLevel(e){this.levels[e]===void 0&&(this.levels[e]=0)}getMaxLevel(e){const t={},r=n=>{if(t[n]!==void 0)return t[n];let o=this.levels[n];if(this.childrenReference[n]){const s=this.childrenReference[n];if(s.length>0)for(let a=0;a<s.length;a++)o=Math.max(o,r(s[a]))}return t[n]=o,o};return r(e)}levelDownstream(e,t){this.levels[t.id]===void 0&&(this.levels[e.id]===void 0&&(this.levels[e.id]=0),this.levels[t.id]=this.levels[e.id]+1)}setMinLevelToZero(){var e;const t=new Uf;let r=0;const n=rn(e=[...new wr(wZ(this.levels))]).call(e,(o,s)=>o-s);for(const o of n)t.set(o,r++);for(const o in this.levels)Object.prototype.hasOwnProperty.call(this.levels,o)&&(this.levels[o]=t.get(this.levels[o]))}getTreeSize(e,t){let r=1e9,n=-1e9,o=1e9,s=-1e9;for(const a in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,a)&&this.trees[a]===t){const l=e[a];r=Math.min(l.x,r),n=Math.max(l.x,n),o=Math.min(l.y,o),s=Math.max(l.y,s)}return{min_x:r,max_x:n,min_y:o,max_y:s}}hasSameParent(e,t){const r=this.parentReference[e.id],n=this.parentReference[t.id];if(r===void 0||n===void 0)return!1;for(let o=0;o<r.length;o++)for(let s=0;s<n.length;s++)if(r[o]==n[s])return!0;return!1}inSameSubNetwork(e,t){return this.trees[e.id]===this.trees[t.id]}getLevels(){return he(this.distributionOrdering)}addToOrdering(e,t){this.distributionOrdering[t]===void 0&&(this.distributionOrdering[t]=[]);let r=!1;const n=this.distributionOrdering[t];for(const o in n)if(n[o]===e){r=!0;break}r||(this.distributionOrdering[t].push(e),this.distributionIndex[e.id]=this.distributionOrdering[t].length-1)}}class jle{constructor(e){this.body=e,this._resetRNG(Math.random()+":"+Va()),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"}},Ee(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("_dataChanged",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",()=>{this.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",()=>{if(this.options.hierarchical.enabled!==!0)return;const e=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",e,!1)})}setOptions(e,t){if(e!==void 0){const r=this.options.hierarchical,n=r.enabled;if(zn(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),mt(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),r.enabled===!0)return n===!0&&this.body.emitter.emit("refresh",!0),r.direction==="RL"||r.direction==="DU"?r.levelSeparation>0&&(r.levelSeparation*=-1):r.levelSeparation<0&&(r.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(n===!0)return this.body.emitter.emit("refresh"),Q(t,this.optionsBackup)}return t}_resetRNG(e){this.initialRandomSeed=e,this._rng=ql(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(e){if(this.options.hierarchical.enabled===!0){const t=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:t.enabled===void 0?!0:t.enabled,solver:"hierarchicalRepulsion"},t.enabled=t.enabled===void 0?!0:t.enabled,t.solver=t.solver||"barnesHut"):typeof e.physics=="object"?(t.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,t.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(t.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});let r=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if(typeof e.edges.smooth=="boolean")this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:r};else{const n=e.edges.smooth;n.type!==void 0&&n.type!=="dynamic"&&(r=n.type),this.optionsBackup.edges={smooth:{enabled:n.enabled===void 0?!0:n.enabled,type:n.type===void 0?"dynamic":n.type,roundness:n.roundness===void 0?.5:n.roundness,forceDirection:n.forceDirection===void 0?!1:n.forceDirection}},e.edges.smooth={enabled:n.enabled===void 0?!0:n.enabled,type:r,roundness:n.roundness===void 0?.5:n.roundness,forceDirection:n.forceDirection===void 0?!1:n.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",r)}return e}positionInitially(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);const t=e.length+50;for(let r=0;r<e.length;r++){const n=e[r],o=2*Math.PI*this._rng();n.x===void 0&&(n.x=t*Math.cos(o)),n.y===void 0&&(n.y=t*Math.sin(o))}}}layoutNetwork(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){const e=this.body.nodeIndices;let t=0;for(let r=0;r<e.length;r++)this.body.nodes[e[r]].predefinedPosition===!0&&(t+=1);if(t<.5*e.length){let n=0;const o=this.options.clusterThreshold,s={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(e.length>o){const l=e.length;for(;e.length>o&&n<=10;){n+=1;const d=e.length;n%3===0?this.body.modules.clustering.clusterBridges(s):this.body.modules.clustering.clusterOutliers(s);const h=e.length;if(d==h&&n%3!==0){this._declusterAll(),this.body.emitter.emit("_layoutFailed"),console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*l)})}n>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();const a=70;for(let l=0;l<e.length;l++){const d=this.body.nodes[e[l]];d.predefinedPosition===!1&&(d.x+=(.5-this._rng())*a,d.y+=(.5-this._rng())*a)}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}_shiftToCenter(){const e=Ye.getRangeCore(this.body.nodes,this.body.nodeIndices),t=Ye.findCenter(e);for(let r=0;r<this.body.nodeIndices.length;r++){const n=this.body.nodes[this.body.nodeIndices[r]];n.x-=t.x,n.y-=t.y}}_declusterAll(){let e=!0;for(;e===!0;){e=!1;for(let t=0;t<this.body.nodeIndices.length;t++)this.body.nodes[this.body.nodeIndices[t]].isCluster===!0&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[t],{},!1));e===!0&&this.body.emitter.emit("_dataChanged")}}getSeed(){return this.initialRandomSeed}setupHierarchicalLayout(){if(this.options.hierarchical.enabled===!0&&this.body.nodeIndices.length>0){let e,t,r=!1,n=!1;this.lastNodeOnLevel={},this.hierarchical=new Lle;for(t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(e=this.body.nodes[t],e.options.level!==void 0?(r=!0,this.hierarchical.levels[t]=e.options.level):n=!0);if(n===!0&&r===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");{if(n===!0){const s=this.options.hierarchical.sortMethod;s==="hubsize"?this._determineLevelsByHubsize():s==="directed"?this._determineLevelsDirected():s==="custom"&&this._determineLevelsCustomCallback()}for(const s in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,s)&&this.hierarchical.ensureLevel(s);const o=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(o),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var e=this;let t=!1;const r={},n=()=>{const p=s();let m=0;for(let $=0;$<p.length-1;$++){const E=p[$].max-p[$+1].min;m+=E+this.options.hierarchical.treeSpacing,o($+1,m)}},o=(p,m)=>{const $=this.hierarchical.trees;for(const E in $)Object.prototype.hasOwnProperty.call($,E)&&$[E]===p&&this.direction.shift(E,m)},s=()=>{const p=[];for(let m=0;m<this.hierarchical.numTrees();m++)p.push(this.direction.getTreeSize(m));return p},a=(p,m)=>{if(!m[p.id]&&(m[p.id]=!0,this.hierarchical.childrenReference[p.id])){const $=this.hierarchical.childrenReference[p.id];if($.length>0)for(let E=0;E<$.length;E++)a(this.body.nodes[$[E]],m)}},l=function(p){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,$=1e9,E=1e9,P=1e9,D=-1e9;for(const L in p)if(Object.prototype.hasOwnProperty.call(p,L)){const W=e.body.nodes[L],se=e.hierarchical.levels[W.id],le=e.direction.getPosition(W),[Ve,ke]=e._getSpaceAroundNode(W,p);$=Math.min(Ve,$),E=Math.min(ke,E),se<=m&&(P=Math.min(le,P),D=Math.max(le,D))}return[P,D,$,E]},d=(p,m)=>{const $=this.hierarchical.getMaxLevel(p.id),E=this.hierarchical.getMaxLevel(m.id);return Math.min($,E)},h=(p,m,$)=>{const E=this.hierarchical;for(let P=0;P<m.length;P++){const D=m[P],L=E.distributionOrdering[D];if(L.length>1)for(let W=0;W<L.length-1;W++){const se=L[W],le=L[W+1];E.hasSameParent(se,le)&&E.inSameSubNetwork(se,le)&&p(se,le,$)}}},c=function(p,m){let $=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const E=e.direction.getPosition(p),P=e.direction.getPosition(m),D=Math.abs(P-E),L=e.options.hierarchical.nodeSpacing;if(D>L){const W={},se={};a(p,W),a(m,se);const le=d(p,m),Ve=l(W,le),ke=l(se,le),Re=Ve[1],ct=ke[0],re=ke[2];if(Math.abs(Re-ct)>L){let G=Re-ct+L;G<-re+L&&(G=-re+L),G<0&&(e._shiftBlock(m.id,G),t=!0,$===!0&&e._centerParent(m))}}},u=(p,m)=>{const $=m.id,E=m.edges,P=this.hierarchical.levels[m.id],D=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,L={},W=[];for(let re=0;re<E.length;re++){const V=E[re];if(V.toId!=V.fromId){const G=V.toId==$?V.from:V.to;L[E[re].id]=G,this.hierarchical.levels[G.id]<P&&W.push(V)}}const se=(re,V)=>{let G=0;for(let be=0;be<V.length;be++)if(L[V[be].id]!==void 0){const $e=this.direction.getPosition(L[V[be].id])-re;G+=$e/Math.sqrt($e*$e+D)}return G},le=(re,V)=>{let G=0;for(let be=0;be<V.length;be++)if(L[V[be].id]!==void 0){const $e=this.direction.getPosition(L[V[be].id])-re;G-=D*Math.pow($e*$e+D,-1.5)}return G},Ve=(re,V)=>{let G=this.direction.getPosition(m);const be={};for(let $e=0;$e<re;$e++){const Pe=se(G,V),Xt=le(G,V),Nt=40,ed=Math.max(-Nt,Math.min(Nt,Math.round(Pe/Xt)));if(G=G-ed,be[G]!==void 0)break;be[G]=$e}return G},ke=re=>{const V=this.direction.getPosition(m);if(r[m.id]===void 0){const Nt={};a(m,Nt),r[m.id]=Nt}const G=l(r[m.id]),be=G[2],$e=G[3],Pe=re-V;let Xt=0;Pe>0?Xt=Math.min(Pe,$e-this.options.hierarchical.nodeSpacing):Pe<0&&(Xt=-Math.min(-Pe,be-this.options.hierarchical.nodeSpacing)),Xt!=0&&(this._shiftBlock(m.id,Xt),t=!0)},Re=re=>{const V=this.direction.getPosition(m),[G,be]=this._getSpaceAroundNode(m),$e=re-V;let Pe=V;$e>0?Pe=Math.min(V+(be-this.options.hierarchical.nodeSpacing),re):$e<0&&(Pe=Math.max(V-(G-this.options.hierarchical.nodeSpacing),re)),Pe!==V&&(this.direction.setPosition(m,Pe),t=!0)};let ct=Ve(p,W);ke(ct),ct=Ve(p,E),Re(ct)},f=p=>{let m=this.hierarchical.getLevels();m=ni(m).call(m);for(let $=0;$<p;$++){t=!1;for(let E=0;E<m.length;E++){const P=m[E],D=this.hierarchical.distributionOrdering[P];for(let L=0;L<D.length;L++)u(1e3,D[L])}if(t!==!0)break}},v=p=>{let m=this.hierarchical.getLevels();m=ni(m).call(m);for(let $=0;$<p&&(t=!1,h(c,m,!0),t===!0);$++);},y=()=>{for(const p in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,p)&&this._centerParent(this.body.nodes[p])},g=()=>{let p=this.hierarchical.getLevels();p=ni(p).call(p);for(let m=0;m<p.length;m++){const $=p[m],E=this.hierarchical.distributionOrdering[$];for(let P=0;P<E.length;P++)this._centerParent(E[P])}};this.options.hierarchical.blockShifting===!0&&(v(5),y()),this.options.hierarchical.edgeMinimization===!0&&f(20),this.options.hierarchical.parentCentralization===!0&&g(),n()}_getSpaceAroundNode(e,t){let r=!0;t===void 0&&(r=!1);const n=this.hierarchical.levels[e.id];if(n!==void 0){const o=this.hierarchical.distributionIndex[e.id],s=this.direction.getPosition(e),a=this.hierarchical.distributionOrdering[n];let l=1e9,d=1e9;if(o!==0){const h=a[o-1];if(r===!0&&t[h.id]===void 0||r===!1){const c=this.direction.getPosition(h);l=s-c}}if(o!=a.length-1){const h=a[o+1];if(r===!0&&t[h.id]===void 0||r===!1){const c=this.direction.getPosition(h);d=Math.min(d,c-s)}}return[l,d]}else return[0,0]}_centerParent(e){if(this.hierarchical.parentReference[e.id]){const t=this.hierarchical.parentReference[e.id];for(let r=0;r<t.length;r++){const n=t[r],o=this.body.nodes[n],s=this.hierarchical.childrenReference[n];if(s!==void 0){const a=this._getCenterPosition(s),l=this.direction.getPosition(o),[d,h]=this._getSpaceAroundNode(o),c=l-a;(c<0&&Math.abs(c)<h-this.options.hierarchical.nodeSpacing||c>0&&Math.abs(c)<d-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(o,a)}}}}_placeNodesByHierarchy(e){this.positionedNodes={};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var t;let n=he(e[r]);n=this._indexArrayToNodes(n),rn(t=this.direction).call(t,n);let o=0;for(let s=0;s<n.length;s++){const a=n[s];if(this.positionedNodes[a.id]===void 0){const l=this.options.hierarchical.nodeSpacing;let d=l*o;o>0&&(d=this.direction.getPosition(n[s-1])+l),this.direction.setPosition(a,d,r),this._validatePositionAndContinue(a,r,d),o++}}}}_placeBranchNodes(e,t){var r;const n=this.hierarchical.childrenReference[e];if(n===void 0)return;const o=[];for(let a=0;a<n.length;a++)o.push(this.body.nodes[n[a]]);rn(r=this.direction).call(r,o);for(let a=0;a<o.length;a++){const l=o[a],d=this.hierarchical.levels[l.id];if(d>t&&this.positionedNodes[l.id]===void 0){const h=this.options.hierarchical.nodeSpacing;let c;a===0?c=this.direction.getPosition(this.body.nodes[e]):c=this.direction.getPosition(o[a-1])+h,this.direction.setPosition(l,c,d),this._validatePositionAndContinue(l,d,c)}else return}const s=this._getCenterPosition(o);this.direction.setPosition(this.body.nodes[e],s,t)}_validatePositionAndContinue(e,t,r){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[t]!==void 0){const n=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(r-n<this.options.hierarchical.nodeSpacing){const o=n+this.options.hierarchical.nodeSpacing-r,s=this._findCommonParent(this.lastNodeOnLevel[t],e.id);this._shiftBlock(s.withChild,o)}}this.lastNodeOnLevel[t]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,t)}}_indexArrayToNodes(e){const t=[];for(let r=0;r<e.length;r++)t.push(this.body.nodes[e[r]]);return t}_getDistribution(){const e={};let t,r;for(t in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,t)){r=this.body.nodes[t];const n=this.hierarchical.levels[t]===void 0?0:this.hierarchical.levels[t];this.direction.fix(r,n),e[n]===void 0&&(e[n]={}),e[n][t]=r}return e}_getActiveEdges(e){const t=[];return H(e.edges,r=>{var n;q(n=this.body.edgeIndices).call(n,r.id)!==-1&&t.push(r)}),t}_getHubSizes(){const e={},t=this.body.nodeIndices;H(t,n=>{const o=this.body.nodes[n],s=this._getActiveEdges(o).length;e[s]=!0});const r=[];return H(e,n=>{r.push(Number(n))}),rn(r).call(r,function(n,o){return o-n}),r}_determineLevelsByHubsize(){const e=(r,n)=>{this.hierarchical.levelDownstream(r,n)},t=this._getHubSizes();for(let r=0;r<t.length;++r){const n=t[r];if(n===0)break;H(this.body.nodeIndices,o=>{const s=this.body.nodes[o];n===this._getActiveEdges(s).length&&this._crawlNetwork(e,o)})}}_determineLevelsCustomCallback(){const t=function(n,o,s){},r=(n,o,s)=>{let a=this.hierarchical.levels[n.id];a===void 0&&(a=this.hierarchical.levels[n.id]=1e5);const l=t(Ye.cloneOptions(n,"node"),Ye.cloneOptions(o,"node"),Ye.cloneOptions(s,"edge"));this.hierarchical.levels[o.id]=a+l};this._crawlNetwork(r),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;const t=ES(e=this.body.nodeIndices).call(e,(r,n)=>(r.set(n,this.body.nodes[n]),r),new Uf);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=Ble(t):this.hierarchical.levels=Fle(t),this.hierarchical.setMinLevelToZero()}_generateMap(){const e=(t,r)=>{this.hierarchical.levels[r.id]>this.hierarchical.levels[t.id]&&this.hierarchical.addRelation(t.id,r.id)};this._crawlNetwork(e),this.hierarchical.checkIfTree()}_crawlNetwork(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},t=arguments.length>1?arguments[1]:void 0;const r={},n=(o,s)=>{if(r[o.id]===void 0){this.hierarchical.setTreeIndex(o,s),r[o.id]=!0;let a;const l=this._getActiveEdges(o);for(let d=0;d<l.length;d++){const h=l[d];h.connected===!0&&(h.toId==o.id?a=h.from:a=h.to,o.id!=a.id&&(e(o,a,h),n(a,s)))}}};if(t===void 0){let o=0;for(let s=0;s<this.body.nodeIndices.length;s++){const a=this.body.nodeIndices[s];if(r[a]===void 0){const l=this.body.nodes[a];n(l,o),o+=1}}}else{const o=this.body.nodes[t];if(o===void 0){console.error("Node not found:",t);return}n(o)}}_shiftBlock(e,t){const r={},n=o=>{if(r[o])return;r[o]=!0,this.direction.shift(o,t);const s=this.hierarchical.childrenReference[o];if(s!==void 0)for(let a=0;a<s.length;a++)n(s[a])};n(e)}_findCommonParent(e,t){const r={},n=(s,a)=>{const l=this.hierarchical.parentReference[a];if(l!==void 0)for(let d=0;d<l.length;d++){const h=l[d];s[h]=!0,n(s,h)}},o=(s,a)=>{const l=this.hierarchical.parentReference[a];if(l!==void 0)for(let d=0;d<l.length;d++){const h=l[d];if(s[h]!==void 0)return{foundParent:h,withChild:a};const c=o(s,h);if(c.foundParent!==null)return c}return{foundParent:null,withChild:a}};return n(r,e),o(r,t)}setDirectionStrategy(){this.options.hierarchical.direction==="UD"||this.options.hierarchical.direction==="DU"?this.direction=new Ele(this):this.direction=new _le(this)}_getCenterPosition(e){let t=1e9,r=-1e9;for(let n=0;n<e.length;n++){let o;if(e[n].id!==void 0)o=e[n];else{const a=e[n];o=this.body.nodes[a]}const s=this.direction.getPosition(o);t=Math.min(t,s),r=Math.max(r,s)}return .5*(t+r)}}class zle{constructor(e,t,r,n){var o,s;this.body=e,this.canvas=t,this.selectionHandler=r,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}},Ee(this.options,this.defaultOptions),this.body.emitter.on("destroy",()=>{this._clean()}),this.body.emitter.on("_dataChanged",_(o=this._restore).call(o,this)),this.body.emitter.on("_resetData",_(s=this._restore).call(s,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(e,t,r){t!==void 0&&(t.locale!==void 0?this.options.locale=t.locale:this.options.locale=r.locale,t.locales!==void 0?this.options.locales=t.locales:this.options.locales=r.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,Q(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}toggleEditMode(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var e,t;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";const r=this.selectionHandler.getSelectedNodeCount(),n=this.selectionHandler.getSelectedEdgeCount(),o=r+n,s=this.options.locales[this.options.locale];let a=!1;this.options.addNode!==!1&&(this._createAddNodeButton(s),a=!0),this.options.addEdge!==!1&&(a===!0?this._createSeperator(1):a=!0,this._createAddEdgeButton(s)),r===1&&typeof this.options.editNode=="function"?(a===!0?this._createSeperator(2):a=!0,this._createEditNodeButton(s)):n===1&&r===0&&this.options.editEdge!==!1&&(a===!0?this._createSeperator(3):a=!0,this._createEditEdgeButton(s)),o!==0&&(r>0&&this.options.deleteNode!==!1?(a===!0&&this._createSeperator(4),this._createDeleteButton(s)):r===0&&this.options.deleteEdge!==!1&&(a===!0&&this._createSeperator(4),this._createDeleteButton(s))),this._bindElementEvents(this.closeDiv,_(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",_(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var t;const r=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(r),this._createSeperator(),this._createDescription(r.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,_(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",_(e=this._performAddNode).call(e,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();const e=this.selectionHandler.getSelectedNodes()[0];if(e!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(e.isCluster!==!0){const t=Q({},e.options,!1);if(t.x=e.x,t.y=e.y,this.options.editNode.length===2)this.options.editNode(t,r=>{r!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(r),this.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}addEdgeMode(){var e,t,r,n,o;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var s;const a=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(a),this._createSeperator(),this._createDescription(a.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,_(s=this.toggleEditMode).call(s,this))}this._temporaryBindUI("onTouch",_(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",_(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",_(r=this._dragControlNode).call(r,this)),this._temporaryBindUI("onRelease",_(n=this._finishConnect).call(n,this)),this._temporaryBindUI("onDragStart",_(o=this._dragStartEdge).call(o,this)),this._temporaryBindUI("onHold",()=>{})}editEdgeMode(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",typeof this.options.editEdge=="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){const s=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(s.from.id,s.to.id);return}if(this.guiEnabled===!0){var e;const s=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(s),this._createSeperator(),this._createDescription(s.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,_(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var t,r,n,o;const s=this.body.edges[this.edgeBeingEditedId],a=this._getNewTargetNode(s.from.x,s.from.y),l=this._getNewTargetNode(s.to.x,s.to.y);this.temporaryIds.nodes.push(a.id),this.temporaryIds.nodes.push(l.id),this.body.nodes[a.id]=a,this.body.nodeIndices.push(a.id),this.body.nodes[l.id]=l,this.body.nodeIndices.push(l.id),this._temporaryBindUI("onTouch",_(t=this._controlNodeTouch).call(t,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",_(r=this._controlNodeDragStart).call(r,this)),this._temporaryBindUI("onDrag",_(n=this._controlNodeDrag).call(n,this)),this._temporaryBindUI("onDragEnd",_(o=this._controlNodeDragEnd).call(o,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",d=>{const h=s.edgeType.findBorderPositions(d);a.selected===!1&&(a.x=h.from.x,a.y=h.from.y),l.selected===!1&&(l.x=h.to.x,l.y=h.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";const e=this.selectionHandler.getSelectedNodeIds(),t=this.selectionHandler.getSelectedEdgeIds();let r;if(e.length>0){for(let n=0;n<e.length;n++)if(this.body.nodes[e[n]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode=="function"&&(r=this.options.deleteNode)}else t.length>0&&typeof this.options.deleteEdge=="function"&&(r=this.options.deleteEdge);if(typeof r=="function"){const n={nodes:e,edges:t};if(r.length===2)r(n,o=>{o!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(o.edges),this.body.data.nodes.getDataSet().remove(o.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(t),this.body.data.nodes.getDataSet().remove(e),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}_setup(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){if(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0){var e,t;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(t=this.options.locales[this.options.locale])===null||t===void 0?void 0:t.close)!==null&&e!==void 0?e:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}_getNewTargetNode(e,t){const r=Q({},this.options.controlNodeStyle);r.id="targetNode"+ao(),r.hidden=!1,r.physics=!1,r.x=e,r.y=t;const n=this.body.functions.createNode(r);return n.shape.boundingBox={left:e,right:e,top:t,bottom:t},n}_createEditButton(){var e;this._clean(),this.manipulationDOM={},br(this.editModeDiv);const t=this.options.locales[this.options.locale],r=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(r),this._bindElementEvents(r,_(e=this.toggleEditMode).call(e,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(br(this.editModeDiv),br(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(const t of ir(e=this._domEventListenerCleanupQueue).call(e,0)){var e;t()}}_removeManipulationDOM(){this._clean(),br(this.manipulationDiv),br(this.editModeDiv),br(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}_createSeperator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}_createAddNodeButton(e){var t;const r=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,_(t=this.addNodeMode).call(t,this))}_createAddEdgeButton(e){var t;const r=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,_(t=this.addEdgeMode).call(t,this))}_createEditNodeButton(e){var t;const r=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,_(t=this.editNode).call(t,this))}_createEditEdgeButton(e){var t;const r=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,_(t=this.editEdgeMode).call(t,this))}_createDeleteButton(e){var t;let r;this.options.rtl?r="vis-delete-rtl":r="vis-delete";const n=this._createButton("delete",r,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,_(t=this.deleteSelected).call(t,this))}_createBackButton(e){var t;const r=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,_(t=this.showManipulatorToolbar).call(t,this))}_createButton(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("button"),this.manipulationDOM[e+"Div"].className="vis-button "+t,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=n,this.manipulationDOM[e+"Label"].innerText=r,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}_createDescription(e){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}_temporaryBindUI(e,t){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+gs(he(this.body.eventListeners)))}_unbindTemporaryUIs(){for(const e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let e=0;e<this.temporaryEventFunctions.length;e++){const t=this.temporaryEventFunctions[e].event,r=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(t,r)}this.temporaryEventFunctions=[]}_bindElementEvents(e,t){const r=new en(e,{});Qa(r,t),this._domEventListenerCleanupQueue.push(()=>{r.destroy()});const n=o=>{let{keyCode:s,key:a}=o;(a==="Enter"||a===" "||s===13||s===32)&&t()};e.addEventListener("keyup",n,!1),this._domEventListenerCleanupQueue.push(()=>{e.removeEventListener("keyup",n,!1)})}_cleanupTemporaryNodesAndEdges(){for(let o=0;o<this.temporaryIds.edges.length;o++){var e;this.body.edges[this.temporaryIds.edges[o]].disconnect(),delete this.body.edges[this.temporaryIds.edges[o]];const s=q(e=this.body.edgeIndices).call(e,this.temporaryIds.edges[o]);if(s!==-1){var t;ir(t=this.body.edgeIndices).call(t,s,1)}}for(let o=0;o<this.temporaryIds.nodes.length;o++){var r;delete this.body.nodes[this.temporaryIds.nodes[o]];const s=q(r=this.body.nodeIndices).call(r,this.temporaryIds.nodes[o]);if(s!==-1){var n;ir(n=this.body.nodeIndices).call(n,s,1)}}this.temporaryIds={nodes:[],edges:[]}}_controlNodeTouch(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=Ee({},this.body.view.translation)}_controlNodeDragStart(){const e=this.lastTouch,t=this.selectionHandler._pointerToPositionObject(e),r=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 s=r.isOverlappingWith(t),a=n.isOverlappingWith(t);s===!0?(this.selectedControlNode=r,o.edgeType.from=r):a===!0&&(this.selectedControlNode=n,o.edgeType.to=n),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}_controlNodeDrag(e){this.body.emitter.emit("disablePhysics");const t=this.body.functions.getPointer(e.center),r=this.canvas.DOMtoCanvas(t);this.selectedControlNode!==void 0?(this.selectedControlNode.x=r.x,this.selectedControlNode.y=r.y):this.interactionHandler.onDrag(e),this.body.emitter.emit("_redraw")}_controlNodeDragEnd(e){const t=this.body.functions.getPointer(e.center),r=this.selectionHandler._pointerToPositionObject(t),n=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode===void 0)return;this.selectionHandler.unselectAll();const o=this.selectionHandler._getAllNodesOverlappingWith(r);let s;for(let a=o.length-1;a>=0;a--)if(o[a]!==this.selectedControlNode.id){s=this.body.nodes[o[a]];break}if(s!==void 0&&this.selectedControlNode!==void 0)if(s.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const a=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===a.id?this._performEditEdge(s.id,n.to.id):this._performEditEdge(n.from.id,s.id)}else n.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}_handleConnect(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=Ee({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;const t=this.lastTouch,r=this.selectionHandler.getNodeAt(t);if(r!==void 0)if(r.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const n=this._getNewTargetNode(r.x,r.y);this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id);const o=this.body.functions.createEdge({id:"connectionEdge"+ao(),from:r.id,to:n.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[o.id]=o,this.body.edgeIndices.push(o.id),this.temporaryIds.nodes.push(n.id),this.temporaryIds.edges.push(o.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(e){const t=this.body.functions.getPointer(e.center),r=this.selectionHandler._pointerToPositionObject(t);let n;this.temporaryIds.edges[0]!==void 0&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);const o=this.selectionHandler._getAllNodesOverlappingWith(r);let s;for(let l=o.length-1;l>=0;l--){var a;if(q(a=this.temporaryIds.nodes).call(a,o[l])===-1){s=this.body.nodes[o[l]];break}}if(e.controlEdge={from:n,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,t),this.temporaryIds.nodes[0]!==void 0){const l=this.body.nodes[this.temporaryIds.nodes[0]];l.x=this.canvas._XconvertDOMtoCanvas(t.x),l.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}_finishConnect(e){const t=this.body.functions.getPointer(e.center),r=this.selectionHandler._pointerToPositionObject(t);let n;this.temporaryIds.edges[0]!==void 0&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);const o=this.selectionHandler._getAllNodesOverlappingWith(r);let s;for(let l=o.length-1;l>=0;l--){var a;if(q(a=this.temporaryIds.nodes).call(a,o[l])===-1){s=this.body.nodes[o[l]];break}}this._cleanupTemporaryNodesAndEdges(),s!==void 0&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[n]!==void 0&&this.body.nodes[s.id]!==void 0&&this._performAddEdge(n,s.id)),e.controlEdge={from:n,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,t),this.body.emitter.emit("_redraw")}_dragStartEdge(e){const t=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,t,void 0,!0)}_performAddNode(e){const t={id:ao(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(t,r=>{r!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(r),this.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(t),this.showManipulatorToolbar()}_performAddEdge(e,t){const r={from:e,to:t};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(r,n=>{n!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(r),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(e,t){const r={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label};let n=this.options.editEdge;if(typeof n=="object"&&(n=n.editWithoutDrag),typeof n=="function")if(n.length===2)n(r,o=>{o==null||this.inMode!=="editEdge"?(this.body.edges[r.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(r),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}const T="string",w="boolean",b="number",Jn="array",x="object",TS="dom",Hle="any",fc=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],vc={borderWidth:{number:b},borderWidthSelected:{number:b,undefined:"undefined"},brokenImage:{string:T,undefined:"undefined"},chosen:{label:{boolean:w,function:"function"},node:{boolean:w,function:"function"},__type__:{object:x,boolean:w}},color:{border:{string:T},background:{string:T},highlight:{border:{string:T},background:{string:T},__type__:{object:x,string:T}},hover:{border:{string:T},background:{string:T},__type__:{object:x,string:T}},__type__:{object:x,string:T}},opacity:{number:b,undefined:"undefined"},fixed:{x:{boolean:w},y:{boolean:w},__type__:{object:x,boolean:w}},font:{align:{string:T},color:{string:T},size:{number:b},face:{string:T},background:{string:T},strokeWidth:{number:b},strokeColor:{string:T},vadjust:{number:b},multi:{boolean:w,string:T},bold:{color:{string:T},size:{number:b},face:{string:T},mod:{string:T},vadjust:{number:b},__type__:{object:x,string:T}},boldital:{color:{string:T},size:{number:b},face:{string:T},mod:{string:T},vadjust:{number:b},__type__:{object:x,string:T}},ital:{color:{string:T},size:{number:b},face:{string:T},mod:{string:T},vadjust:{number:b},__type__:{object:x,string:T}},mono:{color:{string:T},size:{number:b},face:{string:T},mod:{string:T},vadjust:{number:b},__type__:{object:x,string:T}},__type__:{object:x,string:T}},group:{string:T,number:b,undefined:"undefined"},heightConstraint:{minimum:{number:b},valign:{string:T},__type__:{object:x,boolean:w,number:b}},hidden:{boolean:w},icon:{face:{string:T},code:{string:T},size:{number:b},color:{string:T},weight:{string:T,number:b},__type__:{object:x}},id:{string:T,number:b},image:{selected:{string:T,undefined:"undefined"},unselected:{string:T,undefined:"undefined"},__type__:{object:x,string:T}},imagePadding:{top:{number:b},right:{number:b},bottom:{number:b},left:{number:b},__type__:{object:x,number:b}},label:{string:T,undefined:"undefined"},labelHighlightBold:{boolean:w},level:{number:b,undefined:"undefined"},margin:{top:{number:b},right:{number:b},bottom:{number:b},left:{number:b},__type__:{object:x,number:b}},mass:{number:b},physics:{boolean:w},scaling:{min:{number:b},max:{number:b},label:{enabled:{boolean:w},min:{number:b},max:{number:b},maxVisible:{number:b},drawThreshold:{number:b},__type__:{object:x,boolean:w}},customScalingFunction:{function:"function"},__type__:{object:x}},shadow:{enabled:{boolean:w},color:{string:T},size:{number:b},x:{number:b},y:{number:b},__type__:{object:x,boolean:w}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:w,array:Jn},borderRadius:{number:b},interpolation:{boolean:w},useImageSize:{boolean:w},useBorderWithImage:{boolean:w},coordinateOrigin:{string:["center","top-left"]},__type__:{object:x}},size:{number:b},title:{string:T,dom:TS,undefined:"undefined"},value:{number:b,undefined:"undefined"},widthConstraint:{minimum:{number:b},maximum:{number:b},__type__:{object:x,boolean:w,number:b}},x:{number:b},y:{number:b},__type__:{object:x}},Wle={configure:{enabled:{boolean:w},filter:{boolean:w,string:T,array:Jn,function:"function"},container:{dom:TS},showButton:{boolean:w},__type__:{object:x,boolean:w,string:T,array:Jn,function:"function"}},edges:{arrows:{to:{enabled:{boolean:w},scaleFactor:{number:b},type:{string:fc},imageHeight:{number:b},imageWidth:{number:b},src:{string:T},__type__:{object:x,boolean:w}},middle:{enabled:{boolean:w},scaleFactor:{number:b},type:{string:fc},imageWidth:{number:b},imageHeight:{number:b},src:{string:T},__type__:{object:x,boolean:w}},from:{enabled:{boolean:w},scaleFactor:{number:b},type:{string:fc},imageWidth:{number:b},imageHeight:{number:b},src:{string:T},__type__:{object:x,boolean:w}},__type__:{string:["from","to","middle"],object:x}},endPointOffset:{from:{number:b},to:{number:b},__type__:{object:x,number:b}},arrowStrikethrough:{boolean:w},background:{enabled:{boolean:w},color:{string:T},size:{number:b},dashes:{boolean:w,array:Jn},__type__:{object:x,boolean:w}},chosen:{label:{boolean:w,function:"function"},edge:{boolean:w,function:"function"},__type__:{object:x,boolean:w}},color:{color:{string:T},highlight:{string:T},hover:{string:T},inherit:{string:["from","to","both"],boolean:w},opacity:{number:b},__type__:{object:x,string:T}},dashes:{boolean:w,array:Jn},font:{color:{string:T},size:{number:b},face:{string:T},background:{string:T},strokeWidth:{number:b},strokeColor:{string:T},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:b},multi:{boolean:w,string:T},bold:{color:{string:T},size:{number:b},face:{string:T},mod:{string:T},vadjust:{number:b},__type__:{object:x,string:T}},boldital:{color:{string:T},size:{number:b},face:{string:T},mod:{string:T},vadjust:{number:b},__type__:{object:x,string:T}},ital:{color:{string:T},size:{number:b},face:{string:T},mod:{string:T},vadjust:{number:b},__type__:{object:x,string:T}},mono:{color:{string:T},size:{number:b},face:{string:T},mod:{string:T},vadjust:{number:b},__type__:{object:x,string:T}},__type__:{object:x,string:T}},hidden:{boolean:w},hoverWidth:{function:"function",number:b},label:{string:T,undefined:"undefined"},labelHighlightBold:{boolean:w},length:{number:b,undefined:"undefined"},physics:{boolean:w},scaling:{min:{number:b},max:{number:b},label:{enabled:{boolean:w},min:{number:b},max:{number:b},maxVisible:{number:b},drawThreshold:{number:b},__type__:{object:x,boolean:w}},customScalingFunction:{function:"function"},__type__:{object:x}},selectionWidth:{function:"function",number:b},selfReferenceSize:{number:b},selfReference:{size:{number:b},angle:{number:b},renderBehindTheNode:{boolean:w},__type__:{object:x}},shadow:{enabled:{boolean:w},color:{string:T},size:{number:b},x:{number:b},y:{number:b},__type__:{object:x,boolean:w}},smooth:{enabled:{boolean:w},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:b},forceDirection:{string:["horizontal","vertical","none"],boolean:w},__type__:{object:x,boolean:w}},title:{string:T,undefined:"undefined"},width:{number:b},widthConstraint:{maximum:{number:b},__type__:{object:x,boolean:w,number:b}},value:{number:b,undefined:"undefined"},__type__:{object:x}},groups:{useDefaultGroups:{boolean:w},__any__:vc,__type__:{object:x}},interaction:{dragNodes:{boolean:w},dragView:{boolean:w},hideEdgesOnDrag:{boolean:w},hideEdgesOnZoom:{boolean:w},hideNodesOnDrag:{boolean:w},hover:{boolean:w},keyboard:{enabled:{boolean:w},speed:{x:{number:b},y:{number:b},zoom:{number:b},__type__:{object:x}},bindToWindow:{boolean:w},autoFocus:{boolean:w},__type__:{object:x,boolean:w}},multiselect:{boolean:w},navigationButtons:{boolean:w},selectable:{boolean:w},selectConnectedEdges:{boolean:w},hoverConnectedEdges:{boolean:w},tooltipDelay:{number:b},zoomView:{boolean:w},zoomSpeed:{number:b},__type__:{object:x}},layout:{randomSeed:{undefined:"undefined",number:b,string:T},improvedLayout:{boolean:w},clusterThreshold:{number:b},hierarchical:{enabled:{boolean:w},levelSeparation:{number:b},nodeSpacing:{number:b},treeSpacing:{number:b},blockShifting:{boolean:w},edgeMinimization:{boolean:w},parentCentralization:{boolean:w},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:x,boolean:w}},__type__:{object:x}},manipulation:{enabled:{boolean:w},initiallyActive:{boolean:w},addNode:{boolean:w,function:"function"},addEdge:{boolean:w,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:x,boolean:w,function:"function"}},deleteNode:{boolean:w,function:"function"},deleteEdge:{boolean:w,function:"function"},controlNodeStyle:vc,__type__:{object:x,boolean:w}},nodes:vc,physics:{enabled:{boolean:w},barnesHut:{theta:{number:b},gravitationalConstant:{number:b},centralGravity:{number:b},springLength:{number:b},springConstant:{number:b},damping:{number:b},avoidOverlap:{number:b},__type__:{object:x}},forceAtlas2Based:{theta:{number:b},gravitationalConstant:{number:b},centralGravity:{number:b},springLength:{number:b},springConstant:{number:b},damping:{number:b},avoidOverlap:{number:b},__type__:{object:x}},repulsion:{centralGravity:{number:b},springLength:{number:b},springConstant:{number:b},nodeDistance:{number:b},damping:{number:b},__type__:{object:x}},hierarchicalRepulsion:{centralGravity:{number:b},springLength:{number:b},springConstant:{number:b},nodeDistance:{number:b},damping:{number:b},avoidOverlap:{number:b},__type__:{object:x}},maxVelocity:{number:b},minVelocity:{number:b},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:w},iterations:{number:b},updateInterval:{number:b},onlyDynamicEdges:{boolean:w},fit:{boolean:w},__type__:{object:x,boolean:w}},timestep:{number:b},adaptiveTimestep:{boolean:w},wind:{x:{number:b},y:{number:b},__type__:{object:x}},__type__:{object:x,boolean:w}},autoResize:{boolean:w},clickToUse:{boolean:w},locale:{string:T},locales:{__any__:{any:Hle},__type__:{object:x}},height:{string:T},width:{string:T},__type__:{object:x}},IS={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]}}},Vle=(i,e,t)=>{var r;return!!(Cr(i).call(i,"physics")&&Cr(r=IS.physics.solver).call(r,e)&&t.physics.solver!==e&&e!=="wind")};class Ule{constructor(){}getDistances(e,t,r){const n={},o=e.edges;for(let a=0;a<t.length;a++){const l=t[a],d={};n[l]=d;for(let h=0;h<t.length;h++)d[t[h]]=a==h?0:1e9}for(let a=0;a<r.length;a++){const l=o[r[a]];l.connected===!0&&n[l.fromId]!==void 0&&n[l.toId]!==void 0&&(n[l.fromId][l.toId]=1,n[l.toId][l.fromId]=1)}const s=t.length;for(let a=0;a<s;a++){const l=t[a],d=n[l];for(let h=0;h<s-1;h++){const c=t[h],u=n[c];for(let f=h+1;f<s;f++){const v=t[f],y=n[v],g=Math.min(u[v],u[l]+d[v]);u[v]=g,y[c]=g}}}return n}}class Kle{constructor(e,t,r){this.body=e,this.springLength=t,this.springConstant=r,this.distanceSolver=new Ule}setOptions(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}solve(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const n=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(n),this._createK_matrix(n),this._createE_matrix();const o=.01,s=1;let a=0;const l=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),d=5;let h=1e9,c=0,u=0,f=0,v=0,y=0;for(;h>o&&a<l;)for(a+=1,[c,h,u,f]=this._getHighestEnergyNode(r),v=h,y=0;v>s&&y<d;)y+=1,this._moveNode(c,u,f),[v,u,f]=this._getEnergy(c)}_getHighestEnergyNode(e){const t=this.body.nodeIndices,r=this.body.nodes;let n=0,o=t[0],s=0,a=0;for(let l=0;l<t.length;l++){const d=t[l];if(r[d].predefinedPosition!==!0||r[d].isCluster===!0&&e===!0||r[d].options.fixed.x!==!0||r[d].options.fixed.y!==!0){const[h,c,u]=this._getEnergy(d);n<h&&(n=h,o=d,s=c,a=u)}}return[o,n,s,a]}_getEnergy(e){const[t,r]=this.E_sums[e];return[Math.sqrt(t**2+r**2),t,r]}_moveNode(e,t,r){const n=this.body.nodeIndices,o=this.body.nodes;let s=0,a=0,l=0;const d=o[e].x,h=o[e].y,c=this.K_matrix[e],u=this.L_matrix[e];for(let E=0;E<n.length;E++){const P=n[E];if(P!==e){const D=o[P].x,L=o[P].y,W=c[P],se=u[P],le=1/((d-D)**2+(h-L)**2)**1.5;s+=W*(1-se*(h-L)**2*le),a+=W*(se*(d-D)*(h-L)*le),l+=W*(1-se*(d-D)**2*le)}}const f=s,v=a,y=t,g=l,p=r,m=(y/f+p/v)/(v/f-g/v),$=-(v*m+y)/f;o[e].x+=$,o[e].y+=m,this._updateE_matrix(e)}_createL_matrix(e){const t=this.body.nodeIndices,r=this.springLength;this.L_matrix=[];for(let n=0;n<t.length;n++){this.L_matrix[t[n]]={};for(let o=0;o<t.length;o++)this.L_matrix[t[n]][t[o]]=r*e[t[n]][t[o]]}}_createK_matrix(e){const t=this.body.nodeIndices,r=this.springConstant;this.K_matrix=[];for(let n=0;n<t.length;n++){this.K_matrix[t[n]]={};for(let o=0;o<t.length;o++)this.K_matrix[t[n]][t[o]]=r*e[t[n]][t[o]]**-2}}_createE_matrix(){const e=this.body.nodeIndices,t=this.body.nodes;this.E_matrix={},this.E_sums={};for(let r=0;r<e.length;r++)this.E_matrix[e[r]]=[];for(let r=0;r<e.length;r++){const n=e[r],o=t[n].x,s=t[n].y;let a=0,l=0;for(let d=r;d<e.length;d++){const h=e[d];if(h!==n){const c=t[h].x,u=t[h].y,f=1/Math.sqrt((o-c)**2+(s-u)**2);this.E_matrix[n][d]=[this.K_matrix[n][h]*(o-c-this.L_matrix[n][h]*(o-c)*f),this.K_matrix[n][h]*(s-u-this.L_matrix[n][h]*(s-u)*f)],this.E_matrix[h][r]=this.E_matrix[n][d],a+=this.E_matrix[n][d][0],l+=this.E_matrix[n][d][1]}}this.E_sums[n]=[a,l]}}_updateE_matrix(e){const t=this.body.nodeIndices,r=this.body.nodes,n=this.E_matrix[e],o=this.K_matrix[e],s=this.L_matrix[e],a=r[e].x,l=r[e].y;let d=0,h=0;for(let c=0;c<t.length;c++){const u=t[c];if(u!==e){const f=n[c],v=f[0],y=f[1],g=r[u].x,p=r[u].y,m=1/Math.sqrt((a-g)**2+(l-p)**2),$=o[u]*(a-g-s[u]*(a-g)*m),E=o[u]*(l-p-s[u]*(l-p)*m);n[c]=[$,E],d+=$,h+=E;const P=this.E_sums[u];P[0]+=$-v,P[1]+=E-y}}this.E_sums[e]=[d,h]}}function C(i,e,t){var r,n,o,s;if(!(this instanceof C))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:_ee,clickToUse:!1},Ee(this.options,this.defaultOptions),this.body={container:i,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:_(r=this.on).call(r,this),off:_(n=this.off).call(n,this),emit:_(o=this.emit).call(o,this),once:_(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 Tee(()=>this.body.emitter.emit("_requestRedraw")),this.groups=new wre,this.canvas=new kse(this.body),this.selectionHandler=new $ae(this.body,this.canvas),this.interactionHandler=new Bse(this.body,this.canvas,this.selectionHandler),this.view=new Nse(this.body,this.canvas),this.renderer=new Cse(this.body,this.canvas),this.physics=new Ese(this.body),this.layoutEngine=new jle(this.body),this.clustering=new Pse(this.body),this.manipulation=new zle(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new Koe(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new gse(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new Kle(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(t),this.setData(e)}K0(C.prototype);C.prototype.setOptions=function(i){if(i===null&&(i=void 0),i!==void 0){if(eee.validate(i,Wle)===!0&&console.error("%cErrors have been found in the supplied options object.",P_),zn(["locale","locales","clickToUse"],this.options,i),i.locale!==void 0&&(i.locale=See(i.locales||this.options.locales,i.locale)),i=this.layoutEngine.setOptions(i.layout,i),this.canvas.setOptions(i),this.groups.setOptions(i.groups),this.nodesHandler.setOptions(i.nodes),this.edgesHandler.setOptions(i.edges),this.physics.setOptions(i.physics),this.manipulation.setOptions(i.manipulation,i,this.options),this.interactionHandler.setOptions(i.interaction),this.renderer.setOptions(i.interaction),this.selectionHandler.setOptions(i.interaction),i.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in i&&(this.configurator||(this.configurator=new JQ(this,this.body.container,IS,this.canvas.pixelRatio,Vle)),this.configurator.setOptions(i.configure)),this.configurator&&this.configurator.options.enabled===!0){const r={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};Q(r.nodes,this.nodesHandler.options),Q(r.edges,this.edgesHandler.options),Q(r.layout,this.layoutEngine.options),Q(r.interaction,this.selectionHandler.options),Q(r.interaction,this.renderer.options),Q(r.interaction,this.interactionHandler.options),Q(r.manipulation,this.manipulation.options),Q(r.physics,this.physics.options),Q(r.global,this.canvas.options),Q(r.global,this.options),this.configurator.setModuleOptions(r)}i.clickToUse!==void 0?i.clickToUse===!0?this.activator===void 0&&(this.activator=new ZQ(this.canvas.frame),this.activator.on("change",()=>{this.body.emitter.emit("activate")})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}};C.prototype._updateVisibleIndices=function(){const i=this.body.nodes,e=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&!this.clustering._isClusteredNode(t)&&i[t].options.hidden===!1&&this.body.nodeIndices.push(i[t].id);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const r=e[t],n=i[r.fromId],o=i[r.toId],s=n!==void 0&&o!==void 0;!this.clustering._isClusteredEdge(t)&&r.options.hidden===!1&&s&&n.options.hidden===!1&&o.options.hidden===!1&&this.body.edgeIndices.push(r.id)}};C.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")})};C.prototype.setData=function(i){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),i&&i.dot&&(i.nodes||i.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(i&&i.options),i&&i.dot){console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");const e=hee(i.dot);this.setData(e);return}else if(i&&i.gephi){console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");const e=cee(i.gephi);this.setData(e);return}else this.nodesHandler.setData(i&&i.nodes,!0),this.edgesHandler.setData(i&&i.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")};C.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 i in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,i)&&delete this.body.nodes[i];for(const i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&delete this.body.edges[i];br(this.body.container)};C.prototype._updateValueRange=function(i){let e,t,r,n=0;for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)){const o=i[e].getValue();o!==void 0&&(t=t===void 0?o:Math.min(o,t),r=r===void 0?o:Math.max(o,r),n+=o)}if(t!==void 0&&r!==void 0)for(e in i)Object.prototype.hasOwnProperty.call(i,e)&&i[e].setValueRange(t,r,n)};C.prototype.isActive=function(){return!this.activator||this.activator.active};C.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)};C.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)};C.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)};C.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)};C.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)};C.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)};C.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)};C.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)};C.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)};C.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)};C.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)};C.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)};C.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)};C.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)};C.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)};C.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)};C.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)};C.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)};C.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)};C.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)};C.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)};C.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)};C.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)};C.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)};C.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)};C.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)};C.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)};C.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)};C.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)};C.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)};C.prototype.getConnectedNodes=function(i){return this.body.nodes[i]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)};C.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)};C.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)};C.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)};C.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)};C.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)};C.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)};C.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)};C.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)};C.prototype.getNodeAt=function(){const i=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return i!==void 0&&i.id!==void 0?i.id:i};C.prototype.getEdgeAt=function(){const i=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return i!==void 0&&i.id!==void 0?i.id:i};C.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)};C.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)};C.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()};C.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)};C.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)};C.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)};C.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)};C.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)};C.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)};C.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)};C.prototype.getOptionsFromConfigurator=function(){let i={};return this.configurator&&(i=this.configurator.getOptions.apply(this.configurator)),i};export{ja as D,C as N};