@abi-software/map-utilities 1.4.3-beta.2 → 1.4.3-isan.1
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.
- package/dist/map-utilities.js +8795 -8675
- package/dist/map-utilities.umd.cjs +22 -22
- package/dist/style.css +1 -1
- package/package.json +1 -6
- package/src/App.vue +100 -41
- package/src/components/Tooltip/AnnotationPopup.vue +122 -40
- package/src/components/Tooltip/ExternalResourceCard.vue +39 -69
- package/src/components/Tooltip/ProvenancePopup.vue +109 -149
- package/src/components/Tooltip/Tooltip.vue +2 -2
- package/src/components/utilities.js +0 -40
- package/src/components.d.ts +4 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
(function(Fe,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(Fe=typeof globalThis<"u"?globalThis:Fe||self,o(Fe.MapUtilities={},Fe.Vue))})(this,function(Fe,o){"use strict";var
|
|
1
|
+
(function(Fe,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(Fe=typeof globalThis<"u"?globalThis:Fe||self,o(Fe.MapUtilities={},Fe.Vue))})(this,function(Fe,o){"use strict";var aI=Object.defineProperty;var iI=(Fe,o,Ft)=>o in Fe?aI(Fe,o,{enumerable:!0,configurable:!0,writable:!0,value:Ft}):Fe[o]=Ft;var on=(Fe,o,Ft)=>iI(Fe,typeof o!="symbol"?o+"":o,Ft);const Ft=(t,e,{checkForDefaultPrevented:n=!0}={})=>a=>{const i=t==null?void 0:t(a);if(n===!1||!i)return e==null?void 0:e(a)};var Zc;const et=typeof window<"u",_g=t=>typeof t=="string",Xc=()=>{},Ps=et&&((Zc=window==null?void 0:window.navigator)==null?void 0:Zc.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Qc(t){return typeof t=="function"?t():o.unref(t)}function Pg(t){return t}function Xi(t){return o.getCurrentScope()?(o.onScopeDispose(t),!0):!1}function Ig(t,e=!0){o.getCurrentInstance()?o.onMounted(t):e?t():o.nextTick(t)}function _n(t){var e;const n=Qc(t);return(e=n==null?void 0:n.$el)!=null?e:n}const Qi=et?window:void 0;function Yt(...t){let e,n,r,a;if(_g(t[0])||Array.isArray(t[0])?([n,r,a]=t,e=Qi):[e,n,r,a]=t,!e)return Xc;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const i=[],s=()=>{i.forEach(d=>d()),i.length=0},l=(d,f,h,v)=>(d.addEventListener(f,h,v),()=>d.removeEventListener(f,h,v)),u=o.watch(()=>[_n(e),Qc(a)],([d,f])=>{s(),d&&i.push(...n.flatMap(h=>r.map(v=>l(d,h,v,f))))},{immediate:!0,flush:"post"}),c=()=>{u(),s()};return Xi(c),c}let Jc=!1;function Og(t,e,n={}){const{window:r=Qi,ignore:a=[],capture:i=!0,detectIframe:s=!1}=n;if(!r)return;Ps&&!Jc&&(Jc=!0,Array.from(r.document.body.children).forEach(h=>h.addEventListener("click",Xc)));let l=!0;const u=h=>a.some(v=>{if(typeof v=="string")return Array.from(r.document.querySelectorAll(v)).some(p=>p===h.target||h.composedPath().includes(p));{const p=_n(v);return p&&(h.target===p||h.composedPath().includes(p))}}),d=[Yt(r,"click",h=>{const v=_n(t);if(!(!v||v===h.target||h.composedPath().includes(v))){if(h.detail===0&&(l=!u(h)),!l){l=!0;return}e(h)}},{passive:!0,capture:i}),Yt(r,"pointerdown",h=>{const v=_n(t);v&&(l=!h.composedPath().includes(v)&&!u(h))},{passive:!0}),s&&Yt(r,"blur",h=>{var v;const p=_n(t);((v=r.document.activeElement)==null?void 0:v.tagName)==="IFRAME"&&!(p!=null&&p.contains(r.document.activeElement))&&e(h)})].filter(Boolean);return()=>d.forEach(h=>h())}function eu(t,e=!1){const n=o.ref(),r=()=>n.value=!!t();return r(),Ig(r,e),n}const tu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},nu="__vueuse_ssr_handlers__";tu[nu]=tu[nu]||{};var ru=Object.getOwnPropertySymbols,Lg=Object.prototype.hasOwnProperty,Mg=Object.prototype.propertyIsEnumerable,Fg=(t,e)=>{var n={};for(var r in t)Lg.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&ru)for(var r of ru(t))e.indexOf(r)<0&&Mg.call(t,r)&&(n[r]=t[r]);return n};function Pn(t,e,n={}){const r=n,{window:a=Qi}=r,i=Fg(r,["window"]);let s;const l=eu(()=>a&&"ResizeObserver"in a),u=()=>{s&&(s.disconnect(),s=void 0)},c=o.watch(()=>_n(t),f=>{u(),l.value&&a&&f&&(s=new ResizeObserver(e),s.observe(f,i))},{immediate:!0,flush:"post"}),d=()=>{u(),c()};return Xi(d),{isSupported:l,stop:d}}var au=Object.getOwnPropertySymbols,Ag=Object.prototype.hasOwnProperty,Vg=Object.prototype.propertyIsEnumerable,Rg=(t,e)=>{var n={};for(var r in t)Ag.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&au)for(var r of au(t))e.indexOf(r)<0&&Vg.call(t,r)&&(n[r]=t[r]);return n};function $g(t,e,n={}){const r=n,{window:a=Qi}=r,i=Rg(r,["window"]);let s;const l=eu(()=>a&&"MutationObserver"in a),u=()=>{s&&(s.disconnect(),s=void 0)},c=o.watch(()=>_n(t),f=>{u(),l.value&&a&&f&&(s=new MutationObserver(e),s.observe(f,i))},{immediate:!0}),d=()=>{u(),c()};return Xi(d),{isSupported:l,stop:d}}var iu;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(iu||(iu={}));var zg=Object.defineProperty,ou=Object.getOwnPropertySymbols,Hg=Object.prototype.hasOwnProperty,Kg=Object.prototype.propertyIsEnumerable,su=(t,e,n)=>e in t?zg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,qg=(t,e)=>{for(var n in e||(e={}))Hg.call(e,n)&&su(t,n,e[n]);if(ou)for(var n of ou(e))Kg.call(e,n)&&su(t,n,e[n]);return t};qg({linear:Pg},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const Ug=()=>et&&/firefox/i.test(window.navigator.userAgent),Is=t=>{let e,n;return t.type==="touchend"?(n=t.changedTouches[0].clientY,e=t.changedTouches[0].clientX):t.type.startsWith("touch")?(n=t.touches[0].clientY,e=t.touches[0].clientX):(n=t.clientY,e=t.clientX),{clientX:e,clientY:n}};/**
|
|
2
2
|
* @vue/shared v3.4.27
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
|
-
**/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const Ha=()=>{},Gg=Object.prototype.hasOwnProperty,wr=(t,e)=>Gg.call(t,e),At=Array.isArray,Lt=t=>typeof t=="function",St=t=>typeof t=="string",gt=t=>t!==null&&typeof t=="object",Wg=Object.prototype.toString,jg=t=>Wg.call(t),Is=t=>jg(t).slice(8,-1),lu=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},Yg=/-(\w)/g,Zg=lu(t=>t.replace(Yg,(e,n)=>n?n.toUpperCase():"")),Xg=/\B([A-Z])/g,Qg=lu(t=>t.replace(Xg,"-$1").toLowerCase());var cu=typeof global=="object"&&global&&global.Object===Object&&global,Jg=typeof self=="object"&&self&&self.Object===Object&&self,yn=cu||Jg||Function("return this")(),bn=yn.Symbol,uu=Object.prototype,em=uu.hasOwnProperty,tm=uu.toString,Ka=bn?bn.toStringTag:void 0;function nm(t){var e=em.call(t,Ka),n=t[Ka];try{t[Ka]=void 0;var r=!0}catch{}var a=tm.call(t);return r&&(e?t[Ka]=n:delete t[Ka]),a}var rm=Object.prototype,am=rm.toString;function im(t){return am.call(t)}var om="[object Null]",sm="[object Undefined]",du=bn?bn.toStringTag:void 0;function Xr(t){return t==null?t===void 0?sm:om:du&&du in Object(t)?nm(t):im(t)}function Qr(t){return t!=null&&typeof t=="object"}var lm="[object Symbol]";function Ji(t){return typeof t=="symbol"||Qr(t)&&Xr(t)==lm}function cm(t,e){for(var n=-1,r=t==null?0:t.length,a=Array(r);++n<r;)a[n]=e(t[n],n,t);return a}var sn=Array.isArray,um=1/0,fu=bn?bn.prototype:void 0,hu=fu?fu.toString:void 0;function pu(t){if(typeof t=="string")return t;if(sn(t))return cm(t,pu)+"";if(Ji(t))return hu?hu.call(t):"";var e=t+"";return e=="0"&&1/t==-um?"-0":e}var dm=/\s/;function fm(t){for(var e=t.length;e--&&dm.test(t.charAt(e)););return e}var hm=/^\s+/;function pm(t){return t&&t.slice(0,fm(t)+1).replace(hm,"")}function Gn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var vu=NaN,vm=/^[-+]0x[0-9a-f]+$/i,gm=/^0b[01]+$/i,mm=/^0o[0-7]+$/i,ym=parseInt;function gu(t){if(typeof t=="number")return t;if(Ji(t))return vu;if(Gn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Gn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=pm(t);var n=gm.test(t);return n||mm.test(t)?ym(t.slice(2),n?2:8):vm.test(t)?vu:+t}function mu(t){return t}var bm="[object AsyncFunction]",wm="[object Function]",Cm="[object GeneratorFunction]",km="[object Proxy]";function yu(t){if(!Gn(t))return!1;var e=Xr(t);return e==wm||e==Cm||e==bm||e==km}var Ls=yn["__core-js_shared__"],bu=function(){var t=/[^.]+$/.exec(Ls&&Ls.keys&&Ls.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function xm(t){return!!bu&&bu in t}var Em=Function.prototype,Sm=Em.toString;function Cr(t){if(t!=null){try{return Sm.call(t)}catch{}try{return t+""}catch{}}return""}var Tm=/[\\^$.*+?()[\]{}|]/g,Bm=/^\[object .+?Constructor\]$/,Nm=Function.prototype,Dm=Object.prototype,_m=Nm.toString,Pm=Dm.hasOwnProperty,Om=RegExp("^"+_m.call(Pm).replace(Tm,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Im(t){if(!Gn(t)||xm(t))return!1;var e=yu(t)?Om:Bm;return e.test(Cr(t))}function Lm(t,e){return t==null?void 0:t[e]}function kr(t,e){var n=Lm(t,e);return Im(n)?n:void 0}var Ms=kr(yn,"WeakMap");function Mm(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var Fm=800,Am=16,Vm=Date.now;function Rm(t){var e=0,n=0;return function(){var r=Vm(),a=Am-(r-n);if(n=r,a>0){if(++e>=Fm)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function $m(t){return function(){return t}}var eo=function(){try{var t=kr(Object,"defineProperty");return t({},"",{}),t}catch{}}(),zm=eo?function(t,e){return eo(t,"toString",{configurable:!0,enumerable:!1,value:$m(e),writable:!0})}:mu,Hm=Rm(zm);function Km(t,e,n,r){t.length;for(var a=n+1;a--;)if(e(t[a],a,t))return a;return-1}var qm=9007199254740991,Um=/^(?:0|[1-9]\d*)$/;function Fs(t,e){var n=typeof t;return e=e??qm,!!e&&(n=="number"||n!="symbol"&&Um.test(t))&&t>-1&&t%1==0&&t<e}function Gm(t,e,n){e=="__proto__"&&eo?eo(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function As(t,e){return t===e||t!==t&&e!==e}var Wm=Object.prototype,jm=Wm.hasOwnProperty;function Ym(t,e,n){var r=t[e];(!(jm.call(t,e)&&As(r,n))||n===void 0&&!(e in t))&&Gm(t,e,n)}var wu=Math.max;function Zm(t,e,n){return e=wu(e===void 0?t.length-1:e,0),function(){for(var r=arguments,a=-1,i=wu(r.length-e,0),s=Array(i);++a<i;)s[a]=r[e+a];a=-1;for(var l=Array(e+1);++a<e;)l[a]=r[a];return l[e]=n(s),Mm(t,this,l)}}var Xm=9007199254740991;function Vs(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Xm}function Qm(t){return t!=null&&Vs(t.length)&&!yu(t)}var Jm=Object.prototype;function e0(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Jm;return t===n}function t0(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var n0="[object Arguments]";function Cu(t){return Qr(t)&&Xr(t)==n0}var ku=Object.prototype,r0=ku.hasOwnProperty,a0=ku.propertyIsEnumerable,Rs=Cu(function(){return arguments}())?Cu:function(t){return Qr(t)&&r0.call(t,"callee")&&!a0.call(t,"callee")};function i0(){return!1}var xu=typeof Fe=="object"&&Fe&&!Fe.nodeType&&Fe,Eu=xu&&typeof module=="object"&&module&&!module.nodeType&&module,o0=Eu&&Eu.exports===xu,Su=o0?yn.Buffer:void 0,s0=Su?Su.isBuffer:void 0,$s=s0||i0,l0="[object Arguments]",c0="[object Array]",u0="[object Boolean]",d0="[object Date]",f0="[object Error]",h0="[object Function]",p0="[object Map]",v0="[object Number]",g0="[object Object]",m0="[object RegExp]",y0="[object Set]",b0="[object String]",w0="[object WeakMap]",C0="[object ArrayBuffer]",k0="[object DataView]",x0="[object Float32Array]",E0="[object Float64Array]",S0="[object Int8Array]",T0="[object Int16Array]",B0="[object Int32Array]",N0="[object Uint8Array]",D0="[object Uint8ClampedArray]",_0="[object Uint16Array]",P0="[object Uint32Array]",We={};We[x0]=We[E0]=We[S0]=We[T0]=We[B0]=We[N0]=We[D0]=We[_0]=We[P0]=!0,We[l0]=We[c0]=We[C0]=We[u0]=We[k0]=We[d0]=We[f0]=We[h0]=We[p0]=We[v0]=We[g0]=We[m0]=We[y0]=We[b0]=We[w0]=!1;function O0(t){return Qr(t)&&Vs(t.length)&&!!We[Xr(t)]}function I0(t){return function(e){return t(e)}}var Tu=typeof Fe=="object"&&Fe&&!Fe.nodeType&&Fe,qa=Tu&&typeof module=="object"&&module&&!module.nodeType&&module,L0=qa&&qa.exports===Tu,zs=L0&&cu.process,Bu=function(){try{var t=qa&&qa.require&&qa.require("util").types;return t||zs&&zs.binding&&zs.binding("util")}catch{}}(),Nu=Bu&&Bu.isTypedArray,Du=Nu?I0(Nu):O0,M0=Object.prototype,F0=M0.hasOwnProperty;function A0(t,e){var n=sn(t),r=!n&&Rs(t),a=!n&&!r&&$s(t),i=!n&&!r&&!a&&Du(t),s=n||r||a||i,l=s?t0(t.length,String):[],u=l.length;for(var c in t)F0.call(t,c)&&!(s&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Fs(c,u)))&&l.push(c);return l}function V0(t,e){return function(n){return t(e(n))}}var R0=V0(Object.keys,Object),$0=Object.prototype,z0=$0.hasOwnProperty;function H0(t){if(!e0(t))return R0(t);var e=[];for(var n in Object(t))z0.call(t,n)&&n!="constructor"&&e.push(n);return e}function _u(t){return Qm(t)?A0(t):H0(t)}var K0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q0=/^\w*$/;function Hs(t,e){if(sn(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Ji(t)?!0:q0.test(t)||!K0.test(t)||e!=null&&t in Object(e)}var Ua=kr(Object,"create");function U0(){this.__data__=Ua?Ua(null):{},this.size=0}function G0(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var W0="__lodash_hash_undefined__",j0=Object.prototype,Y0=j0.hasOwnProperty;function Z0(t){var e=this.__data__;if(Ua){var n=e[t];return n===W0?void 0:n}return Y0.call(e,t)?e[t]:void 0}var X0=Object.prototype,Q0=X0.hasOwnProperty;function J0(t){var e=this.__data__;return Ua?e[t]!==void 0:Q0.call(e,t)}var ey="__lodash_hash_undefined__";function ty(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ua&&e===void 0?ey:e,this}function xr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}xr.prototype.clear=U0,xr.prototype.delete=G0,xr.prototype.get=Z0,xr.prototype.has=J0,xr.prototype.set=ty;function ny(){this.__data__=[],this.size=0}function to(t,e){for(var n=t.length;n--;)if(As(t[n][0],e))return n;return-1}var ry=Array.prototype,ay=ry.splice;function iy(t){var e=this.__data__,n=to(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():ay.call(e,n,1),--this.size,!0}function oy(t){var e=this.__data__,n=to(e,t);return n<0?void 0:e[n][1]}function sy(t){return to(this.__data__,t)>-1}function ly(t,e){var n=this.__data__,r=to(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function On(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}On.prototype.clear=ny,On.prototype.delete=iy,On.prototype.get=oy,On.prototype.has=sy,On.prototype.set=ly;var Ga=kr(yn,"Map");function cy(){this.size=0,this.__data__={hash:new xr,map:new(Ga||On),string:new xr}}function uy(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function no(t,e){var n=t.__data__;return uy(e)?n[typeof e=="string"?"string":"hash"]:n.map}function dy(t){var e=no(this,t).delete(t);return this.size-=e?1:0,e}function fy(t){return no(this,t).get(t)}function hy(t){return no(this,t).has(t)}function py(t,e){var n=no(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function In(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}In.prototype.clear=cy,In.prototype.delete=dy,In.prototype.get=fy,In.prototype.has=hy,In.prototype.set=py;var vy="Expected a function";function Ks(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(vy);var n=function(){var r=arguments,a=e?e.apply(this,r):r[0],i=n.cache;if(i.has(a))return i.get(a);var s=t.apply(this,r);return n.cache=i.set(a,s)||i,s};return n.cache=new(Ks.Cache||In),n}Ks.Cache=In;var gy=500;function my(t){var e=Ks(t,function(r){return n.size===gy&&n.clear(),r}),n=e.cache;return e}var yy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,by=/\\(\\)?/g,wy=my(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(yy,function(n,r,a,i){e.push(a?i.replace(by,"$1"):r||n)}),e});function Cy(t){return t==null?"":pu(t)}function ro(t,e){return sn(t)?t:Hs(t,e)?[t]:wy(Cy(t))}var ky=1/0;function Wa(t){if(typeof t=="string"||Ji(t))return t;var e=t+"";return e=="0"&&1/t==-ky?"-0":e}function qs(t,e){e=ro(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Wa(e[n++])];return n&&n==r?t:void 0}function Ln(t,e,n){var r=t==null?void 0:qs(t,e);return r===void 0?n:r}function Pu(t,e){for(var n=-1,r=e.length,a=t.length;++n<r;)t[a+n]=e[n];return t}var Ou=bn?bn.isConcatSpreadable:void 0;function xy(t){return sn(t)||Rs(t)||!!(Ou&&t&&t[Ou])}function Ey(t,e,n,r,a){var i=-1,s=t.length;for(n||(n=xy),a||(a=[]);++i<s;){var l=t[i];n(l)?Pu(a,l):a[a.length]=l}return a}function Sy(t){var e=t==null?0:t.length;return e?Ey(t):[]}function Ty(t){return Hm(Zm(t,void 0,Sy),t+"")}function Wn(){if(!arguments.length)return[];var t=arguments[0];return sn(t)?t:[t]}function By(){this.__data__=new On,this.size=0}function Ny(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Dy(t){return this.__data__.get(t)}function _y(t){return this.__data__.has(t)}var Py=200;function Oy(t,e){var n=this.__data__;if(n instanceof On){var r=n.__data__;if(!Ga||r.length<Py-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new In(r)}return n.set(t,e),this.size=n.size,this}function Mn(t){var e=this.__data__=new On(t);this.size=e.size}Mn.prototype.clear=By,Mn.prototype.delete=Ny,Mn.prototype.get=Dy,Mn.prototype.has=_y,Mn.prototype.set=Oy;function Iy(t,e){for(var n=-1,r=t==null?0:t.length,a=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[a++]=s)}return i}function Ly(){return[]}var My=Object.prototype,Fy=My.propertyIsEnumerable,Iu=Object.getOwnPropertySymbols,Ay=Iu?function(t){return t==null?[]:(t=Object(t),Iy(Iu(t),function(e){return Fy.call(t,e)}))}:Ly;function Vy(t,e,n){var r=e(t);return sn(t)?r:Pu(r,n(t))}function Lu(t){return Vy(t,_u,Ay)}var Us=kr(yn,"DataView"),Gs=kr(yn,"Promise"),Ws=kr(yn,"Set"),Mu="[object Map]",Ry="[object Object]",Fu="[object Promise]",Au="[object Set]",Vu="[object WeakMap]",Ru="[object DataView]",$y=Cr(Us),zy=Cr(Ga),Hy=Cr(Gs),Ky=Cr(Ws),qy=Cr(Ms),jn=Xr;(Us&&jn(new Us(new ArrayBuffer(1)))!=Ru||Ga&&jn(new Ga)!=Mu||Gs&&jn(Gs.resolve())!=Fu||Ws&&jn(new Ws)!=Au||Ms&&jn(new Ms)!=Vu)&&(jn=function(t){var e=Xr(t),n=e==Ry?t.constructor:void 0,r=n?Cr(n):"";if(r)switch(r){case $y:return Ru;case zy:return Mu;case Hy:return Fu;case Ky:return Au;case qy:return Vu}return e});var $u=yn.Uint8Array,Uy="__lodash_hash_undefined__";function Gy(t){return this.__data__.set(t,Uy),this}function Wy(t){return this.__data__.has(t)}function ao(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new In;++e<n;)this.add(t[e])}ao.prototype.add=ao.prototype.push=Gy,ao.prototype.has=Wy;function jy(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function Yy(t,e){return t.has(e)}var Zy=1,Xy=2;function zu(t,e,n,r,a,i){var s=n&Zy,l=t.length,u=e.length;if(l!=u&&!(s&&u>l))return!1;var c=i.get(t),d=i.get(e);if(c&&d)return c==e&&d==t;var f=-1,h=!0,v=n&Xy?new ao:void 0;for(i.set(t,e),i.set(e,t);++f<l;){var p=t[f],g=e[f];if(r)var y=s?r(g,p,f,e,t,i):r(p,g,f,t,e,i);if(y!==void 0){if(y)continue;h=!1;break}if(v){if(!jy(e,function(m,b){if(!Yy(v,b)&&(p===m||a(p,m,n,r,i)))return v.push(b)})){h=!1;break}}else if(!(p===g||a(p,g,n,r,i))){h=!1;break}}return i.delete(t),i.delete(e),h}function Qy(t){var e=-1,n=Array(t.size);return t.forEach(function(r,a){n[++e]=[a,r]}),n}function Jy(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var e1=1,t1=2,n1="[object Boolean]",r1="[object Date]",a1="[object Error]",i1="[object Map]",o1="[object Number]",s1="[object RegExp]",l1="[object Set]",c1="[object String]",u1="[object Symbol]",d1="[object ArrayBuffer]",f1="[object DataView]",Hu=bn?bn.prototype:void 0,js=Hu?Hu.valueOf:void 0;function h1(t,e,n,r,a,i,s){switch(n){case f1:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case d1:return!(t.byteLength!=e.byteLength||!i(new $u(t),new $u(e)));case n1:case r1:case o1:return As(+t,+e);case a1:return t.name==e.name&&t.message==e.message;case s1:case c1:return t==e+"";case i1:var l=Qy;case l1:var u=r&e1;if(l||(l=Jy),t.size!=e.size&&!u)return!1;var c=s.get(t);if(c)return c==e;r|=t1,s.set(t,e);var d=zu(l(t),l(e),r,a,i,s);return s.delete(t),d;case u1:if(js)return js.call(t)==js.call(e)}return!1}var p1=1,v1=Object.prototype,g1=v1.hasOwnProperty;function m1(t,e,n,r,a,i){var s=n&p1,l=Lu(t),u=l.length,c=Lu(e),d=c.length;if(u!=d&&!s)return!1;for(var f=u;f--;){var h=l[f];if(!(s?h in e:g1.call(e,h)))return!1}var v=i.get(t),p=i.get(e);if(v&&p)return v==e&&p==t;var g=!0;i.set(t,e),i.set(e,t);for(var y=s;++f<u;){h=l[f];var m=t[h],b=e[h];if(r)var w=s?r(b,m,h,e,t,i):r(m,b,h,t,e,i);if(!(w===void 0?m===b||a(m,b,n,r,i):w)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var C=t.constructor,k=e.constructor;C!=k&&"constructor"in t&&"constructor"in e&&!(typeof C=="function"&&C instanceof C&&typeof k=="function"&&k instanceof k)&&(g=!1)}return i.delete(t),i.delete(e),g}var y1=1,Ku="[object Arguments]",qu="[object Array]",io="[object Object]",b1=Object.prototype,Uu=b1.hasOwnProperty;function w1(t,e,n,r,a,i){var s=sn(t),l=sn(e),u=s?qu:jn(t),c=l?qu:jn(e);u=u==Ku?io:u,c=c==Ku?io:c;var d=u==io,f=c==io,h=u==c;if(h&&$s(t)){if(!$s(e))return!1;s=!0,d=!1}if(h&&!d)return i||(i=new Mn),s||Du(t)?zu(t,e,n,r,a,i):h1(t,e,u,n,r,a,i);if(!(n&y1)){var v=d&&Uu.call(t,"__wrapped__"),p=f&&Uu.call(e,"__wrapped__");if(v||p){var g=v?t.value():t,y=p?e.value():e;return i||(i=new Mn),a(g,y,n,r,i)}}return h?(i||(i=new Mn),m1(t,e,n,r,a,i)):!1}function oo(t,e,n,r,a){return t===e?!0:t==null||e==null||!Qr(t)&&!Qr(e)?t!==t&&e!==e:w1(t,e,n,r,oo,a)}var C1=1,k1=2;function x1(t,e,n,r){var a=n.length,i=a;if(t==null)return!i;for(t=Object(t);a--;){var s=n[a];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++a<i;){s=n[a];var l=s[0],u=t[l],c=s[1];if(s[2]){if(u===void 0&&!(l in t))return!1}else{var d=new Mn,f;if(!(f===void 0?oo(c,u,C1|k1,r,d):f))return!1}}return!0}function Gu(t){return t===t&&!Gn(t)}function E1(t){for(var e=_u(t),n=e.length;n--;){var r=e[n],a=t[r];e[n]=[r,a,Gu(a)]}return e}function Wu(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function S1(t){var e=E1(t);return e.length==1&&e[0][2]?Wu(e[0][0],e[0][1]):function(n){return n===t||x1(n,t,e)}}function T1(t,e){return t!=null&&e in Object(t)}function B1(t,e,n){e=ro(e,t);for(var r=-1,a=e.length,i=!1;++r<a;){var s=Wa(e[r]);if(!(i=t!=null&&n(t,s)))break;t=t[s]}return i||++r!=a?i:(a=t==null?0:t.length,!!a&&Vs(a)&&Fs(s,a)&&(sn(t)||Rs(t)))}function ju(t,e){return t!=null&&B1(t,e,T1)}var N1=1,D1=2;function _1(t,e){return Hs(t)&&Gu(e)?Wu(Wa(t),e):function(n){var r=Ln(n,t);return r===void 0&&r===e?ju(n,t):oo(e,r,N1|D1)}}function P1(t){return function(e){return e==null?void 0:e[t]}}function O1(t){return function(e){return qs(e,t)}}function I1(t){return Hs(t)?P1(Wa(t)):O1(t)}function L1(t){return typeof t=="function"?t:t==null?mu:typeof t=="object"?sn(t)?_1(t[0],t[1]):S1(t):I1(t)}var Ys=function(){return yn.Date.now()},M1="Expected a function",F1=Math.max,A1=Math.min;function Yu(t,e,n){var r,a,i,s,l,u,c=0,d=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(M1);e=gu(e)||0,Gn(n)&&(d=!!n.leading,f="maxWait"in n,i=f?F1(gu(n.maxWait)||0,e):i,h="trailing"in n?!!n.trailing:h);function v(E){var x=r,B=a;return r=a=void 0,c=E,s=t.apply(B,x),s}function p(E){return c=E,l=setTimeout(m,e),d?v(E):s}function g(E){var x=E-u,B=E-c,S=e-x;return f?A1(S,i-B):S}function y(E){var x=E-u,B=E-c;return u===void 0||x>=e||x<0||f&&B>=i}function m(){var E=Ys();if(y(E))return b(E);l=setTimeout(m,g(E))}function b(E){return l=void 0,h&&r?v(E):(r=a=void 0,s)}function w(){l!==void 0&&clearTimeout(l),c=0,r=u=a=l=void 0}function C(){return l===void 0?s:b(Ys())}function k(){var E=Ys(),x=y(E);if(r=arguments,a=this,u=E,x){if(l===void 0)return p(u);if(f)return clearTimeout(l),l=setTimeout(m,e),v(u)}return l===void 0&&(l=setTimeout(m,e)),s}return k.cancel=w,k.flush=C,k}function V1(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var a=r-1;return Km(t,L1(e),a)}function so(t){for(var e=-1,n=t==null?0:t.length,r={};++e<n;){var a=t[e];r[a[0]]=a[1]}return r}function lo(t,e){return oo(t,e)}function Yn(t){return t==null}function R1(t){return t===void 0}function $1(t,e,n,r){if(!Gn(t))return t;e=ro(e,t);for(var a=-1,i=e.length,s=i-1,l=t;l!=null&&++a<i;){var u=Wa(e[a]),c=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(a!=s){var d=l[u];c=void 0,c===void 0&&(c=Gn(d)?d:Fs(e[a+1])?[]:{})}Ym(l,u,c),l=l[u]}return t}function z1(t,e,n){for(var r=-1,a=e.length,i={};++r<a;){var s=e[r],l=qs(t,s);n(l,s)&&$1(i,ro(s,t),l)}return i}function H1(t,e){return z1(t,e,function(n,r){return ju(t,r)})}var Zu=Ty(function(t,e){return t==null?{}:H1(t,e)});const Zn=t=>t===void 0,Jr=t=>typeof t=="boolean",mt=t=>typeof t=="number",Er=t=>typeof Element>"u"?!1:t instanceof Element,co=t=>Yn(t),K1=t=>St(t)?!Number.isNaN(Number(t)):!1,q1=(t="")=>t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),Xu=t=>Object.keys(t);class Qu extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function U1(t,e){throw new Qu(`[${t}] ${e}`)}function tt(t,e){if(process.env.NODE_ENV!=="production"){const n=St(t)?new Qu(`[${t}] ${e}`):t;console.warn(n)}}const G1="utils/dom/style",Ju=(t="")=>t.split(" ").filter(e=>!!e.trim()),Zs=(t,e)=>{!t||!e.trim()||t.classList.add(...Ju(e))},Sr=(t,e)=>{!t||!e.trim()||t.classList.remove(...Ju(e))},ja=(t,e)=>{var n;if(!et||!t||!e)return"";let r=Zg(e);r==="float"&&(r="cssFloat");try{const a=t.style[r];if(a)return a;const i=(n=document.defaultView)==null?void 0:n.getComputedStyle(t,"");return i?i[r]:""}catch{return t.style[r]}};function ea(t,e="px"){if(!t)return"";if(mt(t)||K1(t))return`${t}${e}`;if(St(t))return t;tt(G1,"binding value must be a string or number")}function W1(t,e){if(!et)return;if(!e){t.scrollTop=0;return}const n=[];let r=e.offsetParent;for(;r!==null&&t!==r&&t.contains(r);)n.push(r),r=r.offsetParent;const a=e.offsetTop+n.reduce((u,c)=>u+c.offsetTop,0),i=a+e.offsetHeight,s=t.scrollTop,l=s+t.clientHeight;a<s?t.scrollTop=a:i>l&&(t.scrollTop=i-t.clientHeight)}/*! Element Plus Icons Vue v2.3.1 */var j1=o.defineComponent({name:"Aim",__name:"aim",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32m0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32M96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32m576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32"})]))}}),Y1=j1,Z1=o.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),Ya=Z1,X1=o.defineComponent({name:"ArrowUp",__name:"arrow-up",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),Xs=X1,Q1=o.defineComponent({name:"CaretRight",__name:"caret-right",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M384 192v640l384-320.064z"})]))}}),J1=Q1,eb=o.defineComponent({name:"CircleCheck",__name:"circle-check",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),o.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),tb=eb,nb=o.defineComponent({name:"CircleClose",__name:"circle-close",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),Qs=nb,rb=o.defineComponent({name:"Close",__name:"close",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),uo=rb,ab=o.defineComponent({name:"CopyDocument",__name:"copy-document",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z"}),o.createElementVNode("path",{fill:"currentColor",d:"M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64"})]))}}),ib=ab,ob=o.defineComponent({name:"Delete",__name:"delete",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),sb=ob,lb=o.defineComponent({name:"Edit",__name:"edit",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),o.createElementVNode("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),cb=lb,ub=o.defineComponent({name:"Finished",__name:"finished",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M280.768 753.728 691.456 167.04a32 32 0 1 1 52.416 36.672L314.24 817.472a32 32 0 0 1-45.44 7.296l-230.4-172.8a32 32 0 0 1 38.4-51.2l203.968 152.96zM736 448a32 32 0 1 1 0-64h192a32 32 0 1 1 0 64zM608 640a32 32 0 0 1 0-64h319.936a32 32 0 1 1 0 64zM480 832a32 32 0 1 1 0-64h447.936a32 32 0 1 1 0 64z"})]))}}),db=ub,fb=o.defineComponent({name:"Hide",__name:"hide",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),o.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),hb=fb,pb=o.defineComponent({name:"Loading",__name:"loading",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),Js=pb,vb=o.defineComponent({name:"Lock",__name:"lock",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"})]))}}),gb=vb,mb=o.defineComponent({name:"Unlock",__name:"unlock",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z"})]))}}),yb=mb,bb=o.defineComponent({name:"View",__name:"view",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),wb=bb,Cb=o.defineComponent({name:"Warning",__name:"warning",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"})]))}}),fo=Cb,kb=o.defineComponent({name:"ZoomIn",__name:"zoom-in",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})]))}}),xb=kb,Eb=o.defineComponent({name:"ZoomOut",__name:"zoom-out",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"})]))}}),Sb=Eb;const ed="__epPropKey",ke=t=>t,Tb=t=>gt(t)&&!!t[ed],ho=(t,e)=>{if(!gt(t)||Tb(t))return t;const{values:n,required:r,default:a,type:i,validator:s}=t,u={type:i,required:!!r,validator:n||s?c=>{let d=!1,f=[];if(n&&(f=Array.from(n),wr(t,"default")&&f.push(a),d||(d=f.includes(c))),s&&(d||(d=s(c))),!d&&f.length>0){const h=[...new Set(f)].map(v=>JSON.stringify(v)).join(", ");o.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${h}], got value ${JSON.stringify(c)}.`)}return d}:void 0,[ed]:!0};return wr(t,"default")&&(u.default=a),u},Ae=t=>so(Object.entries(t).map(([e,n])=>[e,ho(n,e)])),Xn=ke([String,Object,Function]),td={validating:Js,success:tb,error:Qs},ft=(t,e)=>{if(t.install=n=>{for(const r of[t,...Object.values(e??{})])n.component(r.name,r)},e)for(const[n,r]of Object.entries(e))t[n]=r;return t},Bb=(t,e)=>(t.install=n=>{n.directive(e,t)},t),Fn=t=>(t.install=Ha,t),it={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},yt="update:modelValue",el="change",nd=["","default","small","large"],Nb=t=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t),ta=t=>t,Db=["class","style"],_b=/^on[A-Z]/,Pb=(t={})=>{const{excludeListeners:e=!1,excludeKeys:n}=t,r=o.computed(()=>((n==null?void 0:n.value)||[]).concat(Db)),a=o.getCurrentInstance();return a?o.computed(()=>{var i;return so(Object.entries((i=a.proxy)==null?void 0:i.$attrs).filter(([s])=>!r.value.includes(s)&&!(e&&_b.test(s))))}):(tt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),o.computed(()=>({})))},po=({from:t,replacement:e,scope:n,version:r,ref:a,type:i="API"},s)=>{o.watch(()=>o.unref(s),l=>{l&&tt(n,`[${i}] ${t} is about to be deprecated in version ${r}, please use ${e} instead.
|
|
5
|
+
**/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const Ka=()=>{},Gg=Object.prototype.hasOwnProperty,wr=(t,e)=>Gg.call(t,e),At=Array.isArray,Lt=t=>typeof t=="function",St=t=>typeof t=="string",gt=t=>t!==null&&typeof t=="object",Wg=Object.prototype.toString,jg=t=>Wg.call(t),Os=t=>jg(t).slice(8,-1),lu=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},Yg=/-(\w)/g,Zg=lu(t=>t.replace(Yg,(e,n)=>n?n.toUpperCase():"")),Xg=/\B([A-Z])/g,Qg=lu(t=>t.replace(Xg,"-$1").toLowerCase());var cu=typeof global=="object"&&global&&global.Object===Object&&global,Jg=typeof self=="object"&&self&&self.Object===Object&&self,yn=cu||Jg||Function("return this")(),bn=yn.Symbol,uu=Object.prototype,em=uu.hasOwnProperty,tm=uu.toString,qa=bn?bn.toStringTag:void 0;function nm(t){var e=em.call(t,qa),n=t[qa];try{t[qa]=void 0;var r=!0}catch{}var a=tm.call(t);return r&&(e?t[qa]=n:delete t[qa]),a}var rm=Object.prototype,am=rm.toString;function im(t){return am.call(t)}var om="[object Null]",sm="[object Undefined]",du=bn?bn.toStringTag:void 0;function Xr(t){return t==null?t===void 0?sm:om:du&&du in Object(t)?nm(t):im(t)}function Qr(t){return t!=null&&typeof t=="object"}var lm="[object Symbol]";function Ji(t){return typeof t=="symbol"||Qr(t)&&Xr(t)==lm}function cm(t,e){for(var n=-1,r=t==null?0:t.length,a=Array(r);++n<r;)a[n]=e(t[n],n,t);return a}var sn=Array.isArray,um=1/0,fu=bn?bn.prototype:void 0,hu=fu?fu.toString:void 0;function pu(t){if(typeof t=="string")return t;if(sn(t))return cm(t,pu)+"";if(Ji(t))return hu?hu.call(t):"";var e=t+"";return e=="0"&&1/t==-um?"-0":e}var dm=/\s/;function fm(t){for(var e=t.length;e--&&dm.test(t.charAt(e)););return e}var hm=/^\s+/;function pm(t){return t&&t.slice(0,fm(t)+1).replace(hm,"")}function Gn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var vu=NaN,vm=/^[-+]0x[0-9a-f]+$/i,gm=/^0b[01]+$/i,mm=/^0o[0-7]+$/i,ym=parseInt;function gu(t){if(typeof t=="number")return t;if(Ji(t))return vu;if(Gn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Gn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=pm(t);var n=gm.test(t);return n||mm.test(t)?ym(t.slice(2),n?2:8):vm.test(t)?vu:+t}function mu(t){return t}var bm="[object AsyncFunction]",wm="[object Function]",Cm="[object GeneratorFunction]",km="[object Proxy]";function yu(t){if(!Gn(t))return!1;var e=Xr(t);return e==wm||e==Cm||e==bm||e==km}var Ls=yn["__core-js_shared__"],bu=function(){var t=/[^.]+$/.exec(Ls&&Ls.keys&&Ls.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function xm(t){return!!bu&&bu in t}var Em=Function.prototype,Sm=Em.toString;function Cr(t){if(t!=null){try{return Sm.call(t)}catch{}try{return t+""}catch{}}return""}var Tm=/[\\^$.*+?()[\]{}|]/g,Bm=/^\[object .+?Constructor\]$/,Nm=Function.prototype,Dm=Object.prototype,_m=Nm.toString,Pm=Dm.hasOwnProperty,Im=RegExp("^"+_m.call(Pm).replace(Tm,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Om(t){if(!Gn(t)||xm(t))return!1;var e=yu(t)?Im:Bm;return e.test(Cr(t))}function Lm(t,e){return t==null?void 0:t[e]}function kr(t,e){var n=Lm(t,e);return Om(n)?n:void 0}var Ms=kr(yn,"WeakMap");function Mm(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var Fm=800,Am=16,Vm=Date.now;function Rm(t){var e=0,n=0;return function(){var r=Vm(),a=Am-(r-n);if(n=r,a>0){if(++e>=Fm)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function $m(t){return function(){return t}}var eo=function(){try{var t=kr(Object,"defineProperty");return t({},"",{}),t}catch{}}(),zm=eo?function(t,e){return eo(t,"toString",{configurable:!0,enumerable:!1,value:$m(e),writable:!0})}:mu,Hm=Rm(zm);function Km(t,e,n,r){t.length;for(var a=n+1;a--;)if(e(t[a],a,t))return a;return-1}var qm=9007199254740991,Um=/^(?:0|[1-9]\d*)$/;function Fs(t,e){var n=typeof t;return e=e??qm,!!e&&(n=="number"||n!="symbol"&&Um.test(t))&&t>-1&&t%1==0&&t<e}function Gm(t,e,n){e=="__proto__"&&eo?eo(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function As(t,e){return t===e||t!==t&&e!==e}var Wm=Object.prototype,jm=Wm.hasOwnProperty;function Ym(t,e,n){var r=t[e];(!(jm.call(t,e)&&As(r,n))||n===void 0&&!(e in t))&&Gm(t,e,n)}var wu=Math.max;function Zm(t,e,n){return e=wu(e===void 0?t.length-1:e,0),function(){for(var r=arguments,a=-1,i=wu(r.length-e,0),s=Array(i);++a<i;)s[a]=r[e+a];a=-1;for(var l=Array(e+1);++a<e;)l[a]=r[a];return l[e]=n(s),Mm(t,this,l)}}var Xm=9007199254740991;function Vs(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Xm}function Qm(t){return t!=null&&Vs(t.length)&&!yu(t)}var Jm=Object.prototype;function e0(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Jm;return t===n}function t0(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var n0="[object Arguments]";function Cu(t){return Qr(t)&&Xr(t)==n0}var ku=Object.prototype,r0=ku.hasOwnProperty,a0=ku.propertyIsEnumerable,Rs=Cu(function(){return arguments}())?Cu:function(t){return Qr(t)&&r0.call(t,"callee")&&!a0.call(t,"callee")};function i0(){return!1}var xu=typeof Fe=="object"&&Fe&&!Fe.nodeType&&Fe,Eu=xu&&typeof module=="object"&&module&&!module.nodeType&&module,o0=Eu&&Eu.exports===xu,Su=o0?yn.Buffer:void 0,s0=Su?Su.isBuffer:void 0,$s=s0||i0,l0="[object Arguments]",c0="[object Array]",u0="[object Boolean]",d0="[object Date]",f0="[object Error]",h0="[object Function]",p0="[object Map]",v0="[object Number]",g0="[object Object]",m0="[object RegExp]",y0="[object Set]",b0="[object String]",w0="[object WeakMap]",C0="[object ArrayBuffer]",k0="[object DataView]",x0="[object Float32Array]",E0="[object Float64Array]",S0="[object Int8Array]",T0="[object Int16Array]",B0="[object Int32Array]",N0="[object Uint8Array]",D0="[object Uint8ClampedArray]",_0="[object Uint16Array]",P0="[object Uint32Array]",We={};We[x0]=We[E0]=We[S0]=We[T0]=We[B0]=We[N0]=We[D0]=We[_0]=We[P0]=!0,We[l0]=We[c0]=We[C0]=We[u0]=We[k0]=We[d0]=We[f0]=We[h0]=We[p0]=We[v0]=We[g0]=We[m0]=We[y0]=We[b0]=We[w0]=!1;function I0(t){return Qr(t)&&Vs(t.length)&&!!We[Xr(t)]}function O0(t){return function(e){return t(e)}}var Tu=typeof Fe=="object"&&Fe&&!Fe.nodeType&&Fe,Ua=Tu&&typeof module=="object"&&module&&!module.nodeType&&module,L0=Ua&&Ua.exports===Tu,zs=L0&&cu.process,Bu=function(){try{var t=Ua&&Ua.require&&Ua.require("util").types;return t||zs&&zs.binding&&zs.binding("util")}catch{}}(),Nu=Bu&&Bu.isTypedArray,Du=Nu?O0(Nu):I0,M0=Object.prototype,F0=M0.hasOwnProperty;function A0(t,e){var n=sn(t),r=!n&&Rs(t),a=!n&&!r&&$s(t),i=!n&&!r&&!a&&Du(t),s=n||r||a||i,l=s?t0(t.length,String):[],u=l.length;for(var c in t)F0.call(t,c)&&!(s&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Fs(c,u)))&&l.push(c);return l}function V0(t,e){return function(n){return t(e(n))}}var R0=V0(Object.keys,Object),$0=Object.prototype,z0=$0.hasOwnProperty;function H0(t){if(!e0(t))return R0(t);var e=[];for(var n in Object(t))z0.call(t,n)&&n!="constructor"&&e.push(n);return e}function _u(t){return Qm(t)?A0(t):H0(t)}var K0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q0=/^\w*$/;function Hs(t,e){if(sn(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Ji(t)?!0:q0.test(t)||!K0.test(t)||e!=null&&t in Object(e)}var Ga=kr(Object,"create");function U0(){this.__data__=Ga?Ga(null):{},this.size=0}function G0(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var W0="__lodash_hash_undefined__",j0=Object.prototype,Y0=j0.hasOwnProperty;function Z0(t){var e=this.__data__;if(Ga){var n=e[t];return n===W0?void 0:n}return Y0.call(e,t)?e[t]:void 0}var X0=Object.prototype,Q0=X0.hasOwnProperty;function J0(t){var e=this.__data__;return Ga?e[t]!==void 0:Q0.call(e,t)}var ey="__lodash_hash_undefined__";function ty(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ga&&e===void 0?ey:e,this}function xr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}xr.prototype.clear=U0,xr.prototype.delete=G0,xr.prototype.get=Z0,xr.prototype.has=J0,xr.prototype.set=ty;function ny(){this.__data__=[],this.size=0}function to(t,e){for(var n=t.length;n--;)if(As(t[n][0],e))return n;return-1}var ry=Array.prototype,ay=ry.splice;function iy(t){var e=this.__data__,n=to(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():ay.call(e,n,1),--this.size,!0}function oy(t){var e=this.__data__,n=to(e,t);return n<0?void 0:e[n][1]}function sy(t){return to(this.__data__,t)>-1}function ly(t,e){var n=this.__data__,r=to(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function In(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}In.prototype.clear=ny,In.prototype.delete=iy,In.prototype.get=oy,In.prototype.has=sy,In.prototype.set=ly;var Wa=kr(yn,"Map");function cy(){this.size=0,this.__data__={hash:new xr,map:new(Wa||In),string:new xr}}function uy(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function no(t,e){var n=t.__data__;return uy(e)?n[typeof e=="string"?"string":"hash"]:n.map}function dy(t){var e=no(this,t).delete(t);return this.size-=e?1:0,e}function fy(t){return no(this,t).get(t)}function hy(t){return no(this,t).has(t)}function py(t,e){var n=no(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function On(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}On.prototype.clear=cy,On.prototype.delete=dy,On.prototype.get=fy,On.prototype.has=hy,On.prototype.set=py;var vy="Expected a function";function Ks(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(vy);var n=function(){var r=arguments,a=e?e.apply(this,r):r[0],i=n.cache;if(i.has(a))return i.get(a);var s=t.apply(this,r);return n.cache=i.set(a,s)||i,s};return n.cache=new(Ks.Cache||On),n}Ks.Cache=On;var gy=500;function my(t){var e=Ks(t,function(r){return n.size===gy&&n.clear(),r}),n=e.cache;return e}var yy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,by=/\\(\\)?/g,wy=my(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(yy,function(n,r,a,i){e.push(a?i.replace(by,"$1"):r||n)}),e});function Cy(t){return t==null?"":pu(t)}function ro(t,e){return sn(t)?t:Hs(t,e)?[t]:wy(Cy(t))}var ky=1/0;function ja(t){if(typeof t=="string"||Ji(t))return t;var e=t+"";return e=="0"&&1/t==-ky?"-0":e}function qs(t,e){e=ro(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[ja(e[n++])];return n&&n==r?t:void 0}function Ln(t,e,n){var r=t==null?void 0:qs(t,e);return r===void 0?n:r}function Pu(t,e){for(var n=-1,r=e.length,a=t.length;++n<r;)t[a+n]=e[n];return t}var Iu=bn?bn.isConcatSpreadable:void 0;function xy(t){return sn(t)||Rs(t)||!!(Iu&&t&&t[Iu])}function Ey(t,e,n,r,a){var i=-1,s=t.length;for(n||(n=xy),a||(a=[]);++i<s;){var l=t[i];n(l)?Pu(a,l):a[a.length]=l}return a}function Sy(t){var e=t==null?0:t.length;return e?Ey(t):[]}function Ty(t){return Hm(Zm(t,void 0,Sy),t+"")}function Wn(){if(!arguments.length)return[];var t=arguments[0];return sn(t)?t:[t]}function By(){this.__data__=new In,this.size=0}function Ny(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Dy(t){return this.__data__.get(t)}function _y(t){return this.__data__.has(t)}var Py=200;function Iy(t,e){var n=this.__data__;if(n instanceof In){var r=n.__data__;if(!Wa||r.length<Py-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new On(r)}return n.set(t,e),this.size=n.size,this}function Mn(t){var e=this.__data__=new In(t);this.size=e.size}Mn.prototype.clear=By,Mn.prototype.delete=Ny,Mn.prototype.get=Dy,Mn.prototype.has=_y,Mn.prototype.set=Iy;function Oy(t,e){for(var n=-1,r=t==null?0:t.length,a=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[a++]=s)}return i}function Ly(){return[]}var My=Object.prototype,Fy=My.propertyIsEnumerable,Ou=Object.getOwnPropertySymbols,Ay=Ou?function(t){return t==null?[]:(t=Object(t),Oy(Ou(t),function(e){return Fy.call(t,e)}))}:Ly;function Vy(t,e,n){var r=e(t);return sn(t)?r:Pu(r,n(t))}function Lu(t){return Vy(t,_u,Ay)}var Us=kr(yn,"DataView"),Gs=kr(yn,"Promise"),Ws=kr(yn,"Set"),Mu="[object Map]",Ry="[object Object]",Fu="[object Promise]",Au="[object Set]",Vu="[object WeakMap]",Ru="[object DataView]",$y=Cr(Us),zy=Cr(Wa),Hy=Cr(Gs),Ky=Cr(Ws),qy=Cr(Ms),jn=Xr;(Us&&jn(new Us(new ArrayBuffer(1)))!=Ru||Wa&&jn(new Wa)!=Mu||Gs&&jn(Gs.resolve())!=Fu||Ws&&jn(new Ws)!=Au||Ms&&jn(new Ms)!=Vu)&&(jn=function(t){var e=Xr(t),n=e==Ry?t.constructor:void 0,r=n?Cr(n):"";if(r)switch(r){case $y:return Ru;case zy:return Mu;case Hy:return Fu;case Ky:return Au;case qy:return Vu}return e});var $u=yn.Uint8Array,Uy="__lodash_hash_undefined__";function Gy(t){return this.__data__.set(t,Uy),this}function Wy(t){return this.__data__.has(t)}function ao(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new On;++e<n;)this.add(t[e])}ao.prototype.add=ao.prototype.push=Gy,ao.prototype.has=Wy;function jy(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function Yy(t,e){return t.has(e)}var Zy=1,Xy=2;function zu(t,e,n,r,a,i){var s=n&Zy,l=t.length,u=e.length;if(l!=u&&!(s&&u>l))return!1;var c=i.get(t),d=i.get(e);if(c&&d)return c==e&&d==t;var f=-1,h=!0,v=n&Xy?new ao:void 0;for(i.set(t,e),i.set(e,t);++f<l;){var p=t[f],g=e[f];if(r)var y=s?r(g,p,f,e,t,i):r(p,g,f,t,e,i);if(y!==void 0){if(y)continue;h=!1;break}if(v){if(!jy(e,function(m,b){if(!Yy(v,b)&&(p===m||a(p,m,n,r,i)))return v.push(b)})){h=!1;break}}else if(!(p===g||a(p,g,n,r,i))){h=!1;break}}return i.delete(t),i.delete(e),h}function Qy(t){var e=-1,n=Array(t.size);return t.forEach(function(r,a){n[++e]=[a,r]}),n}function Jy(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var e1=1,t1=2,n1="[object Boolean]",r1="[object Date]",a1="[object Error]",i1="[object Map]",o1="[object Number]",s1="[object RegExp]",l1="[object Set]",c1="[object String]",u1="[object Symbol]",d1="[object ArrayBuffer]",f1="[object DataView]",Hu=bn?bn.prototype:void 0,js=Hu?Hu.valueOf:void 0;function h1(t,e,n,r,a,i,s){switch(n){case f1:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case d1:return!(t.byteLength!=e.byteLength||!i(new $u(t),new $u(e)));case n1:case r1:case o1:return As(+t,+e);case a1:return t.name==e.name&&t.message==e.message;case s1:case c1:return t==e+"";case i1:var l=Qy;case l1:var u=r&e1;if(l||(l=Jy),t.size!=e.size&&!u)return!1;var c=s.get(t);if(c)return c==e;r|=t1,s.set(t,e);var d=zu(l(t),l(e),r,a,i,s);return s.delete(t),d;case u1:if(js)return js.call(t)==js.call(e)}return!1}var p1=1,v1=Object.prototype,g1=v1.hasOwnProperty;function m1(t,e,n,r,a,i){var s=n&p1,l=Lu(t),u=l.length,c=Lu(e),d=c.length;if(u!=d&&!s)return!1;for(var f=u;f--;){var h=l[f];if(!(s?h in e:g1.call(e,h)))return!1}var v=i.get(t),p=i.get(e);if(v&&p)return v==e&&p==t;var g=!0;i.set(t,e),i.set(e,t);for(var y=s;++f<u;){h=l[f];var m=t[h],b=e[h];if(r)var w=s?r(b,m,h,e,t,i):r(m,b,h,t,e,i);if(!(w===void 0?m===b||a(m,b,n,r,i):w)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var C=t.constructor,E=e.constructor;C!=E&&"constructor"in t&&"constructor"in e&&!(typeof C=="function"&&C instanceof C&&typeof E=="function"&&E instanceof E)&&(g=!1)}return i.delete(t),i.delete(e),g}var y1=1,Ku="[object Arguments]",qu="[object Array]",io="[object Object]",b1=Object.prototype,Uu=b1.hasOwnProperty;function w1(t,e,n,r,a,i){var s=sn(t),l=sn(e),u=s?qu:jn(t),c=l?qu:jn(e);u=u==Ku?io:u,c=c==Ku?io:c;var d=u==io,f=c==io,h=u==c;if(h&&$s(t)){if(!$s(e))return!1;s=!0,d=!1}if(h&&!d)return i||(i=new Mn),s||Du(t)?zu(t,e,n,r,a,i):h1(t,e,u,n,r,a,i);if(!(n&y1)){var v=d&&Uu.call(t,"__wrapped__"),p=f&&Uu.call(e,"__wrapped__");if(v||p){var g=v?t.value():t,y=p?e.value():e;return i||(i=new Mn),a(g,y,n,r,i)}}return h?(i||(i=new Mn),m1(t,e,n,r,a,i)):!1}function oo(t,e,n,r,a){return t===e?!0:t==null||e==null||!Qr(t)&&!Qr(e)?t!==t&&e!==e:w1(t,e,n,r,oo,a)}var C1=1,k1=2;function x1(t,e,n,r){var a=n.length,i=a;if(t==null)return!i;for(t=Object(t);a--;){var s=n[a];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++a<i;){s=n[a];var l=s[0],u=t[l],c=s[1];if(s[2]){if(u===void 0&&!(l in t))return!1}else{var d=new Mn,f;if(!(f===void 0?oo(c,u,C1|k1,r,d):f))return!1}}return!0}function Gu(t){return t===t&&!Gn(t)}function E1(t){for(var e=_u(t),n=e.length;n--;){var r=e[n],a=t[r];e[n]=[r,a,Gu(a)]}return e}function Wu(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function S1(t){var e=E1(t);return e.length==1&&e[0][2]?Wu(e[0][0],e[0][1]):function(n){return n===t||x1(n,t,e)}}function T1(t,e){return t!=null&&e in Object(t)}function B1(t,e,n){e=ro(e,t);for(var r=-1,a=e.length,i=!1;++r<a;){var s=ja(e[r]);if(!(i=t!=null&&n(t,s)))break;t=t[s]}return i||++r!=a?i:(a=t==null?0:t.length,!!a&&Vs(a)&&Fs(s,a)&&(sn(t)||Rs(t)))}function ju(t,e){return t!=null&&B1(t,e,T1)}var N1=1,D1=2;function _1(t,e){return Hs(t)&&Gu(e)?Wu(ja(t),e):function(n){var r=Ln(n,t);return r===void 0&&r===e?ju(n,t):oo(e,r,N1|D1)}}function P1(t){return function(e){return e==null?void 0:e[t]}}function I1(t){return function(e){return qs(e,t)}}function O1(t){return Hs(t)?P1(ja(t)):I1(t)}function L1(t){return typeof t=="function"?t:t==null?mu:typeof t=="object"?sn(t)?_1(t[0],t[1]):S1(t):O1(t)}var Ys=function(){return yn.Date.now()},M1="Expected a function",F1=Math.max,A1=Math.min;function Yu(t,e,n){var r,a,i,s,l,u,c=0,d=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(M1);e=gu(e)||0,Gn(n)&&(d=!!n.leading,f="maxWait"in n,i=f?F1(gu(n.maxWait)||0,e):i,h="trailing"in n?!!n.trailing:h);function v(x){var k=r,B=a;return r=a=void 0,c=x,s=t.apply(B,k),s}function p(x){return c=x,l=setTimeout(m,e),d?v(x):s}function g(x){var k=x-u,B=x-c,S=e-k;return f?A1(S,i-B):S}function y(x){var k=x-u,B=x-c;return u===void 0||k>=e||k<0||f&&B>=i}function m(){var x=Ys();if(y(x))return b(x);l=setTimeout(m,g(x))}function b(x){return l=void 0,h&&r?v(x):(r=a=void 0,s)}function w(){l!==void 0&&clearTimeout(l),c=0,r=u=a=l=void 0}function C(){return l===void 0?s:b(Ys())}function E(){var x=Ys(),k=y(x);if(r=arguments,a=this,u=x,k){if(l===void 0)return p(u);if(f)return clearTimeout(l),l=setTimeout(m,e),v(u)}return l===void 0&&(l=setTimeout(m,e)),s}return E.cancel=w,E.flush=C,E}function V1(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var a=r-1;return Km(t,L1(e),a)}function so(t){for(var e=-1,n=t==null?0:t.length,r={};++e<n;){var a=t[e];r[a[0]]=a[1]}return r}function lo(t,e){return oo(t,e)}function Yn(t){return t==null}function R1(t){return t===void 0}function $1(t,e,n,r){if(!Gn(t))return t;e=ro(e,t);for(var a=-1,i=e.length,s=i-1,l=t;l!=null&&++a<i;){var u=ja(e[a]),c=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(a!=s){var d=l[u];c=void 0,c===void 0&&(c=Gn(d)?d:Fs(e[a+1])?[]:{})}Ym(l,u,c),l=l[u]}return t}function z1(t,e,n){for(var r=-1,a=e.length,i={};++r<a;){var s=e[r],l=qs(t,s);n(l,s)&&$1(i,ro(s,t),l)}return i}function H1(t,e){return z1(t,e,function(n,r){return ju(t,r)})}var Zu=Ty(function(t,e){return t==null?{}:H1(t,e)});const Zn=t=>t===void 0,Jr=t=>typeof t=="boolean",mt=t=>typeof t=="number",Er=t=>typeof Element>"u"?!1:t instanceof Element,co=t=>Yn(t),K1=t=>St(t)?!Number.isNaN(Number(t)):!1,q1=(t="")=>t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),Xu=t=>Object.keys(t);class Qu extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function U1(t,e){throw new Qu(`[${t}] ${e}`)}function tt(t,e){if(process.env.NODE_ENV!=="production"){const n=St(t)?new Qu(`[${t}] ${e}`):t;console.warn(n)}}const G1="utils/dom/style",Ju=(t="")=>t.split(" ").filter(e=>!!e.trim()),Zs=(t,e)=>{!t||!e.trim()||t.classList.add(...Ju(e))},Sr=(t,e)=>{!t||!e.trim()||t.classList.remove(...Ju(e))},Ya=(t,e)=>{var n;if(!et||!t||!e)return"";let r=Zg(e);r==="float"&&(r="cssFloat");try{const a=t.style[r];if(a)return a;const i=(n=document.defaultView)==null?void 0:n.getComputedStyle(t,"");return i?i[r]:""}catch{return t.style[r]}};function ea(t,e="px"){if(!t)return"";if(mt(t)||K1(t))return`${t}${e}`;if(St(t))return t;tt(G1,"binding value must be a string or number")}function W1(t,e){if(!et)return;if(!e){t.scrollTop=0;return}const n=[];let r=e.offsetParent;for(;r!==null&&t!==r&&t.contains(r);)n.push(r),r=r.offsetParent;const a=e.offsetTop+n.reduce((u,c)=>u+c.offsetTop,0),i=a+e.offsetHeight,s=t.scrollTop,l=s+t.clientHeight;a<s?t.scrollTop=a:i>l&&(t.scrollTop=i-t.clientHeight)}/*! Element Plus Icons Vue v2.3.1 */var j1=o.defineComponent({name:"Aim",__name:"aim",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32m0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32M96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32m576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32"})]))}}),Y1=j1,Z1=o.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),Za=Z1,X1=o.defineComponent({name:"ArrowUp",__name:"arrow-up",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),Xs=X1,Q1=o.defineComponent({name:"CaretRight",__name:"caret-right",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M384 192v640l384-320.064z"})]))}}),J1=Q1,eb=o.defineComponent({name:"CircleCheck",__name:"circle-check",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),o.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),tb=eb,nb=o.defineComponent({name:"CircleClose",__name:"circle-close",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),Qs=nb,rb=o.defineComponent({name:"Close",__name:"close",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),uo=rb,ab=o.defineComponent({name:"CopyDocument",__name:"copy-document",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z"}),o.createElementVNode("path",{fill:"currentColor",d:"M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64"})]))}}),ib=ab,ob=o.defineComponent({name:"Delete",__name:"delete",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),sb=ob,lb=o.defineComponent({name:"Edit",__name:"edit",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),o.createElementVNode("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),cb=lb,ub=o.defineComponent({name:"Finished",__name:"finished",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M280.768 753.728 691.456 167.04a32 32 0 1 1 52.416 36.672L314.24 817.472a32 32 0 0 1-45.44 7.296l-230.4-172.8a32 32 0 0 1 38.4-51.2l203.968 152.96zM736 448a32 32 0 1 1 0-64h192a32 32 0 1 1 0 64zM608 640a32 32 0 0 1 0-64h319.936a32 32 0 1 1 0 64zM480 832a32 32 0 1 1 0-64h447.936a32 32 0 1 1 0 64z"})]))}}),db=ub,fb=o.defineComponent({name:"Hide",__name:"hide",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),o.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),hb=fb,pb=o.defineComponent({name:"Loading",__name:"loading",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),Js=pb,vb=o.defineComponent({name:"Lock",__name:"lock",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"})]))}}),gb=vb,mb=o.defineComponent({name:"Unlock",__name:"unlock",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z"})]))}}),yb=mb,bb=o.defineComponent({name:"View",__name:"view",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),wb=bb,Cb=o.defineComponent({name:"Warning",__name:"warning",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"})]))}}),fo=Cb,kb=o.defineComponent({name:"ZoomIn",__name:"zoom-in",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})]))}}),xb=kb,Eb=o.defineComponent({name:"ZoomOut",__name:"zoom-out",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"})]))}}),Sb=Eb;const ed="__epPropKey",ke=t=>t,Tb=t=>gt(t)&&!!t[ed],ho=(t,e)=>{if(!gt(t)||Tb(t))return t;const{values:n,required:r,default:a,type:i,validator:s}=t,u={type:i,required:!!r,validator:n||s?c=>{let d=!1,f=[];if(n&&(f=Array.from(n),wr(t,"default")&&f.push(a),d||(d=f.includes(c))),s&&(d||(d=s(c))),!d&&f.length>0){const h=[...new Set(f)].map(v=>JSON.stringify(v)).join(", ");o.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${h}], got value ${JSON.stringify(c)}.`)}return d}:void 0,[ed]:!0};return wr(t,"default")&&(u.default=a),u},Ae=t=>so(Object.entries(t).map(([e,n])=>[e,ho(n,e)])),Xn=ke([String,Object,Function]),td={validating:Js,success:tb,error:Qs},ft=(t,e)=>{if(t.install=n=>{for(const r of[t,...Object.values(e??{})])n.component(r.name,r)},e)for(const[n,r]of Object.entries(e))t[n]=r;return t},Bb=(t,e)=>(t.install=n=>{n.directive(e,t)},t),Fn=t=>(t.install=Ka,t),it={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},yt="update:modelValue",el="change",nd=["","default","small","large"],Nb=t=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t),ta=t=>t,Db=["class","style"],_b=/^on[A-Z]/,Pb=(t={})=>{const{excludeListeners:e=!1,excludeKeys:n}=t,r=o.computed(()=>((n==null?void 0:n.value)||[]).concat(Db)),a=o.getCurrentInstance();return a?o.computed(()=>{var i;return so(Object.entries((i=a.proxy)==null?void 0:i.$attrs).filter(([s])=>!r.value.includes(s)&&!(e&&_b.test(s))))}):(tt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),o.computed(()=>({})))},po=({from:t,replacement:e,scope:n,version:r,ref:a,type:i="API"},s)=>{o.watch(()=>o.unref(s),l=>{l&&tt(n,`[${i}] ${t} is about to be deprecated in version ${r}, please use ${e} instead.
|
|
6
6
|
For more detail, please visit: ${a}
|
|
7
|
-
`)},{immediate:!0})};var Ob={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const Ib=t=>(e,n)=>Lb(e,n,o.unref(t)),Lb=(t,e,n)=>Ln(n,t,t).replace(/\{(\w+)\}/g,(r,a)=>{var i;return`${(i=e==null?void 0:e[a])!=null?i:`{${a}}`}`}),Mb=t=>{const e=o.computed(()=>o.unref(t).name),n=o.isRef(t)?t:o.ref(t);return{lang:e,locale:n,t:Ib(t)}},rd=Symbol("localeContextKey"),Za=t=>{const e=t||o.inject(rd,o.ref());return Mb(o.computed(()=>e.value||Ob))},vo="el",Fb="is-",Tr=(t,e,n,r,a)=>{let i=`${t}-${e}`;return n&&(i+=`-${n}`),r&&(i+=`__${r}`),a&&(i+=`--${a}`),i},ad=Symbol("namespaceContextKey"),tl=t=>{const e=t||(o.getCurrentInstance()?o.inject(ad,o.ref(vo)):o.ref(vo));return o.computed(()=>o.unref(e)||vo)},Be=(t,e)=>{const n=tl(e);return{namespace:n,b:(g="")=>Tr(n.value,t,g,"",""),e:g=>g?Tr(n.value,t,"",g,""):"",m:g=>g?Tr(n.value,t,"","",g):"",be:(g,y)=>g&&y?Tr(n.value,t,g,y,""):"",em:(g,y)=>g&&y?Tr(n.value,t,"",g,y):"",bm:(g,y)=>g&&y?Tr(n.value,t,g,"",y):"",bem:(g,y,m)=>g&&y&&m?Tr(n.value,t,g,y,m):"",is:(g,...y)=>{const m=y.length>=1?y[0]:!0;return g&&m?`${Fb}${g}`:""},cssVar:g=>{const y={};for(const m in g)g[m]&&(y[`--${n.value}-${m}`]=g[m]);return y},cssVarName:g=>`--${n.value}-${g}`,cssVarBlock:g=>{const y={};for(const m in g)g[m]&&(y[`--${n.value}-${t}-${m}`]=g[m]);return y},cssVarBlockName:g=>`--${n.value}-${t}-${g}`}},Ab=ho({type:ke(Boolean),default:null}),Vb=ho({type:ke(Function)}),Rb=t=>{const e=`update:${t}`,n=`onUpdate:${t}`,r=[e],a={[t]:Ab,[n]:Vb};return{useModelToggle:({indicator:s,toggleReason:l,shouldHideWhenRouteChanges:u,shouldProceed:c,onShow:d,onHide:f})=>{const h=o.getCurrentInstance(),{emit:v}=h,p=h.props,g=o.computed(()=>Lt(p[n])),y=o.computed(()=>p[t]===null),m=x=>{s.value!==!0&&(s.value=!0,l&&(l.value=x),Lt(d)&&d(x))},b=x=>{s.value!==!1&&(s.value=!1,l&&(l.value=x),Lt(f)&&f(x))},w=x=>{if(p.disabled===!0||Lt(c)&&!c())return;const B=g.value&&et;B&&v(e,!0),(y.value||!B)&&m(x)},C=x=>{if(p.disabled===!0||!et)return;const B=g.value&&et;B&&v(e,!1),(y.value||!B)&&b(x)},k=x=>{Jr(x)&&(p.disabled&&x?g.value&&v(e,!1):s.value!==x&&(x?m():b()))},E=()=>{s.value?C():w()};return o.watch(()=>p[t],k),u&&h.appContext.config.globalProperties.$route!==void 0&&o.watch(()=>({...h.proxy.$route}),()=>{u.value&&s.value&&C()}),o.onMounted(()=>{k(p[t])}),{hide:C,show:w,toggle:E,hasUpdateHandler:g}},useModelToggleProps:a,useModelToggleEmits:r}},id=t=>{const e=o.getCurrentInstance();return o.computed(()=>{var n,r;return(r=(n=e==null?void 0:e.proxy)==null?void 0:n.$props)==null?void 0:r[t]})};var Vt="top",Yt="bottom",Zt="right",Rt="left",nl="auto",Xa=[Vt,Yt,Zt,Rt],na="start",Qa="end",$b="clippingParents",od="viewport",Ja="popper",zb="reference",sd=Xa.reduce(function(t,e){return t.concat([e+"-"+na,e+"-"+Qa])},[]),go=[].concat(Xa,[nl]).reduce(function(t,e){return t.concat([e,e+"-"+na,e+"-"+Qa])},[]),Hb="beforeRead",Kb="read",qb="afterRead",Ub="beforeMain",Gb="main",Wb="afterMain",jb="beforeWrite",Yb="write",Zb="afterWrite",Xb=[Hb,Kb,qb,Ub,Gb,Wb,jb,Yb,Zb];function wn(t){return t?(t.nodeName||"").toLowerCase():null}function ln(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function ra(t){var e=ln(t).Element;return t instanceof e||t instanceof Element}function Xt(t){var e=ln(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function rl(t){if(typeof ShadowRoot>"u")return!1;var e=ln(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Qb(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},a=e.attributes[n]||{},i=e.elements[n];!Xt(i)||!wn(i)||(Object.assign(i.style,r),Object.keys(a).forEach(function(s){var l=a[s];l===!1?i.removeAttribute(s):i.setAttribute(s,l===!0?"":l)}))})}function Jb(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var a=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(u,c){return u[c]="",u},{});!Xt(a)||!wn(a)||(Object.assign(a.style,l),Object.keys(i).forEach(function(u){a.removeAttribute(u)}))})}}var ld={name:"applyStyles",enabled:!0,phase:"write",fn:Qb,effect:Jb,requires:["computeStyles"]};function Cn(t){return t.split("-")[0]}var Br=Math.max,mo=Math.min,aa=Math.round;function ia(t,e){e===void 0&&(e=!1);var n=t.getBoundingClientRect(),r=1,a=1;if(Xt(t)&&e){var i=t.offsetHeight,s=t.offsetWidth;s>0&&(r=aa(n.width)/s||1),i>0&&(a=aa(n.height)/i||1)}return{width:n.width/r,height:n.height/a,top:n.top/a,right:n.right/r,bottom:n.bottom/a,left:n.left/r,x:n.left/r,y:n.top/a}}function al(t){var e=ia(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function cd(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&rl(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function An(t){return ln(t).getComputedStyle(t)}function ew(t){return["table","td","th"].indexOf(wn(t))>=0}function Qn(t){return((ra(t)?t.ownerDocument:t.document)||window.document).documentElement}function yo(t){return wn(t)==="html"?t:t.assignedSlot||t.parentNode||(rl(t)?t.host:null)||Qn(t)}function ud(t){return!Xt(t)||An(t).position==="fixed"?null:t.offsetParent}function tw(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&Xt(t)){var r=An(t);if(r.position==="fixed")return null}var a=yo(t);for(rl(a)&&(a=a.host);Xt(a)&&["html","body"].indexOf(wn(a))<0;){var i=An(a);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return a;a=a.parentNode}return null}function ei(t){for(var e=ln(t),n=ud(t);n&&ew(n)&&An(n).position==="static";)n=ud(n);return n&&(wn(n)==="html"||wn(n)==="body"&&An(n).position==="static")?e:n||tw(t)||e}function il(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ti(t,e,n){return Br(t,mo(e,n))}function nw(t,e,n){var r=ti(t,e,n);return r>n?n:r}function dd(){return{top:0,right:0,bottom:0,left:0}}function fd(t){return Object.assign({},dd(),t)}function hd(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var rw=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,fd(typeof t!="number"?t:hd(t,Xa))};function aw(t){var e,n=t.state,r=t.name,a=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,l=Cn(n.placement),u=il(l),c=[Rt,Zt].indexOf(l)>=0,d=c?"height":"width";if(!(!i||!s)){var f=rw(a.padding,n),h=al(i),v=u==="y"?Vt:Rt,p=u==="y"?Yt:Zt,g=n.rects.reference[d]+n.rects.reference[u]-s[u]-n.rects.popper[d],y=s[u]-n.rects.reference[u],m=ei(i),b=m?u==="y"?m.clientHeight||0:m.clientWidth||0:0,w=g/2-y/2,C=f[v],k=b-h[d]-f[p],E=b/2-h[d]/2+w,x=ti(C,E,k),B=u;n.modifiersData[r]=(e={},e[B]=x,e.centerOffset=x-E,e)}}function iw(t){var e=t.state,n=t.options,r=n.element,a=r===void 0?"[data-popper-arrow]":r;a!=null&&(typeof a=="string"&&(a=e.elements.popper.querySelector(a),!a)||!cd(e.elements.popper,a)||(e.elements.arrow=a))}var ow={name:"arrow",enabled:!0,phase:"main",fn:aw,effect:iw,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function oa(t){return t.split("-")[1]}var sw={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lw(t){var e=t.x,n=t.y,r=window,a=r.devicePixelRatio||1;return{x:aa(e*a)/a||0,y:aa(n*a)/a||0}}function pd(t){var e,n=t.popper,r=t.popperRect,a=t.placement,i=t.variation,s=t.offsets,l=t.position,u=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,f=t.isFixed,h=s.x,v=h===void 0?0:h,p=s.y,g=p===void 0?0:p,y=typeof d=="function"?d({x:v,y:g}):{x:v,y:g};v=y.x,g=y.y;var m=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),w=Rt,C=Vt,k=window;if(c){var E=ei(n),x="clientHeight",B="clientWidth";if(E===ln(n)&&(E=Qn(n),An(E).position!=="static"&&l==="absolute"&&(x="scrollHeight",B="scrollWidth")),E=E,a===Vt||(a===Rt||a===Zt)&&i===Qa){C=Yt;var S=f&&E===k&&k.visualViewport?k.visualViewport.height:E[x];g-=S-r.height,g*=u?1:-1}if(a===Rt||(a===Vt||a===Yt)&&i===Qa){w=Zt;var N=f&&E===k&&k.visualViewport?k.visualViewport.width:E[B];v-=N-r.width,v*=u?1:-1}}var D=Object.assign({position:l},c&&sw),_=d===!0?lw({x:v,y:g}):{x:v,y:g};if(v=_.x,g=_.y,u){var I;return Object.assign({},D,(I={},I[C]=b?"0":"",I[w]=m?"0":"",I.transform=(k.devicePixelRatio||1)<=1?"translate("+v+"px, "+g+"px)":"translate3d("+v+"px, "+g+"px, 0)",I))}return Object.assign({},D,(e={},e[C]=b?g+"px":"",e[w]=m?v+"px":"",e.transform="",e))}function cw(t){var e=t.state,n=t.options,r=n.gpuAcceleration,a=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,l=n.roundOffsets,u=l===void 0?!0:l,c={placement:Cn(e.placement),variation:oa(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:a,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,pd(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,pd(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var vd={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:cw,data:{}},bo={passive:!0};function uw(t){var e=t.state,n=t.instance,r=t.options,a=r.scroll,i=a===void 0?!0:a,s=r.resize,l=s===void 0?!0:s,u=ln(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(d){d.addEventListener("scroll",n.update,bo)}),l&&u.addEventListener("resize",n.update,bo),function(){i&&c.forEach(function(d){d.removeEventListener("scroll",n.update,bo)}),l&&u.removeEventListener("resize",n.update,bo)}}var gd={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:uw,data:{}},dw={left:"right",right:"left",bottom:"top",top:"bottom"};function wo(t){return t.replace(/left|right|bottom|top/g,function(e){return dw[e]})}var fw={start:"end",end:"start"};function md(t){return t.replace(/start|end/g,function(e){return fw[e]})}function ol(t){var e=ln(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function sl(t){return ia(Qn(t)).left+ol(t).scrollLeft}function hw(t){var e=ln(t),n=Qn(t),r=e.visualViewport,a=n.clientWidth,i=n.clientHeight,s=0,l=0;return r&&(a=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,l=r.offsetTop)),{width:a,height:i,x:s+sl(t),y:l}}function pw(t){var e,n=Qn(t),r=ol(t),a=(e=t.ownerDocument)==null?void 0:e.body,i=Br(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=Br(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),l=-r.scrollLeft+sl(t),u=-r.scrollTop;return An(a||n).direction==="rtl"&&(l+=Br(n.clientWidth,a?a.clientWidth:0)-i),{width:i,height:s,x:l,y:u}}function ll(t){var e=An(t),n=e.overflow,r=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+r)}function yd(t){return["html","body","#document"].indexOf(wn(t))>=0?t.ownerDocument.body:Xt(t)&&ll(t)?t:yd(yo(t))}function ni(t,e){var n;e===void 0&&(e=[]);var r=yd(t),a=r===((n=t.ownerDocument)==null?void 0:n.body),i=ln(r),s=a?[i].concat(i.visualViewport||[],ll(r)?r:[]):r,l=e.concat(s);return a?l:l.concat(ni(yo(s)))}function cl(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function vw(t){var e=ia(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function bd(t,e){return e===od?cl(hw(t)):ra(e)?vw(e):cl(pw(Qn(t)))}function gw(t){var e=ni(yo(t)),n=["absolute","fixed"].indexOf(An(t).position)>=0,r=n&&Xt(t)?ei(t):t;return ra(r)?e.filter(function(a){return ra(a)&&cd(a,r)&&wn(a)!=="body"}):[]}function mw(t,e,n){var r=e==="clippingParents"?gw(t):[].concat(e),a=[].concat(r,[n]),i=a[0],s=a.reduce(function(l,u){var c=bd(t,u);return l.top=Br(c.top,l.top),l.right=mo(c.right,l.right),l.bottom=mo(c.bottom,l.bottom),l.left=Br(c.left,l.left),l},bd(t,i));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function wd(t){var e=t.reference,n=t.element,r=t.placement,a=r?Cn(r):null,i=r?oa(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(a){case Vt:u={x:s,y:e.y-n.height};break;case Yt:u={x:s,y:e.y+e.height};break;case Zt:u={x:e.x+e.width,y:l};break;case Rt:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var c=a?il(a):null;if(c!=null){var d=c==="y"?"height":"width";switch(i){case na:u[c]=u[c]-(e[d]/2-n[d]/2);break;case Qa:u[c]=u[c]+(e[d]/2-n[d]/2);break}}return u}function ri(t,e){e===void 0&&(e={});var n=e,r=n.placement,a=r===void 0?t.placement:r,i=n.boundary,s=i===void 0?$b:i,l=n.rootBoundary,u=l===void 0?od:l,c=n.elementContext,d=c===void 0?Ja:c,f=n.altBoundary,h=f===void 0?!1:f,v=n.padding,p=v===void 0?0:v,g=fd(typeof p!="number"?p:hd(p,Xa)),y=d===Ja?zb:Ja,m=t.rects.popper,b=t.elements[h?y:d],w=mw(ra(b)?b:b.contextElement||Qn(t.elements.popper),s,u),C=ia(t.elements.reference),k=wd({reference:C,element:m,strategy:"absolute",placement:a}),E=cl(Object.assign({},m,k)),x=d===Ja?E:C,B={top:w.top-x.top+g.top,bottom:x.bottom-w.bottom+g.bottom,left:w.left-x.left+g.left,right:x.right-w.right+g.right},S=t.modifiersData.offset;if(d===Ja&&S){var N=S[a];Object.keys(B).forEach(function(D){var _=[Zt,Yt].indexOf(D)>=0?1:-1,I=[Vt,Yt].indexOf(D)>=0?"y":"x";B[D]+=N[I]*_})}return B}function yw(t,e){e===void 0&&(e={});var n=e,r=n.placement,a=n.boundary,i=n.rootBoundary,s=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,c=u===void 0?go:u,d=oa(r),f=d?l?sd:sd.filter(function(p){return oa(p)===d}):Xa,h=f.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=f);var v=h.reduce(function(p,g){return p[g]=ri(t,{placement:g,boundary:a,rootBoundary:i,padding:s})[Cn(g)],p},{});return Object.keys(v).sort(function(p,g){return v[p]-v[g]})}function bw(t){if(Cn(t)===nl)return[];var e=wo(t);return[md(t),e,md(e)]}function ww(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var a=n.mainAxis,i=a===void 0?!0:a,s=n.altAxis,l=s===void 0?!0:s,u=n.fallbackPlacements,c=n.padding,d=n.boundary,f=n.rootBoundary,h=n.altBoundary,v=n.flipVariations,p=v===void 0?!0:v,g=n.allowedAutoPlacements,y=e.options.placement,m=Cn(y),b=m===y,w=u||(b||!p?[wo(y)]:bw(y)),C=[y].concat(w).reduce(function(ee,J){return ee.concat(Cn(J)===nl?yw(e,{placement:J,boundary:d,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:g}):J)},[]),k=e.rects.reference,E=e.rects.popper,x=new Map,B=!0,S=C[0],N=0;N<C.length;N++){var D=C[N],_=Cn(D),I=oa(D)===na,P=[Vt,Yt].indexOf(_)>=0,F=P?"width":"height",O=ri(e,{placement:D,boundary:d,rootBoundary:f,altBoundary:h,padding:c}),M=P?I?Zt:Rt:I?Yt:Vt;k[F]>E[F]&&(M=wo(M));var L=wo(M),V=[];if(i&&V.push(O[_]<=0),l&&V.push(O[M]<=0,O[L]<=0),V.every(function(ee){return ee})){S=D,B=!1;break}x.set(D,V)}if(B)for(var H=p?3:1,$=function(ee){var J=C.find(function(X){var ne=x.get(X);if(ne)return ne.slice(0,ee).every(function(Y){return Y})});if(J)return S=J,"break"},z=H;z>0;z--){var j=$(z);if(j==="break")break}e.placement!==S&&(e.modifiersData[r]._skip=!0,e.placement=S,e.reset=!0)}}var Cw={name:"flip",enabled:!0,phase:"main",fn:ww,requiresIfExists:["offset"],data:{_skip:!1}};function Cd(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function kd(t){return[Vt,Zt,Yt,Rt].some(function(e){return t[e]>=0})}function kw(t){var e=t.state,n=t.name,r=e.rects.reference,a=e.rects.popper,i=e.modifiersData.preventOverflow,s=ri(e,{elementContext:"reference"}),l=ri(e,{altBoundary:!0}),u=Cd(s,r),c=Cd(l,a,i),d=kd(u),f=kd(c);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}var xw={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:kw};function Ew(t,e,n){var r=Cn(t),a=[Rt,Vt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],l=i[1];return s=s||0,l=(l||0)*a,[Rt,Zt].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function Sw(t){var e=t.state,n=t.options,r=t.name,a=n.offset,i=a===void 0?[0,0]:a,s=go.reduce(function(d,f){return d[f]=Ew(f,e.rects,i),d},{}),l=s[e.placement],u=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}var Tw={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Sw};function Bw(t){var e=t.state,n=t.name;e.modifiersData[n]=wd({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var xd={name:"popperOffsets",enabled:!0,phase:"read",fn:Bw,data:{}};function Nw(t){return t==="x"?"y":"x"}function Dw(t){var e=t.state,n=t.options,r=t.name,a=n.mainAxis,i=a===void 0?!0:a,s=n.altAxis,l=s===void 0?!1:s,u=n.boundary,c=n.rootBoundary,d=n.altBoundary,f=n.padding,h=n.tether,v=h===void 0?!0:h,p=n.tetherOffset,g=p===void 0?0:p,y=ri(e,{boundary:u,rootBoundary:c,padding:f,altBoundary:d}),m=Cn(e.placement),b=oa(e.placement),w=!b,C=il(m),k=Nw(C),E=e.modifiersData.popperOffsets,x=e.rects.reference,B=e.rects.popper,S=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,N=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,_={x:0,y:0};if(E){if(i){var I,P=C==="y"?Vt:Rt,F=C==="y"?Yt:Zt,O=C==="y"?"height":"width",M=E[C],L=M+y[P],V=M-y[F],H=v?-B[O]/2:0,$=b===na?x[O]:B[O],z=b===na?-B[O]:-x[O],j=e.elements.arrow,ee=v&&j?al(j):{width:0,height:0},J=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:dd(),X=J[P],ne=J[F],Y=ti(0,x[O],ee[O]),A=w?x[O]/2-H-Y-X-N.mainAxis:$-Y-X-N.mainAxis,K=w?-x[O]/2+H+Y+ne+N.mainAxis:z+Y+ne+N.mainAxis,W=e.elements.arrow&&ei(e.elements.arrow),oe=W?C==="y"?W.clientTop||0:W.clientLeft||0:0,he=(I=D==null?void 0:D[C])!=null?I:0,re=M+A-he-oe,se=M+K-he,ue=ti(v?mo(L,re):L,M,v?Br(V,se):V);E[C]=ue,_[C]=ue-M}if(l){var pe,de=C==="x"?Vt:Rt,me=C==="x"?Yt:Zt,Ne=E[k],De=k==="y"?"height":"width",Ee=Ne+y[de],_e=Ne-y[me],te=[Vt,Rt].indexOf(m)!==-1,T=(pe=D==null?void 0:D[k])!=null?pe:0,R=te?Ee:Ne-x[De]-B[De]-T+N.altAxis,Q=te?Ne+x[De]+B[De]-T-N.altAxis:_e,G=v&&te?nw(R,Ne,Q):ti(v?R:Ee,Ne,v?Q:_e);E[k]=G,_[k]=G-Ne}e.modifiersData[r]=_}}var _w={name:"preventOverflow",enabled:!0,phase:"main",fn:Dw,requiresIfExists:["offset"]};function Pw(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Ow(t){return t===ln(t)||!Xt(t)?ol(t):Pw(t)}function Iw(t){var e=t.getBoundingClientRect(),n=aa(e.width)/t.offsetWidth||1,r=aa(e.height)/t.offsetHeight||1;return n!==1||r!==1}function Lw(t,e,n){n===void 0&&(n=!1);var r=Xt(e),a=Xt(e)&&Iw(e),i=Qn(e),s=ia(t,a),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((wn(e)!=="body"||ll(i))&&(l=Ow(e)),Xt(e)?(u=ia(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):i&&(u.x=sl(i))),{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function Mw(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function a(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var u=e.get(l);u&&a(u)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||a(i)}),r}function Fw(t){var e=Mw(t);return Xb.reduce(function(n,r){return n.concat(e.filter(function(a){return a.phase===r}))},[])}function Aw(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Vw(t){var e=t.reduce(function(n,r){var a=n[r.name];return n[r.name]=a?Object.assign({},a,r,{options:Object.assign({},a.options,r.options),data:Object.assign({},a.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Ed={placement:"bottom",modifiers:[],strategy:"absolute"};function Sd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function ul(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,a=e.defaultOptions,i=a===void 0?Ed:a;return function(s,l,u){u===void 0&&(u=i);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ed,i),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],f=!1,h={state:c,setOptions:function(g){var y=typeof g=="function"?g(c.options):g;p(),c.options=Object.assign({},i,c.options,y),c.scrollParents={reference:ra(s)?ni(s):s.contextElement?ni(s.contextElement):[],popper:ni(l)};var m=Fw(Vw([].concat(r,c.options.modifiers)));return c.orderedModifiers=m.filter(function(b){return b.enabled}),v(),h.update()},forceUpdate:function(){if(!f){var g=c.elements,y=g.reference,m=g.popper;if(Sd(y,m)){c.rects={reference:Lw(y,ei(m),c.options.strategy==="fixed"),popper:al(m)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(B){return c.modifiersData[B.name]=Object.assign({},B.data)});for(var b=0;b<c.orderedModifiers.length;b++){if(c.reset===!0){c.reset=!1,b=-1;continue}var w=c.orderedModifiers[b],C=w.fn,k=w.options,E=k===void 0?{}:k,x=w.name;typeof C=="function"&&(c=C({state:c,options:E,name:x,instance:h})||c)}}}},update:Aw(function(){return new Promise(function(g){h.forceUpdate(),g(c)})}),destroy:function(){p(),f=!0}};if(!Sd(s,l))return h;h.setOptions(u).then(function(g){!f&&u.onFirstUpdate&&u.onFirstUpdate(g)});function v(){c.orderedModifiers.forEach(function(g){var y=g.name,m=g.options,b=m===void 0?{}:m,w=g.effect;if(typeof w=="function"){var C=w({state:c,name:y,instance:h,options:b}),k=function(){};d.push(C||k)}})}function p(){d.forEach(function(g){return g()}),d=[]}return h}}ul();var Rw=[gd,xd,vd,ld];ul({defaultModifiers:Rw});var $w=[gd,xd,vd,ld,Tw,Cw,_w,ow,xw],zw=ul({defaultModifiers:$w});const Hw=(t,e,n={})=>{const r={name:"updateState",enabled:!0,phase:"write",fn:({state:u})=>{const c=Kw(u);Object.assign(s.value,c)},requires:["computeStyles"]},a=o.computed(()=>{const{onFirstUpdate:u,placement:c,strategy:d,modifiers:f}=o.unref(n);return{onFirstUpdate:u,placement:c||"bottom",strategy:d||"absolute",modifiers:[...f||[],r,{name:"applyStyles",enabled:!1}]}}),i=o.shallowRef(),s=o.ref({styles:{popper:{position:o.unref(a).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{i.value&&(i.value.destroy(),i.value=void 0)};return o.watch(a,u=>{const c=o.unref(i);c&&c.setOptions(u)},{deep:!0}),o.watch([t,e],([u,c])=>{l(),!(!u||!c)&&(i.value=zw(u,c,o.unref(a)))}),o.onBeforeUnmount(()=>{l()}),{state:o.computed(()=>{var u;return{...((u=o.unref(i))==null?void 0:u.state)||{}}}),styles:o.computed(()=>o.unref(s).styles),attributes:o.computed(()=>o.unref(s).attributes),update:()=>{var u;return(u=o.unref(i))==null?void 0:u.update()},forceUpdate:()=>{var u;return(u=o.unref(i))==null?void 0:u.forceUpdate()},instanceRef:o.computed(()=>o.unref(i))}};function Kw(t){const e=Object.keys(t.elements),n=so(e.map(a=>[a,t.styles[a]||{}])),r=so(e.map(a=>[a,t.attributes[a]]));return{styles:n,attributes:r}}function Td(){let t;const e=(r,a)=>{n(),t=window.setTimeout(r,a)},n=()=>window.clearTimeout(t);return Xi(()=>n()),{registerTimeout:e,cancelTimeout:n}}const dl={prefix:Math.floor(Math.random()*1e4),current:0},qw=Symbol("elIdInjection"),Bd=()=>o.getCurrentInstance()?o.inject(qw,dl):dl,Co=t=>{const e=Bd();!et&&e===dl&&tt("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
|
|
7
|
+
`)},{immediate:!0})};var Ib={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const Ob=t=>(e,n)=>Lb(e,n,o.unref(t)),Lb=(t,e,n)=>Ln(n,t,t).replace(/\{(\w+)\}/g,(r,a)=>{var i;return`${(i=e==null?void 0:e[a])!=null?i:`{${a}}`}`}),Mb=t=>{const e=o.computed(()=>o.unref(t).name),n=o.isRef(t)?t:o.ref(t);return{lang:e,locale:n,t:Ob(t)}},rd=Symbol("localeContextKey"),Xa=t=>{const e=t||o.inject(rd,o.ref());return Mb(o.computed(()=>e.value||Ib))},vo="el",Fb="is-",Tr=(t,e,n,r,a)=>{let i=`${t}-${e}`;return n&&(i+=`-${n}`),r&&(i+=`__${r}`),a&&(i+=`--${a}`),i},ad=Symbol("namespaceContextKey"),tl=t=>{const e=t||(o.getCurrentInstance()?o.inject(ad,o.ref(vo)):o.ref(vo));return o.computed(()=>o.unref(e)||vo)},Be=(t,e)=>{const n=tl(e);return{namespace:n,b:(g="")=>Tr(n.value,t,g,"",""),e:g=>g?Tr(n.value,t,"",g,""):"",m:g=>g?Tr(n.value,t,"","",g):"",be:(g,y)=>g&&y?Tr(n.value,t,g,y,""):"",em:(g,y)=>g&&y?Tr(n.value,t,"",g,y):"",bm:(g,y)=>g&&y?Tr(n.value,t,g,"",y):"",bem:(g,y,m)=>g&&y&&m?Tr(n.value,t,g,y,m):"",is:(g,...y)=>{const m=y.length>=1?y[0]:!0;return g&&m?`${Fb}${g}`:""},cssVar:g=>{const y={};for(const m in g)g[m]&&(y[`--${n.value}-${m}`]=g[m]);return y},cssVarName:g=>`--${n.value}-${g}`,cssVarBlock:g=>{const y={};for(const m in g)g[m]&&(y[`--${n.value}-${t}-${m}`]=g[m]);return y},cssVarBlockName:g=>`--${n.value}-${t}-${g}`}},Ab=ho({type:ke(Boolean),default:null}),Vb=ho({type:ke(Function)}),Rb=t=>{const e=`update:${t}`,n=`onUpdate:${t}`,r=[e],a={[t]:Ab,[n]:Vb};return{useModelToggle:({indicator:s,toggleReason:l,shouldHideWhenRouteChanges:u,shouldProceed:c,onShow:d,onHide:f})=>{const h=o.getCurrentInstance(),{emit:v}=h,p=h.props,g=o.computed(()=>Lt(p[n])),y=o.computed(()=>p[t]===null),m=k=>{s.value!==!0&&(s.value=!0,l&&(l.value=k),Lt(d)&&d(k))},b=k=>{s.value!==!1&&(s.value=!1,l&&(l.value=k),Lt(f)&&f(k))},w=k=>{if(p.disabled===!0||Lt(c)&&!c())return;const B=g.value&&et;B&&v(e,!0),(y.value||!B)&&m(k)},C=k=>{if(p.disabled===!0||!et)return;const B=g.value&&et;B&&v(e,!1),(y.value||!B)&&b(k)},E=k=>{Jr(k)&&(p.disabled&&k?g.value&&v(e,!1):s.value!==k&&(k?m():b()))},x=()=>{s.value?C():w()};return o.watch(()=>p[t],E),u&&h.appContext.config.globalProperties.$route!==void 0&&o.watch(()=>({...h.proxy.$route}),()=>{u.value&&s.value&&C()}),o.onMounted(()=>{E(p[t])}),{hide:C,show:w,toggle:x,hasUpdateHandler:g}},useModelToggleProps:a,useModelToggleEmits:r}},id=t=>{const e=o.getCurrentInstance();return o.computed(()=>{var n,r;return(r=(n=e==null?void 0:e.proxy)==null?void 0:n.$props)==null?void 0:r[t]})};var Vt="top",Zt="bottom",Xt="right",Rt="left",nl="auto",Qa=[Vt,Zt,Xt,Rt],na="start",Ja="end",$b="clippingParents",od="viewport",ei="popper",zb="reference",sd=Qa.reduce(function(t,e){return t.concat([e+"-"+na,e+"-"+Ja])},[]),go=[].concat(Qa,[nl]).reduce(function(t,e){return t.concat([e,e+"-"+na,e+"-"+Ja])},[]),Hb="beforeRead",Kb="read",qb="afterRead",Ub="beforeMain",Gb="main",Wb="afterMain",jb="beforeWrite",Yb="write",Zb="afterWrite",Xb=[Hb,Kb,qb,Ub,Gb,Wb,jb,Yb,Zb];function wn(t){return t?(t.nodeName||"").toLowerCase():null}function ln(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function ra(t){var e=ln(t).Element;return t instanceof e||t instanceof Element}function Qt(t){var e=ln(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function rl(t){if(typeof ShadowRoot>"u")return!1;var e=ln(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Qb(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},a=e.attributes[n]||{},i=e.elements[n];!Qt(i)||!wn(i)||(Object.assign(i.style,r),Object.keys(a).forEach(function(s){var l=a[s];l===!1?i.removeAttribute(s):i.setAttribute(s,l===!0?"":l)}))})}function Jb(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var a=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(u,c){return u[c]="",u},{});!Qt(a)||!wn(a)||(Object.assign(a.style,l),Object.keys(i).forEach(function(u){a.removeAttribute(u)}))})}}var ld={name:"applyStyles",enabled:!0,phase:"write",fn:Qb,effect:Jb,requires:["computeStyles"]};function Cn(t){return t.split("-")[0]}var Br=Math.max,mo=Math.min,aa=Math.round;function ia(t,e){e===void 0&&(e=!1);var n=t.getBoundingClientRect(),r=1,a=1;if(Qt(t)&&e){var i=t.offsetHeight,s=t.offsetWidth;s>0&&(r=aa(n.width)/s||1),i>0&&(a=aa(n.height)/i||1)}return{width:n.width/r,height:n.height/a,top:n.top/a,right:n.right/r,bottom:n.bottom/a,left:n.left/r,x:n.left/r,y:n.top/a}}function al(t){var e=ia(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function cd(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&rl(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function An(t){return ln(t).getComputedStyle(t)}function ew(t){return["table","td","th"].indexOf(wn(t))>=0}function Qn(t){return((ra(t)?t.ownerDocument:t.document)||window.document).documentElement}function yo(t){return wn(t)==="html"?t:t.assignedSlot||t.parentNode||(rl(t)?t.host:null)||Qn(t)}function ud(t){return!Qt(t)||An(t).position==="fixed"?null:t.offsetParent}function tw(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&Qt(t)){var r=An(t);if(r.position==="fixed")return null}var a=yo(t);for(rl(a)&&(a=a.host);Qt(a)&&["html","body"].indexOf(wn(a))<0;){var i=An(a);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return a;a=a.parentNode}return null}function ti(t){for(var e=ln(t),n=ud(t);n&&ew(n)&&An(n).position==="static";)n=ud(n);return n&&(wn(n)==="html"||wn(n)==="body"&&An(n).position==="static")?e:n||tw(t)||e}function il(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ni(t,e,n){return Br(t,mo(e,n))}function nw(t,e,n){var r=ni(t,e,n);return r>n?n:r}function dd(){return{top:0,right:0,bottom:0,left:0}}function fd(t){return Object.assign({},dd(),t)}function hd(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var rw=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,fd(typeof t!="number"?t:hd(t,Qa))};function aw(t){var e,n=t.state,r=t.name,a=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,l=Cn(n.placement),u=il(l),c=[Rt,Xt].indexOf(l)>=0,d=c?"height":"width";if(!(!i||!s)){var f=rw(a.padding,n),h=al(i),v=u==="y"?Vt:Rt,p=u==="y"?Zt:Xt,g=n.rects.reference[d]+n.rects.reference[u]-s[u]-n.rects.popper[d],y=s[u]-n.rects.reference[u],m=ti(i),b=m?u==="y"?m.clientHeight||0:m.clientWidth||0:0,w=g/2-y/2,C=f[v],E=b-h[d]-f[p],x=b/2-h[d]/2+w,k=ni(C,x,E),B=u;n.modifiersData[r]=(e={},e[B]=k,e.centerOffset=k-x,e)}}function iw(t){var e=t.state,n=t.options,r=n.element,a=r===void 0?"[data-popper-arrow]":r;a!=null&&(typeof a=="string"&&(a=e.elements.popper.querySelector(a),!a)||!cd(e.elements.popper,a)||(e.elements.arrow=a))}var ow={name:"arrow",enabled:!0,phase:"main",fn:aw,effect:iw,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function oa(t){return t.split("-")[1]}var sw={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lw(t){var e=t.x,n=t.y,r=window,a=r.devicePixelRatio||1;return{x:aa(e*a)/a||0,y:aa(n*a)/a||0}}function pd(t){var e,n=t.popper,r=t.popperRect,a=t.placement,i=t.variation,s=t.offsets,l=t.position,u=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,f=t.isFixed,h=s.x,v=h===void 0?0:h,p=s.y,g=p===void 0?0:p,y=typeof d=="function"?d({x:v,y:g}):{x:v,y:g};v=y.x,g=y.y;var m=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),w=Rt,C=Vt,E=window;if(c){var x=ti(n),k="clientHeight",B="clientWidth";if(x===ln(n)&&(x=Qn(n),An(x).position!=="static"&&l==="absolute"&&(k="scrollHeight",B="scrollWidth")),x=x,a===Vt||(a===Rt||a===Xt)&&i===Ja){C=Zt;var S=f&&x===E&&E.visualViewport?E.visualViewport.height:x[k];g-=S-r.height,g*=u?1:-1}if(a===Rt||(a===Vt||a===Zt)&&i===Ja){w=Xt;var N=f&&x===E&&E.visualViewport?E.visualViewport.width:x[B];v-=N-r.width,v*=u?1:-1}}var D=Object.assign({position:l},c&&sw),_=d===!0?lw({x:v,y:g}):{x:v,y:g};if(v=_.x,g=_.y,u){var O;return Object.assign({},D,(O={},O[C]=b?"0":"",O[w]=m?"0":"",O.transform=(E.devicePixelRatio||1)<=1?"translate("+v+"px, "+g+"px)":"translate3d("+v+"px, "+g+"px, 0)",O))}return Object.assign({},D,(e={},e[C]=b?g+"px":"",e[w]=m?v+"px":"",e.transform="",e))}function cw(t){var e=t.state,n=t.options,r=n.gpuAcceleration,a=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,l=n.roundOffsets,u=l===void 0?!0:l,c={placement:Cn(e.placement),variation:oa(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:a,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,pd(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,pd(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var vd={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:cw,data:{}},bo={passive:!0};function uw(t){var e=t.state,n=t.instance,r=t.options,a=r.scroll,i=a===void 0?!0:a,s=r.resize,l=s===void 0?!0:s,u=ln(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(d){d.addEventListener("scroll",n.update,bo)}),l&&u.addEventListener("resize",n.update,bo),function(){i&&c.forEach(function(d){d.removeEventListener("scroll",n.update,bo)}),l&&u.removeEventListener("resize",n.update,bo)}}var gd={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:uw,data:{}},dw={left:"right",right:"left",bottom:"top",top:"bottom"};function wo(t){return t.replace(/left|right|bottom|top/g,function(e){return dw[e]})}var fw={start:"end",end:"start"};function md(t){return t.replace(/start|end/g,function(e){return fw[e]})}function ol(t){var e=ln(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function sl(t){return ia(Qn(t)).left+ol(t).scrollLeft}function hw(t){var e=ln(t),n=Qn(t),r=e.visualViewport,a=n.clientWidth,i=n.clientHeight,s=0,l=0;return r&&(a=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,l=r.offsetTop)),{width:a,height:i,x:s+sl(t),y:l}}function pw(t){var e,n=Qn(t),r=ol(t),a=(e=t.ownerDocument)==null?void 0:e.body,i=Br(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=Br(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),l=-r.scrollLeft+sl(t),u=-r.scrollTop;return An(a||n).direction==="rtl"&&(l+=Br(n.clientWidth,a?a.clientWidth:0)-i),{width:i,height:s,x:l,y:u}}function ll(t){var e=An(t),n=e.overflow,r=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+r)}function yd(t){return["html","body","#document"].indexOf(wn(t))>=0?t.ownerDocument.body:Qt(t)&&ll(t)?t:yd(yo(t))}function ri(t,e){var n;e===void 0&&(e=[]);var r=yd(t),a=r===((n=t.ownerDocument)==null?void 0:n.body),i=ln(r),s=a?[i].concat(i.visualViewport||[],ll(r)?r:[]):r,l=e.concat(s);return a?l:l.concat(ri(yo(s)))}function cl(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function vw(t){var e=ia(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function bd(t,e){return e===od?cl(hw(t)):ra(e)?vw(e):cl(pw(Qn(t)))}function gw(t){var e=ri(yo(t)),n=["absolute","fixed"].indexOf(An(t).position)>=0,r=n&&Qt(t)?ti(t):t;return ra(r)?e.filter(function(a){return ra(a)&&cd(a,r)&&wn(a)!=="body"}):[]}function mw(t,e,n){var r=e==="clippingParents"?gw(t):[].concat(e),a=[].concat(r,[n]),i=a[0],s=a.reduce(function(l,u){var c=bd(t,u);return l.top=Br(c.top,l.top),l.right=mo(c.right,l.right),l.bottom=mo(c.bottom,l.bottom),l.left=Br(c.left,l.left),l},bd(t,i));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function wd(t){var e=t.reference,n=t.element,r=t.placement,a=r?Cn(r):null,i=r?oa(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(a){case Vt:u={x:s,y:e.y-n.height};break;case Zt:u={x:s,y:e.y+e.height};break;case Xt:u={x:e.x+e.width,y:l};break;case Rt:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var c=a?il(a):null;if(c!=null){var d=c==="y"?"height":"width";switch(i){case na:u[c]=u[c]-(e[d]/2-n[d]/2);break;case Ja:u[c]=u[c]+(e[d]/2-n[d]/2);break}}return u}function ai(t,e){e===void 0&&(e={});var n=e,r=n.placement,a=r===void 0?t.placement:r,i=n.boundary,s=i===void 0?$b:i,l=n.rootBoundary,u=l===void 0?od:l,c=n.elementContext,d=c===void 0?ei:c,f=n.altBoundary,h=f===void 0?!1:f,v=n.padding,p=v===void 0?0:v,g=fd(typeof p!="number"?p:hd(p,Qa)),y=d===ei?zb:ei,m=t.rects.popper,b=t.elements[h?y:d],w=mw(ra(b)?b:b.contextElement||Qn(t.elements.popper),s,u),C=ia(t.elements.reference),E=wd({reference:C,element:m,strategy:"absolute",placement:a}),x=cl(Object.assign({},m,E)),k=d===ei?x:C,B={top:w.top-k.top+g.top,bottom:k.bottom-w.bottom+g.bottom,left:w.left-k.left+g.left,right:k.right-w.right+g.right},S=t.modifiersData.offset;if(d===ei&&S){var N=S[a];Object.keys(B).forEach(function(D){var _=[Xt,Zt].indexOf(D)>=0?1:-1,O=[Vt,Zt].indexOf(D)>=0?"y":"x";B[D]+=N[O]*_})}return B}function yw(t,e){e===void 0&&(e={});var n=e,r=n.placement,a=n.boundary,i=n.rootBoundary,s=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,c=u===void 0?go:u,d=oa(r),f=d?l?sd:sd.filter(function(p){return oa(p)===d}):Qa,h=f.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=f);var v=h.reduce(function(p,g){return p[g]=ai(t,{placement:g,boundary:a,rootBoundary:i,padding:s})[Cn(g)],p},{});return Object.keys(v).sort(function(p,g){return v[p]-v[g]})}function bw(t){if(Cn(t)===nl)return[];var e=wo(t);return[md(t),e,md(e)]}function ww(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var a=n.mainAxis,i=a===void 0?!0:a,s=n.altAxis,l=s===void 0?!0:s,u=n.fallbackPlacements,c=n.padding,d=n.boundary,f=n.rootBoundary,h=n.altBoundary,v=n.flipVariations,p=v===void 0?!0:v,g=n.allowedAutoPlacements,y=e.options.placement,m=Cn(y),b=m===y,w=u||(b||!p?[wo(y)]:bw(y)),C=[y].concat(w).reduce(function(ee,J){return ee.concat(Cn(J)===nl?yw(e,{placement:J,boundary:d,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:g}):J)},[]),E=e.rects.reference,x=e.rects.popper,k=new Map,B=!0,S=C[0],N=0;N<C.length;N++){var D=C[N],_=Cn(D),O=oa(D)===na,P=[Vt,Zt].indexOf(_)>=0,F=P?"width":"height",I=ai(e,{placement:D,boundary:d,rootBoundary:f,altBoundary:h,padding:c}),M=P?O?Xt:Rt:O?Zt:Vt;E[F]>x[F]&&(M=wo(M));var L=wo(M),V=[];if(i&&V.push(I[_]<=0),l&&V.push(I[M]<=0,I[L]<=0),V.every(function(ee){return ee})){S=D,B=!1;break}k.set(D,V)}if(B)for(var H=p?3:1,$=function(ee){var J=C.find(function(X){var ne=k.get(X);if(ne)return ne.slice(0,ee).every(function(Y){return Y})});if(J)return S=J,"break"},z=H;z>0;z--){var j=$(z);if(j==="break")break}e.placement!==S&&(e.modifiersData[r]._skip=!0,e.placement=S,e.reset=!0)}}var Cw={name:"flip",enabled:!0,phase:"main",fn:ww,requiresIfExists:["offset"],data:{_skip:!1}};function Cd(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function kd(t){return[Vt,Xt,Zt,Rt].some(function(e){return t[e]>=0})}function kw(t){var e=t.state,n=t.name,r=e.rects.reference,a=e.rects.popper,i=e.modifiersData.preventOverflow,s=ai(e,{elementContext:"reference"}),l=ai(e,{altBoundary:!0}),u=Cd(s,r),c=Cd(l,a,i),d=kd(u),f=kd(c);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}var xw={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:kw};function Ew(t,e,n){var r=Cn(t),a=[Rt,Vt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],l=i[1];return s=s||0,l=(l||0)*a,[Rt,Xt].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function Sw(t){var e=t.state,n=t.options,r=t.name,a=n.offset,i=a===void 0?[0,0]:a,s=go.reduce(function(d,f){return d[f]=Ew(f,e.rects,i),d},{}),l=s[e.placement],u=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}var Tw={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Sw};function Bw(t){var e=t.state,n=t.name;e.modifiersData[n]=wd({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var xd={name:"popperOffsets",enabled:!0,phase:"read",fn:Bw,data:{}};function Nw(t){return t==="x"?"y":"x"}function Dw(t){var e=t.state,n=t.options,r=t.name,a=n.mainAxis,i=a===void 0?!0:a,s=n.altAxis,l=s===void 0?!1:s,u=n.boundary,c=n.rootBoundary,d=n.altBoundary,f=n.padding,h=n.tether,v=h===void 0?!0:h,p=n.tetherOffset,g=p===void 0?0:p,y=ai(e,{boundary:u,rootBoundary:c,padding:f,altBoundary:d}),m=Cn(e.placement),b=oa(e.placement),w=!b,C=il(m),E=Nw(C),x=e.modifiersData.popperOffsets,k=e.rects.reference,B=e.rects.popper,S=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,N=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,_={x:0,y:0};if(x){if(i){var O,P=C==="y"?Vt:Rt,F=C==="y"?Zt:Xt,I=C==="y"?"height":"width",M=x[C],L=M+y[P],V=M-y[F],H=v?-B[I]/2:0,$=b===na?k[I]:B[I],z=b===na?-B[I]:-k[I],j=e.elements.arrow,ee=v&&j?al(j):{width:0,height:0},J=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:dd(),X=J[P],ne=J[F],Y=ni(0,k[I],ee[I]),A=w?k[I]/2-H-Y-X-N.mainAxis:$-Y-X-N.mainAxis,K=w?-k[I]/2+H+Y+ne+N.mainAxis:z+Y+ne+N.mainAxis,W=e.elements.arrow&&ti(e.elements.arrow),oe=W?C==="y"?W.clientTop||0:W.clientLeft||0:0,he=(O=D==null?void 0:D[C])!=null?O:0,re=M+A-he-oe,se=M+K-he,ue=ni(v?mo(L,re):L,M,v?Br(V,se):V);x[C]=ue,_[C]=ue-M}if(l){var pe,de=C==="x"?Vt:Rt,me=C==="x"?Zt:Xt,Ne=x[E],De=E==="y"?"height":"width",Ee=Ne+y[de],_e=Ne-y[me],te=[Vt,Rt].indexOf(m)!==-1,T=(pe=D==null?void 0:D[E])!=null?pe:0,R=te?Ee:Ne-k[De]-B[De]-T+N.altAxis,Q=te?Ne+k[De]+B[De]-T-N.altAxis:_e,G=v&&te?nw(R,Ne,Q):ni(v?R:Ee,Ne,v?Q:_e);x[E]=G,_[E]=G-Ne}e.modifiersData[r]=_}}var _w={name:"preventOverflow",enabled:!0,phase:"main",fn:Dw,requiresIfExists:["offset"]};function Pw(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Iw(t){return t===ln(t)||!Qt(t)?ol(t):Pw(t)}function Ow(t){var e=t.getBoundingClientRect(),n=aa(e.width)/t.offsetWidth||1,r=aa(e.height)/t.offsetHeight||1;return n!==1||r!==1}function Lw(t,e,n){n===void 0&&(n=!1);var r=Qt(e),a=Qt(e)&&Ow(e),i=Qn(e),s=ia(t,a),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((wn(e)!=="body"||ll(i))&&(l=Iw(e)),Qt(e)?(u=ia(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):i&&(u.x=sl(i))),{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function Mw(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function a(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var u=e.get(l);u&&a(u)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||a(i)}),r}function Fw(t){var e=Mw(t);return Xb.reduce(function(n,r){return n.concat(e.filter(function(a){return a.phase===r}))},[])}function Aw(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Vw(t){var e=t.reduce(function(n,r){var a=n[r.name];return n[r.name]=a?Object.assign({},a,r,{options:Object.assign({},a.options,r.options),data:Object.assign({},a.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Ed={placement:"bottom",modifiers:[],strategy:"absolute"};function Sd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function ul(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,a=e.defaultOptions,i=a===void 0?Ed:a;return function(s,l,u){u===void 0&&(u=i);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ed,i),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],f=!1,h={state:c,setOptions:function(g){var y=typeof g=="function"?g(c.options):g;p(),c.options=Object.assign({},i,c.options,y),c.scrollParents={reference:ra(s)?ri(s):s.contextElement?ri(s.contextElement):[],popper:ri(l)};var m=Fw(Vw([].concat(r,c.options.modifiers)));return c.orderedModifiers=m.filter(function(b){return b.enabled}),v(),h.update()},forceUpdate:function(){if(!f){var g=c.elements,y=g.reference,m=g.popper;if(Sd(y,m)){c.rects={reference:Lw(y,ti(m),c.options.strategy==="fixed"),popper:al(m)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(B){return c.modifiersData[B.name]=Object.assign({},B.data)});for(var b=0;b<c.orderedModifiers.length;b++){if(c.reset===!0){c.reset=!1,b=-1;continue}var w=c.orderedModifiers[b],C=w.fn,E=w.options,x=E===void 0?{}:E,k=w.name;typeof C=="function"&&(c=C({state:c,options:x,name:k,instance:h})||c)}}}},update:Aw(function(){return new Promise(function(g){h.forceUpdate(),g(c)})}),destroy:function(){p(),f=!0}};if(!Sd(s,l))return h;h.setOptions(u).then(function(g){!f&&u.onFirstUpdate&&u.onFirstUpdate(g)});function v(){c.orderedModifiers.forEach(function(g){var y=g.name,m=g.options,b=m===void 0?{}:m,w=g.effect;if(typeof w=="function"){var C=w({state:c,name:y,instance:h,options:b}),E=function(){};d.push(C||E)}})}function p(){d.forEach(function(g){return g()}),d=[]}return h}}ul();var Rw=[gd,xd,vd,ld];ul({defaultModifiers:Rw});var $w=[gd,xd,vd,ld,Tw,Cw,_w,ow,xw],zw=ul({defaultModifiers:$w});const Hw=(t,e,n={})=>{const r={name:"updateState",enabled:!0,phase:"write",fn:({state:u})=>{const c=Kw(u);Object.assign(s.value,c)},requires:["computeStyles"]},a=o.computed(()=>{const{onFirstUpdate:u,placement:c,strategy:d,modifiers:f}=o.unref(n);return{onFirstUpdate:u,placement:c||"bottom",strategy:d||"absolute",modifiers:[...f||[],r,{name:"applyStyles",enabled:!1}]}}),i=o.shallowRef(),s=o.ref({styles:{popper:{position:o.unref(a).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{i.value&&(i.value.destroy(),i.value=void 0)};return o.watch(a,u=>{const c=o.unref(i);c&&c.setOptions(u)},{deep:!0}),o.watch([t,e],([u,c])=>{l(),!(!u||!c)&&(i.value=zw(u,c,o.unref(a)))}),o.onBeforeUnmount(()=>{l()}),{state:o.computed(()=>{var u;return{...((u=o.unref(i))==null?void 0:u.state)||{}}}),styles:o.computed(()=>o.unref(s).styles),attributes:o.computed(()=>o.unref(s).attributes),update:()=>{var u;return(u=o.unref(i))==null?void 0:u.update()},forceUpdate:()=>{var u;return(u=o.unref(i))==null?void 0:u.forceUpdate()},instanceRef:o.computed(()=>o.unref(i))}};function Kw(t){const e=Object.keys(t.elements),n=so(e.map(a=>[a,t.styles[a]||{}])),r=so(e.map(a=>[a,t.attributes[a]]));return{styles:n,attributes:r}}function Td(){let t;const e=(r,a)=>{n(),t=window.setTimeout(r,a)},n=()=>window.clearTimeout(t);return Xi(()=>n()),{registerTimeout:e,cancelTimeout:n}}const dl={prefix:Math.floor(Math.random()*1e4),current:0},qw=Symbol("elIdInjection"),Bd=()=>o.getCurrentInstance()?o.inject(qw,dl):dl,Co=t=>{const e=Bd();!et&&e===dl&&tt("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
|
|
8
8
|
usage: app.provide(ID_INJECTION_KEY, {
|
|
9
9
|
prefix: number,
|
|
10
10
|
current: number,
|
|
11
|
-
})`);const n=tl();return o.computed(()=>o.unref(t)||`${n.value}-id-${e.prefix}-${e.current++}`)};let sa=[];const Nd=t=>{const e=t;e.key===it.esc&&sa.forEach(n=>n(e))},Uw=t=>{o.onMounted(()=>{sa.length===0&&document.addEventListener("keydown",Nd),et&&sa.push(t)}),o.onBeforeUnmount(()=>{sa=sa.filter(e=>e!==t),sa.length===0&&et&&document.removeEventListener("keydown",Nd)})};let Dd;const _d=()=>{const t=tl(),e=Bd(),n=o.computed(()=>`${t.value}-popper-container-${e.prefix}`),r=o.computed(()=>`#${n.value}`);return{id:n,selector:r}},Gw=t=>{const e=document.createElement("div");return e.id=t,document.body.appendChild(e),e},Ww=()=>{const{id:t,selector:e}=_d();return o.onBeforeMount(()=>{et&&(process.env.NODE_ENV==="test"||!Dd||!document.body.querySelector(e.value))&&(Dd=Gw(t.value))}),{id:t,selector:e}},jw=Ae({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),Yw=({showAfter:t,hideAfter:e,autoClose:n,open:r,close:a})=>{const{registerTimeout:i}=Td(),{registerTimeout:s,cancelTimeout:l}=Td();return{onOpen:d=>{i(()=>{r(d);const f=o.unref(n);mt(f)&&f>0&&s(()=>{a(d)},f)},o.unref(t))},onClose:d=>{l(),i(()=>{a(d)},o.unref(e))}}},Pd=Symbol("elForwardRef"),Zw=t=>{const e=n=>{t.value=n};o.provide(Pd,{setForwardRef:e})},Xw=t=>({mounted(e){t(e)},updated(e){t(e)},unmounted(){t(null)}}),
|
|
12
|
-
usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:r,currentZIndex:a,nextZIndex:i}};function Qw(t){let e;function n(){if(t.value==null)return;const{selectionStart:a,selectionEnd:i,value:s}=t.value;if(a==null||i==null)return;const l=s.slice(0,Math.max(0,a)),u=s.slice(Math.max(0,i));e={selectionStart:a,selectionEnd:i,value:s,beforeTxt:l,afterTxt:u}}function r(){if(t.value==null||e==null)return;const{value:a}=t.value,{beforeTxt:i,afterTxt:s,selectionStart:l}=e;if(i==null||s==null||l==null)return;let u=a.length;if(a.endsWith(s))u=a.length-s.length;else if(a.startsWith(i))u=i.length;else{const c=i[l-1],d=a.indexOf(c,l-1);d!==-1&&(u=d+1)}t.value.setSelectionRange(u,u)}return[n,r]}const la=ho({type:String,values:nd,required:!1}),Vd=Symbol("size"),Jw=()=>{const t=o.inject(Vd,{});return o.computed(()=>o.unref(t.size)||"")};function fl(t,{beforeFocus:e,afterFocus:n,beforeBlur:r,afterBlur:a}={}){const i=o.getCurrentInstance(),{emit:s}=i,l=o.shallowRef(),u=o.ref(!1),c=h=>{Lt(e)&&e(h)||u.value||(u.value=!0,s("focus",h),n==null||n())},d=h=>{var v;Lt(r)&&r(h)||h.relatedTarget&&((v=l.value)!=null&&v.contains(h.relatedTarget))||(u.value=!1,s("blur",h),a==null||a())},f=()=>{var h,v;(h=l.value)!=null&&h.contains(document.activeElement)&&l.value!==document.activeElement||(v=t.value)==null||v.focus()};return o.watch(l,h=>{h&&h.setAttribute("tabindex","-1")}),
|
|
11
|
+
})`);const n=tl();return o.computed(()=>o.unref(t)||`${n.value}-id-${e.prefix}-${e.current++}`)};let sa=[];const Nd=t=>{const e=t;e.key===it.esc&&sa.forEach(n=>n(e))},Uw=t=>{o.onMounted(()=>{sa.length===0&&document.addEventListener("keydown",Nd),et&&sa.push(t)}),o.onBeforeUnmount(()=>{sa=sa.filter(e=>e!==t),sa.length===0&&et&&document.removeEventListener("keydown",Nd)})};let Dd;const _d=()=>{const t=tl(),e=Bd(),n=o.computed(()=>`${t.value}-popper-container-${e.prefix}`),r=o.computed(()=>`#${n.value}`);return{id:n,selector:r}},Gw=t=>{const e=document.createElement("div");return e.id=t,document.body.appendChild(e),e},Ww=()=>{const{id:t,selector:e}=_d();return o.onBeforeMount(()=>{et&&(process.env.NODE_ENV==="test"||!Dd||!document.body.querySelector(e.value))&&(Dd=Gw(t.value))}),{id:t,selector:e}},jw=Ae({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),Yw=({showAfter:t,hideAfter:e,autoClose:n,open:r,close:a})=>{const{registerTimeout:i}=Td(),{registerTimeout:s,cancelTimeout:l}=Td();return{onOpen:d=>{i(()=>{r(d);const f=o.unref(n);mt(f)&&f>0&&s(()=>{a(d)},f)},o.unref(t))},onClose:d=>{l(),i(()=>{a(d)},o.unref(e))}}},Pd=Symbol("elForwardRef"),Zw=t=>{const e=n=>{t.value=n};o.provide(Pd,{setForwardRef:e})},Xw=t=>({mounted(e){t(e)},updated(e){t(e)},unmounted(){t(null)}}),Id={current:0},Od=o.ref(0),Ld=2e3,Md=Symbol("elZIndexContextKey"),Fd=Symbol("zIndexContextKey"),Ad=t=>{const e=o.getCurrentInstance()?o.inject(Md,Id):Id,n=t||(o.getCurrentInstance()?o.inject(Fd,void 0):void 0),r=o.computed(()=>{const s=o.unref(n);return mt(s)?s:Ld}),a=o.computed(()=>r.value+Od.value),i=()=>(e.current++,Od.value=e.current,a.value);return!et&&!o.inject(Md)&&tt("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
|
|
12
|
+
usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:r,currentZIndex:a,nextZIndex:i}};function Qw(t){let e;function n(){if(t.value==null)return;const{selectionStart:a,selectionEnd:i,value:s}=t.value;if(a==null||i==null)return;const l=s.slice(0,Math.max(0,a)),u=s.slice(Math.max(0,i));e={selectionStart:a,selectionEnd:i,value:s,beforeTxt:l,afterTxt:u}}function r(){if(t.value==null||e==null)return;const{value:a}=t.value,{beforeTxt:i,afterTxt:s,selectionStart:l}=e;if(i==null||s==null||l==null)return;let u=a.length;if(a.endsWith(s))u=a.length-s.length;else if(a.startsWith(i))u=i.length;else{const c=i[l-1],d=a.indexOf(c,l-1);d!==-1&&(u=d+1)}t.value.setSelectionRange(u,u)}return[n,r]}const la=ho({type:String,values:nd,required:!1}),Vd=Symbol("size"),Jw=()=>{const t=o.inject(Vd,{});return o.computed(()=>o.unref(t.size)||"")};function fl(t,{beforeFocus:e,afterFocus:n,beforeBlur:r,afterBlur:a}={}){const i=o.getCurrentInstance(),{emit:s}=i,l=o.shallowRef(),u=o.ref(!1),c=h=>{Lt(e)&&e(h)||u.value||(u.value=!0,s("focus",h),n==null||n())},d=h=>{var v;Lt(r)&&r(h)||h.relatedTarget&&((v=l.value)!=null&&v.contains(h.relatedTarget))||(u.value=!1,s("blur",h),a==null||a())},f=()=>{var h,v;(h=l.value)!=null&&h.contains(document.activeElement)&&l.value!==document.activeElement||(v=t.value)==null||v.focus()};return o.watch(l,h=>{h&&h.setAttribute("tabindex","-1")}),Yt(l,"focus",c,!0),Yt(l,"blur",d,!0),Yt(l,"click",f,!0),process.env.NODE_ENV==="test"&&o.onMounted(()=>{const h=Er(t.value)?t.value:document.querySelector("input,textarea");h&&(Yt(h,"focus",c,!0),Yt(h,"blur",d,!0))}),{isFocused:u,wrapperRef:l,handleFocus:c,handleBlur:d}}function Rd({afterComposition:t,emit:e}){const n=o.ref(!1),r=l=>{e==null||e("compositionstart",l),n.value=!0},a=l=>{var u;e==null||e("compositionupdate",l);const c=(u=l.target)==null?void 0:u.value,d=c[c.length-1]||"";n.value=!Nb(d)},i=l=>{e==null||e("compositionend",l),n.value&&(n.value=!1,o.nextTick(()=>t(l)))};return{isComposing:n,handleComposition:l=>{l.type==="compositionend"?i(l):a(l)},handleCompositionStart:r,handleCompositionUpdate:a,handleCompositionEnd:i}}const $d=Symbol("emptyValuesContextKey"),e2="use-empty-values",t2=["",void 0,null],n2=void 0,r2=Ae({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:t=>Lt(t)?!t():!t}}),a2=(t,e)=>{const n=o.getCurrentInstance()?o.inject($d,o.ref({})):o.ref({}),r=o.computed(()=>t.emptyValues||n.value.emptyValues||t2),a=o.computed(()=>Lt(t.valueOnClear)?t.valueOnClear():t.valueOnClear!==void 0?t.valueOnClear:Lt(n.value.valueOnClear)?n.value.valueOnClear():n.value.valueOnClear!==void 0?n.value.valueOnClear:n2),i=s=>r.value.includes(s);return r.value.includes(a.value)||tt(e2,"value-on-clear should be a value of empty-values"),{emptyValues:r,valueOnClear:a,isEmptyValue:i}},i2=Ae({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Jn=t=>Zu(i2,t),zd=Symbol(),ko=o.ref();function hl(t,e=void 0){const n=o.getCurrentInstance()?o.inject(zd,ko):ko;return t?o.computed(()=>{var r,a;return(a=(r=n.value)==null?void 0:r[t])!=null?a:e}):n}function o2(t,e){const n=hl(),r=Be(t,o.computed(()=>{var l;return((l=n.value)==null?void 0:l.namespace)||vo})),a=Xa(o.computed(()=>{var l;return(l=n.value)==null?void 0:l.locale})),i=Ad(o.computed(()=>{var l;return((l=n.value)==null?void 0:l.zIndex)||Ld})),s=o.computed(()=>{var l;return o.unref(e)||((l=n.value)==null?void 0:l.size)||""});return s2(o.computed(()=>o.unref(n)||{})),{ns:r,locale:a,zIndex:i,size:s}}const s2=(t,e,n=!1)=>{var r;const a=!!o.getCurrentInstance(),i=a?hl():void 0,s=(r=void 0)!=null?r:a?o.provide:void 0;if(!s){tt("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const l=o.computed(()=>{const u=o.unref(t);return i!=null&&i.value?l2(i.value,u):u});return s(zd,l),s(rd,o.computed(()=>l.value.locale)),s(ad,o.computed(()=>l.value.namespace)),s(Fd,o.computed(()=>l.value.zIndex)),s(Vd,{size:o.computed(()=>l.value.size||"")}),s($d,o.computed(()=>({emptyValues:l.value.emptyValues,valueOnClear:l.value.valueOnClear}))),(n||!ko.value)&&(ko.value=l.value),l},l2=(t,e)=>{const n=[...new Set([...Xu(t),...Xu(e)])],r={};for(const a of n)r[a]=e[a]!==void 0?e[a]:t[a];return r};var Te=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n};const c2=Ae({size:{type:ke([Number,String])},color:{type:String}}),u2=o.defineComponent({name:"ElIcon",inheritAttrs:!1}),d2=o.defineComponent({...u2,props:c2,setup(t){const e=t,n=Be("icon"),r=o.computed(()=>{const{size:a,color:i}=e;return!a&&!i?{}:{fontSize:Zn(a)?void 0:ea(a),"--color":i}});return(a,i)=>(o.openBlock(),o.createElementBlock("i",o.mergeProps({class:o.unref(n).b(),style:o.unref(r)},a.$attrs),[o.renderSlot(a.$slots,"default")],16))}});var f2=Te(d2,[["__file","icon.vue"]]);const ot=ft(f2),pl=Symbol("formContextKey"),ii=Symbol("formItemContextKey"),Nr=(t,e={})=>{const n=o.ref(void 0),r=e.prop?n:id("size"),a=e.global?n:Jw(),i=e.form?{size:void 0}:o.inject(pl,void 0),s=e.formItem?{size:void 0}:o.inject(ii,void 0);return o.computed(()=>r.value||o.unref(t)||(s==null?void 0:s.size)||(i==null?void 0:i.size)||a.value||"")},oi=t=>{const e=id("disabled"),n=o.inject(pl,void 0);return o.computed(()=>e.value||o.unref(t)||(n==null?void 0:n.disabled)||!1)},Dr=()=>{const t=o.inject(pl,void 0),e=o.inject(ii,void 0);return{form:t,formItem:e}},si=(t,{formItemContext:e,disableIdGeneration:n,disableIdManagement:r})=>{n||(n=o.ref(!1)),r||(r=o.ref(!1));const a=o.ref();let i;const s=o.computed(()=>{var l;return!!(!(t.label||t.ariaLabel)&&e&&e.inputIds&&((l=e.inputIds)==null?void 0:l.length)<=1)});return o.onMounted(()=>{i=o.watch([o.toRef(t,"id"),n],([l,u])=>{const c=l??(u?void 0:Co().value);c!==a.value&&(e!=null&&e.removeInputId&&(a.value&&e.removeInputId(a.value),!(r!=null&&r.value)&&!u&&c&&e.addInputId(c)),a.value=c)},{immediate:!0})}),o.onUnmounted(()=>{i&&i(),e!=null&&e.removeInputId&&a.value&&e.removeInputId(a.value)}),{isLabeledByFormItem:s,inputId:a}};let cn;const h2=`
|
|
13
13
|
height:0 !important;
|
|
14
14
|
visibility:hidden !important;
|
|
15
15
|
${Ug()?"":"overflow:hidden !important;"}
|
|
@@ -17,8 +17,8 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:r,curr
|
|
|
17
17
|
z-index:-1000 !important;
|
|
18
18
|
top:0 !important;
|
|
19
19
|
right:0 !important;
|
|
20
|
-
`,p2=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function v2(t){const e=window.getComputedStyle(t),n=e.getPropertyValue("box-sizing"),r=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),a=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:p2.map(s=>`${s}:${e.getPropertyValue(s)}`).join(";"),paddingSize:r,borderSize:a,boxSizing:n}}function Hd(t,e=1,n){var r;cn||(cn=document.createElement("textarea"),document.body.appendChild(cn));const{paddingSize:a,borderSize:i,boxSizing:s,contextStyle:l}=v2(t);cn.setAttribute("style",`${l};${h2}`),cn.value=t.value||t.placeholder||"";let u=cn.scrollHeight;const c={};s==="border-box"?u=u+i:s==="content-box"&&(u=u-a),cn.value="";const d=cn.scrollHeight-a;if(mt(e)){let f=d*e;s==="border-box"&&(f=f+a+i),u=Math.max(f,u),c.minHeight=`${f}px`}if(mt(n)){let f=d*n;s==="border-box"&&(f=f+a+i),u=Math.min(f,u)}return c.height=`${u}px`,(r=cn.parentNode)==null||r.removeChild(cn),cn=void 0,c}const g2=Ae({id:{type:String,default:void 0},size:la,disabled:Boolean,modelValue:{type:ke([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:ke([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:Xn},prefixIcon:{type:Xn},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:ke([Object,Array,String]),default:()=>ta({})},autofocus:Boolean,rows:{type:Number,default:2},...Jn(["ariaLabel"])}),m2={[yt]:t=>St(t),input:t=>St(t),change:t=>St(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,mouseleave:t=>t instanceof MouseEvent,mouseenter:t=>t instanceof MouseEvent,keydown:t=>t instanceof Event,compositionstart:t=>t instanceof CompositionEvent,compositionupdate:t=>t instanceof CompositionEvent,compositionend:t=>t instanceof CompositionEvent},y2=o.defineComponent({name:"ElInput",inheritAttrs:!1}),b2=o.defineComponent({...y2,props:g2,emits:m2,setup(t,{expose:e,emit:n}){const r=t,a=o.useAttrs(),i=o.useSlots(),s=o.computed(()=>{const T={};return r.containerRole==="combobox"&&(T["aria-haspopup"]=a["aria-haspopup"],T["aria-owns"]=a["aria-owns"],T["aria-expanded"]=a["aria-expanded"]),T}),l=o.computed(()=>[r.type==="textarea"?y.b():g.b(),g.m(v.value),g.is("disabled",p.value),g.is("exceed",j.value),{[g.b("group")]:i.prepend||i.append,[g.m("prefix")]:i.prefix||r.prefixIcon,[g.m("suffix")]:i.suffix||r.suffixIcon||r.clearable||r.showPassword,[g.bm("suffix","password-clear")]:V.value&&H.value,[g.b("hidden")]:r.type==="hidden"},a.class]),u=o.computed(()=>[g.e("wrapper"),g.is("focus",S.value)]),c=Pb({excludeKeys:o.computed(()=>Object.keys(s.value))}),{form:d,formItem:f}=Dr(),{inputId:h}=oi(r,{formItemContext:f}),v=Nr(),p=ii(),g=Be("input"),y=Be("textarea"),m=o.shallowRef(),b=o.shallowRef(),w=o.ref(!1),C=o.ref(!1),k=o.ref(),E=o.shallowRef(r.inputStyle),x=o.computed(()=>m.value||b.value),{wrapperRef:B,isFocused:S,handleFocus:N,handleBlur:D}=fl(x,{beforeFocus(){return p.value},afterBlur(){var T;r.validateEvent&&((T=f==null?void 0:f.validate)==null||T.call(f,"blur").catch(R=>tt(R)))}}),_=o.computed(()=>{var T;return(T=d==null?void 0:d.statusIcon)!=null?T:!1}),I=o.computed(()=>(f==null?void 0:f.validateState)||""),P=o.computed(()=>I.value&&td[I.value]),F=o.computed(()=>C.value?wb:hb),O=o.computed(()=>[a.style]),M=o.computed(()=>[r.inputStyle,E.value,{resize:r.resize}]),L=o.computed(()=>Yn(r.modelValue)?"":String(r.modelValue)),V=o.computed(()=>r.clearable&&!p.value&&!r.readonly&&!!L.value&&(S.value||w.value)),H=o.computed(()=>r.showPassword&&!p.value&&!r.readonly&&!!L.value&&(!!L.value||S.value)),$=o.computed(()=>r.showWordLimit&&!!r.maxlength&&(r.type==="text"||r.type==="textarea")&&!p.value&&!r.readonly&&!r.showPassword),z=o.computed(()=>L.value.length),j=o.computed(()=>!!$.value&&z.value>Number(r.maxlength)),ee=o.computed(()=>!!i.suffix||!!r.suffixIcon||V.value||r.showPassword||$.value||!!I.value&&_.value),[J,X]=Qw(m);Pn(b,T=>{if(A(),!$.value||r.resize!=="both")return;const R=T[0],{width:Q}=R.contentRect;k.value={right:`calc(100% - ${Q+15+6}px)`}});const ne=()=>{const{type:T,autosize:R}=r;if(!(!et||T!=="textarea"||!b.value))if(R){const Q=gt(R)?R.minRows:void 0,G=gt(R)?R.maxRows:void 0,U=Hd(b.value,Q,G);E.value={overflowY:"hidden",...U},o.nextTick(()=>{b.value.offsetHeight,E.value=U})}else E.value={minHeight:Hd(b.value).minHeight}},A=(T=>{let R=!1;return()=>{var Q;if(R||!r.autosize)return;((Q=b.value)==null?void 0:Q.offsetParent)===null||(T(),R=!0)}})(ne),K=()=>{const T=x.value,R=r.formatter?r.formatter(L.value):L.value;!T||T.value===R||(T.value=R)},W=async T=>{J();let{value:R}=T.target;if(r.formatter&&(R=r.parser?r.parser(R):R),!he.value){if(R===L.value){K();return}n(yt,R),n("input",R),await o.nextTick(),K(),X()}},oe=T=>{n("change",T.target.value)},{isComposing:he,handleCompositionStart:re,handleCompositionUpdate:se,handleCompositionEnd:ue}=Rd({emit:n,afterComposition:W}),pe=()=>{C.value=!C.value,de()},de=async()=>{var T;await o.nextTick(),(T=x.value)==null||T.focus()},me=()=>{var T;return(T=x.value)==null?void 0:T.blur()},Ne=T=>{w.value=!1,n("mouseleave",T)},De=T=>{w.value=!0,n("mouseenter",T)},Ee=T=>{n("keydown",T)},_e=()=>{var T;(T=x.value)==null||T.select()},te=()=>{n(yt,""),n("change",""),n("clear"),n("input","")};return o.watch(()=>r.modelValue,()=>{var T;o.nextTick(()=>ne()),r.validateEvent&&((T=f==null?void 0:f.validate)==null||T.call(f,"change").catch(R=>tt(R)))}),o.watch(L,()=>K()),o.watch(()=>r.type,async()=>{await o.nextTick(),K(),ne()}),o.onMounted(()=>{!r.formatter&&r.parser&&tt("ElInput","If you set the parser, you also need to set the formatter."),K(),o.nextTick(ne)}),e({input:m,textarea:b,ref:x,textareaStyle:M,autosize:o.toRef(r,"autosize"),isComposing:he,focus:de,blur:me,select:_e,clear:te,resizeTextarea:ne}),(T,R)=>(o.openBlock(),o.createElementBlock("div",o.mergeProps(o.unref(s),{class:[o.unref(l),{[o.unref(g).bm("group","append")]:T.$slots.append,[o.unref(g).bm("group","prepend")]:T.$slots.prepend}],style:o.unref(O),role:T.containerRole,onMouseenter:De,onMouseleave:Ne}),[o.createCommentVNode(" input "),T.type!=="textarea"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createCommentVNode(" prepend slot "),T.$slots.prepend?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(g).be("group","prepend"))},[o.renderSlot(T.$slots,"prepend")],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{ref_key:"wrapperRef",ref:B,class:o.normalizeClass(o.unref(u))},[o.createCommentVNode(" prefix slot "),T.$slots.prefix||T.prefixIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(g).e("prefix"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(g).e("prefix-inner"))},[o.renderSlot(T.$slots,"prefix"),T.prefixIcon?(o.openBlock(),o.createBlock(o.unref(ot),{key:0,class:o.normalizeClass(o.unref(g).e("icon"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(T.prefixIcon)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],2)],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("input",o.mergeProps({id:o.unref(h),ref_key:"input",ref:m,class:o.unref(g).e("inner")},o.unref(c),{minlength:T.minlength,maxlength:T.maxlength,type:T.showPassword?C.value?"text":"password":T.type,disabled:o.unref(p),readonly:T.readonly,autocomplete:T.autocomplete,tabindex:T.tabindex,"aria-label":T.ariaLabel,placeholder:T.placeholder,style:T.inputStyle,form:T.form,autofocus:T.autofocus,onCompositionstart:o.unref(re),onCompositionupdate:o.unref(se),onCompositionend:o.unref(ue),onInput:W,onChange:oe,onKeydown:Ee}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),o.createCommentVNode(" suffix slot "),o.unref(ee)?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(o.unref(g).e("suffix"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(g).e("suffix-inner"))},[!o.unref(V)||!o.unref(H)||!o.unref($)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.renderSlot(T.$slots,"suffix"),T.suffixIcon?(o.openBlock(),o.createBlock(o.unref(ot),{key:0,class:o.normalizeClass(o.unref(g).e("icon"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(T.suffixIcon)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],64)):o.createCommentVNode("v-if",!0),o.unref(V)?(o.openBlock(),o.createBlock(o.unref(ot),{key:1,class:o.normalizeClass([o.unref(g).e("icon"),o.unref(g).e("clear")]),onMousedown:o.withModifiers(o.unref(Ha),["prevent"]),onClick:te},{default:o.withCtx(()=>[o.createVNode(o.unref(Qs))]),_:1},8,["class","onMousedown"])):o.createCommentVNode("v-if",!0),o.unref(H)?(o.openBlock(),o.createBlock(o.unref(ot),{key:2,class:o.normalizeClass([o.unref(g).e("icon"),o.unref(g).e("password")]),onClick:pe},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(F))))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),o.unref($)?(o.openBlock(),o.createElementBlock("span",{key:3,class:o.normalizeClass(o.unref(g).e("count"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(g).e("count-inner"))},o.toDisplayString(o.unref(z))+" / "+o.toDisplayString(T.maxlength),3)],2)):o.createCommentVNode("v-if",!0),o.unref(I)&&o.unref(P)&&o.unref(_)?(o.openBlock(),o.createBlock(o.unref(ot),{key:4,class:o.normalizeClass([o.unref(g).e("icon"),o.unref(g).e("validateIcon"),o.unref(g).is("loading",o.unref(I)==="validating")])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(P))))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],2)],2)):o.createCommentVNode("v-if",!0)],2),o.createCommentVNode(" append slot "),T.$slots.append?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(g).be("group","append"))},[o.renderSlot(T.$slots,"append")],2)):o.createCommentVNode("v-if",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createCommentVNode(" textarea "),o.createElementVNode("textarea",o.mergeProps({id:o.unref(h),ref_key:"textarea",ref:b,class:[o.unref(y).e("inner"),o.unref(g).is("focus",o.unref(S))]},o.unref(c),{minlength:T.minlength,maxlength:T.maxlength,tabindex:T.tabindex,disabled:o.unref(p),readonly:T.readonly,autocomplete:T.autocomplete,style:o.unref(M),"aria-label":T.ariaLabel,placeholder:T.placeholder,form:T.form,autofocus:T.autofocus,rows:T.rows,onCompositionstart:o.unref(re),onCompositionupdate:o.unref(se),onCompositionend:o.unref(ue),onInput:W,onFocus:o.unref(N),onBlur:o.unref(D),onChange:oe,onKeydown:Ee}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),o.unref($)?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(k.value),class:o.normalizeClass(o.unref(g).e("count"))},o.toDisplayString(o.unref(z))+" / "+o.toDisplayString(T.maxlength),7)):o.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var w2=Te(b2,[["__file","input.vue"]]);const si=ft(w2),ca=4,C2={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},k2=({move:t,size:e,bar:n})=>({[n.size]:e,transform:`translate${n.axis}(${t}%)`}),vl=Symbol("scrollbarContextKey"),x2=Ae({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),E2="Thumb";var Kd=Te(o.defineComponent({__name:"thumb",props:x2,setup(t){const e=t,n=o.inject(vl),r=Be("scrollbar");n||U1(E2,"can not inject scrollbar context");const a=o.ref(),i=o.ref(),s=o.ref({}),l=o.ref(!1);let u=!1,c=!1,d=et?document.onselectstart:null;const f=o.computed(()=>C2[e.vertical?"vertical":"horizontal"]),h=o.computed(()=>k2({size:e.size,move:e.move,bar:f.value})),v=o.computed(()=>a.value[f.value.offset]**2/n.wrapElement[f.value.scrollSize]/e.ratio/i.value[f.value.offset]),p=E=>{var x;if(E.stopPropagation(),E.ctrlKey||[1,2].includes(E.button))return;(x=window.getSelection())==null||x.removeAllRanges(),y(E);const B=E.currentTarget;B&&(s.value[f.value.axis]=B[f.value.offset]-(E[f.value.client]-B.getBoundingClientRect()[f.value.direction]))},g=E=>{if(!i.value||!a.value||!n.wrapElement)return;const x=Math.abs(E.target.getBoundingClientRect()[f.value.direction]-E[f.value.client]),B=i.value[f.value.offset]/2,S=(x-B)*100*v.value/a.value[f.value.offset];n.wrapElement[f.value.scroll]=S*n.wrapElement[f.value.scrollSize]/100},y=E=>{E.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",m),document.addEventListener("mouseup",b),d=document.onselectstart,document.onselectstart=()=>!1},m=E=>{if(!a.value||!i.value||u===!1)return;const x=s.value[f.value.axis];if(!x)return;const B=(a.value.getBoundingClientRect()[f.value.direction]-E[f.value.client])*-1,S=i.value[f.value.offset]-x,N=(B-S)*100*v.value/a.value[f.value.offset];n.wrapElement[f.value.scroll]=N*n.wrapElement[f.value.scrollSize]/100},b=()=>{u=!1,s.value[f.value.axis]=0,document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",b),k(),c&&(l.value=!1)},w=()=>{c=!1,l.value=!!e.size},C=()=>{c=!0,l.value=u};o.onBeforeUnmount(()=>{k(),document.removeEventListener("mouseup",b)});const k=()=>{document.onselectstart!==d&&(document.onselectstart=d)};return jt(o.toRef(n,"scrollbarElement"),"mousemove",w),jt(o.toRef(n,"scrollbarElement"),"mouseleave",C),(E,x)=>(o.openBlock(),o.createBlock(o.Transition,{name:o.unref(r).b("fade"),persisted:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{ref_key:"instance",ref:a,class:o.normalizeClass([o.unref(r).e("bar"),o.unref(r).is(o.unref(f).key)]),onMousedown:g},[o.createElementVNode("div",{ref_key:"thumb",ref:i,class:o.normalizeClass(o.unref(r).e("thumb")),style:o.normalizeStyle(o.unref(h)),onMousedown:p},null,38)],34),[[o.vShow,E.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const S2=Ae({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var T2=Te(o.defineComponent({__name:"bar",props:S2,setup(t,{expose:e}){const n=t,r=o.inject(vl),a=o.ref(0),i=o.ref(0),s=o.ref(""),l=o.ref(""),u=o.ref(1),c=o.ref(1);return e({handleScroll:h=>{if(h){const v=h.offsetHeight-ca,p=h.offsetWidth-ca;i.value=h.scrollTop*100/v*u.value,a.value=h.scrollLeft*100/p*c.value}},update:()=>{const h=r==null?void 0:r.wrapElement;if(!h)return;const v=h.offsetHeight-ca,p=h.offsetWidth-ca,g=v**2/h.scrollHeight,y=p**2/h.scrollWidth,m=Math.max(g,n.minSize),b=Math.max(y,n.minSize);u.value=g/(v-g)/(m/(v-m)),c.value=y/(p-y)/(b/(p-b)),l.value=m+ca<v?`${m}px`:"",s.value=b+ca<p?`${b}px`:""}}),(h,v)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(Kd,{move:a.value,ratio:c.value,size:s.value,always:h.always},null,8,["move","ratio","size","always"]),o.createVNode(Kd,{move:i.value,ratio:u.value,size:l.value,vertical:"",always:h.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const B2=Ae({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:ke([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...Jn(["ariaLabel","ariaOrientation"])}),N2={scroll:({scrollTop:t,scrollLeft:e})=>[t,e].every(mt)},gl="ElScrollbar",D2=o.defineComponent({name:gl}),_2=o.defineComponent({...D2,props:B2,emits:N2,setup(t,{expose:e,emit:n}){const r=t,a=Be("scrollbar");let i,s,l=0,u=0;const c=o.ref(),d=o.ref(),f=o.ref(),h=o.ref(),v=o.computed(()=>{const k={};return r.height&&(k.height=ea(r.height)),r.maxHeight&&(k.maxHeight=ea(r.maxHeight)),[r.wrapStyle,k]}),p=o.computed(()=>[r.wrapClass,a.e("wrap"),{[a.em("wrap","hidden-default")]:!r.native}]),g=o.computed(()=>[a.e("view"),r.viewClass]),y=()=>{var k;d.value&&((k=h.value)==null||k.handleScroll(d.value),l=d.value.scrollTop,u=d.value.scrollLeft,n("scroll",{scrollTop:d.value.scrollTop,scrollLeft:d.value.scrollLeft}))};function m(k,E){gt(k)?d.value.scrollTo(k):mt(k)&&mt(E)&&d.value.scrollTo(k,E)}const b=k=>{if(!mt(k)){tt(gl,"value must be a number");return}d.value.scrollTop=k},w=k=>{if(!mt(k)){tt(gl,"value must be a number");return}d.value.scrollLeft=k},C=()=>{var k;(k=h.value)==null||k.update()};return o.watch(()=>r.noresize,k=>{k?(i==null||i(),s==null||s()):({stop:i}=Pn(f,C),s=jt("resize",C))},{immediate:!0}),o.watch(()=>[r.maxHeight,r.height],()=>{r.native||o.nextTick(()=>{var k;C(),d.value&&((k=h.value)==null||k.handleScroll(d.value))})}),o.provide(vl,o.reactive({scrollbarElement:c,wrapElement:d})),o.onActivated(()=>{d.value&&(d.value.scrollTop=l,d.value.scrollLeft=u)}),o.onMounted(()=>{r.native||o.nextTick(()=>{C()})}),o.onUpdated(()=>C()),e({wrapRef:d,update:C,scrollTo:m,setScrollTop:b,setScrollLeft:w,handleScroll:y}),(k,E)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"scrollbarRef",ref:c,class:o.normalizeClass(o.unref(a).b())},[o.createElementVNode("div",{ref_key:"wrapRef",ref:d,class:o.normalizeClass(o.unref(p)),style:o.normalizeStyle(o.unref(v)),tabindex:k.tabindex,onScroll:y},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(k.tag),{id:k.id,ref_key:"resizeRef",ref:f,class:o.normalizeClass(o.unref(g)),style:o.normalizeStyle(k.viewStyle),role:k.role,"aria-label":k.ariaLabel,"aria-orientation":k.ariaOrientation},{default:o.withCtx(()=>[o.renderSlot(k.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),k.native?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(T2,{key:0,ref_key:"barRef",ref:h,always:k.always,"min-size":k.minSize},null,8,["always","min-size"]))],2))}});var P2=Te(_2,[["__file","scrollbar.vue"]]);const O2=ft(P2),ml=Symbol("popper"),qd=Symbol("popperContent"),Ud=Ae({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),I2=o.defineComponent({name:"ElPopper",inheritAttrs:!1}),L2=o.defineComponent({...I2,props:Ud,setup(t,{expose:e}){const n=t,r=o.ref(),a=o.ref(),i=o.ref(),s=o.ref(),l=o.computed(()=>n.role),u={triggerRef:r,popperInstanceRef:a,contentRef:i,referenceRef:s,role:l};return e(u),o.provide(ml,u),(c,d)=>o.renderSlot(c.$slots,"default")}});var M2=Te(L2,[["__file","popper.vue"]]);const Gd=Ae({arrowOffset:{type:Number,default:5}}),F2=o.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),A2=o.defineComponent({...F2,props:Gd,setup(t,{expose:e}){const n=t,r=Be("popper"),{arrowOffset:a,arrowRef:i,arrowStyle:s}=o.inject(qd,void 0);return o.watch(()=>n.arrowOffset,l=>{a.value=l}),o.onBeforeUnmount(()=>{i.value=void 0}),e({arrowRef:i}),(l,u)=>(o.openBlock(),o.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:o.normalizeClass(o.unref(r).e("arrow")),style:o.normalizeStyle(o.unref(s)),"data-popper-arrow":""},null,6))}});var V2=Te(A2,[["__file","arrow.vue"]]);const yl="ElOnlyChild",R2=o.defineComponent({name:yl,setup(t,{slots:e,attrs:n}){var r;const a=o.inject(Pd),i=Xw((r=a==null?void 0:a.setForwardRef)!=null?r:Ha);return()=>{var s;const l=(s=e.default)==null?void 0:s.call(e,n);if(!l)return null;if(l.length>1)return tt(yl,"requires exact only one valid child."),null;const u=Wd(l);return u?o.withDirectives(o.cloneVNode(u,n),[[i]]):(tt(yl,"no valid child node found"),null)}}});function Wd(t){if(!t)return null;const e=t;for(const n of e){if(gt(n))switch(n.type){case o.Comment:continue;case o.Text:case"svg":return jd(n);case o.Fragment:return Wd(n.children);default:return n}return jd(n)}return null}function jd(t){const e=Be("only-child");return o.createVNode("span",{class:e.e("content")},[t])}const Yd=Ae({virtualRef:{type:ke(Object)},virtualTriggering:Boolean,onMouseenter:{type:ke(Function)},onMouseleave:{type:ke(Function)},onClick:{type:ke(Function)},onKeydown:{type:ke(Function)},onFocus:{type:ke(Function)},onBlur:{type:ke(Function)},onContextmenu:{type:ke(Function)},id:String,open:Boolean}),$2=o.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),z2=o.defineComponent({...$2,props:Yd,setup(t,{expose:e}){const n=t,{role:r,triggerRef:a}=o.inject(ml,void 0);Zw(a);const i=o.computed(()=>l.value?n.id:void 0),s=o.computed(()=>{if(r&&r.value==="tooltip")return n.open&&n.id?n.id:void 0}),l=o.computed(()=>{if(r&&r.value!=="tooltip")return r.value}),u=o.computed(()=>l.value?`${n.open}`:void 0);let c;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return o.onMounted(()=>{o.watch(()=>n.virtualRef,f=>{f&&(a.value=_n(f))},{immediate:!0}),o.watch(a,(f,h)=>{c==null||c(),c=void 0,Er(f)&&(d.forEach(v=>{var p;const g=n[v];g&&(f.addEventListener(v.slice(2).toLowerCase(),g),(p=h==null?void 0:h.removeEventListener)==null||p.call(h,v.slice(2).toLowerCase(),g))}),c=o.watch([i,s,l,u],v=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((p,g)=>{Yn(v[g])?f.removeAttribute(p):f.setAttribute(p,v[g])})},{immediate:!0})),Er(h)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(v=>h.removeAttribute(v))},{immediate:!0})}),o.onBeforeUnmount(()=>{if(c==null||c(),c=void 0,a.value&&Er(a.value)){const f=a.value;d.forEach(h=>{const v=n[h];v&&f.removeEventListener(h.slice(2).toLowerCase(),v)}),a.value=void 0}}),e({triggerRef:a}),(f,h)=>f.virtualTriggering?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(o.unref(R2),o.mergeProps({key:0},f.$attrs,{"aria-controls":o.unref(i),"aria-describedby":o.unref(s),"aria-expanded":o.unref(u),"aria-haspopup":o.unref(l)}),{default:o.withCtx(()=>[o.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var H2=Te(z2,[["__file","trigger.vue"]]);const bl="focus-trap.focus-after-trapped",wl="focus-trap.focus-after-released",K2="focus-trap.focusout-prevented",Zd={cancelable:!0,bubbles:!1},q2={cancelable:!0,bubbles:!1},Xd="focusAfterTrapped",Qd="focusAfterReleased",U2=Symbol("elFocusTrap"),Cl=o.ref(),xo=o.ref(0),kl=o.ref(0);let Eo=0;const Jd=t=>{const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0||r===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e},ef=(t,e)=>{for(const n of t)if(!G2(n,e))return n},G2=(t,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1},W2=t=>{const e=Jd(t),n=ef(e,t),r=ef(e.reverse(),t);return[n,r]},j2=t=>t instanceof HTMLInputElement&&"select"in t,er=(t,e)=>{if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),kl.value=window.performance.now(),t!==n&&j2(t)&&e&&t.select()}};function tf(t,e){const n=[...t],r=t.indexOf(e);return r!==-1&&n.splice(r,1),n}const Y2=()=>{let t=[];return{push:r=>{const a=t[0];a&&r!==a&&a.pause(),t=tf(t,r),t.unshift(r)},remove:r=>{var a,i;t=tf(t,r),(i=(a=t[0])==null?void 0:a.resume)==null||i.call(a)}}},Z2=(t,e=!1)=>{const n=document.activeElement;for(const r of t)if(er(r,e),document.activeElement!==n)return},nf=Y2(),X2=()=>xo.value>kl.value,So=()=>{Cl.value="pointer",xo.value=window.performance.now()},rf=()=>{Cl.value="keyboard",xo.value=window.performance.now()},Q2=()=>(o.onMounted(()=>{Eo===0&&(document.addEventListener("mousedown",So),document.addEventListener("touchstart",So),document.addEventListener("keydown",rf)),Eo++}),o.onBeforeUnmount(()=>{Eo--,Eo<=0&&(document.removeEventListener("mousedown",So),document.removeEventListener("touchstart",So),document.removeEventListener("keydown",rf))}),{focusReason:Cl,lastUserFocusTimestamp:xo,lastAutomatedFocusTimestamp:kl}),To=t=>new CustomEvent(K2,{...q2,detail:t}),J2=o.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Xd,Qd,"focusin","focusout","focusout-prevented","release-requested"],setup(t,{emit:e}){const n=o.ref();let r,a;const{focusReason:i}=Q2();Uw(p=>{t.trapped&&!s.paused&&e("release-requested",p)});const s={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=p=>{if(!t.loop&&!t.trapped||s.paused)return;const{key:g,altKey:y,ctrlKey:m,metaKey:b,currentTarget:w,shiftKey:C}=p,{loop:k}=t,E=g===it.tab&&!y&&!m&&!b,x=document.activeElement;if(E&&x){const B=w,[S,N]=W2(B);if(S&&N){if(!C&&x===N){const _=To({focusReason:i.value});e("focusout-prevented",_),_.defaultPrevented||(p.preventDefault(),k&&er(S,!0))}else if(C&&[S,B].includes(x)){const _=To({focusReason:i.value});e("focusout-prevented",_),_.defaultPrevented||(p.preventDefault(),k&&er(N,!0))}}else if(x===B){const _=To({focusReason:i.value});e("focusout-prevented",_),_.defaultPrevented||p.preventDefault()}}};o.provide(U2,{focusTrapRef:n,onKeydown:l}),o.watch(()=>t.focusTrapEl,p=>{p&&(n.value=p)},{immediate:!0}),o.watch([n],([p],[g])=>{p&&(p.addEventListener("keydown",l),p.addEventListener("focusin",d),p.addEventListener("focusout",f)),g&&(g.removeEventListener("keydown",l),g.removeEventListener("focusin",d),g.removeEventListener("focusout",f))});const u=p=>{e(Xd,p)},c=p=>e(Qd,p),d=p=>{const g=o.unref(n);if(!g)return;const y=p.target,m=p.relatedTarget,b=y&&g.contains(y);t.trapped||m&&g.contains(m)||(r=m),b&&e("focusin",p),!s.paused&&t.trapped&&(b?a=y:er(a,!0))},f=p=>{const g=o.unref(n);if(!(s.paused||!g))if(t.trapped){const y=p.relatedTarget;!Yn(y)&&!g.contains(y)&&setTimeout(()=>{if(!s.paused&&t.trapped){const m=To({focusReason:i.value});e("focusout-prevented",m),m.defaultPrevented||er(a,!0)}},0)}else{const y=p.target;y&&g.contains(y)||e("focusout",p)}};async function h(){await o.nextTick();const p=o.unref(n);if(p){nf.push(s);const g=p.contains(document.activeElement)?r:document.activeElement;if(r=g,!p.contains(g)){const m=new Event(bl,Zd);p.addEventListener(bl,u),p.dispatchEvent(m),m.defaultPrevented||o.nextTick(()=>{let b=t.focusStartEl;St(b)||(er(b),document.activeElement!==b&&(b="first")),b==="first"&&Z2(Jd(p),!0),(document.activeElement===g||b==="container")&&er(p)})}}}function v(){const p=o.unref(n);if(p){p.removeEventListener(bl,u);const g=new CustomEvent(wl,{...Zd,detail:{focusReason:i.value}});p.addEventListener(wl,c),p.dispatchEvent(g),!g.defaultPrevented&&(i.value=="keyboard"||!X2()||p.contains(document.activeElement))&&er(r??document.body),p.removeEventListener(wl,c),nf.remove(s)}}return o.onMounted(()=>{t.trapped&&h(),o.watch(()=>t.trapped,p=>{p?h():v()})}),o.onBeforeUnmount(()=>{t.trapped&&v(),n.value&&(n.value.removeEventListener("keydown",l),n.value.removeEventListener("focusin",d),n.value.removeEventListener("focusout",f),n.value=void 0)}),{onKeydown:l}}});function eC(t,e,n,r,a,i){return o.renderSlot(t.$slots,"default",{handleKeydown:t.onKeydown})}var tC=Te(J2,[["render",eC],["__file","focus-trap.vue"]]);const nC=["fixed","absolute"],rC=Ae({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:ke(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:go,default:"bottom"},popperOptions:{type:ke(Object),default:()=>({})},strategy:{type:String,values:nC,default:"absolute"}}),af=Ae({...rC,id:String,style:{type:ke([String,Array,Object])},className:{type:ke([String,Array,Object])},effect:{type:ke(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:ke([String,Array,Object])},popperStyle:{type:ke([String,Array,Object])},referenceEl:{type:ke(Object)},triggerTargetEl:{type:ke(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Jn(["ariaLabel"])}),aC={mouseenter:t=>t instanceof MouseEvent,mouseleave:t=>t instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},iC=(t,e=[])=>{const{placement:n,strategy:r,popperOptions:a}=t,i={placement:n,strategy:r,...a,modifiers:[...sC(t),...e]};return lC(i,a==null?void 0:a.modifiers),i},oC=t=>{if(et)return _n(t)};function sC(t){const{offset:e,gpuAcceleration:n,fallbackPlacements:r}=t;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:r}},{name:"computeStyles",options:{gpuAcceleration:n}}]}function lC(t,e){e&&(t.modifiers=[...t.modifiers,...e??[]])}const cC=0,uC=t=>{const{popperInstanceRef:e,contentRef:n,triggerRef:r,role:a}=o.inject(ml,void 0),i=o.ref(),s=o.ref(),l=o.computed(()=>({name:"eventListeners",enabled:!!t.visible})),u=o.computed(()=>{var m;const b=o.unref(i),w=(m=o.unref(s))!=null?m:cC;return{name:"arrow",enabled:!R1(b),options:{element:b,padding:w}}}),c=o.computed(()=>({onFirstUpdate:()=>{p()},...iC(t,[o.unref(u),o.unref(l)])})),d=o.computed(()=>oC(t.referenceEl)||o.unref(r)),{attributes:f,state:h,styles:v,update:p,forceUpdate:g,instanceRef:y}=Hw(d,n,c);return o.watch(y,m=>e.value=m),o.onMounted(()=>{o.watch(()=>{var m;return(m=o.unref(d))==null?void 0:m.getBoundingClientRect()},()=>{p()})}),{attributes:f,arrowRef:i,contentRef:n,instanceRef:y,state:h,styles:v,role:a,forceUpdate:g,update:p}},dC=(t,{attributes:e,styles:n,role:r})=>{const{nextZIndex:a}=Ad(),i=Be("popper"),s=o.computed(()=>o.unref(e).popper),l=o.ref(mt(t.zIndex)?t.zIndex:a()),u=o.computed(()=>[i.b(),i.is("pure",t.pure),i.is(t.effect),t.popperClass]),c=o.computed(()=>[{zIndex:o.unref(l)},o.unref(n).popper,t.popperStyle||{}]),d=o.computed(()=>r.value==="dialog"?"false":void 0),f=o.computed(()=>o.unref(n).arrow||{});return{ariaModal:d,arrowStyle:f,contentAttrs:s,contentClass:u,contentStyle:c,contentZIndex:l,updateZIndex:()=>{l.value=mt(t.zIndex)?t.zIndex:a()}}},fC=(t,e)=>{const n=o.ref(!1),r=o.ref();return{focusStartRef:r,trapped:n,onFocusAfterReleased:c=>{var d;((d=c.detail)==null?void 0:d.focusReason)!=="pointer"&&(r.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:c=>{t.visible&&!n.value&&(c.target&&(r.value=c.target),n.value=!0)},onFocusoutPrevented:c=>{t.trapping||(c.detail.focusReason==="pointer"&&c.preventDefault(),n.value=!1)},onReleaseRequested:()=>{n.value=!1,e("close")}}},hC=o.defineComponent({name:"ElPopperContent"}),pC=o.defineComponent({...hC,props:af,emits:aC,setup(t,{expose:e,emit:n}){const r=t,{focusStartRef:a,trapped:i,onFocusAfterReleased:s,onFocusAfterTrapped:l,onFocusInTrap:u,onFocusoutPrevented:c,onReleaseRequested:d}=fC(r,n),{attributes:f,arrowRef:h,contentRef:v,styles:p,instanceRef:g,role:y,update:m}=uC(r),{ariaModal:b,arrowStyle:w,contentAttrs:C,contentClass:k,contentStyle:E,updateZIndex:x}=dC(r,{styles:p,attributes:f,role:y}),B=o.inject(ai,void 0),S=o.ref();o.provide(qd,{arrowStyle:w,arrowRef:h,arrowOffset:S}),B&&o.provide(ai,{...B,addInputId:Ha,removeInputId:Ha});let N;const D=(I=!0)=>{m(),I&&x()},_=()=>{D(!1),r.visible&&r.focusOnShow?i.value=!0:r.visible===!1&&(i.value=!1)};return o.onMounted(()=>{o.watch(()=>r.triggerTargetEl,(I,P)=>{N==null||N(),N=void 0;const F=o.unref(I||v.value),O=o.unref(P||v.value);Er(F)&&(N=o.watch([y,()=>r.ariaLabel,b,()=>r.id],M=>{["role","aria-label","aria-modal","id"].forEach((L,V)=>{Yn(M[V])?F.removeAttribute(L):F.setAttribute(L,M[V])})},{immediate:!0})),O!==F&&Er(O)&&["role","aria-label","aria-modal","id"].forEach(M=>{O.removeAttribute(M)})},{immediate:!0}),o.watch(()=>r.visible,_,{immediate:!0})}),o.onBeforeUnmount(()=>{N==null||N(),N=void 0}),e({popperContentRef:v,popperInstanceRef:g,updatePopper:D,contentStyle:E}),(I,P)=>(o.openBlock(),o.createElementBlock("div",o.mergeProps({ref_key:"contentRef",ref:v},o.unref(C),{style:o.unref(E),class:o.unref(k),tabindex:"-1",onMouseenter:F=>I.$emit("mouseenter",F),onMouseleave:F=>I.$emit("mouseleave",F)}),[o.createVNode(o.unref(tC),{trapped:o.unref(i),"trap-on-focus-in":!0,"focus-trap-el":o.unref(v),"focus-start-el":o.unref(a),onFocusAfterTrapped:o.unref(l),onFocusAfterReleased:o.unref(s),onFocusin:o.unref(u),onFocusoutPrevented:o.unref(c),onReleaseRequested:o.unref(d)},{default:o.withCtx(()=>[o.renderSlot(I.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var vC=Te(pC,[["__file","content.vue"]]);const gC=ft(M2),xl=Symbol("elTooltip"),$t=Ae({...jw,...af,appendTo:{type:ke([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:ke(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Jn(["ariaLabel"])}),li=Ae({...Yd,disabled:Boolean,trigger:{type:ke([String,Array]),default:"hover"},triggerKeys:{type:ke(Array),default:()=>[it.enter,it.space]}}),{useModelToggleProps:mC,useModelToggleEmits:yC,useModelToggle:bC}=Rb("visible"),wC=Ae({...Ud,...mC,...$t,...li,...Gd,showArrow:{type:Boolean,default:!0}}),CC=[...yC,"before-show","before-hide","show","hide","open","close"],kC=(t,e)=>At(t)?t.includes(e):t===e,ua=(t,e,n)=>r=>{kC(o.unref(t),e)&&n(r)},xC=o.defineComponent({name:"ElTooltipTrigger"}),EC=o.defineComponent({...xC,props:li,setup(t,{expose:e}){const n=t,r=Be("tooltip"),{controlled:a,id:i,open:s,onOpen:l,onClose:u,onToggle:c}=o.inject(xl,void 0),d=o.ref(null),f=()=>{if(o.unref(a)||n.disabled)return!0},h=o.toRef(n,"trigger"),v=Ft(f,ua(h,"hover",l)),p=Ft(f,ua(h,"hover",u)),g=Ft(f,ua(h,"click",C=>{C.button===0&&c(C)})),y=Ft(f,ua(h,"focus",l)),m=Ft(f,ua(h,"focus",u)),b=Ft(f,ua(h,"contextmenu",C=>{C.preventDefault(),c(C)})),w=Ft(f,C=>{const{code:k}=C;n.triggerKeys.includes(k)&&(C.preventDefault(),c(C))});return e({triggerRef:d}),(C,k)=>(o.openBlock(),o.createBlock(o.unref(H2),{id:o.unref(i),"virtual-ref":C.virtualRef,open:o.unref(s),"virtual-triggering":C.virtualTriggering,class:o.normalizeClass(o.unref(r).e("trigger")),onBlur:o.unref(m),onClick:o.unref(g),onContextmenu:o.unref(b),onFocus:o.unref(y),onMouseenter:o.unref(v),onMouseleave:o.unref(p),onKeydown:o.unref(w)},{default:o.withCtx(()=>[o.renderSlot(C.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var SC=Te(EC,[["__file","trigger.vue"]]);const TC=Ae({to:{type:ke([String,Object]),required:!0},disabled:Boolean});var BC=Te(o.defineComponent({__name:"teleport",props:TC,setup(t){return(e,n)=>e.disabled?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createBlock(o.Teleport,{key:1,to:e.to},[o.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const NC=ft(BC),DC=o.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),_C=o.defineComponent({...DC,props:$t,setup(t,{expose:e}){const n=t,{selector:r}=_d(),a=Be("tooltip"),i=o.ref(null);let s;const{controlled:l,id:u,open:c,trigger:d,onClose:f,onOpen:h,onShow:v,onHide:p,onBeforeShow:g,onBeforeHide:y}=o.inject(xl,void 0),m=o.computed(()=>n.transition||`${a.namespace.value}-fade-in-linear`),b=o.computed(()=>process.env.NODE_ENV==="test"?!0:n.persistent);o.onBeforeUnmount(()=>{s==null||s()});const w=o.computed(()=>o.unref(b)?!0:o.unref(c)),C=o.computed(()=>n.disabled?!1:o.unref(c)),k=o.computed(()=>n.appendTo||r.value),E=o.computed(()=>{var O;return(O=n.style)!=null?O:{}}),x=o.ref(!0),B=()=>{p(),x.value=!0},S=()=>{if(o.unref(l))return!0},N=Ft(S,()=>{n.enterable&&o.unref(d)==="hover"&&h()}),D=Ft(S,()=>{o.unref(d)==="hover"&&f()}),_=()=>{var O,M;(M=(O=i.value)==null?void 0:O.updatePopper)==null||M.call(O),g==null||g()},I=()=>{y==null||y()},P=()=>{v(),s=Ig(o.computed(()=>{var O;return(O=i.value)==null?void 0:O.popperContentRef}),()=>{if(o.unref(l))return;o.unref(d)!=="hover"&&f()})},F=()=>{n.virtualTriggering||f()};return o.watch(()=>o.unref(c),O=>{O?x.value=!1:s==null||s()},{flush:"post"}),o.watch(()=>n.content,()=>{var O,M;(M=(O=i.value)==null?void 0:O.updatePopper)==null||M.call(O)}),e({contentRef:i}),(O,M)=>(o.openBlock(),o.createBlock(o.unref(NC),{disabled:!O.teleported,to:o.unref(k)},{default:o.withCtx(()=>[o.createVNode(o.Transition,{name:o.unref(m),onAfterLeave:B,onBeforeEnter:_,onAfterEnter:P,onBeforeLeave:I},{default:o.withCtx(()=>[o.unref(w)?o.withDirectives((o.openBlock(),o.createBlock(o.unref(vC),o.mergeProps({key:0,id:o.unref(u),ref_key:"contentRef",ref:i},O.$attrs,{"aria-label":O.ariaLabel,"aria-hidden":x.value,"boundaries-padding":O.boundariesPadding,"fallback-placements":O.fallbackPlacements,"gpu-acceleration":O.gpuAcceleration,offset:O.offset,placement:O.placement,"popper-options":O.popperOptions,strategy:O.strategy,effect:O.effect,enterable:O.enterable,pure:O.pure,"popper-class":O.popperClass,"popper-style":[O.popperStyle,o.unref(E)],"reference-el":O.referenceEl,"trigger-target-el":O.triggerTargetEl,visible:o.unref(C),"z-index":O.zIndex,onMouseenter:o.unref(N),onMouseleave:o.unref(D),onBlur:F,onClose:o.unref(f)}),{default:o.withCtx(()=>[o.renderSlot(O.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[o.vShow,o.unref(C)]]):o.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var PC=Te(_C,[["__file","content.vue"]]);const OC=o.defineComponent({name:"ElTooltip"}),IC=o.defineComponent({...OC,props:wC,emits:CC,setup(t,{expose:e,emit:n}){const r=t;Ww();const a=Co(),i=o.ref(),s=o.ref(),l=()=>{var m;const b=o.unref(i);b&&((m=b.popperInstanceRef)==null||m.update())},u=o.ref(!1),c=o.ref(),{show:d,hide:f,hasUpdateHandler:h}=bC({indicator:u,toggleReason:c}),{onOpen:v,onClose:p}=Yw({showAfter:o.toRef(r,"showAfter"),hideAfter:o.toRef(r,"hideAfter"),autoClose:o.toRef(r,"autoClose"),open:d,close:f}),g=o.computed(()=>Jr(r.visible)&&!h.value);o.provide(xl,{controlled:g,id:a,open:o.readonly(u),trigger:o.toRef(r,"trigger"),onOpen:m=>{v(m)},onClose:m=>{p(m)},onToggle:m=>{o.unref(u)?p(m):v(m)},onShow:()=>{n("show",c.value)},onHide:()=>{n("hide",c.value)},onBeforeShow:()=>{n("before-show",c.value)},onBeforeHide:()=>{n("before-hide",c.value)},updatePopper:l}),o.watch(()=>r.disabled,m=>{m&&u.value&&(u.value=!1)});const y=m=>{var b,w;const C=(w=(b=s.value)==null?void 0:b.contentRef)==null?void 0:w.popperContentRef,k=(m==null?void 0:m.relatedTarget)||document.activeElement;return C&&C.contains(k)};return o.onDeactivated(()=>u.value&&f()),e({popperRef:i,contentRef:s,isFocusInsideContent:y,updatePopper:l,onOpen:v,onClose:p,hide:f}),(m,b)=>(o.openBlock(),o.createBlock(o.unref(gC),{ref_key:"popperRef",ref:i,role:m.role},{default:o.withCtx(()=>[o.createVNode(SC,{disabled:m.disabled,trigger:m.trigger,"trigger-keys":m.triggerKeys,"virtual-ref":m.virtualRef,"virtual-triggering":m.virtualTriggering},{default:o.withCtx(()=>[m.$slots.default?o.renderSlot(m.$slots,"default",{key:0}):o.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),o.createVNode(PC,{ref_key:"contentRef",ref:s,"aria-label":m.ariaLabel,"boundaries-padding":m.boundariesPadding,content:m.content,disabled:m.disabled,effect:m.effect,enterable:m.enterable,"fallback-placements":m.fallbackPlacements,"hide-after":m.hideAfter,"gpu-acceleration":m.gpuAcceleration,offset:m.offset,persistent:m.persistent,"popper-class":m.popperClass,"popper-style":m.popperStyle,placement:m.placement,"popper-options":m.popperOptions,pure:m.pure,"raw-content":m.rawContent,"reference-el":m.referenceEl,"trigger-target-el":m.triggerTargetEl,"show-after":m.showAfter,strategy:m.strategy,teleported:m.teleported,transition:m.transition,"virtual-triggering":m.virtualTriggering,"z-index":m.zIndex,"append-to":m.appendTo},{default:o.withCtx(()=>[o.renderSlot(m.$slots,"content",{},()=>[m.rawContent?(o.openBlock(),o.createElementBlock("span",{key:0,innerHTML:m.content},null,8,["innerHTML"])):(o.openBlock(),o.createElementBlock("span",{key:1},o.toDisplayString(m.content),1))]),m.showArrow?(o.openBlock(),o.createBlock(o.unref(V2),{key:0,"arrow-offset":m.arrowOffset},null,8,["arrow-offset"])):o.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var LC=Te(IC,[["__file","tooltip.vue"]]);const ci=ft(LC),of=Symbol("buttonGroupContextKey"),MC=(t,e)=>{po({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},o.computed(()=>t.type==="text"));const n=o.inject(of,void 0),r=hl("button"),{form:a}=Dr(),i=Nr(o.computed(()=>n==null?void 0:n.size)),s=ii(),l=o.ref(),u=o.useSlots(),c=o.computed(()=>t.type||(n==null?void 0:n.type)||""),d=o.computed(()=>{var p,g,y;return(y=(g=t.autoInsertSpace)!=null?g:(p=r.value)==null?void 0:p.autoInsertSpace)!=null?y:!1}),f=o.computed(()=>t.tag==="button"?{ariaDisabled:s.value||t.loading,disabled:s.value||t.loading,autofocus:t.autofocus,type:t.nativeType}:{}),h=o.computed(()=>{var p;const g=(p=u.default)==null?void 0:p.call(u);if(d.value&&(g==null?void 0:g.length)===1){const y=g[0];if((y==null?void 0:y.type)===o.Text){const m=y.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(m.trim())}}return!1});return{_disabled:s,_size:i,_type:c,_ref:l,_props:f,shouldAddSpace:h,handleClick:p=>{if(s.value||t.loading){p.stopPropagation();return}t.nativeType==="reset"&&(a==null||a.resetFields()),e("click",p)}}},El=Ae({size:la,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Xn},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Xn,default:()=>Js},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:ke([String,Object]),default:"button"}}),FC={click:t=>t instanceof MouseEvent};function bt(t,e){AC(t)&&(t="100%");var n=VC(t);return t=e===360?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:(e===360?t=(t<0?t%e+e:t%e)/parseFloat(String(e)):t=t%e/parseFloat(String(e)),t)}function Bo(t){return Math.min(1,Math.max(0,t))}function AC(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function VC(t){return typeof t=="string"&&t.indexOf("%")!==-1}function sf(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function No(t){return t<=1?"".concat(Number(t)*100,"%"):t}function _r(t){return t.length===1?"0"+t:String(t)}function RC(t,e,n){return{r:bt(t,255)*255,g:bt(e,255)*255,b:bt(n,255)*255}}function lf(t,e,n){t=bt(t,255),e=bt(e,255),n=bt(n,255);var r=Math.max(t,e,n),a=Math.min(t,e,n),i=0,s=0,l=(r+a)/2;if(r===a)s=0,i=0;else{var u=r-a;switch(s=l>.5?u/(2-r-a):u/(r+a),r){case t:i=(e-n)/u+(e<n?6:0);break;case e:i=(n-t)/u+2;break;case n:i=(t-e)/u+4;break}i/=6}return{h:i,s,l}}function Sl(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*(6*n):n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function $C(t,e,n){var r,a,i;if(t=bt(t,360),e=bt(e,100),n=bt(n,100),e===0)a=n,i=n,r=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;r=Sl(l,s,t+1/3),a=Sl(l,s,t),i=Sl(l,s,t-1/3)}return{r:r*255,g:a*255,b:i*255}}function cf(t,e,n){t=bt(t,255),e=bt(e,255),n=bt(n,255);var r=Math.max(t,e,n),a=Math.min(t,e,n),i=0,s=r,l=r-a,u=r===0?0:l/r;if(r===a)i=0;else{switch(r){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4;break}i/=6}return{h:i,s:u,v:s}}function zC(t,e,n){t=bt(t,360)*6,e=bt(e,100),n=bt(n,100);var r=Math.floor(t),a=t-r,i=n*(1-e),s=n*(1-a*e),l=n*(1-(1-a)*e),u=r%6,c=[n,s,i,i,l,n][u],d=[l,n,n,s,i,i][u],f=[i,i,l,n,n,s][u];return{r:c*255,g:d*255,b:f*255}}function uf(t,e,n,r){var a=[_r(Math.round(t).toString(16)),_r(Math.round(e).toString(16)),_r(Math.round(n).toString(16))];return r&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function HC(t,e,n,r,a){var i=[_r(Math.round(t).toString(16)),_r(Math.round(e).toString(16)),_r(Math.round(n).toString(16)),_r(KC(r))];return a&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function KC(t){return Math.round(parseFloat(t)*255).toString(16)}function df(t){return qt(t)/255}function qt(t){return parseInt(t,16)}function qC(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var Tl={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function UC(t){var e={r:0,g:0,b:0},n=1,r=null,a=null,i=null,s=!1,l=!1;return typeof t=="string"&&(t=jC(t)),typeof t=="object"&&(Vn(t.r)&&Vn(t.g)&&Vn(t.b)?(e=RC(t.r,t.g,t.b),s=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Vn(t.h)&&Vn(t.s)&&Vn(t.v)?(r=No(t.s),a=No(t.v),e=zC(t.h,r,a),s=!0,l="hsv"):Vn(t.h)&&Vn(t.s)&&Vn(t.l)&&(r=No(t.s),i=No(t.l),e=$C(t.h,r,i),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(n=t.a)),n=sf(n),{ok:s,format:t.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}var GC="[-\\+]?\\d+%?",WC="[-\\+]?\\d*\\.\\d+%?",tr="(?:".concat(WC,")|(?:").concat(GC,")"),Bl="[\\s|\\(]+(".concat(tr,")[,|\\s]+(").concat(tr,")[,|\\s]+(").concat(tr,")\\s*\\)?"),Nl="[\\s|\\(]+(".concat(tr,")[,|\\s]+(").concat(tr,")[,|\\s]+(").concat(tr,")[,|\\s]+(").concat(tr,")\\s*\\)?"),un={CSS_UNIT:new RegExp(tr),rgb:new RegExp("rgb"+Bl),rgba:new RegExp("rgba"+Nl),hsl:new RegExp("hsl"+Bl),hsla:new RegExp("hsla"+Nl),hsv:new RegExp("hsv"+Bl),hsva:new RegExp("hsva"+Nl),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function jC(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(Tl[t])t=Tl[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=un.rgb.exec(t);return n?{r:n[1],g:n[2],b:n[3]}:(n=un.rgba.exec(t),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=un.hsl.exec(t),n?{h:n[1],s:n[2],l:n[3]}:(n=un.hsla.exec(t),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=un.hsv.exec(t),n?{h:n[1],s:n[2],v:n[3]}:(n=un.hsva.exec(t),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=un.hex8.exec(t),n?{r:qt(n[1]),g:qt(n[2]),b:qt(n[3]),a:df(n[4]),format:e?"name":"hex8"}:(n=un.hex6.exec(t),n?{r:qt(n[1]),g:qt(n[2]),b:qt(n[3]),format:e?"name":"hex"}:(n=un.hex4.exec(t),n?{r:qt(n[1]+n[1]),g:qt(n[2]+n[2]),b:qt(n[3]+n[3]),a:df(n[4]+n[4]),format:e?"name":"hex8"}:(n=un.hex3.exec(t),n?{r:qt(n[1]+n[1]),g:qt(n[2]+n[2]),b:qt(n[3]+n[3]),format:e?"name":"hex"}:!1)))))))))}function Vn(t){return!!un.CSS_UNIT.exec(String(t))}var YC=function(){function t(e,n){e===void 0&&(e=""),n===void 0&&(n={});var r;if(e instanceof t)return e;typeof e=="number"&&(e=qC(e)),this.originalInput=e;var a=UC(e);this.originalInput=e,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:a.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=a.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},t.prototype.getLuminance=function(){var e=this.toRgb(),n,r,a,i=e.r/255,s=e.g/255,l=e.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),s<=.03928?r=s/12.92:r=Math.pow((s+.055)/1.055,2.4),l<=.03928?a=l/12.92:a=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*r+.0722*a},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(e){return this.a=sf(e),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},t.prototype.toHsv=function(){var e=cf(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},t.prototype.toHsvString=function(){var e=cf(this.r,this.g,this.b),n=Math.round(e.h*360),r=Math.round(e.s*100),a=Math.round(e.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(a,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(a,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var e=lf(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},t.prototype.toHslString=function(){var e=lf(this.r,this.g,this.b),n=Math.round(e.h*360),r=Math.round(e.s*100),a=Math.round(e.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(a,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(a,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(e){return e===void 0&&(e=!1),uf(this.r,this.g,this.b,e)},t.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},t.prototype.toHex8=function(e){return e===void 0&&(e=!1),HC(this.r,this.g,this.b,this.a,e)},t.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},t.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var e=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(n,", ").concat(r,")"):"rgba(".concat(e,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var e=function(n){return"".concat(Math.round(bt(n,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var e=function(n){return Math.round(bt(n,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+uf(this.r,this.g,this.b,!1),n=0,r=Object.entries(Tl);n<r.length;n++){var a=r[n],i=a[0],s=a[1];if(e===s)return i}return!1},t.prototype.toString=function(e){var n=!!e;e=e??this.format;var r=!1,a=this.a<1&&this.a>=0,i=!n&&a&&(e.startsWith("hex")||e==="name");return i?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l+=e/100,n.l=Bo(n.l),new t(n)},t.prototype.brighten=function(e){e===void 0&&(e=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(e/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(e/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(e/100)))),new t(n)},t.prototype.darken=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l-=e/100,n.l=Bo(n.l),new t(n)},t.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},t.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},t.prototype.desaturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s-=e/100,n.s=Bo(n.s),new t(n)},t.prototype.saturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s+=e/100,n.s=Bo(n.s),new t(n)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var n=this.toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,new t(n)},t.prototype.mix=function(e,n){n===void 0&&(n=50);var r=this.toRgb(),a=new t(e).toRgb(),i=n/100,s={r:(a.r-r.r)*i+r.r,g:(a.g-r.g)*i+r.g,b:(a.b-r.b)*i+r.b,a:(a.a-r.a)*i+r.a};return new t(s)},t.prototype.analogous=function(e,n){e===void 0&&(e=6),n===void 0&&(n=30);var r=this.toHsl(),a=360/n,i=[this];for(r.h=(r.h-(a*e>>1)+720)%360;--e;)r.h=(r.h+a)%360,i.push(new t(r));return i},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var n=this.toHsv(),r=n.h,a=n.s,i=n.v,s=[],l=1/e;e--;)s.push(new t({h:r,s:a,v:i})),i=(i+l)%1;return s},t.prototype.splitcomplement=function(){var e=this.toHsl(),n=e.h;return[this,new t({h:(n+72)%360,s:e.s,l:e.l}),new t({h:(n+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var n=this.toRgb(),r=new t(e).toRgb(),a=n.a+r.a*(1-n.a);return new t({r:(n.r*n.a+r.r*r.a*(1-n.a))/a,g:(n.g*n.a+r.g*r.a*(1-n.a))/a,b:(n.b*n.a+r.b*r.a*(1-n.a))/a,a})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var n=this.toHsl(),r=n.h,a=[this],i=360/e,s=1;s<e;s++)a.push(new t({h:(r+s*i)%360,s:n.s,l:n.l}));return a},t.prototype.equals=function(e){return this.toRgbString()===new t(e).toRgbString()},t}();function nr(t,e=20){return t.mix("#141414",e).toString()}function ZC(t){const e=ii(),n=Be("button");return o.computed(()=>{let r={},a=t.color;if(a){const i=a.match(/var\((.*?)\)/);i&&(a=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const s=new YC(a),l=t.dark?s.tint(20).toString():nr(s,20);if(t.plain)r=n.cssVarBlock({"bg-color":t.dark?nr(s,90):s.tint(90).toString(),"text-color":a,"border-color":t.dark?nr(s,50):s.tint(50).toString(),"hover-text-color":`var(${n.cssVarName("color-white")})`,"hover-bg-color":a,"hover-border-color":a,"active-bg-color":l,"active-text-color":`var(${n.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(r[n.cssVarBlockName("disabled-bg-color")]=t.dark?nr(s,90):s.tint(90).toString(),r[n.cssVarBlockName("disabled-text-color")]=t.dark?nr(s,50):s.tint(50).toString(),r[n.cssVarBlockName("disabled-border-color")]=t.dark?nr(s,80):s.tint(80).toString());else{const u=t.dark?nr(s,30):s.tint(30).toString(),c=s.isDark()?`var(${n.cssVarName("color-white")})`:`var(${n.cssVarName("color-black")})`;if(r=n.cssVarBlock({"bg-color":a,"text-color":c,"border-color":a,"hover-bg-color":u,"hover-text-color":c,"hover-border-color":u,"active-bg-color":l,"active-border-color":l}),e.value){const d=t.dark?nr(s,50):s.tint(50).toString();r[n.cssVarBlockName("disabled-bg-color")]=d,r[n.cssVarBlockName("disabled-text-color")]=t.dark?"rgba(255, 255, 255, 0.5)":`var(${n.cssVarName("color-white")})`,r[n.cssVarBlockName("disabled-border-color")]=d}}}return r})}const XC=o.defineComponent({name:"ElButton"}),QC=o.defineComponent({...XC,props:El,emits:FC,setup(t,{expose:e,emit:n}){const r=t,a=ZC(r),i=Be("button"),{_ref:s,_size:l,_type:u,_disabled:c,_props:d,shouldAddSpace:f,handleClick:h}=MC(r,n),v=o.computed(()=>[i.b(),i.m(u.value),i.m(l.value),i.is("disabled",c.value),i.is("loading",r.loading),i.is("plain",r.plain),i.is("round",r.round),i.is("circle",r.circle),i.is("text",r.text),i.is("link",r.link),i.is("has-bg",r.bg)]);return e({ref:s,size:l,type:u,disabled:c,shouldAddSpace:f}),(p,g)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.tag),o.mergeProps({ref_key:"_ref",ref:s},o.unref(d),{class:o.unref(v),style:o.unref(a),onClick:o.unref(h)}),{default:o.withCtx(()=>[p.loading?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[p.$slots.loading?o.renderSlot(p.$slots,"loading",{key:0}):(o.openBlock(),o.createBlock(o.unref(ot),{key:1,class:o.normalizeClass(o.unref(i).is("loading"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.loadingIcon)))]),_:1},8,["class"]))],64)):p.icon||p.$slots.icon?(o.openBlock(),o.createBlock(o.unref(ot),{key:1},{default:o.withCtx(()=>[p.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.icon),{key:0})):o.renderSlot(p.$slots,"icon",{key:1})]),_:3})):o.createCommentVNode("v-if",!0),p.$slots.default?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass({[o.unref(i).em("text","expand")]:o.unref(f)})},[o.renderSlot(p.$slots,"default")],2)):o.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var JC=Te(QC,[["__file","button.vue"]]);const ek={size:El.size,type:El.type},tk=o.defineComponent({name:"ElButtonGroup"}),nk=o.defineComponent({...tk,props:ek,setup(t){const e=t;o.provide(of,o.reactive({size:o.toRef(e,"size"),type:o.toRef(e,"type")}));const n=Be("button");return(r,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(n).b("group"))},[o.renderSlot(r.$slots,"default")],2))}});var ff=Te(nk,[["__file","button-group.vue"]]);const Qt=ft(JC,{ButtonGroup:ff});Fn(ff);const rr=new Map;if(et){let t;document.addEventListener("mousedown",e=>t=e),document.addEventListener("mouseup",e=>{if(t){for(const n of rr.values())for(const{documentHandler:r}of n)r(e,t);t=void 0}})}function hf(t,e){let n=[];return Array.isArray(e.arg)?n=e.arg:Er(e.arg)&&n.push(e.arg),function(r,a){const i=e.instance.popperRef,s=r.target,l=a==null?void 0:a.target,u=!e||!e.instance,c=!s||!l,d=t.contains(s)||t.contains(l),f=t===s,h=n.length&&n.some(p=>p==null?void 0:p.contains(s))||n.length&&n.includes(l),v=i&&(i.contains(s)||i.contains(l));u||c||d||f||h||v||e.value(r,a)}}const pf={beforeMount(t,e){rr.has(t)||rr.set(t,[]),rr.get(t).push({documentHandler:hf(t,e),bindingFn:e.value})},updated(t,e){rr.has(t)||rr.set(t,[]);const n=rr.get(t),r=n.findIndex(i=>i.bindingFn===e.oldValue),a={documentHandler:hf(t,e),bindingFn:e.value};r>=0?n.splice(r,1,a):n.push(a)},unmounted(t){rr.delete(t)}},rk=Ae({header:{type:String,default:""},footer:{type:String,default:""},bodyStyle:{type:ke([String,Object,Array]),default:""},bodyClass:String,shadow:{type:String,values:["always","hover","never"],default:"always"}}),ak=o.defineComponent({name:"ElCard"}),ik=o.defineComponent({...ak,props:rk,setup(t){const e=Be("card");return(n,r)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([o.unref(e).b(),o.unref(e).is(`${n.shadow}-shadow`)])},[n.$slots.header||n.header?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(e).e("header"))},[o.renderSlot(n.$slots,"header",{},()=>[o.createTextVNode(o.toDisplayString(n.header),1)])],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{class:o.normalizeClass([o.unref(e).e("body"),n.bodyClass]),style:o.normalizeStyle(n.bodyStyle)},[o.renderSlot(n.$slots,"default")],6),n.$slots.footer||n.footer?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(e).e("footer"))},[o.renderSlot(n.$slots,"footer",{},()=>[o.createTextVNode(o.toDisplayString(n.footer),1)])],2)):o.createCommentVNode("v-if",!0)],2))}});var ok=Te(ik,[["__file","card.vue"]]);const sk=ft(ok),vf={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},value:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueValue:{type:[String,Number],default:void 0},falseValue:{type:[String,Number],default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},border:Boolean,size:la,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...Jn(["ariaControls"])},gf={[yt]:t=>St(t)||mt(t)||Jr(t),change:t=>St(t)||mt(t)||Jr(t)},da=Symbol("checkboxGroupContextKey"),lk=({model:t,isChecked:e})=>{const n=o.inject(da,void 0),r=o.computed(()=>{var i,s;const l=(i=n==null?void 0:n.max)==null?void 0:i.value,u=(s=n==null?void 0:n.min)==null?void 0:s.value;return!Zn(l)&&t.value.length>=l&&!e.value||!Zn(u)&&t.value.length<=u&&e.value});return{isDisabled:ii(o.computed(()=>(n==null?void 0:n.disabled.value)||r.value)),isLimitDisabled:r}},ck=(t,{model:e,isLimitExceeded:n,hasOwnLabel:r,isDisabled:a,isLabeledByFormItem:i})=>{const s=o.inject(da,void 0),{formItem:l}=Dr(),{emit:u}=o.getCurrentInstance();function c(p){var g,y,m,b;return[!0,t.trueValue,t.trueLabel].includes(p)?(y=(g=t.trueValue)!=null?g:t.trueLabel)!=null?y:!0:(b=(m=t.falseValue)!=null?m:t.falseLabel)!=null?b:!1}function d(p,g){u("change",c(p),g)}function f(p){if(n.value)return;const g=p.target;u("change",c(g.checked),p)}async function h(p){n.value||!r.value&&!a.value&&i.value&&(p.composedPath().some(m=>m.tagName==="LABEL")||(e.value=c([!1,t.falseValue,t.falseLabel].includes(e.value)),await o.nextTick(),d(e.value,p)))}const v=o.computed(()=>(s==null?void 0:s.validateEvent)||t.validateEvent);return o.watch(()=>t.modelValue,()=>{v.value&&(l==null||l.validate("change").catch(p=>tt(p)))}),{handleChange:f,onClickRoot:h}},uk=t=>{const e=o.ref(!1),{emit:n}=o.getCurrentInstance(),r=o.inject(da,void 0),a=o.computed(()=>Zn(r)===!1),i=o.ref(!1),s=o.computed({get(){var l,u;return a.value?(l=r==null?void 0:r.modelValue)==null?void 0:l.value:(u=t.modelValue)!=null?u:e.value},set(l){var u,c;a.value&&At(l)?(i.value=((u=r==null?void 0:r.max)==null?void 0:u.value)!==void 0&&l.length>(r==null?void 0:r.max.value)&&l.length>s.value.length,i.value===!1&&((c=r==null?void 0:r.changeEvent)==null||c.call(r,l))):(n(yt,l),e.value=l)}});return{model:s,isGroup:a,isLimitExceeded:i}},dk=(t,e,{model:n})=>{const r=o.inject(da,void 0),a=o.ref(!1),i=o.computed(()=>co(t.value)?t.label:t.value),s=o.computed(()=>{const d=n.value;return Jr(d)?d:At(d)?gt(i.value)?d.map(o.toRaw).some(f=>lo(f,i.value)):d.map(o.toRaw).includes(i.value):d!=null?d===t.trueValue||d===t.trueLabel:!!d}),l=Nr(o.computed(()=>{var d;return(d=r==null?void 0:r.size)==null?void 0:d.value}),{prop:!0}),u=Nr(o.computed(()=>{var d;return(d=r==null?void 0:r.size)==null?void 0:d.value})),c=o.computed(()=>!!e.default||!co(i.value));return{checkboxButtonSize:l,isChecked:s,isFocused:a,checkboxSize:u,hasOwnLabel:c,actualValue:i}},mf=(t,e)=>{const{formItem:n}=Dr(),{model:r,isGroup:a,isLimitExceeded:i}=uk(t),{isFocused:s,isChecked:l,checkboxButtonSize:u,checkboxSize:c,hasOwnLabel:d,actualValue:f}=dk(t,e,{model:r}),{isDisabled:h}=lk({model:r,isChecked:l}),{inputId:v,isLabeledByFormItem:p}=oi(t,{formItemContext:n,disableIdGeneration:d,disableIdManagement:a}),{handleChange:g,onClickRoot:y}=ck(t,{model:r,isLimitExceeded:i,hasOwnLabel:d,isDisabled:h,isLabeledByFormItem:p});return(()=>{function b(){var w,C;At(r.value)&&!r.value.includes(f.value)?r.value.push(f.value):r.value=(C=(w=t.trueValue)!=null?w:t.trueLabel)!=null?C:!0}t.checked&&b()})(),po({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},o.computed(()=>a.value&&co(t.value))),po({from:"true-label",replacement:"true-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},o.computed(()=>!!t.trueLabel)),po({from:"false-label",replacement:"false-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},o.computed(()=>!!t.falseLabel)),{inputId:v,isLabeledByFormItem:p,isChecked:l,isDisabled:h,isFocused:s,checkboxButtonSize:u,checkboxSize:c,hasOwnLabel:d,model:r,actualValue:f,handleChange:g,onClickRoot:y}},fk=o.defineComponent({name:"ElCheckbox"}),hk=o.defineComponent({...fk,props:vf,emits:gf,setup(t){const e=t,n=o.useSlots(),{inputId:r,isLabeledByFormItem:a,isChecked:i,isDisabled:s,isFocused:l,checkboxSize:u,hasOwnLabel:c,model:d,actualValue:f,handleChange:h,onClickRoot:v}=mf(e,n),p=Be("checkbox"),g=o.computed(()=>[p.b(),p.m(u.value),p.is("disabled",s.value),p.is("bordered",e.border),p.is("checked",i.value)]),y=o.computed(()=>[p.e("input"),p.is("disabled",s.value),p.is("checked",i.value),p.is("indeterminate",e.indeterminate),p.is("focus",l.value)]);return(m,b)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(!o.unref(c)&&o.unref(a)?"span":"label"),{class:o.normalizeClass(o.unref(g)),"aria-controls":m.indeterminate?m.ariaControls:null,onClick:o.unref(v)},{default:o.withCtx(()=>{var w,C,k,E;return[o.createElementVNode("span",{class:o.normalizeClass(o.unref(y))},[m.trueValue||m.falseValue||m.trueLabel||m.falseLabel?o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:0,id:o.unref(r),"onUpdate:modelValue":x=>o.isRef(d)?d.value=x:null,class:o.normalizeClass(o.unref(p).e("original")),type:"checkbox",indeterminate:m.indeterminate,name:m.name,tabindex:m.tabindex,disabled:o.unref(s),"true-value":(C=(w=m.trueValue)!=null?w:m.trueLabel)!=null?C:!0,"false-value":(E=(k=m.falseValue)!=null?k:m.falseLabel)!=null?E:!1,onChange:o.unref(h),onFocus:x=>l.value=!0,onBlur:x=>l.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(d)]]):o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:1,id:o.unref(r),"onUpdate:modelValue":x=>o.isRef(d)?d.value=x:null,class:o.normalizeClass(o.unref(p).e("original")),type:"checkbox",indeterminate:m.indeterminate,disabled:o.unref(s),value:o.unref(f),name:m.name,tabindex:m.tabindex,onChange:o.unref(h),onFocus:x=>l.value=!0,onBlur:x=>l.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","disabled","value","name","tabindex","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(d)]]),o.createElementVNode("span",{class:o.normalizeClass(o.unref(p).e("inner"))},null,2)],2),o.unref(c)?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(p).e("label"))},[o.renderSlot(m.$slots,"default"),m.$slots.default?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(m.label),1)],64))],2)):o.createCommentVNode("v-if",!0)]}),_:3},8,["class","aria-controls","onClick"]))}});var pk=Te(hk,[["__file","checkbox.vue"]]);const vk=o.defineComponent({name:"ElCheckboxButton"}),gk=o.defineComponent({...vk,props:vf,emits:gf,setup(t){const e=t,n=o.useSlots(),{isFocused:r,isChecked:a,isDisabled:i,checkboxButtonSize:s,model:l,actualValue:u,handleChange:c}=mf(e,n),d=o.inject(da,void 0),f=Be("checkbox"),h=o.computed(()=>{var p,g,y,m;const b=(g=(p=d==null?void 0:d.fill)==null?void 0:p.value)!=null?g:"";return{backgroundColor:b,borderColor:b,color:(m=(y=d==null?void 0:d.textColor)==null?void 0:y.value)!=null?m:"",boxShadow:b?`-1px 0 0 0 ${b}`:void 0}}),v=o.computed(()=>[f.b("button"),f.bm("button",s.value),f.is("disabled",i.value),f.is("checked",a.value),f.is("focus",r.value)]);return(p,g)=>{var y,m,b,w;return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(o.unref(v))},[p.trueValue||p.falseValue||p.trueLabel||p.falseLabel?o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:0,"onUpdate:modelValue":C=>o.isRef(l)?l.value=C:null,class:o.normalizeClass(o.unref(f).be("button","original")),type:"checkbox",name:p.name,tabindex:p.tabindex,disabled:o.unref(i),"true-value":(m=(y=p.trueValue)!=null?y:p.trueLabel)!=null?m:!0,"false-value":(w=(b=p.falseValue)!=null?b:p.falseLabel)!=null?w:!1,onChange:o.unref(c),onFocus:C=>r.value=!0,onBlur:C=>r.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(l)]]):o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:1,"onUpdate:modelValue":C=>o.isRef(l)?l.value=C:null,class:o.normalizeClass(o.unref(f).be("button","original")),type:"checkbox",name:p.name,tabindex:p.tabindex,disabled:o.unref(i),value:o.unref(u),onChange:o.unref(c),onFocus:C=>r.value=!0,onBlur:C=>r.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","value","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(l)]]),p.$slots.default||p.label?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass(o.unref(f).be("button","inner")),style:o.normalizeStyle(o.unref(a)?o.unref(h):void 0)},[o.renderSlot(p.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(p.label),1)])],6)):o.createCommentVNode("v-if",!0)],2)}}});var yf=Te(gk,[["__file","checkbox-button.vue"]]);const mk=Ae({modelValue:{type:ke(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:la,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...Jn(["ariaLabel"])}),yk={[yt]:t=>At(t),change:t=>At(t)},bk=o.defineComponent({name:"ElCheckboxGroup"}),wk=o.defineComponent({...bk,props:mk,emits:yk,setup(t,{emit:e}){const n=t,r=Be("checkbox"),{formItem:a}=Dr(),{inputId:i,isLabeledByFormItem:s}=oi(n,{formItemContext:a}),l=async c=>{e(yt,c),await o.nextTick(),e("change",c)},u=o.computed({get(){return n.modelValue},set(c){l(c)}});return o.provide(da,{...Zu(o.toRefs(n),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:u,changeEvent:l}),o.watch(()=>n.modelValue,()=>{n.validateEvent&&(a==null||a.validate("change").catch(c=>tt(c)))}),(c,d)=>{var f;return o.openBlock(),o.createBlock(o.resolveDynamicComponent(c.tag),{id:o.unref(i),class:o.normalizeClass(o.unref(r).b("group")),role:"group","aria-label":o.unref(s)?void 0:c.ariaLabel||"checkbox-group","aria-labelledby":o.unref(s)?(f=o.unref(a))==null?void 0:f.labelId:void 0},{default:o.withCtx(()=>[o.renderSlot(c.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var bf=Te(wk,[["__file","checkbox-group.vue"]]);const Ck=ft(pk,{CheckboxButton:yf,CheckboxGroup:bf});Fn(yf),Fn(bf);const Dl=Ae({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:nd},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),kk={close:t=>t instanceof MouseEvent,click:t=>t instanceof MouseEvent},xk=o.defineComponent({name:"ElTag"}),Ek=o.defineComponent({...xk,props:Dl,emits:kk,setup(t,{emit:e}){const n=t,r=Nr(),a=Be("tag"),i=o.computed(()=>{const{type:c,hit:d,effect:f,closable:h,round:v}=n;return[a.b(),a.is("closable",h),a.m(c||"primary"),a.m(r.value),a.m(f),a.is("hit",d),a.is("round",v)]}),s=c=>{e("close",c)},l=c=>{e("click",c)},u=c=>{c.component.subTree.component.bum=null};return(c,d)=>c.disableTransitions?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle({backgroundColor:c.color}),onClick:l},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(a).e("content"))},[o.renderSlot(c.$slots,"default")],2),c.closable?(o.openBlock(),o.createBlock(o.unref(ot),{key:0,class:o.normalizeClass(o.unref(a).e("close")),onClick:o.withModifiers(s,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(uo))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0)],6)):(o.openBlock(),o.createBlock(o.Transition,{key:1,name:`${o.unref(a).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:u},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle({backgroundColor:c.color}),onClick:l},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(a).e("content"))},[o.renderSlot(c.$slots,"default")],2),c.closable?(o.openBlock(),o.createBlock(o.unref(ot),{key:0,class:o.normalizeClass(o.unref(a).e("close")),onClick:o.withModifiers(s,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(uo))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var Sk=Te(Ek,[["__file","tag.vue"]]);const Tk=ft(Sk),wf=Symbol("rowContextKey"),Bk=Ae({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),Nk=o.defineComponent({name:"ElRow"}),Dk=o.defineComponent({...Nk,props:Bk,setup(t){const e=t,n=Be("row"),r=o.computed(()=>e.gutter);o.provide(wf,{gutter:r});const a=o.computed(()=>{const s={};return e.gutter&&(s.marginRight=s.marginLeft=`-${e.gutter/2}px`),s}),i=o.computed(()=>[n.b(),n.is(`justify-${e.justify}`,e.justify!=="start"),n.is(`align-${e.align}`,!!e.align)]);return(s,l)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.tag),{class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle(o.unref(a))},{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},8,["class","style"]))}});var _k=Te(Dk,[["__file","row.vue"]]);const Do=ft(_k),Pk=Ae({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:ke([Number,Object]),default:()=>ta({})},sm:{type:ke([Number,Object]),default:()=>ta({})},md:{type:ke([Number,Object]),default:()=>ta({})},lg:{type:ke([Number,Object]),default:()=>ta({})},xl:{type:ke([Number,Object]),default:()=>ta({})}}),Ok=o.defineComponent({name:"ElCol"}),Ik=o.defineComponent({...Ok,props:Pk,setup(t){const e=t,{gutter:n}=o.inject(wf,{gutter:o.computed(()=>0)}),r=Be("col"),a=o.computed(()=>{const s={};return n.value&&(s.paddingLeft=s.paddingRight=`${n.value/2}px`),s}),i=o.computed(()=>{const s=[];return["span","offset","pull","push"].forEach(c=>{const d=e[c];mt(d)&&(c==="span"?s.push(r.b(`${e[c]}`)):d>0&&s.push(r.b(`${c}-${e[c]}`)))}),["xs","sm","md","lg","xl"].forEach(c=>{mt(e[c])?s.push(r.b(`${c}-${e[c]}`)):gt(e[c])&&Object.entries(e[c]).forEach(([d,f])=>{s.push(d!=="span"?r.b(`${c}-${d}-${f}`):r.b(`${c}-${f}`))})}),n.value&&s.push(r.is("guttered")),[r.b(),s]});return(s,l)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.tag),{class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle(o.unref(a))},{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},8,["class","style"]))}});var Lk=Te(Ik,[["__file","col.vue"]]);const ui=ft(Lk),Mk=o.defineComponent({name:"ElCollapseTransition"}),Fk=o.defineComponent({...Mk,setup(t){const e=Be("collapse-transition"),n=a=>{a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom},r={beforeEnter(a){a.dataset||(a.dataset={}),a.dataset.oldPaddingTop=a.style.paddingTop,a.dataset.oldPaddingBottom=a.style.paddingBottom,a.style.height&&(a.dataset.elExistsHeight=a.style.height),a.style.maxHeight=0,a.style.paddingTop=0,a.style.paddingBottom=0},enter(a){requestAnimationFrame(()=>{a.dataset.oldOverflow=a.style.overflow,a.dataset.elExistsHeight?a.style.maxHeight=a.dataset.elExistsHeight:a.scrollHeight!==0?a.style.maxHeight=`${a.scrollHeight}px`:a.style.maxHeight=0,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom,a.style.overflow="hidden"})},afterEnter(a){a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow},enterCancelled(a){n(a)},beforeLeave(a){a.dataset||(a.dataset={}),a.dataset.oldPaddingTop=a.style.paddingTop,a.dataset.oldPaddingBottom=a.style.paddingBottom,a.dataset.oldOverflow=a.style.overflow,a.style.maxHeight=`${a.scrollHeight}px`,a.style.overflow="hidden"},leave(a){a.scrollHeight!==0&&(a.style.maxHeight=0,a.style.paddingTop=0,a.style.paddingBottom=0)},afterLeave(a){n(a)},leaveCancelled(a){n(a)}};return(a,i)=>(o.openBlock(),o.createBlock(o.Transition,o.mergeProps({name:o.unref(e).b()},o.toHandlers(r)),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["name"]))}});var Ak=Te(Fk,[["__file","collapse-transition.vue"]]);const Vk=ft(Ak),Rk=Ae({color:{type:ke(Object),required:!0},vertical:{type:Boolean,default:!1}});let _l=!1;function di(t,e){if(!et)return;const n=function(i){var s;(s=e.drag)==null||s.call(e,i)},r=function(i){var s;document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",r),document.removeEventListener("touchmove",n),document.removeEventListener("touchend",r),document.onselectstart=null,document.ondragstart=null,_l=!1,(s=e.end)==null||s.call(e,i)},a=function(i){var s;_l||(i.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",n),document.addEventListener("mouseup",r),document.addEventListener("touchmove",n),document.addEventListener("touchend",r),_l=!0,(s=e.start)==null||s.call(e,i))};t.addEventListener("mousedown",a),t.addEventListener("touchstart",a,{passive:!1})}const $k=t=>{const e=o.getCurrentInstance(),{t:n}=Za(),r=o.shallowRef(),a=o.shallowRef(),i=o.computed(()=>t.color.get("alpha")),s=o.computed(()=>n("el.colorpicker.alphaLabel"));function l(f){var h;f.target!==r.value&&u(f),(h=r.value)==null||h.focus()}function u(f){if(!a.value||!r.value)return;const v=e.vnode.el.getBoundingClientRect(),{clientX:p,clientY:g}=Os(f);if(t.vertical){let y=g-v.top;y=Math.max(r.value.offsetHeight/2,y),y=Math.min(y,v.height-r.value.offsetHeight/2),t.color.set("alpha",Math.round((y-r.value.offsetHeight/2)/(v.height-r.value.offsetHeight)*100))}else{let y=p-v.left;y=Math.max(r.value.offsetWidth/2,y),y=Math.min(y,v.width-r.value.offsetWidth/2),t.color.set("alpha",Math.round((y-r.value.offsetWidth/2)/(v.width-r.value.offsetWidth)*100))}}function c(f){const{code:h,shiftKey:v}=f,p=v?10:1;switch(h){case it.left:case it.down:f.preventDefault(),f.stopPropagation(),d(-p);break;case it.right:case it.up:f.preventDefault(),f.stopPropagation(),d(p);break}}function d(f){let h=i.value+f;h=h<0?0:h>100?100:h,t.color.set("alpha",h)}return{thumb:r,bar:a,alpha:i,alphaLabel:s,handleDrag:u,handleClick:l,handleKeydown:c}},zk=(t,{bar:e,thumb:n,handleDrag:r})=>{const a=o.getCurrentInstance(),i=Be("color-alpha-slider"),s=o.ref(0),l=o.ref(0),u=o.ref();function c(){if(!n.value||t.vertical)return 0;const b=a.vnode.el,w=t.color.get("alpha");return b?Math.round(w*(b.offsetWidth-n.value.offsetWidth/2)/100):0}function d(){if(!n.value)return 0;const b=a.vnode.el;if(!t.vertical)return 0;const w=t.color.get("alpha");return b?Math.round(w*(b.offsetHeight-n.value.offsetHeight/2)/100):0}function f(){if(t.color&&t.color.value){const{r:b,g:w,b:C}=t.color.toRgb();return`linear-gradient(to right, rgba(${b}, ${w}, ${C}, 0) 0%, rgba(${b}, ${w}, ${C}, 1) 100%)`}return""}function h(){s.value=c(),l.value=d(),u.value=f()}o.onMounted(()=>{if(!e.value||!n.value)return;const b={drag:w=>{r(w)},end:w=>{r(w)}};di(e.value,b),di(n.value,b),h()}),o.watch(()=>t.color.get("alpha"),()=>h()),o.watch(()=>t.color.value,()=>h());const v=o.computed(()=>[i.b(),i.is("vertical",t.vertical)]),p=o.computed(()=>i.e("bar")),g=o.computed(()=>i.e("thumb")),y=o.computed(()=>({background:u.value})),m=o.computed(()=>({left:ea(s.value),top:ea(l.value)}));return{rootKls:v,barKls:p,barStyle:y,thumbKls:g,thumbStyle:m,update:h}},Hk=o.defineComponent({name:"ElColorAlphaSlider"}),Kk=o.defineComponent({...Hk,props:Rk,setup(t,{expose:e}){const n=t,{alpha:r,alphaLabel:a,bar:i,thumb:s,handleDrag:l,handleClick:u,handleKeydown:c}=$k(n),{rootKls:d,barKls:f,barStyle:h,thumbKls:v,thumbStyle:p,update:g}=zk(n,{bar:i,thumb:s,handleDrag:l});return e({update:g,bar:i,thumb:s}),(y,m)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(d))},[o.createElementVNode("div",{ref_key:"bar",ref:i,class:o.normalizeClass(o.unref(f)),style:o.normalizeStyle(o.unref(h)),onClick:o.unref(u)},null,14,["onClick"]),o.createElementVNode("div",{ref_key:"thumb",ref:s,class:o.normalizeClass(o.unref(v)),style:o.normalizeStyle(o.unref(p)),"aria-label":o.unref(a),"aria-valuenow":o.unref(r),"aria-orientation":y.vertical?"vertical":"horizontal","aria-valuemin":"0","aria-valuemax":"100",role:"slider",tabindex:"0",onKeydown:o.unref(c)},null,46,["aria-label","aria-valuenow","aria-orientation","onKeydown"])],2))}});var qk=Te(Kk,[["__file","alpha-slider.vue"]]);const Uk=o.defineComponent({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(t){const e=Be("color-hue-slider"),n=o.getCurrentInstance(),r=o.ref(),a=o.ref(),i=o.ref(0),s=o.ref(0),l=o.computed(()=>t.color.get("hue"));o.watch(()=>l.value,()=>{h()});function u(v){v.target!==r.value&&c(v)}function c(v){if(!a.value||!r.value)return;const g=n.vnode.el.getBoundingClientRect(),{clientX:y,clientY:m}=Os(v);let b;if(t.vertical){let w=m-g.top;w=Math.min(w,g.height-r.value.offsetHeight/2),w=Math.max(r.value.offsetHeight/2,w),b=Math.round((w-r.value.offsetHeight/2)/(g.height-r.value.offsetHeight)*360)}else{let w=y-g.left;w=Math.min(w,g.width-r.value.offsetWidth/2),w=Math.max(r.value.offsetWidth/2,w),b=Math.round((w-r.value.offsetWidth/2)/(g.width-r.value.offsetWidth)*360)}t.color.set("hue",b)}function d(){if(!r.value)return 0;const v=n.vnode.el;if(t.vertical)return 0;const p=t.color.get("hue");return v?Math.round(p*(v.offsetWidth-r.value.offsetWidth/2)/360):0}function f(){if(!r.value)return 0;const v=n.vnode.el;if(!t.vertical)return 0;const p=t.color.get("hue");return v?Math.round(p*(v.offsetHeight-r.value.offsetHeight/2)/360):0}function h(){i.value=d(),s.value=f()}return o.onMounted(()=>{if(!a.value||!r.value)return;const v={drag:p=>{c(p)},end:p=>{c(p)}};di(a.value,v),di(r.value,v),h()}),{bar:a,thumb:r,thumbLeft:i,thumbTop:s,hueValue:l,handleClick:u,update:h,ns:e}}});function Gk(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([t.ns.b(),t.ns.is("vertical",t.vertical)])},[o.createElementVNode("div",{ref:"bar",class:o.normalizeClass(t.ns.e("bar")),onClick:t.handleClick},null,10,["onClick"]),o.createElementVNode("div",{ref:"thumb",class:o.normalizeClass(t.ns.e("thumb")),style:o.normalizeStyle({left:t.thumbLeft+"px",top:t.thumbTop+"px"})},null,6)],2)}var Wk=Te(Uk,[["render",Gk],["__file","hue-slider.vue"]]);const jk=Ae({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:la,popperClass:{type:String,default:""},tabindex:{type:[String,Number],default:0},teleported:$t.teleported,predefine:{type:ke(Array)},validateEvent:{type:Boolean,default:!0},...Jn(["ariaLabel"])}),Yk={[yt]:t=>St(t)||Yn(t),[el]:t=>St(t)||Yn(t),activeChange:t=>St(t)||Yn(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent},Cf=Symbol("colorPickerContextKey"),kf=function(t,e,n){return[t,e*n/((t=(2-e)*n)<1?t:2-t)||0,t/2]},Zk=function(t){return typeof t=="string"&&t.includes(".")&&Number.parseFloat(t)===1},Xk=function(t){return typeof t=="string"&&t.includes("%")},fa=function(t,e){Zk(t)&&(t="100%");const n=Xk(t);return t=Math.min(e,Math.max(0,Number.parseFloat(`${t}`))),n&&(t=Number.parseInt(`${t*e}`,10)/100),Math.abs(t-e)<1e-6?1:t%e/Number.parseFloat(e)},xf={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},_o=t=>{t=Math.min(Math.round(t),255);const e=Math.floor(t/16),n=t%16;return`${xf[e]||e}${xf[n]||n}`},Ef=function({r:t,g:e,b:n}){return Number.isNaN(+t)||Number.isNaN(+e)||Number.isNaN(+n)?"":`#${_o(t)}${_o(e)}${_o(n)}`},Pl={A:10,B:11,C:12,D:13,E:14,F:15},Pr=function(t){return t.length===2?(Pl[t[0].toUpperCase()]||+t[0])*16+(Pl[t[1].toUpperCase()]||+t[1]):Pl[t[1].toUpperCase()]||+t[1]},Qk=function(t,e,n){e=e/100,n=n/100;let r=e;const a=Math.max(n,.01);n*=2,e*=n<=1?n:2-n,r*=a<=1?a:2-a;const i=(n+e)/2,s=n===0?2*r/(a+r):2*e/(n+e);return{h:t,s:s*100,v:i*100}},Sf=(t,e,n)=>{t=fa(t,255),e=fa(e,255),n=fa(n,255);const r=Math.max(t,e,n),a=Math.min(t,e,n);let i;const s=r,l=r-a,u=r===0?0:l/r;if(r===a)i=0;else{switch(r){case t:{i=(e-n)/l+(e<n?6:0);break}case e:{i=(n-t)/l+2;break}case n:{i=(t-e)/l+4;break}}i/=6}return{h:i*360,s:u*100,v:s*100}},fi=function(t,e,n){t=fa(t,360)*6,e=fa(e,100),n=fa(n,100);const r=Math.floor(t),a=t-r,i=n*(1-e),s=n*(1-a*e),l=n*(1-(1-a)*e),u=r%6,c=[n,s,i,i,l,n][u],d=[l,n,n,s,i,i][u],f=[i,i,l,n,n,s][u];return{r:Math.round(c*255),g:Math.round(d*255),b:Math.round(f*255)}};class hi{constructor(e={}){this._hue=0,this._saturation=100,this._value=100,this._alpha=100,this.enableAlpha=!1,this.format="hex",this.value="";for(const n in e)wr(e,n)&&(this[n]=e[n]);e.value?this.fromString(e.value):this.doOnChange()}set(e,n){if(arguments.length===1&&typeof e=="object"){for(const r in e)wr(e,r)&&this.set(r,e[r]);return}this[`_${e}`]=n,this.doOnChange()}get(e){return e==="alpha"?Math.floor(this[`_${e}`]):this[`_${e}`]}toRgb(){return fi(this._hue,this._saturation,this._value)}fromString(e){if(!e){this._hue=0,this._saturation=100,this._value=100,this.doOnChange();return}const n=(r,a,i)=>{this._hue=Math.max(0,Math.min(360,r)),this._saturation=Math.max(0,Math.min(100,a)),this._value=Math.max(0,Math.min(100,i)),this.doOnChange()};if(e.includes("hsl")){const r=e.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));if(r.length===4?this._alpha=Number.parseFloat(r[3])*100:r.length===3&&(this._alpha=100),r.length>=3){const{h:a,s:i,v:s}=Qk(r[0],r[1],r[2]);n(a,i,s)}}else if(e.includes("hsv")){const r=e.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));r.length===4?this._alpha=Number.parseFloat(r[3])*100:r.length===3&&(this._alpha=100),r.length>=3&&n(r[0],r[1],r[2])}else if(e.includes("rgb")){const r=e.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));if(r.length===4?this._alpha=Number.parseFloat(r[3])*100:r.length===3&&(this._alpha=100),r.length>=3){const{h:a,s:i,v:s}=Sf(r[0],r[1],r[2]);n(a,i,s)}}else if(e.includes("#")){const r=e.replace("#","").trim();if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(r))return;let a,i,s;r.length===3?(a=Pr(r[0]+r[0]),i=Pr(r[1]+r[1]),s=Pr(r[2]+r[2])):(r.length===6||r.length===8)&&(a=Pr(r.slice(0,2)),i=Pr(r.slice(2,4)),s=Pr(r.slice(4,6))),r.length===8?this._alpha=Pr(r.slice(6))/255*100:(r.length===3||r.length===6)&&(this._alpha=100);const{h:l,s:u,v:c}=Sf(a,i,s);n(l,u,c)}}compare(e){return Math.abs(e._hue-this._hue)<2&&Math.abs(e._saturation-this._saturation)<1&&Math.abs(e._value-this._value)<1&&Math.abs(e._alpha-this._alpha)<1}doOnChange(){const{_hue:e,_saturation:n,_value:r,_alpha:a,format:i}=this;if(this.enableAlpha)switch(i){case"hsl":{const s=kf(e,n/100,r/100);this.value=`hsla(${e}, ${Math.round(s[1]*100)}%, ${Math.round(s[2]*100)}%, ${this.get("alpha")/100})`;break}case"hsv":{this.value=`hsva(${e}, ${Math.round(n)}%, ${Math.round(r)}%, ${this.get("alpha")/100})`;break}case"hex":{this.value=`${Ef(fi(e,n,r))}${_o(a*255/100)}`;break}default:{const{r:s,g:l,b:u}=fi(e,n,r);this.value=`rgba(${s}, ${l}, ${u}, ${this.get("alpha")/100})`}}else switch(i){case"hsl":{const s=kf(e,n/100,r/100);this.value=`hsl(${e}, ${Math.round(s[1]*100)}%, ${Math.round(s[2]*100)}%)`;break}case"hsv":{this.value=`hsv(${e}, ${Math.round(n)}%, ${Math.round(r)}%)`;break}case"rgb":{const{r:s,g:l,b:u}=fi(e,n,r);this.value=`rgb(${s}, ${l}, ${u})`;break}default:this.value=Ef(fi(e,n,r))}}}const Jk=o.defineComponent({props:{colors:{type:Array,required:!0},color:{type:Object,required:!0},enableAlpha:{type:Boolean,required:!0}},setup(t){const e=Be("color-predefine"),{currentColor:n}=o.inject(Cf),r=o.ref(i(t.colors,t.color));o.watch(()=>n.value,s=>{const l=new hi;l.fromString(s),r.value.forEach(u=>{u.selected=l.compare(u)})}),o.watchEffect(()=>{r.value=i(t.colors,t.color)});function a(s){t.color.fromString(t.colors[s])}function i(s,l){return s.map(u=>{const c=new hi;return c.enableAlpha=t.enableAlpha,c.format="rgba",c.fromString(u),c.selected=c.value===l.value,c})}return{rgbaColors:r,handleSelect:a,ns:e}}});function ex(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(t.ns.b())},[o.createElementVNode("div",{class:o.normalizeClass(t.ns.e("colors"))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.rgbaColors,(s,l)=>(o.openBlock(),o.createElementBlock("div",{key:t.colors[l],class:o.normalizeClass([t.ns.e("color-selector"),t.ns.is("alpha",s._alpha<100),{selected:s.selected}]),onClick:u=>t.handleSelect(l)},[o.createElementVNode("div",{style:o.normalizeStyle({backgroundColor:s.value})},null,4)],10,["onClick"]))),128))],2)],2)}var tx=Te(Jk,[["render",ex],["__file","predefine.vue"]]);const nx=o.defineComponent({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(t){const e=Be("color-svpanel"),n=o.getCurrentInstance(),r=o.ref(0),a=o.ref(0),i=o.ref("hsl(0, 100%, 50%)"),s=o.computed(()=>{const c=t.color.get("hue"),d=t.color.get("value");return{hue:c,value:d}});function l(){const c=t.color.get("saturation"),d=t.color.get("value"),f=n.vnode.el,{clientWidth:h,clientHeight:v}=f;a.value=c*h/100,r.value=(100-d)*v/100,i.value=`hsl(${t.color.get("hue")}, 100%, 50%)`}function u(c){const f=n.vnode.el.getBoundingClientRect(),{clientX:h,clientY:v}=Os(c);let p=h-f.left,g=v-f.top;p=Math.max(0,p),p=Math.min(p,f.width),g=Math.max(0,g),g=Math.min(g,f.height),a.value=p,r.value=g,t.color.set({saturation:p/f.width*100,value:100-g/f.height*100})}return o.watch(()=>s.value,()=>{l()}),o.onMounted(()=>{di(n.vnode.el,{drag:c=>{u(c)},end:c=>{u(c)}}),l()}),{cursorTop:r,cursorLeft:a,background:i,colorValue:s,handleDrag:u,update:l,ns:e}}});function rx(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(t.ns.b()),style:o.normalizeStyle({backgroundColor:t.background})},[o.createElementVNode("div",{class:o.normalizeClass(t.ns.e("white"))},null,2),o.createElementVNode("div",{class:o.normalizeClass(t.ns.e("black"))},null,2),o.createElementVNode("div",{class:o.normalizeClass(t.ns.e("cursor")),style:o.normalizeStyle({top:t.cursorTop+"px",left:t.cursorLeft+"px"})},[o.createElementVNode("div")],6)],6)}var ax=Te(nx,[["render",rx],["__file","sv-panel.vue"]]);const ix=o.defineComponent({name:"ElColorPicker"}),ox=o.defineComponent({...ix,props:jk,emits:Yk,setup(t,{expose:e,emit:n}){const r=t,{t:a}=Za(),i=Be("color"),{formItem:s}=Dr(),l=Nr(),u=ii(),{inputId:c,isLabeledByFormItem:d}=oi(r,{formItemContext:s}),f=o.ref(),h=o.ref(),v=o.ref(),p=o.ref(),g=o.ref(),y=o.ref(),{isFocused:m,handleFocus:b,handleBlur:w}=fl(g,{beforeFocus(){return u.value},beforeBlur(A){var K;return(K=p.value)==null?void 0:K.isFocusInsideContent(A)},afterBlur(){F(!1),V()}});let C=!0;const k=o.reactive(new hi({enableAlpha:r.showAlpha,format:r.colorFormat||"",value:r.modelValue})),E=o.ref(!1),x=o.ref(!1),B=o.ref(""),S=o.computed(()=>!r.modelValue&&!x.value?"transparent":P(k,r.showAlpha)),N=o.computed(()=>!r.modelValue&&!x.value?"":k.value),D=o.computed(()=>d.value?void 0:r.ariaLabel||a("el.colorpicker.defaultLabel")),_=o.computed(()=>d.value?s==null?void 0:s.labelId:void 0),I=o.computed(()=>[i.b("picker"),i.is("disabled",u.value),i.bm("picker",l.value),i.is("focused",m.value)]);function P(A,K){if(!(A instanceof hi))throw new TypeError("color should be instance of _color Class");const{r:W,g:oe,b:he}=A.toRgb();return K?`rgba(${W}, ${oe}, ${he}, ${A.get("alpha")/100})`:`rgb(${W}, ${oe}, ${he})`}function F(A){E.value=A}const O=Yu(F,100,{leading:!0});function M(){u.value||F(!0)}function L(){O(!1),V()}function V(){o.nextTick(()=>{r.modelValue?k.fromString(r.modelValue):(k.value="",o.nextTick(()=>{x.value=!1}))})}function H(){u.value||O(!E.value)}function $(){k.fromString(B.value)}function z(){const A=k.value;n(yt,A),n("change",A),r.validateEvent&&(s==null||s.validate("change").catch(K=>tt(K))),O(!1),o.nextTick(()=>{const K=new hi({enableAlpha:r.showAlpha,format:r.colorFormat||"",value:r.modelValue});k.compare(K)||V()})}function j(){O(!1),n(yt,null),n("change",null),r.modelValue!==null&&r.validateEvent&&(s==null||s.validate("change").catch(A=>tt(A))),V()}function ee(){E.value&&(L(),m.value&&ne())}function J(A){A.preventDefault(),A.stopPropagation(),F(!1),V()}function X(A){switch(A.code){case it.enter:case it.space:A.preventDefault(),A.stopPropagation(),M(),y.value.focus();break;case it.esc:J(A);break}}function ne(){g.value.focus()}function Y(){g.value.blur()}return o.onMounted(()=>{r.modelValue&&(B.value=N.value)}),o.watch(()=>r.modelValue,A=>{A?A&&A!==k.value&&(C=!1,k.fromString(A)):x.value=!1}),o.watch(()=>[r.colorFormat,r.showAlpha],()=>{k.enableAlpha=r.showAlpha,k.format=r.colorFormat||k.format,k.doOnChange(),n(yt,k.value)}),o.watch(()=>N.value,A=>{B.value=A,C&&n("activeChange",A),C=!0}),o.watch(()=>k.value,()=>{!r.modelValue&&!x.value&&(x.value=!0)}),o.watch(()=>E.value,()=>{o.nextTick(()=>{var A,K,W;(A=f.value)==null||A.update(),(K=h.value)==null||K.update(),(W=v.value)==null||W.update()})}),o.provide(Cf,{currentColor:N}),e({color:k,show:M,hide:L,focus:ne,blur:Y}),(A,K)=>(o.openBlock(),o.createBlock(o.unref(ci),{ref_key:"popper",ref:p,visible:E.value,"show-arrow":!1,"fallback-placements":["bottom","top","right","left"],offset:0,"gpu-acceleration":!1,"popper-class":[o.unref(i).be("picker","panel"),o.unref(i).b("dropdown"),A.popperClass],"stop-popper-mouse-event":!1,effect:"light",trigger:"click",teleported:A.teleported,transition:`${o.unref(i).namespace.value}-zoom-in-top`,persistent:"",onHide:W=>F(!1)},{content:o.withCtx(()=>[o.withDirectives((o.openBlock(),o.createElementBlock("div",{onKeydown:o.withKeys(J,["esc"])},[o.createElementVNode("div",{class:o.normalizeClass(o.unref(i).be("dropdown","main-wrapper"))},[o.createVNode(Wk,{ref_key:"hue",ref:f,class:"hue-slider",color:o.unref(k),vertical:""},null,8,["color"]),o.createVNode(ax,{ref_key:"sv",ref:h,color:o.unref(k)},null,8,["color"])],2),A.showAlpha?(o.openBlock(),o.createBlock(qk,{key:0,ref_key:"alpha",ref:v,color:o.unref(k)},null,8,["color"])):o.createCommentVNode("v-if",!0),A.predefine?(o.openBlock(),o.createBlock(tx,{key:1,ref:"predefine","enable-alpha":A.showAlpha,color:o.unref(k),colors:A.predefine},null,8,["enable-alpha","color","colors"])):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{class:o.normalizeClass(o.unref(i).be("dropdown","btns"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(i).be("dropdown","value"))},[o.createVNode(o.unref(si),{ref_key:"inputRef",ref:y,modelValue:B.value,"onUpdate:modelValue":W=>B.value=W,"validate-event":!1,size:"small",onKeyup:o.withKeys($,["enter"]),onBlur:$},null,8,["modelValue","onUpdate:modelValue","onKeyup"])],2),o.createVNode(o.unref(Qt),{class:o.normalizeClass(o.unref(i).be("dropdown","link-btn")),text:"",size:"small",onClick:j},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("el.colorpicker.clear")),1)]),_:1},8,["class"]),o.createVNode(o.unref(Qt),{plain:"",size:"small",class:o.normalizeClass(o.unref(i).be("dropdown","btn")),onClick:z},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("el.colorpicker.confirm")),1)]),_:1},8,["class"])],2)],40,["onKeydown"])),[[o.unref(pf),ee]])]),default:o.withCtx(()=>[o.createElementVNode("div",o.mergeProps({id:o.unref(c),ref_key:"triggerRef",ref:g},A.$attrs,{class:o.unref(I),role:"button","aria-label":o.unref(D),"aria-labelledby":o.unref(_),"aria-description":o.unref(a)("el.colorpicker.description",{color:A.modelValue||""}),"aria-disabled":o.unref(u),tabindex:o.unref(u)?-1:A.tabindex,onKeydown:X,onFocus:o.unref(b),onBlur:o.unref(w)}),[o.unref(u)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(i).be("picker","mask"))},null,2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{class:o.normalizeClass(o.unref(i).be("picker","trigger")),onClick:H},[o.createElementVNode("span",{class:o.normalizeClass([o.unref(i).be("picker","color"),o.unref(i).is("alpha",A.showAlpha)])},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(i).be("picker","color-inner")),style:o.normalizeStyle({backgroundColor:o.unref(S)})},[o.withDirectives(o.createVNode(o.unref(ot),{class:o.normalizeClass([o.unref(i).be("picker","icon"),o.unref(i).is("icon-arrow-down")])},{default:o.withCtx(()=>[o.createVNode(o.unref(Ya))]),_:1},8,["class"]),[[o.vShow,A.modelValue||x.value]]),o.withDirectives(o.createVNode(o.unref(ot),{class:o.normalizeClass([o.unref(i).be("picker","empty"),o.unref(i).is("icon-close")])},{default:o.withCtx(()=>[o.createVNode(o.unref(uo))]),_:1},8,["class"]),[[o.vShow,!A.modelValue&&!x.value]])],6)],2)],2)],16,["id","aria-label","aria-labelledby","aria-description","aria-disabled","tabindex","onFocus","onBlur"])]),_:1},8,["visible","popper-class","teleported","transition","onHide"]))}});var sx=Te(ox,[["__file","color-picker.vue"]]);const lx=ft(sx),cx=o.defineComponent({name:"ElContainer"}),ux=o.defineComponent({...cx,props:{direction:{type:String}},setup(t){const e=t,n=o.useSlots(),r=Be("container"),a=o.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:n&&n.default?n.default().some(s=>{const l=s.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(i,s)=>(o.openBlock(),o.createElementBlock("section",{class:o.normalizeClass([o.unref(r).b(),o.unref(r).is("vertical",o.unref(a))])},[o.renderSlot(i.$slots,"default")],2))}});var dx=Te(ux,[["__file","container.vue"]]);const fx=o.defineComponent({name:"ElAside"}),hx=o.defineComponent({...fx,props:{width:{type:String,default:null}},setup(t){const e=t,n=Be("aside"),r=o.computed(()=>e.width?n.cssVarBlock({width:e.width}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("aside",{class:o.normalizeClass(o.unref(n).b()),style:o.normalizeStyle(o.unref(r))},[o.renderSlot(a.$slots,"default")],6))}});var Tf=Te(hx,[["__file","aside.vue"]]);const px=o.defineComponent({name:"ElFooter"}),vx=o.defineComponent({...px,props:{height:{type:String,default:null}},setup(t){const e=t,n=Be("footer"),r=o.computed(()=>e.height?n.cssVarBlock({height:e.height}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("footer",{class:o.normalizeClass(o.unref(n).b()),style:o.normalizeStyle(o.unref(r))},[o.renderSlot(a.$slots,"default")],6))}});var Bf=Te(vx,[["__file","footer.vue"]]);const gx=o.defineComponent({name:"ElHeader"}),mx=o.defineComponent({...gx,props:{height:{type:String,default:null}},setup(t){const e=t,n=Be("header"),r=o.computed(()=>e.height?n.cssVarBlock({height:e.height}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("header",{class:o.normalizeClass(o.unref(n).b()),style:o.normalizeStyle(o.unref(r))},[o.renderSlot(a.$slots,"default")],6))}});var Nf=Te(mx,[["__file","header.vue"]]);const yx=o.defineComponent({name:"ElMain"}),bx=o.defineComponent({...yx,setup(t){const e=Be("main");return(n,r)=>(o.openBlock(),o.createElementBlock("main",{class:o.normalizeClass(o.unref(e).b())},[o.renderSlot(n.$slots,"default")],2))}});var Df=Te(bx,[["__file","main.vue"]]);const Ol=ft(dx,{Aside:Tf,Footer:Bf,Header:Nf,Main:Df});Fn(Tf),Fn(Bf);const _f=Fn(Nf),Il=Fn(Df),wx=o.defineComponent({inheritAttrs:!1});function Cx(t,e,n,r,a,i){return o.renderSlot(t.$slots,"default")}var kx=Te(wx,[["render",Cx],["__file","collection.vue"]]);const xx=o.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function Ex(t,e,n,r,a,i){return o.renderSlot(t.$slots,"default")}var Sx=Te(xx,[["render",Ex],["__file","collection-item.vue"]]);const Tx="data-el-collection-item",Bx=t=>{const e=`El${t}Collection`,n=`${e}Item`,r=Symbol(e),a=Symbol(n),i={...kx,name:e,setup(){const l=o.ref(null),u=new Map,c=()=>{const d=o.unref(l);if(!d)return[];const f=Array.from(d.querySelectorAll(`[${Tx}]`));return[...u.values()].sort((v,p)=>f.indexOf(v.ref)-f.indexOf(p.ref))};o.provide(r,{itemMap:u,getItems:c,collectionRef:l})}},s={...Sx,name:n,setup(l,{attrs:u}){const c=o.ref(null),d=o.inject(r,void 0);o.provide(a,{collectionItemRef:c}),o.onMounted(()=>{const f=o.unref(c);f&&d.itemMap.set(f,{ref:f,...u})}),o.onBeforeUnmount(()=>{const f=o.unref(c);d.itemMap.delete(f)})}};return{COLLECTION_INJECTION_KEY:r,COLLECTION_ITEM_INJECTION_KEY:a,ElCollection:i,ElCollectionItem:s}},Ll=Ae({trigger:li.trigger,effect:{...$t.effect,default:"light"},type:{type:ke(String)},placement:{type:ke(String),default:"bottom"},popperOptions:{type:ke(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:ke([Number,String]),default:0},maxHeight:{type:ke([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:ke(Object)},teleported:$t.teleported});Ae({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:Xn}}),Ae({onKeydown:{type:ke(Function)}}),Bx("Dropdown");const Pf=Symbol("ElSelectGroup"),pi=Symbol("ElSelect");function Nx(t,e){const n=o.inject(pi),r=o.inject(Pf,{disabled:!1}),a=o.computed(()=>d(Wn(n.props.modelValue),t.value)),i=o.computed(()=>{var v;if(n.props.multiple){const p=Wn((v=n.props.modelValue)!=null?v:[]);return!a.value&&p.length>=n.props.multipleLimit&&n.props.multipleLimit>0}else return!1}),s=o.computed(()=>t.label||(gt(t.value)?"":t.value)),l=o.computed(()=>t.value||t.label||""),u=o.computed(()=>t.disabled||e.groupDisabled||i.value),c=o.getCurrentInstance(),d=(v=[],p)=>{if(gt(t.value)){const g=n.props.valueKey;return v&&v.some(y=>o.toRaw(Ln(y,g))===Ln(p,g))}else return v&&v.includes(p)},f=()=>{!t.disabled&&!r.disabled&&(n.states.hoveringIndex=n.optionsArray.indexOf(c.proxy))},h=v=>{const p=new RegExp(q1(v),"i");e.visible=p.test(s.value)||t.created};return o.watch(()=>s.value,()=>{!t.created&&!n.props.remote&&n.setSelected()}),o.watch(()=>t.value,(v,p)=>{const{remote:g,valueKey:y}=n.props;if(v!==p&&(n.onOptionDestroy(p,c.proxy),n.onOptionCreate(c.proxy)),!t.created&&!g){if(y&>(v)&>(p)&&v[y]===p[y])return;n.setSelected()}}),o.watch(()=>r.disabled,()=>{e.groupDisabled=r.disabled},{immediate:!0}),{select:n,currentLabel:s,currentValue:l,itemSelected:a,isDisabled:u,hoverItem:f,updateOption:h}}const Dx=o.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(t){const e=Be("select"),n=Co(),r=o.computed(()=>[e.be("dropdown","item"),e.is("disabled",o.unref(l)),e.is("selected",o.unref(s)),e.is("hovering",o.unref(h))]),a=o.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:i,itemSelected:s,isDisabled:l,select:u,hoverItem:c,updateOption:d}=Nx(t,a),{visible:f,hover:h}=o.toRefs(a),v=o.getCurrentInstance().proxy;u.onOptionCreate(v),o.onBeforeUnmount(()=>{const g=v.value,{selected:y}=u.states,b=(u.props.multiple?y:[y]).some(w=>w.value===v.value);o.nextTick(()=>{u.states.cachedOptions.get(g)===v&&!b&&u.states.cachedOptions.delete(g)}),u.onOptionDestroy(g,v)});function p(){l.value||u.handleOptionSelect(v)}return{ns:e,id:n,containerKls:r,currentLabel:i,itemSelected:s,isDisabled:l,select:u,hoverItem:c,updateOption:d,visible:f,hover:h,selectOptionClick:p,states:a}}});function _x(t,e,n,r,a,i){return o.withDirectives((o.openBlock(),o.createElementBlock("li",{id:t.id,class:o.normalizeClass(t.containerKls),role:"option","aria-disabled":t.isDisabled||void 0,"aria-selected":t.itemSelected,onMouseenter:t.hoverItem,onClick:o.withModifiers(t.selectOptionClick,["stop"])},[o.renderSlot(t.$slots,"default",{},()=>[o.createElementVNode("span",null,o.toDisplayString(t.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[o.vShow,t.visible]])}var Ml=Te(Dx,[["render",_x],["__file","option.vue"]]);const Px=o.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const t=o.inject(pi),e=Be("select"),n=o.computed(()=>t.props.popperClass),r=o.computed(()=>t.props.multiple),a=o.computed(()=>t.props.fitInputWidth),i=o.ref("");function s(){var l;i.value=`${(l=t.selectRef)==null?void 0:l.offsetWidth}px`}return o.onMounted(()=>{s(),Pn(t.selectRef,s)}),{ns:e,minWidth:i,popperClass:n,isMultiple:r,isFitInputWidth:a}}});function Ox(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([t.ns.b("dropdown"),t.ns.is("multiple",t.isMultiple),t.popperClass]),style:o.normalizeStyle({[t.isFitInputWidth?"width":"minWidth"]:t.minWidth})},[t.$slots.header?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(t.ns.be("dropdown","header"))},[o.renderSlot(t.$slots,"header")],2)):o.createCommentVNode("v-if",!0),o.renderSlot(t.$slots,"default"),t.$slots.footer?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(t.ns.be("dropdown","footer"))},[o.renderSlot(t.$slots,"footer")],2)):o.createCommentVNode("v-if",!0)],6)}var Ix=Te(Px,[["render",Ox],["__file","select-dropdown.vue"]]);const Lx=11,Mx=(t,e)=>{const{t:n}=Za(),r=Co(),a=Be("select"),i=Be("input"),s=o.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=o.ref(null),u=o.ref(null),c=o.ref(null),d=o.ref(null),f=o.ref(null),h=o.ref(null),v=o.ref(null),p=o.ref(null),g=o.ref(null),y=o.ref(null),m=o.ref(null),b=o.ref(null),{isComposing:w,handleCompositionStart:C,handleCompositionUpdate:k,handleCompositionEnd:E}=Rd({afterComposition:q=>Q(q)}),{wrapperRef:x,isFocused:B}=fl(f,{beforeFocus(){return O.value},afterFocus(){t.automaticDropdown&&!S.value&&(S.value=!0,s.menuVisibleOnFocus=!0)},beforeBlur(q){var ce,Pe;return((ce=c.value)==null?void 0:ce.isFocusInsideContent(q))||((Pe=d.value)==null?void 0:Pe.isFocusInsideContent(q))},afterBlur(){S.value=!1,s.menuVisibleOnFocus=!1}}),S=o.ref(!1),N=o.ref(),{form:D,formItem:_}=Dr(),{inputId:I}=oi(t,{formItemContext:_}),{valueOnClear:P,isEmptyValue:F}=a2(t),O=o.computed(()=>t.disabled||(D==null?void 0:D.disabled)),M=o.computed(()=>At(t.modelValue)?t.modelValue.length>0:!F(t.modelValue)),L=o.computed(()=>t.clearable&&!O.value&&s.inputHovering&&M.value),V=o.computed(()=>t.remote&&t.filterable&&!t.remoteShowSuffix?"":t.suffixIcon),H=o.computed(()=>a.is("reverse",V.value&&S.value)),$=o.computed(()=>(_==null?void 0:_.validateState)||""),z=o.computed(()=>td[$.value]),j=o.computed(()=>t.remote?300:0),ee=o.computed(()=>t.loading?t.loadingText||n("el.select.loading"):t.remote&&!s.inputValue&&s.options.size===0?!1:t.filterable&&s.inputValue&&s.options.size>0&&J.value===0?t.noMatchText||n("el.select.noMatch"):s.options.size===0?t.noDataText||n("el.select.noData"):null),J=o.computed(()=>X.value.filter(q=>q.visible).length),X=o.computed(()=>{const q=Array.from(s.options.values()),ce=[];return s.optionValues.forEach(Pe=>{const He=q.findIndex(Dn=>Dn.value===Pe);He>-1&&ce.push(q[He])}),ce.length>=q.length?ce:q}),ne=o.computed(()=>Array.from(s.cachedOptions.values())),Y=o.computed(()=>{const q=X.value.filter(ce=>!ce.created).some(ce=>ce.currentLabel===s.inputValue);return t.filterable&&t.allowCreate&&s.inputValue!==""&&!q}),A=()=>{t.filterable&&Lt(t.filterMethod)||t.filterable&&t.remote&&Lt(t.remoteMethod)||X.value.forEach(q=>{var ce;(ce=q.updateOption)==null||ce.call(q,s.inputValue)})},K=Nr(),W=o.computed(()=>["small"].includes(K.value)?"small":"default"),oe=o.computed({get(){return S.value&&ee.value!==!1},set(q){S.value=q}}),he=o.computed(()=>{if(t.multiple&&!Zn(t.modelValue))return Wn(t.modelValue).length===0&&!s.inputValue;const q=At(t.modelValue)?t.modelValue[0]:t.modelValue;return t.filterable||Zn(q)?!s.inputValue:!0}),re=o.computed(()=>{var q;const ce=(q=t.placeholder)!=null?q:n("el.select.placeholder");return t.multiple||!M.value?ce:s.selectedLabel}),se=o.computed(()=>Ps?null:"mouseenter");o.watch(()=>t.modelValue,(q,ce)=>{t.multiple&&t.filterable&&!t.reserveKeyword&&(s.inputValue="",ue("")),de(),!lo(q,ce)&&t.validateEvent&&(_==null||_.validate("change").catch(Pe=>tt(Pe)))},{flush:"post",deep:!0}),o.watch(()=>S.value,q=>{q?ue(s.inputValue):(s.inputValue="",s.previousQuery=null,s.isBeforeHide=!0),e("visible-change",q)}),o.watch(()=>s.options.entries(),()=>{var q;if(!et)return;const ce=((q=l.value)==null?void 0:q.querySelectorAll("input"))||[];(!t.filterable&&!t.defaultFirstOption&&!Zn(t.modelValue)||!Array.from(ce).includes(document.activeElement))&&de(),t.defaultFirstOption&&(t.filterable||t.remote)&&J.value&&pe()},{flush:"post"}),o.watch(()=>s.hoveringIndex,q=>{mt(q)&&q>-1?N.value=X.value[q]||{}:N.value={},X.value.forEach(ce=>{ce.hover=N.value===ce})}),o.watchEffect(()=>{s.isBeforeHide||A()});const ue=q=>{s.previousQuery===q||w.value||(s.previousQuery=q,t.filterable&&Lt(t.filterMethod)?t.filterMethod(q):t.filterable&&t.remote&&Lt(t.remoteMethod)&&t.remoteMethod(q),t.defaultFirstOption&&(t.filterable||t.remote)&&J.value?o.nextTick(pe):o.nextTick(Ne))},pe=()=>{const q=X.value.filter(He=>He.visible&&!He.disabled&&!He.states.groupDisabled),ce=q.find(He=>He.created),Pe=q[0];s.hoveringIndex=ge(X.value,ce||Pe)},de=()=>{if(t.multiple)s.selectedLabel="";else{const ce=At(t.modelValue)?t.modelValue[0]:t.modelValue,Pe=me(ce);s.selectedLabel=Pe.currentLabel,s.selected=[Pe];return}const q=[];Zn(t.modelValue)||Wn(t.modelValue).forEach(ce=>{q.push(me(ce))}),s.selected=q},me=q=>{let ce;const Pe=Is(q).toLowerCase()==="object",He=Is(q).toLowerCase()==="null",Dn=Is(q).toLowerCase()==="undefined";for(let Un=s.cachedOptions.size-1;Un>=0;Un--){const an=ne.value[Un];if(Pe?Ln(an.value,t.valueKey)===Ln(q,t.valueKey):an.value===q){ce={value:q,currentLabel:an.currentLabel,get isDisabled(){return an.isDisabled}};break}}if(ce)return ce;const yr=Pe?q.label:!He&&!Dn?q:"";return{value:q,currentLabel:yr}},Ne=()=>{s.hoveringIndex=X.value.findIndex(q=>s.selected.some(ce=>Ot(ce)===Ot(q)))},De=()=>{s.selectionWidth=u.value.getBoundingClientRect().width},Ee=()=>{s.calculatorWidth=h.value.getBoundingClientRect().width},_e=()=>{s.collapseItemWidth=m.value.getBoundingClientRect().width},te=()=>{var q,ce;(ce=(q=c.value)==null?void 0:q.updatePopper)==null||ce.call(q)},T=()=>{var q,ce;(ce=(q=d.value)==null?void 0:q.updatePopper)==null||ce.call(q)},R=()=>{s.inputValue.length>0&&!S.value&&(S.value=!0),ue(s.inputValue)},Q=q=>{if(s.inputValue=q.target.value,t.remote)G();else return R()},G=Yu(()=>{R()},j.value),U=q=>{lo(t.modelValue,q)||e(el,q)},ie=q=>V1(q,ce=>!s.disabledOptions.has(ce)),Z=q=>{if(t.multiple&&q.code!==it.delete&&q.target.value.length<=0){const ce=Wn(t.modelValue).slice(),Pe=ie(ce);if(Pe<0)return;const He=ce[Pe];ce.splice(Pe,1),e(yt,ce),U(ce),e("remove-tag",He)}},ae=(q,ce)=>{const Pe=s.selected.indexOf(ce);if(Pe>-1&&!O.value){const He=Wn(t.modelValue).slice();He.splice(Pe,1),e(yt,He),U(He),e("remove-tag",ce.value)}q.stopPropagation(),nt()},we=q=>{q.stopPropagation();const ce=t.multiple?[]:P.value;if(t.multiple)for(const Pe of s.selected)Pe.isDisabled&&ce.push(Pe.value);e(yt,ce),U(ce),s.hoveringIndex=-1,S.value=!1,e("clear"),nt()},Ce=q=>{var ce;if(t.multiple){const Pe=Wn((ce=t.modelValue)!=null?ce:[]).slice(),He=ge(Pe,q.value);He>-1?Pe.splice(He,1):(t.multipleLimit<=0||Pe.length<t.multipleLimit)&&Pe.push(q.value),e(yt,Pe),U(Pe),q.created&&ue(""),t.filterable&&!t.reserveKeyword&&(s.inputValue="")}else e(yt,q.value),U(q.value),S.value=!1;nt(),!S.value&&o.nextTick(()=>{Se(q)})},ge=(q=[],ce)=>{if(!gt(ce))return q.indexOf(ce);const Pe=t.valueKey;let He=-1;return q.some((Dn,yr)=>o.toRaw(Ln(Dn,Pe))===Ln(ce,Pe)?(He=yr,!0):!1),He},Se=q=>{var ce,Pe,He,Dn,yr;const za=At(q)?q[0]:q;let Un=null;if(za!=null&&za.value){const an=X.value.filter(br=>br.value===za.value);an.length>0&&(Un=an[0].$el)}if(c.value&&Un){const an=(Dn=(He=(Pe=(ce=c.value)==null?void 0:ce.popperRef)==null?void 0:Pe.contentRef)==null?void 0:He.querySelector)==null?void 0:Dn.call(He,`.${a.be("dropdown","wrap")}`);an&&W1(an,Un)}(yr=b.value)==null||yr.handleScroll()},ve=q=>{s.options.set(q.value,q),s.cachedOptions.set(q.value,q),q.disabled&&s.disabledOptions.set(q.value,q)},ye=(q,ce)=>{s.options.get(q)===ce&&s.options.delete(q)},Ge=o.computed(()=>{var q,ce;return(ce=(q=c.value)==null?void 0:q.popperRef)==null?void 0:ce.contentRef}),$e=()=>{s.isBeforeHide=!1,o.nextTick(()=>Se(s.selected))},nt=()=>{var q;(q=f.value)==null||q.focus()},rt=()=>{var q;(q=f.value)==null||q.blur()},Qe=q=>{we(q)},Pt=()=>{S.value=!1,B.value&&rt()},dt=()=>{s.inputValue.length>0?s.inputValue="":S.value=!1},pt=()=>{O.value||(Ps&&(s.inputHovering=!0),s.menuVisibleOnFocus?s.menuVisibleOnFocus=!1:S.value=!S.value)},Wt=()=>{S.value?X.value[s.hoveringIndex]&&Ce(X.value[s.hoveringIndex]):pt()},Ot=q=>gt(q.value)?Ln(q.value,t.valueKey):q.value,It=o.computed(()=>X.value.filter(q=>q.visible).every(q=>q.disabled)),rn=o.computed(()=>t.multiple?t.collapseTags?s.selected.slice(0,t.maxCollapseTags):s.selected:[]),vn=o.computed(()=>t.multiple?t.collapseTags?s.selected.slice(t.maxCollapseTags):[]:[]),Kt=q=>{if(!S.value){S.value=!0;return}if(!(s.options.size===0||s.filteredOptionsCount===0||w.value)&&!It.value){q==="next"?(s.hoveringIndex++,s.hoveringIndex===s.options.size&&(s.hoveringIndex=0)):q==="prev"&&(s.hoveringIndex--,s.hoveringIndex<0&&(s.hoveringIndex=s.options.size-1));const ce=X.value[s.hoveringIndex];(ce.disabled===!0||ce.states.groupDisabled===!0||!ce.visible)&&Kt(q),o.nextTick(()=>Se(N.value))}},Je=()=>{if(!u.value)return 0;const q=window.getComputedStyle(u.value);return Number.parseFloat(q.gap||"6px")},at=o.computed(()=>{const q=Je();return{maxWidth:`${m.value&&t.maxCollapseTags===1?s.selectionWidth-s.collapseItemWidth-q:s.selectionWidth}px`}}),vt=o.computed(()=>({maxWidth:`${s.selectionWidth}px`})),mr=o.computed(()=>({width:`${Math.max(s.calculatorWidth,Lx)}px`}));return Pn(u,De),Pn(h,Ee),Pn(g,te),Pn(x,te),Pn(y,T),Pn(m,_e),o.onMounted(()=>{de()}),{inputId:I,contentId:r,nsSelect:a,nsInput:i,states:s,isFocused:B,expanded:S,optionsArray:X,hoverOption:N,selectSize:K,filteredOptionsCount:J,resetCalculatorWidth:Ee,updateTooltip:te,updateTagTooltip:T,debouncedOnInputChange:G,onInput:Q,deletePrevTag:Z,deleteTag:ae,deleteSelected:we,handleOptionSelect:Ce,scrollToOption:Se,hasModelValue:M,shouldShowPlaceholder:he,currentPlaceholder:re,mouseEnterEventName:se,showClose:L,iconComponent:V,iconReverse:H,validateState:$,validateIcon:z,showNewOption:Y,updateOptions:A,collapseTagSize:W,setSelected:de,selectDisabled:O,emptyText:ee,handleCompositionStart:C,handleCompositionUpdate:k,handleCompositionEnd:E,onOptionCreate:ve,onOptionDestroy:ye,handleMenuEnter:$e,focus:nt,blur:rt,handleClearClick:Qe,handleClickOutside:Pt,handleEsc:dt,toggleMenu:pt,selectOption:Wt,getValueKey:Ot,navigateOptions:Kt,dropdownMenuVisible:oe,showTagList:rn,collapseTagList:vn,tagStyle:at,collapseTagStyle:vt,inputStyle:mr,popperRef:Ge,inputRef:f,tooltipRef:c,tagTooltipRef:d,calculatorRef:h,prefixRef:v,suffixRef:p,selectRef:l,wrapperRef:x,selectionRef:u,scrollbarRef:b,menuRef:g,tagMenuRef:y,collapseItemRef:m}};var Fx=o.defineComponent({name:"ElOptions",setup(t,{slots:e}){const n=o.inject(pi);let r=[];return()=>{var a,i;const s=(a=e.default)==null?void 0:a.call(e),l=[];function u(c){At(c)&&c.forEach(d=>{var f,h,v,p;const g=(f=(d==null?void 0:d.type)||{})==null?void 0:f.name;g==="ElOptionGroup"?u(!St(d.children)&&!At(d.children)&&Lt((h=d.children)==null?void 0:h.default)?(v=d.children)==null?void 0:v.default():d.children):g==="ElOption"?l.push((p=d.props)==null?void 0:p.value):At(d.children)&&u(d.children)})}return s.length&&u((i=s[0])==null?void 0:i.children),lo(l,r)||(r=l,n&&(n.states.optionValues=l)),s}}});const Ax=Ae({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:la,effect:{type:ke(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:ke(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:$t.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:Xn,default:Qs},fitInputWidth:Boolean,suffixIcon:{type:Xn,default:Ya},tagType:{...Dl.type,default:"info"},tagEffect:{...Dl.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:ke(String),values:go,default:"bottom-start"},fallbackPlacements:{type:ke(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...r2,...Jn(["ariaLabel"])}),Of="ElSelect",Vx=o.defineComponent({name:Of,componentName:Of,components:{ElSelectMenu:Ix,ElOption:Ml,ElOptions:Fx,ElTag:Tk,ElScrollbar:O2,ElTooltip:ci,ElIcon:ot},directives:{ClickOutside:pf},props:Ax,emits:[yt,el,"remove-tag","clear","visible-change","focus","blur"],setup(t,{emit:e}){const n=o.computed(()=>{const{modelValue:i,multiple:s}=t,l=s?[]:void 0;return At(i)?s?i:l:s?l:i}),r=o.reactive({...o.toRefs(t),modelValue:n}),a=Mx(r,e);return o.provide(pi,o.reactive({props:r,states:a.states,optionsArray:a.optionsArray,handleOptionSelect:a.handleOptionSelect,onOptionCreate:a.onOptionCreate,onOptionDestroy:a.onOptionDestroy,selectRef:a.selectRef,setSelected:a.setSelected})),{...a,modelValue:n}}});function Rx(t,e,n,r,a,i){const s=o.resolveComponent("el-tag"),l=o.resolveComponent("el-tooltip"),u=o.resolveComponent("el-icon"),c=o.resolveComponent("el-option"),d=o.resolveComponent("el-options"),f=o.resolveComponent("el-scrollbar"),h=o.resolveComponent("el-select-menu"),v=o.resolveDirective("click-outside");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"selectRef",class:o.normalizeClass([t.nsSelect.b(),t.nsSelect.m(t.selectSize)]),[o.toHandlerKey(t.mouseEnterEventName)]:p=>t.states.inputHovering=!0,onMouseleave:p=>t.states.inputHovering=!1},[o.createVNode(l,{ref:"tooltipRef",visible:t.dropdownMenuVisible,placement:t.placement,teleported:t.teleported,"popper-class":[t.nsSelect.e("popper"),t.popperClass],"popper-options":t.popperOptions,"fallback-placements":t.fallbackPlacements,effect:t.effect,pure:"",trigger:"click",transition:`${t.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:t.persistent,"append-to":t.appendTo,onBeforeShow:t.handleMenuEnter,onHide:p=>t.states.isBeforeHide=!1},{default:o.withCtx(()=>{var p;return[o.createElementVNode("div",{ref:"wrapperRef",class:o.normalizeClass([t.nsSelect.e("wrapper"),t.nsSelect.is("focused",t.isFocused),t.nsSelect.is("hovering",t.states.inputHovering),t.nsSelect.is("filterable",t.filterable),t.nsSelect.is("disabled",t.selectDisabled)]),onClick:o.withModifiers(t.toggleMenu,["prevent"])},[t.$slots.prefix?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"prefixRef",class:o.normalizeClass(t.nsSelect.e("prefix"))},[o.renderSlot(t.$slots,"prefix")],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{ref:"selectionRef",class:o.normalizeClass([t.nsSelect.e("selection"),t.nsSelect.is("near",t.multiple&&!t.$slots.prefix&&!!t.states.selected.length)])},[t.multiple?o.renderSlot(t.$slots,"tag",{key:0},()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.showTagList,g=>(o.openBlock(),o.createElementBlock("div",{key:t.getValueKey(g),class:o.normalizeClass(t.nsSelect.e("selected-item"))},[o.createVNode(s,{closable:!t.selectDisabled&&!g.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:o.normalizeStyle(t.tagStyle),onClose:y=>t.deleteTag(y,g)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(t.nsSelect.e("tags-text"))},[o.renderSlot(t.$slots,"label",{label:g.currentLabel,value:g.value},()=>[o.createTextVNode(o.toDisplayString(g.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),t.collapseTags&&t.states.selected.length>t.maxCollapseTags?(o.openBlock(),o.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:t.dropdownMenuVisible||!t.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:t.effect,placement:"bottom",teleported:t.teleported},{default:o.withCtx(()=>[o.createElementVNode("div",{ref:"collapseItemRef",class:o.normalizeClass(t.nsSelect.e("selected-item"))},[o.createVNode(s,{closable:!1,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:o.normalizeStyle(t.collapseTagStyle)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(t.nsSelect.e("tags-text"))}," + "+o.toDisplayString(t.states.selected.length-t.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:o.withCtx(()=>[o.createElementVNode("div",{ref:"tagMenuRef",class:o.normalizeClass(t.nsSelect.e("selection"))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.collapseTagList,g=>(o.openBlock(),o.createElementBlock("div",{key:t.getValueKey(g),class:o.normalizeClass(t.nsSelect.e("selected-item"))},[o.createVNode(s,{class:"in-tooltip",closable:!t.selectDisabled&&!g.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",onClose:y=>t.deleteTag(y,g)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(t.nsSelect.e("tags-text"))},[o.renderSlot(t.$slots,"label",{label:g.currentLabel,value:g.value},()=>[o.createTextVNode(o.toDisplayString(g.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):o.createCommentVNode("v-if",!0)]):o.createCommentVNode("v-if",!0),t.selectDisabled?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass([t.nsSelect.e("selected-item"),t.nsSelect.e("input-wrapper"),t.nsSelect.is("hidden",!t.filterable)])},[o.withDirectives(o.createElementVNode("input",{id:t.inputId,ref:"inputRef","onUpdate:modelValue":g=>t.states.inputValue=g,type:"text",name:t.name,class:o.normalizeClass([t.nsSelect.e("input"),t.nsSelect.is(t.selectSize)]),disabled:t.selectDisabled,autocomplete:t.autocomplete,style:o.normalizeStyle(t.inputStyle),role:"combobox",readonly:!t.filterable,spellcheck:"false","aria-activedescendant":((p=t.hoverOption)==null?void 0:p.id)||"","aria-controls":t.contentId,"aria-expanded":t.dropdownMenuVisible,"aria-label":t.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[o.withKeys(o.withModifiers(g=>t.navigateOptions("next"),["stop","prevent"]),["down"]),o.withKeys(o.withModifiers(g=>t.navigateOptions("prev"),["stop","prevent"]),["up"]),o.withKeys(o.withModifiers(t.handleEsc,["stop","prevent"]),["esc"]),o.withKeys(o.withModifiers(t.selectOption,["stop","prevent"]),["enter"]),o.withKeys(o.withModifiers(t.deletePrevTag,["stop"]),["delete"])],onCompositionstart:t.handleCompositionStart,onCompositionupdate:t.handleCompositionUpdate,onCompositionend:t.handleCompositionEnd,onInput:t.onInput,onClick:o.withModifiers(t.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[o.vModelText,t.states.inputValue]]),t.filterable?(o.openBlock(),o.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:o.normalizeClass(t.nsSelect.e("input-calculator")),textContent:o.toDisplayString(t.states.inputValue)},null,10,["textContent"])):o.createCommentVNode("v-if",!0)],2)),t.shouldShowPlaceholder?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass([t.nsSelect.e("selected-item"),t.nsSelect.e("placeholder"),t.nsSelect.is("transparent",!t.hasModelValue||t.expanded&&!t.states.inputValue)])},[t.hasModelValue?o.renderSlot(t.$slots,"label",{key:0,label:t.currentPlaceholder,value:t.modelValue},()=>[o.createElementVNode("span",null,o.toDisplayString(t.currentPlaceholder),1)]):(o.openBlock(),o.createElementBlock("span",{key:1},o.toDisplayString(t.currentPlaceholder),1))],2)):o.createCommentVNode("v-if",!0)],2),o.createElementVNode("div",{ref:"suffixRef",class:o.normalizeClass(t.nsSelect.e("suffix"))},[t.iconComponent&&!t.showClose?(o.openBlock(),o.createBlock(u,{key:0,class:o.normalizeClass([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.iconReverse])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.iconComponent)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),t.showClose&&t.clearIcon?(o.openBlock(),o.createBlock(u,{key:1,class:o.normalizeClass([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.nsSelect.e("clear")]),onClick:t.handleClearClick},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.clearIcon)))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0),t.validateState&&t.validateIcon?(o.openBlock(),o.createBlock(u,{key:2,class:o.normalizeClass([t.nsInput.e("icon"),t.nsInput.e("validateIcon")])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.validateIcon)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:o.withCtx(()=>[o.createVNode(h,{ref:"menuRef"},{default:o.withCtx(()=>[t.$slots.header?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(t.nsSelect.be("dropdown","header")),onClick:o.withModifiers(()=>{},["stop"])},[o.renderSlot(t.$slots,"header")],10,["onClick"])):o.createCommentVNode("v-if",!0),o.withDirectives(o.createVNode(f,{id:t.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":t.nsSelect.be("dropdown","wrap"),"view-class":t.nsSelect.be("dropdown","list"),class:o.normalizeClass([t.nsSelect.is("empty",t.filteredOptionsCount===0)]),role:"listbox","aria-label":t.ariaLabel,"aria-orientation":"vertical"},{default:o.withCtx(()=>[t.showNewOption?(o.openBlock(),o.createBlock(c,{key:0,value:t.states.inputValue,created:!0},null,8,["value"])):o.createCommentVNode("v-if",!0),o.createVNode(d,null,{default:o.withCtx(()=>[o.renderSlot(t.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[o.vShow,t.states.options.size>0&&!t.loading]]),t.$slots.loading&&t.loading?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(t.nsSelect.be("dropdown","loading"))},[o.renderSlot(t.$slots,"loading")],2)):t.loading||t.filteredOptionsCount===0?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(t.nsSelect.be("dropdown","empty"))},[o.renderSlot(t.$slots,"empty",{},()=>[o.createElementVNode("span",null,o.toDisplayString(t.emptyText),1)])],2)):o.createCommentVNode("v-if",!0),t.$slots.footer?(o.openBlock(),o.createElementBlock("div",{key:3,class:o.normalizeClass(t.nsSelect.be("dropdown","footer")),onClick:o.withModifiers(()=>{},["stop"])},[o.renderSlot(t.$slots,"footer")],10,["onClick"])):o.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[v,t.handleClickOutside,t.popperRef]])}var $x=Te(Vx,[["render",Rx],["__file","select.vue"]]);const zx=o.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(t){const e=Be("select"),n=o.ref(null),r=o.getCurrentInstance(),a=o.ref([]);o.provide(Pf,o.reactive({...o.toRefs(t)}));const i=o.computed(()=>a.value.some(c=>c.visible===!0)),s=c=>{var d,f;return((d=c.type)==null?void 0:d.name)==="ElOption"&&!!((f=c.component)!=null&&f.proxy)},l=c=>{const d=Wn(c),f=[];return d.forEach(h=>{var v,p;s(h)?f.push(h.component.proxy):(v=h.children)!=null&&v.length?f.push(...l(h.children)):(p=h.component)!=null&&p.subTree&&f.push(...l(h.component.subTree))}),f},u=()=>{a.value=l(r.subTree)};return o.onMounted(()=>{u()}),$g(n,u,{attributes:!0,subtree:!0,childList:!0}),{groupRef:n,visible:i,ns:e}}});function Hx(t,e,n,r,a,i){return o.withDirectives((o.openBlock(),o.createElementBlock("ul",{ref:"groupRef",class:o.normalizeClass(t.ns.be("group","wrap"))},[o.createElementVNode("li",{class:o.normalizeClass(t.ns.be("group","title"))},o.toDisplayString(t.label),3),o.createElementVNode("li",null,[o.createElementVNode("ul",{class:o.normalizeClass(t.ns.b("group"))},[o.renderSlot(t.$slots,"default")],2)])],2)),[[o.vShow,t.visible]])}var If=Te(zx,[["render",Hx],["__file","option-group.vue"]]);const Kx=ft($x,{Option:Ml,OptionGroup:If}),qx=Fn(Ml);Fn(If);const Ux=Ae({trigger:li.trigger,placement:Ll.placement,disabled:li.disabled,visible:$t.visible,transition:$t.transition,popperOptions:Ll.popperOptions,tabindex:Ll.tabindex,content:$t.content,popperStyle:$t.popperStyle,popperClass:$t.popperClass,enterable:{...$t.enterable,default:!0},effect:{...$t.effect,default:"light"},teleported:$t.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),Gx={"update:visible":t=>Jr(t),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},Wx="onUpdate:visible",jx=o.defineComponent({name:"ElPopover"}),Yx=o.defineComponent({...jx,props:Ux,emits:Gx,setup(t,{expose:e,emit:n}){const r=t,a=o.computed(()=>r[Wx]),i=Be("popover"),s=o.ref(),l=o.computed(()=>{var y;return(y=o.unref(s))==null?void 0:y.popperRef}),u=o.computed(()=>[{width:ea(r.width)},r.popperStyle]),c=o.computed(()=>[i.b(),r.popperClass,{[i.m("plain")]:!!r.content}]),d=o.computed(()=>r.transition===`${i.namespace.value}-fade-in-linear`),f=()=>{var y;(y=s.value)==null||y.hide()},h=()=>{n("before-enter")},v=()=>{n("before-leave")},p=()=>{n("after-enter")},g=()=>{n("update:visible",!1),n("after-leave")};return e({popperRef:l,hide:f}),(y,m)=>(o.openBlock(),o.createBlock(o.unref(ci),o.mergeProps({ref_key:"tooltipRef",ref:s},y.$attrs,{trigger:y.trigger,placement:y.placement,disabled:y.disabled,visible:y.visible,transition:y.transition,"popper-options":y.popperOptions,tabindex:y.tabindex,content:y.content,offset:y.offset,"show-after":y.showAfter,"hide-after":y.hideAfter,"auto-close":y.autoClose,"show-arrow":y.showArrow,"aria-label":y.title,effect:y.effect,enterable:y.enterable,"popper-class":o.unref(c),"popper-style":o.unref(u),teleported:y.teleported,persistent:y.persistent,"gpu-acceleration":o.unref(d),"onUpdate:visible":o.unref(a),onBeforeShow:h,onBeforeHide:v,onShow:p,onHide:g}),{content:o.withCtx(()=>[y.title?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(i).e("title")),role:"title"},o.toDisplayString(y.title),3)):o.createCommentVNode("v-if",!0),o.renderSlot(y.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(y.content),1)])]),default:o.withCtx(()=>[y.$slots.reference?o.renderSlot(y.$slots,"reference",{key:0}):o.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var Zx=Te(Yx,[["__file","popover.vue"]]);const Lf=(t,e)=>{const n=e.arg||e.value,r=n==null?void 0:n.popperRef;r&&(r.triggerRef=t)};var Xx={mounted(t,e){Lf(t,e)},updated(t,e){Lf(t,e)}};const Qx=Bb(Xx,"popover"),vi=ft(Zx,{directive:Qx}),ha="$treeNodeId",Mf=function(t,e){!e||e[ha]||Object.defineProperty(e,ha,{value:t.id,enumerable:!1,configurable:!1,writable:!1})},Fl=function(t,e){return t?e[t]:e[ha]},Al=(t,e,n)=>{const r=t.value.currentNode;n();const a=t.value.currentNode;r!==a&&e("current-change",a?a.data:null,a)},Vl=t=>{let e=!0,n=!0,r=!0;for(let a=0,i=t.length;a<i;a++){const s=t[a];(s.checked!==!0||s.indeterminate)&&(e=!1,s.disabled||(r=!1)),(s.checked!==!1||s.indeterminate)&&(n=!1)}return{all:e,none:n,allWithoutDisable:r,half:!e&&!n}},gi=function(t){if(t.childNodes.length===0||t.loading)return;const{all:e,none:n,half:r}=Vl(t.childNodes);e?(t.checked=!0,t.indeterminate=!1):r?(t.checked=!1,t.indeterminate=!0):n&&(t.checked=!1,t.indeterminate=!1);const a=t.parent;!a||a.level===0||t.store.checkStrictly||gi(a)},Po=function(t,e){const n=t.store.props,r=t.data||{},a=n[e];if(typeof a=="function")return a(r,t);if(typeof a=="string")return r[a];if(typeof a>"u"){const i=r[e];return i===void 0?"":i}};let Jx=0;class Or{constructor(e){this.id=Jx++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const n in e)wr(e,n)&&(this[n]=e[n]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const e=this.store;if(!e)throw new Error("[Node]store is required!");e.registerNode(this);const n=e.props;if(n&&typeof n.isLeaf<"u"){const i=Po(this,"isLeaf");typeof i=="boolean"&&(this.isLeafByUser=i)}if(e.lazy!==!0&&this.data?(this.setData(this.data),e.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&e.lazy&&e.defaultExpandAll&&!this.isLeafByUser&&this.expand(),Array.isArray(this.data)||Mf(this,this.data),!this.data)return;const r=e.defaultExpandedKeys,a=e.key;a&&r&&r.includes(this.key)&&this.expand(null,e.autoExpandParent),a&&e.currentNodeKey!==void 0&&this.key===e.currentNodeKey&&(e.currentNode=this,e.currentNode.isCurrent=!0),e.lazy&&e._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(e){Array.isArray(e)||Mf(this,e),this.data=e,this.childNodes=[];let n;this.level===0&&Array.isArray(this.data)?n=this.data:n=Po(this,"children")||[];for(let r=0,a=n.length;r<a;r++)this.insertChild({data:n[r]})}get label(){return Po(this,"label")}get key(){const e=this.store.key;return this.data?this.data[e]:null}get disabled(){return Po(this,"disabled")}get nextSibling(){const e=this.parent;if(e){const n=e.childNodes.indexOf(this);if(n>-1)return e.childNodes[n+1]}return null}get previousSibling(){const e=this.parent;if(e){const n=e.childNodes.indexOf(this);if(n>-1)return n>0?e.childNodes[n-1]:null}return null}contains(e,n=!0){return(this.childNodes||[]).some(r=>r===e||n&&r.contains(e))}remove(){const e=this.parent;e&&e.removeChild(this)}insertChild(e,n,r){if(!e)throw new Error("InsertChild error: child is required.");if(!(e instanceof Or)){if(!r){const a=this.getChildren(!0);a.includes(e.data)||(typeof n>"u"||n<0?a.push(e.data):a.splice(n,0,e.data))}Object.assign(e,{parent:this,store:this.store}),e=o.reactive(new Or(e)),e instanceof Or&&e.initialize()}e.level=this.level+1,typeof n>"u"||n<0?this.childNodes.push(e):this.childNodes.splice(n,0,e),this.updateLeafState()}insertBefore(e,n){let r;n&&(r=this.childNodes.indexOf(n)),this.insertChild(e,r)}insertAfter(e,n){let r;n&&(r=this.childNodes.indexOf(n),r!==-1&&(r+=1)),this.insertChild(e,r)}removeChild(e){const n=this.getChildren()||[],r=n.indexOf(e.data);r>-1&&n.splice(r,1);const a=this.childNodes.indexOf(e);a>-1&&(this.store&&this.store.deregisterNode(e),e.parent=null,this.childNodes.splice(a,1)),this.updateLeafState()}removeChildByData(e){let n=null;for(let r=0;r<this.childNodes.length;r++)if(this.childNodes[r].data===e){n=this.childNodes[r];break}n&&this.removeChild(n)}expand(e,n){const r=()=>{if(n){let a=this.parent;for(;a.level>0;)a.expanded=!0,a=a.parent}this.expanded=!0,e&&e(),this.childNodes.forEach(a=>{a.canFocus=!0})};this.shouldLoadData()?this.loadData(a=>{Array.isArray(a)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||gi(this),r())}):r()}doCreateChildren(e,n={}){e.forEach(r=>{this.insertChild(Object.assign({data:r},n),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(e=>{e.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const e=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!e||e.length===0;return}this.isLeaf=!1}setChecked(e,n,r,a){if(this.indeterminate=e==="half",this.checked=e===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:s,allWithoutDisable:l}=Vl(this.childNodes);!this.isLeaf&&!s&&l&&(this.checked=!1,e=!1);const u=()=>{if(n){const c=this.childNodes;for(let h=0,v=c.length;h<v;h++){const p=c[h];a=a||e!==!1;const g=p.disabled?p.checked:a;p.setChecked(g,n,!0,a)}const{half:d,all:f}=Vl(c);f||(this.checked=f,this.indeterminate=d)}};if(this.shouldLoadData()){this.loadData(()=>{u(),gi(this)},{checked:e!==!1});return}else u()}const i=this.parent;!i||i.level===0||r||gi(i)}getChildren(e=!1){if(this.level===0)return this.data;const n=this.data;if(!n)return null;const r=this.store.props;let a="children";return r&&(a=r.children||"children"),n[a]===void 0&&(n[a]=null),e&&!n[a]&&(n[a]=[]),n[a]}updateChildren(){const e=this.getChildren()||[],n=this.childNodes.map(i=>i.data),r={},a=[];e.forEach((i,s)=>{const l=i[ha];!!l&&n.findIndex(c=>c[ha]===l)>=0?r[l]={index:s,data:i}:a.push({index:s,data:i})}),this.store.lazy||n.forEach(i=>{r[i[ha]]||this.removeChildByData(i)}),a.forEach(({index:i,data:s})=>{this.insertChild({data:s},i)}),this.updateLeafState()}loadData(e,n={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(n).length)){this.loading=!0;const r=i=>{this.childNodes=[],this.doCreateChildren(i,n),this.loaded=!0,this.loading=!1,this.updateLeafState(),e&&e.call(this,i)},a=()=>{this.loading=!1};this.store.load(this,r,a)}else e&&e.call(this)}eachNode(e){const n=[this];for(;n.length;){const r=n.shift();n.unshift(...r.childNodes),e(r)}}reInitChecked(){this.store.checkStrictly||gi(this)}}class eE{constructor(e){this.currentNode=null,this.currentNodeKey=null;for(const n in e)wr(e,n)&&(this[n]=e[n]);this.nodesMap={}}initialize(){if(this.root=new Or({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const e=this.load;e(this.root,n=>{this.root.doCreateChildren(n),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(e){const n=this.filterNodeMethod,r=this.lazy,a=function(i){const s=i.root?i.root.childNodes:i.childNodes;if(s.forEach(l=>{l.visible=n.call(l,e,l.data,l),a(l)}),!i.visible&&s.length){let l=!0;l=!s.some(u=>u.visible),i.root?i.root.visible=l===!1:i.visible=l===!1}e&&i.visible&&!i.isLeaf&&(!r||i.loaded)&&i.expand()};a(this)}setData(e){e!==this.root.data?(this.nodesMap={},this.root.setData(e),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(e){if(e instanceof Or)return e;const n=gt(e)?Fl(this.key,e):e;return this.nodesMap[n]||null}insertBefore(e,n){const r=this.getNode(n);r.parent.insertBefore({data:e},r)}insertAfter(e,n){const r=this.getNode(n);r.parent.insertAfter({data:e},r)}remove(e){const n=this.getNode(e);n&&n.parent&&(n===this.currentNode&&(this.currentNode=null),n.parent.removeChild(n))}append(e,n){const r=co(n)?this.root:this.getNode(n);r&&r.insertChild({data:e})}_initDefaultCheckedNodes(){const e=this.defaultCheckedKeys||[],n=this.nodesMap;e.forEach(r=>{const a=n[r];a&&a.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(e){(this.defaultCheckedKeys||[]).includes(e.key)&&e.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(e){e!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=e,this._initDefaultCheckedNodes())}registerNode(e){const n=this.key;!e||!e.data||(n?e.key!==void 0&&(this.nodesMap[e.key]=e):this.nodesMap[e.id]=e)}deregisterNode(e){!this.key||!e||!e.data||(e.childNodes.forEach(r=>{this.deregisterNode(r)}),delete this.nodesMap[e.key])}getCheckedNodes(e=!1,n=!1){const r=[],a=function(i){(i.root?i.root.childNodes:i.childNodes).forEach(l=>{(l.checked||n&&l.indeterminate)&&(!e||e&&l.isLeaf)&&r.push(l.data),a(l)})};return a(this),r}getCheckedKeys(e=!1){return this.getCheckedNodes(e).map(n=>(n||{})[this.key])}getHalfCheckedNodes(){const e=[],n=function(r){(r.root?r.root.childNodes:r.childNodes).forEach(i=>{i.indeterminate&&e.push(i.data),n(i)})};return n(this),e}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(e=>(e||{})[this.key])}_getAllNodes(){const e=[],n=this.nodesMap;for(const r in n)wr(n,r)&&e.push(n[r]);return e}updateChildren(e,n){const r=this.nodesMap[e];if(!r)return;const a=r.childNodes;for(let i=a.length-1;i>=0;i--){const s=a[i];this.remove(s.data)}for(let i=0,s=n.length;i<s;i++){const l=n[i];this.append(l,r.data)}}_setCheckedKeys(e,n=!1,r){const a=this._getAllNodes().sort((u,c)=>u.level-c.level),i=Object.create(null),s=Object.keys(r);a.forEach(u=>u.setChecked(!1,!1));const l=u=>{u.childNodes.forEach(c=>{var d;i[c.data[e]]=!0,(d=c.childNodes)!=null&&d.length&&l(c)})};for(let u=0,c=a.length;u<c;u++){const d=a[u],f=d.data[e].toString();if(!s.includes(f)){d.checked&&!i[f]&&d.setChecked(!1,!1);continue}if(d.childNodes.length&&l(d),d.isLeaf||this.checkStrictly){d.setChecked(!0,!1);continue}if(d.setChecked(!0,!0),n){d.setChecked(!1,!1);const v=function(p){p.childNodes.forEach(y=>{y.isLeaf||y.setChecked(!1,!1),v(y)})};v(d)}}}setCheckedNodes(e,n=!1){const r=this.key,a={};e.forEach(i=>{a[(i||{})[r]]=!0}),this._setCheckedKeys(r,n,a)}setCheckedKeys(e,n=!1){this.defaultCheckedKeys=e;const r=this.key,a={};e.forEach(i=>{a[i]=!0}),this._setCheckedKeys(r,n,a)}setDefaultExpandedKeys(e){e=e||[],this.defaultExpandedKeys=e,e.forEach(n=>{const r=this.getNode(n);r&&r.expand(null,this.autoExpandParent)})}setChecked(e,n,r){const a=this.getNode(e);a&&a.setChecked(!!n,r)}getCurrentNode(){return this.currentNode}setCurrentNode(e){const n=this.currentNode;n&&(n.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0}setUserCurrentNode(e,n=!0){const r=e[this.key],a=this.nodesMap[r];this.setCurrentNode(a),n&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(e,n=!0){if(e==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const r=this.getNode(e);r&&(this.setCurrentNode(r),n&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const tE=o.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(t){const e=Be("tree"),n=o.inject("NodeInstance"),r=o.inject("RootTree");return()=>{const a=t.node,{data:i,store:s}=a;return t.renderContent?t.renderContent(o.h,{_self:n,node:a,data:i,store:s}):o.renderSlot(r.ctx.slots,"default",{node:a,data:i},()=>[o.h("span",{class:e.be("node","label")},[a.label])])}}});var nE=Te(tE,[["__file","tree-node-content.vue"]]);function Ff(t){const e=o.inject("TreeNodeMap",null),n={treeNodeExpand:r=>{t.node!==r&&t.node.collapse()},children:[]};return e&&e.children.push(n),o.provide("TreeNodeMap",n),{broadcastExpanded:r=>{if(t.accordion)for(const a of n.children)a.treeNodeExpand(r)}}}const Af=Symbol("dragEvents");function rE({props:t,ctx:e,el$:n,dropIndicator$:r,store:a}){const i=Be("tree"),s=o.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),l=({event:d,treeNode:f})=>{if(typeof t.allowDrag=="function"&&!t.allowDrag(f.node))return d.preventDefault(),!1;d.dataTransfer.effectAllowed="move";try{d.dataTransfer.setData("text/plain","")}catch{}s.value.draggingNode=f,e.emit("node-drag-start",f.node,d)},u=({event:d,treeNode:f})=>{const h=f,v=s.value.dropNode;v&&v.node.id!==h.node.id&&Sr(v.$el,i.is("drop-inner"));const p=s.value.draggingNode;if(!p||!h)return;let g=!0,y=!0,m=!0,b=!0;typeof t.allowDrop=="function"&&(g=t.allowDrop(p.node,h.node,"prev"),b=y=t.allowDrop(p.node,h.node,"inner"),m=t.allowDrop(p.node,h.node,"next")),d.dataTransfer.dropEffect=y||g||m?"move":"none",(g||y||m)&&(v==null?void 0:v.node.id)!==h.node.id&&(v&&e.emit("node-drag-leave",p.node,v.node,d),e.emit("node-drag-enter",p.node,h.node,d)),g||y||m?s.value.dropNode=h:s.value.dropNode=null,h.node.nextSibling===p.node&&(m=!1),h.node.previousSibling===p.node&&(g=!1),h.node.contains(p.node,!1)&&(y=!1),(p.node===h.node||p.node.contains(h.node))&&(g=!1,y=!1,m=!1);const w=h.$el.querySelector(`.${i.be("node","content")}`).getBoundingClientRect(),C=n.value.getBoundingClientRect();let k;const E=g?y?.25:m?.45:1:-1,x=m?y?.75:g?.55:0:1;let B=-9999;const S=d.clientY-w.top;S<w.height*E?k="before":S>w.height*x?k="after":y?k="inner":k="none";const N=h.$el.querySelector(`.${i.be("node","expand-icon")}`).getBoundingClientRect(),D=r.value;k==="before"?B=N.top-C.top:k==="after"&&(B=N.bottom-C.top),D.style.top=`${B}px`,D.style.left=`${N.right-C.left}px`,k==="inner"?Zs(h.$el,i.is("drop-inner")):Sr(h.$el,i.is("drop-inner")),s.value.showDropIndicator=k==="before"||k==="after",s.value.allowDrop=s.value.showDropIndicator||b,s.value.dropType=k,e.emit("node-drag-over",p.node,h.node,d)},c=d=>{const{draggingNode:f,dropType:h,dropNode:v}=s.value;if(d.preventDefault(),d.dataTransfer&&(d.dataTransfer.dropEffect="move"),f&&v){const p={data:f.node.data};h!=="none"&&f.node.remove(),h==="before"?v.node.parent.insertBefore(p,v.node):h==="after"?v.node.parent.insertAfter(p,v.node):h==="inner"&&v.node.insertChild(p),h!=="none"&&(a.value.registerNode(p),a.value.key&&f.node.eachNode(g=>{var y;(y=a.value.nodesMap[g.data[a.value.key]])==null||y.setChecked(g.checked,!a.value.checkStrictly)})),Sr(v.$el,i.is("drop-inner")),e.emit("node-drag-end",f.node,v.node,h,d),h!=="none"&&e.emit("node-drop",f.node,v.node,h,d)}f&&!v&&e.emit("node-drag-end",f.node,null,h,d),s.value.showDropIndicator=!1,s.value.draggingNode=null,s.value.dropNode=null,s.value.allowDrop=!0};return o.provide(Af,{treeNodeDragStart:l,treeNodeDragOver:u,treeNodeDragEnd:c}),{dragState:s}}const aE=o.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:Vk,ElCheckbox:Ck,NodeContent:nE,ElIcon:ot,Loading:Js},props:{node:{type:Or,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(t,e){const n=Be("tree"),{broadcastExpanded:r}=Ff(t),a=o.inject("RootTree"),i=o.ref(!1),s=o.ref(!1),l=o.ref(null),u=o.ref(null),c=o.ref(null),d=o.inject(Af),f=o.getCurrentInstance();o.provide("NodeInstance",f),a||tt("Tree","Can not find node's tree."),t.node.expanded&&(i.value=!0,s.value=!0);const h=a.props.props.children||"children";o.watch(()=>{const S=t.node.data[h];return S&&[...S]},()=>{t.node.updateChildren()}),o.watch(()=>t.node.indeterminate,S=>{g(t.node.checked,S)}),o.watch(()=>t.node.checked,S=>{g(S,t.node.indeterminate)}),o.watch(()=>t.node.childNodes.length,()=>t.node.reInitChecked()),o.watch(()=>t.node.expanded,S=>{o.nextTick(()=>i.value=S),S&&(s.value=!0)});const v=S=>Fl(a.props.nodeKey,S.data),p=S=>{const N=t.props.class;if(!N)return{};let D;if(Lt(N)){const{data:_}=S;D=N(_,S)}else D=N;return St(D)?{[D]:!0}:D},g=(S,N)=>{(l.value!==S||u.value!==N)&&a.ctx.emit("check-change",t.node.data,S,N),l.value=S,u.value=N},y=S=>{Al(a.store,a.ctx.emit,()=>a.store.value.setCurrentNode(t.node)),a.currentNode.value=t.node,a.props.expandOnClickNode&&b(),a.props.checkOnClickNode&&!t.node.disabled&&w(null,{target:{checked:!t.node.checked}}),a.ctx.emit("node-click",t.node.data,t.node,f,S)},m=S=>{a.instance.vnode.props.onNodeContextmenu&&(S.stopPropagation(),S.preventDefault()),a.ctx.emit("node-contextmenu",S,t.node.data,t.node,f)},b=()=>{t.node.isLeaf||(i.value?(a.ctx.emit("node-collapse",t.node.data,t.node,f),t.node.collapse()):t.node.expand(()=>{e.emit("node-expand",t.node.data,t.node,f)}))},w=(S,N)=>{t.node.setChecked(N.target.checked,!a.props.checkStrictly),o.nextTick(()=>{const D=a.store.value;a.ctx.emit("check",t.node.data,{checkedNodes:D.getCheckedNodes(),checkedKeys:D.getCheckedKeys(),halfCheckedNodes:D.getHalfCheckedNodes(),halfCheckedKeys:D.getHalfCheckedKeys()})})};return{ns:n,node$:c,tree:a,expanded:i,childNodeRendered:s,oldChecked:l,oldIndeterminate:u,getNodeKey:v,getNodeClass:p,handleSelectChange:g,handleClick:y,handleContextMenu:m,handleExpandIconClick:b,handleCheckChange:w,handleChildNodeExpand:(S,N,D)=>{r(N),a.ctx.emit("node-expand",S,N,D)},handleDragStart:S=>{a.props.draggable&&d.treeNodeDragStart({event:S,treeNode:t})},handleDragOver:S=>{S.preventDefault(),a.props.draggable&&d.treeNodeDragOver({event:S,treeNode:{$el:c.value,node:t.node}})},handleDrop:S=>{S.preventDefault()},handleDragEnd:S=>{a.props.draggable&&d.treeNodeDragEnd(S)},CaretRight:J1}}});function iE(t,e,n,r,a,i){const s=o.resolveComponent("el-icon"),l=o.resolveComponent("el-checkbox"),u=o.resolveComponent("loading"),c=o.resolveComponent("node-content"),d=o.resolveComponent("el-tree-node"),f=o.resolveComponent("el-collapse-transition");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"node$",class:o.normalizeClass([t.ns.b("node"),t.ns.is("expanded",t.expanded),t.ns.is("current",t.node.isCurrent),t.ns.is("hidden",!t.node.visible),t.ns.is("focusable",!t.node.disabled),t.ns.is("checked",!t.node.disabled&&t.node.checked),t.getNodeClass(t.node)]),role:"treeitem",tabindex:"-1","aria-expanded":t.expanded,"aria-disabled":t.node.disabled,"aria-checked":t.node.checked,draggable:t.tree.props.draggable,"data-key":t.getNodeKey(t.node),onClick:o.withModifiers(t.handleClick,["stop"]),onContextmenu:t.handleContextMenu,onDragstart:o.withModifiers(t.handleDragStart,["stop"]),onDragover:o.withModifiers(t.handleDragOver,["stop"]),onDragend:o.withModifiers(t.handleDragEnd,["stop"]),onDrop:o.withModifiers(t.handleDrop,["stop"])},[o.createElementVNode("div",{class:o.normalizeClass(t.ns.be("node","content")),style:o.normalizeStyle({paddingLeft:(t.node.level-1)*t.tree.props.indent+"px"})},[t.tree.props.icon||t.CaretRight?(o.openBlock(),o.createBlock(s,{key:0,class:o.normalizeClass([t.ns.be("node","expand-icon"),t.ns.is("leaf",t.node.isLeaf),{expanded:!t.node.isLeaf&&t.expanded}]),onClick:o.withModifiers(t.handleExpandIconClick,["stop"])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.tree.props.icon||t.CaretRight)))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0),t.showCheckbox?(o.openBlock(),o.createBlock(l,{key:1,"model-value":t.node.checked,indeterminate:t.node.indeterminate,disabled:!!t.node.disabled,onClick:o.withModifiers(()=>{},["stop"]),onChange:t.handleCheckChange},null,8,["model-value","indeterminate","disabled","onClick","onChange"])):o.createCommentVNode("v-if",!0),t.node.loading?(o.openBlock(),o.createBlock(s,{key:2,class:o.normalizeClass([t.ns.be("node","loading-icon"),t.ns.is("loading")])},{default:o.withCtx(()=>[o.createVNode(u)]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),o.createVNode(c,{node:t.node,"render-content":t.renderContent},null,8,["node","render-content"])],6),o.createVNode(f,null,{default:o.withCtx(()=>[!t.renderAfterExpand||t.childNodeRendered?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(t.ns.be("node","children")),role:"group","aria-expanded":t.expanded},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.node.childNodes,h=>(o.openBlock(),o.createBlock(d,{key:t.getNodeKey(h),"render-content":t.renderContent,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,node:h,accordion:t.accordion,props:t.props,onNodeExpand:t.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,["aria-expanded"])),[[o.vShow,t.expanded]]):o.createCommentVNode("v-if",!0)]),_:1})],42,["aria-expanded","aria-disabled","aria-checked","draggable","data-key","onClick","onContextmenu","onDragstart","onDragover","onDragend","onDrop"])),[[o.vShow,t.node.visible]])}var oE=Te(aE,[["render",iE],["__file","tree-node.vue"]]);function sE({el$:t},e){const n=Be("tree"),r=o.shallowRef([]),a=o.shallowRef([]);o.onMounted(()=>{s()}),o.onUpdated(()=>{r.value=Array.from(t.value.querySelectorAll("[role=treeitem]")),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"))}),o.watch(a,l=>{l.forEach(u=>{u.setAttribute("tabindex","-1")})}),jt(t,"keydown",l=>{const u=l.target;if(!u.className.includes(n.b("node")))return;const c=l.code;r.value=Array.from(t.value.querySelectorAll(`.${n.is("focusable")}[role=treeitem]`));const d=r.value.indexOf(u);let f;if([it.up,it.down].includes(c)){if(l.preventDefault(),c===it.up){f=d===-1?0:d!==0?d-1:r.value.length-1;const v=f;for(;!e.value.getNode(r.value[f].dataset.key).canFocus;){if(f--,f===v){f=-1;break}f<0&&(f=r.value.length-1)}}else{f=d===-1?0:d<r.value.length-1?d+1:0;const v=f;for(;!e.value.getNode(r.value[f].dataset.key).canFocus;){if(f++,f===v){f=-1;break}f>=r.value.length&&(f=0)}}f!==-1&&r.value[f].focus()}[it.left,it.right].includes(c)&&(l.preventDefault(),u.click());const h=u.querySelector('[type="checkbox"]');[it.enter,it.space].includes(c)&&h&&(l.preventDefault(),h.click())});const s=()=>{var l;r.value=Array.from(t.value.querySelectorAll(`.${n.is("focusable")}[role=treeitem]`)),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"));const u=t.value.querySelectorAll(`.${n.is("checked")}[role=treeitem]`);if(u.length){u[0].setAttribute("tabindex","0");return}(l=r.value[0])==null||l.setAttribute("tabindex","0")}}const lE=o.defineComponent({name:"ElTree",components:{ElTreeNode:oE},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:Xn}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(t,e){const{t:n}=Za(),r=Be("tree"),a=o.inject(pi,null),i=o.ref(new eE({key:t.nodeKey,data:t.data,lazy:t.lazy,props:t.props,load:t.load,currentNodeKey:t.currentNodeKey,checkStrictly:t.checkStrictly,checkDescendants:t.checkDescendants,defaultCheckedKeys:t.defaultCheckedKeys,defaultExpandedKeys:t.defaultExpandedKeys,autoExpandParent:t.autoExpandParent,defaultExpandAll:t.defaultExpandAll,filterNodeMethod:t.filterNodeMethod}));i.value.initialize();const s=o.ref(i.value.root),l=o.ref(null),u=o.ref(null),c=o.ref(null),{broadcastExpanded:d}=Ff(t),{dragState:f}=rE({props:t,ctx:e,el$:u,dropIndicator$:c,store:i});sE({el$:u},i);const h=o.computed(()=>{const{childNodes:L}=s.value,V=a?a.hasFilteredOptions!==0:!1;return(!L||L.length===0||L.every(({visible:H})=>!H))&&!V});o.watch(()=>t.currentNodeKey,L=>{i.value.setCurrentNodeKey(L)}),o.watch(()=>t.defaultCheckedKeys,L=>{i.value.setDefaultCheckedKey(L)}),o.watch(()=>t.defaultExpandedKeys,L=>{i.value.setDefaultExpandedKeys(L)}),o.watch(()=>t.data,L=>{i.value.setData(L)},{deep:!0}),o.watch(()=>t.checkStrictly,L=>{i.value.checkStrictly=L});const v=L=>{if(!t.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");i.value.filter(L)},p=L=>Fl(t.nodeKey,L.data),g=L=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const V=i.value.getNode(L);if(!V)return[];const H=[V.data];let $=V.parent;for(;$&&$!==s.value;)H.push($.data),$=$.parent;return H.reverse()},y=(L,V)=>i.value.getCheckedNodes(L,V),m=L=>i.value.getCheckedKeys(L),b=()=>{const L=i.value.getCurrentNode();return L?L.data:null},w=()=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const L=b();return L?L[t.nodeKey]:null},C=(L,V)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");i.value.setCheckedNodes(L,V)},k=(L,V)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");i.value.setCheckedKeys(L,V)},E=(L,V,H)=>{i.value.setChecked(L,V,H)},x=()=>i.value.getHalfCheckedNodes(),B=()=>i.value.getHalfCheckedKeys(),S=(L,V=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");Al(i,e.emit,()=>{d(L),i.value.setUserCurrentNode(L,V)})},N=(L,V=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");Al(i,e.emit,()=>{d(),i.value.setCurrentNodeKey(L,V)})},D=L=>i.value.getNode(L),_=L=>{i.value.remove(L)},I=(L,V)=>{i.value.append(L,V)},P=(L,V)=>{i.value.insertBefore(L,V)},F=(L,V)=>{i.value.insertAfter(L,V)},O=(L,V,H)=>{d(V),e.emit("node-expand",L,V,H)},M=(L,V)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");i.value.updateChildren(L,V)};return o.provide("RootTree",{ctx:e,props:t,store:i,root:s,currentNode:l,instance:o.getCurrentInstance()}),o.provide(ai,void 0),{ns:r,store:i,root:s,currentNode:l,dragState:f,el$:u,dropIndicator$:c,isEmpty:h,filter:v,getNodeKey:p,getNodePath:g,getCheckedNodes:y,getCheckedKeys:m,getCurrentNode:b,getCurrentKey:w,setCheckedNodes:C,setCheckedKeys:k,setChecked:E,getHalfCheckedNodes:x,getHalfCheckedKeys:B,setCurrentNode:S,setCurrentKey:N,t:n,getNode:D,remove:_,append:I,insertBefore:P,insertAfter:F,handleNodeExpand:O,updateKeyChildren:M}}});function cE(t,e,n,r,a,i){const s=o.resolveComponent("el-tree-node");return o.openBlock(),o.createElementBlock("div",{ref:"el$",class:o.normalizeClass([t.ns.b(),t.ns.is("dragging",!!t.dragState.draggingNode),t.ns.is("drop-not-allow",!t.dragState.allowDrop),t.ns.is("drop-inner",t.dragState.dropType==="inner"),{[t.ns.m("highlight-current")]:t.highlightCurrent}]),role:"tree"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.root.childNodes,l=>(o.openBlock(),o.createBlock(s,{key:t.getNodeKey(l),node:l,props:t.props,accordion:t.accordion,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,"render-content":t.renderContent,onNodeExpand:t.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),t.isEmpty?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(t.ns.e("empty-block"))},[o.renderSlot(t.$slots,"empty",{},()=>{var l;return[o.createElementVNode("span",{class:o.normalizeClass(t.ns.e("empty-text"))},o.toDisplayString((l=t.emptyText)!=null?l:t.t("el.tree.emptyText")),3)]})],2)):o.createCommentVNode("v-if",!0),o.withDirectives(o.createElementVNode("div",{ref:"dropIndicator$",class:o.normalizeClass(t.ns.e("drop-indicator"))},null,2),[[o.vShow,t.dragState.showDropIndicator]])],2)}var uE=Te(lE,[["render",cE],["__file","tree.vue"]]);const dE=ft(uE);function fE(t){let e;const n=o.ref(!1),r=o.reactive({...t,originalPosition:"",originalOverflow:"",visible:!1});function a(h){r.text=h}function i(){const h=r.parent,v=f.ns;if(!h.vLoadingAddClassList){let p=h.getAttribute("loading-number");p=Number.parseInt(p)-1,p?h.setAttribute("loading-number",p.toString()):(Sr(h,v.bm("parent","relative")),h.removeAttribute("loading-number")),Sr(h,v.bm("parent","hidden"))}s(),d.unmount()}function s(){var h,v;(v=(h=f.$el)==null?void 0:h.parentNode)==null||v.removeChild(f.$el)}function l(){var h;t.beforeClose&&!t.beforeClose()||(n.value=!0,clearTimeout(e),e=setTimeout(u,400),r.visible=!1,(h=t.closed)==null||h.call(t))}function u(){if(!n.value)return;const h=r.parent;n.value=!1,h.vLoadingAddClassList=void 0,i()}const c=o.defineComponent({name:"ElLoading",setup(h,{expose:v}){const{ns:p,zIndex:g}=o2("loading");return v({ns:p,zIndex:g}),()=>{const y=r.spinner||r.svg,m=o.h("svg",{class:"circular",viewBox:r.svgViewBox?r.svgViewBox:"0 0 50 50",...y?{innerHTML:y}:{}},[o.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),b=r.text?o.h("p",{class:p.b("text")},[r.text]):void 0;return o.h(o.Transition,{name:p.b("fade"),onAfterLeave:u},{default:o.withCtx(()=>[o.withDirectives(o.createVNode("div",{style:{backgroundColor:r.background||""},class:[p.b("mask"),r.customClass,r.fullscreen?"is-fullscreen":""]},[o.h("div",{class:p.b("spinner")},[m,b])]),[[o.vShow,r.visible]])])})}}}),d=o.createApp(c),f=d.mount(document.createElement("div"));return{...o.toRefs(r),setText:a,removeElLoadingChild:s,close:l,handleAfterLeave:u,vm:f,get $el(){return f.$el}}}let Oo;const hE=function(t={}){if(!et)return;const e=pE(t);if(e.fullscreen&&Oo)return Oo;const n=fE({...e,closed:()=>{var a;(a=e.closed)==null||a.call(e),e.fullscreen&&(Oo=void 0)}});vE(e,e.parent,n),Vf(e,e.parent,n),e.parent.vLoadingAddClassList=()=>Vf(e,e.parent,n);let r=e.parent.getAttribute("loading-number");return r?r=`${Number.parseInt(r)+1}`:r="1",e.parent.setAttribute("loading-number",r),e.parent.appendChild(n.$el),o.nextTick(()=>n.visible.value=e.visible),e.fullscreen&&(Oo=n),n},pE=t=>{var e,n,r,a;let i;return St(t.target)?i=(e=document.querySelector(t.target))!=null?e:document.body:i=t.target||document.body,{parent:i===document.body||t.body?document.body:i,background:t.background||"",svg:t.svg||"",svgViewBox:t.svgViewBox||"",spinner:t.spinner||!1,text:t.text||"",fullscreen:i===document.body&&((n=t.fullscreen)!=null?n:!0),lock:(r=t.lock)!=null?r:!1,customClass:t.customClass||"",visible:(a=t.visible)!=null?a:!0,beforeClose:t.beforeClose,closed:t.closed,target:i}},vE=async(t,e,n)=>{const{nextZIndex:r}=n.vm.zIndex||n.vm._.exposed.zIndex,a={};if(t.fullscreen)n.originalPosition.value=ja(document.body,"position"),n.originalOverflow.value=ja(document.body,"overflow"),a.zIndex=r();else if(t.parent===document.body){n.originalPosition.value=ja(document.body,"position"),await o.nextTick();for(const i of["top","left"]){const s=i==="top"?"scrollTop":"scrollLeft";a[i]=`${t.target.getBoundingClientRect()[i]+document.body[s]+document.documentElement[s]-Number.parseInt(ja(document.body,`margin-${i}`),10)}px`}for(const i of["height","width"])a[i]=`${t.target.getBoundingClientRect()[i]}px`}else n.originalPosition.value=ja(e,"position");for(const[i,s]of Object.entries(a))n.$el.style[i]=s},Vf=(t,e,n)=>{const r=n.vm.ns||n.vm._.exposed.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?Sr(e,r.bm("parent","relative")):Zs(e,r.bm("parent","relative")),t.fullscreen&&t.lock?Zs(e,r.bm("parent","hidden")):Sr(e,r.bm("parent","hidden"))},Io=Symbol("ElLoading"),Rf=(t,e)=>{var n,r,a,i;const s=e.instance,l=h=>gt(e.value)?e.value[h]:void 0,u=h=>{const v=St(h)&&(s==null?void 0:s[h])||h;return v&&o.ref(v)},c=h=>u(l(h)||t.getAttribute(`element-loading-${Qg(h)}`)),d=(n=l("fullscreen"))!=null?n:e.modifiers.fullscreen,f={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:d,target:(r=l("target"))!=null?r:d?void 0:t,body:(a=l("body"))!=null?a:e.modifiers.body,lock:(i=l("lock"))!=null?i:e.modifiers.lock};t[Io]={options:f,instance:hE(f)}},gE=(t,e)=>{for(const n of Object.keys(e))o.isRef(e[n])&&(e[n].value=t[n])},Rl={mounted(t,e){e.value&&Rf(t,e)},updated(t,e){const n=t[Io];e.oldValue!==e.value&&(e.value&&!e.oldValue?Rf(t,e):e.value&&e.oldValue?gt(e.value)&&gE(e.value,n.options):n==null||n.instance.close())},unmounted(t){var e;(e=t[Io])==null||e.instance.close(),t[Io]=null}},Jt=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},mE="Copy to clipboard",yE="Copied!",bE="#8300bf",wE={name:"CopyToClipboard",props:{content:{type:String,default:""},label:{type:String,default:mE},theme:{type:String,default:""}},data:function(){return{textLabel:this.label,autoHideTimeout:0,iconColor:bE,tooltipContainer:null}},mounted(){const t=document.querySelector(".mapcontent");t?this.tooltipContainer=t:this.tooltipContainer=document.body},methods:{copyToClipboard:async function(){let t=!0;this.autoHideTimeout=600;try{const e=this.content.replaceAll(`
|
|
21
|
-
`,""),n=document.createElement("div");n.innerHTML=this.content;const r=n.textContent||n.innerText||"",a=new Blob([e],{type:"text/html"}),i=new Blob([r],{type:"text/plain"}),s=new ClipboardItem({"text/html":a,"text/plain":i});await navigator.clipboard.write([s])}catch(e){console.error("Error when trying to use navigator.clipboard.write()",e),t=!1}t?this.textLabel=yE:this.textLabel="Error trying to copy to clipboard!"},resetSettings:function(){this.autoHideTimeout=0,this.textLabel=this.label}}},CE={class:"visually-hidden"};function kE(t,e,n,r,a,i){const s=ib,l=ot,u=
|
|
20
|
+
`,p2=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function v2(t){const e=window.getComputedStyle(t),n=e.getPropertyValue("box-sizing"),r=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),a=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:p2.map(s=>`${s}:${e.getPropertyValue(s)}`).join(";"),paddingSize:r,borderSize:a,boxSizing:n}}function Hd(t,e=1,n){var r;cn||(cn=document.createElement("textarea"),document.body.appendChild(cn));const{paddingSize:a,borderSize:i,boxSizing:s,contextStyle:l}=v2(t);cn.setAttribute("style",`${l};${h2}`),cn.value=t.value||t.placeholder||"";let u=cn.scrollHeight;const c={};s==="border-box"?u=u+i:s==="content-box"&&(u=u-a),cn.value="";const d=cn.scrollHeight-a;if(mt(e)){let f=d*e;s==="border-box"&&(f=f+a+i),u=Math.max(f,u),c.minHeight=`${f}px`}if(mt(n)){let f=d*n;s==="border-box"&&(f=f+a+i),u=Math.min(f,u)}return c.height=`${u}px`,(r=cn.parentNode)==null||r.removeChild(cn),cn=void 0,c}const g2=Ae({id:{type:String,default:void 0},size:la,disabled:Boolean,modelValue:{type:ke([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:ke([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:Xn},prefixIcon:{type:Xn},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:ke([Object,Array,String]),default:()=>ta({})},autofocus:Boolean,rows:{type:Number,default:2},...Jn(["ariaLabel"])}),m2={[yt]:t=>St(t),input:t=>St(t),change:t=>St(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,mouseleave:t=>t instanceof MouseEvent,mouseenter:t=>t instanceof MouseEvent,keydown:t=>t instanceof Event,compositionstart:t=>t instanceof CompositionEvent,compositionupdate:t=>t instanceof CompositionEvent,compositionend:t=>t instanceof CompositionEvent},y2=o.defineComponent({name:"ElInput",inheritAttrs:!1}),b2=o.defineComponent({...y2,props:g2,emits:m2,setup(t,{expose:e,emit:n}){const r=t,a=o.useAttrs(),i=o.useSlots(),s=o.computed(()=>{const T={};return r.containerRole==="combobox"&&(T["aria-haspopup"]=a["aria-haspopup"],T["aria-owns"]=a["aria-owns"],T["aria-expanded"]=a["aria-expanded"]),T}),l=o.computed(()=>[r.type==="textarea"?y.b():g.b(),g.m(v.value),g.is("disabled",p.value),g.is("exceed",j.value),{[g.b("group")]:i.prepend||i.append,[g.m("prefix")]:i.prefix||r.prefixIcon,[g.m("suffix")]:i.suffix||r.suffixIcon||r.clearable||r.showPassword,[g.bm("suffix","password-clear")]:V.value&&H.value,[g.b("hidden")]:r.type==="hidden"},a.class]),u=o.computed(()=>[g.e("wrapper"),g.is("focus",S.value)]),c=Pb({excludeKeys:o.computed(()=>Object.keys(s.value))}),{form:d,formItem:f}=Dr(),{inputId:h}=si(r,{formItemContext:f}),v=Nr(),p=oi(),g=Be("input"),y=Be("textarea"),m=o.shallowRef(),b=o.shallowRef(),w=o.ref(!1),C=o.ref(!1),E=o.ref(),x=o.shallowRef(r.inputStyle),k=o.computed(()=>m.value||b.value),{wrapperRef:B,isFocused:S,handleFocus:N,handleBlur:D}=fl(k,{beforeFocus(){return p.value},afterBlur(){var T;r.validateEvent&&((T=f==null?void 0:f.validate)==null||T.call(f,"blur").catch(R=>tt(R)))}}),_=o.computed(()=>{var T;return(T=d==null?void 0:d.statusIcon)!=null?T:!1}),O=o.computed(()=>(f==null?void 0:f.validateState)||""),P=o.computed(()=>O.value&&td[O.value]),F=o.computed(()=>C.value?wb:hb),I=o.computed(()=>[a.style]),M=o.computed(()=>[r.inputStyle,x.value,{resize:r.resize}]),L=o.computed(()=>Yn(r.modelValue)?"":String(r.modelValue)),V=o.computed(()=>r.clearable&&!p.value&&!r.readonly&&!!L.value&&(S.value||w.value)),H=o.computed(()=>r.showPassword&&!p.value&&!r.readonly&&!!L.value&&(!!L.value||S.value)),$=o.computed(()=>r.showWordLimit&&!!r.maxlength&&(r.type==="text"||r.type==="textarea")&&!p.value&&!r.readonly&&!r.showPassword),z=o.computed(()=>L.value.length),j=o.computed(()=>!!$.value&&z.value>Number(r.maxlength)),ee=o.computed(()=>!!i.suffix||!!r.suffixIcon||V.value||r.showPassword||$.value||!!O.value&&_.value),[J,X]=Qw(m);Pn(b,T=>{if(A(),!$.value||r.resize!=="both")return;const R=T[0],{width:Q}=R.contentRect;E.value={right:`calc(100% - ${Q+15+6}px)`}});const ne=()=>{const{type:T,autosize:R}=r;if(!(!et||T!=="textarea"||!b.value))if(R){const Q=gt(R)?R.minRows:void 0,G=gt(R)?R.maxRows:void 0,U=Hd(b.value,Q,G);x.value={overflowY:"hidden",...U},o.nextTick(()=>{b.value.offsetHeight,x.value=U})}else x.value={minHeight:Hd(b.value).minHeight}},A=(T=>{let R=!1;return()=>{var Q;if(R||!r.autosize)return;((Q=b.value)==null?void 0:Q.offsetParent)===null||(T(),R=!0)}})(ne),K=()=>{const T=k.value,R=r.formatter?r.formatter(L.value):L.value;!T||T.value===R||(T.value=R)},W=async T=>{J();let{value:R}=T.target;if(r.formatter&&(R=r.parser?r.parser(R):R),!he.value){if(R===L.value){K();return}n(yt,R),n("input",R),await o.nextTick(),K(),X()}},oe=T=>{n("change",T.target.value)},{isComposing:he,handleCompositionStart:re,handleCompositionUpdate:se,handleCompositionEnd:ue}=Rd({emit:n,afterComposition:W}),pe=()=>{C.value=!C.value,de()},de=async()=>{var T;await o.nextTick(),(T=k.value)==null||T.focus()},me=()=>{var T;return(T=k.value)==null?void 0:T.blur()},Ne=T=>{w.value=!1,n("mouseleave",T)},De=T=>{w.value=!0,n("mouseenter",T)},Ee=T=>{n("keydown",T)},_e=()=>{var T;(T=k.value)==null||T.select()},te=()=>{n(yt,""),n("change",""),n("clear"),n("input","")};return o.watch(()=>r.modelValue,()=>{var T;o.nextTick(()=>ne()),r.validateEvent&&((T=f==null?void 0:f.validate)==null||T.call(f,"change").catch(R=>tt(R)))}),o.watch(L,()=>K()),o.watch(()=>r.type,async()=>{await o.nextTick(),K(),ne()}),o.onMounted(()=>{!r.formatter&&r.parser&&tt("ElInput","If you set the parser, you also need to set the formatter."),K(),o.nextTick(ne)}),e({input:m,textarea:b,ref:k,textareaStyle:M,autosize:o.toRef(r,"autosize"),isComposing:he,focus:de,blur:me,select:_e,clear:te,resizeTextarea:ne}),(T,R)=>(o.openBlock(),o.createElementBlock("div",o.mergeProps(o.unref(s),{class:[o.unref(l),{[o.unref(g).bm("group","append")]:T.$slots.append,[o.unref(g).bm("group","prepend")]:T.$slots.prepend}],style:o.unref(I),role:T.containerRole,onMouseenter:De,onMouseleave:Ne}),[o.createCommentVNode(" input "),T.type!=="textarea"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createCommentVNode(" prepend slot "),T.$slots.prepend?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(g).be("group","prepend"))},[o.renderSlot(T.$slots,"prepend")],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{ref_key:"wrapperRef",ref:B,class:o.normalizeClass(o.unref(u))},[o.createCommentVNode(" prefix slot "),T.$slots.prefix||T.prefixIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(g).e("prefix"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(g).e("prefix-inner"))},[o.renderSlot(T.$slots,"prefix"),T.prefixIcon?(o.openBlock(),o.createBlock(o.unref(ot),{key:0,class:o.normalizeClass(o.unref(g).e("icon"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(T.prefixIcon)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],2)],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("input",o.mergeProps({id:o.unref(h),ref_key:"input",ref:m,class:o.unref(g).e("inner")},o.unref(c),{minlength:T.minlength,maxlength:T.maxlength,type:T.showPassword?C.value?"text":"password":T.type,disabled:o.unref(p),readonly:T.readonly,autocomplete:T.autocomplete,tabindex:T.tabindex,"aria-label":T.ariaLabel,placeholder:T.placeholder,style:T.inputStyle,form:T.form,autofocus:T.autofocus,onCompositionstart:o.unref(re),onCompositionupdate:o.unref(se),onCompositionend:o.unref(ue),onInput:W,onChange:oe,onKeydown:Ee}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),o.createCommentVNode(" suffix slot "),o.unref(ee)?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(o.unref(g).e("suffix"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(g).e("suffix-inner"))},[!o.unref(V)||!o.unref(H)||!o.unref($)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.renderSlot(T.$slots,"suffix"),T.suffixIcon?(o.openBlock(),o.createBlock(o.unref(ot),{key:0,class:o.normalizeClass(o.unref(g).e("icon"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(T.suffixIcon)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],64)):o.createCommentVNode("v-if",!0),o.unref(V)?(o.openBlock(),o.createBlock(o.unref(ot),{key:1,class:o.normalizeClass([o.unref(g).e("icon"),o.unref(g).e("clear")]),onMousedown:o.withModifiers(o.unref(Ka),["prevent"]),onClick:te},{default:o.withCtx(()=>[o.createVNode(o.unref(Qs))]),_:1},8,["class","onMousedown"])):o.createCommentVNode("v-if",!0),o.unref(H)?(o.openBlock(),o.createBlock(o.unref(ot),{key:2,class:o.normalizeClass([o.unref(g).e("icon"),o.unref(g).e("password")]),onClick:pe},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(F))))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),o.unref($)?(o.openBlock(),o.createElementBlock("span",{key:3,class:o.normalizeClass(o.unref(g).e("count"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(g).e("count-inner"))},o.toDisplayString(o.unref(z))+" / "+o.toDisplayString(T.maxlength),3)],2)):o.createCommentVNode("v-if",!0),o.unref(O)&&o.unref(P)&&o.unref(_)?(o.openBlock(),o.createBlock(o.unref(ot),{key:4,class:o.normalizeClass([o.unref(g).e("icon"),o.unref(g).e("validateIcon"),o.unref(g).is("loading",o.unref(O)==="validating")])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(P))))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],2)],2)):o.createCommentVNode("v-if",!0)],2),o.createCommentVNode(" append slot "),T.$slots.append?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(g).be("group","append"))},[o.renderSlot(T.$slots,"append")],2)):o.createCommentVNode("v-if",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createCommentVNode(" textarea "),o.createElementVNode("textarea",o.mergeProps({id:o.unref(h),ref_key:"textarea",ref:b,class:[o.unref(y).e("inner"),o.unref(g).is("focus",o.unref(S))]},o.unref(c),{minlength:T.minlength,maxlength:T.maxlength,tabindex:T.tabindex,disabled:o.unref(p),readonly:T.readonly,autocomplete:T.autocomplete,style:o.unref(M),"aria-label":T.ariaLabel,placeholder:T.placeholder,form:T.form,autofocus:T.autofocus,rows:T.rows,onCompositionstart:o.unref(re),onCompositionupdate:o.unref(se),onCompositionend:o.unref(ue),onInput:W,onFocus:o.unref(N),onBlur:o.unref(D),onChange:oe,onKeydown:Ee}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),o.unref($)?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(E.value),class:o.normalizeClass(o.unref(g).e("count"))},o.toDisplayString(o.unref(z))+" / "+o.toDisplayString(T.maxlength),7)):o.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var w2=Te(b2,[["__file","input.vue"]]);const li=ft(w2),ca=4,C2={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},k2=({move:t,size:e,bar:n})=>({[n.size]:e,transform:`translate${n.axis}(${t}%)`}),vl=Symbol("scrollbarContextKey"),x2=Ae({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),E2="Thumb";var Kd=Te(o.defineComponent({__name:"thumb",props:x2,setup(t){const e=t,n=o.inject(vl),r=Be("scrollbar");n||U1(E2,"can not inject scrollbar context");const a=o.ref(),i=o.ref(),s=o.ref({}),l=o.ref(!1);let u=!1,c=!1,d=et?document.onselectstart:null;const f=o.computed(()=>C2[e.vertical?"vertical":"horizontal"]),h=o.computed(()=>k2({size:e.size,move:e.move,bar:f.value})),v=o.computed(()=>a.value[f.value.offset]**2/n.wrapElement[f.value.scrollSize]/e.ratio/i.value[f.value.offset]),p=x=>{var k;if(x.stopPropagation(),x.ctrlKey||[1,2].includes(x.button))return;(k=window.getSelection())==null||k.removeAllRanges(),y(x);const B=x.currentTarget;B&&(s.value[f.value.axis]=B[f.value.offset]-(x[f.value.client]-B.getBoundingClientRect()[f.value.direction]))},g=x=>{if(!i.value||!a.value||!n.wrapElement)return;const k=Math.abs(x.target.getBoundingClientRect()[f.value.direction]-x[f.value.client]),B=i.value[f.value.offset]/2,S=(k-B)*100*v.value/a.value[f.value.offset];n.wrapElement[f.value.scroll]=S*n.wrapElement[f.value.scrollSize]/100},y=x=>{x.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",m),document.addEventListener("mouseup",b),d=document.onselectstart,document.onselectstart=()=>!1},m=x=>{if(!a.value||!i.value||u===!1)return;const k=s.value[f.value.axis];if(!k)return;const B=(a.value.getBoundingClientRect()[f.value.direction]-x[f.value.client])*-1,S=i.value[f.value.offset]-k,N=(B-S)*100*v.value/a.value[f.value.offset];n.wrapElement[f.value.scroll]=N*n.wrapElement[f.value.scrollSize]/100},b=()=>{u=!1,s.value[f.value.axis]=0,document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",b),E(),c&&(l.value=!1)},w=()=>{c=!1,l.value=!!e.size},C=()=>{c=!0,l.value=u};o.onBeforeUnmount(()=>{E(),document.removeEventListener("mouseup",b)});const E=()=>{document.onselectstart!==d&&(document.onselectstart=d)};return Yt(o.toRef(n,"scrollbarElement"),"mousemove",w),Yt(o.toRef(n,"scrollbarElement"),"mouseleave",C),(x,k)=>(o.openBlock(),o.createBlock(o.Transition,{name:o.unref(r).b("fade"),persisted:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{ref_key:"instance",ref:a,class:o.normalizeClass([o.unref(r).e("bar"),o.unref(r).is(o.unref(f).key)]),onMousedown:g},[o.createElementVNode("div",{ref_key:"thumb",ref:i,class:o.normalizeClass(o.unref(r).e("thumb")),style:o.normalizeStyle(o.unref(h)),onMousedown:p},null,38)],34),[[o.vShow,x.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const S2=Ae({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var T2=Te(o.defineComponent({__name:"bar",props:S2,setup(t,{expose:e}){const n=t,r=o.inject(vl),a=o.ref(0),i=o.ref(0),s=o.ref(""),l=o.ref(""),u=o.ref(1),c=o.ref(1);return e({handleScroll:h=>{if(h){const v=h.offsetHeight-ca,p=h.offsetWidth-ca;i.value=h.scrollTop*100/v*u.value,a.value=h.scrollLeft*100/p*c.value}},update:()=>{const h=r==null?void 0:r.wrapElement;if(!h)return;const v=h.offsetHeight-ca,p=h.offsetWidth-ca,g=v**2/h.scrollHeight,y=p**2/h.scrollWidth,m=Math.max(g,n.minSize),b=Math.max(y,n.minSize);u.value=g/(v-g)/(m/(v-m)),c.value=y/(p-y)/(b/(p-b)),l.value=m+ca<v?`${m}px`:"",s.value=b+ca<p?`${b}px`:""}}),(h,v)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(Kd,{move:a.value,ratio:c.value,size:s.value,always:h.always},null,8,["move","ratio","size","always"]),o.createVNode(Kd,{move:i.value,ratio:u.value,size:l.value,vertical:"",always:h.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const B2=Ae({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:ke([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...Jn(["ariaLabel","ariaOrientation"])}),N2={scroll:({scrollTop:t,scrollLeft:e})=>[t,e].every(mt)},gl="ElScrollbar",D2=o.defineComponent({name:gl}),_2=o.defineComponent({...D2,props:B2,emits:N2,setup(t,{expose:e,emit:n}){const r=t,a=Be("scrollbar");let i,s,l=0,u=0;const c=o.ref(),d=o.ref(),f=o.ref(),h=o.ref(),v=o.computed(()=>{const E={};return r.height&&(E.height=ea(r.height)),r.maxHeight&&(E.maxHeight=ea(r.maxHeight)),[r.wrapStyle,E]}),p=o.computed(()=>[r.wrapClass,a.e("wrap"),{[a.em("wrap","hidden-default")]:!r.native}]),g=o.computed(()=>[a.e("view"),r.viewClass]),y=()=>{var E;d.value&&((E=h.value)==null||E.handleScroll(d.value),l=d.value.scrollTop,u=d.value.scrollLeft,n("scroll",{scrollTop:d.value.scrollTop,scrollLeft:d.value.scrollLeft}))};function m(E,x){gt(E)?d.value.scrollTo(E):mt(E)&&mt(x)&&d.value.scrollTo(E,x)}const b=E=>{if(!mt(E)){tt(gl,"value must be a number");return}d.value.scrollTop=E},w=E=>{if(!mt(E)){tt(gl,"value must be a number");return}d.value.scrollLeft=E},C=()=>{var E;(E=h.value)==null||E.update()};return o.watch(()=>r.noresize,E=>{E?(i==null||i(),s==null||s()):({stop:i}=Pn(f,C),s=Yt("resize",C))},{immediate:!0}),o.watch(()=>[r.maxHeight,r.height],()=>{r.native||o.nextTick(()=>{var E;C(),d.value&&((E=h.value)==null||E.handleScroll(d.value))})}),o.provide(vl,o.reactive({scrollbarElement:c,wrapElement:d})),o.onActivated(()=>{d.value&&(d.value.scrollTop=l,d.value.scrollLeft=u)}),o.onMounted(()=>{r.native||o.nextTick(()=>{C()})}),o.onUpdated(()=>C()),e({wrapRef:d,update:C,scrollTo:m,setScrollTop:b,setScrollLeft:w,handleScroll:y}),(E,x)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"scrollbarRef",ref:c,class:o.normalizeClass(o.unref(a).b())},[o.createElementVNode("div",{ref_key:"wrapRef",ref:d,class:o.normalizeClass(o.unref(p)),style:o.normalizeStyle(o.unref(v)),tabindex:E.tabindex,onScroll:y},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(E.tag),{id:E.id,ref_key:"resizeRef",ref:f,class:o.normalizeClass(o.unref(g)),style:o.normalizeStyle(E.viewStyle),role:E.role,"aria-label":E.ariaLabel,"aria-orientation":E.ariaOrientation},{default:o.withCtx(()=>[o.renderSlot(E.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),E.native?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(T2,{key:0,ref_key:"barRef",ref:h,always:E.always,"min-size":E.minSize},null,8,["always","min-size"]))],2))}});var P2=Te(_2,[["__file","scrollbar.vue"]]);const I2=ft(P2),ml=Symbol("popper"),qd=Symbol("popperContent"),Ud=Ae({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),O2=o.defineComponent({name:"ElPopper",inheritAttrs:!1}),L2=o.defineComponent({...O2,props:Ud,setup(t,{expose:e}){const n=t,r=o.ref(),a=o.ref(),i=o.ref(),s=o.ref(),l=o.computed(()=>n.role),u={triggerRef:r,popperInstanceRef:a,contentRef:i,referenceRef:s,role:l};return e(u),o.provide(ml,u),(c,d)=>o.renderSlot(c.$slots,"default")}});var M2=Te(L2,[["__file","popper.vue"]]);const Gd=Ae({arrowOffset:{type:Number,default:5}}),F2=o.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),A2=o.defineComponent({...F2,props:Gd,setup(t,{expose:e}){const n=t,r=Be("popper"),{arrowOffset:a,arrowRef:i,arrowStyle:s}=o.inject(qd,void 0);return o.watch(()=>n.arrowOffset,l=>{a.value=l}),o.onBeforeUnmount(()=>{i.value=void 0}),e({arrowRef:i}),(l,u)=>(o.openBlock(),o.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:o.normalizeClass(o.unref(r).e("arrow")),style:o.normalizeStyle(o.unref(s)),"data-popper-arrow":""},null,6))}});var V2=Te(A2,[["__file","arrow.vue"]]);const yl="ElOnlyChild",R2=o.defineComponent({name:yl,setup(t,{slots:e,attrs:n}){var r;const a=o.inject(Pd),i=Xw((r=a==null?void 0:a.setForwardRef)!=null?r:Ka);return()=>{var s;const l=(s=e.default)==null?void 0:s.call(e,n);if(!l)return null;if(l.length>1)return tt(yl,"requires exact only one valid child."),null;const u=Wd(l);return u?o.withDirectives(o.cloneVNode(u,n),[[i]]):(tt(yl,"no valid child node found"),null)}}});function Wd(t){if(!t)return null;const e=t;for(const n of e){if(gt(n))switch(n.type){case o.Comment:continue;case o.Text:case"svg":return jd(n);case o.Fragment:return Wd(n.children);default:return n}return jd(n)}return null}function jd(t){const e=Be("only-child");return o.createVNode("span",{class:e.e("content")},[t])}const Yd=Ae({virtualRef:{type:ke(Object)},virtualTriggering:Boolean,onMouseenter:{type:ke(Function)},onMouseleave:{type:ke(Function)},onClick:{type:ke(Function)},onKeydown:{type:ke(Function)},onFocus:{type:ke(Function)},onBlur:{type:ke(Function)},onContextmenu:{type:ke(Function)},id:String,open:Boolean}),$2=o.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),z2=o.defineComponent({...$2,props:Yd,setup(t,{expose:e}){const n=t,{role:r,triggerRef:a}=o.inject(ml,void 0);Zw(a);const i=o.computed(()=>l.value?n.id:void 0),s=o.computed(()=>{if(r&&r.value==="tooltip")return n.open&&n.id?n.id:void 0}),l=o.computed(()=>{if(r&&r.value!=="tooltip")return r.value}),u=o.computed(()=>l.value?`${n.open}`:void 0);let c;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return o.onMounted(()=>{o.watch(()=>n.virtualRef,f=>{f&&(a.value=_n(f))},{immediate:!0}),o.watch(a,(f,h)=>{c==null||c(),c=void 0,Er(f)&&(d.forEach(v=>{var p;const g=n[v];g&&(f.addEventListener(v.slice(2).toLowerCase(),g),(p=h==null?void 0:h.removeEventListener)==null||p.call(h,v.slice(2).toLowerCase(),g))}),c=o.watch([i,s,l,u],v=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((p,g)=>{Yn(v[g])?f.removeAttribute(p):f.setAttribute(p,v[g])})},{immediate:!0})),Er(h)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(v=>h.removeAttribute(v))},{immediate:!0})}),o.onBeforeUnmount(()=>{if(c==null||c(),c=void 0,a.value&&Er(a.value)){const f=a.value;d.forEach(h=>{const v=n[h];v&&f.removeEventListener(h.slice(2).toLowerCase(),v)}),a.value=void 0}}),e({triggerRef:a}),(f,h)=>f.virtualTriggering?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(o.unref(R2),o.mergeProps({key:0},f.$attrs,{"aria-controls":o.unref(i),"aria-describedby":o.unref(s),"aria-expanded":o.unref(u),"aria-haspopup":o.unref(l)}),{default:o.withCtx(()=>[o.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var H2=Te(z2,[["__file","trigger.vue"]]);const bl="focus-trap.focus-after-trapped",wl="focus-trap.focus-after-released",K2="focus-trap.focusout-prevented",Zd={cancelable:!0,bubbles:!1},q2={cancelable:!0,bubbles:!1},Xd="focusAfterTrapped",Qd="focusAfterReleased",U2=Symbol("elFocusTrap"),Cl=o.ref(),xo=o.ref(0),kl=o.ref(0);let Eo=0;const Jd=t=>{const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0||r===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e},ef=(t,e)=>{for(const n of t)if(!G2(n,e))return n},G2=(t,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1},W2=t=>{const e=Jd(t),n=ef(e,t),r=ef(e.reverse(),t);return[n,r]},j2=t=>t instanceof HTMLInputElement&&"select"in t,er=(t,e)=>{if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),kl.value=window.performance.now(),t!==n&&j2(t)&&e&&t.select()}};function tf(t,e){const n=[...t],r=t.indexOf(e);return r!==-1&&n.splice(r,1),n}const Y2=()=>{let t=[];return{push:r=>{const a=t[0];a&&r!==a&&a.pause(),t=tf(t,r),t.unshift(r)},remove:r=>{var a,i;t=tf(t,r),(i=(a=t[0])==null?void 0:a.resume)==null||i.call(a)}}},Z2=(t,e=!1)=>{const n=document.activeElement;for(const r of t)if(er(r,e),document.activeElement!==n)return},nf=Y2(),X2=()=>xo.value>kl.value,So=()=>{Cl.value="pointer",xo.value=window.performance.now()},rf=()=>{Cl.value="keyboard",xo.value=window.performance.now()},Q2=()=>(o.onMounted(()=>{Eo===0&&(document.addEventListener("mousedown",So),document.addEventListener("touchstart",So),document.addEventListener("keydown",rf)),Eo++}),o.onBeforeUnmount(()=>{Eo--,Eo<=0&&(document.removeEventListener("mousedown",So),document.removeEventListener("touchstart",So),document.removeEventListener("keydown",rf))}),{focusReason:Cl,lastUserFocusTimestamp:xo,lastAutomatedFocusTimestamp:kl}),To=t=>new CustomEvent(K2,{...q2,detail:t}),J2=o.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Xd,Qd,"focusin","focusout","focusout-prevented","release-requested"],setup(t,{emit:e}){const n=o.ref();let r,a;const{focusReason:i}=Q2();Uw(p=>{t.trapped&&!s.paused&&e("release-requested",p)});const s={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=p=>{if(!t.loop&&!t.trapped||s.paused)return;const{key:g,altKey:y,ctrlKey:m,metaKey:b,currentTarget:w,shiftKey:C}=p,{loop:E}=t,x=g===it.tab&&!y&&!m&&!b,k=document.activeElement;if(x&&k){const B=w,[S,N]=W2(B);if(S&&N){if(!C&&k===N){const _=To({focusReason:i.value});e("focusout-prevented",_),_.defaultPrevented||(p.preventDefault(),E&&er(S,!0))}else if(C&&[S,B].includes(k)){const _=To({focusReason:i.value});e("focusout-prevented",_),_.defaultPrevented||(p.preventDefault(),E&&er(N,!0))}}else if(k===B){const _=To({focusReason:i.value});e("focusout-prevented",_),_.defaultPrevented||p.preventDefault()}}};o.provide(U2,{focusTrapRef:n,onKeydown:l}),o.watch(()=>t.focusTrapEl,p=>{p&&(n.value=p)},{immediate:!0}),o.watch([n],([p],[g])=>{p&&(p.addEventListener("keydown",l),p.addEventListener("focusin",d),p.addEventListener("focusout",f)),g&&(g.removeEventListener("keydown",l),g.removeEventListener("focusin",d),g.removeEventListener("focusout",f))});const u=p=>{e(Xd,p)},c=p=>e(Qd,p),d=p=>{const g=o.unref(n);if(!g)return;const y=p.target,m=p.relatedTarget,b=y&&g.contains(y);t.trapped||m&&g.contains(m)||(r=m),b&&e("focusin",p),!s.paused&&t.trapped&&(b?a=y:er(a,!0))},f=p=>{const g=o.unref(n);if(!(s.paused||!g))if(t.trapped){const y=p.relatedTarget;!Yn(y)&&!g.contains(y)&&setTimeout(()=>{if(!s.paused&&t.trapped){const m=To({focusReason:i.value});e("focusout-prevented",m),m.defaultPrevented||er(a,!0)}},0)}else{const y=p.target;y&&g.contains(y)||e("focusout",p)}};async function h(){await o.nextTick();const p=o.unref(n);if(p){nf.push(s);const g=p.contains(document.activeElement)?r:document.activeElement;if(r=g,!p.contains(g)){const m=new Event(bl,Zd);p.addEventListener(bl,u),p.dispatchEvent(m),m.defaultPrevented||o.nextTick(()=>{let b=t.focusStartEl;St(b)||(er(b),document.activeElement!==b&&(b="first")),b==="first"&&Z2(Jd(p),!0),(document.activeElement===g||b==="container")&&er(p)})}}}function v(){const p=o.unref(n);if(p){p.removeEventListener(bl,u);const g=new CustomEvent(wl,{...Zd,detail:{focusReason:i.value}});p.addEventListener(wl,c),p.dispatchEvent(g),!g.defaultPrevented&&(i.value=="keyboard"||!X2()||p.contains(document.activeElement))&&er(r??document.body),p.removeEventListener(wl,c),nf.remove(s)}}return o.onMounted(()=>{t.trapped&&h(),o.watch(()=>t.trapped,p=>{p?h():v()})}),o.onBeforeUnmount(()=>{t.trapped&&v(),n.value&&(n.value.removeEventListener("keydown",l),n.value.removeEventListener("focusin",d),n.value.removeEventListener("focusout",f),n.value=void 0)}),{onKeydown:l}}});function eC(t,e,n,r,a,i){return o.renderSlot(t.$slots,"default",{handleKeydown:t.onKeydown})}var tC=Te(J2,[["render",eC],["__file","focus-trap.vue"]]);const nC=["fixed","absolute"],rC=Ae({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:ke(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:go,default:"bottom"},popperOptions:{type:ke(Object),default:()=>({})},strategy:{type:String,values:nC,default:"absolute"}}),af=Ae({...rC,id:String,style:{type:ke([String,Array,Object])},className:{type:ke([String,Array,Object])},effect:{type:ke(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:ke([String,Array,Object])},popperStyle:{type:ke([String,Array,Object])},referenceEl:{type:ke(Object)},triggerTargetEl:{type:ke(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Jn(["ariaLabel"])}),aC={mouseenter:t=>t instanceof MouseEvent,mouseleave:t=>t instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},iC=(t,e=[])=>{const{placement:n,strategy:r,popperOptions:a}=t,i={placement:n,strategy:r,...a,modifiers:[...sC(t),...e]};return lC(i,a==null?void 0:a.modifiers),i},oC=t=>{if(et)return _n(t)};function sC(t){const{offset:e,gpuAcceleration:n,fallbackPlacements:r}=t;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:r}},{name:"computeStyles",options:{gpuAcceleration:n}}]}function lC(t,e){e&&(t.modifiers=[...t.modifiers,...e??[]])}const cC=0,uC=t=>{const{popperInstanceRef:e,contentRef:n,triggerRef:r,role:a}=o.inject(ml,void 0),i=o.ref(),s=o.ref(),l=o.computed(()=>({name:"eventListeners",enabled:!!t.visible})),u=o.computed(()=>{var m;const b=o.unref(i),w=(m=o.unref(s))!=null?m:cC;return{name:"arrow",enabled:!R1(b),options:{element:b,padding:w}}}),c=o.computed(()=>({onFirstUpdate:()=>{p()},...iC(t,[o.unref(u),o.unref(l)])})),d=o.computed(()=>oC(t.referenceEl)||o.unref(r)),{attributes:f,state:h,styles:v,update:p,forceUpdate:g,instanceRef:y}=Hw(d,n,c);return o.watch(y,m=>e.value=m),o.onMounted(()=>{o.watch(()=>{var m;return(m=o.unref(d))==null?void 0:m.getBoundingClientRect()},()=>{p()})}),{attributes:f,arrowRef:i,contentRef:n,instanceRef:y,state:h,styles:v,role:a,forceUpdate:g,update:p}},dC=(t,{attributes:e,styles:n,role:r})=>{const{nextZIndex:a}=Ad(),i=Be("popper"),s=o.computed(()=>o.unref(e).popper),l=o.ref(mt(t.zIndex)?t.zIndex:a()),u=o.computed(()=>[i.b(),i.is("pure",t.pure),i.is(t.effect),t.popperClass]),c=o.computed(()=>[{zIndex:o.unref(l)},o.unref(n).popper,t.popperStyle||{}]),d=o.computed(()=>r.value==="dialog"?"false":void 0),f=o.computed(()=>o.unref(n).arrow||{});return{ariaModal:d,arrowStyle:f,contentAttrs:s,contentClass:u,contentStyle:c,contentZIndex:l,updateZIndex:()=>{l.value=mt(t.zIndex)?t.zIndex:a()}}},fC=(t,e)=>{const n=o.ref(!1),r=o.ref();return{focusStartRef:r,trapped:n,onFocusAfterReleased:c=>{var d;((d=c.detail)==null?void 0:d.focusReason)!=="pointer"&&(r.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:c=>{t.visible&&!n.value&&(c.target&&(r.value=c.target),n.value=!0)},onFocusoutPrevented:c=>{t.trapping||(c.detail.focusReason==="pointer"&&c.preventDefault(),n.value=!1)},onReleaseRequested:()=>{n.value=!1,e("close")}}},hC=o.defineComponent({name:"ElPopperContent"}),pC=o.defineComponent({...hC,props:af,emits:aC,setup(t,{expose:e,emit:n}){const r=t,{focusStartRef:a,trapped:i,onFocusAfterReleased:s,onFocusAfterTrapped:l,onFocusInTrap:u,onFocusoutPrevented:c,onReleaseRequested:d}=fC(r,n),{attributes:f,arrowRef:h,contentRef:v,styles:p,instanceRef:g,role:y,update:m}=uC(r),{ariaModal:b,arrowStyle:w,contentAttrs:C,contentClass:E,contentStyle:x,updateZIndex:k}=dC(r,{styles:p,attributes:f,role:y}),B=o.inject(ii,void 0),S=o.ref();o.provide(qd,{arrowStyle:w,arrowRef:h,arrowOffset:S}),B&&o.provide(ii,{...B,addInputId:Ka,removeInputId:Ka});let N;const D=(O=!0)=>{m(),O&&k()},_=()=>{D(!1),r.visible&&r.focusOnShow?i.value=!0:r.visible===!1&&(i.value=!1)};return o.onMounted(()=>{o.watch(()=>r.triggerTargetEl,(O,P)=>{N==null||N(),N=void 0;const F=o.unref(O||v.value),I=o.unref(P||v.value);Er(F)&&(N=o.watch([y,()=>r.ariaLabel,b,()=>r.id],M=>{["role","aria-label","aria-modal","id"].forEach((L,V)=>{Yn(M[V])?F.removeAttribute(L):F.setAttribute(L,M[V])})},{immediate:!0})),I!==F&&Er(I)&&["role","aria-label","aria-modal","id"].forEach(M=>{I.removeAttribute(M)})},{immediate:!0}),o.watch(()=>r.visible,_,{immediate:!0})}),o.onBeforeUnmount(()=>{N==null||N(),N=void 0}),e({popperContentRef:v,popperInstanceRef:g,updatePopper:D,contentStyle:x}),(O,P)=>(o.openBlock(),o.createElementBlock("div",o.mergeProps({ref_key:"contentRef",ref:v},o.unref(C),{style:o.unref(x),class:o.unref(E),tabindex:"-1",onMouseenter:F=>O.$emit("mouseenter",F),onMouseleave:F=>O.$emit("mouseleave",F)}),[o.createVNode(o.unref(tC),{trapped:o.unref(i),"trap-on-focus-in":!0,"focus-trap-el":o.unref(v),"focus-start-el":o.unref(a),onFocusAfterTrapped:o.unref(l),onFocusAfterReleased:o.unref(s),onFocusin:o.unref(u),onFocusoutPrevented:o.unref(c),onReleaseRequested:o.unref(d)},{default:o.withCtx(()=>[o.renderSlot(O.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var vC=Te(pC,[["__file","content.vue"]]);const gC=ft(M2),xl=Symbol("elTooltip"),$t=Ae({...jw,...af,appendTo:{type:ke([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:ke(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Jn(["ariaLabel"])}),ci=Ae({...Yd,disabled:Boolean,trigger:{type:ke([String,Array]),default:"hover"},triggerKeys:{type:ke(Array),default:()=>[it.enter,it.space]}}),{useModelToggleProps:mC,useModelToggleEmits:yC,useModelToggle:bC}=Rb("visible"),wC=Ae({...Ud,...mC,...$t,...ci,...Gd,showArrow:{type:Boolean,default:!0}}),CC=[...yC,"before-show","before-hide","show","hide","open","close"],kC=(t,e)=>At(t)?t.includes(e):t===e,ua=(t,e,n)=>r=>{kC(o.unref(t),e)&&n(r)},xC=o.defineComponent({name:"ElTooltipTrigger"}),EC=o.defineComponent({...xC,props:ci,setup(t,{expose:e}){const n=t,r=Be("tooltip"),{controlled:a,id:i,open:s,onOpen:l,onClose:u,onToggle:c}=o.inject(xl,void 0),d=o.ref(null),f=()=>{if(o.unref(a)||n.disabled)return!0},h=o.toRef(n,"trigger"),v=Ft(f,ua(h,"hover",l)),p=Ft(f,ua(h,"hover",u)),g=Ft(f,ua(h,"click",C=>{C.button===0&&c(C)})),y=Ft(f,ua(h,"focus",l)),m=Ft(f,ua(h,"focus",u)),b=Ft(f,ua(h,"contextmenu",C=>{C.preventDefault(),c(C)})),w=Ft(f,C=>{const{code:E}=C;n.triggerKeys.includes(E)&&(C.preventDefault(),c(C))});return e({triggerRef:d}),(C,E)=>(o.openBlock(),o.createBlock(o.unref(H2),{id:o.unref(i),"virtual-ref":C.virtualRef,open:o.unref(s),"virtual-triggering":C.virtualTriggering,class:o.normalizeClass(o.unref(r).e("trigger")),onBlur:o.unref(m),onClick:o.unref(g),onContextmenu:o.unref(b),onFocus:o.unref(y),onMouseenter:o.unref(v),onMouseleave:o.unref(p),onKeydown:o.unref(w)},{default:o.withCtx(()=>[o.renderSlot(C.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var SC=Te(EC,[["__file","trigger.vue"]]);const TC=Ae({to:{type:ke([String,Object]),required:!0},disabled:Boolean});var BC=Te(o.defineComponent({__name:"teleport",props:TC,setup(t){return(e,n)=>e.disabled?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createBlock(o.Teleport,{key:1,to:e.to},[o.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const NC=ft(BC),DC=o.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),_C=o.defineComponent({...DC,props:$t,setup(t,{expose:e}){const n=t,{selector:r}=_d(),a=Be("tooltip"),i=o.ref(null);let s;const{controlled:l,id:u,open:c,trigger:d,onClose:f,onOpen:h,onShow:v,onHide:p,onBeforeShow:g,onBeforeHide:y}=o.inject(xl,void 0),m=o.computed(()=>n.transition||`${a.namespace.value}-fade-in-linear`),b=o.computed(()=>process.env.NODE_ENV==="test"?!0:n.persistent);o.onBeforeUnmount(()=>{s==null||s()});const w=o.computed(()=>o.unref(b)?!0:o.unref(c)),C=o.computed(()=>n.disabled?!1:o.unref(c)),E=o.computed(()=>n.appendTo||r.value),x=o.computed(()=>{var I;return(I=n.style)!=null?I:{}}),k=o.ref(!0),B=()=>{p(),k.value=!0},S=()=>{if(o.unref(l))return!0},N=Ft(S,()=>{n.enterable&&o.unref(d)==="hover"&&h()}),D=Ft(S,()=>{o.unref(d)==="hover"&&f()}),_=()=>{var I,M;(M=(I=i.value)==null?void 0:I.updatePopper)==null||M.call(I),g==null||g()},O=()=>{y==null||y()},P=()=>{v(),s=Og(o.computed(()=>{var I;return(I=i.value)==null?void 0:I.popperContentRef}),()=>{if(o.unref(l))return;o.unref(d)!=="hover"&&f()})},F=()=>{n.virtualTriggering||f()};return o.watch(()=>o.unref(c),I=>{I?k.value=!1:s==null||s()},{flush:"post"}),o.watch(()=>n.content,()=>{var I,M;(M=(I=i.value)==null?void 0:I.updatePopper)==null||M.call(I)}),e({contentRef:i}),(I,M)=>(o.openBlock(),o.createBlock(o.unref(NC),{disabled:!I.teleported,to:o.unref(E)},{default:o.withCtx(()=>[o.createVNode(o.Transition,{name:o.unref(m),onAfterLeave:B,onBeforeEnter:_,onAfterEnter:P,onBeforeLeave:O},{default:o.withCtx(()=>[o.unref(w)?o.withDirectives((o.openBlock(),o.createBlock(o.unref(vC),o.mergeProps({key:0,id:o.unref(u),ref_key:"contentRef",ref:i},I.$attrs,{"aria-label":I.ariaLabel,"aria-hidden":k.value,"boundaries-padding":I.boundariesPadding,"fallback-placements":I.fallbackPlacements,"gpu-acceleration":I.gpuAcceleration,offset:I.offset,placement:I.placement,"popper-options":I.popperOptions,strategy:I.strategy,effect:I.effect,enterable:I.enterable,pure:I.pure,"popper-class":I.popperClass,"popper-style":[I.popperStyle,o.unref(x)],"reference-el":I.referenceEl,"trigger-target-el":I.triggerTargetEl,visible:o.unref(C),"z-index":I.zIndex,onMouseenter:o.unref(N),onMouseleave:o.unref(D),onBlur:F,onClose:o.unref(f)}),{default:o.withCtx(()=>[o.renderSlot(I.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[o.vShow,o.unref(C)]]):o.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var PC=Te(_C,[["__file","content.vue"]]);const IC=o.defineComponent({name:"ElTooltip"}),OC=o.defineComponent({...IC,props:wC,emits:CC,setup(t,{expose:e,emit:n}){const r=t;Ww();const a=Co(),i=o.ref(),s=o.ref(),l=()=>{var m;const b=o.unref(i);b&&((m=b.popperInstanceRef)==null||m.update())},u=o.ref(!1),c=o.ref(),{show:d,hide:f,hasUpdateHandler:h}=bC({indicator:u,toggleReason:c}),{onOpen:v,onClose:p}=Yw({showAfter:o.toRef(r,"showAfter"),hideAfter:o.toRef(r,"hideAfter"),autoClose:o.toRef(r,"autoClose"),open:d,close:f}),g=o.computed(()=>Jr(r.visible)&&!h.value);o.provide(xl,{controlled:g,id:a,open:o.readonly(u),trigger:o.toRef(r,"trigger"),onOpen:m=>{v(m)},onClose:m=>{p(m)},onToggle:m=>{o.unref(u)?p(m):v(m)},onShow:()=>{n("show",c.value)},onHide:()=>{n("hide",c.value)},onBeforeShow:()=>{n("before-show",c.value)},onBeforeHide:()=>{n("before-hide",c.value)},updatePopper:l}),o.watch(()=>r.disabled,m=>{m&&u.value&&(u.value=!1)});const y=m=>{var b,w;const C=(w=(b=s.value)==null?void 0:b.contentRef)==null?void 0:w.popperContentRef,E=(m==null?void 0:m.relatedTarget)||document.activeElement;return C&&C.contains(E)};return o.onDeactivated(()=>u.value&&f()),e({popperRef:i,contentRef:s,isFocusInsideContent:y,updatePopper:l,onOpen:v,onClose:p,hide:f}),(m,b)=>(o.openBlock(),o.createBlock(o.unref(gC),{ref_key:"popperRef",ref:i,role:m.role},{default:o.withCtx(()=>[o.createVNode(SC,{disabled:m.disabled,trigger:m.trigger,"trigger-keys":m.triggerKeys,"virtual-ref":m.virtualRef,"virtual-triggering":m.virtualTriggering},{default:o.withCtx(()=>[m.$slots.default?o.renderSlot(m.$slots,"default",{key:0}):o.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),o.createVNode(PC,{ref_key:"contentRef",ref:s,"aria-label":m.ariaLabel,"boundaries-padding":m.boundariesPadding,content:m.content,disabled:m.disabled,effect:m.effect,enterable:m.enterable,"fallback-placements":m.fallbackPlacements,"hide-after":m.hideAfter,"gpu-acceleration":m.gpuAcceleration,offset:m.offset,persistent:m.persistent,"popper-class":m.popperClass,"popper-style":m.popperStyle,placement:m.placement,"popper-options":m.popperOptions,pure:m.pure,"raw-content":m.rawContent,"reference-el":m.referenceEl,"trigger-target-el":m.triggerTargetEl,"show-after":m.showAfter,strategy:m.strategy,teleported:m.teleported,transition:m.transition,"virtual-triggering":m.virtualTriggering,"z-index":m.zIndex,"append-to":m.appendTo},{default:o.withCtx(()=>[o.renderSlot(m.$slots,"content",{},()=>[m.rawContent?(o.openBlock(),o.createElementBlock("span",{key:0,innerHTML:m.content},null,8,["innerHTML"])):(o.openBlock(),o.createElementBlock("span",{key:1},o.toDisplayString(m.content),1))]),m.showArrow?(o.openBlock(),o.createBlock(o.unref(V2),{key:0,"arrow-offset":m.arrowOffset},null,8,["arrow-offset"])):o.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var LC=Te(OC,[["__file","tooltip.vue"]]);const ui=ft(LC),of=Symbol("buttonGroupContextKey"),MC=(t,e)=>{po({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},o.computed(()=>t.type==="text"));const n=o.inject(of,void 0),r=hl("button"),{form:a}=Dr(),i=Nr(o.computed(()=>n==null?void 0:n.size)),s=oi(),l=o.ref(),u=o.useSlots(),c=o.computed(()=>t.type||(n==null?void 0:n.type)||""),d=o.computed(()=>{var p,g,y;return(y=(g=t.autoInsertSpace)!=null?g:(p=r.value)==null?void 0:p.autoInsertSpace)!=null?y:!1}),f=o.computed(()=>t.tag==="button"?{ariaDisabled:s.value||t.loading,disabled:s.value||t.loading,autofocus:t.autofocus,type:t.nativeType}:{}),h=o.computed(()=>{var p;const g=(p=u.default)==null?void 0:p.call(u);if(d.value&&(g==null?void 0:g.length)===1){const y=g[0];if((y==null?void 0:y.type)===o.Text){const m=y.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(m.trim())}}return!1});return{_disabled:s,_size:i,_type:c,_ref:l,_props:f,shouldAddSpace:h,handleClick:p=>{if(s.value||t.loading){p.stopPropagation();return}t.nativeType==="reset"&&(a==null||a.resetFields()),e("click",p)}}},El=Ae({size:la,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Xn},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Xn,default:()=>Js},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:ke([String,Object]),default:"button"}}),FC={click:t=>t instanceof MouseEvent};function bt(t,e){AC(t)&&(t="100%");var n=VC(t);return t=e===360?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:(e===360?t=(t<0?t%e+e:t%e)/parseFloat(String(e)):t=t%e/parseFloat(String(e)),t)}function Bo(t){return Math.min(1,Math.max(0,t))}function AC(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function VC(t){return typeof t=="string"&&t.indexOf("%")!==-1}function sf(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function No(t){return t<=1?"".concat(Number(t)*100,"%"):t}function _r(t){return t.length===1?"0"+t:String(t)}function RC(t,e,n){return{r:bt(t,255)*255,g:bt(e,255)*255,b:bt(n,255)*255}}function lf(t,e,n){t=bt(t,255),e=bt(e,255),n=bt(n,255);var r=Math.max(t,e,n),a=Math.min(t,e,n),i=0,s=0,l=(r+a)/2;if(r===a)s=0,i=0;else{var u=r-a;switch(s=l>.5?u/(2-r-a):u/(r+a),r){case t:i=(e-n)/u+(e<n?6:0);break;case e:i=(n-t)/u+2;break;case n:i=(t-e)/u+4;break}i/=6}return{h:i,s,l}}function Sl(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*(6*n):n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function $C(t,e,n){var r,a,i;if(t=bt(t,360),e=bt(e,100),n=bt(n,100),e===0)a=n,i=n,r=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;r=Sl(l,s,t+1/3),a=Sl(l,s,t),i=Sl(l,s,t-1/3)}return{r:r*255,g:a*255,b:i*255}}function cf(t,e,n){t=bt(t,255),e=bt(e,255),n=bt(n,255);var r=Math.max(t,e,n),a=Math.min(t,e,n),i=0,s=r,l=r-a,u=r===0?0:l/r;if(r===a)i=0;else{switch(r){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4;break}i/=6}return{h:i,s:u,v:s}}function zC(t,e,n){t=bt(t,360)*6,e=bt(e,100),n=bt(n,100);var r=Math.floor(t),a=t-r,i=n*(1-e),s=n*(1-a*e),l=n*(1-(1-a)*e),u=r%6,c=[n,s,i,i,l,n][u],d=[l,n,n,s,i,i][u],f=[i,i,l,n,n,s][u];return{r:c*255,g:d*255,b:f*255}}function uf(t,e,n,r){var a=[_r(Math.round(t).toString(16)),_r(Math.round(e).toString(16)),_r(Math.round(n).toString(16))];return r&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function HC(t,e,n,r,a){var i=[_r(Math.round(t).toString(16)),_r(Math.round(e).toString(16)),_r(Math.round(n).toString(16)),_r(KC(r))];return a&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function KC(t){return Math.round(parseFloat(t)*255).toString(16)}function df(t){return qt(t)/255}function qt(t){return parseInt(t,16)}function qC(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var Tl={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function UC(t){var e={r:0,g:0,b:0},n=1,r=null,a=null,i=null,s=!1,l=!1;return typeof t=="string"&&(t=jC(t)),typeof t=="object"&&(Vn(t.r)&&Vn(t.g)&&Vn(t.b)?(e=RC(t.r,t.g,t.b),s=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Vn(t.h)&&Vn(t.s)&&Vn(t.v)?(r=No(t.s),a=No(t.v),e=zC(t.h,r,a),s=!0,l="hsv"):Vn(t.h)&&Vn(t.s)&&Vn(t.l)&&(r=No(t.s),i=No(t.l),e=$C(t.h,r,i),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(n=t.a)),n=sf(n),{ok:s,format:t.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}var GC="[-\\+]?\\d+%?",WC="[-\\+]?\\d*\\.\\d+%?",tr="(?:".concat(WC,")|(?:").concat(GC,")"),Bl="[\\s|\\(]+(".concat(tr,")[,|\\s]+(").concat(tr,")[,|\\s]+(").concat(tr,")\\s*\\)?"),Nl="[\\s|\\(]+(".concat(tr,")[,|\\s]+(").concat(tr,")[,|\\s]+(").concat(tr,")[,|\\s]+(").concat(tr,")\\s*\\)?"),un={CSS_UNIT:new RegExp(tr),rgb:new RegExp("rgb"+Bl),rgba:new RegExp("rgba"+Nl),hsl:new RegExp("hsl"+Bl),hsla:new RegExp("hsla"+Nl),hsv:new RegExp("hsv"+Bl),hsva:new RegExp("hsva"+Nl),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function jC(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(Tl[t])t=Tl[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=un.rgb.exec(t);return n?{r:n[1],g:n[2],b:n[3]}:(n=un.rgba.exec(t),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=un.hsl.exec(t),n?{h:n[1],s:n[2],l:n[3]}:(n=un.hsla.exec(t),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=un.hsv.exec(t),n?{h:n[1],s:n[2],v:n[3]}:(n=un.hsva.exec(t),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=un.hex8.exec(t),n?{r:qt(n[1]),g:qt(n[2]),b:qt(n[3]),a:df(n[4]),format:e?"name":"hex8"}:(n=un.hex6.exec(t),n?{r:qt(n[1]),g:qt(n[2]),b:qt(n[3]),format:e?"name":"hex"}:(n=un.hex4.exec(t),n?{r:qt(n[1]+n[1]),g:qt(n[2]+n[2]),b:qt(n[3]+n[3]),a:df(n[4]+n[4]),format:e?"name":"hex8"}:(n=un.hex3.exec(t),n?{r:qt(n[1]+n[1]),g:qt(n[2]+n[2]),b:qt(n[3]+n[3]),format:e?"name":"hex"}:!1)))))))))}function Vn(t){return!!un.CSS_UNIT.exec(String(t))}var YC=function(){function t(e,n){e===void 0&&(e=""),n===void 0&&(n={});var r;if(e instanceof t)return e;typeof e=="number"&&(e=qC(e)),this.originalInput=e;var a=UC(e);this.originalInput=e,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:a.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=a.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},t.prototype.getLuminance=function(){var e=this.toRgb(),n,r,a,i=e.r/255,s=e.g/255,l=e.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),s<=.03928?r=s/12.92:r=Math.pow((s+.055)/1.055,2.4),l<=.03928?a=l/12.92:a=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*r+.0722*a},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(e){return this.a=sf(e),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},t.prototype.toHsv=function(){var e=cf(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},t.prototype.toHsvString=function(){var e=cf(this.r,this.g,this.b),n=Math.round(e.h*360),r=Math.round(e.s*100),a=Math.round(e.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(a,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(a,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var e=lf(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},t.prototype.toHslString=function(){var e=lf(this.r,this.g,this.b),n=Math.round(e.h*360),r=Math.round(e.s*100),a=Math.round(e.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(a,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(a,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(e){return e===void 0&&(e=!1),uf(this.r,this.g,this.b,e)},t.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},t.prototype.toHex8=function(e){return e===void 0&&(e=!1),HC(this.r,this.g,this.b,this.a,e)},t.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},t.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var e=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(n,", ").concat(r,")"):"rgba(".concat(e,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var e=function(n){return"".concat(Math.round(bt(n,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var e=function(n){return Math.round(bt(n,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+uf(this.r,this.g,this.b,!1),n=0,r=Object.entries(Tl);n<r.length;n++){var a=r[n],i=a[0],s=a[1];if(e===s)return i}return!1},t.prototype.toString=function(e){var n=!!e;e=e??this.format;var r=!1,a=this.a<1&&this.a>=0,i=!n&&a&&(e.startsWith("hex")||e==="name");return i?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l+=e/100,n.l=Bo(n.l),new t(n)},t.prototype.brighten=function(e){e===void 0&&(e=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(e/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(e/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(e/100)))),new t(n)},t.prototype.darken=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l-=e/100,n.l=Bo(n.l),new t(n)},t.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},t.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},t.prototype.desaturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s-=e/100,n.s=Bo(n.s),new t(n)},t.prototype.saturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s+=e/100,n.s=Bo(n.s),new t(n)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var n=this.toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,new t(n)},t.prototype.mix=function(e,n){n===void 0&&(n=50);var r=this.toRgb(),a=new t(e).toRgb(),i=n/100,s={r:(a.r-r.r)*i+r.r,g:(a.g-r.g)*i+r.g,b:(a.b-r.b)*i+r.b,a:(a.a-r.a)*i+r.a};return new t(s)},t.prototype.analogous=function(e,n){e===void 0&&(e=6),n===void 0&&(n=30);var r=this.toHsl(),a=360/n,i=[this];for(r.h=(r.h-(a*e>>1)+720)%360;--e;)r.h=(r.h+a)%360,i.push(new t(r));return i},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var n=this.toHsv(),r=n.h,a=n.s,i=n.v,s=[],l=1/e;e--;)s.push(new t({h:r,s:a,v:i})),i=(i+l)%1;return s},t.prototype.splitcomplement=function(){var e=this.toHsl(),n=e.h;return[this,new t({h:(n+72)%360,s:e.s,l:e.l}),new t({h:(n+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var n=this.toRgb(),r=new t(e).toRgb(),a=n.a+r.a*(1-n.a);return new t({r:(n.r*n.a+r.r*r.a*(1-n.a))/a,g:(n.g*n.a+r.g*r.a*(1-n.a))/a,b:(n.b*n.a+r.b*r.a*(1-n.a))/a,a})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var n=this.toHsl(),r=n.h,a=[this],i=360/e,s=1;s<e;s++)a.push(new t({h:(r+s*i)%360,s:n.s,l:n.l}));return a},t.prototype.equals=function(e){return this.toRgbString()===new t(e).toRgbString()},t}();function nr(t,e=20){return t.mix("#141414",e).toString()}function ZC(t){const e=oi(),n=Be("button");return o.computed(()=>{let r={},a=t.color;if(a){const i=a.match(/var\((.*?)\)/);i&&(a=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const s=new YC(a),l=t.dark?s.tint(20).toString():nr(s,20);if(t.plain)r=n.cssVarBlock({"bg-color":t.dark?nr(s,90):s.tint(90).toString(),"text-color":a,"border-color":t.dark?nr(s,50):s.tint(50).toString(),"hover-text-color":`var(${n.cssVarName("color-white")})`,"hover-bg-color":a,"hover-border-color":a,"active-bg-color":l,"active-text-color":`var(${n.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(r[n.cssVarBlockName("disabled-bg-color")]=t.dark?nr(s,90):s.tint(90).toString(),r[n.cssVarBlockName("disabled-text-color")]=t.dark?nr(s,50):s.tint(50).toString(),r[n.cssVarBlockName("disabled-border-color")]=t.dark?nr(s,80):s.tint(80).toString());else{const u=t.dark?nr(s,30):s.tint(30).toString(),c=s.isDark()?`var(${n.cssVarName("color-white")})`:`var(${n.cssVarName("color-black")})`;if(r=n.cssVarBlock({"bg-color":a,"text-color":c,"border-color":a,"hover-bg-color":u,"hover-text-color":c,"hover-border-color":u,"active-bg-color":l,"active-border-color":l}),e.value){const d=t.dark?nr(s,50):s.tint(50).toString();r[n.cssVarBlockName("disabled-bg-color")]=d,r[n.cssVarBlockName("disabled-text-color")]=t.dark?"rgba(255, 255, 255, 0.5)":`var(${n.cssVarName("color-white")})`,r[n.cssVarBlockName("disabled-border-color")]=d}}}return r})}const XC=o.defineComponent({name:"ElButton"}),QC=o.defineComponent({...XC,props:El,emits:FC,setup(t,{expose:e,emit:n}){const r=t,a=ZC(r),i=Be("button"),{_ref:s,_size:l,_type:u,_disabled:c,_props:d,shouldAddSpace:f,handleClick:h}=MC(r,n),v=o.computed(()=>[i.b(),i.m(u.value),i.m(l.value),i.is("disabled",c.value),i.is("loading",r.loading),i.is("plain",r.plain),i.is("round",r.round),i.is("circle",r.circle),i.is("text",r.text),i.is("link",r.link),i.is("has-bg",r.bg)]);return e({ref:s,size:l,type:u,disabled:c,shouldAddSpace:f}),(p,g)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.tag),o.mergeProps({ref_key:"_ref",ref:s},o.unref(d),{class:o.unref(v),style:o.unref(a),onClick:o.unref(h)}),{default:o.withCtx(()=>[p.loading?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[p.$slots.loading?o.renderSlot(p.$slots,"loading",{key:0}):(o.openBlock(),o.createBlock(o.unref(ot),{key:1,class:o.normalizeClass(o.unref(i).is("loading"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.loadingIcon)))]),_:1},8,["class"]))],64)):p.icon||p.$slots.icon?(o.openBlock(),o.createBlock(o.unref(ot),{key:1},{default:o.withCtx(()=>[p.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.icon),{key:0})):o.renderSlot(p.$slots,"icon",{key:1})]),_:3})):o.createCommentVNode("v-if",!0),p.$slots.default?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass({[o.unref(i).em("text","expand")]:o.unref(f)})},[o.renderSlot(p.$slots,"default")],2)):o.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var JC=Te(QC,[["__file","button.vue"]]);const ek={size:El.size,type:El.type},tk=o.defineComponent({name:"ElButtonGroup"}),nk=o.defineComponent({...tk,props:ek,setup(t){const e=t;o.provide(of,o.reactive({size:o.toRef(e,"size"),type:o.toRef(e,"type")}));const n=Be("button");return(r,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(n).b("group"))},[o.renderSlot(r.$slots,"default")],2))}});var ff=Te(nk,[["__file","button-group.vue"]]);const Ut=ft(JC,{ButtonGroup:ff});Fn(ff);const rr=new Map;if(et){let t;document.addEventListener("mousedown",e=>t=e),document.addEventListener("mouseup",e=>{if(t){for(const n of rr.values())for(const{documentHandler:r}of n)r(e,t);t=void 0}})}function hf(t,e){let n=[];return Array.isArray(e.arg)?n=e.arg:Er(e.arg)&&n.push(e.arg),function(r,a){const i=e.instance.popperRef,s=r.target,l=a==null?void 0:a.target,u=!e||!e.instance,c=!s||!l,d=t.contains(s)||t.contains(l),f=t===s,h=n.length&&n.some(p=>p==null?void 0:p.contains(s))||n.length&&n.includes(l),v=i&&(i.contains(s)||i.contains(l));u||c||d||f||h||v||e.value(r,a)}}const pf={beforeMount(t,e){rr.has(t)||rr.set(t,[]),rr.get(t).push({documentHandler:hf(t,e),bindingFn:e.value})},updated(t,e){rr.has(t)||rr.set(t,[]);const n=rr.get(t),r=n.findIndex(i=>i.bindingFn===e.oldValue),a={documentHandler:hf(t,e),bindingFn:e.value};r>=0?n.splice(r,1,a):n.push(a)},unmounted(t){rr.delete(t)}},rk=Ae({header:{type:String,default:""},footer:{type:String,default:""},bodyStyle:{type:ke([String,Object,Array]),default:""},bodyClass:String,shadow:{type:String,values:["always","hover","never"],default:"always"}}),ak=o.defineComponent({name:"ElCard"}),ik=o.defineComponent({...ak,props:rk,setup(t){const e=Be("card");return(n,r)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([o.unref(e).b(),o.unref(e).is(`${n.shadow}-shadow`)])},[n.$slots.header||n.header?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(e).e("header"))},[o.renderSlot(n.$slots,"header",{},()=>[o.createTextVNode(o.toDisplayString(n.header),1)])],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{class:o.normalizeClass([o.unref(e).e("body"),n.bodyClass]),style:o.normalizeStyle(n.bodyStyle)},[o.renderSlot(n.$slots,"default")],6),n.$slots.footer||n.footer?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(e).e("footer"))},[o.renderSlot(n.$slots,"footer",{},()=>[o.createTextVNode(o.toDisplayString(n.footer),1)])],2)):o.createCommentVNode("v-if",!0)],2))}});var ok=Te(ik,[["__file","card.vue"]]);const sk=ft(ok),vf={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},value:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueValue:{type:[String,Number],default:void 0},falseValue:{type:[String,Number],default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},border:Boolean,size:la,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...Jn(["ariaControls"])},gf={[yt]:t=>St(t)||mt(t)||Jr(t),change:t=>St(t)||mt(t)||Jr(t)},da=Symbol("checkboxGroupContextKey"),lk=({model:t,isChecked:e})=>{const n=o.inject(da,void 0),r=o.computed(()=>{var i,s;const l=(i=n==null?void 0:n.max)==null?void 0:i.value,u=(s=n==null?void 0:n.min)==null?void 0:s.value;return!Zn(l)&&t.value.length>=l&&!e.value||!Zn(u)&&t.value.length<=u&&e.value});return{isDisabled:oi(o.computed(()=>(n==null?void 0:n.disabled.value)||r.value)),isLimitDisabled:r}},ck=(t,{model:e,isLimitExceeded:n,hasOwnLabel:r,isDisabled:a,isLabeledByFormItem:i})=>{const s=o.inject(da,void 0),{formItem:l}=Dr(),{emit:u}=o.getCurrentInstance();function c(p){var g,y,m,b;return[!0,t.trueValue,t.trueLabel].includes(p)?(y=(g=t.trueValue)!=null?g:t.trueLabel)!=null?y:!0:(b=(m=t.falseValue)!=null?m:t.falseLabel)!=null?b:!1}function d(p,g){u("change",c(p),g)}function f(p){if(n.value)return;const g=p.target;u("change",c(g.checked),p)}async function h(p){n.value||!r.value&&!a.value&&i.value&&(p.composedPath().some(m=>m.tagName==="LABEL")||(e.value=c([!1,t.falseValue,t.falseLabel].includes(e.value)),await o.nextTick(),d(e.value,p)))}const v=o.computed(()=>(s==null?void 0:s.validateEvent)||t.validateEvent);return o.watch(()=>t.modelValue,()=>{v.value&&(l==null||l.validate("change").catch(p=>tt(p)))}),{handleChange:f,onClickRoot:h}},uk=t=>{const e=o.ref(!1),{emit:n}=o.getCurrentInstance(),r=o.inject(da,void 0),a=o.computed(()=>Zn(r)===!1),i=o.ref(!1),s=o.computed({get(){var l,u;return a.value?(l=r==null?void 0:r.modelValue)==null?void 0:l.value:(u=t.modelValue)!=null?u:e.value},set(l){var u,c;a.value&&At(l)?(i.value=((u=r==null?void 0:r.max)==null?void 0:u.value)!==void 0&&l.length>(r==null?void 0:r.max.value)&&l.length>s.value.length,i.value===!1&&((c=r==null?void 0:r.changeEvent)==null||c.call(r,l))):(n(yt,l),e.value=l)}});return{model:s,isGroup:a,isLimitExceeded:i}},dk=(t,e,{model:n})=>{const r=o.inject(da,void 0),a=o.ref(!1),i=o.computed(()=>co(t.value)?t.label:t.value),s=o.computed(()=>{const d=n.value;return Jr(d)?d:At(d)?gt(i.value)?d.map(o.toRaw).some(f=>lo(f,i.value)):d.map(o.toRaw).includes(i.value):d!=null?d===t.trueValue||d===t.trueLabel:!!d}),l=Nr(o.computed(()=>{var d;return(d=r==null?void 0:r.size)==null?void 0:d.value}),{prop:!0}),u=Nr(o.computed(()=>{var d;return(d=r==null?void 0:r.size)==null?void 0:d.value})),c=o.computed(()=>!!e.default||!co(i.value));return{checkboxButtonSize:l,isChecked:s,isFocused:a,checkboxSize:u,hasOwnLabel:c,actualValue:i}},mf=(t,e)=>{const{formItem:n}=Dr(),{model:r,isGroup:a,isLimitExceeded:i}=uk(t),{isFocused:s,isChecked:l,checkboxButtonSize:u,checkboxSize:c,hasOwnLabel:d,actualValue:f}=dk(t,e,{model:r}),{isDisabled:h}=lk({model:r,isChecked:l}),{inputId:v,isLabeledByFormItem:p}=si(t,{formItemContext:n,disableIdGeneration:d,disableIdManagement:a}),{handleChange:g,onClickRoot:y}=ck(t,{model:r,isLimitExceeded:i,hasOwnLabel:d,isDisabled:h,isLabeledByFormItem:p});return(()=>{function b(){var w,C;At(r.value)&&!r.value.includes(f.value)?r.value.push(f.value):r.value=(C=(w=t.trueValue)!=null?w:t.trueLabel)!=null?C:!0}t.checked&&b()})(),po({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},o.computed(()=>a.value&&co(t.value))),po({from:"true-label",replacement:"true-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},o.computed(()=>!!t.trueLabel)),po({from:"false-label",replacement:"false-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},o.computed(()=>!!t.falseLabel)),{inputId:v,isLabeledByFormItem:p,isChecked:l,isDisabled:h,isFocused:s,checkboxButtonSize:u,checkboxSize:c,hasOwnLabel:d,model:r,actualValue:f,handleChange:g,onClickRoot:y}},fk=o.defineComponent({name:"ElCheckbox"}),hk=o.defineComponent({...fk,props:vf,emits:gf,setup(t){const e=t,n=o.useSlots(),{inputId:r,isLabeledByFormItem:a,isChecked:i,isDisabled:s,isFocused:l,checkboxSize:u,hasOwnLabel:c,model:d,actualValue:f,handleChange:h,onClickRoot:v}=mf(e,n),p=Be("checkbox"),g=o.computed(()=>[p.b(),p.m(u.value),p.is("disabled",s.value),p.is("bordered",e.border),p.is("checked",i.value)]),y=o.computed(()=>[p.e("input"),p.is("disabled",s.value),p.is("checked",i.value),p.is("indeterminate",e.indeterminate),p.is("focus",l.value)]);return(m,b)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(!o.unref(c)&&o.unref(a)?"span":"label"),{class:o.normalizeClass(o.unref(g)),"aria-controls":m.indeterminate?m.ariaControls:null,onClick:o.unref(v)},{default:o.withCtx(()=>{var w,C,E,x;return[o.createElementVNode("span",{class:o.normalizeClass(o.unref(y))},[m.trueValue||m.falseValue||m.trueLabel||m.falseLabel?o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:0,id:o.unref(r),"onUpdate:modelValue":k=>o.isRef(d)?d.value=k:null,class:o.normalizeClass(o.unref(p).e("original")),type:"checkbox",indeterminate:m.indeterminate,name:m.name,tabindex:m.tabindex,disabled:o.unref(s),"true-value":(C=(w=m.trueValue)!=null?w:m.trueLabel)!=null?C:!0,"false-value":(x=(E=m.falseValue)!=null?E:m.falseLabel)!=null?x:!1,onChange:o.unref(h),onFocus:k=>l.value=!0,onBlur:k=>l.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(d)]]):o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:1,id:o.unref(r),"onUpdate:modelValue":k=>o.isRef(d)?d.value=k:null,class:o.normalizeClass(o.unref(p).e("original")),type:"checkbox",indeterminate:m.indeterminate,disabled:o.unref(s),value:o.unref(f),name:m.name,tabindex:m.tabindex,onChange:o.unref(h),onFocus:k=>l.value=!0,onBlur:k=>l.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","disabled","value","name","tabindex","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(d)]]),o.createElementVNode("span",{class:o.normalizeClass(o.unref(p).e("inner"))},null,2)],2),o.unref(c)?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(p).e("label"))},[o.renderSlot(m.$slots,"default"),m.$slots.default?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(m.label),1)],64))],2)):o.createCommentVNode("v-if",!0)]}),_:3},8,["class","aria-controls","onClick"]))}});var pk=Te(hk,[["__file","checkbox.vue"]]);const vk=o.defineComponent({name:"ElCheckboxButton"}),gk=o.defineComponent({...vk,props:vf,emits:gf,setup(t){const e=t,n=o.useSlots(),{isFocused:r,isChecked:a,isDisabled:i,checkboxButtonSize:s,model:l,actualValue:u,handleChange:c}=mf(e,n),d=o.inject(da,void 0),f=Be("checkbox"),h=o.computed(()=>{var p,g,y,m;const b=(g=(p=d==null?void 0:d.fill)==null?void 0:p.value)!=null?g:"";return{backgroundColor:b,borderColor:b,color:(m=(y=d==null?void 0:d.textColor)==null?void 0:y.value)!=null?m:"",boxShadow:b?`-1px 0 0 0 ${b}`:void 0}}),v=o.computed(()=>[f.b("button"),f.bm("button",s.value),f.is("disabled",i.value),f.is("checked",a.value),f.is("focus",r.value)]);return(p,g)=>{var y,m,b,w;return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(o.unref(v))},[p.trueValue||p.falseValue||p.trueLabel||p.falseLabel?o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:0,"onUpdate:modelValue":C=>o.isRef(l)?l.value=C:null,class:o.normalizeClass(o.unref(f).be("button","original")),type:"checkbox",name:p.name,tabindex:p.tabindex,disabled:o.unref(i),"true-value":(m=(y=p.trueValue)!=null?y:p.trueLabel)!=null?m:!0,"false-value":(w=(b=p.falseValue)!=null?b:p.falseLabel)!=null?w:!1,onChange:o.unref(c),onFocus:C=>r.value=!0,onBlur:C=>r.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(l)]]):o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:1,"onUpdate:modelValue":C=>o.isRef(l)?l.value=C:null,class:o.normalizeClass(o.unref(f).be("button","original")),type:"checkbox",name:p.name,tabindex:p.tabindex,disabled:o.unref(i),value:o.unref(u),onChange:o.unref(c),onFocus:C=>r.value=!0,onBlur:C=>r.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","value","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(l)]]),p.$slots.default||p.label?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass(o.unref(f).be("button","inner")),style:o.normalizeStyle(o.unref(a)?o.unref(h):void 0)},[o.renderSlot(p.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(p.label),1)])],6)):o.createCommentVNode("v-if",!0)],2)}}});var yf=Te(gk,[["__file","checkbox-button.vue"]]);const mk=Ae({modelValue:{type:ke(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:la,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...Jn(["ariaLabel"])}),yk={[yt]:t=>At(t),change:t=>At(t)},bk=o.defineComponent({name:"ElCheckboxGroup"}),wk=o.defineComponent({...bk,props:mk,emits:yk,setup(t,{emit:e}){const n=t,r=Be("checkbox"),{formItem:a}=Dr(),{inputId:i,isLabeledByFormItem:s}=si(n,{formItemContext:a}),l=async c=>{e(yt,c),await o.nextTick(),e("change",c)},u=o.computed({get(){return n.modelValue},set(c){l(c)}});return o.provide(da,{...Zu(o.toRefs(n),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:u,changeEvent:l}),o.watch(()=>n.modelValue,()=>{n.validateEvent&&(a==null||a.validate("change").catch(c=>tt(c)))}),(c,d)=>{var f;return o.openBlock(),o.createBlock(o.resolveDynamicComponent(c.tag),{id:o.unref(i),class:o.normalizeClass(o.unref(r).b("group")),role:"group","aria-label":o.unref(s)?void 0:c.ariaLabel||"checkbox-group","aria-labelledby":o.unref(s)?(f=o.unref(a))==null?void 0:f.labelId:void 0},{default:o.withCtx(()=>[o.renderSlot(c.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var bf=Te(wk,[["__file","checkbox-group.vue"]]);const Ck=ft(pk,{CheckboxButton:yf,CheckboxGroup:bf});Fn(yf),Fn(bf);const Dl=Ae({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:nd},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),kk={close:t=>t instanceof MouseEvent,click:t=>t instanceof MouseEvent},xk=o.defineComponent({name:"ElTag"}),Ek=o.defineComponent({...xk,props:Dl,emits:kk,setup(t,{emit:e}){const n=t,r=Nr(),a=Be("tag"),i=o.computed(()=>{const{type:c,hit:d,effect:f,closable:h,round:v}=n;return[a.b(),a.is("closable",h),a.m(c||"primary"),a.m(r.value),a.m(f),a.is("hit",d),a.is("round",v)]}),s=c=>{e("close",c)},l=c=>{e("click",c)},u=c=>{c.component.subTree.component.bum=null};return(c,d)=>c.disableTransitions?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle({backgroundColor:c.color}),onClick:l},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(a).e("content"))},[o.renderSlot(c.$slots,"default")],2),c.closable?(o.openBlock(),o.createBlock(o.unref(ot),{key:0,class:o.normalizeClass(o.unref(a).e("close")),onClick:o.withModifiers(s,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(uo))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0)],6)):(o.openBlock(),o.createBlock(o.Transition,{key:1,name:`${o.unref(a).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:u},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle({backgroundColor:c.color}),onClick:l},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(a).e("content"))},[o.renderSlot(c.$slots,"default")],2),c.closable?(o.openBlock(),o.createBlock(o.unref(ot),{key:0,class:o.normalizeClass(o.unref(a).e("close")),onClick:o.withModifiers(s,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(uo))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var Sk=Te(Ek,[["__file","tag.vue"]]);const Tk=ft(Sk),wf=Symbol("rowContextKey"),Bk=Ae({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),Nk=o.defineComponent({name:"ElRow"}),Dk=o.defineComponent({...Nk,props:Bk,setup(t){const e=t,n=Be("row"),r=o.computed(()=>e.gutter);o.provide(wf,{gutter:r});const a=o.computed(()=>{const s={};return e.gutter&&(s.marginRight=s.marginLeft=`-${e.gutter/2}px`),s}),i=o.computed(()=>[n.b(),n.is(`justify-${e.justify}`,e.justify!=="start"),n.is(`align-${e.align}`,!!e.align)]);return(s,l)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.tag),{class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle(o.unref(a))},{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},8,["class","style"]))}});var _k=Te(Dk,[["__file","row.vue"]]);const Do=ft(_k),Pk=Ae({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:ke([Number,Object]),default:()=>ta({})},sm:{type:ke([Number,Object]),default:()=>ta({})},md:{type:ke([Number,Object]),default:()=>ta({})},lg:{type:ke([Number,Object]),default:()=>ta({})},xl:{type:ke([Number,Object]),default:()=>ta({})}}),Ik=o.defineComponent({name:"ElCol"}),Ok=o.defineComponent({...Ik,props:Pk,setup(t){const e=t,{gutter:n}=o.inject(wf,{gutter:o.computed(()=>0)}),r=Be("col"),a=o.computed(()=>{const s={};return n.value&&(s.paddingLeft=s.paddingRight=`${n.value/2}px`),s}),i=o.computed(()=>{const s=[];return["span","offset","pull","push"].forEach(c=>{const d=e[c];mt(d)&&(c==="span"?s.push(r.b(`${e[c]}`)):d>0&&s.push(r.b(`${c}-${e[c]}`)))}),["xs","sm","md","lg","xl"].forEach(c=>{mt(e[c])?s.push(r.b(`${c}-${e[c]}`)):gt(e[c])&&Object.entries(e[c]).forEach(([d,f])=>{s.push(d!=="span"?r.b(`${c}-${d}-${f}`):r.b(`${c}-${f}`))})}),n.value&&s.push(r.is("guttered")),[r.b(),s]});return(s,l)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.tag),{class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle(o.unref(a))},{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},8,["class","style"]))}});var Lk=Te(Ok,[["__file","col.vue"]]);const di=ft(Lk),Mk=o.defineComponent({name:"ElCollapseTransition"}),Fk=o.defineComponent({...Mk,setup(t){const e=Be("collapse-transition"),n=a=>{a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom},r={beforeEnter(a){a.dataset||(a.dataset={}),a.dataset.oldPaddingTop=a.style.paddingTop,a.dataset.oldPaddingBottom=a.style.paddingBottom,a.style.height&&(a.dataset.elExistsHeight=a.style.height),a.style.maxHeight=0,a.style.paddingTop=0,a.style.paddingBottom=0},enter(a){requestAnimationFrame(()=>{a.dataset.oldOverflow=a.style.overflow,a.dataset.elExistsHeight?a.style.maxHeight=a.dataset.elExistsHeight:a.scrollHeight!==0?a.style.maxHeight=`${a.scrollHeight}px`:a.style.maxHeight=0,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom,a.style.overflow="hidden"})},afterEnter(a){a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow},enterCancelled(a){n(a)},beforeLeave(a){a.dataset||(a.dataset={}),a.dataset.oldPaddingTop=a.style.paddingTop,a.dataset.oldPaddingBottom=a.style.paddingBottom,a.dataset.oldOverflow=a.style.overflow,a.style.maxHeight=`${a.scrollHeight}px`,a.style.overflow="hidden"},leave(a){a.scrollHeight!==0&&(a.style.maxHeight=0,a.style.paddingTop=0,a.style.paddingBottom=0)},afterLeave(a){n(a)},leaveCancelled(a){n(a)}};return(a,i)=>(o.openBlock(),o.createBlock(o.Transition,o.mergeProps({name:o.unref(e).b()},o.toHandlers(r)),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["name"]))}});var Ak=Te(Fk,[["__file","collapse-transition.vue"]]);const Vk=ft(Ak),Rk=Ae({color:{type:ke(Object),required:!0},vertical:{type:Boolean,default:!1}});let _l=!1;function fi(t,e){if(!et)return;const n=function(i){var s;(s=e.drag)==null||s.call(e,i)},r=function(i){var s;document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",r),document.removeEventListener("touchmove",n),document.removeEventListener("touchend",r),document.onselectstart=null,document.ondragstart=null,_l=!1,(s=e.end)==null||s.call(e,i)},a=function(i){var s;_l||(i.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",n),document.addEventListener("mouseup",r),document.addEventListener("touchmove",n),document.addEventListener("touchend",r),_l=!0,(s=e.start)==null||s.call(e,i))};t.addEventListener("mousedown",a),t.addEventListener("touchstart",a,{passive:!1})}const $k=t=>{const e=o.getCurrentInstance(),{t:n}=Xa(),r=o.shallowRef(),a=o.shallowRef(),i=o.computed(()=>t.color.get("alpha")),s=o.computed(()=>n("el.colorpicker.alphaLabel"));function l(f){var h;f.target!==r.value&&u(f),(h=r.value)==null||h.focus()}function u(f){if(!a.value||!r.value)return;const v=e.vnode.el.getBoundingClientRect(),{clientX:p,clientY:g}=Is(f);if(t.vertical){let y=g-v.top;y=Math.max(r.value.offsetHeight/2,y),y=Math.min(y,v.height-r.value.offsetHeight/2),t.color.set("alpha",Math.round((y-r.value.offsetHeight/2)/(v.height-r.value.offsetHeight)*100))}else{let y=p-v.left;y=Math.max(r.value.offsetWidth/2,y),y=Math.min(y,v.width-r.value.offsetWidth/2),t.color.set("alpha",Math.round((y-r.value.offsetWidth/2)/(v.width-r.value.offsetWidth)*100))}}function c(f){const{code:h,shiftKey:v}=f,p=v?10:1;switch(h){case it.left:case it.down:f.preventDefault(),f.stopPropagation(),d(-p);break;case it.right:case it.up:f.preventDefault(),f.stopPropagation(),d(p);break}}function d(f){let h=i.value+f;h=h<0?0:h>100?100:h,t.color.set("alpha",h)}return{thumb:r,bar:a,alpha:i,alphaLabel:s,handleDrag:u,handleClick:l,handleKeydown:c}},zk=(t,{bar:e,thumb:n,handleDrag:r})=>{const a=o.getCurrentInstance(),i=Be("color-alpha-slider"),s=o.ref(0),l=o.ref(0),u=o.ref();function c(){if(!n.value||t.vertical)return 0;const b=a.vnode.el,w=t.color.get("alpha");return b?Math.round(w*(b.offsetWidth-n.value.offsetWidth/2)/100):0}function d(){if(!n.value)return 0;const b=a.vnode.el;if(!t.vertical)return 0;const w=t.color.get("alpha");return b?Math.round(w*(b.offsetHeight-n.value.offsetHeight/2)/100):0}function f(){if(t.color&&t.color.value){const{r:b,g:w,b:C}=t.color.toRgb();return`linear-gradient(to right, rgba(${b}, ${w}, ${C}, 0) 0%, rgba(${b}, ${w}, ${C}, 1) 100%)`}return""}function h(){s.value=c(),l.value=d(),u.value=f()}o.onMounted(()=>{if(!e.value||!n.value)return;const b={drag:w=>{r(w)},end:w=>{r(w)}};fi(e.value,b),fi(n.value,b),h()}),o.watch(()=>t.color.get("alpha"),()=>h()),o.watch(()=>t.color.value,()=>h());const v=o.computed(()=>[i.b(),i.is("vertical",t.vertical)]),p=o.computed(()=>i.e("bar")),g=o.computed(()=>i.e("thumb")),y=o.computed(()=>({background:u.value})),m=o.computed(()=>({left:ea(s.value),top:ea(l.value)}));return{rootKls:v,barKls:p,barStyle:y,thumbKls:g,thumbStyle:m,update:h}},Hk=o.defineComponent({name:"ElColorAlphaSlider"}),Kk=o.defineComponent({...Hk,props:Rk,setup(t,{expose:e}){const n=t,{alpha:r,alphaLabel:a,bar:i,thumb:s,handleDrag:l,handleClick:u,handleKeydown:c}=$k(n),{rootKls:d,barKls:f,barStyle:h,thumbKls:v,thumbStyle:p,update:g}=zk(n,{bar:i,thumb:s,handleDrag:l});return e({update:g,bar:i,thumb:s}),(y,m)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(d))},[o.createElementVNode("div",{ref_key:"bar",ref:i,class:o.normalizeClass(o.unref(f)),style:o.normalizeStyle(o.unref(h)),onClick:o.unref(u)},null,14,["onClick"]),o.createElementVNode("div",{ref_key:"thumb",ref:s,class:o.normalizeClass(o.unref(v)),style:o.normalizeStyle(o.unref(p)),"aria-label":o.unref(a),"aria-valuenow":o.unref(r),"aria-orientation":y.vertical?"vertical":"horizontal","aria-valuemin":"0","aria-valuemax":"100",role:"slider",tabindex:"0",onKeydown:o.unref(c)},null,46,["aria-label","aria-valuenow","aria-orientation","onKeydown"])],2))}});var qk=Te(Kk,[["__file","alpha-slider.vue"]]);const Uk=o.defineComponent({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(t){const e=Be("color-hue-slider"),n=o.getCurrentInstance(),r=o.ref(),a=o.ref(),i=o.ref(0),s=o.ref(0),l=o.computed(()=>t.color.get("hue"));o.watch(()=>l.value,()=>{h()});function u(v){v.target!==r.value&&c(v)}function c(v){if(!a.value||!r.value)return;const g=n.vnode.el.getBoundingClientRect(),{clientX:y,clientY:m}=Is(v);let b;if(t.vertical){let w=m-g.top;w=Math.min(w,g.height-r.value.offsetHeight/2),w=Math.max(r.value.offsetHeight/2,w),b=Math.round((w-r.value.offsetHeight/2)/(g.height-r.value.offsetHeight)*360)}else{let w=y-g.left;w=Math.min(w,g.width-r.value.offsetWidth/2),w=Math.max(r.value.offsetWidth/2,w),b=Math.round((w-r.value.offsetWidth/2)/(g.width-r.value.offsetWidth)*360)}t.color.set("hue",b)}function d(){if(!r.value)return 0;const v=n.vnode.el;if(t.vertical)return 0;const p=t.color.get("hue");return v?Math.round(p*(v.offsetWidth-r.value.offsetWidth/2)/360):0}function f(){if(!r.value)return 0;const v=n.vnode.el;if(!t.vertical)return 0;const p=t.color.get("hue");return v?Math.round(p*(v.offsetHeight-r.value.offsetHeight/2)/360):0}function h(){i.value=d(),s.value=f()}return o.onMounted(()=>{if(!a.value||!r.value)return;const v={drag:p=>{c(p)},end:p=>{c(p)}};fi(a.value,v),fi(r.value,v),h()}),{bar:a,thumb:r,thumbLeft:i,thumbTop:s,hueValue:l,handleClick:u,update:h,ns:e}}});function Gk(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([t.ns.b(),t.ns.is("vertical",t.vertical)])},[o.createElementVNode("div",{ref:"bar",class:o.normalizeClass(t.ns.e("bar")),onClick:t.handleClick},null,10,["onClick"]),o.createElementVNode("div",{ref:"thumb",class:o.normalizeClass(t.ns.e("thumb")),style:o.normalizeStyle({left:t.thumbLeft+"px",top:t.thumbTop+"px"})},null,6)],2)}var Wk=Te(Uk,[["render",Gk],["__file","hue-slider.vue"]]);const jk=Ae({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:la,popperClass:{type:String,default:""},tabindex:{type:[String,Number],default:0},teleported:$t.teleported,predefine:{type:ke(Array)},validateEvent:{type:Boolean,default:!0},...Jn(["ariaLabel"])}),Yk={[yt]:t=>St(t)||Yn(t),[el]:t=>St(t)||Yn(t),activeChange:t=>St(t)||Yn(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent},Cf=Symbol("colorPickerContextKey"),kf=function(t,e,n){return[t,e*n/((t=(2-e)*n)<1?t:2-t)||0,t/2]},Zk=function(t){return typeof t=="string"&&t.includes(".")&&Number.parseFloat(t)===1},Xk=function(t){return typeof t=="string"&&t.includes("%")},fa=function(t,e){Zk(t)&&(t="100%");const n=Xk(t);return t=Math.min(e,Math.max(0,Number.parseFloat(`${t}`))),n&&(t=Number.parseInt(`${t*e}`,10)/100),Math.abs(t-e)<1e-6?1:t%e/Number.parseFloat(e)},xf={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},_o=t=>{t=Math.min(Math.round(t),255);const e=Math.floor(t/16),n=t%16;return`${xf[e]||e}${xf[n]||n}`},Ef=function({r:t,g:e,b:n}){return Number.isNaN(+t)||Number.isNaN(+e)||Number.isNaN(+n)?"":`#${_o(t)}${_o(e)}${_o(n)}`},Pl={A:10,B:11,C:12,D:13,E:14,F:15},Pr=function(t){return t.length===2?(Pl[t[0].toUpperCase()]||+t[0])*16+(Pl[t[1].toUpperCase()]||+t[1]):Pl[t[1].toUpperCase()]||+t[1]},Qk=function(t,e,n){e=e/100,n=n/100;let r=e;const a=Math.max(n,.01);n*=2,e*=n<=1?n:2-n,r*=a<=1?a:2-a;const i=(n+e)/2,s=n===0?2*r/(a+r):2*e/(n+e);return{h:t,s:s*100,v:i*100}},Sf=(t,e,n)=>{t=fa(t,255),e=fa(e,255),n=fa(n,255);const r=Math.max(t,e,n),a=Math.min(t,e,n);let i;const s=r,l=r-a,u=r===0?0:l/r;if(r===a)i=0;else{switch(r){case t:{i=(e-n)/l+(e<n?6:0);break}case e:{i=(n-t)/l+2;break}case n:{i=(t-e)/l+4;break}}i/=6}return{h:i*360,s:u*100,v:s*100}},hi=function(t,e,n){t=fa(t,360)*6,e=fa(e,100),n=fa(n,100);const r=Math.floor(t),a=t-r,i=n*(1-e),s=n*(1-a*e),l=n*(1-(1-a)*e),u=r%6,c=[n,s,i,i,l,n][u],d=[l,n,n,s,i,i][u],f=[i,i,l,n,n,s][u];return{r:Math.round(c*255),g:Math.round(d*255),b:Math.round(f*255)}};class pi{constructor(e={}){this._hue=0,this._saturation=100,this._value=100,this._alpha=100,this.enableAlpha=!1,this.format="hex",this.value="";for(const n in e)wr(e,n)&&(this[n]=e[n]);e.value?this.fromString(e.value):this.doOnChange()}set(e,n){if(arguments.length===1&&typeof e=="object"){for(const r in e)wr(e,r)&&this.set(r,e[r]);return}this[`_${e}`]=n,this.doOnChange()}get(e){return e==="alpha"?Math.floor(this[`_${e}`]):this[`_${e}`]}toRgb(){return hi(this._hue,this._saturation,this._value)}fromString(e){if(!e){this._hue=0,this._saturation=100,this._value=100,this.doOnChange();return}const n=(r,a,i)=>{this._hue=Math.max(0,Math.min(360,r)),this._saturation=Math.max(0,Math.min(100,a)),this._value=Math.max(0,Math.min(100,i)),this.doOnChange()};if(e.includes("hsl")){const r=e.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));if(r.length===4?this._alpha=Number.parseFloat(r[3])*100:r.length===3&&(this._alpha=100),r.length>=3){const{h:a,s:i,v:s}=Qk(r[0],r[1],r[2]);n(a,i,s)}}else if(e.includes("hsv")){const r=e.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));r.length===4?this._alpha=Number.parseFloat(r[3])*100:r.length===3&&(this._alpha=100),r.length>=3&&n(r[0],r[1],r[2])}else if(e.includes("rgb")){const r=e.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));if(r.length===4?this._alpha=Number.parseFloat(r[3])*100:r.length===3&&(this._alpha=100),r.length>=3){const{h:a,s:i,v:s}=Sf(r[0],r[1],r[2]);n(a,i,s)}}else if(e.includes("#")){const r=e.replace("#","").trim();if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(r))return;let a,i,s;r.length===3?(a=Pr(r[0]+r[0]),i=Pr(r[1]+r[1]),s=Pr(r[2]+r[2])):(r.length===6||r.length===8)&&(a=Pr(r.slice(0,2)),i=Pr(r.slice(2,4)),s=Pr(r.slice(4,6))),r.length===8?this._alpha=Pr(r.slice(6))/255*100:(r.length===3||r.length===6)&&(this._alpha=100);const{h:l,s:u,v:c}=Sf(a,i,s);n(l,u,c)}}compare(e){return Math.abs(e._hue-this._hue)<2&&Math.abs(e._saturation-this._saturation)<1&&Math.abs(e._value-this._value)<1&&Math.abs(e._alpha-this._alpha)<1}doOnChange(){const{_hue:e,_saturation:n,_value:r,_alpha:a,format:i}=this;if(this.enableAlpha)switch(i){case"hsl":{const s=kf(e,n/100,r/100);this.value=`hsla(${e}, ${Math.round(s[1]*100)}%, ${Math.round(s[2]*100)}%, ${this.get("alpha")/100})`;break}case"hsv":{this.value=`hsva(${e}, ${Math.round(n)}%, ${Math.round(r)}%, ${this.get("alpha")/100})`;break}case"hex":{this.value=`${Ef(hi(e,n,r))}${_o(a*255/100)}`;break}default:{const{r:s,g:l,b:u}=hi(e,n,r);this.value=`rgba(${s}, ${l}, ${u}, ${this.get("alpha")/100})`}}else switch(i){case"hsl":{const s=kf(e,n/100,r/100);this.value=`hsl(${e}, ${Math.round(s[1]*100)}%, ${Math.round(s[2]*100)}%)`;break}case"hsv":{this.value=`hsv(${e}, ${Math.round(n)}%, ${Math.round(r)}%)`;break}case"rgb":{const{r:s,g:l,b:u}=hi(e,n,r);this.value=`rgb(${s}, ${l}, ${u})`;break}default:this.value=Ef(hi(e,n,r))}}}const Jk=o.defineComponent({props:{colors:{type:Array,required:!0},color:{type:Object,required:!0},enableAlpha:{type:Boolean,required:!0}},setup(t){const e=Be("color-predefine"),{currentColor:n}=o.inject(Cf),r=o.ref(i(t.colors,t.color));o.watch(()=>n.value,s=>{const l=new pi;l.fromString(s),r.value.forEach(u=>{u.selected=l.compare(u)})}),o.watchEffect(()=>{r.value=i(t.colors,t.color)});function a(s){t.color.fromString(t.colors[s])}function i(s,l){return s.map(u=>{const c=new pi;return c.enableAlpha=t.enableAlpha,c.format="rgba",c.fromString(u),c.selected=c.value===l.value,c})}return{rgbaColors:r,handleSelect:a,ns:e}}});function ex(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(t.ns.b())},[o.createElementVNode("div",{class:o.normalizeClass(t.ns.e("colors"))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.rgbaColors,(s,l)=>(o.openBlock(),o.createElementBlock("div",{key:t.colors[l],class:o.normalizeClass([t.ns.e("color-selector"),t.ns.is("alpha",s._alpha<100),{selected:s.selected}]),onClick:u=>t.handleSelect(l)},[o.createElementVNode("div",{style:o.normalizeStyle({backgroundColor:s.value})},null,4)],10,["onClick"]))),128))],2)],2)}var tx=Te(Jk,[["render",ex],["__file","predefine.vue"]]);const nx=o.defineComponent({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(t){const e=Be("color-svpanel"),n=o.getCurrentInstance(),r=o.ref(0),a=o.ref(0),i=o.ref("hsl(0, 100%, 50%)"),s=o.computed(()=>{const c=t.color.get("hue"),d=t.color.get("value");return{hue:c,value:d}});function l(){const c=t.color.get("saturation"),d=t.color.get("value"),f=n.vnode.el,{clientWidth:h,clientHeight:v}=f;a.value=c*h/100,r.value=(100-d)*v/100,i.value=`hsl(${t.color.get("hue")}, 100%, 50%)`}function u(c){const f=n.vnode.el.getBoundingClientRect(),{clientX:h,clientY:v}=Is(c);let p=h-f.left,g=v-f.top;p=Math.max(0,p),p=Math.min(p,f.width),g=Math.max(0,g),g=Math.min(g,f.height),a.value=p,r.value=g,t.color.set({saturation:p/f.width*100,value:100-g/f.height*100})}return o.watch(()=>s.value,()=>{l()}),o.onMounted(()=>{fi(n.vnode.el,{drag:c=>{u(c)},end:c=>{u(c)}}),l()}),{cursorTop:r,cursorLeft:a,background:i,colorValue:s,handleDrag:u,update:l,ns:e}}});function rx(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(t.ns.b()),style:o.normalizeStyle({backgroundColor:t.background})},[o.createElementVNode("div",{class:o.normalizeClass(t.ns.e("white"))},null,2),o.createElementVNode("div",{class:o.normalizeClass(t.ns.e("black"))},null,2),o.createElementVNode("div",{class:o.normalizeClass(t.ns.e("cursor")),style:o.normalizeStyle({top:t.cursorTop+"px",left:t.cursorLeft+"px"})},[o.createElementVNode("div")],6)],6)}var ax=Te(nx,[["render",rx],["__file","sv-panel.vue"]]);const ix=o.defineComponent({name:"ElColorPicker"}),ox=o.defineComponent({...ix,props:jk,emits:Yk,setup(t,{expose:e,emit:n}){const r=t,{t:a}=Xa(),i=Be("color"),{formItem:s}=Dr(),l=Nr(),u=oi(),{inputId:c,isLabeledByFormItem:d}=si(r,{formItemContext:s}),f=o.ref(),h=o.ref(),v=o.ref(),p=o.ref(),g=o.ref(),y=o.ref(),{isFocused:m,handleFocus:b,handleBlur:w}=fl(g,{beforeFocus(){return u.value},beforeBlur(A){var K;return(K=p.value)==null?void 0:K.isFocusInsideContent(A)},afterBlur(){F(!1),V()}});let C=!0;const E=o.reactive(new pi({enableAlpha:r.showAlpha,format:r.colorFormat||"",value:r.modelValue})),x=o.ref(!1),k=o.ref(!1),B=o.ref(""),S=o.computed(()=>!r.modelValue&&!k.value?"transparent":P(E,r.showAlpha)),N=o.computed(()=>!r.modelValue&&!k.value?"":E.value),D=o.computed(()=>d.value?void 0:r.ariaLabel||a("el.colorpicker.defaultLabel")),_=o.computed(()=>d.value?s==null?void 0:s.labelId:void 0),O=o.computed(()=>[i.b("picker"),i.is("disabled",u.value),i.bm("picker",l.value),i.is("focused",m.value)]);function P(A,K){if(!(A instanceof pi))throw new TypeError("color should be instance of _color Class");const{r:W,g:oe,b:he}=A.toRgb();return K?`rgba(${W}, ${oe}, ${he}, ${A.get("alpha")/100})`:`rgb(${W}, ${oe}, ${he})`}function F(A){x.value=A}const I=Yu(F,100,{leading:!0});function M(){u.value||F(!0)}function L(){I(!1),V()}function V(){o.nextTick(()=>{r.modelValue?E.fromString(r.modelValue):(E.value="",o.nextTick(()=>{k.value=!1}))})}function H(){u.value||I(!x.value)}function $(){E.fromString(B.value)}function z(){const A=E.value;n(yt,A),n("change",A),r.validateEvent&&(s==null||s.validate("change").catch(K=>tt(K))),I(!1),o.nextTick(()=>{const K=new pi({enableAlpha:r.showAlpha,format:r.colorFormat||"",value:r.modelValue});E.compare(K)||V()})}function j(){I(!1),n(yt,null),n("change",null),r.modelValue!==null&&r.validateEvent&&(s==null||s.validate("change").catch(A=>tt(A))),V()}function ee(){x.value&&(L(),m.value&&ne())}function J(A){A.preventDefault(),A.stopPropagation(),F(!1),V()}function X(A){switch(A.code){case it.enter:case it.space:A.preventDefault(),A.stopPropagation(),M(),y.value.focus();break;case it.esc:J(A);break}}function ne(){g.value.focus()}function Y(){g.value.blur()}return o.onMounted(()=>{r.modelValue&&(B.value=N.value)}),o.watch(()=>r.modelValue,A=>{A?A&&A!==E.value&&(C=!1,E.fromString(A)):k.value=!1}),o.watch(()=>[r.colorFormat,r.showAlpha],()=>{E.enableAlpha=r.showAlpha,E.format=r.colorFormat||E.format,E.doOnChange(),n(yt,E.value)}),o.watch(()=>N.value,A=>{B.value=A,C&&n("activeChange",A),C=!0}),o.watch(()=>E.value,()=>{!r.modelValue&&!k.value&&(k.value=!0)}),o.watch(()=>x.value,()=>{o.nextTick(()=>{var A,K,W;(A=f.value)==null||A.update(),(K=h.value)==null||K.update(),(W=v.value)==null||W.update()})}),o.provide(Cf,{currentColor:N}),e({color:E,show:M,hide:L,focus:ne,blur:Y}),(A,K)=>(o.openBlock(),o.createBlock(o.unref(ui),{ref_key:"popper",ref:p,visible:x.value,"show-arrow":!1,"fallback-placements":["bottom","top","right","left"],offset:0,"gpu-acceleration":!1,"popper-class":[o.unref(i).be("picker","panel"),o.unref(i).b("dropdown"),A.popperClass],"stop-popper-mouse-event":!1,effect:"light",trigger:"click",teleported:A.teleported,transition:`${o.unref(i).namespace.value}-zoom-in-top`,persistent:"",onHide:W=>F(!1)},{content:o.withCtx(()=>[o.withDirectives((o.openBlock(),o.createElementBlock("div",{onKeydown:o.withKeys(J,["esc"])},[o.createElementVNode("div",{class:o.normalizeClass(o.unref(i).be("dropdown","main-wrapper"))},[o.createVNode(Wk,{ref_key:"hue",ref:f,class:"hue-slider",color:o.unref(E),vertical:""},null,8,["color"]),o.createVNode(ax,{ref_key:"sv",ref:h,color:o.unref(E)},null,8,["color"])],2),A.showAlpha?(o.openBlock(),o.createBlock(qk,{key:0,ref_key:"alpha",ref:v,color:o.unref(E)},null,8,["color"])):o.createCommentVNode("v-if",!0),A.predefine?(o.openBlock(),o.createBlock(tx,{key:1,ref:"predefine","enable-alpha":A.showAlpha,color:o.unref(E),colors:A.predefine},null,8,["enable-alpha","color","colors"])):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{class:o.normalizeClass(o.unref(i).be("dropdown","btns"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(i).be("dropdown","value"))},[o.createVNode(o.unref(li),{ref_key:"inputRef",ref:y,modelValue:B.value,"onUpdate:modelValue":W=>B.value=W,"validate-event":!1,size:"small",onKeyup:o.withKeys($,["enter"]),onBlur:$},null,8,["modelValue","onUpdate:modelValue","onKeyup"])],2),o.createVNode(o.unref(Ut),{class:o.normalizeClass(o.unref(i).be("dropdown","link-btn")),text:"",size:"small",onClick:j},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("el.colorpicker.clear")),1)]),_:1},8,["class"]),o.createVNode(o.unref(Ut),{plain:"",size:"small",class:o.normalizeClass(o.unref(i).be("dropdown","btn")),onClick:z},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("el.colorpicker.confirm")),1)]),_:1},8,["class"])],2)],40,["onKeydown"])),[[o.unref(pf),ee]])]),default:o.withCtx(()=>[o.createElementVNode("div",o.mergeProps({id:o.unref(c),ref_key:"triggerRef",ref:g},A.$attrs,{class:o.unref(O),role:"button","aria-label":o.unref(D),"aria-labelledby":o.unref(_),"aria-description":o.unref(a)("el.colorpicker.description",{color:A.modelValue||""}),"aria-disabled":o.unref(u),tabindex:o.unref(u)?-1:A.tabindex,onKeydown:X,onFocus:o.unref(b),onBlur:o.unref(w)}),[o.unref(u)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(i).be("picker","mask"))},null,2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{class:o.normalizeClass(o.unref(i).be("picker","trigger")),onClick:H},[o.createElementVNode("span",{class:o.normalizeClass([o.unref(i).be("picker","color"),o.unref(i).is("alpha",A.showAlpha)])},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(i).be("picker","color-inner")),style:o.normalizeStyle({backgroundColor:o.unref(S)})},[o.withDirectives(o.createVNode(o.unref(ot),{class:o.normalizeClass([o.unref(i).be("picker","icon"),o.unref(i).is("icon-arrow-down")])},{default:o.withCtx(()=>[o.createVNode(o.unref(Za))]),_:1},8,["class"]),[[o.vShow,A.modelValue||k.value]]),o.withDirectives(o.createVNode(o.unref(ot),{class:o.normalizeClass([o.unref(i).be("picker","empty"),o.unref(i).is("icon-close")])},{default:o.withCtx(()=>[o.createVNode(o.unref(uo))]),_:1},8,["class"]),[[o.vShow,!A.modelValue&&!k.value]])],6)],2)],2)],16,["id","aria-label","aria-labelledby","aria-description","aria-disabled","tabindex","onFocus","onBlur"])]),_:1},8,["visible","popper-class","teleported","transition","onHide"]))}});var sx=Te(ox,[["__file","color-picker.vue"]]);const lx=ft(sx),cx=o.defineComponent({name:"ElContainer"}),ux=o.defineComponent({...cx,props:{direction:{type:String}},setup(t){const e=t,n=o.useSlots(),r=Be("container"),a=o.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:n&&n.default?n.default().some(s=>{const l=s.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(i,s)=>(o.openBlock(),o.createElementBlock("section",{class:o.normalizeClass([o.unref(r).b(),o.unref(r).is("vertical",o.unref(a))])},[o.renderSlot(i.$slots,"default")],2))}});var dx=Te(ux,[["__file","container.vue"]]);const fx=o.defineComponent({name:"ElAside"}),hx=o.defineComponent({...fx,props:{width:{type:String,default:null}},setup(t){const e=t,n=Be("aside"),r=o.computed(()=>e.width?n.cssVarBlock({width:e.width}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("aside",{class:o.normalizeClass(o.unref(n).b()),style:o.normalizeStyle(o.unref(r))},[o.renderSlot(a.$slots,"default")],6))}});var Tf=Te(hx,[["__file","aside.vue"]]);const px=o.defineComponent({name:"ElFooter"}),vx=o.defineComponent({...px,props:{height:{type:String,default:null}},setup(t){const e=t,n=Be("footer"),r=o.computed(()=>e.height?n.cssVarBlock({height:e.height}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("footer",{class:o.normalizeClass(o.unref(n).b()),style:o.normalizeStyle(o.unref(r))},[o.renderSlot(a.$slots,"default")],6))}});var Bf=Te(vx,[["__file","footer.vue"]]);const gx=o.defineComponent({name:"ElHeader"}),mx=o.defineComponent({...gx,props:{height:{type:String,default:null}},setup(t){const e=t,n=Be("header"),r=o.computed(()=>e.height?n.cssVarBlock({height:e.height}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("header",{class:o.normalizeClass(o.unref(n).b()),style:o.normalizeStyle(o.unref(r))},[o.renderSlot(a.$slots,"default")],6))}});var Nf=Te(mx,[["__file","header.vue"]]);const yx=o.defineComponent({name:"ElMain"}),bx=o.defineComponent({...yx,setup(t){const e=Be("main");return(n,r)=>(o.openBlock(),o.createElementBlock("main",{class:o.normalizeClass(o.unref(e).b())},[o.renderSlot(n.$slots,"default")],2))}});var Df=Te(bx,[["__file","main.vue"]]);const Il=ft(dx,{Aside:Tf,Footer:Bf,Header:Nf,Main:Df});Fn(Tf),Fn(Bf);const _f=Fn(Nf),Ol=Fn(Df),wx=o.defineComponent({inheritAttrs:!1});function Cx(t,e,n,r,a,i){return o.renderSlot(t.$slots,"default")}var kx=Te(wx,[["render",Cx],["__file","collection.vue"]]);const xx=o.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function Ex(t,e,n,r,a,i){return o.renderSlot(t.$slots,"default")}var Sx=Te(xx,[["render",Ex],["__file","collection-item.vue"]]);const Tx="data-el-collection-item",Bx=t=>{const e=`El${t}Collection`,n=`${e}Item`,r=Symbol(e),a=Symbol(n),i={...kx,name:e,setup(){const l=o.ref(null),u=new Map,c=()=>{const d=o.unref(l);if(!d)return[];const f=Array.from(d.querySelectorAll(`[${Tx}]`));return[...u.values()].sort((v,p)=>f.indexOf(v.ref)-f.indexOf(p.ref))};o.provide(r,{itemMap:u,getItems:c,collectionRef:l})}},s={...Sx,name:n,setup(l,{attrs:u}){const c=o.ref(null),d=o.inject(r,void 0);o.provide(a,{collectionItemRef:c}),o.onMounted(()=>{const f=o.unref(c);f&&d.itemMap.set(f,{ref:f,...u})}),o.onBeforeUnmount(()=>{const f=o.unref(c);d.itemMap.delete(f)})}};return{COLLECTION_INJECTION_KEY:r,COLLECTION_ITEM_INJECTION_KEY:a,ElCollection:i,ElCollectionItem:s}},Ll=Ae({trigger:ci.trigger,effect:{...$t.effect,default:"light"},type:{type:ke(String)},placement:{type:ke(String),default:"bottom"},popperOptions:{type:ke(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:ke([Number,String]),default:0},maxHeight:{type:ke([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:ke(Object)},teleported:$t.teleported});Ae({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:Xn}}),Ae({onKeydown:{type:ke(Function)}}),Bx("Dropdown");const Pf=Symbol("ElSelectGroup"),vi=Symbol("ElSelect");function Nx(t,e){const n=o.inject(vi),r=o.inject(Pf,{disabled:!1}),a=o.computed(()=>d(Wn(n.props.modelValue),t.value)),i=o.computed(()=>{var v;if(n.props.multiple){const p=Wn((v=n.props.modelValue)!=null?v:[]);return!a.value&&p.length>=n.props.multipleLimit&&n.props.multipleLimit>0}else return!1}),s=o.computed(()=>t.label||(gt(t.value)?"":t.value)),l=o.computed(()=>t.value||t.label||""),u=o.computed(()=>t.disabled||e.groupDisabled||i.value),c=o.getCurrentInstance(),d=(v=[],p)=>{if(gt(t.value)){const g=n.props.valueKey;return v&&v.some(y=>o.toRaw(Ln(y,g))===Ln(p,g))}else return v&&v.includes(p)},f=()=>{!t.disabled&&!r.disabled&&(n.states.hoveringIndex=n.optionsArray.indexOf(c.proxy))},h=v=>{const p=new RegExp(q1(v),"i");e.visible=p.test(s.value)||t.created};return o.watch(()=>s.value,()=>{!t.created&&!n.props.remote&&n.setSelected()}),o.watch(()=>t.value,(v,p)=>{const{remote:g,valueKey:y}=n.props;if(v!==p&&(n.onOptionDestroy(p,c.proxy),n.onOptionCreate(c.proxy)),!t.created&&!g){if(y&>(v)&>(p)&&v[y]===p[y])return;n.setSelected()}}),o.watch(()=>r.disabled,()=>{e.groupDisabled=r.disabled},{immediate:!0}),{select:n,currentLabel:s,currentValue:l,itemSelected:a,isDisabled:u,hoverItem:f,updateOption:h}}const Dx=o.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(t){const e=Be("select"),n=Co(),r=o.computed(()=>[e.be("dropdown","item"),e.is("disabled",o.unref(l)),e.is("selected",o.unref(s)),e.is("hovering",o.unref(h))]),a=o.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:i,itemSelected:s,isDisabled:l,select:u,hoverItem:c,updateOption:d}=Nx(t,a),{visible:f,hover:h}=o.toRefs(a),v=o.getCurrentInstance().proxy;u.onOptionCreate(v),o.onBeforeUnmount(()=>{const g=v.value,{selected:y}=u.states,b=(u.props.multiple?y:[y]).some(w=>w.value===v.value);o.nextTick(()=>{u.states.cachedOptions.get(g)===v&&!b&&u.states.cachedOptions.delete(g)}),u.onOptionDestroy(g,v)});function p(){l.value||u.handleOptionSelect(v)}return{ns:e,id:n,containerKls:r,currentLabel:i,itemSelected:s,isDisabled:l,select:u,hoverItem:c,updateOption:d,visible:f,hover:h,selectOptionClick:p,states:a}}});function _x(t,e,n,r,a,i){return o.withDirectives((o.openBlock(),o.createElementBlock("li",{id:t.id,class:o.normalizeClass(t.containerKls),role:"option","aria-disabled":t.isDisabled||void 0,"aria-selected":t.itemSelected,onMouseenter:t.hoverItem,onClick:o.withModifiers(t.selectOptionClick,["stop"])},[o.renderSlot(t.$slots,"default",{},()=>[o.createElementVNode("span",null,o.toDisplayString(t.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[o.vShow,t.visible]])}var Ml=Te(Dx,[["render",_x],["__file","option.vue"]]);const Px=o.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const t=o.inject(vi),e=Be("select"),n=o.computed(()=>t.props.popperClass),r=o.computed(()=>t.props.multiple),a=o.computed(()=>t.props.fitInputWidth),i=o.ref("");function s(){var l;i.value=`${(l=t.selectRef)==null?void 0:l.offsetWidth}px`}return o.onMounted(()=>{s(),Pn(t.selectRef,s)}),{ns:e,minWidth:i,popperClass:n,isMultiple:r,isFitInputWidth:a}}});function Ix(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([t.ns.b("dropdown"),t.ns.is("multiple",t.isMultiple),t.popperClass]),style:o.normalizeStyle({[t.isFitInputWidth?"width":"minWidth"]:t.minWidth})},[t.$slots.header?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(t.ns.be("dropdown","header"))},[o.renderSlot(t.$slots,"header")],2)):o.createCommentVNode("v-if",!0),o.renderSlot(t.$slots,"default"),t.$slots.footer?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(t.ns.be("dropdown","footer"))},[o.renderSlot(t.$slots,"footer")],2)):o.createCommentVNode("v-if",!0)],6)}var Ox=Te(Px,[["render",Ix],["__file","select-dropdown.vue"]]);const Lx=11,Mx=(t,e)=>{const{t:n}=Xa(),r=Co(),a=Be("select"),i=Be("input"),s=o.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=o.ref(null),u=o.ref(null),c=o.ref(null),d=o.ref(null),f=o.ref(null),h=o.ref(null),v=o.ref(null),p=o.ref(null),g=o.ref(null),y=o.ref(null),m=o.ref(null),b=o.ref(null),{isComposing:w,handleCompositionStart:C,handleCompositionUpdate:E,handleCompositionEnd:x}=Rd({afterComposition:q=>Q(q)}),{wrapperRef:k,isFocused:B}=fl(f,{beforeFocus(){return I.value},afterFocus(){t.automaticDropdown&&!S.value&&(S.value=!0,s.menuVisibleOnFocus=!0)},beforeBlur(q){var ce,Pe;return((ce=c.value)==null?void 0:ce.isFocusInsideContent(q))||((Pe=d.value)==null?void 0:Pe.isFocusInsideContent(q))},afterBlur(){S.value=!1,s.menuVisibleOnFocus=!1}}),S=o.ref(!1),N=o.ref(),{form:D,formItem:_}=Dr(),{inputId:O}=si(t,{formItemContext:_}),{valueOnClear:P,isEmptyValue:F}=a2(t),I=o.computed(()=>t.disabled||(D==null?void 0:D.disabled)),M=o.computed(()=>At(t.modelValue)?t.modelValue.length>0:!F(t.modelValue)),L=o.computed(()=>t.clearable&&!I.value&&s.inputHovering&&M.value),V=o.computed(()=>t.remote&&t.filterable&&!t.remoteShowSuffix?"":t.suffixIcon),H=o.computed(()=>a.is("reverse",V.value&&S.value)),$=o.computed(()=>(_==null?void 0:_.validateState)||""),z=o.computed(()=>td[$.value]),j=o.computed(()=>t.remote?300:0),ee=o.computed(()=>t.loading?t.loadingText||n("el.select.loading"):t.remote&&!s.inputValue&&s.options.size===0?!1:t.filterable&&s.inputValue&&s.options.size>0&&J.value===0?t.noMatchText||n("el.select.noMatch"):s.options.size===0?t.noDataText||n("el.select.noData"):null),J=o.computed(()=>X.value.filter(q=>q.visible).length),X=o.computed(()=>{const q=Array.from(s.options.values()),ce=[];return s.optionValues.forEach(Pe=>{const He=q.findIndex(Dn=>Dn.value===Pe);He>-1&&ce.push(q[He])}),ce.length>=q.length?ce:q}),ne=o.computed(()=>Array.from(s.cachedOptions.values())),Y=o.computed(()=>{const q=X.value.filter(ce=>!ce.created).some(ce=>ce.currentLabel===s.inputValue);return t.filterable&&t.allowCreate&&s.inputValue!==""&&!q}),A=()=>{t.filterable&&Lt(t.filterMethod)||t.filterable&&t.remote&&Lt(t.remoteMethod)||X.value.forEach(q=>{var ce;(ce=q.updateOption)==null||ce.call(q,s.inputValue)})},K=Nr(),W=o.computed(()=>["small"].includes(K.value)?"small":"default"),oe=o.computed({get(){return S.value&&ee.value!==!1},set(q){S.value=q}}),he=o.computed(()=>{if(t.multiple&&!Zn(t.modelValue))return Wn(t.modelValue).length===0&&!s.inputValue;const q=At(t.modelValue)?t.modelValue[0]:t.modelValue;return t.filterable||Zn(q)?!s.inputValue:!0}),re=o.computed(()=>{var q;const ce=(q=t.placeholder)!=null?q:n("el.select.placeholder");return t.multiple||!M.value?ce:s.selectedLabel}),se=o.computed(()=>Ps?null:"mouseenter");o.watch(()=>t.modelValue,(q,ce)=>{t.multiple&&t.filterable&&!t.reserveKeyword&&(s.inputValue="",ue("")),de(),!lo(q,ce)&&t.validateEvent&&(_==null||_.validate("change").catch(Pe=>tt(Pe)))},{flush:"post",deep:!0}),o.watch(()=>S.value,q=>{q?ue(s.inputValue):(s.inputValue="",s.previousQuery=null,s.isBeforeHide=!0),e("visible-change",q)}),o.watch(()=>s.options.entries(),()=>{var q;if(!et)return;const ce=((q=l.value)==null?void 0:q.querySelectorAll("input"))||[];(!t.filterable&&!t.defaultFirstOption&&!Zn(t.modelValue)||!Array.from(ce).includes(document.activeElement))&&de(),t.defaultFirstOption&&(t.filterable||t.remote)&&J.value&&pe()},{flush:"post"}),o.watch(()=>s.hoveringIndex,q=>{mt(q)&&q>-1?N.value=X.value[q]||{}:N.value={},X.value.forEach(ce=>{ce.hover=N.value===ce})}),o.watchEffect(()=>{s.isBeforeHide||A()});const ue=q=>{s.previousQuery===q||w.value||(s.previousQuery=q,t.filterable&&Lt(t.filterMethod)?t.filterMethod(q):t.filterable&&t.remote&&Lt(t.remoteMethod)&&t.remoteMethod(q),t.defaultFirstOption&&(t.filterable||t.remote)&&J.value?o.nextTick(pe):o.nextTick(Ne))},pe=()=>{const q=X.value.filter(He=>He.visible&&!He.disabled&&!He.states.groupDisabled),ce=q.find(He=>He.created),Pe=q[0];s.hoveringIndex=ge(X.value,ce||Pe)},de=()=>{if(t.multiple)s.selectedLabel="";else{const ce=At(t.modelValue)?t.modelValue[0]:t.modelValue,Pe=me(ce);s.selectedLabel=Pe.currentLabel,s.selected=[Pe];return}const q=[];Zn(t.modelValue)||Wn(t.modelValue).forEach(ce=>{q.push(me(ce))}),s.selected=q},me=q=>{let ce;const Pe=Os(q).toLowerCase()==="object",He=Os(q).toLowerCase()==="null",Dn=Os(q).toLowerCase()==="undefined";for(let Un=s.cachedOptions.size-1;Un>=0;Un--){const an=ne.value[Un];if(Pe?Ln(an.value,t.valueKey)===Ln(q,t.valueKey):an.value===q){ce={value:q,currentLabel:an.currentLabel,get isDisabled(){return an.isDisabled}};break}}if(ce)return ce;const yr=Pe?q.label:!He&&!Dn?q:"";return{value:q,currentLabel:yr}},Ne=()=>{s.hoveringIndex=X.value.findIndex(q=>s.selected.some(ce=>It(ce)===It(q)))},De=()=>{s.selectionWidth=u.value.getBoundingClientRect().width},Ee=()=>{s.calculatorWidth=h.value.getBoundingClientRect().width},_e=()=>{s.collapseItemWidth=m.value.getBoundingClientRect().width},te=()=>{var q,ce;(ce=(q=c.value)==null?void 0:q.updatePopper)==null||ce.call(q)},T=()=>{var q,ce;(ce=(q=d.value)==null?void 0:q.updatePopper)==null||ce.call(q)},R=()=>{s.inputValue.length>0&&!S.value&&(S.value=!0),ue(s.inputValue)},Q=q=>{if(s.inputValue=q.target.value,t.remote)G();else return R()},G=Yu(()=>{R()},j.value),U=q=>{lo(t.modelValue,q)||e(el,q)},ie=q=>V1(q,ce=>!s.disabledOptions.has(ce)),Z=q=>{if(t.multiple&&q.code!==it.delete&&q.target.value.length<=0){const ce=Wn(t.modelValue).slice(),Pe=ie(ce);if(Pe<0)return;const He=ce[Pe];ce.splice(Pe,1),e(yt,ce),U(ce),e("remove-tag",He)}},ae=(q,ce)=>{const Pe=s.selected.indexOf(ce);if(Pe>-1&&!I.value){const He=Wn(t.modelValue).slice();He.splice(Pe,1),e(yt,He),U(He),e("remove-tag",ce.value)}q.stopPropagation(),nt()},we=q=>{q.stopPropagation();const ce=t.multiple?[]:P.value;if(t.multiple)for(const Pe of s.selected)Pe.isDisabled&&ce.push(Pe.value);e(yt,ce),U(ce),s.hoveringIndex=-1,S.value=!1,e("clear"),nt()},Ce=q=>{var ce;if(t.multiple){const Pe=Wn((ce=t.modelValue)!=null?ce:[]).slice(),He=ge(Pe,q.value);He>-1?Pe.splice(He,1):(t.multipleLimit<=0||Pe.length<t.multipleLimit)&&Pe.push(q.value),e(yt,Pe),U(Pe),q.created&&ue(""),t.filterable&&!t.reserveKeyword&&(s.inputValue="")}else e(yt,q.value),U(q.value),S.value=!1;nt(),!S.value&&o.nextTick(()=>{Se(q)})},ge=(q=[],ce)=>{if(!gt(ce))return q.indexOf(ce);const Pe=t.valueKey;let He=-1;return q.some((Dn,yr)=>o.toRaw(Ln(Dn,Pe))===Ln(ce,Pe)?(He=yr,!0):!1),He},Se=q=>{var ce,Pe,He,Dn,yr;const Ha=At(q)?q[0]:q;let Un=null;if(Ha!=null&&Ha.value){const an=X.value.filter(br=>br.value===Ha.value);an.length>0&&(Un=an[0].$el)}if(c.value&&Un){const an=(Dn=(He=(Pe=(ce=c.value)==null?void 0:ce.popperRef)==null?void 0:Pe.contentRef)==null?void 0:He.querySelector)==null?void 0:Dn.call(He,`.${a.be("dropdown","wrap")}`);an&&W1(an,Un)}(yr=b.value)==null||yr.handleScroll()},ve=q=>{s.options.set(q.value,q),s.cachedOptions.set(q.value,q),q.disabled&&s.disabledOptions.set(q.value,q)},ye=(q,ce)=>{s.options.get(q)===ce&&s.options.delete(q)},Ge=o.computed(()=>{var q,ce;return(ce=(q=c.value)==null?void 0:q.popperRef)==null?void 0:ce.contentRef}),$e=()=>{s.isBeforeHide=!1,o.nextTick(()=>Se(s.selected))},nt=()=>{var q;(q=f.value)==null||q.focus()},rt=()=>{var q;(q=f.value)==null||q.blur()},Qe=q=>{we(q)},Pt=()=>{S.value=!1,B.value&&rt()},dt=()=>{s.inputValue.length>0?s.inputValue="":S.value=!1},pt=()=>{I.value||(Ps&&(s.inputHovering=!0),s.menuVisibleOnFocus?s.menuVisibleOnFocus=!1:S.value=!S.value)},jt=()=>{S.value?X.value[s.hoveringIndex]&&Ce(X.value[s.hoveringIndex]):pt()},It=q=>gt(q.value)?Ln(q.value,t.valueKey):q.value,Ot=o.computed(()=>X.value.filter(q=>q.visible).every(q=>q.disabled)),rn=o.computed(()=>t.multiple?t.collapseTags?s.selected.slice(0,t.maxCollapseTags):s.selected:[]),vn=o.computed(()=>t.multiple?t.collapseTags?s.selected.slice(t.maxCollapseTags):[]:[]),Kt=q=>{if(!S.value){S.value=!0;return}if(!(s.options.size===0||s.filteredOptionsCount===0||w.value)&&!Ot.value){q==="next"?(s.hoveringIndex++,s.hoveringIndex===s.options.size&&(s.hoveringIndex=0)):q==="prev"&&(s.hoveringIndex--,s.hoveringIndex<0&&(s.hoveringIndex=s.options.size-1));const ce=X.value[s.hoveringIndex];(ce.disabled===!0||ce.states.groupDisabled===!0||!ce.visible)&&Kt(q),o.nextTick(()=>Se(N.value))}},Je=()=>{if(!u.value)return 0;const q=window.getComputedStyle(u.value);return Number.parseFloat(q.gap||"6px")},at=o.computed(()=>{const q=Je();return{maxWidth:`${m.value&&t.maxCollapseTags===1?s.selectionWidth-s.collapseItemWidth-q:s.selectionWidth}px`}}),vt=o.computed(()=>({maxWidth:`${s.selectionWidth}px`})),mr=o.computed(()=>({width:`${Math.max(s.calculatorWidth,Lx)}px`}));return Pn(u,De),Pn(h,Ee),Pn(g,te),Pn(k,te),Pn(y,T),Pn(m,_e),o.onMounted(()=>{de()}),{inputId:O,contentId:r,nsSelect:a,nsInput:i,states:s,isFocused:B,expanded:S,optionsArray:X,hoverOption:N,selectSize:K,filteredOptionsCount:J,resetCalculatorWidth:Ee,updateTooltip:te,updateTagTooltip:T,debouncedOnInputChange:G,onInput:Q,deletePrevTag:Z,deleteTag:ae,deleteSelected:we,handleOptionSelect:Ce,scrollToOption:Se,hasModelValue:M,shouldShowPlaceholder:he,currentPlaceholder:re,mouseEnterEventName:se,showClose:L,iconComponent:V,iconReverse:H,validateState:$,validateIcon:z,showNewOption:Y,updateOptions:A,collapseTagSize:W,setSelected:de,selectDisabled:I,emptyText:ee,handleCompositionStart:C,handleCompositionUpdate:E,handleCompositionEnd:x,onOptionCreate:ve,onOptionDestroy:ye,handleMenuEnter:$e,focus:nt,blur:rt,handleClearClick:Qe,handleClickOutside:Pt,handleEsc:dt,toggleMenu:pt,selectOption:jt,getValueKey:It,navigateOptions:Kt,dropdownMenuVisible:oe,showTagList:rn,collapseTagList:vn,tagStyle:at,collapseTagStyle:vt,inputStyle:mr,popperRef:Ge,inputRef:f,tooltipRef:c,tagTooltipRef:d,calculatorRef:h,prefixRef:v,suffixRef:p,selectRef:l,wrapperRef:k,selectionRef:u,scrollbarRef:b,menuRef:g,tagMenuRef:y,collapseItemRef:m}};var Fx=o.defineComponent({name:"ElOptions",setup(t,{slots:e}){const n=o.inject(vi);let r=[];return()=>{var a,i;const s=(a=e.default)==null?void 0:a.call(e),l=[];function u(c){At(c)&&c.forEach(d=>{var f,h,v,p;const g=(f=(d==null?void 0:d.type)||{})==null?void 0:f.name;g==="ElOptionGroup"?u(!St(d.children)&&!At(d.children)&&Lt((h=d.children)==null?void 0:h.default)?(v=d.children)==null?void 0:v.default():d.children):g==="ElOption"?l.push((p=d.props)==null?void 0:p.value):At(d.children)&&u(d.children)})}return s.length&&u((i=s[0])==null?void 0:i.children),lo(l,r)||(r=l,n&&(n.states.optionValues=l)),s}}});const Ax=Ae({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:la,effect:{type:ke(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:ke(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:$t.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:Xn,default:Qs},fitInputWidth:Boolean,suffixIcon:{type:Xn,default:Za},tagType:{...Dl.type,default:"info"},tagEffect:{...Dl.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:ke(String),values:go,default:"bottom-start"},fallbackPlacements:{type:ke(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...r2,...Jn(["ariaLabel"])}),If="ElSelect",Vx=o.defineComponent({name:If,componentName:If,components:{ElSelectMenu:Ox,ElOption:Ml,ElOptions:Fx,ElTag:Tk,ElScrollbar:I2,ElTooltip:ui,ElIcon:ot},directives:{ClickOutside:pf},props:Ax,emits:[yt,el,"remove-tag","clear","visible-change","focus","blur"],setup(t,{emit:e}){const n=o.computed(()=>{const{modelValue:i,multiple:s}=t,l=s?[]:void 0;return At(i)?s?i:l:s?l:i}),r=o.reactive({...o.toRefs(t),modelValue:n}),a=Mx(r,e);return o.provide(vi,o.reactive({props:r,states:a.states,optionsArray:a.optionsArray,handleOptionSelect:a.handleOptionSelect,onOptionCreate:a.onOptionCreate,onOptionDestroy:a.onOptionDestroy,selectRef:a.selectRef,setSelected:a.setSelected})),{...a,modelValue:n}}});function Rx(t,e,n,r,a,i){const s=o.resolveComponent("el-tag"),l=o.resolveComponent("el-tooltip"),u=o.resolveComponent("el-icon"),c=o.resolveComponent("el-option"),d=o.resolveComponent("el-options"),f=o.resolveComponent("el-scrollbar"),h=o.resolveComponent("el-select-menu"),v=o.resolveDirective("click-outside");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"selectRef",class:o.normalizeClass([t.nsSelect.b(),t.nsSelect.m(t.selectSize)]),[o.toHandlerKey(t.mouseEnterEventName)]:p=>t.states.inputHovering=!0,onMouseleave:p=>t.states.inputHovering=!1},[o.createVNode(l,{ref:"tooltipRef",visible:t.dropdownMenuVisible,placement:t.placement,teleported:t.teleported,"popper-class":[t.nsSelect.e("popper"),t.popperClass],"popper-options":t.popperOptions,"fallback-placements":t.fallbackPlacements,effect:t.effect,pure:"",trigger:"click",transition:`${t.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:t.persistent,"append-to":t.appendTo,onBeforeShow:t.handleMenuEnter,onHide:p=>t.states.isBeforeHide=!1},{default:o.withCtx(()=>{var p;return[o.createElementVNode("div",{ref:"wrapperRef",class:o.normalizeClass([t.nsSelect.e("wrapper"),t.nsSelect.is("focused",t.isFocused),t.nsSelect.is("hovering",t.states.inputHovering),t.nsSelect.is("filterable",t.filterable),t.nsSelect.is("disabled",t.selectDisabled)]),onClick:o.withModifiers(t.toggleMenu,["prevent"])},[t.$slots.prefix?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"prefixRef",class:o.normalizeClass(t.nsSelect.e("prefix"))},[o.renderSlot(t.$slots,"prefix")],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{ref:"selectionRef",class:o.normalizeClass([t.nsSelect.e("selection"),t.nsSelect.is("near",t.multiple&&!t.$slots.prefix&&!!t.states.selected.length)])},[t.multiple?o.renderSlot(t.$slots,"tag",{key:0},()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.showTagList,g=>(o.openBlock(),o.createElementBlock("div",{key:t.getValueKey(g),class:o.normalizeClass(t.nsSelect.e("selected-item"))},[o.createVNode(s,{closable:!t.selectDisabled&&!g.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:o.normalizeStyle(t.tagStyle),onClose:y=>t.deleteTag(y,g)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(t.nsSelect.e("tags-text"))},[o.renderSlot(t.$slots,"label",{label:g.currentLabel,value:g.value},()=>[o.createTextVNode(o.toDisplayString(g.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),t.collapseTags&&t.states.selected.length>t.maxCollapseTags?(o.openBlock(),o.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:t.dropdownMenuVisible||!t.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:t.effect,placement:"bottom",teleported:t.teleported},{default:o.withCtx(()=>[o.createElementVNode("div",{ref:"collapseItemRef",class:o.normalizeClass(t.nsSelect.e("selected-item"))},[o.createVNode(s,{closable:!1,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:o.normalizeStyle(t.collapseTagStyle)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(t.nsSelect.e("tags-text"))}," + "+o.toDisplayString(t.states.selected.length-t.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:o.withCtx(()=>[o.createElementVNode("div",{ref:"tagMenuRef",class:o.normalizeClass(t.nsSelect.e("selection"))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.collapseTagList,g=>(o.openBlock(),o.createElementBlock("div",{key:t.getValueKey(g),class:o.normalizeClass(t.nsSelect.e("selected-item"))},[o.createVNode(s,{class:"in-tooltip",closable:!t.selectDisabled&&!g.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",onClose:y=>t.deleteTag(y,g)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(t.nsSelect.e("tags-text"))},[o.renderSlot(t.$slots,"label",{label:g.currentLabel,value:g.value},()=>[o.createTextVNode(o.toDisplayString(g.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):o.createCommentVNode("v-if",!0)]):o.createCommentVNode("v-if",!0),t.selectDisabled?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass([t.nsSelect.e("selected-item"),t.nsSelect.e("input-wrapper"),t.nsSelect.is("hidden",!t.filterable)])},[o.withDirectives(o.createElementVNode("input",{id:t.inputId,ref:"inputRef","onUpdate:modelValue":g=>t.states.inputValue=g,type:"text",name:t.name,class:o.normalizeClass([t.nsSelect.e("input"),t.nsSelect.is(t.selectSize)]),disabled:t.selectDisabled,autocomplete:t.autocomplete,style:o.normalizeStyle(t.inputStyle),role:"combobox",readonly:!t.filterable,spellcheck:"false","aria-activedescendant":((p=t.hoverOption)==null?void 0:p.id)||"","aria-controls":t.contentId,"aria-expanded":t.dropdownMenuVisible,"aria-label":t.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[o.withKeys(o.withModifiers(g=>t.navigateOptions("next"),["stop","prevent"]),["down"]),o.withKeys(o.withModifiers(g=>t.navigateOptions("prev"),["stop","prevent"]),["up"]),o.withKeys(o.withModifiers(t.handleEsc,["stop","prevent"]),["esc"]),o.withKeys(o.withModifiers(t.selectOption,["stop","prevent"]),["enter"]),o.withKeys(o.withModifiers(t.deletePrevTag,["stop"]),["delete"])],onCompositionstart:t.handleCompositionStart,onCompositionupdate:t.handleCompositionUpdate,onCompositionend:t.handleCompositionEnd,onInput:t.onInput,onClick:o.withModifiers(t.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[o.vModelText,t.states.inputValue]]),t.filterable?(o.openBlock(),o.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:o.normalizeClass(t.nsSelect.e("input-calculator")),textContent:o.toDisplayString(t.states.inputValue)},null,10,["textContent"])):o.createCommentVNode("v-if",!0)],2)),t.shouldShowPlaceholder?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass([t.nsSelect.e("selected-item"),t.nsSelect.e("placeholder"),t.nsSelect.is("transparent",!t.hasModelValue||t.expanded&&!t.states.inputValue)])},[t.hasModelValue?o.renderSlot(t.$slots,"label",{key:0,label:t.currentPlaceholder,value:t.modelValue},()=>[o.createElementVNode("span",null,o.toDisplayString(t.currentPlaceholder),1)]):(o.openBlock(),o.createElementBlock("span",{key:1},o.toDisplayString(t.currentPlaceholder),1))],2)):o.createCommentVNode("v-if",!0)],2),o.createElementVNode("div",{ref:"suffixRef",class:o.normalizeClass(t.nsSelect.e("suffix"))},[t.iconComponent&&!t.showClose?(o.openBlock(),o.createBlock(u,{key:0,class:o.normalizeClass([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.iconReverse])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.iconComponent)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),t.showClose&&t.clearIcon?(o.openBlock(),o.createBlock(u,{key:1,class:o.normalizeClass([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.nsSelect.e("clear")]),onClick:t.handleClearClick},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.clearIcon)))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0),t.validateState&&t.validateIcon?(o.openBlock(),o.createBlock(u,{key:2,class:o.normalizeClass([t.nsInput.e("icon"),t.nsInput.e("validateIcon")])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.validateIcon)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:o.withCtx(()=>[o.createVNode(h,{ref:"menuRef"},{default:o.withCtx(()=>[t.$slots.header?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(t.nsSelect.be("dropdown","header")),onClick:o.withModifiers(()=>{},["stop"])},[o.renderSlot(t.$slots,"header")],10,["onClick"])):o.createCommentVNode("v-if",!0),o.withDirectives(o.createVNode(f,{id:t.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":t.nsSelect.be("dropdown","wrap"),"view-class":t.nsSelect.be("dropdown","list"),class:o.normalizeClass([t.nsSelect.is("empty",t.filteredOptionsCount===0)]),role:"listbox","aria-label":t.ariaLabel,"aria-orientation":"vertical"},{default:o.withCtx(()=>[t.showNewOption?(o.openBlock(),o.createBlock(c,{key:0,value:t.states.inputValue,created:!0},null,8,["value"])):o.createCommentVNode("v-if",!0),o.createVNode(d,null,{default:o.withCtx(()=>[o.renderSlot(t.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[o.vShow,t.states.options.size>0&&!t.loading]]),t.$slots.loading&&t.loading?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(t.nsSelect.be("dropdown","loading"))},[o.renderSlot(t.$slots,"loading")],2)):t.loading||t.filteredOptionsCount===0?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(t.nsSelect.be("dropdown","empty"))},[o.renderSlot(t.$slots,"empty",{},()=>[o.createElementVNode("span",null,o.toDisplayString(t.emptyText),1)])],2)):o.createCommentVNode("v-if",!0),t.$slots.footer?(o.openBlock(),o.createElementBlock("div",{key:3,class:o.normalizeClass(t.nsSelect.be("dropdown","footer")),onClick:o.withModifiers(()=>{},["stop"])},[o.renderSlot(t.$slots,"footer")],10,["onClick"])):o.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[v,t.handleClickOutside,t.popperRef]])}var $x=Te(Vx,[["render",Rx],["__file","select.vue"]]);const zx=o.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(t){const e=Be("select"),n=o.ref(null),r=o.getCurrentInstance(),a=o.ref([]);o.provide(Pf,o.reactive({...o.toRefs(t)}));const i=o.computed(()=>a.value.some(c=>c.visible===!0)),s=c=>{var d,f;return((d=c.type)==null?void 0:d.name)==="ElOption"&&!!((f=c.component)!=null&&f.proxy)},l=c=>{const d=Wn(c),f=[];return d.forEach(h=>{var v,p;s(h)?f.push(h.component.proxy):(v=h.children)!=null&&v.length?f.push(...l(h.children)):(p=h.component)!=null&&p.subTree&&f.push(...l(h.component.subTree))}),f},u=()=>{a.value=l(r.subTree)};return o.onMounted(()=>{u()}),$g(n,u,{attributes:!0,subtree:!0,childList:!0}),{groupRef:n,visible:i,ns:e}}});function Hx(t,e,n,r,a,i){return o.withDirectives((o.openBlock(),o.createElementBlock("ul",{ref:"groupRef",class:o.normalizeClass(t.ns.be("group","wrap"))},[o.createElementVNode("li",{class:o.normalizeClass(t.ns.be("group","title"))},o.toDisplayString(t.label),3),o.createElementVNode("li",null,[o.createElementVNode("ul",{class:o.normalizeClass(t.ns.b("group"))},[o.renderSlot(t.$slots,"default")],2)])],2)),[[o.vShow,t.visible]])}var Of=Te(zx,[["render",Hx],["__file","option-group.vue"]]);const Kx=ft($x,{Option:Ml,OptionGroup:Of}),qx=Fn(Ml);Fn(Of);const Ux=Ae({trigger:ci.trigger,placement:Ll.placement,disabled:ci.disabled,visible:$t.visible,transition:$t.transition,popperOptions:Ll.popperOptions,tabindex:Ll.tabindex,content:$t.content,popperStyle:$t.popperStyle,popperClass:$t.popperClass,enterable:{...$t.enterable,default:!0},effect:{...$t.effect,default:"light"},teleported:$t.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),Gx={"update:visible":t=>Jr(t),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},Wx="onUpdate:visible",jx=o.defineComponent({name:"ElPopover"}),Yx=o.defineComponent({...jx,props:Ux,emits:Gx,setup(t,{expose:e,emit:n}){const r=t,a=o.computed(()=>r[Wx]),i=Be("popover"),s=o.ref(),l=o.computed(()=>{var y;return(y=o.unref(s))==null?void 0:y.popperRef}),u=o.computed(()=>[{width:ea(r.width)},r.popperStyle]),c=o.computed(()=>[i.b(),r.popperClass,{[i.m("plain")]:!!r.content}]),d=o.computed(()=>r.transition===`${i.namespace.value}-fade-in-linear`),f=()=>{var y;(y=s.value)==null||y.hide()},h=()=>{n("before-enter")},v=()=>{n("before-leave")},p=()=>{n("after-enter")},g=()=>{n("update:visible",!1),n("after-leave")};return e({popperRef:l,hide:f}),(y,m)=>(o.openBlock(),o.createBlock(o.unref(ui),o.mergeProps({ref_key:"tooltipRef",ref:s},y.$attrs,{trigger:y.trigger,placement:y.placement,disabled:y.disabled,visible:y.visible,transition:y.transition,"popper-options":y.popperOptions,tabindex:y.tabindex,content:y.content,offset:y.offset,"show-after":y.showAfter,"hide-after":y.hideAfter,"auto-close":y.autoClose,"show-arrow":y.showArrow,"aria-label":y.title,effect:y.effect,enterable:y.enterable,"popper-class":o.unref(c),"popper-style":o.unref(u),teleported:y.teleported,persistent:y.persistent,"gpu-acceleration":o.unref(d),"onUpdate:visible":o.unref(a),onBeforeShow:h,onBeforeHide:v,onShow:p,onHide:g}),{content:o.withCtx(()=>[y.title?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(i).e("title")),role:"title"},o.toDisplayString(y.title),3)):o.createCommentVNode("v-if",!0),o.renderSlot(y.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(y.content),1)])]),default:o.withCtx(()=>[y.$slots.reference?o.renderSlot(y.$slots,"reference",{key:0}):o.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var Zx=Te(Yx,[["__file","popover.vue"]]);const Lf=(t,e)=>{const n=e.arg||e.value,r=n==null?void 0:n.popperRef;r&&(r.triggerRef=t)};var Xx={mounted(t,e){Lf(t,e)},updated(t,e){Lf(t,e)}};const Qx=Bb(Xx,"popover"),ha=ft(Zx,{directive:Qx}),pa="$treeNodeId",Mf=function(t,e){!e||e[pa]||Object.defineProperty(e,pa,{value:t.id,enumerable:!1,configurable:!1,writable:!1})},Fl=function(t,e){return t?e[t]:e[pa]},Al=(t,e,n)=>{const r=t.value.currentNode;n();const a=t.value.currentNode;r!==a&&e("current-change",a?a.data:null,a)},Vl=t=>{let e=!0,n=!0,r=!0;for(let a=0,i=t.length;a<i;a++){const s=t[a];(s.checked!==!0||s.indeterminate)&&(e=!1,s.disabled||(r=!1)),(s.checked!==!1||s.indeterminate)&&(n=!1)}return{all:e,none:n,allWithoutDisable:r,half:!e&&!n}},gi=function(t){if(t.childNodes.length===0||t.loading)return;const{all:e,none:n,half:r}=Vl(t.childNodes);e?(t.checked=!0,t.indeterminate=!1):r?(t.checked=!1,t.indeterminate=!0):n&&(t.checked=!1,t.indeterminate=!1);const a=t.parent;!a||a.level===0||t.store.checkStrictly||gi(a)},Po=function(t,e){const n=t.store.props,r=t.data||{},a=n[e];if(typeof a=="function")return a(r,t);if(typeof a=="string")return r[a];if(typeof a>"u"){const i=r[e];return i===void 0?"":i}};let Jx=0;class Ir{constructor(e){this.id=Jx++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const n in e)wr(e,n)&&(this[n]=e[n]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const e=this.store;if(!e)throw new Error("[Node]store is required!");e.registerNode(this);const n=e.props;if(n&&typeof n.isLeaf<"u"){const i=Po(this,"isLeaf");typeof i=="boolean"&&(this.isLeafByUser=i)}if(e.lazy!==!0&&this.data?(this.setData(this.data),e.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&e.lazy&&e.defaultExpandAll&&!this.isLeafByUser&&this.expand(),Array.isArray(this.data)||Mf(this,this.data),!this.data)return;const r=e.defaultExpandedKeys,a=e.key;a&&r&&r.includes(this.key)&&this.expand(null,e.autoExpandParent),a&&e.currentNodeKey!==void 0&&this.key===e.currentNodeKey&&(e.currentNode=this,e.currentNode.isCurrent=!0),e.lazy&&e._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(e){Array.isArray(e)||Mf(this,e),this.data=e,this.childNodes=[];let n;this.level===0&&Array.isArray(this.data)?n=this.data:n=Po(this,"children")||[];for(let r=0,a=n.length;r<a;r++)this.insertChild({data:n[r]})}get label(){return Po(this,"label")}get key(){const e=this.store.key;return this.data?this.data[e]:null}get disabled(){return Po(this,"disabled")}get nextSibling(){const e=this.parent;if(e){const n=e.childNodes.indexOf(this);if(n>-1)return e.childNodes[n+1]}return null}get previousSibling(){const e=this.parent;if(e){const n=e.childNodes.indexOf(this);if(n>-1)return n>0?e.childNodes[n-1]:null}return null}contains(e,n=!0){return(this.childNodes||[]).some(r=>r===e||n&&r.contains(e))}remove(){const e=this.parent;e&&e.removeChild(this)}insertChild(e,n,r){if(!e)throw new Error("InsertChild error: child is required.");if(!(e instanceof Ir)){if(!r){const a=this.getChildren(!0);a.includes(e.data)||(typeof n>"u"||n<0?a.push(e.data):a.splice(n,0,e.data))}Object.assign(e,{parent:this,store:this.store}),e=o.reactive(new Ir(e)),e instanceof Ir&&e.initialize()}e.level=this.level+1,typeof n>"u"||n<0?this.childNodes.push(e):this.childNodes.splice(n,0,e),this.updateLeafState()}insertBefore(e,n){let r;n&&(r=this.childNodes.indexOf(n)),this.insertChild(e,r)}insertAfter(e,n){let r;n&&(r=this.childNodes.indexOf(n),r!==-1&&(r+=1)),this.insertChild(e,r)}removeChild(e){const n=this.getChildren()||[],r=n.indexOf(e.data);r>-1&&n.splice(r,1);const a=this.childNodes.indexOf(e);a>-1&&(this.store&&this.store.deregisterNode(e),e.parent=null,this.childNodes.splice(a,1)),this.updateLeafState()}removeChildByData(e){let n=null;for(let r=0;r<this.childNodes.length;r++)if(this.childNodes[r].data===e){n=this.childNodes[r];break}n&&this.removeChild(n)}expand(e,n){const r=()=>{if(n){let a=this.parent;for(;a.level>0;)a.expanded=!0,a=a.parent}this.expanded=!0,e&&e(),this.childNodes.forEach(a=>{a.canFocus=!0})};this.shouldLoadData()?this.loadData(a=>{Array.isArray(a)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||gi(this),r())}):r()}doCreateChildren(e,n={}){e.forEach(r=>{this.insertChild(Object.assign({data:r},n),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(e=>{e.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const e=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!e||e.length===0;return}this.isLeaf=!1}setChecked(e,n,r,a){if(this.indeterminate=e==="half",this.checked=e===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:s,allWithoutDisable:l}=Vl(this.childNodes);!this.isLeaf&&!s&&l&&(this.checked=!1,e=!1);const u=()=>{if(n){const c=this.childNodes;for(let h=0,v=c.length;h<v;h++){const p=c[h];a=a||e!==!1;const g=p.disabled?p.checked:a;p.setChecked(g,n,!0,a)}const{half:d,all:f}=Vl(c);f||(this.checked=f,this.indeterminate=d)}};if(this.shouldLoadData()){this.loadData(()=>{u(),gi(this)},{checked:e!==!1});return}else u()}const i=this.parent;!i||i.level===0||r||gi(i)}getChildren(e=!1){if(this.level===0)return this.data;const n=this.data;if(!n)return null;const r=this.store.props;let a="children";return r&&(a=r.children||"children"),n[a]===void 0&&(n[a]=null),e&&!n[a]&&(n[a]=[]),n[a]}updateChildren(){const e=this.getChildren()||[],n=this.childNodes.map(i=>i.data),r={},a=[];e.forEach((i,s)=>{const l=i[pa];!!l&&n.findIndex(c=>c[pa]===l)>=0?r[l]={index:s,data:i}:a.push({index:s,data:i})}),this.store.lazy||n.forEach(i=>{r[i[pa]]||this.removeChildByData(i)}),a.forEach(({index:i,data:s})=>{this.insertChild({data:s},i)}),this.updateLeafState()}loadData(e,n={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(n).length)){this.loading=!0;const r=i=>{this.childNodes=[],this.doCreateChildren(i,n),this.loaded=!0,this.loading=!1,this.updateLeafState(),e&&e.call(this,i)},a=()=>{this.loading=!1};this.store.load(this,r,a)}else e&&e.call(this)}eachNode(e){const n=[this];for(;n.length;){const r=n.shift();n.unshift(...r.childNodes),e(r)}}reInitChecked(){this.store.checkStrictly||gi(this)}}class eE{constructor(e){this.currentNode=null,this.currentNodeKey=null;for(const n in e)wr(e,n)&&(this[n]=e[n]);this.nodesMap={}}initialize(){if(this.root=new Ir({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const e=this.load;e(this.root,n=>{this.root.doCreateChildren(n),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(e){const n=this.filterNodeMethod,r=this.lazy,a=function(i){const s=i.root?i.root.childNodes:i.childNodes;if(s.forEach(l=>{l.visible=n.call(l,e,l.data,l),a(l)}),!i.visible&&s.length){let l=!0;l=!s.some(u=>u.visible),i.root?i.root.visible=l===!1:i.visible=l===!1}e&&i.visible&&!i.isLeaf&&(!r||i.loaded)&&i.expand()};a(this)}setData(e){e!==this.root.data?(this.nodesMap={},this.root.setData(e),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(e){if(e instanceof Ir)return e;const n=gt(e)?Fl(this.key,e):e;return this.nodesMap[n]||null}insertBefore(e,n){const r=this.getNode(n);r.parent.insertBefore({data:e},r)}insertAfter(e,n){const r=this.getNode(n);r.parent.insertAfter({data:e},r)}remove(e){const n=this.getNode(e);n&&n.parent&&(n===this.currentNode&&(this.currentNode=null),n.parent.removeChild(n))}append(e,n){const r=co(n)?this.root:this.getNode(n);r&&r.insertChild({data:e})}_initDefaultCheckedNodes(){const e=this.defaultCheckedKeys||[],n=this.nodesMap;e.forEach(r=>{const a=n[r];a&&a.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(e){(this.defaultCheckedKeys||[]).includes(e.key)&&e.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(e){e!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=e,this._initDefaultCheckedNodes())}registerNode(e){const n=this.key;!e||!e.data||(n?e.key!==void 0&&(this.nodesMap[e.key]=e):this.nodesMap[e.id]=e)}deregisterNode(e){!this.key||!e||!e.data||(e.childNodes.forEach(r=>{this.deregisterNode(r)}),delete this.nodesMap[e.key])}getCheckedNodes(e=!1,n=!1){const r=[],a=function(i){(i.root?i.root.childNodes:i.childNodes).forEach(l=>{(l.checked||n&&l.indeterminate)&&(!e||e&&l.isLeaf)&&r.push(l.data),a(l)})};return a(this),r}getCheckedKeys(e=!1){return this.getCheckedNodes(e).map(n=>(n||{})[this.key])}getHalfCheckedNodes(){const e=[],n=function(r){(r.root?r.root.childNodes:r.childNodes).forEach(i=>{i.indeterminate&&e.push(i.data),n(i)})};return n(this),e}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(e=>(e||{})[this.key])}_getAllNodes(){const e=[],n=this.nodesMap;for(const r in n)wr(n,r)&&e.push(n[r]);return e}updateChildren(e,n){const r=this.nodesMap[e];if(!r)return;const a=r.childNodes;for(let i=a.length-1;i>=0;i--){const s=a[i];this.remove(s.data)}for(let i=0,s=n.length;i<s;i++){const l=n[i];this.append(l,r.data)}}_setCheckedKeys(e,n=!1,r){const a=this._getAllNodes().sort((u,c)=>u.level-c.level),i=Object.create(null),s=Object.keys(r);a.forEach(u=>u.setChecked(!1,!1));const l=u=>{u.childNodes.forEach(c=>{var d;i[c.data[e]]=!0,(d=c.childNodes)!=null&&d.length&&l(c)})};for(let u=0,c=a.length;u<c;u++){const d=a[u],f=d.data[e].toString();if(!s.includes(f)){d.checked&&!i[f]&&d.setChecked(!1,!1);continue}if(d.childNodes.length&&l(d),d.isLeaf||this.checkStrictly){d.setChecked(!0,!1);continue}if(d.setChecked(!0,!0),n){d.setChecked(!1,!1);const v=function(p){p.childNodes.forEach(y=>{y.isLeaf||y.setChecked(!1,!1),v(y)})};v(d)}}}setCheckedNodes(e,n=!1){const r=this.key,a={};e.forEach(i=>{a[(i||{})[r]]=!0}),this._setCheckedKeys(r,n,a)}setCheckedKeys(e,n=!1){this.defaultCheckedKeys=e;const r=this.key,a={};e.forEach(i=>{a[i]=!0}),this._setCheckedKeys(r,n,a)}setDefaultExpandedKeys(e){e=e||[],this.defaultExpandedKeys=e,e.forEach(n=>{const r=this.getNode(n);r&&r.expand(null,this.autoExpandParent)})}setChecked(e,n,r){const a=this.getNode(e);a&&a.setChecked(!!n,r)}getCurrentNode(){return this.currentNode}setCurrentNode(e){const n=this.currentNode;n&&(n.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0}setUserCurrentNode(e,n=!0){const r=e[this.key],a=this.nodesMap[r];this.setCurrentNode(a),n&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(e,n=!0){if(e==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const r=this.getNode(e);r&&(this.setCurrentNode(r),n&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const tE=o.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(t){const e=Be("tree"),n=o.inject("NodeInstance"),r=o.inject("RootTree");return()=>{const a=t.node,{data:i,store:s}=a;return t.renderContent?t.renderContent(o.h,{_self:n,node:a,data:i,store:s}):o.renderSlot(r.ctx.slots,"default",{node:a,data:i},()=>[o.h("span",{class:e.be("node","label")},[a.label])])}}});var nE=Te(tE,[["__file","tree-node-content.vue"]]);function Ff(t){const e=o.inject("TreeNodeMap",null),n={treeNodeExpand:r=>{t.node!==r&&t.node.collapse()},children:[]};return e&&e.children.push(n),o.provide("TreeNodeMap",n),{broadcastExpanded:r=>{if(t.accordion)for(const a of n.children)a.treeNodeExpand(r)}}}const Af=Symbol("dragEvents");function rE({props:t,ctx:e,el$:n,dropIndicator$:r,store:a}){const i=Be("tree"),s=o.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),l=({event:d,treeNode:f})=>{if(typeof t.allowDrag=="function"&&!t.allowDrag(f.node))return d.preventDefault(),!1;d.dataTransfer.effectAllowed="move";try{d.dataTransfer.setData("text/plain","")}catch{}s.value.draggingNode=f,e.emit("node-drag-start",f.node,d)},u=({event:d,treeNode:f})=>{const h=f,v=s.value.dropNode;v&&v.node.id!==h.node.id&&Sr(v.$el,i.is("drop-inner"));const p=s.value.draggingNode;if(!p||!h)return;let g=!0,y=!0,m=!0,b=!0;typeof t.allowDrop=="function"&&(g=t.allowDrop(p.node,h.node,"prev"),b=y=t.allowDrop(p.node,h.node,"inner"),m=t.allowDrop(p.node,h.node,"next")),d.dataTransfer.dropEffect=y||g||m?"move":"none",(g||y||m)&&(v==null?void 0:v.node.id)!==h.node.id&&(v&&e.emit("node-drag-leave",p.node,v.node,d),e.emit("node-drag-enter",p.node,h.node,d)),g||y||m?s.value.dropNode=h:s.value.dropNode=null,h.node.nextSibling===p.node&&(m=!1),h.node.previousSibling===p.node&&(g=!1),h.node.contains(p.node,!1)&&(y=!1),(p.node===h.node||p.node.contains(h.node))&&(g=!1,y=!1,m=!1);const w=h.$el.querySelector(`.${i.be("node","content")}`).getBoundingClientRect(),C=n.value.getBoundingClientRect();let E;const x=g?y?.25:m?.45:1:-1,k=m?y?.75:g?.55:0:1;let B=-9999;const S=d.clientY-w.top;S<w.height*x?E="before":S>w.height*k?E="after":y?E="inner":E="none";const N=h.$el.querySelector(`.${i.be("node","expand-icon")}`).getBoundingClientRect(),D=r.value;E==="before"?B=N.top-C.top:E==="after"&&(B=N.bottom-C.top),D.style.top=`${B}px`,D.style.left=`${N.right-C.left}px`,E==="inner"?Zs(h.$el,i.is("drop-inner")):Sr(h.$el,i.is("drop-inner")),s.value.showDropIndicator=E==="before"||E==="after",s.value.allowDrop=s.value.showDropIndicator||b,s.value.dropType=E,e.emit("node-drag-over",p.node,h.node,d)},c=d=>{const{draggingNode:f,dropType:h,dropNode:v}=s.value;if(d.preventDefault(),d.dataTransfer&&(d.dataTransfer.dropEffect="move"),f&&v){const p={data:f.node.data};h!=="none"&&f.node.remove(),h==="before"?v.node.parent.insertBefore(p,v.node):h==="after"?v.node.parent.insertAfter(p,v.node):h==="inner"&&v.node.insertChild(p),h!=="none"&&(a.value.registerNode(p),a.value.key&&f.node.eachNode(g=>{var y;(y=a.value.nodesMap[g.data[a.value.key]])==null||y.setChecked(g.checked,!a.value.checkStrictly)})),Sr(v.$el,i.is("drop-inner")),e.emit("node-drag-end",f.node,v.node,h,d),h!=="none"&&e.emit("node-drop",f.node,v.node,h,d)}f&&!v&&e.emit("node-drag-end",f.node,null,h,d),s.value.showDropIndicator=!1,s.value.draggingNode=null,s.value.dropNode=null,s.value.allowDrop=!0};return o.provide(Af,{treeNodeDragStart:l,treeNodeDragOver:u,treeNodeDragEnd:c}),{dragState:s}}const aE=o.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:Vk,ElCheckbox:Ck,NodeContent:nE,ElIcon:ot,Loading:Js},props:{node:{type:Ir,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(t,e){const n=Be("tree"),{broadcastExpanded:r}=Ff(t),a=o.inject("RootTree"),i=o.ref(!1),s=o.ref(!1),l=o.ref(null),u=o.ref(null),c=o.ref(null),d=o.inject(Af),f=o.getCurrentInstance();o.provide("NodeInstance",f),a||tt("Tree","Can not find node's tree."),t.node.expanded&&(i.value=!0,s.value=!0);const h=a.props.props.children||"children";o.watch(()=>{const S=t.node.data[h];return S&&[...S]},()=>{t.node.updateChildren()}),o.watch(()=>t.node.indeterminate,S=>{g(t.node.checked,S)}),o.watch(()=>t.node.checked,S=>{g(S,t.node.indeterminate)}),o.watch(()=>t.node.childNodes.length,()=>t.node.reInitChecked()),o.watch(()=>t.node.expanded,S=>{o.nextTick(()=>i.value=S),S&&(s.value=!0)});const v=S=>Fl(a.props.nodeKey,S.data),p=S=>{const N=t.props.class;if(!N)return{};let D;if(Lt(N)){const{data:_}=S;D=N(_,S)}else D=N;return St(D)?{[D]:!0}:D},g=(S,N)=>{(l.value!==S||u.value!==N)&&a.ctx.emit("check-change",t.node.data,S,N),l.value=S,u.value=N},y=S=>{Al(a.store,a.ctx.emit,()=>a.store.value.setCurrentNode(t.node)),a.currentNode.value=t.node,a.props.expandOnClickNode&&b(),a.props.checkOnClickNode&&!t.node.disabled&&w(null,{target:{checked:!t.node.checked}}),a.ctx.emit("node-click",t.node.data,t.node,f,S)},m=S=>{a.instance.vnode.props.onNodeContextmenu&&(S.stopPropagation(),S.preventDefault()),a.ctx.emit("node-contextmenu",S,t.node.data,t.node,f)},b=()=>{t.node.isLeaf||(i.value?(a.ctx.emit("node-collapse",t.node.data,t.node,f),t.node.collapse()):t.node.expand(()=>{e.emit("node-expand",t.node.data,t.node,f)}))},w=(S,N)=>{t.node.setChecked(N.target.checked,!a.props.checkStrictly),o.nextTick(()=>{const D=a.store.value;a.ctx.emit("check",t.node.data,{checkedNodes:D.getCheckedNodes(),checkedKeys:D.getCheckedKeys(),halfCheckedNodes:D.getHalfCheckedNodes(),halfCheckedKeys:D.getHalfCheckedKeys()})})};return{ns:n,node$:c,tree:a,expanded:i,childNodeRendered:s,oldChecked:l,oldIndeterminate:u,getNodeKey:v,getNodeClass:p,handleSelectChange:g,handleClick:y,handleContextMenu:m,handleExpandIconClick:b,handleCheckChange:w,handleChildNodeExpand:(S,N,D)=>{r(N),a.ctx.emit("node-expand",S,N,D)},handleDragStart:S=>{a.props.draggable&&d.treeNodeDragStart({event:S,treeNode:t})},handleDragOver:S=>{S.preventDefault(),a.props.draggable&&d.treeNodeDragOver({event:S,treeNode:{$el:c.value,node:t.node}})},handleDrop:S=>{S.preventDefault()},handleDragEnd:S=>{a.props.draggable&&d.treeNodeDragEnd(S)},CaretRight:J1}}});function iE(t,e,n,r,a,i){const s=o.resolveComponent("el-icon"),l=o.resolveComponent("el-checkbox"),u=o.resolveComponent("loading"),c=o.resolveComponent("node-content"),d=o.resolveComponent("el-tree-node"),f=o.resolveComponent("el-collapse-transition");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"node$",class:o.normalizeClass([t.ns.b("node"),t.ns.is("expanded",t.expanded),t.ns.is("current",t.node.isCurrent),t.ns.is("hidden",!t.node.visible),t.ns.is("focusable",!t.node.disabled),t.ns.is("checked",!t.node.disabled&&t.node.checked),t.getNodeClass(t.node)]),role:"treeitem",tabindex:"-1","aria-expanded":t.expanded,"aria-disabled":t.node.disabled,"aria-checked":t.node.checked,draggable:t.tree.props.draggable,"data-key":t.getNodeKey(t.node),onClick:o.withModifiers(t.handleClick,["stop"]),onContextmenu:t.handleContextMenu,onDragstart:o.withModifiers(t.handleDragStart,["stop"]),onDragover:o.withModifiers(t.handleDragOver,["stop"]),onDragend:o.withModifiers(t.handleDragEnd,["stop"]),onDrop:o.withModifiers(t.handleDrop,["stop"])},[o.createElementVNode("div",{class:o.normalizeClass(t.ns.be("node","content")),style:o.normalizeStyle({paddingLeft:(t.node.level-1)*t.tree.props.indent+"px"})},[t.tree.props.icon||t.CaretRight?(o.openBlock(),o.createBlock(s,{key:0,class:o.normalizeClass([t.ns.be("node","expand-icon"),t.ns.is("leaf",t.node.isLeaf),{expanded:!t.node.isLeaf&&t.expanded}]),onClick:o.withModifiers(t.handleExpandIconClick,["stop"])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.tree.props.icon||t.CaretRight)))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0),t.showCheckbox?(o.openBlock(),o.createBlock(l,{key:1,"model-value":t.node.checked,indeterminate:t.node.indeterminate,disabled:!!t.node.disabled,onClick:o.withModifiers(()=>{},["stop"]),onChange:t.handleCheckChange},null,8,["model-value","indeterminate","disabled","onClick","onChange"])):o.createCommentVNode("v-if",!0),t.node.loading?(o.openBlock(),o.createBlock(s,{key:2,class:o.normalizeClass([t.ns.be("node","loading-icon"),t.ns.is("loading")])},{default:o.withCtx(()=>[o.createVNode(u)]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),o.createVNode(c,{node:t.node,"render-content":t.renderContent},null,8,["node","render-content"])],6),o.createVNode(f,null,{default:o.withCtx(()=>[!t.renderAfterExpand||t.childNodeRendered?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(t.ns.be("node","children")),role:"group","aria-expanded":t.expanded},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.node.childNodes,h=>(o.openBlock(),o.createBlock(d,{key:t.getNodeKey(h),"render-content":t.renderContent,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,node:h,accordion:t.accordion,props:t.props,onNodeExpand:t.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,["aria-expanded"])),[[o.vShow,t.expanded]]):o.createCommentVNode("v-if",!0)]),_:1})],42,["aria-expanded","aria-disabled","aria-checked","draggable","data-key","onClick","onContextmenu","onDragstart","onDragover","onDragend","onDrop"])),[[o.vShow,t.node.visible]])}var oE=Te(aE,[["render",iE],["__file","tree-node.vue"]]);function sE({el$:t},e){const n=Be("tree"),r=o.shallowRef([]),a=o.shallowRef([]);o.onMounted(()=>{s()}),o.onUpdated(()=>{r.value=Array.from(t.value.querySelectorAll("[role=treeitem]")),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"))}),o.watch(a,l=>{l.forEach(u=>{u.setAttribute("tabindex","-1")})}),Yt(t,"keydown",l=>{const u=l.target;if(!u.className.includes(n.b("node")))return;const c=l.code;r.value=Array.from(t.value.querySelectorAll(`.${n.is("focusable")}[role=treeitem]`));const d=r.value.indexOf(u);let f;if([it.up,it.down].includes(c)){if(l.preventDefault(),c===it.up){f=d===-1?0:d!==0?d-1:r.value.length-1;const v=f;for(;!e.value.getNode(r.value[f].dataset.key).canFocus;){if(f--,f===v){f=-1;break}f<0&&(f=r.value.length-1)}}else{f=d===-1?0:d<r.value.length-1?d+1:0;const v=f;for(;!e.value.getNode(r.value[f].dataset.key).canFocus;){if(f++,f===v){f=-1;break}f>=r.value.length&&(f=0)}}f!==-1&&r.value[f].focus()}[it.left,it.right].includes(c)&&(l.preventDefault(),u.click());const h=u.querySelector('[type="checkbox"]');[it.enter,it.space].includes(c)&&h&&(l.preventDefault(),h.click())});const s=()=>{var l;r.value=Array.from(t.value.querySelectorAll(`.${n.is("focusable")}[role=treeitem]`)),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"));const u=t.value.querySelectorAll(`.${n.is("checked")}[role=treeitem]`);if(u.length){u[0].setAttribute("tabindex","0");return}(l=r.value[0])==null||l.setAttribute("tabindex","0")}}const lE=o.defineComponent({name:"ElTree",components:{ElTreeNode:oE},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:Xn}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(t,e){const{t:n}=Xa(),r=Be("tree"),a=o.inject(vi,null),i=o.ref(new eE({key:t.nodeKey,data:t.data,lazy:t.lazy,props:t.props,load:t.load,currentNodeKey:t.currentNodeKey,checkStrictly:t.checkStrictly,checkDescendants:t.checkDescendants,defaultCheckedKeys:t.defaultCheckedKeys,defaultExpandedKeys:t.defaultExpandedKeys,autoExpandParent:t.autoExpandParent,defaultExpandAll:t.defaultExpandAll,filterNodeMethod:t.filterNodeMethod}));i.value.initialize();const s=o.ref(i.value.root),l=o.ref(null),u=o.ref(null),c=o.ref(null),{broadcastExpanded:d}=Ff(t),{dragState:f}=rE({props:t,ctx:e,el$:u,dropIndicator$:c,store:i});sE({el$:u},i);const h=o.computed(()=>{const{childNodes:L}=s.value,V=a?a.hasFilteredOptions!==0:!1;return(!L||L.length===0||L.every(({visible:H})=>!H))&&!V});o.watch(()=>t.currentNodeKey,L=>{i.value.setCurrentNodeKey(L)}),o.watch(()=>t.defaultCheckedKeys,L=>{i.value.setDefaultCheckedKey(L)}),o.watch(()=>t.defaultExpandedKeys,L=>{i.value.setDefaultExpandedKeys(L)}),o.watch(()=>t.data,L=>{i.value.setData(L)},{deep:!0}),o.watch(()=>t.checkStrictly,L=>{i.value.checkStrictly=L});const v=L=>{if(!t.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");i.value.filter(L)},p=L=>Fl(t.nodeKey,L.data),g=L=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const V=i.value.getNode(L);if(!V)return[];const H=[V.data];let $=V.parent;for(;$&&$!==s.value;)H.push($.data),$=$.parent;return H.reverse()},y=(L,V)=>i.value.getCheckedNodes(L,V),m=L=>i.value.getCheckedKeys(L),b=()=>{const L=i.value.getCurrentNode();return L?L.data:null},w=()=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const L=b();return L?L[t.nodeKey]:null},C=(L,V)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");i.value.setCheckedNodes(L,V)},E=(L,V)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");i.value.setCheckedKeys(L,V)},x=(L,V,H)=>{i.value.setChecked(L,V,H)},k=()=>i.value.getHalfCheckedNodes(),B=()=>i.value.getHalfCheckedKeys(),S=(L,V=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");Al(i,e.emit,()=>{d(L),i.value.setUserCurrentNode(L,V)})},N=(L,V=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");Al(i,e.emit,()=>{d(),i.value.setCurrentNodeKey(L,V)})},D=L=>i.value.getNode(L),_=L=>{i.value.remove(L)},O=(L,V)=>{i.value.append(L,V)},P=(L,V)=>{i.value.insertBefore(L,V)},F=(L,V)=>{i.value.insertAfter(L,V)},I=(L,V,H)=>{d(V),e.emit("node-expand",L,V,H)},M=(L,V)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");i.value.updateChildren(L,V)};return o.provide("RootTree",{ctx:e,props:t,store:i,root:s,currentNode:l,instance:o.getCurrentInstance()}),o.provide(ii,void 0),{ns:r,store:i,root:s,currentNode:l,dragState:f,el$:u,dropIndicator$:c,isEmpty:h,filter:v,getNodeKey:p,getNodePath:g,getCheckedNodes:y,getCheckedKeys:m,getCurrentNode:b,getCurrentKey:w,setCheckedNodes:C,setCheckedKeys:E,setChecked:x,getHalfCheckedNodes:k,getHalfCheckedKeys:B,setCurrentNode:S,setCurrentKey:N,t:n,getNode:D,remove:_,append:O,insertBefore:P,insertAfter:F,handleNodeExpand:I,updateKeyChildren:M}}});function cE(t,e,n,r,a,i){const s=o.resolveComponent("el-tree-node");return o.openBlock(),o.createElementBlock("div",{ref:"el$",class:o.normalizeClass([t.ns.b(),t.ns.is("dragging",!!t.dragState.draggingNode),t.ns.is("drop-not-allow",!t.dragState.allowDrop),t.ns.is("drop-inner",t.dragState.dropType==="inner"),{[t.ns.m("highlight-current")]:t.highlightCurrent}]),role:"tree"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.root.childNodes,l=>(o.openBlock(),o.createBlock(s,{key:t.getNodeKey(l),node:l,props:t.props,accordion:t.accordion,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,"render-content":t.renderContent,onNodeExpand:t.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),t.isEmpty?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(t.ns.e("empty-block"))},[o.renderSlot(t.$slots,"empty",{},()=>{var l;return[o.createElementVNode("span",{class:o.normalizeClass(t.ns.e("empty-text"))},o.toDisplayString((l=t.emptyText)!=null?l:t.t("el.tree.emptyText")),3)]})],2)):o.createCommentVNode("v-if",!0),o.withDirectives(o.createElementVNode("div",{ref:"dropIndicator$",class:o.normalizeClass(t.ns.e("drop-indicator"))},null,2),[[o.vShow,t.dragState.showDropIndicator]])],2)}var uE=Te(lE,[["render",cE],["__file","tree.vue"]]);const dE=ft(uE);function fE(t){let e;const n=o.ref(!1),r=o.reactive({...t,originalPosition:"",originalOverflow:"",visible:!1});function a(h){r.text=h}function i(){const h=r.parent,v=f.ns;if(!h.vLoadingAddClassList){let p=h.getAttribute("loading-number");p=Number.parseInt(p)-1,p?h.setAttribute("loading-number",p.toString()):(Sr(h,v.bm("parent","relative")),h.removeAttribute("loading-number")),Sr(h,v.bm("parent","hidden"))}s(),d.unmount()}function s(){var h,v;(v=(h=f.$el)==null?void 0:h.parentNode)==null||v.removeChild(f.$el)}function l(){var h;t.beforeClose&&!t.beforeClose()||(n.value=!0,clearTimeout(e),e=setTimeout(u,400),r.visible=!1,(h=t.closed)==null||h.call(t))}function u(){if(!n.value)return;const h=r.parent;n.value=!1,h.vLoadingAddClassList=void 0,i()}const c=o.defineComponent({name:"ElLoading",setup(h,{expose:v}){const{ns:p,zIndex:g}=o2("loading");return v({ns:p,zIndex:g}),()=>{const y=r.spinner||r.svg,m=o.h("svg",{class:"circular",viewBox:r.svgViewBox?r.svgViewBox:"0 0 50 50",...y?{innerHTML:y}:{}},[o.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),b=r.text?o.h("p",{class:p.b("text")},[r.text]):void 0;return o.h(o.Transition,{name:p.b("fade"),onAfterLeave:u},{default:o.withCtx(()=>[o.withDirectives(o.createVNode("div",{style:{backgroundColor:r.background||""},class:[p.b("mask"),r.customClass,r.fullscreen?"is-fullscreen":""]},[o.h("div",{class:p.b("spinner")},[m,b])]),[[o.vShow,r.visible]])])})}}}),d=o.createApp(c),f=d.mount(document.createElement("div"));return{...o.toRefs(r),setText:a,removeElLoadingChild:s,close:l,handleAfterLeave:u,vm:f,get $el(){return f.$el}}}let Io;const hE=function(t={}){if(!et)return;const e=pE(t);if(e.fullscreen&&Io)return Io;const n=fE({...e,closed:()=>{var a;(a=e.closed)==null||a.call(e),e.fullscreen&&(Io=void 0)}});vE(e,e.parent,n),Vf(e,e.parent,n),e.parent.vLoadingAddClassList=()=>Vf(e,e.parent,n);let r=e.parent.getAttribute("loading-number");return r?r=`${Number.parseInt(r)+1}`:r="1",e.parent.setAttribute("loading-number",r),e.parent.appendChild(n.$el),o.nextTick(()=>n.visible.value=e.visible),e.fullscreen&&(Io=n),n},pE=t=>{var e,n,r,a;let i;return St(t.target)?i=(e=document.querySelector(t.target))!=null?e:document.body:i=t.target||document.body,{parent:i===document.body||t.body?document.body:i,background:t.background||"",svg:t.svg||"",svgViewBox:t.svgViewBox||"",spinner:t.spinner||!1,text:t.text||"",fullscreen:i===document.body&&((n=t.fullscreen)!=null?n:!0),lock:(r=t.lock)!=null?r:!1,customClass:t.customClass||"",visible:(a=t.visible)!=null?a:!0,beforeClose:t.beforeClose,closed:t.closed,target:i}},vE=async(t,e,n)=>{const{nextZIndex:r}=n.vm.zIndex||n.vm._.exposed.zIndex,a={};if(t.fullscreen)n.originalPosition.value=Ya(document.body,"position"),n.originalOverflow.value=Ya(document.body,"overflow"),a.zIndex=r();else if(t.parent===document.body){n.originalPosition.value=Ya(document.body,"position"),await o.nextTick();for(const i of["top","left"]){const s=i==="top"?"scrollTop":"scrollLeft";a[i]=`${t.target.getBoundingClientRect()[i]+document.body[s]+document.documentElement[s]-Number.parseInt(Ya(document.body,`margin-${i}`),10)}px`}for(const i of["height","width"])a[i]=`${t.target.getBoundingClientRect()[i]}px`}else n.originalPosition.value=Ya(e,"position");for(const[i,s]of Object.entries(a))n.$el.style[i]=s},Vf=(t,e,n)=>{const r=n.vm.ns||n.vm._.exposed.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?Sr(e,r.bm("parent","relative")):Zs(e,r.bm("parent","relative")),t.fullscreen&&t.lock?Zs(e,r.bm("parent","hidden")):Sr(e,r.bm("parent","hidden"))},Oo=Symbol("ElLoading"),Rf=(t,e)=>{var n,r,a,i;const s=e.instance,l=h=>gt(e.value)?e.value[h]:void 0,u=h=>{const v=St(h)&&(s==null?void 0:s[h])||h;return v&&o.ref(v)},c=h=>u(l(h)||t.getAttribute(`element-loading-${Qg(h)}`)),d=(n=l("fullscreen"))!=null?n:e.modifiers.fullscreen,f={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:d,target:(r=l("target"))!=null?r:d?void 0:t,body:(a=l("body"))!=null?a:e.modifiers.body,lock:(i=l("lock"))!=null?i:e.modifiers.lock};t[Oo]={options:f,instance:hE(f)}},gE=(t,e)=>{for(const n of Object.keys(e))o.isRef(e[n])&&(e[n].value=t[n])},Rl={mounted(t,e){e.value&&Rf(t,e)},updated(t,e){const n=t[Oo];e.oldValue!==e.value&&(e.value&&!e.oldValue?Rf(t,e):e.value&&e.oldValue?gt(e.value)&&gE(e.value,n.options):n==null||n.instance.close())},unmounted(t){var e;(e=t[Oo])==null||e.instance.close(),t[Oo]=null}},Jt=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},mE="Copy to clipboard",yE="Copied!",bE="#8300bf",wE={name:"CopyToClipboard",props:{content:{type:String,default:""},label:{type:String,default:mE},theme:{type:String,default:""}},data:function(){return{textLabel:this.label,autoHideTimeout:0,iconColor:bE,tooltipContainer:null}},mounted(){const t=document.querySelector(".mapcontent");t?this.tooltipContainer=t:this.tooltipContainer=document.body},methods:{copyToClipboard:async function(){let t=!0;this.autoHideTimeout=600;try{const e=this.content.replaceAll(`
|
|
21
|
+
`,""),n=document.createElement("div");n.innerHTML=this.content;const r=n.textContent||n.innerText||"",a=new Blob([e],{type:"text/html"}),i=new Blob([r],{type:"text/plain"}),s=new ClipboardItem({"text/html":a,"text/plain":i});await navigator.clipboard.write([s])}catch(e){console.error("Error when trying to use navigator.clipboard.write()",e),t=!1}t?this.textLabel=yE:this.textLabel="Error trying to copy to clipboard!"},resetSettings:function(){this.autoHideTimeout=0,this.textLabel=this.label}}},CE={class:"visually-hidden"};function kE(t,e,n,r,a,i){const s=ib,l=ot,u=Ut,c=ui;return o.openBlock(),o.createBlock(c,{content:t.textLabel,placement:"bottom","hide-after":t.autoHideTimeout,effect:"clipboard-tooltip",onHide:i.resetSettings,teleported:!0,"append-to":t.tooltipContainer},{default:o.withCtx(()=>[o.createVNode(u,{class:o.normalizeClass(["copy-clipboard-button",n.theme]),size:"small",onClick:i.copyToClipboard},{default:o.withCtx(()=>[o.createVNode(l,{color:t.iconColor},{default:o.withCtx(()=>[o.createVNode(s)]),_:1},8,["color"]),o.createElementVNode("span",CE,o.toDisplayString(t.textLabel),1)]),_:1},8,["class","onClick"])]),_:1},8,["content","hide-after","onHide","append-to"])}const $l=Jt(wE,[["render",kE],["__scopeId","data-v-08b3bab3"]]),xE={name:"AnnotationPopup",props:{annotationEntry:{type:Array}},inject:["$annotator","userApiKey"],data:function(){return{displayPair:{"Feature ID":"featureId",Label:"label",Ontology:"models",Name:"name",Resource:"resourceId"},editing:!1,evidencePrefixes:[{value:"DOI:",label:"DOI:"},{value:"PMID:",label:"PMID:"},{value:"",label:"Other:"}],evidencePrefix:"DOI:",evidence:[],authenticated:!1,newEvidence:"",comment:"",prevSubs:[],showSubmissions:!0,errorMessage:"",creator:void 0,copyContent:"",entryIndex:0}},computed:{entry:function(){return this.annotationEntry[this.entryIndex]},previousLabel:function(){var t;return this.entryIndex===0?"This is the first item. Click 'Next' to see more information.":(t=this.annotationEntry[this.entryIndex-1])==null?void 0:t.label},nextLabel:function(){var t;return this.entryIndex===this.annotationEntry.length-1?"This is the last item. Click 'Previous' to see more information.":(t=this.annotationEntry[this.entryIndex+1])==null?void 0:t.label},isEditable:function(){return this.entry.resourceId&&this.entry.featureId},isPositionUpdated:function(){return this.entry.resourceId&&this.entry.type==="updated"&&this.entry.positionUpdated},isDeleted:function(){return this.entry.resourceId&&this.entry.type==="deleted"},ontologyLink:function(){const t=this.entry.models;if(t&&t.startsWith("UBERON"))return`http://purl.obolibrary.org/obo/${this.entry.models.replace(":","_")}`},updatedCopyContent:function(){return this.getUpdateCopyContent()}},methods:{previous:function(){this.entryIndex!==0&&(this.entryIndex=this.entryIndex-1)},next:function(){this.entryIndex!==this.annotationEntry.length-1&&(this.entryIndex=this.entryIndex+1)},processEvidences:function(t){var n;const e=[];return(n=t==null?void 0:t.body)!=null&&n.evidence&&t.body.evidence.forEach(r=>{if(typeof r=="object")e.push(r);else{const a={};if(r.includes("https://doi.org/")){const i=r.replace("https://doi.org/","DOI:");a[i]=r}else if(r.includes("https://pubmed.ncbi.nlm.nih.gov/")){const i=r.replace("https://pubmed.ncbi.nlm.nih.gov/","PMID:");a[i]=r}Object.keys(a).length>0?e.push(a):e.push(r)}}),e},evidenceEntered:function(t){t&&(this.evidence.push(this.evidencePrefix+t),this.newEvidence="")},formatTime:function(t){const e={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"};return new Date(t).toLocaleDateString(void 0,e)},updatePrevSubmissions:function(){var t;this.$annotator&&this.authenticated&&this.entry.resourceId&&this.entry.featureId&&((t=this.$annotator)==null||t.itemAnnotations(this.userApiKey,this.entry.resourceId,this.entry.featureId).then(e=>{this.prevSubs=e}).catch(e=>{console.log(e)}))},submit:function(){var t;if(this.entry.type==="updated"&&this.entry.positionUpdated?this.comment=this.comment?`Position Updated: ${this.comment}`:"Position Updated":this.entry.type==="deleted"&&(this.comment=this.comment?`Feature Deleted: ${this.comment}`:"Feature Deleted"),(this.evidence.length>0||this.comment)&&this.entry.resourceId&&this.entry.featureId){const e=[];this.evidence.forEach(r=>{if(r.includes("DOI:")){const a=r.replace("DOI:","https://doi.org/");e.push(new URL(a))}else if(r.includes("PMID:")){const a=r.replace("PMID:","https://pubmed.ncbi.nlm.nih.gov/");e.push(new URL(a))}else e.push(r)});const n={resource:this.entry.resourceId,item:Object.assign({id:this.entry.featureId},Object.fromEntries(Object.entries(this.entry).filter(([r])=>["label","models"].includes(r)))),body:{evidence:e,comment:this.comment},feature:this.entry.feature};Object.assign(n.body,this.entry.body),this.entry.type==="deleted"&&(n.feature=void 0),this.creator&&(n.creator=this.creator),(t=this.$annotator)==null||t.addAnnotation(this.userApiKey,n).then(()=>{this.$emit("annotation",n),this.errorMessage="",this.resetSubmission(),this.updatePrevSubmissions()}).catch(()=>{this.errorMessage="There is a problem with the submission, please try again later"})}},removeEvidence:function(t){this.evidence.splice(t,1)},resetSubmission:function(){this.editing=!1,this.evidence=[],this.newFeature="",this.comment=""},getUpdateCopyContent:function(){if(!this.entry)return"";const t=[];if(this.entry.featureId&&t.push(`<div><strong>Feature ID:</strong>${this.entry.featureId}</div>`),this.entry.label&&t.push(`<div><strong>Label:</strong>${this.entry.label}</div>`),this.entry.models&&(t.push(`<div><strong>Ontology:</strong>${this.entry.models}</div>`),this.ontologyLink&&t.push(`<div><strong>Ontology Link:</strong>${this.ontologyLink}</div>`)),this.entry.resourceId&&t.push(`<div><strong>Resource:</strong>${this.entry.resourceId}</div>`),this.prevSubs.length){let e=`<div><strong>Annotations:</strong></div>
|
|
22
22
|
<br>`;this.prevSubs.map((n,r)=>{if(e+=`<div><strong>Created:</strong>${this.formatTime(n.created)}</div>
|
|
23
23
|
<br>`,e+=`<div><strong>Creator:</strong>${n.creator.name}</div>
|
|
24
24
|
<br>`,e+=`<div><strong>Email:</strong>${n.creator.email}</div>
|
|
@@ -26,33 +26,33 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:r,curr
|
|
|
26
26
|
<br>`}e+=`<div><strong>Comment:</strong>${n.body.comment}</div>
|
|
27
27
|
<br>`}),t.push(`<div>${e}</div>`)}return t.join(`
|
|
28
28
|
|
|
29
|
-
<br>`)}},watch:{annotationEntry:{handler:function(t,e){t!==e&&(this.resetSubmission(),this.updatePrevSubmissions())},immediate:!1,deep:!1}},mounted:function(){var t;(t=this.$annotator)==null||t.authenticate(this.userApiKey).then(e=>{e.name&&e.email&&e.canUpdate?(this.creator=e,e.orcid||(this.creator.orcid="0000-0000-0000-0000"),this.authenticated=!0,this.updatePrevSubmissions()):this.errorMessage=""})}},Ir=t=>(o.pushScopeId("data-v-56354500"),t=t(),o.popScopeId(),t),EE={class:"block"},SE=Ir(()=>o.createElementVNode("div",{class:"title"},"Feature Annotations",-1)),TE={class:"title-buttons"},BE={key:0},NE=["href"],DE=Ir(()=>o.createElementVNode("strong",{class:"sub-title"},"Previous submissions:",-1)),_E=Ir(()=>o.createElementVNode("strong",null,"Evidence: ",-1)),PE=["href"],OE={key:1},IE={key:2},LE=Ir(()=>o.createElementVNode("strong",null,"Comment: ",-1)),ME=Ir(()=>o.createElementVNode("strong",{class:"sub-title"},"Suggest changes:",-1)),FE=Ir(()=>o.createElementVNode("strong",null,"Evidence:",-1)),AE=Ir(()=>o.createElementVNode("strong",null,"Comment:",-1)),VE={class:"sub-title"};function RE(t,e,n,r,a,i){const s=$l,l=Do,u=Xs,c=ot,d=Ya,f=cb,h=sb,v=db,p=ui,g=uo,y=qx,m=Kx,b=si,w=Qt,C=Il;return o.openBlock(),o.createBlock(C,{class:"main"},{default:o.withCtx(()=>[o.createElementVNode("div",EE,[o.createVNode(l,{class:"info-field"},{default:o.withCtx(()=>[SE,o.createElementVNode("div",TE,[o.createVNode(s,{content:i.updatedCopyContent},null,8,["content"])])]),_:1}),n.annotationEntry?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.displayPair,(k,E)=>o.withDirectives((o.openBlock(),o.createBlock(l,{class:"dialog-text",key:k},{default:o.withCtx(()=>[o.createElementVNode("strong",null,o.toDisplayString(E)+": ",1),o.createTextVNode(" "),E!=="Ontology"?(o.openBlock(),o.createElementBlock("span",BE,o.toDisplayString(n.annotationEntry[k]),1)):(o.openBlock(),o.createElementBlock("a",{key:1,href:i.ontologyLink,target:"_blank"},o.toDisplayString(n.annotationEntry[k]),9,NE))]),_:2},1024)),[[o.vShow,n.annotationEntry[k]]])),128)),t.prevSubs.length>0?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.withDirectives(o.createElementVNode("div",{class:"hide",onClick:e[0]||(e[0]=k=>t.showSubmissions=!1)},[o.createTextVNode(" Hide previous submissions "),o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(u)]),_:1})],512),[[o.vShow,t.showSubmissions]]),o.withDirectives(o.createElementVNode("div",{class:"hide",onClick:e[1]||(e[1]=k=>t.showSubmissions=!0)},[o.createTextVNode(" Show previous "+o.toDisplayString(t.prevSubs.length)+" submission(s) ",1),o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(d)]),_:1})],512),[[o.vShow,!t.showSubmissions]]),t.showSubmissions?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(l,{class:"dialog-spacer"}),o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[DE]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.prevSubs,(k,E)=>(o.openBlock(),o.createElementBlock("div",{class:"entry",key:E},[o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[o.createElementVNode("strong",null,o.toDisplayString(i.formatTime(k.created)),1),o.createTextVNode(" "+o.toDisplayString(k.creator.name),1)]),_:2},1024),o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[_E,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.processEvidences(k),(x,B)=>(o.openBlock(),o.createBlock(l,{key:x,class:"dialog-text"},{default:o.withCtx(()=>[typeof x=="object"?(o.openBlock(),o.createElementBlock("a",{key:0,href:Object.values(x)[0],target:"_blank"},o.toDisplayString(Object.keys(x)[0]),9,PE)):(o.openBlock(),o.createElementBlock("span",OE,o.toDisplayString(x),1)),B!==k.body.evidence.length-1?(o.openBlock(),o.createElementBlock("span",IE,", ")):o.createCommentVNode("",!0)]),_:2},1024))),128))]),_:2},1024),o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[LE,o.createTextVNode(" "+o.toDisplayString(k.body.comment),1)]),_:2},1024)]))),128))],64)):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0),t.authenticated?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.isEditable?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(l,{class:"dialog-spacer"}),t.editing?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[ME]),_:1}),i.isDeleted?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[FE]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.evidence,(k,E)=>(o.openBlock(),o.createBlock(l,{key:k},{default:o.withCtx(()=>[o.createVNode(p,{span:20},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.evidence[E]),1)]),_:2},1024),o.createVNode(p,{span:4},{default:o.withCtx(()=>[o.createVNode(c,{class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(g,{onClick:x=>i.removeEvidence(E)},null,8,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(b,{size:"small",placeholder:"Enter",modelValue:t.newEvidence,"onUpdate:modelValue":e[4]||(e[4]=k=>t.newEvidence=k),onChange:e[5]||(e[5]=k=>i.evidenceEntered(k))},{prepend:o.withCtx(()=>[o.createVNode(m,{teleported:!1,modelValue:t.evidencePrefix,"onUpdate:modelValue":e[3]||(e[3]=k=>t.evidencePrefix=k),placeholder:"Other:",class:"select-box","popper-class":"flatmap_dropdown"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.evidencePrefixes,k=>(o.openBlock(),o.createBlock(y,{key:k.label,value:k.value},{default:o.withCtx(()=>[o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(p,{span:12},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k.label),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1})],64)),o.createVNode(l,null,{default:o.withCtx(()=>[AE]),_:1}),o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[o.createVNode(b,{type:"textarea",autosize:{minRows:2,maxRows:4},placeholder:"Enter",modelValue:t.comment,"onUpdate:modelValue":e[6]||(e[6]=k=>t.comment=k)},null,8,["modelValue"])]),_:1}),o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[o.createVNode(w,{class:"button",type:"primary",plain:"",onClick:i.submit},{default:o.withCtx(()=>[o.createTextVNode(" Submit ")]),_:1},8,["onClick"])]),_:1})],64)):(o.openBlock(),o.createBlock(l,{key:0},{default:o.withCtx(()=>[o.createVNode(c,{class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(f,{onClick:e[2]||(e[2]=k=>t.editing=!0)})]),_:1}),i.isDeleted?(o.openBlock(),o.createBlock(c,{key:0,class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(h,{onClick:i.submit},null,8,["onClick"])]),_:1})):i.isPositionUpdated?(o.openBlock(),o.createBlock(c,{key:1,class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(v,{onClick:i.submit},null,8,["onClick"])]),_:1})):o.createCommentVNode("",!0)]),_:1})),t.errorMessage?(o.openBlock(),o.createBlock(l,{key:2,class:"dialog-text"},{default:o.withCtx(()=>[o.createElementVNode("strong",VE,o.toDisplayString(t.errorMessage),1)]),_:1})):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)])]),_:1})}const $f=Jt(xE,[["render",RE],["__scopeId","data-v-56354500"]]),$E={name:"CreateTooltipContent",components:{Button:Qt,Col:ui,Container:Ol,Header:_f,Input:si,Main:Il},props:{createData:{type:Object}},watch:{"createData.shape":{handler:function(t,e){this.group=t,e!==void 0&&this.$emit("cancel-create")},immediate:!0}},computed:{confirmText:function(){return this.createData.editingIndex>-1?"Edit":"Confirm"}},data:function(){return{group:"default",region:"",showPoint:!1}},methods:{confirm:function(){this.$emit("confirm-create",{region:"__annotation/"+this.region,group:this.group,shape:this.createData.shape,editingIndex:this.createData.editingIndex}),this.group=this.createData.shape},cancel:function(){this.$emit("cancel-create")}}},zE=(t=>(o.pushScopeId("data-v-d61c5879"),t=t(),o.popScopeId(),t))(()=>o.createElementVNode("span",{class:"create-text"}," Primitives will be created in the __annotation region ",-1));function HE(t,e,n,r,a,i){const s=_f,l=ui,u=Do,c=si,d=Qt,f=Il,h=Ol;return o.openBlock(),o.createBlock(h,{class:"create-container"},{default:o.withCtx(()=>[o.createVNode(s,{height:"30px",class:"header"},{default:o.withCtx(()=>[o.createElementVNode("div",null,"Create "+o.toDisplayString(n.createData.shape),1)]),_:1}),o.createVNode(f,{class:"slides-block"},{default:o.withCtx(()=>[zE,o.withDirectives(o.createVNode(u,{class:"row"},{default:o.withCtx(()=>[o.createVNode(l,{offset:0,span:8},{default:o.withCtx(()=>[o.createTextVNode(" Position: ")]),_:1}),o.createVNode(l,{offset:0,span:16},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.createData.points,({value:v,i:p})=>(o.openBlock(),o.createBlock(u,{key:p,class:"value"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(p),1)]),_:2},1024))),128))]),_:1})]),_:1},512),[[o.vShow,t.showPoint]]),o.createVNode(u,{class:"row"},{default:o.withCtx(()=>[o.createVNode(l,{offset:0,span:8},{default:o.withCtx(()=>[o.createTextVNode(" Region: ")]),_:1}),o.createVNode(l,{offset:0,span:16},{default:o.withCtx(()=>[o.createVNode(c,{modelValue:t.region,"onUpdate:modelValue":e[0]||(e[0]=v=>t.region=v),placeholder:"__annotation",size:"small"},null,8,["modelValue"])]),_:1})]),_:1}),o.createVNode(u,{class:"row"},{default:o.withCtx(()=>[o.createVNode(l,{offset:0,span:8},{default:o.withCtx(()=>[o.createTextVNode(" Group: ")]),_:1}),o.createVNode(l,{offset:0,span:16},{default:o.withCtx(()=>[o.createVNode(c,{modelValue:t.group,"onUpdate:modelValue":e[1]||(e[1]=v=>t.group=v),placeholder:n.createData.shape,size:"small"},null,8,["modelValue","placeholder"])]),_:1})]),_:1}),o.createVNode(u,null,{default:o.withCtx(()=>[o.createVNode(l,{offset:0,span:12},{default:o.withCtx(()=>[o.createVNode(d,{type:"primary",plain:"",onClick:i.confirm},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.confirmText),1)]),_:1},8,["onClick"])]),_:1}),o.createVNode(l,{offset:0,span:12},{default:o.withCtx(()=>[o.createVNode(d,{type:"primary",plain:"",onClick:i.cancel},{default:o.withCtx(()=>[o.createTextVNode(" Cancel ")]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1})]),_:1})}const KE=Jt($E,[["render",HE],["__scopeId","data-v-d61c5879"]]);function st(t){"@babel/helpers - typeof";return st=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},st(t)}function zl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Hl(t,e,n){return e&&qE(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function zf(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dn(t,e){return UE(t)||GE(t,e)||Hf(t,e)||WE()}function UE(t){if(Array.isArray(t))return t}function GE(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],a=!0,i=!1,s,l;try{for(n=n.call(t);!(a=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));a=!0);}catch(u){i=!0,l=u}finally{try{!a&&n.return!=null&&n.return()}finally{if(i)throw l}}return r}}function Hf(t,e){if(t){if(typeof t=="string")return Kf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kf(t,e)}}function Kf(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function WE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
29
|
+
<br>`)}},watch:{entry:{deep:!0,immediate:!0,handler:function(t,e){t!==e&&(this.resetSubmission(),this.updatePrevSubmissions())}}},mounted:function(){var t;(t=this.$annotator)==null||t.authenticate(this.userApiKey).then(e=>{e.name&&e.email&&e.canUpdate?(this.creator=e,e.orcid||(this.creator.orcid="0000-0000-0000-0000"),this.authenticated=!0,this.updatePrevSubmissions()):this.errorMessage=""})}},Or=t=>(o.pushScopeId("data-v-b0c0a0f5"),t=t(),o.popScopeId(),t),EE={key:0,class:"toggle-button"},SE={class:"block"},TE=Or(()=>o.createElementVNode("div",{class:"title"},"Feature Annotations",-1)),BE={class:"title-buttons"},NE={key:0},DE=["href"],_E=Or(()=>o.createElementVNode("strong",{class:"sub-title"},"Previous submissions:",-1)),PE=Or(()=>o.createElementVNode("strong",null,"Evidence: ",-1)),IE=["href"],OE={key:1},LE={key:2},ME=Or(()=>o.createElementVNode("strong",null,"Comment: ",-1)),FE=Or(()=>o.createElementVNode("strong",{class:"sub-title"},"Suggest changes:",-1)),AE=Or(()=>o.createElementVNode("strong",null,"Evidence:",-1)),VE=Or(()=>o.createElementVNode("strong",null,"Comment:",-1)),RE={class:"sub-title"};function $E(t,e,n,r,a,i){const s=Ut,l=ha,u=$l,c=Do,d=Xs,f=ot,h=Za,v=cb,p=sb,g=db,y=di,m=uo,b=qx,w=Kx,C=li,E=Ol;return o.openBlock(),o.createBlock(E,{class:"main"},{default:o.withCtx(()=>[n.annotationEntry.length>1?(o.openBlock(),o.createElementBlock("div",EE,[o.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:o.withCtx(()=>[o.createVNode(s,{class:"button",onClick:i.previous,disabled:this.entryIndex===0},{default:o.withCtx(()=>[o.createTextVNode(" Previous ")]),_:1},8,["onClick","disabled"])]),default:o.withCtx(()=>[o.createElementVNode("span",null,o.toDisplayString(i.previousLabel),1)]),_:1}),o.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:o.withCtx(()=>[o.createVNode(s,{class:"button",onClick:i.next,disabled:this.entryIndex===this.annotationEntry.length-1},{default:o.withCtx(()=>[o.createTextVNode(" Next ")]),_:1},8,["onClick","disabled"])]),default:o.withCtx(()=>[o.createElementVNode("span",null,o.toDisplayString(i.nextLabel),1)]),_:1})])):o.createCommentVNode("",!0),o.createElementVNode("div",SE,[o.createVNode(c,{class:"info-field"},{default:o.withCtx(()=>[TE,o.createElementVNode("div",BE,[o.createVNode(u,{content:i.updatedCopyContent},null,8,["content"])])]),_:1}),i.entry?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.displayPair,(x,k)=>o.withDirectives((o.openBlock(),o.createBlock(c,{class:"dialog-text",key:x},{default:o.withCtx(()=>[o.createElementVNode("strong",null,o.toDisplayString(k)+": ",1),o.createTextVNode(" "),k!=="Ontology"?(o.openBlock(),o.createElementBlock("span",NE,o.toDisplayString(i.entry[x]),1)):(o.openBlock(),o.createElementBlock("a",{key:1,href:i.ontologyLink,target:"_blank"},o.toDisplayString(i.entry[x]),9,DE))]),_:2},1024)),[[o.vShow,i.entry[x]]])),128)),t.prevSubs.length>0?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.withDirectives(o.createElementVNode("div",{class:"hide",onClick:e[0]||(e[0]=x=>t.showSubmissions=!1)},[o.createTextVNode(" Hide previous submissions "),o.createVNode(f,null,{default:o.withCtx(()=>[o.createVNode(d)]),_:1})],512),[[o.vShow,t.showSubmissions]]),o.withDirectives(o.createElementVNode("div",{class:"hide",onClick:e[1]||(e[1]=x=>t.showSubmissions=!0)},[o.createTextVNode(" Show previous "+o.toDisplayString(t.prevSubs.length)+" submission(s) ",1),o.createVNode(f,null,{default:o.withCtx(()=>[o.createVNode(h)]),_:1})],512),[[o.vShow,!t.showSubmissions]]),t.showSubmissions?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(c,{class:"dialog-spacer"}),o.createVNode(c,{class:"dialog-text"},{default:o.withCtx(()=>[_E]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.prevSubs,(x,k)=>(o.openBlock(),o.createElementBlock("div",{class:"entry",key:k},[o.createVNode(c,{class:"dialog-text"},{default:o.withCtx(()=>[o.createElementVNode("strong",null,o.toDisplayString(i.formatTime(x.created)),1),o.createTextVNode(" "+o.toDisplayString(x.creator.name),1)]),_:2},1024),o.createVNode(c,{class:"dialog-text"},{default:o.withCtx(()=>[PE,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.processEvidences(x),(B,S)=>(o.openBlock(),o.createBlock(c,{key:B,class:"dialog-text"},{default:o.withCtx(()=>[typeof B=="object"?(o.openBlock(),o.createElementBlock("a",{key:0,href:Object.values(B)[0],target:"_blank"},o.toDisplayString(Object.keys(B)[0]),9,IE)):(o.openBlock(),o.createElementBlock("span",OE,o.toDisplayString(B),1)),S!==x.body.evidence.length-1?(o.openBlock(),o.createElementBlock("span",LE,", ")):o.createCommentVNode("",!0)]),_:2},1024))),128))]),_:2},1024),o.createVNode(c,{class:"dialog-text"},{default:o.withCtx(()=>[ME,o.createTextVNode(" "+o.toDisplayString(x.body.comment),1)]),_:2},1024)]))),128))],64)):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0),t.authenticated?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.isEditable?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(c,{class:"dialog-spacer"}),t.editing?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createVNode(c,{class:"dialog-text"},{default:o.withCtx(()=>[FE]),_:1}),i.isDeleted?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(c,{class:"dialog-text"},{default:o.withCtx(()=>[AE]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.evidence,(x,k)=>(o.openBlock(),o.createBlock(c,{key:x},{default:o.withCtx(()=>[o.createVNode(y,{span:20},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.evidence[k]),1)]),_:2},1024),o.createVNode(y,{span:4},{default:o.withCtx(()=>[o.createVNode(f,{class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(m,{onClick:B=>i.removeEvidence(k)},null,8,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(C,{size:"small",placeholder:"Enter",modelValue:t.newEvidence,"onUpdate:modelValue":e[4]||(e[4]=x=>t.newEvidence=x),onChange:e[5]||(e[5]=x=>i.evidenceEntered(x))},{prepend:o.withCtx(()=>[o.createVNode(w,{teleported:!1,modelValue:t.evidencePrefix,"onUpdate:modelValue":e[3]||(e[3]=x=>t.evidencePrefix=x),placeholder:"Other:",class:"select-box","popper-class":"flatmap_dropdown"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.evidencePrefixes,x=>(o.openBlock(),o.createBlock(b,{key:x.label,value:x.value},{default:o.withCtx(()=>[o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(y,{span:12},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(x.label),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1})],64)),o.createVNode(c,null,{default:o.withCtx(()=>[VE]),_:1}),o.createVNode(c,{class:"dialog-text"},{default:o.withCtx(()=>[o.createVNode(C,{type:"textarea",autosize:{minRows:2,maxRows:4},placeholder:"Enter",modelValue:t.comment,"onUpdate:modelValue":e[6]||(e[6]=x=>t.comment=x)},null,8,["modelValue"])]),_:1}),o.createVNode(c,{class:"dialog-text"},{default:o.withCtx(()=>[o.createVNode(s,{class:"button",type:"primary",plain:"",onClick:i.submit},{default:o.withCtx(()=>[o.createTextVNode(" Submit ")]),_:1},8,["onClick"])]),_:1})],64)):(o.openBlock(),o.createBlock(c,{key:0},{default:o.withCtx(()=>[o.createVNode(f,{class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(v,{onClick:e[2]||(e[2]=x=>t.editing=!0)})]),_:1}),i.isDeleted?(o.openBlock(),o.createBlock(f,{key:0,class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(p,{onClick:i.submit},null,8,["onClick"])]),_:1})):i.isPositionUpdated?(o.openBlock(),o.createBlock(f,{key:1,class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(g,{onClick:i.submit},null,8,["onClick"])]),_:1})):o.createCommentVNode("",!0)]),_:1})),t.errorMessage?(o.openBlock(),o.createBlock(c,{key:2,class:"dialog-text"},{default:o.withCtx(()=>[o.createElementVNode("strong",RE,o.toDisplayString(t.errorMessage),1)]),_:1})):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)])]),_:1})}const $f=Jt(xE,[["render",$E],["__scopeId","data-v-b0c0a0f5"]]),zE={name:"CreateTooltipContent",components:{Button:Ut,Col:di,Container:Il,Header:_f,Input:li,Main:Ol},props:{createData:{type:Object}},watch:{"createData.shape":{handler:function(t,e){this.group=t,e!==void 0&&this.$emit("cancel-create")},immediate:!0}},computed:{confirmText:function(){return this.createData.editingIndex>-1?"Edit":"Confirm"}},data:function(){return{group:"default",region:"",showPoint:!1}},methods:{confirm:function(){this.$emit("confirm-create",{region:"__annotation/"+this.region,group:this.group,shape:this.createData.shape,editingIndex:this.createData.editingIndex}),this.group=this.createData.shape},cancel:function(){this.$emit("cancel-create")}}},HE=(t=>(o.pushScopeId("data-v-d61c5879"),t=t(),o.popScopeId(),t))(()=>o.createElementVNode("span",{class:"create-text"}," Primitives will be created in the __annotation region ",-1));function KE(t,e,n,r,a,i){const s=_f,l=di,u=Do,c=li,d=Ut,f=Ol,h=Il;return o.openBlock(),o.createBlock(h,{class:"create-container"},{default:o.withCtx(()=>[o.createVNode(s,{height:"30px",class:"header"},{default:o.withCtx(()=>[o.createElementVNode("div",null,"Create "+o.toDisplayString(n.createData.shape),1)]),_:1}),o.createVNode(f,{class:"slides-block"},{default:o.withCtx(()=>[HE,o.withDirectives(o.createVNode(u,{class:"row"},{default:o.withCtx(()=>[o.createVNode(l,{offset:0,span:8},{default:o.withCtx(()=>[o.createTextVNode(" Position: ")]),_:1}),o.createVNode(l,{offset:0,span:16},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.createData.points,({value:v,i:p})=>(o.openBlock(),o.createBlock(u,{key:p,class:"value"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(p),1)]),_:2},1024))),128))]),_:1})]),_:1},512),[[o.vShow,t.showPoint]]),o.createVNode(u,{class:"row"},{default:o.withCtx(()=>[o.createVNode(l,{offset:0,span:8},{default:o.withCtx(()=>[o.createTextVNode(" Region: ")]),_:1}),o.createVNode(l,{offset:0,span:16},{default:o.withCtx(()=>[o.createVNode(c,{modelValue:t.region,"onUpdate:modelValue":e[0]||(e[0]=v=>t.region=v),placeholder:"__annotation",size:"small"},null,8,["modelValue"])]),_:1})]),_:1}),o.createVNode(u,{class:"row"},{default:o.withCtx(()=>[o.createVNode(l,{offset:0,span:8},{default:o.withCtx(()=>[o.createTextVNode(" Group: ")]),_:1}),o.createVNode(l,{offset:0,span:16},{default:o.withCtx(()=>[o.createVNode(c,{modelValue:t.group,"onUpdate:modelValue":e[1]||(e[1]=v=>t.group=v),placeholder:n.createData.shape,size:"small"},null,8,["modelValue","placeholder"])]),_:1})]),_:1}),o.createVNode(u,null,{default:o.withCtx(()=>[o.createVNode(l,{offset:0,span:12},{default:o.withCtx(()=>[o.createVNode(d,{type:"primary",plain:"",onClick:i.confirm},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.confirmText),1)]),_:1},8,["onClick"])]),_:1}),o.createVNode(l,{offset:0,span:12},{default:o.withCtx(()=>[o.createVNode(d,{type:"primary",plain:"",onClick:i.cancel},{default:o.withCtx(()=>[o.createTextVNode(" Cancel ")]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1})]),_:1})}const qE=Jt(zE,[["render",KE],["__scopeId","data-v-d61c5879"]]);function st(t){"@babel/helpers - typeof";return st=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},st(t)}function zl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function UE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Hl(t,e,n){return e&&UE(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function zf(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dn(t,e){return GE(t)||WE(t,e)||Hf(t,e)||jE()}function GE(t){if(Array.isArray(t))return t}function WE(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],a=!0,i=!1,s,l;try{for(n=n.call(t);!(a=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));a=!0);}catch(u){i=!0,l=u}finally{try{!a&&n.return!=null&&n.return()}finally{if(i)throw l}}return r}}function Hf(t,e){if(t){if(typeof t=="string")return Kf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kf(t,e)}}function Kf(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function jE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
30
30
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qf(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Hf(t))||e){n&&(t=n);var r=0,a=function(){};return{s:a,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(u){throw u},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
31
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,l;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return i=u.done,u},e:function(u){s=!0,l=u},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(s)throw l}}}}var lt=typeof window>"u"?null:window,Uf=lt?lt.navigator:null;lt&<.document;var jE=st(""),Gf=st({}),YE=st(function(){}),ZE=typeof HTMLElement>"u"?"undefined":st(HTMLElement),mi=function(e){return e&&e.instanceString&&Ye(e.instanceString)?e.instanceString():null},be=function(e){return e!=null&&st(e)==jE},Ye=function(e){return e!=null&&st(e)===YE},Ke=function(e){return!Ut(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Oe=function(e){return e!=null&&st(e)===Gf&&!Ke(e)&&e.constructor===Object},XE=function(e){return e!=null&&st(e)===Gf},le=function(e){return e!=null&&st(e)===st(1)&&!isNaN(e)},QE=function(e){return le(e)&&Math.floor(e)===e},Lo=function(e){if(ZE!=="undefined")return e!=null&&e instanceof HTMLElement},Ut=function(e){return yi(e)||Wf(e)},yi=function(e){return mi(e)==="collection"&&e._private.single},Wf=function(e){return mi(e)==="collection"&&!e._private.single},Kl=function(e){return mi(e)==="core"},jf=function(e){return mi(e)==="stylesheet"},JE=function(e){return mi(e)==="event"},ar=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},eS=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},tS=function(e){return Oe(e)&&le(e.x1)&&le(e.x2)&&le(e.y1)&&le(e.y2)},nS=function(e){return XE(e)&&Ye(e.then)},rS=function(){return Uf&&Uf.userAgent.match(/msie|trident|edge/i)},bi=function(e,n){n||(n=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")});var r=function a(){var i=this,s=arguments,l,u=n.apply(i,s),c=a.cache;return(l=c[u])||(l=c[u]=e.apply(i,s)),l};return r.cache={},r},ql=bi(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Mo=bi(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Yf=bi(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),Zf=function(e){return ar(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},ct="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",aS="rgb[a]?\\(("+ct+"[%]?)\\s*,\\s*("+ct+"[%]?)\\s*,\\s*("+ct+"[%]?)(?:\\s*,\\s*("+ct+"))?\\)",iS="rgb[a]?\\((?:"+ct+"[%]?)\\s*,\\s*(?:"+ct+"[%]?)\\s*,\\s*(?:"+ct+"[%]?)(?:\\s*,\\s*(?:"+ct+"))?\\)",oS="hsl[a]?\\(("+ct+")\\s*,\\s*("+ct+"[%])\\s*,\\s*("+ct+"[%])(?:\\s*,\\s*("+ct+"))?\\)",sS="hsl[a]?\\((?:"+ct+")\\s*,\\s*(?:"+ct+"[%])\\s*,\\s*(?:"+ct+"[%])(?:\\s*,\\s*(?:"+ct+"))?\\)",lS="\\#[0-9a-fA-F]{3}",cS="\\#[0-9a-fA-F]{6}",Xf=function(e,n){return e<n?-1:e>n?1:0},uS=function(e,n){return-1*Xf(e,n)},xe=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,n=1;n<e.length;n++){var r=e[n];if(r!=null)for(var a=Object.keys(r),i=0;i<a.length;i++){var s=a[i];t[s]=r[s]}}return t},dS=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var n=e.length===4,r,a,i,s=16;return n?(r=parseInt(e[1]+e[1],s),a=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s)):(r=parseInt(e[1]+e[2],s),a=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s)),[r,a,i]}},fS=function(e){var n,r,a,i,s,l,u,c;function d(p,g,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?p+(g-p)*6*y:y<1/2?g:y<2/3?p+(g-p)*(2/3-y)*6:p}var f=new RegExp("^"+oS+"$").exec(e);if(f){if(r=parseInt(f[1]),r<0?r=(360- -1*r%360)%360:r>360&&(r=r%360),r/=360,a=parseFloat(f[2]),a<0||a>100||(a=a/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,s=f[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(a===0)l=u=c=Math.round(i*255);else{var h=i<.5?i*(1+a):i+a-i*a,v=2*i-h;l=Math.round(255*d(v,h,r+1/3)),u=Math.round(255*d(v,h,r)),c=Math.round(255*d(v,h,r-1/3))}n=[l,u,c,s]}return n},hS=function(e){var n,r=new RegExp("^"+aS+"$").exec(e);if(r){n=[];for(var a=[],i=1;i<=3;i++){var s=r[i];if(s[s.length-1]==="%"&&(a[i]=!0),s=parseFloat(s),a[i]&&(s=s/100*255),s<0||s>255)return;n.push(Math.floor(s))}var l=a[1]||a[2]||a[3],u=a[1]&&a[2]&&a[3];if(l&&!u)return;var c=r[4];if(c!==void 0){if(c=parseFloat(c),c<0||c>1)return;n.push(c)}}return n},pS=function(e){return gS[e.toLowerCase()]},vS=function(e){return(Ke(e)?e:null)||pS(e)||dS(e)||hS(e)||fS(e)},gS={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Qf=function(e){for(var n=e.map,r=e.keys,a=r.length,i=0;i<a;i++){var s=r[i];if(Oe(s))throw Error("Tried to set map with object key");i<r.length-1?(n[s]==null&&(n[s]={}),n=n[s]):n[s]=e.value}},Jf=function(e){for(var n=e.map,r=e.keys,a=r.length,i=0;i<a;i++){var s=r[i];if(Oe(s))throw Error("Tried to get map with object key");if(n=n[s],n==null)return n}return n};function mS(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Lr=mS,wi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yS(t,e){return e={exports:{}},t(e,e.exports),e.exports}var bS=typeof wi=="object"&&wi&&wi.Object===Object&&wi,wS=bS,CS=typeof self=="object"&&self&&self.Object===Object&&self,kS=wS||CS||Function("return this")(),Fo=kS,xS=function(){return Fo.Date.now()},Ul=xS,ES=/\s/;function SS(t){for(var e=t.length;e--&&ES.test(t.charAt(e)););return e}var TS=SS,BS=/^\s+/;function NS(t){return t&&t.slice(0,TS(t)+1).replace(BS,"")}var DS=NS,_S=Fo.Symbol,pa=_S,eh=Object.prototype,PS=eh.hasOwnProperty,OS=eh.toString,Ci=pa?pa.toStringTag:void 0;function IS(t){var e=PS.call(t,Ci),n=t[Ci];try{t[Ci]=void 0;var r=!0}catch{}var a=OS.call(t);return r&&(e?t[Ci]=n:delete t[Ci]),a}var LS=IS,MS=Object.prototype,FS=MS.toString;function AS(t){return FS.call(t)}var VS=AS,RS="[object Null]",$S="[object Undefined]",th=pa?pa.toStringTag:void 0;function zS(t){return t==null?t===void 0?$S:RS:th&&th in Object(t)?LS(t):VS(t)}var nh=zS;function HS(t){return t!=null&&typeof t=="object"}var KS=HS,qS="[object Symbol]";function US(t){return typeof t=="symbol"||KS(t)&&nh(t)==qS}var ki=US,rh=NaN,GS=/^[-+]0x[0-9a-f]+$/i,WS=/^0b[01]+$/i,jS=/^0o[0-7]+$/i,YS=parseInt;function ZS(t){if(typeof t=="number")return t;if(ki(t))return rh;if(Lr(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Lr(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=DS(t);var n=WS.test(t);return n||jS.test(t)?YS(t.slice(2),n?2:8):GS.test(t)?rh:+t}var ah=ZS,XS="Expected a function",QS=Math.max,JS=Math.min;function eT(t,e,n){var r,a,i,s,l,u,c=0,d=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(XS);e=ah(e)||0,Lr(n)&&(d=!!n.leading,f="maxWait"in n,i=f?QS(ah(n.maxWait)||0,e):i,h="trailing"in n?!!n.trailing:h);function v(E){var x=r,B=a;return r=a=void 0,c=E,s=t.apply(B,x),s}function p(E){return c=E,l=setTimeout(m,e),d?v(E):s}function g(E){var x=E-u,B=E-c,S=e-x;return f?JS(S,i-B):S}function y(E){var x=E-u,B=E-c;return u===void 0||x>=e||x<0||f&&B>=i}function m(){var E=Ul();if(y(E))return b(E);l=setTimeout(m,g(E))}function b(E){return l=void 0,h&&r?v(E):(r=a=void 0,s)}function w(){l!==void 0&&clearTimeout(l),c=0,r=u=a=l=void 0}function C(){return l===void 0?s:b(Ul())}function k(){var E=Ul(),x=y(E);if(r=arguments,a=this,u=E,x){if(l===void 0)return p(u);if(f)return clearTimeout(l),l=setTimeout(m,e),v(u)}return l===void 0&&(l=setTimeout(m,e)),s}return k.cancel=w,k.flush=C,k}var Ao=eT,Gl=lt?lt.performance:null,ih=Gl&&Gl.now?function(){return Gl.now()}:function(){return Date.now()},tT=function(){if(lt){if(lt.requestAnimationFrame)return function(t){lt.requestAnimationFrame(t)};if(lt.mozRequestAnimationFrame)return function(t){lt.mozRequestAnimationFrame(t)};if(lt.webkitRequestAnimationFrame)return function(t){lt.webkitRequestAnimationFrame(t)};if(lt.msRequestAnimationFrame)return function(t){lt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(ih())},1e3/60)}}(),Vo=function(e){return tT(e)},Rn=ih,va=9261,oh=65599,xi=5381,sh=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:va,r=n,a;a=e.next(),!a.done;)r=r*oh+a.value|0;return r},Ei=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:va;return n*oh+e|0},Si=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xi;return(n<<5)+n+e|0},nT=function(e,n){return e*2097152+n},ir=function(e){return e[0]*2097152+e[1]},Ro=function(e,n){return[Ei(e[0],n[0]),Si(e[1],n[1])]},rT=function(e,n){var r={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?r.value=e[a++]:r.done=!0,r}};return sh(s,n)},Mr=function(e,n){var r={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?r.value=e.charCodeAt(a++):r.done=!0,r}};return sh(s,n)},lh=function(){return aT(arguments)},aT=function(e){for(var n,r=0;r<e.length;r++){var a=e[r];r===0?n=Mr(a):n=Mr(a,n)}return n},ch=!0,iT=console.warn!=null,oT=console.trace!=null,Wl=Number.MAX_SAFE_INTEGER||9007199254740991,uh=function(){return!0},$o=function(){return!1},dh=function(){return 0},jl=function(){},Ze=function(e){throw new Error(e)},fh=function(e){if(e!==void 0)ch=!!e;else return ch},Ve=function(e){fh()&&(iT?console.warn(e):(console.log(e),oT&&console.trace()))},sT=function(e){return xe({},e)},kn=function(e){return e==null?e:Ke(e)?e.slice():Oe(e)?sT(e):e},lT=function(e){return e.slice()},hh=function(e,n){for(n=e="";e++<36;n+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return n},cT={},ph=function(){return cT},wt=function(e){var n=Object.keys(e);return function(r){for(var a={},i=0;i<n.length;i++){var s=n[i],l=r==null?void 0:r[s];a[s]=l===void 0?e[s]:l}return a}},or=function(e,n,r){for(var a=e.length-1;a>=0;a--)e[a]===n&&e.splice(a,1)},Yl=function(e){e.splice(0,e.length)},uT=function(e,n){for(var r=0;r<n.length;r++){var a=n[r];e.push(a)}},fn=function(e,n,r){return r&&(n=Yf(r,n)),e[n]},sr=function(e,n,r,a){r&&(n=Yf(r,n)),e[n]=a},dT=function(){function t(){zl(this,t),this._obj={}}return Hl(t,[{key:"set",value:function(n,r){return this._obj[n]=r,this}},{key:"delete",value:function(n){return this._obj[n]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(n){return this._obj[n]!==void 0}},{key:"get",value:function(n){return this._obj[n]}}]),t}(),xn=typeof Map<"u"?Map:dT,fT="undefined",hT=function(){function t(e){if(zl(this,t),this._obj=Object.create(null),this.size=0,e!=null){var n;e.instanceString!=null&&e.instanceString()===this.instanceString()?n=e.toArray():n=e;for(var r=0;r<n.length;r++)this.add(n[r])}}return Hl(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(n){var r=this._obj;r[n]!==1&&(r[n]=1,this.size++)}},{key:"delete",value:function(n){var r=this._obj;r[n]===1&&(r[n]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(n){return this._obj[n]===1}},{key:"toArray",value:function(){var n=this;return Object.keys(this._obj).filter(function(r){return n.has(r)})}},{key:"forEach",value:function(n,r){return this.toArray().forEach(n,r)}}]),t}(),ga=(typeof Set>"u"?"undefined":st(Set))!==fT?Set:hT,zo=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||n===void 0||!Kl(e)){Ze("An element must have a core reference and parameters set");return}var a=n.group;if(a==null&&(n.data&&n.data.source!=null&&n.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){Ze("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:n.data||{},position:n.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!n.selected,selectable:n.selectable===void 0?!0:!!n.selectable,locked:!!n.locked,grabbed:!1,grabbable:n.grabbable===void 0?!0:!!n.grabbable,pannable:n.pannable===void 0?a==="edges":!!n.pannable,active:!1,classes:new ga,animation:{current:[],queue:[]},rscratch:{},scratch:n.scratch||{},edges:[],children:[],parent:n.parent&&n.parent.isNode()?n.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),n.renderedPosition){var s=n.renderedPosition,l=e.pan(),u=e.zoom();i.position={x:(s.x-l.x)/u,y:(s.y-l.y)/u}}var c=[];Ke(n.classes)?c=n.classes:be(n.classes)&&(c=n.classes.split(/\s+/));for(var d=0,f=c.length;d<f;d++){var h=c[d];!h||h===""||i.classes.add(h)}this.createEmitter();var v=n.style||n.css;v&&(Ve("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(v)),(r===void 0||r)&&this.restore()},vh=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(r,a,i){var s;Oe(r)&&!Ut(r)&&(s=r,r=s.roots||s.root,a=s.visit,i=s.directed),i=arguments.length===2&&!Ye(a)?a:i,a=Ye(a)?a:function(){};for(var l=this._private.cy,u=r=be(r)?this.filter(r):r,c=[],d=[],f={},h={},v={},p=0,g,y=this.byGroup(),m=y.nodes,b=y.edges,w=0;w<u.length;w++){var C=u[w],k=C.id();C.isNode()&&(c.unshift(C),e.bfs&&(v[k]=!0,d.push(C)),h[k]=0)}for(var E=function(){var I=e.bfs?c.shift():c.pop(),P=I.id();if(e.dfs){if(v[P])return"continue";v[P]=!0,d.push(I)}var F=h[P],O=f[P],M=O!=null?O.source():null,L=O!=null?O.target():null,V=O==null?void 0:I.same(M)?L[0]:M[0],H=void 0;if(H=a(I,O,V,p++,F),H===!0)return g=I,"break";if(H===!1)return"break";for(var $=I.connectedEdges().filter(function(X){return(!i||X.source().same(I))&&b.has(X)}),z=0;z<$.length;z++){var j=$[z],ee=j.connectedNodes().filter(function(X){return!X.same(I)&&m.has(X)}),J=ee.id();ee.length!==0&&!v[J]&&(ee=ee[0],c.push(ee),e.bfs&&(v[J]=!0,d.push(ee)),f[J]=j,h[J]=h[P]+1)}};c.length!==0;){var x=E();if(x!=="continue"&&x==="break")break}for(var B=l.collection(),S=0;S<d.length;S++){var N=d[S],D=f[N.id()];D!=null&&B.push(D),B.push(N)}return{path:l.collection(B),found:l.collection(g)}}},Ti={breadthFirstSearch:vh({bfs:!0}),depthFirstSearch:vh({dfs:!0})};Ti.bfs=Ti.breadthFirstSearch,Ti.dfs=Ti.depthFirstSearch;var pT=yS(function(t,e){(function(){var n,r,a,i,s,l,u,c,d,f,h,v,p,g,y;a=Math.floor,f=Math.min,r=function(m,b){return m<b?-1:m>b?1:0},d=function(m,b,w,C,k){var E;if(w==null&&(w=0),k==null&&(k=r),w<0)throw new Error("lo must be non-negative");for(C==null&&(C=m.length);w<C;)E=a((w+C)/2),k(b,m[E])<0?C=E:w=E+1;return[].splice.apply(m,[w,w-w].concat(b)),b},l=function(m,b,w){return w==null&&(w=r),m.push(b),g(m,0,m.length-1,w)},s=function(m,b){var w,C;return b==null&&(b=r),w=m.pop(),m.length?(C=m[0],m[0]=w,y(m,0,b)):C=w,C},c=function(m,b,w){var C;return w==null&&(w=r),C=m[0],m[0]=b,y(m,0,w),C},u=function(m,b,w){var C;return w==null&&(w=r),m.length&&w(m[0],b)<0&&(C=[m[0],b],b=C[0],m[0]=C[1],y(m,0,w)),b},i=function(m,b){var w,C,k,E,x,B;for(b==null&&(b=r),E=(function(){B=[];for(var S=0,N=a(m.length/2);0<=N?S<N:S>N;0<=N?S++:S--)B.push(S);return B}).apply(this).reverse(),x=[],C=0,k=E.length;C<k;C++)w=E[C],x.push(y(m,w,b));return x},p=function(m,b,w){var C;if(w==null&&(w=r),C=m.indexOf(b),C!==-1)return g(m,0,C,w),y(m,C,w)},h=function(m,b,w){var C,k,E,x,B;if(w==null&&(w=r),k=m.slice(0,b),!k.length)return k;for(i(k,w),B=m.slice(b),E=0,x=B.length;E<x;E++)C=B[E],u(k,C,w);return k.sort(w).reverse()},v=function(m,b,w){var C,k,E,x,B,S,N,D,_;if(w==null&&(w=r),b*10<=m.length){if(E=m.slice(0,b).sort(w),!E.length)return E;for(k=E[E.length-1],N=m.slice(b),x=0,S=N.length;x<S;x++)C=N[x],w(C,k)<0&&(d(E,C,0,null,w),E.pop(),k=E[E.length-1]);return E}for(i(m,w),_=[],B=0,D=f(b,m.length);0<=D?B<D:B>D;0<=D?++B:--B)_.push(s(m,w));return _},g=function(m,b,w,C){var k,E,x;for(C==null&&(C=r),k=m[w];w>b;){if(x=w-1>>1,E=m[x],C(k,E)<0){m[w]=E,w=x;continue}break}return m[w]=k},y=function(m,b,w){var C,k,E,x,B;for(w==null&&(w=r),k=m.length,B=b,E=m[b],C=2*b+1;C<k;)x=C+1,x<k&&!(w(m[C],m[x])<0)&&(C=x),m[b]=m[C],b=C,C=2*b+1;return m[b]=E,g(m,B,b,w)},n=function(){m.push=l,m.pop=s,m.replace=c,m.pushpop=u,m.heapify=i,m.updateItem=p,m.nlargest=h,m.nsmallest=v;function m(b){this.cmp=b??r,this.nodes=[]}return m.prototype.push=function(b){return l(this.nodes,b,this.cmp)},m.prototype.pop=function(){return s(this.nodes,this.cmp)},m.prototype.peek=function(){return this.nodes[0]},m.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},m.prototype.replace=function(b){return c(this.nodes,b,this.cmp)},m.prototype.pushpop=function(b){return u(this.nodes,b,this.cmp)},m.prototype.heapify=function(){return i(this.nodes,this.cmp)},m.prototype.updateItem=function(b){return p(this.nodes,b,this.cmp)},m.prototype.clear=function(){return this.nodes=[]},m.prototype.empty=function(){return this.nodes.length===0},m.prototype.size=function(){return this.nodes.length},m.prototype.clone=function(){var b;return b=new m,b.nodes=this.nodes.slice(0),b},m.prototype.toArray=function(){return this.nodes.slice(0)},m.prototype.insert=m.prototype.push,m.prototype.top=m.prototype.peek,m.prototype.front=m.prototype.peek,m.prototype.has=m.prototype.contains,m.prototype.copy=m.prototype.clone,m}(),function(m,b){return t.exports=b()}(this,function(){return n})}).call(wi)}),Bi=pT,vT=wt({root:null,weight:function(e){return 1},directed:!1}),gT={dijkstra:function(e){if(!Oe(e)){var n=arguments;e={root:n[0],weight:n[1],directed:n[2]}}var r=vT(e),a=r.root,i=r.weight,s=r.directed,l=this,u=i,c=be(a)?this.filter(a)[0]:a[0],d={},f={},h={},v=this.byGroup(),p=v.nodes,g=v.edges;g.unmergeBy(function(F){return F.isLoop()});for(var y=function(O){return d[O.id()]},m=function(O,M){d[O.id()]=M,b.updateItem(O)},b=new Bi(function(F,O){return y(F)-y(O)}),w=0;w<p.length;w++){var C=p[w];d[C.id()]=C.same(c)?0:1/0,b.push(C)}for(var k=function(O,M){for(var L=(s?O.edgesTo(M):O.edgesWith(M)).intersect(g),V=1/0,H,$=0;$<L.length;$++){var z=L[$],j=u(z);(j<V||!H)&&(V=j,H=z)}return{edge:H,dist:V}};b.size()>0;){var E=b.pop(),x=y(E),B=E.id();if(h[B]=x,x!==1/0)for(var S=E.neighborhood().intersect(p),N=0;N<S.length;N++){var D=S[N],_=D.id(),I=k(E,D),P=x+I.dist;P<y(D)&&(m(D,P),f[_]={node:E,edge:I.edge})}}return{distanceTo:function(O){var M=be(O)?p.filter(O)[0]:O[0];return h[M.id()]},pathTo:function(O){var M=be(O)?p.filter(O)[0]:O[0],L=[],V=M,H=V.id();if(M.length>0)for(L.unshift(M);f[H];){var $=f[H];L.unshift($.edge),L.unshift($.node),V=$.node,H=V.id()}return l.spawn(L)}}}},mT={kruskal:function(e){e=e||function(w){return 1};for(var n=this.byGroup(),r=n.nodes,a=n.edges,i=r.length,s=new Array(i),l=r,u=function(C){for(var k=0;k<s.length;k++){var E=s[k];if(E.has(C))return k}},c=0;c<i;c++)s[c]=this.spawn(r[c]);for(var d=a.sort(function(w,C){return e(w)-e(C)}),f=0;f<d.length;f++){var h=d[f],v=h.source()[0],p=h.target()[0],g=u(v),y=u(p),m=s[g],b=s[y];g!==y&&(l.merge(h),m.merge(b),s.splice(y,1))}return l}},yT=wt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),bT={aStar:function(e){var n=this.cy(),r=yT(e),a=r.root,i=r.goal,s=r.heuristic,l=r.directed,u=r.weight;a=n.collection(a)[0],i=n.collection(i)[0];var c=a.id(),d=i.id(),f={},h={},v={},p=new Bi(function(H,$){return h[H.id()]-h[$.id()]}),g=new ga,y={},m={},b=function($,z){p.push($),g.add(z)},w,C,k=function(){w=p.pop(),C=w.id(),g.delete(C)},E=function($){return g.has($)};b(a,c),f[c]=0,h[c]=s(a);for(var x=0;p.size()>0;){if(k(),x++,C===d){for(var B=[],S=i,N=d,D=m[N];B.unshift(S),D!=null&&B.unshift(D),S=y[N],S!=null;)N=S.id(),D=m[N];return{found:!0,distance:f[C],path:this.spawn(B),steps:x}}v[C]=!0;for(var _=w._private.edges,I=0;I<_.length;I++){var P=_[I];if(this.hasElementWithId(P.id())&&!(l&&P.data("source")!==C)){var F=P.source(),O=P.target(),M=F.id()!==C?F:O,L=M.id();if(this.hasElementWithId(L)&&!v[L]){var V=f[C]+u(P);if(!E(L)){f[L]=V,h[L]=V+s(M),b(M,L),y[L]=w,m[L]=P;continue}V<f[L]&&(f[L]=V,h[L]=V+s(M),y[L]=w,m[L]=P)}}}}return{found:!1,distance:void 0,path:void 0,steps:x}}},wT=wt({weight:function(e){return 1},directed:!1}),CT={floydWarshall:function(e){for(var n=this.cy(),r=wT(e),a=r.weight,i=r.directed,s=a,l=this.byGroup(),u=l.nodes,c=l.edges,d=u.length,f=d*d,h=function(j){return u.indexOf(j)},v=function(j){return u[j]},p=new Array(f),g=0;g<f;g++){var y=g%d,m=(g-y)/d;m===y?p[g]=0:p[g]=1/0}for(var b=new Array(f),w=new Array(f),C=0;C<c.length;C++){var k=c[C],E=k.source()[0],x=k.target()[0];if(E!==x){var B=h(E),S=h(x),N=B*d+S,D=s(k);if(p[N]>D&&(p[N]=D,b[N]=S,w[N]=k),!i){var _=S*d+B;!i&&p[_]>D&&(p[_]=D,b[_]=B,w[_]=k)}}}for(var I=0;I<d;I++)for(var P=0;P<d;P++)for(var F=P*d+I,O=0;O<d;O++){var M=P*d+O,L=I*d+O;p[F]+p[L]<p[M]&&(p[M]=p[F]+p[L],b[M]=b[F])}var V=function(j){return(be(j)?n.filter(j):j)[0]},H=function(j){return h(V(j))},$={distance:function(j,ee){var J=H(j),X=H(ee);return p[J*d+X]},path:function(j,ee){var J=H(j),X=H(ee),ne=v(J);if(J===X)return ne.collection();if(b[J*d+X]==null)return n.collection();var Y=n.collection(),A=J,K;for(Y.merge(ne);J!==X;)A=J,J=b[J*d+X],K=w[A*d+J],Y.merge(K),Y.merge(v(J));return Y}};return $}},kT=wt({weight:function(e){return 1},directed:!1,root:null}),xT={bellmanFord:function(e){var n=this,r=kT(e),a=r.weight,i=r.directed,s=r.root,l=a,u=this,c=this.cy(),d=this.byGroup(),f=d.edges,h=d.nodes,v=h.length,p=new xn,g=!1,y=[];s=c.collection(s)[0],f.unmergeBy(function(pe){return pe.isLoop()});for(var m=f.length,b=function(de){var me=p.get(de.id());return me||(me={},p.set(de.id(),me)),me},w=function(de){return(be(de)?c.$(de):de)[0]},C=function(de){return b(w(de)).dist},k=function(de){for(var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,Ne=w(de),De=[],Ee=Ne;;){if(Ee==null)return n.spawn();var _e=b(Ee),te=_e.edge,T=_e.pred;if(De.unshift(Ee[0]),Ee.same(me)&&De.length>0)break;te!=null&&De.unshift(te),Ee=T}return u.spawn(De)},E=0;E<v;E++){var x=h[E],B=b(x);x.same(s)?B.dist=0:B.dist=1/0,B.pred=null,B.edge=null}for(var S=!1,N=function(de,me,Ne,De,Ee,_e){var te=De.dist+_e;te<Ee.dist&&!Ne.same(De.edge)&&(Ee.dist=te,Ee.pred=de,Ee.edge=Ne,S=!0)},D=1;D<v;D++){S=!1;for(var _=0;_<m;_++){var I=f[_],P=I.source(),F=I.target(),O=l(I),M=b(P),L=b(F);N(P,F,I,M,L,O),i||N(F,P,I,L,M,O)}if(!S)break}if(S)for(var V=[],H=0;H<m;H++){var $=f[H],z=$.source(),j=$.target(),ee=l($),J=b(z).dist,X=b(j).dist;if(J+ee<X||!i&&X+ee<J)if(g||(Ve("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),e.findNegativeWeightCycles!==!1){var ne=[];J+ee<X&&ne.push(z),!i&&X+ee<J&&ne.push(j);for(var Y=ne.length,A=0;A<Y;A++){var K=ne[A],W=[K];W.push(b(K).edge);for(var oe=b(K).pred;W.indexOf(oe)===-1;)W.push(oe),W.push(b(oe).edge),oe=b(oe).pred;W=W.slice(W.indexOf(oe));for(var he=W[0].id(),re=0,se=2;se<W.length;se+=2)W[se].id()<he&&(he=W[se].id(),re=se);W=W.slice(re).concat(W.slice(0,re)),W.push(W[0]);var ue=W.map(function(pe){return pe.id()}).join(",");V.indexOf(ue)===-1&&(y.push(u.spawn(W)),V.push(ue))}}else break}return{distanceTo:C,pathTo:k,hasNegativeWeightCycle:g,negativeWeightCycles:y}}},ET=Math.sqrt(2),ST=function(e,n,r){r.length===0&&Ze("Karger-Stein must be run on a connected (sub)graph");for(var a=r[e],i=a[1],s=a[2],l=n[i],u=n[s],c=r,d=c.length-1;d>=0;d--){var f=c[d],h=f[1],v=f[2];(n[h]===l&&n[v]===u||n[h]===u&&n[v]===l)&&c.splice(d,1)}for(var p=0;p<c.length;p++){var g=c[p];g[1]===u?(c[p]=g.slice(),c[p][1]=l):g[2]===u&&(c[p]=g.slice(),c[p][2]=l)}for(var y=0;y<n.length;y++)n[y]===u&&(n[y]=l);return c},Zl=function(e,n,r,a){for(;r>a;){var i=Math.floor(Math.random()*n.length);n=ST(i,e,n),r--}return n},TT={kargerStein:function(){var e=this,n=this.byGroup(),r=n.nodes,a=n.edges;a.unmergeBy(function(L){return L.isLoop()});var i=r.length,s=a.length,l=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/ET);if(i<2){Ze("At least 2 nodes are required for Karger-Stein algorithm");return}for(var c=[],d=0;d<s;d++){var f=a[d];c.push([d,r.indexOf(f.source()),r.indexOf(f.target())])}for(var h=1/0,v=[],p=new Array(i),g=new Array(i),y=new Array(i),m=function(V,H){for(var $=0;$<i;$++)H[$]=V[$]},b=0;b<=l;b++){for(var w=0;w<i;w++)g[w]=w;var C=Zl(g,c.slice(),i,u),k=C.slice();m(g,y);var E=Zl(g,C,u,2),x=Zl(y,k,u,2);E.length<=x.length&&E.length<h?(h=E.length,v=E,m(g,p)):x.length<=E.length&&x.length<h&&(h=x.length,v=x,m(y,p))}for(var B=this.spawn(v.map(function(L){return a[L[0]]})),S=this.spawn(),N=this.spawn(),D=p[0],_=0;_<p.length;_++){var I=p[_],P=r[_];I===D?S.merge(P):N.merge(P)}var F=function(V){var H=e.spawn();return V.forEach(function($){H.merge($),$.connectedEdges().forEach(function(z){e.contains(z)&&!B.contains(z)&&H.merge(z)})}),H},O=[F(S),F(N)],M={cut:B,components:O,partition1:S,partition2:N};return M}},BT=function(e){return{x:e.x,y:e.y}},Ho=function(e,n,r){return{x:e.x*n+r.x,y:e.y*n+r.y}},gh=function(e,n,r){return{x:(e.x-r.x)/n,y:(e.y-r.y)/n}},ma=function(e){return{x:e[0],y:e[1]}},NT=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=n;i<r;i++){var s=e[i];isFinite(s)&&(a=Math.min(s,a))}return a},DT=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=n;i<r;i++){var s=e[i];isFinite(s)&&(a=Math.max(s,a))}return a},_T=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,s=n;s<r;s++){var l=e[s];isFinite(l)&&(a+=l,i++)}return a/i},PT=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?e=e.slice(n,r):(r<e.length&&e.splice(r,e.length-r),n>0&&e.splice(0,n));for(var l=0,u=e.length-1;u>=0;u--){var c=e[u];s?isFinite(c)||(e[u]=-1/0,l++):e.splice(u,1)}i&&e.sort(function(h,v){return h-v});var d=e.length,f=Math.floor(d/2);return d%2!==0?e[f+1+l]:(e[f-1+l]+e[f+l])/2},OT=function(e){return Math.PI*e/180},Ko=function(e,n){return Math.atan2(n,e)-Math.PI/2},Xl=Math.log2||function(t){return Math.log(t)/Math.log(2)},mh=function(e){return e>0?1:e<0?-1:0},Fr=function(e,n){return Math.sqrt(Ar(e,n))},Ar=function(e,n){var r=n.x-e.x,a=n.y-e.y;return r*r+a*a},IT=function(e){for(var n=e.length,r=0,a=0;a<n;a++)r+=e[a];for(var i=0;i<n;i++)e[i]=e[i]/r;return e},ht=function(e,n,r,a){return(1-a)*(1-a)*e+2*(1-a)*a*n+a*a*r},ya=function(e,n,r,a){return{x:ht(e.x,n.x,r.x,a),y:ht(e.y,n.y,r.y,a)}},LT=function(e,n,r,a){var i={x:n.x-e.x,y:n.y-e.y},s=Fr(e,n),l={x:i.x/s,y:i.y/s};return r=r??0,a=a??r*s,{x:e.x+l.x*a,y:e.y+l.y*a}},Ni=function(e,n,r){return Math.max(e,Math.min(r,n))},zt=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},MT=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},FT=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},AT=function(e,n,r){return{x1:e.x1+n,x2:e.x2+n,y1:e.y1+r,y2:e.y2+r,w:e.w,h:e.h}},yh=function(e,n){e.x1=Math.min(e.x1,n.x1),e.x2=Math.max(e.x2,n.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n.y1),e.y2=Math.max(e.y2,n.y2),e.h=e.y2-e.y1},VT=function(e,n,r){e.x1=Math.min(e.x1,n),e.x2=Math.max(e.x2,n),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r),e.y2=Math.max(e.y2,r),e.h=e.y2-e.y1},qo=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=n,e.x2+=n,e.y1-=n,e.y2+=n,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Uo=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],r,a,i,s;if(n.length===1)r=a=i=s=n[0];else if(n.length===2)r=i=n[0],s=a=n[1];else if(n.length===4){var l=dn(n,4);r=l[0],a=l[1],i=l[2],s=l[3]}return e.x1-=s,e.x2+=a,e.y1-=r,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},bh=function(e,n){e.x1=n.x1,e.y1=n.y1,e.x2=n.x2,e.y2=n.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Ql=function(e,n){return!(e.x1>n.x2||n.x1>e.x2||e.x2<n.x1||n.x2<e.x1||e.y2<n.y1||n.y2<e.y1||e.y1>n.y2||n.y1>e.y2)},ba=function(e,n,r){return e.x1<=n&&n<=e.x2&&e.y1<=r&&r<=e.y2},RT=function(e,n){return ba(e,n.x,n.y)},wh=function(e,n){return ba(e,n.x1,n.y1)&&ba(e,n.x2,n.y2)},Ch=function(e,n,r,a,i,s,l){var u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",c=u==="auto"?Rr(i,s):u,d=i/2,f=s/2;c=Math.min(c,d,f);var h=c!==d,v=c!==f,p;if(h){var g=r-d+c-l,y=a-f-l,m=r+d-c+l,b=y;if(p=lr(e,n,r,a,g,y,m,b,!1),p.length>0)return p}if(v){var w=r+d+l,C=a-f+c-l,k=w,E=a+f-c+l;if(p=lr(e,n,r,a,w,C,k,E,!1),p.length>0)return p}if(h){var x=r-d+c-l,B=a+f+l,S=r+d-c+l,N=B;if(p=lr(e,n,r,a,x,B,S,N,!1),p.length>0)return p}if(v){var D=r-d-l,_=a-f+c-l,I=D,P=a+f-c+l;if(p=lr(e,n,r,a,D,_,I,P,!1),p.length>0)return p}var F;{var O=r-d+c,M=a-f+c;if(F=Di(e,n,r,a,O,M,c+l),F.length>0&&F[0]<=O&&F[1]<=M)return[F[0],F[1]]}{var L=r+d-c,V=a-f+c;if(F=Di(e,n,r,a,L,V,c+l),F.length>0&&F[0]>=L&&F[1]<=V)return[F[0],F[1]]}{var H=r+d-c,$=a+f-c;if(F=Di(e,n,r,a,H,$,c+l),F.length>0&&F[0]>=H&&F[1]>=$)return[F[0],F[1]]}{var z=r-d+c,j=a+f-c;if(F=Di(e,n,r,a,z,j,c+l),F.length>0&&F[0]<=z&&F[1]>=j)return[F[0],F[1]]}return[]},$T=function(e,n,r,a,i,s,l){var u=l,c=Math.min(r,i),d=Math.max(r,i),f=Math.min(a,s),h=Math.max(a,s);return c-u<=e&&e<=d+u&&f-u<=n&&n<=h+u},zT=function(e,n,r,a,i,s,l,u,c){var d={x1:Math.min(r,l,i)-c,x2:Math.max(r,l,i)+c,y1:Math.min(a,u,s)-c,y2:Math.max(a,u,s)+c};return!(e<d.x1||e>d.x2||n<d.y1||n>d.y2)},HT=function(e,n,r,a){r-=a;var i=n*n-4*e*r;if(i<0)return[];var s=Math.sqrt(i),l=2*e,u=(-n+s)/l,c=(-n-s)/l;return[u,c]},KT=function(e,n,r,a,i){var s=1e-5;e===0&&(e=s),n/=e,r/=e,a/=e;var l,u,c,d,f,h,v,p;if(u=(3*r-n*n)/9,c=-(27*a)+n*(9*r-2*(n*n)),c/=54,l=u*u*u+c*c,i[1]=0,v=n/3,l>0){f=c+Math.sqrt(l),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),h=c-Math.sqrt(l),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-v+f+h,v+=(f+h)/2,i[4]=i[2]=-v,v=Math.sqrt(3)*(-h+f)/2,i[3]=v,i[5]=-v;return}if(i[5]=i[3]=0,l===0){p=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-v+2*p,i[4]=i[2]=-(p+v);return}u=-u,d=u*u*u,d=Math.acos(c/Math.sqrt(d)),p=2*Math.sqrt(u),i[0]=-v+p*Math.cos(d/3),i[2]=-v+p*Math.cos((d+2*Math.PI)/3),i[4]=-v+p*Math.cos((d+4*Math.PI)/3)},qT=function(e,n,r,a,i,s,l,u){var c=1*r*r-4*r*i+2*r*l+4*i*i-4*i*l+l*l+a*a-4*a*s+2*a*u+4*s*s-4*s*u+u*u,d=1*9*r*i-3*r*r-3*r*l-6*i*i+3*i*l+9*a*s-3*a*a-3*a*u-6*s*s+3*s*u,f=1*3*r*r-6*r*i+r*l-r*e+2*i*i+2*i*e-l*e+3*a*a-6*a*s+a*u-a*n+2*s*s+2*s*n-u*n,h=1*r*i-r*r+r*e-i*e+a*s-a*a+a*n-s*n,v=[];KT(c,d,f,h,v);for(var p=1e-7,g=[],y=0;y<6;y+=2)Math.abs(v[y+1])<p&&v[y]>=0&&v[y]<=1&&g.push(v[y]);g.push(1),g.push(0);for(var m=-1,b,w,C,k=0;k<g.length;k++)b=Math.pow(1-g[k],2)*r+2*(1-g[k])*g[k]*i+g[k]*g[k]*l,w=Math.pow(1-g[k],2)*a+2*(1-g[k])*g[k]*s+g[k]*g[k]*u,C=Math.pow(b-e,2)+Math.pow(w-n,2),m>=0?C<m&&(m=C):m=C;return m},UT=function(e,n,r,a,i,s){var l=[e-r,n-a],u=[i-r,s-a],c=u[0]*u[0]+u[1]*u[1],d=l[0]*l[0]+l[1]*l[1],f=l[0]*u[0]+l[1]*u[1],h=f*f/c;return f<0?d:h>c?(e-i)*(e-i)+(n-s)*(n-s):d-h},Ht=function(e,n,r){for(var a,i,s,l,u,c=0,d=0;d<r.length/2;d++)if(a=r[d*2],i=r[d*2+1],d+1<r.length/2?(s=r[(d+1)*2],l=r[(d+1)*2+1]):(s=r[(d+1-r.length/2)*2],l=r[(d+1-r.length/2)*2+1]),!(a==e&&s==e))if(a>=e&&e>=s||a<=e&&e<=s)u=(e-a)/(s-a)*(l-i)+i,u>n&&c++;else continue;return c%2!==0},$n=function(e,n,r,a,i,s,l,u,c){var d=new Array(r.length),f;u[0]!=null?(f=Math.atan(u[1]/u[0]),u[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=u;for(var h=Math.cos(-f),v=Math.sin(-f),p=0;p<d.length/2;p++)d[p*2]=s/2*(r[p*2]*h-r[p*2+1]*v),d[p*2+1]=l/2*(r[p*2+1]*h+r[p*2]*v),d[p*2]+=a,d[p*2+1]+=i;var g;if(c>0){var y=Wo(d,-c);g=Go(y)}else g=d;return Ht(e,n,g)},GT=function(e,n,r,a,i,s,l,u){for(var c=new Array(r.length*2),d=0;d<u.length;d++){var f=u[d];c[d*4+0]=f.startX,c[d*4+1]=f.startY,c[d*4+2]=f.stopX,c[d*4+3]=f.stopY;var h=Math.pow(f.cx-e,2)+Math.pow(f.cy-n,2);if(h<=Math.pow(f.radius,2))return!0}return Ht(e,n,c)},Go=function(e){for(var n=new Array(e.length/2),r,a,i,s,l,u,c,d,f=0;f<e.length/4;f++){r=e[f*4],a=e[f*4+1],i=e[f*4+2],s=e[f*4+3],f<e.length/4-1?(l=e[(f+1)*4],u=e[(f+1)*4+1],c=e[(f+1)*4+2],d=e[(f+1)*4+3]):(l=e[0],u=e[1],c=e[2],d=e[3]);var h=lr(r,a,i,s,l,u,c,d,!0);n[f*2]=h[0],n[f*2+1]=h[1]}return n},Wo=function(e,n){for(var r=new Array(e.length*2),a,i,s,l,u=0;u<e.length/2;u++){a=e[u*2],i=e[u*2+1],u<e.length/2-1?(s=e[(u+1)*2],l=e[(u+1)*2+1]):(s=e[0],l=e[1]);var c=l-i,d=-(s-a),f=Math.sqrt(c*c+d*d),h=c/f,v=d/f;r[u*4]=a+h*n,r[u*4+1]=i+v*n,r[u*4+2]=s+h*n,r[u*4+3]=l+v*n}return r},WT=function(e,n,r,a,i,s){var l=r-e,u=a-n;l/=i,u/=s;var c=Math.sqrt(l*l+u*u),d=c-1;if(d<0)return[];var f=d/c;return[(r-e)*f+e,(a-n)*f+n]},Vr=function(e,n,r,a,i,s,l){return e-=i,n-=s,e/=r/2+l,n/=a/2+l,e*e+n*n<=1},Di=function(e,n,r,a,i,s,l){var u=[r-e,a-n],c=[e-i,n-s],d=u[0]*u[0]+u[1]*u[1],f=2*(c[0]*u[0]+c[1]*u[1]),h=c[0]*c[0]+c[1]*c[1]-l*l,v=f*f-4*d*h;if(v<0)return[];var p=(-f+Math.sqrt(v))/(2*d),g=(-f-Math.sqrt(v))/(2*d),y=Math.min(p,g),m=Math.max(p,g),b=[];if(y>=0&&y<=1&&b.push(y),m>=0&&m<=1&&b.push(m),b.length===0)return[];var w=b[0]*u[0]+e,C=b[0]*u[1]+n;if(b.length>1){if(b[0]==b[1])return[w,C];var k=b[1]*u[0]+e,E=b[1]*u[1]+n;return[w,C,k,E]}else return[w,C]},Jl=function(e,n,r){return n<=e&&e<=r||r<=e&&e<=n?e:e<=n&&n<=r||r<=n&&n<=e?n:r},lr=function(e,n,r,a,i,s,l,u,c){var d=e-i,f=r-e,h=l-i,v=n-s,p=a-n,g=u-s,y=h*v-g*d,m=f*v-p*d,b=g*f-h*p;if(b!==0){var w=y/b,C=m/b,k=.001,E=0-k,x=1+k;return E<=w&&w<=x&&E<=C&&C<=x?[e+w*f,n+w*p]:c?[e+w*f,n+w*p]:[]}else return y===0||m===0?Jl(e,r,l)===l?[l,u]:Jl(e,r,i)===i?[i,s]:Jl(i,l,r)===r?[r,a]:[]:[]},_i=function(e,n,r,a,i,s,l,u){var c=[],d,f=new Array(r.length),h=!0;s==null&&(h=!1);var v;if(h){for(var p=0;p<f.length/2;p++)f[p*2]=r[p*2]*s+a,f[p*2+1]=r[p*2+1]*l+i;if(u>0){var g=Wo(f,-u);v=Go(g)}else v=f}else v=r;for(var y,m,b,w,C=0;C<v.length/2;C++)y=v[C*2],m=v[C*2+1],C<v.length/2-1?(b=v[(C+1)*2],w=v[(C+1)*2+1]):(b=v[0],w=v[1]),d=lr(e,n,a,i,y,m,b,w),d.length!==0&&c.push(d[0],d[1]);return c},jT=function(e,n,r,a,i,s,l,u,c){var d=[],f,h=new Array(r.length*2);c.forEach(function(b,w){w===0?(h[h.length-2]=b.startX,h[h.length-1]=b.startY):(h[w*4-2]=b.startX,h[w*4-1]=b.startY),h[w*4]=b.stopX,h[w*4+1]=b.stopY,f=Di(e,n,a,i,b.cx,b.cy,b.radius),f.length!==0&&d.push(f[0],f[1])});for(var v=0;v<h.length/4;v++)f=lr(e,n,a,i,h[v*4],h[v*4+1],h[v*4+2],h[v*4+3],!1),f.length!==0&&d.push(f[0],f[1]);if(d.length>2){for(var p=[d[0],d[1]],g=Math.pow(p[0]-e,2)+Math.pow(p[1]-n,2),y=1;y<d.length/2;y++){var m=Math.pow(d[y*2]-e,2)+Math.pow(d[y*2+1]-n,2);m<=g&&(p[0]=d[y*2],p[1]=d[y*2+1],g=m)}return p}return d},jo=function(e,n,r){var a=[e[0]-n[0],e[1]-n[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),s=(i-r)/i;return s<0&&(s=1e-5),[n[0]+s*a[0],n[1]+s*a[1]]},Mt=function(e,n){var r=ec(e,n);return r=kh(r),r},kh=function(e){for(var n,r,a=e.length/2,i=1/0,s=1/0,l=-1/0,u=-1/0,c=0;c<a;c++)n=e[2*c],r=e[2*c+1],i=Math.min(i,n),l=Math.max(l,n),s=Math.min(s,r),u=Math.max(u,r);for(var d=2/(l-i),f=2/(u-s),h=0;h<a;h++)n=e[2*h]=e[2*h]*d,r=e[2*h+1]=e[2*h+1]*f,i=Math.min(i,n),l=Math.max(l,n),s=Math.min(s,r),u=Math.max(u,r);if(s<-1)for(var v=0;v<a;v++)r=e[2*v+1]=e[2*v+1]+(-1-s);return e},ec=function(e,n){var r=1/e*2*Math.PI,a=e%2===0?Math.PI/2+r/2:Math.PI/2;a+=n;for(var i=new Array(e*2),s,l=0;l<e;l++)s=l*r+a,i[2*l]=Math.cos(s),i[2*l+1]=Math.sin(-s);return i},Rr=function(e,n){return Math.min(e/4,n/4,8)},xh=function(e,n){return Math.min(e/10,n/10,8)},tc=function(){return 8},YT=function(e,n,r){return[e-2*n+r,2*(n-e),e]},nc=function(e,n){return{heightOffset:Math.min(15,.05*n),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},ZT=wt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),XT={pageRank:function(e){for(var n=ZT(e),r=n.dampingFactor,a=n.precision,i=n.iterations,s=n.weight,l=this._private.cy,u=this.byGroup(),c=u.nodes,d=u.edges,f=c.length,h=f*f,v=d.length,p=new Array(h),g=new Array(f),y=(1-r)/f,m=0;m<f;m++){for(var b=0;b<f;b++){var w=m*f+b;p[w]=0}g[m]=0}for(var C=0;C<v;C++){var k=d[C],E=k.data("source"),x=k.data("target");if(E!==x){var B=c.indexOfId(E),S=c.indexOfId(x),N=s(k),D=S*f+B;p[D]+=N,g[B]+=N}}for(var _=1/f+y,I=0;I<f;I++)if(g[I]===0)for(var P=0;P<f;P++){var F=P*f+I;p[F]=_}else for(var O=0;O<f;O++){var M=O*f+I;p[M]=p[M]/g[I]+y}for(var L=new Array(f),V=new Array(f),H,$=0;$<f;$++)L[$]=1;for(var z=0;z<i;z++){for(var j=0;j<f;j++)V[j]=0;for(var ee=0;ee<f;ee++)for(var J=0;J<f;J++){var X=ee*f+J;V[ee]+=p[X]*L[J]}IT(V),H=L,L=V,V=H;for(var ne=0,Y=0;Y<f;Y++){var A=H[Y]-L[Y];ne+=A*A}if(ne<a)break}var K={rank:function(oe){return oe=l.collection(oe)[0],L[c.indexOf(oe)]}};return K}},Eh=wt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),wa={degreeCentralityNormalized:function(e){e=Eh(e);var n=this.cy(),r=this.nodes(),a=r.length;if(e.directed){for(var d={},f={},h=0,v=0,p=0;p<a;p++){var g=r[p],y=g.id();e.root=g;var m=this.degreeCentrality(e);h<m.indegree&&(h=m.indegree),v<m.outdegree&&(v=m.outdegree),d[y]=m.indegree,f[y]=m.outdegree}return{indegree:function(w){return h==0?0:(be(w)&&(w=n.filter(w)),d[w.id()]/h)},outdegree:function(w){return v===0?0:(be(w)&&(w=n.filter(w)),f[w.id()]/v)}}}else{for(var i={},s=0,l=0;l<a;l++){var u=r[l];e.root=u;var c=this.degreeCentrality(e);s<c.degree&&(s=c.degree),i[u.id()]=c.degree}return{degree:function(w){return s===0?0:(be(w)&&(w=n.filter(w)),i[w.id()]/s)}}}},degreeCentrality:function(e){e=Eh(e);var n=this.cy(),r=this,a=e,i=a.root,s=a.weight,l=a.directed,u=a.alpha;if(i=n.collection(i)[0],l){for(var v=i.connectedEdges(),p=v.filter(function(E){return E.target().same(i)&&r.has(E)}),g=v.filter(function(E){return E.source().same(i)&&r.has(E)}),y=p.length,m=g.length,b=0,w=0,C=0;C<p.length;C++)b+=s(p[C]);for(var k=0;k<g.length;k++)w+=s(g[k]);return{indegree:Math.pow(y,1-u)*Math.pow(b,u),outdegree:Math.pow(m,1-u)*Math.pow(w,u)}}else{for(var c=i.connectedEdges().intersection(r),d=c.length,f=0,h=0;h<c.length;h++)f+=s(c[h]);return{degree:Math.pow(d,1-u)*Math.pow(f,u)}}}};wa.dc=wa.degreeCentrality,wa.dcn=wa.degreeCentralityNormalised=wa.degreeCentralityNormalized;var Sh=wt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Ca={closenessCentralityNormalized:function(e){for(var n=Sh(e),r=n.harmonic,a=n.weight,i=n.directed,s=this.cy(),l={},u=0,c=this.nodes(),d=this.floydWarshall({weight:a,directed:i}),f=0;f<c.length;f++){for(var h=0,v=c[f],p=0;p<c.length;p++)if(f!==p){var g=d.distance(v,c[p]);r?h+=1/g:h+=g}r||(h=1/h),u<h&&(u=h),l[v.id()]=h}return{closeness:function(m){return u==0?0:(be(m)?m=s.filter(m)[0].id():m=m.id(),l[m]/u)}}},closenessCentrality:function(e){var n=Sh(e),r=n.root,a=n.weight,i=n.directed,s=n.harmonic;r=this.filter(r)[0];for(var l=this.dijkstra({root:r,weight:a,directed:i}),u=0,c=this.nodes(),d=0;d<c.length;d++){var f=c[d];if(!f.same(r)){var h=l.distanceTo(f);s?u+=1/h:u+=h}}return s?u:1/u}};Ca.cc=Ca.closenessCentrality,Ca.ccn=Ca.closenessCentralityNormalised=Ca.closenessCentralityNormalized;var QT=wt({weight:null,directed:!1}),rc={betweennessCentrality:function(e){for(var n=QT(e),r=n.directed,a=n.weight,i=a!=null,s=this.cy(),l=this.nodes(),u={},c={},d=0,f={set:function(w,C){c[w]=C,C>d&&(d=C)},get:function(w){return c[w]}},h=0;h<l.length;h++){var v=l[h],p=v.id();r?u[p]=v.outgoers().nodes():u[p]=v.openNeighborhood().nodes(),f.set(p,0)}for(var g=function(w){for(var C=l[w].id(),k=[],E={},x={},B={},S=new Bi(function(J,X){return B[J]-B[X]}),N=0;N<l.length;N++){var D=l[N].id();E[D]=[],x[D]=0,B[D]=1/0}for(x[C]=1,B[C]=0,S.push(C);!S.empty();){var _=S.pop();if(k.push(_),i)for(var I=0;I<u[_].length;I++){var P=u[_][I],F=s.getElementById(_),O=void 0;F.edgesTo(P).length>0?O=F.edgesTo(P)[0]:O=P.edgesTo(F)[0];var M=a(O);P=P.id(),B[P]>B[_]+M&&(B[P]=B[_]+M,S.nodes.indexOf(P)<0?S.push(P):S.updateItem(P),x[P]=0,E[P]=[]),B[P]==B[_]+M&&(x[P]=x[P]+x[_],E[P].push(_))}else for(var L=0;L<u[_].length;L++){var V=u[_][L].id();B[V]==1/0&&(S.push(V),B[V]=B[_]+1),B[V]==B[_]+1&&(x[V]=x[V]+x[_],E[V].push(_))}}for(var H={},$=0;$<l.length;$++)H[l[$].id()]=0;for(;k.length>0;){for(var z=k.pop(),j=0;j<E[z].length;j++){var ee=E[z][j];H[ee]=H[ee]+x[ee]/x[z]*(1+H[z])}z!=l[w].id()&&f.set(z,f.get(z)+H[z])}},y=0;y<l.length;y++)g(y);var m={betweenness:function(w){var C=s.collection(w).id();return f.get(C)},betweennessNormalized:function(w){if(d==0)return 0;var C=s.collection(w).id();return f.get(C)/d}};return m.betweennessNormalised=m.betweennessNormalized,m}};rc.bc=rc.betweennessCentrality;var JT=wt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),eB=function(e){return JT(e)},tB=function(e,n){for(var r=0,a=0;a<n.length;a++)r+=n[a](e);return r},nB=function(e,n,r){for(var a=0;a<n;a++)e[a*n+a]=r},Th=function(e,n){for(var r,a=0;a<n;a++){r=0;for(var i=0;i<n;i++)r+=e[i*n+a];for(var s=0;s<n;s++)e[s*n+a]=e[s*n+a]/r}},rB=function(e,n,r){for(var a=new Array(r*r),i=0;i<r;i++){for(var s=0;s<r;s++)a[i*r+s]=0;for(var l=0;l<r;l++)for(var u=0;u<r;u++)a[i*r+u]+=e[i*r+l]*n[l*r+u]}return a},aB=function(e,n,r){for(var a=e.slice(0),i=1;i<r;i++)e=rB(e,a,n);return e},iB=function(e,n,r){for(var a=new Array(n*n),i=0;i<n*n;i++)a[i]=Math.pow(e[i],r);return Th(a,n),a},oB=function(e,n,r,a){for(var i=0;i<r;i++){var s=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),l=Math.round(n[i]*Math.pow(10,a))/Math.pow(10,a);if(s!==l)return!1}return!0},sB=function(e,n,r,a){for(var i=[],s=0;s<n;s++){for(var l=[],u=0;u<n;u++)Math.round(e[s*n+u]*1e3)/1e3>0&&l.push(r[u]);l.length!==0&&i.push(a.collection(l))}return i},lB=function(e,n){for(var r=0;r<e.length;r++)if(!n[r]||e[r].id()!==n[r].id())return!1;return!0},cB=function(e){for(var n=0;n<e.length;n++)for(var r=0;r<e.length;r++)n!=r&&lB(e[n],e[r])&&e.splice(r,1);return e},Bh=function(e){for(var n=this.nodes(),r=this.edges(),a=this.cy(),i=eB(e),s={},l=0;l<n.length;l++)s[n[l].id()]=l;for(var u=n.length,c=u*u,d=new Array(c),f,h=0;h<c;h++)d[h]=0;for(var v=0;v<r.length;v++){var p=r[v],g=s[p.source().id()],y=s[p.target().id()],m=tB(p,i.attributes);d[g*u+y]+=m,d[y*u+g]+=m}nB(d,u,i.multFactor),Th(d,u);for(var b=!0,w=0;b&&w<i.maxIterations;)b=!1,f=aB(d,u,i.expandFactor),d=iB(f,u,i.inflateFactor),oB(d,f,c,4)||(b=!0),w++;var C=sB(d,u,n,a);return C=cB(C),C},uB={markovClustering:Bh,mcl:Bh},dB=function(e){return e},Nh=function(e,n){return Math.abs(n-e)},Dh=function(e,n,r){return e+Nh(n,r)},_h=function(e,n,r){return e+Math.pow(r-n,2)},fB=function(e){return Math.sqrt(e)},hB=function(e,n,r){return Math.max(e,Nh(n,r))},Pi=function(e,n,r,a,i){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:dB,l=a,u,c,d=0;d<e;d++)u=n(d),c=r(d),l=i(l,u,c);return s(l)},ka={euclidean:function(e,n,r){return e>=2?Pi(e,n,r,0,_h,fB):Pi(e,n,r,0,Dh)},squaredEuclidean:function(e,n,r){return Pi(e,n,r,0,_h)},manhattan:function(e,n,r){return Pi(e,n,r,0,Dh)},max:function(e,n,r){return Pi(e,n,r,-1/0,hB)}};ka["squared-euclidean"]=ka.squaredEuclidean,ka.squaredeuclidean=ka.squaredEuclidean;function Yo(t,e,n,r,a,i){var s;return Ye(t)?s=t:s=ka[t]||ka.euclidean,e===0&&Ye(t)?s(a,i):s(e,n,r,a,i)}var pB=wt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),ac=function(e){return pB(e)},Zo=function(e,n,r,a,i){var s=i!=="kMedoids",l=s?function(f){return r[f]}:function(f){return a[f](r)},u=function(h){return a[h](n)},c=r,d=n;return Yo(e,a.length,l,u,c,d)},ic=function(e,n,r){for(var a=r.length,i=new Array(a),s=new Array(a),l=new Array(n),u=null,c=0;c<a;c++)i[c]=e.min(r[c]).value,s[c]=e.max(r[c]).value;for(var d=0;d<n;d++){u=[];for(var f=0;f<a;f++)u[f]=Math.random()*(s[f]-i[f])+i[f];l[d]=u}return l},Ph=function(e,n,r,a,i){for(var s=1/0,l=0,u=0;u<n.length;u++){var c=Zo(r,e,n[u],a,i);c<s&&(s=c,l=u)}return l},Oh=function(e,n,r){for(var a=[],i=null,s=0;s<n.length;s++)i=n[s],r[i.id()]===e&&a.push(i);return a},vB=function(e,n,r){return Math.abs(n-e)<=r},gB=function(e,n,r){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var s=Math.abs(e[a][i]-n[a][i]);if(s>r)return!1}return!0},mB=function(e,n,r){for(var a=0;a<r;a++)if(e===n[a])return!0;return!1},Ih=function(e,n){var r=new Array(n);if(e.length<50)for(var a=0;a<n;a++){for(var i=e[Math.floor(Math.random()*e.length)];mB(i,r,a);)i=e[Math.floor(Math.random()*e.length)];r[a]=i}else for(var s=0;s<n;s++)r[s]=e[Math.floor(Math.random()*e.length)];return r},Lh=function(e,n,r){for(var a=0,i=0;i<n.length;i++)a+=Zo("manhattan",n[i],e,r,"kMedoids");return a},yB=function(e){var n=this.cy(),r=this.nodes(),a=null,i=ac(e),s=new Array(i.k),l={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=ic(r,i.k,i.attributes)):st(i.testCentroids)==="object"?u=i.testCentroids:u=ic(r,i.k,i.attributes):u=ic(r,i.k,i.attributes);for(var c=!0,d=0;c&&d<i.maxIterations;){for(var f=0;f<r.length;f++)a=r[f],l[a.id()]=Ph(a,u,i.distance,i.attributes,"kMeans");c=!1;for(var h=0;h<i.k;h++){var v=Oh(h,r,l);if(v.length!==0){for(var p=i.attributes.length,g=u[h],y=new Array(p),m=new Array(p),b=0;b<p;b++){m[b]=0;for(var w=0;w<v.length;w++)a=v[w],m[b]+=i.attributes[b](a);y[b]=m[b]/v.length,vB(y[b],g[b],i.sensitivityThreshold)||(c=!0)}u[h]=y,s[h]=n.collection(v)}}d++}return s},bB=function(e){var n=this.cy(),r=this.nodes(),a=null,i=ac(e),s=new Array(i.k),l,u={},c,d=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(st(i.testCentroids)==="object"?l=i.testCentroids:l=Ih(r,i.k)):l=Ih(r,i.k);for(var f=!0,h=0;f&&h<i.maxIterations;){for(var v=0;v<r.length;v++)a=r[v],u[a.id()]=Ph(a,l,i.distance,i.attributes,"kMedoids");f=!1;for(var p=0;p<l.length;p++){var g=Oh(p,r,u);if(g.length!==0){d[p]=Lh(l[p],g,i.attributes);for(var y=0;y<g.length;y++)c=Lh(g[y],g,i.attributes),c<d[p]&&(d[p]=c,l[p]=g[y],f=!0);s[p]=n.collection(g)}}h++}return s},wB=function(e,n,r,a,i){for(var s,l,u=0;u<n.length;u++)for(var c=0;c<e.length;c++)a[u][c]=Math.pow(r[u][c],i.m);for(var d=0;d<e.length;d++)for(var f=0;f<i.attributes.length;f++){s=0,l=0;for(var h=0;h<n.length;h++)s+=a[h][d]*i.attributes[f](n[h]),l+=a[h][d];e[d][f]=s/l}},CB=function(e,n,r,a,i){for(var s=0;s<e.length;s++)n[s]=e[s].slice();for(var l,u,c,d=2/(i.m-1),f=0;f<r.length;f++)for(var h=0;h<a.length;h++){l=0;for(var v=0;v<r.length;v++)u=Zo(i.distance,a[h],r[f],i.attributes,"cmeans"),c=Zo(i.distance,a[h],r[v],i.attributes,"cmeans"),l+=Math.pow(u/c,d);e[h][f]=1/l}},kB=function(e,n,r,a){for(var i=new Array(r.k),s=0;s<i.length;s++)i[s]=[];for(var l,u,c=0;c<n.length;c++){l=-1/0,u=-1;for(var d=0;d<n[0].length;d++)n[c][d]>l&&(l=n[c][d],u=d);i[u].push(e[c])}for(var f=0;f<i.length;f++)i[f]=a.collection(i[f]);return i},Mh=function(e){var n=this.cy(),r=this.nodes(),a=ac(e),i,s,l,u,c;u=new Array(r.length);for(var d=0;d<r.length;d++)u[d]=new Array(a.k);l=new Array(r.length);for(var f=0;f<r.length;f++)l[f]=new Array(a.k);for(var h=0;h<r.length;h++){for(var v=0,p=0;p<a.k;p++)l[h][p]=Math.random(),v+=l[h][p];for(var g=0;g<a.k;g++)l[h][g]=l[h][g]/v}s=new Array(a.k);for(var y=0;y<a.k;y++)s[y]=new Array(a.attributes.length);c=new Array(r.length);for(var m=0;m<r.length;m++)c[m]=new Array(a.k);for(var b=!0,w=0;b&&w<a.maxIterations;)b=!1,wB(s,r,l,c,a),CB(l,u,s,r,a),gB(l,u,a.sensitivityThreshold)||(b=!0),w++;return i=kB(r,l,a,n),{clusters:i,degreeOfMembership:l}},xB={kMeans:yB,kMedoids:bB,fuzzyCMeans:Mh,fcm:Mh},EB=wt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),SB={single:"min",complete:"max"},TB=function(e){var n=EB(e),r=SB[n.linkage];return r!=null&&(n.linkage=r),n},Fh=function(e,n,r,a,i){for(var s=0,l=1/0,u,c=i.attributes,d=function(S,N){return Yo(i.distance,c.length,function(D){return c[D](S)},function(D){return c[D](N)},S,N)},f=0;f<e.length;f++){var h=e[f].key,v=r[h][a[h]];v<l&&(s=h,l=v)}if(i.mode==="threshold"&&l>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var p=n[s],g=n[a[s]],y;i.mode==="dendrogram"?y={left:p,right:g,key:p.key}:y={value:p.value.concat(g.value),key:p.key},e[p.index]=y,e.splice(g.index,1),n[p.key]=y;for(var m=0;m<e.length;m++){var b=e[m];p.key===b.key?u=1/0:i.linkage==="min"?(u=r[p.key][b.key],r[p.key][b.key]>r[g.key][b.key]&&(u=r[g.key][b.key])):i.linkage==="max"?(u=r[p.key][b.key],r[p.key][b.key]<r[g.key][b.key]&&(u=r[g.key][b.key])):i.linkage==="mean"?u=(r[p.key][b.key]*p.size+r[g.key][b.key]*g.size)/(p.size+g.size):i.mode==="dendrogram"?u=d(b.value,p.value):u=d(b.value[0],p.value[0]),r[p.key][b.key]=r[b.key][p.key]=u}for(var w=0;w<e.length;w++){var C=e[w].key;if(a[C]===p.key||a[C]===g.key){for(var k=C,E=0;E<e.length;E++){var x=e[E].key;r[C][x]<r[C][k]&&(k=x)}a[C]=k}e[w].index=w}return p.key=g.key=p.index=g.index=null,!0},Xo=function t(e,n,r){e&&(e.value?n.push(e.value):(e.left&&t(e.left,n),e.right&&t(e.right,n)))},BB=function t(e,n){if(!e)return"";if(e.left&&e.right){var r=t(e.left,n),a=t(e.right,n),i=n.add({group:"nodes",data:{id:r+","+a}});return n.add({group:"edges",data:{source:r,target:i.id()}}),n.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},NB=function t(e,n,r){if(!e)return[];var a=[],i=[],s=[];return n===0?(e.left&&Xo(e.left,a),e.right&&Xo(e.right,i),s=a.concat(i),[r.collection(s)]):n===1?e.value?[r.collection(e.value)]:(e.left&&Xo(e.left,a),e.right&&Xo(e.right,i),[r.collection(a),r.collection(i)]):e.value?[r.collection(e.value)]:(e.left&&(a=t(e.left,n-1,r)),e.right&&(i=t(e.right,n-1,r)),a.concat(i))},Ah=function(e){for(var n=this.cy(),r=this.nodes(),a=TB(e),i=a.attributes,s=function(w,C){return Yo(a.distance,i.length,function(k){return i[k](w)},function(k){return i[k](C)},w,C)},l=[],u=[],c=[],d=[],f=0;f<r.length;f++){var h={value:a.mode==="dendrogram"?r[f]:[r[f]],key:f,index:f};l[f]=h,d[f]=h,u[f]=[],c[f]=0}for(var v=0;v<l.length;v++)for(var p=0;p<=v;p++){var g=void 0;a.mode==="dendrogram"?g=v===p?1/0:s(l[v].value,l[p].value):g=v===p?1/0:s(l[v].value[0],l[p].value[0]),u[v][p]=g,u[p][v]=g,g<u[v][c[v]]&&(c[v]=p)}for(var y=Fh(l,d,u,c,a);y;)y=Fh(l,d,u,c,a);var m;return a.mode==="dendrogram"?(m=NB(l[0],a.dendrogramDepth,n),a.addDendrogram&&BB(l[0],n)):(m=new Array(l.length),l.forEach(function(b,w){b.key=b.index=null,m[w]=n.collection(b.value)})),m},DB={hierarchicalClustering:Ah,hca:Ah},_B=wt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),PB=function(e){var n=e.damping,r=e.preference;.5<=n&&n<1||Ze("Damping must range on [0.5, 1). Got: ".concat(n));var a=["median","mean","min","max"];return a.some(function(i){return i===r})||le(r)||Ze("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(r)),_B(e)},OB=function(e,n,r,a){var i=function(l,u){return a[u](l)};return-Yo(e,a.length,function(s){return i(n,s)},function(s){return i(r,s)},n,r)},IB=function(e,n){var r=null;return n==="median"?r=PT(e):n==="mean"?r=_T(e):n==="min"?r=NT(e):n==="max"?r=DT(e):r=n,r},LB=function(e,n,r){for(var a=[],i=0;i<e;i++)n[i*e+i]+r[i*e+i]>0&&a.push(i);return a},Vh=function(e,n,r){for(var a=[],i=0;i<e;i++){for(var s=-1,l=-1/0,u=0;u<r.length;u++){var c=r[u];n[i*e+c]>l&&(s=c,l=n[i*e+c])}s>0&&a.push(s)}for(var d=0;d<r.length;d++)a[r[d]]=r[d];return a},MB=function(e,n,r){for(var a=Vh(e,n,r),i=0;i<r.length;i++){for(var s=[],l=0;l<a.length;l++)a[l]===r[i]&&s.push(l);for(var u=-1,c=-1/0,d=0;d<s.length;d++){for(var f=0,h=0;h<s.length;h++)f+=n[s[h]*e+s[d]];f>c&&(u=d,c=f)}r[i]=s[u]}return a=Vh(e,n,r),a},Rh=function(e){for(var n=this.cy(),r=this.nodes(),a=PB(e),i={},s=0;s<r.length;s++)i[r[s].id()]=s;var l,u,c,d,f,h;l=r.length,u=l*l,c=new Array(u);for(var v=0;v<u;v++)c[v]=-1/0;for(var p=0;p<l;p++)for(var g=0;g<l;g++)p!==g&&(c[p*l+g]=OB(a.distance,r[p],r[g],a.attributes));d=IB(c,a.preference);for(var y=0;y<l;y++)c[y*l+y]=d;f=new Array(u);for(var m=0;m<u;m++)f[m]=0;h=new Array(u);for(var b=0;b<u;b++)h[b]=0;for(var w=new Array(l),C=new Array(l),k=new Array(l),E=0;E<l;E++)w[E]=0,C[E]=0,k[E]=0;for(var x=new Array(l*a.minIterations),B=0;B<x.length;B++)x[B]=0;var S;for(S=0;S<a.maxIterations;S++){for(var N=0;N<l;N++){for(var D=-1/0,_=-1/0,I=-1,P=0,F=0;F<l;F++)w[F]=f[N*l+F],P=h[N*l+F]+c[N*l+F],P>=D?(_=D,D=P,I=F):P>_&&(_=P);for(var O=0;O<l;O++)f[N*l+O]=(1-a.damping)*(c[N*l+O]-D)+a.damping*w[O];f[N*l+I]=(1-a.damping)*(c[N*l+I]-_)+a.damping*w[I]}for(var M=0;M<l;M++){for(var L=0,V=0;V<l;V++)w[V]=h[V*l+M],C[V]=Math.max(0,f[V*l+M]),L+=C[V];L-=C[M],C[M]=f[M*l+M],L+=C[M];for(var H=0;H<l;H++)h[H*l+M]=(1-a.damping)*Math.min(0,L-C[H])+a.damping*w[H];h[M*l+M]=(1-a.damping)*(L-C[M])+a.damping*w[M]}for(var $=0,z=0;z<l;z++){var j=h[z*l+z]+f[z*l+z]>0?1:0;x[S%a.minIterations*l+z]=j,$+=j}if($>0&&(S>=a.minIterations-1||S==a.maxIterations-1)){for(var ee=0,J=0;J<l;J++){k[J]=0;for(var X=0;X<a.minIterations;X++)k[J]+=x[X*l+J];(k[J]===0||k[J]===a.minIterations)&&ee++}if(ee===l)break}}for(var ne=LB(l,f,h),Y=MB(l,c,ne),A={},K=0;K<ne.length;K++)A[ne[K]]=[];for(var W=0;W<r.length;W++){var oe=i[r[W].id()],he=Y[oe];he!=null&&A[he].push(r[W])}for(var re=new Array(ne.length),se=0;se<ne.length;se++)re[se]=n.collection(A[ne[se]]);return re},FB={affinityPropagation:Rh,ap:Rh},AB=wt({root:void 0,directed:!1}),VB={hierholzer:function(e){if(!Oe(e)){var n=arguments;e={root:n[0],directed:n[1]}}var r=AB(e),a=r.root,i=r.directed,s=this,l=!1,u,c,d;a&&(d=be(a)?this.filter(a)[0].id():a[0].id());var f={},h={};i?s.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.indegree(!0),k=b.outdegree(!0),E=C-k,x=k-C;E==1?u?l=!0:u=w:x==1?c?l=!0:c=w:(x>1||E>1)&&(l=!0),f[w]=[],b.outgoers().forEach(function(B){B.isEdge()&&f[w].push(B.id())})}else h[w]=[void 0,b.target().id()]}):s.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.degree(!0);C%2&&(u?c?l=!0:c=w:u=w),f[w]=[],b.connectedEdges().forEach(function(k){return f[w].push(k.id())})}else h[w]=[b.source().id(),b.target().id()]});var v={found:!1,trail:void 0};if(l)return v;if(c&&u)if(i){if(d&&c!=d)return v;d=c}else{if(d&&c!=d&&u!=d)return v;d||(d=c)}else d||(d=s[0].id());var p=function(w){for(var C=w,k=[w],E,x,B;f[C].length;)E=f[C].shift(),x=h[E][0],B=h[E][1],C!=B?(f[B]=f[B].filter(function(S){return S!=E}),C=B):!i&&C!=x&&(f[x]=f[x].filter(function(S){return S!=E}),C=x),k.unshift(E),k.unshift(C);return k},g=[],y=[];for(y=p(d);y.length!=1;)f[y[0]].length==0?(g.unshift(s.getElementById(y.shift())),g.unshift(s.getElementById(y.shift()))):y=p(y.shift()).concat(y);g.unshift(s.getElementById(y.shift()));for(var m in f)if(f[m].length)return v;return v.found=!0,v.trail=this.spawn(g,!0),v}},Qo=function(){var e=this,n={},r=0,a=0,i=[],s=[],l={},u=function(h,v){for(var p=s.length-1,g=[],y=e.spawn();s[p].x!=h||s[p].y!=v;)g.push(s.pop().edge),p--;g.push(s.pop().edge),g.forEach(function(m){var b=m.connectedNodes().intersection(e);y.merge(m),b.forEach(function(w){var C=w.id(),k=w.connectedEdges().intersection(e);y.merge(w),n[C].cutVertex?y.merge(k.filter(function(E){return E.isLoop()})):y.merge(k)})}),i.push(y)},c=function f(h,v,p){h===p&&(a+=1),n[v]={id:r,low:r++,cutVertex:!1};var g=e.getElementById(v).connectedEdges().intersection(e);if(g.size()===0)i.push(e.spawn(e.getElementById(v)));else{var y,m,b,w;g.forEach(function(C){y=C.source().id(),m=C.target().id(),b=y===v?m:y,b!==p&&(w=C.id(),l[w]||(l[w]=!0,s.push({x:v,y:b,edge:C})),b in n?n[v].low=Math.min(n[v].low,n[b].id):(f(h,b,v),n[v].low=Math.min(n[v].low,n[b].low),n[v].id<=n[b].low&&(n[v].cutVertex=!0,u(v,b))))})}};e.forEach(function(f){if(f.isNode()){var h=f.id();h in n||(a=0,c(h,h),n[h].cutVertex=a>1)}});var d=Object.keys(n).filter(function(f){return n[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(d),components:i}},RB={hopcroftTarjanBiconnected:Qo,htbc:Qo,htb:Qo,hopcroftTarjanBiconnectedComponents:Qo},Jo=function(){var e=this,n={},r=0,a=[],i=[],s=e.spawn(e),l=function u(c){i.push(c),n[c]={index:r,low:r++,explored:!1};var d=e.getElementById(c).connectedEdges().intersection(e);if(d.forEach(function(g){var y=g.target().id();y!==c&&(y in n||u(y),n[y].explored||(n[c].low=Math.min(n[c].low,n[y].low)))}),n[c].index===n[c].low){for(var f=e.spawn();;){var h=i.pop();if(f.merge(e.getElementById(h)),n[h].low=n[c].index,n[h].explored=!0,h===c)break}var v=f.edgesWith(f),p=f.merge(v);a.push(p),s=s.difference(p)}};return e.forEach(function(u){if(u.isNode()){var c=u.id();c in n||l(c)}}),{cut:s,components:a}},$B={tarjanStronglyConnected:Jo,tsc:Jo,tscc:Jo,tarjanStronglyConnectedComponents:Jo},$h={};[Ti,gT,mT,bT,CT,xT,TT,XT,wa,Ca,rc,uB,xB,DB,FB,VB,RB,$B].forEach(function(t){xe($h,t)});/*!
|
|
31
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,l;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return i=u.done,u},e:function(u){s=!0,l=u},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(s)throw l}}}}var lt=typeof window>"u"?null:window,Uf=lt?lt.navigator:null;lt&<.document;var YE=st(""),Gf=st({}),ZE=st(function(){}),XE=typeof HTMLElement>"u"?"undefined":st(HTMLElement),mi=function(e){return e&&e.instanceString&&Ye(e.instanceString)?e.instanceString():null},be=function(e){return e!=null&&st(e)==YE},Ye=function(e){return e!=null&&st(e)===ZE},Ke=function(e){return!Gt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Ie=function(e){return e!=null&&st(e)===Gf&&!Ke(e)&&e.constructor===Object},QE=function(e){return e!=null&&st(e)===Gf},le=function(e){return e!=null&&st(e)===st(1)&&!isNaN(e)},JE=function(e){return le(e)&&Math.floor(e)===e},Lo=function(e){if(XE!=="undefined")return e!=null&&e instanceof HTMLElement},Gt=function(e){return yi(e)||Wf(e)},yi=function(e){return mi(e)==="collection"&&e._private.single},Wf=function(e){return mi(e)==="collection"&&!e._private.single},Kl=function(e){return mi(e)==="core"},jf=function(e){return mi(e)==="stylesheet"},eS=function(e){return mi(e)==="event"},ar=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},tS=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},nS=function(e){return Ie(e)&&le(e.x1)&&le(e.x2)&&le(e.y1)&&le(e.y2)},rS=function(e){return QE(e)&&Ye(e.then)},aS=function(){return Uf&&Uf.userAgent.match(/msie|trident|edge/i)},bi=function(e,n){n||(n=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")});var r=function a(){var i=this,s=arguments,l,u=n.apply(i,s),c=a.cache;return(l=c[u])||(l=c[u]=e.apply(i,s)),l};return r.cache={},r},ql=bi(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Mo=bi(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Yf=bi(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),Zf=function(e){return ar(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},ct="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",iS="rgb[a]?\\(("+ct+"[%]?)\\s*,\\s*("+ct+"[%]?)\\s*,\\s*("+ct+"[%]?)(?:\\s*,\\s*("+ct+"))?\\)",oS="rgb[a]?\\((?:"+ct+"[%]?)\\s*,\\s*(?:"+ct+"[%]?)\\s*,\\s*(?:"+ct+"[%]?)(?:\\s*,\\s*(?:"+ct+"))?\\)",sS="hsl[a]?\\(("+ct+")\\s*,\\s*("+ct+"[%])\\s*,\\s*("+ct+"[%])(?:\\s*,\\s*("+ct+"))?\\)",lS="hsl[a]?\\((?:"+ct+")\\s*,\\s*(?:"+ct+"[%])\\s*,\\s*(?:"+ct+"[%])(?:\\s*,\\s*(?:"+ct+"))?\\)",cS="\\#[0-9a-fA-F]{3}",uS="\\#[0-9a-fA-F]{6}",Xf=function(e,n){return e<n?-1:e>n?1:0},dS=function(e,n){return-1*Xf(e,n)},xe=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,n=1;n<e.length;n++){var r=e[n];if(r!=null)for(var a=Object.keys(r),i=0;i<a.length;i++){var s=a[i];t[s]=r[s]}}return t},fS=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var n=e.length===4,r,a,i,s=16;return n?(r=parseInt(e[1]+e[1],s),a=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s)):(r=parseInt(e[1]+e[2],s),a=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s)),[r,a,i]}},hS=function(e){var n,r,a,i,s,l,u,c;function d(p,g,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?p+(g-p)*6*y:y<1/2?g:y<2/3?p+(g-p)*(2/3-y)*6:p}var f=new RegExp("^"+sS+"$").exec(e);if(f){if(r=parseInt(f[1]),r<0?r=(360- -1*r%360)%360:r>360&&(r=r%360),r/=360,a=parseFloat(f[2]),a<0||a>100||(a=a/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,s=f[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(a===0)l=u=c=Math.round(i*255);else{var h=i<.5?i*(1+a):i+a-i*a,v=2*i-h;l=Math.round(255*d(v,h,r+1/3)),u=Math.round(255*d(v,h,r)),c=Math.round(255*d(v,h,r-1/3))}n=[l,u,c,s]}return n},pS=function(e){var n,r=new RegExp("^"+iS+"$").exec(e);if(r){n=[];for(var a=[],i=1;i<=3;i++){var s=r[i];if(s[s.length-1]==="%"&&(a[i]=!0),s=parseFloat(s),a[i]&&(s=s/100*255),s<0||s>255)return;n.push(Math.floor(s))}var l=a[1]||a[2]||a[3],u=a[1]&&a[2]&&a[3];if(l&&!u)return;var c=r[4];if(c!==void 0){if(c=parseFloat(c),c<0||c>1)return;n.push(c)}}return n},vS=function(e){return mS[e.toLowerCase()]},gS=function(e){return(Ke(e)?e:null)||vS(e)||fS(e)||pS(e)||hS(e)},mS={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Qf=function(e){for(var n=e.map,r=e.keys,a=r.length,i=0;i<a;i++){var s=r[i];if(Ie(s))throw Error("Tried to set map with object key");i<r.length-1?(n[s]==null&&(n[s]={}),n=n[s]):n[s]=e.value}},Jf=function(e){for(var n=e.map,r=e.keys,a=r.length,i=0;i<a;i++){var s=r[i];if(Ie(s))throw Error("Tried to get map with object key");if(n=n[s],n==null)return n}return n};function yS(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Lr=yS,wi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bS(t,e){return e={exports:{}},t(e,e.exports),e.exports}var wS=typeof wi=="object"&&wi&&wi.Object===Object&&wi,CS=wS,kS=typeof self=="object"&&self&&self.Object===Object&&self,xS=CS||kS||Function("return this")(),Fo=xS,ES=function(){return Fo.Date.now()},Ul=ES,SS=/\s/;function TS(t){for(var e=t.length;e--&&SS.test(t.charAt(e)););return e}var BS=TS,NS=/^\s+/;function DS(t){return t&&t.slice(0,BS(t)+1).replace(NS,"")}var _S=DS,PS=Fo.Symbol,va=PS,eh=Object.prototype,IS=eh.hasOwnProperty,OS=eh.toString,Ci=va?va.toStringTag:void 0;function LS(t){var e=IS.call(t,Ci),n=t[Ci];try{t[Ci]=void 0;var r=!0}catch{}var a=OS.call(t);return r&&(e?t[Ci]=n:delete t[Ci]),a}var MS=LS,FS=Object.prototype,AS=FS.toString;function VS(t){return AS.call(t)}var RS=VS,$S="[object Null]",zS="[object Undefined]",th=va?va.toStringTag:void 0;function HS(t){return t==null?t===void 0?zS:$S:th&&th in Object(t)?MS(t):RS(t)}var nh=HS;function KS(t){return t!=null&&typeof t=="object"}var qS=KS,US="[object Symbol]";function GS(t){return typeof t=="symbol"||qS(t)&&nh(t)==US}var ki=GS,rh=NaN,WS=/^[-+]0x[0-9a-f]+$/i,jS=/^0b[01]+$/i,YS=/^0o[0-7]+$/i,ZS=parseInt;function XS(t){if(typeof t=="number")return t;if(ki(t))return rh;if(Lr(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Lr(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=_S(t);var n=jS.test(t);return n||YS.test(t)?ZS(t.slice(2),n?2:8):WS.test(t)?rh:+t}var ah=XS,QS="Expected a function",JS=Math.max,eT=Math.min;function tT(t,e,n){var r,a,i,s,l,u,c=0,d=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(QS);e=ah(e)||0,Lr(n)&&(d=!!n.leading,f="maxWait"in n,i=f?JS(ah(n.maxWait)||0,e):i,h="trailing"in n?!!n.trailing:h);function v(x){var k=r,B=a;return r=a=void 0,c=x,s=t.apply(B,k),s}function p(x){return c=x,l=setTimeout(m,e),d?v(x):s}function g(x){var k=x-u,B=x-c,S=e-k;return f?eT(S,i-B):S}function y(x){var k=x-u,B=x-c;return u===void 0||k>=e||k<0||f&&B>=i}function m(){var x=Ul();if(y(x))return b(x);l=setTimeout(m,g(x))}function b(x){return l=void 0,h&&r?v(x):(r=a=void 0,s)}function w(){l!==void 0&&clearTimeout(l),c=0,r=u=a=l=void 0}function C(){return l===void 0?s:b(Ul())}function E(){var x=Ul(),k=y(x);if(r=arguments,a=this,u=x,k){if(l===void 0)return p(u);if(f)return clearTimeout(l),l=setTimeout(m,e),v(u)}return l===void 0&&(l=setTimeout(m,e)),s}return E.cancel=w,E.flush=C,E}var Ao=tT,Gl=lt?lt.performance:null,ih=Gl&&Gl.now?function(){return Gl.now()}:function(){return Date.now()},nT=function(){if(lt){if(lt.requestAnimationFrame)return function(t){lt.requestAnimationFrame(t)};if(lt.mozRequestAnimationFrame)return function(t){lt.mozRequestAnimationFrame(t)};if(lt.webkitRequestAnimationFrame)return function(t){lt.webkitRequestAnimationFrame(t)};if(lt.msRequestAnimationFrame)return function(t){lt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(ih())},1e3/60)}}(),Vo=function(e){return nT(e)},Rn=ih,ga=9261,oh=65599,xi=5381,sh=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ga,r=n,a;a=e.next(),!a.done;)r=r*oh+a.value|0;return r},Ei=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ga;return n*oh+e|0},Si=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xi;return(n<<5)+n+e|0},rT=function(e,n){return e*2097152+n},ir=function(e){return e[0]*2097152+e[1]},Ro=function(e,n){return[Ei(e[0],n[0]),Si(e[1],n[1])]},aT=function(e,n){var r={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?r.value=e[a++]:r.done=!0,r}};return sh(s,n)},Mr=function(e,n){var r={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?r.value=e.charCodeAt(a++):r.done=!0,r}};return sh(s,n)},lh=function(){return iT(arguments)},iT=function(e){for(var n,r=0;r<e.length;r++){var a=e[r];r===0?n=Mr(a):n=Mr(a,n)}return n},ch=!0,oT=console.warn!=null,sT=console.trace!=null,Wl=Number.MAX_SAFE_INTEGER||9007199254740991,uh=function(){return!0},$o=function(){return!1},dh=function(){return 0},jl=function(){},Ze=function(e){throw new Error(e)},fh=function(e){if(e!==void 0)ch=!!e;else return ch},Ve=function(e){fh()&&(oT?console.warn(e):(console.log(e),sT&&console.trace()))},lT=function(e){return xe({},e)},kn=function(e){return e==null?e:Ke(e)?e.slice():Ie(e)?lT(e):e},cT=function(e){return e.slice()},hh=function(e,n){for(n=e="";e++<36;n+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return n},uT={},ph=function(){return uT},wt=function(e){var n=Object.keys(e);return function(r){for(var a={},i=0;i<n.length;i++){var s=n[i],l=r==null?void 0:r[s];a[s]=l===void 0?e[s]:l}return a}},or=function(e,n,r){for(var a=e.length-1;a>=0;a--)e[a]===n&&e.splice(a,1)},Yl=function(e){e.splice(0,e.length)},dT=function(e,n){for(var r=0;r<n.length;r++){var a=n[r];e.push(a)}},fn=function(e,n,r){return r&&(n=Yf(r,n)),e[n]},sr=function(e,n,r,a){r&&(n=Yf(r,n)),e[n]=a},fT=function(){function t(){zl(this,t),this._obj={}}return Hl(t,[{key:"set",value:function(n,r){return this._obj[n]=r,this}},{key:"delete",value:function(n){return this._obj[n]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(n){return this._obj[n]!==void 0}},{key:"get",value:function(n){return this._obj[n]}}]),t}(),xn=typeof Map<"u"?Map:fT,hT="undefined",pT=function(){function t(e){if(zl(this,t),this._obj=Object.create(null),this.size=0,e!=null){var n;e.instanceString!=null&&e.instanceString()===this.instanceString()?n=e.toArray():n=e;for(var r=0;r<n.length;r++)this.add(n[r])}}return Hl(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(n){var r=this._obj;r[n]!==1&&(r[n]=1,this.size++)}},{key:"delete",value:function(n){var r=this._obj;r[n]===1&&(r[n]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(n){return this._obj[n]===1}},{key:"toArray",value:function(){var n=this;return Object.keys(this._obj).filter(function(r){return n.has(r)})}},{key:"forEach",value:function(n,r){return this.toArray().forEach(n,r)}}]),t}(),ma=(typeof Set>"u"?"undefined":st(Set))!==hT?Set:pT,zo=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||n===void 0||!Kl(e)){Ze("An element must have a core reference and parameters set");return}var a=n.group;if(a==null&&(n.data&&n.data.source!=null&&n.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){Ze("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:n.data||{},position:n.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!n.selected,selectable:n.selectable===void 0?!0:!!n.selectable,locked:!!n.locked,grabbed:!1,grabbable:n.grabbable===void 0?!0:!!n.grabbable,pannable:n.pannable===void 0?a==="edges":!!n.pannable,active:!1,classes:new ma,animation:{current:[],queue:[]},rscratch:{},scratch:n.scratch||{},edges:[],children:[],parent:n.parent&&n.parent.isNode()?n.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),n.renderedPosition){var s=n.renderedPosition,l=e.pan(),u=e.zoom();i.position={x:(s.x-l.x)/u,y:(s.y-l.y)/u}}var c=[];Ke(n.classes)?c=n.classes:be(n.classes)&&(c=n.classes.split(/\s+/));for(var d=0,f=c.length;d<f;d++){var h=c[d];!h||h===""||i.classes.add(h)}this.createEmitter();var v=n.style||n.css;v&&(Ve("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(v)),(r===void 0||r)&&this.restore()},vh=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(r,a,i){var s;Ie(r)&&!Gt(r)&&(s=r,r=s.roots||s.root,a=s.visit,i=s.directed),i=arguments.length===2&&!Ye(a)?a:i,a=Ye(a)?a:function(){};for(var l=this._private.cy,u=r=be(r)?this.filter(r):r,c=[],d=[],f={},h={},v={},p=0,g,y=this.byGroup(),m=y.nodes,b=y.edges,w=0;w<u.length;w++){var C=u[w],E=C.id();C.isNode()&&(c.unshift(C),e.bfs&&(v[E]=!0,d.push(C)),h[E]=0)}for(var x=function(){var O=e.bfs?c.shift():c.pop(),P=O.id();if(e.dfs){if(v[P])return"continue";v[P]=!0,d.push(O)}var F=h[P],I=f[P],M=I!=null?I.source():null,L=I!=null?I.target():null,V=I==null?void 0:O.same(M)?L[0]:M[0],H=void 0;if(H=a(O,I,V,p++,F),H===!0)return g=O,"break";if(H===!1)return"break";for(var $=O.connectedEdges().filter(function(X){return(!i||X.source().same(O))&&b.has(X)}),z=0;z<$.length;z++){var j=$[z],ee=j.connectedNodes().filter(function(X){return!X.same(O)&&m.has(X)}),J=ee.id();ee.length!==0&&!v[J]&&(ee=ee[0],c.push(ee),e.bfs&&(v[J]=!0,d.push(ee)),f[J]=j,h[J]=h[P]+1)}};c.length!==0;){var k=x();if(k!=="continue"&&k==="break")break}for(var B=l.collection(),S=0;S<d.length;S++){var N=d[S],D=f[N.id()];D!=null&&B.push(D),B.push(N)}return{path:l.collection(B),found:l.collection(g)}}},Ti={breadthFirstSearch:vh({bfs:!0}),depthFirstSearch:vh({dfs:!0})};Ti.bfs=Ti.breadthFirstSearch,Ti.dfs=Ti.depthFirstSearch;var vT=bS(function(t,e){(function(){var n,r,a,i,s,l,u,c,d,f,h,v,p,g,y;a=Math.floor,f=Math.min,r=function(m,b){return m<b?-1:m>b?1:0},d=function(m,b,w,C,E){var x;if(w==null&&(w=0),E==null&&(E=r),w<0)throw new Error("lo must be non-negative");for(C==null&&(C=m.length);w<C;)x=a((w+C)/2),E(b,m[x])<0?C=x:w=x+1;return[].splice.apply(m,[w,w-w].concat(b)),b},l=function(m,b,w){return w==null&&(w=r),m.push(b),g(m,0,m.length-1,w)},s=function(m,b){var w,C;return b==null&&(b=r),w=m.pop(),m.length?(C=m[0],m[0]=w,y(m,0,b)):C=w,C},c=function(m,b,w){var C;return w==null&&(w=r),C=m[0],m[0]=b,y(m,0,w),C},u=function(m,b,w){var C;return w==null&&(w=r),m.length&&w(m[0],b)<0&&(C=[m[0],b],b=C[0],m[0]=C[1],y(m,0,w)),b},i=function(m,b){var w,C,E,x,k,B;for(b==null&&(b=r),x=(function(){B=[];for(var S=0,N=a(m.length/2);0<=N?S<N:S>N;0<=N?S++:S--)B.push(S);return B}).apply(this).reverse(),k=[],C=0,E=x.length;C<E;C++)w=x[C],k.push(y(m,w,b));return k},p=function(m,b,w){var C;if(w==null&&(w=r),C=m.indexOf(b),C!==-1)return g(m,0,C,w),y(m,C,w)},h=function(m,b,w){var C,E,x,k,B;if(w==null&&(w=r),E=m.slice(0,b),!E.length)return E;for(i(E,w),B=m.slice(b),x=0,k=B.length;x<k;x++)C=B[x],u(E,C,w);return E.sort(w).reverse()},v=function(m,b,w){var C,E,x,k,B,S,N,D,_;if(w==null&&(w=r),b*10<=m.length){if(x=m.slice(0,b).sort(w),!x.length)return x;for(E=x[x.length-1],N=m.slice(b),k=0,S=N.length;k<S;k++)C=N[k],w(C,E)<0&&(d(x,C,0,null,w),x.pop(),E=x[x.length-1]);return x}for(i(m,w),_=[],B=0,D=f(b,m.length);0<=D?B<D:B>D;0<=D?++B:--B)_.push(s(m,w));return _},g=function(m,b,w,C){var E,x,k;for(C==null&&(C=r),E=m[w];w>b;){if(k=w-1>>1,x=m[k],C(E,x)<0){m[w]=x,w=k;continue}break}return m[w]=E},y=function(m,b,w){var C,E,x,k,B;for(w==null&&(w=r),E=m.length,B=b,x=m[b],C=2*b+1;C<E;)k=C+1,k<E&&!(w(m[C],m[k])<0)&&(C=k),m[b]=m[C],b=C,C=2*b+1;return m[b]=x,g(m,B,b,w)},n=function(){m.push=l,m.pop=s,m.replace=c,m.pushpop=u,m.heapify=i,m.updateItem=p,m.nlargest=h,m.nsmallest=v;function m(b){this.cmp=b??r,this.nodes=[]}return m.prototype.push=function(b){return l(this.nodes,b,this.cmp)},m.prototype.pop=function(){return s(this.nodes,this.cmp)},m.prototype.peek=function(){return this.nodes[0]},m.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},m.prototype.replace=function(b){return c(this.nodes,b,this.cmp)},m.prototype.pushpop=function(b){return u(this.nodes,b,this.cmp)},m.prototype.heapify=function(){return i(this.nodes,this.cmp)},m.prototype.updateItem=function(b){return p(this.nodes,b,this.cmp)},m.prototype.clear=function(){return this.nodes=[]},m.prototype.empty=function(){return this.nodes.length===0},m.prototype.size=function(){return this.nodes.length},m.prototype.clone=function(){var b;return b=new m,b.nodes=this.nodes.slice(0),b},m.prototype.toArray=function(){return this.nodes.slice(0)},m.prototype.insert=m.prototype.push,m.prototype.top=m.prototype.peek,m.prototype.front=m.prototype.peek,m.prototype.has=m.prototype.contains,m.prototype.copy=m.prototype.clone,m}(),function(m,b){return t.exports=b()}(this,function(){return n})}).call(wi)}),Bi=vT,gT=wt({root:null,weight:function(e){return 1},directed:!1}),mT={dijkstra:function(e){if(!Ie(e)){var n=arguments;e={root:n[0],weight:n[1],directed:n[2]}}var r=gT(e),a=r.root,i=r.weight,s=r.directed,l=this,u=i,c=be(a)?this.filter(a)[0]:a[0],d={},f={},h={},v=this.byGroup(),p=v.nodes,g=v.edges;g.unmergeBy(function(F){return F.isLoop()});for(var y=function(I){return d[I.id()]},m=function(I,M){d[I.id()]=M,b.updateItem(I)},b=new Bi(function(F,I){return y(F)-y(I)}),w=0;w<p.length;w++){var C=p[w];d[C.id()]=C.same(c)?0:1/0,b.push(C)}for(var E=function(I,M){for(var L=(s?I.edgesTo(M):I.edgesWith(M)).intersect(g),V=1/0,H,$=0;$<L.length;$++){var z=L[$],j=u(z);(j<V||!H)&&(V=j,H=z)}return{edge:H,dist:V}};b.size()>0;){var x=b.pop(),k=y(x),B=x.id();if(h[B]=k,k!==1/0)for(var S=x.neighborhood().intersect(p),N=0;N<S.length;N++){var D=S[N],_=D.id(),O=E(x,D),P=k+O.dist;P<y(D)&&(m(D,P),f[_]={node:x,edge:O.edge})}}return{distanceTo:function(I){var M=be(I)?p.filter(I)[0]:I[0];return h[M.id()]},pathTo:function(I){var M=be(I)?p.filter(I)[0]:I[0],L=[],V=M,H=V.id();if(M.length>0)for(L.unshift(M);f[H];){var $=f[H];L.unshift($.edge),L.unshift($.node),V=$.node,H=V.id()}return l.spawn(L)}}}},yT={kruskal:function(e){e=e||function(w){return 1};for(var n=this.byGroup(),r=n.nodes,a=n.edges,i=r.length,s=new Array(i),l=r,u=function(C){for(var E=0;E<s.length;E++){var x=s[E];if(x.has(C))return E}},c=0;c<i;c++)s[c]=this.spawn(r[c]);for(var d=a.sort(function(w,C){return e(w)-e(C)}),f=0;f<d.length;f++){var h=d[f],v=h.source()[0],p=h.target()[0],g=u(v),y=u(p),m=s[g],b=s[y];g!==y&&(l.merge(h),m.merge(b),s.splice(y,1))}return l}},bT=wt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),wT={aStar:function(e){var n=this.cy(),r=bT(e),a=r.root,i=r.goal,s=r.heuristic,l=r.directed,u=r.weight;a=n.collection(a)[0],i=n.collection(i)[0];var c=a.id(),d=i.id(),f={},h={},v={},p=new Bi(function(H,$){return h[H.id()]-h[$.id()]}),g=new ma,y={},m={},b=function($,z){p.push($),g.add(z)},w,C,E=function(){w=p.pop(),C=w.id(),g.delete(C)},x=function($){return g.has($)};b(a,c),f[c]=0,h[c]=s(a);for(var k=0;p.size()>0;){if(E(),k++,C===d){for(var B=[],S=i,N=d,D=m[N];B.unshift(S),D!=null&&B.unshift(D),S=y[N],S!=null;)N=S.id(),D=m[N];return{found:!0,distance:f[C],path:this.spawn(B),steps:k}}v[C]=!0;for(var _=w._private.edges,O=0;O<_.length;O++){var P=_[O];if(this.hasElementWithId(P.id())&&!(l&&P.data("source")!==C)){var F=P.source(),I=P.target(),M=F.id()!==C?F:I,L=M.id();if(this.hasElementWithId(L)&&!v[L]){var V=f[C]+u(P);if(!x(L)){f[L]=V,h[L]=V+s(M),b(M,L),y[L]=w,m[L]=P;continue}V<f[L]&&(f[L]=V,h[L]=V+s(M),y[L]=w,m[L]=P)}}}}return{found:!1,distance:void 0,path:void 0,steps:k}}},CT=wt({weight:function(e){return 1},directed:!1}),kT={floydWarshall:function(e){for(var n=this.cy(),r=CT(e),a=r.weight,i=r.directed,s=a,l=this.byGroup(),u=l.nodes,c=l.edges,d=u.length,f=d*d,h=function(j){return u.indexOf(j)},v=function(j){return u[j]},p=new Array(f),g=0;g<f;g++){var y=g%d,m=(g-y)/d;m===y?p[g]=0:p[g]=1/0}for(var b=new Array(f),w=new Array(f),C=0;C<c.length;C++){var E=c[C],x=E.source()[0],k=E.target()[0];if(x!==k){var B=h(x),S=h(k),N=B*d+S,D=s(E);if(p[N]>D&&(p[N]=D,b[N]=S,w[N]=E),!i){var _=S*d+B;!i&&p[_]>D&&(p[_]=D,b[_]=B,w[_]=E)}}}for(var O=0;O<d;O++)for(var P=0;P<d;P++)for(var F=P*d+O,I=0;I<d;I++){var M=P*d+I,L=O*d+I;p[F]+p[L]<p[M]&&(p[M]=p[F]+p[L],b[M]=b[F])}var V=function(j){return(be(j)?n.filter(j):j)[0]},H=function(j){return h(V(j))},$={distance:function(j,ee){var J=H(j),X=H(ee);return p[J*d+X]},path:function(j,ee){var J=H(j),X=H(ee),ne=v(J);if(J===X)return ne.collection();if(b[J*d+X]==null)return n.collection();var Y=n.collection(),A=J,K;for(Y.merge(ne);J!==X;)A=J,J=b[J*d+X],K=w[A*d+J],Y.merge(K),Y.merge(v(J));return Y}};return $}},xT=wt({weight:function(e){return 1},directed:!1,root:null}),ET={bellmanFord:function(e){var n=this,r=xT(e),a=r.weight,i=r.directed,s=r.root,l=a,u=this,c=this.cy(),d=this.byGroup(),f=d.edges,h=d.nodes,v=h.length,p=new xn,g=!1,y=[];s=c.collection(s)[0],f.unmergeBy(function(pe){return pe.isLoop()});for(var m=f.length,b=function(de){var me=p.get(de.id());return me||(me={},p.set(de.id(),me)),me},w=function(de){return(be(de)?c.$(de):de)[0]},C=function(de){return b(w(de)).dist},E=function(de){for(var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,Ne=w(de),De=[],Ee=Ne;;){if(Ee==null)return n.spawn();var _e=b(Ee),te=_e.edge,T=_e.pred;if(De.unshift(Ee[0]),Ee.same(me)&&De.length>0)break;te!=null&&De.unshift(te),Ee=T}return u.spawn(De)},x=0;x<v;x++){var k=h[x],B=b(k);k.same(s)?B.dist=0:B.dist=1/0,B.pred=null,B.edge=null}for(var S=!1,N=function(de,me,Ne,De,Ee,_e){var te=De.dist+_e;te<Ee.dist&&!Ne.same(De.edge)&&(Ee.dist=te,Ee.pred=de,Ee.edge=Ne,S=!0)},D=1;D<v;D++){S=!1;for(var _=0;_<m;_++){var O=f[_],P=O.source(),F=O.target(),I=l(O),M=b(P),L=b(F);N(P,F,O,M,L,I),i||N(F,P,O,L,M,I)}if(!S)break}if(S)for(var V=[],H=0;H<m;H++){var $=f[H],z=$.source(),j=$.target(),ee=l($),J=b(z).dist,X=b(j).dist;if(J+ee<X||!i&&X+ee<J)if(g||(Ve("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),e.findNegativeWeightCycles!==!1){var ne=[];J+ee<X&&ne.push(z),!i&&X+ee<J&&ne.push(j);for(var Y=ne.length,A=0;A<Y;A++){var K=ne[A],W=[K];W.push(b(K).edge);for(var oe=b(K).pred;W.indexOf(oe)===-1;)W.push(oe),W.push(b(oe).edge),oe=b(oe).pred;W=W.slice(W.indexOf(oe));for(var he=W[0].id(),re=0,se=2;se<W.length;se+=2)W[se].id()<he&&(he=W[se].id(),re=se);W=W.slice(re).concat(W.slice(0,re)),W.push(W[0]);var ue=W.map(function(pe){return pe.id()}).join(",");V.indexOf(ue)===-1&&(y.push(u.spawn(W)),V.push(ue))}}else break}return{distanceTo:C,pathTo:E,hasNegativeWeightCycle:g,negativeWeightCycles:y}}},ST=Math.sqrt(2),TT=function(e,n,r){r.length===0&&Ze("Karger-Stein must be run on a connected (sub)graph");for(var a=r[e],i=a[1],s=a[2],l=n[i],u=n[s],c=r,d=c.length-1;d>=0;d--){var f=c[d],h=f[1],v=f[2];(n[h]===l&&n[v]===u||n[h]===u&&n[v]===l)&&c.splice(d,1)}for(var p=0;p<c.length;p++){var g=c[p];g[1]===u?(c[p]=g.slice(),c[p][1]=l):g[2]===u&&(c[p]=g.slice(),c[p][2]=l)}for(var y=0;y<n.length;y++)n[y]===u&&(n[y]=l);return c},Zl=function(e,n,r,a){for(;r>a;){var i=Math.floor(Math.random()*n.length);n=TT(i,e,n),r--}return n},BT={kargerStein:function(){var e=this,n=this.byGroup(),r=n.nodes,a=n.edges;a.unmergeBy(function(L){return L.isLoop()});var i=r.length,s=a.length,l=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/ST);if(i<2){Ze("At least 2 nodes are required for Karger-Stein algorithm");return}for(var c=[],d=0;d<s;d++){var f=a[d];c.push([d,r.indexOf(f.source()),r.indexOf(f.target())])}for(var h=1/0,v=[],p=new Array(i),g=new Array(i),y=new Array(i),m=function(V,H){for(var $=0;$<i;$++)H[$]=V[$]},b=0;b<=l;b++){for(var w=0;w<i;w++)g[w]=w;var C=Zl(g,c.slice(),i,u),E=C.slice();m(g,y);var x=Zl(g,C,u,2),k=Zl(y,E,u,2);x.length<=k.length&&x.length<h?(h=x.length,v=x,m(g,p)):k.length<=x.length&&k.length<h&&(h=k.length,v=k,m(y,p))}for(var B=this.spawn(v.map(function(L){return a[L[0]]})),S=this.spawn(),N=this.spawn(),D=p[0],_=0;_<p.length;_++){var O=p[_],P=r[_];O===D?S.merge(P):N.merge(P)}var F=function(V){var H=e.spawn();return V.forEach(function($){H.merge($),$.connectedEdges().forEach(function(z){e.contains(z)&&!B.contains(z)&&H.merge(z)})}),H},I=[F(S),F(N)],M={cut:B,components:I,partition1:S,partition2:N};return M}},NT=function(e){return{x:e.x,y:e.y}},Ho=function(e,n,r){return{x:e.x*n+r.x,y:e.y*n+r.y}},gh=function(e,n,r){return{x:(e.x-r.x)/n,y:(e.y-r.y)/n}},ya=function(e){return{x:e[0],y:e[1]}},DT=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=n;i<r;i++){var s=e[i];isFinite(s)&&(a=Math.min(s,a))}return a},_T=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=n;i<r;i++){var s=e[i];isFinite(s)&&(a=Math.max(s,a))}return a},PT=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,s=n;s<r;s++){var l=e[s];isFinite(l)&&(a+=l,i++)}return a/i},IT=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?e=e.slice(n,r):(r<e.length&&e.splice(r,e.length-r),n>0&&e.splice(0,n));for(var l=0,u=e.length-1;u>=0;u--){var c=e[u];s?isFinite(c)||(e[u]=-1/0,l++):e.splice(u,1)}i&&e.sort(function(h,v){return h-v});var d=e.length,f=Math.floor(d/2);return d%2!==0?e[f+1+l]:(e[f-1+l]+e[f+l])/2},OT=function(e){return Math.PI*e/180},Ko=function(e,n){return Math.atan2(n,e)-Math.PI/2},Xl=Math.log2||function(t){return Math.log(t)/Math.log(2)},mh=function(e){return e>0?1:e<0?-1:0},Fr=function(e,n){return Math.sqrt(Ar(e,n))},Ar=function(e,n){var r=n.x-e.x,a=n.y-e.y;return r*r+a*a},LT=function(e){for(var n=e.length,r=0,a=0;a<n;a++)r+=e[a];for(var i=0;i<n;i++)e[i]=e[i]/r;return e},ht=function(e,n,r,a){return(1-a)*(1-a)*e+2*(1-a)*a*n+a*a*r},ba=function(e,n,r,a){return{x:ht(e.x,n.x,r.x,a),y:ht(e.y,n.y,r.y,a)}},MT=function(e,n,r,a){var i={x:n.x-e.x,y:n.y-e.y},s=Fr(e,n),l={x:i.x/s,y:i.y/s};return r=r??0,a=a??r*s,{x:e.x+l.x*a,y:e.y+l.y*a}},Ni=function(e,n,r){return Math.max(e,Math.min(r,n))},zt=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},FT=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},AT=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},VT=function(e,n,r){return{x1:e.x1+n,x2:e.x2+n,y1:e.y1+r,y2:e.y2+r,w:e.w,h:e.h}},yh=function(e,n){e.x1=Math.min(e.x1,n.x1),e.x2=Math.max(e.x2,n.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n.y1),e.y2=Math.max(e.y2,n.y2),e.h=e.y2-e.y1},RT=function(e,n,r){e.x1=Math.min(e.x1,n),e.x2=Math.max(e.x2,n),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r),e.y2=Math.max(e.y2,r),e.h=e.y2-e.y1},qo=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=n,e.x2+=n,e.y1-=n,e.y2+=n,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Uo=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],r,a,i,s;if(n.length===1)r=a=i=s=n[0];else if(n.length===2)r=i=n[0],s=a=n[1];else if(n.length===4){var l=dn(n,4);r=l[0],a=l[1],i=l[2],s=l[3]}return e.x1-=s,e.x2+=a,e.y1-=r,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},bh=function(e,n){e.x1=n.x1,e.y1=n.y1,e.x2=n.x2,e.y2=n.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Ql=function(e,n){return!(e.x1>n.x2||n.x1>e.x2||e.x2<n.x1||n.x2<e.x1||e.y2<n.y1||n.y2<e.y1||e.y1>n.y2||n.y1>e.y2)},wa=function(e,n,r){return e.x1<=n&&n<=e.x2&&e.y1<=r&&r<=e.y2},$T=function(e,n){return wa(e,n.x,n.y)},wh=function(e,n){return wa(e,n.x1,n.y1)&&wa(e,n.x2,n.y2)},Ch=function(e,n,r,a,i,s,l){var u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",c=u==="auto"?Rr(i,s):u,d=i/2,f=s/2;c=Math.min(c,d,f);var h=c!==d,v=c!==f,p;if(h){var g=r-d+c-l,y=a-f-l,m=r+d-c+l,b=y;if(p=lr(e,n,r,a,g,y,m,b,!1),p.length>0)return p}if(v){var w=r+d+l,C=a-f+c-l,E=w,x=a+f-c+l;if(p=lr(e,n,r,a,w,C,E,x,!1),p.length>0)return p}if(h){var k=r-d+c-l,B=a+f+l,S=r+d-c+l,N=B;if(p=lr(e,n,r,a,k,B,S,N,!1),p.length>0)return p}if(v){var D=r-d-l,_=a-f+c-l,O=D,P=a+f-c+l;if(p=lr(e,n,r,a,D,_,O,P,!1),p.length>0)return p}var F;{var I=r-d+c,M=a-f+c;if(F=Di(e,n,r,a,I,M,c+l),F.length>0&&F[0]<=I&&F[1]<=M)return[F[0],F[1]]}{var L=r+d-c,V=a-f+c;if(F=Di(e,n,r,a,L,V,c+l),F.length>0&&F[0]>=L&&F[1]<=V)return[F[0],F[1]]}{var H=r+d-c,$=a+f-c;if(F=Di(e,n,r,a,H,$,c+l),F.length>0&&F[0]>=H&&F[1]>=$)return[F[0],F[1]]}{var z=r-d+c,j=a+f-c;if(F=Di(e,n,r,a,z,j,c+l),F.length>0&&F[0]<=z&&F[1]>=j)return[F[0],F[1]]}return[]},zT=function(e,n,r,a,i,s,l){var u=l,c=Math.min(r,i),d=Math.max(r,i),f=Math.min(a,s),h=Math.max(a,s);return c-u<=e&&e<=d+u&&f-u<=n&&n<=h+u},HT=function(e,n,r,a,i,s,l,u,c){var d={x1:Math.min(r,l,i)-c,x2:Math.max(r,l,i)+c,y1:Math.min(a,u,s)-c,y2:Math.max(a,u,s)+c};return!(e<d.x1||e>d.x2||n<d.y1||n>d.y2)},KT=function(e,n,r,a){r-=a;var i=n*n-4*e*r;if(i<0)return[];var s=Math.sqrt(i),l=2*e,u=(-n+s)/l,c=(-n-s)/l;return[u,c]},qT=function(e,n,r,a,i){var s=1e-5;e===0&&(e=s),n/=e,r/=e,a/=e;var l,u,c,d,f,h,v,p;if(u=(3*r-n*n)/9,c=-(27*a)+n*(9*r-2*(n*n)),c/=54,l=u*u*u+c*c,i[1]=0,v=n/3,l>0){f=c+Math.sqrt(l),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),h=c-Math.sqrt(l),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-v+f+h,v+=(f+h)/2,i[4]=i[2]=-v,v=Math.sqrt(3)*(-h+f)/2,i[3]=v,i[5]=-v;return}if(i[5]=i[3]=0,l===0){p=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-v+2*p,i[4]=i[2]=-(p+v);return}u=-u,d=u*u*u,d=Math.acos(c/Math.sqrt(d)),p=2*Math.sqrt(u),i[0]=-v+p*Math.cos(d/3),i[2]=-v+p*Math.cos((d+2*Math.PI)/3),i[4]=-v+p*Math.cos((d+4*Math.PI)/3)},UT=function(e,n,r,a,i,s,l,u){var c=1*r*r-4*r*i+2*r*l+4*i*i-4*i*l+l*l+a*a-4*a*s+2*a*u+4*s*s-4*s*u+u*u,d=1*9*r*i-3*r*r-3*r*l-6*i*i+3*i*l+9*a*s-3*a*a-3*a*u-6*s*s+3*s*u,f=1*3*r*r-6*r*i+r*l-r*e+2*i*i+2*i*e-l*e+3*a*a-6*a*s+a*u-a*n+2*s*s+2*s*n-u*n,h=1*r*i-r*r+r*e-i*e+a*s-a*a+a*n-s*n,v=[];qT(c,d,f,h,v);for(var p=1e-7,g=[],y=0;y<6;y+=2)Math.abs(v[y+1])<p&&v[y]>=0&&v[y]<=1&&g.push(v[y]);g.push(1),g.push(0);for(var m=-1,b,w,C,E=0;E<g.length;E++)b=Math.pow(1-g[E],2)*r+2*(1-g[E])*g[E]*i+g[E]*g[E]*l,w=Math.pow(1-g[E],2)*a+2*(1-g[E])*g[E]*s+g[E]*g[E]*u,C=Math.pow(b-e,2)+Math.pow(w-n,2),m>=0?C<m&&(m=C):m=C;return m},GT=function(e,n,r,a,i,s){var l=[e-r,n-a],u=[i-r,s-a],c=u[0]*u[0]+u[1]*u[1],d=l[0]*l[0]+l[1]*l[1],f=l[0]*u[0]+l[1]*u[1],h=f*f/c;return f<0?d:h>c?(e-i)*(e-i)+(n-s)*(n-s):d-h},Ht=function(e,n,r){for(var a,i,s,l,u,c=0,d=0;d<r.length/2;d++)if(a=r[d*2],i=r[d*2+1],d+1<r.length/2?(s=r[(d+1)*2],l=r[(d+1)*2+1]):(s=r[(d+1-r.length/2)*2],l=r[(d+1-r.length/2)*2+1]),!(a==e&&s==e))if(a>=e&&e>=s||a<=e&&e<=s)u=(e-a)/(s-a)*(l-i)+i,u>n&&c++;else continue;return c%2!==0},$n=function(e,n,r,a,i,s,l,u,c){var d=new Array(r.length),f;u[0]!=null?(f=Math.atan(u[1]/u[0]),u[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=u;for(var h=Math.cos(-f),v=Math.sin(-f),p=0;p<d.length/2;p++)d[p*2]=s/2*(r[p*2]*h-r[p*2+1]*v),d[p*2+1]=l/2*(r[p*2+1]*h+r[p*2]*v),d[p*2]+=a,d[p*2+1]+=i;var g;if(c>0){var y=Wo(d,-c);g=Go(y)}else g=d;return Ht(e,n,g)},WT=function(e,n,r,a,i,s,l,u){for(var c=new Array(r.length*2),d=0;d<u.length;d++){var f=u[d];c[d*4+0]=f.startX,c[d*4+1]=f.startY,c[d*4+2]=f.stopX,c[d*4+3]=f.stopY;var h=Math.pow(f.cx-e,2)+Math.pow(f.cy-n,2);if(h<=Math.pow(f.radius,2))return!0}return Ht(e,n,c)},Go=function(e){for(var n=new Array(e.length/2),r,a,i,s,l,u,c,d,f=0;f<e.length/4;f++){r=e[f*4],a=e[f*4+1],i=e[f*4+2],s=e[f*4+3],f<e.length/4-1?(l=e[(f+1)*4],u=e[(f+1)*4+1],c=e[(f+1)*4+2],d=e[(f+1)*4+3]):(l=e[0],u=e[1],c=e[2],d=e[3]);var h=lr(r,a,i,s,l,u,c,d,!0);n[f*2]=h[0],n[f*2+1]=h[1]}return n},Wo=function(e,n){for(var r=new Array(e.length*2),a,i,s,l,u=0;u<e.length/2;u++){a=e[u*2],i=e[u*2+1],u<e.length/2-1?(s=e[(u+1)*2],l=e[(u+1)*2+1]):(s=e[0],l=e[1]);var c=l-i,d=-(s-a),f=Math.sqrt(c*c+d*d),h=c/f,v=d/f;r[u*4]=a+h*n,r[u*4+1]=i+v*n,r[u*4+2]=s+h*n,r[u*4+3]=l+v*n}return r},jT=function(e,n,r,a,i,s){var l=r-e,u=a-n;l/=i,u/=s;var c=Math.sqrt(l*l+u*u),d=c-1;if(d<0)return[];var f=d/c;return[(r-e)*f+e,(a-n)*f+n]},Vr=function(e,n,r,a,i,s,l){return e-=i,n-=s,e/=r/2+l,n/=a/2+l,e*e+n*n<=1},Di=function(e,n,r,a,i,s,l){var u=[r-e,a-n],c=[e-i,n-s],d=u[0]*u[0]+u[1]*u[1],f=2*(c[0]*u[0]+c[1]*u[1]),h=c[0]*c[0]+c[1]*c[1]-l*l,v=f*f-4*d*h;if(v<0)return[];var p=(-f+Math.sqrt(v))/(2*d),g=(-f-Math.sqrt(v))/(2*d),y=Math.min(p,g),m=Math.max(p,g),b=[];if(y>=0&&y<=1&&b.push(y),m>=0&&m<=1&&b.push(m),b.length===0)return[];var w=b[0]*u[0]+e,C=b[0]*u[1]+n;if(b.length>1){if(b[0]==b[1])return[w,C];var E=b[1]*u[0]+e,x=b[1]*u[1]+n;return[w,C,E,x]}else return[w,C]},Jl=function(e,n,r){return n<=e&&e<=r||r<=e&&e<=n?e:e<=n&&n<=r||r<=n&&n<=e?n:r},lr=function(e,n,r,a,i,s,l,u,c){var d=e-i,f=r-e,h=l-i,v=n-s,p=a-n,g=u-s,y=h*v-g*d,m=f*v-p*d,b=g*f-h*p;if(b!==0){var w=y/b,C=m/b,E=.001,x=0-E,k=1+E;return x<=w&&w<=k&&x<=C&&C<=k?[e+w*f,n+w*p]:c?[e+w*f,n+w*p]:[]}else return y===0||m===0?Jl(e,r,l)===l?[l,u]:Jl(e,r,i)===i?[i,s]:Jl(i,l,r)===r?[r,a]:[]:[]},_i=function(e,n,r,a,i,s,l,u){var c=[],d,f=new Array(r.length),h=!0;s==null&&(h=!1);var v;if(h){for(var p=0;p<f.length/2;p++)f[p*2]=r[p*2]*s+a,f[p*2+1]=r[p*2+1]*l+i;if(u>0){var g=Wo(f,-u);v=Go(g)}else v=f}else v=r;for(var y,m,b,w,C=0;C<v.length/2;C++)y=v[C*2],m=v[C*2+1],C<v.length/2-1?(b=v[(C+1)*2],w=v[(C+1)*2+1]):(b=v[0],w=v[1]),d=lr(e,n,a,i,y,m,b,w),d.length!==0&&c.push(d[0],d[1]);return c},YT=function(e,n,r,a,i,s,l,u,c){var d=[],f,h=new Array(r.length*2);c.forEach(function(b,w){w===0?(h[h.length-2]=b.startX,h[h.length-1]=b.startY):(h[w*4-2]=b.startX,h[w*4-1]=b.startY),h[w*4]=b.stopX,h[w*4+1]=b.stopY,f=Di(e,n,a,i,b.cx,b.cy,b.radius),f.length!==0&&d.push(f[0],f[1])});for(var v=0;v<h.length/4;v++)f=lr(e,n,a,i,h[v*4],h[v*4+1],h[v*4+2],h[v*4+3],!1),f.length!==0&&d.push(f[0],f[1]);if(d.length>2){for(var p=[d[0],d[1]],g=Math.pow(p[0]-e,2)+Math.pow(p[1]-n,2),y=1;y<d.length/2;y++){var m=Math.pow(d[y*2]-e,2)+Math.pow(d[y*2+1]-n,2);m<=g&&(p[0]=d[y*2],p[1]=d[y*2+1],g=m)}return p}return d},jo=function(e,n,r){var a=[e[0]-n[0],e[1]-n[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),s=(i-r)/i;return s<0&&(s=1e-5),[n[0]+s*a[0],n[1]+s*a[1]]},Mt=function(e,n){var r=ec(e,n);return r=kh(r),r},kh=function(e){for(var n,r,a=e.length/2,i=1/0,s=1/0,l=-1/0,u=-1/0,c=0;c<a;c++)n=e[2*c],r=e[2*c+1],i=Math.min(i,n),l=Math.max(l,n),s=Math.min(s,r),u=Math.max(u,r);for(var d=2/(l-i),f=2/(u-s),h=0;h<a;h++)n=e[2*h]=e[2*h]*d,r=e[2*h+1]=e[2*h+1]*f,i=Math.min(i,n),l=Math.max(l,n),s=Math.min(s,r),u=Math.max(u,r);if(s<-1)for(var v=0;v<a;v++)r=e[2*v+1]=e[2*v+1]+(-1-s);return e},ec=function(e,n){var r=1/e*2*Math.PI,a=e%2===0?Math.PI/2+r/2:Math.PI/2;a+=n;for(var i=new Array(e*2),s,l=0;l<e;l++)s=l*r+a,i[2*l]=Math.cos(s),i[2*l+1]=Math.sin(-s);return i},Rr=function(e,n){return Math.min(e/4,n/4,8)},xh=function(e,n){return Math.min(e/10,n/10,8)},tc=function(){return 8},ZT=function(e,n,r){return[e-2*n+r,2*(n-e),e]},nc=function(e,n){return{heightOffset:Math.min(15,.05*n),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},XT=wt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),QT={pageRank:function(e){for(var n=XT(e),r=n.dampingFactor,a=n.precision,i=n.iterations,s=n.weight,l=this._private.cy,u=this.byGroup(),c=u.nodes,d=u.edges,f=c.length,h=f*f,v=d.length,p=new Array(h),g=new Array(f),y=(1-r)/f,m=0;m<f;m++){for(var b=0;b<f;b++){var w=m*f+b;p[w]=0}g[m]=0}for(var C=0;C<v;C++){var E=d[C],x=E.data("source"),k=E.data("target");if(x!==k){var B=c.indexOfId(x),S=c.indexOfId(k),N=s(E),D=S*f+B;p[D]+=N,g[B]+=N}}for(var _=1/f+y,O=0;O<f;O++)if(g[O]===0)for(var P=0;P<f;P++){var F=P*f+O;p[F]=_}else for(var I=0;I<f;I++){var M=I*f+O;p[M]=p[M]/g[O]+y}for(var L=new Array(f),V=new Array(f),H,$=0;$<f;$++)L[$]=1;for(var z=0;z<i;z++){for(var j=0;j<f;j++)V[j]=0;for(var ee=0;ee<f;ee++)for(var J=0;J<f;J++){var X=ee*f+J;V[ee]+=p[X]*L[J]}LT(V),H=L,L=V,V=H;for(var ne=0,Y=0;Y<f;Y++){var A=H[Y]-L[Y];ne+=A*A}if(ne<a)break}var K={rank:function(oe){return oe=l.collection(oe)[0],L[c.indexOf(oe)]}};return K}},Eh=wt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Ca={degreeCentralityNormalized:function(e){e=Eh(e);var n=this.cy(),r=this.nodes(),a=r.length;if(e.directed){for(var d={},f={},h=0,v=0,p=0;p<a;p++){var g=r[p],y=g.id();e.root=g;var m=this.degreeCentrality(e);h<m.indegree&&(h=m.indegree),v<m.outdegree&&(v=m.outdegree),d[y]=m.indegree,f[y]=m.outdegree}return{indegree:function(w){return h==0?0:(be(w)&&(w=n.filter(w)),d[w.id()]/h)},outdegree:function(w){return v===0?0:(be(w)&&(w=n.filter(w)),f[w.id()]/v)}}}else{for(var i={},s=0,l=0;l<a;l++){var u=r[l];e.root=u;var c=this.degreeCentrality(e);s<c.degree&&(s=c.degree),i[u.id()]=c.degree}return{degree:function(w){return s===0?0:(be(w)&&(w=n.filter(w)),i[w.id()]/s)}}}},degreeCentrality:function(e){e=Eh(e);var n=this.cy(),r=this,a=e,i=a.root,s=a.weight,l=a.directed,u=a.alpha;if(i=n.collection(i)[0],l){for(var v=i.connectedEdges(),p=v.filter(function(x){return x.target().same(i)&&r.has(x)}),g=v.filter(function(x){return x.source().same(i)&&r.has(x)}),y=p.length,m=g.length,b=0,w=0,C=0;C<p.length;C++)b+=s(p[C]);for(var E=0;E<g.length;E++)w+=s(g[E]);return{indegree:Math.pow(y,1-u)*Math.pow(b,u),outdegree:Math.pow(m,1-u)*Math.pow(w,u)}}else{for(var c=i.connectedEdges().intersection(r),d=c.length,f=0,h=0;h<c.length;h++)f+=s(c[h]);return{degree:Math.pow(d,1-u)*Math.pow(f,u)}}}};Ca.dc=Ca.degreeCentrality,Ca.dcn=Ca.degreeCentralityNormalised=Ca.degreeCentralityNormalized;var Sh=wt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),ka={closenessCentralityNormalized:function(e){for(var n=Sh(e),r=n.harmonic,a=n.weight,i=n.directed,s=this.cy(),l={},u=0,c=this.nodes(),d=this.floydWarshall({weight:a,directed:i}),f=0;f<c.length;f++){for(var h=0,v=c[f],p=0;p<c.length;p++)if(f!==p){var g=d.distance(v,c[p]);r?h+=1/g:h+=g}r||(h=1/h),u<h&&(u=h),l[v.id()]=h}return{closeness:function(m){return u==0?0:(be(m)?m=s.filter(m)[0].id():m=m.id(),l[m]/u)}}},closenessCentrality:function(e){var n=Sh(e),r=n.root,a=n.weight,i=n.directed,s=n.harmonic;r=this.filter(r)[0];for(var l=this.dijkstra({root:r,weight:a,directed:i}),u=0,c=this.nodes(),d=0;d<c.length;d++){var f=c[d];if(!f.same(r)){var h=l.distanceTo(f);s?u+=1/h:u+=h}}return s?u:1/u}};ka.cc=ka.closenessCentrality,ka.ccn=ka.closenessCentralityNormalised=ka.closenessCentralityNormalized;var JT=wt({weight:null,directed:!1}),rc={betweennessCentrality:function(e){for(var n=JT(e),r=n.directed,a=n.weight,i=a!=null,s=this.cy(),l=this.nodes(),u={},c={},d=0,f={set:function(w,C){c[w]=C,C>d&&(d=C)},get:function(w){return c[w]}},h=0;h<l.length;h++){var v=l[h],p=v.id();r?u[p]=v.outgoers().nodes():u[p]=v.openNeighborhood().nodes(),f.set(p,0)}for(var g=function(w){for(var C=l[w].id(),E=[],x={},k={},B={},S=new Bi(function(J,X){return B[J]-B[X]}),N=0;N<l.length;N++){var D=l[N].id();x[D]=[],k[D]=0,B[D]=1/0}for(k[C]=1,B[C]=0,S.push(C);!S.empty();){var _=S.pop();if(E.push(_),i)for(var O=0;O<u[_].length;O++){var P=u[_][O],F=s.getElementById(_),I=void 0;F.edgesTo(P).length>0?I=F.edgesTo(P)[0]:I=P.edgesTo(F)[0];var M=a(I);P=P.id(),B[P]>B[_]+M&&(B[P]=B[_]+M,S.nodes.indexOf(P)<0?S.push(P):S.updateItem(P),k[P]=0,x[P]=[]),B[P]==B[_]+M&&(k[P]=k[P]+k[_],x[P].push(_))}else for(var L=0;L<u[_].length;L++){var V=u[_][L].id();B[V]==1/0&&(S.push(V),B[V]=B[_]+1),B[V]==B[_]+1&&(k[V]=k[V]+k[_],x[V].push(_))}}for(var H={},$=0;$<l.length;$++)H[l[$].id()]=0;for(;E.length>0;){for(var z=E.pop(),j=0;j<x[z].length;j++){var ee=x[z][j];H[ee]=H[ee]+k[ee]/k[z]*(1+H[z])}z!=l[w].id()&&f.set(z,f.get(z)+H[z])}},y=0;y<l.length;y++)g(y);var m={betweenness:function(w){var C=s.collection(w).id();return f.get(C)},betweennessNormalized:function(w){if(d==0)return 0;var C=s.collection(w).id();return f.get(C)/d}};return m.betweennessNormalised=m.betweennessNormalized,m}};rc.bc=rc.betweennessCentrality;var eB=wt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),tB=function(e){return eB(e)},nB=function(e,n){for(var r=0,a=0;a<n.length;a++)r+=n[a](e);return r},rB=function(e,n,r){for(var a=0;a<n;a++)e[a*n+a]=r},Th=function(e,n){for(var r,a=0;a<n;a++){r=0;for(var i=0;i<n;i++)r+=e[i*n+a];for(var s=0;s<n;s++)e[s*n+a]=e[s*n+a]/r}},aB=function(e,n,r){for(var a=new Array(r*r),i=0;i<r;i++){for(var s=0;s<r;s++)a[i*r+s]=0;for(var l=0;l<r;l++)for(var u=0;u<r;u++)a[i*r+u]+=e[i*r+l]*n[l*r+u]}return a},iB=function(e,n,r){for(var a=e.slice(0),i=1;i<r;i++)e=aB(e,a,n);return e},oB=function(e,n,r){for(var a=new Array(n*n),i=0;i<n*n;i++)a[i]=Math.pow(e[i],r);return Th(a,n),a},sB=function(e,n,r,a){for(var i=0;i<r;i++){var s=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),l=Math.round(n[i]*Math.pow(10,a))/Math.pow(10,a);if(s!==l)return!1}return!0},lB=function(e,n,r,a){for(var i=[],s=0;s<n;s++){for(var l=[],u=0;u<n;u++)Math.round(e[s*n+u]*1e3)/1e3>0&&l.push(r[u]);l.length!==0&&i.push(a.collection(l))}return i},cB=function(e,n){for(var r=0;r<e.length;r++)if(!n[r]||e[r].id()!==n[r].id())return!1;return!0},uB=function(e){for(var n=0;n<e.length;n++)for(var r=0;r<e.length;r++)n!=r&&cB(e[n],e[r])&&e.splice(r,1);return e},Bh=function(e){for(var n=this.nodes(),r=this.edges(),a=this.cy(),i=tB(e),s={},l=0;l<n.length;l++)s[n[l].id()]=l;for(var u=n.length,c=u*u,d=new Array(c),f,h=0;h<c;h++)d[h]=0;for(var v=0;v<r.length;v++){var p=r[v],g=s[p.source().id()],y=s[p.target().id()],m=nB(p,i.attributes);d[g*u+y]+=m,d[y*u+g]+=m}rB(d,u,i.multFactor),Th(d,u);for(var b=!0,w=0;b&&w<i.maxIterations;)b=!1,f=iB(d,u,i.expandFactor),d=oB(f,u,i.inflateFactor),sB(d,f,c,4)||(b=!0),w++;var C=lB(d,u,n,a);return C=uB(C),C},dB={markovClustering:Bh,mcl:Bh},fB=function(e){return e},Nh=function(e,n){return Math.abs(n-e)},Dh=function(e,n,r){return e+Nh(n,r)},_h=function(e,n,r){return e+Math.pow(r-n,2)},hB=function(e){return Math.sqrt(e)},pB=function(e,n,r){return Math.max(e,Nh(n,r))},Pi=function(e,n,r,a,i){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:fB,l=a,u,c,d=0;d<e;d++)u=n(d),c=r(d),l=i(l,u,c);return s(l)},xa={euclidean:function(e,n,r){return e>=2?Pi(e,n,r,0,_h,hB):Pi(e,n,r,0,Dh)},squaredEuclidean:function(e,n,r){return Pi(e,n,r,0,_h)},manhattan:function(e,n,r){return Pi(e,n,r,0,Dh)},max:function(e,n,r){return Pi(e,n,r,-1/0,pB)}};xa["squared-euclidean"]=xa.squaredEuclidean,xa.squaredeuclidean=xa.squaredEuclidean;function Yo(t,e,n,r,a,i){var s;return Ye(t)?s=t:s=xa[t]||xa.euclidean,e===0&&Ye(t)?s(a,i):s(e,n,r,a,i)}var vB=wt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),ac=function(e){return vB(e)},Zo=function(e,n,r,a,i){var s=i!=="kMedoids",l=s?function(f){return r[f]}:function(f){return a[f](r)},u=function(h){return a[h](n)},c=r,d=n;return Yo(e,a.length,l,u,c,d)},ic=function(e,n,r){for(var a=r.length,i=new Array(a),s=new Array(a),l=new Array(n),u=null,c=0;c<a;c++)i[c]=e.min(r[c]).value,s[c]=e.max(r[c]).value;for(var d=0;d<n;d++){u=[];for(var f=0;f<a;f++)u[f]=Math.random()*(s[f]-i[f])+i[f];l[d]=u}return l},Ph=function(e,n,r,a,i){for(var s=1/0,l=0,u=0;u<n.length;u++){var c=Zo(r,e,n[u],a,i);c<s&&(s=c,l=u)}return l},Ih=function(e,n,r){for(var a=[],i=null,s=0;s<n.length;s++)i=n[s],r[i.id()]===e&&a.push(i);return a},gB=function(e,n,r){return Math.abs(n-e)<=r},mB=function(e,n,r){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var s=Math.abs(e[a][i]-n[a][i]);if(s>r)return!1}return!0},yB=function(e,n,r){for(var a=0;a<r;a++)if(e===n[a])return!0;return!1},Oh=function(e,n){var r=new Array(n);if(e.length<50)for(var a=0;a<n;a++){for(var i=e[Math.floor(Math.random()*e.length)];yB(i,r,a);)i=e[Math.floor(Math.random()*e.length)];r[a]=i}else for(var s=0;s<n;s++)r[s]=e[Math.floor(Math.random()*e.length)];return r},Lh=function(e,n,r){for(var a=0,i=0;i<n.length;i++)a+=Zo("manhattan",n[i],e,r,"kMedoids");return a},bB=function(e){var n=this.cy(),r=this.nodes(),a=null,i=ac(e),s=new Array(i.k),l={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=ic(r,i.k,i.attributes)):st(i.testCentroids)==="object"?u=i.testCentroids:u=ic(r,i.k,i.attributes):u=ic(r,i.k,i.attributes);for(var c=!0,d=0;c&&d<i.maxIterations;){for(var f=0;f<r.length;f++)a=r[f],l[a.id()]=Ph(a,u,i.distance,i.attributes,"kMeans");c=!1;for(var h=0;h<i.k;h++){var v=Ih(h,r,l);if(v.length!==0){for(var p=i.attributes.length,g=u[h],y=new Array(p),m=new Array(p),b=0;b<p;b++){m[b]=0;for(var w=0;w<v.length;w++)a=v[w],m[b]+=i.attributes[b](a);y[b]=m[b]/v.length,gB(y[b],g[b],i.sensitivityThreshold)||(c=!0)}u[h]=y,s[h]=n.collection(v)}}d++}return s},wB=function(e){var n=this.cy(),r=this.nodes(),a=null,i=ac(e),s=new Array(i.k),l,u={},c,d=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(st(i.testCentroids)==="object"?l=i.testCentroids:l=Oh(r,i.k)):l=Oh(r,i.k);for(var f=!0,h=0;f&&h<i.maxIterations;){for(var v=0;v<r.length;v++)a=r[v],u[a.id()]=Ph(a,l,i.distance,i.attributes,"kMedoids");f=!1;for(var p=0;p<l.length;p++){var g=Ih(p,r,u);if(g.length!==0){d[p]=Lh(l[p],g,i.attributes);for(var y=0;y<g.length;y++)c=Lh(g[y],g,i.attributes),c<d[p]&&(d[p]=c,l[p]=g[y],f=!0);s[p]=n.collection(g)}}h++}return s},CB=function(e,n,r,a,i){for(var s,l,u=0;u<n.length;u++)for(var c=0;c<e.length;c++)a[u][c]=Math.pow(r[u][c],i.m);for(var d=0;d<e.length;d++)for(var f=0;f<i.attributes.length;f++){s=0,l=0;for(var h=0;h<n.length;h++)s+=a[h][d]*i.attributes[f](n[h]),l+=a[h][d];e[d][f]=s/l}},kB=function(e,n,r,a,i){for(var s=0;s<e.length;s++)n[s]=e[s].slice();for(var l,u,c,d=2/(i.m-1),f=0;f<r.length;f++)for(var h=0;h<a.length;h++){l=0;for(var v=0;v<r.length;v++)u=Zo(i.distance,a[h],r[f],i.attributes,"cmeans"),c=Zo(i.distance,a[h],r[v],i.attributes,"cmeans"),l+=Math.pow(u/c,d);e[h][f]=1/l}},xB=function(e,n,r,a){for(var i=new Array(r.k),s=0;s<i.length;s++)i[s]=[];for(var l,u,c=0;c<n.length;c++){l=-1/0,u=-1;for(var d=0;d<n[0].length;d++)n[c][d]>l&&(l=n[c][d],u=d);i[u].push(e[c])}for(var f=0;f<i.length;f++)i[f]=a.collection(i[f]);return i},Mh=function(e){var n=this.cy(),r=this.nodes(),a=ac(e),i,s,l,u,c;u=new Array(r.length);for(var d=0;d<r.length;d++)u[d]=new Array(a.k);l=new Array(r.length);for(var f=0;f<r.length;f++)l[f]=new Array(a.k);for(var h=0;h<r.length;h++){for(var v=0,p=0;p<a.k;p++)l[h][p]=Math.random(),v+=l[h][p];for(var g=0;g<a.k;g++)l[h][g]=l[h][g]/v}s=new Array(a.k);for(var y=0;y<a.k;y++)s[y]=new Array(a.attributes.length);c=new Array(r.length);for(var m=0;m<r.length;m++)c[m]=new Array(a.k);for(var b=!0,w=0;b&&w<a.maxIterations;)b=!1,CB(s,r,l,c,a),kB(l,u,s,r,a),mB(l,u,a.sensitivityThreshold)||(b=!0),w++;return i=xB(r,l,a,n),{clusters:i,degreeOfMembership:l}},EB={kMeans:bB,kMedoids:wB,fuzzyCMeans:Mh,fcm:Mh},SB=wt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),TB={single:"min",complete:"max"},BB=function(e){var n=SB(e),r=TB[n.linkage];return r!=null&&(n.linkage=r),n},Fh=function(e,n,r,a,i){for(var s=0,l=1/0,u,c=i.attributes,d=function(S,N){return Yo(i.distance,c.length,function(D){return c[D](S)},function(D){return c[D](N)},S,N)},f=0;f<e.length;f++){var h=e[f].key,v=r[h][a[h]];v<l&&(s=h,l=v)}if(i.mode==="threshold"&&l>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var p=n[s],g=n[a[s]],y;i.mode==="dendrogram"?y={left:p,right:g,key:p.key}:y={value:p.value.concat(g.value),key:p.key},e[p.index]=y,e.splice(g.index,1),n[p.key]=y;for(var m=0;m<e.length;m++){var b=e[m];p.key===b.key?u=1/0:i.linkage==="min"?(u=r[p.key][b.key],r[p.key][b.key]>r[g.key][b.key]&&(u=r[g.key][b.key])):i.linkage==="max"?(u=r[p.key][b.key],r[p.key][b.key]<r[g.key][b.key]&&(u=r[g.key][b.key])):i.linkage==="mean"?u=(r[p.key][b.key]*p.size+r[g.key][b.key]*g.size)/(p.size+g.size):i.mode==="dendrogram"?u=d(b.value,p.value):u=d(b.value[0],p.value[0]),r[p.key][b.key]=r[b.key][p.key]=u}for(var w=0;w<e.length;w++){var C=e[w].key;if(a[C]===p.key||a[C]===g.key){for(var E=C,x=0;x<e.length;x++){var k=e[x].key;r[C][k]<r[C][E]&&(E=k)}a[C]=E}e[w].index=w}return p.key=g.key=p.index=g.index=null,!0},Xo=function t(e,n,r){e&&(e.value?n.push(e.value):(e.left&&t(e.left,n),e.right&&t(e.right,n)))},NB=function t(e,n){if(!e)return"";if(e.left&&e.right){var r=t(e.left,n),a=t(e.right,n),i=n.add({group:"nodes",data:{id:r+","+a}});return n.add({group:"edges",data:{source:r,target:i.id()}}),n.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},DB=function t(e,n,r){if(!e)return[];var a=[],i=[],s=[];return n===0?(e.left&&Xo(e.left,a),e.right&&Xo(e.right,i),s=a.concat(i),[r.collection(s)]):n===1?e.value?[r.collection(e.value)]:(e.left&&Xo(e.left,a),e.right&&Xo(e.right,i),[r.collection(a),r.collection(i)]):e.value?[r.collection(e.value)]:(e.left&&(a=t(e.left,n-1,r)),e.right&&(i=t(e.right,n-1,r)),a.concat(i))},Ah=function(e){for(var n=this.cy(),r=this.nodes(),a=BB(e),i=a.attributes,s=function(w,C){return Yo(a.distance,i.length,function(E){return i[E](w)},function(E){return i[E](C)},w,C)},l=[],u=[],c=[],d=[],f=0;f<r.length;f++){var h={value:a.mode==="dendrogram"?r[f]:[r[f]],key:f,index:f};l[f]=h,d[f]=h,u[f]=[],c[f]=0}for(var v=0;v<l.length;v++)for(var p=0;p<=v;p++){var g=void 0;a.mode==="dendrogram"?g=v===p?1/0:s(l[v].value,l[p].value):g=v===p?1/0:s(l[v].value[0],l[p].value[0]),u[v][p]=g,u[p][v]=g,g<u[v][c[v]]&&(c[v]=p)}for(var y=Fh(l,d,u,c,a);y;)y=Fh(l,d,u,c,a);var m;return a.mode==="dendrogram"?(m=DB(l[0],a.dendrogramDepth,n),a.addDendrogram&&NB(l[0],n)):(m=new Array(l.length),l.forEach(function(b,w){b.key=b.index=null,m[w]=n.collection(b.value)})),m},_B={hierarchicalClustering:Ah,hca:Ah},PB=wt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),IB=function(e){var n=e.damping,r=e.preference;.5<=n&&n<1||Ze("Damping must range on [0.5, 1). Got: ".concat(n));var a=["median","mean","min","max"];return a.some(function(i){return i===r})||le(r)||Ze("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(r)),PB(e)},OB=function(e,n,r,a){var i=function(l,u){return a[u](l)};return-Yo(e,a.length,function(s){return i(n,s)},function(s){return i(r,s)},n,r)},LB=function(e,n){var r=null;return n==="median"?r=IT(e):n==="mean"?r=PT(e):n==="min"?r=DT(e):n==="max"?r=_T(e):r=n,r},MB=function(e,n,r){for(var a=[],i=0;i<e;i++)n[i*e+i]+r[i*e+i]>0&&a.push(i);return a},Vh=function(e,n,r){for(var a=[],i=0;i<e;i++){for(var s=-1,l=-1/0,u=0;u<r.length;u++){var c=r[u];n[i*e+c]>l&&(s=c,l=n[i*e+c])}s>0&&a.push(s)}for(var d=0;d<r.length;d++)a[r[d]]=r[d];return a},FB=function(e,n,r){for(var a=Vh(e,n,r),i=0;i<r.length;i++){for(var s=[],l=0;l<a.length;l++)a[l]===r[i]&&s.push(l);for(var u=-1,c=-1/0,d=0;d<s.length;d++){for(var f=0,h=0;h<s.length;h++)f+=n[s[h]*e+s[d]];f>c&&(u=d,c=f)}r[i]=s[u]}return a=Vh(e,n,r),a},Rh=function(e){for(var n=this.cy(),r=this.nodes(),a=IB(e),i={},s=0;s<r.length;s++)i[r[s].id()]=s;var l,u,c,d,f,h;l=r.length,u=l*l,c=new Array(u);for(var v=0;v<u;v++)c[v]=-1/0;for(var p=0;p<l;p++)for(var g=0;g<l;g++)p!==g&&(c[p*l+g]=OB(a.distance,r[p],r[g],a.attributes));d=LB(c,a.preference);for(var y=0;y<l;y++)c[y*l+y]=d;f=new Array(u);for(var m=0;m<u;m++)f[m]=0;h=new Array(u);for(var b=0;b<u;b++)h[b]=0;for(var w=new Array(l),C=new Array(l),E=new Array(l),x=0;x<l;x++)w[x]=0,C[x]=0,E[x]=0;for(var k=new Array(l*a.minIterations),B=0;B<k.length;B++)k[B]=0;var S;for(S=0;S<a.maxIterations;S++){for(var N=0;N<l;N++){for(var D=-1/0,_=-1/0,O=-1,P=0,F=0;F<l;F++)w[F]=f[N*l+F],P=h[N*l+F]+c[N*l+F],P>=D?(_=D,D=P,O=F):P>_&&(_=P);for(var I=0;I<l;I++)f[N*l+I]=(1-a.damping)*(c[N*l+I]-D)+a.damping*w[I];f[N*l+O]=(1-a.damping)*(c[N*l+O]-_)+a.damping*w[O]}for(var M=0;M<l;M++){for(var L=0,V=0;V<l;V++)w[V]=h[V*l+M],C[V]=Math.max(0,f[V*l+M]),L+=C[V];L-=C[M],C[M]=f[M*l+M],L+=C[M];for(var H=0;H<l;H++)h[H*l+M]=(1-a.damping)*Math.min(0,L-C[H])+a.damping*w[H];h[M*l+M]=(1-a.damping)*(L-C[M])+a.damping*w[M]}for(var $=0,z=0;z<l;z++){var j=h[z*l+z]+f[z*l+z]>0?1:0;k[S%a.minIterations*l+z]=j,$+=j}if($>0&&(S>=a.minIterations-1||S==a.maxIterations-1)){for(var ee=0,J=0;J<l;J++){E[J]=0;for(var X=0;X<a.minIterations;X++)E[J]+=k[X*l+J];(E[J]===0||E[J]===a.minIterations)&&ee++}if(ee===l)break}}for(var ne=MB(l,f,h),Y=FB(l,c,ne),A={},K=0;K<ne.length;K++)A[ne[K]]=[];for(var W=0;W<r.length;W++){var oe=i[r[W].id()],he=Y[oe];he!=null&&A[he].push(r[W])}for(var re=new Array(ne.length),se=0;se<ne.length;se++)re[se]=n.collection(A[ne[se]]);return re},AB={affinityPropagation:Rh,ap:Rh},VB=wt({root:void 0,directed:!1}),RB={hierholzer:function(e){if(!Ie(e)){var n=arguments;e={root:n[0],directed:n[1]}}var r=VB(e),a=r.root,i=r.directed,s=this,l=!1,u,c,d;a&&(d=be(a)?this.filter(a)[0].id():a[0].id());var f={},h={};i?s.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.indegree(!0),E=b.outdegree(!0),x=C-E,k=E-C;x==1?u?l=!0:u=w:k==1?c?l=!0:c=w:(k>1||x>1)&&(l=!0),f[w]=[],b.outgoers().forEach(function(B){B.isEdge()&&f[w].push(B.id())})}else h[w]=[void 0,b.target().id()]}):s.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.degree(!0);C%2&&(u?c?l=!0:c=w:u=w),f[w]=[],b.connectedEdges().forEach(function(E){return f[w].push(E.id())})}else h[w]=[b.source().id(),b.target().id()]});var v={found:!1,trail:void 0};if(l)return v;if(c&&u)if(i){if(d&&c!=d)return v;d=c}else{if(d&&c!=d&&u!=d)return v;d||(d=c)}else d||(d=s[0].id());var p=function(w){for(var C=w,E=[w],x,k,B;f[C].length;)x=f[C].shift(),k=h[x][0],B=h[x][1],C!=B?(f[B]=f[B].filter(function(S){return S!=x}),C=B):!i&&C!=k&&(f[k]=f[k].filter(function(S){return S!=x}),C=k),E.unshift(x),E.unshift(C);return E},g=[],y=[];for(y=p(d);y.length!=1;)f[y[0]].length==0?(g.unshift(s.getElementById(y.shift())),g.unshift(s.getElementById(y.shift()))):y=p(y.shift()).concat(y);g.unshift(s.getElementById(y.shift()));for(var m in f)if(f[m].length)return v;return v.found=!0,v.trail=this.spawn(g,!0),v}},Qo=function(){var e=this,n={},r=0,a=0,i=[],s=[],l={},u=function(h,v){for(var p=s.length-1,g=[],y=e.spawn();s[p].x!=h||s[p].y!=v;)g.push(s.pop().edge),p--;g.push(s.pop().edge),g.forEach(function(m){var b=m.connectedNodes().intersection(e);y.merge(m),b.forEach(function(w){var C=w.id(),E=w.connectedEdges().intersection(e);y.merge(w),n[C].cutVertex?y.merge(E.filter(function(x){return x.isLoop()})):y.merge(E)})}),i.push(y)},c=function f(h,v,p){h===p&&(a+=1),n[v]={id:r,low:r++,cutVertex:!1};var g=e.getElementById(v).connectedEdges().intersection(e);if(g.size()===0)i.push(e.spawn(e.getElementById(v)));else{var y,m,b,w;g.forEach(function(C){y=C.source().id(),m=C.target().id(),b=y===v?m:y,b!==p&&(w=C.id(),l[w]||(l[w]=!0,s.push({x:v,y:b,edge:C})),b in n?n[v].low=Math.min(n[v].low,n[b].id):(f(h,b,v),n[v].low=Math.min(n[v].low,n[b].low),n[v].id<=n[b].low&&(n[v].cutVertex=!0,u(v,b))))})}};e.forEach(function(f){if(f.isNode()){var h=f.id();h in n||(a=0,c(h,h),n[h].cutVertex=a>1)}});var d=Object.keys(n).filter(function(f){return n[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(d),components:i}},$B={hopcroftTarjanBiconnected:Qo,htbc:Qo,htb:Qo,hopcroftTarjanBiconnectedComponents:Qo},Jo=function(){var e=this,n={},r=0,a=[],i=[],s=e.spawn(e),l=function u(c){i.push(c),n[c]={index:r,low:r++,explored:!1};var d=e.getElementById(c).connectedEdges().intersection(e);if(d.forEach(function(g){var y=g.target().id();y!==c&&(y in n||u(y),n[y].explored||(n[c].low=Math.min(n[c].low,n[y].low)))}),n[c].index===n[c].low){for(var f=e.spawn();;){var h=i.pop();if(f.merge(e.getElementById(h)),n[h].low=n[c].index,n[h].explored=!0,h===c)break}var v=f.edgesWith(f),p=f.merge(v);a.push(p),s=s.difference(p)}};return e.forEach(function(u){if(u.isNode()){var c=u.id();c in n||l(c)}}),{cut:s,components:a}},zB={tarjanStronglyConnected:Jo,tsc:Jo,tscc:Jo,tarjanStronglyConnectedComponents:Jo},$h={};[Ti,mT,yT,wT,kT,ET,BT,QT,Ca,ka,rc,dB,EB,_B,AB,RB,$B,zB].forEach(function(t){xe($h,t)});/*!
|
|
32
32
|
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
|
|
33
33
|
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
|
|
34
34
|
Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
35
|
-
*/var zh=0,Hh=1,Kh=2,zn=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=zh,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};zn.prototype={fulfill:function(e){return qh(this,Hh,"fulfillValue",e)},reject:function(e){return qh(this,Kh,"rejectReason",e)},then:function(e,n){var r=this,a=new zn;return r.onFulfilled.push(Wh(e,a,"fulfill")),r.onRejected.push(Wh(n,a,"reject")),Uh(r),a.proxy}};var qh=function(e,n,r,a){return e.state===zh&&(e.state=n,e[r]=a,Uh(e)),e},Uh=function(e){e.state===Hh?Gh(e,"onFulfilled",e.fulfillValue):e.state===Kh&&Gh(e,"onRejected",e.rejectReason)},Gh=function(e,n,r){if(e[n].length!==0){var a=e[n];e[n]=[];var i=function(){for(var l=0;l<a.length;l++)a[l](r)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},Wh=function(e,n,r){return function(a){if(typeof e!="function")n[r].call(n,a);else{var i;try{i=e(a)}catch(s){n.reject(s);return}zB(n,i)}}},zB=function t(e,n){if(e===n||e.proxy===n){e.reject(new TypeError("cannot resolve promise with itself"));return}var r;if(st(n)==="object"&&n!==null||typeof n=="function")try{r=n.then}catch(i){e.reject(i);return}if(typeof r=="function"){var a=!1;try{r.call(n,function(i){a||(a=!0,i===n?e.reject(new TypeError("circular thenable chain")):t(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}return}e.fulfill(n)};zn.all=function(t){return new zn(function(e,n){for(var r=new Array(t.length),a=0,i=function(u,c){r[u]=c,a++,a===t.length&&e(r)},s=0;s<t.length;s++)(function(l){var u=t[l],c=u!=null&&u.then!=null;if(c)u.then(function(f){i(l,f)},function(f){n(f)});else{var d=u;i(l,d)}})(s)})},zn.resolve=function(t){return new zn(function(e,n){e(t)})},zn.reject=function(t){return new zn(function(e,n){n(t)})};var xa=typeof Promise<"u"?Promise:zn,oc=function(e,n,r){var a=Kl(e),i=!a,s=this._private=xe({duration:1e3},n,r);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&Ye(s.complete)&&s.completes.push(s.complete),i){var l=e.position();s.startPosition=s.startPosition||{x:l.x,y:l.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(a){var u=e.pan();s.startPan={x:u.x,y:u.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},$r=oc.prototype;xe($r,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var n,r=e.target._private.animation;e.queue?n=r.queue:n=r.current,n.push(this),Ut(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var n=this._private;return e===void 0?n.progress*n.duration:this.progress(e/n.duration)},progress:function(e){var n=this._private,r=n.playing;return e===void 0?n.progress:(r&&this.pause(),n.progress=e,n.started=!1,r&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,n=e.playing;n&&this.pause(),e.progress=1-e.progress,e.started=!1;var r=function(c,d){var f=e[c];f!=null&&(e[c]=e[d],e[d]=f)};if(r("zoom","startZoom"),r("pan","startPan"),r("position","startPosition"),e.style)for(var a=0;a<e.style.length;a++){var i=e.style[a],s=i.name,l=e.startStyle[s];e.startStyle[s]=i,e.style[a]=l}return n&&this.play(),this},promise:function(e){var n=this._private,r;switch(e){case"frame":r=n.frames;break;default:case"complete":case"completed":r=n.completes}return new xa(function(a,i){r.push(function(){a()})})}}),$r.complete=$r.completed,$r.run=$r.play,$r.running=$r.playing;var HB={animated:function(){return function(){var n=this,r=n.length!==void 0,a=r?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return!1;var s=a[0];if(s)return s._private.animation.current.length>0}},clearQueue:function(){return function(){var n=this,r=n.length!==void 0,a=r?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s<a.length;s++){var l=a[s];l._private.animation.queue=[]}return this}},delay:function(){return function(n,r){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:n,duration:n,complete:r}):this}},delayAnimation:function(){return function(n,r){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:n,duration:n,complete:r}):this}},animation:function(){return function(n,r){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this,u=!i,c=!u;if(!l.styleEnabled())return this;var d=l.style();n=xe({},n,r);var f=Object.keys(n).length===0;if(f)return new oc(s[0],n);switch(n.duration===void 0&&(n.duration=400),n.duration){case"slow":n.duration=600;break;case"fast":n.duration=200;break}if(c&&(n.style=d.getPropsList(n.style||n.css),n.css=void 0),c&&n.renderedPosition!=null){var h=n.renderedPosition,v=l.pan(),p=l.zoom();n.position=gh(h,p,v)}if(u&&n.panBy!=null){var g=n.panBy,y=l.pan();n.pan={x:y.x+g.x,y:y.y+g.y}}var m=n.center||n.centre;if(u&&m!=null){var b=l.getCenterPan(m.eles,n.zoom);b!=null&&(n.pan=b)}if(u&&n.fit!=null){var w=n.fit,C=l.getFitViewport(w.eles||w.boundingBox,w.padding);C!=null&&(n.pan=C.pan,n.zoom=C.zoom)}if(u&&Oe(n.zoom)){var k=l.getZoomedViewport(n.zoom);k!=null?(k.zoomed&&(n.zoom=k.zoom),k.panned&&(n.pan=k.pan)):n.zoom=null}return new oc(s[0],n)}},animate:function(){return function(n,r){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;r&&(n=xe({},n,r));for(var u=0;u<s.length;u++){var c=s[u],d=c.animated()&&(n.queue===void 0||n.queue),f=c.animation(n,d?{queue:!0}:void 0);f.play()}return this}},stop:function(){return function(n,r){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;for(var u=0;u<s.length;u++){for(var c=s[u],d=c._private,f=d.animation.current,h=0;h<f.length;h++){var v=f[h],p=v._private;r&&(p.duration=0)}n&&(d.animation.queue=[]),r||(d.animation.current=[])}return l.notify("draw"),this}}},KB=Array.isArray,es=KB,qB=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,UB=/^\w*$/;function GB(t,e){if(es(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||ki(t)?!0:UB.test(t)||!qB.test(t)||e!=null&&t in Object(e)}var WB=GB,jB="[object AsyncFunction]",YB="[object Function]",ZB="[object GeneratorFunction]",XB="[object Proxy]";function QB(t){if(!Lr(t))return!1;var e=nh(t);return e==YB||e==ZB||e==jB||e==XB}var JB=QB,e5=Fo["__core-js_shared__"],sc=e5,jh=function(){var t=/[^.]+$/.exec(sc&&sc.keys&&sc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function t5(t){return!!jh&&jh in t}var n5=t5,r5=Function.prototype,a5=r5.toString;function i5(t){if(t!=null){try{return a5.call(t)}catch{}try{return t+""}catch{}}return""}var o5=i5,s5=/[\\^$.*+?()[\]{}|]/g,l5=/^\[object .+?Constructor\]$/,c5=Function.prototype,u5=Object.prototype,d5=c5.toString,f5=u5.hasOwnProperty,h5=RegExp("^"+d5.call(f5).replace(s5,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p5(t){if(!Lr(t)||n5(t))return!1;var e=JB(t)?h5:l5;return e.test(o5(t))}var v5=p5;function g5(t,e){return t==null?void 0:t[e]}var m5=g5;function y5(t,e){var n=m5(t,e);return v5(n)?n:void 0}var lc=y5,b5=lc(Object,"create"),Oi=b5;function w5(){this.__data__=Oi?Oi(null):{},this.size=0}var C5=w5;function k5(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var x5=k5,E5="__lodash_hash_undefined__",S5=Object.prototype,T5=S5.hasOwnProperty;function B5(t){var e=this.__data__;if(Oi){var n=e[t];return n===E5?void 0:n}return T5.call(e,t)?e[t]:void 0}var N5=B5,D5=Object.prototype,_5=D5.hasOwnProperty;function P5(t){var e=this.__data__;return Oi?e[t]!==void 0:_5.call(e,t)}var O5=P5,I5="__lodash_hash_undefined__";function L5(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Oi&&e===void 0?I5:e,this}var M5=L5;function Ea(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ea.prototype.clear=C5,Ea.prototype.delete=x5,Ea.prototype.get=N5,Ea.prototype.has=O5,Ea.prototype.set=M5;var Yh=Ea;function F5(){this.__data__=[],this.size=0}var A5=F5;function V5(t,e){return t===e||t!==t&&e!==e}var Zh=V5;function R5(t,e){for(var n=t.length;n--;)if(Zh(t[n][0],e))return n;return-1}var ts=R5,$5=Array.prototype,z5=$5.splice;function H5(t){var e=this.__data__,n=ts(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():z5.call(e,n,1),--this.size,!0}var K5=H5;function q5(t){var e=this.__data__,n=ts(e,t);return n<0?void 0:e[n][1]}var U5=q5;function G5(t){return ts(this.__data__,t)>-1}var W5=G5;function j5(t,e){var n=this.__data__,r=ts(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Y5=j5;function Sa(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Sa.prototype.clear=A5,Sa.prototype.delete=K5,Sa.prototype.get=U5,Sa.prototype.has=W5,Sa.prototype.set=Y5;var Z5=Sa,X5=lc(Fo,"Map"),Q5=X5;function J5(){this.size=0,this.__data__={hash:new Yh,map:new(Q5||Z5),string:new Yh}}var eN=J5;function tN(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var nN=tN;function rN(t,e){var n=t.__data__;return nN(e)?n[typeof e=="string"?"string":"hash"]:n.map}var ns=rN;function aN(t){var e=ns(this,t).delete(t);return this.size-=e?1:0,e}var iN=aN;function oN(t){return ns(this,t).get(t)}var sN=oN;function lN(t){return ns(this,t).has(t)}var cN=lN;function uN(t,e){var n=ns(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var dN=uN;function Ta(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ta.prototype.clear=eN,Ta.prototype.delete=iN,Ta.prototype.get=sN,Ta.prototype.has=cN,Ta.prototype.set=dN;var Xh=Ta,fN="Expected a function";function cc(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(fN);var n=function(){var r=arguments,a=e?e.apply(this,r):r[0],i=n.cache;if(i.has(a))return i.get(a);var s=t.apply(this,r);return n.cache=i.set(a,s)||i,s};return n.cache=new(cc.Cache||Xh),n}cc.Cache=Xh;var hN=cc,pN=500;function vN(t){var e=hN(t,function(r){return n.size===pN&&n.clear(),r}),n=e.cache;return e}var gN=vN,mN=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yN=/\\(\\)?/g,bN=gN(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(mN,function(n,r,a,i){e.push(a?i.replace(yN,"$1"):r||n)}),e}),Qh=bN;function wN(t,e){for(var n=-1,r=t==null?0:t.length,a=Array(r);++n<r;)a[n]=e(t[n],n,t);return a}var Jh=wN,CN=1/0,ep=pa?pa.prototype:void 0,tp=ep?ep.toString:void 0;function np(t){if(typeof t=="string")return t;if(es(t))return Jh(t,np)+"";if(ki(t))return tp?tp.call(t):"";var e=t+"";return e=="0"&&1/t==-CN?"-0":e}var kN=np;function xN(t){return t==null?"":kN(t)}var rp=xN;function EN(t,e){return es(t)?t:WB(t,e)?[t]:Qh(rp(t))}var ap=EN,SN=1/0;function TN(t){if(typeof t=="string"||ki(t))return t;var e=t+"";return e=="0"&&1/t==-SN?"-0":e}var uc=TN;function BN(t,e){e=ap(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[uc(e[n++])];return n&&n==r?t:void 0}var NN=BN;function DN(t,e,n){var r=t==null?void 0:NN(t,e);return r===void 0?n:r}var _N=DN,PN=function(){try{var t=lc(Object,"defineProperty");return t({},"",{}),t}catch{}}(),ip=PN;function ON(t,e,n){e=="__proto__"&&ip?ip(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var IN=ON,LN=Object.prototype,MN=LN.hasOwnProperty;function FN(t,e,n){var r=t[e];(!(MN.call(t,e)&&Zh(r,n))||n===void 0&&!(e in t))&&IN(t,e,n)}var AN=FN,VN=9007199254740991,RN=/^(?:0|[1-9]\d*)$/;function $N(t,e){var n=typeof t;return e=e??VN,!!e&&(n=="number"||n!="symbol"&&RN.test(t))&&t>-1&&t%1==0&&t<e}var zN=$N;function HN(t,e,n,r){if(!Lr(t))return t;e=ap(e,t);for(var a=-1,i=e.length,s=i-1,l=t;l!=null&&++a<i;){var u=uc(e[a]),c=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(a!=s){var d=l[u];c=r?r(d,u,l):void 0,c===void 0&&(c=Lr(d)?d:zN(e[a+1])?[]:{})}AN(l,u,c),l=l[u]}return t}var KN=HN;function qN(t,e,n){return t==null?t:KN(t,e,n)}var UN=qN;function GN(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var WN=GN;function jN(t){return es(t)?Jh(t,uc):ki(t)?[t]:WN(Qh(rp(t)))}var YN=jN,ZN={data:function(e){var n={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(a){},beforeSet:function(a,i){},onSet:function(a){},canSet:function(a){return!0}};return e=xe({},n,e),function(a,i){var s=e,l=this,u=l.length!==void 0,c=u?l:[l],d=u?l[0]:l;if(be(a)){var f=a.indexOf(".")!==-1,h=f&&YN(a);if(s.allowGetting&&i===void 0){var v;return d&&(s.beforeGet(d),h&&d._private[s.field][a]===void 0?v=_N(d._private[s.field],h):v=d._private[s.field][a]),v}else if(s.allowSetting&&i!==void 0){var p=!s.immutableKeys[a];if(p){var g=zf({},a,i);s.beforeSet(l,g);for(var y=0,m=c.length;y<m;y++){var b=c[y];s.canSet(b)&&(h&&d._private[s.field][a]===void 0?UN(b._private[s.field],h,i):b._private[s.field][a]=i)}s.updateStyle&&l.updateStyle(),s.onSet(l),s.settingTriggersEvent&&l[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&Oe(a)){var w=a,C,k,E=Object.keys(w);s.beforeSet(l,w);for(var x=0;x<E.length;x++){C=E[x],k=w[C];var B=!s.immutableKeys[C];if(B)for(var S=0;S<c.length;S++){var N=c[S];s.canSet(N)&&(N._private[s.field][C]=k)}}s.updateStyle&&l.updateStyle(),s.onSet(l),s.settingTriggersEvent&&l[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&Ye(a)){var D=a;l.on(s.bindingEvent,D)}else if(s.allowGetting&&a===void 0){var _;return d&&(s.beforeGet(d),_=d._private[s.field]),_}return l}},removeData:function(e){var n={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=xe({},n,e),function(a){var i=e,s=this,l=s.length!==void 0,u=l?s:[s];if(be(a)){for(var c=a.split(/\s+/),d=c.length,f=0;f<d;f++){var h=c[f];if(!ar(h)){var v=!i.immutableKeys[h];if(v)for(var p=0,g=u.length;p<g;p++)u[p]._private[i.field][h]=void 0}}i.triggerEvent&&s[i.triggerFnName](i.event)}else if(a===void 0){for(var y=0,m=u.length;y<m;y++)for(var b=u[y]._private[i.field],w=Object.keys(b),C=0;C<w.length;C++){var k=w[C],E=!i.immutableKeys[k];E&&(b[k]=void 0)}i.triggerEvent&&s[i.triggerFnName](i.event)}return s}}},XN={eventAliasesOn:function(e){var n=e;n.addListener=n.listen=n.bind=n.on,n.unlisten=n.unbind=n.off=n.removeListener,n.trigger=n.emit,n.pon=n.promiseOn=function(r,a){var i=this,s=Array.prototype.slice.call(arguments,0);return new xa(function(l,u){var c=function(v){i.off.apply(i,f),l(v)},d=s.concat([c]),f=d.concat([]);i.on.apply(i,d)})}}},Re={};[HB,ZN,XN].forEach(function(t){xe(Re,t)});var QN={animate:Re.animate(),animation:Re.animation(),animated:Re.animated(),clearQueue:Re.clearQueue(),delay:Re.delay(),delayAnimation:Re.delayAnimation(),stop:Re.stop()},rs={classes:function(e){var n=this;if(e===void 0){var r=[];return n[0]._private.classes.forEach(function(p){return r.push(p)}),r}else Ke(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new ga(e),s=0;s<n.length;s++){for(var l=n[s],u=l._private,c=u.classes,d=!1,f=0;f<e.length;f++){var h=e[f],v=c.has(h);if(!v){d=!0;break}}d||(d=c.size!==e.length),d&&(u.classes=i,a.push(l))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),n},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var n=this[0];return n!=null&&n._private.classes.has(e)},toggleClass:function(e,n){Ke(e)||(e=e.match(/\S+/g)||[]);for(var r=this,a=n===void 0,i=[],s=0,l=r.length;s<l;s++)for(var u=r[s],c=u._private.classes,d=!1,f=0;f<e.length;f++){var h=e[f],v=c.has(h),p=!1;n||a&&!v?(c.add(h),p=!0):(!n||a&&v)&&(c.delete(h),p=!0),!d&&p&&(i.push(u),d=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),r},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,n){var r=this;if(n==null)n=250;else if(n===0)return r;return r.addClass(e),setTimeout(function(){r.removeClass(e)},n),r}};rs.className=rs.classNames=rs.classes;var Ie={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:ct,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ie.variable="(?:[\\w-.]|(?:\\\\"+Ie.metaChar+"))+",Ie.className="(?:[\\w-]|(?:\\\\"+Ie.metaChar+"))+",Ie.value=Ie.string+"|"+Ie.number,Ie.id=Ie.variable,function(){var t,e,n;for(t=Ie.comparatorOp.split("|"),n=0;n<t.length;n++)e=t[n],Ie.comparatorOp+="|@"+e;for(t=Ie.comparatorOp.split("|"),n=0;n<t.length;n++)e=t[n],!(e.indexOf("!")>=0)&&e!=="="&&(Ie.comparatorOp+="|\\!"+e)}();var ze=function(){return{checks:[]}},fe={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},dc=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return uS(t.selector,e.selector)}),JN=function(){for(var t={},e,n=0;n<dc.length;n++)e=dc[n],t[e.selector]=e.matches;return t}(),eD=function(e,n){return JN[e](n)},tD="("+dc.map(function(t){return t.selector}).join("|")+")",Ba=function(e){return e.replace(new RegExp("\\\\("+Ie.metaChar+")","g"),function(n,r){return r})},cr=function(e,n,r){e[e.length-1]=r},fc=[{name:"group",query:!0,regex:"("+Ie.group+")",populate:function(e,n,r){var a=dn(r,1),i=a[0];n.checks.push({type:fe.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:tD,populate:function(e,n,r){var a=dn(r,1),i=a[0];n.checks.push({type:fe.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Ie.id+")",populate:function(e,n,r){var a=dn(r,1),i=a[0];n.checks.push({type:fe.ID,value:Ba(i)})}},{name:"className",query:!0,regex:"\\.("+Ie.className+")",populate:function(e,n,r){var a=dn(r,1),i=a[0];n.checks.push({type:fe.CLASS,value:Ba(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Ie.variable+")\\s*\\]",populate:function(e,n,r){var a=dn(r,1),i=a[0];n.checks.push({type:fe.DATA_EXIST,field:Ba(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Ie.variable+")\\s*("+Ie.comparatorOp+")\\s*("+Ie.value+")\\s*\\]",populate:function(e,n,r){var a=dn(r,3),i=a[0],s=a[1],l=a[2],u=new RegExp("^"+Ie.string+"$").exec(l)!=null;u?l=l.substring(1,l.length-1):l=parseFloat(l),n.checks.push({type:fe.DATA_COMPARE,field:Ba(i),operator:s,value:l})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Ie.boolOp+")\\s*("+Ie.variable+")\\s*\\]",populate:function(e,n,r){var a=dn(r,2),i=a[0],s=a[1];n.checks.push({type:fe.DATA_BOOL,field:Ba(s),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Ie.meta+")\\s*("+Ie.comparatorOp+")\\s*("+Ie.number+")\\s*\\]\\]",populate:function(e,n,r){var a=dn(r,3),i=a[0],s=a[1],l=a[2];n.checks.push({type:fe.META_COMPARE,field:Ba(i),operator:s,value:parseFloat(l)})}},{name:"nextQuery",separator:!0,regex:Ie.separator,populate:function(e,n){var r=e.currentSubject,a=e.edgeCount,i=e.compoundCount,s=e[e.length-1];r!=null&&(s.subject=r,e.currentSubject=null),s.edgeCount=a,s.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var l=e[e.length++]=ze();return l}},{name:"directedEdge",separator:!0,regex:Ie.directedEdge,populate:function(e,n){if(e.currentSubject==null){var r=ze(),a=n,i=ze();return r.checks.push({type:fe.DIRECTED_EDGE,source:a,target:i}),cr(e,n,r),e.edgeCount++,i}else{var s=ze(),l=n,u=ze();return s.checks.push({type:fe.NODE_SOURCE,source:l,target:u}),cr(e,n,s),e.edgeCount++,u}}},{name:"undirectedEdge",separator:!0,regex:Ie.undirectedEdge,populate:function(e,n){if(e.currentSubject==null){var r=ze(),a=n,i=ze();return r.checks.push({type:fe.UNDIRECTED_EDGE,nodes:[a,i]}),cr(e,n,r),e.edgeCount++,i}else{var s=ze(),l=n,u=ze();return s.checks.push({type:fe.NODE_NEIGHBOR,node:l,neighbor:u}),cr(e,n,s),u}}},{name:"child",separator:!0,regex:Ie.child,populate:function(e,n){if(e.currentSubject==null){var r=ze(),a=ze(),i=e[e.length-1];return r.checks.push({type:fe.CHILD,parent:i,child:a}),cr(e,n,r),e.compoundCount++,a}else if(e.currentSubject===n){var s=ze(),l=e[e.length-1],u=ze(),c=ze(),d=ze(),f=ze();return s.checks.push({type:fe.COMPOUND_SPLIT,left:l,right:u,subject:c}),c.checks=n.checks,n.checks=[{type:fe.TRUE}],f.checks.push({type:fe.TRUE}),u.checks.push({type:fe.PARENT,parent:f,child:d}),cr(e,l,s),e.currentSubject=c,e.compoundCount++,d}else{var h=ze(),v=ze(),p=[{type:fe.PARENT,parent:h,child:v}];return h.checks=n.checks,n.checks=p,e.compoundCount++,v}}},{name:"descendant",separator:!0,regex:Ie.descendant,populate:function(e,n){if(e.currentSubject==null){var r=ze(),a=ze(),i=e[e.length-1];return r.checks.push({type:fe.DESCENDANT,ancestor:i,descendant:a}),cr(e,n,r),e.compoundCount++,a}else if(e.currentSubject===n){var s=ze(),l=e[e.length-1],u=ze(),c=ze(),d=ze(),f=ze();return s.checks.push({type:fe.COMPOUND_SPLIT,left:l,right:u,subject:c}),c.checks=n.checks,n.checks=[{type:fe.TRUE}],f.checks.push({type:fe.TRUE}),u.checks.push({type:fe.ANCESTOR,ancestor:f,descendant:d}),cr(e,l,s),e.currentSubject=c,e.compoundCount++,d}else{var h=ze(),v=ze(),p=[{type:fe.ANCESTOR,ancestor:h,descendant:v}];return h.checks=n.checks,n.checks=p,e.compoundCount++,v}}},{name:"subject",modifier:!0,regex:Ie.subject,populate:function(e,n){if(e.currentSubject!=null&&e.currentSubject!==n)return Ve("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=n;var r=e[e.length-1],a=r.checks[0],i=a==null?null:a.type;i===fe.DIRECTED_EDGE?a.type=fe.NODE_TARGET:i===fe.UNDIRECTED_EDGE&&(a.type=fe.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];fc.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var nD=function(e){for(var n,r,a,i=0;i<fc.length;i++){var s=fc[i],l=s.name,u=e.match(s.regexObj);if(u!=null){r=u,n=s,a=l;var c=u[0];e=e.substring(c.length);break}}return{expr:n,match:r,name:a,remaining:e}},rD=function(e){var n=e.match(/^\s+/);if(n){var r=n[0];e=e.substring(r.length)}return e},aD=function(e){var n=this,r=n.inputText=e,a=n[0]=ze();for(n.length=1,r=rD(r);;){var i=nD(r);if(i.expr==null)return Ve("The selector `"+e+"`is invalid"),!1;var s=i.match.slice(1),l=i.expr.populate(n,a,s);if(l===!1)return!1;if(l!=null&&(a=l),r=i.remaining,r.match(/^\s*$/))break}var u=n[n.length-1];n.currentSubject!=null&&(u.subject=n.currentSubject),u.edgeCount=n.edgeCount,u.compoundCount=n.compoundCount;for(var c=0;c<n.length;c++){var d=n[c];if(d.compoundCount>0&&d.edgeCount>0)return Ve("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(d.edgeCount>1)return Ve("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;d.edgeCount===1&&Ve("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},iD=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(d){return d??""},n=function(d){return be(d)?'"'+d+'"':e(d)},r=function(d){return" "+d+" "},a=function(d,f){var h=d.type,v=d.value;switch(h){case fe.GROUP:{var p=e(v);return p.substring(0,p.length-1)}case fe.DATA_COMPARE:{var g=d.field,y=d.operator;return"["+g+r(e(y))+n(v)+"]"}case fe.DATA_BOOL:{var m=d.operator,b=d.field;return"["+e(m)+b+"]"}case fe.DATA_EXIST:{var w=d.field;return"["+w+"]"}case fe.META_COMPARE:{var C=d.operator,k=d.field;return"[["+k+r(e(C))+n(v)+"]]"}case fe.STATE:return v;case fe.ID:return"#"+v;case fe.CLASS:return"."+v;case fe.PARENT:case fe.CHILD:return i(d.parent,f)+r(">")+i(d.child,f);case fe.ANCESTOR:case fe.DESCENDANT:return i(d.ancestor,f)+" "+i(d.descendant,f);case fe.COMPOUND_SPLIT:{var E=i(d.left,f),x=i(d.subject,f),B=i(d.right,f);return E+(E.length>0?" ":"")+x+B}case fe.TRUE:return""}},i=function(d,f){return d.checks.reduce(function(h,v,p){return h+(f===d&&p===0?"$":"")+a(v,f)},"")},s="",l=0;l<this.length;l++){var u=this[l];s+=i(u,u.subject),this.length>1&&l<this.length-1&&(s+=", ")}return this.toStringCache=s,s},oD={parse:aD,toString:iD},op=function(e,n,r){var a,i=be(e),s=le(e),l=be(r),u,c,d=!1,f=!1,h=!1;switch(n.indexOf("!")>=0&&(n=n.replace("!",""),f=!0),n.indexOf("@")>=0&&(n=n.replace("@",""),d=!0),(i||l||d)&&(u=!i&&!s?"":""+e,c=""+r),d&&(e=u=u.toLowerCase(),r=c=c.toLowerCase()),n){case"*=":a=u.indexOf(c)>=0;break;case"$=":a=u.indexOf(c,u.length-c.length)>=0;break;case"^=":a=u.indexOf(c)===0;break;case"=":a=e===r;break;case">":h=!0,a=e>r;break;case">=":h=!0,a=e>=r;break;case"<":h=!0,a=e<r;break;case"<=":h=!0,a=e<=r;break;default:a=!1;break}return f&&(e!=null||!h)&&(a=!a),a},sD=function(e,n){switch(n){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},lD=function(e){return e!==void 0},hc=function(e,n){return e.data(n)},cD=function(e,n){return e[n]()},Xe=[],je=function(e,n){return e.checks.every(function(r){return Xe[r.type](r,n)})};Xe[fe.GROUP]=function(t,e){var n=t.value;return n==="*"||n===e.group()},Xe[fe.STATE]=function(t,e){var n=t.value;return eD(n,e)},Xe[fe.ID]=function(t,e){var n=t.value;return e.id()===n},Xe[fe.CLASS]=function(t,e){var n=t.value;return e.hasClass(n)},Xe[fe.META_COMPARE]=function(t,e){var n=t.field,r=t.operator,a=t.value;return op(cD(e,n),r,a)},Xe[fe.DATA_COMPARE]=function(t,e){var n=t.field,r=t.operator,a=t.value;return op(hc(e,n),r,a)},Xe[fe.DATA_BOOL]=function(t,e){var n=t.field,r=t.operator;return sD(hc(e,n),r)},Xe[fe.DATA_EXIST]=function(t,e){var n=t.field;return t.operator,lD(hc(e,n))},Xe[fe.UNDIRECTED_EDGE]=function(t,e){var n=t.nodes[0],r=t.nodes[1],a=e.source(),i=e.target();return je(n,a)&&je(r,i)||je(r,a)&&je(n,i)},Xe[fe.NODE_NEIGHBOR]=function(t,e){return je(t.node,e)&&e.neighborhood().some(function(n){return n.isNode()&&je(t.neighbor,n)})},Xe[fe.DIRECTED_EDGE]=function(t,e){return je(t.source,e.source())&&je(t.target,e.target())},Xe[fe.NODE_SOURCE]=function(t,e){return je(t.source,e)&&e.outgoers().some(function(n){return n.isNode()&&je(t.target,n)})},Xe[fe.NODE_TARGET]=function(t,e){return je(t.target,e)&&e.incomers().some(function(n){return n.isNode()&&je(t.source,n)})},Xe[fe.CHILD]=function(t,e){return je(t.child,e)&&je(t.parent,e.parent())},Xe[fe.PARENT]=function(t,e){return je(t.parent,e)&&e.children().some(function(n){return je(t.child,n)})},Xe[fe.DESCENDANT]=function(t,e){return je(t.descendant,e)&&e.ancestors().some(function(n){return je(t.ancestor,n)})},Xe[fe.ANCESTOR]=function(t,e){return je(t.ancestor,e)&&e.descendants().some(function(n){return je(t.descendant,n)})},Xe[fe.COMPOUND_SPLIT]=function(t,e){return je(t.subject,e)&&je(t.left,e)&&je(t.right,e)},Xe[fe.TRUE]=function(){return!0},Xe[fe.COLLECTION]=function(t,e){var n=t.value;return n.has(e)},Xe[fe.FILTER]=function(t,e){var n=t.value;return n(e)};var uD=function(e){var n=this;if(n.length===1&&n[0].checks.length===1&&n[0].checks[0].type===fe.ID)return e.getElementById(n[0].checks[0].value).collection();var r=function(i){for(var s=0;s<n.length;s++){var l=n[s];if(je(l,i))return!0}return!1};return n.text()==null&&(r=function(){return!0}),e.filter(r)},dD=function(e){for(var n=this,r=0;r<n.length;r++){var a=n[r];if(je(a,e))return!0}return!1},fD={matches:dD,filter:uD},ur=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||be(e)&&e.match(/^\s*$/)||(Ut(e)?this.addQuery({checks:[{type:fe.COLLECTION,value:e.collection()}]}):Ye(e)?this.addQuery({checks:[{type:fe.FILTER,value:e}]}):be(e)?this.parse(e)||(this.invalid=!0):Ze("A selector must be created from a string; found "))},dr=ur.prototype;[oD,fD].forEach(function(t){return xe(dr,t)}),dr.text=function(){return this.inputText},dr.size=function(){return this.length},dr.eq=function(t){return this[t]},dr.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()},dr.addQuery=function(t){this[this.length++]=t},dr.selector=dr.toString;var fr={allAre:function(e){var n=new ur(e);return this.every(function(r){return n.matches(r)})},is:function(e){var n=new ur(e);return this.some(function(r){return n.matches(r)})},some:function(e,n){for(var r=0;r<this.length;r++){var a=n?e.apply(n,[this[r],r,this]):e(this[r],r,this);if(a)return!0}return!1},every:function(e,n){for(var r=0;r<this.length;r++){var a=n?e.apply(n,[this[r],r,this]):e(this[r],r,this);if(!a)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var n=this.length,r=e.length;return n!==r?!1:n===1?this[0]===e[0]:this.every(function(a){return e.hasElementWithId(a.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(n){return e.hasElementWithId(n.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var n=this.neighborhood();return e.every(function(r){return n.hasElementWithId(r.id())})},contains:function(e){e=this.cy().collection(e);var n=this;return e.every(function(r){return n.hasElementWithId(r.id())})}};fr.allAreNeighbours=fr.allAreNeighbors,fr.has=fr.contains,fr.equal=fr.equals=fr.same;var en=function(e,n){return function(a,i,s,l){var u=a,c=this,d;if(u==null?d="":Ut(u)&&u.length===1&&(d=u.id()),c.length===1&&d){var f=c[0]._private,h=f.traversalCache=f.traversalCache||{},v=h[n]=h[n]||[],p=Mr(d),g=v[p];return g||(v[p]=e.call(c,a,i,s,l))}else return e.call(c,a,i,s,l)}},Na={parent:function(e){var n=[];if(this.length===1){var r=this[0]._private.parent;if(r)return r}for(var a=0;a<this.length;a++){var i=this[a],s=i._private.parent;s&&n.push(s)}return this.spawn(n,!0).filter(e)},parents:function(e){for(var n=[],r=this.parent();r.nonempty();){for(var a=0;a<r.length;a++){var i=r[a];n.push(i)}r=r.parent()}return this.spawn(n,!0).filter(e)},commonAncestors:function(e){for(var n,r=0;r<this.length;r++){var a=this[r],i=a.parents();n=n||i,n=n.intersect(i)}return n.filter(e)},orphans:function(e){return this.stdFilter(function(n){return n.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(n){return n.isChild()}).filter(e)},children:en(function(t){for(var e=[],n=0;n<this.length;n++)for(var r=this[n],a=r._private.children,i=0;i<a.length;i++)e.push(a[i]);return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var n=[];function r(a){for(var i=0;i<a.length;i++){var s=a[i];n.push(s),s.children().nonempty()&&r(s.children())}}return r(this.children()),this.spawn(n,!0).filter(e)}};function pc(t,e,n,r){for(var a=[],i=new ga,s=t.cy(),l=s.hasCompoundNodes(),u=0;u<t.length;u++){var c=t[u];n?a.push(c):l&&r(a,i,c)}for(;a.length>0;){var d=a.shift();e(d),i.add(d.id()),l&&r(a,i,d)}return t}function sp(t,e,n){if(n.isParent())for(var r=n._private.children,a=0;a<r.length;a++){var i=r[a];e.has(i.id())||t.push(i)}}Na.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return pc(this,t,e,sp)};function lp(t,e,n){if(n.isChild()){var r=n._private.parent;e.has(r.id())||t.push(r)}}Na.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return pc(this,t,e,lp)};function hD(t,e,n){lp(t,e,n),sp(t,e,n)}Na.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return pc(this,t,e,hD)},Na.ancestors=Na.parents;var Ii,cp;Ii=cp={data:Re.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Re.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Re.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Re.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Re.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Re.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},Ii.attr=Ii.data,Ii.removeAttr=Ii.removeData;var pD=cp,as={};function vc(t){return function(e){var n=this;if(e===void 0&&(e=!0),n.length!==0)if(n.isNode()&&!n.removed()){for(var r=0,a=n[0],i=a._private.edges,s=0;s<i.length;s++){var l=i[s];!e&&l.isLoop()||(r+=t(a,l))}return r}else return}}xe(as,{degree:vc(function(t,e){return e.source().same(e.target())?2:1}),indegree:vc(function(t,e){return e.target().same(t)?1:0}),outdegree:vc(function(t,e){return e.source().same(t)?1:0})});function Da(t,e){return function(n){for(var r,a=this.nodes(),i=0;i<a.length;i++){var s=a[i],l=s[t](n);l!==void 0&&(r===void 0||e(l,r))&&(r=l)}return r}}xe(as,{minDegree:Da("degree",function(t,e){return t<e}),maxDegree:Da("degree",function(t,e){return t>e}),minIndegree:Da("indegree",function(t,e){return t<e}),maxIndegree:Da("indegree",function(t,e){return t>e}),minOutdegree:Da("outdegree",function(t,e){return t<e}),maxOutdegree:Da("outdegree",function(t,e){return t>e})}),xe(as,{totalDegree:function(e){for(var n=0,r=this.nodes(),a=0;a<r.length;a++)n+=r[a].degree(e);return n}});var hn,up,dp=function(e,n,r){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var s=i._private.position,l={x:n.x!=null?n.x-s.x:0,y:n.y!=null?n.y-s.y:0};i.isParent()&&!(l.x===0&&l.y===0)&&i.children().shift(l,r),i.dirtyBoundingBoxCache()}}},fp={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,n){dp(e,n,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};hn=up={position:Re.data(fp),silentPosition:Re.data(xe({},fp,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,n){dp(e,n,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,n){if(Oe(e))n?this.silentPosition(e):this.position(e);else if(Ye(e)){var r=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var s=this[i],l=void 0;(l=r(s,i))&&(n?s.silentPosition(l):s.position(l))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,n,r){var a;if(Oe(e)?(a={x:le(e.x)?e.x:0,y:le(e.y)?e.y:0},r=n):be(e)&&le(n)&&(a={x:0,y:0},a[e]=n),a!=null){var i=this.cy();i.startBatch();for(var s=0;s<this.length;s++){var l=this[s];if(!(i.hasCompoundNodes()&&l.isChild()&&l.ancestors().anySame(this))){var u=l.position(),c={x:u.x+a.x,y:u.y+a.y};r?l.silentPosition(c):l.position(c)}}i.endBatch()}return this},silentShift:function(e,n){return Oe(e)?this.shift(e,!0):be(e)&&le(n)&&this.shift(e,n,!0),this},renderedPosition:function(e,n){var r=this[0],a=this.cy(),i=a.zoom(),s=a.pan(),l=Oe(e)?e:void 0,u=l!==void 0||n!==void 0&&be(e);if(r&&r.isNode())if(u)for(var c=0;c<this.length;c++){var d=this[c];n!==void 0?d.position(e,(n-s[e])/i):l!==void 0&&d.position(gh(l,i,s))}else{var f=r.position();return l=Ho(f,i,s),e===void 0?l:l[e]}else if(!u)return;return this},relativePosition:function(e,n){var r=this[0],a=this.cy(),i=Oe(e)?e:void 0,s=i!==void 0||n!==void 0&&be(e),l=a.hasCompoundNodes();if(r&&r.isNode())if(s)for(var u=0;u<this.length;u++){var c=this[u],d=l?c.parent():null,f=d&&d.length>0,h=f;f&&(d=d[0]);var v=h?d.position():{x:0,y:0};n!==void 0?c.position(e,n+v[e]):i!==void 0&&c.position({x:i.x+v.x,y:i.y+v.y})}else{var p=r.position(),g=l?r.parent():null,y=g&&g.length>0,m=y;y&&(g=g[0]);var b=m?g.position():{x:0,y:0};return i={x:p.x-b.x,y:p.y-b.y},e===void 0?i:i[e]}else if(!s)return;return this}},hn.modelPosition=hn.point=hn.position,hn.modelPositions=hn.points=hn.positions,hn.renderedPoint=hn.renderedPosition,hn.relativePoint=hn.relativePosition;var vD=up,_a,hr;_a=hr={},hr.renderedBoundingBox=function(t){var e=this.boundingBox(t),n=this.cy(),r=n.zoom(),a=n.pan(),i=e.x1*r+a.x,s=e.x2*r+a.x,l=e.y1*r+a.y,u=e.y2*r+a.y;return{x1:i,x2:s,y1:l,y2:u,w:s-i,h:u-l}},hr.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(n){if(n.isParent()){var r=n._private;r.compoundBoundsClean=!1,r.bbCache=null,t||n.emitAndNotify("bounds")}}),this)},hr.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function n(s){if(!s.isParent())return;var l=s._private,u=s.children(),c=s.pstyle("compound-sizing-wrt-labels").value==="include",d={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},f=u.boundingBox({includeLabels:c,includeOverlays:!1,useCache:!1}),h=l.position;(f.w===0||f.h===0)&&(f={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},f.x1=h.x-f.w/2,f.x2=h.x+f.w/2,f.y1=h.y-f.h/2,f.y2=h.y+f.h/2);function v(S,N,D){var _=0,I=0,P=N+D;return S>0&&P>0&&(_=N/P*S,I=D/P*S),{biasDiff:_,biasComplementDiff:I}}function p(S,N,D,_){if(D.units==="%")switch(_){case"width":return S>0?D.pfValue*S:0;case"height":return N>0?D.pfValue*N:0;case"average":return S>0&&N>0?D.pfValue*(S+N)/2:0;case"min":return S>0&&N>0?S>N?D.pfValue*N:D.pfValue*S:0;case"max":return S>0&&N>0?S>N?D.pfValue*S:D.pfValue*N:0;default:return 0}else return D.units==="px"?D.pfValue:0}var g=d.width.left.value;d.width.left.units==="px"&&d.width.val>0&&(g=g*100/d.width.val);var y=d.width.right.value;d.width.right.units==="px"&&d.width.val>0&&(y=y*100/d.width.val);var m=d.height.top.value;d.height.top.units==="px"&&d.height.val>0&&(m=m*100/d.height.val);var b=d.height.bottom.value;d.height.bottom.units==="px"&&d.height.val>0&&(b=b*100/d.height.val);var w=v(d.width.val-f.w,g,y),C=w.biasDiff,k=w.biasComplementDiff,E=v(d.height.val-f.h,m,b),x=E.biasDiff,B=E.biasComplementDiff;l.autoPadding=p(f.w,f.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),l.autoWidth=Math.max(f.w,d.width.val),h.x=(-C+f.x1+f.x2+k)/2,l.autoHeight=Math.max(f.h,d.height.val),h.y=(-x+f.y1+f.y2+B)/2}for(var r=0;r<this.length;r++){var a=this[r],i=a._private;(!i.compoundBoundsClean||t)&&(n(a),e.batching()||(i.compoundBoundsClean=!0))}return this};var tn=function(e){return e===1/0||e===-1/0?0:e},pn=function(e,n,r,a,i){a-n===0||i-r===0||n==null||r==null||a==null||i==null||(e.x1=n<e.x1?n:e.x1,e.x2=a>e.x2?a:e.x2,e.y1=r<e.y1?r:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},zr=function(e,n){return n==null?e:pn(e,n.x1,n.y1,n.x2,n.y2)},Li=function(e,n,r){return fn(e,n,r)},is=function(e,n,r){if(!n.cy().headless()){var a=n._private,i=a.rstyle,s=i.arrowWidth/2,l=n.pstyle(r+"-arrow-shape").value,u,c;if(l!=="none"){r==="source"?(u=i.srcX,c=i.srcY):r==="target"?(u=i.tgtX,c=i.tgtY):(u=i.midX,c=i.midY);var d=a.arrowBounds=a.arrowBounds||{},f=d[r]=d[r]||{};f.x1=u-s,f.y1=c-s,f.x2=u+s,f.y2=c+s,f.w=f.x2-f.x1,f.h=f.y2-f.y1,qo(f,1),pn(e,f.x1,f.y1,f.x2,f.y2)}}},gc=function(e,n,r){if(!n.cy().headless()){var a;r?a=r+"-":a="";var i=n._private,s=i.rstyle,l=n.pstyle(a+"label").strValue;if(l){var u=n.pstyle("text-halign"),c=n.pstyle("text-valign"),d=Li(s,"labelWidth",r),f=Li(s,"labelHeight",r),h=Li(s,"labelX",r),v=Li(s,"labelY",r),p=n.pstyle(a+"text-margin-x").pfValue,g=n.pstyle(a+"text-margin-y").pfValue,y=n.isEdge(),m=n.pstyle(a+"text-rotation"),b=n.pstyle("text-outline-width").pfValue,w=n.pstyle("text-border-width").pfValue,C=w/2,k=n.pstyle("text-background-padding").pfValue,E=2,x=f,B=d,S=B/2,N=x/2,D,_,I,P;if(y)D=h-S,_=h+S,I=v-N,P=v+N;else{switch(u.value){case"left":D=h-B,_=h;break;case"center":D=h-S,_=h+S;break;case"right":D=h,_=h+B;break}switch(c.value){case"top":I=v-x,P=v;break;case"center":I=v-N,P=v+N;break;case"bottom":I=v,P=v+x;break}}D+=p-Math.max(b,C)-k-E,_+=p+Math.max(b,C)+k+E,I+=g-Math.max(b,C)-k-E,P+=g+Math.max(b,C)+k+E;var F=r||"main",O=i.labelBounds,M=O[F]=O[F]||{};M.x1=D,M.y1=I,M.x2=_,M.y2=P,M.w=_-D,M.h=P-I;var L=y&&m.strValue==="autorotate",V=m.pfValue!=null&&m.pfValue!==0;if(L||V){var H=L?Li(i.rstyle,"labelAngle",r):m.pfValue,$=Math.cos(H),z=Math.sin(H),j=(D+_)/2,ee=(I+P)/2;if(!y){switch(u.value){case"left":j=_;break;case"right":j=D;break}switch(c.value){case"top":ee=P;break;case"bottom":ee=I;break}}var J=function(he,re){return he=he-j,re=re-ee,{x:he*$-re*z+j,y:he*z+re*$+ee}},X=J(D,I),ne=J(D,P),Y=J(_,I),A=J(_,P);D=Math.min(X.x,ne.x,Y.x,A.x),_=Math.max(X.x,ne.x,Y.x,A.x),I=Math.min(X.y,ne.y,Y.y,A.y),P=Math.max(X.y,ne.y,Y.y,A.y)}var K=F+"Rot",W=O[K]=O[K]||{};W.x1=D,W.y1=I,W.x2=_,W.y2=P,W.w=_-D,W.h=P-I,pn(e,D,I,_,P),pn(i.labelBounds.all,D,I,_,P)}return e}},gD=function(e,n){if(!n.cy().headless()){var r=n.pstyle("outline-opacity").value,a=n.pstyle("outline-width").value;if(r>0&&a>0){var i=n.pstyle("outline-offset").value,s=n.pstyle("shape").value,l=a+i,u=(e.w+l*2)/e.w,c=(e.h+l*2)/e.h,d=0,f=0;["diamond","pentagon","round-triangle"].includes(s)?(u=(e.w+l*2.4)/e.w,f=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?u=(e.w+l*2.4)/e.w:s==="star"?(u=(e.w+l*2.8)/e.w,c=(e.h+l*2.6)/e.h,f=-l/3.8):s==="triangle"?(u=(e.w+l*2.8)/e.w,c=(e.h+l*2.4)/e.h,f=-l/1.4):s==="vee"&&(u=(e.w+l*4.4)/e.w,c=(e.h+l*3.8)/e.h,f=-l*.5);var h=e.h*c-e.h,v=e.w*u-e.w;if(Uo(e,[Math.ceil(h/2),Math.ceil(v/2)]),d!=0||f!==0){var p=AT(e,d,f);yh(e,p)}}}},mD=function(e,n){var r=e._private.cy,a=r.styleEnabled(),i=r.headless(),s=zt(),l=e._private,u=e.isNode(),c=e.isEdge(),d,f,h,v,p,g,y=l.rstyle,m=u&&a?e.pstyle("bounds-expansion").pfValue:[0],b=function(ue){return ue.pstyle("display").value!=="none"},w=!a||b(e)&&(!c||b(e.source())&&b(e.target()));if(w){var C=0,k=0;a&&n.includeOverlays&&(C=e.pstyle("overlay-opacity").value,C!==0&&(k=e.pstyle("overlay-padding").value));var E=0,x=0;a&&n.includeUnderlays&&(E=e.pstyle("underlay-opacity").value,E!==0&&(x=e.pstyle("underlay-padding").value));var B=Math.max(k,x),S=0,N=0;if(a&&(S=e.pstyle("width").pfValue,N=S/2),u&&n.includeNodes){var D=e.position();p=D.x,g=D.y;var _=e.outerWidth(),I=_/2,P=e.outerHeight(),F=P/2;d=p-I,f=p+I,h=g-F,v=g+F,pn(s,d,h,f,v),a&&n.includeOutlines&&gD(s,e)}else if(c&&n.includeEdges)if(a&&!i){var O=e.pstyle("curve-style").strValue;if(d=Math.min(y.srcX,y.midX,y.tgtX),f=Math.max(y.srcX,y.midX,y.tgtX),h=Math.min(y.srcY,y.midY,y.tgtY),v=Math.max(y.srcY,y.midY,y.tgtY),d-=N,f+=N,h-=N,v+=N,pn(s,d,h,f,v),O==="haystack"){var M=y.haystackPts;if(M&&M.length===2){if(d=M[0].x,h=M[0].y,f=M[1].x,v=M[1].y,d>f){var L=d;d=f,f=L}if(h>v){var V=h;h=v,v=V}pn(s,d-N,h-N,f+N,v+N)}}else if(O==="bezier"||O==="unbundled-bezier"||O.endsWith("segments")||O.endsWith("taxi")){var H;switch(O){case"bezier":case"unbundled-bezier":H=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":H=y.linePts;break}if(H!=null)for(var $=0;$<H.length;$++){var z=H[$];d=z.x-N,f=z.x+N,h=z.y-N,v=z.y+N,pn(s,d,h,f,v)}}}else{var j=e.source(),ee=j.position(),J=e.target(),X=J.position();if(d=ee.x,f=X.x,h=ee.y,v=X.y,d>f){var ne=d;d=f,f=ne}if(h>v){var Y=h;h=v,v=Y}d-=N,f+=N,h-=N,v+=N,pn(s,d,h,f,v)}if(a&&n.includeEdges&&c&&(is(s,e,"mid-source"),is(s,e,"mid-target"),is(s,e,"source"),is(s,e,"target")),a){var A=e.pstyle("ghost").value==="yes";if(A){var K=e.pstyle("ghost-offset-x").pfValue,W=e.pstyle("ghost-offset-y").pfValue;pn(s,s.x1+K,s.y1+W,s.x2+K,s.y2+W)}}var oe=l.bodyBounds=l.bodyBounds||{};bh(oe,s),Uo(oe,m),qo(oe,1),a&&(d=s.x1,f=s.x2,h=s.y1,v=s.y2,pn(s,d-B,h-B,f+B,v+B));var he=l.overlayBounds=l.overlayBounds||{};bh(he,s),Uo(he,m),qo(he,1);var re=l.labelBounds=l.labelBounds||{};re.all!=null?FT(re.all):re.all=zt(),a&&n.includeLabels&&(n.includeMainLabels&&gc(s,e,null),c&&(n.includeSourceLabels&&gc(s,e,"source"),n.includeTargetLabels&&gc(s,e,"target")))}return s.x1=tn(s.x1),s.y1=tn(s.y1),s.x2=tn(s.x2),s.y2=tn(s.y2),s.w=tn(s.x2-s.x1),s.h=tn(s.y2-s.y1),s.w>0&&s.h>0&&w&&(Uo(s,m),qo(s,1)),s},hp=function(e){var n=0,r=function(s){return(s?1:0)<<n++},a=0;return a+=r(e.incudeNodes),a+=r(e.includeEdges),a+=r(e.includeLabels),a+=r(e.includeMainLabels),a+=r(e.includeSourceLabels),a+=r(e.includeTargetLabels),a+=r(e.includeOverlays),a+=r(e.includeOutlines),a},pp=function(e){if(e.isEdge()){var n=e.source().position(),r=e.target().position(),a=function(s){return Math.round(s)};return rT([a(n.x),a(n.y),a(r.x),a(r.y)])}else return 0},vp=function(e,n){var r=e._private,a,i=e.isEdge(),s=n==null?gp:hp(n),l=s===gp,u=pp(e),c=r.bbCachePosKey===u,d=n.useCache&&c,f=function(g){return g._private.bbCache==null||g._private.styleDirty},h=!d||f(e)||i&&f(e.source())||f(e.target());if(h?(c||e.recalculateRenderedStyle(d),a=mD(e,Mi),r.bbCache=a,r.bbCachePosKey=u):a=r.bbCache,!l){var v=e.isNode();a=zt(),(n.includeNodes&&v||n.includeEdges&&!v)&&(n.includeOverlays?zr(a,r.overlayBounds):zr(a,r.bodyBounds)),n.includeLabels&&(n.includeMainLabels&&(!i||n.includeSourceLabels&&n.includeTargetLabels)?zr(a,r.labelBounds.all):(n.includeMainLabels&&zr(a,r.labelBounds.mainRot),n.includeSourceLabels&&zr(a,r.labelBounds.sourceRot),n.includeTargetLabels&&zr(a,r.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},Mi={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},gp=hp(Mi),mp=wt(Mi);hr.boundingBox=function(t){var e;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(t===void 0||t.useCache===void 0||t.useCache===!0))t===void 0?t=Mi:t=mp(t),e=vp(this[0],t);else{e=zt(),t=t||Mi;var n=mp(t),r=this,a=r.cy(),i=a.styleEnabled();if(i)for(var s=0;s<r.length;s++){var l=r[s],u=l._private,c=pp(l),d=u.bbCachePosKey===c,f=n.useCache&&d&&!u.styleDirty;l.recalculateRenderedStyle(f)}this.updateCompoundBounds(!t.useCache);for(var h=0;h<r.length;h++){var v=r[h];zr(e,vp(v,n))}}return e.x1=tn(e.x1),e.y1=tn(e.y1),e.x2=tn(e.x2),e.y2=tn(e.y2),e.w=tn(e.x2-e.x1),e.h=tn(e.y2-e.y1),e},hr.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},hr.boundingBoxAt=function(t){var e=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),a=n.collection();if(r&&(a=e.filter(function(c){return c.isParent()}),e=e.not(a)),Oe(t)){var i=t;t=function(){return i}}var s=function(d,f){return d._private.bbAtOldPos=t(d,f)},l=function(d){return d._private.bbAtOldPos};n.startBatch(),e.forEach(s).silentPositions(t),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var u=MT(this.boundingBox({useCache:!1}));return e.silentPositions(l),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),n.endBatch(),u},_a.boundingbox=_a.bb=_a.boundingBox,_a.renderedBoundingbox=_a.renderedBoundingBox;var yD=hr,Fi,Ai;Fi=Ai={};var yp=function(e){e.uppercaseName=Zf(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=Zf(e.outerName),Fi[e.name]=function(){var r=this[0],a=r._private,i=a.cy,s=i._private.styleEnabled;if(r)if(s){if(r.isParent())return r.updateCompoundBounds(),a[e.autoName]||0;var l=r.pstyle(e.name);switch(l.strValue){case"label":return r.recalculateRenderedStyle(),a.rstyle[e.labelName]||0;default:return l.pfValue}}else return 1},Fi["outer"+e.uppercaseName]=function(){var r=this[0],a=r._private,i=a.cy,s=i._private.styleEnabled;if(r)if(s){var l=r[e.name](),u=r.pstyle("border-width").pfValue,c=2*r.padding();return l+u+c}else return 1},Fi["rendered"+e.uppercaseName]=function(){var r=this[0];if(r){var a=r[e.name]();return a*this.cy().zoom()}},Fi["rendered"+e.uppercaseOuterName]=function(){var r=this[0];if(r){var a=r[e.outerName]();return a*this.cy().zoom()}}};yp({name:"width"}),yp({name:"height"}),Ai.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue},Ai.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()},Ai.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var bD=Ai,wD=function(e,n){if(e.isEdge())return n(e)},CD=function(e,n){if(e.isEdge()){var r=e.cy();return Ho(n(e),r.zoom(),r.pan())}},kD=function(e,n){if(e.isEdge()){var r=e.cy(),a=r.pan(),i=r.zoom();return n(e).map(function(s){return Ho(s,i,a)})}},xD=function(e){return e.renderer().getControlPoints(e)},ED=function(e){return e.renderer().getSegmentPoints(e)},SD=function(e){return e.renderer().getSourceEndpoint(e)},TD=function(e){return e.renderer().getTargetEndpoint(e)},BD=function(e){return e.renderer().getEdgeMidpoint(e)},bp={controlPoints:{get:xD,mult:!0},segmentPoints:{get:ED,mult:!0},sourceEndpoint:{get:SD},targetEndpoint:{get:TD},midpoint:{get:BD}},ND=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},DD=Object.keys(bp).reduce(function(t,e){var n=bp[e],r=ND(e);return t[e]=function(){return wD(this,n.get)},n.mult?t[r]=function(){return kD(this,n.get)}:t[r]=function(){return CD(this,n.get)},t},{}),_D=xe({},vD,yD,bD,DD);/*!
|
|
35
|
+
*/var zh=0,Hh=1,Kh=2,zn=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=zh,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};zn.prototype={fulfill:function(e){return qh(this,Hh,"fulfillValue",e)},reject:function(e){return qh(this,Kh,"rejectReason",e)},then:function(e,n){var r=this,a=new zn;return r.onFulfilled.push(Wh(e,a,"fulfill")),r.onRejected.push(Wh(n,a,"reject")),Uh(r),a.proxy}};var qh=function(e,n,r,a){return e.state===zh&&(e.state=n,e[r]=a,Uh(e)),e},Uh=function(e){e.state===Hh?Gh(e,"onFulfilled",e.fulfillValue):e.state===Kh&&Gh(e,"onRejected",e.rejectReason)},Gh=function(e,n,r){if(e[n].length!==0){var a=e[n];e[n]=[];var i=function(){for(var l=0;l<a.length;l++)a[l](r)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},Wh=function(e,n,r){return function(a){if(typeof e!="function")n[r].call(n,a);else{var i;try{i=e(a)}catch(s){n.reject(s);return}HB(n,i)}}},HB=function t(e,n){if(e===n||e.proxy===n){e.reject(new TypeError("cannot resolve promise with itself"));return}var r;if(st(n)==="object"&&n!==null||typeof n=="function")try{r=n.then}catch(i){e.reject(i);return}if(typeof r=="function"){var a=!1;try{r.call(n,function(i){a||(a=!0,i===n?e.reject(new TypeError("circular thenable chain")):t(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}return}e.fulfill(n)};zn.all=function(t){return new zn(function(e,n){for(var r=new Array(t.length),a=0,i=function(u,c){r[u]=c,a++,a===t.length&&e(r)},s=0;s<t.length;s++)(function(l){var u=t[l],c=u!=null&&u.then!=null;if(c)u.then(function(f){i(l,f)},function(f){n(f)});else{var d=u;i(l,d)}})(s)})},zn.resolve=function(t){return new zn(function(e,n){e(t)})},zn.reject=function(t){return new zn(function(e,n){n(t)})};var Ea=typeof Promise<"u"?Promise:zn,oc=function(e,n,r){var a=Kl(e),i=!a,s=this._private=xe({duration:1e3},n,r);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&Ye(s.complete)&&s.completes.push(s.complete),i){var l=e.position();s.startPosition=s.startPosition||{x:l.x,y:l.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(a){var u=e.pan();s.startPan={x:u.x,y:u.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},$r=oc.prototype;xe($r,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var n,r=e.target._private.animation;e.queue?n=r.queue:n=r.current,n.push(this),Gt(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var n=this._private;return e===void 0?n.progress*n.duration:this.progress(e/n.duration)},progress:function(e){var n=this._private,r=n.playing;return e===void 0?n.progress:(r&&this.pause(),n.progress=e,n.started=!1,r&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,n=e.playing;n&&this.pause(),e.progress=1-e.progress,e.started=!1;var r=function(c,d){var f=e[c];f!=null&&(e[c]=e[d],e[d]=f)};if(r("zoom","startZoom"),r("pan","startPan"),r("position","startPosition"),e.style)for(var a=0;a<e.style.length;a++){var i=e.style[a],s=i.name,l=e.startStyle[s];e.startStyle[s]=i,e.style[a]=l}return n&&this.play(),this},promise:function(e){var n=this._private,r;switch(e){case"frame":r=n.frames;break;default:case"complete":case"completed":r=n.completes}return new Ea(function(a,i){r.push(function(){a()})})}}),$r.complete=$r.completed,$r.run=$r.play,$r.running=$r.playing;var KB={animated:function(){return function(){var n=this,r=n.length!==void 0,a=r?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return!1;var s=a[0];if(s)return s._private.animation.current.length>0}},clearQueue:function(){return function(){var n=this,r=n.length!==void 0,a=r?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s<a.length;s++){var l=a[s];l._private.animation.queue=[]}return this}},delay:function(){return function(n,r){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:n,duration:n,complete:r}):this}},delayAnimation:function(){return function(n,r){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:n,duration:n,complete:r}):this}},animation:function(){return function(n,r){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this,u=!i,c=!u;if(!l.styleEnabled())return this;var d=l.style();n=xe({},n,r);var f=Object.keys(n).length===0;if(f)return new oc(s[0],n);switch(n.duration===void 0&&(n.duration=400),n.duration){case"slow":n.duration=600;break;case"fast":n.duration=200;break}if(c&&(n.style=d.getPropsList(n.style||n.css),n.css=void 0),c&&n.renderedPosition!=null){var h=n.renderedPosition,v=l.pan(),p=l.zoom();n.position=gh(h,p,v)}if(u&&n.panBy!=null){var g=n.panBy,y=l.pan();n.pan={x:y.x+g.x,y:y.y+g.y}}var m=n.center||n.centre;if(u&&m!=null){var b=l.getCenterPan(m.eles,n.zoom);b!=null&&(n.pan=b)}if(u&&n.fit!=null){var w=n.fit,C=l.getFitViewport(w.eles||w.boundingBox,w.padding);C!=null&&(n.pan=C.pan,n.zoom=C.zoom)}if(u&&Ie(n.zoom)){var E=l.getZoomedViewport(n.zoom);E!=null?(E.zoomed&&(n.zoom=E.zoom),E.panned&&(n.pan=E.pan)):n.zoom=null}return new oc(s[0],n)}},animate:function(){return function(n,r){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;r&&(n=xe({},n,r));for(var u=0;u<s.length;u++){var c=s[u],d=c.animated()&&(n.queue===void 0||n.queue),f=c.animation(n,d?{queue:!0}:void 0);f.play()}return this}},stop:function(){return function(n,r){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;for(var u=0;u<s.length;u++){for(var c=s[u],d=c._private,f=d.animation.current,h=0;h<f.length;h++){var v=f[h],p=v._private;r&&(p.duration=0)}n&&(d.animation.queue=[]),r||(d.animation.current=[])}return l.notify("draw"),this}}},qB=Array.isArray,es=qB,UB=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,GB=/^\w*$/;function WB(t,e){if(es(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||ki(t)?!0:GB.test(t)||!UB.test(t)||e!=null&&t in Object(e)}var jB=WB,YB="[object AsyncFunction]",ZB="[object Function]",XB="[object GeneratorFunction]",QB="[object Proxy]";function JB(t){if(!Lr(t))return!1;var e=nh(t);return e==ZB||e==XB||e==YB||e==QB}var eN=JB,tN=Fo["__core-js_shared__"],sc=tN,jh=function(){var t=/[^.]+$/.exec(sc&&sc.keys&&sc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function nN(t){return!!jh&&jh in t}var rN=nN,aN=Function.prototype,iN=aN.toString;function oN(t){if(t!=null){try{return iN.call(t)}catch{}try{return t+""}catch{}}return""}var sN=oN,lN=/[\\^$.*+?()[\]{}|]/g,cN=/^\[object .+?Constructor\]$/,uN=Function.prototype,dN=Object.prototype,fN=uN.toString,hN=dN.hasOwnProperty,pN=RegExp("^"+fN.call(hN).replace(lN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function vN(t){if(!Lr(t)||rN(t))return!1;var e=eN(t)?pN:cN;return e.test(sN(t))}var gN=vN;function mN(t,e){return t==null?void 0:t[e]}var yN=mN;function bN(t,e){var n=yN(t,e);return gN(n)?n:void 0}var lc=bN,wN=lc(Object,"create"),Ii=wN;function CN(){this.__data__=Ii?Ii(null):{},this.size=0}var kN=CN;function xN(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var EN=xN,SN="__lodash_hash_undefined__",TN=Object.prototype,BN=TN.hasOwnProperty;function NN(t){var e=this.__data__;if(Ii){var n=e[t];return n===SN?void 0:n}return BN.call(e,t)?e[t]:void 0}var DN=NN,_N=Object.prototype,PN=_N.hasOwnProperty;function IN(t){var e=this.__data__;return Ii?e[t]!==void 0:PN.call(e,t)}var ON=IN,LN="__lodash_hash_undefined__";function MN(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ii&&e===void 0?LN:e,this}var FN=MN;function Sa(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Sa.prototype.clear=kN,Sa.prototype.delete=EN,Sa.prototype.get=DN,Sa.prototype.has=ON,Sa.prototype.set=FN;var Yh=Sa;function AN(){this.__data__=[],this.size=0}var VN=AN;function RN(t,e){return t===e||t!==t&&e!==e}var Zh=RN;function $N(t,e){for(var n=t.length;n--;)if(Zh(t[n][0],e))return n;return-1}var ts=$N,zN=Array.prototype,HN=zN.splice;function KN(t){var e=this.__data__,n=ts(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():HN.call(e,n,1),--this.size,!0}var qN=KN;function UN(t){var e=this.__data__,n=ts(e,t);return n<0?void 0:e[n][1]}var GN=UN;function WN(t){return ts(this.__data__,t)>-1}var jN=WN;function YN(t,e){var n=this.__data__,r=ts(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var ZN=YN;function Ta(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ta.prototype.clear=VN,Ta.prototype.delete=qN,Ta.prototype.get=GN,Ta.prototype.has=jN,Ta.prototype.set=ZN;var XN=Ta,QN=lc(Fo,"Map"),JN=QN;function e5(){this.size=0,this.__data__={hash:new Yh,map:new(JN||XN),string:new Yh}}var t5=e5;function n5(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var r5=n5;function a5(t,e){var n=t.__data__;return r5(e)?n[typeof e=="string"?"string":"hash"]:n.map}var ns=a5;function i5(t){var e=ns(this,t).delete(t);return this.size-=e?1:0,e}var o5=i5;function s5(t){return ns(this,t).get(t)}var l5=s5;function c5(t){return ns(this,t).has(t)}var u5=c5;function d5(t,e){var n=ns(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var f5=d5;function Ba(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ba.prototype.clear=t5,Ba.prototype.delete=o5,Ba.prototype.get=l5,Ba.prototype.has=u5,Ba.prototype.set=f5;var Xh=Ba,h5="Expected a function";function cc(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(h5);var n=function(){var r=arguments,a=e?e.apply(this,r):r[0],i=n.cache;if(i.has(a))return i.get(a);var s=t.apply(this,r);return n.cache=i.set(a,s)||i,s};return n.cache=new(cc.Cache||Xh),n}cc.Cache=Xh;var p5=cc,v5=500;function g5(t){var e=p5(t,function(r){return n.size===v5&&n.clear(),r}),n=e.cache;return e}var m5=g5,y5=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,b5=/\\(\\)?/g,w5=m5(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(y5,function(n,r,a,i){e.push(a?i.replace(b5,"$1"):r||n)}),e}),Qh=w5;function C5(t,e){for(var n=-1,r=t==null?0:t.length,a=Array(r);++n<r;)a[n]=e(t[n],n,t);return a}var Jh=C5,k5=1/0,ep=va?va.prototype:void 0,tp=ep?ep.toString:void 0;function np(t){if(typeof t=="string")return t;if(es(t))return Jh(t,np)+"";if(ki(t))return tp?tp.call(t):"";var e=t+"";return e=="0"&&1/t==-k5?"-0":e}var x5=np;function E5(t){return t==null?"":x5(t)}var rp=E5;function S5(t,e){return es(t)?t:jB(t,e)?[t]:Qh(rp(t))}var ap=S5,T5=1/0;function B5(t){if(typeof t=="string"||ki(t))return t;var e=t+"";return e=="0"&&1/t==-T5?"-0":e}var uc=B5;function N5(t,e){e=ap(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[uc(e[n++])];return n&&n==r?t:void 0}var D5=N5;function _5(t,e,n){var r=t==null?void 0:D5(t,e);return r===void 0?n:r}var P5=_5,I5=function(){try{var t=lc(Object,"defineProperty");return t({},"",{}),t}catch{}}(),ip=I5;function O5(t,e,n){e=="__proto__"&&ip?ip(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var L5=O5,M5=Object.prototype,F5=M5.hasOwnProperty;function A5(t,e,n){var r=t[e];(!(F5.call(t,e)&&Zh(r,n))||n===void 0&&!(e in t))&&L5(t,e,n)}var V5=A5,R5=9007199254740991,$5=/^(?:0|[1-9]\d*)$/;function z5(t,e){var n=typeof t;return e=e??R5,!!e&&(n=="number"||n!="symbol"&&$5.test(t))&&t>-1&&t%1==0&&t<e}var H5=z5;function K5(t,e,n,r){if(!Lr(t))return t;e=ap(e,t);for(var a=-1,i=e.length,s=i-1,l=t;l!=null&&++a<i;){var u=uc(e[a]),c=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(a!=s){var d=l[u];c=r?r(d,u,l):void 0,c===void 0&&(c=Lr(d)?d:H5(e[a+1])?[]:{})}V5(l,u,c),l=l[u]}return t}var q5=K5;function U5(t,e,n){return t==null?t:q5(t,e,n)}var G5=U5;function W5(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var j5=W5;function Y5(t){return es(t)?Jh(t,uc):ki(t)?[t]:j5(Qh(rp(t)))}var Z5=Y5,X5={data:function(e){var n={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(a){},beforeSet:function(a,i){},onSet:function(a){},canSet:function(a){return!0}};return e=xe({},n,e),function(a,i){var s=e,l=this,u=l.length!==void 0,c=u?l:[l],d=u?l[0]:l;if(be(a)){var f=a.indexOf(".")!==-1,h=f&&Z5(a);if(s.allowGetting&&i===void 0){var v;return d&&(s.beforeGet(d),h&&d._private[s.field][a]===void 0?v=P5(d._private[s.field],h):v=d._private[s.field][a]),v}else if(s.allowSetting&&i!==void 0){var p=!s.immutableKeys[a];if(p){var g=zf({},a,i);s.beforeSet(l,g);for(var y=0,m=c.length;y<m;y++){var b=c[y];s.canSet(b)&&(h&&d._private[s.field][a]===void 0?G5(b._private[s.field],h,i):b._private[s.field][a]=i)}s.updateStyle&&l.updateStyle(),s.onSet(l),s.settingTriggersEvent&&l[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&Ie(a)){var w=a,C,E,x=Object.keys(w);s.beforeSet(l,w);for(var k=0;k<x.length;k++){C=x[k],E=w[C];var B=!s.immutableKeys[C];if(B)for(var S=0;S<c.length;S++){var N=c[S];s.canSet(N)&&(N._private[s.field][C]=E)}}s.updateStyle&&l.updateStyle(),s.onSet(l),s.settingTriggersEvent&&l[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&Ye(a)){var D=a;l.on(s.bindingEvent,D)}else if(s.allowGetting&&a===void 0){var _;return d&&(s.beforeGet(d),_=d._private[s.field]),_}return l}},removeData:function(e){var n={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=xe({},n,e),function(a){var i=e,s=this,l=s.length!==void 0,u=l?s:[s];if(be(a)){for(var c=a.split(/\s+/),d=c.length,f=0;f<d;f++){var h=c[f];if(!ar(h)){var v=!i.immutableKeys[h];if(v)for(var p=0,g=u.length;p<g;p++)u[p]._private[i.field][h]=void 0}}i.triggerEvent&&s[i.triggerFnName](i.event)}else if(a===void 0){for(var y=0,m=u.length;y<m;y++)for(var b=u[y]._private[i.field],w=Object.keys(b),C=0;C<w.length;C++){var E=w[C],x=!i.immutableKeys[E];x&&(b[E]=void 0)}i.triggerEvent&&s[i.triggerFnName](i.event)}return s}}},Q5={eventAliasesOn:function(e){var n=e;n.addListener=n.listen=n.bind=n.on,n.unlisten=n.unbind=n.off=n.removeListener,n.trigger=n.emit,n.pon=n.promiseOn=function(r,a){var i=this,s=Array.prototype.slice.call(arguments,0);return new Ea(function(l,u){var c=function(v){i.off.apply(i,f),l(v)},d=s.concat([c]),f=d.concat([]);i.on.apply(i,d)})}}},Re={};[KB,X5,Q5].forEach(function(t){xe(Re,t)});var J5={animate:Re.animate(),animation:Re.animation(),animated:Re.animated(),clearQueue:Re.clearQueue(),delay:Re.delay(),delayAnimation:Re.delayAnimation(),stop:Re.stop()},rs={classes:function(e){var n=this;if(e===void 0){var r=[];return n[0]._private.classes.forEach(function(p){return r.push(p)}),r}else Ke(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new ma(e),s=0;s<n.length;s++){for(var l=n[s],u=l._private,c=u.classes,d=!1,f=0;f<e.length;f++){var h=e[f],v=c.has(h);if(!v){d=!0;break}}d||(d=c.size!==e.length),d&&(u.classes=i,a.push(l))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),n},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var n=this[0];return n!=null&&n._private.classes.has(e)},toggleClass:function(e,n){Ke(e)||(e=e.match(/\S+/g)||[]);for(var r=this,a=n===void 0,i=[],s=0,l=r.length;s<l;s++)for(var u=r[s],c=u._private.classes,d=!1,f=0;f<e.length;f++){var h=e[f],v=c.has(h),p=!1;n||a&&!v?(c.add(h),p=!0):(!n||a&&v)&&(c.delete(h),p=!0),!d&&p&&(i.push(u),d=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),r},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,n){var r=this;if(n==null)n=250;else if(n===0)return r;return r.addClass(e),setTimeout(function(){r.removeClass(e)},n),r}};rs.className=rs.classNames=rs.classes;var Oe={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:ct,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Oe.variable="(?:[\\w-.]|(?:\\\\"+Oe.metaChar+"))+",Oe.className="(?:[\\w-]|(?:\\\\"+Oe.metaChar+"))+",Oe.value=Oe.string+"|"+Oe.number,Oe.id=Oe.variable,function(){var t,e,n;for(t=Oe.comparatorOp.split("|"),n=0;n<t.length;n++)e=t[n],Oe.comparatorOp+="|@"+e;for(t=Oe.comparatorOp.split("|"),n=0;n<t.length;n++)e=t[n],!(e.indexOf("!")>=0)&&e!=="="&&(Oe.comparatorOp+="|\\!"+e)}();var ze=function(){return{checks:[]}},fe={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},dc=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return dS(t.selector,e.selector)}),eD=function(){for(var t={},e,n=0;n<dc.length;n++)e=dc[n],t[e.selector]=e.matches;return t}(),tD=function(e,n){return eD[e](n)},nD="("+dc.map(function(t){return t.selector}).join("|")+")",Na=function(e){return e.replace(new RegExp("\\\\("+Oe.metaChar+")","g"),function(n,r){return r})},cr=function(e,n,r){e[e.length-1]=r},fc=[{name:"group",query:!0,regex:"("+Oe.group+")",populate:function(e,n,r){var a=dn(r,1),i=a[0];n.checks.push({type:fe.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:nD,populate:function(e,n,r){var a=dn(r,1),i=a[0];n.checks.push({type:fe.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Oe.id+")",populate:function(e,n,r){var a=dn(r,1),i=a[0];n.checks.push({type:fe.ID,value:Na(i)})}},{name:"className",query:!0,regex:"\\.("+Oe.className+")",populate:function(e,n,r){var a=dn(r,1),i=a[0];n.checks.push({type:fe.CLASS,value:Na(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Oe.variable+")\\s*\\]",populate:function(e,n,r){var a=dn(r,1),i=a[0];n.checks.push({type:fe.DATA_EXIST,field:Na(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Oe.variable+")\\s*("+Oe.comparatorOp+")\\s*("+Oe.value+")\\s*\\]",populate:function(e,n,r){var a=dn(r,3),i=a[0],s=a[1],l=a[2],u=new RegExp("^"+Oe.string+"$").exec(l)!=null;u?l=l.substring(1,l.length-1):l=parseFloat(l),n.checks.push({type:fe.DATA_COMPARE,field:Na(i),operator:s,value:l})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Oe.boolOp+")\\s*("+Oe.variable+")\\s*\\]",populate:function(e,n,r){var a=dn(r,2),i=a[0],s=a[1];n.checks.push({type:fe.DATA_BOOL,field:Na(s),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Oe.meta+")\\s*("+Oe.comparatorOp+")\\s*("+Oe.number+")\\s*\\]\\]",populate:function(e,n,r){var a=dn(r,3),i=a[0],s=a[1],l=a[2];n.checks.push({type:fe.META_COMPARE,field:Na(i),operator:s,value:parseFloat(l)})}},{name:"nextQuery",separator:!0,regex:Oe.separator,populate:function(e,n){var r=e.currentSubject,a=e.edgeCount,i=e.compoundCount,s=e[e.length-1];r!=null&&(s.subject=r,e.currentSubject=null),s.edgeCount=a,s.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var l=e[e.length++]=ze();return l}},{name:"directedEdge",separator:!0,regex:Oe.directedEdge,populate:function(e,n){if(e.currentSubject==null){var r=ze(),a=n,i=ze();return r.checks.push({type:fe.DIRECTED_EDGE,source:a,target:i}),cr(e,n,r),e.edgeCount++,i}else{var s=ze(),l=n,u=ze();return s.checks.push({type:fe.NODE_SOURCE,source:l,target:u}),cr(e,n,s),e.edgeCount++,u}}},{name:"undirectedEdge",separator:!0,regex:Oe.undirectedEdge,populate:function(e,n){if(e.currentSubject==null){var r=ze(),a=n,i=ze();return r.checks.push({type:fe.UNDIRECTED_EDGE,nodes:[a,i]}),cr(e,n,r),e.edgeCount++,i}else{var s=ze(),l=n,u=ze();return s.checks.push({type:fe.NODE_NEIGHBOR,node:l,neighbor:u}),cr(e,n,s),u}}},{name:"child",separator:!0,regex:Oe.child,populate:function(e,n){if(e.currentSubject==null){var r=ze(),a=ze(),i=e[e.length-1];return r.checks.push({type:fe.CHILD,parent:i,child:a}),cr(e,n,r),e.compoundCount++,a}else if(e.currentSubject===n){var s=ze(),l=e[e.length-1],u=ze(),c=ze(),d=ze(),f=ze();return s.checks.push({type:fe.COMPOUND_SPLIT,left:l,right:u,subject:c}),c.checks=n.checks,n.checks=[{type:fe.TRUE}],f.checks.push({type:fe.TRUE}),u.checks.push({type:fe.PARENT,parent:f,child:d}),cr(e,l,s),e.currentSubject=c,e.compoundCount++,d}else{var h=ze(),v=ze(),p=[{type:fe.PARENT,parent:h,child:v}];return h.checks=n.checks,n.checks=p,e.compoundCount++,v}}},{name:"descendant",separator:!0,regex:Oe.descendant,populate:function(e,n){if(e.currentSubject==null){var r=ze(),a=ze(),i=e[e.length-1];return r.checks.push({type:fe.DESCENDANT,ancestor:i,descendant:a}),cr(e,n,r),e.compoundCount++,a}else if(e.currentSubject===n){var s=ze(),l=e[e.length-1],u=ze(),c=ze(),d=ze(),f=ze();return s.checks.push({type:fe.COMPOUND_SPLIT,left:l,right:u,subject:c}),c.checks=n.checks,n.checks=[{type:fe.TRUE}],f.checks.push({type:fe.TRUE}),u.checks.push({type:fe.ANCESTOR,ancestor:f,descendant:d}),cr(e,l,s),e.currentSubject=c,e.compoundCount++,d}else{var h=ze(),v=ze(),p=[{type:fe.ANCESTOR,ancestor:h,descendant:v}];return h.checks=n.checks,n.checks=p,e.compoundCount++,v}}},{name:"subject",modifier:!0,regex:Oe.subject,populate:function(e,n){if(e.currentSubject!=null&&e.currentSubject!==n)return Ve("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=n;var r=e[e.length-1],a=r.checks[0],i=a==null?null:a.type;i===fe.DIRECTED_EDGE?a.type=fe.NODE_TARGET:i===fe.UNDIRECTED_EDGE&&(a.type=fe.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];fc.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var rD=function(e){for(var n,r,a,i=0;i<fc.length;i++){var s=fc[i],l=s.name,u=e.match(s.regexObj);if(u!=null){r=u,n=s,a=l;var c=u[0];e=e.substring(c.length);break}}return{expr:n,match:r,name:a,remaining:e}},aD=function(e){var n=e.match(/^\s+/);if(n){var r=n[0];e=e.substring(r.length)}return e},iD=function(e){var n=this,r=n.inputText=e,a=n[0]=ze();for(n.length=1,r=aD(r);;){var i=rD(r);if(i.expr==null)return Ve("The selector `"+e+"`is invalid"),!1;var s=i.match.slice(1),l=i.expr.populate(n,a,s);if(l===!1)return!1;if(l!=null&&(a=l),r=i.remaining,r.match(/^\s*$/))break}var u=n[n.length-1];n.currentSubject!=null&&(u.subject=n.currentSubject),u.edgeCount=n.edgeCount,u.compoundCount=n.compoundCount;for(var c=0;c<n.length;c++){var d=n[c];if(d.compoundCount>0&&d.edgeCount>0)return Ve("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(d.edgeCount>1)return Ve("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;d.edgeCount===1&&Ve("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},oD=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(d){return d??""},n=function(d){return be(d)?'"'+d+'"':e(d)},r=function(d){return" "+d+" "},a=function(d,f){var h=d.type,v=d.value;switch(h){case fe.GROUP:{var p=e(v);return p.substring(0,p.length-1)}case fe.DATA_COMPARE:{var g=d.field,y=d.operator;return"["+g+r(e(y))+n(v)+"]"}case fe.DATA_BOOL:{var m=d.operator,b=d.field;return"["+e(m)+b+"]"}case fe.DATA_EXIST:{var w=d.field;return"["+w+"]"}case fe.META_COMPARE:{var C=d.operator,E=d.field;return"[["+E+r(e(C))+n(v)+"]]"}case fe.STATE:return v;case fe.ID:return"#"+v;case fe.CLASS:return"."+v;case fe.PARENT:case fe.CHILD:return i(d.parent,f)+r(">")+i(d.child,f);case fe.ANCESTOR:case fe.DESCENDANT:return i(d.ancestor,f)+" "+i(d.descendant,f);case fe.COMPOUND_SPLIT:{var x=i(d.left,f),k=i(d.subject,f),B=i(d.right,f);return x+(x.length>0?" ":"")+k+B}case fe.TRUE:return""}},i=function(d,f){return d.checks.reduce(function(h,v,p){return h+(f===d&&p===0?"$":"")+a(v,f)},"")},s="",l=0;l<this.length;l++){var u=this[l];s+=i(u,u.subject),this.length>1&&l<this.length-1&&(s+=", ")}return this.toStringCache=s,s},sD={parse:iD,toString:oD},op=function(e,n,r){var a,i=be(e),s=le(e),l=be(r),u,c,d=!1,f=!1,h=!1;switch(n.indexOf("!")>=0&&(n=n.replace("!",""),f=!0),n.indexOf("@")>=0&&(n=n.replace("@",""),d=!0),(i||l||d)&&(u=!i&&!s?"":""+e,c=""+r),d&&(e=u=u.toLowerCase(),r=c=c.toLowerCase()),n){case"*=":a=u.indexOf(c)>=0;break;case"$=":a=u.indexOf(c,u.length-c.length)>=0;break;case"^=":a=u.indexOf(c)===0;break;case"=":a=e===r;break;case">":h=!0,a=e>r;break;case">=":h=!0,a=e>=r;break;case"<":h=!0,a=e<r;break;case"<=":h=!0,a=e<=r;break;default:a=!1;break}return f&&(e!=null||!h)&&(a=!a),a},lD=function(e,n){switch(n){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},cD=function(e){return e!==void 0},hc=function(e,n){return e.data(n)},uD=function(e,n){return e[n]()},Xe=[],je=function(e,n){return e.checks.every(function(r){return Xe[r.type](r,n)})};Xe[fe.GROUP]=function(t,e){var n=t.value;return n==="*"||n===e.group()},Xe[fe.STATE]=function(t,e){var n=t.value;return tD(n,e)},Xe[fe.ID]=function(t,e){var n=t.value;return e.id()===n},Xe[fe.CLASS]=function(t,e){var n=t.value;return e.hasClass(n)},Xe[fe.META_COMPARE]=function(t,e){var n=t.field,r=t.operator,a=t.value;return op(uD(e,n),r,a)},Xe[fe.DATA_COMPARE]=function(t,e){var n=t.field,r=t.operator,a=t.value;return op(hc(e,n),r,a)},Xe[fe.DATA_BOOL]=function(t,e){var n=t.field,r=t.operator;return lD(hc(e,n),r)},Xe[fe.DATA_EXIST]=function(t,e){var n=t.field;return t.operator,cD(hc(e,n))},Xe[fe.UNDIRECTED_EDGE]=function(t,e){var n=t.nodes[0],r=t.nodes[1],a=e.source(),i=e.target();return je(n,a)&&je(r,i)||je(r,a)&&je(n,i)},Xe[fe.NODE_NEIGHBOR]=function(t,e){return je(t.node,e)&&e.neighborhood().some(function(n){return n.isNode()&&je(t.neighbor,n)})},Xe[fe.DIRECTED_EDGE]=function(t,e){return je(t.source,e.source())&&je(t.target,e.target())},Xe[fe.NODE_SOURCE]=function(t,e){return je(t.source,e)&&e.outgoers().some(function(n){return n.isNode()&&je(t.target,n)})},Xe[fe.NODE_TARGET]=function(t,e){return je(t.target,e)&&e.incomers().some(function(n){return n.isNode()&&je(t.source,n)})},Xe[fe.CHILD]=function(t,e){return je(t.child,e)&&je(t.parent,e.parent())},Xe[fe.PARENT]=function(t,e){return je(t.parent,e)&&e.children().some(function(n){return je(t.child,n)})},Xe[fe.DESCENDANT]=function(t,e){return je(t.descendant,e)&&e.ancestors().some(function(n){return je(t.ancestor,n)})},Xe[fe.ANCESTOR]=function(t,e){return je(t.ancestor,e)&&e.descendants().some(function(n){return je(t.descendant,n)})},Xe[fe.COMPOUND_SPLIT]=function(t,e){return je(t.subject,e)&&je(t.left,e)&&je(t.right,e)},Xe[fe.TRUE]=function(){return!0},Xe[fe.COLLECTION]=function(t,e){var n=t.value;return n.has(e)},Xe[fe.FILTER]=function(t,e){var n=t.value;return n(e)};var dD=function(e){var n=this;if(n.length===1&&n[0].checks.length===1&&n[0].checks[0].type===fe.ID)return e.getElementById(n[0].checks[0].value).collection();var r=function(i){for(var s=0;s<n.length;s++){var l=n[s];if(je(l,i))return!0}return!1};return n.text()==null&&(r=function(){return!0}),e.filter(r)},fD=function(e){for(var n=this,r=0;r<n.length;r++){var a=n[r];if(je(a,e))return!0}return!1},hD={matches:fD,filter:dD},ur=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||be(e)&&e.match(/^\s*$/)||(Gt(e)?this.addQuery({checks:[{type:fe.COLLECTION,value:e.collection()}]}):Ye(e)?this.addQuery({checks:[{type:fe.FILTER,value:e}]}):be(e)?this.parse(e)||(this.invalid=!0):Ze("A selector must be created from a string; found "))},dr=ur.prototype;[sD,hD].forEach(function(t){return xe(dr,t)}),dr.text=function(){return this.inputText},dr.size=function(){return this.length},dr.eq=function(t){return this[t]},dr.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()},dr.addQuery=function(t){this[this.length++]=t},dr.selector=dr.toString;var fr={allAre:function(e){var n=new ur(e);return this.every(function(r){return n.matches(r)})},is:function(e){var n=new ur(e);return this.some(function(r){return n.matches(r)})},some:function(e,n){for(var r=0;r<this.length;r++){var a=n?e.apply(n,[this[r],r,this]):e(this[r],r,this);if(a)return!0}return!1},every:function(e,n){for(var r=0;r<this.length;r++){var a=n?e.apply(n,[this[r],r,this]):e(this[r],r,this);if(!a)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var n=this.length,r=e.length;return n!==r?!1:n===1?this[0]===e[0]:this.every(function(a){return e.hasElementWithId(a.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(n){return e.hasElementWithId(n.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var n=this.neighborhood();return e.every(function(r){return n.hasElementWithId(r.id())})},contains:function(e){e=this.cy().collection(e);var n=this;return e.every(function(r){return n.hasElementWithId(r.id())})}};fr.allAreNeighbours=fr.allAreNeighbors,fr.has=fr.contains,fr.equal=fr.equals=fr.same;var en=function(e,n){return function(a,i,s,l){var u=a,c=this,d;if(u==null?d="":Gt(u)&&u.length===1&&(d=u.id()),c.length===1&&d){var f=c[0]._private,h=f.traversalCache=f.traversalCache||{},v=h[n]=h[n]||[],p=Mr(d),g=v[p];return g||(v[p]=e.call(c,a,i,s,l))}else return e.call(c,a,i,s,l)}},Da={parent:function(e){var n=[];if(this.length===1){var r=this[0]._private.parent;if(r)return r}for(var a=0;a<this.length;a++){var i=this[a],s=i._private.parent;s&&n.push(s)}return this.spawn(n,!0).filter(e)},parents:function(e){for(var n=[],r=this.parent();r.nonempty();){for(var a=0;a<r.length;a++){var i=r[a];n.push(i)}r=r.parent()}return this.spawn(n,!0).filter(e)},commonAncestors:function(e){for(var n,r=0;r<this.length;r++){var a=this[r],i=a.parents();n=n||i,n=n.intersect(i)}return n.filter(e)},orphans:function(e){return this.stdFilter(function(n){return n.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(n){return n.isChild()}).filter(e)},children:en(function(t){for(var e=[],n=0;n<this.length;n++)for(var r=this[n],a=r._private.children,i=0;i<a.length;i++)e.push(a[i]);return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var n=[];function r(a){for(var i=0;i<a.length;i++){var s=a[i];n.push(s),s.children().nonempty()&&r(s.children())}}return r(this.children()),this.spawn(n,!0).filter(e)}};function pc(t,e,n,r){for(var a=[],i=new ma,s=t.cy(),l=s.hasCompoundNodes(),u=0;u<t.length;u++){var c=t[u];n?a.push(c):l&&r(a,i,c)}for(;a.length>0;){var d=a.shift();e(d),i.add(d.id()),l&&r(a,i,d)}return t}function sp(t,e,n){if(n.isParent())for(var r=n._private.children,a=0;a<r.length;a++){var i=r[a];e.has(i.id())||t.push(i)}}Da.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return pc(this,t,e,sp)};function lp(t,e,n){if(n.isChild()){var r=n._private.parent;e.has(r.id())||t.push(r)}}Da.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return pc(this,t,e,lp)};function pD(t,e,n){lp(t,e,n),sp(t,e,n)}Da.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return pc(this,t,e,pD)},Da.ancestors=Da.parents;var Oi,cp;Oi=cp={data:Re.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Re.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Re.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Re.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Re.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Re.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},Oi.attr=Oi.data,Oi.removeAttr=Oi.removeData;var vD=cp,as={};function vc(t){return function(e){var n=this;if(e===void 0&&(e=!0),n.length!==0)if(n.isNode()&&!n.removed()){for(var r=0,a=n[0],i=a._private.edges,s=0;s<i.length;s++){var l=i[s];!e&&l.isLoop()||(r+=t(a,l))}return r}else return}}xe(as,{degree:vc(function(t,e){return e.source().same(e.target())?2:1}),indegree:vc(function(t,e){return e.target().same(t)?1:0}),outdegree:vc(function(t,e){return e.source().same(t)?1:0})});function _a(t,e){return function(n){for(var r,a=this.nodes(),i=0;i<a.length;i++){var s=a[i],l=s[t](n);l!==void 0&&(r===void 0||e(l,r))&&(r=l)}return r}}xe(as,{minDegree:_a("degree",function(t,e){return t<e}),maxDegree:_a("degree",function(t,e){return t>e}),minIndegree:_a("indegree",function(t,e){return t<e}),maxIndegree:_a("indegree",function(t,e){return t>e}),minOutdegree:_a("outdegree",function(t,e){return t<e}),maxOutdegree:_a("outdegree",function(t,e){return t>e})}),xe(as,{totalDegree:function(e){for(var n=0,r=this.nodes(),a=0;a<r.length;a++)n+=r[a].degree(e);return n}});var hn,up,dp=function(e,n,r){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var s=i._private.position,l={x:n.x!=null?n.x-s.x:0,y:n.y!=null?n.y-s.y:0};i.isParent()&&!(l.x===0&&l.y===0)&&i.children().shift(l,r),i.dirtyBoundingBoxCache()}}},fp={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,n){dp(e,n,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};hn=up={position:Re.data(fp),silentPosition:Re.data(xe({},fp,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,n){dp(e,n,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,n){if(Ie(e))n?this.silentPosition(e):this.position(e);else if(Ye(e)){var r=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var s=this[i],l=void 0;(l=r(s,i))&&(n?s.silentPosition(l):s.position(l))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,n,r){var a;if(Ie(e)?(a={x:le(e.x)?e.x:0,y:le(e.y)?e.y:0},r=n):be(e)&&le(n)&&(a={x:0,y:0},a[e]=n),a!=null){var i=this.cy();i.startBatch();for(var s=0;s<this.length;s++){var l=this[s];if(!(i.hasCompoundNodes()&&l.isChild()&&l.ancestors().anySame(this))){var u=l.position(),c={x:u.x+a.x,y:u.y+a.y};r?l.silentPosition(c):l.position(c)}}i.endBatch()}return this},silentShift:function(e,n){return Ie(e)?this.shift(e,!0):be(e)&&le(n)&&this.shift(e,n,!0),this},renderedPosition:function(e,n){var r=this[0],a=this.cy(),i=a.zoom(),s=a.pan(),l=Ie(e)?e:void 0,u=l!==void 0||n!==void 0&&be(e);if(r&&r.isNode())if(u)for(var c=0;c<this.length;c++){var d=this[c];n!==void 0?d.position(e,(n-s[e])/i):l!==void 0&&d.position(gh(l,i,s))}else{var f=r.position();return l=Ho(f,i,s),e===void 0?l:l[e]}else if(!u)return;return this},relativePosition:function(e,n){var r=this[0],a=this.cy(),i=Ie(e)?e:void 0,s=i!==void 0||n!==void 0&&be(e),l=a.hasCompoundNodes();if(r&&r.isNode())if(s)for(var u=0;u<this.length;u++){var c=this[u],d=l?c.parent():null,f=d&&d.length>0,h=f;f&&(d=d[0]);var v=h?d.position():{x:0,y:0};n!==void 0?c.position(e,n+v[e]):i!==void 0&&c.position({x:i.x+v.x,y:i.y+v.y})}else{var p=r.position(),g=l?r.parent():null,y=g&&g.length>0,m=y;y&&(g=g[0]);var b=m?g.position():{x:0,y:0};return i={x:p.x-b.x,y:p.y-b.y},e===void 0?i:i[e]}else if(!s)return;return this}},hn.modelPosition=hn.point=hn.position,hn.modelPositions=hn.points=hn.positions,hn.renderedPoint=hn.renderedPosition,hn.relativePoint=hn.relativePosition;var gD=up,Pa,hr;Pa=hr={},hr.renderedBoundingBox=function(t){var e=this.boundingBox(t),n=this.cy(),r=n.zoom(),a=n.pan(),i=e.x1*r+a.x,s=e.x2*r+a.x,l=e.y1*r+a.y,u=e.y2*r+a.y;return{x1:i,x2:s,y1:l,y2:u,w:s-i,h:u-l}},hr.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(n){if(n.isParent()){var r=n._private;r.compoundBoundsClean=!1,r.bbCache=null,t||n.emitAndNotify("bounds")}}),this)},hr.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function n(s){if(!s.isParent())return;var l=s._private,u=s.children(),c=s.pstyle("compound-sizing-wrt-labels").value==="include",d={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},f=u.boundingBox({includeLabels:c,includeOverlays:!1,useCache:!1}),h=l.position;(f.w===0||f.h===0)&&(f={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},f.x1=h.x-f.w/2,f.x2=h.x+f.w/2,f.y1=h.y-f.h/2,f.y2=h.y+f.h/2);function v(S,N,D){var _=0,O=0,P=N+D;return S>0&&P>0&&(_=N/P*S,O=D/P*S),{biasDiff:_,biasComplementDiff:O}}function p(S,N,D,_){if(D.units==="%")switch(_){case"width":return S>0?D.pfValue*S:0;case"height":return N>0?D.pfValue*N:0;case"average":return S>0&&N>0?D.pfValue*(S+N)/2:0;case"min":return S>0&&N>0?S>N?D.pfValue*N:D.pfValue*S:0;case"max":return S>0&&N>0?S>N?D.pfValue*S:D.pfValue*N:0;default:return 0}else return D.units==="px"?D.pfValue:0}var g=d.width.left.value;d.width.left.units==="px"&&d.width.val>0&&(g=g*100/d.width.val);var y=d.width.right.value;d.width.right.units==="px"&&d.width.val>0&&(y=y*100/d.width.val);var m=d.height.top.value;d.height.top.units==="px"&&d.height.val>0&&(m=m*100/d.height.val);var b=d.height.bottom.value;d.height.bottom.units==="px"&&d.height.val>0&&(b=b*100/d.height.val);var w=v(d.width.val-f.w,g,y),C=w.biasDiff,E=w.biasComplementDiff,x=v(d.height.val-f.h,m,b),k=x.biasDiff,B=x.biasComplementDiff;l.autoPadding=p(f.w,f.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),l.autoWidth=Math.max(f.w,d.width.val),h.x=(-C+f.x1+f.x2+E)/2,l.autoHeight=Math.max(f.h,d.height.val),h.y=(-k+f.y1+f.y2+B)/2}for(var r=0;r<this.length;r++){var a=this[r],i=a._private;(!i.compoundBoundsClean||t)&&(n(a),e.batching()||(i.compoundBoundsClean=!0))}return this};var tn=function(e){return e===1/0||e===-1/0?0:e},pn=function(e,n,r,a,i){a-n===0||i-r===0||n==null||r==null||a==null||i==null||(e.x1=n<e.x1?n:e.x1,e.x2=a>e.x2?a:e.x2,e.y1=r<e.y1?r:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},zr=function(e,n){return n==null?e:pn(e,n.x1,n.y1,n.x2,n.y2)},Li=function(e,n,r){return fn(e,n,r)},is=function(e,n,r){if(!n.cy().headless()){var a=n._private,i=a.rstyle,s=i.arrowWidth/2,l=n.pstyle(r+"-arrow-shape").value,u,c;if(l!=="none"){r==="source"?(u=i.srcX,c=i.srcY):r==="target"?(u=i.tgtX,c=i.tgtY):(u=i.midX,c=i.midY);var d=a.arrowBounds=a.arrowBounds||{},f=d[r]=d[r]||{};f.x1=u-s,f.y1=c-s,f.x2=u+s,f.y2=c+s,f.w=f.x2-f.x1,f.h=f.y2-f.y1,qo(f,1),pn(e,f.x1,f.y1,f.x2,f.y2)}}},gc=function(e,n,r){if(!n.cy().headless()){var a;r?a=r+"-":a="";var i=n._private,s=i.rstyle,l=n.pstyle(a+"label").strValue;if(l){var u=n.pstyle("text-halign"),c=n.pstyle("text-valign"),d=Li(s,"labelWidth",r),f=Li(s,"labelHeight",r),h=Li(s,"labelX",r),v=Li(s,"labelY",r),p=n.pstyle(a+"text-margin-x").pfValue,g=n.pstyle(a+"text-margin-y").pfValue,y=n.isEdge(),m=n.pstyle(a+"text-rotation"),b=n.pstyle("text-outline-width").pfValue,w=n.pstyle("text-border-width").pfValue,C=w/2,E=n.pstyle("text-background-padding").pfValue,x=2,k=f,B=d,S=B/2,N=k/2,D,_,O,P;if(y)D=h-S,_=h+S,O=v-N,P=v+N;else{switch(u.value){case"left":D=h-B,_=h;break;case"center":D=h-S,_=h+S;break;case"right":D=h,_=h+B;break}switch(c.value){case"top":O=v-k,P=v;break;case"center":O=v-N,P=v+N;break;case"bottom":O=v,P=v+k;break}}D+=p-Math.max(b,C)-E-x,_+=p+Math.max(b,C)+E+x,O+=g-Math.max(b,C)-E-x,P+=g+Math.max(b,C)+E+x;var F=r||"main",I=i.labelBounds,M=I[F]=I[F]||{};M.x1=D,M.y1=O,M.x2=_,M.y2=P,M.w=_-D,M.h=P-O;var L=y&&m.strValue==="autorotate",V=m.pfValue!=null&&m.pfValue!==0;if(L||V){var H=L?Li(i.rstyle,"labelAngle",r):m.pfValue,$=Math.cos(H),z=Math.sin(H),j=(D+_)/2,ee=(O+P)/2;if(!y){switch(u.value){case"left":j=_;break;case"right":j=D;break}switch(c.value){case"top":ee=P;break;case"bottom":ee=O;break}}var J=function(he,re){return he=he-j,re=re-ee,{x:he*$-re*z+j,y:he*z+re*$+ee}},X=J(D,O),ne=J(D,P),Y=J(_,O),A=J(_,P);D=Math.min(X.x,ne.x,Y.x,A.x),_=Math.max(X.x,ne.x,Y.x,A.x),O=Math.min(X.y,ne.y,Y.y,A.y),P=Math.max(X.y,ne.y,Y.y,A.y)}var K=F+"Rot",W=I[K]=I[K]||{};W.x1=D,W.y1=O,W.x2=_,W.y2=P,W.w=_-D,W.h=P-O,pn(e,D,O,_,P),pn(i.labelBounds.all,D,O,_,P)}return e}},mD=function(e,n){if(!n.cy().headless()){var r=n.pstyle("outline-opacity").value,a=n.pstyle("outline-width").value;if(r>0&&a>0){var i=n.pstyle("outline-offset").value,s=n.pstyle("shape").value,l=a+i,u=(e.w+l*2)/e.w,c=(e.h+l*2)/e.h,d=0,f=0;["diamond","pentagon","round-triangle"].includes(s)?(u=(e.w+l*2.4)/e.w,f=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?u=(e.w+l*2.4)/e.w:s==="star"?(u=(e.w+l*2.8)/e.w,c=(e.h+l*2.6)/e.h,f=-l/3.8):s==="triangle"?(u=(e.w+l*2.8)/e.w,c=(e.h+l*2.4)/e.h,f=-l/1.4):s==="vee"&&(u=(e.w+l*4.4)/e.w,c=(e.h+l*3.8)/e.h,f=-l*.5);var h=e.h*c-e.h,v=e.w*u-e.w;if(Uo(e,[Math.ceil(h/2),Math.ceil(v/2)]),d!=0||f!==0){var p=VT(e,d,f);yh(e,p)}}}},yD=function(e,n){var r=e._private.cy,a=r.styleEnabled(),i=r.headless(),s=zt(),l=e._private,u=e.isNode(),c=e.isEdge(),d,f,h,v,p,g,y=l.rstyle,m=u&&a?e.pstyle("bounds-expansion").pfValue:[0],b=function(ue){return ue.pstyle("display").value!=="none"},w=!a||b(e)&&(!c||b(e.source())&&b(e.target()));if(w){var C=0,E=0;a&&n.includeOverlays&&(C=e.pstyle("overlay-opacity").value,C!==0&&(E=e.pstyle("overlay-padding").value));var x=0,k=0;a&&n.includeUnderlays&&(x=e.pstyle("underlay-opacity").value,x!==0&&(k=e.pstyle("underlay-padding").value));var B=Math.max(E,k),S=0,N=0;if(a&&(S=e.pstyle("width").pfValue,N=S/2),u&&n.includeNodes){var D=e.position();p=D.x,g=D.y;var _=e.outerWidth(),O=_/2,P=e.outerHeight(),F=P/2;d=p-O,f=p+O,h=g-F,v=g+F,pn(s,d,h,f,v),a&&n.includeOutlines&&mD(s,e)}else if(c&&n.includeEdges)if(a&&!i){var I=e.pstyle("curve-style").strValue;if(d=Math.min(y.srcX,y.midX,y.tgtX),f=Math.max(y.srcX,y.midX,y.tgtX),h=Math.min(y.srcY,y.midY,y.tgtY),v=Math.max(y.srcY,y.midY,y.tgtY),d-=N,f+=N,h-=N,v+=N,pn(s,d,h,f,v),I==="haystack"){var M=y.haystackPts;if(M&&M.length===2){if(d=M[0].x,h=M[0].y,f=M[1].x,v=M[1].y,d>f){var L=d;d=f,f=L}if(h>v){var V=h;h=v,v=V}pn(s,d-N,h-N,f+N,v+N)}}else if(I==="bezier"||I==="unbundled-bezier"||I.endsWith("segments")||I.endsWith("taxi")){var H;switch(I){case"bezier":case"unbundled-bezier":H=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":H=y.linePts;break}if(H!=null)for(var $=0;$<H.length;$++){var z=H[$];d=z.x-N,f=z.x+N,h=z.y-N,v=z.y+N,pn(s,d,h,f,v)}}}else{var j=e.source(),ee=j.position(),J=e.target(),X=J.position();if(d=ee.x,f=X.x,h=ee.y,v=X.y,d>f){var ne=d;d=f,f=ne}if(h>v){var Y=h;h=v,v=Y}d-=N,f+=N,h-=N,v+=N,pn(s,d,h,f,v)}if(a&&n.includeEdges&&c&&(is(s,e,"mid-source"),is(s,e,"mid-target"),is(s,e,"source"),is(s,e,"target")),a){var A=e.pstyle("ghost").value==="yes";if(A){var K=e.pstyle("ghost-offset-x").pfValue,W=e.pstyle("ghost-offset-y").pfValue;pn(s,s.x1+K,s.y1+W,s.x2+K,s.y2+W)}}var oe=l.bodyBounds=l.bodyBounds||{};bh(oe,s),Uo(oe,m),qo(oe,1),a&&(d=s.x1,f=s.x2,h=s.y1,v=s.y2,pn(s,d-B,h-B,f+B,v+B));var he=l.overlayBounds=l.overlayBounds||{};bh(he,s),Uo(he,m),qo(he,1);var re=l.labelBounds=l.labelBounds||{};re.all!=null?AT(re.all):re.all=zt(),a&&n.includeLabels&&(n.includeMainLabels&&gc(s,e,null),c&&(n.includeSourceLabels&&gc(s,e,"source"),n.includeTargetLabels&&gc(s,e,"target")))}return s.x1=tn(s.x1),s.y1=tn(s.y1),s.x2=tn(s.x2),s.y2=tn(s.y2),s.w=tn(s.x2-s.x1),s.h=tn(s.y2-s.y1),s.w>0&&s.h>0&&w&&(Uo(s,m),qo(s,1)),s},hp=function(e){var n=0,r=function(s){return(s?1:0)<<n++},a=0;return a+=r(e.incudeNodes),a+=r(e.includeEdges),a+=r(e.includeLabels),a+=r(e.includeMainLabels),a+=r(e.includeSourceLabels),a+=r(e.includeTargetLabels),a+=r(e.includeOverlays),a+=r(e.includeOutlines),a},pp=function(e){if(e.isEdge()){var n=e.source().position(),r=e.target().position(),a=function(s){return Math.round(s)};return aT([a(n.x),a(n.y),a(r.x),a(r.y)])}else return 0},vp=function(e,n){var r=e._private,a,i=e.isEdge(),s=n==null?gp:hp(n),l=s===gp,u=pp(e),c=r.bbCachePosKey===u,d=n.useCache&&c,f=function(g){return g._private.bbCache==null||g._private.styleDirty},h=!d||f(e)||i&&f(e.source())||f(e.target());if(h?(c||e.recalculateRenderedStyle(d),a=yD(e,Mi),r.bbCache=a,r.bbCachePosKey=u):a=r.bbCache,!l){var v=e.isNode();a=zt(),(n.includeNodes&&v||n.includeEdges&&!v)&&(n.includeOverlays?zr(a,r.overlayBounds):zr(a,r.bodyBounds)),n.includeLabels&&(n.includeMainLabels&&(!i||n.includeSourceLabels&&n.includeTargetLabels)?zr(a,r.labelBounds.all):(n.includeMainLabels&&zr(a,r.labelBounds.mainRot),n.includeSourceLabels&&zr(a,r.labelBounds.sourceRot),n.includeTargetLabels&&zr(a,r.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},Mi={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},gp=hp(Mi),mp=wt(Mi);hr.boundingBox=function(t){var e;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(t===void 0||t.useCache===void 0||t.useCache===!0))t===void 0?t=Mi:t=mp(t),e=vp(this[0],t);else{e=zt(),t=t||Mi;var n=mp(t),r=this,a=r.cy(),i=a.styleEnabled();if(i)for(var s=0;s<r.length;s++){var l=r[s],u=l._private,c=pp(l),d=u.bbCachePosKey===c,f=n.useCache&&d&&!u.styleDirty;l.recalculateRenderedStyle(f)}this.updateCompoundBounds(!t.useCache);for(var h=0;h<r.length;h++){var v=r[h];zr(e,vp(v,n))}}return e.x1=tn(e.x1),e.y1=tn(e.y1),e.x2=tn(e.x2),e.y2=tn(e.y2),e.w=tn(e.x2-e.x1),e.h=tn(e.y2-e.y1),e},hr.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},hr.boundingBoxAt=function(t){var e=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),a=n.collection();if(r&&(a=e.filter(function(c){return c.isParent()}),e=e.not(a)),Ie(t)){var i=t;t=function(){return i}}var s=function(d,f){return d._private.bbAtOldPos=t(d,f)},l=function(d){return d._private.bbAtOldPos};n.startBatch(),e.forEach(s).silentPositions(t),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var u=FT(this.boundingBox({useCache:!1}));return e.silentPositions(l),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),n.endBatch(),u},Pa.boundingbox=Pa.bb=Pa.boundingBox,Pa.renderedBoundingbox=Pa.renderedBoundingBox;var bD=hr,Fi,Ai;Fi=Ai={};var yp=function(e){e.uppercaseName=Zf(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=Zf(e.outerName),Fi[e.name]=function(){var r=this[0],a=r._private,i=a.cy,s=i._private.styleEnabled;if(r)if(s){if(r.isParent())return r.updateCompoundBounds(),a[e.autoName]||0;var l=r.pstyle(e.name);switch(l.strValue){case"label":return r.recalculateRenderedStyle(),a.rstyle[e.labelName]||0;default:return l.pfValue}}else return 1},Fi["outer"+e.uppercaseName]=function(){var r=this[0],a=r._private,i=a.cy,s=i._private.styleEnabled;if(r)if(s){var l=r[e.name](),u=r.pstyle("border-width").pfValue,c=2*r.padding();return l+u+c}else return 1},Fi["rendered"+e.uppercaseName]=function(){var r=this[0];if(r){var a=r[e.name]();return a*this.cy().zoom()}},Fi["rendered"+e.uppercaseOuterName]=function(){var r=this[0];if(r){var a=r[e.outerName]();return a*this.cy().zoom()}}};yp({name:"width"}),yp({name:"height"}),Ai.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue},Ai.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()},Ai.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var wD=Ai,CD=function(e,n){if(e.isEdge())return n(e)},kD=function(e,n){if(e.isEdge()){var r=e.cy();return Ho(n(e),r.zoom(),r.pan())}},xD=function(e,n){if(e.isEdge()){var r=e.cy(),a=r.pan(),i=r.zoom();return n(e).map(function(s){return Ho(s,i,a)})}},ED=function(e){return e.renderer().getControlPoints(e)},SD=function(e){return e.renderer().getSegmentPoints(e)},TD=function(e){return e.renderer().getSourceEndpoint(e)},BD=function(e){return e.renderer().getTargetEndpoint(e)},ND=function(e){return e.renderer().getEdgeMidpoint(e)},bp={controlPoints:{get:ED,mult:!0},segmentPoints:{get:SD,mult:!0},sourceEndpoint:{get:TD},targetEndpoint:{get:BD},midpoint:{get:ND}},DD=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},_D=Object.keys(bp).reduce(function(t,e){var n=bp[e],r=DD(e);return t[e]=function(){return CD(this,n.get)},n.mult?t[r]=function(){return xD(this,n.get)}:t[r]=function(){return kD(this,n.get)},t},{}),PD=xe({},gD,bD,wD,_D);/*!
|
|
36
36
|
Event object based on jQuery events, MIT license
|
|
37
37
|
|
|
38
38
|
https://jquery.org/license/
|
|
39
39
|
https://tldrlegal.com/license/mit-license
|
|
40
40
|
https://github.com/jquery/jquery/blob/master/src/event.js
|
|
41
|
-
*/var wp=function(e,n){this.recycle(e,n)};function Vi(){return!1}function os(){return!0}wp.prototype={instanceString:function(){return"event"},recycle:function(e,n){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Vi,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?os:Vi):e!=null&&e.type?n=e:this.type=e,n!=null&&(this.originalEvent=n.originalEvent,this.type=n.type!=null?n.type:this.type,this.cy=n.cy,this.target=n.target,this.position=n.position,this.renderedPosition=n.renderedPosition,this.namespace=n.namespace,this.layout=n.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var r=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:r.x*a+i.x,y:r.y*a+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=os;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=os;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=os,this.stopPropagation()},isDefaultPrevented:Vi,isPropagationStopped:Vi,isImmediatePropagationStopped:Vi};var Cp=/^([^.]+)(\.(?:[^.]+))?$/,PD=".*",kp={qualifierCompare:function(e,n){return e===n},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},xp=Object.keys(kp),OD={};function ss(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:OD,e=arguments.length>1?arguments[1]:void 0,n=0;n<xp.length;n++){var r=xp[n];this[r]=t[r]||kp[r]}this.context=e||this.context,this.listeners=[],this.emitting=0}var pr=ss.prototype,Ep=function(e,n,r,a,i,s,l){Ye(a)&&(i=a,a=null),l&&(s==null?s=l:s=xe({},s,l));for(var u=Ke(r)?r:r.split(/\s+/),c=0;c<u.length;c++){var d=u[c];if(!ar(d)){var f=d.match(Cp);if(f){var h=f[1],v=f[2]?f[2]:null,p=n(e,d,h,v,a,i,s);if(p===!1)break}}}},Sp=function(e,n){return e.addEventFields(e.context,n),new wp(n.type,n)},ID=function(e,n,r){if(JE(r)){n(e,r);return}else if(Oe(r)){n(e,Sp(e,r));return}for(var a=Ke(r)?r:r.split(/\s+/),i=0;i<a.length;i++){var s=a[i];if(!ar(s)){var l=s.match(Cp);if(l){var u=l[1],c=l[2]?l[2]:null,d=Sp(e,{type:u,namespace:c,target:e.context});n(e,d)}}}};pr.on=pr.addListener=function(t,e,n,r,a){return Ep(this,function(i,s,l,u,c,d,f){Ye(d)&&i.listeners.push({event:s,callback:d,type:l,namespace:u,qualifier:c,conf:f})},t,e,n,r,a),this},pr.one=function(t,e,n,r){return this.on(t,e,n,r,{one:!0})},pr.removeListener=pr.off=function(t,e,n,r){var a=this;this.emitting!==0&&(this.listeners=lT(this.listeners));for(var i=this.listeners,s=function(c){var d=i[c];Ep(a,function(f,h,v,p,g,y){if((d.type===v||t==="*")&&(!p&&d.namespace!==".*"||d.namespace===p)&&(!g||f.qualifierCompare(d.qualifier,g))&&(!y||d.callback===y))return i.splice(c,1),!1},t,e,n,r)},l=i.length-1;l>=0;l--)s(l);return this},pr.removeAllListeners=function(){return this.removeListener("*")},pr.emit=pr.trigger=function(t,e,n){var r=this.listeners,a=r.length;return this.emitting++,Ke(e)||(e=[e]),ID(this,function(i,s){n!=null&&(r=[{event:s.event,type:s.type,namespace:s.namespace,callback:n}],a=r.length);for(var l=function(d){var f=r[d];if(f.type===s.type&&(!f.namespace||f.namespace===s.namespace||f.namespace===PD)&&i.eventMatches(i.context,f,s)){var h=[s];e!=null&&uT(h,e),i.beforeEmit(i.context,f,s),f.conf&&f.conf.one&&(i.listeners=i.listeners.filter(function(g){return g!==f}));var v=i.callbackContext(i.context,f,s),p=f.callback.apply(v,h);i.afterEmit(i.context,f,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},u=0;u<a;u++)l(u);i.bubble(i.context)&&!s.isPropagationStopped()&&i.parent(i.context).emit(s,e)},t),this.emitting--,this};var LD={qualifierCompare:function(e,n){return e==null||n==null?e==null&&n==null:e.sameText(n)},eventMatches:function(e,n,r){var a=n.qualifier;return a!=null?e!==r.target&&yi(r.target)&&a.matches(r.target):!0},addEventFields:function(e,n){n.cy=e.cy(),n.target=e},callbackContext:function(e,n,r){return n.qualifier!=null?r.target:e},beforeEmit:function(e,n){n.conf&&n.conf.once&&n.conf.onceCollection.removeListener(n.event,n.qualifier,n.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},ls=function(e){return be(e)?new ur(e):e},Tp={createEmitter:function(){for(var e=0;e<this.length;e++){var n=this[e],r=n._private;r.emitter||(r.emitter=new ss(LD,n))}return this},emitter:function(){return this._private.emitter},on:function(e,n,r){for(var a=ls(n),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,r)}return this},removeListener:function(e,n,r){for(var a=ls(n),i=0;i<this.length;i++){var s=this[i];s.emitter().removeListener(e,a,r)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var n=this[e];n.emitter().removeAllListeners()}return this},one:function(e,n,r){for(var a=ls(n),i=0;i<this.length;i++){var s=this[i];s.emitter().one(e,a,r)}return this},once:function(e,n,r){for(var a=ls(n),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,r,{once:!0,onceCollection:this})}},emit:function(e,n){for(var r=0;r<this.length;r++){var a=this[r];a.emitter().emit(e,n)}return this},emitAndNotify:function(e,n){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,n),this}};Re.eventAliasesOn(Tp);var Bp={nodes:function(e){return this.filter(function(n){return n.isNode()}).filter(e)},edges:function(e){return this.filter(function(n){return n.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),n=this.spawn(),r=0;r<this.length;r++){var a=this[r];a.isNode()?e.push(a):n.push(a)}return{nodes:e,edges:n}},filter:function(e,n){if(e===void 0)return this;if(be(e)||Ut(e))return new ur(e).filter(this);if(Ye(e)){for(var r=this.spawn(),a=this,i=0;i<a.length;i++){var s=a[i],l=n?e.apply(n,[s,i,a]):e(s,i,a);l&&r.push(s)}return r}return this.spawn()},not:function(e){if(e){be(e)&&(e=this.filter(e));for(var n=this.spawn(),r=0;r<this.length;r++){var a=this[r],i=e.has(a);i||n.push(a)}return n}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(be(e)){var n=e;return this.filter(n)}for(var r=this.spawn(),a=this,i=e,s=this.length<e.length,l=s?a:i,u=s?i:a,c=0;c<l.length;c++){var d=l[c];u.has(d)&&r.push(d)}return r},xor:function(e){var n=this._private.cy;be(e)&&(e=n.$(e));var r=this.spawn(),a=this,i=e,s=function(u,c){for(var d=0;d<u.length;d++){var f=u[d],h=f._private.data.id,v=c.hasElementWithId(h);v||r.push(f)}};return s(a,i),s(i,a),r},diff:function(e){var n=this._private.cy;be(e)&&(e=n.$(e));var r=this.spawn(),a=this.spawn(),i=this.spawn(),s=this,l=e,u=function(d,f,h){for(var v=0;v<d.length;v++){var p=d[v],g=p._private.data.id,y=f.hasElementWithId(g);y?i.merge(p):h.push(p)}};return u(s,l,r),u(l,s,a),{left:r,right:a,both:i}},add:function(e){var n=this._private.cy;if(!e)return this;if(be(e)){var r=e;e=n.mutableElements().filter(r)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var s=e[i],l=!this.has(s);l&&a.push(s)}return a},merge:function(e){var n=this._private,r=n.cy;if(!e)return this;if(e&&be(e)){var a=e;e=r.mutableElements().filter(a)}for(var i=n.map,s=0;s<e.length;s++){var l=e[s],u=l._private.data.id,c=!i.has(u);if(c){var d=this.length++;this[d]=l,i.set(u,{ele:l,index:d})}}return this},unmergeAt:function(e){var n=this[e],r=n.id(),a=this._private,i=a.map;this[e]=void 0,i.delete(r);var s=e===this.length-1;if(this.length>1&&!s){var l=this.length-1,u=this[l],c=u._private.data.id;this[l]=void 0,this[e]=u,i.set(c,{ele:u,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var n=this._private,r=e._private.data.id,a=n.map,i=a.get(r);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var n=this._private.cy;if(!e)return this;if(e&&be(e)){var r=e;e=n.mutableElements().filter(r)}for(var a=0;a<e.length;a++)this.unmergeOne(e[a]);return this},unmergeBy:function(e){for(var n=this.length-1;n>=0;n--){var r=this[n];e(r)&&this.unmergeAt(n)}return this},map:function(e,n){for(var r=[],a=this,i=0;i<a.length;i++){var s=a[i],l=n?e.apply(n,[s,i,a]):e(s,i,a);r.push(l)}return r},reduce:function(e,n){for(var r=n,a=this,i=0;i<a.length;i++)r=e(r,a[i],i,a);return r},max:function(e,n){for(var r=-1/0,a,i=this,s=0;s<i.length;s++){var l=i[s],u=n?e.apply(n,[l,s,i]):e(l,s,i);u>r&&(r=u,a=l)}return{value:r,ele:a}},min:function(e,n){for(var r=1/0,a,i=this,s=0;s<i.length;s++){var l=i[s],u=n?e.apply(n,[l,s,i]):e(l,s,i);u<r&&(r=u,a=l)}return{value:r,ele:a}}},Le=Bp;Le.u=Le["|"]=Le["+"]=Le.union=Le.or=Le.add,Le["\\"]=Le["!"]=Le["-"]=Le.difference=Le.relativeComplement=Le.subtract=Le.not,Le.n=Le["&"]=Le["."]=Le.and=Le.intersection=Le.intersect,Le["^"]=Le["(+)"]=Le["(-)"]=Le.symmetricDifference=Le.symdiff=Le.xor,Le.fnFilter=Le.filterFn=Le.stdFilter=Le.filter,Le.complement=Le.abscomp=Le.absoluteComplement;var MD={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},Np=function(e,n){var r=e.cy(),a=r.hasCompoundNodes();function i(d){var f=d.pstyle("z-compound-depth");return f.value==="auto"?a?d.zDepth():0:f.value==="bottom"?-1:f.value==="top"?Wl:0}var s=i(e)-i(n);if(s!==0)return s;function l(d){var f=d.pstyle("z-index-compare");return f.value==="auto"&&d.isNode()?1:0}var u=l(e)-l(n);if(u!==0)return u;var c=e.pstyle("z-index").value-n.pstyle("z-index").value;return c!==0?c:e.poolIndex()-n.poolIndex()},cs={forEach:function(e,n){if(Ye(e))for(var r=this.length,a=0;a<r;a++){var i=this[a],s=n?e.apply(n,[i,a,this]):e(i,a,this);if(s===!1)break}return this},toArray:function(){for(var e=[],n=0;n<this.length;n++)e.push(this[n]);return e},slice:function(e,n){var r=[],a=this.length;n==null&&(n=a),e==null&&(e=0),e<0&&(e=a+e),n<0&&(n=a+n);for(var i=e;i>=0&&i<n&&i<a;i++)r.push(this[i]);return this.spawn(r)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!Ye(e))return this;var n=this.toArray().sort(e);return this.spawn(n)},sortByZIndex:function(){return this.sort(Np)},zDepth:function(){var e=this[0];if(e){var n=e._private,r=n.group;if(r==="nodes"){var a=n.data.parent?e.parents().size():0;return e.isParent()?a:Wl-1}else{var i=n.source,s=n.target,l=i.zDepth(),u=s.zDepth();return Math.max(l,u,0)}}}};cs.each=cs.forEach;var FD=function(){var e="undefined",n=(typeof Symbol>"u"?"undefined":st(Symbol))!=e&&st(Symbol.iterator)!=e;n&&(cs[Symbol.iterator]=function(){var r=this,a={value:void 0,done:!1},i=0,s=this.length;return zf({next:function(){return i<s?a.value=r[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};FD();var AD=wt({nodeDimensionsIncludeLabels:!1}),us={layoutDimensions:function(e){e=AD(e);var n;if(!this.takesUpSpace())n={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var r=this.boundingBox();n={w:r.w,h:r.h}}else n={w:this.outerWidth(),h:this.outerHeight()};return(n.w===0||n.h===0)&&(n.w=n.h=1),n},layoutPositions:function(e,n,r){var a=this.nodes().filter(function(k){return!k.isParent()}),i=this.cy(),s=n.eles,l=function(E){return E.id()},u=bi(r,l);e.emit({type:"layoutstart",layout:e}),e.animations=[];var c=function(E,x,B){var S={x:x.x1+x.w/2,y:x.y1+x.h/2},N={x:(B.x-S.x)*E,y:(B.y-S.y)*E};return{x:S.x+N.x,y:S.y+N.y}},d=n.spacingFactor&&n.spacingFactor!==1,f=function(){if(!d)return null;for(var E=zt(),x=0;x<a.length;x++){var B=a[x],S=u(B,x);VT(E,S.x,S.y)}return E},h=f(),v=bi(function(k,E){var x=u(k,E);if(d){var B=Math.abs(n.spacingFactor);x=c(B,h,x)}return n.transform!=null&&(x=n.transform(k,x)),x},l);if(n.animate){for(var p=0;p<a.length;p++){var g=a[p],y=v(g,p),m=n.animateFilter==null||n.animateFilter(g,p);if(m){var b=g.animation({position:y,duration:n.animationDuration,easing:n.animationEasing});e.animations.push(b)}else g.position(y)}if(n.fit){var w=i.animation({fit:{boundingBox:s.boundingBoxAt(v),padding:n.padding},duration:n.animationDuration,easing:n.animationEasing});e.animations.push(w)}else if(n.zoom!==void 0&&n.pan!==void 0){var C=i.animation({zoom:n.zoom,pan:n.pan,duration:n.animationDuration,easing:n.animationEasing});e.animations.push(C)}e.animations.forEach(function(k){return k.play()}),e.one("layoutready",n.ready),e.emit({type:"layoutready",layout:e}),xa.all(e.animations.map(function(k){return k.promise()})).then(function(){e.one("layoutstop",n.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(v),n.fit&&i.fit(n.eles,n.padding),n.zoom!=null&&i.zoom(n.zoom),n.pan&&i.pan(n.pan),e.one("layoutready",n.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",n.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var n=this.cy();return n.makeLayout(xe({},e,{eles:this}))}};us.createLayout=us.makeLayout=us.layout;function Dp(t,e,n){var r=n._private,a=r.styleCache=r.styleCache||[],i;return(i=a[t])!=null||(i=a[t]=e(n)),i}function ds(t,e){return t=Mr(t),function(r){return Dp(t,e,r)}}function fs(t,e){t=Mr(t);var n=function(a){return e.call(a)};return function(){var a=this[0];if(a)return Dp(t,n,a)}}var Ct={recalculateRenderedStyle:function(e){var n=this.cy(),r=n.renderer(),a=n.styleEnabled();return r&&a&&r.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),n=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var r;r=this.spawnSelf().merge(this.descendants()).merge(this.parents()),r.merge(r.connectedEdges()),r.forEach(n)}else this.forEach(function(a){n(a),a.connectedEdges().forEach(n)});return this},updateStyle:function(e){var n=this._private.cy;if(!n.styleEnabled())return this;if(n.batching()){var r=n._private.batchStyleEles;return r.merge(this),this}var a=n.hasCompoundNodes(),i=this;e=!!(e||e===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=i;return e?s.emitAndNotify("style"):s.emit("style"),i.forEach(function(l){return l._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var n=0;n<this.length;n++){var r=this[n];r._private.styleDirty&&(r._private.styleDirty=!1,e.style().apply(r))}},parsedStyle:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this[0],a=r.cy();if(a.styleEnabled()&&r){this.cleanStyle();var i=r._private.style[e];return i??(n?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var n=this[0];if(n.cy().styleEnabled()&&n){var r=n.pstyle(e);return r.pfValue!==void 0?r.pfValue:r.value}},numericStyleUnits:function(e){var n=this[0];if(n.cy().styleEnabled()&&n)return n.pstyle(e).units},renderedStyle:function(e){var n=this.cy();if(!n.styleEnabled())return this;var r=this[0];if(r)return n.style().getRenderedStyle(r,e)},style:function(e,n){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,i=r.style();if(Oe(e)){var s=e;i.applyBypass(this,s,a),this.emitAndNotify("style")}else if(be(e))if(n===void 0){var l=this[0];return l?i.getStylePropertyValue(l,e):void 0}else i.applyBypass(this,e,n,a),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?i.getRawStyle(u):void 0}return this},removeStyle:function(e){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,a=n.style(),i=this;if(e===void 0)for(var s=0;s<i.length;s++){var l=i[s];a.removeAllBypasses(l,r)}else{e=e.split(/\s+/);for(var u=0;u<i.length;u++){var c=i[u];a.removeBypasses(c,e,r)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var n=e.hasCompoundNodes(),r=this[0];if(r){var a=r._private,i=r.pstyle("opacity").value;if(!n)return i;var s=a.data.parent?r.parents():null;if(s)for(var l=0;l<s.length;l++){var u=s[l],c=u.pstyle("opacity").value;i=c*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var n=this[0],r=n.cy().hasCompoundNodes();if(n)return r?n.effectiveOpacity()===0:n.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var n=this[0];return!!n._private.backgrounding}};function mc(t,e){var n=t._private,r=n.data.parent?t.parents():null;if(r)for(var a=0;a<r.length;a++){var i=r[a];if(!e(i))return!1}return!0}function yc(t){var e=t.ok,n=t.edgeOkViaNode||t.ok,r=t.parentOk||t.ok;return function(){var a=this.cy();if(!a.styleEnabled())return!0;var i=this[0],s=a.hasCompoundNodes();if(i){var l=i._private;if(!e(i))return!1;if(i.isNode())return!s||mc(i,r);var u=l.source,c=l.target;return n(u)&&(!s||mc(u,n))&&(u===c||n(c)&&(!s||mc(c,n)))}}}var Pa=ds("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Ct.takesUpSpace=fs("takesUpSpace",yc({ok:Pa}));var VD=ds("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Pa(t)}),RD=ds("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Pa(t)});Ct.interactive=fs("interactive",yc({ok:VD,parentOk:RD,edgeOkViaNode:Pa})),Ct.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var $D=ds("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Pa(t)}),zD=Pa;Ct.visible=fs("visible",yc({ok:$D,edgeOkViaNode:zD})),Ct.hidden=function(){var t=this[0];if(t)return!t.visible()},Ct.isBundledBezier=fs("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),Ct.bypass=Ct.css=Ct.style,Ct.renderedCss=Ct.renderedStyle,Ct.removeBypass=Ct.removeCss=Ct.removeStyle,Ct.pstyle=Ct.parsedStyle;var vr={};function _p(t){return function(){var e=arguments,n=[];if(e.length===2){var r=e[0],a=e[1];this.on(t.event,r,a)}else if(e.length===1&&Ye(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&Ke(e[0])){for(var s=e.length===1?e[0]:null,l=0;l<this.length;l++){var u=this[l],c=!t.ableField||u._private[t.ableField],d=u._private[t.field]!=t.value;if(t.overrideAble){var f=t.overrideAble(u);if(f!==void 0&&(c=f,!f))return this}c&&(u._private[t.field]=t.value,d&&n.push(u))}var h=this.spawn(n);h.updateStyle(),h.emit(t.event),s&&h.emit(s)}return this}}function Oa(t){vr[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var n=t.overrideField(e);if(n!==void 0)return n}return e._private[t.field]}},vr[t.on]=_p({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),vr[t.off]=_p({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Oa({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),Oa({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),Oa({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),Oa({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),vr.deselect=vr.unselect,vr.grabbed=function(){var t=this[0];if(t)return t._private.grabbed},Oa({field:"active",on:"activate",off:"unactivate"}),Oa({field:"pannable",on:"panify",off:"unpanify"}),vr.inactive=function(){var t=this[0];if(t)return!t._private.active};var Tt={},Pp=function(e){return function(r){for(var a=this,i=[],s=0;s<a.length;s++){var l=a[s];if(l.isNode()){for(var u=!1,c=l.connectedEdges(),d=0;d<c.length;d++){var f=c[d],h=f.source(),v=f.target();if(e.noIncomingEdges&&v===l&&h!==l||e.noOutgoingEdges&&h===l&&v!==l){u=!0;break}}u||i.push(l)}}return this.spawn(i,!0).filter(r)}},Op=function(e){return function(n){for(var r=this,a=[],i=0;i<r.length;i++){var s=r[i];if(s.isNode())for(var l=s.connectedEdges(),u=0;u<l.length;u++){var c=l[u],d=c.source(),f=c.target();e.outgoing&&d===s?(a.push(c),a.push(f)):e.incoming&&f===s&&(a.push(c),a.push(d))}}return this.spawn(a,!0).filter(n)}},Ip=function(e){return function(n){for(var r=this,a=[],i={};;){var s=e.outgoing?r.outgoers():r.incomers();if(s.length===0)break;for(var l=!1,u=0;u<s.length;u++){var c=s[u],d=c.id();i[d]||(i[d]=!0,a.push(c),l=!0)}if(!l)break;r=s}return this.spawn(a,!0).filter(n)}};Tt.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null},xe(Tt,{roots:Pp({noIncomingEdges:!0}),leaves:Pp({noOutgoingEdges:!0}),outgoers:en(Op({outgoing:!0}),"outgoers"),successors:Ip({outgoing:!0}),incomers:en(Op({incoming:!0}),"incomers"),predecessors:Ip({incoming:!0})}),xe(Tt,{neighborhood:en(function(t){for(var e=[],n=this.nodes(),r=0;r<n.length;r++)for(var a=n[r],i=a.connectedEdges(),s=0;s<i.length;s++){var l=i[s],u=l.source(),c=l.target(),d=a===u?c:u;d.length>0&&e.push(d[0]),e.push(l[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Tt.neighbourhood=Tt.neighborhood,Tt.closedNeighbourhood=Tt.closedNeighborhood,Tt.openNeighbourhood=Tt.openNeighborhood,xe(Tt,{source:en(function(e){var n=this[0],r;return n&&(r=n._private.source||n.cy().collection()),r&&e?r.filter(e):r},"source"),target:en(function(e){var n=this[0],r;return n&&(r=n._private.target||n.cy().collection()),r&&e?r.filter(e):r},"target"),sources:Lp({attr:"source"}),targets:Lp({attr:"target"})});function Lp(t){return function(n){for(var r=[],a=0;a<this.length;a++){var i=this[a],s=i._private[t.attr];s&&r.push(s)}return this.spawn(r,!0).filter(n)}}xe(Tt,{edgesWith:en(Mp(),"edgesWith"),edgesTo:en(Mp({thisIsSrc:!0}),"edgesTo")});function Mp(t){return function(n){var r=[],a=this._private.cy,i=t||{};be(n)&&(n=a.$(n));for(var s=0;s<n.length;s++)for(var l=n[s]._private.edges,u=0;u<l.length;u++){var c=l[u],d=c._private.data,f=this.hasElementWithId(d.source)&&n.hasElementWithId(d.target),h=n.hasElementWithId(d.source)&&this.hasElementWithId(d.target),v=f||h;v&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!f||i.thisIsTgt&&!h)||r.push(c))}return this.spawn(r,!0)}}xe(Tt,{connectedEdges:en(function(t){for(var e=[],n=this,r=0;r<n.length;r++){var a=n[r];if(a.isNode())for(var i=a._private.edges,s=0;s<i.length;s++){var l=i[s];e.push(l)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:en(function(t){for(var e=[],n=this,r=0;r<n.length;r++){var a=n[r];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:en(Fp(),"parallelEdges"),codirectedEdges:en(Fp({codirected:!0}),"codirectedEdges")});function Fp(t){var e={codirected:!1};return t=xe({},e,t),function(r){for(var a=[],i=this.edges(),s=t,l=0;l<i.length;l++)for(var u=i[l],c=u._private,d=c.source,f=d._private.data.id,h=c.data.target,v=d._private.edges,p=0;p<v.length;p++){var g=v[p],y=g._private.data,m=y.target,b=y.source,w=m===h&&b===f,C=f===m&&h===b;(s.codirected&&w||!s.codirected&&(w||C))&&a.push(g)}return this.spawn(a,!0).filter(r)}}xe(Tt,{components:function(e){var n=this,r=n.cy(),a=r.collection(),i=e==null?n.nodes():e.nodes(),s=[];e!=null&&i.empty()&&(i=e.sources());var l=function(d,f){a.merge(d),i.unmerge(d),f.merge(d)};if(i.empty())return n.spawn();var u=function(){var d=r.collection();s.push(d);var f=i[0];l(f,d),n.bfs({directed:!1,roots:f,visit:function(v){return l(v,d)}}),d.forEach(function(h){h.connectedEdges().forEach(function(v){n.has(v)&&d.has(v.source())&&d.has(v.target())&&d.merge(v)})})};do u();while(i.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Tt.componentsOf=Tt.components;var kt=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Ze("A collection must have a reference to the core");return}var i=new xn,s=!1;if(!n)n=[];else if(n.length>0&&Oe(n[0])&&!yi(n[0])){s=!0;for(var l=[],u=new ga,c=0,d=n.length;c<d;c++){var f=n[c];f.data==null&&(f.data={});var h=f.data;if(h.id==null)h.id=hh();else if(e.hasElementWithId(h.id)||u.has(h.id))continue;var v=new zo(e,f,!1);l.push(v),u.add(h.id)}n=l}this.length=0;for(var p=0,g=n.length;p<g;p++){var y=n[p][0];if(y!=null){var m=y._private.data.id;(!r||!i.has(m))&&(r&&i.set(m,{index:this.length,ele:y}),this[this.length]=y,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(b){this.lazyMap=b},rebuildMap:function(){for(var w=this.lazyMap=new xn,C=this.eles,k=0;k<C.length;k++){var E=C[k];w.set(E.id(),{index:k,ele:E})}}},r&&(this._private.map=i),s&&!a&&this.restore()},qe=zo.prototype=kt.prototype=Object.create(Array.prototype);qe.instanceString=function(){return"collection"},qe.spawn=function(t,e){return new kt(this.cy(),t,e)},qe.spawnSelf=function(){return this.spawn(this)},qe.cy=function(){return this._private.cy},qe.renderer=function(){return this._private.cy.renderer()},qe.element=function(){return this[0]},qe.collection=function(){return Wf(this)?this:new kt(this._private.cy,[this])},qe.unique=function(){return new kt(this._private.cy,this,!0)},qe.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)},qe.getElementById=function(t){t=""+t;var e=this._private.cy,n=this._private.map.get(t);return n?n.ele:new kt(e)},qe.$id=qe.getElementById,qe.poolIndex=function(){var t=this._private.cy,e=t._private.elements,n=this[0]._private.data.id;return e._private.map.get(n).index},qe.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index},qe.indexOfId=function(t){return t=""+t,this._private.map.get(t).index},qe.json=function(t){var e=this.element(),n=this.cy();if(e==null&&t)return this;if(e!=null){var r=e._private;if(Oe(t)){if(n.startBatch(),t.data){e.data(t.data);var a=r.data;if(e.isEdge()){var i=!1,s={},l=t.data.source,u=t.data.target;l!=null&&l!=a.source&&(s.source=""+l,i=!0),u!=null&&u!=a.target&&(s.target=""+u,i=!0),i&&(e=e.move(s))}else{var c="parent"in t.data,d=t.data.parent;c&&(d!=null||a.parent!=null)&&d!=a.parent&&(d===void 0&&(d=null),d!=null&&(d=""+d),e=e.move({parent:d}))}}t.position&&e.position(t.position);var f=function(g,y,m){var b=t[g];b!=null&&b!==r[g]&&(b?e[y]():e[m]())};return f("removed","remove","restore"),f("selected","select","unselect"),f("selectable","selectify","unselectify"),f("locked","lock","unlock"),f("grabbable","grabify","ungrabify"),f("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),n.endBatch(),this}else if(t===void 0){var h={data:kn(r.data),position:kn(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};h.classes="";var v=0;return r.classes.forEach(function(p){return h.classes+=v++===0?p:" "+p}),h}}},qe.jsons=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e],r=n.json();t.push(r)}return t},qe.clone=function(){for(var t=this.cy(),e=[],n=0;n<this.length;n++){var r=this[n],a=r.json(),i=new zo(t,a,!1);e.push(i)}return new kt(t,e)},qe.copy=qe.clone,qe.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=n.cy(),a=r._private,i=[],s=[],l,u=0,c=n.length;u<c;u++){var d=n[u];e&&!d.removed()||(d.isNode()?i.push(d):s.push(d))}l=i.concat(s);var f,h=function(){l.splice(f,1),f--};for(f=0;f<l.length;f++){var v=l[f],p=v._private,g=p.data;if(v.clearTraversalCache(),!(!e&&!p.removed)){if(g.id===void 0)g.id=hh();else if(le(g.id))g.id=""+g.id;else if(ar(g.id)||!be(g.id)){Ze("Can not create element with invalid string ID `"+g.id+"`"),h();continue}else if(r.hasElementWithId(g.id)){Ze("Can not create second element with ID `"+g.id+"`"),h();continue}}var y=g.id;if(v.isNode()){var m=p.position;m.x==null&&(m.x=0),m.y==null&&(m.y=0)}if(v.isEdge()){for(var b=v,w=["source","target"],C=w.length,k=!1,E=0;E<C;E++){var x=w[E],B=g[x];le(B)&&(B=g[x]=""+g[x]),B==null||B===""?(Ze("Can not create edge `"+y+"` with unspecified "+x),k=!0):r.hasElementWithId(B)||(Ze("Can not create edge `"+y+"` with nonexistant "+x+" `"+B+"`"),k=!0)}if(k){h();continue}var S=r.getElementById(g.source),N=r.getElementById(g.target);S.same(N)?S._private.edges.push(b):(S._private.edges.push(b),N._private.edges.push(b)),b._private.source=S,b._private.target=N}p.map=new xn,p.map.set(y,{ele:v,index:0}),p.removed=!1,e&&r.addToPool(v)}for(var D=0;D<i.length;D++){var _=i[D],I=_._private.data;le(I.parent)&&(I.parent=""+I.parent);var P=I.parent,F=P!=null;if(F||_._private.parent){var O=_._private.parent?r.collection().merge(_._private.parent):r.getElementById(P);if(O.empty())I.parent=void 0;else if(O[0].removed())Ve("Node added with missing parent, reference to parent removed"),I.parent=void 0,_._private.parent=null;else{for(var M=!1,L=O;!L.empty();){if(_.same(L)){M=!0,I.parent=void 0;break}L=L.parent()}M||(O[0]._private.children.push(_),_._private.parent=O[0],a.hasCompoundNodes=!0)}}}if(l.length>0){for(var V=l.length===n.length?n:new kt(r,l),H=0;H<V.length;H++){var $=V[H];$.isNode()||($.parallelEdges().clearTraversalCache(),$.source().clearTraversalCache(),$.target().clearTraversalCache())}var z;a.hasCompoundNodes?z=r.collection().merge(V).merge(V.connectedNodes()).merge(V.parent()):z=V,z.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?V.emitAndNotify("add"):e&&V.emit("add")}return n},qe.removed=function(){var t=this[0];return t&&t._private.removed},qe.inside=function(){var t=this[0];return t&&!t._private.removed},qe.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=[],a={},i=n._private.cy;function s(P){for(var F=P._private.edges,O=0;O<F.length;O++)u(F[O])}function l(P){for(var F=P._private.children,O=0;O<F.length;O++)u(F[O])}function u(P){var F=a[P.id()];e&&P.removed()||F||(a[P.id()]=!0,P.isNode()?(r.push(P),s(P),l(P)):r.unshift(P))}for(var c=0,d=n.length;c<d;c++){var f=n[c];u(f)}function h(P,F){var O=P._private.edges;or(O,F),P.clearTraversalCache()}function v(P){P.clearTraversalCache()}var p=[];p.ids={};function g(P,F){F=F[0],P=P[0];var O=P._private.children,M=P.id();or(O,F),F._private.parent=null,p.ids[M]||(p.ids[M]=!0,p.push(P))}n.dirtyCompoundBoundsCache(),e&&i.removeFromPool(r);for(var y=0;y<r.length;y++){var m=r[y];if(m.isEdge()){var b=m.source()[0],w=m.target()[0];h(b,m),h(w,m);for(var C=m.parallelEdges(),k=0;k<C.length;k++){var E=C[k];v(E),E.isBundledBezier()&&E.dirtyBoundingBoxCache()}}else{var x=m.parent();x.length!==0&&g(x,m)}e&&(m._private.removed=!0)}var B=i._private.elements;i._private.hasCompoundNodes=!1;for(var S=0;S<B.length;S++){var N=B[S];if(N.isParent()){i._private.hasCompoundNodes=!0;break}}var D=new kt(this.cy(),r);D.size()>0&&(t?D.emitAndNotify("remove"):e&&D.emit("remove"));for(var _=0;_<p.length;_++){var I=p[_];(!e||!I.removed())&&I.updateStyle()}return D},qe.move=function(t){var e=this._private.cy,n=this,r=!1,a=!1,i=function(p){return p==null?p:""+p};if(t.source!==void 0||t.target!==void 0){var s=i(t.source),l=i(t.target),u=s!=null&&e.hasElementWithId(s),c=l!=null&&e.hasElementWithId(l);(u||c)&&(e.batch(function(){n.remove(r,a),n.emitAndNotify("moveout");for(var v=0;v<n.length;v++){var p=n[v],g=p._private.data;p.isEdge()&&(u&&(g.source=s),c&&(g.target=l))}n.restore(r,a)}),n.emitAndNotify("move"))}else if(t.parent!==void 0){var d=i(t.parent),f=d===null||e.hasElementWithId(d);if(f){var h=d===null?void 0:d;e.batch(function(){var v=n.remove(r,a);v.emitAndNotify("moveout");for(var p=0;p<n.length;p++){var g=n[p],y=g._private.data;g.isNode()&&(y.parent=h)}v.restore(r,a)}),n.emitAndNotify("move")}}return this},[$h,QN,rs,fr,Na,pD,as,_D,Tp,Bp,MD,cs,us,Ct,vr,Tt].forEach(function(t){xe(qe,t)});var HD={add:function(e){var n,r=this;if(Ut(e)){var a=e;if(a._private.cy===r)n=a.restore();else{for(var i=[],s=0;s<a.length;s++){var l=a[s];i.push(l.json())}n=new kt(r,i)}}else if(Ke(e)){var u=e;n=new kt(r,u)}else if(Oe(e)&&(Ke(e.nodes)||Ke(e.edges))){for(var c=e,d=[],f=["nodes","edges"],h=0,v=f.length;h<v;h++){var p=f[h],g=c[p];if(Ke(g))for(var y=0,m=g.length;y<m;y++){var b=xe({group:p},g[y]);d.push(b)}}n=new kt(r,d)}else{var w=e;n=new zo(r,w).collection()}return n},remove:function(e){if(!Ut(e)){if(be(e)){var n=e;e=this.$(n)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function KD(t,e,n,r){var a=4,i=.001,s=1e-7,l=10,u=11,c=1/(u-1),d=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var f=0;f<4;++f)if(typeof arguments[f]!="number"||isNaN(arguments[f])||!isFinite(arguments[f]))return!1;t=Math.min(t,1),n=Math.min(n,1),t=Math.max(t,0),n=Math.max(n,0);var h=d?new Float32Array(u):new Array(u);function v(N,D){return 1-3*D+3*N}function p(N,D){return 3*D-6*N}function g(N){return 3*N}function y(N,D,_){return((v(D,_)*N+p(D,_))*N+g(D))*N}function m(N,D,_){return 3*v(D,_)*N*N+2*p(D,_)*N+g(D)}function b(N,D){for(var _=0;_<a;++_){var I=m(D,t,n);if(I===0)return D;var P=y(D,t,n)-N;D-=P/I}return D}function w(){for(var N=0;N<u;++N)h[N]=y(N*c,t,n)}function C(N,D,_){var I,P,F=0;do P=D+(_-D)/2,I=y(P,t,n)-N,I>0?_=P:D=P;while(Math.abs(I)>s&&++F<l);return P}function k(N){for(var D=0,_=1,I=u-1;_!==I&&h[_]<=N;++_)D+=c;--_;var P=(N-h[_])/(h[_+1]-h[_]),F=D+P*c,O=m(F,t,n);return O>=i?b(N,F):O===0?F:C(N,D,D+c)}var E=!1;function x(){E=!0,(t!==e||n!==r)&&w()}var B=function(D){return E||x(),t===e&&n===r?D:D===0?0:D===1?1:y(k(D),e,r)};B.getControlPoints=function(){return[{x:t,y:e},{x:n,y:r}]};var S="generateBezier("+[t,e,n,r]+")";return B.toString=function(){return S},B}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var qD=function(){function t(r){return-r.tension*r.x-r.friction*r.v}function e(r,a,i){var s={x:r.x+i.dx*a,v:r.v+i.dv*a,tension:r.tension,friction:r.friction};return{dx:s.v,dv:t(s)}}function n(r,a){var i={dx:r.v,dv:t(r)},s=e(r,a*.5,i),l=e(r,a*.5,s),u=e(r,a,l),c=1/6*(i.dx+2*(s.dx+l.dx)+u.dx),d=1/6*(i.dv+2*(s.dv+l.dv)+u.dv);return r.x=r.x+c*a,r.v=r.v+d*a,r}return function r(a,i,s){var l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,d=1/1e4,f=16/1e3,h,v,p;for(a=parseFloat(a)||500,i=parseFloat(i)||20,s=s||null,l.tension=a,l.friction=i,h=s!==null,h?(c=r(a,i),v=c/s*f):v=f;p=n(p||l,v),u.push(1+p.x),c+=16,Math.abs(p.x)>d&&Math.abs(p.v)>d;);return h?function(g){return u[g*(u.length-1)|0]}:c}}(),Ue=function(e,n,r,a){var i=KD(e,n,r,a);return function(s,l,u){return s+(l-s)*i(u)}},hs={linear:function(e,n,r){return e+(n-e)*r},ease:Ue(.25,.1,.25,1),"ease-in":Ue(.42,0,1,1),"ease-out":Ue(0,0,.58,1),"ease-in-out":Ue(.42,0,.58,1),"ease-in-sine":Ue(.47,0,.745,.715),"ease-out-sine":Ue(.39,.575,.565,1),"ease-in-out-sine":Ue(.445,.05,.55,.95),"ease-in-quad":Ue(.55,.085,.68,.53),"ease-out-quad":Ue(.25,.46,.45,.94),"ease-in-out-quad":Ue(.455,.03,.515,.955),"ease-in-cubic":Ue(.55,.055,.675,.19),"ease-out-cubic":Ue(.215,.61,.355,1),"ease-in-out-cubic":Ue(.645,.045,.355,1),"ease-in-quart":Ue(.895,.03,.685,.22),"ease-out-quart":Ue(.165,.84,.44,1),"ease-in-out-quart":Ue(.77,0,.175,1),"ease-in-quint":Ue(.755,.05,.855,.06),"ease-out-quint":Ue(.23,1,.32,1),"ease-in-out-quint":Ue(.86,0,.07,1),"ease-in-expo":Ue(.95,.05,.795,.035),"ease-out-expo":Ue(.19,1,.22,1),"ease-in-out-expo":Ue(1,0,0,1),"ease-in-circ":Ue(.6,.04,.98,.335),"ease-out-circ":Ue(.075,.82,.165,1),"ease-in-out-circ":Ue(.785,.135,.15,.86),spring:function(e,n,r){if(r===0)return hs.linear;var a=qD(e,n,r);return function(i,s,l){return i+(s-i)*a(l)}},"cubic-bezier":Ue};function Ap(t,e,n,r,a){if(r===1||e===n)return n;var i=a(e,n,r);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}function Vp(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Ia(t,e,n,r,a){var i=a!=null?a.type:null;n<0?n=0:n>1&&(n=1);var s=Vp(t,a),l=Vp(e,a);if(le(s)&&le(l))return Ap(i,s,l,n,r);if(Ke(s)&&Ke(l)){for(var u=[],c=0;c<l.length;c++){var d=s[c],f=l[c];if(d!=null&&f!=null){var h=Ap(i,d,f,n,r);u.push(h)}else u.push(f)}return u}}function UD(t,e,n,r){var a=!r,i=t._private,s=e._private,l=s.easing,u=s.startTime,c=r?t:t.cy(),d=c.style();if(!s.easingImpl)if(l==null)s.easingImpl=hs.linear;else{var f;if(be(l)){var h=d.parse("transition-timing-function",l);f=h.value}else f=l;var v,p;be(f)?(v=f,p=[]):(v=f[1],p=f.slice(2).map(function(V){return+V})),p.length>0?(v==="spring"&&p.push(s.duration),s.easingImpl=hs[v].apply(null,p)):s.easingImpl=hs[v]}var g=s.easingImpl,y;if(s.duration===0?y=1:y=(n-u)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var m=s.startPosition,b=s.position;if(b&&a&&!t.locked()){var w={};Ri(m.x,b.x)&&(w.x=Ia(m.x,b.x,y,g)),Ri(m.y,b.y)&&(w.y=Ia(m.y,b.y,y,g)),t.position(w)}var C=s.startPan,k=s.pan,E=i.pan,x=k!=null&&r;x&&(Ri(C.x,k.x)&&(E.x=Ia(C.x,k.x,y,g)),Ri(C.y,k.y)&&(E.y=Ia(C.y,k.y,y,g)),t.emit("pan"));var B=s.startZoom,S=s.zoom,N=S!=null&&r;N&&(Ri(B,S)&&(i.zoom=Ni(i.minZoom,Ia(B,S,y,g),i.maxZoom)),t.emit("zoom")),(x||N)&&t.emit("viewport");var D=s.style;if(D&&D.length>0&&a){for(var _=0;_<D.length;_++){var I=D[_],P=I.name,F=I,O=s.startStyle[P],M=d.properties[O.name],L=Ia(O,F,y,g,M);d.overrideBypass(t,P,L)}t.emit("style")}}return s.progress=y,y}function Ri(t,e){return t==null||e==null?!1:le(t)&&le(e)?!0:!!(t&&e)}function GD(t,e,n,r){var a=e._private;a.started=!0,a.startTime=n-a.progress*a.duration}function Rp(t,e){var n=e._private.aniEles,r=[];function a(d,f){var h=d._private,v=h.animation.current,p=h.animation.queue,g=!1;if(v.length===0){var y=p.shift();y&&v.push(y)}for(var m=function(E){for(var x=E.length-1;x>=0;x--){var B=E[x];B()}E.splice(0,E.length)},b=v.length-1;b>=0;b--){var w=v[b],C=w._private;if(C.stopped){v.splice(b,1),C.hooked=!1,C.playing=!1,C.started=!1,m(C.frames);continue}!C.playing&&!C.applying||(C.playing&&C.applying&&(C.applying=!1),C.started||GD(d,w,t),UD(d,w,t,f),C.applying&&(C.applying=!1),m(C.frames),C.step!=null&&C.step(t),w.completed()&&(v.splice(b,1),C.hooked=!1,C.playing=!1,C.started=!1,m(C.completes)),g=!0)}return!f&&v.length===0&&p.length===0&&r.push(d),g}for(var i=!1,s=0;s<n.length;s++){var l=n[s],u=a(l);i=i||u}var c=a(e,!0);(i||c)&&(n.length>0?e.notify("draw",n):e.notify("draw")),n.unmerge(r),e.emit("step")}var WD={animate:Re.animate(),animation:Re.animation(),animated:Re.animated(),clearQueue:Re.clearQueue(),delay:Re.delay(),delayAnimation:Re.delayAnimation(),stop:Re.stop(),addToAnimationPool:function(e){var n=this;n.styleEnabled()&&n._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function n(){e._private.animationsRunning&&Vo(function(i){Rp(i,e),n()})}var r=e.renderer();r&&r.beforeRender?r.beforeRender(function(i,s){Rp(s,e)},r.beforeRenderPriorities.animations):n()}},jD={qualifierCompare:function(e,n){return e==null||n==null?e==null&&n==null:e.sameText(n)},eventMatches:function(e,n,r){var a=n.qualifier;return a!=null?e!==r.target&&yi(r.target)&&a.matches(r.target):!0},addEventFields:function(e,n){n.cy=e,n.target=e},callbackContext:function(e,n,r){return n.qualifier!=null?r.target:e}},ps=function(e){return be(e)?new ur(e):e},$p={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new ss(jD,this)),this},emitter:function(){return this._private.emitter},on:function(e,n,r){return this.emitter().on(e,ps(n),r),this},removeListener:function(e,n,r){return this.emitter().removeListener(e,ps(n),r),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,n,r){return this.emitter().one(e,ps(n),r),this},once:function(e,n,r){return this.emitter().one(e,ps(n),r),this},emit:function(e,n){return this.emitter().emit(e,n),this},emitAndNotify:function(e,n){return this.emit(e),this.notify(e,n),this}};Re.eventAliasesOn($p);var bc={png:function(e){var n=this._private.renderer;return e=e||{},n.png(e)},jpg:function(e){var n=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",n.jpg(e)}};bc.jpeg=bc.jpg;var vs={layout:function(e){var n=this;if(e==null){Ze("Layout options must be specified to make a layout");return}if(e.name==null){Ze("A `name` must be specified to make a layout");return}var r=e.name,a=n.extension("layout",r);if(a==null){Ze("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;be(e.eles)?i=n.$(e.eles):i=e.eles!=null?e.eles:n.$();var s=new a(xe({},e,{cy:n,eles:i}));return s}};vs.createLayout=vs.makeLayout=vs.layout;var YD={notify:function(e,n){var r=this._private;if(this.batching()){r.batchNotifications=r.batchNotifications||{};var a=r.batchNotifications[e]=r.batchNotifications[e]||this.collection();n!=null&&a.merge(n);return}if(r.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,n)}},notifications:function(e){var n=this._private;return e===void 0?n.notificationsEnabled:(n.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var n=this.renderer();Object.keys(e.batchNotifications).forEach(function(r){var a=e.batchNotifications[r];a.empty()?n.notify(r):n.notify(r,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var n=this;return this.batch(function(){for(var r=Object.keys(e),a=0;a<r.length;a++){var i=r[a],s=e[i],l=n.getElementById(i);l.data(s)}})}},ZD=wt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),wc={renderTo:function(e,n,r,a){var i=this._private.renderer;return i.renderTo(e,n,r,a),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var n=this,r=n.extension("renderer",e.name);if(r==null){Ze("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Ve("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var a=ZD(e);a.cy=n,n._private.renderer=new r(a),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var n=e.container();if(n)for(n._cyreg=null;n.childNodes.length>0;)n.removeChild(n.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(r){var a=r._private;a.rscratch={},a.rstyle={},a.animation.current=[],a.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};wc.invalidateDimensions=wc.resize;var gs={collection:function(e,n){return be(e)?this.$(e):Ut(e)?e.collection():Ke(e)?(n||(n={}),new kt(this,e,n.unique,n.removed)):new kt(this)},nodes:function(e){var n=this.$(function(r){return r.isNode()});return e?n.filter(e):n},edges:function(e){var n=this.$(function(r){return r.isEdge()});return e?n.filter(e):n},$:function(e){var n=this._private.elements;return e?n.filter(e):n.spawnSelf()},mutableElements:function(){return this._private.elements}};gs.elements=gs.filter=gs.$;var Bt={},$i="t",XD="f";Bt.apply=function(t){for(var e=this,n=e._private,r=n.cy,a=r.collection(),i=0;i<t.length;i++){var s=t[i],l=e.getContextMeta(s);if(!l.empty){var u=e.getContextStyle(l),c=e.applyContextStyle(l,u,s);s._private.appliedInitStyle?e.updateTransitions(s,c.diffProps):s._private.appliedInitStyle=!0;var d=e.updateStyleHints(s);d&&a.push(s)}}return a},Bt.getPropertiesDiff=function(t,e){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},a=t+"-"+e,i=r[a];if(i)return i;for(var s=[],l={},u=0;u<n.length;u++){var c=n[u],d=t[u]===$i,f=e[u]===$i,h=d!==f,v=c.mappedProperties.length>0;if(h||f&&v){var p=void 0;h&&v||h?p=c.properties:v&&(p=c.mappedProperties);for(var g=0;g<p.length;g++){for(var y=p[g],m=y.name,b=!1,w=u+1;w<n.length;w++){var C=n[w],k=e[w]===$i;if(k&&(b=C.properties[y.name]!=null,b))break}!l[m]&&!b&&(l[m]=!0,s.push(m))}}}return r[a]=s,s},Bt.getContextMeta=function(t){for(var e=this,n="",r,a=t._private.styleCxtKey||"",i=0;i<e.length;i++){var s=e[i],l=s.selector&&s.selector.matches(t);l?n+=$i:n+=XD}return r=e.getPropertiesDiff(a,n),t._private.styleCxtKey=n,{key:n,diffPropNames:r,empty:r.length===0}},Bt.getContextStyle=function(t){var e=t.key,n=this,r=this._private.contextStyles=this._private.contextStyles||{};if(r[e])return r[e];for(var a={_private:{key:e}},i=0;i<n.length;i++){var s=n[i],l=e[i]===$i;if(l)for(var u=0;u<s.properties.length;u++){var c=s.properties[u];a[c.name]=c}}return r[e]=a,a},Bt.applyContextStyle=function(t,e,n){for(var r=this,a=t.diffPropNames,i={},s=r.types,l=0;l<a.length;l++){var u=a[l],c=e[u],d=n.pstyle(u);if(!c)if(d)d.bypass?c={name:u,deleteBypassed:!0}:c={name:u,delete:!0};else continue;if(d!==c){if(c.mapped===s.fn&&d!=null&&d.mapping!=null&&d.mapping.value===c.value){var f=d.mapping,h=f.fnValue=c.value(n);if(h===f.prevFnValue)continue}var v=i[u]={prev:d};r.applyParsedProperty(n,c),v.next=n.pstyle(u),v.next&&v.next.bypass&&(v.next=v.next.bypassed)}}return{diffProps:i}},Bt.updateStyleHints=function(t){var e=t._private,n=this,r=n.propertyGroupNames,a=n.propertyGroupKeys,i=function(W,oe,he){return n.getPropertiesHash(W,oe,he)},s=e.styleKey;if(t.removed())return!1;var l=e.group==="nodes",u=t._private.style;r=Object.keys(u);for(var c=0;c<a.length;c++){var d=a[c];e.styleKeys[d]=[va,xi]}for(var f=function(W,oe){return e.styleKeys[oe][0]=Ei(W,e.styleKeys[oe][0])},h=function(W,oe){return e.styleKeys[oe][1]=Si(W,e.styleKeys[oe][1])},v=function(W,oe){f(W,oe),h(W,oe)},p=function(W,oe){for(var he=0;he<W.length;he++){var re=W.charCodeAt(he);f(re,oe),h(re,oe)}},g=2e9,y=function(W){return-128<W&&W<128&&Math.floor(W)!==W?g-(W*1024|0):W},m=0;m<r.length;m++){var b=r[m],w=u[b];if(w!=null){var C=this.properties[b],k=C.type,E=C.groupKey,x=void 0;C.hashOverride!=null?x=C.hashOverride(t,w):w.pfValue!=null&&(x=w.pfValue);var B=C.enums==null?w.value:null,S=x!=null,N=B!=null,D=S||N,_=w.units;if(k.number&&D&&!k.multiple){var I=S?x:B;v(y(I),E),!S&&_!=null&&p(_,E)}else p(w.strValue,E)}}for(var P=[va,xi],F=0;F<a.length;F++){var O=a[F],M=e.styleKeys[O];P[0]=Ei(M[0],P[0]),P[1]=Si(M[1],P[1])}e.styleKey=nT(P[0],P[1]);var L=e.styleKeys;e.labelDimsKey=ir(L.labelDimensions);var V=i(t,["label"],L.labelDimensions);if(e.labelKey=ir(V),e.labelStyleKey=ir(Ro(L.commonLabel,V)),!l){var H=i(t,["source-label"],L.labelDimensions);e.sourceLabelKey=ir(H),e.sourceLabelStyleKey=ir(Ro(L.commonLabel,H));var $=i(t,["target-label"],L.labelDimensions);e.targetLabelKey=ir($),e.targetLabelStyleKey=ir(Ro(L.commonLabel,$))}if(l){var z=e.styleKeys,j=z.nodeBody,ee=z.nodeBorder,J=z.nodeOutline,X=z.backgroundImage,ne=z.compound,Y=z.pie,A=[j,ee,J,X,ne,Y].filter(function(K){return K!=null}).reduce(Ro,[va,xi]);e.nodeKey=ir(A),e.hasPie=Y!=null&&Y[0]!==va&&Y[1]!==xi}return s!==e.styleKey},Bt.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null},Bt.applyParsedProperty=function(t,e){var n=this,r=e,a=t._private.style,i,s=n.types,l=n.properties[r.name].type,u=r.bypass,c=a[r.name],d=c&&c.bypass,f=t._private,h="mapping",v=function(j){return j==null?null:j.pfValue!=null?j.pfValue:j.value},p=function(){var j=v(c),ee=v(r);n.checkTriggers(t,r.name,j,ee)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(r=e=this.parse(e.name,"bezier",u)),r.delete)return a[r.name]=void 0,p(),!0;if(r.deleteBypassed)return c?c.bypass?(c.bypassed=void 0,p(),!0):!1:(p(),!0);if(r.deleteBypass)return c?c.bypass?(a[r.name]=c.bypassed,p(),!0):!1:(p(),!0);var g=function(){Ve("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+r.name+"` with data field `"+r.field+"`); try a `["+r.field+"]` selector to limit scope to elements with `"+r.field+"` defined")};switch(r.mapped){case s.mapData:{for(var y=r.field.split("."),m=f.data,b=0;b<y.length&&m;b++){var w=y[b];m=m[w]}if(m==null)return g(),!1;var C;if(le(m)){var k=r.fieldMax-r.fieldMin;k===0?C=0:C=(m-r.fieldMin)/k}else return Ve("Do not use continuous mappers without specifying numeric data (i.e. `"+r.field+": "+m+"` for `"+t.id()+"` is non-numeric)"),!1;if(C<0?C=0:C>1&&(C=1),l.color){var E=r.valueMin[0],x=r.valueMax[0],B=r.valueMin[1],S=r.valueMax[1],N=r.valueMin[2],D=r.valueMax[2],_=r.valueMin[3]==null?1:r.valueMin[3],I=r.valueMax[3]==null?1:r.valueMax[3],P=[Math.round(E+(x-E)*C),Math.round(B+(S-B)*C),Math.round(N+(D-N)*C),Math.round(_+(I-_)*C)];i={bypass:r.bypass,name:r.name,value:P,strValue:"rgb("+P[0]+", "+P[1]+", "+P[2]+")"}}else if(l.number){var F=r.valueMin+(r.valueMax-r.valueMin)*C;i=this.parse(r.name,F,r.bypass,h)}else return!1;if(!i)return g(),!1;i.mapping=r,r=i;break}case s.data:{for(var O=r.field.split("."),M=f.data,L=0;L<O.length&&M;L++){var V=O[L];M=M[V]}if(M!=null&&(i=this.parse(r.name,M,r.bypass,h)),!i)return g(),!1;i.mapping=r,r=i;break}case s.fn:{var H=r.value,$=r.fnValue!=null?r.fnValue:H(t);if(r.prevFnValue=$,$==null)return Ve("Custom function mappers may not return null (i.e. `"+r.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(r.name,$,r.bypass,h),!i)return Ve("Custom function mappers may not return invalid values for the property type (i.e. `"+r.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=kn(r),r=i;break}case void 0:break;default:return!1}return u?(d?r.bypassed=c.bypassed:r.bypassed=c,a[r.name]=r):d?c.bypassed=r:a[r.name]=r,p(),!0},Bt.cleanElements=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),!e)r._private.style={};else for(var a=r._private.style,i=Object.keys(a),s=0;s<i.length;s++){var l=i[s],u=a[l];u!=null&&(u.bypass?u.bypassed=null:a[l]=null)}}},Bt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()},Bt.updateTransitions=function(t,e){var n=this,r=t._private,a=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,s=t.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var l={},u=!1,c=0;c<a.length;c++){var d=a[c],f=t.pstyle(d),h=e[d];if(h){var v=h.prev,p=v,g=h.next!=null?h.next:f,y=!1,m=void 0,b=1e-6;p&&(le(p.pfValue)&&le(g.pfValue)?(y=g.pfValue-p.pfValue,m=p.pfValue+b*y):le(p.value)&&le(g.value)?(y=g.value-p.value,m=p.value+b*y):Ke(p.value)&&Ke(g.value)&&(y=p.value[0]!==g.value[0]||p.value[1]!==g.value[1]||p.value[2]!==g.value[2],m=p.strValue),y&&(l[d]=g.strValue,this.applyBypass(t,d,m),u=!0))}}if(!u)return;r.transitioning=!0,new xa(function(w){s>0?t.delayAnimation(s).play().promise().then(w):w()}).then(function(){return t.animation({style:l,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(t,a),t.emitAndNotify("style"),r.transitioning=!1})}else r.transitioning&&(this.removeBypasses(t,a),t.emitAndNotify("style"),r.transitioning=!1)},Bt.checkTrigger=function(t,e,n,r,a,i){var s=this.properties[e],l=a(s);l!=null&&l(n,r)&&i(s)},Bt.checkZOrderTrigger=function(t,e,n,r){var a=this;this.checkTrigger(t,e,n,r,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",t)})},Bt.checkBoundsTrigger=function(t,e,n,r){this.checkTrigger(t,e,n,r,function(a){return a.triggersBounds},function(a){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),a.triggersBoundsOfParallelBeziers&&e==="curve-style"&&(n==="bezier"||r==="bezier")&&t.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()}),a.triggersBoundsOfConnectedEdges&&e==="display"&&(n==="none"||r==="none")&&t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},Bt.checkTriggers=function(t,e,n,r){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,n,r),this.checkBoundsTrigger(t,e,n,r)};var zi={};zi.applyBypass=function(t,e,n,r){var a=this,i=[],s=!0;if(e==="*"||e==="**"){if(n!==void 0)for(var l=0;l<a.properties.length;l++){var u=a.properties[l],c=u.name,d=this.parse(c,n,!0);d&&i.push(d)}}else if(be(e)){var f=this.parse(e,n,!0);f&&i.push(f)}else if(Oe(e)){var h=e;r=n;for(var v=Object.keys(h),p=0;p<v.length;p++){var g=v[p],y=h[g];if(y===void 0&&(y=h[Mo(g)]),y!==void 0){var m=this.parse(g,y,!0);m&&i.push(m)}}}else return!1;if(i.length===0)return!1;for(var b=!1,w=0;w<t.length;w++){for(var C=t[w],k={},E=void 0,x=0;x<i.length;x++){var B=i[x];if(r){var S=C.pstyle(B.name);E=k[B.name]={prev:S}}b=this.applyParsedProperty(C,kn(B))||b,r&&(E.next=C.pstyle(B.name))}b&&this.updateStyleHints(C),r&&this.updateTransitions(C,k,s)}return b},zi.overrideBypass=function(t,e,n){e=ql(e);for(var r=0;r<t.length;r++){var a=t[r],i=a._private.style[e],s=this.properties[e].type,l=s.color,u=s.mutiple,c=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,e,n):(i.value=n,i.pfValue!=null&&(i.pfValue=n),l?i.strValue="rgb("+n.join(",")+")":u?i.strValue=n.join(" "):i.strValue=""+n,this.updateStyleHints(a)),this.checkTriggers(a,e,c,n)}},zi.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)},zi.removeBypasses=function(t,e,n){for(var r=!0,a=0;a<t.length;a++){for(var i=t[a],s={},l=0;l<e.length;l++){var u=e[l],c=this.properties[u],d=i.pstyle(c.name);if(!(!d||!d.bypass)){var f="",h=this.parse(u,f,!0),v=s[c.name]={prev:d};this.applyParsedProperty(i,h),v.next=i.pstyle(c.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,s,r)}};var Cc={};Cc.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1},Cc.containerCss=function(t){var e=this._private.cy,n=e.container(),r=e.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(t)};var En={};En.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)},En.getRawStyle=function(t,e){var n=this;if(t=t[0],t){for(var r={},a=0;a<n.properties.length;a++){var i=n.properties[a],s=n.getStylePropertyValue(t,i.name,e);s!=null&&(r[i.name]=s,r[Mo(i.name)]=s)}return r}},En.getIndexedStyle=function(t,e,n,r){var a=t.pstyle(e)[n][r];return a??t.cy().style().getDefaultProperty(e)[n][0]},En.getStylePropertyValue=function(t,e,n){var r=this;if(t=t[0],t){var a=r.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,s=t.pstyle(a.name);if(s){var l=s.value,u=s.units,c=s.strValue;if(n&&i.number&&l!=null&&le(l)){var d=t.cy().zoom(),f=function(y){return y*d},h=function(y,m){return f(y)+m},v=Ke(l),p=v?u.every(function(g){return g!=null}):u!=null;return p?v?l.map(function(g,y){return h(g,u[y])}).join(" "):h(l,u):v?l.map(function(g){return be(g)?g:""+f(g)}).join(" "):""+f(l)}else if(c!=null)return c}return null}},En.getAnimationStartStyle=function(t,e){for(var n={},r=0;r<e.length;r++){var a=e[r],i=a.name,s=t.pstyle(i);s!==void 0&&(Oe(s)?s=this.parse(i,s.strValue):s=this.parse(i,s)),s&&(n[i]=s)}return n},En.getPropsList=function(t){var e=this,n=[],r=t,a=e.properties;if(r)for(var i=Object.keys(r),s=0;s<i.length;s++){var l=i[s],u=r[l],c=a[l]||a[ql(l)],d=this.parse(c.name,u);d&&n.push(d)}return n},En.getNonDefaultPropertiesHash=function(t,e,n){var r=n.slice(),a,i,s,l,u,c;for(u=0;u<e.length;u++)if(a=e[u],i=t.pstyle(a,!1),i!=null)if(i.pfValue!=null)r[0]=Ei(l,r[0]),r[1]=Si(l,r[1]);else for(s=i.strValue,c=0;c<s.length;c++)l=s.charCodeAt(c),r[0]=Ei(l,r[0]),r[1]=Si(l,r[1]);return r},En.getPropertiesHash=En.getNonDefaultPropertiesHash;var ms={};ms.appendFromJson=function(t){for(var e=this,n=0;n<t.length;n++){var r=t[n],a=r.selector,i=r.style||r.css,s=Object.keys(i);e.selector(a);for(var l=0;l<s.length;l++){var u=s[l],c=i[u];e.css(u,c)}}return e},ms.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e},ms.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var n=this[e],r=n.selector,a=n.properties,i={},s=0;s<a.length;s++){var l=a[s];i[l.name]=l.strValue}t.push({selector:r?r.toString():"core",style:i})}return t};var kc={};kc.appendFromString=function(t){var e=this,n=this,r=""+t,a,i,s;r=r.replace(/[/][*](\s|.)+?[*][/]/g,"");function l(){r.length>a.length?r=r.substr(a.length):r=""}function u(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var c=r.match(/^\s*$/);if(c)break;var d=r.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){Ve("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+r);break}a=d[0];var f=d[1];if(f!=="core"){var h=new ur(f);if(h.invalid){Ve("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),l();continue}}var v=d[2],p=!1;i=v;for(var g=[];;){var y=i.match(/^\s*$/);if(y)break;var m=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!m){Ve("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+v),p=!0;break}s=m[0];var b=m[1],w=m[2],C=e.properties[b];if(!C){Ve("Skipping property: Invalid property name in: "+s),u();continue}var k=n.parse(b,w);if(!k){Ve("Skipping property: Invalid property definition in: "+s),u();continue}g.push({name:b,val:w}),u()}if(p){l();break}n.selector(f);for(var E=0;E<g.length;E++){var x=g[E];n.css(x.name,x.val)}l()}return n},kc.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var xt={};(function(){var t=ct,e=iS,n=sS,r=lS,a=cS,i=function(A){return"^"+A+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(A){var K=t+"|\\w+|"+e+"|"+n+"|"+r+"|"+a;return"^"+A+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+K+")\\s*\\,\\s*("+K+")\\)$"},l=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];xt.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:l,singleRegexMatchValue:!0},urls:{regexes:l,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(A,K){switch(A.length){case 2:return K[0]!=="deg"&&K[0]!=="rad"&&K[1]!=="deg"&&K[1]!=="rad";case 1:return be(A[0])||K[0]==="deg"||K[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(A){var K=A.length;return K===1||K===2||K===4}}};var u={zeroNonZero:function(A,K){return(A==null||K==null)&&A!==K||A==0&&K!=0?!0:A!=0&&K==0},any:function(A,K){return A!=K},emptyNonEmpty:function(A,K){var W=ar(A),oe=ar(K);return W&&!oe||!W&&oe}},c=xt.types,d=[{name:"label",type:c.text,triggersBounds:u.any,triggersZOrder:u.emptyNonEmpty},{name:"text-rotation",type:c.textRotation,triggersBounds:u.any},{name:"text-margin-x",type:c.bidirectionalSize,triggersBounds:u.any},{name:"text-margin-y",type:c.bidirectionalSize,triggersBounds:u.any}],f=[{name:"source-label",type:c.text,triggersBounds:u.any},{name:"source-text-rotation",type:c.textRotation,triggersBounds:u.any},{name:"source-text-margin-x",type:c.bidirectionalSize,triggersBounds:u.any},{name:"source-text-margin-y",type:c.bidirectionalSize,triggersBounds:u.any},{name:"source-text-offset",type:c.size,triggersBounds:u.any}],h=[{name:"target-label",type:c.text,triggersBounds:u.any},{name:"target-text-rotation",type:c.textRotation,triggersBounds:u.any},{name:"target-text-margin-x",type:c.bidirectionalSize,triggersBounds:u.any},{name:"target-text-margin-y",type:c.bidirectionalSize,triggersBounds:u.any},{name:"target-text-offset",type:c.size,triggersBounds:u.any}],v=[{name:"font-family",type:c.fontFamily,triggersBounds:u.any},{name:"font-style",type:c.fontStyle,triggersBounds:u.any},{name:"font-weight",type:c.fontWeight,triggersBounds:u.any},{name:"font-size",type:c.size,triggersBounds:u.any},{name:"text-transform",type:c.textTransform,triggersBounds:u.any},{name:"text-wrap",type:c.textWrap,triggersBounds:u.any},{name:"text-overflow-wrap",type:c.textOverflowWrap,triggersBounds:u.any},{name:"text-max-width",type:c.size,triggersBounds:u.any},{name:"text-outline-width",type:c.size,triggersBounds:u.any},{name:"line-height",type:c.positiveNumber,triggersBounds:u.any}],p=[{name:"text-valign",type:c.valign,triggersBounds:u.any},{name:"text-halign",type:c.halign,triggersBounds:u.any},{name:"color",type:c.color},{name:"text-outline-color",type:c.color},{name:"text-outline-opacity",type:c.zeroOneNumber},{name:"text-background-color",type:c.color},{name:"text-background-opacity",type:c.zeroOneNumber},{name:"text-background-padding",type:c.size,triggersBounds:u.any},{name:"text-border-opacity",type:c.zeroOneNumber},{name:"text-border-color",type:c.color},{name:"text-border-width",type:c.size,triggersBounds:u.any},{name:"text-border-style",type:c.borderStyle,triggersBounds:u.any},{name:"text-background-shape",type:c.textBackgroundShape,triggersBounds:u.any},{name:"text-justification",type:c.justification}],g=[{name:"events",type:c.bool,triggersZOrder:u.any},{name:"text-events",type:c.bool,triggersZOrder:u.any}],y=[{name:"display",type:c.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:c.visibility,triggersZOrder:u.any},{name:"opacity",type:c.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:c.zeroOneNumber},{name:"min-zoomed-font-size",type:c.size},{name:"z-compound-depth",type:c.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:c.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:c.number,triggersZOrder:u.any}],m=[{name:"overlay-padding",type:c.size,triggersBounds:u.any},{name:"overlay-color",type:c.color},{name:"overlay-opacity",type:c.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"overlay-shape",type:c.overlayShape,triggersBounds:u.any},{name:"overlay-corner-radius",type:c.cornerRadius}],b=[{name:"underlay-padding",type:c.size,triggersBounds:u.any},{name:"underlay-color",type:c.color},{name:"underlay-opacity",type:c.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"underlay-shape",type:c.overlayShape,triggersBounds:u.any},{name:"underlay-corner-radius",type:c.cornerRadius}],w=[{name:"transition-property",type:c.propList},{name:"transition-duration",type:c.time},{name:"transition-delay",type:c.time},{name:"transition-timing-function",type:c.easing}],C=function(A,K){return K.value==="label"?-A.poolIndex():K.pfValue},k=[{name:"height",type:c.nodeSize,triggersBounds:u.any,hashOverride:C},{name:"width",type:c.nodeSize,triggersBounds:u.any,hashOverride:C},{name:"shape",type:c.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:c.polygonPointList,triggersBounds:u.any},{name:"corner-radius",type:c.cornerRadius},{name:"background-color",type:c.color},{name:"background-fill",type:c.fill},{name:"background-opacity",type:c.zeroOneNumber},{name:"background-blacken",type:c.nOneOneNumber},{name:"background-gradient-stop-colors",type:c.colors},{name:"background-gradient-stop-positions",type:c.percentages},{name:"background-gradient-direction",type:c.gradientDirection},{name:"padding",type:c.sizeMaybePercent,triggersBounds:u.any},{name:"padding-relative-to",type:c.paddingRelativeTo,triggersBounds:u.any},{name:"bounds-expansion",type:c.boundsExpansion,triggersBounds:u.any}],E=[{name:"border-color",type:c.color},{name:"border-opacity",type:c.zeroOneNumber},{name:"border-width",type:c.size,triggersBounds:u.any},{name:"border-style",type:c.borderStyle},{name:"border-cap",type:c.lineCap},{name:"border-join",type:c.lineJoin},{name:"border-dash-pattern",type:c.numbers},{name:"border-dash-offset",type:c.number},{name:"border-position",type:c.linePosition}],x=[{name:"outline-color",type:c.color},{name:"outline-opacity",type:c.zeroOneNumber},{name:"outline-width",type:c.size,triggersBounds:u.any},{name:"outline-style",type:c.borderStyle},{name:"outline-offset",type:c.size,triggersBounds:u.any}],B=[{name:"background-image",type:c.urls},{name:"background-image-crossorigin",type:c.bgCrossOrigin},{name:"background-image-opacity",type:c.zeroOneNumbers},{name:"background-image-containment",type:c.bgContainment},{name:"background-image-smoothing",type:c.bools},{name:"background-position-x",type:c.bgPos},{name:"background-position-y",type:c.bgPos},{name:"background-width-relative-to",type:c.bgRelativeTo},{name:"background-height-relative-to",type:c.bgRelativeTo},{name:"background-repeat",type:c.bgRepeat},{name:"background-fit",type:c.bgFit},{name:"background-clip",type:c.bgClip},{name:"background-width",type:c.bgWH},{name:"background-height",type:c.bgWH},{name:"background-offset-x",type:c.bgPos},{name:"background-offset-y",type:c.bgPos}],S=[{name:"position",type:c.position,triggersBounds:u.any},{name:"compound-sizing-wrt-labels",type:c.compoundIncludeLabels,triggersBounds:u.any},{name:"min-width",type:c.size,triggersBounds:u.any},{name:"min-width-bias-left",type:c.sizeMaybePercent,triggersBounds:u.any},{name:"min-width-bias-right",type:c.sizeMaybePercent,triggersBounds:u.any},{name:"min-height",type:c.size,triggersBounds:u.any},{name:"min-height-bias-top",type:c.sizeMaybePercent,triggersBounds:u.any},{name:"min-height-bias-bottom",type:c.sizeMaybePercent,triggersBounds:u.any}],N=[{name:"line-style",type:c.lineStyle},{name:"line-color",type:c.color},{name:"line-fill",type:c.fill},{name:"line-cap",type:c.lineCap},{name:"line-opacity",type:c.zeroOneNumber},{name:"line-dash-pattern",type:c.numbers},{name:"line-dash-offset",type:c.number},{name:"line-outline-width",type:c.size},{name:"line-outline-color",type:c.color},{name:"line-gradient-stop-colors",type:c.colors},{name:"line-gradient-stop-positions",type:c.percentages},{name:"curve-style",type:c.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:c.zeroOneNumber,triggersBounds:u.any},{name:"source-endpoint",type:c.edgeEndpoint,triggersBounds:u.any},{name:"target-endpoint",type:c.edgeEndpoint,triggersBounds:u.any},{name:"control-point-step-size",type:c.size,triggersBounds:u.any},{name:"control-point-distances",type:c.bidirectionalSizes,triggersBounds:u.any},{name:"control-point-weights",type:c.numbers,triggersBounds:u.any},{name:"segment-distances",type:c.bidirectionalSizes,triggersBounds:u.any},{name:"segment-weights",type:c.numbers,triggersBounds:u.any},{name:"segment-radii",type:c.numbers,triggersBounds:u.any},{name:"radius-type",type:c.radiusType,triggersBounds:u.any},{name:"taxi-turn",type:c.bidirectionalSizeMaybePercent,triggersBounds:u.any},{name:"taxi-turn-min-distance",type:c.size,triggersBounds:u.any},{name:"taxi-direction",type:c.axisDirection,triggersBounds:u.any},{name:"taxi-radius",type:c.number,triggersBounds:u.any},{name:"edge-distances",type:c.edgeDistances,triggersBounds:u.any},{name:"arrow-scale",type:c.positiveNumber,triggersBounds:u.any},{name:"loop-direction",type:c.angle,triggersBounds:u.any},{name:"loop-sweep",type:c.angle,triggersBounds:u.any},{name:"source-distance-from-node",type:c.size,triggersBounds:u.any},{name:"target-distance-from-node",type:c.size,triggersBounds:u.any}],D=[{name:"ghost",type:c.bool,triggersBounds:u.any},{name:"ghost-offset-x",type:c.bidirectionalSize,triggersBounds:u.any},{name:"ghost-offset-y",type:c.bidirectionalSize,triggersBounds:u.any},{name:"ghost-opacity",type:c.zeroOneNumber}],_=[{name:"selection-box-color",type:c.color},{name:"selection-box-opacity",type:c.zeroOneNumber},{name:"selection-box-border-color",type:c.color},{name:"selection-box-border-width",type:c.size},{name:"active-bg-color",type:c.color},{name:"active-bg-opacity",type:c.zeroOneNumber},{name:"active-bg-size",type:c.size},{name:"outside-texture-bg-color",type:c.color},{name:"outside-texture-bg-opacity",type:c.zeroOneNumber}],I=[];xt.pieBackgroundN=16,I.push({name:"pie-size",type:c.sizeMaybePercent});for(var P=1;P<=xt.pieBackgroundN;P++)I.push({name:"pie-"+P+"-background-color",type:c.color}),I.push({name:"pie-"+P+"-background-size",type:c.percent}),I.push({name:"pie-"+P+"-background-opacity",type:c.zeroOneNumber});var F=[],O=xt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:c.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:c.color},{name:"arrow-fill",type:c.arrowFill},{name:"arrow-width",type:c.arrowWidth}].forEach(function(Y){O.forEach(function(A){var K=A+"-"+Y.name,W=Y.type,oe=Y.triggersBounds;F.push({name:K,type:W,triggersBounds:oe})})},{});var M=xt.properties=[].concat(g,w,y,m,b,D,p,v,d,f,h,k,E,x,B,I,S,N,F,_),L=xt.propertyGroups={behavior:g,transition:w,visibility:y,overlay:m,underlay:b,ghost:D,commonLabel:p,labelDimensions:v,mainLabel:d,sourceLabel:f,targetLabel:h,nodeBody:k,nodeBorder:E,nodeOutline:x,backgroundImage:B,pie:I,compound:S,edgeLine:N,edgeArrow:F,core:_},V=xt.propertyGroupNames={},H=xt.propertyGroupKeys=Object.keys(L);H.forEach(function(Y){V[Y]=L[Y].map(function(A){return A.name}),L[Y].forEach(function(A){return A.groupKey=Y})});var $=xt.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];xt.propertyNames=M.map(function(Y){return Y.name});for(var z=0;z<M.length;z++){var j=M[z];M[j.name]=j}for(var ee=0;ee<$.length;ee++){var J=$[ee],X=M[J.pointsTo],ne={name:J.name,alias:!0,pointsTo:X};M.push(ne),M[J.name]=ne}})(),xt.getDefaultProperty=function(t){return this.getDefaultProperties()[t]},xt.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=xe({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(u,c){for(var d=1;d<=xt.pieBackgroundN;d++){var f=c.name.replace("{{i}}",d),h=c.value;u[f]=h}return u},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(u,c){return xt.arrowPrefixes.forEach(function(d){var f=d+"-"+c.name,h=c.value;u[f]=h}),u},{})),n={},r=0;r<this.properties.length;r++){var a=this.properties[r];if(!a.pointsTo){var i=a.name,s=e[i],l=this.parse(i,s);n[i]=l}}return t.defaultProperties=n,t.defaultProperties},xt.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var ys={};ys.parse=function(t,e,n,r){var a=this;if(Ye(e))return a.parseImplWarn(t,e,n,r);var i=r==="mapping"||r===!0||r===!1||r==null?"dontcare":r,s=n?"t":"f",l=""+e,u=lh(t,l,s,i),c=a.propCache=a.propCache||[],d;return(d=c[u])||(d=c[u]=a.parseImplWarn(t,e,n,r)),(n||r==="mapping")&&(d=kn(d),d&&(d.value=kn(d.value))),d},ys.parseImplWarn=function(t,e,n,r){var a=this.parseImpl(t,e,n,r);return!a&&e!=null&&Ve("The style property `".concat(t,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&Ve("The style value of `label` is deprecated for `"+a.name+"`"),a},ys.parseImpl=function(t,e,n,r){var a=this;t=ql(t);var i=a.properties[t],s=e,l=a.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var u=be(e);u&&(e=e.trim());var c=i.type;if(!c)return null;if(n&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(Ye(e))return{name:t,value:e,strValue:"fn",mapped:l.fn,bypass:n};var d,f;if(!(!u||r||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(d=new RegExp(l.data.regex).exec(e))){if(n)return!1;var h=l.data;return{name:t,value:d,strValue:""+e,mapped:h,field:d[1],bypass:n}}else if(e.length>=10&&e[0]==="m"&&(f=new RegExp(l.mapData.regex).exec(e))){if(n||c.multiple)return!1;var v=l.mapData;if(!(c.color||c.number))return!1;var p=this.parse(t,f[4]);if(!p||p.mapped)return!1;var g=this.parse(t,f[5]);if(!g||g.mapped)return!1;if(p.pfValue===g.pfValue||p.strValue===g.strValue)return Ve("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+p.strValue+"`"),this.parse(t,p.strValue);if(c.color){var y=p.value,m=g.value,b=y[0]===m[0]&&y[1]===m[1]&&y[2]===m[2]&&(y[3]===m[3]||(y[3]==null||y[3]===1)&&(m[3]==null||m[3]===1));if(b)return!1}return{name:t,value:f,strValue:""+e,mapped:v,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:p.value,valueMax:g.value,bypass:n}}}if(c.multiple&&r!=="multiple"){var w;if(u?w=e.split(/\s+/):Ke(e)?w=e:w=[e],c.evenMultiple&&w.length%2!==0)return null;for(var C=[],k=[],E=[],x="",B=!1,S=0;S<w.length;S++){var N=a.parse(t,w[S],n,"multiple");B=B||be(N.value),C.push(N.value),E.push(N.pfValue!=null?N.pfValue:N.value),k.push(N.units),x+=(S>0?" ":"")+N.strValue}return c.validate&&!c.validate(C,k)?null:c.singleEnum&&B?C.length===1&&be(C[0])?{name:t,value:C[0],strValue:C[0],bypass:n}:null:{name:t,value:C,pfValue:E,strValue:x,bypass:n,units:k}}var D=function(){for(var A=0;A<c.enums.length;A++){var K=c.enums[A];if(K===e)return{name:t,value:e,strValue:""+e,bypass:n}}return null};if(c.number){var _,I="px";if(c.units&&(_=c.units),c.implicitUnits&&(I=c.implicitUnits),!c.unitless)if(u){var P="px|em"+(c.allowPercent?"|\\%":"");_&&(P=_);var F=e.match("^("+ct+")("+P+")?$");F&&(e=F[1],_=F[2]||I)}else(!_||c.implicitUnits)&&(_=I);if(e=parseFloat(e),isNaN(e)&&c.enums===void 0)return null;if(isNaN(e)&&c.enums!==void 0)return e=s,D();if(c.integer&&!QE(e)||c.min!==void 0&&(e<c.min||c.strictMin&&e===c.min)||c.max!==void 0&&(e>c.max||c.strictMax&&e===c.max))return null;var O={name:t,value:e,strValue:""+e+(_||""),units:_,bypass:n};return c.unitless||_!=="px"&&_!=="em"?O.pfValue=e:O.pfValue=_==="px"||!_?e:this.getEmSizeInPixels()*e,(_==="ms"||_==="s")&&(O.pfValue=_==="ms"?e:1e3*e),(_==="deg"||_==="rad")&&(O.pfValue=_==="rad"?e:OT(e)),_==="%"&&(O.pfValue=e/100),O}else if(c.propList){var M=[],L=""+e;if(L!=="none"){for(var V=L.split(/\s*,\s*|\s+/),H=0;H<V.length;H++){var $=V[H].trim();a.properties[$]?M.push($):Ve("`"+$+"` is not a valid property name")}if(M.length===0)return null}return{name:t,value:M,strValue:M.length===0?"none":M.join(" "),bypass:n}}else if(c.color){var z=vS(e);return z?{name:t,value:z,pfValue:z,strValue:"rgb("+z[0]+","+z[1]+","+z[2]+")",bypass:n}:null}else if(c.regex||c.regexes){if(c.enums){var j=D();if(j)return j}for(var ee=c.regexes?c.regexes:[c.regex],J=0;J<ee.length;J++){var X=new RegExp(ee[J]),ne=X.exec(e);if(ne)return{name:t,value:c.singleRegexMatchValue?ne[1]:ne,strValue:""+e,bypass:n}}return null}else return c.string?{name:t,value:""+e,strValue:""+e,bypass:n}:c.enums?D():null};var Nt=function t(e){if(!(this instanceof t))return new t(e);if(!Kl(e)){Ze("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Dt=Nt.prototype;Dt.instanceString=function(){return"style"},Dt.clear=function(){for(var t=this._private,e=t.cy,n=e.elements(),r=0;r<this.length;r++)this[r]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(n,!0),n.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this},Dt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},Dt.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)},Dt.selector=function(t){var e=t==="core"?null:new ur(t),n=this.length++;return this[n]={selector:e,properties:[],mappedProperties:[],index:n},this},Dt.css=function(){var t=this,e=arguments;if(e.length===1)for(var n=e[0],r=0;r<t.properties.length;r++){var a=t.properties[r],i=n[a.name];i===void 0&&(i=n[Mo(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this},Dt.style=Dt.css,Dt.cssRule=function(t,e){var n=this.parse(t,e);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[r].mappedProperties.push(n);var a=!this[r].selector;a&&(this._private.coreStyle[n.name]=n)}return this},Dt.append=function(t){return jf(t)?t.appendToStyle(this):Ke(t)?this.appendFromJson(t):be(t)&&this.appendFromString(t),this},Nt.fromJson=function(t,e){var n=new Nt(t);return n.fromJson(e),n},Nt.fromString=function(t,e){return new Nt(t).fromString(e)},[Bt,zi,Cc,En,ms,kc,xt,ys].forEach(function(t){xe(Dt,t)}),Nt.types=Dt.types,Nt.properties=Dt.properties,Nt.propertyGroups=Dt.propertyGroups,Nt.propertyGroupNames=Dt.propertyGroupNames,Nt.propertyGroupKeys=Dt.propertyGroupKeys;var QD={style:function(e){if(e){var n=this.setStyle(e);n.update()}return this._private.style},setStyle:function(e){var n=this._private;return jf(e)?n.style=e.generateStyle(this):Ke(e)?n.style=Nt.fromJson(this,e):be(e)?n.style=Nt.fromString(this,e):n.style=Nt(this),n.style},updateStyle:function(){this.mutableElements().updateStyle()}},JD="single",Hr={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var n=this._private;if(n.selectionType==null&&(n.selectionType=JD),e!==void 0)(e==="additive"||e==="single")&&(n.selectionType=e);else return n.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,n=this._private.pan,r,a,i,s,l;switch(e.length){case 0:return n;case 1:if(be(e[0]))return r=e[0],n[r];if(Oe(e[0])){if(!this._private.panningEnabled)return this;i=e[0],s=i.x,l=i.y,le(s)&&(n.x=s),le(l)&&(n.y=l),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;r=e[0],a=e[1],(r==="x"||r==="y")&&le(a)&&(n[r]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,n){var r=arguments,a=this._private.pan,i,s,l,u,c;if(!this._private.panningEnabled)return this;switch(r.length){case 1:Oe(e)&&(l=r[0],u=l.x,c=l.y,le(u)&&(a.x+=u),le(c)&&(a.y+=c),this.emit("pan viewport"));break;case 2:i=e,s=n,(i==="x"||i==="y")&&le(s)&&(a[i]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,n){var r=this.getFitViewport(e,n);if(r){var a=this._private;a.zoom=r.zoom,a.pan=r.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,n){if(le(e)&&n===void 0&&(n=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var r;if(be(e)){var a=e;e=this.$(a)}else if(tS(e)){var i=e;r={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},r.w=r.x2-r.x1,r.h=r.y2-r.y1}else Ut(e)||(e=this.mutableElements());if(!(Ut(e)&&e.empty())){r=r||e.boundingBox();var s=this.width(),l=this.height(),u;if(n=le(n)?n:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0){u=Math.min((s-2*n)/r.w,(l-2*n)/r.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u<this._private.minZoom?this._private.minZoom:u;var c={x:(s-u*(r.x1+r.x2))/2,y:(l-u*(r.y1+r.y2))/2};return{zoom:u,pan:c}}}}},zoomRange:function(e,n){var r=this._private;if(n==null){var a=e;e=a.min,n=a.max}return le(e)&&le(n)&&e<=n?(r.minZoom=e,r.maxZoom=n):le(e)&&n===void 0&&e<=r.maxZoom?r.minZoom=e:le(n)&&e===void 0&&n>=r.minZoom&&(r.maxZoom=n),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var n=this._private,r=n.pan,a=n.zoom,i,s,l=!1;if(n.zoomingEnabled||(l=!0),le(e)?s=e:Oe(e)&&(s=e.level,e.position!=null?i=Ho(e.position,a,r):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!n.panningEnabled&&(l=!0)),s=s>n.maxZoom?n.maxZoom:s,s=s<n.minZoom?n.minZoom:s,l||!le(s)||s===a||i!=null&&(!le(i.x)||!le(i.y)))return null;if(i!=null){var u=r,c=a,d=s,f={x:-d/c*(i.x-u.x)+i.x,y:-d/c*(i.y-u.y)+i.y};return{zoomed:!0,panned:!0,zoom:d,pan:f}}else return{zoomed:!0,panned:!1,zoom:s,pan:r}},zoom:function(e){if(e===void 0)return this._private.zoom;var n=this.getZoomedViewport(e),r=this._private;return n==null||!n.zoomed?this:(r.zoom=n.zoom,n.panned&&(r.pan.x=n.pan.x,r.pan.y=n.pan.y),this.emit("zoom"+(n.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var n=this._private,r=!0,a=!0,i=[],s=!1,l=!1;if(!e)return this;if(le(e.zoom)||(r=!1),Oe(e.pan)||(a=!1),!r&&!a)return this;if(r){var u=e.zoom;u<n.minZoom||u>n.maxZoom||!n.zoomingEnabled?s=!0:(n.zoom=u,i.push("zoom"))}if(a&&(!s||!e.cancelOnFailedZoom)&&n.panningEnabled){var c=e.pan;le(c.x)&&(n.pan.x=c.x,l=!1),le(c.y)&&(n.pan.y=c.y,l=!1),l||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var n=this.getCenterPan(e);return n&&(this._private.pan=n,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,n){if(this._private.panningEnabled){if(be(e)){var r=e;e=this.mutableElements().filter(r)}else Ut(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),s=this.height();n=n===void 0?this._private.zoom:n;var l={x:(i-n*(a.x1+a.x2))/2,y:(s-n*(a.y1+a.y2))/2};return l}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,n=e.container,r=this;return e.sizeCache=e.sizeCache||(n?function(){var a=r.window().getComputedStyle(n),i=function(l){return parseFloat(a.getPropertyValue(l))};return{width:n.clientWidth-i("padding-left")-i("padding-right"),height:n.clientHeight-i("padding-top")-i("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,n=this._private.zoom,r=this.renderedExtent(),a={x1:(r.x1-e.x)/n,x2:(r.x2-e.x)/n,y1:(r.y1-e.y)/n,y2:(r.y2-e.y)/n};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),n=this.height();return{x1:0,y1:0,x2:e,y2:n,w:e,h:n}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Hr.centre=Hr.center,Hr.autolockNodes=Hr.autolock,Hr.autoungrabifyNodes=Hr.autoungrabify;var Hi={data:Re.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Re.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Re.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Re.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Hi.attr=Hi.data,Hi.removeAttr=Hi.removeData;var Ki=function(e){var n=this;e=xe({},e);var r=e.container;r&&!Lo(r)&&Lo(r[0])&&(r=r[0]);var a=r?r._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];r&&(r._cyreg=a),a.cy=n;var s=lt!==void 0&&r!==void 0&&!e.headless,l=e;l.layout=xe({name:s?"grid":"null"},l.layout),l.renderer=xe({name:s?"canvas":"null"},l.renderer);var u=function(p,g,y){return g!==void 0?g:y!==void 0?y:p},c=this._private={container:r,ready:!1,options:l,elements:new kt(this),listeners:[],aniEles:new kt(this),data:l.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,l.zoomingEnabled),userZoomingEnabled:u(!0,l.userZoomingEnabled),panningEnabled:u(!0,l.panningEnabled),userPanningEnabled:u(!0,l.userPanningEnabled),boxSelectionEnabled:u(!0,l.boxSelectionEnabled),autolock:u(!1,l.autolock,l.autolockNodes),autoungrabify:u(!1,l.autoungrabify,l.autoungrabifyNodes),autounselectify:u(!1,l.autounselectify),styleEnabled:l.styleEnabled===void 0?s:l.styleEnabled,zoom:le(l.zoom)?l.zoom:1,pan:{x:Oe(l.pan)&&le(l.pan.x)?l.pan.x:0,y:Oe(l.pan)&&le(l.pan.y)?l.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,l.multiClickDebounceTime)};this.createEmitter(),this.selectionType(l.selectionType),this.zoomRange({min:l.minZoom,max:l.maxZoom});var d=function(p,g){var y=p.some(nS);if(y)return xa.all(p).then(g);g(p)};c.styleEnabled&&n.setStyle([]);var f=xe({},l,l.renderer);n.initRenderer(f);var h=function(p,g,y){n.notifications(!1);var m=n.mutableElements();m.length>0&&m.remove(),p!=null&&(Oe(p)||Ke(p))&&n.add(p),n.one("layoutready",function(w){n.notifications(!0),n.emit(w),n.one("load",g),n.emitAndNotify("load")}).one("layoutstop",function(){n.one("done",y),n.emit("done")});var b=xe({},n._private.options.layout);b.eles=n.elements(),n.layout(b).run()};d([l.style,l.elements],function(v){var p=v[0],g=v[1];c.styleEnabled&&n.style().append(p),h(g,function(){n.startAnimationLoop(),c.ready=!0,Ye(l.ready)&&n.on("ready",l.ready);for(var y=0;y<i.length;y++){var m=i[y];n.on("ready",m)}a&&(a.readies=[]),n.emit("ready")},l.done)})},bs=Ki.prototype;xe(bs,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return lt;var n=this._private.container.ownerDocument;return n===void 0||n==null?lt:n.defaultView||lt},mount:function(e){if(e!=null){var n=this,r=n._private,a=r.options;return!Lo(e)&&Lo(e[0])&&(e=e[0]),n.stopAnimationLoop(),n.destroyRenderer(),r.container=e,r.styleEnabled=!0,n.invalidateSize(),n.initRenderer(xe({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),n.startAnimationLoop(),n.style(a.style),n.emit("mount"),n}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return kn(this._private.options)},json:function(e){var n=this,r=n._private,a=n.mutableElements(),i=function(C){return n.getElementById(C.id())};if(Oe(e)){if(n.startBatch(),e.elements){var s={},l=function(C,k){for(var E=[],x=[],B=0;B<C.length;B++){var S=C[B];if(!S.data.id){Ve("cy.json() cannot handle elements without an ID attribute");continue}var N=""+S.data.id,D=n.getElementById(N);s[N]=!0,D.length!==0?x.push({ele:D,json:S}):(k&&(S.group=k),E.push(S))}n.add(E);for(var _=0;_<x.length;_++){var I=x[_],P=I.ele,F=I.json;P.json(F)}};if(Ke(e.elements))l(e.elements);else for(var u=["nodes","edges"],c=0;c<u.length;c++){var d=u[c],f=e.elements[d];Ke(f)&&l(f,d)}var h=n.collection();a.filter(function(w){return!s[w.id()]}).forEach(function(w){w.isParent()?h.merge(w):w.remove()}),h.forEach(function(w){return w.children().move({parent:null})}),h.forEach(function(w){return i(w).remove()})}e.style&&n.style(e.style),e.zoom!=null&&e.zoom!==r.zoom&&n.zoom(e.zoom),e.pan&&(e.pan.x!==r.pan.x||e.pan.y!==r.pan.y)&&n.pan(e.pan),e.data&&n.data(e.data);for(var v=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],p=0;p<v.length;p++){var g=v[p];e[g]!=null&&n[g](e[g])}return n.endBatch(),this}else{var y=!!e,m={};y?m.elements=this.elements().map(function(w){return w.json()}):(m.elements={},a.forEach(function(w){var C=w.group();m.elements[C]||(m.elements[C]=[]),m.elements[C].push(w.json())})),this._private.styleEnabled&&(m.style=n.style().json()),m.data=kn(n.data());var b=r.options;return m.zoomingEnabled=r.zoomingEnabled,m.userZoomingEnabled=r.userZoomingEnabled,m.zoom=r.zoom,m.minZoom=r.minZoom,m.maxZoom=r.maxZoom,m.panningEnabled=r.panningEnabled,m.userPanningEnabled=r.userPanningEnabled,m.pan=kn(r.pan),m.boxSelectionEnabled=r.boxSelectionEnabled,m.renderer=kn(b.renderer),m.hideEdgesOnViewport=b.hideEdgesOnViewport,m.textureOnViewport=b.textureOnViewport,m.wheelSensitivity=b.wheelSensitivity,m.motionBlur=b.motionBlur,m.multiClickDebounceTime=b.multiClickDebounceTime,m}}}),bs.$id=bs.getElementById,[HD,WD,$p,bc,vs,YD,wc,gs,QD,Hr,Hi].forEach(function(t){xe(bs,t)});var e4={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}},t4={maximal:!1,acyclic:!1},La=function(e){return e.scratch("breadthfirst")},zp=function(e,n){return e.scratch("breadthfirst",n)};function Hp(t){this.options=xe({},e4,t4,t)}Hp.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,a=r.nodes().filter(function(re){return!re.isParent()}),i=r,s=e.directed,l=e.acyclic||e.maximal||e.maximalAdjustments>0,u=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),c;if(Ut(e.roots))c=e.roots;else if(Ke(e.roots)){for(var d=[],f=0;f<e.roots.length;f++){var h=e.roots[f],v=n.getElementById(h);d.push(v)}c=n.collection(d)}else if(be(e.roots))c=n.$(e.roots);else if(s)c=a.roots();else{var p=r.components();c=n.collection();for(var g=function(se){var ue=p[se],pe=ue.maxDegree(!1),de=ue.filter(function(me){return me.degree(!1)===pe});c=c.add(de)},y=0;y<p.length;y++)g(y)}var m=[],b={},w=function(se,ue){m[ue]==null&&(m[ue]=[]);var pe=m[ue].length;m[ue].push(se),zp(se,{index:pe,depth:ue})},C=function(se,ue){var pe=La(se),de=pe.depth,me=pe.index;m[de][me]=null,w(se,ue)};i.bfs({roots:c,directed:e.directed,visit:function(se,ue,pe,de,me){var Ne=se[0],De=Ne.id();w(Ne,me),b[De]=!0}});for(var k=[],E=0;E<a.length;E++){var x=a[E];b[x.id()]||k.push(x)}var B=function(se){for(var ue=m[se],pe=0;pe<ue.length;pe++){var de=ue[pe];if(de==null){ue.splice(pe,1),pe--;continue}zp(de,{depth:se,index:pe})}},S=function(){for(var se=0;se<m.length;se++)B(se)},N=function(se,ue){for(var pe=La(se),de=se.incomers().filter(function(T){return T.isNode()&&r.has(T)}),me=-1,Ne=se.id(),De=0;De<de.length;De++){var Ee=de[De],_e=La(Ee);me=Math.max(me,_e.depth)}if(pe.depth<=me){if(!e.acyclic&&ue[Ne])return null;var te=me+1;return C(se,te),ue[Ne]=te,!0}return!1};if(s&&l){var D=[],_={},I=function(se){return D.push(se)},P=function(){return D.shift()};for(a.forEach(function(re){return D.push(re)});D.length>0;){var F=P(),O=N(F,_);if(O)F.outgoers().filter(function(re){return re.isNode()&&r.has(re)}).forEach(I);else if(O===null){Ve("Detected double maximal shift for node `"+F.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}S();var M=0;if(e.avoidOverlap)for(var L=0;L<a.length;L++){var V=a[L],H=V.layoutDimensions(e),$=H.w,z=H.h;M=Math.max(M,$,z)}var j={},ee=function(se){if(j[se.id()])return j[se.id()];for(var ue=La(se).depth,pe=se.neighborhood(),de=0,me=0,Ne=0;Ne<pe.length;Ne++){var De=pe[Ne];if(!(De.isEdge()||De.isParent()||!a.has(De))){var Ee=La(De);if(Ee!=null){var _e=Ee.index,te=Ee.depth;if(!(_e==null||te==null)){var T=m[te].length;te<ue&&(de+=_e/T,me++)}}}}return me=Math.max(1,me),de=de/me,me===0&&(de=0),j[se.id()]=de,de},J=function(se,ue){var pe=ee(se),de=ee(ue),me=pe-de;return me===0?Xf(se.id(),ue.id()):me};e.depthSort!==void 0&&(J=e.depthSort);for(var X=0;X<m.length;X++)m[X].sort(J),B(X);for(var ne=[],Y=0;Y<k.length;Y++)ne.push(k[Y]);m.unshift(ne),S();for(var A=0,K=0;K<m.length;K++)A=Math.max(m[K].length,A);var W={x:u.x1+u.w/2,y:u.x1+u.h/2},oe=m.reduce(function(re,se){return Math.max(re,se.length)},0),he=function(se){var ue=La(se),pe=ue.depth,de=ue.index,me=m[pe].length,Ne=Math.max(u.w/((e.grid?oe:me)+1),M),De=Math.max(u.h/(m.length+1),M),Ee=Math.min(u.w/2/m.length,u.h/2/m.length);if(Ee=Math.max(Ee,M),e.circle){var te=Ee*pe+Ee-(m.length>0&&m[0].length<=3?Ee/2:0),T=2*Math.PI/m[pe].length*de;return pe===0&&m[0].length===1&&(te=1),{x:W.x+te*Math.cos(T),y:W.y+te*Math.sin(T)}}else{var _e={x:W.x+(de+1-(me+1)/2)*Ne,y:(pe+1)*De};return _e}};return r.nodes().layoutPositions(this,e,he),this};var n4={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function Kp(t){this.options=xe({},n4,t)}Kp.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=r.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var s=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,c=u/Math.max(1,i.length-1),d,f=0,h=0;h<i.length;h++){var v=i[h],p=v.layoutDimensions(e),g=p.w,y=p.h;f=Math.max(f,g,y)}if(le(e.radius)?d=e.radius:i.length<=1?d=0:d=Math.min(s.h,s.w)/2-f,i.length>1&&e.avoidOverlap){f*=1.75;var m=Math.cos(c)-Math.cos(0),b=Math.sin(c)-Math.sin(0),w=Math.sqrt(f*f/(m*m+b*b));d=Math.max(w,d)}var C=function(E,x){var B=e.startAngle+x*c*(a?1:-1),S=d*Math.cos(B),N=d*Math.sin(B),D={x:l.x+S,y:l.y+N};return D};return r.nodes().layoutPositions(this,e,C),this};var r4={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function qp(t){this.options=xe({},r4,t)}qp.prototype.run=function(){for(var t=this.options,e=t,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,r=t.cy,a=e.eles,i=a.nodes().not(":parent"),s=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},u=[],c=0,d=0;d<i.length;d++){var f=i[d],h=void 0;h=e.concentric(f),u.push({value:h,node:f}),f._private.scratch.concentric=h}i.updateStyle();for(var v=0;v<i.length;v++){var p=i[v],g=p.layoutDimensions(e);c=Math.max(c,g.w,g.h)}u.sort(function(re,se){return se.value-re.value});for(var y=e.levelWidth(i),m=[[]],b=m[0],w=0;w<u.length;w++){var C=u[w];if(b.length>0){var k=Math.abs(b[0].value-C.value);k>=y&&(b=[],m.push(b))}b.push(C)}var E=c+e.minNodeSpacing;if(!e.avoidOverlap){var x=m.length>0&&m[0].length>1,B=Math.min(s.w,s.h)/2-E,S=B/(m.length+x?1:0);E=Math.min(E,S)}for(var N=0,D=0;D<m.length;D++){var _=m[D],I=e.sweep===void 0?2*Math.PI-2*Math.PI/_.length:e.sweep,P=_.dTheta=I/Math.max(1,_.length-1);if(_.length>1&&e.avoidOverlap){var F=Math.cos(P)-Math.cos(0),O=Math.sin(P)-Math.sin(0),M=Math.sqrt(E*E/(F*F+O*O));N=Math.max(M,N)}_.r=N,N+=E}if(e.equidistant){for(var L=0,V=0,H=0;H<m.length;H++){var $=m[H],z=$.r-V;L=Math.max(L,z)}V=0;for(var j=0;j<m.length;j++){var ee=m[j];j===0&&(V=ee.r),ee.r=V,V+=L}}for(var J={},X=0;X<m.length;X++)for(var ne=m[X],Y=ne.dTheta,A=ne.r,K=0;K<ne.length;K++){var W=ne[K],oe=e.startAngle+(n?1:-1)*Y*K,he={x:l.x+A*Math.cos(oe),y:l.y+A*Math.sin(oe)};J[W.node.id()]=he}return a.nodes().layoutPositions(this,e,function(re){var se=re.id();return J[se]}),this};var xc,a4={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,n){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function ws(t){this.options=xe({},a4,t),this.options.layout=this;var e=this.options.eles.nodes(),n=this.options.eles.edges(),r=n.filter(function(a){var i=a.source().data("id"),s=a.target().data("id"),l=e.some(function(c){return c.data("id")===i}),u=e.some(function(c){return c.data("id")===s});return!l||!u});this.options.eles=this.options.eles.not(r)}ws.prototype.run=function(){var t=this.options,e=t.cy,n=this;n.stopped=!1,(t.animate===!0||t.animate===!1)&&n.emit({type:"layoutstart",layout:n}),t.debug===!0?xc=!0:xc=!1;var r=i4(e,n,t);xc&&l4(r),t.randomize&&c4(r);var a=Rn(),i=function(){u4(r,e,t),t.fit===!0&&e.fit(t.padding)},s=function(h){return!(n.stopped||h>=t.numIter||(d4(r,t),r.temperature=r.temperature*t.coolingFactor,r.temperature<t.minTemp))},l=function(){if(t.animate===!0||t.animate===!1)i(),n.one("layoutstop",t.stop),n.emit({type:"layoutstop",layout:n});else{var h=t.eles.nodes(),v=Up(r,t,h);h.layoutPositions(n,t,v)}},u=0,c=!0;if(t.animate===!0){var d=function f(){for(var h=0;c&&h<t.refresh;)c=s(u),u++,h++;if(!c)Wp(r,t),l();else{var v=Rn();v-a>=t.animationThreshold&&i(),Vo(f)}};d()}else{for(;c;)c=s(u),u++;Wp(r,t),l()}return this},ws.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},ws.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var i4=function(e,n,r){for(var a=r.eles.edges(),i=r.eles.nodes(),s=zt(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),l={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:r.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},u=r.eles.components(),c={},d=0;d<u.length;d++)for(var f=u[d],h=0;h<f.length;h++){var v=f[h];c[v.id()]=d}for(var d=0;d<l.nodeSize;d++){var p=i[d],g=p.layoutDimensions(r),y={};y.isLocked=p.locked(),y.id=p.data("id"),y.parentId=p.data("parent"),y.cmptId=c[p.id()],y.children=[],y.positionX=p.position("x"),y.positionY=p.position("y"),y.offsetX=0,y.offsetY=0,y.height=g.w,y.width=g.h,y.maxX=y.positionX+y.width/2,y.minX=y.positionX-y.width/2,y.maxY=y.positionY+y.height/2,y.minY=y.positionY-y.height/2,y.padLeft=parseFloat(p.style("padding")),y.padRight=parseFloat(p.style("padding")),y.padTop=parseFloat(p.style("padding")),y.padBottom=parseFloat(p.style("padding")),y.nodeRepulsion=Ye(r.nodeRepulsion)?r.nodeRepulsion(p):r.nodeRepulsion,l.layoutNodes.push(y),l.idToIndex[y.id]=d}for(var m=[],b=0,w=-1,C=[],d=0;d<l.nodeSize;d++){var p=l.layoutNodes[d],k=p.parentId;k!=null?l.layoutNodes[l.idToIndex[k]].children.push(p.id):(m[++w]=p.id,C.push(p.id))}for(l.graphSet.push(C);b<=w;){var E=m[b++],x=l.idToIndex[E],v=l.layoutNodes[x],B=v.children;if(B.length>0){l.graphSet.push(B);for(var d=0;d<B.length;d++)m[++w]=B[d]}}for(var d=0;d<l.graphSet.length;d++)for(var S=l.graphSet[d],h=0;h<S.length;h++){var N=l.idToIndex[S[h]];l.indexToGraph[N]=d}for(var d=0;d<l.edgeSize;d++){var D=a[d],_={};_.id=D.data("id"),_.sourceId=D.data("source"),_.targetId=D.data("target");var I=Ye(r.idealEdgeLength)?r.idealEdgeLength(D):r.idealEdgeLength,P=Ye(r.edgeElasticity)?r.edgeElasticity(D):r.edgeElasticity,F=l.idToIndex[_.sourceId],O=l.idToIndex[_.targetId],M=l.indexToGraph[F],L=l.indexToGraph[O];if(M!=L){for(var V=o4(_.sourceId,_.targetId,l),H=l.graphSet[V],$=0,y=l.layoutNodes[F];H.indexOf(y.id)===-1;)y=l.layoutNodes[l.idToIndex[y.parentId]],$++;for(y=l.layoutNodes[O];H.indexOf(y.id)===-1;)y=l.layoutNodes[l.idToIndex[y.parentId]],$++;I*=$*r.nestingFactor}_.idealLength=I,_.elasticity=P,l.layoutEdges.push(_)}return l},o4=function(e,n,r){var a=s4(e,n,0,r);return 2>a.count?0:a.graph},s4=function t(e,n,r,a){var i=a.graphSet[r];if(-1<i.indexOf(e)&&-1<i.indexOf(n))return{count:2,graph:r};for(var s=0,l=0;l<i.length;l++){var u=i[l],c=a.idToIndex[u],d=a.layoutNodes[c].children;if(d.length!==0){var f=a.indexToGraph[a.idToIndex[d[0]]],h=t(e,n,f,a);if(h.count!==0)if(h.count===1){if(s++,s===2)break}else return h}}return{count:s,graph:r}},l4,c4=function(e,n){for(var r=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var s=e.layoutNodes[i];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*r,s.positionY=Math.random()*a)}},Up=function(e,n,r){var a=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return n.boundingBox&&(r.forEach(function(s){var l=e.layoutNodes[e.idToIndex[s.data("id")]];i.x1=Math.min(i.x1,l.positionX),i.x2=Math.max(i.x2,l.positionX),i.y1=Math.min(i.y1,l.positionY),i.y2=Math.max(i.y2,l.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(s,l){var u=e.layoutNodes[e.idToIndex[s.data("id")]];if(n.boundingBox){var c=(u.positionX-i.x1)/i.w,d=(u.positionY-i.y1)/i.h;return{x:a.x1+c*a.w,y:a.y1+d*a.h}}else return{x:u.positionX,y:u.positionY}}},u4=function(e,n,r){var a=r.layout,i=r.eles.nodes(),s=Up(e,r,i);i.positions(s),e.ready!==!0&&(e.ready=!0,a.one("layoutready",r.ready),a.emit({type:"layoutready",layout:this}))},d4=function(e,n,r){f4(e,n),v4(e),g4(e,n),m4(e),y4(e)},f4=function(e,n){for(var r=0;r<e.graphSet.length;r++)for(var a=e.graphSet[r],i=a.length,s=0;s<i;s++)for(var l=e.layoutNodes[e.idToIndex[a[s]]],u=s+1;u<i;u++){var c=e.layoutNodes[e.idToIndex[a[u]]];h4(l,c,e,n)}},Gp=function(e){return-e+2*e*Math.random()},h4=function(e,n,r,a){var i=e.cmptId,s=n.cmptId;if(!(i!==s&&!r.isCompound)){var l=n.positionX-e.positionX,u=n.positionY-e.positionY,c=1;l===0&&u===0&&(l=Gp(c),u=Gp(c));var d=p4(e,n,l,u);if(d>0)var f=a.nodeOverlap*d,h=Math.sqrt(l*l+u*u),v=f*l/h,p=f*u/h;else var g=Cs(e,l,u),y=Cs(n,-1*l,-1*u),m=y.x-g.x,b=y.y-g.y,w=m*m+b*b,h=Math.sqrt(w),f=(e.nodeRepulsion+n.nodeRepulsion)/w,v=f*m/h,p=f*b/h;e.isLocked||(e.offsetX-=v,e.offsetY-=p),n.isLocked||(n.offsetX+=v,n.offsetY+=p)}},p4=function(e,n,r,a){if(r>0)var i=e.maxX-n.minX;else var i=n.maxX-e.minX;if(a>0)var s=e.maxY-n.minY;else var s=n.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},Cs=function(e,n,r){var a=e.positionX,i=e.positionY,s=e.height||1,l=e.width||1,u=r/n,c=s/l,d={};return n===0&&0<r||n===0&&0>r?(d.x=a,d.y=i+s/2,d):0<n&&-1*c<=u&&u<=c?(d.x=a+l/2,d.y=i+l*r/2/n,d):0>n&&-1*c<=u&&u<=c?(d.x=a-l/2,d.y=i-l*r/2/n,d):0<r&&(u<=-1*c||u>=c)?(d.x=a+s*n/2/r,d.y=i+s/2,d):(0>r&&(u<=-1*c||u>=c)&&(d.x=a-s*n/2/r,d.y=i-s/2),d)},v4=function(e,n){for(var r=0;r<e.edgeSize;r++){var a=e.layoutEdges[r],i=e.idToIndex[a.sourceId],s=e.layoutNodes[i],l=e.idToIndex[a.targetId],u=e.layoutNodes[l],c=u.positionX-s.positionX,d=u.positionY-s.positionY;if(!(c===0&&d===0)){var f=Cs(s,c,d),h=Cs(u,-1*c,-1*d),v=h.x-f.x,p=h.y-f.y,g=Math.sqrt(v*v+p*p),y=Math.pow(a.idealLength-g,2)/a.elasticity;if(g!==0)var m=y*v/g,b=y*p/g;else var m=0,b=0;s.isLocked||(s.offsetX+=m,s.offsetY+=b),u.isLocked||(u.offsetX-=m,u.offsetY-=b)}}},g4=function(e,n){if(n.gravity!==0)for(var r=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],s=i.length;if(a===0)var l=e.clientHeight/2,u=e.clientWidth/2;else var c=e.layoutNodes[e.idToIndex[i[0]]],d=e.layoutNodes[e.idToIndex[c.parentId]],l=d.positionX,u=d.positionY;for(var f=0;f<s;f++){var h=e.layoutNodes[e.idToIndex[i[f]]];if(!h.isLocked){var v=l-h.positionX,p=u-h.positionY,g=Math.sqrt(v*v+p*p);if(g>r){var y=n.gravity*v/g,m=n.gravity*p/g;h.offsetX+=y,h.offsetY+=m}}}}},m4=function(e,n){var r=[],a=0,i=-1;for(r.push.apply(r,e.graphSet[0]),i+=e.graphSet[0].length;a<=i;){var s=r[a++],l=e.idToIndex[s],u=e.layoutNodes[l],c=u.children;if(0<c.length&&!u.isLocked){for(var d=u.offsetX,f=u.offsetY,h=0;h<c.length;h++){var v=e.layoutNodes[e.idToIndex[c[h]]];v.offsetX+=d,v.offsetY+=f,r[++i]=c[h]}u.offsetX=0,u.offsetY=0}}},y4=function(e,n){for(var r=0;r<e.nodeSize;r++){var a=e.layoutNodes[r];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var r=0;r<e.nodeSize;r++){var a=e.layoutNodes[r];if(!(0<a.children.length||a.isLocked)){var i=b4(a.offsetX,a.offsetY,e.temperature);a.positionX+=i.x,a.positionY+=i.y,a.offsetX=0,a.offsetY=0,a.minX=a.positionX-a.width,a.maxX=a.positionX+a.width,a.minY=a.positionY-a.height,a.maxY=a.positionY+a.height,w4(a,e)}}for(var r=0;r<e.nodeSize;r++){var a=e.layoutNodes[r];0<a.children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},b4=function(e,n,r){var a=Math.sqrt(e*e+n*n);if(a>r)var i={x:r*e/a,y:r*n/a};else var i={x:e,y:n};return i},w4=function t(e,n){var r=e.parentId;if(r!=null){var a=n.layoutNodes[n.idToIndex[r]],i=!1;if((a.maxX==null||e.maxX+a.padRight>a.maxX)&&(a.maxX=e.maxX+a.padRight,i=!0),(a.minX==null||e.minX-a.padLeft<a.minX)&&(a.minX=e.minX-a.padLeft,i=!0),(a.maxY==null||e.maxY+a.padBottom>a.maxY)&&(a.maxY=e.maxY+a.padBottom,i=!0),(a.minY==null||e.minY-a.padTop<a.minY)&&(a.minY=e.minY-a.padTop,i=!0),i)return t(a,n)}},Wp=function(e,n){for(var r=e.layoutNodes,a=[],i=0;i<r.length;i++){var s=r[i],l=s.cmptId,u=a[l]=a[l]||[];u.push(s)}for(var c=0,i=0;i<a.length;i++){var d=a[i];if(d){d.x1=1/0,d.x2=-1/0,d.y1=1/0,d.y2=-1/0;for(var f=0;f<d.length;f++){var h=d[f];d.x1=Math.min(d.x1,h.positionX-h.width/2),d.x2=Math.max(d.x2,h.positionX+h.width/2),d.y1=Math.min(d.y1,h.positionY-h.height/2),d.y2=Math.max(d.y2,h.positionY+h.height/2)}d.w=d.x2-d.x1,d.h=d.y2-d.y1,c+=d.w*d.h}}a.sort(function(b,w){return w.w*w.h-b.w*b.h});for(var v=0,p=0,g=0,y=0,m=Math.sqrt(c)*e.clientWidth/e.clientHeight,i=0;i<a.length;i++){var d=a[i];if(d){for(var f=0;f<d.length;f++){var h=d[f];h.isLocked||(h.positionX+=v-d.x1,h.positionY+=p-d.y1)}v+=d.w+n.componentSpacing,g+=d.w+n.componentSpacing,y=Math.max(y,d.h),g>m&&(p+=y+n.componentSpacing,v=0,g=0,y=0)}}},C4={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function jp(t){this.options=xe({},C4,t)}jp.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,a=r.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var i=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(i.h===0||i.w===0)r.nodes().layoutPositions(this,e,function(j){return{x:i.x1,y:i.y1}});else{var s=a.size(),l=Math.sqrt(s*i.h/i.w),u=Math.round(l),c=Math.round(i.w/i.h*l),d=function(ee){if(ee==null)return Math.min(u,c);var J=Math.min(u,c);J==u?u=ee:c=ee},f=function(ee){if(ee==null)return Math.max(u,c);var J=Math.max(u,c);J==u?u=ee:c=ee},h=e.rows,v=e.cols!=null?e.cols:e.columns;if(h!=null&&v!=null)u=h,c=v;else if(h!=null&&v==null)u=h,c=Math.ceil(s/u);else if(h==null&&v!=null)c=v,u=Math.ceil(s/c);else if(c*u>s){var p=d(),g=f();(p-1)*g>=s?d(p-1):(g-1)*p>=s&&f(g-1)}else for(;c*u<s;){var y=d(),m=f();(m+1)*y>=s?f(m+1):d(y+1)}var b=i.w/c,w=i.h/u;if(e.condense&&(b=0,w=0),e.avoidOverlap)for(var C=0;C<a.length;C++){var k=a[C],E=k._private.position;(E.x==null||E.y==null)&&(E.x=0,E.y=0);var x=k.layoutDimensions(e),B=e.avoidOverlapPadding,S=x.w+B,N=x.h+B;b=Math.max(b,S),w=Math.max(w,N)}for(var D={},_=function(ee,J){return!!D["c-"+ee+"-"+J]},I=function(ee,J){D["c-"+ee+"-"+J]=!0},P=0,F=0,O=function(){F++,F>=c&&(F=0,P++)},M={},L=0;L<a.length;L++){var V=a[L],H=e.position(V);if(H&&(H.row!==void 0||H.col!==void 0)){var $={row:H.row,col:H.col};if($.col===void 0)for($.col=0;_($.row,$.col);)$.col++;else if($.row===void 0)for($.row=0;_($.row,$.col);)$.row++;M[V.id()]=$,I($.row,$.col)}}var z=function(ee,J){var X,ne;if(ee.locked()||ee.isParent())return!1;var Y=M[ee.id()];if(Y)X=Y.col*b+b/2+i.x1,ne=Y.row*w+w/2+i.y1;else{for(;_(P,F);)O();X=F*b+b/2+i.x1,ne=P*w+w/2+i.y1,I(P,F),O()}return{x:X,y:ne}};a.layoutPositions(this,e,z)}return this};var k4={ready:function(){},stop:function(){}};function Ec(t){this.options=xe({},k4,t)}Ec.prototype.run=function(){var t=this.options,e=t.eles,n=this;return t.cy,n.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),n.one("layoutready",t.ready),n.emit("layoutready"),n.one("layoutstop",t.stop),n.emit("layoutstop"),this},Ec.prototype.stop=function(){return this};var x4={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function Yp(t){this.options=xe({},x4,t)}Yp.prototype.run=function(){var t=this.options,e=t.eles,n=e.nodes(),r=Ye(t.positions);function a(i){if(t.positions==null)return BT(i.position());if(r)return t.positions(i);var s=t.positions[i._private.data.id];return s??null}return n.layoutPositions(this,t,function(i,s){var l=a(i);return i.locked()||l==null?!1:l}),this};var E4={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function Zp(t){this.options=xe({},E4,t)}Zp.prototype.run=function(){var t=this.options,e=t.cy,n=t.eles,r=zt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(s,l){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}};return n.nodes().layoutPositions(this,t,a),this};var S4=[{name:"breadthfirst",impl:Hp},{name:"circle",impl:Kp},{name:"concentric",impl:qp},{name:"cose",impl:ws},{name:"grid",impl:jp},{name:"null",impl:Ec},{name:"preset",impl:Yp},{name:"random",impl:Zp}];function Xp(t){this.options=t,this.notifications=0}var Qp=function(){},Jp=function(){throw new Error("A headless instance can not render images")};Xp.prototype={recalculateRenderedStyle:Qp,notify:function(){this.notifications++},init:Qp,isHeadless:function(){return!0},png:Jp,jpg:Jp};var Sc={};Sc.arrowShapeWidth=.3,Sc.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,n=function(c,d,f,h,v,p,g){var y=v.x-f/2-g,m=v.x+f/2+g,b=v.y-f/2-g,w=v.y+f/2+g,C=y<=c&&c<=m&&b<=d&&d<=w;return C},r=function(c,d,f,h,v){var p=c*Math.cos(h)-d*Math.sin(h),g=c*Math.sin(h)+d*Math.cos(h),y=p*f,m=g*f,b=y+v.x,w=m+v.y;return{x:b,y:w}},a=function(c,d,f,h){for(var v=[],p=0;p<c.length;p+=2){var g=c[p],y=c[p+1];v.push(r(g,y,d,f,h))}return v},i=function(c){for(var d=[],f=0;f<c.length;f++){var h=c[f];d.push(h.x,h.y)}return d},s=function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").pfValue*2},l=function(c,d){be(d)&&(d=t[d]),t[c]=xe({name:c,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(h,v,p,g,y,m){var b=i(a(this.points,p+2*m,g,y)),w=Ht(h,v,b);return w},roughCollide:n,draw:function(h,v,p,g){var y=a(this.points,v,p,g);e.arrowShapeImpl("polygon")(h,y)},spacing:function(h){return 0},gap:s},d)};l("none",{collide:$o,roughCollide:$o,draw:jl,spacing:dh,gap:dh}),l("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),l("arrow","triangle"),l("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(c,d,f,h,v){var p=a(this.points,d,f,h),g=this.controlPoint,y=r(g[0],g[1],d,f,h);e.arrowShapeImpl(this.name)(c,p,y)},gap:function(c){return s(c)*.8}}),l("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(c,d,f,h,v,p,g){var y=i(a(this.points,f+2*g,h,v)),m=i(a(this.pointsTee,f+2*g,h,v)),b=Ht(c,d,y)||Ht(c,d,m);return b},draw:function(c,d,f,h,v){var p=a(this.points,d,f,h),g=a(this.pointsTee,d,f,h);e.arrowShapeImpl(this.name)(c,p,g)}}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(c,d,f,h,v,p,g){var y=v,m=Math.pow(y.x-c,2)+Math.pow(y.y-d,2)<=Math.pow((f+2*g)*this.radius,2),b=i(a(this.points,f+2*g,h,v));return Ht(c,d,b)||m},draw:function(c,d,f,h,v){var p=a(this.pointsTr,d,f,h);e.arrowShapeImpl(this.name)(c,p,h.x,h.y,this.radius*d)},spacing:function(c){return e.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),l("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(c,d){var f=this.baseCrossLinePts.slice(),h=d/c,v=3,p=5;return f[v]=f[v]-h,f[p]=f[p]-h,f},collide:function(c,d,f,h,v,p,g){var y=i(a(this.points,f+2*g,h,v)),m=i(a(this.crossLinePts(f,p),f+2*g,h,v)),b=Ht(c,d,y)||Ht(c,d,m);return b},draw:function(c,d,f,h,v){var p=a(this.points,d,f,h),g=a(this.crossLinePts(d,v),d,f,h);e.arrowShapeImpl(this.name)(c,p,g)}}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(c){return s(c)*.525}}),l("circle",{radius:.15,collide:function(c,d,f,h,v,p,g){var y=v,m=Math.pow(y.x-c,2)+Math.pow(y.y-d,2)<=Math.pow((f+2*g)*this.radius,2);return m},draw:function(c,d,f,h,v){e.arrowShapeImpl(this.name)(c,h.x,h.y,this.radius*d)},spacing:function(c){return e.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),l("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(c){return 1},gap:function(c){return 1}}),l("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),l("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}}),l("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(c){return .95*c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}})};var Kr={};Kr.projectIntoViewport=function(t,e){var n=this.cy,r=this.findContainerClientCoords(),a=r[0],i=r[1],s=r[4],l=n.pan(),u=n.zoom(),c=((t-a)/s-l.x)/u,d=((e-i)/s-l.y)/u;return[c,d]},Kr.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),n=this.cy.window().getComputedStyle(t),r=function(m){return parseFloat(n.getPropertyValue(m))},a={left:r("padding-left"),right:r("padding-right"),top:r("padding-top"),bottom:r("padding-bottom")},i={left:r("border-left-width"),right:r("border-right-width"),top:r("border-top-width"),bottom:r("border-bottom-width")},s=t.clientWidth,l=t.clientHeight,u=a.left+a.right,c=a.top+a.bottom,d=i.left+i.right,f=e.width/(s+d),h=s-u,v=l-c,p=e.left+a.left+i.left,g=e.top+a.top+i.top;return this.containerBB=[p,g,h,v,f]},Kr.invalidateContainerClientCoordsCache=function(){this.containerBB=null},Kr.findNearestElement=function(t,e,n,r){return this.findNearestElements(t,e,n,r)[0]},Kr.findNearestElements=function(t,e,n,r){var a=this,i=this,s=i.getCachedZSortedEles(),l=[],u=i.cy.zoom(),c=i.cy.hasCompoundNodes(),d=(r?24:8)/u,f=(r?8:2)/u,h=(r?8:2)/u,v=1/0,p,g;n&&(s=s.interactive);function y(x,B){if(x.isNode()){if(g)return;g=x,l.push(x)}if(x.isEdge()&&(B==null||B<v))if(p){if(p.pstyle("z-compound-depth").value===x.pstyle("z-compound-depth").value&&p.pstyle("z-compound-depth").value===x.pstyle("z-compound-depth").value){for(var S=0;S<l.length;S++)if(l[S].isEdge()){l[S]=x,p=x,v=B??v;break}}}else l.push(x),p=x,v=B??v}function m(x){var B=x.outerWidth()+2*f,S=x.outerHeight()+2*f,N=B/2,D=S/2,_=x.position(),I=x.pstyle("corner-radius").value==="auto"?"auto":x.pstyle("corner-radius").pfValue,P=x._private.rscratch;if(_.x-N<=t&&t<=_.x+N&&_.y-D<=e&&e<=_.y+D){var F=i.nodeShapes[a.getNodeShape(x)];if(F.checkPoint(t,e,0,B,S,_.x,_.y,I,P))return y(x,0),!0}}function b(x){var B=x._private,S=B.rscratch,N=x.pstyle("width").pfValue,D=x.pstyle("arrow-scale").value,_=N/2+d,I=_*_,P=_*2,L=B.source,V=B.target,F;if(S.edgeType==="segments"||S.edgeType==="straight"||S.edgeType==="haystack"){for(var O=S.allpts,M=0;M+3<O.length;M+=2)if($T(t,e,O[M],O[M+1],O[M+2],O[M+3],P)&&I>(F=UT(t,e,O[M],O[M+1],O[M+2],O[M+3])))return y(x,F),!0}else if(S.edgeType==="bezier"||S.edgeType==="multibezier"||S.edgeType==="self"||S.edgeType==="compound"){for(var O=S.allpts,M=0;M+5<S.allpts.length;M+=4)if(zT(t,e,O[M],O[M+1],O[M+2],O[M+3],O[M+4],O[M+5],P)&&I>(F=qT(t,e,O[M],O[M+1],O[M+2],O[M+3],O[M+4],O[M+5])))return y(x,F),!0}for(var L=L||B.source,V=V||B.target,H=a.getArrowWidth(N,D),$=[{name:"source",x:S.arrowStartX,y:S.arrowStartY,angle:S.srcArrowAngle},{name:"target",x:S.arrowEndX,y:S.arrowEndY,angle:S.tgtArrowAngle},{name:"mid-source",x:S.midX,y:S.midY,angle:S.midsrcArrowAngle},{name:"mid-target",x:S.midX,y:S.midY,angle:S.midtgtArrowAngle}],M=0;M<$.length;M++){var z=$[M],j=i.arrowShapes[x.pstyle(z.name+"-arrow-shape").value],ee=x.pstyle("width").pfValue;if(j.roughCollide(t,e,H,z.angle,{x:z.x,y:z.y},ee,d)&&j.collide(t,e,H,z.angle,{x:z.x,y:z.y},ee,d))return y(x),!0}c&&l.length>0&&(m(L),m(V))}function w(x,B,S){return fn(x,B,S)}function C(x,B){var S=x._private,N=h,D;B?D=B+"-":D="",x.boundingBox();var _=S.labelBounds[B||"main"],I=x.pstyle(D+"label").value,P=x.pstyle("text-events").strValue==="yes";if(!(!P||!I)){var F=w(S.rscratch,"labelX",B),O=w(S.rscratch,"labelY",B),M=w(S.rscratch,"labelAngle",B),L=x.pstyle(D+"text-margin-x").pfValue,V=x.pstyle(D+"text-margin-y").pfValue,H=_.x1-N-L,$=_.x2+N-L,z=_.y1-N-V,j=_.y2+N-V;if(M){var ee=Math.cos(M),J=Math.sin(M),X=function(he,re){return he=he-F,re=re-O,{x:he*ee-re*J+F,y:he*J+re*ee+O}},ne=X(H,z),Y=X(H,j),A=X($,z),K=X($,j),W=[ne.x+L,ne.y+V,A.x+L,A.y+V,K.x+L,K.y+V,Y.x+L,Y.y+V];if(Ht(t,e,W))return y(x),!0}else if(ba(_,t,e))return y(x),!0}}for(var k=s.length-1;k>=0;k--){var E=s[k];E.isNode()?m(E)||C(E):b(E)||C(E)||C(E,"source")||C(E,"target")}return l},Kr.getAllInBox=function(t,e,n,r){var a=this.getCachedZSortedEles().interactive,i=[],s=Math.min(t,n),l=Math.max(t,n),u=Math.min(e,r),c=Math.max(e,r);t=s,n=l,e=u,r=c;for(var d=zt({x1:t,y1:e,x2:n,y2:r}),f=0;f<a.length;f++){var h=a[f];if(h.isNode()){var v=h,p=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});Ql(d,p)&&!wh(p,d)&&i.push(v)}else{var g=h,y=g._private,m=y.rscratch;if(m.startX!=null&&m.startY!=null&&!ba(d,m.startX,m.startY)||m.endX!=null&&m.endY!=null&&!ba(d,m.endX,m.endY))continue;if(m.edgeType==="bezier"||m.edgeType==="multibezier"||m.edgeType==="self"||m.edgeType==="compound"||m.edgeType==="segments"||m.edgeType==="haystack"){for(var b=y.rstyle.bezierPts||y.rstyle.linePts||y.rstyle.haystackPts,w=!0,C=0;C<b.length;C++)if(!RT(d,b[C])){w=!1;break}w&&i.push(g)}else(m.edgeType==="haystack"||m.edgeType==="straight")&&i.push(g)}}return i};var ks={};ks.calculateArrowAngles=function(t){var e=t._private.rscratch,n=e.edgeType==="haystack",r=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",s=e.edgeType==="compound",l=e.edgeType==="self",u,c,d,f,h,v,m,b;if(n?(d=e.haystackPts[0],f=e.haystackPts[1],h=e.haystackPts[2],v=e.haystackPts[3]):(d=e.arrowStartX,f=e.arrowStartY,h=e.arrowEndX,v=e.arrowEndY),m=e.midX,b=e.midY,i)u=d-e.segpts[0],c=f-e.segpts[1];else if(a||s||l||r){var p=e.allpts,g=ht(p[0],p[2],p[4],.1),y=ht(p[1],p[3],p[5],.1);u=d-g,c=f-y}else u=d-m,c=f-b;e.srcArrowAngle=Ko(u,c);var m=e.midX,b=e.midY;if(n&&(m=(d+h)/2,b=(f+v)/2),u=h-d,c=v-f,i){var p=e.allpts;if(p.length/2%2===0){var w=p.length/2,C=w-2;u=p[w]-p[C],c=p[w+1]-p[C+1]}else if(e.isRound)u=e.midVector[1],c=-e.midVector[0];else{var w=p.length/2-1,C=w-2;u=p[w]-p[C],c=p[w+1]-p[C+1]}}else if(a||s||l){var p=e.allpts,k=e.ctrlpts,E,x,B,S;if(k.length/2%2===0){var N=p.length/2-1,D=N+2,_=D+2;E=ht(p[N],p[D],p[_],0),x=ht(p[N+1],p[D+1],p[_+1],0),B=ht(p[N],p[D],p[_],1e-4),S=ht(p[N+1],p[D+1],p[_+1],1e-4)}else{var D=p.length/2-1,N=D-2,_=D+2;E=ht(p[N],p[D],p[_],.4999),x=ht(p[N+1],p[D+1],p[_+1],.4999),B=ht(p[N],p[D],p[_],.5),S=ht(p[N+1],p[D+1],p[_+1],.5)}u=B-E,c=S-x}if(e.midtgtArrowAngle=Ko(u,c),e.midDispX=u,e.midDispY=c,u*=-1,c*=-1,i){var p=e.allpts;if(p.length/2%2!==0){if(!e.isRound){var w=p.length/2-1,I=w+2;u=-(p[I]-p[w]),c=-(p[I+1]-p[w+1])}}}if(e.midsrcArrowAngle=Ko(u,c),i)u=h-e.segpts[e.segpts.length-2],c=v-e.segpts[e.segpts.length-1];else if(a||s||l||r){var p=e.allpts,P=p.length,g=ht(p[P-6],p[P-4],p[P-2],.9),y=ht(p[P-5],p[P-3],p[P-1],.9);u=h-g,c=v-y}else u=h-m,c=v-b;e.tgtArrowAngle=Ko(u,c)},ks.getArrowWidth=ks.getArrowHeight=function(t,e){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[t+", "+e];return r||(r=Math.max(Math.pow(t*13.37,.9),29)*e,n[t+", "+e]=r,r)};var Tc,Bc,Sn={},nn={},ev,tv,qr,xs,Hn,Ur,Gr,Tn,Ma,Es,nv,rv,Nc,Dc,av,iv=function(e,n,r){r.x=n.x-e.x,r.y=n.y-e.y,r.len=Math.sqrt(r.x*r.x+r.y*r.y),r.nx=r.x/r.len,r.ny=r.y/r.len,r.ang=Math.atan2(r.ny,r.nx)},T4=function(e,n){n.x=e.x*-1,n.y=e.y*-1,n.nx=e.nx*-1,n.ny=e.ny*-1,n.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},B4=function(e,n,r,a,i){if(e!==av?iv(n,e,Sn):T4(nn,Sn),iv(n,r,nn),ev=Sn.nx*nn.ny-Sn.ny*nn.nx,tv=Sn.nx*nn.nx-Sn.ny*-nn.ny,Hn=Math.asin(Math.max(-1,Math.min(1,ev))),Math.abs(Hn)<1e-6){Tc=n.x,Bc=n.y,Gr=Ma=0;return}qr=1,xs=!1,tv<0?Hn<0?Hn=Math.PI+Hn:(Hn=Math.PI-Hn,qr=-1,xs=!0):Hn>0&&(qr=-1,xs=!0),n.radius!==void 0?Ma=n.radius:Ma=a,Ur=Hn/2,Es=Math.min(Sn.len/2,nn.len/2),i?(Tn=Math.abs(Math.cos(Ur)*Ma/Math.sin(Ur)),Tn>Es?(Tn=Es,Gr=Math.abs(Tn*Math.sin(Ur)/Math.cos(Ur))):Gr=Ma):(Tn=Math.min(Es,Ma),Gr=Math.abs(Tn*Math.sin(Ur)/Math.cos(Ur))),Nc=n.x+nn.nx*Tn,Dc=n.y+nn.ny*Tn,Tc=Nc-nn.ny*Gr*qr,Bc=Dc+nn.nx*Gr*qr,nv=n.x+Sn.nx*Tn,rv=n.y+Sn.ny*Tn,av=n};function ov(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function _c(t,e,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return r===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(B4(t,e,n,r,a),{cx:Tc,cy:Bc,radius:Gr,startX:nv,startY:rv,stopX:Nc,stopY:Dc,startAngle:Sn.ang+Math.PI/2*qr,endAngle:nn.ang-Math.PI/2*qr,counterClockwise:xs})}var _t={};_t.findMidptPtsEtc=function(t,e){var n=e.posPts,r=e.intersectionPts,a=e.vectorNormInverse,i,s=t.pstyle("source-endpoint"),l=t.pstyle("target-endpoint"),u=s.units!=null&&l.units!=null,c=function(k,E,x,B){var S=B-E,N=x-k,D=Math.sqrt(N*N+S*S);return{x:-S/D,y:N/D}},d=t.pstyle("edge-distances").value;switch(d){case"node-position":i=n;break;case"intersection":i=r;break;case"endpoints":{if(u){var f=this.manualEndptToPx(t.source()[0],s),h=dn(f,2),v=h[0],p=h[1],g=this.manualEndptToPx(t.target()[0],l),y=dn(g,2),m=y[0],b=y[1],w={x1:v,y1:p,x2:m,y2:b};a=c(v,p,m,b),i=w}else Ve("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=r;break}}return{midptPts:i,vectorNormInverse:a}},_t.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=n._private,a=r.rscratch;if(!a.haystack){var i=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var s=r.source,l=r.target,u=s.position(),c=l.position(),d=s.width(),f=l.width(),h=s.height(),v=l.height(),p=n.pstyle("haystack-radius").value,g=p/2;a.haystackPts=a.allpts=[a.source.x*d*g+u.x,a.source.y*h*g+u.y,a.target.x*f*g+c.x,a.target.y*v*g+c.y],a.midX=(a.allpts[0]+a.allpts[2])/2,a.midY=(a.allpts[1]+a.allpts[3])/2,a.edgeType="haystack",a.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},_t.findSegmentsPoints=function(t,e){var n=t._private.rscratch,r=t.pstyle("segment-weights"),a=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),l=Math.min(r.pfValue.length,a.pfValue.length),u=i.pfValue[i.pfValue.length-1],c=s.pfValue[s.pfValue.length-1];n.edgeType="segments",n.segpts=[],n.radii=[],n.isArcRadius=[];for(var d=0;d<l;d++){var f=r.pfValue[d],h=a.pfValue[d],v=1-f,p=f,g=this.findMidptPtsEtc(t,e),y=g.midptPts,m=g.vectorNormInverse,b={x:y.x1*v+y.x2*p,y:y.y1*v+y.y2*p};n.segpts.push(b.x+m.x*h,b.y+m.y*h),n.radii.push(i.pfValue[d]!==void 0?i.pfValue[d]:u),n.isArcRadius.push((s.pfValue[d]!==void 0?s.pfValue[d]:c)==="arc-radius")}},_t.findLoopPoints=function(t,e,n,r){var a=t._private.rscratch,i=e.dirCounts,s=e.srcPos,l=t.pstyle("control-point-distances"),u=l?l.pfValue[0]:void 0,c=t.pstyle("loop-direction").pfValue,d=t.pstyle("loop-sweep").pfValue,f=t.pstyle("control-point-step-size").pfValue;a.edgeType="self";var h=n,v=f;r&&(h=0,v=u);var p=c-Math.PI/2,g=p-d/2,y=p+d/2,m=c+"_"+d;h=i[m]===void 0?i[m]=0:++i[m],a.ctrlpts=[s.x+Math.cos(g)*1.4*v*(h/3+1),s.y+Math.sin(g)*1.4*v*(h/3+1),s.x+Math.cos(y)*1.4*v*(h/3+1),s.y+Math.sin(y)*1.4*v*(h/3+1)]},_t.findCompoundLoopPoints=function(t,e,n,r){var a=t._private.rscratch;a.edgeType="compound";var i=e.srcPos,s=e.tgtPos,l=e.srcW,u=e.srcH,c=e.tgtW,d=e.tgtH,f=t.pstyle("control-point-step-size").pfValue,h=t.pstyle("control-point-distances"),v=h?h.pfValue[0]:void 0,p=n,g=f;r&&(p=0,g=v);var y=50,m={x:i.x-l/2,y:i.y-u/2},b={x:s.x-c/2,y:s.y-d/2},w={x:Math.min(m.x,b.x),y:Math.min(m.y,b.y)},C=.5,k=Math.max(C,Math.log(l*.01)),E=Math.max(C,Math.log(c*.01));a.ctrlpts=[w.x,w.y-(1+Math.pow(y,1.12)/100)*g*(p/3+1)*k,w.x-(1+Math.pow(y,1.12)/100)*g*(p/3+1)*E,w.y]},_t.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"},_t.findBezierPoints=function(t,e,n,r,a){var i=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,l=t.pstyle("control-point-distances"),u=t.pstyle("control-point-weights"),c=l&&u?Math.min(l.value.length,u.value.length):1,d=l?l.pfValue[0]:void 0,f=u.value[0],h=r;i.edgeType=h?"multibezier":"bezier",i.ctrlpts=[];for(var v=0;v<c;v++){var p=(.5-e.eles.length/2+n)*s*(a?-1:1),g=void 0,y=mh(p);h&&(d=l?l.pfValue[v]:s,f=u.value[v]),r?g=d:g=d!==void 0?y*d:void 0;var m=g!==void 0?g:p,b=1-f,w=f,C=this.findMidptPtsEtc(t,e),k=C.midptPts,E=C.vectorNormInverse,x={x:k.x1*b+k.x2*w,y:k.y1*b+k.y2*w};i.ctrlpts.push(x.x+E.x*m,x.y+E.y*m)}},_t.findTaxiPoints=function(t,e){var n=t._private.rscratch;n.edgeType="segments";var r="vertical",a="horizontal",i="leftward",s="rightward",l="downward",u="upward",c="auto",d=e.posPts,f=e.srcW,h=e.srcH,v=e.tgtW,p=e.tgtH,g=t.pstyle("edge-distances").value,y=g!=="node-position",m=t.pstyle("taxi-direction").value,b=m,w=t.pstyle("taxi-turn"),C=w.units==="%",k=w.pfValue,E=k<0,x=t.pstyle("taxi-turn-min-distance").pfValue,B=y?(f+v)/2:0,S=y?(h+p)/2:0,N=d.x2-d.x1,D=d.y2-d.y1,_=function(we,Ce){return we>0?Math.max(we-Ce,0):Math.min(we+Ce,0)},I=_(N,B),P=_(D,S),F=!1;b===c?m=Math.abs(I)>Math.abs(P)?a:r:b===u||b===l?(m=r,F=!0):(b===i||b===s)&&(m=a,F=!0);var O=m===r,M=O?P:I,L=O?D:N,V=mh(L),H=!1;!(F&&(C||E))&&(b===l&&L<0||b===u&&L>0||b===i&&L>0||b===s&&L<0)&&(V*=-1,M=V*Math.abs(M),H=!0);var $;if(C){var z=k<0?1+k:k;$=z*M}else{var j=k<0?M:0;$=j+k*V}var ee=function(we){return Math.abs(we)<x||Math.abs(we)>=Math.abs(M)},J=ee($),X=ee(Math.abs(M)-Math.abs($)),ne=J||X;if(ne&&!H)if(O){var Y=Math.abs(L)<=h/2,A=Math.abs(N)<=v/2;if(Y){var K=(d.x1+d.x2)/2,W=d.y1,oe=d.y2;n.segpts=[K,W,K,oe]}else if(A){var he=(d.y1+d.y2)/2,re=d.x1,se=d.x2;n.segpts=[re,he,se,he]}else n.segpts=[d.x1,d.y2]}else{var ue=Math.abs(L)<=f/2,pe=Math.abs(D)<=p/2;if(ue){var de=(d.y1+d.y2)/2,me=d.x1,Ne=d.x2;n.segpts=[me,de,Ne,de]}else if(pe){var De=(d.x1+d.x2)/2,Ee=d.y1,_e=d.y2;n.segpts=[De,Ee,De,_e]}else n.segpts=[d.x2,d.y1]}else if(O){var te=d.y1+$+(y?h/2*V:0),T=d.x1,R=d.x2;n.segpts=[T,te,R,te]}else{var Q=d.x1+$+(y?f/2*V:0),G=d.y1,U=d.y2;n.segpts=[Q,G,Q,U]}if(n.isRound){var ie=t.pstyle("taxi-radius").value,Z=t.pstyle("radius-type").value[0]==="arc-radius";n.radii=new Array(n.segpts.length/2).fill(ie),n.isArcRadius=new Array(n.segpts.length/2).fill(Z)}},_t.tryToCorrectInvalidPoints=function(t,e){var n=t._private.rscratch;if(n.edgeType==="bezier"){var r=e.srcPos,a=e.tgtPos,i=e.srcW,s=e.srcH,l=e.tgtW,u=e.tgtH,c=e.srcShape,d=e.tgtShape,f=e.srcCornerRadius,h=e.tgtCornerRadius,v=e.srcRs,p=e.tgtRs,g=!le(n.startX)||!le(n.startY),y=!le(n.arrowStartX)||!le(n.arrowStartY),m=!le(n.endX)||!le(n.endY),b=!le(n.arrowEndX)||!le(n.arrowEndY),w=3,C=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,k=w*C,E=Fr({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),x=E<k,B=Fr({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),S=B<k,N=!1;if(g||y||x){N=!0;var D={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},_=Math.sqrt(D.x*D.x+D.y*D.y),I={x:D.x/_,y:D.y/_},P=Math.max(i,s),F={x:n.ctrlpts[0]+I.x*2*P,y:n.ctrlpts[1]+I.y*2*P},O=c.intersectLine(r.x,r.y,i,s,F.x,F.y,0,f,v);x?(n.ctrlpts[0]=n.ctrlpts[0]+I.x*(k-E),n.ctrlpts[1]=n.ctrlpts[1]+I.y*(k-E)):(n.ctrlpts[0]=O[0]+I.x*k,n.ctrlpts[1]=O[1]+I.y*k)}if(m||b||S){N=!0;var M={x:n.ctrlpts[0]-a.x,y:n.ctrlpts[1]-a.y},L=Math.sqrt(M.x*M.x+M.y*M.y),V={x:M.x/L,y:M.y/L},H=Math.max(i,s),$={x:n.ctrlpts[0]+V.x*2*H,y:n.ctrlpts[1]+V.y*2*H},z=d.intersectLine(a.x,a.y,l,u,$.x,$.y,0,h,p);S?(n.ctrlpts[0]=n.ctrlpts[0]+V.x*(k-B),n.ctrlpts[1]=n.ctrlpts[1]+V.y*(k-B)):(n.ctrlpts[0]=z[0]+V.x*k,n.ctrlpts[1]=z[1]+V.y*k)}N&&this.findEndpoints(t)}},_t.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var n=0;n+1<e.ctrlpts.length;n+=2)e.allpts.push(e.ctrlpts[n],e.ctrlpts[n+1]),n+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[n]+e.ctrlpts[n+2])/2,(e.ctrlpts[n+1]+e.ctrlpts[n+3])/2);e.allpts.push(e.endX,e.endY);var r,a;e.ctrlpts.length/2%2===0?(r=e.allpts.length/2-1,e.midX=e.allpts[r],e.midY=e.allpts[r+1]):(r=e.allpts.length/2-3,a=.5,e.midX=ht(e.allpts[r],e.allpts[r+2],e.allpts[r+4],a),e.midY=ht(e.allpts[r+1],e.allpts[r+3],e.allpts[r+5],a))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var s=e.radii[i/2-1],l=e.isArcRadius[i/2-1];e.roundCorners.push(_c({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:s},{x:e.allpts[i+2],y:e.allpts[i+3]},s,l))}}if(e.segpts.length%4===0){var u=e.segpts.length/2,c=u-2;e.midX=(e.segpts[c]+e.segpts[u])/2,e.midY=(e.segpts[c+1]+e.segpts[u+1])/2}else{var d=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[d],e.midY=e.segpts[d+1];else{var f={x:e.segpts[d],y:e.segpts[d+1]},h=e.roundCorners[d/2],v=[f.x-h.cx,f.y-h.cy],p=h.radius/Math.sqrt(Math.pow(v[0],2)+Math.pow(v[1],2));v=v.map(function(g){return g*p}),e.midX=h.cx+v[0],e.midY=h.cy+v[1],e.midVector=v}}}},_t.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||le(e.startX)&&le(e.startY)&&le(e.endX)&&le(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Ve("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},_t.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var n=this,r=n.cy,a=r.hasCompoundNodes(),i={map:new xn,get:function(x){var B=this.map.get(x[0]);return B!=null?B.get(x[1]):null},set:function(x,B){var S=this.map.get(x[0]);S==null&&(S=new xn,this.map.set(x[0],S)),S.set(x[1],B)}},s=[],l=[],u=0;u<t.length;u++){var c=t[u],d=c._private,f=c.pstyle("curve-style").value;if(!(c.removed()||!c.takesUpSpace())){if(f==="haystack"){l.push(c);continue}var h=f==="unbundled-bezier"||f.endsWith("segments")||f==="straight"||f==="straight-triangle"||f.endsWith("taxi"),v=f==="unbundled-bezier"||f==="bezier",p=d.source,g=d.target,y=p.poolIndex(),m=g.poolIndex(),b=[y,m].sort(),w=i.get(b);w==null&&(w={eles:[]},i.set(b,w),s.push(b)),w.eles.push(c),h&&(w.hasUnbundled=!0),v&&(w.hasBezier=!0)}}for(var C=function(x){var B=s[x],S=i.get(B),N=void 0;if(!S.hasUnbundled){var D=S.eles[0].parallelEdges().filter(function(Q){return Q.isBundledBezier()});Yl(S.eles),D.forEach(function(Q){return S.eles.push(Q)}),S.eles.sort(function(Q,G){return Q.poolIndex()-G.poolIndex()})}var _=S.eles[0],I=_.source(),P=_.target();if(I.poolIndex()>P.poolIndex()){var F=I;I=P,P=F}var O=S.srcPos=I.position(),M=S.tgtPos=P.position(),L=S.srcW=I.outerWidth(),V=S.srcH=I.outerHeight(),H=S.tgtW=P.outerWidth(),$=S.tgtH=P.outerHeight(),z=S.srcShape=n.nodeShapes[e.getNodeShape(I)],j=S.tgtShape=n.nodeShapes[e.getNodeShape(P)],ee=S.srcCornerRadius=I.pstyle("corner-radius").value==="auto"?"auto":I.pstyle("corner-radius").pfValue,J=S.tgtCornerRadius=P.pstyle("corner-radius").value==="auto"?"auto":P.pstyle("corner-radius").pfValue,X=S.tgtRs=P._private.rscratch,ne=S.srcRs=I._private.rscratch;S.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var Y=0;Y<S.eles.length;Y++){var A=S.eles[Y],K=A[0]._private.rscratch,W=A.pstyle("curve-style").value,oe=W==="unbundled-bezier"||W.endsWith("segments")||W.endsWith("taxi"),he=!I.same(A.source());if(!S.calculatedIntersection&&I!==P&&(S.hasBezier||S.hasUnbundled)){S.calculatedIntersection=!0;var re=z.intersectLine(O.x,O.y,L,V,M.x,M.y,0,ee,ne),se=S.srcIntn=re,ue=j.intersectLine(M.x,M.y,H,$,O.x,O.y,0,J,X),pe=S.tgtIntn=ue,de=S.intersectionPts={x1:re[0],x2:ue[0],y1:re[1],y2:ue[1]},me=S.posPts={x1:O.x,x2:M.x,y1:O.y,y2:M.y},Ne=ue[1]-re[1],De=ue[0]-re[0],Ee=Math.sqrt(De*De+Ne*Ne),_e=S.vector={x:De,y:Ne},te=S.vectorNorm={x:_e.x/Ee,y:_e.y/Ee},T={x:-te.y,y:te.x};S.nodesOverlap=!le(Ee)||j.checkPoint(re[0],re[1],0,H,$,M.x,M.y,J,X)||z.checkPoint(ue[0],ue[1],0,L,V,O.x,O.y,ee,ne),S.vectorNormInverse=T,N={nodesOverlap:S.nodesOverlap,dirCounts:S.dirCounts,calculatedIntersection:!0,hasBezier:S.hasBezier,hasUnbundled:S.hasUnbundled,eles:S.eles,srcPos:M,tgtPos:O,srcW:H,srcH:$,tgtW:L,tgtH:V,srcIntn:pe,tgtIntn:se,srcShape:j,tgtShape:z,posPts:{x1:me.x2,y1:me.y2,x2:me.x1,y2:me.y1},intersectionPts:{x1:de.x2,y1:de.y2,x2:de.x1,y2:de.y1},vector:{x:-_e.x,y:-_e.y},vectorNorm:{x:-te.x,y:-te.y},vectorNormInverse:{x:-T.x,y:-T.y}}}var R=he?N:S;K.nodesOverlap=R.nodesOverlap,K.srcIntn=R.srcIntn,K.tgtIntn=R.tgtIntn,K.isRound=W.startsWith("round"),a&&(I.isParent()||I.isChild()||P.isParent()||P.isChild())&&(I.parents().anySame(P)||P.parents().anySame(I)||I.same(P)&&I.isParent())?e.findCompoundLoopPoints(A,R,Y,oe):I===P?e.findLoopPoints(A,R,Y,oe):W.endsWith("segments")?e.findSegmentsPoints(A,R):W.endsWith("taxi")?e.findTaxiPoints(A,R):W==="straight"||!oe&&S.eles.length%2===1&&Y===Math.floor(S.eles.length/2)?e.findStraightEdgePoints(A):e.findBezierPoints(A,R,Y,oe,he),e.findEndpoints(A),e.tryToCorrectInvalidPoints(A,R),e.checkForInvalidEdgeWarning(A),e.storeAllpts(A),e.storeEdgeProjections(A),e.calculateArrowAngles(A),e.recalculateEdgeLabelProjections(A),e.calculateLabelAngles(A)}},k=0;k<s.length;k++)C(k);this.findHaystackPoints(l)}};function sv(t){var e=[];if(t!=null){for(var n=0;n<t.length;n+=2){var r=t[n],a=t[n+1];e.push({x:r,y:a})}return e}}_t.getSegmentPoints=function(t){var e=t[0]._private.rscratch,n=e.edgeType;if(n==="segments")return this.recalculateRenderedStyle(t),sv(e.segpts)},_t.getControlPoints=function(t){var e=t[0]._private.rscratch,n=e.edgeType;if(n==="bezier"||n==="multibezier"||n==="self"||n==="compound")return this.recalculateRenderedStyle(t),sv(e.ctrlpts)},_t.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var qi={};qi.manualEndptToPx=function(t,e){var n=this,r=t.position(),a=t.outerWidth(),i=t.outerHeight(),s=t._private.rscratch;if(e.value.length===2){var l=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(l[0]=l[0]*a),e.units[1]==="%"&&(l[1]=l[1]*i),l[0]+=r.x,l[1]+=r.y,l}else{var u=e.pfValue[0];u=-Math.PI/2+u;var c=2*Math.max(a,i),d=[r.x+Math.cos(u)*c,r.y+Math.sin(u)*c];return n.nodeShapes[this.getNodeShape(t)].intersectLine(r.x,r.y,a,i,d[0],d[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}},qi.findEndpoints=function(t){var e=this,n,r=t.source()[0],a=t.target()[0],i=r.position(),s=a.position(),l=t.pstyle("target-arrow-shape").value,u=t.pstyle("source-arrow-shape").value,c=t.pstyle("target-distance-from-node").pfValue,d=t.pstyle("source-distance-from-node").pfValue,f=r._private.rscratch,h=a._private.rscratch,v=t.pstyle("curve-style").value,p=t._private.rscratch,g=p.edgeType,y=v==="taxi",m=g==="self"||g==="compound",b=g==="bezier"||g==="multibezier"||m,w=g!=="bezier",C=g==="straight"||g==="segments",k=g==="segments",E=b||w||C,x=m||y,B=t.pstyle("source-endpoint"),S=x?"outside-to-node":B.value,N=r.pstyle("corner-radius").value==="auto"?"auto":r.pstyle("corner-radius").pfValue,D=t.pstyle("target-endpoint"),_=x?"outside-to-node":D.value,I=a.pstyle("corner-radius").value==="auto"?"auto":a.pstyle("corner-radius").pfValue;p.srcManEndpt=B,p.tgtManEndpt=D;var P,F,O,M;if(b){var L=[p.ctrlpts[0],p.ctrlpts[1]],V=w?[p.ctrlpts[p.ctrlpts.length-2],p.ctrlpts[p.ctrlpts.length-1]]:L;P=V,F=L}else if(C){var H=k?p.segpts.slice(0,2):[s.x,s.y],$=k?p.segpts.slice(p.segpts.length-2):[i.x,i.y];P=$,F=H}if(_==="inside-to-node")n=[s.x,s.y];else if(D.units)n=this.manualEndptToPx(a,D);else if(_==="outside-to-line")n=p.tgtIntn;else if(_==="outside-to-node"||_==="outside-to-node-or-label"?O=P:(_==="outside-to-line"||_==="outside-to-line-or-label")&&(O=[i.x,i.y]),n=e.nodeShapes[this.getNodeShape(a)].intersectLine(s.x,s.y,a.outerWidth(),a.outerHeight(),O[0],O[1],0,I,h),_==="outside-to-node-or-label"||_==="outside-to-line-or-label"){var z=a._private.rscratch,j=z.labelWidth,ee=z.labelHeight,J=z.labelX,X=z.labelY,ne=j/2,Y=ee/2,A=a.pstyle("text-valign").value;A==="top"?X-=Y:A==="bottom"&&(X+=Y);var K=a.pstyle("text-halign").value;K==="left"?J-=ne:K==="right"&&(J+=ne);var W=_i(O[0],O[1],[J-ne,X-Y,J+ne,X-Y,J+ne,X+Y,J-ne,X+Y],s.x,s.y);if(W.length>0){var oe=i,he=Ar(oe,ma(n)),re=Ar(oe,ma(W)),se=he;if(re<he&&(n=W,se=re),W.length>2){var ue=Ar(oe,{x:W[2],y:W[3]});ue<se&&(n=[W[2],W[3]])}}}var pe=jo(n,P,e.arrowShapes[l].spacing(t)+c),de=jo(n,P,e.arrowShapes[l].gap(t)+c);if(p.endX=de[0],p.endY=de[1],p.arrowEndX=pe[0],p.arrowEndY=pe[1],S==="inside-to-node")n=[i.x,i.y];else if(B.units)n=this.manualEndptToPx(r,B);else if(S==="outside-to-line")n=p.srcIntn;else if(S==="outside-to-node"||S==="outside-to-node-or-label"?M=F:(S==="outside-to-line"||S==="outside-to-line-or-label")&&(M=[s.x,s.y]),n=e.nodeShapes[this.getNodeShape(r)].intersectLine(i.x,i.y,r.outerWidth(),r.outerHeight(),M[0],M[1],0,N,f),S==="outside-to-node-or-label"||S==="outside-to-line-or-label"){var me=r._private.rscratch,Ne=me.labelWidth,De=me.labelHeight,Ee=me.labelX,_e=me.labelY,te=Ne/2,T=De/2,R=r.pstyle("text-valign").value;R==="top"?_e-=T:R==="bottom"&&(_e+=T);var Q=r.pstyle("text-halign").value;Q==="left"?Ee-=te:Q==="right"&&(Ee+=te);var G=_i(M[0],M[1],[Ee-te,_e-T,Ee+te,_e-T,Ee+te,_e+T,Ee-te,_e+T],i.x,i.y);if(G.length>0){var U=s,ie=Ar(U,ma(n)),Z=Ar(U,ma(G)),ae=ie;if(Z<ie&&(n=[G[0],G[1]],ae=Z),G.length>2){var we=Ar(U,{x:G[2],y:G[3]});we<ae&&(n=[G[2],G[3]])}}}var Ce=jo(n,F,e.arrowShapes[u].spacing(t)+d),ge=jo(n,F,e.arrowShapes[u].gap(t)+d);p.startX=ge[0],p.startY=ge[1],p.arrowStartX=Ce[0],p.arrowStartY=Ce[1],E&&(!le(p.startX)||!le(p.startY)||!le(p.endX)||!le(p.endY)?p.badLine=!0:p.badLine=!1)},qi.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}},qi.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var Pc={};function N4(t,e,n){for(var r=function(c,d,f,h){return ht(c,d,f,h)},a=e._private,i=a.rstyle.bezierPts,s=0;s<t.bezierProjPcts.length;s++){var l=t.bezierProjPcts[s];i.push({x:r(n[0],n[2],n[4],l),y:r(n[1],n[3],n[5],l)})}}Pc.storeEdgeProjections=function(t){var e=t._private,n=e.rscratch,r=n.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,r==="multibezier"||r==="bezier"||r==="self"||r==="compound"){e.rstyle.bezierPts=[];for(var a=0;a+5<n.allpts.length;a+=4)N4(this,t,n.allpts.slice(a,a+6))}else if(r==="segments")for(var i=e.rstyle.linePts=[],a=0;a+1<n.allpts.length;a+=2)i.push({x:n.allpts[a],y:n.allpts[a+1]});else if(r==="haystack"){var s=n.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth},Pc.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var Bn={};Bn.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!ar(e)){var n,r,a=t._private,i=t.width(),s=t.height(),l=t.padding(),u=t.position(),c=t.pstyle("text-halign").strValue,d=t.pstyle("text-valign").strValue,f=a.rscratch,h=a.rstyle;switch(c){case"left":n=u.x-i/2-l;break;case"right":n=u.x+i/2+l;break;default:n=u.x}switch(d){case"top":r=u.y-s/2-l;break;case"bottom":r=u.y+s/2+l;break;default:r=u.y}f.labelX=n,f.labelY=r,h.labelX=n,h.labelY=r,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var lv=function(e,n){var r=Math.atan(n/e);return e===0&&r<0&&(r=r*-1),r},cv=function(e,n){var r=n.x-e.x,a=n.y-e.y;return lv(r,a)},D4=function(e,n,r,a){var i=Ni(0,a-.001,1),s=Ni(0,a+.001,1),l=ya(e,n,r,i),u=ya(e,n,r,s);return cv(l,u)};Bn.recalculateEdgeLabelProjections=function(t){var e,n=t._private,r=n.rscratch,a=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:r.midX,y:r.midY};var s=function(f,h,v){sr(n.rscratch,f,h,v),sr(n.rstyle,f,h,v)};s("labelX",null,e.x),s("labelY",null,e.y);var l=lv(r.midDispX,r.midDispY);s("labelAutoAngle",null,l);var u=function d(){if(d.cache)return d.cache;for(var f=[],h=0;h+5<r.allpts.length;h+=4){var v={x:r.allpts[h],y:r.allpts[h+1]},p={x:r.allpts[h+2],y:r.allpts[h+3]},g={x:r.allpts[h+4],y:r.allpts[h+5]};f.push({p0:v,p1:p,p2:g,startDist:0,length:0,segments:[]})}var y=n.rstyle.bezierPts,m=a.bezierProjPcts.length;function b(x,B,S,N,D){var _=Fr(B,S),I=x.segments[x.segments.length-1],P={p0:B,p1:S,t0:N,t1:D,startDist:I?I.startDist+I.length:0,length:_};x.segments.push(P),x.length+=_}for(var w=0;w<f.length;w++){var C=f[w],k=f[w-1];k&&(C.startDist=k.startDist+k.length),b(C,C.p0,y[w*m],0,a.bezierProjPcts[0]);for(var E=0;E<m-1;E++)b(C,y[w*m+E],y[w*m+E+1],a.bezierProjPcts[E],a.bezierProjPcts[E+1]);b(C,y[w*m+m-1],C.p2,a.bezierProjPcts[m-1],1)}return d.cache=f},c=function(f){var h,v=f==="source";if(i[f]){var p=t.pstyle(f+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var g=u(),y,m=0,b=0,w=0;w<g.length;w++){for(var C=g[v?w:g.length-1-w],k=0;k<C.segments.length;k++){var E=C.segments[v?k:C.segments.length-1-k],x=w===g.length-1&&k===C.segments.length-1;if(m=b,b+=E.length,b>=p||x){y={cp:C,segment:E};break}}if(y)break}var B=y.cp,S=y.segment,N=(p-m)/S.length,D=S.t1-S.t0,_=v?S.t0+D*N:S.t1-D*N;_=Ni(0,_,1),e=ya(B.p0,B.p1,B.p2,_),h=D4(B.p0,B.p1,B.p2,_);break}case"straight":case"segments":case"haystack":{for(var I=0,P,F,O,M,L=r.allpts.length,V=0;V+3<L&&(v?(O={x:r.allpts[V],y:r.allpts[V+1]},M={x:r.allpts[V+2],y:r.allpts[V+3]}):(O={x:r.allpts[L-2-V],y:r.allpts[L-1-V]},M={x:r.allpts[L-4-V],y:r.allpts[L-3-V]}),P=Fr(O,M),F=I,I+=P,!(I>=p));V+=2);var H=p-F,$=H/P;$=Ni(0,$,1),e=LT(O,M,$),h=cv(O,M);break}}s("labelX",f,e.x),s("labelY",f,e.y),s("labelAutoAngle",f,h)}};c("source"),c("target"),this.applyLabelDimensions(t)}},Bn.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},Bn.applyPrefixedLabelDimensions=function(t,e){var n=t._private,r=this.getLabelText(t,e),a=this.calculateLabelDimensions(t,r),i=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,l=fn(n.rscratch,"labelWrapCachedLines",e)||[],u=s!=="wrap"?1:Math.max(l.length,1),c=a.height/u,d=c*i,f=a.width,h=a.height+(u-1)*(i-1)*c;sr(n.rstyle,"labelWidth",e,f),sr(n.rscratch,"labelWidth",e,f),sr(n.rstyle,"labelHeight",e,h),sr(n.rscratch,"labelHeight",e,h),sr(n.rscratch,"labelLineHeight",e,d)},Bn.getLabelText=function(t,e){var n=t._private,r=e?e+"-":"",a=t.pstyle(r+"label").strValue,i=t.pstyle("text-transform").value,s=function(j,ee){return ee?(sr(n.rscratch,j,e,ee),ee):fn(n.rscratch,j,e)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var l=t.pstyle("text-wrap").value;if(l==="wrap"){var u=s("labelKey");if(u!=null&&s("labelWrapKey")===u)return s("labelWrapCachedText");for(var c="",d=a.split(`
|
|
42
|
-
`),f=t.pstyle("text-max-width").pfValue,h=t.pstyle("text-overflow-wrap").value,v=h==="anywhere",p=[],g=/[\s\u200b]+|$/g,y=0;y<d.length;y++){var m=d[y],b=this.calculateLabelDimensions(t,m),w=b.width;if(v){var C=m.split("").join(c);m=C}if(w>f){var
|
|
43
|
-
`)),s("labelWrapKey",u)}else if(l==="ellipsis"){var
|
|
44
|
-
`),w=0;w<b.length;w++){var C=b[w],k=p.measureText(C),E=Math.ceil(k.width),x=d;y=Math.max(E,y),m+=x}return y+=u,m+=u,s[i]={width:y,height:m}},Bn.calculateLabelAngle=function(t,e){var n=t._private,r=n.rscratch,a=t.isEdge(),i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),l=s.strValue;return l==="none"?0:a&&l==="autorotate"?r.labelAutoAngle:l==="autorotate"?0:s.pfValue},Bn.calculateLabelAngles=function(t){var e=this,n=t.isEdge(),r=t._private,a=r.rscratch;a.labelAngle=e.calculateLabelAngle(t),n&&(a.sourceLabelAngle=e.calculateLabelAngle(t,"source"),a.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var uv={},dv=28,fv=!1;uv.getNodeShape=function(t){var e=this,n=t.pstyle("shape").value;if(n==="cutrectangle"&&(t.width()<dv||t.height()<dv))return fv||(Ve("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),fv=!0),"rectangle";if(t.isParent())return n==="rectangle"||n==="roundrectangle"||n==="round-rectangle"||n==="cutrectangle"||n==="cut-rectangle"||n==="barrel"?n:"rectangle";if(n==="polygon"){var r=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(r).name}return n};var Ss={};Ss.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),n=this,r=function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),l)for(var u=0;u<s.length;u++){var c=s[u],d=c._private,f=d.rstyle;f.clean=!1,f.cleanConnected=!1}};n.binder(t).on("bounds.* dirty.*",function(s){var l=s.target;r(l)}).on("style.* background.*",function(s){var l=s.target;r(l,!1)});var a=function(s){if(s){var l=n.onUpdateEleCalcsFns;e.cleanStyle();for(var u=0;u<e.length;u++){var c=e[u],d=c._private.rstyle;c.isNode()&&!d.cleanConnected&&(r(c.connectedEdges()),d.cleanConnected=!0)}if(l)for(var f=0;f<l.length;f++){var h=l[f];h(s,e)}n.recalculateRenderedStyle(e),e=t.collection()}};n.flushRenderedStyleQueue=function(){a(!0)},n.beforeRender(a,n.beforeRenderPriorities.eleCalcs)},Ss.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)},Ss.recalculateRenderedStyle=function(t,e){var n=function(C){return C._private.rstyle.cleanConnected},r=[],a=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var s=t[i],l=s._private,u=l.rstyle;s.isEdge()&&(!n(s.source())||!n(s.target()))&&(u.clean=!1),!(e&&u.clean||s.removed())&&s.pstyle("display").value!=="none"&&(l.group==="nodes"?a.push(s):r.push(s),u.clean=!0)}for(var c=0;c<a.length;c++){var d=a[c],f=d._private,h=f.rstyle,v=d.position();this.recalculateNodeLabelProjection(d),h.nodeX=v.x,h.nodeY=v.y,h.nodeW=d.pstyle("width").pfValue,h.nodeH=d.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var p=0;p<r.length;p++){var g=r[p],y=g._private,m=y.rstyle,b=y.rscratch;m.srcX=b.arrowStartX,m.srcY=b.arrowStartY,m.tgtX=b.arrowEndX,m.tgtY=b.arrowEndY,m.midX=b.midX,m.midY=b.midY,m.labelAngle=b.labelAngle,m.sourceLabelAngle=b.sourceLabelAngle,m.targetLabelAngle=b.targetLabelAngle}}};var Ts={};Ts.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],n=0;n<t.length;n++){var r=t[n],a=r._private.rscratch;r.grabbed()&&!r.isParent()?e.push(r):a.inDragLayer?t.drag.push(r):t.nondrag.push(r)}for(var n=0;n<e.length;n++){var r=e[n];t.drag.push(r)}}},Ts.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},Ts.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(Np),e.interactive=e.filter(function(n){return n.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var hv={};[Kr,ks,_t,qi,Pc,Bn,uv,Ss,Ts].forEach(function(t){xe(hv,t)});var pv={};pv.getCachedImage=function(t,e,n){var r=this,a=r.imageCache=r.imageCache||{},i=a[t];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;i=a[t]=a[t]||{};var s=i.image=new Image;s.addEventListener("load",n),s.addEventListener("error",function(){s.error=!0});var l="data:",u=t.substring(0,l.length).toLowerCase()===l;return u||(e=e==="null"?null:e,s.crossOrigin=e),s.src=t,s};var Fa={};Fa.registerBinding=function(t,e,n,r){var a=Array.prototype.slice.apply(arguments,[1]),i=this.binder(t);return i.on.apply(i,a)},Fa.binder=function(t){var e=this,n=e.cy.window(),r=t===n||t===n.document||t===n.document.body||eS(t);if(e.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});n.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=a}var s=function(u,c,d){var f=Array.prototype.slice.call(arguments);return r&&e.supportsPassiveEvents&&(f[2]={capture:d??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:f}),(t.addEventListener||t.on).apply(t,f),this};return{on:s,addEventListener:s,addListener:s,bind:s}},Fa.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()},Fa.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()},Fa.load=function(){var t=this,e=t.cy.window(),n=function(T){return T.selected()},r=function(T,R,Q,G){T==null&&(T=t.cy);for(var U=0;U<R.length;U++){var ie=R[U];T.emit({originalEvent:Q,type:ie,position:G})}},a=function(T){return T.shiftKey||T.metaKey||T.ctrlKey},i=function(T,R){var Q=!0;if(t.cy.hasCompoundNodes()&&T&&T.pannable())for(var G=0;R&&G<R.length;G++){var T=R[G];if(T.isNode()&&T.isParent()&&!T.pannable()){Q=!1;break}}else Q=!0;return Q},s=function(T){T[0]._private.grabbed=!0},l=function(T){T[0]._private.grabbed=!1},u=function(T){T[0]._private.rscratch.inDragLayer=!0},c=function(T){T[0]._private.rscratch.inDragLayer=!1},d=function(T){T[0]._private.rscratch.isGrabTarget=!0},f=function(T){T[0]._private.rscratch.isGrabTarget=!1},h=function(T,R){var Q=R.addToList,G=Q.has(T);!G&&T.grabbable()&&!T.locked()&&(Q.merge(T),s(T))},v=function(T,R){if(T.cy().hasCompoundNodes()&&!(R.inDragLayer==null&&R.addToList==null)){var Q=T.descendants();R.inDragLayer&&(Q.forEach(u),Q.connectedEdges().forEach(u)),R.addToList&&h(Q,R)}},p=function(T,R){R=R||{};var Q=T.cy().hasCompoundNodes();R.inDragLayer&&(T.forEach(u),T.neighborhood().stdFilter(function(G){return!Q||G.isEdge()}).forEach(u)),R.addToList&&T.forEach(function(G){h(G,R)}),v(T,R),m(T,{inDragLayer:R.inDragLayer}),t.updateCachedGrabbedEles()},g=p,y=function(T){T&&(t.getCachedZSortedEles().forEach(function(R){l(R),c(R),f(R)}),t.updateCachedGrabbedEles())},m=function(T,R){if(!(R.inDragLayer==null&&R.addToList==null)&&T.cy().hasCompoundNodes()){var Q=T.ancestors().orphans();if(!Q.same(T)){var G=Q.descendants().spawnSelf().merge(Q).unmerge(T).unmerge(T.descendants()),U=G.connectedEdges();R.inDragLayer&&(U.forEach(u),G.forEach(u)),R.addToList&&G.forEach(function(ie){h(ie,R)})}}},b=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},w=typeof MutationObserver<"u",C=typeof ResizeObserver<"u";w?(t.removeObserver=new MutationObserver(function(te){for(var T=0;T<te.length;T++){var R=te[T],Q=R.removedNodes;if(Q)for(var G=0;G<Q.length;G++){var U=Q[G];if(U===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(te){t.destroy()});var k=Ao(function(){t.cy.resize()},100);w&&(t.styleObserver=new MutationObserver(k),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",k),C&&(t.resizeObserver=new ResizeObserver(k),t.resizeObserver.observe(t.container));var E=function(T,R){for(;T!=null;)R(T),T=T.parentNode},x=function(){t.invalidateContainerClientCoordsCache()};E(t.container,function(te){t.registerBinding(te,"transitionend",x),t.registerBinding(te,"animationend",x),t.registerBinding(te,"scroll",x)}),t.registerBinding(t.container,"contextmenu",function(te){te.preventDefault()});var B=function(){return t.selection[4]!==0},S=function(T){for(var R=t.findContainerClientCoords(),Q=R[0],G=R[1],U=R[2],ie=R[3],Z=T.touches?T.touches:[T],ae=!1,we=0;we<Z.length;we++){var Ce=Z[we];if(Q<=Ce.clientX&&Ce.clientX<=Q+U&&G<=Ce.clientY&&Ce.clientY<=G+ie){ae=!0;break}}if(!ae)return!1;for(var ge=t.container,Se=T.target,ve=Se.parentNode,ye=!1;ve;){if(ve===ge){ye=!0;break}ve=ve.parentNode}return!!ye};t.registerBinding(t.container,"mousedown",function(T){if(S(T)&&!(t.hoverData.which===1&&T.which!==1)){T.preventDefault(),b(),t.hoverData.capture=!0,t.hoverData.which=T.which;var R=t.cy,Q=[T.clientX,T.clientY],G=t.projectIntoViewport(Q[0],Q[1]),U=t.selection,ie=t.findNearestElements(G[0],G[1],!0,!1),Z=ie[0],ae=t.dragData.possibleDragElements;t.hoverData.mdownPos=G,t.hoverData.mdownGPos=Q;var we=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var Ge=t.hoverData.down;Ge?Ge.emit({originalEvent:T,type:"taphold",position:{x:G[0],y:G[1]}}):R.emit({originalEvent:T,type:"taphold",position:{x:G[0],y:G[1]}})}},t.tapholdDuration)};if(T.which==3){t.hoverData.cxtStarted=!0;var Ce={originalEvent:T,type:"cxttapstart",position:{x:G[0],y:G[1]}};Z?(Z.activate(),Z.emit(Ce),t.hoverData.down=Z):R.emit(Ce),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(T.which==1){Z&&Z.activate();{if(Z!=null&&t.nodeIsGrabbable(Z)){var ge=function(Ge){return{originalEvent:T,type:Ge,position:{x:G[0],y:G[1]}}},Se=function(Ge){Ge.emit(ge("grab"))};if(d(Z),!Z.selected())ae=t.dragData.possibleDragElements=R.collection(),g(Z,{addToList:ae}),Z.emit(ge("grabon")).emit(ge("grab"));else{ae=t.dragData.possibleDragElements=R.collection();var ve=R.$(function(ye){return ye.isNode()&&ye.selected()&&t.nodeIsGrabbable(ye)});p(ve,{addToList:ae}),Z.emit(ge("grabon")),ve.forEach(Se)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=Z,t.hoverData.downs=ie,t.hoverData.downTime=new Date().getTime()}r(Z,["mousedown","tapstart","vmousedown"],T,{x:G[0],y:G[1]}),Z==null?(U[4]=1,t.data.bgActivePosistion={x:G[0],y:G[1]},t.redrawHint("select",!0),t.redraw()):Z.pannable()&&(U[4]=1),we()}U[0]=U[2]=G[0],U[1]=U[3]=G[1]}},!1),t.registerBinding(e,"mousemove",function(T){var R=t.hoverData.capture;if(!(!R&&!S(T))){var Q=!1,G=t.cy,U=G.zoom(),ie=[T.clientX,T.clientY],Z=t.projectIntoViewport(ie[0],ie[1]),ae=t.hoverData.mdownPos,we=t.hoverData.mdownGPos,Ce=t.selection,ge=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(ge=t.findNearestElement(Z[0],Z[1],!0,!1));var Se=t.hoverData.last,ve=t.hoverData.down,ye=[Z[0]-Ce[2],Z[1]-Ce[3]],Ge=t.dragData.possibleDragElements,$e;if(we){var nt=ie[0]-we[0],rt=nt*nt,Qe=ie[1]-we[1],Pt=Qe*Qe,dt=rt+Pt;t.hoverData.isOverThresholdDrag=$e=dt>=t.desktopTapThreshold2}var pt=a(T);$e&&(t.hoverData.tapholdCancelled=!0);var Wt=function(){var q=t.hoverData.dragDelta=t.hoverData.dragDelta||[];q.length===0?(q.push(ye[0]),q.push(ye[1])):(q[0]+=ye[0],q[1]+=ye[1])};Q=!0,r(ge,["mousemove","vmousemove","tapdrag"],T,{x:Z[0],y:Z[1]});var Ot=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||G.emit({originalEvent:T,type:"boxstart",position:{x:Z[0],y:Z[1]}}),Ce[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if($e){var It={originalEvent:T,type:"cxtdrag",position:{x:Z[0],y:Z[1]}};ve?ve.emit(It):G.emit(It),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||ge!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:T,type:"cxtdragout",position:{x:Z[0],y:Z[1]}}),t.hoverData.cxtOver=ge,ge&&ge.emit({originalEvent:T,type:"cxtdragover",position:{x:Z[0],y:Z[1]}}))}}else if(t.hoverData.dragging){if(Q=!0,G.panningEnabled()&&G.userPanningEnabled()){var rn;if(t.hoverData.justStartedPan){var vn=t.hoverData.mdownPos;rn={x:(Z[0]-vn[0])*U,y:(Z[1]-vn[1])*U},t.hoverData.justStartedPan=!1}else rn={x:ye[0]*U,y:ye[1]*U};G.panBy(rn),G.emit("dragpan"),t.hoverData.dragged=!0}Z=t.projectIntoViewport(T.clientX,T.clientY)}else if(Ce[4]==1&&(ve==null||ve.pannable())){if($e){if(!t.hoverData.dragging&&G.boxSelectionEnabled()&&(pt||!G.panningEnabled()||!G.userPanningEnabled()))Ot();else if(!t.hoverData.selecting&&G.panningEnabled()&&G.userPanningEnabled()){var Kt=i(ve,t.hoverData.downs);Kt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Ce[4]=0,t.data.bgActivePosistion=ma(ae),t.redrawHint("select",!0),t.redraw())}ve&&ve.pannable()&&ve.active()&&ve.unactivate()}}else{if(ve&&ve.pannable()&&ve.active()&&ve.unactivate(),(!ve||!ve.grabbed())&&ge!=Se&&(Se&&r(Se,["mouseout","tapdragout"],T,{x:Z[0],y:Z[1]}),ge&&r(ge,["mouseover","tapdragover"],T,{x:Z[0],y:Z[1]}),t.hoverData.last=ge),ve)if($e){if(G.boxSelectionEnabled()&&pt)ve&&ve.grabbed()&&(y(Ge),ve.emit("freeon"),Ge.emit("free"),t.dragData.didDrag&&(ve.emit("dragfreeon"),Ge.emit("dragfree"))),Ot();else if(ve&&ve.grabbed()&&t.nodeIsDraggable(ve)){var Je=!t.dragData.didDrag;Je&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(Ge,{inDragLayer:!0});var at={x:0,y:0};if(le(ye[0])&&le(ye[1])&&(at.x+=ye[0],at.y+=ye[1],Je)){var vt=t.hoverData.dragDelta;vt&&le(vt[0])&&le(vt[1])&&(at.x+=vt[0],at.y+=vt[1])}t.hoverData.draggingEles=!0,Ge.silentShift(at).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else Wt();Q=!0}if(Ce[2]=Z[0],Ce[3]=Z[1],Q)return T.stopPropagation&&T.stopPropagation(),T.preventDefault&&T.preventDefault(),!1}},!1);var N,D,_;t.registerBinding(e,"mouseup",function(T){if(!(t.hoverData.which===1&&T.which!==1&&t.hoverData.capture)){var R=t.hoverData.capture;if(R){t.hoverData.capture=!1;var Q=t.cy,G=t.projectIntoViewport(T.clientX,T.clientY),U=t.selection,ie=t.findNearestElement(G[0],G[1],!0,!1),Z=t.dragData.possibleDragElements,ae=t.hoverData.down,we=a(T);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,ae&&ae.unactivate(),t.hoverData.which===3){var Ce={originalEvent:T,type:"cxttapend",position:{x:G[0],y:G[1]}};if(ae?ae.emit(Ce):Q.emit(Ce),!t.hoverData.cxtDragged){var ge={originalEvent:T,type:"cxttap",position:{x:G[0],y:G[1]}};ae?ae.emit(ge):Q.emit(ge)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(r(ie,["mouseup","tapend","vmouseup"],T,{x:G[0],y:G[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(r(ae,["click","tap","vclick"],T,{x:G[0],y:G[1]}),D=!1,T.timeStamp-_<=Q.multiClickDebounceTime()?(N&&clearTimeout(N),D=!0,_=null,r(ae,["dblclick","dbltap","vdblclick"],T,{x:G[0],y:G[1]})):(N=setTimeout(function(){D||r(ae,["oneclick","onetap","voneclick"],T,{x:G[0],y:G[1]})},Q.multiClickDebounceTime()),_=T.timeStamp)),ae==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(T)&&(Q.$(n).unselect(["tapunselect"]),Z.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=Z=Q.collection()),ie==ae&&!t.dragData.didDrag&&!t.hoverData.selecting&&ie!=null&&ie._private.selectable&&(t.hoverData.dragging||(Q.selectionType()==="additive"||we?ie.selected()?ie.unselect(["tapunselect"]):ie.select(["tapselect"]):we||(Q.$(n).unmerge(ie).unselect(["tapunselect"]),ie.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Se=Q.collection(t.getAllInBox(U[0],U[1],U[2],U[3]));t.redrawHint("select",!0),Se.length>0&&t.redrawHint("eles",!0),Q.emit({type:"boxend",originalEvent:T,position:{x:G[0],y:G[1]}});var ve=function($e){return $e.selectable()&&!$e.selected()};Q.selectionType()==="additive"||we||Q.$(n).unmerge(Se).unselect(),Se.emit("box").stdFilter(ve).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!U[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var ye=ae&&ae.grabbed();y(Z),ye&&(ae.emit("freeon"),Z.emit("free"),t.dragData.didDrag&&(ae.emit("dragfreeon"),Z.emit("dragfree")))}}U[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var I=function(T){if(!t.scrollingPage){var R=t.cy,Q=R.zoom(),G=R.pan(),U=t.projectIntoViewport(T.clientX,T.clientY),ie=[U[0]*Q+G.x,U[1]*Q+G.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||B()){T.preventDefault();return}if(R.panningEnabled()&&R.userPanningEnabled()&&R.zoomingEnabled()&&R.userZoomingEnabled()){T.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var Z;T.deltaY!=null?Z=T.deltaY/-250:T.wheelDeltaY!=null?Z=T.wheelDeltaY/1e3:Z=T.wheelDelta/1e3,Z=Z*t.wheelSensitivity;var ae=T.deltaMode===1;ae&&(Z*=33);var we=R.zoom()*Math.pow(10,Z);T.type==="gesturechange"&&(we=t.gestureStartZoom*T.scale),R.zoom({level:we,renderedPosition:{x:ie[0],y:ie[1]}}),R.emit(T.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",I,!0),t.registerBinding(e,"scroll",function(T){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(T){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||T.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(te){t.hasTouchStarted||I(te)},!0),t.registerBinding(t.container,"mouseout",function(T){var R=t.projectIntoViewport(T.clientX,T.clientY);t.cy.emit({originalEvent:T,type:"mouseout",position:{x:R[0],y:R[1]}})},!1),t.registerBinding(t.container,"mouseover",function(T){var R=t.projectIntoViewport(T.clientX,T.clientY);t.cy.emit({originalEvent:T,type:"mouseover",position:{x:R[0],y:R[1]}})},!1);var P,F,O,M,L,V,H,$,z,j,ee,J,X,ne=function(T,R,Q,G){return Math.sqrt((Q-T)*(Q-T)+(G-R)*(G-R))},Y=function(T,R,Q,G){return(Q-T)*(Q-T)+(G-R)*(G-R)},A;t.registerBinding(t.container,"touchstart",A=function(T){if(t.hasTouchStarted=!0,!!S(T)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var R=t.cy,Q=t.touchData.now,G=t.touchData.earlier;if(T.touches[0]){var U=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);Q[0]=U[0],Q[1]=U[1]}if(T.touches[1]){var U=t.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);Q[2]=U[0],Q[3]=U[1]}if(T.touches[2]){var U=t.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);Q[4]=U[0],Q[5]=U[1]}if(T.touches[1]){t.touchData.singleTouchMoved=!0,y(t.dragData.touchDragEles);var ie=t.findContainerClientCoords();z=ie[0],j=ie[1],ee=ie[2],J=ie[3],P=T.touches[0].clientX-z,F=T.touches[0].clientY-j,O=T.touches[1].clientX-z,M=T.touches[1].clientY-j,X=0<=P&&P<=ee&&0<=O&&O<=ee&&0<=F&&F<=J&&0<=M&&M<=J;var Z=R.pan(),ae=R.zoom();L=ne(P,F,O,M),V=Y(P,F,O,M),H=[(P+O)/2,(F+M)/2],$=[(H[0]-Z.x)/ae,(H[1]-Z.y)/ae];var we=200,Ce=we*we;if(V<Ce&&!T.touches[2]){var ge=t.findNearestElement(Q[0],Q[1],!0,!0),Se=t.findNearestElement(Q[2],Q[3],!0,!0);ge&&ge.isNode()?(ge.activate().emit({originalEvent:T,type:"cxttapstart",position:{x:Q[0],y:Q[1]}}),t.touchData.start=ge):Se&&Se.isNode()?(Se.activate().emit({originalEvent:T,type:"cxttapstart",position:{x:Q[0],y:Q[1]}}),t.touchData.start=Se):R.emit({originalEvent:T,type:"cxttapstart",position:{x:Q[0],y:Q[1]}}),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(T.touches[2])R.boxSelectionEnabled()&&T.preventDefault();else if(!T.touches[1]){if(T.touches[0]){var ve=t.findNearestElements(Q[0],Q[1],!0,!0),ye=ve[0];if(ye!=null&&(ye.activate(),t.touchData.start=ye,t.touchData.starts=ve,t.nodeIsGrabbable(ye))){var Ge=t.dragData.touchDragEles=R.collection(),$e=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),ye.selected()?($e=R.$(function(dt){return dt.selected()&&t.nodeIsGrabbable(dt)}),p($e,{addToList:Ge})):g(ye,{addToList:Ge}),d(ye);var nt=function(pt){return{originalEvent:T,type:pt,position:{x:Q[0],y:Q[1]}}};ye.emit(nt("grabon")),$e?$e.forEach(function(dt){dt.emit(nt("grab"))}):ye.emit(nt("grab"))}r(ye,["touchstart","tapstart","vmousedown"],T,{x:Q[0],y:Q[1]}),ye==null&&(t.data.bgActivePosistion={x:U[0],y:U[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&r(t.touchData.start,["taphold"],T,{x:Q[0],y:Q[1]})},t.tapholdDuration)}}if(T.touches.length>=1){for(var rt=t.touchData.startPosition=[null,null,null,null,null,null],Qe=0;Qe<Q.length;Qe++)rt[Qe]=G[Qe]=Q[Qe];var Pt=T.touches[0];t.touchData.startGPosition=[Pt.clientX,Pt.clientY]}}},!1);var K;t.registerBinding(e,"touchmove",K=function(T){var R=t.touchData.capture;if(!(!R&&!S(T))){var Q=t.selection,G=t.cy,U=t.touchData.now,ie=t.touchData.earlier,Z=G.zoom();if(T.touches[0]){var ae=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);U[0]=ae[0],U[1]=ae[1]}if(T.touches[1]){var ae=t.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);U[2]=ae[0],U[3]=ae[1]}if(T.touches[2]){var ae=t.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);U[4]=ae[0],U[5]=ae[1]}var we=t.touchData.startGPosition,Ce;if(R&&T.touches[0]&&we){for(var ge=[],Se=0;Se<U.length;Se++)ge[Se]=U[Se]-ie[Se];var ve=T.touches[0].clientX-we[0],ye=ve*ve,Ge=T.touches[0].clientY-we[1],$e=Ge*Ge,nt=ye+$e;Ce=nt>=t.touchTapThreshold2}if(R&&t.touchData.cxt){T.preventDefault();var rt=T.touches[0].clientX-z,Qe=T.touches[0].clientY-j,Pt=T.touches[1].clientX-z,dt=T.touches[1].clientY-j,pt=Y(rt,Qe,Pt,dt),Wt=pt/V,Ot=150,It=Ot*Ot,rn=1.5,vn=rn*rn;if(Wt>=vn||pt>=It){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Kt={originalEvent:T,type:"cxttapend",position:{x:U[0],y:U[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(Kt),t.touchData.start=null):G.emit(Kt)}}if(R&&t.touchData.cxt){var Kt={originalEvent:T,type:"cxtdrag",position:{x:U[0],y:U[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Kt):G.emit(Kt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Je=t.findNearestElement(U[0],U[1],!0,!0);(!t.touchData.cxtOver||Je!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:T,type:"cxtdragout",position:{x:U[0],y:U[1]}}),t.touchData.cxtOver=Je,Je&&Je.emit({originalEvent:T,type:"cxtdragover",position:{x:U[0],y:U[1]}}))}else if(R&&T.touches[2]&&G.boxSelectionEnabled())T.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||G.emit({originalEvent:T,type:"boxstart",position:{x:U[0],y:U[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,Q[4]=1,!Q||Q.length===0||Q[0]===void 0?(Q[0]=(U[0]+U[2]+U[4])/3,Q[1]=(U[1]+U[3]+U[5])/3,Q[2]=(U[0]+U[2]+U[4])/3+1,Q[3]=(U[1]+U[3]+U[5])/3+1):(Q[2]=(U[0]+U[2]+U[4])/3,Q[3]=(U[1]+U[3]+U[5])/3),t.redrawHint("select",!0),t.redraw();else if(R&&T.touches[1]&&!t.touchData.didSelect&&G.zoomingEnabled()&&G.panningEnabled()&&G.userZoomingEnabled()&&G.userPanningEnabled()){T.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var at=t.dragData.touchDragEles;if(at){t.redrawHint("drag",!0);for(var vt=0;vt<at.length;vt++){var mr=at[vt]._private;mr.grabbed=!1,mr.rscratch.inDragLayer=!1}}var q=t.touchData.start,rt=T.touches[0].clientX-z,Qe=T.touches[0].clientY-j,Pt=T.touches[1].clientX-z,dt=T.touches[1].clientY-j,ce=ne(rt,Qe,Pt,dt),Pe=ce/L;if(X){var He=rt-P,Dn=Qe-F,yr=Pt-O,za=dt-M,Un=(He+yr)/2,an=(Dn+za)/2,br=G.zoom(),jc=br*Pe,_s=G.pan(),Bg=$[0]*br+_s.x,Ng=$[1]*br+_s.y,eO={x:-jc/br*(Bg-_s.x-Un)+Bg,y:-jc/br*(Ng-_s.y-an)+Ng};if(q&&q.active()){var at=t.dragData.touchDragEles;y(at),t.redrawHint("drag",!0),t.redrawHint("eles",!0),q.unactivate().emit("freeon"),at.emit("free"),t.dragData.didDrag&&(q.emit("dragfreeon"),at.emit("dragfree"))}G.viewport({zoom:jc,pan:eO,cancelOnFailedZoom:!0}),G.emit("pinchzoom"),L=ce,P=rt,F=Qe,O=Pt,M=dt,t.pinching=!0}if(T.touches[0]){var ae=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);U[0]=ae[0],U[1]=ae[1]}if(T.touches[1]){var ae=t.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);U[2]=ae[0],U[3]=ae[1]}if(T.touches[2]){var ae=t.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);U[4]=ae[0],U[5]=ae[1]}}else if(T.touches[0]&&!t.touchData.didSelect){var gn=t.touchData.start,Yc=t.touchData.last,Je;if(!t.hoverData.draggingEles&&!t.swipePanning&&(Je=t.findNearestElement(U[0],U[1],!0,!0)),R&&gn!=null&&T.preventDefault(),R&&gn!=null&&t.nodeIsDraggable(gn))if(Ce){var at=t.dragData.touchDragEles,Dg=!t.dragData.didDrag;Dg&&p(at,{inDragLayer:!0}),t.dragData.didDrag=!0;var Zi={x:0,y:0};if(le(ge[0])&&le(ge[1])&&(Zi.x+=ge[0],Zi.y+=ge[1],Dg)){t.redrawHint("eles",!0);var mn=t.touchData.dragDelta;mn&&le(mn[0])&&le(mn[1])&&(Zi.x+=mn[0],Zi.y+=mn[1])}t.hoverData.draggingEles=!0,at.silentShift(Zi).emit("position drag"),t.redrawHint("drag",!0),t.touchData.startPosition[0]==ie[0]&&t.touchData.startPosition[1]==ie[1]&&t.redrawHint("eles",!0),t.redraw()}else{var mn=t.touchData.dragDelta=t.touchData.dragDelta||[];mn.length===0?(mn.push(ge[0]),mn.push(ge[1])):(mn[0]+=ge[0],mn[1]+=ge[1])}if(r(gn||Je,["touchmove","tapdrag","vmousemove"],T,{x:U[0],y:U[1]}),(!gn||!gn.grabbed())&&Je!=Yc&&(Yc&&Yc.emit({originalEvent:T,type:"tapdragout",position:{x:U[0],y:U[1]}}),Je&&Je.emit({originalEvent:T,type:"tapdragover",position:{x:U[0],y:U[1]}})),t.touchData.last=Je,R)for(var vt=0;vt<U.length;vt++)U[vt]&&t.touchData.startPosition[vt]&&Ce&&(t.touchData.singleTouchMoved=!0);if(R&&(gn==null||gn.pannable())&&G.panningEnabled()&&G.userPanningEnabled()){var tO=i(gn,t.touchData.starts);tO&&(T.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=ma(t.touchData.startPosition)),t.swipePanning?(G.panBy({x:ge[0]*Z,y:ge[1]*Z}),G.emit("dragpan")):Ce&&(t.swipePanning=!0,G.panBy({x:ve*Z,y:Ge*Z}),G.emit("dragpan"),gn&&(gn.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var ae=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);U[0]=ae[0],U[1]=ae[1]}}for(var Se=0;Se<U.length;Se++)ie[Se]=U[Se];R&&T.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var W;t.registerBinding(e,"touchcancel",W=function(T){var R=t.touchData.start;t.touchData.capture=!1,R&&R.unactivate()});var oe,he,re,se;if(t.registerBinding(e,"touchend",oe=function(T){var R=t.touchData.start,Q=t.touchData.capture;if(Q)T.touches.length===0&&(t.touchData.capture=!1),T.preventDefault();else return;var G=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var U=t.cy,ie=U.zoom(),Z=t.touchData.now,ae=t.touchData.earlier;if(T.touches[0]){var we=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);Z[0]=we[0],Z[1]=we[1]}if(T.touches[1]){var we=t.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);Z[2]=we[0],Z[3]=we[1]}if(T.touches[2]){var we=t.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);Z[4]=we[0],Z[5]=we[1]}R&&R.unactivate();var Ce;if(t.touchData.cxt){if(Ce={originalEvent:T,type:"cxttapend",position:{x:Z[0],y:Z[1]}},R?R.emit(Ce):U.emit(Ce),!t.touchData.cxtDragged){var ge={originalEvent:T,type:"cxttap",position:{x:Z[0],y:Z[1]}};R?R.emit(ge):U.emit(ge)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!T.touches[2]&&U.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Se=U.collection(t.getAllInBox(G[0],G[1],G[2],G[3]));G[0]=void 0,G[1]=void 0,G[2]=void 0,G[3]=void 0,G[4]=0,t.redrawHint("select",!0),U.emit({type:"boxend",originalEvent:T,position:{x:Z[0],y:Z[1]}});var ve=function(It){return It.selectable()&&!It.selected()};Se.emit("box").stdFilter(ve).select().emit("boxselect"),Se.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(R!=null&&R.unactivate(),T.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!T.touches[1]){if(!T.touches[0]){if(!T.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var ye=t.dragData.touchDragEles;if(R!=null){var Ge=R._private.grabbed;y(ye),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Ge&&(R.emit("freeon"),ye.emit("free"),t.dragData.didDrag&&(R.emit("dragfreeon"),ye.emit("dragfree"))),r(R,["touchend","tapend","vmouseup","tapdragout"],T,{x:Z[0],y:Z[1]}),R.unactivate(),t.touchData.start=null}else{var $e=t.findNearestElement(Z[0],Z[1],!0,!0);r($e,["touchend","tapend","vmouseup","tapdragout"],T,{x:Z[0],y:Z[1]})}var nt=t.touchData.startPosition[0]-Z[0],rt=nt*nt,Qe=t.touchData.startPosition[1]-Z[1],Pt=Qe*Qe,dt=rt+Pt,pt=dt*ie*ie;t.touchData.singleTouchMoved||(R||U.$(":selected").unselect(["tapunselect"]),r(R,["tap","vclick"],T,{x:Z[0],y:Z[1]}),he=!1,T.timeStamp-se<=U.multiClickDebounceTime()?(re&&clearTimeout(re),he=!0,se=null,r(R,["dbltap","vdblclick"],T,{x:Z[0],y:Z[1]})):(re=setTimeout(function(){he||r(R,["onetap","voneclick"],T,{x:Z[0],y:Z[1]})},U.multiClickDebounceTime()),se=T.timeStamp)),R!=null&&!t.dragData.didDrag&&R._private.selectable&&pt<t.touchTapThreshold2&&!t.pinching&&(U.selectionType()==="single"?(U.$(n).unmerge(R).unselect(["tapunselect"]),R.select(["tapselect"])):R.selected()?R.unselect(["tapunselect"]):R.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var Wt=0;Wt<Z.length;Wt++)ae[Wt]=Z[Wt];t.dragData.didDrag=!1,T.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),T.touches.length<2&&(T.touches.length===1&&(t.touchData.startGPosition=[T.touches[0].clientX,T.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var ue=[],pe=function(T){return{clientX:T.clientX,clientY:T.clientY,force:1,identifier:T.pointerId,pageX:T.pageX,pageY:T.pageY,radiusX:T.width/2,radiusY:T.height/2,screenX:T.screenX,screenY:T.screenY,target:T.target}},de=function(T){return{event:T,touch:pe(T)}},me=function(T){ue.push(de(T))},Ne=function(T){for(var R=0;R<ue.length;R++){var Q=ue[R];if(Q.event.pointerId===T.pointerId){ue.splice(R,1);return}}},De=function(T){var R=ue.filter(function(Q){return Q.event.pointerId===T.pointerId})[0];R.event=T,R.touch=pe(T)},Ee=function(T){T.touches=ue.map(function(R){return R.touch})},_e=function(T){return T.pointerType==="mouse"||T.pointerType===4};t.registerBinding(t.container,"pointerdown",function(te){_e(te)||(te.preventDefault(),me(te),Ee(te),A(te))}),t.registerBinding(t.container,"pointerup",function(te){_e(te)||(Ne(te),Ee(te),oe(te))}),t.registerBinding(t.container,"pointercancel",function(te){_e(te)||(Ne(te),Ee(te),W(te))}),t.registerBinding(t.container,"pointermove",function(te){_e(te)||(te.preventDefault(),De(te),Ee(te),K(te))})}};var Kn={};Kn.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(r,a,i,s,l,u){this.renderer.nodeShapeImpl("polygon",r,a,i,s,l,this.points)},intersectLine:function(r,a,i,s,l,u,c,d){return _i(l,u,this.points,r,a,i/2,s/2,c)},checkPoint:function(r,a,i,s,l,u,c,d){return $n(r,a,this.points,u,c,s,l,[0,-1],i)}}},Kn.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i)},intersectLine:function(e,n,r,a,i,s,l,u){return WT(i,s,e,n,r/2+l,a/2+l)},checkPoint:function(e,n,r,a,i,s,l,u){return Vr(e,n,a,i,s,l,r)}}},Kn.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(r,a,i,s,l,u,c){if(u[c]!==void 0&&u[c+"-cx"]===r&&u[c+"-cy"]===a)return u[c];u[c]=new Array(e.length/2),u[c+"-cx"]=r,u[c+"-cy"]=a;var d=i/2,f=s/2;l=l==="auto"?xh(i,s):l;for(var h=new Array(e.length/2),v=0;v<e.length/2;v++)h[v]={x:r+d*e[v*2],y:a+f*e[v*2+1]};var p,g,y,m,b=h.length;for(g=h[b-1],p=0;p<b;p++)y=h[p%b],m=h[(p+1)%b],u[c][p]=_c(g,y,m,l),g=y,y=m;return u[c]},draw:function(r,a,i,s,l,u,c){this.renderer.nodeShapeImpl("round-polygon",r,a,i,s,l,this.points,this.getOrCreateCorners(a,i,s,l,u,c,"drawCorners"))},intersectLine:function(r,a,i,s,l,u,c,d,f){return jT(l,u,this.points,r,a,i,s,c,this.getOrCreateCorners(r,a,i,s,d,f,"corners"))},checkPoint:function(r,a,i,s,l,u,c,d,f){return GT(r,a,this.points,u,c,s,l,this.getOrCreateCorners(u,c,s,l,d,f,"corners"))}}},Kn.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Mt(4,0),draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i,this.points,s)},intersectLine:function(e,n,r,a,i,s,l,u){return Ch(i,s,e,n,r,a,l,u)},checkPoint:function(e,n,r,a,i,s,l,u){var c=a/2,d=i/2;u=u==="auto"?Rr(a,i):u,u=Math.min(c,d,u);var f=u*2;return!!($n(e,n,this.points,s,l,a,i-f,[0,-1],r)||$n(e,n,this.points,s,l,a-f,i,[0,-1],r)||Vr(e,n,f,f,s-c+u,l-d+u,r)||Vr(e,n,f,f,s+c-u,l-d+u,r)||Vr(e,n,f,f,s+c-u,l+d-u,r)||Vr(e,n,f,f,s-c+u,l+d-u,r))}}},Kn.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:tc(),points:Mt(4,0),draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i,null,s)},generateCutTrianglePts:function(e,n,r,a,i){var s=i==="auto"?this.cornerLength:i,l=n/2,u=e/2,c=r-u,d=r+u,f=a-l,h=a+l;return{topLeft:[c,f+s,c+s,f,c+s,f+s],topRight:[d-s,f,d,f+s,d-s,f+s],bottomRight:[d,h-s,d-s,h,d-s,h-s],bottomLeft:[c+s,h,c,h-s,c+s,h-s]}},intersectLine:function(e,n,r,a,i,s,l,u){var c=this.generateCutTrianglePts(r+2*l,a+2*l,e,n,u),d=[].concat.apply([],[c.topLeft.splice(0,4),c.topRight.splice(0,4),c.bottomRight.splice(0,4),c.bottomLeft.splice(0,4)]);return _i(i,s,d,e,n)},checkPoint:function(e,n,r,a,i,s,l,u){var c=u==="auto"?this.cornerLength:u;if($n(e,n,this.points,s,l,a,i-2*c,[0,-1],r)||$n(e,n,this.points,s,l,a-2*c,i,[0,-1],r))return!0;var d=this.generateCutTrianglePts(a,i,s,l);return Ht(e,n,d.topLeft)||Ht(e,n,d.topRight)||Ht(e,n,d.bottomRight)||Ht(e,n,d.bottomLeft)}}},Kn.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Mt(4,0),draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i)},intersectLine:function(e,n,r,a,i,s,l,u){var c=.15,d=.5,f=.85,h=this.generateBarrelBezierPts(r+2*l,a+2*l,e,n),v=function(y){var m=ya({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},c),b=ya({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},d),w=ya({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},f);return[y[0],y[1],m.x,m.y,b.x,b.y,w.x,w.y,y[4],y[5]]},p=[].concat(v(h.topLeft),v(h.topRight),v(h.bottomRight),v(h.bottomLeft));return _i(i,s,p,e,n)},generateBarrelBezierPts:function(e,n,r,a){var i=n/2,s=e/2,l=r-s,u=r+s,c=a-i,d=a+i,f=nc(e,n),h=f.heightOffset,v=f.widthOffset,p=f.ctrlPtOffsetPct*e,g={topLeft:[l,c+h,l+p,c,l+v,c],topRight:[u-v,c,u-p,c,u,c+h],bottomRight:[u,d-h,u-p,d,u-v,d],bottomLeft:[l+v,d,l+p,d,l,d-h]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g},checkPoint:function(e,n,r,a,i,s,l,u){var c=nc(a,i),d=c.heightOffset,f=c.widthOffset;if($n(e,n,this.points,s,l,a,i-2*d,[0,-1],r)||$n(e,n,this.points,s,l,a-2*f,i,[0,-1],r))return!0;for(var h=this.generateBarrelBezierPts(a,i,s,l),v=function(B,S,N){var D=N[4],_=N[2],I=N[0],P=N[5],F=N[1],O=Math.min(D,I),M=Math.max(D,I),L=Math.min(P,F),V=Math.max(P,F);if(O<=B&&B<=M&&L<=S&&S<=V){var H=YT(D,_,I),$=HT(H[0],H[1],H[2],B),z=$.filter(function(j){return 0<=j&&j<=1});if(z.length>0)return z[0]}return null},p=Object.keys(h),g=0;g<p.length;g++){var y=p[g],m=h[y],b=v(e,n,m);if(b!=null){var w=m[5],C=m[3],k=m[1],E=ht(w,C,k,b);if(m.isTop&&E<=n||m.isBottom&&n<=E)return!0}}return!1}}},Kn.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Mt(4,0),draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i,this.points,s)},intersectLine:function(e,n,r,a,i,s,l,u){var c=e-(r/2+l),d=n-(a/2+l),f=d,h=e+(r/2+l),v=lr(i,s,e,n,c,d,h,f,!1);return v.length>0?v:Ch(i,s,e,n,r,a,l,u)},checkPoint:function(e,n,r,a,i,s,l,u){u=u==="auto"?Rr(a,i):u;var c=2*u;if($n(e,n,this.points,s,l,a,i-c,[0,-1],r)||$n(e,n,this.points,s,l,a-c,i,[0,-1],r))return!0;var d=a/2+2*r,f=i/2+2*r,h=[s-d,l-f,s-d,l,s+d,l,s+d,l-f];return!!(Ht(e,n,h)||Vr(e,n,c,c,s+a/2-u,l+i/2-u,r)||Vr(e,n,c,c,s-a/2+u,l+i/2-u,r))}}},Kn.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Mt(3,0)),this.generateRoundPolygon("round-triangle",Mt(3,0)),this.generatePolygon("rectangle",Mt(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n)}this.generatePolygon("pentagon",Mt(5,0)),this.generateRoundPolygon("round-pentagon",Mt(5,0)),this.generatePolygon("hexagon",Mt(6,0)),this.generateRoundPolygon("round-hexagon",Mt(6,0)),this.generatePolygon("heptagon",Mt(7,0)),this.generateRoundPolygon("round-heptagon",Mt(7,0)),this.generatePolygon("octagon",Mt(8,0)),this.generateRoundPolygon("round-octagon",Mt(8,0));var r=new Array(20);{var a=ec(5,0),i=ec(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var l=0;l<i.length/2;l++)i[l*2]*=s,i[l*2+1]*=s;for(var l=0;l<20/4;l++)r[l*4]=a[l*2],r[l*4+1]=a[l*2+1],r[l*4+2]=i[l*2],r[l*4+3]=i[l*2+1]}r=kh(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u)}t.makePolygon=function(c){var d=c.join("$"),f="polygon-"+d,h;return(h=this[f])?h:e.generatePolygon(f,c)}};var Ui={};Ui.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},Ui.redraw=function(t){t=t||ph();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t},Ui.beforeRender=function(t,e){if(!this.destroyed){e==null&&Ze("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:t,priority:e}),n.sort(function(r,a){return a.priority-r.priority})}};var vv=function(e,n,r){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(n,r)};Ui.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var n=function r(a){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){vv(t,!0,a);var i=Rn();t.render(t.renderOptions);var s=t.lastDrawTime=Rn();t.averageRedrawTime===void 0&&(t.averageRedrawTime=s-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var l=s-i;t.redrawTotalTime+=l,t.lastRedrawTime=l,t.averageRedrawTime=t.averageRedrawTime/2+l/2,t.requestedFrame=!1}else vv(t,!1,a);t.skipFrame=!1,Vo(r)}};Vo(n)}};var _4=function(e){this.init(e)},gv=_4,Aa=gv.prototype;Aa.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],Aa.init=function(t){var e=this;e.options=t,e.cy=t.cy;var n=e.container=t.cy.container(),r=e.cy.window();if(r){var a=r.document,i=a.head,s="__________cytoscape_stylesheet",l="__________cytoscape_container",u=a.getElementById(s)!=null;if(n.className.indexOf(l)<0&&(n.className=(n.className||"")+" "+l),!u){var c=a.createElement("style");c.id=s,c.textContent="."+l+" { position: relative; }",i.insertBefore(c,i.children[0])}var d=r.getComputedStyle(n),f=d.getPropertyValue("position");f==="static"&&Ve("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=le(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()},Aa.notify=function(t,e){var n=this,r=n.cy;if(!this.destroyed){if(t==="init"){n.load();return}if(t==="destroy"){n.destroy();return}(t==="add"||t==="remove"||t==="move"&&r.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&n.invalidateCachedZSortedEles(),t==="viewport"&&n.redrawHint("select",!0),(t==="load"||t==="resize"||t==="mount")&&(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},Aa.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var n=t.bindings[e],r=n,a=r.target;(a.off||a.removeEventListener).apply(a,r.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}},Aa.isHeadless=function(){return!1},[Sc,hv,pv,Fa,Kn,Ui].forEach(function(t){xe(Aa,t)});var Oc=1e3/60,mv={setupDequeueing:function(e){return function(){var r=this,a=this.renderer;if(!r.dequeueingSetup){r.dequeueingSetup=!0;var i=Ao(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),s=function(c,d){var f=Rn(),h=a.averageRedrawTime,v=a.lastRedrawTime,p=[],g=a.cy.extent(),y=a.getPixelRatio();for(c||a.flushRenderedStyleQueue();;){var m=Rn(),b=m-f,w=m-d;if(v<Oc){var C=Oc-(c?h:0);if(w>=e.deqFastCost*C)break}else if(c){if(b>=e.deqCost*v||b>=e.deqAvgCost*h)break}else if(w>=e.deqNoDrawCost*Oc)break;var k=e.deq(r,y,g);if(k.length>0)for(var E=0;E<k.length;E++)p.push(k[E]);else break}p.length>0&&(e.onDeqd(r,p),!c&&e.shouldRedraw(r,p,y,g)&&i())},l=e.priority||jl;a.beforeRender(s,l(r))}}}},P4=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$o;zl(this,t),this.idsByKey=new xn,this.keyForId=new xn,this.cachesByLvl=new xn,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=n}return Hl(t,[{key:"getIdsFor",value:function(n){n==null&&Ze("Can not get id list for null key");var r=this.idsByKey,a=this.idsByKey.get(n);return a||(a=new ga,r.set(n,a)),a}},{key:"addIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).add(r)}},{key:"deleteIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).delete(r)}},{key:"getNumberOfIdsForKey",value:function(n){return n==null?0:this.getIdsFor(n).size}},{key:"updateKeyMappingFor",value:function(n){var r=n.id(),a=this.keyForId.get(r),i=this.getKey(n);this.deleteIdForKey(a,r),this.addIdForKey(i,r),this.keyForId.set(r,i)}},{key:"deleteKeyMappingFor",value:function(n){var r=n.id(),a=this.keyForId.get(r);this.deleteIdForKey(a,r),this.keyForId.delete(r)}},{key:"keyHasChangedFor",value:function(n){var r=n.id(),a=this.keyForId.get(r),i=this.getKey(n);return a!==i}},{key:"isInvalid",value:function(n){return this.keyHasChangedFor(n)||this.doesEleInvalidateKey(n)}},{key:"getCachesAt",value:function(n){var r=this.cachesByLvl,a=this.lvls,i=r.get(n);return i||(i=new xn,r.set(n,i),a.push(n)),i}},{key:"getCache",value:function(n,r){return this.getCachesAt(r).get(n)}},{key:"get",value:function(n,r){var a=this.getKey(n),i=this.getCache(a,r);return i!=null&&this.updateKeyMappingFor(n),i}},{key:"getForCachedKey",value:function(n,r){var a=this.keyForId.get(n.id()),i=this.getCache(a,r);return i}},{key:"hasCache",value:function(n,r){return this.getCachesAt(r).has(n)}},{key:"has",value:function(n,r){var a=this.getKey(n);return this.hasCache(a,r)}},{key:"setCache",value:function(n,r,a){a.key=n,this.getCachesAt(r).set(n,a)}},{key:"set",value:function(n,r,a){var i=this.getKey(n);this.setCache(i,r,a),this.updateKeyMappingFor(n)}},{key:"deleteCache",value:function(n,r){this.getCachesAt(r).delete(n)}},{key:"delete",value:function(n,r){var a=this.getKey(n);this.deleteCache(a,r)}},{key:"invalidateKey",value:function(n){var r=this;this.lvls.forEach(function(a){return r.deleteCache(n,a)})}},{key:"invalidate",value:function(n){var r=n.id(),a=this.keyForId.get(r);this.deleteKeyMappingFor(n);var i=this.doesEleInvalidateKey(n);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}]),t}(),yv=25,Bs=50,Ns=-4,Ic=3,O4=7.99,I4=8,L4=1024,M4=1024,F4=1024,A4=.2,V4=.8,R4=10,$4=.15,z4=.1,H4=.9,K4=.9,q4=100,U4=1,Va={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},G4=wt({getKey:null,doesEleInvalidateKey:$o,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:uh,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Gi=function(e,n){var r=this;r.renderer=e,r.onDequeues=[];var a=G4(n);xe(r,a),r.lookup=new P4(a.getKey,a.doesEleInvalidateKey),r.setupDequeueing()},ut=Gi.prototype;ut.reasons=Va,ut.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},ut.getRetiredTextureQueue=function(t){var e=this,n=e.eleImgCaches.retired=e.eleImgCaches.retired||{},r=n[t]=n[t]||[];return r},ut.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Bi(function(n,r){return r.reqs-n.reqs});return e},ut.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},ut.getElement=function(t,e,n,r,a){var i=this,s=this.renderer,l=s.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(r==null&&(r=Math.ceil(Xl(l*n))),r<Ns)r=Ns;else if(l>=O4||r>Ic)return null;var c=Math.pow(2,r),d=e.h*c,f=e.w*c,h=s.eleTextBiggerThanMin(t,c);if(!this.isVisible(t,h))return null;var v=u.get(t,r);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;var p;if(d<=yv?p=yv:d<=Bs?p=Bs:p=Math.ceil(d/Bs)*Bs,d>F4||f>M4)return null;var g=i.getTextureQueue(p),y=g[g.length-2],m=function(){return i.recycleTexture(p,f)||i.addTexture(p,f)};y||(y=g[g.length-1]),y||(y=m()),y.width-y.usedWidth<f&&(y=m());for(var b=function(O){return O&&O.scaledLabelShown===h},w=a&&a===Va.dequeue,C=a&&a===Va.highQuality,k=a&&a===Va.downscale,E,x=r+1;x<=Ic;x++){var B=u.get(t,x);if(B){E=B;break}}var S=E&&E.level===r+1?E:null,N=function(){y.context.drawImage(S.texture.canvas,S.x,0,S.width,S.height,y.usedWidth,0,f,d)};if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,f,p),b(S))N();else if(b(E))if(C){for(var D=E.level;D>r;D--)S=i.getElement(t,e,n,D,Va.downscale);N()}else return i.queueElement(t,E.level-1),E;else{var _;if(!w&&!C&&!k)for(var I=r-1;I>=Ns;I--){var P=u.get(t,I);if(P){_=P;break}}if(b(_))return i.queueElement(t,r),_;y.context.translate(y.usedWidth,0),y.context.scale(c,c),this.drawElement(y.context,t,e,h,!1),y.context.scale(1/c,1/c),y.context.translate(-y.usedWidth,0)}return v={x:y.usedWidth,texture:y,level:r,scale:c,width:f,height:d,scaledLabelShown:h},y.usedWidth+=Math.ceil(f+I4),y.eleCaches.push(v),u.set(t,r,v),i.checkTextureFullness(y),v},ut.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])},ut.invalidateElement=function(t){var e=this,n=e.lookup,r=[],a=n.isInvalid(t);if(a){for(var i=Ns;i<=Ic;i++){var s=n.getForCachedKey(t,i);s&&r.push(s)}var l=n.invalidate(t);if(l)for(var u=0;u<r.length;u++){var c=r[u],d=c.texture;d.invalidatedWidth+=c.width,c.invalidated=!0,e.checkTextureUtility(d)}e.removeFromQueue(t)}},ut.checkTextureUtility=function(t){t.invalidatedWidth>=A4*t.width&&this.retireTexture(t)},ut.checkTextureFullness=function(t){var e=this,n=e.getTextureQueue(t.height);t.usedWidth/t.width>V4&&t.fullnessChecks>=R4?or(n,t):t.fullnessChecks++},ut.retireTexture=function(t){var e=this,n=t.height,r=e.getTextureQueue(n),a=this.lookup;or(r,t),t.retired=!0;for(var i=t.eleCaches,s=0;s<i.length;s++){var l=i[s];a.deleteCache(l.key,l.level)}Yl(i);var u=e.getRetiredTextureQueue(n);u.push(t)},ut.addTexture=function(t,e){var n=this,r=n.getTextureQueue(t),a={};return r.push(a),a.eleCaches=[],a.height=t,a.width=Math.max(L4,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=n.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a},ut.recycleTexture=function(t,e){for(var n=this,r=n.getTextureQueue(t),a=n.getRetiredTextureQueue(t),i=0;i<a.length;i++){var s=a[i];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,Yl(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),or(a,s),r.push(s),s}},ut.queueElement=function(t,e){var n=this,r=n.getElementQueue(),a=n.getElementKeyToQueue(),i=this.getKey(t),s=a[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,r.updateItem(s);else{var l={eles:t.spawn().merge(t),level:e,reqs:1,key:i};r.push(l),a[i]=l}},ut.dequeue=function(t){for(var e=this,n=e.getElementQueue(),r=e.getElementKeyToQueue(),a=[],i=e.lookup,s=0;s<U4&&n.size()>0;s++){var l=n.pop(),u=l.key,c=l.eles[0],d=i.hasCache(c,l.level);if(r[u]=null,d)continue;a.push(l);var f=e.getBoundingBox(c);e.getElement(c,f,t,l.level,Va.dequeue)}return a},ut.removeFromQueue=function(t){var e=this,n=e.getElementQueue(),r=e.getElementKeyToQueue(),a=this.getKey(t),i=r[a];i!=null&&(i.eles.length===1?(i.reqs=Wl,n.updateItem(i),n.pop(),r[a]=null):i.eles.unmerge(t))},ut.onDequeue=function(t){this.onDequeues.push(t)},ut.offDequeue=function(t){or(this.onDequeues,t)},ut.setupDequeueing=mv.setupDequeueing({deqRedrawThreshold:q4,deqCost:$4,deqAvgCost:z4,deqNoDrawCost:H4,deqFastCost:K4,deq:function(e,n,r){return e.dequeue(n,r)},onDeqd:function(e,n){for(var r=0;r<e.onDequeues.length;r++){var a=e.onDequeues[r];a(n)}},shouldRedraw:function(e,n,r,a){for(var i=0;i<n.length;i++)for(var s=n[i].eles,l=0;l<s.length;l++){var u=s[l].boundingBox();if(Ql(u,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var W4=1,Wi=-4,Ds=2,j4=3.99,Y4=50,Z4=50,X4=.15,Q4=.1,J4=.9,e_=.9,t_=1,bv=250,n_=4e3*4e3,r_=!0,wv=function(e){var n=this,r=n.renderer=e,a=r.cy;n.layersByLevel={},n.firstGet=!0,n.lastInvalidationTime=Rn()-2*bv,n.skipping=!1,n.eleTxrDeqs=a.collection(),n.scheduleElementRefinement=Ao(function(){n.refineElementTextures(n.eleTxrDeqs),n.eleTxrDeqs.unmerge(n.eleTxrDeqs)},Z4),r.beforeRender(function(s,l){l-n.lastInvalidationTime<=bv?n.skipping=!0:n.skipping=!1},r.beforeRenderPriorities.lyrTxrSkip);var i=function(l,u){return u.reqs-l.reqs};n.layersQueue=new Bi(i),n.setupDequeueing()},Et=wv.prototype,Cv=0,a_=Math.pow(2,53)-1;Et.makeLayer=function(t,e){var n=Math.pow(2,e),r=Math.ceil(t.w*n),a=Math.ceil(t.h*n),i=this.renderer.makeOffscreenCanvas(r,a),s={id:Cv=++Cv%a_,bb:t,level:e,width:r,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},l=s.context,u=-s.bb.x1,c=-s.bb.y1;return l.scale(n,n),l.translate(u,c),s},Et.getLayers=function(t,e,n){var r=this,a=r.renderer,i=a.cy,s=i.zoom(),l=r.firstGet;if(r.firstGet=!1,n==null){if(n=Math.ceil(Xl(s*e)),n<Wi)n=Wi;else if(s>=j4||n>Ds)return null}r.validateLayersElesOrdering(n,t);var u=r.layersByLevel,c=Math.pow(2,n),d=u[n]=u[n]||[],f,h=r.levelIsComplete(n,t),v,p=function(){var N=function(F){if(r.validateLayersElesOrdering(F,t),r.levelIsComplete(F,t))return v=u[F],!0},D=function(F){if(!v)for(var O=n+F;Wi<=O&&O<=Ds&&!N(O);O+=F);};D(1),D(-1);for(var _=d.length-1;_>=0;_--){var I=d[_];I.invalid&&or(d,I)}};if(!h)p();else return d;var g=function(){if(!f){f=zt();for(var N=0;N<t.length;N++)yh(f,t[N].boundingBox())}return f},y=function(N){N=N||{};var D=N.after;g();var _=f.w*c*(f.h*c);if(_>n_)return null;var I=r.makeLayer(f,n);if(D!=null){var P=d.indexOf(D)+1;d.splice(P,0,I)}else(N.insert===void 0||N.insert)&&d.unshift(I);return I};if(r.skipping&&!l)return null;for(var m=null,b=t.length/W4,w=!l,C=0;C<t.length;C++){var k=t[C],E=k._private.rscratch,x=E.imgLayerCaches=E.imgLayerCaches||{},B=x[n];if(B){m=B;continue}if((!m||m.eles.length>=b||!wh(m.bb,k.boundingBox()))&&(m=y({insert:!0,after:m}),!m))return null;v||w?r.queueLayer(m,k):r.drawEleInLayer(m,k,n,e),m.eles.push(k),x[n]=m}return v||(w?null:d)},Et.getEleLevelForLayerLevel=function(t,e){return t},Et.drawEleInLayer=function(t,e,n,r){var a=this,i=this.renderer,s=t.context,l=e.boundingBox();l.w===0||l.h===0||!e.visible()||(n=a.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,n,r_),i.setImgSmoothing(s,!0))},Et.levelIsComplete=function(t,e){var n=this,r=n.layersByLevel[t];if(!r||r.length===0)return!1;for(var a=0,i=0;i<r.length;i++){var s=r[i];if(s.reqs>0||s.invalid)return!1;a+=s.eles.length}return a===e.length},Et.validateLayersElesOrdering=function(t,e){var n=this.layersByLevel[t];if(n)for(var r=0;r<n.length;r++){for(var a=n[r],i=-1,s=0;s<e.length;s++)if(a.eles[0]===e[s]){i=s;break}if(i<0){this.invalidateLayer(a);continue}for(var l=i,s=0;s<a.eles.length;s++)if(a.eles[s]!==e[l+s]){this.invalidateLayer(a);break}}},Et.updateElementsInLayers=function(t,e){for(var n=this,r=yi(t[0]),a=0;a<t.length;a++)for(var i=r?null:t[a],s=r?t[a]:t[a].ele,l=s._private.rscratch,u=l.imgLayerCaches=l.imgLayerCaches||{},c=Wi;c<=Ds;c++){var d=u[c];d&&(i&&n.getEleLevelForLayerLevel(d.level)!==i.level||e(d,s,i))}},Et.haveLayers=function(){for(var t=this,e=!1,n=Wi;n<=Ds;n++){var r=t.layersByLevel[n];if(r&&r.length>0){e=!0;break}}return e},Et.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Rn(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(r,a,i){e.invalidateLayer(r)}))},Et.invalidateLayer=function(t){if(this.lastInvalidationTime=Rn(),!t.invalid){var e=t.level,n=t.eles,r=this.layersByLevel[e];or(r,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var a=0;a<n.length;a++){var i=n[a]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}},Et.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(r,a,i){var s=r.replacement;if(s||(s=r.replacement=e.makeLayer(r.bb,r.level),s.replaces=r,s.eles=r.eles),!s.reqs)for(var l=0;l<s.eles.length;l++)e.queueLayer(s,s.eles[l])})},Et.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()},Et.queueLayer=function(t,e){var n=this,r=n.layersQueue,a=t.elesQueue,i=a.hasId=a.hasId||{};if(!t.replacement){if(e){if(i[e.id()])return;a.push(e),i[e.id()]=!0}t.reqs?(t.reqs++,r.updateItem(t)):(t.reqs=1,r.push(t))}},Et.dequeue=function(t){for(var e=this,n=e.layersQueue,r=[],a=0;a<t_&&n.size()!==0;){var i=n.peek();if(i.replacement){n.pop();continue}if(i.replaces&&i!==i.replaces.replacement){n.pop();continue}if(i.invalid){n.pop();continue}var s=i.elesQueue.shift();s&&(e.drawEleInLayer(i,s,i.level,t),a++),r.length===0&&r.push(!0),i.elesQueue.length===0&&(n.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return r},Et.applyLayerReplacement=function(t){var e=this,n=e.layersByLevel[t.level],r=t.replaces,a=n.indexOf(r);if(!(a<0||r.invalid)){n[a]=t;for(var i=0;i<t.eles.length;i++){var s=t.eles[i]._private,l=s.imgLayerCaches=s.imgLayerCaches||{};l&&(l[t.level]=t)}e.requestRedraw()}},Et.requestRedraw=Ao(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100),Et.setupDequeueing=mv.setupDequeueing({deqRedrawThreshold:Y4,deqCost:X4,deqAvgCost:Q4,deqNoDrawCost:J4,deqFastCost:e_,deq:function(e,n){return e.dequeue(n)},onDeqd:jl,shouldRedraw:uh,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var kv={},xv;function i_(t,e){for(var n=0;n<e.length;n++){var r=e[n];t.lineTo(r.x,r.y)}}function o_(t,e,n){for(var r,a=0;a<e.length;a++){var i=e[a];a===0&&(r=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(n.x,n.y,r.x,r.y)}function Ev(t,e,n){t.beginPath&&t.beginPath();for(var r=e,a=0;a<r.length;a++){var i=r[a];t.lineTo(i.x,i.y)}var s=n,l=n[0];t.moveTo(l.x,l.y);for(var a=1;a<s.length;a++){var i=s[a];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}function s_(t,e,n,r,a){t.beginPath&&t.beginPath(),t.arc(n,r,a,0,Math.PI*2,!1);var i=e,s=i[0];t.moveTo(s.x,s.y);for(var l=0;l<i.length;l++){var u=i[l];t.lineTo(u.x,u.y)}t.closePath&&t.closePath()}function l_(t,e,n,r){t.arc(e,n,r,0,Math.PI*2,!1)}kv.arrowShapeImpl=function(t){return(xv||(xv={polygon:i_,"triangle-backcurve":o_,"triangle-tee":Ev,"circle-triangle":s_,"triangle-cross":Ev,circle:l_}))[t]};var Nn={};Nn.drawElement=function(t,e,n,r,a,i){var s=this;e.isNode()?s.drawNode(t,e,n,r,a,i):s.drawEdge(t,e,n,r,a,i)},Nn.drawElementOverlay=function(t,e){var n=this;e.isNode()?n.drawNodeOverlay(t,e):n.drawEdgeOverlay(t,e)},Nn.drawElementUnderlay=function(t,e){var n=this;e.isNode()?n.drawNodeUnderlay(t,e):n.drawEdgeUnderlay(t,e)},Nn.drawCachedElementPortion=function(t,e,n,r,a,i,s,l){var u=this,c=n.getBoundingBox(e);if(!(c.w===0||c.h===0)){var d=n.getElement(e,c,r,a,i);if(d!=null){var f=l(u,e);if(f===0)return;var h=s(u,e),v=c.x1,p=c.y1,g=c.w,y=c.h,m,b,w,C,k;if(h!==0){var E=n.getRotationPoint(e);w=E.x,C=E.y,t.translate(w,C),t.rotate(h),k=u.getImgSmoothing(t),k||u.setImgSmoothing(t,!0);var x=n.getRotationOffset(e);m=x.x,b=x.y}else m=v,b=p;var B;f!==1&&(B=t.globalAlpha,t.globalAlpha=B*f),t.drawImage(d.texture.canvas,d.x,0,d.width,d.height,m,b,g,y),f!==1&&(t.globalAlpha=B),h!==0&&(t.rotate(-h),t.translate(-w,-C),k||u.setImgSmoothing(t,!1))}else n.drawElement(t,e)}};var c_=function(){return 0},u_=function(e,n){return e.getTextAngle(n,null)},d_=function(e,n){return e.getTextAngle(n,"source")},f_=function(e,n){return e.getTextAngle(n,"target")},h_=function(e,n){return n.effectiveOpacity()},Lc=function(e,n){return n.pstyle("text-opacity").pfValue*n.effectiveOpacity()};Nn.drawCachedElement=function(t,e,n,r,a,i){var s=this,l=s.data,u=l.eleTxrCache,c=l.lblTxrCache,d=l.slbTxrCache,f=l.tlbTxrCache,h=e.boundingBox(),v=i===!0?u.reasons.highQuality:null;if(!(h.w===0||h.h===0||!e.visible())&&(!r||Ql(h,r))){var p=e.isEdge(),g=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,u,n,a,v,c_,h_),(!p||!g)&&s.drawCachedElementPortion(t,e,c,n,a,v,u_,Lc),p&&!g&&(s.drawCachedElementPortion(t,e,d,n,a,v,d_,Lc),s.drawCachedElementPortion(t,e,f,n,a,v,f_,Lc)),s.drawElementOverlay(t,e)}},Nn.drawElements=function(t,e){for(var n=this,r=0;r<e.length;r++){var a=e[r];n.drawElement(t,a)}},Nn.drawCachedElements=function(t,e,n,r){for(var a=this,i=0;i<e.length;i++){var s=e[i];a.drawCachedElement(t,s,n,r)}},Nn.drawCachedNodes=function(t,e,n,r){for(var a=this,i=0;i<e.length;i++){var s=e[i];s.isNode()&&a.drawCachedElement(t,s,n,r)}},Nn.drawLayeredElements=function(t,e,n,r){var a=this,i=a.data.lyrTxrCache.getLayers(e,n);if(i)for(var s=0;s<i.length;s++){var l=i[s],u=l.bb;u.w===0||u.h===0||t.drawImage(l.canvas,u.x1,u.y1,u.w,u.h)}else a.drawCachedElements(t,e,n,r)};var qn={};qn.drawEdge=function(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,l=e._private.rscratch;if(!(i&&!e.visible())&&!(l.badLine||l.allpts==null||isNaN(l.allpts[0]))){var u;n&&(u=n,t.translate(-u.x1,-u.y1));var c=i?e.pstyle("opacity").value:1,d=i?e.pstyle("line-opacity").value:1,f=e.pstyle("curve-style").value,h=e.pstyle("line-style").value,v=e.pstyle("width").pfValue,p=e.pstyle("line-cap").value,g=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,m=c*d,b=c*d,w=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;f==="straight-triangle"?(s.eleStrokeStyle(t,e,F),s.drawEdgeTrianglePath(e,t,l.allpts)):(t.lineWidth=v,t.lineCap=p,s.eleStrokeStyle(t,e,F),s.drawEdgePath(e,t,l.allpts,h),t.lineCap="butt")},C=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;if(t.lineWidth=v+g,t.lineCap=p,g>0)s.colorStrokeStyle(t,y[0],y[1],y[2],F);else{t.lineCap="butt";return}f==="straight-triangle"?s.drawEdgeTrianglePath(e,t,l.allpts):(s.drawEdgePath(e,t,l.allpts,h),t.lineCap="butt")},k=function(){a&&s.drawEdgeOverlay(t,e)},E=function(){a&&s.drawEdgeUnderlay(t,e)},x=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;s.drawArrowheads(t,e,F)},B=function(){s.drawElementText(t,e,null,r)};t.lineJoin="round";var S=e.pstyle("ghost").value==="yes";if(S){var N=e.pstyle("ghost-offset-x").pfValue,D=e.pstyle("ghost-offset-y").pfValue,_=e.pstyle("ghost-opacity").value,I=m*_;t.translate(N,D),w(I),x(I),t.translate(-N,-D)}else C();E(),w(),x(),k(),B(),n&&t.translate(u.x1,u.y1)}};var Sv=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(n,r){if(r.visible()){var a=r.pstyle("".concat(e,"-opacity")).value;if(a!==0){var i=this,s=i.usePaths(),l=r._private.rscratch,u=r.pstyle("".concat(e,"-padding")).pfValue,c=2*u,d=r.pstyle("".concat(e,"-color")).value;n.lineWidth=c,l.edgeType==="self"&&!s?n.lineCap="butt":n.lineCap="round",i.colorStrokeStyle(n,d[0],d[1],d[2],a),i.drawEdgePath(r,n,l.allpts,"solid")}}}};qn.drawEdgeOverlay=Sv("overlay"),qn.drawEdgeUnderlay=Sv("underlay"),qn.drawEdgePath=function(t,e,n,r){var a=t._private.rscratch,i=e,s,l=!1,u=this.usePaths(),c=t.pstyle("line-dash-pattern").pfValue,d=t.pstyle("line-dash-offset").pfValue;if(u){var f=n.join("$"),h=a.pathCacheKey&&a.pathCacheKey===f;h?(s=e=a.pathCache,l=!0):(s=e=new Path2D,a.pathCacheKey=f,a.pathCache=s)}if(i.setLineDash)switch(r){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(c),i.lineDashOffset=d;break;case"solid":i.setLineDash([]);break}if(!l&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var v=2;v+3<n.length;v+=4)e.quadraticCurveTo(n[v],n[v+1],n[v+2],n[v+3]);break;case"straight":case"haystack":for(var p=2;p+1<n.length;p+=2)e.lineTo(n[p],n[p+1]);break;case"segments":if(a.isRound){var g=qf(a.roundCorners),y;try{for(g.s();!(y=g.n()).done;){var m=y.value;ov(e,m)}}catch(w){g.e(w)}finally{g.f()}e.lineTo(n[n.length-2],n[n.length-1])}else for(var b=2;b+1<n.length;b+=2)e.lineTo(n[b],n[b+1]);break}e=i,u?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])},qn.drawEdgeTrianglePath=function(t,e,n){e.fillStyle=e.strokeStyle;for(var r=t.pstyle("width").pfValue,a=0;a+1<n.length;a+=2){var i=[n[a+2]-n[a],n[a+3]-n[a+1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),l=[i[1]/s,-i[0]/s],u=[l[0]*r/2,l[1]*r/2];e.beginPath(),e.moveTo(n[a]-u[0],n[a+1]-u[1]),e.lineTo(n[a]+u[0],n[a+1]+u[1]),e.lineTo(n[a+2],n[a+3]),e.closePath(),e.fill()}},qn.drawArrowheads=function(t,e,n){var r=e._private.rscratch,a=r.edgeType==="haystack";a||this.drawArrowhead(t,e,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(t,e,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(t,e,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),a||this.drawArrowhead(t,e,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},qn.drawArrowhead=function(t,e,n,r,a,i,s){if(!(isNaN(r)||r==null||isNaN(a)||a==null||isNaN(i)||i==null)){var l=this,u=e.pstyle(n+"-arrow-shape").value;if(u!=="none"){var c=e.pstyle(n+"-arrow-fill").value==="hollow"?"both":"filled",d=e.pstyle(n+"-arrow-fill").value,f=e.pstyle("width").pfValue,h=e.pstyle(n+"-arrow-width"),v=h.value==="match-line"?f:h.pfValue;h.units==="%"&&(v*=f);var p=e.pstyle("opacity").value;s===void 0&&(s=p);var g=t.globalCompositeOperation;(s!==1||d==="hollow")&&(t.globalCompositeOperation="destination-out",l.colorFillStyle(t,255,255,255,1),l.colorStrokeStyle(t,255,255,255,1),l.drawArrowShape(e,t,c,f,u,v,r,a,i),t.globalCompositeOperation=g);var y=e.pstyle(n+"-arrow-color").value;l.colorFillStyle(t,y[0],y[1],y[2],s),l.colorStrokeStyle(t,y[0],y[1],y[2],s),l.drawArrowShape(e,t,d,f,u,v,r,a,i)}}},qn.drawArrowShape=function(t,e,n,r,a,i,s,l,u){var c=this,d=this.usePaths()&&a!=="triangle-cross",f=!1,h,v=e,p={x:s,y:l},g=t.pstyle("arrow-scale").value,y=this.getArrowWidth(r,g),m=c.arrowShapes[a];if(d){var b=c.arrowPathCache=c.arrowPathCache||[],w=Mr(a),C=b[w];C!=null?(h=e=C,f=!0):(h=e=new Path2D,b[w]=h)}f||(e.beginPath&&e.beginPath(),d?m.draw(e,1,0,{x:0,y:0},1):m.draw(e,y,u,p,r),e.closePath&&e.closePath()),e=v,d&&(e.translate(s,l),e.rotate(u),e.scale(y,y)),(n==="filled"||n==="both")&&(d?e.fill(h):e.fill()),(n==="hollow"||n==="both")&&(e.lineWidth=i/(d?y:1),e.lineJoin="miter",d?e.stroke(h):e.stroke()),d&&(e.scale(1/y,1/y),e.rotate(-u),e.translate(-s,-l))};var Mc={};Mc.safeDrawImage=function(t,e,n,r,a,i,s,l,u,c){if(!(a<=0||i<=0||u<=0||c<=0))try{t.drawImage(e,n,r,a,i,s,l,u,c)}catch(d){Ve(d)}},Mc.drawInscribedImage=function(t,e,n,r,a){var i=this,s=n.position(),l=s.x,u=s.y,c=n.cy().style(),d=c.getIndexedStyle.bind(c),f=d(n,"background-fit","value",r),h=d(n,"background-repeat","value",r),v=n.width(),p=n.height(),g=n.padding()*2,y=v+(d(n,"background-width-relative-to","value",r)==="inner"?0:g),m=p+(d(n,"background-height-relative-to","value",r)==="inner"?0:g),b=n._private.rscratch,w=d(n,"background-clip","value",r),C=w==="node",k=d(n,"background-image-opacity","value",r)*a,E=d(n,"background-image-smoothing","value",r),x=n.pstyle("corner-radius").value;x!=="auto"&&(x=n.pstyle("corner-radius").pfValue);var B=e.width||e.cachedW,S=e.height||e.cachedH;(B==null||S==null)&&(document.body.appendChild(e),B=e.cachedW=e.width||e.offsetWidth,S=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var N=B,D=S;if(d(n,"background-width","value",r)!=="auto"&&(d(n,"background-width","units",r)==="%"?N=d(n,"background-width","pfValue",r)*y:N=d(n,"background-width","pfValue",r)),d(n,"background-height","value",r)!=="auto"&&(d(n,"background-height","units",r)==="%"?D=d(n,"background-height","pfValue",r)*m:D=d(n,"background-height","pfValue",r)),!(N===0||D===0)){if(f==="contain"){var _=Math.min(y/N,m/D);N*=_,D*=_}else if(f==="cover"){var _=Math.max(y/N,m/D);N*=_,D*=_}var I=l-y/2,P=d(n,"background-position-x","units",r),F=d(n,"background-position-x","pfValue",r);P==="%"?I+=(y-N)*F:I+=F;var O=d(n,"background-offset-x","units",r),M=d(n,"background-offset-x","pfValue",r);O==="%"?I+=(y-N)*M:I+=M;var L=u-m/2,V=d(n,"background-position-y","units",r),H=d(n,"background-position-y","pfValue",r);V==="%"?L+=(m-D)*H:L+=H;var $=d(n,"background-offset-y","units",r),z=d(n,"background-offset-y","pfValue",r);$==="%"?L+=(m-D)*z:L+=z,b.pathCache&&(I-=l,L-=u,l=0,u=0);var j=t.globalAlpha;t.globalAlpha=k;var ee=i.getImgSmoothing(t),J=!1;if(E==="no"&&ee?(i.setImgSmoothing(t,!1),J=!0):E==="yes"&&!ee&&(i.setImgSmoothing(t,!0),J=!0),h==="no-repeat")C&&(t.save(),b.pathCache?t.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(n)].draw(t,l,u,y,m,x,b),t.clip())),i.safeDrawImage(t,e,0,0,B,S,I,L,N,D),C&&t.restore();else{var X=t.createPattern(e,h);t.fillStyle=X,i.nodeShapes[i.getNodeShape(n)].draw(t,l,u,y,m,x,b),t.translate(I,L),t.fill(),t.translate(-I,-L)}t.globalAlpha=j,J&&i.setImgSmoothing(t,ee)}};var Wr={};Wr.eleTextBiggerThanMin=function(t,e){if(!e){var n=t.cy().zoom(),r=this.getPixelRatio(),a=Math.ceil(Xl(n*r));e=Math.pow(2,a)}var i=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;return!(i<s)},Wr.drawElementText=function(t,e,n,r,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(r==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(r===!1)return;if(e.isNode()){var l=e.pstyle("label");if(!l||!l.value)return;var u=s.getLabelJustification(e);t.textAlign=u,t.textBaseline="bottom"}else{var c=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),h=e.pstyle("target-label");if(c||(!d||!d.value)&&(!f||!f.value)&&(!h||!h.value))return;t.textAlign="center",t.textBaseline="bottom"}var v=!n,p;n&&(p=n,t.translate(-p.x1,-p.y1)),a==null?(s.drawText(t,e,null,v,i),e.isEdge()&&(s.drawText(t,e,"source",v,i),s.drawText(t,e,"target",v,i))):s.drawText(t,e,a,v,i),n&&t.translate(p.x1,p.y1)},Wr.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if(e=this.fontCaches[n],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e},Wr.setupTextStyle=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,l=n?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*l,c=e.pstyle("color").value,d=e.pstyle("text-outline-color").value;t.font=r+" "+s+" "+a+" "+i,t.lineJoin="round",this.colorFillStyle(t,c[0],c[1],c[2],l),this.colorStrokeStyle(t,d[0],d[1],d[2],u)};function Fc(t,e,n,r,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+i,n),t.lineTo(e+r-i,n),t.quadraticCurveTo(e+r,n,e+r,n+i),t.lineTo(e+r,n+a-i),t.quadraticCurveTo(e+r,n+a,e+r-i,n+a),t.lineTo(e+i,n+a),t.quadraticCurveTo(e,n+a,e,n+a-i),t.lineTo(e,n+i),t.quadraticCurveTo(e,n,e+i,n),t.closePath(),s?t.stroke():t.fill()}Wr.getTextAngle=function(t,e){var n,r=t._private,a=r.rscratch,i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),l=fn(a,"labelAngle",e);return s.strValue==="autorotate"?n=t.isEdge()?l:0:s.strValue==="none"?n=0:n=s.pfValue,n},Wr.drawText=function(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,s=i.rscratch,l=a?e.effectiveOpacity():1;if(!(a&&(l===0||e.pstyle("text-opacity").value===0))){n==="main"&&(n=null);var u=fn(s,"labelX",n),c=fn(s,"labelY",n),d,f,h=this.getLabelText(e,n);if(h!=null&&h!==""&&!isNaN(u)&&!isNaN(c)){this.setupTextStyle(t,e,a);var v=n?n+"-":"",p=fn(s,"labelWidth",n),g=fn(s,"labelHeight",n),y=e.pstyle(v+"text-margin-x").pfValue,m=e.pstyle(v+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;b&&(w="center",C="center"),u+=y,c+=m;var k;switch(r?k=this.getTextAngle(e,n):k=0,k!==0&&(d=u,f=c,t.translate(d,f),t.rotate(k),u=0,c=0),C){case"top":break;case"center":c+=g/2;break;case"bottom":c+=g;break}var E=e.pstyle("text-background-opacity").value,x=e.pstyle("text-border-opacity").value,B=e.pstyle("text-border-width").pfValue,S=e.pstyle("text-background-padding").pfValue,N=e.pstyle("text-background-shape").strValue,D=N.indexOf("round")===0,_=2;if(E>0||B>0&&x>0){var I=u-S;switch(w){case"left":I-=p;break;case"center":I-=p/2;break}var P=c-g-S,F=p+2*S,O=g+2*S;if(E>0){var M=t.fillStyle,L=e.pstyle("text-background-color").value;t.fillStyle="rgba("+L[0]+","+L[1]+","+L[2]+","+E*l+")",D?Fc(t,I,P,F,O,_):t.fillRect(I,P,F,O),t.fillStyle=M}if(B>0&&x>0){var V=t.strokeStyle,H=t.lineWidth,$=e.pstyle("text-border-color").value,z=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+$[0]+","+$[1]+","+$[2]+","+x*l+")",t.lineWidth=B,t.setLineDash)switch(z){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=B/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(D?Fc(t,I,P,F,O,_,"stroke"):t.strokeRect(I,P,F,O),z==="double"){var j=B/2;D?Fc(t,I+j,P+j,F-j*2,O-j*2,_,"stroke"):t.strokeRect(I+j,P+j,F-j*2,O-j*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=H,t.strokeStyle=V}}var ee=2*e.pstyle("text-outline-width").pfValue;if(ee>0&&(t.lineWidth=ee),e.pstyle("text-wrap").value==="wrap"){var J=fn(s,"labelWrapCachedLines",n),X=fn(s,"labelLineHeight",n),ne=p/2,Y=this.getLabelJustification(e);switch(Y==="auto"||(w==="left"?Y==="left"?u+=-p:Y==="center"&&(u+=-ne):w==="center"?Y==="left"?u+=-ne:Y==="right"&&(u+=ne):w==="right"&&(Y==="center"?u+=ne:Y==="right"&&(u+=p))),C){case"top":c-=(J.length-1)*X;break;case"center":case"bottom":c-=(J.length-1)*X;break}for(var A=0;A<J.length;A++)ee>0&&t.strokeText(J[A],u,c),t.fillText(J[A],u,c),c+=X}else ee>0&&t.strokeText(h,u,c),t.fillText(h,u,c);k!==0&&(t.rotate(-k),t.translate(-d,-f))}}};var Ra={};Ra.drawNode=function(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,l,u,c=e._private,d=c.rscratch,f=e.position();if(!(!le(f.x)||!le(f.y))&&!(i&&!e.visible())){var h=i?e.effectiveOpacity():1,v=s.usePaths(),p,g=!1,y=e.padding();l=e.width()+2*y,u=e.height()+2*y;var m;n&&(m=n,t.translate(-m.x1,-m.y1));for(var b=e.pstyle("background-image"),w=b.value,C=new Array(w.length),k=new Array(w.length),E=0,x=0;x<w.length;x++){var B=w[x],S=C[x]=B!=null&&B!=="none";if(S){var N=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",x);E++,k[x]=s.getCachedImage(B,N,function(){c.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var D=e.pstyle("background-blacken").value,_=e.pstyle("border-width").pfValue,I=e.pstyle("background-opacity").value*h,P=e.pstyle("border-color").value,F=e.pstyle("border-style").value,O=e.pstyle("border-join").value,M=e.pstyle("border-cap").value,L=e.pstyle("border-position").value,V=e.pstyle("border-dash-pattern").pfValue,H=e.pstyle("border-dash-offset").pfValue,$=e.pstyle("border-opacity").value*h,z=e.pstyle("outline-width").pfValue,j=e.pstyle("outline-color").value,ee=e.pstyle("outline-style").value,J=e.pstyle("outline-opacity").value*h,X=e.pstyle("outline-offset").value,ne=e.pstyle("corner-radius").value;ne!=="auto"&&(ne=e.pstyle("corner-radius").pfValue);var Y=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I;s.eleFillStyle(t,e,ie)},A=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$;s.colorStrokeStyle(t,P[0],P[1],P[2],ie)},K=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:J;s.colorStrokeStyle(t,j[0],j[1],j[2],ie)},W=function(ie,Z,ae,we){var Ce=s.nodePathCache=s.nodePathCache||[],ge=lh(ae==="polygon"?ae+","+we.join(","):ae,""+Z,""+ie,""+ne),Se=Ce[ge],ve,ye=!1;return Se!=null?(ve=Se,ye=!0,d.pathCache=ve):(ve=new Path2D,Ce[ge]=d.pathCache=ve),{path:ve,cacheHit:ye}},oe=e.pstyle("shape").strValue,he=e.pstyle("shape-polygon-points").pfValue;if(v){t.translate(f.x,f.y);var re=W(l,u,oe,he);p=re.path,g=re.cacheHit}var se=function(){if(!g){var ie=f;v&&(ie={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(p||t,ie.x,ie.y,l,u,ne,d)}v?t.fill(p):t.fill()},ue=function(){for(var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ae=c.backgrounding,we=0,Ce=0;Ce<k.length;Ce++){var ge=e.cy().style().getIndexedStyle(e,"background-image-containment","value",Ce);if(Z&&ge==="over"||!Z&&ge==="inside"){we++;continue}C[Ce]&&k[Ce].complete&&!k[Ce].error&&(we++,s.drawInscribedImage(t,k[Ce],e,Ce,ie))}c.backgrounding=we!==E,ae!==c.backgrounding&&e.updateStyle(!1)},pe=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;s.hasPie(e)&&(s.drawPie(t,e,Z),ie&&(v||s.nodeShapes[s.getNodeShape(e)].draw(t,f.x,f.y,l,u,ne,d)))},de=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,Z=(D>0?D:-D)*ie,ae=D>0?0:255;D!==0&&(s.colorFillStyle(t,ae,ae,ae,Z),v?t.fill(p):t.fill())},me=function(){if(_>0){if(t.lineWidth=_,t.lineCap=M,t.lineJoin=O,t.setLineDash)switch(F){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(V),t.lineDashOffset=H;break;case"solid":case"double":t.setLineDash([]);break}if(L!=="center"){if(t.save(),t.lineWidth*=2,L==="inside")v?t.clip(p):t.clip();else{var ie=new Path2D;ie.rect(-l/2-_,-u/2-_,l+2*_,u+2*_),ie.addPath(p),t.clip(ie,"evenodd")}v?t.stroke(p):t.stroke(),t.restore()}else v?t.stroke(p):t.stroke();if(F==="double"){t.lineWidth=_/3;var Z=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(p):t.stroke(),t.globalCompositeOperation=Z}t.setLineDash&&t.setLineDash([])}},Ne=function(){if(z>0){if(t.lineWidth=z,t.lineCap="butt",t.setLineDash)switch(ee){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var ie=f;v&&(ie={x:0,y:0});var Z=s.getNodeShape(e),ae=_;L==="inside"&&(ae=0),L==="outside"&&(ae*=2);var we=(l+ae+(z+X))/l,Ce=(u+ae+(z+X))/u,ge=l*we,Se=u*Ce,ve=s.nodeShapes[Z].points,ye;if(v){var Ge=W(ge,Se,Z,ve);ye=Ge.path}if(Z==="ellipse")s.drawEllipsePath(ye||t,ie.x,ie.y,ge,Se);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(Z)){var $e=0,nt=0,rt=0;Z==="round-diamond"?$e=(ae+X+z)*1.4:Z==="round-heptagon"?($e=(ae+X+z)*1.075,rt=-(ae/2+X+z)/35):Z==="round-hexagon"?$e=(ae+X+z)*1.12:Z==="round-pentagon"?($e=(ae+X+z)*1.13,rt=-(ae/2+X+z)/15):Z==="round-tag"?($e=(ae+X+z)*1.12,nt=(ae/2+z+X)*.07):Z==="round-triangle"&&($e=(ae+X+z)*(Math.PI/2),rt=-(ae+X/2+z)/Math.PI),$e!==0&&(we=(l+$e)/l,ge=l*we,["round-hexagon","round-tag"].includes(Z)||(Ce=(u+$e)/u,Se=u*Ce)),ne=ne==="auto"?xh(ge,Se):ne;for(var Qe=ge/2,Pt=Se/2,dt=ne+(ae+z+X)/2,pt=new Array(ve.length/2),Wt=new Array(ve.length/2),Ot=0;Ot<ve.length/2;Ot++)pt[Ot]={x:ie.x+nt+Qe*ve[Ot*2],y:ie.y+rt+Pt*ve[Ot*2+1]};var It,rn,vn,Kt,Je=pt.length;for(rn=pt[Je-1],It=0;It<Je;It++)vn=pt[It%Je],Kt=pt[(It+1)%Je],Wt[It]=_c(rn,vn,Kt,dt),rn=vn,vn=Kt;s.drawRoundPolygonPath(ye||t,ie.x+nt,ie.y+rt,l*we,u*Ce,ve,Wt)}else if(["roundrectangle","round-rectangle"].includes(Z))ne=ne==="auto"?Rr(ge,Se):ne,s.drawRoundRectanglePath(ye||t,ie.x,ie.y,ge,Se,ne+(ae+z+X)/2);else if(["cutrectangle","cut-rectangle"].includes(Z))ne=ne==="auto"?tc():ne,s.drawCutRectanglePath(ye||t,ie.x,ie.y,ge,Se,null,ne+(ae+z+X)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(Z))ne=ne==="auto"?Rr(ge,Se):ne,s.drawBottomRoundRectanglePath(ye||t,ie.x,ie.y,ge,Se,ne+(ae+z+X)/2);else if(Z==="barrel")s.drawBarrelPath(ye||t,ie.x,ie.y,ge,Se);else if(Z.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(Z)){var at=(ae+z+X)/l;ve=Go(Wo(ve,at)),s.drawPolygonPath(ye||t,ie.x,ie.y,l,u,ve)}else{var vt=(ae+z+X)/l;ve=Go(Wo(ve,-vt)),s.drawPolygonPath(ye||t,ie.x,ie.y,l,u,ve)}if(v?t.stroke(ye):t.stroke(),ee==="double"){t.lineWidth=ae/3;var mr=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(ye):t.stroke(),t.globalCompositeOperation=mr}t.setLineDash&&t.setLineDash([])}},De=function(){a&&s.drawNodeOverlay(t,e,f,l,u)},Ee=function(){a&&s.drawNodeUnderlay(t,e,f,l,u)},_e=function(){s.drawElementText(t,e,null,r)},te=e.pstyle("ghost").value==="yes";if(te){var T=e.pstyle("ghost-offset-x").pfValue,R=e.pstyle("ghost-offset-y").pfValue,Q=e.pstyle("ghost-opacity").value,G=Q*h;t.translate(T,R),K(),Ne(),Y(Q*I),se(),ue(G,!0),A(Q*$),me(),pe(D!==0||_!==0),ue(G,!1),de(G),t.translate(-T,-R)}v&&t.translate(-f.x,-f.y),Ee(),v&&t.translate(f.x,f.y),K(),Ne(),Y(),se(),ue(h,!0),A(),me(),pe(D!==0||_!==0),ue(h,!1),de(),v&&t.translate(-f.x,-f.y),_e(),De(),n&&t.translate(m.x1,m.y1)}};var Tv=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(n,r,a,i,s){var l=this;if(r.visible()){var u=r.pstyle("".concat(e,"-padding")).pfValue,c=r.pstyle("".concat(e,"-opacity")).value,d=r.pstyle("".concat(e,"-color")).value,f=r.pstyle("".concat(e,"-shape")).value,h=r.pstyle("".concat(e,"-corner-radius")).value;if(c>0){if(a=a||r.position(),i==null||s==null){var v=r.padding();i=r.width()+2*v,s=r.height()+2*v}l.colorFillStyle(n,d[0],d[1],d[2],c),l.nodeShapes[f].draw(n,a.x,a.y,i+u*2,s+u*2,h),n.fill()}}}};Ra.drawNodeOverlay=Tv("overlay"),Ra.drawNodeUnderlay=Tv("underlay"),Ra.hasPie=function(t){return t=t[0],t._private.hasPie},Ra.drawPie=function(t,e,n,r){e=e[0],r=r||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),s=r.x,l=r.y,u=e.width(),c=e.height(),d=Math.min(u,c)/2,f=0,h=this.usePaths();h&&(s=0,l=0),i.units==="%"?d=d*i.pfValue:i.pfValue!==void 0&&(d=i.pfValue/2);for(var v=1;v<=a.pieBackgroundN;v++){var p=e.pstyle("pie-"+v+"-background-size").value,g=e.pstyle("pie-"+v+"-background-color").value,y=e.pstyle("pie-"+v+"-background-opacity").value*n,m=p/100;m+f>1&&(m=1-f);var b=1.5*Math.PI+2*Math.PI*f,w=2*Math.PI*m,C=b+w;p===0||f>=1||f+m>1||(t.beginPath(),t.moveTo(s,l),t.arc(s,l,d,b,C),t.closePath(),this.colorFillStyle(t,g[0],g[1],g[2],y),t.fill(),f+=m)}};var Gt={},p_=100;Gt.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),n=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/n},Gt.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],n=!0,r,a=0;a<e.length;a++)if(r=e[a],r.context===t){n=!1;break}return n&&(r={context:t},e.push(r)),r},Gt.createGradientStyleFor=function(t,e,n,r,a){var i,s=this.usePaths(),l=n.pstyle(e+"-gradient-stop-colors").value,u=n.pstyle(e+"-gradient-stop-positions").pfValue;if(r==="radial-gradient")if(n.isEdge()){var c=n.sourceEndpoint(),d=n.targetEndpoint(),f=n.midpoint(),h=Fr(c,f),v=Fr(d,f);i=t.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(h,v))}else{var p=s?{x:0,y:0}:n.position(),g=n.paddedWidth(),y=n.paddedHeight();i=t.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(g,y))}else if(n.isEdge()){var m=n.sourceEndpoint(),b=n.targetEndpoint();i=t.createLinearGradient(m.x,m.y,b.x,b.y)}else{var w=s?{x:0,y:0}:n.position(),C=n.paddedWidth(),k=n.paddedHeight(),E=C/2,x=k/2,B=n.pstyle("background-gradient-direction").value;switch(B){case"to-bottom":i=t.createLinearGradient(w.x,w.y-x,w.x,w.y+x);break;case"to-top":i=t.createLinearGradient(w.x,w.y+x,w.x,w.y-x);break;case"to-left":i=t.createLinearGradient(w.x+E,w.y,w.x-E,w.y);break;case"to-right":i=t.createLinearGradient(w.x-E,w.y,w.x+E,w.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(w.x-E,w.y-x,w.x+E,w.y+x);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(w.x-E,w.y+x,w.x+E,w.y-x);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(w.x+E,w.y-x,w.x-E,w.y+x);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(w.x+E,w.y+x,w.x-E,w.y-x);break}}if(!i)return null;for(var S=u.length===l.length,N=l.length,D=0;D<N;D++)i.addColorStop(S?u[D]:D/(N-1),"rgba("+l[D][0]+","+l[D][1]+","+l[D][2]+","+a+")");return i},Gt.gradientFillStyle=function(t,e,n,r){var a=this.createGradientStyleFor(t,"background",e,n,r);if(!a)return null;t.fillStyle=a},Gt.colorFillStyle=function(t,e,n,r,a){t.fillStyle="rgba("+e+","+n+","+r+","+a+")"},Gt.eleFillStyle=function(t,e,n){var r=e.pstyle("background-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientFillStyle(t,e,r,n);else{var a=e.pstyle("background-color").value;this.colorFillStyle(t,a[0],a[1],a[2],n)}},Gt.gradientStrokeStyle=function(t,e,n,r){var a=this.createGradientStyleFor(t,"line",e,n,r);if(!a)return null;t.strokeStyle=a},Gt.colorStrokeStyle=function(t,e,n,r,a){t.strokeStyle="rgba("+e+","+n+","+r+","+a+")"},Gt.eleStrokeStyle=function(t,e,n){var r=e.pstyle("line-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientStrokeStyle(t,e,r,n);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(t,a[0],a[1],a[2],n)}},Gt.matchCanvasSize=function(t){var e=this,n=e.data,r=e.findContainerClientCoords(),a=r[2],i=r[3],s=e.getPixelRatio(),l=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(s=l);var u=a*s,c=i*s,d;if(!(u===e.canvasWidth&&c===e.canvasHeight)){e.fontCaches=null;var f=n.canvasContainer;f.style.width=a+"px",f.style.height=i+"px";for(var h=0;h<e.CANVAS_LAYERS;h++)d=n.canvases[h],d.width=u,d.height=c,d.style.width=a+"px",d.style.height=i+"px";for(var h=0;h<e.BUFFER_COUNT;h++)d=n.bufferCanvases[h],d.width=u,d.height=c,d.style.width=a+"px",d.style.height=i+"px";e.textureMult=1,s<=1&&(d=n.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,d.width=u*e.textureMult,d.height=c*e.textureMult),e.canvasWidth=u,e.canvasHeight=c}},Gt.renderTo=function(t,e,n,r){this.render({forcedContext:t,forcedZoom:e,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},Gt.render=function(t){t=t||ph();var e=t.forcedContext,n=t.drawAllLayers,r=t.drawOnlyNodeLayer,a=t.forcedZoom,i=t.forcedPan,s=this,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,u=s.cy,c=s.data,d=c.canvasNeedsRedraw,f=s.textureOnViewport&&!e&&(s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming),h=t.motionBlur!==void 0?t.motionBlur:s.motionBlur,v=s.motionBlurPxRatio,p=u.hasCompoundNodes(),g=s.hoverData.draggingEles,y=!!(s.hoverData.selecting||s.touchData.selecting);h=h&&!e&&s.motionBlurEnabled&&!y;var m=h;e||(s.prevPxRatio!==l&&(s.invalidateContainerClientCoordsCache(),s.matchCanvasSize(s.container),s.redrawHint("eles",!0),s.redrawHint("drag",!0)),s.prevPxRatio=l),!e&&s.motionBlurTimeout&&clearTimeout(s.motionBlurTimeout),h&&(s.mbFrames==null&&(s.mbFrames=0),s.mbFrames++,s.mbFrames<3&&(m=!1),s.mbFrames>s.minMbLowQualFrames&&(s.motionBlurPxRatio=s.mbPxRBlurry)),s.clearingMotionBlur&&(s.motionBlurPxRatio=1),s.textureDrawLastFrame&&!f&&(d[s.NODE]=!0,d[s.SELECT_BOX]=!0);var b=u.style(),w=u.zoom(),C=a!==void 0?a:w,k=u.pan(),E={x:k.x,y:k.y},x={zoom:w,pan:{x:k.x,y:k.y}},B=s.prevViewport,S=B===void 0||x.zoom!==B.zoom||x.pan.x!==B.pan.x||x.pan.y!==B.pan.y;!S&&!(g&&!p)&&(s.motionBlurPxRatio=1),i&&(E=i),C*=l,E.x*=l,E.y*=l;var N=s.getCachedZSortedEles();function D(re,se,ue,pe,de){var me=re.globalCompositeOperation;re.globalCompositeOperation="destination-out",s.colorFillStyle(re,255,255,255,s.motionBlurTransparency),re.fillRect(se,ue,pe,de),re.globalCompositeOperation=me}function _(re,se){var ue,pe,de,me;!s.clearingMotionBlur&&(re===c.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]||re===c.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG])?(ue={x:k.x*v,y:k.y*v},pe=w*v,de=s.canvasWidth*v,me=s.canvasHeight*v):(ue=E,pe=C,de=s.canvasWidth,me=s.canvasHeight),re.setTransform(1,0,0,1,0,0),se==="motionBlur"?D(re,0,0,de,me):!e&&(se===void 0||se)&&re.clearRect(0,0,de,me),n||(re.translate(ue.x,ue.y),re.scale(pe,pe)),i&&re.translate(i.x,i.y),a&&re.scale(a,a)}if(f||(s.textureDrawLastFrame=!1),f){if(s.textureDrawLastFrame=!0,!s.textureCache){s.textureCache={},s.textureCache.bb=u.mutableElements().boundingBox(),s.textureCache.texture=s.data.bufferCanvases[s.TEXTURE_BUFFER];var I=s.data.bufferContexts[s.TEXTURE_BUFFER];I.setTransform(1,0,0,1,0,0),I.clearRect(0,0,s.canvasWidth*s.textureMult,s.canvasHeight*s.textureMult),s.render({forcedContext:I,drawOnlyNodeLayer:!0,forcedPxRatio:l*s.textureMult});var x=s.textureCache.viewport={zoom:u.zoom(),pan:u.pan(),width:s.canvasWidth,height:s.canvasHeight};x.mpan={x:(0-x.pan.x)/x.zoom,y:(0-x.pan.y)/x.zoom}}d[s.DRAG]=!1,d[s.NODE]=!1;var P=c.contexts[s.NODE],F=s.textureCache.texture,x=s.textureCache.viewport;P.setTransform(1,0,0,1,0,0),h?D(P,0,0,x.width,x.height):P.clearRect(0,0,x.width,x.height);var O=b.core("outside-texture-bg-color").value,M=b.core("outside-texture-bg-opacity").value;s.colorFillStyle(P,O[0],O[1],O[2],M),P.fillRect(0,0,x.width,x.height);var w=u.zoom();_(P,!1),P.clearRect(x.mpan.x,x.mpan.y,x.width/x.zoom/l,x.height/x.zoom/l),P.drawImage(F,x.mpan.x,x.mpan.y,x.width/x.zoom/l,x.height/x.zoom/l)}else s.textureOnViewport&&!e&&(s.textureCache=null);var L=u.extent(),V=s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming||s.hoverData.draggingEles||s.cy.animated(),H=s.hideEdgesOnViewport&&V,$=[];if($[s.NODE]=!d[s.NODE]&&h&&!s.clearedForMotionBlur[s.NODE]||s.clearingMotionBlur,$[s.NODE]&&(s.clearedForMotionBlur[s.NODE]=!0),$[s.DRAG]=!d[s.DRAG]&&h&&!s.clearedForMotionBlur[s.DRAG]||s.clearingMotionBlur,$[s.DRAG]&&(s.clearedForMotionBlur[s.DRAG]=!0),d[s.NODE]||n||r||$[s.NODE]){var z=h&&!$[s.NODE]&&v!==1,P=e||(z?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]:c.contexts[s.NODE]),j=h&&!z?"motionBlur":void 0;_(P,j),H?s.drawCachedNodes(P,N.nondrag,l,L):s.drawLayeredElements(P,N.nondrag,l,L),s.debug&&s.drawDebugPoints(P,N.nondrag),!n&&!h&&(d[s.NODE]=!1)}if(!r&&(d[s.DRAG]||n||$[s.DRAG])){var z=h&&!$[s.DRAG]&&v!==1,P=e||(z?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG]:c.contexts[s.DRAG]);_(P,h&&!z?"motionBlur":void 0),H?s.drawCachedNodes(P,N.drag,l,L):s.drawCachedElements(P,N.drag,l,L),s.debug&&s.drawDebugPoints(P,N.drag),!n&&!h&&(d[s.DRAG]=!1)}if(s.showFps||!r&&d[s.SELECT_BOX]&&!n){var P=e||c.contexts[s.SELECT_BOX];if(_(P),s.selection[4]==1&&(s.hoverData.selecting||s.touchData.selecting)){var w=s.cy.zoom(),ee=b.core("selection-box-border-width").value/w;P.lineWidth=ee,P.fillStyle="rgba("+b.core("selection-box-color").value[0]+","+b.core("selection-box-color").value[1]+","+b.core("selection-box-color").value[2]+","+b.core("selection-box-opacity").value+")",P.fillRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]),ee>0&&(P.strokeStyle="rgba("+b.core("selection-box-border-color").value[0]+","+b.core("selection-box-border-color").value[1]+","+b.core("selection-box-border-color").value[2]+","+b.core("selection-box-opacity").value+")",P.strokeRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]))}if(c.bgActivePosistion&&!s.hoverData.selecting){var w=s.cy.zoom(),J=c.bgActivePosistion;P.fillStyle="rgba("+b.core("active-bg-color").value[0]+","+b.core("active-bg-color").value[1]+","+b.core("active-bg-color").value[2]+","+b.core("active-bg-opacity").value+")",P.beginPath(),P.arc(J.x,J.y,b.core("active-bg-size").pfValue/w,0,2*Math.PI),P.fill()}var X=s.lastRedrawTime;if(s.showFps&&X){X=Math.round(X);var ne=Math.round(1e3/X);P.setTransform(1,0,0,1,0,0),P.fillStyle="rgba(255, 0, 0, 0.75)",P.strokeStyle="rgba(255, 0, 0, 0.75)",P.lineWidth=1,P.fillText("1 frame = "+X+" ms = "+ne+" fps",0,20);var Y=60;P.strokeRect(0,30,250,20),P.fillRect(0,30,250*Math.min(ne/Y,1),20)}n||(d[s.SELECT_BOX]=!1)}if(h&&v!==1){var A=c.contexts[s.NODE],K=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_NODE],W=c.contexts[s.DRAG],oe=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_DRAG],he=function(se,ue,pe){se.setTransform(1,0,0,1,0,0),pe||!m?se.clearRect(0,0,s.canvasWidth,s.canvasHeight):D(se,0,0,s.canvasWidth,s.canvasHeight);var de=v;se.drawImage(ue,0,0,s.canvasWidth*de,s.canvasHeight*de,0,0,s.canvasWidth,s.canvasHeight)};(d[s.NODE]||$[s.NODE])&&(he(A,K,$[s.NODE]),d[s.NODE]=!1),(d[s.DRAG]||$[s.DRAG])&&(he(W,oe,$[s.DRAG]),d[s.DRAG]=!1)}s.prevViewport=x,s.clearingMotionBlur&&(s.clearingMotionBlur=!1,s.motionBlurCleared=!0,s.motionBlur=!0),h&&(s.motionBlurTimeout=setTimeout(function(){s.motionBlurTimeout=null,s.clearedForMotionBlur[s.NODE]=!1,s.clearedForMotionBlur[s.DRAG]=!1,s.motionBlur=!1,s.clearingMotionBlur=!f,s.mbFrames=0,d[s.NODE]=!0,d[s.DRAG]=!0,s.redraw()},p_)),e||u.emit("render")};var gr={};gr.drawPolygonPath=function(t,e,n,r,a,i){var s=r/2,l=a/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*i[0],n+l*i[1]);for(var u=1;u<i.length/2;u++)t.lineTo(e+s*i[u*2],n+l*i[u*2+1]);t.closePath()},gr.drawRoundPolygonPath=function(t,e,n,r,a,i,s){s.forEach(function(l){return ov(t,l)}),t.closePath()},gr.drawRoundRectanglePath=function(t,e,n,r,a,i){var s=r/2,l=a/2,u=i==="auto"?Rr(r,a):Math.min(i,l,s);t.beginPath&&t.beginPath(),t.moveTo(e,n-l),t.arcTo(e+s,n-l,e+s,n,u),t.arcTo(e+s,n+l,e,n+l,u),t.arcTo(e-s,n+l,e-s,n,u),t.arcTo(e-s,n-l,e,n-l,u),t.lineTo(e,n-l),t.closePath()},gr.drawBottomRoundRectanglePath=function(t,e,n,r,a,i){var s=r/2,l=a/2,u=i==="auto"?Rr(r,a):i;t.beginPath&&t.beginPath(),t.moveTo(e,n-l),t.lineTo(e+s,n-l),t.lineTo(e+s,n),t.arcTo(e+s,n+l,e,n+l,u),t.arcTo(e-s,n+l,e-s,n,u),t.lineTo(e-s,n-l),t.lineTo(e,n-l),t.closePath()},gr.drawCutRectanglePath=function(t,e,n,r,a,i,s){var l=r/2,u=a/2,c=s==="auto"?tc():s;t.beginPath&&t.beginPath(),t.moveTo(e-l+c,n-u),t.lineTo(e+l-c,n-u),t.lineTo(e+l,n-u+c),t.lineTo(e+l,n+u-c),t.lineTo(e+l-c,n+u),t.lineTo(e-l+c,n+u),t.lineTo(e-l,n+u-c),t.lineTo(e-l,n-u+c),t.closePath()},gr.drawBarrelPath=function(t,e,n,r,a){var i=r/2,s=a/2,l=e-i,u=e+i,c=n-s,d=n+s,f=nc(r,a),h=f.widthOffset,v=f.heightOffset,p=f.ctrlPtOffsetPct*h;t.beginPath&&t.beginPath(),t.moveTo(l,c+v),t.lineTo(l,d-v),t.quadraticCurveTo(l+p,d,l+h,d),t.lineTo(u-h,d),t.quadraticCurveTo(u-p,d,u,d-v),t.lineTo(u,c+v),t.quadraticCurveTo(u-p,c,u-h,c),t.lineTo(l+h,c),t.quadraticCurveTo(l+p,c,l,c+v),t.closePath()};for(var Bv=Math.sin(0),Nv=Math.cos(0),Ac={},Vc={},Dv=Math.PI/40,$a=0*Math.PI;$a<2*Math.PI;$a+=Dv)Ac[$a]=Math.sin($a),Vc[$a]=Math.cos($a);gr.drawEllipsePath=function(t,e,n,r,a){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,n,r/2,a/2,0,0,2*Math.PI);else for(var i,s,l=r/2,u=a/2,c=0*Math.PI;c<2*Math.PI;c+=Dv)i=e-l*Ac[c]*Bv+l*Vc[c]*Nv,s=n+u*Vc[c]*Bv+u*Ac[c]*Nv,c===0?t.moveTo(i,s):t.lineTo(i,s);t.closePath()};var ji={};ji.createBuffer=function(t,e){var n=document.createElement("canvas");return n.width=t,n.height=e,[n,n.getContext("2d")]},ji.bufferCanvasImage=function(t){var e=this.cy,n=e.mutableElements(),r=n.boundingBox(),a=this.findContainerClientCoords(),i=t.full?Math.ceil(r.w):a[2],s=t.full?Math.ceil(r.h):a[3],l=le(t.maxWidth)||le(t.maxHeight),u=this.getPixelRatio(),c=1;if(t.scale!==void 0)i*=t.scale,s*=t.scale,c=t.scale;else if(l){var d=1/0,f=1/0;le(t.maxWidth)&&(d=c*t.maxWidth/i),le(t.maxHeight)&&(f=c*t.maxHeight/s),c=Math.min(d,f),i*=c,s*=c}l||(i*=u,s*=u,c*=u);var h=document.createElement("canvas");h.width=i,h.height=s,h.style.width=i+"px",h.style.height=s+"px";var v=h.getContext("2d");if(i>0&&s>0){v.clearRect(0,0,i,s),v.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(t.full)v.translate(-r.x1*c,-r.y1*c),v.scale(c,c),this.drawElements(v,p),v.scale(1/c,1/c),v.translate(r.x1*c,r.y1*c);else{var g=e.pan(),y={x:g.x*c,y:g.y*c};c*=e.zoom(),v.translate(y.x,y.y),v.scale(c,c),this.drawElements(v,p),v.scale(1/c,1/c),v.translate(-y.x,-y.y)}t.bg&&(v.globalCompositeOperation="destination-over",v.fillStyle=t.bg,v.rect(0,0,i,s),v.fill())}return h};function v_(t,e){for(var n=atob(t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return new Blob([r],{type:e})}function _v(t){var e=t.indexOf(",");return t.substr(e+1)}function Pv(t,e,n){var r=function(){return e.toDataURL(n,t.quality)};switch(t.output){case"blob-promise":return new xa(function(a,i){try{e.toBlob(function(s){s!=null?a(s):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},n,t.quality)}catch(s){i(s)}});case"blob":return v_(_v(r()),n);case"base64":return _v(r());case"base64uri":default:return r()}}ji.png=function(t){return Pv(t,this.bufferCanvasImage(t),"image/png")},ji.jpg=function(t){return Pv(t,this.bufferCanvasImage(t),"image/jpeg")};var Ov={};Ov.nodeShapeImpl=function(t,e,n,r,a,i,s,l){switch(t){case"ellipse":return this.drawEllipsePath(e,n,r,a,i);case"polygon":return this.drawPolygonPath(e,n,r,a,i,s);case"round-polygon":return this.drawRoundPolygonPath(e,n,r,a,i,s,l);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,n,r,a,i,l);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,n,r,a,i,s,l);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,n,r,a,i,l);case"barrel":return this.drawBarrelPath(e,n,r,a,i)}};var g_=Iv,Me=Iv.prototype;Me.CANVAS_LAYERS=3,Me.SELECT_BOX=0,Me.DRAG=1,Me.NODE=2,Me.BUFFER_COUNT=3,Me.TEXTURE_BUFFER=0,Me.MOTIONBLUR_BUFFER_NODE=1,Me.MOTIONBLUR_BUFFER_DRAG=2;function Iv(t){var e=this,n=e.cy.window(),r=n.document;e.data={canvases:new Array(Me.CANVAS_LAYERS),contexts:new Array(Me.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Me.CANVAS_LAYERS),bufferCanvases:new Array(Me.BUFFER_COUNT),bufferContexts:new Array(Me.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=r.createElement("div");var s=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,s.position="relative",s.zIndex="0",s.overflow="hidden";var l=t.cy.container();l.appendChild(e.data.canvasContainer),l.style[a]=i;var u={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};rS()&&(u["-ms-touch-action"]="none",u["touch-action"]="none");for(var c=0;c<Me.CANVAS_LAYERS;c++){var d=e.data.canvases[c]=r.createElement("canvas");e.data.contexts[c]=d.getContext("2d"),Object.keys(u).forEach(function(Y){d.style[Y]=u[Y]}),d.style.position="absolute",d.setAttribute("data-id","layer"+c),d.style.zIndex=String(Me.CANVAS_LAYERS-c),e.data.canvasContainer.appendChild(d),e.data.canvasNeedsRedraw[c]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Me.NODE].setAttribute("data-id","layer"+Me.NODE+"-node"),e.data.canvases[Me.SELECT_BOX].setAttribute("data-id","layer"+Me.SELECT_BOX+"-selectbox"),e.data.canvases[Me.DRAG].setAttribute("data-id","layer"+Me.DRAG+"-drag");for(var c=0;c<Me.BUFFER_COUNT;c++)e.data.bufferCanvases[c]=r.createElement("canvas"),e.data.bufferContexts[c]=e.data.bufferCanvases[c].getContext("2d"),e.data.bufferCanvases[c].style.position="absolute",e.data.bufferCanvases[c].setAttribute("data-id","buffer"+c),e.data.bufferCanvases[c].style.zIndex=String(-c-1),e.data.bufferCanvases[c].style.visibility="hidden";e.pathsEnabled=!0;var f=zt(),h=function(A){return{x:(A.x1+A.x2)/2,y:(A.y1+A.y2)/2}},v=function(A){return{x:-A.w/2,y:-A.h/2}},p=function(A){var K=A[0]._private,W=K.oldBackgroundTimestamp===K.backgroundTimestamp;return!W},g=function(A){return A[0]._private.nodeKey},y=function(A){return A[0]._private.labelStyleKey},m=function(A){return A[0]._private.sourceLabelStyleKey},b=function(A){return A[0]._private.targetLabelStyleKey},w=function(A,K,W,oe,he){return e.drawElement(A,K,W,!1,!1,he)},C=function(A,K,W,oe,he){return e.drawElementText(A,K,W,oe,"main",he)},k=function(A,K,W,oe,he){return e.drawElementText(A,K,W,oe,"source",he)},E=function(A,K,W,oe,he){return e.drawElementText(A,K,W,oe,"target",he)},x=function(A){return A.boundingBox(),A[0]._private.bodyBounds},B=function(A){return A.boundingBox(),A[0]._private.labelBounds.main||f},S=function(A){return A.boundingBox(),A[0]._private.labelBounds.source||f},N=function(A){return A.boundingBox(),A[0]._private.labelBounds.target||f},D=function(A,K){return K},_=function(A){return h(x(A))},I=function(A,K,W){var oe=A?A+"-":"";return{x:K.x+W.pstyle(oe+"text-margin-x").pfValue,y:K.y+W.pstyle(oe+"text-margin-y").pfValue}},P=function(A,K,W){var oe=A[0]._private.rscratch;return{x:oe[K],y:oe[W]}},F=function(A){return I("",P(A,"labelX","labelY"),A)},O=function(A){return I("source",P(A,"sourceLabelX","sourceLabelY"),A)},M=function(A){return I("target",P(A,"targetLabelX","targetLabelY"),A)},L=function(A){return v(x(A))},V=function(A){return v(S(A))},H=function(A){return v(N(A))},$=function(A){var K=B(A),W=v(B(A));if(A.isNode()){switch(A.pstyle("text-halign").value){case"left":W.x=-K.w;break;case"right":W.x=0;break}switch(A.pstyle("text-valign").value){case"top":W.y=-K.h;break;case"bottom":W.y=0;break}}return W},z=e.data.eleTxrCache=new Gi(e,{getKey:g,doesEleInvalidateKey:p,drawElement:w,getBoundingBox:x,getRotationPoint:_,getRotationOffset:L,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),j=e.data.lblTxrCache=new Gi(e,{getKey:y,drawElement:C,getBoundingBox:B,getRotationPoint:F,getRotationOffset:$,isVisible:D}),ee=e.data.slbTxrCache=new Gi(e,{getKey:m,drawElement:k,getBoundingBox:S,getRotationPoint:O,getRotationOffset:V,isVisible:D}),J=e.data.tlbTxrCache=new Gi(e,{getKey:b,drawElement:E,getBoundingBox:N,getRotationPoint:M,getRotationOffset:H,isVisible:D}),X=e.data.lyrTxrCache=new wv(e);e.onUpdateEleCalcs(function(A,K){z.invalidateElements(K),j.invalidateElements(K),ee.invalidateElements(K),J.invalidateElements(K),X.invalidateElements(K);for(var W=0;W<K.length;W++){var oe=K[W]._private;oe.oldBackgroundTimestamp=oe.backgroundTimestamp}});var ne=function(A){for(var K=0;K<A.length;K++)X.enqueueElementRefinement(A[K].ele)};z.onDequeue(ne),j.onDequeue(ne),ee.onDequeue(ne),J.onDequeue(ne)}Me.redrawHint=function(t,e){var n=this;switch(t){case"eles":n.data.canvasNeedsRedraw[Me.NODE]=e;break;case"drag":n.data.canvasNeedsRedraw[Me.DRAG]=e;break;case"select":n.data.canvasNeedsRedraw[Me.SELECT_BOX]=e;break}};var m_=typeof Path2D<"u";Me.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t},Me.usePaths=function(){return m_&&this.pathsEnabled},Me.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)},Me.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled},Me.makeOffscreenCanvas=function(t,e){var n;if((typeof OffscreenCanvas>"u"?"undefined":st(OffscreenCanvas))!=="undefined")n=new OffscreenCanvas(t,e);else{var r=this.cy.window(),a=r.document;n=a.createElement("canvas"),n.width=t,n.height=e}return n},[kv,Nn,qn,Mc,Wr,Ra,Gt,gr,ji,Ov].forEach(function(t){xe(Me,t)});var y_=[{name:"null",impl:Xp},{name:"base",impl:gv},{name:"canvas",impl:g_}],b_=[{type:"layout",extensions:S4},{type:"renderer",extensions:y_}],Lv={},Mv={};function Fv(t,e,n){var r=n,a=function(B){Ve("Can not register `"+e+"` for `"+t+"` since `"+B+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(Ki.prototype[e])return a(e);Ki.prototype[e]=n}else if(t==="collection"){if(kt.prototype[e])return a(e);kt.prototype[e]=n}else if(t==="layout"){for(var i=function(B){this.options=B,n.call(this,B),Oe(this._private)||(this._private={}),this._private.cy=B.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(n.prototype),l=[],u=0;u<l.length;u++){var c=l[u];s[c]=s[c]||function(){return this}}s.start&&!s.run?s.run=function(){return this.start(),this}:!s.start&&s.run&&(s.start=function(){return this.run(),this});var d=n.prototype.stop;s.stop=function(){var x=this.options;if(x&&x.animate){var B=this.animations;if(B)for(var S=0;S<B.length;S++)B[S].stop()}return d?d.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var f=function(B){return B._private.cy},h={addEventFields:function(B,S){S.layout=B,S.cy=f(B),S.target=B},bubble:function(){return!0},parent:function(B){return f(B)}};xe(s,{createEmitter:function(){return this._private.emitter=new ss(h,this),this},emitter:function(){return this._private.emitter},on:function(B,S){return this.emitter().on(B,S),this},one:function(B,S){return this.emitter().one(B,S),this},once:function(B,S){return this.emitter().one(B,S),this},removeListener:function(B,S){return this.emitter().removeListener(B,S),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(B,S){return this.emitter().emit(B,S),this}}),Re.eventAliasesOn(s),r=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var v=Av("renderer","base"),p=v.prototype,g=n,y=n.prototype,m=function(){v.apply(this,arguments),g.apply(this,arguments)},b=m.prototype;for(var w in p){var C=p[w],k=y[w]!=null;if(k)return a(w);b[w]=C}for(var E in y)b[E]=y[E];p.clientFunctions.forEach(function(x){b[x]=b[x]||function(){Ze("Renderer does not implement `renderer."+x+"()` on its prototype")}}),r=m}else if(t==="__proto__"||t==="constructor"||t==="prototype")return Ze(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return Qf({map:Lv,keys:[t,e],value:r})}function Av(t,e){return Jf({map:Lv,keys:[t,e]})}function w_(t,e,n,r,a){return Qf({map:Mv,keys:[t,e,n,r],value:a})}function C_(t,e,n,r){return Jf({map:Mv,keys:[t,e,n,r]})}var Rc=function(){if(arguments.length===2)return Av.apply(null,arguments);if(arguments.length===3)return Fv.apply(null,arguments);if(arguments.length===4)return C_.apply(null,arguments);if(arguments.length===5)return w_.apply(null,arguments);Ze("Invalid extension access syntax")};Ki.prototype.extension=Rc,b_.forEach(function(t){t.extensions.forEach(function(e){Fv(t.type,e.name,e.impl)})});var Vv=function t(){if(!(this instanceof t))return new t;this.length=0},jr=Vv.prototype;jr.instanceString=function(){return"stylesheet"},jr.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this},jr.css=function(t,e){var n=this.length-1;if(be(t))this[n].properties.push({name:t,value:e});else if(Oe(t))for(var r=t,a=Object.keys(r),i=0;i<a.length;i++){var s=a[i],l=r[s];if(l!=null){var u=Nt.properties[s]||Nt.properties[Mo(s)];if(u!=null){var c=u.name,d=l;this[n].properties.push({name:c,value:d})}}}return this},jr.style=jr.css,jr.generateStyle=function(t){var e=new Nt(t);return this.appendToStyle(e)},jr.appendToStyle=function(t){for(var e=0;e<this.length;e++){var n=this[e],r=n.selector,a=n.properties;t.selector(r);for(var i=0;i<a.length;i++){var s=a[i];t.css(s.name,s.value)}}return t};var k_="3.30.2",Yr=function(e){if(e===void 0&&(e={}),Oe(e))return new Ki(e);if(be(e))return Rc.apply(Rc,arguments)};Yr.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Yr),t.apply(null,e),this},Yr.warnings=function(t){return fh(t)},Yr.version=k_,Yr.stylesheet=Yr.Stylesheet=Vv;const Rv=function(t,e){if(!t||!e)return!1;let n=JSON.stringify(t),r=JSON.stringify(e);return n.indexOf(r)!==-1},x_=function(t){return t?[...new Set(t.map(e=>JSON.stringify(e)))].map(e=>JSON.parse(e)):[]},E_=function(t,e,n){let r=t.connectivity.flat(),a=x_(r),i=[],s=!1;return a.forEach(l=>{s=!1,Rv(e,l)&&(s=!0),Rv(n,l)&&(s=!0),s||i.push(l)}),i};let S_=class extends EventTarget{constructor(n,r){super();on(this,"cyg",null);on(this,"nodes",[]);on(this,"edges",[]);on(this,"axons",[]);on(this,"dendrites",[]);on(this,"somas",[]);on(this,"labelCache",new Map);on(this,"graphCanvas",null);on(this,"hasPhenotypes",!1);this.labelCache=n,this.graphCanvas=r}async addConnectivity(n){var r;if(n&&n["node-phenotypes"]){const a=["ilxtr:hasSomaLocatedIn"],i=["ilxtr:hasAxonPresynapticElementIn","ilxtr:hasAxonSensorySubcellularElementIn"],s=[],l=[];a.forEach(c=>{s.push(...n["node-phenotypes"][c])}),i.forEach(c=>{l.push(...n["node-phenotypes"][c])});const u=E_(n,s,l);this.dendrites=s.map(c=>JSON.stringify(c)),this.axons=l.map(c=>JSON.stringify(c)),u!=null&&u.length&&(this.somas=u.map(c=>JSON.stringify(c))),this.hasPhenotypes=!0}else this.axons=n.axons.map(a=>JSON.stringify(a)),this.dendrites=n.dendrites.map(a=>JSON.stringify(a)),(r=n.somas)!=null&&r.length&&(this.somas=n.somas.map(a=>JSON.stringify(a))),this.hasPhenotypes=!1;if(n.connectivity.length)for(const a of n.connectivity){const i=await this.graphNode(a[0]),s=await this.graphNode(a[1]);this.nodes.push(i),this.nodes.push(s),this.edges.push({id:`${i.id}_${s.id}`,source:i.id,target:s.id})}else this.nodes.push({id:"MISSING",label:"NO PATHS"})}showConnectivity(n){this.cyg=new D_(this,n),this.cyg.on("tap-node",r=>{const a=new CustomEvent("tap-node",{detail:r.detail});this.dispatchEvent(a)})}selectConnectivity(n){var r;if((r=this.cyg)!=null&&r.cy){let a="";this.cyg.cy.elements().forEach(i=>{const s=i.data("label"),l=$c(s);N_(n,l)&&(a=i.id())}),a&&this.cyg.cy.$id(a).select()}}clearConnectivity(){var n;(n=this.cyg)!=null&&n.cy&&(this.cyg.cy.remove(),this.cyg.cy=null)}reset(){var n;(n=this.cyg)!=null&&n.cy&&this.cyg.cy.reset()}zoom(n){var r;if((r=this.cyg)!=null&&r.cy){const a=this.cyg.cy.zoom(),i=this.cyg.cy.width(),s=this.cyg.cy.height(),l={x:i/2,y:s/2};this.cyg.cy.zoom({level:a+n,renderedPosition:l})}}enableZoom(n){var r;(r=this.cyg)!=null&&r.cy&&this.cyg.cy.userZoomingEnabled(n)}get elements(){return[...this.nodes.map(n=>({data:n})),...this.edges.map(n=>({data:n}))]}get roots(){return this.hasPhenotypes?[...this.dendrites]:[...this.dendrites,...this.somas]}async graphNode(n){const r=JSON.stringify(n),a=[n[0],...n[1]],i=[];for(const l of a){const u=this.labelCache.has(l)?this.labelCache.get(l):"";i.push(u)}a.push(...i);const s={id:r,label:a.join(`
|
|
45
|
-
`)};return this.hasPhenotypes?this.axons.includes(r)?s.axon=!0:this.dendrites.includes(r)?s.dendrite=!0:s.somas=!0:this.axons.includes(r)?this.dendrites.includes(r)||this.somas.includes(r)?s.somas=!0:s.axon=!0:(this.dendrites.includes(r)||this.somas.includes(r))&&(s.dendrite=!0),s}on(n,r){this.addEventListener(n,r)}};const
|
|
41
|
+
*/var wp=function(e,n){this.recycle(e,n)};function Vi(){return!1}function os(){return!0}wp.prototype={instanceString:function(){return"event"},recycle:function(e,n){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Vi,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?os:Vi):e!=null&&e.type?n=e:this.type=e,n!=null&&(this.originalEvent=n.originalEvent,this.type=n.type!=null?n.type:this.type,this.cy=n.cy,this.target=n.target,this.position=n.position,this.renderedPosition=n.renderedPosition,this.namespace=n.namespace,this.layout=n.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var r=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:r.x*a+i.x,y:r.y*a+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=os;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=os;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=os,this.stopPropagation()},isDefaultPrevented:Vi,isPropagationStopped:Vi,isImmediatePropagationStopped:Vi};var Cp=/^([^.]+)(\.(?:[^.]+))?$/,ID=".*",kp={qualifierCompare:function(e,n){return e===n},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},xp=Object.keys(kp),OD={};function ss(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:OD,e=arguments.length>1?arguments[1]:void 0,n=0;n<xp.length;n++){var r=xp[n];this[r]=t[r]||kp[r]}this.context=e||this.context,this.listeners=[],this.emitting=0}var pr=ss.prototype,Ep=function(e,n,r,a,i,s,l){Ye(a)&&(i=a,a=null),l&&(s==null?s=l:s=xe({},s,l));for(var u=Ke(r)?r:r.split(/\s+/),c=0;c<u.length;c++){var d=u[c];if(!ar(d)){var f=d.match(Cp);if(f){var h=f[1],v=f[2]?f[2]:null,p=n(e,d,h,v,a,i,s);if(p===!1)break}}}},Sp=function(e,n){return e.addEventFields(e.context,n),new wp(n.type,n)},LD=function(e,n,r){if(eS(r)){n(e,r);return}else if(Ie(r)){n(e,Sp(e,r));return}for(var a=Ke(r)?r:r.split(/\s+/),i=0;i<a.length;i++){var s=a[i];if(!ar(s)){var l=s.match(Cp);if(l){var u=l[1],c=l[2]?l[2]:null,d=Sp(e,{type:u,namespace:c,target:e.context});n(e,d)}}}};pr.on=pr.addListener=function(t,e,n,r,a){return Ep(this,function(i,s,l,u,c,d,f){Ye(d)&&i.listeners.push({event:s,callback:d,type:l,namespace:u,qualifier:c,conf:f})},t,e,n,r,a),this},pr.one=function(t,e,n,r){return this.on(t,e,n,r,{one:!0})},pr.removeListener=pr.off=function(t,e,n,r){var a=this;this.emitting!==0&&(this.listeners=cT(this.listeners));for(var i=this.listeners,s=function(c){var d=i[c];Ep(a,function(f,h,v,p,g,y){if((d.type===v||t==="*")&&(!p&&d.namespace!==".*"||d.namespace===p)&&(!g||f.qualifierCompare(d.qualifier,g))&&(!y||d.callback===y))return i.splice(c,1),!1},t,e,n,r)},l=i.length-1;l>=0;l--)s(l);return this},pr.removeAllListeners=function(){return this.removeListener("*")},pr.emit=pr.trigger=function(t,e,n){var r=this.listeners,a=r.length;return this.emitting++,Ke(e)||(e=[e]),LD(this,function(i,s){n!=null&&(r=[{event:s.event,type:s.type,namespace:s.namespace,callback:n}],a=r.length);for(var l=function(d){var f=r[d];if(f.type===s.type&&(!f.namespace||f.namespace===s.namespace||f.namespace===ID)&&i.eventMatches(i.context,f,s)){var h=[s];e!=null&&dT(h,e),i.beforeEmit(i.context,f,s),f.conf&&f.conf.one&&(i.listeners=i.listeners.filter(function(g){return g!==f}));var v=i.callbackContext(i.context,f,s),p=f.callback.apply(v,h);i.afterEmit(i.context,f,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},u=0;u<a;u++)l(u);i.bubble(i.context)&&!s.isPropagationStopped()&&i.parent(i.context).emit(s,e)},t),this.emitting--,this};var MD={qualifierCompare:function(e,n){return e==null||n==null?e==null&&n==null:e.sameText(n)},eventMatches:function(e,n,r){var a=n.qualifier;return a!=null?e!==r.target&&yi(r.target)&&a.matches(r.target):!0},addEventFields:function(e,n){n.cy=e.cy(),n.target=e},callbackContext:function(e,n,r){return n.qualifier!=null?r.target:e},beforeEmit:function(e,n){n.conf&&n.conf.once&&n.conf.onceCollection.removeListener(n.event,n.qualifier,n.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},ls=function(e){return be(e)?new ur(e):e},Tp={createEmitter:function(){for(var e=0;e<this.length;e++){var n=this[e],r=n._private;r.emitter||(r.emitter=new ss(MD,n))}return this},emitter:function(){return this._private.emitter},on:function(e,n,r){for(var a=ls(n),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,r)}return this},removeListener:function(e,n,r){for(var a=ls(n),i=0;i<this.length;i++){var s=this[i];s.emitter().removeListener(e,a,r)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var n=this[e];n.emitter().removeAllListeners()}return this},one:function(e,n,r){for(var a=ls(n),i=0;i<this.length;i++){var s=this[i];s.emitter().one(e,a,r)}return this},once:function(e,n,r){for(var a=ls(n),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,r,{once:!0,onceCollection:this})}},emit:function(e,n){for(var r=0;r<this.length;r++){var a=this[r];a.emitter().emit(e,n)}return this},emitAndNotify:function(e,n){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,n),this}};Re.eventAliasesOn(Tp);var Bp={nodes:function(e){return this.filter(function(n){return n.isNode()}).filter(e)},edges:function(e){return this.filter(function(n){return n.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),n=this.spawn(),r=0;r<this.length;r++){var a=this[r];a.isNode()?e.push(a):n.push(a)}return{nodes:e,edges:n}},filter:function(e,n){if(e===void 0)return this;if(be(e)||Gt(e))return new ur(e).filter(this);if(Ye(e)){for(var r=this.spawn(),a=this,i=0;i<a.length;i++){var s=a[i],l=n?e.apply(n,[s,i,a]):e(s,i,a);l&&r.push(s)}return r}return this.spawn()},not:function(e){if(e){be(e)&&(e=this.filter(e));for(var n=this.spawn(),r=0;r<this.length;r++){var a=this[r],i=e.has(a);i||n.push(a)}return n}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(be(e)){var n=e;return this.filter(n)}for(var r=this.spawn(),a=this,i=e,s=this.length<e.length,l=s?a:i,u=s?i:a,c=0;c<l.length;c++){var d=l[c];u.has(d)&&r.push(d)}return r},xor:function(e){var n=this._private.cy;be(e)&&(e=n.$(e));var r=this.spawn(),a=this,i=e,s=function(u,c){for(var d=0;d<u.length;d++){var f=u[d],h=f._private.data.id,v=c.hasElementWithId(h);v||r.push(f)}};return s(a,i),s(i,a),r},diff:function(e){var n=this._private.cy;be(e)&&(e=n.$(e));var r=this.spawn(),a=this.spawn(),i=this.spawn(),s=this,l=e,u=function(d,f,h){for(var v=0;v<d.length;v++){var p=d[v],g=p._private.data.id,y=f.hasElementWithId(g);y?i.merge(p):h.push(p)}};return u(s,l,r),u(l,s,a),{left:r,right:a,both:i}},add:function(e){var n=this._private.cy;if(!e)return this;if(be(e)){var r=e;e=n.mutableElements().filter(r)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var s=e[i],l=!this.has(s);l&&a.push(s)}return a},merge:function(e){var n=this._private,r=n.cy;if(!e)return this;if(e&&be(e)){var a=e;e=r.mutableElements().filter(a)}for(var i=n.map,s=0;s<e.length;s++){var l=e[s],u=l._private.data.id,c=!i.has(u);if(c){var d=this.length++;this[d]=l,i.set(u,{ele:l,index:d})}}return this},unmergeAt:function(e){var n=this[e],r=n.id(),a=this._private,i=a.map;this[e]=void 0,i.delete(r);var s=e===this.length-1;if(this.length>1&&!s){var l=this.length-1,u=this[l],c=u._private.data.id;this[l]=void 0,this[e]=u,i.set(c,{ele:u,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var n=this._private,r=e._private.data.id,a=n.map,i=a.get(r);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var n=this._private.cy;if(!e)return this;if(e&&be(e)){var r=e;e=n.mutableElements().filter(r)}for(var a=0;a<e.length;a++)this.unmergeOne(e[a]);return this},unmergeBy:function(e){for(var n=this.length-1;n>=0;n--){var r=this[n];e(r)&&this.unmergeAt(n)}return this},map:function(e,n){for(var r=[],a=this,i=0;i<a.length;i++){var s=a[i],l=n?e.apply(n,[s,i,a]):e(s,i,a);r.push(l)}return r},reduce:function(e,n){for(var r=n,a=this,i=0;i<a.length;i++)r=e(r,a[i],i,a);return r},max:function(e,n){for(var r=-1/0,a,i=this,s=0;s<i.length;s++){var l=i[s],u=n?e.apply(n,[l,s,i]):e(l,s,i);u>r&&(r=u,a=l)}return{value:r,ele:a}},min:function(e,n){for(var r=1/0,a,i=this,s=0;s<i.length;s++){var l=i[s],u=n?e.apply(n,[l,s,i]):e(l,s,i);u<r&&(r=u,a=l)}return{value:r,ele:a}}},Le=Bp;Le.u=Le["|"]=Le["+"]=Le.union=Le.or=Le.add,Le["\\"]=Le["!"]=Le["-"]=Le.difference=Le.relativeComplement=Le.subtract=Le.not,Le.n=Le["&"]=Le["."]=Le.and=Le.intersection=Le.intersect,Le["^"]=Le["(+)"]=Le["(-)"]=Le.symmetricDifference=Le.symdiff=Le.xor,Le.fnFilter=Le.filterFn=Le.stdFilter=Le.filter,Le.complement=Le.abscomp=Le.absoluteComplement;var FD={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},Np=function(e,n){var r=e.cy(),a=r.hasCompoundNodes();function i(d){var f=d.pstyle("z-compound-depth");return f.value==="auto"?a?d.zDepth():0:f.value==="bottom"?-1:f.value==="top"?Wl:0}var s=i(e)-i(n);if(s!==0)return s;function l(d){var f=d.pstyle("z-index-compare");return f.value==="auto"&&d.isNode()?1:0}var u=l(e)-l(n);if(u!==0)return u;var c=e.pstyle("z-index").value-n.pstyle("z-index").value;return c!==0?c:e.poolIndex()-n.poolIndex()},cs={forEach:function(e,n){if(Ye(e))for(var r=this.length,a=0;a<r;a++){var i=this[a],s=n?e.apply(n,[i,a,this]):e(i,a,this);if(s===!1)break}return this},toArray:function(){for(var e=[],n=0;n<this.length;n++)e.push(this[n]);return e},slice:function(e,n){var r=[],a=this.length;n==null&&(n=a),e==null&&(e=0),e<0&&(e=a+e),n<0&&(n=a+n);for(var i=e;i>=0&&i<n&&i<a;i++)r.push(this[i]);return this.spawn(r)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!Ye(e))return this;var n=this.toArray().sort(e);return this.spawn(n)},sortByZIndex:function(){return this.sort(Np)},zDepth:function(){var e=this[0];if(e){var n=e._private,r=n.group;if(r==="nodes"){var a=n.data.parent?e.parents().size():0;return e.isParent()?a:Wl-1}else{var i=n.source,s=n.target,l=i.zDepth(),u=s.zDepth();return Math.max(l,u,0)}}}};cs.each=cs.forEach;var AD=function(){var e="undefined",n=(typeof Symbol>"u"?"undefined":st(Symbol))!=e&&st(Symbol.iterator)!=e;n&&(cs[Symbol.iterator]=function(){var r=this,a={value:void 0,done:!1},i=0,s=this.length;return zf({next:function(){return i<s?a.value=r[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};AD();var VD=wt({nodeDimensionsIncludeLabels:!1}),us={layoutDimensions:function(e){e=VD(e);var n;if(!this.takesUpSpace())n={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var r=this.boundingBox();n={w:r.w,h:r.h}}else n={w:this.outerWidth(),h:this.outerHeight()};return(n.w===0||n.h===0)&&(n.w=n.h=1),n},layoutPositions:function(e,n,r){var a=this.nodes().filter(function(E){return!E.isParent()}),i=this.cy(),s=n.eles,l=function(x){return x.id()},u=bi(r,l);e.emit({type:"layoutstart",layout:e}),e.animations=[];var c=function(x,k,B){var S={x:k.x1+k.w/2,y:k.y1+k.h/2},N={x:(B.x-S.x)*x,y:(B.y-S.y)*x};return{x:S.x+N.x,y:S.y+N.y}},d=n.spacingFactor&&n.spacingFactor!==1,f=function(){if(!d)return null;for(var x=zt(),k=0;k<a.length;k++){var B=a[k],S=u(B,k);RT(x,S.x,S.y)}return x},h=f(),v=bi(function(E,x){var k=u(E,x);if(d){var B=Math.abs(n.spacingFactor);k=c(B,h,k)}return n.transform!=null&&(k=n.transform(E,k)),k},l);if(n.animate){for(var p=0;p<a.length;p++){var g=a[p],y=v(g,p),m=n.animateFilter==null||n.animateFilter(g,p);if(m){var b=g.animation({position:y,duration:n.animationDuration,easing:n.animationEasing});e.animations.push(b)}else g.position(y)}if(n.fit){var w=i.animation({fit:{boundingBox:s.boundingBoxAt(v),padding:n.padding},duration:n.animationDuration,easing:n.animationEasing});e.animations.push(w)}else if(n.zoom!==void 0&&n.pan!==void 0){var C=i.animation({zoom:n.zoom,pan:n.pan,duration:n.animationDuration,easing:n.animationEasing});e.animations.push(C)}e.animations.forEach(function(E){return E.play()}),e.one("layoutready",n.ready),e.emit({type:"layoutready",layout:e}),Ea.all(e.animations.map(function(E){return E.promise()})).then(function(){e.one("layoutstop",n.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(v),n.fit&&i.fit(n.eles,n.padding),n.zoom!=null&&i.zoom(n.zoom),n.pan&&i.pan(n.pan),e.one("layoutready",n.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",n.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var n=this.cy();return n.makeLayout(xe({},e,{eles:this}))}};us.createLayout=us.makeLayout=us.layout;function Dp(t,e,n){var r=n._private,a=r.styleCache=r.styleCache||[],i;return(i=a[t])!=null||(i=a[t]=e(n)),i}function ds(t,e){return t=Mr(t),function(r){return Dp(t,e,r)}}function fs(t,e){t=Mr(t);var n=function(a){return e.call(a)};return function(){var a=this[0];if(a)return Dp(t,n,a)}}var Ct={recalculateRenderedStyle:function(e){var n=this.cy(),r=n.renderer(),a=n.styleEnabled();return r&&a&&r.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),n=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var r;r=this.spawnSelf().merge(this.descendants()).merge(this.parents()),r.merge(r.connectedEdges()),r.forEach(n)}else this.forEach(function(a){n(a),a.connectedEdges().forEach(n)});return this},updateStyle:function(e){var n=this._private.cy;if(!n.styleEnabled())return this;if(n.batching()){var r=n._private.batchStyleEles;return r.merge(this),this}var a=n.hasCompoundNodes(),i=this;e=!!(e||e===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=i;return e?s.emitAndNotify("style"):s.emit("style"),i.forEach(function(l){return l._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var n=0;n<this.length;n++){var r=this[n];r._private.styleDirty&&(r._private.styleDirty=!1,e.style().apply(r))}},parsedStyle:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this[0],a=r.cy();if(a.styleEnabled()&&r){this.cleanStyle();var i=r._private.style[e];return i??(n?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var n=this[0];if(n.cy().styleEnabled()&&n){var r=n.pstyle(e);return r.pfValue!==void 0?r.pfValue:r.value}},numericStyleUnits:function(e){var n=this[0];if(n.cy().styleEnabled()&&n)return n.pstyle(e).units},renderedStyle:function(e){var n=this.cy();if(!n.styleEnabled())return this;var r=this[0];if(r)return n.style().getRenderedStyle(r,e)},style:function(e,n){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,i=r.style();if(Ie(e)){var s=e;i.applyBypass(this,s,a),this.emitAndNotify("style")}else if(be(e))if(n===void 0){var l=this[0];return l?i.getStylePropertyValue(l,e):void 0}else i.applyBypass(this,e,n,a),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?i.getRawStyle(u):void 0}return this},removeStyle:function(e){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,a=n.style(),i=this;if(e===void 0)for(var s=0;s<i.length;s++){var l=i[s];a.removeAllBypasses(l,r)}else{e=e.split(/\s+/);for(var u=0;u<i.length;u++){var c=i[u];a.removeBypasses(c,e,r)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var n=e.hasCompoundNodes(),r=this[0];if(r){var a=r._private,i=r.pstyle("opacity").value;if(!n)return i;var s=a.data.parent?r.parents():null;if(s)for(var l=0;l<s.length;l++){var u=s[l],c=u.pstyle("opacity").value;i=c*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var n=this[0],r=n.cy().hasCompoundNodes();if(n)return r?n.effectiveOpacity()===0:n.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var n=this[0];return!!n._private.backgrounding}};function mc(t,e){var n=t._private,r=n.data.parent?t.parents():null;if(r)for(var a=0;a<r.length;a++){var i=r[a];if(!e(i))return!1}return!0}function yc(t){var e=t.ok,n=t.edgeOkViaNode||t.ok,r=t.parentOk||t.ok;return function(){var a=this.cy();if(!a.styleEnabled())return!0;var i=this[0],s=a.hasCompoundNodes();if(i){var l=i._private;if(!e(i))return!1;if(i.isNode())return!s||mc(i,r);var u=l.source,c=l.target;return n(u)&&(!s||mc(u,n))&&(u===c||n(c)&&(!s||mc(c,n)))}}}var Ia=ds("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Ct.takesUpSpace=fs("takesUpSpace",yc({ok:Ia}));var RD=ds("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Ia(t)}),$D=ds("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Ia(t)});Ct.interactive=fs("interactive",yc({ok:RD,parentOk:$D,edgeOkViaNode:Ia})),Ct.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var zD=ds("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Ia(t)}),HD=Ia;Ct.visible=fs("visible",yc({ok:zD,edgeOkViaNode:HD})),Ct.hidden=function(){var t=this[0];if(t)return!t.visible()},Ct.isBundledBezier=fs("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),Ct.bypass=Ct.css=Ct.style,Ct.renderedCss=Ct.renderedStyle,Ct.removeBypass=Ct.removeCss=Ct.removeStyle,Ct.pstyle=Ct.parsedStyle;var vr={};function _p(t){return function(){var e=arguments,n=[];if(e.length===2){var r=e[0],a=e[1];this.on(t.event,r,a)}else if(e.length===1&&Ye(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&Ke(e[0])){for(var s=e.length===1?e[0]:null,l=0;l<this.length;l++){var u=this[l],c=!t.ableField||u._private[t.ableField],d=u._private[t.field]!=t.value;if(t.overrideAble){var f=t.overrideAble(u);if(f!==void 0&&(c=f,!f))return this}c&&(u._private[t.field]=t.value,d&&n.push(u))}var h=this.spawn(n);h.updateStyle(),h.emit(t.event),s&&h.emit(s)}return this}}function Oa(t){vr[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var n=t.overrideField(e);if(n!==void 0)return n}return e._private[t.field]}},vr[t.on]=_p({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),vr[t.off]=_p({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Oa({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),Oa({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),Oa({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),Oa({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),vr.deselect=vr.unselect,vr.grabbed=function(){var t=this[0];if(t)return t._private.grabbed},Oa({field:"active",on:"activate",off:"unactivate"}),Oa({field:"pannable",on:"panify",off:"unpanify"}),vr.inactive=function(){var t=this[0];if(t)return!t._private.active};var Tt={},Pp=function(e){return function(r){for(var a=this,i=[],s=0;s<a.length;s++){var l=a[s];if(l.isNode()){for(var u=!1,c=l.connectedEdges(),d=0;d<c.length;d++){var f=c[d],h=f.source(),v=f.target();if(e.noIncomingEdges&&v===l&&h!==l||e.noOutgoingEdges&&h===l&&v!==l){u=!0;break}}u||i.push(l)}}return this.spawn(i,!0).filter(r)}},Ip=function(e){return function(n){for(var r=this,a=[],i=0;i<r.length;i++){var s=r[i];if(s.isNode())for(var l=s.connectedEdges(),u=0;u<l.length;u++){var c=l[u],d=c.source(),f=c.target();e.outgoing&&d===s?(a.push(c),a.push(f)):e.incoming&&f===s&&(a.push(c),a.push(d))}}return this.spawn(a,!0).filter(n)}},Op=function(e){return function(n){for(var r=this,a=[],i={};;){var s=e.outgoing?r.outgoers():r.incomers();if(s.length===0)break;for(var l=!1,u=0;u<s.length;u++){var c=s[u],d=c.id();i[d]||(i[d]=!0,a.push(c),l=!0)}if(!l)break;r=s}return this.spawn(a,!0).filter(n)}};Tt.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null},xe(Tt,{roots:Pp({noIncomingEdges:!0}),leaves:Pp({noOutgoingEdges:!0}),outgoers:en(Ip({outgoing:!0}),"outgoers"),successors:Op({outgoing:!0}),incomers:en(Ip({incoming:!0}),"incomers"),predecessors:Op({incoming:!0})}),xe(Tt,{neighborhood:en(function(t){for(var e=[],n=this.nodes(),r=0;r<n.length;r++)for(var a=n[r],i=a.connectedEdges(),s=0;s<i.length;s++){var l=i[s],u=l.source(),c=l.target(),d=a===u?c:u;d.length>0&&e.push(d[0]),e.push(l[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Tt.neighbourhood=Tt.neighborhood,Tt.closedNeighbourhood=Tt.closedNeighborhood,Tt.openNeighbourhood=Tt.openNeighborhood,xe(Tt,{source:en(function(e){var n=this[0],r;return n&&(r=n._private.source||n.cy().collection()),r&&e?r.filter(e):r},"source"),target:en(function(e){var n=this[0],r;return n&&(r=n._private.target||n.cy().collection()),r&&e?r.filter(e):r},"target"),sources:Lp({attr:"source"}),targets:Lp({attr:"target"})});function Lp(t){return function(n){for(var r=[],a=0;a<this.length;a++){var i=this[a],s=i._private[t.attr];s&&r.push(s)}return this.spawn(r,!0).filter(n)}}xe(Tt,{edgesWith:en(Mp(),"edgesWith"),edgesTo:en(Mp({thisIsSrc:!0}),"edgesTo")});function Mp(t){return function(n){var r=[],a=this._private.cy,i=t||{};be(n)&&(n=a.$(n));for(var s=0;s<n.length;s++)for(var l=n[s]._private.edges,u=0;u<l.length;u++){var c=l[u],d=c._private.data,f=this.hasElementWithId(d.source)&&n.hasElementWithId(d.target),h=n.hasElementWithId(d.source)&&this.hasElementWithId(d.target),v=f||h;v&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!f||i.thisIsTgt&&!h)||r.push(c))}return this.spawn(r,!0)}}xe(Tt,{connectedEdges:en(function(t){for(var e=[],n=this,r=0;r<n.length;r++){var a=n[r];if(a.isNode())for(var i=a._private.edges,s=0;s<i.length;s++){var l=i[s];e.push(l)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:en(function(t){for(var e=[],n=this,r=0;r<n.length;r++){var a=n[r];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:en(Fp(),"parallelEdges"),codirectedEdges:en(Fp({codirected:!0}),"codirectedEdges")});function Fp(t){var e={codirected:!1};return t=xe({},e,t),function(r){for(var a=[],i=this.edges(),s=t,l=0;l<i.length;l++)for(var u=i[l],c=u._private,d=c.source,f=d._private.data.id,h=c.data.target,v=d._private.edges,p=0;p<v.length;p++){var g=v[p],y=g._private.data,m=y.target,b=y.source,w=m===h&&b===f,C=f===m&&h===b;(s.codirected&&w||!s.codirected&&(w||C))&&a.push(g)}return this.spawn(a,!0).filter(r)}}xe(Tt,{components:function(e){var n=this,r=n.cy(),a=r.collection(),i=e==null?n.nodes():e.nodes(),s=[];e!=null&&i.empty()&&(i=e.sources());var l=function(d,f){a.merge(d),i.unmerge(d),f.merge(d)};if(i.empty())return n.spawn();var u=function(){var d=r.collection();s.push(d);var f=i[0];l(f,d),n.bfs({directed:!1,roots:f,visit:function(v){return l(v,d)}}),d.forEach(function(h){h.connectedEdges().forEach(function(v){n.has(v)&&d.has(v.source())&&d.has(v.target())&&d.merge(v)})})};do u();while(i.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Tt.componentsOf=Tt.components;var kt=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Ze("A collection must have a reference to the core");return}var i=new xn,s=!1;if(!n)n=[];else if(n.length>0&&Ie(n[0])&&!yi(n[0])){s=!0;for(var l=[],u=new ma,c=0,d=n.length;c<d;c++){var f=n[c];f.data==null&&(f.data={});var h=f.data;if(h.id==null)h.id=hh();else if(e.hasElementWithId(h.id)||u.has(h.id))continue;var v=new zo(e,f,!1);l.push(v),u.add(h.id)}n=l}this.length=0;for(var p=0,g=n.length;p<g;p++){var y=n[p][0];if(y!=null){var m=y._private.data.id;(!r||!i.has(m))&&(r&&i.set(m,{index:this.length,ele:y}),this[this.length]=y,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(b){this.lazyMap=b},rebuildMap:function(){for(var w=this.lazyMap=new xn,C=this.eles,E=0;E<C.length;E++){var x=C[E];w.set(x.id(),{index:E,ele:x})}}},r&&(this._private.map=i),s&&!a&&this.restore()},qe=zo.prototype=kt.prototype=Object.create(Array.prototype);qe.instanceString=function(){return"collection"},qe.spawn=function(t,e){return new kt(this.cy(),t,e)},qe.spawnSelf=function(){return this.spawn(this)},qe.cy=function(){return this._private.cy},qe.renderer=function(){return this._private.cy.renderer()},qe.element=function(){return this[0]},qe.collection=function(){return Wf(this)?this:new kt(this._private.cy,[this])},qe.unique=function(){return new kt(this._private.cy,this,!0)},qe.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)},qe.getElementById=function(t){t=""+t;var e=this._private.cy,n=this._private.map.get(t);return n?n.ele:new kt(e)},qe.$id=qe.getElementById,qe.poolIndex=function(){var t=this._private.cy,e=t._private.elements,n=this[0]._private.data.id;return e._private.map.get(n).index},qe.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index},qe.indexOfId=function(t){return t=""+t,this._private.map.get(t).index},qe.json=function(t){var e=this.element(),n=this.cy();if(e==null&&t)return this;if(e!=null){var r=e._private;if(Ie(t)){if(n.startBatch(),t.data){e.data(t.data);var a=r.data;if(e.isEdge()){var i=!1,s={},l=t.data.source,u=t.data.target;l!=null&&l!=a.source&&(s.source=""+l,i=!0),u!=null&&u!=a.target&&(s.target=""+u,i=!0),i&&(e=e.move(s))}else{var c="parent"in t.data,d=t.data.parent;c&&(d!=null||a.parent!=null)&&d!=a.parent&&(d===void 0&&(d=null),d!=null&&(d=""+d),e=e.move({parent:d}))}}t.position&&e.position(t.position);var f=function(g,y,m){var b=t[g];b!=null&&b!==r[g]&&(b?e[y]():e[m]())};return f("removed","remove","restore"),f("selected","select","unselect"),f("selectable","selectify","unselectify"),f("locked","lock","unlock"),f("grabbable","grabify","ungrabify"),f("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),n.endBatch(),this}else if(t===void 0){var h={data:kn(r.data),position:kn(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};h.classes="";var v=0;return r.classes.forEach(function(p){return h.classes+=v++===0?p:" "+p}),h}}},qe.jsons=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e],r=n.json();t.push(r)}return t},qe.clone=function(){for(var t=this.cy(),e=[],n=0;n<this.length;n++){var r=this[n],a=r.json(),i=new zo(t,a,!1);e.push(i)}return new kt(t,e)},qe.copy=qe.clone,qe.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=n.cy(),a=r._private,i=[],s=[],l,u=0,c=n.length;u<c;u++){var d=n[u];e&&!d.removed()||(d.isNode()?i.push(d):s.push(d))}l=i.concat(s);var f,h=function(){l.splice(f,1),f--};for(f=0;f<l.length;f++){var v=l[f],p=v._private,g=p.data;if(v.clearTraversalCache(),!(!e&&!p.removed)){if(g.id===void 0)g.id=hh();else if(le(g.id))g.id=""+g.id;else if(ar(g.id)||!be(g.id)){Ze("Can not create element with invalid string ID `"+g.id+"`"),h();continue}else if(r.hasElementWithId(g.id)){Ze("Can not create second element with ID `"+g.id+"`"),h();continue}}var y=g.id;if(v.isNode()){var m=p.position;m.x==null&&(m.x=0),m.y==null&&(m.y=0)}if(v.isEdge()){for(var b=v,w=["source","target"],C=w.length,E=!1,x=0;x<C;x++){var k=w[x],B=g[k];le(B)&&(B=g[k]=""+g[k]),B==null||B===""?(Ze("Can not create edge `"+y+"` with unspecified "+k),E=!0):r.hasElementWithId(B)||(Ze("Can not create edge `"+y+"` with nonexistant "+k+" `"+B+"`"),E=!0)}if(E){h();continue}var S=r.getElementById(g.source),N=r.getElementById(g.target);S.same(N)?S._private.edges.push(b):(S._private.edges.push(b),N._private.edges.push(b)),b._private.source=S,b._private.target=N}p.map=new xn,p.map.set(y,{ele:v,index:0}),p.removed=!1,e&&r.addToPool(v)}for(var D=0;D<i.length;D++){var _=i[D],O=_._private.data;le(O.parent)&&(O.parent=""+O.parent);var P=O.parent,F=P!=null;if(F||_._private.parent){var I=_._private.parent?r.collection().merge(_._private.parent):r.getElementById(P);if(I.empty())O.parent=void 0;else if(I[0].removed())Ve("Node added with missing parent, reference to parent removed"),O.parent=void 0,_._private.parent=null;else{for(var M=!1,L=I;!L.empty();){if(_.same(L)){M=!0,O.parent=void 0;break}L=L.parent()}M||(I[0]._private.children.push(_),_._private.parent=I[0],a.hasCompoundNodes=!0)}}}if(l.length>0){for(var V=l.length===n.length?n:new kt(r,l),H=0;H<V.length;H++){var $=V[H];$.isNode()||($.parallelEdges().clearTraversalCache(),$.source().clearTraversalCache(),$.target().clearTraversalCache())}var z;a.hasCompoundNodes?z=r.collection().merge(V).merge(V.connectedNodes()).merge(V.parent()):z=V,z.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?V.emitAndNotify("add"):e&&V.emit("add")}return n},qe.removed=function(){var t=this[0];return t&&t._private.removed},qe.inside=function(){var t=this[0];return t&&!t._private.removed},qe.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=[],a={},i=n._private.cy;function s(P){for(var F=P._private.edges,I=0;I<F.length;I++)u(F[I])}function l(P){for(var F=P._private.children,I=0;I<F.length;I++)u(F[I])}function u(P){var F=a[P.id()];e&&P.removed()||F||(a[P.id()]=!0,P.isNode()?(r.push(P),s(P),l(P)):r.unshift(P))}for(var c=0,d=n.length;c<d;c++){var f=n[c];u(f)}function h(P,F){var I=P._private.edges;or(I,F),P.clearTraversalCache()}function v(P){P.clearTraversalCache()}var p=[];p.ids={};function g(P,F){F=F[0],P=P[0];var I=P._private.children,M=P.id();or(I,F),F._private.parent=null,p.ids[M]||(p.ids[M]=!0,p.push(P))}n.dirtyCompoundBoundsCache(),e&&i.removeFromPool(r);for(var y=0;y<r.length;y++){var m=r[y];if(m.isEdge()){var b=m.source()[0],w=m.target()[0];h(b,m),h(w,m);for(var C=m.parallelEdges(),E=0;E<C.length;E++){var x=C[E];v(x),x.isBundledBezier()&&x.dirtyBoundingBoxCache()}}else{var k=m.parent();k.length!==0&&g(k,m)}e&&(m._private.removed=!0)}var B=i._private.elements;i._private.hasCompoundNodes=!1;for(var S=0;S<B.length;S++){var N=B[S];if(N.isParent()){i._private.hasCompoundNodes=!0;break}}var D=new kt(this.cy(),r);D.size()>0&&(t?D.emitAndNotify("remove"):e&&D.emit("remove"));for(var _=0;_<p.length;_++){var O=p[_];(!e||!O.removed())&&O.updateStyle()}return D},qe.move=function(t){var e=this._private.cy,n=this,r=!1,a=!1,i=function(p){return p==null?p:""+p};if(t.source!==void 0||t.target!==void 0){var s=i(t.source),l=i(t.target),u=s!=null&&e.hasElementWithId(s),c=l!=null&&e.hasElementWithId(l);(u||c)&&(e.batch(function(){n.remove(r,a),n.emitAndNotify("moveout");for(var v=0;v<n.length;v++){var p=n[v],g=p._private.data;p.isEdge()&&(u&&(g.source=s),c&&(g.target=l))}n.restore(r,a)}),n.emitAndNotify("move"))}else if(t.parent!==void 0){var d=i(t.parent),f=d===null||e.hasElementWithId(d);if(f){var h=d===null?void 0:d;e.batch(function(){var v=n.remove(r,a);v.emitAndNotify("moveout");for(var p=0;p<n.length;p++){var g=n[p],y=g._private.data;g.isNode()&&(y.parent=h)}v.restore(r,a)}),n.emitAndNotify("move")}}return this},[$h,J5,rs,fr,Da,vD,as,PD,Tp,Bp,FD,cs,us,Ct,vr,Tt].forEach(function(t){xe(qe,t)});var KD={add:function(e){var n,r=this;if(Gt(e)){var a=e;if(a._private.cy===r)n=a.restore();else{for(var i=[],s=0;s<a.length;s++){var l=a[s];i.push(l.json())}n=new kt(r,i)}}else if(Ke(e)){var u=e;n=new kt(r,u)}else if(Ie(e)&&(Ke(e.nodes)||Ke(e.edges))){for(var c=e,d=[],f=["nodes","edges"],h=0,v=f.length;h<v;h++){var p=f[h],g=c[p];if(Ke(g))for(var y=0,m=g.length;y<m;y++){var b=xe({group:p},g[y]);d.push(b)}}n=new kt(r,d)}else{var w=e;n=new zo(r,w).collection()}return n},remove:function(e){if(!Gt(e)){if(be(e)){var n=e;e=this.$(n)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function qD(t,e,n,r){var a=4,i=.001,s=1e-7,l=10,u=11,c=1/(u-1),d=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var f=0;f<4;++f)if(typeof arguments[f]!="number"||isNaN(arguments[f])||!isFinite(arguments[f]))return!1;t=Math.min(t,1),n=Math.min(n,1),t=Math.max(t,0),n=Math.max(n,0);var h=d?new Float32Array(u):new Array(u);function v(N,D){return 1-3*D+3*N}function p(N,D){return 3*D-6*N}function g(N){return 3*N}function y(N,D,_){return((v(D,_)*N+p(D,_))*N+g(D))*N}function m(N,D,_){return 3*v(D,_)*N*N+2*p(D,_)*N+g(D)}function b(N,D){for(var _=0;_<a;++_){var O=m(D,t,n);if(O===0)return D;var P=y(D,t,n)-N;D-=P/O}return D}function w(){for(var N=0;N<u;++N)h[N]=y(N*c,t,n)}function C(N,D,_){var O,P,F=0;do P=D+(_-D)/2,O=y(P,t,n)-N,O>0?_=P:D=P;while(Math.abs(O)>s&&++F<l);return P}function E(N){for(var D=0,_=1,O=u-1;_!==O&&h[_]<=N;++_)D+=c;--_;var P=(N-h[_])/(h[_+1]-h[_]),F=D+P*c,I=m(F,t,n);return I>=i?b(N,F):I===0?F:C(N,D,D+c)}var x=!1;function k(){x=!0,(t!==e||n!==r)&&w()}var B=function(D){return x||k(),t===e&&n===r?D:D===0?0:D===1?1:y(E(D),e,r)};B.getControlPoints=function(){return[{x:t,y:e},{x:n,y:r}]};var S="generateBezier("+[t,e,n,r]+")";return B.toString=function(){return S},B}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var UD=function(){function t(r){return-r.tension*r.x-r.friction*r.v}function e(r,a,i){var s={x:r.x+i.dx*a,v:r.v+i.dv*a,tension:r.tension,friction:r.friction};return{dx:s.v,dv:t(s)}}function n(r,a){var i={dx:r.v,dv:t(r)},s=e(r,a*.5,i),l=e(r,a*.5,s),u=e(r,a,l),c=1/6*(i.dx+2*(s.dx+l.dx)+u.dx),d=1/6*(i.dv+2*(s.dv+l.dv)+u.dv);return r.x=r.x+c*a,r.v=r.v+d*a,r}return function r(a,i,s){var l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,d=1/1e4,f=16/1e3,h,v,p;for(a=parseFloat(a)||500,i=parseFloat(i)||20,s=s||null,l.tension=a,l.friction=i,h=s!==null,h?(c=r(a,i),v=c/s*f):v=f;p=n(p||l,v),u.push(1+p.x),c+=16,Math.abs(p.x)>d&&Math.abs(p.v)>d;);return h?function(g){return u[g*(u.length-1)|0]}:c}}(),Ue=function(e,n,r,a){var i=qD(e,n,r,a);return function(s,l,u){return s+(l-s)*i(u)}},hs={linear:function(e,n,r){return e+(n-e)*r},ease:Ue(.25,.1,.25,1),"ease-in":Ue(.42,0,1,1),"ease-out":Ue(0,0,.58,1),"ease-in-out":Ue(.42,0,.58,1),"ease-in-sine":Ue(.47,0,.745,.715),"ease-out-sine":Ue(.39,.575,.565,1),"ease-in-out-sine":Ue(.445,.05,.55,.95),"ease-in-quad":Ue(.55,.085,.68,.53),"ease-out-quad":Ue(.25,.46,.45,.94),"ease-in-out-quad":Ue(.455,.03,.515,.955),"ease-in-cubic":Ue(.55,.055,.675,.19),"ease-out-cubic":Ue(.215,.61,.355,1),"ease-in-out-cubic":Ue(.645,.045,.355,1),"ease-in-quart":Ue(.895,.03,.685,.22),"ease-out-quart":Ue(.165,.84,.44,1),"ease-in-out-quart":Ue(.77,0,.175,1),"ease-in-quint":Ue(.755,.05,.855,.06),"ease-out-quint":Ue(.23,1,.32,1),"ease-in-out-quint":Ue(.86,0,.07,1),"ease-in-expo":Ue(.95,.05,.795,.035),"ease-out-expo":Ue(.19,1,.22,1),"ease-in-out-expo":Ue(1,0,0,1),"ease-in-circ":Ue(.6,.04,.98,.335),"ease-out-circ":Ue(.075,.82,.165,1),"ease-in-out-circ":Ue(.785,.135,.15,.86),spring:function(e,n,r){if(r===0)return hs.linear;var a=UD(e,n,r);return function(i,s,l){return i+(s-i)*a(l)}},"cubic-bezier":Ue};function Ap(t,e,n,r,a){if(r===1||e===n)return n;var i=a(e,n,r);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}function Vp(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function La(t,e,n,r,a){var i=a!=null?a.type:null;n<0?n=0:n>1&&(n=1);var s=Vp(t,a),l=Vp(e,a);if(le(s)&&le(l))return Ap(i,s,l,n,r);if(Ke(s)&&Ke(l)){for(var u=[],c=0;c<l.length;c++){var d=s[c],f=l[c];if(d!=null&&f!=null){var h=Ap(i,d,f,n,r);u.push(h)}else u.push(f)}return u}}function GD(t,e,n,r){var a=!r,i=t._private,s=e._private,l=s.easing,u=s.startTime,c=r?t:t.cy(),d=c.style();if(!s.easingImpl)if(l==null)s.easingImpl=hs.linear;else{var f;if(be(l)){var h=d.parse("transition-timing-function",l);f=h.value}else f=l;var v,p;be(f)?(v=f,p=[]):(v=f[1],p=f.slice(2).map(function(V){return+V})),p.length>0?(v==="spring"&&p.push(s.duration),s.easingImpl=hs[v].apply(null,p)):s.easingImpl=hs[v]}var g=s.easingImpl,y;if(s.duration===0?y=1:y=(n-u)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var m=s.startPosition,b=s.position;if(b&&a&&!t.locked()){var w={};Ri(m.x,b.x)&&(w.x=La(m.x,b.x,y,g)),Ri(m.y,b.y)&&(w.y=La(m.y,b.y,y,g)),t.position(w)}var C=s.startPan,E=s.pan,x=i.pan,k=E!=null&&r;k&&(Ri(C.x,E.x)&&(x.x=La(C.x,E.x,y,g)),Ri(C.y,E.y)&&(x.y=La(C.y,E.y,y,g)),t.emit("pan"));var B=s.startZoom,S=s.zoom,N=S!=null&&r;N&&(Ri(B,S)&&(i.zoom=Ni(i.minZoom,La(B,S,y,g),i.maxZoom)),t.emit("zoom")),(k||N)&&t.emit("viewport");var D=s.style;if(D&&D.length>0&&a){for(var _=0;_<D.length;_++){var O=D[_],P=O.name,F=O,I=s.startStyle[P],M=d.properties[I.name],L=La(I,F,y,g,M);d.overrideBypass(t,P,L)}t.emit("style")}}return s.progress=y,y}function Ri(t,e){return t==null||e==null?!1:le(t)&&le(e)?!0:!!(t&&e)}function WD(t,e,n,r){var a=e._private;a.started=!0,a.startTime=n-a.progress*a.duration}function Rp(t,e){var n=e._private.aniEles,r=[];function a(d,f){var h=d._private,v=h.animation.current,p=h.animation.queue,g=!1;if(v.length===0){var y=p.shift();y&&v.push(y)}for(var m=function(x){for(var k=x.length-1;k>=0;k--){var B=x[k];B()}x.splice(0,x.length)},b=v.length-1;b>=0;b--){var w=v[b],C=w._private;if(C.stopped){v.splice(b,1),C.hooked=!1,C.playing=!1,C.started=!1,m(C.frames);continue}!C.playing&&!C.applying||(C.playing&&C.applying&&(C.applying=!1),C.started||WD(d,w,t),GD(d,w,t,f),C.applying&&(C.applying=!1),m(C.frames),C.step!=null&&C.step(t),w.completed()&&(v.splice(b,1),C.hooked=!1,C.playing=!1,C.started=!1,m(C.completes)),g=!0)}return!f&&v.length===0&&p.length===0&&r.push(d),g}for(var i=!1,s=0;s<n.length;s++){var l=n[s],u=a(l);i=i||u}var c=a(e,!0);(i||c)&&(n.length>0?e.notify("draw",n):e.notify("draw")),n.unmerge(r),e.emit("step")}var jD={animate:Re.animate(),animation:Re.animation(),animated:Re.animated(),clearQueue:Re.clearQueue(),delay:Re.delay(),delayAnimation:Re.delayAnimation(),stop:Re.stop(),addToAnimationPool:function(e){var n=this;n.styleEnabled()&&n._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function n(){e._private.animationsRunning&&Vo(function(i){Rp(i,e),n()})}var r=e.renderer();r&&r.beforeRender?r.beforeRender(function(i,s){Rp(s,e)},r.beforeRenderPriorities.animations):n()}},YD={qualifierCompare:function(e,n){return e==null||n==null?e==null&&n==null:e.sameText(n)},eventMatches:function(e,n,r){var a=n.qualifier;return a!=null?e!==r.target&&yi(r.target)&&a.matches(r.target):!0},addEventFields:function(e,n){n.cy=e,n.target=e},callbackContext:function(e,n,r){return n.qualifier!=null?r.target:e}},ps=function(e){return be(e)?new ur(e):e},$p={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new ss(YD,this)),this},emitter:function(){return this._private.emitter},on:function(e,n,r){return this.emitter().on(e,ps(n),r),this},removeListener:function(e,n,r){return this.emitter().removeListener(e,ps(n),r),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,n,r){return this.emitter().one(e,ps(n),r),this},once:function(e,n,r){return this.emitter().one(e,ps(n),r),this},emit:function(e,n){return this.emitter().emit(e,n),this},emitAndNotify:function(e,n){return this.emit(e),this.notify(e,n),this}};Re.eventAliasesOn($p);var bc={png:function(e){var n=this._private.renderer;return e=e||{},n.png(e)},jpg:function(e){var n=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",n.jpg(e)}};bc.jpeg=bc.jpg;var vs={layout:function(e){var n=this;if(e==null){Ze("Layout options must be specified to make a layout");return}if(e.name==null){Ze("A `name` must be specified to make a layout");return}var r=e.name,a=n.extension("layout",r);if(a==null){Ze("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;be(e.eles)?i=n.$(e.eles):i=e.eles!=null?e.eles:n.$();var s=new a(xe({},e,{cy:n,eles:i}));return s}};vs.createLayout=vs.makeLayout=vs.layout;var ZD={notify:function(e,n){var r=this._private;if(this.batching()){r.batchNotifications=r.batchNotifications||{};var a=r.batchNotifications[e]=r.batchNotifications[e]||this.collection();n!=null&&a.merge(n);return}if(r.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,n)}},notifications:function(e){var n=this._private;return e===void 0?n.notificationsEnabled:(n.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var n=this.renderer();Object.keys(e.batchNotifications).forEach(function(r){var a=e.batchNotifications[r];a.empty()?n.notify(r):n.notify(r,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var n=this;return this.batch(function(){for(var r=Object.keys(e),a=0;a<r.length;a++){var i=r[a],s=e[i],l=n.getElementById(i);l.data(s)}})}},XD=wt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),wc={renderTo:function(e,n,r,a){var i=this._private.renderer;return i.renderTo(e,n,r,a),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var n=this,r=n.extension("renderer",e.name);if(r==null){Ze("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Ve("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var a=XD(e);a.cy=n,n._private.renderer=new r(a),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var n=e.container();if(n)for(n._cyreg=null;n.childNodes.length>0;)n.removeChild(n.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(r){var a=r._private;a.rscratch={},a.rstyle={},a.animation.current=[],a.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};wc.invalidateDimensions=wc.resize;var gs={collection:function(e,n){return be(e)?this.$(e):Gt(e)?e.collection():Ke(e)?(n||(n={}),new kt(this,e,n.unique,n.removed)):new kt(this)},nodes:function(e){var n=this.$(function(r){return r.isNode()});return e?n.filter(e):n},edges:function(e){var n=this.$(function(r){return r.isEdge()});return e?n.filter(e):n},$:function(e){var n=this._private.elements;return e?n.filter(e):n.spawnSelf()},mutableElements:function(){return this._private.elements}};gs.elements=gs.filter=gs.$;var Bt={},$i="t",QD="f";Bt.apply=function(t){for(var e=this,n=e._private,r=n.cy,a=r.collection(),i=0;i<t.length;i++){var s=t[i],l=e.getContextMeta(s);if(!l.empty){var u=e.getContextStyle(l),c=e.applyContextStyle(l,u,s);s._private.appliedInitStyle?e.updateTransitions(s,c.diffProps):s._private.appliedInitStyle=!0;var d=e.updateStyleHints(s);d&&a.push(s)}}return a},Bt.getPropertiesDiff=function(t,e){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},a=t+"-"+e,i=r[a];if(i)return i;for(var s=[],l={},u=0;u<n.length;u++){var c=n[u],d=t[u]===$i,f=e[u]===$i,h=d!==f,v=c.mappedProperties.length>0;if(h||f&&v){var p=void 0;h&&v||h?p=c.properties:v&&(p=c.mappedProperties);for(var g=0;g<p.length;g++){for(var y=p[g],m=y.name,b=!1,w=u+1;w<n.length;w++){var C=n[w],E=e[w]===$i;if(E&&(b=C.properties[y.name]!=null,b))break}!l[m]&&!b&&(l[m]=!0,s.push(m))}}}return r[a]=s,s},Bt.getContextMeta=function(t){for(var e=this,n="",r,a=t._private.styleCxtKey||"",i=0;i<e.length;i++){var s=e[i],l=s.selector&&s.selector.matches(t);l?n+=$i:n+=QD}return r=e.getPropertiesDiff(a,n),t._private.styleCxtKey=n,{key:n,diffPropNames:r,empty:r.length===0}},Bt.getContextStyle=function(t){var e=t.key,n=this,r=this._private.contextStyles=this._private.contextStyles||{};if(r[e])return r[e];for(var a={_private:{key:e}},i=0;i<n.length;i++){var s=n[i],l=e[i]===$i;if(l)for(var u=0;u<s.properties.length;u++){var c=s.properties[u];a[c.name]=c}}return r[e]=a,a},Bt.applyContextStyle=function(t,e,n){for(var r=this,a=t.diffPropNames,i={},s=r.types,l=0;l<a.length;l++){var u=a[l],c=e[u],d=n.pstyle(u);if(!c)if(d)d.bypass?c={name:u,deleteBypassed:!0}:c={name:u,delete:!0};else continue;if(d!==c){if(c.mapped===s.fn&&d!=null&&d.mapping!=null&&d.mapping.value===c.value){var f=d.mapping,h=f.fnValue=c.value(n);if(h===f.prevFnValue)continue}var v=i[u]={prev:d};r.applyParsedProperty(n,c),v.next=n.pstyle(u),v.next&&v.next.bypass&&(v.next=v.next.bypassed)}}return{diffProps:i}},Bt.updateStyleHints=function(t){var e=t._private,n=this,r=n.propertyGroupNames,a=n.propertyGroupKeys,i=function(W,oe,he){return n.getPropertiesHash(W,oe,he)},s=e.styleKey;if(t.removed())return!1;var l=e.group==="nodes",u=t._private.style;r=Object.keys(u);for(var c=0;c<a.length;c++){var d=a[c];e.styleKeys[d]=[ga,xi]}for(var f=function(W,oe){return e.styleKeys[oe][0]=Ei(W,e.styleKeys[oe][0])},h=function(W,oe){return e.styleKeys[oe][1]=Si(W,e.styleKeys[oe][1])},v=function(W,oe){f(W,oe),h(W,oe)},p=function(W,oe){for(var he=0;he<W.length;he++){var re=W.charCodeAt(he);f(re,oe),h(re,oe)}},g=2e9,y=function(W){return-128<W&&W<128&&Math.floor(W)!==W?g-(W*1024|0):W},m=0;m<r.length;m++){var b=r[m],w=u[b];if(w!=null){var C=this.properties[b],E=C.type,x=C.groupKey,k=void 0;C.hashOverride!=null?k=C.hashOverride(t,w):w.pfValue!=null&&(k=w.pfValue);var B=C.enums==null?w.value:null,S=k!=null,N=B!=null,D=S||N,_=w.units;if(E.number&&D&&!E.multiple){var O=S?k:B;v(y(O),x),!S&&_!=null&&p(_,x)}else p(w.strValue,x)}}for(var P=[ga,xi],F=0;F<a.length;F++){var I=a[F],M=e.styleKeys[I];P[0]=Ei(M[0],P[0]),P[1]=Si(M[1],P[1])}e.styleKey=rT(P[0],P[1]);var L=e.styleKeys;e.labelDimsKey=ir(L.labelDimensions);var V=i(t,["label"],L.labelDimensions);if(e.labelKey=ir(V),e.labelStyleKey=ir(Ro(L.commonLabel,V)),!l){var H=i(t,["source-label"],L.labelDimensions);e.sourceLabelKey=ir(H),e.sourceLabelStyleKey=ir(Ro(L.commonLabel,H));var $=i(t,["target-label"],L.labelDimensions);e.targetLabelKey=ir($),e.targetLabelStyleKey=ir(Ro(L.commonLabel,$))}if(l){var z=e.styleKeys,j=z.nodeBody,ee=z.nodeBorder,J=z.nodeOutline,X=z.backgroundImage,ne=z.compound,Y=z.pie,A=[j,ee,J,X,ne,Y].filter(function(K){return K!=null}).reduce(Ro,[ga,xi]);e.nodeKey=ir(A),e.hasPie=Y!=null&&Y[0]!==ga&&Y[1]!==xi}return s!==e.styleKey},Bt.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null},Bt.applyParsedProperty=function(t,e){var n=this,r=e,a=t._private.style,i,s=n.types,l=n.properties[r.name].type,u=r.bypass,c=a[r.name],d=c&&c.bypass,f=t._private,h="mapping",v=function(j){return j==null?null:j.pfValue!=null?j.pfValue:j.value},p=function(){var j=v(c),ee=v(r);n.checkTriggers(t,r.name,j,ee)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(r=e=this.parse(e.name,"bezier",u)),r.delete)return a[r.name]=void 0,p(),!0;if(r.deleteBypassed)return c?c.bypass?(c.bypassed=void 0,p(),!0):!1:(p(),!0);if(r.deleteBypass)return c?c.bypass?(a[r.name]=c.bypassed,p(),!0):!1:(p(),!0);var g=function(){Ve("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+r.name+"` with data field `"+r.field+"`); try a `["+r.field+"]` selector to limit scope to elements with `"+r.field+"` defined")};switch(r.mapped){case s.mapData:{for(var y=r.field.split("."),m=f.data,b=0;b<y.length&&m;b++){var w=y[b];m=m[w]}if(m==null)return g(),!1;var C;if(le(m)){var E=r.fieldMax-r.fieldMin;E===0?C=0:C=(m-r.fieldMin)/E}else return Ve("Do not use continuous mappers without specifying numeric data (i.e. `"+r.field+": "+m+"` for `"+t.id()+"` is non-numeric)"),!1;if(C<0?C=0:C>1&&(C=1),l.color){var x=r.valueMin[0],k=r.valueMax[0],B=r.valueMin[1],S=r.valueMax[1],N=r.valueMin[2],D=r.valueMax[2],_=r.valueMin[3]==null?1:r.valueMin[3],O=r.valueMax[3]==null?1:r.valueMax[3],P=[Math.round(x+(k-x)*C),Math.round(B+(S-B)*C),Math.round(N+(D-N)*C),Math.round(_+(O-_)*C)];i={bypass:r.bypass,name:r.name,value:P,strValue:"rgb("+P[0]+", "+P[1]+", "+P[2]+")"}}else if(l.number){var F=r.valueMin+(r.valueMax-r.valueMin)*C;i=this.parse(r.name,F,r.bypass,h)}else return!1;if(!i)return g(),!1;i.mapping=r,r=i;break}case s.data:{for(var I=r.field.split("."),M=f.data,L=0;L<I.length&&M;L++){var V=I[L];M=M[V]}if(M!=null&&(i=this.parse(r.name,M,r.bypass,h)),!i)return g(),!1;i.mapping=r,r=i;break}case s.fn:{var H=r.value,$=r.fnValue!=null?r.fnValue:H(t);if(r.prevFnValue=$,$==null)return Ve("Custom function mappers may not return null (i.e. `"+r.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(r.name,$,r.bypass,h),!i)return Ve("Custom function mappers may not return invalid values for the property type (i.e. `"+r.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=kn(r),r=i;break}case void 0:break;default:return!1}return u?(d?r.bypassed=c.bypassed:r.bypassed=c,a[r.name]=r):d?c.bypassed=r:a[r.name]=r,p(),!0},Bt.cleanElements=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),!e)r._private.style={};else for(var a=r._private.style,i=Object.keys(a),s=0;s<i.length;s++){var l=i[s],u=a[l];u!=null&&(u.bypass?u.bypassed=null:a[l]=null)}}},Bt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()},Bt.updateTransitions=function(t,e){var n=this,r=t._private,a=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,s=t.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var l={},u=!1,c=0;c<a.length;c++){var d=a[c],f=t.pstyle(d),h=e[d];if(h){var v=h.prev,p=v,g=h.next!=null?h.next:f,y=!1,m=void 0,b=1e-6;p&&(le(p.pfValue)&&le(g.pfValue)?(y=g.pfValue-p.pfValue,m=p.pfValue+b*y):le(p.value)&&le(g.value)?(y=g.value-p.value,m=p.value+b*y):Ke(p.value)&&Ke(g.value)&&(y=p.value[0]!==g.value[0]||p.value[1]!==g.value[1]||p.value[2]!==g.value[2],m=p.strValue),y&&(l[d]=g.strValue,this.applyBypass(t,d,m),u=!0))}}if(!u)return;r.transitioning=!0,new Ea(function(w){s>0?t.delayAnimation(s).play().promise().then(w):w()}).then(function(){return t.animation({style:l,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(t,a),t.emitAndNotify("style"),r.transitioning=!1})}else r.transitioning&&(this.removeBypasses(t,a),t.emitAndNotify("style"),r.transitioning=!1)},Bt.checkTrigger=function(t,e,n,r,a,i){var s=this.properties[e],l=a(s);l!=null&&l(n,r)&&i(s)},Bt.checkZOrderTrigger=function(t,e,n,r){var a=this;this.checkTrigger(t,e,n,r,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",t)})},Bt.checkBoundsTrigger=function(t,e,n,r){this.checkTrigger(t,e,n,r,function(a){return a.triggersBounds},function(a){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),a.triggersBoundsOfParallelBeziers&&e==="curve-style"&&(n==="bezier"||r==="bezier")&&t.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()}),a.triggersBoundsOfConnectedEdges&&e==="display"&&(n==="none"||r==="none")&&t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},Bt.checkTriggers=function(t,e,n,r){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,n,r),this.checkBoundsTrigger(t,e,n,r)};var zi={};zi.applyBypass=function(t,e,n,r){var a=this,i=[],s=!0;if(e==="*"||e==="**"){if(n!==void 0)for(var l=0;l<a.properties.length;l++){var u=a.properties[l],c=u.name,d=this.parse(c,n,!0);d&&i.push(d)}}else if(be(e)){var f=this.parse(e,n,!0);f&&i.push(f)}else if(Ie(e)){var h=e;r=n;for(var v=Object.keys(h),p=0;p<v.length;p++){var g=v[p],y=h[g];if(y===void 0&&(y=h[Mo(g)]),y!==void 0){var m=this.parse(g,y,!0);m&&i.push(m)}}}else return!1;if(i.length===0)return!1;for(var b=!1,w=0;w<t.length;w++){for(var C=t[w],E={},x=void 0,k=0;k<i.length;k++){var B=i[k];if(r){var S=C.pstyle(B.name);x=E[B.name]={prev:S}}b=this.applyParsedProperty(C,kn(B))||b,r&&(x.next=C.pstyle(B.name))}b&&this.updateStyleHints(C),r&&this.updateTransitions(C,E,s)}return b},zi.overrideBypass=function(t,e,n){e=ql(e);for(var r=0;r<t.length;r++){var a=t[r],i=a._private.style[e],s=this.properties[e].type,l=s.color,u=s.mutiple,c=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,e,n):(i.value=n,i.pfValue!=null&&(i.pfValue=n),l?i.strValue="rgb("+n.join(",")+")":u?i.strValue=n.join(" "):i.strValue=""+n,this.updateStyleHints(a)),this.checkTriggers(a,e,c,n)}},zi.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)},zi.removeBypasses=function(t,e,n){for(var r=!0,a=0;a<t.length;a++){for(var i=t[a],s={},l=0;l<e.length;l++){var u=e[l],c=this.properties[u],d=i.pstyle(c.name);if(!(!d||!d.bypass)){var f="",h=this.parse(u,f,!0),v=s[c.name]={prev:d};this.applyParsedProperty(i,h),v.next=i.pstyle(c.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,s,r)}};var Cc={};Cc.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1},Cc.containerCss=function(t){var e=this._private.cy,n=e.container(),r=e.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(t)};var En={};En.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)},En.getRawStyle=function(t,e){var n=this;if(t=t[0],t){for(var r={},a=0;a<n.properties.length;a++){var i=n.properties[a],s=n.getStylePropertyValue(t,i.name,e);s!=null&&(r[i.name]=s,r[Mo(i.name)]=s)}return r}},En.getIndexedStyle=function(t,e,n,r){var a=t.pstyle(e)[n][r];return a??t.cy().style().getDefaultProperty(e)[n][0]},En.getStylePropertyValue=function(t,e,n){var r=this;if(t=t[0],t){var a=r.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,s=t.pstyle(a.name);if(s){var l=s.value,u=s.units,c=s.strValue;if(n&&i.number&&l!=null&&le(l)){var d=t.cy().zoom(),f=function(y){return y*d},h=function(y,m){return f(y)+m},v=Ke(l),p=v?u.every(function(g){return g!=null}):u!=null;return p?v?l.map(function(g,y){return h(g,u[y])}).join(" "):h(l,u):v?l.map(function(g){return be(g)?g:""+f(g)}).join(" "):""+f(l)}else if(c!=null)return c}return null}},En.getAnimationStartStyle=function(t,e){for(var n={},r=0;r<e.length;r++){var a=e[r],i=a.name,s=t.pstyle(i);s!==void 0&&(Ie(s)?s=this.parse(i,s.strValue):s=this.parse(i,s)),s&&(n[i]=s)}return n},En.getPropsList=function(t){var e=this,n=[],r=t,a=e.properties;if(r)for(var i=Object.keys(r),s=0;s<i.length;s++){var l=i[s],u=r[l],c=a[l]||a[ql(l)],d=this.parse(c.name,u);d&&n.push(d)}return n},En.getNonDefaultPropertiesHash=function(t,e,n){var r=n.slice(),a,i,s,l,u,c;for(u=0;u<e.length;u++)if(a=e[u],i=t.pstyle(a,!1),i!=null)if(i.pfValue!=null)r[0]=Ei(l,r[0]),r[1]=Si(l,r[1]);else for(s=i.strValue,c=0;c<s.length;c++)l=s.charCodeAt(c),r[0]=Ei(l,r[0]),r[1]=Si(l,r[1]);return r},En.getPropertiesHash=En.getNonDefaultPropertiesHash;var ms={};ms.appendFromJson=function(t){for(var e=this,n=0;n<t.length;n++){var r=t[n],a=r.selector,i=r.style||r.css,s=Object.keys(i);e.selector(a);for(var l=0;l<s.length;l++){var u=s[l],c=i[u];e.css(u,c)}}return e},ms.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e},ms.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var n=this[e],r=n.selector,a=n.properties,i={},s=0;s<a.length;s++){var l=a[s];i[l.name]=l.strValue}t.push({selector:r?r.toString():"core",style:i})}return t};var kc={};kc.appendFromString=function(t){var e=this,n=this,r=""+t,a,i,s;r=r.replace(/[/][*](\s|.)+?[*][/]/g,"");function l(){r.length>a.length?r=r.substr(a.length):r=""}function u(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var c=r.match(/^\s*$/);if(c)break;var d=r.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){Ve("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+r);break}a=d[0];var f=d[1];if(f!=="core"){var h=new ur(f);if(h.invalid){Ve("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),l();continue}}var v=d[2],p=!1;i=v;for(var g=[];;){var y=i.match(/^\s*$/);if(y)break;var m=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!m){Ve("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+v),p=!0;break}s=m[0];var b=m[1],w=m[2],C=e.properties[b];if(!C){Ve("Skipping property: Invalid property name in: "+s),u();continue}var E=n.parse(b,w);if(!E){Ve("Skipping property: Invalid property definition in: "+s),u();continue}g.push({name:b,val:w}),u()}if(p){l();break}n.selector(f);for(var x=0;x<g.length;x++){var k=g[x];n.css(k.name,k.val)}l()}return n},kc.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var xt={};(function(){var t=ct,e=oS,n=lS,r=cS,a=uS,i=function(A){return"^"+A+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(A){var K=t+"|\\w+|"+e+"|"+n+"|"+r+"|"+a;return"^"+A+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+K+")\\s*\\,\\s*("+K+")\\)$"},l=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];xt.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:l,singleRegexMatchValue:!0},urls:{regexes:l,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(A,K){switch(A.length){case 2:return K[0]!=="deg"&&K[0]!=="rad"&&K[1]!=="deg"&&K[1]!=="rad";case 1:return be(A[0])||K[0]==="deg"||K[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(A){var K=A.length;return K===1||K===2||K===4}}};var u={zeroNonZero:function(A,K){return(A==null||K==null)&&A!==K||A==0&&K!=0?!0:A!=0&&K==0},any:function(A,K){return A!=K},emptyNonEmpty:function(A,K){var W=ar(A),oe=ar(K);return W&&!oe||!W&&oe}},c=xt.types,d=[{name:"label",type:c.text,triggersBounds:u.any,triggersZOrder:u.emptyNonEmpty},{name:"text-rotation",type:c.textRotation,triggersBounds:u.any},{name:"text-margin-x",type:c.bidirectionalSize,triggersBounds:u.any},{name:"text-margin-y",type:c.bidirectionalSize,triggersBounds:u.any}],f=[{name:"source-label",type:c.text,triggersBounds:u.any},{name:"source-text-rotation",type:c.textRotation,triggersBounds:u.any},{name:"source-text-margin-x",type:c.bidirectionalSize,triggersBounds:u.any},{name:"source-text-margin-y",type:c.bidirectionalSize,triggersBounds:u.any},{name:"source-text-offset",type:c.size,triggersBounds:u.any}],h=[{name:"target-label",type:c.text,triggersBounds:u.any},{name:"target-text-rotation",type:c.textRotation,triggersBounds:u.any},{name:"target-text-margin-x",type:c.bidirectionalSize,triggersBounds:u.any},{name:"target-text-margin-y",type:c.bidirectionalSize,triggersBounds:u.any},{name:"target-text-offset",type:c.size,triggersBounds:u.any}],v=[{name:"font-family",type:c.fontFamily,triggersBounds:u.any},{name:"font-style",type:c.fontStyle,triggersBounds:u.any},{name:"font-weight",type:c.fontWeight,triggersBounds:u.any},{name:"font-size",type:c.size,triggersBounds:u.any},{name:"text-transform",type:c.textTransform,triggersBounds:u.any},{name:"text-wrap",type:c.textWrap,triggersBounds:u.any},{name:"text-overflow-wrap",type:c.textOverflowWrap,triggersBounds:u.any},{name:"text-max-width",type:c.size,triggersBounds:u.any},{name:"text-outline-width",type:c.size,triggersBounds:u.any},{name:"line-height",type:c.positiveNumber,triggersBounds:u.any}],p=[{name:"text-valign",type:c.valign,triggersBounds:u.any},{name:"text-halign",type:c.halign,triggersBounds:u.any},{name:"color",type:c.color},{name:"text-outline-color",type:c.color},{name:"text-outline-opacity",type:c.zeroOneNumber},{name:"text-background-color",type:c.color},{name:"text-background-opacity",type:c.zeroOneNumber},{name:"text-background-padding",type:c.size,triggersBounds:u.any},{name:"text-border-opacity",type:c.zeroOneNumber},{name:"text-border-color",type:c.color},{name:"text-border-width",type:c.size,triggersBounds:u.any},{name:"text-border-style",type:c.borderStyle,triggersBounds:u.any},{name:"text-background-shape",type:c.textBackgroundShape,triggersBounds:u.any},{name:"text-justification",type:c.justification}],g=[{name:"events",type:c.bool,triggersZOrder:u.any},{name:"text-events",type:c.bool,triggersZOrder:u.any}],y=[{name:"display",type:c.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:c.visibility,triggersZOrder:u.any},{name:"opacity",type:c.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:c.zeroOneNumber},{name:"min-zoomed-font-size",type:c.size},{name:"z-compound-depth",type:c.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:c.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:c.number,triggersZOrder:u.any}],m=[{name:"overlay-padding",type:c.size,triggersBounds:u.any},{name:"overlay-color",type:c.color},{name:"overlay-opacity",type:c.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"overlay-shape",type:c.overlayShape,triggersBounds:u.any},{name:"overlay-corner-radius",type:c.cornerRadius}],b=[{name:"underlay-padding",type:c.size,triggersBounds:u.any},{name:"underlay-color",type:c.color},{name:"underlay-opacity",type:c.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"underlay-shape",type:c.overlayShape,triggersBounds:u.any},{name:"underlay-corner-radius",type:c.cornerRadius}],w=[{name:"transition-property",type:c.propList},{name:"transition-duration",type:c.time},{name:"transition-delay",type:c.time},{name:"transition-timing-function",type:c.easing}],C=function(A,K){return K.value==="label"?-A.poolIndex():K.pfValue},E=[{name:"height",type:c.nodeSize,triggersBounds:u.any,hashOverride:C},{name:"width",type:c.nodeSize,triggersBounds:u.any,hashOverride:C},{name:"shape",type:c.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:c.polygonPointList,triggersBounds:u.any},{name:"corner-radius",type:c.cornerRadius},{name:"background-color",type:c.color},{name:"background-fill",type:c.fill},{name:"background-opacity",type:c.zeroOneNumber},{name:"background-blacken",type:c.nOneOneNumber},{name:"background-gradient-stop-colors",type:c.colors},{name:"background-gradient-stop-positions",type:c.percentages},{name:"background-gradient-direction",type:c.gradientDirection},{name:"padding",type:c.sizeMaybePercent,triggersBounds:u.any},{name:"padding-relative-to",type:c.paddingRelativeTo,triggersBounds:u.any},{name:"bounds-expansion",type:c.boundsExpansion,triggersBounds:u.any}],x=[{name:"border-color",type:c.color},{name:"border-opacity",type:c.zeroOneNumber},{name:"border-width",type:c.size,triggersBounds:u.any},{name:"border-style",type:c.borderStyle},{name:"border-cap",type:c.lineCap},{name:"border-join",type:c.lineJoin},{name:"border-dash-pattern",type:c.numbers},{name:"border-dash-offset",type:c.number},{name:"border-position",type:c.linePosition}],k=[{name:"outline-color",type:c.color},{name:"outline-opacity",type:c.zeroOneNumber},{name:"outline-width",type:c.size,triggersBounds:u.any},{name:"outline-style",type:c.borderStyle},{name:"outline-offset",type:c.size,triggersBounds:u.any}],B=[{name:"background-image",type:c.urls},{name:"background-image-crossorigin",type:c.bgCrossOrigin},{name:"background-image-opacity",type:c.zeroOneNumbers},{name:"background-image-containment",type:c.bgContainment},{name:"background-image-smoothing",type:c.bools},{name:"background-position-x",type:c.bgPos},{name:"background-position-y",type:c.bgPos},{name:"background-width-relative-to",type:c.bgRelativeTo},{name:"background-height-relative-to",type:c.bgRelativeTo},{name:"background-repeat",type:c.bgRepeat},{name:"background-fit",type:c.bgFit},{name:"background-clip",type:c.bgClip},{name:"background-width",type:c.bgWH},{name:"background-height",type:c.bgWH},{name:"background-offset-x",type:c.bgPos},{name:"background-offset-y",type:c.bgPos}],S=[{name:"position",type:c.position,triggersBounds:u.any},{name:"compound-sizing-wrt-labels",type:c.compoundIncludeLabels,triggersBounds:u.any},{name:"min-width",type:c.size,triggersBounds:u.any},{name:"min-width-bias-left",type:c.sizeMaybePercent,triggersBounds:u.any},{name:"min-width-bias-right",type:c.sizeMaybePercent,triggersBounds:u.any},{name:"min-height",type:c.size,triggersBounds:u.any},{name:"min-height-bias-top",type:c.sizeMaybePercent,triggersBounds:u.any},{name:"min-height-bias-bottom",type:c.sizeMaybePercent,triggersBounds:u.any}],N=[{name:"line-style",type:c.lineStyle},{name:"line-color",type:c.color},{name:"line-fill",type:c.fill},{name:"line-cap",type:c.lineCap},{name:"line-opacity",type:c.zeroOneNumber},{name:"line-dash-pattern",type:c.numbers},{name:"line-dash-offset",type:c.number},{name:"line-outline-width",type:c.size},{name:"line-outline-color",type:c.color},{name:"line-gradient-stop-colors",type:c.colors},{name:"line-gradient-stop-positions",type:c.percentages},{name:"curve-style",type:c.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:c.zeroOneNumber,triggersBounds:u.any},{name:"source-endpoint",type:c.edgeEndpoint,triggersBounds:u.any},{name:"target-endpoint",type:c.edgeEndpoint,triggersBounds:u.any},{name:"control-point-step-size",type:c.size,triggersBounds:u.any},{name:"control-point-distances",type:c.bidirectionalSizes,triggersBounds:u.any},{name:"control-point-weights",type:c.numbers,triggersBounds:u.any},{name:"segment-distances",type:c.bidirectionalSizes,triggersBounds:u.any},{name:"segment-weights",type:c.numbers,triggersBounds:u.any},{name:"segment-radii",type:c.numbers,triggersBounds:u.any},{name:"radius-type",type:c.radiusType,triggersBounds:u.any},{name:"taxi-turn",type:c.bidirectionalSizeMaybePercent,triggersBounds:u.any},{name:"taxi-turn-min-distance",type:c.size,triggersBounds:u.any},{name:"taxi-direction",type:c.axisDirection,triggersBounds:u.any},{name:"taxi-radius",type:c.number,triggersBounds:u.any},{name:"edge-distances",type:c.edgeDistances,triggersBounds:u.any},{name:"arrow-scale",type:c.positiveNumber,triggersBounds:u.any},{name:"loop-direction",type:c.angle,triggersBounds:u.any},{name:"loop-sweep",type:c.angle,triggersBounds:u.any},{name:"source-distance-from-node",type:c.size,triggersBounds:u.any},{name:"target-distance-from-node",type:c.size,triggersBounds:u.any}],D=[{name:"ghost",type:c.bool,triggersBounds:u.any},{name:"ghost-offset-x",type:c.bidirectionalSize,triggersBounds:u.any},{name:"ghost-offset-y",type:c.bidirectionalSize,triggersBounds:u.any},{name:"ghost-opacity",type:c.zeroOneNumber}],_=[{name:"selection-box-color",type:c.color},{name:"selection-box-opacity",type:c.zeroOneNumber},{name:"selection-box-border-color",type:c.color},{name:"selection-box-border-width",type:c.size},{name:"active-bg-color",type:c.color},{name:"active-bg-opacity",type:c.zeroOneNumber},{name:"active-bg-size",type:c.size},{name:"outside-texture-bg-color",type:c.color},{name:"outside-texture-bg-opacity",type:c.zeroOneNumber}],O=[];xt.pieBackgroundN=16,O.push({name:"pie-size",type:c.sizeMaybePercent});for(var P=1;P<=xt.pieBackgroundN;P++)O.push({name:"pie-"+P+"-background-color",type:c.color}),O.push({name:"pie-"+P+"-background-size",type:c.percent}),O.push({name:"pie-"+P+"-background-opacity",type:c.zeroOneNumber});var F=[],I=xt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:c.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:c.color},{name:"arrow-fill",type:c.arrowFill},{name:"arrow-width",type:c.arrowWidth}].forEach(function(Y){I.forEach(function(A){var K=A+"-"+Y.name,W=Y.type,oe=Y.triggersBounds;F.push({name:K,type:W,triggersBounds:oe})})},{});var M=xt.properties=[].concat(g,w,y,m,b,D,p,v,d,f,h,E,x,k,B,O,S,N,F,_),L=xt.propertyGroups={behavior:g,transition:w,visibility:y,overlay:m,underlay:b,ghost:D,commonLabel:p,labelDimensions:v,mainLabel:d,sourceLabel:f,targetLabel:h,nodeBody:E,nodeBorder:x,nodeOutline:k,backgroundImage:B,pie:O,compound:S,edgeLine:N,edgeArrow:F,core:_},V=xt.propertyGroupNames={},H=xt.propertyGroupKeys=Object.keys(L);H.forEach(function(Y){V[Y]=L[Y].map(function(A){return A.name}),L[Y].forEach(function(A){return A.groupKey=Y})});var $=xt.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];xt.propertyNames=M.map(function(Y){return Y.name});for(var z=0;z<M.length;z++){var j=M[z];M[j.name]=j}for(var ee=0;ee<$.length;ee++){var J=$[ee],X=M[J.pointsTo],ne={name:J.name,alias:!0,pointsTo:X};M.push(ne),M[J.name]=ne}})(),xt.getDefaultProperty=function(t){return this.getDefaultProperties()[t]},xt.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=xe({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(u,c){for(var d=1;d<=xt.pieBackgroundN;d++){var f=c.name.replace("{{i}}",d),h=c.value;u[f]=h}return u},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(u,c){return xt.arrowPrefixes.forEach(function(d){var f=d+"-"+c.name,h=c.value;u[f]=h}),u},{})),n={},r=0;r<this.properties.length;r++){var a=this.properties[r];if(!a.pointsTo){var i=a.name,s=e[i],l=this.parse(i,s);n[i]=l}}return t.defaultProperties=n,t.defaultProperties},xt.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var ys={};ys.parse=function(t,e,n,r){var a=this;if(Ye(e))return a.parseImplWarn(t,e,n,r);var i=r==="mapping"||r===!0||r===!1||r==null?"dontcare":r,s=n?"t":"f",l=""+e,u=lh(t,l,s,i),c=a.propCache=a.propCache||[],d;return(d=c[u])||(d=c[u]=a.parseImplWarn(t,e,n,r)),(n||r==="mapping")&&(d=kn(d),d&&(d.value=kn(d.value))),d},ys.parseImplWarn=function(t,e,n,r){var a=this.parseImpl(t,e,n,r);return!a&&e!=null&&Ve("The style property `".concat(t,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&Ve("The style value of `label` is deprecated for `"+a.name+"`"),a},ys.parseImpl=function(t,e,n,r){var a=this;t=ql(t);var i=a.properties[t],s=e,l=a.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var u=be(e);u&&(e=e.trim());var c=i.type;if(!c)return null;if(n&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(Ye(e))return{name:t,value:e,strValue:"fn",mapped:l.fn,bypass:n};var d,f;if(!(!u||r||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(d=new RegExp(l.data.regex).exec(e))){if(n)return!1;var h=l.data;return{name:t,value:d,strValue:""+e,mapped:h,field:d[1],bypass:n}}else if(e.length>=10&&e[0]==="m"&&(f=new RegExp(l.mapData.regex).exec(e))){if(n||c.multiple)return!1;var v=l.mapData;if(!(c.color||c.number))return!1;var p=this.parse(t,f[4]);if(!p||p.mapped)return!1;var g=this.parse(t,f[5]);if(!g||g.mapped)return!1;if(p.pfValue===g.pfValue||p.strValue===g.strValue)return Ve("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+p.strValue+"`"),this.parse(t,p.strValue);if(c.color){var y=p.value,m=g.value,b=y[0]===m[0]&&y[1]===m[1]&&y[2]===m[2]&&(y[3]===m[3]||(y[3]==null||y[3]===1)&&(m[3]==null||m[3]===1));if(b)return!1}return{name:t,value:f,strValue:""+e,mapped:v,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:p.value,valueMax:g.value,bypass:n}}}if(c.multiple&&r!=="multiple"){var w;if(u?w=e.split(/\s+/):Ke(e)?w=e:w=[e],c.evenMultiple&&w.length%2!==0)return null;for(var C=[],E=[],x=[],k="",B=!1,S=0;S<w.length;S++){var N=a.parse(t,w[S],n,"multiple");B=B||be(N.value),C.push(N.value),x.push(N.pfValue!=null?N.pfValue:N.value),E.push(N.units),k+=(S>0?" ":"")+N.strValue}return c.validate&&!c.validate(C,E)?null:c.singleEnum&&B?C.length===1&&be(C[0])?{name:t,value:C[0],strValue:C[0],bypass:n}:null:{name:t,value:C,pfValue:x,strValue:k,bypass:n,units:E}}var D=function(){for(var A=0;A<c.enums.length;A++){var K=c.enums[A];if(K===e)return{name:t,value:e,strValue:""+e,bypass:n}}return null};if(c.number){var _,O="px";if(c.units&&(_=c.units),c.implicitUnits&&(O=c.implicitUnits),!c.unitless)if(u){var P="px|em"+(c.allowPercent?"|\\%":"");_&&(P=_);var F=e.match("^("+ct+")("+P+")?$");F&&(e=F[1],_=F[2]||O)}else(!_||c.implicitUnits)&&(_=O);if(e=parseFloat(e),isNaN(e)&&c.enums===void 0)return null;if(isNaN(e)&&c.enums!==void 0)return e=s,D();if(c.integer&&!JE(e)||c.min!==void 0&&(e<c.min||c.strictMin&&e===c.min)||c.max!==void 0&&(e>c.max||c.strictMax&&e===c.max))return null;var I={name:t,value:e,strValue:""+e+(_||""),units:_,bypass:n};return c.unitless||_!=="px"&&_!=="em"?I.pfValue=e:I.pfValue=_==="px"||!_?e:this.getEmSizeInPixels()*e,(_==="ms"||_==="s")&&(I.pfValue=_==="ms"?e:1e3*e),(_==="deg"||_==="rad")&&(I.pfValue=_==="rad"?e:OT(e)),_==="%"&&(I.pfValue=e/100),I}else if(c.propList){var M=[],L=""+e;if(L!=="none"){for(var V=L.split(/\s*,\s*|\s+/),H=0;H<V.length;H++){var $=V[H].trim();a.properties[$]?M.push($):Ve("`"+$+"` is not a valid property name")}if(M.length===0)return null}return{name:t,value:M,strValue:M.length===0?"none":M.join(" "),bypass:n}}else if(c.color){var z=gS(e);return z?{name:t,value:z,pfValue:z,strValue:"rgb("+z[0]+","+z[1]+","+z[2]+")",bypass:n}:null}else if(c.regex||c.regexes){if(c.enums){var j=D();if(j)return j}for(var ee=c.regexes?c.regexes:[c.regex],J=0;J<ee.length;J++){var X=new RegExp(ee[J]),ne=X.exec(e);if(ne)return{name:t,value:c.singleRegexMatchValue?ne[1]:ne,strValue:""+e,bypass:n}}return null}else return c.string?{name:t,value:""+e,strValue:""+e,bypass:n}:c.enums?D():null};var Nt=function t(e){if(!(this instanceof t))return new t(e);if(!Kl(e)){Ze("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Dt=Nt.prototype;Dt.instanceString=function(){return"style"},Dt.clear=function(){for(var t=this._private,e=t.cy,n=e.elements(),r=0;r<this.length;r++)this[r]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(n,!0),n.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this},Dt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},Dt.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)},Dt.selector=function(t){var e=t==="core"?null:new ur(t),n=this.length++;return this[n]={selector:e,properties:[],mappedProperties:[],index:n},this},Dt.css=function(){var t=this,e=arguments;if(e.length===1)for(var n=e[0],r=0;r<t.properties.length;r++){var a=t.properties[r],i=n[a.name];i===void 0&&(i=n[Mo(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this},Dt.style=Dt.css,Dt.cssRule=function(t,e){var n=this.parse(t,e);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[r].mappedProperties.push(n);var a=!this[r].selector;a&&(this._private.coreStyle[n.name]=n)}return this},Dt.append=function(t){return jf(t)?t.appendToStyle(this):Ke(t)?this.appendFromJson(t):be(t)&&this.appendFromString(t),this},Nt.fromJson=function(t,e){var n=new Nt(t);return n.fromJson(e),n},Nt.fromString=function(t,e){return new Nt(t).fromString(e)},[Bt,zi,Cc,En,ms,kc,xt,ys].forEach(function(t){xe(Dt,t)}),Nt.types=Dt.types,Nt.properties=Dt.properties,Nt.propertyGroups=Dt.propertyGroups,Nt.propertyGroupNames=Dt.propertyGroupNames,Nt.propertyGroupKeys=Dt.propertyGroupKeys;var JD={style:function(e){if(e){var n=this.setStyle(e);n.update()}return this._private.style},setStyle:function(e){var n=this._private;return jf(e)?n.style=e.generateStyle(this):Ke(e)?n.style=Nt.fromJson(this,e):be(e)?n.style=Nt.fromString(this,e):n.style=Nt(this),n.style},updateStyle:function(){this.mutableElements().updateStyle()}},e4="single",Hr={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var n=this._private;if(n.selectionType==null&&(n.selectionType=e4),e!==void 0)(e==="additive"||e==="single")&&(n.selectionType=e);else return n.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,n=this._private.pan,r,a,i,s,l;switch(e.length){case 0:return n;case 1:if(be(e[0]))return r=e[0],n[r];if(Ie(e[0])){if(!this._private.panningEnabled)return this;i=e[0],s=i.x,l=i.y,le(s)&&(n.x=s),le(l)&&(n.y=l),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;r=e[0],a=e[1],(r==="x"||r==="y")&&le(a)&&(n[r]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,n){var r=arguments,a=this._private.pan,i,s,l,u,c;if(!this._private.panningEnabled)return this;switch(r.length){case 1:Ie(e)&&(l=r[0],u=l.x,c=l.y,le(u)&&(a.x+=u),le(c)&&(a.y+=c),this.emit("pan viewport"));break;case 2:i=e,s=n,(i==="x"||i==="y")&&le(s)&&(a[i]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,n){var r=this.getFitViewport(e,n);if(r){var a=this._private;a.zoom=r.zoom,a.pan=r.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,n){if(le(e)&&n===void 0&&(n=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var r;if(be(e)){var a=e;e=this.$(a)}else if(nS(e)){var i=e;r={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},r.w=r.x2-r.x1,r.h=r.y2-r.y1}else Gt(e)||(e=this.mutableElements());if(!(Gt(e)&&e.empty())){r=r||e.boundingBox();var s=this.width(),l=this.height(),u;if(n=le(n)?n:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0){u=Math.min((s-2*n)/r.w,(l-2*n)/r.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u<this._private.minZoom?this._private.minZoom:u;var c={x:(s-u*(r.x1+r.x2))/2,y:(l-u*(r.y1+r.y2))/2};return{zoom:u,pan:c}}}}},zoomRange:function(e,n){var r=this._private;if(n==null){var a=e;e=a.min,n=a.max}return le(e)&&le(n)&&e<=n?(r.minZoom=e,r.maxZoom=n):le(e)&&n===void 0&&e<=r.maxZoom?r.minZoom=e:le(n)&&e===void 0&&n>=r.minZoom&&(r.maxZoom=n),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var n=this._private,r=n.pan,a=n.zoom,i,s,l=!1;if(n.zoomingEnabled||(l=!0),le(e)?s=e:Ie(e)&&(s=e.level,e.position!=null?i=Ho(e.position,a,r):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!n.panningEnabled&&(l=!0)),s=s>n.maxZoom?n.maxZoom:s,s=s<n.minZoom?n.minZoom:s,l||!le(s)||s===a||i!=null&&(!le(i.x)||!le(i.y)))return null;if(i!=null){var u=r,c=a,d=s,f={x:-d/c*(i.x-u.x)+i.x,y:-d/c*(i.y-u.y)+i.y};return{zoomed:!0,panned:!0,zoom:d,pan:f}}else return{zoomed:!0,panned:!1,zoom:s,pan:r}},zoom:function(e){if(e===void 0)return this._private.zoom;var n=this.getZoomedViewport(e),r=this._private;return n==null||!n.zoomed?this:(r.zoom=n.zoom,n.panned&&(r.pan.x=n.pan.x,r.pan.y=n.pan.y),this.emit("zoom"+(n.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var n=this._private,r=!0,a=!0,i=[],s=!1,l=!1;if(!e)return this;if(le(e.zoom)||(r=!1),Ie(e.pan)||(a=!1),!r&&!a)return this;if(r){var u=e.zoom;u<n.minZoom||u>n.maxZoom||!n.zoomingEnabled?s=!0:(n.zoom=u,i.push("zoom"))}if(a&&(!s||!e.cancelOnFailedZoom)&&n.panningEnabled){var c=e.pan;le(c.x)&&(n.pan.x=c.x,l=!1),le(c.y)&&(n.pan.y=c.y,l=!1),l||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var n=this.getCenterPan(e);return n&&(this._private.pan=n,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,n){if(this._private.panningEnabled){if(be(e)){var r=e;e=this.mutableElements().filter(r)}else Gt(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),s=this.height();n=n===void 0?this._private.zoom:n;var l={x:(i-n*(a.x1+a.x2))/2,y:(s-n*(a.y1+a.y2))/2};return l}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,n=e.container,r=this;return e.sizeCache=e.sizeCache||(n?function(){var a=r.window().getComputedStyle(n),i=function(l){return parseFloat(a.getPropertyValue(l))};return{width:n.clientWidth-i("padding-left")-i("padding-right"),height:n.clientHeight-i("padding-top")-i("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,n=this._private.zoom,r=this.renderedExtent(),a={x1:(r.x1-e.x)/n,x2:(r.x2-e.x)/n,y1:(r.y1-e.y)/n,y2:(r.y2-e.y)/n};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),n=this.height();return{x1:0,y1:0,x2:e,y2:n,w:e,h:n}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Hr.centre=Hr.center,Hr.autolockNodes=Hr.autolock,Hr.autoungrabifyNodes=Hr.autoungrabify;var Hi={data:Re.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Re.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Re.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Re.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Hi.attr=Hi.data,Hi.removeAttr=Hi.removeData;var Ki=function(e){var n=this;e=xe({},e);var r=e.container;r&&!Lo(r)&&Lo(r[0])&&(r=r[0]);var a=r?r._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];r&&(r._cyreg=a),a.cy=n;var s=lt!==void 0&&r!==void 0&&!e.headless,l=e;l.layout=xe({name:s?"grid":"null"},l.layout),l.renderer=xe({name:s?"canvas":"null"},l.renderer);var u=function(p,g,y){return g!==void 0?g:y!==void 0?y:p},c=this._private={container:r,ready:!1,options:l,elements:new kt(this),listeners:[],aniEles:new kt(this),data:l.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,l.zoomingEnabled),userZoomingEnabled:u(!0,l.userZoomingEnabled),panningEnabled:u(!0,l.panningEnabled),userPanningEnabled:u(!0,l.userPanningEnabled),boxSelectionEnabled:u(!0,l.boxSelectionEnabled),autolock:u(!1,l.autolock,l.autolockNodes),autoungrabify:u(!1,l.autoungrabify,l.autoungrabifyNodes),autounselectify:u(!1,l.autounselectify),styleEnabled:l.styleEnabled===void 0?s:l.styleEnabled,zoom:le(l.zoom)?l.zoom:1,pan:{x:Ie(l.pan)&&le(l.pan.x)?l.pan.x:0,y:Ie(l.pan)&&le(l.pan.y)?l.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,l.multiClickDebounceTime)};this.createEmitter(),this.selectionType(l.selectionType),this.zoomRange({min:l.minZoom,max:l.maxZoom});var d=function(p,g){var y=p.some(rS);if(y)return Ea.all(p).then(g);g(p)};c.styleEnabled&&n.setStyle([]);var f=xe({},l,l.renderer);n.initRenderer(f);var h=function(p,g,y){n.notifications(!1);var m=n.mutableElements();m.length>0&&m.remove(),p!=null&&(Ie(p)||Ke(p))&&n.add(p),n.one("layoutready",function(w){n.notifications(!0),n.emit(w),n.one("load",g),n.emitAndNotify("load")}).one("layoutstop",function(){n.one("done",y),n.emit("done")});var b=xe({},n._private.options.layout);b.eles=n.elements(),n.layout(b).run()};d([l.style,l.elements],function(v){var p=v[0],g=v[1];c.styleEnabled&&n.style().append(p),h(g,function(){n.startAnimationLoop(),c.ready=!0,Ye(l.ready)&&n.on("ready",l.ready);for(var y=0;y<i.length;y++){var m=i[y];n.on("ready",m)}a&&(a.readies=[]),n.emit("ready")},l.done)})},bs=Ki.prototype;xe(bs,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return lt;var n=this._private.container.ownerDocument;return n===void 0||n==null?lt:n.defaultView||lt},mount:function(e){if(e!=null){var n=this,r=n._private,a=r.options;return!Lo(e)&&Lo(e[0])&&(e=e[0]),n.stopAnimationLoop(),n.destroyRenderer(),r.container=e,r.styleEnabled=!0,n.invalidateSize(),n.initRenderer(xe({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),n.startAnimationLoop(),n.style(a.style),n.emit("mount"),n}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return kn(this._private.options)},json:function(e){var n=this,r=n._private,a=n.mutableElements(),i=function(C){return n.getElementById(C.id())};if(Ie(e)){if(n.startBatch(),e.elements){var s={},l=function(C,E){for(var x=[],k=[],B=0;B<C.length;B++){var S=C[B];if(!S.data.id){Ve("cy.json() cannot handle elements without an ID attribute");continue}var N=""+S.data.id,D=n.getElementById(N);s[N]=!0,D.length!==0?k.push({ele:D,json:S}):(E&&(S.group=E),x.push(S))}n.add(x);for(var _=0;_<k.length;_++){var O=k[_],P=O.ele,F=O.json;P.json(F)}};if(Ke(e.elements))l(e.elements);else for(var u=["nodes","edges"],c=0;c<u.length;c++){var d=u[c],f=e.elements[d];Ke(f)&&l(f,d)}var h=n.collection();a.filter(function(w){return!s[w.id()]}).forEach(function(w){w.isParent()?h.merge(w):w.remove()}),h.forEach(function(w){return w.children().move({parent:null})}),h.forEach(function(w){return i(w).remove()})}e.style&&n.style(e.style),e.zoom!=null&&e.zoom!==r.zoom&&n.zoom(e.zoom),e.pan&&(e.pan.x!==r.pan.x||e.pan.y!==r.pan.y)&&n.pan(e.pan),e.data&&n.data(e.data);for(var v=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],p=0;p<v.length;p++){var g=v[p];e[g]!=null&&n[g](e[g])}return n.endBatch(),this}else{var y=!!e,m={};y?m.elements=this.elements().map(function(w){return w.json()}):(m.elements={},a.forEach(function(w){var C=w.group();m.elements[C]||(m.elements[C]=[]),m.elements[C].push(w.json())})),this._private.styleEnabled&&(m.style=n.style().json()),m.data=kn(n.data());var b=r.options;return m.zoomingEnabled=r.zoomingEnabled,m.userZoomingEnabled=r.userZoomingEnabled,m.zoom=r.zoom,m.minZoom=r.minZoom,m.maxZoom=r.maxZoom,m.panningEnabled=r.panningEnabled,m.userPanningEnabled=r.userPanningEnabled,m.pan=kn(r.pan),m.boxSelectionEnabled=r.boxSelectionEnabled,m.renderer=kn(b.renderer),m.hideEdgesOnViewport=b.hideEdgesOnViewport,m.textureOnViewport=b.textureOnViewport,m.wheelSensitivity=b.wheelSensitivity,m.motionBlur=b.motionBlur,m.multiClickDebounceTime=b.multiClickDebounceTime,m}}}),bs.$id=bs.getElementById,[KD,jD,$p,bc,vs,ZD,wc,gs,JD,Hr,Hi].forEach(function(t){xe(bs,t)});var t4={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}},n4={maximal:!1,acyclic:!1},Ma=function(e){return e.scratch("breadthfirst")},zp=function(e,n){return e.scratch("breadthfirst",n)};function Hp(t){this.options=xe({},t4,n4,t)}Hp.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,a=r.nodes().filter(function(re){return!re.isParent()}),i=r,s=e.directed,l=e.acyclic||e.maximal||e.maximalAdjustments>0,u=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),c;if(Gt(e.roots))c=e.roots;else if(Ke(e.roots)){for(var d=[],f=0;f<e.roots.length;f++){var h=e.roots[f],v=n.getElementById(h);d.push(v)}c=n.collection(d)}else if(be(e.roots))c=n.$(e.roots);else if(s)c=a.roots();else{var p=r.components();c=n.collection();for(var g=function(se){var ue=p[se],pe=ue.maxDegree(!1),de=ue.filter(function(me){return me.degree(!1)===pe});c=c.add(de)},y=0;y<p.length;y++)g(y)}var m=[],b={},w=function(se,ue){m[ue]==null&&(m[ue]=[]);var pe=m[ue].length;m[ue].push(se),zp(se,{index:pe,depth:ue})},C=function(se,ue){var pe=Ma(se),de=pe.depth,me=pe.index;m[de][me]=null,w(se,ue)};i.bfs({roots:c,directed:e.directed,visit:function(se,ue,pe,de,me){var Ne=se[0],De=Ne.id();w(Ne,me),b[De]=!0}});for(var E=[],x=0;x<a.length;x++){var k=a[x];b[k.id()]||E.push(k)}var B=function(se){for(var ue=m[se],pe=0;pe<ue.length;pe++){var de=ue[pe];if(de==null){ue.splice(pe,1),pe--;continue}zp(de,{depth:se,index:pe})}},S=function(){for(var se=0;se<m.length;se++)B(se)},N=function(se,ue){for(var pe=Ma(se),de=se.incomers().filter(function(T){return T.isNode()&&r.has(T)}),me=-1,Ne=se.id(),De=0;De<de.length;De++){var Ee=de[De],_e=Ma(Ee);me=Math.max(me,_e.depth)}if(pe.depth<=me){if(!e.acyclic&&ue[Ne])return null;var te=me+1;return C(se,te),ue[Ne]=te,!0}return!1};if(s&&l){var D=[],_={},O=function(se){return D.push(se)},P=function(){return D.shift()};for(a.forEach(function(re){return D.push(re)});D.length>0;){var F=P(),I=N(F,_);if(I)F.outgoers().filter(function(re){return re.isNode()&&r.has(re)}).forEach(O);else if(I===null){Ve("Detected double maximal shift for node `"+F.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}S();var M=0;if(e.avoidOverlap)for(var L=0;L<a.length;L++){var V=a[L],H=V.layoutDimensions(e),$=H.w,z=H.h;M=Math.max(M,$,z)}var j={},ee=function(se){if(j[se.id()])return j[se.id()];for(var ue=Ma(se).depth,pe=se.neighborhood(),de=0,me=0,Ne=0;Ne<pe.length;Ne++){var De=pe[Ne];if(!(De.isEdge()||De.isParent()||!a.has(De))){var Ee=Ma(De);if(Ee!=null){var _e=Ee.index,te=Ee.depth;if(!(_e==null||te==null)){var T=m[te].length;te<ue&&(de+=_e/T,me++)}}}}return me=Math.max(1,me),de=de/me,me===0&&(de=0),j[se.id()]=de,de},J=function(se,ue){var pe=ee(se),de=ee(ue),me=pe-de;return me===0?Xf(se.id(),ue.id()):me};e.depthSort!==void 0&&(J=e.depthSort);for(var X=0;X<m.length;X++)m[X].sort(J),B(X);for(var ne=[],Y=0;Y<E.length;Y++)ne.push(E[Y]);m.unshift(ne),S();for(var A=0,K=0;K<m.length;K++)A=Math.max(m[K].length,A);var W={x:u.x1+u.w/2,y:u.x1+u.h/2},oe=m.reduce(function(re,se){return Math.max(re,se.length)},0),he=function(se){var ue=Ma(se),pe=ue.depth,de=ue.index,me=m[pe].length,Ne=Math.max(u.w/((e.grid?oe:me)+1),M),De=Math.max(u.h/(m.length+1),M),Ee=Math.min(u.w/2/m.length,u.h/2/m.length);if(Ee=Math.max(Ee,M),e.circle){var te=Ee*pe+Ee-(m.length>0&&m[0].length<=3?Ee/2:0),T=2*Math.PI/m[pe].length*de;return pe===0&&m[0].length===1&&(te=1),{x:W.x+te*Math.cos(T),y:W.y+te*Math.sin(T)}}else{var _e={x:W.x+(de+1-(me+1)/2)*Ne,y:(pe+1)*De};return _e}};return r.nodes().layoutPositions(this,e,he),this};var r4={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function Kp(t){this.options=xe({},r4,t)}Kp.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=r.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var s=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,c=u/Math.max(1,i.length-1),d,f=0,h=0;h<i.length;h++){var v=i[h],p=v.layoutDimensions(e),g=p.w,y=p.h;f=Math.max(f,g,y)}if(le(e.radius)?d=e.radius:i.length<=1?d=0:d=Math.min(s.h,s.w)/2-f,i.length>1&&e.avoidOverlap){f*=1.75;var m=Math.cos(c)-Math.cos(0),b=Math.sin(c)-Math.sin(0),w=Math.sqrt(f*f/(m*m+b*b));d=Math.max(w,d)}var C=function(x,k){var B=e.startAngle+k*c*(a?1:-1),S=d*Math.cos(B),N=d*Math.sin(B),D={x:l.x+S,y:l.y+N};return D};return r.nodes().layoutPositions(this,e,C),this};var a4={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function qp(t){this.options=xe({},a4,t)}qp.prototype.run=function(){for(var t=this.options,e=t,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,r=t.cy,a=e.eles,i=a.nodes().not(":parent"),s=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},u=[],c=0,d=0;d<i.length;d++){var f=i[d],h=void 0;h=e.concentric(f),u.push({value:h,node:f}),f._private.scratch.concentric=h}i.updateStyle();for(var v=0;v<i.length;v++){var p=i[v],g=p.layoutDimensions(e);c=Math.max(c,g.w,g.h)}u.sort(function(re,se){return se.value-re.value});for(var y=e.levelWidth(i),m=[[]],b=m[0],w=0;w<u.length;w++){var C=u[w];if(b.length>0){var E=Math.abs(b[0].value-C.value);E>=y&&(b=[],m.push(b))}b.push(C)}var x=c+e.minNodeSpacing;if(!e.avoidOverlap){var k=m.length>0&&m[0].length>1,B=Math.min(s.w,s.h)/2-x,S=B/(m.length+k?1:0);x=Math.min(x,S)}for(var N=0,D=0;D<m.length;D++){var _=m[D],O=e.sweep===void 0?2*Math.PI-2*Math.PI/_.length:e.sweep,P=_.dTheta=O/Math.max(1,_.length-1);if(_.length>1&&e.avoidOverlap){var F=Math.cos(P)-Math.cos(0),I=Math.sin(P)-Math.sin(0),M=Math.sqrt(x*x/(F*F+I*I));N=Math.max(M,N)}_.r=N,N+=x}if(e.equidistant){for(var L=0,V=0,H=0;H<m.length;H++){var $=m[H],z=$.r-V;L=Math.max(L,z)}V=0;for(var j=0;j<m.length;j++){var ee=m[j];j===0&&(V=ee.r),ee.r=V,V+=L}}for(var J={},X=0;X<m.length;X++)for(var ne=m[X],Y=ne.dTheta,A=ne.r,K=0;K<ne.length;K++){var W=ne[K],oe=e.startAngle+(n?1:-1)*Y*K,he={x:l.x+A*Math.cos(oe),y:l.y+A*Math.sin(oe)};J[W.node.id()]=he}return a.nodes().layoutPositions(this,e,function(re){var se=re.id();return J[se]}),this};var xc,i4={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,n){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function ws(t){this.options=xe({},i4,t),this.options.layout=this;var e=this.options.eles.nodes(),n=this.options.eles.edges(),r=n.filter(function(a){var i=a.source().data("id"),s=a.target().data("id"),l=e.some(function(c){return c.data("id")===i}),u=e.some(function(c){return c.data("id")===s});return!l||!u});this.options.eles=this.options.eles.not(r)}ws.prototype.run=function(){var t=this.options,e=t.cy,n=this;n.stopped=!1,(t.animate===!0||t.animate===!1)&&n.emit({type:"layoutstart",layout:n}),t.debug===!0?xc=!0:xc=!1;var r=o4(e,n,t);xc&&c4(r),t.randomize&&u4(r);var a=Rn(),i=function(){d4(r,e,t),t.fit===!0&&e.fit(t.padding)},s=function(h){return!(n.stopped||h>=t.numIter||(f4(r,t),r.temperature=r.temperature*t.coolingFactor,r.temperature<t.minTemp))},l=function(){if(t.animate===!0||t.animate===!1)i(),n.one("layoutstop",t.stop),n.emit({type:"layoutstop",layout:n});else{var h=t.eles.nodes(),v=Up(r,t,h);h.layoutPositions(n,t,v)}},u=0,c=!0;if(t.animate===!0){var d=function f(){for(var h=0;c&&h<t.refresh;)c=s(u),u++,h++;if(!c)Wp(r,t),l();else{var v=Rn();v-a>=t.animationThreshold&&i(),Vo(f)}};d()}else{for(;c;)c=s(u),u++;Wp(r,t),l()}return this},ws.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},ws.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var o4=function(e,n,r){for(var a=r.eles.edges(),i=r.eles.nodes(),s=zt(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),l={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:r.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},u=r.eles.components(),c={},d=0;d<u.length;d++)for(var f=u[d],h=0;h<f.length;h++){var v=f[h];c[v.id()]=d}for(var d=0;d<l.nodeSize;d++){var p=i[d],g=p.layoutDimensions(r),y={};y.isLocked=p.locked(),y.id=p.data("id"),y.parentId=p.data("parent"),y.cmptId=c[p.id()],y.children=[],y.positionX=p.position("x"),y.positionY=p.position("y"),y.offsetX=0,y.offsetY=0,y.height=g.w,y.width=g.h,y.maxX=y.positionX+y.width/2,y.minX=y.positionX-y.width/2,y.maxY=y.positionY+y.height/2,y.minY=y.positionY-y.height/2,y.padLeft=parseFloat(p.style("padding")),y.padRight=parseFloat(p.style("padding")),y.padTop=parseFloat(p.style("padding")),y.padBottom=parseFloat(p.style("padding")),y.nodeRepulsion=Ye(r.nodeRepulsion)?r.nodeRepulsion(p):r.nodeRepulsion,l.layoutNodes.push(y),l.idToIndex[y.id]=d}for(var m=[],b=0,w=-1,C=[],d=0;d<l.nodeSize;d++){var p=l.layoutNodes[d],E=p.parentId;E!=null?l.layoutNodes[l.idToIndex[E]].children.push(p.id):(m[++w]=p.id,C.push(p.id))}for(l.graphSet.push(C);b<=w;){var x=m[b++],k=l.idToIndex[x],v=l.layoutNodes[k],B=v.children;if(B.length>0){l.graphSet.push(B);for(var d=0;d<B.length;d++)m[++w]=B[d]}}for(var d=0;d<l.graphSet.length;d++)for(var S=l.graphSet[d],h=0;h<S.length;h++){var N=l.idToIndex[S[h]];l.indexToGraph[N]=d}for(var d=0;d<l.edgeSize;d++){var D=a[d],_={};_.id=D.data("id"),_.sourceId=D.data("source"),_.targetId=D.data("target");var O=Ye(r.idealEdgeLength)?r.idealEdgeLength(D):r.idealEdgeLength,P=Ye(r.edgeElasticity)?r.edgeElasticity(D):r.edgeElasticity,F=l.idToIndex[_.sourceId],I=l.idToIndex[_.targetId],M=l.indexToGraph[F],L=l.indexToGraph[I];if(M!=L){for(var V=s4(_.sourceId,_.targetId,l),H=l.graphSet[V],$=0,y=l.layoutNodes[F];H.indexOf(y.id)===-1;)y=l.layoutNodes[l.idToIndex[y.parentId]],$++;for(y=l.layoutNodes[I];H.indexOf(y.id)===-1;)y=l.layoutNodes[l.idToIndex[y.parentId]],$++;O*=$*r.nestingFactor}_.idealLength=O,_.elasticity=P,l.layoutEdges.push(_)}return l},s4=function(e,n,r){var a=l4(e,n,0,r);return 2>a.count?0:a.graph},l4=function t(e,n,r,a){var i=a.graphSet[r];if(-1<i.indexOf(e)&&-1<i.indexOf(n))return{count:2,graph:r};for(var s=0,l=0;l<i.length;l++){var u=i[l],c=a.idToIndex[u],d=a.layoutNodes[c].children;if(d.length!==0){var f=a.indexToGraph[a.idToIndex[d[0]]],h=t(e,n,f,a);if(h.count!==0)if(h.count===1){if(s++,s===2)break}else return h}}return{count:s,graph:r}},c4,u4=function(e,n){for(var r=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var s=e.layoutNodes[i];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*r,s.positionY=Math.random()*a)}},Up=function(e,n,r){var a=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return n.boundingBox&&(r.forEach(function(s){var l=e.layoutNodes[e.idToIndex[s.data("id")]];i.x1=Math.min(i.x1,l.positionX),i.x2=Math.max(i.x2,l.positionX),i.y1=Math.min(i.y1,l.positionY),i.y2=Math.max(i.y2,l.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(s,l){var u=e.layoutNodes[e.idToIndex[s.data("id")]];if(n.boundingBox){var c=(u.positionX-i.x1)/i.w,d=(u.positionY-i.y1)/i.h;return{x:a.x1+c*a.w,y:a.y1+d*a.h}}else return{x:u.positionX,y:u.positionY}}},d4=function(e,n,r){var a=r.layout,i=r.eles.nodes(),s=Up(e,r,i);i.positions(s),e.ready!==!0&&(e.ready=!0,a.one("layoutready",r.ready),a.emit({type:"layoutready",layout:this}))},f4=function(e,n,r){h4(e,n),g4(e),m4(e,n),y4(e),b4(e)},h4=function(e,n){for(var r=0;r<e.graphSet.length;r++)for(var a=e.graphSet[r],i=a.length,s=0;s<i;s++)for(var l=e.layoutNodes[e.idToIndex[a[s]]],u=s+1;u<i;u++){var c=e.layoutNodes[e.idToIndex[a[u]]];p4(l,c,e,n)}},Gp=function(e){return-e+2*e*Math.random()},p4=function(e,n,r,a){var i=e.cmptId,s=n.cmptId;if(!(i!==s&&!r.isCompound)){var l=n.positionX-e.positionX,u=n.positionY-e.positionY,c=1;l===0&&u===0&&(l=Gp(c),u=Gp(c));var d=v4(e,n,l,u);if(d>0)var f=a.nodeOverlap*d,h=Math.sqrt(l*l+u*u),v=f*l/h,p=f*u/h;else var g=Cs(e,l,u),y=Cs(n,-1*l,-1*u),m=y.x-g.x,b=y.y-g.y,w=m*m+b*b,h=Math.sqrt(w),f=(e.nodeRepulsion+n.nodeRepulsion)/w,v=f*m/h,p=f*b/h;e.isLocked||(e.offsetX-=v,e.offsetY-=p),n.isLocked||(n.offsetX+=v,n.offsetY+=p)}},v4=function(e,n,r,a){if(r>0)var i=e.maxX-n.minX;else var i=n.maxX-e.minX;if(a>0)var s=e.maxY-n.minY;else var s=n.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},Cs=function(e,n,r){var a=e.positionX,i=e.positionY,s=e.height||1,l=e.width||1,u=r/n,c=s/l,d={};return n===0&&0<r||n===0&&0>r?(d.x=a,d.y=i+s/2,d):0<n&&-1*c<=u&&u<=c?(d.x=a+l/2,d.y=i+l*r/2/n,d):0>n&&-1*c<=u&&u<=c?(d.x=a-l/2,d.y=i-l*r/2/n,d):0<r&&(u<=-1*c||u>=c)?(d.x=a+s*n/2/r,d.y=i+s/2,d):(0>r&&(u<=-1*c||u>=c)&&(d.x=a-s*n/2/r,d.y=i-s/2),d)},g4=function(e,n){for(var r=0;r<e.edgeSize;r++){var a=e.layoutEdges[r],i=e.idToIndex[a.sourceId],s=e.layoutNodes[i],l=e.idToIndex[a.targetId],u=e.layoutNodes[l],c=u.positionX-s.positionX,d=u.positionY-s.positionY;if(!(c===0&&d===0)){var f=Cs(s,c,d),h=Cs(u,-1*c,-1*d),v=h.x-f.x,p=h.y-f.y,g=Math.sqrt(v*v+p*p),y=Math.pow(a.idealLength-g,2)/a.elasticity;if(g!==0)var m=y*v/g,b=y*p/g;else var m=0,b=0;s.isLocked||(s.offsetX+=m,s.offsetY+=b),u.isLocked||(u.offsetX-=m,u.offsetY-=b)}}},m4=function(e,n){if(n.gravity!==0)for(var r=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],s=i.length;if(a===0)var l=e.clientHeight/2,u=e.clientWidth/2;else var c=e.layoutNodes[e.idToIndex[i[0]]],d=e.layoutNodes[e.idToIndex[c.parentId]],l=d.positionX,u=d.positionY;for(var f=0;f<s;f++){var h=e.layoutNodes[e.idToIndex[i[f]]];if(!h.isLocked){var v=l-h.positionX,p=u-h.positionY,g=Math.sqrt(v*v+p*p);if(g>r){var y=n.gravity*v/g,m=n.gravity*p/g;h.offsetX+=y,h.offsetY+=m}}}}},y4=function(e,n){var r=[],a=0,i=-1;for(r.push.apply(r,e.graphSet[0]),i+=e.graphSet[0].length;a<=i;){var s=r[a++],l=e.idToIndex[s],u=e.layoutNodes[l],c=u.children;if(0<c.length&&!u.isLocked){for(var d=u.offsetX,f=u.offsetY,h=0;h<c.length;h++){var v=e.layoutNodes[e.idToIndex[c[h]]];v.offsetX+=d,v.offsetY+=f,r[++i]=c[h]}u.offsetX=0,u.offsetY=0}}},b4=function(e,n){for(var r=0;r<e.nodeSize;r++){var a=e.layoutNodes[r];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var r=0;r<e.nodeSize;r++){var a=e.layoutNodes[r];if(!(0<a.children.length||a.isLocked)){var i=w4(a.offsetX,a.offsetY,e.temperature);a.positionX+=i.x,a.positionY+=i.y,a.offsetX=0,a.offsetY=0,a.minX=a.positionX-a.width,a.maxX=a.positionX+a.width,a.minY=a.positionY-a.height,a.maxY=a.positionY+a.height,C4(a,e)}}for(var r=0;r<e.nodeSize;r++){var a=e.layoutNodes[r];0<a.children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},w4=function(e,n,r){var a=Math.sqrt(e*e+n*n);if(a>r)var i={x:r*e/a,y:r*n/a};else var i={x:e,y:n};return i},C4=function t(e,n){var r=e.parentId;if(r!=null){var a=n.layoutNodes[n.idToIndex[r]],i=!1;if((a.maxX==null||e.maxX+a.padRight>a.maxX)&&(a.maxX=e.maxX+a.padRight,i=!0),(a.minX==null||e.minX-a.padLeft<a.minX)&&(a.minX=e.minX-a.padLeft,i=!0),(a.maxY==null||e.maxY+a.padBottom>a.maxY)&&(a.maxY=e.maxY+a.padBottom,i=!0),(a.minY==null||e.minY-a.padTop<a.minY)&&(a.minY=e.minY-a.padTop,i=!0),i)return t(a,n)}},Wp=function(e,n){for(var r=e.layoutNodes,a=[],i=0;i<r.length;i++){var s=r[i],l=s.cmptId,u=a[l]=a[l]||[];u.push(s)}for(var c=0,i=0;i<a.length;i++){var d=a[i];if(d){d.x1=1/0,d.x2=-1/0,d.y1=1/0,d.y2=-1/0;for(var f=0;f<d.length;f++){var h=d[f];d.x1=Math.min(d.x1,h.positionX-h.width/2),d.x2=Math.max(d.x2,h.positionX+h.width/2),d.y1=Math.min(d.y1,h.positionY-h.height/2),d.y2=Math.max(d.y2,h.positionY+h.height/2)}d.w=d.x2-d.x1,d.h=d.y2-d.y1,c+=d.w*d.h}}a.sort(function(b,w){return w.w*w.h-b.w*b.h});for(var v=0,p=0,g=0,y=0,m=Math.sqrt(c)*e.clientWidth/e.clientHeight,i=0;i<a.length;i++){var d=a[i];if(d){for(var f=0;f<d.length;f++){var h=d[f];h.isLocked||(h.positionX+=v-d.x1,h.positionY+=p-d.y1)}v+=d.w+n.componentSpacing,g+=d.w+n.componentSpacing,y=Math.max(y,d.h),g>m&&(p+=y+n.componentSpacing,v=0,g=0,y=0)}}},k4={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function jp(t){this.options=xe({},k4,t)}jp.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,a=r.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var i=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(i.h===0||i.w===0)r.nodes().layoutPositions(this,e,function(j){return{x:i.x1,y:i.y1}});else{var s=a.size(),l=Math.sqrt(s*i.h/i.w),u=Math.round(l),c=Math.round(i.w/i.h*l),d=function(ee){if(ee==null)return Math.min(u,c);var J=Math.min(u,c);J==u?u=ee:c=ee},f=function(ee){if(ee==null)return Math.max(u,c);var J=Math.max(u,c);J==u?u=ee:c=ee},h=e.rows,v=e.cols!=null?e.cols:e.columns;if(h!=null&&v!=null)u=h,c=v;else if(h!=null&&v==null)u=h,c=Math.ceil(s/u);else if(h==null&&v!=null)c=v,u=Math.ceil(s/c);else if(c*u>s){var p=d(),g=f();(p-1)*g>=s?d(p-1):(g-1)*p>=s&&f(g-1)}else for(;c*u<s;){var y=d(),m=f();(m+1)*y>=s?f(m+1):d(y+1)}var b=i.w/c,w=i.h/u;if(e.condense&&(b=0,w=0),e.avoidOverlap)for(var C=0;C<a.length;C++){var E=a[C],x=E._private.position;(x.x==null||x.y==null)&&(x.x=0,x.y=0);var k=E.layoutDimensions(e),B=e.avoidOverlapPadding,S=k.w+B,N=k.h+B;b=Math.max(b,S),w=Math.max(w,N)}for(var D={},_=function(ee,J){return!!D["c-"+ee+"-"+J]},O=function(ee,J){D["c-"+ee+"-"+J]=!0},P=0,F=0,I=function(){F++,F>=c&&(F=0,P++)},M={},L=0;L<a.length;L++){var V=a[L],H=e.position(V);if(H&&(H.row!==void 0||H.col!==void 0)){var $={row:H.row,col:H.col};if($.col===void 0)for($.col=0;_($.row,$.col);)$.col++;else if($.row===void 0)for($.row=0;_($.row,$.col);)$.row++;M[V.id()]=$,O($.row,$.col)}}var z=function(ee,J){var X,ne;if(ee.locked()||ee.isParent())return!1;var Y=M[ee.id()];if(Y)X=Y.col*b+b/2+i.x1,ne=Y.row*w+w/2+i.y1;else{for(;_(P,F);)I();X=F*b+b/2+i.x1,ne=P*w+w/2+i.y1,O(P,F),I()}return{x:X,y:ne}};a.layoutPositions(this,e,z)}return this};var x4={ready:function(){},stop:function(){}};function Ec(t){this.options=xe({},x4,t)}Ec.prototype.run=function(){var t=this.options,e=t.eles,n=this;return t.cy,n.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),n.one("layoutready",t.ready),n.emit("layoutready"),n.one("layoutstop",t.stop),n.emit("layoutstop"),this},Ec.prototype.stop=function(){return this};var E4={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function Yp(t){this.options=xe({},E4,t)}Yp.prototype.run=function(){var t=this.options,e=t.eles,n=e.nodes(),r=Ye(t.positions);function a(i){if(t.positions==null)return NT(i.position());if(r)return t.positions(i);var s=t.positions[i._private.data.id];return s??null}return n.layoutPositions(this,t,function(i,s){var l=a(i);return i.locked()||l==null?!1:l}),this};var S4={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function Zp(t){this.options=xe({},S4,t)}Zp.prototype.run=function(){var t=this.options,e=t.cy,n=t.eles,r=zt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(s,l){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}};return n.nodes().layoutPositions(this,t,a),this};var T4=[{name:"breadthfirst",impl:Hp},{name:"circle",impl:Kp},{name:"concentric",impl:qp},{name:"cose",impl:ws},{name:"grid",impl:jp},{name:"null",impl:Ec},{name:"preset",impl:Yp},{name:"random",impl:Zp}];function Xp(t){this.options=t,this.notifications=0}var Qp=function(){},Jp=function(){throw new Error("A headless instance can not render images")};Xp.prototype={recalculateRenderedStyle:Qp,notify:function(){this.notifications++},init:Qp,isHeadless:function(){return!0},png:Jp,jpg:Jp};var Sc={};Sc.arrowShapeWidth=.3,Sc.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,n=function(c,d,f,h,v,p,g){var y=v.x-f/2-g,m=v.x+f/2+g,b=v.y-f/2-g,w=v.y+f/2+g,C=y<=c&&c<=m&&b<=d&&d<=w;return C},r=function(c,d,f,h,v){var p=c*Math.cos(h)-d*Math.sin(h),g=c*Math.sin(h)+d*Math.cos(h),y=p*f,m=g*f,b=y+v.x,w=m+v.y;return{x:b,y:w}},a=function(c,d,f,h){for(var v=[],p=0;p<c.length;p+=2){var g=c[p],y=c[p+1];v.push(r(g,y,d,f,h))}return v},i=function(c){for(var d=[],f=0;f<c.length;f++){var h=c[f];d.push(h.x,h.y)}return d},s=function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").pfValue*2},l=function(c,d){be(d)&&(d=t[d]),t[c]=xe({name:c,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(h,v,p,g,y,m){var b=i(a(this.points,p+2*m,g,y)),w=Ht(h,v,b);return w},roughCollide:n,draw:function(h,v,p,g){var y=a(this.points,v,p,g);e.arrowShapeImpl("polygon")(h,y)},spacing:function(h){return 0},gap:s},d)};l("none",{collide:$o,roughCollide:$o,draw:jl,spacing:dh,gap:dh}),l("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),l("arrow","triangle"),l("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(c,d,f,h,v){var p=a(this.points,d,f,h),g=this.controlPoint,y=r(g[0],g[1],d,f,h);e.arrowShapeImpl(this.name)(c,p,y)},gap:function(c){return s(c)*.8}}),l("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(c,d,f,h,v,p,g){var y=i(a(this.points,f+2*g,h,v)),m=i(a(this.pointsTee,f+2*g,h,v)),b=Ht(c,d,y)||Ht(c,d,m);return b},draw:function(c,d,f,h,v){var p=a(this.points,d,f,h),g=a(this.pointsTee,d,f,h);e.arrowShapeImpl(this.name)(c,p,g)}}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(c,d,f,h,v,p,g){var y=v,m=Math.pow(y.x-c,2)+Math.pow(y.y-d,2)<=Math.pow((f+2*g)*this.radius,2),b=i(a(this.points,f+2*g,h,v));return Ht(c,d,b)||m},draw:function(c,d,f,h,v){var p=a(this.pointsTr,d,f,h);e.arrowShapeImpl(this.name)(c,p,h.x,h.y,this.radius*d)},spacing:function(c){return e.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),l("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(c,d){var f=this.baseCrossLinePts.slice(),h=d/c,v=3,p=5;return f[v]=f[v]-h,f[p]=f[p]-h,f},collide:function(c,d,f,h,v,p,g){var y=i(a(this.points,f+2*g,h,v)),m=i(a(this.crossLinePts(f,p),f+2*g,h,v)),b=Ht(c,d,y)||Ht(c,d,m);return b},draw:function(c,d,f,h,v){var p=a(this.points,d,f,h),g=a(this.crossLinePts(d,v),d,f,h);e.arrowShapeImpl(this.name)(c,p,g)}}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(c){return s(c)*.525}}),l("circle",{radius:.15,collide:function(c,d,f,h,v,p,g){var y=v,m=Math.pow(y.x-c,2)+Math.pow(y.y-d,2)<=Math.pow((f+2*g)*this.radius,2);return m},draw:function(c,d,f,h,v){e.arrowShapeImpl(this.name)(c,h.x,h.y,this.radius*d)},spacing:function(c){return e.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),l("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(c){return 1},gap:function(c){return 1}}),l("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),l("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}}),l("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(c){return .95*c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}})};var Kr={};Kr.projectIntoViewport=function(t,e){var n=this.cy,r=this.findContainerClientCoords(),a=r[0],i=r[1],s=r[4],l=n.pan(),u=n.zoom(),c=((t-a)/s-l.x)/u,d=((e-i)/s-l.y)/u;return[c,d]},Kr.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),n=this.cy.window().getComputedStyle(t),r=function(m){return parseFloat(n.getPropertyValue(m))},a={left:r("padding-left"),right:r("padding-right"),top:r("padding-top"),bottom:r("padding-bottom")},i={left:r("border-left-width"),right:r("border-right-width"),top:r("border-top-width"),bottom:r("border-bottom-width")},s=t.clientWidth,l=t.clientHeight,u=a.left+a.right,c=a.top+a.bottom,d=i.left+i.right,f=e.width/(s+d),h=s-u,v=l-c,p=e.left+a.left+i.left,g=e.top+a.top+i.top;return this.containerBB=[p,g,h,v,f]},Kr.invalidateContainerClientCoordsCache=function(){this.containerBB=null},Kr.findNearestElement=function(t,e,n,r){return this.findNearestElements(t,e,n,r)[0]},Kr.findNearestElements=function(t,e,n,r){var a=this,i=this,s=i.getCachedZSortedEles(),l=[],u=i.cy.zoom(),c=i.cy.hasCompoundNodes(),d=(r?24:8)/u,f=(r?8:2)/u,h=(r?8:2)/u,v=1/0,p,g;n&&(s=s.interactive);function y(k,B){if(k.isNode()){if(g)return;g=k,l.push(k)}if(k.isEdge()&&(B==null||B<v))if(p){if(p.pstyle("z-compound-depth").value===k.pstyle("z-compound-depth").value&&p.pstyle("z-compound-depth").value===k.pstyle("z-compound-depth").value){for(var S=0;S<l.length;S++)if(l[S].isEdge()){l[S]=k,p=k,v=B??v;break}}}else l.push(k),p=k,v=B??v}function m(k){var B=k.outerWidth()+2*f,S=k.outerHeight()+2*f,N=B/2,D=S/2,_=k.position(),O=k.pstyle("corner-radius").value==="auto"?"auto":k.pstyle("corner-radius").pfValue,P=k._private.rscratch;if(_.x-N<=t&&t<=_.x+N&&_.y-D<=e&&e<=_.y+D){var F=i.nodeShapes[a.getNodeShape(k)];if(F.checkPoint(t,e,0,B,S,_.x,_.y,O,P))return y(k,0),!0}}function b(k){var B=k._private,S=B.rscratch,N=k.pstyle("width").pfValue,D=k.pstyle("arrow-scale").value,_=N/2+d,O=_*_,P=_*2,L=B.source,V=B.target,F;if(S.edgeType==="segments"||S.edgeType==="straight"||S.edgeType==="haystack"){for(var I=S.allpts,M=0;M+3<I.length;M+=2)if(zT(t,e,I[M],I[M+1],I[M+2],I[M+3],P)&&O>(F=GT(t,e,I[M],I[M+1],I[M+2],I[M+3])))return y(k,F),!0}else if(S.edgeType==="bezier"||S.edgeType==="multibezier"||S.edgeType==="self"||S.edgeType==="compound"){for(var I=S.allpts,M=0;M+5<S.allpts.length;M+=4)if(HT(t,e,I[M],I[M+1],I[M+2],I[M+3],I[M+4],I[M+5],P)&&O>(F=UT(t,e,I[M],I[M+1],I[M+2],I[M+3],I[M+4],I[M+5])))return y(k,F),!0}for(var L=L||B.source,V=V||B.target,H=a.getArrowWidth(N,D),$=[{name:"source",x:S.arrowStartX,y:S.arrowStartY,angle:S.srcArrowAngle},{name:"target",x:S.arrowEndX,y:S.arrowEndY,angle:S.tgtArrowAngle},{name:"mid-source",x:S.midX,y:S.midY,angle:S.midsrcArrowAngle},{name:"mid-target",x:S.midX,y:S.midY,angle:S.midtgtArrowAngle}],M=0;M<$.length;M++){var z=$[M],j=i.arrowShapes[k.pstyle(z.name+"-arrow-shape").value],ee=k.pstyle("width").pfValue;if(j.roughCollide(t,e,H,z.angle,{x:z.x,y:z.y},ee,d)&&j.collide(t,e,H,z.angle,{x:z.x,y:z.y},ee,d))return y(k),!0}c&&l.length>0&&(m(L),m(V))}function w(k,B,S){return fn(k,B,S)}function C(k,B){var S=k._private,N=h,D;B?D=B+"-":D="",k.boundingBox();var _=S.labelBounds[B||"main"],O=k.pstyle(D+"label").value,P=k.pstyle("text-events").strValue==="yes";if(!(!P||!O)){var F=w(S.rscratch,"labelX",B),I=w(S.rscratch,"labelY",B),M=w(S.rscratch,"labelAngle",B),L=k.pstyle(D+"text-margin-x").pfValue,V=k.pstyle(D+"text-margin-y").pfValue,H=_.x1-N-L,$=_.x2+N-L,z=_.y1-N-V,j=_.y2+N-V;if(M){var ee=Math.cos(M),J=Math.sin(M),X=function(he,re){return he=he-F,re=re-I,{x:he*ee-re*J+F,y:he*J+re*ee+I}},ne=X(H,z),Y=X(H,j),A=X($,z),K=X($,j),W=[ne.x+L,ne.y+V,A.x+L,A.y+V,K.x+L,K.y+V,Y.x+L,Y.y+V];if(Ht(t,e,W))return y(k),!0}else if(wa(_,t,e))return y(k),!0}}for(var E=s.length-1;E>=0;E--){var x=s[E];x.isNode()?m(x)||C(x):b(x)||C(x)||C(x,"source")||C(x,"target")}return l},Kr.getAllInBox=function(t,e,n,r){var a=this.getCachedZSortedEles().interactive,i=[],s=Math.min(t,n),l=Math.max(t,n),u=Math.min(e,r),c=Math.max(e,r);t=s,n=l,e=u,r=c;for(var d=zt({x1:t,y1:e,x2:n,y2:r}),f=0;f<a.length;f++){var h=a[f];if(h.isNode()){var v=h,p=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});Ql(d,p)&&!wh(p,d)&&i.push(v)}else{var g=h,y=g._private,m=y.rscratch;if(m.startX!=null&&m.startY!=null&&!wa(d,m.startX,m.startY)||m.endX!=null&&m.endY!=null&&!wa(d,m.endX,m.endY))continue;if(m.edgeType==="bezier"||m.edgeType==="multibezier"||m.edgeType==="self"||m.edgeType==="compound"||m.edgeType==="segments"||m.edgeType==="haystack"){for(var b=y.rstyle.bezierPts||y.rstyle.linePts||y.rstyle.haystackPts,w=!0,C=0;C<b.length;C++)if(!$T(d,b[C])){w=!1;break}w&&i.push(g)}else(m.edgeType==="haystack"||m.edgeType==="straight")&&i.push(g)}}return i};var ks={};ks.calculateArrowAngles=function(t){var e=t._private.rscratch,n=e.edgeType==="haystack",r=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",s=e.edgeType==="compound",l=e.edgeType==="self",u,c,d,f,h,v,m,b;if(n?(d=e.haystackPts[0],f=e.haystackPts[1],h=e.haystackPts[2],v=e.haystackPts[3]):(d=e.arrowStartX,f=e.arrowStartY,h=e.arrowEndX,v=e.arrowEndY),m=e.midX,b=e.midY,i)u=d-e.segpts[0],c=f-e.segpts[1];else if(a||s||l||r){var p=e.allpts,g=ht(p[0],p[2],p[4],.1),y=ht(p[1],p[3],p[5],.1);u=d-g,c=f-y}else u=d-m,c=f-b;e.srcArrowAngle=Ko(u,c);var m=e.midX,b=e.midY;if(n&&(m=(d+h)/2,b=(f+v)/2),u=h-d,c=v-f,i){var p=e.allpts;if(p.length/2%2===0){var w=p.length/2,C=w-2;u=p[w]-p[C],c=p[w+1]-p[C+1]}else if(e.isRound)u=e.midVector[1],c=-e.midVector[0];else{var w=p.length/2-1,C=w-2;u=p[w]-p[C],c=p[w+1]-p[C+1]}}else if(a||s||l){var p=e.allpts,E=e.ctrlpts,x,k,B,S;if(E.length/2%2===0){var N=p.length/2-1,D=N+2,_=D+2;x=ht(p[N],p[D],p[_],0),k=ht(p[N+1],p[D+1],p[_+1],0),B=ht(p[N],p[D],p[_],1e-4),S=ht(p[N+1],p[D+1],p[_+1],1e-4)}else{var D=p.length/2-1,N=D-2,_=D+2;x=ht(p[N],p[D],p[_],.4999),k=ht(p[N+1],p[D+1],p[_+1],.4999),B=ht(p[N],p[D],p[_],.5),S=ht(p[N+1],p[D+1],p[_+1],.5)}u=B-x,c=S-k}if(e.midtgtArrowAngle=Ko(u,c),e.midDispX=u,e.midDispY=c,u*=-1,c*=-1,i){var p=e.allpts;if(p.length/2%2!==0){if(!e.isRound){var w=p.length/2-1,O=w+2;u=-(p[O]-p[w]),c=-(p[O+1]-p[w+1])}}}if(e.midsrcArrowAngle=Ko(u,c),i)u=h-e.segpts[e.segpts.length-2],c=v-e.segpts[e.segpts.length-1];else if(a||s||l||r){var p=e.allpts,P=p.length,g=ht(p[P-6],p[P-4],p[P-2],.9),y=ht(p[P-5],p[P-3],p[P-1],.9);u=h-g,c=v-y}else u=h-m,c=v-b;e.tgtArrowAngle=Ko(u,c)},ks.getArrowWidth=ks.getArrowHeight=function(t,e){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[t+", "+e];return r||(r=Math.max(Math.pow(t*13.37,.9),29)*e,n[t+", "+e]=r,r)};var Tc,Bc,Sn={},nn={},ev,tv,qr,xs,Hn,Ur,Gr,Tn,Fa,Es,nv,rv,Nc,Dc,av,iv=function(e,n,r){r.x=n.x-e.x,r.y=n.y-e.y,r.len=Math.sqrt(r.x*r.x+r.y*r.y),r.nx=r.x/r.len,r.ny=r.y/r.len,r.ang=Math.atan2(r.ny,r.nx)},B4=function(e,n){n.x=e.x*-1,n.y=e.y*-1,n.nx=e.nx*-1,n.ny=e.ny*-1,n.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},N4=function(e,n,r,a,i){if(e!==av?iv(n,e,Sn):B4(nn,Sn),iv(n,r,nn),ev=Sn.nx*nn.ny-Sn.ny*nn.nx,tv=Sn.nx*nn.nx-Sn.ny*-nn.ny,Hn=Math.asin(Math.max(-1,Math.min(1,ev))),Math.abs(Hn)<1e-6){Tc=n.x,Bc=n.y,Gr=Fa=0;return}qr=1,xs=!1,tv<0?Hn<0?Hn=Math.PI+Hn:(Hn=Math.PI-Hn,qr=-1,xs=!0):Hn>0&&(qr=-1,xs=!0),n.radius!==void 0?Fa=n.radius:Fa=a,Ur=Hn/2,Es=Math.min(Sn.len/2,nn.len/2),i?(Tn=Math.abs(Math.cos(Ur)*Fa/Math.sin(Ur)),Tn>Es?(Tn=Es,Gr=Math.abs(Tn*Math.sin(Ur)/Math.cos(Ur))):Gr=Fa):(Tn=Math.min(Es,Fa),Gr=Math.abs(Tn*Math.sin(Ur)/Math.cos(Ur))),Nc=n.x+nn.nx*Tn,Dc=n.y+nn.ny*Tn,Tc=Nc-nn.ny*Gr*qr,Bc=Dc+nn.nx*Gr*qr,nv=n.x+Sn.nx*Tn,rv=n.y+Sn.ny*Tn,av=n};function ov(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function _c(t,e,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return r===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(N4(t,e,n,r,a),{cx:Tc,cy:Bc,radius:Gr,startX:nv,startY:rv,stopX:Nc,stopY:Dc,startAngle:Sn.ang+Math.PI/2*qr,endAngle:nn.ang-Math.PI/2*qr,counterClockwise:xs})}var _t={};_t.findMidptPtsEtc=function(t,e){var n=e.posPts,r=e.intersectionPts,a=e.vectorNormInverse,i,s=t.pstyle("source-endpoint"),l=t.pstyle("target-endpoint"),u=s.units!=null&&l.units!=null,c=function(E,x,k,B){var S=B-x,N=k-E,D=Math.sqrt(N*N+S*S);return{x:-S/D,y:N/D}},d=t.pstyle("edge-distances").value;switch(d){case"node-position":i=n;break;case"intersection":i=r;break;case"endpoints":{if(u){var f=this.manualEndptToPx(t.source()[0],s),h=dn(f,2),v=h[0],p=h[1],g=this.manualEndptToPx(t.target()[0],l),y=dn(g,2),m=y[0],b=y[1],w={x1:v,y1:p,x2:m,y2:b};a=c(v,p,m,b),i=w}else Ve("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=r;break}}return{midptPts:i,vectorNormInverse:a}},_t.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=n._private,a=r.rscratch;if(!a.haystack){var i=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var s=r.source,l=r.target,u=s.position(),c=l.position(),d=s.width(),f=l.width(),h=s.height(),v=l.height(),p=n.pstyle("haystack-radius").value,g=p/2;a.haystackPts=a.allpts=[a.source.x*d*g+u.x,a.source.y*h*g+u.y,a.target.x*f*g+c.x,a.target.y*v*g+c.y],a.midX=(a.allpts[0]+a.allpts[2])/2,a.midY=(a.allpts[1]+a.allpts[3])/2,a.edgeType="haystack",a.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},_t.findSegmentsPoints=function(t,e){var n=t._private.rscratch,r=t.pstyle("segment-weights"),a=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),l=Math.min(r.pfValue.length,a.pfValue.length),u=i.pfValue[i.pfValue.length-1],c=s.pfValue[s.pfValue.length-1];n.edgeType="segments",n.segpts=[],n.radii=[],n.isArcRadius=[];for(var d=0;d<l;d++){var f=r.pfValue[d],h=a.pfValue[d],v=1-f,p=f,g=this.findMidptPtsEtc(t,e),y=g.midptPts,m=g.vectorNormInverse,b={x:y.x1*v+y.x2*p,y:y.y1*v+y.y2*p};n.segpts.push(b.x+m.x*h,b.y+m.y*h),n.radii.push(i.pfValue[d]!==void 0?i.pfValue[d]:u),n.isArcRadius.push((s.pfValue[d]!==void 0?s.pfValue[d]:c)==="arc-radius")}},_t.findLoopPoints=function(t,e,n,r){var a=t._private.rscratch,i=e.dirCounts,s=e.srcPos,l=t.pstyle("control-point-distances"),u=l?l.pfValue[0]:void 0,c=t.pstyle("loop-direction").pfValue,d=t.pstyle("loop-sweep").pfValue,f=t.pstyle("control-point-step-size").pfValue;a.edgeType="self";var h=n,v=f;r&&(h=0,v=u);var p=c-Math.PI/2,g=p-d/2,y=p+d/2,m=c+"_"+d;h=i[m]===void 0?i[m]=0:++i[m],a.ctrlpts=[s.x+Math.cos(g)*1.4*v*(h/3+1),s.y+Math.sin(g)*1.4*v*(h/3+1),s.x+Math.cos(y)*1.4*v*(h/3+1),s.y+Math.sin(y)*1.4*v*(h/3+1)]},_t.findCompoundLoopPoints=function(t,e,n,r){var a=t._private.rscratch;a.edgeType="compound";var i=e.srcPos,s=e.tgtPos,l=e.srcW,u=e.srcH,c=e.tgtW,d=e.tgtH,f=t.pstyle("control-point-step-size").pfValue,h=t.pstyle("control-point-distances"),v=h?h.pfValue[0]:void 0,p=n,g=f;r&&(p=0,g=v);var y=50,m={x:i.x-l/2,y:i.y-u/2},b={x:s.x-c/2,y:s.y-d/2},w={x:Math.min(m.x,b.x),y:Math.min(m.y,b.y)},C=.5,E=Math.max(C,Math.log(l*.01)),x=Math.max(C,Math.log(c*.01));a.ctrlpts=[w.x,w.y-(1+Math.pow(y,1.12)/100)*g*(p/3+1)*E,w.x-(1+Math.pow(y,1.12)/100)*g*(p/3+1)*x,w.y]},_t.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"},_t.findBezierPoints=function(t,e,n,r,a){var i=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,l=t.pstyle("control-point-distances"),u=t.pstyle("control-point-weights"),c=l&&u?Math.min(l.value.length,u.value.length):1,d=l?l.pfValue[0]:void 0,f=u.value[0],h=r;i.edgeType=h?"multibezier":"bezier",i.ctrlpts=[];for(var v=0;v<c;v++){var p=(.5-e.eles.length/2+n)*s*(a?-1:1),g=void 0,y=mh(p);h&&(d=l?l.pfValue[v]:s,f=u.value[v]),r?g=d:g=d!==void 0?y*d:void 0;var m=g!==void 0?g:p,b=1-f,w=f,C=this.findMidptPtsEtc(t,e),E=C.midptPts,x=C.vectorNormInverse,k={x:E.x1*b+E.x2*w,y:E.y1*b+E.y2*w};i.ctrlpts.push(k.x+x.x*m,k.y+x.y*m)}},_t.findTaxiPoints=function(t,e){var n=t._private.rscratch;n.edgeType="segments";var r="vertical",a="horizontal",i="leftward",s="rightward",l="downward",u="upward",c="auto",d=e.posPts,f=e.srcW,h=e.srcH,v=e.tgtW,p=e.tgtH,g=t.pstyle("edge-distances").value,y=g!=="node-position",m=t.pstyle("taxi-direction").value,b=m,w=t.pstyle("taxi-turn"),C=w.units==="%",E=w.pfValue,x=E<0,k=t.pstyle("taxi-turn-min-distance").pfValue,B=y?(f+v)/2:0,S=y?(h+p)/2:0,N=d.x2-d.x1,D=d.y2-d.y1,_=function(we,Ce){return we>0?Math.max(we-Ce,0):Math.min(we+Ce,0)},O=_(N,B),P=_(D,S),F=!1;b===c?m=Math.abs(O)>Math.abs(P)?a:r:b===u||b===l?(m=r,F=!0):(b===i||b===s)&&(m=a,F=!0);var I=m===r,M=I?P:O,L=I?D:N,V=mh(L),H=!1;!(F&&(C||x))&&(b===l&&L<0||b===u&&L>0||b===i&&L>0||b===s&&L<0)&&(V*=-1,M=V*Math.abs(M),H=!0);var $;if(C){var z=E<0?1+E:E;$=z*M}else{var j=E<0?M:0;$=j+E*V}var ee=function(we){return Math.abs(we)<k||Math.abs(we)>=Math.abs(M)},J=ee($),X=ee(Math.abs(M)-Math.abs($)),ne=J||X;if(ne&&!H)if(I){var Y=Math.abs(L)<=h/2,A=Math.abs(N)<=v/2;if(Y){var K=(d.x1+d.x2)/2,W=d.y1,oe=d.y2;n.segpts=[K,W,K,oe]}else if(A){var he=(d.y1+d.y2)/2,re=d.x1,se=d.x2;n.segpts=[re,he,se,he]}else n.segpts=[d.x1,d.y2]}else{var ue=Math.abs(L)<=f/2,pe=Math.abs(D)<=p/2;if(ue){var de=(d.y1+d.y2)/2,me=d.x1,Ne=d.x2;n.segpts=[me,de,Ne,de]}else if(pe){var De=(d.x1+d.x2)/2,Ee=d.y1,_e=d.y2;n.segpts=[De,Ee,De,_e]}else n.segpts=[d.x2,d.y1]}else if(I){var te=d.y1+$+(y?h/2*V:0),T=d.x1,R=d.x2;n.segpts=[T,te,R,te]}else{var Q=d.x1+$+(y?f/2*V:0),G=d.y1,U=d.y2;n.segpts=[Q,G,Q,U]}if(n.isRound){var ie=t.pstyle("taxi-radius").value,Z=t.pstyle("radius-type").value[0]==="arc-radius";n.radii=new Array(n.segpts.length/2).fill(ie),n.isArcRadius=new Array(n.segpts.length/2).fill(Z)}},_t.tryToCorrectInvalidPoints=function(t,e){var n=t._private.rscratch;if(n.edgeType==="bezier"){var r=e.srcPos,a=e.tgtPos,i=e.srcW,s=e.srcH,l=e.tgtW,u=e.tgtH,c=e.srcShape,d=e.tgtShape,f=e.srcCornerRadius,h=e.tgtCornerRadius,v=e.srcRs,p=e.tgtRs,g=!le(n.startX)||!le(n.startY),y=!le(n.arrowStartX)||!le(n.arrowStartY),m=!le(n.endX)||!le(n.endY),b=!le(n.arrowEndX)||!le(n.arrowEndY),w=3,C=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,E=w*C,x=Fr({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),k=x<E,B=Fr({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),S=B<E,N=!1;if(g||y||k){N=!0;var D={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},_=Math.sqrt(D.x*D.x+D.y*D.y),O={x:D.x/_,y:D.y/_},P=Math.max(i,s),F={x:n.ctrlpts[0]+O.x*2*P,y:n.ctrlpts[1]+O.y*2*P},I=c.intersectLine(r.x,r.y,i,s,F.x,F.y,0,f,v);k?(n.ctrlpts[0]=n.ctrlpts[0]+O.x*(E-x),n.ctrlpts[1]=n.ctrlpts[1]+O.y*(E-x)):(n.ctrlpts[0]=I[0]+O.x*E,n.ctrlpts[1]=I[1]+O.y*E)}if(m||b||S){N=!0;var M={x:n.ctrlpts[0]-a.x,y:n.ctrlpts[1]-a.y},L=Math.sqrt(M.x*M.x+M.y*M.y),V={x:M.x/L,y:M.y/L},H=Math.max(i,s),$={x:n.ctrlpts[0]+V.x*2*H,y:n.ctrlpts[1]+V.y*2*H},z=d.intersectLine(a.x,a.y,l,u,$.x,$.y,0,h,p);S?(n.ctrlpts[0]=n.ctrlpts[0]+V.x*(E-B),n.ctrlpts[1]=n.ctrlpts[1]+V.y*(E-B)):(n.ctrlpts[0]=z[0]+V.x*E,n.ctrlpts[1]=z[1]+V.y*E)}N&&this.findEndpoints(t)}},_t.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var n=0;n+1<e.ctrlpts.length;n+=2)e.allpts.push(e.ctrlpts[n],e.ctrlpts[n+1]),n+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[n]+e.ctrlpts[n+2])/2,(e.ctrlpts[n+1]+e.ctrlpts[n+3])/2);e.allpts.push(e.endX,e.endY);var r,a;e.ctrlpts.length/2%2===0?(r=e.allpts.length/2-1,e.midX=e.allpts[r],e.midY=e.allpts[r+1]):(r=e.allpts.length/2-3,a=.5,e.midX=ht(e.allpts[r],e.allpts[r+2],e.allpts[r+4],a),e.midY=ht(e.allpts[r+1],e.allpts[r+3],e.allpts[r+5],a))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var s=e.radii[i/2-1],l=e.isArcRadius[i/2-1];e.roundCorners.push(_c({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:s},{x:e.allpts[i+2],y:e.allpts[i+3]},s,l))}}if(e.segpts.length%4===0){var u=e.segpts.length/2,c=u-2;e.midX=(e.segpts[c]+e.segpts[u])/2,e.midY=(e.segpts[c+1]+e.segpts[u+1])/2}else{var d=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[d],e.midY=e.segpts[d+1];else{var f={x:e.segpts[d],y:e.segpts[d+1]},h=e.roundCorners[d/2],v=[f.x-h.cx,f.y-h.cy],p=h.radius/Math.sqrt(Math.pow(v[0],2)+Math.pow(v[1],2));v=v.map(function(g){return g*p}),e.midX=h.cx+v[0],e.midY=h.cy+v[1],e.midVector=v}}}},_t.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||le(e.startX)&&le(e.startY)&&le(e.endX)&&le(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Ve("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},_t.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var n=this,r=n.cy,a=r.hasCompoundNodes(),i={map:new xn,get:function(k){var B=this.map.get(k[0]);return B!=null?B.get(k[1]):null},set:function(k,B){var S=this.map.get(k[0]);S==null&&(S=new xn,this.map.set(k[0],S)),S.set(k[1],B)}},s=[],l=[],u=0;u<t.length;u++){var c=t[u],d=c._private,f=c.pstyle("curve-style").value;if(!(c.removed()||!c.takesUpSpace())){if(f==="haystack"){l.push(c);continue}var h=f==="unbundled-bezier"||f.endsWith("segments")||f==="straight"||f==="straight-triangle"||f.endsWith("taxi"),v=f==="unbundled-bezier"||f==="bezier",p=d.source,g=d.target,y=p.poolIndex(),m=g.poolIndex(),b=[y,m].sort(),w=i.get(b);w==null&&(w={eles:[]},i.set(b,w),s.push(b)),w.eles.push(c),h&&(w.hasUnbundled=!0),v&&(w.hasBezier=!0)}}for(var C=function(k){var B=s[k],S=i.get(B),N=void 0;if(!S.hasUnbundled){var D=S.eles[0].parallelEdges().filter(function(Q){return Q.isBundledBezier()});Yl(S.eles),D.forEach(function(Q){return S.eles.push(Q)}),S.eles.sort(function(Q,G){return Q.poolIndex()-G.poolIndex()})}var _=S.eles[0],O=_.source(),P=_.target();if(O.poolIndex()>P.poolIndex()){var F=O;O=P,P=F}var I=S.srcPos=O.position(),M=S.tgtPos=P.position(),L=S.srcW=O.outerWidth(),V=S.srcH=O.outerHeight(),H=S.tgtW=P.outerWidth(),$=S.tgtH=P.outerHeight(),z=S.srcShape=n.nodeShapes[e.getNodeShape(O)],j=S.tgtShape=n.nodeShapes[e.getNodeShape(P)],ee=S.srcCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,J=S.tgtCornerRadius=P.pstyle("corner-radius").value==="auto"?"auto":P.pstyle("corner-radius").pfValue,X=S.tgtRs=P._private.rscratch,ne=S.srcRs=O._private.rscratch;S.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var Y=0;Y<S.eles.length;Y++){var A=S.eles[Y],K=A[0]._private.rscratch,W=A.pstyle("curve-style").value,oe=W==="unbundled-bezier"||W.endsWith("segments")||W.endsWith("taxi"),he=!O.same(A.source());if(!S.calculatedIntersection&&O!==P&&(S.hasBezier||S.hasUnbundled)){S.calculatedIntersection=!0;var re=z.intersectLine(I.x,I.y,L,V,M.x,M.y,0,ee,ne),se=S.srcIntn=re,ue=j.intersectLine(M.x,M.y,H,$,I.x,I.y,0,J,X),pe=S.tgtIntn=ue,de=S.intersectionPts={x1:re[0],x2:ue[0],y1:re[1],y2:ue[1]},me=S.posPts={x1:I.x,x2:M.x,y1:I.y,y2:M.y},Ne=ue[1]-re[1],De=ue[0]-re[0],Ee=Math.sqrt(De*De+Ne*Ne),_e=S.vector={x:De,y:Ne},te=S.vectorNorm={x:_e.x/Ee,y:_e.y/Ee},T={x:-te.y,y:te.x};S.nodesOverlap=!le(Ee)||j.checkPoint(re[0],re[1],0,H,$,M.x,M.y,J,X)||z.checkPoint(ue[0],ue[1],0,L,V,I.x,I.y,ee,ne),S.vectorNormInverse=T,N={nodesOverlap:S.nodesOverlap,dirCounts:S.dirCounts,calculatedIntersection:!0,hasBezier:S.hasBezier,hasUnbundled:S.hasUnbundled,eles:S.eles,srcPos:M,tgtPos:I,srcW:H,srcH:$,tgtW:L,tgtH:V,srcIntn:pe,tgtIntn:se,srcShape:j,tgtShape:z,posPts:{x1:me.x2,y1:me.y2,x2:me.x1,y2:me.y1},intersectionPts:{x1:de.x2,y1:de.y2,x2:de.x1,y2:de.y1},vector:{x:-_e.x,y:-_e.y},vectorNorm:{x:-te.x,y:-te.y},vectorNormInverse:{x:-T.x,y:-T.y}}}var R=he?N:S;K.nodesOverlap=R.nodesOverlap,K.srcIntn=R.srcIntn,K.tgtIntn=R.tgtIntn,K.isRound=W.startsWith("round"),a&&(O.isParent()||O.isChild()||P.isParent()||P.isChild())&&(O.parents().anySame(P)||P.parents().anySame(O)||O.same(P)&&O.isParent())?e.findCompoundLoopPoints(A,R,Y,oe):O===P?e.findLoopPoints(A,R,Y,oe):W.endsWith("segments")?e.findSegmentsPoints(A,R):W.endsWith("taxi")?e.findTaxiPoints(A,R):W==="straight"||!oe&&S.eles.length%2===1&&Y===Math.floor(S.eles.length/2)?e.findStraightEdgePoints(A):e.findBezierPoints(A,R,Y,oe,he),e.findEndpoints(A),e.tryToCorrectInvalidPoints(A,R),e.checkForInvalidEdgeWarning(A),e.storeAllpts(A),e.storeEdgeProjections(A),e.calculateArrowAngles(A),e.recalculateEdgeLabelProjections(A),e.calculateLabelAngles(A)}},E=0;E<s.length;E++)C(E);this.findHaystackPoints(l)}};function sv(t){var e=[];if(t!=null){for(var n=0;n<t.length;n+=2){var r=t[n],a=t[n+1];e.push({x:r,y:a})}return e}}_t.getSegmentPoints=function(t){var e=t[0]._private.rscratch,n=e.edgeType;if(n==="segments")return this.recalculateRenderedStyle(t),sv(e.segpts)},_t.getControlPoints=function(t){var e=t[0]._private.rscratch,n=e.edgeType;if(n==="bezier"||n==="multibezier"||n==="self"||n==="compound")return this.recalculateRenderedStyle(t),sv(e.ctrlpts)},_t.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var qi={};qi.manualEndptToPx=function(t,e){var n=this,r=t.position(),a=t.outerWidth(),i=t.outerHeight(),s=t._private.rscratch;if(e.value.length===2){var l=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(l[0]=l[0]*a),e.units[1]==="%"&&(l[1]=l[1]*i),l[0]+=r.x,l[1]+=r.y,l}else{var u=e.pfValue[0];u=-Math.PI/2+u;var c=2*Math.max(a,i),d=[r.x+Math.cos(u)*c,r.y+Math.sin(u)*c];return n.nodeShapes[this.getNodeShape(t)].intersectLine(r.x,r.y,a,i,d[0],d[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}},qi.findEndpoints=function(t){var e=this,n,r=t.source()[0],a=t.target()[0],i=r.position(),s=a.position(),l=t.pstyle("target-arrow-shape").value,u=t.pstyle("source-arrow-shape").value,c=t.pstyle("target-distance-from-node").pfValue,d=t.pstyle("source-distance-from-node").pfValue,f=r._private.rscratch,h=a._private.rscratch,v=t.pstyle("curve-style").value,p=t._private.rscratch,g=p.edgeType,y=v==="taxi",m=g==="self"||g==="compound",b=g==="bezier"||g==="multibezier"||m,w=g!=="bezier",C=g==="straight"||g==="segments",E=g==="segments",x=b||w||C,k=m||y,B=t.pstyle("source-endpoint"),S=k?"outside-to-node":B.value,N=r.pstyle("corner-radius").value==="auto"?"auto":r.pstyle("corner-radius").pfValue,D=t.pstyle("target-endpoint"),_=k?"outside-to-node":D.value,O=a.pstyle("corner-radius").value==="auto"?"auto":a.pstyle("corner-radius").pfValue;p.srcManEndpt=B,p.tgtManEndpt=D;var P,F,I,M;if(b){var L=[p.ctrlpts[0],p.ctrlpts[1]],V=w?[p.ctrlpts[p.ctrlpts.length-2],p.ctrlpts[p.ctrlpts.length-1]]:L;P=V,F=L}else if(C){var H=E?p.segpts.slice(0,2):[s.x,s.y],$=E?p.segpts.slice(p.segpts.length-2):[i.x,i.y];P=$,F=H}if(_==="inside-to-node")n=[s.x,s.y];else if(D.units)n=this.manualEndptToPx(a,D);else if(_==="outside-to-line")n=p.tgtIntn;else if(_==="outside-to-node"||_==="outside-to-node-or-label"?I=P:(_==="outside-to-line"||_==="outside-to-line-or-label")&&(I=[i.x,i.y]),n=e.nodeShapes[this.getNodeShape(a)].intersectLine(s.x,s.y,a.outerWidth(),a.outerHeight(),I[0],I[1],0,O,h),_==="outside-to-node-or-label"||_==="outside-to-line-or-label"){var z=a._private.rscratch,j=z.labelWidth,ee=z.labelHeight,J=z.labelX,X=z.labelY,ne=j/2,Y=ee/2,A=a.pstyle("text-valign").value;A==="top"?X-=Y:A==="bottom"&&(X+=Y);var K=a.pstyle("text-halign").value;K==="left"?J-=ne:K==="right"&&(J+=ne);var W=_i(I[0],I[1],[J-ne,X-Y,J+ne,X-Y,J+ne,X+Y,J-ne,X+Y],s.x,s.y);if(W.length>0){var oe=i,he=Ar(oe,ya(n)),re=Ar(oe,ya(W)),se=he;if(re<he&&(n=W,se=re),W.length>2){var ue=Ar(oe,{x:W[2],y:W[3]});ue<se&&(n=[W[2],W[3]])}}}var pe=jo(n,P,e.arrowShapes[l].spacing(t)+c),de=jo(n,P,e.arrowShapes[l].gap(t)+c);if(p.endX=de[0],p.endY=de[1],p.arrowEndX=pe[0],p.arrowEndY=pe[1],S==="inside-to-node")n=[i.x,i.y];else if(B.units)n=this.manualEndptToPx(r,B);else if(S==="outside-to-line")n=p.srcIntn;else if(S==="outside-to-node"||S==="outside-to-node-or-label"?M=F:(S==="outside-to-line"||S==="outside-to-line-or-label")&&(M=[s.x,s.y]),n=e.nodeShapes[this.getNodeShape(r)].intersectLine(i.x,i.y,r.outerWidth(),r.outerHeight(),M[0],M[1],0,N,f),S==="outside-to-node-or-label"||S==="outside-to-line-or-label"){var me=r._private.rscratch,Ne=me.labelWidth,De=me.labelHeight,Ee=me.labelX,_e=me.labelY,te=Ne/2,T=De/2,R=r.pstyle("text-valign").value;R==="top"?_e-=T:R==="bottom"&&(_e+=T);var Q=r.pstyle("text-halign").value;Q==="left"?Ee-=te:Q==="right"&&(Ee+=te);var G=_i(M[0],M[1],[Ee-te,_e-T,Ee+te,_e-T,Ee+te,_e+T,Ee-te,_e+T],i.x,i.y);if(G.length>0){var U=s,ie=Ar(U,ya(n)),Z=Ar(U,ya(G)),ae=ie;if(Z<ie&&(n=[G[0],G[1]],ae=Z),G.length>2){var we=Ar(U,{x:G[2],y:G[3]});we<ae&&(n=[G[2],G[3]])}}}var Ce=jo(n,F,e.arrowShapes[u].spacing(t)+d),ge=jo(n,F,e.arrowShapes[u].gap(t)+d);p.startX=ge[0],p.startY=ge[1],p.arrowStartX=Ce[0],p.arrowStartY=Ce[1],x&&(!le(p.startX)||!le(p.startY)||!le(p.endX)||!le(p.endY)?p.badLine=!0:p.badLine=!1)},qi.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}},qi.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var Pc={};function D4(t,e,n){for(var r=function(c,d,f,h){return ht(c,d,f,h)},a=e._private,i=a.rstyle.bezierPts,s=0;s<t.bezierProjPcts.length;s++){var l=t.bezierProjPcts[s];i.push({x:r(n[0],n[2],n[4],l),y:r(n[1],n[3],n[5],l)})}}Pc.storeEdgeProjections=function(t){var e=t._private,n=e.rscratch,r=n.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,r==="multibezier"||r==="bezier"||r==="self"||r==="compound"){e.rstyle.bezierPts=[];for(var a=0;a+5<n.allpts.length;a+=4)D4(this,t,n.allpts.slice(a,a+6))}else if(r==="segments")for(var i=e.rstyle.linePts=[],a=0;a+1<n.allpts.length;a+=2)i.push({x:n.allpts[a],y:n.allpts[a+1]});else if(r==="haystack"){var s=n.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth},Pc.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var Bn={};Bn.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!ar(e)){var n,r,a=t._private,i=t.width(),s=t.height(),l=t.padding(),u=t.position(),c=t.pstyle("text-halign").strValue,d=t.pstyle("text-valign").strValue,f=a.rscratch,h=a.rstyle;switch(c){case"left":n=u.x-i/2-l;break;case"right":n=u.x+i/2+l;break;default:n=u.x}switch(d){case"top":r=u.y-s/2-l;break;case"bottom":r=u.y+s/2+l;break;default:r=u.y}f.labelX=n,f.labelY=r,h.labelX=n,h.labelY=r,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var lv=function(e,n){var r=Math.atan(n/e);return e===0&&r<0&&(r=r*-1),r},cv=function(e,n){var r=n.x-e.x,a=n.y-e.y;return lv(r,a)},_4=function(e,n,r,a){var i=Ni(0,a-.001,1),s=Ni(0,a+.001,1),l=ba(e,n,r,i),u=ba(e,n,r,s);return cv(l,u)};Bn.recalculateEdgeLabelProjections=function(t){var e,n=t._private,r=n.rscratch,a=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:r.midX,y:r.midY};var s=function(f,h,v){sr(n.rscratch,f,h,v),sr(n.rstyle,f,h,v)};s("labelX",null,e.x),s("labelY",null,e.y);var l=lv(r.midDispX,r.midDispY);s("labelAutoAngle",null,l);var u=function d(){if(d.cache)return d.cache;for(var f=[],h=0;h+5<r.allpts.length;h+=4){var v={x:r.allpts[h],y:r.allpts[h+1]},p={x:r.allpts[h+2],y:r.allpts[h+3]},g={x:r.allpts[h+4],y:r.allpts[h+5]};f.push({p0:v,p1:p,p2:g,startDist:0,length:0,segments:[]})}var y=n.rstyle.bezierPts,m=a.bezierProjPcts.length;function b(k,B,S,N,D){var _=Fr(B,S),O=k.segments[k.segments.length-1],P={p0:B,p1:S,t0:N,t1:D,startDist:O?O.startDist+O.length:0,length:_};k.segments.push(P),k.length+=_}for(var w=0;w<f.length;w++){var C=f[w],E=f[w-1];E&&(C.startDist=E.startDist+E.length),b(C,C.p0,y[w*m],0,a.bezierProjPcts[0]);for(var x=0;x<m-1;x++)b(C,y[w*m+x],y[w*m+x+1],a.bezierProjPcts[x],a.bezierProjPcts[x+1]);b(C,y[w*m+m-1],C.p2,a.bezierProjPcts[m-1],1)}return d.cache=f},c=function(f){var h,v=f==="source";if(i[f]){var p=t.pstyle(f+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var g=u(),y,m=0,b=0,w=0;w<g.length;w++){for(var C=g[v?w:g.length-1-w],E=0;E<C.segments.length;E++){var x=C.segments[v?E:C.segments.length-1-E],k=w===g.length-1&&E===C.segments.length-1;if(m=b,b+=x.length,b>=p||k){y={cp:C,segment:x};break}}if(y)break}var B=y.cp,S=y.segment,N=(p-m)/S.length,D=S.t1-S.t0,_=v?S.t0+D*N:S.t1-D*N;_=Ni(0,_,1),e=ba(B.p0,B.p1,B.p2,_),h=_4(B.p0,B.p1,B.p2,_);break}case"straight":case"segments":case"haystack":{for(var O=0,P,F,I,M,L=r.allpts.length,V=0;V+3<L&&(v?(I={x:r.allpts[V],y:r.allpts[V+1]},M={x:r.allpts[V+2],y:r.allpts[V+3]}):(I={x:r.allpts[L-2-V],y:r.allpts[L-1-V]},M={x:r.allpts[L-4-V],y:r.allpts[L-3-V]}),P=Fr(I,M),F=O,O+=P,!(O>=p));V+=2);var H=p-F,$=H/P;$=Ni(0,$,1),e=MT(I,M,$),h=cv(I,M);break}}s("labelX",f,e.x),s("labelY",f,e.y),s("labelAutoAngle",f,h)}};c("source"),c("target"),this.applyLabelDimensions(t)}},Bn.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},Bn.applyPrefixedLabelDimensions=function(t,e){var n=t._private,r=this.getLabelText(t,e),a=this.calculateLabelDimensions(t,r),i=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,l=fn(n.rscratch,"labelWrapCachedLines",e)||[],u=s!=="wrap"?1:Math.max(l.length,1),c=a.height/u,d=c*i,f=a.width,h=a.height+(u-1)*(i-1)*c;sr(n.rstyle,"labelWidth",e,f),sr(n.rscratch,"labelWidth",e,f),sr(n.rstyle,"labelHeight",e,h),sr(n.rscratch,"labelHeight",e,h),sr(n.rscratch,"labelLineHeight",e,d)},Bn.getLabelText=function(t,e){var n=t._private,r=e?e+"-":"",a=t.pstyle(r+"label").strValue,i=t.pstyle("text-transform").value,s=function(j,ee){return ee?(sr(n.rscratch,j,e,ee),ee):fn(n.rscratch,j,e)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var l=t.pstyle("text-wrap").value;if(l==="wrap"){var u=s("labelKey");if(u!=null&&s("labelWrapKey")===u)return s("labelWrapCachedText");for(var c="",d=a.split(`
|
|
42
|
+
`),f=t.pstyle("text-max-width").pfValue,h=t.pstyle("text-overflow-wrap").value,v=h==="anywhere",p=[],g=/[\s\u200b]+|$/g,y=0;y<d.length;y++){var m=d[y],b=this.calculateLabelDimensions(t,m),w=b.width;if(v){var C=m.split("").join(c);m=C}if(w>f){var E=m.matchAll(g),x="",k=0,B=qf(E),S;try{for(B.s();!(S=B.n()).done;){var N=S.value,D=N[0],_=m.substring(k,N.index);k=N.index+D.length;var O=x.length===0?_:x+_+D,P=this.calculateLabelDimensions(t,O),F=P.width;F<=f?x+=_+D:(x&&p.push(x),x=_+D)}}catch(z){B.e(z)}finally{B.f()}x.match(/^[\s\u200b]+$/)||p.push(x)}else p.push(m)}s("labelWrapCachedLines",p),a=s("labelWrapCachedText",p.join(`
|
|
43
|
+
`)),s("labelWrapKey",u)}else if(l==="ellipsis"){var I=t.pstyle("text-max-width").pfValue,M="",L="…",V=!1;if(this.calculateLabelDimensions(t,a).width<I)return a;for(var H=0;H<a.length;H++){var $=this.calculateLabelDimensions(t,M+a[H]+L).width;if($>I)break;M+=a[H],H===a.length-1&&(V=!0)}return V||(M+=L),M}return a},Bn.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,n=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(n){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e},Bn.calculateLabelDimensions=function(t,e){var n=this,r=n.cy.window(),a=r.document,i=Mr(e,t._private.labelDimsKey),s=n.labelDimCache||(n.labelDimCache=[]),l=s[i];if(l!=null)return l;var u=0,c=t.pstyle("font-style").strValue,d=t.pstyle("font-size").pfValue,f=t.pstyle("font-family").strValue,h=t.pstyle("font-weight").strValue,v=this.labelCalcCanvas,p=this.labelCalcCanvasContext;if(!v){v=this.labelCalcCanvas=a.createElement("canvas"),p=this.labelCalcCanvasContext=v.getContext("2d");var g=v.style;g.position="absolute",g.left="-9999px",g.top="-9999px",g.zIndex="-1",g.visibility="hidden",g.pointerEvents="none"}p.font="".concat(c," ").concat(h," ").concat(d,"px ").concat(f);for(var y=0,m=0,b=e.split(`
|
|
44
|
+
`),w=0;w<b.length;w++){var C=b[w],E=p.measureText(C),x=Math.ceil(E.width),k=d;y=Math.max(x,y),m+=k}return y+=u,m+=u,s[i]={width:y,height:m}},Bn.calculateLabelAngle=function(t,e){var n=t._private,r=n.rscratch,a=t.isEdge(),i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),l=s.strValue;return l==="none"?0:a&&l==="autorotate"?r.labelAutoAngle:l==="autorotate"?0:s.pfValue},Bn.calculateLabelAngles=function(t){var e=this,n=t.isEdge(),r=t._private,a=r.rscratch;a.labelAngle=e.calculateLabelAngle(t),n&&(a.sourceLabelAngle=e.calculateLabelAngle(t,"source"),a.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var uv={},dv=28,fv=!1;uv.getNodeShape=function(t){var e=this,n=t.pstyle("shape").value;if(n==="cutrectangle"&&(t.width()<dv||t.height()<dv))return fv||(Ve("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),fv=!0),"rectangle";if(t.isParent())return n==="rectangle"||n==="roundrectangle"||n==="round-rectangle"||n==="cutrectangle"||n==="cut-rectangle"||n==="barrel"?n:"rectangle";if(n==="polygon"){var r=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(r).name}return n};var Ss={};Ss.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),n=this,r=function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),l)for(var u=0;u<s.length;u++){var c=s[u],d=c._private,f=d.rstyle;f.clean=!1,f.cleanConnected=!1}};n.binder(t).on("bounds.* dirty.*",function(s){var l=s.target;r(l)}).on("style.* background.*",function(s){var l=s.target;r(l,!1)});var a=function(s){if(s){var l=n.onUpdateEleCalcsFns;e.cleanStyle();for(var u=0;u<e.length;u++){var c=e[u],d=c._private.rstyle;c.isNode()&&!d.cleanConnected&&(r(c.connectedEdges()),d.cleanConnected=!0)}if(l)for(var f=0;f<l.length;f++){var h=l[f];h(s,e)}n.recalculateRenderedStyle(e),e=t.collection()}};n.flushRenderedStyleQueue=function(){a(!0)},n.beforeRender(a,n.beforeRenderPriorities.eleCalcs)},Ss.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)},Ss.recalculateRenderedStyle=function(t,e){var n=function(C){return C._private.rstyle.cleanConnected},r=[],a=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var s=t[i],l=s._private,u=l.rstyle;s.isEdge()&&(!n(s.source())||!n(s.target()))&&(u.clean=!1),!(e&&u.clean||s.removed())&&s.pstyle("display").value!=="none"&&(l.group==="nodes"?a.push(s):r.push(s),u.clean=!0)}for(var c=0;c<a.length;c++){var d=a[c],f=d._private,h=f.rstyle,v=d.position();this.recalculateNodeLabelProjection(d),h.nodeX=v.x,h.nodeY=v.y,h.nodeW=d.pstyle("width").pfValue,h.nodeH=d.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var p=0;p<r.length;p++){var g=r[p],y=g._private,m=y.rstyle,b=y.rscratch;m.srcX=b.arrowStartX,m.srcY=b.arrowStartY,m.tgtX=b.arrowEndX,m.tgtY=b.arrowEndY,m.midX=b.midX,m.midY=b.midY,m.labelAngle=b.labelAngle,m.sourceLabelAngle=b.sourceLabelAngle,m.targetLabelAngle=b.targetLabelAngle}}};var Ts={};Ts.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],n=0;n<t.length;n++){var r=t[n],a=r._private.rscratch;r.grabbed()&&!r.isParent()?e.push(r):a.inDragLayer?t.drag.push(r):t.nondrag.push(r)}for(var n=0;n<e.length;n++){var r=e[n];t.drag.push(r)}}},Ts.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},Ts.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(Np),e.interactive=e.filter(function(n){return n.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var hv={};[Kr,ks,_t,qi,Pc,Bn,uv,Ss,Ts].forEach(function(t){xe(hv,t)});var pv={};pv.getCachedImage=function(t,e,n){var r=this,a=r.imageCache=r.imageCache||{},i=a[t];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;i=a[t]=a[t]||{};var s=i.image=new Image;s.addEventListener("load",n),s.addEventListener("error",function(){s.error=!0});var l="data:",u=t.substring(0,l.length).toLowerCase()===l;return u||(e=e==="null"?null:e,s.crossOrigin=e),s.src=t,s};var Aa={};Aa.registerBinding=function(t,e,n,r){var a=Array.prototype.slice.apply(arguments,[1]),i=this.binder(t);return i.on.apply(i,a)},Aa.binder=function(t){var e=this,n=e.cy.window(),r=t===n||t===n.document||t===n.document.body||tS(t);if(e.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});n.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=a}var s=function(u,c,d){var f=Array.prototype.slice.call(arguments);return r&&e.supportsPassiveEvents&&(f[2]={capture:d??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:f}),(t.addEventListener||t.on).apply(t,f),this};return{on:s,addEventListener:s,addListener:s,bind:s}},Aa.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()},Aa.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()},Aa.load=function(){var t=this,e=t.cy.window(),n=function(T){return T.selected()},r=function(T,R,Q,G){T==null&&(T=t.cy);for(var U=0;U<R.length;U++){var ie=R[U];T.emit({originalEvent:Q,type:ie,position:G})}},a=function(T){return T.shiftKey||T.metaKey||T.ctrlKey},i=function(T,R){var Q=!0;if(t.cy.hasCompoundNodes()&&T&&T.pannable())for(var G=0;R&&G<R.length;G++){var T=R[G];if(T.isNode()&&T.isParent()&&!T.pannable()){Q=!1;break}}else Q=!0;return Q},s=function(T){T[0]._private.grabbed=!0},l=function(T){T[0]._private.grabbed=!1},u=function(T){T[0]._private.rscratch.inDragLayer=!0},c=function(T){T[0]._private.rscratch.inDragLayer=!1},d=function(T){T[0]._private.rscratch.isGrabTarget=!0},f=function(T){T[0]._private.rscratch.isGrabTarget=!1},h=function(T,R){var Q=R.addToList,G=Q.has(T);!G&&T.grabbable()&&!T.locked()&&(Q.merge(T),s(T))},v=function(T,R){if(T.cy().hasCompoundNodes()&&!(R.inDragLayer==null&&R.addToList==null)){var Q=T.descendants();R.inDragLayer&&(Q.forEach(u),Q.connectedEdges().forEach(u)),R.addToList&&h(Q,R)}},p=function(T,R){R=R||{};var Q=T.cy().hasCompoundNodes();R.inDragLayer&&(T.forEach(u),T.neighborhood().stdFilter(function(G){return!Q||G.isEdge()}).forEach(u)),R.addToList&&T.forEach(function(G){h(G,R)}),v(T,R),m(T,{inDragLayer:R.inDragLayer}),t.updateCachedGrabbedEles()},g=p,y=function(T){T&&(t.getCachedZSortedEles().forEach(function(R){l(R),c(R),f(R)}),t.updateCachedGrabbedEles())},m=function(T,R){if(!(R.inDragLayer==null&&R.addToList==null)&&T.cy().hasCompoundNodes()){var Q=T.ancestors().orphans();if(!Q.same(T)){var G=Q.descendants().spawnSelf().merge(Q).unmerge(T).unmerge(T.descendants()),U=G.connectedEdges();R.inDragLayer&&(U.forEach(u),G.forEach(u)),R.addToList&&G.forEach(function(ie){h(ie,R)})}}},b=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},w=typeof MutationObserver<"u",C=typeof ResizeObserver<"u";w?(t.removeObserver=new MutationObserver(function(te){for(var T=0;T<te.length;T++){var R=te[T],Q=R.removedNodes;if(Q)for(var G=0;G<Q.length;G++){var U=Q[G];if(U===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(te){t.destroy()});var E=Ao(function(){t.cy.resize()},100);w&&(t.styleObserver=new MutationObserver(E),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",E),C&&(t.resizeObserver=new ResizeObserver(E),t.resizeObserver.observe(t.container));var x=function(T,R){for(;T!=null;)R(T),T=T.parentNode},k=function(){t.invalidateContainerClientCoordsCache()};x(t.container,function(te){t.registerBinding(te,"transitionend",k),t.registerBinding(te,"animationend",k),t.registerBinding(te,"scroll",k)}),t.registerBinding(t.container,"contextmenu",function(te){te.preventDefault()});var B=function(){return t.selection[4]!==0},S=function(T){for(var R=t.findContainerClientCoords(),Q=R[0],G=R[1],U=R[2],ie=R[3],Z=T.touches?T.touches:[T],ae=!1,we=0;we<Z.length;we++){var Ce=Z[we];if(Q<=Ce.clientX&&Ce.clientX<=Q+U&&G<=Ce.clientY&&Ce.clientY<=G+ie){ae=!0;break}}if(!ae)return!1;for(var ge=t.container,Se=T.target,ve=Se.parentNode,ye=!1;ve;){if(ve===ge){ye=!0;break}ve=ve.parentNode}return!!ye};t.registerBinding(t.container,"mousedown",function(T){if(S(T)&&!(t.hoverData.which===1&&T.which!==1)){T.preventDefault(),b(),t.hoverData.capture=!0,t.hoverData.which=T.which;var R=t.cy,Q=[T.clientX,T.clientY],G=t.projectIntoViewport(Q[0],Q[1]),U=t.selection,ie=t.findNearestElements(G[0],G[1],!0,!1),Z=ie[0],ae=t.dragData.possibleDragElements;t.hoverData.mdownPos=G,t.hoverData.mdownGPos=Q;var we=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var Ge=t.hoverData.down;Ge?Ge.emit({originalEvent:T,type:"taphold",position:{x:G[0],y:G[1]}}):R.emit({originalEvent:T,type:"taphold",position:{x:G[0],y:G[1]}})}},t.tapholdDuration)};if(T.which==3){t.hoverData.cxtStarted=!0;var Ce={originalEvent:T,type:"cxttapstart",position:{x:G[0],y:G[1]}};Z?(Z.activate(),Z.emit(Ce),t.hoverData.down=Z):R.emit(Ce),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(T.which==1){Z&&Z.activate();{if(Z!=null&&t.nodeIsGrabbable(Z)){var ge=function(Ge){return{originalEvent:T,type:Ge,position:{x:G[0],y:G[1]}}},Se=function(Ge){Ge.emit(ge("grab"))};if(d(Z),!Z.selected())ae=t.dragData.possibleDragElements=R.collection(),g(Z,{addToList:ae}),Z.emit(ge("grabon")).emit(ge("grab"));else{ae=t.dragData.possibleDragElements=R.collection();var ve=R.$(function(ye){return ye.isNode()&&ye.selected()&&t.nodeIsGrabbable(ye)});p(ve,{addToList:ae}),Z.emit(ge("grabon")),ve.forEach(Se)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=Z,t.hoverData.downs=ie,t.hoverData.downTime=new Date().getTime()}r(Z,["mousedown","tapstart","vmousedown"],T,{x:G[0],y:G[1]}),Z==null?(U[4]=1,t.data.bgActivePosistion={x:G[0],y:G[1]},t.redrawHint("select",!0),t.redraw()):Z.pannable()&&(U[4]=1),we()}U[0]=U[2]=G[0],U[1]=U[3]=G[1]}},!1),t.registerBinding(e,"mousemove",function(T){var R=t.hoverData.capture;if(!(!R&&!S(T))){var Q=!1,G=t.cy,U=G.zoom(),ie=[T.clientX,T.clientY],Z=t.projectIntoViewport(ie[0],ie[1]),ae=t.hoverData.mdownPos,we=t.hoverData.mdownGPos,Ce=t.selection,ge=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(ge=t.findNearestElement(Z[0],Z[1],!0,!1));var Se=t.hoverData.last,ve=t.hoverData.down,ye=[Z[0]-Ce[2],Z[1]-Ce[3]],Ge=t.dragData.possibleDragElements,$e;if(we){var nt=ie[0]-we[0],rt=nt*nt,Qe=ie[1]-we[1],Pt=Qe*Qe,dt=rt+Pt;t.hoverData.isOverThresholdDrag=$e=dt>=t.desktopTapThreshold2}var pt=a(T);$e&&(t.hoverData.tapholdCancelled=!0);var jt=function(){var q=t.hoverData.dragDelta=t.hoverData.dragDelta||[];q.length===0?(q.push(ye[0]),q.push(ye[1])):(q[0]+=ye[0],q[1]+=ye[1])};Q=!0,r(ge,["mousemove","vmousemove","tapdrag"],T,{x:Z[0],y:Z[1]});var It=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||G.emit({originalEvent:T,type:"boxstart",position:{x:Z[0],y:Z[1]}}),Ce[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if($e){var Ot={originalEvent:T,type:"cxtdrag",position:{x:Z[0],y:Z[1]}};ve?ve.emit(Ot):G.emit(Ot),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||ge!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:T,type:"cxtdragout",position:{x:Z[0],y:Z[1]}}),t.hoverData.cxtOver=ge,ge&&ge.emit({originalEvent:T,type:"cxtdragover",position:{x:Z[0],y:Z[1]}}))}}else if(t.hoverData.dragging){if(Q=!0,G.panningEnabled()&&G.userPanningEnabled()){var rn;if(t.hoverData.justStartedPan){var vn=t.hoverData.mdownPos;rn={x:(Z[0]-vn[0])*U,y:(Z[1]-vn[1])*U},t.hoverData.justStartedPan=!1}else rn={x:ye[0]*U,y:ye[1]*U};G.panBy(rn),G.emit("dragpan"),t.hoverData.dragged=!0}Z=t.projectIntoViewport(T.clientX,T.clientY)}else if(Ce[4]==1&&(ve==null||ve.pannable())){if($e){if(!t.hoverData.dragging&&G.boxSelectionEnabled()&&(pt||!G.panningEnabled()||!G.userPanningEnabled()))It();else if(!t.hoverData.selecting&&G.panningEnabled()&&G.userPanningEnabled()){var Kt=i(ve,t.hoverData.downs);Kt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Ce[4]=0,t.data.bgActivePosistion=ya(ae),t.redrawHint("select",!0),t.redraw())}ve&&ve.pannable()&&ve.active()&&ve.unactivate()}}else{if(ve&&ve.pannable()&&ve.active()&&ve.unactivate(),(!ve||!ve.grabbed())&&ge!=Se&&(Se&&r(Se,["mouseout","tapdragout"],T,{x:Z[0],y:Z[1]}),ge&&r(ge,["mouseover","tapdragover"],T,{x:Z[0],y:Z[1]}),t.hoverData.last=ge),ve)if($e){if(G.boxSelectionEnabled()&&pt)ve&&ve.grabbed()&&(y(Ge),ve.emit("freeon"),Ge.emit("free"),t.dragData.didDrag&&(ve.emit("dragfreeon"),Ge.emit("dragfree"))),It();else if(ve&&ve.grabbed()&&t.nodeIsDraggable(ve)){var Je=!t.dragData.didDrag;Je&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(Ge,{inDragLayer:!0});var at={x:0,y:0};if(le(ye[0])&&le(ye[1])&&(at.x+=ye[0],at.y+=ye[1],Je)){var vt=t.hoverData.dragDelta;vt&&le(vt[0])&&le(vt[1])&&(at.x+=vt[0],at.y+=vt[1])}t.hoverData.draggingEles=!0,Ge.silentShift(at).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else jt();Q=!0}if(Ce[2]=Z[0],Ce[3]=Z[1],Q)return T.stopPropagation&&T.stopPropagation(),T.preventDefault&&T.preventDefault(),!1}},!1);var N,D,_;t.registerBinding(e,"mouseup",function(T){if(!(t.hoverData.which===1&&T.which!==1&&t.hoverData.capture)){var R=t.hoverData.capture;if(R){t.hoverData.capture=!1;var Q=t.cy,G=t.projectIntoViewport(T.clientX,T.clientY),U=t.selection,ie=t.findNearestElement(G[0],G[1],!0,!1),Z=t.dragData.possibleDragElements,ae=t.hoverData.down,we=a(T);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,ae&&ae.unactivate(),t.hoverData.which===3){var Ce={originalEvent:T,type:"cxttapend",position:{x:G[0],y:G[1]}};if(ae?ae.emit(Ce):Q.emit(Ce),!t.hoverData.cxtDragged){var ge={originalEvent:T,type:"cxttap",position:{x:G[0],y:G[1]}};ae?ae.emit(ge):Q.emit(ge)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(r(ie,["mouseup","tapend","vmouseup"],T,{x:G[0],y:G[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(r(ae,["click","tap","vclick"],T,{x:G[0],y:G[1]}),D=!1,T.timeStamp-_<=Q.multiClickDebounceTime()?(N&&clearTimeout(N),D=!0,_=null,r(ae,["dblclick","dbltap","vdblclick"],T,{x:G[0],y:G[1]})):(N=setTimeout(function(){D||r(ae,["oneclick","onetap","voneclick"],T,{x:G[0],y:G[1]})},Q.multiClickDebounceTime()),_=T.timeStamp)),ae==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(T)&&(Q.$(n).unselect(["tapunselect"]),Z.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=Z=Q.collection()),ie==ae&&!t.dragData.didDrag&&!t.hoverData.selecting&&ie!=null&&ie._private.selectable&&(t.hoverData.dragging||(Q.selectionType()==="additive"||we?ie.selected()?ie.unselect(["tapunselect"]):ie.select(["tapselect"]):we||(Q.$(n).unmerge(ie).unselect(["tapunselect"]),ie.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Se=Q.collection(t.getAllInBox(U[0],U[1],U[2],U[3]));t.redrawHint("select",!0),Se.length>0&&t.redrawHint("eles",!0),Q.emit({type:"boxend",originalEvent:T,position:{x:G[0],y:G[1]}});var ve=function($e){return $e.selectable()&&!$e.selected()};Q.selectionType()==="additive"||we||Q.$(n).unmerge(Se).unselect(),Se.emit("box").stdFilter(ve).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!U[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var ye=ae&&ae.grabbed();y(Z),ye&&(ae.emit("freeon"),Z.emit("free"),t.dragData.didDrag&&(ae.emit("dragfreeon"),Z.emit("dragfree")))}}U[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var O=function(T){if(!t.scrollingPage){var R=t.cy,Q=R.zoom(),G=R.pan(),U=t.projectIntoViewport(T.clientX,T.clientY),ie=[U[0]*Q+G.x,U[1]*Q+G.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||B()){T.preventDefault();return}if(R.panningEnabled()&&R.userPanningEnabled()&&R.zoomingEnabled()&&R.userZoomingEnabled()){T.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var Z;T.deltaY!=null?Z=T.deltaY/-250:T.wheelDeltaY!=null?Z=T.wheelDeltaY/1e3:Z=T.wheelDelta/1e3,Z=Z*t.wheelSensitivity;var ae=T.deltaMode===1;ae&&(Z*=33);var we=R.zoom()*Math.pow(10,Z);T.type==="gesturechange"&&(we=t.gestureStartZoom*T.scale),R.zoom({level:we,renderedPosition:{x:ie[0],y:ie[1]}}),R.emit(T.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",O,!0),t.registerBinding(e,"scroll",function(T){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(T){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||T.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(te){t.hasTouchStarted||O(te)},!0),t.registerBinding(t.container,"mouseout",function(T){var R=t.projectIntoViewport(T.clientX,T.clientY);t.cy.emit({originalEvent:T,type:"mouseout",position:{x:R[0],y:R[1]}})},!1),t.registerBinding(t.container,"mouseover",function(T){var R=t.projectIntoViewport(T.clientX,T.clientY);t.cy.emit({originalEvent:T,type:"mouseover",position:{x:R[0],y:R[1]}})},!1);var P,F,I,M,L,V,H,$,z,j,ee,J,X,ne=function(T,R,Q,G){return Math.sqrt((Q-T)*(Q-T)+(G-R)*(G-R))},Y=function(T,R,Q,G){return(Q-T)*(Q-T)+(G-R)*(G-R)},A;t.registerBinding(t.container,"touchstart",A=function(T){if(t.hasTouchStarted=!0,!!S(T)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var R=t.cy,Q=t.touchData.now,G=t.touchData.earlier;if(T.touches[0]){var U=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);Q[0]=U[0],Q[1]=U[1]}if(T.touches[1]){var U=t.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);Q[2]=U[0],Q[3]=U[1]}if(T.touches[2]){var U=t.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);Q[4]=U[0],Q[5]=U[1]}if(T.touches[1]){t.touchData.singleTouchMoved=!0,y(t.dragData.touchDragEles);var ie=t.findContainerClientCoords();z=ie[0],j=ie[1],ee=ie[2],J=ie[3],P=T.touches[0].clientX-z,F=T.touches[0].clientY-j,I=T.touches[1].clientX-z,M=T.touches[1].clientY-j,X=0<=P&&P<=ee&&0<=I&&I<=ee&&0<=F&&F<=J&&0<=M&&M<=J;var Z=R.pan(),ae=R.zoom();L=ne(P,F,I,M),V=Y(P,F,I,M),H=[(P+I)/2,(F+M)/2],$=[(H[0]-Z.x)/ae,(H[1]-Z.y)/ae];var we=200,Ce=we*we;if(V<Ce&&!T.touches[2]){var ge=t.findNearestElement(Q[0],Q[1],!0,!0),Se=t.findNearestElement(Q[2],Q[3],!0,!0);ge&&ge.isNode()?(ge.activate().emit({originalEvent:T,type:"cxttapstart",position:{x:Q[0],y:Q[1]}}),t.touchData.start=ge):Se&&Se.isNode()?(Se.activate().emit({originalEvent:T,type:"cxttapstart",position:{x:Q[0],y:Q[1]}}),t.touchData.start=Se):R.emit({originalEvent:T,type:"cxttapstart",position:{x:Q[0],y:Q[1]}}),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(T.touches[2])R.boxSelectionEnabled()&&T.preventDefault();else if(!T.touches[1]){if(T.touches[0]){var ve=t.findNearestElements(Q[0],Q[1],!0,!0),ye=ve[0];if(ye!=null&&(ye.activate(),t.touchData.start=ye,t.touchData.starts=ve,t.nodeIsGrabbable(ye))){var Ge=t.dragData.touchDragEles=R.collection(),$e=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),ye.selected()?($e=R.$(function(dt){return dt.selected()&&t.nodeIsGrabbable(dt)}),p($e,{addToList:Ge})):g(ye,{addToList:Ge}),d(ye);var nt=function(pt){return{originalEvent:T,type:pt,position:{x:Q[0],y:Q[1]}}};ye.emit(nt("grabon")),$e?$e.forEach(function(dt){dt.emit(nt("grab"))}):ye.emit(nt("grab"))}r(ye,["touchstart","tapstart","vmousedown"],T,{x:Q[0],y:Q[1]}),ye==null&&(t.data.bgActivePosistion={x:U[0],y:U[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&r(t.touchData.start,["taphold"],T,{x:Q[0],y:Q[1]})},t.tapholdDuration)}}if(T.touches.length>=1){for(var rt=t.touchData.startPosition=[null,null,null,null,null,null],Qe=0;Qe<Q.length;Qe++)rt[Qe]=G[Qe]=Q[Qe];var Pt=T.touches[0];t.touchData.startGPosition=[Pt.clientX,Pt.clientY]}}},!1);var K;t.registerBinding(e,"touchmove",K=function(T){var R=t.touchData.capture;if(!(!R&&!S(T))){var Q=t.selection,G=t.cy,U=t.touchData.now,ie=t.touchData.earlier,Z=G.zoom();if(T.touches[0]){var ae=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);U[0]=ae[0],U[1]=ae[1]}if(T.touches[1]){var ae=t.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);U[2]=ae[0],U[3]=ae[1]}if(T.touches[2]){var ae=t.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);U[4]=ae[0],U[5]=ae[1]}var we=t.touchData.startGPosition,Ce;if(R&&T.touches[0]&&we){for(var ge=[],Se=0;Se<U.length;Se++)ge[Se]=U[Se]-ie[Se];var ve=T.touches[0].clientX-we[0],ye=ve*ve,Ge=T.touches[0].clientY-we[1],$e=Ge*Ge,nt=ye+$e;Ce=nt>=t.touchTapThreshold2}if(R&&t.touchData.cxt){T.preventDefault();var rt=T.touches[0].clientX-z,Qe=T.touches[0].clientY-j,Pt=T.touches[1].clientX-z,dt=T.touches[1].clientY-j,pt=Y(rt,Qe,Pt,dt),jt=pt/V,It=150,Ot=It*It,rn=1.5,vn=rn*rn;if(jt>=vn||pt>=Ot){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Kt={originalEvent:T,type:"cxttapend",position:{x:U[0],y:U[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(Kt),t.touchData.start=null):G.emit(Kt)}}if(R&&t.touchData.cxt){var Kt={originalEvent:T,type:"cxtdrag",position:{x:U[0],y:U[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Kt):G.emit(Kt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Je=t.findNearestElement(U[0],U[1],!0,!0);(!t.touchData.cxtOver||Je!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:T,type:"cxtdragout",position:{x:U[0],y:U[1]}}),t.touchData.cxtOver=Je,Je&&Je.emit({originalEvent:T,type:"cxtdragover",position:{x:U[0],y:U[1]}}))}else if(R&&T.touches[2]&&G.boxSelectionEnabled())T.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||G.emit({originalEvent:T,type:"boxstart",position:{x:U[0],y:U[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,Q[4]=1,!Q||Q.length===0||Q[0]===void 0?(Q[0]=(U[0]+U[2]+U[4])/3,Q[1]=(U[1]+U[3]+U[5])/3,Q[2]=(U[0]+U[2]+U[4])/3+1,Q[3]=(U[1]+U[3]+U[5])/3+1):(Q[2]=(U[0]+U[2]+U[4])/3,Q[3]=(U[1]+U[3]+U[5])/3),t.redrawHint("select",!0),t.redraw();else if(R&&T.touches[1]&&!t.touchData.didSelect&&G.zoomingEnabled()&&G.panningEnabled()&&G.userZoomingEnabled()&&G.userPanningEnabled()){T.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var at=t.dragData.touchDragEles;if(at){t.redrawHint("drag",!0);for(var vt=0;vt<at.length;vt++){var mr=at[vt]._private;mr.grabbed=!1,mr.rscratch.inDragLayer=!1}}var q=t.touchData.start,rt=T.touches[0].clientX-z,Qe=T.touches[0].clientY-j,Pt=T.touches[1].clientX-z,dt=T.touches[1].clientY-j,ce=ne(rt,Qe,Pt,dt),Pe=ce/L;if(X){var He=rt-P,Dn=Qe-F,yr=Pt-I,Ha=dt-M,Un=(He+yr)/2,an=(Dn+Ha)/2,br=G.zoom(),jc=br*Pe,_s=G.pan(),Bg=$[0]*br+_s.x,Ng=$[1]*br+_s.y,nI={x:-jc/br*(Bg-_s.x-Un)+Bg,y:-jc/br*(Ng-_s.y-an)+Ng};if(q&&q.active()){var at=t.dragData.touchDragEles;y(at),t.redrawHint("drag",!0),t.redrawHint("eles",!0),q.unactivate().emit("freeon"),at.emit("free"),t.dragData.didDrag&&(q.emit("dragfreeon"),at.emit("dragfree"))}G.viewport({zoom:jc,pan:nI,cancelOnFailedZoom:!0}),G.emit("pinchzoom"),L=ce,P=rt,F=Qe,I=Pt,M=dt,t.pinching=!0}if(T.touches[0]){var ae=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);U[0]=ae[0],U[1]=ae[1]}if(T.touches[1]){var ae=t.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);U[2]=ae[0],U[3]=ae[1]}if(T.touches[2]){var ae=t.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);U[4]=ae[0],U[5]=ae[1]}}else if(T.touches[0]&&!t.touchData.didSelect){var gn=t.touchData.start,Yc=t.touchData.last,Je;if(!t.hoverData.draggingEles&&!t.swipePanning&&(Je=t.findNearestElement(U[0],U[1],!0,!0)),R&&gn!=null&&T.preventDefault(),R&&gn!=null&&t.nodeIsDraggable(gn))if(Ce){var at=t.dragData.touchDragEles,Dg=!t.dragData.didDrag;Dg&&p(at,{inDragLayer:!0}),t.dragData.didDrag=!0;var Zi={x:0,y:0};if(le(ge[0])&&le(ge[1])&&(Zi.x+=ge[0],Zi.y+=ge[1],Dg)){t.redrawHint("eles",!0);var mn=t.touchData.dragDelta;mn&&le(mn[0])&&le(mn[1])&&(Zi.x+=mn[0],Zi.y+=mn[1])}t.hoverData.draggingEles=!0,at.silentShift(Zi).emit("position drag"),t.redrawHint("drag",!0),t.touchData.startPosition[0]==ie[0]&&t.touchData.startPosition[1]==ie[1]&&t.redrawHint("eles",!0),t.redraw()}else{var mn=t.touchData.dragDelta=t.touchData.dragDelta||[];mn.length===0?(mn.push(ge[0]),mn.push(ge[1])):(mn[0]+=ge[0],mn[1]+=ge[1])}if(r(gn||Je,["touchmove","tapdrag","vmousemove"],T,{x:U[0],y:U[1]}),(!gn||!gn.grabbed())&&Je!=Yc&&(Yc&&Yc.emit({originalEvent:T,type:"tapdragout",position:{x:U[0],y:U[1]}}),Je&&Je.emit({originalEvent:T,type:"tapdragover",position:{x:U[0],y:U[1]}})),t.touchData.last=Je,R)for(var vt=0;vt<U.length;vt++)U[vt]&&t.touchData.startPosition[vt]&&Ce&&(t.touchData.singleTouchMoved=!0);if(R&&(gn==null||gn.pannable())&&G.panningEnabled()&&G.userPanningEnabled()){var rI=i(gn,t.touchData.starts);rI&&(T.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=ya(t.touchData.startPosition)),t.swipePanning?(G.panBy({x:ge[0]*Z,y:ge[1]*Z}),G.emit("dragpan")):Ce&&(t.swipePanning=!0,G.panBy({x:ve*Z,y:Ge*Z}),G.emit("dragpan"),gn&&(gn.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var ae=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);U[0]=ae[0],U[1]=ae[1]}}for(var Se=0;Se<U.length;Se++)ie[Se]=U[Se];R&&T.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var W;t.registerBinding(e,"touchcancel",W=function(T){var R=t.touchData.start;t.touchData.capture=!1,R&&R.unactivate()});var oe,he,re,se;if(t.registerBinding(e,"touchend",oe=function(T){var R=t.touchData.start,Q=t.touchData.capture;if(Q)T.touches.length===0&&(t.touchData.capture=!1),T.preventDefault();else return;var G=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var U=t.cy,ie=U.zoom(),Z=t.touchData.now,ae=t.touchData.earlier;if(T.touches[0]){var we=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);Z[0]=we[0],Z[1]=we[1]}if(T.touches[1]){var we=t.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);Z[2]=we[0],Z[3]=we[1]}if(T.touches[2]){var we=t.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);Z[4]=we[0],Z[5]=we[1]}R&&R.unactivate();var Ce;if(t.touchData.cxt){if(Ce={originalEvent:T,type:"cxttapend",position:{x:Z[0],y:Z[1]}},R?R.emit(Ce):U.emit(Ce),!t.touchData.cxtDragged){var ge={originalEvent:T,type:"cxttap",position:{x:Z[0],y:Z[1]}};R?R.emit(ge):U.emit(ge)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!T.touches[2]&&U.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Se=U.collection(t.getAllInBox(G[0],G[1],G[2],G[3]));G[0]=void 0,G[1]=void 0,G[2]=void 0,G[3]=void 0,G[4]=0,t.redrawHint("select",!0),U.emit({type:"boxend",originalEvent:T,position:{x:Z[0],y:Z[1]}});var ve=function(Ot){return Ot.selectable()&&!Ot.selected()};Se.emit("box").stdFilter(ve).select().emit("boxselect"),Se.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(R!=null&&R.unactivate(),T.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!T.touches[1]){if(!T.touches[0]){if(!T.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var ye=t.dragData.touchDragEles;if(R!=null){var Ge=R._private.grabbed;y(ye),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Ge&&(R.emit("freeon"),ye.emit("free"),t.dragData.didDrag&&(R.emit("dragfreeon"),ye.emit("dragfree"))),r(R,["touchend","tapend","vmouseup","tapdragout"],T,{x:Z[0],y:Z[1]}),R.unactivate(),t.touchData.start=null}else{var $e=t.findNearestElement(Z[0],Z[1],!0,!0);r($e,["touchend","tapend","vmouseup","tapdragout"],T,{x:Z[0],y:Z[1]})}var nt=t.touchData.startPosition[0]-Z[0],rt=nt*nt,Qe=t.touchData.startPosition[1]-Z[1],Pt=Qe*Qe,dt=rt+Pt,pt=dt*ie*ie;t.touchData.singleTouchMoved||(R||U.$(":selected").unselect(["tapunselect"]),r(R,["tap","vclick"],T,{x:Z[0],y:Z[1]}),he=!1,T.timeStamp-se<=U.multiClickDebounceTime()?(re&&clearTimeout(re),he=!0,se=null,r(R,["dbltap","vdblclick"],T,{x:Z[0],y:Z[1]})):(re=setTimeout(function(){he||r(R,["onetap","voneclick"],T,{x:Z[0],y:Z[1]})},U.multiClickDebounceTime()),se=T.timeStamp)),R!=null&&!t.dragData.didDrag&&R._private.selectable&&pt<t.touchTapThreshold2&&!t.pinching&&(U.selectionType()==="single"?(U.$(n).unmerge(R).unselect(["tapunselect"]),R.select(["tapselect"])):R.selected()?R.unselect(["tapunselect"]):R.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var jt=0;jt<Z.length;jt++)ae[jt]=Z[jt];t.dragData.didDrag=!1,T.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),T.touches.length<2&&(T.touches.length===1&&(t.touchData.startGPosition=[T.touches[0].clientX,T.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var ue=[],pe=function(T){return{clientX:T.clientX,clientY:T.clientY,force:1,identifier:T.pointerId,pageX:T.pageX,pageY:T.pageY,radiusX:T.width/2,radiusY:T.height/2,screenX:T.screenX,screenY:T.screenY,target:T.target}},de=function(T){return{event:T,touch:pe(T)}},me=function(T){ue.push(de(T))},Ne=function(T){for(var R=0;R<ue.length;R++){var Q=ue[R];if(Q.event.pointerId===T.pointerId){ue.splice(R,1);return}}},De=function(T){var R=ue.filter(function(Q){return Q.event.pointerId===T.pointerId})[0];R.event=T,R.touch=pe(T)},Ee=function(T){T.touches=ue.map(function(R){return R.touch})},_e=function(T){return T.pointerType==="mouse"||T.pointerType===4};t.registerBinding(t.container,"pointerdown",function(te){_e(te)||(te.preventDefault(),me(te),Ee(te),A(te))}),t.registerBinding(t.container,"pointerup",function(te){_e(te)||(Ne(te),Ee(te),oe(te))}),t.registerBinding(t.container,"pointercancel",function(te){_e(te)||(Ne(te),Ee(te),W(te))}),t.registerBinding(t.container,"pointermove",function(te){_e(te)||(te.preventDefault(),De(te),Ee(te),K(te))})}};var Kn={};Kn.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(r,a,i,s,l,u){this.renderer.nodeShapeImpl("polygon",r,a,i,s,l,this.points)},intersectLine:function(r,a,i,s,l,u,c,d){return _i(l,u,this.points,r,a,i/2,s/2,c)},checkPoint:function(r,a,i,s,l,u,c,d){return $n(r,a,this.points,u,c,s,l,[0,-1],i)}}},Kn.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i)},intersectLine:function(e,n,r,a,i,s,l,u){return jT(i,s,e,n,r/2+l,a/2+l)},checkPoint:function(e,n,r,a,i,s,l,u){return Vr(e,n,a,i,s,l,r)}}},Kn.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(r,a,i,s,l,u,c){if(u[c]!==void 0&&u[c+"-cx"]===r&&u[c+"-cy"]===a)return u[c];u[c]=new Array(e.length/2),u[c+"-cx"]=r,u[c+"-cy"]=a;var d=i/2,f=s/2;l=l==="auto"?xh(i,s):l;for(var h=new Array(e.length/2),v=0;v<e.length/2;v++)h[v]={x:r+d*e[v*2],y:a+f*e[v*2+1]};var p,g,y,m,b=h.length;for(g=h[b-1],p=0;p<b;p++)y=h[p%b],m=h[(p+1)%b],u[c][p]=_c(g,y,m,l),g=y,y=m;return u[c]},draw:function(r,a,i,s,l,u,c){this.renderer.nodeShapeImpl("round-polygon",r,a,i,s,l,this.points,this.getOrCreateCorners(a,i,s,l,u,c,"drawCorners"))},intersectLine:function(r,a,i,s,l,u,c,d,f){return YT(l,u,this.points,r,a,i,s,c,this.getOrCreateCorners(r,a,i,s,d,f,"corners"))},checkPoint:function(r,a,i,s,l,u,c,d,f){return WT(r,a,this.points,u,c,s,l,this.getOrCreateCorners(u,c,s,l,d,f,"corners"))}}},Kn.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Mt(4,0),draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i,this.points,s)},intersectLine:function(e,n,r,a,i,s,l,u){return Ch(i,s,e,n,r,a,l,u)},checkPoint:function(e,n,r,a,i,s,l,u){var c=a/2,d=i/2;u=u==="auto"?Rr(a,i):u,u=Math.min(c,d,u);var f=u*2;return!!($n(e,n,this.points,s,l,a,i-f,[0,-1],r)||$n(e,n,this.points,s,l,a-f,i,[0,-1],r)||Vr(e,n,f,f,s-c+u,l-d+u,r)||Vr(e,n,f,f,s+c-u,l-d+u,r)||Vr(e,n,f,f,s+c-u,l+d-u,r)||Vr(e,n,f,f,s-c+u,l+d-u,r))}}},Kn.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:tc(),points:Mt(4,0),draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i,null,s)},generateCutTrianglePts:function(e,n,r,a,i){var s=i==="auto"?this.cornerLength:i,l=n/2,u=e/2,c=r-u,d=r+u,f=a-l,h=a+l;return{topLeft:[c,f+s,c+s,f,c+s,f+s],topRight:[d-s,f,d,f+s,d-s,f+s],bottomRight:[d,h-s,d-s,h,d-s,h-s],bottomLeft:[c+s,h,c,h-s,c+s,h-s]}},intersectLine:function(e,n,r,a,i,s,l,u){var c=this.generateCutTrianglePts(r+2*l,a+2*l,e,n,u),d=[].concat.apply([],[c.topLeft.splice(0,4),c.topRight.splice(0,4),c.bottomRight.splice(0,4),c.bottomLeft.splice(0,4)]);return _i(i,s,d,e,n)},checkPoint:function(e,n,r,a,i,s,l,u){var c=u==="auto"?this.cornerLength:u;if($n(e,n,this.points,s,l,a,i-2*c,[0,-1],r)||$n(e,n,this.points,s,l,a-2*c,i,[0,-1],r))return!0;var d=this.generateCutTrianglePts(a,i,s,l);return Ht(e,n,d.topLeft)||Ht(e,n,d.topRight)||Ht(e,n,d.bottomRight)||Ht(e,n,d.bottomLeft)}}},Kn.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Mt(4,0),draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i)},intersectLine:function(e,n,r,a,i,s,l,u){var c=.15,d=.5,f=.85,h=this.generateBarrelBezierPts(r+2*l,a+2*l,e,n),v=function(y){var m=ba({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},c),b=ba({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},d),w=ba({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},f);return[y[0],y[1],m.x,m.y,b.x,b.y,w.x,w.y,y[4],y[5]]},p=[].concat(v(h.topLeft),v(h.topRight),v(h.bottomRight),v(h.bottomLeft));return _i(i,s,p,e,n)},generateBarrelBezierPts:function(e,n,r,a){var i=n/2,s=e/2,l=r-s,u=r+s,c=a-i,d=a+i,f=nc(e,n),h=f.heightOffset,v=f.widthOffset,p=f.ctrlPtOffsetPct*e,g={topLeft:[l,c+h,l+p,c,l+v,c],topRight:[u-v,c,u-p,c,u,c+h],bottomRight:[u,d-h,u-p,d,u-v,d],bottomLeft:[l+v,d,l+p,d,l,d-h]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g},checkPoint:function(e,n,r,a,i,s,l,u){var c=nc(a,i),d=c.heightOffset,f=c.widthOffset;if($n(e,n,this.points,s,l,a,i-2*d,[0,-1],r)||$n(e,n,this.points,s,l,a-2*f,i,[0,-1],r))return!0;for(var h=this.generateBarrelBezierPts(a,i,s,l),v=function(B,S,N){var D=N[4],_=N[2],O=N[0],P=N[5],F=N[1],I=Math.min(D,O),M=Math.max(D,O),L=Math.min(P,F),V=Math.max(P,F);if(I<=B&&B<=M&&L<=S&&S<=V){var H=ZT(D,_,O),$=KT(H[0],H[1],H[2],B),z=$.filter(function(j){return 0<=j&&j<=1});if(z.length>0)return z[0]}return null},p=Object.keys(h),g=0;g<p.length;g++){var y=p[g],m=h[y],b=v(e,n,m);if(b!=null){var w=m[5],C=m[3],E=m[1],x=ht(w,C,E,b);if(m.isTop&&x<=n||m.isBottom&&n<=x)return!0}}return!1}}},Kn.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Mt(4,0),draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i,this.points,s)},intersectLine:function(e,n,r,a,i,s,l,u){var c=e-(r/2+l),d=n-(a/2+l),f=d,h=e+(r/2+l),v=lr(i,s,e,n,c,d,h,f,!1);return v.length>0?v:Ch(i,s,e,n,r,a,l,u)},checkPoint:function(e,n,r,a,i,s,l,u){u=u==="auto"?Rr(a,i):u;var c=2*u;if($n(e,n,this.points,s,l,a,i-c,[0,-1],r)||$n(e,n,this.points,s,l,a-c,i,[0,-1],r))return!0;var d=a/2+2*r,f=i/2+2*r,h=[s-d,l-f,s-d,l,s+d,l,s+d,l-f];return!!(Ht(e,n,h)||Vr(e,n,c,c,s+a/2-u,l+i/2-u,r)||Vr(e,n,c,c,s-a/2+u,l+i/2-u,r))}}},Kn.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Mt(3,0)),this.generateRoundPolygon("round-triangle",Mt(3,0)),this.generatePolygon("rectangle",Mt(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n)}this.generatePolygon("pentagon",Mt(5,0)),this.generateRoundPolygon("round-pentagon",Mt(5,0)),this.generatePolygon("hexagon",Mt(6,0)),this.generateRoundPolygon("round-hexagon",Mt(6,0)),this.generatePolygon("heptagon",Mt(7,0)),this.generateRoundPolygon("round-heptagon",Mt(7,0)),this.generatePolygon("octagon",Mt(8,0)),this.generateRoundPolygon("round-octagon",Mt(8,0));var r=new Array(20);{var a=ec(5,0),i=ec(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var l=0;l<i.length/2;l++)i[l*2]*=s,i[l*2+1]*=s;for(var l=0;l<20/4;l++)r[l*4]=a[l*2],r[l*4+1]=a[l*2+1],r[l*4+2]=i[l*2],r[l*4+3]=i[l*2+1]}r=kh(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u)}t.makePolygon=function(c){var d=c.join("$"),f="polygon-"+d,h;return(h=this[f])?h:e.generatePolygon(f,c)}};var Ui={};Ui.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},Ui.redraw=function(t){t=t||ph();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t},Ui.beforeRender=function(t,e){if(!this.destroyed){e==null&&Ze("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:t,priority:e}),n.sort(function(r,a){return a.priority-r.priority})}};var vv=function(e,n,r){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(n,r)};Ui.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var n=function r(a){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){vv(t,!0,a);var i=Rn();t.render(t.renderOptions);var s=t.lastDrawTime=Rn();t.averageRedrawTime===void 0&&(t.averageRedrawTime=s-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var l=s-i;t.redrawTotalTime+=l,t.lastRedrawTime=l,t.averageRedrawTime=t.averageRedrawTime/2+l/2,t.requestedFrame=!1}else vv(t,!1,a);t.skipFrame=!1,Vo(r)}};Vo(n)}};var P4=function(e){this.init(e)},gv=P4,Va=gv.prototype;Va.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],Va.init=function(t){var e=this;e.options=t,e.cy=t.cy;var n=e.container=t.cy.container(),r=e.cy.window();if(r){var a=r.document,i=a.head,s="__________cytoscape_stylesheet",l="__________cytoscape_container",u=a.getElementById(s)!=null;if(n.className.indexOf(l)<0&&(n.className=(n.className||"")+" "+l),!u){var c=a.createElement("style");c.id=s,c.textContent="."+l+" { position: relative; }",i.insertBefore(c,i.children[0])}var d=r.getComputedStyle(n),f=d.getPropertyValue("position");f==="static"&&Ve("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=le(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()},Va.notify=function(t,e){var n=this,r=n.cy;if(!this.destroyed){if(t==="init"){n.load();return}if(t==="destroy"){n.destroy();return}(t==="add"||t==="remove"||t==="move"&&r.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&n.invalidateCachedZSortedEles(),t==="viewport"&&n.redrawHint("select",!0),(t==="load"||t==="resize"||t==="mount")&&(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},Va.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var n=t.bindings[e],r=n,a=r.target;(a.off||a.removeEventListener).apply(a,r.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}},Va.isHeadless=function(){return!1},[Sc,hv,pv,Aa,Kn,Ui].forEach(function(t){xe(Va,t)});var Ic=1e3/60,mv={setupDequeueing:function(e){return function(){var r=this,a=this.renderer;if(!r.dequeueingSetup){r.dequeueingSetup=!0;var i=Ao(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),s=function(c,d){var f=Rn(),h=a.averageRedrawTime,v=a.lastRedrawTime,p=[],g=a.cy.extent(),y=a.getPixelRatio();for(c||a.flushRenderedStyleQueue();;){var m=Rn(),b=m-f,w=m-d;if(v<Ic){var C=Ic-(c?h:0);if(w>=e.deqFastCost*C)break}else if(c){if(b>=e.deqCost*v||b>=e.deqAvgCost*h)break}else if(w>=e.deqNoDrawCost*Ic)break;var E=e.deq(r,y,g);if(E.length>0)for(var x=0;x<E.length;x++)p.push(E[x]);else break}p.length>0&&(e.onDeqd(r,p),!c&&e.shouldRedraw(r,p,y,g)&&i())},l=e.priority||jl;a.beforeRender(s,l(r))}}}},I4=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$o;zl(this,t),this.idsByKey=new xn,this.keyForId=new xn,this.cachesByLvl=new xn,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=n}return Hl(t,[{key:"getIdsFor",value:function(n){n==null&&Ze("Can not get id list for null key");var r=this.idsByKey,a=this.idsByKey.get(n);return a||(a=new ma,r.set(n,a)),a}},{key:"addIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).add(r)}},{key:"deleteIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).delete(r)}},{key:"getNumberOfIdsForKey",value:function(n){return n==null?0:this.getIdsFor(n).size}},{key:"updateKeyMappingFor",value:function(n){var r=n.id(),a=this.keyForId.get(r),i=this.getKey(n);this.deleteIdForKey(a,r),this.addIdForKey(i,r),this.keyForId.set(r,i)}},{key:"deleteKeyMappingFor",value:function(n){var r=n.id(),a=this.keyForId.get(r);this.deleteIdForKey(a,r),this.keyForId.delete(r)}},{key:"keyHasChangedFor",value:function(n){var r=n.id(),a=this.keyForId.get(r),i=this.getKey(n);return a!==i}},{key:"isInvalid",value:function(n){return this.keyHasChangedFor(n)||this.doesEleInvalidateKey(n)}},{key:"getCachesAt",value:function(n){var r=this.cachesByLvl,a=this.lvls,i=r.get(n);return i||(i=new xn,r.set(n,i),a.push(n)),i}},{key:"getCache",value:function(n,r){return this.getCachesAt(r).get(n)}},{key:"get",value:function(n,r){var a=this.getKey(n),i=this.getCache(a,r);return i!=null&&this.updateKeyMappingFor(n),i}},{key:"getForCachedKey",value:function(n,r){var a=this.keyForId.get(n.id()),i=this.getCache(a,r);return i}},{key:"hasCache",value:function(n,r){return this.getCachesAt(r).has(n)}},{key:"has",value:function(n,r){var a=this.getKey(n);return this.hasCache(a,r)}},{key:"setCache",value:function(n,r,a){a.key=n,this.getCachesAt(r).set(n,a)}},{key:"set",value:function(n,r,a){var i=this.getKey(n);this.setCache(i,r,a),this.updateKeyMappingFor(n)}},{key:"deleteCache",value:function(n,r){this.getCachesAt(r).delete(n)}},{key:"delete",value:function(n,r){var a=this.getKey(n);this.deleteCache(a,r)}},{key:"invalidateKey",value:function(n){var r=this;this.lvls.forEach(function(a){return r.deleteCache(n,a)})}},{key:"invalidate",value:function(n){var r=n.id(),a=this.keyForId.get(r);this.deleteKeyMappingFor(n);var i=this.doesEleInvalidateKey(n);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}]),t}(),yv=25,Bs=50,Ns=-4,Oc=3,O4=7.99,L4=8,M4=1024,F4=1024,A4=1024,V4=.2,R4=.8,$4=10,z4=.15,H4=.1,K4=.9,q4=.9,U4=100,G4=1,Ra={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},W4=wt({getKey:null,doesEleInvalidateKey:$o,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:uh,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Gi=function(e,n){var r=this;r.renderer=e,r.onDequeues=[];var a=W4(n);xe(r,a),r.lookup=new I4(a.getKey,a.doesEleInvalidateKey),r.setupDequeueing()},ut=Gi.prototype;ut.reasons=Ra,ut.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},ut.getRetiredTextureQueue=function(t){var e=this,n=e.eleImgCaches.retired=e.eleImgCaches.retired||{},r=n[t]=n[t]||[];return r},ut.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Bi(function(n,r){return r.reqs-n.reqs});return e},ut.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},ut.getElement=function(t,e,n,r,a){var i=this,s=this.renderer,l=s.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(r==null&&(r=Math.ceil(Xl(l*n))),r<Ns)r=Ns;else if(l>=O4||r>Oc)return null;var c=Math.pow(2,r),d=e.h*c,f=e.w*c,h=s.eleTextBiggerThanMin(t,c);if(!this.isVisible(t,h))return null;var v=u.get(t,r);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;var p;if(d<=yv?p=yv:d<=Bs?p=Bs:p=Math.ceil(d/Bs)*Bs,d>A4||f>F4)return null;var g=i.getTextureQueue(p),y=g[g.length-2],m=function(){return i.recycleTexture(p,f)||i.addTexture(p,f)};y||(y=g[g.length-1]),y||(y=m()),y.width-y.usedWidth<f&&(y=m());for(var b=function(I){return I&&I.scaledLabelShown===h},w=a&&a===Ra.dequeue,C=a&&a===Ra.highQuality,E=a&&a===Ra.downscale,x,k=r+1;k<=Oc;k++){var B=u.get(t,k);if(B){x=B;break}}var S=x&&x.level===r+1?x:null,N=function(){y.context.drawImage(S.texture.canvas,S.x,0,S.width,S.height,y.usedWidth,0,f,d)};if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,f,p),b(S))N();else if(b(x))if(C){for(var D=x.level;D>r;D--)S=i.getElement(t,e,n,D,Ra.downscale);N()}else return i.queueElement(t,x.level-1),x;else{var _;if(!w&&!C&&!E)for(var O=r-1;O>=Ns;O--){var P=u.get(t,O);if(P){_=P;break}}if(b(_))return i.queueElement(t,r),_;y.context.translate(y.usedWidth,0),y.context.scale(c,c),this.drawElement(y.context,t,e,h,!1),y.context.scale(1/c,1/c),y.context.translate(-y.usedWidth,0)}return v={x:y.usedWidth,texture:y,level:r,scale:c,width:f,height:d,scaledLabelShown:h},y.usedWidth+=Math.ceil(f+L4),y.eleCaches.push(v),u.set(t,r,v),i.checkTextureFullness(y),v},ut.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])},ut.invalidateElement=function(t){var e=this,n=e.lookup,r=[],a=n.isInvalid(t);if(a){for(var i=Ns;i<=Oc;i++){var s=n.getForCachedKey(t,i);s&&r.push(s)}var l=n.invalidate(t);if(l)for(var u=0;u<r.length;u++){var c=r[u],d=c.texture;d.invalidatedWidth+=c.width,c.invalidated=!0,e.checkTextureUtility(d)}e.removeFromQueue(t)}},ut.checkTextureUtility=function(t){t.invalidatedWidth>=V4*t.width&&this.retireTexture(t)},ut.checkTextureFullness=function(t){var e=this,n=e.getTextureQueue(t.height);t.usedWidth/t.width>R4&&t.fullnessChecks>=$4?or(n,t):t.fullnessChecks++},ut.retireTexture=function(t){var e=this,n=t.height,r=e.getTextureQueue(n),a=this.lookup;or(r,t),t.retired=!0;for(var i=t.eleCaches,s=0;s<i.length;s++){var l=i[s];a.deleteCache(l.key,l.level)}Yl(i);var u=e.getRetiredTextureQueue(n);u.push(t)},ut.addTexture=function(t,e){var n=this,r=n.getTextureQueue(t),a={};return r.push(a),a.eleCaches=[],a.height=t,a.width=Math.max(M4,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=n.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a},ut.recycleTexture=function(t,e){for(var n=this,r=n.getTextureQueue(t),a=n.getRetiredTextureQueue(t),i=0;i<a.length;i++){var s=a[i];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,Yl(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),or(a,s),r.push(s),s}},ut.queueElement=function(t,e){var n=this,r=n.getElementQueue(),a=n.getElementKeyToQueue(),i=this.getKey(t),s=a[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,r.updateItem(s);else{var l={eles:t.spawn().merge(t),level:e,reqs:1,key:i};r.push(l),a[i]=l}},ut.dequeue=function(t){for(var e=this,n=e.getElementQueue(),r=e.getElementKeyToQueue(),a=[],i=e.lookup,s=0;s<G4&&n.size()>0;s++){var l=n.pop(),u=l.key,c=l.eles[0],d=i.hasCache(c,l.level);if(r[u]=null,d)continue;a.push(l);var f=e.getBoundingBox(c);e.getElement(c,f,t,l.level,Ra.dequeue)}return a},ut.removeFromQueue=function(t){var e=this,n=e.getElementQueue(),r=e.getElementKeyToQueue(),a=this.getKey(t),i=r[a];i!=null&&(i.eles.length===1?(i.reqs=Wl,n.updateItem(i),n.pop(),r[a]=null):i.eles.unmerge(t))},ut.onDequeue=function(t){this.onDequeues.push(t)},ut.offDequeue=function(t){or(this.onDequeues,t)},ut.setupDequeueing=mv.setupDequeueing({deqRedrawThreshold:U4,deqCost:z4,deqAvgCost:H4,deqNoDrawCost:K4,deqFastCost:q4,deq:function(e,n,r){return e.dequeue(n,r)},onDeqd:function(e,n){for(var r=0;r<e.onDequeues.length;r++){var a=e.onDequeues[r];a(n)}},shouldRedraw:function(e,n,r,a){for(var i=0;i<n.length;i++)for(var s=n[i].eles,l=0;l<s.length;l++){var u=s[l].boundingBox();if(Ql(u,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var j4=1,Wi=-4,Ds=2,Y4=3.99,Z4=50,X4=50,Q4=.15,J4=.1,e_=.9,t_=.9,n_=1,bv=250,r_=4e3*4e3,a_=!0,wv=function(e){var n=this,r=n.renderer=e,a=r.cy;n.layersByLevel={},n.firstGet=!0,n.lastInvalidationTime=Rn()-2*bv,n.skipping=!1,n.eleTxrDeqs=a.collection(),n.scheduleElementRefinement=Ao(function(){n.refineElementTextures(n.eleTxrDeqs),n.eleTxrDeqs.unmerge(n.eleTxrDeqs)},X4),r.beforeRender(function(s,l){l-n.lastInvalidationTime<=bv?n.skipping=!0:n.skipping=!1},r.beforeRenderPriorities.lyrTxrSkip);var i=function(l,u){return u.reqs-l.reqs};n.layersQueue=new Bi(i),n.setupDequeueing()},Et=wv.prototype,Cv=0,i_=Math.pow(2,53)-1;Et.makeLayer=function(t,e){var n=Math.pow(2,e),r=Math.ceil(t.w*n),a=Math.ceil(t.h*n),i=this.renderer.makeOffscreenCanvas(r,a),s={id:Cv=++Cv%i_,bb:t,level:e,width:r,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},l=s.context,u=-s.bb.x1,c=-s.bb.y1;return l.scale(n,n),l.translate(u,c),s},Et.getLayers=function(t,e,n){var r=this,a=r.renderer,i=a.cy,s=i.zoom(),l=r.firstGet;if(r.firstGet=!1,n==null){if(n=Math.ceil(Xl(s*e)),n<Wi)n=Wi;else if(s>=Y4||n>Ds)return null}r.validateLayersElesOrdering(n,t);var u=r.layersByLevel,c=Math.pow(2,n),d=u[n]=u[n]||[],f,h=r.levelIsComplete(n,t),v,p=function(){var N=function(F){if(r.validateLayersElesOrdering(F,t),r.levelIsComplete(F,t))return v=u[F],!0},D=function(F){if(!v)for(var I=n+F;Wi<=I&&I<=Ds&&!N(I);I+=F);};D(1),D(-1);for(var _=d.length-1;_>=0;_--){var O=d[_];O.invalid&&or(d,O)}};if(!h)p();else return d;var g=function(){if(!f){f=zt();for(var N=0;N<t.length;N++)yh(f,t[N].boundingBox())}return f},y=function(N){N=N||{};var D=N.after;g();var _=f.w*c*(f.h*c);if(_>r_)return null;var O=r.makeLayer(f,n);if(D!=null){var P=d.indexOf(D)+1;d.splice(P,0,O)}else(N.insert===void 0||N.insert)&&d.unshift(O);return O};if(r.skipping&&!l)return null;for(var m=null,b=t.length/j4,w=!l,C=0;C<t.length;C++){var E=t[C],x=E._private.rscratch,k=x.imgLayerCaches=x.imgLayerCaches||{},B=k[n];if(B){m=B;continue}if((!m||m.eles.length>=b||!wh(m.bb,E.boundingBox()))&&(m=y({insert:!0,after:m}),!m))return null;v||w?r.queueLayer(m,E):r.drawEleInLayer(m,E,n,e),m.eles.push(E),k[n]=m}return v||(w?null:d)},Et.getEleLevelForLayerLevel=function(t,e){return t},Et.drawEleInLayer=function(t,e,n,r){var a=this,i=this.renderer,s=t.context,l=e.boundingBox();l.w===0||l.h===0||!e.visible()||(n=a.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,n,a_),i.setImgSmoothing(s,!0))},Et.levelIsComplete=function(t,e){var n=this,r=n.layersByLevel[t];if(!r||r.length===0)return!1;for(var a=0,i=0;i<r.length;i++){var s=r[i];if(s.reqs>0||s.invalid)return!1;a+=s.eles.length}return a===e.length},Et.validateLayersElesOrdering=function(t,e){var n=this.layersByLevel[t];if(n)for(var r=0;r<n.length;r++){for(var a=n[r],i=-1,s=0;s<e.length;s++)if(a.eles[0]===e[s]){i=s;break}if(i<0){this.invalidateLayer(a);continue}for(var l=i,s=0;s<a.eles.length;s++)if(a.eles[s]!==e[l+s]){this.invalidateLayer(a);break}}},Et.updateElementsInLayers=function(t,e){for(var n=this,r=yi(t[0]),a=0;a<t.length;a++)for(var i=r?null:t[a],s=r?t[a]:t[a].ele,l=s._private.rscratch,u=l.imgLayerCaches=l.imgLayerCaches||{},c=Wi;c<=Ds;c++){var d=u[c];d&&(i&&n.getEleLevelForLayerLevel(d.level)!==i.level||e(d,s,i))}},Et.haveLayers=function(){for(var t=this,e=!1,n=Wi;n<=Ds;n++){var r=t.layersByLevel[n];if(r&&r.length>0){e=!0;break}}return e},Et.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Rn(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(r,a,i){e.invalidateLayer(r)}))},Et.invalidateLayer=function(t){if(this.lastInvalidationTime=Rn(),!t.invalid){var e=t.level,n=t.eles,r=this.layersByLevel[e];or(r,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var a=0;a<n.length;a++){var i=n[a]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}},Et.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(r,a,i){var s=r.replacement;if(s||(s=r.replacement=e.makeLayer(r.bb,r.level),s.replaces=r,s.eles=r.eles),!s.reqs)for(var l=0;l<s.eles.length;l++)e.queueLayer(s,s.eles[l])})},Et.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()},Et.queueLayer=function(t,e){var n=this,r=n.layersQueue,a=t.elesQueue,i=a.hasId=a.hasId||{};if(!t.replacement){if(e){if(i[e.id()])return;a.push(e),i[e.id()]=!0}t.reqs?(t.reqs++,r.updateItem(t)):(t.reqs=1,r.push(t))}},Et.dequeue=function(t){for(var e=this,n=e.layersQueue,r=[],a=0;a<n_&&n.size()!==0;){var i=n.peek();if(i.replacement){n.pop();continue}if(i.replaces&&i!==i.replaces.replacement){n.pop();continue}if(i.invalid){n.pop();continue}var s=i.elesQueue.shift();s&&(e.drawEleInLayer(i,s,i.level,t),a++),r.length===0&&r.push(!0),i.elesQueue.length===0&&(n.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return r},Et.applyLayerReplacement=function(t){var e=this,n=e.layersByLevel[t.level],r=t.replaces,a=n.indexOf(r);if(!(a<0||r.invalid)){n[a]=t;for(var i=0;i<t.eles.length;i++){var s=t.eles[i]._private,l=s.imgLayerCaches=s.imgLayerCaches||{};l&&(l[t.level]=t)}e.requestRedraw()}},Et.requestRedraw=Ao(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100),Et.setupDequeueing=mv.setupDequeueing({deqRedrawThreshold:Z4,deqCost:Q4,deqAvgCost:J4,deqNoDrawCost:e_,deqFastCost:t_,deq:function(e,n){return e.dequeue(n)},onDeqd:jl,shouldRedraw:uh,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var kv={},xv;function o_(t,e){for(var n=0;n<e.length;n++){var r=e[n];t.lineTo(r.x,r.y)}}function s_(t,e,n){for(var r,a=0;a<e.length;a++){var i=e[a];a===0&&(r=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(n.x,n.y,r.x,r.y)}function Ev(t,e,n){t.beginPath&&t.beginPath();for(var r=e,a=0;a<r.length;a++){var i=r[a];t.lineTo(i.x,i.y)}var s=n,l=n[0];t.moveTo(l.x,l.y);for(var a=1;a<s.length;a++){var i=s[a];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}function l_(t,e,n,r,a){t.beginPath&&t.beginPath(),t.arc(n,r,a,0,Math.PI*2,!1);var i=e,s=i[0];t.moveTo(s.x,s.y);for(var l=0;l<i.length;l++){var u=i[l];t.lineTo(u.x,u.y)}t.closePath&&t.closePath()}function c_(t,e,n,r){t.arc(e,n,r,0,Math.PI*2,!1)}kv.arrowShapeImpl=function(t){return(xv||(xv={polygon:o_,"triangle-backcurve":s_,"triangle-tee":Ev,"circle-triangle":l_,"triangle-cross":Ev,circle:c_}))[t]};var Nn={};Nn.drawElement=function(t,e,n,r,a,i){var s=this;e.isNode()?s.drawNode(t,e,n,r,a,i):s.drawEdge(t,e,n,r,a,i)},Nn.drawElementOverlay=function(t,e){var n=this;e.isNode()?n.drawNodeOverlay(t,e):n.drawEdgeOverlay(t,e)},Nn.drawElementUnderlay=function(t,e){var n=this;e.isNode()?n.drawNodeUnderlay(t,e):n.drawEdgeUnderlay(t,e)},Nn.drawCachedElementPortion=function(t,e,n,r,a,i,s,l){var u=this,c=n.getBoundingBox(e);if(!(c.w===0||c.h===0)){var d=n.getElement(e,c,r,a,i);if(d!=null){var f=l(u,e);if(f===0)return;var h=s(u,e),v=c.x1,p=c.y1,g=c.w,y=c.h,m,b,w,C,E;if(h!==0){var x=n.getRotationPoint(e);w=x.x,C=x.y,t.translate(w,C),t.rotate(h),E=u.getImgSmoothing(t),E||u.setImgSmoothing(t,!0);var k=n.getRotationOffset(e);m=k.x,b=k.y}else m=v,b=p;var B;f!==1&&(B=t.globalAlpha,t.globalAlpha=B*f),t.drawImage(d.texture.canvas,d.x,0,d.width,d.height,m,b,g,y),f!==1&&(t.globalAlpha=B),h!==0&&(t.rotate(-h),t.translate(-w,-C),E||u.setImgSmoothing(t,!1))}else n.drawElement(t,e)}};var u_=function(){return 0},d_=function(e,n){return e.getTextAngle(n,null)},f_=function(e,n){return e.getTextAngle(n,"source")},h_=function(e,n){return e.getTextAngle(n,"target")},p_=function(e,n){return n.effectiveOpacity()},Lc=function(e,n){return n.pstyle("text-opacity").pfValue*n.effectiveOpacity()};Nn.drawCachedElement=function(t,e,n,r,a,i){var s=this,l=s.data,u=l.eleTxrCache,c=l.lblTxrCache,d=l.slbTxrCache,f=l.tlbTxrCache,h=e.boundingBox(),v=i===!0?u.reasons.highQuality:null;if(!(h.w===0||h.h===0||!e.visible())&&(!r||Ql(h,r))){var p=e.isEdge(),g=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,u,n,a,v,u_,p_),(!p||!g)&&s.drawCachedElementPortion(t,e,c,n,a,v,d_,Lc),p&&!g&&(s.drawCachedElementPortion(t,e,d,n,a,v,f_,Lc),s.drawCachedElementPortion(t,e,f,n,a,v,h_,Lc)),s.drawElementOverlay(t,e)}},Nn.drawElements=function(t,e){for(var n=this,r=0;r<e.length;r++){var a=e[r];n.drawElement(t,a)}},Nn.drawCachedElements=function(t,e,n,r){for(var a=this,i=0;i<e.length;i++){var s=e[i];a.drawCachedElement(t,s,n,r)}},Nn.drawCachedNodes=function(t,e,n,r){for(var a=this,i=0;i<e.length;i++){var s=e[i];s.isNode()&&a.drawCachedElement(t,s,n,r)}},Nn.drawLayeredElements=function(t,e,n,r){var a=this,i=a.data.lyrTxrCache.getLayers(e,n);if(i)for(var s=0;s<i.length;s++){var l=i[s],u=l.bb;u.w===0||u.h===0||t.drawImage(l.canvas,u.x1,u.y1,u.w,u.h)}else a.drawCachedElements(t,e,n,r)};var qn={};qn.drawEdge=function(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,l=e._private.rscratch;if(!(i&&!e.visible())&&!(l.badLine||l.allpts==null||isNaN(l.allpts[0]))){var u;n&&(u=n,t.translate(-u.x1,-u.y1));var c=i?e.pstyle("opacity").value:1,d=i?e.pstyle("line-opacity").value:1,f=e.pstyle("curve-style").value,h=e.pstyle("line-style").value,v=e.pstyle("width").pfValue,p=e.pstyle("line-cap").value,g=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,m=c*d,b=c*d,w=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;f==="straight-triangle"?(s.eleStrokeStyle(t,e,F),s.drawEdgeTrianglePath(e,t,l.allpts)):(t.lineWidth=v,t.lineCap=p,s.eleStrokeStyle(t,e,F),s.drawEdgePath(e,t,l.allpts,h),t.lineCap="butt")},C=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;if(t.lineWidth=v+g,t.lineCap=p,g>0)s.colorStrokeStyle(t,y[0],y[1],y[2],F);else{t.lineCap="butt";return}f==="straight-triangle"?s.drawEdgeTrianglePath(e,t,l.allpts):(s.drawEdgePath(e,t,l.allpts,h),t.lineCap="butt")},E=function(){a&&s.drawEdgeOverlay(t,e)},x=function(){a&&s.drawEdgeUnderlay(t,e)},k=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;s.drawArrowheads(t,e,F)},B=function(){s.drawElementText(t,e,null,r)};t.lineJoin="round";var S=e.pstyle("ghost").value==="yes";if(S){var N=e.pstyle("ghost-offset-x").pfValue,D=e.pstyle("ghost-offset-y").pfValue,_=e.pstyle("ghost-opacity").value,O=m*_;t.translate(N,D),w(O),k(O),t.translate(-N,-D)}else C();x(),w(),k(),E(),B(),n&&t.translate(u.x1,u.y1)}};var Sv=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(n,r){if(r.visible()){var a=r.pstyle("".concat(e,"-opacity")).value;if(a!==0){var i=this,s=i.usePaths(),l=r._private.rscratch,u=r.pstyle("".concat(e,"-padding")).pfValue,c=2*u,d=r.pstyle("".concat(e,"-color")).value;n.lineWidth=c,l.edgeType==="self"&&!s?n.lineCap="butt":n.lineCap="round",i.colorStrokeStyle(n,d[0],d[1],d[2],a),i.drawEdgePath(r,n,l.allpts,"solid")}}}};qn.drawEdgeOverlay=Sv("overlay"),qn.drawEdgeUnderlay=Sv("underlay"),qn.drawEdgePath=function(t,e,n,r){var a=t._private.rscratch,i=e,s,l=!1,u=this.usePaths(),c=t.pstyle("line-dash-pattern").pfValue,d=t.pstyle("line-dash-offset").pfValue;if(u){var f=n.join("$"),h=a.pathCacheKey&&a.pathCacheKey===f;h?(s=e=a.pathCache,l=!0):(s=e=new Path2D,a.pathCacheKey=f,a.pathCache=s)}if(i.setLineDash)switch(r){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(c),i.lineDashOffset=d;break;case"solid":i.setLineDash([]);break}if(!l&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var v=2;v+3<n.length;v+=4)e.quadraticCurveTo(n[v],n[v+1],n[v+2],n[v+3]);break;case"straight":case"haystack":for(var p=2;p+1<n.length;p+=2)e.lineTo(n[p],n[p+1]);break;case"segments":if(a.isRound){var g=qf(a.roundCorners),y;try{for(g.s();!(y=g.n()).done;){var m=y.value;ov(e,m)}}catch(w){g.e(w)}finally{g.f()}e.lineTo(n[n.length-2],n[n.length-1])}else for(var b=2;b+1<n.length;b+=2)e.lineTo(n[b],n[b+1]);break}e=i,u?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])},qn.drawEdgeTrianglePath=function(t,e,n){e.fillStyle=e.strokeStyle;for(var r=t.pstyle("width").pfValue,a=0;a+1<n.length;a+=2){var i=[n[a+2]-n[a],n[a+3]-n[a+1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),l=[i[1]/s,-i[0]/s],u=[l[0]*r/2,l[1]*r/2];e.beginPath(),e.moveTo(n[a]-u[0],n[a+1]-u[1]),e.lineTo(n[a]+u[0],n[a+1]+u[1]),e.lineTo(n[a+2],n[a+3]),e.closePath(),e.fill()}},qn.drawArrowheads=function(t,e,n){var r=e._private.rscratch,a=r.edgeType==="haystack";a||this.drawArrowhead(t,e,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(t,e,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(t,e,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),a||this.drawArrowhead(t,e,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},qn.drawArrowhead=function(t,e,n,r,a,i,s){if(!(isNaN(r)||r==null||isNaN(a)||a==null||isNaN(i)||i==null)){var l=this,u=e.pstyle(n+"-arrow-shape").value;if(u!=="none"){var c=e.pstyle(n+"-arrow-fill").value==="hollow"?"both":"filled",d=e.pstyle(n+"-arrow-fill").value,f=e.pstyle("width").pfValue,h=e.pstyle(n+"-arrow-width"),v=h.value==="match-line"?f:h.pfValue;h.units==="%"&&(v*=f);var p=e.pstyle("opacity").value;s===void 0&&(s=p);var g=t.globalCompositeOperation;(s!==1||d==="hollow")&&(t.globalCompositeOperation="destination-out",l.colorFillStyle(t,255,255,255,1),l.colorStrokeStyle(t,255,255,255,1),l.drawArrowShape(e,t,c,f,u,v,r,a,i),t.globalCompositeOperation=g);var y=e.pstyle(n+"-arrow-color").value;l.colorFillStyle(t,y[0],y[1],y[2],s),l.colorStrokeStyle(t,y[0],y[1],y[2],s),l.drawArrowShape(e,t,d,f,u,v,r,a,i)}}},qn.drawArrowShape=function(t,e,n,r,a,i,s,l,u){var c=this,d=this.usePaths()&&a!=="triangle-cross",f=!1,h,v=e,p={x:s,y:l},g=t.pstyle("arrow-scale").value,y=this.getArrowWidth(r,g),m=c.arrowShapes[a];if(d){var b=c.arrowPathCache=c.arrowPathCache||[],w=Mr(a),C=b[w];C!=null?(h=e=C,f=!0):(h=e=new Path2D,b[w]=h)}f||(e.beginPath&&e.beginPath(),d?m.draw(e,1,0,{x:0,y:0},1):m.draw(e,y,u,p,r),e.closePath&&e.closePath()),e=v,d&&(e.translate(s,l),e.rotate(u),e.scale(y,y)),(n==="filled"||n==="both")&&(d?e.fill(h):e.fill()),(n==="hollow"||n==="both")&&(e.lineWidth=i/(d?y:1),e.lineJoin="miter",d?e.stroke(h):e.stroke()),d&&(e.scale(1/y,1/y),e.rotate(-u),e.translate(-s,-l))};var Mc={};Mc.safeDrawImage=function(t,e,n,r,a,i,s,l,u,c){if(!(a<=0||i<=0||u<=0||c<=0))try{t.drawImage(e,n,r,a,i,s,l,u,c)}catch(d){Ve(d)}},Mc.drawInscribedImage=function(t,e,n,r,a){var i=this,s=n.position(),l=s.x,u=s.y,c=n.cy().style(),d=c.getIndexedStyle.bind(c),f=d(n,"background-fit","value",r),h=d(n,"background-repeat","value",r),v=n.width(),p=n.height(),g=n.padding()*2,y=v+(d(n,"background-width-relative-to","value",r)==="inner"?0:g),m=p+(d(n,"background-height-relative-to","value",r)==="inner"?0:g),b=n._private.rscratch,w=d(n,"background-clip","value",r),C=w==="node",E=d(n,"background-image-opacity","value",r)*a,x=d(n,"background-image-smoothing","value",r),k=n.pstyle("corner-radius").value;k!=="auto"&&(k=n.pstyle("corner-radius").pfValue);var B=e.width||e.cachedW,S=e.height||e.cachedH;(B==null||S==null)&&(document.body.appendChild(e),B=e.cachedW=e.width||e.offsetWidth,S=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var N=B,D=S;if(d(n,"background-width","value",r)!=="auto"&&(d(n,"background-width","units",r)==="%"?N=d(n,"background-width","pfValue",r)*y:N=d(n,"background-width","pfValue",r)),d(n,"background-height","value",r)!=="auto"&&(d(n,"background-height","units",r)==="%"?D=d(n,"background-height","pfValue",r)*m:D=d(n,"background-height","pfValue",r)),!(N===0||D===0)){if(f==="contain"){var _=Math.min(y/N,m/D);N*=_,D*=_}else if(f==="cover"){var _=Math.max(y/N,m/D);N*=_,D*=_}var O=l-y/2,P=d(n,"background-position-x","units",r),F=d(n,"background-position-x","pfValue",r);P==="%"?O+=(y-N)*F:O+=F;var I=d(n,"background-offset-x","units",r),M=d(n,"background-offset-x","pfValue",r);I==="%"?O+=(y-N)*M:O+=M;var L=u-m/2,V=d(n,"background-position-y","units",r),H=d(n,"background-position-y","pfValue",r);V==="%"?L+=(m-D)*H:L+=H;var $=d(n,"background-offset-y","units",r),z=d(n,"background-offset-y","pfValue",r);$==="%"?L+=(m-D)*z:L+=z,b.pathCache&&(O-=l,L-=u,l=0,u=0);var j=t.globalAlpha;t.globalAlpha=E;var ee=i.getImgSmoothing(t),J=!1;if(x==="no"&&ee?(i.setImgSmoothing(t,!1),J=!0):x==="yes"&&!ee&&(i.setImgSmoothing(t,!0),J=!0),h==="no-repeat")C&&(t.save(),b.pathCache?t.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(n)].draw(t,l,u,y,m,k,b),t.clip())),i.safeDrawImage(t,e,0,0,B,S,O,L,N,D),C&&t.restore();else{var X=t.createPattern(e,h);t.fillStyle=X,i.nodeShapes[i.getNodeShape(n)].draw(t,l,u,y,m,k,b),t.translate(O,L),t.fill(),t.translate(-O,-L)}t.globalAlpha=j,J&&i.setImgSmoothing(t,ee)}};var Wr={};Wr.eleTextBiggerThanMin=function(t,e){if(!e){var n=t.cy().zoom(),r=this.getPixelRatio(),a=Math.ceil(Xl(n*r));e=Math.pow(2,a)}var i=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;return!(i<s)},Wr.drawElementText=function(t,e,n,r,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(r==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(r===!1)return;if(e.isNode()){var l=e.pstyle("label");if(!l||!l.value)return;var u=s.getLabelJustification(e);t.textAlign=u,t.textBaseline="bottom"}else{var c=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),h=e.pstyle("target-label");if(c||(!d||!d.value)&&(!f||!f.value)&&(!h||!h.value))return;t.textAlign="center",t.textBaseline="bottom"}var v=!n,p;n&&(p=n,t.translate(-p.x1,-p.y1)),a==null?(s.drawText(t,e,null,v,i),e.isEdge()&&(s.drawText(t,e,"source",v,i),s.drawText(t,e,"target",v,i))):s.drawText(t,e,a,v,i),n&&t.translate(p.x1,p.y1)},Wr.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if(e=this.fontCaches[n],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e},Wr.setupTextStyle=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,l=n?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*l,c=e.pstyle("color").value,d=e.pstyle("text-outline-color").value;t.font=r+" "+s+" "+a+" "+i,t.lineJoin="round",this.colorFillStyle(t,c[0],c[1],c[2],l),this.colorStrokeStyle(t,d[0],d[1],d[2],u)};function Fc(t,e,n,r,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+i,n),t.lineTo(e+r-i,n),t.quadraticCurveTo(e+r,n,e+r,n+i),t.lineTo(e+r,n+a-i),t.quadraticCurveTo(e+r,n+a,e+r-i,n+a),t.lineTo(e+i,n+a),t.quadraticCurveTo(e,n+a,e,n+a-i),t.lineTo(e,n+i),t.quadraticCurveTo(e,n,e+i,n),t.closePath(),s?t.stroke():t.fill()}Wr.getTextAngle=function(t,e){var n,r=t._private,a=r.rscratch,i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),l=fn(a,"labelAngle",e);return s.strValue==="autorotate"?n=t.isEdge()?l:0:s.strValue==="none"?n=0:n=s.pfValue,n},Wr.drawText=function(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,s=i.rscratch,l=a?e.effectiveOpacity():1;if(!(a&&(l===0||e.pstyle("text-opacity").value===0))){n==="main"&&(n=null);var u=fn(s,"labelX",n),c=fn(s,"labelY",n),d,f,h=this.getLabelText(e,n);if(h!=null&&h!==""&&!isNaN(u)&&!isNaN(c)){this.setupTextStyle(t,e,a);var v=n?n+"-":"",p=fn(s,"labelWidth",n),g=fn(s,"labelHeight",n),y=e.pstyle(v+"text-margin-x").pfValue,m=e.pstyle(v+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;b&&(w="center",C="center"),u+=y,c+=m;var E;switch(r?E=this.getTextAngle(e,n):E=0,E!==0&&(d=u,f=c,t.translate(d,f),t.rotate(E),u=0,c=0),C){case"top":break;case"center":c+=g/2;break;case"bottom":c+=g;break}var x=e.pstyle("text-background-opacity").value,k=e.pstyle("text-border-opacity").value,B=e.pstyle("text-border-width").pfValue,S=e.pstyle("text-background-padding").pfValue,N=e.pstyle("text-background-shape").strValue,D=N.indexOf("round")===0,_=2;if(x>0||B>0&&k>0){var O=u-S;switch(w){case"left":O-=p;break;case"center":O-=p/2;break}var P=c-g-S,F=p+2*S,I=g+2*S;if(x>0){var M=t.fillStyle,L=e.pstyle("text-background-color").value;t.fillStyle="rgba("+L[0]+","+L[1]+","+L[2]+","+x*l+")",D?Fc(t,O,P,F,I,_):t.fillRect(O,P,F,I),t.fillStyle=M}if(B>0&&k>0){var V=t.strokeStyle,H=t.lineWidth,$=e.pstyle("text-border-color").value,z=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+$[0]+","+$[1]+","+$[2]+","+k*l+")",t.lineWidth=B,t.setLineDash)switch(z){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=B/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(D?Fc(t,O,P,F,I,_,"stroke"):t.strokeRect(O,P,F,I),z==="double"){var j=B/2;D?Fc(t,O+j,P+j,F-j*2,I-j*2,_,"stroke"):t.strokeRect(O+j,P+j,F-j*2,I-j*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=H,t.strokeStyle=V}}var ee=2*e.pstyle("text-outline-width").pfValue;if(ee>0&&(t.lineWidth=ee),e.pstyle("text-wrap").value==="wrap"){var J=fn(s,"labelWrapCachedLines",n),X=fn(s,"labelLineHeight",n),ne=p/2,Y=this.getLabelJustification(e);switch(Y==="auto"||(w==="left"?Y==="left"?u+=-p:Y==="center"&&(u+=-ne):w==="center"?Y==="left"?u+=-ne:Y==="right"&&(u+=ne):w==="right"&&(Y==="center"?u+=ne:Y==="right"&&(u+=p))),C){case"top":c-=(J.length-1)*X;break;case"center":case"bottom":c-=(J.length-1)*X;break}for(var A=0;A<J.length;A++)ee>0&&t.strokeText(J[A],u,c),t.fillText(J[A],u,c),c+=X}else ee>0&&t.strokeText(h,u,c),t.fillText(h,u,c);E!==0&&(t.rotate(-E),t.translate(-d,-f))}}};var $a={};$a.drawNode=function(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,l,u,c=e._private,d=c.rscratch,f=e.position();if(!(!le(f.x)||!le(f.y))&&!(i&&!e.visible())){var h=i?e.effectiveOpacity():1,v=s.usePaths(),p,g=!1,y=e.padding();l=e.width()+2*y,u=e.height()+2*y;var m;n&&(m=n,t.translate(-m.x1,-m.y1));for(var b=e.pstyle("background-image"),w=b.value,C=new Array(w.length),E=new Array(w.length),x=0,k=0;k<w.length;k++){var B=w[k],S=C[k]=B!=null&&B!=="none";if(S){var N=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",k);x++,E[k]=s.getCachedImage(B,N,function(){c.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var D=e.pstyle("background-blacken").value,_=e.pstyle("border-width").pfValue,O=e.pstyle("background-opacity").value*h,P=e.pstyle("border-color").value,F=e.pstyle("border-style").value,I=e.pstyle("border-join").value,M=e.pstyle("border-cap").value,L=e.pstyle("border-position").value,V=e.pstyle("border-dash-pattern").pfValue,H=e.pstyle("border-dash-offset").pfValue,$=e.pstyle("border-opacity").value*h,z=e.pstyle("outline-width").pfValue,j=e.pstyle("outline-color").value,ee=e.pstyle("outline-style").value,J=e.pstyle("outline-opacity").value*h,X=e.pstyle("outline-offset").value,ne=e.pstyle("corner-radius").value;ne!=="auto"&&(ne=e.pstyle("corner-radius").pfValue);var Y=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:O;s.eleFillStyle(t,e,ie)},A=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$;s.colorStrokeStyle(t,P[0],P[1],P[2],ie)},K=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:J;s.colorStrokeStyle(t,j[0],j[1],j[2],ie)},W=function(ie,Z,ae,we){var Ce=s.nodePathCache=s.nodePathCache||[],ge=lh(ae==="polygon"?ae+","+we.join(","):ae,""+Z,""+ie,""+ne),Se=Ce[ge],ve,ye=!1;return Se!=null?(ve=Se,ye=!0,d.pathCache=ve):(ve=new Path2D,Ce[ge]=d.pathCache=ve),{path:ve,cacheHit:ye}},oe=e.pstyle("shape").strValue,he=e.pstyle("shape-polygon-points").pfValue;if(v){t.translate(f.x,f.y);var re=W(l,u,oe,he);p=re.path,g=re.cacheHit}var se=function(){if(!g){var ie=f;v&&(ie={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(p||t,ie.x,ie.y,l,u,ne,d)}v?t.fill(p):t.fill()},ue=function(){for(var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ae=c.backgrounding,we=0,Ce=0;Ce<E.length;Ce++){var ge=e.cy().style().getIndexedStyle(e,"background-image-containment","value",Ce);if(Z&&ge==="over"||!Z&&ge==="inside"){we++;continue}C[Ce]&&E[Ce].complete&&!E[Ce].error&&(we++,s.drawInscribedImage(t,E[Ce],e,Ce,ie))}c.backgrounding=we!==x,ae!==c.backgrounding&&e.updateStyle(!1)},pe=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;s.hasPie(e)&&(s.drawPie(t,e,Z),ie&&(v||s.nodeShapes[s.getNodeShape(e)].draw(t,f.x,f.y,l,u,ne,d)))},de=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,Z=(D>0?D:-D)*ie,ae=D>0?0:255;D!==0&&(s.colorFillStyle(t,ae,ae,ae,Z),v?t.fill(p):t.fill())},me=function(){if(_>0){if(t.lineWidth=_,t.lineCap=M,t.lineJoin=I,t.setLineDash)switch(F){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(V),t.lineDashOffset=H;break;case"solid":case"double":t.setLineDash([]);break}if(L!=="center"){if(t.save(),t.lineWidth*=2,L==="inside")v?t.clip(p):t.clip();else{var ie=new Path2D;ie.rect(-l/2-_,-u/2-_,l+2*_,u+2*_),ie.addPath(p),t.clip(ie,"evenodd")}v?t.stroke(p):t.stroke(),t.restore()}else v?t.stroke(p):t.stroke();if(F==="double"){t.lineWidth=_/3;var Z=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(p):t.stroke(),t.globalCompositeOperation=Z}t.setLineDash&&t.setLineDash([])}},Ne=function(){if(z>0){if(t.lineWidth=z,t.lineCap="butt",t.setLineDash)switch(ee){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var ie=f;v&&(ie={x:0,y:0});var Z=s.getNodeShape(e),ae=_;L==="inside"&&(ae=0),L==="outside"&&(ae*=2);var we=(l+ae+(z+X))/l,Ce=(u+ae+(z+X))/u,ge=l*we,Se=u*Ce,ve=s.nodeShapes[Z].points,ye;if(v){var Ge=W(ge,Se,Z,ve);ye=Ge.path}if(Z==="ellipse")s.drawEllipsePath(ye||t,ie.x,ie.y,ge,Se);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(Z)){var $e=0,nt=0,rt=0;Z==="round-diamond"?$e=(ae+X+z)*1.4:Z==="round-heptagon"?($e=(ae+X+z)*1.075,rt=-(ae/2+X+z)/35):Z==="round-hexagon"?$e=(ae+X+z)*1.12:Z==="round-pentagon"?($e=(ae+X+z)*1.13,rt=-(ae/2+X+z)/15):Z==="round-tag"?($e=(ae+X+z)*1.12,nt=(ae/2+z+X)*.07):Z==="round-triangle"&&($e=(ae+X+z)*(Math.PI/2),rt=-(ae+X/2+z)/Math.PI),$e!==0&&(we=(l+$e)/l,ge=l*we,["round-hexagon","round-tag"].includes(Z)||(Ce=(u+$e)/u,Se=u*Ce)),ne=ne==="auto"?xh(ge,Se):ne;for(var Qe=ge/2,Pt=Se/2,dt=ne+(ae+z+X)/2,pt=new Array(ve.length/2),jt=new Array(ve.length/2),It=0;It<ve.length/2;It++)pt[It]={x:ie.x+nt+Qe*ve[It*2],y:ie.y+rt+Pt*ve[It*2+1]};var Ot,rn,vn,Kt,Je=pt.length;for(rn=pt[Je-1],Ot=0;Ot<Je;Ot++)vn=pt[Ot%Je],Kt=pt[(Ot+1)%Je],jt[Ot]=_c(rn,vn,Kt,dt),rn=vn,vn=Kt;s.drawRoundPolygonPath(ye||t,ie.x+nt,ie.y+rt,l*we,u*Ce,ve,jt)}else if(["roundrectangle","round-rectangle"].includes(Z))ne=ne==="auto"?Rr(ge,Se):ne,s.drawRoundRectanglePath(ye||t,ie.x,ie.y,ge,Se,ne+(ae+z+X)/2);else if(["cutrectangle","cut-rectangle"].includes(Z))ne=ne==="auto"?tc():ne,s.drawCutRectanglePath(ye||t,ie.x,ie.y,ge,Se,null,ne+(ae+z+X)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(Z))ne=ne==="auto"?Rr(ge,Se):ne,s.drawBottomRoundRectanglePath(ye||t,ie.x,ie.y,ge,Se,ne+(ae+z+X)/2);else if(Z==="barrel")s.drawBarrelPath(ye||t,ie.x,ie.y,ge,Se);else if(Z.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(Z)){var at=(ae+z+X)/l;ve=Go(Wo(ve,at)),s.drawPolygonPath(ye||t,ie.x,ie.y,l,u,ve)}else{var vt=(ae+z+X)/l;ve=Go(Wo(ve,-vt)),s.drawPolygonPath(ye||t,ie.x,ie.y,l,u,ve)}if(v?t.stroke(ye):t.stroke(),ee==="double"){t.lineWidth=ae/3;var mr=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(ye):t.stroke(),t.globalCompositeOperation=mr}t.setLineDash&&t.setLineDash([])}},De=function(){a&&s.drawNodeOverlay(t,e,f,l,u)},Ee=function(){a&&s.drawNodeUnderlay(t,e,f,l,u)},_e=function(){s.drawElementText(t,e,null,r)},te=e.pstyle("ghost").value==="yes";if(te){var T=e.pstyle("ghost-offset-x").pfValue,R=e.pstyle("ghost-offset-y").pfValue,Q=e.pstyle("ghost-opacity").value,G=Q*h;t.translate(T,R),K(),Ne(),Y(Q*O),se(),ue(G,!0),A(Q*$),me(),pe(D!==0||_!==0),ue(G,!1),de(G),t.translate(-T,-R)}v&&t.translate(-f.x,-f.y),Ee(),v&&t.translate(f.x,f.y),K(),Ne(),Y(),se(),ue(h,!0),A(),me(),pe(D!==0||_!==0),ue(h,!1),de(),v&&t.translate(-f.x,-f.y),_e(),De(),n&&t.translate(m.x1,m.y1)}};var Tv=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(n,r,a,i,s){var l=this;if(r.visible()){var u=r.pstyle("".concat(e,"-padding")).pfValue,c=r.pstyle("".concat(e,"-opacity")).value,d=r.pstyle("".concat(e,"-color")).value,f=r.pstyle("".concat(e,"-shape")).value,h=r.pstyle("".concat(e,"-corner-radius")).value;if(c>0){if(a=a||r.position(),i==null||s==null){var v=r.padding();i=r.width()+2*v,s=r.height()+2*v}l.colorFillStyle(n,d[0],d[1],d[2],c),l.nodeShapes[f].draw(n,a.x,a.y,i+u*2,s+u*2,h),n.fill()}}}};$a.drawNodeOverlay=Tv("overlay"),$a.drawNodeUnderlay=Tv("underlay"),$a.hasPie=function(t){return t=t[0],t._private.hasPie},$a.drawPie=function(t,e,n,r){e=e[0],r=r||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),s=r.x,l=r.y,u=e.width(),c=e.height(),d=Math.min(u,c)/2,f=0,h=this.usePaths();h&&(s=0,l=0),i.units==="%"?d=d*i.pfValue:i.pfValue!==void 0&&(d=i.pfValue/2);for(var v=1;v<=a.pieBackgroundN;v++){var p=e.pstyle("pie-"+v+"-background-size").value,g=e.pstyle("pie-"+v+"-background-color").value,y=e.pstyle("pie-"+v+"-background-opacity").value*n,m=p/100;m+f>1&&(m=1-f);var b=1.5*Math.PI+2*Math.PI*f,w=2*Math.PI*m,C=b+w;p===0||f>=1||f+m>1||(t.beginPath(),t.moveTo(s,l),t.arc(s,l,d,b,C),t.closePath(),this.colorFillStyle(t,g[0],g[1],g[2],y),t.fill(),f+=m)}};var Wt={},v_=100;Wt.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),n=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/n},Wt.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],n=!0,r,a=0;a<e.length;a++)if(r=e[a],r.context===t){n=!1;break}return n&&(r={context:t},e.push(r)),r},Wt.createGradientStyleFor=function(t,e,n,r,a){var i,s=this.usePaths(),l=n.pstyle(e+"-gradient-stop-colors").value,u=n.pstyle(e+"-gradient-stop-positions").pfValue;if(r==="radial-gradient")if(n.isEdge()){var c=n.sourceEndpoint(),d=n.targetEndpoint(),f=n.midpoint(),h=Fr(c,f),v=Fr(d,f);i=t.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(h,v))}else{var p=s?{x:0,y:0}:n.position(),g=n.paddedWidth(),y=n.paddedHeight();i=t.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(g,y))}else if(n.isEdge()){var m=n.sourceEndpoint(),b=n.targetEndpoint();i=t.createLinearGradient(m.x,m.y,b.x,b.y)}else{var w=s?{x:0,y:0}:n.position(),C=n.paddedWidth(),E=n.paddedHeight(),x=C/2,k=E/2,B=n.pstyle("background-gradient-direction").value;switch(B){case"to-bottom":i=t.createLinearGradient(w.x,w.y-k,w.x,w.y+k);break;case"to-top":i=t.createLinearGradient(w.x,w.y+k,w.x,w.y-k);break;case"to-left":i=t.createLinearGradient(w.x+x,w.y,w.x-x,w.y);break;case"to-right":i=t.createLinearGradient(w.x-x,w.y,w.x+x,w.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(w.x-x,w.y-k,w.x+x,w.y+k);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(w.x-x,w.y+k,w.x+x,w.y-k);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(w.x+x,w.y-k,w.x-x,w.y+k);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(w.x+x,w.y+k,w.x-x,w.y-k);break}}if(!i)return null;for(var S=u.length===l.length,N=l.length,D=0;D<N;D++)i.addColorStop(S?u[D]:D/(N-1),"rgba("+l[D][0]+","+l[D][1]+","+l[D][2]+","+a+")");return i},Wt.gradientFillStyle=function(t,e,n,r){var a=this.createGradientStyleFor(t,"background",e,n,r);if(!a)return null;t.fillStyle=a},Wt.colorFillStyle=function(t,e,n,r,a){t.fillStyle="rgba("+e+","+n+","+r+","+a+")"},Wt.eleFillStyle=function(t,e,n){var r=e.pstyle("background-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientFillStyle(t,e,r,n);else{var a=e.pstyle("background-color").value;this.colorFillStyle(t,a[0],a[1],a[2],n)}},Wt.gradientStrokeStyle=function(t,e,n,r){var a=this.createGradientStyleFor(t,"line",e,n,r);if(!a)return null;t.strokeStyle=a},Wt.colorStrokeStyle=function(t,e,n,r,a){t.strokeStyle="rgba("+e+","+n+","+r+","+a+")"},Wt.eleStrokeStyle=function(t,e,n){var r=e.pstyle("line-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientStrokeStyle(t,e,r,n);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(t,a[0],a[1],a[2],n)}},Wt.matchCanvasSize=function(t){var e=this,n=e.data,r=e.findContainerClientCoords(),a=r[2],i=r[3],s=e.getPixelRatio(),l=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(s=l);var u=a*s,c=i*s,d;if(!(u===e.canvasWidth&&c===e.canvasHeight)){e.fontCaches=null;var f=n.canvasContainer;f.style.width=a+"px",f.style.height=i+"px";for(var h=0;h<e.CANVAS_LAYERS;h++)d=n.canvases[h],d.width=u,d.height=c,d.style.width=a+"px",d.style.height=i+"px";for(var h=0;h<e.BUFFER_COUNT;h++)d=n.bufferCanvases[h],d.width=u,d.height=c,d.style.width=a+"px",d.style.height=i+"px";e.textureMult=1,s<=1&&(d=n.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,d.width=u*e.textureMult,d.height=c*e.textureMult),e.canvasWidth=u,e.canvasHeight=c}},Wt.renderTo=function(t,e,n,r){this.render({forcedContext:t,forcedZoom:e,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},Wt.render=function(t){t=t||ph();var e=t.forcedContext,n=t.drawAllLayers,r=t.drawOnlyNodeLayer,a=t.forcedZoom,i=t.forcedPan,s=this,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,u=s.cy,c=s.data,d=c.canvasNeedsRedraw,f=s.textureOnViewport&&!e&&(s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming),h=t.motionBlur!==void 0?t.motionBlur:s.motionBlur,v=s.motionBlurPxRatio,p=u.hasCompoundNodes(),g=s.hoverData.draggingEles,y=!!(s.hoverData.selecting||s.touchData.selecting);h=h&&!e&&s.motionBlurEnabled&&!y;var m=h;e||(s.prevPxRatio!==l&&(s.invalidateContainerClientCoordsCache(),s.matchCanvasSize(s.container),s.redrawHint("eles",!0),s.redrawHint("drag",!0)),s.prevPxRatio=l),!e&&s.motionBlurTimeout&&clearTimeout(s.motionBlurTimeout),h&&(s.mbFrames==null&&(s.mbFrames=0),s.mbFrames++,s.mbFrames<3&&(m=!1),s.mbFrames>s.minMbLowQualFrames&&(s.motionBlurPxRatio=s.mbPxRBlurry)),s.clearingMotionBlur&&(s.motionBlurPxRatio=1),s.textureDrawLastFrame&&!f&&(d[s.NODE]=!0,d[s.SELECT_BOX]=!0);var b=u.style(),w=u.zoom(),C=a!==void 0?a:w,E=u.pan(),x={x:E.x,y:E.y},k={zoom:w,pan:{x:E.x,y:E.y}},B=s.prevViewport,S=B===void 0||k.zoom!==B.zoom||k.pan.x!==B.pan.x||k.pan.y!==B.pan.y;!S&&!(g&&!p)&&(s.motionBlurPxRatio=1),i&&(x=i),C*=l,x.x*=l,x.y*=l;var N=s.getCachedZSortedEles();function D(re,se,ue,pe,de){var me=re.globalCompositeOperation;re.globalCompositeOperation="destination-out",s.colorFillStyle(re,255,255,255,s.motionBlurTransparency),re.fillRect(se,ue,pe,de),re.globalCompositeOperation=me}function _(re,se){var ue,pe,de,me;!s.clearingMotionBlur&&(re===c.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]||re===c.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG])?(ue={x:E.x*v,y:E.y*v},pe=w*v,de=s.canvasWidth*v,me=s.canvasHeight*v):(ue=x,pe=C,de=s.canvasWidth,me=s.canvasHeight),re.setTransform(1,0,0,1,0,0),se==="motionBlur"?D(re,0,0,de,me):!e&&(se===void 0||se)&&re.clearRect(0,0,de,me),n||(re.translate(ue.x,ue.y),re.scale(pe,pe)),i&&re.translate(i.x,i.y),a&&re.scale(a,a)}if(f||(s.textureDrawLastFrame=!1),f){if(s.textureDrawLastFrame=!0,!s.textureCache){s.textureCache={},s.textureCache.bb=u.mutableElements().boundingBox(),s.textureCache.texture=s.data.bufferCanvases[s.TEXTURE_BUFFER];var O=s.data.bufferContexts[s.TEXTURE_BUFFER];O.setTransform(1,0,0,1,0,0),O.clearRect(0,0,s.canvasWidth*s.textureMult,s.canvasHeight*s.textureMult),s.render({forcedContext:O,drawOnlyNodeLayer:!0,forcedPxRatio:l*s.textureMult});var k=s.textureCache.viewport={zoom:u.zoom(),pan:u.pan(),width:s.canvasWidth,height:s.canvasHeight};k.mpan={x:(0-k.pan.x)/k.zoom,y:(0-k.pan.y)/k.zoom}}d[s.DRAG]=!1,d[s.NODE]=!1;var P=c.contexts[s.NODE],F=s.textureCache.texture,k=s.textureCache.viewport;P.setTransform(1,0,0,1,0,0),h?D(P,0,0,k.width,k.height):P.clearRect(0,0,k.width,k.height);var I=b.core("outside-texture-bg-color").value,M=b.core("outside-texture-bg-opacity").value;s.colorFillStyle(P,I[0],I[1],I[2],M),P.fillRect(0,0,k.width,k.height);var w=u.zoom();_(P,!1),P.clearRect(k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l),P.drawImage(F,k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l)}else s.textureOnViewport&&!e&&(s.textureCache=null);var L=u.extent(),V=s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming||s.hoverData.draggingEles||s.cy.animated(),H=s.hideEdgesOnViewport&&V,$=[];if($[s.NODE]=!d[s.NODE]&&h&&!s.clearedForMotionBlur[s.NODE]||s.clearingMotionBlur,$[s.NODE]&&(s.clearedForMotionBlur[s.NODE]=!0),$[s.DRAG]=!d[s.DRAG]&&h&&!s.clearedForMotionBlur[s.DRAG]||s.clearingMotionBlur,$[s.DRAG]&&(s.clearedForMotionBlur[s.DRAG]=!0),d[s.NODE]||n||r||$[s.NODE]){var z=h&&!$[s.NODE]&&v!==1,P=e||(z?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]:c.contexts[s.NODE]),j=h&&!z?"motionBlur":void 0;_(P,j),H?s.drawCachedNodes(P,N.nondrag,l,L):s.drawLayeredElements(P,N.nondrag,l,L),s.debug&&s.drawDebugPoints(P,N.nondrag),!n&&!h&&(d[s.NODE]=!1)}if(!r&&(d[s.DRAG]||n||$[s.DRAG])){var z=h&&!$[s.DRAG]&&v!==1,P=e||(z?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG]:c.contexts[s.DRAG]);_(P,h&&!z?"motionBlur":void 0),H?s.drawCachedNodes(P,N.drag,l,L):s.drawCachedElements(P,N.drag,l,L),s.debug&&s.drawDebugPoints(P,N.drag),!n&&!h&&(d[s.DRAG]=!1)}if(s.showFps||!r&&d[s.SELECT_BOX]&&!n){var P=e||c.contexts[s.SELECT_BOX];if(_(P),s.selection[4]==1&&(s.hoverData.selecting||s.touchData.selecting)){var w=s.cy.zoom(),ee=b.core("selection-box-border-width").value/w;P.lineWidth=ee,P.fillStyle="rgba("+b.core("selection-box-color").value[0]+","+b.core("selection-box-color").value[1]+","+b.core("selection-box-color").value[2]+","+b.core("selection-box-opacity").value+")",P.fillRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]),ee>0&&(P.strokeStyle="rgba("+b.core("selection-box-border-color").value[0]+","+b.core("selection-box-border-color").value[1]+","+b.core("selection-box-border-color").value[2]+","+b.core("selection-box-opacity").value+")",P.strokeRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]))}if(c.bgActivePosistion&&!s.hoverData.selecting){var w=s.cy.zoom(),J=c.bgActivePosistion;P.fillStyle="rgba("+b.core("active-bg-color").value[0]+","+b.core("active-bg-color").value[1]+","+b.core("active-bg-color").value[2]+","+b.core("active-bg-opacity").value+")",P.beginPath(),P.arc(J.x,J.y,b.core("active-bg-size").pfValue/w,0,2*Math.PI),P.fill()}var X=s.lastRedrawTime;if(s.showFps&&X){X=Math.round(X);var ne=Math.round(1e3/X);P.setTransform(1,0,0,1,0,0),P.fillStyle="rgba(255, 0, 0, 0.75)",P.strokeStyle="rgba(255, 0, 0, 0.75)",P.lineWidth=1,P.fillText("1 frame = "+X+" ms = "+ne+" fps",0,20);var Y=60;P.strokeRect(0,30,250,20),P.fillRect(0,30,250*Math.min(ne/Y,1),20)}n||(d[s.SELECT_BOX]=!1)}if(h&&v!==1){var A=c.contexts[s.NODE],K=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_NODE],W=c.contexts[s.DRAG],oe=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_DRAG],he=function(se,ue,pe){se.setTransform(1,0,0,1,0,0),pe||!m?se.clearRect(0,0,s.canvasWidth,s.canvasHeight):D(se,0,0,s.canvasWidth,s.canvasHeight);var de=v;se.drawImage(ue,0,0,s.canvasWidth*de,s.canvasHeight*de,0,0,s.canvasWidth,s.canvasHeight)};(d[s.NODE]||$[s.NODE])&&(he(A,K,$[s.NODE]),d[s.NODE]=!1),(d[s.DRAG]||$[s.DRAG])&&(he(W,oe,$[s.DRAG]),d[s.DRAG]=!1)}s.prevViewport=k,s.clearingMotionBlur&&(s.clearingMotionBlur=!1,s.motionBlurCleared=!0,s.motionBlur=!0),h&&(s.motionBlurTimeout=setTimeout(function(){s.motionBlurTimeout=null,s.clearedForMotionBlur[s.NODE]=!1,s.clearedForMotionBlur[s.DRAG]=!1,s.motionBlur=!1,s.clearingMotionBlur=!f,s.mbFrames=0,d[s.NODE]=!0,d[s.DRAG]=!0,s.redraw()},v_)),e||u.emit("render")};var gr={};gr.drawPolygonPath=function(t,e,n,r,a,i){var s=r/2,l=a/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*i[0],n+l*i[1]);for(var u=1;u<i.length/2;u++)t.lineTo(e+s*i[u*2],n+l*i[u*2+1]);t.closePath()},gr.drawRoundPolygonPath=function(t,e,n,r,a,i,s){s.forEach(function(l){return ov(t,l)}),t.closePath()},gr.drawRoundRectanglePath=function(t,e,n,r,a,i){var s=r/2,l=a/2,u=i==="auto"?Rr(r,a):Math.min(i,l,s);t.beginPath&&t.beginPath(),t.moveTo(e,n-l),t.arcTo(e+s,n-l,e+s,n,u),t.arcTo(e+s,n+l,e,n+l,u),t.arcTo(e-s,n+l,e-s,n,u),t.arcTo(e-s,n-l,e,n-l,u),t.lineTo(e,n-l),t.closePath()},gr.drawBottomRoundRectanglePath=function(t,e,n,r,a,i){var s=r/2,l=a/2,u=i==="auto"?Rr(r,a):i;t.beginPath&&t.beginPath(),t.moveTo(e,n-l),t.lineTo(e+s,n-l),t.lineTo(e+s,n),t.arcTo(e+s,n+l,e,n+l,u),t.arcTo(e-s,n+l,e-s,n,u),t.lineTo(e-s,n-l),t.lineTo(e,n-l),t.closePath()},gr.drawCutRectanglePath=function(t,e,n,r,a,i,s){var l=r/2,u=a/2,c=s==="auto"?tc():s;t.beginPath&&t.beginPath(),t.moveTo(e-l+c,n-u),t.lineTo(e+l-c,n-u),t.lineTo(e+l,n-u+c),t.lineTo(e+l,n+u-c),t.lineTo(e+l-c,n+u),t.lineTo(e-l+c,n+u),t.lineTo(e-l,n+u-c),t.lineTo(e-l,n-u+c),t.closePath()},gr.drawBarrelPath=function(t,e,n,r,a){var i=r/2,s=a/2,l=e-i,u=e+i,c=n-s,d=n+s,f=nc(r,a),h=f.widthOffset,v=f.heightOffset,p=f.ctrlPtOffsetPct*h;t.beginPath&&t.beginPath(),t.moveTo(l,c+v),t.lineTo(l,d-v),t.quadraticCurveTo(l+p,d,l+h,d),t.lineTo(u-h,d),t.quadraticCurveTo(u-p,d,u,d-v),t.lineTo(u,c+v),t.quadraticCurveTo(u-p,c,u-h,c),t.lineTo(l+h,c),t.quadraticCurveTo(l+p,c,l,c+v),t.closePath()};for(var Bv=Math.sin(0),Nv=Math.cos(0),Ac={},Vc={},Dv=Math.PI/40,za=0*Math.PI;za<2*Math.PI;za+=Dv)Ac[za]=Math.sin(za),Vc[za]=Math.cos(za);gr.drawEllipsePath=function(t,e,n,r,a){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,n,r/2,a/2,0,0,2*Math.PI);else for(var i,s,l=r/2,u=a/2,c=0*Math.PI;c<2*Math.PI;c+=Dv)i=e-l*Ac[c]*Bv+l*Vc[c]*Nv,s=n+u*Vc[c]*Bv+u*Ac[c]*Nv,c===0?t.moveTo(i,s):t.lineTo(i,s);t.closePath()};var ji={};ji.createBuffer=function(t,e){var n=document.createElement("canvas");return n.width=t,n.height=e,[n,n.getContext("2d")]},ji.bufferCanvasImage=function(t){var e=this.cy,n=e.mutableElements(),r=n.boundingBox(),a=this.findContainerClientCoords(),i=t.full?Math.ceil(r.w):a[2],s=t.full?Math.ceil(r.h):a[3],l=le(t.maxWidth)||le(t.maxHeight),u=this.getPixelRatio(),c=1;if(t.scale!==void 0)i*=t.scale,s*=t.scale,c=t.scale;else if(l){var d=1/0,f=1/0;le(t.maxWidth)&&(d=c*t.maxWidth/i),le(t.maxHeight)&&(f=c*t.maxHeight/s),c=Math.min(d,f),i*=c,s*=c}l||(i*=u,s*=u,c*=u);var h=document.createElement("canvas");h.width=i,h.height=s,h.style.width=i+"px",h.style.height=s+"px";var v=h.getContext("2d");if(i>0&&s>0){v.clearRect(0,0,i,s),v.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(t.full)v.translate(-r.x1*c,-r.y1*c),v.scale(c,c),this.drawElements(v,p),v.scale(1/c,1/c),v.translate(r.x1*c,r.y1*c);else{var g=e.pan(),y={x:g.x*c,y:g.y*c};c*=e.zoom(),v.translate(y.x,y.y),v.scale(c,c),this.drawElements(v,p),v.scale(1/c,1/c),v.translate(-y.x,-y.y)}t.bg&&(v.globalCompositeOperation="destination-over",v.fillStyle=t.bg,v.rect(0,0,i,s),v.fill())}return h};function g_(t,e){for(var n=atob(t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return new Blob([r],{type:e})}function _v(t){var e=t.indexOf(",");return t.substr(e+1)}function Pv(t,e,n){var r=function(){return e.toDataURL(n,t.quality)};switch(t.output){case"blob-promise":return new Ea(function(a,i){try{e.toBlob(function(s){s!=null?a(s):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},n,t.quality)}catch(s){i(s)}});case"blob":return g_(_v(r()),n);case"base64":return _v(r());case"base64uri":default:return r()}}ji.png=function(t){return Pv(t,this.bufferCanvasImage(t),"image/png")},ji.jpg=function(t){return Pv(t,this.bufferCanvasImage(t),"image/jpeg")};var Iv={};Iv.nodeShapeImpl=function(t,e,n,r,a,i,s,l){switch(t){case"ellipse":return this.drawEllipsePath(e,n,r,a,i);case"polygon":return this.drawPolygonPath(e,n,r,a,i,s);case"round-polygon":return this.drawRoundPolygonPath(e,n,r,a,i,s,l);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,n,r,a,i,l);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,n,r,a,i,s,l);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,n,r,a,i,l);case"barrel":return this.drawBarrelPath(e,n,r,a,i)}};var m_=Ov,Me=Ov.prototype;Me.CANVAS_LAYERS=3,Me.SELECT_BOX=0,Me.DRAG=1,Me.NODE=2,Me.BUFFER_COUNT=3,Me.TEXTURE_BUFFER=0,Me.MOTIONBLUR_BUFFER_NODE=1,Me.MOTIONBLUR_BUFFER_DRAG=2;function Ov(t){var e=this,n=e.cy.window(),r=n.document;e.data={canvases:new Array(Me.CANVAS_LAYERS),contexts:new Array(Me.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Me.CANVAS_LAYERS),bufferCanvases:new Array(Me.BUFFER_COUNT),bufferContexts:new Array(Me.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=r.createElement("div");var s=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,s.position="relative",s.zIndex="0",s.overflow="hidden";var l=t.cy.container();l.appendChild(e.data.canvasContainer),l.style[a]=i;var u={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};aS()&&(u["-ms-touch-action"]="none",u["touch-action"]="none");for(var c=0;c<Me.CANVAS_LAYERS;c++){var d=e.data.canvases[c]=r.createElement("canvas");e.data.contexts[c]=d.getContext("2d"),Object.keys(u).forEach(function(Y){d.style[Y]=u[Y]}),d.style.position="absolute",d.setAttribute("data-id","layer"+c),d.style.zIndex=String(Me.CANVAS_LAYERS-c),e.data.canvasContainer.appendChild(d),e.data.canvasNeedsRedraw[c]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Me.NODE].setAttribute("data-id","layer"+Me.NODE+"-node"),e.data.canvases[Me.SELECT_BOX].setAttribute("data-id","layer"+Me.SELECT_BOX+"-selectbox"),e.data.canvases[Me.DRAG].setAttribute("data-id","layer"+Me.DRAG+"-drag");for(var c=0;c<Me.BUFFER_COUNT;c++)e.data.bufferCanvases[c]=r.createElement("canvas"),e.data.bufferContexts[c]=e.data.bufferCanvases[c].getContext("2d"),e.data.bufferCanvases[c].style.position="absolute",e.data.bufferCanvases[c].setAttribute("data-id","buffer"+c),e.data.bufferCanvases[c].style.zIndex=String(-c-1),e.data.bufferCanvases[c].style.visibility="hidden";e.pathsEnabled=!0;var f=zt(),h=function(A){return{x:(A.x1+A.x2)/2,y:(A.y1+A.y2)/2}},v=function(A){return{x:-A.w/2,y:-A.h/2}},p=function(A){var K=A[0]._private,W=K.oldBackgroundTimestamp===K.backgroundTimestamp;return!W},g=function(A){return A[0]._private.nodeKey},y=function(A){return A[0]._private.labelStyleKey},m=function(A){return A[0]._private.sourceLabelStyleKey},b=function(A){return A[0]._private.targetLabelStyleKey},w=function(A,K,W,oe,he){return e.drawElement(A,K,W,!1,!1,he)},C=function(A,K,W,oe,he){return e.drawElementText(A,K,W,oe,"main",he)},E=function(A,K,W,oe,he){return e.drawElementText(A,K,W,oe,"source",he)},x=function(A,K,W,oe,he){return e.drawElementText(A,K,W,oe,"target",he)},k=function(A){return A.boundingBox(),A[0]._private.bodyBounds},B=function(A){return A.boundingBox(),A[0]._private.labelBounds.main||f},S=function(A){return A.boundingBox(),A[0]._private.labelBounds.source||f},N=function(A){return A.boundingBox(),A[0]._private.labelBounds.target||f},D=function(A,K){return K},_=function(A){return h(k(A))},O=function(A,K,W){var oe=A?A+"-":"";return{x:K.x+W.pstyle(oe+"text-margin-x").pfValue,y:K.y+W.pstyle(oe+"text-margin-y").pfValue}},P=function(A,K,W){var oe=A[0]._private.rscratch;return{x:oe[K],y:oe[W]}},F=function(A){return O("",P(A,"labelX","labelY"),A)},I=function(A){return O("source",P(A,"sourceLabelX","sourceLabelY"),A)},M=function(A){return O("target",P(A,"targetLabelX","targetLabelY"),A)},L=function(A){return v(k(A))},V=function(A){return v(S(A))},H=function(A){return v(N(A))},$=function(A){var K=B(A),W=v(B(A));if(A.isNode()){switch(A.pstyle("text-halign").value){case"left":W.x=-K.w;break;case"right":W.x=0;break}switch(A.pstyle("text-valign").value){case"top":W.y=-K.h;break;case"bottom":W.y=0;break}}return W},z=e.data.eleTxrCache=new Gi(e,{getKey:g,doesEleInvalidateKey:p,drawElement:w,getBoundingBox:k,getRotationPoint:_,getRotationOffset:L,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),j=e.data.lblTxrCache=new Gi(e,{getKey:y,drawElement:C,getBoundingBox:B,getRotationPoint:F,getRotationOffset:$,isVisible:D}),ee=e.data.slbTxrCache=new Gi(e,{getKey:m,drawElement:E,getBoundingBox:S,getRotationPoint:I,getRotationOffset:V,isVisible:D}),J=e.data.tlbTxrCache=new Gi(e,{getKey:b,drawElement:x,getBoundingBox:N,getRotationPoint:M,getRotationOffset:H,isVisible:D}),X=e.data.lyrTxrCache=new wv(e);e.onUpdateEleCalcs(function(A,K){z.invalidateElements(K),j.invalidateElements(K),ee.invalidateElements(K),J.invalidateElements(K),X.invalidateElements(K);for(var W=0;W<K.length;W++){var oe=K[W]._private;oe.oldBackgroundTimestamp=oe.backgroundTimestamp}});var ne=function(A){for(var K=0;K<A.length;K++)X.enqueueElementRefinement(A[K].ele)};z.onDequeue(ne),j.onDequeue(ne),ee.onDequeue(ne),J.onDequeue(ne)}Me.redrawHint=function(t,e){var n=this;switch(t){case"eles":n.data.canvasNeedsRedraw[Me.NODE]=e;break;case"drag":n.data.canvasNeedsRedraw[Me.DRAG]=e;break;case"select":n.data.canvasNeedsRedraw[Me.SELECT_BOX]=e;break}};var y_=typeof Path2D<"u";Me.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t},Me.usePaths=function(){return y_&&this.pathsEnabled},Me.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)},Me.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled},Me.makeOffscreenCanvas=function(t,e){var n;if((typeof OffscreenCanvas>"u"?"undefined":st(OffscreenCanvas))!=="undefined")n=new OffscreenCanvas(t,e);else{var r=this.cy.window(),a=r.document;n=a.createElement("canvas"),n.width=t,n.height=e}return n},[kv,Nn,qn,Mc,Wr,$a,Wt,gr,ji,Iv].forEach(function(t){xe(Me,t)});var b_=[{name:"null",impl:Xp},{name:"base",impl:gv},{name:"canvas",impl:m_}],w_=[{type:"layout",extensions:T4},{type:"renderer",extensions:b_}],Lv={},Mv={};function Fv(t,e,n){var r=n,a=function(B){Ve("Can not register `"+e+"` for `"+t+"` since `"+B+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(Ki.prototype[e])return a(e);Ki.prototype[e]=n}else if(t==="collection"){if(kt.prototype[e])return a(e);kt.prototype[e]=n}else if(t==="layout"){for(var i=function(B){this.options=B,n.call(this,B),Ie(this._private)||(this._private={}),this._private.cy=B.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(n.prototype),l=[],u=0;u<l.length;u++){var c=l[u];s[c]=s[c]||function(){return this}}s.start&&!s.run?s.run=function(){return this.start(),this}:!s.start&&s.run&&(s.start=function(){return this.run(),this});var d=n.prototype.stop;s.stop=function(){var k=this.options;if(k&&k.animate){var B=this.animations;if(B)for(var S=0;S<B.length;S++)B[S].stop()}return d?d.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var f=function(B){return B._private.cy},h={addEventFields:function(B,S){S.layout=B,S.cy=f(B),S.target=B},bubble:function(){return!0},parent:function(B){return f(B)}};xe(s,{createEmitter:function(){return this._private.emitter=new ss(h,this),this},emitter:function(){return this._private.emitter},on:function(B,S){return this.emitter().on(B,S),this},one:function(B,S){return this.emitter().one(B,S),this},once:function(B,S){return this.emitter().one(B,S),this},removeListener:function(B,S){return this.emitter().removeListener(B,S),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(B,S){return this.emitter().emit(B,S),this}}),Re.eventAliasesOn(s),r=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var v=Av("renderer","base"),p=v.prototype,g=n,y=n.prototype,m=function(){v.apply(this,arguments),g.apply(this,arguments)},b=m.prototype;for(var w in p){var C=p[w],E=y[w]!=null;if(E)return a(w);b[w]=C}for(var x in y)b[x]=y[x];p.clientFunctions.forEach(function(k){b[k]=b[k]||function(){Ze("Renderer does not implement `renderer."+k+"()` on its prototype")}}),r=m}else if(t==="__proto__"||t==="constructor"||t==="prototype")return Ze(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return Qf({map:Lv,keys:[t,e],value:r})}function Av(t,e){return Jf({map:Lv,keys:[t,e]})}function C_(t,e,n,r,a){return Qf({map:Mv,keys:[t,e,n,r],value:a})}function k_(t,e,n,r){return Jf({map:Mv,keys:[t,e,n,r]})}var Rc=function(){if(arguments.length===2)return Av.apply(null,arguments);if(arguments.length===3)return Fv.apply(null,arguments);if(arguments.length===4)return k_.apply(null,arguments);if(arguments.length===5)return C_.apply(null,arguments);Ze("Invalid extension access syntax")};Ki.prototype.extension=Rc,w_.forEach(function(t){t.extensions.forEach(function(e){Fv(t.type,e.name,e.impl)})});var Vv=function t(){if(!(this instanceof t))return new t;this.length=0},jr=Vv.prototype;jr.instanceString=function(){return"stylesheet"},jr.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this},jr.css=function(t,e){var n=this.length-1;if(be(t))this[n].properties.push({name:t,value:e});else if(Ie(t))for(var r=t,a=Object.keys(r),i=0;i<a.length;i++){var s=a[i],l=r[s];if(l!=null){var u=Nt.properties[s]||Nt.properties[Mo(s)];if(u!=null){var c=u.name,d=l;this[n].properties.push({name:c,value:d})}}}return this},jr.style=jr.css,jr.generateStyle=function(t){var e=new Nt(t);return this.appendToStyle(e)},jr.appendToStyle=function(t){for(var e=0;e<this.length;e++){var n=this[e],r=n.selector,a=n.properties;t.selector(r);for(var i=0;i<a.length;i++){var s=a[i];t.css(s.name,s.value)}}return t};var x_="3.30.2",Yr=function(e){if(e===void 0&&(e={}),Ie(e))return new Ki(e);if(be(e))return Rc.apply(Rc,arguments)};Yr.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Yr),t.apply(null,e),this},Yr.warnings=function(t){return fh(t)},Yr.version=x_,Yr.stylesheet=Yr.Stylesheet=Vv;const Rv=function(t,e){if(!t||!e)return!1;let n=JSON.stringify(t),r=JSON.stringify(e);return n.indexOf(r)!==-1},E_=function(t){return t?[...new Set(t.map(e=>JSON.stringify(e)))].map(e=>JSON.parse(e)):[]},S_=function(t,e,n){let r=t.connectivity.flat(),a=E_(r),i=[],s=!1;return a.forEach(l=>{s=!1,Rv(e,l)&&(s=!0),Rv(n,l)&&(s=!0),s||i.push(l)}),i};let T_=class extends EventTarget{constructor(n,r){super();on(this,"cyg",null);on(this,"nodes",[]);on(this,"edges",[]);on(this,"axons",[]);on(this,"dendrites",[]);on(this,"somas",[]);on(this,"labelCache",new Map);on(this,"graphCanvas",null);on(this,"hasPhenotypes",!1);this.labelCache=n,this.graphCanvas=r}async addConnectivity(n){var r;if(n&&n["node-phenotypes"]){const a=["ilxtr:hasSomaLocatedIn"],i=["ilxtr:hasAxonPresynapticElementIn","ilxtr:hasAxonSensorySubcellularElementIn"],s=[],l=[];a.forEach(c=>{s.push(...n["node-phenotypes"][c])}),i.forEach(c=>{l.push(...n["node-phenotypes"][c])});const u=S_(n,s,l);this.dendrites=s.map(c=>JSON.stringify(c)),this.axons=l.map(c=>JSON.stringify(c)),u!=null&&u.length&&(this.somas=u.map(c=>JSON.stringify(c))),this.hasPhenotypes=!0}else this.axons=n.axons.map(a=>JSON.stringify(a)),this.dendrites=n.dendrites.map(a=>JSON.stringify(a)),(r=n.somas)!=null&&r.length&&(this.somas=n.somas.map(a=>JSON.stringify(a))),this.hasPhenotypes=!1;if(n.connectivity.length)for(const a of n.connectivity){const i=await this.graphNode(a[0]),s=await this.graphNode(a[1]);this.nodes.push(i),this.nodes.push(s),this.edges.push({id:`${i.id}_${s.id}`,source:i.id,target:s.id})}else this.nodes.push({id:"MISSING",label:"NO PATHS"})}showConnectivity(n){this.cyg=new __(this,n),this.cyg.on("tap-node",r=>{const a=new CustomEvent("tap-node",{detail:r.detail});this.dispatchEvent(a)})}selectConnectivity(n){var r;if((r=this.cyg)!=null&&r.cy){let a="";this.cyg.cy.elements().forEach(i=>{const s=i.data("label"),l=$c(s);D_(n,l)&&(a=i.id())}),a&&this.cyg.cy.$id(a).select()}}clearConnectivity(){var n;(n=this.cyg)!=null&&n.cy&&(this.cyg.cy.remove(),this.cyg.cy=null)}reset(){var n;(n=this.cyg)!=null&&n.cy&&this.cyg.cy.reset()}zoom(n){var r;if((r=this.cyg)!=null&&r.cy){const a=this.cyg.cy.zoom(),i=this.cyg.cy.width(),s=this.cyg.cy.height(),l={x:i/2,y:s/2};this.cyg.cy.zoom({level:a+n,renderedPosition:l})}}enableZoom(n){var r;(r=this.cyg)!=null&&r.cy&&this.cyg.cy.userZoomingEnabled(n)}get elements(){return[...this.nodes.map(n=>({data:n})),...this.edges.map(n=>({data:n}))]}get roots(){return this.hasPhenotypes?[...this.dendrites]:[...this.dendrites,...this.somas]}async graphNode(n){const r=JSON.stringify(n),a=[n[0],...n[1]],i=[];for(const l of a){const u=this.labelCache.has(l)?this.labelCache.get(l):"";i.push(u)}a.push(...i);const s={id:r,label:a.join(`
|
|
45
|
+
`)};return this.hasPhenotypes?this.axons.includes(r)?s.axon=!0:this.dendrites.includes(r)?s.dendrite=!0:s.somas=!0:this.axons.includes(r)?this.dendrites.includes(r)||this.somas.includes(r)?s.somas=!0:s.axon=!0:(this.dendrites.includes(r)||this.somas.includes(r))&&(s.dendrite=!0),s}on(n,r){this.addEventListener(n,r)}};const B_=[{selector:"node",style:{label:function(t){return N_(t.data("label"))},"background-color":"transparent","background-opacity":"0","text-valign":"center","text-wrap":"wrap",width:"80px",height:"80px","text-max-width":"80px","font-size":"6px",shape:"round-rectangle","border-width":1,"border-style":"solid","border-color":"gray"}},{selector:"node[axon]",style:{shape:"round-diamond",width:"100px",height:"100px"}},{selector:"node[dendrite]",style:{shape:"ellipse"}},{selector:"node[somas]",style:{shape:"round-rectangle"}},{selector:"edge",style:{width:1,"line-color":"dimgray","curve-style":"bezier"}},{selector:"node.active",style:{"border-color":"#8300bf","background-color":"#f3ecf6","background-opacity":.75}}];function N_(t){const e=t.split(`
|
|
46
46
|
`),n=e.length/2,r=e.slice(n);return $v(r.join(`
|
|
47
47
|
`))}function $v(t){return t.split(`
|
|
48
48
|
`).map(e=>e&&e[0]>="a"&&e[0]<="z"?e.charAt(0).toUpperCase()+e.slice(1):e).join(`
|
|
49
49
|
`)}function $c(t){const e=t?t.split(`
|
|
50
|
-
`):[],n=[];for(let r=0;r<e.length/2;r++)n.push({id:e[r],label:e[r+e.length/2]});return n}function
|
|
51
|
-
`)),this.tooltip.style.left=`${n.renderedPosition.x}px`,this.tooltip.style.top=`${n.renderedPosition.y}px`,this.tooltip.style.maxWidth="240px",this.tooltip.style.zIndex=2,this.tooltip.hidden=!1,this.checkRightBoundary(n.renderedPosition.x),this.tapNode(n,!0)}moveNode(n){const r=n.target;this.tooltip.style.left=`${r.renderedPosition().x}px`,this.tooltip.style.top=`${r.renderedPosition().y}px`,this.checkRightBoundary(r.renderedPosition().x)}exitNode(n){this.tooltip.hidden=!0,this.tapNode(n,!1)}tapNode(n,r){const a=n.target,i=a.data();let{label:s}=i;r?a.addClass("active"):(a.removeClass("active"),s="",setTimeout(()=>{a.unselect()}));const l=$c(s),u=new CustomEvent("tap-node",{detail:l});this.dispatchEvent(u)}on(n,r){this.addEventListener(n,r)}}const
|
|
50
|
+
`):[],n=[];for(let r=0;r<e.length/2;r++)n.push({id:e[r],label:e[r+e.length/2]});return n}function D_(t,e){t.sort((n,r)=>n.id<r.id?-1:n.id>r.id?1:0),e.sort((n,r)=>n.id<r.id?-1:n.id>r.id?1:0);for(let n=0;n<t.length;n++)if(JSON.stringify(t[n])!==JSON.stringify(e[n]))return!1;return!0}class __ extends EventTarget{constructor(n,r){var a;super();on(this,"cy");on(this,"tooltip");this.cy=Yr({container:r,elements:n.elements,layout:{name:"breadthfirst",circle:!1,roots:n.roots},directed:!0,style:B_,minZoom:.1,maxZoom:10,wheelSensitivity:.4}).on("mouseover","node",this.overNode.bind(this)).on("mouseout","node",this.exitNode.bind(this)).on("position","node",this.moveNode.bind(this)),this.tooltip=document.createElement("div"),this.tooltip.className="cy-graph-tooltip",this.tooltip.hidden=!0,(a=r==null?void 0:r.lastChild)==null||a.appendChild(this.tooltip)}remove(){this.cy&&this.cy.destroy()}checkRightBoundary(n){var r;n+this.tooltip.offsetWidth>=((r=this.tooltip.parentElement)==null?void 0:r.offsetWidth)&&(this.tooltip.style.left=`${n-this.tooltip.offsetWidth}px`)}overNode(n){const a=n.target.data(),{label:i}=a,l=$c(i).map(u=>u.label+" ("+u.id+")");this.tooltip.innerText=$v(l.join(`
|
|
51
|
+
`)),this.tooltip.style.left=`${n.renderedPosition.x}px`,this.tooltip.style.top=`${n.renderedPosition.y}px`,this.tooltip.style.maxWidth="240px",this.tooltip.style.zIndex=2,this.tooltip.hidden=!1,this.checkRightBoundary(n.renderedPosition.x),this.tapNode(n,!0)}moveNode(n){const r=n.target;this.tooltip.style.left=`${r.renderedPosition().x}px`,this.tooltip.style.top=`${r.renderedPosition().y}px`,this.checkRightBoundary(r.renderedPosition().x)}exitNode(n){this.tooltip.hidden=!0,this.tapNode(n,!1)}tapNode(n,r){const a=n.target,i=a.data();let{label:s}=i;r?a.addClass("active"):(a.removeClass("active"),s="",setTimeout(()=>{a.unselect()}));const l=$c(s),u=new CustomEvent("tap-node",{detail:l});this.dispatchEvent(u)}on(n,r){this.addEventListener(n,r)}}const P_=1.3,I_=24*60*60*1e3,O_="Reset position",zv="Lock zoom",L_="Unlock zoom",M_="Zoom in",F_="Zoom out",Hv=.25,A_="#8300bf",V_=3e3,R_={name:"ConnectivityGraph",props:{entry:{type:String,default:""},mapServer:{type:String,default:""},sckanVersion:{type:String,default:""},selectedConnectivityData:{type:Array,default:[]},connectivityFromMap:{type:Object,default:()=>null}},data:function(){return{loading:!0,loadingError:"",connectivityGraph:null,selectedSource:"",availableSources:[],pathList:[],schemaVersion:"",knowledgeByPath:new Map,labelledTerms:new Set,labelCache:new Map,resetLabel:O_,zoomLockLabel:zv,zoomInLabel:M_,zoomOutLabel:F_,iconColor:A_,zoomEnabled:!1,connectivityError:null,timeoutID:void 0,connectivityGraphContainer:null}},watch:{connectivityFromMap:function(t,e){t!=e&&(this.showSpinner(),this.start())}},mounted(){this.showSpinner(),this.updateTooltipContainer(),this.refreshCache(),this.loadCacheData(),this.start()},methods:{updateTooltipContainer:function(){this.connectivityGraphContainer=this.$refs.connectivityGraphRef},loadCacheData:function(){const t=sessionStorage.getItem("connectivity-graph-sources"),e=sessionStorage.getItem("connectivity-graph-labels"),n=sessionStorage.getItem("connectivity-graph-pathlist"),r=sessionStorage.getItem("connectivity-graph-schema-version");if(this.sckanVersion&&(this.selectedSource=this.sckanVersion),sessionStorage.setItem("connectivity-graph-selected-source",this.selectedSource),this.updateCacheExpiry(),t&&(this.availableSources=JSON.parse(t)),n&&(this.pathList=JSON.parse(n)),e){const a=JSON.parse(e);this.labelCache=new Map(Object.entries(a))}r&&(this.schemaVersion=r)},isValidKnowledgeSource:function(){const t=sessionStorage.getItem("connectivity-graph-selected-source");return!(this.sckanVersion&&this.sckanVersion!==t)},removeAllCacheData:function(){["connectivity-graph-expiry","connectivity-graph-selected-source","connectivity-graph-source","connectivity-graph-sources","connectivity-graph-labels","connectivity-graph-pathlist","connectivity-graph-schema-version"].forEach(e=>{sessionStorage.removeItem(e)})},refreshCache:function(){const t=sessionStorage.getItem("connectivity-graph-expiry"),e=new Date,n=this.isValidKnowledgeSource();(e.getTime()>t||!n)&&this.removeAllCacheData()},updateCacheExpiry:function(){const e=new Date().getTime()+I_;sessionStorage.setItem("connectivity-graph-expiry",e)},start:function(){this.run().then(t=>{t!=null&&t.success?this.showGraph(this.entry):t!=null&&t.error?this.loadingError=t.error:this.loadingError="Loading error!"}).catch(t=>{this.loadingError="Loading error!",this.hideSpinner()})},run:async function(){return this.schemaVersion||(this.schemaVersion=await this.getSchemaVersion(),sessionStorage.setItem("connectivity-graph-schema-version",this.schemaVersion),this.updateCacheExpiry()),this.schemaVersion<P_?{error:`No server available for schema-version ${this.schemaVersion}.`}:(this.availableSources.length||(this.availableSources=await this.loadAvailableSources()),this.isSCKANVersionAvailable()?(await this.setPathList(this.selectedSource),{success:!0}):{error:`No data available for SCKAN version ${this.selectedSource}.`})},showGraph:async function(t){const e=this.$refs.graphCanvas;this.connectivityFromMap&&(this.cacheLabels(this.connectivityFromMap),await this.getCachedTermLabels()),this.connectivityGraph=new T_(this.labelCache,e);const n=this.knowledgeByPath.get(t);this.connectivityFromMap&&(n.axons=this.connectivityFromMap.axons,n.connectivity=this.connectivityFromMap.connectivity,n.dendrites=this.connectivityFromMap.dendrites,n.somas=this.connectivityFromMap.somas),await this.connectivityGraph.addConnectivity(n),this.connectivityGraph.showConnectivity(e),this.selectedConnectivityData.length&&this.connectivityGraph.selectConnectivity(this.selectedConnectivityData),this.connectivityGraph.on("tap-node",r=>{const a=r.detail;this.$emit("tap-node",a)}),this.hideSpinner()},query:async function(t,e){const n=`${this.mapServer}knowledge/query/`,r={sql:t,params:e};try{const a=await fetch(n,{method:"POST",headers:{Accept:"application/json; charset=utf-8","Cache-Control":"no-store","Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Error(`Cannot access ${n}`);return await a.json()}catch{return{values:[]}}},isSCKANVersionAvailable:function(){return this.availableSources.includes(this.selectedSource)},loadAvailableSources:async function(){const t=await this.getJsonData(`${this.mapServer}knowledge/sources`),n=(t?t.sources||[]:[]).filter(r=>r);return sessionStorage.setItem("connectivity-graph-sources",JSON.stringify(n)),this.updateCacheExpiry(),n},loadPathData:async function(t){const e=await this.query(`select entity, knowledge from knowledge
|
|
52
52
|
where entity like 'ilxtr:%' and source=?
|
|
53
53
|
order by entity`,[t]);return e?e.values:[]},setPathList:async function(t){this.pathList.length||(this.pathList=await this.loadPathData(t),sessionStorage.setItem("connectivity-graph-pathlist",JSON.stringify(this.pathList)),this.updateCacheExpiry()),this.knowledgeByPath.clear(),this.labelledTerms=new Set;for(const[e,n]of this.pathList){const r=JSON.parse(n);"connectivity"in r&&(this.knowledgeByPath.set(e,r),this.cacheLabels(r))}return this.labelCache.size||await this.getCachedTermLabels(),""},getSchemaVersion:async function(){const t=await this.getJsonData(`${this.mapServer}knowledge/schema-version`);return t&&+t.version||0},getJsonData:async function(t){try{const e=await fetch(t,{method:"GET",headers:{Accept:"application/json; charset=utf-8","Cache-Control":"no-store","Content-Type":"application/json"}});return e.ok||console.error(`Cannot access ${t}`),await e.json()}catch{return null}},getCachedTermLabels:async function(){if(this.labelledTerms.size){const t=await this.query(`select entity, knowledge from knowledge
|
|
54
54
|
where entity in (?${", ?".repeat(this.labelledTerms.size-1)})
|
|
55
|
-
order by source desc`,[...this.labelledTerms.values()]);let e=null;for(const[r,a]of t.values)if(r!==e){const i=JSON.parse(a);this.labelCache.set(r,i.label||r),e=r}const n=Object.fromEntries(this.labelCache);sessionStorage.setItem("connectivity-graph-labels",JSON.stringify(n)),this.updateCacheExpiry()}},cacheNodeLabels:function(t){for(const e of[t[0],...t[1]])this.labelledTerms.add(e)},cacheLabels:async function(t){for(const e of t.connectivity)this.cacheNodeLabels(e[0]),this.cacheNodeLabels(e[1])},showSpinner:function(){this.loading=!0},hideSpinner:function(){this.loading=!1},reset:function(){this.connectivityGraph.reset()},zoomIn:function(){this.connectivityGraph.zoom(Hv)},zoomOut:function(){this.connectivityGraph.zoom(-Hv)},toggleZoom:function(){this.zoomEnabled=!this.zoomEnabled,this.zoomLockLabel=this.zoomEnabled?I_:zv,this.connectivityGraph.enableZoom(!this.zoomEnabled)},showErrorMessage:function(t){this.connectivityError={...t},this.timeoutID&&clearTimeout(this.timeoutID),this.timeoutID=setTimeout(()=>{this.connectivityError=null},A_)}}},R_={class:"connectivity-graph",ref:"connectivityGraphRef"},$_={ref:"graphCanvas",class:"graph-canvas"},z_={class:"control-panel control-panel-tools"},H_={class:"visually-hidden"},K_={class:"visually-hidden"},q_={class:"visually-hidden"},U_={class:"visually-hidden"},G_=o.createStaticVNode('<div class="control-panel control-panel-nodes" data-v-79596f35><div class="node-key" data-v-79596f35><div class="key-box-container" data-v-79596f35><div class="key-box key-box-dendrite" data-v-79596f35> Origin </div><div class="key-box key-box-node" data-v-79596f35> Components </div><div class="key-box key-box-axon" data-v-79596f35> Destination </div></div></div></div>',1),W_={key:0,class:"connectivity-graph-error"},j_={key:0},Y_={key:1,class:"loading-error"};function Z_(t,e,n,r,a,i){const s=Y1,l=ot,u=Qt,c=ci,d=gb,f=yb,h=xb,v=Sb,p=Rl;return o.withDirectives((o.openBlock(),o.createElementBlock("div",R_,[o.createElementVNode("div",$_,null,512),o.createElementVNode("div",z_,[o.createElementVNode("div",{class:o.normalizeClass(["tools",{"zoom-locked":t.zoomEnabled}])},[o.createVNode(c,{content:t.resetLabel,placement:"top",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:o.withCtx(()=>[o.createVNode(u,{class:"control-button",size:"small",onClick:i.reset},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1}),o.createElementVNode("span",H_,o.toDisplayString(t.resetLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),o.createVNode(c,{content:t.zoomLockLabel,placement:"top",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:o.withCtx(()=>[o.createVNode(u,{class:"control-button",size:"small",onClick:i.toggleZoom},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[t.zoomEnabled?(o.openBlock(),o.createBlock(d,{key:0})):(o.openBlock(),o.createBlock(f,{key:1}))]),_:1}),o.createElementVNode("span",K_,o.toDisplayString(t.zoomLockLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),o.createVNode(c,{content:t.zoomInLabel,placement:"left",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:o.withCtx(()=>[o.createVNode(u,{class:"control-button",size:"small",onClick:i.zoomIn},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(h)]),_:1}),o.createElementVNode("span",q_,o.toDisplayString(t.zoomInLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),o.createVNode(c,{content:t.zoomOutLabel,placement:"left",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:o.withCtx(()=>[o.createVNode(u,{class:"control-button",size:"small",onClick:i.zoomOut},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(v)]),_:1}),o.createElementVNode("span",U_,o.toDisplayString(t.zoomOutLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"])],2)]),G_,t.connectivityError?(o.openBlock(),o.createElementBlock("div",W_,[t.connectivityError.errorConnectivities?(o.openBlock(),o.createElementBlock("strong",j_,o.toDisplayString(t.connectivityError.errorConnectivities),1)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(t.connectivityError.errorMessage),1)])):o.createCommentVNode("",!0),t.loadingError?(o.openBlock(),o.createElementBlock("div",Y_,o.toDisplayString(t.loadingError),1)):o.createCommentVNode("",!0)])),[[p,t.loading]])}const X_=Jt(V_,[["render",Z_],["__scopeId","data-v-79596f35"]]),Kv=t=>t&&t.charAt(0).toUpperCase()+t.slice(1),Q_=t=>t.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()),J_=t=>new Promise(e=>setTimeout(e,t)),e3={name:"ConnectivityList",components:{Button:Qt,Container:Ol,Icon:ot,ElIconWarning:fo},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0,featuresAlert:void 0})},origins:{type:Array,default:()=>[]},components:{type:Array,default:()=>[]},destinations:{type:Array,default:()=>[]},originsWithDatasets:{type:Array,default:()=>[]},componentsWithDatasets:{type:Array,default:()=>[]},destinationsWithDatasets:{type:Array,default:()=>[]},availableAnatomyFacets:{type:Array,default:()=>[]},connectivityError:{type:Object,default:()=>null}},data:function(){return{originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},facetList:[],sckanVersion:""}},watch:{availableAnatomyFacets:{handler:function(t){this.convertFacetsToList(t)},immediate:!0,deep:!0}},computed:{originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory}},methods:{capitalise:function(t){return Kv(t)},toggleConnectivityTooltip:function(t,e){this.$emit("toggle-connectivity-tooltip",{name:t,option:e})},shouldShowExploreButton:function(t){for(let e=0;e<t.length;e++)if(this.facetList.includes(t[e].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(t){t.forEach(e=>{e.children?this.convertFacetsToList(e.children):this.facetList.push(e.label.toLowerCase())})},openAll:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.componentsWithDatasets.map(t=>t.name.toLowerCase())})},openAxons:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.destinationsWithDatasets.map(t=>t.name.toLowerCase())})},openDendrites:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.originsWithDatasets.map(t=>t.name.toLowerCase())})}}},Yi=t=>(o.pushScopeId("data-v-4db36fd6"),t=t(),o.popScopeId(),t),t3={class:"connectivity-list"},n3={key:0,class:"block"},r3={class:"attribute-title-container"},a3=Yi(()=>o.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),i3={style:{"word-break":"keep-all"}},o3=Yi(()=>o.createElementVNode("i",null,"Origin",-1)),s3=["origin-item-label","onMouseenter","onMouseleave"],l3={key:1,class:"block"},c3=Yi(()=>o.createElementVNode("div",{class:"attribute-title-container"},[o.createElementVNode("span",{class:"attribute-title"},"Components")],-1)),u3=["component-item-label","onMouseenter","onMouseleave"],d3={key:2,class:"block"},f3={class:"attribute-title-container"},h3=Yi(()=>o.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),p3=Yi(()=>o.createElementVNode("span",{style:{"word-break":"keep-all"}},[o.createElementVNode("i",null,"Destination"),o.createTextVNode(" is where the axons terminate ")],-1)),v3=["destination-item-label","onMouseenter","onMouseleave"],g3={class:"block"},m3={class:"connectivity-error-container"},y3={key:0,class:"connectivity-error"},b3={key:0};function w3(t,e,n,r,a,i){const s=fo,l=ot,u=vi,c=Qt;return o.openBlock(),o.createElementBlock("div",t3,[o.createTextVNode(o.toDisplayString(n.entry.paths)+" ",1),n.origins&&n.origins.length>0?(o.openBlock(),o.createElementBlock("div",n3,[o.createElementVNode("div",r3,[a3,o.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("span",i3,[o3,o.createTextVNode(" "+o.toDisplayString(i.originDescription),1)])]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.origins,(d,f)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","origin-item-label":d,key:d,onMouseenter:h=>i.toggleConnectivityTooltip(d,{show:!0}),onMouseleave:h=>i.toggleConnectivityTooltip(d,{show:!1})},o.toDisplayString(i.capitalise(d)),41,s3))),128)),o.withDirectives(o.createVNode(c,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:o.withCtx(()=>[o.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[o.vShow,n.originsWithDatasets&&n.originsWithDatasets.length>0&&i.shouldShowExploreButton(n.originsWithDatasets)]])])):o.createCommentVNode("",!0),n.components&&n.components.length>0?(o.openBlock(),o.createElementBlock("div",l3,[c3,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.components,(d,f)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","component-item-label":d,key:d,onMouseenter:h=>i.toggleConnectivityTooltip(d,{show:!0}),onMouseleave:h=>i.toggleConnectivityTooltip(d,{show:!1})},o.toDisplayString(i.capitalise(d)),41,u3))),128))])):o.createCommentVNode("",!0),n.destinations&&n.destinations.length>0?(o.openBlock(),o.createElementBlock("div",d3,[o.createElementVNode("div",f3,[h3,o.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1})]),default:o.withCtx(()=>[p3]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.destinations,(d,f)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","destination-item-label":d,key:d,onMouseenter:h=>i.toggleConnectivityTooltip(d,{show:!0}),onMouseleave:h=>i.toggleConnectivityTooltip(d,{show:!1})},o.toDisplayString(i.capitalise(d)),41,v3))),128)),o.withDirectives(o.createVNode(c,{class:"button",onClick:i.openAxons},{default:o.withCtx(()=>[o.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[o.vShow,n.destinationsWithDatasets&&n.destinationsWithDatasets.length>0&&i.shouldShowExploreButton(n.destinationsWithDatasets)]])])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",g3,[o.createVNode(c,{class:"button",onClick:i.openAll},{default:o.withCtx(()=>[o.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"])],512),[[o.vShow,n.componentsWithDatasets&&n.componentsWithDatasets.length>0&&i.shouldShowExploreButton(n.componentsWithDatasets)]]),o.createElementVNode("div",m3,[n.connectivityError?(o.openBlock(),o.createElementBlock("div",y3,[n.connectivityError.errorConnectivities?(o.openBlock(),o.createElementBlock("strong",b3,o.toDisplayString(n.connectivityError.errorConnectivities),1)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(n.connectivityError.errorMessage),1)])):o.createCommentVNode("",!0)])])}const zc=Jt(e3,[["render",w3],["__scopeId","data-v-4db36fd6"]]),C3=function(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},k3={name:"ConnectionDialog",props:{connectionEntry:{type:Object,default:{}},inDrawing:{type:Boolean,default:!1},connectionExist:{type:Boolean,default:!1}},data:function(){return{tooltipId:void 0}},methods:{shadowDisplay:function(t){return this.tooltipId===t?"always":"hover"},capitalize:function(t){return C3(t)},handleTooltip:function(t){this.tooltipId=this.tooltipId===t?void 0:t,this.$emit("featureTooltip",this.tooltipId)}}},Hc=t=>(o.pushScopeId("data-v-1ddab772"),t=t(),o.popScopeId(),t),x3={class:"dialog-container"},E3=Hc(()=>o.createElementVNode("span",{class:"dialog-title"},"Finalize drawing",-1)),S3=Hc(()=>o.createElementVNode("span",{class:"dialog-title"},"Visualize connection",-1)),T3=Hc(()=>o.createElementVNode("b",null,[o.createElementVNode("span",null,"Related Features")],-1)),B3={class:"connection-label"};function N3(t,e,n,r,a,i){const s=Qt,l=Do,u=ui,c=vi,d=sk;return o.openBlock(),o.createElementBlock("div",x3,[o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(u,null,{default:o.withCtx(()=>[n.inDrawing?(o.openBlock(),o.createBlock(l,{key:0},{default:o.withCtx(()=>[E3,o.createVNode(s,{type:"primary",plain:"",onClick:e[0]||(e[0]=f=>t.$emit("confirmDrawn",!0))},{default:o.withCtx(()=>[o.createTextVNode(" Confirm ")]),_:1}),o.createVNode(s,{type:"primary",plain:"",onClick:e[1]||(e[1]=f=>t.$emit("cancelDrawn",!0))},{default:o.withCtx(()=>[o.createTextVNode(" Cancel ")]),_:1})]),_:1})):(o.openBlock(),o.createBlock(l,{key:1},{default:o.withCtx(()=>[S3,o.createVNode(s,{type:"primary",plain:"",onClick:e[2]||(e[2]=f=>t.$emit("dialogDisplay",!1))},{default:o.withCtx(()=>[o.createTextVNode(" Close ")]),_:1})]),_:1}))]),_:1})]),_:1}),n.connectionExist?(o.openBlock(),o.createBlock(l,{key:0},{default:o.withCtx(()=>[o.createVNode(u,null,{default:o.withCtx(()=>[T3,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.connectionEntry,(f,h)=>(o.openBlock(),o.createBlock(l,{key:h},{default:o.withCtx(()=>[o.createVNode(d,{shadow:i.shadowDisplay(h),onClick:v=>i.handleTooltip(h)},{default:o.withCtx(()=>[o.createVNode(c,{trigger:"hover",disabled:f.label.length<20,width:200,content:i.capitalize(f.label)},{reference:o.withCtx(()=>[o.createElementVNode("span",B3,o.toDisplayString(i.capitalize(f.label)),1)]),_:2},1032,["disabled","content"])]),_:2},1032,["shadow","onClick"])]),_:2},1024))),128))]),_:1})]),_:1})):o.createCommentVNode("",!0)])}const D3=Jt(k3,[["render",N3],["__scopeId","data-v-1ddab772"]]),qv=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},_3=["xlink:href"],P3={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{class:o.normalizeClass(["map-icon",{"map-icon-spin":t.spin}])},[o.createElementVNode("use",{"xlink:href":`#${t.icon}`},null,8,_3)],2))}},O3=qv(P3,[["__scopeId","data-v-e172d5ff"]]),Uv=`<?xml version="1.0" encoding="UTF-8"?>
|
|
55
|
+
order by source desc`,[...this.labelledTerms.values()]);let e=null;for(const[r,a]of t.values)if(r!==e){const i=JSON.parse(a);this.labelCache.set(r,i.label||r),e=r}const n=Object.fromEntries(this.labelCache);sessionStorage.setItem("connectivity-graph-labels",JSON.stringify(n)),this.updateCacheExpiry()}},cacheNodeLabels:function(t){for(const e of[t[0],...t[1]])this.labelledTerms.add(e)},cacheLabels:async function(t){for(const e of t.connectivity)this.cacheNodeLabels(e[0]),this.cacheNodeLabels(e[1])},showSpinner:function(){this.loading=!0},hideSpinner:function(){this.loading=!1},reset:function(){this.connectivityGraph.reset()},zoomIn:function(){this.connectivityGraph.zoom(Hv)},zoomOut:function(){this.connectivityGraph.zoom(-Hv)},toggleZoom:function(){this.zoomEnabled=!this.zoomEnabled,this.zoomLockLabel=this.zoomEnabled?L_:zv,this.connectivityGraph.enableZoom(!this.zoomEnabled)},showErrorMessage:function(t){this.connectivityError={...t},this.timeoutID&&clearTimeout(this.timeoutID),this.timeoutID=setTimeout(()=>{this.connectivityError=null},V_)}}},$_={class:"connectivity-graph",ref:"connectivityGraphRef"},z_={ref:"graphCanvas",class:"graph-canvas"},H_={class:"control-panel control-panel-tools"},K_={class:"visually-hidden"},q_={class:"visually-hidden"},U_={class:"visually-hidden"},G_={class:"visually-hidden"},W_=o.createStaticVNode('<div class="control-panel control-panel-nodes" data-v-79596f35><div class="node-key" data-v-79596f35><div class="key-box-container" data-v-79596f35><div class="key-box key-box-dendrite" data-v-79596f35> Origin </div><div class="key-box key-box-node" data-v-79596f35> Components </div><div class="key-box key-box-axon" data-v-79596f35> Destination </div></div></div></div>',1),j_={key:0,class:"connectivity-graph-error"},Y_={key:0},Z_={key:1,class:"loading-error"};function X_(t,e,n,r,a,i){const s=Y1,l=ot,u=Ut,c=ui,d=gb,f=yb,h=xb,v=Sb,p=Rl;return o.withDirectives((o.openBlock(),o.createElementBlock("div",$_,[o.createElementVNode("div",z_,null,512),o.createElementVNode("div",H_,[o.createElementVNode("div",{class:o.normalizeClass(["tools",{"zoom-locked":t.zoomEnabled}])},[o.createVNode(c,{content:t.resetLabel,placement:"top",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:o.withCtx(()=>[o.createVNode(u,{class:"control-button",size:"small",onClick:i.reset},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1}),o.createElementVNode("span",K_,o.toDisplayString(t.resetLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),o.createVNode(c,{content:t.zoomLockLabel,placement:"top",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:o.withCtx(()=>[o.createVNode(u,{class:"control-button",size:"small",onClick:i.toggleZoom},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[t.zoomEnabled?(o.openBlock(),o.createBlock(d,{key:0})):(o.openBlock(),o.createBlock(f,{key:1}))]),_:1}),o.createElementVNode("span",q_,o.toDisplayString(t.zoomLockLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),o.createVNode(c,{content:t.zoomInLabel,placement:"left",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:o.withCtx(()=>[o.createVNode(u,{class:"control-button",size:"small",onClick:i.zoomIn},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(h)]),_:1}),o.createElementVNode("span",U_,o.toDisplayString(t.zoomInLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),o.createVNode(c,{content:t.zoomOutLabel,placement:"left",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:o.withCtx(()=>[o.createVNode(u,{class:"control-button",size:"small",onClick:i.zoomOut},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(v)]),_:1}),o.createElementVNode("span",G_,o.toDisplayString(t.zoomOutLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"])],2)]),W_,t.connectivityError?(o.openBlock(),o.createElementBlock("div",j_,[t.connectivityError.errorConnectivities?(o.openBlock(),o.createElementBlock("strong",Y_,o.toDisplayString(t.connectivityError.errorConnectivities),1)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(t.connectivityError.errorMessage),1)])):o.createCommentVNode("",!0),t.loadingError?(o.openBlock(),o.createElementBlock("div",Z_,o.toDisplayString(t.loadingError),1)):o.createCommentVNode("",!0)])),[[p,t.loading]])}const Q_=Jt(R_,[["render",X_],["__scopeId","data-v-79596f35"]]),Kv=t=>t&&t.charAt(0).toUpperCase()+t.slice(1),J_=t=>t.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()),e3=t=>new Promise(e=>setTimeout(e,t)),t3={name:"ConnectivityList",components:{Button:Ut,Container:Il,Icon:ot,ElIconWarning:fo},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0,featuresAlert:void 0})},origins:{type:Array,default:()=>[]},components:{type:Array,default:()=>[]},destinations:{type:Array,default:()=>[]},originsWithDatasets:{type:Array,default:()=>[]},componentsWithDatasets:{type:Array,default:()=>[]},destinationsWithDatasets:{type:Array,default:()=>[]},availableAnatomyFacets:{type:Array,default:()=>[]},connectivityError:{type:Object,default:()=>null}},data:function(){return{originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},facetList:[],sckanVersion:""}},watch:{availableAnatomyFacets:{handler:function(t){this.convertFacetsToList(t)},immediate:!0,deep:!0}},computed:{originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory}},methods:{capitalise:function(t){return Kv(t)},toggleConnectivityTooltip:function(t,e){this.$emit("toggle-connectivity-tooltip",{name:t,option:e})},shouldShowExploreButton:function(t){for(let e=0;e<t.length;e++)if(this.facetList.includes(t[e].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(t){t.forEach(e=>{e.children?this.convertFacetsToList(e.children):this.facetList.push(e.label.toLowerCase())})},openAll:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.componentsWithDatasets.map(t=>t.name.toLowerCase())})},openAxons:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.destinationsWithDatasets.map(t=>t.name.toLowerCase())})},openDendrites:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.originsWithDatasets.map(t=>t.name.toLowerCase())})}}},Yi=t=>(o.pushScopeId("data-v-4db36fd6"),t=t(),o.popScopeId(),t),n3={class:"connectivity-list"},r3={key:0,class:"block"},a3={class:"attribute-title-container"},i3=Yi(()=>o.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),o3={style:{"word-break":"keep-all"}},s3=Yi(()=>o.createElementVNode("i",null,"Origin",-1)),l3=["origin-item-label","onMouseenter","onMouseleave"],c3={key:1,class:"block"},u3=Yi(()=>o.createElementVNode("div",{class:"attribute-title-container"},[o.createElementVNode("span",{class:"attribute-title"},"Components")],-1)),d3=["component-item-label","onMouseenter","onMouseleave"],f3={key:2,class:"block"},h3={class:"attribute-title-container"},p3=Yi(()=>o.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),v3=Yi(()=>o.createElementVNode("span",{style:{"word-break":"keep-all"}},[o.createElementVNode("i",null,"Destination"),o.createTextVNode(" is where the axons terminate ")],-1)),g3=["destination-item-label","onMouseenter","onMouseleave"],m3={class:"block"},y3={class:"connectivity-error-container"},b3={key:0,class:"connectivity-error"},w3={key:0};function C3(t,e,n,r,a,i){const s=fo,l=ot,u=ha,c=Ut;return o.openBlock(),o.createElementBlock("div",n3,[o.createTextVNode(o.toDisplayString(n.entry.paths)+" ",1),n.origins&&n.origins.length>0?(o.openBlock(),o.createElementBlock("div",r3,[o.createElementVNode("div",a3,[i3,o.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("span",o3,[s3,o.createTextVNode(" "+o.toDisplayString(i.originDescription),1)])]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.origins,(d,f)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","origin-item-label":d,key:d,onMouseenter:h=>i.toggleConnectivityTooltip(d,{show:!0}),onMouseleave:h=>i.toggleConnectivityTooltip(d,{show:!1})},o.toDisplayString(i.capitalise(d)),41,l3))),128)),o.withDirectives(o.createVNode(c,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:o.withCtx(()=>[o.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[o.vShow,n.originsWithDatasets&&n.originsWithDatasets.length>0&&i.shouldShowExploreButton(n.originsWithDatasets)]])])):o.createCommentVNode("",!0),n.components&&n.components.length>0?(o.openBlock(),o.createElementBlock("div",c3,[u3,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.components,(d,f)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","component-item-label":d,key:d,onMouseenter:h=>i.toggleConnectivityTooltip(d,{show:!0}),onMouseleave:h=>i.toggleConnectivityTooltip(d,{show:!1})},o.toDisplayString(i.capitalise(d)),41,d3))),128))])):o.createCommentVNode("",!0),n.destinations&&n.destinations.length>0?(o.openBlock(),o.createElementBlock("div",f3,[o.createElementVNode("div",h3,[p3,o.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1})]),default:o.withCtx(()=>[v3]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.destinations,(d,f)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","destination-item-label":d,key:d,onMouseenter:h=>i.toggleConnectivityTooltip(d,{show:!0}),onMouseleave:h=>i.toggleConnectivityTooltip(d,{show:!1})},o.toDisplayString(i.capitalise(d)),41,g3))),128)),o.withDirectives(o.createVNode(c,{class:"button",onClick:i.openAxons},{default:o.withCtx(()=>[o.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[o.vShow,n.destinationsWithDatasets&&n.destinationsWithDatasets.length>0&&i.shouldShowExploreButton(n.destinationsWithDatasets)]])])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",m3,[o.createVNode(c,{class:"button",onClick:i.openAll},{default:o.withCtx(()=>[o.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"])],512),[[o.vShow,n.componentsWithDatasets&&n.componentsWithDatasets.length>0&&i.shouldShowExploreButton(n.componentsWithDatasets)]]),o.createElementVNode("div",y3,[n.connectivityError?(o.openBlock(),o.createElementBlock("div",b3,[n.connectivityError.errorConnectivities?(o.openBlock(),o.createElementBlock("strong",w3,o.toDisplayString(n.connectivityError.errorConnectivities),1)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(n.connectivityError.errorMessage),1)])):o.createCommentVNode("",!0)])])}const zc=Jt(t3,[["render",C3],["__scopeId","data-v-4db36fd6"]]),k3=function(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},x3={name:"ConnectionDialog",props:{connectionEntry:{type:Object,default:{}},inDrawing:{type:Boolean,default:!1},connectionExist:{type:Boolean,default:!1}},data:function(){return{tooltipId:void 0}},methods:{shadowDisplay:function(t){return this.tooltipId===t?"always":"hover"},capitalize:function(t){return k3(t)},handleTooltip:function(t){this.tooltipId=this.tooltipId===t?void 0:t,this.$emit("featureTooltip",this.tooltipId)}}},Hc=t=>(o.pushScopeId("data-v-1ddab772"),t=t(),o.popScopeId(),t),E3={class:"dialog-container"},S3=Hc(()=>o.createElementVNode("span",{class:"dialog-title"},"Finalize drawing",-1)),T3=Hc(()=>o.createElementVNode("span",{class:"dialog-title"},"Visualize connection",-1)),B3=Hc(()=>o.createElementVNode("b",null,[o.createElementVNode("span",null,"Related Features")],-1)),N3={class:"connection-label"};function D3(t,e,n,r,a,i){const s=Ut,l=Do,u=di,c=ha,d=sk;return o.openBlock(),o.createElementBlock("div",E3,[o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(u,null,{default:o.withCtx(()=>[n.inDrawing?(o.openBlock(),o.createBlock(l,{key:0},{default:o.withCtx(()=>[S3,o.createVNode(s,{type:"primary",plain:"",onClick:e[0]||(e[0]=f=>t.$emit("confirmDrawn",!0))},{default:o.withCtx(()=>[o.createTextVNode(" Confirm ")]),_:1}),o.createVNode(s,{type:"primary",plain:"",onClick:e[1]||(e[1]=f=>t.$emit("cancelDrawn",!0))},{default:o.withCtx(()=>[o.createTextVNode(" Cancel ")]),_:1})]),_:1})):(o.openBlock(),o.createBlock(l,{key:1},{default:o.withCtx(()=>[T3,o.createVNode(s,{type:"primary",plain:"",onClick:e[2]||(e[2]=f=>t.$emit("dialogDisplay",!1))},{default:o.withCtx(()=>[o.createTextVNode(" Close ")]),_:1})]),_:1}))]),_:1})]),_:1}),n.connectionExist?(o.openBlock(),o.createBlock(l,{key:0},{default:o.withCtx(()=>[o.createVNode(u,null,{default:o.withCtx(()=>[B3,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.connectionEntry,(f,h)=>(o.openBlock(),o.createBlock(l,{key:h},{default:o.withCtx(()=>[o.createVNode(d,{shadow:i.shadowDisplay(h),onClick:v=>i.handleTooltip(h)},{default:o.withCtx(()=>[o.createVNode(c,{trigger:"hover",disabled:f.label.length<20,width:200,content:i.capitalize(f.label)},{reference:o.withCtx(()=>[o.createElementVNode("span",N3,o.toDisplayString(i.capitalize(f.label)),1)]),_:2},1032,["disabled","content"])]),_:2},1032,["shadow","onClick"])]),_:2},1024))),128))]),_:1})]),_:1})):o.createCommentVNode("",!0)])}const _3=Jt(x3,[["render",D3],["__scopeId","data-v-1ddab772"]]),qv=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},P3=["xlink:href"],I3={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{class:o.normalizeClass(["map-icon",{"map-icon-spin":t.spin}])},[o.createElementVNode("use",{"xlink:href":`#${t.icon}`},null,8,P3)],2))}},O3=qv(I3,[["__scopeId","data-v-e172d5ff"]]),Uv=`<?xml version="1.0" encoding="UTF-8"?>
|
|
56
56
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
57
57
|
<title>2horpanel</title>
|
|
58
58
|
<g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
@@ -461,8 +461,8 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
|
461
461
|
<line x1="9" y1="9.5" x2="12" y2="9.5" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
|
|
462
462
|
</g>
|
|
463
463
|
</g>
|
|
464
|
-
</svg>`,Eg=(t,e,n,r)=>{const a=["title","desc","defs","style"],i=["width","height"],s=r||[];let l=document.createElement("div");l.innerHTML=t,a.map(c=>{const d=l.querySelector(c);d&&d.remove()}),i.map(c=>{l.querySelector("svg").removeAttribute(c)}),r&&s.map(c=>{Object.values(l.querySelectorAll(`[${c}]`)).map(d=>{d.removeAttribute(c)})});const u=l.innerHTML;return l=null,u},Sg=t=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((e,n)=>"".replace.apply(e,n),t).trim(),
|
|
465
|
-
`);const qc=Object.assign({"/assets/icons/2horpanel.svg":Uv,"/assets/icons/2vertpanel.svg":Gv,"/assets/icons/3panel.svg":Wv,"/assets/icons/4panel.svg":jv,"/assets/icons/5panel.svg":Yv,"/assets/icons/6panel.svg":Zv,"/assets/icons/6panelVertical.svg":Xv,"/assets/icons/changeBckgd.svg":Qv,"/assets/icons/close-no-bk.svg":Jv,"/assets/icons/close.svg":eg,"/assets/icons/closeFullScreen.svg":tg,"/assets/icons/comment.svg":ng,"/assets/icons/connection.svg":rg,"/assets/icons/dock.svg":ag,"/assets/icons/drawLine.svg":ig,"/assets/icons/drawPoint.svg":og,"/assets/icons/drawPolygon.svg":sg,"/assets/icons/drawTrash.svg":lg,"/assets/icons/fitWindow.svg":cg,"/assets/icons/fullScreen.svg":ug,"/assets/icons/help.svg":dg,"/assets/icons/magnifyingGlass.svg":fg,"/assets/icons/noun-filter.svg":hg,"/assets/icons/openMap.svg":pg,"/assets/icons/pause.svg":vg,"/assets/icons/permalink.svg":gg,"/assets/icons/play.svg":mg,"/assets/icons/resetZoom.svg":yg,"/assets/icons/singlepanel.svg":bg,"/assets/icons/tooltips.svg":wg,"/assets/icons/undock.svg":Cg,"/assets/icons/zoomIn.svg":kg,"/assets/icons/zoomOut.svg":xg}),
|
|
466
|
-
`)},V3=["innerHTML"];function R3(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:t.$options.svgSprite},null,8,V3)}const $3=qv(A3,[["render",R3]]),z3=(t,e)=>{let n,r,a,i,s,l;e.style.left="",e.style.top="",e.addEventListener("mousedown",c=>{c.preventDefault(),n=e.offsetLeft,r=e.offsetTop,a=c.clientX,i=c.clientY,e.addEventListener("mousemove",u,!1),document.addEventListener("mouseup",()=>{e.removeEventListener("mousemove",u,!1)},!1)},!1);function u(c){c.preventDefault(),s=n-(a-c.clientX),l=r-(i-c.clientY),e.style.left=`${s}px`,e.style.top=`${l}px`}},H3={name:"DrawToolbar",components:{MapSvgIcon:O3,MapSvgSpriteColor:$3},props:{mapCanvas:{type:Object,default:void 0},toolbarOptions:{type:Array,default:["Edit","Delete","Point","LineString","Polygon","Connection"]},drawnType:{type:String,default:"All tools"},activeDrawTool:{required:!0},activeDrawMode:{required:!0},newlyDrawnEntry:{type:Object,default:{}},connectionEntry:{type:Object,default:{}},hoverVisibilities:{type:Array,required:!0,default:[{value:!1,ref:"editPopover"},{value:!1,ref:"deletePopover"},{value:!1,ref:"pointPopover"},{value:!1,ref:"lineStringPopover"},{value:!1,ref:"polygonPopover"},{value:!1,ref:"connectionPopover"}]}},data:function(){return{toolbarIcons:[{name:"Edit",active:!1,disabled:!1,type:"mode"},{name:"Delete",active:!1,disabled:!1,type:"mode"},{name:"Point",active:!1,disabled:!1,type:"tool"},{name:"LineString",active:!1,disabled:!1,type:"tool"},{name:"Polygon",active:!1,disabled:!1,type:"tool"},{name:"Connection",active:!1,disabled:!0,type:"conn"}],connectionDisplay:!1,dialogPosition:{offsetX:0,offsetY:0,x:void 0,y:void 0}}},computed:{showAllToolIcons:function(){return this.drawnType==="All tools"||this.drawnType==="None"},showEditModeIcon:function(){return this.toolbarOptions.includes("Edit")},showDeleteModeIcon:function(){return this.toolbarOptions.includes("Delete")},showDrawPointIcon:function(){return this.toolbarOptions.includes("Point")&&(this.showAllToolIcons||this.drawnType==="Point")},showDrawLineStringIcon:function(){return this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},showDrawPolygonIcon:function(){return this.toolbarOptions.includes("Polygon")&&(this.showAllToolIcons||this.drawnType==="Polygon")},showConnectionIcon:function(){return this.toolbarOptions.includes("Connection")&&this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},inDrawing:function(){return this.activeDrawTool!==void 0},newlyDrawnExist:function(){return Object.keys(this.newlyDrawnEntry).length>0},connectionExist:function(){return Object.keys(this.connectionEntry).length>0}},watch:{drawnType:function(){this.disabledToolbarConnectionIcon(!0)},activeDrawMode:function(t){this.updateToolbarIcons(t,"mode"),t==="Delete"&&(this.connectionDisplay=!1)},activeDrawTool:function(t){this.updateToolbarIcons(t,"tool"),t||(this.connectionDisplay=!1)},newlyDrawnExist:function(t){t&&(this.connectionDisplay=!0)},connectionExist:function(t){this.disabledToolbarConnectionIcon(!t),t||(this.connectionDisplay=!1)},connectionDisplay:function(t){this.activeToolbarConnectionIcon(t),t?this.dialogCssHacks():this.$emit("featureTooltip",void 0)},dialogPosition:{handler:function(){const t=this.$el.getBoundingClientRect();this.dialogPosition.offsetX=t.x,this.dialogPosition.offsetY=t.y},deep:!0,once:!0}},methods:{iconDisabled:function(t){return this.toolbarIcons.filter(e=>e.name===t)[0].disabled},modeClickEvent:function(t){if(!this.iconDisabled(t)){const e=this.activeDrawMode===t?void 0:t;this.$emit("clickToolbar","mode",e)}},toolClickEvent:function(t){if(!this.iconDisabled(t)){const e=this.activeDrawTool===t?void 0:t;this.$emit("clickToolbar","tool",e)}},connectionClickEvent:function(){!this.iconDisabled("Connection")&&!this.newlyDrawnExist&&(this.connectionDisplay=!this.connectionDisplay)},updateToolbarIcons:function(t,e){this.toolbarIcons.map(n=>{n.name===t?n.active=!0:n.active=!1}),this.toolbarIcons.filter(n=>n.type!=="conn").filter(n=>n.type!==e).map(n=>{t?n.disabled=!0:n.disabled=!1}),this.toolbarCssHacks()},disabledToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.type==="conn").map(e=>{t?e.disabled=!0:e.disabled=!1,this.activeDrawMode==="Delete"&&(e.disabled=!0)}),this.toolbarCssHacks()},activeToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.type==="conn").map(e=>{t?e.active=!0:e.active=!1}),this.toolbarCssHacks()},toolbarCssHacks:function(){this.$nextTick(()=>{this.toolbarIcons.map(t=>{const e=this.$el.querySelector(`.draw${t.name}`);e&&(t.active?e.classList.add("active"):e.classList.remove("active"),t.disabled?e.classList.add("disabled"):e.classList.remove("disabled"))})})},dialogCssHacks:function(){this.$nextTick(()=>{const t=this.$el.querySelector(".connection-dialog");z3(this.mapCanvas.containerHTML,t);let e,n;const r=this.mapCanvas.containerHTML.getBoundingClientRect(),a=t.getBoundingClientRect();this.dialogPosition.x>r.width/2?e=this.dialogPosition.x-a.width:e=this.dialogPosition.x,this.dialogPosition.y>r.height/2?n=this.dialogPosition.y-a.height:n=this.dialogPosition.y,t.style.transform=`translate(${e-this.dialogPosition.offsetX}px, ${n-this.dialogPosition.offsetY}px)`})},hoverIndex:function(t){return this.hoverVisibilities.findIndex(e=>e.ref===t)},showTooltip:function(t){this.$emit("showTooltip",t)},hideTooltip:function(t){this.$emit("hideTooltip",t)},dialogPopUpPositionHandler:function(t){t.preventDefault(),this.dialogPosition.x=t.clientX,this.dialogPosition.y=t.clientY,this.activeDrawTool==="Point"&&this.dialogCssHacks()}},mounted:function(){this.$nextTick(()=>{this.toolbarCssHacks(),this.mapCanvas&&this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).addEventListener("click",this.dialogPopUpPositionHandler,!1)})},destroyed:function(){this.mapCanvas&&this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).removeEventListener("click",this.dialogPopUpPositionHandler,!1)}},K3={class:"toolbar-container"},q3={class:"toolbar-icons"};function U3(t,e,n,r,a,i){const s=o.resolveComponent("map-svg-sprite-color"),l=o.resolveComponent("map-svg-icon"),u=vi,c=D3;return o.openBlock(),o.createElementBlock("div",K3,[o.createVNode(s),o.createElementVNode("div",q3,[i.showEditModeIcon?(o.openBlock(),o.createBlock(u,{key:0,content:"Edit Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("editPopover")].value,ref:"editPopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"comment",class:"icon-button drawEdit",onClick:e[0]||(e[0]=d=>i.modeClickEvent("Edit")),onMouseover:e[1]||(e[1]=d=>i.showTooltip(i.hoverIndex("editPopover"))),onMouseout:e[2]||(e[2]=d=>i.hideTooltip(i.hoverIndex("editPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showDeleteModeIcon?(o.openBlock(),o.createBlock(u,{key:1,content:"Delete Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("deletePopover")].value,ref:"deletePopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"drawTrash",class:"icon-button drawDelete",onClick:e[3]||(e[3]=d=>i.modeClickEvent("Delete")),onMouseover:e[4]||(e[4]=d=>i.showTooltip(i.hoverIndex("deletePopover"))),onMouseout:e[5]||(e[5]=d=>i.hideTooltip(i.hoverIndex("deletePopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showDrawPointIcon?(o.openBlock(),o.createBlock(u,{key:2,content:"Draw Point",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("pointPopover")].value,ref:"pointPopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"drawPoint",class:"icon-button drawPoint",onClick:e[6]||(e[6]=d=>i.toolClickEvent("Point")),onMouseover:e[7]||(e[7]=d=>i.showTooltip(i.hoverIndex("pointPopover"))),onMouseout:e[8]||(e[8]=d=>i.hideTooltip(i.hoverIndex("pointPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showDrawLineStringIcon?(o.openBlock(),o.createBlock(u,{key:3,content:"Draw LineString",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("lineStringPopover")].value,ref:"drawLinePopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"drawLine",class:"icon-button drawLineString",onClick:e[9]||(e[9]=d=>i.toolClickEvent("LineString")),onMouseover:e[10]||(e[10]=d=>i.showTooltip(i.hoverIndex("lineStringPopover"))),onMouseout:e[11]||(e[11]=d=>i.hideTooltip(i.hoverIndex("lineStringPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showDrawPolygonIcon?(o.openBlock(),o.createBlock(u,{key:4,content:"Draw Polygon",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("polygonPopover")].value,ref:"polygonPopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"drawPolygon",class:"icon-button drawPolygon",onClick:e[12]||(e[12]=d=>i.toolClickEvent("Polygon")),onMouseover:e[13]||(e[13]=d=>i.showTooltip(i.hoverIndex("polygonPopover"))),onMouseout:e[14]||(e[14]=d=>i.hideTooltip(i.hoverIndex("polygonPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showConnectionIcon?(o.openBlock(),o.createBlock(u,{key:5,content:"Connectivity",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("connectionPopover")].value,ref:"connectionPopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"connection",class:"icon-button drawConnection",onClick:e[15]||(e[15]=d=>i.connectionClickEvent()),onMouseover:e[16]||(e[16]=d=>i.showTooltip(i.hoverIndex("connectionPopover"))),onMouseout:e[17]||(e[17]=d=>i.hideTooltip(i.hoverIndex("connectionPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0)]),n.mapCanvas?o.withDirectives((o.openBlock(),o.createBlock(c,{key:0,class:"connection-dialog",connectionEntry:n.connectionEntry,inDrawing:i.inDrawing,connectionExist:i.connectionExist,onDialogDisplay:e[18]||(e[18]=d=>i.connectionClickEvent()),onConfirmDrawn:e[19]||(e[19]=d=>t.$emit("confirmDrawn",d)),onCancelDrawn:e[20]||(e[20]=d=>t.$emit("cancelDrawn",d)),onFeatureTooltip:e[21]||(e[21]=d=>t.$emit("featureTooltip",d))},null,8,["connectionEntry","inDrawing","connectionExist"])),[[o.vShow,t.connectionDisplay]]):o.createCommentVNode("",!0)])}const G3=Jt(H3,[["render",U3],["__scopeId","data-v-8a96a220"]]),W3={name:"HelpModeDialog",props:{multiflatmapRef:{type:Object,default:null},flatmapRef:{type:Object,default:null},scaffoldRef:{type:Object,default:null},lastItem:{type:Boolean,default:!1,required:!1}},mounted:function(){this.toggleHelpModeHighlight(!0),this.toggleTooltipHighlight()},unmounted:function(){this.toggleHelpModeHighlight(!1)},watch:{lastItem:function(t){t&&this.toggleTooltipHighlight()}},methods:{showNext:function(){this.$emit("show-next")},finishHelpMode:function(){this.$emit("finish-help-mode")},toggleTooltipPinHighlight:function(){const t=this.getCurrentFlatmap();this.resetHighlightedItems(),this.$nextTick(()=>{var i;const e=t.querySelectorAll(".maplibregl-marker"),n=t.querySelector(".flatmap-popup-popper"),r=((i=n==null?void 0:n.style)==null?void 0:i.transform)||"",a=this.extractMarkerPosition(r);e.forEach(s=>{const l=s.style.transform;this.extractMarkerPosition(l)===a&&s.classList.add("in-help-highlight")})})},toggleTooltipHighlight:function(){this.resetHighlightedItems(),this.$nextTick(()=>{document.querySelectorAll('.el-popper:not([style*="none"])').forEach(e=>{const n=e.classList.contains("flatmap-popper"),r=e.classList.contains("el-fade-in-linear-enter-active");(n||r)&&this.toggleHighlight(e)})})},toggleHighlight:function(t){const e=(t==null?void 0:t.id)||"",n=document.querySelector(`[aria-describedby="${e}"]`);n&&n.classList.add("in-help-highlight")},resetHighlightedItems:function(){document.querySelectorAll(".in-help-highlight").forEach(e=>{e.classList.remove("in-help-highlight")})},getCurrentScaffold:function(){var e;return((e=this.scaffoldRef)==null?void 0:e.$el)||null},getCurrentMultiflatmap:function(){var e;return((e=this.multiflatmapRef)==null?void 0:e.$el)||null},getCurrentFlatmap:function(){var n;const t=this.flatmapRef||((n=this.multiflatmapRef)==null?void 0:n.getCurrentFlatmap());return(t==null?void 0:t.$el)||null},toggleHelpModeHighlight:function(t){const e=this.getCurrentMultiflatmap(),n=this.getCurrentFlatmap(),r=this.getCurrentScaffold(),a=document.querySelectorAll(".in-help-highlight");e&&(t?e.classList.add("in-help"):e.classList.remove("in-help")),n&&(t?n.classList.add("in-help"):n.classList.remove("in-help")),r&&(t?r.classList.add("in-help"):r.classList.remove("in-help")),t||a.forEach(i=>{i.classList.remove("in-help-highlight")})},extractMarkerPosition:function(t){const e=/translate\((.*?)\)/g,n=t.match(e);return n?n[n.length-1].slice(10,-1):""}}},Uc=t=>(o.pushScopeId("data-v-3efb89fb"),t=t(),o.popScopeId(),t),j3=Uc(()=>o.createElementVNode("h4",null,"Help Mode",-1)),Y3=Uc(()=>o.createElementVNode("p",null,[o.createTextVNode(" All caught up! "),o.createElementVNode("br"),o.createTextVNode(" Click 'Help' to restart. ")],-1)),Z3=Uc(()=>o.createElementVNode("p",null,'Click "Next" to see the next item.',-1));function X3(t,e,n,r,a,i){const s=Qt;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["help-mode-dialog",{finish:n.lastItem}])},[j3,n.lastItem?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[Y3,o.createElementVNode("div",null,[o.createVNode(s,{class:"button",onClick:i.finishHelpMode},{default:o.withCtx(()=>[o.createTextVNode(" Finish ")]),_:1},8,["onClick"])])],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[Z3,o.createElementVNode("div",null,[o.createVNode(s,{class:"button",onClick:i.showNext},{default:o.withCtx(()=>[o.createTextVNode(" Next ")]),_:1},8,["onClick"]),o.createVNode(s,{class:"button secondary",onClick:i.finishHelpMode},{default:o.withCtx(()=>[o.createTextVNode(" Exit Help Mode ")]),_:1},8,["onClick"])])],64))],2)}const Q3=Jt(W3,[["render",X3],["__scopeId","data-v-3efb89fb"]]),J3="https://citation.doi.org",eP=[{label:"APA",value:"apa"},{label:"Chicago",value:"chicago-note-bibliography"},{label:"IEEE",value:"ieee"},{label:"Bibtex",value:"bibtex"}],Gc="apa",tP=600,nP={name:"ExternalResourceCard",props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubMedReferences:[],openLibReferences:[],isbnDBReferences:[],referecesListContent:"",citationOptions:eP,citationType:Gc,crosscite_host:J3}},watch:{resources:function(t){this.formatReferences([...t]),this.getCitationText(Gc)}},computed:{referencesWithDOI:function(){return this.pubMedReferences.filter(e=>e.type==="doi"||e.doi).length}},mounted:function(){this.formatReferences([...this.resources]),this.getCitationText(Gc)},methods:{showRelatedConnectivities:function(t){this.$emit("show-reference-connectivities",t)},formatReferences:function(t){const e=this.extractNonPubMedReferences(t),n=t.filter(r=>!e.includes(r));this.pubMedReferences=n.map(r=>typeof r=="object"?this.extractPublicationIdFromURLString(r[0]):this.extractPublicationIdFromURLString(r)),this.pubMedReferences.forEach(r=>{if(r.type==="pmc"){const a=r.id;this.searchPMID(a).then(i=>{if(i&&i.esearchresult){const s=i.esearchresult.idlist||[];r.id=s[0],r.type="pmid"}})}}),this.formatNonPubMedReferences(e).then(r=>{this.openLibReferences=r.filter(a=>a.type==="openlib"),this.isbnDBReferences=r.filter(a=>a.type==="isbndb"),this.formatOpenLibReferences()})},extractNonPubMedReferences:function(t){const e=[],n=this.getPubMedDomains();return t.forEach(r=>{let a=0;n.forEach(i=>{r.includes(i)&&a++}),a||e.push(r)}),e},formatNonPubMedReferences:async function(t){const e=[],n=t.filter(c=>c.indexOf("isbn")!==-1),r=n.map(c=>"ISBN:"+c.split("/").pop()),a=r.join(","),i=r.slice(),s=c=>n.find(d=>d.includes(c)),l=`https://openlibrary.org/api/books?bibkeys=${a}&format=json`,u=await this.fetchData(l);for(const c in u){const d=i.indexOf(c);i.splice(d,1);const f=u[c].info_url,h=f.split("/"),v=h.indexOf("books"),p=h[v+1],g=c.split(":")[1],y=s(g);e.push({id:g,type:"openlib",url:f,bookId:p,resource:y})}return i.forEach(c=>{const d=c.split(":")[1],f=`https://isbndb.com/book/${d}`,h=s(d);e.push({id:d,url:f,type:"isbndb",resource:h})}),e},extractPublicationIdFromURLString:function(t){if(!t)return;const e=decodeURIComponent(t);let n={id:"",type:"",citation:{},resource:t};return this.getPubMedDomains().forEach(a=>{const i=e.lastIndexOf(a);i!==-1&&(n.id=e.slice(i+a.length),a==="doi.org/"?n.type="doi":a==="pmc/articles/"?n.type="pmc":n.type="pmid")}),n.id===""&&(t.includes("doi:")?(n.id=this.stripPMIDPrefix(t),n.type="doi"):t.includes("PMID:")&&(n.id=this.stripPMIDPrefix(t),n.type="pmid")),n.id.endsWith("/")&&(n.id=n.id.slice(0,-1)),n},getPubMedDomains:function(){return["doi.org/","nih.gov/pubmed/","pmc/articles/","pubmed.ncbi.nlm.nih.gov/"]},stripPMIDPrefix:function(t){return t.split(":")[1]},onCitationFormatChange:function(t){this.citationType=t,this.getCitationText(t)},generateCitationText:function(t,e){const{id:n,type:r,doi:a}=t;if(!(t.citation&&t.citation[e])&&n)if(t.citation[e]="",t.citation.error=null,r==="doi"||a){const i=r==="doi"?n:a;this.getCitationTextByDOI(i).then(s=>{const l=this.replaceLinkInText(s);t.citation[e]=l,this.updateCopyContents()}).catch(s=>{t.citation.error={type:e,ref:"doi"}})}else r==="pmid"&&this.getDOIFromPubMedID(n).then(i=>{if(i!=null&&i.result){const s=i.result[n],u=((s==null?void 0:s.articleids)||[]).find(d=>d.idtype==="doi"),c=u==null?void 0:u.value;if(c)t.doi=c,this.getCitationTextByDOI(c).then(d=>{const f=this.replaceLinkInText(d);t.citation[e]=f,this.updateCopyContents()}).catch(d=>{t.citation.error={type:e,ref:"doi"}});else{const{title:d,pubdate:f,authors:h}=s,v=h?h.map(g=>g.name):[],p=this.formatCopyReference({title:d||"",date:f||"",authors:v,url:`https://pubmed.ncbi.nlm.nih.gov/${n}`});t.citation[e]=p,this.updateCopyContents()}}}).catch(i=>{t.citation.error={type:e,ref:"pubmed"}})},getCitationText:function(t){async function e(n){for(let r=0;r<n.pubMedReferences.length;r++)n.generateCitationText(n.pubMedReferences[r],t),n.pubMedReferences.length>3&&r<n.pubMedReferences.length-1&&await J_(tP)}e(this)},reloadCitation:function(t){this.generateCitationText(t,this.citationType)},updateCopyContents:function(){const t=this.citationOptions.find(r=>r.value===this.citationType);let e="";const n=[];if(this.referencesWithDOI&&(e=t==null?void 0:t.label),this.pubMedReferences.forEach(r=>{n.push(r.citation[this.citationType])}),this.openLibReferences.forEach(r=>{n.push(this.formatCopyReference(r))}),this.isbnDBReferences.forEach(r=>{n.push(r.url)}),n.length){const a=`<ul>${n.map(s=>`<li>${s}</li>`).join(`
|
|
464
|
+
</svg>`,Eg=(t,e,n,r)=>{const a=["title","desc","defs","style"],i=["width","height"],s=r||[];let l=document.createElement("div");l.innerHTML=t,a.map(c=>{const d=l.querySelector(c);d&&d.remove()}),i.map(c=>{l.querySelector("svg").removeAttribute(c)}),r&&s.map(c=>{Object.values(l.querySelectorAll(`[${c}]`)).map(d=>{d.removeAttribute(c)})});const u=l.innerHTML;return l=null,u},Sg=t=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((e,n)=>"".replace.apply(e,n),t).trim(),L3=!0,M3=!0,F3=["fill"],Kc=Object.assign({"/assets/icons/2horpanel.svg":Uv,"/assets/icons/2vertpanel.svg":Gv,"/assets/icons/3panel.svg":Wv,"/assets/icons/4panel.svg":jv,"/assets/icons/5panel.svg":Yv,"/assets/icons/6panel.svg":Zv,"/assets/icons/6panelVertical.svg":Xv,"/assets/icons/changeBckgd.svg":Qv,"/assets/icons/close-no-bk.svg":Jv,"/assets/icons/close.svg":eg,"/assets/icons/closeFullScreen.svg":tg,"/assets/icons/comment.svg":ng,"/assets/icons/connection.svg":rg,"/assets/icons/dock.svg":ag,"/assets/icons/drawLine.svg":ig,"/assets/icons/drawPoint.svg":og,"/assets/icons/drawPolygon.svg":sg,"/assets/icons/drawTrash.svg":lg,"/assets/icons/fitWindow.svg":cg,"/assets/icons/fullScreen.svg":ug,"/assets/icons/help.svg":dg,"/assets/icons/magnifyingGlass.svg":fg,"/assets/icons/noun-filter.svg":hg,"/assets/icons/openMap.svg":pg,"/assets/icons/pause.svg":vg,"/assets/icons/permalink.svg":gg,"/assets/icons/play.svg":mg,"/assets/icons/resetZoom.svg":yg,"/assets/icons/singlepanel.svg":bg,"/assets/icons/tooltips.svg":wg,"/assets/icons/undock.svg":Cg,"/assets/icons/zoomIn.svg":kg,"/assets/icons/zoomOut.svg":xg});Object.keys(Kc).map(t=>{const e=Eg(Kc[t],L3,M3,F3),n=t.replace(/^.+\/(\w+).svg$/,"$1");return Sg(e).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}).join(`
|
|
465
|
+
`);const qc=Object.assign({"/assets/icons/2horpanel.svg":Uv,"/assets/icons/2vertpanel.svg":Gv,"/assets/icons/3panel.svg":Wv,"/assets/icons/4panel.svg":jv,"/assets/icons/5panel.svg":Yv,"/assets/icons/6panel.svg":Zv,"/assets/icons/6panelVertical.svg":Xv,"/assets/icons/changeBckgd.svg":Qv,"/assets/icons/close-no-bk.svg":Jv,"/assets/icons/close.svg":eg,"/assets/icons/closeFullScreen.svg":tg,"/assets/icons/comment.svg":ng,"/assets/icons/connection.svg":rg,"/assets/icons/dock.svg":ag,"/assets/icons/drawLine.svg":ig,"/assets/icons/drawPoint.svg":og,"/assets/icons/drawPolygon.svg":sg,"/assets/icons/drawTrash.svg":lg,"/assets/icons/fitWindow.svg":cg,"/assets/icons/fullScreen.svg":ug,"/assets/icons/help.svg":dg,"/assets/icons/magnifyingGlass.svg":fg,"/assets/icons/noun-filter.svg":hg,"/assets/icons/openMap.svg":pg,"/assets/icons/pause.svg":vg,"/assets/icons/permalink.svg":gg,"/assets/icons/play.svg":mg,"/assets/icons/resetZoom.svg":yg,"/assets/icons/singlepanel.svg":bg,"/assets/icons/tooltips.svg":wg,"/assets/icons/undock.svg":Cg,"/assets/icons/zoomIn.svg":kg,"/assets/icons/zoomOut.svg":xg}),A3=Object.keys(qc).map(t=>{const e=Eg(qc[t]),n=t.replace(/^.+\/(\w+).svg$/,"$1");return Sg(e).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}),V3={name:"MapSvgSpriteColor",svgContext:qc,svgSprite:A3.join(`
|
|
466
|
+
`)},R3=["innerHTML"];function $3(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:t.$options.svgSprite},null,8,R3)}const z3=qv(V3,[["render",$3]]),H3=(t,e)=>{let n,r,a,i,s,l;e.style.left="",e.style.top="",e.addEventListener("mousedown",c=>{c.preventDefault(),n=e.offsetLeft,r=e.offsetTop,a=c.clientX,i=c.clientY,e.addEventListener("mousemove",u,!1),document.addEventListener("mouseup",()=>{e.removeEventListener("mousemove",u,!1)},!1)},!1);function u(c){c.preventDefault(),s=n-(a-c.clientX),l=r-(i-c.clientY),e.style.left=`${s}px`,e.style.top=`${l}px`}},K3={name:"DrawToolbar",components:{MapSvgIcon:O3,MapSvgSpriteColor:z3},props:{mapCanvas:{type:Object,default:void 0},toolbarOptions:{type:Array,default:["Edit","Delete","Point","LineString","Polygon","Connection"]},drawnType:{type:String,default:"All tools"},activeDrawTool:{required:!0},activeDrawMode:{required:!0},newlyDrawnEntry:{type:Object,default:{}},connectionEntry:{type:Object,default:{}},hoverVisibilities:{type:Array,required:!0,default:[{value:!1,ref:"editPopover"},{value:!1,ref:"deletePopover"},{value:!1,ref:"pointPopover"},{value:!1,ref:"lineStringPopover"},{value:!1,ref:"polygonPopover"},{value:!1,ref:"connectionPopover"}]}},data:function(){return{toolbarIcons:[{name:"Edit",active:!1,disabled:!1,type:"mode"},{name:"Delete",active:!1,disabled:!1,type:"mode"},{name:"Point",active:!1,disabled:!1,type:"tool"},{name:"LineString",active:!1,disabled:!1,type:"tool"},{name:"Polygon",active:!1,disabled:!1,type:"tool"},{name:"Connection",active:!1,disabled:!0,type:"conn"}],connectionDisplay:!1,dialogPosition:{offsetX:0,offsetY:0,x:void 0,y:void 0}}},computed:{showAllToolIcons:function(){return this.drawnType==="All tools"||this.drawnType==="None"},showEditModeIcon:function(){return this.toolbarOptions.includes("Edit")},showDeleteModeIcon:function(){return this.toolbarOptions.includes("Delete")},showDrawPointIcon:function(){return this.toolbarOptions.includes("Point")&&(this.showAllToolIcons||this.drawnType==="Point")},showDrawLineStringIcon:function(){return this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},showDrawPolygonIcon:function(){return this.toolbarOptions.includes("Polygon")&&(this.showAllToolIcons||this.drawnType==="Polygon")},showConnectionIcon:function(){return this.toolbarOptions.includes("Connection")&&this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},inDrawing:function(){return this.activeDrawTool!==void 0},newlyDrawnExist:function(){return Object.keys(this.newlyDrawnEntry).length>0},connectionExist:function(){return Object.keys(this.connectionEntry).length>0}},watch:{drawnType:function(){this.disabledToolbarConnectionIcon(!0)},activeDrawMode:function(t){this.updateToolbarIcons(t,"mode"),t==="Delete"&&(this.connectionDisplay=!1)},activeDrawTool:function(t){this.updateToolbarIcons(t,"tool"),t||(this.connectionDisplay=!1)},newlyDrawnExist:function(t){t&&(this.connectionDisplay=!0)},connectionExist:function(t){this.disabledToolbarConnectionIcon(!t),t||(this.connectionDisplay=!1)},connectionDisplay:function(t){this.activeToolbarConnectionIcon(t),t?this.dialogCssHacks():this.$emit("featureTooltip",void 0)},dialogPosition:{handler:function(){const t=this.$el.getBoundingClientRect();this.dialogPosition.offsetX=t.x,this.dialogPosition.offsetY=t.y},deep:!0,once:!0}},methods:{iconDisabled:function(t){return this.toolbarIcons.filter(e=>e.name===t)[0].disabled},modeClickEvent:function(t){if(!this.iconDisabled(t)){const e=this.activeDrawMode===t?void 0:t;this.$emit("clickToolbar","mode",e)}},toolClickEvent:function(t){if(!this.iconDisabled(t)){const e=this.activeDrawTool===t?void 0:t;this.$emit("clickToolbar","tool",e)}},connectionClickEvent:function(){!this.iconDisabled("Connection")&&!this.newlyDrawnExist&&(this.connectionDisplay=!this.connectionDisplay)},updateToolbarIcons:function(t,e){this.toolbarIcons.map(n=>{n.name===t?n.active=!0:n.active=!1}),this.toolbarIcons.filter(n=>n.type!=="conn").filter(n=>n.type!==e).map(n=>{t?n.disabled=!0:n.disabled=!1}),this.toolbarCssHacks()},disabledToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.type==="conn").map(e=>{t?e.disabled=!0:e.disabled=!1,this.activeDrawMode==="Delete"&&(e.disabled=!0)}),this.toolbarCssHacks()},activeToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.type==="conn").map(e=>{t?e.active=!0:e.active=!1}),this.toolbarCssHacks()},toolbarCssHacks:function(){this.$nextTick(()=>{this.toolbarIcons.map(t=>{const e=this.$el.querySelector(`.draw${t.name}`);e&&(t.active?e.classList.add("active"):e.classList.remove("active"),t.disabled?e.classList.add("disabled"):e.classList.remove("disabled"))})})},dialogCssHacks:function(){this.$nextTick(()=>{const t=this.$el.querySelector(".connection-dialog");H3(this.mapCanvas.containerHTML,t);let e,n;const r=this.mapCanvas.containerHTML.getBoundingClientRect(),a=t.getBoundingClientRect();this.dialogPosition.x>r.width/2?e=this.dialogPosition.x-a.width:e=this.dialogPosition.x,this.dialogPosition.y>r.height/2?n=this.dialogPosition.y-a.height:n=this.dialogPosition.y,t.style.transform=`translate(${e-this.dialogPosition.offsetX}px, ${n-this.dialogPosition.offsetY}px)`})},hoverIndex:function(t){return this.hoverVisibilities.findIndex(e=>e.ref===t)},showTooltip:function(t){this.$emit("showTooltip",t)},hideTooltip:function(t){this.$emit("hideTooltip",t)},dialogPopUpPositionHandler:function(t){t.preventDefault(),this.dialogPosition.x=t.clientX,this.dialogPosition.y=t.clientY,this.activeDrawTool==="Point"&&this.dialogCssHacks()}},mounted:function(){this.$nextTick(()=>{this.toolbarCssHacks(),this.mapCanvas&&this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).addEventListener("click",this.dialogPopUpPositionHandler,!1)})},destroyed:function(){this.mapCanvas&&this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).removeEventListener("click",this.dialogPopUpPositionHandler,!1)}},q3={class:"toolbar-container"},U3={class:"toolbar-icons"};function G3(t,e,n,r,a,i){const s=o.resolveComponent("map-svg-sprite-color"),l=o.resolveComponent("map-svg-icon"),u=ha,c=_3;return o.openBlock(),o.createElementBlock("div",q3,[o.createVNode(s),o.createElementVNode("div",U3,[i.showEditModeIcon?(o.openBlock(),o.createBlock(u,{key:0,content:"Edit Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("editPopover")].value,ref:"editPopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"comment",class:"icon-button drawEdit",onClick:e[0]||(e[0]=d=>i.modeClickEvent("Edit")),onMouseover:e[1]||(e[1]=d=>i.showTooltip(i.hoverIndex("editPopover"))),onMouseout:e[2]||(e[2]=d=>i.hideTooltip(i.hoverIndex("editPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showDeleteModeIcon?(o.openBlock(),o.createBlock(u,{key:1,content:"Delete Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("deletePopover")].value,ref:"deletePopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"drawTrash",class:"icon-button drawDelete",onClick:e[3]||(e[3]=d=>i.modeClickEvent("Delete")),onMouseover:e[4]||(e[4]=d=>i.showTooltip(i.hoverIndex("deletePopover"))),onMouseout:e[5]||(e[5]=d=>i.hideTooltip(i.hoverIndex("deletePopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showDrawPointIcon?(o.openBlock(),o.createBlock(u,{key:2,content:"Draw Point",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("pointPopover")].value,ref:"pointPopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"drawPoint",class:"icon-button drawPoint",onClick:e[6]||(e[6]=d=>i.toolClickEvent("Point")),onMouseover:e[7]||(e[7]=d=>i.showTooltip(i.hoverIndex("pointPopover"))),onMouseout:e[8]||(e[8]=d=>i.hideTooltip(i.hoverIndex("pointPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showDrawLineStringIcon?(o.openBlock(),o.createBlock(u,{key:3,content:"Draw LineString",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("lineStringPopover")].value,ref:"drawLinePopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"drawLine",class:"icon-button drawLineString",onClick:e[9]||(e[9]=d=>i.toolClickEvent("LineString")),onMouseover:e[10]||(e[10]=d=>i.showTooltip(i.hoverIndex("lineStringPopover"))),onMouseout:e[11]||(e[11]=d=>i.hideTooltip(i.hoverIndex("lineStringPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showDrawPolygonIcon?(o.openBlock(),o.createBlock(u,{key:4,content:"Draw Polygon",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("polygonPopover")].value,ref:"polygonPopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"drawPolygon",class:"icon-button drawPolygon",onClick:e[12]||(e[12]=d=>i.toolClickEvent("Polygon")),onMouseover:e[13]||(e[13]=d=>i.showTooltip(i.hoverIndex("polygonPopover"))),onMouseout:e[14]||(e[14]=d=>i.hideTooltip(i.hoverIndex("polygonPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showConnectionIcon?(o.openBlock(),o.createBlock(u,{key:5,content:"Connectivity",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("connectionPopover")].value,ref:"connectionPopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"connection",class:"icon-button drawConnection",onClick:e[15]||(e[15]=d=>i.connectionClickEvent()),onMouseover:e[16]||(e[16]=d=>i.showTooltip(i.hoverIndex("connectionPopover"))),onMouseout:e[17]||(e[17]=d=>i.hideTooltip(i.hoverIndex("connectionPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0)]),n.mapCanvas?o.withDirectives((o.openBlock(),o.createBlock(c,{key:0,class:"connection-dialog",connectionEntry:n.connectionEntry,inDrawing:i.inDrawing,connectionExist:i.connectionExist,onDialogDisplay:e[18]||(e[18]=d=>i.connectionClickEvent()),onConfirmDrawn:e[19]||(e[19]=d=>t.$emit("confirmDrawn",d)),onCancelDrawn:e[20]||(e[20]=d=>t.$emit("cancelDrawn",d)),onFeatureTooltip:e[21]||(e[21]=d=>t.$emit("featureTooltip",d))},null,8,["connectionEntry","inDrawing","connectionExist"])),[[o.vShow,t.connectionDisplay]]):o.createCommentVNode("",!0)])}const W3=Jt(K3,[["render",G3],["__scopeId","data-v-8a96a220"]]),j3={name:"HelpModeDialog",props:{multiflatmapRef:{type:Object,default:null},flatmapRef:{type:Object,default:null},scaffoldRef:{type:Object,default:null},lastItem:{type:Boolean,default:!1,required:!1}},mounted:function(){this.toggleHelpModeHighlight(!0),this.toggleTooltipHighlight()},unmounted:function(){this.toggleHelpModeHighlight(!1)},watch:{lastItem:function(t){t&&this.toggleTooltipHighlight()}},methods:{showNext:function(){this.$emit("show-next")},finishHelpMode:function(){this.$emit("finish-help-mode")},toggleTooltipPinHighlight:function(){const t=this.getCurrentFlatmap();this.resetHighlightedItems(),this.$nextTick(()=>{var i;const e=t.querySelectorAll(".maplibregl-marker"),n=t.querySelector(".flatmap-popup-popper"),r=((i=n==null?void 0:n.style)==null?void 0:i.transform)||"",a=this.extractMarkerPosition(r);e.forEach(s=>{const l=s.style.transform;this.extractMarkerPosition(l)===a&&s.classList.add("in-help-highlight")})})},toggleTooltipHighlight:function(){this.resetHighlightedItems(),this.$nextTick(()=>{document.querySelectorAll('.el-popper:not([style*="none"])').forEach(e=>{const n=e.classList.contains("flatmap-popper"),r=e.classList.contains("el-fade-in-linear-enter-active");(n||r)&&this.toggleHighlight(e)})})},toggleHighlight:function(t){const e=(t==null?void 0:t.id)||"",n=document.querySelector(`[aria-describedby="${e}"]`);n&&n.classList.add("in-help-highlight")},resetHighlightedItems:function(){document.querySelectorAll(".in-help-highlight").forEach(e=>{e.classList.remove("in-help-highlight")})},getCurrentScaffold:function(){var e;return((e=this.scaffoldRef)==null?void 0:e.$el)||null},getCurrentMultiflatmap:function(){var e;return((e=this.multiflatmapRef)==null?void 0:e.$el)||null},getCurrentFlatmap:function(){var n;const t=this.flatmapRef||((n=this.multiflatmapRef)==null?void 0:n.getCurrentFlatmap());return(t==null?void 0:t.$el)||null},toggleHelpModeHighlight:function(t){const e=this.getCurrentMultiflatmap(),n=this.getCurrentFlatmap(),r=this.getCurrentScaffold(),a=document.querySelectorAll(".in-help-highlight");e&&(t?e.classList.add("in-help"):e.classList.remove("in-help")),n&&(t?n.classList.add("in-help"):n.classList.remove("in-help")),r&&(t?r.classList.add("in-help"):r.classList.remove("in-help")),t||a.forEach(i=>{i.classList.remove("in-help-highlight")})},extractMarkerPosition:function(t){const e=/translate\((.*?)\)/g,n=t.match(e);return n?n[n.length-1].slice(10,-1):""}}},Uc=t=>(o.pushScopeId("data-v-3efb89fb"),t=t(),o.popScopeId(),t),Y3=Uc(()=>o.createElementVNode("h4",null,"Help Mode",-1)),Z3=Uc(()=>o.createElementVNode("p",null,[o.createTextVNode(" All caught up! "),o.createElementVNode("br"),o.createTextVNode(" Click 'Help' to restart. ")],-1)),X3=Uc(()=>o.createElementVNode("p",null,'Click "Next" to see the next item.',-1));function Q3(t,e,n,r,a,i){const s=Ut;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["help-mode-dialog",{finish:n.lastItem}])},[Y3,n.lastItem?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[Z3,o.createElementVNode("div",null,[o.createVNode(s,{class:"button",onClick:i.finishHelpMode},{default:o.withCtx(()=>[o.createTextVNode(" Finish ")]),_:1},8,["onClick"])])],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[X3,o.createElementVNode("div",null,[o.createVNode(s,{class:"button",onClick:i.showNext},{default:o.withCtx(()=>[o.createTextVNode(" Next ")]),_:1},8,["onClick"]),o.createVNode(s,{class:"button secondary",onClick:i.finishHelpMode},{default:o.withCtx(()=>[o.createTextVNode(" Exit Help Mode ")]),_:1},8,["onClick"])])],64))],2)}const J3=Jt(j3,[["render",Q3],["__scopeId","data-v-3efb89fb"]]),eP="https://citation.doi.org",tP=[{label:"APA",value:"apa"},{label:"Chicago",value:"chicago-note-bibliography"},{label:"IEEE",value:"ieee"},{label:"Bibtex",value:"bibtex"}],Gc="apa",nP=600,rP={name:"ExternalResourceCard",props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubMedReferences:[],openLibReferences:[],isbnDBReferences:[],referecesListContent:"",citationOptions:tP,citationType:Gc,crosscite_host:eP}},watch:{resources:function(t){this.formatReferences([...t]),this.getCitationText(Gc)}},computed:{referencesWithDOI:function(){return this.pubMedReferences.filter(e=>e.type==="doi"||e.doi).length}},mounted:function(){this.formatReferences([...this.resources]),this.getCitationText(Gc)},methods:{showRelatedConnectivities:function(t){this.$emit("show-reference-connectivities",t)},formatReferences:function(t){const e=this.extractNonPubMedReferences(t),n=t.filter(r=>!e.includes(r));this.pubMedReferences=n.map(r=>typeof r=="object"?this.extractPublicationIdFromURLString(r[0]):this.extractPublicationIdFromURLString(r)),this.pubMedReferences.forEach(r=>{if(r.type==="pmc"){const a=r.id;this.searchPMID(a).then(i=>{if(i&&i.esearchresult){const s=i.esearchresult.idlist||[];r.id=s[0],r.type="pmid"}})}}),this.formatNonPubMedReferences(e).then(r=>{this.openLibReferences=r.filter(a=>a.type==="openlib"),this.isbnDBReferences=r.filter(a=>a.type==="isbndb"),this.formatOpenLibReferences()})},extractNonPubMedReferences:function(t){const e=[],n=this.getPubMedDomains();return t.forEach(r=>{let a=0;n.forEach(i=>{r.includes(i)&&a++}),a||e.push(r)}),e},formatNonPubMedReferences:async function(t){const e=[],n=t.filter(c=>c.indexOf("isbn")!==-1),r=n.map(c=>"ISBN:"+c.split("/").pop()),a=r.join(","),i=r.slice(),s=c=>n.find(d=>d.includes(c)),l=`https://openlibrary.org/api/books?bibkeys=${a}&format=json`,u=await this.fetchData(l);for(const c in u){const d=i.indexOf(c);i.splice(d,1);const f=u[c].info_url,h=f.split("/"),v=h.indexOf("books"),p=h[v+1],g=c.split(":")[1],y=s(g);e.push({id:g,type:"openlib",url:f,bookId:p,resource:y})}return i.forEach(c=>{const d=c.split(":")[1],f=`https://isbndb.com/book/${d}`,h=s(d);e.push({id:d,url:f,type:"isbndb",resource:h})}),e},extractPublicationIdFromURLString:function(t){if(!t)return;const e=decodeURIComponent(t);let n={id:"",type:"",citation:{},resource:t};return this.getPubMedDomains().forEach(a=>{const i=e.lastIndexOf(a);i!==-1&&(n.id=e.slice(i+a.length),a==="doi.org/"?n.type="doi":a==="pmc/articles/"?n.type="pmc":n.type="pmid")}),n.id===""&&(t.includes("doi:")?(n.id=this.stripPMIDPrefix(t),n.type="doi"):t.includes("PMID:")&&(n.id=this.stripPMIDPrefix(t),n.type="pmid")),n.id.endsWith("/")&&(n.id=n.id.slice(0,-1)),n},getPubMedDomains:function(){return["doi.org/","nih.gov/pubmed/","pmc/articles/","pubmed.ncbi.nlm.nih.gov/"]},stripPMIDPrefix:function(t){return t.split(":")[1]},onCitationFormatChange:function(t){this.citationType=t,this.getCitationText(t)},generateCitationText:function(t,e){const{id:n,type:r,doi:a}=t;if(!(t.citation&&t.citation[e])&&n)if(t.citation[e]="",t.citation.error=null,r==="doi"||a){const i=r==="doi"?n:a;this.getCitationTextByDOI(i).then(s=>{const l=this.replaceLinkInText(s);t.citation[e]=l,this.updateCopyContents()}).catch(s=>{t.citation.error={type:e,ref:"doi"}})}else r==="pmid"&&this.getDOIFromPubMedID(n).then(i=>{if(i!=null&&i.result){const s=i.result[n],u=((s==null?void 0:s.articleids)||[]).find(d=>d.idtype==="doi"),c=u==null?void 0:u.value;if(c)t.doi=c,this.getCitationTextByDOI(c).then(d=>{const f=this.replaceLinkInText(d);t.citation[e]=f,this.updateCopyContents()}).catch(d=>{t.citation.error={type:e,ref:"doi"}});else{const{title:d,pubdate:f,authors:h}=s,v=h?h.map(g=>g.name):[],p=this.formatCopyReference({title:d||"",date:f||"",authors:v,url:`https://pubmed.ncbi.nlm.nih.gov/${n}`});t.citation[e]=p,this.updateCopyContents()}}}).catch(i=>{t.citation.error={type:e,ref:"pubmed"}})},getCitationText:function(t){async function e(n){for(let r=0;r<n.pubMedReferences.length;r++)n.generateCitationText(n.pubMedReferences[r],t),n.pubMedReferences.length>3&&r<n.pubMedReferences.length-1&&await e3(nP)}e(this)},reloadCitation:function(t){this.generateCitationText(t,this.citationType)},updateCopyContents:function(){const t=this.citationOptions.find(r=>r.value===this.citationType);let e="";const n=[];if(this.referencesWithDOI&&(e=t==null?void 0:t.label),this.pubMedReferences.forEach(r=>{n.push(r.citation[this.citationType])}),this.openLibReferences.forEach(r=>{n.push(this.formatCopyReference(r))}),this.isbnDBReferences.forEach(r=>{n.push(r.url)}),n.length){const a=`<ul>${n.map(s=>`<li>${s}</li>`).join(`
|
|
467
467
|
`)}</ul>`,i="<div><strong>References</strong></div>";this.referecesListContent=i+`
|
|
468
|
-
`+a}this.$emit("references-loaded",{style:e,list:n})},replaceLinkInText:function(t){const e="https://";let n=t.split(e)[1];if(n){n=n.split(" ")[0],n=n.trim(),n.endsWith(".")&&(n=n.substring(0,n.length-1));const r=e+n,a=`<a href="${r}" target="_blank">${r}</a>`;return t.replace(r,a)}return t},searchPMID:async function(t){const e=`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=${t}&format=json`;return await this.fetchData(e)},getCitationTextByDOI:async function(t){const e=`${this.crosscite_host}/format?doi=${t}&style=${this.citationType}&lang=en-US`;return await this.fetchData(e,"text")},getDOIFromPubMedID:async function(t){const e=`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=${t}&format=json`;return await this.fetchData(e)},formatOpenLibReferences:function(){this.openLibReferences.forEach(t=>{const{bookId:e}=t;this.getBookData(e).then(n=>{const{title:r,authors:a,publish_date:i}=n;r&&(t.title=r),i&&(t.date=i),a&&(t.authors=[],a.forEach(s=>{this.getBookAuthor(s.key).then(l=>{const{name:u}=l;u&&(t.authors.push(u),this.updateCopyContents())})})),this.updateCopyContents()})})},getBookData:async function(t){const e=`https://openlibrary.org/books/${t}.json`;return await this.fetchData(e)},getBookAuthor:async function(t){const e=`https://openlibrary.org${t}.json`;return await this.fetchData(e)},formatCopyReference:function(t){const e=[],{title:n,date:r,authors:a,url:i}=t;return n&&e.push(n),r&&e.push(`(${r})`),a&&e.push(`- ${a.join(", ")}`),e.push(`<div><a href="${i}" target="_blank">${i}</a></div>`),e.join(" ")},fetchData:async function(t,e){try{const n=await fetch(t);if(!n.ok)throw new Error(`Response status: ${n.status}`);return e==="text"?await n.text():await n.json()}catch(n){throw new Error(n)}}}},Zr=t=>(o.pushScopeId("data-v-44a32829"),t=t(),o.popScopeId(),t),rP={class:"resource-container"},aP={class:"attribute-title-container"},iP=Zr(()=>o.createElementVNode("div",{class:"attribute-title"},"References",-1)),oP={class:"copy-button"},sP={key:0,class:"citation-tabs"},lP={class:"citation-list"},cP=Zr(()=>o.createElementVNode("span",null,"Internal Server Error",-1)),uP=Zr(()=>o.createElementVNode("br",null,null,-1)),dP=Zr(()=>o.createElementVNode("br",null,null,-1)),fP=["href"],hP=Zr(()=>o.createElementVNode("br",null,null,-1)),pP=Zr(()=>o.createElementVNode("span",null,"Sorry, something went wrong.",-1)),vP=Zr(()=>o.createElementVNode("br",null,null,-1)),gP=["onClick"],mP=["innerHTML"],yP={class:"reference-button-container"},bP=["innerHTML"],wP={class:"reference-button-container"},CP=["href"],kP={class:"reference-button-container"};function xP(t,e,n,r,a,i){const s=$l,l=Qt;return o.openBlock(),o.createElementBlock("div",rP,[o.createElementVNode("div",aP,[iP,o.createElementVNode("div",oP,[o.createVNode(s,{label:"Copy list to clipboard",content:t.referecesListContent},null,8,["content"])])]),i.referencesWithDOI?(o.openBlock(),o.createElementBlock("div",sP,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.citationOptions,u=>(o.openBlock(),o.createBlock(l,{link:"",key:u.value,type:t.citationType===u.value?"primary":"",onClick:c=>i.onCitationFormatChange(u.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(u.label),1)]),_:2},1032,["type","onClick"]))),128))])):o.createCommentVNode("",!0),o.createElementVNode("ul",lP,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.pubMedReferences,u=>{var c,d,f,h;return o.openBlock(),o.createElementBlock("li",{key:u.id,class:o.normalizeClass({loading:u.citation&&!u.citation.error&&u.citation[t.citationType]==="",error:u.citation&&u.citation.error})},[u.citation?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[((c=u.citation.error)==null?void 0:c.ref)==="doi"&&((d=u.citation.error)==null?void 0:d.type)===t.citationType?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[cP,uP,o.createTextVNode(" Sorry, something went wrong."),dP,o.createTextVNode(" The dataset citation generator ("),o.createElementVNode("a",{href:t.crosscite_host,target:"_blank"},o.toDisplayString(t.crosscite_host),9,fP),o.createTextVNode(") encountered an internal error and was unable to complete your request."),hP,o.createTextVNode(" Please come back later. ")],64)):((f=u.citation.error)==null?void 0:f.ref)==="pubmed"&&((h=u.citation.error)==null?void 0:h.type)===t.citationType?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[pP,vP,o.createTextVNode(" Please try again. "),o.createElementVNode("span",{class:"reload-button",onClick:v=>i.reloadCitation(u)},"Reload",8,gP)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createElementVNode("span",{innerHTML:u.citation[t.citationType]},null,8,mP),o.createElementVNode("div",yP,[o.createVNode(l,{class:"reference-icon-button",size:"small",onClick:v=>i.showRelatedConnectivities(u.resource)},{default:o.withCtx(()=>[o.createTextVNode(" Show related connectivities ")]),_:2},1032,["onClick"])]),o.createVNode(s,{content:u.citation[t.citationType]},null,8,["content"])],64))],64)):o.createCommentVNode("",!0)],2)}),128)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.openLibReferences,u=>(o.openBlock(),o.createElementBlock("li",null,[o.createElementVNode("div",{innerHTML:i.formatCopyReference(u)},null,8,bP),o.createElementVNode("div",wP,[o.createVNode(l,{class:"reference-icon-button",size:"small",onClick:c=>i.showRelatedConnectivities(u.resource)},{default:o.withCtx(()=>[o.createTextVNode(" Show related connectivities ")]),_:2},1032,["onClick"])]),o.createVNode(s,{content:i.formatCopyReference(u)},null,8,["content"])]))),256)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.isbnDBReferences,u=>(o.openBlock(),o.createElementBlock("li",null,[o.createElementVNode("a",{href:u.url,target:"_blank"},o.toDisplayString(u.url),9,CP),o.createElementVNode("div",kP,[o.createVNode(l,{class:"reference-icon-button",size:"small",onClick:c=>i.showRelatedConnectivities(u.resource)},{default:o.withCtx(()=>[o.createTextVNode(" Show related connectivities ")]),_:2},1032,["onClick"])]),o.createVNode(s,{content:u.url},null,8,["content"])]))),256))])])}const Wc=Jt(nP,[["render",xP],["__scopeId","data-v-44a32829"]]);function EP(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r?r.push(n):t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var r=t.get(e);r&&r.slice().map(function(a){a(n)}),(r=t.get("*"))&&r.slice().map(function(a){a(e,n)})}}}const Tg=new EP,SP={name:"ProvenancePopup",components:{ElIconArrowUp:Xs,ElIconArrowDown:Ya,ElIconWarning:fo,ConnectivityList:zc,ExternalResourceCard:Wc},props:{tooltipEntry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})}},inject:["getFeaturesAlert"],data:function(){return{loading:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},origins:[],components:[],destinations:[],originsWithDatasets:[],componentsWithDatasets:[],destinationsWithDatasets:[],availableAnatomyFacets:[]}},watch:{tooltipEntry:{handler:function(t){this.updateConnectionsData(t)},immediate:!0,deep:!0}},computed:{featuresAlert(){return this.getFeaturesAlert()},resources:function(){let t=[];return this.tooltipEntry&&this.tooltipEntry.hyperlinks&&(t=this.tooltipEntry.hyperlinks),t},originDescription:function(){return this.tooltipEntry&&this.tooltipEntry.title&&this.tooltipEntry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let t="Studied in";return this.tooltipEntry.provenanceTaxonomyLabel.forEach(e=>{t+=` ${e},`}),t=t.slice(0,-1),t+=" species",t}},mounted:function(){this.loadAvailableAnatomyFacets(),this.updateConnectionsData(this.tooltipEntry)},methods:{titleCase:function(t){return Q_(t)},capitalise:function(t){return Kv(t)},onConnectivityActionClick:function(t){Tg.emit("onActionClick",t)},loadAvailableAnatomyFacets:function(){const t=localStorage.getItem("available-anatomy-facets");t&&(this.availableAnatomyFacets=JSON.parse(t))},updateConnectionsData:function(t){this.origins=t.origins,this.components=t.components,this.destinations=t.destinations,this.originsWithDatasets=t.originsWithDatasets,this.componentsWithDatasets=t.componentsWithDatasets,this.destinationsWithDatasets=t.destinationsWithDatasets}}},TP=t=>(o.pushScopeId("data-v-ebba8dc2"),t=t(),o.popScopeId(),t),BP={key:0,class:"main"},NP={key:0,class:"block"},DP={class:"title"},_P={key:0,class:"subtitle"},PP={key:1,class:"block"},OP={class:"title"},IP={key:2,class:"attribute-title-container"},LP=TP(()=>o.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),MP={style:{"word-break":"keep-all"}},FP={class:"content-container scrollbar"};function AP(t,e,n,r,a,i){const s=fo,l=ot,u=vi,c=Xs,d=Ya,f=zc,h=Wc,v=Rl;return n.tooltipEntry?o.withDirectives((o.openBlock(),o.createElementBlock("div",BP,[n.tooltipEntry.title?(o.openBlock(),o.createElementBlock("div",NP,[o.createElementVNode("div",DP,o.toDisplayString(i.capitalise(n.tooltipEntry.title)),1),n.tooltipEntry.provenanceTaxonomyLabel&&n.tooltipEntry.provenanceTaxonomyLabel.length>0?(o.openBlock(),o.createElementBlock("div",_P,o.toDisplayString(i.provSpeciesDescription),1)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",PP,[o.createElementVNode("div",OP,o.toDisplayString(n.tooltipEntry.featureId),1)])),i.featuresAlert?(o.openBlock(),o.createElementBlock("div",IP,[LP,o.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("span",MP,o.toDisplayString(i.featuresAlert),1)]),_:1})])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{class:"hide",id:"hide-path-info",onClick:e[0]||(e[0]=p=>t.showDetails=!1)},[o.createTextVNode(" Hide path information "),o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(c)]),_:1})],512),[[o.vShow,t.showDetails]]),o.withDirectives(o.createElementVNode("div",{class:"hide",id:"show-path-info",onClick:e[1]||(e[1]=p=>t.showDetails=!0)},[o.createTextVNode(" Show path information "),o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(d)]),_:1})],512),[[o.vShow,!t.showDetails]]),o.createVNode(o.Transition,{name:"slide-fade"},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",FP,[(o.openBlock(),o.createBlock(f,{key:n.tooltipEntry.featureId[0],entry:n.tooltipEntry,origins:t.origins,components:t.components,destinations:t.destinations,originsWithDatasets:t.originsWithDatasets,componentsWithDatasets:t.componentsWithDatasets,destinationsWithDatasets:t.destinationsWithDatasets,availableAnatomyFacets:t.availableAnatomyFacets,onConnectivityActionClick:i.onConnectivityActionClick},null,8,["entry","origins","components","destinations","originsWithDatasets","componentsWithDatasets","destinationsWithDatasets","availableAnatomyFacets","onConnectivityActionClick"])),i.resources.length?(o.openBlock(),o.createBlock(h,{key:0,resources:i.resources},null,8,["resources"])):o.createCommentVNode("",!0)],512),[[o.vShow,t.showDetails]])]),_:1})])),[[v,t.loading]]):o.createCommentVNode("",!0)}const VP=Jt(SP,[["render",AP],["__scopeId","data-v-ebba8dc2"]]),RP={name:"Tooltip",props:{tooltipEntry:{type:Object},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Object}},mounted:function(){Tg.on("onActionClick",t=>{this.$emit("onActionClick",t)})}},$P={class:"tooltip-container",id:"tooltip-container"};function zP(t,e,n,r,a,i){const s=$f,l=VP;return o.openBlock(),o.createElementBlock("div",$P,[n.annotationDisplay?(o.openBlock(),o.createBlock(s,{key:0,annotationEntry:n.annotationEntry,onAnnotation:e[0]||(e[0]=u=>t.$emit("annotation",u))},null,8,["annotationEntry"])):(o.openBlock(),o.createBlock(l,{key:1,tooltipEntry:n.tooltipEntry},null,8,["tooltipEntry"]))])}const HP=Jt(RP,[["render",zP],["__scopeId","data-v-229b3988"]]),KP={name:"TreeControls",props:{mapType:{type:String,required:!0},isReady:{type:Boolean,default:!0},title:{type:String},treeData:{type:Array,default:function(){return[]}},showColourPicker:{type:Boolean,default:!1},active:{type:[String,Array],required:!0},hover:{type:[String,Array],required:!0},enableFilter:{type:Boolean,default:!0}},data:function(){return{defaultExpandedKeys:["All"],filterText:"",myPopperClass:"hide-scaffold-colour-popup",tooltipVisible:!1,tooltipLabel:"",tooltipAtBottom:!1}},computed:{isFlatmap:function(){return this.mapType==="flatmap"},isScaffold:function(){return this.mapType==="scaffold"},nodeKey:function(){if(this.isFlatmap)return"key";if(this.isScaffold)return"id"},expandedKeys:function(){if(this.isFlatmap)return this.defaultExpandedKeys;if(this.isScaffold)return[]}},watch:{showColourPicker:{immediate:!0,handler:function(){this.showColourPicker?this.myPopperClass="showPicker":this.myPopperClass="hide-scaffold-colour-popup"}},filterText:{handler:function(t){this.$refs.regionTree&&this.$refs.regionTree.filter(t)}}},methods:{filterNode:function(t,e){return t?e.label?e.label.toLowerCase().includes(t.toLowerCase()):!1:!0},setColour:function(t,e){this.$emit("setColour",t,e)},getBackgroundStyles:function(t){return"colour"in t?{background:t.colour}:{}},nodeIsActive:function(t){return this.active===t.models},nodeIsHover:function(t){return this.hover===t.models},changeActiveByNode:function(t,e=!1){this.isFlatmap?t.models&&this.$emit("changeActive",t.models):this.isScaffold&&(t.isPrimitives||t.isRegion)&&this.$emit("changeActive",t,e)},changeHoverByNode:function(t,e=!1){this.isFlatmap?t.models&&this.$emit("changeHover",t.models):this.isScaffold&&t.isPrimitives&&this.$emit("changeHover",t,e)},checkChanged:function(t,e){if(this.isFlatmap){const n=e.checkedKeys.includes(t.key);t.key==="All"?this.$emit("checkAll",n):this.$emit("checkChanged",{key:t.key,value:n})}else this.isScaffold&&this.$emit("checkChanged",t,e)},displayTooltip:function(t,e,n){const a=n.target.closest(".el-tree-node__content"),i=a.clientWidth,s=a.getBoundingClientRect().x,l=a.querySelector(".lastChildInItem");let u=0;if(l){const d=l.getBoundingClientRect();u=d.x+d.width-s}const c=u>i;this.tooltipVisible=c&&e,this.tooltipLabel=t,this.tooltipAtBottom=.5>n.layerY/this.$refs.treeContainer.clientHeight}},unmounted:function(){this.sortedPrimitiveGroups=void 0},mounted:function(){this.$refs.regionTree&&this.$refs.regionTree.filter(this.filterText)}},qP={class:"selections-container"},UP={class:"title-text"},GP={class:"tree-container",ref:"treeContainer"},WP={class:"tooltip-text"},jP=["onClick","onMouseover","onMouseenter"],YP=["onClick","onMouseover","onMouseenter"],ZP={class:"lastChildInItem"},XP={key:0,class:"node-options"};function QP(t,e,n,r,a,i){const s=ui,l=si,u=Do,c=vi,d=lx,f=dE,h=Rl;return o.openBlock(),o.createElementBlock("div",qP,[n.title?(o.openBlock(),o.createBlock(u,{key:0},{default:o.withCtx(()=>[o.createVNode(s,{span:12},{default:o.withCtx(()=>[o.createElementVNode("div",UP,o.toDisplayString(n.title),1)]),_:1}),n.enableFilter?(o.openBlock(),o.createBlock(s,{key:0,span:12},{default:o.withCtx(()=>[o.createElementVNode("div",null,[o.createVNode(l,{class:"tree-filter-input",modelValue:t.filterText,"onUpdate:modelValue":e[0]||(e[0]=v=>t.filterText=v),placeholder:"Filter "+n.title},null,8,["modelValue","placeholder"])])]),_:1})):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0),o.createElementVNode("div",GP,[o.createElementVNode("div",{class:o.normalizeClass(["tree-tooltip",t.tooltipAtBottom?"bottom":""])},[o.createVNode(c,{ref:"tooltip",visible:t.tooltipVisible&&t.tooltipLabel!=="",placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tree-tooltip-popper","virtual-triggering":"",width:260},{default:o.withCtx(()=>[o.createElementVNode("div",WP,o.toDisplayString(t.tooltipLabel),1)]),_:1},8,["visible"])],2),o.withDirectives((o.openBlock(),o.createBlock(f,{ref:"regionTree","element-loading-background":"rgba(0, 0, 0, 0.3)","show-checkbox":"","node-key":i.nodeKey,data:n.treeData,"check-strictly":!1,"expand-on-click-node":!1,"render-after-expand":!1,"default-expanded-keys":i.expandedKeys,onCheck:i.checkChanged,indent:8,"filter-node-method":i.filterNode,class:o.normalizeClass([n.mapType==="flatmap"?"hide_grandchildren_checkbox":""])},{default:o.withCtx(({node:v,data:p})=>[n.mapType==="flatmap"?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["region-tree-node",{activeItem:i.nodeIsActive(p),hoverItem:i.nodeIsHover(p)}]),onClick:g=>i.changeActiveByNode(p),onMouseover:g=>i.changeHoverByNode(p,!1),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[1]||(e[1]=g=>i.displayTooltip("",!1,g))},[o.createElementVNode("div",{style:o.normalizeStyle(i.getBackgroundStyles(p)),class:"lastChildInItem"},o.toDisplayString(v.label),5)],42,jP)):n.mapType==="scaffold"?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["region-tree-node",{activeItem:n.active.includes(p.id),hoverItem:n.hover.includes(p.id)}]),onClick:g=>i.changeActiveByNode(p,!0),onMouseover:g=>i.changeHoverByNode(p,!0,g),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[2]||(e[2]=g=>i.displayTooltip("",!1,g))},[p.isPrimitives?(o.openBlock(),o.createBlock(d,{key:0,class:o.normalizeClass({"show-picker":n.showColourPicker}),modelValue:p.activeColour,"onUpdate:modelValue":g=>p.activeColour=g,size:"small","popper-class":t.myPopperClass,onChange:g=>i.setColour(p,g)},null,8,["class","modelValue","onUpdate:modelValue","popper-class","onChange"])):o.createCommentVNode("",!0),o.createElementVNode("div",ZP,[o.createElementVNode("span",null,o.toDisplayString(v.label),1),p.isTextureSlides?(o.openBlock(),o.createElementBlock("span",XP," (Texture) ")):o.createCommentVNode("",!0)])],42,YP)):o.createCommentVNode("",!0)]),_:1},8,["node-key","data","default-expanded-keys","onCheck","filter-node-method","class"])),[[h,!n.isReady]])],512)])}const JP=Jt(KP,[["render",QP],["__scopeId","data-v-823a8388"]]);Fe.AnnotationPopup=$f,Fe.ConnectivityGraph=X_,Fe.ConnectivityList=zc,Fe.CopyToClipboard=$l,Fe.CreateTooltipContent=KE,Fe.DrawToolbar=G3,Fe.ExternalResourceCard=Wc,Fe.HelpModeDialog=Q3,Fe.Tooltip=HP,Fe.TreeControls=JP,Object.defineProperty(Fe,Symbol.toStringTag,{value:"Module"})});
|
|
468
|
+
`+a}this.$emit("references-loaded",{style:e,list:n})},replaceLinkInText:function(t){const e="https://";let n=t.split(e)[1];if(n){n=n.split(" ")[0],n=n.trim(),n.endsWith(".")&&(n=n.substring(0,n.length-1));const r=e+n,a=`<a href="${r}" target="_blank">${r}</a>`;return t.replace(r,a)}return t},searchPMID:async function(t){const e=`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=${t}&format=json`;return await this.fetchData(e)},getCitationTextByDOI:async function(t){const e=`${this.crosscite_host}/format?doi=${t}&style=${this.citationType}&lang=en-US`;return await this.fetchData(e,"text")},getDOIFromPubMedID:async function(t){const e=`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=${t}&format=json`;return await this.fetchData(e)},formatOpenLibReferences:function(){this.openLibReferences.forEach(t=>{const{bookId:e}=t;this.getBookData(e).then(n=>{const{title:r,authors:a,publish_date:i}=n;r&&(t.title=r),i&&(t.date=i),a&&(t.authors=[],a.forEach(s=>{this.getBookAuthor(s.key).then(l=>{const{name:u}=l;u&&(t.authors.push(u),this.updateCopyContents())})})),this.updateCopyContents()})})},getBookData:async function(t){const e=`https://openlibrary.org/books/${t}.json`;return await this.fetchData(e)},getBookAuthor:async function(t){const e=`https://openlibrary.org${t}.json`;return await this.fetchData(e)},formatCopyReference:function(t){const e=[],{title:n,date:r,authors:a,url:i}=t;return n&&e.push(n),r&&e.push(`(${r})`),a&&e.push(`- ${a.join(", ")}`),e.push(`<div><a href="${i}" target="_blank">${i}</a></div>`),e.join(" ")},fetchData:async function(t,e){try{const n=await fetch(t);if(!n.ok)throw new Error(`Response status: ${n.status}`);return e==="text"?await n.text():await n.json()}catch(n){throw new Error(n)}}}},Zr=t=>(o.pushScopeId("data-v-44a32829"),t=t(),o.popScopeId(),t),aP={class:"resource-container"},iP={class:"attribute-title-container"},oP=Zr(()=>o.createElementVNode("div",{class:"attribute-title"},"References",-1)),sP={class:"copy-button"},lP={key:0,class:"citation-tabs"},cP={class:"citation-list"},uP=Zr(()=>o.createElementVNode("span",null,"Internal Server Error",-1)),dP=Zr(()=>o.createElementVNode("br",null,null,-1)),fP=Zr(()=>o.createElementVNode("br",null,null,-1)),hP=["href"],pP=Zr(()=>o.createElementVNode("br",null,null,-1)),vP=Zr(()=>o.createElementVNode("span",null,"Sorry, something went wrong.",-1)),gP=Zr(()=>o.createElementVNode("br",null,null,-1)),mP=["onClick"],yP=["innerHTML"],bP={class:"reference-button-container"},wP=["innerHTML"],CP={class:"reference-button-container"},kP=["href"],xP={class:"reference-button-container"};function EP(t,e,n,r,a,i){const s=$l,l=Ut;return o.openBlock(),o.createElementBlock("div",aP,[o.createElementVNode("div",iP,[oP,o.createElementVNode("div",sP,[o.createVNode(s,{label:"Copy list to clipboard",content:t.referecesListContent},null,8,["content"])])]),i.referencesWithDOI?(o.openBlock(),o.createElementBlock("div",lP,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.citationOptions,u=>(o.openBlock(),o.createBlock(l,{link:"",key:u.value,type:t.citationType===u.value?"primary":"",onClick:c=>i.onCitationFormatChange(u.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(u.label),1)]),_:2},1032,["type","onClick"]))),128))])):o.createCommentVNode("",!0),o.createElementVNode("ul",cP,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.pubMedReferences,u=>{var c,d,f,h;return o.openBlock(),o.createElementBlock("li",{key:u.id,class:o.normalizeClass({loading:u.citation&&!u.citation.error&&u.citation[t.citationType]==="",error:u.citation&&u.citation.error})},[u.citation?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[((c=u.citation.error)==null?void 0:c.ref)==="doi"&&((d=u.citation.error)==null?void 0:d.type)===t.citationType?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[uP,dP,o.createTextVNode(" Sorry, something went wrong."),fP,o.createTextVNode(" The dataset citation generator ("),o.createElementVNode("a",{href:t.crosscite_host,target:"_blank"},o.toDisplayString(t.crosscite_host),9,hP),o.createTextVNode(") encountered an internal error and was unable to complete your request."),pP,o.createTextVNode(" Please come back later. ")],64)):((f=u.citation.error)==null?void 0:f.ref)==="pubmed"&&((h=u.citation.error)==null?void 0:h.type)===t.citationType?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[vP,gP,o.createTextVNode(" Please try again. "),o.createElementVNode("span",{class:"reload-button",onClick:v=>i.reloadCitation(u)},"Reload",8,mP)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createElementVNode("span",{innerHTML:u.citation[t.citationType]},null,8,yP),o.createElementVNode("div",bP,[o.createVNode(l,{class:"reference-icon-button",size:"small",onClick:v=>i.showRelatedConnectivities(u.resource)},{default:o.withCtx(()=>[o.createTextVNode(" Show related connectivities ")]),_:2},1032,["onClick"])]),o.createVNode(s,{content:u.citation[t.citationType]},null,8,["content"])],64))],64)):o.createCommentVNode("",!0)],2)}),128)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.openLibReferences,u=>(o.openBlock(),o.createElementBlock("li",null,[o.createElementVNode("div",{innerHTML:i.formatCopyReference(u)},null,8,wP),o.createElementVNode("div",CP,[o.createVNode(l,{class:"reference-icon-button",size:"small",onClick:c=>i.showRelatedConnectivities(u.resource)},{default:o.withCtx(()=>[o.createTextVNode(" Show related connectivities ")]),_:2},1032,["onClick"])]),o.createVNode(s,{content:i.formatCopyReference(u)},null,8,["content"])]))),256)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.isbnDBReferences,u=>(o.openBlock(),o.createElementBlock("li",null,[o.createElementVNode("a",{href:u.url,target:"_blank"},o.toDisplayString(u.url),9,kP),o.createElementVNode("div",xP,[o.createVNode(l,{class:"reference-icon-button",size:"small",onClick:c=>i.showRelatedConnectivities(u.resource)},{default:o.withCtx(()=>[o.createTextVNode(" Show related connectivities ")]),_:2},1032,["onClick"])]),o.createVNode(s,{content:u.url},null,8,["content"])]))),256))])])}const Wc=Jt(rP,[["render",EP],["__scopeId","data-v-44a32829"]]);function SP(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r?r.push(n):t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var r=t.get(e);r&&r.slice().map(function(a){a(n)}),(r=t.get("*"))&&r.slice().map(function(a){a(e,n)})}}}const Tg=new SP,TP={name:"ProvenancePopup",components:{ElIconArrowUp:Xs,ElIconArrowDown:Za,ElIconWarning:fo,ConnectivityList:zc,ExternalResourceCard:Wc},props:{tooltipEntry:{type:Array,default:[]}},data:function(){return{loading:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},entryIndex:0,availableAnatomyFacets:[]}},computed:{entry:function(){return this.tooltipEntry[this.entryIndex]},previousLabel:function(){var t;return this.entryIndex===0?"This is the first item. Click 'Next' to see more information.":(t=this.tooltipEntry[this.entryIndex-1])==null?void 0:t.title},nextLabel:function(){var t;return this.entryIndex===this.tooltipEntry.length-1?"This is the last item. Click 'Previous' to see more information.":(t=this.tooltipEntry[this.entryIndex+1])==null?void 0:t.title},provSpeciesDescription:function(){let t="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(e=>{t+=` ${e},`}),t=t.slice(0,-1),t+=" species",t},origins:function(){return this.entry.origins},components:function(){return this.entry.components},destinations:function(){return this.entry.destinations},originsWithDatasets:function(){return this.entry.originsWithDatasets},componentsWithDatasets:function(){return this.entry.componentsWithDatasets},destinationsWithDatasets:function(){return this.entry.destinationsWithDatasets},resources:function(){return this.entry.hyperlinks}},mounted:function(){this.loadAvailableAnatomyFacets()},methods:{previous:function(){this.entryIndex!==0&&(this.entryIndex=this.entryIndex-1)},next:function(){this.entryIndex!==this.tooltipEntry.length-1&&(this.entryIndex=this.entryIndex+1)},titleCase:function(t){return J_(t)},capitalise:function(t){return Kv(t)},onConnectivityActionClick:function(t){Tg.emit("onActionClick",t)},loadAvailableAnatomyFacets:function(){const t=localStorage.getItem("available-anatomy-facets");t&&(this.availableAnatomyFacets=JSON.parse(t))}}},BP=t=>(o.pushScopeId("data-v-697bbd67"),t=t(),o.popScopeId(),t),NP={key:0,class:"main"},DP={key:0,class:"toggle-button"},_P={key:1,class:"block"},PP={class:"title"},IP={key:0,class:"subtitle"},OP={key:2,class:"block"},LP={class:"title"},MP={key:3,class:"attribute-title-container"},FP=BP(()=>o.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),AP={style:{"word-break":"keep-all"}},VP={class:"content-container scrollbar"};function RP(t,e,n,r,a,i){const s=Ut,l=ha,u=fo,c=ot,d=Xs,f=Za,h=zc,v=Wc,p=Rl;return i.entry?o.withDirectives((o.openBlock(),o.createElementBlock("div",NP,[n.tooltipEntry.length>1?(o.openBlock(),o.createElementBlock("div",DP,[o.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:o.withCtx(()=>[o.createVNode(s,{class:"button",onClick:i.previous,disabled:this.entryIndex===0},{default:o.withCtx(()=>[o.createTextVNode(" Previous ")]),_:1},8,["onClick","disabled"])]),default:o.withCtx(()=>[o.createElementVNode("span",null,o.toDisplayString(i.previousLabel),1)]),_:1}),o.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:o.withCtx(()=>[o.createVNode(s,{class:"button",onClick:i.next,disabled:this.entryIndex===this.tooltipEntry.length-1},{default:o.withCtx(()=>[o.createTextVNode(" Next ")]),_:1},8,["onClick","disabled"])]),default:o.withCtx(()=>[o.createElementVNode("span",null,o.toDisplayString(i.nextLabel),1)]),_:1})])):o.createCommentVNode("",!0),i.entry.title?(o.openBlock(),o.createElementBlock("div",_P,[o.createElementVNode("div",PP,o.toDisplayString(i.capitalise(i.entry.title)),1),i.entry.provenanceTaxonomyLabel&&i.entry.provenanceTaxonomyLabel.length>0?(o.openBlock(),o.createElementBlock("div",IP,o.toDisplayString(i.provSpeciesDescription),1)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",OP,[o.createElementVNode("div",LP,o.toDisplayString(i.entry.featureId),1)])),i.entry.featuresAlert?(o.openBlock(),o.createElementBlock("div",MP,[FP,o.createVNode(l,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(c,{class:"info"},{default:o.withCtx(()=>[o.createVNode(u)]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("span",AP,o.toDisplayString(i.entry.featuresAlert),1)]),_:1})])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{class:"hide",id:"hide-path-info",onClick:e[0]||(e[0]=g=>t.showDetails=!1)},[o.createTextVNode(" Hide path information "),o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(d)]),_:1})],512),[[o.vShow,t.showDetails]]),o.withDirectives(o.createElementVNode("div",{class:"hide",id:"show-path-info",onClick:e[1]||(e[1]=g=>t.showDetails=!0)},[o.createTextVNode(" Show path information "),o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(f)]),_:1})],512),[[o.vShow,!t.showDetails]]),o.createVNode(o.Transition,{name:"slide-fade"},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",VP,[(o.openBlock(),o.createBlock(h,{key:i.entry.featureId[0],entry:i.entry,origins:i.origins,components:i.components,destinations:i.destinations,originsWithDatasets:i.originsWithDatasets,componentsWithDatasets:i.componentsWithDatasets,destinationsWithDatasets:i.destinationsWithDatasets,availableAnatomyFacets:t.availableAnatomyFacets,onConnectivityActionClick:i.onConnectivityActionClick},null,8,["entry","origins","components","destinations","originsWithDatasets","componentsWithDatasets","destinationsWithDatasets","availableAnatomyFacets","onConnectivityActionClick"])),i.resources.length?(o.openBlock(),o.createBlock(v,{key:0,resources:i.resources},null,8,["resources"])):o.createCommentVNode("",!0)],512),[[o.vShow,t.showDetails]])]),_:1})])),[[p,t.loading]]):o.createCommentVNode("",!0)}const $P=Jt(TP,[["render",RP],["__scopeId","data-v-697bbd67"]]),zP={name:"Tooltip",props:{tooltipEntry:{type:Array},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Array}},mounted:function(){Tg.on("onActionClick",t=>{this.$emit("onActionClick",t)})}},HP={class:"tooltip-container",id:"tooltip-container"};function KP(t,e,n,r,a,i){const s=$f,l=$P;return o.openBlock(),o.createElementBlock("div",HP,[n.annotationDisplay?(o.openBlock(),o.createBlock(s,{key:0,annotationEntry:n.annotationEntry,onAnnotation:e[0]||(e[0]=u=>t.$emit("annotation",u))},null,8,["annotationEntry"])):(o.openBlock(),o.createBlock(l,{key:1,tooltipEntry:n.tooltipEntry},null,8,["tooltipEntry"]))])}const qP=Jt(zP,[["render",KP],["__scopeId","data-v-d1e37cc2"]]),UP={name:"TreeControls",props:{mapType:{type:String,required:!0},isReady:{type:Boolean,default:!0},title:{type:String},treeData:{type:Array,default:function(){return[]}},showColourPicker:{type:Boolean,default:!1},active:{type:[String,Array],required:!0},hover:{type:[String,Array],required:!0},enableFilter:{type:Boolean,default:!0}},data:function(){return{defaultExpandedKeys:["All"],filterText:"",myPopperClass:"hide-scaffold-colour-popup",tooltipVisible:!1,tooltipLabel:"",tooltipAtBottom:!1}},computed:{isFlatmap:function(){return this.mapType==="flatmap"},isScaffold:function(){return this.mapType==="scaffold"},nodeKey:function(){if(this.isFlatmap)return"key";if(this.isScaffold)return"id"},expandedKeys:function(){if(this.isFlatmap)return this.defaultExpandedKeys;if(this.isScaffold)return[]}},watch:{showColourPicker:{immediate:!0,handler:function(){this.showColourPicker?this.myPopperClass="showPicker":this.myPopperClass="hide-scaffold-colour-popup"}},filterText:{handler:function(t){this.$refs.regionTree&&this.$refs.regionTree.filter(t)}}},methods:{filterNode:function(t,e){return t?e.label?e.label.toLowerCase().includes(t.toLowerCase()):!1:!0},setColour:function(t,e){this.$emit("setColour",t,e)},getBackgroundStyles:function(t){return"colour"in t?{background:t.colour}:{}},nodeIsActive:function(t){return this.active===t.models},nodeIsHover:function(t){return this.hover===t.models},changeActiveByNode:function(t,e=!1){this.isFlatmap?t.models&&this.$emit("changeActive",t.models):this.isScaffold&&(t.isPrimitives||t.isRegion)&&this.$emit("changeActive",t,e)},changeHoverByNode:function(t,e=!1){this.isFlatmap?t.models&&this.$emit("changeHover",t.models):this.isScaffold&&t.isPrimitives&&this.$emit("changeHover",t,e)},checkChanged:function(t,e){if(this.isFlatmap){const n=e.checkedKeys.includes(t.key);t.key==="All"?this.$emit("checkAll",n):this.$emit("checkChanged",{key:t.key,value:n})}else this.isScaffold&&this.$emit("checkChanged",t,e)},displayTooltip:function(t,e,n){const a=n.target.closest(".el-tree-node__content"),i=a.clientWidth,s=a.getBoundingClientRect().x,l=a.querySelector(".lastChildInItem");let u=0;if(l){const d=l.getBoundingClientRect();u=d.x+d.width-s}const c=u>i;this.tooltipVisible=c&&e,this.tooltipLabel=t,this.tooltipAtBottom=.5>n.layerY/this.$refs.treeContainer.clientHeight}},unmounted:function(){this.sortedPrimitiveGroups=void 0},mounted:function(){this.$refs.regionTree&&this.$refs.regionTree.filter(this.filterText)}},GP={class:"selections-container"},WP={class:"title-text"},jP={class:"tree-container",ref:"treeContainer"},YP={class:"tooltip-text"},ZP=["onClick","onMouseover","onMouseenter"],XP=["onClick","onMouseover","onMouseenter"],QP={class:"lastChildInItem"},JP={key:0,class:"node-options"};function eI(t,e,n,r,a,i){const s=di,l=li,u=Do,c=ha,d=lx,f=dE,h=Rl;return o.openBlock(),o.createElementBlock("div",GP,[n.title?(o.openBlock(),o.createBlock(u,{key:0},{default:o.withCtx(()=>[o.createVNode(s,{span:12},{default:o.withCtx(()=>[o.createElementVNode("div",WP,o.toDisplayString(n.title),1)]),_:1}),n.enableFilter?(o.openBlock(),o.createBlock(s,{key:0,span:12},{default:o.withCtx(()=>[o.createElementVNode("div",null,[o.createVNode(l,{class:"tree-filter-input",modelValue:t.filterText,"onUpdate:modelValue":e[0]||(e[0]=v=>t.filterText=v),placeholder:"Filter "+n.title},null,8,["modelValue","placeholder"])])]),_:1})):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0),o.createElementVNode("div",jP,[o.createElementVNode("div",{class:o.normalizeClass(["tree-tooltip",t.tooltipAtBottom?"bottom":""])},[o.createVNode(c,{ref:"tooltip",visible:t.tooltipVisible&&t.tooltipLabel!=="",placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tree-tooltip-popper","virtual-triggering":"",width:260},{default:o.withCtx(()=>[o.createElementVNode("div",YP,o.toDisplayString(t.tooltipLabel),1)]),_:1},8,["visible"])],2),o.withDirectives((o.openBlock(),o.createBlock(f,{ref:"regionTree","element-loading-background":"rgba(0, 0, 0, 0.3)","show-checkbox":"","node-key":i.nodeKey,data:n.treeData,"check-strictly":!1,"expand-on-click-node":!1,"render-after-expand":!1,"default-expanded-keys":i.expandedKeys,onCheck:i.checkChanged,indent:8,"filter-node-method":i.filterNode,class:o.normalizeClass([n.mapType==="flatmap"?"hide_grandchildren_checkbox":""])},{default:o.withCtx(({node:v,data:p})=>[n.mapType==="flatmap"?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["region-tree-node",{activeItem:i.nodeIsActive(p),hoverItem:i.nodeIsHover(p)}]),onClick:g=>i.changeActiveByNode(p),onMouseover:g=>i.changeHoverByNode(p,!1),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[1]||(e[1]=g=>i.displayTooltip("",!1,g))},[o.createElementVNode("div",{style:o.normalizeStyle(i.getBackgroundStyles(p)),class:"lastChildInItem"},o.toDisplayString(v.label),5)],42,ZP)):n.mapType==="scaffold"?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["region-tree-node",{activeItem:n.active.includes(p.id),hoverItem:n.hover.includes(p.id)}]),onClick:g=>i.changeActiveByNode(p,!0),onMouseover:g=>i.changeHoverByNode(p,!0,g),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[2]||(e[2]=g=>i.displayTooltip("",!1,g))},[p.isPrimitives?(o.openBlock(),o.createBlock(d,{key:0,class:o.normalizeClass({"show-picker":n.showColourPicker}),modelValue:p.activeColour,"onUpdate:modelValue":g=>p.activeColour=g,size:"small","popper-class":t.myPopperClass,onChange:g=>i.setColour(p,g)},null,8,["class","modelValue","onUpdate:modelValue","popper-class","onChange"])):o.createCommentVNode("",!0),o.createElementVNode("div",QP,[o.createElementVNode("span",null,o.toDisplayString(v.label),1),p.isTextureSlides?(o.openBlock(),o.createElementBlock("span",JP," (Texture) ")):o.createCommentVNode("",!0)])],42,XP)):o.createCommentVNode("",!0)]),_:1},8,["node-key","data","default-expanded-keys","onCheck","filter-node-method","class"])),[[h,!n.isReady]])],512)])}const tI=Jt(UP,[["render",eI],["__scopeId","data-v-823a8388"]]);Fe.AnnotationPopup=$f,Fe.ConnectivityGraph=Q_,Fe.ConnectivityList=zc,Fe.CopyToClipboard=$l,Fe.CreateTooltipContent=qE,Fe.DrawToolbar=W3,Fe.ExternalResourceCard=Wc,Fe.HelpModeDialog=J3,Fe.Tooltip=qP,Fe.TreeControls=tI,Object.defineProperty(Fe,Symbol.toStringTag,{value:"Module"})});
|