@abi-software/map-utilities 1.2.2-beta.5 → 1.2.2-beta.6

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.
@@ -1,15 +1,15 @@
1
- (function(Re,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(Re=typeof globalThis<"u"?globalThis:Re||self,o(Re.MapUtilities={},Re.Vue))})(this,function(Re,o){"use strict";var T_=Object.defineProperty;var B_=(Re,o,Ft)=>o in Re?T_(Re,o,{enumerable:!0,configurable:!0,writable:!0,value:Ft}):Re[o]=Ft;var gr=(Re,o,Ft)=>B_(Re,typeof o!="symbol"?o+"":o,Ft);const Ft=(t,e,{checkForDefaultPrevented:r=!0}={})=>a=>{const i=t==null?void 0:t(a);if(r===!1||!i)return e==null?void 0:e(a)};var Kc;const et=typeof window<"u",Tg=t=>typeof t=="string",qc=()=>{},Ds=et&&((Kc=window==null?void 0:window.navigator)==null?void 0:Kc.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Uc(t){return typeof t=="function"?t():o.unref(t)}function Bg(t){return t}function ji(t){return o.getCurrentScope()?(o.onScopeDispose(t),!0):!1}function Ng(t,e=!0){o.getCurrentInstance()?o.onMounted(t):e?t():o.nextTick(t)}function Dr(t){var e;const r=Uc(t);return(e=r==null?void 0:r.$el)!=null?e:r}const Yi=et?window:void 0;function jt(...t){let e,r,n,a;if(Tg(t[0])||Array.isArray(t[0])?([r,n,a]=t,e=Yi):[e,r,n,a]=t,!e)return qc;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const i=[],s=()=>{i.forEach(d=>d()),i.length=0},l=(d,f,p,v)=>(d.addEventListener(f,p,v),()=>d.removeEventListener(f,p,v)),c=o.watch(()=>[Dr(e),Uc(a)],([d,f])=>{s(),d&&i.push(...r.flatMap(p=>n.map(v=>l(d,p,v,f))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return ji(u),u}let Gc=!1;function Dg(t,e,r={}){const{window:n=Yi,ignore:a=[],capture:i=!0,detectIframe:s=!1}=r;if(!n)return;Ds&&!Gc&&(Gc=!0,Array.from(n.document.body.children).forEach(p=>p.addEventListener("click",qc)));let l=!0;const c=p=>a.some(v=>{if(typeof v=="string")return Array.from(n.document.querySelectorAll(v)).some(h=>h===p.target||p.composedPath().includes(h));{const h=Dr(v);return h&&(p.target===h||p.composedPath().includes(h))}}),d=[jt(n,"click",p=>{const v=Dr(t);if(!(!v||v===p.target||p.composedPath().includes(v))){if(p.detail===0&&(l=!c(p)),!l){l=!0;return}e(p)}},{passive:!0,capture:i}),jt(n,"pointerdown",p=>{const v=Dr(t);v&&(l=!p.composedPath().includes(v)&&!c(p))},{passive:!0}),s&&jt(n,"blur",p=>{var v;const h=Dr(t);((v=n.document.activeElement)==null?void 0:v.tagName)==="IFRAME"&&!(h!=null&&h.contains(n.document.activeElement))&&e(p)})].filter(Boolean);return()=>d.forEach(p=>p())}function Wc(t,e=!1){const r=o.ref(),n=()=>r.value=!!t();return n(),Ng(n,e),r}const jc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Yc="__vueuse_ssr_handlers__";jc[Yc]=jc[Yc]||{};var Zc=Object.getOwnPropertySymbols,Pg=Object.prototype.hasOwnProperty,_g=Object.prototype.propertyIsEnumerable,Og=(t,e)=>{var r={};for(var n in t)Pg.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Zc)for(var n of Zc(t))e.indexOf(n)<0&&_g.call(t,n)&&(r[n]=t[n]);return r};function Pr(t,e,r={}){const n=r,{window:a=Yi}=n,i=Og(n,["window"]);let s;const l=Wc(()=>a&&"ResizeObserver"in a),c=()=>{s&&(s.disconnect(),s=void 0)},u=o.watch(()=>Dr(t),f=>{c(),l.value&&a&&f&&(s=new ResizeObserver(e),s.observe(f,i))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return ji(d),{isSupported:l,stop:d}}var Xc=Object.getOwnPropertySymbols,Ig=Object.prototype.hasOwnProperty,Lg=Object.prototype.propertyIsEnumerable,Mg=(t,e)=>{var r={};for(var n in t)Ig.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Xc)for(var n of Xc(t))e.indexOf(n)<0&&Lg.call(t,n)&&(r[n]=t[n]);return r};function Fg(t,e,r={}){const n=r,{window:a=Yi}=n,i=Mg(n,["window"]);let s;const l=Wc(()=>a&&"MutationObserver"in a),c=()=>{s&&(s.disconnect(),s=void 0)},u=o.watch(()=>Dr(t),f=>{c(),l.value&&a&&f&&(s=new MutationObserver(e),s.observe(f,i))},{immediate:!0}),d=()=>{c(),u()};return ji(d),{isSupported:l,stop:d}}var Qc;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(Qc||(Qc={}));var Ag=Object.defineProperty,Jc=Object.getOwnPropertySymbols,Vg=Object.prototype.hasOwnProperty,Rg=Object.prototype.propertyIsEnumerable,eu=(t,e,r)=>e in t?Ag(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$g=(t,e)=>{for(var r in e||(e={}))Vg.call(e,r)&&eu(t,r,e[r]);if(Jc)for(var r of Jc(e))Rg.call(e,r)&&eu(t,r,e[r]);return t};$g({linear:Bg},{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 zg=()=>et&&/firefox/i.test(window.navigator.userAgent),Ps=t=>{let e,r;return t.type==="touchend"?(r=t.changedTouches[0].clientY,e=t.changedTouches[0].clientX):t.type.startsWith("touch")?(r=t.touches[0].clientY,e=t.touches[0].clientX):(r=t.clientY,e=t.clientX),{clientX:e,clientY:r}};/**
1
+ (function(Re,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(Re=typeof globalThis<"u"?globalThis:Re||self,o(Re.MapUtilities={},Re.Vue))})(this,function(Re,o){"use strict";var T_=Object.defineProperty;var B_=(Re,o,Ft)=>o in Re?T_(Re,o,{enumerable:!0,configurable:!0,writable:!0,value:Ft}):Re[o]=Ft;var gr=(Re,o,Ft)=>B_(Re,typeof o!="symbol"?o+"":o,Ft);const Ft=(t,e,{checkForDefaultPrevented:r=!0}={})=>a=>{const i=t==null?void 0:t(a);if(r===!1||!i)return e==null?void 0:e(a)};var qc;const et=typeof window<"u",Tg=t=>typeof t=="string",Uc=()=>{},Ds=et&&((qc=window==null?void 0:window.navigator)==null?void 0:qc.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Gc(t){return typeof t=="function"?t():o.unref(t)}function Bg(t){return t}function ji(t){return o.getCurrentScope()?(o.onScopeDispose(t),!0):!1}function Ng(t,e=!0){o.getCurrentInstance()?o.onMounted(t):e?t():o.nextTick(t)}function Dr(t){var e;const r=Gc(t);return(e=r==null?void 0:r.$el)!=null?e:r}const Yi=et?window:void 0;function jt(...t){let e,r,n,a;if(Tg(t[0])||Array.isArray(t[0])?([r,n,a]=t,e=Yi):[e,r,n,a]=t,!e)return Uc;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const i=[],s=()=>{i.forEach(d=>d()),i.length=0},l=(d,f,p,v)=>(d.addEventListener(f,p,v),()=>d.removeEventListener(f,p,v)),c=o.watch(()=>[Dr(e),Gc(a)],([d,f])=>{s(),d&&i.push(...r.flatMap(p=>n.map(v=>l(d,p,v,f))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return ji(u),u}let Wc=!1;function Dg(t,e,r={}){const{window:n=Yi,ignore:a=[],capture:i=!0,detectIframe:s=!1}=r;if(!n)return;Ds&&!Wc&&(Wc=!0,Array.from(n.document.body.children).forEach(p=>p.addEventListener("click",Uc)));let l=!0;const c=p=>a.some(v=>{if(typeof v=="string")return Array.from(n.document.querySelectorAll(v)).some(h=>h===p.target||p.composedPath().includes(h));{const h=Dr(v);return h&&(p.target===h||p.composedPath().includes(h))}}),d=[jt(n,"click",p=>{const v=Dr(t);if(!(!v||v===p.target||p.composedPath().includes(v))){if(p.detail===0&&(l=!c(p)),!l){l=!0;return}e(p)}},{passive:!0,capture:i}),jt(n,"pointerdown",p=>{const v=Dr(t);v&&(l=!p.composedPath().includes(v)&&!c(p))},{passive:!0}),s&&jt(n,"blur",p=>{var v;const h=Dr(t);((v=n.document.activeElement)==null?void 0:v.tagName)==="IFRAME"&&!(h!=null&&h.contains(n.document.activeElement))&&e(p)})].filter(Boolean);return()=>d.forEach(p=>p())}function jc(t,e=!1){const r=o.ref(),n=()=>r.value=!!t();return n(),Ng(n,e),r}const Yc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Zc="__vueuse_ssr_handlers__";Yc[Zc]=Yc[Zc]||{};var Xc=Object.getOwnPropertySymbols,Pg=Object.prototype.hasOwnProperty,_g=Object.prototype.propertyIsEnumerable,Og=(t,e)=>{var r={};for(var n in t)Pg.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Xc)for(var n of Xc(t))e.indexOf(n)<0&&_g.call(t,n)&&(r[n]=t[n]);return r};function Pr(t,e,r={}){const n=r,{window:a=Yi}=n,i=Og(n,["window"]);let s;const l=jc(()=>a&&"ResizeObserver"in a),c=()=>{s&&(s.disconnect(),s=void 0)},u=o.watch(()=>Dr(t),f=>{c(),l.value&&a&&f&&(s=new ResizeObserver(e),s.observe(f,i))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return ji(d),{isSupported:l,stop:d}}var Qc=Object.getOwnPropertySymbols,Ig=Object.prototype.hasOwnProperty,Lg=Object.prototype.propertyIsEnumerable,Mg=(t,e)=>{var r={};for(var n in t)Ig.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Qc)for(var n of Qc(t))e.indexOf(n)<0&&Lg.call(t,n)&&(r[n]=t[n]);return r};function Fg(t,e,r={}){const n=r,{window:a=Yi}=n,i=Mg(n,["window"]);let s;const l=jc(()=>a&&"MutationObserver"in a),c=()=>{s&&(s.disconnect(),s=void 0)},u=o.watch(()=>Dr(t),f=>{c(),l.value&&a&&f&&(s=new MutationObserver(e),s.observe(f,i))},{immediate:!0}),d=()=>{c(),u()};return ji(d),{isSupported:l,stop:d}}var Jc;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(Jc||(Jc={}));var Ag=Object.defineProperty,eu=Object.getOwnPropertySymbols,Vg=Object.prototype.hasOwnProperty,Rg=Object.prototype.propertyIsEnumerable,tu=(t,e,r)=>e in t?Ag(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$g=(t,e)=>{for(var r in e||(e={}))Vg.call(e,r)&&tu(t,r,e[r]);if(eu)for(var r of eu(e))Rg.call(e,r)&&tu(t,r,e[r]);return t};$g({linear:Bg},{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 zg=()=>et&&/firefox/i.test(window.navigator.userAgent),Ps=t=>{let e,r;return t.type==="touchend"?(r=t.changedTouches[0].clientY,e=t.changedTouches[0].clientX):t.type.startsWith("touch")?(r=t.touches[0].clientY,e=t.touches[0].clientX):(r=t.clientY,e=t.clientX),{clientX:e,clientY:r}};/**
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=()=>{},Hg=Object.prototype.hasOwnProperty,wn=(t,e)=>Hg.call(t,e),At=Array.isArray,Lt=t=>typeof t=="function",St=t=>typeof t=="string",vt=t=>t!==null&&typeof t=="object",Kg=Object.prototype.toString,qg=t=>Kg.call(t),_s=t=>qg(t).slice(8,-1),tu=t=>{const e=Object.create(null);return r=>e[r]||(e[r]=t(r))},Ug=/-(\w)/g,Gg=tu(t=>t.replace(Ug,(e,r)=>r?r.toUpperCase():"")),Wg=/\B([A-Z])/g,jg=tu(t=>t.replace(Wg,"-$1").toLowerCase());var ru=typeof global=="object"&&global&&global.Object===Object&&global,Yg=typeof self=="object"&&self&&self.Object===Object&&self,mr=ru||Yg||Function("return this")(),yr=mr.Symbol,nu=Object.prototype,Zg=nu.hasOwnProperty,Xg=nu.toString,Ka=yr?yr.toStringTag:void 0;function Qg(t){var e=Zg.call(t,Ka),r=t[Ka];try{t[Ka]=void 0;var n=!0}catch{}var a=Xg.call(t);return n&&(e?t[Ka]=r:delete t[Ka]),a}var Jg=Object.prototype,em=Jg.toString;function tm(t){return em.call(t)}var rm="[object Null]",nm="[object Undefined]",au=yr?yr.toStringTag:void 0;function Zn(t){return t==null?t===void 0?nm:rm:au&&au in Object(t)?Qg(t):tm(t)}function Xn(t){return t!=null&&typeof t=="object"}var am="[object Symbol]";function Zi(t){return typeof t=="symbol"||Xn(t)&&Zn(t)==am}function im(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}var nr=Array.isArray,om=1/0,iu=yr?yr.prototype:void 0,ou=iu?iu.toString:void 0;function su(t){if(typeof t=="string")return t;if(nr(t))return im(t,su)+"";if(Zi(t))return ou?ou.call(t):"";var e=t+"";return e=="0"&&1/t==-om?"-0":e}var sm=/\s/;function lm(t){for(var e=t.length;e--&&sm.test(t.charAt(e)););return e}var cm=/^\s+/;function um(t){return t&&t.slice(0,lm(t)+1).replace(cm,"")}function Ur(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var lu=NaN,dm=/^[-+]0x[0-9a-f]+$/i,fm=/^0b[01]+$/i,hm=/^0o[0-7]+$/i,pm=parseInt;function cu(t){if(typeof t=="number")return t;if(Zi(t))return lu;if(Ur(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ur(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=um(t);var r=fm.test(t);return r||hm.test(t)?pm(t.slice(2),r?2:8):dm.test(t)?lu:+t}function uu(t){return t}var vm="[object AsyncFunction]",gm="[object Function]",mm="[object GeneratorFunction]",ym="[object Proxy]";function du(t){if(!Ur(t))return!1;var e=Zn(t);return e==gm||e==mm||e==vm||e==ym}var Os=mr["__core-js_shared__"],fu=function(){var t=/[^.]+$/.exec(Os&&Os.keys&&Os.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function bm(t){return!!fu&&fu in t}var wm=Function.prototype,Cm=wm.toString;function Cn(t){if(t!=null){try{return Cm.call(t)}catch{}try{return t+""}catch{}}return""}var km=/[\\^$.*+?()[\]{}|]/g,xm=/^\[object .+?Constructor\]$/,Em=Function.prototype,Sm=Object.prototype,Tm=Em.toString,Bm=Sm.hasOwnProperty,Nm=RegExp("^"+Tm.call(Bm).replace(km,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Dm(t){if(!Ur(t)||bm(t))return!1;var e=du(t)?Nm:xm;return e.test(Cn(t))}function Pm(t,e){return t==null?void 0:t[e]}function kn(t,e){var r=Pm(t,e);return Dm(r)?r:void 0}var Is=kn(mr,"WeakMap");function _m(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Om=800,Im=16,Lm=Date.now;function Mm(t){var e=0,r=0;return function(){var n=Lm(),a=Im-(n-r);if(r=n,a>0){if(++e>=Om)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Fm(t){return function(){return t}}var Xi=function(){try{var t=kn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Am=Xi?function(t,e){return Xi(t,"toString",{configurable:!0,enumerable:!1,value:Fm(e),writable:!0})}:uu,Vm=Mm(Am);function Rm(t,e,r,n){t.length;for(var a=r+1;a--;)if(e(t[a],a,t))return a;return-1}var $m=9007199254740991,zm=/^(?:0|[1-9]\d*)$/;function Ls(t,e){var r=typeof t;return e=e??$m,!!e&&(r=="number"||r!="symbol"&&zm.test(t))&&t>-1&&t%1==0&&t<e}function Hm(t,e,r){e=="__proto__"&&Xi?Xi(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Ms(t,e){return t===e||t!==t&&e!==e}var Km=Object.prototype,qm=Km.hasOwnProperty;function Um(t,e,r){var n=t[e];(!(qm.call(t,e)&&Ms(n,r))||r===void 0&&!(e in t))&&Hm(t,e,r)}var hu=Math.max;function Gm(t,e,r){return e=hu(e===void 0?t.length-1:e,0),function(){for(var n=arguments,a=-1,i=hu(n.length-e,0),s=Array(i);++a<i;)s[a]=n[e+a];a=-1;for(var l=Array(e+1);++a<e;)l[a]=n[a];return l[e]=r(s),_m(t,this,l)}}var Wm=9007199254740991;function Fs(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Wm}function jm(t){return t!=null&&Fs(t.length)&&!du(t)}var Ym=Object.prototype;function Zm(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ym;return t===r}function Xm(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Qm="[object Arguments]";function pu(t){return Xn(t)&&Zn(t)==Qm}var vu=Object.prototype,Jm=vu.hasOwnProperty,e0=vu.propertyIsEnumerable,As=pu(function(){return arguments}())?pu:function(t){return Xn(t)&&Jm.call(t,"callee")&&!e0.call(t,"callee")};function t0(){return!1}var gu=typeof Re=="object"&&Re&&!Re.nodeType&&Re,mu=gu&&typeof module=="object"&&module&&!module.nodeType&&module,r0=mu&&mu.exports===gu,yu=r0?mr.Buffer:void 0,n0=yu?yu.isBuffer:void 0,Vs=n0||t0,a0="[object Arguments]",i0="[object Array]",o0="[object Boolean]",s0="[object Date]",l0="[object Error]",c0="[object Function]",u0="[object Map]",d0="[object Number]",f0="[object Object]",h0="[object RegExp]",p0="[object Set]",v0="[object String]",g0="[object WeakMap]",m0="[object ArrayBuffer]",y0="[object DataView]",b0="[object Float32Array]",w0="[object Float64Array]",C0="[object Int8Array]",k0="[object Int16Array]",x0="[object Int32Array]",E0="[object Uint8Array]",S0="[object Uint8ClampedArray]",T0="[object Uint16Array]",B0="[object Uint32Array]",We={};We[b0]=We[w0]=We[C0]=We[k0]=We[x0]=We[E0]=We[S0]=We[T0]=We[B0]=!0,We[a0]=We[i0]=We[m0]=We[o0]=We[y0]=We[s0]=We[l0]=We[c0]=We[u0]=We[d0]=We[f0]=We[h0]=We[p0]=We[v0]=We[g0]=!1;function N0(t){return Xn(t)&&Fs(t.length)&&!!We[Zn(t)]}function D0(t){return function(e){return t(e)}}var bu=typeof Re=="object"&&Re&&!Re.nodeType&&Re,qa=bu&&typeof module=="object"&&module&&!module.nodeType&&module,P0=qa&&qa.exports===bu,Rs=P0&&ru.process,wu=function(){try{var t=qa&&qa.require&&qa.require("util").types;return t||Rs&&Rs.binding&&Rs.binding("util")}catch{}}(),Cu=wu&&wu.isTypedArray,ku=Cu?D0(Cu):N0,_0=Object.prototype,O0=_0.hasOwnProperty;function I0(t,e){var r=nr(t),n=!r&&As(t),a=!r&&!n&&Vs(t),i=!r&&!n&&!a&&ku(t),s=r||n||a||i,l=s?Xm(t.length,String):[],c=l.length;for(var u in t)O0.call(t,u)&&!(s&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Ls(u,c)))&&l.push(u);return l}function L0(t,e){return function(r){return t(e(r))}}var M0=L0(Object.keys,Object),F0=Object.prototype,A0=F0.hasOwnProperty;function V0(t){if(!Zm(t))return M0(t);var e=[];for(var r in Object(t))A0.call(t,r)&&r!="constructor"&&e.push(r);return e}function xu(t){return jm(t)?I0(t):V0(t)}var R0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$0=/^\w*$/;function $s(t,e){if(nr(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Zi(t)?!0:$0.test(t)||!R0.test(t)||e!=null&&t in Object(e)}var Ua=kn(Object,"create");function z0(){this.__data__=Ua?Ua(null):{},this.size=0}function H0(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var K0="__lodash_hash_undefined__",q0=Object.prototype,U0=q0.hasOwnProperty;function G0(t){var e=this.__data__;if(Ua){var r=e[t];return r===K0?void 0:r}return U0.call(e,t)?e[t]:void 0}var W0=Object.prototype,j0=W0.hasOwnProperty;function Y0(t){var e=this.__data__;return Ua?e[t]!==void 0:j0.call(e,t)}var Z0="__lodash_hash_undefined__";function X0(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ua&&e===void 0?Z0:e,this}function xn(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}xn.prototype.clear=z0,xn.prototype.delete=H0,xn.prototype.get=G0,xn.prototype.has=Y0,xn.prototype.set=X0;function Q0(){this.__data__=[],this.size=0}function Qi(t,e){for(var r=t.length;r--;)if(Ms(t[r][0],e))return r;return-1}var J0=Array.prototype,ey=J0.splice;function ty(t){var e=this.__data__,r=Qi(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ey.call(e,r,1),--this.size,!0}function ry(t){var e=this.__data__,r=Qi(e,t);return r<0?void 0:e[r][1]}function ny(t){return Qi(this.__data__,t)>-1}function ay(t,e){var r=this.__data__,n=Qi(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function _r(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}_r.prototype.clear=Q0,_r.prototype.delete=ty,_r.prototype.get=ry,_r.prototype.has=ny,_r.prototype.set=ay;var Ga=kn(mr,"Map");function iy(){this.size=0,this.__data__={hash:new xn,map:new(Ga||_r),string:new xn}}function oy(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ji(t,e){var r=t.__data__;return oy(e)?r[typeof e=="string"?"string":"hash"]:r.map}function sy(t){var e=Ji(this,t).delete(t);return this.size-=e?1:0,e}function ly(t){return Ji(this,t).get(t)}function cy(t){return Ji(this,t).has(t)}function uy(t,e){var r=Ji(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Or(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Or.prototype.clear=iy,Or.prototype.delete=sy,Or.prototype.get=ly,Or.prototype.has=cy,Or.prototype.set=uy;var dy="Expected a function";function zs(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(dy);var r=function(){var n=arguments,a=e?e.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var s=t.apply(this,n);return r.cache=i.set(a,s)||i,s};return r.cache=new(zs.Cache||Or),r}zs.Cache=Or;var fy=500;function hy(t){var e=zs(t,function(n){return r.size===fy&&r.clear(),n}),r=e.cache;return e}var py=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vy=/\\(\\)?/g,gy=hy(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(py,function(r,n,a,i){e.push(a?i.replace(vy,"$1"):n||r)}),e});function my(t){return t==null?"":su(t)}function eo(t,e){return nr(t)?t:$s(t,e)?[t]:gy(my(t))}var yy=1/0;function Wa(t){if(typeof t=="string"||Zi(t))return t;var e=t+"";return e=="0"&&1/t==-yy?"-0":e}function Hs(t,e){e=eo(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Wa(e[r++])];return r&&r==n?t:void 0}function Ir(t,e,r){var n=t==null?void 0:Hs(t,e);return n===void 0?r:n}function Eu(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}var Su=yr?yr.isConcatSpreadable:void 0;function by(t){return nr(t)||As(t)||!!(Su&&t&&t[Su])}function wy(t,e,r,n,a){var i=-1,s=t.length;for(r||(r=by),a||(a=[]);++i<s;){var l=t[i];r(l)?Eu(a,l):a[a.length]=l}return a}function Cy(t){var e=t==null?0:t.length;return e?wy(t):[]}function ky(t){return Vm(Gm(t,void 0,Cy),t+"")}function Gr(){if(!arguments.length)return[];var t=arguments[0];return nr(t)?t:[t]}function xy(){this.__data__=new _r,this.size=0}function Ey(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Sy(t){return this.__data__.get(t)}function Ty(t){return this.__data__.has(t)}var By=200;function Ny(t,e){var r=this.__data__;if(r instanceof _r){var n=r.__data__;if(!Ga||n.length<By-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Or(n)}return r.set(t,e),this.size=r.size,this}function Lr(t){var e=this.__data__=new _r(t);this.size=e.size}Lr.prototype.clear=xy,Lr.prototype.delete=Ey,Lr.prototype.get=Sy,Lr.prototype.has=Ty,Lr.prototype.set=Ny;function Dy(t,e){for(var r=-1,n=t==null?0:t.length,a=0,i=[];++r<n;){var s=t[r];e(s,r,t)&&(i[a++]=s)}return i}function Py(){return[]}var _y=Object.prototype,Oy=_y.propertyIsEnumerable,Tu=Object.getOwnPropertySymbols,Iy=Tu?function(t){return t==null?[]:(t=Object(t),Dy(Tu(t),function(e){return Oy.call(t,e)}))}:Py;function Ly(t,e,r){var n=e(t);return nr(t)?n:Eu(n,r(t))}function Bu(t){return Ly(t,xu,Iy)}var Ks=kn(mr,"DataView"),qs=kn(mr,"Promise"),Us=kn(mr,"Set"),Nu="[object Map]",My="[object Object]",Du="[object Promise]",Pu="[object Set]",_u="[object WeakMap]",Ou="[object DataView]",Fy=Cn(Ks),Ay=Cn(Ga),Vy=Cn(qs),Ry=Cn(Us),$y=Cn(Is),Wr=Zn;(Ks&&Wr(new Ks(new ArrayBuffer(1)))!=Ou||Ga&&Wr(new Ga)!=Nu||qs&&Wr(qs.resolve())!=Du||Us&&Wr(new Us)!=Pu||Is&&Wr(new Is)!=_u)&&(Wr=function(t){var e=Zn(t),r=e==My?t.constructor:void 0,n=r?Cn(r):"";if(n)switch(n){case Fy:return Ou;case Ay:return Nu;case Vy:return Du;case Ry:return Pu;case $y:return _u}return e});var Iu=mr.Uint8Array,zy="__lodash_hash_undefined__";function Hy(t){return this.__data__.set(t,zy),this}function Ky(t){return this.__data__.has(t)}function to(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Or;++e<r;)this.add(t[e])}to.prototype.add=to.prototype.push=Hy,to.prototype.has=Ky;function qy(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Uy(t,e){return t.has(e)}var Gy=1,Wy=2;function Lu(t,e,r,n,a,i){var s=r&Gy,l=t.length,c=e.length;if(l!=c&&!(s&&c>l))return!1;var u=i.get(t),d=i.get(e);if(u&&d)return u==e&&d==t;var f=-1,p=!0,v=r&Wy?new to:void 0;for(i.set(t,e),i.set(e,t);++f<l;){var h=t[f],g=e[f];if(n)var y=s?n(g,h,f,e,t,i):n(h,g,f,t,e,i);if(y!==void 0){if(y)continue;p=!1;break}if(v){if(!qy(e,function(m,b){if(!Uy(v,b)&&(h===m||a(h,m,r,n,i)))return v.push(b)})){p=!1;break}}else if(!(h===g||a(h,g,r,n,i))){p=!1;break}}return i.delete(t),i.delete(e),p}function jy(t){var e=-1,r=Array(t.size);return t.forEach(function(n,a){r[++e]=[a,n]}),r}function Yy(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Zy=1,Xy=2,Qy="[object Boolean]",Jy="[object Date]",e1="[object Error]",t1="[object Map]",r1="[object Number]",n1="[object RegExp]",a1="[object Set]",i1="[object String]",o1="[object Symbol]",s1="[object ArrayBuffer]",l1="[object DataView]",Mu=yr?yr.prototype:void 0,Gs=Mu?Mu.valueOf:void 0;function c1(t,e,r,n,a,i,s){switch(r){case l1:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case s1:return!(t.byteLength!=e.byteLength||!i(new Iu(t),new Iu(e)));case Qy:case Jy:case r1:return Ms(+t,+e);case e1:return t.name==e.name&&t.message==e.message;case n1:case i1:return t==e+"";case t1:var l=jy;case a1:var c=n&Zy;if(l||(l=Yy),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=Xy,s.set(t,e);var d=Lu(l(t),l(e),n,a,i,s);return s.delete(t),d;case o1:if(Gs)return Gs.call(t)==Gs.call(e)}return!1}var u1=1,d1=Object.prototype,f1=d1.hasOwnProperty;function h1(t,e,r,n,a,i){var s=r&u1,l=Bu(t),c=l.length,u=Bu(e),d=u.length;if(c!=d&&!s)return!1;for(var f=c;f--;){var p=l[f];if(!(s?p in e:f1.call(e,p)))return!1}var v=i.get(t),h=i.get(e);if(v&&h)return v==e&&h==t;var g=!0;i.set(t,e),i.set(e,t);for(var y=s;++f<c;){p=l[f];var m=t[p],b=e[p];if(n)var w=s?n(b,m,p,e,t,i):n(m,b,p,t,e,i);if(!(w===void 0?m===b||a(m,b,r,n,i):w)){g=!1;break}y||(y=p=="constructor")}if(g&&!y){var C=t.constructor,x=e.constructor;C!=x&&"constructor"in t&&"constructor"in e&&!(typeof C=="function"&&C instanceof C&&typeof x=="function"&&x instanceof x)&&(g=!1)}return i.delete(t),i.delete(e),g}var p1=1,Fu="[object Arguments]",Au="[object Array]",ro="[object Object]",v1=Object.prototype,Vu=v1.hasOwnProperty;function g1(t,e,r,n,a,i){var s=nr(t),l=nr(e),c=s?Au:Wr(t),u=l?Au:Wr(e);c=c==Fu?ro:c,u=u==Fu?ro:u;var d=c==ro,f=u==ro,p=c==u;if(p&&Vs(t)){if(!Vs(e))return!1;s=!0,d=!1}if(p&&!d)return i||(i=new Lr),s||ku(t)?Lu(t,e,r,n,a,i):c1(t,e,c,r,n,a,i);if(!(r&p1)){var v=d&&Vu.call(t,"__wrapped__"),h=f&&Vu.call(e,"__wrapped__");if(v||h){var g=v?t.value():t,y=h?e.value():e;return i||(i=new Lr),a(g,y,r,n,i)}}return p?(i||(i=new Lr),h1(t,e,r,n,a,i)):!1}function no(t,e,r,n,a){return t===e?!0:t==null||e==null||!Xn(t)&&!Xn(e)?t!==t&&e!==e:g1(t,e,r,n,no,a)}var m1=1,y1=2;function b1(t,e,r,n){var a=r.length,i=a;if(t==null)return!i;for(t=Object(t);a--;){var s=r[a];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++a<i;){s=r[a];var l=s[0],c=t[l],u=s[1];if(s[2]){if(c===void 0&&!(l in t))return!1}else{var d=new Lr,f;if(!(f===void 0?no(u,c,m1|y1,n,d):f))return!1}}return!0}function Ru(t){return t===t&&!Ur(t)}function w1(t){for(var e=xu(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,Ru(a)]}return e}function $u(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function C1(t){var e=w1(t);return e.length==1&&e[0][2]?$u(e[0][0],e[0][1]):function(r){return r===t||b1(r,t,e)}}function k1(t,e){return t!=null&&e in Object(t)}function x1(t,e,r){e=eo(e,t);for(var n=-1,a=e.length,i=!1;++n<a;){var s=Wa(e[n]);if(!(i=t!=null&&r(t,s)))break;t=t[s]}return i||++n!=a?i:(a=t==null?0:t.length,!!a&&Fs(a)&&Ls(s,a)&&(nr(t)||As(t)))}function zu(t,e){return t!=null&&x1(t,e,k1)}var E1=1,S1=2;function T1(t,e){return $s(t)&&Ru(e)?$u(Wa(t),e):function(r){var n=Ir(r,t);return n===void 0&&n===e?zu(r,t):no(e,n,E1|S1)}}function B1(t){return function(e){return e==null?void 0:e[t]}}function N1(t){return function(e){return Hs(e,t)}}function D1(t){return $s(t)?B1(Wa(t)):N1(t)}function P1(t){return typeof t=="function"?t:t==null?uu:typeof t=="object"?nr(t)?T1(t[0],t[1]):C1(t):D1(t)}var Ws=function(){return mr.Date.now()},_1="Expected a function",O1=Math.max,I1=Math.min;function Hu(t,e,r){var n,a,i,s,l,c,u=0,d=!1,f=!1,p=!0;if(typeof t!="function")throw new TypeError(_1);e=cu(e)||0,Ur(r)&&(d=!!r.leading,f="maxWait"in r,i=f?O1(cu(r.maxWait)||0,e):i,p="trailing"in r?!!r.trailing:p);function v(E){var k=n,B=a;return n=a=void 0,u=E,s=t.apply(B,k),s}function h(E){return u=E,l=setTimeout(m,e),d?v(E):s}function g(E){var k=E-c,B=E-u,S=e-k;return f?I1(S,i-B):S}function y(E){var k=E-c,B=E-u;return c===void 0||k>=e||k<0||f&&B>=i}function m(){var E=Ws();if(y(E))return b(E);l=setTimeout(m,g(E))}function b(E){return l=void 0,p&&n?v(E):(n=a=void 0,s)}function w(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function C(){return l===void 0?s:b(Ws())}function x(){var E=Ws(),k=y(E);if(n=arguments,a=this,c=E,k){if(l===void 0)return h(c);if(f)return clearTimeout(l),l=setTimeout(m,e),v(c)}return l===void 0&&(l=setTimeout(m,e)),s}return x.cancel=w,x.flush=C,x}function L1(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var a=n-1;return Rm(t,P1(e),a)}function ao(t){for(var e=-1,r=t==null?0:t.length,n={};++e<r;){var a=t[e];n[a[0]]=a[1]}return n}function io(t,e){return no(t,e)}function jr(t){return t==null}function M1(t){return t===void 0}function F1(t,e,r,n){if(!Ur(t))return t;e=eo(e,t);for(var a=-1,i=e.length,s=i-1,l=t;l!=null&&++a<i;){var c=Wa(e[a]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(a!=s){var d=l[c];u=void 0,u===void 0&&(u=Ur(d)?d:Ls(e[a+1])?[]:{})}Um(l,c,u),l=l[c]}return t}function A1(t,e,r){for(var n=-1,a=e.length,i={};++n<a;){var s=e[n],l=Hs(t,s);r(l,s)&&F1(i,eo(s,t),l)}return i}function V1(t,e){return A1(t,e,function(r,n){return zu(t,n)})}var Ku=ky(function(t,e){return t==null?{}:V1(t,e)});const Yr=t=>t===void 0,Qn=t=>typeof t=="boolean",gt=t=>typeof t=="number",En=t=>typeof Element>"u"?!1:t instanceof Element,oo=t=>jr(t),R1=t=>St(t)?!Number.isNaN(Number(t)):!1,$1=(t="")=>t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),qu=t=>Object.keys(t);class Uu extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function z1(t,e){throw new Uu(`[${t}] ${e}`)}function tt(t,e){if(process.env.NODE_ENV!=="production"){const r=St(t)?new Uu(`[${t}] ${e}`):t;console.warn(r)}}const H1="utils/dom/style",Gu=(t="")=>t.split(" ").filter(e=>!!e.trim()),js=(t,e)=>{!t||!e.trim()||t.classList.add(...Gu(e))},Sn=(t,e)=>{!t||!e.trim()||t.classList.remove(...Gu(e))},ja=(t,e)=>{var r;if(!et||!t||!e)return"";let n=Gg(e);n==="float"&&(n="cssFloat");try{const a=t.style[n];if(a)return a;const i=(r=document.defaultView)==null?void 0:r.getComputedStyle(t,"");return i?i[n]:""}catch{return t.style[n]}};function Jn(t,e="px"){if(!t)return"";if(gt(t)||R1(t))return`${t}${e}`;if(St(t))return t;tt(H1,"binding value must be a string or number")}function K1(t,e){if(!et)return;if(!e){t.scrollTop=0;return}const r=[];let n=e.offsetParent;for(;n!==null&&t!==n&&t.contains(n);)r.push(n),n=n.offsetParent;const a=e.offsetTop+r.reduce((c,u)=>c+u.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 q1=o.defineComponent({name:"Aim",__name:"aim",setup(t){return(e,r)=>(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"})]))}}),U1=q1,G1=o.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(t){return(e,r)=>(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"})]))}}),so=G1,W1=o.defineComponent({name:"ArrowUp",__name:"arrow-up",setup(t){return(e,r)=>(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"})]))}}),Wu=W1,j1=o.defineComponent({name:"CaretRight",__name:"caret-right",setup(t){return(e,r)=>(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"})]))}}),Y1=j1,Z1=o.defineComponent({name:"CircleCheck",__name:"circle-check",setup(t){return(e,r)=>(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"})]))}}),X1=Z1,Q1=o.defineComponent({name:"CircleClose",__name:"circle-close",setup(t){return(e,r)=>(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"})]))}}),Ys=Q1,J1=o.defineComponent({name:"Close",__name:"close",setup(t){return(e,r)=>(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"})]))}}),lo=J1,eb=o.defineComponent({name:"CopyDocument",__name:"copy-document",setup(t){return(e,r)=>(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"})]))}}),tb=eb,rb=o.defineComponent({name:"Delete",__name:"delete",setup(t){return(e,r)=>(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"})]))}}),nb=rb,ab=o.defineComponent({name:"Edit",__name:"edit",setup(t){return(e,r)=>(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"})]))}}),ib=ab,ob=o.defineComponent({name:"Finished",__name:"finished",setup(t){return(e,r)=>(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"})]))}}),sb=ob,lb=o.defineComponent({name:"Hide",__name:"hide",setup(t){return(e,r)=>(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"})]))}}),cb=lb,ub=o.defineComponent({name:"Loading",__name:"loading",setup(t){return(e,r)=>(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"})]))}}),Zs=ub,db=o.defineComponent({name:"Lock",__name:"lock",setup(t){return(e,r)=>(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"})]))}}),fb=db,hb=o.defineComponent({name:"Unlock",__name:"unlock",setup(t){return(e,r)=>(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"})]))}}),pb=hb,vb=o.defineComponent({name:"View",__name:"view",setup(t){return(e,r)=>(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"})]))}}),gb=vb,mb=o.defineComponent({name:"Warning",__name:"warning",setup(t){return(e,r)=>(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"})]))}}),yb=mb,bb=o.defineComponent({name:"ZoomIn",__name:"zoom-in",setup(t){return(e,r)=>(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"})]))}}),wb=bb,Cb=o.defineComponent({name:"ZoomOut",__name:"zoom-out",setup(t){return(e,r)=>(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"})]))}}),kb=Cb;const ju="__epPropKey",ke=t=>t,xb=t=>vt(t)&&!!t[ju],co=(t,e)=>{if(!vt(t)||xb(t))return t;const{values:r,required:n,default:a,type:i,validator:s}=t,c={type:i,required:!!n,validator:r||s?u=>{let d=!1,f=[];if(r&&(f=Array.from(r),wn(t,"default")&&f.push(a),d||(d=f.includes(u))),s&&(d||(d=s(u))),!d&&f.length>0){const p=[...new Set(f)].map(v=>JSON.stringify(v)).join(", ");o.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${p}], got value ${JSON.stringify(u)}.`)}return d}:void 0,[ju]:!0};return wn(t,"default")&&(c.default=a),c},Fe=t=>ao(Object.entries(t).map(([e,r])=>[e,co(r,e)])),Zr=ke([String,Object,Function]),Yu={validating:Zs,success:X1,error:Ys},dt=(t,e)=>{if(t.install=r=>{for(const n of[t,...Object.values(e??{})])r.component(n.name,n)},e)for(const[r,n]of Object.entries(e))t[r]=n;return t},Eb=(t,e)=>(t.install=r=>{r.directive(e,t)},t),Mr=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"},mt="update:modelValue",Xs="change",Zu=["","default","small","large"],Sb=t=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t),ea=t=>t,Tb=["class","style"],Bb=/^on[A-Z]/,Nb=(t={})=>{const{excludeListeners:e=!1,excludeKeys:r}=t,n=o.computed(()=>((r==null?void 0:r.value)||[]).concat(Tb)),a=o.getCurrentInstance();return a?o.computed(()=>{var i;return ao(Object.entries((i=a.proxy)==null?void 0:i.$attrs).filter(([s])=>!n.value.includes(s)&&!(e&&Bb.test(s))))}):(tt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),o.computed(()=>({})))},uo=({from:t,replacement:e,scope:r,version:n,ref:a,type:i="API"},s)=>{o.watch(()=>o.unref(s),l=>{l&&tt(r,`[${i}] ${t} is about to be deprecated in version ${n}, please use ${e} instead.
5
+ **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const Ha=()=>{},Hg=Object.prototype.hasOwnProperty,wn=(t,e)=>Hg.call(t,e),At=Array.isArray,Lt=t=>typeof t=="function",St=t=>typeof t=="string",vt=t=>t!==null&&typeof t=="object",Kg=Object.prototype.toString,qg=t=>Kg.call(t),_s=t=>qg(t).slice(8,-1),ru=t=>{const e=Object.create(null);return r=>e[r]||(e[r]=t(r))},Ug=/-(\w)/g,Gg=ru(t=>t.replace(Ug,(e,r)=>r?r.toUpperCase():"")),Wg=/\B([A-Z])/g,jg=ru(t=>t.replace(Wg,"-$1").toLowerCase());var nu=typeof global=="object"&&global&&global.Object===Object&&global,Yg=typeof self=="object"&&self&&self.Object===Object&&self,mr=nu||Yg||Function("return this")(),yr=mr.Symbol,au=Object.prototype,Zg=au.hasOwnProperty,Xg=au.toString,Ka=yr?yr.toStringTag:void 0;function Qg(t){var e=Zg.call(t,Ka),r=t[Ka];try{t[Ka]=void 0;var n=!0}catch{}var a=Xg.call(t);return n&&(e?t[Ka]=r:delete t[Ka]),a}var Jg=Object.prototype,em=Jg.toString;function tm(t){return em.call(t)}var rm="[object Null]",nm="[object Undefined]",iu=yr?yr.toStringTag:void 0;function Zn(t){return t==null?t===void 0?nm:rm:iu&&iu in Object(t)?Qg(t):tm(t)}function Xn(t){return t!=null&&typeof t=="object"}var am="[object Symbol]";function Zi(t){return typeof t=="symbol"||Xn(t)&&Zn(t)==am}function im(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}var nr=Array.isArray,om=1/0,ou=yr?yr.prototype:void 0,su=ou?ou.toString:void 0;function lu(t){if(typeof t=="string")return t;if(nr(t))return im(t,lu)+"";if(Zi(t))return su?su.call(t):"";var e=t+"";return e=="0"&&1/t==-om?"-0":e}var sm=/\s/;function lm(t){for(var e=t.length;e--&&sm.test(t.charAt(e)););return e}var cm=/^\s+/;function um(t){return t&&t.slice(0,lm(t)+1).replace(cm,"")}function Ur(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var cu=NaN,dm=/^[-+]0x[0-9a-f]+$/i,fm=/^0b[01]+$/i,hm=/^0o[0-7]+$/i,pm=parseInt;function uu(t){if(typeof t=="number")return t;if(Zi(t))return cu;if(Ur(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ur(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=um(t);var r=fm.test(t);return r||hm.test(t)?pm(t.slice(2),r?2:8):dm.test(t)?cu:+t}function du(t){return t}var vm="[object AsyncFunction]",gm="[object Function]",mm="[object GeneratorFunction]",ym="[object Proxy]";function fu(t){if(!Ur(t))return!1;var e=Zn(t);return e==gm||e==mm||e==vm||e==ym}var Os=mr["__core-js_shared__"],hu=function(){var t=/[^.]+$/.exec(Os&&Os.keys&&Os.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function bm(t){return!!hu&&hu in t}var wm=Function.prototype,Cm=wm.toString;function Cn(t){if(t!=null){try{return Cm.call(t)}catch{}try{return t+""}catch{}}return""}var km=/[\\^$.*+?()[\]{}|]/g,xm=/^\[object .+?Constructor\]$/,Em=Function.prototype,Sm=Object.prototype,Tm=Em.toString,Bm=Sm.hasOwnProperty,Nm=RegExp("^"+Tm.call(Bm).replace(km,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Dm(t){if(!Ur(t)||bm(t))return!1;var e=fu(t)?Nm:xm;return e.test(Cn(t))}function Pm(t,e){return t==null?void 0:t[e]}function kn(t,e){var r=Pm(t,e);return Dm(r)?r:void 0}var Is=kn(mr,"WeakMap");function _m(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Om=800,Im=16,Lm=Date.now;function Mm(t){var e=0,r=0;return function(){var n=Lm(),a=Im-(n-r);if(r=n,a>0){if(++e>=Om)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Fm(t){return function(){return t}}var Xi=function(){try{var t=kn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Am=Xi?function(t,e){return Xi(t,"toString",{configurable:!0,enumerable:!1,value:Fm(e),writable:!0})}:du,Vm=Mm(Am);function Rm(t,e,r,n){t.length;for(var a=r+1;a--;)if(e(t[a],a,t))return a;return-1}var $m=9007199254740991,zm=/^(?:0|[1-9]\d*)$/;function Ls(t,e){var r=typeof t;return e=e??$m,!!e&&(r=="number"||r!="symbol"&&zm.test(t))&&t>-1&&t%1==0&&t<e}function Hm(t,e,r){e=="__proto__"&&Xi?Xi(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Ms(t,e){return t===e||t!==t&&e!==e}var Km=Object.prototype,qm=Km.hasOwnProperty;function Um(t,e,r){var n=t[e];(!(qm.call(t,e)&&Ms(n,r))||r===void 0&&!(e in t))&&Hm(t,e,r)}var pu=Math.max;function Gm(t,e,r){return e=pu(e===void 0?t.length-1:e,0),function(){for(var n=arguments,a=-1,i=pu(n.length-e,0),s=Array(i);++a<i;)s[a]=n[e+a];a=-1;for(var l=Array(e+1);++a<e;)l[a]=n[a];return l[e]=r(s),_m(t,this,l)}}var Wm=9007199254740991;function Fs(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Wm}function jm(t){return t!=null&&Fs(t.length)&&!fu(t)}var Ym=Object.prototype;function Zm(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ym;return t===r}function Xm(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Qm="[object Arguments]";function vu(t){return Xn(t)&&Zn(t)==Qm}var gu=Object.prototype,Jm=gu.hasOwnProperty,e0=gu.propertyIsEnumerable,As=vu(function(){return arguments}())?vu:function(t){return Xn(t)&&Jm.call(t,"callee")&&!e0.call(t,"callee")};function t0(){return!1}var mu=typeof Re=="object"&&Re&&!Re.nodeType&&Re,yu=mu&&typeof module=="object"&&module&&!module.nodeType&&module,r0=yu&&yu.exports===mu,bu=r0?mr.Buffer:void 0,n0=bu?bu.isBuffer:void 0,Vs=n0||t0,a0="[object Arguments]",i0="[object Array]",o0="[object Boolean]",s0="[object Date]",l0="[object Error]",c0="[object Function]",u0="[object Map]",d0="[object Number]",f0="[object Object]",h0="[object RegExp]",p0="[object Set]",v0="[object String]",g0="[object WeakMap]",m0="[object ArrayBuffer]",y0="[object DataView]",b0="[object Float32Array]",w0="[object Float64Array]",C0="[object Int8Array]",k0="[object Int16Array]",x0="[object Int32Array]",E0="[object Uint8Array]",S0="[object Uint8ClampedArray]",T0="[object Uint16Array]",B0="[object Uint32Array]",We={};We[b0]=We[w0]=We[C0]=We[k0]=We[x0]=We[E0]=We[S0]=We[T0]=We[B0]=!0,We[a0]=We[i0]=We[m0]=We[o0]=We[y0]=We[s0]=We[l0]=We[c0]=We[u0]=We[d0]=We[f0]=We[h0]=We[p0]=We[v0]=We[g0]=!1;function N0(t){return Xn(t)&&Fs(t.length)&&!!We[Zn(t)]}function D0(t){return function(e){return t(e)}}var wu=typeof Re=="object"&&Re&&!Re.nodeType&&Re,qa=wu&&typeof module=="object"&&module&&!module.nodeType&&module,P0=qa&&qa.exports===wu,Rs=P0&&nu.process,Cu=function(){try{var t=qa&&qa.require&&qa.require("util").types;return t||Rs&&Rs.binding&&Rs.binding("util")}catch{}}(),ku=Cu&&Cu.isTypedArray,xu=ku?D0(ku):N0,_0=Object.prototype,O0=_0.hasOwnProperty;function I0(t,e){var r=nr(t),n=!r&&As(t),a=!r&&!n&&Vs(t),i=!r&&!n&&!a&&xu(t),s=r||n||a||i,l=s?Xm(t.length,String):[],c=l.length;for(var u in t)O0.call(t,u)&&!(s&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Ls(u,c)))&&l.push(u);return l}function L0(t,e){return function(r){return t(e(r))}}var M0=L0(Object.keys,Object),F0=Object.prototype,A0=F0.hasOwnProperty;function V0(t){if(!Zm(t))return M0(t);var e=[];for(var r in Object(t))A0.call(t,r)&&r!="constructor"&&e.push(r);return e}function Eu(t){return jm(t)?I0(t):V0(t)}var R0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$0=/^\w*$/;function $s(t,e){if(nr(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Zi(t)?!0:$0.test(t)||!R0.test(t)||e!=null&&t in Object(e)}var Ua=kn(Object,"create");function z0(){this.__data__=Ua?Ua(null):{},this.size=0}function H0(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var K0="__lodash_hash_undefined__",q0=Object.prototype,U0=q0.hasOwnProperty;function G0(t){var e=this.__data__;if(Ua){var r=e[t];return r===K0?void 0:r}return U0.call(e,t)?e[t]:void 0}var W0=Object.prototype,j0=W0.hasOwnProperty;function Y0(t){var e=this.__data__;return Ua?e[t]!==void 0:j0.call(e,t)}var Z0="__lodash_hash_undefined__";function X0(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ua&&e===void 0?Z0:e,this}function xn(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}xn.prototype.clear=z0,xn.prototype.delete=H0,xn.prototype.get=G0,xn.prototype.has=Y0,xn.prototype.set=X0;function Q0(){this.__data__=[],this.size=0}function Qi(t,e){for(var r=t.length;r--;)if(Ms(t[r][0],e))return r;return-1}var J0=Array.prototype,ey=J0.splice;function ty(t){var e=this.__data__,r=Qi(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ey.call(e,r,1),--this.size,!0}function ry(t){var e=this.__data__,r=Qi(e,t);return r<0?void 0:e[r][1]}function ny(t){return Qi(this.__data__,t)>-1}function ay(t,e){var r=this.__data__,n=Qi(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function _r(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}_r.prototype.clear=Q0,_r.prototype.delete=ty,_r.prototype.get=ry,_r.prototype.has=ny,_r.prototype.set=ay;var Ga=kn(mr,"Map");function iy(){this.size=0,this.__data__={hash:new xn,map:new(Ga||_r),string:new xn}}function oy(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ji(t,e){var r=t.__data__;return oy(e)?r[typeof e=="string"?"string":"hash"]:r.map}function sy(t){var e=Ji(this,t).delete(t);return this.size-=e?1:0,e}function ly(t){return Ji(this,t).get(t)}function cy(t){return Ji(this,t).has(t)}function uy(t,e){var r=Ji(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Or(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Or.prototype.clear=iy,Or.prototype.delete=sy,Or.prototype.get=ly,Or.prototype.has=cy,Or.prototype.set=uy;var dy="Expected a function";function zs(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(dy);var r=function(){var n=arguments,a=e?e.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var s=t.apply(this,n);return r.cache=i.set(a,s)||i,s};return r.cache=new(zs.Cache||Or),r}zs.Cache=Or;var fy=500;function hy(t){var e=zs(t,function(n){return r.size===fy&&r.clear(),n}),r=e.cache;return e}var py=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vy=/\\(\\)?/g,gy=hy(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(py,function(r,n,a,i){e.push(a?i.replace(vy,"$1"):n||r)}),e});function my(t){return t==null?"":lu(t)}function eo(t,e){return nr(t)?t:$s(t,e)?[t]:gy(my(t))}var yy=1/0;function Wa(t){if(typeof t=="string"||Zi(t))return t;var e=t+"";return e=="0"&&1/t==-yy?"-0":e}function Hs(t,e){e=eo(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Wa(e[r++])];return r&&r==n?t:void 0}function Ir(t,e,r){var n=t==null?void 0:Hs(t,e);return n===void 0?r:n}function Su(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}var Tu=yr?yr.isConcatSpreadable:void 0;function by(t){return nr(t)||As(t)||!!(Tu&&t&&t[Tu])}function wy(t,e,r,n,a){var i=-1,s=t.length;for(r||(r=by),a||(a=[]);++i<s;){var l=t[i];r(l)?Su(a,l):a[a.length]=l}return a}function Cy(t){var e=t==null?0:t.length;return e?wy(t):[]}function ky(t){return Vm(Gm(t,void 0,Cy),t+"")}function Gr(){if(!arguments.length)return[];var t=arguments[0];return nr(t)?t:[t]}function xy(){this.__data__=new _r,this.size=0}function Ey(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Sy(t){return this.__data__.get(t)}function Ty(t){return this.__data__.has(t)}var By=200;function Ny(t,e){var r=this.__data__;if(r instanceof _r){var n=r.__data__;if(!Ga||n.length<By-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Or(n)}return r.set(t,e),this.size=r.size,this}function Lr(t){var e=this.__data__=new _r(t);this.size=e.size}Lr.prototype.clear=xy,Lr.prototype.delete=Ey,Lr.prototype.get=Sy,Lr.prototype.has=Ty,Lr.prototype.set=Ny;function Dy(t,e){for(var r=-1,n=t==null?0:t.length,a=0,i=[];++r<n;){var s=t[r];e(s,r,t)&&(i[a++]=s)}return i}function Py(){return[]}var _y=Object.prototype,Oy=_y.propertyIsEnumerable,Bu=Object.getOwnPropertySymbols,Iy=Bu?function(t){return t==null?[]:(t=Object(t),Dy(Bu(t),function(e){return Oy.call(t,e)}))}:Py;function Ly(t,e,r){var n=e(t);return nr(t)?n:Su(n,r(t))}function Nu(t){return Ly(t,Eu,Iy)}var Ks=kn(mr,"DataView"),qs=kn(mr,"Promise"),Us=kn(mr,"Set"),Du="[object Map]",My="[object Object]",Pu="[object Promise]",_u="[object Set]",Ou="[object WeakMap]",Iu="[object DataView]",Fy=Cn(Ks),Ay=Cn(Ga),Vy=Cn(qs),Ry=Cn(Us),$y=Cn(Is),Wr=Zn;(Ks&&Wr(new Ks(new ArrayBuffer(1)))!=Iu||Ga&&Wr(new Ga)!=Du||qs&&Wr(qs.resolve())!=Pu||Us&&Wr(new Us)!=_u||Is&&Wr(new Is)!=Ou)&&(Wr=function(t){var e=Zn(t),r=e==My?t.constructor:void 0,n=r?Cn(r):"";if(n)switch(n){case Fy:return Iu;case Ay:return Du;case Vy:return Pu;case Ry:return _u;case $y:return Ou}return e});var Lu=mr.Uint8Array,zy="__lodash_hash_undefined__";function Hy(t){return this.__data__.set(t,zy),this}function Ky(t){return this.__data__.has(t)}function to(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Or;++e<r;)this.add(t[e])}to.prototype.add=to.prototype.push=Hy,to.prototype.has=Ky;function qy(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Uy(t,e){return t.has(e)}var Gy=1,Wy=2;function Mu(t,e,r,n,a,i){var s=r&Gy,l=t.length,c=e.length;if(l!=c&&!(s&&c>l))return!1;var u=i.get(t),d=i.get(e);if(u&&d)return u==e&&d==t;var f=-1,p=!0,v=r&Wy?new to:void 0;for(i.set(t,e),i.set(e,t);++f<l;){var h=t[f],g=e[f];if(n)var y=s?n(g,h,f,e,t,i):n(h,g,f,t,e,i);if(y!==void 0){if(y)continue;p=!1;break}if(v){if(!qy(e,function(m,b){if(!Uy(v,b)&&(h===m||a(h,m,r,n,i)))return v.push(b)})){p=!1;break}}else if(!(h===g||a(h,g,r,n,i))){p=!1;break}}return i.delete(t),i.delete(e),p}function jy(t){var e=-1,r=Array(t.size);return t.forEach(function(n,a){r[++e]=[a,n]}),r}function Yy(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Zy=1,Xy=2,Qy="[object Boolean]",Jy="[object Date]",e1="[object Error]",t1="[object Map]",r1="[object Number]",n1="[object RegExp]",a1="[object Set]",i1="[object String]",o1="[object Symbol]",s1="[object ArrayBuffer]",l1="[object DataView]",Fu=yr?yr.prototype:void 0,Gs=Fu?Fu.valueOf:void 0;function c1(t,e,r,n,a,i,s){switch(r){case l1:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case s1:return!(t.byteLength!=e.byteLength||!i(new Lu(t),new Lu(e)));case Qy:case Jy:case r1:return Ms(+t,+e);case e1:return t.name==e.name&&t.message==e.message;case n1:case i1:return t==e+"";case t1:var l=jy;case a1:var c=n&Zy;if(l||(l=Yy),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=Xy,s.set(t,e);var d=Mu(l(t),l(e),n,a,i,s);return s.delete(t),d;case o1:if(Gs)return Gs.call(t)==Gs.call(e)}return!1}var u1=1,d1=Object.prototype,f1=d1.hasOwnProperty;function h1(t,e,r,n,a,i){var s=r&u1,l=Nu(t),c=l.length,u=Nu(e),d=u.length;if(c!=d&&!s)return!1;for(var f=c;f--;){var p=l[f];if(!(s?p in e:f1.call(e,p)))return!1}var v=i.get(t),h=i.get(e);if(v&&h)return v==e&&h==t;var g=!0;i.set(t,e),i.set(e,t);for(var y=s;++f<c;){p=l[f];var m=t[p],b=e[p];if(n)var w=s?n(b,m,p,e,t,i):n(m,b,p,t,e,i);if(!(w===void 0?m===b||a(m,b,r,n,i):w)){g=!1;break}y||(y=p=="constructor")}if(g&&!y){var C=t.constructor,x=e.constructor;C!=x&&"constructor"in t&&"constructor"in e&&!(typeof C=="function"&&C instanceof C&&typeof x=="function"&&x instanceof x)&&(g=!1)}return i.delete(t),i.delete(e),g}var p1=1,Au="[object Arguments]",Vu="[object Array]",ro="[object Object]",v1=Object.prototype,Ru=v1.hasOwnProperty;function g1(t,e,r,n,a,i){var s=nr(t),l=nr(e),c=s?Vu:Wr(t),u=l?Vu:Wr(e);c=c==Au?ro:c,u=u==Au?ro:u;var d=c==ro,f=u==ro,p=c==u;if(p&&Vs(t)){if(!Vs(e))return!1;s=!0,d=!1}if(p&&!d)return i||(i=new Lr),s||xu(t)?Mu(t,e,r,n,a,i):c1(t,e,c,r,n,a,i);if(!(r&p1)){var v=d&&Ru.call(t,"__wrapped__"),h=f&&Ru.call(e,"__wrapped__");if(v||h){var g=v?t.value():t,y=h?e.value():e;return i||(i=new Lr),a(g,y,r,n,i)}}return p?(i||(i=new Lr),h1(t,e,r,n,a,i)):!1}function no(t,e,r,n,a){return t===e?!0:t==null||e==null||!Xn(t)&&!Xn(e)?t!==t&&e!==e:g1(t,e,r,n,no,a)}var m1=1,y1=2;function b1(t,e,r,n){var a=r.length,i=a;if(t==null)return!i;for(t=Object(t);a--;){var s=r[a];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++a<i;){s=r[a];var l=s[0],c=t[l],u=s[1];if(s[2]){if(c===void 0&&!(l in t))return!1}else{var d=new Lr,f;if(!(f===void 0?no(u,c,m1|y1,n,d):f))return!1}}return!0}function $u(t){return t===t&&!Ur(t)}function w1(t){for(var e=Eu(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,$u(a)]}return e}function zu(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function C1(t){var e=w1(t);return e.length==1&&e[0][2]?zu(e[0][0],e[0][1]):function(r){return r===t||b1(r,t,e)}}function k1(t,e){return t!=null&&e in Object(t)}function x1(t,e,r){e=eo(e,t);for(var n=-1,a=e.length,i=!1;++n<a;){var s=Wa(e[n]);if(!(i=t!=null&&r(t,s)))break;t=t[s]}return i||++n!=a?i:(a=t==null?0:t.length,!!a&&Fs(a)&&Ls(s,a)&&(nr(t)||As(t)))}function Hu(t,e){return t!=null&&x1(t,e,k1)}var E1=1,S1=2;function T1(t,e){return $s(t)&&$u(e)?zu(Wa(t),e):function(r){var n=Ir(r,t);return n===void 0&&n===e?Hu(r,t):no(e,n,E1|S1)}}function B1(t){return function(e){return e==null?void 0:e[t]}}function N1(t){return function(e){return Hs(e,t)}}function D1(t){return $s(t)?B1(Wa(t)):N1(t)}function P1(t){return typeof t=="function"?t:t==null?du:typeof t=="object"?nr(t)?T1(t[0],t[1]):C1(t):D1(t)}var Ws=function(){return mr.Date.now()},_1="Expected a function",O1=Math.max,I1=Math.min;function Ku(t,e,r){var n,a,i,s,l,c,u=0,d=!1,f=!1,p=!0;if(typeof t!="function")throw new TypeError(_1);e=uu(e)||0,Ur(r)&&(d=!!r.leading,f="maxWait"in r,i=f?O1(uu(r.maxWait)||0,e):i,p="trailing"in r?!!r.trailing:p);function v(E){var k=n,B=a;return n=a=void 0,u=E,s=t.apply(B,k),s}function h(E){return u=E,l=setTimeout(m,e),d?v(E):s}function g(E){var k=E-c,B=E-u,S=e-k;return f?I1(S,i-B):S}function y(E){var k=E-c,B=E-u;return c===void 0||k>=e||k<0||f&&B>=i}function m(){var E=Ws();if(y(E))return b(E);l=setTimeout(m,g(E))}function b(E){return l=void 0,p&&n?v(E):(n=a=void 0,s)}function w(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function C(){return l===void 0?s:b(Ws())}function x(){var E=Ws(),k=y(E);if(n=arguments,a=this,c=E,k){if(l===void 0)return h(c);if(f)return clearTimeout(l),l=setTimeout(m,e),v(c)}return l===void 0&&(l=setTimeout(m,e)),s}return x.cancel=w,x.flush=C,x}function L1(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var a=n-1;return Rm(t,P1(e),a)}function ao(t){for(var e=-1,r=t==null?0:t.length,n={};++e<r;){var a=t[e];n[a[0]]=a[1]}return n}function io(t,e){return no(t,e)}function jr(t){return t==null}function M1(t){return t===void 0}function F1(t,e,r,n){if(!Ur(t))return t;e=eo(e,t);for(var a=-1,i=e.length,s=i-1,l=t;l!=null&&++a<i;){var c=Wa(e[a]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(a!=s){var d=l[c];u=void 0,u===void 0&&(u=Ur(d)?d:Ls(e[a+1])?[]:{})}Um(l,c,u),l=l[c]}return t}function A1(t,e,r){for(var n=-1,a=e.length,i={};++n<a;){var s=e[n],l=Hs(t,s);r(l,s)&&F1(i,eo(s,t),l)}return i}function V1(t,e){return A1(t,e,function(r,n){return Hu(t,n)})}var qu=ky(function(t,e){return t==null?{}:V1(t,e)});const Yr=t=>t===void 0,Qn=t=>typeof t=="boolean",gt=t=>typeof t=="number",En=t=>typeof Element>"u"?!1:t instanceof Element,oo=t=>jr(t),R1=t=>St(t)?!Number.isNaN(Number(t)):!1,$1=(t="")=>t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),Uu=t=>Object.keys(t);class Gu extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function z1(t,e){throw new Gu(`[${t}] ${e}`)}function tt(t,e){if(process.env.NODE_ENV!=="production"){const r=St(t)?new Gu(`[${t}] ${e}`):t;console.warn(r)}}const H1="utils/dom/style",Wu=(t="")=>t.split(" ").filter(e=>!!e.trim()),js=(t,e)=>{!t||!e.trim()||t.classList.add(...Wu(e))},Sn=(t,e)=>{!t||!e.trim()||t.classList.remove(...Wu(e))},ja=(t,e)=>{var r;if(!et||!t||!e)return"";let n=Gg(e);n==="float"&&(n="cssFloat");try{const a=t.style[n];if(a)return a;const i=(r=document.defaultView)==null?void 0:r.getComputedStyle(t,"");return i?i[n]:""}catch{return t.style[n]}};function Jn(t,e="px"){if(!t)return"";if(gt(t)||R1(t))return`${t}${e}`;if(St(t))return t;tt(H1,"binding value must be a string or number")}function K1(t,e){if(!et)return;if(!e){t.scrollTop=0;return}const r=[];let n=e.offsetParent;for(;n!==null&&t!==n&&t.contains(n);)r.push(n),n=n.offsetParent;const a=e.offsetTop+r.reduce((c,u)=>c+u.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 q1=o.defineComponent({name:"Aim",__name:"aim",setup(t){return(e,r)=>(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"})]))}}),U1=q1,G1=o.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(t){return(e,r)=>(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"})]))}}),so=G1,W1=o.defineComponent({name:"ArrowUp",__name:"arrow-up",setup(t){return(e,r)=>(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"})]))}}),ju=W1,j1=o.defineComponent({name:"CaretRight",__name:"caret-right",setup(t){return(e,r)=>(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"})]))}}),Y1=j1,Z1=o.defineComponent({name:"CircleCheck",__name:"circle-check",setup(t){return(e,r)=>(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"})]))}}),X1=Z1,Q1=o.defineComponent({name:"CircleClose",__name:"circle-close",setup(t){return(e,r)=>(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"})]))}}),Ys=Q1,J1=o.defineComponent({name:"Close",__name:"close",setup(t){return(e,r)=>(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"})]))}}),lo=J1,eb=o.defineComponent({name:"CopyDocument",__name:"copy-document",setup(t){return(e,r)=>(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"})]))}}),tb=eb,rb=o.defineComponent({name:"Delete",__name:"delete",setup(t){return(e,r)=>(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"})]))}}),nb=rb,ab=o.defineComponent({name:"Edit",__name:"edit",setup(t){return(e,r)=>(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"})]))}}),ib=ab,ob=o.defineComponent({name:"Finished",__name:"finished",setup(t){return(e,r)=>(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"})]))}}),sb=ob,lb=o.defineComponent({name:"Hide",__name:"hide",setup(t){return(e,r)=>(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"})]))}}),cb=lb,ub=o.defineComponent({name:"Loading",__name:"loading",setup(t){return(e,r)=>(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"})]))}}),Zs=ub,db=o.defineComponent({name:"Lock",__name:"lock",setup(t){return(e,r)=>(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"})]))}}),fb=db,hb=o.defineComponent({name:"Unlock",__name:"unlock",setup(t){return(e,r)=>(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"})]))}}),pb=hb,vb=o.defineComponent({name:"View",__name:"view",setup(t){return(e,r)=>(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"})]))}}),gb=vb,mb=o.defineComponent({name:"Warning",__name:"warning",setup(t){return(e,r)=>(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"})]))}}),yb=mb,bb=o.defineComponent({name:"ZoomIn",__name:"zoom-in",setup(t){return(e,r)=>(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"})]))}}),wb=bb,Cb=o.defineComponent({name:"ZoomOut",__name:"zoom-out",setup(t){return(e,r)=>(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"})]))}}),kb=Cb;const Yu="__epPropKey",ke=t=>t,xb=t=>vt(t)&&!!t[Yu],co=(t,e)=>{if(!vt(t)||xb(t))return t;const{values:r,required:n,default:a,type:i,validator:s}=t,c={type:i,required:!!n,validator:r||s?u=>{let d=!1,f=[];if(r&&(f=Array.from(r),wn(t,"default")&&f.push(a),d||(d=f.includes(u))),s&&(d||(d=s(u))),!d&&f.length>0){const p=[...new Set(f)].map(v=>JSON.stringify(v)).join(", ");o.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${p}], got value ${JSON.stringify(u)}.`)}return d}:void 0,[Yu]:!0};return wn(t,"default")&&(c.default=a),c},Fe=t=>ao(Object.entries(t).map(([e,r])=>[e,co(r,e)])),Zr=ke([String,Object,Function]),Zu={validating:Zs,success:X1,error:Ys},dt=(t,e)=>{if(t.install=r=>{for(const n of[t,...Object.values(e??{})])r.component(n.name,n)},e)for(const[r,n]of Object.entries(e))t[r]=n;return t},Eb=(t,e)=>(t.install=r=>{r.directive(e,t)},t),Mr=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"},mt="update:modelValue",Xs="change",Xu=["","default","small","large"],Sb=t=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t),ea=t=>t,Tb=["class","style"],Bb=/^on[A-Z]/,Nb=(t={})=>{const{excludeListeners:e=!1,excludeKeys:r}=t,n=o.computed(()=>((r==null?void 0:r.value)||[]).concat(Tb)),a=o.getCurrentInstance();return a?o.computed(()=>{var i;return ao(Object.entries((i=a.proxy)==null?void 0:i.$attrs).filter(([s])=>!n.value.includes(s)&&!(e&&Bb.test(s))))}):(tt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),o.computed(()=>({})))},uo=({from:t,replacement:e,scope:r,version:n,ref:a,type:i="API"},s)=>{o.watch(()=>o.unref(s),l=>{l&&tt(r,`[${i}] ${t} is about to be deprecated in version ${n}, please use ${e} instead.
6
6
  For more detail, please visit: ${a}
7
- `)},{immediate:!0})};var Db={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 Pb=t=>(e,r)=>_b(e,r,o.unref(t)),_b=(t,e,r)=>Ir(r,t,t).replace(/\{(\w+)\}/g,(n,a)=>{var i;return`${(i=e==null?void 0:e[a])!=null?i:`{${a}}`}`}),Ob=t=>{const e=o.computed(()=>o.unref(t).name),r=o.isRef(t)?t:o.ref(t);return{lang:e,locale:r,t:Pb(t)}},Xu=Symbol("localeContextKey"),Ya=t=>{const e=t||o.inject(Xu,o.ref());return Ob(o.computed(()=>e.value||Db))},fo="el",Ib="is-",Tn=(t,e,r,n,a)=>{let i=`${t}-${e}`;return r&&(i+=`-${r}`),n&&(i+=`__${n}`),a&&(i+=`--${a}`),i},Qu=Symbol("namespaceContextKey"),Qs=t=>{const e=t||(o.getCurrentInstance()?o.inject(Qu,o.ref(fo)):o.ref(fo));return o.computed(()=>o.unref(e)||fo)},Be=(t,e)=>{const r=Qs(e);return{namespace:r,b:(g="")=>Tn(r.value,t,g,"",""),e:g=>g?Tn(r.value,t,"",g,""):"",m:g=>g?Tn(r.value,t,"","",g):"",be:(g,y)=>g&&y?Tn(r.value,t,g,y,""):"",em:(g,y)=>g&&y?Tn(r.value,t,"",g,y):"",bm:(g,y)=>g&&y?Tn(r.value,t,g,"",y):"",bem:(g,y,m)=>g&&y&&m?Tn(r.value,t,g,y,m):"",is:(g,...y)=>{const m=y.length>=1?y[0]:!0;return g&&m?`${Ib}${g}`:""},cssVar:g=>{const y={};for(const m in g)g[m]&&(y[`--${r.value}-${m}`]=g[m]);return y},cssVarName:g=>`--${r.value}-${g}`,cssVarBlock:g=>{const y={};for(const m in g)g[m]&&(y[`--${r.value}-${t}-${m}`]=g[m]);return y},cssVarBlockName:g=>`--${r.value}-${t}-${g}`}},Lb=co({type:ke(Boolean),default:null}),Mb=co({type:ke(Function)}),Fb=t=>{const e=`update:${t}`,r=`onUpdate:${t}`,n=[e],a={[t]:Lb,[r]:Mb};return{useModelToggle:({indicator:s,toggleReason:l,shouldHideWhenRouteChanges:c,shouldProceed:u,onShow:d,onHide:f})=>{const p=o.getCurrentInstance(),{emit:v}=p,h=p.props,g=o.computed(()=>Lt(h[r])),y=o.computed(()=>h[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(h.disabled===!0||Lt(u)&&!u())return;const B=g.value&&et;B&&v(e,!0),(y.value||!B)&&m(k)},C=k=>{if(h.disabled===!0||!et)return;const B=g.value&&et;B&&v(e,!1),(y.value||!B)&&b(k)},x=k=>{Qn(k)&&(h.disabled&&k?g.value&&v(e,!1):s.value!==k&&(k?m():b()))},E=()=>{s.value?C():w()};return o.watch(()=>h[t],x),c&&p.appContext.config.globalProperties.$route!==void 0&&o.watch(()=>({...p.proxy.$route}),()=>{c.value&&s.value&&C()}),o.onMounted(()=>{x(h[t])}),{hide:C,show:w,toggle:E,hasUpdateHandler:g}},useModelToggleProps:a,useModelToggleEmits:n}},Ju=t=>{const e=o.getCurrentInstance();return o.computed(()=>{var r,n;return(n=(r=e==null?void 0:e.proxy)==null?void 0:r.$props)==null?void 0:n[t]})};var Vt="top",Yt="bottom",Zt="right",Rt="left",Js="auto",Za=[Vt,Yt,Zt,Rt],ta="start",Xa="end",Ab="clippingParents",ed="viewport",Qa="popper",Vb="reference",td=Za.reduce(function(t,e){return t.concat([e+"-"+ta,e+"-"+Xa])},[]),ho=[].concat(Za,[Js]).reduce(function(t,e){return t.concat([e,e+"-"+ta,e+"-"+Xa])},[]),Rb="beforeRead",$b="read",zb="afterRead",Hb="beforeMain",Kb="main",qb="afterMain",Ub="beforeWrite",Gb="write",Wb="afterWrite",jb=[Rb,$b,zb,Hb,Kb,qb,Ub,Gb,Wb];function br(t){return t?(t.nodeName||"").toLowerCase():null}function ar(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=ar(t).Element;return t instanceof e||t instanceof Element}function Xt(t){var e=ar(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function el(t){if(typeof ShadowRoot>"u")return!1;var e=ar(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Yb(t){var e=t.state;Object.keys(e.elements).forEach(function(r){var n=e.styles[r]||{},a=e.attributes[r]||{},i=e.elements[r];!Xt(i)||!br(i)||(Object.assign(i.style,n),Object.keys(a).forEach(function(s){var l=a[s];l===!1?i.removeAttribute(s):i.setAttribute(s,l===!0?"":l)}))})}function Zb(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(n){var a=e.elements[n],i=e.attributes[n]||{},s=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:r[n]),l=s.reduce(function(c,u){return c[u]="",c},{});!Xt(a)||!br(a)||(Object.assign(a.style,l),Object.keys(i).forEach(function(c){a.removeAttribute(c)}))})}}var rd={name:"applyStyles",enabled:!0,phase:"write",fn:Yb,effect:Zb,requires:["computeStyles"]};function wr(t){return t.split("-")[0]}var Bn=Math.max,po=Math.min,na=Math.round;function aa(t,e){e===void 0&&(e=!1);var r=t.getBoundingClientRect(),n=1,a=1;if(Xt(t)&&e){var i=t.offsetHeight,s=t.offsetWidth;s>0&&(n=na(r.width)/s||1),i>0&&(a=na(r.height)/i||1)}return{width:r.width/n,height:r.height/a,top:r.top/a,right:r.right/n,bottom:r.bottom/a,left:r.left/n,x:r.left/n,y:r.top/a}}function tl(t){var e=aa(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function nd(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&el(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Fr(t){return ar(t).getComputedStyle(t)}function Xb(t){return["table","td","th"].indexOf(br(t))>=0}function Xr(t){return((ra(t)?t.ownerDocument:t.document)||window.document).documentElement}function vo(t){return br(t)==="html"?t:t.assignedSlot||t.parentNode||(el(t)?t.host:null)||Xr(t)}function ad(t){return!Xt(t)||Fr(t).position==="fixed"?null:t.offsetParent}function Qb(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,r=navigator.userAgent.indexOf("Trident")!==-1;if(r&&Xt(t)){var n=Fr(t);if(n.position==="fixed")return null}var a=vo(t);for(el(a)&&(a=a.host);Xt(a)&&["html","body"].indexOf(br(a))<0;){var i=Fr(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 Ja(t){for(var e=ar(t),r=ad(t);r&&Xb(r)&&Fr(r).position==="static";)r=ad(r);return r&&(br(r)==="html"||br(r)==="body"&&Fr(r).position==="static")?e:r||Qb(t)||e}function rl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ei(t,e,r){return Bn(t,po(e,r))}function Jb(t,e,r){var n=ei(t,e,r);return n>r?r:n}function id(){return{top:0,right:0,bottom:0,left:0}}function od(t){return Object.assign({},id(),t)}function sd(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var ew=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,od(typeof t!="number"?t:sd(t,Za))};function tw(t){var e,r=t.state,n=t.name,a=t.options,i=r.elements.arrow,s=r.modifiersData.popperOffsets,l=wr(r.placement),c=rl(l),u=[Rt,Zt].indexOf(l)>=0,d=u?"height":"width";if(!(!i||!s)){var f=ew(a.padding,r),p=tl(i),v=c==="y"?Vt:Rt,h=c==="y"?Yt:Zt,g=r.rects.reference[d]+r.rects.reference[c]-s[c]-r.rects.popper[d],y=s[c]-r.rects.reference[c],m=Ja(i),b=m?c==="y"?m.clientHeight||0:m.clientWidth||0:0,w=g/2-y/2,C=f[v],x=b-p[d]-f[h],E=b/2-p[d]/2+w,k=ei(C,E,x),B=c;r.modifiersData[n]=(e={},e[B]=k,e.centerOffset=k-E,e)}}function rw(t){var e=t.state,r=t.options,n=r.element,a=n===void 0?"[data-popper-arrow]":n;a!=null&&(typeof a=="string"&&(a=e.elements.popper.querySelector(a),!a)||!nd(e.elements.popper,a)||(e.elements.arrow=a))}var nw={name:"arrow",enabled:!0,phase:"main",fn:tw,effect:rw,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ia(t){return t.split("-")[1]}var aw={top:"auto",right:"auto",bottom:"auto",left:"auto"};function iw(t){var e=t.x,r=t.y,n=window,a=n.devicePixelRatio||1;return{x:na(e*a)/a||0,y:na(r*a)/a||0}}function ld(t){var e,r=t.popper,n=t.popperRect,a=t.placement,i=t.variation,s=t.offsets,l=t.position,c=t.gpuAcceleration,u=t.adaptive,d=t.roundOffsets,f=t.isFixed,p=s.x,v=p===void 0?0:p,h=s.y,g=h===void 0?0:h,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,x=window;if(u){var E=Ja(r),k="clientHeight",B="clientWidth";if(E===ar(r)&&(E=Xr(r),Fr(E).position!=="static"&&l==="absolute"&&(k="scrollHeight",B="scrollWidth")),E=E,a===Vt||(a===Rt||a===Zt)&&i===Xa){C=Yt;var S=f&&E===x&&x.visualViewport?x.visualViewport.height:E[k];g-=S-n.height,g*=c?1:-1}if(a===Rt||(a===Vt||a===Yt)&&i===Xa){w=Zt;var N=f&&E===x&&x.visualViewport?x.visualViewport.width:E[B];v-=N-n.width,v*=c?1:-1}}var D=Object.assign({position:l},u&&aw),P=d===!0?iw({x:v,y:g}):{x:v,y:g};if(v=P.x,g=P.y,c){var I;return Object.assign({},D,(I={},I[C]=b?"0":"",I[w]=m?"0":"",I.transform=(x.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 ow(t){var e=t.state,r=t.options,n=r.gpuAcceleration,a=n===void 0?!0:n,i=r.adaptive,s=i===void 0?!0:i,l=r.roundOffsets,c=l===void 0?!0:l,u={placement:wr(e.placement),variation:ia(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,ld(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ld(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var cd={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ow,data:{}},go={passive:!0};function sw(t){var e=t.state,r=t.instance,n=t.options,a=n.scroll,i=a===void 0?!0:a,s=n.resize,l=s===void 0?!0:s,c=ar(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",r.update,go)}),l&&c.addEventListener("resize",r.update,go),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",r.update,go)}),l&&c.removeEventListener("resize",r.update,go)}}var ud={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:sw,data:{}},lw={left:"right",right:"left",bottom:"top",top:"bottom"};function mo(t){return t.replace(/left|right|bottom|top/g,function(e){return lw[e]})}var cw={start:"end",end:"start"};function dd(t){return t.replace(/start|end/g,function(e){return cw[e]})}function nl(t){var e=ar(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function al(t){return aa(Xr(t)).left+nl(t).scrollLeft}function uw(t){var e=ar(t),r=Xr(t),n=e.visualViewport,a=r.clientWidth,i=r.clientHeight,s=0,l=0;return n&&(a=n.width,i=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=n.offsetLeft,l=n.offsetTop)),{width:a,height:i,x:s+al(t),y:l}}function dw(t){var e,r=Xr(t),n=nl(t),a=(e=t.ownerDocument)==null?void 0:e.body,i=Bn(r.scrollWidth,r.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=Bn(r.scrollHeight,r.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),l=-n.scrollLeft+al(t),c=-n.scrollTop;return Fr(a||r).direction==="rtl"&&(l+=Bn(r.clientWidth,a?a.clientWidth:0)-i),{width:i,height:s,x:l,y:c}}function il(t){var e=Fr(t),r=e.overflow,n=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+a+n)}function fd(t){return["html","body","#document"].indexOf(br(t))>=0?t.ownerDocument.body:Xt(t)&&il(t)?t:fd(vo(t))}function ti(t,e){var r;e===void 0&&(e=[]);var n=fd(t),a=n===((r=t.ownerDocument)==null?void 0:r.body),i=ar(n),s=a?[i].concat(i.visualViewport||[],il(n)?n:[]):n,l=e.concat(s);return a?l:l.concat(ti(vo(s)))}function ol(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function fw(t){var e=aa(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 hd(t,e){return e===ed?ol(uw(t)):ra(e)?fw(e):ol(dw(Xr(t)))}function hw(t){var e=ti(vo(t)),r=["absolute","fixed"].indexOf(Fr(t).position)>=0,n=r&&Xt(t)?Ja(t):t;return ra(n)?e.filter(function(a){return ra(a)&&nd(a,n)&&br(a)!=="body"}):[]}function pw(t,e,r){var n=e==="clippingParents"?hw(t):[].concat(e),a=[].concat(n,[r]),i=a[0],s=a.reduce(function(l,c){var u=hd(t,c);return l.top=Bn(u.top,l.top),l.right=po(u.right,l.right),l.bottom=po(u.bottom,l.bottom),l.left=Bn(u.left,l.left),l},hd(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 pd(t){var e=t.reference,r=t.element,n=t.placement,a=n?wr(n):null,i=n?ia(n):null,s=e.x+e.width/2-r.width/2,l=e.y+e.height/2-r.height/2,c;switch(a){case Vt:c={x:s,y:e.y-r.height};break;case Yt:c={x:s,y:e.y+e.height};break;case Zt:c={x:e.x+e.width,y:l};break;case Rt:c={x:e.x-r.width,y:l};break;default:c={x:e.x,y:e.y}}var u=a?rl(a):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case ta:c[u]=c[u]-(e[d]/2-r[d]/2);break;case Xa:c[u]=c[u]+(e[d]/2-r[d]/2);break}}return c}function ri(t,e){e===void 0&&(e={});var r=e,n=r.placement,a=n===void 0?t.placement:n,i=r.boundary,s=i===void 0?Ab:i,l=r.rootBoundary,c=l===void 0?ed:l,u=r.elementContext,d=u===void 0?Qa:u,f=r.altBoundary,p=f===void 0?!1:f,v=r.padding,h=v===void 0?0:v,g=od(typeof h!="number"?h:sd(h,Za)),y=d===Qa?Vb:Qa,m=t.rects.popper,b=t.elements[p?y:d],w=pw(ra(b)?b:b.contextElement||Xr(t.elements.popper),s,c),C=aa(t.elements.reference),x=pd({reference:C,element:m,strategy:"absolute",placement:a}),E=ol(Object.assign({},m,x)),k=d===Qa?E: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===Qa&&S){var N=S[a];Object.keys(B).forEach(function(D){var P=[Zt,Yt].indexOf(D)>=0?1:-1,I=[Vt,Yt].indexOf(D)>=0?"y":"x";B[D]+=N[I]*P})}return B}function vw(t,e){e===void 0&&(e={});var r=e,n=r.placement,a=r.boundary,i=r.rootBoundary,s=r.padding,l=r.flipVariations,c=r.allowedAutoPlacements,u=c===void 0?ho:c,d=ia(n),f=d?l?td:td.filter(function(h){return ia(h)===d}):Za,p=f.filter(function(h){return u.indexOf(h)>=0});p.length===0&&(p=f);var v=p.reduce(function(h,g){return h[g]=ri(t,{placement:g,boundary:a,rootBoundary:i,padding:s})[wr(g)],h},{});return Object.keys(v).sort(function(h,g){return v[h]-v[g]})}function gw(t){if(wr(t)===Js)return[];var e=mo(t);return[dd(t),e,dd(e)]}function mw(t){var e=t.state,r=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var a=r.mainAxis,i=a===void 0?!0:a,s=r.altAxis,l=s===void 0?!0:s,c=r.fallbackPlacements,u=r.padding,d=r.boundary,f=r.rootBoundary,p=r.altBoundary,v=r.flipVariations,h=v===void 0?!0:v,g=r.allowedAutoPlacements,y=e.options.placement,m=wr(y),b=m===y,w=c||(b||!h?[mo(y)]:gw(y)),C=[y].concat(w).reduce(function(ee,J){return ee.concat(wr(J)===Js?vw(e,{placement:J,boundary:d,rootBoundary:f,padding:u,flipVariations:h,allowedAutoPlacements:g}):J)},[]),x=e.rects.reference,E=e.rects.popper,k=new Map,B=!0,S=C[0],N=0;N<C.length;N++){var D=C[N],P=wr(D),I=ia(D)===ta,_=[Vt,Yt].indexOf(P)>=0,F=_?"width":"height",O=ri(e,{placement:D,boundary:d,rootBoundary:f,altBoundary:p,padding:u}),M=_?I?Zt:Rt:I?Yt:Vt;x[F]>E[F]&&(M=mo(M));var L=mo(M),V=[];if(i&&V.push(O[P]<=0),l&&V.push(O[M]<=0,O[L]<=0),V.every(function(ee){return ee})){S=D,B=!1;break}k.set(D,V)}if(B)for(var H=h?3:1,$=function(ee){var J=C.find(function(X){var re=k.get(X);if(re)return re.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[n]._skip=!0,e.placement=S,e.reset=!0)}}var yw={name:"flip",enabled:!0,phase:"main",fn:mw,requiresIfExists:["offset"],data:{_skip:!1}};function vd(t,e,r){return r===void 0&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function gd(t){return[Vt,Zt,Yt,Rt].some(function(e){return t[e]>=0})}function bw(t){var e=t.state,r=t.name,n=e.rects.reference,a=e.rects.popper,i=e.modifiersData.preventOverflow,s=ri(e,{elementContext:"reference"}),l=ri(e,{altBoundary:!0}),c=vd(s,n),u=vd(l,a,i),d=gd(c),f=gd(u);e.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}var ww={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:bw};function Cw(t,e,r){var n=wr(t),a=[Rt,Vt].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,s=i[0],l=i[1];return s=s||0,l=(l||0)*a,[Rt,Zt].indexOf(n)>=0?{x:l,y:s}:{x:s,y:l}}function kw(t){var e=t.state,r=t.options,n=t.name,a=r.offset,i=a===void 0?[0,0]:a,s=ho.reduce(function(d,f){return d[f]=Cw(f,e.rects,i),d},{}),l=s[e.placement],c=l.x,u=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[n]=s}var xw={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:kw};function Ew(t){var e=t.state,r=t.name;e.modifiersData[r]=pd({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var md={name:"popperOffsets",enabled:!0,phase:"read",fn:Ew,data:{}};function Sw(t){return t==="x"?"y":"x"}function Tw(t){var e=t.state,r=t.options,n=t.name,a=r.mainAxis,i=a===void 0?!0:a,s=r.altAxis,l=s===void 0?!1:s,c=r.boundary,u=r.rootBoundary,d=r.altBoundary,f=r.padding,p=r.tether,v=p===void 0?!0:p,h=r.tetherOffset,g=h===void 0?0:h,y=ri(e,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),m=wr(e.placement),b=ia(e.placement),w=!b,C=rl(m),x=Sw(C),E=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,P={x:0,y:0};if(E){if(i){var I,_=C==="y"?Vt:Rt,F=C==="y"?Yt:Zt,O=C==="y"?"height":"width",M=E[C],L=M+y[_],V=M-y[F],H=v?-B[O]/2:0,$=b===ta?k[O]:B[O],z=b===ta?-B[O]:-k[O],j=e.elements.arrow,ee=v&&j?tl(j):{width:0,height:0},J=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:id(),X=J[_],re=J[F],Y=ei(0,k[O],ee[O]),A=w?k[O]/2-H-Y-X-N.mainAxis:$-Y-X-N.mainAxis,K=w?-k[O]/2+H+Y+re+N.mainAxis:z+Y+re+N.mainAxis,W=e.elements.arrow&&Ja(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,ne=M+A-he-oe,se=M+K-he,ue=ei(v?po(L,ne):L,M,v?Bn(V,se):V);E[C]=ue,P[C]=ue-M}if(l){var pe,de=C==="x"?Vt:Rt,me=C==="x"?Yt:Zt,Ne=E[x],De=x==="y"?"height":"width",Ee=Ne+y[de],Pe=Ne-y[me],te=[Vt,Rt].indexOf(m)!==-1,T=(pe=D==null?void 0:D[x])!=null?pe:0,R=te?Ee:Ne-k[De]-B[De]-T+N.altAxis,Q=te?Ne+k[De]+B[De]-T-N.altAxis:Pe,G=v&&te?Jb(R,Ne,Q):ei(v?R:Ee,Ne,v?Q:Pe);E[x]=G,P[x]=G-Ne}e.modifiersData[n]=P}}var Bw={name:"preventOverflow",enabled:!0,phase:"main",fn:Tw,requiresIfExists:["offset"]};function Nw(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Dw(t){return t===ar(t)||!Xt(t)?nl(t):Nw(t)}function Pw(t){var e=t.getBoundingClientRect(),r=na(e.width)/t.offsetWidth||1,n=na(e.height)/t.offsetHeight||1;return r!==1||n!==1}function _w(t,e,r){r===void 0&&(r=!1);var n=Xt(e),a=Xt(e)&&Pw(e),i=Xr(e),s=aa(t,a),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((br(e)!=="body"||il(i))&&(l=Dw(e)),Xt(e)?(c=aa(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=al(i))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function Ow(t){var e=new Map,r=new Set,n=[];t.forEach(function(i){e.set(i.name,i)});function a(i){r.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(l){if(!r.has(l)){var c=e.get(l);c&&a(c)}}),n.push(i)}return t.forEach(function(i){r.has(i.name)||a(i)}),n}function Iw(t){var e=Ow(t);return jb.reduce(function(r,n){return r.concat(e.filter(function(a){return a.phase===n}))},[])}function Lw(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function Mw(t){var e=t.reduce(function(r,n){var a=r[n.name];return r[n.name]=a?Object.assign({},a,n,{options:Object.assign({},a.options,n.options),data:Object.assign({},a.data,n.data)}):n,r},{});return Object.keys(e).map(function(r){return e[r]})}var yd={placement:"bottom",modifiers:[],strategy:"absolute"};function bd(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function sl(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,a=e.defaultOptions,i=a===void 0?yd:a;return function(s,l,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},yd,i),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],f=!1,p={state:u,setOptions:function(g){var y=typeof g=="function"?g(u.options):g;h(),u.options=Object.assign({},i,u.options,y),u.scrollParents={reference:ra(s)?ti(s):s.contextElement?ti(s.contextElement):[],popper:ti(l)};var m=Iw(Mw([].concat(n,u.options.modifiers)));return u.orderedModifiers=m.filter(function(b){return b.enabled}),v(),p.update()},forceUpdate:function(){if(!f){var g=u.elements,y=g.reference,m=g.popper;if(bd(y,m)){u.rects={reference:_w(y,Ja(m),u.options.strategy==="fixed"),popper:tl(m)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(B){return u.modifiersData[B.name]=Object.assign({},B.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var w=u.orderedModifiers[b],C=w.fn,x=w.options,E=x===void 0?{}:x,k=w.name;typeof C=="function"&&(u=C({state:u,options:E,name:k,instance:p})||u)}}}},update:Lw(function(){return new Promise(function(g){p.forceUpdate(),g(u)})}),destroy:function(){h(),f=!0}};if(!bd(s,l))return p;p.setOptions(c).then(function(g){!f&&c.onFirstUpdate&&c.onFirstUpdate(g)});function v(){u.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:u,name:y,instance:p,options:b}),x=function(){};d.push(C||x)}})}function h(){d.forEach(function(g){return g()}),d=[]}return p}}sl();var Fw=[ud,md,cd,rd];sl({defaultModifiers:Fw});var Aw=[ud,md,cd,rd,xw,yw,Bw,nw,ww],Vw=sl({defaultModifiers:Aw});const Rw=(t,e,r={})=>{const n={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=$w(c);Object.assign(s.value,u)},requires:["computeStyles"]},a=o.computed(()=>{const{onFirstUpdate:c,placement:u,strategy:d,modifiers:f}=o.unref(r);return{onFirstUpdate:c,placement:u||"bottom",strategy:d||"absolute",modifiers:[...f||[],n,{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,c=>{const u=o.unref(i);u&&u.setOptions(c)},{deep:!0}),o.watch([t,e],([c,u])=>{l(),!(!c||!u)&&(i.value=Vw(c,u,o.unref(a)))}),o.onBeforeUnmount(()=>{l()}),{state:o.computed(()=>{var c;return{...((c=o.unref(i))==null?void 0:c.state)||{}}}),styles:o.computed(()=>o.unref(s).styles),attributes:o.computed(()=>o.unref(s).attributes),update:()=>{var c;return(c=o.unref(i))==null?void 0:c.update()},forceUpdate:()=>{var c;return(c=o.unref(i))==null?void 0:c.forceUpdate()},instanceRef:o.computed(()=>o.unref(i))}};function $w(t){const e=Object.keys(t.elements),r=ao(e.map(a=>[a,t.styles[a]||{}])),n=ao(e.map(a=>[a,t.attributes[a]]));return{styles:r,attributes:n}}function wd(){let t;const e=(n,a)=>{r(),t=window.setTimeout(n,a)},r=()=>window.clearTimeout(t);return ji(()=>r()),{registerTimeout:e,cancelTimeout:r}}const ll={prefix:Math.floor(Math.random()*1e4),current:0},zw=Symbol("elIdInjection"),Cd=()=>o.getCurrentInstance()?o.inject(zw,ll):ll,yo=t=>{const e=Cd();!et&&e===ll&&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 Db={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 Pb=t=>(e,r)=>_b(e,r,o.unref(t)),_b=(t,e,r)=>Ir(r,t,t).replace(/\{(\w+)\}/g,(n,a)=>{var i;return`${(i=e==null?void 0:e[a])!=null?i:`{${a}}`}`}),Ob=t=>{const e=o.computed(()=>o.unref(t).name),r=o.isRef(t)?t:o.ref(t);return{lang:e,locale:r,t:Pb(t)}},Qu=Symbol("localeContextKey"),Ya=t=>{const e=t||o.inject(Qu,o.ref());return Ob(o.computed(()=>e.value||Db))},fo="el",Ib="is-",Tn=(t,e,r,n,a)=>{let i=`${t}-${e}`;return r&&(i+=`-${r}`),n&&(i+=`__${n}`),a&&(i+=`--${a}`),i},Ju=Symbol("namespaceContextKey"),Qs=t=>{const e=t||(o.getCurrentInstance()?o.inject(Ju,o.ref(fo)):o.ref(fo));return o.computed(()=>o.unref(e)||fo)},Be=(t,e)=>{const r=Qs(e);return{namespace:r,b:(g="")=>Tn(r.value,t,g,"",""),e:g=>g?Tn(r.value,t,"",g,""):"",m:g=>g?Tn(r.value,t,"","",g):"",be:(g,y)=>g&&y?Tn(r.value,t,g,y,""):"",em:(g,y)=>g&&y?Tn(r.value,t,"",g,y):"",bm:(g,y)=>g&&y?Tn(r.value,t,g,"",y):"",bem:(g,y,m)=>g&&y&&m?Tn(r.value,t,g,y,m):"",is:(g,...y)=>{const m=y.length>=1?y[0]:!0;return g&&m?`${Ib}${g}`:""},cssVar:g=>{const y={};for(const m in g)g[m]&&(y[`--${r.value}-${m}`]=g[m]);return y},cssVarName:g=>`--${r.value}-${g}`,cssVarBlock:g=>{const y={};for(const m in g)g[m]&&(y[`--${r.value}-${t}-${m}`]=g[m]);return y},cssVarBlockName:g=>`--${r.value}-${t}-${g}`}},Lb=co({type:ke(Boolean),default:null}),Mb=co({type:ke(Function)}),Fb=t=>{const e=`update:${t}`,r=`onUpdate:${t}`,n=[e],a={[t]:Lb,[r]:Mb};return{useModelToggle:({indicator:s,toggleReason:l,shouldHideWhenRouteChanges:c,shouldProceed:u,onShow:d,onHide:f})=>{const p=o.getCurrentInstance(),{emit:v}=p,h=p.props,g=o.computed(()=>Lt(h[r])),y=o.computed(()=>h[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(h.disabled===!0||Lt(u)&&!u())return;const B=g.value&&et;B&&v(e,!0),(y.value||!B)&&m(k)},C=k=>{if(h.disabled===!0||!et)return;const B=g.value&&et;B&&v(e,!1),(y.value||!B)&&b(k)},x=k=>{Qn(k)&&(h.disabled&&k?g.value&&v(e,!1):s.value!==k&&(k?m():b()))},E=()=>{s.value?C():w()};return o.watch(()=>h[t],x),c&&p.appContext.config.globalProperties.$route!==void 0&&o.watch(()=>({...p.proxy.$route}),()=>{c.value&&s.value&&C()}),o.onMounted(()=>{x(h[t])}),{hide:C,show:w,toggle:E,hasUpdateHandler:g}},useModelToggleProps:a,useModelToggleEmits:n}},ed=t=>{const e=o.getCurrentInstance();return o.computed(()=>{var r,n;return(n=(r=e==null?void 0:e.proxy)==null?void 0:r.$props)==null?void 0:n[t]})};var Vt="top",Yt="bottom",Zt="right",Rt="left",Js="auto",Za=[Vt,Yt,Zt,Rt],ta="start",Xa="end",Ab="clippingParents",td="viewport",Qa="popper",Vb="reference",rd=Za.reduce(function(t,e){return t.concat([e+"-"+ta,e+"-"+Xa])},[]),ho=[].concat(Za,[Js]).reduce(function(t,e){return t.concat([e,e+"-"+ta,e+"-"+Xa])},[]),Rb="beforeRead",$b="read",zb="afterRead",Hb="beforeMain",Kb="main",qb="afterMain",Ub="beforeWrite",Gb="write",Wb="afterWrite",jb=[Rb,$b,zb,Hb,Kb,qb,Ub,Gb,Wb];function br(t){return t?(t.nodeName||"").toLowerCase():null}function ar(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=ar(t).Element;return t instanceof e||t instanceof Element}function Xt(t){var e=ar(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function el(t){if(typeof ShadowRoot>"u")return!1;var e=ar(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Yb(t){var e=t.state;Object.keys(e.elements).forEach(function(r){var n=e.styles[r]||{},a=e.attributes[r]||{},i=e.elements[r];!Xt(i)||!br(i)||(Object.assign(i.style,n),Object.keys(a).forEach(function(s){var l=a[s];l===!1?i.removeAttribute(s):i.setAttribute(s,l===!0?"":l)}))})}function Zb(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(n){var a=e.elements[n],i=e.attributes[n]||{},s=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:r[n]),l=s.reduce(function(c,u){return c[u]="",c},{});!Xt(a)||!br(a)||(Object.assign(a.style,l),Object.keys(i).forEach(function(c){a.removeAttribute(c)}))})}}var nd={name:"applyStyles",enabled:!0,phase:"write",fn:Yb,effect:Zb,requires:["computeStyles"]};function wr(t){return t.split("-")[0]}var Bn=Math.max,po=Math.min,na=Math.round;function aa(t,e){e===void 0&&(e=!1);var r=t.getBoundingClientRect(),n=1,a=1;if(Xt(t)&&e){var i=t.offsetHeight,s=t.offsetWidth;s>0&&(n=na(r.width)/s||1),i>0&&(a=na(r.height)/i||1)}return{width:r.width/n,height:r.height/a,top:r.top/a,right:r.right/n,bottom:r.bottom/a,left:r.left/n,x:r.left/n,y:r.top/a}}function tl(t){var e=aa(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function ad(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&el(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Fr(t){return ar(t).getComputedStyle(t)}function Xb(t){return["table","td","th"].indexOf(br(t))>=0}function Xr(t){return((ra(t)?t.ownerDocument:t.document)||window.document).documentElement}function vo(t){return br(t)==="html"?t:t.assignedSlot||t.parentNode||(el(t)?t.host:null)||Xr(t)}function id(t){return!Xt(t)||Fr(t).position==="fixed"?null:t.offsetParent}function Qb(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,r=navigator.userAgent.indexOf("Trident")!==-1;if(r&&Xt(t)){var n=Fr(t);if(n.position==="fixed")return null}var a=vo(t);for(el(a)&&(a=a.host);Xt(a)&&["html","body"].indexOf(br(a))<0;){var i=Fr(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 Ja(t){for(var e=ar(t),r=id(t);r&&Xb(r)&&Fr(r).position==="static";)r=id(r);return r&&(br(r)==="html"||br(r)==="body"&&Fr(r).position==="static")?e:r||Qb(t)||e}function rl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ei(t,e,r){return Bn(t,po(e,r))}function Jb(t,e,r){var n=ei(t,e,r);return n>r?r:n}function od(){return{top:0,right:0,bottom:0,left:0}}function sd(t){return Object.assign({},od(),t)}function ld(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var ew=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,sd(typeof t!="number"?t:ld(t,Za))};function tw(t){var e,r=t.state,n=t.name,a=t.options,i=r.elements.arrow,s=r.modifiersData.popperOffsets,l=wr(r.placement),c=rl(l),u=[Rt,Zt].indexOf(l)>=0,d=u?"height":"width";if(!(!i||!s)){var f=ew(a.padding,r),p=tl(i),v=c==="y"?Vt:Rt,h=c==="y"?Yt:Zt,g=r.rects.reference[d]+r.rects.reference[c]-s[c]-r.rects.popper[d],y=s[c]-r.rects.reference[c],m=Ja(i),b=m?c==="y"?m.clientHeight||0:m.clientWidth||0:0,w=g/2-y/2,C=f[v],x=b-p[d]-f[h],E=b/2-p[d]/2+w,k=ei(C,E,x),B=c;r.modifiersData[n]=(e={},e[B]=k,e.centerOffset=k-E,e)}}function rw(t){var e=t.state,r=t.options,n=r.element,a=n===void 0?"[data-popper-arrow]":n;a!=null&&(typeof a=="string"&&(a=e.elements.popper.querySelector(a),!a)||!ad(e.elements.popper,a)||(e.elements.arrow=a))}var nw={name:"arrow",enabled:!0,phase:"main",fn:tw,effect:rw,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ia(t){return t.split("-")[1]}var aw={top:"auto",right:"auto",bottom:"auto",left:"auto"};function iw(t){var e=t.x,r=t.y,n=window,a=n.devicePixelRatio||1;return{x:na(e*a)/a||0,y:na(r*a)/a||0}}function cd(t){var e,r=t.popper,n=t.popperRect,a=t.placement,i=t.variation,s=t.offsets,l=t.position,c=t.gpuAcceleration,u=t.adaptive,d=t.roundOffsets,f=t.isFixed,p=s.x,v=p===void 0?0:p,h=s.y,g=h===void 0?0:h,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,x=window;if(u){var E=Ja(r),k="clientHeight",B="clientWidth";if(E===ar(r)&&(E=Xr(r),Fr(E).position!=="static"&&l==="absolute"&&(k="scrollHeight",B="scrollWidth")),E=E,a===Vt||(a===Rt||a===Zt)&&i===Xa){C=Yt;var S=f&&E===x&&x.visualViewport?x.visualViewport.height:E[k];g-=S-n.height,g*=c?1:-1}if(a===Rt||(a===Vt||a===Yt)&&i===Xa){w=Zt;var N=f&&E===x&&x.visualViewport?x.visualViewport.width:E[B];v-=N-n.width,v*=c?1:-1}}var D=Object.assign({position:l},u&&aw),P=d===!0?iw({x:v,y:g}):{x:v,y:g};if(v=P.x,g=P.y,c){var I;return Object.assign({},D,(I={},I[C]=b?"0":"",I[w]=m?"0":"",I.transform=(x.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 ow(t){var e=t.state,r=t.options,n=r.gpuAcceleration,a=n===void 0?!0:n,i=r.adaptive,s=i===void 0?!0:i,l=r.roundOffsets,c=l===void 0?!0:l,u={placement:wr(e.placement),variation:ia(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,cd(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,cd(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var ud={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ow,data:{}},go={passive:!0};function sw(t){var e=t.state,r=t.instance,n=t.options,a=n.scroll,i=a===void 0?!0:a,s=n.resize,l=s===void 0?!0:s,c=ar(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",r.update,go)}),l&&c.addEventListener("resize",r.update,go),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",r.update,go)}),l&&c.removeEventListener("resize",r.update,go)}}var dd={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:sw,data:{}},lw={left:"right",right:"left",bottom:"top",top:"bottom"};function mo(t){return t.replace(/left|right|bottom|top/g,function(e){return lw[e]})}var cw={start:"end",end:"start"};function fd(t){return t.replace(/start|end/g,function(e){return cw[e]})}function nl(t){var e=ar(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function al(t){return aa(Xr(t)).left+nl(t).scrollLeft}function uw(t){var e=ar(t),r=Xr(t),n=e.visualViewport,a=r.clientWidth,i=r.clientHeight,s=0,l=0;return n&&(a=n.width,i=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=n.offsetLeft,l=n.offsetTop)),{width:a,height:i,x:s+al(t),y:l}}function dw(t){var e,r=Xr(t),n=nl(t),a=(e=t.ownerDocument)==null?void 0:e.body,i=Bn(r.scrollWidth,r.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=Bn(r.scrollHeight,r.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),l=-n.scrollLeft+al(t),c=-n.scrollTop;return Fr(a||r).direction==="rtl"&&(l+=Bn(r.clientWidth,a?a.clientWidth:0)-i),{width:i,height:s,x:l,y:c}}function il(t){var e=Fr(t),r=e.overflow,n=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+a+n)}function hd(t){return["html","body","#document"].indexOf(br(t))>=0?t.ownerDocument.body:Xt(t)&&il(t)?t:hd(vo(t))}function ti(t,e){var r;e===void 0&&(e=[]);var n=hd(t),a=n===((r=t.ownerDocument)==null?void 0:r.body),i=ar(n),s=a?[i].concat(i.visualViewport||[],il(n)?n:[]):n,l=e.concat(s);return a?l:l.concat(ti(vo(s)))}function ol(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function fw(t){var e=aa(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 pd(t,e){return e===td?ol(uw(t)):ra(e)?fw(e):ol(dw(Xr(t)))}function hw(t){var e=ti(vo(t)),r=["absolute","fixed"].indexOf(Fr(t).position)>=0,n=r&&Xt(t)?Ja(t):t;return ra(n)?e.filter(function(a){return ra(a)&&ad(a,n)&&br(a)!=="body"}):[]}function pw(t,e,r){var n=e==="clippingParents"?hw(t):[].concat(e),a=[].concat(n,[r]),i=a[0],s=a.reduce(function(l,c){var u=pd(t,c);return l.top=Bn(u.top,l.top),l.right=po(u.right,l.right),l.bottom=po(u.bottom,l.bottom),l.left=Bn(u.left,l.left),l},pd(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 vd(t){var e=t.reference,r=t.element,n=t.placement,a=n?wr(n):null,i=n?ia(n):null,s=e.x+e.width/2-r.width/2,l=e.y+e.height/2-r.height/2,c;switch(a){case Vt:c={x:s,y:e.y-r.height};break;case Yt:c={x:s,y:e.y+e.height};break;case Zt:c={x:e.x+e.width,y:l};break;case Rt:c={x:e.x-r.width,y:l};break;default:c={x:e.x,y:e.y}}var u=a?rl(a):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case ta:c[u]=c[u]-(e[d]/2-r[d]/2);break;case Xa:c[u]=c[u]+(e[d]/2-r[d]/2);break}}return c}function ri(t,e){e===void 0&&(e={});var r=e,n=r.placement,a=n===void 0?t.placement:n,i=r.boundary,s=i===void 0?Ab:i,l=r.rootBoundary,c=l===void 0?td:l,u=r.elementContext,d=u===void 0?Qa:u,f=r.altBoundary,p=f===void 0?!1:f,v=r.padding,h=v===void 0?0:v,g=sd(typeof h!="number"?h:ld(h,Za)),y=d===Qa?Vb:Qa,m=t.rects.popper,b=t.elements[p?y:d],w=pw(ra(b)?b:b.contextElement||Xr(t.elements.popper),s,c),C=aa(t.elements.reference),x=vd({reference:C,element:m,strategy:"absolute",placement:a}),E=ol(Object.assign({},m,x)),k=d===Qa?E: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===Qa&&S){var N=S[a];Object.keys(B).forEach(function(D){var P=[Zt,Yt].indexOf(D)>=0?1:-1,I=[Vt,Yt].indexOf(D)>=0?"y":"x";B[D]+=N[I]*P})}return B}function vw(t,e){e===void 0&&(e={});var r=e,n=r.placement,a=r.boundary,i=r.rootBoundary,s=r.padding,l=r.flipVariations,c=r.allowedAutoPlacements,u=c===void 0?ho:c,d=ia(n),f=d?l?rd:rd.filter(function(h){return ia(h)===d}):Za,p=f.filter(function(h){return u.indexOf(h)>=0});p.length===0&&(p=f);var v=p.reduce(function(h,g){return h[g]=ri(t,{placement:g,boundary:a,rootBoundary:i,padding:s})[wr(g)],h},{});return Object.keys(v).sort(function(h,g){return v[h]-v[g]})}function gw(t){if(wr(t)===Js)return[];var e=mo(t);return[fd(t),e,fd(e)]}function mw(t){var e=t.state,r=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var a=r.mainAxis,i=a===void 0?!0:a,s=r.altAxis,l=s===void 0?!0:s,c=r.fallbackPlacements,u=r.padding,d=r.boundary,f=r.rootBoundary,p=r.altBoundary,v=r.flipVariations,h=v===void 0?!0:v,g=r.allowedAutoPlacements,y=e.options.placement,m=wr(y),b=m===y,w=c||(b||!h?[mo(y)]:gw(y)),C=[y].concat(w).reduce(function(ee,J){return ee.concat(wr(J)===Js?vw(e,{placement:J,boundary:d,rootBoundary:f,padding:u,flipVariations:h,allowedAutoPlacements:g}):J)},[]),x=e.rects.reference,E=e.rects.popper,k=new Map,B=!0,S=C[0],N=0;N<C.length;N++){var D=C[N],P=wr(D),I=ia(D)===ta,_=[Vt,Yt].indexOf(P)>=0,F=_?"width":"height",O=ri(e,{placement:D,boundary:d,rootBoundary:f,altBoundary:p,padding:u}),M=_?I?Zt:Rt:I?Yt:Vt;x[F]>E[F]&&(M=mo(M));var L=mo(M),V=[];if(i&&V.push(O[P]<=0),l&&V.push(O[M]<=0,O[L]<=0),V.every(function(ee){return ee})){S=D,B=!1;break}k.set(D,V)}if(B)for(var H=h?3:1,$=function(ee){var J=C.find(function(X){var re=k.get(X);if(re)return re.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[n]._skip=!0,e.placement=S,e.reset=!0)}}var yw={name:"flip",enabled:!0,phase:"main",fn:mw,requiresIfExists:["offset"],data:{_skip:!1}};function gd(t,e,r){return r===void 0&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function md(t){return[Vt,Zt,Yt,Rt].some(function(e){return t[e]>=0})}function bw(t){var e=t.state,r=t.name,n=e.rects.reference,a=e.rects.popper,i=e.modifiersData.preventOverflow,s=ri(e,{elementContext:"reference"}),l=ri(e,{altBoundary:!0}),c=gd(s,n),u=gd(l,a,i),d=md(c),f=md(u);e.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}var ww={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:bw};function Cw(t,e,r){var n=wr(t),a=[Rt,Vt].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,s=i[0],l=i[1];return s=s||0,l=(l||0)*a,[Rt,Zt].indexOf(n)>=0?{x:l,y:s}:{x:s,y:l}}function kw(t){var e=t.state,r=t.options,n=t.name,a=r.offset,i=a===void 0?[0,0]:a,s=ho.reduce(function(d,f){return d[f]=Cw(f,e.rects,i),d},{}),l=s[e.placement],c=l.x,u=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[n]=s}var xw={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:kw};function Ew(t){var e=t.state,r=t.name;e.modifiersData[r]=vd({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var yd={name:"popperOffsets",enabled:!0,phase:"read",fn:Ew,data:{}};function Sw(t){return t==="x"?"y":"x"}function Tw(t){var e=t.state,r=t.options,n=t.name,a=r.mainAxis,i=a===void 0?!0:a,s=r.altAxis,l=s===void 0?!1:s,c=r.boundary,u=r.rootBoundary,d=r.altBoundary,f=r.padding,p=r.tether,v=p===void 0?!0:p,h=r.tetherOffset,g=h===void 0?0:h,y=ri(e,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),m=wr(e.placement),b=ia(e.placement),w=!b,C=rl(m),x=Sw(C),E=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,P={x:0,y:0};if(E){if(i){var I,_=C==="y"?Vt:Rt,F=C==="y"?Yt:Zt,O=C==="y"?"height":"width",M=E[C],L=M+y[_],V=M-y[F],H=v?-B[O]/2:0,$=b===ta?k[O]:B[O],z=b===ta?-B[O]:-k[O],j=e.elements.arrow,ee=v&&j?tl(j):{width:0,height:0},J=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:od(),X=J[_],re=J[F],Y=ei(0,k[O],ee[O]),A=w?k[O]/2-H-Y-X-N.mainAxis:$-Y-X-N.mainAxis,K=w?-k[O]/2+H+Y+re+N.mainAxis:z+Y+re+N.mainAxis,W=e.elements.arrow&&Ja(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,ne=M+A-he-oe,se=M+K-he,ue=ei(v?po(L,ne):L,M,v?Bn(V,se):V);E[C]=ue,P[C]=ue-M}if(l){var pe,de=C==="x"?Vt:Rt,me=C==="x"?Yt:Zt,Ne=E[x],De=x==="y"?"height":"width",Ee=Ne+y[de],Pe=Ne-y[me],te=[Vt,Rt].indexOf(m)!==-1,T=(pe=D==null?void 0:D[x])!=null?pe:0,R=te?Ee:Ne-k[De]-B[De]-T+N.altAxis,Q=te?Ne+k[De]+B[De]-T-N.altAxis:Pe,G=v&&te?Jb(R,Ne,Q):ei(v?R:Ee,Ne,v?Q:Pe);E[x]=G,P[x]=G-Ne}e.modifiersData[n]=P}}var Bw={name:"preventOverflow",enabled:!0,phase:"main",fn:Tw,requiresIfExists:["offset"]};function Nw(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Dw(t){return t===ar(t)||!Xt(t)?nl(t):Nw(t)}function Pw(t){var e=t.getBoundingClientRect(),r=na(e.width)/t.offsetWidth||1,n=na(e.height)/t.offsetHeight||1;return r!==1||n!==1}function _w(t,e,r){r===void 0&&(r=!1);var n=Xt(e),a=Xt(e)&&Pw(e),i=Xr(e),s=aa(t,a),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((br(e)!=="body"||il(i))&&(l=Dw(e)),Xt(e)?(c=aa(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=al(i))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function Ow(t){var e=new Map,r=new Set,n=[];t.forEach(function(i){e.set(i.name,i)});function a(i){r.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(l){if(!r.has(l)){var c=e.get(l);c&&a(c)}}),n.push(i)}return t.forEach(function(i){r.has(i.name)||a(i)}),n}function Iw(t){var e=Ow(t);return jb.reduce(function(r,n){return r.concat(e.filter(function(a){return a.phase===n}))},[])}function Lw(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function Mw(t){var e=t.reduce(function(r,n){var a=r[n.name];return r[n.name]=a?Object.assign({},a,n,{options:Object.assign({},a.options,n.options),data:Object.assign({},a.data,n.data)}):n,r},{});return Object.keys(e).map(function(r){return e[r]})}var bd={placement:"bottom",modifiers:[],strategy:"absolute"};function wd(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function sl(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,a=e.defaultOptions,i=a===void 0?bd:a;return function(s,l,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},bd,i),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],f=!1,p={state:u,setOptions:function(g){var y=typeof g=="function"?g(u.options):g;h(),u.options=Object.assign({},i,u.options,y),u.scrollParents={reference:ra(s)?ti(s):s.contextElement?ti(s.contextElement):[],popper:ti(l)};var m=Iw(Mw([].concat(n,u.options.modifiers)));return u.orderedModifiers=m.filter(function(b){return b.enabled}),v(),p.update()},forceUpdate:function(){if(!f){var g=u.elements,y=g.reference,m=g.popper;if(wd(y,m)){u.rects={reference:_w(y,Ja(m),u.options.strategy==="fixed"),popper:tl(m)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(B){return u.modifiersData[B.name]=Object.assign({},B.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var w=u.orderedModifiers[b],C=w.fn,x=w.options,E=x===void 0?{}:x,k=w.name;typeof C=="function"&&(u=C({state:u,options:E,name:k,instance:p})||u)}}}},update:Lw(function(){return new Promise(function(g){p.forceUpdate(),g(u)})}),destroy:function(){h(),f=!0}};if(!wd(s,l))return p;p.setOptions(c).then(function(g){!f&&c.onFirstUpdate&&c.onFirstUpdate(g)});function v(){u.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:u,name:y,instance:p,options:b}),x=function(){};d.push(C||x)}})}function h(){d.forEach(function(g){return g()}),d=[]}return p}}sl();var Fw=[dd,yd,ud,nd];sl({defaultModifiers:Fw});var Aw=[dd,yd,ud,nd,xw,yw,Bw,nw,ww],Vw=sl({defaultModifiers:Aw});const Rw=(t,e,r={})=>{const n={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=$w(c);Object.assign(s.value,u)},requires:["computeStyles"]},a=o.computed(()=>{const{onFirstUpdate:c,placement:u,strategy:d,modifiers:f}=o.unref(r);return{onFirstUpdate:c,placement:u||"bottom",strategy:d||"absolute",modifiers:[...f||[],n,{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,c=>{const u=o.unref(i);u&&u.setOptions(c)},{deep:!0}),o.watch([t,e],([c,u])=>{l(),!(!c||!u)&&(i.value=Vw(c,u,o.unref(a)))}),o.onBeforeUnmount(()=>{l()}),{state:o.computed(()=>{var c;return{...((c=o.unref(i))==null?void 0:c.state)||{}}}),styles:o.computed(()=>o.unref(s).styles),attributes:o.computed(()=>o.unref(s).attributes),update:()=>{var c;return(c=o.unref(i))==null?void 0:c.update()},forceUpdate:()=>{var c;return(c=o.unref(i))==null?void 0:c.forceUpdate()},instanceRef:o.computed(()=>o.unref(i))}};function $w(t){const e=Object.keys(t.elements),r=ao(e.map(a=>[a,t.styles[a]||{}])),n=ao(e.map(a=>[a,t.attributes[a]]));return{styles:r,attributes:n}}function Cd(){let t;const e=(n,a)=>{r(),t=window.setTimeout(n,a)},r=()=>window.clearTimeout(t);return ji(()=>r()),{registerTimeout:e,cancelTimeout:r}}const ll={prefix:Math.floor(Math.random()*1e4),current:0},zw=Symbol("elIdInjection"),kd=()=>o.getCurrentInstance()?o.inject(zw,ll):ll,yo=t=>{const e=kd();!et&&e===ll&&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 r=Qs();return o.computed(()=>o.unref(t)||`${r.value}-id-${e.prefix}-${e.current++}`)};let oa=[];const kd=t=>{const e=t;e.key===it.esc&&oa.forEach(r=>r(e))},Hw=t=>{o.onMounted(()=>{oa.length===0&&document.addEventListener("keydown",kd),et&&oa.push(t)}),o.onBeforeUnmount(()=>{oa=oa.filter(e=>e!==t),oa.length===0&&et&&document.removeEventListener("keydown",kd)})};let xd;const Ed=()=>{const t=Qs(),e=Cd(),r=o.computed(()=>`${t.value}-popper-container-${e.prefix}`),n=o.computed(()=>`#${r.value}`);return{id:r,selector:n}},Kw=t=>{const e=document.createElement("div");return e.id=t,document.body.appendChild(e),e},qw=()=>{const{id:t,selector:e}=Ed();return o.onBeforeMount(()=>{et&&(process.env.NODE_ENV==="test"||!xd||!document.body.querySelector(e.value))&&(xd=Kw(t.value))}),{id:t,selector:e}},Uw=Fe({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),Gw=({showAfter:t,hideAfter:e,autoClose:r,open:n,close:a})=>{const{registerTimeout:i}=wd(),{registerTimeout:s,cancelTimeout:l}=wd();return{onOpen:d=>{i(()=>{n(d);const f=o.unref(r);gt(f)&&f>0&&s(()=>{a(d)},f)},o.unref(t))},onClose:d=>{l(),i(()=>{a(d)},o.unref(e))}}},Sd=Symbol("elForwardRef"),Ww=t=>{const e=r=>{t.value=r};o.provide(Sd,{setForwardRef:e})},jw=t=>({mounted(e){t(e)},updated(e){t(e)},unmounted(){t(null)}}),Td={current:0},Bd=o.ref(0),Nd=2e3,Dd=Symbol("elZIndexContextKey"),Pd=Symbol("zIndexContextKey"),_d=t=>{const e=o.getCurrentInstance()?o.inject(Dd,Td):Td,r=t||(o.getCurrentInstance()?o.inject(Pd,void 0):void 0),n=o.computed(()=>{const s=o.unref(r);return gt(s)?s:Nd}),a=o.computed(()=>n.value+Bd.value),i=()=>(e.current++,Bd.value=e.current,a.value);return!et&&!o.inject(Dd)&&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:n,currentZIndex:a,nextZIndex:i}};function Yw(t){let e;function r(){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)),c=s.slice(Math.max(0,i));e={selectionStart:a,selectionEnd:i,value:s,beforeTxt:l,afterTxt:c}}function n(){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 c=a.length;if(a.endsWith(s))c=a.length-s.length;else if(a.startsWith(i))c=i.length;else{const u=i[l-1],d=a.indexOf(u,l-1);d!==-1&&(c=d+1)}t.value.setSelectionRange(c,c)}return[r,n]}const sa=co({type:String,values:Zu,required:!1}),Od=Symbol("size"),Zw=()=>{const t=o.inject(Od,{});return o.computed(()=>o.unref(t.size)||"")};function cl(t,{beforeFocus:e,afterFocus:r,beforeBlur:n,afterBlur:a}={}){const i=o.getCurrentInstance(),{emit:s}=i,l=o.shallowRef(),c=o.ref(!1),u=p=>{Lt(e)&&e(p)||c.value||(c.value=!0,s("focus",p),r==null||r())},d=p=>{var v;Lt(n)&&n(p)||p.relatedTarget&&((v=l.value)!=null&&v.contains(p.relatedTarget))||(c.value=!1,s("blur",p),a==null||a())},f=()=>{var p,v;(p=l.value)!=null&&p.contains(document.activeElement)&&l.value!==document.activeElement||(v=t.value)==null||v.focus()};return o.watch(l,p=>{p&&p.setAttribute("tabindex","-1")}),jt(l,"focus",u,!0),jt(l,"blur",d,!0),jt(l,"click",f,!0),process.env.NODE_ENV==="test"&&o.onMounted(()=>{const p=En(t.value)?t.value:document.querySelector("input,textarea");p&&(jt(p,"focus",u,!0),jt(p,"blur",d,!0))}),{isFocused:c,wrapperRef:l,handleFocus:u,handleBlur:d}}function Id({afterComposition:t,emit:e}){const r=o.ref(!1),n=l=>{e==null||e("compositionstart",l),r.value=!0},a=l=>{var c;e==null||e("compositionupdate",l);const u=(c=l.target)==null?void 0:c.value,d=u[u.length-1]||"";r.value=!Sb(d)},i=l=>{e==null||e("compositionend",l),r.value&&(r.value=!1,o.nextTick(()=>t(l)))};return{isComposing:r,handleComposition:l=>{l.type==="compositionend"?i(l):a(l)},handleCompositionStart:n,handleCompositionUpdate:a,handleCompositionEnd:i}}const Ld=Symbol("emptyValuesContextKey"),Xw="use-empty-values",Qw=["",void 0,null],Jw=void 0,e2=Fe({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:t=>Lt(t)?!t():!t}}),t2=(t,e)=>{const r=o.getCurrentInstance()?o.inject(Ld,o.ref({})):o.ref({}),n=o.computed(()=>t.emptyValues||r.value.emptyValues||Qw),a=o.computed(()=>Lt(t.valueOnClear)?t.valueOnClear():t.valueOnClear!==void 0?t.valueOnClear:Lt(r.value.valueOnClear)?r.value.valueOnClear():r.value.valueOnClear!==void 0?r.value.valueOnClear:Jw),i=s=>n.value.includes(s);return n.value.includes(a.value)||tt(Xw,"value-on-clear should be a value of empty-values"),{emptyValues:n,valueOnClear:a,isEmptyValue:i}},r2=Fe({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Qr=t=>Ku(r2,t),Md=Symbol(),bo=o.ref();function ul(t,e=void 0){const r=o.getCurrentInstance()?o.inject(Md,bo):bo;return t?o.computed(()=>{var n,a;return(a=(n=r.value)==null?void 0:n[t])!=null?a:e}):r}function n2(t,e){const r=ul(),n=Be(t,o.computed(()=>{var l;return((l=r.value)==null?void 0:l.namespace)||fo})),a=Ya(o.computed(()=>{var l;return(l=r.value)==null?void 0:l.locale})),i=_d(o.computed(()=>{var l;return((l=r.value)==null?void 0:l.zIndex)||Nd})),s=o.computed(()=>{var l;return o.unref(e)||((l=r.value)==null?void 0:l.size)||""});return a2(o.computed(()=>o.unref(r)||{})),{ns:n,locale:a,zIndex:i,size:s}}const a2=(t,e,r=!1)=>{var n;const a=!!o.getCurrentInstance(),i=a?ul():void 0,s=(n=void 0)!=null?n:a?o.provide:void 0;if(!s){tt("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const l=o.computed(()=>{const c=o.unref(t);return i!=null&&i.value?i2(i.value,c):c});return s(Md,l),s(Xu,o.computed(()=>l.value.locale)),s(Qu,o.computed(()=>l.value.namespace)),s(Pd,o.computed(()=>l.value.zIndex)),s(Od,{size:o.computed(()=>l.value.size||"")}),s(Ld,o.computed(()=>({emptyValues:l.value.emptyValues,valueOnClear:l.value.valueOnClear}))),(r||!bo.value)&&(bo.value=l.value),l},i2=(t,e)=>{const r=[...new Set([...qu(t),...qu(e)])],n={};for(const a of r)n[a]=e[a]!==void 0?e[a]:t[a];return n};var Te=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r};const o2=Fe({size:{type:ke([Number,String])},color:{type:String}}),s2=o.defineComponent({name:"ElIcon",inheritAttrs:!1}),l2=o.defineComponent({...s2,props:o2,setup(t){const e=t,r=Be("icon"),n=o.computed(()=>{const{size:a,color:i}=e;return!a&&!i?{}:{fontSize:Yr(a)?void 0:Jn(a),"--color":i}});return(a,i)=>(o.openBlock(),o.createElementBlock("i",o.mergeProps({class:o.unref(r).b(),style:o.unref(n)},a.$attrs),[o.renderSlot(a.$slots,"default")],16))}});var c2=Te(l2,[["__file","icon.vue"]]);const yt=dt(c2),dl=Symbol("formContextKey"),ni=Symbol("formItemContextKey"),Nn=(t,e={})=>{const r=o.ref(void 0),n=e.prop?r:Ju("size"),a=e.global?r:Zw(),i=e.form?{size:void 0}:o.inject(dl,void 0),s=e.formItem?{size:void 0}:o.inject(ni,void 0);return o.computed(()=>n.value||o.unref(t)||(s==null?void 0:s.size)||(i==null?void 0:i.size)||a.value||"")},ai=t=>{const e=Ju("disabled"),r=o.inject(dl,void 0);return o.computed(()=>e.value||o.unref(t)||(r==null?void 0:r.disabled)||!1)},Dn=()=>{const t=o.inject(dl,void 0),e=o.inject(ni,void 0);return{form:t,formItem:e}},ii=(t,{formItemContext:e,disableIdGeneration:r,disableIdManagement:n})=>{r||(r=o.ref(!1)),n||(n=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"),r],([l,c])=>{const u=l??(c?void 0:yo().value);u!==a.value&&(e!=null&&e.removeInputId&&(a.value&&e.removeInputId(a.value),!(n!=null&&n.value)&&!c&&u&&e.addInputId(u)),a.value=u)},{immediate:!0})}),o.onUnmounted(()=>{i&&i(),e!=null&&e.removeInputId&&a.value&&e.removeInputId(a.value)}),{isLabeledByFormItem:s,inputId:a}};let ir;const u2=`
11
+ })`);const r=Qs();return o.computed(()=>o.unref(t)||`${r.value}-id-${e.prefix}-${e.current++}`)};let oa=[];const xd=t=>{const e=t;e.key===it.esc&&oa.forEach(r=>r(e))},Hw=t=>{o.onMounted(()=>{oa.length===0&&document.addEventListener("keydown",xd),et&&oa.push(t)}),o.onBeforeUnmount(()=>{oa=oa.filter(e=>e!==t),oa.length===0&&et&&document.removeEventListener("keydown",xd)})};let Ed;const Sd=()=>{const t=Qs(),e=kd(),r=o.computed(()=>`${t.value}-popper-container-${e.prefix}`),n=o.computed(()=>`#${r.value}`);return{id:r,selector:n}},Kw=t=>{const e=document.createElement("div");return e.id=t,document.body.appendChild(e),e},qw=()=>{const{id:t,selector:e}=Sd();return o.onBeforeMount(()=>{et&&(process.env.NODE_ENV==="test"||!Ed||!document.body.querySelector(e.value))&&(Ed=Kw(t.value))}),{id:t,selector:e}},Uw=Fe({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),Gw=({showAfter:t,hideAfter:e,autoClose:r,open:n,close:a})=>{const{registerTimeout:i}=Cd(),{registerTimeout:s,cancelTimeout:l}=Cd();return{onOpen:d=>{i(()=>{n(d);const f=o.unref(r);gt(f)&&f>0&&s(()=>{a(d)},f)},o.unref(t))},onClose:d=>{l(),i(()=>{a(d)},o.unref(e))}}},Td=Symbol("elForwardRef"),Ww=t=>{const e=r=>{t.value=r};o.provide(Td,{setForwardRef:e})},jw=t=>({mounted(e){t(e)},updated(e){t(e)},unmounted(){t(null)}}),Bd={current:0},Nd=o.ref(0),Dd=2e3,Pd=Symbol("elZIndexContextKey"),_d=Symbol("zIndexContextKey"),Od=t=>{const e=o.getCurrentInstance()?o.inject(Pd,Bd):Bd,r=t||(o.getCurrentInstance()?o.inject(_d,void 0):void 0),n=o.computed(()=>{const s=o.unref(r);return gt(s)?s:Dd}),a=o.computed(()=>n.value+Nd.value),i=()=>(e.current++,Nd.value=e.current,a.value);return!et&&!o.inject(Pd)&&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:n,currentZIndex:a,nextZIndex:i}};function Yw(t){let e;function r(){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)),c=s.slice(Math.max(0,i));e={selectionStart:a,selectionEnd:i,value:s,beforeTxt:l,afterTxt:c}}function n(){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 c=a.length;if(a.endsWith(s))c=a.length-s.length;else if(a.startsWith(i))c=i.length;else{const u=i[l-1],d=a.indexOf(u,l-1);d!==-1&&(c=d+1)}t.value.setSelectionRange(c,c)}return[r,n]}const sa=co({type:String,values:Xu,required:!1}),Id=Symbol("size"),Zw=()=>{const t=o.inject(Id,{});return o.computed(()=>o.unref(t.size)||"")};function cl(t,{beforeFocus:e,afterFocus:r,beforeBlur:n,afterBlur:a}={}){const i=o.getCurrentInstance(),{emit:s}=i,l=o.shallowRef(),c=o.ref(!1),u=p=>{Lt(e)&&e(p)||c.value||(c.value=!0,s("focus",p),r==null||r())},d=p=>{var v;Lt(n)&&n(p)||p.relatedTarget&&((v=l.value)!=null&&v.contains(p.relatedTarget))||(c.value=!1,s("blur",p),a==null||a())},f=()=>{var p,v;(p=l.value)!=null&&p.contains(document.activeElement)&&l.value!==document.activeElement||(v=t.value)==null||v.focus()};return o.watch(l,p=>{p&&p.setAttribute("tabindex","-1")}),jt(l,"focus",u,!0),jt(l,"blur",d,!0),jt(l,"click",f,!0),process.env.NODE_ENV==="test"&&o.onMounted(()=>{const p=En(t.value)?t.value:document.querySelector("input,textarea");p&&(jt(p,"focus",u,!0),jt(p,"blur",d,!0))}),{isFocused:c,wrapperRef:l,handleFocus:u,handleBlur:d}}function Ld({afterComposition:t,emit:e}){const r=o.ref(!1),n=l=>{e==null||e("compositionstart",l),r.value=!0},a=l=>{var c;e==null||e("compositionupdate",l);const u=(c=l.target)==null?void 0:c.value,d=u[u.length-1]||"";r.value=!Sb(d)},i=l=>{e==null||e("compositionend",l),r.value&&(r.value=!1,o.nextTick(()=>t(l)))};return{isComposing:r,handleComposition:l=>{l.type==="compositionend"?i(l):a(l)},handleCompositionStart:n,handleCompositionUpdate:a,handleCompositionEnd:i}}const Md=Symbol("emptyValuesContextKey"),Xw="use-empty-values",Qw=["",void 0,null],Jw=void 0,e2=Fe({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:t=>Lt(t)?!t():!t}}),t2=(t,e)=>{const r=o.getCurrentInstance()?o.inject(Md,o.ref({})):o.ref({}),n=o.computed(()=>t.emptyValues||r.value.emptyValues||Qw),a=o.computed(()=>Lt(t.valueOnClear)?t.valueOnClear():t.valueOnClear!==void 0?t.valueOnClear:Lt(r.value.valueOnClear)?r.value.valueOnClear():r.value.valueOnClear!==void 0?r.value.valueOnClear:Jw),i=s=>n.value.includes(s);return n.value.includes(a.value)||tt(Xw,"value-on-clear should be a value of empty-values"),{emptyValues:n,valueOnClear:a,isEmptyValue:i}},r2=Fe({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Qr=t=>qu(r2,t),Fd=Symbol(),bo=o.ref();function ul(t,e=void 0){const r=o.getCurrentInstance()?o.inject(Fd,bo):bo;return t?o.computed(()=>{var n,a;return(a=(n=r.value)==null?void 0:n[t])!=null?a:e}):r}function n2(t,e){const r=ul(),n=Be(t,o.computed(()=>{var l;return((l=r.value)==null?void 0:l.namespace)||fo})),a=Ya(o.computed(()=>{var l;return(l=r.value)==null?void 0:l.locale})),i=Od(o.computed(()=>{var l;return((l=r.value)==null?void 0:l.zIndex)||Dd})),s=o.computed(()=>{var l;return o.unref(e)||((l=r.value)==null?void 0:l.size)||""});return a2(o.computed(()=>o.unref(r)||{})),{ns:n,locale:a,zIndex:i,size:s}}const a2=(t,e,r=!1)=>{var n;const a=!!o.getCurrentInstance(),i=a?ul():void 0,s=(n=void 0)!=null?n:a?o.provide:void 0;if(!s){tt("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const l=o.computed(()=>{const c=o.unref(t);return i!=null&&i.value?i2(i.value,c):c});return s(Fd,l),s(Qu,o.computed(()=>l.value.locale)),s(Ju,o.computed(()=>l.value.namespace)),s(_d,o.computed(()=>l.value.zIndex)),s(Id,{size:o.computed(()=>l.value.size||"")}),s(Md,o.computed(()=>({emptyValues:l.value.emptyValues,valueOnClear:l.value.valueOnClear}))),(r||!bo.value)&&(bo.value=l.value),l},i2=(t,e)=>{const r=[...new Set([...Uu(t),...Uu(e)])],n={};for(const a of r)n[a]=e[a]!==void 0?e[a]:t[a];return n};var Te=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r};const o2=Fe({size:{type:ke([Number,String])},color:{type:String}}),s2=o.defineComponent({name:"ElIcon",inheritAttrs:!1}),l2=o.defineComponent({...s2,props:o2,setup(t){const e=t,r=Be("icon"),n=o.computed(()=>{const{size:a,color:i}=e;return!a&&!i?{}:{fontSize:Yr(a)?void 0:Jn(a),"--color":i}});return(a,i)=>(o.openBlock(),o.createElementBlock("i",o.mergeProps({class:o.unref(r).b(),style:o.unref(n)},a.$attrs),[o.renderSlot(a.$slots,"default")],16))}});var c2=Te(l2,[["__file","icon.vue"]]);const yt=dt(c2),dl=Symbol("formContextKey"),ni=Symbol("formItemContextKey"),Nn=(t,e={})=>{const r=o.ref(void 0),n=e.prop?r:ed("size"),a=e.global?r:Zw(),i=e.form?{size:void 0}:o.inject(dl,void 0),s=e.formItem?{size:void 0}:o.inject(ni,void 0);return o.computed(()=>n.value||o.unref(t)||(s==null?void 0:s.size)||(i==null?void 0:i.size)||a.value||"")},ai=t=>{const e=ed("disabled"),r=o.inject(dl,void 0);return o.computed(()=>e.value||o.unref(t)||(r==null?void 0:r.disabled)||!1)},Dn=()=>{const t=o.inject(dl,void 0),e=o.inject(ni,void 0);return{form:t,formItem:e}},ii=(t,{formItemContext:e,disableIdGeneration:r,disableIdManagement:n})=>{r||(r=o.ref(!1)),n||(n=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"),r],([l,c])=>{const u=l??(c?void 0:yo().value);u!==a.value&&(e!=null&&e.removeInputId&&(a.value&&e.removeInputId(a.value),!(n!=null&&n.value)&&!c&&u&&e.addInputId(u)),a.value=u)},{immediate:!0})}),o.onUnmounted(()=>{i&&i(),e!=null&&e.removeInputId&&a.value&&e.removeInputId(a.value)}),{isLabeledByFormItem:s,inputId:a}};let ir;const u2=`
13
13
  height:0 !important;
14
14
  visibility:hidden !important;
15
15
  ${zg()?"":"overflow:hidden !important;"}
@@ -17,34 +17,34 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:n,curr
17
17
  z-index:-1000 !important;
18
18
  top:0 !important;
19
19
  right:0 !important;
20
- `,d2=["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 f2(t){const e=window.getComputedStyle(t),r=e.getPropertyValue("box-sizing"),n=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:d2.map(s=>`${s}:${e.getPropertyValue(s)}`).join(";"),paddingSize:n,borderSize:a,boxSizing:r}}function Fd(t,e=1,r){var n;ir||(ir=document.createElement("textarea"),document.body.appendChild(ir));const{paddingSize:a,borderSize:i,boxSizing:s,contextStyle:l}=f2(t);ir.setAttribute("style",`${l};${u2}`),ir.value=t.value||t.placeholder||"";let c=ir.scrollHeight;const u={};s==="border-box"?c=c+i:s==="content-box"&&(c=c-a),ir.value="";const d=ir.scrollHeight-a;if(gt(e)){let f=d*e;s==="border-box"&&(f=f+a+i),c=Math.max(f,c),u.minHeight=`${f}px`}if(gt(r)){let f=d*r;s==="border-box"&&(f=f+a+i),c=Math.min(f,c)}return u.height=`${c}px`,(n=ir.parentNode)==null||n.removeChild(ir),ir=void 0,u}const h2=Fe({id:{type:String,default:void 0},size:sa,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:Zr},prefixIcon:{type:Zr},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:ke([Object,Array,String]),default:()=>ea({})},autofocus:Boolean,rows:{type:Number,default:2},...Qr(["ariaLabel"])}),p2={[mt]: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},v2=o.defineComponent({name:"ElInput",inheritAttrs:!1}),g2=o.defineComponent({...v2,props:h2,emits:p2,setup(t,{expose:e,emit:r}){const n=t,a=o.useAttrs(),i=o.useSlots(),s=o.computed(()=>{const T={};return n.containerRole==="combobox"&&(T["aria-haspopup"]=a["aria-haspopup"],T["aria-owns"]=a["aria-owns"],T["aria-expanded"]=a["aria-expanded"]),T}),l=o.computed(()=>[n.type==="textarea"?y.b():g.b(),g.m(v.value),g.is("disabled",h.value),g.is("exceed",j.value),{[g.b("group")]:i.prepend||i.append,[g.m("prefix")]:i.prefix||n.prefixIcon,[g.m("suffix")]:i.suffix||n.suffixIcon||n.clearable||n.showPassword,[g.bm("suffix","password-clear")]:V.value&&H.value,[g.b("hidden")]:n.type==="hidden"},a.class]),c=o.computed(()=>[g.e("wrapper"),g.is("focus",S.value)]),u=Nb({excludeKeys:o.computed(()=>Object.keys(s.value))}),{form:d,formItem:f}=Dn(),{inputId:p}=ii(n,{formItemContext:f}),v=Nn(),h=ai(),g=Be("input"),y=Be("textarea"),m=o.shallowRef(),b=o.shallowRef(),w=o.ref(!1),C=o.ref(!1),x=o.ref(),E=o.shallowRef(n.inputStyle),k=o.computed(()=>m.value||b.value),{wrapperRef:B,isFocused:S,handleFocus:N,handleBlur:D}=cl(k,{beforeFocus(){return h.value},afterBlur(){var T;n.validateEvent&&((T=f==null?void 0:f.validate)==null||T.call(f,"blur").catch(R=>tt(R)))}}),P=o.computed(()=>{var T;return(T=d==null?void 0:d.statusIcon)!=null?T:!1}),I=o.computed(()=>(f==null?void 0:f.validateState)||""),_=o.computed(()=>I.value&&Yu[I.value]),F=o.computed(()=>C.value?gb:cb),O=o.computed(()=>[a.style]),M=o.computed(()=>[n.inputStyle,E.value,{resize:n.resize}]),L=o.computed(()=>jr(n.modelValue)?"":String(n.modelValue)),V=o.computed(()=>n.clearable&&!h.value&&!n.readonly&&!!L.value&&(S.value||w.value)),H=o.computed(()=>n.showPassword&&!h.value&&!n.readonly&&!!L.value&&(!!L.value||S.value)),$=o.computed(()=>n.showWordLimit&&!!n.maxlength&&(n.type==="text"||n.type==="textarea")&&!h.value&&!n.readonly&&!n.showPassword),z=o.computed(()=>L.value.length),j=o.computed(()=>!!$.value&&z.value>Number(n.maxlength)),ee=o.computed(()=>!!i.suffix||!!n.suffixIcon||V.value||n.showPassword||$.value||!!I.value&&P.value),[J,X]=Yw(m);Pr(b,T=>{if(A(),!$.value||n.resize!=="both")return;const R=T[0],{width:Q}=R.contentRect;x.value={right:`calc(100% - ${Q+15+6}px)`}});const re=()=>{const{type:T,autosize:R}=n;if(!(!et||T!=="textarea"||!b.value))if(R){const Q=vt(R)?R.minRows:void 0,G=vt(R)?R.maxRows:void 0,U=Fd(b.value,Q,G);E.value={overflowY:"hidden",...U},o.nextTick(()=>{b.value.offsetHeight,E.value=U})}else E.value={minHeight:Fd(b.value).minHeight}},A=(T=>{let R=!1;return()=>{var Q;if(R||!n.autosize)return;((Q=b.value)==null?void 0:Q.offsetParent)===null||(T(),R=!0)}})(re),K=()=>{const T=k.value,R=n.formatter?n.formatter(L.value):L.value;!T||T.value===R||(T.value=R)},W=async T=>{J();let{value:R}=T.target;if(n.formatter&&(R=n.parser?n.parser(R):R),!he.value){if(R===L.value){K();return}r(mt,R),r("input",R),await o.nextTick(),K(),X()}},oe=T=>{r("change",T.target.value)},{isComposing:he,handleCompositionStart:ne,handleCompositionUpdate:se,handleCompositionEnd:ue}=Id({emit:r,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,r("mouseleave",T)},De=T=>{w.value=!0,r("mouseenter",T)},Ee=T=>{r("keydown",T)},Pe=()=>{var T;(T=k.value)==null||T.select()},te=()=>{r(mt,""),r("change",""),r("clear"),r("input","")};return o.watch(()=>n.modelValue,()=>{var T;o.nextTick(()=>re()),n.validateEvent&&((T=f==null?void 0:f.validate)==null||T.call(f,"change").catch(R=>tt(R)))}),o.watch(L,()=>K()),o.watch(()=>n.type,async()=>{await o.nextTick(),K(),re()}),o.onMounted(()=>{!n.formatter&&n.parser&&tt("ElInput","If you set the parser, you also need to set the formatter."),K(),o.nextTick(re)}),e({input:m,textarea:b,ref:k,textareaStyle:M,autosize:o.toRef(n,"autosize"),isComposing:he,focus:de,blur:me,select:Pe,clear:te,resizeTextarea:re}),(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(c))},[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(yt),{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(p),ref_key:"input",ref:m,class:o.unref(g).e("inner")},o.unref(u),{minlength:T.minlength,maxlength:T.maxlength,type:T.showPassword?C.value?"text":"password":T.type,disabled:o.unref(h),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(ne),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(yt),{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(yt),{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(Ys))]),_:1},8,["class","onMousedown"])):o.createCommentVNode("v-if",!0),o.unref(H)?(o.openBlock(),o.createBlock(o.unref(yt),{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(_)&&o.unref(P)?(o.openBlock(),o.createBlock(o.unref(yt),{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(_))))]),_: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(p),ref_key:"textarea",ref:b,class:[o.unref(y).e("inner"),o.unref(g).is("focus",o.unref(S))]},o.unref(u),{minlength:T.minlength,maxlength:T.maxlength,tabindex:T.tabindex,disabled:o.unref(h),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(ne),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(x.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 m2=Te(g2,[["__file","input.vue"]]);const oi=dt(m2),la=4,y2={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"}},b2=({move:t,size:e,bar:r})=>({[r.size]:e,transform:`translate${r.axis}(${t}%)`}),fl=Symbol("scrollbarContextKey"),w2=Fe({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),C2="Thumb";var Ad=Te(o.defineComponent({__name:"thumb",props:w2,setup(t){const e=t,r=o.inject(fl),n=Be("scrollbar");r||z1(C2,"can not inject scrollbar context");const a=o.ref(),i=o.ref(),s=o.ref({}),l=o.ref(!1);let c=!1,u=!1,d=et?document.onselectstart:null;const f=o.computed(()=>y2[e.vertical?"vertical":"horizontal"]),p=o.computed(()=>b2({size:e.size,move:e.move,bar:f.value})),v=o.computed(()=>a.value[f.value.offset]**2/r.wrapElement[f.value.scrollSize]/e.ratio/i.value[f.value.offset]),h=E=>{var k;if(E.stopPropagation(),E.ctrlKey||[1,2].includes(E.button))return;(k=window.getSelection())==null||k.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||!r.wrapElement)return;const k=Math.abs(E.target.getBoundingClientRect()[f.value.direction]-E[f.value.client]),B=i.value[f.value.offset]/2,S=(k-B)*100*v.value/a.value[f.value.offset];r.wrapElement[f.value.scroll]=S*r.wrapElement[f.value.scrollSize]/100},y=E=>{E.stopImmediatePropagation(),c=!0,document.addEventListener("mousemove",m),document.addEventListener("mouseup",b),d=document.onselectstart,document.onselectstart=()=>!1},m=E=>{if(!a.value||!i.value||c===!1)return;const k=s.value[f.value.axis];if(!k)return;const B=(a.value.getBoundingClientRect()[f.value.direction]-E[f.value.client])*-1,S=i.value[f.value.offset]-k,N=(B-S)*100*v.value/a.value[f.value.offset];r.wrapElement[f.value.scroll]=N*r.wrapElement[f.value.scrollSize]/100},b=()=>{c=!1,s.value[f.value.axis]=0,document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",b),x(),u&&(l.value=!1)},w=()=>{u=!1,l.value=!!e.size},C=()=>{u=!0,l.value=c};o.onBeforeUnmount(()=>{x(),document.removeEventListener("mouseup",b)});const x=()=>{document.onselectstart!==d&&(document.onselectstart=d)};return jt(o.toRef(r,"scrollbarElement"),"mousemove",w),jt(o.toRef(r,"scrollbarElement"),"mouseleave",C),(E,k)=>(o.openBlock(),o.createBlock(o.Transition,{name:o.unref(n).b("fade"),persisted:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{ref_key:"instance",ref:a,class:o.normalizeClass([o.unref(n).e("bar"),o.unref(n).is(o.unref(f).key)]),onMousedown:g},[o.createElementVNode("div",{ref_key:"thumb",ref:i,class:o.normalizeClass(o.unref(n).e("thumb")),style:o.normalizeStyle(o.unref(p)),onMousedown:h},null,38)],34),[[o.vShow,E.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const k2=Fe({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var x2=Te(o.defineComponent({__name:"bar",props:k2,setup(t,{expose:e}){const r=t,n=o.inject(fl),a=o.ref(0),i=o.ref(0),s=o.ref(""),l=o.ref(""),c=o.ref(1),u=o.ref(1);return e({handleScroll:p=>{if(p){const v=p.offsetHeight-la,h=p.offsetWidth-la;i.value=p.scrollTop*100/v*c.value,a.value=p.scrollLeft*100/h*u.value}},update:()=>{const p=n==null?void 0:n.wrapElement;if(!p)return;const v=p.offsetHeight-la,h=p.offsetWidth-la,g=v**2/p.scrollHeight,y=h**2/p.scrollWidth,m=Math.max(g,r.minSize),b=Math.max(y,r.minSize);c.value=g/(v-g)/(m/(v-m)),u.value=y/(h-y)/(b/(h-b)),l.value=m+la<v?`${m}px`:"",s.value=b+la<h?`${b}px`:""}}),(p,v)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(Ad,{move:a.value,ratio:u.value,size:s.value,always:p.always},null,8,["move","ratio","size","always"]),o.createVNode(Ad,{move:i.value,ratio:c.value,size:l.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const E2=Fe({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,...Qr(["ariaLabel","ariaOrientation"])}),S2={scroll:({scrollTop:t,scrollLeft:e})=>[t,e].every(gt)},hl="ElScrollbar",T2=o.defineComponent({name:hl}),B2=o.defineComponent({...T2,props:E2,emits:S2,setup(t,{expose:e,emit:r}){const n=t,a=Be("scrollbar");let i,s,l=0,c=0;const u=o.ref(),d=o.ref(),f=o.ref(),p=o.ref(),v=o.computed(()=>{const x={};return n.height&&(x.height=Jn(n.height)),n.maxHeight&&(x.maxHeight=Jn(n.maxHeight)),[n.wrapStyle,x]}),h=o.computed(()=>[n.wrapClass,a.e("wrap"),{[a.em("wrap","hidden-default")]:!n.native}]),g=o.computed(()=>[a.e("view"),n.viewClass]),y=()=>{var x;d.value&&((x=p.value)==null||x.handleScroll(d.value),l=d.value.scrollTop,c=d.value.scrollLeft,r("scroll",{scrollTop:d.value.scrollTop,scrollLeft:d.value.scrollLeft}))};function m(x,E){vt(x)?d.value.scrollTo(x):gt(x)&&gt(E)&&d.value.scrollTo(x,E)}const b=x=>{if(!gt(x)){tt(hl,"value must be a number");return}d.value.scrollTop=x},w=x=>{if(!gt(x)){tt(hl,"value must be a number");return}d.value.scrollLeft=x},C=()=>{var x;(x=p.value)==null||x.update()};return o.watch(()=>n.noresize,x=>{x?(i==null||i(),s==null||s()):({stop:i}=Pr(f,C),s=jt("resize",C))},{immediate:!0}),o.watch(()=>[n.maxHeight,n.height],()=>{n.native||o.nextTick(()=>{var x;C(),d.value&&((x=p.value)==null||x.handleScroll(d.value))})}),o.provide(fl,o.reactive({scrollbarElement:u,wrapElement:d})),o.onActivated(()=>{d.value&&(d.value.scrollTop=l,d.value.scrollLeft=c)}),o.onMounted(()=>{n.native||o.nextTick(()=>{C()})}),o.onUpdated(()=>C()),e({wrapRef:d,update:C,scrollTo:m,setScrollTop:b,setScrollLeft:w,handleScroll:y}),(x,E)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"scrollbarRef",ref:u,class:o.normalizeClass(o.unref(a).b())},[o.createElementVNode("div",{ref_key:"wrapRef",ref:d,class:o.normalizeClass(o.unref(h)),style:o.normalizeStyle(o.unref(v)),tabindex:x.tabindex,onScroll:y},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(x.tag),{id:x.id,ref_key:"resizeRef",ref:f,class:o.normalizeClass(o.unref(g)),style:o.normalizeStyle(x.viewStyle),role:x.role,"aria-label":x.ariaLabel,"aria-orientation":x.ariaOrientation},{default:o.withCtx(()=>[o.renderSlot(x.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),x.native?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(x2,{key:0,ref_key:"barRef",ref:p,always:x.always,"min-size":x.minSize},null,8,["always","min-size"]))],2))}});var N2=Te(B2,[["__file","scrollbar.vue"]]);const D2=dt(N2),pl=Symbol("popper"),Vd=Symbol("popperContent"),Rd=Fe({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),P2=o.defineComponent({name:"ElPopper",inheritAttrs:!1}),_2=o.defineComponent({...P2,props:Rd,setup(t,{expose:e}){const r=t,n=o.ref(),a=o.ref(),i=o.ref(),s=o.ref(),l=o.computed(()=>r.role),c={triggerRef:n,popperInstanceRef:a,contentRef:i,referenceRef:s,role:l};return e(c),o.provide(pl,c),(u,d)=>o.renderSlot(u.$slots,"default")}});var O2=Te(_2,[["__file","popper.vue"]]);const $d=Fe({arrowOffset:{type:Number,default:5}}),I2=o.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),L2=o.defineComponent({...I2,props:$d,setup(t,{expose:e}){const r=t,n=Be("popper"),{arrowOffset:a,arrowRef:i,arrowStyle:s}=o.inject(Vd,void 0);return o.watch(()=>r.arrowOffset,l=>{a.value=l}),o.onBeforeUnmount(()=>{i.value=void 0}),e({arrowRef:i}),(l,c)=>(o.openBlock(),o.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:o.normalizeClass(o.unref(n).e("arrow")),style:o.normalizeStyle(o.unref(s)),"data-popper-arrow":""},null,6))}});var M2=Te(L2,[["__file","arrow.vue"]]);const vl="ElOnlyChild",F2=o.defineComponent({name:vl,setup(t,{slots:e,attrs:r}){var n;const a=o.inject(Sd),i=jw((n=a==null?void 0:a.setForwardRef)!=null?n:Ha);return()=>{var s;const l=(s=e.default)==null?void 0:s.call(e,r);if(!l)return null;if(l.length>1)return tt(vl,"requires exact only one valid child."),null;const c=zd(l);return c?o.withDirectives(o.cloneVNode(c,r),[[i]]):(tt(vl,"no valid child node found"),null)}}});function zd(t){if(!t)return null;const e=t;for(const r of e){if(vt(r))switch(r.type){case o.Comment:continue;case o.Text:case"svg":return Hd(r);case o.Fragment:return zd(r.children);default:return r}return Hd(r)}return null}function Hd(t){const e=Be("only-child");return o.createVNode("span",{class:e.e("content")},[t])}const Kd=Fe({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}),A2=o.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),V2=o.defineComponent({...A2,props:Kd,setup(t,{expose:e}){const r=t,{role:n,triggerRef:a}=o.inject(pl,void 0);Ww(a);const i=o.computed(()=>l.value?r.id:void 0),s=o.computed(()=>{if(n&&n.value==="tooltip")return r.open&&r.id?r.id:void 0}),l=o.computed(()=>{if(n&&n.value!=="tooltip")return n.value}),c=o.computed(()=>l.value?`${r.open}`:void 0);let u;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return o.onMounted(()=>{o.watch(()=>r.virtualRef,f=>{f&&(a.value=Dr(f))},{immediate:!0}),o.watch(a,(f,p)=>{u==null||u(),u=void 0,En(f)&&(d.forEach(v=>{var h;const g=r[v];g&&(f.addEventListener(v.slice(2).toLowerCase(),g),(h=p==null?void 0:p.removeEventListener)==null||h.call(p,v.slice(2).toLowerCase(),g))}),u=o.watch([i,s,l,c],v=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((h,g)=>{jr(v[g])?f.removeAttribute(h):f.setAttribute(h,v[g])})},{immediate:!0})),En(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(v=>p.removeAttribute(v))},{immediate:!0})}),o.onBeforeUnmount(()=>{if(u==null||u(),u=void 0,a.value&&En(a.value)){const f=a.value;d.forEach(p=>{const v=r[p];v&&f.removeEventListener(p.slice(2).toLowerCase(),v)}),a.value=void 0}}),e({triggerRef:a}),(f,p)=>f.virtualTriggering?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(o.unref(F2),o.mergeProps({key:0},f.$attrs,{"aria-controls":o.unref(i),"aria-describedby":o.unref(s),"aria-expanded":o.unref(c),"aria-haspopup":o.unref(l)}),{default:o.withCtx(()=>[o.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var R2=Te(V2,[["__file","trigger.vue"]]);const gl="focus-trap.focus-after-trapped",ml="focus-trap.focus-after-released",$2="focus-trap.focusout-prevented",qd={cancelable:!0,bubbles:!1},z2={cancelable:!0,bubbles:!1},Ud="focusAfterTrapped",Gd="focusAfterReleased",H2=Symbol("elFocusTrap"),yl=o.ref(),wo=o.ref(0),bl=o.ref(0);let Co=0;const Wd=t=>{const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0||n===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e},jd=(t,e)=>{for(const r of t)if(!K2(r,e))return r},K2=(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},q2=t=>{const e=Wd(t),r=jd(e,t),n=jd(e.reverse(),t);return[r,n]},U2=t=>t instanceof HTMLInputElement&&"select"in t,Jr=(t,e)=>{if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),bl.value=window.performance.now(),t!==r&&U2(t)&&e&&t.select()}};function Yd(t,e){const r=[...t],n=t.indexOf(e);return n!==-1&&r.splice(n,1),r}const G2=()=>{let t=[];return{push:n=>{const a=t[0];a&&n!==a&&a.pause(),t=Yd(t,n),t.unshift(n)},remove:n=>{var a,i;t=Yd(t,n),(i=(a=t[0])==null?void 0:a.resume)==null||i.call(a)}}},W2=(t,e=!1)=>{const r=document.activeElement;for(const n of t)if(Jr(n,e),document.activeElement!==r)return},Zd=G2(),j2=()=>wo.value>bl.value,ko=()=>{yl.value="pointer",wo.value=window.performance.now()},Xd=()=>{yl.value="keyboard",wo.value=window.performance.now()},Y2=()=>(o.onMounted(()=>{Co===0&&(document.addEventListener("mousedown",ko),document.addEventListener("touchstart",ko),document.addEventListener("keydown",Xd)),Co++}),o.onBeforeUnmount(()=>{Co--,Co<=0&&(document.removeEventListener("mousedown",ko),document.removeEventListener("touchstart",ko),document.removeEventListener("keydown",Xd))}),{focusReason:yl,lastUserFocusTimestamp:wo,lastAutomatedFocusTimestamp:bl}),xo=t=>new CustomEvent($2,{...z2,detail:t}),Z2=o.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Ud,Gd,"focusin","focusout","focusout-prevented","release-requested"],setup(t,{emit:e}){const r=o.ref();let n,a;const{focusReason:i}=Y2();Hw(h=>{t.trapped&&!s.paused&&e("release-requested",h)});const s={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=h=>{if(!t.loop&&!t.trapped||s.paused)return;const{key:g,altKey:y,ctrlKey:m,metaKey:b,currentTarget:w,shiftKey:C}=h,{loop:x}=t,E=g===it.tab&&!y&&!m&&!b,k=document.activeElement;if(E&&k){const B=w,[S,N]=q2(B);if(S&&N){if(!C&&k===N){const P=xo({focusReason:i.value});e("focusout-prevented",P),P.defaultPrevented||(h.preventDefault(),x&&Jr(S,!0))}else if(C&&[S,B].includes(k)){const P=xo({focusReason:i.value});e("focusout-prevented",P),P.defaultPrevented||(h.preventDefault(),x&&Jr(N,!0))}}else if(k===B){const P=xo({focusReason:i.value});e("focusout-prevented",P),P.defaultPrevented||h.preventDefault()}}};o.provide(H2,{focusTrapRef:r,onKeydown:l}),o.watch(()=>t.focusTrapEl,h=>{h&&(r.value=h)},{immediate:!0}),o.watch([r],([h],[g])=>{h&&(h.addEventListener("keydown",l),h.addEventListener("focusin",d),h.addEventListener("focusout",f)),g&&(g.removeEventListener("keydown",l),g.removeEventListener("focusin",d),g.removeEventListener("focusout",f))});const c=h=>{e(Ud,h)},u=h=>e(Gd,h),d=h=>{const g=o.unref(r);if(!g)return;const y=h.target,m=h.relatedTarget,b=y&&g.contains(y);t.trapped||m&&g.contains(m)||(n=m),b&&e("focusin",h),!s.paused&&t.trapped&&(b?a=y:Jr(a,!0))},f=h=>{const g=o.unref(r);if(!(s.paused||!g))if(t.trapped){const y=h.relatedTarget;!jr(y)&&!g.contains(y)&&setTimeout(()=>{if(!s.paused&&t.trapped){const m=xo({focusReason:i.value});e("focusout-prevented",m),m.defaultPrevented||Jr(a,!0)}},0)}else{const y=h.target;y&&g.contains(y)||e("focusout",h)}};async function p(){await o.nextTick();const h=o.unref(r);if(h){Zd.push(s);const g=h.contains(document.activeElement)?n:document.activeElement;if(n=g,!h.contains(g)){const m=new Event(gl,qd);h.addEventListener(gl,c),h.dispatchEvent(m),m.defaultPrevented||o.nextTick(()=>{let b=t.focusStartEl;St(b)||(Jr(b),document.activeElement!==b&&(b="first")),b==="first"&&W2(Wd(h),!0),(document.activeElement===g||b==="container")&&Jr(h)})}}}function v(){const h=o.unref(r);if(h){h.removeEventListener(gl,c);const g=new CustomEvent(ml,{...qd,detail:{focusReason:i.value}});h.addEventListener(ml,u),h.dispatchEvent(g),!g.defaultPrevented&&(i.value=="keyboard"||!j2()||h.contains(document.activeElement))&&Jr(n??document.body),h.removeEventListener(ml,u),Zd.remove(s)}}return o.onMounted(()=>{t.trapped&&p(),o.watch(()=>t.trapped,h=>{h?p():v()})}),o.onBeforeUnmount(()=>{t.trapped&&v(),r.value&&(r.value.removeEventListener("keydown",l),r.value.removeEventListener("focusin",d),r.value.removeEventListener("focusout",f),r.value=void 0)}),{onKeydown:l}}});function X2(t,e,r,n,a,i){return o.renderSlot(t.$slots,"default",{handleKeydown:t.onKeydown})}var Q2=Te(Z2,[["render",X2],["__file","focus-trap.vue"]]);const J2=["fixed","absolute"],eC=Fe({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:ho,default:"bottom"},popperOptions:{type:ke(Object),default:()=>({})},strategy:{type:String,values:J2,default:"absolute"}}),Qd=Fe({...eC,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,...Qr(["ariaLabel"])}),tC={mouseenter:t=>t instanceof MouseEvent,mouseleave:t=>t instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},rC=(t,e=[])=>{const{placement:r,strategy:n,popperOptions:a}=t,i={placement:r,strategy:n,...a,modifiers:[...aC(t),...e]};return iC(i,a==null?void 0:a.modifiers),i},nC=t=>{if(et)return Dr(t)};function aC(t){const{offset:e,gpuAcceleration:r,fallbackPlacements:n}=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:n}},{name:"computeStyles",options:{gpuAcceleration:r}}]}function iC(t,e){e&&(t.modifiers=[...t.modifiers,...e??[]])}const oC=0,sC=t=>{const{popperInstanceRef:e,contentRef:r,triggerRef:n,role:a}=o.inject(pl,void 0),i=o.ref(),s=o.ref(),l=o.computed(()=>({name:"eventListeners",enabled:!!t.visible})),c=o.computed(()=>{var m;const b=o.unref(i),w=(m=o.unref(s))!=null?m:oC;return{name:"arrow",enabled:!M1(b),options:{element:b,padding:w}}}),u=o.computed(()=>({onFirstUpdate:()=>{h()},...rC(t,[o.unref(c),o.unref(l)])})),d=o.computed(()=>nC(t.referenceEl)||o.unref(n)),{attributes:f,state:p,styles:v,update:h,forceUpdate:g,instanceRef:y}=Rw(d,r,u);return o.watch(y,m=>e.value=m),o.onMounted(()=>{o.watch(()=>{var m;return(m=o.unref(d))==null?void 0:m.getBoundingClientRect()},()=>{h()})}),{attributes:f,arrowRef:i,contentRef:r,instanceRef:y,state:p,styles:v,role:a,forceUpdate:g,update:h}},lC=(t,{attributes:e,styles:r,role:n})=>{const{nextZIndex:a}=_d(),i=Be("popper"),s=o.computed(()=>o.unref(e).popper),l=o.ref(gt(t.zIndex)?t.zIndex:a()),c=o.computed(()=>[i.b(),i.is("pure",t.pure),i.is(t.effect),t.popperClass]),u=o.computed(()=>[{zIndex:o.unref(l)},o.unref(r).popper,t.popperStyle||{}]),d=o.computed(()=>n.value==="dialog"?"false":void 0),f=o.computed(()=>o.unref(r).arrow||{});return{ariaModal:d,arrowStyle:f,contentAttrs:s,contentClass:c,contentStyle:u,contentZIndex:l,updateZIndex:()=>{l.value=gt(t.zIndex)?t.zIndex:a()}}},cC=(t,e)=>{const r=o.ref(!1),n=o.ref();return{focusStartRef:n,trapped:r,onFocusAfterReleased:u=>{var d;((d=u.detail)==null?void 0:d.focusReason)!=="pointer"&&(n.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:u=>{t.visible&&!r.value&&(u.target&&(n.value=u.target),r.value=!0)},onFocusoutPrevented:u=>{t.trapping||(u.detail.focusReason==="pointer"&&u.preventDefault(),r.value=!1)},onReleaseRequested:()=>{r.value=!1,e("close")}}},uC=o.defineComponent({name:"ElPopperContent"}),dC=o.defineComponent({...uC,props:Qd,emits:tC,setup(t,{expose:e,emit:r}){const n=t,{focusStartRef:a,trapped:i,onFocusAfterReleased:s,onFocusAfterTrapped:l,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=cC(n,r),{attributes:f,arrowRef:p,contentRef:v,styles:h,instanceRef:g,role:y,update:m}=sC(n),{ariaModal:b,arrowStyle:w,contentAttrs:C,contentClass:x,contentStyle:E,updateZIndex:k}=lC(n,{styles:h,attributes:f,role:y}),B=o.inject(ni,void 0),S=o.ref();o.provide(Vd,{arrowStyle:w,arrowRef:p,arrowOffset:S}),B&&o.provide(ni,{...B,addInputId:Ha,removeInputId:Ha});let N;const D=(I=!0)=>{m(),I&&k()},P=()=>{D(!1),n.visible&&n.focusOnShow?i.value=!0:n.visible===!1&&(i.value=!1)};return o.onMounted(()=>{o.watch(()=>n.triggerTargetEl,(I,_)=>{N==null||N(),N=void 0;const F=o.unref(I||v.value),O=o.unref(_||v.value);En(F)&&(N=o.watch([y,()=>n.ariaLabel,b,()=>n.id],M=>{["role","aria-label","aria-modal","id"].forEach((L,V)=>{jr(M[V])?F.removeAttribute(L):F.setAttribute(L,M[V])})},{immediate:!0})),O!==F&&En(O)&&["role","aria-label","aria-modal","id"].forEach(M=>{O.removeAttribute(M)})},{immediate:!0}),o.watch(()=>n.visible,P,{immediate:!0})}),o.onBeforeUnmount(()=>{N==null||N(),N=void 0}),e({popperContentRef:v,popperInstanceRef:g,updatePopper:D,contentStyle:E}),(I,_)=>(o.openBlock(),o.createElementBlock("div",o.mergeProps({ref_key:"contentRef",ref:v},o.unref(C),{style:o.unref(E),class:o.unref(x),tabindex:"-1",onMouseenter:F=>I.$emit("mouseenter",F),onMouseleave:F=>I.$emit("mouseleave",F)}),[o.createVNode(o.unref(Q2),{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(c),onFocusoutPrevented:o.unref(u),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 fC=Te(dC,[["__file","content.vue"]]);const hC=dt(O2),wl=Symbol("elTooltip"),$t=Fe({...Uw,...Qd,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,...Qr(["ariaLabel"])}),si=Fe({...Kd,disabled:Boolean,trigger:{type:ke([String,Array]),default:"hover"},triggerKeys:{type:ke(Array),default:()=>[it.enter,it.space]}}),{useModelToggleProps:pC,useModelToggleEmits:vC,useModelToggle:gC}=Fb("visible"),mC=Fe({...Rd,...pC,...$t,...si,...$d,showArrow:{type:Boolean,default:!0}}),yC=[...vC,"before-show","before-hide","show","hide","open","close"],bC=(t,e)=>At(t)?t.includes(e):t===e,ca=(t,e,r)=>n=>{bC(o.unref(t),e)&&r(n)},wC=o.defineComponent({name:"ElTooltipTrigger"}),CC=o.defineComponent({...wC,props:si,setup(t,{expose:e}){const r=t,n=Be("tooltip"),{controlled:a,id:i,open:s,onOpen:l,onClose:c,onToggle:u}=o.inject(wl,void 0),d=o.ref(null),f=()=>{if(o.unref(a)||r.disabled)return!0},p=o.toRef(r,"trigger"),v=Ft(f,ca(p,"hover",l)),h=Ft(f,ca(p,"hover",c)),g=Ft(f,ca(p,"click",C=>{C.button===0&&u(C)})),y=Ft(f,ca(p,"focus",l)),m=Ft(f,ca(p,"focus",c)),b=Ft(f,ca(p,"contextmenu",C=>{C.preventDefault(),u(C)})),w=Ft(f,C=>{const{code:x}=C;r.triggerKeys.includes(x)&&(C.preventDefault(),u(C))});return e({triggerRef:d}),(C,x)=>(o.openBlock(),o.createBlock(o.unref(R2),{id:o.unref(i),"virtual-ref":C.virtualRef,open:o.unref(s),"virtual-triggering":C.virtualTriggering,class:o.normalizeClass(o.unref(n).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(h),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 kC=Te(CC,[["__file","trigger.vue"]]);const xC=Fe({to:{type:ke([String,Object]),required:!0},disabled:Boolean});var EC=Te(o.defineComponent({__name:"teleport",props:xC,setup(t){return(e,r)=>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 SC=dt(EC),TC=o.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),BC=o.defineComponent({...TC,props:$t,setup(t,{expose:e}){const r=t,{selector:n}=Ed(),a=Be("tooltip"),i=o.ref(null);let s;const{controlled:l,id:c,open:u,trigger:d,onClose:f,onOpen:p,onShow:v,onHide:h,onBeforeShow:g,onBeforeHide:y}=o.inject(wl,void 0),m=o.computed(()=>r.transition||`${a.namespace.value}-fade-in-linear`),b=o.computed(()=>process.env.NODE_ENV==="test"?!0:r.persistent);o.onBeforeUnmount(()=>{s==null||s()});const w=o.computed(()=>o.unref(b)?!0:o.unref(u)),C=o.computed(()=>r.disabled?!1:o.unref(u)),x=o.computed(()=>r.appendTo||n.value),E=o.computed(()=>{var O;return(O=r.style)!=null?O:{}}),k=o.ref(!0),B=()=>{h(),k.value=!0},S=()=>{if(o.unref(l))return!0},N=Ft(S,()=>{r.enterable&&o.unref(d)==="hover"&&p()}),D=Ft(S,()=>{o.unref(d)==="hover"&&f()}),P=()=>{var O,M;(M=(O=i.value)==null?void 0:O.updatePopper)==null||M.call(O),g==null||g()},I=()=>{y==null||y()},_=()=>{v(),s=Dg(o.computed(()=>{var O;return(O=i.value)==null?void 0:O.popperContentRef}),()=>{if(o.unref(l))return;o.unref(d)!=="hover"&&f()})},F=()=>{r.virtualTriggering||f()};return o.watch(()=>o.unref(u),O=>{O?k.value=!1:s==null||s()},{flush:"post"}),o.watch(()=>r.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(SC),{disabled:!O.teleported,to:o.unref(x)},{default:o.withCtx(()=>[o.createVNode(o.Transition,{name:o.unref(m),onAfterLeave:B,onBeforeEnter:P,onAfterEnter:_,onBeforeLeave:I},{default:o.withCtx(()=>[o.unref(w)?o.withDirectives((o.openBlock(),o.createBlock(o.unref(fC),o.mergeProps({key:0,id:o.unref(c),ref_key:"contentRef",ref:i},O.$attrs,{"aria-label":O.ariaLabel,"aria-hidden":k.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 NC=Te(BC,[["__file","content.vue"]]);const DC=o.defineComponent({name:"ElTooltip"}),PC=o.defineComponent({...DC,props:mC,emits:yC,setup(t,{expose:e,emit:r}){const n=t;qw();const a=yo(),i=o.ref(),s=o.ref(),l=()=>{var m;const b=o.unref(i);b&&((m=b.popperInstanceRef)==null||m.update())},c=o.ref(!1),u=o.ref(),{show:d,hide:f,hasUpdateHandler:p}=gC({indicator:c,toggleReason:u}),{onOpen:v,onClose:h}=Gw({showAfter:o.toRef(n,"showAfter"),hideAfter:o.toRef(n,"hideAfter"),autoClose:o.toRef(n,"autoClose"),open:d,close:f}),g=o.computed(()=>Qn(n.visible)&&!p.value);o.provide(wl,{controlled:g,id:a,open:o.readonly(c),trigger:o.toRef(n,"trigger"),onOpen:m=>{v(m)},onClose:m=>{h(m)},onToggle:m=>{o.unref(c)?h(m):v(m)},onShow:()=>{r("show",u.value)},onHide:()=>{r("hide",u.value)},onBeforeShow:()=>{r("before-show",u.value)},onBeforeHide:()=>{r("before-hide",u.value)},updatePopper:l}),o.watch(()=>n.disabled,m=>{m&&c.value&&(c.value=!1)});const y=m=>{var b,w;const C=(w=(b=s.value)==null?void 0:b.contentRef)==null?void 0:w.popperContentRef,x=(m==null?void 0:m.relatedTarget)||document.activeElement;return C&&C.contains(x)};return o.onDeactivated(()=>c.value&&f()),e({popperRef:i,contentRef:s,isFocusInsideContent:y,updatePopper:l,onOpen:v,onClose:h,hide:f}),(m,b)=>(o.openBlock(),o.createBlock(o.unref(hC),{ref_key:"popperRef",ref:i,role:m.role},{default:o.withCtx(()=>[o.createVNode(kC,{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(NC,{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(M2),{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 _C=Te(PC,[["__file","tooltip.vue"]]);const li=dt(_C),Jd=Symbol("buttonGroupContextKey"),OC=(t,e)=>{uo({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 r=o.inject(Jd,void 0),n=ul("button"),{form:a}=Dn(),i=Nn(o.computed(()=>r==null?void 0:r.size)),s=ai(),l=o.ref(),c=o.useSlots(),u=o.computed(()=>t.type||(r==null?void 0:r.type)||""),d=o.computed(()=>{var h,g,y;return(y=(g=t.autoInsertSpace)!=null?g:(h=n.value)==null?void 0:h.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}:{}),p=o.computed(()=>{var h;const g=(h=c.default)==null?void 0:h.call(c);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:u,_ref:l,_props:f,shouldAddSpace:p,handleClick:h=>{if(s.value||t.loading){h.stopPropagation();return}t.nativeType==="reset"&&(a==null||a.resetFields()),e("click",h)}}},Cl=Fe({size:sa,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Zr},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Zr,default:()=>Zs},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"}}),IC={click:t=>t instanceof MouseEvent};function bt(t,e){LC(t)&&(t="100%");var r=MC(t);return t=e===360?t:Math.min(e,Math.max(0,parseFloat(t))),r&&(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 Eo(t){return Math.min(1,Math.max(0,t))}function LC(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function MC(t){return typeof t=="string"&&t.indexOf("%")!==-1}function ef(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function So(t){return t<=1?"".concat(Number(t)*100,"%"):t}function Pn(t){return t.length===1?"0"+t:String(t)}function FC(t,e,r){return{r:bt(t,255)*255,g:bt(e,255)*255,b:bt(r,255)*255}}function tf(t,e,r){t=bt(t,255),e=bt(e,255),r=bt(r,255);var n=Math.max(t,e,r),a=Math.min(t,e,r),i=0,s=0,l=(n+a)/2;if(n===a)s=0,i=0;else{var c=n-a;switch(s=l>.5?c/(2-n-a):c/(n+a),n){case t:i=(e-r)/c+(e<r?6:0);break;case e:i=(r-t)/c+2;break;case r:i=(t-e)/c+4;break}i/=6}return{h:i,s,l}}function kl(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*(6*r):r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function AC(t,e,r){var n,a,i;if(t=bt(t,360),e=bt(e,100),r=bt(r,100),e===0)a=r,i=r,n=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=kl(l,s,t+1/3),a=kl(l,s,t),i=kl(l,s,t-1/3)}return{r:n*255,g:a*255,b:i*255}}function rf(t,e,r){t=bt(t,255),e=bt(e,255),r=bt(r,255);var n=Math.max(t,e,r),a=Math.min(t,e,r),i=0,s=n,l=n-a,c=n===0?0:l/n;if(n===a)i=0;else{switch(n){case t:i=(e-r)/l+(e<r?6:0);break;case e:i=(r-t)/l+2;break;case r:i=(t-e)/l+4;break}i/=6}return{h:i,s:c,v:s}}function VC(t,e,r){t=bt(t,360)*6,e=bt(e,100),r=bt(r,100);var n=Math.floor(t),a=t-n,i=r*(1-e),s=r*(1-a*e),l=r*(1-(1-a)*e),c=n%6,u=[r,s,i,i,l,r][c],d=[l,r,r,s,i,i][c],f=[i,i,l,r,r,s][c];return{r:u*255,g:d*255,b:f*255}}function nf(t,e,r,n){var a=[Pn(Math.round(t).toString(16)),Pn(Math.round(e).toString(16)),Pn(Math.round(r).toString(16))];return n&&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 RC(t,e,r,n,a){var i=[Pn(Math.round(t).toString(16)),Pn(Math.round(e).toString(16)),Pn(Math.round(r).toString(16)),Pn($C(n))];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 $C(t){return Math.round(parseFloat(t)*255).toString(16)}function af(t){return qt(t)/255}function qt(t){return parseInt(t,16)}function zC(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var xl={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 HC(t){var e={r:0,g:0,b:0},r=1,n=null,a=null,i=null,s=!1,l=!1;return typeof t=="string"&&(t=UC(t)),typeof t=="object"&&(Ar(t.r)&&Ar(t.g)&&Ar(t.b)?(e=FC(t.r,t.g,t.b),s=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Ar(t.h)&&Ar(t.s)&&Ar(t.v)?(n=So(t.s),a=So(t.v),e=VC(t.h,n,a),s=!0,l="hsv"):Ar(t.h)&&Ar(t.s)&&Ar(t.l)&&(n=So(t.s),i=So(t.l),e=AC(t.h,n,i),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(r=t.a)),r=ef(r),{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:r}}var KC="[-\\+]?\\d+%?",qC="[-\\+]?\\d*\\.\\d+%?",en="(?:".concat(qC,")|(?:").concat(KC,")"),El="[\\s|\\(]+(".concat(en,")[,|\\s]+(").concat(en,")[,|\\s]+(").concat(en,")\\s*\\)?"),Sl="[\\s|\\(]+(".concat(en,")[,|\\s]+(").concat(en,")[,|\\s]+(").concat(en,")[,|\\s]+(").concat(en,")\\s*\\)?"),or={CSS_UNIT:new RegExp(en),rgb:new RegExp("rgb"+El),rgba:new RegExp("rgba"+Sl),hsl:new RegExp("hsl"+El),hsla:new RegExp("hsla"+Sl),hsv:new RegExp("hsv"+El),hsva:new RegExp("hsva"+Sl),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 UC(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(xl[t])t=xl[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=or.rgb.exec(t);return r?{r:r[1],g:r[2],b:r[3]}:(r=or.rgba.exec(t),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=or.hsl.exec(t),r?{h:r[1],s:r[2],l:r[3]}:(r=or.hsla.exec(t),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=or.hsv.exec(t),r?{h:r[1],s:r[2],v:r[3]}:(r=or.hsva.exec(t),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=or.hex8.exec(t),r?{r:qt(r[1]),g:qt(r[2]),b:qt(r[3]),a:af(r[4]),format:e?"name":"hex8"}:(r=or.hex6.exec(t),r?{r:qt(r[1]),g:qt(r[2]),b:qt(r[3]),format:e?"name":"hex"}:(r=or.hex4.exec(t),r?{r:qt(r[1]+r[1]),g:qt(r[2]+r[2]),b:qt(r[3]+r[3]),a:af(r[4]+r[4]),format:e?"name":"hex8"}:(r=or.hex3.exec(t),r?{r:qt(r[1]+r[1]),g:qt(r[2]+r[2]),b:qt(r[3]+r[3]),format:e?"name":"hex"}:!1)))))))))}function Ar(t){return!!or.CSS_UNIT.exec(String(t))}var GC=function(){function t(e,r){e===void 0&&(e=""),r===void 0&&(r={});var n;if(e instanceof t)return e;typeof e=="number"&&(e=zC(e)),this.originalInput=e;var a=HC(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=(n=r.format)!==null&&n!==void 0?n:a.format,this.gradientType=r.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(),r,n,a,i=e.r/255,s=e.g/255,l=e.b/255;return i<=.03928?r=i/12.92:r=Math.pow((i+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),l<=.03928?a=l/12.92:a=Math.pow((l+.055)/1.055,2.4),.2126*r+.7152*n+.0722*a},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(e){return this.a=ef(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=rf(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=rf(this.r,this.g,this.b),r=Math.round(e.h*360),n=Math.round(e.s*100),a=Math.round(e.v*100);return this.a===1?"hsv(".concat(r,", ").concat(n,"%, ").concat(a,"%)"):"hsva(".concat(r,", ").concat(n,"%, ").concat(a,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var e=tf(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=tf(this.r,this.g,this.b),r=Math.round(e.h*360),n=Math.round(e.s*100),a=Math.round(e.l*100);return this.a===1?"hsl(".concat(r,", ").concat(n,"%, ").concat(a,"%)"):"hsla(".concat(r,", ").concat(n,"%, ").concat(a,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(e){return e===void 0&&(e=!1),nf(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),RC(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),r=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(r,", ").concat(n,")"):"rgba(".concat(e,", ").concat(r,", ").concat(n,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var e=function(r){return"".concat(Math.round(bt(r,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(r){return Math.round(bt(r,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="#"+nf(this.r,this.g,this.b,!1),r=0,n=Object.entries(xl);r<n.length;r++){var a=n[r],i=a[0],s=a[1];if(e===s)return i}return!1},t.prototype.toString=function(e){var r=!!e;e=e??this.format;var n=!1,a=this.a<1&&this.a>=0,i=!r&&a&&(e.startsWith("hex")||e==="name");return i?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||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 r=this.toHsl();return r.l+=e/100,r.l=Eo(r.l),new t(r)},t.prototype.brighten=function(e){e===void 0&&(e=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(e/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(e/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(e/100)))),new t(r)},t.prototype.darken=function(e){e===void 0&&(e=10);var r=this.toHsl();return r.l-=e/100,r.l=Eo(r.l),new t(r)},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 r=this.toHsl();return r.s-=e/100,r.s=Eo(r.s),new t(r)},t.prototype.saturate=function(e){e===void 0&&(e=10);var r=this.toHsl();return r.s+=e/100,r.s=Eo(r.s),new t(r)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var r=this.toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,new t(r)},t.prototype.mix=function(e,r){r===void 0&&(r=50);var n=this.toRgb(),a=new t(e).toRgb(),i=r/100,s={r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a};return new t(s)},t.prototype.analogous=function(e,r){e===void 0&&(e=6),r===void 0&&(r=30);var n=this.toHsl(),a=360/r,i=[this];for(n.h=(n.h-(a*e>>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(new t(n));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 r=this.toHsv(),n=r.h,a=r.s,i=r.v,s=[],l=1/e;e--;)s.push(new t({h:n,s:a,v:i})),i=(i+l)%1;return s},t.prototype.splitcomplement=function(){var e=this.toHsl(),r=e.h;return[this,new t({h:(r+72)%360,s:e.s,l:e.l}),new t({h:(r+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var r=this.toRgb(),n=new t(e).toRgb(),a=r.a+n.a*(1-r.a);return new t({r:(r.r*r.a+n.r*n.a*(1-r.a))/a,g:(r.g*r.a+n.g*n.a*(1-r.a))/a,b:(r.b*r.a+n.b*n.a*(1-r.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 r=this.toHsl(),n=r.h,a=[this],i=360/e,s=1;s<e;s++)a.push(new t({h:(n+s*i)%360,s:r.s,l:r.l}));return a},t.prototype.equals=function(e){return this.toRgbString()===new t(e).toRgbString()},t}();function tn(t,e=20){return t.mix("#141414",e).toString()}function WC(t){const e=ai(),r=Be("button");return o.computed(()=>{let n={},a=t.color;if(a){const i=a.match(/var\((.*?)\)/);i&&(a=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const s=new GC(a),l=t.dark?s.tint(20).toString():tn(s,20);if(t.plain)n=r.cssVarBlock({"bg-color":t.dark?tn(s,90):s.tint(90).toString(),"text-color":a,"border-color":t.dark?tn(s,50):s.tint(50).toString(),"hover-text-color":`var(${r.cssVarName("color-white")})`,"hover-bg-color":a,"hover-border-color":a,"active-bg-color":l,"active-text-color":`var(${r.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(n[r.cssVarBlockName("disabled-bg-color")]=t.dark?tn(s,90):s.tint(90).toString(),n[r.cssVarBlockName("disabled-text-color")]=t.dark?tn(s,50):s.tint(50).toString(),n[r.cssVarBlockName("disabled-border-color")]=t.dark?tn(s,80):s.tint(80).toString());else{const c=t.dark?tn(s,30):s.tint(30).toString(),u=s.isDark()?`var(${r.cssVarName("color-white")})`:`var(${r.cssVarName("color-black")})`;if(n=r.cssVarBlock({"bg-color":a,"text-color":u,"border-color":a,"hover-bg-color":c,"hover-text-color":u,"hover-border-color":c,"active-bg-color":l,"active-border-color":l}),e.value){const d=t.dark?tn(s,50):s.tint(50).toString();n[r.cssVarBlockName("disabled-bg-color")]=d,n[r.cssVarBlockName("disabled-text-color")]=t.dark?"rgba(255, 255, 255, 0.5)":`var(${r.cssVarName("color-white")})`,n[r.cssVarBlockName("disabled-border-color")]=d}}}return n})}const jC=o.defineComponent({name:"ElButton"}),YC=o.defineComponent({...jC,props:Cl,emits:IC,setup(t,{expose:e,emit:r}){const n=t,a=WC(n),i=Be("button"),{_ref:s,_size:l,_type:c,_disabled:u,_props:d,shouldAddSpace:f,handleClick:p}=OC(n,r),v=o.computed(()=>[i.b(),i.m(c.value),i.m(l.value),i.is("disabled",u.value),i.is("loading",n.loading),i.is("plain",n.plain),i.is("round",n.round),i.is("circle",n.circle),i.is("text",n.text),i.is("link",n.link),i.is("has-bg",n.bg)]);return e({ref:s,size:l,type:c,disabled:u,shouldAddSpace:f}),(h,g)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h.tag),o.mergeProps({ref_key:"_ref",ref:s},o.unref(d),{class:o.unref(v),style:o.unref(a),onClick:o.unref(p)}),{default:o.withCtx(()=>[h.loading?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[h.$slots.loading?o.renderSlot(h.$slots,"loading",{key:0}):(o.openBlock(),o.createBlock(o.unref(yt),{key:1,class:o.normalizeClass(o.unref(i).is("loading"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h.loadingIcon)))]),_:1},8,["class"]))],64)):h.icon||h.$slots.icon?(o.openBlock(),o.createBlock(o.unref(yt),{key:1},{default:o.withCtx(()=>[h.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h.icon),{key:0})):o.renderSlot(h.$slots,"icon",{key:1})]),_:3})):o.createCommentVNode("v-if",!0),h.$slots.default?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass({[o.unref(i).em("text","expand")]:o.unref(f)})},[o.renderSlot(h.$slots,"default")],2)):o.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var ZC=Te(YC,[["__file","button.vue"]]);const XC={size:Cl.size,type:Cl.type},QC=o.defineComponent({name:"ElButtonGroup"}),JC=o.defineComponent({...QC,props:XC,setup(t){const e=t;o.provide(Jd,o.reactive({size:o.toRef(e,"size"),type:o.toRef(e,"type")}));const r=Be("button");return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(r).b("group"))},[o.renderSlot(n.$slots,"default")],2))}});var of=Te(JC,[["__file","button-group.vue"]]);const sr=dt(ZC,{ButtonGroup:of}),ek=Mr(of),rn=new Map;if(et){let t;document.addEventListener("mousedown",e=>t=e),document.addEventListener("mouseup",e=>{if(t){for(const r of rn.values())for(const{documentHandler:n}of r)n(e,t);t=void 0}})}function sf(t,e){let r=[];return Array.isArray(e.arg)?r=e.arg:En(e.arg)&&r.push(e.arg),function(n,a){const i=e.instance.popperRef,s=n.target,l=a==null?void 0:a.target,c=!e||!e.instance,u=!s||!l,d=t.contains(s)||t.contains(l),f=t===s,p=r.length&&r.some(h=>h==null?void 0:h.contains(s))||r.length&&r.includes(l),v=i&&(i.contains(s)||i.contains(l));c||u||d||f||p||v||e.value(n,a)}}const lf={beforeMount(t,e){rn.has(t)||rn.set(t,[]),rn.get(t).push({documentHandler:sf(t,e),bindingFn:e.value})},updated(t,e){rn.has(t)||rn.set(t,[]);const r=rn.get(t),n=r.findIndex(i=>i.bindingFn===e.oldValue),a={documentHandler:sf(t,e),bindingFn:e.value};n>=0?r.splice(n,1,a):r.push(a)},unmounted(t){rn.delete(t)}},tk=Fe({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"}}),rk=o.defineComponent({name:"ElCard"}),nk=o.defineComponent({...rk,props:tk,setup(t){const e=Be("card");return(r,n)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([o.unref(e).b(),o.unref(e).is(`${r.shadow}-shadow`)])},[r.$slots.header||r.header?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(e).e("header"))},[o.renderSlot(r.$slots,"header",{},()=>[o.createTextVNode(o.toDisplayString(r.header),1)])],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{class:o.normalizeClass([o.unref(e).e("body"),r.bodyClass]),style:o.normalizeStyle(r.bodyStyle)},[o.renderSlot(r.$slots,"default")],6),r.$slots.footer||r.footer?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(e).e("footer"))},[o.renderSlot(r.$slots,"footer",{},()=>[o.createTextVNode(o.toDisplayString(r.footer),1)])],2)):o.createCommentVNode("v-if",!0)],2))}});var ak=Te(nk,[["__file","card.vue"]]);const ik=dt(ak),cf={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:sa,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...Qr(["ariaControls"])},uf={[mt]:t=>St(t)||gt(t)||Qn(t),change:t=>St(t)||gt(t)||Qn(t)},ua=Symbol("checkboxGroupContextKey"),ok=({model:t,isChecked:e})=>{const r=o.inject(ua,void 0),n=o.computed(()=>{var i,s;const l=(i=r==null?void 0:r.max)==null?void 0:i.value,c=(s=r==null?void 0:r.min)==null?void 0:s.value;return!Yr(l)&&t.value.length>=l&&!e.value||!Yr(c)&&t.value.length<=c&&e.value});return{isDisabled:ai(o.computed(()=>(r==null?void 0:r.disabled.value)||n.value)),isLimitDisabled:n}},sk=(t,{model:e,isLimitExceeded:r,hasOwnLabel:n,isDisabled:a,isLabeledByFormItem:i})=>{const s=o.inject(ua,void 0),{formItem:l}=Dn(),{emit:c}=o.getCurrentInstance();function u(h){var g,y,m,b;return[!0,t.trueValue,t.trueLabel].includes(h)?(y=(g=t.trueValue)!=null?g:t.trueLabel)!=null?y:!0:(b=(m=t.falseValue)!=null?m:t.falseLabel)!=null?b:!1}function d(h,g){c("change",u(h),g)}function f(h){if(r.value)return;const g=h.target;c("change",u(g.checked),h)}async function p(h){r.value||!n.value&&!a.value&&i.value&&(h.composedPath().some(m=>m.tagName==="LABEL")||(e.value=u([!1,t.falseValue,t.falseLabel].includes(e.value)),await o.nextTick(),d(e.value,h)))}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(h=>tt(h)))}),{handleChange:f,onClickRoot:p}},lk=t=>{const e=o.ref(!1),{emit:r}=o.getCurrentInstance(),n=o.inject(ua,void 0),a=o.computed(()=>Yr(n)===!1),i=o.ref(!1),s=o.computed({get(){var l,c;return a.value?(l=n==null?void 0:n.modelValue)==null?void 0:l.value:(c=t.modelValue)!=null?c:e.value},set(l){var c,u;a.value&&At(l)?(i.value=((c=n==null?void 0:n.max)==null?void 0:c.value)!==void 0&&l.length>(n==null?void 0:n.max.value)&&l.length>s.value.length,i.value===!1&&((u=n==null?void 0:n.changeEvent)==null||u.call(n,l))):(r(mt,l),e.value=l)}});return{model:s,isGroup:a,isLimitExceeded:i}},ck=(t,e,{model:r})=>{const n=o.inject(ua,void 0),a=o.ref(!1),i=o.computed(()=>oo(t.value)?t.label:t.value),s=o.computed(()=>{const d=r.value;return Qn(d)?d:At(d)?vt(i.value)?d.map(o.toRaw).some(f=>io(f,i.value)):d.map(o.toRaw).includes(i.value):d!=null?d===t.trueValue||d===t.trueLabel:!!d}),l=Nn(o.computed(()=>{var d;return(d=n==null?void 0:n.size)==null?void 0:d.value}),{prop:!0}),c=Nn(o.computed(()=>{var d;return(d=n==null?void 0:n.size)==null?void 0:d.value})),u=o.computed(()=>!!e.default||!oo(i.value));return{checkboxButtonSize:l,isChecked:s,isFocused:a,checkboxSize:c,hasOwnLabel:u,actualValue:i}},df=(t,e)=>{const{formItem:r}=Dn(),{model:n,isGroup:a,isLimitExceeded:i}=lk(t),{isFocused:s,isChecked:l,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,actualValue:f}=ck(t,e,{model:n}),{isDisabled:p}=ok({model:n,isChecked:l}),{inputId:v,isLabeledByFormItem:h}=ii(t,{formItemContext:r,disableIdGeneration:d,disableIdManagement:a}),{handleChange:g,onClickRoot:y}=sk(t,{model:n,isLimitExceeded:i,hasOwnLabel:d,isDisabled:p,isLabeledByFormItem:h});return(()=>{function b(){var w,C;At(n.value)&&!n.value.includes(f.value)?n.value.push(f.value):n.value=(C=(w=t.trueValue)!=null?w:t.trueLabel)!=null?C:!0}t.checked&&b()})(),uo({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&&oo(t.value))),uo({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)),uo({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:h,isChecked:l,isDisabled:p,isFocused:s,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,model:n,actualValue:f,handleChange:g,onClickRoot:y}},uk=o.defineComponent({name:"ElCheckbox"}),dk=o.defineComponent({...uk,props:cf,emits:uf,setup(t){const e=t,r=o.useSlots(),{inputId:n,isLabeledByFormItem:a,isChecked:i,isDisabled:s,isFocused:l,checkboxSize:c,hasOwnLabel:u,model:d,actualValue:f,handleChange:p,onClickRoot:v}=df(e,r),h=Be("checkbox"),g=o.computed(()=>[h.b(),h.m(c.value),h.is("disabled",s.value),h.is("bordered",e.border),h.is("checked",i.value)]),y=o.computed(()=>[h.e("input"),h.is("disabled",s.value),h.is("checked",i.value),h.is("indeterminate",e.indeterminate),h.is("focus",l.value)]);return(m,b)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(!o.unref(u)&&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,x,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(n),"onUpdate:modelValue":k=>o.isRef(d)?d.value=k:null,class:o.normalizeClass(o.unref(h).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=(x=m.falseValue)!=null?x:m.falseLabel)!=null?E:!1,onChange:o.unref(p),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(n),"onUpdate:modelValue":k=>o.isRef(d)?d.value=k:null,class:o.normalizeClass(o.unref(h).e("original")),type:"checkbox",indeterminate:m.indeterminate,disabled:o.unref(s),value:o.unref(f),name:m.name,tabindex:m.tabindex,onChange:o.unref(p),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(h).e("inner"))},null,2)],2),o.unref(u)?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(h).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 fk=Te(dk,[["__file","checkbox.vue"]]);const hk=o.defineComponent({name:"ElCheckboxButton"}),pk=o.defineComponent({...hk,props:cf,emits:uf,setup(t){const e=t,r=o.useSlots(),{isFocused:n,isChecked:a,isDisabled:i,checkboxButtonSize:s,model:l,actualValue:c,handleChange:u}=df(e,r),d=o.inject(ua,void 0),f=Be("checkbox"),p=o.computed(()=>{var h,g,y,m;const b=(g=(h=d==null?void 0:d.fill)==null?void 0:h.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",n.value)]);return(h,g)=>{var y,m,b,w;return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(o.unref(v))},[h.trueValue||h.falseValue||h.trueLabel||h.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:h.name,tabindex:h.tabindex,disabled:o.unref(i),"true-value":(m=(y=h.trueValue)!=null?y:h.trueLabel)!=null?m:!0,"false-value":(w=(b=h.falseValue)!=null?b:h.falseLabel)!=null?w:!1,onChange:o.unref(u),onFocus:C=>n.value=!0,onBlur:C=>n.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:h.name,tabindex:h.tabindex,disabled:o.unref(i),value:o.unref(c),onChange:o.unref(u),onFocus:C=>n.value=!0,onBlur:C=>n.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","value","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(l)]]),h.$slots.default||h.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(p):void 0)},[o.renderSlot(h.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(h.label),1)])],6)):o.createCommentVNode("v-if",!0)],2)}}});var ff=Te(pk,[["__file","checkbox-button.vue"]]);const vk=Fe({modelValue:{type:ke(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:sa,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...Qr(["ariaLabel"])}),gk={[mt]:t=>At(t),change:t=>At(t)},mk=o.defineComponent({name:"ElCheckboxGroup"}),yk=o.defineComponent({...mk,props:vk,emits:gk,setup(t,{emit:e}){const r=t,n=Be("checkbox"),{formItem:a}=Dn(),{inputId:i,isLabeledByFormItem:s}=ii(r,{formItemContext:a}),l=async u=>{e(mt,u),await o.nextTick(),e("change",u)},c=o.computed({get(){return r.modelValue},set(u){l(u)}});return o.provide(ua,{...Ku(o.toRefs(r),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:c,changeEvent:l}),o.watch(()=>r.modelValue,()=>{r.validateEvent&&(a==null||a.validate("change").catch(u=>tt(u)))}),(u,d)=>{var f;return o.openBlock(),o.createBlock(o.resolveDynamicComponent(u.tag),{id:o.unref(i),class:o.normalizeClass(o.unref(n).b("group")),role:"group","aria-label":o.unref(s)?void 0:u.ariaLabel||"checkbox-group","aria-labelledby":o.unref(s)?(f=o.unref(a))==null?void 0:f.labelId:void 0},{default:o.withCtx(()=>[o.renderSlot(u.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var hf=Te(yk,[["__file","checkbox-group.vue"]]);const bk=dt(fk,{CheckboxButton:ff,CheckboxGroup:hf});Mr(ff),Mr(hf);const Tl=Fe({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Zu},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),wk={close:t=>t instanceof MouseEvent,click:t=>t instanceof MouseEvent},Ck=o.defineComponent({name:"ElTag"}),kk=o.defineComponent({...Ck,props:Tl,emits:wk,setup(t,{emit:e}){const r=t,n=Nn(),a=Be("tag"),i=o.computed(()=>{const{type:u,hit:d,effect:f,closable:p,round:v}=r;return[a.b(),a.is("closable",p),a.m(u||"primary"),a.m(n.value),a.m(f),a.is("hit",d),a.is("round",v)]}),s=u=>{e("close",u)},l=u=>{e("click",u)},c=u=>{u.component.subTree.component.bum=null};return(u,d)=>u.disableTransitions?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle({backgroundColor:u.color}),onClick:l},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(a).e("content"))},[o.renderSlot(u.$slots,"default")],2),u.closable?(o.openBlock(),o.createBlock(o.unref(yt),{key:0,class:o.normalizeClass(o.unref(a).e("close")),onClick:o.withModifiers(s,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(lo))]),_: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:c},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle({backgroundColor:u.color}),onClick:l},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(a).e("content"))},[o.renderSlot(u.$slots,"default")],2),u.closable?(o.openBlock(),o.createBlock(o.unref(yt),{key:0,class:o.normalizeClass(o.unref(a).e("close")),onClick:o.withModifiers(s,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(lo))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var xk=Te(kk,[["__file","tag.vue"]]);const Ek=dt(xk),pf=Symbol("rowContextKey"),Sk=Fe({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"]}}),Tk=o.defineComponent({name:"ElRow"}),Bk=o.defineComponent({...Tk,props:Sk,setup(t){const e=t,r=Be("row"),n=o.computed(()=>e.gutter);o.provide(pf,{gutter:n});const a=o.computed(()=>{const s={};return e.gutter&&(s.marginRight=s.marginLeft=`-${e.gutter/2}px`),s}),i=o.computed(()=>[r.b(),r.is(`justify-${e.justify}`,e.justify!=="start"),r.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 Nk=Te(Bk,[["__file","row.vue"]]);const To=dt(Nk),Dk=Fe({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:()=>ea({})},sm:{type:ke([Number,Object]),default:()=>ea({})},md:{type:ke([Number,Object]),default:()=>ea({})},lg:{type:ke([Number,Object]),default:()=>ea({})},xl:{type:ke([Number,Object]),default:()=>ea({})}}),Pk=o.defineComponent({name:"ElCol"}),_k=o.defineComponent({...Pk,props:Dk,setup(t){const e=t,{gutter:r}=o.inject(pf,{gutter:o.computed(()=>0)}),n=Be("col"),a=o.computed(()=>{const s={};return r.value&&(s.paddingLeft=s.paddingRight=`${r.value/2}px`),s}),i=o.computed(()=>{const s=[];return["span","offset","pull","push"].forEach(u=>{const d=e[u];gt(d)&&(u==="span"?s.push(n.b(`${e[u]}`)):d>0&&s.push(n.b(`${u}-${e[u]}`)))}),["xs","sm","md","lg","xl"].forEach(u=>{gt(e[u])?s.push(n.b(`${u}-${e[u]}`)):vt(e[u])&&Object.entries(e[u]).forEach(([d,f])=>{s.push(d!=="span"?n.b(`${u}-${d}-${f}`):n.b(`${u}-${f}`))})}),r.value&&s.push(n.is("guttered")),[n.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 Ok=Te(_k,[["__file","col.vue"]]);const ci=dt(Ok),Ik=o.defineComponent({name:"ElCollapseTransition"}),Lk=o.defineComponent({...Ik,setup(t){const e=Be("collapse-transition"),r=a=>{a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom},n={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){r(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){r(a)},leaveCancelled(a){r(a)}};return(a,i)=>(o.openBlock(),o.createBlock(o.Transition,o.mergeProps({name:o.unref(e).b()},o.toHandlers(n)),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["name"]))}});var Mk=Te(Lk,[["__file","collapse-transition.vue"]]);const Fk=dt(Mk),Ak=Fe({color:{type:ke(Object),required:!0},vertical:{type:Boolean,default:!1}});let Bl=!1;function ui(t,e){if(!et)return;const r=function(i){var s;(s=e.drag)==null||s.call(e,i)},n=function(i){var s;document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",n),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",n),document.onselectstart=null,document.ondragstart=null,Bl=!1,(s=e.end)==null||s.call(e,i)},a=function(i){var s;Bl||(i.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",r),document.addEventListener("mouseup",n),document.addEventListener("touchmove",r),document.addEventListener("touchend",n),Bl=!0,(s=e.start)==null||s.call(e,i))};t.addEventListener("mousedown",a),t.addEventListener("touchstart",a,{passive:!1})}const Vk=t=>{const e=o.getCurrentInstance(),{t:r}=Ya(),n=o.shallowRef(),a=o.shallowRef(),i=o.computed(()=>t.color.get("alpha")),s=o.computed(()=>r("el.colorpicker.alphaLabel"));function l(f){var p;f.target!==n.value&&c(f),(p=n.value)==null||p.focus()}function c(f){if(!a.value||!n.value)return;const v=e.vnode.el.getBoundingClientRect(),{clientX:h,clientY:g}=Ps(f);if(t.vertical){let y=g-v.top;y=Math.max(n.value.offsetHeight/2,y),y=Math.min(y,v.height-n.value.offsetHeight/2),t.color.set("alpha",Math.round((y-n.value.offsetHeight/2)/(v.height-n.value.offsetHeight)*100))}else{let y=h-v.left;y=Math.max(n.value.offsetWidth/2,y),y=Math.min(y,v.width-n.value.offsetWidth/2),t.color.set("alpha",Math.round((y-n.value.offsetWidth/2)/(v.width-n.value.offsetWidth)*100))}}function u(f){const{code:p,shiftKey:v}=f,h=v?10:1;switch(p){case it.left:case it.down:f.preventDefault(),f.stopPropagation(),d(-h);break;case it.right:case it.up:f.preventDefault(),f.stopPropagation(),d(h);break}}function d(f){let p=i.value+f;p=p<0?0:p>100?100:p,t.color.set("alpha",p)}return{thumb:n,bar:a,alpha:i,alphaLabel:s,handleDrag:c,handleClick:l,handleKeydown:u}},Rk=(t,{bar:e,thumb:r,handleDrag:n})=>{const a=o.getCurrentInstance(),i=Be("color-alpha-slider"),s=o.ref(0),l=o.ref(0),c=o.ref();function u(){if(!r.value||t.vertical)return 0;const b=a.vnode.el,w=t.color.get("alpha");return b?Math.round(w*(b.offsetWidth-r.value.offsetWidth/2)/100):0}function d(){if(!r.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-r.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 p(){s.value=u(),l.value=d(),c.value=f()}o.onMounted(()=>{if(!e.value||!r.value)return;const b={drag:w=>{n(w)},end:w=>{n(w)}};ui(e.value,b),ui(r.value,b),p()}),o.watch(()=>t.color.get("alpha"),()=>p()),o.watch(()=>t.color.value,()=>p());const v=o.computed(()=>[i.b(),i.is("vertical",t.vertical)]),h=o.computed(()=>i.e("bar")),g=o.computed(()=>i.e("thumb")),y=o.computed(()=>({background:c.value})),m=o.computed(()=>({left:Jn(s.value),top:Jn(l.value)}));return{rootKls:v,barKls:h,barStyle:y,thumbKls:g,thumbStyle:m,update:p}},$k=o.defineComponent({name:"ElColorAlphaSlider"}),zk=o.defineComponent({...$k,props:Ak,setup(t,{expose:e}){const r=t,{alpha:n,alphaLabel:a,bar:i,thumb:s,handleDrag:l,handleClick:c,handleKeydown:u}=Vk(r),{rootKls:d,barKls:f,barStyle:p,thumbKls:v,thumbStyle:h,update:g}=Rk(r,{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(p)),onClick:o.unref(c)},null,14,["onClick"]),o.createElementVNode("div",{ref_key:"thumb",ref:s,class:o.normalizeClass(o.unref(v)),style:o.normalizeStyle(o.unref(h)),"aria-label":o.unref(a),"aria-valuenow":o.unref(n),"aria-orientation":y.vertical?"vertical":"horizontal","aria-valuemin":"0","aria-valuemax":"100",role:"slider",tabindex:"0",onKeydown:o.unref(u)},null,46,["aria-label","aria-valuenow","aria-orientation","onKeydown"])],2))}});var Hk=Te(zk,[["__file","alpha-slider.vue"]]);const Kk=o.defineComponent({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(t){const e=Be("color-hue-slider"),r=o.getCurrentInstance(),n=o.ref(),a=o.ref(),i=o.ref(0),s=o.ref(0),l=o.computed(()=>t.color.get("hue"));o.watch(()=>l.value,()=>{p()});function c(v){v.target!==n.value&&u(v)}function u(v){if(!a.value||!n.value)return;const g=r.vnode.el.getBoundingClientRect(),{clientX:y,clientY:m}=Ps(v);let b;if(t.vertical){let w=m-g.top;w=Math.min(w,g.height-n.value.offsetHeight/2),w=Math.max(n.value.offsetHeight/2,w),b=Math.round((w-n.value.offsetHeight/2)/(g.height-n.value.offsetHeight)*360)}else{let w=y-g.left;w=Math.min(w,g.width-n.value.offsetWidth/2),w=Math.max(n.value.offsetWidth/2,w),b=Math.round((w-n.value.offsetWidth/2)/(g.width-n.value.offsetWidth)*360)}t.color.set("hue",b)}function d(){if(!n.value)return 0;const v=r.vnode.el;if(t.vertical)return 0;const h=t.color.get("hue");return v?Math.round(h*(v.offsetWidth-n.value.offsetWidth/2)/360):0}function f(){if(!n.value)return 0;const v=r.vnode.el;if(!t.vertical)return 0;const h=t.color.get("hue");return v?Math.round(h*(v.offsetHeight-n.value.offsetHeight/2)/360):0}function p(){i.value=d(),s.value=f()}return o.onMounted(()=>{if(!a.value||!n.value)return;const v={drag:h=>{u(h)},end:h=>{u(h)}};ui(a.value,v),ui(n.value,v),p()}),{bar:a,thumb:n,thumbLeft:i,thumbTop:s,hueValue:l,handleClick:c,update:p,ns:e}}});function qk(t,e,r,n,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 Uk=Te(Kk,[["render",qk],["__file","hue-slider.vue"]]);const Gk=Fe({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:sa,popperClass:{type:String,default:""},tabindex:{type:[String,Number],default:0},teleported:$t.teleported,predefine:{type:ke(Array)},validateEvent:{type:Boolean,default:!0},...Qr(["ariaLabel"])}),Wk={[mt]:t=>St(t)||jr(t),[Xs]:t=>St(t)||jr(t),activeChange:t=>St(t)||jr(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent},vf=Symbol("colorPickerContextKey"),gf=function(t,e,r){return[t,e*r/((t=(2-e)*r)<1?t:2-t)||0,t/2]},jk=function(t){return typeof t=="string"&&t.includes(".")&&Number.parseFloat(t)===1},Yk=function(t){return typeof t=="string"&&t.includes("%")},da=function(t,e){jk(t)&&(t="100%");const r=Yk(t);return t=Math.min(e,Math.max(0,Number.parseFloat(`${t}`))),r&&(t=Number.parseInt(`${t*e}`,10)/100),Math.abs(t-e)<1e-6?1:t%e/Number.parseFloat(e)},mf={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},Bo=t=>{t=Math.min(Math.round(t),255);const e=Math.floor(t/16),r=t%16;return`${mf[e]||e}${mf[r]||r}`},yf=function({r:t,g:e,b:r}){return Number.isNaN(+t)||Number.isNaN(+e)||Number.isNaN(+r)?"":`#${Bo(t)}${Bo(e)}${Bo(r)}`},Nl={A:10,B:11,C:12,D:13,E:14,F:15},_n=function(t){return t.length===2?(Nl[t[0].toUpperCase()]||+t[0])*16+(Nl[t[1].toUpperCase()]||+t[1]):Nl[t[1].toUpperCase()]||+t[1]},Zk=function(t,e,r){e=e/100,r=r/100;let n=e;const a=Math.max(r,.01);r*=2,e*=r<=1?r:2-r,n*=a<=1?a:2-a;const i=(r+e)/2,s=r===0?2*n/(a+n):2*e/(r+e);return{h:t,s:s*100,v:i*100}},bf=(t,e,r)=>{t=da(t,255),e=da(e,255),r=da(r,255);const n=Math.max(t,e,r),a=Math.min(t,e,r);let i;const s=n,l=n-a,c=n===0?0:l/n;if(n===a)i=0;else{switch(n){case t:{i=(e-r)/l+(e<r?6:0);break}case e:{i=(r-t)/l+2;break}case r:{i=(t-e)/l+4;break}}i/=6}return{h:i*360,s:c*100,v:s*100}},di=function(t,e,r){t=da(t,360)*6,e=da(e,100),r=da(r,100);const n=Math.floor(t),a=t-n,i=r*(1-e),s=r*(1-a*e),l=r*(1-(1-a)*e),c=n%6,u=[r,s,i,i,l,r][c],d=[l,r,r,s,i,i][c],f=[i,i,l,r,r,s][c];return{r:Math.round(u*255),g:Math.round(d*255),b:Math.round(f*255)}};class fi{constructor(e={}){this._hue=0,this._saturation=100,this._value=100,this._alpha=100,this.enableAlpha=!1,this.format="hex",this.value="";for(const r in e)wn(e,r)&&(this[r]=e[r]);e.value?this.fromString(e.value):this.doOnChange()}set(e,r){if(arguments.length===1&&typeof e=="object"){for(const n in e)wn(e,n)&&this.set(n,e[n]);return}this[`_${e}`]=r,this.doOnChange()}get(e){return e==="alpha"?Math.floor(this[`_${e}`]):this[`_${e}`]}toRgb(){return di(this._hue,this._saturation,this._value)}fromString(e){if(!e){this._hue=0,this._saturation=100,this._value=100,this.doOnChange();return}const r=(n,a,i)=>{this._hue=Math.max(0,Math.min(360,n)),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 n=e.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));if(n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3){const{h:a,s:i,v:s}=Zk(n[0],n[1],n[2]);r(a,i,s)}}else if(e.includes("hsv")){const n=e.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3&&r(n[0],n[1],n[2])}else if(e.includes("rgb")){const n=e.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));if(n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3){const{h:a,s:i,v:s}=bf(n[0],n[1],n[2]);r(a,i,s)}}else if(e.includes("#")){const n=e.replace("#","").trim();if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(n))return;let a,i,s;n.length===3?(a=_n(n[0]+n[0]),i=_n(n[1]+n[1]),s=_n(n[2]+n[2])):(n.length===6||n.length===8)&&(a=_n(n.slice(0,2)),i=_n(n.slice(2,4)),s=_n(n.slice(4,6))),n.length===8?this._alpha=_n(n.slice(6))/255*100:(n.length===3||n.length===6)&&(this._alpha=100);const{h:l,s:c,v:u}=bf(a,i,s);r(l,c,u)}}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:r,_value:n,_alpha:a,format:i}=this;if(this.enableAlpha)switch(i){case"hsl":{const s=gf(e,r/100,n/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(r)}%, ${Math.round(n)}%, ${this.get("alpha")/100})`;break}case"hex":{this.value=`${yf(di(e,r,n))}${Bo(a*255/100)}`;break}default:{const{r:s,g:l,b:c}=di(e,r,n);this.value=`rgba(${s}, ${l}, ${c}, ${this.get("alpha")/100})`}}else switch(i){case"hsl":{const s=gf(e,r/100,n/100);this.value=`hsl(${e}, ${Math.round(s[1]*100)}%, ${Math.round(s[2]*100)}%)`;break}case"hsv":{this.value=`hsv(${e}, ${Math.round(r)}%, ${Math.round(n)}%)`;break}case"rgb":{const{r:s,g:l,b:c}=di(e,r,n);this.value=`rgb(${s}, ${l}, ${c})`;break}default:this.value=yf(di(e,r,n))}}}const Xk=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:r}=o.inject(vf),n=o.ref(i(t.colors,t.color));o.watch(()=>r.value,s=>{const l=new fi;l.fromString(s),n.value.forEach(c=>{c.selected=l.compare(c)})}),o.watchEffect(()=>{n.value=i(t.colors,t.color)});function a(s){t.color.fromString(t.colors[s])}function i(s,l){return s.map(c=>{const u=new fi;return u.enableAlpha=t.enableAlpha,u.format="rgba",u.fromString(c),u.selected=u.value===l.value,u})}return{rgbaColors:n,handleSelect:a,ns:e}}});function Qk(t,e,r,n,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:c=>t.handleSelect(l)},[o.createElementVNode("div",{style:o.normalizeStyle({backgroundColor:s.value})},null,4)],10,["onClick"]))),128))],2)],2)}var Jk=Te(Xk,[["render",Qk],["__file","predefine.vue"]]);const ex=o.defineComponent({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(t){const e=Be("color-svpanel"),r=o.getCurrentInstance(),n=o.ref(0),a=o.ref(0),i=o.ref("hsl(0, 100%, 50%)"),s=o.computed(()=>{const u=t.color.get("hue"),d=t.color.get("value");return{hue:u,value:d}});function l(){const u=t.color.get("saturation"),d=t.color.get("value"),f=r.vnode.el,{clientWidth:p,clientHeight:v}=f;a.value=u*p/100,n.value=(100-d)*v/100,i.value=`hsl(${t.color.get("hue")}, 100%, 50%)`}function c(u){const f=r.vnode.el.getBoundingClientRect(),{clientX:p,clientY:v}=Ps(u);let h=p-f.left,g=v-f.top;h=Math.max(0,h),h=Math.min(h,f.width),g=Math.max(0,g),g=Math.min(g,f.height),a.value=h,n.value=g,t.color.set({saturation:h/f.width*100,value:100-g/f.height*100})}return o.watch(()=>s.value,()=>{l()}),o.onMounted(()=>{ui(r.vnode.el,{drag:u=>{c(u)},end:u=>{c(u)}}),l()}),{cursorTop:n,cursorLeft:a,background:i,colorValue:s,handleDrag:c,update:l,ns:e}}});function tx(t,e,r,n,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 rx=Te(ex,[["render",tx],["__file","sv-panel.vue"]]);const nx=o.defineComponent({name:"ElColorPicker"}),ax=o.defineComponent({...nx,props:Gk,emits:Wk,setup(t,{expose:e,emit:r}){const n=t,{t:a}=Ya(),i=Be("color"),{formItem:s}=Dn(),l=Nn(),c=ai(),{inputId:u,isLabeledByFormItem:d}=ii(n,{formItemContext:s}),f=o.ref(),p=o.ref(),v=o.ref(),h=o.ref(),g=o.ref(),y=o.ref(),{isFocused:m,handleFocus:b,handleBlur:w}=cl(g,{beforeFocus(){return c.value},beforeBlur(A){var K;return(K=h.value)==null?void 0:K.isFocusInsideContent(A)},afterBlur(){F(!1),V()}});let C=!0;const x=o.reactive(new fi({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue})),E=o.ref(!1),k=o.ref(!1),B=o.ref(""),S=o.computed(()=>!n.modelValue&&!k.value?"transparent":_(x,n.showAlpha)),N=o.computed(()=>!n.modelValue&&!k.value?"":x.value),D=o.computed(()=>d.value?void 0:n.ariaLabel||a("el.colorpicker.defaultLabel")),P=o.computed(()=>d.value?s==null?void 0:s.labelId:void 0),I=o.computed(()=>[i.b("picker"),i.is("disabled",c.value),i.bm("picker",l.value),i.is("focused",m.value)]);function _(A,K){if(!(A instanceof fi))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=Hu(F,100,{leading:!0});function M(){c.value||F(!0)}function L(){O(!1),V()}function V(){o.nextTick(()=>{n.modelValue?x.fromString(n.modelValue):(x.value="",o.nextTick(()=>{k.value=!1}))})}function H(){c.value||O(!E.value)}function $(){x.fromString(B.value)}function z(){const A=x.value;r(mt,A),r("change",A),n.validateEvent&&(s==null||s.validate("change").catch(K=>tt(K))),O(!1),o.nextTick(()=>{const K=new fi({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue});x.compare(K)||V()})}function j(){O(!1),r(mt,null),r("change",null),n.modelValue!==null&&n.validateEvent&&(s==null||s.validate("change").catch(A=>tt(A))),V()}function ee(){E.value&&(L(),m.value&&re())}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 re(){g.value.focus()}function Y(){g.value.blur()}return o.onMounted(()=>{n.modelValue&&(B.value=N.value)}),o.watch(()=>n.modelValue,A=>{A?A&&A!==x.value&&(C=!1,x.fromString(A)):k.value=!1}),o.watch(()=>[n.colorFormat,n.showAlpha],()=>{x.enableAlpha=n.showAlpha,x.format=n.colorFormat||x.format,x.doOnChange(),r(mt,x.value)}),o.watch(()=>N.value,A=>{B.value=A,C&&r("activeChange",A),C=!0}),o.watch(()=>x.value,()=>{!n.modelValue&&!k.value&&(k.value=!0)}),o.watch(()=>E.value,()=>{o.nextTick(()=>{var A,K,W;(A=f.value)==null||A.update(),(K=p.value)==null||K.update(),(W=v.value)==null||W.update()})}),o.provide(vf,{currentColor:N}),e({color:x,show:M,hide:L,focus:re,blur:Y}),(A,K)=>(o.openBlock(),o.createBlock(o.unref(li),{ref_key:"popper",ref:h,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(Uk,{ref_key:"hue",ref:f,class:"hue-slider",color:o.unref(x),vertical:""},null,8,["color"]),o.createVNode(rx,{ref_key:"sv",ref:p,color:o.unref(x)},null,8,["color"])],2),A.showAlpha?(o.openBlock(),o.createBlock(Hk,{key:0,ref_key:"alpha",ref:v,color:o.unref(x)},null,8,["color"])):o.createCommentVNode("v-if",!0),A.predefine?(o.openBlock(),o.createBlock(Jk,{key:1,ref:"predefine","enable-alpha":A.showAlpha,color:o.unref(x),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(oi),{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(sr),{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(sr),{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(lf),ee]])]),default:o.withCtx(()=>[o.createElementVNode("div",o.mergeProps({id:o.unref(u),ref_key:"triggerRef",ref:g},A.$attrs,{class:o.unref(I),role:"button","aria-label":o.unref(D),"aria-labelledby":o.unref(P),"aria-description":o.unref(a)("el.colorpicker.description",{color:A.modelValue||""}),"aria-disabled":o.unref(c),tabindex:o.unref(c)?-1:A.tabindex,onKeydown:X,onFocus:o.unref(b),onBlur:o.unref(w)}),[o.unref(c)?(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(yt),{class:o.normalizeClass([o.unref(i).be("picker","icon"),o.unref(i).is("icon-arrow-down")])},{default:o.withCtx(()=>[o.createVNode(o.unref(so))]),_:1},8,["class"]),[[o.vShow,A.modelValue||k.value]]),o.withDirectives(o.createVNode(o.unref(yt),{class:o.normalizeClass([o.unref(i).be("picker","empty"),o.unref(i).is("icon-close")])},{default:o.withCtx(()=>[o.createVNode(o.unref(lo))]),_: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 ix=Te(ax,[["__file","color-picker.vue"]]);const ox=dt(ix),sx=o.defineComponent({name:"ElContainer"}),lx=o.defineComponent({...sx,props:{direction:{type:String}},setup(t){const e=t,r=o.useSlots(),n=Be("container"),a=o.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:r&&r.default?r.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(n).b(),o.unref(n).is("vertical",o.unref(a))])},[o.renderSlot(i.$slots,"default")],2))}});var cx=Te(lx,[["__file","container.vue"]]);const ux=o.defineComponent({name:"ElAside"}),dx=o.defineComponent({...ux,props:{width:{type:String,default:null}},setup(t){const e=t,r=Be("aside"),n=o.computed(()=>e.width?r.cssVarBlock({width:e.width}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("aside",{class:o.normalizeClass(o.unref(r).b()),style:o.normalizeStyle(o.unref(n))},[o.renderSlot(a.$slots,"default")],6))}});var wf=Te(dx,[["__file","aside.vue"]]);const fx=o.defineComponent({name:"ElFooter"}),hx=o.defineComponent({...fx,props:{height:{type:String,default:null}},setup(t){const e=t,r=Be("footer"),n=o.computed(()=>e.height?r.cssVarBlock({height:e.height}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("footer",{class:o.normalizeClass(o.unref(r).b()),style:o.normalizeStyle(o.unref(n))},[o.renderSlot(a.$slots,"default")],6))}});var Cf=Te(hx,[["__file","footer.vue"]]);const px=o.defineComponent({name:"ElHeader"}),vx=o.defineComponent({...px,props:{height:{type:String,default:null}},setup(t){const e=t,r=Be("header"),n=o.computed(()=>e.height?r.cssVarBlock({height:e.height}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("header",{class:o.normalizeClass(o.unref(r).b()),style:o.normalizeStyle(o.unref(n))},[o.renderSlot(a.$slots,"default")],6))}});var kf=Te(vx,[["__file","header.vue"]]);const gx=o.defineComponent({name:"ElMain"}),mx=o.defineComponent({...gx,setup(t){const e=Be("main");return(r,n)=>(o.openBlock(),o.createElementBlock("main",{class:o.normalizeClass(o.unref(e).b())},[o.renderSlot(r.$slots,"default")],2))}});var xf=Te(mx,[["__file","main.vue"]]);const Ef=dt(cx,{Aside:wf,Footer:Cf,Header:kf,Main:xf});Mr(wf),Mr(Cf);const Sf=Mr(kf),Dl=Mr(xf),yx=o.defineComponent({inheritAttrs:!1});function bx(t,e,r,n,a,i){return o.renderSlot(t.$slots,"default")}var wx=Te(yx,[["render",bx],["__file","collection.vue"]]);const Cx=o.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function kx(t,e,r,n,a,i){return o.renderSlot(t.$slots,"default")}var xx=Te(Cx,[["render",kx],["__file","collection-item.vue"]]);const Ex="data-el-collection-item",Sx=t=>{const e=`El${t}Collection`,r=`${e}Item`,n=Symbol(e),a=Symbol(r),i={...wx,name:e,setup(){const l=o.ref(null),c=new Map,u=()=>{const d=o.unref(l);if(!d)return[];const f=Array.from(d.querySelectorAll(`[${Ex}]`));return[...c.values()].sort((v,h)=>f.indexOf(v.ref)-f.indexOf(h.ref))};o.provide(n,{itemMap:c,getItems:u,collectionRef:l})}},s={...xx,name:r,setup(l,{attrs:c}){const u=o.ref(null),d=o.inject(n,void 0);o.provide(a,{collectionItemRef:u}),o.onMounted(()=>{const f=o.unref(u);f&&d.itemMap.set(f,{ref:f,...c})}),o.onBeforeUnmount(()=>{const f=o.unref(u);d.itemMap.delete(f)})}};return{COLLECTION_INJECTION_KEY:n,COLLECTION_ITEM_INJECTION_KEY:a,ElCollection:i,ElCollectionItem:s}},Pl=Fe({trigger:si.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});Fe({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:Zr}}),Fe({onKeydown:{type:ke(Function)}}),Sx("Dropdown");const Tf=Symbol("ElSelectGroup"),hi=Symbol("ElSelect");function Tx(t,e){const r=o.inject(hi),n=o.inject(Tf,{disabled:!1}),a=o.computed(()=>d(Gr(r.props.modelValue),t.value)),i=o.computed(()=>{var v;if(r.props.multiple){const h=Gr((v=r.props.modelValue)!=null?v:[]);return!a.value&&h.length>=r.props.multipleLimit&&r.props.multipleLimit>0}else return!1}),s=o.computed(()=>t.label||(vt(t.value)?"":t.value)),l=o.computed(()=>t.value||t.label||""),c=o.computed(()=>t.disabled||e.groupDisabled||i.value),u=o.getCurrentInstance(),d=(v=[],h)=>{if(vt(t.value)){const g=r.props.valueKey;return v&&v.some(y=>o.toRaw(Ir(y,g))===Ir(h,g))}else return v&&v.includes(h)},f=()=>{!t.disabled&&!n.disabled&&(r.states.hoveringIndex=r.optionsArray.indexOf(u.proxy))},p=v=>{const h=new RegExp($1(v),"i");e.visible=h.test(s.value)||t.created};return o.watch(()=>s.value,()=>{!t.created&&!r.props.remote&&r.setSelected()}),o.watch(()=>t.value,(v,h)=>{const{remote:g,valueKey:y}=r.props;if(v!==h&&(r.onOptionDestroy(h,u.proxy),r.onOptionCreate(u.proxy)),!t.created&&!g){if(y&&vt(v)&&vt(h)&&v[y]===h[y])return;r.setSelected()}}),o.watch(()=>n.disabled,()=>{e.groupDisabled=n.disabled},{immediate:!0}),{select:r,currentLabel:s,currentValue:l,itemSelected:a,isDisabled:c,hoverItem:f,updateOption:p}}const Bx=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"),r=yo(),n=o.computed(()=>[e.be("dropdown","item"),e.is("disabled",o.unref(l)),e.is("selected",o.unref(s)),e.is("hovering",o.unref(p))]),a=o.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:i,itemSelected:s,isDisabled:l,select:c,hoverItem:u,updateOption:d}=Tx(t,a),{visible:f,hover:p}=o.toRefs(a),v=o.getCurrentInstance().proxy;c.onOptionCreate(v),o.onBeforeUnmount(()=>{const g=v.value,{selected:y}=c.states,b=(c.props.multiple?y:[y]).some(w=>w.value===v.value);o.nextTick(()=>{c.states.cachedOptions.get(g)===v&&!b&&c.states.cachedOptions.delete(g)}),c.onOptionDestroy(g,v)});function h(){l.value||c.handleOptionSelect(v)}return{ns:e,id:r,containerKls:n,currentLabel:i,itemSelected:s,isDisabled:l,select:c,hoverItem:u,updateOption:d,visible:f,hover:p,selectOptionClick:h,states:a}}});function Nx(t,e,r,n,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 _l=Te(Bx,[["render",Nx],["__file","option.vue"]]);const Dx=o.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const t=o.inject(hi),e=Be("select"),r=o.computed(()=>t.props.popperClass),n=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(),Pr(t.selectRef,s)}),{ns:e,minWidth:i,popperClass:r,isMultiple:n,isFitInputWidth:a}}});function Px(t,e,r,n,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 _x=Te(Dx,[["render",Px],["__file","select-dropdown.vue"]]);const Ox=11,Ix=(t,e)=>{const{t:r}=Ya(),n=yo(),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),c=o.ref(null),u=o.ref(null),d=o.ref(null),f=o.ref(null),p=o.ref(null),v=o.ref(null),h=o.ref(null),g=o.ref(null),y=o.ref(null),m=o.ref(null),b=o.ref(null),{isComposing:w,handleCompositionStart:C,handleCompositionUpdate:x,handleCompositionEnd:E}=Id({afterComposition:q=>Q(q)}),{wrapperRef:k,isFocused:B}=cl(f,{beforeFocus(){return O.value},afterFocus(){t.automaticDropdown&&!S.value&&(S.value=!0,s.menuVisibleOnFocus=!0)},beforeBlur(q){var ce,_e;return((ce=u.value)==null?void 0:ce.isFocusInsideContent(q))||((_e=d.value)==null?void 0:_e.isFocusInsideContent(q))},afterBlur(){S.value=!1,s.menuVisibleOnFocus=!1}}),S=o.ref(!1),N=o.ref(),{form:D,formItem:P}=Dn(),{inputId:I}=ii(t,{formItemContext:P}),{valueOnClear:_,isEmptyValue:F}=t2(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(()=>(P==null?void 0:P.validateState)||""),z=o.computed(()=>Yu[$.value]),j=o.computed(()=>t.remote?300:0),ee=o.computed(()=>t.loading?t.loadingText||r("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||r("el.select.noMatch"):s.options.size===0?t.noDataText||r("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(_e=>{const He=q.findIndex(Nr=>Nr.value===_e);He>-1&&ce.push(q[He])}),ce.length>=q.length?ce:q}),re=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=Nn(),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&&!Yr(t.modelValue))return Gr(t.modelValue).length===0&&!s.inputValue;const q=At(t.modelValue)?t.modelValue[0]:t.modelValue;return t.filterable||Yr(q)?!s.inputValue:!0}),ne=o.computed(()=>{var q;const ce=(q=t.placeholder)!=null?q:r("el.select.placeholder");return t.multiple||!M.value?ce:s.selectedLabel}),se=o.computed(()=>Ds?null:"mouseenter");o.watch(()=>t.modelValue,(q,ce)=>{t.multiple&&t.filterable&&!t.reserveKeyword&&(s.inputValue="",ue("")),de(),!io(q,ce)&&t.validateEvent&&(P==null||P.validate("change").catch(_e=>tt(_e)))},{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&&!Yr(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=>{gt(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),_e=q[0];s.hoveringIndex=ge(X.value,ce||_e)},de=()=>{if(t.multiple)s.selectedLabel="";else{const ce=At(t.modelValue)?t.modelValue[0]:t.modelValue,_e=me(ce);s.selectedLabel=_e.currentLabel,s.selected=[_e];return}const q=[];Yr(t.modelValue)||Gr(t.modelValue).forEach(ce=>{q.push(me(ce))}),s.selected=q},me=q=>{let ce;const _e=_s(q).toLowerCase()==="object",He=_s(q).toLowerCase()==="null",Nr=_s(q).toLowerCase()==="undefined";for(let qr=s.cachedOptions.size-1;qr>=0;qr--){const rr=re.value[qr];if(_e?Ir(rr.value,t.valueKey)===Ir(q,t.valueKey):rr.value===q){ce={value:q,currentLabel:rr.currentLabel,get isDisabled(){return rr.isDisabled}};break}}if(ce)return ce;const yn=_e?q.label:!He&&!Nr?q:"";return{value:q,currentLabel:yn}},Ne=()=>{s.hoveringIndex=X.value.findIndex(q=>s.selected.some(ce=>Ot(ce)===Ot(q)))},De=()=>{s.selectionWidth=c.value.getBoundingClientRect().width},Ee=()=>{s.calculatorWidth=p.value.getBoundingClientRect().width},Pe=()=>{s.collapseItemWidth=m.value.getBoundingClientRect().width},te=()=>{var q,ce;(ce=(q=u.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=Hu(()=>{R()},j.value),U=q=>{io(t.modelValue,q)||e(Xs,q)},ie=q=>L1(q,ce=>!s.disabledOptions.has(ce)),Z=q=>{if(t.multiple&&q.code!==it.delete&&q.target.value.length<=0){const ce=Gr(t.modelValue).slice(),_e=ie(ce);if(_e<0)return;const He=ce[_e];ce.splice(_e,1),e(mt,ce),U(ce),e("remove-tag",He)}},ae=(q,ce)=>{const _e=s.selected.indexOf(ce);if(_e>-1&&!O.value){const He=Gr(t.modelValue).slice();He.splice(_e,1),e(mt,He),U(He),e("remove-tag",ce.value)}q.stopPropagation(),rt()},we=q=>{q.stopPropagation();const ce=t.multiple?[]:_.value;if(t.multiple)for(const _e of s.selected)_e.isDisabled&&ce.push(_e.value);e(mt,ce),U(ce),s.hoveringIndex=-1,S.value=!1,e("clear"),rt()},Ce=q=>{var ce;if(t.multiple){const _e=Gr((ce=t.modelValue)!=null?ce:[]).slice(),He=ge(_e,q.value);He>-1?_e.splice(He,1):(t.multipleLimit<=0||_e.length<t.multipleLimit)&&_e.push(q.value),e(mt,_e),U(_e),q.created&&ue(""),t.filterable&&!t.reserveKeyword&&(s.inputValue="")}else e(mt,q.value),U(q.value),S.value=!1;rt(),!S.value&&o.nextTick(()=>{Se(q)})},ge=(q=[],ce)=>{if(!vt(ce))return q.indexOf(ce);const _e=t.valueKey;let He=-1;return q.some((Nr,yn)=>o.toRaw(Ir(Nr,_e))===Ir(ce,_e)?(He=yn,!0):!1),He},Se=q=>{var ce,_e,He,Nr,yn;const za=At(q)?q[0]:q;let qr=null;if(za!=null&&za.value){const rr=X.value.filter(bn=>bn.value===za.value);rr.length>0&&(qr=rr[0].$el)}if(u.value&&qr){const rr=(Nr=(He=(_e=(ce=u.value)==null?void 0:ce.popperRef)==null?void 0:_e.contentRef)==null?void 0:He.querySelector)==null?void 0:Nr.call(He,`.${a.be("dropdown","wrap")}`);rr&&K1(rr,qr)}(yn=b.value)==null||yn.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=u.value)==null?void 0:q.popperRef)==null?void 0:ce.contentRef}),$e=()=>{s.isBeforeHide=!1,o.nextTick(()=>Se(s.selected))},rt=()=>{var q;(q=f.value)==null||q.focus()},nt=()=>{var q;(q=f.value)==null||q.blur()},Qe=q=>{we(q)},_t=()=>{S.value=!1,B.value&&nt()},ut=()=>{s.inputValue.length>0?s.inputValue="":S.value=!1},ht=()=>{O.value||(Ds&&(s.inputHovering=!0),s.menuVisibleOnFocus?s.menuVisibleOnFocus=!1:S.value=!S.value)},Wt=()=>{S.value?X.value[s.hoveringIndex]&&Ce(X.value[s.hoveringIndex]):ht()},Ot=q=>vt(q.value)?Ir(q.value,t.valueKey):q.value,It=o.computed(()=>X.value.filter(q=>q.visible).every(q=>q.disabled)),tr=o.computed(()=>t.multiple?t.collapseTags?s.selected.slice(0,t.maxCollapseTags):s.selected:[]),hr=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(!c.value)return 0;const q=window.getComputedStyle(c.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`}}),pt=o.computed(()=>({maxWidth:`${s.selectionWidth}px`})),mn=o.computed(()=>({width:`${Math.max(s.calculatorWidth,Ox)}px`}));return Pr(c,De),Pr(p,Ee),Pr(g,te),Pr(k,te),Pr(y,T),Pr(m,Pe),o.onMounted(()=>{de()}),{inputId:I,contentId:n,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:ne,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:x,handleCompositionEnd:E,onOptionCreate:ve,onOptionDestroy:ye,handleMenuEnter:$e,focus:rt,blur:nt,handleClearClick:Qe,handleClickOutside:_t,handleEsc:ut,toggleMenu:ht,selectOption:Wt,getValueKey:Ot,navigateOptions:Kt,dropdownMenuVisible:oe,showTagList:tr,collapseTagList:hr,tagStyle:at,collapseTagStyle:pt,inputStyle:mn,popperRef:Ge,inputRef:f,tooltipRef:u,tagTooltipRef:d,calculatorRef:p,prefixRef:v,suffixRef:h,selectRef:l,wrapperRef:k,selectionRef:c,scrollbarRef:b,menuRef:g,tagMenuRef:y,collapseItemRef:m}};var Lx=o.defineComponent({name:"ElOptions",setup(t,{slots:e}){const r=o.inject(hi);let n=[];return()=>{var a,i;const s=(a=e.default)==null?void 0:a.call(e),l=[];function c(u){At(u)&&u.forEach(d=>{var f,p,v,h;const g=(f=(d==null?void 0:d.type)||{})==null?void 0:f.name;g==="ElOptionGroup"?c(!St(d.children)&&!At(d.children)&&Lt((p=d.children)==null?void 0:p.default)?(v=d.children)==null?void 0:v.default():d.children):g==="ElOption"?l.push((h=d.props)==null?void 0:h.value):At(d.children)&&c(d.children)})}return s.length&&c((i=s[0])==null?void 0:i.children),io(l,n)||(n=l,r&&(r.states.optionValues=l)),s}}});const Mx=Fe({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:sa,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:Zr,default:Ys},fitInputWidth:Boolean,suffixIcon:{type:Zr,default:so},tagType:{...Tl.type,default:"info"},tagEffect:{...Tl.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:ke(String),values:ho,default:"bottom-start"},fallbackPlacements:{type:ke(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...e2,...Qr(["ariaLabel"])}),Bf="ElSelect",Fx=o.defineComponent({name:Bf,componentName:Bf,components:{ElSelectMenu:_x,ElOption:_l,ElOptions:Lx,ElTag:Ek,ElScrollbar:D2,ElTooltip:li,ElIcon:yt},directives:{ClickOutside:lf},props:Mx,emits:[mt,Xs,"remove-tag","clear","visible-change","focus","blur"],setup(t,{emit:e}){const r=o.computed(()=>{const{modelValue:i,multiple:s}=t,l=s?[]:void 0;return At(i)?s?i:l:s?l:i}),n=o.reactive({...o.toRefs(t),modelValue:r}),a=Ix(n,e);return o.provide(hi,o.reactive({props:n,states:a.states,optionsArray:a.optionsArray,handleOptionSelect:a.handleOptionSelect,onOptionCreate:a.onOptionCreate,onOptionDestroy:a.onOptionDestroy,selectRef:a.selectRef,setSelected:a.setSelected})),{...a,modelValue:r}}});function Ax(t,e,r,n,a,i){const s=o.resolveComponent("el-tag"),l=o.resolveComponent("el-tooltip"),c=o.resolveComponent("el-icon"),u=o.resolveComponent("el-option"),d=o.resolveComponent("el-options"),f=o.resolveComponent("el-scrollbar"),p=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)]:h=>t.states.inputHovering=!0,onMouseleave:h=>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:h=>t.states.isBeforeHide=!1},{default:o.withCtx(()=>{var h;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":((h=t.hoverOption)==null?void 0:h.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(c,{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(c,{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(c,{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(p,{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(u,{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 Vx=Te(Fx,[["render",Ax],["__file","select.vue"]]);const Rx=o.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(t){const e=Be("select"),r=o.ref(null),n=o.getCurrentInstance(),a=o.ref([]);o.provide(Tf,o.reactive({...o.toRefs(t)}));const i=o.computed(()=>a.value.some(u=>u.visible===!0)),s=u=>{var d,f;return((d=u.type)==null?void 0:d.name)==="ElOption"&&!!((f=u.component)!=null&&f.proxy)},l=u=>{const d=Gr(u),f=[];return d.forEach(p=>{var v,h;s(p)?f.push(p.component.proxy):(v=p.children)!=null&&v.length?f.push(...l(p.children)):(h=p.component)!=null&&h.subTree&&f.push(...l(p.component.subTree))}),f},c=()=>{a.value=l(n.subTree)};return o.onMounted(()=>{c()}),Fg(r,c,{attributes:!0,subtree:!0,childList:!0}),{groupRef:r,visible:i,ns:e}}});function $x(t,e,r,n,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 Nf=Te(Rx,[["render",$x],["__file","option-group.vue"]]);const zx=dt(Vx,{Option:_l,OptionGroup:Nf}),Hx=Mr(_l);Mr(Nf);const Kx=Fe({trigger:si.trigger,placement:Pl.placement,disabled:si.disabled,visible:$t.visible,transition:$t.transition,popperOptions:Pl.popperOptions,tabindex:Pl.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}}),qx={"update:visible":t=>Qn(t),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},Ux="onUpdate:visible",Gx=o.defineComponent({name:"ElPopover"}),Wx=o.defineComponent({...Gx,props:Kx,emits:qx,setup(t,{expose:e,emit:r}){const n=t,a=o.computed(()=>n[Ux]),i=Be("popover"),s=o.ref(),l=o.computed(()=>{var y;return(y=o.unref(s))==null?void 0:y.popperRef}),c=o.computed(()=>[{width:Jn(n.width)},n.popperStyle]),u=o.computed(()=>[i.b(),n.popperClass,{[i.m("plain")]:!!n.content}]),d=o.computed(()=>n.transition===`${i.namespace.value}-fade-in-linear`),f=()=>{var y;(y=s.value)==null||y.hide()},p=()=>{r("before-enter")},v=()=>{r("before-leave")},h=()=>{r("after-enter")},g=()=>{r("update:visible",!1),r("after-leave")};return e({popperRef:l,hide:f}),(y,m)=>(o.openBlock(),o.createBlock(o.unref(li),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(u),"popper-style":o.unref(c),teleported:y.teleported,persistent:y.persistent,"gpu-acceleration":o.unref(d),"onUpdate:visible":o.unref(a),onBeforeShow:p,onBeforeHide:v,onShow:h,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 jx=Te(Wx,[["__file","popover.vue"]]);const Df=(t,e)=>{const r=e.arg||e.value,n=r==null?void 0:r.popperRef;n&&(n.triggerRef=t)};var Yx={mounted(t,e){Df(t,e)},updated(t,e){Df(t,e)}};const Zx=Eb(Yx,"popover"),Ol=dt(jx,{directive:Zx}),fa="$treeNodeId",Pf=function(t,e){!e||e[fa]||Object.defineProperty(e,fa,{value:t.id,enumerable:!1,configurable:!1,writable:!1})},Il=function(t,e){return t?e[t]:e[fa]},Ll=(t,e,r)=>{const n=t.value.currentNode;r();const a=t.value.currentNode;n!==a&&e("current-change",a?a.data:null,a)},Ml=t=>{let e=!0,r=!0,n=!0;for(let a=0,i=t.length;a<i;a++){const s=t[a];(s.checked!==!0||s.indeterminate)&&(e=!1,s.disabled||(n=!1)),(s.checked!==!1||s.indeterminate)&&(r=!1)}return{all:e,none:r,allWithoutDisable:n,half:!e&&!r}},pi=function(t){if(t.childNodes.length===0||t.loading)return;const{all:e,none:r,half:n}=Ml(t.childNodes);e?(t.checked=!0,t.indeterminate=!1):n?(t.checked=!1,t.indeterminate=!0):r&&(t.checked=!1,t.indeterminate=!1);const a=t.parent;!a||a.level===0||t.store.checkStrictly||pi(a)},No=function(t,e){const r=t.store.props,n=t.data||{},a=r[e];if(typeof a=="function")return a(n,t);if(typeof a=="string")return n[a];if(typeof a>"u"){const i=n[e];return i===void 0?"":i}};let Xx=0;class On{constructor(e){this.id=Xx++,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 r in e)wn(e,r)&&(this[r]=e[r]);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 r=e.props;if(r&&typeof r.isLeaf<"u"){const i=No(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)||Pf(this,this.data),!this.data)return;const n=e.defaultExpandedKeys,a=e.key;a&&n&&n.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)||Pf(this,e),this.data=e,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=No(this,"children")||[];for(let n=0,a=r.length;n<a;n++)this.insertChild({data:r[n]})}get label(){return No(this,"label")}get key(){const e=this.store.key;return this.data?this.data[e]:null}get disabled(){return No(this,"disabled")}get nextSibling(){const e=this.parent;if(e){const r=e.childNodes.indexOf(this);if(r>-1)return e.childNodes[r+1]}return null}get previousSibling(){const e=this.parent;if(e){const r=e.childNodes.indexOf(this);if(r>-1)return r>0?e.childNodes[r-1]:null}return null}contains(e,r=!0){return(this.childNodes||[]).some(n=>n===e||r&&n.contains(e))}remove(){const e=this.parent;e&&e.removeChild(this)}insertChild(e,r,n){if(!e)throw new Error("InsertChild error: child is required.");if(!(e instanceof On)){if(!n){const a=this.getChildren(!0);a.includes(e.data)||(typeof r>"u"||r<0?a.push(e.data):a.splice(r,0,e.data))}Object.assign(e,{parent:this,store:this.store}),e=o.reactive(new On(e)),e instanceof On&&e.initialize()}e.level=this.level+1,typeof r>"u"||r<0?this.childNodes.push(e):this.childNodes.splice(r,0,e),this.updateLeafState()}insertBefore(e,r){let n;r&&(n=this.childNodes.indexOf(r)),this.insertChild(e,n)}insertAfter(e,r){let n;r&&(n=this.childNodes.indexOf(r),n!==-1&&(n+=1)),this.insertChild(e,n)}removeChild(e){const r=this.getChildren()||[],n=r.indexOf(e.data);n>-1&&r.splice(n,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 r=null;for(let n=0;n<this.childNodes.length;n++)if(this.childNodes[n].data===e){r=this.childNodes[n];break}r&&this.removeChild(r)}expand(e,r){const n=()=>{if(r){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||pi(this),n())}):n()}doCreateChildren(e,r={}){e.forEach(n=>{this.insertChild(Object.assign({data:n},r),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,r,n,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}=Ml(this.childNodes);!this.isLeaf&&!s&&l&&(this.checked=!1,e=!1);const c=()=>{if(r){const u=this.childNodes;for(let p=0,v=u.length;p<v;p++){const h=u[p];a=a||e!==!1;const g=h.disabled?h.checked:a;h.setChecked(g,r,!0,a)}const{half:d,all:f}=Ml(u);f||(this.checked=f,this.indeterminate=d)}};if(this.shouldLoadData()){this.loadData(()=>{c(),pi(this)},{checked:e!==!1});return}else c()}const i=this.parent;!i||i.level===0||n||pi(i)}getChildren(e=!1){if(this.level===0)return this.data;const r=this.data;if(!r)return null;const n=this.store.props;let a="children";return n&&(a=n.children||"children"),r[a]===void 0&&(r[a]=null),e&&!r[a]&&(r[a]=[]),r[a]}updateChildren(){const e=this.getChildren()||[],r=this.childNodes.map(i=>i.data),n={},a=[];e.forEach((i,s)=>{const l=i[fa];!!l&&r.findIndex(u=>u[fa]===l)>=0?n[l]={index:s,data:i}:a.push({index:s,data:i})}),this.store.lazy||r.forEach(i=>{n[i[fa]]||this.removeChildByData(i)}),a.forEach(({index:i,data:s})=>{this.insertChild({data:s},i)}),this.updateLeafState()}loadData(e,r={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(r).length)){this.loading=!0;const n=i=>{this.childNodes=[],this.doCreateChildren(i,r),this.loaded=!0,this.loading=!1,this.updateLeafState(),e&&e.call(this,i)},a=()=>{this.loading=!1};this.store.load(this,n,a)}else e&&e.call(this)}eachNode(e){const r=[this];for(;r.length;){const n=r.shift();r.unshift(...n.childNodes),e(n)}}reInitChecked(){this.store.checkStrictly||pi(this)}}class Qx{constructor(e){this.currentNode=null,this.currentNodeKey=null;for(const r in e)wn(e,r)&&(this[r]=e[r]);this.nodesMap={}}initialize(){if(this.root=new On({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const e=this.load;e(this.root,r=>{this.root.doCreateChildren(r),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(e){const r=this.filterNodeMethod,n=this.lazy,a=function(i){const s=i.root?i.root.childNodes:i.childNodes;if(s.forEach(l=>{l.visible=r.call(l,e,l.data,l),a(l)}),!i.visible&&s.length){let l=!0;l=!s.some(c=>c.visible),i.root?i.root.visible=l===!1:i.visible=l===!1}e&&i.visible&&!i.isLeaf&&(!n||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 On)return e;const r=vt(e)?Il(this.key,e):e;return this.nodesMap[r]||null}insertBefore(e,r){const n=this.getNode(r);n.parent.insertBefore({data:e},n)}insertAfter(e,r){const n=this.getNode(r);n.parent.insertAfter({data:e},n)}remove(e){const r=this.getNode(e);r&&r.parent&&(r===this.currentNode&&(this.currentNode=null),r.parent.removeChild(r))}append(e,r){const n=oo(r)?this.root:this.getNode(r);n&&n.insertChild({data:e})}_initDefaultCheckedNodes(){const e=this.defaultCheckedKeys||[],r=this.nodesMap;e.forEach(n=>{const a=r[n];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 r=this.key;!e||!e.data||(r?e.key!==void 0&&(this.nodesMap[e.key]=e):this.nodesMap[e.id]=e)}deregisterNode(e){!this.key||!e||!e.data||(e.childNodes.forEach(n=>{this.deregisterNode(n)}),delete this.nodesMap[e.key])}getCheckedNodes(e=!1,r=!1){const n=[],a=function(i){(i.root?i.root.childNodes:i.childNodes).forEach(l=>{(l.checked||r&&l.indeterminate)&&(!e||e&&l.isLeaf)&&n.push(l.data),a(l)})};return a(this),n}getCheckedKeys(e=!1){return this.getCheckedNodes(e).map(r=>(r||{})[this.key])}getHalfCheckedNodes(){const e=[],r=function(n){(n.root?n.root.childNodes:n.childNodes).forEach(i=>{i.indeterminate&&e.push(i.data),r(i)})};return r(this),e}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(e=>(e||{})[this.key])}_getAllNodes(){const e=[],r=this.nodesMap;for(const n in r)wn(r,n)&&e.push(r[n]);return e}updateChildren(e,r){const n=this.nodesMap[e];if(!n)return;const a=n.childNodes;for(let i=a.length-1;i>=0;i--){const s=a[i];this.remove(s.data)}for(let i=0,s=r.length;i<s;i++){const l=r[i];this.append(l,n.data)}}_setCheckedKeys(e,r=!1,n){const a=this._getAllNodes().sort((c,u)=>c.level-u.level),i=Object.create(null),s=Object.keys(n);a.forEach(c=>c.setChecked(!1,!1));const l=c=>{c.childNodes.forEach(u=>{var d;i[u.data[e]]=!0,(d=u.childNodes)!=null&&d.length&&l(u)})};for(let c=0,u=a.length;c<u;c++){const d=a[c],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),r){d.setChecked(!1,!1);const v=function(h){h.childNodes.forEach(y=>{y.isLeaf||y.setChecked(!1,!1),v(y)})};v(d)}}}setCheckedNodes(e,r=!1){const n=this.key,a={};e.forEach(i=>{a[(i||{})[n]]=!0}),this._setCheckedKeys(n,r,a)}setCheckedKeys(e,r=!1){this.defaultCheckedKeys=e;const n=this.key,a={};e.forEach(i=>{a[i]=!0}),this._setCheckedKeys(n,r,a)}setDefaultExpandedKeys(e){e=e||[],this.defaultExpandedKeys=e,e.forEach(r=>{const n=this.getNode(r);n&&n.expand(null,this.autoExpandParent)})}setChecked(e,r,n){const a=this.getNode(e);a&&a.setChecked(!!r,n)}getCurrentNode(){return this.currentNode}setCurrentNode(e){const r=this.currentNode;r&&(r.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0}setUserCurrentNode(e,r=!0){const n=e[this.key],a=this.nodesMap[n];this.setCurrentNode(a),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(e,r=!0){if(e==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const n=this.getNode(e);n&&(this.setCurrentNode(n),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const Jx=o.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(t){const e=Be("tree"),r=o.inject("NodeInstance"),n=o.inject("RootTree");return()=>{const a=t.node,{data:i,store:s}=a;return t.renderContent?t.renderContent(o.h,{_self:r,node:a,data:i,store:s}):o.renderSlot(n.ctx.slots,"default",{node:a,data:i},()=>[o.h("span",{class:e.be("node","label")},[a.label])])}}});var eE=Te(Jx,[["__file","tree-node-content.vue"]]);function _f(t){const e=o.inject("TreeNodeMap",null),r={treeNodeExpand:n=>{t.node!==n&&t.node.collapse()},children:[]};return e&&e.children.push(r),o.provide("TreeNodeMap",r),{broadcastExpanded:n=>{if(t.accordion)for(const a of r.children)a.treeNodeExpand(n)}}}const Of=Symbol("dragEvents");function tE({props:t,ctx:e,el$:r,dropIndicator$:n,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)},c=({event:d,treeNode:f})=>{const p=f,v=s.value.dropNode;v&&v.node.id!==p.node.id&&Sn(v.$el,i.is("drop-inner"));const h=s.value.draggingNode;if(!h||!p)return;let g=!0,y=!0,m=!0,b=!0;typeof t.allowDrop=="function"&&(g=t.allowDrop(h.node,p.node,"prev"),b=y=t.allowDrop(h.node,p.node,"inner"),m=t.allowDrop(h.node,p.node,"next")),d.dataTransfer.dropEffect=y||g||m?"move":"none",(g||y||m)&&(v==null?void 0:v.node.id)!==p.node.id&&(v&&e.emit("node-drag-leave",h.node,v.node,d),e.emit("node-drag-enter",h.node,p.node,d)),g||y||m?s.value.dropNode=p:s.value.dropNode=null,p.node.nextSibling===h.node&&(m=!1),p.node.previousSibling===h.node&&(g=!1),p.node.contains(h.node,!1)&&(y=!1),(h.node===p.node||h.node.contains(p.node))&&(g=!1,y=!1,m=!1);const w=p.$el.querySelector(`.${i.be("node","content")}`).getBoundingClientRect(),C=r.value.getBoundingClientRect();let x;const E=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*E?x="before":S>w.height*k?x="after":y?x="inner":x="none";const N=p.$el.querySelector(`.${i.be("node","expand-icon")}`).getBoundingClientRect(),D=n.value;x==="before"?B=N.top-C.top:x==="after"&&(B=N.bottom-C.top),D.style.top=`${B}px`,D.style.left=`${N.right-C.left}px`,x==="inner"?js(p.$el,i.is("drop-inner")):Sn(p.$el,i.is("drop-inner")),s.value.showDropIndicator=x==="before"||x==="after",s.value.allowDrop=s.value.showDropIndicator||b,s.value.dropType=x,e.emit("node-drag-over",h.node,p.node,d)},u=d=>{const{draggingNode:f,dropType:p,dropNode:v}=s.value;if(d.preventDefault(),d.dataTransfer&&(d.dataTransfer.dropEffect="move"),f&&v){const h={data:f.node.data};p!=="none"&&f.node.remove(),p==="before"?v.node.parent.insertBefore(h,v.node):p==="after"?v.node.parent.insertAfter(h,v.node):p==="inner"&&v.node.insertChild(h),p!=="none"&&(a.value.registerNode(h),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)})),Sn(v.$el,i.is("drop-inner")),e.emit("node-drag-end",f.node,v.node,p,d),p!=="none"&&e.emit("node-drop",f.node,v.node,p,d)}f&&!v&&e.emit("node-drag-end",f.node,null,p,d),s.value.showDropIndicator=!1,s.value.draggingNode=null,s.value.dropNode=null,s.value.allowDrop=!0};return o.provide(Of,{treeNodeDragStart:l,treeNodeDragOver:c,treeNodeDragEnd:u}),{dragState:s}}const rE=o.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:Fk,ElCheckbox:bk,NodeContent:eE,ElIcon:yt,Loading:Zs},props:{node:{type:On,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(t,e){const r=Be("tree"),{broadcastExpanded:n}=_f(t),a=o.inject("RootTree"),i=o.ref(!1),s=o.ref(!1),l=o.ref(null),c=o.ref(null),u=o.ref(null),d=o.inject(Of),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 p=a.props.props.children||"children";o.watch(()=>{const S=t.node.data[p];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=>Il(a.props.nodeKey,S.data),h=S=>{const N=t.props.class;if(!N)return{};let D;if(Lt(N)){const{data:P}=S;D=N(P,S)}else D=N;return St(D)?{[D]:!0}:D},g=(S,N)=>{(l.value!==S||c.value!==N)&&a.ctx.emit("check-change",t.node.data,S,N),l.value=S,c.value=N},y=S=>{Ll(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:r,node$:u,tree:a,expanded:i,childNodeRendered:s,oldChecked:l,oldIndeterminate:c,getNodeKey:v,getNodeClass:h,handleSelectChange:g,handleClick:y,handleContextMenu:m,handleExpandIconClick:b,handleCheckChange:w,handleChildNodeExpand:(S,N,D)=>{n(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:u.value,node:t.node}})},handleDrop:S=>{S.preventDefault()},handleDragEnd:S=>{a.props.draggable&&d.treeNodeDragEnd(S)},CaretRight:Y1}}});function nE(t,e,r,n,a,i){const s=o.resolveComponent("el-icon"),l=o.resolveComponent("el-checkbox"),c=o.resolveComponent("loading"),u=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(c)]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),o.createVNode(u,{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,p=>(o.openBlock(),o.createBlock(d,{key:t.getNodeKey(p),"render-content":t.renderContent,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,node:p,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 aE=Te(rE,[["render",nE],["__file","tree-node.vue"]]);function iE({el$:t},e){const r=Be("tree"),n=o.shallowRef([]),a=o.shallowRef([]);o.onMounted(()=>{s()}),o.onUpdated(()=>{n.value=Array.from(t.value.querySelectorAll("[role=treeitem]")),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"))}),o.watch(a,l=>{l.forEach(c=>{c.setAttribute("tabindex","-1")})}),jt(t,"keydown",l=>{const c=l.target;if(!c.className.includes(r.b("node")))return;const u=l.code;n.value=Array.from(t.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const d=n.value.indexOf(c);let f;if([it.up,it.down].includes(u)){if(l.preventDefault(),u===it.up){f=d===-1?0:d!==0?d-1:n.value.length-1;const v=f;for(;!e.value.getNode(n.value[f].dataset.key).canFocus;){if(f--,f===v){f=-1;break}f<0&&(f=n.value.length-1)}}else{f=d===-1?0:d<n.value.length-1?d+1:0;const v=f;for(;!e.value.getNode(n.value[f].dataset.key).canFocus;){if(f++,f===v){f=-1;break}f>=n.value.length&&(f=0)}}f!==-1&&n.value[f].focus()}[it.left,it.right].includes(u)&&(l.preventDefault(),c.click());const p=c.querySelector('[type="checkbox"]');[it.enter,it.space].includes(u)&&p&&(l.preventDefault(),p.click())});const s=()=>{var l;n.value=Array.from(t.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"));const c=t.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);if(c.length){c[0].setAttribute("tabindex","0");return}(l=n.value[0])==null||l.setAttribute("tabindex","0")}}const oE=o.defineComponent({name:"ElTree",components:{ElTreeNode:aE},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:Zr}},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:r}=Ya(),n=Be("tree"),a=o.inject(hi,null),i=o.ref(new Qx({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),c=o.ref(null),u=o.ref(null),{broadcastExpanded:d}=_f(t),{dragState:f}=tE({props:t,ctx:e,el$:c,dropIndicator$:u,store:i});iE({el$:c},i);const p=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)},h=L=>Il(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)},x=(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)},k=()=>i.value.getHalfCheckedNodes(),B=()=>i.value.getHalfCheckedKeys(),S=(L,V=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");Ll(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");Ll(i,e.emit,()=>{d(),i.value.setCurrentNodeKey(L,V)})},D=L=>i.value.getNode(L),P=L=>{i.value.remove(L)},I=(L,V)=>{i.value.append(L,V)},_=(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(ni,void 0),{ns:n,store:i,root:s,currentNode:l,dragState:f,el$:c,dropIndicator$:u,isEmpty:p,filter:v,getNodeKey:h,getNodePath:g,getCheckedNodes:y,getCheckedKeys:m,getCurrentNode:b,getCurrentKey:w,setCheckedNodes:C,setCheckedKeys:x,setChecked:E,getHalfCheckedNodes:k,getHalfCheckedKeys:B,setCurrentNode:S,setCurrentKey:N,t:r,getNode:D,remove:P,append:I,insertBefore:_,insertAfter:F,handleNodeExpand:O,updateKeyChildren:M}}});function sE(t,e,r,n,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 lE=Te(oE,[["render",sE],["__file","tree.vue"]]);const cE=dt(lE);function uE(t){let e;const r=o.ref(!1),n=o.reactive({...t,originalPosition:"",originalOverflow:"",visible:!1});function a(p){n.text=p}function i(){const p=n.parent,v=f.ns;if(!p.vLoadingAddClassList){let h=p.getAttribute("loading-number");h=Number.parseInt(h)-1,h?p.setAttribute("loading-number",h.toString()):(Sn(p,v.bm("parent","relative")),p.removeAttribute("loading-number")),Sn(p,v.bm("parent","hidden"))}s(),d.unmount()}function s(){var p,v;(v=(p=f.$el)==null?void 0:p.parentNode)==null||v.removeChild(f.$el)}function l(){var p;t.beforeClose&&!t.beforeClose()||(r.value=!0,clearTimeout(e),e=setTimeout(c,400),n.visible=!1,(p=t.closed)==null||p.call(t))}function c(){if(!r.value)return;const p=n.parent;r.value=!1,p.vLoadingAddClassList=void 0,i()}const u=o.defineComponent({name:"ElLoading",setup(p,{expose:v}){const{ns:h,zIndex:g}=n2("loading");return v({ns:h,zIndex:g}),()=>{const y=n.spinner||n.svg,m=o.h("svg",{class:"circular",viewBox:n.svgViewBox?n.svgViewBox:"0 0 50 50",...y?{innerHTML:y}:{}},[o.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),b=n.text?o.h("p",{class:h.b("text")},[n.text]):void 0;return o.h(o.Transition,{name:h.b("fade"),onAfterLeave:c},{default:o.withCtx(()=>[o.withDirectives(o.createVNode("div",{style:{backgroundColor:n.background||""},class:[h.b("mask"),n.customClass,n.fullscreen?"is-fullscreen":""]},[o.h("div",{class:h.b("spinner")},[m,b])]),[[o.vShow,n.visible]])])})}}}),d=o.createApp(u),f=d.mount(document.createElement("div"));return{...o.toRefs(n),setText:a,removeElLoadingChild:s,close:l,handleAfterLeave:c,vm:f,get $el(){return f.$el}}}let Do;const dE=function(t={}){if(!et)return;const e=fE(t);if(e.fullscreen&&Do)return Do;const r=uE({...e,closed:()=>{var a;(a=e.closed)==null||a.call(e),e.fullscreen&&(Do=void 0)}});hE(e,e.parent,r),If(e,e.parent,r),e.parent.vLoadingAddClassList=()=>If(e,e.parent,r);let n=e.parent.getAttribute("loading-number");return n?n=`${Number.parseInt(n)+1}`:n="1",e.parent.setAttribute("loading-number",n),e.parent.appendChild(r.$el),o.nextTick(()=>r.visible.value=e.visible),e.fullscreen&&(Do=r),r},fE=t=>{var e,r,n,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&&((r=t.fullscreen)!=null?r:!0),lock:(n=t.lock)!=null?n:!1,customClass:t.customClass||"",visible:(a=t.visible)!=null?a:!0,beforeClose:t.beforeClose,closed:t.closed,target:i}},hE=async(t,e,r)=>{const{nextZIndex:n}=r.vm.zIndex||r.vm._.exposed.zIndex,a={};if(t.fullscreen)r.originalPosition.value=ja(document.body,"position"),r.originalOverflow.value=ja(document.body,"overflow"),a.zIndex=n();else if(t.parent===document.body){r.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 r.originalPosition.value=ja(e,"position");for(const[i,s]of Object.entries(a))r.$el.style[i]=s},If=(t,e,r)=>{const n=r.vm.ns||r.vm._.exposed.ns;["absolute","fixed","sticky"].includes(r.originalPosition.value)?Sn(e,n.bm("parent","relative")):js(e,n.bm("parent","relative")),t.fullscreen&&t.lock?js(e,n.bm("parent","hidden")):Sn(e,n.bm("parent","hidden"))},Po=Symbol("ElLoading"),Lf=(t,e)=>{var r,n,a,i;const s=e.instance,l=p=>vt(e.value)?e.value[p]:void 0,c=p=>{const v=St(p)&&(s==null?void 0:s[p])||p;return v&&o.ref(v)},u=p=>c(l(p)||t.getAttribute(`element-loading-${jg(p)}`)),d=(r=l("fullscreen"))!=null?r:e.modifiers.fullscreen,f={text:u("text"),svg:u("svg"),svgViewBox:u("svgViewBox"),spinner:u("spinner"),background:u("background"),customClass:u("customClass"),fullscreen:d,target:(n=l("target"))!=null?n:d?void 0:t,body:(a=l("body"))!=null?a:e.modifiers.body,lock:(i=l("lock"))!=null?i:e.modifiers.lock};t[Po]={options:f,instance:dE(f)}},pE=(t,e)=>{for(const r of Object.keys(e))o.isRef(e[r])&&(e[r].value=t[r])},Fl={mounted(t,e){e.value&&Lf(t,e)},updated(t,e){const r=t[Po];e.oldValue!==e.value&&(e.value&&!e.oldValue?Lf(t,e):e.value&&e.oldValue?vt(e.value)&&pE(e.value,r.options):r==null||r.instance.close())},unmounted(t){var e;(e=t[Po])==null||e.instance.close(),t[Po]=null}},lr=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},vE={name:"AnnotationPopup",props:{annotationEntry:{type:Object}},inject:["$annotator","userApiKey"],data:function(){return{displayPair:{"Feature ID":"featureId",Tooltip:"label",Models:"models",Name:"name",Resource:"resourceId"},editing:!1,evidencePrefixes:["","DOI:","PMID:"],evidencePrefix:"",evidence:[],authenticated:!1,newEvidence:"",comment:"",prevSubs:[],showSubmissions:!0,errorMessage:"",creator:void 0}},computed:{isEditable:function(){return this.annotationEntry.resourceId&&this.annotationEntry.featureId},isPositionUpdated:function(){return this.annotationEntry.resourceId&&this.annotationEntry.type==="updated"&&this.annotationEntry.positionUpdated},isDeleted:function(){return this.annotationEntry.resourceId&&this.annotationEntry.type==="deleted"}},methods:{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.annotationEntry.resourceId&&this.annotationEntry.featureId&&((t=this.$annotator)==null||t.itemAnnotations(this.userApiKey,this.annotationEntry.resourceId,this.annotationEntry.featureId).then(e=>{this.prevSubs=e}).catch(e=>{console.log(e)}))},submit:function(){var t;if(this.annotationEntry.type==="updated"&&this.annotationEntry.positionUpdated?this.comment=this.comment?`Position Updated: ${this.comment}`:"Position Updated":this.annotationEntry.type==="deleted"&&(this.comment=this.comment?`Feature Deleted: ${this.comment}`:"Feature Deleted"),(this.evidence.length>0||this.comment)&&this.annotationEntry.resourceId&&this.annotationEntry.featureId){const e=[];this.evidence.forEach(n=>{if(n.includes("DOI:")){const a=n.replace("DOI:","https://doi.org/");e.push(new URL(a))}else if(n.includes("PMID:")){const a=n.replace("PMID:","https://pubmed.ncbi.nlm.nih.gov/");e.push(new URL(a))}else e.push(n)});const r={resource:this.annotationEntry.resourceId,item:Object.assign({id:this.annotationEntry.featureId},Object.fromEntries(Object.entries(this.annotationEntry).filter(([n])=>["label","models"].includes(n)))),body:{evidence:e,comment:this.comment},feature:this.annotationEntry.feature};Object.assign(r.body,this.annotationEntry.body),this.annotationEntry.type==="deleted"&&(r.feature=void 0),this.creator&&(r.creator=this.creator),(t=this.$annotator)==null||t.addAnnotation(this.userApiKey,r).then(()=>{this.$emit("annotation",r),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=""}},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=""})}},In=t=>(o.pushScopeId("data-v-9930ef40"),t=t(),o.popScopeId(),t),gE={class:"block"},mE=In(()=>o.createElementVNode("div",{class:"title"},"Feature Annotations",-1)),yE=In(()=>o.createElementVNode("strong",{class:"sub-title"},"Previous submissions:",-1)),bE=In(()=>o.createElementVNode("strong",null,"Evidence: ",-1)),wE=["href"],CE=In(()=>o.createElementVNode("strong",null,"Comment: ",-1)),kE=In(()=>o.createElementVNode("strong",{class:"sub-title"},"Suggest changes:",-1)),xE=In(()=>o.createElementVNode("strong",null,"Evidence:",-1)),EE=In(()=>o.createElementVNode("strong",null,"Comment:",-1)),SE={class:"sub-title"};function TE(t,e,r,n,a,i){const s=To,l=Wu,c=yt,u=so,d=ib,f=nb,p=sb,v=ci,h=lo,g=Hx,y=zx,m=oi,b=sr,w=Dl;return o.openBlock(),o.createBlock(w,{class:"main"},{default:o.withCtx(()=>[o.createElementVNode("div",gE,[o.createVNode(s,{class:"info-field"},{default:o.withCtx(()=>[mE]),_:1}),r.annotationEntry?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.displayPair,(C,x)=>o.withDirectives((o.openBlock(),o.createBlock(s,{class:"dialog-text",key:C},{default:o.withCtx(()=>[o.createElementVNode("strong",null,o.toDisplayString(x)+": ",1),o.createTextVNode(" "+o.toDisplayString(r.annotationEntry[C]),1)]),_:2},1024)),[[o.vShow,r.annotationEntry[C]]])),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]=C=>t.showSubmissions=!1)},[o.createTextVNode(" Hide previous submissions "),o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(l)]),_:1})],512),[[o.vShow,t.showSubmissions]]),o.withDirectives(o.createElementVNode("div",{class:"hide",onClick:e[1]||(e[1]=C=>t.showSubmissions=!0)},[o.createTextVNode(" Show previous "+o.toDisplayString(t.prevSubs.length)+" submission(s) ",1),o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(u)]),_:1})],512),[[o.vShow,!t.showSubmissions]]),t.showSubmissions?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(s,{class:"dialog-spacer"}),o.createVNode(s,{class:"dialog-text"},{default:o.withCtx(()=>[yE]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.prevSubs,(C,x)=>(o.openBlock(),o.createElementBlock("div",{class:"entry",key:x},[o.createVNode(s,{class:"dialog-text"},{default:o.withCtx(()=>[o.createElementVNode("strong",null,o.toDisplayString(i.formatTime(C.created)),1),o.createTextVNode(" "+o.toDisplayString(C.creator.name),1)]),_:2},1024),o.createVNode(s,{class:"dialog-text"},{default:o.withCtx(()=>[bE,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(C.body.evidence,E=>(o.openBlock(),o.createBlock(s,{key:E,class:"dialog-text"},{default:o.withCtx(()=>[o.createElementVNode("a",{href:E,target:"_blank"},o.toDisplayString(E),9,wE)]),_:2},1024))),128))]),_:2},1024),o.createVNode(s,{class:"dialog-text"},{default:o.withCtx(()=>[CE,o.createTextVNode(" "+o.toDisplayString(C.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(s,{class:"dialog-spacer"}),t.editing?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createVNode(s,{class:"dialog-text"},{default:o.withCtx(()=>[kE]),_:1}),i.isDeleted?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(s,{class:"dialog-text"},{default:o.withCtx(()=>[xE]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.evidence,(C,x)=>(o.openBlock(),o.createBlock(s,{key:C},{default:o.withCtx(()=>[o.createVNode(v,{span:20},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.evidence[x]),1)]),_:2},1024),o.createVNode(v,{span:4},{default:o.withCtx(()=>[o.createVNode(c,{class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(h,{onClick:E=>i.removeEvidence(x)},null,8,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),o.createVNode(s,null,{default:o.withCtx(()=>[o.createVNode(m,{size:"small",placeholder:"Enter",modelValue:t.newEvidence,"onUpdate:modelValue":e[4]||(e[4]=C=>t.newEvidence=C),onChange:e[5]||(e[5]=C=>i.evidenceEntered(C))},{prepend:o.withCtx(()=>[o.createVNode(y,{teleported:!1,modelValue:t.evidencePrefix,"onUpdate:modelValue":e[3]||(e[3]=C=>t.evidencePrefix=C),placeholder:"No Prefix",class:"select-box","popper-class":"flatmap_dropdown"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.evidencePrefixes,C=>(o.openBlock(),o.createBlock(g,{key:C,label:C,value:C},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>[o.createVNode(v,{span:12},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(C),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1})],64)),o.createVNode(s,null,{default:o.withCtx(()=>[EE]),_:1}),o.createVNode(s,{class:"dialog-text"},{default:o.withCtx(()=>[o.createVNode(m,{type:"textarea",autosize:{minRows:2,maxRows:4},placeholder:"Enter",modelValue:t.comment,"onUpdate:modelValue":e[6]||(e[6]=C=>t.comment=C)},null,8,["modelValue"])]),_:1}),o.createVNode(s,{class:"dialog-text"},{default:o.withCtx(()=>[o.createVNode(b,{class:"button",type:"primary",plain:"",onClick:i.submit},{default:o.withCtx(()=>[o.createTextVNode(" Submit ")]),_:1},8,["onClick"])]),_:1})],64)):(o.openBlock(),o.createBlock(s,{key:0},{default:o.withCtx(()=>[o.createVNode(c,{class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(d,{onClick:e[2]||(e[2]=C=>t.editing=!0)})]),_:1}),i.isDeleted?(o.openBlock(),o.createBlock(c,{key:0,class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(f,{onClick:i.submit},null,8,["onClick"])]),_:1})):i.isPositionUpdated?(o.openBlock(),o.createBlock(c,{key:1,class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(p,{onClick:i.submit},null,8,["onClick"])]),_:1})):o.createCommentVNode("",!0)]),_:1})),t.errorMessage?(o.openBlock(),o.createBlock(s,{key:2,class:"dialog-text"},{default:o.withCtx(()=>[o.createElementVNode("strong",SE,o.toDisplayString(t.errorMessage),1)]),_:1})):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)])]),_:1})}const Mf=lr(vE,[["render",TE],["__scopeId","data-v-9930ef40"]]),BE={name:"CreateTooltipContent",components:{Button:sr,Col:ci,Container:Ef,Header:Sf,Input:oi,Main:Dl},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")}}},NE=(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 DE(t,e,r,n,a,i){const s=Sf,l=ci,c=To,u=oi,d=sr,f=Dl,p=Ef;return o.openBlock(),o.createBlock(p,{class:"create-container"},{default:o.withCtx(()=>[o.createVNode(s,{height:"30px",class:"header"},{default:o.withCtx(()=>[o.createElementVNode("div",null,"Create "+o.toDisplayString(r.createData.shape),1)]),_:1}),o.createVNode(f,{class:"slides-block"},{default:o.withCtx(()=>[NE,o.withDirectives(o.createVNode(c,{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(r.createData.points,({value:v,i:h})=>(o.openBlock(),o.createBlock(c,{key:h,class:"value"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h),1)]),_:2},1024))),128))]),_:1})]),_:1},512),[[o.vShow,t.showPoint]]),o.createVNode(c,{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(u,{modelValue:t.region,"onUpdate:modelValue":e[0]||(e[0]=v=>t.region=v),placeholder:"__annotation",size:"small"},null,8,["modelValue"])]),_:1})]),_:1}),o.createVNode(c,{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(u,{modelValue:t.group,"onUpdate:modelValue":e[1]||(e[1]=v=>t.group=v),placeholder:r.createData.shape,size:"small"},null,8,["modelValue","placeholder"])]),_:1})]),_:1}),o.createVNode(c,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 PE=lr(BE,[["render",DE],["__scopeId","data-v-d61c5879"]]);function ot(t){"@babel/helpers - typeof";return ot=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},ot(t)}function Al(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _E(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Vl(t,e,r){return e&&_E(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ff(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cr(t,e){return OE(t)||IE(t,e)||Af(t,e)||LE()}function OE(t){if(Array.isArray(t))return t}function IE(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],a=!0,i=!1,s,l;try{for(r=r.call(t);!(a=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));a=!0);}catch(c){i=!0,l=c}finally{try{!a&&r.return!=null&&r.return()}finally{if(i)throw l}}return n}}function Af(t,e){if(t){if(typeof t=="string")return Vf(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vf(t,e)}}function Vf(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function LE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
21
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rf(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Af(t))||e){r&&(t=r);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
22
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,l;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return i=c.done,c},e:function(c){s=!0,l=c},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(s)throw l}}}}var st=typeof window>"u"?null:window,$f=st?st.navigator:null;st&&st.document;var ME=ot(""),zf=ot({}),FE=ot(function(){}),AE=typeof HTMLElement>"u"?"undefined":ot(HTMLElement),vi=function(e){return e&&e.instanceString&&Ye(e.instanceString)?e.instanceString():null},be=function(e){return e!=null&&ot(e)==ME},Ye=function(e){return e!=null&&ot(e)===FE},Ke=function(e){return!Ut(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Oe=function(e){return e!=null&&ot(e)===zf&&!Ke(e)&&e.constructor===Object},VE=function(e){return e!=null&&ot(e)===zf},le=function(e){return e!=null&&ot(e)===ot(1)&&!isNaN(e)},RE=function(e){return le(e)&&Math.floor(e)===e},_o=function(e){if(AE!=="undefined")return e!=null&&e instanceof HTMLElement},Ut=function(e){return gi(e)||Hf(e)},gi=function(e){return vi(e)==="collection"&&e._private.single},Hf=function(e){return vi(e)==="collection"&&!e._private.single},Rl=function(e){return vi(e)==="core"},Kf=function(e){return vi(e)==="stylesheet"},$E=function(e){return vi(e)==="event"},nn=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},zE=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},HE=function(e){return Oe(e)&&le(e.x1)&&le(e.x2)&&le(e.y1)&&le(e.y2)},KE=function(e){return VE(e)&&Ye(e.then)},qE=function(){return $f&&$f.userAgent.match(/msie|trident|edge/i)},mi=function(e,r){r||(r=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 n=function a(){var i=this,s=arguments,l,c=r.apply(i,s),u=a.cache;return(l=u[c])||(l=u[c]=e.apply(i,s)),l};return n.cache={},n},$l=mi(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Oo=mi(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),qf=mi(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),Uf=function(e){return nn(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},lt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",UE="rgb[a]?\\(("+lt+"[%]?)\\s*,\\s*("+lt+"[%]?)\\s*,\\s*("+lt+"[%]?)(?:\\s*,\\s*("+lt+"))?\\)",GE="rgb[a]?\\((?:"+lt+"[%]?)\\s*,\\s*(?:"+lt+"[%]?)\\s*,\\s*(?:"+lt+"[%]?)(?:\\s*,\\s*(?:"+lt+"))?\\)",WE="hsl[a]?\\(("+lt+")\\s*,\\s*("+lt+"[%])\\s*,\\s*("+lt+"[%])(?:\\s*,\\s*("+lt+"))?\\)",jE="hsl[a]?\\((?:"+lt+")\\s*,\\s*(?:"+lt+"[%])\\s*,\\s*(?:"+lt+"[%])(?:\\s*,\\s*(?:"+lt+"))?\\)",YE="\\#[0-9a-fA-F]{3}",ZE="\\#[0-9a-fA-F]{6}",Gf=function(e,r){return e<r?-1:e>r?1:0},XE=function(e,r){return-1*Gf(e,r)},xe=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var n=e[r];if(n!=null)for(var a=Object.keys(n),i=0;i<a.length;i++){var s=a[i];t[s]=n[s]}}return t},QE=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,n,a,i,s=16;return r?(n=parseInt(e[1]+e[1],s),a=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s)):(n=parseInt(e[1]+e[2],s),a=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s)),[n,a,i]}},JE=function(e){var r,n,a,i,s,l,c,u;function d(h,g,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?h+(g-h)*6*y:y<1/2?g:y<2/3?h+(g-h)*(2/3-y)*6:h}var f=new RegExp("^"+WE+"$").exec(e);if(f){if(n=parseInt(f[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=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=c=u=Math.round(i*255);else{var p=i<.5?i*(1+a):i+a-i*a,v=2*i-p;l=Math.round(255*d(v,p,n+1/3)),c=Math.round(255*d(v,p,n)),u=Math.round(255*d(v,p,n-1/3))}r=[l,c,u,s]}return r},eS=function(e){var r,n=new RegExp("^"+UE+"$").exec(e);if(n){r=[];for(var a=[],i=1;i<=3;i++){var s=n[i];if(s[s.length-1]==="%"&&(a[i]=!0),s=parseFloat(s),a[i]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var l=a[1]||a[2]||a[3],c=a[1]&&a[2]&&a[3];if(l&&!c)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},tS=function(e){return nS[e.toLowerCase()]},rS=function(e){return(Ke(e)?e:null)||tS(e)||QE(e)||eS(e)||JE(e)},nS={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]},Wf=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var s=n[i];if(Oe(s))throw Error("Tried to set map with object key");i<n.length-1?(r[s]==null&&(r[s]={}),r=r[s]):r[s]=e.value}},jf=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var s=n[i];if(Oe(s))throw Error("Tried to get map with object key");if(r=r[s],r==null)return r}return r};function aS(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ln=aS,yi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function iS(t,e){return e={exports:{}},t(e,e.exports),e.exports}var oS=typeof yi=="object"&&yi&&yi.Object===Object&&yi,sS=oS,lS=typeof self=="object"&&self&&self.Object===Object&&self,cS=sS||lS||Function("return this")(),Io=cS,uS=function(){return Io.Date.now()},zl=uS,dS=/\s/;function fS(t){for(var e=t.length;e--&&dS.test(t.charAt(e)););return e}var hS=fS,pS=/^\s+/;function vS(t){return t&&t.slice(0,hS(t)+1).replace(pS,"")}var gS=vS,mS=Io.Symbol,ha=mS,Yf=Object.prototype,yS=Yf.hasOwnProperty,bS=Yf.toString,bi=ha?ha.toStringTag:void 0;function wS(t){var e=yS.call(t,bi),r=t[bi];try{t[bi]=void 0;var n=!0}catch{}var a=bS.call(t);return n&&(e?t[bi]=r:delete t[bi]),a}var CS=wS,kS=Object.prototype,xS=kS.toString;function ES(t){return xS.call(t)}var SS=ES,TS="[object Null]",BS="[object Undefined]",Zf=ha?ha.toStringTag:void 0;function NS(t){return t==null?t===void 0?BS:TS:Zf&&Zf in Object(t)?CS(t):SS(t)}var Xf=NS;function DS(t){return t!=null&&typeof t=="object"}var PS=DS,_S="[object Symbol]";function OS(t){return typeof t=="symbol"||PS(t)&&Xf(t)==_S}var wi=OS,Qf=NaN,IS=/^[-+]0x[0-9a-f]+$/i,LS=/^0b[01]+$/i,MS=/^0o[0-7]+$/i,FS=parseInt;function AS(t){if(typeof t=="number")return t;if(wi(t))return Qf;if(Ln(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ln(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=gS(t);var r=LS.test(t);return r||MS.test(t)?FS(t.slice(2),r?2:8):IS.test(t)?Qf:+t}var Jf=AS,VS="Expected a function",RS=Math.max,$S=Math.min;function zS(t,e,r){var n,a,i,s,l,c,u=0,d=!1,f=!1,p=!0;if(typeof t!="function")throw new TypeError(VS);e=Jf(e)||0,Ln(r)&&(d=!!r.leading,f="maxWait"in r,i=f?RS(Jf(r.maxWait)||0,e):i,p="trailing"in r?!!r.trailing:p);function v(E){var k=n,B=a;return n=a=void 0,u=E,s=t.apply(B,k),s}function h(E){return u=E,l=setTimeout(m,e),d?v(E):s}function g(E){var k=E-c,B=E-u,S=e-k;return f?$S(S,i-B):S}function y(E){var k=E-c,B=E-u;return c===void 0||k>=e||k<0||f&&B>=i}function m(){var E=zl();if(y(E))return b(E);l=setTimeout(m,g(E))}function b(E){return l=void 0,p&&n?v(E):(n=a=void 0,s)}function w(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function C(){return l===void 0?s:b(zl())}function x(){var E=zl(),k=y(E);if(n=arguments,a=this,c=E,k){if(l===void 0)return h(c);if(f)return clearTimeout(l),l=setTimeout(m,e),v(c)}return l===void 0&&(l=setTimeout(m,e)),s}return x.cancel=w,x.flush=C,x}var Lo=zS,Hl=st?st.performance:null,eh=Hl&&Hl.now?function(){return Hl.now()}:function(){return Date.now()},HS=function(){if(st){if(st.requestAnimationFrame)return function(t){st.requestAnimationFrame(t)};if(st.mozRequestAnimationFrame)return function(t){st.mozRequestAnimationFrame(t)};if(st.webkitRequestAnimationFrame)return function(t){st.webkitRequestAnimationFrame(t)};if(st.msRequestAnimationFrame)return function(t){st.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(eh())},1e3/60)}}(),Mo=function(e){return HS(e)},Vr=eh,pa=9261,th=65599,Ci=5381,rh=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pa,n=r,a;a=e.next(),!a.done;)n=n*th+a.value|0;return n},ki=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pa;return r*th+e|0},xi=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ci;return(r<<5)+r+e|0},KS=function(e,r){return e*2097152+r},an=function(e){return e[0]*2097152+e[1]},Fo=function(e,r){return[ki(e[0],r[0]),xi(e[1],r[1])]},qS=function(e,r){var n={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?n.value=e[a++]:n.done=!0,n}};return rh(s,r)},Mn=function(e,r){var n={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}};return rh(s,r)},nh=function(){return US(arguments)},US=function(e){for(var r,n=0;n<e.length;n++){var a=e[n];n===0?r=Mn(a):r=Mn(a,r)}return r},ah=!0,GS=console.warn!=null,WS=console.trace!=null,Kl=Number.MAX_SAFE_INTEGER||9007199254740991,ih=function(){return!0},Ao=function(){return!1},oh=function(){return 0},ql=function(){},Ze=function(e){throw new Error(e)},sh=function(e){if(e!==void 0)ah=!!e;else return ah},Ae=function(e){sh()&&(GS?console.warn(e):(console.log(e),WS&&console.trace()))},jS=function(e){return xe({},e)},Cr=function(e){return e==null?e:Ke(e)?e.slice():Oe(e)?jS(e):e},YS=function(e){return e.slice()},lh=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},ZS={},ch=function(){return ZS},wt=function(e){var r=Object.keys(e);return function(n){for(var a={},i=0;i<r.length;i++){var s=r[i],l=n==null?void 0:n[s];a[s]=l===void 0?e[s]:l}return a}},on=function(e,r,n){for(var a=e.length-1;a>=0;a--)e[a]===r&&e.splice(a,1)},Ul=function(e){e.splice(0,e.length)},XS=function(e,r){for(var n=0;n<r.length;n++){var a=r[n];e.push(a)}},ur=function(e,r,n){return n&&(r=qf(n,r)),e[r]},sn=function(e,r,n,a){n&&(r=qf(n,r)),e[r]=a},QS=function(){function t(){Al(this,t),this._obj={}}return Vl(t,[{key:"set",value:function(r,n){return this._obj[r]=n,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}]),t}(),kr=typeof Map<"u"?Map:QS,JS="undefined",eT=function(){function t(e){if(Al(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var n=0;n<r.length;n++)this.add(r[n])}}return Vl(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var n=this._obj;n[r]!==1&&(n[r]=1,this.size++)}},{key:"delete",value:function(r){var n=this._obj;n[r]===1&&(n[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(n){return r.has(n)})}},{key:"forEach",value:function(r,n){return this.toArray().forEach(r,n)}}]),t}(),va=(typeof Set>"u"?"undefined":ot(Set))!==JS?Set:eT,Vo=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Rl(e)){Ze("An element must have a core reference and parameters set");return}var a=r.group;if(a==null&&(r.data&&r.data.source!=null&&r.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:r.data||{},position:r.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:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?a==="edges":!!r.pannable,active:!1,classes:new va,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.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),r.renderedPosition){var s=r.renderedPosition,l=e.pan(),c=e.zoom();i.position={x:(s.x-l.x)/c,y:(s.y-l.y)/c}}var u=[];Ke(r.classes)?u=r.classes:be(r.classes)&&(u=r.classes.split(/\s+/));for(var d=0,f=u.length;d<f;d++){var p=u[d];!p||p===""||i.classes.add(p)}this.createEmitter();var v=r.style||r.css;v&&(Ae("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(v)),(n===void 0||n)&&this.restore()},uh=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var s;Oe(n)&&!Ut(n)&&(s=n,n=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,c=n=be(n)?this.filter(n):n,u=[],d=[],f={},p={},v={},h=0,g,y=this.byGroup(),m=y.nodes,b=y.edges,w=0;w<c.length;w++){var C=c[w],x=C.id();C.isNode()&&(u.unshift(C),e.bfs&&(v[x]=!0,d.push(C)),p[x]=0)}for(var E=function(){var I=e.bfs?u.shift():u.pop(),_=I.id();if(e.dfs){if(v[_])return"continue";v[_]=!0,d.push(I)}var F=p[_],O=f[_],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,h++,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],u.push(ee),e.bfs&&(v[J]=!0,d.push(ee)),f[J]=j,p[J]=p[_]+1)}};u.length!==0;){var k=E();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)}}},Ei={breadthFirstSearch:uh({bfs:!0}),depthFirstSearch:uh({dfs:!0})};Ei.bfs=Ei.breadthFirstSearch,Ei.dfs=Ei.depthFirstSearch;var tT=iS(function(t,e){(function(){var r,n,a,i,s,l,c,u,d,f,p,v,h,g,y;a=Math.floor,f=Math.min,n=function(m,b){return m<b?-1:m>b?1:0},d=function(m,b,w,C,x){var E;if(w==null&&(w=0),x==null&&(x=n),w<0)throw new Error("lo must be non-negative");for(C==null&&(C=m.length);w<C;)E=a((w+C)/2),x(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=n),m.push(b),g(m,0,m.length-1,w)},s=function(m,b){var w,C;return b==null&&(b=n),w=m.pop(),m.length?(C=m[0],m[0]=w,y(m,0,b)):C=w,C},u=function(m,b,w){var C;return w==null&&(w=n),C=m[0],m[0]=b,y(m,0,w),C},c=function(m,b,w){var C;return w==null&&(w=n),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,x,E,k,B;for(b==null&&(b=n),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(),k=[],C=0,x=E.length;C<x;C++)w=E[C],k.push(y(m,w,b));return k},h=function(m,b,w){var C;if(w==null&&(w=n),C=m.indexOf(b),C!==-1)return g(m,0,C,w),y(m,C,w)},p=function(m,b,w){var C,x,E,k,B;if(w==null&&(w=n),x=m.slice(0,b),!x.length)return x;for(i(x,w),B=m.slice(b),E=0,k=B.length;E<k;E++)C=B[E],c(x,C,w);return x.sort(w).reverse()},v=function(m,b,w){var C,x,E,k,B,S,N,D,P;if(w==null&&(w=n),b*10<=m.length){if(E=m.slice(0,b).sort(w),!E.length)return E;for(x=E[E.length-1],N=m.slice(b),k=0,S=N.length;k<S;k++)C=N[k],w(C,x)<0&&(d(E,C,0,null,w),E.pop(),x=E[E.length-1]);return E}for(i(m,w),P=[],B=0,D=f(b,m.length);0<=D?B<D:B>D;0<=D?++B:--B)P.push(s(m,w));return P},g=function(m,b,w,C){var x,E,k;for(C==null&&(C=n),x=m[w];w>b;){if(k=w-1>>1,E=m[k],C(x,E)<0){m[w]=E,w=k;continue}break}return m[w]=x},y=function(m,b,w){var C,x,E,k,B;for(w==null&&(w=n),x=m.length,B=b,E=m[b],C=2*b+1;C<x;)k=C+1,k<x&&!(w(m[C],m[k])<0)&&(C=k),m[b]=m[C],b=C,C=2*b+1;return m[b]=E,g(m,B,b,w)},r=function(){m.push=l,m.pop=s,m.replace=u,m.pushpop=c,m.heapify=i,m.updateItem=h,m.nlargest=p,m.nsmallest=v;function m(b){this.cmp=b??n,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 u(this.nodes,b,this.cmp)},m.prototype.pushpop=function(b){return c(this.nodes,b,this.cmp)},m.prototype.heapify=function(){return i(this.nodes,this.cmp)},m.prototype.updateItem=function(b){return h(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 r})}).call(yi)}),Si=tT,rT=wt({root:null,weight:function(e){return 1},directed:!1}),nT={dijkstra:function(e){if(!Oe(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var n=rT(e),a=n.root,i=n.weight,s=n.directed,l=this,c=i,u=be(a)?this.filter(a)[0]:a[0],d={},f={},p={},v=this.byGroup(),h=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 Si(function(F,O){return y(F)-y(O)}),w=0;w<h.length;w++){var C=h[w];d[C.id()]=C.same(u)?0:1/0,b.push(C)}for(var x=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=c(z);(j<V||!H)&&(V=j,H=z)}return{edge:H,dist:V}};b.size()>0;){var E=b.pop(),k=y(E),B=E.id();if(p[B]=k,k!==1/0)for(var S=E.neighborhood().intersect(h),N=0;N<S.length;N++){var D=S[N],P=D.id(),I=x(E,D),_=k+I.dist;_<y(D)&&(m(D,_),f[P]={node:E,edge:I.edge})}}return{distanceTo:function(O){var M=be(O)?h.filter(O)[0]:O[0];return p[M.id()]},pathTo:function(O){var M=be(O)?h.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)}}}},aT={kruskal:function(e){e=e||function(w){return 1};for(var r=this.byGroup(),n=r.nodes,a=r.edges,i=n.length,s=new Array(i),l=n,c=function(C){for(var x=0;x<s.length;x++){var E=s[x];if(E.has(C))return x}},u=0;u<i;u++)s[u]=this.spawn(n[u]);for(var d=a.sort(function(w,C){return e(w)-e(C)}),f=0;f<d.length;f++){var p=d[f],v=p.source()[0],h=p.target()[0],g=c(v),y=c(h),m=s[g],b=s[y];g!==y&&(l.merge(p),m.merge(b),s.splice(y,1))}return l}},iT=wt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),oT={aStar:function(e){var r=this.cy(),n=iT(e),a=n.root,i=n.goal,s=n.heuristic,l=n.directed,c=n.weight;a=r.collection(a)[0],i=r.collection(i)[0];var u=a.id(),d=i.id(),f={},p={},v={},h=new Si(function(H,$){return p[H.id()]-p[$.id()]}),g=new va,y={},m={},b=function($,z){h.push($),g.add(z)},w,C,x=function(){w=h.pop(),C=w.id(),g.delete(C)},E=function($){return g.has($)};b(a,u),f[u]=0,p[u]=s(a);for(var k=0;h.size()>0;){if(x(),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 P=w._private.edges,I=0;I<P.length;I++){var _=P[I];if(this.hasElementWithId(_.id())&&!(l&&_.data("source")!==C)){var F=_.source(),O=_.target(),M=F.id()!==C?F:O,L=M.id();if(this.hasElementWithId(L)&&!v[L]){var V=f[C]+c(_);if(!E(L)){f[L]=V,p[L]=V+s(M),b(M,L),y[L]=w,m[L]=_;continue}V<f[L]&&(f[L]=V,p[L]=V+s(M),y[L]=w,m[L]=_)}}}}return{found:!1,distance:void 0,path:void 0,steps:k}}},sT=wt({weight:function(e){return 1},directed:!1}),lT={floydWarshall:function(e){for(var r=this.cy(),n=sT(e),a=n.weight,i=n.directed,s=a,l=this.byGroup(),c=l.nodes,u=l.edges,d=c.length,f=d*d,p=function(j){return c.indexOf(j)},v=function(j){return c[j]},h=new Array(f),g=0;g<f;g++){var y=g%d,m=(g-y)/d;m===y?h[g]=0:h[g]=1/0}for(var b=new Array(f),w=new Array(f),C=0;C<u.length;C++){var x=u[C],E=x.source()[0],k=x.target()[0];if(E!==k){var B=p(E),S=p(k),N=B*d+S,D=s(x);if(h[N]>D&&(h[N]=D,b[N]=S,w[N]=x),!i){var P=S*d+B;!i&&h[P]>D&&(h[P]=D,b[P]=B,w[P]=x)}}}for(var I=0;I<d;I++)for(var _=0;_<d;_++)for(var F=_*d+I,O=0;O<d;O++){var M=_*d+O,L=I*d+O;h[F]+h[L]<h[M]&&(h[M]=h[F]+h[L],b[M]=b[F])}var V=function(j){return(be(j)?r.filter(j):j)[0]},H=function(j){return p(V(j))},$={distance:function(j,ee){var J=H(j),X=H(ee);return h[J*d+X]},path:function(j,ee){var J=H(j),X=H(ee),re=v(J);if(J===X)return re.collection();if(b[J*d+X]==null)return r.collection();var Y=r.collection(),A=J,K;for(Y.merge(re);J!==X;)A=J,J=b[J*d+X],K=w[A*d+J],Y.merge(K),Y.merge(v(J));return Y}};return $}},cT=wt({weight:function(e){return 1},directed:!1,root:null}),uT={bellmanFord:function(e){var r=this,n=cT(e),a=n.weight,i=n.directed,s=n.root,l=a,c=this,u=this.cy(),d=this.byGroup(),f=d.edges,p=d.nodes,v=p.length,h=new kr,g=!1,y=[];s=u.collection(s)[0],f.unmergeBy(function(pe){return pe.isLoop()});for(var m=f.length,b=function(de){var me=h.get(de.id());return me||(me={},h.set(de.id(),me)),me},w=function(de){return(be(de)?u.$(de):de)[0]},C=function(de){return b(w(de)).dist},x=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 r.spawn();var Pe=b(Ee),te=Pe.edge,T=Pe.pred;if(De.unshift(Ee[0]),Ee.same(me)&&De.length>0)break;te!=null&&De.unshift(te),Ee=T}return c.spawn(De)},E=0;E<v;E++){var k=p[E],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,Pe){var te=De.dist+Pe;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 P=0;P<m;P++){var I=f[P],_=I.source(),F=I.target(),O=l(I),M=b(_),L=b(F);N(_,F,I,M,L,O),i||N(F,_,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||(Ae("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),e.findNegativeWeightCycles!==!1){var re=[];J+ee<X&&re.push(z),!i&&X+ee<J&&re.push(j);for(var Y=re.length,A=0;A<Y;A++){var K=re[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(),ne=0,se=2;se<W.length;se+=2)W[se].id()<he&&(he=W[se].id(),ne=se);W=W.slice(ne).concat(W.slice(0,ne)),W.push(W[0]);var ue=W.map(function(pe){return pe.id()}).join(",");V.indexOf(ue)===-1&&(y.push(c.spawn(W)),V.push(ue))}}else break}return{distanceTo:C,pathTo:x,hasNegativeWeightCycle:g,negativeWeightCycles:y}}},dT=Math.sqrt(2),fT=function(e,r,n){n.length===0&&Ze("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],i=a[1],s=a[2],l=r[i],c=r[s],u=n,d=u.length-1;d>=0;d--){var f=u[d],p=f[1],v=f[2];(r[p]===l&&r[v]===c||r[p]===c&&r[v]===l)&&u.splice(d,1)}for(var h=0;h<u.length;h++){var g=u[h];g[1]===c?(u[h]=g.slice(),u[h][1]=l):g[2]===c&&(u[h]=g.slice(),u[h][2]=l)}for(var y=0;y<r.length;y++)r[y]===c&&(r[y]=l);return u},Gl=function(e,r,n,a){for(;n>a;){var i=Math.floor(Math.random()*r.length);r=fT(i,e,r),n--}return r},hT={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,a=r.edges;a.unmergeBy(function(L){return L.isLoop()});var i=n.length,s=a.length,l=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),c=Math.floor(i/dT);if(i<2){Ze("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],d=0;d<s;d++){var f=a[d];u.push([d,n.indexOf(f.source()),n.indexOf(f.target())])}for(var p=1/0,v=[],h=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=Gl(g,u.slice(),i,c),x=C.slice();m(g,y);var E=Gl(g,C,c,2),k=Gl(y,x,c,2);E.length<=k.length&&E.length<p?(p=E.length,v=E,m(g,h)):k.length<=E.length&&k.length<p&&(p=k.length,v=k,m(y,h))}for(var B=this.spawn(v.map(function(L){return a[L[0]]})),S=this.spawn(),N=this.spawn(),D=h[0],P=0;P<h.length;P++){var I=h[P],_=n[P];I===D?S.merge(_):N.merge(_)}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}},pT=function(e){return{x:e.x,y:e.y}},Ro=function(e,r,n){return{x:e.x*r+n.x,y:e.y*r+n.y}},dh=function(e,r,n){return{x:(e.x-n.x)/r,y:(e.y-n.y)/r}},ga=function(e){return{x:e[0],y:e[1]}},vT=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=r;i<n;i++){var s=e[i];isFinite(s)&&(a=Math.min(s,a))}return a},gT=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=r;i<n;i++){var s=e[i];isFinite(s)&&(a=Math.max(s,a))}return a},mT=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,s=r;s<n;s++){var l=e[s];isFinite(l)&&(a+=l,i++)}return a/i},yT=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=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(r,n):(n<e.length&&e.splice(n,e.length-n),r>0&&e.splice(0,r));for(var l=0,c=e.length-1;c>=0;c--){var u=e[c];s?isFinite(u)||(e[c]=-1/0,l++):e.splice(c,1)}i&&e.sort(function(p,v){return p-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},bT=function(e){return Math.PI*e/180},$o=function(e,r){return Math.atan2(r,e)-Math.PI/2},Wl=Math.log2||function(t){return Math.log(t)/Math.log(2)},fh=function(e){return e>0?1:e<0?-1:0},Fn=function(e,r){return Math.sqrt(An(e,r))},An=function(e,r){var n=r.x-e.x,a=r.y-e.y;return n*n+a*a},wT=function(e){for(var r=e.length,n=0,a=0;a<r;a++)n+=e[a];for(var i=0;i<r;i++)e[i]=e[i]/n;return e},ft=function(e,r,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*r+a*a*n},ma=function(e,r,n,a){return{x:ft(e.x,r.x,n.x,a),y:ft(e.y,r.y,n.y,a)}},CT=function(e,r,n,a){var i={x:r.x-e.x,y:r.y-e.y},s=Fn(e,r),l={x:i.x/s,y:i.y/s};return n=n??0,a=a??n*s,{x:e.x+l.x*a,y:e.y+l.y*a}},Ti=function(e,r,n){return Math.max(e,Math.min(n,r))},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}}},kT=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},xT=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},ET=function(e,r,n){return{x1:e.x1+r,x2:e.x2+r,y1:e.y1+n,y2:e.y2+n,w:e.w,h:e.h}},hh=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},ST=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},zo=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Ho=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,a,i,s;if(r.length===1)n=a=i=s=r[0];else if(r.length===2)n=i=r[0],s=a=r[1];else if(r.length===4){var l=cr(r,4);n=l[0],a=l[1],i=l[2],s=l[3]}return e.x1-=s,e.x2+=a,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},ph=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},jl=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},ya=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},TT=function(e,r){return ya(e,r.x,r.y)},vh=function(e,r){return ya(e,r.x1,r.y1)&&ya(e,r.x2,r.y2)},gh=function(e,r,n,a,i,s,l){var c=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=c==="auto"?Rn(i,s):c,d=i/2,f=s/2;u=Math.min(u,d,f);var p=u!==d,v=u!==f,h;if(p){var g=n-d+u-l,y=a-f-l,m=n+d-u+l,b=y;if(h=ln(e,r,n,a,g,y,m,b,!1),h.length>0)return h}if(v){var w=n+d+l,C=a-f+u-l,x=w,E=a+f-u+l;if(h=ln(e,r,n,a,w,C,x,E,!1),h.length>0)return h}if(p){var k=n-d+u-l,B=a+f+l,S=n+d-u+l,N=B;if(h=ln(e,r,n,a,k,B,S,N,!1),h.length>0)return h}if(v){var D=n-d-l,P=a-f+u-l,I=D,_=a+f-u+l;if(h=ln(e,r,n,a,D,P,I,_,!1),h.length>0)return h}var F;{var O=n-d+u,M=a-f+u;if(F=Bi(e,r,n,a,O,M,u+l),F.length>0&&F[0]<=O&&F[1]<=M)return[F[0],F[1]]}{var L=n+d-u,V=a-f+u;if(F=Bi(e,r,n,a,L,V,u+l),F.length>0&&F[0]>=L&&F[1]<=V)return[F[0],F[1]]}{var H=n+d-u,$=a+f-u;if(F=Bi(e,r,n,a,H,$,u+l),F.length>0&&F[0]>=H&&F[1]>=$)return[F[0],F[1]]}{var z=n-d+u,j=a+f-u;if(F=Bi(e,r,n,a,z,j,u+l),F.length>0&&F[0]<=z&&F[1]>=j)return[F[0],F[1]]}return[]},BT=function(e,r,n,a,i,s,l){var c=l,u=Math.min(n,i),d=Math.max(n,i),f=Math.min(a,s),p=Math.max(a,s);return u-c<=e&&e<=d+c&&f-c<=r&&r<=p+c},NT=function(e,r,n,a,i,s,l,c,u){var d={x1:Math.min(n,l,i)-u,x2:Math.max(n,l,i)+u,y1:Math.min(a,c,s)-u,y2:Math.max(a,c,s)+u};return!(e<d.x1||e>d.x2||r<d.y1||r>d.y2)},DT=function(e,r,n,a){n-=a;var i=r*r-4*e*n;if(i<0)return[];var s=Math.sqrt(i),l=2*e,c=(-r+s)/l,u=(-r-s)/l;return[c,u]},PT=function(e,r,n,a,i){var s=1e-5;e===0&&(e=s),r/=e,n/=e,a/=e;var l,c,u,d,f,p,v,h;if(c=(3*n-r*r)/9,u=-(27*a)+r*(9*n-2*(r*r)),u/=54,l=c*c*c+u*u,i[1]=0,v=r/3,l>0){f=u+Math.sqrt(l),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),p=u-Math.sqrt(l),p=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),i[0]=-v+f+p,v+=(f+p)/2,i[4]=i[2]=-v,v=Math.sqrt(3)*(-p+f)/2,i[3]=v,i[5]=-v;return}if(i[5]=i[3]=0,l===0){h=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-v+2*h,i[4]=i[2]=-(h+v);return}c=-c,d=c*c*c,d=Math.acos(u/Math.sqrt(d)),h=2*Math.sqrt(c),i[0]=-v+h*Math.cos(d/3),i[2]=-v+h*Math.cos((d+2*Math.PI)/3),i[4]=-v+h*Math.cos((d+4*Math.PI)/3)},_T=function(e,r,n,a,i,s,l,c){var u=1*n*n-4*n*i+2*n*l+4*i*i-4*i*l+l*l+a*a-4*a*s+2*a*c+4*s*s-4*s*c+c*c,d=1*9*n*i-3*n*n-3*n*l-6*i*i+3*i*l+9*a*s-3*a*a-3*a*c-6*s*s+3*s*c,f=1*3*n*n-6*n*i+n*l-n*e+2*i*i+2*i*e-l*e+3*a*a-6*a*s+a*c-a*r+2*s*s+2*s*r-c*r,p=1*n*i-n*n+n*e-i*e+a*s-a*a+a*r-s*r,v=[];PT(u,d,f,p,v);for(var h=1e-7,g=[],y=0;y<6;y+=2)Math.abs(v[y+1])<h&&v[y]>=0&&v[y]<=1&&g.push(v[y]);g.push(1),g.push(0);for(var m=-1,b,w,C,x=0;x<g.length;x++)b=Math.pow(1-g[x],2)*n+2*(1-g[x])*g[x]*i+g[x]*g[x]*l,w=Math.pow(1-g[x],2)*a+2*(1-g[x])*g[x]*s+g[x]*g[x]*c,C=Math.pow(b-e,2)+Math.pow(w-r,2),m>=0?C<m&&(m=C):m=C;return m},OT=function(e,r,n,a,i,s){var l=[e-n,r-a],c=[i-n,s-a],u=c[0]*c[0]+c[1]*c[1],d=l[0]*l[0]+l[1]*l[1],f=l[0]*c[0]+l[1]*c[1],p=f*f/u;return f<0?d:p>u?(e-i)*(e-i)+(r-s)*(r-s):d-p},Ht=function(e,r,n){for(var a,i,s,l,c,u=0,d=0;d<n.length/2;d++)if(a=n[d*2],i=n[d*2+1],d+1<n.length/2?(s=n[(d+1)*2],l=n[(d+1)*2+1]):(s=n[(d+1-n.length/2)*2],l=n[(d+1-n.length/2)*2+1]),!(a==e&&s==e))if(a>=e&&e>=s||a<=e&&e<=s)c=(e-a)/(s-a)*(l-i)+i,c>r&&u++;else continue;return u%2!==0},Rr=function(e,r,n,a,i,s,l,c,u){var d=new Array(n.length),f;c[0]!=null?(f=Math.atan(c[1]/c[0]),c[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=c;for(var p=Math.cos(-f),v=Math.sin(-f),h=0;h<d.length/2;h++)d[h*2]=s/2*(n[h*2]*p-n[h*2+1]*v),d[h*2+1]=l/2*(n[h*2+1]*p+n[h*2]*v),d[h*2]+=a,d[h*2+1]+=i;var g;if(u>0){var y=qo(d,-u);g=Ko(y)}else g=d;return Ht(e,r,g)},IT=function(e,r,n,a,i,s,l,c){for(var u=new Array(n.length*2),d=0;d<c.length;d++){var f=c[d];u[d*4+0]=f.startX,u[d*4+1]=f.startY,u[d*4+2]=f.stopX,u[d*4+3]=f.stopY;var p=Math.pow(f.cx-e,2)+Math.pow(f.cy-r,2);if(p<=Math.pow(f.radius,2))return!0}return Ht(e,r,u)},Ko=function(e){for(var r=new Array(e.length/2),n,a,i,s,l,c,u,d,f=0;f<e.length/4;f++){n=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],c=e[(f+1)*4+1],u=e[(f+1)*4+2],d=e[(f+1)*4+3]):(l=e[0],c=e[1],u=e[2],d=e[3]);var p=ln(n,a,i,s,l,c,u,d,!0);r[f*2]=p[0],r[f*2+1]=p[1]}return r},qo=function(e,r){for(var n=new Array(e.length*2),a,i,s,l,c=0;c<e.length/2;c++){a=e[c*2],i=e[c*2+1],c<e.length/2-1?(s=e[(c+1)*2],l=e[(c+1)*2+1]):(s=e[0],l=e[1]);var u=l-i,d=-(s-a),f=Math.sqrt(u*u+d*d),p=u/f,v=d/f;n[c*4]=a+p*r,n[c*4+1]=i+v*r,n[c*4+2]=s+p*r,n[c*4+3]=l+v*r}return n},LT=function(e,r,n,a,i,s){var l=n-e,c=a-r;l/=i,c/=s;var u=Math.sqrt(l*l+c*c),d=u-1;if(d<0)return[];var f=d/u;return[(n-e)*f+e,(a-r)*f+r]},Vn=function(e,r,n,a,i,s,l){return e-=i,r-=s,e/=n/2+l,r/=a/2+l,e*e+r*r<=1},Bi=function(e,r,n,a,i,s,l){var c=[n-e,a-r],u=[e-i,r-s],d=c[0]*c[0]+c[1]*c[1],f=2*(u[0]*c[0]+u[1]*c[1]),p=u[0]*u[0]+u[1]*u[1]-l*l,v=f*f-4*d*p;if(v<0)return[];var h=(-f+Math.sqrt(v))/(2*d),g=(-f-Math.sqrt(v))/(2*d),y=Math.min(h,g),m=Math.max(h,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]*c[0]+e,C=b[0]*c[1]+r;if(b.length>1){if(b[0]==b[1])return[w,C];var x=b[1]*c[0]+e,E=b[1]*c[1]+r;return[w,C,x,E]}else return[w,C]},Yl=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},ln=function(e,r,n,a,i,s,l,c,u){var d=e-i,f=n-e,p=l-i,v=r-s,h=a-r,g=c-s,y=p*v-g*d,m=f*v-h*d,b=g*f-p*h;if(b!==0){var w=y/b,C=m/b,x=.001,E=0-x,k=1+x;return E<=w&&w<=k&&E<=C&&C<=k?[e+w*f,r+w*h]:u?[e+w*f,r+w*h]:[]}else return y===0||m===0?Yl(e,n,l)===l?[l,c]:Yl(e,n,i)===i?[i,s]:Yl(i,l,n)===n?[n,a]:[]:[]},Ni=function(e,r,n,a,i,s,l,c){var u=[],d,f=new Array(n.length),p=!0;s==null&&(p=!1);var v;if(p){for(var h=0;h<f.length/2;h++)f[h*2]=n[h*2]*s+a,f[h*2+1]=n[h*2+1]*l+i;if(c>0){var g=qo(f,-c);v=Ko(g)}else v=f}else v=n;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=ln(e,r,a,i,y,m,b,w),d.length!==0&&u.push(d[0],d[1]);return u},MT=function(e,r,n,a,i,s,l,c,u){var d=[],f,p=new Array(n.length*2);u.forEach(function(b,w){w===0?(p[p.length-2]=b.startX,p[p.length-1]=b.startY):(p[w*4-2]=b.startX,p[w*4-1]=b.startY),p[w*4]=b.stopX,p[w*4+1]=b.stopY,f=Bi(e,r,a,i,b.cx,b.cy,b.radius),f.length!==0&&d.push(f[0],f[1])});for(var v=0;v<p.length/4;v++)f=ln(e,r,a,i,p[v*4],p[v*4+1],p[v*4+2],p[v*4+3],!1),f.length!==0&&d.push(f[0],f[1]);if(d.length>2){for(var h=[d[0],d[1]],g=Math.pow(h[0]-e,2)+Math.pow(h[1]-r,2),y=1;y<d.length/2;y++){var m=Math.pow(d[y*2]-e,2)+Math.pow(d[y*2+1]-r,2);m<=g&&(h[0]=d[y*2],h[1]=d[y*2+1],g=m)}return h}return d},Uo=function(e,r,n){var a=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),s=(i-n)/i;return s<0&&(s=1e-5),[r[0]+s*a[0],r[1]+s*a[1]]},Mt=function(e,r){var n=Zl(e,r);return n=mh(n),n},mh=function(e){for(var r,n,a=e.length/2,i=1/0,s=1/0,l=-1/0,c=-1/0,u=0;u<a;u++)r=e[2*u],n=e[2*u+1],i=Math.min(i,r),l=Math.max(l,r),s=Math.min(s,n),c=Math.max(c,n);for(var d=2/(l-i),f=2/(c-s),p=0;p<a;p++)r=e[2*p]=e[2*p]*d,n=e[2*p+1]=e[2*p+1]*f,i=Math.min(i,r),l=Math.max(l,r),s=Math.min(s,n),c=Math.max(c,n);if(s<-1)for(var v=0;v<a;v++)n=e[2*v+1]=e[2*v+1]+(-1-s);return e},Zl=function(e,r){var n=1/e*2*Math.PI,a=e%2===0?Math.PI/2+n/2:Math.PI/2;a+=r;for(var i=new Array(e*2),s,l=0;l<e;l++)s=l*n+a,i[2*l]=Math.cos(s),i[2*l+1]=Math.sin(-s);return i},Rn=function(e,r){return Math.min(e/4,r/4,8)},yh=function(e,r){return Math.min(e/10,r/10,8)},Xl=function(){return 8},FT=function(e,r,n){return[e-2*r+n,2*(r-e),e]},Ql=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},AT=wt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),VT={pageRank:function(e){for(var r=AT(e),n=r.dampingFactor,a=r.precision,i=r.iterations,s=r.weight,l=this._private.cy,c=this.byGroup(),u=c.nodes,d=c.edges,f=u.length,p=f*f,v=d.length,h=new Array(p),g=new Array(f),y=(1-n)/f,m=0;m<f;m++){for(var b=0;b<f;b++){var w=m*f+b;h[w]=0}g[m]=0}for(var C=0;C<v;C++){var x=d[C],E=x.data("source"),k=x.data("target");if(E!==k){var B=u.indexOfId(E),S=u.indexOfId(k),N=s(x),D=S*f+B;h[D]+=N,g[B]+=N}}for(var P=1/f+y,I=0;I<f;I++)if(g[I]===0)for(var _=0;_<f;_++){var F=_*f+I;h[F]=P}else for(var O=0;O<f;O++){var M=O*f+I;h[M]=h[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]+=h[X]*L[J]}wT(V),H=L,L=V,V=H;for(var re=0,Y=0;Y<f;Y++){var A=H[Y]-L[Y];re+=A*A}if(re<a)break}var K={rank:function(oe){return oe=l.collection(oe)[0],L[u.indexOf(oe)]}};return K}},bh=wt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),ba={degreeCentralityNormalized:function(e){e=bh(e);var r=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var d={},f={},p=0,v=0,h=0;h<a;h++){var g=n[h],y=g.id();e.root=g;var m=this.degreeCentrality(e);p<m.indegree&&(p=m.indegree),v<m.outdegree&&(v=m.outdegree),d[y]=m.indegree,f[y]=m.outdegree}return{indegree:function(w){return p==0?0:(be(w)&&(w=r.filter(w)),d[w.id()]/p)},outdegree:function(w){return v===0?0:(be(w)&&(w=r.filter(w)),f[w.id()]/v)}}}else{for(var i={},s=0,l=0;l<a;l++){var c=n[l];e.root=c;var u=this.degreeCentrality(e);s<u.degree&&(s=u.degree),i[c.id()]=u.degree}return{degree:function(w){return s===0?0:(be(w)&&(w=r.filter(w)),i[w.id()]/s)}}}},degreeCentrality:function(e){e=bh(e);var r=this.cy(),n=this,a=e,i=a.root,s=a.weight,l=a.directed,c=a.alpha;if(i=r.collection(i)[0],l){for(var v=i.connectedEdges(),h=v.filter(function(E){return E.target().same(i)&&n.has(E)}),g=v.filter(function(E){return E.source().same(i)&&n.has(E)}),y=h.length,m=g.length,b=0,w=0,C=0;C<h.length;C++)b+=s(h[C]);for(var x=0;x<g.length;x++)w+=s(g[x]);return{indegree:Math.pow(y,1-c)*Math.pow(b,c),outdegree:Math.pow(m,1-c)*Math.pow(w,c)}}else{for(var u=i.connectedEdges().intersection(n),d=u.length,f=0,p=0;p<u.length;p++)f+=s(u[p]);return{degree:Math.pow(d,1-c)*Math.pow(f,c)}}}};ba.dc=ba.degreeCentrality,ba.dcn=ba.degreeCentralityNormalised=ba.degreeCentralityNormalized;var wh=wt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),wa={closenessCentralityNormalized:function(e){for(var r=wh(e),n=r.harmonic,a=r.weight,i=r.directed,s=this.cy(),l={},c=0,u=this.nodes(),d=this.floydWarshall({weight:a,directed:i}),f=0;f<u.length;f++){for(var p=0,v=u[f],h=0;h<u.length;h++)if(f!==h){var g=d.distance(v,u[h]);n?p+=1/g:p+=g}n||(p=1/p),c<p&&(c=p),l[v.id()]=p}return{closeness:function(m){return c==0?0:(be(m)?m=s.filter(m)[0].id():m=m.id(),l[m]/c)}}},closenessCentrality:function(e){var r=wh(e),n=r.root,a=r.weight,i=r.directed,s=r.harmonic;n=this.filter(n)[0];for(var l=this.dijkstra({root:n,weight:a,directed:i}),c=0,u=this.nodes(),d=0;d<u.length;d++){var f=u[d];if(!f.same(n)){var p=l.distanceTo(f);s?c+=1/p:c+=p}}return s?c:1/c}};wa.cc=wa.closenessCentrality,wa.ccn=wa.closenessCentralityNormalised=wa.closenessCentralityNormalized;var RT=wt({weight:null,directed:!1}),Jl={betweennessCentrality:function(e){for(var r=RT(e),n=r.directed,a=r.weight,i=a!=null,s=this.cy(),l=this.nodes(),c={},u={},d=0,f={set:function(w,C){u[w]=C,C>d&&(d=C)},get:function(w){return u[w]}},p=0;p<l.length;p++){var v=l[p],h=v.id();n?c[h]=v.outgoers().nodes():c[h]=v.openNeighborhood().nodes(),f.set(h,0)}for(var g=function(w){for(var C=l[w].id(),x=[],E={},k={},B={},S=new Si(function(J,X){return B[J]-B[X]}),N=0;N<l.length;N++){var D=l[N].id();E[D]=[],k[D]=0,B[D]=1/0}for(k[C]=1,B[C]=0,S.push(C);!S.empty();){var P=S.pop();if(x.push(P),i)for(var I=0;I<c[P].length;I++){var _=c[P][I],F=s.getElementById(P),O=void 0;F.edgesTo(_).length>0?O=F.edgesTo(_)[0]:O=_.edgesTo(F)[0];var M=a(O);_=_.id(),B[_]>B[P]+M&&(B[_]=B[P]+M,S.nodes.indexOf(_)<0?S.push(_):S.updateItem(_),k[_]=0,E[_]=[]),B[_]==B[P]+M&&(k[_]=k[_]+k[P],E[_].push(P))}else for(var L=0;L<c[P].length;L++){var V=c[P][L].id();B[V]==1/0&&(S.push(V),B[V]=B[P]+1),B[V]==B[P]+1&&(k[V]=k[V]+k[P],E[V].push(P))}}for(var H={},$=0;$<l.length;$++)H[l[$].id()]=0;for(;x.length>0;){for(var z=x.pop(),j=0;j<E[z].length;j++){var ee=E[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}};Jl.bc=Jl.betweennessCentrality;var $T=wt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),zT=function(e){return $T(e)},HT=function(e,r){for(var n=0,a=0;a<r.length;a++)n+=r[a](e);return n},KT=function(e,r,n){for(var a=0;a<r;a++)e[a*r+a]=n},Ch=function(e,r){for(var n,a=0;a<r;a++){n=0;for(var i=0;i<r;i++)n+=e[i*r+a];for(var s=0;s<r;s++)e[s*r+a]=e[s*r+a]/n}},qT=function(e,r,n){for(var a=new Array(n*n),i=0;i<n;i++){for(var s=0;s<n;s++)a[i*n+s]=0;for(var l=0;l<n;l++)for(var c=0;c<n;c++)a[i*n+c]+=e[i*n+l]*r[l*n+c]}return a},UT=function(e,r,n){for(var a=e.slice(0),i=1;i<n;i++)e=qT(e,a,r);return e},GT=function(e,r,n){for(var a=new Array(r*r),i=0;i<r*r;i++)a[i]=Math.pow(e[i],n);return Ch(a,r),a},WT=function(e,r,n,a){for(var i=0;i<n;i++){var s=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),l=Math.round(r[i]*Math.pow(10,a))/Math.pow(10,a);if(s!==l)return!1}return!0},jT=function(e,r,n,a){for(var i=[],s=0;s<r;s++){for(var l=[],c=0;c<r;c++)Math.round(e[s*r+c]*1e3)/1e3>0&&l.push(n[c]);l.length!==0&&i.push(a.collection(l))}return i},YT=function(e,r){for(var n=0;n<e.length;n++)if(!r[n]||e[n].id()!==r[n].id())return!1;return!0},ZT=function(e){for(var r=0;r<e.length;r++)for(var n=0;n<e.length;n++)r!=n&&YT(e[r],e[n])&&e.splice(n,1);return e},kh=function(e){for(var r=this.nodes(),n=this.edges(),a=this.cy(),i=zT(e),s={},l=0;l<r.length;l++)s[r[l].id()]=l;for(var c=r.length,u=c*c,d=new Array(u),f,p=0;p<u;p++)d[p]=0;for(var v=0;v<n.length;v++){var h=n[v],g=s[h.source().id()],y=s[h.target().id()],m=HT(h,i.attributes);d[g*c+y]+=m,d[y*c+g]+=m}KT(d,c,i.multFactor),Ch(d,c);for(var b=!0,w=0;b&&w<i.maxIterations;)b=!1,f=UT(d,c,i.expandFactor),d=GT(f,c,i.inflateFactor),WT(d,f,u,4)||(b=!0),w++;var C=jT(d,c,r,a);return C=ZT(C),C},XT={markovClustering:kh,mcl:kh},QT=function(e){return e},xh=function(e,r){return Math.abs(r-e)},Eh=function(e,r,n){return e+xh(r,n)},Sh=function(e,r,n){return e+Math.pow(n-r,2)},JT=function(e){return Math.sqrt(e)},eB=function(e,r,n){return Math.max(e,xh(r,n))},Di=function(e,r,n,a,i){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:QT,l=a,c,u,d=0;d<e;d++)c=r(d),u=n(d),l=i(l,c,u);return s(l)},Ca={euclidean:function(e,r,n){return e>=2?Di(e,r,n,0,Sh,JT):Di(e,r,n,0,Eh)},squaredEuclidean:function(e,r,n){return Di(e,r,n,0,Sh)},manhattan:function(e,r,n){return Di(e,r,n,0,Eh)},max:function(e,r,n){return Di(e,r,n,-1/0,eB)}};Ca["squared-euclidean"]=Ca.squaredEuclidean,Ca.squaredeuclidean=Ca.squaredEuclidean;function Go(t,e,r,n,a,i){var s;return Ye(t)?s=t:s=Ca[t]||Ca.euclidean,e===0&&Ye(t)?s(a,i):s(e,r,n,a,i)}var tB=wt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),ec=function(e){return tB(e)},Wo=function(e,r,n,a,i){var s=i!=="kMedoids",l=s?function(f){return n[f]}:function(f){return a[f](n)},c=function(p){return a[p](r)},u=n,d=r;return Go(e,a.length,l,c,u,d)},tc=function(e,r,n){for(var a=n.length,i=new Array(a),s=new Array(a),l=new Array(r),c=null,u=0;u<a;u++)i[u]=e.min(n[u]).value,s[u]=e.max(n[u]).value;for(var d=0;d<r;d++){c=[];for(var f=0;f<a;f++)c[f]=Math.random()*(s[f]-i[f])+i[f];l[d]=c}return l},Th=function(e,r,n,a,i){for(var s=1/0,l=0,c=0;c<r.length;c++){var u=Wo(n,e,r[c],a,i);u<s&&(s=u,l=c)}return l},Bh=function(e,r,n){for(var a=[],i=null,s=0;s<r.length;s++)i=r[s],n[i.id()]===e&&a.push(i);return a},rB=function(e,r,n){return Math.abs(r-e)<=n},nB=function(e,r,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var s=Math.abs(e[a][i]-r[a][i]);if(s>n)return!1}return!0},aB=function(e,r,n){for(var a=0;a<n;a++)if(e===r[a])return!0;return!1},Nh=function(e,r){var n=new Array(r);if(e.length<50)for(var a=0;a<r;a++){for(var i=e[Math.floor(Math.random()*e.length)];aB(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var s=0;s<r;s++)n[s]=e[Math.floor(Math.random()*e.length)];return n},Dh=function(e,r,n){for(var a=0,i=0;i<r.length;i++)a+=Wo("manhattan",r[i],e,n,"kMedoids");return a},iB=function(e){var r=this.cy(),n=this.nodes(),a=null,i=ec(e),s=new Array(i.k),l={},c;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,c=tc(n,i.k,i.attributes)):ot(i.testCentroids)==="object"?c=i.testCentroids:c=tc(n,i.k,i.attributes):c=tc(n,i.k,i.attributes);for(var u=!0,d=0;u&&d<i.maxIterations;){for(var f=0;f<n.length;f++)a=n[f],l[a.id()]=Th(a,c,i.distance,i.attributes,"kMeans");u=!1;for(var p=0;p<i.k;p++){var v=Bh(p,n,l);if(v.length!==0){for(var h=i.attributes.length,g=c[p],y=new Array(h),m=new Array(h),b=0;b<h;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,rB(y[b],g[b],i.sensitivityThreshold)||(u=!0)}c[p]=y,s[p]=r.collection(v)}}d++}return s},oB=function(e){var r=this.cy(),n=this.nodes(),a=null,i=ec(e),s=new Array(i.k),l,c={},u,d=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(ot(i.testCentroids)==="object"?l=i.testCentroids:l=Nh(n,i.k)):l=Nh(n,i.k);for(var f=!0,p=0;f&&p<i.maxIterations;){for(var v=0;v<n.length;v++)a=n[v],c[a.id()]=Th(a,l,i.distance,i.attributes,"kMedoids");f=!1;for(var h=0;h<l.length;h++){var g=Bh(h,n,c);if(g.length!==0){d[h]=Dh(l[h],g,i.attributes);for(var y=0;y<g.length;y++)u=Dh(g[y],g,i.attributes),u<d[h]&&(d[h]=u,l[h]=g[y],f=!0);s[h]=r.collection(g)}}p++}return s},sB=function(e,r,n,a,i){for(var s,l,c=0;c<r.length;c++)for(var u=0;u<e.length;u++)a[c][u]=Math.pow(n[c][u],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 p=0;p<r.length;p++)s+=a[p][d]*i.attributes[f](r[p]),l+=a[p][d];e[d][f]=s/l}},lB=function(e,r,n,a,i){for(var s=0;s<e.length;s++)r[s]=e[s].slice();for(var l,c,u,d=2/(i.m-1),f=0;f<n.length;f++)for(var p=0;p<a.length;p++){l=0;for(var v=0;v<n.length;v++)c=Wo(i.distance,a[p],n[f],i.attributes,"cmeans"),u=Wo(i.distance,a[p],n[v],i.attributes,"cmeans"),l+=Math.pow(c/u,d);e[p][f]=1/l}},cB=function(e,r,n,a){for(var i=new Array(n.k),s=0;s<i.length;s++)i[s]=[];for(var l,c,u=0;u<r.length;u++){l=-1/0,c=-1;for(var d=0;d<r[0].length;d++)r[u][d]>l&&(l=r[u][d],c=d);i[c].push(e[u])}for(var f=0;f<i.length;f++)i[f]=a.collection(i[f]);return i},Ph=function(e){var r=this.cy(),n=this.nodes(),a=ec(e),i,s,l,c,u;c=new Array(n.length);for(var d=0;d<n.length;d++)c[d]=new Array(a.k);l=new Array(n.length);for(var f=0;f<n.length;f++)l[f]=new Array(a.k);for(var p=0;p<n.length;p++){for(var v=0,h=0;h<a.k;h++)l[p][h]=Math.random(),v+=l[p][h];for(var g=0;g<a.k;g++)l[p][g]=l[p][g]/v}s=new Array(a.k);for(var y=0;y<a.k;y++)s[y]=new Array(a.attributes.length);u=new Array(n.length);for(var m=0;m<n.length;m++)u[m]=new Array(a.k);for(var b=!0,w=0;b&&w<a.maxIterations;)b=!1,sB(s,n,l,u,a),lB(l,c,s,n,a),nB(l,c,a.sensitivityThreshold)||(b=!0),w++;return i=cB(n,l,a,r),{clusters:i,degreeOfMembership:l}},uB={kMeans:iB,kMedoids:oB,fuzzyCMeans:Ph,fcm:Ph},dB=wt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),fB={single:"min",complete:"max"},hB=function(e){var r=dB(e),n=fB[r.linkage];return n!=null&&(r.linkage=n),r},_h=function(e,r,n,a,i){for(var s=0,l=1/0,c,u=i.attributes,d=function(S,N){return Go(i.distance,u.length,function(D){return u[D](S)},function(D){return u[D](N)},S,N)},f=0;f<e.length;f++){var p=e[f].key,v=n[p][a[p]];v<l&&(s=p,l=v)}if(i.mode==="threshold"&&l>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var h=r[s],g=r[a[s]],y;i.mode==="dendrogram"?y={left:h,right:g,key:h.key}:y={value:h.value.concat(g.value),key:h.key},e[h.index]=y,e.splice(g.index,1),r[h.key]=y;for(var m=0;m<e.length;m++){var b=e[m];h.key===b.key?c=1/0:i.linkage==="min"?(c=n[h.key][b.key],n[h.key][b.key]>n[g.key][b.key]&&(c=n[g.key][b.key])):i.linkage==="max"?(c=n[h.key][b.key],n[h.key][b.key]<n[g.key][b.key]&&(c=n[g.key][b.key])):i.linkage==="mean"?c=(n[h.key][b.key]*h.size+n[g.key][b.key]*g.size)/(h.size+g.size):i.mode==="dendrogram"?c=d(b.value,h.value):c=d(b.value[0],h.value[0]),n[h.key][b.key]=n[b.key][h.key]=c}for(var w=0;w<e.length;w++){var C=e[w].key;if(a[C]===h.key||a[C]===g.key){for(var x=C,E=0;E<e.length;E++){var k=e[E].key;n[C][k]<n[C][x]&&(x=k)}a[C]=x}e[w].index=w}return h.key=g.key=h.index=g.index=null,!0},jo=function t(e,r,n){e&&(e.value?r.push(e.value):(e.left&&t(e.left,r),e.right&&t(e.right,r)))},pB=function t(e,r){if(!e)return"";if(e.left&&e.right){var n=t(e.left,r),a=t(e.right,r),i=r.add({group:"nodes",data:{id:n+","+a}});return r.add({group:"edges",data:{source:n,target:i.id()}}),r.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},vB=function t(e,r,n){if(!e)return[];var a=[],i=[],s=[];return r===0?(e.left&&jo(e.left,a),e.right&&jo(e.right,i),s=a.concat(i),[n.collection(s)]):r===1?e.value?[n.collection(e.value)]:(e.left&&jo(e.left,a),e.right&&jo(e.right,i),[n.collection(a),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(a=t(e.left,r-1,n)),e.right&&(i=t(e.right,r-1,n)),a.concat(i))},Oh=function(e){for(var r=this.cy(),n=this.nodes(),a=hB(e),i=a.attributes,s=function(w,C){return Go(a.distance,i.length,function(x){return i[x](w)},function(x){return i[x](C)},w,C)},l=[],c=[],u=[],d=[],f=0;f<n.length;f++){var p={value:a.mode==="dendrogram"?n[f]:[n[f]],key:f,index:f};l[f]=p,d[f]=p,c[f]=[],u[f]=0}for(var v=0;v<l.length;v++)for(var h=0;h<=v;h++){var g=void 0;a.mode==="dendrogram"?g=v===h?1/0:s(l[v].value,l[h].value):g=v===h?1/0:s(l[v].value[0],l[h].value[0]),c[v][h]=g,c[h][v]=g,g<c[v][u[v]]&&(u[v]=h)}for(var y=_h(l,d,c,u,a);y;)y=_h(l,d,c,u,a);var m;return a.mode==="dendrogram"?(m=vB(l[0],a.dendrogramDepth,r),a.addDendrogram&&pB(l[0],r)):(m=new Array(l.length),l.forEach(function(b,w){b.key=b.index=null,m[w]=r.collection(b.value)})),m},gB={hierarchicalClustering:Oh,hca:Oh},mB=wt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),yB=function(e){var r=e.damping,n=e.preference;.5<=r&&r<1||Ze("Damping must range on [0.5, 1). Got: ".concat(r));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||le(n)||Ze("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),mB(e)},bB=function(e,r,n,a){var i=function(l,c){return a[c](l)};return-Go(e,a.length,function(s){return i(r,s)},function(s){return i(n,s)},r,n)},wB=function(e,r){var n=null;return r==="median"?n=yT(e):r==="mean"?n=mT(e):r==="min"?n=vT(e):r==="max"?n=gT(e):n=r,n},CB=function(e,r,n){for(var a=[],i=0;i<e;i++)r[i*e+i]+n[i*e+i]>0&&a.push(i);return a},Ih=function(e,r,n){for(var a=[],i=0;i<e;i++){for(var s=-1,l=-1/0,c=0;c<n.length;c++){var u=n[c];r[i*e+u]>l&&(s=u,l=r[i*e+u])}s>0&&a.push(s)}for(var d=0;d<n.length;d++)a[n[d]]=n[d];return a},kB=function(e,r,n){for(var a=Ih(e,r,n),i=0;i<n.length;i++){for(var s=[],l=0;l<a.length;l++)a[l]===n[i]&&s.push(l);for(var c=-1,u=-1/0,d=0;d<s.length;d++){for(var f=0,p=0;p<s.length;p++)f+=r[s[p]*e+s[d]];f>u&&(c=d,u=f)}n[i]=s[c]}return a=Ih(e,r,n),a},Lh=function(e){for(var r=this.cy(),n=this.nodes(),a=yB(e),i={},s=0;s<n.length;s++)i[n[s].id()]=s;var l,c,u,d,f,p;l=n.length,c=l*l,u=new Array(c);for(var v=0;v<c;v++)u[v]=-1/0;for(var h=0;h<l;h++)for(var g=0;g<l;g++)h!==g&&(u[h*l+g]=bB(a.distance,n[h],n[g],a.attributes));d=wB(u,a.preference);for(var y=0;y<l;y++)u[y*l+y]=d;f=new Array(c);for(var m=0;m<c;m++)f[m]=0;p=new Array(c);for(var b=0;b<c;b++)p[b]=0;for(var w=new Array(l),C=new Array(l),x=new Array(l),E=0;E<l;E++)w[E]=0,C[E]=0,x[E]=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,P=-1/0,I=-1,_=0,F=0;F<l;F++)w[F]=f[N*l+F],_=p[N*l+F]+u[N*l+F],_>=D?(P=D,D=_,I=F):_>P&&(P=_);for(var O=0;O<l;O++)f[N*l+O]=(1-a.damping)*(u[N*l+O]-D)+a.damping*w[O];f[N*l+I]=(1-a.damping)*(u[N*l+I]-P)+a.damping*w[I]}for(var M=0;M<l;M++){for(var L=0,V=0;V<l;V++)w[V]=p[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++)p[H*l+M]=(1-a.damping)*Math.min(0,L-C[H])+a.damping*w[H];p[M*l+M]=(1-a.damping)*(L-C[M])+a.damping*w[M]}for(var $=0,z=0;z<l;z++){var j=p[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++){x[J]=0;for(var X=0;X<a.minIterations;X++)x[J]+=k[X*l+J];(x[J]===0||x[J]===a.minIterations)&&ee++}if(ee===l)break}}for(var re=CB(l,f,p),Y=kB(l,u,re),A={},K=0;K<re.length;K++)A[re[K]]=[];for(var W=0;W<n.length;W++){var oe=i[n[W].id()],he=Y[oe];he!=null&&A[he].push(n[W])}for(var ne=new Array(re.length),se=0;se<re.length;se++)ne[se]=r.collection(A[re[se]]);return ne},xB={affinityPropagation:Lh,ap:Lh},EB=wt({root:void 0,directed:!1}),SB={hierholzer:function(e){if(!Oe(e)){var r=arguments;e={root:r[0],directed:r[1]}}var n=EB(e),a=n.root,i=n.directed,s=this,l=!1,c,u,d;a&&(d=be(a)?this.filter(a)[0].id():a[0].id());var f={},p={};i?s.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.indegree(!0),x=b.outdegree(!0),E=C-x,k=x-C;E==1?c?l=!0:c=w:k==1?u?l=!0:u=w:(k>1||E>1)&&(l=!0),f[w]=[],b.outgoers().forEach(function(B){B.isEdge()&&f[w].push(B.id())})}else p[w]=[void 0,b.target().id()]}):s.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.degree(!0);C%2&&(c?u?l=!0:u=w:c=w),f[w]=[],b.connectedEdges().forEach(function(x){return f[w].push(x.id())})}else p[w]=[b.source().id(),b.target().id()]});var v={found:!1,trail:void 0};if(l)return v;if(u&&c)if(i){if(d&&u!=d)return v;d=u}else{if(d&&u!=d&&c!=d)return v;d||(d=u)}else d||(d=s[0].id());var h=function(w){for(var C=w,x=[w],E,k,B;f[C].length;)E=f[C].shift(),k=p[E][0],B=p[E][1],C!=B?(f[B]=f[B].filter(function(S){return S!=E}),C=B):!i&&C!=k&&(f[k]=f[k].filter(function(S){return S!=E}),C=k),x.unshift(E),x.unshift(C);return x},g=[],y=[];for(y=h(d);y.length!=1;)f[y[0]].length==0?(g.unshift(s.getElementById(y.shift())),g.unshift(s.getElementById(y.shift()))):y=h(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}},Yo=function(){var e=this,r={},n=0,a=0,i=[],s=[],l={},c=function(p,v){for(var h=s.length-1,g=[],y=e.spawn();s[h].x!=p||s[h].y!=v;)g.push(s.pop().edge),h--;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(),x=w.connectedEdges().intersection(e);y.merge(w),r[C].cutVertex?y.merge(x.filter(function(E){return E.isLoop()})):y.merge(x)})}),i.push(y)},u=function f(p,v,h){p===h&&(a+=1),r[v]={id:n,low:n++,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!==h&&(w=C.id(),l[w]||(l[w]=!0,s.push({x:v,y:b,edge:C})),b in r?r[v].low=Math.min(r[v].low,r[b].id):(f(p,b,v),r[v].low=Math.min(r[v].low,r[b].low),r[v].id<=r[b].low&&(r[v].cutVertex=!0,c(v,b))))})}};e.forEach(function(f){if(f.isNode()){var p=f.id();p in r||(a=0,u(p,p),r[p].cutVertex=a>1)}});var d=Object.keys(r).filter(function(f){return r[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(d),components:i}},TB={hopcroftTarjanBiconnected:Yo,htbc:Yo,htb:Yo,hopcroftTarjanBiconnectedComponents:Yo},Zo=function(){var e=this,r={},n=0,a=[],i=[],s=e.spawn(e),l=function c(u){i.push(u),r[u]={index:n,low:n++,explored:!1};var d=e.getElementById(u).connectedEdges().intersection(e);if(d.forEach(function(g){var y=g.target().id();y!==u&&(y in r||c(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var f=e.spawn();;){var p=i.pop();if(f.merge(e.getElementById(p)),r[p].low=r[u].index,r[p].explored=!0,p===u)break}var v=f.edgesWith(f),h=f.merge(v);a.push(h),s=s.difference(h)}};return e.forEach(function(c){if(c.isNode()){var u=c.id();u in r||l(u)}}),{cut:s,components:a}},BB={tarjanStronglyConnected:Zo,tsc:Zo,tscc:Zo,tarjanStronglyConnectedComponents:Zo},Mh={};[Ei,nT,aT,oT,lT,uT,hT,VT,ba,wa,Jl,XT,uB,gB,xB,SB,TB,BB].forEach(function(t){xe(Mh,t)});/*!
20
+ `,d2=["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 f2(t){const e=window.getComputedStyle(t),r=e.getPropertyValue("box-sizing"),n=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:d2.map(s=>`${s}:${e.getPropertyValue(s)}`).join(";"),paddingSize:n,borderSize:a,boxSizing:r}}function Ad(t,e=1,r){var n;ir||(ir=document.createElement("textarea"),document.body.appendChild(ir));const{paddingSize:a,borderSize:i,boxSizing:s,contextStyle:l}=f2(t);ir.setAttribute("style",`${l};${u2}`),ir.value=t.value||t.placeholder||"";let c=ir.scrollHeight;const u={};s==="border-box"?c=c+i:s==="content-box"&&(c=c-a),ir.value="";const d=ir.scrollHeight-a;if(gt(e)){let f=d*e;s==="border-box"&&(f=f+a+i),c=Math.max(f,c),u.minHeight=`${f}px`}if(gt(r)){let f=d*r;s==="border-box"&&(f=f+a+i),c=Math.min(f,c)}return u.height=`${c}px`,(n=ir.parentNode)==null||n.removeChild(ir),ir=void 0,u}const h2=Fe({id:{type:String,default:void 0},size:sa,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:Zr},prefixIcon:{type:Zr},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:ke([Object,Array,String]),default:()=>ea({})},autofocus:Boolean,rows:{type:Number,default:2},...Qr(["ariaLabel"])}),p2={[mt]: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},v2=o.defineComponent({name:"ElInput",inheritAttrs:!1}),g2=o.defineComponent({...v2,props:h2,emits:p2,setup(t,{expose:e,emit:r}){const n=t,a=o.useAttrs(),i=o.useSlots(),s=o.computed(()=>{const T={};return n.containerRole==="combobox"&&(T["aria-haspopup"]=a["aria-haspopup"],T["aria-owns"]=a["aria-owns"],T["aria-expanded"]=a["aria-expanded"]),T}),l=o.computed(()=>[n.type==="textarea"?y.b():g.b(),g.m(v.value),g.is("disabled",h.value),g.is("exceed",j.value),{[g.b("group")]:i.prepend||i.append,[g.m("prefix")]:i.prefix||n.prefixIcon,[g.m("suffix")]:i.suffix||n.suffixIcon||n.clearable||n.showPassword,[g.bm("suffix","password-clear")]:V.value&&H.value,[g.b("hidden")]:n.type==="hidden"},a.class]),c=o.computed(()=>[g.e("wrapper"),g.is("focus",S.value)]),u=Nb({excludeKeys:o.computed(()=>Object.keys(s.value))}),{form:d,formItem:f}=Dn(),{inputId:p}=ii(n,{formItemContext:f}),v=Nn(),h=ai(),g=Be("input"),y=Be("textarea"),m=o.shallowRef(),b=o.shallowRef(),w=o.ref(!1),C=o.ref(!1),x=o.ref(),E=o.shallowRef(n.inputStyle),k=o.computed(()=>m.value||b.value),{wrapperRef:B,isFocused:S,handleFocus:N,handleBlur:D}=cl(k,{beforeFocus(){return h.value},afterBlur(){var T;n.validateEvent&&((T=f==null?void 0:f.validate)==null||T.call(f,"blur").catch(R=>tt(R)))}}),P=o.computed(()=>{var T;return(T=d==null?void 0:d.statusIcon)!=null?T:!1}),I=o.computed(()=>(f==null?void 0:f.validateState)||""),_=o.computed(()=>I.value&&Zu[I.value]),F=o.computed(()=>C.value?gb:cb),O=o.computed(()=>[a.style]),M=o.computed(()=>[n.inputStyle,E.value,{resize:n.resize}]),L=o.computed(()=>jr(n.modelValue)?"":String(n.modelValue)),V=o.computed(()=>n.clearable&&!h.value&&!n.readonly&&!!L.value&&(S.value||w.value)),H=o.computed(()=>n.showPassword&&!h.value&&!n.readonly&&!!L.value&&(!!L.value||S.value)),$=o.computed(()=>n.showWordLimit&&!!n.maxlength&&(n.type==="text"||n.type==="textarea")&&!h.value&&!n.readonly&&!n.showPassword),z=o.computed(()=>L.value.length),j=o.computed(()=>!!$.value&&z.value>Number(n.maxlength)),ee=o.computed(()=>!!i.suffix||!!n.suffixIcon||V.value||n.showPassword||$.value||!!I.value&&P.value),[J,X]=Yw(m);Pr(b,T=>{if(A(),!$.value||n.resize!=="both")return;const R=T[0],{width:Q}=R.contentRect;x.value={right:`calc(100% - ${Q+15+6}px)`}});const re=()=>{const{type:T,autosize:R}=n;if(!(!et||T!=="textarea"||!b.value))if(R){const Q=vt(R)?R.minRows:void 0,G=vt(R)?R.maxRows:void 0,U=Ad(b.value,Q,G);E.value={overflowY:"hidden",...U},o.nextTick(()=>{b.value.offsetHeight,E.value=U})}else E.value={minHeight:Ad(b.value).minHeight}},A=(T=>{let R=!1;return()=>{var Q;if(R||!n.autosize)return;((Q=b.value)==null?void 0:Q.offsetParent)===null||(T(),R=!0)}})(re),K=()=>{const T=k.value,R=n.formatter?n.formatter(L.value):L.value;!T||T.value===R||(T.value=R)},W=async T=>{J();let{value:R}=T.target;if(n.formatter&&(R=n.parser?n.parser(R):R),!he.value){if(R===L.value){K();return}r(mt,R),r("input",R),await o.nextTick(),K(),X()}},oe=T=>{r("change",T.target.value)},{isComposing:he,handleCompositionStart:ne,handleCompositionUpdate:se,handleCompositionEnd:ue}=Ld({emit:r,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,r("mouseleave",T)},De=T=>{w.value=!0,r("mouseenter",T)},Ee=T=>{r("keydown",T)},Pe=()=>{var T;(T=k.value)==null||T.select()},te=()=>{r(mt,""),r("change",""),r("clear"),r("input","")};return o.watch(()=>n.modelValue,()=>{var T;o.nextTick(()=>re()),n.validateEvent&&((T=f==null?void 0:f.validate)==null||T.call(f,"change").catch(R=>tt(R)))}),o.watch(L,()=>K()),o.watch(()=>n.type,async()=>{await o.nextTick(),K(),re()}),o.onMounted(()=>{!n.formatter&&n.parser&&tt("ElInput","If you set the parser, you also need to set the formatter."),K(),o.nextTick(re)}),e({input:m,textarea:b,ref:k,textareaStyle:M,autosize:o.toRef(n,"autosize"),isComposing:he,focus:de,blur:me,select:Pe,clear:te,resizeTextarea:re}),(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(c))},[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(yt),{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(p),ref_key:"input",ref:m,class:o.unref(g).e("inner")},o.unref(u),{minlength:T.minlength,maxlength:T.maxlength,type:T.showPassword?C.value?"text":"password":T.type,disabled:o.unref(h),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(ne),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(yt),{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(yt),{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(Ys))]),_:1},8,["class","onMousedown"])):o.createCommentVNode("v-if",!0),o.unref(H)?(o.openBlock(),o.createBlock(o.unref(yt),{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(_)&&o.unref(P)?(o.openBlock(),o.createBlock(o.unref(yt),{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(_))))]),_: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(p),ref_key:"textarea",ref:b,class:[o.unref(y).e("inner"),o.unref(g).is("focus",o.unref(S))]},o.unref(u),{minlength:T.minlength,maxlength:T.maxlength,tabindex:T.tabindex,disabled:o.unref(h),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(ne),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(x.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 m2=Te(g2,[["__file","input.vue"]]);const oi=dt(m2),la=4,y2={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"}},b2=({move:t,size:e,bar:r})=>({[r.size]:e,transform:`translate${r.axis}(${t}%)`}),fl=Symbol("scrollbarContextKey"),w2=Fe({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),C2="Thumb";var Vd=Te(o.defineComponent({__name:"thumb",props:w2,setup(t){const e=t,r=o.inject(fl),n=Be("scrollbar");r||z1(C2,"can not inject scrollbar context");const a=o.ref(),i=o.ref(),s=o.ref({}),l=o.ref(!1);let c=!1,u=!1,d=et?document.onselectstart:null;const f=o.computed(()=>y2[e.vertical?"vertical":"horizontal"]),p=o.computed(()=>b2({size:e.size,move:e.move,bar:f.value})),v=o.computed(()=>a.value[f.value.offset]**2/r.wrapElement[f.value.scrollSize]/e.ratio/i.value[f.value.offset]),h=E=>{var k;if(E.stopPropagation(),E.ctrlKey||[1,2].includes(E.button))return;(k=window.getSelection())==null||k.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||!r.wrapElement)return;const k=Math.abs(E.target.getBoundingClientRect()[f.value.direction]-E[f.value.client]),B=i.value[f.value.offset]/2,S=(k-B)*100*v.value/a.value[f.value.offset];r.wrapElement[f.value.scroll]=S*r.wrapElement[f.value.scrollSize]/100},y=E=>{E.stopImmediatePropagation(),c=!0,document.addEventListener("mousemove",m),document.addEventListener("mouseup",b),d=document.onselectstart,document.onselectstart=()=>!1},m=E=>{if(!a.value||!i.value||c===!1)return;const k=s.value[f.value.axis];if(!k)return;const B=(a.value.getBoundingClientRect()[f.value.direction]-E[f.value.client])*-1,S=i.value[f.value.offset]-k,N=(B-S)*100*v.value/a.value[f.value.offset];r.wrapElement[f.value.scroll]=N*r.wrapElement[f.value.scrollSize]/100},b=()=>{c=!1,s.value[f.value.axis]=0,document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",b),x(),u&&(l.value=!1)},w=()=>{u=!1,l.value=!!e.size},C=()=>{u=!0,l.value=c};o.onBeforeUnmount(()=>{x(),document.removeEventListener("mouseup",b)});const x=()=>{document.onselectstart!==d&&(document.onselectstart=d)};return jt(o.toRef(r,"scrollbarElement"),"mousemove",w),jt(o.toRef(r,"scrollbarElement"),"mouseleave",C),(E,k)=>(o.openBlock(),o.createBlock(o.Transition,{name:o.unref(n).b("fade"),persisted:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{ref_key:"instance",ref:a,class:o.normalizeClass([o.unref(n).e("bar"),o.unref(n).is(o.unref(f).key)]),onMousedown:g},[o.createElementVNode("div",{ref_key:"thumb",ref:i,class:o.normalizeClass(o.unref(n).e("thumb")),style:o.normalizeStyle(o.unref(p)),onMousedown:h},null,38)],34),[[o.vShow,E.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const k2=Fe({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var x2=Te(o.defineComponent({__name:"bar",props:k2,setup(t,{expose:e}){const r=t,n=o.inject(fl),a=o.ref(0),i=o.ref(0),s=o.ref(""),l=o.ref(""),c=o.ref(1),u=o.ref(1);return e({handleScroll:p=>{if(p){const v=p.offsetHeight-la,h=p.offsetWidth-la;i.value=p.scrollTop*100/v*c.value,a.value=p.scrollLeft*100/h*u.value}},update:()=>{const p=n==null?void 0:n.wrapElement;if(!p)return;const v=p.offsetHeight-la,h=p.offsetWidth-la,g=v**2/p.scrollHeight,y=h**2/p.scrollWidth,m=Math.max(g,r.minSize),b=Math.max(y,r.minSize);c.value=g/(v-g)/(m/(v-m)),u.value=y/(h-y)/(b/(h-b)),l.value=m+la<v?`${m}px`:"",s.value=b+la<h?`${b}px`:""}}),(p,v)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(Vd,{move:a.value,ratio:u.value,size:s.value,always:p.always},null,8,["move","ratio","size","always"]),o.createVNode(Vd,{move:i.value,ratio:c.value,size:l.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const E2=Fe({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,...Qr(["ariaLabel","ariaOrientation"])}),S2={scroll:({scrollTop:t,scrollLeft:e})=>[t,e].every(gt)},hl="ElScrollbar",T2=o.defineComponent({name:hl}),B2=o.defineComponent({...T2,props:E2,emits:S2,setup(t,{expose:e,emit:r}){const n=t,a=Be("scrollbar");let i,s,l=0,c=0;const u=o.ref(),d=o.ref(),f=o.ref(),p=o.ref(),v=o.computed(()=>{const x={};return n.height&&(x.height=Jn(n.height)),n.maxHeight&&(x.maxHeight=Jn(n.maxHeight)),[n.wrapStyle,x]}),h=o.computed(()=>[n.wrapClass,a.e("wrap"),{[a.em("wrap","hidden-default")]:!n.native}]),g=o.computed(()=>[a.e("view"),n.viewClass]),y=()=>{var x;d.value&&((x=p.value)==null||x.handleScroll(d.value),l=d.value.scrollTop,c=d.value.scrollLeft,r("scroll",{scrollTop:d.value.scrollTop,scrollLeft:d.value.scrollLeft}))};function m(x,E){vt(x)?d.value.scrollTo(x):gt(x)&&gt(E)&&d.value.scrollTo(x,E)}const b=x=>{if(!gt(x)){tt(hl,"value must be a number");return}d.value.scrollTop=x},w=x=>{if(!gt(x)){tt(hl,"value must be a number");return}d.value.scrollLeft=x},C=()=>{var x;(x=p.value)==null||x.update()};return o.watch(()=>n.noresize,x=>{x?(i==null||i(),s==null||s()):({stop:i}=Pr(f,C),s=jt("resize",C))},{immediate:!0}),o.watch(()=>[n.maxHeight,n.height],()=>{n.native||o.nextTick(()=>{var x;C(),d.value&&((x=p.value)==null||x.handleScroll(d.value))})}),o.provide(fl,o.reactive({scrollbarElement:u,wrapElement:d})),o.onActivated(()=>{d.value&&(d.value.scrollTop=l,d.value.scrollLeft=c)}),o.onMounted(()=>{n.native||o.nextTick(()=>{C()})}),o.onUpdated(()=>C()),e({wrapRef:d,update:C,scrollTo:m,setScrollTop:b,setScrollLeft:w,handleScroll:y}),(x,E)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"scrollbarRef",ref:u,class:o.normalizeClass(o.unref(a).b())},[o.createElementVNode("div",{ref_key:"wrapRef",ref:d,class:o.normalizeClass(o.unref(h)),style:o.normalizeStyle(o.unref(v)),tabindex:x.tabindex,onScroll:y},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(x.tag),{id:x.id,ref_key:"resizeRef",ref:f,class:o.normalizeClass(o.unref(g)),style:o.normalizeStyle(x.viewStyle),role:x.role,"aria-label":x.ariaLabel,"aria-orientation":x.ariaOrientation},{default:o.withCtx(()=>[o.renderSlot(x.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),x.native?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(x2,{key:0,ref_key:"barRef",ref:p,always:x.always,"min-size":x.minSize},null,8,["always","min-size"]))],2))}});var N2=Te(B2,[["__file","scrollbar.vue"]]);const D2=dt(N2),pl=Symbol("popper"),Rd=Symbol("popperContent"),$d=Fe({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),P2=o.defineComponent({name:"ElPopper",inheritAttrs:!1}),_2=o.defineComponent({...P2,props:$d,setup(t,{expose:e}){const r=t,n=o.ref(),a=o.ref(),i=o.ref(),s=o.ref(),l=o.computed(()=>r.role),c={triggerRef:n,popperInstanceRef:a,contentRef:i,referenceRef:s,role:l};return e(c),o.provide(pl,c),(u,d)=>o.renderSlot(u.$slots,"default")}});var O2=Te(_2,[["__file","popper.vue"]]);const zd=Fe({arrowOffset:{type:Number,default:5}}),I2=o.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),L2=o.defineComponent({...I2,props:zd,setup(t,{expose:e}){const r=t,n=Be("popper"),{arrowOffset:a,arrowRef:i,arrowStyle:s}=o.inject(Rd,void 0);return o.watch(()=>r.arrowOffset,l=>{a.value=l}),o.onBeforeUnmount(()=>{i.value=void 0}),e({arrowRef:i}),(l,c)=>(o.openBlock(),o.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:o.normalizeClass(o.unref(n).e("arrow")),style:o.normalizeStyle(o.unref(s)),"data-popper-arrow":""},null,6))}});var M2=Te(L2,[["__file","arrow.vue"]]);const vl="ElOnlyChild",F2=o.defineComponent({name:vl,setup(t,{slots:e,attrs:r}){var n;const a=o.inject(Td),i=jw((n=a==null?void 0:a.setForwardRef)!=null?n:Ha);return()=>{var s;const l=(s=e.default)==null?void 0:s.call(e,r);if(!l)return null;if(l.length>1)return tt(vl,"requires exact only one valid child."),null;const c=Hd(l);return c?o.withDirectives(o.cloneVNode(c,r),[[i]]):(tt(vl,"no valid child node found"),null)}}});function Hd(t){if(!t)return null;const e=t;for(const r of e){if(vt(r))switch(r.type){case o.Comment:continue;case o.Text:case"svg":return Kd(r);case o.Fragment:return Hd(r.children);default:return r}return Kd(r)}return null}function Kd(t){const e=Be("only-child");return o.createVNode("span",{class:e.e("content")},[t])}const qd=Fe({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}),A2=o.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),V2=o.defineComponent({...A2,props:qd,setup(t,{expose:e}){const r=t,{role:n,triggerRef:a}=o.inject(pl,void 0);Ww(a);const i=o.computed(()=>l.value?r.id:void 0),s=o.computed(()=>{if(n&&n.value==="tooltip")return r.open&&r.id?r.id:void 0}),l=o.computed(()=>{if(n&&n.value!=="tooltip")return n.value}),c=o.computed(()=>l.value?`${r.open}`:void 0);let u;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return o.onMounted(()=>{o.watch(()=>r.virtualRef,f=>{f&&(a.value=Dr(f))},{immediate:!0}),o.watch(a,(f,p)=>{u==null||u(),u=void 0,En(f)&&(d.forEach(v=>{var h;const g=r[v];g&&(f.addEventListener(v.slice(2).toLowerCase(),g),(h=p==null?void 0:p.removeEventListener)==null||h.call(p,v.slice(2).toLowerCase(),g))}),u=o.watch([i,s,l,c],v=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((h,g)=>{jr(v[g])?f.removeAttribute(h):f.setAttribute(h,v[g])})},{immediate:!0})),En(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(v=>p.removeAttribute(v))},{immediate:!0})}),o.onBeforeUnmount(()=>{if(u==null||u(),u=void 0,a.value&&En(a.value)){const f=a.value;d.forEach(p=>{const v=r[p];v&&f.removeEventListener(p.slice(2).toLowerCase(),v)}),a.value=void 0}}),e({triggerRef:a}),(f,p)=>f.virtualTriggering?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(o.unref(F2),o.mergeProps({key:0},f.$attrs,{"aria-controls":o.unref(i),"aria-describedby":o.unref(s),"aria-expanded":o.unref(c),"aria-haspopup":o.unref(l)}),{default:o.withCtx(()=>[o.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var R2=Te(V2,[["__file","trigger.vue"]]);const gl="focus-trap.focus-after-trapped",ml="focus-trap.focus-after-released",$2="focus-trap.focusout-prevented",Ud={cancelable:!0,bubbles:!1},z2={cancelable:!0,bubbles:!1},Gd="focusAfterTrapped",Wd="focusAfterReleased",H2=Symbol("elFocusTrap"),yl=o.ref(),wo=o.ref(0),bl=o.ref(0);let Co=0;const jd=t=>{const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0||n===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e},Yd=(t,e)=>{for(const r of t)if(!K2(r,e))return r},K2=(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},q2=t=>{const e=jd(t),r=Yd(e,t),n=Yd(e.reverse(),t);return[r,n]},U2=t=>t instanceof HTMLInputElement&&"select"in t,Jr=(t,e)=>{if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),bl.value=window.performance.now(),t!==r&&U2(t)&&e&&t.select()}};function Zd(t,e){const r=[...t],n=t.indexOf(e);return n!==-1&&r.splice(n,1),r}const G2=()=>{let t=[];return{push:n=>{const a=t[0];a&&n!==a&&a.pause(),t=Zd(t,n),t.unshift(n)},remove:n=>{var a,i;t=Zd(t,n),(i=(a=t[0])==null?void 0:a.resume)==null||i.call(a)}}},W2=(t,e=!1)=>{const r=document.activeElement;for(const n of t)if(Jr(n,e),document.activeElement!==r)return},Xd=G2(),j2=()=>wo.value>bl.value,ko=()=>{yl.value="pointer",wo.value=window.performance.now()},Qd=()=>{yl.value="keyboard",wo.value=window.performance.now()},Y2=()=>(o.onMounted(()=>{Co===0&&(document.addEventListener("mousedown",ko),document.addEventListener("touchstart",ko),document.addEventListener("keydown",Qd)),Co++}),o.onBeforeUnmount(()=>{Co--,Co<=0&&(document.removeEventListener("mousedown",ko),document.removeEventListener("touchstart",ko),document.removeEventListener("keydown",Qd))}),{focusReason:yl,lastUserFocusTimestamp:wo,lastAutomatedFocusTimestamp:bl}),xo=t=>new CustomEvent($2,{...z2,detail:t}),Z2=o.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Gd,Wd,"focusin","focusout","focusout-prevented","release-requested"],setup(t,{emit:e}){const r=o.ref();let n,a;const{focusReason:i}=Y2();Hw(h=>{t.trapped&&!s.paused&&e("release-requested",h)});const s={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=h=>{if(!t.loop&&!t.trapped||s.paused)return;const{key:g,altKey:y,ctrlKey:m,metaKey:b,currentTarget:w,shiftKey:C}=h,{loop:x}=t,E=g===it.tab&&!y&&!m&&!b,k=document.activeElement;if(E&&k){const B=w,[S,N]=q2(B);if(S&&N){if(!C&&k===N){const P=xo({focusReason:i.value});e("focusout-prevented",P),P.defaultPrevented||(h.preventDefault(),x&&Jr(S,!0))}else if(C&&[S,B].includes(k)){const P=xo({focusReason:i.value});e("focusout-prevented",P),P.defaultPrevented||(h.preventDefault(),x&&Jr(N,!0))}}else if(k===B){const P=xo({focusReason:i.value});e("focusout-prevented",P),P.defaultPrevented||h.preventDefault()}}};o.provide(H2,{focusTrapRef:r,onKeydown:l}),o.watch(()=>t.focusTrapEl,h=>{h&&(r.value=h)},{immediate:!0}),o.watch([r],([h],[g])=>{h&&(h.addEventListener("keydown",l),h.addEventListener("focusin",d),h.addEventListener("focusout",f)),g&&(g.removeEventListener("keydown",l),g.removeEventListener("focusin",d),g.removeEventListener("focusout",f))});const c=h=>{e(Gd,h)},u=h=>e(Wd,h),d=h=>{const g=o.unref(r);if(!g)return;const y=h.target,m=h.relatedTarget,b=y&&g.contains(y);t.trapped||m&&g.contains(m)||(n=m),b&&e("focusin",h),!s.paused&&t.trapped&&(b?a=y:Jr(a,!0))},f=h=>{const g=o.unref(r);if(!(s.paused||!g))if(t.trapped){const y=h.relatedTarget;!jr(y)&&!g.contains(y)&&setTimeout(()=>{if(!s.paused&&t.trapped){const m=xo({focusReason:i.value});e("focusout-prevented",m),m.defaultPrevented||Jr(a,!0)}},0)}else{const y=h.target;y&&g.contains(y)||e("focusout",h)}};async function p(){await o.nextTick();const h=o.unref(r);if(h){Xd.push(s);const g=h.contains(document.activeElement)?n:document.activeElement;if(n=g,!h.contains(g)){const m=new Event(gl,Ud);h.addEventListener(gl,c),h.dispatchEvent(m),m.defaultPrevented||o.nextTick(()=>{let b=t.focusStartEl;St(b)||(Jr(b),document.activeElement!==b&&(b="first")),b==="first"&&W2(jd(h),!0),(document.activeElement===g||b==="container")&&Jr(h)})}}}function v(){const h=o.unref(r);if(h){h.removeEventListener(gl,c);const g=new CustomEvent(ml,{...Ud,detail:{focusReason:i.value}});h.addEventListener(ml,u),h.dispatchEvent(g),!g.defaultPrevented&&(i.value=="keyboard"||!j2()||h.contains(document.activeElement))&&Jr(n??document.body),h.removeEventListener(ml,u),Xd.remove(s)}}return o.onMounted(()=>{t.trapped&&p(),o.watch(()=>t.trapped,h=>{h?p():v()})}),o.onBeforeUnmount(()=>{t.trapped&&v(),r.value&&(r.value.removeEventListener("keydown",l),r.value.removeEventListener("focusin",d),r.value.removeEventListener("focusout",f),r.value=void 0)}),{onKeydown:l}}});function X2(t,e,r,n,a,i){return o.renderSlot(t.$slots,"default",{handleKeydown:t.onKeydown})}var Q2=Te(Z2,[["render",X2],["__file","focus-trap.vue"]]);const J2=["fixed","absolute"],eC=Fe({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:ho,default:"bottom"},popperOptions:{type:ke(Object),default:()=>({})},strategy:{type:String,values:J2,default:"absolute"}}),Jd=Fe({...eC,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,...Qr(["ariaLabel"])}),tC={mouseenter:t=>t instanceof MouseEvent,mouseleave:t=>t instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},rC=(t,e=[])=>{const{placement:r,strategy:n,popperOptions:a}=t,i={placement:r,strategy:n,...a,modifiers:[...aC(t),...e]};return iC(i,a==null?void 0:a.modifiers),i},nC=t=>{if(et)return Dr(t)};function aC(t){const{offset:e,gpuAcceleration:r,fallbackPlacements:n}=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:n}},{name:"computeStyles",options:{gpuAcceleration:r}}]}function iC(t,e){e&&(t.modifiers=[...t.modifiers,...e??[]])}const oC=0,sC=t=>{const{popperInstanceRef:e,contentRef:r,triggerRef:n,role:a}=o.inject(pl,void 0),i=o.ref(),s=o.ref(),l=o.computed(()=>({name:"eventListeners",enabled:!!t.visible})),c=o.computed(()=>{var m;const b=o.unref(i),w=(m=o.unref(s))!=null?m:oC;return{name:"arrow",enabled:!M1(b),options:{element:b,padding:w}}}),u=o.computed(()=>({onFirstUpdate:()=>{h()},...rC(t,[o.unref(c),o.unref(l)])})),d=o.computed(()=>nC(t.referenceEl)||o.unref(n)),{attributes:f,state:p,styles:v,update:h,forceUpdate:g,instanceRef:y}=Rw(d,r,u);return o.watch(y,m=>e.value=m),o.onMounted(()=>{o.watch(()=>{var m;return(m=o.unref(d))==null?void 0:m.getBoundingClientRect()},()=>{h()})}),{attributes:f,arrowRef:i,contentRef:r,instanceRef:y,state:p,styles:v,role:a,forceUpdate:g,update:h}},lC=(t,{attributes:e,styles:r,role:n})=>{const{nextZIndex:a}=Od(),i=Be("popper"),s=o.computed(()=>o.unref(e).popper),l=o.ref(gt(t.zIndex)?t.zIndex:a()),c=o.computed(()=>[i.b(),i.is("pure",t.pure),i.is(t.effect),t.popperClass]),u=o.computed(()=>[{zIndex:o.unref(l)},o.unref(r).popper,t.popperStyle||{}]),d=o.computed(()=>n.value==="dialog"?"false":void 0),f=o.computed(()=>o.unref(r).arrow||{});return{ariaModal:d,arrowStyle:f,contentAttrs:s,contentClass:c,contentStyle:u,contentZIndex:l,updateZIndex:()=>{l.value=gt(t.zIndex)?t.zIndex:a()}}},cC=(t,e)=>{const r=o.ref(!1),n=o.ref();return{focusStartRef:n,trapped:r,onFocusAfterReleased:u=>{var d;((d=u.detail)==null?void 0:d.focusReason)!=="pointer"&&(n.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:u=>{t.visible&&!r.value&&(u.target&&(n.value=u.target),r.value=!0)},onFocusoutPrevented:u=>{t.trapping||(u.detail.focusReason==="pointer"&&u.preventDefault(),r.value=!1)},onReleaseRequested:()=>{r.value=!1,e("close")}}},uC=o.defineComponent({name:"ElPopperContent"}),dC=o.defineComponent({...uC,props:Jd,emits:tC,setup(t,{expose:e,emit:r}){const n=t,{focusStartRef:a,trapped:i,onFocusAfterReleased:s,onFocusAfterTrapped:l,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=cC(n,r),{attributes:f,arrowRef:p,contentRef:v,styles:h,instanceRef:g,role:y,update:m}=sC(n),{ariaModal:b,arrowStyle:w,contentAttrs:C,contentClass:x,contentStyle:E,updateZIndex:k}=lC(n,{styles:h,attributes:f,role:y}),B=o.inject(ni,void 0),S=o.ref();o.provide(Rd,{arrowStyle:w,arrowRef:p,arrowOffset:S}),B&&o.provide(ni,{...B,addInputId:Ha,removeInputId:Ha});let N;const D=(I=!0)=>{m(),I&&k()},P=()=>{D(!1),n.visible&&n.focusOnShow?i.value=!0:n.visible===!1&&(i.value=!1)};return o.onMounted(()=>{o.watch(()=>n.triggerTargetEl,(I,_)=>{N==null||N(),N=void 0;const F=o.unref(I||v.value),O=o.unref(_||v.value);En(F)&&(N=o.watch([y,()=>n.ariaLabel,b,()=>n.id],M=>{["role","aria-label","aria-modal","id"].forEach((L,V)=>{jr(M[V])?F.removeAttribute(L):F.setAttribute(L,M[V])})},{immediate:!0})),O!==F&&En(O)&&["role","aria-label","aria-modal","id"].forEach(M=>{O.removeAttribute(M)})},{immediate:!0}),o.watch(()=>n.visible,P,{immediate:!0})}),o.onBeforeUnmount(()=>{N==null||N(),N=void 0}),e({popperContentRef:v,popperInstanceRef:g,updatePopper:D,contentStyle:E}),(I,_)=>(o.openBlock(),o.createElementBlock("div",o.mergeProps({ref_key:"contentRef",ref:v},o.unref(C),{style:o.unref(E),class:o.unref(x),tabindex:"-1",onMouseenter:F=>I.$emit("mouseenter",F),onMouseleave:F=>I.$emit("mouseleave",F)}),[o.createVNode(o.unref(Q2),{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(c),onFocusoutPrevented:o.unref(u),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 fC=Te(dC,[["__file","content.vue"]]);const hC=dt(O2),wl=Symbol("elTooltip"),$t=Fe({...Uw,...Jd,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,...Qr(["ariaLabel"])}),si=Fe({...qd,disabled:Boolean,trigger:{type:ke([String,Array]),default:"hover"},triggerKeys:{type:ke(Array),default:()=>[it.enter,it.space]}}),{useModelToggleProps:pC,useModelToggleEmits:vC,useModelToggle:gC}=Fb("visible"),mC=Fe({...$d,...pC,...$t,...si,...zd,showArrow:{type:Boolean,default:!0}}),yC=[...vC,"before-show","before-hide","show","hide","open","close"],bC=(t,e)=>At(t)?t.includes(e):t===e,ca=(t,e,r)=>n=>{bC(o.unref(t),e)&&r(n)},wC=o.defineComponent({name:"ElTooltipTrigger"}),CC=o.defineComponent({...wC,props:si,setup(t,{expose:e}){const r=t,n=Be("tooltip"),{controlled:a,id:i,open:s,onOpen:l,onClose:c,onToggle:u}=o.inject(wl,void 0),d=o.ref(null),f=()=>{if(o.unref(a)||r.disabled)return!0},p=o.toRef(r,"trigger"),v=Ft(f,ca(p,"hover",l)),h=Ft(f,ca(p,"hover",c)),g=Ft(f,ca(p,"click",C=>{C.button===0&&u(C)})),y=Ft(f,ca(p,"focus",l)),m=Ft(f,ca(p,"focus",c)),b=Ft(f,ca(p,"contextmenu",C=>{C.preventDefault(),u(C)})),w=Ft(f,C=>{const{code:x}=C;r.triggerKeys.includes(x)&&(C.preventDefault(),u(C))});return e({triggerRef:d}),(C,x)=>(o.openBlock(),o.createBlock(o.unref(R2),{id:o.unref(i),"virtual-ref":C.virtualRef,open:o.unref(s),"virtual-triggering":C.virtualTriggering,class:o.normalizeClass(o.unref(n).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(h),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 kC=Te(CC,[["__file","trigger.vue"]]);const xC=Fe({to:{type:ke([String,Object]),required:!0},disabled:Boolean});var EC=Te(o.defineComponent({__name:"teleport",props:xC,setup(t){return(e,r)=>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 SC=dt(EC),TC=o.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),BC=o.defineComponent({...TC,props:$t,setup(t,{expose:e}){const r=t,{selector:n}=Sd(),a=Be("tooltip"),i=o.ref(null);let s;const{controlled:l,id:c,open:u,trigger:d,onClose:f,onOpen:p,onShow:v,onHide:h,onBeforeShow:g,onBeforeHide:y}=o.inject(wl,void 0),m=o.computed(()=>r.transition||`${a.namespace.value}-fade-in-linear`),b=o.computed(()=>process.env.NODE_ENV==="test"?!0:r.persistent);o.onBeforeUnmount(()=>{s==null||s()});const w=o.computed(()=>o.unref(b)?!0:o.unref(u)),C=o.computed(()=>r.disabled?!1:o.unref(u)),x=o.computed(()=>r.appendTo||n.value),E=o.computed(()=>{var O;return(O=r.style)!=null?O:{}}),k=o.ref(!0),B=()=>{h(),k.value=!0},S=()=>{if(o.unref(l))return!0},N=Ft(S,()=>{r.enterable&&o.unref(d)==="hover"&&p()}),D=Ft(S,()=>{o.unref(d)==="hover"&&f()}),P=()=>{var O,M;(M=(O=i.value)==null?void 0:O.updatePopper)==null||M.call(O),g==null||g()},I=()=>{y==null||y()},_=()=>{v(),s=Dg(o.computed(()=>{var O;return(O=i.value)==null?void 0:O.popperContentRef}),()=>{if(o.unref(l))return;o.unref(d)!=="hover"&&f()})},F=()=>{r.virtualTriggering||f()};return o.watch(()=>o.unref(u),O=>{O?k.value=!1:s==null||s()},{flush:"post"}),o.watch(()=>r.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(SC),{disabled:!O.teleported,to:o.unref(x)},{default:o.withCtx(()=>[o.createVNode(o.Transition,{name:o.unref(m),onAfterLeave:B,onBeforeEnter:P,onAfterEnter:_,onBeforeLeave:I},{default:o.withCtx(()=>[o.unref(w)?o.withDirectives((o.openBlock(),o.createBlock(o.unref(fC),o.mergeProps({key:0,id:o.unref(c),ref_key:"contentRef",ref:i},O.$attrs,{"aria-label":O.ariaLabel,"aria-hidden":k.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 NC=Te(BC,[["__file","content.vue"]]);const DC=o.defineComponent({name:"ElTooltip"}),PC=o.defineComponent({...DC,props:mC,emits:yC,setup(t,{expose:e,emit:r}){const n=t;qw();const a=yo(),i=o.ref(),s=o.ref(),l=()=>{var m;const b=o.unref(i);b&&((m=b.popperInstanceRef)==null||m.update())},c=o.ref(!1),u=o.ref(),{show:d,hide:f,hasUpdateHandler:p}=gC({indicator:c,toggleReason:u}),{onOpen:v,onClose:h}=Gw({showAfter:o.toRef(n,"showAfter"),hideAfter:o.toRef(n,"hideAfter"),autoClose:o.toRef(n,"autoClose"),open:d,close:f}),g=o.computed(()=>Qn(n.visible)&&!p.value);o.provide(wl,{controlled:g,id:a,open:o.readonly(c),trigger:o.toRef(n,"trigger"),onOpen:m=>{v(m)},onClose:m=>{h(m)},onToggle:m=>{o.unref(c)?h(m):v(m)},onShow:()=>{r("show",u.value)},onHide:()=>{r("hide",u.value)},onBeforeShow:()=>{r("before-show",u.value)},onBeforeHide:()=>{r("before-hide",u.value)},updatePopper:l}),o.watch(()=>n.disabled,m=>{m&&c.value&&(c.value=!1)});const y=m=>{var b,w;const C=(w=(b=s.value)==null?void 0:b.contentRef)==null?void 0:w.popperContentRef,x=(m==null?void 0:m.relatedTarget)||document.activeElement;return C&&C.contains(x)};return o.onDeactivated(()=>c.value&&f()),e({popperRef:i,contentRef:s,isFocusInsideContent:y,updatePopper:l,onOpen:v,onClose:h,hide:f}),(m,b)=>(o.openBlock(),o.createBlock(o.unref(hC),{ref_key:"popperRef",ref:i,role:m.role},{default:o.withCtx(()=>[o.createVNode(kC,{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(NC,{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(M2),{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 _C=Te(PC,[["__file","tooltip.vue"]]);const li=dt(_C),ef=Symbol("buttonGroupContextKey"),OC=(t,e)=>{uo({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 r=o.inject(ef,void 0),n=ul("button"),{form:a}=Dn(),i=Nn(o.computed(()=>r==null?void 0:r.size)),s=ai(),l=o.ref(),c=o.useSlots(),u=o.computed(()=>t.type||(r==null?void 0:r.type)||""),d=o.computed(()=>{var h,g,y;return(y=(g=t.autoInsertSpace)!=null?g:(h=n.value)==null?void 0:h.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}:{}),p=o.computed(()=>{var h;const g=(h=c.default)==null?void 0:h.call(c);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:u,_ref:l,_props:f,shouldAddSpace:p,handleClick:h=>{if(s.value||t.loading){h.stopPropagation();return}t.nativeType==="reset"&&(a==null||a.resetFields()),e("click",h)}}},Cl=Fe({size:sa,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Zr},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Zr,default:()=>Zs},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"}}),IC={click:t=>t instanceof MouseEvent};function bt(t,e){LC(t)&&(t="100%");var r=MC(t);return t=e===360?t:Math.min(e,Math.max(0,parseFloat(t))),r&&(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 Eo(t){return Math.min(1,Math.max(0,t))}function LC(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function MC(t){return typeof t=="string"&&t.indexOf("%")!==-1}function tf(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function So(t){return t<=1?"".concat(Number(t)*100,"%"):t}function Pn(t){return t.length===1?"0"+t:String(t)}function FC(t,e,r){return{r:bt(t,255)*255,g:bt(e,255)*255,b:bt(r,255)*255}}function rf(t,e,r){t=bt(t,255),e=bt(e,255),r=bt(r,255);var n=Math.max(t,e,r),a=Math.min(t,e,r),i=0,s=0,l=(n+a)/2;if(n===a)s=0,i=0;else{var c=n-a;switch(s=l>.5?c/(2-n-a):c/(n+a),n){case t:i=(e-r)/c+(e<r?6:0);break;case e:i=(r-t)/c+2;break;case r:i=(t-e)/c+4;break}i/=6}return{h:i,s,l}}function kl(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*(6*r):r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function AC(t,e,r){var n,a,i;if(t=bt(t,360),e=bt(e,100),r=bt(r,100),e===0)a=r,i=r,n=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=kl(l,s,t+1/3),a=kl(l,s,t),i=kl(l,s,t-1/3)}return{r:n*255,g:a*255,b:i*255}}function nf(t,e,r){t=bt(t,255),e=bt(e,255),r=bt(r,255);var n=Math.max(t,e,r),a=Math.min(t,e,r),i=0,s=n,l=n-a,c=n===0?0:l/n;if(n===a)i=0;else{switch(n){case t:i=(e-r)/l+(e<r?6:0);break;case e:i=(r-t)/l+2;break;case r:i=(t-e)/l+4;break}i/=6}return{h:i,s:c,v:s}}function VC(t,e,r){t=bt(t,360)*6,e=bt(e,100),r=bt(r,100);var n=Math.floor(t),a=t-n,i=r*(1-e),s=r*(1-a*e),l=r*(1-(1-a)*e),c=n%6,u=[r,s,i,i,l,r][c],d=[l,r,r,s,i,i][c],f=[i,i,l,r,r,s][c];return{r:u*255,g:d*255,b:f*255}}function af(t,e,r,n){var a=[Pn(Math.round(t).toString(16)),Pn(Math.round(e).toString(16)),Pn(Math.round(r).toString(16))];return n&&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 RC(t,e,r,n,a){var i=[Pn(Math.round(t).toString(16)),Pn(Math.round(e).toString(16)),Pn(Math.round(r).toString(16)),Pn($C(n))];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 $C(t){return Math.round(parseFloat(t)*255).toString(16)}function of(t){return qt(t)/255}function qt(t){return parseInt(t,16)}function zC(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var xl={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 HC(t){var e={r:0,g:0,b:0},r=1,n=null,a=null,i=null,s=!1,l=!1;return typeof t=="string"&&(t=UC(t)),typeof t=="object"&&(Ar(t.r)&&Ar(t.g)&&Ar(t.b)?(e=FC(t.r,t.g,t.b),s=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Ar(t.h)&&Ar(t.s)&&Ar(t.v)?(n=So(t.s),a=So(t.v),e=VC(t.h,n,a),s=!0,l="hsv"):Ar(t.h)&&Ar(t.s)&&Ar(t.l)&&(n=So(t.s),i=So(t.l),e=AC(t.h,n,i),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(r=t.a)),r=tf(r),{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:r}}var KC="[-\\+]?\\d+%?",qC="[-\\+]?\\d*\\.\\d+%?",en="(?:".concat(qC,")|(?:").concat(KC,")"),El="[\\s|\\(]+(".concat(en,")[,|\\s]+(").concat(en,")[,|\\s]+(").concat(en,")\\s*\\)?"),Sl="[\\s|\\(]+(".concat(en,")[,|\\s]+(").concat(en,")[,|\\s]+(").concat(en,")[,|\\s]+(").concat(en,")\\s*\\)?"),or={CSS_UNIT:new RegExp(en),rgb:new RegExp("rgb"+El),rgba:new RegExp("rgba"+Sl),hsl:new RegExp("hsl"+El),hsla:new RegExp("hsla"+Sl),hsv:new RegExp("hsv"+El),hsva:new RegExp("hsva"+Sl),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 UC(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(xl[t])t=xl[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=or.rgb.exec(t);return r?{r:r[1],g:r[2],b:r[3]}:(r=or.rgba.exec(t),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=or.hsl.exec(t),r?{h:r[1],s:r[2],l:r[3]}:(r=or.hsla.exec(t),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=or.hsv.exec(t),r?{h:r[1],s:r[2],v:r[3]}:(r=or.hsva.exec(t),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=or.hex8.exec(t),r?{r:qt(r[1]),g:qt(r[2]),b:qt(r[3]),a:of(r[4]),format:e?"name":"hex8"}:(r=or.hex6.exec(t),r?{r:qt(r[1]),g:qt(r[2]),b:qt(r[3]),format:e?"name":"hex"}:(r=or.hex4.exec(t),r?{r:qt(r[1]+r[1]),g:qt(r[2]+r[2]),b:qt(r[3]+r[3]),a:of(r[4]+r[4]),format:e?"name":"hex8"}:(r=or.hex3.exec(t),r?{r:qt(r[1]+r[1]),g:qt(r[2]+r[2]),b:qt(r[3]+r[3]),format:e?"name":"hex"}:!1)))))))))}function Ar(t){return!!or.CSS_UNIT.exec(String(t))}var GC=function(){function t(e,r){e===void 0&&(e=""),r===void 0&&(r={});var n;if(e instanceof t)return e;typeof e=="number"&&(e=zC(e)),this.originalInput=e;var a=HC(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=(n=r.format)!==null&&n!==void 0?n:a.format,this.gradientType=r.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(),r,n,a,i=e.r/255,s=e.g/255,l=e.b/255;return i<=.03928?r=i/12.92:r=Math.pow((i+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),l<=.03928?a=l/12.92:a=Math.pow((l+.055)/1.055,2.4),.2126*r+.7152*n+.0722*a},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(e){return this.a=tf(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=nf(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=nf(this.r,this.g,this.b),r=Math.round(e.h*360),n=Math.round(e.s*100),a=Math.round(e.v*100);return this.a===1?"hsv(".concat(r,", ").concat(n,"%, ").concat(a,"%)"):"hsva(".concat(r,", ").concat(n,"%, ").concat(a,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var e=rf(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=rf(this.r,this.g,this.b),r=Math.round(e.h*360),n=Math.round(e.s*100),a=Math.round(e.l*100);return this.a===1?"hsl(".concat(r,", ").concat(n,"%, ").concat(a,"%)"):"hsla(".concat(r,", ").concat(n,"%, ").concat(a,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(e){return e===void 0&&(e=!1),af(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),RC(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),r=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(r,", ").concat(n,")"):"rgba(".concat(e,", ").concat(r,", ").concat(n,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var e=function(r){return"".concat(Math.round(bt(r,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(r){return Math.round(bt(r,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="#"+af(this.r,this.g,this.b,!1),r=0,n=Object.entries(xl);r<n.length;r++){var a=n[r],i=a[0],s=a[1];if(e===s)return i}return!1},t.prototype.toString=function(e){var r=!!e;e=e??this.format;var n=!1,a=this.a<1&&this.a>=0,i=!r&&a&&(e.startsWith("hex")||e==="name");return i?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||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 r=this.toHsl();return r.l+=e/100,r.l=Eo(r.l),new t(r)},t.prototype.brighten=function(e){e===void 0&&(e=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(e/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(e/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(e/100)))),new t(r)},t.prototype.darken=function(e){e===void 0&&(e=10);var r=this.toHsl();return r.l-=e/100,r.l=Eo(r.l),new t(r)},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 r=this.toHsl();return r.s-=e/100,r.s=Eo(r.s),new t(r)},t.prototype.saturate=function(e){e===void 0&&(e=10);var r=this.toHsl();return r.s+=e/100,r.s=Eo(r.s),new t(r)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var r=this.toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,new t(r)},t.prototype.mix=function(e,r){r===void 0&&(r=50);var n=this.toRgb(),a=new t(e).toRgb(),i=r/100,s={r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a};return new t(s)},t.prototype.analogous=function(e,r){e===void 0&&(e=6),r===void 0&&(r=30);var n=this.toHsl(),a=360/r,i=[this];for(n.h=(n.h-(a*e>>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(new t(n));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 r=this.toHsv(),n=r.h,a=r.s,i=r.v,s=[],l=1/e;e--;)s.push(new t({h:n,s:a,v:i})),i=(i+l)%1;return s},t.prototype.splitcomplement=function(){var e=this.toHsl(),r=e.h;return[this,new t({h:(r+72)%360,s:e.s,l:e.l}),new t({h:(r+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var r=this.toRgb(),n=new t(e).toRgb(),a=r.a+n.a*(1-r.a);return new t({r:(r.r*r.a+n.r*n.a*(1-r.a))/a,g:(r.g*r.a+n.g*n.a*(1-r.a))/a,b:(r.b*r.a+n.b*n.a*(1-r.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 r=this.toHsl(),n=r.h,a=[this],i=360/e,s=1;s<e;s++)a.push(new t({h:(n+s*i)%360,s:r.s,l:r.l}));return a},t.prototype.equals=function(e){return this.toRgbString()===new t(e).toRgbString()},t}();function tn(t,e=20){return t.mix("#141414",e).toString()}function WC(t){const e=ai(),r=Be("button");return o.computed(()=>{let n={},a=t.color;if(a){const i=a.match(/var\((.*?)\)/);i&&(a=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const s=new GC(a),l=t.dark?s.tint(20).toString():tn(s,20);if(t.plain)n=r.cssVarBlock({"bg-color":t.dark?tn(s,90):s.tint(90).toString(),"text-color":a,"border-color":t.dark?tn(s,50):s.tint(50).toString(),"hover-text-color":`var(${r.cssVarName("color-white")})`,"hover-bg-color":a,"hover-border-color":a,"active-bg-color":l,"active-text-color":`var(${r.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(n[r.cssVarBlockName("disabled-bg-color")]=t.dark?tn(s,90):s.tint(90).toString(),n[r.cssVarBlockName("disabled-text-color")]=t.dark?tn(s,50):s.tint(50).toString(),n[r.cssVarBlockName("disabled-border-color")]=t.dark?tn(s,80):s.tint(80).toString());else{const c=t.dark?tn(s,30):s.tint(30).toString(),u=s.isDark()?`var(${r.cssVarName("color-white")})`:`var(${r.cssVarName("color-black")})`;if(n=r.cssVarBlock({"bg-color":a,"text-color":u,"border-color":a,"hover-bg-color":c,"hover-text-color":u,"hover-border-color":c,"active-bg-color":l,"active-border-color":l}),e.value){const d=t.dark?tn(s,50):s.tint(50).toString();n[r.cssVarBlockName("disabled-bg-color")]=d,n[r.cssVarBlockName("disabled-text-color")]=t.dark?"rgba(255, 255, 255, 0.5)":`var(${r.cssVarName("color-white")})`,n[r.cssVarBlockName("disabled-border-color")]=d}}}return n})}const jC=o.defineComponent({name:"ElButton"}),YC=o.defineComponent({...jC,props:Cl,emits:IC,setup(t,{expose:e,emit:r}){const n=t,a=WC(n),i=Be("button"),{_ref:s,_size:l,_type:c,_disabled:u,_props:d,shouldAddSpace:f,handleClick:p}=OC(n,r),v=o.computed(()=>[i.b(),i.m(c.value),i.m(l.value),i.is("disabled",u.value),i.is("loading",n.loading),i.is("plain",n.plain),i.is("round",n.round),i.is("circle",n.circle),i.is("text",n.text),i.is("link",n.link),i.is("has-bg",n.bg)]);return e({ref:s,size:l,type:c,disabled:u,shouldAddSpace:f}),(h,g)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h.tag),o.mergeProps({ref_key:"_ref",ref:s},o.unref(d),{class:o.unref(v),style:o.unref(a),onClick:o.unref(p)}),{default:o.withCtx(()=>[h.loading?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[h.$slots.loading?o.renderSlot(h.$slots,"loading",{key:0}):(o.openBlock(),o.createBlock(o.unref(yt),{key:1,class:o.normalizeClass(o.unref(i).is("loading"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h.loadingIcon)))]),_:1},8,["class"]))],64)):h.icon||h.$slots.icon?(o.openBlock(),o.createBlock(o.unref(yt),{key:1},{default:o.withCtx(()=>[h.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h.icon),{key:0})):o.renderSlot(h.$slots,"icon",{key:1})]),_:3})):o.createCommentVNode("v-if",!0),h.$slots.default?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass({[o.unref(i).em("text","expand")]:o.unref(f)})},[o.renderSlot(h.$slots,"default")],2)):o.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var ZC=Te(YC,[["__file","button.vue"]]);const XC={size:Cl.size,type:Cl.type},QC=o.defineComponent({name:"ElButtonGroup"}),JC=o.defineComponent({...QC,props:XC,setup(t){const e=t;o.provide(ef,o.reactive({size:o.toRef(e,"size"),type:o.toRef(e,"type")}));const r=Be("button");return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(r).b("group"))},[o.renderSlot(n.$slots,"default")],2))}});var sf=Te(JC,[["__file","button-group.vue"]]);const sr=dt(ZC,{ButtonGroup:sf}),ek=Mr(sf),rn=new Map;if(et){let t;document.addEventListener("mousedown",e=>t=e),document.addEventListener("mouseup",e=>{if(t){for(const r of rn.values())for(const{documentHandler:n}of r)n(e,t);t=void 0}})}function lf(t,e){let r=[];return Array.isArray(e.arg)?r=e.arg:En(e.arg)&&r.push(e.arg),function(n,a){const i=e.instance.popperRef,s=n.target,l=a==null?void 0:a.target,c=!e||!e.instance,u=!s||!l,d=t.contains(s)||t.contains(l),f=t===s,p=r.length&&r.some(h=>h==null?void 0:h.contains(s))||r.length&&r.includes(l),v=i&&(i.contains(s)||i.contains(l));c||u||d||f||p||v||e.value(n,a)}}const cf={beforeMount(t,e){rn.has(t)||rn.set(t,[]),rn.get(t).push({documentHandler:lf(t,e),bindingFn:e.value})},updated(t,e){rn.has(t)||rn.set(t,[]);const r=rn.get(t),n=r.findIndex(i=>i.bindingFn===e.oldValue),a={documentHandler:lf(t,e),bindingFn:e.value};n>=0?r.splice(n,1,a):r.push(a)},unmounted(t){rn.delete(t)}},tk=Fe({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"}}),rk=o.defineComponent({name:"ElCard"}),nk=o.defineComponent({...rk,props:tk,setup(t){const e=Be("card");return(r,n)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([o.unref(e).b(),o.unref(e).is(`${r.shadow}-shadow`)])},[r.$slots.header||r.header?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(e).e("header"))},[o.renderSlot(r.$slots,"header",{},()=>[o.createTextVNode(o.toDisplayString(r.header),1)])],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{class:o.normalizeClass([o.unref(e).e("body"),r.bodyClass]),style:o.normalizeStyle(r.bodyStyle)},[o.renderSlot(r.$slots,"default")],6),r.$slots.footer||r.footer?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(e).e("footer"))},[o.renderSlot(r.$slots,"footer",{},()=>[o.createTextVNode(o.toDisplayString(r.footer),1)])],2)):o.createCommentVNode("v-if",!0)],2))}});var ak=Te(nk,[["__file","card.vue"]]);const ik=dt(ak),uf={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:sa,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...Qr(["ariaControls"])},df={[mt]:t=>St(t)||gt(t)||Qn(t),change:t=>St(t)||gt(t)||Qn(t)},ua=Symbol("checkboxGroupContextKey"),ok=({model:t,isChecked:e})=>{const r=o.inject(ua,void 0),n=o.computed(()=>{var i,s;const l=(i=r==null?void 0:r.max)==null?void 0:i.value,c=(s=r==null?void 0:r.min)==null?void 0:s.value;return!Yr(l)&&t.value.length>=l&&!e.value||!Yr(c)&&t.value.length<=c&&e.value});return{isDisabled:ai(o.computed(()=>(r==null?void 0:r.disabled.value)||n.value)),isLimitDisabled:n}},sk=(t,{model:e,isLimitExceeded:r,hasOwnLabel:n,isDisabled:a,isLabeledByFormItem:i})=>{const s=o.inject(ua,void 0),{formItem:l}=Dn(),{emit:c}=o.getCurrentInstance();function u(h){var g,y,m,b;return[!0,t.trueValue,t.trueLabel].includes(h)?(y=(g=t.trueValue)!=null?g:t.trueLabel)!=null?y:!0:(b=(m=t.falseValue)!=null?m:t.falseLabel)!=null?b:!1}function d(h,g){c("change",u(h),g)}function f(h){if(r.value)return;const g=h.target;c("change",u(g.checked),h)}async function p(h){r.value||!n.value&&!a.value&&i.value&&(h.composedPath().some(m=>m.tagName==="LABEL")||(e.value=u([!1,t.falseValue,t.falseLabel].includes(e.value)),await o.nextTick(),d(e.value,h)))}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(h=>tt(h)))}),{handleChange:f,onClickRoot:p}},lk=t=>{const e=o.ref(!1),{emit:r}=o.getCurrentInstance(),n=o.inject(ua,void 0),a=o.computed(()=>Yr(n)===!1),i=o.ref(!1),s=o.computed({get(){var l,c;return a.value?(l=n==null?void 0:n.modelValue)==null?void 0:l.value:(c=t.modelValue)!=null?c:e.value},set(l){var c,u;a.value&&At(l)?(i.value=((c=n==null?void 0:n.max)==null?void 0:c.value)!==void 0&&l.length>(n==null?void 0:n.max.value)&&l.length>s.value.length,i.value===!1&&((u=n==null?void 0:n.changeEvent)==null||u.call(n,l))):(r(mt,l),e.value=l)}});return{model:s,isGroup:a,isLimitExceeded:i}},ck=(t,e,{model:r})=>{const n=o.inject(ua,void 0),a=o.ref(!1),i=o.computed(()=>oo(t.value)?t.label:t.value),s=o.computed(()=>{const d=r.value;return Qn(d)?d:At(d)?vt(i.value)?d.map(o.toRaw).some(f=>io(f,i.value)):d.map(o.toRaw).includes(i.value):d!=null?d===t.trueValue||d===t.trueLabel:!!d}),l=Nn(o.computed(()=>{var d;return(d=n==null?void 0:n.size)==null?void 0:d.value}),{prop:!0}),c=Nn(o.computed(()=>{var d;return(d=n==null?void 0:n.size)==null?void 0:d.value})),u=o.computed(()=>!!e.default||!oo(i.value));return{checkboxButtonSize:l,isChecked:s,isFocused:a,checkboxSize:c,hasOwnLabel:u,actualValue:i}},ff=(t,e)=>{const{formItem:r}=Dn(),{model:n,isGroup:a,isLimitExceeded:i}=lk(t),{isFocused:s,isChecked:l,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,actualValue:f}=ck(t,e,{model:n}),{isDisabled:p}=ok({model:n,isChecked:l}),{inputId:v,isLabeledByFormItem:h}=ii(t,{formItemContext:r,disableIdGeneration:d,disableIdManagement:a}),{handleChange:g,onClickRoot:y}=sk(t,{model:n,isLimitExceeded:i,hasOwnLabel:d,isDisabled:p,isLabeledByFormItem:h});return(()=>{function b(){var w,C;At(n.value)&&!n.value.includes(f.value)?n.value.push(f.value):n.value=(C=(w=t.trueValue)!=null?w:t.trueLabel)!=null?C:!0}t.checked&&b()})(),uo({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&&oo(t.value))),uo({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)),uo({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:h,isChecked:l,isDisabled:p,isFocused:s,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,model:n,actualValue:f,handleChange:g,onClickRoot:y}},uk=o.defineComponent({name:"ElCheckbox"}),dk=o.defineComponent({...uk,props:uf,emits:df,setup(t){const e=t,r=o.useSlots(),{inputId:n,isLabeledByFormItem:a,isChecked:i,isDisabled:s,isFocused:l,checkboxSize:c,hasOwnLabel:u,model:d,actualValue:f,handleChange:p,onClickRoot:v}=ff(e,r),h=Be("checkbox"),g=o.computed(()=>[h.b(),h.m(c.value),h.is("disabled",s.value),h.is("bordered",e.border),h.is("checked",i.value)]),y=o.computed(()=>[h.e("input"),h.is("disabled",s.value),h.is("checked",i.value),h.is("indeterminate",e.indeterminate),h.is("focus",l.value)]);return(m,b)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(!o.unref(u)&&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,x,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(n),"onUpdate:modelValue":k=>o.isRef(d)?d.value=k:null,class:o.normalizeClass(o.unref(h).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=(x=m.falseValue)!=null?x:m.falseLabel)!=null?E:!1,onChange:o.unref(p),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(n),"onUpdate:modelValue":k=>o.isRef(d)?d.value=k:null,class:o.normalizeClass(o.unref(h).e("original")),type:"checkbox",indeterminate:m.indeterminate,disabled:o.unref(s),value:o.unref(f),name:m.name,tabindex:m.tabindex,onChange:o.unref(p),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(h).e("inner"))},null,2)],2),o.unref(u)?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(h).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 fk=Te(dk,[["__file","checkbox.vue"]]);const hk=o.defineComponent({name:"ElCheckboxButton"}),pk=o.defineComponent({...hk,props:uf,emits:df,setup(t){const e=t,r=o.useSlots(),{isFocused:n,isChecked:a,isDisabled:i,checkboxButtonSize:s,model:l,actualValue:c,handleChange:u}=ff(e,r),d=o.inject(ua,void 0),f=Be("checkbox"),p=o.computed(()=>{var h,g,y,m;const b=(g=(h=d==null?void 0:d.fill)==null?void 0:h.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",n.value)]);return(h,g)=>{var y,m,b,w;return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(o.unref(v))},[h.trueValue||h.falseValue||h.trueLabel||h.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:h.name,tabindex:h.tabindex,disabled:o.unref(i),"true-value":(m=(y=h.trueValue)!=null?y:h.trueLabel)!=null?m:!0,"false-value":(w=(b=h.falseValue)!=null?b:h.falseLabel)!=null?w:!1,onChange:o.unref(u),onFocus:C=>n.value=!0,onBlur:C=>n.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:h.name,tabindex:h.tabindex,disabled:o.unref(i),value:o.unref(c),onChange:o.unref(u),onFocus:C=>n.value=!0,onBlur:C=>n.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","value","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(l)]]),h.$slots.default||h.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(p):void 0)},[o.renderSlot(h.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(h.label),1)])],6)):o.createCommentVNode("v-if",!0)],2)}}});var hf=Te(pk,[["__file","checkbox-button.vue"]]);const vk=Fe({modelValue:{type:ke(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:sa,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...Qr(["ariaLabel"])}),gk={[mt]:t=>At(t),change:t=>At(t)},mk=o.defineComponent({name:"ElCheckboxGroup"}),yk=o.defineComponent({...mk,props:vk,emits:gk,setup(t,{emit:e}){const r=t,n=Be("checkbox"),{formItem:a}=Dn(),{inputId:i,isLabeledByFormItem:s}=ii(r,{formItemContext:a}),l=async u=>{e(mt,u),await o.nextTick(),e("change",u)},c=o.computed({get(){return r.modelValue},set(u){l(u)}});return o.provide(ua,{...qu(o.toRefs(r),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:c,changeEvent:l}),o.watch(()=>r.modelValue,()=>{r.validateEvent&&(a==null||a.validate("change").catch(u=>tt(u)))}),(u,d)=>{var f;return o.openBlock(),o.createBlock(o.resolveDynamicComponent(u.tag),{id:o.unref(i),class:o.normalizeClass(o.unref(n).b("group")),role:"group","aria-label":o.unref(s)?void 0:u.ariaLabel||"checkbox-group","aria-labelledby":o.unref(s)?(f=o.unref(a))==null?void 0:f.labelId:void 0},{default:o.withCtx(()=>[o.renderSlot(u.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var pf=Te(yk,[["__file","checkbox-group.vue"]]);const bk=dt(fk,{CheckboxButton:hf,CheckboxGroup:pf});Mr(hf),Mr(pf);const Tl=Fe({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Xu},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),wk={close:t=>t instanceof MouseEvent,click:t=>t instanceof MouseEvent},Ck=o.defineComponent({name:"ElTag"}),kk=o.defineComponent({...Ck,props:Tl,emits:wk,setup(t,{emit:e}){const r=t,n=Nn(),a=Be("tag"),i=o.computed(()=>{const{type:u,hit:d,effect:f,closable:p,round:v}=r;return[a.b(),a.is("closable",p),a.m(u||"primary"),a.m(n.value),a.m(f),a.is("hit",d),a.is("round",v)]}),s=u=>{e("close",u)},l=u=>{e("click",u)},c=u=>{u.component.subTree.component.bum=null};return(u,d)=>u.disableTransitions?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle({backgroundColor:u.color}),onClick:l},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(a).e("content"))},[o.renderSlot(u.$slots,"default")],2),u.closable?(o.openBlock(),o.createBlock(o.unref(yt),{key:0,class:o.normalizeClass(o.unref(a).e("close")),onClick:o.withModifiers(s,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(lo))]),_: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:c},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle({backgroundColor:u.color}),onClick:l},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(a).e("content"))},[o.renderSlot(u.$slots,"default")],2),u.closable?(o.openBlock(),o.createBlock(o.unref(yt),{key:0,class:o.normalizeClass(o.unref(a).e("close")),onClick:o.withModifiers(s,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(lo))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var xk=Te(kk,[["__file","tag.vue"]]);const Ek=dt(xk),vf=Symbol("rowContextKey"),Sk=Fe({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"]}}),Tk=o.defineComponent({name:"ElRow"}),Bk=o.defineComponent({...Tk,props:Sk,setup(t){const e=t,r=Be("row"),n=o.computed(()=>e.gutter);o.provide(vf,{gutter:n});const a=o.computed(()=>{const s={};return e.gutter&&(s.marginRight=s.marginLeft=`-${e.gutter/2}px`),s}),i=o.computed(()=>[r.b(),r.is(`justify-${e.justify}`,e.justify!=="start"),r.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 Nk=Te(Bk,[["__file","row.vue"]]);const To=dt(Nk),Dk=Fe({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:()=>ea({})},sm:{type:ke([Number,Object]),default:()=>ea({})},md:{type:ke([Number,Object]),default:()=>ea({})},lg:{type:ke([Number,Object]),default:()=>ea({})},xl:{type:ke([Number,Object]),default:()=>ea({})}}),Pk=o.defineComponent({name:"ElCol"}),_k=o.defineComponent({...Pk,props:Dk,setup(t){const e=t,{gutter:r}=o.inject(vf,{gutter:o.computed(()=>0)}),n=Be("col"),a=o.computed(()=>{const s={};return r.value&&(s.paddingLeft=s.paddingRight=`${r.value/2}px`),s}),i=o.computed(()=>{const s=[];return["span","offset","pull","push"].forEach(u=>{const d=e[u];gt(d)&&(u==="span"?s.push(n.b(`${e[u]}`)):d>0&&s.push(n.b(`${u}-${e[u]}`)))}),["xs","sm","md","lg","xl"].forEach(u=>{gt(e[u])?s.push(n.b(`${u}-${e[u]}`)):vt(e[u])&&Object.entries(e[u]).forEach(([d,f])=>{s.push(d!=="span"?n.b(`${u}-${d}-${f}`):n.b(`${u}-${f}`))})}),r.value&&s.push(n.is("guttered")),[n.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 Ok=Te(_k,[["__file","col.vue"]]);const ci=dt(Ok),Ik=o.defineComponent({name:"ElCollapseTransition"}),Lk=o.defineComponent({...Ik,setup(t){const e=Be("collapse-transition"),r=a=>{a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom},n={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){r(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){r(a)},leaveCancelled(a){r(a)}};return(a,i)=>(o.openBlock(),o.createBlock(o.Transition,o.mergeProps({name:o.unref(e).b()},o.toHandlers(n)),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["name"]))}});var Mk=Te(Lk,[["__file","collapse-transition.vue"]]);const Fk=dt(Mk),Ak=Fe({color:{type:ke(Object),required:!0},vertical:{type:Boolean,default:!1}});let Bl=!1;function ui(t,e){if(!et)return;const r=function(i){var s;(s=e.drag)==null||s.call(e,i)},n=function(i){var s;document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",n),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",n),document.onselectstart=null,document.ondragstart=null,Bl=!1,(s=e.end)==null||s.call(e,i)},a=function(i){var s;Bl||(i.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",r),document.addEventListener("mouseup",n),document.addEventListener("touchmove",r),document.addEventListener("touchend",n),Bl=!0,(s=e.start)==null||s.call(e,i))};t.addEventListener("mousedown",a),t.addEventListener("touchstart",a,{passive:!1})}const Vk=t=>{const e=o.getCurrentInstance(),{t:r}=Ya(),n=o.shallowRef(),a=o.shallowRef(),i=o.computed(()=>t.color.get("alpha")),s=o.computed(()=>r("el.colorpicker.alphaLabel"));function l(f){var p;f.target!==n.value&&c(f),(p=n.value)==null||p.focus()}function c(f){if(!a.value||!n.value)return;const v=e.vnode.el.getBoundingClientRect(),{clientX:h,clientY:g}=Ps(f);if(t.vertical){let y=g-v.top;y=Math.max(n.value.offsetHeight/2,y),y=Math.min(y,v.height-n.value.offsetHeight/2),t.color.set("alpha",Math.round((y-n.value.offsetHeight/2)/(v.height-n.value.offsetHeight)*100))}else{let y=h-v.left;y=Math.max(n.value.offsetWidth/2,y),y=Math.min(y,v.width-n.value.offsetWidth/2),t.color.set("alpha",Math.round((y-n.value.offsetWidth/2)/(v.width-n.value.offsetWidth)*100))}}function u(f){const{code:p,shiftKey:v}=f,h=v?10:1;switch(p){case it.left:case it.down:f.preventDefault(),f.stopPropagation(),d(-h);break;case it.right:case it.up:f.preventDefault(),f.stopPropagation(),d(h);break}}function d(f){let p=i.value+f;p=p<0?0:p>100?100:p,t.color.set("alpha",p)}return{thumb:n,bar:a,alpha:i,alphaLabel:s,handleDrag:c,handleClick:l,handleKeydown:u}},Rk=(t,{bar:e,thumb:r,handleDrag:n})=>{const a=o.getCurrentInstance(),i=Be("color-alpha-slider"),s=o.ref(0),l=o.ref(0),c=o.ref();function u(){if(!r.value||t.vertical)return 0;const b=a.vnode.el,w=t.color.get("alpha");return b?Math.round(w*(b.offsetWidth-r.value.offsetWidth/2)/100):0}function d(){if(!r.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-r.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 p(){s.value=u(),l.value=d(),c.value=f()}o.onMounted(()=>{if(!e.value||!r.value)return;const b={drag:w=>{n(w)},end:w=>{n(w)}};ui(e.value,b),ui(r.value,b),p()}),o.watch(()=>t.color.get("alpha"),()=>p()),o.watch(()=>t.color.value,()=>p());const v=o.computed(()=>[i.b(),i.is("vertical",t.vertical)]),h=o.computed(()=>i.e("bar")),g=o.computed(()=>i.e("thumb")),y=o.computed(()=>({background:c.value})),m=o.computed(()=>({left:Jn(s.value),top:Jn(l.value)}));return{rootKls:v,barKls:h,barStyle:y,thumbKls:g,thumbStyle:m,update:p}},$k=o.defineComponent({name:"ElColorAlphaSlider"}),zk=o.defineComponent({...$k,props:Ak,setup(t,{expose:e}){const r=t,{alpha:n,alphaLabel:a,bar:i,thumb:s,handleDrag:l,handleClick:c,handleKeydown:u}=Vk(r),{rootKls:d,barKls:f,barStyle:p,thumbKls:v,thumbStyle:h,update:g}=Rk(r,{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(p)),onClick:o.unref(c)},null,14,["onClick"]),o.createElementVNode("div",{ref_key:"thumb",ref:s,class:o.normalizeClass(o.unref(v)),style:o.normalizeStyle(o.unref(h)),"aria-label":o.unref(a),"aria-valuenow":o.unref(n),"aria-orientation":y.vertical?"vertical":"horizontal","aria-valuemin":"0","aria-valuemax":"100",role:"slider",tabindex:"0",onKeydown:o.unref(u)},null,46,["aria-label","aria-valuenow","aria-orientation","onKeydown"])],2))}});var Hk=Te(zk,[["__file","alpha-slider.vue"]]);const Kk=o.defineComponent({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(t){const e=Be("color-hue-slider"),r=o.getCurrentInstance(),n=o.ref(),a=o.ref(),i=o.ref(0),s=o.ref(0),l=o.computed(()=>t.color.get("hue"));o.watch(()=>l.value,()=>{p()});function c(v){v.target!==n.value&&u(v)}function u(v){if(!a.value||!n.value)return;const g=r.vnode.el.getBoundingClientRect(),{clientX:y,clientY:m}=Ps(v);let b;if(t.vertical){let w=m-g.top;w=Math.min(w,g.height-n.value.offsetHeight/2),w=Math.max(n.value.offsetHeight/2,w),b=Math.round((w-n.value.offsetHeight/2)/(g.height-n.value.offsetHeight)*360)}else{let w=y-g.left;w=Math.min(w,g.width-n.value.offsetWidth/2),w=Math.max(n.value.offsetWidth/2,w),b=Math.round((w-n.value.offsetWidth/2)/(g.width-n.value.offsetWidth)*360)}t.color.set("hue",b)}function d(){if(!n.value)return 0;const v=r.vnode.el;if(t.vertical)return 0;const h=t.color.get("hue");return v?Math.round(h*(v.offsetWidth-n.value.offsetWidth/2)/360):0}function f(){if(!n.value)return 0;const v=r.vnode.el;if(!t.vertical)return 0;const h=t.color.get("hue");return v?Math.round(h*(v.offsetHeight-n.value.offsetHeight/2)/360):0}function p(){i.value=d(),s.value=f()}return o.onMounted(()=>{if(!a.value||!n.value)return;const v={drag:h=>{u(h)},end:h=>{u(h)}};ui(a.value,v),ui(n.value,v),p()}),{bar:a,thumb:n,thumbLeft:i,thumbTop:s,hueValue:l,handleClick:c,update:p,ns:e}}});function qk(t,e,r,n,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 Uk=Te(Kk,[["render",qk],["__file","hue-slider.vue"]]);const Gk=Fe({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:sa,popperClass:{type:String,default:""},tabindex:{type:[String,Number],default:0},teleported:$t.teleported,predefine:{type:ke(Array)},validateEvent:{type:Boolean,default:!0},...Qr(["ariaLabel"])}),Wk={[mt]:t=>St(t)||jr(t),[Xs]:t=>St(t)||jr(t),activeChange:t=>St(t)||jr(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent},gf=Symbol("colorPickerContextKey"),mf=function(t,e,r){return[t,e*r/((t=(2-e)*r)<1?t:2-t)||0,t/2]},jk=function(t){return typeof t=="string"&&t.includes(".")&&Number.parseFloat(t)===1},Yk=function(t){return typeof t=="string"&&t.includes("%")},da=function(t,e){jk(t)&&(t="100%");const r=Yk(t);return t=Math.min(e,Math.max(0,Number.parseFloat(`${t}`))),r&&(t=Number.parseInt(`${t*e}`,10)/100),Math.abs(t-e)<1e-6?1:t%e/Number.parseFloat(e)},yf={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},Bo=t=>{t=Math.min(Math.round(t),255);const e=Math.floor(t/16),r=t%16;return`${yf[e]||e}${yf[r]||r}`},bf=function({r:t,g:e,b:r}){return Number.isNaN(+t)||Number.isNaN(+e)||Number.isNaN(+r)?"":`#${Bo(t)}${Bo(e)}${Bo(r)}`},Nl={A:10,B:11,C:12,D:13,E:14,F:15},_n=function(t){return t.length===2?(Nl[t[0].toUpperCase()]||+t[0])*16+(Nl[t[1].toUpperCase()]||+t[1]):Nl[t[1].toUpperCase()]||+t[1]},Zk=function(t,e,r){e=e/100,r=r/100;let n=e;const a=Math.max(r,.01);r*=2,e*=r<=1?r:2-r,n*=a<=1?a:2-a;const i=(r+e)/2,s=r===0?2*n/(a+n):2*e/(r+e);return{h:t,s:s*100,v:i*100}},wf=(t,e,r)=>{t=da(t,255),e=da(e,255),r=da(r,255);const n=Math.max(t,e,r),a=Math.min(t,e,r);let i;const s=n,l=n-a,c=n===0?0:l/n;if(n===a)i=0;else{switch(n){case t:{i=(e-r)/l+(e<r?6:0);break}case e:{i=(r-t)/l+2;break}case r:{i=(t-e)/l+4;break}}i/=6}return{h:i*360,s:c*100,v:s*100}},di=function(t,e,r){t=da(t,360)*6,e=da(e,100),r=da(r,100);const n=Math.floor(t),a=t-n,i=r*(1-e),s=r*(1-a*e),l=r*(1-(1-a)*e),c=n%6,u=[r,s,i,i,l,r][c],d=[l,r,r,s,i,i][c],f=[i,i,l,r,r,s][c];return{r:Math.round(u*255),g:Math.round(d*255),b:Math.round(f*255)}};class fi{constructor(e={}){this._hue=0,this._saturation=100,this._value=100,this._alpha=100,this.enableAlpha=!1,this.format="hex",this.value="";for(const r in e)wn(e,r)&&(this[r]=e[r]);e.value?this.fromString(e.value):this.doOnChange()}set(e,r){if(arguments.length===1&&typeof e=="object"){for(const n in e)wn(e,n)&&this.set(n,e[n]);return}this[`_${e}`]=r,this.doOnChange()}get(e){return e==="alpha"?Math.floor(this[`_${e}`]):this[`_${e}`]}toRgb(){return di(this._hue,this._saturation,this._value)}fromString(e){if(!e){this._hue=0,this._saturation=100,this._value=100,this.doOnChange();return}const r=(n,a,i)=>{this._hue=Math.max(0,Math.min(360,n)),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 n=e.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));if(n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3){const{h:a,s:i,v:s}=Zk(n[0],n[1],n[2]);r(a,i,s)}}else if(e.includes("hsv")){const n=e.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3&&r(n[0],n[1],n[2])}else if(e.includes("rgb")){const n=e.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));if(n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3){const{h:a,s:i,v:s}=wf(n[0],n[1],n[2]);r(a,i,s)}}else if(e.includes("#")){const n=e.replace("#","").trim();if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(n))return;let a,i,s;n.length===3?(a=_n(n[0]+n[0]),i=_n(n[1]+n[1]),s=_n(n[2]+n[2])):(n.length===6||n.length===8)&&(a=_n(n.slice(0,2)),i=_n(n.slice(2,4)),s=_n(n.slice(4,6))),n.length===8?this._alpha=_n(n.slice(6))/255*100:(n.length===3||n.length===6)&&(this._alpha=100);const{h:l,s:c,v:u}=wf(a,i,s);r(l,c,u)}}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:r,_value:n,_alpha:a,format:i}=this;if(this.enableAlpha)switch(i){case"hsl":{const s=mf(e,r/100,n/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(r)}%, ${Math.round(n)}%, ${this.get("alpha")/100})`;break}case"hex":{this.value=`${bf(di(e,r,n))}${Bo(a*255/100)}`;break}default:{const{r:s,g:l,b:c}=di(e,r,n);this.value=`rgba(${s}, ${l}, ${c}, ${this.get("alpha")/100})`}}else switch(i){case"hsl":{const s=mf(e,r/100,n/100);this.value=`hsl(${e}, ${Math.round(s[1]*100)}%, ${Math.round(s[2]*100)}%)`;break}case"hsv":{this.value=`hsv(${e}, ${Math.round(r)}%, ${Math.round(n)}%)`;break}case"rgb":{const{r:s,g:l,b:c}=di(e,r,n);this.value=`rgb(${s}, ${l}, ${c})`;break}default:this.value=bf(di(e,r,n))}}}const Xk=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:r}=o.inject(gf),n=o.ref(i(t.colors,t.color));o.watch(()=>r.value,s=>{const l=new fi;l.fromString(s),n.value.forEach(c=>{c.selected=l.compare(c)})}),o.watchEffect(()=>{n.value=i(t.colors,t.color)});function a(s){t.color.fromString(t.colors[s])}function i(s,l){return s.map(c=>{const u=new fi;return u.enableAlpha=t.enableAlpha,u.format="rgba",u.fromString(c),u.selected=u.value===l.value,u})}return{rgbaColors:n,handleSelect:a,ns:e}}});function Qk(t,e,r,n,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:c=>t.handleSelect(l)},[o.createElementVNode("div",{style:o.normalizeStyle({backgroundColor:s.value})},null,4)],10,["onClick"]))),128))],2)],2)}var Jk=Te(Xk,[["render",Qk],["__file","predefine.vue"]]);const ex=o.defineComponent({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(t){const e=Be("color-svpanel"),r=o.getCurrentInstance(),n=o.ref(0),a=o.ref(0),i=o.ref("hsl(0, 100%, 50%)"),s=o.computed(()=>{const u=t.color.get("hue"),d=t.color.get("value");return{hue:u,value:d}});function l(){const u=t.color.get("saturation"),d=t.color.get("value"),f=r.vnode.el,{clientWidth:p,clientHeight:v}=f;a.value=u*p/100,n.value=(100-d)*v/100,i.value=`hsl(${t.color.get("hue")}, 100%, 50%)`}function c(u){const f=r.vnode.el.getBoundingClientRect(),{clientX:p,clientY:v}=Ps(u);let h=p-f.left,g=v-f.top;h=Math.max(0,h),h=Math.min(h,f.width),g=Math.max(0,g),g=Math.min(g,f.height),a.value=h,n.value=g,t.color.set({saturation:h/f.width*100,value:100-g/f.height*100})}return o.watch(()=>s.value,()=>{l()}),o.onMounted(()=>{ui(r.vnode.el,{drag:u=>{c(u)},end:u=>{c(u)}}),l()}),{cursorTop:n,cursorLeft:a,background:i,colorValue:s,handleDrag:c,update:l,ns:e}}});function tx(t,e,r,n,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 rx=Te(ex,[["render",tx],["__file","sv-panel.vue"]]);const nx=o.defineComponent({name:"ElColorPicker"}),ax=o.defineComponent({...nx,props:Gk,emits:Wk,setup(t,{expose:e,emit:r}){const n=t,{t:a}=Ya(),i=Be("color"),{formItem:s}=Dn(),l=Nn(),c=ai(),{inputId:u,isLabeledByFormItem:d}=ii(n,{formItemContext:s}),f=o.ref(),p=o.ref(),v=o.ref(),h=o.ref(),g=o.ref(),y=o.ref(),{isFocused:m,handleFocus:b,handleBlur:w}=cl(g,{beforeFocus(){return c.value},beforeBlur(A){var K;return(K=h.value)==null?void 0:K.isFocusInsideContent(A)},afterBlur(){F(!1),V()}});let C=!0;const x=o.reactive(new fi({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue})),E=o.ref(!1),k=o.ref(!1),B=o.ref(""),S=o.computed(()=>!n.modelValue&&!k.value?"transparent":_(x,n.showAlpha)),N=o.computed(()=>!n.modelValue&&!k.value?"":x.value),D=o.computed(()=>d.value?void 0:n.ariaLabel||a("el.colorpicker.defaultLabel")),P=o.computed(()=>d.value?s==null?void 0:s.labelId:void 0),I=o.computed(()=>[i.b("picker"),i.is("disabled",c.value),i.bm("picker",l.value),i.is("focused",m.value)]);function _(A,K){if(!(A instanceof fi))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=Ku(F,100,{leading:!0});function M(){c.value||F(!0)}function L(){O(!1),V()}function V(){o.nextTick(()=>{n.modelValue?x.fromString(n.modelValue):(x.value="",o.nextTick(()=>{k.value=!1}))})}function H(){c.value||O(!E.value)}function $(){x.fromString(B.value)}function z(){const A=x.value;r(mt,A),r("change",A),n.validateEvent&&(s==null||s.validate("change").catch(K=>tt(K))),O(!1),o.nextTick(()=>{const K=new fi({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue});x.compare(K)||V()})}function j(){O(!1),r(mt,null),r("change",null),n.modelValue!==null&&n.validateEvent&&(s==null||s.validate("change").catch(A=>tt(A))),V()}function ee(){E.value&&(L(),m.value&&re())}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 re(){g.value.focus()}function Y(){g.value.blur()}return o.onMounted(()=>{n.modelValue&&(B.value=N.value)}),o.watch(()=>n.modelValue,A=>{A?A&&A!==x.value&&(C=!1,x.fromString(A)):k.value=!1}),o.watch(()=>[n.colorFormat,n.showAlpha],()=>{x.enableAlpha=n.showAlpha,x.format=n.colorFormat||x.format,x.doOnChange(),r(mt,x.value)}),o.watch(()=>N.value,A=>{B.value=A,C&&r("activeChange",A),C=!0}),o.watch(()=>x.value,()=>{!n.modelValue&&!k.value&&(k.value=!0)}),o.watch(()=>E.value,()=>{o.nextTick(()=>{var A,K,W;(A=f.value)==null||A.update(),(K=p.value)==null||K.update(),(W=v.value)==null||W.update()})}),o.provide(gf,{currentColor:N}),e({color:x,show:M,hide:L,focus:re,blur:Y}),(A,K)=>(o.openBlock(),o.createBlock(o.unref(li),{ref_key:"popper",ref:h,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(Uk,{ref_key:"hue",ref:f,class:"hue-slider",color:o.unref(x),vertical:""},null,8,["color"]),o.createVNode(rx,{ref_key:"sv",ref:p,color:o.unref(x)},null,8,["color"])],2),A.showAlpha?(o.openBlock(),o.createBlock(Hk,{key:0,ref_key:"alpha",ref:v,color:o.unref(x)},null,8,["color"])):o.createCommentVNode("v-if",!0),A.predefine?(o.openBlock(),o.createBlock(Jk,{key:1,ref:"predefine","enable-alpha":A.showAlpha,color:o.unref(x),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(oi),{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(sr),{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(sr),{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(cf),ee]])]),default:o.withCtx(()=>[o.createElementVNode("div",o.mergeProps({id:o.unref(u),ref_key:"triggerRef",ref:g},A.$attrs,{class:o.unref(I),role:"button","aria-label":o.unref(D),"aria-labelledby":o.unref(P),"aria-description":o.unref(a)("el.colorpicker.description",{color:A.modelValue||""}),"aria-disabled":o.unref(c),tabindex:o.unref(c)?-1:A.tabindex,onKeydown:X,onFocus:o.unref(b),onBlur:o.unref(w)}),[o.unref(c)?(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(yt),{class:o.normalizeClass([o.unref(i).be("picker","icon"),o.unref(i).is("icon-arrow-down")])},{default:o.withCtx(()=>[o.createVNode(o.unref(so))]),_:1},8,["class"]),[[o.vShow,A.modelValue||k.value]]),o.withDirectives(o.createVNode(o.unref(yt),{class:o.normalizeClass([o.unref(i).be("picker","empty"),o.unref(i).is("icon-close")])},{default:o.withCtx(()=>[o.createVNode(o.unref(lo))]),_: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 ix=Te(ax,[["__file","color-picker.vue"]]);const ox=dt(ix),sx=o.defineComponent({name:"ElContainer"}),lx=o.defineComponent({...sx,props:{direction:{type:String}},setup(t){const e=t,r=o.useSlots(),n=Be("container"),a=o.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:r&&r.default?r.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(n).b(),o.unref(n).is("vertical",o.unref(a))])},[o.renderSlot(i.$slots,"default")],2))}});var cx=Te(lx,[["__file","container.vue"]]);const ux=o.defineComponent({name:"ElAside"}),dx=o.defineComponent({...ux,props:{width:{type:String,default:null}},setup(t){const e=t,r=Be("aside"),n=o.computed(()=>e.width?r.cssVarBlock({width:e.width}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("aside",{class:o.normalizeClass(o.unref(r).b()),style:o.normalizeStyle(o.unref(n))},[o.renderSlot(a.$slots,"default")],6))}});var Cf=Te(dx,[["__file","aside.vue"]]);const fx=o.defineComponent({name:"ElFooter"}),hx=o.defineComponent({...fx,props:{height:{type:String,default:null}},setup(t){const e=t,r=Be("footer"),n=o.computed(()=>e.height?r.cssVarBlock({height:e.height}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("footer",{class:o.normalizeClass(o.unref(r).b()),style:o.normalizeStyle(o.unref(n))},[o.renderSlot(a.$slots,"default")],6))}});var kf=Te(hx,[["__file","footer.vue"]]);const px=o.defineComponent({name:"ElHeader"}),vx=o.defineComponent({...px,props:{height:{type:String,default:null}},setup(t){const e=t,r=Be("header"),n=o.computed(()=>e.height?r.cssVarBlock({height:e.height}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("header",{class:o.normalizeClass(o.unref(r).b()),style:o.normalizeStyle(o.unref(n))},[o.renderSlot(a.$slots,"default")],6))}});var xf=Te(vx,[["__file","header.vue"]]);const gx=o.defineComponent({name:"ElMain"}),mx=o.defineComponent({...gx,setup(t){const e=Be("main");return(r,n)=>(o.openBlock(),o.createElementBlock("main",{class:o.normalizeClass(o.unref(e).b())},[o.renderSlot(r.$slots,"default")],2))}});var Ef=Te(mx,[["__file","main.vue"]]);const Sf=dt(cx,{Aside:Cf,Footer:kf,Header:xf,Main:Ef});Mr(Cf),Mr(kf);const Tf=Mr(xf),Dl=Mr(Ef),yx=o.defineComponent({inheritAttrs:!1});function bx(t,e,r,n,a,i){return o.renderSlot(t.$slots,"default")}var wx=Te(yx,[["render",bx],["__file","collection.vue"]]);const Cx=o.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function kx(t,e,r,n,a,i){return o.renderSlot(t.$slots,"default")}var xx=Te(Cx,[["render",kx],["__file","collection-item.vue"]]);const Ex="data-el-collection-item",Sx=t=>{const e=`El${t}Collection`,r=`${e}Item`,n=Symbol(e),a=Symbol(r),i={...wx,name:e,setup(){const l=o.ref(null),c=new Map,u=()=>{const d=o.unref(l);if(!d)return[];const f=Array.from(d.querySelectorAll(`[${Ex}]`));return[...c.values()].sort((v,h)=>f.indexOf(v.ref)-f.indexOf(h.ref))};o.provide(n,{itemMap:c,getItems:u,collectionRef:l})}},s={...xx,name:r,setup(l,{attrs:c}){const u=o.ref(null),d=o.inject(n,void 0);o.provide(a,{collectionItemRef:u}),o.onMounted(()=>{const f=o.unref(u);f&&d.itemMap.set(f,{ref:f,...c})}),o.onBeforeUnmount(()=>{const f=o.unref(u);d.itemMap.delete(f)})}};return{COLLECTION_INJECTION_KEY:n,COLLECTION_ITEM_INJECTION_KEY:a,ElCollection:i,ElCollectionItem:s}},Pl=Fe({trigger:si.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});Fe({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:Zr}}),Fe({onKeydown:{type:ke(Function)}}),Sx("Dropdown");const Bf=Symbol("ElSelectGroup"),hi=Symbol("ElSelect");function Tx(t,e){const r=o.inject(hi),n=o.inject(Bf,{disabled:!1}),a=o.computed(()=>d(Gr(r.props.modelValue),t.value)),i=o.computed(()=>{var v;if(r.props.multiple){const h=Gr((v=r.props.modelValue)!=null?v:[]);return!a.value&&h.length>=r.props.multipleLimit&&r.props.multipleLimit>0}else return!1}),s=o.computed(()=>t.label||(vt(t.value)?"":t.value)),l=o.computed(()=>t.value||t.label||""),c=o.computed(()=>t.disabled||e.groupDisabled||i.value),u=o.getCurrentInstance(),d=(v=[],h)=>{if(vt(t.value)){const g=r.props.valueKey;return v&&v.some(y=>o.toRaw(Ir(y,g))===Ir(h,g))}else return v&&v.includes(h)},f=()=>{!t.disabled&&!n.disabled&&(r.states.hoveringIndex=r.optionsArray.indexOf(u.proxy))},p=v=>{const h=new RegExp($1(v),"i");e.visible=h.test(s.value)||t.created};return o.watch(()=>s.value,()=>{!t.created&&!r.props.remote&&r.setSelected()}),o.watch(()=>t.value,(v,h)=>{const{remote:g,valueKey:y}=r.props;if(v!==h&&(r.onOptionDestroy(h,u.proxy),r.onOptionCreate(u.proxy)),!t.created&&!g){if(y&&vt(v)&&vt(h)&&v[y]===h[y])return;r.setSelected()}}),o.watch(()=>n.disabled,()=>{e.groupDisabled=n.disabled},{immediate:!0}),{select:r,currentLabel:s,currentValue:l,itemSelected:a,isDisabled:c,hoverItem:f,updateOption:p}}const Bx=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"),r=yo(),n=o.computed(()=>[e.be("dropdown","item"),e.is("disabled",o.unref(l)),e.is("selected",o.unref(s)),e.is("hovering",o.unref(p))]),a=o.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:i,itemSelected:s,isDisabled:l,select:c,hoverItem:u,updateOption:d}=Tx(t,a),{visible:f,hover:p}=o.toRefs(a),v=o.getCurrentInstance().proxy;c.onOptionCreate(v),o.onBeforeUnmount(()=>{const g=v.value,{selected:y}=c.states,b=(c.props.multiple?y:[y]).some(w=>w.value===v.value);o.nextTick(()=>{c.states.cachedOptions.get(g)===v&&!b&&c.states.cachedOptions.delete(g)}),c.onOptionDestroy(g,v)});function h(){l.value||c.handleOptionSelect(v)}return{ns:e,id:r,containerKls:n,currentLabel:i,itemSelected:s,isDisabled:l,select:c,hoverItem:u,updateOption:d,visible:f,hover:p,selectOptionClick:h,states:a}}});function Nx(t,e,r,n,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 _l=Te(Bx,[["render",Nx],["__file","option.vue"]]);const Dx=o.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const t=o.inject(hi),e=Be("select"),r=o.computed(()=>t.props.popperClass),n=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(),Pr(t.selectRef,s)}),{ns:e,minWidth:i,popperClass:r,isMultiple:n,isFitInputWidth:a}}});function Px(t,e,r,n,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 _x=Te(Dx,[["render",Px],["__file","select-dropdown.vue"]]);const Ox=11,Ix=(t,e)=>{const{t:r}=Ya(),n=yo(),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),c=o.ref(null),u=o.ref(null),d=o.ref(null),f=o.ref(null),p=o.ref(null),v=o.ref(null),h=o.ref(null),g=o.ref(null),y=o.ref(null),m=o.ref(null),b=o.ref(null),{isComposing:w,handleCompositionStart:C,handleCompositionUpdate:x,handleCompositionEnd:E}=Ld({afterComposition:q=>Q(q)}),{wrapperRef:k,isFocused:B}=cl(f,{beforeFocus(){return O.value},afterFocus(){t.automaticDropdown&&!S.value&&(S.value=!0,s.menuVisibleOnFocus=!0)},beforeBlur(q){var ce,_e;return((ce=u.value)==null?void 0:ce.isFocusInsideContent(q))||((_e=d.value)==null?void 0:_e.isFocusInsideContent(q))},afterBlur(){S.value=!1,s.menuVisibleOnFocus=!1}}),S=o.ref(!1),N=o.ref(),{form:D,formItem:P}=Dn(),{inputId:I}=ii(t,{formItemContext:P}),{valueOnClear:_,isEmptyValue:F}=t2(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(()=>(P==null?void 0:P.validateState)||""),z=o.computed(()=>Zu[$.value]),j=o.computed(()=>t.remote?300:0),ee=o.computed(()=>t.loading?t.loadingText||r("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||r("el.select.noMatch"):s.options.size===0?t.noDataText||r("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(_e=>{const He=q.findIndex(Nr=>Nr.value===_e);He>-1&&ce.push(q[He])}),ce.length>=q.length?ce:q}),re=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=Nn(),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&&!Yr(t.modelValue))return Gr(t.modelValue).length===0&&!s.inputValue;const q=At(t.modelValue)?t.modelValue[0]:t.modelValue;return t.filterable||Yr(q)?!s.inputValue:!0}),ne=o.computed(()=>{var q;const ce=(q=t.placeholder)!=null?q:r("el.select.placeholder");return t.multiple||!M.value?ce:s.selectedLabel}),se=o.computed(()=>Ds?null:"mouseenter");o.watch(()=>t.modelValue,(q,ce)=>{t.multiple&&t.filterable&&!t.reserveKeyword&&(s.inputValue="",ue("")),de(),!io(q,ce)&&t.validateEvent&&(P==null||P.validate("change").catch(_e=>tt(_e)))},{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&&!Yr(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=>{gt(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),_e=q[0];s.hoveringIndex=ge(X.value,ce||_e)},de=()=>{if(t.multiple)s.selectedLabel="";else{const ce=At(t.modelValue)?t.modelValue[0]:t.modelValue,_e=me(ce);s.selectedLabel=_e.currentLabel,s.selected=[_e];return}const q=[];Yr(t.modelValue)||Gr(t.modelValue).forEach(ce=>{q.push(me(ce))}),s.selected=q},me=q=>{let ce;const _e=_s(q).toLowerCase()==="object",He=_s(q).toLowerCase()==="null",Nr=_s(q).toLowerCase()==="undefined";for(let qr=s.cachedOptions.size-1;qr>=0;qr--){const rr=re.value[qr];if(_e?Ir(rr.value,t.valueKey)===Ir(q,t.valueKey):rr.value===q){ce={value:q,currentLabel:rr.currentLabel,get isDisabled(){return rr.isDisabled}};break}}if(ce)return ce;const yn=_e?q.label:!He&&!Nr?q:"";return{value:q,currentLabel:yn}},Ne=()=>{s.hoveringIndex=X.value.findIndex(q=>s.selected.some(ce=>Ot(ce)===Ot(q)))},De=()=>{s.selectionWidth=c.value.getBoundingClientRect().width},Ee=()=>{s.calculatorWidth=p.value.getBoundingClientRect().width},Pe=()=>{s.collapseItemWidth=m.value.getBoundingClientRect().width},te=()=>{var q,ce;(ce=(q=u.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=Ku(()=>{R()},j.value),U=q=>{io(t.modelValue,q)||e(Xs,q)},ie=q=>L1(q,ce=>!s.disabledOptions.has(ce)),Z=q=>{if(t.multiple&&q.code!==it.delete&&q.target.value.length<=0){const ce=Gr(t.modelValue).slice(),_e=ie(ce);if(_e<0)return;const He=ce[_e];ce.splice(_e,1),e(mt,ce),U(ce),e("remove-tag",He)}},ae=(q,ce)=>{const _e=s.selected.indexOf(ce);if(_e>-1&&!O.value){const He=Gr(t.modelValue).slice();He.splice(_e,1),e(mt,He),U(He),e("remove-tag",ce.value)}q.stopPropagation(),rt()},we=q=>{q.stopPropagation();const ce=t.multiple?[]:_.value;if(t.multiple)for(const _e of s.selected)_e.isDisabled&&ce.push(_e.value);e(mt,ce),U(ce),s.hoveringIndex=-1,S.value=!1,e("clear"),rt()},Ce=q=>{var ce;if(t.multiple){const _e=Gr((ce=t.modelValue)!=null?ce:[]).slice(),He=ge(_e,q.value);He>-1?_e.splice(He,1):(t.multipleLimit<=0||_e.length<t.multipleLimit)&&_e.push(q.value),e(mt,_e),U(_e),q.created&&ue(""),t.filterable&&!t.reserveKeyword&&(s.inputValue="")}else e(mt,q.value),U(q.value),S.value=!1;rt(),!S.value&&o.nextTick(()=>{Se(q)})},ge=(q=[],ce)=>{if(!vt(ce))return q.indexOf(ce);const _e=t.valueKey;let He=-1;return q.some((Nr,yn)=>o.toRaw(Ir(Nr,_e))===Ir(ce,_e)?(He=yn,!0):!1),He},Se=q=>{var ce,_e,He,Nr,yn;const za=At(q)?q[0]:q;let qr=null;if(za!=null&&za.value){const rr=X.value.filter(bn=>bn.value===za.value);rr.length>0&&(qr=rr[0].$el)}if(u.value&&qr){const rr=(Nr=(He=(_e=(ce=u.value)==null?void 0:ce.popperRef)==null?void 0:_e.contentRef)==null?void 0:He.querySelector)==null?void 0:Nr.call(He,`.${a.be("dropdown","wrap")}`);rr&&K1(rr,qr)}(yn=b.value)==null||yn.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=u.value)==null?void 0:q.popperRef)==null?void 0:ce.contentRef}),$e=()=>{s.isBeforeHide=!1,o.nextTick(()=>Se(s.selected))},rt=()=>{var q;(q=f.value)==null||q.focus()},nt=()=>{var q;(q=f.value)==null||q.blur()},Qe=q=>{we(q)},_t=()=>{S.value=!1,B.value&&nt()},ut=()=>{s.inputValue.length>0?s.inputValue="":S.value=!1},ht=()=>{O.value||(Ds&&(s.inputHovering=!0),s.menuVisibleOnFocus?s.menuVisibleOnFocus=!1:S.value=!S.value)},Wt=()=>{S.value?X.value[s.hoveringIndex]&&Ce(X.value[s.hoveringIndex]):ht()},Ot=q=>vt(q.value)?Ir(q.value,t.valueKey):q.value,It=o.computed(()=>X.value.filter(q=>q.visible).every(q=>q.disabled)),tr=o.computed(()=>t.multiple?t.collapseTags?s.selected.slice(0,t.maxCollapseTags):s.selected:[]),hr=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(!c.value)return 0;const q=window.getComputedStyle(c.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`}}),pt=o.computed(()=>({maxWidth:`${s.selectionWidth}px`})),mn=o.computed(()=>({width:`${Math.max(s.calculatorWidth,Ox)}px`}));return Pr(c,De),Pr(p,Ee),Pr(g,te),Pr(k,te),Pr(y,T),Pr(m,Pe),o.onMounted(()=>{de()}),{inputId:I,contentId:n,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:ne,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:x,handleCompositionEnd:E,onOptionCreate:ve,onOptionDestroy:ye,handleMenuEnter:$e,focus:rt,blur:nt,handleClearClick:Qe,handleClickOutside:_t,handleEsc:ut,toggleMenu:ht,selectOption:Wt,getValueKey:Ot,navigateOptions:Kt,dropdownMenuVisible:oe,showTagList:tr,collapseTagList:hr,tagStyle:at,collapseTagStyle:pt,inputStyle:mn,popperRef:Ge,inputRef:f,tooltipRef:u,tagTooltipRef:d,calculatorRef:p,prefixRef:v,suffixRef:h,selectRef:l,wrapperRef:k,selectionRef:c,scrollbarRef:b,menuRef:g,tagMenuRef:y,collapseItemRef:m}};var Lx=o.defineComponent({name:"ElOptions",setup(t,{slots:e}){const r=o.inject(hi);let n=[];return()=>{var a,i;const s=(a=e.default)==null?void 0:a.call(e),l=[];function c(u){At(u)&&u.forEach(d=>{var f,p,v,h;const g=(f=(d==null?void 0:d.type)||{})==null?void 0:f.name;g==="ElOptionGroup"?c(!St(d.children)&&!At(d.children)&&Lt((p=d.children)==null?void 0:p.default)?(v=d.children)==null?void 0:v.default():d.children):g==="ElOption"?l.push((h=d.props)==null?void 0:h.value):At(d.children)&&c(d.children)})}return s.length&&c((i=s[0])==null?void 0:i.children),io(l,n)||(n=l,r&&(r.states.optionValues=l)),s}}});const Mx=Fe({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:sa,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:Zr,default:Ys},fitInputWidth:Boolean,suffixIcon:{type:Zr,default:so},tagType:{...Tl.type,default:"info"},tagEffect:{...Tl.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:ke(String),values:ho,default:"bottom-start"},fallbackPlacements:{type:ke(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...e2,...Qr(["ariaLabel"])}),Nf="ElSelect",Fx=o.defineComponent({name:Nf,componentName:Nf,components:{ElSelectMenu:_x,ElOption:_l,ElOptions:Lx,ElTag:Ek,ElScrollbar:D2,ElTooltip:li,ElIcon:yt},directives:{ClickOutside:cf},props:Mx,emits:[mt,Xs,"remove-tag","clear","visible-change","focus","blur"],setup(t,{emit:e}){const r=o.computed(()=>{const{modelValue:i,multiple:s}=t,l=s?[]:void 0;return At(i)?s?i:l:s?l:i}),n=o.reactive({...o.toRefs(t),modelValue:r}),a=Ix(n,e);return o.provide(hi,o.reactive({props:n,states:a.states,optionsArray:a.optionsArray,handleOptionSelect:a.handleOptionSelect,onOptionCreate:a.onOptionCreate,onOptionDestroy:a.onOptionDestroy,selectRef:a.selectRef,setSelected:a.setSelected})),{...a,modelValue:r}}});function Ax(t,e,r,n,a,i){const s=o.resolveComponent("el-tag"),l=o.resolveComponent("el-tooltip"),c=o.resolveComponent("el-icon"),u=o.resolveComponent("el-option"),d=o.resolveComponent("el-options"),f=o.resolveComponent("el-scrollbar"),p=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)]:h=>t.states.inputHovering=!0,onMouseleave:h=>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:h=>t.states.isBeforeHide=!1},{default:o.withCtx(()=>{var h;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":((h=t.hoverOption)==null?void 0:h.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(c,{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(c,{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(c,{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(p,{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(u,{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 Vx=Te(Fx,[["render",Ax],["__file","select.vue"]]);const Rx=o.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(t){const e=Be("select"),r=o.ref(null),n=o.getCurrentInstance(),a=o.ref([]);o.provide(Bf,o.reactive({...o.toRefs(t)}));const i=o.computed(()=>a.value.some(u=>u.visible===!0)),s=u=>{var d,f;return((d=u.type)==null?void 0:d.name)==="ElOption"&&!!((f=u.component)!=null&&f.proxy)},l=u=>{const d=Gr(u),f=[];return d.forEach(p=>{var v,h;s(p)?f.push(p.component.proxy):(v=p.children)!=null&&v.length?f.push(...l(p.children)):(h=p.component)!=null&&h.subTree&&f.push(...l(p.component.subTree))}),f},c=()=>{a.value=l(n.subTree)};return o.onMounted(()=>{c()}),Fg(r,c,{attributes:!0,subtree:!0,childList:!0}),{groupRef:r,visible:i,ns:e}}});function $x(t,e,r,n,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 Df=Te(Rx,[["render",$x],["__file","option-group.vue"]]);const zx=dt(Vx,{Option:_l,OptionGroup:Df}),Hx=Mr(_l);Mr(Df);const Kx=Fe({trigger:si.trigger,placement:Pl.placement,disabled:si.disabled,visible:$t.visible,transition:$t.transition,popperOptions:Pl.popperOptions,tabindex:Pl.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}}),qx={"update:visible":t=>Qn(t),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},Ux="onUpdate:visible",Gx=o.defineComponent({name:"ElPopover"}),Wx=o.defineComponent({...Gx,props:Kx,emits:qx,setup(t,{expose:e,emit:r}){const n=t,a=o.computed(()=>n[Ux]),i=Be("popover"),s=o.ref(),l=o.computed(()=>{var y;return(y=o.unref(s))==null?void 0:y.popperRef}),c=o.computed(()=>[{width:Jn(n.width)},n.popperStyle]),u=o.computed(()=>[i.b(),n.popperClass,{[i.m("plain")]:!!n.content}]),d=o.computed(()=>n.transition===`${i.namespace.value}-fade-in-linear`),f=()=>{var y;(y=s.value)==null||y.hide()},p=()=>{r("before-enter")},v=()=>{r("before-leave")},h=()=>{r("after-enter")},g=()=>{r("update:visible",!1),r("after-leave")};return e({popperRef:l,hide:f}),(y,m)=>(o.openBlock(),o.createBlock(o.unref(li),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(u),"popper-style":o.unref(c),teleported:y.teleported,persistent:y.persistent,"gpu-acceleration":o.unref(d),"onUpdate:visible":o.unref(a),onBeforeShow:p,onBeforeHide:v,onShow:h,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 jx=Te(Wx,[["__file","popover.vue"]]);const Pf=(t,e)=>{const r=e.arg||e.value,n=r==null?void 0:r.popperRef;n&&(n.triggerRef=t)};var Yx={mounted(t,e){Pf(t,e)},updated(t,e){Pf(t,e)}};const Zx=Eb(Yx,"popover"),Ol=dt(jx,{directive:Zx}),fa="$treeNodeId",_f=function(t,e){!e||e[fa]||Object.defineProperty(e,fa,{value:t.id,enumerable:!1,configurable:!1,writable:!1})},Il=function(t,e){return t?e[t]:e[fa]},Ll=(t,e,r)=>{const n=t.value.currentNode;r();const a=t.value.currentNode;n!==a&&e("current-change",a?a.data:null,a)},Ml=t=>{let e=!0,r=!0,n=!0;for(let a=0,i=t.length;a<i;a++){const s=t[a];(s.checked!==!0||s.indeterminate)&&(e=!1,s.disabled||(n=!1)),(s.checked!==!1||s.indeterminate)&&(r=!1)}return{all:e,none:r,allWithoutDisable:n,half:!e&&!r}},pi=function(t){if(t.childNodes.length===0||t.loading)return;const{all:e,none:r,half:n}=Ml(t.childNodes);e?(t.checked=!0,t.indeterminate=!1):n?(t.checked=!1,t.indeterminate=!0):r&&(t.checked=!1,t.indeterminate=!1);const a=t.parent;!a||a.level===0||t.store.checkStrictly||pi(a)},No=function(t,e){const r=t.store.props,n=t.data||{},a=r[e];if(typeof a=="function")return a(n,t);if(typeof a=="string")return n[a];if(typeof a>"u"){const i=n[e];return i===void 0?"":i}};let Xx=0;class On{constructor(e){this.id=Xx++,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 r in e)wn(e,r)&&(this[r]=e[r]);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 r=e.props;if(r&&typeof r.isLeaf<"u"){const i=No(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)||_f(this,this.data),!this.data)return;const n=e.defaultExpandedKeys,a=e.key;a&&n&&n.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)||_f(this,e),this.data=e,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=No(this,"children")||[];for(let n=0,a=r.length;n<a;n++)this.insertChild({data:r[n]})}get label(){return No(this,"label")}get key(){const e=this.store.key;return this.data?this.data[e]:null}get disabled(){return No(this,"disabled")}get nextSibling(){const e=this.parent;if(e){const r=e.childNodes.indexOf(this);if(r>-1)return e.childNodes[r+1]}return null}get previousSibling(){const e=this.parent;if(e){const r=e.childNodes.indexOf(this);if(r>-1)return r>0?e.childNodes[r-1]:null}return null}contains(e,r=!0){return(this.childNodes||[]).some(n=>n===e||r&&n.contains(e))}remove(){const e=this.parent;e&&e.removeChild(this)}insertChild(e,r,n){if(!e)throw new Error("InsertChild error: child is required.");if(!(e instanceof On)){if(!n){const a=this.getChildren(!0);a.includes(e.data)||(typeof r>"u"||r<0?a.push(e.data):a.splice(r,0,e.data))}Object.assign(e,{parent:this,store:this.store}),e=o.reactive(new On(e)),e instanceof On&&e.initialize()}e.level=this.level+1,typeof r>"u"||r<0?this.childNodes.push(e):this.childNodes.splice(r,0,e),this.updateLeafState()}insertBefore(e,r){let n;r&&(n=this.childNodes.indexOf(r)),this.insertChild(e,n)}insertAfter(e,r){let n;r&&(n=this.childNodes.indexOf(r),n!==-1&&(n+=1)),this.insertChild(e,n)}removeChild(e){const r=this.getChildren()||[],n=r.indexOf(e.data);n>-1&&r.splice(n,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 r=null;for(let n=0;n<this.childNodes.length;n++)if(this.childNodes[n].data===e){r=this.childNodes[n];break}r&&this.removeChild(r)}expand(e,r){const n=()=>{if(r){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||pi(this),n())}):n()}doCreateChildren(e,r={}){e.forEach(n=>{this.insertChild(Object.assign({data:n},r),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,r,n,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}=Ml(this.childNodes);!this.isLeaf&&!s&&l&&(this.checked=!1,e=!1);const c=()=>{if(r){const u=this.childNodes;for(let p=0,v=u.length;p<v;p++){const h=u[p];a=a||e!==!1;const g=h.disabled?h.checked:a;h.setChecked(g,r,!0,a)}const{half:d,all:f}=Ml(u);f||(this.checked=f,this.indeterminate=d)}};if(this.shouldLoadData()){this.loadData(()=>{c(),pi(this)},{checked:e!==!1});return}else c()}const i=this.parent;!i||i.level===0||n||pi(i)}getChildren(e=!1){if(this.level===0)return this.data;const r=this.data;if(!r)return null;const n=this.store.props;let a="children";return n&&(a=n.children||"children"),r[a]===void 0&&(r[a]=null),e&&!r[a]&&(r[a]=[]),r[a]}updateChildren(){const e=this.getChildren()||[],r=this.childNodes.map(i=>i.data),n={},a=[];e.forEach((i,s)=>{const l=i[fa];!!l&&r.findIndex(u=>u[fa]===l)>=0?n[l]={index:s,data:i}:a.push({index:s,data:i})}),this.store.lazy||r.forEach(i=>{n[i[fa]]||this.removeChildByData(i)}),a.forEach(({index:i,data:s})=>{this.insertChild({data:s},i)}),this.updateLeafState()}loadData(e,r={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(r).length)){this.loading=!0;const n=i=>{this.childNodes=[],this.doCreateChildren(i,r),this.loaded=!0,this.loading=!1,this.updateLeafState(),e&&e.call(this,i)},a=()=>{this.loading=!1};this.store.load(this,n,a)}else e&&e.call(this)}eachNode(e){const r=[this];for(;r.length;){const n=r.shift();r.unshift(...n.childNodes),e(n)}}reInitChecked(){this.store.checkStrictly||pi(this)}}class Qx{constructor(e){this.currentNode=null,this.currentNodeKey=null;for(const r in e)wn(e,r)&&(this[r]=e[r]);this.nodesMap={}}initialize(){if(this.root=new On({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const e=this.load;e(this.root,r=>{this.root.doCreateChildren(r),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(e){const r=this.filterNodeMethod,n=this.lazy,a=function(i){const s=i.root?i.root.childNodes:i.childNodes;if(s.forEach(l=>{l.visible=r.call(l,e,l.data,l),a(l)}),!i.visible&&s.length){let l=!0;l=!s.some(c=>c.visible),i.root?i.root.visible=l===!1:i.visible=l===!1}e&&i.visible&&!i.isLeaf&&(!n||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 On)return e;const r=vt(e)?Il(this.key,e):e;return this.nodesMap[r]||null}insertBefore(e,r){const n=this.getNode(r);n.parent.insertBefore({data:e},n)}insertAfter(e,r){const n=this.getNode(r);n.parent.insertAfter({data:e},n)}remove(e){const r=this.getNode(e);r&&r.parent&&(r===this.currentNode&&(this.currentNode=null),r.parent.removeChild(r))}append(e,r){const n=oo(r)?this.root:this.getNode(r);n&&n.insertChild({data:e})}_initDefaultCheckedNodes(){const e=this.defaultCheckedKeys||[],r=this.nodesMap;e.forEach(n=>{const a=r[n];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 r=this.key;!e||!e.data||(r?e.key!==void 0&&(this.nodesMap[e.key]=e):this.nodesMap[e.id]=e)}deregisterNode(e){!this.key||!e||!e.data||(e.childNodes.forEach(n=>{this.deregisterNode(n)}),delete this.nodesMap[e.key])}getCheckedNodes(e=!1,r=!1){const n=[],a=function(i){(i.root?i.root.childNodes:i.childNodes).forEach(l=>{(l.checked||r&&l.indeterminate)&&(!e||e&&l.isLeaf)&&n.push(l.data),a(l)})};return a(this),n}getCheckedKeys(e=!1){return this.getCheckedNodes(e).map(r=>(r||{})[this.key])}getHalfCheckedNodes(){const e=[],r=function(n){(n.root?n.root.childNodes:n.childNodes).forEach(i=>{i.indeterminate&&e.push(i.data),r(i)})};return r(this),e}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(e=>(e||{})[this.key])}_getAllNodes(){const e=[],r=this.nodesMap;for(const n in r)wn(r,n)&&e.push(r[n]);return e}updateChildren(e,r){const n=this.nodesMap[e];if(!n)return;const a=n.childNodes;for(let i=a.length-1;i>=0;i--){const s=a[i];this.remove(s.data)}for(let i=0,s=r.length;i<s;i++){const l=r[i];this.append(l,n.data)}}_setCheckedKeys(e,r=!1,n){const a=this._getAllNodes().sort((c,u)=>c.level-u.level),i=Object.create(null),s=Object.keys(n);a.forEach(c=>c.setChecked(!1,!1));const l=c=>{c.childNodes.forEach(u=>{var d;i[u.data[e]]=!0,(d=u.childNodes)!=null&&d.length&&l(u)})};for(let c=0,u=a.length;c<u;c++){const d=a[c],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),r){d.setChecked(!1,!1);const v=function(h){h.childNodes.forEach(y=>{y.isLeaf||y.setChecked(!1,!1),v(y)})};v(d)}}}setCheckedNodes(e,r=!1){const n=this.key,a={};e.forEach(i=>{a[(i||{})[n]]=!0}),this._setCheckedKeys(n,r,a)}setCheckedKeys(e,r=!1){this.defaultCheckedKeys=e;const n=this.key,a={};e.forEach(i=>{a[i]=!0}),this._setCheckedKeys(n,r,a)}setDefaultExpandedKeys(e){e=e||[],this.defaultExpandedKeys=e,e.forEach(r=>{const n=this.getNode(r);n&&n.expand(null,this.autoExpandParent)})}setChecked(e,r,n){const a=this.getNode(e);a&&a.setChecked(!!r,n)}getCurrentNode(){return this.currentNode}setCurrentNode(e){const r=this.currentNode;r&&(r.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0}setUserCurrentNode(e,r=!0){const n=e[this.key],a=this.nodesMap[n];this.setCurrentNode(a),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(e,r=!0){if(e==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const n=this.getNode(e);n&&(this.setCurrentNode(n),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const Jx=o.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(t){const e=Be("tree"),r=o.inject("NodeInstance"),n=o.inject("RootTree");return()=>{const a=t.node,{data:i,store:s}=a;return t.renderContent?t.renderContent(o.h,{_self:r,node:a,data:i,store:s}):o.renderSlot(n.ctx.slots,"default",{node:a,data:i},()=>[o.h("span",{class:e.be("node","label")},[a.label])])}}});var eE=Te(Jx,[["__file","tree-node-content.vue"]]);function Of(t){const e=o.inject("TreeNodeMap",null),r={treeNodeExpand:n=>{t.node!==n&&t.node.collapse()},children:[]};return e&&e.children.push(r),o.provide("TreeNodeMap",r),{broadcastExpanded:n=>{if(t.accordion)for(const a of r.children)a.treeNodeExpand(n)}}}const If=Symbol("dragEvents");function tE({props:t,ctx:e,el$:r,dropIndicator$:n,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)},c=({event:d,treeNode:f})=>{const p=f,v=s.value.dropNode;v&&v.node.id!==p.node.id&&Sn(v.$el,i.is("drop-inner"));const h=s.value.draggingNode;if(!h||!p)return;let g=!0,y=!0,m=!0,b=!0;typeof t.allowDrop=="function"&&(g=t.allowDrop(h.node,p.node,"prev"),b=y=t.allowDrop(h.node,p.node,"inner"),m=t.allowDrop(h.node,p.node,"next")),d.dataTransfer.dropEffect=y||g||m?"move":"none",(g||y||m)&&(v==null?void 0:v.node.id)!==p.node.id&&(v&&e.emit("node-drag-leave",h.node,v.node,d),e.emit("node-drag-enter",h.node,p.node,d)),g||y||m?s.value.dropNode=p:s.value.dropNode=null,p.node.nextSibling===h.node&&(m=!1),p.node.previousSibling===h.node&&(g=!1),p.node.contains(h.node,!1)&&(y=!1),(h.node===p.node||h.node.contains(p.node))&&(g=!1,y=!1,m=!1);const w=p.$el.querySelector(`.${i.be("node","content")}`).getBoundingClientRect(),C=r.value.getBoundingClientRect();let x;const E=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*E?x="before":S>w.height*k?x="after":y?x="inner":x="none";const N=p.$el.querySelector(`.${i.be("node","expand-icon")}`).getBoundingClientRect(),D=n.value;x==="before"?B=N.top-C.top:x==="after"&&(B=N.bottom-C.top),D.style.top=`${B}px`,D.style.left=`${N.right-C.left}px`,x==="inner"?js(p.$el,i.is("drop-inner")):Sn(p.$el,i.is("drop-inner")),s.value.showDropIndicator=x==="before"||x==="after",s.value.allowDrop=s.value.showDropIndicator||b,s.value.dropType=x,e.emit("node-drag-over",h.node,p.node,d)},u=d=>{const{draggingNode:f,dropType:p,dropNode:v}=s.value;if(d.preventDefault(),d.dataTransfer&&(d.dataTransfer.dropEffect="move"),f&&v){const h={data:f.node.data};p!=="none"&&f.node.remove(),p==="before"?v.node.parent.insertBefore(h,v.node):p==="after"?v.node.parent.insertAfter(h,v.node):p==="inner"&&v.node.insertChild(h),p!=="none"&&(a.value.registerNode(h),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)})),Sn(v.$el,i.is("drop-inner")),e.emit("node-drag-end",f.node,v.node,p,d),p!=="none"&&e.emit("node-drop",f.node,v.node,p,d)}f&&!v&&e.emit("node-drag-end",f.node,null,p,d),s.value.showDropIndicator=!1,s.value.draggingNode=null,s.value.dropNode=null,s.value.allowDrop=!0};return o.provide(If,{treeNodeDragStart:l,treeNodeDragOver:c,treeNodeDragEnd:u}),{dragState:s}}const rE=o.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:Fk,ElCheckbox:bk,NodeContent:eE,ElIcon:yt,Loading:Zs},props:{node:{type:On,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(t,e){const r=Be("tree"),{broadcastExpanded:n}=Of(t),a=o.inject("RootTree"),i=o.ref(!1),s=o.ref(!1),l=o.ref(null),c=o.ref(null),u=o.ref(null),d=o.inject(If),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 p=a.props.props.children||"children";o.watch(()=>{const S=t.node.data[p];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=>Il(a.props.nodeKey,S.data),h=S=>{const N=t.props.class;if(!N)return{};let D;if(Lt(N)){const{data:P}=S;D=N(P,S)}else D=N;return St(D)?{[D]:!0}:D},g=(S,N)=>{(l.value!==S||c.value!==N)&&a.ctx.emit("check-change",t.node.data,S,N),l.value=S,c.value=N},y=S=>{Ll(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:r,node$:u,tree:a,expanded:i,childNodeRendered:s,oldChecked:l,oldIndeterminate:c,getNodeKey:v,getNodeClass:h,handleSelectChange:g,handleClick:y,handleContextMenu:m,handleExpandIconClick:b,handleCheckChange:w,handleChildNodeExpand:(S,N,D)=>{n(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:u.value,node:t.node}})},handleDrop:S=>{S.preventDefault()},handleDragEnd:S=>{a.props.draggable&&d.treeNodeDragEnd(S)},CaretRight:Y1}}});function nE(t,e,r,n,a,i){const s=o.resolveComponent("el-icon"),l=o.resolveComponent("el-checkbox"),c=o.resolveComponent("loading"),u=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(c)]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),o.createVNode(u,{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,p=>(o.openBlock(),o.createBlock(d,{key:t.getNodeKey(p),"render-content":t.renderContent,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,node:p,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 aE=Te(rE,[["render",nE],["__file","tree-node.vue"]]);function iE({el$:t},e){const r=Be("tree"),n=o.shallowRef([]),a=o.shallowRef([]);o.onMounted(()=>{s()}),o.onUpdated(()=>{n.value=Array.from(t.value.querySelectorAll("[role=treeitem]")),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"))}),o.watch(a,l=>{l.forEach(c=>{c.setAttribute("tabindex","-1")})}),jt(t,"keydown",l=>{const c=l.target;if(!c.className.includes(r.b("node")))return;const u=l.code;n.value=Array.from(t.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const d=n.value.indexOf(c);let f;if([it.up,it.down].includes(u)){if(l.preventDefault(),u===it.up){f=d===-1?0:d!==0?d-1:n.value.length-1;const v=f;for(;!e.value.getNode(n.value[f].dataset.key).canFocus;){if(f--,f===v){f=-1;break}f<0&&(f=n.value.length-1)}}else{f=d===-1?0:d<n.value.length-1?d+1:0;const v=f;for(;!e.value.getNode(n.value[f].dataset.key).canFocus;){if(f++,f===v){f=-1;break}f>=n.value.length&&(f=0)}}f!==-1&&n.value[f].focus()}[it.left,it.right].includes(u)&&(l.preventDefault(),c.click());const p=c.querySelector('[type="checkbox"]');[it.enter,it.space].includes(u)&&p&&(l.preventDefault(),p.click())});const s=()=>{var l;n.value=Array.from(t.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"));const c=t.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);if(c.length){c[0].setAttribute("tabindex","0");return}(l=n.value[0])==null||l.setAttribute("tabindex","0")}}const oE=o.defineComponent({name:"ElTree",components:{ElTreeNode:aE},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:Zr}},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:r}=Ya(),n=Be("tree"),a=o.inject(hi,null),i=o.ref(new Qx({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),c=o.ref(null),u=o.ref(null),{broadcastExpanded:d}=Of(t),{dragState:f}=tE({props:t,ctx:e,el$:c,dropIndicator$:u,store:i});iE({el$:c},i);const p=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)},h=L=>Il(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)},x=(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)},k=()=>i.value.getHalfCheckedNodes(),B=()=>i.value.getHalfCheckedKeys(),S=(L,V=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");Ll(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");Ll(i,e.emit,()=>{d(),i.value.setCurrentNodeKey(L,V)})},D=L=>i.value.getNode(L),P=L=>{i.value.remove(L)},I=(L,V)=>{i.value.append(L,V)},_=(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(ni,void 0),{ns:n,store:i,root:s,currentNode:l,dragState:f,el$:c,dropIndicator$:u,isEmpty:p,filter:v,getNodeKey:h,getNodePath:g,getCheckedNodes:y,getCheckedKeys:m,getCurrentNode:b,getCurrentKey:w,setCheckedNodes:C,setCheckedKeys:x,setChecked:E,getHalfCheckedNodes:k,getHalfCheckedKeys:B,setCurrentNode:S,setCurrentKey:N,t:r,getNode:D,remove:P,append:I,insertBefore:_,insertAfter:F,handleNodeExpand:O,updateKeyChildren:M}}});function sE(t,e,r,n,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 lE=Te(oE,[["render",sE],["__file","tree.vue"]]);const cE=dt(lE);function uE(t){let e;const r=o.ref(!1),n=o.reactive({...t,originalPosition:"",originalOverflow:"",visible:!1});function a(p){n.text=p}function i(){const p=n.parent,v=f.ns;if(!p.vLoadingAddClassList){let h=p.getAttribute("loading-number");h=Number.parseInt(h)-1,h?p.setAttribute("loading-number",h.toString()):(Sn(p,v.bm("parent","relative")),p.removeAttribute("loading-number")),Sn(p,v.bm("parent","hidden"))}s(),d.unmount()}function s(){var p,v;(v=(p=f.$el)==null?void 0:p.parentNode)==null||v.removeChild(f.$el)}function l(){var p;t.beforeClose&&!t.beforeClose()||(r.value=!0,clearTimeout(e),e=setTimeout(c,400),n.visible=!1,(p=t.closed)==null||p.call(t))}function c(){if(!r.value)return;const p=n.parent;r.value=!1,p.vLoadingAddClassList=void 0,i()}const u=o.defineComponent({name:"ElLoading",setup(p,{expose:v}){const{ns:h,zIndex:g}=n2("loading");return v({ns:h,zIndex:g}),()=>{const y=n.spinner||n.svg,m=o.h("svg",{class:"circular",viewBox:n.svgViewBox?n.svgViewBox:"0 0 50 50",...y?{innerHTML:y}:{}},[o.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),b=n.text?o.h("p",{class:h.b("text")},[n.text]):void 0;return o.h(o.Transition,{name:h.b("fade"),onAfterLeave:c},{default:o.withCtx(()=>[o.withDirectives(o.createVNode("div",{style:{backgroundColor:n.background||""},class:[h.b("mask"),n.customClass,n.fullscreen?"is-fullscreen":""]},[o.h("div",{class:h.b("spinner")},[m,b])]),[[o.vShow,n.visible]])])})}}}),d=o.createApp(u),f=d.mount(document.createElement("div"));return{...o.toRefs(n),setText:a,removeElLoadingChild:s,close:l,handleAfterLeave:c,vm:f,get $el(){return f.$el}}}let Do;const dE=function(t={}){if(!et)return;const e=fE(t);if(e.fullscreen&&Do)return Do;const r=uE({...e,closed:()=>{var a;(a=e.closed)==null||a.call(e),e.fullscreen&&(Do=void 0)}});hE(e,e.parent,r),Lf(e,e.parent,r),e.parent.vLoadingAddClassList=()=>Lf(e,e.parent,r);let n=e.parent.getAttribute("loading-number");return n?n=`${Number.parseInt(n)+1}`:n="1",e.parent.setAttribute("loading-number",n),e.parent.appendChild(r.$el),o.nextTick(()=>r.visible.value=e.visible),e.fullscreen&&(Do=r),r},fE=t=>{var e,r,n,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&&((r=t.fullscreen)!=null?r:!0),lock:(n=t.lock)!=null?n:!1,customClass:t.customClass||"",visible:(a=t.visible)!=null?a:!0,beforeClose:t.beforeClose,closed:t.closed,target:i}},hE=async(t,e,r)=>{const{nextZIndex:n}=r.vm.zIndex||r.vm._.exposed.zIndex,a={};if(t.fullscreen)r.originalPosition.value=ja(document.body,"position"),r.originalOverflow.value=ja(document.body,"overflow"),a.zIndex=n();else if(t.parent===document.body){r.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 r.originalPosition.value=ja(e,"position");for(const[i,s]of Object.entries(a))r.$el.style[i]=s},Lf=(t,e,r)=>{const n=r.vm.ns||r.vm._.exposed.ns;["absolute","fixed","sticky"].includes(r.originalPosition.value)?Sn(e,n.bm("parent","relative")):js(e,n.bm("parent","relative")),t.fullscreen&&t.lock?js(e,n.bm("parent","hidden")):Sn(e,n.bm("parent","hidden"))},Po=Symbol("ElLoading"),Mf=(t,e)=>{var r,n,a,i;const s=e.instance,l=p=>vt(e.value)?e.value[p]:void 0,c=p=>{const v=St(p)&&(s==null?void 0:s[p])||p;return v&&o.ref(v)},u=p=>c(l(p)||t.getAttribute(`element-loading-${jg(p)}`)),d=(r=l("fullscreen"))!=null?r:e.modifiers.fullscreen,f={text:u("text"),svg:u("svg"),svgViewBox:u("svgViewBox"),spinner:u("spinner"),background:u("background"),customClass:u("customClass"),fullscreen:d,target:(n=l("target"))!=null?n:d?void 0:t,body:(a=l("body"))!=null?a:e.modifiers.body,lock:(i=l("lock"))!=null?i:e.modifiers.lock};t[Po]={options:f,instance:dE(f)}},pE=(t,e)=>{for(const r of Object.keys(e))o.isRef(e[r])&&(e[r].value=t[r])},Fl={mounted(t,e){e.value&&Mf(t,e)},updated(t,e){const r=t[Po];e.oldValue!==e.value&&(e.value&&!e.oldValue?Mf(t,e):e.value&&e.oldValue?vt(e.value)&&pE(e.value,r.options):r==null||r.instance.close())},unmounted(t){var e;(e=t[Po])==null||e.instance.close(),t[Po]=null}},lr=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},vE={name:"AnnotationPopup",props:{annotationEntry:{type:Object}},inject:["$annotator","userApiKey"],data:function(){return{displayPair:{"Feature ID":"featureId",Tooltip:"label",Models:"models",Name:"name",Resource:"resourceId"},editing:!1,evidencePrefixes:["","DOI:","PMID:"],evidencePrefix:"",evidence:[],authenticated:!1,newEvidence:"",comment:"",prevSubs:[],showSubmissions:!0,errorMessage:"",creator:void 0}},computed:{isEditable:function(){return this.annotationEntry.resourceId&&this.annotationEntry.featureId},isPositionUpdated:function(){return this.annotationEntry.resourceId&&this.annotationEntry.type==="updated"&&this.annotationEntry.positionUpdated},isDeleted:function(){return this.annotationEntry.resourceId&&this.annotationEntry.type==="deleted"}},methods:{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.annotationEntry.resourceId&&this.annotationEntry.featureId&&((t=this.$annotator)==null||t.itemAnnotations(this.userApiKey,this.annotationEntry.resourceId,this.annotationEntry.featureId).then(e=>{this.prevSubs=e}).catch(e=>{console.log(e)}))},submit:function(){var t;if(this.annotationEntry.type==="updated"&&this.annotationEntry.positionUpdated?this.comment=this.comment?`Position Updated: ${this.comment}`:"Position Updated":this.annotationEntry.type==="deleted"&&(this.comment=this.comment?`Feature Deleted: ${this.comment}`:"Feature Deleted"),(this.evidence.length>0||this.comment)&&this.annotationEntry.resourceId&&this.annotationEntry.featureId){const e=[];this.evidence.forEach(n=>{if(n.includes("DOI:")){const a=n.replace("DOI:","https://doi.org/");e.push(new URL(a))}else if(n.includes("PMID:")){const a=n.replace("PMID:","https://pubmed.ncbi.nlm.nih.gov/");e.push(new URL(a))}else e.push(n)});const r={resource:this.annotationEntry.resourceId,item:Object.assign({id:this.annotationEntry.featureId},Object.fromEntries(Object.entries(this.annotationEntry).filter(([n])=>["label","models"].includes(n)))),body:{evidence:e,comment:this.comment},feature:this.annotationEntry.feature};Object.assign(r.body,this.annotationEntry.body),this.annotationEntry.type==="deleted"&&(r.feature=void 0),this.creator&&(r.creator=this.creator),(t=this.$annotator)==null||t.addAnnotation(this.userApiKey,r).then(()=>{this.$emit("annotation",r),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=""}},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=""})}},In=t=>(o.pushScopeId("data-v-9930ef40"),t=t(),o.popScopeId(),t),gE={class:"block"},mE=In(()=>o.createElementVNode("div",{class:"title"},"Feature Annotations",-1)),yE=In(()=>o.createElementVNode("strong",{class:"sub-title"},"Previous submissions:",-1)),bE=In(()=>o.createElementVNode("strong",null,"Evidence: ",-1)),wE=["href"],CE=In(()=>o.createElementVNode("strong",null,"Comment: ",-1)),kE=In(()=>o.createElementVNode("strong",{class:"sub-title"},"Suggest changes:",-1)),xE=In(()=>o.createElementVNode("strong",null,"Evidence:",-1)),EE=In(()=>o.createElementVNode("strong",null,"Comment:",-1)),SE={class:"sub-title"};function TE(t,e,r,n,a,i){const s=To,l=ju,c=yt,u=so,d=ib,f=nb,p=sb,v=ci,h=lo,g=Hx,y=zx,m=oi,b=sr,w=Dl;return o.openBlock(),o.createBlock(w,{class:"main"},{default:o.withCtx(()=>[o.createElementVNode("div",gE,[o.createVNode(s,{class:"info-field"},{default:o.withCtx(()=>[mE]),_:1}),r.annotationEntry?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.displayPair,(C,x)=>o.withDirectives((o.openBlock(),o.createBlock(s,{class:"dialog-text",key:C},{default:o.withCtx(()=>[o.createElementVNode("strong",null,o.toDisplayString(x)+": ",1),o.createTextVNode(" "+o.toDisplayString(r.annotationEntry[C]),1)]),_:2},1024)),[[o.vShow,r.annotationEntry[C]]])),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]=C=>t.showSubmissions=!1)},[o.createTextVNode(" Hide previous submissions "),o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(l)]),_:1})],512),[[o.vShow,t.showSubmissions]]),o.withDirectives(o.createElementVNode("div",{class:"hide",onClick:e[1]||(e[1]=C=>t.showSubmissions=!0)},[o.createTextVNode(" Show previous "+o.toDisplayString(t.prevSubs.length)+" submission(s) ",1),o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(u)]),_:1})],512),[[o.vShow,!t.showSubmissions]]),t.showSubmissions?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(s,{class:"dialog-spacer"}),o.createVNode(s,{class:"dialog-text"},{default:o.withCtx(()=>[yE]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.prevSubs,(C,x)=>(o.openBlock(),o.createElementBlock("div",{class:"entry",key:x},[o.createVNode(s,{class:"dialog-text"},{default:o.withCtx(()=>[o.createElementVNode("strong",null,o.toDisplayString(i.formatTime(C.created)),1),o.createTextVNode(" "+o.toDisplayString(C.creator.name),1)]),_:2},1024),o.createVNode(s,{class:"dialog-text"},{default:o.withCtx(()=>[bE,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(C.body.evidence,E=>(o.openBlock(),o.createBlock(s,{key:E,class:"dialog-text"},{default:o.withCtx(()=>[o.createElementVNode("a",{href:E,target:"_blank"},o.toDisplayString(E),9,wE)]),_:2},1024))),128))]),_:2},1024),o.createVNode(s,{class:"dialog-text"},{default:o.withCtx(()=>[CE,o.createTextVNode(" "+o.toDisplayString(C.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(s,{class:"dialog-spacer"}),t.editing?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createVNode(s,{class:"dialog-text"},{default:o.withCtx(()=>[kE]),_:1}),i.isDeleted?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(s,{class:"dialog-text"},{default:o.withCtx(()=>[xE]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.evidence,(C,x)=>(o.openBlock(),o.createBlock(s,{key:C},{default:o.withCtx(()=>[o.createVNode(v,{span:20},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.evidence[x]),1)]),_:2},1024),o.createVNode(v,{span:4},{default:o.withCtx(()=>[o.createVNode(c,{class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(h,{onClick:E=>i.removeEvidence(x)},null,8,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),o.createVNode(s,null,{default:o.withCtx(()=>[o.createVNode(m,{size:"small",placeholder:"Enter",modelValue:t.newEvidence,"onUpdate:modelValue":e[4]||(e[4]=C=>t.newEvidence=C),onChange:e[5]||(e[5]=C=>i.evidenceEntered(C))},{prepend:o.withCtx(()=>[o.createVNode(y,{teleported:!1,modelValue:t.evidencePrefix,"onUpdate:modelValue":e[3]||(e[3]=C=>t.evidencePrefix=C),placeholder:"No Prefix",class:"select-box","popper-class":"flatmap_dropdown"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.evidencePrefixes,C=>(o.openBlock(),o.createBlock(g,{key:C,label:C,value:C},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>[o.createVNode(v,{span:12},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(C),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1})],64)),o.createVNode(s,null,{default:o.withCtx(()=>[EE]),_:1}),o.createVNode(s,{class:"dialog-text"},{default:o.withCtx(()=>[o.createVNode(m,{type:"textarea",autosize:{minRows:2,maxRows:4},placeholder:"Enter",modelValue:t.comment,"onUpdate:modelValue":e[6]||(e[6]=C=>t.comment=C)},null,8,["modelValue"])]),_:1}),o.createVNode(s,{class:"dialog-text"},{default:o.withCtx(()=>[o.createVNode(b,{class:"button",type:"primary",plain:"",onClick:i.submit},{default:o.withCtx(()=>[o.createTextVNode(" Submit ")]),_:1},8,["onClick"])]),_:1})],64)):(o.openBlock(),o.createBlock(s,{key:0},{default:o.withCtx(()=>[o.createVNode(c,{class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(d,{onClick:e[2]||(e[2]=C=>t.editing=!0)})]),_:1}),i.isDeleted?(o.openBlock(),o.createBlock(c,{key:0,class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(f,{onClick:i.submit},null,8,["onClick"])]),_:1})):i.isPositionUpdated?(o.openBlock(),o.createBlock(c,{key:1,class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(p,{onClick:i.submit},null,8,["onClick"])]),_:1})):o.createCommentVNode("",!0)]),_:1})),t.errorMessage?(o.openBlock(),o.createBlock(s,{key:2,class:"dialog-text"},{default:o.withCtx(()=>[o.createElementVNode("strong",SE,o.toDisplayString(t.errorMessage),1)]),_:1})):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)])]),_:1})}const Ff=lr(vE,[["render",TE],["__scopeId","data-v-9930ef40"]]),BE={name:"CreateTooltipContent",components:{Button:sr,Col:ci,Container:Sf,Header:Tf,Input:oi,Main:Dl},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")}}},NE=(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 DE(t,e,r,n,a,i){const s=Tf,l=ci,c=To,u=oi,d=sr,f=Dl,p=Sf;return o.openBlock(),o.createBlock(p,{class:"create-container"},{default:o.withCtx(()=>[o.createVNode(s,{height:"30px",class:"header"},{default:o.withCtx(()=>[o.createElementVNode("div",null,"Create "+o.toDisplayString(r.createData.shape),1)]),_:1}),o.createVNode(f,{class:"slides-block"},{default:o.withCtx(()=>[NE,o.withDirectives(o.createVNode(c,{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(r.createData.points,({value:v,i:h})=>(o.openBlock(),o.createBlock(c,{key:h,class:"value"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h),1)]),_:2},1024))),128))]),_:1})]),_:1},512),[[o.vShow,t.showPoint]]),o.createVNode(c,{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(u,{modelValue:t.region,"onUpdate:modelValue":e[0]||(e[0]=v=>t.region=v),placeholder:"__annotation",size:"small"},null,8,["modelValue"])]),_:1})]),_:1}),o.createVNode(c,{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(u,{modelValue:t.group,"onUpdate:modelValue":e[1]||(e[1]=v=>t.group=v),placeholder:r.createData.shape,size:"small"},null,8,["modelValue","placeholder"])]),_:1})]),_:1}),o.createVNode(c,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 PE=lr(BE,[["render",DE],["__scopeId","data-v-d61c5879"]]);function ot(t){"@babel/helpers - typeof";return ot=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},ot(t)}function Al(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _E(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Vl(t,e,r){return e&&_E(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Af(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cr(t,e){return OE(t)||IE(t,e)||Vf(t,e)||LE()}function OE(t){if(Array.isArray(t))return t}function IE(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],a=!0,i=!1,s,l;try{for(r=r.call(t);!(a=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));a=!0);}catch(c){i=!0,l=c}finally{try{!a&&r.return!=null&&r.return()}finally{if(i)throw l}}return n}}function Vf(t,e){if(t){if(typeof t=="string")return Rf(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rf(t,e)}}function Rf(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function LE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
21
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $f(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Vf(t))||e){r&&(t=r);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
22
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,l;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return i=c.done,c},e:function(c){s=!0,l=c},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(s)throw l}}}}var st=typeof window>"u"?null:window,zf=st?st.navigator:null;st&&st.document;var ME=ot(""),Hf=ot({}),FE=ot(function(){}),AE=typeof HTMLElement>"u"?"undefined":ot(HTMLElement),vi=function(e){return e&&e.instanceString&&Ye(e.instanceString)?e.instanceString():null},be=function(e){return e!=null&&ot(e)==ME},Ye=function(e){return e!=null&&ot(e)===FE},Ke=function(e){return!Ut(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Oe=function(e){return e!=null&&ot(e)===Hf&&!Ke(e)&&e.constructor===Object},VE=function(e){return e!=null&&ot(e)===Hf},le=function(e){return e!=null&&ot(e)===ot(1)&&!isNaN(e)},RE=function(e){return le(e)&&Math.floor(e)===e},_o=function(e){if(AE!=="undefined")return e!=null&&e instanceof HTMLElement},Ut=function(e){return gi(e)||Kf(e)},gi=function(e){return vi(e)==="collection"&&e._private.single},Kf=function(e){return vi(e)==="collection"&&!e._private.single},Rl=function(e){return vi(e)==="core"},qf=function(e){return vi(e)==="stylesheet"},$E=function(e){return vi(e)==="event"},nn=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},zE=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},HE=function(e){return Oe(e)&&le(e.x1)&&le(e.x2)&&le(e.y1)&&le(e.y2)},KE=function(e){return VE(e)&&Ye(e.then)},qE=function(){return zf&&zf.userAgent.match(/msie|trident|edge/i)},mi=function(e,r){r||(r=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 n=function a(){var i=this,s=arguments,l,c=r.apply(i,s),u=a.cache;return(l=u[c])||(l=u[c]=e.apply(i,s)),l};return n.cache={},n},$l=mi(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Oo=mi(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Uf=mi(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),Gf=function(e){return nn(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},lt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",UE="rgb[a]?\\(("+lt+"[%]?)\\s*,\\s*("+lt+"[%]?)\\s*,\\s*("+lt+"[%]?)(?:\\s*,\\s*("+lt+"))?\\)",GE="rgb[a]?\\((?:"+lt+"[%]?)\\s*,\\s*(?:"+lt+"[%]?)\\s*,\\s*(?:"+lt+"[%]?)(?:\\s*,\\s*(?:"+lt+"))?\\)",WE="hsl[a]?\\(("+lt+")\\s*,\\s*("+lt+"[%])\\s*,\\s*("+lt+"[%])(?:\\s*,\\s*("+lt+"))?\\)",jE="hsl[a]?\\((?:"+lt+")\\s*,\\s*(?:"+lt+"[%])\\s*,\\s*(?:"+lt+"[%])(?:\\s*,\\s*(?:"+lt+"))?\\)",YE="\\#[0-9a-fA-F]{3}",ZE="\\#[0-9a-fA-F]{6}",Wf=function(e,r){return e<r?-1:e>r?1:0},XE=function(e,r){return-1*Wf(e,r)},xe=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var n=e[r];if(n!=null)for(var a=Object.keys(n),i=0;i<a.length;i++){var s=a[i];t[s]=n[s]}}return t},QE=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,n,a,i,s=16;return r?(n=parseInt(e[1]+e[1],s),a=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s)):(n=parseInt(e[1]+e[2],s),a=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s)),[n,a,i]}},JE=function(e){var r,n,a,i,s,l,c,u;function d(h,g,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?h+(g-h)*6*y:y<1/2?g:y<2/3?h+(g-h)*(2/3-y)*6:h}var f=new RegExp("^"+WE+"$").exec(e);if(f){if(n=parseInt(f[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=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=c=u=Math.round(i*255);else{var p=i<.5?i*(1+a):i+a-i*a,v=2*i-p;l=Math.round(255*d(v,p,n+1/3)),c=Math.round(255*d(v,p,n)),u=Math.round(255*d(v,p,n-1/3))}r=[l,c,u,s]}return r},eS=function(e){var r,n=new RegExp("^"+UE+"$").exec(e);if(n){r=[];for(var a=[],i=1;i<=3;i++){var s=n[i];if(s[s.length-1]==="%"&&(a[i]=!0),s=parseFloat(s),a[i]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var l=a[1]||a[2]||a[3],c=a[1]&&a[2]&&a[3];if(l&&!c)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},tS=function(e){return nS[e.toLowerCase()]},rS=function(e){return(Ke(e)?e:null)||tS(e)||QE(e)||eS(e)||JE(e)},nS={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]},jf=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var s=n[i];if(Oe(s))throw Error("Tried to set map with object key");i<n.length-1?(r[s]==null&&(r[s]={}),r=r[s]):r[s]=e.value}},Yf=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var s=n[i];if(Oe(s))throw Error("Tried to get map with object key");if(r=r[s],r==null)return r}return r};function aS(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ln=aS,yi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function iS(t,e){return e={exports:{}},t(e,e.exports),e.exports}var oS=typeof yi=="object"&&yi&&yi.Object===Object&&yi,sS=oS,lS=typeof self=="object"&&self&&self.Object===Object&&self,cS=sS||lS||Function("return this")(),Io=cS,uS=function(){return Io.Date.now()},zl=uS,dS=/\s/;function fS(t){for(var e=t.length;e--&&dS.test(t.charAt(e)););return e}var hS=fS,pS=/^\s+/;function vS(t){return t&&t.slice(0,hS(t)+1).replace(pS,"")}var gS=vS,mS=Io.Symbol,ha=mS,Zf=Object.prototype,yS=Zf.hasOwnProperty,bS=Zf.toString,bi=ha?ha.toStringTag:void 0;function wS(t){var e=yS.call(t,bi),r=t[bi];try{t[bi]=void 0;var n=!0}catch{}var a=bS.call(t);return n&&(e?t[bi]=r:delete t[bi]),a}var CS=wS,kS=Object.prototype,xS=kS.toString;function ES(t){return xS.call(t)}var SS=ES,TS="[object Null]",BS="[object Undefined]",Xf=ha?ha.toStringTag:void 0;function NS(t){return t==null?t===void 0?BS:TS:Xf&&Xf in Object(t)?CS(t):SS(t)}var Qf=NS;function DS(t){return t!=null&&typeof t=="object"}var PS=DS,_S="[object Symbol]";function OS(t){return typeof t=="symbol"||PS(t)&&Qf(t)==_S}var wi=OS,Jf=NaN,IS=/^[-+]0x[0-9a-f]+$/i,LS=/^0b[01]+$/i,MS=/^0o[0-7]+$/i,FS=parseInt;function AS(t){if(typeof t=="number")return t;if(wi(t))return Jf;if(Ln(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ln(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=gS(t);var r=LS.test(t);return r||MS.test(t)?FS(t.slice(2),r?2:8):IS.test(t)?Jf:+t}var eh=AS,VS="Expected a function",RS=Math.max,$S=Math.min;function zS(t,e,r){var n,a,i,s,l,c,u=0,d=!1,f=!1,p=!0;if(typeof t!="function")throw new TypeError(VS);e=eh(e)||0,Ln(r)&&(d=!!r.leading,f="maxWait"in r,i=f?RS(eh(r.maxWait)||0,e):i,p="trailing"in r?!!r.trailing:p);function v(E){var k=n,B=a;return n=a=void 0,u=E,s=t.apply(B,k),s}function h(E){return u=E,l=setTimeout(m,e),d?v(E):s}function g(E){var k=E-c,B=E-u,S=e-k;return f?$S(S,i-B):S}function y(E){var k=E-c,B=E-u;return c===void 0||k>=e||k<0||f&&B>=i}function m(){var E=zl();if(y(E))return b(E);l=setTimeout(m,g(E))}function b(E){return l=void 0,p&&n?v(E):(n=a=void 0,s)}function w(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function C(){return l===void 0?s:b(zl())}function x(){var E=zl(),k=y(E);if(n=arguments,a=this,c=E,k){if(l===void 0)return h(c);if(f)return clearTimeout(l),l=setTimeout(m,e),v(c)}return l===void 0&&(l=setTimeout(m,e)),s}return x.cancel=w,x.flush=C,x}var Lo=zS,Hl=st?st.performance:null,th=Hl&&Hl.now?function(){return Hl.now()}:function(){return Date.now()},HS=function(){if(st){if(st.requestAnimationFrame)return function(t){st.requestAnimationFrame(t)};if(st.mozRequestAnimationFrame)return function(t){st.mozRequestAnimationFrame(t)};if(st.webkitRequestAnimationFrame)return function(t){st.webkitRequestAnimationFrame(t)};if(st.msRequestAnimationFrame)return function(t){st.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(th())},1e3/60)}}(),Mo=function(e){return HS(e)},Vr=th,pa=9261,rh=65599,Ci=5381,nh=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pa,n=r,a;a=e.next(),!a.done;)n=n*rh+a.value|0;return n},ki=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pa;return r*rh+e|0},xi=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ci;return(r<<5)+r+e|0},KS=function(e,r){return e*2097152+r},an=function(e){return e[0]*2097152+e[1]},Fo=function(e,r){return[ki(e[0],r[0]),xi(e[1],r[1])]},qS=function(e,r){var n={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?n.value=e[a++]:n.done=!0,n}};return nh(s,r)},Mn=function(e,r){var n={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}};return nh(s,r)},ah=function(){return US(arguments)},US=function(e){for(var r,n=0;n<e.length;n++){var a=e[n];n===0?r=Mn(a):r=Mn(a,r)}return r},ih=!0,GS=console.warn!=null,WS=console.trace!=null,Kl=Number.MAX_SAFE_INTEGER||9007199254740991,oh=function(){return!0},Ao=function(){return!1},sh=function(){return 0},ql=function(){},Ze=function(e){throw new Error(e)},lh=function(e){if(e!==void 0)ih=!!e;else return ih},Ae=function(e){lh()&&(GS?console.warn(e):(console.log(e),WS&&console.trace()))},jS=function(e){return xe({},e)},Cr=function(e){return e==null?e:Ke(e)?e.slice():Oe(e)?jS(e):e},YS=function(e){return e.slice()},ch=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},ZS={},uh=function(){return ZS},wt=function(e){var r=Object.keys(e);return function(n){for(var a={},i=0;i<r.length;i++){var s=r[i],l=n==null?void 0:n[s];a[s]=l===void 0?e[s]:l}return a}},on=function(e,r,n){for(var a=e.length-1;a>=0;a--)e[a]===r&&e.splice(a,1)},Ul=function(e){e.splice(0,e.length)},XS=function(e,r){for(var n=0;n<r.length;n++){var a=r[n];e.push(a)}},ur=function(e,r,n){return n&&(r=Uf(n,r)),e[r]},sn=function(e,r,n,a){n&&(r=Uf(n,r)),e[r]=a},QS=function(){function t(){Al(this,t),this._obj={}}return Vl(t,[{key:"set",value:function(r,n){return this._obj[r]=n,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}]),t}(),kr=typeof Map<"u"?Map:QS,JS="undefined",eT=function(){function t(e){if(Al(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var n=0;n<r.length;n++)this.add(r[n])}}return Vl(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var n=this._obj;n[r]!==1&&(n[r]=1,this.size++)}},{key:"delete",value:function(r){var n=this._obj;n[r]===1&&(n[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(n){return r.has(n)})}},{key:"forEach",value:function(r,n){return this.toArray().forEach(r,n)}}]),t}(),va=(typeof Set>"u"?"undefined":ot(Set))!==JS?Set:eT,Vo=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Rl(e)){Ze("An element must have a core reference and parameters set");return}var a=r.group;if(a==null&&(r.data&&r.data.source!=null&&r.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:r.data||{},position:r.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:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?a==="edges":!!r.pannable,active:!1,classes:new va,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.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),r.renderedPosition){var s=r.renderedPosition,l=e.pan(),c=e.zoom();i.position={x:(s.x-l.x)/c,y:(s.y-l.y)/c}}var u=[];Ke(r.classes)?u=r.classes:be(r.classes)&&(u=r.classes.split(/\s+/));for(var d=0,f=u.length;d<f;d++){var p=u[d];!p||p===""||i.classes.add(p)}this.createEmitter();var v=r.style||r.css;v&&(Ae("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(v)),(n===void 0||n)&&this.restore()},dh=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var s;Oe(n)&&!Ut(n)&&(s=n,n=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,c=n=be(n)?this.filter(n):n,u=[],d=[],f={},p={},v={},h=0,g,y=this.byGroup(),m=y.nodes,b=y.edges,w=0;w<c.length;w++){var C=c[w],x=C.id();C.isNode()&&(u.unshift(C),e.bfs&&(v[x]=!0,d.push(C)),p[x]=0)}for(var E=function(){var I=e.bfs?u.shift():u.pop(),_=I.id();if(e.dfs){if(v[_])return"continue";v[_]=!0,d.push(I)}var F=p[_],O=f[_],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,h++,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],u.push(ee),e.bfs&&(v[J]=!0,d.push(ee)),f[J]=j,p[J]=p[_]+1)}};u.length!==0;){var k=E();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)}}},Ei={breadthFirstSearch:dh({bfs:!0}),depthFirstSearch:dh({dfs:!0})};Ei.bfs=Ei.breadthFirstSearch,Ei.dfs=Ei.depthFirstSearch;var tT=iS(function(t,e){(function(){var r,n,a,i,s,l,c,u,d,f,p,v,h,g,y;a=Math.floor,f=Math.min,n=function(m,b){return m<b?-1:m>b?1:0},d=function(m,b,w,C,x){var E;if(w==null&&(w=0),x==null&&(x=n),w<0)throw new Error("lo must be non-negative");for(C==null&&(C=m.length);w<C;)E=a((w+C)/2),x(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=n),m.push(b),g(m,0,m.length-1,w)},s=function(m,b){var w,C;return b==null&&(b=n),w=m.pop(),m.length?(C=m[0],m[0]=w,y(m,0,b)):C=w,C},u=function(m,b,w){var C;return w==null&&(w=n),C=m[0],m[0]=b,y(m,0,w),C},c=function(m,b,w){var C;return w==null&&(w=n),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,x,E,k,B;for(b==null&&(b=n),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(),k=[],C=0,x=E.length;C<x;C++)w=E[C],k.push(y(m,w,b));return k},h=function(m,b,w){var C;if(w==null&&(w=n),C=m.indexOf(b),C!==-1)return g(m,0,C,w),y(m,C,w)},p=function(m,b,w){var C,x,E,k,B;if(w==null&&(w=n),x=m.slice(0,b),!x.length)return x;for(i(x,w),B=m.slice(b),E=0,k=B.length;E<k;E++)C=B[E],c(x,C,w);return x.sort(w).reverse()},v=function(m,b,w){var C,x,E,k,B,S,N,D,P;if(w==null&&(w=n),b*10<=m.length){if(E=m.slice(0,b).sort(w),!E.length)return E;for(x=E[E.length-1],N=m.slice(b),k=0,S=N.length;k<S;k++)C=N[k],w(C,x)<0&&(d(E,C,0,null,w),E.pop(),x=E[E.length-1]);return E}for(i(m,w),P=[],B=0,D=f(b,m.length);0<=D?B<D:B>D;0<=D?++B:--B)P.push(s(m,w));return P},g=function(m,b,w,C){var x,E,k;for(C==null&&(C=n),x=m[w];w>b;){if(k=w-1>>1,E=m[k],C(x,E)<0){m[w]=E,w=k;continue}break}return m[w]=x},y=function(m,b,w){var C,x,E,k,B;for(w==null&&(w=n),x=m.length,B=b,E=m[b],C=2*b+1;C<x;)k=C+1,k<x&&!(w(m[C],m[k])<0)&&(C=k),m[b]=m[C],b=C,C=2*b+1;return m[b]=E,g(m,B,b,w)},r=function(){m.push=l,m.pop=s,m.replace=u,m.pushpop=c,m.heapify=i,m.updateItem=h,m.nlargest=p,m.nsmallest=v;function m(b){this.cmp=b??n,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 u(this.nodes,b,this.cmp)},m.prototype.pushpop=function(b){return c(this.nodes,b,this.cmp)},m.prototype.heapify=function(){return i(this.nodes,this.cmp)},m.prototype.updateItem=function(b){return h(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 r})}).call(yi)}),Si=tT,rT=wt({root:null,weight:function(e){return 1},directed:!1}),nT={dijkstra:function(e){if(!Oe(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var n=rT(e),a=n.root,i=n.weight,s=n.directed,l=this,c=i,u=be(a)?this.filter(a)[0]:a[0],d={},f={},p={},v=this.byGroup(),h=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 Si(function(F,O){return y(F)-y(O)}),w=0;w<h.length;w++){var C=h[w];d[C.id()]=C.same(u)?0:1/0,b.push(C)}for(var x=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=c(z);(j<V||!H)&&(V=j,H=z)}return{edge:H,dist:V}};b.size()>0;){var E=b.pop(),k=y(E),B=E.id();if(p[B]=k,k!==1/0)for(var S=E.neighborhood().intersect(h),N=0;N<S.length;N++){var D=S[N],P=D.id(),I=x(E,D),_=k+I.dist;_<y(D)&&(m(D,_),f[P]={node:E,edge:I.edge})}}return{distanceTo:function(O){var M=be(O)?h.filter(O)[0]:O[0];return p[M.id()]},pathTo:function(O){var M=be(O)?h.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)}}}},aT={kruskal:function(e){e=e||function(w){return 1};for(var r=this.byGroup(),n=r.nodes,a=r.edges,i=n.length,s=new Array(i),l=n,c=function(C){for(var x=0;x<s.length;x++){var E=s[x];if(E.has(C))return x}},u=0;u<i;u++)s[u]=this.spawn(n[u]);for(var d=a.sort(function(w,C){return e(w)-e(C)}),f=0;f<d.length;f++){var p=d[f],v=p.source()[0],h=p.target()[0],g=c(v),y=c(h),m=s[g],b=s[y];g!==y&&(l.merge(p),m.merge(b),s.splice(y,1))}return l}},iT=wt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),oT={aStar:function(e){var r=this.cy(),n=iT(e),a=n.root,i=n.goal,s=n.heuristic,l=n.directed,c=n.weight;a=r.collection(a)[0],i=r.collection(i)[0];var u=a.id(),d=i.id(),f={},p={},v={},h=new Si(function(H,$){return p[H.id()]-p[$.id()]}),g=new va,y={},m={},b=function($,z){h.push($),g.add(z)},w,C,x=function(){w=h.pop(),C=w.id(),g.delete(C)},E=function($){return g.has($)};b(a,u),f[u]=0,p[u]=s(a);for(var k=0;h.size()>0;){if(x(),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 P=w._private.edges,I=0;I<P.length;I++){var _=P[I];if(this.hasElementWithId(_.id())&&!(l&&_.data("source")!==C)){var F=_.source(),O=_.target(),M=F.id()!==C?F:O,L=M.id();if(this.hasElementWithId(L)&&!v[L]){var V=f[C]+c(_);if(!E(L)){f[L]=V,p[L]=V+s(M),b(M,L),y[L]=w,m[L]=_;continue}V<f[L]&&(f[L]=V,p[L]=V+s(M),y[L]=w,m[L]=_)}}}}return{found:!1,distance:void 0,path:void 0,steps:k}}},sT=wt({weight:function(e){return 1},directed:!1}),lT={floydWarshall:function(e){for(var r=this.cy(),n=sT(e),a=n.weight,i=n.directed,s=a,l=this.byGroup(),c=l.nodes,u=l.edges,d=c.length,f=d*d,p=function(j){return c.indexOf(j)},v=function(j){return c[j]},h=new Array(f),g=0;g<f;g++){var y=g%d,m=(g-y)/d;m===y?h[g]=0:h[g]=1/0}for(var b=new Array(f),w=new Array(f),C=0;C<u.length;C++){var x=u[C],E=x.source()[0],k=x.target()[0];if(E!==k){var B=p(E),S=p(k),N=B*d+S,D=s(x);if(h[N]>D&&(h[N]=D,b[N]=S,w[N]=x),!i){var P=S*d+B;!i&&h[P]>D&&(h[P]=D,b[P]=B,w[P]=x)}}}for(var I=0;I<d;I++)for(var _=0;_<d;_++)for(var F=_*d+I,O=0;O<d;O++){var M=_*d+O,L=I*d+O;h[F]+h[L]<h[M]&&(h[M]=h[F]+h[L],b[M]=b[F])}var V=function(j){return(be(j)?r.filter(j):j)[0]},H=function(j){return p(V(j))},$={distance:function(j,ee){var J=H(j),X=H(ee);return h[J*d+X]},path:function(j,ee){var J=H(j),X=H(ee),re=v(J);if(J===X)return re.collection();if(b[J*d+X]==null)return r.collection();var Y=r.collection(),A=J,K;for(Y.merge(re);J!==X;)A=J,J=b[J*d+X],K=w[A*d+J],Y.merge(K),Y.merge(v(J));return Y}};return $}},cT=wt({weight:function(e){return 1},directed:!1,root:null}),uT={bellmanFord:function(e){var r=this,n=cT(e),a=n.weight,i=n.directed,s=n.root,l=a,c=this,u=this.cy(),d=this.byGroup(),f=d.edges,p=d.nodes,v=p.length,h=new kr,g=!1,y=[];s=u.collection(s)[0],f.unmergeBy(function(pe){return pe.isLoop()});for(var m=f.length,b=function(de){var me=h.get(de.id());return me||(me={},h.set(de.id(),me)),me},w=function(de){return(be(de)?u.$(de):de)[0]},C=function(de){return b(w(de)).dist},x=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 r.spawn();var Pe=b(Ee),te=Pe.edge,T=Pe.pred;if(De.unshift(Ee[0]),Ee.same(me)&&De.length>0)break;te!=null&&De.unshift(te),Ee=T}return c.spawn(De)},E=0;E<v;E++){var k=p[E],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,Pe){var te=De.dist+Pe;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 P=0;P<m;P++){var I=f[P],_=I.source(),F=I.target(),O=l(I),M=b(_),L=b(F);N(_,F,I,M,L,O),i||N(F,_,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||(Ae("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),e.findNegativeWeightCycles!==!1){var re=[];J+ee<X&&re.push(z),!i&&X+ee<J&&re.push(j);for(var Y=re.length,A=0;A<Y;A++){var K=re[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(),ne=0,se=2;se<W.length;se+=2)W[se].id()<he&&(he=W[se].id(),ne=se);W=W.slice(ne).concat(W.slice(0,ne)),W.push(W[0]);var ue=W.map(function(pe){return pe.id()}).join(",");V.indexOf(ue)===-1&&(y.push(c.spawn(W)),V.push(ue))}}else break}return{distanceTo:C,pathTo:x,hasNegativeWeightCycle:g,negativeWeightCycles:y}}},dT=Math.sqrt(2),fT=function(e,r,n){n.length===0&&Ze("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],i=a[1],s=a[2],l=r[i],c=r[s],u=n,d=u.length-1;d>=0;d--){var f=u[d],p=f[1],v=f[2];(r[p]===l&&r[v]===c||r[p]===c&&r[v]===l)&&u.splice(d,1)}for(var h=0;h<u.length;h++){var g=u[h];g[1]===c?(u[h]=g.slice(),u[h][1]=l):g[2]===c&&(u[h]=g.slice(),u[h][2]=l)}for(var y=0;y<r.length;y++)r[y]===c&&(r[y]=l);return u},Gl=function(e,r,n,a){for(;n>a;){var i=Math.floor(Math.random()*r.length);r=fT(i,e,r),n--}return r},hT={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,a=r.edges;a.unmergeBy(function(L){return L.isLoop()});var i=n.length,s=a.length,l=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),c=Math.floor(i/dT);if(i<2){Ze("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],d=0;d<s;d++){var f=a[d];u.push([d,n.indexOf(f.source()),n.indexOf(f.target())])}for(var p=1/0,v=[],h=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=Gl(g,u.slice(),i,c),x=C.slice();m(g,y);var E=Gl(g,C,c,2),k=Gl(y,x,c,2);E.length<=k.length&&E.length<p?(p=E.length,v=E,m(g,h)):k.length<=E.length&&k.length<p&&(p=k.length,v=k,m(y,h))}for(var B=this.spawn(v.map(function(L){return a[L[0]]})),S=this.spawn(),N=this.spawn(),D=h[0],P=0;P<h.length;P++){var I=h[P],_=n[P];I===D?S.merge(_):N.merge(_)}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}},pT=function(e){return{x:e.x,y:e.y}},Ro=function(e,r,n){return{x:e.x*r+n.x,y:e.y*r+n.y}},fh=function(e,r,n){return{x:(e.x-n.x)/r,y:(e.y-n.y)/r}},ga=function(e){return{x:e[0],y:e[1]}},vT=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=r;i<n;i++){var s=e[i];isFinite(s)&&(a=Math.min(s,a))}return a},gT=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=r;i<n;i++){var s=e[i];isFinite(s)&&(a=Math.max(s,a))}return a},mT=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,s=r;s<n;s++){var l=e[s];isFinite(l)&&(a+=l,i++)}return a/i},yT=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=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(r,n):(n<e.length&&e.splice(n,e.length-n),r>0&&e.splice(0,r));for(var l=0,c=e.length-1;c>=0;c--){var u=e[c];s?isFinite(u)||(e[c]=-1/0,l++):e.splice(c,1)}i&&e.sort(function(p,v){return p-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},bT=function(e){return Math.PI*e/180},$o=function(e,r){return Math.atan2(r,e)-Math.PI/2},Wl=Math.log2||function(t){return Math.log(t)/Math.log(2)},hh=function(e){return e>0?1:e<0?-1:0},Fn=function(e,r){return Math.sqrt(An(e,r))},An=function(e,r){var n=r.x-e.x,a=r.y-e.y;return n*n+a*a},wT=function(e){for(var r=e.length,n=0,a=0;a<r;a++)n+=e[a];for(var i=0;i<r;i++)e[i]=e[i]/n;return e},ft=function(e,r,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*r+a*a*n},ma=function(e,r,n,a){return{x:ft(e.x,r.x,n.x,a),y:ft(e.y,r.y,n.y,a)}},CT=function(e,r,n,a){var i={x:r.x-e.x,y:r.y-e.y},s=Fn(e,r),l={x:i.x/s,y:i.y/s};return n=n??0,a=a??n*s,{x:e.x+l.x*a,y:e.y+l.y*a}},Ti=function(e,r,n){return Math.max(e,Math.min(n,r))},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}}},kT=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},xT=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},ET=function(e,r,n){return{x1:e.x1+r,x2:e.x2+r,y1:e.y1+n,y2:e.y2+n,w:e.w,h:e.h}},ph=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},ST=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},zo=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Ho=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,a,i,s;if(r.length===1)n=a=i=s=r[0];else if(r.length===2)n=i=r[0],s=a=r[1];else if(r.length===4){var l=cr(r,4);n=l[0],a=l[1],i=l[2],s=l[3]}return e.x1-=s,e.x2+=a,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},vh=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},jl=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},ya=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},TT=function(e,r){return ya(e,r.x,r.y)},gh=function(e,r){return ya(e,r.x1,r.y1)&&ya(e,r.x2,r.y2)},mh=function(e,r,n,a,i,s,l){var c=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=c==="auto"?Rn(i,s):c,d=i/2,f=s/2;u=Math.min(u,d,f);var p=u!==d,v=u!==f,h;if(p){var g=n-d+u-l,y=a-f-l,m=n+d-u+l,b=y;if(h=ln(e,r,n,a,g,y,m,b,!1),h.length>0)return h}if(v){var w=n+d+l,C=a-f+u-l,x=w,E=a+f-u+l;if(h=ln(e,r,n,a,w,C,x,E,!1),h.length>0)return h}if(p){var k=n-d+u-l,B=a+f+l,S=n+d-u+l,N=B;if(h=ln(e,r,n,a,k,B,S,N,!1),h.length>0)return h}if(v){var D=n-d-l,P=a-f+u-l,I=D,_=a+f-u+l;if(h=ln(e,r,n,a,D,P,I,_,!1),h.length>0)return h}var F;{var O=n-d+u,M=a-f+u;if(F=Bi(e,r,n,a,O,M,u+l),F.length>0&&F[0]<=O&&F[1]<=M)return[F[0],F[1]]}{var L=n+d-u,V=a-f+u;if(F=Bi(e,r,n,a,L,V,u+l),F.length>0&&F[0]>=L&&F[1]<=V)return[F[0],F[1]]}{var H=n+d-u,$=a+f-u;if(F=Bi(e,r,n,a,H,$,u+l),F.length>0&&F[0]>=H&&F[1]>=$)return[F[0],F[1]]}{var z=n-d+u,j=a+f-u;if(F=Bi(e,r,n,a,z,j,u+l),F.length>0&&F[0]<=z&&F[1]>=j)return[F[0],F[1]]}return[]},BT=function(e,r,n,a,i,s,l){var c=l,u=Math.min(n,i),d=Math.max(n,i),f=Math.min(a,s),p=Math.max(a,s);return u-c<=e&&e<=d+c&&f-c<=r&&r<=p+c},NT=function(e,r,n,a,i,s,l,c,u){var d={x1:Math.min(n,l,i)-u,x2:Math.max(n,l,i)+u,y1:Math.min(a,c,s)-u,y2:Math.max(a,c,s)+u};return!(e<d.x1||e>d.x2||r<d.y1||r>d.y2)},DT=function(e,r,n,a){n-=a;var i=r*r-4*e*n;if(i<0)return[];var s=Math.sqrt(i),l=2*e,c=(-r+s)/l,u=(-r-s)/l;return[c,u]},PT=function(e,r,n,a,i){var s=1e-5;e===0&&(e=s),r/=e,n/=e,a/=e;var l,c,u,d,f,p,v,h;if(c=(3*n-r*r)/9,u=-(27*a)+r*(9*n-2*(r*r)),u/=54,l=c*c*c+u*u,i[1]=0,v=r/3,l>0){f=u+Math.sqrt(l),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),p=u-Math.sqrt(l),p=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),i[0]=-v+f+p,v+=(f+p)/2,i[4]=i[2]=-v,v=Math.sqrt(3)*(-p+f)/2,i[3]=v,i[5]=-v;return}if(i[5]=i[3]=0,l===0){h=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-v+2*h,i[4]=i[2]=-(h+v);return}c=-c,d=c*c*c,d=Math.acos(u/Math.sqrt(d)),h=2*Math.sqrt(c),i[0]=-v+h*Math.cos(d/3),i[2]=-v+h*Math.cos((d+2*Math.PI)/3),i[4]=-v+h*Math.cos((d+4*Math.PI)/3)},_T=function(e,r,n,a,i,s,l,c){var u=1*n*n-4*n*i+2*n*l+4*i*i-4*i*l+l*l+a*a-4*a*s+2*a*c+4*s*s-4*s*c+c*c,d=1*9*n*i-3*n*n-3*n*l-6*i*i+3*i*l+9*a*s-3*a*a-3*a*c-6*s*s+3*s*c,f=1*3*n*n-6*n*i+n*l-n*e+2*i*i+2*i*e-l*e+3*a*a-6*a*s+a*c-a*r+2*s*s+2*s*r-c*r,p=1*n*i-n*n+n*e-i*e+a*s-a*a+a*r-s*r,v=[];PT(u,d,f,p,v);for(var h=1e-7,g=[],y=0;y<6;y+=2)Math.abs(v[y+1])<h&&v[y]>=0&&v[y]<=1&&g.push(v[y]);g.push(1),g.push(0);for(var m=-1,b,w,C,x=0;x<g.length;x++)b=Math.pow(1-g[x],2)*n+2*(1-g[x])*g[x]*i+g[x]*g[x]*l,w=Math.pow(1-g[x],2)*a+2*(1-g[x])*g[x]*s+g[x]*g[x]*c,C=Math.pow(b-e,2)+Math.pow(w-r,2),m>=0?C<m&&(m=C):m=C;return m},OT=function(e,r,n,a,i,s){var l=[e-n,r-a],c=[i-n,s-a],u=c[0]*c[0]+c[1]*c[1],d=l[0]*l[0]+l[1]*l[1],f=l[0]*c[0]+l[1]*c[1],p=f*f/u;return f<0?d:p>u?(e-i)*(e-i)+(r-s)*(r-s):d-p},Ht=function(e,r,n){for(var a,i,s,l,c,u=0,d=0;d<n.length/2;d++)if(a=n[d*2],i=n[d*2+1],d+1<n.length/2?(s=n[(d+1)*2],l=n[(d+1)*2+1]):(s=n[(d+1-n.length/2)*2],l=n[(d+1-n.length/2)*2+1]),!(a==e&&s==e))if(a>=e&&e>=s||a<=e&&e<=s)c=(e-a)/(s-a)*(l-i)+i,c>r&&u++;else continue;return u%2!==0},Rr=function(e,r,n,a,i,s,l,c,u){var d=new Array(n.length),f;c[0]!=null?(f=Math.atan(c[1]/c[0]),c[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=c;for(var p=Math.cos(-f),v=Math.sin(-f),h=0;h<d.length/2;h++)d[h*2]=s/2*(n[h*2]*p-n[h*2+1]*v),d[h*2+1]=l/2*(n[h*2+1]*p+n[h*2]*v),d[h*2]+=a,d[h*2+1]+=i;var g;if(u>0){var y=qo(d,-u);g=Ko(y)}else g=d;return Ht(e,r,g)},IT=function(e,r,n,a,i,s,l,c){for(var u=new Array(n.length*2),d=0;d<c.length;d++){var f=c[d];u[d*4+0]=f.startX,u[d*4+1]=f.startY,u[d*4+2]=f.stopX,u[d*4+3]=f.stopY;var p=Math.pow(f.cx-e,2)+Math.pow(f.cy-r,2);if(p<=Math.pow(f.radius,2))return!0}return Ht(e,r,u)},Ko=function(e){for(var r=new Array(e.length/2),n,a,i,s,l,c,u,d,f=0;f<e.length/4;f++){n=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],c=e[(f+1)*4+1],u=e[(f+1)*4+2],d=e[(f+1)*4+3]):(l=e[0],c=e[1],u=e[2],d=e[3]);var p=ln(n,a,i,s,l,c,u,d,!0);r[f*2]=p[0],r[f*2+1]=p[1]}return r},qo=function(e,r){for(var n=new Array(e.length*2),a,i,s,l,c=0;c<e.length/2;c++){a=e[c*2],i=e[c*2+1],c<e.length/2-1?(s=e[(c+1)*2],l=e[(c+1)*2+1]):(s=e[0],l=e[1]);var u=l-i,d=-(s-a),f=Math.sqrt(u*u+d*d),p=u/f,v=d/f;n[c*4]=a+p*r,n[c*4+1]=i+v*r,n[c*4+2]=s+p*r,n[c*4+3]=l+v*r}return n},LT=function(e,r,n,a,i,s){var l=n-e,c=a-r;l/=i,c/=s;var u=Math.sqrt(l*l+c*c),d=u-1;if(d<0)return[];var f=d/u;return[(n-e)*f+e,(a-r)*f+r]},Vn=function(e,r,n,a,i,s,l){return e-=i,r-=s,e/=n/2+l,r/=a/2+l,e*e+r*r<=1},Bi=function(e,r,n,a,i,s,l){var c=[n-e,a-r],u=[e-i,r-s],d=c[0]*c[0]+c[1]*c[1],f=2*(u[0]*c[0]+u[1]*c[1]),p=u[0]*u[0]+u[1]*u[1]-l*l,v=f*f-4*d*p;if(v<0)return[];var h=(-f+Math.sqrt(v))/(2*d),g=(-f-Math.sqrt(v))/(2*d),y=Math.min(h,g),m=Math.max(h,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]*c[0]+e,C=b[0]*c[1]+r;if(b.length>1){if(b[0]==b[1])return[w,C];var x=b[1]*c[0]+e,E=b[1]*c[1]+r;return[w,C,x,E]}else return[w,C]},Yl=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},ln=function(e,r,n,a,i,s,l,c,u){var d=e-i,f=n-e,p=l-i,v=r-s,h=a-r,g=c-s,y=p*v-g*d,m=f*v-h*d,b=g*f-p*h;if(b!==0){var w=y/b,C=m/b,x=.001,E=0-x,k=1+x;return E<=w&&w<=k&&E<=C&&C<=k?[e+w*f,r+w*h]:u?[e+w*f,r+w*h]:[]}else return y===0||m===0?Yl(e,n,l)===l?[l,c]:Yl(e,n,i)===i?[i,s]:Yl(i,l,n)===n?[n,a]:[]:[]},Ni=function(e,r,n,a,i,s,l,c){var u=[],d,f=new Array(n.length),p=!0;s==null&&(p=!1);var v;if(p){for(var h=0;h<f.length/2;h++)f[h*2]=n[h*2]*s+a,f[h*2+1]=n[h*2+1]*l+i;if(c>0){var g=qo(f,-c);v=Ko(g)}else v=f}else v=n;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=ln(e,r,a,i,y,m,b,w),d.length!==0&&u.push(d[0],d[1]);return u},MT=function(e,r,n,a,i,s,l,c,u){var d=[],f,p=new Array(n.length*2);u.forEach(function(b,w){w===0?(p[p.length-2]=b.startX,p[p.length-1]=b.startY):(p[w*4-2]=b.startX,p[w*4-1]=b.startY),p[w*4]=b.stopX,p[w*4+1]=b.stopY,f=Bi(e,r,a,i,b.cx,b.cy,b.radius),f.length!==0&&d.push(f[0],f[1])});for(var v=0;v<p.length/4;v++)f=ln(e,r,a,i,p[v*4],p[v*4+1],p[v*4+2],p[v*4+3],!1),f.length!==0&&d.push(f[0],f[1]);if(d.length>2){for(var h=[d[0],d[1]],g=Math.pow(h[0]-e,2)+Math.pow(h[1]-r,2),y=1;y<d.length/2;y++){var m=Math.pow(d[y*2]-e,2)+Math.pow(d[y*2+1]-r,2);m<=g&&(h[0]=d[y*2],h[1]=d[y*2+1],g=m)}return h}return d},Uo=function(e,r,n){var a=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),s=(i-n)/i;return s<0&&(s=1e-5),[r[0]+s*a[0],r[1]+s*a[1]]},Mt=function(e,r){var n=Zl(e,r);return n=yh(n),n},yh=function(e){for(var r,n,a=e.length/2,i=1/0,s=1/0,l=-1/0,c=-1/0,u=0;u<a;u++)r=e[2*u],n=e[2*u+1],i=Math.min(i,r),l=Math.max(l,r),s=Math.min(s,n),c=Math.max(c,n);for(var d=2/(l-i),f=2/(c-s),p=0;p<a;p++)r=e[2*p]=e[2*p]*d,n=e[2*p+1]=e[2*p+1]*f,i=Math.min(i,r),l=Math.max(l,r),s=Math.min(s,n),c=Math.max(c,n);if(s<-1)for(var v=0;v<a;v++)n=e[2*v+1]=e[2*v+1]+(-1-s);return e},Zl=function(e,r){var n=1/e*2*Math.PI,a=e%2===0?Math.PI/2+n/2:Math.PI/2;a+=r;for(var i=new Array(e*2),s,l=0;l<e;l++)s=l*n+a,i[2*l]=Math.cos(s),i[2*l+1]=Math.sin(-s);return i},Rn=function(e,r){return Math.min(e/4,r/4,8)},bh=function(e,r){return Math.min(e/10,r/10,8)},Xl=function(){return 8},FT=function(e,r,n){return[e-2*r+n,2*(r-e),e]},Ql=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},AT=wt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),VT={pageRank:function(e){for(var r=AT(e),n=r.dampingFactor,a=r.precision,i=r.iterations,s=r.weight,l=this._private.cy,c=this.byGroup(),u=c.nodes,d=c.edges,f=u.length,p=f*f,v=d.length,h=new Array(p),g=new Array(f),y=(1-n)/f,m=0;m<f;m++){for(var b=0;b<f;b++){var w=m*f+b;h[w]=0}g[m]=0}for(var C=0;C<v;C++){var x=d[C],E=x.data("source"),k=x.data("target");if(E!==k){var B=u.indexOfId(E),S=u.indexOfId(k),N=s(x),D=S*f+B;h[D]+=N,g[B]+=N}}for(var P=1/f+y,I=0;I<f;I++)if(g[I]===0)for(var _=0;_<f;_++){var F=_*f+I;h[F]=P}else for(var O=0;O<f;O++){var M=O*f+I;h[M]=h[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]+=h[X]*L[J]}wT(V),H=L,L=V,V=H;for(var re=0,Y=0;Y<f;Y++){var A=H[Y]-L[Y];re+=A*A}if(re<a)break}var K={rank:function(oe){return oe=l.collection(oe)[0],L[u.indexOf(oe)]}};return K}},wh=wt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),ba={degreeCentralityNormalized:function(e){e=wh(e);var r=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var d={},f={},p=0,v=0,h=0;h<a;h++){var g=n[h],y=g.id();e.root=g;var m=this.degreeCentrality(e);p<m.indegree&&(p=m.indegree),v<m.outdegree&&(v=m.outdegree),d[y]=m.indegree,f[y]=m.outdegree}return{indegree:function(w){return p==0?0:(be(w)&&(w=r.filter(w)),d[w.id()]/p)},outdegree:function(w){return v===0?0:(be(w)&&(w=r.filter(w)),f[w.id()]/v)}}}else{for(var i={},s=0,l=0;l<a;l++){var c=n[l];e.root=c;var u=this.degreeCentrality(e);s<u.degree&&(s=u.degree),i[c.id()]=u.degree}return{degree:function(w){return s===0?0:(be(w)&&(w=r.filter(w)),i[w.id()]/s)}}}},degreeCentrality:function(e){e=wh(e);var r=this.cy(),n=this,a=e,i=a.root,s=a.weight,l=a.directed,c=a.alpha;if(i=r.collection(i)[0],l){for(var v=i.connectedEdges(),h=v.filter(function(E){return E.target().same(i)&&n.has(E)}),g=v.filter(function(E){return E.source().same(i)&&n.has(E)}),y=h.length,m=g.length,b=0,w=0,C=0;C<h.length;C++)b+=s(h[C]);for(var x=0;x<g.length;x++)w+=s(g[x]);return{indegree:Math.pow(y,1-c)*Math.pow(b,c),outdegree:Math.pow(m,1-c)*Math.pow(w,c)}}else{for(var u=i.connectedEdges().intersection(n),d=u.length,f=0,p=0;p<u.length;p++)f+=s(u[p]);return{degree:Math.pow(d,1-c)*Math.pow(f,c)}}}};ba.dc=ba.degreeCentrality,ba.dcn=ba.degreeCentralityNormalised=ba.degreeCentralityNormalized;var Ch=wt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),wa={closenessCentralityNormalized:function(e){for(var r=Ch(e),n=r.harmonic,a=r.weight,i=r.directed,s=this.cy(),l={},c=0,u=this.nodes(),d=this.floydWarshall({weight:a,directed:i}),f=0;f<u.length;f++){for(var p=0,v=u[f],h=0;h<u.length;h++)if(f!==h){var g=d.distance(v,u[h]);n?p+=1/g:p+=g}n||(p=1/p),c<p&&(c=p),l[v.id()]=p}return{closeness:function(m){return c==0?0:(be(m)?m=s.filter(m)[0].id():m=m.id(),l[m]/c)}}},closenessCentrality:function(e){var r=Ch(e),n=r.root,a=r.weight,i=r.directed,s=r.harmonic;n=this.filter(n)[0];for(var l=this.dijkstra({root:n,weight:a,directed:i}),c=0,u=this.nodes(),d=0;d<u.length;d++){var f=u[d];if(!f.same(n)){var p=l.distanceTo(f);s?c+=1/p:c+=p}}return s?c:1/c}};wa.cc=wa.closenessCentrality,wa.ccn=wa.closenessCentralityNormalised=wa.closenessCentralityNormalized;var RT=wt({weight:null,directed:!1}),Jl={betweennessCentrality:function(e){for(var r=RT(e),n=r.directed,a=r.weight,i=a!=null,s=this.cy(),l=this.nodes(),c={},u={},d=0,f={set:function(w,C){u[w]=C,C>d&&(d=C)},get:function(w){return u[w]}},p=0;p<l.length;p++){var v=l[p],h=v.id();n?c[h]=v.outgoers().nodes():c[h]=v.openNeighborhood().nodes(),f.set(h,0)}for(var g=function(w){for(var C=l[w].id(),x=[],E={},k={},B={},S=new Si(function(J,X){return B[J]-B[X]}),N=0;N<l.length;N++){var D=l[N].id();E[D]=[],k[D]=0,B[D]=1/0}for(k[C]=1,B[C]=0,S.push(C);!S.empty();){var P=S.pop();if(x.push(P),i)for(var I=0;I<c[P].length;I++){var _=c[P][I],F=s.getElementById(P),O=void 0;F.edgesTo(_).length>0?O=F.edgesTo(_)[0]:O=_.edgesTo(F)[0];var M=a(O);_=_.id(),B[_]>B[P]+M&&(B[_]=B[P]+M,S.nodes.indexOf(_)<0?S.push(_):S.updateItem(_),k[_]=0,E[_]=[]),B[_]==B[P]+M&&(k[_]=k[_]+k[P],E[_].push(P))}else for(var L=0;L<c[P].length;L++){var V=c[P][L].id();B[V]==1/0&&(S.push(V),B[V]=B[P]+1),B[V]==B[P]+1&&(k[V]=k[V]+k[P],E[V].push(P))}}for(var H={},$=0;$<l.length;$++)H[l[$].id()]=0;for(;x.length>0;){for(var z=x.pop(),j=0;j<E[z].length;j++){var ee=E[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}};Jl.bc=Jl.betweennessCentrality;var $T=wt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),zT=function(e){return $T(e)},HT=function(e,r){for(var n=0,a=0;a<r.length;a++)n+=r[a](e);return n},KT=function(e,r,n){for(var a=0;a<r;a++)e[a*r+a]=n},kh=function(e,r){for(var n,a=0;a<r;a++){n=0;for(var i=0;i<r;i++)n+=e[i*r+a];for(var s=0;s<r;s++)e[s*r+a]=e[s*r+a]/n}},qT=function(e,r,n){for(var a=new Array(n*n),i=0;i<n;i++){for(var s=0;s<n;s++)a[i*n+s]=0;for(var l=0;l<n;l++)for(var c=0;c<n;c++)a[i*n+c]+=e[i*n+l]*r[l*n+c]}return a},UT=function(e,r,n){for(var a=e.slice(0),i=1;i<n;i++)e=qT(e,a,r);return e},GT=function(e,r,n){for(var a=new Array(r*r),i=0;i<r*r;i++)a[i]=Math.pow(e[i],n);return kh(a,r),a},WT=function(e,r,n,a){for(var i=0;i<n;i++){var s=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),l=Math.round(r[i]*Math.pow(10,a))/Math.pow(10,a);if(s!==l)return!1}return!0},jT=function(e,r,n,a){for(var i=[],s=0;s<r;s++){for(var l=[],c=0;c<r;c++)Math.round(e[s*r+c]*1e3)/1e3>0&&l.push(n[c]);l.length!==0&&i.push(a.collection(l))}return i},YT=function(e,r){for(var n=0;n<e.length;n++)if(!r[n]||e[n].id()!==r[n].id())return!1;return!0},ZT=function(e){for(var r=0;r<e.length;r++)for(var n=0;n<e.length;n++)r!=n&&YT(e[r],e[n])&&e.splice(n,1);return e},xh=function(e){for(var r=this.nodes(),n=this.edges(),a=this.cy(),i=zT(e),s={},l=0;l<r.length;l++)s[r[l].id()]=l;for(var c=r.length,u=c*c,d=new Array(u),f,p=0;p<u;p++)d[p]=0;for(var v=0;v<n.length;v++){var h=n[v],g=s[h.source().id()],y=s[h.target().id()],m=HT(h,i.attributes);d[g*c+y]+=m,d[y*c+g]+=m}KT(d,c,i.multFactor),kh(d,c);for(var b=!0,w=0;b&&w<i.maxIterations;)b=!1,f=UT(d,c,i.expandFactor),d=GT(f,c,i.inflateFactor),WT(d,f,u,4)||(b=!0),w++;var C=jT(d,c,r,a);return C=ZT(C),C},XT={markovClustering:xh,mcl:xh},QT=function(e){return e},Eh=function(e,r){return Math.abs(r-e)},Sh=function(e,r,n){return e+Eh(r,n)},Th=function(e,r,n){return e+Math.pow(n-r,2)},JT=function(e){return Math.sqrt(e)},eB=function(e,r,n){return Math.max(e,Eh(r,n))},Di=function(e,r,n,a,i){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:QT,l=a,c,u,d=0;d<e;d++)c=r(d),u=n(d),l=i(l,c,u);return s(l)},Ca={euclidean:function(e,r,n){return e>=2?Di(e,r,n,0,Th,JT):Di(e,r,n,0,Sh)},squaredEuclidean:function(e,r,n){return Di(e,r,n,0,Th)},manhattan:function(e,r,n){return Di(e,r,n,0,Sh)},max:function(e,r,n){return Di(e,r,n,-1/0,eB)}};Ca["squared-euclidean"]=Ca.squaredEuclidean,Ca.squaredeuclidean=Ca.squaredEuclidean;function Go(t,e,r,n,a,i){var s;return Ye(t)?s=t:s=Ca[t]||Ca.euclidean,e===0&&Ye(t)?s(a,i):s(e,r,n,a,i)}var tB=wt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),ec=function(e){return tB(e)},Wo=function(e,r,n,a,i){var s=i!=="kMedoids",l=s?function(f){return n[f]}:function(f){return a[f](n)},c=function(p){return a[p](r)},u=n,d=r;return Go(e,a.length,l,c,u,d)},tc=function(e,r,n){for(var a=n.length,i=new Array(a),s=new Array(a),l=new Array(r),c=null,u=0;u<a;u++)i[u]=e.min(n[u]).value,s[u]=e.max(n[u]).value;for(var d=0;d<r;d++){c=[];for(var f=0;f<a;f++)c[f]=Math.random()*(s[f]-i[f])+i[f];l[d]=c}return l},Bh=function(e,r,n,a,i){for(var s=1/0,l=0,c=0;c<r.length;c++){var u=Wo(n,e,r[c],a,i);u<s&&(s=u,l=c)}return l},Nh=function(e,r,n){for(var a=[],i=null,s=0;s<r.length;s++)i=r[s],n[i.id()]===e&&a.push(i);return a},rB=function(e,r,n){return Math.abs(r-e)<=n},nB=function(e,r,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var s=Math.abs(e[a][i]-r[a][i]);if(s>n)return!1}return!0},aB=function(e,r,n){for(var a=0;a<n;a++)if(e===r[a])return!0;return!1},Dh=function(e,r){var n=new Array(r);if(e.length<50)for(var a=0;a<r;a++){for(var i=e[Math.floor(Math.random()*e.length)];aB(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var s=0;s<r;s++)n[s]=e[Math.floor(Math.random()*e.length)];return n},Ph=function(e,r,n){for(var a=0,i=0;i<r.length;i++)a+=Wo("manhattan",r[i],e,n,"kMedoids");return a},iB=function(e){var r=this.cy(),n=this.nodes(),a=null,i=ec(e),s=new Array(i.k),l={},c;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,c=tc(n,i.k,i.attributes)):ot(i.testCentroids)==="object"?c=i.testCentroids:c=tc(n,i.k,i.attributes):c=tc(n,i.k,i.attributes);for(var u=!0,d=0;u&&d<i.maxIterations;){for(var f=0;f<n.length;f++)a=n[f],l[a.id()]=Bh(a,c,i.distance,i.attributes,"kMeans");u=!1;for(var p=0;p<i.k;p++){var v=Nh(p,n,l);if(v.length!==0){for(var h=i.attributes.length,g=c[p],y=new Array(h),m=new Array(h),b=0;b<h;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,rB(y[b],g[b],i.sensitivityThreshold)||(u=!0)}c[p]=y,s[p]=r.collection(v)}}d++}return s},oB=function(e){var r=this.cy(),n=this.nodes(),a=null,i=ec(e),s=new Array(i.k),l,c={},u,d=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(ot(i.testCentroids)==="object"?l=i.testCentroids:l=Dh(n,i.k)):l=Dh(n,i.k);for(var f=!0,p=0;f&&p<i.maxIterations;){for(var v=0;v<n.length;v++)a=n[v],c[a.id()]=Bh(a,l,i.distance,i.attributes,"kMedoids");f=!1;for(var h=0;h<l.length;h++){var g=Nh(h,n,c);if(g.length!==0){d[h]=Ph(l[h],g,i.attributes);for(var y=0;y<g.length;y++)u=Ph(g[y],g,i.attributes),u<d[h]&&(d[h]=u,l[h]=g[y],f=!0);s[h]=r.collection(g)}}p++}return s},sB=function(e,r,n,a,i){for(var s,l,c=0;c<r.length;c++)for(var u=0;u<e.length;u++)a[c][u]=Math.pow(n[c][u],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 p=0;p<r.length;p++)s+=a[p][d]*i.attributes[f](r[p]),l+=a[p][d];e[d][f]=s/l}},lB=function(e,r,n,a,i){for(var s=0;s<e.length;s++)r[s]=e[s].slice();for(var l,c,u,d=2/(i.m-1),f=0;f<n.length;f++)for(var p=0;p<a.length;p++){l=0;for(var v=0;v<n.length;v++)c=Wo(i.distance,a[p],n[f],i.attributes,"cmeans"),u=Wo(i.distance,a[p],n[v],i.attributes,"cmeans"),l+=Math.pow(c/u,d);e[p][f]=1/l}},cB=function(e,r,n,a){for(var i=new Array(n.k),s=0;s<i.length;s++)i[s]=[];for(var l,c,u=0;u<r.length;u++){l=-1/0,c=-1;for(var d=0;d<r[0].length;d++)r[u][d]>l&&(l=r[u][d],c=d);i[c].push(e[u])}for(var f=0;f<i.length;f++)i[f]=a.collection(i[f]);return i},_h=function(e){var r=this.cy(),n=this.nodes(),a=ec(e),i,s,l,c,u;c=new Array(n.length);for(var d=0;d<n.length;d++)c[d]=new Array(a.k);l=new Array(n.length);for(var f=0;f<n.length;f++)l[f]=new Array(a.k);for(var p=0;p<n.length;p++){for(var v=0,h=0;h<a.k;h++)l[p][h]=Math.random(),v+=l[p][h];for(var g=0;g<a.k;g++)l[p][g]=l[p][g]/v}s=new Array(a.k);for(var y=0;y<a.k;y++)s[y]=new Array(a.attributes.length);u=new Array(n.length);for(var m=0;m<n.length;m++)u[m]=new Array(a.k);for(var b=!0,w=0;b&&w<a.maxIterations;)b=!1,sB(s,n,l,u,a),lB(l,c,s,n,a),nB(l,c,a.sensitivityThreshold)||(b=!0),w++;return i=cB(n,l,a,r),{clusters:i,degreeOfMembership:l}},uB={kMeans:iB,kMedoids:oB,fuzzyCMeans:_h,fcm:_h},dB=wt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),fB={single:"min",complete:"max"},hB=function(e){var r=dB(e),n=fB[r.linkage];return n!=null&&(r.linkage=n),r},Oh=function(e,r,n,a,i){for(var s=0,l=1/0,c,u=i.attributes,d=function(S,N){return Go(i.distance,u.length,function(D){return u[D](S)},function(D){return u[D](N)},S,N)},f=0;f<e.length;f++){var p=e[f].key,v=n[p][a[p]];v<l&&(s=p,l=v)}if(i.mode==="threshold"&&l>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var h=r[s],g=r[a[s]],y;i.mode==="dendrogram"?y={left:h,right:g,key:h.key}:y={value:h.value.concat(g.value),key:h.key},e[h.index]=y,e.splice(g.index,1),r[h.key]=y;for(var m=0;m<e.length;m++){var b=e[m];h.key===b.key?c=1/0:i.linkage==="min"?(c=n[h.key][b.key],n[h.key][b.key]>n[g.key][b.key]&&(c=n[g.key][b.key])):i.linkage==="max"?(c=n[h.key][b.key],n[h.key][b.key]<n[g.key][b.key]&&(c=n[g.key][b.key])):i.linkage==="mean"?c=(n[h.key][b.key]*h.size+n[g.key][b.key]*g.size)/(h.size+g.size):i.mode==="dendrogram"?c=d(b.value,h.value):c=d(b.value[0],h.value[0]),n[h.key][b.key]=n[b.key][h.key]=c}for(var w=0;w<e.length;w++){var C=e[w].key;if(a[C]===h.key||a[C]===g.key){for(var x=C,E=0;E<e.length;E++){var k=e[E].key;n[C][k]<n[C][x]&&(x=k)}a[C]=x}e[w].index=w}return h.key=g.key=h.index=g.index=null,!0},jo=function t(e,r,n){e&&(e.value?r.push(e.value):(e.left&&t(e.left,r),e.right&&t(e.right,r)))},pB=function t(e,r){if(!e)return"";if(e.left&&e.right){var n=t(e.left,r),a=t(e.right,r),i=r.add({group:"nodes",data:{id:n+","+a}});return r.add({group:"edges",data:{source:n,target:i.id()}}),r.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},vB=function t(e,r,n){if(!e)return[];var a=[],i=[],s=[];return r===0?(e.left&&jo(e.left,a),e.right&&jo(e.right,i),s=a.concat(i),[n.collection(s)]):r===1?e.value?[n.collection(e.value)]:(e.left&&jo(e.left,a),e.right&&jo(e.right,i),[n.collection(a),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(a=t(e.left,r-1,n)),e.right&&(i=t(e.right,r-1,n)),a.concat(i))},Ih=function(e){for(var r=this.cy(),n=this.nodes(),a=hB(e),i=a.attributes,s=function(w,C){return Go(a.distance,i.length,function(x){return i[x](w)},function(x){return i[x](C)},w,C)},l=[],c=[],u=[],d=[],f=0;f<n.length;f++){var p={value:a.mode==="dendrogram"?n[f]:[n[f]],key:f,index:f};l[f]=p,d[f]=p,c[f]=[],u[f]=0}for(var v=0;v<l.length;v++)for(var h=0;h<=v;h++){var g=void 0;a.mode==="dendrogram"?g=v===h?1/0:s(l[v].value,l[h].value):g=v===h?1/0:s(l[v].value[0],l[h].value[0]),c[v][h]=g,c[h][v]=g,g<c[v][u[v]]&&(u[v]=h)}for(var y=Oh(l,d,c,u,a);y;)y=Oh(l,d,c,u,a);var m;return a.mode==="dendrogram"?(m=vB(l[0],a.dendrogramDepth,r),a.addDendrogram&&pB(l[0],r)):(m=new Array(l.length),l.forEach(function(b,w){b.key=b.index=null,m[w]=r.collection(b.value)})),m},gB={hierarchicalClustering:Ih,hca:Ih},mB=wt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),yB=function(e){var r=e.damping,n=e.preference;.5<=r&&r<1||Ze("Damping must range on [0.5, 1). Got: ".concat(r));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||le(n)||Ze("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),mB(e)},bB=function(e,r,n,a){var i=function(l,c){return a[c](l)};return-Go(e,a.length,function(s){return i(r,s)},function(s){return i(n,s)},r,n)},wB=function(e,r){var n=null;return r==="median"?n=yT(e):r==="mean"?n=mT(e):r==="min"?n=vT(e):r==="max"?n=gT(e):n=r,n},CB=function(e,r,n){for(var a=[],i=0;i<e;i++)r[i*e+i]+n[i*e+i]>0&&a.push(i);return a},Lh=function(e,r,n){for(var a=[],i=0;i<e;i++){for(var s=-1,l=-1/0,c=0;c<n.length;c++){var u=n[c];r[i*e+u]>l&&(s=u,l=r[i*e+u])}s>0&&a.push(s)}for(var d=0;d<n.length;d++)a[n[d]]=n[d];return a},kB=function(e,r,n){for(var a=Lh(e,r,n),i=0;i<n.length;i++){for(var s=[],l=0;l<a.length;l++)a[l]===n[i]&&s.push(l);for(var c=-1,u=-1/0,d=0;d<s.length;d++){for(var f=0,p=0;p<s.length;p++)f+=r[s[p]*e+s[d]];f>u&&(c=d,u=f)}n[i]=s[c]}return a=Lh(e,r,n),a},Mh=function(e){for(var r=this.cy(),n=this.nodes(),a=yB(e),i={},s=0;s<n.length;s++)i[n[s].id()]=s;var l,c,u,d,f,p;l=n.length,c=l*l,u=new Array(c);for(var v=0;v<c;v++)u[v]=-1/0;for(var h=0;h<l;h++)for(var g=0;g<l;g++)h!==g&&(u[h*l+g]=bB(a.distance,n[h],n[g],a.attributes));d=wB(u,a.preference);for(var y=0;y<l;y++)u[y*l+y]=d;f=new Array(c);for(var m=0;m<c;m++)f[m]=0;p=new Array(c);for(var b=0;b<c;b++)p[b]=0;for(var w=new Array(l),C=new Array(l),x=new Array(l),E=0;E<l;E++)w[E]=0,C[E]=0,x[E]=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,P=-1/0,I=-1,_=0,F=0;F<l;F++)w[F]=f[N*l+F],_=p[N*l+F]+u[N*l+F],_>=D?(P=D,D=_,I=F):_>P&&(P=_);for(var O=0;O<l;O++)f[N*l+O]=(1-a.damping)*(u[N*l+O]-D)+a.damping*w[O];f[N*l+I]=(1-a.damping)*(u[N*l+I]-P)+a.damping*w[I]}for(var M=0;M<l;M++){for(var L=0,V=0;V<l;V++)w[V]=p[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++)p[H*l+M]=(1-a.damping)*Math.min(0,L-C[H])+a.damping*w[H];p[M*l+M]=(1-a.damping)*(L-C[M])+a.damping*w[M]}for(var $=0,z=0;z<l;z++){var j=p[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++){x[J]=0;for(var X=0;X<a.minIterations;X++)x[J]+=k[X*l+J];(x[J]===0||x[J]===a.minIterations)&&ee++}if(ee===l)break}}for(var re=CB(l,f,p),Y=kB(l,u,re),A={},K=0;K<re.length;K++)A[re[K]]=[];for(var W=0;W<n.length;W++){var oe=i[n[W].id()],he=Y[oe];he!=null&&A[he].push(n[W])}for(var ne=new Array(re.length),se=0;se<re.length;se++)ne[se]=r.collection(A[re[se]]);return ne},xB={affinityPropagation:Mh,ap:Mh},EB=wt({root:void 0,directed:!1}),SB={hierholzer:function(e){if(!Oe(e)){var r=arguments;e={root:r[0],directed:r[1]}}var n=EB(e),a=n.root,i=n.directed,s=this,l=!1,c,u,d;a&&(d=be(a)?this.filter(a)[0].id():a[0].id());var f={},p={};i?s.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.indegree(!0),x=b.outdegree(!0),E=C-x,k=x-C;E==1?c?l=!0:c=w:k==1?u?l=!0:u=w:(k>1||E>1)&&(l=!0),f[w]=[],b.outgoers().forEach(function(B){B.isEdge()&&f[w].push(B.id())})}else p[w]=[void 0,b.target().id()]}):s.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.degree(!0);C%2&&(c?u?l=!0:u=w:c=w),f[w]=[],b.connectedEdges().forEach(function(x){return f[w].push(x.id())})}else p[w]=[b.source().id(),b.target().id()]});var v={found:!1,trail:void 0};if(l)return v;if(u&&c)if(i){if(d&&u!=d)return v;d=u}else{if(d&&u!=d&&c!=d)return v;d||(d=u)}else d||(d=s[0].id());var h=function(w){for(var C=w,x=[w],E,k,B;f[C].length;)E=f[C].shift(),k=p[E][0],B=p[E][1],C!=B?(f[B]=f[B].filter(function(S){return S!=E}),C=B):!i&&C!=k&&(f[k]=f[k].filter(function(S){return S!=E}),C=k),x.unshift(E),x.unshift(C);return x},g=[],y=[];for(y=h(d);y.length!=1;)f[y[0]].length==0?(g.unshift(s.getElementById(y.shift())),g.unshift(s.getElementById(y.shift()))):y=h(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}},Yo=function(){var e=this,r={},n=0,a=0,i=[],s=[],l={},c=function(p,v){for(var h=s.length-1,g=[],y=e.spawn();s[h].x!=p||s[h].y!=v;)g.push(s.pop().edge),h--;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(),x=w.connectedEdges().intersection(e);y.merge(w),r[C].cutVertex?y.merge(x.filter(function(E){return E.isLoop()})):y.merge(x)})}),i.push(y)},u=function f(p,v,h){p===h&&(a+=1),r[v]={id:n,low:n++,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!==h&&(w=C.id(),l[w]||(l[w]=!0,s.push({x:v,y:b,edge:C})),b in r?r[v].low=Math.min(r[v].low,r[b].id):(f(p,b,v),r[v].low=Math.min(r[v].low,r[b].low),r[v].id<=r[b].low&&(r[v].cutVertex=!0,c(v,b))))})}};e.forEach(function(f){if(f.isNode()){var p=f.id();p in r||(a=0,u(p,p),r[p].cutVertex=a>1)}});var d=Object.keys(r).filter(function(f){return r[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(d),components:i}},TB={hopcroftTarjanBiconnected:Yo,htbc:Yo,htb:Yo,hopcroftTarjanBiconnectedComponents:Yo},Zo=function(){var e=this,r={},n=0,a=[],i=[],s=e.spawn(e),l=function c(u){i.push(u),r[u]={index:n,low:n++,explored:!1};var d=e.getElementById(u).connectedEdges().intersection(e);if(d.forEach(function(g){var y=g.target().id();y!==u&&(y in r||c(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var f=e.spawn();;){var p=i.pop();if(f.merge(e.getElementById(p)),r[p].low=r[u].index,r[p].explored=!0,p===u)break}var v=f.edgesWith(f),h=f.merge(v);a.push(h),s=s.difference(h)}};return e.forEach(function(c){if(c.isNode()){var u=c.id();u in r||l(u)}}),{cut:s,components:a}},BB={tarjanStronglyConnected:Zo,tsc:Zo,tscc:Zo,tarjanStronglyConnectedComponents:Zo},Fh={};[Ei,nT,aT,oT,lT,uT,hT,VT,ba,wa,Jl,XT,uB,gB,xB,SB,TB,BB].forEach(function(t){xe(Fh,t)});/*!
23
23
  Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
24
24
  Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
25
25
  Licensed under The MIT License (http://opensource.org/licenses/MIT)
26
- */var Fh=0,Ah=1,Vh=2,$r=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=Fh,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))};$r.prototype={fulfill:function(e){return Rh(this,Ah,"fulfillValue",e)},reject:function(e){return Rh(this,Vh,"rejectReason",e)},then:function(e,r){var n=this,a=new $r;return n.onFulfilled.push(Hh(e,a,"fulfill")),n.onRejected.push(Hh(r,a,"reject")),$h(n),a.proxy}};var Rh=function(e,r,n,a){return e.state===Fh&&(e.state=r,e[n]=a,$h(e)),e},$h=function(e){e.state===Ah?zh(e,"onFulfilled",e.fulfillValue):e.state===Vh&&zh(e,"onRejected",e.rejectReason)},zh=function(e,r,n){if(e[r].length!==0){var a=e[r];e[r]=[];var i=function(){for(var l=0;l<a.length;l++)a[l](n)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},Hh=function(e,r,n){return function(a){if(typeof e!="function")r[n].call(r,a);else{var i;try{i=e(a)}catch(s){r.reject(s);return}NB(r,i)}}},NB=function t(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(ot(r)==="object"&&r!==null||typeof r=="function")try{n=r.then}catch(i){e.reject(i);return}if(typeof n=="function"){var a=!1;try{n.call(r,function(i){a||(a=!0,i===r?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(r)};$r.all=function(t){return new $r(function(e,r){for(var n=new Array(t.length),a=0,i=function(c,u){n[c]=u,a++,a===t.length&&e(n)},s=0;s<t.length;s++)(function(l){var c=t[l],u=c!=null&&c.then!=null;if(u)c.then(function(f){i(l,f)},function(f){r(f)});else{var d=c;i(l,d)}})(s)})},$r.resolve=function(t){return new $r(function(e,r){e(t)})},$r.reject=function(t){return new $r(function(e,r){r(t)})};var ka=typeof Promise<"u"?Promise:$r,rc=function(e,r,n){var a=Rl(e),i=!a,s=this._private=xe({duration:1e3},r,n);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 c=e.pan();s.startPan={x:c.x,y:c.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},$n=rc.prototype;xe($n,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,n=e.target._private.animation;e.queue?r=n.queue:r=n.current,r.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 r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},progress:function(e){var r=this._private,n=r.playing;return e===void 0?r.progress:(n&&this.pause(),r.progress=e,r.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(u,d){var f=e[u];f!=null&&(e[u]=e[d],e[d]=f)};if(n("zoom","startZoom"),n("pan","startPan"),n("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 r&&this.play(),this},promise:function(e){var r=this._private,n;switch(e){case"frame":n=r.frames;break;default:case"complete":case"completed":n=r.completes}return new ka(function(a,i){n.push(function(){a()})})}}),$n.complete=$n.completed,$n.run=$n.play,$n.running=$n.playing;var DB={animated:function(){return function(){var r=this,n=r.length!==void 0,a=n?r:[r],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 r=this,n=r.length!==void 0,a=n?r:[r],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(r,n){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:r,duration:r,complete:n}):this}},delayAnimation:function(){return function(r,n){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:r,duration:r,complete:n}):this}},animation:function(){return function(r,n){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this,c=!i,u=!c;if(!l.styleEnabled())return this;var d=l.style();r=xe({},r,n);var f=Object.keys(r).length===0;if(f)return new rc(s[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(u&&(r.style=d.getPropsList(r.style||r.css),r.css=void 0),u&&r.renderedPosition!=null){var p=r.renderedPosition,v=l.pan(),h=l.zoom();r.position=dh(p,h,v)}if(c&&r.panBy!=null){var g=r.panBy,y=l.pan();r.pan={x:y.x+g.x,y:y.y+g.y}}var m=r.center||r.centre;if(c&&m!=null){var b=l.getCenterPan(m.eles,r.zoom);b!=null&&(r.pan=b)}if(c&&r.fit!=null){var w=r.fit,C=l.getFitViewport(w.eles||w.boundingBox,w.padding);C!=null&&(r.pan=C.pan,r.zoom=C.zoom)}if(c&&Oe(r.zoom)){var x=l.getZoomedViewport(r.zoom);x!=null?(x.zoomed&&(r.zoom=x.zoom),x.panned&&(r.pan=x.pan)):r.zoom=null}return new rc(s[0],r)}},animate:function(){return function(r,n){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;n&&(r=xe({},r,n));for(var c=0;c<s.length;c++){var u=s[c],d=u.animated()&&(r.queue===void 0||r.queue),f=u.animation(r,d?{queue:!0}:void 0);f.play()}return this}},stop:function(){return function(r,n){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;for(var c=0;c<s.length;c++){for(var u=s[c],d=u._private,f=d.animation.current,p=0;p<f.length;p++){var v=f[p],h=v._private;n&&(h.duration=0)}r&&(d.animation.queue=[]),n||(d.animation.current=[])}return l.notify("draw"),this}}},PB=Array.isArray,Xo=PB,_B=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,OB=/^\w*$/;function IB(t,e){if(Xo(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||wi(t)?!0:OB.test(t)||!_B.test(t)||e!=null&&t in Object(e)}var LB=IB,MB="[object AsyncFunction]",FB="[object Function]",AB="[object GeneratorFunction]",VB="[object Proxy]";function RB(t){if(!Ln(t))return!1;var e=Xf(t);return e==FB||e==AB||e==MB||e==VB}var $B=RB,zB=Io["__core-js_shared__"],nc=zB,Kh=function(){var t=/[^.]+$/.exec(nc&&nc.keys&&nc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function HB(t){return!!Kh&&Kh in t}var KB=HB,qB=Function.prototype,UB=qB.toString;function GB(t){if(t!=null){try{return UB.call(t)}catch{}try{return t+""}catch{}}return""}var WB=GB,jB=/[\\^$.*+?()[\]{}|]/g,YB=/^\[object .+?Constructor\]$/,ZB=Function.prototype,XB=Object.prototype,QB=ZB.toString,JB=XB.hasOwnProperty,e5=RegExp("^"+QB.call(JB).replace(jB,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function t5(t){if(!Ln(t)||KB(t))return!1;var e=$B(t)?e5:YB;return e.test(WB(t))}var r5=t5;function n5(t,e){return t==null?void 0:t[e]}var a5=n5;function i5(t,e){var r=a5(t,e);return r5(r)?r:void 0}var ac=i5,o5=ac(Object,"create"),Pi=o5;function s5(){this.__data__=Pi?Pi(null):{},this.size=0}var l5=s5;function c5(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var u5=c5,d5="__lodash_hash_undefined__",f5=Object.prototype,h5=f5.hasOwnProperty;function p5(t){var e=this.__data__;if(Pi){var r=e[t];return r===d5?void 0:r}return h5.call(e,t)?e[t]:void 0}var v5=p5,g5=Object.prototype,m5=g5.hasOwnProperty;function y5(t){var e=this.__data__;return Pi?e[t]!==void 0:m5.call(e,t)}var b5=y5,w5="__lodash_hash_undefined__";function C5(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Pi&&e===void 0?w5:e,this}var k5=C5;function xa(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}xa.prototype.clear=l5,xa.prototype.delete=u5,xa.prototype.get=v5,xa.prototype.has=b5,xa.prototype.set=k5;var qh=xa;function x5(){this.__data__=[],this.size=0}var E5=x5;function S5(t,e){return t===e||t!==t&&e!==e}var Uh=S5;function T5(t,e){for(var r=t.length;r--;)if(Uh(t[r][0],e))return r;return-1}var Qo=T5,B5=Array.prototype,N5=B5.splice;function D5(t){var e=this.__data__,r=Qo(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():N5.call(e,r,1),--this.size,!0}var P5=D5;function _5(t){var e=this.__data__,r=Qo(e,t);return r<0?void 0:e[r][1]}var O5=_5;function I5(t){return Qo(this.__data__,t)>-1}var L5=I5;function M5(t,e){var r=this.__data__,n=Qo(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var F5=M5;function Ea(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ea.prototype.clear=E5,Ea.prototype.delete=P5,Ea.prototype.get=O5,Ea.prototype.has=L5,Ea.prototype.set=F5;var A5=Ea,V5=ac(Io,"Map"),R5=V5;function $5(){this.size=0,this.__data__={hash:new qh,map:new(R5||A5),string:new qh}}var z5=$5;function H5(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var K5=H5;function q5(t,e){var r=t.__data__;return K5(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Jo=q5;function U5(t){var e=Jo(this,t).delete(t);return this.size-=e?1:0,e}var G5=U5;function W5(t){return Jo(this,t).get(t)}var j5=W5;function Y5(t){return Jo(this,t).has(t)}var Z5=Y5;function X5(t,e){var r=Jo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var Q5=X5;function Sa(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Sa.prototype.clear=z5,Sa.prototype.delete=G5,Sa.prototype.get=j5,Sa.prototype.has=Z5,Sa.prototype.set=Q5;var Gh=Sa,J5="Expected a function";function ic(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(J5);var r=function(){var n=arguments,a=e?e.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var s=t.apply(this,n);return r.cache=i.set(a,s)||i,s};return r.cache=new(ic.Cache||Gh),r}ic.Cache=Gh;var eN=ic,tN=500;function rN(t){var e=eN(t,function(n){return r.size===tN&&r.clear(),n}),r=e.cache;return e}var nN=rN,aN=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,iN=/\\(\\)?/g,oN=nN(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(aN,function(r,n,a,i){e.push(a?i.replace(iN,"$1"):n||r)}),e}),Wh=oN;function sN(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}var jh=sN,lN=1/0,Yh=ha?ha.prototype:void 0,Zh=Yh?Yh.toString:void 0;function Xh(t){if(typeof t=="string")return t;if(Xo(t))return jh(t,Xh)+"";if(wi(t))return Zh?Zh.call(t):"";var e=t+"";return e=="0"&&1/t==-lN?"-0":e}var cN=Xh;function uN(t){return t==null?"":cN(t)}var Qh=uN;function dN(t,e){return Xo(t)?t:LB(t,e)?[t]:Wh(Qh(t))}var Jh=dN,fN=1/0;function hN(t){if(typeof t=="string"||wi(t))return t;var e=t+"";return e=="0"&&1/t==-fN?"-0":e}var oc=hN;function pN(t,e){e=Jh(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[oc(e[r++])];return r&&r==n?t:void 0}var vN=pN;function gN(t,e,r){var n=t==null?void 0:vN(t,e);return n===void 0?r:n}var mN=gN,yN=function(){try{var t=ac(Object,"defineProperty");return t({},"",{}),t}catch{}}(),ep=yN;function bN(t,e,r){e=="__proto__"&&ep?ep(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var wN=bN,CN=Object.prototype,kN=CN.hasOwnProperty;function xN(t,e,r){var n=t[e];(!(kN.call(t,e)&&Uh(n,r))||r===void 0&&!(e in t))&&wN(t,e,r)}var EN=xN,SN=9007199254740991,TN=/^(?:0|[1-9]\d*)$/;function BN(t,e){var r=typeof t;return e=e??SN,!!e&&(r=="number"||r!="symbol"&&TN.test(t))&&t>-1&&t%1==0&&t<e}var NN=BN;function DN(t,e,r,n){if(!Ln(t))return t;e=Jh(e,t);for(var a=-1,i=e.length,s=i-1,l=t;l!=null&&++a<i;){var c=oc(e[a]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(a!=s){var d=l[c];u=n?n(d,c,l):void 0,u===void 0&&(u=Ln(d)?d:NN(e[a+1])?[]:{})}EN(l,c,u),l=l[c]}return t}var PN=DN;function _N(t,e,r){return t==null?t:PN(t,e,r)}var ON=_N;function IN(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var LN=IN;function MN(t){return Xo(t)?jh(t,oc):wi(t)?[t]:LN(Wh(Qh(t)))}var FN=MN,AN={data:function(e){var r={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({},r,e),function(a,i){var s=e,l=this,c=l.length!==void 0,u=c?l:[l],d=c?l[0]:l;if(be(a)){var f=a.indexOf(".")!==-1,p=f&&FN(a);if(s.allowGetting&&i===void 0){var v;return d&&(s.beforeGet(d),p&&d._private[s.field][a]===void 0?v=mN(d._private[s.field],p):v=d._private[s.field][a]),v}else if(s.allowSetting&&i!==void 0){var h=!s.immutableKeys[a];if(h){var g=Ff({},a,i);s.beforeSet(l,g);for(var y=0,m=u.length;y<m;y++){var b=u[y];s.canSet(b)&&(p&&d._private[s.field][a]===void 0?ON(b._private[s.field],p,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,x,E=Object.keys(w);s.beforeSet(l,w);for(var k=0;k<E.length;k++){C=E[k],x=w[C];var B=!s.immutableKeys[C];if(B)for(var S=0;S<u.length;S++){var N=u[S];s.canSet(N)&&(N._private[s.field][C]=x)}}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 P;return d&&(s.beforeGet(d),P=d._private[s.field]),P}return l}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=xe({},r,e),function(a){var i=e,s=this,l=s.length!==void 0,c=l?s:[s];if(be(a)){for(var u=a.split(/\s+/),d=u.length,f=0;f<d;f++){var p=u[f];if(!nn(p)){var v=!i.immutableKeys[p];if(v)for(var h=0,g=c.length;h<g;h++)c[h]._private[i.field][p]=void 0}}i.triggerEvent&&s[i.triggerFnName](i.event)}else if(a===void 0){for(var y=0,m=c.length;y<m;y++)for(var b=c[y]._private[i.field],w=Object.keys(b),C=0;C<w.length;C++){var x=w[C],E=!i.immutableKeys[x];E&&(b[x]=void 0)}i.triggerEvent&&s[i.triggerFnName](i.event)}return s}}},VN={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(n,a){var i=this,s=Array.prototype.slice.call(arguments,0);return new ka(function(l,c){var u=function(v){i.off.apply(i,f),l(v)},d=s.concat([u]),f=d.concat([]);i.on.apply(i,d)})}}},Ve={};[DB,AN,VN].forEach(function(t){xe(Ve,t)});var RN={animate:Ve.animate(),animation:Ve.animation(),animated:Ve.animated(),clearQueue:Ve.clearQueue(),delay:Ve.delay(),delayAnimation:Ve.delayAnimation(),stop:Ve.stop()},es={classes:function(e){var r=this;if(e===void 0){var n=[];return r[0]._private.classes.forEach(function(h){return n.push(h)}),n}else Ke(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new va(e),s=0;s<r.length;s++){for(var l=r[s],c=l._private,u=c.classes,d=!1,f=0;f<e.length;f++){var p=e[f],v=u.has(p);if(!v){d=!0;break}}d||(d=u.size!==e.length),d&&(c.classes=i,a.push(l))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Ke(e)||(e=e.match(/\S+/g)||[]);for(var n=this,a=r===void 0,i=[],s=0,l=n.length;s<l;s++)for(var c=n[s],u=c._private.classes,d=!1,f=0;f<e.length;f++){var p=e[f],v=u.has(p),h=!1;r||a&&!v?(u.add(p),h=!0):(!r||a&&v)&&(u.delete(p),h=!0),!d&&h&&(i.push(c),d=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};es.className=es.classNames=es.classes;var Ie={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:lt,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,r;for(t=Ie.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],Ie.comparatorOp+="|@"+e;for(t=Ie.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(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},sc=[{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 XE(t.selector,e.selector)}),$N=function(){for(var t={},e,r=0;r<sc.length;r++)e=sc[r],t[e.selector]=e.matches;return t}(),zN=function(e,r){return $N[e](r)},HN="("+sc.map(function(t){return t.selector}).join("|")+")",Ta=function(e){return e.replace(new RegExp("\\\\("+Ie.metaChar+")","g"),function(r,n){return n})},cn=function(e,r,n){e[e.length-1]=n},lc=[{name:"group",query:!0,regex:"("+Ie.group+")",populate:function(e,r,n){var a=cr(n,1),i=a[0];r.checks.push({type:fe.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:HN,populate:function(e,r,n){var a=cr(n,1),i=a[0];r.checks.push({type:fe.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Ie.id+")",populate:function(e,r,n){var a=cr(n,1),i=a[0];r.checks.push({type:fe.ID,value:Ta(i)})}},{name:"className",query:!0,regex:"\\.("+Ie.className+")",populate:function(e,r,n){var a=cr(n,1),i=a[0];r.checks.push({type:fe.CLASS,value:Ta(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Ie.variable+")\\s*\\]",populate:function(e,r,n){var a=cr(n,1),i=a[0];r.checks.push({type:fe.DATA_EXIST,field:Ta(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Ie.variable+")\\s*("+Ie.comparatorOp+")\\s*("+Ie.value+")\\s*\\]",populate:function(e,r,n){var a=cr(n,3),i=a[0],s=a[1],l=a[2],c=new RegExp("^"+Ie.string+"$").exec(l)!=null;c?l=l.substring(1,l.length-1):l=parseFloat(l),r.checks.push({type:fe.DATA_COMPARE,field:Ta(i),operator:s,value:l})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Ie.boolOp+")\\s*("+Ie.variable+")\\s*\\]",populate:function(e,r,n){var a=cr(n,2),i=a[0],s=a[1];r.checks.push({type:fe.DATA_BOOL,field:Ta(s),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Ie.meta+")\\s*("+Ie.comparatorOp+")\\s*("+Ie.number+")\\s*\\]\\]",populate:function(e,r,n){var a=cr(n,3),i=a[0],s=a[1],l=a[2];r.checks.push({type:fe.META_COMPARE,field:Ta(i),operator:s,value:parseFloat(l)})}},{name:"nextQuery",separator:!0,regex:Ie.separator,populate:function(e,r){var n=e.currentSubject,a=e.edgeCount,i=e.compoundCount,s=e[e.length-1];n!=null&&(s.subject=n,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,r){if(e.currentSubject==null){var n=ze(),a=r,i=ze();return n.checks.push({type:fe.DIRECTED_EDGE,source:a,target:i}),cn(e,r,n),e.edgeCount++,i}else{var s=ze(),l=r,c=ze();return s.checks.push({type:fe.NODE_SOURCE,source:l,target:c}),cn(e,r,s),e.edgeCount++,c}}},{name:"undirectedEdge",separator:!0,regex:Ie.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=r,i=ze();return n.checks.push({type:fe.UNDIRECTED_EDGE,nodes:[a,i]}),cn(e,r,n),e.edgeCount++,i}else{var s=ze(),l=r,c=ze();return s.checks.push({type:fe.NODE_NEIGHBOR,node:l,neighbor:c}),cn(e,r,s),c}}},{name:"child",separator:!0,regex:Ie.child,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=ze(),i=e[e.length-1];return n.checks.push({type:fe.CHILD,parent:i,child:a}),cn(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var s=ze(),l=e[e.length-1],c=ze(),u=ze(),d=ze(),f=ze();return s.checks.push({type:fe.COMPOUND_SPLIT,left:l,right:c,subject:u}),u.checks=r.checks,r.checks=[{type:fe.TRUE}],f.checks.push({type:fe.TRUE}),c.checks.push({type:fe.PARENT,parent:f,child:d}),cn(e,l,s),e.currentSubject=u,e.compoundCount++,d}else{var p=ze(),v=ze(),h=[{type:fe.PARENT,parent:p,child:v}];return p.checks=r.checks,r.checks=h,e.compoundCount++,v}}},{name:"descendant",separator:!0,regex:Ie.descendant,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=ze(),i=e[e.length-1];return n.checks.push({type:fe.DESCENDANT,ancestor:i,descendant:a}),cn(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var s=ze(),l=e[e.length-1],c=ze(),u=ze(),d=ze(),f=ze();return s.checks.push({type:fe.COMPOUND_SPLIT,left:l,right:c,subject:u}),u.checks=r.checks,r.checks=[{type:fe.TRUE}],f.checks.push({type:fe.TRUE}),c.checks.push({type:fe.ANCESTOR,ancestor:f,descendant:d}),cn(e,l,s),e.currentSubject=u,e.compoundCount++,d}else{var p=ze(),v=ze(),h=[{type:fe.ANCESTOR,ancestor:p,descendant:v}];return p.checks=r.checks,r.checks=h,e.compoundCount++,v}}},{name:"subject",modifier:!0,regex:Ie.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return Ae("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var n=e[e.length-1],a=n.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)}}];lc.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var KN=function(e){for(var r,n,a,i=0;i<lc.length;i++){var s=lc[i],l=s.name,c=e.match(s.regexObj);if(c!=null){n=c,r=s,a=l;var u=c[0];e=e.substring(u.length);break}}return{expr:r,match:n,name:a,remaining:e}},qN=function(e){var r=e.match(/^\s+/);if(r){var n=r[0];e=e.substring(n.length)}return e},UN=function(e){var r=this,n=r.inputText=e,a=r[0]=ze();for(r.length=1,n=qN(n);;){var i=KN(n);if(i.expr==null)return Ae("The selector `"+e+"`is invalid"),!1;var s=i.match.slice(1),l=i.expr.populate(r,a,s);if(l===!1)return!1;if(l!=null&&(a=l),n=i.remaining,n.match(/^\s*$/))break}var c=r[r.length-1];r.currentSubject!=null&&(c.subject=r.currentSubject),c.edgeCount=r.edgeCount,c.compoundCount=r.compoundCount;for(var u=0;u<r.length;u++){var d=r[u];if(d.compoundCount>0&&d.edgeCount>0)return Ae("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(d.edgeCount>1)return Ae("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;d.edgeCount===1&&Ae("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},GN=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(d){return d??""},r=function(d){return be(d)?'"'+d+'"':e(d)},n=function(d){return" "+d+" "},a=function(d,f){var p=d.type,v=d.value;switch(p){case fe.GROUP:{var h=e(v);return h.substring(0,h.length-1)}case fe.DATA_COMPARE:{var g=d.field,y=d.operator;return"["+g+n(e(y))+r(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,x=d.field;return"[["+x+n(e(C))+r(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)+n(">")+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),k=i(d.subject,f),B=i(d.right,f);return E+(E.length>0?" ":"")+k+B}case fe.TRUE:return""}},i=function(d,f){return d.checks.reduce(function(p,v,h){return p+(f===d&&h===0?"$":"")+a(v,f)},"")},s="",l=0;l<this.length;l++){var c=this[l];s+=i(c,c.subject),this.length>1&&l<this.length-1&&(s+=", ")}return this.toStringCache=s,s},WN={parse:UN,toString:GN},tp=function(e,r,n){var a,i=be(e),s=le(e),l=be(n),c,u,d=!1,f=!1,p=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),f=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),d=!0),(i||l||d)&&(c=!i&&!s?"":""+e,u=""+n),d&&(e=c=c.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":a=c.indexOf(u)>=0;break;case"$=":a=c.indexOf(u,c.length-u.length)>=0;break;case"^=":a=c.indexOf(u)===0;break;case"=":a=e===n;break;case">":p=!0,a=e>n;break;case">=":p=!0,a=e>=n;break;case"<":p=!0,a=e<n;break;case"<=":p=!0,a=e<=n;break;default:a=!1;break}return f&&(e!=null||!p)&&(a=!a),a},jN=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},YN=function(e){return e!==void 0},cc=function(e,r){return e.data(r)},ZN=function(e,r){return e[r]()},Xe=[],je=function(e,r){return e.checks.every(function(n){return Xe[n.type](n,r)})};Xe[fe.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()},Xe[fe.STATE]=function(t,e){var r=t.value;return zN(r,e)},Xe[fe.ID]=function(t,e){var r=t.value;return e.id()===r},Xe[fe.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)},Xe[fe.META_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return tp(ZN(e,r),n,a)},Xe[fe.DATA_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return tp(cc(e,r),n,a)},Xe[fe.DATA_BOOL]=function(t,e){var r=t.field,n=t.operator;return jN(cc(e,r),n)},Xe[fe.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,YN(cc(e,r))},Xe[fe.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],n=t.nodes[1],a=e.source(),i=e.target();return je(r,a)&&je(n,i)||je(n,a)&&je(r,i)},Xe[fe.NODE_NEIGHBOR]=function(t,e){return je(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&je(t.neighbor,r)})},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(r){return r.isNode()&&je(t.target,r)})},Xe[fe.NODE_TARGET]=function(t,e){return je(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&je(t.source,r)})},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(r){return je(t.child,r)})},Xe[fe.DESCENDANT]=function(t,e){return je(t.descendant,e)&&e.ancestors().some(function(r){return je(t.ancestor,r)})},Xe[fe.ANCESTOR]=function(t,e){return je(t.ancestor,e)&&e.descendants().some(function(r){return je(t.descendant,r)})},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 r=t.value;return r.has(e)},Xe[fe.FILTER]=function(t,e){var r=t.value;return r(e)};var XN=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===fe.ID)return e.getElementById(r[0].checks[0].value).collection();var n=function(i){for(var s=0;s<r.length;s++){var l=r[s];if(je(l,i))return!0}return!1};return r.text()==null&&(n=function(){return!0}),e.filter(n)},QN=function(e){for(var r=this,n=0;n<r.length;n++){var a=r[n];if(je(a,e))return!0}return!1},JN={matches:QN,filter:XN},un=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 "))},dn=un.prototype;[WN,JN].forEach(function(t){return xe(dn,t)}),dn.text=function(){return this.inputText},dn.size=function(){return this.length},dn.eq=function(t){return this[t]},dn.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()},dn.addQuery=function(t){this[this.length++]=t},dn.selector=dn.toString;var fn={allAre:function(e){var r=new un(e);return this.every(function(n){return r.matches(n)})},is:function(e){var r=new un(e);return this.some(function(n){return r.matches(n)})},some:function(e,r){for(var n=0;n<this.length;n++){var a=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(a)return!0}return!1},every:function(e,r){for(var n=0;n<this.length;n++){var a=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(!a)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,n=e.length;return r!==n?!1:r===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(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(n){return r.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(n){return r.hasElementWithId(n.id())})}};fn.allAreNeighbours=fn.allAreNeighbors,fn.has=fn.contains,fn.equal=fn.equals=fn.same;var Qt=function(e,r){return function(a,i,s,l){var c=a,u=this,d;if(c==null?d="":Ut(c)&&c.length===1&&(d=c.id()),u.length===1&&d){var f=u[0]._private,p=f.traversalCache=f.traversalCache||{},v=p[r]=p[r]||[],h=Mn(d),g=v[h];return g||(v[h]=e.call(u,a,i,s,l))}else return e.call(u,a,i,s,l)}},Ba={parent:function(e){var r=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var a=0;a<this.length;a++){var i=this[a],s=i._private.parent;s&&r.push(s)}return this.spawn(r,!0).filter(e)},parents:function(e){for(var r=[],n=this.parent();n.nonempty();){for(var a=0;a<n.length;a++){var i=n[a];r.push(i)}n=n.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){for(var r,n=0;n<this.length;n++){var a=this[n],i=a.parents();r=r||i,r=r.intersect(i)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:Qt(function(t){for(var e=[],r=0;r<this.length;r++)for(var n=this[r],a=n._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 r=[];function n(a){for(var i=0;i<a.length;i++){var s=a[i];r.push(s),s.children().nonempty()&&n(s.children())}}return n(this.children()),this.spawn(r,!0).filter(e)}};function uc(t,e,r,n){for(var a=[],i=new va,s=t.cy(),l=s.hasCompoundNodes(),c=0;c<t.length;c++){var u=t[c];r?a.push(u):l&&n(a,i,u)}for(;a.length>0;){var d=a.shift();e(d),i.add(d.id()),l&&n(a,i,d)}return t}function rp(t,e,r){if(r.isParent())for(var n=r._private.children,a=0;a<n.length;a++){var i=n[a];e.has(i.id())||t.push(i)}}Ba.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return uc(this,t,e,rp)};function np(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}Ba.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return uc(this,t,e,np)};function e4(t,e,r){np(t,e,r),rp(t,e,r)}Ba.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return uc(this,t,e,e4)},Ba.ancestors=Ba.parents;var _i,ap;_i=ap={data:Ve.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:Ve.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ve.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ve.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ve.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ve.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},_i.attr=_i.data,_i.removeAttr=_i.removeData;var t4=ap,ts={};function dc(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,a=r[0],i=a._private.edges,s=0;s<i.length;s++){var l=i[s];!e&&l.isLoop()||(n+=t(a,l))}return n}else return}}xe(ts,{degree:dc(function(t,e){return e.source().same(e.target())?2:1}),indegree:dc(function(t,e){return e.target().same(t)?1:0}),outdegree:dc(function(t,e){return e.source().same(t)?1:0})});function Na(t,e){return function(r){for(var n,a=this.nodes(),i=0;i<a.length;i++){var s=a[i],l=s[t](r);l!==void 0&&(n===void 0||e(l,n))&&(n=l)}return n}}xe(ts,{minDegree:Na("degree",function(t,e){return t<e}),maxDegree:Na("degree",function(t,e){return t>e}),minIndegree:Na("indegree",function(t,e){return t<e}),maxIndegree:Na("indegree",function(t,e){return t>e}),minOutdegree:Na("outdegree",function(t,e){return t<e}),maxOutdegree:Na("outdegree",function(t,e){return t>e})}),xe(ts,{totalDegree:function(e){for(var r=0,n=this.nodes(),a=0;a<n.length;a++)r+=n[a].degree(e);return r}});var dr,ip,op=function(e,r,n){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var s=i._private.position,l={x:r.x!=null?r.x-s.x:0,y:r.y!=null?r.y-s.y:0};i.isParent()&&!(l.x===0&&l.y===0)&&i.children().shift(l,n),i.dirtyBoundingBoxCache()}}},sp={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,r){op(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};dr=ip={position:Ve.data(sp),silentPosition:Ve.data(xe({},sp,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){op(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(Oe(e))r?this.silentPosition(e):this.position(e);else if(Ye(e)){var n=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var s=this[i],l=void 0;(l=n(s,i))&&(r?s.silentPosition(l):s.position(l))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,n){var a;if(Oe(e)?(a={x:le(e.x)?e.x:0,y:le(e.y)?e.y:0},n=r):be(e)&&le(r)&&(a={x:0,y:0},a[e]=r),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 c=l.position(),u={x:c.x+a.x,y:c.y+a.y};n?l.silentPosition(u):l.position(u)}}i.endBatch()}return this},silentShift:function(e,r){return Oe(e)?this.shift(e,!0):be(e)&&le(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var n=this[0],a=this.cy(),i=a.zoom(),s=a.pan(),l=Oe(e)?e:void 0,c=l!==void 0||r!==void 0&&be(e);if(n&&n.isNode())if(c)for(var u=0;u<this.length;u++){var d=this[u];r!==void 0?d.position(e,(r-s[e])/i):l!==void 0&&d.position(dh(l,i,s))}else{var f=n.position();return l=Ro(f,i,s),e===void 0?l:l[e]}else if(!c)return;return this},relativePosition:function(e,r){var n=this[0],a=this.cy(),i=Oe(e)?e:void 0,s=i!==void 0||r!==void 0&&be(e),l=a.hasCompoundNodes();if(n&&n.isNode())if(s)for(var c=0;c<this.length;c++){var u=this[c],d=l?u.parent():null,f=d&&d.length>0,p=f;f&&(d=d[0]);var v=p?d.position():{x:0,y:0};r!==void 0?u.position(e,r+v[e]):i!==void 0&&u.position({x:i.x+v.x,y:i.y+v.y})}else{var h=n.position(),g=l?n.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:h.x-b.x,y:h.y-b.y},e===void 0?i:i[e]}else if(!s)return;return this}},dr.modelPosition=dr.point=dr.position,dr.modelPositions=dr.points=dr.positions,dr.renderedPoint=dr.renderedPosition,dr.relativePoint=dr.relativePosition;var r4=ip,Da,hn;Da=hn={},hn.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),a=r.pan(),i=e.x1*n+a.x,s=e.x2*n+a.x,l=e.y1*n+a.y,c=e.y2*n+a.y;return{x1:i,x2:s,y1:l,y2:c,w:s-i,h:c-l}},hn.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(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)},hn.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 r(s){if(!s.isParent())return;var l=s._private,c=s.children(),u=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=c.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),p=l.position;(f.w===0||f.h===0)&&(f={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},f.x1=p.x-f.w/2,f.x2=p.x+f.w/2,f.y1=p.y-f.h/2,f.y2=p.y+f.h/2);function v(S,N,D){var P=0,I=0,_=N+D;return S>0&&_>0&&(P=N/_*S,I=D/_*S),{biasDiff:P,biasComplementDiff:I}}function h(S,N,D,P){if(D.units==="%")switch(P){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,x=w.biasComplementDiff,E=v(d.height.val-f.h,m,b),k=E.biasDiff,B=E.biasComplementDiff;l.autoPadding=h(f.w,f.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),l.autoWidth=Math.max(f.w,d.width.val),p.x=(-C+f.x1+f.x2+x)/2,l.autoHeight=Math.max(f.h,d.height.val),p.y=(-k+f.y1+f.y2+B)/2}for(var n=0;n<this.length;n++){var a=this[n],i=a._private;(!i.compoundBoundsClean||t)&&(r(a),e.batching()||(i.compoundBoundsClean=!0))}return this};var Jt=function(e){return e===1/0||e===-1/0?0:e},fr=function(e,r,n,a,i){a-r===0||i-n===0||r==null||n==null||a==null||i==null||(e.x1=r<e.x1?r:e.x1,e.x2=a>e.x2?a:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},zn=function(e,r){return r==null?e:fr(e,r.x1,r.y1,r.x2,r.y2)},Oi=function(e,r,n){return ur(e,r,n)},rs=function(e,r,n){if(!r.cy().headless()){var a=r._private,i=a.rstyle,s=i.arrowWidth/2,l=r.pstyle(n+"-arrow-shape").value,c,u;if(l!=="none"){n==="source"?(c=i.srcX,u=i.srcY):n==="target"?(c=i.tgtX,u=i.tgtY):(c=i.midX,u=i.midY);var d=a.arrowBounds=a.arrowBounds||{},f=d[n]=d[n]||{};f.x1=c-s,f.y1=u-s,f.x2=c+s,f.y2=u+s,f.w=f.x2-f.x1,f.h=f.y2-f.y1,zo(f,1),fr(e,f.x1,f.y1,f.x2,f.y2)}}},fc=function(e,r,n){if(!r.cy().headless()){var a;n?a=n+"-":a="";var i=r._private,s=i.rstyle,l=r.pstyle(a+"label").strValue;if(l){var c=r.pstyle("text-halign"),u=r.pstyle("text-valign"),d=Oi(s,"labelWidth",n),f=Oi(s,"labelHeight",n),p=Oi(s,"labelX",n),v=Oi(s,"labelY",n),h=r.pstyle(a+"text-margin-x").pfValue,g=r.pstyle(a+"text-margin-y").pfValue,y=r.isEdge(),m=r.pstyle(a+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,w=r.pstyle("text-border-width").pfValue,C=w/2,x=r.pstyle("text-background-padding").pfValue,E=2,k=f,B=d,S=B/2,N=k/2,D,P,I,_;if(y)D=p-S,P=p+S,I=v-N,_=v+N;else{switch(c.value){case"left":D=p-B,P=p;break;case"center":D=p-S,P=p+S;break;case"right":D=p,P=p+B;break}switch(u.value){case"top":I=v-k,_=v;break;case"center":I=v-N,_=v+N;break;case"bottom":I=v,_=v+k;break}}D+=h-Math.max(b,C)-x-E,P+=h+Math.max(b,C)+x+E,I+=g-Math.max(b,C)-x-E,_+=g+Math.max(b,C)+x+E;var F=n||"main",O=i.labelBounds,M=O[F]=O[F]||{};M.x1=D,M.y1=I,M.x2=P,M.y2=_,M.w=P-D,M.h=_-I;var L=y&&m.strValue==="autorotate",V=m.pfValue!=null&&m.pfValue!==0;if(L||V){var H=L?Oi(i.rstyle,"labelAngle",n):m.pfValue,$=Math.cos(H),z=Math.sin(H),j=(D+P)/2,ee=(I+_)/2;if(!y){switch(c.value){case"left":j=P;break;case"right":j=D;break}switch(u.value){case"top":ee=_;break;case"bottom":ee=I;break}}var J=function(he,ne){return he=he-j,ne=ne-ee,{x:he*$-ne*z+j,y:he*z+ne*$+ee}},X=J(D,I),re=J(D,_),Y=J(P,I),A=J(P,_);D=Math.min(X.x,re.x,Y.x,A.x),P=Math.max(X.x,re.x,Y.x,A.x),I=Math.min(X.y,re.y,Y.y,A.y),_=Math.max(X.y,re.y,Y.y,A.y)}var K=F+"Rot",W=O[K]=O[K]||{};W.x1=D,W.y1=I,W.x2=P,W.y2=_,W.w=P-D,W.h=_-I,fr(e,D,I,P,_),fr(i.labelBounds.all,D,I,P,_)}return e}},n4=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,a=r.pstyle("outline-width").value;if(n>0&&a>0){var i=r.pstyle("outline-offset").value,s=r.pstyle("shape").value,l=a+i,c=(e.w+l*2)/e.w,u=(e.h+l*2)/e.h,d=0,f=0;["diamond","pentagon","round-triangle"].includes(s)?(c=(e.w+l*2.4)/e.w,f=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?c=(e.w+l*2.4)/e.w:s==="star"?(c=(e.w+l*2.8)/e.w,u=(e.h+l*2.6)/e.h,f=-l/3.8):s==="triangle"?(c=(e.w+l*2.8)/e.w,u=(e.h+l*2.4)/e.h,f=-l/1.4):s==="vee"&&(c=(e.w+l*4.4)/e.w,u=(e.h+l*3.8)/e.h,f=-l*.5);var p=e.h*u-e.h,v=e.w*c-e.w;if(Ho(e,[Math.ceil(p/2),Math.ceil(v/2)]),d!=0||f!==0){var h=ET(e,d,f);hh(e,h)}}}},a4=function(e,r){var n=e._private.cy,a=n.styleEnabled(),i=n.headless(),s=zt(),l=e._private,c=e.isNode(),u=e.isEdge(),d,f,p,v,h,g,y=l.rstyle,m=c&&a?e.pstyle("bounds-expansion").pfValue:[0],b=function(ue){return ue.pstyle("display").value!=="none"},w=!a||b(e)&&(!u||b(e.source())&&b(e.target()));if(w){var C=0,x=0;a&&r.includeOverlays&&(C=e.pstyle("overlay-opacity").value,C!==0&&(x=e.pstyle("overlay-padding").value));var E=0,k=0;a&&r.includeUnderlays&&(E=e.pstyle("underlay-opacity").value,E!==0&&(k=e.pstyle("underlay-padding").value));var B=Math.max(x,k),S=0,N=0;if(a&&(S=e.pstyle("width").pfValue,N=S/2),c&&r.includeNodes){var D=e.position();h=D.x,g=D.y;var P=e.outerWidth(),I=P/2,_=e.outerHeight(),F=_/2;d=h-I,f=h+I,p=g-F,v=g+F,fr(s,d,p,f,v),a&&r.includeOutlines&&n4(s,e)}else if(u&&r.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),p=Math.min(y.srcY,y.midY,y.tgtY),v=Math.max(y.srcY,y.midY,y.tgtY),d-=N,f+=N,p-=N,v+=N,fr(s,d,p,f,v),O==="haystack"){var M=y.haystackPts;if(M&&M.length===2){if(d=M[0].x,p=M[0].y,f=M[1].x,v=M[1].y,d>f){var L=d;d=f,f=L}if(p>v){var V=p;p=v,v=V}fr(s,d-N,p-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,p=z.y-N,v=z.y+N,fr(s,d,p,f,v)}}}else{var j=e.source(),ee=j.position(),J=e.target(),X=J.position();if(d=ee.x,f=X.x,p=ee.y,v=X.y,d>f){var re=d;d=f,f=re}if(p>v){var Y=p;p=v,v=Y}d-=N,f+=N,p-=N,v+=N,fr(s,d,p,f,v)}if(a&&r.includeEdges&&u&&(rs(s,e,"mid-source"),rs(s,e,"mid-target"),rs(s,e,"source"),rs(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;fr(s,s.x1+K,s.y1+W,s.x2+K,s.y2+W)}}var oe=l.bodyBounds=l.bodyBounds||{};ph(oe,s),Ho(oe,m),zo(oe,1),a&&(d=s.x1,f=s.x2,p=s.y1,v=s.y2,fr(s,d-B,p-B,f+B,v+B));var he=l.overlayBounds=l.overlayBounds||{};ph(he,s),Ho(he,m),zo(he,1);var ne=l.labelBounds=l.labelBounds||{};ne.all!=null?xT(ne.all):ne.all=zt(),a&&r.includeLabels&&(r.includeMainLabels&&fc(s,e,null),u&&(r.includeSourceLabels&&fc(s,e,"source"),r.includeTargetLabels&&fc(s,e,"target")))}return s.x1=Jt(s.x1),s.y1=Jt(s.y1),s.x2=Jt(s.x2),s.y2=Jt(s.y2),s.w=Jt(s.x2-s.x1),s.h=Jt(s.y2-s.y1),s.w>0&&s.h>0&&w&&(Ho(s,m),zo(s,1)),s},lp=function(e){var r=0,n=function(s){return(s?1:0)<<r++},a=0;return a+=n(e.incudeNodes),a+=n(e.includeEdges),a+=n(e.includeLabels),a+=n(e.includeMainLabels),a+=n(e.includeSourceLabels),a+=n(e.includeTargetLabels),a+=n(e.includeOverlays),a+=n(e.includeOutlines),a},cp=function(e){if(e.isEdge()){var r=e.source().position(),n=e.target().position(),a=function(s){return Math.round(s)};return qS([a(r.x),a(r.y),a(n.x),a(n.y)])}else return 0},up=function(e,r){var n=e._private,a,i=e.isEdge(),s=r==null?dp:lp(r),l=s===dp,c=cp(e),u=n.bbCachePosKey===c,d=r.useCache&&u,f=function(g){return g._private.bbCache==null||g._private.styleDirty},p=!d||f(e)||i&&f(e.source())||f(e.target());if(p?(u||e.recalculateRenderedStyle(d),a=a4(e,Ii),n.bbCache=a,n.bbCachePosKey=c):a=n.bbCache,!l){var v=e.isNode();a=zt(),(r.includeNodes&&v||r.includeEdges&&!v)&&(r.includeOverlays?zn(a,n.overlayBounds):zn(a,n.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?zn(a,n.labelBounds.all):(r.includeMainLabels&&zn(a,n.labelBounds.mainRot),r.includeSourceLabels&&zn(a,n.labelBounds.sourceRot),r.includeTargetLabels&&zn(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},Ii={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},dp=lp(Ii),fp=wt(Ii);hn.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=Ii:t=fp(t),e=up(this[0],t);else{e=zt(),t=t||Ii;var r=fp(t),n=this,a=n.cy(),i=a.styleEnabled();if(i)for(var s=0;s<n.length;s++){var l=n[s],c=l._private,u=cp(l),d=c.bbCachePosKey===u,f=r.useCache&&d&&!c.styleDirty;l.recalculateRenderedStyle(f)}this.updateCompoundBounds(!t.useCache);for(var p=0;p<n.length;p++){var v=n[p];zn(e,up(v,r))}}return e.x1=Jt(e.x1),e.y1=Jt(e.y1),e.x2=Jt(e.x2),e.y2=Jt(e.y2),e.w=Jt(e.x2-e.x1),e.h=Jt(e.y2-e.y1),e},hn.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},hn.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),n=r.hasCompoundNodes(),a=r.collection();if(n&&(a=e.filter(function(u){return u.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};r.startBatch(),e.forEach(s).silentPositions(t),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var c=kT(this.boundingBox({useCache:!1}));return e.silentPositions(l),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),r.endBatch(),c},Da.boundingbox=Da.bb=Da.boundingBox,Da.renderedBoundingbox=Da.renderedBoundingBox;var i4=hn,Li,Mi;Li=Mi={};var hp=function(e){e.uppercaseName=Uf(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=Uf(e.outerName),Li[e.name]=function(){var n=this[0],a=n._private,i=a.cy,s=i._private.styleEnabled;if(n)if(s){if(n.isParent())return n.updateCompoundBounds(),a[e.autoName]||0;var l=n.pstyle(e.name);switch(l.strValue){case"label":return n.recalculateRenderedStyle(),a.rstyle[e.labelName]||0;default:return l.pfValue}}else return 1},Li["outer"+e.uppercaseName]=function(){var n=this[0],a=n._private,i=a.cy,s=i._private.styleEnabled;if(n)if(s){var l=n[e.name](),c=n.pstyle("border-width").pfValue,u=2*n.padding();return l+c+u}else return 1},Li["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},Li["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};hp({name:"width"}),hp({name:"height"}),Mi.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},Mi.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()},Mi.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var o4=Mi,s4=function(e,r){if(e.isEdge())return r(e)},l4=function(e,r){if(e.isEdge()){var n=e.cy();return Ro(r(e),n.zoom(),n.pan())}},c4=function(e,r){if(e.isEdge()){var n=e.cy(),a=n.pan(),i=n.zoom();return r(e).map(function(s){return Ro(s,i,a)})}},u4=function(e){return e.renderer().getControlPoints(e)},d4=function(e){return e.renderer().getSegmentPoints(e)},f4=function(e){return e.renderer().getSourceEndpoint(e)},h4=function(e){return e.renderer().getTargetEndpoint(e)},p4=function(e){return e.renderer().getEdgeMidpoint(e)},pp={controlPoints:{get:u4,mult:!0},segmentPoints:{get:d4,mult:!0},sourceEndpoint:{get:f4},targetEndpoint:{get:h4},midpoint:{get:p4}},v4=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},g4=Object.keys(pp).reduce(function(t,e){var r=pp[e],n=v4(e);return t[e]=function(){return s4(this,r.get)},r.mult?t[n]=function(){return c4(this,r.get)}:t[n]=function(){return l4(this,r.get)},t},{}),m4=xe({},r4,i4,o4,g4);/*!
26
+ */var Ah=0,Vh=1,Rh=2,$r=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=Ah,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))};$r.prototype={fulfill:function(e){return $h(this,Vh,"fulfillValue",e)},reject:function(e){return $h(this,Rh,"rejectReason",e)},then:function(e,r){var n=this,a=new $r;return n.onFulfilled.push(Kh(e,a,"fulfill")),n.onRejected.push(Kh(r,a,"reject")),zh(n),a.proxy}};var $h=function(e,r,n,a){return e.state===Ah&&(e.state=r,e[n]=a,zh(e)),e},zh=function(e){e.state===Vh?Hh(e,"onFulfilled",e.fulfillValue):e.state===Rh&&Hh(e,"onRejected",e.rejectReason)},Hh=function(e,r,n){if(e[r].length!==0){var a=e[r];e[r]=[];var i=function(){for(var l=0;l<a.length;l++)a[l](n)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},Kh=function(e,r,n){return function(a){if(typeof e!="function")r[n].call(r,a);else{var i;try{i=e(a)}catch(s){r.reject(s);return}NB(r,i)}}},NB=function t(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(ot(r)==="object"&&r!==null||typeof r=="function")try{n=r.then}catch(i){e.reject(i);return}if(typeof n=="function"){var a=!1;try{n.call(r,function(i){a||(a=!0,i===r?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(r)};$r.all=function(t){return new $r(function(e,r){for(var n=new Array(t.length),a=0,i=function(c,u){n[c]=u,a++,a===t.length&&e(n)},s=0;s<t.length;s++)(function(l){var c=t[l],u=c!=null&&c.then!=null;if(u)c.then(function(f){i(l,f)},function(f){r(f)});else{var d=c;i(l,d)}})(s)})},$r.resolve=function(t){return new $r(function(e,r){e(t)})},$r.reject=function(t){return new $r(function(e,r){r(t)})};var ka=typeof Promise<"u"?Promise:$r,rc=function(e,r,n){var a=Rl(e),i=!a,s=this._private=xe({duration:1e3},r,n);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 c=e.pan();s.startPan={x:c.x,y:c.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},$n=rc.prototype;xe($n,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,n=e.target._private.animation;e.queue?r=n.queue:r=n.current,r.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 r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},progress:function(e){var r=this._private,n=r.playing;return e===void 0?r.progress:(n&&this.pause(),r.progress=e,r.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(u,d){var f=e[u];f!=null&&(e[u]=e[d],e[d]=f)};if(n("zoom","startZoom"),n("pan","startPan"),n("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 r&&this.play(),this},promise:function(e){var r=this._private,n;switch(e){case"frame":n=r.frames;break;default:case"complete":case"completed":n=r.completes}return new ka(function(a,i){n.push(function(){a()})})}}),$n.complete=$n.completed,$n.run=$n.play,$n.running=$n.playing;var DB={animated:function(){return function(){var r=this,n=r.length!==void 0,a=n?r:[r],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 r=this,n=r.length!==void 0,a=n?r:[r],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(r,n){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:r,duration:r,complete:n}):this}},delayAnimation:function(){return function(r,n){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:r,duration:r,complete:n}):this}},animation:function(){return function(r,n){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this,c=!i,u=!c;if(!l.styleEnabled())return this;var d=l.style();r=xe({},r,n);var f=Object.keys(r).length===0;if(f)return new rc(s[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(u&&(r.style=d.getPropsList(r.style||r.css),r.css=void 0),u&&r.renderedPosition!=null){var p=r.renderedPosition,v=l.pan(),h=l.zoom();r.position=fh(p,h,v)}if(c&&r.panBy!=null){var g=r.panBy,y=l.pan();r.pan={x:y.x+g.x,y:y.y+g.y}}var m=r.center||r.centre;if(c&&m!=null){var b=l.getCenterPan(m.eles,r.zoom);b!=null&&(r.pan=b)}if(c&&r.fit!=null){var w=r.fit,C=l.getFitViewport(w.eles||w.boundingBox,w.padding);C!=null&&(r.pan=C.pan,r.zoom=C.zoom)}if(c&&Oe(r.zoom)){var x=l.getZoomedViewport(r.zoom);x!=null?(x.zoomed&&(r.zoom=x.zoom),x.panned&&(r.pan=x.pan)):r.zoom=null}return new rc(s[0],r)}},animate:function(){return function(r,n){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;n&&(r=xe({},r,n));for(var c=0;c<s.length;c++){var u=s[c],d=u.animated()&&(r.queue===void 0||r.queue),f=u.animation(r,d?{queue:!0}:void 0);f.play()}return this}},stop:function(){return function(r,n){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;for(var c=0;c<s.length;c++){for(var u=s[c],d=u._private,f=d.animation.current,p=0;p<f.length;p++){var v=f[p],h=v._private;n&&(h.duration=0)}r&&(d.animation.queue=[]),n||(d.animation.current=[])}return l.notify("draw"),this}}},PB=Array.isArray,Xo=PB,_B=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,OB=/^\w*$/;function IB(t,e){if(Xo(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||wi(t)?!0:OB.test(t)||!_B.test(t)||e!=null&&t in Object(e)}var LB=IB,MB="[object AsyncFunction]",FB="[object Function]",AB="[object GeneratorFunction]",VB="[object Proxy]";function RB(t){if(!Ln(t))return!1;var e=Qf(t);return e==FB||e==AB||e==MB||e==VB}var $B=RB,zB=Io["__core-js_shared__"],nc=zB,qh=function(){var t=/[^.]+$/.exec(nc&&nc.keys&&nc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function HB(t){return!!qh&&qh in t}var KB=HB,qB=Function.prototype,UB=qB.toString;function GB(t){if(t!=null){try{return UB.call(t)}catch{}try{return t+""}catch{}}return""}var WB=GB,jB=/[\\^$.*+?()[\]{}|]/g,YB=/^\[object .+?Constructor\]$/,ZB=Function.prototype,XB=Object.prototype,QB=ZB.toString,JB=XB.hasOwnProperty,e5=RegExp("^"+QB.call(JB).replace(jB,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function t5(t){if(!Ln(t)||KB(t))return!1;var e=$B(t)?e5:YB;return e.test(WB(t))}var r5=t5;function n5(t,e){return t==null?void 0:t[e]}var a5=n5;function i5(t,e){var r=a5(t,e);return r5(r)?r:void 0}var ac=i5,o5=ac(Object,"create"),Pi=o5;function s5(){this.__data__=Pi?Pi(null):{},this.size=0}var l5=s5;function c5(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var u5=c5,d5="__lodash_hash_undefined__",f5=Object.prototype,h5=f5.hasOwnProperty;function p5(t){var e=this.__data__;if(Pi){var r=e[t];return r===d5?void 0:r}return h5.call(e,t)?e[t]:void 0}var v5=p5,g5=Object.prototype,m5=g5.hasOwnProperty;function y5(t){var e=this.__data__;return Pi?e[t]!==void 0:m5.call(e,t)}var b5=y5,w5="__lodash_hash_undefined__";function C5(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Pi&&e===void 0?w5:e,this}var k5=C5;function xa(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}xa.prototype.clear=l5,xa.prototype.delete=u5,xa.prototype.get=v5,xa.prototype.has=b5,xa.prototype.set=k5;var Uh=xa;function x5(){this.__data__=[],this.size=0}var E5=x5;function S5(t,e){return t===e||t!==t&&e!==e}var Gh=S5;function T5(t,e){for(var r=t.length;r--;)if(Gh(t[r][0],e))return r;return-1}var Qo=T5,B5=Array.prototype,N5=B5.splice;function D5(t){var e=this.__data__,r=Qo(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():N5.call(e,r,1),--this.size,!0}var P5=D5;function _5(t){var e=this.__data__,r=Qo(e,t);return r<0?void 0:e[r][1]}var O5=_5;function I5(t){return Qo(this.__data__,t)>-1}var L5=I5;function M5(t,e){var r=this.__data__,n=Qo(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var F5=M5;function Ea(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ea.prototype.clear=E5,Ea.prototype.delete=P5,Ea.prototype.get=O5,Ea.prototype.has=L5,Ea.prototype.set=F5;var A5=Ea,V5=ac(Io,"Map"),R5=V5;function $5(){this.size=0,this.__data__={hash:new Uh,map:new(R5||A5),string:new Uh}}var z5=$5;function H5(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var K5=H5;function q5(t,e){var r=t.__data__;return K5(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Jo=q5;function U5(t){var e=Jo(this,t).delete(t);return this.size-=e?1:0,e}var G5=U5;function W5(t){return Jo(this,t).get(t)}var j5=W5;function Y5(t){return Jo(this,t).has(t)}var Z5=Y5;function X5(t,e){var r=Jo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var Q5=X5;function Sa(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Sa.prototype.clear=z5,Sa.prototype.delete=G5,Sa.prototype.get=j5,Sa.prototype.has=Z5,Sa.prototype.set=Q5;var Wh=Sa,J5="Expected a function";function ic(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(J5);var r=function(){var n=arguments,a=e?e.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var s=t.apply(this,n);return r.cache=i.set(a,s)||i,s};return r.cache=new(ic.Cache||Wh),r}ic.Cache=Wh;var eN=ic,tN=500;function rN(t){var e=eN(t,function(n){return r.size===tN&&r.clear(),n}),r=e.cache;return e}var nN=rN,aN=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,iN=/\\(\\)?/g,oN=nN(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(aN,function(r,n,a,i){e.push(a?i.replace(iN,"$1"):n||r)}),e}),jh=oN;function sN(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}var Yh=sN,lN=1/0,Zh=ha?ha.prototype:void 0,Xh=Zh?Zh.toString:void 0;function Qh(t){if(typeof t=="string")return t;if(Xo(t))return Yh(t,Qh)+"";if(wi(t))return Xh?Xh.call(t):"";var e=t+"";return e=="0"&&1/t==-lN?"-0":e}var cN=Qh;function uN(t){return t==null?"":cN(t)}var Jh=uN;function dN(t,e){return Xo(t)?t:LB(t,e)?[t]:jh(Jh(t))}var ep=dN,fN=1/0;function hN(t){if(typeof t=="string"||wi(t))return t;var e=t+"";return e=="0"&&1/t==-fN?"-0":e}var oc=hN;function pN(t,e){e=ep(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[oc(e[r++])];return r&&r==n?t:void 0}var vN=pN;function gN(t,e,r){var n=t==null?void 0:vN(t,e);return n===void 0?r:n}var mN=gN,yN=function(){try{var t=ac(Object,"defineProperty");return t({},"",{}),t}catch{}}(),tp=yN;function bN(t,e,r){e=="__proto__"&&tp?tp(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var wN=bN,CN=Object.prototype,kN=CN.hasOwnProperty;function xN(t,e,r){var n=t[e];(!(kN.call(t,e)&&Gh(n,r))||r===void 0&&!(e in t))&&wN(t,e,r)}var EN=xN,SN=9007199254740991,TN=/^(?:0|[1-9]\d*)$/;function BN(t,e){var r=typeof t;return e=e??SN,!!e&&(r=="number"||r!="symbol"&&TN.test(t))&&t>-1&&t%1==0&&t<e}var NN=BN;function DN(t,e,r,n){if(!Ln(t))return t;e=ep(e,t);for(var a=-1,i=e.length,s=i-1,l=t;l!=null&&++a<i;){var c=oc(e[a]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(a!=s){var d=l[c];u=n?n(d,c,l):void 0,u===void 0&&(u=Ln(d)?d:NN(e[a+1])?[]:{})}EN(l,c,u),l=l[c]}return t}var PN=DN;function _N(t,e,r){return t==null?t:PN(t,e,r)}var ON=_N;function IN(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var LN=IN;function MN(t){return Xo(t)?Yh(t,oc):wi(t)?[t]:LN(jh(Jh(t)))}var FN=MN,AN={data:function(e){var r={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({},r,e),function(a,i){var s=e,l=this,c=l.length!==void 0,u=c?l:[l],d=c?l[0]:l;if(be(a)){var f=a.indexOf(".")!==-1,p=f&&FN(a);if(s.allowGetting&&i===void 0){var v;return d&&(s.beforeGet(d),p&&d._private[s.field][a]===void 0?v=mN(d._private[s.field],p):v=d._private[s.field][a]),v}else if(s.allowSetting&&i!==void 0){var h=!s.immutableKeys[a];if(h){var g=Af({},a,i);s.beforeSet(l,g);for(var y=0,m=u.length;y<m;y++){var b=u[y];s.canSet(b)&&(p&&d._private[s.field][a]===void 0?ON(b._private[s.field],p,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,x,E=Object.keys(w);s.beforeSet(l,w);for(var k=0;k<E.length;k++){C=E[k],x=w[C];var B=!s.immutableKeys[C];if(B)for(var S=0;S<u.length;S++){var N=u[S];s.canSet(N)&&(N._private[s.field][C]=x)}}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 P;return d&&(s.beforeGet(d),P=d._private[s.field]),P}return l}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=xe({},r,e),function(a){var i=e,s=this,l=s.length!==void 0,c=l?s:[s];if(be(a)){for(var u=a.split(/\s+/),d=u.length,f=0;f<d;f++){var p=u[f];if(!nn(p)){var v=!i.immutableKeys[p];if(v)for(var h=0,g=c.length;h<g;h++)c[h]._private[i.field][p]=void 0}}i.triggerEvent&&s[i.triggerFnName](i.event)}else if(a===void 0){for(var y=0,m=c.length;y<m;y++)for(var b=c[y]._private[i.field],w=Object.keys(b),C=0;C<w.length;C++){var x=w[C],E=!i.immutableKeys[x];E&&(b[x]=void 0)}i.triggerEvent&&s[i.triggerFnName](i.event)}return s}}},VN={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(n,a){var i=this,s=Array.prototype.slice.call(arguments,0);return new ka(function(l,c){var u=function(v){i.off.apply(i,f),l(v)},d=s.concat([u]),f=d.concat([]);i.on.apply(i,d)})}}},Ve={};[DB,AN,VN].forEach(function(t){xe(Ve,t)});var RN={animate:Ve.animate(),animation:Ve.animation(),animated:Ve.animated(),clearQueue:Ve.clearQueue(),delay:Ve.delay(),delayAnimation:Ve.delayAnimation(),stop:Ve.stop()},es={classes:function(e){var r=this;if(e===void 0){var n=[];return r[0]._private.classes.forEach(function(h){return n.push(h)}),n}else Ke(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new va(e),s=0;s<r.length;s++){for(var l=r[s],c=l._private,u=c.classes,d=!1,f=0;f<e.length;f++){var p=e[f],v=u.has(p);if(!v){d=!0;break}}d||(d=u.size!==e.length),d&&(c.classes=i,a.push(l))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Ke(e)||(e=e.match(/\S+/g)||[]);for(var n=this,a=r===void 0,i=[],s=0,l=n.length;s<l;s++)for(var c=n[s],u=c._private.classes,d=!1,f=0;f<e.length;f++){var p=e[f],v=u.has(p),h=!1;r||a&&!v?(u.add(p),h=!0):(!r||a&&v)&&(u.delete(p),h=!0),!d&&h&&(i.push(c),d=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};es.className=es.classNames=es.classes;var Ie={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:lt,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,r;for(t=Ie.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],Ie.comparatorOp+="|@"+e;for(t=Ie.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(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},sc=[{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 XE(t.selector,e.selector)}),$N=function(){for(var t={},e,r=0;r<sc.length;r++)e=sc[r],t[e.selector]=e.matches;return t}(),zN=function(e,r){return $N[e](r)},HN="("+sc.map(function(t){return t.selector}).join("|")+")",Ta=function(e){return e.replace(new RegExp("\\\\("+Ie.metaChar+")","g"),function(r,n){return n})},cn=function(e,r,n){e[e.length-1]=n},lc=[{name:"group",query:!0,regex:"("+Ie.group+")",populate:function(e,r,n){var a=cr(n,1),i=a[0];r.checks.push({type:fe.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:HN,populate:function(e,r,n){var a=cr(n,1),i=a[0];r.checks.push({type:fe.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Ie.id+")",populate:function(e,r,n){var a=cr(n,1),i=a[0];r.checks.push({type:fe.ID,value:Ta(i)})}},{name:"className",query:!0,regex:"\\.("+Ie.className+")",populate:function(e,r,n){var a=cr(n,1),i=a[0];r.checks.push({type:fe.CLASS,value:Ta(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Ie.variable+")\\s*\\]",populate:function(e,r,n){var a=cr(n,1),i=a[0];r.checks.push({type:fe.DATA_EXIST,field:Ta(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Ie.variable+")\\s*("+Ie.comparatorOp+")\\s*("+Ie.value+")\\s*\\]",populate:function(e,r,n){var a=cr(n,3),i=a[0],s=a[1],l=a[2],c=new RegExp("^"+Ie.string+"$").exec(l)!=null;c?l=l.substring(1,l.length-1):l=parseFloat(l),r.checks.push({type:fe.DATA_COMPARE,field:Ta(i),operator:s,value:l})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Ie.boolOp+")\\s*("+Ie.variable+")\\s*\\]",populate:function(e,r,n){var a=cr(n,2),i=a[0],s=a[1];r.checks.push({type:fe.DATA_BOOL,field:Ta(s),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Ie.meta+")\\s*("+Ie.comparatorOp+")\\s*("+Ie.number+")\\s*\\]\\]",populate:function(e,r,n){var a=cr(n,3),i=a[0],s=a[1],l=a[2];r.checks.push({type:fe.META_COMPARE,field:Ta(i),operator:s,value:parseFloat(l)})}},{name:"nextQuery",separator:!0,regex:Ie.separator,populate:function(e,r){var n=e.currentSubject,a=e.edgeCount,i=e.compoundCount,s=e[e.length-1];n!=null&&(s.subject=n,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,r){if(e.currentSubject==null){var n=ze(),a=r,i=ze();return n.checks.push({type:fe.DIRECTED_EDGE,source:a,target:i}),cn(e,r,n),e.edgeCount++,i}else{var s=ze(),l=r,c=ze();return s.checks.push({type:fe.NODE_SOURCE,source:l,target:c}),cn(e,r,s),e.edgeCount++,c}}},{name:"undirectedEdge",separator:!0,regex:Ie.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=r,i=ze();return n.checks.push({type:fe.UNDIRECTED_EDGE,nodes:[a,i]}),cn(e,r,n),e.edgeCount++,i}else{var s=ze(),l=r,c=ze();return s.checks.push({type:fe.NODE_NEIGHBOR,node:l,neighbor:c}),cn(e,r,s),c}}},{name:"child",separator:!0,regex:Ie.child,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=ze(),i=e[e.length-1];return n.checks.push({type:fe.CHILD,parent:i,child:a}),cn(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var s=ze(),l=e[e.length-1],c=ze(),u=ze(),d=ze(),f=ze();return s.checks.push({type:fe.COMPOUND_SPLIT,left:l,right:c,subject:u}),u.checks=r.checks,r.checks=[{type:fe.TRUE}],f.checks.push({type:fe.TRUE}),c.checks.push({type:fe.PARENT,parent:f,child:d}),cn(e,l,s),e.currentSubject=u,e.compoundCount++,d}else{var p=ze(),v=ze(),h=[{type:fe.PARENT,parent:p,child:v}];return p.checks=r.checks,r.checks=h,e.compoundCount++,v}}},{name:"descendant",separator:!0,regex:Ie.descendant,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=ze(),i=e[e.length-1];return n.checks.push({type:fe.DESCENDANT,ancestor:i,descendant:a}),cn(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var s=ze(),l=e[e.length-1],c=ze(),u=ze(),d=ze(),f=ze();return s.checks.push({type:fe.COMPOUND_SPLIT,left:l,right:c,subject:u}),u.checks=r.checks,r.checks=[{type:fe.TRUE}],f.checks.push({type:fe.TRUE}),c.checks.push({type:fe.ANCESTOR,ancestor:f,descendant:d}),cn(e,l,s),e.currentSubject=u,e.compoundCount++,d}else{var p=ze(),v=ze(),h=[{type:fe.ANCESTOR,ancestor:p,descendant:v}];return p.checks=r.checks,r.checks=h,e.compoundCount++,v}}},{name:"subject",modifier:!0,regex:Ie.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return Ae("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var n=e[e.length-1],a=n.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)}}];lc.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var KN=function(e){for(var r,n,a,i=0;i<lc.length;i++){var s=lc[i],l=s.name,c=e.match(s.regexObj);if(c!=null){n=c,r=s,a=l;var u=c[0];e=e.substring(u.length);break}}return{expr:r,match:n,name:a,remaining:e}},qN=function(e){var r=e.match(/^\s+/);if(r){var n=r[0];e=e.substring(n.length)}return e},UN=function(e){var r=this,n=r.inputText=e,a=r[0]=ze();for(r.length=1,n=qN(n);;){var i=KN(n);if(i.expr==null)return Ae("The selector `"+e+"`is invalid"),!1;var s=i.match.slice(1),l=i.expr.populate(r,a,s);if(l===!1)return!1;if(l!=null&&(a=l),n=i.remaining,n.match(/^\s*$/))break}var c=r[r.length-1];r.currentSubject!=null&&(c.subject=r.currentSubject),c.edgeCount=r.edgeCount,c.compoundCount=r.compoundCount;for(var u=0;u<r.length;u++){var d=r[u];if(d.compoundCount>0&&d.edgeCount>0)return Ae("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(d.edgeCount>1)return Ae("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;d.edgeCount===1&&Ae("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},GN=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(d){return d??""},r=function(d){return be(d)?'"'+d+'"':e(d)},n=function(d){return" "+d+" "},a=function(d,f){var p=d.type,v=d.value;switch(p){case fe.GROUP:{var h=e(v);return h.substring(0,h.length-1)}case fe.DATA_COMPARE:{var g=d.field,y=d.operator;return"["+g+n(e(y))+r(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,x=d.field;return"[["+x+n(e(C))+r(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)+n(">")+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),k=i(d.subject,f),B=i(d.right,f);return E+(E.length>0?" ":"")+k+B}case fe.TRUE:return""}},i=function(d,f){return d.checks.reduce(function(p,v,h){return p+(f===d&&h===0?"$":"")+a(v,f)},"")},s="",l=0;l<this.length;l++){var c=this[l];s+=i(c,c.subject),this.length>1&&l<this.length-1&&(s+=", ")}return this.toStringCache=s,s},WN={parse:UN,toString:GN},rp=function(e,r,n){var a,i=be(e),s=le(e),l=be(n),c,u,d=!1,f=!1,p=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),f=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),d=!0),(i||l||d)&&(c=!i&&!s?"":""+e,u=""+n),d&&(e=c=c.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":a=c.indexOf(u)>=0;break;case"$=":a=c.indexOf(u,c.length-u.length)>=0;break;case"^=":a=c.indexOf(u)===0;break;case"=":a=e===n;break;case">":p=!0,a=e>n;break;case">=":p=!0,a=e>=n;break;case"<":p=!0,a=e<n;break;case"<=":p=!0,a=e<=n;break;default:a=!1;break}return f&&(e!=null||!p)&&(a=!a),a},jN=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},YN=function(e){return e!==void 0},cc=function(e,r){return e.data(r)},ZN=function(e,r){return e[r]()},Xe=[],je=function(e,r){return e.checks.every(function(n){return Xe[n.type](n,r)})};Xe[fe.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()},Xe[fe.STATE]=function(t,e){var r=t.value;return zN(r,e)},Xe[fe.ID]=function(t,e){var r=t.value;return e.id()===r},Xe[fe.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)},Xe[fe.META_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return rp(ZN(e,r),n,a)},Xe[fe.DATA_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return rp(cc(e,r),n,a)},Xe[fe.DATA_BOOL]=function(t,e){var r=t.field,n=t.operator;return jN(cc(e,r),n)},Xe[fe.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,YN(cc(e,r))},Xe[fe.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],n=t.nodes[1],a=e.source(),i=e.target();return je(r,a)&&je(n,i)||je(n,a)&&je(r,i)},Xe[fe.NODE_NEIGHBOR]=function(t,e){return je(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&je(t.neighbor,r)})},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(r){return r.isNode()&&je(t.target,r)})},Xe[fe.NODE_TARGET]=function(t,e){return je(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&je(t.source,r)})},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(r){return je(t.child,r)})},Xe[fe.DESCENDANT]=function(t,e){return je(t.descendant,e)&&e.ancestors().some(function(r){return je(t.ancestor,r)})},Xe[fe.ANCESTOR]=function(t,e){return je(t.ancestor,e)&&e.descendants().some(function(r){return je(t.descendant,r)})},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 r=t.value;return r.has(e)},Xe[fe.FILTER]=function(t,e){var r=t.value;return r(e)};var XN=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===fe.ID)return e.getElementById(r[0].checks[0].value).collection();var n=function(i){for(var s=0;s<r.length;s++){var l=r[s];if(je(l,i))return!0}return!1};return r.text()==null&&(n=function(){return!0}),e.filter(n)},QN=function(e){for(var r=this,n=0;n<r.length;n++){var a=r[n];if(je(a,e))return!0}return!1},JN={matches:QN,filter:XN},un=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 "))},dn=un.prototype;[WN,JN].forEach(function(t){return xe(dn,t)}),dn.text=function(){return this.inputText},dn.size=function(){return this.length},dn.eq=function(t){return this[t]},dn.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()},dn.addQuery=function(t){this[this.length++]=t},dn.selector=dn.toString;var fn={allAre:function(e){var r=new un(e);return this.every(function(n){return r.matches(n)})},is:function(e){var r=new un(e);return this.some(function(n){return r.matches(n)})},some:function(e,r){for(var n=0;n<this.length;n++){var a=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(a)return!0}return!1},every:function(e,r){for(var n=0;n<this.length;n++){var a=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(!a)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,n=e.length;return r!==n?!1:r===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(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(n){return r.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(n){return r.hasElementWithId(n.id())})}};fn.allAreNeighbours=fn.allAreNeighbors,fn.has=fn.contains,fn.equal=fn.equals=fn.same;var Qt=function(e,r){return function(a,i,s,l){var c=a,u=this,d;if(c==null?d="":Ut(c)&&c.length===1&&(d=c.id()),u.length===1&&d){var f=u[0]._private,p=f.traversalCache=f.traversalCache||{},v=p[r]=p[r]||[],h=Mn(d),g=v[h];return g||(v[h]=e.call(u,a,i,s,l))}else return e.call(u,a,i,s,l)}},Ba={parent:function(e){var r=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var a=0;a<this.length;a++){var i=this[a],s=i._private.parent;s&&r.push(s)}return this.spawn(r,!0).filter(e)},parents:function(e){for(var r=[],n=this.parent();n.nonempty();){for(var a=0;a<n.length;a++){var i=n[a];r.push(i)}n=n.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){for(var r,n=0;n<this.length;n++){var a=this[n],i=a.parents();r=r||i,r=r.intersect(i)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:Qt(function(t){for(var e=[],r=0;r<this.length;r++)for(var n=this[r],a=n._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 r=[];function n(a){for(var i=0;i<a.length;i++){var s=a[i];r.push(s),s.children().nonempty()&&n(s.children())}}return n(this.children()),this.spawn(r,!0).filter(e)}};function uc(t,e,r,n){for(var a=[],i=new va,s=t.cy(),l=s.hasCompoundNodes(),c=0;c<t.length;c++){var u=t[c];r?a.push(u):l&&n(a,i,u)}for(;a.length>0;){var d=a.shift();e(d),i.add(d.id()),l&&n(a,i,d)}return t}function np(t,e,r){if(r.isParent())for(var n=r._private.children,a=0;a<n.length;a++){var i=n[a];e.has(i.id())||t.push(i)}}Ba.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return uc(this,t,e,np)};function ap(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}Ba.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return uc(this,t,e,ap)};function e4(t,e,r){ap(t,e,r),np(t,e,r)}Ba.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return uc(this,t,e,e4)},Ba.ancestors=Ba.parents;var _i,ip;_i=ip={data:Ve.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:Ve.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ve.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ve.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ve.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ve.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},_i.attr=_i.data,_i.removeAttr=_i.removeData;var t4=ip,ts={};function dc(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,a=r[0],i=a._private.edges,s=0;s<i.length;s++){var l=i[s];!e&&l.isLoop()||(n+=t(a,l))}return n}else return}}xe(ts,{degree:dc(function(t,e){return e.source().same(e.target())?2:1}),indegree:dc(function(t,e){return e.target().same(t)?1:0}),outdegree:dc(function(t,e){return e.source().same(t)?1:0})});function Na(t,e){return function(r){for(var n,a=this.nodes(),i=0;i<a.length;i++){var s=a[i],l=s[t](r);l!==void 0&&(n===void 0||e(l,n))&&(n=l)}return n}}xe(ts,{minDegree:Na("degree",function(t,e){return t<e}),maxDegree:Na("degree",function(t,e){return t>e}),minIndegree:Na("indegree",function(t,e){return t<e}),maxIndegree:Na("indegree",function(t,e){return t>e}),minOutdegree:Na("outdegree",function(t,e){return t<e}),maxOutdegree:Na("outdegree",function(t,e){return t>e})}),xe(ts,{totalDegree:function(e){for(var r=0,n=this.nodes(),a=0;a<n.length;a++)r+=n[a].degree(e);return r}});var dr,op,sp=function(e,r,n){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var s=i._private.position,l={x:r.x!=null?r.x-s.x:0,y:r.y!=null?r.y-s.y:0};i.isParent()&&!(l.x===0&&l.y===0)&&i.children().shift(l,n),i.dirtyBoundingBoxCache()}}},lp={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,r){sp(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};dr=op={position:Ve.data(lp),silentPosition:Ve.data(xe({},lp,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){sp(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(Oe(e))r?this.silentPosition(e):this.position(e);else if(Ye(e)){var n=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var s=this[i],l=void 0;(l=n(s,i))&&(r?s.silentPosition(l):s.position(l))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,n){var a;if(Oe(e)?(a={x:le(e.x)?e.x:0,y:le(e.y)?e.y:0},n=r):be(e)&&le(r)&&(a={x:0,y:0},a[e]=r),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 c=l.position(),u={x:c.x+a.x,y:c.y+a.y};n?l.silentPosition(u):l.position(u)}}i.endBatch()}return this},silentShift:function(e,r){return Oe(e)?this.shift(e,!0):be(e)&&le(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var n=this[0],a=this.cy(),i=a.zoom(),s=a.pan(),l=Oe(e)?e:void 0,c=l!==void 0||r!==void 0&&be(e);if(n&&n.isNode())if(c)for(var u=0;u<this.length;u++){var d=this[u];r!==void 0?d.position(e,(r-s[e])/i):l!==void 0&&d.position(fh(l,i,s))}else{var f=n.position();return l=Ro(f,i,s),e===void 0?l:l[e]}else if(!c)return;return this},relativePosition:function(e,r){var n=this[0],a=this.cy(),i=Oe(e)?e:void 0,s=i!==void 0||r!==void 0&&be(e),l=a.hasCompoundNodes();if(n&&n.isNode())if(s)for(var c=0;c<this.length;c++){var u=this[c],d=l?u.parent():null,f=d&&d.length>0,p=f;f&&(d=d[0]);var v=p?d.position():{x:0,y:0};r!==void 0?u.position(e,r+v[e]):i!==void 0&&u.position({x:i.x+v.x,y:i.y+v.y})}else{var h=n.position(),g=l?n.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:h.x-b.x,y:h.y-b.y},e===void 0?i:i[e]}else if(!s)return;return this}},dr.modelPosition=dr.point=dr.position,dr.modelPositions=dr.points=dr.positions,dr.renderedPoint=dr.renderedPosition,dr.relativePoint=dr.relativePosition;var r4=op,Da,hn;Da=hn={},hn.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),a=r.pan(),i=e.x1*n+a.x,s=e.x2*n+a.x,l=e.y1*n+a.y,c=e.y2*n+a.y;return{x1:i,x2:s,y1:l,y2:c,w:s-i,h:c-l}},hn.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(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)},hn.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 r(s){if(!s.isParent())return;var l=s._private,c=s.children(),u=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=c.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),p=l.position;(f.w===0||f.h===0)&&(f={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},f.x1=p.x-f.w/2,f.x2=p.x+f.w/2,f.y1=p.y-f.h/2,f.y2=p.y+f.h/2);function v(S,N,D){var P=0,I=0,_=N+D;return S>0&&_>0&&(P=N/_*S,I=D/_*S),{biasDiff:P,biasComplementDiff:I}}function h(S,N,D,P){if(D.units==="%")switch(P){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,x=w.biasComplementDiff,E=v(d.height.val-f.h,m,b),k=E.biasDiff,B=E.biasComplementDiff;l.autoPadding=h(f.w,f.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),l.autoWidth=Math.max(f.w,d.width.val),p.x=(-C+f.x1+f.x2+x)/2,l.autoHeight=Math.max(f.h,d.height.val),p.y=(-k+f.y1+f.y2+B)/2}for(var n=0;n<this.length;n++){var a=this[n],i=a._private;(!i.compoundBoundsClean||t)&&(r(a),e.batching()||(i.compoundBoundsClean=!0))}return this};var Jt=function(e){return e===1/0||e===-1/0?0:e},fr=function(e,r,n,a,i){a-r===0||i-n===0||r==null||n==null||a==null||i==null||(e.x1=r<e.x1?r:e.x1,e.x2=a>e.x2?a:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},zn=function(e,r){return r==null?e:fr(e,r.x1,r.y1,r.x2,r.y2)},Oi=function(e,r,n){return ur(e,r,n)},rs=function(e,r,n){if(!r.cy().headless()){var a=r._private,i=a.rstyle,s=i.arrowWidth/2,l=r.pstyle(n+"-arrow-shape").value,c,u;if(l!=="none"){n==="source"?(c=i.srcX,u=i.srcY):n==="target"?(c=i.tgtX,u=i.tgtY):(c=i.midX,u=i.midY);var d=a.arrowBounds=a.arrowBounds||{},f=d[n]=d[n]||{};f.x1=c-s,f.y1=u-s,f.x2=c+s,f.y2=u+s,f.w=f.x2-f.x1,f.h=f.y2-f.y1,zo(f,1),fr(e,f.x1,f.y1,f.x2,f.y2)}}},fc=function(e,r,n){if(!r.cy().headless()){var a;n?a=n+"-":a="";var i=r._private,s=i.rstyle,l=r.pstyle(a+"label").strValue;if(l){var c=r.pstyle("text-halign"),u=r.pstyle("text-valign"),d=Oi(s,"labelWidth",n),f=Oi(s,"labelHeight",n),p=Oi(s,"labelX",n),v=Oi(s,"labelY",n),h=r.pstyle(a+"text-margin-x").pfValue,g=r.pstyle(a+"text-margin-y").pfValue,y=r.isEdge(),m=r.pstyle(a+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,w=r.pstyle("text-border-width").pfValue,C=w/2,x=r.pstyle("text-background-padding").pfValue,E=2,k=f,B=d,S=B/2,N=k/2,D,P,I,_;if(y)D=p-S,P=p+S,I=v-N,_=v+N;else{switch(c.value){case"left":D=p-B,P=p;break;case"center":D=p-S,P=p+S;break;case"right":D=p,P=p+B;break}switch(u.value){case"top":I=v-k,_=v;break;case"center":I=v-N,_=v+N;break;case"bottom":I=v,_=v+k;break}}D+=h-Math.max(b,C)-x-E,P+=h+Math.max(b,C)+x+E,I+=g-Math.max(b,C)-x-E,_+=g+Math.max(b,C)+x+E;var F=n||"main",O=i.labelBounds,M=O[F]=O[F]||{};M.x1=D,M.y1=I,M.x2=P,M.y2=_,M.w=P-D,M.h=_-I;var L=y&&m.strValue==="autorotate",V=m.pfValue!=null&&m.pfValue!==0;if(L||V){var H=L?Oi(i.rstyle,"labelAngle",n):m.pfValue,$=Math.cos(H),z=Math.sin(H),j=(D+P)/2,ee=(I+_)/2;if(!y){switch(c.value){case"left":j=P;break;case"right":j=D;break}switch(u.value){case"top":ee=_;break;case"bottom":ee=I;break}}var J=function(he,ne){return he=he-j,ne=ne-ee,{x:he*$-ne*z+j,y:he*z+ne*$+ee}},X=J(D,I),re=J(D,_),Y=J(P,I),A=J(P,_);D=Math.min(X.x,re.x,Y.x,A.x),P=Math.max(X.x,re.x,Y.x,A.x),I=Math.min(X.y,re.y,Y.y,A.y),_=Math.max(X.y,re.y,Y.y,A.y)}var K=F+"Rot",W=O[K]=O[K]||{};W.x1=D,W.y1=I,W.x2=P,W.y2=_,W.w=P-D,W.h=_-I,fr(e,D,I,P,_),fr(i.labelBounds.all,D,I,P,_)}return e}},n4=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,a=r.pstyle("outline-width").value;if(n>0&&a>0){var i=r.pstyle("outline-offset").value,s=r.pstyle("shape").value,l=a+i,c=(e.w+l*2)/e.w,u=(e.h+l*2)/e.h,d=0,f=0;["diamond","pentagon","round-triangle"].includes(s)?(c=(e.w+l*2.4)/e.w,f=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?c=(e.w+l*2.4)/e.w:s==="star"?(c=(e.w+l*2.8)/e.w,u=(e.h+l*2.6)/e.h,f=-l/3.8):s==="triangle"?(c=(e.w+l*2.8)/e.w,u=(e.h+l*2.4)/e.h,f=-l/1.4):s==="vee"&&(c=(e.w+l*4.4)/e.w,u=(e.h+l*3.8)/e.h,f=-l*.5);var p=e.h*u-e.h,v=e.w*c-e.w;if(Ho(e,[Math.ceil(p/2),Math.ceil(v/2)]),d!=0||f!==0){var h=ET(e,d,f);ph(e,h)}}}},a4=function(e,r){var n=e._private.cy,a=n.styleEnabled(),i=n.headless(),s=zt(),l=e._private,c=e.isNode(),u=e.isEdge(),d,f,p,v,h,g,y=l.rstyle,m=c&&a?e.pstyle("bounds-expansion").pfValue:[0],b=function(ue){return ue.pstyle("display").value!=="none"},w=!a||b(e)&&(!u||b(e.source())&&b(e.target()));if(w){var C=0,x=0;a&&r.includeOverlays&&(C=e.pstyle("overlay-opacity").value,C!==0&&(x=e.pstyle("overlay-padding").value));var E=0,k=0;a&&r.includeUnderlays&&(E=e.pstyle("underlay-opacity").value,E!==0&&(k=e.pstyle("underlay-padding").value));var B=Math.max(x,k),S=0,N=0;if(a&&(S=e.pstyle("width").pfValue,N=S/2),c&&r.includeNodes){var D=e.position();h=D.x,g=D.y;var P=e.outerWidth(),I=P/2,_=e.outerHeight(),F=_/2;d=h-I,f=h+I,p=g-F,v=g+F,fr(s,d,p,f,v),a&&r.includeOutlines&&n4(s,e)}else if(u&&r.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),p=Math.min(y.srcY,y.midY,y.tgtY),v=Math.max(y.srcY,y.midY,y.tgtY),d-=N,f+=N,p-=N,v+=N,fr(s,d,p,f,v),O==="haystack"){var M=y.haystackPts;if(M&&M.length===2){if(d=M[0].x,p=M[0].y,f=M[1].x,v=M[1].y,d>f){var L=d;d=f,f=L}if(p>v){var V=p;p=v,v=V}fr(s,d-N,p-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,p=z.y-N,v=z.y+N,fr(s,d,p,f,v)}}}else{var j=e.source(),ee=j.position(),J=e.target(),X=J.position();if(d=ee.x,f=X.x,p=ee.y,v=X.y,d>f){var re=d;d=f,f=re}if(p>v){var Y=p;p=v,v=Y}d-=N,f+=N,p-=N,v+=N,fr(s,d,p,f,v)}if(a&&r.includeEdges&&u&&(rs(s,e,"mid-source"),rs(s,e,"mid-target"),rs(s,e,"source"),rs(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;fr(s,s.x1+K,s.y1+W,s.x2+K,s.y2+W)}}var oe=l.bodyBounds=l.bodyBounds||{};vh(oe,s),Ho(oe,m),zo(oe,1),a&&(d=s.x1,f=s.x2,p=s.y1,v=s.y2,fr(s,d-B,p-B,f+B,v+B));var he=l.overlayBounds=l.overlayBounds||{};vh(he,s),Ho(he,m),zo(he,1);var ne=l.labelBounds=l.labelBounds||{};ne.all!=null?xT(ne.all):ne.all=zt(),a&&r.includeLabels&&(r.includeMainLabels&&fc(s,e,null),u&&(r.includeSourceLabels&&fc(s,e,"source"),r.includeTargetLabels&&fc(s,e,"target")))}return s.x1=Jt(s.x1),s.y1=Jt(s.y1),s.x2=Jt(s.x2),s.y2=Jt(s.y2),s.w=Jt(s.x2-s.x1),s.h=Jt(s.y2-s.y1),s.w>0&&s.h>0&&w&&(Ho(s,m),zo(s,1)),s},cp=function(e){var r=0,n=function(s){return(s?1:0)<<r++},a=0;return a+=n(e.incudeNodes),a+=n(e.includeEdges),a+=n(e.includeLabels),a+=n(e.includeMainLabels),a+=n(e.includeSourceLabels),a+=n(e.includeTargetLabels),a+=n(e.includeOverlays),a+=n(e.includeOutlines),a},up=function(e){if(e.isEdge()){var r=e.source().position(),n=e.target().position(),a=function(s){return Math.round(s)};return qS([a(r.x),a(r.y),a(n.x),a(n.y)])}else return 0},dp=function(e,r){var n=e._private,a,i=e.isEdge(),s=r==null?fp:cp(r),l=s===fp,c=up(e),u=n.bbCachePosKey===c,d=r.useCache&&u,f=function(g){return g._private.bbCache==null||g._private.styleDirty},p=!d||f(e)||i&&f(e.source())||f(e.target());if(p?(u||e.recalculateRenderedStyle(d),a=a4(e,Ii),n.bbCache=a,n.bbCachePosKey=c):a=n.bbCache,!l){var v=e.isNode();a=zt(),(r.includeNodes&&v||r.includeEdges&&!v)&&(r.includeOverlays?zn(a,n.overlayBounds):zn(a,n.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?zn(a,n.labelBounds.all):(r.includeMainLabels&&zn(a,n.labelBounds.mainRot),r.includeSourceLabels&&zn(a,n.labelBounds.sourceRot),r.includeTargetLabels&&zn(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},Ii={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},fp=cp(Ii),hp=wt(Ii);hn.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=Ii:t=hp(t),e=dp(this[0],t);else{e=zt(),t=t||Ii;var r=hp(t),n=this,a=n.cy(),i=a.styleEnabled();if(i)for(var s=0;s<n.length;s++){var l=n[s],c=l._private,u=up(l),d=c.bbCachePosKey===u,f=r.useCache&&d&&!c.styleDirty;l.recalculateRenderedStyle(f)}this.updateCompoundBounds(!t.useCache);for(var p=0;p<n.length;p++){var v=n[p];zn(e,dp(v,r))}}return e.x1=Jt(e.x1),e.y1=Jt(e.y1),e.x2=Jt(e.x2),e.y2=Jt(e.y2),e.w=Jt(e.x2-e.x1),e.h=Jt(e.y2-e.y1),e},hn.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},hn.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),n=r.hasCompoundNodes(),a=r.collection();if(n&&(a=e.filter(function(u){return u.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};r.startBatch(),e.forEach(s).silentPositions(t),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var c=kT(this.boundingBox({useCache:!1}));return e.silentPositions(l),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),r.endBatch(),c},Da.boundingbox=Da.bb=Da.boundingBox,Da.renderedBoundingbox=Da.renderedBoundingBox;var i4=hn,Li,Mi;Li=Mi={};var pp=function(e){e.uppercaseName=Gf(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=Gf(e.outerName),Li[e.name]=function(){var n=this[0],a=n._private,i=a.cy,s=i._private.styleEnabled;if(n)if(s){if(n.isParent())return n.updateCompoundBounds(),a[e.autoName]||0;var l=n.pstyle(e.name);switch(l.strValue){case"label":return n.recalculateRenderedStyle(),a.rstyle[e.labelName]||0;default:return l.pfValue}}else return 1},Li["outer"+e.uppercaseName]=function(){var n=this[0],a=n._private,i=a.cy,s=i._private.styleEnabled;if(n)if(s){var l=n[e.name](),c=n.pstyle("border-width").pfValue,u=2*n.padding();return l+c+u}else return 1},Li["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},Li["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};pp({name:"width"}),pp({name:"height"}),Mi.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},Mi.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()},Mi.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var o4=Mi,s4=function(e,r){if(e.isEdge())return r(e)},l4=function(e,r){if(e.isEdge()){var n=e.cy();return Ro(r(e),n.zoom(),n.pan())}},c4=function(e,r){if(e.isEdge()){var n=e.cy(),a=n.pan(),i=n.zoom();return r(e).map(function(s){return Ro(s,i,a)})}},u4=function(e){return e.renderer().getControlPoints(e)},d4=function(e){return e.renderer().getSegmentPoints(e)},f4=function(e){return e.renderer().getSourceEndpoint(e)},h4=function(e){return e.renderer().getTargetEndpoint(e)},p4=function(e){return e.renderer().getEdgeMidpoint(e)},vp={controlPoints:{get:u4,mult:!0},segmentPoints:{get:d4,mult:!0},sourceEndpoint:{get:f4},targetEndpoint:{get:h4},midpoint:{get:p4}},v4=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},g4=Object.keys(vp).reduce(function(t,e){var r=vp[e],n=v4(e);return t[e]=function(){return s4(this,r.get)},r.mult?t[n]=function(){return c4(this,r.get)}:t[n]=function(){return l4(this,r.get)},t},{}),m4=xe({},r4,i4,o4,g4);/*!
27
27
  Event object based on jQuery events, MIT license
28
28
 
29
29
  https://jquery.org/license/
30
30
  https://tldrlegal.com/license/mit-license
31
31
  https://github.com/jquery/jquery/blob/master/src/event.js
32
- */var vp=function(e,r){this.recycle(e,r)};function Fi(){return!1}function ns(){return!0}vp.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Fi,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?ns:Fi):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*a+i.x,y:n.y*a+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=ns;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=ns;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ns,this.stopPropagation()},isDefaultPrevented:Fi,isPropagationStopped:Fi,isImmediatePropagationStopped:Fi};var gp=/^([^.]+)(\.(?:[^.]+))?$/,y4=".*",mp={qualifierCompare:function(e,r){return e===r},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},yp=Object.keys(mp),b4={};function as(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b4,e=arguments.length>1?arguments[1]:void 0,r=0;r<yp.length;r++){var n=yp[r];this[n]=t[n]||mp[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var pn=as.prototype,bp=function(e,r,n,a,i,s,l){Ye(a)&&(i=a,a=null),l&&(s==null?s=l:s=xe({},s,l));for(var c=Ke(n)?n:n.split(/\s+/),u=0;u<c.length;u++){var d=c[u];if(!nn(d)){var f=d.match(gp);if(f){var p=f[1],v=f[2]?f[2]:null,h=r(e,d,p,v,a,i,s);if(h===!1)break}}}},wp=function(e,r){return e.addEventFields(e.context,r),new vp(r.type,r)},w4=function(e,r,n){if($E(n)){r(e,n);return}else if(Oe(n)){r(e,wp(e,n));return}for(var a=Ke(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var s=a[i];if(!nn(s)){var l=s.match(gp);if(l){var c=l[1],u=l[2]?l[2]:null,d=wp(e,{type:c,namespace:u,target:e.context});r(e,d)}}}};pn.on=pn.addListener=function(t,e,r,n,a){return bp(this,function(i,s,l,c,u,d,f){Ye(d)&&i.listeners.push({event:s,callback:d,type:l,namespace:c,qualifier:u,conf:f})},t,e,r,n,a),this},pn.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})},pn.removeListener=pn.off=function(t,e,r,n){var a=this;this.emitting!==0&&(this.listeners=YS(this.listeners));for(var i=this.listeners,s=function(u){var d=i[u];bp(a,function(f,p,v,h,g,y){if((d.type===v||t==="*")&&(!h&&d.namespace!==".*"||d.namespace===h)&&(!g||f.qualifierCompare(d.qualifier,g))&&(!y||d.callback===y))return i.splice(u,1),!1},t,e,r,n)},l=i.length-1;l>=0;l--)s(l);return this},pn.removeAllListeners=function(){return this.removeListener("*")},pn.emit=pn.trigger=function(t,e,r){var n=this.listeners,a=n.length;return this.emitting++,Ke(e)||(e=[e]),w4(this,function(i,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],a=n.length);for(var l=function(d){var f=n[d];if(f.type===s.type&&(!f.namespace||f.namespace===s.namespace||f.namespace===y4)&&i.eventMatches(i.context,f,s)){var p=[s];e!=null&&XS(p,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),h=f.callback.apply(v,p);i.afterEmit(i.context,f,s),h===!1&&(s.stopPropagation(),s.preventDefault())}},c=0;c<a;c++)l(c);i.bubble(i.context)&&!s.isPropagationStopped()&&i.parent(i.context).emit(s,e)},t),this.emitting--,this};var C4={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&gi(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e},beforeEmit:function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},is=function(e){return be(e)?new un(e):e},Cp={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],n=r._private;n.emitter||(n.emitter=new as(C4,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,n){for(var a=is(r),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,n)}return this},removeListener:function(e,r,n){for(var a=is(r),i=0;i<this.length;i++){var s=this[i];s.emitter().removeListener(e,a,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,n){for(var a=is(r),i=0;i<this.length;i++){var s=this[i];s.emitter().one(e,a,n)}return this},once:function(e,r,n){for(var a=is(r),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,n,{once:!0,onceCollection:this})}},emit:function(e,r){for(var n=0;n<this.length;n++){var a=this[n];a.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this}};Ve.eventAliasesOn(Cp);var kp={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),r=this.spawn(),n=0;n<this.length;n++){var a=this[n];a.isNode()?e.push(a):r.push(a)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(be(e)||Ut(e))return new un(e).filter(this);if(Ye(e)){for(var n=this.spawn(),a=this,i=0;i<a.length;i++){var s=a[i],l=r?e.apply(r,[s,i,a]):e(s,i,a);l&&n.push(s)}return n}return this.spawn()},not:function(e){if(e){be(e)&&(e=this.filter(e));for(var r=this.spawn(),n=0;n<this.length;n++){var a=this[n],i=e.has(a);i||r.push(a)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(be(e)){var r=e;return this.filter(r)}for(var n=this.spawn(),a=this,i=e,s=this.length<e.length,l=s?a:i,c=s?i:a,u=0;u<l.length;u++){var d=l[u];c.has(d)&&n.push(d)}return n},xor:function(e){var r=this._private.cy;be(e)&&(e=r.$(e));var n=this.spawn(),a=this,i=e,s=function(c,u){for(var d=0;d<c.length;d++){var f=c[d],p=f._private.data.id,v=u.hasElementWithId(p);v||n.push(f)}};return s(a,i),s(i,a),n},diff:function(e){var r=this._private.cy;be(e)&&(e=r.$(e));var n=this.spawn(),a=this.spawn(),i=this.spawn(),s=this,l=e,c=function(d,f,p){for(var v=0;v<d.length;v++){var h=d[v],g=h._private.data.id,y=f.hasElementWithId(g);y?i.merge(h):p.push(h)}};return c(s,l,n),c(l,s,a),{left:n,right:a,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(be(e)){var n=e;e=r.mutableElements().filter(n)}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 r=this._private,n=r.cy;if(!e)return this;if(e&&be(e)){var a=e;e=n.mutableElements().filter(a)}for(var i=r.map,s=0;s<e.length;s++){var l=e[s],c=l._private.data.id,u=!i.has(c);if(u){var d=this.length++;this[d]=l,i.set(c,{ele:l,index:d})}}return this},unmergeAt:function(e){var r=this[e],n=r.id(),a=this._private,i=a.map;this[e]=void 0,i.delete(n);var s=e===this.length-1;if(this.length>1&&!s){var l=this.length-1,c=this[l],u=c._private.data.id;this[l]=void 0,this[e]=c,i.set(u,{ele:c,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,a=r.map,i=a.get(n);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&be(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=0;a<e.length;a++)this.unmergeOne(e[a]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],a=this,i=0;i<a.length;i++){var s=a[i],l=r?e.apply(r,[s,i,a]):e(s,i,a);n.push(l)}return n},reduce:function(e,r){for(var n=r,a=this,i=0;i<a.length;i++)n=e(n,a[i],i,a);return n},max:function(e,r){for(var n=-1/0,a,i=this,s=0;s<i.length;s++){var l=i[s],c=r?e.apply(r,[l,s,i]):e(l,s,i);c>n&&(n=c,a=l)}return{value:n,ele:a}},min:function(e,r){for(var n=1/0,a,i=this,s=0;s<i.length;s++){var l=i[s],c=r?e.apply(r,[l,s,i]):e(l,s,i);c<n&&(n=c,a=l)}return{value:n,ele:a}}},Le=kp;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 k4={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}},xp=function(e,r){var n=e.cy(),a=n.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"?Kl:0}var s=i(e)-i(r);if(s!==0)return s;function l(d){var f=d.pstyle("z-index-compare");return f.value==="auto"&&d.isNode()?1:0}var c=l(e)-l(r);if(c!==0)return c;var u=e.pstyle("z-index").value-r.pstyle("z-index").value;return u!==0?u:e.poolIndex()-r.poolIndex()},os={forEach:function(e,r){if(Ye(e))for(var n=this.length,a=0;a<n;a++){var i=this[a],s=r?e.apply(r,[i,a,this]):e(i,a,this);if(s===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var n=[],a=this.length;r==null&&(r=a),e==null&&(e=0),e<0&&(e=a+e),r<0&&(r=a+r);for(var i=e;i>=0&&i<r&&i<a;i++)n.push(this[i]);return this.spawn(n)},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 r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(xp)},zDepth:function(){var e=this[0];if(e){var r=e._private,n=r.group;if(n==="nodes"){var a=r.data.parent?e.parents().size():0;return e.isParent()?a:Kl-1}else{var i=r.source,s=r.target,l=i.zDepth(),c=s.zDepth();return Math.max(l,c,0)}}}};os.each=os.forEach;var x4=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":ot(Symbol))!=e&&ot(Symbol.iterator)!=e;r&&(os[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,s=this.length;return Ff({next:function(){return i<s?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};x4();var E4=wt({nodeDimensionsIncludeLabels:!1}),ss={layoutDimensions:function(e){e=E4(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();r={w:n.w,h:n.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,n){var a=this.nodes().filter(function(x){return!x.isParent()}),i=this.cy(),s=r.eles,l=function(E){return E.id()},c=mi(n,l);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(E,k,B){var S={x:k.x1+k.w/2,y:k.y1+k.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=r.spacingFactor&&r.spacingFactor!==1,f=function(){if(!d)return null;for(var E=zt(),k=0;k<a.length;k++){var B=a[k],S=c(B,k);ST(E,S.x,S.y)}return E},p=f(),v=mi(function(x,E){var k=c(x,E);if(d){var B=Math.abs(r.spacingFactor);k=u(B,p,k)}return r.transform!=null&&(k=r.transform(x,k)),k},l);if(r.animate){for(var h=0;h<a.length;h++){var g=a[h],y=v(g,h),m=r.animateFilter==null||r.animateFilter(g,h);if(m){var b=g.animation({position:y,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else g.position(y)}if(r.fit){var w=i.animation({fit:{boundingBox:s.boundingBoxAt(v),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(w)}else if(r.zoom!==void 0&&r.pan!==void 0){var C=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(C)}e.animations.forEach(function(x){return x.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),ka.all(e.animations.map(function(x){return x.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(v),r.fit&&i.fit(r.eles,r.padding),r.zoom!=null&&i.zoom(r.zoom),r.pan&&i.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var r=this.cy();return r.makeLayout(xe({},e,{eles:this}))}};ss.createLayout=ss.makeLayout=ss.layout;function Ep(t,e,r){var n=r._private,a=n.styleCache=n.styleCache||[],i;return(i=a[t])!=null||(i=a[t]=e(r)),i}function ls(t,e){return t=Mn(t),function(n){return Ep(t,e,n)}}function cs(t,e){t=Mn(t);var r=function(a){return e.call(a)};return function(){var a=this[0];if(a)return Ep(t,r,a)}}var Ct={recalculateRenderedStyle:function(e){var r=this.cy(),n=r.renderer(),a=r.styleEnabled();return n&&a&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(r)}else this.forEach(function(a){r(a),a.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var n=r._private.batchStyleEles;return n.merge(this),this}var a=r.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 r=0;r<this.length;r++){var n=this[r];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],a=n.cy();if(a.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return i??(r?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var a=!1,i=n.style();if(Oe(e)){var s=e;i.applyBypass(this,s,a),this.emitAndNotify("style")}else if(be(e))if(r===void 0){var l=this[0];return l?i.getStylePropertyValue(l,e):void 0}else i.applyBypass(this,e,r,a),this.emitAndNotify("style");else if(e===void 0){var c=this[0];return c?i.getRawStyle(c):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,a=r.style(),i=this;if(e===void 0)for(var s=0;s<i.length;s++){var l=i[s];a.removeAllBypasses(l,n)}else{e=e.split(/\s+/);for(var c=0;c<i.length;c++){var u=i[c];a.removeBypasses(u,e,n)}}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 r=e.hasCompoundNodes(),n=this[0];if(n){var a=n._private,i=n.pstyle("opacity").value;if(!r)return i;var s=a.data.parent?n.parents():null;if(s)for(var l=0;l<s.length;l++){var c=s[l],u=c.pstyle("opacity").value;i=u*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],n=r.cy().hasCompoundNodes();if(r)return n?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function hc(t,e){var r=t._private,n=r.data.parent?t.parents():null;if(n)for(var a=0;a<n.length;a++){var i=n[a];if(!e(i))return!1}return!0}function pc(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,n=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||hc(i,n);var c=l.source,u=l.target;return r(c)&&(!s||hc(c,r))&&(c===u||r(u)&&(!s||hc(u,r)))}}}var Pa=ls("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Ct.takesUpSpace=cs("takesUpSpace",pc({ok:Pa}));var S4=ls("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Pa(t)}),T4=ls("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Pa(t)});Ct.interactive=cs("interactive",pc({ok:S4,parentOk:T4,edgeOkViaNode:Pa})),Ct.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var B4=ls("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Pa(t)}),N4=Pa;Ct.visible=cs("visible",pc({ok:B4,edgeOkViaNode:N4})),Ct.hidden=function(){var t=this[0];if(t)return!t.visible()},Ct.isBundledBezier=cs("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 vn={};function Sp(t){return function(){var e=arguments,r=[];if(e.length===2){var n=e[0],a=e[1];this.on(t.event,n,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 c=this[l],u=!t.ableField||c._private[t.ableField],d=c._private[t.field]!=t.value;if(t.overrideAble){var f=t.overrideAble(c);if(f!==void 0&&(u=f,!f))return this}u&&(c._private[t.field]=t.value,d&&r.push(c))}var p=this.spawn(r);p.updateStyle(),p.emit(t.event),s&&p.emit(s)}return this}}function _a(t){vn[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},vn[t.on]=Sp({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),vn[t.off]=Sp({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}_a({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),_a({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),_a({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),_a({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),vn.deselect=vn.unselect,vn.grabbed=function(){var t=this[0];if(t)return t._private.grabbed},_a({field:"active",on:"activate",off:"unactivate"}),_a({field:"pannable",on:"panify",off:"unpanify"}),vn.inactive=function(){var t=this[0];if(t)return!t._private.active};var Tt={},Tp=function(e){return function(n){for(var a=this,i=[],s=0;s<a.length;s++){var l=a[s];if(l.isNode()){for(var c=!1,u=l.connectedEdges(),d=0;d<u.length;d++){var f=u[d],p=f.source(),v=f.target();if(e.noIncomingEdges&&v===l&&p!==l||e.noOutgoingEdges&&p===l&&v!==l){c=!0;break}}c||i.push(l)}}return this.spawn(i,!0).filter(n)}},Bp=function(e){return function(r){for(var n=this,a=[],i=0;i<n.length;i++){var s=n[i];if(s.isNode())for(var l=s.connectedEdges(),c=0;c<l.length;c++){var u=l[c],d=u.source(),f=u.target();e.outgoing&&d===s?(a.push(u),a.push(f)):e.incoming&&f===s&&(a.push(u),a.push(d))}}return this.spawn(a,!0).filter(r)}},Np=function(e){return function(r){for(var n=this,a=[],i={};;){var s=e.outgoing?n.outgoers():n.incomers();if(s.length===0)break;for(var l=!1,c=0;c<s.length;c++){var u=s[c],d=u.id();i[d]||(i[d]=!0,a.push(u),l=!0)}if(!l)break;n=s}return this.spawn(a,!0).filter(r)}};Tt.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null},xe(Tt,{roots:Tp({noIncomingEdges:!0}),leaves:Tp({noOutgoingEdges:!0}),outgoers:Qt(Bp({outgoing:!0}),"outgoers"),successors:Np({outgoing:!0}),incomers:Qt(Bp({incoming:!0}),"incomers"),predecessors:Np({incoming:!0})}),xe(Tt,{neighborhood:Qt(function(t){for(var e=[],r=this.nodes(),n=0;n<r.length;n++)for(var a=r[n],i=a.connectedEdges(),s=0;s<i.length;s++){var l=i[s],c=l.source(),u=l.target(),d=a===c?u:c;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:Qt(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:Qt(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:Dp({attr:"source"}),targets:Dp({attr:"target"})});function Dp(t){return function(r){for(var n=[],a=0;a<this.length;a++){var i=this[a],s=i._private[t.attr];s&&n.push(s)}return this.spawn(n,!0).filter(r)}}xe(Tt,{edgesWith:Qt(Pp(),"edgesWith"),edgesTo:Qt(Pp({thisIsSrc:!0}),"edgesTo")});function Pp(t){return function(r){var n=[],a=this._private.cy,i=t||{};be(r)&&(r=a.$(r));for(var s=0;s<r.length;s++)for(var l=r[s]._private.edges,c=0;c<l.length;c++){var u=l[c],d=u._private.data,f=this.hasElementWithId(d.source)&&r.hasElementWithId(d.target),p=r.hasElementWithId(d.source)&&this.hasElementWithId(d.target),v=f||p;v&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!f||i.thisIsTgt&&!p)||n.push(u))}return this.spawn(n,!0)}}xe(Tt,{connectedEdges:Qt(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var a=r[n];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:Qt(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var a=r[n];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:Qt(_p(),"parallelEdges"),codirectedEdges:Qt(_p({codirected:!0}),"codirectedEdges")});function _p(t){var e={codirected:!1};return t=xe({},e,t),function(n){for(var a=[],i=this.edges(),s=t,l=0;l<i.length;l++)for(var c=i[l],u=c._private,d=u.source,f=d._private.data.id,p=u.data.target,v=d._private.edges,h=0;h<v.length;h++){var g=v[h],y=g._private.data,m=y.target,b=y.source,w=m===p&&b===f,C=f===m&&p===b;(s.codirected&&w||!s.codirected&&(w||C))&&a.push(g)}return this.spawn(a,!0).filter(n)}}xe(Tt,{components:function(e){var r=this,n=r.cy(),a=n.collection(),i=e==null?r.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 r.spawn();var c=function(){var d=n.collection();s.push(d);var f=i[0];l(f,d),r.bfs({directed:!1,roots:f,visit:function(v){return l(v,d)}}),d.forEach(function(p){p.connectedEdges().forEach(function(v){r.has(v)&&d.has(v.source())&&d.has(v.target())&&d.merge(v)})})};do c();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,r){var n=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 kr,s=!1;if(!r)r=[];else if(r.length>0&&Oe(r[0])&&!gi(r[0])){s=!0;for(var l=[],c=new va,u=0,d=r.length;u<d;u++){var f=r[u];f.data==null&&(f.data={});var p=f.data;if(p.id==null)p.id=lh();else if(e.hasElementWithId(p.id)||c.has(p.id))continue;var v=new Vo(e,f,!1);l.push(v),c.add(p.id)}r=l}this.length=0;for(var h=0,g=r.length;h<g;h++){var y=r[h][0];if(y!=null){var m=y._private.data.id;(!n||!i.has(m))&&(n&&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 kr,C=this.eles,x=0;x<C.length;x++){var E=C[x];w.set(E.id(),{index:x,ele:E})}}},n&&(this._private.map=i),s&&!a&&this.restore()},qe=Vo.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 Hf(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,r=this._private.map.get(t);return r?r.ele:new kt(e)},qe.$id=qe.getElementById,qe.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).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(),r=this.cy();if(e==null&&t)return this;if(e!=null){var n=e._private;if(Oe(t)){if(r.startBatch(),t.data){e.data(t.data);var a=n.data;if(e.isEdge()){var i=!1,s={},l=t.data.source,c=t.data.target;l!=null&&l!=a.source&&(s.source=""+l,i=!0),c!=null&&c!=a.target&&(s.target=""+c,i=!0),i&&(e=e.move(s))}else{var u="parent"in t.data,d=t.data.parent;u&&(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!==n[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),r.endBatch(),this}else if(t===void 0){var p={data:Cr(n.data),position:Cr(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};p.classes="";var v=0;return n.classes.forEach(function(h){return p.classes+=v++===0?h:" "+h}),p}}},qe.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],n=r.json();t.push(n)}return t},qe.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var n=this[r],a=n.json(),i=new Vo(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,r=this,n=r.cy(),a=n._private,i=[],s=[],l,c=0,u=r.length;c<u;c++){var d=r[c];e&&!d.removed()||(d.isNode()?i.push(d):s.push(d))}l=i.concat(s);var f,p=function(){l.splice(f,1),f--};for(f=0;f<l.length;f++){var v=l[f],h=v._private,g=h.data;if(v.clearTraversalCache(),!(!e&&!h.removed)){if(g.id===void 0)g.id=lh();else if(le(g.id))g.id=""+g.id;else if(nn(g.id)||!be(g.id)){Ze("Can not create element with invalid string ID `"+g.id+"`"),p();continue}else if(n.hasElementWithId(g.id)){Ze("Can not create second element with ID `"+g.id+"`"),p();continue}}var y=g.id;if(v.isNode()){var m=h.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,x=!1,E=0;E<C;E++){var k=w[E],B=g[k];le(B)&&(B=g[k]=""+g[k]),B==null||B===""?(Ze("Can not create edge `"+y+"` with unspecified "+k),x=!0):n.hasElementWithId(B)||(Ze("Can not create edge `"+y+"` with nonexistant "+k+" `"+B+"`"),x=!0)}if(x){p();continue}var S=n.getElementById(g.source),N=n.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}h.map=new kr,h.map.set(y,{ele:v,index:0}),h.removed=!1,e&&n.addToPool(v)}for(var D=0;D<i.length;D++){var P=i[D],I=P._private.data;le(I.parent)&&(I.parent=""+I.parent);var _=I.parent,F=_!=null;if(F||P._private.parent){var O=P._private.parent?n.collection().merge(P._private.parent):n.getElementById(_);if(O.empty())I.parent=void 0;else if(O[0].removed())Ae("Node added with missing parent, reference to parent removed"),I.parent=void 0,P._private.parent=null;else{for(var M=!1,L=O;!L.empty();){if(P.same(L)){M=!0,I.parent=void 0;break}L=L.parent()}M||(O[0]._private.children.push(P),P._private.parent=O[0],a.hasCompoundNodes=!0)}}}if(l.length>0){for(var V=l.length===r.length?r:new kt(n,l),H=0;H<V.length;H++){var $=V[H];$.isNode()||($.parallelEdges().clearTraversalCache(),$.source().clearTraversalCache(),$.target().clearTraversalCache())}var z;a.hasCompoundNodes?z=n.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 r},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,r=this,n=[],a={},i=r._private.cy;function s(_){for(var F=_._private.edges,O=0;O<F.length;O++)c(F[O])}function l(_){for(var F=_._private.children,O=0;O<F.length;O++)c(F[O])}function c(_){var F=a[_.id()];e&&_.removed()||F||(a[_.id()]=!0,_.isNode()?(n.push(_),s(_),l(_)):n.unshift(_))}for(var u=0,d=r.length;u<d;u++){var f=r[u];c(f)}function p(_,F){var O=_._private.edges;on(O,F),_.clearTraversalCache()}function v(_){_.clearTraversalCache()}var h=[];h.ids={};function g(_,F){F=F[0],_=_[0];var O=_._private.children,M=_.id();on(O,F),F._private.parent=null,h.ids[M]||(h.ids[M]=!0,h.push(_))}r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var y=0;y<n.length;y++){var m=n[y];if(m.isEdge()){var b=m.source()[0],w=m.target()[0];p(b,m),p(w,m);for(var C=m.parallelEdges(),x=0;x<C.length;x++){var E=C[x];v(E),E.isBundledBezier()&&E.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(),n);D.size()>0&&(t?D.emitAndNotify("remove"):e&&D.emit("remove"));for(var P=0;P<h.length;P++){var I=h[P];(!e||!I.removed())&&I.updateStyle()}return D},qe.move=function(t){var e=this._private.cy,r=this,n=!1,a=!1,i=function(h){return h==null?h:""+h};if(t.source!==void 0||t.target!==void 0){var s=i(t.source),l=i(t.target),c=s!=null&&e.hasElementWithId(s),u=l!=null&&e.hasElementWithId(l);(c||u)&&(e.batch(function(){r.remove(n,a),r.emitAndNotify("moveout");for(var v=0;v<r.length;v++){var h=r[v],g=h._private.data;h.isEdge()&&(c&&(g.source=s),u&&(g.target=l))}r.restore(n,a)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var d=i(t.parent),f=d===null||e.hasElementWithId(d);if(f){var p=d===null?void 0:d;e.batch(function(){var v=r.remove(n,a);v.emitAndNotify("moveout");for(var h=0;h<r.length;h++){var g=r[h],y=g._private.data;g.isNode()&&(y.parent=p)}v.restore(n,a)}),r.emitAndNotify("move")}}return this},[Mh,RN,es,fn,Ba,t4,ts,m4,Cp,kp,k4,os,ss,Ct,vn,Tt].forEach(function(t){xe(qe,t)});var D4={add:function(e){var r,n=this;if(Ut(e)){var a=e;if(a._private.cy===n)r=a.restore();else{for(var i=[],s=0;s<a.length;s++){var l=a[s];i.push(l.json())}r=new kt(n,i)}}else if(Ke(e)){var c=e;r=new kt(n,c)}else if(Oe(e)&&(Ke(e.nodes)||Ke(e.edges))){for(var u=e,d=[],f=["nodes","edges"],p=0,v=f.length;p<v;p++){var h=f[p],g=u[h];if(Ke(g))for(var y=0,m=g.length;y<m;y++){var b=xe({group:h},g[y]);d.push(b)}}r=new kt(n,d)}else{var w=e;r=new Vo(n,w).collection()}return r},remove:function(e){if(!Ut(e)){if(be(e)){var r=e;e=this.$(r)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function P4(t,e,r,n){var a=4,i=.001,s=1e-7,l=10,c=11,u=1/(c-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),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var p=d?new Float32Array(c):new Array(c);function v(N,D){return 1-3*D+3*N}function h(N,D){return 3*D-6*N}function g(N){return 3*N}function y(N,D,P){return((v(D,P)*N+h(D,P))*N+g(D))*N}function m(N,D,P){return 3*v(D,P)*N*N+2*h(D,P)*N+g(D)}function b(N,D){for(var P=0;P<a;++P){var I=m(D,t,r);if(I===0)return D;var _=y(D,t,r)-N;D-=_/I}return D}function w(){for(var N=0;N<c;++N)p[N]=y(N*u,t,r)}function C(N,D,P){var I,_,F=0;do _=D+(P-D)/2,I=y(_,t,r)-N,I>0?P=_:D=_;while(Math.abs(I)>s&&++F<l);return _}function x(N){for(var D=0,P=1,I=c-1;P!==I&&p[P]<=N;++P)D+=u;--P;var _=(N-p[P])/(p[P+1]-p[P]),F=D+_*u,O=m(F,t,r);return O>=i?b(N,F):O===0?F:C(N,D,D+u)}var E=!1;function k(){E=!0,(t!==e||r!==n)&&w()}var B=function(D){return E||k(),t===e&&r===n?D:D===0?0:D===1?1:y(x(D),e,n)};B.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var S="generateBezier("+[t,e,r,n]+")";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 _4=function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,a,i){var s={x:n.x+i.dx*a,v:n.v+i.dv*a,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,a){var i={dx:n.v,dv:t(n)},s=e(n,a*.5,i),l=e(n,a*.5,s),c=e(n,a,l),u=1/6*(i.dx+2*(s.dx+l.dx)+c.dx),d=1/6*(i.dv+2*(s.dv+l.dv)+c.dv);return n.x=n.x+u*a,n.v=n.v+d*a,n}return function n(a,i,s){var l={x:-1,v:0,tension:null,friction:null},c=[0],u=0,d=1/1e4,f=16/1e3,p,v,h;for(a=parseFloat(a)||500,i=parseFloat(i)||20,s=s||null,l.tension=a,l.friction=i,p=s!==null,p?(u=n(a,i),v=u/s*f):v=f;h=r(h||l,v),c.push(1+h.x),u+=16,Math.abs(h.x)>d&&Math.abs(h.v)>d;);return p?function(g){return c[g*(c.length-1)|0]}:u}}(),Ue=function(e,r,n,a){var i=P4(e,r,n,a);return function(s,l,c){return s+(l-s)*i(c)}},us={linear:function(e,r,n){return e+(r-e)*n},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,r,n){if(n===0)return us.linear;var a=_4(e,r,n);return function(i,s,l){return i+(s-i)*a(l)}},"cubic-bezier":Ue};function Op(t,e,r,n,a){if(n===1||e===r)return r;var i=a(e,r,n);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 Ip(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Oa(t,e,r,n,a){var i=a!=null?a.type:null;r<0?r=0:r>1&&(r=1);var s=Ip(t,a),l=Ip(e,a);if(le(s)&&le(l))return Op(i,s,l,r,n);if(Ke(s)&&Ke(l)){for(var c=[],u=0;u<l.length;u++){var d=s[u],f=l[u];if(d!=null&&f!=null){var p=Op(i,d,f,r,n);c.push(p)}else c.push(f)}return c}}function O4(t,e,r,n){var a=!n,i=t._private,s=e._private,l=s.easing,c=s.startTime,u=n?t:t.cy(),d=u.style();if(!s.easingImpl)if(l==null)s.easingImpl=us.linear;else{var f;if(be(l)){var p=d.parse("transition-timing-function",l);f=p.value}else f=l;var v,h;be(f)?(v=f,h=[]):(v=f[1],h=f.slice(2).map(function(V){return+V})),h.length>0?(v==="spring"&&h.push(s.duration),s.easingImpl=us[v].apply(null,h)):s.easingImpl=us[v]}var g=s.easingImpl,y;if(s.duration===0?y=1:y=(r-c)/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={};Ai(m.x,b.x)&&(w.x=Oa(m.x,b.x,y,g)),Ai(m.y,b.y)&&(w.y=Oa(m.y,b.y,y,g)),t.position(w)}var C=s.startPan,x=s.pan,E=i.pan,k=x!=null&&n;k&&(Ai(C.x,x.x)&&(E.x=Oa(C.x,x.x,y,g)),Ai(C.y,x.y)&&(E.y=Oa(C.y,x.y,y,g)),t.emit("pan"));var B=s.startZoom,S=s.zoom,N=S!=null&&n;N&&(Ai(B,S)&&(i.zoom=Ti(i.minZoom,Oa(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 P=0;P<D.length;P++){var I=D[P],_=I.name,F=I,O=s.startStyle[_],M=d.properties[O.name],L=Oa(O,F,y,g,M);d.overrideBypass(t,_,L)}t.emit("style")}}return s.progress=y,y}function Ai(t,e){return t==null||e==null?!1:le(t)&&le(e)?!0:!!(t&&e)}function I4(t,e,r,n){var a=e._private;a.started=!0,a.startTime=r-a.progress*a.duration}function Lp(t,e){var r=e._private.aniEles,n=[];function a(d,f){var p=d._private,v=p.animation.current,h=p.animation.queue,g=!1;if(v.length===0){var y=h.shift();y&&v.push(y)}for(var m=function(E){for(var k=E.length-1;k>=0;k--){var B=E[k];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||I4(d,w,t),O4(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&&h.length===0&&n.push(d),g}for(var i=!1,s=0;s<r.length;s++){var l=r[s],c=a(l);i=i||c}var u=a(e,!0);(i||u)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var L4={animate:Ve.animate(),animation:Ve.animation(),animated:Ve.animated(),clearQueue:Ve.clearQueue(),delay:Ve.delay(),delayAnimation:Ve.delayAnimation(),stop:Ve.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&Mo(function(i){Lp(i,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,s){Lp(s,e)},n.beforeRenderPriorities.animations):r()}},M4={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&gi(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},ds=function(e){return be(e)?new un(e):e},Mp={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new as(M4,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,ds(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,ds(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,ds(r),n),this},once:function(e,r,n){return this.emitter().one(e,ds(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};Ve.eventAliasesOn(Mp);var vc={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};vc.jpeg=vc.jpg;var fs={layout:function(e){var r=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 n=e.name,a=r.extension("layout",n);if(a==null){Ze("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;be(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var s=new a(xe({},e,{cy:r,eles:i}));return s}};fs.createLayout=fs.makeLayout=fs.layout;var F4={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var a=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&a.merge(r);return}if(n.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.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 r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var a=e.batchNotifications[n];a.empty()?r.notify(n):r.notify(n,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),a=0;a<n.length;a++){var i=n[a],s=e[i],l=r.getElementById(i);l.data(s)}})}},A4=wt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),gc={renderTo:function(e,r,n,a){var i=this._private.renderer;return i.renderTo(e,r,n,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 r=this,n=r.extension("renderer",e.name);if(n==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&&Ae("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=A4(e);a.cy=r,r._private.renderer=new n(a),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var a=n._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)}};gc.invalidateDimensions=gc.resize;var hs={collection:function(e,r){return be(e)?this.$(e):Ut(e)?e.collection():Ke(e)?(r||(r={}),new kt(this,e,r.unique,r.removed)):new kt(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};hs.elements=hs.filter=hs.$;var Bt={},Vi="t",V4="f";Bt.apply=function(t){for(var e=this,r=e._private,n=r.cy,a=n.collection(),i=0;i<t.length;i++){var s=t[i],l=e.getContextMeta(s);if(!l.empty){var c=e.getContextStyle(l),u=e.applyContextStyle(l,c,s);s._private.appliedInitStyle?e.updateTransitions(s,u.diffProps):s._private.appliedInitStyle=!0;var d=e.updateStyleHints(s);d&&a.push(s)}}return a},Bt.getPropertiesDiff=function(t,e){var r=this,n=r._private.propDiffs=r._private.propDiffs||{},a=t+"-"+e,i=n[a];if(i)return i;for(var s=[],l={},c=0;c<r.length;c++){var u=r[c],d=t[c]===Vi,f=e[c]===Vi,p=d!==f,v=u.mappedProperties.length>0;if(p||f&&v){var h=void 0;p&&v||p?h=u.properties:v&&(h=u.mappedProperties);for(var g=0;g<h.length;g++){for(var y=h[g],m=y.name,b=!1,w=c+1;w<r.length;w++){var C=r[w],x=e[w]===Vi;if(x&&(b=C.properties[y.name]!=null,b))break}!l[m]&&!b&&(l[m]=!0,s.push(m))}}}return n[a]=s,s},Bt.getContextMeta=function(t){for(var e=this,r="",n,a=t._private.styleCxtKey||"",i=0;i<e.length;i++){var s=e[i],l=s.selector&&s.selector.matches(t);l?r+=Vi:r+=V4}return n=e.getPropertiesDiff(a,r),t._private.styleCxtKey=r,{key:r,diffPropNames:n,empty:n.length===0}},Bt.getContextStyle=function(t){var e=t.key,r=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var a={_private:{key:e}},i=0;i<r.length;i++){var s=r[i],l=e[i]===Vi;if(l)for(var c=0;c<s.properties.length;c++){var u=s.properties[c];a[u.name]=u}}return n[e]=a,a},Bt.applyContextStyle=function(t,e,r){for(var n=this,a=t.diffPropNames,i={},s=n.types,l=0;l<a.length;l++){var c=a[l],u=e[c],d=r.pstyle(c);if(!u)if(d)d.bypass?u={name:c,deleteBypassed:!0}:u={name:c,delete:!0};else continue;if(d!==u){if(u.mapped===s.fn&&d!=null&&d.mapping!=null&&d.mapping.value===u.value){var f=d.mapping,p=f.fnValue=u.value(r);if(p===f.prevFnValue)continue}var v=i[c]={prev:d};n.applyParsedProperty(r,u),v.next=r.pstyle(c),v.next&&v.next.bypass&&(v.next=v.next.bypassed)}}return{diffProps:i}},Bt.updateStyleHints=function(t){var e=t._private,r=this,n=r.propertyGroupNames,a=r.propertyGroupKeys,i=function(W,oe,he){return r.getPropertiesHash(W,oe,he)},s=e.styleKey;if(t.removed())return!1;var l=e.group==="nodes",c=t._private.style;n=Object.keys(c);for(var u=0;u<a.length;u++){var d=a[u];e.styleKeys[d]=[pa,Ci]}for(var f=function(W,oe){return e.styleKeys[oe][0]=ki(W,e.styleKeys[oe][0])},p=function(W,oe){return e.styleKeys[oe][1]=xi(W,e.styleKeys[oe][1])},v=function(W,oe){f(W,oe),p(W,oe)},h=function(W,oe){for(var he=0;he<W.length;he++){var ne=W.charCodeAt(he);f(ne,oe),p(ne,oe)}},g=2e9,y=function(W){return-128<W&&W<128&&Math.floor(W)!==W?g-(W*1024|0):W},m=0;m<n.length;m++){var b=n[m],w=c[b];if(w!=null){var C=this.properties[b],x=C.type,E=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,P=w.units;if(x.number&&D&&!x.multiple){var I=S?k:B;v(y(I),E),!S&&P!=null&&h(P,E)}else h(w.strValue,E)}}for(var _=[pa,Ci],F=0;F<a.length;F++){var O=a[F],M=e.styleKeys[O];_[0]=ki(M[0],_[0]),_[1]=xi(M[1],_[1])}e.styleKey=KS(_[0],_[1]);var L=e.styleKeys;e.labelDimsKey=an(L.labelDimensions);var V=i(t,["label"],L.labelDimensions);if(e.labelKey=an(V),e.labelStyleKey=an(Fo(L.commonLabel,V)),!l){var H=i(t,["source-label"],L.labelDimensions);e.sourceLabelKey=an(H),e.sourceLabelStyleKey=an(Fo(L.commonLabel,H));var $=i(t,["target-label"],L.labelDimensions);e.targetLabelKey=an($),e.targetLabelStyleKey=an(Fo(L.commonLabel,$))}if(l){var z=e.styleKeys,j=z.nodeBody,ee=z.nodeBorder,J=z.nodeOutline,X=z.backgroundImage,re=z.compound,Y=z.pie,A=[j,ee,J,X,re,Y].filter(function(K){return K!=null}).reduce(Fo,[pa,Ci]);e.nodeKey=an(A),e.hasPie=Y!=null&&Y[0]!==pa&&Y[1]!==Ci}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 r=this,n=e,a=t._private.style,i,s=r.types,l=r.properties[n.name].type,c=n.bypass,u=a[n.name],d=u&&u.bypass,f=t._private,p="mapping",v=function(j){return j==null?null:j.pfValue!=null?j.pfValue:j.value},h=function(){var j=v(u),ee=v(n);r.checkTriggers(t,n.name,j,ee)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(n=e=this.parse(e.name,"bezier",c)),n.delete)return a[n.name]=void 0,h(),!0;if(n.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,h(),!0):!1:(h(),!0);if(n.deleteBypass)return u?u.bypass?(a[n.name]=u.bypassed,h(),!0):!1:(h(),!0);var g=function(){Ae("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case s.mapData:{for(var y=n.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 x=n.fieldMax-n.fieldMin;x===0?C=0:C=(m-n.fieldMin)/x}else return Ae("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+m+"` for `"+t.id()+"` is non-numeric)"),!1;if(C<0?C=0:C>1&&(C=1),l.color){var E=n.valueMin[0],k=n.valueMax[0],B=n.valueMin[1],S=n.valueMax[1],N=n.valueMin[2],D=n.valueMax[2],P=n.valueMin[3]==null?1:n.valueMin[3],I=n.valueMax[3]==null?1:n.valueMax[3],_=[Math.round(E+(k-E)*C),Math.round(B+(S-B)*C),Math.round(N+(D-N)*C),Math.round(P+(I-P)*C)];i={bypass:n.bypass,name:n.name,value:_,strValue:"rgb("+_[0]+", "+_[1]+", "+_[2]+")"}}else if(l.number){var F=n.valueMin+(n.valueMax-n.valueMin)*C;i=this.parse(n.name,F,n.bypass,p)}else return!1;if(!i)return g(),!1;i.mapping=n,n=i;break}case s.data:{for(var O=n.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(n.name,M,n.bypass,p)),!i)return g(),!1;i.mapping=n,n=i;break}case s.fn:{var H=n.value,$=n.fnValue!=null?n.fnValue:H(t);if(n.prevFnValue=$,$==null)return Ae("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(n.name,$,n.bypass,p),!i)return Ae("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=Cr(n),n=i;break}case void 0:break;default:return!1}return c?(d?n.bypassed=u.bypassed:n.bypassed=u,a[n.name]=n):d?u.bypassed=n:a[n.name]=n,h(),!0},Bt.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),!e)n._private.style={};else for(var a=n._private.style,i=Object.keys(a),s=0;s<i.length;s++){var l=i[s],c=a[l];c!=null&&(c.bypass?c.bypassed=null:a[l]=null)}}},Bt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()},Bt.updateTransitions=function(t,e){var r=this,n=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={},c=!1,u=0;u<a.length;u++){var d=a[u],f=t.pstyle(d),p=e[d];if(p){var v=p.prev,h=v,g=p.next!=null?p.next:f,y=!1,m=void 0,b=1e-6;h&&(le(h.pfValue)&&le(g.pfValue)?(y=g.pfValue-h.pfValue,m=h.pfValue+b*y):le(h.value)&&le(g.value)?(y=g.value-h.value,m=h.value+b*y):Ke(h.value)&&Ke(g.value)&&(y=h.value[0]!==g.value[0]||h.value[1]!==g.value[1]||h.value[2]!==g.value[2],m=h.strValue),y&&(l[d]=g.strValue,this.applyBypass(t,d,m),c=!0))}}if(!c)return;n.transitioning=!0,new ka(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(){r.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1)},Bt.checkTrigger=function(t,e,r,n,a,i){var s=this.properties[e],l=a(s);l!=null&&l(r,n)&&i(s)},Bt.checkZOrderTrigger=function(t,e,r,n){var a=this;this.checkTrigger(t,e,r,n,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",t)})},Bt.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(a){return a.triggersBounds},function(a){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),a.triggersBoundsOfParallelBeziers&&e==="curve-style"&&(r==="bezier"||n==="bezier")&&t.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()}),a.triggersBoundsOfConnectedEdges&&e==="display"&&(r==="none"||n==="none")&&t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},Bt.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n)};var Ri={};Ri.applyBypass=function(t,e,r,n){var a=this,i=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var l=0;l<a.properties.length;l++){var c=a.properties[l],u=c.name,d=this.parse(u,r,!0);d&&i.push(d)}}else if(be(e)){var f=this.parse(e,r,!0);f&&i.push(f)}else if(Oe(e)){var p=e;n=r;for(var v=Object.keys(p),h=0;h<v.length;h++){var g=v[h],y=p[g];if(y===void 0&&(y=p[Oo(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],x={},E=void 0,k=0;k<i.length;k++){var B=i[k];if(n){var S=C.pstyle(B.name);E=x[B.name]={prev:S}}b=this.applyParsedProperty(C,Cr(B))||b,n&&(E.next=C.pstyle(B.name))}b&&this.updateStyleHints(C),n&&this.updateTransitions(C,x,s)}return b},Ri.overrideBypass=function(t,e,r){e=$l(e);for(var n=0;n<t.length;n++){var a=t[n],i=a._private.style[e],s=this.properties[e].type,l=s.color,c=s.mutiple,u=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,e,r):(i.value=r,i.pfValue!=null&&(i.pfValue=r),l?i.strValue="rgb("+r.join(",")+")":c?i.strValue=r.join(" "):i.strValue=""+r,this.updateStyleHints(a)),this.checkTriggers(a,e,u,r)}},Ri.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)},Ri.removeBypasses=function(t,e,r){for(var n=!0,a=0;a<t.length;a++){for(var i=t[a],s={},l=0;l<e.length;l++){var c=e[l],u=this.properties[c],d=i.pstyle(u.name);if(!(!d||!d.bypass)){var f="",p=this.parse(c,f,!0),v=s[u.name]={prev:d};this.applyParsedProperty(i,p),v.next=i.pstyle(u.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,s,n)}};var mc={};mc.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1},mc.containerCss=function(t){var e=this._private.cy,r=e.container(),n=e.window();if(n&&r&&n.getComputedStyle)return n.getComputedStyle(r).getPropertyValue(t)};var xr={};xr.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)},xr.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var n={},a=0;a<r.properties.length;a++){var i=r.properties[a],s=r.getStylePropertyValue(t,i.name,e);s!=null&&(n[i.name]=s,n[Oo(i.name)]=s)}return n}},xr.getIndexedStyle=function(t,e,r,n){var a=t.pstyle(e)[r][n];return a??t.cy().style().getDefaultProperty(e)[r][0]},xr.getStylePropertyValue=function(t,e,r){var n=this;if(t=t[0],t){var a=n.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,s=t.pstyle(a.name);if(s){var l=s.value,c=s.units,u=s.strValue;if(r&&i.number&&l!=null&&le(l)){var d=t.cy().zoom(),f=function(y){return y*d},p=function(y,m){return f(y)+m},v=Ke(l),h=v?c.every(function(g){return g!=null}):c!=null;return h?v?l.map(function(g,y){return p(g,c[y])}).join(" "):p(l,c):v?l.map(function(g){return be(g)?g:""+f(g)}).join(" "):""+f(l)}else if(u!=null)return u}return null}},xr.getAnimationStartStyle=function(t,e){for(var r={},n=0;n<e.length;n++){var a=e[n],i=a.name,s=t.pstyle(i);s!==void 0&&(Oe(s)?s=this.parse(i,s.strValue):s=this.parse(i,s)),s&&(r[i]=s)}return r},xr.getPropsList=function(t){var e=this,r=[],n=t,a=e.properties;if(n)for(var i=Object.keys(n),s=0;s<i.length;s++){var l=i[s],c=n[l],u=a[l]||a[$l(l)],d=this.parse(u.name,c);d&&r.push(d)}return r},xr.getNonDefaultPropertiesHash=function(t,e,r){var n=r.slice(),a,i,s,l,c,u;for(c=0;c<e.length;c++)if(a=e[c],i=t.pstyle(a,!1),i!=null)if(i.pfValue!=null)n[0]=ki(l,n[0]),n[1]=xi(l,n[1]);else for(s=i.strValue,u=0;u<s.length;u++)l=s.charCodeAt(u),n[0]=ki(l,n[0]),n[1]=xi(l,n[1]);return n},xr.getPropertiesHash=xr.getNonDefaultPropertiesHash;var ps={};ps.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var n=t[r],a=n.selector,i=n.style||n.css,s=Object.keys(i);e.selector(a);for(var l=0;l<s.length;l++){var c=s[l],u=i[c];e.css(c,u)}}return e},ps.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e},ps.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],n=r.selector,a=r.properties,i={},s=0;s<a.length;s++){var l=a[s];i[l.name]=l.strValue}t.push({selector:n?n.toString():"core",style:i})}return t};var yc={};yc.appendFromString=function(t){var e=this,r=this,n=""+t,a,i,s;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function l(){n.length>a.length?n=n.substr(a.length):n=""}function c(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var d=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){Ae("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}a=d[0];var f=d[1];if(f!=="core"){var p=new un(f);if(p.invalid){Ae("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),l();continue}}var v=d[2],h=!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){Ae("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+v),h=!0;break}s=m[0];var b=m[1],w=m[2],C=e.properties[b];if(!C){Ae("Skipping property: Invalid property name in: "+s),c();continue}var x=r.parse(b,w);if(!x){Ae("Skipping property: Invalid property definition in: "+s),c();continue}g.push({name:b,val:w}),c()}if(h){l();break}r.selector(f);for(var E=0;E<g.length;E++){var k=g[E];r.css(k.name,k.val)}l()}return r},yc.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var xt={};(function(){var t=lt,e=GE,r=jE,n=YE,a=ZE,i=function(A){return"^"+A+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(A){var K=t+"|\\w+|"+e+"|"+r+"|"+n+"|"+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 c={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=nn(A),oe=nn(K);return W&&!oe||!W&&oe}},u=xt.types,d=[{name:"label",type:u.text,triggersBounds:c.any,triggersZOrder:c.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any}],f=[{name:"source-label",type:u.text,triggersBounds:c.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"source-text-offset",type:u.size,triggersBounds:c.any}],p=[{name:"target-label",type:u.text,triggersBounds:c.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"target-text-offset",type:u.size,triggersBounds:c.any}],v=[{name:"font-family",type:u.fontFamily,triggersBounds:c.any},{name:"font-style",type:u.fontStyle,triggersBounds:c.any},{name:"font-weight",type:u.fontWeight,triggersBounds:c.any},{name:"font-size",type:u.size,triggersBounds:c.any},{name:"text-transform",type:u.textTransform,triggersBounds:c.any},{name:"text-wrap",type:u.textWrap,triggersBounds:c.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:c.any},{name:"text-max-width",type:u.size,triggersBounds:c.any},{name:"text-outline-width",type:u.size,triggersBounds:c.any},{name:"line-height",type:u.positiveNumber,triggersBounds:c.any}],h=[{name:"text-valign",type:u.valign,triggersBounds:c.any},{name:"text-halign",type:u.halign,triggersBounds:c.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:c.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:c.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:c.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:c.any},{name:"text-justification",type:u.justification}],g=[{name:"events",type:u.bool,triggersZOrder:c.any},{name:"text-events",type:u.bool,triggersZOrder:c.any}],y=[{name:"display",type:u.display,triggersZOrder:c.any,triggersBounds:c.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:u.visibility,triggersZOrder:c.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:c.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:c.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:c.any},{name:"z-index",type:u.number,triggersZOrder:c.any}],m=[{name:"overlay-padding",type:u.size,triggersBounds:c.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:c.any},{name:"overlay-corner-radius",type:u.cornerRadius}],b=[{name:"underlay-padding",type:u.size,triggersBounds:c.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:c.any},{name:"underlay-corner-radius",type:u.cornerRadius}],w=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],C=function(A,K){return K.value==="label"?-A.poolIndex():K.pfValue},x=[{name:"height",type:u.nodeSize,triggersBounds:c.any,hashOverride:C},{name:"width",type:u.nodeSize,triggersBounds:c.any,hashOverride:C},{name:"shape",type:u.nodeShape,triggersBounds:c.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:c.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:c.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:c.any}],E=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:c.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],k=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:c.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:c.any}],B=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],S=[{name:"position",type:u.position,triggersBounds:c.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:c.any},{name:"min-width",type:u.size,triggersBounds:c.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-height",type:u.size,triggersBounds:c.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:c.any}],N=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:c.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:c.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:c.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:c.any},{name:"control-point-step-size",type:u.size,triggersBounds:c.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:c.any},{name:"control-point-weights",type:u.numbers,triggersBounds:c.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:c.any},{name:"segment-weights",type:u.numbers,triggersBounds:c.any},{name:"segment-radii",type:u.numbers,triggersBounds:c.any},{name:"radius-type",type:u.radiusType,triggersBounds:c.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:c.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:c.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:c.any},{name:"taxi-radius",type:u.number,triggersBounds:c.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:c.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:c.any},{name:"loop-direction",type:u.angle,triggersBounds:c.any},{name:"loop-sweep",type:u.angle,triggersBounds:c.any},{name:"source-distance-from-node",type:u.size,triggersBounds:c.any},{name:"target-distance-from-node",type:u.size,triggersBounds:c.any}],D=[{name:"ghost",type:u.bool,triggersBounds:c.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"ghost-opacity",type:u.zeroOneNumber}],P=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],I=[];xt.pieBackgroundN=16,I.push({name:"pie-size",type:u.sizeMaybePercent});for(var _=1;_<=xt.pieBackgroundN;_++)I.push({name:"pie-"+_+"-background-color",type:u.color}),I.push({name:"pie-"+_+"-background-size",type:u.percent}),I.push({name:"pie-"+_+"-background-opacity",type:u.zeroOneNumber});var F=[],O=xt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:c.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.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,h,v,d,f,p,x,E,k,B,I,S,N,F,P),L=xt.propertyGroups={behavior:g,transition:w,visibility:y,overlay:m,underlay:b,ghost:D,commonLabel:h,labelDimensions:v,mainLabel:d,sourceLabel:f,targetLabel:p,nodeBody:x,nodeBorder:E,nodeOutline:k,backgroundImage:B,pie:I,compound:S,edgeLine:N,edgeArrow:F,core:P},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],re={name:J.name,alias:!0,pointsTo:X};M.push(re),M[J.name]=re}})(),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(c,u){for(var d=1;d<=xt.pieBackgroundN;d++){var f=u.name.replace("{{i}}",d),p=u.value;c[f]=p}return c},{}),{"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(c,u){return xt.arrowPrefixes.forEach(function(d){var f=d+"-"+u.name,p=u.value;c[f]=p}),c},{})),r={},n=0;n<this.properties.length;n++){var a=this.properties[n];if(!a.pointsTo){var i=a.name,s=e[i],l=this.parse(i,s);r[i]=l}}return t.defaultProperties=r,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 vs={};vs.parse=function(t,e,r,n){var a=this;if(Ye(e))return a.parseImplWarn(t,e,r,n);var i=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,s=r?"t":"f",l=""+e,c=nh(t,l,s,i),u=a.propCache=a.propCache||[],d;return(d=u[c])||(d=u[c]=a.parseImplWarn(t,e,r,n)),(r||n==="mapping")&&(d=Cr(d),d&&(d.value=Cr(d.value))),d},vs.parseImplWarn=function(t,e,r,n){var a=this.parseImpl(t,e,r,n);return!a&&e!=null&&Ae("The style property `".concat(t,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&Ae("The style value of `label` is deprecated for `"+a.name+"`"),a},vs.parseImpl=function(t,e,r,n){var a=this;t=$l(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 c=be(e);c&&(e=e.trim());var u=i.type;if(!u)return null;if(r&&(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:r};var d,f;if(!(!c||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(d=new RegExp(l.data.regex).exec(e))){if(r)return!1;var p=l.data;return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(f=new RegExp(l.mapData.regex).exec(e))){if(r||u.multiple)return!1;var v=l.mapData;if(!(u.color||u.number))return!1;var h=this.parse(t,f[4]);if(!h||h.mapped)return!1;var g=this.parse(t,f[5]);if(!g||g.mapped)return!1;if(h.pfValue===g.pfValue||h.strValue===g.strValue)return Ae("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+h.strValue+"`"),this.parse(t,h.strValue);if(u.color){var y=h.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:h.value,valueMax:g.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var w;if(c?w=e.split(/\s+/):Ke(e)?w=e:w=[e],u.evenMultiple&&w.length%2!==0)return null;for(var C=[],x=[],E=[],k="",B=!1,S=0;S<w.length;S++){var N=a.parse(t,w[S],r,"multiple");B=B||be(N.value),C.push(N.value),E.push(N.pfValue!=null?N.pfValue:N.value),x.push(N.units),k+=(S>0?" ":"")+N.strValue}return u.validate&&!u.validate(C,x)?null:u.singleEnum&&B?C.length===1&&be(C[0])?{name:t,value:C[0],strValue:C[0],bypass:r}:null:{name:t,value:C,pfValue:E,strValue:k,bypass:r,units:x}}var D=function(){for(var A=0;A<u.enums.length;A++){var K=u.enums[A];if(K===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(u.number){var P,I="px";if(u.units&&(P=u.units),u.implicitUnits&&(I=u.implicitUnits),!u.unitless)if(c){var _="px|em"+(u.allowPercent?"|\\%":"");P&&(_=P);var F=e.match("^("+lt+")("+_+")?$");F&&(e=F[1],P=F[2]||I)}else(!P||u.implicitUnits)&&(P=I);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=s,D();if(u.integer&&!RE(e)||u.min!==void 0&&(e<u.min||u.strictMin&&e===u.min)||u.max!==void 0&&(e>u.max||u.strictMax&&e===u.max))return null;var O={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:r};return u.unitless||P!=="px"&&P!=="em"?O.pfValue=e:O.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(O.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(O.pfValue=P==="rad"?e:bT(e)),P==="%"&&(O.pfValue=e/100),O}else if(u.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($):Ae("`"+$+"` 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:r}}else if(u.color){var z=rS(e);return z?{name:t,value:z,pfValue:z,strValue:"rgb("+z[0]+","+z[1]+","+z[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var j=D();if(j)return j}for(var ee=u.regexes?u.regexes:[u.regex],J=0;J<ee.length;J++){var X=new RegExp(ee[J]),re=X.exec(e);if(re)return{name:t,value:u.singleRegexMatchValue?re[1]:re,strValue:""+e,bypass:r}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:r}:u.enums?D():null};var Nt=function t(e){if(!(this instanceof t))return new t(e);if(!Rl(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,r=e.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.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 un(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this},Dt.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],n=0;n<t.properties.length;n++){var a=t.properties[n],i=r[a.name];i===void 0&&(i=r[Oo(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 r=this.parse(t,e);if(r){var n=this.length-1;this[n].properties.push(r),this[n].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.mapped&&this[n].mappedProperties.push(r);var a=!this[n].selector;a&&(this._private.coreStyle[r.name]=r)}return this},Dt.append=function(t){return Kf(t)?t.appendToStyle(this):Ke(t)?this.appendFromJson(t):be(t)&&this.appendFromString(t),this},Nt.fromJson=function(t,e){var r=new Nt(t);return r.fromJson(e),r},Nt.fromString=function(t,e){return new Nt(t).fromString(e)},[Bt,Ri,mc,xr,ps,yc,xt,vs].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 R4={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return Kf(e)?r.style=e.generateStyle(this):Ke(e)?r.style=Nt.fromJson(this,e):be(e)?r.style=Nt.fromString(this,e):r.style=Nt(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},$4="single",Hn={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 r=this._private;if(r.selectionType==null&&(r.selectionType=$4),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.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,r=this._private.pan,n,a,i,s,l;switch(e.length){case 0:return r;case 1:if(be(e[0]))return n=e[0],r[n];if(Oe(e[0])){if(!this._private.panningEnabled)return this;i=e[0],s=i.x,l=i.y,le(s)&&(r.x=s),le(l)&&(r.y=l),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],a=e[1],(n==="x"||n==="y")&&le(a)&&(r[n]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var n=arguments,a=this._private.pan,i,s,l,c,u;if(!this._private.panningEnabled)return this;switch(n.length){case 1:Oe(e)&&(l=n[0],c=l.x,u=l.y,le(c)&&(a.x+=c),le(u)&&(a.y+=u),this.emit("pan viewport"));break;case 2:i=e,s=r,(i==="x"||i==="y")&&le(s)&&(a[i]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,r){var n=this.getFitViewport(e,r);if(n){var a=this._private;a.zoom=n.zoom,a.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(le(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(be(e)){var a=e;e=this.$(a)}else if(HE(e)){var i=e;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else Ut(e)||(e=this.mutableElements());if(!(Ut(e)&&e.empty())){n=n||e.boundingBox();var s=this.width(),l=this.height(),c;if(r=le(r)?r:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){c=Math.min((s-2*r)/n.w,(l-2*r)/n.h),c=c>this._private.maxZoom?this._private.maxZoom:c,c=c<this._private.minZoom?this._private.minZoom:c;var u={x:(s-c*(n.x1+n.x2))/2,y:(l-c*(n.y1+n.y2))/2};return{zoom:c,pan:u}}}}},zoomRange:function(e,r){var n=this._private;if(r==null){var a=e;e=a.min,r=a.max}return le(e)&&le(r)&&e<=r?(n.minZoom=e,n.maxZoom=r):le(e)&&r===void 0&&e<=n.maxZoom?n.minZoom=e:le(r)&&e===void 0&&r>=n.minZoom&&(n.maxZoom=r),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 r=this._private,n=r.pan,a=r.zoom,i,s,l=!1;if(r.zoomingEnabled||(l=!0),le(e)?s=e:Oe(e)&&(s=e.level,e.position!=null?i=Ro(e.position,a,n):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(l=!0)),s=s>r.maxZoom?r.maxZoom:s,s=s<r.minZoom?r.minZoom:s,l||!le(s)||s===a||i!=null&&(!le(i.x)||!le(i.y)))return null;if(i!=null){var c=n,u=a,d=s,f={x:-d/u*(i.x-c.x)+i.x,y:-d/u*(i.y-c.y)+i.y};return{zoomed:!0,panned:!0,zoom:d,pan:f}}else return{zoomed:!0,panned:!1,zoom:s,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),n=this._private;return r==null||!r.zoomed?this:(n.zoom=r.zoom,r.panned&&(n.pan.x=r.pan.x,n.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,n=!0,a=!0,i=[],s=!1,l=!1;if(!e)return this;if(le(e.zoom)||(n=!1),Oe(e.pan)||(a=!1),!n&&!a)return this;if(n){var c=e.zoom;c<r.minZoom||c>r.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=c,i.push("zoom"))}if(a&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;le(u.x)&&(r.pan.x=u.x,l=!1),le(u.y)&&(r.pan.y=u.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 r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(be(e)){var n=e;e=this.mutableElements().filter(n)}else Ut(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var l={x:(i-r*(a.x1+a.x2))/2,y:(s-r*(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,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?function(){var a=n.window().getComputedStyle(r),i=function(l){return parseFloat(a.getPropertyValue(l))};return{width:r.clientWidth-i("padding-left")-i("padding-right"),height:r.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,r=this._private.zoom,n=this.renderedExtent(),a={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Hn.centre=Hn.center,Hn.autolockNodes=Hn.autolock,Hn.autoungrabifyNodes=Hn.autoungrabify;var $i={data:Ve.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ve.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ve.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ve.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};$i.attr=$i.data,$i.removeAttr=$i.removeData;var zi=function(e){var r=this;e=xe({},e);var n=e.container;n&&!_o(n)&&_o(n[0])&&(n=n[0]);var a=n?n._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];n&&(n._cyreg=a),a.cy=r;var s=st!==void 0&&n!==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 c=function(h,g,y){return g!==void 0?g:y!==void 0?y:h},u=this._private={container:n,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:c(!0,l.zoomingEnabled),userZoomingEnabled:c(!0,l.userZoomingEnabled),panningEnabled:c(!0,l.panningEnabled),userPanningEnabled:c(!0,l.userPanningEnabled),boxSelectionEnabled:c(!0,l.boxSelectionEnabled),autolock:c(!1,l.autolock,l.autolockNodes),autoungrabify:c(!1,l.autoungrabify,l.autoungrabifyNodes),autounselectify:c(!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:c(250,l.multiClickDebounceTime)};this.createEmitter(),this.selectionType(l.selectionType),this.zoomRange({min:l.minZoom,max:l.maxZoom});var d=function(h,g){var y=h.some(KE);if(y)return ka.all(h).then(g);g(h)};u.styleEnabled&&r.setStyle([]);var f=xe({},l,l.renderer);r.initRenderer(f);var p=function(h,g,y){r.notifications(!1);var m=r.mutableElements();m.length>0&&m.remove(),h!=null&&(Oe(h)||Ke(h))&&r.add(h),r.one("layoutready",function(w){r.notifications(!0),r.emit(w),r.one("load",g),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var b=xe({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};d([l.style,l.elements],function(v){var h=v[0],g=v[1];u.styleEnabled&&r.style().append(h),p(g,function(){r.startAnimationLoop(),u.ready=!0,Ye(l.ready)&&r.on("ready",l.ready);for(var y=0;y<i.length;y++){var m=i[y];r.on("ready",m)}a&&(a.readies=[]),r.emit("ready")},l.done)})},gs=zi.prototype;xe(gs,{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 st;var r=this._private.container.ownerDocument;return r===void 0||r==null?st:r.defaultView||st},mount:function(e){if(e!=null){var r=this,n=r._private,a=n.options;return!_o(e)&&_o(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),n.container=e,n.styleEnabled=!0,r.invalidateSize(),r.initRenderer(xe({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),r.startAnimationLoop(),r.style(a.style),r.emit("mount"),r}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Cr(this._private.options)},json:function(e){var r=this,n=r._private,a=r.mutableElements(),i=function(C){return r.getElementById(C.id())};if(Oe(e)){if(r.startBatch(),e.elements){var s={},l=function(C,x){for(var E=[],k=[],B=0;B<C.length;B++){var S=C[B];if(!S.data.id){Ae("cy.json() cannot handle elements without an ID attribute");continue}var N=""+S.data.id,D=r.getElementById(N);s[N]=!0,D.length!==0?k.push({ele:D,json:S}):(x&&(S.group=x),E.push(S))}r.add(E);for(var P=0;P<k.length;P++){var I=k[P],_=I.ele,F=I.json;_.json(F)}};if(Ke(e.elements))l(e.elements);else for(var c=["nodes","edges"],u=0;u<c.length;u++){var d=c[u],f=e.elements[d];Ke(f)&&l(f,d)}var p=r.collection();a.filter(function(w){return!s[w.id()]}).forEach(function(w){w.isParent()?p.merge(w):w.remove()}),p.forEach(function(w){return w.children().move({parent:null})}),p.forEach(function(w){return i(w).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var v=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],h=0;h<v.length;h++){var g=v[h];e[g]!=null&&r[g](e[g])}return r.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=r.style().json()),m.data=Cr(r.data());var b=n.options;return m.zoomingEnabled=n.zoomingEnabled,m.userZoomingEnabled=n.userZoomingEnabled,m.zoom=n.zoom,m.minZoom=n.minZoom,m.maxZoom=n.maxZoom,m.panningEnabled=n.panningEnabled,m.userPanningEnabled=n.userPanningEnabled,m.pan=Cr(n.pan),m.boxSelectionEnabled=n.boxSelectionEnabled,m.renderer=Cr(b.renderer),m.hideEdgesOnViewport=b.hideEdgesOnViewport,m.textureOnViewport=b.textureOnViewport,m.wheelSensitivity=b.wheelSensitivity,m.motionBlur=b.motionBlur,m.multiClickDebounceTime=b.multiClickDebounceTime,m}}}),gs.$id=gs.getElementById,[D4,L4,Mp,vc,fs,F4,gc,hs,R4,Hn,$i].forEach(function(t){xe(gs,t)});var z4={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,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},H4={maximal:!1,acyclic:!1},Ia=function(e){return e.scratch("breadthfirst")},Fp=function(e,r){return e.scratch("breadthfirst",r)};function Ap(t){this.options=xe({},z4,H4,t)}Ap.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=n.nodes().filter(function(ne){return!ne.isParent()}),i=n,s=e.directed,l=e.acyclic||e.maximal||e.maximalAdjustments>0,c=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),u;if(Ut(e.roots))u=e.roots;else if(Ke(e.roots)){for(var d=[],f=0;f<e.roots.length;f++){var p=e.roots[f],v=r.getElementById(p);d.push(v)}u=r.collection(d)}else if(be(e.roots))u=r.$(e.roots);else if(s)u=a.roots();else{var h=n.components();u=r.collection();for(var g=function(se){var ue=h[se],pe=ue.maxDegree(!1),de=ue.filter(function(me){return me.degree(!1)===pe});u=u.add(de)},y=0;y<h.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),Fp(se,{index:pe,depth:ue})},C=function(se,ue){var pe=Ia(se),de=pe.depth,me=pe.index;m[de][me]=null,w(se,ue)};i.bfs({roots:u,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 x=[],E=0;E<a.length;E++){var k=a[E];b[k.id()]||x.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}Fp(de,{depth:se,index:pe})}},S=function(){for(var se=0;se<m.length;se++)B(se)},N=function(se,ue){for(var pe=Ia(se),de=se.incomers().filter(function(T){return T.isNode()&&n.has(T)}),me=-1,Ne=se.id(),De=0;De<de.length;De++){var Ee=de[De],Pe=Ia(Ee);me=Math.max(me,Pe.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=[],P={},I=function(se){return D.push(se)},_=function(){return D.shift()};for(a.forEach(function(ne){return D.push(ne)});D.length>0;){var F=_(),O=N(F,P);if(O)F.outgoers().filter(function(ne){return ne.isNode()&&n.has(ne)}).forEach(I);else if(O===null){Ae("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=Ia(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=Ia(De);if(Ee!=null){var Pe=Ee.index,te=Ee.depth;if(!(Pe==null||te==null)){var T=m[te].length;te<ue&&(de+=Pe/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?Gf(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 re=[],Y=0;Y<x.length;Y++)re.push(x[Y]);m.unshift(re),S();for(var A=0,K=0;K<m.length;K++)A=Math.max(m[K].length,A);var W={x:c.x1+c.w/2,y:c.x1+c.h/2},oe=m.reduce(function(ne,se){return Math.max(ne,se.length)},0),he=function(se){var ue=Ia(se),pe=ue.depth,de=ue.index,me=m[pe].length,Ne=Math.max(c.w/((e.grid?oe:me)+1),M),De=Math.max(c.h/(m.length+1),M),Ee=Math.min(c.w/2/m.length,c.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 Pe={x:W.x+(de+1-(me+1)/2)*Ne,y:(pe+1)*De};return Pe}};return n.nodes().layoutPositions(this,e,he),this};var K4={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,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Vp(t){this.options=xe({},K4,t)}Vp.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var 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},c=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=c/Math.max(1,i.length-1),d,f=0,p=0;p<i.length;p++){var v=i[p],h=v.layoutDimensions(e),g=h.w,y=h.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(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),w=Math.sqrt(f*f/(m*m+b*b));d=Math.max(w,d)}var C=function(E,k){var B=e.startAngle+k*u*(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 n.nodes().layoutPositions(this,e,C),this};var q4={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,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Rp(t){this.options=xe({},q4,t)}Rp.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,a=e.eles,i=a.nodes().not(":parent"),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},c=[],u=0,d=0;d<i.length;d++){var f=i[d],p=void 0;p=e.concentric(f),c.push({value:p,node:f}),f._private.scratch.concentric=p}i.updateStyle();for(var v=0;v<i.length;v++){var h=i[v],g=h.layoutDimensions(e);u=Math.max(u,g.w,g.h)}c.sort(function(ne,se){return se.value-ne.value});for(var y=e.levelWidth(i),m=[[]],b=m[0],w=0;w<c.length;w++){var C=c[w];if(b.length>0){var x=Math.abs(b[0].value-C.value);x>=y&&(b=[],m.push(b))}b.push(C)}var E=u+e.minNodeSpacing;if(!e.avoidOverlap){var k=m.length>0&&m[0].length>1,B=Math.min(s.w,s.h)/2-E,S=B/(m.length+k?1:0);E=Math.min(E,S)}for(var N=0,D=0;D<m.length;D++){var P=m[D],I=e.sweep===void 0?2*Math.PI-2*Math.PI/P.length:e.sweep,_=P.dTheta=I/Math.max(1,P.length-1);if(P.length>1&&e.avoidOverlap){var F=Math.cos(_)-Math.cos(0),O=Math.sin(_)-Math.sin(0),M=Math.sqrt(E*E/(F*F+O*O));N=Math.max(M,N)}P.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 re=m[X],Y=re.dTheta,A=re.r,K=0;K<re.length;K++){var W=re[K],oe=e.startAngle+(r?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(ne){var se=ne.id();return J[se]}),this};var bc,U4={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){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 ms(t){this.options=xe({},U4,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),n=r.filter(function(a){var i=a.source().data("id"),s=a.target().data("id"),l=e.some(function(u){return u.data("id")===i}),c=e.some(function(u){return u.data("id")===s});return!l||!c});this.options.eles=this.options.eles.not(n)}ms.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?bc=!0:bc=!1;var n=G4(e,r,t);bc&&Y4(n),t.randomize&&Z4(n);var a=Vr(),i=function(){X4(n,e,t),t.fit===!0&&e.fit(t.padding)},s=function(p){return!(r.stopped||p>=t.numIter||(Q4(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature<t.minTemp))},l=function(){if(t.animate===!0||t.animate===!1)i(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var p=t.eles.nodes(),v=$p(n,t,p);p.layoutPositions(r,t,v)}},c=0,u=!0;if(t.animate===!0){var d=function f(){for(var p=0;u&&p<t.refresh;)u=s(c),c++,p++;if(!u)Hp(n,t),l();else{var v=Vr();v-a>=t.animationThreshold&&i(),Mo(f)}};d()}else{for(;u;)u=s(c),c++;Hp(n,t),l()}return this},ms.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},ms.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var G4=function(e,r,n){for(var a=n.eles.edges(),i=n.eles.nodes(),s=zt(n.boundingBox?n.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:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},c=n.eles.components(),u={},d=0;d<c.length;d++)for(var f=c[d],p=0;p<f.length;p++){var v=f[p];u[v.id()]=d}for(var d=0;d<l.nodeSize;d++){var h=i[d],g=h.layoutDimensions(n),y={};y.isLocked=h.locked(),y.id=h.data("id"),y.parentId=h.data("parent"),y.cmptId=u[h.id()],y.children=[],y.positionX=h.position("x"),y.positionY=h.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(h.style("padding")),y.padRight=parseFloat(h.style("padding")),y.padTop=parseFloat(h.style("padding")),y.padBottom=parseFloat(h.style("padding")),y.nodeRepulsion=Ye(n.nodeRepulsion)?n.nodeRepulsion(h):n.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 h=l.layoutNodes[d],x=h.parentId;x!=null?l.layoutNodes[l.idToIndex[x]].children.push(h.id):(m[++w]=h.id,C.push(h.id))}for(l.graphSet.push(C);b<=w;){var E=m[b++],k=l.idToIndex[E],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],p=0;p<S.length;p++){var N=l.idToIndex[S[p]];l.indexToGraph[N]=d}for(var d=0;d<l.edgeSize;d++){var D=a[d],P={};P.id=D.data("id"),P.sourceId=D.data("source"),P.targetId=D.data("target");var I=Ye(n.idealEdgeLength)?n.idealEdgeLength(D):n.idealEdgeLength,_=Ye(n.edgeElasticity)?n.edgeElasticity(D):n.edgeElasticity,F=l.idToIndex[P.sourceId],O=l.idToIndex[P.targetId],M=l.indexToGraph[F],L=l.indexToGraph[O];if(M!=L){for(var V=W4(P.sourceId,P.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*=$*n.nestingFactor}P.idealLength=I,P.elasticity=_,l.layoutEdges.push(P)}return l},W4=function(e,r,n){var a=j4(e,r,0,n);return 2>a.count?0:a.graph},j4=function t(e,r,n,a){var i=a.graphSet[n];if(-1<i.indexOf(e)&&-1<i.indexOf(r))return{count:2,graph:n};for(var s=0,l=0;l<i.length;l++){var c=i[l],u=a.idToIndex[c],d=a.layoutNodes[u].children;if(d.length!==0){var f=a.indexToGraph[a.idToIndex[d[0]]],p=t(e,r,f,a);if(p.count!==0)if(p.count===1){if(s++,s===2)break}else return p}}return{count:s,graph:n}},Y4,Z4=function(e,r){for(var n=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()*n,s.positionY=Math.random()*a)}},$p=function(e,r,n){var a=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(n.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 c=e.layoutNodes[e.idToIndex[s.data("id")]];if(r.boundingBox){var u=(c.positionX-i.x1)/i.w,d=(c.positionY-i.y1)/i.h;return{x:a.x1+u*a.w,y:a.y1+d*a.h}}else return{x:c.positionX,y:c.positionY}}},X4=function(e,r,n){var a=n.layout,i=n.eles.nodes(),s=$p(e,n,i);i.positions(s),e.ready!==!0&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},Q4=function(e,r,n){J4(e,r),rD(e),nD(e,r),aD(e),iD(e)},J4=function(e,r){for(var n=0;n<e.graphSet.length;n++)for(var a=e.graphSet[n],i=a.length,s=0;s<i;s++)for(var l=e.layoutNodes[e.idToIndex[a[s]]],c=s+1;c<i;c++){var u=e.layoutNodes[e.idToIndex[a[c]]];eD(l,u,e,r)}},zp=function(e){return-e+2*e*Math.random()},eD=function(e,r,n,a){var i=e.cmptId,s=r.cmptId;if(!(i!==s&&!n.isCompound)){var l=r.positionX-e.positionX,c=r.positionY-e.positionY,u=1;l===0&&c===0&&(l=zp(u),c=zp(u));var d=tD(e,r,l,c);if(d>0)var f=a.nodeOverlap*d,p=Math.sqrt(l*l+c*c),v=f*l/p,h=f*c/p;else var g=ys(e,l,c),y=ys(r,-1*l,-1*c),m=y.x-g.x,b=y.y-g.y,w=m*m+b*b,p=Math.sqrt(w),f=(e.nodeRepulsion+r.nodeRepulsion)/w,v=f*m/p,h=f*b/p;e.isLocked||(e.offsetX-=v,e.offsetY-=h),r.isLocked||(r.offsetX+=v,r.offsetY+=h)}},tD=function(e,r,n,a){if(n>0)var i=e.maxX-r.minX;else var i=r.maxX-e.minX;if(a>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},ys=function(e,r,n){var a=e.positionX,i=e.positionY,s=e.height||1,l=e.width||1,c=n/r,u=s/l,d={};return r===0&&0<n||r===0&&0>n?(d.x=a,d.y=i+s/2,d):0<r&&-1*u<=c&&c<=u?(d.x=a+l/2,d.y=i+l*n/2/r,d):0>r&&-1*u<=c&&c<=u?(d.x=a-l/2,d.y=i-l*n/2/r,d):0<n&&(c<=-1*u||c>=u)?(d.x=a+s*r/2/n,d.y=i+s/2,d):(0>n&&(c<=-1*u||c>=u)&&(d.x=a-s*r/2/n,d.y=i-s/2),d)},rD=function(e,r){for(var n=0;n<e.edgeSize;n++){var a=e.layoutEdges[n],i=e.idToIndex[a.sourceId],s=e.layoutNodes[i],l=e.idToIndex[a.targetId],c=e.layoutNodes[l],u=c.positionX-s.positionX,d=c.positionY-s.positionY;if(!(u===0&&d===0)){var f=ys(s,u,d),p=ys(c,-1*u,-1*d),v=p.x-f.x,h=p.y-f.y,g=Math.sqrt(v*v+h*h),y=Math.pow(a.idealLength-g,2)/a.elasticity;if(g!==0)var m=y*v/g,b=y*h/g;else var m=0,b=0;s.isLocked||(s.offsetX+=m,s.offsetY+=b),c.isLocked||(c.offsetX-=m,c.offsetY-=b)}}},nD=function(e,r){if(r.gravity!==0)for(var n=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],s=i.length;if(a===0)var l=e.clientHeight/2,c=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[i[0]]],d=e.layoutNodes[e.idToIndex[u.parentId]],l=d.positionX,c=d.positionY;for(var f=0;f<s;f++){var p=e.layoutNodes[e.idToIndex[i[f]]];if(!p.isLocked){var v=l-p.positionX,h=c-p.positionY,g=Math.sqrt(v*v+h*h);if(g>n){var y=r.gravity*v/g,m=r.gravity*h/g;p.offsetX+=y,p.offsetY+=m}}}}},aD=function(e,r){var n=[],a=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;a<=i;){var s=n[a++],l=e.idToIndex[s],c=e.layoutNodes[l],u=c.children;if(0<u.length&&!c.isLocked){for(var d=c.offsetX,f=c.offsetY,p=0;p<u.length;p++){var v=e.layoutNodes[e.idToIndex[u[p]]];v.offsetX+=d,v.offsetY+=f,n[++i]=u[p]}c.offsetX=0,c.offsetY=0}}},iD=function(e,r){for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];if(!(0<a.children.length||a.isLocked)){var i=oD(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,sD(a,e)}}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];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)}},oD=function(e,r,n){var a=Math.sqrt(e*e+r*r);if(a>n)var i={x:n*e/a,y:n*r/a};else var i={x:e,y:r};return i},sD=function t(e,r){var n=e.parentId;if(n!=null){var a=r.layoutNodes[r.idToIndex[n]],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,r)}},Hp=function(e,r){for(var n=e.layoutNodes,a=[],i=0;i<n.length;i++){var s=n[i],l=s.cmptId,c=a[l]=a[l]||[];c.push(s)}for(var u=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 p=d[f];d.x1=Math.min(d.x1,p.positionX-p.width/2),d.x2=Math.max(d.x2,p.positionX+p.width/2),d.y1=Math.min(d.y1,p.positionY-p.height/2),d.y2=Math.max(d.y2,p.positionY+p.height/2)}d.w=d.x2-d.x1,d.h=d.y2-d.y1,u+=d.w*d.h}}a.sort(function(b,w){return w.w*w.h-b.w*b.h});for(var v=0,h=0,g=0,y=0,m=Math.sqrt(u)*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 p=d[f];p.isLocked||(p.positionX+=v-d.x1,p.positionY+=h-d.y1)}v+=d.w+r.componentSpacing,g+=d.w+r.componentSpacing,y=Math.max(y,d.h),g>m&&(h+=y+r.componentSpacing,v=0,g=0,y=0)}}},lD={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,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Kp(t){this.options=xe({},lD,t)}Kp.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var i=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0)n.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),c=Math.round(l),u=Math.round(i.w/i.h*l),d=function(ee){if(ee==null)return Math.min(c,u);var J=Math.min(c,u);J==c?c=ee:u=ee},f=function(ee){if(ee==null)return Math.max(c,u);var J=Math.max(c,u);J==c?c=ee:u=ee},p=e.rows,v=e.cols!=null?e.cols:e.columns;if(p!=null&&v!=null)c=p,u=v;else if(p!=null&&v==null)c=p,u=Math.ceil(s/c);else if(p==null&&v!=null)u=v,c=Math.ceil(s/u);else if(u*c>s){var h=d(),g=f();(h-1)*g>=s?d(h-1):(g-1)*h>=s&&f(g-1)}else for(;u*c<s;){var y=d(),m=f();(m+1)*y>=s?f(m+1):d(y+1)}var b=i.w/u,w=i.h/c;if(e.condense&&(b=0,w=0),e.avoidOverlap)for(var C=0;C<a.length;C++){var x=a[C],E=x._private.position;(E.x==null||E.y==null)&&(E.x=0,E.y=0);var k=x.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={},P=function(ee,J){return!!D["c-"+ee+"-"+J]},I=function(ee,J){D["c-"+ee+"-"+J]=!0},_=0,F=0,O=function(){F++,F>=u&&(F=0,_++)},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;P($.row,$.col);)$.col++;else if($.row===void 0)for($.row=0;P($.row,$.col);)$.row++;M[V.id()]=$,I($.row,$.col)}}var z=function(ee,J){var X,re;if(ee.locked()||ee.isParent())return!1;var Y=M[ee.id()];if(Y)X=Y.col*b+b/2+i.x1,re=Y.row*w+w/2+i.y1;else{for(;P(_,F);)O();X=F*b+b/2+i.x1,re=_*w+w/2+i.y1,I(_,F),O()}return{x:X,y:re}};a.layoutPositions(this,e,z)}return this};var cD={ready:function(){},stop:function(){}};function wc(t){this.options=xe({},cD,t)}wc.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this},wc.prototype.stop=function(){return this};var uD={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,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function qp(t){this.options=xe({},uD,t)}qp.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),n=Ye(t.positions);function a(i){if(t.positions==null)return pT(i.position());if(n)return t.positions(i);var s=t.positions[i._private.data.id];return s??null}return r.layoutPositions(this,t,function(i,s){var l=a(i);return i.locked()||l==null?!1:l}),this};var dD={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Up(t){this.options=xe({},dD,t)}Up.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=zt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(s,l){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return r.nodes().layoutPositions(this,t,a),this};var fD=[{name:"breadthfirst",impl:Ap},{name:"circle",impl:Vp},{name:"concentric",impl:Rp},{name:"cose",impl:ms},{name:"grid",impl:Kp},{name:"null",impl:wc},{name:"preset",impl:qp},{name:"random",impl:Up}];function Gp(t){this.options=t,this.notifications=0}var Wp=function(){},jp=function(){throw new Error("A headless instance can not render images")};Gp.prototype={recalculateRenderedStyle:Wp,notify:function(){this.notifications++},init:Wp,isHeadless:function(){return!0},png:jp,jpg:jp};var Cc={};Cc.arrowShapeWidth=.3,Cc.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,d,f,p,v,h,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<=u&&u<=m&&b<=d&&d<=w;return C},n=function(u,d,f,p,v){var h=u*Math.cos(p)-d*Math.sin(p),g=u*Math.sin(p)+d*Math.cos(p),y=h*f,m=g*f,b=y+v.x,w=m+v.y;return{x:b,y:w}},a=function(u,d,f,p){for(var v=[],h=0;h<u.length;h+=2){var g=u[h],y=u[h+1];v.push(n(g,y,d,f,p))}return v},i=function(u){for(var d=[],f=0;f<u.length;f++){var p=u[f];d.push(p.x,p.y)}return d},s=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},l=function(u,d){be(d)&&(d=t[d]),t[u]=xe({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(p,v,h,g,y,m){var b=i(a(this.points,h+2*m,g,y)),w=Ht(p,v,b);return w},roughCollide:r,draw:function(p,v,h,g){var y=a(this.points,v,h,g);e.arrowShapeImpl("polygon")(p,y)},spacing:function(p){return 0},gap:s},d)};l("none",{collide:Ao,roughCollide:Ao,draw:ql,spacing:oh,gap:oh}),l("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),l("arrow","triangle"),l("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(u,d,f,p,v){var h=a(this.points,d,f,p),g=this.controlPoint,y=n(g[0],g[1],d,f,p);e.arrowShapeImpl(this.name)(u,h,y)},gap:function(u){return s(u)*.8}}),l("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,d,f,p,v,h,g){var y=i(a(this.points,f+2*g,p,v)),m=i(a(this.pointsTee,f+2*g,p,v)),b=Ht(u,d,y)||Ht(u,d,m);return b},draw:function(u,d,f,p,v){var h=a(this.points,d,f,p),g=a(this.pointsTee,d,f,p);e.arrowShapeImpl(this.name)(u,h,g)}}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,d,f,p,v,h,g){var y=v,m=Math.pow(y.x-u,2)+Math.pow(y.y-d,2)<=Math.pow((f+2*g)*this.radius,2),b=i(a(this.points,f+2*g,p,v));return Ht(u,d,b)||m},draw:function(u,d,f,p,v){var h=a(this.pointsTr,d,f,p);e.arrowShapeImpl(this.name)(u,h,p.x,p.y,this.radius*d)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.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(u,d){var f=this.baseCrossLinePts.slice(),p=d/u,v=3,h=5;return f[v]=f[v]-p,f[h]=f[h]-p,f},collide:function(u,d,f,p,v,h,g){var y=i(a(this.points,f+2*g,p,v)),m=i(a(this.crossLinePts(f,h),f+2*g,p,v)),b=Ht(u,d,y)||Ht(u,d,m);return b},draw:function(u,d,f,p,v){var h=a(this.points,d,f,p),g=a(this.crossLinePts(d,v),d,f,p);e.arrowShapeImpl(this.name)(u,h,g)}}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return s(u)*.525}}),l("circle",{radius:.15,collide:function(u,d,f,p,v,h,g){var y=v,m=Math.pow(y.x-u,2)+Math.pow(y.y-d,2)<=Math.pow((f+2*g)*this.radius,2);return m},draw:function(u,d,f,p,v){e.arrowShapeImpl(this.name)(u,p.x,p.y,this.radius*d)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),l("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){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(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),l("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(u){return .95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})};var Kn={};Kn.projectIntoViewport=function(t,e){var r=this.cy,n=this.findContainerClientCoords(),a=n[0],i=n[1],s=n[4],l=r.pan(),c=r.zoom(),u=((t-a)/s-l.x)/c,d=((e-i)/s-l.y)/c;return[u,d]},Kn.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),n=function(m){return parseFloat(r.getPropertyValue(m))},a={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},i={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},s=t.clientWidth,l=t.clientHeight,c=a.left+a.right,u=a.top+a.bottom,d=i.left+i.right,f=e.width/(s+d),p=s-c,v=l-u,h=e.left+a.left+i.left,g=e.top+a.top+i.top;return this.containerBB=[h,g,p,v,f]},Kn.invalidateContainerClientCoordsCache=function(){this.containerBB=null},Kn.findNearestElement=function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]},Kn.findNearestElements=function(t,e,r,n){var a=this,i=this,s=i.getCachedZSortedEles(),l=[],c=i.cy.zoom(),u=i.cy.hasCompoundNodes(),d=(n?24:8)/c,f=(n?8:2)/c,p=(n?8:2)/c,v=1/0,h,g;r&&(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(h){if(h.pstyle("z-compound-depth").value===k.pstyle("z-compound-depth").value&&h.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,h=k,v=B??v;break}}}else l.push(k),h=k,v=B??v}function m(k){var B=k.outerWidth()+2*f,S=k.outerHeight()+2*f,N=B/2,D=S/2,P=k.position(),I=k.pstyle("corner-radius").value==="auto"?"auto":k.pstyle("corner-radius").pfValue,_=k._private.rscratch;if(P.x-N<=t&&t<=P.x+N&&P.y-D<=e&&e<=P.y+D){var F=i.nodeShapes[a.getNodeShape(k)];if(F.checkPoint(t,e,0,B,S,P.x,P.y,I,_))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,P=N/2+d,I=P*P,_=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(BT(t,e,O[M],O[M+1],O[M+2],O[M+3],_)&&I>(F=OT(t,e,O[M],O[M+1],O[M+2],O[M+3])))return y(k,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(NT(t,e,O[M],O[M+1],O[M+2],O[M+3],O[M+4],O[M+5],_)&&I>(F=_T(t,e,O[M],O[M+1],O[M+2],O[M+3],O[M+4],O[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}u&&l.length>0&&(m(L),m(V))}function w(k,B,S){return ur(k,B,S)}function C(k,B){var S=k._private,N=p,D;B?D=B+"-":D="",k.boundingBox();var P=S.labelBounds[B||"main"],I=k.pstyle(D+"label").value,_=k.pstyle("text-events").strValue==="yes";if(!(!_||!I)){var F=w(S.rscratch,"labelX",B),O=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=P.x1-N-L,$=P.x2+N-L,z=P.y1-N-V,j=P.y2+N-V;if(M){var ee=Math.cos(M),J=Math.sin(M),X=function(he,ne){return he=he-F,ne=ne-O,{x:he*ee-ne*J+F,y:he*J+ne*ee+O}},re=X(H,z),Y=X(H,j),A=X($,z),K=X($,j),W=[re.x+L,re.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(ya(P,t,e))return y(k),!0}}for(var x=s.length-1;x>=0;x--){var E=s[x];E.isNode()?m(E)||C(E):b(E)||C(E)||C(E,"source")||C(E,"target")}return l},Kn.getAllInBox=function(t,e,r,n){var a=this.getCachedZSortedEles().interactive,i=[],s=Math.min(t,r),l=Math.max(t,r),c=Math.min(e,n),u=Math.max(e,n);t=s,r=l,e=c,n=u;for(var d=zt({x1:t,y1:e,x2:r,y2:n}),f=0;f<a.length;f++){var p=a[f];if(p.isNode()){var v=p,h=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});jl(d,h)&&!vh(h,d)&&i.push(v)}else{var g=p,y=g._private,m=y.rscratch;if(m.startX!=null&&m.startY!=null&&!ya(d,m.startX,m.startY)||m.endX!=null&&m.endY!=null&&!ya(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(!TT(d,b[C])){w=!1;break}w&&i.push(g)}else(m.edgeType==="haystack"||m.edgeType==="straight")&&i.push(g)}}return i};var bs={};bs.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",n=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",s=e.edgeType==="compound",l=e.edgeType==="self",c,u,d,f,p,v,m,b;if(r?(d=e.haystackPts[0],f=e.haystackPts[1],p=e.haystackPts[2],v=e.haystackPts[3]):(d=e.arrowStartX,f=e.arrowStartY,p=e.arrowEndX,v=e.arrowEndY),m=e.midX,b=e.midY,i)c=d-e.segpts[0],u=f-e.segpts[1];else if(a||s||l||n){var h=e.allpts,g=ft(h[0],h[2],h[4],.1),y=ft(h[1],h[3],h[5],.1);c=d-g,u=f-y}else c=d-m,u=f-b;e.srcArrowAngle=$o(c,u);var m=e.midX,b=e.midY;if(r&&(m=(d+p)/2,b=(f+v)/2),c=p-d,u=v-f,i){var h=e.allpts;if(h.length/2%2===0){var w=h.length/2,C=w-2;c=h[w]-h[C],u=h[w+1]-h[C+1]}else if(e.isRound)c=e.midVector[1],u=-e.midVector[0];else{var w=h.length/2-1,C=w-2;c=h[w]-h[C],u=h[w+1]-h[C+1]}}else if(a||s||l){var h=e.allpts,x=e.ctrlpts,E,k,B,S;if(x.length/2%2===0){var N=h.length/2-1,D=N+2,P=D+2;E=ft(h[N],h[D],h[P],0),k=ft(h[N+1],h[D+1],h[P+1],0),B=ft(h[N],h[D],h[P],1e-4),S=ft(h[N+1],h[D+1],h[P+1],1e-4)}else{var D=h.length/2-1,N=D-2,P=D+2;E=ft(h[N],h[D],h[P],.4999),k=ft(h[N+1],h[D+1],h[P+1],.4999),B=ft(h[N],h[D],h[P],.5),S=ft(h[N+1],h[D+1],h[P+1],.5)}c=B-E,u=S-k}if(e.midtgtArrowAngle=$o(c,u),e.midDispX=c,e.midDispY=u,c*=-1,u*=-1,i){var h=e.allpts;if(h.length/2%2!==0){if(!e.isRound){var w=h.length/2-1,I=w+2;c=-(h[I]-h[w]),u=-(h[I+1]-h[w+1])}}}if(e.midsrcArrowAngle=$o(c,u),i)c=p-e.segpts[e.segpts.length-2],u=v-e.segpts[e.segpts.length-1];else if(a||s||l||n){var h=e.allpts,_=h.length,g=ft(h[_-6],h[_-4],h[_-2],.9),y=ft(h[_-5],h[_-3],h[_-1],.9);c=p-g,u=v-y}else c=p-m,u=v-b;e.tgtArrowAngle=$o(c,u)},bs.getArrowWidth=bs.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},n=r[t+", "+e];return n||(n=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=n,n)};var kc,xc,Er={},er={},Yp,Zp,qn,ws,zr,Un,Gn,Sr,La,Cs,Xp,Qp,Ec,Sc,Jp,ev=function(e,r,n){n.x=r.x-e.x,n.y=r.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},hD=function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},pD=function(e,r,n,a,i){if(e!==Jp?ev(r,e,Er):hD(er,Er),ev(r,n,er),Yp=Er.nx*er.ny-Er.ny*er.nx,Zp=Er.nx*er.nx-Er.ny*-er.ny,zr=Math.asin(Math.max(-1,Math.min(1,Yp))),Math.abs(zr)<1e-6){kc=r.x,xc=r.y,Gn=La=0;return}qn=1,ws=!1,Zp<0?zr<0?zr=Math.PI+zr:(zr=Math.PI-zr,qn=-1,ws=!0):zr>0&&(qn=-1,ws=!0),r.radius!==void 0?La=r.radius:La=a,Un=zr/2,Cs=Math.min(Er.len/2,er.len/2),i?(Sr=Math.abs(Math.cos(Un)*La/Math.sin(Un)),Sr>Cs?(Sr=Cs,Gn=Math.abs(Sr*Math.sin(Un)/Math.cos(Un))):Gn=La):(Sr=Math.min(Cs,La),Gn=Math.abs(Sr*Math.sin(Un)/Math.cos(Un))),Ec=r.x+er.nx*Sr,Sc=r.y+er.ny*Sr,kc=Ec-er.ny*Gn*qn,xc=Sc+er.nx*Gn*qn,Xp=r.x+Er.nx*Sr,Qp=r.y+Er.ny*Sr,Jp=r};function tv(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 Tc(t,e,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===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}:(pD(t,e,r,n,a),{cx:kc,cy:xc,radius:Gn,startX:Xp,startY:Qp,stopX:Ec,stopY:Sc,startAngle:Er.ang+Math.PI/2*qn,endAngle:er.ang-Math.PI/2*qn,counterClockwise:ws})}var Pt={};Pt.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,i,s=t.pstyle("source-endpoint"),l=t.pstyle("target-endpoint"),c=s.units!=null&&l.units!=null,u=function(x,E,k,B){var S=B-E,N=k-x,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=r;break;case"intersection":i=n;break;case"endpoints":{if(c){var f=this.manualEndptToPx(t.source()[0],s),p=cr(f,2),v=p[0],h=p[1],g=this.manualEndptToPx(t.target()[0],l),y=cr(g,2),m=y[0],b=y[1],w={x1:v,y1:h,x2:m,y2:b};a=u(v,h,m,b),i=w}else Ae("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=n;break}}return{midptPts:i,vectorNormInverse:a}},Pt.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],n=r._private,a=n.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=n.source,l=n.target,c=s.position(),u=l.position(),d=s.width(),f=l.width(),p=s.height(),v=l.height(),h=r.pstyle("haystack-radius").value,g=h/2;a.haystackPts=a.allpts=[a.source.x*d*g+c.x,a.source.y*p*g+c.y,a.target.x*f*g+u.x,a.target.y*v*g+u.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(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}},Pt.findSegmentsPoints=function(t,e){var r=t._private.rscratch,n=t.pstyle("segment-weights"),a=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),l=Math.min(n.pfValue.length,a.pfValue.length),c=i.pfValue[i.pfValue.length-1],u=s.pfValue[s.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var d=0;d<l;d++){var f=n.pfValue[d],p=a.pfValue[d],v=1-f,h=f,g=this.findMidptPtsEtc(t,e),y=g.midptPts,m=g.vectorNormInverse,b={x:y.x1*v+y.x2*h,y:y.y1*v+y.y2*h};r.segpts.push(b.x+m.x*p,b.y+m.y*p),r.radii.push(i.pfValue[d]!==void 0?i.pfValue[d]:c),r.isArcRadius.push((s.pfValue[d]!==void 0?s.pfValue[d]:u)==="arc-radius")}},Pt.findLoopPoints=function(t,e,r,n){var a=t._private.rscratch,i=e.dirCounts,s=e.srcPos,l=t.pstyle("control-point-distances"),c=l?l.pfValue[0]:void 0,u=t.pstyle("loop-direction").pfValue,d=t.pstyle("loop-sweep").pfValue,f=t.pstyle("control-point-step-size").pfValue;a.edgeType="self";var p=r,v=f;n&&(p=0,v=c);var h=u-Math.PI/2,g=h-d/2,y=h+d/2,m=u+"_"+d;p=i[m]===void 0?i[m]=0:++i[m],a.ctrlpts=[s.x+Math.cos(g)*1.4*v*(p/3+1),s.y+Math.sin(g)*1.4*v*(p/3+1),s.x+Math.cos(y)*1.4*v*(p/3+1),s.y+Math.sin(y)*1.4*v*(p/3+1)]},Pt.findCompoundLoopPoints=function(t,e,r,n){var a=t._private.rscratch;a.edgeType="compound";var i=e.srcPos,s=e.tgtPos,l=e.srcW,c=e.srcH,u=e.tgtW,d=e.tgtH,f=t.pstyle("control-point-step-size").pfValue,p=t.pstyle("control-point-distances"),v=p?p.pfValue[0]:void 0,h=r,g=f;n&&(h=0,g=v);var y=50,m={x:i.x-l/2,y:i.y-c/2},b={x:s.x-u/2,y:s.y-d/2},w={x:Math.min(m.x,b.x),y:Math.min(m.y,b.y)},C=.5,x=Math.max(C,Math.log(l*.01)),E=Math.max(C,Math.log(u*.01));a.ctrlpts=[w.x,w.y-(1+Math.pow(y,1.12)/100)*g*(h/3+1)*x,w.x-(1+Math.pow(y,1.12)/100)*g*(h/3+1)*E,w.y]},Pt.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"},Pt.findBezierPoints=function(t,e,r,n,a){var i=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,l=t.pstyle("control-point-distances"),c=t.pstyle("control-point-weights"),u=l&&c?Math.min(l.value.length,c.value.length):1,d=l?l.pfValue[0]:void 0,f=c.value[0],p=n;i.edgeType=p?"multibezier":"bezier",i.ctrlpts=[];for(var v=0;v<u;v++){var h=(.5-e.eles.length/2+r)*s*(a?-1:1),g=void 0,y=fh(h);p&&(d=l?l.pfValue[v]:s,f=c.value[v]),n?g=d:g=d!==void 0?y*d:void 0;var m=g!==void 0?g:h,b=1-f,w=f,C=this.findMidptPtsEtc(t,e),x=C.midptPts,E=C.vectorNormInverse,k={x:x.x1*b+x.x2*w,y:x.y1*b+x.y2*w};i.ctrlpts.push(k.x+E.x*m,k.y+E.y*m)}},Pt.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var n="vertical",a="horizontal",i="leftward",s="rightward",l="downward",c="upward",u="auto",d=e.posPts,f=e.srcW,p=e.srcH,v=e.tgtW,h=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==="%",x=w.pfValue,E=x<0,k=t.pstyle("taxi-turn-min-distance").pfValue,B=y?(f+v)/2:0,S=y?(p+h)/2:0,N=d.x2-d.x1,D=d.y2-d.y1,P=function(we,Ce){return we>0?Math.max(we-Ce,0):Math.min(we+Ce,0)},I=P(N,B),_=P(D,S),F=!1;b===u?m=Math.abs(I)>Math.abs(_)?a:n:b===c||b===l?(m=n,F=!0):(b===i||b===s)&&(m=a,F=!0);var O=m===n,M=O?_:I,L=O?D:N,V=fh(L),H=!1;!(F&&(C||E))&&(b===l&&L<0||b===c&&L>0||b===i&&L>0||b===s&&L<0)&&(V*=-1,M=V*Math.abs(M),H=!0);var $;if(C){var z=x<0?1+x:x;$=z*M}else{var j=x<0?M:0;$=j+x*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($)),re=J||X;if(re&&!H)if(O){var Y=Math.abs(L)<=p/2,A=Math.abs(N)<=v/2;if(Y){var K=(d.x1+d.x2)/2,W=d.y1,oe=d.y2;r.segpts=[K,W,K,oe]}else if(A){var he=(d.y1+d.y2)/2,ne=d.x1,se=d.x2;r.segpts=[ne,he,se,he]}else r.segpts=[d.x1,d.y2]}else{var ue=Math.abs(L)<=f/2,pe=Math.abs(D)<=h/2;if(ue){var de=(d.y1+d.y2)/2,me=d.x1,Ne=d.x2;r.segpts=[me,de,Ne,de]}else if(pe){var De=(d.x1+d.x2)/2,Ee=d.y1,Pe=d.y2;r.segpts=[De,Ee,De,Pe]}else r.segpts=[d.x2,d.y1]}else if(O){var te=d.y1+$+(y?p/2*V:0),T=d.x1,R=d.x2;r.segpts=[T,te,R,te]}else{var Q=d.x1+$+(y?f/2*V:0),G=d.y1,U=d.y2;r.segpts=[Q,G,Q,U]}if(r.isRound){var ie=t.pstyle("taxi-radius").value,Z=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(ie),r.isArcRadius=new Array(r.segpts.length/2).fill(Z)}},Pt.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,a=e.tgtPos,i=e.srcW,s=e.srcH,l=e.tgtW,c=e.tgtH,u=e.srcShape,d=e.tgtShape,f=e.srcCornerRadius,p=e.tgtCornerRadius,v=e.srcRs,h=e.tgtRs,g=!le(r.startX)||!le(r.startY),y=!le(r.arrowStartX)||!le(r.arrowStartY),m=!le(r.endX)||!le(r.endY),b=!le(r.arrowEndX)||!le(r.arrowEndY),w=3,C=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,x=w*C,E=Fn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),k=E<x,B=Fn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),S=B<x,N=!1;if(g||y||k){N=!0;var D={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},P=Math.sqrt(D.x*D.x+D.y*D.y),I={x:D.x/P,y:D.y/P},_=Math.max(i,s),F={x:r.ctrlpts[0]+I.x*2*_,y:r.ctrlpts[1]+I.y*2*_},O=u.intersectLine(n.x,n.y,i,s,F.x,F.y,0,f,v);k?(r.ctrlpts[0]=r.ctrlpts[0]+I.x*(x-E),r.ctrlpts[1]=r.ctrlpts[1]+I.y*(x-E)):(r.ctrlpts[0]=O[0]+I.x*x,r.ctrlpts[1]=O[1]+I.y*x)}if(m||b||S){N=!0;var M={x:r.ctrlpts[0]-a.x,y:r.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:r.ctrlpts[0]+V.x*2*H,y:r.ctrlpts[1]+V.y*2*H},z=d.intersectLine(a.x,a.y,l,c,$.x,$.y,0,p,h);S?(r.ctrlpts[0]=r.ctrlpts[0]+V.x*(x-B),r.ctrlpts[1]=r.ctrlpts[1]+V.y*(x-B)):(r.ctrlpts[0]=z[0]+V.x*x,r.ctrlpts[1]=z[1]+V.y*x)}N&&this.findEndpoints(t)}},Pt.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 r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var n,a;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,a=.5,e.midX=ft(e.allpts[n],e.allpts[n+2],e.allpts[n+4],a),e.midY=ft(e.allpts[n+1],e.allpts[n+3],e.allpts[n+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(Tc({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 c=e.segpts.length/2,u=c-2;e.midX=(e.segpts[u]+e.segpts[c])/2,e.midY=(e.segpts[u+1]+e.segpts[c+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]},p=e.roundCorners[d/2],v=[f.x-p.cx,f.y-p.cy],h=p.radius/Math.sqrt(Math.pow(v[0],2)+Math.pow(v[1],2));v=v.map(function(g){return g*h}),e.midX=p.cx+v[0],e.midY=p.cy+v[1],e.midVector=v}}}},Pt.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,Ae("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."))},Pt.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,n=r.cy,a=n.hasCompoundNodes(),i={map:new kr,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 kr,this.map.set(k[0],S)),S.set(k[1],B)}},s=[],l=[],c=0;c<t.length;c++){var u=t[c],d=u._private,f=u.pstyle("curve-style").value;if(!(u.removed()||!u.takesUpSpace())){if(f==="haystack"){l.push(u);continue}var p=f==="unbundled-bezier"||f.endsWith("segments")||f==="straight"||f==="straight-triangle"||f.endsWith("taxi"),v=f==="unbundled-bezier"||f==="bezier",h=d.source,g=d.target,y=h.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(u),p&&(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()});Ul(S.eles),D.forEach(function(Q){return S.eles.push(Q)}),S.eles.sort(function(Q,G){return Q.poolIndex()-G.poolIndex()})}var P=S.eles[0],I=P.source(),_=P.target();if(I.poolIndex()>_.poolIndex()){var F=I;I=_,_=F}var O=S.srcPos=I.position(),M=S.tgtPos=_.position(),L=S.srcW=I.outerWidth(),V=S.srcH=I.outerHeight(),H=S.tgtW=_.outerWidth(),$=S.tgtH=_.outerHeight(),z=S.srcShape=r.nodeShapes[e.getNodeShape(I)],j=S.tgtShape=r.nodeShapes[e.getNodeShape(_)],ee=S.srcCornerRadius=I.pstyle("corner-radius").value==="auto"?"auto":I.pstyle("corner-radius").pfValue,J=S.tgtCornerRadius=_.pstyle("corner-radius").value==="auto"?"auto":_.pstyle("corner-radius").pfValue,X=S.tgtRs=_._private.rscratch,re=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!==_&&(S.hasBezier||S.hasUnbundled)){S.calculatedIntersection=!0;var ne=z.intersectLine(O.x,O.y,L,V,M.x,M.y,0,ee,re),se=S.srcIntn=ne,ue=j.intersectLine(M.x,M.y,H,$,O.x,O.y,0,J,X),pe=S.tgtIntn=ue,de=S.intersectionPts={x1:ne[0],x2:ue[0],y1:ne[1],y2:ue[1]},me=S.posPts={x1:O.x,x2:M.x,y1:O.y,y2:M.y},Ne=ue[1]-ne[1],De=ue[0]-ne[0],Ee=Math.sqrt(De*De+Ne*Ne),Pe=S.vector={x:De,y:Ne},te=S.vectorNorm={x:Pe.x/Ee,y:Pe.y/Ee},T={x:-te.y,y:te.x};S.nodesOverlap=!le(Ee)||j.checkPoint(ne[0],ne[1],0,H,$,M.x,M.y,J,X)||z.checkPoint(ue[0],ue[1],0,L,V,O.x,O.y,ee,re),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:-Pe.x,y:-Pe.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()||_.isParent()||_.isChild())&&(I.parents().anySame(_)||_.parents().anySame(I)||I.same(_)&&I.isParent())?e.findCompoundLoopPoints(A,R,Y,oe):I===_?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)}},x=0;x<s.length;x++)C(x);this.findHaystackPoints(l)}};function rv(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var n=t[r],a=t[r+1];e.push({x:n,y:a})}return e}}Pt.getSegmentPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="segments")return this.recalculateRenderedStyle(t),rv(e.segpts)},Pt.getControlPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return this.recalculateRenderedStyle(t),rv(e.ctrlpts)},Pt.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var Hi={};Hi.manualEndptToPx=function(t,e){var r=this,n=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]+=n.x,l[1]+=n.y,l}else{var c=e.pfValue[0];c=-Math.PI/2+c;var u=2*Math.max(a,i),d=[n.x+Math.cos(c)*u,n.y+Math.sin(c)*u];return r.nodeShapes[this.getNodeShape(t)].intersectLine(n.x,n.y,a,i,d[0],d[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}},Hi.findEndpoints=function(t){var e=this,r,n=t.source()[0],a=t.target()[0],i=n.position(),s=a.position(),l=t.pstyle("target-arrow-shape").value,c=t.pstyle("source-arrow-shape").value,u=t.pstyle("target-distance-from-node").pfValue,d=t.pstyle("source-distance-from-node").pfValue,f=n._private.rscratch,p=a._private.rscratch,v=t.pstyle("curve-style").value,h=t._private.rscratch,g=h.edgeType,y=v==="taxi",m=g==="self"||g==="compound",b=g==="bezier"||g==="multibezier"||m,w=g!=="bezier",C=g==="straight"||g==="segments",x=g==="segments",E=b||w||C,k=m||y,B=t.pstyle("source-endpoint"),S=k?"outside-to-node":B.value,N=n.pstyle("corner-radius").value==="auto"?"auto":n.pstyle("corner-radius").pfValue,D=t.pstyle("target-endpoint"),P=k?"outside-to-node":D.value,I=a.pstyle("corner-radius").value==="auto"?"auto":a.pstyle("corner-radius").pfValue;h.srcManEndpt=B,h.tgtManEndpt=D;var _,F,O,M;if(b){var L=[h.ctrlpts[0],h.ctrlpts[1]],V=w?[h.ctrlpts[h.ctrlpts.length-2],h.ctrlpts[h.ctrlpts.length-1]]:L;_=V,F=L}else if(C){var H=x?h.segpts.slice(0,2):[s.x,s.y],$=x?h.segpts.slice(h.segpts.length-2):[i.x,i.y];_=$,F=H}if(P==="inside-to-node")r=[s.x,s.y];else if(D.units)r=this.manualEndptToPx(a,D);else if(P==="outside-to-line")r=h.tgtIntn;else if(P==="outside-to-node"||P==="outside-to-node-or-label"?O=_:(P==="outside-to-line"||P==="outside-to-line-or-label")&&(O=[i.x,i.y]),r=e.nodeShapes[this.getNodeShape(a)].intersectLine(s.x,s.y,a.outerWidth(),a.outerHeight(),O[0],O[1],0,I,p),P==="outside-to-node-or-label"||P==="outside-to-line-or-label"){var z=a._private.rscratch,j=z.labelWidth,ee=z.labelHeight,J=z.labelX,X=z.labelY,re=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-=re:K==="right"&&(J+=re);var W=Ni(O[0],O[1],[J-re,X-Y,J+re,X-Y,J+re,X+Y,J-re,X+Y],s.x,s.y);if(W.length>0){var oe=i,he=An(oe,ga(r)),ne=An(oe,ga(W)),se=he;if(ne<he&&(r=W,se=ne),W.length>2){var ue=An(oe,{x:W[2],y:W[3]});ue<se&&(r=[W[2],W[3]])}}}var pe=Uo(r,_,e.arrowShapes[l].spacing(t)+u),de=Uo(r,_,e.arrowShapes[l].gap(t)+u);if(h.endX=de[0],h.endY=de[1],h.arrowEndX=pe[0],h.arrowEndY=pe[1],S==="inside-to-node")r=[i.x,i.y];else if(B.units)r=this.manualEndptToPx(n,B);else if(S==="outside-to-line")r=h.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]),r=e.nodeShapes[this.getNodeShape(n)].intersectLine(i.x,i.y,n.outerWidth(),n.outerHeight(),M[0],M[1],0,N,f),S==="outside-to-node-or-label"||S==="outside-to-line-or-label"){var me=n._private.rscratch,Ne=me.labelWidth,De=me.labelHeight,Ee=me.labelX,Pe=me.labelY,te=Ne/2,T=De/2,R=n.pstyle("text-valign").value;R==="top"?Pe-=T:R==="bottom"&&(Pe+=T);var Q=n.pstyle("text-halign").value;Q==="left"?Ee-=te:Q==="right"&&(Ee+=te);var G=Ni(M[0],M[1],[Ee-te,Pe-T,Ee+te,Pe-T,Ee+te,Pe+T,Ee-te,Pe+T],i.x,i.y);if(G.length>0){var U=s,ie=An(U,ga(r)),Z=An(U,ga(G)),ae=ie;if(Z<ie&&(r=[G[0],G[1]],ae=Z),G.length>2){var we=An(U,{x:G[2],y:G[3]});we<ae&&(r=[G[2],G[3]])}}}var Ce=Uo(r,F,e.arrowShapes[c].spacing(t)+d),ge=Uo(r,F,e.arrowShapes[c].gap(t)+d);h.startX=ge[0],h.startY=ge[1],h.arrowStartX=Ce[0],h.arrowStartY=Ce[1],E&&(!le(h.startX)||!le(h.startY)||!le(h.endX)||!le(h.endY)?h.badLine=!0:h.badLine=!1)},Hi.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}}},Hi.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 Bc={};function vD(t,e,r){for(var n=function(u,d,f,p){return ft(u,d,f,p)},a=e._private,i=a.rstyle.bezierPts,s=0;s<t.bezierProjPcts.length;s++){var l=t.bezierProjPcts[s];i.push({x:n(r[0],r[2],r[4],l),y:n(r[1],r[3],r[5],l)})}}Bc.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,n=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var a=0;a+5<r.allpts.length;a+=4)vD(this,t,r.allpts.slice(a,a+6))}else if(n==="segments")for(var i=e.rstyle.linePts=[],a=0;a+1<r.allpts.length;a+=2)i.push({x:r.allpts[a],y:r.allpts[a+1]});else if(n==="haystack"){var s=r.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},Bc.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var Tr={};Tr.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!nn(e)){var r,n,a=t._private,i=t.width(),s=t.height(),l=t.padding(),c=t.position(),u=t.pstyle("text-halign").strValue,d=t.pstyle("text-valign").strValue,f=a.rscratch,p=a.rstyle;switch(u){case"left":r=c.x-i/2-l;break;case"right":r=c.x+i/2+l;break;default:r=c.x}switch(d){case"top":n=c.y-s/2-l;break;case"bottom":n=c.y+s/2+l;break;default:n=c.y}f.labelX=r,f.labelY=n,p.labelX=r,p.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var nv=function(e,r){var n=Math.atan(r/e);return e===0&&n<0&&(n=n*-1),n},av=function(e,r){var n=r.x-e.x,a=r.y-e.y;return nv(n,a)},gD=function(e,r,n,a){var i=Ti(0,a-.001,1),s=Ti(0,a+.001,1),l=ma(e,r,n,i),c=ma(e,r,n,s);return av(l,c)};Tr.recalculateEdgeLabelProjections=function(t){var e,r=t._private,n=r.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:n.midX,y:n.midY};var s=function(f,p,v){sn(r.rscratch,f,p,v),sn(r.rstyle,f,p,v)};s("labelX",null,e.x),s("labelY",null,e.y);var l=nv(n.midDispX,n.midDispY);s("labelAutoAngle",null,l);var c=function d(){if(d.cache)return d.cache;for(var f=[],p=0;p+5<n.allpts.length;p+=4){var v={x:n.allpts[p],y:n.allpts[p+1]},h={x:n.allpts[p+2],y:n.allpts[p+3]},g={x:n.allpts[p+4],y:n.allpts[p+5]};f.push({p0:v,p1:h,p2:g,startDist:0,length:0,segments:[]})}var y=r.rstyle.bezierPts,m=a.bezierProjPcts.length;function b(k,B,S,N,D){var P=Fn(B,S),I=k.segments[k.segments.length-1],_={p0:B,p1:S,t0:N,t1:D,startDist:I?I.startDist+I.length:0,length:P};k.segments.push(_),k.length+=P}for(var w=0;w<f.length;w++){var C=f[w],x=f[w-1];x&&(C.startDist=x.startDist+x.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},u=function(f){var p,v=f==="source";if(i[f]){var h=t.pstyle(f+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var g=c(),y,m=0,b=0,w=0;w<g.length;w++){for(var C=g[v?w:g.length-1-w],x=0;x<C.segments.length;x++){var E=C.segments[v?x:C.segments.length-1-x],k=w===g.length-1&&x===C.segments.length-1;if(m=b,b+=E.length,b>=h||k){y={cp:C,segment:E};break}}if(y)break}var B=y.cp,S=y.segment,N=(h-m)/S.length,D=S.t1-S.t0,P=v?S.t0+D*N:S.t1-D*N;P=Ti(0,P,1),e=ma(B.p0,B.p1,B.p2,P),p=gD(B.p0,B.p1,B.p2,P);break}case"straight":case"segments":case"haystack":{for(var I=0,_,F,O,M,L=n.allpts.length,V=0;V+3<L&&(v?(O={x:n.allpts[V],y:n.allpts[V+1]},M={x:n.allpts[V+2],y:n.allpts[V+3]}):(O={x:n.allpts[L-2-V],y:n.allpts[L-1-V]},M={x:n.allpts[L-4-V],y:n.allpts[L-3-V]}),_=Fn(O,M),F=I,I+=_,!(I>=h));V+=2);var H=h-F,$=H/_;$=Ti(0,$,1),e=CT(O,M,$),p=av(O,M);break}}s("labelX",f,e.x),s("labelY",f,e.y),s("labelAutoAngle",f,p)}};u("source"),u("target"),this.applyLabelDimensions(t)}},Tr.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},Tr.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),a=this.calculateLabelDimensions(t,n),i=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,l=ur(r.rscratch,"labelWrapCachedLines",e)||[],c=s!=="wrap"?1:Math.max(l.length,1),u=a.height/c,d=u*i,f=a.width,p=a.height+(c-1)*(i-1)*u;sn(r.rstyle,"labelWidth",e,f),sn(r.rscratch,"labelWidth",e,f),sn(r.rstyle,"labelHeight",e,p),sn(r.rscratch,"labelHeight",e,p),sn(r.rscratch,"labelLineHeight",e,d)},Tr.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",a=t.pstyle(n+"label").strValue,i=t.pstyle("text-transform").value,s=function(j,ee){return ee?(sn(r.rscratch,j,e,ee),ee):ur(r.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 c=s("labelKey");if(c!=null&&s("labelWrapKey")===c)return s("labelWrapCachedText");for(var u="​",d=a.split(`
33
- `),f=t.pstyle("text-max-width").pfValue,p=t.pstyle("text-overflow-wrap").value,v=p==="anywhere",h=[],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(u);m=C}if(w>f){var x=m.matchAll(g),E="",k=0,B=Rf(x),S;try{for(B.s();!(S=B.n()).done;){var N=S.value,D=N[0],P=m.substring(k,N.index);k=N.index+D.length;var I=E.length===0?P:E+P+D,_=this.calculateLabelDimensions(t,I),F=_.width;F<=f?E+=P+D:(E&&h.push(E),E=P+D)}}catch(z){B.e(z)}finally{B.f()}E.match(/^[\s\u200b]+$/)||h.push(E)}else h.push(m)}s("labelWrapCachedLines",h),a=s("labelWrapCachedText",h.join(`
32
+ */var gp=function(e,r){this.recycle(e,r)};function Fi(){return!1}function ns(){return!0}gp.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Fi,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?ns:Fi):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*a+i.x,y:n.y*a+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=ns;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=ns;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ns,this.stopPropagation()},isDefaultPrevented:Fi,isPropagationStopped:Fi,isImmediatePropagationStopped:Fi};var mp=/^([^.]+)(\.(?:[^.]+))?$/,y4=".*",yp={qualifierCompare:function(e,r){return e===r},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},bp=Object.keys(yp),b4={};function as(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b4,e=arguments.length>1?arguments[1]:void 0,r=0;r<bp.length;r++){var n=bp[r];this[n]=t[n]||yp[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var pn=as.prototype,wp=function(e,r,n,a,i,s,l){Ye(a)&&(i=a,a=null),l&&(s==null?s=l:s=xe({},s,l));for(var c=Ke(n)?n:n.split(/\s+/),u=0;u<c.length;u++){var d=c[u];if(!nn(d)){var f=d.match(mp);if(f){var p=f[1],v=f[2]?f[2]:null,h=r(e,d,p,v,a,i,s);if(h===!1)break}}}},Cp=function(e,r){return e.addEventFields(e.context,r),new gp(r.type,r)},w4=function(e,r,n){if($E(n)){r(e,n);return}else if(Oe(n)){r(e,Cp(e,n));return}for(var a=Ke(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var s=a[i];if(!nn(s)){var l=s.match(mp);if(l){var c=l[1],u=l[2]?l[2]:null,d=Cp(e,{type:c,namespace:u,target:e.context});r(e,d)}}}};pn.on=pn.addListener=function(t,e,r,n,a){return wp(this,function(i,s,l,c,u,d,f){Ye(d)&&i.listeners.push({event:s,callback:d,type:l,namespace:c,qualifier:u,conf:f})},t,e,r,n,a),this},pn.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})},pn.removeListener=pn.off=function(t,e,r,n){var a=this;this.emitting!==0&&(this.listeners=YS(this.listeners));for(var i=this.listeners,s=function(u){var d=i[u];wp(a,function(f,p,v,h,g,y){if((d.type===v||t==="*")&&(!h&&d.namespace!==".*"||d.namespace===h)&&(!g||f.qualifierCompare(d.qualifier,g))&&(!y||d.callback===y))return i.splice(u,1),!1},t,e,r,n)},l=i.length-1;l>=0;l--)s(l);return this},pn.removeAllListeners=function(){return this.removeListener("*")},pn.emit=pn.trigger=function(t,e,r){var n=this.listeners,a=n.length;return this.emitting++,Ke(e)||(e=[e]),w4(this,function(i,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],a=n.length);for(var l=function(d){var f=n[d];if(f.type===s.type&&(!f.namespace||f.namespace===s.namespace||f.namespace===y4)&&i.eventMatches(i.context,f,s)){var p=[s];e!=null&&XS(p,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),h=f.callback.apply(v,p);i.afterEmit(i.context,f,s),h===!1&&(s.stopPropagation(),s.preventDefault())}},c=0;c<a;c++)l(c);i.bubble(i.context)&&!s.isPropagationStopped()&&i.parent(i.context).emit(s,e)},t),this.emitting--,this};var C4={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&gi(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e},beforeEmit:function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},is=function(e){return be(e)?new un(e):e},kp={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],n=r._private;n.emitter||(n.emitter=new as(C4,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,n){for(var a=is(r),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,n)}return this},removeListener:function(e,r,n){for(var a=is(r),i=0;i<this.length;i++){var s=this[i];s.emitter().removeListener(e,a,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,n){for(var a=is(r),i=0;i<this.length;i++){var s=this[i];s.emitter().one(e,a,n)}return this},once:function(e,r,n){for(var a=is(r),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,n,{once:!0,onceCollection:this})}},emit:function(e,r){for(var n=0;n<this.length;n++){var a=this[n];a.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this}};Ve.eventAliasesOn(kp);var xp={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),r=this.spawn(),n=0;n<this.length;n++){var a=this[n];a.isNode()?e.push(a):r.push(a)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(be(e)||Ut(e))return new un(e).filter(this);if(Ye(e)){for(var n=this.spawn(),a=this,i=0;i<a.length;i++){var s=a[i],l=r?e.apply(r,[s,i,a]):e(s,i,a);l&&n.push(s)}return n}return this.spawn()},not:function(e){if(e){be(e)&&(e=this.filter(e));for(var r=this.spawn(),n=0;n<this.length;n++){var a=this[n],i=e.has(a);i||r.push(a)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(be(e)){var r=e;return this.filter(r)}for(var n=this.spawn(),a=this,i=e,s=this.length<e.length,l=s?a:i,c=s?i:a,u=0;u<l.length;u++){var d=l[u];c.has(d)&&n.push(d)}return n},xor:function(e){var r=this._private.cy;be(e)&&(e=r.$(e));var n=this.spawn(),a=this,i=e,s=function(c,u){for(var d=0;d<c.length;d++){var f=c[d],p=f._private.data.id,v=u.hasElementWithId(p);v||n.push(f)}};return s(a,i),s(i,a),n},diff:function(e){var r=this._private.cy;be(e)&&(e=r.$(e));var n=this.spawn(),a=this.spawn(),i=this.spawn(),s=this,l=e,c=function(d,f,p){for(var v=0;v<d.length;v++){var h=d[v],g=h._private.data.id,y=f.hasElementWithId(g);y?i.merge(h):p.push(h)}};return c(s,l,n),c(l,s,a),{left:n,right:a,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(be(e)){var n=e;e=r.mutableElements().filter(n)}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 r=this._private,n=r.cy;if(!e)return this;if(e&&be(e)){var a=e;e=n.mutableElements().filter(a)}for(var i=r.map,s=0;s<e.length;s++){var l=e[s],c=l._private.data.id,u=!i.has(c);if(u){var d=this.length++;this[d]=l,i.set(c,{ele:l,index:d})}}return this},unmergeAt:function(e){var r=this[e],n=r.id(),a=this._private,i=a.map;this[e]=void 0,i.delete(n);var s=e===this.length-1;if(this.length>1&&!s){var l=this.length-1,c=this[l],u=c._private.data.id;this[l]=void 0,this[e]=c,i.set(u,{ele:c,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,a=r.map,i=a.get(n);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&be(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=0;a<e.length;a++)this.unmergeOne(e[a]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],a=this,i=0;i<a.length;i++){var s=a[i],l=r?e.apply(r,[s,i,a]):e(s,i,a);n.push(l)}return n},reduce:function(e,r){for(var n=r,a=this,i=0;i<a.length;i++)n=e(n,a[i],i,a);return n},max:function(e,r){for(var n=-1/0,a,i=this,s=0;s<i.length;s++){var l=i[s],c=r?e.apply(r,[l,s,i]):e(l,s,i);c>n&&(n=c,a=l)}return{value:n,ele:a}},min:function(e,r){for(var n=1/0,a,i=this,s=0;s<i.length;s++){var l=i[s],c=r?e.apply(r,[l,s,i]):e(l,s,i);c<n&&(n=c,a=l)}return{value:n,ele:a}}},Le=xp;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 k4={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}},Ep=function(e,r){var n=e.cy(),a=n.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"?Kl:0}var s=i(e)-i(r);if(s!==0)return s;function l(d){var f=d.pstyle("z-index-compare");return f.value==="auto"&&d.isNode()?1:0}var c=l(e)-l(r);if(c!==0)return c;var u=e.pstyle("z-index").value-r.pstyle("z-index").value;return u!==0?u:e.poolIndex()-r.poolIndex()},os={forEach:function(e,r){if(Ye(e))for(var n=this.length,a=0;a<n;a++){var i=this[a],s=r?e.apply(r,[i,a,this]):e(i,a,this);if(s===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var n=[],a=this.length;r==null&&(r=a),e==null&&(e=0),e<0&&(e=a+e),r<0&&(r=a+r);for(var i=e;i>=0&&i<r&&i<a;i++)n.push(this[i]);return this.spawn(n)},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 r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(Ep)},zDepth:function(){var e=this[0];if(e){var r=e._private,n=r.group;if(n==="nodes"){var a=r.data.parent?e.parents().size():0;return e.isParent()?a:Kl-1}else{var i=r.source,s=r.target,l=i.zDepth(),c=s.zDepth();return Math.max(l,c,0)}}}};os.each=os.forEach;var x4=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":ot(Symbol))!=e&&ot(Symbol.iterator)!=e;r&&(os[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,s=this.length;return Af({next:function(){return i<s?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};x4();var E4=wt({nodeDimensionsIncludeLabels:!1}),ss={layoutDimensions:function(e){e=E4(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();r={w:n.w,h:n.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,n){var a=this.nodes().filter(function(x){return!x.isParent()}),i=this.cy(),s=r.eles,l=function(E){return E.id()},c=mi(n,l);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(E,k,B){var S={x:k.x1+k.w/2,y:k.y1+k.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=r.spacingFactor&&r.spacingFactor!==1,f=function(){if(!d)return null;for(var E=zt(),k=0;k<a.length;k++){var B=a[k],S=c(B,k);ST(E,S.x,S.y)}return E},p=f(),v=mi(function(x,E){var k=c(x,E);if(d){var B=Math.abs(r.spacingFactor);k=u(B,p,k)}return r.transform!=null&&(k=r.transform(x,k)),k},l);if(r.animate){for(var h=0;h<a.length;h++){var g=a[h],y=v(g,h),m=r.animateFilter==null||r.animateFilter(g,h);if(m){var b=g.animation({position:y,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else g.position(y)}if(r.fit){var w=i.animation({fit:{boundingBox:s.boundingBoxAt(v),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(w)}else if(r.zoom!==void 0&&r.pan!==void 0){var C=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(C)}e.animations.forEach(function(x){return x.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),ka.all(e.animations.map(function(x){return x.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(v),r.fit&&i.fit(r.eles,r.padding),r.zoom!=null&&i.zoom(r.zoom),r.pan&&i.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var r=this.cy();return r.makeLayout(xe({},e,{eles:this}))}};ss.createLayout=ss.makeLayout=ss.layout;function Sp(t,e,r){var n=r._private,a=n.styleCache=n.styleCache||[],i;return(i=a[t])!=null||(i=a[t]=e(r)),i}function ls(t,e){return t=Mn(t),function(n){return Sp(t,e,n)}}function cs(t,e){t=Mn(t);var r=function(a){return e.call(a)};return function(){var a=this[0];if(a)return Sp(t,r,a)}}var Ct={recalculateRenderedStyle:function(e){var r=this.cy(),n=r.renderer(),a=r.styleEnabled();return n&&a&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(r)}else this.forEach(function(a){r(a),a.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var n=r._private.batchStyleEles;return n.merge(this),this}var a=r.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 r=0;r<this.length;r++){var n=this[r];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],a=n.cy();if(a.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return i??(r?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var a=!1,i=n.style();if(Oe(e)){var s=e;i.applyBypass(this,s,a),this.emitAndNotify("style")}else if(be(e))if(r===void 0){var l=this[0];return l?i.getStylePropertyValue(l,e):void 0}else i.applyBypass(this,e,r,a),this.emitAndNotify("style");else if(e===void 0){var c=this[0];return c?i.getRawStyle(c):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,a=r.style(),i=this;if(e===void 0)for(var s=0;s<i.length;s++){var l=i[s];a.removeAllBypasses(l,n)}else{e=e.split(/\s+/);for(var c=0;c<i.length;c++){var u=i[c];a.removeBypasses(u,e,n)}}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 r=e.hasCompoundNodes(),n=this[0];if(n){var a=n._private,i=n.pstyle("opacity").value;if(!r)return i;var s=a.data.parent?n.parents():null;if(s)for(var l=0;l<s.length;l++){var c=s[l],u=c.pstyle("opacity").value;i=u*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],n=r.cy().hasCompoundNodes();if(r)return n?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function hc(t,e){var r=t._private,n=r.data.parent?t.parents():null;if(n)for(var a=0;a<n.length;a++){var i=n[a];if(!e(i))return!1}return!0}function pc(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,n=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||hc(i,n);var c=l.source,u=l.target;return r(c)&&(!s||hc(c,r))&&(c===u||r(u)&&(!s||hc(u,r)))}}}var Pa=ls("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Ct.takesUpSpace=cs("takesUpSpace",pc({ok:Pa}));var S4=ls("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Pa(t)}),T4=ls("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Pa(t)});Ct.interactive=cs("interactive",pc({ok:S4,parentOk:T4,edgeOkViaNode:Pa})),Ct.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var B4=ls("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Pa(t)}),N4=Pa;Ct.visible=cs("visible",pc({ok:B4,edgeOkViaNode:N4})),Ct.hidden=function(){var t=this[0];if(t)return!t.visible()},Ct.isBundledBezier=cs("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 vn={};function Tp(t){return function(){var e=arguments,r=[];if(e.length===2){var n=e[0],a=e[1];this.on(t.event,n,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 c=this[l],u=!t.ableField||c._private[t.ableField],d=c._private[t.field]!=t.value;if(t.overrideAble){var f=t.overrideAble(c);if(f!==void 0&&(u=f,!f))return this}u&&(c._private[t.field]=t.value,d&&r.push(c))}var p=this.spawn(r);p.updateStyle(),p.emit(t.event),s&&p.emit(s)}return this}}function _a(t){vn[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},vn[t.on]=Tp({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),vn[t.off]=Tp({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}_a({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),_a({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),_a({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),_a({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),vn.deselect=vn.unselect,vn.grabbed=function(){var t=this[0];if(t)return t._private.grabbed},_a({field:"active",on:"activate",off:"unactivate"}),_a({field:"pannable",on:"panify",off:"unpanify"}),vn.inactive=function(){var t=this[0];if(t)return!t._private.active};var Tt={},Bp=function(e){return function(n){for(var a=this,i=[],s=0;s<a.length;s++){var l=a[s];if(l.isNode()){for(var c=!1,u=l.connectedEdges(),d=0;d<u.length;d++){var f=u[d],p=f.source(),v=f.target();if(e.noIncomingEdges&&v===l&&p!==l||e.noOutgoingEdges&&p===l&&v!==l){c=!0;break}}c||i.push(l)}}return this.spawn(i,!0).filter(n)}},Np=function(e){return function(r){for(var n=this,a=[],i=0;i<n.length;i++){var s=n[i];if(s.isNode())for(var l=s.connectedEdges(),c=0;c<l.length;c++){var u=l[c],d=u.source(),f=u.target();e.outgoing&&d===s?(a.push(u),a.push(f)):e.incoming&&f===s&&(a.push(u),a.push(d))}}return this.spawn(a,!0).filter(r)}},Dp=function(e){return function(r){for(var n=this,a=[],i={};;){var s=e.outgoing?n.outgoers():n.incomers();if(s.length===0)break;for(var l=!1,c=0;c<s.length;c++){var u=s[c],d=u.id();i[d]||(i[d]=!0,a.push(u),l=!0)}if(!l)break;n=s}return this.spawn(a,!0).filter(r)}};Tt.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null},xe(Tt,{roots:Bp({noIncomingEdges:!0}),leaves:Bp({noOutgoingEdges:!0}),outgoers:Qt(Np({outgoing:!0}),"outgoers"),successors:Dp({outgoing:!0}),incomers:Qt(Np({incoming:!0}),"incomers"),predecessors:Dp({incoming:!0})}),xe(Tt,{neighborhood:Qt(function(t){for(var e=[],r=this.nodes(),n=0;n<r.length;n++)for(var a=r[n],i=a.connectedEdges(),s=0;s<i.length;s++){var l=i[s],c=l.source(),u=l.target(),d=a===c?u:c;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:Qt(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:Qt(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:Pp({attr:"source"}),targets:Pp({attr:"target"})});function Pp(t){return function(r){for(var n=[],a=0;a<this.length;a++){var i=this[a],s=i._private[t.attr];s&&n.push(s)}return this.spawn(n,!0).filter(r)}}xe(Tt,{edgesWith:Qt(_p(),"edgesWith"),edgesTo:Qt(_p({thisIsSrc:!0}),"edgesTo")});function _p(t){return function(r){var n=[],a=this._private.cy,i=t||{};be(r)&&(r=a.$(r));for(var s=0;s<r.length;s++)for(var l=r[s]._private.edges,c=0;c<l.length;c++){var u=l[c],d=u._private.data,f=this.hasElementWithId(d.source)&&r.hasElementWithId(d.target),p=r.hasElementWithId(d.source)&&this.hasElementWithId(d.target),v=f||p;v&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!f||i.thisIsTgt&&!p)||n.push(u))}return this.spawn(n,!0)}}xe(Tt,{connectedEdges:Qt(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var a=r[n];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:Qt(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var a=r[n];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:Qt(Op(),"parallelEdges"),codirectedEdges:Qt(Op({codirected:!0}),"codirectedEdges")});function Op(t){var e={codirected:!1};return t=xe({},e,t),function(n){for(var a=[],i=this.edges(),s=t,l=0;l<i.length;l++)for(var c=i[l],u=c._private,d=u.source,f=d._private.data.id,p=u.data.target,v=d._private.edges,h=0;h<v.length;h++){var g=v[h],y=g._private.data,m=y.target,b=y.source,w=m===p&&b===f,C=f===m&&p===b;(s.codirected&&w||!s.codirected&&(w||C))&&a.push(g)}return this.spawn(a,!0).filter(n)}}xe(Tt,{components:function(e){var r=this,n=r.cy(),a=n.collection(),i=e==null?r.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 r.spawn();var c=function(){var d=n.collection();s.push(d);var f=i[0];l(f,d),r.bfs({directed:!1,roots:f,visit:function(v){return l(v,d)}}),d.forEach(function(p){p.connectedEdges().forEach(function(v){r.has(v)&&d.has(v.source())&&d.has(v.target())&&d.merge(v)})})};do c();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,r){var n=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 kr,s=!1;if(!r)r=[];else if(r.length>0&&Oe(r[0])&&!gi(r[0])){s=!0;for(var l=[],c=new va,u=0,d=r.length;u<d;u++){var f=r[u];f.data==null&&(f.data={});var p=f.data;if(p.id==null)p.id=ch();else if(e.hasElementWithId(p.id)||c.has(p.id))continue;var v=new Vo(e,f,!1);l.push(v),c.add(p.id)}r=l}this.length=0;for(var h=0,g=r.length;h<g;h++){var y=r[h][0];if(y!=null){var m=y._private.data.id;(!n||!i.has(m))&&(n&&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 kr,C=this.eles,x=0;x<C.length;x++){var E=C[x];w.set(E.id(),{index:x,ele:E})}}},n&&(this._private.map=i),s&&!a&&this.restore()},qe=Vo.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 Kf(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,r=this._private.map.get(t);return r?r.ele:new kt(e)},qe.$id=qe.getElementById,qe.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).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(),r=this.cy();if(e==null&&t)return this;if(e!=null){var n=e._private;if(Oe(t)){if(r.startBatch(),t.data){e.data(t.data);var a=n.data;if(e.isEdge()){var i=!1,s={},l=t.data.source,c=t.data.target;l!=null&&l!=a.source&&(s.source=""+l,i=!0),c!=null&&c!=a.target&&(s.target=""+c,i=!0),i&&(e=e.move(s))}else{var u="parent"in t.data,d=t.data.parent;u&&(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!==n[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),r.endBatch(),this}else if(t===void 0){var p={data:Cr(n.data),position:Cr(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};p.classes="";var v=0;return n.classes.forEach(function(h){return p.classes+=v++===0?h:" "+h}),p}}},qe.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],n=r.json();t.push(n)}return t},qe.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var n=this[r],a=n.json(),i=new Vo(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,r=this,n=r.cy(),a=n._private,i=[],s=[],l,c=0,u=r.length;c<u;c++){var d=r[c];e&&!d.removed()||(d.isNode()?i.push(d):s.push(d))}l=i.concat(s);var f,p=function(){l.splice(f,1),f--};for(f=0;f<l.length;f++){var v=l[f],h=v._private,g=h.data;if(v.clearTraversalCache(),!(!e&&!h.removed)){if(g.id===void 0)g.id=ch();else if(le(g.id))g.id=""+g.id;else if(nn(g.id)||!be(g.id)){Ze("Can not create element with invalid string ID `"+g.id+"`"),p();continue}else if(n.hasElementWithId(g.id)){Ze("Can not create second element with ID `"+g.id+"`"),p();continue}}var y=g.id;if(v.isNode()){var m=h.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,x=!1,E=0;E<C;E++){var k=w[E],B=g[k];le(B)&&(B=g[k]=""+g[k]),B==null||B===""?(Ze("Can not create edge `"+y+"` with unspecified "+k),x=!0):n.hasElementWithId(B)||(Ze("Can not create edge `"+y+"` with nonexistant "+k+" `"+B+"`"),x=!0)}if(x){p();continue}var S=n.getElementById(g.source),N=n.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}h.map=new kr,h.map.set(y,{ele:v,index:0}),h.removed=!1,e&&n.addToPool(v)}for(var D=0;D<i.length;D++){var P=i[D],I=P._private.data;le(I.parent)&&(I.parent=""+I.parent);var _=I.parent,F=_!=null;if(F||P._private.parent){var O=P._private.parent?n.collection().merge(P._private.parent):n.getElementById(_);if(O.empty())I.parent=void 0;else if(O[0].removed())Ae("Node added with missing parent, reference to parent removed"),I.parent=void 0,P._private.parent=null;else{for(var M=!1,L=O;!L.empty();){if(P.same(L)){M=!0,I.parent=void 0;break}L=L.parent()}M||(O[0]._private.children.push(P),P._private.parent=O[0],a.hasCompoundNodes=!0)}}}if(l.length>0){for(var V=l.length===r.length?r:new kt(n,l),H=0;H<V.length;H++){var $=V[H];$.isNode()||($.parallelEdges().clearTraversalCache(),$.source().clearTraversalCache(),$.target().clearTraversalCache())}var z;a.hasCompoundNodes?z=n.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 r},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,r=this,n=[],a={},i=r._private.cy;function s(_){for(var F=_._private.edges,O=0;O<F.length;O++)c(F[O])}function l(_){for(var F=_._private.children,O=0;O<F.length;O++)c(F[O])}function c(_){var F=a[_.id()];e&&_.removed()||F||(a[_.id()]=!0,_.isNode()?(n.push(_),s(_),l(_)):n.unshift(_))}for(var u=0,d=r.length;u<d;u++){var f=r[u];c(f)}function p(_,F){var O=_._private.edges;on(O,F),_.clearTraversalCache()}function v(_){_.clearTraversalCache()}var h=[];h.ids={};function g(_,F){F=F[0],_=_[0];var O=_._private.children,M=_.id();on(O,F),F._private.parent=null,h.ids[M]||(h.ids[M]=!0,h.push(_))}r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var y=0;y<n.length;y++){var m=n[y];if(m.isEdge()){var b=m.source()[0],w=m.target()[0];p(b,m),p(w,m);for(var C=m.parallelEdges(),x=0;x<C.length;x++){var E=C[x];v(E),E.isBundledBezier()&&E.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(),n);D.size()>0&&(t?D.emitAndNotify("remove"):e&&D.emit("remove"));for(var P=0;P<h.length;P++){var I=h[P];(!e||!I.removed())&&I.updateStyle()}return D},qe.move=function(t){var e=this._private.cy,r=this,n=!1,a=!1,i=function(h){return h==null?h:""+h};if(t.source!==void 0||t.target!==void 0){var s=i(t.source),l=i(t.target),c=s!=null&&e.hasElementWithId(s),u=l!=null&&e.hasElementWithId(l);(c||u)&&(e.batch(function(){r.remove(n,a),r.emitAndNotify("moveout");for(var v=0;v<r.length;v++){var h=r[v],g=h._private.data;h.isEdge()&&(c&&(g.source=s),u&&(g.target=l))}r.restore(n,a)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var d=i(t.parent),f=d===null||e.hasElementWithId(d);if(f){var p=d===null?void 0:d;e.batch(function(){var v=r.remove(n,a);v.emitAndNotify("moveout");for(var h=0;h<r.length;h++){var g=r[h],y=g._private.data;g.isNode()&&(y.parent=p)}v.restore(n,a)}),r.emitAndNotify("move")}}return this},[Fh,RN,es,fn,Ba,t4,ts,m4,kp,xp,k4,os,ss,Ct,vn,Tt].forEach(function(t){xe(qe,t)});var D4={add:function(e){var r,n=this;if(Ut(e)){var a=e;if(a._private.cy===n)r=a.restore();else{for(var i=[],s=0;s<a.length;s++){var l=a[s];i.push(l.json())}r=new kt(n,i)}}else if(Ke(e)){var c=e;r=new kt(n,c)}else if(Oe(e)&&(Ke(e.nodes)||Ke(e.edges))){for(var u=e,d=[],f=["nodes","edges"],p=0,v=f.length;p<v;p++){var h=f[p],g=u[h];if(Ke(g))for(var y=0,m=g.length;y<m;y++){var b=xe({group:h},g[y]);d.push(b)}}r=new kt(n,d)}else{var w=e;r=new Vo(n,w).collection()}return r},remove:function(e){if(!Ut(e)){if(be(e)){var r=e;e=this.$(r)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function P4(t,e,r,n){var a=4,i=.001,s=1e-7,l=10,c=11,u=1/(c-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),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var p=d?new Float32Array(c):new Array(c);function v(N,D){return 1-3*D+3*N}function h(N,D){return 3*D-6*N}function g(N){return 3*N}function y(N,D,P){return((v(D,P)*N+h(D,P))*N+g(D))*N}function m(N,D,P){return 3*v(D,P)*N*N+2*h(D,P)*N+g(D)}function b(N,D){for(var P=0;P<a;++P){var I=m(D,t,r);if(I===0)return D;var _=y(D,t,r)-N;D-=_/I}return D}function w(){for(var N=0;N<c;++N)p[N]=y(N*u,t,r)}function C(N,D,P){var I,_,F=0;do _=D+(P-D)/2,I=y(_,t,r)-N,I>0?P=_:D=_;while(Math.abs(I)>s&&++F<l);return _}function x(N){for(var D=0,P=1,I=c-1;P!==I&&p[P]<=N;++P)D+=u;--P;var _=(N-p[P])/(p[P+1]-p[P]),F=D+_*u,O=m(F,t,r);return O>=i?b(N,F):O===0?F:C(N,D,D+u)}var E=!1;function k(){E=!0,(t!==e||r!==n)&&w()}var B=function(D){return E||k(),t===e&&r===n?D:D===0?0:D===1?1:y(x(D),e,n)};B.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var S="generateBezier("+[t,e,r,n]+")";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 _4=function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,a,i){var s={x:n.x+i.dx*a,v:n.v+i.dv*a,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,a){var i={dx:n.v,dv:t(n)},s=e(n,a*.5,i),l=e(n,a*.5,s),c=e(n,a,l),u=1/6*(i.dx+2*(s.dx+l.dx)+c.dx),d=1/6*(i.dv+2*(s.dv+l.dv)+c.dv);return n.x=n.x+u*a,n.v=n.v+d*a,n}return function n(a,i,s){var l={x:-1,v:0,tension:null,friction:null},c=[0],u=0,d=1/1e4,f=16/1e3,p,v,h;for(a=parseFloat(a)||500,i=parseFloat(i)||20,s=s||null,l.tension=a,l.friction=i,p=s!==null,p?(u=n(a,i),v=u/s*f):v=f;h=r(h||l,v),c.push(1+h.x),u+=16,Math.abs(h.x)>d&&Math.abs(h.v)>d;);return p?function(g){return c[g*(c.length-1)|0]}:u}}(),Ue=function(e,r,n,a){var i=P4(e,r,n,a);return function(s,l,c){return s+(l-s)*i(c)}},us={linear:function(e,r,n){return e+(r-e)*n},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,r,n){if(n===0)return us.linear;var a=_4(e,r,n);return function(i,s,l){return i+(s-i)*a(l)}},"cubic-bezier":Ue};function Ip(t,e,r,n,a){if(n===1||e===r)return r;var i=a(e,r,n);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 Lp(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Oa(t,e,r,n,a){var i=a!=null?a.type:null;r<0?r=0:r>1&&(r=1);var s=Lp(t,a),l=Lp(e,a);if(le(s)&&le(l))return Ip(i,s,l,r,n);if(Ke(s)&&Ke(l)){for(var c=[],u=0;u<l.length;u++){var d=s[u],f=l[u];if(d!=null&&f!=null){var p=Ip(i,d,f,r,n);c.push(p)}else c.push(f)}return c}}function O4(t,e,r,n){var a=!n,i=t._private,s=e._private,l=s.easing,c=s.startTime,u=n?t:t.cy(),d=u.style();if(!s.easingImpl)if(l==null)s.easingImpl=us.linear;else{var f;if(be(l)){var p=d.parse("transition-timing-function",l);f=p.value}else f=l;var v,h;be(f)?(v=f,h=[]):(v=f[1],h=f.slice(2).map(function(V){return+V})),h.length>0?(v==="spring"&&h.push(s.duration),s.easingImpl=us[v].apply(null,h)):s.easingImpl=us[v]}var g=s.easingImpl,y;if(s.duration===0?y=1:y=(r-c)/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={};Ai(m.x,b.x)&&(w.x=Oa(m.x,b.x,y,g)),Ai(m.y,b.y)&&(w.y=Oa(m.y,b.y,y,g)),t.position(w)}var C=s.startPan,x=s.pan,E=i.pan,k=x!=null&&n;k&&(Ai(C.x,x.x)&&(E.x=Oa(C.x,x.x,y,g)),Ai(C.y,x.y)&&(E.y=Oa(C.y,x.y,y,g)),t.emit("pan"));var B=s.startZoom,S=s.zoom,N=S!=null&&n;N&&(Ai(B,S)&&(i.zoom=Ti(i.minZoom,Oa(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 P=0;P<D.length;P++){var I=D[P],_=I.name,F=I,O=s.startStyle[_],M=d.properties[O.name],L=Oa(O,F,y,g,M);d.overrideBypass(t,_,L)}t.emit("style")}}return s.progress=y,y}function Ai(t,e){return t==null||e==null?!1:le(t)&&le(e)?!0:!!(t&&e)}function I4(t,e,r,n){var a=e._private;a.started=!0,a.startTime=r-a.progress*a.duration}function Mp(t,e){var r=e._private.aniEles,n=[];function a(d,f){var p=d._private,v=p.animation.current,h=p.animation.queue,g=!1;if(v.length===0){var y=h.shift();y&&v.push(y)}for(var m=function(E){for(var k=E.length-1;k>=0;k--){var B=E[k];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||I4(d,w,t),O4(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&&h.length===0&&n.push(d),g}for(var i=!1,s=0;s<r.length;s++){var l=r[s],c=a(l);i=i||c}var u=a(e,!0);(i||u)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var L4={animate:Ve.animate(),animation:Ve.animation(),animated:Ve.animated(),clearQueue:Ve.clearQueue(),delay:Ve.delay(),delayAnimation:Ve.delayAnimation(),stop:Ve.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&Mo(function(i){Mp(i,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,s){Mp(s,e)},n.beforeRenderPriorities.animations):r()}},M4={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&gi(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},ds=function(e){return be(e)?new un(e):e},Fp={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new as(M4,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,ds(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,ds(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,ds(r),n),this},once:function(e,r,n){return this.emitter().one(e,ds(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};Ve.eventAliasesOn(Fp);var vc={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};vc.jpeg=vc.jpg;var fs={layout:function(e){var r=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 n=e.name,a=r.extension("layout",n);if(a==null){Ze("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;be(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var s=new a(xe({},e,{cy:r,eles:i}));return s}};fs.createLayout=fs.makeLayout=fs.layout;var F4={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var a=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&a.merge(r);return}if(n.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.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 r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var a=e.batchNotifications[n];a.empty()?r.notify(n):r.notify(n,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),a=0;a<n.length;a++){var i=n[a],s=e[i],l=r.getElementById(i);l.data(s)}})}},A4=wt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),gc={renderTo:function(e,r,n,a){var i=this._private.renderer;return i.renderTo(e,r,n,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 r=this,n=r.extension("renderer",e.name);if(n==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&&Ae("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=A4(e);a.cy=r,r._private.renderer=new n(a),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var a=n._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)}};gc.invalidateDimensions=gc.resize;var hs={collection:function(e,r){return be(e)?this.$(e):Ut(e)?e.collection():Ke(e)?(r||(r={}),new kt(this,e,r.unique,r.removed)):new kt(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};hs.elements=hs.filter=hs.$;var Bt={},Vi="t",V4="f";Bt.apply=function(t){for(var e=this,r=e._private,n=r.cy,a=n.collection(),i=0;i<t.length;i++){var s=t[i],l=e.getContextMeta(s);if(!l.empty){var c=e.getContextStyle(l),u=e.applyContextStyle(l,c,s);s._private.appliedInitStyle?e.updateTransitions(s,u.diffProps):s._private.appliedInitStyle=!0;var d=e.updateStyleHints(s);d&&a.push(s)}}return a},Bt.getPropertiesDiff=function(t,e){var r=this,n=r._private.propDiffs=r._private.propDiffs||{},a=t+"-"+e,i=n[a];if(i)return i;for(var s=[],l={},c=0;c<r.length;c++){var u=r[c],d=t[c]===Vi,f=e[c]===Vi,p=d!==f,v=u.mappedProperties.length>0;if(p||f&&v){var h=void 0;p&&v||p?h=u.properties:v&&(h=u.mappedProperties);for(var g=0;g<h.length;g++){for(var y=h[g],m=y.name,b=!1,w=c+1;w<r.length;w++){var C=r[w],x=e[w]===Vi;if(x&&(b=C.properties[y.name]!=null,b))break}!l[m]&&!b&&(l[m]=!0,s.push(m))}}}return n[a]=s,s},Bt.getContextMeta=function(t){for(var e=this,r="",n,a=t._private.styleCxtKey||"",i=0;i<e.length;i++){var s=e[i],l=s.selector&&s.selector.matches(t);l?r+=Vi:r+=V4}return n=e.getPropertiesDiff(a,r),t._private.styleCxtKey=r,{key:r,diffPropNames:n,empty:n.length===0}},Bt.getContextStyle=function(t){var e=t.key,r=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var a={_private:{key:e}},i=0;i<r.length;i++){var s=r[i],l=e[i]===Vi;if(l)for(var c=0;c<s.properties.length;c++){var u=s.properties[c];a[u.name]=u}}return n[e]=a,a},Bt.applyContextStyle=function(t,e,r){for(var n=this,a=t.diffPropNames,i={},s=n.types,l=0;l<a.length;l++){var c=a[l],u=e[c],d=r.pstyle(c);if(!u)if(d)d.bypass?u={name:c,deleteBypassed:!0}:u={name:c,delete:!0};else continue;if(d!==u){if(u.mapped===s.fn&&d!=null&&d.mapping!=null&&d.mapping.value===u.value){var f=d.mapping,p=f.fnValue=u.value(r);if(p===f.prevFnValue)continue}var v=i[c]={prev:d};n.applyParsedProperty(r,u),v.next=r.pstyle(c),v.next&&v.next.bypass&&(v.next=v.next.bypassed)}}return{diffProps:i}},Bt.updateStyleHints=function(t){var e=t._private,r=this,n=r.propertyGroupNames,a=r.propertyGroupKeys,i=function(W,oe,he){return r.getPropertiesHash(W,oe,he)},s=e.styleKey;if(t.removed())return!1;var l=e.group==="nodes",c=t._private.style;n=Object.keys(c);for(var u=0;u<a.length;u++){var d=a[u];e.styleKeys[d]=[pa,Ci]}for(var f=function(W,oe){return e.styleKeys[oe][0]=ki(W,e.styleKeys[oe][0])},p=function(W,oe){return e.styleKeys[oe][1]=xi(W,e.styleKeys[oe][1])},v=function(W,oe){f(W,oe),p(W,oe)},h=function(W,oe){for(var he=0;he<W.length;he++){var ne=W.charCodeAt(he);f(ne,oe),p(ne,oe)}},g=2e9,y=function(W){return-128<W&&W<128&&Math.floor(W)!==W?g-(W*1024|0):W},m=0;m<n.length;m++){var b=n[m],w=c[b];if(w!=null){var C=this.properties[b],x=C.type,E=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,P=w.units;if(x.number&&D&&!x.multiple){var I=S?k:B;v(y(I),E),!S&&P!=null&&h(P,E)}else h(w.strValue,E)}}for(var _=[pa,Ci],F=0;F<a.length;F++){var O=a[F],M=e.styleKeys[O];_[0]=ki(M[0],_[0]),_[1]=xi(M[1],_[1])}e.styleKey=KS(_[0],_[1]);var L=e.styleKeys;e.labelDimsKey=an(L.labelDimensions);var V=i(t,["label"],L.labelDimensions);if(e.labelKey=an(V),e.labelStyleKey=an(Fo(L.commonLabel,V)),!l){var H=i(t,["source-label"],L.labelDimensions);e.sourceLabelKey=an(H),e.sourceLabelStyleKey=an(Fo(L.commonLabel,H));var $=i(t,["target-label"],L.labelDimensions);e.targetLabelKey=an($),e.targetLabelStyleKey=an(Fo(L.commonLabel,$))}if(l){var z=e.styleKeys,j=z.nodeBody,ee=z.nodeBorder,J=z.nodeOutline,X=z.backgroundImage,re=z.compound,Y=z.pie,A=[j,ee,J,X,re,Y].filter(function(K){return K!=null}).reduce(Fo,[pa,Ci]);e.nodeKey=an(A),e.hasPie=Y!=null&&Y[0]!==pa&&Y[1]!==Ci}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 r=this,n=e,a=t._private.style,i,s=r.types,l=r.properties[n.name].type,c=n.bypass,u=a[n.name],d=u&&u.bypass,f=t._private,p="mapping",v=function(j){return j==null?null:j.pfValue!=null?j.pfValue:j.value},h=function(){var j=v(u),ee=v(n);r.checkTriggers(t,n.name,j,ee)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(n=e=this.parse(e.name,"bezier",c)),n.delete)return a[n.name]=void 0,h(),!0;if(n.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,h(),!0):!1:(h(),!0);if(n.deleteBypass)return u?u.bypass?(a[n.name]=u.bypassed,h(),!0):!1:(h(),!0);var g=function(){Ae("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case s.mapData:{for(var y=n.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 x=n.fieldMax-n.fieldMin;x===0?C=0:C=(m-n.fieldMin)/x}else return Ae("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+m+"` for `"+t.id()+"` is non-numeric)"),!1;if(C<0?C=0:C>1&&(C=1),l.color){var E=n.valueMin[0],k=n.valueMax[0],B=n.valueMin[1],S=n.valueMax[1],N=n.valueMin[2],D=n.valueMax[2],P=n.valueMin[3]==null?1:n.valueMin[3],I=n.valueMax[3]==null?1:n.valueMax[3],_=[Math.round(E+(k-E)*C),Math.round(B+(S-B)*C),Math.round(N+(D-N)*C),Math.round(P+(I-P)*C)];i={bypass:n.bypass,name:n.name,value:_,strValue:"rgb("+_[0]+", "+_[1]+", "+_[2]+")"}}else if(l.number){var F=n.valueMin+(n.valueMax-n.valueMin)*C;i=this.parse(n.name,F,n.bypass,p)}else return!1;if(!i)return g(),!1;i.mapping=n,n=i;break}case s.data:{for(var O=n.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(n.name,M,n.bypass,p)),!i)return g(),!1;i.mapping=n,n=i;break}case s.fn:{var H=n.value,$=n.fnValue!=null?n.fnValue:H(t);if(n.prevFnValue=$,$==null)return Ae("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(n.name,$,n.bypass,p),!i)return Ae("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=Cr(n),n=i;break}case void 0:break;default:return!1}return c?(d?n.bypassed=u.bypassed:n.bypassed=u,a[n.name]=n):d?u.bypassed=n:a[n.name]=n,h(),!0},Bt.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),!e)n._private.style={};else for(var a=n._private.style,i=Object.keys(a),s=0;s<i.length;s++){var l=i[s],c=a[l];c!=null&&(c.bypass?c.bypassed=null:a[l]=null)}}},Bt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()},Bt.updateTransitions=function(t,e){var r=this,n=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={},c=!1,u=0;u<a.length;u++){var d=a[u],f=t.pstyle(d),p=e[d];if(p){var v=p.prev,h=v,g=p.next!=null?p.next:f,y=!1,m=void 0,b=1e-6;h&&(le(h.pfValue)&&le(g.pfValue)?(y=g.pfValue-h.pfValue,m=h.pfValue+b*y):le(h.value)&&le(g.value)?(y=g.value-h.value,m=h.value+b*y):Ke(h.value)&&Ke(g.value)&&(y=h.value[0]!==g.value[0]||h.value[1]!==g.value[1]||h.value[2]!==g.value[2],m=h.strValue),y&&(l[d]=g.strValue,this.applyBypass(t,d,m),c=!0))}}if(!c)return;n.transitioning=!0,new ka(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(){r.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1)},Bt.checkTrigger=function(t,e,r,n,a,i){var s=this.properties[e],l=a(s);l!=null&&l(r,n)&&i(s)},Bt.checkZOrderTrigger=function(t,e,r,n){var a=this;this.checkTrigger(t,e,r,n,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",t)})},Bt.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(a){return a.triggersBounds},function(a){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),a.triggersBoundsOfParallelBeziers&&e==="curve-style"&&(r==="bezier"||n==="bezier")&&t.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()}),a.triggersBoundsOfConnectedEdges&&e==="display"&&(r==="none"||n==="none")&&t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},Bt.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n)};var Ri={};Ri.applyBypass=function(t,e,r,n){var a=this,i=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var l=0;l<a.properties.length;l++){var c=a.properties[l],u=c.name,d=this.parse(u,r,!0);d&&i.push(d)}}else if(be(e)){var f=this.parse(e,r,!0);f&&i.push(f)}else if(Oe(e)){var p=e;n=r;for(var v=Object.keys(p),h=0;h<v.length;h++){var g=v[h],y=p[g];if(y===void 0&&(y=p[Oo(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],x={},E=void 0,k=0;k<i.length;k++){var B=i[k];if(n){var S=C.pstyle(B.name);E=x[B.name]={prev:S}}b=this.applyParsedProperty(C,Cr(B))||b,n&&(E.next=C.pstyle(B.name))}b&&this.updateStyleHints(C),n&&this.updateTransitions(C,x,s)}return b},Ri.overrideBypass=function(t,e,r){e=$l(e);for(var n=0;n<t.length;n++){var a=t[n],i=a._private.style[e],s=this.properties[e].type,l=s.color,c=s.mutiple,u=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,e,r):(i.value=r,i.pfValue!=null&&(i.pfValue=r),l?i.strValue="rgb("+r.join(",")+")":c?i.strValue=r.join(" "):i.strValue=""+r,this.updateStyleHints(a)),this.checkTriggers(a,e,u,r)}},Ri.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)},Ri.removeBypasses=function(t,e,r){for(var n=!0,a=0;a<t.length;a++){for(var i=t[a],s={},l=0;l<e.length;l++){var c=e[l],u=this.properties[c],d=i.pstyle(u.name);if(!(!d||!d.bypass)){var f="",p=this.parse(c,f,!0),v=s[u.name]={prev:d};this.applyParsedProperty(i,p),v.next=i.pstyle(u.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,s,n)}};var mc={};mc.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1},mc.containerCss=function(t){var e=this._private.cy,r=e.container(),n=e.window();if(n&&r&&n.getComputedStyle)return n.getComputedStyle(r).getPropertyValue(t)};var xr={};xr.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)},xr.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var n={},a=0;a<r.properties.length;a++){var i=r.properties[a],s=r.getStylePropertyValue(t,i.name,e);s!=null&&(n[i.name]=s,n[Oo(i.name)]=s)}return n}},xr.getIndexedStyle=function(t,e,r,n){var a=t.pstyle(e)[r][n];return a??t.cy().style().getDefaultProperty(e)[r][0]},xr.getStylePropertyValue=function(t,e,r){var n=this;if(t=t[0],t){var a=n.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,s=t.pstyle(a.name);if(s){var l=s.value,c=s.units,u=s.strValue;if(r&&i.number&&l!=null&&le(l)){var d=t.cy().zoom(),f=function(y){return y*d},p=function(y,m){return f(y)+m},v=Ke(l),h=v?c.every(function(g){return g!=null}):c!=null;return h?v?l.map(function(g,y){return p(g,c[y])}).join(" "):p(l,c):v?l.map(function(g){return be(g)?g:""+f(g)}).join(" "):""+f(l)}else if(u!=null)return u}return null}},xr.getAnimationStartStyle=function(t,e){for(var r={},n=0;n<e.length;n++){var a=e[n],i=a.name,s=t.pstyle(i);s!==void 0&&(Oe(s)?s=this.parse(i,s.strValue):s=this.parse(i,s)),s&&(r[i]=s)}return r},xr.getPropsList=function(t){var e=this,r=[],n=t,a=e.properties;if(n)for(var i=Object.keys(n),s=0;s<i.length;s++){var l=i[s],c=n[l],u=a[l]||a[$l(l)],d=this.parse(u.name,c);d&&r.push(d)}return r},xr.getNonDefaultPropertiesHash=function(t,e,r){var n=r.slice(),a,i,s,l,c,u;for(c=0;c<e.length;c++)if(a=e[c],i=t.pstyle(a,!1),i!=null)if(i.pfValue!=null)n[0]=ki(l,n[0]),n[1]=xi(l,n[1]);else for(s=i.strValue,u=0;u<s.length;u++)l=s.charCodeAt(u),n[0]=ki(l,n[0]),n[1]=xi(l,n[1]);return n},xr.getPropertiesHash=xr.getNonDefaultPropertiesHash;var ps={};ps.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var n=t[r],a=n.selector,i=n.style||n.css,s=Object.keys(i);e.selector(a);for(var l=0;l<s.length;l++){var c=s[l],u=i[c];e.css(c,u)}}return e},ps.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e},ps.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],n=r.selector,a=r.properties,i={},s=0;s<a.length;s++){var l=a[s];i[l.name]=l.strValue}t.push({selector:n?n.toString():"core",style:i})}return t};var yc={};yc.appendFromString=function(t){var e=this,r=this,n=""+t,a,i,s;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function l(){n.length>a.length?n=n.substr(a.length):n=""}function c(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var d=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){Ae("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}a=d[0];var f=d[1];if(f!=="core"){var p=new un(f);if(p.invalid){Ae("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),l();continue}}var v=d[2],h=!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){Ae("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+v),h=!0;break}s=m[0];var b=m[1],w=m[2],C=e.properties[b];if(!C){Ae("Skipping property: Invalid property name in: "+s),c();continue}var x=r.parse(b,w);if(!x){Ae("Skipping property: Invalid property definition in: "+s),c();continue}g.push({name:b,val:w}),c()}if(h){l();break}r.selector(f);for(var E=0;E<g.length;E++){var k=g[E];r.css(k.name,k.val)}l()}return r},yc.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var xt={};(function(){var t=lt,e=GE,r=jE,n=YE,a=ZE,i=function(A){return"^"+A+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(A){var K=t+"|\\w+|"+e+"|"+r+"|"+n+"|"+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 c={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=nn(A),oe=nn(K);return W&&!oe||!W&&oe}},u=xt.types,d=[{name:"label",type:u.text,triggersBounds:c.any,triggersZOrder:c.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any}],f=[{name:"source-label",type:u.text,triggersBounds:c.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"source-text-offset",type:u.size,triggersBounds:c.any}],p=[{name:"target-label",type:u.text,triggersBounds:c.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"target-text-offset",type:u.size,triggersBounds:c.any}],v=[{name:"font-family",type:u.fontFamily,triggersBounds:c.any},{name:"font-style",type:u.fontStyle,triggersBounds:c.any},{name:"font-weight",type:u.fontWeight,triggersBounds:c.any},{name:"font-size",type:u.size,triggersBounds:c.any},{name:"text-transform",type:u.textTransform,triggersBounds:c.any},{name:"text-wrap",type:u.textWrap,triggersBounds:c.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:c.any},{name:"text-max-width",type:u.size,triggersBounds:c.any},{name:"text-outline-width",type:u.size,triggersBounds:c.any},{name:"line-height",type:u.positiveNumber,triggersBounds:c.any}],h=[{name:"text-valign",type:u.valign,triggersBounds:c.any},{name:"text-halign",type:u.halign,triggersBounds:c.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:c.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:c.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:c.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:c.any},{name:"text-justification",type:u.justification}],g=[{name:"events",type:u.bool,triggersZOrder:c.any},{name:"text-events",type:u.bool,triggersZOrder:c.any}],y=[{name:"display",type:u.display,triggersZOrder:c.any,triggersBounds:c.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:u.visibility,triggersZOrder:c.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:c.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:c.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:c.any},{name:"z-index",type:u.number,triggersZOrder:c.any}],m=[{name:"overlay-padding",type:u.size,triggersBounds:c.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:c.any},{name:"overlay-corner-radius",type:u.cornerRadius}],b=[{name:"underlay-padding",type:u.size,triggersBounds:c.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:c.any},{name:"underlay-corner-radius",type:u.cornerRadius}],w=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],C=function(A,K){return K.value==="label"?-A.poolIndex():K.pfValue},x=[{name:"height",type:u.nodeSize,triggersBounds:c.any,hashOverride:C},{name:"width",type:u.nodeSize,triggersBounds:c.any,hashOverride:C},{name:"shape",type:u.nodeShape,triggersBounds:c.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:c.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:c.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:c.any}],E=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:c.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],k=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:c.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:c.any}],B=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],S=[{name:"position",type:u.position,triggersBounds:c.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:c.any},{name:"min-width",type:u.size,triggersBounds:c.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-height",type:u.size,triggersBounds:c.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:c.any}],N=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:c.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:c.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:c.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:c.any},{name:"control-point-step-size",type:u.size,triggersBounds:c.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:c.any},{name:"control-point-weights",type:u.numbers,triggersBounds:c.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:c.any},{name:"segment-weights",type:u.numbers,triggersBounds:c.any},{name:"segment-radii",type:u.numbers,triggersBounds:c.any},{name:"radius-type",type:u.radiusType,triggersBounds:c.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:c.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:c.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:c.any},{name:"taxi-radius",type:u.number,triggersBounds:c.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:c.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:c.any},{name:"loop-direction",type:u.angle,triggersBounds:c.any},{name:"loop-sweep",type:u.angle,triggersBounds:c.any},{name:"source-distance-from-node",type:u.size,triggersBounds:c.any},{name:"target-distance-from-node",type:u.size,triggersBounds:c.any}],D=[{name:"ghost",type:u.bool,triggersBounds:c.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"ghost-opacity",type:u.zeroOneNumber}],P=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],I=[];xt.pieBackgroundN=16,I.push({name:"pie-size",type:u.sizeMaybePercent});for(var _=1;_<=xt.pieBackgroundN;_++)I.push({name:"pie-"+_+"-background-color",type:u.color}),I.push({name:"pie-"+_+"-background-size",type:u.percent}),I.push({name:"pie-"+_+"-background-opacity",type:u.zeroOneNumber});var F=[],O=xt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:c.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.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,h,v,d,f,p,x,E,k,B,I,S,N,F,P),L=xt.propertyGroups={behavior:g,transition:w,visibility:y,overlay:m,underlay:b,ghost:D,commonLabel:h,labelDimensions:v,mainLabel:d,sourceLabel:f,targetLabel:p,nodeBody:x,nodeBorder:E,nodeOutline:k,backgroundImage:B,pie:I,compound:S,edgeLine:N,edgeArrow:F,core:P},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],re={name:J.name,alias:!0,pointsTo:X};M.push(re),M[J.name]=re}})(),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(c,u){for(var d=1;d<=xt.pieBackgroundN;d++){var f=u.name.replace("{{i}}",d),p=u.value;c[f]=p}return c},{}),{"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(c,u){return xt.arrowPrefixes.forEach(function(d){var f=d+"-"+u.name,p=u.value;c[f]=p}),c},{})),r={},n=0;n<this.properties.length;n++){var a=this.properties[n];if(!a.pointsTo){var i=a.name,s=e[i],l=this.parse(i,s);r[i]=l}}return t.defaultProperties=r,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 vs={};vs.parse=function(t,e,r,n){var a=this;if(Ye(e))return a.parseImplWarn(t,e,r,n);var i=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,s=r?"t":"f",l=""+e,c=ah(t,l,s,i),u=a.propCache=a.propCache||[],d;return(d=u[c])||(d=u[c]=a.parseImplWarn(t,e,r,n)),(r||n==="mapping")&&(d=Cr(d),d&&(d.value=Cr(d.value))),d},vs.parseImplWarn=function(t,e,r,n){var a=this.parseImpl(t,e,r,n);return!a&&e!=null&&Ae("The style property `".concat(t,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&Ae("The style value of `label` is deprecated for `"+a.name+"`"),a},vs.parseImpl=function(t,e,r,n){var a=this;t=$l(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 c=be(e);c&&(e=e.trim());var u=i.type;if(!u)return null;if(r&&(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:r};var d,f;if(!(!c||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(d=new RegExp(l.data.regex).exec(e))){if(r)return!1;var p=l.data;return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(f=new RegExp(l.mapData.regex).exec(e))){if(r||u.multiple)return!1;var v=l.mapData;if(!(u.color||u.number))return!1;var h=this.parse(t,f[4]);if(!h||h.mapped)return!1;var g=this.parse(t,f[5]);if(!g||g.mapped)return!1;if(h.pfValue===g.pfValue||h.strValue===g.strValue)return Ae("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+h.strValue+"`"),this.parse(t,h.strValue);if(u.color){var y=h.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:h.value,valueMax:g.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var w;if(c?w=e.split(/\s+/):Ke(e)?w=e:w=[e],u.evenMultiple&&w.length%2!==0)return null;for(var C=[],x=[],E=[],k="",B=!1,S=0;S<w.length;S++){var N=a.parse(t,w[S],r,"multiple");B=B||be(N.value),C.push(N.value),E.push(N.pfValue!=null?N.pfValue:N.value),x.push(N.units),k+=(S>0?" ":"")+N.strValue}return u.validate&&!u.validate(C,x)?null:u.singleEnum&&B?C.length===1&&be(C[0])?{name:t,value:C[0],strValue:C[0],bypass:r}:null:{name:t,value:C,pfValue:E,strValue:k,bypass:r,units:x}}var D=function(){for(var A=0;A<u.enums.length;A++){var K=u.enums[A];if(K===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(u.number){var P,I="px";if(u.units&&(P=u.units),u.implicitUnits&&(I=u.implicitUnits),!u.unitless)if(c){var _="px|em"+(u.allowPercent?"|\\%":"");P&&(_=P);var F=e.match("^("+lt+")("+_+")?$");F&&(e=F[1],P=F[2]||I)}else(!P||u.implicitUnits)&&(P=I);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=s,D();if(u.integer&&!RE(e)||u.min!==void 0&&(e<u.min||u.strictMin&&e===u.min)||u.max!==void 0&&(e>u.max||u.strictMax&&e===u.max))return null;var O={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:r};return u.unitless||P!=="px"&&P!=="em"?O.pfValue=e:O.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(O.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(O.pfValue=P==="rad"?e:bT(e)),P==="%"&&(O.pfValue=e/100),O}else if(u.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($):Ae("`"+$+"` 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:r}}else if(u.color){var z=rS(e);return z?{name:t,value:z,pfValue:z,strValue:"rgb("+z[0]+","+z[1]+","+z[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var j=D();if(j)return j}for(var ee=u.regexes?u.regexes:[u.regex],J=0;J<ee.length;J++){var X=new RegExp(ee[J]),re=X.exec(e);if(re)return{name:t,value:u.singleRegexMatchValue?re[1]:re,strValue:""+e,bypass:r}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:r}:u.enums?D():null};var Nt=function t(e){if(!(this instanceof t))return new t(e);if(!Rl(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,r=e.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.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 un(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this},Dt.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],n=0;n<t.properties.length;n++){var a=t.properties[n],i=r[a.name];i===void 0&&(i=r[Oo(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 r=this.parse(t,e);if(r){var n=this.length-1;this[n].properties.push(r),this[n].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.mapped&&this[n].mappedProperties.push(r);var a=!this[n].selector;a&&(this._private.coreStyle[r.name]=r)}return this},Dt.append=function(t){return qf(t)?t.appendToStyle(this):Ke(t)?this.appendFromJson(t):be(t)&&this.appendFromString(t),this},Nt.fromJson=function(t,e){var r=new Nt(t);return r.fromJson(e),r},Nt.fromString=function(t,e){return new Nt(t).fromString(e)},[Bt,Ri,mc,xr,ps,yc,xt,vs].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 R4={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return qf(e)?r.style=e.generateStyle(this):Ke(e)?r.style=Nt.fromJson(this,e):be(e)?r.style=Nt.fromString(this,e):r.style=Nt(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},$4="single",Hn={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 r=this._private;if(r.selectionType==null&&(r.selectionType=$4),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.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,r=this._private.pan,n,a,i,s,l;switch(e.length){case 0:return r;case 1:if(be(e[0]))return n=e[0],r[n];if(Oe(e[0])){if(!this._private.panningEnabled)return this;i=e[0],s=i.x,l=i.y,le(s)&&(r.x=s),le(l)&&(r.y=l),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],a=e[1],(n==="x"||n==="y")&&le(a)&&(r[n]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var n=arguments,a=this._private.pan,i,s,l,c,u;if(!this._private.panningEnabled)return this;switch(n.length){case 1:Oe(e)&&(l=n[0],c=l.x,u=l.y,le(c)&&(a.x+=c),le(u)&&(a.y+=u),this.emit("pan viewport"));break;case 2:i=e,s=r,(i==="x"||i==="y")&&le(s)&&(a[i]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,r){var n=this.getFitViewport(e,r);if(n){var a=this._private;a.zoom=n.zoom,a.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(le(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(be(e)){var a=e;e=this.$(a)}else if(HE(e)){var i=e;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else Ut(e)||(e=this.mutableElements());if(!(Ut(e)&&e.empty())){n=n||e.boundingBox();var s=this.width(),l=this.height(),c;if(r=le(r)?r:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){c=Math.min((s-2*r)/n.w,(l-2*r)/n.h),c=c>this._private.maxZoom?this._private.maxZoom:c,c=c<this._private.minZoom?this._private.minZoom:c;var u={x:(s-c*(n.x1+n.x2))/2,y:(l-c*(n.y1+n.y2))/2};return{zoom:c,pan:u}}}}},zoomRange:function(e,r){var n=this._private;if(r==null){var a=e;e=a.min,r=a.max}return le(e)&&le(r)&&e<=r?(n.minZoom=e,n.maxZoom=r):le(e)&&r===void 0&&e<=n.maxZoom?n.minZoom=e:le(r)&&e===void 0&&r>=n.minZoom&&(n.maxZoom=r),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 r=this._private,n=r.pan,a=r.zoom,i,s,l=!1;if(r.zoomingEnabled||(l=!0),le(e)?s=e:Oe(e)&&(s=e.level,e.position!=null?i=Ro(e.position,a,n):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(l=!0)),s=s>r.maxZoom?r.maxZoom:s,s=s<r.minZoom?r.minZoom:s,l||!le(s)||s===a||i!=null&&(!le(i.x)||!le(i.y)))return null;if(i!=null){var c=n,u=a,d=s,f={x:-d/u*(i.x-c.x)+i.x,y:-d/u*(i.y-c.y)+i.y};return{zoomed:!0,panned:!0,zoom:d,pan:f}}else return{zoomed:!0,panned:!1,zoom:s,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),n=this._private;return r==null||!r.zoomed?this:(n.zoom=r.zoom,r.panned&&(n.pan.x=r.pan.x,n.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,n=!0,a=!0,i=[],s=!1,l=!1;if(!e)return this;if(le(e.zoom)||(n=!1),Oe(e.pan)||(a=!1),!n&&!a)return this;if(n){var c=e.zoom;c<r.minZoom||c>r.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=c,i.push("zoom"))}if(a&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;le(u.x)&&(r.pan.x=u.x,l=!1),le(u.y)&&(r.pan.y=u.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 r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(be(e)){var n=e;e=this.mutableElements().filter(n)}else Ut(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var l={x:(i-r*(a.x1+a.x2))/2,y:(s-r*(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,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?function(){var a=n.window().getComputedStyle(r),i=function(l){return parseFloat(a.getPropertyValue(l))};return{width:r.clientWidth-i("padding-left")-i("padding-right"),height:r.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,r=this._private.zoom,n=this.renderedExtent(),a={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Hn.centre=Hn.center,Hn.autolockNodes=Hn.autolock,Hn.autoungrabifyNodes=Hn.autoungrabify;var $i={data:Ve.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ve.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ve.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ve.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};$i.attr=$i.data,$i.removeAttr=$i.removeData;var zi=function(e){var r=this;e=xe({},e);var n=e.container;n&&!_o(n)&&_o(n[0])&&(n=n[0]);var a=n?n._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];n&&(n._cyreg=a),a.cy=r;var s=st!==void 0&&n!==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 c=function(h,g,y){return g!==void 0?g:y!==void 0?y:h},u=this._private={container:n,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:c(!0,l.zoomingEnabled),userZoomingEnabled:c(!0,l.userZoomingEnabled),panningEnabled:c(!0,l.panningEnabled),userPanningEnabled:c(!0,l.userPanningEnabled),boxSelectionEnabled:c(!0,l.boxSelectionEnabled),autolock:c(!1,l.autolock,l.autolockNodes),autoungrabify:c(!1,l.autoungrabify,l.autoungrabifyNodes),autounselectify:c(!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:c(250,l.multiClickDebounceTime)};this.createEmitter(),this.selectionType(l.selectionType),this.zoomRange({min:l.minZoom,max:l.maxZoom});var d=function(h,g){var y=h.some(KE);if(y)return ka.all(h).then(g);g(h)};u.styleEnabled&&r.setStyle([]);var f=xe({},l,l.renderer);r.initRenderer(f);var p=function(h,g,y){r.notifications(!1);var m=r.mutableElements();m.length>0&&m.remove(),h!=null&&(Oe(h)||Ke(h))&&r.add(h),r.one("layoutready",function(w){r.notifications(!0),r.emit(w),r.one("load",g),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var b=xe({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};d([l.style,l.elements],function(v){var h=v[0],g=v[1];u.styleEnabled&&r.style().append(h),p(g,function(){r.startAnimationLoop(),u.ready=!0,Ye(l.ready)&&r.on("ready",l.ready);for(var y=0;y<i.length;y++){var m=i[y];r.on("ready",m)}a&&(a.readies=[]),r.emit("ready")},l.done)})},gs=zi.prototype;xe(gs,{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 st;var r=this._private.container.ownerDocument;return r===void 0||r==null?st:r.defaultView||st},mount:function(e){if(e!=null){var r=this,n=r._private,a=n.options;return!_o(e)&&_o(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),n.container=e,n.styleEnabled=!0,r.invalidateSize(),r.initRenderer(xe({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),r.startAnimationLoop(),r.style(a.style),r.emit("mount"),r}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Cr(this._private.options)},json:function(e){var r=this,n=r._private,a=r.mutableElements(),i=function(C){return r.getElementById(C.id())};if(Oe(e)){if(r.startBatch(),e.elements){var s={},l=function(C,x){for(var E=[],k=[],B=0;B<C.length;B++){var S=C[B];if(!S.data.id){Ae("cy.json() cannot handle elements without an ID attribute");continue}var N=""+S.data.id,D=r.getElementById(N);s[N]=!0,D.length!==0?k.push({ele:D,json:S}):(x&&(S.group=x),E.push(S))}r.add(E);for(var P=0;P<k.length;P++){var I=k[P],_=I.ele,F=I.json;_.json(F)}};if(Ke(e.elements))l(e.elements);else for(var c=["nodes","edges"],u=0;u<c.length;u++){var d=c[u],f=e.elements[d];Ke(f)&&l(f,d)}var p=r.collection();a.filter(function(w){return!s[w.id()]}).forEach(function(w){w.isParent()?p.merge(w):w.remove()}),p.forEach(function(w){return w.children().move({parent:null})}),p.forEach(function(w){return i(w).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var v=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],h=0;h<v.length;h++){var g=v[h];e[g]!=null&&r[g](e[g])}return r.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=r.style().json()),m.data=Cr(r.data());var b=n.options;return m.zoomingEnabled=n.zoomingEnabled,m.userZoomingEnabled=n.userZoomingEnabled,m.zoom=n.zoom,m.minZoom=n.minZoom,m.maxZoom=n.maxZoom,m.panningEnabled=n.panningEnabled,m.userPanningEnabled=n.userPanningEnabled,m.pan=Cr(n.pan),m.boxSelectionEnabled=n.boxSelectionEnabled,m.renderer=Cr(b.renderer),m.hideEdgesOnViewport=b.hideEdgesOnViewport,m.textureOnViewport=b.textureOnViewport,m.wheelSensitivity=b.wheelSensitivity,m.motionBlur=b.motionBlur,m.multiClickDebounceTime=b.multiClickDebounceTime,m}}}),gs.$id=gs.getElementById,[D4,L4,Fp,vc,fs,F4,gc,hs,R4,Hn,$i].forEach(function(t){xe(gs,t)});var z4={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,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},H4={maximal:!1,acyclic:!1},Ia=function(e){return e.scratch("breadthfirst")},Ap=function(e,r){return e.scratch("breadthfirst",r)};function Vp(t){this.options=xe({},z4,H4,t)}Vp.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=n.nodes().filter(function(ne){return!ne.isParent()}),i=n,s=e.directed,l=e.acyclic||e.maximal||e.maximalAdjustments>0,c=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),u;if(Ut(e.roots))u=e.roots;else if(Ke(e.roots)){for(var d=[],f=0;f<e.roots.length;f++){var p=e.roots[f],v=r.getElementById(p);d.push(v)}u=r.collection(d)}else if(be(e.roots))u=r.$(e.roots);else if(s)u=a.roots();else{var h=n.components();u=r.collection();for(var g=function(se){var ue=h[se],pe=ue.maxDegree(!1),de=ue.filter(function(me){return me.degree(!1)===pe});u=u.add(de)},y=0;y<h.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),Ap(se,{index:pe,depth:ue})},C=function(se,ue){var pe=Ia(se),de=pe.depth,me=pe.index;m[de][me]=null,w(se,ue)};i.bfs({roots:u,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 x=[],E=0;E<a.length;E++){var k=a[E];b[k.id()]||x.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}Ap(de,{depth:se,index:pe})}},S=function(){for(var se=0;se<m.length;se++)B(se)},N=function(se,ue){for(var pe=Ia(se),de=se.incomers().filter(function(T){return T.isNode()&&n.has(T)}),me=-1,Ne=se.id(),De=0;De<de.length;De++){var Ee=de[De],Pe=Ia(Ee);me=Math.max(me,Pe.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=[],P={},I=function(se){return D.push(se)},_=function(){return D.shift()};for(a.forEach(function(ne){return D.push(ne)});D.length>0;){var F=_(),O=N(F,P);if(O)F.outgoers().filter(function(ne){return ne.isNode()&&n.has(ne)}).forEach(I);else if(O===null){Ae("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=Ia(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=Ia(De);if(Ee!=null){var Pe=Ee.index,te=Ee.depth;if(!(Pe==null||te==null)){var T=m[te].length;te<ue&&(de+=Pe/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?Wf(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 re=[],Y=0;Y<x.length;Y++)re.push(x[Y]);m.unshift(re),S();for(var A=0,K=0;K<m.length;K++)A=Math.max(m[K].length,A);var W={x:c.x1+c.w/2,y:c.x1+c.h/2},oe=m.reduce(function(ne,se){return Math.max(ne,se.length)},0),he=function(se){var ue=Ia(se),pe=ue.depth,de=ue.index,me=m[pe].length,Ne=Math.max(c.w/((e.grid?oe:me)+1),M),De=Math.max(c.h/(m.length+1),M),Ee=Math.min(c.w/2/m.length,c.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 Pe={x:W.x+(de+1-(me+1)/2)*Ne,y:(pe+1)*De};return Pe}};return n.nodes().layoutPositions(this,e,he),this};var K4={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,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Rp(t){this.options=xe({},K4,t)}Rp.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var 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},c=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=c/Math.max(1,i.length-1),d,f=0,p=0;p<i.length;p++){var v=i[p],h=v.layoutDimensions(e),g=h.w,y=h.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(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),w=Math.sqrt(f*f/(m*m+b*b));d=Math.max(w,d)}var C=function(E,k){var B=e.startAngle+k*u*(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 n.nodes().layoutPositions(this,e,C),this};var q4={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,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function $p(t){this.options=xe({},q4,t)}$p.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,a=e.eles,i=a.nodes().not(":parent"),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},c=[],u=0,d=0;d<i.length;d++){var f=i[d],p=void 0;p=e.concentric(f),c.push({value:p,node:f}),f._private.scratch.concentric=p}i.updateStyle();for(var v=0;v<i.length;v++){var h=i[v],g=h.layoutDimensions(e);u=Math.max(u,g.w,g.h)}c.sort(function(ne,se){return se.value-ne.value});for(var y=e.levelWidth(i),m=[[]],b=m[0],w=0;w<c.length;w++){var C=c[w];if(b.length>0){var x=Math.abs(b[0].value-C.value);x>=y&&(b=[],m.push(b))}b.push(C)}var E=u+e.minNodeSpacing;if(!e.avoidOverlap){var k=m.length>0&&m[0].length>1,B=Math.min(s.w,s.h)/2-E,S=B/(m.length+k?1:0);E=Math.min(E,S)}for(var N=0,D=0;D<m.length;D++){var P=m[D],I=e.sweep===void 0?2*Math.PI-2*Math.PI/P.length:e.sweep,_=P.dTheta=I/Math.max(1,P.length-1);if(P.length>1&&e.avoidOverlap){var F=Math.cos(_)-Math.cos(0),O=Math.sin(_)-Math.sin(0),M=Math.sqrt(E*E/(F*F+O*O));N=Math.max(M,N)}P.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 re=m[X],Y=re.dTheta,A=re.r,K=0;K<re.length;K++){var W=re[K],oe=e.startAngle+(r?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(ne){var se=ne.id();return J[se]}),this};var bc,U4={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){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 ms(t){this.options=xe({},U4,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),n=r.filter(function(a){var i=a.source().data("id"),s=a.target().data("id"),l=e.some(function(u){return u.data("id")===i}),c=e.some(function(u){return u.data("id")===s});return!l||!c});this.options.eles=this.options.eles.not(n)}ms.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?bc=!0:bc=!1;var n=G4(e,r,t);bc&&Y4(n),t.randomize&&Z4(n);var a=Vr(),i=function(){X4(n,e,t),t.fit===!0&&e.fit(t.padding)},s=function(p){return!(r.stopped||p>=t.numIter||(Q4(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature<t.minTemp))},l=function(){if(t.animate===!0||t.animate===!1)i(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var p=t.eles.nodes(),v=zp(n,t,p);p.layoutPositions(r,t,v)}},c=0,u=!0;if(t.animate===!0){var d=function f(){for(var p=0;u&&p<t.refresh;)u=s(c),c++,p++;if(!u)Kp(n,t),l();else{var v=Vr();v-a>=t.animationThreshold&&i(),Mo(f)}};d()}else{for(;u;)u=s(c),c++;Kp(n,t),l()}return this},ms.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},ms.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var G4=function(e,r,n){for(var a=n.eles.edges(),i=n.eles.nodes(),s=zt(n.boundingBox?n.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:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},c=n.eles.components(),u={},d=0;d<c.length;d++)for(var f=c[d],p=0;p<f.length;p++){var v=f[p];u[v.id()]=d}for(var d=0;d<l.nodeSize;d++){var h=i[d],g=h.layoutDimensions(n),y={};y.isLocked=h.locked(),y.id=h.data("id"),y.parentId=h.data("parent"),y.cmptId=u[h.id()],y.children=[],y.positionX=h.position("x"),y.positionY=h.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(h.style("padding")),y.padRight=parseFloat(h.style("padding")),y.padTop=parseFloat(h.style("padding")),y.padBottom=parseFloat(h.style("padding")),y.nodeRepulsion=Ye(n.nodeRepulsion)?n.nodeRepulsion(h):n.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 h=l.layoutNodes[d],x=h.parentId;x!=null?l.layoutNodes[l.idToIndex[x]].children.push(h.id):(m[++w]=h.id,C.push(h.id))}for(l.graphSet.push(C);b<=w;){var E=m[b++],k=l.idToIndex[E],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],p=0;p<S.length;p++){var N=l.idToIndex[S[p]];l.indexToGraph[N]=d}for(var d=0;d<l.edgeSize;d++){var D=a[d],P={};P.id=D.data("id"),P.sourceId=D.data("source"),P.targetId=D.data("target");var I=Ye(n.idealEdgeLength)?n.idealEdgeLength(D):n.idealEdgeLength,_=Ye(n.edgeElasticity)?n.edgeElasticity(D):n.edgeElasticity,F=l.idToIndex[P.sourceId],O=l.idToIndex[P.targetId],M=l.indexToGraph[F],L=l.indexToGraph[O];if(M!=L){for(var V=W4(P.sourceId,P.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*=$*n.nestingFactor}P.idealLength=I,P.elasticity=_,l.layoutEdges.push(P)}return l},W4=function(e,r,n){var a=j4(e,r,0,n);return 2>a.count?0:a.graph},j4=function t(e,r,n,a){var i=a.graphSet[n];if(-1<i.indexOf(e)&&-1<i.indexOf(r))return{count:2,graph:n};for(var s=0,l=0;l<i.length;l++){var c=i[l],u=a.idToIndex[c],d=a.layoutNodes[u].children;if(d.length!==0){var f=a.indexToGraph[a.idToIndex[d[0]]],p=t(e,r,f,a);if(p.count!==0)if(p.count===1){if(s++,s===2)break}else return p}}return{count:s,graph:n}},Y4,Z4=function(e,r){for(var n=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()*n,s.positionY=Math.random()*a)}},zp=function(e,r,n){var a=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(n.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 c=e.layoutNodes[e.idToIndex[s.data("id")]];if(r.boundingBox){var u=(c.positionX-i.x1)/i.w,d=(c.positionY-i.y1)/i.h;return{x:a.x1+u*a.w,y:a.y1+d*a.h}}else return{x:c.positionX,y:c.positionY}}},X4=function(e,r,n){var a=n.layout,i=n.eles.nodes(),s=zp(e,n,i);i.positions(s),e.ready!==!0&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},Q4=function(e,r,n){J4(e,r),rD(e),nD(e,r),aD(e),iD(e)},J4=function(e,r){for(var n=0;n<e.graphSet.length;n++)for(var a=e.graphSet[n],i=a.length,s=0;s<i;s++)for(var l=e.layoutNodes[e.idToIndex[a[s]]],c=s+1;c<i;c++){var u=e.layoutNodes[e.idToIndex[a[c]]];eD(l,u,e,r)}},Hp=function(e){return-e+2*e*Math.random()},eD=function(e,r,n,a){var i=e.cmptId,s=r.cmptId;if(!(i!==s&&!n.isCompound)){var l=r.positionX-e.positionX,c=r.positionY-e.positionY,u=1;l===0&&c===0&&(l=Hp(u),c=Hp(u));var d=tD(e,r,l,c);if(d>0)var f=a.nodeOverlap*d,p=Math.sqrt(l*l+c*c),v=f*l/p,h=f*c/p;else var g=ys(e,l,c),y=ys(r,-1*l,-1*c),m=y.x-g.x,b=y.y-g.y,w=m*m+b*b,p=Math.sqrt(w),f=(e.nodeRepulsion+r.nodeRepulsion)/w,v=f*m/p,h=f*b/p;e.isLocked||(e.offsetX-=v,e.offsetY-=h),r.isLocked||(r.offsetX+=v,r.offsetY+=h)}},tD=function(e,r,n,a){if(n>0)var i=e.maxX-r.minX;else var i=r.maxX-e.minX;if(a>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},ys=function(e,r,n){var a=e.positionX,i=e.positionY,s=e.height||1,l=e.width||1,c=n/r,u=s/l,d={};return r===0&&0<n||r===0&&0>n?(d.x=a,d.y=i+s/2,d):0<r&&-1*u<=c&&c<=u?(d.x=a+l/2,d.y=i+l*n/2/r,d):0>r&&-1*u<=c&&c<=u?(d.x=a-l/2,d.y=i-l*n/2/r,d):0<n&&(c<=-1*u||c>=u)?(d.x=a+s*r/2/n,d.y=i+s/2,d):(0>n&&(c<=-1*u||c>=u)&&(d.x=a-s*r/2/n,d.y=i-s/2),d)},rD=function(e,r){for(var n=0;n<e.edgeSize;n++){var a=e.layoutEdges[n],i=e.idToIndex[a.sourceId],s=e.layoutNodes[i],l=e.idToIndex[a.targetId],c=e.layoutNodes[l],u=c.positionX-s.positionX,d=c.positionY-s.positionY;if(!(u===0&&d===0)){var f=ys(s,u,d),p=ys(c,-1*u,-1*d),v=p.x-f.x,h=p.y-f.y,g=Math.sqrt(v*v+h*h),y=Math.pow(a.idealLength-g,2)/a.elasticity;if(g!==0)var m=y*v/g,b=y*h/g;else var m=0,b=0;s.isLocked||(s.offsetX+=m,s.offsetY+=b),c.isLocked||(c.offsetX-=m,c.offsetY-=b)}}},nD=function(e,r){if(r.gravity!==0)for(var n=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],s=i.length;if(a===0)var l=e.clientHeight/2,c=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[i[0]]],d=e.layoutNodes[e.idToIndex[u.parentId]],l=d.positionX,c=d.positionY;for(var f=0;f<s;f++){var p=e.layoutNodes[e.idToIndex[i[f]]];if(!p.isLocked){var v=l-p.positionX,h=c-p.positionY,g=Math.sqrt(v*v+h*h);if(g>n){var y=r.gravity*v/g,m=r.gravity*h/g;p.offsetX+=y,p.offsetY+=m}}}}},aD=function(e,r){var n=[],a=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;a<=i;){var s=n[a++],l=e.idToIndex[s],c=e.layoutNodes[l],u=c.children;if(0<u.length&&!c.isLocked){for(var d=c.offsetX,f=c.offsetY,p=0;p<u.length;p++){var v=e.layoutNodes[e.idToIndex[u[p]]];v.offsetX+=d,v.offsetY+=f,n[++i]=u[p]}c.offsetX=0,c.offsetY=0}}},iD=function(e,r){for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];if(!(0<a.children.length||a.isLocked)){var i=oD(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,sD(a,e)}}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];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)}},oD=function(e,r,n){var a=Math.sqrt(e*e+r*r);if(a>n)var i={x:n*e/a,y:n*r/a};else var i={x:e,y:r};return i},sD=function t(e,r){var n=e.parentId;if(n!=null){var a=r.layoutNodes[r.idToIndex[n]],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,r)}},Kp=function(e,r){for(var n=e.layoutNodes,a=[],i=0;i<n.length;i++){var s=n[i],l=s.cmptId,c=a[l]=a[l]||[];c.push(s)}for(var u=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 p=d[f];d.x1=Math.min(d.x1,p.positionX-p.width/2),d.x2=Math.max(d.x2,p.positionX+p.width/2),d.y1=Math.min(d.y1,p.positionY-p.height/2),d.y2=Math.max(d.y2,p.positionY+p.height/2)}d.w=d.x2-d.x1,d.h=d.y2-d.y1,u+=d.w*d.h}}a.sort(function(b,w){return w.w*w.h-b.w*b.h});for(var v=0,h=0,g=0,y=0,m=Math.sqrt(u)*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 p=d[f];p.isLocked||(p.positionX+=v-d.x1,p.positionY+=h-d.y1)}v+=d.w+r.componentSpacing,g+=d.w+r.componentSpacing,y=Math.max(y,d.h),g>m&&(h+=y+r.componentSpacing,v=0,g=0,y=0)}}},lD={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,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function qp(t){this.options=xe({},lD,t)}qp.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var i=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0)n.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),c=Math.round(l),u=Math.round(i.w/i.h*l),d=function(ee){if(ee==null)return Math.min(c,u);var J=Math.min(c,u);J==c?c=ee:u=ee},f=function(ee){if(ee==null)return Math.max(c,u);var J=Math.max(c,u);J==c?c=ee:u=ee},p=e.rows,v=e.cols!=null?e.cols:e.columns;if(p!=null&&v!=null)c=p,u=v;else if(p!=null&&v==null)c=p,u=Math.ceil(s/c);else if(p==null&&v!=null)u=v,c=Math.ceil(s/u);else if(u*c>s){var h=d(),g=f();(h-1)*g>=s?d(h-1):(g-1)*h>=s&&f(g-1)}else for(;u*c<s;){var y=d(),m=f();(m+1)*y>=s?f(m+1):d(y+1)}var b=i.w/u,w=i.h/c;if(e.condense&&(b=0,w=0),e.avoidOverlap)for(var C=0;C<a.length;C++){var x=a[C],E=x._private.position;(E.x==null||E.y==null)&&(E.x=0,E.y=0);var k=x.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={},P=function(ee,J){return!!D["c-"+ee+"-"+J]},I=function(ee,J){D["c-"+ee+"-"+J]=!0},_=0,F=0,O=function(){F++,F>=u&&(F=0,_++)},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;P($.row,$.col);)$.col++;else if($.row===void 0)for($.row=0;P($.row,$.col);)$.row++;M[V.id()]=$,I($.row,$.col)}}var z=function(ee,J){var X,re;if(ee.locked()||ee.isParent())return!1;var Y=M[ee.id()];if(Y)X=Y.col*b+b/2+i.x1,re=Y.row*w+w/2+i.y1;else{for(;P(_,F);)O();X=F*b+b/2+i.x1,re=_*w+w/2+i.y1,I(_,F),O()}return{x:X,y:re}};a.layoutPositions(this,e,z)}return this};var cD={ready:function(){},stop:function(){}};function wc(t){this.options=xe({},cD,t)}wc.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this},wc.prototype.stop=function(){return this};var uD={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,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Up(t){this.options=xe({},uD,t)}Up.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),n=Ye(t.positions);function a(i){if(t.positions==null)return pT(i.position());if(n)return t.positions(i);var s=t.positions[i._private.data.id];return s??null}return r.layoutPositions(this,t,function(i,s){var l=a(i);return i.locked()||l==null?!1:l}),this};var dD={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Gp(t){this.options=xe({},dD,t)}Gp.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=zt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(s,l){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return r.nodes().layoutPositions(this,t,a),this};var fD=[{name:"breadthfirst",impl:Vp},{name:"circle",impl:Rp},{name:"concentric",impl:$p},{name:"cose",impl:ms},{name:"grid",impl:qp},{name:"null",impl:wc},{name:"preset",impl:Up},{name:"random",impl:Gp}];function Wp(t){this.options=t,this.notifications=0}var jp=function(){},Yp=function(){throw new Error("A headless instance can not render images")};Wp.prototype={recalculateRenderedStyle:jp,notify:function(){this.notifications++},init:jp,isHeadless:function(){return!0},png:Yp,jpg:Yp};var Cc={};Cc.arrowShapeWidth=.3,Cc.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,d,f,p,v,h,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<=u&&u<=m&&b<=d&&d<=w;return C},n=function(u,d,f,p,v){var h=u*Math.cos(p)-d*Math.sin(p),g=u*Math.sin(p)+d*Math.cos(p),y=h*f,m=g*f,b=y+v.x,w=m+v.y;return{x:b,y:w}},a=function(u,d,f,p){for(var v=[],h=0;h<u.length;h+=2){var g=u[h],y=u[h+1];v.push(n(g,y,d,f,p))}return v},i=function(u){for(var d=[],f=0;f<u.length;f++){var p=u[f];d.push(p.x,p.y)}return d},s=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},l=function(u,d){be(d)&&(d=t[d]),t[u]=xe({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(p,v,h,g,y,m){var b=i(a(this.points,h+2*m,g,y)),w=Ht(p,v,b);return w},roughCollide:r,draw:function(p,v,h,g){var y=a(this.points,v,h,g);e.arrowShapeImpl("polygon")(p,y)},spacing:function(p){return 0},gap:s},d)};l("none",{collide:Ao,roughCollide:Ao,draw:ql,spacing:sh,gap:sh}),l("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),l("arrow","triangle"),l("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(u,d,f,p,v){var h=a(this.points,d,f,p),g=this.controlPoint,y=n(g[0],g[1],d,f,p);e.arrowShapeImpl(this.name)(u,h,y)},gap:function(u){return s(u)*.8}}),l("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,d,f,p,v,h,g){var y=i(a(this.points,f+2*g,p,v)),m=i(a(this.pointsTee,f+2*g,p,v)),b=Ht(u,d,y)||Ht(u,d,m);return b},draw:function(u,d,f,p,v){var h=a(this.points,d,f,p),g=a(this.pointsTee,d,f,p);e.arrowShapeImpl(this.name)(u,h,g)}}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,d,f,p,v,h,g){var y=v,m=Math.pow(y.x-u,2)+Math.pow(y.y-d,2)<=Math.pow((f+2*g)*this.radius,2),b=i(a(this.points,f+2*g,p,v));return Ht(u,d,b)||m},draw:function(u,d,f,p,v){var h=a(this.pointsTr,d,f,p);e.arrowShapeImpl(this.name)(u,h,p.x,p.y,this.radius*d)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.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(u,d){var f=this.baseCrossLinePts.slice(),p=d/u,v=3,h=5;return f[v]=f[v]-p,f[h]=f[h]-p,f},collide:function(u,d,f,p,v,h,g){var y=i(a(this.points,f+2*g,p,v)),m=i(a(this.crossLinePts(f,h),f+2*g,p,v)),b=Ht(u,d,y)||Ht(u,d,m);return b},draw:function(u,d,f,p,v){var h=a(this.points,d,f,p),g=a(this.crossLinePts(d,v),d,f,p);e.arrowShapeImpl(this.name)(u,h,g)}}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return s(u)*.525}}),l("circle",{radius:.15,collide:function(u,d,f,p,v,h,g){var y=v,m=Math.pow(y.x-u,2)+Math.pow(y.y-d,2)<=Math.pow((f+2*g)*this.radius,2);return m},draw:function(u,d,f,p,v){e.arrowShapeImpl(this.name)(u,p.x,p.y,this.radius*d)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),l("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){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(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),l("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(u){return .95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})};var Kn={};Kn.projectIntoViewport=function(t,e){var r=this.cy,n=this.findContainerClientCoords(),a=n[0],i=n[1],s=n[4],l=r.pan(),c=r.zoom(),u=((t-a)/s-l.x)/c,d=((e-i)/s-l.y)/c;return[u,d]},Kn.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),n=function(m){return parseFloat(r.getPropertyValue(m))},a={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},i={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},s=t.clientWidth,l=t.clientHeight,c=a.left+a.right,u=a.top+a.bottom,d=i.left+i.right,f=e.width/(s+d),p=s-c,v=l-u,h=e.left+a.left+i.left,g=e.top+a.top+i.top;return this.containerBB=[h,g,p,v,f]},Kn.invalidateContainerClientCoordsCache=function(){this.containerBB=null},Kn.findNearestElement=function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]},Kn.findNearestElements=function(t,e,r,n){var a=this,i=this,s=i.getCachedZSortedEles(),l=[],c=i.cy.zoom(),u=i.cy.hasCompoundNodes(),d=(n?24:8)/c,f=(n?8:2)/c,p=(n?8:2)/c,v=1/0,h,g;r&&(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(h){if(h.pstyle("z-compound-depth").value===k.pstyle("z-compound-depth").value&&h.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,h=k,v=B??v;break}}}else l.push(k),h=k,v=B??v}function m(k){var B=k.outerWidth()+2*f,S=k.outerHeight()+2*f,N=B/2,D=S/2,P=k.position(),I=k.pstyle("corner-radius").value==="auto"?"auto":k.pstyle("corner-radius").pfValue,_=k._private.rscratch;if(P.x-N<=t&&t<=P.x+N&&P.y-D<=e&&e<=P.y+D){var F=i.nodeShapes[a.getNodeShape(k)];if(F.checkPoint(t,e,0,B,S,P.x,P.y,I,_))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,P=N/2+d,I=P*P,_=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(BT(t,e,O[M],O[M+1],O[M+2],O[M+3],_)&&I>(F=OT(t,e,O[M],O[M+1],O[M+2],O[M+3])))return y(k,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(NT(t,e,O[M],O[M+1],O[M+2],O[M+3],O[M+4],O[M+5],_)&&I>(F=_T(t,e,O[M],O[M+1],O[M+2],O[M+3],O[M+4],O[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}u&&l.length>0&&(m(L),m(V))}function w(k,B,S){return ur(k,B,S)}function C(k,B){var S=k._private,N=p,D;B?D=B+"-":D="",k.boundingBox();var P=S.labelBounds[B||"main"],I=k.pstyle(D+"label").value,_=k.pstyle("text-events").strValue==="yes";if(!(!_||!I)){var F=w(S.rscratch,"labelX",B),O=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=P.x1-N-L,$=P.x2+N-L,z=P.y1-N-V,j=P.y2+N-V;if(M){var ee=Math.cos(M),J=Math.sin(M),X=function(he,ne){return he=he-F,ne=ne-O,{x:he*ee-ne*J+F,y:he*J+ne*ee+O}},re=X(H,z),Y=X(H,j),A=X($,z),K=X($,j),W=[re.x+L,re.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(ya(P,t,e))return y(k),!0}}for(var x=s.length-1;x>=0;x--){var E=s[x];E.isNode()?m(E)||C(E):b(E)||C(E)||C(E,"source")||C(E,"target")}return l},Kn.getAllInBox=function(t,e,r,n){var a=this.getCachedZSortedEles().interactive,i=[],s=Math.min(t,r),l=Math.max(t,r),c=Math.min(e,n),u=Math.max(e,n);t=s,r=l,e=c,n=u;for(var d=zt({x1:t,y1:e,x2:r,y2:n}),f=0;f<a.length;f++){var p=a[f];if(p.isNode()){var v=p,h=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});jl(d,h)&&!gh(h,d)&&i.push(v)}else{var g=p,y=g._private,m=y.rscratch;if(m.startX!=null&&m.startY!=null&&!ya(d,m.startX,m.startY)||m.endX!=null&&m.endY!=null&&!ya(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(!TT(d,b[C])){w=!1;break}w&&i.push(g)}else(m.edgeType==="haystack"||m.edgeType==="straight")&&i.push(g)}}return i};var bs={};bs.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",n=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",s=e.edgeType==="compound",l=e.edgeType==="self",c,u,d,f,p,v,m,b;if(r?(d=e.haystackPts[0],f=e.haystackPts[1],p=e.haystackPts[2],v=e.haystackPts[3]):(d=e.arrowStartX,f=e.arrowStartY,p=e.arrowEndX,v=e.arrowEndY),m=e.midX,b=e.midY,i)c=d-e.segpts[0],u=f-e.segpts[1];else if(a||s||l||n){var h=e.allpts,g=ft(h[0],h[2],h[4],.1),y=ft(h[1],h[3],h[5],.1);c=d-g,u=f-y}else c=d-m,u=f-b;e.srcArrowAngle=$o(c,u);var m=e.midX,b=e.midY;if(r&&(m=(d+p)/2,b=(f+v)/2),c=p-d,u=v-f,i){var h=e.allpts;if(h.length/2%2===0){var w=h.length/2,C=w-2;c=h[w]-h[C],u=h[w+1]-h[C+1]}else if(e.isRound)c=e.midVector[1],u=-e.midVector[0];else{var w=h.length/2-1,C=w-2;c=h[w]-h[C],u=h[w+1]-h[C+1]}}else if(a||s||l){var h=e.allpts,x=e.ctrlpts,E,k,B,S;if(x.length/2%2===0){var N=h.length/2-1,D=N+2,P=D+2;E=ft(h[N],h[D],h[P],0),k=ft(h[N+1],h[D+1],h[P+1],0),B=ft(h[N],h[D],h[P],1e-4),S=ft(h[N+1],h[D+1],h[P+1],1e-4)}else{var D=h.length/2-1,N=D-2,P=D+2;E=ft(h[N],h[D],h[P],.4999),k=ft(h[N+1],h[D+1],h[P+1],.4999),B=ft(h[N],h[D],h[P],.5),S=ft(h[N+1],h[D+1],h[P+1],.5)}c=B-E,u=S-k}if(e.midtgtArrowAngle=$o(c,u),e.midDispX=c,e.midDispY=u,c*=-1,u*=-1,i){var h=e.allpts;if(h.length/2%2!==0){if(!e.isRound){var w=h.length/2-1,I=w+2;c=-(h[I]-h[w]),u=-(h[I+1]-h[w+1])}}}if(e.midsrcArrowAngle=$o(c,u),i)c=p-e.segpts[e.segpts.length-2],u=v-e.segpts[e.segpts.length-1];else if(a||s||l||n){var h=e.allpts,_=h.length,g=ft(h[_-6],h[_-4],h[_-2],.9),y=ft(h[_-5],h[_-3],h[_-1],.9);c=p-g,u=v-y}else c=p-m,u=v-b;e.tgtArrowAngle=$o(c,u)},bs.getArrowWidth=bs.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},n=r[t+", "+e];return n||(n=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=n,n)};var kc,xc,Er={},er={},Zp,Xp,qn,ws,zr,Un,Gn,Sr,La,Cs,Qp,Jp,Ec,Sc,ev,tv=function(e,r,n){n.x=r.x-e.x,n.y=r.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},hD=function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},pD=function(e,r,n,a,i){if(e!==ev?tv(r,e,Er):hD(er,Er),tv(r,n,er),Zp=Er.nx*er.ny-Er.ny*er.nx,Xp=Er.nx*er.nx-Er.ny*-er.ny,zr=Math.asin(Math.max(-1,Math.min(1,Zp))),Math.abs(zr)<1e-6){kc=r.x,xc=r.y,Gn=La=0;return}qn=1,ws=!1,Xp<0?zr<0?zr=Math.PI+zr:(zr=Math.PI-zr,qn=-1,ws=!0):zr>0&&(qn=-1,ws=!0),r.radius!==void 0?La=r.radius:La=a,Un=zr/2,Cs=Math.min(Er.len/2,er.len/2),i?(Sr=Math.abs(Math.cos(Un)*La/Math.sin(Un)),Sr>Cs?(Sr=Cs,Gn=Math.abs(Sr*Math.sin(Un)/Math.cos(Un))):Gn=La):(Sr=Math.min(Cs,La),Gn=Math.abs(Sr*Math.sin(Un)/Math.cos(Un))),Ec=r.x+er.nx*Sr,Sc=r.y+er.ny*Sr,kc=Ec-er.ny*Gn*qn,xc=Sc+er.nx*Gn*qn,Qp=r.x+Er.nx*Sr,Jp=r.y+Er.ny*Sr,ev=r};function rv(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 Tc(t,e,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===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}:(pD(t,e,r,n,a),{cx:kc,cy:xc,radius:Gn,startX:Qp,startY:Jp,stopX:Ec,stopY:Sc,startAngle:Er.ang+Math.PI/2*qn,endAngle:er.ang-Math.PI/2*qn,counterClockwise:ws})}var Pt={};Pt.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,i,s=t.pstyle("source-endpoint"),l=t.pstyle("target-endpoint"),c=s.units!=null&&l.units!=null,u=function(x,E,k,B){var S=B-E,N=k-x,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=r;break;case"intersection":i=n;break;case"endpoints":{if(c){var f=this.manualEndptToPx(t.source()[0],s),p=cr(f,2),v=p[0],h=p[1],g=this.manualEndptToPx(t.target()[0],l),y=cr(g,2),m=y[0],b=y[1],w={x1:v,y1:h,x2:m,y2:b};a=u(v,h,m,b),i=w}else Ae("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=n;break}}return{midptPts:i,vectorNormInverse:a}},Pt.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],n=r._private,a=n.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=n.source,l=n.target,c=s.position(),u=l.position(),d=s.width(),f=l.width(),p=s.height(),v=l.height(),h=r.pstyle("haystack-radius").value,g=h/2;a.haystackPts=a.allpts=[a.source.x*d*g+c.x,a.source.y*p*g+c.y,a.target.x*f*g+u.x,a.target.y*v*g+u.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(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}},Pt.findSegmentsPoints=function(t,e){var r=t._private.rscratch,n=t.pstyle("segment-weights"),a=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),l=Math.min(n.pfValue.length,a.pfValue.length),c=i.pfValue[i.pfValue.length-1],u=s.pfValue[s.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var d=0;d<l;d++){var f=n.pfValue[d],p=a.pfValue[d],v=1-f,h=f,g=this.findMidptPtsEtc(t,e),y=g.midptPts,m=g.vectorNormInverse,b={x:y.x1*v+y.x2*h,y:y.y1*v+y.y2*h};r.segpts.push(b.x+m.x*p,b.y+m.y*p),r.radii.push(i.pfValue[d]!==void 0?i.pfValue[d]:c),r.isArcRadius.push((s.pfValue[d]!==void 0?s.pfValue[d]:u)==="arc-radius")}},Pt.findLoopPoints=function(t,e,r,n){var a=t._private.rscratch,i=e.dirCounts,s=e.srcPos,l=t.pstyle("control-point-distances"),c=l?l.pfValue[0]:void 0,u=t.pstyle("loop-direction").pfValue,d=t.pstyle("loop-sweep").pfValue,f=t.pstyle("control-point-step-size").pfValue;a.edgeType="self";var p=r,v=f;n&&(p=0,v=c);var h=u-Math.PI/2,g=h-d/2,y=h+d/2,m=u+"_"+d;p=i[m]===void 0?i[m]=0:++i[m],a.ctrlpts=[s.x+Math.cos(g)*1.4*v*(p/3+1),s.y+Math.sin(g)*1.4*v*(p/3+1),s.x+Math.cos(y)*1.4*v*(p/3+1),s.y+Math.sin(y)*1.4*v*(p/3+1)]},Pt.findCompoundLoopPoints=function(t,e,r,n){var a=t._private.rscratch;a.edgeType="compound";var i=e.srcPos,s=e.tgtPos,l=e.srcW,c=e.srcH,u=e.tgtW,d=e.tgtH,f=t.pstyle("control-point-step-size").pfValue,p=t.pstyle("control-point-distances"),v=p?p.pfValue[0]:void 0,h=r,g=f;n&&(h=0,g=v);var y=50,m={x:i.x-l/2,y:i.y-c/2},b={x:s.x-u/2,y:s.y-d/2},w={x:Math.min(m.x,b.x),y:Math.min(m.y,b.y)},C=.5,x=Math.max(C,Math.log(l*.01)),E=Math.max(C,Math.log(u*.01));a.ctrlpts=[w.x,w.y-(1+Math.pow(y,1.12)/100)*g*(h/3+1)*x,w.x-(1+Math.pow(y,1.12)/100)*g*(h/3+1)*E,w.y]},Pt.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"},Pt.findBezierPoints=function(t,e,r,n,a){var i=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,l=t.pstyle("control-point-distances"),c=t.pstyle("control-point-weights"),u=l&&c?Math.min(l.value.length,c.value.length):1,d=l?l.pfValue[0]:void 0,f=c.value[0],p=n;i.edgeType=p?"multibezier":"bezier",i.ctrlpts=[];for(var v=0;v<u;v++){var h=(.5-e.eles.length/2+r)*s*(a?-1:1),g=void 0,y=hh(h);p&&(d=l?l.pfValue[v]:s,f=c.value[v]),n?g=d:g=d!==void 0?y*d:void 0;var m=g!==void 0?g:h,b=1-f,w=f,C=this.findMidptPtsEtc(t,e),x=C.midptPts,E=C.vectorNormInverse,k={x:x.x1*b+x.x2*w,y:x.y1*b+x.y2*w};i.ctrlpts.push(k.x+E.x*m,k.y+E.y*m)}},Pt.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var n="vertical",a="horizontal",i="leftward",s="rightward",l="downward",c="upward",u="auto",d=e.posPts,f=e.srcW,p=e.srcH,v=e.tgtW,h=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==="%",x=w.pfValue,E=x<0,k=t.pstyle("taxi-turn-min-distance").pfValue,B=y?(f+v)/2:0,S=y?(p+h)/2:0,N=d.x2-d.x1,D=d.y2-d.y1,P=function(we,Ce){return we>0?Math.max(we-Ce,0):Math.min(we+Ce,0)},I=P(N,B),_=P(D,S),F=!1;b===u?m=Math.abs(I)>Math.abs(_)?a:n:b===c||b===l?(m=n,F=!0):(b===i||b===s)&&(m=a,F=!0);var O=m===n,M=O?_:I,L=O?D:N,V=hh(L),H=!1;!(F&&(C||E))&&(b===l&&L<0||b===c&&L>0||b===i&&L>0||b===s&&L<0)&&(V*=-1,M=V*Math.abs(M),H=!0);var $;if(C){var z=x<0?1+x:x;$=z*M}else{var j=x<0?M:0;$=j+x*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($)),re=J||X;if(re&&!H)if(O){var Y=Math.abs(L)<=p/2,A=Math.abs(N)<=v/2;if(Y){var K=(d.x1+d.x2)/2,W=d.y1,oe=d.y2;r.segpts=[K,W,K,oe]}else if(A){var he=(d.y1+d.y2)/2,ne=d.x1,se=d.x2;r.segpts=[ne,he,se,he]}else r.segpts=[d.x1,d.y2]}else{var ue=Math.abs(L)<=f/2,pe=Math.abs(D)<=h/2;if(ue){var de=(d.y1+d.y2)/2,me=d.x1,Ne=d.x2;r.segpts=[me,de,Ne,de]}else if(pe){var De=(d.x1+d.x2)/2,Ee=d.y1,Pe=d.y2;r.segpts=[De,Ee,De,Pe]}else r.segpts=[d.x2,d.y1]}else if(O){var te=d.y1+$+(y?p/2*V:0),T=d.x1,R=d.x2;r.segpts=[T,te,R,te]}else{var Q=d.x1+$+(y?f/2*V:0),G=d.y1,U=d.y2;r.segpts=[Q,G,Q,U]}if(r.isRound){var ie=t.pstyle("taxi-radius").value,Z=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(ie),r.isArcRadius=new Array(r.segpts.length/2).fill(Z)}},Pt.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,a=e.tgtPos,i=e.srcW,s=e.srcH,l=e.tgtW,c=e.tgtH,u=e.srcShape,d=e.tgtShape,f=e.srcCornerRadius,p=e.tgtCornerRadius,v=e.srcRs,h=e.tgtRs,g=!le(r.startX)||!le(r.startY),y=!le(r.arrowStartX)||!le(r.arrowStartY),m=!le(r.endX)||!le(r.endY),b=!le(r.arrowEndX)||!le(r.arrowEndY),w=3,C=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,x=w*C,E=Fn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),k=E<x,B=Fn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),S=B<x,N=!1;if(g||y||k){N=!0;var D={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},P=Math.sqrt(D.x*D.x+D.y*D.y),I={x:D.x/P,y:D.y/P},_=Math.max(i,s),F={x:r.ctrlpts[0]+I.x*2*_,y:r.ctrlpts[1]+I.y*2*_},O=u.intersectLine(n.x,n.y,i,s,F.x,F.y,0,f,v);k?(r.ctrlpts[0]=r.ctrlpts[0]+I.x*(x-E),r.ctrlpts[1]=r.ctrlpts[1]+I.y*(x-E)):(r.ctrlpts[0]=O[0]+I.x*x,r.ctrlpts[1]=O[1]+I.y*x)}if(m||b||S){N=!0;var M={x:r.ctrlpts[0]-a.x,y:r.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:r.ctrlpts[0]+V.x*2*H,y:r.ctrlpts[1]+V.y*2*H},z=d.intersectLine(a.x,a.y,l,c,$.x,$.y,0,p,h);S?(r.ctrlpts[0]=r.ctrlpts[0]+V.x*(x-B),r.ctrlpts[1]=r.ctrlpts[1]+V.y*(x-B)):(r.ctrlpts[0]=z[0]+V.x*x,r.ctrlpts[1]=z[1]+V.y*x)}N&&this.findEndpoints(t)}},Pt.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 r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var n,a;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,a=.5,e.midX=ft(e.allpts[n],e.allpts[n+2],e.allpts[n+4],a),e.midY=ft(e.allpts[n+1],e.allpts[n+3],e.allpts[n+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(Tc({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 c=e.segpts.length/2,u=c-2;e.midX=(e.segpts[u]+e.segpts[c])/2,e.midY=(e.segpts[u+1]+e.segpts[c+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]},p=e.roundCorners[d/2],v=[f.x-p.cx,f.y-p.cy],h=p.radius/Math.sqrt(Math.pow(v[0],2)+Math.pow(v[1],2));v=v.map(function(g){return g*h}),e.midX=p.cx+v[0],e.midY=p.cy+v[1],e.midVector=v}}}},Pt.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,Ae("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."))},Pt.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,n=r.cy,a=n.hasCompoundNodes(),i={map:new kr,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 kr,this.map.set(k[0],S)),S.set(k[1],B)}},s=[],l=[],c=0;c<t.length;c++){var u=t[c],d=u._private,f=u.pstyle("curve-style").value;if(!(u.removed()||!u.takesUpSpace())){if(f==="haystack"){l.push(u);continue}var p=f==="unbundled-bezier"||f.endsWith("segments")||f==="straight"||f==="straight-triangle"||f.endsWith("taxi"),v=f==="unbundled-bezier"||f==="bezier",h=d.source,g=d.target,y=h.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(u),p&&(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()});Ul(S.eles),D.forEach(function(Q){return S.eles.push(Q)}),S.eles.sort(function(Q,G){return Q.poolIndex()-G.poolIndex()})}var P=S.eles[0],I=P.source(),_=P.target();if(I.poolIndex()>_.poolIndex()){var F=I;I=_,_=F}var O=S.srcPos=I.position(),M=S.tgtPos=_.position(),L=S.srcW=I.outerWidth(),V=S.srcH=I.outerHeight(),H=S.tgtW=_.outerWidth(),$=S.tgtH=_.outerHeight(),z=S.srcShape=r.nodeShapes[e.getNodeShape(I)],j=S.tgtShape=r.nodeShapes[e.getNodeShape(_)],ee=S.srcCornerRadius=I.pstyle("corner-radius").value==="auto"?"auto":I.pstyle("corner-radius").pfValue,J=S.tgtCornerRadius=_.pstyle("corner-radius").value==="auto"?"auto":_.pstyle("corner-radius").pfValue,X=S.tgtRs=_._private.rscratch,re=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!==_&&(S.hasBezier||S.hasUnbundled)){S.calculatedIntersection=!0;var ne=z.intersectLine(O.x,O.y,L,V,M.x,M.y,0,ee,re),se=S.srcIntn=ne,ue=j.intersectLine(M.x,M.y,H,$,O.x,O.y,0,J,X),pe=S.tgtIntn=ue,de=S.intersectionPts={x1:ne[0],x2:ue[0],y1:ne[1],y2:ue[1]},me=S.posPts={x1:O.x,x2:M.x,y1:O.y,y2:M.y},Ne=ue[1]-ne[1],De=ue[0]-ne[0],Ee=Math.sqrt(De*De+Ne*Ne),Pe=S.vector={x:De,y:Ne},te=S.vectorNorm={x:Pe.x/Ee,y:Pe.y/Ee},T={x:-te.y,y:te.x};S.nodesOverlap=!le(Ee)||j.checkPoint(ne[0],ne[1],0,H,$,M.x,M.y,J,X)||z.checkPoint(ue[0],ue[1],0,L,V,O.x,O.y,ee,re),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:-Pe.x,y:-Pe.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()||_.isParent()||_.isChild())&&(I.parents().anySame(_)||_.parents().anySame(I)||I.same(_)&&I.isParent())?e.findCompoundLoopPoints(A,R,Y,oe):I===_?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)}},x=0;x<s.length;x++)C(x);this.findHaystackPoints(l)}};function nv(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var n=t[r],a=t[r+1];e.push({x:n,y:a})}return e}}Pt.getSegmentPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="segments")return this.recalculateRenderedStyle(t),nv(e.segpts)},Pt.getControlPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return this.recalculateRenderedStyle(t),nv(e.ctrlpts)},Pt.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var Hi={};Hi.manualEndptToPx=function(t,e){var r=this,n=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]+=n.x,l[1]+=n.y,l}else{var c=e.pfValue[0];c=-Math.PI/2+c;var u=2*Math.max(a,i),d=[n.x+Math.cos(c)*u,n.y+Math.sin(c)*u];return r.nodeShapes[this.getNodeShape(t)].intersectLine(n.x,n.y,a,i,d[0],d[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}},Hi.findEndpoints=function(t){var e=this,r,n=t.source()[0],a=t.target()[0],i=n.position(),s=a.position(),l=t.pstyle("target-arrow-shape").value,c=t.pstyle("source-arrow-shape").value,u=t.pstyle("target-distance-from-node").pfValue,d=t.pstyle("source-distance-from-node").pfValue,f=n._private.rscratch,p=a._private.rscratch,v=t.pstyle("curve-style").value,h=t._private.rscratch,g=h.edgeType,y=v==="taxi",m=g==="self"||g==="compound",b=g==="bezier"||g==="multibezier"||m,w=g!=="bezier",C=g==="straight"||g==="segments",x=g==="segments",E=b||w||C,k=m||y,B=t.pstyle("source-endpoint"),S=k?"outside-to-node":B.value,N=n.pstyle("corner-radius").value==="auto"?"auto":n.pstyle("corner-radius").pfValue,D=t.pstyle("target-endpoint"),P=k?"outside-to-node":D.value,I=a.pstyle("corner-radius").value==="auto"?"auto":a.pstyle("corner-radius").pfValue;h.srcManEndpt=B,h.tgtManEndpt=D;var _,F,O,M;if(b){var L=[h.ctrlpts[0],h.ctrlpts[1]],V=w?[h.ctrlpts[h.ctrlpts.length-2],h.ctrlpts[h.ctrlpts.length-1]]:L;_=V,F=L}else if(C){var H=x?h.segpts.slice(0,2):[s.x,s.y],$=x?h.segpts.slice(h.segpts.length-2):[i.x,i.y];_=$,F=H}if(P==="inside-to-node")r=[s.x,s.y];else if(D.units)r=this.manualEndptToPx(a,D);else if(P==="outside-to-line")r=h.tgtIntn;else if(P==="outside-to-node"||P==="outside-to-node-or-label"?O=_:(P==="outside-to-line"||P==="outside-to-line-or-label")&&(O=[i.x,i.y]),r=e.nodeShapes[this.getNodeShape(a)].intersectLine(s.x,s.y,a.outerWidth(),a.outerHeight(),O[0],O[1],0,I,p),P==="outside-to-node-or-label"||P==="outside-to-line-or-label"){var z=a._private.rscratch,j=z.labelWidth,ee=z.labelHeight,J=z.labelX,X=z.labelY,re=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-=re:K==="right"&&(J+=re);var W=Ni(O[0],O[1],[J-re,X-Y,J+re,X-Y,J+re,X+Y,J-re,X+Y],s.x,s.y);if(W.length>0){var oe=i,he=An(oe,ga(r)),ne=An(oe,ga(W)),se=he;if(ne<he&&(r=W,se=ne),W.length>2){var ue=An(oe,{x:W[2],y:W[3]});ue<se&&(r=[W[2],W[3]])}}}var pe=Uo(r,_,e.arrowShapes[l].spacing(t)+u),de=Uo(r,_,e.arrowShapes[l].gap(t)+u);if(h.endX=de[0],h.endY=de[1],h.arrowEndX=pe[0],h.arrowEndY=pe[1],S==="inside-to-node")r=[i.x,i.y];else if(B.units)r=this.manualEndptToPx(n,B);else if(S==="outside-to-line")r=h.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]),r=e.nodeShapes[this.getNodeShape(n)].intersectLine(i.x,i.y,n.outerWidth(),n.outerHeight(),M[0],M[1],0,N,f),S==="outside-to-node-or-label"||S==="outside-to-line-or-label"){var me=n._private.rscratch,Ne=me.labelWidth,De=me.labelHeight,Ee=me.labelX,Pe=me.labelY,te=Ne/2,T=De/2,R=n.pstyle("text-valign").value;R==="top"?Pe-=T:R==="bottom"&&(Pe+=T);var Q=n.pstyle("text-halign").value;Q==="left"?Ee-=te:Q==="right"&&(Ee+=te);var G=Ni(M[0],M[1],[Ee-te,Pe-T,Ee+te,Pe-T,Ee+te,Pe+T,Ee-te,Pe+T],i.x,i.y);if(G.length>0){var U=s,ie=An(U,ga(r)),Z=An(U,ga(G)),ae=ie;if(Z<ie&&(r=[G[0],G[1]],ae=Z),G.length>2){var we=An(U,{x:G[2],y:G[3]});we<ae&&(r=[G[2],G[3]])}}}var Ce=Uo(r,F,e.arrowShapes[c].spacing(t)+d),ge=Uo(r,F,e.arrowShapes[c].gap(t)+d);h.startX=ge[0],h.startY=ge[1],h.arrowStartX=Ce[0],h.arrowStartY=Ce[1],E&&(!le(h.startX)||!le(h.startY)||!le(h.endX)||!le(h.endY)?h.badLine=!0:h.badLine=!1)},Hi.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}}},Hi.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 Bc={};function vD(t,e,r){for(var n=function(u,d,f,p){return ft(u,d,f,p)},a=e._private,i=a.rstyle.bezierPts,s=0;s<t.bezierProjPcts.length;s++){var l=t.bezierProjPcts[s];i.push({x:n(r[0],r[2],r[4],l),y:n(r[1],r[3],r[5],l)})}}Bc.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,n=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var a=0;a+5<r.allpts.length;a+=4)vD(this,t,r.allpts.slice(a,a+6))}else if(n==="segments")for(var i=e.rstyle.linePts=[],a=0;a+1<r.allpts.length;a+=2)i.push({x:r.allpts[a],y:r.allpts[a+1]});else if(n==="haystack"){var s=r.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},Bc.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var Tr={};Tr.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!nn(e)){var r,n,a=t._private,i=t.width(),s=t.height(),l=t.padding(),c=t.position(),u=t.pstyle("text-halign").strValue,d=t.pstyle("text-valign").strValue,f=a.rscratch,p=a.rstyle;switch(u){case"left":r=c.x-i/2-l;break;case"right":r=c.x+i/2+l;break;default:r=c.x}switch(d){case"top":n=c.y-s/2-l;break;case"bottom":n=c.y+s/2+l;break;default:n=c.y}f.labelX=r,f.labelY=n,p.labelX=r,p.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var av=function(e,r){var n=Math.atan(r/e);return e===0&&n<0&&(n=n*-1),n},iv=function(e,r){var n=r.x-e.x,a=r.y-e.y;return av(n,a)},gD=function(e,r,n,a){var i=Ti(0,a-.001,1),s=Ti(0,a+.001,1),l=ma(e,r,n,i),c=ma(e,r,n,s);return iv(l,c)};Tr.recalculateEdgeLabelProjections=function(t){var e,r=t._private,n=r.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:n.midX,y:n.midY};var s=function(f,p,v){sn(r.rscratch,f,p,v),sn(r.rstyle,f,p,v)};s("labelX",null,e.x),s("labelY",null,e.y);var l=av(n.midDispX,n.midDispY);s("labelAutoAngle",null,l);var c=function d(){if(d.cache)return d.cache;for(var f=[],p=0;p+5<n.allpts.length;p+=4){var v={x:n.allpts[p],y:n.allpts[p+1]},h={x:n.allpts[p+2],y:n.allpts[p+3]},g={x:n.allpts[p+4],y:n.allpts[p+5]};f.push({p0:v,p1:h,p2:g,startDist:0,length:0,segments:[]})}var y=r.rstyle.bezierPts,m=a.bezierProjPcts.length;function b(k,B,S,N,D){var P=Fn(B,S),I=k.segments[k.segments.length-1],_={p0:B,p1:S,t0:N,t1:D,startDist:I?I.startDist+I.length:0,length:P};k.segments.push(_),k.length+=P}for(var w=0;w<f.length;w++){var C=f[w],x=f[w-1];x&&(C.startDist=x.startDist+x.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},u=function(f){var p,v=f==="source";if(i[f]){var h=t.pstyle(f+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var g=c(),y,m=0,b=0,w=0;w<g.length;w++){for(var C=g[v?w:g.length-1-w],x=0;x<C.segments.length;x++){var E=C.segments[v?x:C.segments.length-1-x],k=w===g.length-1&&x===C.segments.length-1;if(m=b,b+=E.length,b>=h||k){y={cp:C,segment:E};break}}if(y)break}var B=y.cp,S=y.segment,N=(h-m)/S.length,D=S.t1-S.t0,P=v?S.t0+D*N:S.t1-D*N;P=Ti(0,P,1),e=ma(B.p0,B.p1,B.p2,P),p=gD(B.p0,B.p1,B.p2,P);break}case"straight":case"segments":case"haystack":{for(var I=0,_,F,O,M,L=n.allpts.length,V=0;V+3<L&&(v?(O={x:n.allpts[V],y:n.allpts[V+1]},M={x:n.allpts[V+2],y:n.allpts[V+3]}):(O={x:n.allpts[L-2-V],y:n.allpts[L-1-V]},M={x:n.allpts[L-4-V],y:n.allpts[L-3-V]}),_=Fn(O,M),F=I,I+=_,!(I>=h));V+=2);var H=h-F,$=H/_;$=Ti(0,$,1),e=CT(O,M,$),p=iv(O,M);break}}s("labelX",f,e.x),s("labelY",f,e.y),s("labelAutoAngle",f,p)}};u("source"),u("target"),this.applyLabelDimensions(t)}},Tr.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},Tr.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),a=this.calculateLabelDimensions(t,n),i=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,l=ur(r.rscratch,"labelWrapCachedLines",e)||[],c=s!=="wrap"?1:Math.max(l.length,1),u=a.height/c,d=u*i,f=a.width,p=a.height+(c-1)*(i-1)*u;sn(r.rstyle,"labelWidth",e,f),sn(r.rscratch,"labelWidth",e,f),sn(r.rstyle,"labelHeight",e,p),sn(r.rscratch,"labelHeight",e,p),sn(r.rscratch,"labelLineHeight",e,d)},Tr.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",a=t.pstyle(n+"label").strValue,i=t.pstyle("text-transform").value,s=function(j,ee){return ee?(sn(r.rscratch,j,e,ee),ee):ur(r.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 c=s("labelKey");if(c!=null&&s("labelWrapKey")===c)return s("labelWrapCachedText");for(var u="​",d=a.split(`
33
+ `),f=t.pstyle("text-max-width").pfValue,p=t.pstyle("text-overflow-wrap").value,v=p==="anywhere",h=[],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(u);m=C}if(w>f){var x=m.matchAll(g),E="",k=0,B=$f(x),S;try{for(B.s();!(S=B.n()).done;){var N=S.value,D=N[0],P=m.substring(k,N.index);k=N.index+D.length;var I=E.length===0?P:E+P+D,_=this.calculateLabelDimensions(t,I),F=_.width;F<=f?E+=P+D:(E&&h.push(E),E=P+D)}}catch(z){B.e(z)}finally{B.f()}E.match(/^[\s\u200b]+$/)||h.push(E)}else h.push(m)}s("labelWrapCachedLines",h),a=s("labelWrapCachedText",h.join(`
34
34
  `)),s("labelWrapKey",c)}else if(l==="ellipsis"){var O=t.pstyle("text-max-width").pfValue,M="",L="…",V=!1;if(this.calculateLabelDimensions(t,a).width<O)return a;for(var H=0;H<a.length;H++){var $=this.calculateLabelDimensions(t,M+a[H]+L).width;if($>O)break;M+=a[H],H===a.length-1&&(V=!0)}return V||(M+=L),M}return a},Tr.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e},Tr.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),a=n.document,i=Mn(e,t._private.labelDimsKey),s=r.labelDimCache||(r.labelDimCache=[]),l=s[i];if(l!=null)return l;var c=0,u=t.pstyle("font-style").strValue,d=t.pstyle("font-size").pfValue,f=t.pstyle("font-family").strValue,p=t.pstyle("font-weight").strValue,v=this.labelCalcCanvas,h=this.labelCalcCanvasContext;if(!v){v=this.labelCalcCanvas=a.createElement("canvas"),h=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"}h.font="".concat(u," ").concat(p," ").concat(d,"px ").concat(f);for(var y=0,m=0,b=e.split(`
35
- `),w=0;w<b.length;w++){var C=b[w],x=h.measureText(C),E=Math.ceil(x.width),k=d;y=Math.max(E,y),m+=k}return y+=c,m+=c,s[i]={width:y,height:m}},Tr.calculateLabelAngle=function(t,e){var r=t._private,n=r.rscratch,a=t.isEdge(),i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),l=s.strValue;return l==="none"?0:a&&l==="autorotate"?n.labelAutoAngle:l==="autorotate"?0:s.pfValue},Tr.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),n=t._private,a=n.rscratch;a.labelAngle=e.calculateLabelAngle(t),r&&(a.sourceLabelAngle=e.calculateLabelAngle(t,"source"),a.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var iv={},ov=28,sv=!1;iv.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<ov||t.height()<ov))return sv||(Ae("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),sv=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var n=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return r};var ks={};ks.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,n=function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),l)for(var c=0;c<s.length;c++){var u=s[c],d=u._private,f=d.rstyle;f.clean=!1,f.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(s){var l=s.target;n(l)}).on("style.* background.*",function(s){var l=s.target;n(l,!1)});var a=function(s){if(s){var l=r.onUpdateEleCalcsFns;e.cleanStyle();for(var c=0;c<e.length;c++){var u=e[c],d=u._private.rstyle;u.isNode()&&!d.cleanConnected&&(n(u.connectedEdges()),d.cleanConnected=!0)}if(l)for(var f=0;f<l.length;f++){var p=l[f];p(s,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){a(!0)},r.beforeRender(a,r.beforeRenderPriorities.eleCalcs)},ks.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)},ks.recalculateRenderedStyle=function(t,e){var r=function(C){return C._private.rstyle.cleanConnected},n=[],a=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var s=t[i],l=s._private,c=l.rstyle;s.isEdge()&&(!r(s.source())||!r(s.target()))&&(c.clean=!1),!(e&&c.clean||s.removed())&&s.pstyle("display").value!=="none"&&(l.group==="nodes"?a.push(s):n.push(s),c.clean=!0)}for(var u=0;u<a.length;u++){var d=a[u],f=d._private,p=f.rstyle,v=d.position();this.recalculateNodeLabelProjection(d),p.nodeX=v.x,p.nodeY=v.y,p.nodeW=d.pstyle("width").pfValue,p.nodeH=d.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var h=0;h<n.length;h++){var g=n[h],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 xs={};xs.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var n=t[r],a=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):a.inDragLayer?t.drag.push(n):t.nondrag.push(n)}for(var r=0;r<e.length;r++){var n=e[r];t.drag.push(n)}}},xs.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},xs.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(xp),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var lv={};[Kn,bs,Pt,Hi,Bc,Tr,iv,ks,xs].forEach(function(t){xe(lv,t)});var cv={};cv.getCachedImage=function(t,e,r){var n=this,a=n.imageCache=n.imageCache||{},i=a[t];if(i)return i.image.complete||i.image.addEventListener("load",r),i.image;i=a[t]=a[t]||{};var s=i.image=new Image;s.addEventListener("load",r),s.addEventListener("error",function(){s.error=!0});var l="data:",c=t.substring(0,l.length).toLowerCase()===l;return c||(e=e==="null"?null:e,s.crossOrigin=e),s.src=t,s};var Ma={};Ma.registerBinding=function(t,e,r,n){var a=Array.prototype.slice.apply(arguments,[1]),i=this.binder(t);return i.on.apply(i,a)},Ma.binder=function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||zE(t);if(e.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});r.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=a}var s=function(c,u,d){var f=Array.prototype.slice.call(arguments);return n&&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}},Ma.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()},Ma.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()},Ma.load=function(){var t=this,e=t.cy.window(),r=function(T){return T.selected()},n=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},c=function(T){T[0]._private.rscratch.inDragLayer=!0},u=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},p=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(c),Q.connectedEdges().forEach(c)),R.addToList&&p(Q,R)}},h=function(T,R){R=R||{};var Q=T.cy().hasCompoundNodes();R.inDragLayer&&(T.forEach(c),T.neighborhood().stdFilter(function(G){return!Q||G.isEdge()}).forEach(c)),R.addToList&&T.forEach(function(G){p(G,R)}),v(T,R),m(T,{inDragLayer:R.inDragLayer}),t.updateCachedGrabbedEles()},g=h,y=function(T){T&&(t.getCachedZSortedEles().forEach(function(R){l(R),u(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(c),G.forEach(c)),R.addToList&&G.forEach(function(ie){p(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 x=Lo(function(){t.cy.resize()},100);w&&(t.styleObserver=new MutationObserver(x),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",x),C&&(t.resizeObserver=new ResizeObserver(x),t.resizeObserver.observe(t.container));var E=function(T,R){for(;T!=null;)R(T),T=T.parentNode},k=function(){t.invalidateContainerClientCoordsCache()};E(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)});h(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()}n(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 rt=ie[0]-we[0],nt=rt*rt,Qe=ie[1]-we[1],_t=Qe*Qe,ut=nt+_t;t.hoverData.isOverThresholdDrag=$e=ut>=t.desktopTapThreshold2}var ht=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,n(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 tr;if(t.hoverData.justStartedPan){var hr=t.hoverData.mdownPos;tr={x:(Z[0]-hr[0])*U,y:(Z[1]-hr[1])*U},t.hoverData.justStartedPan=!1}else tr={x:ye[0]*U,y:ye[1]*U};G.panBy(tr),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()&&(ht||!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=ga(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&&n(Se,["mouseout","tapdragout"],T,{x:Z[0],y:Z[1]}),ge&&n(ge,["mouseover","tapdragover"],T,{x:Z[0],y:Z[1]}),t.hoverData.last=ge),ve)if($e){if(G.boxSelectionEnabled()&&ht)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||h(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 pt=t.hoverData.dragDelta;pt&&le(pt[0])&&le(pt[1])&&(at.x+=pt[0],at.y+=pt[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,P;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(n(ie,["mouseup","tapend","vmouseup"],T,{x:G[0],y:G[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(n(ae,["click","tap","vclick"],T,{x:G[0],y:G[1]}),D=!1,T.timeStamp-P<=Q.multiClickDebounceTime()?(N&&clearTimeout(N),D=!0,P=null,n(ae,["dblclick","dbltap","vdblclick"],T,{x:G[0],y:G[1]})):(N=setTimeout(function(){D||n(ae,["oneclick","onetap","voneclick"],T,{x:G[0],y:G[1]})},Q.multiClickDebounceTime()),P=T.timeStamp)),ae==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(T)&&(Q.$(r).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.$(r).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.$(r).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 _,F,O,M,L,V,H,$,z,j,ee,J,X,re=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],_=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<=_&&_<=ee&&0<=O&&O<=ee&&0<=F&&F<=J&&0<=M&&M<=J;var Z=R.pan(),ae=R.zoom();L=re(_,F,O,M),V=Y(_,F,O,M),H=[(_+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(ut){return ut.selected()&&t.nodeIsGrabbable(ut)}),h($e,{addToList:Ge})):g(ye,{addToList:Ge}),d(ye);var rt=function(ht){return{originalEvent:T,type:ht,position:{x:Q[0],y:Q[1]}}};ye.emit(rt("grabon")),$e?$e.forEach(function(ut){ut.emit(rt("grab"))}):ye.emit(rt("grab"))}n(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&&n(t.touchData.start,["taphold"],T,{x:Q[0],y:Q[1]})},t.tapholdDuration)}}if(T.touches.length>=1){for(var nt=t.touchData.startPosition=[null,null,null,null,null,null],Qe=0;Qe<Q.length;Qe++)nt[Qe]=G[Qe]=Q[Qe];var _t=T.touches[0];t.touchData.startGPosition=[_t.clientX,_t.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,rt=ye+$e;Ce=rt>=t.touchTapThreshold2}if(R&&t.touchData.cxt){T.preventDefault();var nt=T.touches[0].clientX-z,Qe=T.touches[0].clientY-j,_t=T.touches[1].clientX-z,ut=T.touches[1].clientY-j,ht=Y(nt,Qe,_t,ut),Wt=ht/V,Ot=150,It=Ot*Ot,tr=1.5,hr=tr*tr;if(Wt>=hr||ht>=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 pt=0;pt<at.length;pt++){var mn=at[pt]._private;mn.grabbed=!1,mn.rscratch.inDragLayer=!1}}var q=t.touchData.start,nt=T.touches[0].clientX-z,Qe=T.touches[0].clientY-j,_t=T.touches[1].clientX-z,ut=T.touches[1].clientY-j,ce=re(nt,Qe,_t,ut),_e=ce/L;if(X){var He=nt-_,Nr=Qe-F,yn=_t-O,za=ut-M,qr=(He+yn)/2,rr=(Nr+za)/2,bn=G.zoom(),zc=bn*_e,Ns=G.pan(),xg=$[0]*bn+Ns.x,Eg=$[1]*bn+Ns.y,E_={x:-zc/bn*(xg-Ns.x-qr)+xg,y:-zc/bn*(Eg-Ns.y-rr)+Eg};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:zc,pan:E_,cancelOnFailedZoom:!0}),G.emit("pinchzoom"),L=ce,_=nt,F=Qe,O=_t,M=ut,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 pr=t.touchData.start,Hc=t.touchData.last,Je;if(!t.hoverData.draggingEles&&!t.swipePanning&&(Je=t.findNearestElement(U[0],U[1],!0,!0)),R&&pr!=null&&T.preventDefault(),R&&pr!=null&&t.nodeIsDraggable(pr))if(Ce){var at=t.dragData.touchDragEles,Sg=!t.dragData.didDrag;Sg&&h(at,{inDragLayer:!0}),t.dragData.didDrag=!0;var Wi={x:0,y:0};if(le(ge[0])&&le(ge[1])&&(Wi.x+=ge[0],Wi.y+=ge[1],Sg)){t.redrawHint("eles",!0);var vr=t.touchData.dragDelta;vr&&le(vr[0])&&le(vr[1])&&(Wi.x+=vr[0],Wi.y+=vr[1])}t.hoverData.draggingEles=!0,at.silentShift(Wi).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 vr=t.touchData.dragDelta=t.touchData.dragDelta||[];vr.length===0?(vr.push(ge[0]),vr.push(ge[1])):(vr[0]+=ge[0],vr[1]+=ge[1])}if(n(pr||Je,["touchmove","tapdrag","vmousemove"],T,{x:U[0],y:U[1]}),(!pr||!pr.grabbed())&&Je!=Hc&&(Hc&&Hc.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 pt=0;pt<U.length;pt++)U[pt]&&t.touchData.startPosition[pt]&&Ce&&(t.touchData.singleTouchMoved=!0);if(R&&(pr==null||pr.pannable())&&G.panningEnabled()&&G.userPanningEnabled()){var S_=i(pr,t.touchData.starts);S_&&(T.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=ga(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"),pr&&(pr.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,ne,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"))),n(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);n($e,["touchend","tapend","vmouseup","tapdragout"],T,{x:Z[0],y:Z[1]})}var rt=t.touchData.startPosition[0]-Z[0],nt=rt*rt,Qe=t.touchData.startPosition[1]-Z[1],_t=Qe*Qe,ut=nt+_t,ht=ut*ie*ie;t.touchData.singleTouchMoved||(R||U.$(":selected").unselect(["tapunselect"]),n(R,["tap","vclick"],T,{x:Z[0],y:Z[1]}),he=!1,T.timeStamp-se<=U.multiClickDebounceTime()?(ne&&clearTimeout(ne),he=!0,se=null,n(R,["dbltap","vdblclick"],T,{x:Z[0],y:Z[1]})):(ne=setTimeout(function(){he||n(R,["onetap","voneclick"],T,{x:Z[0],y:Z[1]})},U.multiClickDebounceTime()),se=T.timeStamp)),R!=null&&!t.dragData.didDrag&&R._private.selectable&&ht<t.touchTapThreshold2&&!t.pinching&&(U.selectionType()==="single"?(U.$(r).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})},Pe=function(T){return T.pointerType==="mouse"||T.pointerType===4};t.registerBinding(t.container,"pointerdown",function(te){Pe(te)||(te.preventDefault(),me(te),Ee(te),A(te))}),t.registerBinding(t.container,"pointerup",function(te){Pe(te)||(Ne(te),Ee(te),oe(te))}),t.registerBinding(t.container,"pointercancel",function(te){Pe(te)||(Ne(te),Ee(te),W(te))}),t.registerBinding(t.container,"pointermove",function(te){Pe(te)||(te.preventDefault(),De(te),Ee(te),K(te))})}};var Hr={};Hr.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,a,i,s,l,c){this.renderer.nodeShapeImpl("polygon",n,a,i,s,l,this.points)},intersectLine:function(n,a,i,s,l,c,u,d){return Ni(l,c,this.points,n,a,i/2,s/2,u)},checkPoint:function(n,a,i,s,l,c,u,d){return Rr(n,a,this.points,c,u,s,l,[0,-1],i)}}},Hr.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,s,l,c){return LT(i,s,e,r,n/2+l,a/2+l)},checkPoint:function(e,r,n,a,i,s,l,c){return Vn(e,r,a,i,s,l,n)}}},Hr.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,a,i,s,l,c,u){if(c[u]!==void 0&&c[u+"-cx"]===n&&c[u+"-cy"]===a)return c[u];c[u]=new Array(e.length/2),c[u+"-cx"]=n,c[u+"-cy"]=a;var d=i/2,f=s/2;l=l==="auto"?yh(i,s):l;for(var p=new Array(e.length/2),v=0;v<e.length/2;v++)p[v]={x:n+d*e[v*2],y:a+f*e[v*2+1]};var h,g,y,m,b=p.length;for(g=p[b-1],h=0;h<b;h++)y=p[h%b],m=p[(h+1)%b],c[u][h]=Tc(g,y,m,l),g=y,y=m;return c[u]},draw:function(n,a,i,s,l,c,u){this.renderer.nodeShapeImpl("round-polygon",n,a,i,s,l,this.points,this.getOrCreateCorners(a,i,s,l,c,u,"drawCorners"))},intersectLine:function(n,a,i,s,l,c,u,d,f){return MT(l,c,this.points,n,a,i,s,u,this.getOrCreateCorners(n,a,i,s,d,f,"corners"))},checkPoint:function(n,a,i,s,l,c,u,d,f){return IT(n,a,this.points,c,u,s,l,this.getOrCreateCorners(c,u,s,l,d,f,"corners"))}}},Hr.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Mt(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,s)},intersectLine:function(e,r,n,a,i,s,l,c){return gh(i,s,e,r,n,a,l,c)},checkPoint:function(e,r,n,a,i,s,l,c){var u=a/2,d=i/2;c=c==="auto"?Rn(a,i):c,c=Math.min(u,d,c);var f=c*2;return!!(Rr(e,r,this.points,s,l,a,i-f,[0,-1],n)||Rr(e,r,this.points,s,l,a-f,i,[0,-1],n)||Vn(e,r,f,f,s-u+c,l-d+c,n)||Vn(e,r,f,f,s+u-c,l-d+c,n)||Vn(e,r,f,f,s+u-c,l+d-c,n)||Vn(e,r,f,f,s-u+c,l+d-c,n))}}},Hr.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Xl(),points:Mt(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,null,s)},generateCutTrianglePts:function(e,r,n,a,i){var s=i==="auto"?this.cornerLength:i,l=r/2,c=e/2,u=n-c,d=n+c,f=a-l,p=a+l;return{topLeft:[u,f+s,u+s,f,u+s,f+s],topRight:[d-s,f,d,f+s,d-s,f+s],bottomRight:[d,p-s,d-s,p,d-s,p-s],bottomLeft:[u+s,p,u,p-s,u+s,p-s]}},intersectLine:function(e,r,n,a,i,s,l,c){var u=this.generateCutTrianglePts(n+2*l,a+2*l,e,r,c),d=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return Ni(i,s,d,e,r)},checkPoint:function(e,r,n,a,i,s,l,c){var u=c==="auto"?this.cornerLength:c;if(Rr(e,r,this.points,s,l,a,i-2*u,[0,-1],n)||Rr(e,r,this.points,s,l,a-2*u,i,[0,-1],n))return!0;var d=this.generateCutTrianglePts(a,i,s,l);return Ht(e,r,d.topLeft)||Ht(e,r,d.topRight)||Ht(e,r,d.bottomRight)||Ht(e,r,d.bottomLeft)}}},Hr.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Mt(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,s,l,c){var u=.15,d=.5,f=.85,p=this.generateBarrelBezierPts(n+2*l,a+2*l,e,r),v=function(y){var m=ma({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},u),b=ma({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},d),w=ma({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]]},h=[].concat(v(p.topLeft),v(p.topRight),v(p.bottomRight),v(p.bottomLeft));return Ni(i,s,h,e,r)},generateBarrelBezierPts:function(e,r,n,a){var i=r/2,s=e/2,l=n-s,c=n+s,u=a-i,d=a+i,f=Ql(e,r),p=f.heightOffset,v=f.widthOffset,h=f.ctrlPtOffsetPct*e,g={topLeft:[l,u+p,l+h,u,l+v,u],topRight:[c-v,u,c-h,u,c,u+p],bottomRight:[c,d-p,c-h,d,c-v,d],bottomLeft:[l+v,d,l+h,d,l,d-p]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g},checkPoint:function(e,r,n,a,i,s,l,c){var u=Ql(a,i),d=u.heightOffset,f=u.widthOffset;if(Rr(e,r,this.points,s,l,a,i-2*d,[0,-1],n)||Rr(e,r,this.points,s,l,a-2*f,i,[0,-1],n))return!0;for(var p=this.generateBarrelBezierPts(a,i,s,l),v=function(B,S,N){var D=N[4],P=N[2],I=N[0],_=N[5],F=N[1],O=Math.min(D,I),M=Math.max(D,I),L=Math.min(_,F),V=Math.max(_,F);if(O<=B&&B<=M&&L<=S&&S<=V){var H=FT(D,P,I),$=DT(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},h=Object.keys(p),g=0;g<h.length;g++){var y=h[g],m=p[y],b=v(e,r,m);if(b!=null){var w=m[5],C=m[3],x=m[1],E=ft(w,C,x,b);if(m.isTop&&E<=r||m.isBottom&&r<=E)return!0}}return!1}}},Hr.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Mt(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,s)},intersectLine:function(e,r,n,a,i,s,l,c){var u=e-(n/2+l),d=r-(a/2+l),f=d,p=e+(n/2+l),v=ln(i,s,e,r,u,d,p,f,!1);return v.length>0?v:gh(i,s,e,r,n,a,l,c)},checkPoint:function(e,r,n,a,i,s,l,c){c=c==="auto"?Rn(a,i):c;var u=2*c;if(Rr(e,r,this.points,s,l,a,i-u,[0,-1],n)||Rr(e,r,this.points,s,l,a-u,i,[0,-1],n))return!0;var d=a/2+2*n,f=i/2+2*n,p=[s-d,l-f,s-d,l,s+d,l,s+d,l-f];return!!(Ht(e,r,p)||Vn(e,r,u,u,s+a/2-c,l+i/2-c,n)||Vn(e,r,u,u,s-a/2+c,l+i/2-c,n))}}},Hr.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 r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}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 n=new Array(20);{var a=Zl(5,0),i=Zl(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++)n[l*4]=a[l*2],n[l*4+1]=a[l*2+1],n[l*4+2]=i[l*2],n[l*4+3]=i[l*2+1]}n=mh(n),this.generatePolygon("star",n),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 c=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",c),this.generateRoundPolygon("round-tag",c)}t.makePolygon=function(u){var d=u.join("$"),f="polygon-"+d,p;return(p=this[f])?p:e.generatePolygon(f,u)}};var Ki={};Ki.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},Ki.redraw=function(t){t=t||ch();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},Ki.beforeRender=function(t,e){if(!this.destroyed){e==null&&Ze("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(n,a){return a.priority-n.priority})}};var uv=function(e,r,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(r,n)};Ki.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function n(a){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){uv(t,!0,a);var i=Vr();t.render(t.renderOptions);var s=t.lastDrawTime=Vr();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 uv(t,!1,a);t.skipFrame=!1,Mo(n)}};Mo(r)}};var mD=function(e){this.init(e)},dv=mD,Fa=dv.prototype;Fa.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],Fa.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),n=e.cy.window();if(n){var a=n.document,i=a.head,s="__________cytoscape_stylesheet",l="__________cytoscape_container",c=a.getElementById(s)!=null;if(r.className.indexOf(l)<0&&(r.className=(r.className||"")+" "+l),!c){var u=a.createElement("style");u.id=s,u.textContent="."+l+" { position: relative; }",i.insertBefore(u,i.children[0])}var d=n.getComputedStyle(r),f=d.getPropertyValue("position");f==="static"&&Ae("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()},Fa.notify=function(t,e){var r=this,n=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&n.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},Fa.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],n=r,a=n.target;(a.off||a.removeEventListener).apply(a,n.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{}},Fa.isHeadless=function(){return!1},[Cc,lv,cv,Ma,Hr,Ki].forEach(function(t){xe(Fa,t)});var Nc=1e3/60,fv={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=Lo(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),s=function(u,d){var f=Vr(),p=a.averageRedrawTime,v=a.lastRedrawTime,h=[],g=a.cy.extent(),y=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var m=Vr(),b=m-f,w=m-d;if(v<Nc){var C=Nc-(u?p:0);if(w>=e.deqFastCost*C)break}else if(u){if(b>=e.deqCost*v||b>=e.deqAvgCost*p)break}else if(w>=e.deqNoDrawCost*Nc)break;var x=e.deq(n,y,g);if(x.length>0)for(var E=0;E<x.length;E++)h.push(x[E]);else break}h.length>0&&(e.onDeqd(n,h),!u&&e.shouldRedraw(n,h,y,g)&&i())},l=e.priority||ql;a.beforeRender(s,l(n))}}}},yD=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ao;Al(this,t),this.idsByKey=new kr,this.keyForId=new kr,this.cachesByLvl=new kr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Vl(t,[{key:"getIdsFor",value:function(r){r==null&&Ze("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(r);return a||(a=new va,n.set(r,a)),a}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),i=this.getKey(r);this.deleteIdForKey(a,n),this.addIdForKey(i,n),this.keyForId.set(n,i)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteIdForKey(a,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),i=this.getKey(r);return a!==i}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,a=this.lvls,i=n.get(r);return i||(i=new kr,n.set(r,i),a.push(r)),i}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var a=this.getKey(r),i=this.getCache(a,n);return i!=null&&this.updateKeyMappingFor(r),i}},{key:"getForCachedKey",value:function(r,n){var a=this.keyForId.get(r.id()),i=this.getCache(a,n);return i}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var a=this.getKey(r);return this.hasCache(a,n)}},{key:"setCache",value:function(r,n,a){a.key=r,this.getCachesAt(n).set(r,a)}},{key:"set",value:function(r,n,a){var i=this.getKey(r);this.setCache(i,n,a),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var a=this.getKey(r);this.deleteCache(a,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(a){return n.deleteCache(r,a)})}},{key:"invalidate",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}]),t}(),hv=25,Es=50,Ss=-4,Dc=3,bD=7.99,wD=8,CD=1024,kD=1024,xD=1024,ED=.2,SD=.8,TD=10,BD=.15,ND=.1,DD=.9,PD=.9,_D=100,OD=1,Aa={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},ID=wt({getKey:null,doesEleInvalidateKey:Ao,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:ih,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),qi=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var a=ID(r);xe(n,a),n.lookup=new yD(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},ct=qi.prototype;ct.reasons=Aa,ct.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},ct.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},ct.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Si(function(r,n){return n.reqs-r.reqs});return e},ct.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},ct.getElement=function(t,e,r,n,a){var i=this,s=this.renderer,l=s.cy.zoom(),c=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(n==null&&(n=Math.ceil(Wl(l*r))),n<Ss)n=Ss;else if(l>=bD||n>Dc)return null;var u=Math.pow(2,n),d=e.h*u,f=e.w*u,p=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,p))return null;var v=c.get(t,n);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;var h;if(d<=hv?h=hv:d<=Es?h=Es:h=Math.ceil(d/Es)*Es,d>xD||f>kD)return null;var g=i.getTextureQueue(h),y=g[g.length-2],m=function(){return i.recycleTexture(h,f)||i.addTexture(h,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===p},w=a&&a===Aa.dequeue,C=a&&a===Aa.highQuality,x=a&&a===Aa.downscale,E,k=n+1;k<=Dc;k++){var B=c.get(t,k);if(B){E=B;break}}var S=E&&E.level===n+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,h),b(S))N();else if(b(E))if(C){for(var D=E.level;D>n;D--)S=i.getElement(t,e,r,D,Aa.downscale);N()}else return i.queueElement(t,E.level-1),E;else{var P;if(!w&&!C&&!x)for(var I=n-1;I>=Ss;I--){var _=c.get(t,I);if(_){P=_;break}}if(b(P))return i.queueElement(t,n),P;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,p,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return v={x:y.usedWidth,texture:y,level:n,scale:u,width:f,height:d,scaledLabelShown:p},y.usedWidth+=Math.ceil(f+wD),y.eleCaches.push(v),c.set(t,n,v),i.checkTextureFullness(y),v},ct.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])},ct.invalidateElement=function(t){var e=this,r=e.lookup,n=[],a=r.isInvalid(t);if(a){for(var i=Ss;i<=Dc;i++){var s=r.getForCachedKey(t,i);s&&n.push(s)}var l=r.invalidate(t);if(l)for(var c=0;c<n.length;c++){var u=n[c],d=u.texture;d.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(d)}e.removeFromQueue(t)}},ct.checkTextureUtility=function(t){t.invalidatedWidth>=ED*t.width&&this.retireTexture(t)},ct.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>SD&&t.fullnessChecks>=TD?on(r,t):t.fullnessChecks++},ct.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),a=this.lookup;on(n,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)}Ul(i);var c=e.getRetiredTextureQueue(r);c.push(t)},ct.addTexture=function(t,e){var r=this,n=r.getTextureQueue(t),a={};return n.push(a),a.eleCaches=[],a.height=t,a.width=Math.max(CD,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=r.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a},ct.recycleTexture=function(t,e){for(var r=this,n=r.getTextureQueue(t),a=r.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,Ul(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),on(a,s),n.push(s),s}},ct.queueElement=function(t,e){var r=this,n=r.getElementQueue(),a=r.getElementKeyToQueue(),i=this.getKey(t),s=a[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var l={eles:t.spawn().merge(t),level:e,reqs:1,key:i};n.push(l),a[i]=l}},ct.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,s=0;s<OD&&r.size()>0;s++){var l=r.pop(),c=l.key,u=l.eles[0],d=i.hasCache(u,l.level);if(n[c]=null,d)continue;a.push(l);var f=e.getBoundingBox(u);e.getElement(u,f,t,l.level,Aa.dequeue)}return a},ct.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=this.getKey(t),i=n[a];i!=null&&(i.eles.length===1?(i.reqs=Kl,r.updateItem(i),r.pop(),n[a]=null):i.eles.unmerge(t))},ct.onDequeue=function(t){this.onDequeues.push(t)},ct.offDequeue=function(t){on(this.onDequeues,t)},ct.setupDequeueing=fv.setupDequeueing({deqRedrawThreshold:_D,deqCost:BD,deqAvgCost:ND,deqNoDrawCost:DD,deqFastCost:PD,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n<e.onDequeues.length;n++){var a=e.onDequeues[n];a(r)}},shouldRedraw:function(e,r,n,a){for(var i=0;i<r.length;i++)for(var s=r[i].eles,l=0;l<s.length;l++){var c=s[l].boundingBox();if(jl(c,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var LD=1,Ui=-4,Ts=2,MD=3.99,FD=50,AD=50,VD=.15,RD=.1,$D=.9,zD=.9,HD=1,pv=250,KD=4e3*4e3,qD=!0,vv=function(e){var r=this,n=r.renderer=e,a=n.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Vr()-2*pv,r.skipping=!1,r.eleTxrDeqs=a.collection(),r.scheduleElementRefinement=Lo(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},AD),n.beforeRender(function(s,l){l-r.lastInvalidationTime<=pv?r.skipping=!0:r.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(l,c){return c.reqs-l.reqs};r.layersQueue=new Si(i),r.setupDequeueing()},Et=vv.prototype,gv=0,UD=Math.pow(2,53)-1;Et.makeLayer=function(t,e){var r=Math.pow(2,e),n=Math.ceil(t.w*r),a=Math.ceil(t.h*r),i=this.renderer.makeOffscreenCanvas(n,a),s={id:gv=++gv%UD,bb:t,level:e,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},l=s.context,c=-s.bb.x1,u=-s.bb.y1;return l.scale(r,r),l.translate(c,u),s},Et.getLayers=function(t,e,r){var n=this,a=n.renderer,i=a.cy,s=i.zoom(),l=n.firstGet;if(n.firstGet=!1,r==null){if(r=Math.ceil(Wl(s*e)),r<Ui)r=Ui;else if(s>=MD||r>Ts)return null}n.validateLayersElesOrdering(r,t);var c=n.layersByLevel,u=Math.pow(2,r),d=c[r]=c[r]||[],f,p=n.levelIsComplete(r,t),v,h=function(){var N=function(F){if(n.validateLayersElesOrdering(F,t),n.levelIsComplete(F,t))return v=c[F],!0},D=function(F){if(!v)for(var O=r+F;Ui<=O&&O<=Ts&&!N(O);O+=F);};D(1),D(-1);for(var P=d.length-1;P>=0;P--){var I=d[P];I.invalid&&on(d,I)}};if(!p)h();else return d;var g=function(){if(!f){f=zt();for(var N=0;N<t.length;N++)hh(f,t[N].boundingBox())}return f},y=function(N){N=N||{};var D=N.after;g();var P=f.w*u*(f.h*u);if(P>KD)return null;var I=n.makeLayer(f,r);if(D!=null){var _=d.indexOf(D)+1;d.splice(_,0,I)}else(N.insert===void 0||N.insert)&&d.unshift(I);return I};if(n.skipping&&!l)return null;for(var m=null,b=t.length/LD,w=!l,C=0;C<t.length;C++){var x=t[C],E=x._private.rscratch,k=E.imgLayerCaches=E.imgLayerCaches||{},B=k[r];if(B){m=B;continue}if((!m||m.eles.length>=b||!vh(m.bb,x.boundingBox()))&&(m=y({insert:!0,after:m}),!m))return null;v||w?n.queueLayer(m,x):n.drawEleInLayer(m,x,r,e),m.eles.push(x),k[r]=m}return v||(w?null:d)},Et.getEleLevelForLayerLevel=function(t,e){return t},Et.drawEleInLayer=function(t,e,r,n){var a=this,i=this.renderer,s=t.context,l=e.boundingBox();l.w===0||l.h===0||!e.visible()||(r=a.getEleLevelForLayerLevel(r,n),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,r,qD),i.setImgSmoothing(s,!0))},Et.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var a=0,i=0;i<n.length;i++){var s=n[i];if(s.reqs>0||s.invalid)return!1;a+=s.eles.length}return a===e.length},Et.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n<r.length;n++){for(var a=r[n],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 r=this,n=gi(t[0]),a=0;a<t.length;a++)for(var i=n?null:t[a],s=n?t[a]:t[a].ele,l=s._private.rscratch,c=l.imgLayerCaches=l.imgLayerCaches||{},u=Ui;u<=Ts;u++){var d=c[u];d&&(i&&r.getEleLevelForLayerLevel(d.level)!==i.level||e(d,s,i))}},Et.haveLayers=function(){for(var t=this,e=!1,r=Ui;r<=Ts;r++){var n=t.layersByLevel[r];if(n&&n.length>0){e=!0;break}}return e},Et.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Vr(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,a,i){e.invalidateLayer(n)}))},Et.invalidateLayer=function(t){if(this.lastInvalidationTime=Vr(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];on(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var a=0;a<r.length;a++){var i=r[a]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}},Et.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(n,a,i){var s=n.replacement;if(s||(s=n.replacement=e.makeLayer(n.bb,n.level),s.replaces=n,s.eles=n.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 r=this,n=r.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++,n.updateItem(t)):(t.reqs=1,n.push(t))}},Et.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],a=0;a<HD&&r.size()!==0;){var i=r.peek();if(i.replacement){r.pop();continue}if(i.replaces&&i!==i.replaces.replacement){r.pop();continue}if(i.invalid){r.pop();continue}var s=i.elesQueue.shift();s&&(e.drawEleInLayer(i,s,i.level,t),a++),n.length===0&&n.push(!0),i.elesQueue.length===0&&(r.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return n},Et.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],n=t.replaces,a=r.indexOf(n);if(!(a<0||n.invalid)){r[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=Lo(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100),Et.setupDequeueing=fv.setupDequeueing({deqRedrawThreshold:FD,deqCost:VD,deqAvgCost:RD,deqNoDrawCost:$D,deqFastCost:zD,deq:function(e,r){return e.dequeue(r)},onDeqd:ql,shouldRedraw:ih,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var mv={},yv;function GD(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function WD(t,e,r){for(var n,a=0;a<e.length;a++){var i=e[a];a===0&&(n=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(r.x,r.y,n.x,n.y)}function bv(t,e,r){t.beginPath&&t.beginPath();for(var n=e,a=0;a<n.length;a++){var i=n[a];t.lineTo(i.x,i.y)}var s=r,l=r[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 jD(t,e,r,n,a){t.beginPath&&t.beginPath(),t.arc(r,n,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 c=i[l];t.lineTo(c.x,c.y)}t.closePath&&t.closePath()}function YD(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}mv.arrowShapeImpl=function(t){return(yv||(yv={polygon:GD,"triangle-backcurve":WD,"triangle-tee":bv,"circle-triangle":jD,"triangle-cross":bv,circle:YD}))[t]};var Br={};Br.drawElement=function(t,e,r,n,a,i){var s=this;e.isNode()?s.drawNode(t,e,r,n,a,i):s.drawEdge(t,e,r,n,a,i)},Br.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)},Br.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)},Br.drawCachedElementPortion=function(t,e,r,n,a,i,s,l){var c=this,u=r.getBoundingBox(e);if(!(u.w===0||u.h===0)){var d=r.getElement(e,u,n,a,i);if(d!=null){var f=l(c,e);if(f===0)return;var p=s(c,e),v=u.x1,h=u.y1,g=u.w,y=u.h,m,b,w,C,x;if(p!==0){var E=r.getRotationPoint(e);w=E.x,C=E.y,t.translate(w,C),t.rotate(p),x=c.getImgSmoothing(t),x||c.setImgSmoothing(t,!0);var k=r.getRotationOffset(e);m=k.x,b=k.y}else m=v,b=h;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),p!==0&&(t.rotate(-p),t.translate(-w,-C),x||c.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var ZD=function(){return 0},XD=function(e,r){return e.getTextAngle(r,null)},QD=function(e,r){return e.getTextAngle(r,"source")},JD=function(e,r){return e.getTextAngle(r,"target")},e3=function(e,r){return r.effectiveOpacity()},Pc=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};Br.drawCachedElement=function(t,e,r,n,a,i){var s=this,l=s.data,c=l.eleTxrCache,u=l.lblTxrCache,d=l.slbTxrCache,f=l.tlbTxrCache,p=e.boundingBox(),v=i===!0?c.reasons.highQuality:null;if(!(p.w===0||p.h===0||!e.visible())&&(!n||jl(p,n))){var h=e.isEdge(),g=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,c,r,a,v,ZD,e3),(!h||!g)&&s.drawCachedElementPortion(t,e,u,r,a,v,XD,Pc),h&&!g&&(s.drawCachedElementPortion(t,e,d,r,a,v,QD,Pc),s.drawCachedElementPortion(t,e,f,r,a,v,JD,Pc)),s.drawElementOverlay(t,e)}},Br.drawElements=function(t,e){for(var r=this,n=0;n<e.length;n++){var a=e[n];r.drawElement(t,a)}},Br.drawCachedElements=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var s=e[i];a.drawCachedElement(t,s,r,n)}},Br.drawCachedNodes=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var s=e[i];s.isNode()&&a.drawCachedElement(t,s,r,n)}},Br.drawLayeredElements=function(t,e,r,n){var a=this,i=a.data.lyrTxrCache.getLayers(e,r);if(i)for(var s=0;s<i.length;s++){var l=i[s],c=l.bb;c.w===0||c.h===0||t.drawImage(l.canvas,c.x1,c.y1,c.w,c.h)}else a.drawCachedElements(t,e,r,n)};var Kr={};Kr.drawEdge=function(t,e,r){var n=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 c;r&&(c=r,t.translate(-c.x1,-c.y1));var u=i?e.pstyle("opacity").value:1,d=i?e.pstyle("line-opacity").value:1,f=e.pstyle("curve-style").value,p=e.pstyle("line-style").value,v=e.pstyle("width").pfValue,h=e.pstyle("line-cap").value,g=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,m=u*d,b=u*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=h,s.eleStrokeStyle(t,e,F),s.drawEdgePath(e,t,l.allpts,p),t.lineCap="butt")},C=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;if(t.lineWidth=v+g,t.lineCap=h,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,p),t.lineCap="butt")},x=function(){a&&s.drawEdgeOverlay(t,e)},E=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,n)};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,P=e.pstyle("ghost-opacity").value,I=m*P;t.translate(N,D),w(I),k(I),t.translate(-N,-D)}else C();E(),w(),k(),x(),B(),r&&t.translate(c.x1,c.y1)}};var wv=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var a=n.pstyle("".concat(e,"-opacity")).value;if(a!==0){var i=this,s=i.usePaths(),l=n._private.rscratch,c=n.pstyle("".concat(e,"-padding")).pfValue,u=2*c,d=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,l.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,d[0],d[1],d[2],a),i.drawEdgePath(n,r,l.allpts,"solid")}}}};Kr.drawEdgeOverlay=wv("overlay"),Kr.drawEdgeUnderlay=wv("underlay"),Kr.drawEdgePath=function(t,e,r,n){var a=t._private.rscratch,i=e,s,l=!1,c=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,d=t.pstyle("line-dash-offset").pfValue;if(c){var f=r.join("$"),p=a.pathCacheKey&&a.pathCacheKey===f;p?(s=e=a.pathCache,l=!0):(s=e=new Path2D,a.pathCacheKey=f,a.pathCache=s)}if(i.setLineDash)switch(n){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=d;break;case"solid":i.setLineDash([]);break}if(!l&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var v=2;v+3<r.length;v+=4)e.quadraticCurveTo(r[v],r[v+1],r[v+2],r[v+3]);break;case"straight":case"haystack":for(var h=2;h+1<r.length;h+=2)e.lineTo(r[h],r[h+1]);break;case"segments":if(a.isRound){var g=Rf(a.roundCorners),y;try{for(g.s();!(y=g.n()).done;){var m=y.value;tv(e,m)}}catch(w){g.e(w)}finally{g.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var b=2;b+1<r.length;b+=2)e.lineTo(r[b],r[b+1]);break}e=i,c?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])},Kr.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var n=t.pstyle("width").pfValue,a=0;a+1<r.length;a+=2){var i=[r[a+2]-r[a],r[a+3]-r[a+1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),l=[i[1]/s,-i[0]/s],c=[l[0]*n/2,l[1]*n/2];e.beginPath(),e.moveTo(r[a]-c[0],r[a+1]-c[1]),e.lineTo(r[a]+c[0],r[a+1]+c[1]),e.lineTo(r[a+2],r[a+3]),e.closePath(),e.fill()}},Kr.drawArrowheads=function(t,e,r){var n=e._private.rscratch,a=n.edgeType==="haystack";a||this.drawArrowhead(t,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,r),this.drawArrowhead(t,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,r),a||this.drawArrowhead(t,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,r)},Kr.drawArrowhead=function(t,e,r,n,a,i,s){if(!(isNaN(n)||n==null||isNaN(a)||a==null||isNaN(i)||i==null)){var l=this,c=e.pstyle(r+"-arrow-shape").value;if(c!=="none"){var u=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",d=e.pstyle(r+"-arrow-fill").value,f=e.pstyle("width").pfValue,p=e.pstyle(r+"-arrow-width"),v=p.value==="match-line"?f:p.pfValue;p.units==="%"&&(v*=f);var h=e.pstyle("opacity").value;s===void 0&&(s=h);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,u,f,c,v,n,a,i),t.globalCompositeOperation=g);var y=e.pstyle(r+"-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,c,v,n,a,i)}}},Kr.drawArrowShape=function(t,e,r,n,a,i,s,l,c){var u=this,d=this.usePaths()&&a!=="triangle-cross",f=!1,p,v=e,h={x:s,y:l},g=t.pstyle("arrow-scale").value,y=this.getArrowWidth(n,g),m=u.arrowShapes[a];if(d){var b=u.arrowPathCache=u.arrowPathCache||[],w=Mn(a),C=b[w];C!=null?(p=e=C,f=!0):(p=e=new Path2D,b[w]=p)}f||(e.beginPath&&e.beginPath(),d?m.draw(e,1,0,{x:0,y:0},1):m.draw(e,y,c,h,n),e.closePath&&e.closePath()),e=v,d&&(e.translate(s,l),e.rotate(c),e.scale(y,y)),(r==="filled"||r==="both")&&(d?e.fill(p):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=i/(d?y:1),e.lineJoin="miter",d?e.stroke(p):e.stroke()),d&&(e.scale(1/y,1/y),e.rotate(-c),e.translate(-s,-l))};var _c={};_c.safeDrawImage=function(t,e,r,n,a,i,s,l,c,u){if(!(a<=0||i<=0||c<=0||u<=0))try{t.drawImage(e,r,n,a,i,s,l,c,u)}catch(d){Ae(d)}},_c.drawInscribedImage=function(t,e,r,n,a){var i=this,s=r.position(),l=s.x,c=s.y,u=r.cy().style(),d=u.getIndexedStyle.bind(u),f=d(r,"background-fit","value",n),p=d(r,"background-repeat","value",n),v=r.width(),h=r.height(),g=r.padding()*2,y=v+(d(r,"background-width-relative-to","value",n)==="inner"?0:g),m=h+(d(r,"background-height-relative-to","value",n)==="inner"?0:g),b=r._private.rscratch,w=d(r,"background-clip","value",n),C=w==="node",x=d(r,"background-image-opacity","value",n)*a,E=d(r,"background-image-smoothing","value",n),k=r.pstyle("corner-radius").value;k!=="auto"&&(k=r.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(r,"background-width","value",n)!=="auto"&&(d(r,"background-width","units",n)==="%"?N=d(r,"background-width","pfValue",n)*y:N=d(r,"background-width","pfValue",n)),d(r,"background-height","value",n)!=="auto"&&(d(r,"background-height","units",n)==="%"?D=d(r,"background-height","pfValue",n)*m:D=d(r,"background-height","pfValue",n)),!(N===0||D===0)){if(f==="contain"){var P=Math.min(y/N,m/D);N*=P,D*=P}else if(f==="cover"){var P=Math.max(y/N,m/D);N*=P,D*=P}var I=l-y/2,_=d(r,"background-position-x","units",n),F=d(r,"background-position-x","pfValue",n);_==="%"?I+=(y-N)*F:I+=F;var O=d(r,"background-offset-x","units",n),M=d(r,"background-offset-x","pfValue",n);O==="%"?I+=(y-N)*M:I+=M;var L=c-m/2,V=d(r,"background-position-y","units",n),H=d(r,"background-position-y","pfValue",n);V==="%"?L+=(m-D)*H:L+=H;var $=d(r,"background-offset-y","units",n),z=d(r,"background-offset-y","pfValue",n);$==="%"?L+=(m-D)*z:L+=z,b.pathCache&&(I-=l,L-=c,l=0,c=0);var j=t.globalAlpha;t.globalAlpha=x;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),p==="no-repeat")C&&(t.save(),b.pathCache?t.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,l,c,y,m,k,b),t.clip())),i.safeDrawImage(t,e,0,0,B,S,I,L,N,D),C&&t.restore();else{var X=t.createPattern(e,p);t.fillStyle=X,i.nodeShapes[i.getNodeShape(r)].draw(t,l,c,y,m,k,b),t.translate(I,L),t.fill(),t.translate(-I,-L)}t.globalAlpha=j,J&&i.setImgSmoothing(t,ee)}};var Wn={};Wn.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(Wl(r*n));e=Math.pow(2,a)}var i=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;return!(i<s)},Wn.drawElementText=function(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var l=e.pstyle("label");if(!l||!l.value)return;var c=s.getLabelJustification(e);t.textAlign=c,t.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(u||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var v=!r,h;r&&(h=r,t.translate(-h.x1,-h.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),r&&t.translate(h.x1,h.y1)},Wn.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e},Wn.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=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=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,c=e.pstyle("text-outline-opacity").value*l,u=e.pstyle("color").value,d=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+a+" "+i,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],l),this.colorStrokeStyle(t,d[0],d[1],d[2],c)};function Oc(t,e,r,n,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,r),t.lineTo(e+n-i,r),t.quadraticCurveTo(e+n,r,e+n,r+i),t.lineTo(e+n,r+a-i),t.quadraticCurveTo(e+n,r+a,e+n-i,r+a),t.lineTo(e+i,r+a),t.quadraticCurveTo(e,r+a,e,r+a-i),t.lineTo(e,r+i),t.quadraticCurveTo(e,r,e+i,r),t.closePath(),s?t.stroke():t.fill()}Wn.getTextAngle=function(t,e){var r,n=t._private,a=n.rscratch,i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),l=ur(a,"labelAngle",e);return s.strValue==="autorotate"?r=t.isEdge()?l:0:s.strValue==="none"?r=0:r=s.pfValue,r},Wn.drawText=function(t,e,r){var n=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))){r==="main"&&(r=null);var c=ur(s,"labelX",r),u=ur(s,"labelY",r),d,f,p=this.getLabelText(e,r);if(p!=null&&p!==""&&!isNaN(c)&&!isNaN(u)){this.setupTextStyle(t,e,a);var v=r?r+"-":"",h=ur(s,"labelWidth",r),g=ur(s,"labelHeight",r),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"),c+=y,u+=m;var x;switch(n?x=this.getTextAngle(e,r):x=0,x!==0&&(d=c,f=u,t.translate(d,f),t.rotate(x),c=0,u=0),C){case"top":break;case"center":u+=g/2;break;case"bottom":u+=g;break}var E=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,P=2;if(E>0||B>0&&k>0){var I=c-S;switch(w){case"left":I-=h;break;case"center":I-=h/2;break}var _=u-g-S,F=h+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?Oc(t,I,_,F,O,P):t.fillRect(I,_,F,O),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?Oc(t,I,_,F,O,P,"stroke"):t.strokeRect(I,_,F,O),z==="double"){var j=B/2;D?Oc(t,I+j,_+j,F-j*2,O-j*2,P,"stroke"):t.strokeRect(I+j,_+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=ur(s,"labelWrapCachedLines",r),X=ur(s,"labelLineHeight",r),re=h/2,Y=this.getLabelJustification(e);switch(Y==="auto"||(w==="left"?Y==="left"?c+=-h:Y==="center"&&(c+=-re):w==="center"?Y==="left"?c+=-re:Y==="right"&&(c+=re):w==="right"&&(Y==="center"?c+=re:Y==="right"&&(c+=h))),C){case"top":u-=(J.length-1)*X;break;case"center":case"bottom":u-=(J.length-1)*X;break}for(var A=0;A<J.length;A++)ee>0&&t.strokeText(J[A],c,u),t.fillText(J[A],c,u),u+=X}else ee>0&&t.strokeText(p,c,u),t.fillText(p,c,u);x!==0&&(t.rotate(-x),t.translate(-d,-f))}}};var Va={};Va.drawNode=function(t,e,r){var n=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,c,u=e._private,d=u.rscratch,f=e.position();if(!(!le(f.x)||!le(f.y))&&!(i&&!e.visible())){var p=i?e.effectiveOpacity():1,v=s.usePaths(),h,g=!1,y=e.padding();l=e.width()+2*y,c=e.height()+2*y;var m;r&&(m=r,t.translate(-m.x1,-m.y1));for(var b=e.pstyle("background-image"),w=b.value,C=new Array(w.length),x=new Array(w.length),E=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);E++,x[k]=s.getCachedImage(B,N,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var D=e.pstyle("background-blacken").value,P=e.pstyle("border-width").pfValue,I=e.pstyle("background-opacity").value*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*p,z=e.pstyle("outline-width").pfValue,j=e.pstyle("outline-color").value,ee=e.pstyle("outline-style").value,J=e.pstyle("outline-opacity").value*p,X=e.pstyle("outline-offset").value,re=e.pstyle("corner-radius").value;re!=="auto"&&(re=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,_[0],_[1],_[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=nh(ae==="polygon"?ae+","+we.join(","):ae,""+Z,""+ie,""+re),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 ne=W(l,c,oe,he);h=ne.path,g=ne.cacheHit}var se=function(){if(!g){var ie=f;v&&(ie={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(h||t,ie.x,ie.y,l,c,re,d)}v?t.fill(h):t.fill()},ue=function(){for(var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ae=u.backgrounding,we=0,Ce=0;Ce<x.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]&&x[Ce].complete&&!x[Ce].error&&(we++,s.drawInscribedImage(t,x[Ce],e,Ce,ie))}u.backgrounding=we!==E,ae!==u.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]:p;s.hasPie(e)&&(s.drawPie(t,e,Z),ie&&(v||s.nodeShapes[s.getNodeShape(e)].draw(t,f.x,f.y,l,c,re,d)))},de=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,Z=(D>0?D:-D)*ie,ae=D>0?0:255;D!==0&&(s.colorFillStyle(t,ae,ae,ae,Z),v?t.fill(h):t.fill())},me=function(){if(P>0){if(t.lineWidth=P,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(h):t.clip();else{var ie=new Path2D;ie.rect(-l/2-P,-c/2-P,l+2*P,c+2*P),ie.addPath(h),t.clip(ie,"evenodd")}v?t.stroke(h):t.stroke(),t.restore()}else v?t.stroke(h):t.stroke();if(F==="double"){t.lineWidth=P/3;var Z=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(h):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=P;L==="inside"&&(ae=0),L==="outside"&&(ae*=2);var we=(l+ae+(z+X))/l,Ce=(c+ae+(z+X))/c,ge=l*we,Se=c*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,rt=0,nt=0;Z==="round-diamond"?$e=(ae+X+z)*1.4:Z==="round-heptagon"?($e=(ae+X+z)*1.075,nt=-(ae/2+X+z)/35):Z==="round-hexagon"?$e=(ae+X+z)*1.12:Z==="round-pentagon"?($e=(ae+X+z)*1.13,nt=-(ae/2+X+z)/15):Z==="round-tag"?($e=(ae+X+z)*1.12,rt=(ae/2+z+X)*.07):Z==="round-triangle"&&($e=(ae+X+z)*(Math.PI/2),nt=-(ae+X/2+z)/Math.PI),$e!==0&&(we=(l+$e)/l,ge=l*we,["round-hexagon","round-tag"].includes(Z)||(Ce=(c+$e)/c,Se=c*Ce)),re=re==="auto"?yh(ge,Se):re;for(var Qe=ge/2,_t=Se/2,ut=re+(ae+z+X)/2,ht=new Array(ve.length/2),Wt=new Array(ve.length/2),Ot=0;Ot<ve.length/2;Ot++)ht[Ot]={x:ie.x+rt+Qe*ve[Ot*2],y:ie.y+nt+_t*ve[Ot*2+1]};var It,tr,hr,Kt,Je=ht.length;for(tr=ht[Je-1],It=0;It<Je;It++)hr=ht[It%Je],Kt=ht[(It+1)%Je],Wt[It]=Tc(tr,hr,Kt,ut),tr=hr,hr=Kt;s.drawRoundPolygonPath(ye||t,ie.x+rt,ie.y+nt,l*we,c*Ce,ve,Wt)}else if(["roundrectangle","round-rectangle"].includes(Z))re=re==="auto"?Rn(ge,Se):re,s.drawRoundRectanglePath(ye||t,ie.x,ie.y,ge,Se,re+(ae+z+X)/2);else if(["cutrectangle","cut-rectangle"].includes(Z))re=re==="auto"?Xl():re,s.drawCutRectanglePath(ye||t,ie.x,ie.y,ge,Se,null,re+(ae+z+X)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(Z))re=re==="auto"?Rn(ge,Se):re,s.drawBottomRoundRectanglePath(ye||t,ie.x,ie.y,ge,Se,re+(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=Ko(qo(ve,at)),s.drawPolygonPath(ye||t,ie.x,ie.y,l,c,ve)}else{var pt=(ae+z+X)/l;ve=Ko(qo(ve,-pt)),s.drawPolygonPath(ye||t,ie.x,ie.y,l,c,ve)}if(v?t.stroke(ye):t.stroke(),ee==="double"){t.lineWidth=ae/3;var mn=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(ye):t.stroke(),t.globalCompositeOperation=mn}t.setLineDash&&t.setLineDash([])}},De=function(){a&&s.drawNodeOverlay(t,e,f,l,c)},Ee=function(){a&&s.drawNodeUnderlay(t,e,f,l,c)},Pe=function(){s.drawElementText(t,e,null,n)},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*p;t.translate(T,R),K(),Ne(),Y(Q*I),se(),ue(G,!0),A(Q*$),me(),pe(D!==0||P!==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(p,!0),A(),me(),pe(D!==0||P!==0),ue(p,!1),de(),v&&t.translate(-f.x,-f.y),Pe(),De(),r&&t.translate(m.x1,m.y1)}};var Cv=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n,a,i,s){var l=this;if(n.visible()){var c=n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-opacity")).value,d=n.pstyle("".concat(e,"-color")).value,f=n.pstyle("".concat(e,"-shape")).value,p=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(a=a||n.position(),i==null||s==null){var v=n.padding();i=n.width()+2*v,s=n.height()+2*v}l.colorFillStyle(r,d[0],d[1],d[2],u),l.nodeShapes[f].draw(r,a.x,a.y,i+c*2,s+c*2,p),r.fill()}}}};Va.drawNodeOverlay=Cv("overlay"),Va.drawNodeUnderlay=Cv("underlay"),Va.hasPie=function(t){return t=t[0],t._private.hasPie},Va.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),s=n.x,l=n.y,c=e.width(),u=e.height(),d=Math.min(c,u)/2,f=0,p=this.usePaths();p&&(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 h=e.pstyle("pie-"+v+"-background-size").value,g=e.pstyle("pie-"+v+"-background-color").value,y=e.pstyle("pie-"+v+"-background-opacity").value*r,m=h/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;h===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={},t3=100;Gt.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r},Gt.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,a=0;a<e.length;a++)if(n=e[a],n.context===t){r=!1;break}return r&&(n={context:t},e.push(n)),n},Gt.createGradientStyleFor=function(t,e,r,n,a){var i,s=this.usePaths(),l=r.pstyle(e+"-gradient-stop-colors").value,c=r.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(r.isEdge()){var u=r.sourceEndpoint(),d=r.targetEndpoint(),f=r.midpoint(),p=Fn(u,f),v=Fn(d,f);i=t.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(p,v))}else{var h=s?{x:0,y:0}:r.position(),g=r.paddedWidth(),y=r.paddedHeight();i=t.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(g,y))}else if(r.isEdge()){var m=r.sourceEndpoint(),b=r.targetEndpoint();i=t.createLinearGradient(m.x,m.y,b.x,b.y)}else{var w=s?{x:0,y:0}:r.position(),C=r.paddedWidth(),x=r.paddedHeight(),E=C/2,k=x/2,B=r.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+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-k,w.x+E,w.y+k);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(w.x-E,w.y+k,w.x+E,w.y-k);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(w.x+E,w.y-k,w.x-E,w.y+k);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(w.x+E,w.y+k,w.x-E,w.y-k);break}}if(!i)return null;for(var S=c.length===l.length,N=l.length,D=0;D<N;D++)i.addColorStop(S?c[D]:D/(N-1),"rgba("+l[D][0]+","+l[D][1]+","+l[D][2]+","+a+")");return i},Gt.gradientFillStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"background",e,r,n);if(!a)return null;t.fillStyle=a},Gt.colorFillStyle=function(t,e,r,n,a){t.fillStyle="rgba("+e+","+r+","+n+","+a+")"},Gt.eleFillStyle=function(t,e,r){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(t,e,n,r);else{var a=e.pstyle("background-color").value;this.colorFillStyle(t,a[0],a[1],a[2],r)}},Gt.gradientStrokeStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"line",e,r,n);if(!a)return null;t.strokeStyle=a},Gt.colorStrokeStyle=function(t,e,r,n,a){t.strokeStyle="rgba("+e+","+r+","+n+","+a+")"},Gt.eleStrokeStyle=function(t,e,r){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(t,e,n,r);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(t,a[0],a[1],a[2],r)}},Gt.matchCanvasSize=function(t){var e=this,r=e.data,n=e.findContainerClientCoords(),a=n[2],i=n[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 c=a*s,u=i*s,d;if(!(c===e.canvasWidth&&u===e.canvasHeight)){e.fontCaches=null;var f=r.canvasContainer;f.style.width=a+"px",f.style.height=i+"px";for(var p=0;p<e.CANVAS_LAYERS;p++)d=r.canvases[p],d.width=c,d.height=u,d.style.width=a+"px",d.style.height=i+"px";for(var p=0;p<e.BUFFER_COUNT;p++)d=r.bufferCanvases[p],d.width=c,d.height=u,d.style.width=a+"px",d.style.height=i+"px";e.textureMult=1,s<=1&&(d=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,d.width=c*e.textureMult,d.height=u*e.textureMult),e.canvasWidth=c,e.canvasHeight=u}},Gt.renderTo=function(t,e,r,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:n})},Gt.render=function(t){t=t||ch();var e=t.forcedContext,r=t.drawAllLayers,n=t.drawOnlyNodeLayer,a=t.forcedZoom,i=t.forcedPan,s=this,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,c=s.cy,u=s.data,d=u.canvasNeedsRedraw,f=s.textureOnViewport&&!e&&(s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming),p=t.motionBlur!==void 0?t.motionBlur:s.motionBlur,v=s.motionBlurPxRatio,h=c.hasCompoundNodes(),g=s.hoverData.draggingEles,y=!!(s.hoverData.selecting||s.touchData.selecting);p=p&&!e&&s.motionBlurEnabled&&!y;var m=p;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),p&&(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=c.style(),w=c.zoom(),C=a!==void 0?a:w,x=c.pan(),E={x:x.x,y:x.y},k={zoom:w,pan:{x:x.x,y:x.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&&!h)&&(s.motionBlurPxRatio=1),i&&(E=i),C*=l,E.x*=l,E.y*=l;var N=s.getCachedZSortedEles();function D(ne,se,ue,pe,de){var me=ne.globalCompositeOperation;ne.globalCompositeOperation="destination-out",s.colorFillStyle(ne,255,255,255,s.motionBlurTransparency),ne.fillRect(se,ue,pe,de),ne.globalCompositeOperation=me}function P(ne,se){var ue,pe,de,me;!s.clearingMotionBlur&&(ne===u.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]||ne===u.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG])?(ue={x:x.x*v,y:x.y*v},pe=w*v,de=s.canvasWidth*v,me=s.canvasHeight*v):(ue=E,pe=C,de=s.canvasWidth,me=s.canvasHeight),ne.setTransform(1,0,0,1,0,0),se==="motionBlur"?D(ne,0,0,de,me):!e&&(se===void 0||se)&&ne.clearRect(0,0,de,me),r||(ne.translate(ue.x,ue.y),ne.scale(pe,pe)),i&&ne.translate(i.x,i.y),a&&ne.scale(a,a)}if(f||(s.textureDrawLastFrame=!1),f){if(s.textureDrawLastFrame=!0,!s.textureCache){s.textureCache={},s.textureCache.bb=c.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 k=s.textureCache.viewport={zoom:c.zoom(),pan:c.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 _=u.contexts[s.NODE],F=s.textureCache.texture,k=s.textureCache.viewport;_.setTransform(1,0,0,1,0,0),p?D(_,0,0,k.width,k.height):_.clearRect(0,0,k.width,k.height);var O=b.core("outside-texture-bg-color").value,M=b.core("outside-texture-bg-opacity").value;s.colorFillStyle(_,O[0],O[1],O[2],M),_.fillRect(0,0,k.width,k.height);var w=c.zoom();P(_,!1),_.clearRect(k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l),_.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=c.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]&&p&&!s.clearedForMotionBlur[s.NODE]||s.clearingMotionBlur,$[s.NODE]&&(s.clearedForMotionBlur[s.NODE]=!0),$[s.DRAG]=!d[s.DRAG]&&p&&!s.clearedForMotionBlur[s.DRAG]||s.clearingMotionBlur,$[s.DRAG]&&(s.clearedForMotionBlur[s.DRAG]=!0),d[s.NODE]||r||n||$[s.NODE]){var z=p&&!$[s.NODE]&&v!==1,_=e||(z?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]:u.contexts[s.NODE]),j=p&&!z?"motionBlur":void 0;P(_,j),H?s.drawCachedNodes(_,N.nondrag,l,L):s.drawLayeredElements(_,N.nondrag,l,L),s.debug&&s.drawDebugPoints(_,N.nondrag),!r&&!p&&(d[s.NODE]=!1)}if(!n&&(d[s.DRAG]||r||$[s.DRAG])){var z=p&&!$[s.DRAG]&&v!==1,_=e||(z?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG]:u.contexts[s.DRAG]);P(_,p&&!z?"motionBlur":void 0),H?s.drawCachedNodes(_,N.drag,l,L):s.drawCachedElements(_,N.drag,l,L),s.debug&&s.drawDebugPoints(_,N.drag),!r&&!p&&(d[s.DRAG]=!1)}if(s.showFps||!n&&d[s.SELECT_BOX]&&!r){var _=e||u.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;_.lineWidth=ee,_.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+")",_.fillRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]),ee>0&&(_.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+")",_.strokeRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]))}if(u.bgActivePosistion&&!s.hoverData.selecting){var w=s.cy.zoom(),J=u.bgActivePosistion;_.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+")",_.beginPath(),_.arc(J.x,J.y,b.core("active-bg-size").pfValue/w,0,2*Math.PI),_.fill()}var X=s.lastRedrawTime;if(s.showFps&&X){X=Math.round(X);var re=Math.round(1e3/X);_.setTransform(1,0,0,1,0,0),_.fillStyle="rgba(255, 0, 0, 0.75)",_.strokeStyle="rgba(255, 0, 0, 0.75)",_.lineWidth=1,_.fillText("1 frame = "+X+" ms = "+re+" fps",0,20);var Y=60;_.strokeRect(0,30,250,20),_.fillRect(0,30,250*Math.min(re/Y,1),20)}r||(d[s.SELECT_BOX]=!1)}if(p&&v!==1){var A=u.contexts[s.NODE],K=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_NODE],W=u.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),p&&(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()},t3)),e||c.emit("render")};var gn={};gn.drawPolygonPath=function(t,e,r,n,a,i){var s=n/2,l=a/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*i[0],r+l*i[1]);for(var c=1;c<i.length/2;c++)t.lineTo(e+s*i[c*2],r+l*i[c*2+1]);t.closePath()},gn.drawRoundPolygonPath=function(t,e,r,n,a,i,s){s.forEach(function(l){return tv(t,l)}),t.closePath()},gn.drawRoundRectanglePath=function(t,e,r,n,a,i){var s=n/2,l=a/2,c=i==="auto"?Rn(n,a):Math.min(i,l,s);t.beginPath&&t.beginPath(),t.moveTo(e,r-l),t.arcTo(e+s,r-l,e+s,r,c),t.arcTo(e+s,r+l,e,r+l,c),t.arcTo(e-s,r+l,e-s,r,c),t.arcTo(e-s,r-l,e,r-l,c),t.lineTo(e,r-l),t.closePath()},gn.drawBottomRoundRectanglePath=function(t,e,r,n,a,i){var s=n/2,l=a/2,c=i==="auto"?Rn(n,a):i;t.beginPath&&t.beginPath(),t.moveTo(e,r-l),t.lineTo(e+s,r-l),t.lineTo(e+s,r),t.arcTo(e+s,r+l,e,r+l,c),t.arcTo(e-s,r+l,e-s,r,c),t.lineTo(e-s,r-l),t.lineTo(e,r-l),t.closePath()},gn.drawCutRectanglePath=function(t,e,r,n,a,i,s){var l=n/2,c=a/2,u=s==="auto"?Xl():s;t.beginPath&&t.beginPath(),t.moveTo(e-l+u,r-c),t.lineTo(e+l-u,r-c),t.lineTo(e+l,r-c+u),t.lineTo(e+l,r+c-u),t.lineTo(e+l-u,r+c),t.lineTo(e-l+u,r+c),t.lineTo(e-l,r+c-u),t.lineTo(e-l,r-c+u),t.closePath()},gn.drawBarrelPath=function(t,e,r,n,a){var i=n/2,s=a/2,l=e-i,c=e+i,u=r-s,d=r+s,f=Ql(n,a),p=f.widthOffset,v=f.heightOffset,h=f.ctrlPtOffsetPct*p;t.beginPath&&t.beginPath(),t.moveTo(l,u+v),t.lineTo(l,d-v),t.quadraticCurveTo(l+h,d,l+p,d),t.lineTo(c-p,d),t.quadraticCurveTo(c-h,d,c,d-v),t.lineTo(c,u+v),t.quadraticCurveTo(c-h,u,c-p,u),t.lineTo(l+p,u),t.quadraticCurveTo(l+h,u,l,u+v),t.closePath()};for(var kv=Math.sin(0),xv=Math.cos(0),Ic={},Lc={},Ev=Math.PI/40,Ra=0*Math.PI;Ra<2*Math.PI;Ra+=Ev)Ic[Ra]=Math.sin(Ra),Lc[Ra]=Math.cos(Ra);gn.drawEllipsePath=function(t,e,r,n,a){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,n/2,a/2,0,0,2*Math.PI);else for(var i,s,l=n/2,c=a/2,u=0*Math.PI;u<2*Math.PI;u+=Ev)i=e-l*Ic[u]*kv+l*Lc[u]*xv,s=r+c*Lc[u]*kv+c*Ic[u]*xv,u===0?t.moveTo(i,s):t.lineTo(i,s);t.closePath()};var Gi={};Gi.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]},Gi.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements(),n=r.boundingBox(),a=this.findContainerClientCoords(),i=t.full?Math.ceil(n.w):a[2],s=t.full?Math.ceil(n.h):a[3],l=le(t.maxWidth)||le(t.maxHeight),c=this.getPixelRatio(),u=1;if(t.scale!==void 0)i*=t.scale,s*=t.scale,u=t.scale;else if(l){var d=1/0,f=1/0;le(t.maxWidth)&&(d=u*t.maxWidth/i),le(t.maxHeight)&&(f=u*t.maxHeight/s),u=Math.min(d,f),i*=u,s*=u}l||(i*=c,s*=c,u*=c);var p=document.createElement("canvas");p.width=i,p.height=s,p.style.width=i+"px",p.style.height=s+"px";var v=p.getContext("2d");if(i>0&&s>0){v.clearRect(0,0,i,s),v.globalCompositeOperation="source-over";var h=this.getCachedZSortedEles();if(t.full)v.translate(-n.x1*u,-n.y1*u),v.scale(u,u),this.drawElements(v,h),v.scale(1/u,1/u),v.translate(n.x1*u,n.y1*u);else{var g=e.pan(),y={x:g.x*u,y:g.y*u};u*=e.zoom(),v.translate(y.x,y.y),v.scale(u,u),this.drawElements(v,h),v.scale(1/u,1/u),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 p};function r3(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return new Blob([n],{type:e})}function Sv(t){var e=t.indexOf(",");return t.substr(e+1)}function Tv(t,e,r){var n=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new ka(function(a,i){try{e.toBlob(function(s){s!=null?a(s):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(s){i(s)}});case"blob":return r3(Sv(n()),r);case"base64":return Sv(n());case"base64uri":default:return n()}}Gi.png=function(t){return Tv(t,this.bufferCanvasImage(t),"image/png")},Gi.jpg=function(t){return Tv(t,this.bufferCanvasImage(t),"image/jpeg")};var Bv={};Bv.nodeShapeImpl=function(t,e,r,n,a,i,s,l){switch(t){case"ellipse":return this.drawEllipsePath(e,r,n,a,i);case"polygon":return this.drawPolygonPath(e,r,n,a,i,s);case"round-polygon":return this.drawRoundPolygonPath(e,r,n,a,i,s,l);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,n,a,i,l);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,n,a,i,s,l);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,n,a,i,l);case"barrel":return this.drawBarrelPath(e,r,n,a,i)}};var n3=Nv,Me=Nv.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 Nv(t){var e=this,r=e.cy.window(),n=r.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=n.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 c={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};qE()&&(c["-ms-touch-action"]="none",c["touch-action"]="none");for(var u=0;u<Me.CANVAS_LAYERS;u++){var d=e.data.canvases[u]=n.createElement("canvas");e.data.contexts[u]=d.getContext("2d"),Object.keys(c).forEach(function(Y){d.style[Y]=c[Y]}),d.style.position="absolute",d.setAttribute("data-id","layer"+u),d.style.zIndex=String(Me.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(d),e.data.canvasNeedsRedraw[u]=!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 u=0;u<Me.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=n.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var f=zt(),p=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}},h=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)},x=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)},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},P=function(A){return p(k(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}},_=function(A,K,W){var oe=A[0]._private.rscratch;return{x:oe[K],y:oe[W]}},F=function(A){return I("",_(A,"labelX","labelY"),A)},O=function(A){return I("source",_(A,"sourceLabelX","sourceLabelY"),A)},M=function(A){return I("target",_(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 qi(e,{getKey:g,doesEleInvalidateKey:h,drawElement:w,getBoundingBox:k,getRotationPoint:P,getRotationOffset:L,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),j=e.data.lblTxrCache=new qi(e,{getKey:y,drawElement:C,getBoundingBox:B,getRotationPoint:F,getRotationOffset:$,isVisible:D}),ee=e.data.slbTxrCache=new qi(e,{getKey:m,drawElement:x,getBoundingBox:S,getRotationPoint:O,getRotationOffset:V,isVisible:D}),J=e.data.tlbTxrCache=new qi(e,{getKey:b,drawElement:E,getBoundingBox:N,getRotationPoint:M,getRotationOffset:H,isVisible:D}),X=e.data.lyrTxrCache=new vv(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 re=function(A){for(var K=0;K<A.length;K++)X.enqueueElementRefinement(A[K].ele)};z.onDequeue(re),j.onDequeue(re),ee.onDequeue(re),J.onDequeue(re)}Me.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[Me.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[Me.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[Me.SELECT_BOX]=e;break}};var a3=typeof Path2D<"u";Me.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t},Me.usePaths=function(){return a3&&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 r;if((typeof OffscreenCanvas>"u"?"undefined":ot(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),a=n.document;r=a.createElement("canvas"),r.width=t,r.height=e}return r},[mv,Br,Kr,_c,Wn,Va,Gt,gn,Gi,Bv].forEach(function(t){xe(Me,t)});var i3=[{name:"null",impl:Gp},{name:"base",impl:dv},{name:"canvas",impl:n3}],o3=[{type:"layout",extensions:fD},{type:"renderer",extensions:i3}],Dv={},Pv={};function _v(t,e,r){var n=r,a=function(B){Ae("Can not register `"+e+"` for `"+t+"` since `"+B+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(zi.prototype[e])return a(e);zi.prototype[e]=r}else if(t==="collection"){if(kt.prototype[e])return a(e);kt.prototype[e]=r}else if(t==="layout"){for(var i=function(B){this.options=B,r.call(this,B),Oe(this._private)||(this._private={}),this._private.cy=B.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(r.prototype),l=[],c=0;c<l.length;c++){var u=l[c];s[u]=s[u]||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=r.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},p={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 as(p,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}}),Ve.eventAliasesOn(s),n=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var v=Ov("renderer","base"),h=v.prototype,g=r,y=r.prototype,m=function(){v.apply(this,arguments),g.apply(this,arguments)},b=m.prototype;for(var w in h){var C=h[w],x=y[w]!=null;if(x)return a(w);b[w]=C}for(var E in y)b[E]=y[E];h.clientFunctions.forEach(function(k){b[k]=b[k]||function(){Ze("Renderer does not implement `renderer."+k+"()` on its prototype")}}),n=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 Wf({map:Dv,keys:[t,e],value:n})}function Ov(t,e){return jf({map:Dv,keys:[t,e]})}function s3(t,e,r,n,a){return Wf({map:Pv,keys:[t,e,r,n],value:a})}function l3(t,e,r,n){return jf({map:Pv,keys:[t,e,r,n]})}var Mc=function(){if(arguments.length===2)return Ov.apply(null,arguments);if(arguments.length===3)return _v.apply(null,arguments);if(arguments.length===4)return l3.apply(null,arguments);if(arguments.length===5)return s3.apply(null,arguments);Ze("Invalid extension access syntax")};zi.prototype.extension=Mc,o3.forEach(function(t){t.extensions.forEach(function(e){_v(t.type,e.name,e.impl)})});var Iv=function t(){if(!(this instanceof t))return new t;this.length=0},jn=Iv.prototype;jn.instanceString=function(){return"stylesheet"},jn.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this},jn.css=function(t,e){var r=this.length-1;if(be(t))this[r].properties.push({name:t,value:e});else if(Oe(t))for(var n=t,a=Object.keys(n),i=0;i<a.length;i++){var s=a[i],l=n[s];if(l!=null){var c=Nt.properties[s]||Nt.properties[Oo(s)];if(c!=null){var u=c.name,d=l;this[r].properties.push({name:u,value:d})}}}return this},jn.style=jn.css,jn.generateStyle=function(t){var e=new Nt(t);return this.appendToStyle(e)},jn.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],n=r.selector,a=r.properties;t.selector(n);for(var i=0;i<a.length;i++){var s=a[i];t.css(s.name,s.value)}}return t};var c3="3.30.2",Yn=function(e){if(e===void 0&&(e={}),Oe(e))return new zi(e);if(be(e))return Mc.apply(Mc,arguments)};Yn.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Yn),t.apply(null,e),this},Yn.warnings=function(t){return sh(t)},Yn.version=c3,Yn.stylesheet=Yn.Stylesheet=Iv;let u3=class extends EventTarget{constructor(r,n){super();gr(this,"cyg",null);gr(this,"nodes",[]);gr(this,"edges",[]);gr(this,"axons",[]);gr(this,"dendrites",[]);gr(this,"somas",[]);gr(this,"labelCache",new Map);gr(this,"graphCanvas",null);this.labelCache=r,this.graphCanvas=n}async addConnectivity(r){var n;if(this.axons=r.axons.map(a=>JSON.stringify(a)),this.dendrites=r.dendrites.map(a=>JSON.stringify(a)),(n=r.somas)!=null&&n.length&&(this.somas=r.somas.map(a=>JSON.stringify(a))),r.connectivity.length)for(const a of r.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(r){this.cyg=new p3(this,r),this.cyg.on("tap-node",n=>{const a=new CustomEvent("tap-node",{detail:n.detail});this.dispatchEvent(a)})}selectConnectivity(r){var n;if((n=this.cyg)!=null&&n.cy){let a="";this.cyg.cy.elements().forEach(i=>{const s=i.data("label"),l=Fc(s);h3(r,l)&&(a=i.id())}),a&&this.cyg.cy.$id(a).select()}}clearConnectivity(){var r;(r=this.cyg)!=null&&r.cy&&(this.cyg.cy.remove(),this.cyg.cy=null)}reset(){var r;(r=this.cyg)!=null&&r.cy&&this.cyg.cy.reset()}zoom(r){var n;if((n=this.cyg)!=null&&n.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+r,renderedPosition:l})}}enableZoom(r){var n;(n=this.cyg)!=null&&n.cy&&this.cyg.cy.userZoomingEnabled(r)}get elements(){return[...this.nodes.map(r=>({data:r})),...this.edges.map(r=>({data:r}))]}get roots(){return[...this.dendrites,...this.somas]}async graphNode(r){const n=JSON.stringify(r),a=[r[0],...r[1]],i=[];for(const l of a){const c=this.labelCache.has(l)?this.labelCache.get(l):"";i.push(c)}a.push(...i);const s={id:n,label:a.join(`
35
+ `),w=0;w<b.length;w++){var C=b[w],x=h.measureText(C),E=Math.ceil(x.width),k=d;y=Math.max(E,y),m+=k}return y+=c,m+=c,s[i]={width:y,height:m}},Tr.calculateLabelAngle=function(t,e){var r=t._private,n=r.rscratch,a=t.isEdge(),i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),l=s.strValue;return l==="none"?0:a&&l==="autorotate"?n.labelAutoAngle:l==="autorotate"?0:s.pfValue},Tr.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),n=t._private,a=n.rscratch;a.labelAngle=e.calculateLabelAngle(t),r&&(a.sourceLabelAngle=e.calculateLabelAngle(t,"source"),a.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var ov={},sv=28,lv=!1;ov.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<sv||t.height()<sv))return lv||(Ae("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),lv=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var n=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return r};var ks={};ks.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,n=function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),l)for(var c=0;c<s.length;c++){var u=s[c],d=u._private,f=d.rstyle;f.clean=!1,f.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(s){var l=s.target;n(l)}).on("style.* background.*",function(s){var l=s.target;n(l,!1)});var a=function(s){if(s){var l=r.onUpdateEleCalcsFns;e.cleanStyle();for(var c=0;c<e.length;c++){var u=e[c],d=u._private.rstyle;u.isNode()&&!d.cleanConnected&&(n(u.connectedEdges()),d.cleanConnected=!0)}if(l)for(var f=0;f<l.length;f++){var p=l[f];p(s,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){a(!0)},r.beforeRender(a,r.beforeRenderPriorities.eleCalcs)},ks.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)},ks.recalculateRenderedStyle=function(t,e){var r=function(C){return C._private.rstyle.cleanConnected},n=[],a=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var s=t[i],l=s._private,c=l.rstyle;s.isEdge()&&(!r(s.source())||!r(s.target()))&&(c.clean=!1),!(e&&c.clean||s.removed())&&s.pstyle("display").value!=="none"&&(l.group==="nodes"?a.push(s):n.push(s),c.clean=!0)}for(var u=0;u<a.length;u++){var d=a[u],f=d._private,p=f.rstyle,v=d.position();this.recalculateNodeLabelProjection(d),p.nodeX=v.x,p.nodeY=v.y,p.nodeW=d.pstyle("width").pfValue,p.nodeH=d.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var h=0;h<n.length;h++){var g=n[h],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 xs={};xs.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var n=t[r],a=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):a.inDragLayer?t.drag.push(n):t.nondrag.push(n)}for(var r=0;r<e.length;r++){var n=e[r];t.drag.push(n)}}},xs.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},xs.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(Ep),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var cv={};[Kn,bs,Pt,Hi,Bc,Tr,ov,ks,xs].forEach(function(t){xe(cv,t)});var uv={};uv.getCachedImage=function(t,e,r){var n=this,a=n.imageCache=n.imageCache||{},i=a[t];if(i)return i.image.complete||i.image.addEventListener("load",r),i.image;i=a[t]=a[t]||{};var s=i.image=new Image;s.addEventListener("load",r),s.addEventListener("error",function(){s.error=!0});var l="data:",c=t.substring(0,l.length).toLowerCase()===l;return c||(e=e==="null"?null:e,s.crossOrigin=e),s.src=t,s};var Ma={};Ma.registerBinding=function(t,e,r,n){var a=Array.prototype.slice.apply(arguments,[1]),i=this.binder(t);return i.on.apply(i,a)},Ma.binder=function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||zE(t);if(e.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});r.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=a}var s=function(c,u,d){var f=Array.prototype.slice.call(arguments);return n&&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}},Ma.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()},Ma.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()},Ma.load=function(){var t=this,e=t.cy.window(),r=function(T){return T.selected()},n=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},c=function(T){T[0]._private.rscratch.inDragLayer=!0},u=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},p=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(c),Q.connectedEdges().forEach(c)),R.addToList&&p(Q,R)}},h=function(T,R){R=R||{};var Q=T.cy().hasCompoundNodes();R.inDragLayer&&(T.forEach(c),T.neighborhood().stdFilter(function(G){return!Q||G.isEdge()}).forEach(c)),R.addToList&&T.forEach(function(G){p(G,R)}),v(T,R),m(T,{inDragLayer:R.inDragLayer}),t.updateCachedGrabbedEles()},g=h,y=function(T){T&&(t.getCachedZSortedEles().forEach(function(R){l(R),u(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(c),G.forEach(c)),R.addToList&&G.forEach(function(ie){p(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 x=Lo(function(){t.cy.resize()},100);w&&(t.styleObserver=new MutationObserver(x),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",x),C&&(t.resizeObserver=new ResizeObserver(x),t.resizeObserver.observe(t.container));var E=function(T,R){for(;T!=null;)R(T),T=T.parentNode},k=function(){t.invalidateContainerClientCoordsCache()};E(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)});h(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()}n(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 rt=ie[0]-we[0],nt=rt*rt,Qe=ie[1]-we[1],_t=Qe*Qe,ut=nt+_t;t.hoverData.isOverThresholdDrag=$e=ut>=t.desktopTapThreshold2}var ht=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,n(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 tr;if(t.hoverData.justStartedPan){var hr=t.hoverData.mdownPos;tr={x:(Z[0]-hr[0])*U,y:(Z[1]-hr[1])*U},t.hoverData.justStartedPan=!1}else tr={x:ye[0]*U,y:ye[1]*U};G.panBy(tr),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()&&(ht||!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=ga(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&&n(Se,["mouseout","tapdragout"],T,{x:Z[0],y:Z[1]}),ge&&n(ge,["mouseover","tapdragover"],T,{x:Z[0],y:Z[1]}),t.hoverData.last=ge),ve)if($e){if(G.boxSelectionEnabled()&&ht)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||h(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 pt=t.hoverData.dragDelta;pt&&le(pt[0])&&le(pt[1])&&(at.x+=pt[0],at.y+=pt[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,P;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(n(ie,["mouseup","tapend","vmouseup"],T,{x:G[0],y:G[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(n(ae,["click","tap","vclick"],T,{x:G[0],y:G[1]}),D=!1,T.timeStamp-P<=Q.multiClickDebounceTime()?(N&&clearTimeout(N),D=!0,P=null,n(ae,["dblclick","dbltap","vdblclick"],T,{x:G[0],y:G[1]})):(N=setTimeout(function(){D||n(ae,["oneclick","onetap","voneclick"],T,{x:G[0],y:G[1]})},Q.multiClickDebounceTime()),P=T.timeStamp)),ae==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(T)&&(Q.$(r).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.$(r).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.$(r).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 _,F,O,M,L,V,H,$,z,j,ee,J,X,re=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],_=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<=_&&_<=ee&&0<=O&&O<=ee&&0<=F&&F<=J&&0<=M&&M<=J;var Z=R.pan(),ae=R.zoom();L=re(_,F,O,M),V=Y(_,F,O,M),H=[(_+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(ut){return ut.selected()&&t.nodeIsGrabbable(ut)}),h($e,{addToList:Ge})):g(ye,{addToList:Ge}),d(ye);var rt=function(ht){return{originalEvent:T,type:ht,position:{x:Q[0],y:Q[1]}}};ye.emit(rt("grabon")),$e?$e.forEach(function(ut){ut.emit(rt("grab"))}):ye.emit(rt("grab"))}n(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&&n(t.touchData.start,["taphold"],T,{x:Q[0],y:Q[1]})},t.tapholdDuration)}}if(T.touches.length>=1){for(var nt=t.touchData.startPosition=[null,null,null,null,null,null],Qe=0;Qe<Q.length;Qe++)nt[Qe]=G[Qe]=Q[Qe];var _t=T.touches[0];t.touchData.startGPosition=[_t.clientX,_t.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,rt=ye+$e;Ce=rt>=t.touchTapThreshold2}if(R&&t.touchData.cxt){T.preventDefault();var nt=T.touches[0].clientX-z,Qe=T.touches[0].clientY-j,_t=T.touches[1].clientX-z,ut=T.touches[1].clientY-j,ht=Y(nt,Qe,_t,ut),Wt=ht/V,Ot=150,It=Ot*Ot,tr=1.5,hr=tr*tr;if(Wt>=hr||ht>=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 pt=0;pt<at.length;pt++){var mn=at[pt]._private;mn.grabbed=!1,mn.rscratch.inDragLayer=!1}}var q=t.touchData.start,nt=T.touches[0].clientX-z,Qe=T.touches[0].clientY-j,_t=T.touches[1].clientX-z,ut=T.touches[1].clientY-j,ce=re(nt,Qe,_t,ut),_e=ce/L;if(X){var He=nt-_,Nr=Qe-F,yn=_t-O,za=ut-M,qr=(He+yn)/2,rr=(Nr+za)/2,bn=G.zoom(),Hc=bn*_e,Ns=G.pan(),xg=$[0]*bn+Ns.x,Eg=$[1]*bn+Ns.y,E_={x:-Hc/bn*(xg-Ns.x-qr)+xg,y:-Hc/bn*(Eg-Ns.y-rr)+Eg};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:Hc,pan:E_,cancelOnFailedZoom:!0}),G.emit("pinchzoom"),L=ce,_=nt,F=Qe,O=_t,M=ut,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 pr=t.touchData.start,Kc=t.touchData.last,Je;if(!t.hoverData.draggingEles&&!t.swipePanning&&(Je=t.findNearestElement(U[0],U[1],!0,!0)),R&&pr!=null&&T.preventDefault(),R&&pr!=null&&t.nodeIsDraggable(pr))if(Ce){var at=t.dragData.touchDragEles,Sg=!t.dragData.didDrag;Sg&&h(at,{inDragLayer:!0}),t.dragData.didDrag=!0;var Wi={x:0,y:0};if(le(ge[0])&&le(ge[1])&&(Wi.x+=ge[0],Wi.y+=ge[1],Sg)){t.redrawHint("eles",!0);var vr=t.touchData.dragDelta;vr&&le(vr[0])&&le(vr[1])&&(Wi.x+=vr[0],Wi.y+=vr[1])}t.hoverData.draggingEles=!0,at.silentShift(Wi).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 vr=t.touchData.dragDelta=t.touchData.dragDelta||[];vr.length===0?(vr.push(ge[0]),vr.push(ge[1])):(vr[0]+=ge[0],vr[1]+=ge[1])}if(n(pr||Je,["touchmove","tapdrag","vmousemove"],T,{x:U[0],y:U[1]}),(!pr||!pr.grabbed())&&Je!=Kc&&(Kc&&Kc.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 pt=0;pt<U.length;pt++)U[pt]&&t.touchData.startPosition[pt]&&Ce&&(t.touchData.singleTouchMoved=!0);if(R&&(pr==null||pr.pannable())&&G.panningEnabled()&&G.userPanningEnabled()){var S_=i(pr,t.touchData.starts);S_&&(T.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=ga(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"),pr&&(pr.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,ne,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"))),n(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);n($e,["touchend","tapend","vmouseup","tapdragout"],T,{x:Z[0],y:Z[1]})}var rt=t.touchData.startPosition[0]-Z[0],nt=rt*rt,Qe=t.touchData.startPosition[1]-Z[1],_t=Qe*Qe,ut=nt+_t,ht=ut*ie*ie;t.touchData.singleTouchMoved||(R||U.$(":selected").unselect(["tapunselect"]),n(R,["tap","vclick"],T,{x:Z[0],y:Z[1]}),he=!1,T.timeStamp-se<=U.multiClickDebounceTime()?(ne&&clearTimeout(ne),he=!0,se=null,n(R,["dbltap","vdblclick"],T,{x:Z[0],y:Z[1]})):(ne=setTimeout(function(){he||n(R,["onetap","voneclick"],T,{x:Z[0],y:Z[1]})},U.multiClickDebounceTime()),se=T.timeStamp)),R!=null&&!t.dragData.didDrag&&R._private.selectable&&ht<t.touchTapThreshold2&&!t.pinching&&(U.selectionType()==="single"?(U.$(r).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})},Pe=function(T){return T.pointerType==="mouse"||T.pointerType===4};t.registerBinding(t.container,"pointerdown",function(te){Pe(te)||(te.preventDefault(),me(te),Ee(te),A(te))}),t.registerBinding(t.container,"pointerup",function(te){Pe(te)||(Ne(te),Ee(te),oe(te))}),t.registerBinding(t.container,"pointercancel",function(te){Pe(te)||(Ne(te),Ee(te),W(te))}),t.registerBinding(t.container,"pointermove",function(te){Pe(te)||(te.preventDefault(),De(te),Ee(te),K(te))})}};var Hr={};Hr.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,a,i,s,l,c){this.renderer.nodeShapeImpl("polygon",n,a,i,s,l,this.points)},intersectLine:function(n,a,i,s,l,c,u,d){return Ni(l,c,this.points,n,a,i/2,s/2,u)},checkPoint:function(n,a,i,s,l,c,u,d){return Rr(n,a,this.points,c,u,s,l,[0,-1],i)}}},Hr.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,s,l,c){return LT(i,s,e,r,n/2+l,a/2+l)},checkPoint:function(e,r,n,a,i,s,l,c){return Vn(e,r,a,i,s,l,n)}}},Hr.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,a,i,s,l,c,u){if(c[u]!==void 0&&c[u+"-cx"]===n&&c[u+"-cy"]===a)return c[u];c[u]=new Array(e.length/2),c[u+"-cx"]=n,c[u+"-cy"]=a;var d=i/2,f=s/2;l=l==="auto"?bh(i,s):l;for(var p=new Array(e.length/2),v=0;v<e.length/2;v++)p[v]={x:n+d*e[v*2],y:a+f*e[v*2+1]};var h,g,y,m,b=p.length;for(g=p[b-1],h=0;h<b;h++)y=p[h%b],m=p[(h+1)%b],c[u][h]=Tc(g,y,m,l),g=y,y=m;return c[u]},draw:function(n,a,i,s,l,c,u){this.renderer.nodeShapeImpl("round-polygon",n,a,i,s,l,this.points,this.getOrCreateCorners(a,i,s,l,c,u,"drawCorners"))},intersectLine:function(n,a,i,s,l,c,u,d,f){return MT(l,c,this.points,n,a,i,s,u,this.getOrCreateCorners(n,a,i,s,d,f,"corners"))},checkPoint:function(n,a,i,s,l,c,u,d,f){return IT(n,a,this.points,c,u,s,l,this.getOrCreateCorners(c,u,s,l,d,f,"corners"))}}},Hr.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Mt(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,s)},intersectLine:function(e,r,n,a,i,s,l,c){return mh(i,s,e,r,n,a,l,c)},checkPoint:function(e,r,n,a,i,s,l,c){var u=a/2,d=i/2;c=c==="auto"?Rn(a,i):c,c=Math.min(u,d,c);var f=c*2;return!!(Rr(e,r,this.points,s,l,a,i-f,[0,-1],n)||Rr(e,r,this.points,s,l,a-f,i,[0,-1],n)||Vn(e,r,f,f,s-u+c,l-d+c,n)||Vn(e,r,f,f,s+u-c,l-d+c,n)||Vn(e,r,f,f,s+u-c,l+d-c,n)||Vn(e,r,f,f,s-u+c,l+d-c,n))}}},Hr.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Xl(),points:Mt(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,null,s)},generateCutTrianglePts:function(e,r,n,a,i){var s=i==="auto"?this.cornerLength:i,l=r/2,c=e/2,u=n-c,d=n+c,f=a-l,p=a+l;return{topLeft:[u,f+s,u+s,f,u+s,f+s],topRight:[d-s,f,d,f+s,d-s,f+s],bottomRight:[d,p-s,d-s,p,d-s,p-s],bottomLeft:[u+s,p,u,p-s,u+s,p-s]}},intersectLine:function(e,r,n,a,i,s,l,c){var u=this.generateCutTrianglePts(n+2*l,a+2*l,e,r,c),d=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return Ni(i,s,d,e,r)},checkPoint:function(e,r,n,a,i,s,l,c){var u=c==="auto"?this.cornerLength:c;if(Rr(e,r,this.points,s,l,a,i-2*u,[0,-1],n)||Rr(e,r,this.points,s,l,a-2*u,i,[0,-1],n))return!0;var d=this.generateCutTrianglePts(a,i,s,l);return Ht(e,r,d.topLeft)||Ht(e,r,d.topRight)||Ht(e,r,d.bottomRight)||Ht(e,r,d.bottomLeft)}}},Hr.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Mt(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,s,l,c){var u=.15,d=.5,f=.85,p=this.generateBarrelBezierPts(n+2*l,a+2*l,e,r),v=function(y){var m=ma({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},u),b=ma({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},d),w=ma({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]]},h=[].concat(v(p.topLeft),v(p.topRight),v(p.bottomRight),v(p.bottomLeft));return Ni(i,s,h,e,r)},generateBarrelBezierPts:function(e,r,n,a){var i=r/2,s=e/2,l=n-s,c=n+s,u=a-i,d=a+i,f=Ql(e,r),p=f.heightOffset,v=f.widthOffset,h=f.ctrlPtOffsetPct*e,g={topLeft:[l,u+p,l+h,u,l+v,u],topRight:[c-v,u,c-h,u,c,u+p],bottomRight:[c,d-p,c-h,d,c-v,d],bottomLeft:[l+v,d,l+h,d,l,d-p]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g},checkPoint:function(e,r,n,a,i,s,l,c){var u=Ql(a,i),d=u.heightOffset,f=u.widthOffset;if(Rr(e,r,this.points,s,l,a,i-2*d,[0,-1],n)||Rr(e,r,this.points,s,l,a-2*f,i,[0,-1],n))return!0;for(var p=this.generateBarrelBezierPts(a,i,s,l),v=function(B,S,N){var D=N[4],P=N[2],I=N[0],_=N[5],F=N[1],O=Math.min(D,I),M=Math.max(D,I),L=Math.min(_,F),V=Math.max(_,F);if(O<=B&&B<=M&&L<=S&&S<=V){var H=FT(D,P,I),$=DT(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},h=Object.keys(p),g=0;g<h.length;g++){var y=h[g],m=p[y],b=v(e,r,m);if(b!=null){var w=m[5],C=m[3],x=m[1],E=ft(w,C,x,b);if(m.isTop&&E<=r||m.isBottom&&r<=E)return!0}}return!1}}},Hr.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Mt(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,s)},intersectLine:function(e,r,n,a,i,s,l,c){var u=e-(n/2+l),d=r-(a/2+l),f=d,p=e+(n/2+l),v=ln(i,s,e,r,u,d,p,f,!1);return v.length>0?v:mh(i,s,e,r,n,a,l,c)},checkPoint:function(e,r,n,a,i,s,l,c){c=c==="auto"?Rn(a,i):c;var u=2*c;if(Rr(e,r,this.points,s,l,a,i-u,[0,-1],n)||Rr(e,r,this.points,s,l,a-u,i,[0,-1],n))return!0;var d=a/2+2*n,f=i/2+2*n,p=[s-d,l-f,s-d,l,s+d,l,s+d,l-f];return!!(Ht(e,r,p)||Vn(e,r,u,u,s+a/2-c,l+i/2-c,n)||Vn(e,r,u,u,s-a/2+c,l+i/2-c,n))}}},Hr.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 r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}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 n=new Array(20);{var a=Zl(5,0),i=Zl(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++)n[l*4]=a[l*2],n[l*4+1]=a[l*2+1],n[l*4+2]=i[l*2],n[l*4+3]=i[l*2+1]}n=yh(n),this.generatePolygon("star",n),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 c=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",c),this.generateRoundPolygon("round-tag",c)}t.makePolygon=function(u){var d=u.join("$"),f="polygon-"+d,p;return(p=this[f])?p:e.generatePolygon(f,u)}};var Ki={};Ki.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},Ki.redraw=function(t){t=t||uh();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},Ki.beforeRender=function(t,e){if(!this.destroyed){e==null&&Ze("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(n,a){return a.priority-n.priority})}};var dv=function(e,r,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(r,n)};Ki.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function n(a){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){dv(t,!0,a);var i=Vr();t.render(t.renderOptions);var s=t.lastDrawTime=Vr();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 dv(t,!1,a);t.skipFrame=!1,Mo(n)}};Mo(r)}};var mD=function(e){this.init(e)},fv=mD,Fa=fv.prototype;Fa.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],Fa.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),n=e.cy.window();if(n){var a=n.document,i=a.head,s="__________cytoscape_stylesheet",l="__________cytoscape_container",c=a.getElementById(s)!=null;if(r.className.indexOf(l)<0&&(r.className=(r.className||"")+" "+l),!c){var u=a.createElement("style");u.id=s,u.textContent="."+l+" { position: relative; }",i.insertBefore(u,i.children[0])}var d=n.getComputedStyle(r),f=d.getPropertyValue("position");f==="static"&&Ae("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()},Fa.notify=function(t,e){var r=this,n=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&n.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},Fa.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],n=r,a=n.target;(a.off||a.removeEventListener).apply(a,n.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{}},Fa.isHeadless=function(){return!1},[Cc,cv,uv,Ma,Hr,Ki].forEach(function(t){xe(Fa,t)});var Nc=1e3/60,hv={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=Lo(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),s=function(u,d){var f=Vr(),p=a.averageRedrawTime,v=a.lastRedrawTime,h=[],g=a.cy.extent(),y=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var m=Vr(),b=m-f,w=m-d;if(v<Nc){var C=Nc-(u?p:0);if(w>=e.deqFastCost*C)break}else if(u){if(b>=e.deqCost*v||b>=e.deqAvgCost*p)break}else if(w>=e.deqNoDrawCost*Nc)break;var x=e.deq(n,y,g);if(x.length>0)for(var E=0;E<x.length;E++)h.push(x[E]);else break}h.length>0&&(e.onDeqd(n,h),!u&&e.shouldRedraw(n,h,y,g)&&i())},l=e.priority||ql;a.beforeRender(s,l(n))}}}},yD=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ao;Al(this,t),this.idsByKey=new kr,this.keyForId=new kr,this.cachesByLvl=new kr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Vl(t,[{key:"getIdsFor",value:function(r){r==null&&Ze("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(r);return a||(a=new va,n.set(r,a)),a}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),i=this.getKey(r);this.deleteIdForKey(a,n),this.addIdForKey(i,n),this.keyForId.set(n,i)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteIdForKey(a,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),i=this.getKey(r);return a!==i}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,a=this.lvls,i=n.get(r);return i||(i=new kr,n.set(r,i),a.push(r)),i}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var a=this.getKey(r),i=this.getCache(a,n);return i!=null&&this.updateKeyMappingFor(r),i}},{key:"getForCachedKey",value:function(r,n){var a=this.keyForId.get(r.id()),i=this.getCache(a,n);return i}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var a=this.getKey(r);return this.hasCache(a,n)}},{key:"setCache",value:function(r,n,a){a.key=r,this.getCachesAt(n).set(r,a)}},{key:"set",value:function(r,n,a){var i=this.getKey(r);this.setCache(i,n,a),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var a=this.getKey(r);this.deleteCache(a,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(a){return n.deleteCache(r,a)})}},{key:"invalidate",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}]),t}(),pv=25,Es=50,Ss=-4,Dc=3,bD=7.99,wD=8,CD=1024,kD=1024,xD=1024,ED=.2,SD=.8,TD=10,BD=.15,ND=.1,DD=.9,PD=.9,_D=100,OD=1,Aa={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},ID=wt({getKey:null,doesEleInvalidateKey:Ao,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:oh,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),qi=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var a=ID(r);xe(n,a),n.lookup=new yD(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},ct=qi.prototype;ct.reasons=Aa,ct.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},ct.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},ct.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Si(function(r,n){return n.reqs-r.reqs});return e},ct.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},ct.getElement=function(t,e,r,n,a){var i=this,s=this.renderer,l=s.cy.zoom(),c=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(n==null&&(n=Math.ceil(Wl(l*r))),n<Ss)n=Ss;else if(l>=bD||n>Dc)return null;var u=Math.pow(2,n),d=e.h*u,f=e.w*u,p=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,p))return null;var v=c.get(t,n);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;var h;if(d<=pv?h=pv:d<=Es?h=Es:h=Math.ceil(d/Es)*Es,d>xD||f>kD)return null;var g=i.getTextureQueue(h),y=g[g.length-2],m=function(){return i.recycleTexture(h,f)||i.addTexture(h,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===p},w=a&&a===Aa.dequeue,C=a&&a===Aa.highQuality,x=a&&a===Aa.downscale,E,k=n+1;k<=Dc;k++){var B=c.get(t,k);if(B){E=B;break}}var S=E&&E.level===n+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,h),b(S))N();else if(b(E))if(C){for(var D=E.level;D>n;D--)S=i.getElement(t,e,r,D,Aa.downscale);N()}else return i.queueElement(t,E.level-1),E;else{var P;if(!w&&!C&&!x)for(var I=n-1;I>=Ss;I--){var _=c.get(t,I);if(_){P=_;break}}if(b(P))return i.queueElement(t,n),P;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,p,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return v={x:y.usedWidth,texture:y,level:n,scale:u,width:f,height:d,scaledLabelShown:p},y.usedWidth+=Math.ceil(f+wD),y.eleCaches.push(v),c.set(t,n,v),i.checkTextureFullness(y),v},ct.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])},ct.invalidateElement=function(t){var e=this,r=e.lookup,n=[],a=r.isInvalid(t);if(a){for(var i=Ss;i<=Dc;i++){var s=r.getForCachedKey(t,i);s&&n.push(s)}var l=r.invalidate(t);if(l)for(var c=0;c<n.length;c++){var u=n[c],d=u.texture;d.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(d)}e.removeFromQueue(t)}},ct.checkTextureUtility=function(t){t.invalidatedWidth>=ED*t.width&&this.retireTexture(t)},ct.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>SD&&t.fullnessChecks>=TD?on(r,t):t.fullnessChecks++},ct.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),a=this.lookup;on(n,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)}Ul(i);var c=e.getRetiredTextureQueue(r);c.push(t)},ct.addTexture=function(t,e){var r=this,n=r.getTextureQueue(t),a={};return n.push(a),a.eleCaches=[],a.height=t,a.width=Math.max(CD,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=r.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a},ct.recycleTexture=function(t,e){for(var r=this,n=r.getTextureQueue(t),a=r.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,Ul(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),on(a,s),n.push(s),s}},ct.queueElement=function(t,e){var r=this,n=r.getElementQueue(),a=r.getElementKeyToQueue(),i=this.getKey(t),s=a[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var l={eles:t.spawn().merge(t),level:e,reqs:1,key:i};n.push(l),a[i]=l}},ct.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,s=0;s<OD&&r.size()>0;s++){var l=r.pop(),c=l.key,u=l.eles[0],d=i.hasCache(u,l.level);if(n[c]=null,d)continue;a.push(l);var f=e.getBoundingBox(u);e.getElement(u,f,t,l.level,Aa.dequeue)}return a},ct.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=this.getKey(t),i=n[a];i!=null&&(i.eles.length===1?(i.reqs=Kl,r.updateItem(i),r.pop(),n[a]=null):i.eles.unmerge(t))},ct.onDequeue=function(t){this.onDequeues.push(t)},ct.offDequeue=function(t){on(this.onDequeues,t)},ct.setupDequeueing=hv.setupDequeueing({deqRedrawThreshold:_D,deqCost:BD,deqAvgCost:ND,deqNoDrawCost:DD,deqFastCost:PD,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n<e.onDequeues.length;n++){var a=e.onDequeues[n];a(r)}},shouldRedraw:function(e,r,n,a){for(var i=0;i<r.length;i++)for(var s=r[i].eles,l=0;l<s.length;l++){var c=s[l].boundingBox();if(jl(c,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var LD=1,Ui=-4,Ts=2,MD=3.99,FD=50,AD=50,VD=.15,RD=.1,$D=.9,zD=.9,HD=1,vv=250,KD=4e3*4e3,qD=!0,gv=function(e){var r=this,n=r.renderer=e,a=n.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Vr()-2*vv,r.skipping=!1,r.eleTxrDeqs=a.collection(),r.scheduleElementRefinement=Lo(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},AD),n.beforeRender(function(s,l){l-r.lastInvalidationTime<=vv?r.skipping=!0:r.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(l,c){return c.reqs-l.reqs};r.layersQueue=new Si(i),r.setupDequeueing()},Et=gv.prototype,mv=0,UD=Math.pow(2,53)-1;Et.makeLayer=function(t,e){var r=Math.pow(2,e),n=Math.ceil(t.w*r),a=Math.ceil(t.h*r),i=this.renderer.makeOffscreenCanvas(n,a),s={id:mv=++mv%UD,bb:t,level:e,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},l=s.context,c=-s.bb.x1,u=-s.bb.y1;return l.scale(r,r),l.translate(c,u),s},Et.getLayers=function(t,e,r){var n=this,a=n.renderer,i=a.cy,s=i.zoom(),l=n.firstGet;if(n.firstGet=!1,r==null){if(r=Math.ceil(Wl(s*e)),r<Ui)r=Ui;else if(s>=MD||r>Ts)return null}n.validateLayersElesOrdering(r,t);var c=n.layersByLevel,u=Math.pow(2,r),d=c[r]=c[r]||[],f,p=n.levelIsComplete(r,t),v,h=function(){var N=function(F){if(n.validateLayersElesOrdering(F,t),n.levelIsComplete(F,t))return v=c[F],!0},D=function(F){if(!v)for(var O=r+F;Ui<=O&&O<=Ts&&!N(O);O+=F);};D(1),D(-1);for(var P=d.length-1;P>=0;P--){var I=d[P];I.invalid&&on(d,I)}};if(!p)h();else return d;var g=function(){if(!f){f=zt();for(var N=0;N<t.length;N++)ph(f,t[N].boundingBox())}return f},y=function(N){N=N||{};var D=N.after;g();var P=f.w*u*(f.h*u);if(P>KD)return null;var I=n.makeLayer(f,r);if(D!=null){var _=d.indexOf(D)+1;d.splice(_,0,I)}else(N.insert===void 0||N.insert)&&d.unshift(I);return I};if(n.skipping&&!l)return null;for(var m=null,b=t.length/LD,w=!l,C=0;C<t.length;C++){var x=t[C],E=x._private.rscratch,k=E.imgLayerCaches=E.imgLayerCaches||{},B=k[r];if(B){m=B;continue}if((!m||m.eles.length>=b||!gh(m.bb,x.boundingBox()))&&(m=y({insert:!0,after:m}),!m))return null;v||w?n.queueLayer(m,x):n.drawEleInLayer(m,x,r,e),m.eles.push(x),k[r]=m}return v||(w?null:d)},Et.getEleLevelForLayerLevel=function(t,e){return t},Et.drawEleInLayer=function(t,e,r,n){var a=this,i=this.renderer,s=t.context,l=e.boundingBox();l.w===0||l.h===0||!e.visible()||(r=a.getEleLevelForLayerLevel(r,n),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,r,qD),i.setImgSmoothing(s,!0))},Et.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var a=0,i=0;i<n.length;i++){var s=n[i];if(s.reqs>0||s.invalid)return!1;a+=s.eles.length}return a===e.length},Et.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n<r.length;n++){for(var a=r[n],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 r=this,n=gi(t[0]),a=0;a<t.length;a++)for(var i=n?null:t[a],s=n?t[a]:t[a].ele,l=s._private.rscratch,c=l.imgLayerCaches=l.imgLayerCaches||{},u=Ui;u<=Ts;u++){var d=c[u];d&&(i&&r.getEleLevelForLayerLevel(d.level)!==i.level||e(d,s,i))}},Et.haveLayers=function(){for(var t=this,e=!1,r=Ui;r<=Ts;r++){var n=t.layersByLevel[r];if(n&&n.length>0){e=!0;break}}return e},Et.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Vr(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,a,i){e.invalidateLayer(n)}))},Et.invalidateLayer=function(t){if(this.lastInvalidationTime=Vr(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];on(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var a=0;a<r.length;a++){var i=r[a]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}},Et.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(n,a,i){var s=n.replacement;if(s||(s=n.replacement=e.makeLayer(n.bb,n.level),s.replaces=n,s.eles=n.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 r=this,n=r.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++,n.updateItem(t)):(t.reqs=1,n.push(t))}},Et.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],a=0;a<HD&&r.size()!==0;){var i=r.peek();if(i.replacement){r.pop();continue}if(i.replaces&&i!==i.replaces.replacement){r.pop();continue}if(i.invalid){r.pop();continue}var s=i.elesQueue.shift();s&&(e.drawEleInLayer(i,s,i.level,t),a++),n.length===0&&n.push(!0),i.elesQueue.length===0&&(r.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return n},Et.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],n=t.replaces,a=r.indexOf(n);if(!(a<0||n.invalid)){r[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=Lo(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100),Et.setupDequeueing=hv.setupDequeueing({deqRedrawThreshold:FD,deqCost:VD,deqAvgCost:RD,deqNoDrawCost:$D,deqFastCost:zD,deq:function(e,r){return e.dequeue(r)},onDeqd:ql,shouldRedraw:oh,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var yv={},bv;function GD(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function WD(t,e,r){for(var n,a=0;a<e.length;a++){var i=e[a];a===0&&(n=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(r.x,r.y,n.x,n.y)}function wv(t,e,r){t.beginPath&&t.beginPath();for(var n=e,a=0;a<n.length;a++){var i=n[a];t.lineTo(i.x,i.y)}var s=r,l=r[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 jD(t,e,r,n,a){t.beginPath&&t.beginPath(),t.arc(r,n,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 c=i[l];t.lineTo(c.x,c.y)}t.closePath&&t.closePath()}function YD(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}yv.arrowShapeImpl=function(t){return(bv||(bv={polygon:GD,"triangle-backcurve":WD,"triangle-tee":wv,"circle-triangle":jD,"triangle-cross":wv,circle:YD}))[t]};var Br={};Br.drawElement=function(t,e,r,n,a,i){var s=this;e.isNode()?s.drawNode(t,e,r,n,a,i):s.drawEdge(t,e,r,n,a,i)},Br.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)},Br.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)},Br.drawCachedElementPortion=function(t,e,r,n,a,i,s,l){var c=this,u=r.getBoundingBox(e);if(!(u.w===0||u.h===0)){var d=r.getElement(e,u,n,a,i);if(d!=null){var f=l(c,e);if(f===0)return;var p=s(c,e),v=u.x1,h=u.y1,g=u.w,y=u.h,m,b,w,C,x;if(p!==0){var E=r.getRotationPoint(e);w=E.x,C=E.y,t.translate(w,C),t.rotate(p),x=c.getImgSmoothing(t),x||c.setImgSmoothing(t,!0);var k=r.getRotationOffset(e);m=k.x,b=k.y}else m=v,b=h;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),p!==0&&(t.rotate(-p),t.translate(-w,-C),x||c.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var ZD=function(){return 0},XD=function(e,r){return e.getTextAngle(r,null)},QD=function(e,r){return e.getTextAngle(r,"source")},JD=function(e,r){return e.getTextAngle(r,"target")},e3=function(e,r){return r.effectiveOpacity()},Pc=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};Br.drawCachedElement=function(t,e,r,n,a,i){var s=this,l=s.data,c=l.eleTxrCache,u=l.lblTxrCache,d=l.slbTxrCache,f=l.tlbTxrCache,p=e.boundingBox(),v=i===!0?c.reasons.highQuality:null;if(!(p.w===0||p.h===0||!e.visible())&&(!n||jl(p,n))){var h=e.isEdge(),g=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,c,r,a,v,ZD,e3),(!h||!g)&&s.drawCachedElementPortion(t,e,u,r,a,v,XD,Pc),h&&!g&&(s.drawCachedElementPortion(t,e,d,r,a,v,QD,Pc),s.drawCachedElementPortion(t,e,f,r,a,v,JD,Pc)),s.drawElementOverlay(t,e)}},Br.drawElements=function(t,e){for(var r=this,n=0;n<e.length;n++){var a=e[n];r.drawElement(t,a)}},Br.drawCachedElements=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var s=e[i];a.drawCachedElement(t,s,r,n)}},Br.drawCachedNodes=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var s=e[i];s.isNode()&&a.drawCachedElement(t,s,r,n)}},Br.drawLayeredElements=function(t,e,r,n){var a=this,i=a.data.lyrTxrCache.getLayers(e,r);if(i)for(var s=0;s<i.length;s++){var l=i[s],c=l.bb;c.w===0||c.h===0||t.drawImage(l.canvas,c.x1,c.y1,c.w,c.h)}else a.drawCachedElements(t,e,r,n)};var Kr={};Kr.drawEdge=function(t,e,r){var n=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 c;r&&(c=r,t.translate(-c.x1,-c.y1));var u=i?e.pstyle("opacity").value:1,d=i?e.pstyle("line-opacity").value:1,f=e.pstyle("curve-style").value,p=e.pstyle("line-style").value,v=e.pstyle("width").pfValue,h=e.pstyle("line-cap").value,g=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,m=u*d,b=u*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=h,s.eleStrokeStyle(t,e,F),s.drawEdgePath(e,t,l.allpts,p),t.lineCap="butt")},C=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;if(t.lineWidth=v+g,t.lineCap=h,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,p),t.lineCap="butt")},x=function(){a&&s.drawEdgeOverlay(t,e)},E=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,n)};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,P=e.pstyle("ghost-opacity").value,I=m*P;t.translate(N,D),w(I),k(I),t.translate(-N,-D)}else C();E(),w(),k(),x(),B(),r&&t.translate(c.x1,c.y1)}};var Cv=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var a=n.pstyle("".concat(e,"-opacity")).value;if(a!==0){var i=this,s=i.usePaths(),l=n._private.rscratch,c=n.pstyle("".concat(e,"-padding")).pfValue,u=2*c,d=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,l.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,d[0],d[1],d[2],a),i.drawEdgePath(n,r,l.allpts,"solid")}}}};Kr.drawEdgeOverlay=Cv("overlay"),Kr.drawEdgeUnderlay=Cv("underlay"),Kr.drawEdgePath=function(t,e,r,n){var a=t._private.rscratch,i=e,s,l=!1,c=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,d=t.pstyle("line-dash-offset").pfValue;if(c){var f=r.join("$"),p=a.pathCacheKey&&a.pathCacheKey===f;p?(s=e=a.pathCache,l=!0):(s=e=new Path2D,a.pathCacheKey=f,a.pathCache=s)}if(i.setLineDash)switch(n){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=d;break;case"solid":i.setLineDash([]);break}if(!l&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var v=2;v+3<r.length;v+=4)e.quadraticCurveTo(r[v],r[v+1],r[v+2],r[v+3]);break;case"straight":case"haystack":for(var h=2;h+1<r.length;h+=2)e.lineTo(r[h],r[h+1]);break;case"segments":if(a.isRound){var g=$f(a.roundCorners),y;try{for(g.s();!(y=g.n()).done;){var m=y.value;rv(e,m)}}catch(w){g.e(w)}finally{g.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var b=2;b+1<r.length;b+=2)e.lineTo(r[b],r[b+1]);break}e=i,c?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])},Kr.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var n=t.pstyle("width").pfValue,a=0;a+1<r.length;a+=2){var i=[r[a+2]-r[a],r[a+3]-r[a+1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),l=[i[1]/s,-i[0]/s],c=[l[0]*n/2,l[1]*n/2];e.beginPath(),e.moveTo(r[a]-c[0],r[a+1]-c[1]),e.lineTo(r[a]+c[0],r[a+1]+c[1]),e.lineTo(r[a+2],r[a+3]),e.closePath(),e.fill()}},Kr.drawArrowheads=function(t,e,r){var n=e._private.rscratch,a=n.edgeType==="haystack";a||this.drawArrowhead(t,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,r),this.drawArrowhead(t,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,r),a||this.drawArrowhead(t,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,r)},Kr.drawArrowhead=function(t,e,r,n,a,i,s){if(!(isNaN(n)||n==null||isNaN(a)||a==null||isNaN(i)||i==null)){var l=this,c=e.pstyle(r+"-arrow-shape").value;if(c!=="none"){var u=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",d=e.pstyle(r+"-arrow-fill").value,f=e.pstyle("width").pfValue,p=e.pstyle(r+"-arrow-width"),v=p.value==="match-line"?f:p.pfValue;p.units==="%"&&(v*=f);var h=e.pstyle("opacity").value;s===void 0&&(s=h);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,u,f,c,v,n,a,i),t.globalCompositeOperation=g);var y=e.pstyle(r+"-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,c,v,n,a,i)}}},Kr.drawArrowShape=function(t,e,r,n,a,i,s,l,c){var u=this,d=this.usePaths()&&a!=="triangle-cross",f=!1,p,v=e,h={x:s,y:l},g=t.pstyle("arrow-scale").value,y=this.getArrowWidth(n,g),m=u.arrowShapes[a];if(d){var b=u.arrowPathCache=u.arrowPathCache||[],w=Mn(a),C=b[w];C!=null?(p=e=C,f=!0):(p=e=new Path2D,b[w]=p)}f||(e.beginPath&&e.beginPath(),d?m.draw(e,1,0,{x:0,y:0},1):m.draw(e,y,c,h,n),e.closePath&&e.closePath()),e=v,d&&(e.translate(s,l),e.rotate(c),e.scale(y,y)),(r==="filled"||r==="both")&&(d?e.fill(p):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=i/(d?y:1),e.lineJoin="miter",d?e.stroke(p):e.stroke()),d&&(e.scale(1/y,1/y),e.rotate(-c),e.translate(-s,-l))};var _c={};_c.safeDrawImage=function(t,e,r,n,a,i,s,l,c,u){if(!(a<=0||i<=0||c<=0||u<=0))try{t.drawImage(e,r,n,a,i,s,l,c,u)}catch(d){Ae(d)}},_c.drawInscribedImage=function(t,e,r,n,a){var i=this,s=r.position(),l=s.x,c=s.y,u=r.cy().style(),d=u.getIndexedStyle.bind(u),f=d(r,"background-fit","value",n),p=d(r,"background-repeat","value",n),v=r.width(),h=r.height(),g=r.padding()*2,y=v+(d(r,"background-width-relative-to","value",n)==="inner"?0:g),m=h+(d(r,"background-height-relative-to","value",n)==="inner"?0:g),b=r._private.rscratch,w=d(r,"background-clip","value",n),C=w==="node",x=d(r,"background-image-opacity","value",n)*a,E=d(r,"background-image-smoothing","value",n),k=r.pstyle("corner-radius").value;k!=="auto"&&(k=r.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(r,"background-width","value",n)!=="auto"&&(d(r,"background-width","units",n)==="%"?N=d(r,"background-width","pfValue",n)*y:N=d(r,"background-width","pfValue",n)),d(r,"background-height","value",n)!=="auto"&&(d(r,"background-height","units",n)==="%"?D=d(r,"background-height","pfValue",n)*m:D=d(r,"background-height","pfValue",n)),!(N===0||D===0)){if(f==="contain"){var P=Math.min(y/N,m/D);N*=P,D*=P}else if(f==="cover"){var P=Math.max(y/N,m/D);N*=P,D*=P}var I=l-y/2,_=d(r,"background-position-x","units",n),F=d(r,"background-position-x","pfValue",n);_==="%"?I+=(y-N)*F:I+=F;var O=d(r,"background-offset-x","units",n),M=d(r,"background-offset-x","pfValue",n);O==="%"?I+=(y-N)*M:I+=M;var L=c-m/2,V=d(r,"background-position-y","units",n),H=d(r,"background-position-y","pfValue",n);V==="%"?L+=(m-D)*H:L+=H;var $=d(r,"background-offset-y","units",n),z=d(r,"background-offset-y","pfValue",n);$==="%"?L+=(m-D)*z:L+=z,b.pathCache&&(I-=l,L-=c,l=0,c=0);var j=t.globalAlpha;t.globalAlpha=x;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),p==="no-repeat")C&&(t.save(),b.pathCache?t.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,l,c,y,m,k,b),t.clip())),i.safeDrawImage(t,e,0,0,B,S,I,L,N,D),C&&t.restore();else{var X=t.createPattern(e,p);t.fillStyle=X,i.nodeShapes[i.getNodeShape(r)].draw(t,l,c,y,m,k,b),t.translate(I,L),t.fill(),t.translate(-I,-L)}t.globalAlpha=j,J&&i.setImgSmoothing(t,ee)}};var Wn={};Wn.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(Wl(r*n));e=Math.pow(2,a)}var i=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;return!(i<s)},Wn.drawElementText=function(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var l=e.pstyle("label");if(!l||!l.value)return;var c=s.getLabelJustification(e);t.textAlign=c,t.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(u||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var v=!r,h;r&&(h=r,t.translate(-h.x1,-h.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),r&&t.translate(h.x1,h.y1)},Wn.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e},Wn.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=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=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,c=e.pstyle("text-outline-opacity").value*l,u=e.pstyle("color").value,d=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+a+" "+i,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],l),this.colorStrokeStyle(t,d[0],d[1],d[2],c)};function Oc(t,e,r,n,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,r),t.lineTo(e+n-i,r),t.quadraticCurveTo(e+n,r,e+n,r+i),t.lineTo(e+n,r+a-i),t.quadraticCurveTo(e+n,r+a,e+n-i,r+a),t.lineTo(e+i,r+a),t.quadraticCurveTo(e,r+a,e,r+a-i),t.lineTo(e,r+i),t.quadraticCurveTo(e,r,e+i,r),t.closePath(),s?t.stroke():t.fill()}Wn.getTextAngle=function(t,e){var r,n=t._private,a=n.rscratch,i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),l=ur(a,"labelAngle",e);return s.strValue==="autorotate"?r=t.isEdge()?l:0:s.strValue==="none"?r=0:r=s.pfValue,r},Wn.drawText=function(t,e,r){var n=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))){r==="main"&&(r=null);var c=ur(s,"labelX",r),u=ur(s,"labelY",r),d,f,p=this.getLabelText(e,r);if(p!=null&&p!==""&&!isNaN(c)&&!isNaN(u)){this.setupTextStyle(t,e,a);var v=r?r+"-":"",h=ur(s,"labelWidth",r),g=ur(s,"labelHeight",r),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"),c+=y,u+=m;var x;switch(n?x=this.getTextAngle(e,r):x=0,x!==0&&(d=c,f=u,t.translate(d,f),t.rotate(x),c=0,u=0),C){case"top":break;case"center":u+=g/2;break;case"bottom":u+=g;break}var E=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,P=2;if(E>0||B>0&&k>0){var I=c-S;switch(w){case"left":I-=h;break;case"center":I-=h/2;break}var _=u-g-S,F=h+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?Oc(t,I,_,F,O,P):t.fillRect(I,_,F,O),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?Oc(t,I,_,F,O,P,"stroke"):t.strokeRect(I,_,F,O),z==="double"){var j=B/2;D?Oc(t,I+j,_+j,F-j*2,O-j*2,P,"stroke"):t.strokeRect(I+j,_+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=ur(s,"labelWrapCachedLines",r),X=ur(s,"labelLineHeight",r),re=h/2,Y=this.getLabelJustification(e);switch(Y==="auto"||(w==="left"?Y==="left"?c+=-h:Y==="center"&&(c+=-re):w==="center"?Y==="left"?c+=-re:Y==="right"&&(c+=re):w==="right"&&(Y==="center"?c+=re:Y==="right"&&(c+=h))),C){case"top":u-=(J.length-1)*X;break;case"center":case"bottom":u-=(J.length-1)*X;break}for(var A=0;A<J.length;A++)ee>0&&t.strokeText(J[A],c,u),t.fillText(J[A],c,u),u+=X}else ee>0&&t.strokeText(p,c,u),t.fillText(p,c,u);x!==0&&(t.rotate(-x),t.translate(-d,-f))}}};var Va={};Va.drawNode=function(t,e,r){var n=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,c,u=e._private,d=u.rscratch,f=e.position();if(!(!le(f.x)||!le(f.y))&&!(i&&!e.visible())){var p=i?e.effectiveOpacity():1,v=s.usePaths(),h,g=!1,y=e.padding();l=e.width()+2*y,c=e.height()+2*y;var m;r&&(m=r,t.translate(-m.x1,-m.y1));for(var b=e.pstyle("background-image"),w=b.value,C=new Array(w.length),x=new Array(w.length),E=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);E++,x[k]=s.getCachedImage(B,N,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var D=e.pstyle("background-blacken").value,P=e.pstyle("border-width").pfValue,I=e.pstyle("background-opacity").value*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*p,z=e.pstyle("outline-width").pfValue,j=e.pstyle("outline-color").value,ee=e.pstyle("outline-style").value,J=e.pstyle("outline-opacity").value*p,X=e.pstyle("outline-offset").value,re=e.pstyle("corner-radius").value;re!=="auto"&&(re=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,_[0],_[1],_[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=ah(ae==="polygon"?ae+","+we.join(","):ae,""+Z,""+ie,""+re),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 ne=W(l,c,oe,he);h=ne.path,g=ne.cacheHit}var se=function(){if(!g){var ie=f;v&&(ie={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(h||t,ie.x,ie.y,l,c,re,d)}v?t.fill(h):t.fill()},ue=function(){for(var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ae=u.backgrounding,we=0,Ce=0;Ce<x.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]&&x[Ce].complete&&!x[Ce].error&&(we++,s.drawInscribedImage(t,x[Ce],e,Ce,ie))}u.backgrounding=we!==E,ae!==u.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]:p;s.hasPie(e)&&(s.drawPie(t,e,Z),ie&&(v||s.nodeShapes[s.getNodeShape(e)].draw(t,f.x,f.y,l,c,re,d)))},de=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,Z=(D>0?D:-D)*ie,ae=D>0?0:255;D!==0&&(s.colorFillStyle(t,ae,ae,ae,Z),v?t.fill(h):t.fill())},me=function(){if(P>0){if(t.lineWidth=P,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(h):t.clip();else{var ie=new Path2D;ie.rect(-l/2-P,-c/2-P,l+2*P,c+2*P),ie.addPath(h),t.clip(ie,"evenodd")}v?t.stroke(h):t.stroke(),t.restore()}else v?t.stroke(h):t.stroke();if(F==="double"){t.lineWidth=P/3;var Z=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(h):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=P;L==="inside"&&(ae=0),L==="outside"&&(ae*=2);var we=(l+ae+(z+X))/l,Ce=(c+ae+(z+X))/c,ge=l*we,Se=c*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,rt=0,nt=0;Z==="round-diamond"?$e=(ae+X+z)*1.4:Z==="round-heptagon"?($e=(ae+X+z)*1.075,nt=-(ae/2+X+z)/35):Z==="round-hexagon"?$e=(ae+X+z)*1.12:Z==="round-pentagon"?($e=(ae+X+z)*1.13,nt=-(ae/2+X+z)/15):Z==="round-tag"?($e=(ae+X+z)*1.12,rt=(ae/2+z+X)*.07):Z==="round-triangle"&&($e=(ae+X+z)*(Math.PI/2),nt=-(ae+X/2+z)/Math.PI),$e!==0&&(we=(l+$e)/l,ge=l*we,["round-hexagon","round-tag"].includes(Z)||(Ce=(c+$e)/c,Se=c*Ce)),re=re==="auto"?bh(ge,Se):re;for(var Qe=ge/2,_t=Se/2,ut=re+(ae+z+X)/2,ht=new Array(ve.length/2),Wt=new Array(ve.length/2),Ot=0;Ot<ve.length/2;Ot++)ht[Ot]={x:ie.x+rt+Qe*ve[Ot*2],y:ie.y+nt+_t*ve[Ot*2+1]};var It,tr,hr,Kt,Je=ht.length;for(tr=ht[Je-1],It=0;It<Je;It++)hr=ht[It%Je],Kt=ht[(It+1)%Je],Wt[It]=Tc(tr,hr,Kt,ut),tr=hr,hr=Kt;s.drawRoundPolygonPath(ye||t,ie.x+rt,ie.y+nt,l*we,c*Ce,ve,Wt)}else if(["roundrectangle","round-rectangle"].includes(Z))re=re==="auto"?Rn(ge,Se):re,s.drawRoundRectanglePath(ye||t,ie.x,ie.y,ge,Se,re+(ae+z+X)/2);else if(["cutrectangle","cut-rectangle"].includes(Z))re=re==="auto"?Xl():re,s.drawCutRectanglePath(ye||t,ie.x,ie.y,ge,Se,null,re+(ae+z+X)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(Z))re=re==="auto"?Rn(ge,Se):re,s.drawBottomRoundRectanglePath(ye||t,ie.x,ie.y,ge,Se,re+(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=Ko(qo(ve,at)),s.drawPolygonPath(ye||t,ie.x,ie.y,l,c,ve)}else{var pt=(ae+z+X)/l;ve=Ko(qo(ve,-pt)),s.drawPolygonPath(ye||t,ie.x,ie.y,l,c,ve)}if(v?t.stroke(ye):t.stroke(),ee==="double"){t.lineWidth=ae/3;var mn=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(ye):t.stroke(),t.globalCompositeOperation=mn}t.setLineDash&&t.setLineDash([])}},De=function(){a&&s.drawNodeOverlay(t,e,f,l,c)},Ee=function(){a&&s.drawNodeUnderlay(t,e,f,l,c)},Pe=function(){s.drawElementText(t,e,null,n)},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*p;t.translate(T,R),K(),Ne(),Y(Q*I),se(),ue(G,!0),A(Q*$),me(),pe(D!==0||P!==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(p,!0),A(),me(),pe(D!==0||P!==0),ue(p,!1),de(),v&&t.translate(-f.x,-f.y),Pe(),De(),r&&t.translate(m.x1,m.y1)}};var kv=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n,a,i,s){var l=this;if(n.visible()){var c=n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-opacity")).value,d=n.pstyle("".concat(e,"-color")).value,f=n.pstyle("".concat(e,"-shape")).value,p=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(a=a||n.position(),i==null||s==null){var v=n.padding();i=n.width()+2*v,s=n.height()+2*v}l.colorFillStyle(r,d[0],d[1],d[2],u),l.nodeShapes[f].draw(r,a.x,a.y,i+c*2,s+c*2,p),r.fill()}}}};Va.drawNodeOverlay=kv("overlay"),Va.drawNodeUnderlay=kv("underlay"),Va.hasPie=function(t){return t=t[0],t._private.hasPie},Va.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),s=n.x,l=n.y,c=e.width(),u=e.height(),d=Math.min(c,u)/2,f=0,p=this.usePaths();p&&(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 h=e.pstyle("pie-"+v+"-background-size").value,g=e.pstyle("pie-"+v+"-background-color").value,y=e.pstyle("pie-"+v+"-background-opacity").value*r,m=h/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;h===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={},t3=100;Gt.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r},Gt.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,a=0;a<e.length;a++)if(n=e[a],n.context===t){r=!1;break}return r&&(n={context:t},e.push(n)),n},Gt.createGradientStyleFor=function(t,e,r,n,a){var i,s=this.usePaths(),l=r.pstyle(e+"-gradient-stop-colors").value,c=r.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(r.isEdge()){var u=r.sourceEndpoint(),d=r.targetEndpoint(),f=r.midpoint(),p=Fn(u,f),v=Fn(d,f);i=t.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(p,v))}else{var h=s?{x:0,y:0}:r.position(),g=r.paddedWidth(),y=r.paddedHeight();i=t.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(g,y))}else if(r.isEdge()){var m=r.sourceEndpoint(),b=r.targetEndpoint();i=t.createLinearGradient(m.x,m.y,b.x,b.y)}else{var w=s?{x:0,y:0}:r.position(),C=r.paddedWidth(),x=r.paddedHeight(),E=C/2,k=x/2,B=r.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+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-k,w.x+E,w.y+k);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(w.x-E,w.y+k,w.x+E,w.y-k);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(w.x+E,w.y-k,w.x-E,w.y+k);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(w.x+E,w.y+k,w.x-E,w.y-k);break}}if(!i)return null;for(var S=c.length===l.length,N=l.length,D=0;D<N;D++)i.addColorStop(S?c[D]:D/(N-1),"rgba("+l[D][0]+","+l[D][1]+","+l[D][2]+","+a+")");return i},Gt.gradientFillStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"background",e,r,n);if(!a)return null;t.fillStyle=a},Gt.colorFillStyle=function(t,e,r,n,a){t.fillStyle="rgba("+e+","+r+","+n+","+a+")"},Gt.eleFillStyle=function(t,e,r){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(t,e,n,r);else{var a=e.pstyle("background-color").value;this.colorFillStyle(t,a[0],a[1],a[2],r)}},Gt.gradientStrokeStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"line",e,r,n);if(!a)return null;t.strokeStyle=a},Gt.colorStrokeStyle=function(t,e,r,n,a){t.strokeStyle="rgba("+e+","+r+","+n+","+a+")"},Gt.eleStrokeStyle=function(t,e,r){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(t,e,n,r);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(t,a[0],a[1],a[2],r)}},Gt.matchCanvasSize=function(t){var e=this,r=e.data,n=e.findContainerClientCoords(),a=n[2],i=n[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 c=a*s,u=i*s,d;if(!(c===e.canvasWidth&&u===e.canvasHeight)){e.fontCaches=null;var f=r.canvasContainer;f.style.width=a+"px",f.style.height=i+"px";for(var p=0;p<e.CANVAS_LAYERS;p++)d=r.canvases[p],d.width=c,d.height=u,d.style.width=a+"px",d.style.height=i+"px";for(var p=0;p<e.BUFFER_COUNT;p++)d=r.bufferCanvases[p],d.width=c,d.height=u,d.style.width=a+"px",d.style.height=i+"px";e.textureMult=1,s<=1&&(d=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,d.width=c*e.textureMult,d.height=u*e.textureMult),e.canvasWidth=c,e.canvasHeight=u}},Gt.renderTo=function(t,e,r,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:n})},Gt.render=function(t){t=t||uh();var e=t.forcedContext,r=t.drawAllLayers,n=t.drawOnlyNodeLayer,a=t.forcedZoom,i=t.forcedPan,s=this,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,c=s.cy,u=s.data,d=u.canvasNeedsRedraw,f=s.textureOnViewport&&!e&&(s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming),p=t.motionBlur!==void 0?t.motionBlur:s.motionBlur,v=s.motionBlurPxRatio,h=c.hasCompoundNodes(),g=s.hoverData.draggingEles,y=!!(s.hoverData.selecting||s.touchData.selecting);p=p&&!e&&s.motionBlurEnabled&&!y;var m=p;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),p&&(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=c.style(),w=c.zoom(),C=a!==void 0?a:w,x=c.pan(),E={x:x.x,y:x.y},k={zoom:w,pan:{x:x.x,y:x.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&&!h)&&(s.motionBlurPxRatio=1),i&&(E=i),C*=l,E.x*=l,E.y*=l;var N=s.getCachedZSortedEles();function D(ne,se,ue,pe,de){var me=ne.globalCompositeOperation;ne.globalCompositeOperation="destination-out",s.colorFillStyle(ne,255,255,255,s.motionBlurTransparency),ne.fillRect(se,ue,pe,de),ne.globalCompositeOperation=me}function P(ne,se){var ue,pe,de,me;!s.clearingMotionBlur&&(ne===u.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]||ne===u.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG])?(ue={x:x.x*v,y:x.y*v},pe=w*v,de=s.canvasWidth*v,me=s.canvasHeight*v):(ue=E,pe=C,de=s.canvasWidth,me=s.canvasHeight),ne.setTransform(1,0,0,1,0,0),se==="motionBlur"?D(ne,0,0,de,me):!e&&(se===void 0||se)&&ne.clearRect(0,0,de,me),r||(ne.translate(ue.x,ue.y),ne.scale(pe,pe)),i&&ne.translate(i.x,i.y),a&&ne.scale(a,a)}if(f||(s.textureDrawLastFrame=!1),f){if(s.textureDrawLastFrame=!0,!s.textureCache){s.textureCache={},s.textureCache.bb=c.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 k=s.textureCache.viewport={zoom:c.zoom(),pan:c.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 _=u.contexts[s.NODE],F=s.textureCache.texture,k=s.textureCache.viewport;_.setTransform(1,0,0,1,0,0),p?D(_,0,0,k.width,k.height):_.clearRect(0,0,k.width,k.height);var O=b.core("outside-texture-bg-color").value,M=b.core("outside-texture-bg-opacity").value;s.colorFillStyle(_,O[0],O[1],O[2],M),_.fillRect(0,0,k.width,k.height);var w=c.zoom();P(_,!1),_.clearRect(k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l),_.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=c.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]&&p&&!s.clearedForMotionBlur[s.NODE]||s.clearingMotionBlur,$[s.NODE]&&(s.clearedForMotionBlur[s.NODE]=!0),$[s.DRAG]=!d[s.DRAG]&&p&&!s.clearedForMotionBlur[s.DRAG]||s.clearingMotionBlur,$[s.DRAG]&&(s.clearedForMotionBlur[s.DRAG]=!0),d[s.NODE]||r||n||$[s.NODE]){var z=p&&!$[s.NODE]&&v!==1,_=e||(z?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]:u.contexts[s.NODE]),j=p&&!z?"motionBlur":void 0;P(_,j),H?s.drawCachedNodes(_,N.nondrag,l,L):s.drawLayeredElements(_,N.nondrag,l,L),s.debug&&s.drawDebugPoints(_,N.nondrag),!r&&!p&&(d[s.NODE]=!1)}if(!n&&(d[s.DRAG]||r||$[s.DRAG])){var z=p&&!$[s.DRAG]&&v!==1,_=e||(z?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG]:u.contexts[s.DRAG]);P(_,p&&!z?"motionBlur":void 0),H?s.drawCachedNodes(_,N.drag,l,L):s.drawCachedElements(_,N.drag,l,L),s.debug&&s.drawDebugPoints(_,N.drag),!r&&!p&&(d[s.DRAG]=!1)}if(s.showFps||!n&&d[s.SELECT_BOX]&&!r){var _=e||u.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;_.lineWidth=ee,_.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+")",_.fillRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]),ee>0&&(_.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+")",_.strokeRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]))}if(u.bgActivePosistion&&!s.hoverData.selecting){var w=s.cy.zoom(),J=u.bgActivePosistion;_.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+")",_.beginPath(),_.arc(J.x,J.y,b.core("active-bg-size").pfValue/w,0,2*Math.PI),_.fill()}var X=s.lastRedrawTime;if(s.showFps&&X){X=Math.round(X);var re=Math.round(1e3/X);_.setTransform(1,0,0,1,0,0),_.fillStyle="rgba(255, 0, 0, 0.75)",_.strokeStyle="rgba(255, 0, 0, 0.75)",_.lineWidth=1,_.fillText("1 frame = "+X+" ms = "+re+" fps",0,20);var Y=60;_.strokeRect(0,30,250,20),_.fillRect(0,30,250*Math.min(re/Y,1),20)}r||(d[s.SELECT_BOX]=!1)}if(p&&v!==1){var A=u.contexts[s.NODE],K=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_NODE],W=u.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),p&&(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()},t3)),e||c.emit("render")};var gn={};gn.drawPolygonPath=function(t,e,r,n,a,i){var s=n/2,l=a/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*i[0],r+l*i[1]);for(var c=1;c<i.length/2;c++)t.lineTo(e+s*i[c*2],r+l*i[c*2+1]);t.closePath()},gn.drawRoundPolygonPath=function(t,e,r,n,a,i,s){s.forEach(function(l){return rv(t,l)}),t.closePath()},gn.drawRoundRectanglePath=function(t,e,r,n,a,i){var s=n/2,l=a/2,c=i==="auto"?Rn(n,a):Math.min(i,l,s);t.beginPath&&t.beginPath(),t.moveTo(e,r-l),t.arcTo(e+s,r-l,e+s,r,c),t.arcTo(e+s,r+l,e,r+l,c),t.arcTo(e-s,r+l,e-s,r,c),t.arcTo(e-s,r-l,e,r-l,c),t.lineTo(e,r-l),t.closePath()},gn.drawBottomRoundRectanglePath=function(t,e,r,n,a,i){var s=n/2,l=a/2,c=i==="auto"?Rn(n,a):i;t.beginPath&&t.beginPath(),t.moveTo(e,r-l),t.lineTo(e+s,r-l),t.lineTo(e+s,r),t.arcTo(e+s,r+l,e,r+l,c),t.arcTo(e-s,r+l,e-s,r,c),t.lineTo(e-s,r-l),t.lineTo(e,r-l),t.closePath()},gn.drawCutRectanglePath=function(t,e,r,n,a,i,s){var l=n/2,c=a/2,u=s==="auto"?Xl():s;t.beginPath&&t.beginPath(),t.moveTo(e-l+u,r-c),t.lineTo(e+l-u,r-c),t.lineTo(e+l,r-c+u),t.lineTo(e+l,r+c-u),t.lineTo(e+l-u,r+c),t.lineTo(e-l+u,r+c),t.lineTo(e-l,r+c-u),t.lineTo(e-l,r-c+u),t.closePath()},gn.drawBarrelPath=function(t,e,r,n,a){var i=n/2,s=a/2,l=e-i,c=e+i,u=r-s,d=r+s,f=Ql(n,a),p=f.widthOffset,v=f.heightOffset,h=f.ctrlPtOffsetPct*p;t.beginPath&&t.beginPath(),t.moveTo(l,u+v),t.lineTo(l,d-v),t.quadraticCurveTo(l+h,d,l+p,d),t.lineTo(c-p,d),t.quadraticCurveTo(c-h,d,c,d-v),t.lineTo(c,u+v),t.quadraticCurveTo(c-h,u,c-p,u),t.lineTo(l+p,u),t.quadraticCurveTo(l+h,u,l,u+v),t.closePath()};for(var xv=Math.sin(0),Ev=Math.cos(0),Ic={},Lc={},Sv=Math.PI/40,Ra=0*Math.PI;Ra<2*Math.PI;Ra+=Sv)Ic[Ra]=Math.sin(Ra),Lc[Ra]=Math.cos(Ra);gn.drawEllipsePath=function(t,e,r,n,a){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,n/2,a/2,0,0,2*Math.PI);else for(var i,s,l=n/2,c=a/2,u=0*Math.PI;u<2*Math.PI;u+=Sv)i=e-l*Ic[u]*xv+l*Lc[u]*Ev,s=r+c*Lc[u]*xv+c*Ic[u]*Ev,u===0?t.moveTo(i,s):t.lineTo(i,s);t.closePath()};var Gi={};Gi.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]},Gi.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements(),n=r.boundingBox(),a=this.findContainerClientCoords(),i=t.full?Math.ceil(n.w):a[2],s=t.full?Math.ceil(n.h):a[3],l=le(t.maxWidth)||le(t.maxHeight),c=this.getPixelRatio(),u=1;if(t.scale!==void 0)i*=t.scale,s*=t.scale,u=t.scale;else if(l){var d=1/0,f=1/0;le(t.maxWidth)&&(d=u*t.maxWidth/i),le(t.maxHeight)&&(f=u*t.maxHeight/s),u=Math.min(d,f),i*=u,s*=u}l||(i*=c,s*=c,u*=c);var p=document.createElement("canvas");p.width=i,p.height=s,p.style.width=i+"px",p.style.height=s+"px";var v=p.getContext("2d");if(i>0&&s>0){v.clearRect(0,0,i,s),v.globalCompositeOperation="source-over";var h=this.getCachedZSortedEles();if(t.full)v.translate(-n.x1*u,-n.y1*u),v.scale(u,u),this.drawElements(v,h),v.scale(1/u,1/u),v.translate(n.x1*u,n.y1*u);else{var g=e.pan(),y={x:g.x*u,y:g.y*u};u*=e.zoom(),v.translate(y.x,y.y),v.scale(u,u),this.drawElements(v,h),v.scale(1/u,1/u),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 p};function r3(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return new Blob([n],{type:e})}function Tv(t){var e=t.indexOf(",");return t.substr(e+1)}function Bv(t,e,r){var n=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new ka(function(a,i){try{e.toBlob(function(s){s!=null?a(s):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(s){i(s)}});case"blob":return r3(Tv(n()),r);case"base64":return Tv(n());case"base64uri":default:return n()}}Gi.png=function(t){return Bv(t,this.bufferCanvasImage(t),"image/png")},Gi.jpg=function(t){return Bv(t,this.bufferCanvasImage(t),"image/jpeg")};var Nv={};Nv.nodeShapeImpl=function(t,e,r,n,a,i,s,l){switch(t){case"ellipse":return this.drawEllipsePath(e,r,n,a,i);case"polygon":return this.drawPolygonPath(e,r,n,a,i,s);case"round-polygon":return this.drawRoundPolygonPath(e,r,n,a,i,s,l);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,n,a,i,l);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,n,a,i,s,l);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,n,a,i,l);case"barrel":return this.drawBarrelPath(e,r,n,a,i)}};var n3=Dv,Me=Dv.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 Dv(t){var e=this,r=e.cy.window(),n=r.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=n.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 c={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};qE()&&(c["-ms-touch-action"]="none",c["touch-action"]="none");for(var u=0;u<Me.CANVAS_LAYERS;u++){var d=e.data.canvases[u]=n.createElement("canvas");e.data.contexts[u]=d.getContext("2d"),Object.keys(c).forEach(function(Y){d.style[Y]=c[Y]}),d.style.position="absolute",d.setAttribute("data-id","layer"+u),d.style.zIndex=String(Me.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(d),e.data.canvasNeedsRedraw[u]=!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 u=0;u<Me.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=n.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var f=zt(),p=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}},h=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)},x=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)},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},P=function(A){return p(k(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}},_=function(A,K,W){var oe=A[0]._private.rscratch;return{x:oe[K],y:oe[W]}},F=function(A){return I("",_(A,"labelX","labelY"),A)},O=function(A){return I("source",_(A,"sourceLabelX","sourceLabelY"),A)},M=function(A){return I("target",_(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 qi(e,{getKey:g,doesEleInvalidateKey:h,drawElement:w,getBoundingBox:k,getRotationPoint:P,getRotationOffset:L,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),j=e.data.lblTxrCache=new qi(e,{getKey:y,drawElement:C,getBoundingBox:B,getRotationPoint:F,getRotationOffset:$,isVisible:D}),ee=e.data.slbTxrCache=new qi(e,{getKey:m,drawElement:x,getBoundingBox:S,getRotationPoint:O,getRotationOffset:V,isVisible:D}),J=e.data.tlbTxrCache=new qi(e,{getKey:b,drawElement:E,getBoundingBox:N,getRotationPoint:M,getRotationOffset:H,isVisible:D}),X=e.data.lyrTxrCache=new gv(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 re=function(A){for(var K=0;K<A.length;K++)X.enqueueElementRefinement(A[K].ele)};z.onDequeue(re),j.onDequeue(re),ee.onDequeue(re),J.onDequeue(re)}Me.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[Me.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[Me.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[Me.SELECT_BOX]=e;break}};var a3=typeof Path2D<"u";Me.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t},Me.usePaths=function(){return a3&&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 r;if((typeof OffscreenCanvas>"u"?"undefined":ot(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),a=n.document;r=a.createElement("canvas"),r.width=t,r.height=e}return r},[yv,Br,Kr,_c,Wn,Va,Gt,gn,Gi,Nv].forEach(function(t){xe(Me,t)});var i3=[{name:"null",impl:Wp},{name:"base",impl:fv},{name:"canvas",impl:n3}],o3=[{type:"layout",extensions:fD},{type:"renderer",extensions:i3}],Pv={},_v={};function Ov(t,e,r){var n=r,a=function(B){Ae("Can not register `"+e+"` for `"+t+"` since `"+B+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(zi.prototype[e])return a(e);zi.prototype[e]=r}else if(t==="collection"){if(kt.prototype[e])return a(e);kt.prototype[e]=r}else if(t==="layout"){for(var i=function(B){this.options=B,r.call(this,B),Oe(this._private)||(this._private={}),this._private.cy=B.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(r.prototype),l=[],c=0;c<l.length;c++){var u=l[c];s[u]=s[u]||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=r.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},p={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 as(p,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}}),Ve.eventAliasesOn(s),n=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var v=Iv("renderer","base"),h=v.prototype,g=r,y=r.prototype,m=function(){v.apply(this,arguments),g.apply(this,arguments)},b=m.prototype;for(var w in h){var C=h[w],x=y[w]!=null;if(x)return a(w);b[w]=C}for(var E in y)b[E]=y[E];h.clientFunctions.forEach(function(k){b[k]=b[k]||function(){Ze("Renderer does not implement `renderer."+k+"()` on its prototype")}}),n=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 jf({map:Pv,keys:[t,e],value:n})}function Iv(t,e){return Yf({map:Pv,keys:[t,e]})}function s3(t,e,r,n,a){return jf({map:_v,keys:[t,e,r,n],value:a})}function l3(t,e,r,n){return Yf({map:_v,keys:[t,e,r,n]})}var Mc=function(){if(arguments.length===2)return Iv.apply(null,arguments);if(arguments.length===3)return Ov.apply(null,arguments);if(arguments.length===4)return l3.apply(null,arguments);if(arguments.length===5)return s3.apply(null,arguments);Ze("Invalid extension access syntax")};zi.prototype.extension=Mc,o3.forEach(function(t){t.extensions.forEach(function(e){Ov(t.type,e.name,e.impl)})});var Lv=function t(){if(!(this instanceof t))return new t;this.length=0},jn=Lv.prototype;jn.instanceString=function(){return"stylesheet"},jn.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this},jn.css=function(t,e){var r=this.length-1;if(be(t))this[r].properties.push({name:t,value:e});else if(Oe(t))for(var n=t,a=Object.keys(n),i=0;i<a.length;i++){var s=a[i],l=n[s];if(l!=null){var c=Nt.properties[s]||Nt.properties[Oo(s)];if(c!=null){var u=c.name,d=l;this[r].properties.push({name:u,value:d})}}}return this},jn.style=jn.css,jn.generateStyle=function(t){var e=new Nt(t);return this.appendToStyle(e)},jn.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],n=r.selector,a=r.properties;t.selector(n);for(var i=0;i<a.length;i++){var s=a[i];t.css(s.name,s.value)}}return t};var c3="3.30.2",Yn=function(e){if(e===void 0&&(e={}),Oe(e))return new zi(e);if(be(e))return Mc.apply(Mc,arguments)};Yn.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Yn),t.apply(null,e),this},Yn.warnings=function(t){return lh(t)},Yn.version=c3,Yn.stylesheet=Yn.Stylesheet=Lv;let u3=class extends EventTarget{constructor(r,n){super();gr(this,"cyg",null);gr(this,"nodes",[]);gr(this,"edges",[]);gr(this,"axons",[]);gr(this,"dendrites",[]);gr(this,"somas",[]);gr(this,"labelCache",new Map);gr(this,"graphCanvas",null);this.labelCache=r,this.graphCanvas=n}async addConnectivity(r){var n;if(this.axons=r.axons.map(a=>JSON.stringify(a)),this.dendrites=r.dendrites.map(a=>JSON.stringify(a)),(n=r.somas)!=null&&n.length&&(this.somas=r.somas.map(a=>JSON.stringify(a))),r.connectivity.length)for(const a of r.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(r){this.cyg=new p3(this,r),this.cyg.on("tap-node",n=>{const a=new CustomEvent("tap-node",{detail:n.detail});this.dispatchEvent(a)})}selectConnectivity(r){var n;if((n=this.cyg)!=null&&n.cy){let a="";this.cyg.cy.elements().forEach(i=>{const s=i.data("label"),l=Fc(s);h3(r,l)&&(a=i.id())}),a&&this.cyg.cy.$id(a).select()}}clearConnectivity(){var r;(r=this.cyg)!=null&&r.cy&&(this.cyg.cy.remove(),this.cyg.cy=null)}reset(){var r;(r=this.cyg)!=null&&r.cy&&this.cyg.cy.reset()}zoom(r){var n;if((n=this.cyg)!=null&&n.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+r,renderedPosition:l})}}enableZoom(r){var n;(n=this.cyg)!=null&&n.cy&&this.cyg.cy.userZoomingEnabled(r)}get elements(){return[...this.nodes.map(r=>({data:r})),...this.edges.map(r=>({data:r}))]}get roots(){return[...this.dendrites,...this.somas]}async graphNode(r){const n=JSON.stringify(r),a=[r[0],...r[1]],i=[];for(const l of a){const c=this.labelCache.has(l)?this.labelCache.get(l):"";i.push(c)}a.push(...i);const s={id:n,label:a.join(`
36
36
  `)};return this.axons.includes(n)?this.dendrites.includes(n)||this.somas.includes(n)?s["both-a-d"]=!0:s.axon=!0:(this.dendrites.includes(n)||this.somas.includes(n))&&(s.dendrite=!0),s}on(r,n){this.addEventListener(r,n)}};const d3=[{selector:"node",style:{label:function(t){return f3(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[both-a-d]",style:{shape:"round-rectangle"}},{selector:"edge",style:{width:1,"line-color":"dimgray","target-arrow-color":"dimgray","target-arrow-shape":"triangle","curve-style":"bezier"}},{selector:"node.active",style:{"border-color":"#8300bf","background-color":"#f3ecf6","background-opacity":.75}}];function f3(t){const e=t.split(`
37
- `),r=e.length/2,n=e.slice(r);return Lv(n.join(`
38
- `))}function Lv(t){return t.split(`
37
+ `),r=e.length/2,n=e.slice(r);return Mv(n.join(`
38
+ `))}function Mv(t){return t.split(`
39
39
  `).map(e=>e&&e[0]>="a"&&e[0]<="z"?e.charAt(0).toUpperCase()+e.slice(1):e).join(`
40
40
  `)}function Fc(t){const e=t?t.split(`
41
- `):[],r=[];for(let n=0;n<e.length/2;n++)r.push({id:e[n],label:e[n+e.length/2]});return r}function h3(t,e){t.sort((r,n)=>r.id<n.id?-1:r.id>n.id?1:0),e.sort((r,n)=>r.id<n.id?-1:r.id>n.id?1:0);for(let r=0;r<t.length;r++)if(JSON.stringify(t[r])!==JSON.stringify(e[r]))return!1;return!0}class p3 extends EventTarget{constructor(r,n){var a;super();gr(this,"cy");gr(this,"tooltip");this.cy=Yn({container:n,elements:r.elements,layout:{name:"breadthfirst",circle:!1,roots:r.roots},directed:!0,style:d3,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=n==null?void 0:n.lastChild)==null||a.appendChild(this.tooltip)}remove(){this.cy&&this.cy.destroy()}checkRightBoundary(r){var n;r+this.tooltip.offsetWidth>=((n=this.tooltip.parentElement)==null?void 0:n.offsetWidth)&&(this.tooltip.style.left=`${r-this.tooltip.offsetWidth}px`)}overNode(r){const a=r.target.data(),{label:i}=a,l=Fc(i).map(c=>c.label+" ("+c.id+")");this.tooltip.innerText=Lv(l.join(`
42
- `)),this.tooltip.style.left=`${r.renderedPosition.x}px`,this.tooltip.style.top=`${r.renderedPosition.y}px`,this.tooltip.style.maxWidth="240px",this.tooltip.style.zIndex=2,this.tooltip.hidden=!1,this.checkRightBoundary(r.renderedPosition.x),this.tapNode(r,!0)}moveNode(r){const n=r.target;this.tooltip.style.left=`${n.renderedPosition().x}px`,this.tooltip.style.top=`${n.renderedPosition().y}px`,this.checkRightBoundary(n.renderedPosition().x)}exitNode(r){this.tooltip.hidden=!0,this.tapNode(r,!1)}tapNode(r,n){const a=r.target,i=a.data();let{label:s}=i;n?a.addClass("active"):(a.removeClass("active"),s="",setTimeout(()=>{a.unselect()}));const l=Fc(s),c=new CustomEvent("tap-node",{detail:l});this.dispatchEvent(c)}on(r,n){this.addEventListener(r,n)}}const v3=1.3,g3=24*60*60*1e3,m3="Reset position",Mv="Lock zoom",y3="Unlock zoom",b3="Zoom in",w3="Zoom out",Fv=.25,C3="#8300bf",k3=3e3,x3={name:"ConnectivityGraph",props:{entry:{type:String,default:""},mapServer:{type:String,default:""},selectedConnectivityData:{type:Array,default:[]}},data:function(){return{loading:!0,connectivityGraph:null,selectedSource:"",pathList:[],schemaVersion:"",knowledgeByPath:new Map,labelledTerms:new Set,labelCache:new Map,resetLabel:m3,zoomLockLabel:Mv,zoomInLabel:b3,zoomOutLabel:w3,iconColor:C3,zoomEnabled:!1,connectivityError:null,timeoutID:void 0}},mounted(){this.refreshCache(),this.loadCacheData(),this.run().then(t=>{this.showGraph(this.entry)})},methods:{loadCacheData:function(){const t=sessionStorage.getItem("connectivity-graph-source"),e=sessionStorage.getItem("connectivity-graph-labels"),r=sessionStorage.getItem("connectivity-graph-pathlist"),n=sessionStorage.getItem("connectivity-graph-schema-version");if(t&&(this.selectedSource=t),r&&(this.pathList=JSON.parse(r)),e){const a=JSON.parse(e);this.labelCache=new Map(Object.entries(a))}n&&(this.schemaVersion=n)},removeAllCacheData:function(){["connectivity-graph-expiry","connectivity-graph-source","connectivity-graph-labels","connectivity-graph-pathlist","connectivity-graph-schema-version"].forEach(e=>{sessionStorage.removeItem(e)})},refreshCache:function(){const t=sessionStorage.getItem("connectivity-graph-expiry");new Date().getTime()>t&&this.removeAllCacheData()},updateCacheExpiry:function(){const e=new Date().getTime()+g3;sessionStorage.setItem("connectivity-graph-expiry",e)},run:async function(){if(this.schemaVersion||(this.schemaVersion=await this.getSchemaVersion(),sessionStorage.setItem("connectivity-graph-schema-version",this.schemaVersion),this.updateCacheExpiry()),this.schemaVersion<v3){console.warn("No Server!");return}this.showSpinner(),this.selectedSource||(this.selectedSource=await this.setSourceList(),sessionStorage.setItem("connectivity-graph-source",this.selectedSource),this.updateCacheExpiry()),await this.setPathList(this.selectedSource),this.hideSpinner()},showGraph:async function(t){const e=this.$refs.graphCanvas;this.showSpinner(),this.connectivityGraph=new u3(this.labelCache,e),await this.connectivityGraph.addConnectivity(this.knowledgeByPath.get(t)),this.hideSpinner(),this.connectivityGraph.showConnectivity(e),this.selectedConnectivityData.length&&this.connectivityGraph.selectConnectivity(this.selectedConnectivityData),this.connectivityGraph.on("tap-node",r=>{const n=r.detail;this.$emit("tap-node",n)})},query:async function(t,e){const r=`${this.mapServer}knowledge/query/`,n={sql:t,params:e};try{const a=await fetch(r,{method:"POST",headers:{Accept:"application/json; charset=utf-8","Cache-Control":"no-store","Content-Type":"application/json"},body:JSON.stringify(n)});if(!a.ok)throw new Error(`Cannot access ${r}`);return await a.json()}catch{return{values:[]}}},setSourceList:async function(){const t=await this.getJsonData(`${this.mapServer}knowledge/sources`),e=t?t.sources||[]:[];let r="";for(const n of e)n&&r===""&&(r=n);return r},loadPathData:async function(t){const e=await this.query(`select entity, knowledge from knowledge
41
+ `):[],r=[];for(let n=0;n<e.length/2;n++)r.push({id:e[n],label:e[n+e.length/2]});return r}function h3(t,e){t.sort((r,n)=>r.id<n.id?-1:r.id>n.id?1:0),e.sort((r,n)=>r.id<n.id?-1:r.id>n.id?1:0);for(let r=0;r<t.length;r++)if(JSON.stringify(t[r])!==JSON.stringify(e[r]))return!1;return!0}class p3 extends EventTarget{constructor(r,n){var a;super();gr(this,"cy");gr(this,"tooltip");this.cy=Yn({container:n,elements:r.elements,layout:{name:"breadthfirst",circle:!1,roots:r.roots},directed:!0,style:d3,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=n==null?void 0:n.lastChild)==null||a.appendChild(this.tooltip)}remove(){this.cy&&this.cy.destroy()}checkRightBoundary(r){var n;r+this.tooltip.offsetWidth>=((n=this.tooltip.parentElement)==null?void 0:n.offsetWidth)&&(this.tooltip.style.left=`${r-this.tooltip.offsetWidth}px`)}overNode(r){const a=r.target.data(),{label:i}=a,l=Fc(i).map(c=>c.label+" ("+c.id+")");this.tooltip.innerText=Mv(l.join(`
42
+ `)),this.tooltip.style.left=`${r.renderedPosition.x}px`,this.tooltip.style.top=`${r.renderedPosition.y}px`,this.tooltip.style.maxWidth="240px",this.tooltip.style.zIndex=2,this.tooltip.hidden=!1,this.checkRightBoundary(r.renderedPosition.x),this.tapNode(r,!0)}moveNode(r){const n=r.target;this.tooltip.style.left=`${n.renderedPosition().x}px`,this.tooltip.style.top=`${n.renderedPosition().y}px`,this.checkRightBoundary(n.renderedPosition().x)}exitNode(r){this.tooltip.hidden=!0,this.tapNode(r,!1)}tapNode(r,n){const a=r.target,i=a.data();let{label:s}=i;n?a.addClass("active"):(a.removeClass("active"),s="",setTimeout(()=>{a.unselect()}));const l=Fc(s),c=new CustomEvent("tap-node",{detail:l});this.dispatchEvent(c)}on(r,n){this.addEventListener(r,n)}}const v3=1.3,g3=24*60*60*1e3,m3="Reset position",Fv="Lock zoom",y3="Unlock zoom",b3="Zoom in",w3="Zoom out",Av=.25,C3="#8300bf",k3=3e3,x3={name:"ConnectivityGraph",props:{entry:{type:String,default:""},mapServer:{type:String,default:""},selectedConnectivityData:{type:Array,default:[]}},data:function(){return{loading:!0,connectivityGraph:null,selectedSource:"",pathList:[],schemaVersion:"",knowledgeByPath:new Map,labelledTerms:new Set,labelCache:new Map,resetLabel:m3,zoomLockLabel:Fv,zoomInLabel:b3,zoomOutLabel:w3,iconColor:C3,zoomEnabled:!1,connectivityError:null,timeoutID:void 0}},mounted(){this.refreshCache(),this.loadCacheData(),this.run().then(t=>{this.showGraph(this.entry)})},methods:{loadCacheData:function(){const t=sessionStorage.getItem("connectivity-graph-source"),e=sessionStorage.getItem("connectivity-graph-labels"),r=sessionStorage.getItem("connectivity-graph-pathlist"),n=sessionStorage.getItem("connectivity-graph-schema-version");if(t&&(this.selectedSource=t),r&&(this.pathList=JSON.parse(r)),e){const a=JSON.parse(e);this.labelCache=new Map(Object.entries(a))}n&&(this.schemaVersion=n)},removeAllCacheData:function(){["connectivity-graph-expiry","connectivity-graph-source","connectivity-graph-labels","connectivity-graph-pathlist","connectivity-graph-schema-version"].forEach(e=>{sessionStorage.removeItem(e)})},refreshCache:function(){const t=sessionStorage.getItem("connectivity-graph-expiry");new Date().getTime()>t&&this.removeAllCacheData()},updateCacheExpiry:function(){const e=new Date().getTime()+g3;sessionStorage.setItem("connectivity-graph-expiry",e)},run:async function(){if(this.schemaVersion||(this.schemaVersion=await this.getSchemaVersion(),sessionStorage.setItem("connectivity-graph-schema-version",this.schemaVersion),this.updateCacheExpiry()),this.schemaVersion<v3){console.warn("No Server!");return}this.showSpinner(),this.selectedSource||(this.selectedSource=await this.setSourceList(),sessionStorage.setItem("connectivity-graph-source",this.selectedSource),this.updateCacheExpiry()),await this.setPathList(this.selectedSource),this.hideSpinner()},showGraph:async function(t){const e=this.$refs.graphCanvas;this.showSpinner(),this.connectivityGraph=new u3(this.labelCache,e),await this.connectivityGraph.addConnectivity(this.knowledgeByPath.get(t)),this.hideSpinner(),this.connectivityGraph.showConnectivity(e),this.selectedConnectivityData.length&&this.connectivityGraph.selectConnectivity(this.selectedConnectivityData),this.connectivityGraph.on("tap-node",r=>{const n=r.detail;this.$emit("tap-node",n)})},query:async function(t,e){const r=`${this.mapServer}knowledge/query/`,n={sql:t,params:e};try{const a=await fetch(r,{method:"POST",headers:{Accept:"application/json; charset=utf-8","Cache-Control":"no-store","Content-Type":"application/json"},body:JSON.stringify(n)});if(!a.ok)throw new Error(`Cannot access ${r}`);return await a.json()}catch{return{values:[]}}},setSourceList:async function(){const t=await this.getJsonData(`${this.mapServer}knowledge/sources`),e=t?t.sources||[]:[];let r="";for(const n of e)n&&r===""&&(r=n);return r},loadPathData:async function(t){const e=await this.query(`select entity, knowledge from knowledge
43
43
  where entity like 'ilxtr:%' and source=?
44
44
  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,r]of this.pathList){const n=JSON.parse(r);"connectivity"in n&&(this.knowledgeByPath.set(e,n),this.cacheLabels(n))}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
45
45
  where entity in (?${", ?".repeat(this.labelledTerms.size-1)})
46
- order by source desc`,[...this.labelledTerms.values()]);let e=null;for(const[n,a]of t.values)if(n!==e){const i=JSON.parse(a);this.labelCache.set(n,i.label||n),e=n}const r=Object.fromEntries(this.labelCache);sessionStorage.setItem("connectivity-graph-labels",JSON.stringify(r)),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(Fv)},zoomOut:function(){this.connectivityGraph.zoom(-Fv)},toggleZoom:function(){this.zoomEnabled=!this.zoomEnabled,this.zoomLockLabel=this.zoomEnabled?y3:Mv,this.connectivityGraph.enableZoom(!this.zoomEnabled)},showErrorMessage:function(t){this.connectivityError={...t},this.timeoutID&&clearTimeout(this.timeoutID),this.timeoutID=setTimeout(()=>{this.connectivityError=null},k3)}}},E3={class:"connectivity-graph"},S3={ref:"graphCanvas",class:"graph-canvas"},T3={class:"control-panel control-panel-tools"},B3={class:"visually-hidden"},N3={class:"visually-hidden"},D3={class:"visually-hidden"},P3={class:"visually-hidden"},_3=o.createStaticVNode('<div class="control-panel control-panel-nodes" data-v-6acf6401><div class="node-key" data-v-6acf6401><div class="key-box-container" data-v-6acf6401><div class="key-box key-box-dendrite" data-v-6acf6401> Origin </div><div class="key-box key-box-node" data-v-6acf6401> Components </div><div class="key-box key-box-axon" data-v-6acf6401> Destination </div></div></div></div>',1),O3={key:0,class:"connectivity-graph-error"},I3={key:0};function L3(t,e,r,n,a,i){const s=U1,l=yt,c=sr,u=li,d=fb,f=pb,p=wb,v=kb,h=Fl;return o.withDirectives((o.openBlock(),o.createElementBlock("div",E3,[o.createElementVNode("div",S3,null,512),o.createElementVNode("div",T3,[o.createElementVNode("div",{class:o.normalizeClass(["tools",{"zoom-locked":t.zoomEnabled}])},[o.createVNode(u,{content:t.resetLabel,placement:"top",effect:"control-tooltip"},{default:o.withCtx(()=>[o.createVNode(c,{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",B3,o.toDisplayString(t.resetLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content"]),o.createVNode(u,{content:t.zoomLockLabel,placement:"top",effect:"control-tooltip"},{default:o.withCtx(()=>[o.createVNode(c,{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",N3,o.toDisplayString(t.zoomLockLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content"]),o.createVNode(u,{content:t.zoomInLabel,placement:"left",effect:"control-tooltip"},{default:o.withCtx(()=>[o.createVNode(c,{class:"control-button",size:"small",onClick:i.zoomIn},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(p)]),_:1}),o.createElementVNode("span",D3,o.toDisplayString(t.zoomInLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content"]),o.createVNode(u,{content:t.zoomOutLabel,placement:"left",effect:"control-tooltip"},{default:o.withCtx(()=>[o.createVNode(c,{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",P3,o.toDisplayString(t.zoomOutLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content"])],2)]),_3,t.connectivityError?(o.openBlock(),o.createElementBlock("div",O3,[t.connectivityError.errorConnectivities?(o.openBlock(),o.createElementBlock("strong",I3,o.toDisplayString(t.connectivityError.errorConnectivities),1)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(t.connectivityError.errorMessage),1)])):o.createCommentVNode("",!0)])),[[h,t.loading]])}const M3=lr(x3,[["render",L3],["__scopeId","data-v-6acf6401"]]),Av="Copy to clipboard",F3="Copied!",A3="#8300bf",V3={name:"CopyToClipboard",props:{content:{type:String,default:""},theme:{type:String,default:""}},data:function(){return{textLabel:Av,autoHideTimeout:0,iconColor:A3}},methods:{copyToClipboard:async function(){let t=!0;this.autoHideTimeout=600;try{const e=this.content.replaceAll(`
47
- `,""),r=document.createElement("div");r.innerHTML=this.content;const n=r.textContent||r.innerText||"",a=new Blob([e],{type:"text/html"}),i=new Blob([n],{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=F3:this.textLabel="Error trying to copy to clipboard!"},resetSettings:function(){this.autoHideTimeout=0,this.textLabel=Av}}},R3={class:"visually-hidden"};function $3(t,e,r,n,a,i){const s=tb,l=yt,c=sr,u=li;return o.openBlock(),o.createBlock(u,{content:t.textLabel,placement:"bottom","hide-after":t.autoHideTimeout,effect:"clipboard-tooltip",onHide:i.resetSettings},{default:o.withCtx(()=>[o.createVNode(c,{class:o.normalizeClass(["copy-clipboard-button",r.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",R3,o.toDisplayString(t.textLabel),1)]),_:1},8,["class","onClick"])]),_:1},8,["content","hide-after","onHide"])}const Vv=lr(V3,[["render",$3],["__scopeId","data-v-de3b5311"]]),z3=function(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},H3={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"},capitalise:function(t){return z3(t)},handleTooltip:function(t){this.tooltipId=this.tooltipId===t?void 0:t,this.$emit("featureTooltip",this.tooltipId)}}},Ac=t=>(o.pushScopeId("data-v-8168ee98"),t=t(),o.popScopeId(),t),K3={class:"dialog-container"},q3=Ac(()=>o.createElementVNode("span",{class:"dialog-title"},"Finalise drawing",-1)),U3=Ac(()=>o.createElementVNode("span",{class:"dialog-title"},"Visualise connection",-1)),G3=Ac(()=>o.createElementVNode("b",null,[o.createElementVNode("span",null,"Related Features")],-1));function W3(t,e,r,n,a,i){const s=sr,l=ek,c=To,u=ci,d=ik;return o.openBlock(),o.createElementBlock("div",K3,[o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(u,null,{default:o.withCtx(()=>[r.inDrawing?(o.openBlock(),o.createBlock(c,{key:0},{default:o.withCtx(()=>[q3,o.createVNode(l,null,{default:o.withCtx(()=>[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})]),_:1})):(o.openBlock(),o.createBlock(c,{key:1},{default:o.withCtx(()=>[U3,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}),r.connectionExist?(o.openBlock(),o.createBlock(c,{key:0},{default:o.withCtx(()=>[o.createVNode(u,null,{default:o.withCtx(()=>[G3,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.connectionEntry,(f,p)=>(o.openBlock(),o.createBlock(c,{key:p},{default:o.withCtx(()=>[o.createVNode(d,{shadow:i.shadowDisplay(p),onClick:v=>i.handleTooltip(p)},{default:o.withCtx(()=>[o.createElementVNode("span",null,o.toDisplayString(i.capitalise(f.label)),1)]),_:2},1032,["shadow","onClick"])]),_:2},1024))),128))]),_:1})]),_:1})):o.createCommentVNode("",!0)])}const j3=lr(H3,[["render",W3],["__scopeId","data-v-8168ee98"]]),Rv=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},Y3=["xlink:href"],Z3={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(t){return(e,r)=>(o.openBlock(),o.createElementBlock("svg",{class:o.normalizeClass(["map-icon",{"map-icon-spin":t.spin}])},[o.createElementVNode("use",{"xlink:href":`#${t.icon}`},null,8,Y3)],2))}},X3=Rv(Z3,[["__scopeId","data-v-e172d5ff"]]),$v=`<?xml version="1.0" encoding="UTF-8"?>
46
+ order by source desc`,[...this.labelledTerms.values()]);let e=null;for(const[n,a]of t.values)if(n!==e){const i=JSON.parse(a);this.labelCache.set(n,i.label||n),e=n}const r=Object.fromEntries(this.labelCache);sessionStorage.setItem("connectivity-graph-labels",JSON.stringify(r)),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(Av)},zoomOut:function(){this.connectivityGraph.zoom(-Av)},toggleZoom:function(){this.zoomEnabled=!this.zoomEnabled,this.zoomLockLabel=this.zoomEnabled?y3:Fv,this.connectivityGraph.enableZoom(!this.zoomEnabled)},showErrorMessage:function(t){this.connectivityError={...t},this.timeoutID&&clearTimeout(this.timeoutID),this.timeoutID=setTimeout(()=>{this.connectivityError=null},k3)}}},E3={class:"connectivity-graph"},S3={ref:"graphCanvas",class:"graph-canvas"},T3={class:"control-panel control-panel-tools"},B3={class:"visually-hidden"},N3={class:"visually-hidden"},D3={class:"visually-hidden"},P3={class:"visually-hidden"},_3=o.createStaticVNode('<div class="control-panel control-panel-nodes" data-v-6acf6401><div class="node-key" data-v-6acf6401><div class="key-box-container" data-v-6acf6401><div class="key-box key-box-dendrite" data-v-6acf6401> Origin </div><div class="key-box key-box-node" data-v-6acf6401> Components </div><div class="key-box key-box-axon" data-v-6acf6401> Destination </div></div></div></div>',1),O3={key:0,class:"connectivity-graph-error"},I3={key:0};function L3(t,e,r,n,a,i){const s=U1,l=yt,c=sr,u=li,d=fb,f=pb,p=wb,v=kb,h=Fl;return o.withDirectives((o.openBlock(),o.createElementBlock("div",E3,[o.createElementVNode("div",S3,null,512),o.createElementVNode("div",T3,[o.createElementVNode("div",{class:o.normalizeClass(["tools",{"zoom-locked":t.zoomEnabled}])},[o.createVNode(u,{content:t.resetLabel,placement:"top",effect:"control-tooltip"},{default:o.withCtx(()=>[o.createVNode(c,{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",B3,o.toDisplayString(t.resetLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content"]),o.createVNode(u,{content:t.zoomLockLabel,placement:"top",effect:"control-tooltip"},{default:o.withCtx(()=>[o.createVNode(c,{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",N3,o.toDisplayString(t.zoomLockLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content"]),o.createVNode(u,{content:t.zoomInLabel,placement:"left",effect:"control-tooltip"},{default:o.withCtx(()=>[o.createVNode(c,{class:"control-button",size:"small",onClick:i.zoomIn},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(p)]),_:1}),o.createElementVNode("span",D3,o.toDisplayString(t.zoomInLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content"]),o.createVNode(u,{content:t.zoomOutLabel,placement:"left",effect:"control-tooltip"},{default:o.withCtx(()=>[o.createVNode(c,{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",P3,o.toDisplayString(t.zoomOutLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content"])],2)]),_3,t.connectivityError?(o.openBlock(),o.createElementBlock("div",O3,[t.connectivityError.errorConnectivities?(o.openBlock(),o.createElementBlock("strong",I3,o.toDisplayString(t.connectivityError.errorConnectivities),1)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(t.connectivityError.errorMessage),1)])):o.createCommentVNode("",!0)])),[[h,t.loading]])}const M3=lr(x3,[["render",L3],["__scopeId","data-v-6acf6401"]]),Vv="Copy to clipboard",F3="Copied!",A3="#8300bf",V3={name:"CopyToClipboard",props:{content:{type:String,default:""},theme:{type:String,default:""}},data:function(){return{textLabel:Vv,autoHideTimeout:0,iconColor:A3}},methods:{copyToClipboard:async function(){let t=!0;this.autoHideTimeout=600;try{const e=this.content.replaceAll(`
47
+ `,""),r=document.createElement("div");r.innerHTML=this.content;const n=r.textContent||r.innerText||"",a=new Blob([e],{type:"text/html"}),i=new Blob([n],{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=F3:this.textLabel="Error trying to copy to clipboard!"},resetSettings:function(){this.autoHideTimeout=0,this.textLabel=Vv}}},R3={class:"visually-hidden"};function $3(t,e,r,n,a,i){const s=tb,l=yt,c=sr,u=li;return o.openBlock(),o.createBlock(u,{content:t.textLabel,placement:"bottom","hide-after":t.autoHideTimeout,effect:"clipboard-tooltip",onHide:i.resetSettings},{default:o.withCtx(()=>[o.createVNode(c,{class:o.normalizeClass(["copy-clipboard-button",r.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",R3,o.toDisplayString(t.textLabel),1)]),_:1},8,["class","onClick"])]),_:1},8,["content","hide-after","onHide"])}const Rv=lr(V3,[["render",$3],["__scopeId","data-v-de3b5311"]]),z3=function(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},H3={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"},capitalise:function(t){return z3(t)},handleTooltip:function(t){this.tooltipId=this.tooltipId===t?void 0:t,this.$emit("featureTooltip",this.tooltipId)}}},Ac=t=>(o.pushScopeId("data-v-8168ee98"),t=t(),o.popScopeId(),t),K3={class:"dialog-container"},q3=Ac(()=>o.createElementVNode("span",{class:"dialog-title"},"Finalise drawing",-1)),U3=Ac(()=>o.createElementVNode("span",{class:"dialog-title"},"Visualise connection",-1)),G3=Ac(()=>o.createElementVNode("b",null,[o.createElementVNode("span",null,"Related Features")],-1));function W3(t,e,r,n,a,i){const s=sr,l=ek,c=To,u=ci,d=ik;return o.openBlock(),o.createElementBlock("div",K3,[o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(u,null,{default:o.withCtx(()=>[r.inDrawing?(o.openBlock(),o.createBlock(c,{key:0},{default:o.withCtx(()=>[q3,o.createVNode(l,null,{default:o.withCtx(()=>[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})]),_:1})):(o.openBlock(),o.createBlock(c,{key:1},{default:o.withCtx(()=>[U3,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}),r.connectionExist?(o.openBlock(),o.createBlock(c,{key:0},{default:o.withCtx(()=>[o.createVNode(u,null,{default:o.withCtx(()=>[G3,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.connectionEntry,(f,p)=>(o.openBlock(),o.createBlock(c,{key:p},{default:o.withCtx(()=>[o.createVNode(d,{shadow:i.shadowDisplay(p),onClick:v=>i.handleTooltip(p)},{default:o.withCtx(()=>[o.createElementVNode("span",null,o.toDisplayString(i.capitalise(f.label)),1)]),_:2},1032,["shadow","onClick"])]),_:2},1024))),128))]),_:1})]),_:1})):o.createCommentVNode("",!0)])}const j3=lr(H3,[["render",W3],["__scopeId","data-v-8168ee98"]]),$v=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},Y3=["xlink:href"],Z3={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(t){return(e,r)=>(o.openBlock(),o.createElementBlock("svg",{class:o.normalizeClass(["map-icon",{"map-icon-spin":t.spin}])},[o.createElementVNode("use",{"xlink:href":`#${t.icon}`},null,8,Y3)],2))}},X3=$v(Z3,[["__scopeId","data-v-e172d5ff"]]),zv=`<?xml version="1.0" encoding="UTF-8"?>
48
48
  <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">
49
49
  <title>2horpanel</title>
50
50
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -59,7 +59,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
59
59
  <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
60
60
  </g>
61
61
  </g>
62
- </svg>`,zv=`<?xml version="1.0" encoding="UTF-8"?>
62
+ </svg>`,Hv=`<?xml version="1.0" encoding="UTF-8"?>
63
63
  <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">
64
64
  <title>2vertpanel</title>
65
65
  <g id="2vertpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -74,7 +74,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
74
74
  <line x1="12" y1="7.5" x2="12" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
75
75
  </g>
76
76
  </g>
77
- </svg>`,Hv=`<?xml version="1.0" encoding="UTF-8"?>
77
+ </svg>`,Kv=`<?xml version="1.0" encoding="UTF-8"?>
78
78
  <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">
79
79
  <title>3panel</title>
80
80
  <g id="3panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -90,7 +90,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
90
90
  <line x1="18.5" y1="11.5" x2="11.5" y2="11.5" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
91
91
  </g>
92
92
  </g>
93
- </svg>`,Kv=`<?xml version="1.0" encoding="UTF-8"?>
93
+ </svg>`,qv=`<?xml version="1.0" encoding="UTF-8"?>
94
94
  <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">
95
95
  <title>4panel</title>
96
96
  <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -106,7 +106,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
106
106
  <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
107
107
  </g>
108
108
  </g>
109
- </svg>`,qv=`<?xml version="1.0" encoding="UTF-8"?>
109
+ </svg>`,Uv=`<?xml version="1.0" encoding="UTF-8"?>
110
110
  <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">
111
111
  <title>2horpanel</title>
112
112
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -124,7 +124,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
124
124
  <line x1="9.5" y1="12" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
125
125
  </g>
126
126
  </g>
127
- </svg>`,Uv=`<?xml version="1.0" encoding="UTF-8"?>
127
+ </svg>`,Gv=`<?xml version="1.0" encoding="UTF-8"?>
128
128
  <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">
129
129
  <title>2horpanel</title>
130
130
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -141,7 +141,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
141
141
  <line x1="9.5" y1="16" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
142
142
  </g>
143
143
  </g>
144
- </svg>`,Gv=`<?xml version="1.0" encoding="UTF-8"?>
144
+ </svg>`,Wv=`<?xml version="1.0" encoding="UTF-8"?>
145
145
  <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">
146
146
  <title>4panel</title>
147
147
  <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -158,7 +158,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
158
158
  <line x1="18.5" y1="13.8" x2="5.5" y2="13.8" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
159
159
  </g>
160
160
  </g>
161
- </svg>`,Wv=`<?xml version="1.0" encoding="UTF-8"?>
161
+ </svg>`,jv=`<?xml version="1.0" encoding="UTF-8"?>
162
162
  <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">
163
163
  <title>changeBckgd</title>
164
164
  <g id="changeBckgd" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -169,7 +169,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
169
169
  <line x1="7" y1="16.5" x2="17" y2="16.5" id="Line" stroke="#FFFFFF" stroke-linecap="square"></line>
170
170
  </g>
171
171
  </g>
172
- </svg>`,jv=`<?xml version="1.0" encoding="UTF-8"?>
172
+ </svg>`,Yv=`<?xml version="1.0" encoding="UTF-8"?>
173
173
  <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">
174
174
  <title>close no bk</title>
175
175
  <g id="close-no-bk" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="square">
@@ -178,7 +178,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
178
178
  <line x1="7" y1="0" x2="7" y2="14" id="Line-9"></line>
179
179
  </g>
180
180
  </g>
181
- </svg>`,Yv=`<?xml version="1.0" encoding="UTF-8"?>
181
+ </svg>`,Zv=`<?xml version="1.0" encoding="UTF-8"?>
182
182
  <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">
183
183
  <title>close</title>
184
184
  <g id="close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -192,7 +192,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
192
192
  </g>
193
193
  </g>
194
194
  </g>
195
- </svg>`,Zv=`<?xml version="1.0" encoding="UTF-8"?>
195
+ </svg>`,Xv=`<?xml version="1.0" encoding="UTF-8"?>
196
196
  <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">
197
197
  <title>closeFullScreen</title>
198
198
  <g id="closeFullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -204,7 +204,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
204
204
  <polyline id="Line-5" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="square" transform="translate(17.250000, 7.750000) scale(1, -1) rotate(-360.000000) translate(-17.250000, -7.750000) " points="15.5 9.5 15.5 6 19 6"></polyline>
205
205
  </g>
206
206
  </g>
207
- </svg>`,Xv=`<?xml version="1.0" encoding="UTF-8"?>
207
+ </svg>`,Qv=`<?xml version="1.0" encoding="UTF-8"?>
208
208
  <svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
209
209
  xmlns:xlink="http://www.w3.org/1999/xlink">
210
210
  <title>Comment</title>
@@ -213,7 +213,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
213
213
  <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(165, 215)"
214
214
  d="M736 504a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112M128 128v640h192v160l224-160h352V128z" />
215
215
  </g>
216
- </svg>`,Qv=`<?xml version="1.0" encoding="UTF-8"?>
216
+ </svg>`,Jv=`<?xml version="1.0" encoding="UTF-8"?>
217
217
  <svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
218
218
  xmlns:xlink="http://www.w3.org/1999/xlink">
219
219
  <title>Connection</title>
@@ -224,7 +224,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
224
224
  <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(175, 175)"
225
225
  d="M384 640v-64h192a128 128 0 0 0 128-128V320a128 128 0 0 0-128-128H256a128 128 0 0 0-128 128v128a128 128 0 0 0 64 110.848v70.272A192.064 192.064 0 0 1 64 448V320a192 192 0 0 1 192-192h320a192 192 0 0 1 192 192v128a192 192 0 0 1-192 192z" />
226
226
  </g>
227
- </svg>`,Jv=`<?xml version="1.0" encoding="UTF-8"?>
227
+ </svg>`,eg=`<?xml version="1.0" encoding="UTF-8"?>
228
228
  <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">
229
229
  <title>dock</title>
230
230
  <g id="dock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -244,35 +244,35 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
244
244
  </g>
245
245
  </g>
246
246
  </g>
247
- </svg>`,eg=`<?xml version="1.0" encoding="UTF-8"?>
247
+ </svg>`,tg=`<?xml version="1.0" encoding="UTF-8"?>
248
248
  <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">
249
249
  <title>drawLine</title>
250
250
  <g id="drawLine" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
251
251
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
252
252
  <path fill="#FFFFFF" transform="translate(2 2.0625)" d="m13.5 3.5c-1.4 0-2.5 1.1-2.5 2.5 0 .3 0 .6.2.9l-3.8 3.8c-.3-.1-.6-.2-.9-.2-1.4 0-2.5 1.1-2.5 2.5s1.1 2.5 2.5 2.5 2.5-1.1 2.5-2.5c0-.3 0-.6-.2-.9l3.8-3.8c.3.1.6.2.9.2 1.4 0 2.5-1.1 2.5-2.5s-1.1-2.5-2.5-2.5z" />
253
253
  </g>
254
- </svg>`,tg=`<?xml version="1.0" encoding="UTF-8"?>
254
+ </svg>`,rg=`<?xml version="1.0" encoding="UTF-8"?>
255
255
  <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">
256
256
  <title>drawPoint</title>
257
257
  <g id="drawPoint" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
258
258
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
259
259
  <path fill="#FFFFFF" transform="translate(1.875 2.5)" d="m10 2c-3.3 0-6 2.7-6 6s6 9 6 9 6-5.7 6-9-2.7-6-6-6zm0 2c2.1 0 3.8 1.7 3.8 3.8 0 1.5-1.8 3.9-2.9 5.2h-1.7c-1.1-1.4-2.9-3.8-2.9-5.2-.1-2.1 1.6-3.8 3.7-3.8z" />
260
260
  </g>
261
- </svg>`,rg=`<?xml version="1.0" encoding="UTF-8"?>
261
+ </svg>`,ng=`<?xml version="1.0" encoding="UTF-8"?>
262
262
  <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">
263
263
  <title>drawPolygon</title>
264
264
  <g id="drawPolygon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
265
265
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
266
266
  <path fill="#FFFFFF" transform="translate(1.875 1.625)" d="m15 12.3v-4.6c.6-.3 1-1 1-1.7 0-1.1-.9-2-2-2-.7 0-1.4.4-1.7 1h-4.6c-.3-.6-1-1-1.7-1-1.1 0-2 .9-2 2 0 .7.4 1.4 1 1.7v4.6c-.6.3-1 1-1 1.7 0 1.1.9 2 2 2 .7 0 1.4-.4 1.7-1h4.6c.3.6 1 1 1.7 1 1.1 0 2-.9 2-2 0-.7-.4-1.4-1-1.7zm-8-.3v-4l1-1h4l1 1v4l-1 1h-4z" />
267
267
  </g>
268
- </svg>`,ng=`<?xml version="1.0" encoding="UTF-8"?>
268
+ </svg>`,ag=`<?xml version="1.0" encoding="UTF-8"?>
269
269
  <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">
270
270
  <title>drawTrash</title>
271
271
  <g id="drawTrash" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
272
272
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
273
273
  <path fill="#FFFFFF" transform="translate(2 1.5)" d="M10,3.4 c-0.8,0-1.5,0.5-1.8,1.2H5l-1,1v1h12v-1l-1-1h-3.2C11.5,3.9,10.8,3.4,10,3.4z M5,8v7c0,1,1,2,2,2h6c1,0,2-1,2-2V8h-2v5.5h-1.5V8h-3 v5.5H7V8H5z" />
274
274
  </g>
275
- </svg>`,ag=`<?xml version="1.0" encoding="UTF-8"?>
275
+ </svg>`,ig=`<?xml version="1.0" encoding="UTF-8"?>
276
276
  <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">
277
277
  <title>fitWindow</title>
278
278
  <g id="fitWindow" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -291,7 +291,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
291
291
  </g>
292
292
  </g>
293
293
  </g>
294
- </svg>`,ig=`<?xml version="1.0" encoding="UTF-8"?>
294
+ </svg>`,og=`<?xml version="1.0" encoding="UTF-8"?>
295
295
  <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">
296
296
  <title>fullScreen</title>
297
297
  <g id="fullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -305,7 +305,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
305
305
  </g>
306
306
  </g>
307
307
  </g>
308
- </svg>`,og='<svg id="icons" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>DataPortal-Icons</title><circle cx="12" cy="15.824" r="0.753"/><path d="M12,14.256a.75.75,0,0,1-.75-.75v-1c0-.529.419-.818.862-1.124.623-.43,1.138-.83,1.138-1.376A1.209,1.209,0,0,0,12,8.756a1.252,1.252,0,0,0-1.25,1.25.75.75,0,0,1-1.5,0A2.753,2.753,0,0,1,12,7.256a2.721,2.721,0,0,1,2.75,2.75,3.3,3.3,0,0,1-1.786,2.61c-.079.055-.152.1-.214.147v.743A.75.75,0,0,1,12,14.256Z"/><path d="M12,5a7,7,0,1,1-7,7,7.008,7.008,0,0,1,7-7m0-2a9,9,0,1,0,9,9,9,9,0,0,0-9-9Z"/></svg>',sg=`<?xml version="1.0" encoding="UTF-8"?>
308
+ </svg>`,sg='<svg id="icons" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>DataPortal-Icons</title><circle cx="12" cy="15.824" r="0.753"/><path d="M12,14.256a.75.75,0,0,1-.75-.75v-1c0-.529.419-.818.862-1.124.623-.43,1.138-.83,1.138-1.376A1.209,1.209,0,0,0,12,8.756a1.252,1.252,0,0,0-1.25,1.25.75.75,0,0,1-1.5,0A2.753,2.753,0,0,1,12,7.256a2.721,2.721,0,0,1,2.75,2.75,3.3,3.3,0,0,1-1.786,2.61c-.079.055-.152.1-.214.147v.743A.75.75,0,0,1,12,14.256Z"/><path d="M12,5a7,7,0,1,1-7,7,7.008,7.008,0,0,1,7-7m0-2a9,9,0,1,0,9,9,9,9,0,0,0-9-9Z"/></svg>',lg=`<?xml version="1.0" encoding="UTF-8"?>
309
309
  <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">
310
310
  <title>magnifyingGlass</title>
311
311
  <g id="magnifyingGlass" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -319,7 +319,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
319
319
  </g>
320
320
  </g>
321
321
  </g>
322
- </svg>`,lg=`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" x="0px" y="0px" viewBox="0 0 960 1200" enable-background="new 0 0 960 960" xml:space="preserve"><g><path fill="#000000" d="M670,499.992c0,5.5-4.5,10-10,10H300c-5.516,0-10-4.5-10-10v-40c0-5.5,4.484-10,10-10h360 c5.5,0,10,4.5,10,10V499.992z"/><path fill="#000000" d="M530,649.992c0,5.5-4.5,10-10,10h-80c-5.516,0-10-4.5-10-10v-40c0-5.5,4.484-10,10-10h80 c5.5,0,10,4.5,10,10V649.992z"/><path fill="#000000" d="M780,350.008c0,5.5-4.5,10-10,10H190c-5.516,0-10-4.5-10-10v-40c0-5.516,4.484-10,10-10h580 c5.5,0,10,4.484,10,10V350.008z"/></g><text x="0" y="975" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">Created by Wahyu Prihantoro</text><text x="0" y="980" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">from the Noun Project</text></svg>`,cg=`<?xml version="1.0" encoding="UTF-8"?>
322
+ </svg>`,cg=`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" x="0px" y="0px" viewBox="0 0 960 1200" enable-background="new 0 0 960 960" xml:space="preserve"><g><path fill="#000000" d="M670,499.992c0,5.5-4.5,10-10,10H300c-5.516,0-10-4.5-10-10v-40c0-5.5,4.484-10,10-10h360 c5.5,0,10,4.5,10,10V499.992z"/><path fill="#000000" d="M530,649.992c0,5.5-4.5,10-10,10h-80c-5.516,0-10-4.5-10-10v-40c0-5.5,4.484-10,10-10h80 c5.5,0,10,4.5,10,10V649.992z"/><path fill="#000000" d="M780,350.008c0,5.5-4.5,10-10,10H190c-5.516,0-10-4.5-10-10v-40c0-5.516,4.484-10,10-10h580 c5.5,0,10,4.484,10,10V350.008z"/></g><text x="0" y="975" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">Created by Wahyu Prihantoro</text><text x="0" y="980" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">from the Noun Project</text></svg>`,ug=`<?xml version="1.0" encoding="UTF-8"?>
323
323
  <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">
324
324
  <title>openMap</title>
325
325
  <g id="openMap" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -329,7 +329,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
329
329
  <rect id="Rectangle" stroke="#FFFFFF" x="5" y="10" width="10" height="7"></rect>
330
330
  <rect id="Rectangle-Copy" stroke="#FFFFFF" x="9" y="6" width="10" height="7"></rect>
331
331
  </g>
332
- </svg>`,ug=`<?xml version="1.0" encoding="UTF-8"?>
332
+ </svg>`,dg=`<?xml version="1.0" encoding="UTF-8"?>
333
333
  <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">
334
334
  <title>Artboard Copy 6</title>
335
335
  <g id="Artboard-Copy-6" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -339,7 +339,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
339
339
  <line x1="9" y1="8" x2="9" y2="16" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
340
340
  <line x1="15" y1="8" x2="15" y2="16" id="Line-6-Copy-3" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
341
341
  </g>
342
- </svg>`,dg=`<?xml version="1.0" encoding="UTF-8"?>
342
+ </svg>`,fg=`<?xml version="1.0" encoding="UTF-8"?>
343
343
  <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">
344
344
  <title>permalink</title>
345
345
  <g id="permalink" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -347,7 +347,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
347
347
  <line x1="12.5" y1="9" x2="12.5" y2="15" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square" transform="translate(12.500000, 12.000000) rotate(45.000000) translate(-12.500000, -12.000000) "></line>
348
348
  <path d="M17,13 L17,16.5 C17,18.9852814 14.9852814,21 12.5,21 C10.0147186,21 8,18.9852814 8,16.5 L8,13 L10,13 L10,16.5 C10,17.8807119 11.1192881,19 12.5,19 C13.8254834,19 14.9100387,17.9684641 14.9946823,16.6643757 L15,16.5 L15,13 L17,13 Z M12.5,3 C14.9852814,3 17,5.01471863 17,7.5 L17,11 L15,11 L15,7.5 C15,6.11928813 13.8807119,5 12.5,5 C11.1745166,5 10.0899613,6.03153594 10.0053177,7.33562431 L10,7.5 L10,11 L8,11 L8,7.5 C8,5.01471863 10.0147186,3 12.5,3 Z" id="Combined-Shape" fill="#FFFFFF" transform="translate(12.500000, 12.000000) rotate(45.000000) translate(-12.500000, -12.000000) "></path>
349
349
  </g>
350
- </svg>`,fg=`<?xml version="1.0" encoding="UTF-8"?>
350
+ </svg>`,hg=`<?xml version="1.0" encoding="UTF-8"?>
351
351
  <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">
352
352
  <title>play</title>
353
353
  <g id="play" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -358,7 +358,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
358
358
  <polygon id="Triangle" fill="#FFFFFF" class="st0" transform="translate(13.000000, 11.500000) rotate(-270.000000) translate(-13.000000, -11.500000) " points="13 8 19 15 7 15"></polygon>
359
359
  </g>
360
360
  </g>
361
- </svg>`,hg=`<?xml version="1.0" encoding="UTF-8"?>
361
+ </svg>`,pg=`<?xml version="1.0" encoding="UTF-8"?>
362
362
  <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">
363
363
  <title>resetZoom</title>
364
364
  <g id="resetZoom" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -376,7 +376,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
376
376
  </g>
377
377
  </g>
378
378
  </g>
379
- </svg>`,pg=`<?xml version="1.0" encoding="UTF-8"?>
379
+ </svg>`,vg=`<?xml version="1.0" encoding="UTF-8"?>
380
380
  <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">
381
381
  <title>singlepanel</title>
382
382
  <g id="singlepanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -390,7 +390,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
390
390
  <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
391
391
  </g>
392
392
  </g>
393
- </svg>`,vg=`<?xml version="1.0" encoding="UTF-8"?>
393
+ </svg>`,gg=`<?xml version="1.0" encoding="UTF-8"?>
394
394
  <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">
395
395
  <title>tooltips</title>
396
396
  <g id="tooltips" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -402,7 +402,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
402
402
  </text>
403
403
  </g>
404
404
  </g>
405
- </svg>`,gg=`<?xml version="1.0" encoding="UTF-8"?>
405
+ </svg>`,mg=`<?xml version="1.0" encoding="UTF-8"?>
406
406
  <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">
407
407
  <title>undock</title>
408
408
  <g id="undock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -422,7 +422,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
422
422
  </g>
423
423
  </g>
424
424
  </g>
425
- </svg>`,mg=`<?xml version="1.0" encoding="UTF-8"?>
425
+ </svg>`,yg=`<?xml version="1.0" encoding="UTF-8"?>
426
426
  <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">
427
427
  <title>zoomIn</title>
428
428
  <g id="zoomIn" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -438,7 +438,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
438
438
  <line x1="9" y1="9.5" x2="12" y2="9.5" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square" transform="translate(10.500000, 9.500000) rotate(90.000000) translate(-10.500000, -9.500000) "></line>
439
439
  </g>
440
440
  </g>
441
- </svg>`,yg=`<?xml version="1.0" encoding="UTF-8"?>
441
+ </svg>`,bg=`<?xml version="1.0" encoding="UTF-8"?>
442
442
  <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">
443
443
  <title>zoomOut</title>
444
444
  <g id="zoomOut" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -453,6 +453,6 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
453
453
  <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>
454
454
  </g>
455
455
  </g>
456
- </svg>`,bg=(t,e,r,n)=>{const a=["title","desc","defs","style"],i=["width","height"],s=n||[];let l=document.createElement("div");l.innerHTML=t,a.map(u=>{const d=l.querySelector(u);d&&d.remove()}),i.map(u=>{l.querySelector("svg").removeAttribute(u)}),n&&s.map(u=>{Object.values(l.querySelectorAll(`[${u}]`)).map(d=>{d.removeAttribute(u)})});const c=l.innerHTML;return l=null,c},wg=t=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((e,r)=>"".replace.apply(e,r),t).trim(),Q3=!0,J3=!0,eP=["fill"],Vc=Object.assign({"/assets/icons/2horpanel.svg":$v,"/assets/icons/2vertpanel.svg":zv,"/assets/icons/3panel.svg":Hv,"/assets/icons/4panel.svg":Kv,"/assets/icons/5panel.svg":qv,"/assets/icons/6panel.svg":Uv,"/assets/icons/6panelVertical.svg":Gv,"/assets/icons/changeBckgd.svg":Wv,"/assets/icons/close-no-bk.svg":jv,"/assets/icons/close.svg":Yv,"/assets/icons/closeFullScreen.svg":Zv,"/assets/icons/comment.svg":Xv,"/assets/icons/connection.svg":Qv,"/assets/icons/dock.svg":Jv,"/assets/icons/drawLine.svg":eg,"/assets/icons/drawPoint.svg":tg,"/assets/icons/drawPolygon.svg":rg,"/assets/icons/drawTrash.svg":ng,"/assets/icons/fitWindow.svg":ag,"/assets/icons/fullScreen.svg":ig,"/assets/icons/help.svg":og,"/assets/icons/magnifyingGlass.svg":sg,"/assets/icons/noun-filter.svg":lg,"/assets/icons/openMap.svg":cg,"/assets/icons/pause.svg":ug,"/assets/icons/permalink.svg":dg,"/assets/icons/play.svg":fg,"/assets/icons/resetZoom.svg":hg,"/assets/icons/singlepanel.svg":pg,"/assets/icons/tooltips.svg":vg,"/assets/icons/undock.svg":gg,"/assets/icons/zoomIn.svg":mg,"/assets/icons/zoomOut.svg":yg});Object.keys(Vc).map(t=>{const e=bg(Vc[t],Q3,J3,eP),r=t.replace(/^.+\/(\w+).svg$/,"$1");return wg(e).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}).join(`
457
- `);const Rc=Object.assign({"/assets/icons/2horpanel.svg":$v,"/assets/icons/2vertpanel.svg":zv,"/assets/icons/3panel.svg":Hv,"/assets/icons/4panel.svg":Kv,"/assets/icons/5panel.svg":qv,"/assets/icons/6panel.svg":Uv,"/assets/icons/6panelVertical.svg":Gv,"/assets/icons/changeBckgd.svg":Wv,"/assets/icons/close-no-bk.svg":jv,"/assets/icons/close.svg":Yv,"/assets/icons/closeFullScreen.svg":Zv,"/assets/icons/comment.svg":Xv,"/assets/icons/connection.svg":Qv,"/assets/icons/dock.svg":Jv,"/assets/icons/drawLine.svg":eg,"/assets/icons/drawPoint.svg":tg,"/assets/icons/drawPolygon.svg":rg,"/assets/icons/drawTrash.svg":ng,"/assets/icons/fitWindow.svg":ag,"/assets/icons/fullScreen.svg":ig,"/assets/icons/help.svg":og,"/assets/icons/magnifyingGlass.svg":sg,"/assets/icons/noun-filter.svg":lg,"/assets/icons/openMap.svg":cg,"/assets/icons/pause.svg":ug,"/assets/icons/permalink.svg":dg,"/assets/icons/play.svg":fg,"/assets/icons/resetZoom.svg":hg,"/assets/icons/singlepanel.svg":pg,"/assets/icons/tooltips.svg":vg,"/assets/icons/undock.svg":gg,"/assets/icons/zoomIn.svg":mg,"/assets/icons/zoomOut.svg":yg}),tP=Object.keys(Rc).map(t=>{const e=bg(Rc[t]),r=t.replace(/^.+\/(\w+).svg$/,"$1");return wg(e).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}),rP={name:"MapSvgSpriteColor",svgContext:Rc,svgSprite:tP.join(`
458
- `)},nP=["innerHTML"];function aP(t,e,r,n,a,i){return o.openBlock(),o.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:t.$options.svgSprite},null,8,nP)}const iP=Rv(rP,[["render",aP]]),oP=(t,e)=>{let r,n,a,i,s,l;e.style.left="",e.style.top="",e.addEventListener("mousedown",u=>{u.preventDefault(),r=e.offsetLeft,n=e.offsetTop,a=u.clientX,i=u.clientY,e.addEventListener("mousemove",c,!1),document.addEventListener("mouseup",()=>{e.removeEventListener("mousemove",c,!1)},!1)},!1);function c(u){u.preventDefault(),s=r-(a-u.clientX),l=n-(i-u.clientY),e.style.left=`${s}px`,e.style.top=`${l}px`}},sP={name:"DrawToolbar",components:{MapSvgIcon:X3,MapSvgSpriteColor:iP},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},{name:"Delete",active:!1,disabled:!1},{name:"Point",active:!1,disabled:!1},{name:"LineString",active:!1,disabled:!1},{name:"Polygon",active:!1,disabled:!1},{name:"Connection",active:!1,disabled:!0}],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),t==="Delete"&&(this.connectionDisplay=!1)},activeDrawTool:function(t){this.updateToolbarIcons(t),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){this.toolbarIcons.map(e=>{e.name===t?e.active=!0:e.active=!1}),this.toolbarIcons.filter(e=>e.name!=="Connection"&&e.name!==t).map(e=>{t?e.disabled=!0:e.disabled=!1}),this.toolbarCssHacks()},disabledToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.name==="Connection").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.name==="Connection").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");oP(this.mapCanvas.containerHTML,t);let e,r;const n=this.mapCanvas.containerHTML.getBoundingClientRect(),a=t.getBoundingClientRect();this.dialogPosition.x>n.width/2?e=this.dialogPosition.x-a.width:e=this.dialogPosition.x,this.dialogPosition.y>n.height/2?r=this.dialogPosition.y-a.height:r=this.dialogPosition.y,t.style.transform=`translate(${e-this.dialogPosition.offsetX}px, ${r-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)}},lP={class:"toolbar-container"},cP={class:"toolbar-icons"};function uP(t,e,r,n,a,i){const s=o.resolveComponent("map-svg-sprite-color"),l=o.resolveComponent("map-svg-icon"),c=Ol,u=j3;return o.openBlock(),o.createElementBlock("div",lP,[o.createVNode(s),o.createElementVNode("div",cP,[i.showEditModeIcon?(o.openBlock(),o.createBlock(c,{key:0,content:"Edit Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.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(c,{key:1,content:"Delete Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.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(c,{key:2,content:"Draw Point",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.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(c,{key:3,content:"Draw LineString",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.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(c,{key:4,content:"Draw Polygon",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.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(c,{key:5,content:"Connectivity",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.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)]),r.mapCanvas?o.withDirectives((o.openBlock(),o.createBlock(u,{key:0,class:"connection-dialog",connectionEntry:r.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 dP=lr(sP,[["render",uP],["__scopeId","data-v-6ac1a744"]]),fP={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"),r=t.querySelector(".flatmap-popup-popper"),n=((i=r==null?void 0:r.style)==null?void 0:i.transform)||"",a=this.extractMarkerPosition(n);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 r=e.classList.contains("flatmap-popper"),n=e.classList.contains("el-fade-in-linear-enter-active");(r||n)&&this.toggleHighlight(e)})})},toggleHighlight:function(t){const e=(t==null?void 0:t.id)||"",r=document.querySelector(`[aria-describedby="${e}"]`);r&&r.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 r;const t=this.flatmapRef||((r=this.multiflatmapRef)==null?void 0:r.getCurrentFlatmap());return(t==null?void 0:t.$el)||null},toggleHelpModeHighlight:function(t){const e=this.getCurrentMultiflatmap(),r=this.getCurrentFlatmap(),n=this.getCurrentScaffold(),a=document.querySelectorAll(".in-help-highlight");e&&(t?e.classList.add("in-help"):e.classList.remove("in-help")),r&&(t?r.classList.add("in-help"):r.classList.remove("in-help")),n&&(t?n.classList.add("in-help"):n.classList.remove("in-help")),t||a.forEach(i=>{i.classList.remove("in-help-highlight")})},extractMarkerPosition:function(t){const e=/translate\((.*?)\)/g,r=t.match(e);return r?r[r.length-1].slice(10,-1):""}}},$c=t=>(o.pushScopeId("data-v-3efb89fb"),t=t(),o.popScopeId(),t),hP=$c(()=>o.createElementVNode("h4",null,"Help Mode",-1)),pP=$c(()=>o.createElementVNode("p",null,[o.createTextVNode(" All caught up! "),o.createElementVNode("br"),o.createTextVNode(" Click 'Help' to restart. ")],-1)),vP=$c(()=>o.createElementVNode("p",null,'Click "Next" to see the next item.',-1));function gP(t,e,r,n,a,i){const s=sr;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["help-mode-dialog",{finish:r.lastItem}])},[hP,r.lastItem?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[pP,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},[vP,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 mP=lr(fP,[["render",gP],["__scopeId","data-v-3efb89fb"]]),yP="https://citation.crosscite.org",bP=[{label:"APA",value:"apa"},{label:"Chicago",value:"chicago-note-bibliography"},{label:"IEEE",value:"ieee"},{label:"Bibtex",value:"bibtex"}],Cg="apa",wP={name:"ExternalResourceCard",props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubMedReferences:[],openLibReferences:[],isbnDBReferences:[],citationOptions:bP,citationType:Cg}},watch:{resources:function(t){this.formatReferences([...t])}},computed:{referencesWithDOI:function(){return this.pubMedReferences.filter(e=>e.type==="doi"||e.doi).length}},mounted:function(){this.formatReferences([...this.resources]),this.getCitationText(Cg)},methods:{formatReferences:function(t){const e=this.extractNonPubMedReferences(t),r=t.filter(n=>!e.includes(n));this.pubMedReferences=r.map(n=>typeof n=="object"?this.extractPublicationIdFromURLString(n[0]):this.extractPublicationIdFromURLString(n)),this.pubMedReferences.forEach(n=>{if(n.type==="pmc"){const a=n.id;this.searchPMID(a).then(i=>{if(i&&i.esearchresult){const s=i.esearchresult.idlist||[];n.id=s[0],n.type="pmid"}})}}),this.formatNonPubMedReferences(e).then(n=>{this.openLibReferences=n.filter(a=>a.type==="openlib"),this.isbnDBReferences=n.filter(a=>a.type==="isbndb"),this.formatOpenLibReferences()})},extractNonPubMedReferences:function(t){const e=[],r=this.getPubMedDomains();return t.forEach(n=>{let a=0;r.forEach(i=>{n.includes(i)&&a++}),a||e.push(n)}),e},formatNonPubMedReferences:async function(t){const e=[],n=t.filter(c=>c.indexOf("isbn")!==-1).map(c=>"ISBN:"+c.split("/").pop()),a=n.join(","),i=n.slice(),s=`https://openlibrary.org/api/books?bibkeys=${a}&format=json`,l=await this.fetchData(s);for(const c in l){const u=i.indexOf(c);i.splice(u,1);const d=l[c].info_url,f=d.split("/"),p=f.indexOf("books"),v=f[p+1];e.push({id:c.split(":")[1],type:"openlib",url:d,bookId:v})}return i.forEach(c=>{const u=c.split(":")[1],d=`https://isbndb.com/book/${u}`;e.push({id:u,url:d,type:"isbndb"})}),e},extractPublicationIdFromURLString:function(t){if(!t)return;const e=decodeURIComponent(t);let r={id:"",type:"",citation:{}};return this.getPubMedDomains().forEach(a=>{const i=e.lastIndexOf(a);i!==-1&&(r.id=e.slice(i+a.length),a==="doi.org/"?r.type="doi":a==="pmc/articles/"?r.type="pmc":r.type="pmid")}),r.id===""&&(t.includes("doi:")?(r.id=this.stripPMIDPrefix(t),r.type="doi"):t.includes("PMID:")&&(r.id=this.stripPMIDPrefix(t),r.type="pmid")),r.id.endsWith("/")&&(r.id=r.id.slice(0,-1)),r},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)},getCitationText:function(t){this.pubMedReferences.forEach(e=>{const{id:r,type:n,doi:a}=e;if(!(e.citation&&e.citation[t])&&r)if(e.citation[t]="",n==="doi"||a){const i=n==="doi"?r:a;this.getCitationTextByDOI(i).then(s=>{const l=this.replaceLinkInText(s);e.citation[t]=l,this.updateCopyContents()})}else n==="pmid"&&this.getDOIFromPubMedID(r).then(i=>{if(i!=null&&i.result){const s=i.result[r],c=((s==null?void 0:s.articleids)||[]).find(d=>d.idtype==="doi"),u=c==null?void 0:c.value;if(u)e.doi=u,this.getCitationTextByDOI(u).then(d=>{const f=this.replaceLinkInText(d);e.citation[t]=f,this.updateCopyContents()});else{const{title:d,pubdate:f,authors:p}=s,v=p?p.map(g=>g.name):[],h=this.formatCopyReference({title:d||"",date:f||"",authors:v,url:`https://pubmed.ncbi.nlm.nih.gov/${r}`});e.citation[t]=h,this.updateCopyContents()}}})})},updateCopyContents:function(){const t=this.citationOptions.find(n=>n.value===this.citationType);let e="";const r=[];this.referencesWithDOI&&(e=t==null?void 0:t.label),this.pubMedReferences.forEach(n=>{r.push(n.citation[this.citationType])}),this.openLibReferences.forEach(n=>{r.push(this.formatCopyReference(n))}),this.isbnDBReferences.forEach(n=>{r.push(n.url)}),this.$emit("references-loaded",{style:e,list:r})},replaceLinkInText:function(t){const e="https://";let r=t.split(e)[1];if(r){r=r.split(" ")[0],r=r.trim(),r.endsWith(".")&&(r=r.substring(0,r.length-1));const n=e+r,a=`<a href="${n}" target="_blank">${n}</a>`;return t.replace(n,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=`${yP}/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(r=>{const{title:n,authors:a,publish_date:i}=r;n&&(t.title=n),i&&(t.date=i),a&&(t.authors=[],a.forEach(s=>{this.getBookAuthor(s.key).then(l=>{const{name:c}=l;c&&(t.authors.push(c),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:r,date:n,authors:a,url:i}=t;return r&&e.push(r),n&&e.push(`(${n})`),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 r=await fetch(t);if(!r.ok)throw new Error(`Response status: ${r.status}`);return e==="text"?await r.text():await r.json()}catch(r){console.error(`Fetch data error: ${r}`)}}}},CP=t=>(o.pushScopeId("data-v-9f85ed44"),t=t(),o.popScopeId(),t),kP={class:"resource-container"},xP=CP(()=>o.createElementVNode("div",{class:"attribute-title-container"},[o.createElementVNode("div",{class:"attribute-title"},"References")],-1)),EP={key:0,class:"citation-tabs"},SP={class:"citation-list"},TP=["innerHTML"],BP=["innerHTML"],NP=["href"];function DP(t,e,r,n,a,i){const s=sr,l=Vv;return o.openBlock(),o.createElementBlock("div",kP,[xP,i.referencesWithDOI?(o.openBlock(),o.createElementBlock("div",EP,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.citationOptions,c=>(o.openBlock(),o.createBlock(s,{link:"",key:c.value,type:t.citationType===c.value?"primary":"",onClick:u=>i.onCitationFormatChange(c.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(c.label),1)]),_:2},1032,["type","onClick"]))),128))])):o.createCommentVNode("",!0),o.createElementVNode("ul",SP,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.pubMedReferences,c=>(o.openBlock(),o.createElementBlock("li",{key:c.id,class:o.normalizeClass({loading:c.citation&&c.citation[t.citationType]===""})},[c.citation&&c.citation[t.citationType]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",{innerHTML:c.citation[t.citationType]},null,8,TP),o.createVNode(l,{content:c.citation[t.citationType]},null,8,["content"])],64)):o.createCommentVNode("",!0)],2))),128)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.openLibReferences,c=>(o.openBlock(),o.createElementBlock("li",null,[o.createElementVNode("div",{innerHTML:i.formatCopyReference(c)},null,8,BP),o.createVNode(l,{content:i.formatCopyReference(c)},null,8,["content"])]))),256)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.isbnDBReferences,c=>(o.openBlock(),o.createElementBlock("li",null,[o.createElementVNode("a",{href:c.url,target:"_blank"},o.toDisplayString(c.url),9,NP),o.createVNode(l,{content:c.url},null,8,["content"])]))),256))])])}const kg=lr(wP,[["render",DP],["__scopeId","data-v-9f85ed44"]]);function PP(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(a){a(r)}),(n=t.get("*"))&&n.slice().map(function(a){a(e,r)})}}}const Bs=new PP,_P=t=>t.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()),OP=function(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},IP={name:"ProvenancePopup",props:{tooltipEntry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})}},inject:["getFeaturesAlert"],data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,showToolip:!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"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 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}},methods:{titleCase:function(t){return _P(t)},capitalise:function(t){return OP(t)},openUrl:function(t){window.open(t,"_blank")},openAll:function(){Bs.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.componentsWithDatasets.map(t=>t.name)})},openAxons:function(){Bs.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.destinationsWithDatasets.map(t=>t.name)})},openDendrites:function(){Bs.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.originsWithDatasets.map(t=>t.name)})},pubmedSearchUrlUpdate:function(t){this.pubmedSearchUrl=t}}},$a=t=>(o.pushScopeId("data-v-3d217adc"),t=t(),o.popScopeId(),t),LP={key:0,class:"main"},MP={key:0,class:"block"},FP={class:"title"},AP={key:0,class:"subtitle"},VP={key:1,class:"block"},RP={class:"title"},$P={key:2,class:"attribute-title-container"},zP=$a(()=>o.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),HP={style:{"word-break":"keep-all"}},KP={class:"content-container scrollbar"},qP={key:0,class:"block"},UP={class:"attribute-title-container"},GP=$a(()=>o.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),WP={style:{"word-break":"keep-all"}},jP=$a(()=>o.createElementVNode("i",null,"Origin",-1)),YP=["origin-item-label"],ZP={key:0,class:"separator"},XP={key:1,class:"block"},QP=$a(()=>o.createElementVNode("div",{class:"attribute-title-container"},[o.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),JP=["component-item-label"],e_={key:0,class:"separator"},t_={key:2,class:"block"},r_={class:"attribute-title-container"},n_=$a(()=>o.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),a_=$a(()=>o.createElementVNode("span",{style:{"word-break":"keep-all"}},[o.createElementVNode("i",null,"Destination"),o.createTextVNode(" is where the axons terminate ")],-1)),i_=["destination-item-label"],o_={key:0,class:"separator"};function s_(t,e,r,n,a,i){const s=yb,l=yt,c=Ol,u=Wu,d=so,f=sr,p=kg,v=Fl;return r.tooltipEntry?o.withDirectives((o.openBlock(),o.createElementBlock("div",LP,[r.tooltipEntry.title?(o.openBlock(),o.createElementBlock("div",MP,[o.createElementVNode("div",FP,o.toDisplayString(i.capitalise(r.tooltipEntry.title)),1),r.tooltipEntry.provenanceTaxonomyLabel&&r.tooltipEntry.provenanceTaxonomyLabel.length>0?(o.openBlock(),o.createElementBlock("div",AP,o.toDisplayString(i.provSpeciesDescription),1)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",VP,[o.createElementVNode("div",RP,o.toDisplayString(r.tooltipEntry.featureId),1)])),i.featuresAlert?(o.openBlock(),o.createElementBlock("div",$P,[zP,o.createVNode(c,{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",HP,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]=h=>t.showDetails=!1)},[o.createTextVNode(" Hide path information "),o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(u)]),_:1})],512),[[o.vShow,t.showDetails]]),o.withDirectives(o.createElementVNode("div",{class:"hide",id:"show-path-info",onClick:e[1]||(e[1]=h=>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",KP,[o.createTextVNode(o.toDisplayString(r.tooltipEntry.paths)+" ",1),r.tooltipEntry.origins&&r.tooltipEntry.origins.length>0?(o.openBlock(),o.createElementBlock("div",qP,[o.createElementVNode("div",UP,[GP,o.createVNode(c,{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",WP,[jP,o.createTextVNode(" "+o.toDisplayString(i.originDescription),1)])]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.tooltipEntry.origins,(h,g)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","origin-item-label":h,key:h},[o.createTextVNode(o.toDisplayString(i.capitalise(h))+" ",1),g!=r.tooltipEntry.origins.length-1?(o.openBlock(),o.createElementBlock("div",ZP)):o.createCommentVNode("",!0)],8,YP))),128)),o.withDirectives(o.createVNode(f,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:o.withCtx(()=>[o.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[o.vShow,r.tooltipEntry.originsWithDatasets&&r.tooltipEntry.originsWithDatasets.length>0]])])):o.createCommentVNode("",!0),r.tooltipEntry.components&&r.tooltipEntry.components.length>0?(o.openBlock(),o.createElementBlock("div",XP,[QP,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.tooltipEntry.components,(h,g)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","component-item-label":h,key:h},[o.createTextVNode(o.toDisplayString(i.capitalise(h))+" ",1),g!=r.tooltipEntry.components.length-1?(o.openBlock(),o.createElementBlock("div",e_)):o.createCommentVNode("",!0)],8,JP))),128))])):o.createCommentVNode("",!0),r.tooltipEntry.destinations&&r.tooltipEntry.destinations.length>0?(o.openBlock(),o.createElementBlock("div",t_,[o.createElementVNode("div",r_,[n_,o.createVNode(c,{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(()=>[a_]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.tooltipEntry.destinations,(h,g)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","destination-item-label":h,key:h},[o.createTextVNode(o.toDisplayString(i.capitalise(h))+" ",1),g!=r.tooltipEntry.destinations.length-1?(o.openBlock(),o.createElementBlock("div",o_)):o.createCommentVNode("",!0)],8,i_))),128)),o.withDirectives(o.createVNode(f,{class:"button",onClick:i.openAxons},{default:o.withCtx(()=>[o.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[o.vShow,r.tooltipEntry.destinationsWithDatasets&&r.tooltipEntry.destinationsWithDatasets.length>0]])])):o.createCommentVNode("",!0),o.withDirectives(o.createVNode(f,{class:"button",onClick:i.openAll},{default:o.withCtx(()=>[o.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[o.vShow,r.tooltipEntry.componentsWithDatasets&&r.tooltipEntry.componentsWithDatasets.length>0]]),i.resources.length?(o.openBlock(),o.createBlock(p,{key:3,resources:i.resources},null,8,["resources"])):o.createCommentVNode("",!0)],512),[[o.vShow,t.showDetails]])]),_:1})])),[[v,t.loading]]):o.createCommentVNode("",!0)}const l_=lr(IP,[["render",s_],["__scopeId","data-v-3d217adc"]]),c_={name:"Tooltip",props:{tooltipEntry:{type:Object},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Object}},mounted:function(){Bs.on("onActionClick",t=>{this.$emit("onActionClick",t)})}},u_={class:"tooltip-container",id:"tooltip-container"};function d_(t,e,r,n,a,i){const s=Mf,l=l_;return o.openBlock(),o.createElementBlock("div",u_,[r.annotationDisplay?(o.openBlock(),o.createBlock(s,{key:0,annotationEntry:r.annotationEntry,onAnnotation:e[0]||(e[0]=c=>t.$emit("annotation",c))},null,8,["annotationEntry"])):(o.openBlock(),o.createBlock(l,{key:1,tooltipEntry:r.tooltipEntry},null,8,["tooltipEntry"]))])}const f_=lr(c_,[["render",d_],["__scopeId","data-v-229b3988"]]),h_={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 r=e.checkedKeys.includes(t.key);t.key==="All"?this.$emit("checkAll",r):this.$emit("checkChanged",{key:t.key,value:r})}else this.isScaffold&&this.$emit("checkChanged",t,e)},displayTooltip:function(t,e,r){const a=r.target.closest(".el-tree-node__content"),i=a.clientWidth,s=a.getBoundingClientRect().x,l=a.querySelector(".lastChildInItem");let c=0;if(l){const d=l.getBoundingClientRect();c=d.x+d.width-s}const u=c>i;this.tooltipVisible=u&&e,this.tooltipLabel=t,this.tooltipAtBottom=.5>r.layerY/this.$refs.treeContainer.clientHeight}},unmounted:function(){this.sortedPrimitiveGroups=void 0},mounted:function(){this.$refs.regionTree&&this.$refs.regionTree.filter(this.filterText)}},p_={class:"selections-container"},v_={class:"title-text"},g_={class:"tree-container",ref:"treeContainer"},m_={class:"tooltip-text"},y_=["onClick","onMouseover","onMouseenter"],b_=["onClick","onMouseover","onMouseenter"],w_={class:"lastChildInItem"},C_={key:0,class:"node-options"};function k_(t,e,r,n,a,i){const s=ci,l=oi,c=To,u=Ol,d=ox,f=cE,p=Fl;return o.openBlock(),o.createElementBlock("div",p_,[r.title?(o.openBlock(),o.createBlock(c,{key:0},{default:o.withCtx(()=>[o.createVNode(s,{span:12},{default:o.withCtx(()=>[o.createElementVNode("div",v_,o.toDisplayString(r.title),1)]),_:1}),r.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 "+r.title},null,8,["modelValue","placeholder"])])]),_:1})):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0),o.createElementVNode("div",g_,[o.createElementVNode("div",{class:o.normalizeClass(["tree-tooltip",t.tooltipAtBottom?"bottom":""])},[o.createVNode(u,{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",m_,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:r.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([r.mapType==="flatmap"?"hide_grandchildren_checkbox":""])},{default:o.withCtx(({node:v,data:h})=>[r.mapType==="flatmap"?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["region-tree-node",{activeItem:i.nodeIsActive(h),hoverItem:i.nodeIsHover(h)}]),onClick:g=>i.changeActiveByNode(h),onMouseover:g=>i.changeHoverByNode(h,!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(h)),class:"lastChildInItem"},o.toDisplayString(v.label),5)],42,y_)):r.mapType==="scaffold"?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["region-tree-node",{activeItem:r.active.includes(h.id),hoverItem:r.hover.includes(h.id)}]),onClick:g=>i.changeActiveByNode(h,!0),onMouseover:g=>i.changeHoverByNode(h,!0,g),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[2]||(e[2]=g=>i.displayTooltip("",!1,g))},[h.isPrimitives?(o.openBlock(),o.createBlock(d,{key:0,class:o.normalizeClass({"show-picker":r.showColourPicker}),modelValue:h.activeColour,"onUpdate:modelValue":g=>h.activeColour=g,size:"small","popper-class":t.myPopperClass,onChange:g=>i.setColour(h,g)},null,8,["class","modelValue","onUpdate:modelValue","popper-class","onChange"])):o.createCommentVNode("",!0),o.createElementVNode("div",w_,[o.createElementVNode("span",null,o.toDisplayString(v.label),1),h.isTextureSlides?(o.openBlock(),o.createElementBlock("span",C_," (Texture) ")):o.createCommentVNode("",!0)])],42,b_)):o.createCommentVNode("",!0)]),_:1},8,["node-key","data","default-expanded-keys","onCheck","filter-node-method","class"])),[[p,!r.isReady]])],512)])}const x_=lr(h_,[["render",k_],["__scopeId","data-v-823a8388"]]);Re.AnnotationPopup=Mf,Re.ConnectivityGraph=M3,Re.CopyToClipboard=Vv,Re.CreateTooltipContent=PE,Re.DrawToolbar=dP,Re.ExternalResourceCard=kg,Re.HelpModeDialog=mP,Re.Tooltip=f_,Re.TreeControls=x_,Object.defineProperty(Re,Symbol.toStringTag,{value:"Module"})});
456
+ </svg>`,wg=(t,e,r,n)=>{const a=["title","desc","defs","style"],i=["width","height"],s=n||[];let l=document.createElement("div");l.innerHTML=t,a.map(u=>{const d=l.querySelector(u);d&&d.remove()}),i.map(u=>{l.querySelector("svg").removeAttribute(u)}),n&&s.map(u=>{Object.values(l.querySelectorAll(`[${u}]`)).map(d=>{d.removeAttribute(u)})});const c=l.innerHTML;return l=null,c},Cg=t=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((e,r)=>"".replace.apply(e,r),t).trim(),Q3=!0,J3=!0,eP=["fill"],Vc=Object.assign({"/assets/icons/2horpanel.svg":zv,"/assets/icons/2vertpanel.svg":Hv,"/assets/icons/3panel.svg":Kv,"/assets/icons/4panel.svg":qv,"/assets/icons/5panel.svg":Uv,"/assets/icons/6panel.svg":Gv,"/assets/icons/6panelVertical.svg":Wv,"/assets/icons/changeBckgd.svg":jv,"/assets/icons/close-no-bk.svg":Yv,"/assets/icons/close.svg":Zv,"/assets/icons/closeFullScreen.svg":Xv,"/assets/icons/comment.svg":Qv,"/assets/icons/connection.svg":Jv,"/assets/icons/dock.svg":eg,"/assets/icons/drawLine.svg":tg,"/assets/icons/drawPoint.svg":rg,"/assets/icons/drawPolygon.svg":ng,"/assets/icons/drawTrash.svg":ag,"/assets/icons/fitWindow.svg":ig,"/assets/icons/fullScreen.svg":og,"/assets/icons/help.svg":sg,"/assets/icons/magnifyingGlass.svg":lg,"/assets/icons/noun-filter.svg":cg,"/assets/icons/openMap.svg":ug,"/assets/icons/pause.svg":dg,"/assets/icons/permalink.svg":fg,"/assets/icons/play.svg":hg,"/assets/icons/resetZoom.svg":pg,"/assets/icons/singlepanel.svg":vg,"/assets/icons/tooltips.svg":gg,"/assets/icons/undock.svg":mg,"/assets/icons/zoomIn.svg":yg,"/assets/icons/zoomOut.svg":bg});Object.keys(Vc).map(t=>{const e=wg(Vc[t],Q3,J3,eP),r=t.replace(/^.+\/(\w+).svg$/,"$1");return Cg(e).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}).join(`
457
+ `);const Rc=Object.assign({"/assets/icons/2horpanel.svg":zv,"/assets/icons/2vertpanel.svg":Hv,"/assets/icons/3panel.svg":Kv,"/assets/icons/4panel.svg":qv,"/assets/icons/5panel.svg":Uv,"/assets/icons/6panel.svg":Gv,"/assets/icons/6panelVertical.svg":Wv,"/assets/icons/changeBckgd.svg":jv,"/assets/icons/close-no-bk.svg":Yv,"/assets/icons/close.svg":Zv,"/assets/icons/closeFullScreen.svg":Xv,"/assets/icons/comment.svg":Qv,"/assets/icons/connection.svg":Jv,"/assets/icons/dock.svg":eg,"/assets/icons/drawLine.svg":tg,"/assets/icons/drawPoint.svg":rg,"/assets/icons/drawPolygon.svg":ng,"/assets/icons/drawTrash.svg":ag,"/assets/icons/fitWindow.svg":ig,"/assets/icons/fullScreen.svg":og,"/assets/icons/help.svg":sg,"/assets/icons/magnifyingGlass.svg":lg,"/assets/icons/noun-filter.svg":cg,"/assets/icons/openMap.svg":ug,"/assets/icons/pause.svg":dg,"/assets/icons/permalink.svg":fg,"/assets/icons/play.svg":hg,"/assets/icons/resetZoom.svg":pg,"/assets/icons/singlepanel.svg":vg,"/assets/icons/tooltips.svg":gg,"/assets/icons/undock.svg":mg,"/assets/icons/zoomIn.svg":yg,"/assets/icons/zoomOut.svg":bg}),tP=Object.keys(Rc).map(t=>{const e=wg(Rc[t]),r=t.replace(/^.+\/(\w+).svg$/,"$1");return Cg(e).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}),rP={name:"MapSvgSpriteColor",svgContext:Rc,svgSprite:tP.join(`
458
+ `)},nP=["innerHTML"];function aP(t,e,r,n,a,i){return o.openBlock(),o.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:t.$options.svgSprite},null,8,nP)}const iP=$v(rP,[["render",aP]]),oP=(t,e)=>{let r,n,a,i,s,l;e.style.left="",e.style.top="",e.addEventListener("mousedown",u=>{u.preventDefault(),r=e.offsetLeft,n=e.offsetTop,a=u.clientX,i=u.clientY,e.addEventListener("mousemove",c,!1),document.addEventListener("mouseup",()=>{e.removeEventListener("mousemove",c,!1)},!1)},!1);function c(u){u.preventDefault(),s=r-(a-u.clientX),l=n-(i-u.clientY),e.style.left=`${s}px`,e.style.top=`${l}px`}},sP={name:"DrawToolbar",components:{MapSvgIcon:X3,MapSvgSpriteColor:iP},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},{name:"Delete",active:!1,disabled:!1},{name:"Point",active:!1,disabled:!1},{name:"LineString",active:!1,disabled:!1},{name:"Polygon",active:!1,disabled:!1},{name:"Connection",active:!1,disabled:!0}],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),t==="Delete"&&(this.connectionDisplay=!1)},activeDrawTool:function(t){this.updateToolbarIcons(t),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){this.toolbarIcons.map(e=>{e.name===t?e.active=!0:e.active=!1}),this.toolbarIcons.filter(e=>e.name!=="Connection"&&e.name!==t).map(e=>{t?e.disabled=!0:e.disabled=!1}),this.toolbarCssHacks()},disabledToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.name==="Connection").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.name==="Connection").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");oP(this.mapCanvas.containerHTML,t);let e,r;const n=this.mapCanvas.containerHTML.getBoundingClientRect(),a=t.getBoundingClientRect();this.dialogPosition.x>n.width/2?e=this.dialogPosition.x-a.width:e=this.dialogPosition.x,this.dialogPosition.y>n.height/2?r=this.dialogPosition.y-a.height:r=this.dialogPosition.y,t.style.transform=`translate(${e-this.dialogPosition.offsetX}px, ${r-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)}},lP={class:"toolbar-container"},cP={class:"toolbar-icons"};function uP(t,e,r,n,a,i){const s=o.resolveComponent("map-svg-sprite-color"),l=o.resolveComponent("map-svg-icon"),c=Ol,u=j3;return o.openBlock(),o.createElementBlock("div",lP,[o.createVNode(s),o.createElementVNode("div",cP,[i.showEditModeIcon?(o.openBlock(),o.createBlock(c,{key:0,content:"Edit Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.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(c,{key:1,content:"Delete Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.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(c,{key:2,content:"Draw Point",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.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(c,{key:3,content:"Draw LineString",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.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(c,{key:4,content:"Draw Polygon",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.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(c,{key:5,content:"Connectivity",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.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)]),r.mapCanvas?o.withDirectives((o.openBlock(),o.createBlock(u,{key:0,class:"connection-dialog",connectionEntry:r.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 dP=lr(sP,[["render",uP],["__scopeId","data-v-6ac1a744"]]),fP={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"),r=t.querySelector(".flatmap-popup-popper"),n=((i=r==null?void 0:r.style)==null?void 0:i.transform)||"",a=this.extractMarkerPosition(n);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 r=e.classList.contains("flatmap-popper"),n=e.classList.contains("el-fade-in-linear-enter-active");(r||n)&&this.toggleHighlight(e)})})},toggleHighlight:function(t){const e=(t==null?void 0:t.id)||"",r=document.querySelector(`[aria-describedby="${e}"]`);r&&r.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 r;const t=this.flatmapRef||((r=this.multiflatmapRef)==null?void 0:r.getCurrentFlatmap());return(t==null?void 0:t.$el)||null},toggleHelpModeHighlight:function(t){const e=this.getCurrentMultiflatmap(),r=this.getCurrentFlatmap(),n=this.getCurrentScaffold(),a=document.querySelectorAll(".in-help-highlight");e&&(t?e.classList.add("in-help"):e.classList.remove("in-help")),r&&(t?r.classList.add("in-help"):r.classList.remove("in-help")),n&&(t?n.classList.add("in-help"):n.classList.remove("in-help")),t||a.forEach(i=>{i.classList.remove("in-help-highlight")})},extractMarkerPosition:function(t){const e=/translate\((.*?)\)/g,r=t.match(e);return r?r[r.length-1].slice(10,-1):""}}},$c=t=>(o.pushScopeId("data-v-3efb89fb"),t=t(),o.popScopeId(),t),hP=$c(()=>o.createElementVNode("h4",null,"Help Mode",-1)),pP=$c(()=>o.createElementVNode("p",null,[o.createTextVNode(" All caught up! "),o.createElementVNode("br"),o.createTextVNode(" Click 'Help' to restart. ")],-1)),vP=$c(()=>o.createElementVNode("p",null,'Click "Next" to see the next item.',-1));function gP(t,e,r,n,a,i){const s=sr;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["help-mode-dialog",{finish:r.lastItem}])},[hP,r.lastItem?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[pP,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},[vP,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 mP=lr(fP,[["render",gP],["__scopeId","data-v-3efb89fb"]]),yP="https://citation.crosscite.org",bP=[{label:"APA",value:"apa"},{label:"Chicago",value:"chicago-note-bibliography"},{label:"IEEE",value:"ieee"},{label:"Bibtex",value:"bibtex"}],zc="apa",wP={name:"ExternalResourceCard",props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubMedReferences:[],openLibReferences:[],isbnDBReferences:[],citationOptions:bP,citationType:zc}},watch:{resources:function(t){this.formatReferences([...t]),this.getCitationText(zc)}},computed:{referencesWithDOI:function(){return this.pubMedReferences.filter(e=>e.type==="doi"||e.doi).length}},mounted:function(){this.formatReferences([...this.resources]),this.getCitationText(zc)},methods:{formatReferences:function(t){const e=this.extractNonPubMedReferences(t),r=t.filter(n=>!e.includes(n));this.pubMedReferences=r.map(n=>typeof n=="object"?this.extractPublicationIdFromURLString(n[0]):this.extractPublicationIdFromURLString(n)),this.pubMedReferences.forEach(n=>{if(n.type==="pmc"){const a=n.id;this.searchPMID(a).then(i=>{if(i&&i.esearchresult){const s=i.esearchresult.idlist||[];n.id=s[0],n.type="pmid"}})}}),this.formatNonPubMedReferences(e).then(n=>{this.openLibReferences=n.filter(a=>a.type==="openlib"),this.isbnDBReferences=n.filter(a=>a.type==="isbndb"),this.formatOpenLibReferences()})},extractNonPubMedReferences:function(t){const e=[],r=this.getPubMedDomains();return t.forEach(n=>{let a=0;r.forEach(i=>{n.includes(i)&&a++}),a||e.push(n)}),e},formatNonPubMedReferences:async function(t){const e=[],n=t.filter(c=>c.indexOf("isbn")!==-1).map(c=>"ISBN:"+c.split("/").pop()),a=n.join(","),i=n.slice(),s=`https://openlibrary.org/api/books?bibkeys=${a}&format=json`,l=await this.fetchData(s);for(const c in l){const u=i.indexOf(c);i.splice(u,1);const d=l[c].info_url,f=d.split("/"),p=f.indexOf("books"),v=f[p+1];e.push({id:c.split(":")[1],type:"openlib",url:d,bookId:v})}return i.forEach(c=>{const u=c.split(":")[1],d=`https://isbndb.com/book/${u}`;e.push({id:u,url:d,type:"isbndb"})}),e},extractPublicationIdFromURLString:function(t){if(!t)return;const e=decodeURIComponent(t);let r={id:"",type:"",citation:{}};return this.getPubMedDomains().forEach(a=>{const i=e.lastIndexOf(a);i!==-1&&(r.id=e.slice(i+a.length),a==="doi.org/"?r.type="doi":a==="pmc/articles/"?r.type="pmc":r.type="pmid")}),r.id===""&&(t.includes("doi:")?(r.id=this.stripPMIDPrefix(t),r.type="doi"):t.includes("PMID:")&&(r.id=this.stripPMIDPrefix(t),r.type="pmid")),r.id.endsWith("/")&&(r.id=r.id.slice(0,-1)),r},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)},getCitationText:function(t){this.pubMedReferences.forEach(e=>{const{id:r,type:n,doi:a}=e;if(!(e.citation&&e.citation[t])&&r)if(e.citation[t]="",n==="doi"||a){const i=n==="doi"?r:a;this.getCitationTextByDOI(i).then(s=>{const l=this.replaceLinkInText(s);e.citation[t]=l,this.updateCopyContents()})}else n==="pmid"&&this.getDOIFromPubMedID(r).then(i=>{if(i!=null&&i.result){const s=i.result[r],c=((s==null?void 0:s.articleids)||[]).find(d=>d.idtype==="doi"),u=c==null?void 0:c.value;if(u)e.doi=u,this.getCitationTextByDOI(u).then(d=>{const f=this.replaceLinkInText(d);e.citation[t]=f,this.updateCopyContents()});else{const{title:d,pubdate:f,authors:p}=s,v=p?p.map(g=>g.name):[],h=this.formatCopyReference({title:d||"",date:f||"",authors:v,url:`https://pubmed.ncbi.nlm.nih.gov/${r}`});e.citation[t]=h,this.updateCopyContents()}}})})},updateCopyContents:function(){const t=this.citationOptions.find(n=>n.value===this.citationType);let e="";const r=[];this.referencesWithDOI&&(e=t==null?void 0:t.label),this.pubMedReferences.forEach(n=>{r.push(n.citation[this.citationType])}),this.openLibReferences.forEach(n=>{r.push(this.formatCopyReference(n))}),this.isbnDBReferences.forEach(n=>{r.push(n.url)}),this.$emit("references-loaded",{style:e,list:r})},replaceLinkInText:function(t){const e="https://";let r=t.split(e)[1];if(r){r=r.split(" ")[0],r=r.trim(),r.endsWith(".")&&(r=r.substring(0,r.length-1));const n=e+r,a=`<a href="${n}" target="_blank">${n}</a>`;return t.replace(n,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=`${yP}/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(r=>{const{title:n,authors:a,publish_date:i}=r;n&&(t.title=n),i&&(t.date=i),a&&(t.authors=[],a.forEach(s=>{this.getBookAuthor(s.key).then(l=>{const{name:c}=l;c&&(t.authors.push(c),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:r,date:n,authors:a,url:i}=t;return r&&e.push(r),n&&e.push(`(${n})`),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 r=await fetch(t);if(!r.ok)throw new Error(`Response status: ${r.status}`);return e==="text"?await r.text():await r.json()}catch(r){console.error(`Fetch data error: ${r}`)}}}},CP=t=>(o.pushScopeId("data-v-c36f648b"),t=t(),o.popScopeId(),t),kP={class:"resource-container"},xP=CP(()=>o.createElementVNode("div",{class:"attribute-title-container"},[o.createElementVNode("div",{class:"attribute-title"},"References")],-1)),EP={key:0,class:"citation-tabs"},SP={class:"citation-list"},TP=["innerHTML"],BP=["innerHTML"],NP=["href"];function DP(t,e,r,n,a,i){const s=sr,l=Rv;return o.openBlock(),o.createElementBlock("div",kP,[xP,i.referencesWithDOI?(o.openBlock(),o.createElementBlock("div",EP,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.citationOptions,c=>(o.openBlock(),o.createBlock(s,{link:"",key:c.value,type:t.citationType===c.value?"primary":"",onClick:u=>i.onCitationFormatChange(c.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(c.label),1)]),_:2},1032,["type","onClick"]))),128))])):o.createCommentVNode("",!0),o.createElementVNode("ul",SP,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.pubMedReferences,c=>(o.openBlock(),o.createElementBlock("li",{key:c.id,class:o.normalizeClass({loading:c.citation&&c.citation[t.citationType]===""})},[c.citation&&c.citation[t.citationType]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",{innerHTML:c.citation[t.citationType]},null,8,TP),o.createVNode(l,{content:c.citation[t.citationType]},null,8,["content"])],64)):o.createCommentVNode("",!0)],2))),128)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.openLibReferences,c=>(o.openBlock(),o.createElementBlock("li",null,[o.createElementVNode("div",{innerHTML:i.formatCopyReference(c)},null,8,BP),o.createVNode(l,{content:i.formatCopyReference(c)},null,8,["content"])]))),256)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.isbnDBReferences,c=>(o.openBlock(),o.createElementBlock("li",null,[o.createElementVNode("a",{href:c.url,target:"_blank"},o.toDisplayString(c.url),9,NP),o.createVNode(l,{content:c.url},null,8,["content"])]))),256))])])}const kg=lr(wP,[["render",DP],["__scopeId","data-v-c36f648b"]]);function PP(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(a){a(r)}),(n=t.get("*"))&&n.slice().map(function(a){a(e,r)})}}}const Bs=new PP,_P=t=>t.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()),OP=function(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},IP={name:"ProvenancePopup",props:{tooltipEntry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})}},inject:["getFeaturesAlert"],data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,showToolip:!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"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 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}},methods:{titleCase:function(t){return _P(t)},capitalise:function(t){return OP(t)},openUrl:function(t){window.open(t,"_blank")},openAll:function(){Bs.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.componentsWithDatasets.map(t=>t.name)})},openAxons:function(){Bs.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.destinationsWithDatasets.map(t=>t.name)})},openDendrites:function(){Bs.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.originsWithDatasets.map(t=>t.name)})},pubmedSearchUrlUpdate:function(t){this.pubmedSearchUrl=t}}},$a=t=>(o.pushScopeId("data-v-3d217adc"),t=t(),o.popScopeId(),t),LP={key:0,class:"main"},MP={key:0,class:"block"},FP={class:"title"},AP={key:0,class:"subtitle"},VP={key:1,class:"block"},RP={class:"title"},$P={key:2,class:"attribute-title-container"},zP=$a(()=>o.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),HP={style:{"word-break":"keep-all"}},KP={class:"content-container scrollbar"},qP={key:0,class:"block"},UP={class:"attribute-title-container"},GP=$a(()=>o.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),WP={style:{"word-break":"keep-all"}},jP=$a(()=>o.createElementVNode("i",null,"Origin",-1)),YP=["origin-item-label"],ZP={key:0,class:"separator"},XP={key:1,class:"block"},QP=$a(()=>o.createElementVNode("div",{class:"attribute-title-container"},[o.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),JP=["component-item-label"],e_={key:0,class:"separator"},t_={key:2,class:"block"},r_={class:"attribute-title-container"},n_=$a(()=>o.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),a_=$a(()=>o.createElementVNode("span",{style:{"word-break":"keep-all"}},[o.createElementVNode("i",null,"Destination"),o.createTextVNode(" is where the axons terminate ")],-1)),i_=["destination-item-label"],o_={key:0,class:"separator"};function s_(t,e,r,n,a,i){const s=yb,l=yt,c=Ol,u=ju,d=so,f=sr,p=kg,v=Fl;return r.tooltipEntry?o.withDirectives((o.openBlock(),o.createElementBlock("div",LP,[r.tooltipEntry.title?(o.openBlock(),o.createElementBlock("div",MP,[o.createElementVNode("div",FP,o.toDisplayString(i.capitalise(r.tooltipEntry.title)),1),r.tooltipEntry.provenanceTaxonomyLabel&&r.tooltipEntry.provenanceTaxonomyLabel.length>0?(o.openBlock(),o.createElementBlock("div",AP,o.toDisplayString(i.provSpeciesDescription),1)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",VP,[o.createElementVNode("div",RP,o.toDisplayString(r.tooltipEntry.featureId),1)])),i.featuresAlert?(o.openBlock(),o.createElementBlock("div",$P,[zP,o.createVNode(c,{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",HP,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]=h=>t.showDetails=!1)},[o.createTextVNode(" Hide path information "),o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(u)]),_:1})],512),[[o.vShow,t.showDetails]]),o.withDirectives(o.createElementVNode("div",{class:"hide",id:"show-path-info",onClick:e[1]||(e[1]=h=>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",KP,[o.createTextVNode(o.toDisplayString(r.tooltipEntry.paths)+" ",1),r.tooltipEntry.origins&&r.tooltipEntry.origins.length>0?(o.openBlock(),o.createElementBlock("div",qP,[o.createElementVNode("div",UP,[GP,o.createVNode(c,{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",WP,[jP,o.createTextVNode(" "+o.toDisplayString(i.originDescription),1)])]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.tooltipEntry.origins,(h,g)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","origin-item-label":h,key:h},[o.createTextVNode(o.toDisplayString(i.capitalise(h))+" ",1),g!=r.tooltipEntry.origins.length-1?(o.openBlock(),o.createElementBlock("div",ZP)):o.createCommentVNode("",!0)],8,YP))),128)),o.withDirectives(o.createVNode(f,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:o.withCtx(()=>[o.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[o.vShow,r.tooltipEntry.originsWithDatasets&&r.tooltipEntry.originsWithDatasets.length>0]])])):o.createCommentVNode("",!0),r.tooltipEntry.components&&r.tooltipEntry.components.length>0?(o.openBlock(),o.createElementBlock("div",XP,[QP,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.tooltipEntry.components,(h,g)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","component-item-label":h,key:h},[o.createTextVNode(o.toDisplayString(i.capitalise(h))+" ",1),g!=r.tooltipEntry.components.length-1?(o.openBlock(),o.createElementBlock("div",e_)):o.createCommentVNode("",!0)],8,JP))),128))])):o.createCommentVNode("",!0),r.tooltipEntry.destinations&&r.tooltipEntry.destinations.length>0?(o.openBlock(),o.createElementBlock("div",t_,[o.createElementVNode("div",r_,[n_,o.createVNode(c,{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(()=>[a_]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.tooltipEntry.destinations,(h,g)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","destination-item-label":h,key:h},[o.createTextVNode(o.toDisplayString(i.capitalise(h))+" ",1),g!=r.tooltipEntry.destinations.length-1?(o.openBlock(),o.createElementBlock("div",o_)):o.createCommentVNode("",!0)],8,i_))),128)),o.withDirectives(o.createVNode(f,{class:"button",onClick:i.openAxons},{default:o.withCtx(()=>[o.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[o.vShow,r.tooltipEntry.destinationsWithDatasets&&r.tooltipEntry.destinationsWithDatasets.length>0]])])):o.createCommentVNode("",!0),o.withDirectives(o.createVNode(f,{class:"button",onClick:i.openAll},{default:o.withCtx(()=>[o.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[o.vShow,r.tooltipEntry.componentsWithDatasets&&r.tooltipEntry.componentsWithDatasets.length>0]]),i.resources.length?(o.openBlock(),o.createBlock(p,{key:3,resources:i.resources},null,8,["resources"])):o.createCommentVNode("",!0)],512),[[o.vShow,t.showDetails]])]),_:1})])),[[v,t.loading]]):o.createCommentVNode("",!0)}const l_=lr(IP,[["render",s_],["__scopeId","data-v-3d217adc"]]),c_={name:"Tooltip",props:{tooltipEntry:{type:Object},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Object}},mounted:function(){Bs.on("onActionClick",t=>{this.$emit("onActionClick",t)})}},u_={class:"tooltip-container",id:"tooltip-container"};function d_(t,e,r,n,a,i){const s=Ff,l=l_;return o.openBlock(),o.createElementBlock("div",u_,[r.annotationDisplay?(o.openBlock(),o.createBlock(s,{key:0,annotationEntry:r.annotationEntry,onAnnotation:e[0]||(e[0]=c=>t.$emit("annotation",c))},null,8,["annotationEntry"])):(o.openBlock(),o.createBlock(l,{key:1,tooltipEntry:r.tooltipEntry},null,8,["tooltipEntry"]))])}const f_=lr(c_,[["render",d_],["__scopeId","data-v-229b3988"]]),h_={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 r=e.checkedKeys.includes(t.key);t.key==="All"?this.$emit("checkAll",r):this.$emit("checkChanged",{key:t.key,value:r})}else this.isScaffold&&this.$emit("checkChanged",t,e)},displayTooltip:function(t,e,r){const a=r.target.closest(".el-tree-node__content"),i=a.clientWidth,s=a.getBoundingClientRect().x,l=a.querySelector(".lastChildInItem");let c=0;if(l){const d=l.getBoundingClientRect();c=d.x+d.width-s}const u=c>i;this.tooltipVisible=u&&e,this.tooltipLabel=t,this.tooltipAtBottom=.5>r.layerY/this.$refs.treeContainer.clientHeight}},unmounted:function(){this.sortedPrimitiveGroups=void 0},mounted:function(){this.$refs.regionTree&&this.$refs.regionTree.filter(this.filterText)}},p_={class:"selections-container"},v_={class:"title-text"},g_={class:"tree-container",ref:"treeContainer"},m_={class:"tooltip-text"},y_=["onClick","onMouseover","onMouseenter"],b_=["onClick","onMouseover","onMouseenter"],w_={class:"lastChildInItem"},C_={key:0,class:"node-options"};function k_(t,e,r,n,a,i){const s=ci,l=oi,c=To,u=Ol,d=ox,f=cE,p=Fl;return o.openBlock(),o.createElementBlock("div",p_,[r.title?(o.openBlock(),o.createBlock(c,{key:0},{default:o.withCtx(()=>[o.createVNode(s,{span:12},{default:o.withCtx(()=>[o.createElementVNode("div",v_,o.toDisplayString(r.title),1)]),_:1}),r.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 "+r.title},null,8,["modelValue","placeholder"])])]),_:1})):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0),o.createElementVNode("div",g_,[o.createElementVNode("div",{class:o.normalizeClass(["tree-tooltip",t.tooltipAtBottom?"bottom":""])},[o.createVNode(u,{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",m_,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:r.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([r.mapType==="flatmap"?"hide_grandchildren_checkbox":""])},{default:o.withCtx(({node:v,data:h})=>[r.mapType==="flatmap"?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["region-tree-node",{activeItem:i.nodeIsActive(h),hoverItem:i.nodeIsHover(h)}]),onClick:g=>i.changeActiveByNode(h),onMouseover:g=>i.changeHoverByNode(h,!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(h)),class:"lastChildInItem"},o.toDisplayString(v.label),5)],42,y_)):r.mapType==="scaffold"?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["region-tree-node",{activeItem:r.active.includes(h.id),hoverItem:r.hover.includes(h.id)}]),onClick:g=>i.changeActiveByNode(h,!0),onMouseover:g=>i.changeHoverByNode(h,!0,g),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[2]||(e[2]=g=>i.displayTooltip("",!1,g))},[h.isPrimitives?(o.openBlock(),o.createBlock(d,{key:0,class:o.normalizeClass({"show-picker":r.showColourPicker}),modelValue:h.activeColour,"onUpdate:modelValue":g=>h.activeColour=g,size:"small","popper-class":t.myPopperClass,onChange:g=>i.setColour(h,g)},null,8,["class","modelValue","onUpdate:modelValue","popper-class","onChange"])):o.createCommentVNode("",!0),o.createElementVNode("div",w_,[o.createElementVNode("span",null,o.toDisplayString(v.label),1),h.isTextureSlides?(o.openBlock(),o.createElementBlock("span",C_," (Texture) ")):o.createCommentVNode("",!0)])],42,b_)):o.createCommentVNode("",!0)]),_:1},8,["node-key","data","default-expanded-keys","onCheck","filter-node-method","class"])),[[p,!r.isReady]])],512)])}const x_=lr(h_,[["render",k_],["__scopeId","data-v-823a8388"]]);Re.AnnotationPopup=Ff,Re.ConnectivityGraph=M3,Re.CopyToClipboard=Rv,Re.CreateTooltipContent=PE,Re.DrawToolbar=dP,Re.ExternalResourceCard=kg,Re.HelpModeDialog=mP,Re.Tooltip=f_,Re.TreeControls=x_,Object.defineProperty(Re,Symbol.toStringTag,{value:"Module"})});