@abi-software/map-utilities 1.7.8-beta.0 → 1.7.8-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,24 @@
1
- (function(Te,Ne){typeof exports=="object"&&typeof module<"u"?Ne(exports,require("@element-plus/icons-vue"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@element-plus/icons-vue","vue"],Ne):(Te=typeof globalThis<"u"?globalThis:Te||self,Ne(Te.MapUtilities={},Te["@element-plus/icons-vue"],Te.Vue))})(this,function(Te,Ne,s){"use strict";var aG=Object.defineProperty;var iG=(Te,Ne,s)=>Ne in Te?aG(Te,Ne,{enumerable:!0,configurable:!0,writable:!0,value:s}):Te[Ne]=s;var cr=(Te,Ne,s)=>iG(Te,typeof Ne!="symbol"?Ne+"":Ne,s);const Fr=(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 Tg;const rt=typeof window<"u",A_=t=>typeof t=="string",Ng=()=>{},Sl=rt&&((Tg=window==null?void 0:window.navigator)==null?void 0:Tg.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Ig(t){return typeof t=="function"?t():s.unref(t)}function R_(t){return t}function Io(t){return s.getCurrentScope()?(s.onScopeDispose(t),!0):!1}function L_(t,e=!0){s.getCurrentInstance()?s.onMounted(t):e?t():s.nextTick(t)}function $r(t){var e;const r=Ig(t);return(e=r==null?void 0:r.$el)!=null?e:r}const Bo=rt?window:void 0;function Qt(...t){let e,r,n,a;if(A_(t[0])||Array.isArray(t[0])?([r,n,a]=t,e=Bo):[e,r,n,a]=t,!e)return Ng;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const i=[],o=()=>{i.forEach(d=>d()),i.length=0},l=(d,f,h,v)=>(d.addEventListener(f,h,v),()=>d.removeEventListener(f,h,v)),c=s.watch(()=>[$r(e),Ig(a)],([d,f])=>{o(),d&&i.push(...r.flatMap(h=>n.map(v=>l(d,h,v,f))))},{immediate:!0,flush:"post"}),u=()=>{c(),o()};return Io(u),u}let Bg=!1;function M_(t,e,r={}){const{window:n=Bo,ignore:a=[],capture:i=!0,detectIframe:o=!1}=r;if(!n)return;Sl&&!Bg&&(Bg=!0,Array.from(n.document.body.children).forEach(h=>h.addEventListener("click",Ng)));let l=!0;const c=h=>a.some(v=>{if(typeof v=="string")return Array.from(n.document.querySelectorAll(v)).some(p=>p===h.target||h.composedPath().includes(p));{const p=$r(v);return p&&(h.target===p||h.composedPath().includes(p))}}),d=[Qt(n,"click",h=>{const v=$r(t);if(!(!v||v===h.target||h.composedPath().includes(v))){if(h.detail===0&&(l=!c(h)),!l){l=!0;return}e(h)}},{passive:!0,capture:i}),Qt(n,"pointerdown",h=>{const v=$r(t);v&&(l=!h.composedPath().includes(v)&&!c(h))},{passive:!0}),o&&Qt(n,"blur",h=>{var v;const p=$r(t);((v=n.document.activeElement)==null?void 0:v.tagName)==="IFRAME"&&!(p!=null&&p.contains(n.document.activeElement))&&e(h)})].filter(Boolean);return()=>d.forEach(h=>h())}function Dg(t,e=!1){const r=s.ref(),n=()=>r.value=!!t();return n(),L_(n,e),r}const Og=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Pg="__vueuse_ssr_handlers__";Og[Pg]=Og[Pg]||{};var Ag=Object.getOwnPropertySymbols,F_=Object.prototype.hasOwnProperty,$_=Object.prototype.propertyIsEnumerable,V_=(t,e)=>{var r={};for(var n in t)F_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Ag)for(var n of Ag(t))e.indexOf(n)<0&&$_.call(t,n)&&(r[n]=t[n]);return r};function Vr(t,e,r={}){const n=r,{window:a=Bo}=n,i=V_(n,["window"]);let o;const l=Dg(()=>a&&"ResizeObserver"in a),c=()=>{o&&(o.disconnect(),o=void 0)},u=s.watch(()=>$r(t),f=>{c(),l.value&&a&&f&&(o=new ResizeObserver(e),o.observe(f,i))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return Io(d),{isSupported:l,stop:d}}var Rg=Object.getOwnPropertySymbols,q_=Object.prototype.hasOwnProperty,z_=Object.prototype.propertyIsEnumerable,H_=(t,e)=>{var r={};for(var n in t)q_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Rg)for(var n of Rg(t))e.indexOf(n)<0&&z_.call(t,n)&&(r[n]=t[n]);return r};function K_(t,e,r={}){const n=r,{window:a=Bo}=n,i=H_(n,["window"]);let o;const l=Dg(()=>a&&"MutationObserver"in a),c=()=>{o&&(o.disconnect(),o=void 0)},u=s.watch(()=>$r(t),f=>{c(),l.value&&a&&f&&(o=new MutationObserver(e),o.observe(f,i))},{immediate:!0}),d=()=>{c(),u()};return Io(d),{isSupported:l,stop:d}}var Lg;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(Lg||(Lg={}));var G_=Object.defineProperty,Mg=Object.getOwnPropertySymbols,U_=Object.prototype.hasOwnProperty,j_=Object.prototype.propertyIsEnumerable,Fg=(t,e,r)=>e in t?G_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,W_=(t,e)=>{for(var r in e||(e={}))U_.call(e,r)&&Fg(t,r,e[r]);if(Mg)for(var r of Mg(e))j_.call(e,r)&&Fg(t,r,e[r]);return t};W_({linear:R_},{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 Y_=()=>rt&&/firefox/i.test(window.navigator.userAgent),_l=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(Te,Ne){typeof exports=="object"&&typeof module<"u"?Ne(exports,require("@element-plus/icons-vue"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@element-plus/icons-vue","vue"],Ne):(Te=typeof globalThis<"u"?globalThis:Te||self,Ne(Te.MapUtilities={},Te["@element-plus/icons-vue"],Te.Vue))})(this,function(Te,Ne,s){"use strict";var pG=Object.defineProperty;var vG=(Te,Ne,s)=>Ne in Te?pG(Te,Ne,{enumerable:!0,configurable:!0,writable:!0,value:s}):Te[Ne]=s;var cr=(Te,Ne,s)=>vG(Te,typeof Ne!="symbol"?Ne+"":Ne,s);const Mr=(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 Ig;const nt=typeof window<"u",q_=t=>typeof t=="string",Bg=()=>{},_l=nt&&((Ig=window==null?void 0:window.navigator)==null?void 0:Ig.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Dg(t){return typeof t=="function"?t():s.unref(t)}function z_(t){return t}function Do(t){return s.getCurrentScope()?(s.onScopeDispose(t),!0):!1}function H_(t,e=!0){s.getCurrentInstance()?s.onMounted(t):e?t():s.nextTick(t)}function $r(t){var e;const r=Dg(t);return(e=r==null?void 0:r.$el)!=null?e:r}const Po=nt?window:void 0;function Qt(...t){let e,r,n,a;if(q_(t[0])||Array.isArray(t[0])?([r,n,a]=t,e=Po):[e,r,n,a]=t,!e)return Bg;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const i=[],o=()=>{i.forEach(d=>d()),i.length=0},l=(d,f,h,v)=>(d.addEventListener(f,h,v),()=>d.removeEventListener(f,h,v)),c=s.watch(()=>[$r(e),Dg(a)],([d,f])=>{o(),d&&i.push(...r.flatMap(h=>n.map(v=>l(d,h,v,f))))},{immediate:!0,flush:"post"}),u=()=>{c(),o()};return Do(u),u}let Pg=!1;function Og(t,e,r={}){const{window:n=Po,ignore:a=[],capture:i=!0,detectIframe:o=!1}=r;if(!n)return;_l&&!Pg&&(Pg=!0,Array.from(n.document.body.children).forEach(h=>h.addEventListener("click",Bg)));let l=!0;const c=h=>a.some(v=>{if(typeof v=="string")return Array.from(n.document.querySelectorAll(v)).some(p=>p===h.target||h.composedPath().includes(p));{const p=$r(v);return p&&(h.target===p||h.composedPath().includes(p))}}),d=[Qt(n,"click",h=>{const v=$r(t);if(!(!v||v===h.target||h.composedPath().includes(v))){if(h.detail===0&&(l=!c(h)),!l){l=!0;return}e(h)}},{passive:!0,capture:i}),Qt(n,"pointerdown",h=>{const v=$r(t);v&&(l=!h.composedPath().includes(v)&&!c(h))},{passive:!0}),o&&Qt(n,"blur",h=>{var v;const p=$r(t);((v=n.document.activeElement)==null?void 0:v.tagName)==="IFRAME"&&!(p!=null&&p.contains(n.document.activeElement))&&e(h)})].filter(Boolean);return()=>d.forEach(h=>h())}function Ag(t,e=!1){const r=s.ref(),n=()=>r.value=!!t();return n(),H_(n,e),r}const Rg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Lg="__vueuse_ssr_handlers__";Rg[Lg]=Rg[Lg]||{};var Fg=Object.getOwnPropertySymbols,K_=Object.prototype.hasOwnProperty,G_=Object.prototype.propertyIsEnumerable,U_=(t,e)=>{var r={};for(var n in t)K_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Fg)for(var n of Fg(t))e.indexOf(n)<0&&G_.call(t,n)&&(r[n]=t[n]);return r};function Vr(t,e,r={}){const n=r,{window:a=Po}=n,i=U_(n,["window"]);let o;const l=Ag(()=>a&&"ResizeObserver"in a),c=()=>{o&&(o.disconnect(),o=void 0)},u=s.watch(()=>$r(t),f=>{c(),l.value&&a&&f&&(o=new ResizeObserver(e),o.observe(f,i))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return Do(d),{isSupported:l,stop:d}}var Mg=Object.getOwnPropertySymbols,j_=Object.prototype.hasOwnProperty,W_=Object.prototype.propertyIsEnumerable,Y_=(t,e)=>{var r={};for(var n in t)j_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Mg)for(var n of Mg(t))e.indexOf(n)<0&&W_.call(t,n)&&(r[n]=t[n]);return r};function Z_(t,e,r={}){const n=r,{window:a=Po}=n,i=Y_(n,["window"]);let o;const l=Ag(()=>a&&"MutationObserver"in a),c=()=>{o&&(o.disconnect(),o=void 0)},u=s.watch(()=>$r(t),f=>{c(),l.value&&a&&f&&(o=new MutationObserver(e),o.observe(f,i))},{immediate:!0}),d=()=>{c(),u()};return Do(d),{isSupported:l,stop:d}}var $g;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})($g||($g={}));var X_=Object.defineProperty,Vg=Object.getOwnPropertySymbols,J_=Object.prototype.hasOwnProperty,Q_=Object.prototype.propertyIsEnumerable,qg=(t,e,r)=>e in t?X_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,eT=(t,e)=>{for(var r in e||(e={}))J_.call(e,r)&&qg(t,r,e[r]);if(Vg)for(var r of Vg(e))Q_.call(e,r)&&qg(t,r,e[r]);return t};eT({linear:z_},{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 tT=()=>nt&&/firefox/i.test(window.navigator.userAgent),Tl=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 hi=()=>{},Z_=Object.prototype.hasOwnProperty,Ln=(t,e)=>Z_.call(t,e),$t=Array.isArray,Mt=t=>typeof t=="function",Nt=t=>typeof t=="string",bt=t=>t!==null&&typeof t=="object",X_=Object.prototype.toString,J_=t=>X_.call(t),Tl=t=>J_(t).slice(8,-1),$g=t=>{const e=Object.create(null);return r=>e[r]||(e[r]=t(r))},Q_=/-(\w)/g,eT=$g(t=>t.replace(Q_,(e,r)=>r?r.toUpperCase():"")),tT=/\B([A-Z])/g,rT=$g(t=>t.replace(tT,"-$1").toLowerCase());var Vg=typeof global=="object"&&global&&global.Object===Object&&global,nT=typeof self=="object"&&self&&self.Object===Object&&self,kr=Vg||nT||Function("return this")(),Sr=kr.Symbol,qg=Object.prototype,aT=qg.hasOwnProperty,iT=qg.toString,pi=Sr?Sr.toStringTag:void 0;function oT(t){var e=aT.call(t,pi),r=t[pi];try{t[pi]=void 0;var n=!0}catch{}var a=iT.call(t);return n&&(e?t[pi]=r:delete t[pi]),a}var sT=Object.prototype,lT=sT.toString;function uT(t){return lT.call(t)}var cT="[object Null]",dT="[object Undefined]",zg=Sr?Sr.toStringTag:void 0;function ga(t){return t==null?t===void 0?dT:cT:zg&&zg in Object(t)?oT(t):uT(t)}function ma(t){return t!=null&&typeof t=="object"}var fT="[object Symbol]";function Do(t){return typeof t=="symbol"||ma(t)&&ga(t)==fT}function hT(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 dr=Array.isArray,pT=1/0,Hg=Sr?Sr.prototype:void 0,Kg=Hg?Hg.toString:void 0;function Gg(t){if(typeof t=="string")return t;if(dr(t))return hT(t,Gg)+"";if(Do(t))return Kg?Kg.call(t):"";var e=t+"";return e=="0"&&1/t==-pT?"-0":e}var vT=/\s/;function gT(t){for(var e=t.length;e--&&vT.test(t.charAt(e)););return e}var mT=/^\s+/;function yT(t){return t&&t.slice(0,gT(t)+1).replace(mT,"")}function an(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ug=NaN,bT=/^[-+]0x[0-9a-f]+$/i,wT=/^0b[01]+$/i,CT=/^0o[0-7]+$/i,ET=parseInt;function jg(t){if(typeof t=="number")return t;if(Do(t))return Ug;if(an(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=an(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=yT(t);var r=wT.test(t);return r||CT.test(t)?ET(t.slice(2),r?2:8):bT.test(t)?Ug:+t}function Wg(t){return t}var xT="[object AsyncFunction]",kT="[object Function]",ST="[object GeneratorFunction]",_T="[object Proxy]";function Yg(t){if(!an(t))return!1;var e=ga(t);return e==kT||e==ST||e==xT||e==_T}var Nl=kr["__core-js_shared__"],Zg=function(){var t=/[^.]+$/.exec(Nl&&Nl.keys&&Nl.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function TT(t){return!!Zg&&Zg in t}var NT=Function.prototype,IT=NT.toString;function Mn(t){if(t!=null){try{return IT.call(t)}catch{}try{return t+""}catch{}}return""}var BT=/[\\^$.*+?()[\]{}|]/g,DT=/^\[object .+?Constructor\]$/,OT=Function.prototype,PT=Object.prototype,AT=OT.toString,RT=PT.hasOwnProperty,LT=RegExp("^"+AT.call(RT).replace(BT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function MT(t){if(!an(t)||TT(t))return!1;var e=Yg(t)?LT:DT;return e.test(Mn(t))}function FT(t,e){return t==null?void 0:t[e]}function Fn(t,e){var r=FT(t,e);return MT(r)?r:void 0}var Il=Fn(kr,"WeakMap");function $T(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 VT=800,qT=16,zT=Date.now;function HT(t){var e=0,r=0;return function(){var n=zT(),a=qT-(n-r);if(r=n,a>0){if(++e>=VT)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function KT(t){return function(){return t}}var Oo=function(){try{var t=Fn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),GT=Oo?function(t,e){return Oo(t,"toString",{configurable:!0,enumerable:!1,value:KT(e),writable:!0})}:Wg,UT=HT(GT);function jT(t,e,r,n){t.length;for(var a=r+1;a--;)if(e(t[a],a,t))return a;return-1}var WT=9007199254740991,YT=/^(?:0|[1-9]\d*)$/;function Bl(t,e){var r=typeof t;return e=e??WT,!!e&&(r=="number"||r!="symbol"&&YT.test(t))&&t>-1&&t%1==0&&t<e}function ZT(t,e,r){e=="__proto__"&&Oo?Oo(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Dl(t,e){return t===e||t!==t&&e!==e}var XT=Object.prototype,JT=XT.hasOwnProperty;function QT(t,e,r){var n=t[e];(!(JT.call(t,e)&&Dl(n,r))||r===void 0&&!(e in t))&&ZT(t,e,r)}var Xg=Math.max;function eN(t,e,r){return e=Xg(e===void 0?t.length-1:e,0),function(){for(var n=arguments,a=-1,i=Xg(n.length-e,0),o=Array(i);++a<i;)o[a]=n[e+a];a=-1;for(var l=Array(e+1);++a<e;)l[a]=n[a];return l[e]=r(o),$T(t,this,l)}}var tN=9007199254740991;function Ol(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=tN}function rN(t){return t!=null&&Ol(t.length)&&!Yg(t)}var nN=Object.prototype;function aN(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||nN;return t===r}function iN(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var oN="[object Arguments]";function Jg(t){return ma(t)&&ga(t)==oN}var Qg=Object.prototype,sN=Qg.hasOwnProperty,lN=Qg.propertyIsEnumerable,Pl=Jg(function(){return arguments}())?Jg:function(t){return ma(t)&&sN.call(t,"callee")&&!lN.call(t,"callee")};function uN(){return!1}var em=typeof Te=="object"&&Te&&!Te.nodeType&&Te,tm=em&&typeof module=="object"&&module&&!module.nodeType&&module,cN=tm&&tm.exports===em,rm=cN?kr.Buffer:void 0,dN=rm?rm.isBuffer:void 0,Al=dN||uN,fN="[object Arguments]",hN="[object Array]",pN="[object Boolean]",vN="[object Date]",gN="[object Error]",mN="[object Function]",yN="[object Map]",bN="[object Number]",wN="[object Object]",CN="[object RegExp]",EN="[object Set]",xN="[object String]",kN="[object WeakMap]",SN="[object ArrayBuffer]",_N="[object DataView]",TN="[object Float32Array]",NN="[object Float64Array]",IN="[object Int8Array]",BN="[object Int16Array]",DN="[object Int32Array]",ON="[object Uint8Array]",PN="[object Uint8ClampedArray]",AN="[object Uint16Array]",RN="[object Uint32Array]",We={};We[TN]=We[NN]=We[IN]=We[BN]=We[DN]=We[ON]=We[PN]=We[AN]=We[RN]=!0,We[fN]=We[hN]=We[SN]=We[pN]=We[_N]=We[vN]=We[gN]=We[mN]=We[yN]=We[bN]=We[wN]=We[CN]=We[EN]=We[xN]=We[kN]=!1;function LN(t){return ma(t)&&Ol(t.length)&&!!We[ga(t)]}function MN(t){return function(e){return t(e)}}var nm=typeof Te=="object"&&Te&&!Te.nodeType&&Te,vi=nm&&typeof module=="object"&&module&&!module.nodeType&&module,FN=vi&&vi.exports===nm,Rl=FN&&Vg.process,am=function(){try{var t=vi&&vi.require&&vi.require("util").types;return t||Rl&&Rl.binding&&Rl.binding("util")}catch{}}(),im=am&&am.isTypedArray,om=im?MN(im):LN,$N=Object.prototype,VN=$N.hasOwnProperty;function qN(t,e){var r=dr(t),n=!r&&Pl(t),a=!r&&!n&&Al(t),i=!r&&!n&&!a&&om(t),o=r||n||a||i,l=o?iN(t.length,String):[],c=l.length;for(var u in t)VN.call(t,u)&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Bl(u,c)))&&l.push(u);return l}function zN(t,e){return function(r){return t(e(r))}}var HN=zN(Object.keys,Object),KN=Object.prototype,GN=KN.hasOwnProperty;function UN(t){if(!aN(t))return HN(t);var e=[];for(var r in Object(t))GN.call(t,r)&&r!="constructor"&&e.push(r);return e}function sm(t){return rN(t)?qN(t):UN(t)}var jN=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,WN=/^\w*$/;function Ll(t,e){if(dr(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Do(t)?!0:WN.test(t)||!jN.test(t)||e!=null&&t in Object(e)}var gi=Fn(Object,"create");function YN(){this.__data__=gi?gi(null):{},this.size=0}function ZN(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var XN="__lodash_hash_undefined__",JN=Object.prototype,QN=JN.hasOwnProperty;function eI(t){var e=this.__data__;if(gi){var r=e[t];return r===XN?void 0:r}return QN.call(e,t)?e[t]:void 0}var tI=Object.prototype,rI=tI.hasOwnProperty;function nI(t){var e=this.__data__;return gi?e[t]!==void 0:rI.call(e,t)}var aI="__lodash_hash_undefined__";function iI(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=gi&&e===void 0?aI:e,this}function $n(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])}}$n.prototype.clear=YN,$n.prototype.delete=ZN,$n.prototype.get=eI,$n.prototype.has=nI,$n.prototype.set=iI;function oI(){this.__data__=[],this.size=0}function Po(t,e){for(var r=t.length;r--;)if(Dl(t[r][0],e))return r;return-1}var sI=Array.prototype,lI=sI.splice;function uI(t){var e=this.__data__,r=Po(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():lI.call(e,r,1),--this.size,!0}function cI(t){var e=this.__data__,r=Po(e,t);return r<0?void 0:e[r][1]}function dI(t){return Po(this.__data__,t)>-1}function fI(t,e){var r=this.__data__,n=Po(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function qr(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])}}qr.prototype.clear=oI,qr.prototype.delete=uI,qr.prototype.get=cI,qr.prototype.has=dI,qr.prototype.set=fI;var mi=Fn(kr,"Map");function hI(){this.size=0,this.__data__={hash:new $n,map:new(mi||qr),string:new $n}}function pI(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ao(t,e){var r=t.__data__;return pI(e)?r[typeof e=="string"?"string":"hash"]:r.map}function vI(t){var e=Ao(this,t).delete(t);return this.size-=e?1:0,e}function gI(t){return Ao(this,t).get(t)}function mI(t){return Ao(this,t).has(t)}function yI(t,e){var r=Ao(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function zr(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])}}zr.prototype.clear=hI,zr.prototype.delete=vI,zr.prototype.get=gI,zr.prototype.has=mI,zr.prototype.set=yI;var bI="Expected a function";function Ml(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(bI);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 o=t.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(Ml.Cache||zr),r}Ml.Cache=zr;var wI=500;function CI(t){var e=Ml(t,function(n){return r.size===wI&&r.clear(),n}),r=e.cache;return e}var EI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xI=/\\(\\)?/g,kI=CI(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(EI,function(r,n,a,i){e.push(a?i.replace(xI,"$1"):n||r)}),e});function SI(t){return t==null?"":Gg(t)}function Ro(t,e){return dr(t)?t:Ll(t,e)?[t]:kI(SI(t))}var _I=1/0;function yi(t){if(typeof t=="string"||Do(t))return t;var e=t+"";return e=="0"&&1/t==-_I?"-0":e}function Fl(t,e){e=Ro(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[yi(e[r++])];return r&&r==n?t:void 0}function Hr(t,e,r){var n=t==null?void 0:Fl(t,e);return n===void 0?r:n}function lm(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}var um=Sr?Sr.isConcatSpreadable:void 0;function TI(t){return dr(t)||Pl(t)||!!(um&&t&&t[um])}function NI(t,e,r,n,a){var i=-1,o=t.length;for(r||(r=TI),a||(a=[]);++i<o;){var l=t[i];r(l)?lm(a,l):a[a.length]=l}return a}function II(t){var e=t==null?0:t.length;return e?NI(t):[]}function BI(t){return UT(eN(t,void 0,II),t+"")}function on(){if(!arguments.length)return[];var t=arguments[0];return dr(t)?t:[t]}function DI(){this.__data__=new qr,this.size=0}function OI(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function PI(t){return this.__data__.get(t)}function AI(t){return this.__data__.has(t)}var RI=200;function LI(t,e){var r=this.__data__;if(r instanceof qr){var n=r.__data__;if(!mi||n.length<RI-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new zr(n)}return r.set(t,e),this.size=r.size,this}function Kr(t){var e=this.__data__=new qr(t);this.size=e.size}Kr.prototype.clear=DI,Kr.prototype.delete=OI,Kr.prototype.get=PI,Kr.prototype.has=AI,Kr.prototype.set=LI;function MI(t,e){for(var r=-1,n=t==null?0:t.length,a=0,i=[];++r<n;){var o=t[r];e(o,r,t)&&(i[a++]=o)}return i}function FI(){return[]}var $I=Object.prototype,VI=$I.propertyIsEnumerable,cm=Object.getOwnPropertySymbols,qI=cm?function(t){return t==null?[]:(t=Object(t),MI(cm(t),function(e){return VI.call(t,e)}))}:FI;function zI(t,e,r){var n=e(t);return dr(t)?n:lm(n,r(t))}function dm(t){return zI(t,sm,qI)}var $l=Fn(kr,"DataView"),Vl=Fn(kr,"Promise"),ql=Fn(kr,"Set"),fm="[object Map]",HI="[object Object]",hm="[object Promise]",pm="[object Set]",vm="[object WeakMap]",gm="[object DataView]",KI=Mn($l),GI=Mn(mi),UI=Mn(Vl),jI=Mn(ql),WI=Mn(Il),sn=ga;($l&&sn(new $l(new ArrayBuffer(1)))!=gm||mi&&sn(new mi)!=fm||Vl&&sn(Vl.resolve())!=hm||ql&&sn(new ql)!=pm||Il&&sn(new Il)!=vm)&&(sn=function(t){var e=ga(t),r=e==HI?t.constructor:void 0,n=r?Mn(r):"";if(n)switch(n){case KI:return gm;case GI:return fm;case UI:return hm;case jI:return pm;case WI:return vm}return e});var mm=kr.Uint8Array,YI="__lodash_hash_undefined__";function ZI(t){return this.__data__.set(t,YI),this}function XI(t){return this.__data__.has(t)}function Lo(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new zr;++e<r;)this.add(t[e])}Lo.prototype.add=Lo.prototype.push=ZI,Lo.prototype.has=XI;function JI(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 QI(t,e){return t.has(e)}var eB=1,tB=2;function ym(t,e,r,n,a,i){var o=r&eB,l=t.length,c=e.length;if(l!=c&&!(o&&c>l))return!1;var u=i.get(t),d=i.get(e);if(u&&d)return u==e&&d==t;var f=-1,h=!0,v=r&tB?new Lo:void 0;for(i.set(t,e),i.set(e,t);++f<l;){var p=t[f],g=e[f];if(n)var m=o?n(g,p,f,e,t,i):n(p,g,f,t,e,i);if(m!==void 0){if(m)continue;h=!1;break}if(v){if(!JI(e,function(y,b){if(!QI(v,b)&&(p===y||a(p,y,r,n,i)))return v.push(b)})){h=!1;break}}else if(!(p===g||a(p,g,r,n,i))){h=!1;break}}return i.delete(t),i.delete(e),h}function rB(t){var e=-1,r=Array(t.size);return t.forEach(function(n,a){r[++e]=[a,n]}),r}function nB(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var aB=1,iB=2,oB="[object Boolean]",sB="[object Date]",lB="[object Error]",uB="[object Map]",cB="[object Number]",dB="[object RegExp]",fB="[object Set]",hB="[object String]",pB="[object Symbol]",vB="[object ArrayBuffer]",gB="[object DataView]",bm=Sr?Sr.prototype:void 0,zl=bm?bm.valueOf:void 0;function mB(t,e,r,n,a,i,o){switch(r){case gB:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case vB:return!(t.byteLength!=e.byteLength||!i(new mm(t),new mm(e)));case oB:case sB:case cB:return Dl(+t,+e);case lB:return t.name==e.name&&t.message==e.message;case dB:case hB:return t==e+"";case uB:var l=rB;case fB:var c=n&aB;if(l||(l=nB),t.size!=e.size&&!c)return!1;var u=o.get(t);if(u)return u==e;n|=iB,o.set(t,e);var d=ym(l(t),l(e),n,a,i,o);return o.delete(t),d;case pB:if(zl)return zl.call(t)==zl.call(e)}return!1}var yB=1,bB=Object.prototype,wB=bB.hasOwnProperty;function CB(t,e,r,n,a,i){var o=r&yB,l=dm(t),c=l.length,u=dm(e),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in e:wB.call(e,h)))return!1}var v=i.get(t),p=i.get(e);if(v&&p)return v==e&&p==t;var g=!0;i.set(t,e),i.set(e,t);for(var m=o;++f<c;){h=l[f];var y=t[h],b=e[h];if(n)var w=o?n(b,y,h,e,t,i):n(y,b,h,t,e,i);if(!(w===void 0?y===b||a(y,b,r,n,i):w)){g=!1;break}m||(m=h=="constructor")}if(g&&!m){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 EB=1,wm="[object Arguments]",Cm="[object Array]",Mo="[object Object]",xB=Object.prototype,Em=xB.hasOwnProperty;function kB(t,e,r,n,a,i){var o=dr(t),l=dr(e),c=o?Cm:sn(t),u=l?Cm:sn(e);c=c==wm?Mo:c,u=u==wm?Mo:u;var d=c==Mo,f=u==Mo,h=c==u;if(h&&Al(t)){if(!Al(e))return!1;o=!0,d=!1}if(h&&!d)return i||(i=new Kr),o||om(t)?ym(t,e,r,n,a,i):mB(t,e,c,r,n,a,i);if(!(r&EB)){var v=d&&Em.call(t,"__wrapped__"),p=f&&Em.call(e,"__wrapped__");if(v||p){var g=v?t.value():t,m=p?e.value():e;return i||(i=new Kr),a(g,m,r,n,i)}}return h?(i||(i=new Kr),CB(t,e,r,n,a,i)):!1}function Fo(t,e,r,n,a){return t===e?!0:t==null||e==null||!ma(t)&&!ma(e)?t!==t&&e!==e:kB(t,e,r,n,Fo,a)}var SB=1,_B=2;function TB(t,e,r,n){var a=r.length,i=a;if(t==null)return!i;for(t=Object(t);a--;){var o=r[a];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++a<i;){o=r[a];var l=o[0],c=t[l],u=o[1];if(o[2]){if(c===void 0&&!(l in t))return!1}else{var d=new Kr,f;if(!(f===void 0?Fo(u,c,SB|_B,n,d):f))return!1}}return!0}function xm(t){return t===t&&!an(t)}function NB(t){for(var e=sm(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,xm(a)]}return e}function km(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function IB(t){var e=NB(t);return e.length==1&&e[0][2]?km(e[0][0],e[0][1]):function(r){return r===t||TB(r,t,e)}}function BB(t,e){return t!=null&&e in Object(t)}function DB(t,e,r){e=Ro(e,t);for(var n=-1,a=e.length,i=!1;++n<a;){var o=yi(e[n]);if(!(i=t!=null&&r(t,o)))break;t=t[o]}return i||++n!=a?i:(a=t==null?0:t.length,!!a&&Ol(a)&&Bl(o,a)&&(dr(t)||Pl(t)))}function Sm(t,e){return t!=null&&DB(t,e,BB)}var OB=1,PB=2;function AB(t,e){return Ll(t)&&xm(e)?km(yi(t),e):function(r){var n=Hr(r,t);return n===void 0&&n===e?Sm(r,t):Fo(e,n,OB|PB)}}function RB(t){return function(e){return e==null?void 0:e[t]}}function LB(t){return function(e){return Fl(e,t)}}function MB(t){return Ll(t)?RB(yi(t)):LB(t)}function FB(t){return typeof t=="function"?t:t==null?Wg:typeof t=="object"?dr(t)?AB(t[0],t[1]):IB(t):MB(t)}var Hl=function(){return kr.Date.now()},$B="Expected a function",VB=Math.max,qB=Math.min;function _m(t,e,r){var n,a,i,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError($B);e=jg(e)||0,an(r)&&(d=!!r.leading,f="maxWait"in r,i=f?VB(jg(r.maxWait)||0,e):i,h="trailing"in r?!!r.trailing:h);function v(k){var E=n,_=a;return n=a=void 0,u=k,o=t.apply(_,E),o}function p(k){return u=k,l=setTimeout(y,e),d?v(k):o}function g(k){var E=k-c,_=k-u,S=e-E;return f?qB(S,i-_):S}function m(k){var E=k-c,_=k-u;return c===void 0||E>=e||E<0||f&&_>=i}function y(){var k=Hl();if(m(k))return b(k);l=setTimeout(y,g(k))}function b(k){return l=void 0,h&&n?v(k):(n=a=void 0,o)}function w(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function C(){return l===void 0?o:b(Hl())}function x(){var k=Hl(),E=m(k);if(n=arguments,a=this,c=k,E){if(l===void 0)return p(c);if(f)return clearTimeout(l),l=setTimeout(y,e),v(c)}return l===void 0&&(l=setTimeout(y,e)),o}return x.cancel=w,x.flush=C,x}function zB(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var a=n-1;return jT(t,FB(e),a)}function $o(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 Vo(t,e){return Fo(t,e)}function ln(t){return t==null}function HB(t){return t===void 0}function KB(t,e,r,n){if(!an(t))return t;e=Ro(e,t);for(var a=-1,i=e.length,o=i-1,l=t;l!=null&&++a<i;){var c=yi(e[a]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(a!=o){var d=l[c];u=void 0,u===void 0&&(u=an(d)?d:Bl(e[a+1])?[]:{})}QT(l,c,u),l=l[c]}return t}function GB(t,e,r){for(var n=-1,a=e.length,i={};++n<a;){var o=e[n],l=Fl(t,o);r(l,o)&&KB(i,Ro(o,t),l)}return i}function UB(t,e){return GB(t,e,function(r,n){return Sm(t,n)})}var Tm=BI(function(t,e){return t==null?{}:UB(t,e)});const un=t=>t===void 0,ya=t=>typeof t=="boolean",wt=t=>typeof t=="number",Vn=t=>typeof Element>"u"?!1:t instanceof Element,qo=t=>ln(t),jB=t=>Nt(t)?!Number.isNaN(Number(t)):!1,WB=(t="")=>t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),Nm=t=>Object.keys(t);class Im extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function YB(t,e){throw new Im(`[${t}] ${e}`)}function nt(t,e){if(process.env.NODE_ENV!=="production"){const r=Nt(t)?new Im(`[${t}] ${e}`):t;console.warn(r)}}const ZB="utils/dom/style",Bm=(t="")=>t.split(" ").filter(e=>!!e.trim()),Kl=(t,e)=>{!t||!e.trim()||t.classList.add(...Bm(e))},qn=(t,e)=>{!t||!e.trim()||t.classList.remove(...Bm(e))},bi=(t,e)=>{var r;if(!rt||!t||!e)return"";let n=eT(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 ba(t,e="px"){if(!t)return"";if(wt(t)||jB(t))return`${t}${e}`;if(Nt(t))return t;nt(ZB,"binding value must be a string or number")}function XB(t,e){if(!rt)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,o=t.scrollTop,l=o+t.clientHeight;a<o?t.scrollTop=a:i>l&&(t.scrollTop=i-t.clientHeight)}const Dm="__epPropKey",ke=t=>t,JB=t=>bt(t)&&!!t[Dm],zo=(t,e)=>{if(!bt(t)||JB(t))return t;const{values:r,required:n,default:a,type:i,validator:o}=t,c={type:i,required:!!n,validator:r||o?u=>{let d=!1,f=[];if(r&&(f=Array.from(r),Ln(t,"default")&&f.push(a),d||(d=f.includes(u))),o&&(d||(d=o(u))),!d&&f.length>0){const h=[...new Set(f)].map(v=>JSON.stringify(v)).join(", ");s.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${h}], got value ${JSON.stringify(u)}.`)}return d}:void 0,[Dm]:!0};return Ln(t,"default")&&(c.default=a),c},Fe=t=>$o(Object.entries(t).map(([e,r])=>[e,zo(r,e)])),cn=ke([String,Object,Function]),Om={validating:Ne.Loading,success:Ne.CircleCheck,error:Ne.CircleClose},vt=(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},QB=(t,e)=>(t.install=r=>{r.directive(e,t)},t),Gr=t=>(t.install=hi,t),lt={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"},Ct="update:modelValue",Gl="change",Pm=["","default","small","large"],eD=t=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t),wa=t=>t,tD=["class","style"],rD=/^on[A-Z]/,nD=(t={})=>{const{excludeListeners:e=!1,excludeKeys:r}=t,n=s.computed(()=>((r==null?void 0:r.value)||[]).concat(tD)),a=s.getCurrentInstance();return a?s.computed(()=>{var i;return $o(Object.entries((i=a.proxy)==null?void 0:i.$attrs).filter(([o])=>!n.value.includes(o)&&!(e&&rD.test(o))))}):(nt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),s.computed(()=>({})))},Ho=({from:t,replacement:e,scope:r,version:n,ref:a,type:i="API"},o)=>{s.watch(()=>s.unref(o),l=>{l&&nt(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 ga=()=>{},rT=Object.prototype.hasOwnProperty,Ln=(t,e)=>rT.call(t,e),Et=Array.isArray,Mt=t=>typeof t=="function",ct=t=>typeof t=="string",yt=t=>t!==null&&typeof t=="object",nT=Object.prototype.toString,aT=t=>nT.call(t),Nl=t=>aT(t).slice(8,-1),zg=t=>{const e=Object.create(null);return r=>e[r]||(e[r]=t(r))},iT=/-(\w)/g,oT=zg(t=>t.replace(iT,(e,r)=>r?r.toUpperCase():"")),sT=/\B([A-Z])/g,lT=zg(t=>t.replace(sT,"-$1").toLowerCase());var Hg=typeof global=="object"&&global&&global.Object===Object&&global,uT=typeof self=="object"&&self&&self.Object===Object&&self,kr=Hg||uT||Function("return this")(),Sr=kr.Symbol,Kg=Object.prototype,cT=Kg.hasOwnProperty,dT=Kg.toString,gi=Sr?Sr.toStringTag:void 0;function fT(t){var e=cT.call(t,gi),r=t[gi];try{t[gi]=void 0;var n=!0}catch{}var a=dT.call(t);return n&&(e?t[gi]=r:delete t[gi]),a}var hT=Object.prototype,pT=hT.toString;function vT(t){return pT.call(t)}var gT="[object Null]",mT="[object Undefined]",Gg=Sr?Sr.toStringTag:void 0;function ma(t){return t==null?t===void 0?mT:gT:Gg&&Gg in Object(t)?fT(t):vT(t)}function ya(t){return t!=null&&typeof t=="object"}var yT="[object Symbol]";function Oo(t){return typeof t=="symbol"||ya(t)&&ma(t)==yT}function bT(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 dr=Array.isArray,wT=1/0,Ug=Sr?Sr.prototype:void 0,jg=Ug?Ug.toString:void 0;function Wg(t){if(typeof t=="string")return t;if(dr(t))return bT(t,Wg)+"";if(Oo(t))return jg?jg.call(t):"";var e=t+"";return e=="0"&&1/t==-wT?"-0":e}var CT=/\s/;function ET(t){for(var e=t.length;e--&&CT.test(t.charAt(e)););return e}var xT=/^\s+/;function kT(t){return t&&t.slice(0,ET(t)+1).replace(xT,"")}function on(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Yg=NaN,ST=/^[-+]0x[0-9a-f]+$/i,_T=/^0b[01]+$/i,TT=/^0o[0-7]+$/i,NT=parseInt;function Zg(t){if(typeof t=="number")return t;if(Oo(t))return Yg;if(on(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=on(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=kT(t);var r=_T.test(t);return r||TT.test(t)?NT(t.slice(2),r?2:8):ST.test(t)?Yg:+t}function Xg(t){return t}var IT="[object AsyncFunction]",BT="[object Function]",DT="[object GeneratorFunction]",PT="[object Proxy]";function Jg(t){if(!on(t))return!1;var e=ma(t);return e==BT||e==DT||e==IT||e==PT}var Il=kr["__core-js_shared__"],Qg=function(){var t=/[^.]+$/.exec(Il&&Il.keys&&Il.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function OT(t){return!!Qg&&Qg in t}var AT=Function.prototype,RT=AT.toString;function Fn(t){if(t!=null){try{return RT.call(t)}catch{}try{return t+""}catch{}}return""}var LT=/[\\^$.*+?()[\]{}|]/g,FT=/^\[object .+?Constructor\]$/,MT=Function.prototype,$T=Object.prototype,VT=MT.toString,qT=$T.hasOwnProperty,zT=RegExp("^"+VT.call(qT).replace(LT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function HT(t){if(!on(t)||OT(t))return!1;var e=Jg(t)?zT:FT;return e.test(Fn(t))}function KT(t,e){return t==null?void 0:t[e]}function Mn(t,e){var r=KT(t,e);return HT(r)?r:void 0}var Bl=Mn(kr,"WeakMap");function GT(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 UT=800,jT=16,WT=Date.now;function YT(t){var e=0,r=0;return function(){var n=WT(),a=jT-(n-r);if(r=n,a>0){if(++e>=UT)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function ZT(t){return function(){return t}}var Ao=function(){try{var t=Mn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),XT=Ao?function(t,e){return Ao(t,"toString",{configurable:!0,enumerable:!1,value:ZT(e),writable:!0})}:Xg,JT=YT(XT);function QT(t,e,r,n){t.length;for(var a=r+1;a--;)if(e(t[a],a,t))return a;return-1}var eN=9007199254740991,tN=/^(?:0|[1-9]\d*)$/;function Dl(t,e){var r=typeof t;return e=e??eN,!!e&&(r=="number"||r!="symbol"&&tN.test(t))&&t>-1&&t%1==0&&t<e}function rN(t,e,r){e=="__proto__"&&Ao?Ao(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Pl(t,e){return t===e||t!==t&&e!==e}var nN=Object.prototype,aN=nN.hasOwnProperty;function iN(t,e,r){var n=t[e];(!(aN.call(t,e)&&Pl(n,r))||r===void 0&&!(e in t))&&rN(t,e,r)}var em=Math.max;function oN(t,e,r){return e=em(e===void 0?t.length-1:e,0),function(){for(var n=arguments,a=-1,i=em(n.length-e,0),o=Array(i);++a<i;)o[a]=n[e+a];a=-1;for(var l=Array(e+1);++a<e;)l[a]=n[a];return l[e]=r(o),GT(t,this,l)}}var sN=9007199254740991;function Ol(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=sN}function lN(t){return t!=null&&Ol(t.length)&&!Jg(t)}var uN=Object.prototype;function cN(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||uN;return t===r}function dN(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var fN="[object Arguments]";function tm(t){return ya(t)&&ma(t)==fN}var rm=Object.prototype,hN=rm.hasOwnProperty,pN=rm.propertyIsEnumerable,Al=tm(function(){return arguments}())?tm:function(t){return ya(t)&&hN.call(t,"callee")&&!pN.call(t,"callee")};function vN(){return!1}var nm=typeof Te=="object"&&Te&&!Te.nodeType&&Te,am=nm&&typeof module=="object"&&module&&!module.nodeType&&module,gN=am&&am.exports===nm,im=gN?kr.Buffer:void 0,mN=im?im.isBuffer:void 0,Rl=mN||vN,yN="[object Arguments]",bN="[object Array]",wN="[object Boolean]",CN="[object Date]",EN="[object Error]",xN="[object Function]",kN="[object Map]",SN="[object Number]",_N="[object Object]",TN="[object RegExp]",NN="[object Set]",IN="[object String]",BN="[object WeakMap]",DN="[object ArrayBuffer]",PN="[object DataView]",ON="[object Float32Array]",AN="[object Float64Array]",RN="[object Int8Array]",LN="[object Int16Array]",FN="[object Int32Array]",MN="[object Uint8Array]",$N="[object Uint8ClampedArray]",VN="[object Uint16Array]",qN="[object Uint32Array]",We={};We[ON]=We[AN]=We[RN]=We[LN]=We[FN]=We[MN]=We[$N]=We[VN]=We[qN]=!0,We[yN]=We[bN]=We[DN]=We[wN]=We[PN]=We[CN]=We[EN]=We[xN]=We[kN]=We[SN]=We[_N]=We[TN]=We[NN]=We[IN]=We[BN]=!1;function zN(t){return ya(t)&&Ol(t.length)&&!!We[ma(t)]}function HN(t){return function(e){return t(e)}}var om=typeof Te=="object"&&Te&&!Te.nodeType&&Te,mi=om&&typeof module=="object"&&module&&!module.nodeType&&module,KN=mi&&mi.exports===om,Ll=KN&&Hg.process,sm=function(){try{var t=mi&&mi.require&&mi.require("util").types;return t||Ll&&Ll.binding&&Ll.binding("util")}catch{}}(),lm=sm&&sm.isTypedArray,um=lm?HN(lm):zN,GN=Object.prototype,UN=GN.hasOwnProperty;function jN(t,e){var r=dr(t),n=!r&&Al(t),a=!r&&!n&&Rl(t),i=!r&&!n&&!a&&um(t),o=r||n||a||i,l=o?dN(t.length,String):[],c=l.length;for(var u in t)UN.call(t,u)&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Dl(u,c)))&&l.push(u);return l}function WN(t,e){return function(r){return t(e(r))}}var YN=WN(Object.keys,Object),ZN=Object.prototype,XN=ZN.hasOwnProperty;function JN(t){if(!cN(t))return YN(t);var e=[];for(var r in Object(t))XN.call(t,r)&&r!="constructor"&&e.push(r);return e}function cm(t){return lN(t)?jN(t):JN(t)}var QN=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,eI=/^\w*$/;function Fl(t,e){if(dr(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Oo(t)?!0:eI.test(t)||!QN.test(t)||e!=null&&t in Object(e)}var yi=Mn(Object,"create");function tI(){this.__data__=yi?yi(null):{},this.size=0}function rI(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var nI="__lodash_hash_undefined__",aI=Object.prototype,iI=aI.hasOwnProperty;function oI(t){var e=this.__data__;if(yi){var r=e[t];return r===nI?void 0:r}return iI.call(e,t)?e[t]:void 0}var sI=Object.prototype,lI=sI.hasOwnProperty;function uI(t){var e=this.__data__;return yi?e[t]!==void 0:lI.call(e,t)}var cI="__lodash_hash_undefined__";function dI(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=yi&&e===void 0?cI:e,this}function $n(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])}}$n.prototype.clear=tI,$n.prototype.delete=rI,$n.prototype.get=oI,$n.prototype.has=uI,$n.prototype.set=dI;function fI(){this.__data__=[],this.size=0}function Ro(t,e){for(var r=t.length;r--;)if(Pl(t[r][0],e))return r;return-1}var hI=Array.prototype,pI=hI.splice;function vI(t){var e=this.__data__,r=Ro(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():pI.call(e,r,1),--this.size,!0}function gI(t){var e=this.__data__,r=Ro(e,t);return r<0?void 0:e[r][1]}function mI(t){return Ro(this.__data__,t)>-1}function yI(t,e){var r=this.__data__,n=Ro(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function qr(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])}}qr.prototype.clear=fI,qr.prototype.delete=vI,qr.prototype.get=gI,qr.prototype.has=mI,qr.prototype.set=yI;var bi=Mn(kr,"Map");function bI(){this.size=0,this.__data__={hash:new $n,map:new(bi||qr),string:new $n}}function wI(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Lo(t,e){var r=t.__data__;return wI(e)?r[typeof e=="string"?"string":"hash"]:r.map}function CI(t){var e=Lo(this,t).delete(t);return this.size-=e?1:0,e}function EI(t){return Lo(this,t).get(t)}function xI(t){return Lo(this,t).has(t)}function kI(t,e){var r=Lo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function zr(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])}}zr.prototype.clear=bI,zr.prototype.delete=CI,zr.prototype.get=EI,zr.prototype.has=xI,zr.prototype.set=kI;var SI="Expected a function";function Ml(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(SI);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 o=t.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(Ml.Cache||zr),r}Ml.Cache=zr;var _I=500;function TI(t){var e=Ml(t,function(n){return r.size===_I&&r.clear(),n}),r=e.cache;return e}var NI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,II=/\\(\\)?/g,BI=TI(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(NI,function(r,n,a,i){e.push(a?i.replace(II,"$1"):n||r)}),e});function DI(t){return t==null?"":Wg(t)}function Fo(t,e){return dr(t)?t:Fl(t,e)?[t]:BI(DI(t))}var PI=1/0;function wi(t){if(typeof t=="string"||Oo(t))return t;var e=t+"";return e=="0"&&1/t==-PI?"-0":e}function $l(t,e){e=Fo(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[wi(e[r++])];return r&&r==n?t:void 0}function Hr(t,e,r){var n=t==null?void 0:$l(t,e);return n===void 0?r:n}function dm(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}var fm=Sr?Sr.isConcatSpreadable:void 0;function OI(t){return dr(t)||Al(t)||!!(fm&&t&&t[fm])}function AI(t,e,r,n,a){var i=-1,o=t.length;for(r||(r=OI),a||(a=[]);++i<o;){var l=t[i];r(l)?dm(a,l):a[a.length]=l}return a}function RI(t){var e=t==null?0:t.length;return e?AI(t):[]}function LI(t){return JT(oN(t,void 0,RI),t+"")}function sn(){if(!arguments.length)return[];var t=arguments[0];return dr(t)?t:[t]}function FI(){this.__data__=new qr,this.size=0}function MI(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function $I(t){return this.__data__.get(t)}function VI(t){return this.__data__.has(t)}var qI=200;function zI(t,e){var r=this.__data__;if(r instanceof qr){var n=r.__data__;if(!bi||n.length<qI-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new zr(n)}return r.set(t,e),this.size=r.size,this}function Kr(t){var e=this.__data__=new qr(t);this.size=e.size}Kr.prototype.clear=FI,Kr.prototype.delete=MI,Kr.prototype.get=$I,Kr.prototype.has=VI,Kr.prototype.set=zI;function HI(t,e){for(var r=-1,n=t==null?0:t.length,a=0,i=[];++r<n;){var o=t[r];e(o,r,t)&&(i[a++]=o)}return i}function KI(){return[]}var GI=Object.prototype,UI=GI.propertyIsEnumerable,hm=Object.getOwnPropertySymbols,jI=hm?function(t){return t==null?[]:(t=Object(t),HI(hm(t),function(e){return UI.call(t,e)}))}:KI;function WI(t,e,r){var n=e(t);return dr(t)?n:dm(n,r(t))}function pm(t){return WI(t,cm,jI)}var Vl=Mn(kr,"DataView"),ql=Mn(kr,"Promise"),zl=Mn(kr,"Set"),vm="[object Map]",YI="[object Object]",gm="[object Promise]",mm="[object Set]",ym="[object WeakMap]",bm="[object DataView]",ZI=Fn(Vl),XI=Fn(bi),JI=Fn(ql),QI=Fn(zl),eB=Fn(Bl),ln=ma;(Vl&&ln(new Vl(new ArrayBuffer(1)))!=bm||bi&&ln(new bi)!=vm||ql&&ln(ql.resolve())!=gm||zl&&ln(new zl)!=mm||Bl&&ln(new Bl)!=ym)&&(ln=function(t){var e=ma(t),r=e==YI?t.constructor:void 0,n=r?Fn(r):"";if(n)switch(n){case ZI:return bm;case XI:return vm;case JI:return gm;case QI:return mm;case eB:return ym}return e});var wm=kr.Uint8Array,tB="__lodash_hash_undefined__";function rB(t){return this.__data__.set(t,tB),this}function nB(t){return this.__data__.has(t)}function Mo(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new zr;++e<r;)this.add(t[e])}Mo.prototype.add=Mo.prototype.push=rB,Mo.prototype.has=nB;function aB(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 iB(t,e){return t.has(e)}var oB=1,sB=2;function Cm(t,e,r,n,a,i){var o=r&oB,l=t.length,c=e.length;if(l!=c&&!(o&&c>l))return!1;var u=i.get(t),d=i.get(e);if(u&&d)return u==e&&d==t;var f=-1,h=!0,v=r&sB?new Mo:void 0;for(i.set(t,e),i.set(e,t);++f<l;){var p=t[f],g=e[f];if(n)var y=o?n(g,p,f,e,t,i):n(p,g,f,t,e,i);if(y!==void 0){if(y)continue;h=!1;break}if(v){if(!aB(e,function(m,b){if(!iB(v,b)&&(p===m||a(p,m,r,n,i)))return v.push(b)})){h=!1;break}}else if(!(p===g||a(p,g,r,n,i))){h=!1;break}}return i.delete(t),i.delete(e),h}function lB(t){var e=-1,r=Array(t.size);return t.forEach(function(n,a){r[++e]=[a,n]}),r}function uB(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var cB=1,dB=2,fB="[object Boolean]",hB="[object Date]",pB="[object Error]",vB="[object Map]",gB="[object Number]",mB="[object RegExp]",yB="[object Set]",bB="[object String]",wB="[object Symbol]",CB="[object ArrayBuffer]",EB="[object DataView]",Em=Sr?Sr.prototype:void 0,Hl=Em?Em.valueOf:void 0;function xB(t,e,r,n,a,i,o){switch(r){case EB:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case CB:return!(t.byteLength!=e.byteLength||!i(new wm(t),new wm(e)));case fB:case hB:case gB:return Pl(+t,+e);case pB:return t.name==e.name&&t.message==e.message;case mB:case bB:return t==e+"";case vB:var l=lB;case yB:var c=n&cB;if(l||(l=uB),t.size!=e.size&&!c)return!1;var u=o.get(t);if(u)return u==e;n|=dB,o.set(t,e);var d=Cm(l(t),l(e),n,a,i,o);return o.delete(t),d;case wB:if(Hl)return Hl.call(t)==Hl.call(e)}return!1}var kB=1,SB=Object.prototype,_B=SB.hasOwnProperty;function TB(t,e,r,n,a,i){var o=r&kB,l=pm(t),c=l.length,u=pm(e),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in e:_B.call(e,h)))return!1}var v=i.get(t),p=i.get(e);if(v&&p)return v==e&&p==t;var g=!0;i.set(t,e),i.set(e,t);for(var y=o;++f<c;){h=l[f];var m=t[h],b=e[h];if(n)var w=o?n(b,m,h,e,t,i):n(m,b,h,t,e,i);if(!(w===void 0?m===b||a(m,b,r,n,i):w)){g=!1;break}y||(y=h=="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 NB=1,xm="[object Arguments]",km="[object Array]",$o="[object Object]",IB=Object.prototype,Sm=IB.hasOwnProperty;function BB(t,e,r,n,a,i){var o=dr(t),l=dr(e),c=o?km:ln(t),u=l?km:ln(e);c=c==xm?$o:c,u=u==xm?$o:u;var d=c==$o,f=u==$o,h=c==u;if(h&&Rl(t)){if(!Rl(e))return!1;o=!0,d=!1}if(h&&!d)return i||(i=new Kr),o||um(t)?Cm(t,e,r,n,a,i):xB(t,e,c,r,n,a,i);if(!(r&NB)){var v=d&&Sm.call(t,"__wrapped__"),p=f&&Sm.call(e,"__wrapped__");if(v||p){var g=v?t.value():t,y=p?e.value():e;return i||(i=new Kr),a(g,y,r,n,i)}}return h?(i||(i=new Kr),TB(t,e,r,n,a,i)):!1}function Vo(t,e,r,n,a){return t===e?!0:t==null||e==null||!ya(t)&&!ya(e)?t!==t&&e!==e:BB(t,e,r,n,Vo,a)}var DB=1,PB=2;function OB(t,e,r,n){var a=r.length,i=a;if(t==null)return!i;for(t=Object(t);a--;){var o=r[a];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++a<i;){o=r[a];var l=o[0],c=t[l],u=o[1];if(o[2]){if(c===void 0&&!(l in t))return!1}else{var d=new Kr,f;if(!(f===void 0?Vo(u,c,DB|PB,n,d):f))return!1}}return!0}function _m(t){return t===t&&!on(t)}function AB(t){for(var e=cm(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,_m(a)]}return e}function Tm(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function RB(t){var e=AB(t);return e.length==1&&e[0][2]?Tm(e[0][0],e[0][1]):function(r){return r===t||OB(r,t,e)}}function LB(t,e){return t!=null&&e in Object(t)}function FB(t,e,r){e=Fo(e,t);for(var n=-1,a=e.length,i=!1;++n<a;){var o=wi(e[n]);if(!(i=t!=null&&r(t,o)))break;t=t[o]}return i||++n!=a?i:(a=t==null?0:t.length,!!a&&Ol(a)&&Dl(o,a)&&(dr(t)||Al(t)))}function Nm(t,e){return t!=null&&FB(t,e,LB)}var MB=1,$B=2;function VB(t,e){return Fl(t)&&_m(e)?Tm(wi(t),e):function(r){var n=Hr(r,t);return n===void 0&&n===e?Nm(r,t):Vo(e,n,MB|$B)}}function qB(t){return function(e){return e==null?void 0:e[t]}}function zB(t){return function(e){return $l(e,t)}}function HB(t){return Fl(t)?qB(wi(t)):zB(t)}function KB(t){return typeof t=="function"?t:t==null?Xg:typeof t=="object"?dr(t)?VB(t[0],t[1]):RB(t):HB(t)}var Kl=function(){return kr.Date.now()},GB="Expected a function",UB=Math.max,jB=Math.min;function Gl(t,e,r){var n,a,i,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(GB);e=Zg(e)||0,on(r)&&(d=!!r.leading,f="maxWait"in r,i=f?UB(Zg(r.maxWait)||0,e):i,h="trailing"in r?!!r.trailing:h);function v(k){var E=n,_=a;return n=a=void 0,u=k,o=t.apply(_,E),o}function p(k){return u=k,l=setTimeout(m,e),d?v(k):o}function g(k){var E=k-c,_=k-u,S=e-E;return f?jB(S,i-_):S}function y(k){var E=k-c,_=k-u;return c===void 0||E>=e||E<0||f&&_>=i}function m(){var k=Kl();if(y(k))return b(k);l=setTimeout(m,g(k))}function b(k){return l=void 0,h&&n?v(k):(n=a=void 0,o)}function w(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function C(){return l===void 0?o:b(Kl())}function x(){var k=Kl(),E=y(k);if(n=arguments,a=this,c=k,E){if(l===void 0)return p(c);if(f)return clearTimeout(l),l=setTimeout(m,e),v(c)}return l===void 0&&(l=setTimeout(m,e)),o}return x.cancel=w,x.flush=C,x}function WB(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var a=n-1;return QT(t,KB(e),a)}function qo(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 zo(t,e){return Vo(t,e)}function un(t){return t==null}function YB(t){return t===void 0}function ZB(t,e,r,n){if(!on(t))return t;e=Fo(e,t);for(var a=-1,i=e.length,o=i-1,l=t;l!=null&&++a<i;){var c=wi(e[a]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(a!=o){var d=l[c];u=void 0,u===void 0&&(u=on(d)?d:Dl(e[a+1])?[]:{})}iN(l,c,u),l=l[c]}return t}function XB(t,e,r){for(var n=-1,a=e.length,i={};++n<a;){var o=e[n],l=$l(t,o);r(l,o)&&ZB(i,Fo(o,t),l)}return i}function JB(t,e){return XB(t,e,function(r,n){return Nm(t,n)})}var Im=LI(function(t,e){return t==null?{}:JB(t,e)});const cn=t=>t===void 0,ba=t=>typeof t=="boolean",xt=t=>typeof t=="number",Vn=t=>typeof Element>"u"?!1:t instanceof Element,Ho=t=>un(t),QB=t=>ct(t)?!Number.isNaN(Number(t)):!1,eD=(t="")=>t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),Bm=t=>Object.keys(t);class Dm extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function Pm(t,e){throw new Dm(`[${t}] ${e}`)}function at(t,e){if(process.env.NODE_ENV!=="production"){const r=ct(t)?new Dm(`[${t}] ${e}`):t;console.warn(r)}}const tD="utils/dom/style",Om=(t="")=>t.split(" ").filter(e=>!!e.trim()),Ul=(t,e)=>{!t||!e.trim()||t.classList.add(...Om(e))},qn=(t,e)=>{!t||!e.trim()||t.classList.remove(...Om(e))},Ci=(t,e)=>{var r;if(!nt||!t||!e)return"";let n=oT(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 wa(t,e="px"){if(!t)return"";if(xt(t)||QB(t))return`${t}${e}`;if(ct(t))return t;at(tD,"binding value must be a string or number")}function rD(t,e){if(!nt)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,o=t.scrollTop,l=o+t.clientHeight;a<o?t.scrollTop=a:i>l&&(t.scrollTop=i-t.clientHeight)}const Am="__epPropKey",ke=t=>t,nD=t=>yt(t)&&!!t[Am],Ko=(t,e)=>{if(!yt(t)||nD(t))return t;const{values:r,required:n,default:a,type:i,validator:o}=t,c={type:i,required:!!n,validator:r||o?u=>{let d=!1,f=[];if(r&&(f=Array.from(r),Ln(t,"default")&&f.push(a),d||(d=f.includes(u))),o&&(d||(d=o(u))),!d&&f.length>0){const h=[...new Set(f)].map(v=>JSON.stringify(v)).join(", ");s.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${h}], got value ${JSON.stringify(u)}.`)}return d}:void 0,[Am]:!0};return Ln(t,"default")&&(c.default=a),c},Me=t=>qo(Object.entries(t).map(([e,r])=>[e,Ko(r,e)])),dn=ke([String,Object,Function]),Rm={validating:Ne.Loading,success:Ne.CircleCheck,error:Ne.CircleClose},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},aD=(t,e)=>(t.install=r=>{r.directive(e,t)},t),Gr=t=>(t.install=ga,t),ft={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"},et="update:modelValue",Ei="change",jl="input",Lm=["","default","small","large"],iD=t=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t),Ca=t=>t,oD=["class","style"],sD=/^on[A-Z]/,Fm=(t={})=>{const{excludeListeners:e=!1,excludeKeys:r}=t,n=s.computed(()=>((r==null?void 0:r.value)||[]).concat(oD)),a=s.getCurrentInstance();return a?s.computed(()=>{var i;return qo(Object.entries((i=a.proxy)==null?void 0:i.$attrs).filter(([o])=>!n.value.includes(o)&&!(e&&sD.test(o))))}):(at("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),s.computed(()=>({})))},Go=({from:t,replacement:e,scope:r,version:n,ref:a,type:i="API"},o)=>{s.watch(()=>s.unref(o),l=>{l&&at(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 aD={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 iD=t=>(e,r)=>oD(e,r,s.unref(t)),oD=(t,e,r)=>Hr(r,t,t).replace(/\{(\w+)\}/g,(n,a)=>{var i;return`${(i=e==null?void 0:e[a])!=null?i:`{${a}}`}`}),sD=t=>{const e=s.computed(()=>s.unref(t).name),r=s.isRef(t)?t:s.ref(t);return{lang:e,locale:r,t:iD(t)}},Am=Symbol("localeContextKey"),wi=t=>{const e=t||s.inject(Am,s.ref());return sD(s.computed(()=>e.value||aD))},Ko="el",lD="is-",zn=(t,e,r,n,a)=>{let i=`${t}-${e}`;return r&&(i+=`-${r}`),n&&(i+=`__${n}`),a&&(i+=`--${a}`),i},Rm=Symbol("namespaceContextKey"),Ul=t=>{const e=t||(s.getCurrentInstance()?s.inject(Rm,s.ref(Ko)):s.ref(Ko));return s.computed(()=>s.unref(e)||Ko)},Oe=(t,e)=>{const r=Ul(e);return{namespace:r,b:(g="")=>zn(r.value,t,g,"",""),e:g=>g?zn(r.value,t,"",g,""):"",m:g=>g?zn(r.value,t,"","",g):"",be:(g,m)=>g&&m?zn(r.value,t,g,m,""):"",em:(g,m)=>g&&m?zn(r.value,t,"",g,m):"",bm:(g,m)=>g&&m?zn(r.value,t,g,"",m):"",bem:(g,m,y)=>g&&m&&y?zn(r.value,t,g,m,y):"",is:(g,...m)=>{const y=m.length>=1?m[0]:!0;return g&&y?`${lD}${g}`:""},cssVar:g=>{const m={};for(const y in g)g[y]&&(m[`--${r.value}-${y}`]=g[y]);return m},cssVarName:g=>`--${r.value}-${g}`,cssVarBlock:g=>{const m={};for(const y in g)g[y]&&(m[`--${r.value}-${t}-${y}`]=g[y]);return m},cssVarBlockName:g=>`--${r.value}-${t}-${g}`}},uD=zo({type:ke(Boolean),default:null}),cD=zo({type:ke(Function)}),dD=t=>{const e=`update:${t}`,r=`onUpdate:${t}`,n=[e],a={[t]:uD,[r]:cD};return{useModelToggle:({indicator:o,toggleReason:l,shouldHideWhenRouteChanges:c,shouldProceed:u,onShow:d,onHide:f})=>{const h=s.getCurrentInstance(),{emit:v}=h,p=h.props,g=s.computed(()=>Mt(p[r])),m=s.computed(()=>p[t]===null),y=E=>{o.value!==!0&&(o.value=!0,l&&(l.value=E),Mt(d)&&d(E))},b=E=>{o.value!==!1&&(o.value=!1,l&&(l.value=E),Mt(f)&&f(E))},w=E=>{if(p.disabled===!0||Mt(u)&&!u())return;const _=g.value&&rt;_&&v(e,!0),(m.value||!_)&&y(E)},C=E=>{if(p.disabled===!0||!rt)return;const _=g.value&&rt;_&&v(e,!1),(m.value||!_)&&b(E)},x=E=>{ya(E)&&(p.disabled&&E?g.value&&v(e,!1):o.value!==E&&(E?y():b()))},k=()=>{o.value?C():w()};return s.watch(()=>p[t],x),c&&h.appContext.config.globalProperties.$route!==void 0&&s.watch(()=>({...h.proxy.$route}),()=>{c.value&&o.value&&C()}),s.onMounted(()=>{x(p[t])}),{hide:C,show:w,toggle:k,hasUpdateHandler:g}},useModelToggleProps:a,useModelToggleEmits:n}},Lm=t=>{const e=s.getCurrentInstance();return s.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",er="bottom",tr="right",qt="left",jl="auto",Ci=[Vt,er,tr,qt],Ca="start",Ei="end",fD="clippingParents",Mm="viewport",xi="popper",hD="reference",Fm=Ci.reduce(function(t,e){return t.concat([e+"-"+Ca,e+"-"+Ei])},[]),Go=[].concat(Ci,[jl]).reduce(function(t,e){return t.concat([e,e+"-"+Ca,e+"-"+Ei])},[]),pD="beforeRead",vD="read",gD="afterRead",mD="beforeMain",yD="main",bD="afterMain",wD="beforeWrite",CD="write",ED="afterWrite",xD=[pD,vD,gD,mD,yD,bD,wD,CD,ED];function _r(t){return t?(t.nodeName||"").toLowerCase():null}function fr(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Ea(t){var e=fr(t).Element;return t instanceof e||t instanceof Element}function rr(t){var e=fr(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Wl(t){if(typeof ShadowRoot>"u")return!1;var e=fr(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function kD(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];!rr(i)||!_r(i)||(Object.assign(i.style,n),Object.keys(a).forEach(function(o){var l=a[o];l===!1?i.removeAttribute(o):i.setAttribute(o,l===!0?"":l)}))})}function SD(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]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:r[n]),l=o.reduce(function(c,u){return c[u]="",c},{});!rr(a)||!_r(a)||(Object.assign(a.style,l),Object.keys(i).forEach(function(c){a.removeAttribute(c)}))})}}var $m={name:"applyStyles",enabled:!0,phase:"write",fn:kD,effect:SD,requires:["computeStyles"]};function Tr(t){return t.split("-")[0]}var Hn=Math.max,Uo=Math.min,xa=Math.round;function ka(t,e){e===void 0&&(e=!1);var r=t.getBoundingClientRect(),n=1,a=1;if(rr(t)&&e){var i=t.offsetHeight,o=t.offsetWidth;o>0&&(n=xa(r.width)/o||1),i>0&&(a=xa(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 Yl(t){var e=ka(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 Vm(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&Wl(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ur(t){return fr(t).getComputedStyle(t)}function _D(t){return["table","td","th"].indexOf(_r(t))>=0}function dn(t){return((Ea(t)?t.ownerDocument:t.document)||window.document).documentElement}function jo(t){return _r(t)==="html"?t:t.assignedSlot||t.parentNode||(Wl(t)?t.host:null)||dn(t)}function qm(t){return!rr(t)||Ur(t).position==="fixed"?null:t.offsetParent}function TD(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,r=navigator.userAgent.indexOf("Trident")!==-1;if(r&&rr(t)){var n=Ur(t);if(n.position==="fixed")return null}var a=jo(t);for(Wl(a)&&(a=a.host);rr(a)&&["html","body"].indexOf(_r(a))<0;){var i=Ur(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 ki(t){for(var e=fr(t),r=qm(t);r&&_D(r)&&Ur(r).position==="static";)r=qm(r);return r&&(_r(r)==="html"||_r(r)==="body"&&Ur(r).position==="static")?e:r||TD(t)||e}function Zl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Si(t,e,r){return Hn(t,Uo(e,r))}function ND(t,e,r){var n=Si(t,e,r);return n>r?r:n}function zm(){return{top:0,right:0,bottom:0,left:0}}function Hm(t){return Object.assign({},zm(),t)}function Km(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var ID=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Hm(typeof t!="number"?t:Km(t,Ci))};function BD(t){var e,r=t.state,n=t.name,a=t.options,i=r.elements.arrow,o=r.modifiersData.popperOffsets,l=Tr(r.placement),c=Zl(l),u=[qt,tr].indexOf(l)>=0,d=u?"height":"width";if(!(!i||!o)){var f=ID(a.padding,r),h=Yl(i),v=c==="y"?Vt:qt,p=c==="y"?er:tr,g=r.rects.reference[d]+r.rects.reference[c]-o[c]-r.rects.popper[d],m=o[c]-r.rects.reference[c],y=ki(i),b=y?c==="y"?y.clientHeight||0:y.clientWidth||0:0,w=g/2-m/2,C=f[v],x=b-h[d]-f[p],k=b/2-h[d]/2+w,E=Si(C,k,x),_=c;r.modifiersData[n]=(e={},e[_]=E,e.centerOffset=E-k,e)}}function DD(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)||!Vm(e.elements.popper,a)||(e.elements.arrow=a))}var OD={name:"arrow",enabled:!0,phase:"main",fn:BD,effect:DD,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sa(t){return t.split("-")[1]}var PD={top:"auto",right:"auto",bottom:"auto",left:"auto"};function AD(t){var e=t.x,r=t.y,n=window,a=n.devicePixelRatio||1;return{x:xa(e*a)/a||0,y:xa(r*a)/a||0}}function Gm(t){var e,r=t.popper,n=t.popperRect,a=t.placement,i=t.variation,o=t.offsets,l=t.position,c=t.gpuAcceleration,u=t.adaptive,d=t.roundOffsets,f=t.isFixed,h=o.x,v=h===void 0?0:h,p=o.y,g=p===void 0?0:p,m=typeof d=="function"?d({x:v,y:g}):{x:v,y:g};v=m.x,g=m.y;var y=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),w=qt,C=Vt,x=window;if(u){var k=ki(r),E="clientHeight",_="clientWidth";if(k===fr(r)&&(k=dn(r),Ur(k).position!=="static"&&l==="absolute"&&(E="scrollHeight",_="scrollWidth")),k=k,a===Vt||(a===qt||a===tr)&&i===Ei){C=er;var S=f&&k===x&&x.visualViewport?x.visualViewport.height:k[E];g-=S-n.height,g*=c?1:-1}if(a===qt||(a===Vt||a===er)&&i===Ei){w=tr;var T=f&&k===x&&x.visualViewport?x.visualViewport.width:k[_];v-=T-n.width,v*=c?1:-1}}var N=Object.assign({position:l},u&&PD),B=d===!0?AD({x:v,y:g}):{x:v,y:g};if(v=B.x,g=B.y,c){var O;return Object.assign({},N,(O={},O[C]=b?"0":"",O[w]=y?"0":"",O.transform=(x.devicePixelRatio||1)<=1?"translate("+v+"px, "+g+"px)":"translate3d("+v+"px, "+g+"px, 0)",O))}return Object.assign({},N,(e={},e[C]=b?g+"px":"",e[w]=y?v+"px":"",e.transform="",e))}function RD(t){var e=t.state,r=t.options,n=r.gpuAcceleration,a=n===void 0?!0:n,i=r.adaptive,o=i===void 0?!0:i,l=r.roundOffsets,c=l===void 0?!0:l,u={placement:Tr(e.placement),variation:Sa(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,Gm(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Gm(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 Um={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:RD,data:{}},Wo={passive:!0};function LD(t){var e=t.state,r=t.instance,n=t.options,a=n.scroll,i=a===void 0?!0:a,o=n.resize,l=o===void 0?!0:o,c=fr(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",r.update,Wo)}),l&&c.addEventListener("resize",r.update,Wo),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",r.update,Wo)}),l&&c.removeEventListener("resize",r.update,Wo)}}var jm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:LD,data:{}},MD={left:"right",right:"left",bottom:"top",top:"bottom"};function Yo(t){return t.replace(/left|right|bottom|top/g,function(e){return MD[e]})}var FD={start:"end",end:"start"};function Wm(t){return t.replace(/start|end/g,function(e){return FD[e]})}function Xl(t){var e=fr(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Jl(t){return ka(dn(t)).left+Xl(t).scrollLeft}function $D(t){var e=fr(t),r=dn(t),n=e.visualViewport,a=r.clientWidth,i=r.clientHeight,o=0,l=0;return n&&(a=n.width,i=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=n.offsetLeft,l=n.offsetTop)),{width:a,height:i,x:o+Jl(t),y:l}}function VD(t){var e,r=dn(t),n=Xl(t),a=(e=t.ownerDocument)==null?void 0:e.body,i=Hn(r.scrollWidth,r.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),o=Hn(r.scrollHeight,r.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),l=-n.scrollLeft+Jl(t),c=-n.scrollTop;return Ur(a||r).direction==="rtl"&&(l+=Hn(r.clientWidth,a?a.clientWidth:0)-i),{width:i,height:o,x:l,y:c}}function Ql(t){var e=Ur(t),r=e.overflow,n=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+a+n)}function Ym(t){return["html","body","#document"].indexOf(_r(t))>=0?t.ownerDocument.body:rr(t)&&Ql(t)?t:Ym(jo(t))}function _i(t,e){var r;e===void 0&&(e=[]);var n=Ym(t),a=n===((r=t.ownerDocument)==null?void 0:r.body),i=fr(n),o=a?[i].concat(i.visualViewport||[],Ql(n)?n:[]):n,l=e.concat(o);return a?l:l.concat(_i(jo(o)))}function eu(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function qD(t){var e=ka(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 Zm(t,e){return e===Mm?eu($D(t)):Ea(e)?qD(e):eu(VD(dn(t)))}function zD(t){var e=_i(jo(t)),r=["absolute","fixed"].indexOf(Ur(t).position)>=0,n=r&&rr(t)?ki(t):t;return Ea(n)?e.filter(function(a){return Ea(a)&&Vm(a,n)&&_r(a)!=="body"}):[]}function HD(t,e,r){var n=e==="clippingParents"?zD(t):[].concat(e),a=[].concat(n,[r]),i=a[0],o=a.reduce(function(l,c){var u=Zm(t,c);return l.top=Hn(u.top,l.top),l.right=Uo(u.right,l.right),l.bottom=Uo(u.bottom,l.bottom),l.left=Hn(u.left,l.left),l},Zm(t,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Xm(t){var e=t.reference,r=t.element,n=t.placement,a=n?Tr(n):null,i=n?Sa(n):null,o=e.x+e.width/2-r.width/2,l=e.y+e.height/2-r.height/2,c;switch(a){case Vt:c={x:o,y:e.y-r.height};break;case er:c={x:o,y:e.y+e.height};break;case tr:c={x:e.x+e.width,y:l};break;case qt:c={x:e.x-r.width,y:l};break;default:c={x:e.x,y:e.y}}var u=a?Zl(a):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case Ca:c[u]=c[u]-(e[d]/2-r[d]/2);break;case Ei:c[u]=c[u]+(e[d]/2-r[d]/2);break}}return c}function Ti(t,e){e===void 0&&(e={});var r=e,n=r.placement,a=n===void 0?t.placement:n,i=r.boundary,o=i===void 0?fD:i,l=r.rootBoundary,c=l===void 0?Mm:l,u=r.elementContext,d=u===void 0?xi:u,f=r.altBoundary,h=f===void 0?!1:f,v=r.padding,p=v===void 0?0:v,g=Hm(typeof p!="number"?p:Km(p,Ci)),m=d===xi?hD:xi,y=t.rects.popper,b=t.elements[h?m:d],w=HD(Ea(b)?b:b.contextElement||dn(t.elements.popper),o,c),C=ka(t.elements.reference),x=Xm({reference:C,element:y,strategy:"absolute",placement:a}),k=eu(Object.assign({},y,x)),E=d===xi?k:C,_={top:w.top-E.top+g.top,bottom:E.bottom-w.bottom+g.bottom,left:w.left-E.left+g.left,right:E.right-w.right+g.right},S=t.modifiersData.offset;if(d===xi&&S){var T=S[a];Object.keys(_).forEach(function(N){var B=[tr,er].indexOf(N)>=0?1:-1,O=[Vt,er].indexOf(N)>=0?"y":"x";_[N]+=T[O]*B})}return _}function KD(t,e){e===void 0&&(e={});var r=e,n=r.placement,a=r.boundary,i=r.rootBoundary,o=r.padding,l=r.flipVariations,c=r.allowedAutoPlacements,u=c===void 0?Go:c,d=Sa(n),f=d?l?Fm:Fm.filter(function(p){return Sa(p)===d}):Ci,h=f.filter(function(p){return u.indexOf(p)>=0});h.length===0&&(h=f);var v=h.reduce(function(p,g){return p[g]=Ti(t,{placement:g,boundary:a,rootBoundary:i,padding:o})[Tr(g)],p},{});return Object.keys(v).sort(function(p,g){return v[p]-v[g]})}function GD(t){if(Tr(t)===jl)return[];var e=Yo(t);return[Wm(t),e,Wm(e)]}function UD(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,o=r.altAxis,l=o===void 0?!0:o,c=r.fallbackPlacements,u=r.padding,d=r.boundary,f=r.rootBoundary,h=r.altBoundary,v=r.flipVariations,p=v===void 0?!0:v,g=r.allowedAutoPlacements,m=e.options.placement,y=Tr(m),b=y===m,w=c||(b||!p?[Yo(m)]:GD(m)),C=[m].concat(w).reduce(function(F,$){return F.concat(Tr($)===jl?KD(e,{placement:$,boundary:d,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:g}):$)},[]),x=e.rects.reference,k=e.rects.popper,E=new Map,_=!0,S=C[0],T=0;T<C.length;T++){var N=C[T],B=Tr(N),O=Sa(N)===Ca,D=[Vt,er].indexOf(B)>=0,R=D?"width":"height",P=Ti(e,{placement:N,boundary:d,rootBoundary:f,altBoundary:h,padding:u}),L=D?O?tr:qt:O?er:Vt;x[R]>k[R]&&(L=Yo(L));var A=Yo(L),q=[];if(i&&q.push(P[B]<=0),l&&q.push(P[L]<=0,P[A]<=0),q.every(function(F){return F})){S=N,_=!1;break}E.set(N,q)}if(_)for(var U=p?3:1,z=function(F){var $=C.find(function(V){var G=E.get(V);if(G)return G.slice(0,F).every(function(j){return j})});if($)return S=$,"break"},H=U;H>0;H--){var Q=z(H);if(Q==="break")break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}}var jD={name:"flip",enabled:!0,phase:"main",fn:UD,requiresIfExists:["offset"],data:{_skip:!1}};function Jm(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 Qm(t){return[Vt,tr,er,qt].some(function(e){return t[e]>=0})}function WD(t){var e=t.state,r=t.name,n=e.rects.reference,a=e.rects.popper,i=e.modifiersData.preventOverflow,o=Ti(e,{elementContext:"reference"}),l=Ti(e,{altBoundary:!0}),c=Jm(o,n),u=Jm(l,a,i),d=Qm(c),f=Qm(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 YD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:WD};function ZD(t,e,r){var n=Tr(t),a=[qt,Vt].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,o=i[0],l=i[1];return o=o||0,l=(l||0)*a,[qt,tr].indexOf(n)>=0?{x:l,y:o}:{x:o,y:l}}function XD(t){var e=t.state,r=t.options,n=t.name,a=r.offset,i=a===void 0?[0,0]:a,o=Go.reduce(function(d,f){return d[f]=ZD(f,e.rects,i),d},{}),l=o[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]=o}var JD={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:XD};function QD(t){var e=t.state,r=t.name;e.modifiersData[r]=Xm({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var ey={name:"popperOffsets",enabled:!0,phase:"read",fn:QD,data:{}};function eO(t){return t==="x"?"y":"x"}function tO(t){var e=t.state,r=t.options,n=t.name,a=r.mainAxis,i=a===void 0?!0:a,o=r.altAxis,l=o===void 0?!1:o,c=r.boundary,u=r.rootBoundary,d=r.altBoundary,f=r.padding,h=r.tether,v=h===void 0?!0:h,p=r.tetherOffset,g=p===void 0?0:p,m=Ti(e,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),y=Tr(e.placement),b=Sa(e.placement),w=!b,C=Zl(y),x=eO(C),k=e.modifiersData.popperOffsets,E=e.rects.reference,_=e.rects.popper,S=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,T=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),N=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,B={x:0,y:0};if(k){if(i){var O,D=C==="y"?Vt:qt,R=C==="y"?er:tr,P=C==="y"?"height":"width",L=k[C],A=L+m[D],q=L-m[R],U=v?-_[P]/2:0,z=b===Ca?E[P]:_[P],H=b===Ca?-_[P]:-E[P],Q=e.elements.arrow,F=v&&Q?Yl(Q):{width:0,height:0},$=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:zm(),V=$[D],G=$[R],j=Si(0,E[P],F[P]),M=w?E[P]/2-U-j-V-T.mainAxis:z-j-V-T.mainAxis,W=w?-E[P]/2+U+j+G+T.mainAxis:H+j+G+T.mainAxis,Y=e.elements.arrow&&ki(e.elements.arrow),se=Y?C==="y"?Y.clientTop||0:Y.clientLeft||0:0,ce=(O=N==null?void 0:N[C])!=null?O:0,ae=L+M-ce-se,ne=L+W-ce,ue=Si(v?Uo(A,ae):A,L,v?Hn(q,ne):q);k[C]=ue,B[C]=ue-L}if(l){var ie,fe=C==="x"?Vt:qt,pe=C==="x"?er:tr,De=k[x],Ie=x==="y"?"height":"width",we=De+m[fe],xe=De-m[pe],re=[Vt,qt].indexOf(y)!==-1,I=(ie=N==null?void 0:N[x])!=null?ie:0,K=re?we:De-E[Ie]-_[Ie]-I+T.altAxis,te=re?De+E[Ie]+_[Ie]-I-T.altAxis:xe,Z=v&&re?ND(K,De,te):Si(v?K:we,De,v?te:xe);k[x]=Z,B[x]=Z-De}e.modifiersData[n]=B}}var rO={name:"preventOverflow",enabled:!0,phase:"main",fn:tO,requiresIfExists:["offset"]};function nO(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function aO(t){return t===fr(t)||!rr(t)?Xl(t):nO(t)}function iO(t){var e=t.getBoundingClientRect(),r=xa(e.width)/t.offsetWidth||1,n=xa(e.height)/t.offsetHeight||1;return r!==1||n!==1}function oO(t,e,r){r===void 0&&(r=!1);var n=rr(e),a=rr(e)&&iO(e),i=dn(e),o=ka(t,a),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((_r(e)!=="body"||Ql(i))&&(l=aO(e)),rr(e)?(c=ka(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=Jl(i))),{x:o.left+l.scrollLeft-c.x,y:o.top+l.scrollTop-c.y,width:o.width,height:o.height}}function sO(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 o=[].concat(i.requires||[],i.requiresIfExists||[]);o.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 lO(t){var e=sO(t);return xD.reduce(function(r,n){return r.concat(e.filter(function(a){return a.phase===n}))},[])}function uO(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function cO(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 ty={placement:"bottom",modifiers:[],strategy:"absolute"};function ry(){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 tu(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,a=e.defaultOptions,i=a===void 0?ty:a;return function(o,l,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},ty,i),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},d=[],f=!1,h={state:u,setOptions:function(g){var m=typeof g=="function"?g(u.options):g;p(),u.options=Object.assign({},i,u.options,m),u.scrollParents={reference:Ea(o)?_i(o):o.contextElement?_i(o.contextElement):[],popper:_i(l)};var y=lO(cO([].concat(n,u.options.modifiers)));return u.orderedModifiers=y.filter(function(b){return b.enabled}),v(),h.update()},forceUpdate:function(){if(!f){var g=u.elements,m=g.reference,y=g.popper;if(ry(m,y)){u.rects={reference:oO(m,ki(y),u.options.strategy==="fixed"),popper:Yl(y)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(_){return u.modifiersData[_.name]=Object.assign({},_.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,k=x===void 0?{}:x,E=w.name;typeof C=="function"&&(u=C({state:u,options:k,name:E,instance:h})||u)}}}},update:uO(function(){return new Promise(function(g){h.forceUpdate(),g(u)})}),destroy:function(){p(),f=!0}};if(!ry(o,l))return h;h.setOptions(c).then(function(g){!f&&c.onFirstUpdate&&c.onFirstUpdate(g)});function v(){u.orderedModifiers.forEach(function(g){var m=g.name,y=g.options,b=y===void 0?{}:y,w=g.effect;if(typeof w=="function"){var C=w({state:u,name:m,instance:h,options:b}),x=function(){};d.push(C||x)}})}function p(){d.forEach(function(g){return g()}),d=[]}return h}}tu();var dO=[jm,ey,Um,$m];tu({defaultModifiers:dO});var fO=[jm,ey,Um,$m,JD,jD,rO,OD,YD],hO=tu({defaultModifiers:fO});const pO=(t,e,r={})=>{const n={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=vO(c);Object.assign(o.value,u)},requires:["computeStyles"]},a=s.computed(()=>{const{onFirstUpdate:c,placement:u,strategy:d,modifiers:f}=s.unref(r);return{onFirstUpdate:c,placement:u||"bottom",strategy:d||"absolute",modifiers:[...f||[],n,{name:"applyStyles",enabled:!1}]}}),i=s.shallowRef(),o=s.ref({styles:{popper:{position:s.unref(a).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{i.value&&(i.value.destroy(),i.value=void 0)};return s.watch(a,c=>{const u=s.unref(i);u&&u.setOptions(c)},{deep:!0}),s.watch([t,e],([c,u])=>{l(),!(!c||!u)&&(i.value=hO(c,u,s.unref(a)))}),s.onBeforeUnmount(()=>{l()}),{state:s.computed(()=>{var c;return{...((c=s.unref(i))==null?void 0:c.state)||{}}}),styles:s.computed(()=>s.unref(o).styles),attributes:s.computed(()=>s.unref(o).attributes),update:()=>{var c;return(c=s.unref(i))==null?void 0:c.update()},forceUpdate:()=>{var c;return(c=s.unref(i))==null?void 0:c.forceUpdate()},instanceRef:s.computed(()=>s.unref(i))}};function vO(t){const e=Object.keys(t.elements),r=$o(e.map(a=>[a,t.styles[a]||{}])),n=$o(e.map(a=>[a,t.attributes[a]]));return{styles:r,attributes:n}}function ny(){let t;const e=(n,a)=>{r(),t=window.setTimeout(n,a)},r=()=>window.clearTimeout(t);return Io(()=>r()),{registerTimeout:e,cancelTimeout:r}}const ru={prefix:Math.floor(Math.random()*1e4),current:0},gO=Symbol("elIdInjection"),ay=()=>s.getCurrentInstance()?s.inject(gO,ru):ru,Zo=t=>{const e=ay();!rt&&e===ru&&nt("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 lD={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 uD=t=>(e,r)=>cD(e,r,s.unref(t)),cD=(t,e,r)=>Hr(r,t,t).replace(/\{(\w+)\}/g,(n,a)=>{var i;return`${(i=e==null?void 0:e[a])!=null?i:`{${a}}`}`}),dD=t=>{const e=s.computed(()=>s.unref(t).name),r=s.isRef(t)?t:s.ref(t);return{lang:e,locale:r,t:uD(t)}},Mm=Symbol("localeContextKey"),xi=t=>{const e=t||s.inject(Mm,s.ref());return dD(s.computed(()=>e.value||lD))},Uo="el",fD="is-",zn=(t,e,r,n,a)=>{let i=`${t}-${e}`;return r&&(i+=`-${r}`),n&&(i+=`__${n}`),a&&(i+=`--${a}`),i},$m=Symbol("namespaceContextKey"),Wl=t=>{const e=t||(s.getCurrentInstance()?s.inject($m,s.ref(Uo)):s.ref(Uo));return s.computed(()=>s.unref(e)||Uo)},De=(t,e)=>{const r=Wl(e);return{namespace:r,b:(g="")=>zn(r.value,t,g,"",""),e:g=>g?zn(r.value,t,"",g,""):"",m:g=>g?zn(r.value,t,"","",g):"",be:(g,y)=>g&&y?zn(r.value,t,g,y,""):"",em:(g,y)=>g&&y?zn(r.value,t,"",g,y):"",bm:(g,y)=>g&&y?zn(r.value,t,g,"",y):"",bem:(g,y,m)=>g&&y&&m?zn(r.value,t,g,y,m):"",is:(g,...y)=>{const m=y.length>=1?y[0]:!0;return g&&m?`${fD}${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}`}},hD=Ko({type:ke(Boolean),default:null}),pD=Ko({type:ke(Function)}),vD=t=>{const e=`update:${t}`,r=`onUpdate:${t}`,n=[e],a={[t]:hD,[r]:pD};return{useModelToggle:({indicator:o,toggleReason:l,shouldHideWhenRouteChanges:c,shouldProceed:u,onShow:d,onHide:f})=>{const h=s.getCurrentInstance(),{emit:v}=h,p=h.props,g=s.computed(()=>Mt(p[r])),y=s.computed(()=>p[t]===null),m=E=>{o.value!==!0&&(o.value=!0,l&&(l.value=E),Mt(d)&&d(E))},b=E=>{o.value!==!1&&(o.value=!1,l&&(l.value=E),Mt(f)&&f(E))},w=E=>{if(p.disabled===!0||Mt(u)&&!u())return;const _=g.value&&nt;_&&v(e,!0),(y.value||!_)&&m(E)},C=E=>{if(p.disabled===!0||!nt)return;const _=g.value&&nt;_&&v(e,!1),(y.value||!_)&&b(E)},x=E=>{ba(E)&&(p.disabled&&E?g.value&&v(e,!1):o.value!==E&&(E?m():b()))},k=()=>{o.value?C():w()};return s.watch(()=>p[t],x),c&&h.appContext.config.globalProperties.$route!==void 0&&s.watch(()=>({...h.proxy.$route}),()=>{c.value&&o.value&&C()}),s.onMounted(()=>{x(p[t])}),{hide:C,show:w,toggle:k,hasUpdateHandler:g}},useModelToggleProps:a,useModelToggleEmits:n}},Vm=t=>{const e=s.getCurrentInstance();return s.computed(()=>{var r,n;return(n=(r=e==null?void 0:e.proxy)==null?void 0:r.$props)==null?void 0:n[t]})};var qt="top",er="bottom",tr="right",zt="left",Yl="auto",ki=[qt,er,tr,zt],Ea="start",Si="end",gD="clippingParents",qm="viewport",_i="popper",mD="reference",zm=ki.reduce(function(t,e){return t.concat([e+"-"+Ea,e+"-"+Si])},[]),jo=[].concat(ki,[Yl]).reduce(function(t,e){return t.concat([e,e+"-"+Ea,e+"-"+Si])},[]),yD="beforeRead",bD="read",wD="afterRead",CD="beforeMain",ED="main",xD="afterMain",kD="beforeWrite",SD="write",_D="afterWrite",TD=[yD,bD,wD,CD,ED,xD,kD,SD,_D];function _r(t){return t?(t.nodeName||"").toLowerCase():null}function fr(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function xa(t){var e=fr(t).Element;return t instanceof e||t instanceof Element}function rr(t){var e=fr(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Zl(t){if(typeof ShadowRoot>"u")return!1;var e=fr(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function ND(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];!rr(i)||!_r(i)||(Object.assign(i.style,n),Object.keys(a).forEach(function(o){var l=a[o];l===!1?i.removeAttribute(o):i.setAttribute(o,l===!0?"":l)}))})}function ID(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]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:r[n]),l=o.reduce(function(c,u){return c[u]="",c},{});!rr(a)||!_r(a)||(Object.assign(a.style,l),Object.keys(i).forEach(function(c){a.removeAttribute(c)}))})}}var Hm={name:"applyStyles",enabled:!0,phase:"write",fn:ND,effect:ID,requires:["computeStyles"]};function Tr(t){return t.split("-")[0]}var Hn=Math.max,Wo=Math.min,ka=Math.round;function Sa(t,e){e===void 0&&(e=!1);var r=t.getBoundingClientRect(),n=1,a=1;if(rr(t)&&e){var i=t.offsetHeight,o=t.offsetWidth;o>0&&(n=ka(r.width)/o||1),i>0&&(a=ka(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 Xl(t){var e=Sa(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 Km(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&Zl(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ur(t){return fr(t).getComputedStyle(t)}function BD(t){return["table","td","th"].indexOf(_r(t))>=0}function fn(t){return((xa(t)?t.ownerDocument:t.document)||window.document).documentElement}function Yo(t){return _r(t)==="html"?t:t.assignedSlot||t.parentNode||(Zl(t)?t.host:null)||fn(t)}function Gm(t){return!rr(t)||Ur(t).position==="fixed"?null:t.offsetParent}function DD(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,r=navigator.userAgent.indexOf("Trident")!==-1;if(r&&rr(t)){var n=Ur(t);if(n.position==="fixed")return null}var a=Yo(t);for(Zl(a)&&(a=a.host);rr(a)&&["html","body"].indexOf(_r(a))<0;){var i=Ur(a);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return a;a=a.parentNode}return null}function Ti(t){for(var e=fr(t),r=Gm(t);r&&BD(r)&&Ur(r).position==="static";)r=Gm(r);return r&&(_r(r)==="html"||_r(r)==="body"&&Ur(r).position==="static")?e:r||DD(t)||e}function Jl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ni(t,e,r){return Hn(t,Wo(e,r))}function PD(t,e,r){var n=Ni(t,e,r);return n>r?r:n}function Um(){return{top:0,right:0,bottom:0,left:0}}function jm(t){return Object.assign({},Um(),t)}function Wm(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var OD=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,jm(typeof t!="number"?t:Wm(t,ki))};function AD(t){var e,r=t.state,n=t.name,a=t.options,i=r.elements.arrow,o=r.modifiersData.popperOffsets,l=Tr(r.placement),c=Jl(l),u=[zt,tr].indexOf(l)>=0,d=u?"height":"width";if(!(!i||!o)){var f=OD(a.padding,r),h=Xl(i),v=c==="y"?qt:zt,p=c==="y"?er:tr,g=r.rects.reference[d]+r.rects.reference[c]-o[c]-r.rects.popper[d],y=o[c]-r.rects.reference[c],m=Ti(i),b=m?c==="y"?m.clientHeight||0:m.clientWidth||0:0,w=g/2-y/2,C=f[v],x=b-h[d]-f[p],k=b/2-h[d]/2+w,E=Ni(C,k,x),_=c;r.modifiersData[n]=(e={},e[_]=E,e.centerOffset=E-k,e)}}function RD(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)||!Km(e.elements.popper,a)||(e.elements.arrow=a))}var LD={name:"arrow",enabled:!0,phase:"main",fn:AD,effect:RD,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function _a(t){return t.split("-")[1]}var FD={top:"auto",right:"auto",bottom:"auto",left:"auto"};function MD(t){var e=t.x,r=t.y,n=window,a=n.devicePixelRatio||1;return{x:ka(e*a)/a||0,y:ka(r*a)/a||0}}function Ym(t){var e,r=t.popper,n=t.popperRect,a=t.placement,i=t.variation,o=t.offsets,l=t.position,c=t.gpuAcceleration,u=t.adaptive,d=t.roundOffsets,f=t.isFixed,h=o.x,v=h===void 0?0:h,p=o.y,g=p===void 0?0:p,y=typeof d=="function"?d({x:v,y:g}):{x:v,y:g};v=y.x,g=y.y;var m=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),w=zt,C=qt,x=window;if(u){var k=Ti(r),E="clientHeight",_="clientWidth";if(k===fr(r)&&(k=fn(r),Ur(k).position!=="static"&&l==="absolute"&&(E="scrollHeight",_="scrollWidth")),k=k,a===qt||(a===zt||a===tr)&&i===Si){C=er;var S=f&&k===x&&x.visualViewport?x.visualViewport.height:k[E];g-=S-n.height,g*=c?1:-1}if(a===zt||(a===qt||a===er)&&i===Si){w=tr;var T=f&&k===x&&x.visualViewport?x.visualViewport.width:k[_];v-=T-n.width,v*=c?1:-1}}var N=Object.assign({position:l},u&&FD),B=d===!0?MD({x:v,y:g}):{x:v,y:g};if(v=B.x,g=B.y,c){var P;return Object.assign({},N,(P={},P[C]=b?"0":"",P[w]=m?"0":"",P.transform=(x.devicePixelRatio||1)<=1?"translate("+v+"px, "+g+"px)":"translate3d("+v+"px, "+g+"px, 0)",P))}return Object.assign({},N,(e={},e[C]=b?g+"px":"",e[w]=m?v+"px":"",e.transform="",e))}function $D(t){var e=t.state,r=t.options,n=r.gpuAcceleration,a=n===void 0?!0:n,i=r.adaptive,o=i===void 0?!0:i,l=r.roundOffsets,c=l===void 0?!0:l,u={placement:Tr(e.placement),variation:_a(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,Ym(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ym(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 Zm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:$D,data:{}},Zo={passive:!0};function VD(t){var e=t.state,r=t.instance,n=t.options,a=n.scroll,i=a===void 0?!0:a,o=n.resize,l=o===void 0?!0:o,c=fr(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",r.update,Zo)}),l&&c.addEventListener("resize",r.update,Zo),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",r.update,Zo)}),l&&c.removeEventListener("resize",r.update,Zo)}}var Xm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:VD,data:{}},qD={left:"right",right:"left",bottom:"top",top:"bottom"};function Xo(t){return t.replace(/left|right|bottom|top/g,function(e){return qD[e]})}var zD={start:"end",end:"start"};function Jm(t){return t.replace(/start|end/g,function(e){return zD[e]})}function Ql(t){var e=fr(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function eu(t){return Sa(fn(t)).left+Ql(t).scrollLeft}function HD(t){var e=fr(t),r=fn(t),n=e.visualViewport,a=r.clientWidth,i=r.clientHeight,o=0,l=0;return n&&(a=n.width,i=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=n.offsetLeft,l=n.offsetTop)),{width:a,height:i,x:o+eu(t),y:l}}function KD(t){var e,r=fn(t),n=Ql(t),a=(e=t.ownerDocument)==null?void 0:e.body,i=Hn(r.scrollWidth,r.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),o=Hn(r.scrollHeight,r.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),l=-n.scrollLeft+eu(t),c=-n.scrollTop;return Ur(a||r).direction==="rtl"&&(l+=Hn(r.clientWidth,a?a.clientWidth:0)-i),{width:i,height:o,x:l,y:c}}function tu(t){var e=Ur(t),r=e.overflow,n=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+a+n)}function Qm(t){return["html","body","#document"].indexOf(_r(t))>=0?t.ownerDocument.body:rr(t)&&tu(t)?t:Qm(Yo(t))}function Ii(t,e){var r;e===void 0&&(e=[]);var n=Qm(t),a=n===((r=t.ownerDocument)==null?void 0:r.body),i=fr(n),o=a?[i].concat(i.visualViewport||[],tu(n)?n:[]):n,l=e.concat(o);return a?l:l.concat(Ii(Yo(o)))}function ru(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function GD(t){var e=Sa(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 ey(t,e){return e===qm?ru(HD(t)):xa(e)?GD(e):ru(KD(fn(t)))}function UD(t){var e=Ii(Yo(t)),r=["absolute","fixed"].indexOf(Ur(t).position)>=0,n=r&&rr(t)?Ti(t):t;return xa(n)?e.filter(function(a){return xa(a)&&Km(a,n)&&_r(a)!=="body"}):[]}function jD(t,e,r){var n=e==="clippingParents"?UD(t):[].concat(e),a=[].concat(n,[r]),i=a[0],o=a.reduce(function(l,c){var u=ey(t,c);return l.top=Hn(u.top,l.top),l.right=Wo(u.right,l.right),l.bottom=Wo(u.bottom,l.bottom),l.left=Hn(u.left,l.left),l},ey(t,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function ty(t){var e=t.reference,r=t.element,n=t.placement,a=n?Tr(n):null,i=n?_a(n):null,o=e.x+e.width/2-r.width/2,l=e.y+e.height/2-r.height/2,c;switch(a){case qt:c={x:o,y:e.y-r.height};break;case er:c={x:o,y:e.y+e.height};break;case tr:c={x:e.x+e.width,y:l};break;case zt:c={x:e.x-r.width,y:l};break;default:c={x:e.x,y:e.y}}var u=a?Jl(a):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case Ea:c[u]=c[u]-(e[d]/2-r[d]/2);break;case Si:c[u]=c[u]+(e[d]/2-r[d]/2);break}}return c}function Bi(t,e){e===void 0&&(e={});var r=e,n=r.placement,a=n===void 0?t.placement:n,i=r.boundary,o=i===void 0?gD:i,l=r.rootBoundary,c=l===void 0?qm:l,u=r.elementContext,d=u===void 0?_i:u,f=r.altBoundary,h=f===void 0?!1:f,v=r.padding,p=v===void 0?0:v,g=jm(typeof p!="number"?p:Wm(p,ki)),y=d===_i?mD:_i,m=t.rects.popper,b=t.elements[h?y:d],w=jD(xa(b)?b:b.contextElement||fn(t.elements.popper),o,c),C=Sa(t.elements.reference),x=ty({reference:C,element:m,strategy:"absolute",placement:a}),k=ru(Object.assign({},m,x)),E=d===_i?k:C,_={top:w.top-E.top+g.top,bottom:E.bottom-w.bottom+g.bottom,left:w.left-E.left+g.left,right:E.right-w.right+g.right},S=t.modifiersData.offset;if(d===_i&&S){var T=S[a];Object.keys(_).forEach(function(N){var B=[tr,er].indexOf(N)>=0?1:-1,P=[qt,er].indexOf(N)>=0?"y":"x";_[N]+=T[P]*B})}return _}function WD(t,e){e===void 0&&(e={});var r=e,n=r.placement,a=r.boundary,i=r.rootBoundary,o=r.padding,l=r.flipVariations,c=r.allowedAutoPlacements,u=c===void 0?jo:c,d=_a(n),f=d?l?zm:zm.filter(function(p){return _a(p)===d}):ki,h=f.filter(function(p){return u.indexOf(p)>=0});h.length===0&&(h=f);var v=h.reduce(function(p,g){return p[g]=Bi(t,{placement:g,boundary:a,rootBoundary:i,padding:o})[Tr(g)],p},{});return Object.keys(v).sort(function(p,g){return v[p]-v[g]})}function YD(t){if(Tr(t)===Yl)return[];var e=Xo(t);return[Jm(t),e,Jm(e)]}function ZD(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,o=r.altAxis,l=o===void 0?!0:o,c=r.fallbackPlacements,u=r.padding,d=r.boundary,f=r.rootBoundary,h=r.altBoundary,v=r.flipVariations,p=v===void 0?!0:v,g=r.allowedAutoPlacements,y=e.options.placement,m=Tr(y),b=m===y,w=c||(b||!p?[Xo(y)]:YD(y)),C=[y].concat(w).reduce(function(M,V){return M.concat(Tr(V)===Yl?WD(e,{placement:V,boundary:d,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:g}):V)},[]),x=e.rects.reference,k=e.rects.popper,E=new Map,_=!0,S=C[0],T=0;T<C.length;T++){var N=C[T],B=Tr(N),P=_a(N)===Ea,D=[qt,er].indexOf(B)>=0,R=D?"width":"height",O=Bi(e,{placement:N,boundary:d,rootBoundary:f,altBoundary:h,padding:u}),F=D?P?tr:zt:P?er:qt;x[R]>k[R]&&(F=Xo(F));var A=Xo(F),z=[];if(i&&z.push(O[B]<=0),l&&z.push(O[F]<=0,O[A]<=0),z.every(function(M){return M})){S=N,_=!1;break}E.set(N,z)}if(_)for(var j=p?3:1,H=function(M){var V=C.find(function(q){var $=E.get(q);if($)return $.slice(0,M).every(function(K){return K})});if(V)return S=V,"break"},G=j;G>0;G--){var X=H(G);if(X==="break")break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}}var XD={name:"flip",enabled:!0,phase:"main",fn:ZD,requiresIfExists:["offset"],data:{_skip:!1}};function ry(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 ny(t){return[qt,tr,er,zt].some(function(e){return t[e]>=0})}function JD(t){var e=t.state,r=t.name,n=e.rects.reference,a=e.rects.popper,i=e.modifiersData.preventOverflow,o=Bi(e,{elementContext:"reference"}),l=Bi(e,{altBoundary:!0}),c=ry(o,n),u=ry(l,a,i),d=ny(c),f=ny(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 QD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:JD};function eP(t,e,r){var n=Tr(t),a=[zt,qt].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,o=i[0],l=i[1];return o=o||0,l=(l||0)*a,[zt,tr].indexOf(n)>=0?{x:l,y:o}:{x:o,y:l}}function tP(t){var e=t.state,r=t.options,n=t.name,a=r.offset,i=a===void 0?[0,0]:a,o=jo.reduce(function(d,f){return d[f]=eP(f,e.rects,i),d},{}),l=o[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]=o}var rP={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:tP};function nP(t){var e=t.state,r=t.name;e.modifiersData[r]=ty({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var ay={name:"popperOffsets",enabled:!0,phase:"read",fn:nP,data:{}};function aP(t){return t==="x"?"y":"x"}function iP(t){var e=t.state,r=t.options,n=t.name,a=r.mainAxis,i=a===void 0?!0:a,o=r.altAxis,l=o===void 0?!1:o,c=r.boundary,u=r.rootBoundary,d=r.altBoundary,f=r.padding,h=r.tether,v=h===void 0?!0:h,p=r.tetherOffset,g=p===void 0?0:p,y=Bi(e,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),m=Tr(e.placement),b=_a(e.placement),w=!b,C=Jl(m),x=aP(C),k=e.modifiersData.popperOffsets,E=e.rects.reference,_=e.rects.popper,S=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,T=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),N=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,B={x:0,y:0};if(k){if(i){var P,D=C==="y"?qt:zt,R=C==="y"?er:tr,O=C==="y"?"height":"width",F=k[C],A=F+y[D],z=F-y[R],j=v?-_[O]/2:0,H=b===Ea?E[O]:_[O],G=b===Ea?-_[O]:-E[O],X=e.elements.arrow,M=v&&X?Xl(X):{width:0,height:0},V=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Um(),q=V[D],$=V[R],K=Ni(0,E[O],M[O]),L=w?E[O]/2-j-K-q-T.mainAxis:H-K-q-T.mainAxis,W=w?-E[O]/2+j+K+$+T.mainAxis:G+K+$+T.mainAxis,Y=e.elements.arrow&&Ti(e.elements.arrow),se=Y?C==="y"?Y.clientTop||0:Y.clientLeft||0:0,ue=(P=N==null?void 0:N[C])!=null?P:0,ae=F+L-ue-se,ne=F+W-ue,ce=Ni(v?Wo(A,ae):A,F,v?Hn(z,ne):z);k[C]=ce,B[C]=ce-F}if(l){var ie,fe=C==="x"?qt:zt,pe=C==="x"?er:tr,Pe=k[x],Ie=x==="y"?"height":"width",we=Pe+y[fe],xe=Pe-y[pe],re=[qt,zt].indexOf(m)!==-1,I=(ie=N==null?void 0:N[x])!=null?ie:0,U=re?we:Pe-E[Ie]-_[Ie]-I+T.altAxis,te=re?Pe+E[Ie]+_[Ie]-I-T.altAxis:xe,Z=v&&re?PD(U,Pe,te):Ni(v?U:we,Pe,v?te:xe);k[x]=Z,B[x]=Z-Pe}e.modifiersData[n]=B}}var oP={name:"preventOverflow",enabled:!0,phase:"main",fn:iP,requiresIfExists:["offset"]};function sP(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function lP(t){return t===fr(t)||!rr(t)?Ql(t):sP(t)}function uP(t){var e=t.getBoundingClientRect(),r=ka(e.width)/t.offsetWidth||1,n=ka(e.height)/t.offsetHeight||1;return r!==1||n!==1}function cP(t,e,r){r===void 0&&(r=!1);var n=rr(e),a=rr(e)&&uP(e),i=fn(e),o=Sa(t,a),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((_r(e)!=="body"||tu(i))&&(l=lP(e)),rr(e)?(c=Sa(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=eu(i))),{x:o.left+l.scrollLeft-c.x,y:o.top+l.scrollTop-c.y,width:o.width,height:o.height}}function dP(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 o=[].concat(i.requires||[],i.requiresIfExists||[]);o.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 fP(t){var e=dP(t);return TD.reduce(function(r,n){return r.concat(e.filter(function(a){return a.phase===n}))},[])}function hP(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function pP(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 iy={placement:"bottom",modifiers:[],strategy:"absolute"};function oy(){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 nu(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,a=e.defaultOptions,i=a===void 0?iy:a;return function(o,l,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},iy,i),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},d=[],f=!1,h={state:u,setOptions:function(g){var y=typeof g=="function"?g(u.options):g;p(),u.options=Object.assign({},i,u.options,y),u.scrollParents={reference:xa(o)?Ii(o):o.contextElement?Ii(o.contextElement):[],popper:Ii(l)};var m=fP(pP([].concat(n,u.options.modifiers)));return u.orderedModifiers=m.filter(function(b){return b.enabled}),v(),h.update()},forceUpdate:function(){if(!f){var g=u.elements,y=g.reference,m=g.popper;if(oy(y,m)){u.rects={reference:cP(y,Ti(m),u.options.strategy==="fixed"),popper:Xl(m)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(_){return u.modifiersData[_.name]=Object.assign({},_.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,k=x===void 0?{}:x,E=w.name;typeof C=="function"&&(u=C({state:u,options:k,name:E,instance:h})||u)}}}},update:hP(function(){return new Promise(function(g){h.forceUpdate(),g(u)})}),destroy:function(){p(),f=!0}};if(!oy(o,l))return h;h.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:h,options:b}),x=function(){};d.push(C||x)}})}function p(){d.forEach(function(g){return g()}),d=[]}return h}}nu();var vP=[Xm,ay,Zm,Hm];nu({defaultModifiers:vP});var gP=[Xm,ay,Zm,Hm,rP,XD,oP,LD,QD],mP=nu({defaultModifiers:gP});const yP=(t,e,r={})=>{const n={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=bP(c);Object.assign(o.value,u)},requires:["computeStyles"]},a=s.computed(()=>{const{onFirstUpdate:c,placement:u,strategy:d,modifiers:f}=s.unref(r);return{onFirstUpdate:c,placement:u||"bottom",strategy:d||"absolute",modifiers:[...f||[],n,{name:"applyStyles",enabled:!1}]}}),i=s.shallowRef(),o=s.ref({styles:{popper:{position:s.unref(a).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{i.value&&(i.value.destroy(),i.value=void 0)};return s.watch(a,c=>{const u=s.unref(i);u&&u.setOptions(c)},{deep:!0}),s.watch([t,e],([c,u])=>{l(),!(!c||!u)&&(i.value=mP(c,u,s.unref(a)))}),s.onBeforeUnmount(()=>{l()}),{state:s.computed(()=>{var c;return{...((c=s.unref(i))==null?void 0:c.state)||{}}}),styles:s.computed(()=>s.unref(o).styles),attributes:s.computed(()=>s.unref(o).attributes),update:()=>{var c;return(c=s.unref(i))==null?void 0:c.update()},forceUpdate:()=>{var c;return(c=s.unref(i))==null?void 0:c.forceUpdate()},instanceRef:s.computed(()=>s.unref(i))}};function bP(t){const e=Object.keys(t.elements),r=qo(e.map(a=>[a,t.styles[a]||{}])),n=qo(e.map(a=>[a,t.attributes[a]]));return{styles:r,attributes:n}}function sy(){let t;const e=(n,a)=>{r(),t=window.setTimeout(n,a)},r=()=>window.clearTimeout(t);return Do(()=>r()),{registerTimeout:e,cancelTimeout:r}}const au={prefix:Math.floor(Math.random()*1e4),current:0},wP=Symbol("elIdInjection"),ly=()=>s.getCurrentInstance()?s.inject(wP,au):au,Di=t=>{const e=ly();!nt&&e===au&&at("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=Ul();return s.computed(()=>s.unref(t)||`${r.value}-id-${e.prefix}-${e.current++}`)};let _a=[];const iy=t=>{const e=t;e.key===lt.esc&&_a.forEach(r=>r(e))},mO=t=>{s.onMounted(()=>{_a.length===0&&document.addEventListener("keydown",iy),rt&&_a.push(t)}),s.onBeforeUnmount(()=>{_a=_a.filter(e=>e!==t),_a.length===0&&rt&&document.removeEventListener("keydown",iy)})};let oy;const sy=()=>{const t=Ul(),e=ay(),r=s.computed(()=>`${t.value}-popper-container-${e.prefix}`),n=s.computed(()=>`#${r.value}`);return{id:r,selector:n}},yO=t=>{const e=document.createElement("div");return e.id=t,document.body.appendChild(e),e},bO=()=>{const{id:t,selector:e}=sy();return s.onBeforeMount(()=>{rt&&(process.env.NODE_ENV==="test"||!oy||!document.body.querySelector(e.value))&&(oy=yO(t.value))}),{id:t,selector:e}},wO=Fe({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),CO=({showAfter:t,hideAfter:e,autoClose:r,open:n,close:a})=>{const{registerTimeout:i}=ny(),{registerTimeout:o,cancelTimeout:l}=ny();return{onOpen:d=>{i(()=>{n(d);const f=s.unref(r);wt(f)&&f>0&&o(()=>{a(d)},f)},s.unref(t))},onClose:d=>{l(),i(()=>{a(d)},s.unref(e))}}},ly=Symbol("elForwardRef"),EO=t=>{const e=r=>{t.value=r};s.provide(ly,{setForwardRef:e})},xO=t=>({mounted(e){t(e)},updated(e){t(e)},unmounted(){t(null)}}),uy={current:0},cy=s.ref(0),dy=2e3,fy=Symbol("elZIndexContextKey"),hy=Symbol("zIndexContextKey"),py=t=>{const e=s.getCurrentInstance()?s.inject(fy,uy):uy,r=t||(s.getCurrentInstance()?s.inject(hy,void 0):void 0),n=s.computed(()=>{const o=s.unref(r);return wt(o)?o:dy}),a=s.computed(()=>n.value+cy.value),i=()=>(e.current++,cy.value=e.current,a.value);return!rt&&!s.inject(fy)&&nt("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 kO(t){let e;function r(){if(t.value==null)return;const{selectionStart:a,selectionEnd:i,value:o}=t.value;if(a==null||i==null)return;const l=o.slice(0,Math.max(0,a)),c=o.slice(Math.max(0,i));e={selectionStart:a,selectionEnd:i,value:o,beforeTxt:l,afterTxt:c}}function n(){if(t.value==null||e==null)return;const{value:a}=t.value,{beforeTxt:i,afterTxt:o,selectionStart:l}=e;if(i==null||o==null||l==null)return;let c=a.length;if(a.endsWith(o))c=a.length-o.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 Ta=zo({type:String,values:Pm,required:!1}),vy=Symbol("size"),SO=()=>{const t=s.inject(vy,{});return s.computed(()=>s.unref(t.size)||"")};function nu(t,{beforeFocus:e,afterFocus:r,beforeBlur:n,afterBlur:a}={}){const i=s.getCurrentInstance(),{emit:o}=i,l=s.shallowRef(),c=s.ref(!1),u=h=>{Mt(e)&&e(h)||c.value||(c.value=!0,o("focus",h),r==null||r())},d=h=>{var v;Mt(n)&&n(h)||h.relatedTarget&&((v=l.value)!=null&&v.contains(h.relatedTarget))||(c.value=!1,o("blur",h),a==null||a())},f=()=>{var h,v;(h=l.value)!=null&&h.contains(document.activeElement)&&l.value!==document.activeElement||(v=t.value)==null||v.focus()};return s.watch(l,h=>{h&&h.setAttribute("tabindex","-1")}),Qt(l,"focus",u,!0),Qt(l,"blur",d,!0),Qt(l,"click",f,!0),process.env.NODE_ENV==="test"&&s.onMounted(()=>{const h=Vn(t.value)?t.value:document.querySelector("input,textarea");h&&(Qt(h,"focus",u,!0),Qt(h,"blur",d,!0))}),{isFocused:c,wrapperRef:l,handleFocus:u,handleBlur:d}}function gy({afterComposition:t,emit:e}){const r=s.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=!eD(d)},i=l=>{e==null||e("compositionend",l),r.value&&(r.value=!1,s.nextTick(()=>t(l)))};return{isComposing:r,handleComposition:l=>{l.type==="compositionend"?i(l):a(l)},handleCompositionStart:n,handleCompositionUpdate:a,handleCompositionEnd:i}}const my=Symbol("emptyValuesContextKey"),_O="use-empty-values",TO=["",void 0,null],NO=void 0,IO=Fe({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:t=>Mt(t)?!t():!t}}),BO=(t,e)=>{const r=s.getCurrentInstance()?s.inject(my,s.ref({})):s.ref({}),n=s.computed(()=>t.emptyValues||r.value.emptyValues||TO),a=s.computed(()=>Mt(t.valueOnClear)?t.valueOnClear():t.valueOnClear!==void 0?t.valueOnClear:Mt(r.value.valueOnClear)?r.value.valueOnClear():r.value.valueOnClear!==void 0?r.value.valueOnClear:NO),i=o=>n.value.includes(o);return n.value.includes(a.value)||nt(_O,"value-on-clear should be a value of empty-values"),{emptyValues:n,valueOnClear:a,isEmptyValue:i}},DO=Fe({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),fn=t=>Tm(DO,t),yy=Symbol(),Xo=s.ref();function au(t,e=void 0){const r=s.getCurrentInstance()?s.inject(yy,Xo):Xo;return t?s.computed(()=>{var n,a;return(a=(n=r.value)==null?void 0:n[t])!=null?a:e}):r}function OO(t,e){const r=au(),n=Oe(t,s.computed(()=>{var l;return((l=r.value)==null?void 0:l.namespace)||Ko})),a=wi(s.computed(()=>{var l;return(l=r.value)==null?void 0:l.locale})),i=py(s.computed(()=>{var l;return((l=r.value)==null?void 0:l.zIndex)||dy})),o=s.computed(()=>{var l;return s.unref(e)||((l=r.value)==null?void 0:l.size)||""});return PO(s.computed(()=>s.unref(r)||{})),{ns:n,locale:a,zIndex:i,size:o}}const PO=(t,e,r=!1)=>{var n;const a=!!s.getCurrentInstance(),i=a?au():void 0,o=(n=void 0)!=null?n:a?s.provide:void 0;if(!o){nt("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const l=s.computed(()=>{const c=s.unref(t);return i!=null&&i.value?AO(i.value,c):c});return o(yy,l),o(Am,s.computed(()=>l.value.locale)),o(Rm,s.computed(()=>l.value.namespace)),o(hy,s.computed(()=>l.value.zIndex)),o(vy,{size:s.computed(()=>l.value.size||"")}),o(my,s.computed(()=>({emptyValues:l.value.emptyValues,valueOnClear:l.value.valueOnClear}))),(r||!Xo.value)&&(Xo.value=l.value),l},AO=(t,e)=>{const r=[...new Set([...Nm(t),...Nm(e)])],n={};for(const a of r)n[a]=e[a]!==void 0?e[a]:t[a];return n};var Be=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r};const RO=Fe({size:{type:ke([Number,String])},color:{type:String}}),LO=s.defineComponent({name:"ElIcon",inheritAttrs:!1}),MO=s.defineComponent({...LO,props:RO,setup(t){const e=t,r=Oe("icon"),n=s.computed(()=>{const{size:a,color:i}=e;return!a&&!i?{}:{fontSize:un(a)?void 0:ba(a),"--color":i}});return(a,i)=>(s.openBlock(),s.createElementBlock("i",s.mergeProps({class:s.unref(r).b(),style:s.unref(n)},a.$attrs),[s.renderSlot(a.$slots,"default")],16))}});var FO=Be(MO,[["__file","icon.vue"]]);const ut=vt(FO),iu=Symbol("formContextKey"),Ni=Symbol("formItemContextKey"),Kn=(t,e={})=>{const r=s.ref(void 0),n=e.prop?r:Lm("size"),a=e.global?r:SO(),i=e.form?{size:void 0}:s.inject(iu,void 0),o=e.formItem?{size:void 0}:s.inject(Ni,void 0);return s.computed(()=>n.value||s.unref(t)||(o==null?void 0:o.size)||(i==null?void 0:i.size)||a.value||"")},Ii=t=>{const e=Lm("disabled"),r=s.inject(iu,void 0);return s.computed(()=>e.value||s.unref(t)||(r==null?void 0:r.disabled)||!1)},Gn=()=>{const t=s.inject(iu,void 0),e=s.inject(Ni,void 0);return{form:t,formItem:e}},Bi=(t,{formItemContext:e,disableIdGeneration:r,disableIdManagement:n})=>{r||(r=s.ref(!1)),n||(n=s.ref(!1));const a=s.ref();let i;const o=s.computed(()=>{var l;return!!(!(t.label||t.ariaLabel)&&e&&e.inputIds&&((l=e.inputIds)==null?void 0:l.length)<=1)});return s.onMounted(()=>{i=s.watch([s.toRef(t,"id"),r],([l,c])=>{const u=l??(c?void 0:Zo().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})}),s.onUnmounted(()=>{i&&i(),e!=null&&e.removeInputId&&a.value&&e.removeInputId(a.value)}),{isLabeledByFormItem:o,inputId:a}};let hr;const $O=`
11
+ })`);const r=Wl();return s.computed(()=>s.unref(t)||`${r.value}-id-${e.prefix}-${e.current++}`)};let Ta=[];const uy=t=>{const e=t;e.key===ft.esc&&Ta.forEach(r=>r(e))},CP=t=>{s.onMounted(()=>{Ta.length===0&&document.addEventListener("keydown",uy),nt&&Ta.push(t)}),s.onBeforeUnmount(()=>{Ta=Ta.filter(e=>e!==t),Ta.length===0&&nt&&document.removeEventListener("keydown",uy)})};let cy;const dy=()=>{const t=Wl(),e=ly(),r=s.computed(()=>`${t.value}-popper-container-${e.prefix}`),n=s.computed(()=>`#${r.value}`);return{id:r,selector:n}},EP=t=>{const e=document.createElement("div");return e.id=t,document.body.appendChild(e),e},xP=()=>{const{id:t,selector:e}=dy();return s.onBeforeMount(()=>{nt&&(process.env.NODE_ENV==="test"||!cy||!document.body.querySelector(e.value))&&(cy=EP(t.value))}),{id:t,selector:e}},kP=Me({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),SP=({showAfter:t,hideAfter:e,autoClose:r,open:n,close:a})=>{const{registerTimeout:i}=sy(),{registerTimeout:o,cancelTimeout:l}=sy();return{onOpen:d=>{i(()=>{n(d);const f=s.unref(r);xt(f)&&f>0&&o(()=>{a(d)},f)},s.unref(t))},onClose:d=>{l(),i(()=>{a(d)},s.unref(e))}}},fy=Symbol("elForwardRef"),_P=t=>{const e=r=>{t.value=r};s.provide(fy,{setForwardRef:e})},TP=t=>({mounted(e){t(e)},updated(e){t(e)},unmounted(){t(null)}}),hy={current:0},py=s.ref(0),vy=2e3,gy=Symbol("elZIndexContextKey"),my=Symbol("zIndexContextKey"),yy=t=>{const e=s.getCurrentInstance()?s.inject(gy,hy):hy,r=t||(s.getCurrentInstance()?s.inject(my,void 0):void 0),n=s.computed(()=>{const o=s.unref(r);return xt(o)?o:vy}),a=s.computed(()=>n.value+py.value),i=()=>(e.current++,py.value=e.current,a.value);return!nt&&!s.inject(gy)&&at("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 NP(t){let e;function r(){if(t.value==null)return;const{selectionStart:a,selectionEnd:i,value:o}=t.value;if(a==null||i==null)return;const l=o.slice(0,Math.max(0,a)),c=o.slice(Math.max(0,i));e={selectionStart:a,selectionEnd:i,value:o,beforeTxt:l,afterTxt:c}}function n(){if(t.value==null||e==null)return;const{value:a}=t.value,{beforeTxt:i,afterTxt:o,selectionStart:l}=e;if(i==null||o==null||l==null)return;let c=a.length;if(a.endsWith(o))c=a.length-o.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 Na=Ko({type:String,values:Lm,required:!1}),by=Symbol("size"),IP=()=>{const t=s.inject(by,{});return s.computed(()=>s.unref(t.size)||"")};function iu(t,{beforeFocus:e,afterFocus:r,beforeBlur:n,afterBlur:a}={}){const i=s.getCurrentInstance(),{emit:o}=i,l=s.shallowRef(),c=s.ref(!1),u=h=>{Mt(e)&&e(h)||c.value||(c.value=!0,o("focus",h),r==null||r())},d=h=>{var v;Mt(n)&&n(h)||h.relatedTarget&&((v=l.value)!=null&&v.contains(h.relatedTarget))||(c.value=!1,o("blur",h),a==null||a())},f=()=>{var h,v;(h=l.value)!=null&&h.contains(document.activeElement)&&l.value!==document.activeElement||(v=t.value)==null||v.focus()};return s.watch(l,h=>{h&&h.setAttribute("tabindex","-1")}),Qt(l,"focus",u,!0),Qt(l,"blur",d,!0),Qt(l,"click",f,!0),process.env.NODE_ENV==="test"&&s.onMounted(()=>{const h=Vn(t.value)?t.value:document.querySelector("input,textarea");h&&(Qt(h,"focus",u,!0),Qt(h,"blur",d,!0))}),{isFocused:c,wrapperRef:l,handleFocus:u,handleBlur:d}}function wy({afterComposition:t,emit:e}){const r=s.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=!iD(d)},i=l=>{e==null||e("compositionend",l),r.value&&(r.value=!1,s.nextTick(()=>t(l)))};return{isComposing:r,handleComposition:l=>{l.type==="compositionend"?i(l):a(l)},handleCompositionStart:n,handleCompositionUpdate:a,handleCompositionEnd:i}}const Cy=Symbol("emptyValuesContextKey"),BP="use-empty-values",DP=["",void 0,null],PP=void 0,OP=Me({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:t=>Mt(t)?!t():!t}}),AP=(t,e)=>{const r=s.getCurrentInstance()?s.inject(Cy,s.ref({})):s.ref({}),n=s.computed(()=>t.emptyValues||r.value.emptyValues||DP),a=s.computed(()=>Mt(t.valueOnClear)?t.valueOnClear():t.valueOnClear!==void 0?t.valueOnClear:Mt(r.value.valueOnClear)?r.value.valueOnClear():r.value.valueOnClear!==void 0?r.value.valueOnClear:PP),i=o=>n.value.includes(o);return n.value.includes(a.value)||at(BP,"value-on-clear should be a value of empty-values"),{emptyValues:n,valueOnClear:a,isEmptyValue:i}},RP=Me({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),jr=t=>Im(RP,t),Ey=Symbol(),Jo=s.ref();function ou(t,e=void 0){const r=s.getCurrentInstance()?s.inject(Ey,Jo):Jo;return t?s.computed(()=>{var n,a;return(a=(n=r.value)==null?void 0:n[t])!=null?a:e}):r}function LP(t,e){const r=ou(),n=De(t,s.computed(()=>{var l;return((l=r.value)==null?void 0:l.namespace)||Uo})),a=xi(s.computed(()=>{var l;return(l=r.value)==null?void 0:l.locale})),i=yy(s.computed(()=>{var l;return((l=r.value)==null?void 0:l.zIndex)||vy})),o=s.computed(()=>{var l;return s.unref(e)||((l=r.value)==null?void 0:l.size)||""});return FP(s.computed(()=>s.unref(r)||{})),{ns:n,locale:a,zIndex:i,size:o}}const FP=(t,e,r=!1)=>{var n;const a=!!s.getCurrentInstance(),i=a?ou():void 0,o=(n=void 0)!=null?n:a?s.provide:void 0;if(!o){at("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const l=s.computed(()=>{const c=s.unref(t);return i!=null&&i.value?MP(i.value,c):c});return o(Ey,l),o(Mm,s.computed(()=>l.value.locale)),o($m,s.computed(()=>l.value.namespace)),o(my,s.computed(()=>l.value.zIndex)),o(by,{size:s.computed(()=>l.value.size||"")}),o(Cy,s.computed(()=>({emptyValues:l.value.emptyValues,valueOnClear:l.value.valueOnClear}))),(r||!Jo.value)&&(Jo.value=l.value),l},MP=(t,e)=>{const r=[...new Set([...Bm(t),...Bm(e)])],n={};for(const a of r)n[a]=e[a]!==void 0?e[a]:t[a];return n};var Be=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r};const $P=Me({size:{type:ke([Number,String])},color:{type:String}}),VP=s.defineComponent({name:"ElIcon",inheritAttrs:!1}),qP=s.defineComponent({...VP,props:$P,setup(t){const e=t,r=De("icon"),n=s.computed(()=>{const{size:a,color:i}=e;return!a&&!i?{}:{fontSize:cn(a)?void 0:wa(a),"--color":i}});return(a,i)=>(s.openBlock(),s.createElementBlock("i",s.mergeProps({class:s.unref(r).b(),style:s.unref(n)},a.$attrs),[s.renderSlot(a.$slots,"default")],16))}});var zP=Be(qP,[["__file","icon.vue"]]);const it=dt(zP),su=Symbol("formContextKey"),Pi=Symbol("formItemContextKey"),Kn=(t,e={})=>{const r=s.ref(void 0),n=e.prop?r:Vm("size"),a=e.global?r:IP(),i=e.form?{size:void 0}:s.inject(su,void 0),o=e.formItem?{size:void 0}:s.inject(Pi,void 0);return s.computed(()=>n.value||s.unref(t)||(o==null?void 0:o.size)||(i==null?void 0:i.size)||a.value||"")},Ia=t=>{const e=Vm("disabled"),r=s.inject(su,void 0);return s.computed(()=>e.value||s.unref(t)||(r==null?void 0:r.disabled)||!1)},Gn=()=>{const t=s.inject(su,void 0),e=s.inject(Pi,void 0);return{form:t,formItem:e}},Oi=(t,{formItemContext:e,disableIdGeneration:r,disableIdManagement:n})=>{r||(r=s.ref(!1)),n||(n=s.ref(!1));const a=s.ref();let i;const o=s.computed(()=>{var l;return!!(!(t.label||t.ariaLabel)&&e&&e.inputIds&&((l=e.inputIds)==null?void 0:l.length)<=1)});return s.onMounted(()=>{i=s.watch([s.toRef(t,"id"),r],([l,c])=>{const u=l??(c?void 0:Di().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})}),s.onUnmounted(()=>{i&&i(),e!=null&&e.removeInputId&&a.value&&e.removeInputId(a.value)}),{isLabeledByFormItem:o,inputId:a}};let hr;const HP=`
13
13
  height:0 !important;
14
14
  visibility:hidden !important;
15
- ${Y_()?"":"overflow:hidden !important;"}
15
+ ${tT()?"":"overflow:hidden !important;"}
16
16
  position:absolute !important;
17
17
  z-index:-1000 !important;
18
18
  top:0 !important;
19
19
  right:0 !important;
20
- `,VO=["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 qO(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:VO.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:n,borderSize:a,boxSizing:r}}function by(t,e=1,r){var n;hr||(hr=document.createElement("textarea"),document.body.appendChild(hr));const{paddingSize:a,borderSize:i,boxSizing:o,contextStyle:l}=qO(t);hr.setAttribute("style",`${l};${$O}`),hr.value=t.value||t.placeholder||"";let c=hr.scrollHeight;const u={};o==="border-box"?c=c+i:o==="content-box"&&(c=c-a),hr.value="";const d=hr.scrollHeight-a;if(wt(e)){let f=d*e;o==="border-box"&&(f=f+a+i),c=Math.max(f,c),u.minHeight=`${f}px`}if(wt(r)){let f=d*r;o==="border-box"&&(f=f+a+i),c=Math.min(f,c)}return u.height=`${c}px`,(n=hr.parentNode)==null||n.removeChild(hr),hr=void 0,u}const zO=Fe({id:{type:String,default:void 0},size:Ta,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:cn},prefixIcon:{type:cn},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:ke([Object,Array,String]),default:()=>wa({})},autofocus:Boolean,rows:{type:Number,default:2},...fn(["ariaLabel"])}),HO={[Ct]:t=>Nt(t),input:t=>Nt(t),change:t=>Nt(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},KO=s.defineComponent({name:"ElInput",inheritAttrs:!1}),GO=s.defineComponent({...KO,props:zO,emits:HO,setup(t,{expose:e,emit:r}){const n=t,a=s.useAttrs(),i=s.useSlots(),o=s.computed(()=>{const I={};return n.containerRole==="combobox"&&(I["aria-haspopup"]=a["aria-haspopup"],I["aria-owns"]=a["aria-owns"],I["aria-expanded"]=a["aria-expanded"]),I}),l=s.computed(()=>[n.type==="textarea"?m.b():g.b(),g.m(v.value),g.is("disabled",p.value),g.is("exceed",Q.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")]:q.value&&U.value,[g.b("hidden")]:n.type==="hidden"},a.class]),c=s.computed(()=>[g.e("wrapper"),g.is("focus",S.value)]),u=nD({excludeKeys:s.computed(()=>Object.keys(o.value))}),{form:d,formItem:f}=Gn(),{inputId:h}=Bi(n,{formItemContext:f}),v=Kn(),p=Ii(),g=Oe("input"),m=Oe("textarea"),y=s.shallowRef(),b=s.shallowRef(),w=s.ref(!1),C=s.ref(!1),x=s.ref(),k=s.shallowRef(n.inputStyle),E=s.computed(()=>y.value||b.value),{wrapperRef:_,isFocused:S,handleFocus:T,handleBlur:N}=nu(E,{beforeFocus(){return p.value},afterBlur(){var I;n.validateEvent&&((I=f==null?void 0:f.validate)==null||I.call(f,"blur").catch(K=>nt(K)))}}),B=s.computed(()=>{var I;return(I=d==null?void 0:d.statusIcon)!=null?I:!1}),O=s.computed(()=>(f==null?void 0:f.validateState)||""),D=s.computed(()=>O.value&&Om[O.value]),R=s.computed(()=>C.value?Ne.View:Ne.Hide),P=s.computed(()=>[a.style]),L=s.computed(()=>[n.inputStyle,k.value,{resize:n.resize}]),A=s.computed(()=>ln(n.modelValue)?"":String(n.modelValue)),q=s.computed(()=>n.clearable&&!p.value&&!n.readonly&&!!A.value&&(S.value||w.value)),U=s.computed(()=>n.showPassword&&!p.value&&!n.readonly&&!!A.value&&(!!A.value||S.value)),z=s.computed(()=>n.showWordLimit&&!!n.maxlength&&(n.type==="text"||n.type==="textarea")&&!p.value&&!n.readonly&&!n.showPassword),H=s.computed(()=>A.value.length),Q=s.computed(()=>!!z.value&&H.value>Number(n.maxlength)),F=s.computed(()=>!!i.suffix||!!n.suffixIcon||q.value||n.showPassword||z.value||!!O.value&&B.value),[$,V]=kO(y);Vr(b,I=>{if(M(),!z.value||n.resize!=="both")return;const K=I[0],{width:te}=K.contentRect;x.value={right:`calc(100% - ${te+15+6}px)`}});const G=()=>{const{type:I,autosize:K}=n;if(!(!rt||I!=="textarea"||!b.value))if(K){const te=bt(K)?K.minRows:void 0,Z=bt(K)?K.maxRows:void 0,X=by(b.value,te,Z);k.value={overflowY:"hidden",...X},s.nextTick(()=>{b.value.offsetHeight,k.value=X})}else k.value={minHeight:by(b.value).minHeight}},M=(I=>{let K=!1;return()=>{var te;if(K||!n.autosize)return;((te=b.value)==null?void 0:te.offsetParent)===null||(I(),K=!0)}})(G),W=()=>{const I=E.value,K=n.formatter?n.formatter(A.value):A.value;!I||I.value===K||(I.value=K)},Y=async I=>{$();let{value:K}=I.target;if(n.formatter&&(K=n.parser?n.parser(K):K),!ce.value){if(K===A.value){W();return}r(Ct,K),r("input",K),await s.nextTick(),W(),V()}},se=I=>{r("change",I.target.value)},{isComposing:ce,handleCompositionStart:ae,handleCompositionUpdate:ne,handleCompositionEnd:ue}=gy({emit:r,afterComposition:Y}),ie=()=>{C.value=!C.value,fe()},fe=async()=>{var I;await s.nextTick(),(I=E.value)==null||I.focus()},pe=()=>{var I;return(I=E.value)==null?void 0:I.blur()},De=I=>{w.value=!1,r("mouseleave",I)},Ie=I=>{w.value=!0,r("mouseenter",I)},we=I=>{r("keydown",I)},xe=()=>{var I;(I=E.value)==null||I.select()},re=()=>{r(Ct,""),r("change",""),r("clear"),r("input","")};return s.watch(()=>n.modelValue,()=>{var I;s.nextTick(()=>G()),n.validateEvent&&((I=f==null?void 0:f.validate)==null||I.call(f,"change").catch(K=>nt(K)))}),s.watch(A,()=>W()),s.watch(()=>n.type,async()=>{await s.nextTick(),W(),G()}),s.onMounted(()=>{!n.formatter&&n.parser&&nt("ElInput","If you set the parser, you also need to set the formatter."),W(),s.nextTick(G)}),e({input:y,textarea:b,ref:E,textareaStyle:L,autosize:s.toRef(n,"autosize"),isComposing:ce,focus:fe,blur:pe,select:xe,clear:re,resizeTextarea:G}),(I,K)=>(s.openBlock(),s.createElementBlock("div",s.mergeProps(s.unref(o),{class:[s.unref(l),{[s.unref(g).bm("group","append")]:I.$slots.append,[s.unref(g).bm("group","prepend")]:I.$slots.prepend}],style:s.unref(P),role:I.containerRole,onMouseenter:Ie,onMouseleave:De}),[s.createCommentVNode(" input "),I.type!=="textarea"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createCommentVNode(" prepend slot "),I.$slots.prepend?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(g).be("group","prepend"))},[s.renderSlot(I.$slots,"prepend")],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{ref_key:"wrapperRef",ref:_,class:s.normalizeClass(s.unref(c))},[s.createCommentVNode(" prefix slot "),I.$slots.prefix||I.prefixIcon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(g).e("prefix"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(g).e("prefix-inner"))},[s.renderSlot(I.$slots,"prefix"),I.prefixIcon?(s.openBlock(),s.createBlock(s.unref(ut),{key:0,class:s.normalizeClass(s.unref(g).e("icon"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(I.prefixIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("input",s.mergeProps({id:s.unref(h),ref_key:"input",ref:y,class:s.unref(g).e("inner")},s.unref(u),{minlength:I.minlength,maxlength:I.maxlength,type:I.showPassword?C.value?"text":"password":I.type,disabled:s.unref(p),readonly:I.readonly,autocomplete:I.autocomplete,tabindex:I.tabindex,"aria-label":I.ariaLabel,placeholder:I.placeholder,style:I.inputStyle,form:I.form,autofocus:I.autofocus,onCompositionstart:s.unref(ae),onCompositionupdate:s.unref(ne),onCompositionend:s.unref(ue),onInput:Y,onChange:se,onKeydown:we}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),s.createCommentVNode(" suffix slot "),s.unref(F)?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(s.unref(g).e("suffix"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(g).e("suffix-inner"))},[!s.unref(q)||!s.unref(U)||!s.unref(z)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.renderSlot(I.$slots,"suffix"),I.suffixIcon?(s.openBlock(),s.createBlock(s.unref(ut),{key:0,class:s.normalizeClass(s.unref(g).e("icon"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(I.suffixIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],64)):s.createCommentVNode("v-if",!0),s.unref(q)?(s.openBlock(),s.createBlock(s.unref(ut),{key:1,class:s.normalizeClass([s.unref(g).e("icon"),s.unref(g).e("clear")]),onMousedown:s.withModifiers(s.unref(hi),["prevent"]),onClick:re},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.CircleClose))]),_:1},8,["class","onMousedown"])):s.createCommentVNode("v-if",!0),s.unref(U)?(s.openBlock(),s.createBlock(s.unref(ut),{key:2,class:s.normalizeClass([s.unref(g).e("icon"),s.unref(g).e("password")]),onClick:ie},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(R))))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),s.unref(z)?(s.openBlock(),s.createElementBlock("span",{key:3,class:s.normalizeClass(s.unref(g).e("count"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(g).e("count-inner"))},s.toDisplayString(s.unref(H))+" / "+s.toDisplayString(I.maxlength),3)],2)):s.createCommentVNode("v-if",!0),s.unref(O)&&s.unref(D)&&s.unref(B)?(s.openBlock(),s.createBlock(s.unref(ut),{key:4,class:s.normalizeClass([s.unref(g).e("icon"),s.unref(g).e("validateIcon"),s.unref(g).is("loading",s.unref(O)==="validating")])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(D))))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],2)):s.createCommentVNode("v-if",!0)],2),s.createCommentVNode(" append slot "),I.$slots.append?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(s.unref(g).be("group","append"))},[s.renderSlot(I.$slots,"append")],2)):s.createCommentVNode("v-if",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createCommentVNode(" textarea "),s.createElementVNode("textarea",s.mergeProps({id:s.unref(h),ref_key:"textarea",ref:b,class:[s.unref(m).e("inner"),s.unref(g).is("focus",s.unref(S))]},s.unref(u),{minlength:I.minlength,maxlength:I.maxlength,tabindex:I.tabindex,disabled:s.unref(p),readonly:I.readonly,autocomplete:I.autocomplete,style:s.unref(L),"aria-label":I.ariaLabel,placeholder:I.placeholder,form:I.form,autofocus:I.autofocus,rows:I.rows,onCompositionstart:s.unref(ae),onCompositionupdate:s.unref(ne),onCompositionend:s.unref(ue),onInput:Y,onFocus:s.unref(T),onBlur:s.unref(N),onChange:se,onKeydown:we}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),s.unref(z)?(s.openBlock(),s.createElementBlock("span",{key:0,style:s.normalizeStyle(x.value),class:s.normalizeClass(s.unref(g).e("count"))},s.toDisplayString(s.unref(H))+" / "+s.toDisplayString(I.maxlength),7)):s.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var UO=Be(GO,[["__file","input.vue"]]);const Di=vt(UO),Na=4,jO={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"}},WO=({move:t,size:e,bar:r})=>({[r.size]:e,transform:`translate${r.axis}(${t}%)`}),ou=Symbol("scrollbarContextKey"),YO=Fe({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),ZO="Thumb";var wy=Be(s.defineComponent({__name:"thumb",props:YO,setup(t){const e=t,r=s.inject(ou),n=Oe("scrollbar");r||YB(ZO,"can not inject scrollbar context");const a=s.ref(),i=s.ref(),o=s.ref({}),l=s.ref(!1);let c=!1,u=!1,d=rt?document.onselectstart:null;const f=s.computed(()=>jO[e.vertical?"vertical":"horizontal"]),h=s.computed(()=>WO({size:e.size,move:e.move,bar:f.value})),v=s.computed(()=>a.value[f.value.offset]**2/r.wrapElement[f.value.scrollSize]/e.ratio/i.value[f.value.offset]),p=k=>{var E;if(k.stopPropagation(),k.ctrlKey||[1,2].includes(k.button))return;(E=window.getSelection())==null||E.removeAllRanges(),m(k);const _=k.currentTarget;_&&(o.value[f.value.axis]=_[f.value.offset]-(k[f.value.client]-_.getBoundingClientRect()[f.value.direction]))},g=k=>{if(!i.value||!a.value||!r.wrapElement)return;const E=Math.abs(k.target.getBoundingClientRect()[f.value.direction]-k[f.value.client]),_=i.value[f.value.offset]/2,S=(E-_)*100*v.value/a.value[f.value.offset];r.wrapElement[f.value.scroll]=S*r.wrapElement[f.value.scrollSize]/100},m=k=>{k.stopImmediatePropagation(),c=!0,document.addEventListener("mousemove",y),document.addEventListener("mouseup",b),d=document.onselectstart,document.onselectstart=()=>!1},y=k=>{if(!a.value||!i.value||c===!1)return;const E=o.value[f.value.axis];if(!E)return;const _=(a.value.getBoundingClientRect()[f.value.direction]-k[f.value.client])*-1,S=i.value[f.value.offset]-E,T=(_-S)*100*v.value/a.value[f.value.offset];r.wrapElement[f.value.scroll]=T*r.wrapElement[f.value.scrollSize]/100},b=()=>{c=!1,o.value[f.value.axis]=0,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",b),x(),u&&(l.value=!1)},w=()=>{u=!1,l.value=!!e.size},C=()=>{u=!0,l.value=c};s.onBeforeUnmount(()=>{x(),document.removeEventListener("mouseup",b)});const x=()=>{document.onselectstart!==d&&(document.onselectstart=d)};return Qt(s.toRef(r,"scrollbarElement"),"mousemove",w),Qt(s.toRef(r,"scrollbarElement"),"mouseleave",C),(k,E)=>(s.openBlock(),s.createBlock(s.Transition,{name:s.unref(n).b("fade"),persisted:""},{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{ref_key:"instance",ref:a,class:s.normalizeClass([s.unref(n).e("bar"),s.unref(n).is(s.unref(f).key)]),onMousedown:g},[s.createElementVNode("div",{ref_key:"thumb",ref:i,class:s.normalizeClass(s.unref(n).e("thumb")),style:s.normalizeStyle(s.unref(h)),onMousedown:p},null,38)],34),[[s.vShow,k.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const XO=Fe({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var JO=Be(s.defineComponent({__name:"bar",props:XO,setup(t,{expose:e}){const r=t,n=s.inject(ou),a=s.ref(0),i=s.ref(0),o=s.ref(""),l=s.ref(""),c=s.ref(1),u=s.ref(1);return e({handleScroll:h=>{if(h){const v=h.offsetHeight-Na,p=h.offsetWidth-Na;i.value=h.scrollTop*100/v*c.value,a.value=h.scrollLeft*100/p*u.value}},update:()=>{const h=n==null?void 0:n.wrapElement;if(!h)return;const v=h.offsetHeight-Na,p=h.offsetWidth-Na,g=v**2/h.scrollHeight,m=p**2/h.scrollWidth,y=Math.max(g,r.minSize),b=Math.max(m,r.minSize);c.value=g/(v-g)/(y/(v-y)),u.value=m/(p-m)/(b/(p-b)),l.value=y+Na<v?`${y}px`:"",o.value=b+Na<p?`${b}px`:""}}),(h,v)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(wy,{move:a.value,ratio:u.value,size:o.value,always:h.always},null,8,["move","ratio","size","always"]),s.createVNode(wy,{move:i.value,ratio:c.value,size:l.value,vertical:"",always:h.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const QO=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,...fn(["ariaLabel","ariaOrientation"])}),eP={scroll:({scrollTop:t,scrollLeft:e})=>[t,e].every(wt)},su="ElScrollbar",tP=s.defineComponent({name:su}),rP=s.defineComponent({...tP,props:QO,emits:eP,setup(t,{expose:e,emit:r}){const n=t,a=Oe("scrollbar");let i,o,l=0,c=0;const u=s.ref(),d=s.ref(),f=s.ref(),h=s.ref(),v=s.computed(()=>{const x={};return n.height&&(x.height=ba(n.height)),n.maxHeight&&(x.maxHeight=ba(n.maxHeight)),[n.wrapStyle,x]}),p=s.computed(()=>[n.wrapClass,a.e("wrap"),{[a.em("wrap","hidden-default")]:!n.native}]),g=s.computed(()=>[a.e("view"),n.viewClass]),m=()=>{var x;d.value&&((x=h.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 y(x,k){bt(x)?d.value.scrollTo(x):wt(x)&&wt(k)&&d.value.scrollTo(x,k)}const b=x=>{if(!wt(x)){nt(su,"value must be a number");return}d.value.scrollTop=x},w=x=>{if(!wt(x)){nt(su,"value must be a number");return}d.value.scrollLeft=x},C=()=>{var x;(x=h.value)==null||x.update()};return s.watch(()=>n.noresize,x=>{x?(i==null||i(),o==null||o()):({stop:i}=Vr(f,C),o=Qt("resize",C))},{immediate:!0}),s.watch(()=>[n.maxHeight,n.height],()=>{n.native||s.nextTick(()=>{var x;C(),d.value&&((x=h.value)==null||x.handleScroll(d.value))})}),s.provide(ou,s.reactive({scrollbarElement:u,wrapElement:d})),s.onActivated(()=>{d.value&&(d.value.scrollTop=l,d.value.scrollLeft=c)}),s.onMounted(()=>{n.native||s.nextTick(()=>{C()})}),s.onUpdated(()=>C()),e({wrapRef:d,update:C,scrollTo:y,setScrollTop:b,setScrollLeft:w,handleScroll:m}),(x,k)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"scrollbarRef",ref:u,class:s.normalizeClass(s.unref(a).b())},[s.createElementVNode("div",{ref_key:"wrapRef",ref:d,class:s.normalizeClass(s.unref(p)),style:s.normalizeStyle(s.unref(v)),tabindex:x.tabindex,onScroll:m},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(x.tag),{id:x.id,ref_key:"resizeRef",ref:f,class:s.normalizeClass(s.unref(g)),style:s.normalizeStyle(x.viewStyle),role:x.role,"aria-label":x.ariaLabel,"aria-orientation":x.ariaOrientation},{default:s.withCtx(()=>[s.renderSlot(x.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),x.native?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createBlock(JO,{key:0,ref_key:"barRef",ref:h,always:x.always,"min-size":x.minSize},null,8,["always","min-size"]))],2))}});var nP=Be(rP,[["__file","scrollbar.vue"]]);const aP=vt(nP),lu=Symbol("popper"),Cy=Symbol("popperContent"),Ey=Fe({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),iP=s.defineComponent({name:"ElPopper",inheritAttrs:!1}),oP=s.defineComponent({...iP,props:Ey,setup(t,{expose:e}){const r=t,n=s.ref(),a=s.ref(),i=s.ref(),o=s.ref(),l=s.computed(()=>r.role),c={triggerRef:n,popperInstanceRef:a,contentRef:i,referenceRef:o,role:l};return e(c),s.provide(lu,c),(u,d)=>s.renderSlot(u.$slots,"default")}});var sP=Be(oP,[["__file","popper.vue"]]);const xy=Fe({arrowOffset:{type:Number,default:5}}),lP=s.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),uP=s.defineComponent({...lP,props:xy,setup(t,{expose:e}){const r=t,n=Oe("popper"),{arrowOffset:a,arrowRef:i,arrowStyle:o}=s.inject(Cy,void 0);return s.watch(()=>r.arrowOffset,l=>{a.value=l}),s.onBeforeUnmount(()=>{i.value=void 0}),e({arrowRef:i}),(l,c)=>(s.openBlock(),s.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:s.normalizeClass(s.unref(n).e("arrow")),style:s.normalizeStyle(s.unref(o)),"data-popper-arrow":""},null,6))}});var cP=Be(uP,[["__file","arrow.vue"]]);const uu="ElOnlyChild",dP=s.defineComponent({name:uu,setup(t,{slots:e,attrs:r}){var n;const a=s.inject(ly),i=xO((n=a==null?void 0:a.setForwardRef)!=null?n:hi);return()=>{var o;const l=(o=e.default)==null?void 0:o.call(e,r);if(!l)return null;if(l.length>1)return nt(uu,"requires exact only one valid child."),null;const c=ky(l);return c?s.withDirectives(s.cloneVNode(c,r),[[i]]):(nt(uu,"no valid child node found"),null)}}});function ky(t){if(!t)return null;const e=t;for(const r of e){if(bt(r))switch(r.type){case s.Comment:continue;case s.Text:case"svg":return Sy(r);case s.Fragment:return ky(r.children);default:return r}return Sy(r)}return null}function Sy(t){const e=Oe("only-child");return s.createVNode("span",{class:e.e("content")},[t])}const _y=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}),fP=s.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),hP=s.defineComponent({...fP,props:_y,setup(t,{expose:e}){const r=t,{role:n,triggerRef:a}=s.inject(lu,void 0);EO(a);const i=s.computed(()=>l.value?r.id:void 0),o=s.computed(()=>{if(n&&n.value==="tooltip")return r.open&&r.id?r.id:void 0}),l=s.computed(()=>{if(n&&n.value!=="tooltip")return n.value}),c=s.computed(()=>l.value?`${r.open}`:void 0);let u;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return s.onMounted(()=>{s.watch(()=>r.virtualRef,f=>{f&&(a.value=$r(f))},{immediate:!0}),s.watch(a,(f,h)=>{u==null||u(),u=void 0,Vn(f)&&(d.forEach(v=>{var p;const g=r[v];g&&(f.addEventListener(v.slice(2).toLowerCase(),g),(p=h==null?void 0:h.removeEventListener)==null||p.call(h,v.slice(2).toLowerCase(),g))}),u=s.watch([i,o,l,c],v=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((p,g)=>{ln(v[g])?f.removeAttribute(p):f.setAttribute(p,v[g])})},{immediate:!0})),Vn(h)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(v=>h.removeAttribute(v))},{immediate:!0})}),s.onBeforeUnmount(()=>{if(u==null||u(),u=void 0,a.value&&Vn(a.value)){const f=a.value;d.forEach(h=>{const v=r[h];v&&f.removeEventListener(h.slice(2).toLowerCase(),v)}),a.value=void 0}}),e({triggerRef:a}),(f,h)=>f.virtualTriggering?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createBlock(s.unref(dP),s.mergeProps({key:0},f.$attrs,{"aria-controls":s.unref(i),"aria-describedby":s.unref(o),"aria-expanded":s.unref(c),"aria-haspopup":s.unref(l)}),{default:s.withCtx(()=>[s.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var pP=Be(hP,[["__file","trigger.vue"]]);const cu="focus-trap.focus-after-trapped",du="focus-trap.focus-after-released",vP="focus-trap.focusout-prevented",Ty={cancelable:!0,bubbles:!1},gP={cancelable:!0,bubbles:!1},Ny="focusAfterTrapped",Iy="focusAfterReleased",mP=Symbol("elFocusTrap"),fu=s.ref(),Jo=s.ref(0),hu=s.ref(0);let Qo=0;const By=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},Dy=(t,e)=>{for(const r of t)if(!yP(r,e))return r},yP=(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},bP=t=>{const e=By(t),r=Dy(e,t),n=Dy(e.reverse(),t);return[r,n]},wP=t=>t instanceof HTMLInputElement&&"select"in t,hn=(t,e)=>{if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),hu.value=window.performance.now(),t!==r&&wP(t)&&e&&t.select()}};function Oy(t,e){const r=[...t],n=t.indexOf(e);return n!==-1&&r.splice(n,1),r}const CP=()=>{let t=[];return{push:n=>{const a=t[0];a&&n!==a&&a.pause(),t=Oy(t,n),t.unshift(n)},remove:n=>{var a,i;t=Oy(t,n),(i=(a=t[0])==null?void 0:a.resume)==null||i.call(a)}}},EP=(t,e=!1)=>{const r=document.activeElement;for(const n of t)if(hn(n,e),document.activeElement!==r)return},Py=CP(),xP=()=>Jo.value>hu.value,es=()=>{fu.value="pointer",Jo.value=window.performance.now()},Ay=()=>{fu.value="keyboard",Jo.value=window.performance.now()},kP=()=>(s.onMounted(()=>{Qo===0&&(document.addEventListener("mousedown",es),document.addEventListener("touchstart",es),document.addEventListener("keydown",Ay)),Qo++}),s.onBeforeUnmount(()=>{Qo--,Qo<=0&&(document.removeEventListener("mousedown",es),document.removeEventListener("touchstart",es),document.removeEventListener("keydown",Ay))}),{focusReason:fu,lastUserFocusTimestamp:Jo,lastAutomatedFocusTimestamp:hu}),ts=t=>new CustomEvent(vP,{...gP,detail:t}),SP=s.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Ny,Iy,"focusin","focusout","focusout-prevented","release-requested"],setup(t,{emit:e}){const r=s.ref();let n,a;const{focusReason:i}=kP();mO(p=>{t.trapped&&!o.paused&&e("release-requested",p)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=p=>{if(!t.loop&&!t.trapped||o.paused)return;const{key:g,altKey:m,ctrlKey:y,metaKey:b,currentTarget:w,shiftKey:C}=p,{loop:x}=t,k=g===lt.tab&&!m&&!y&&!b,E=document.activeElement;if(k&&E){const _=w,[S,T]=bP(_);if(S&&T){if(!C&&E===T){const B=ts({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||(p.preventDefault(),x&&hn(S,!0))}else if(C&&[S,_].includes(E)){const B=ts({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||(p.preventDefault(),x&&hn(T,!0))}}else if(E===_){const B=ts({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||p.preventDefault()}}};s.provide(mP,{focusTrapRef:r,onKeydown:l}),s.watch(()=>t.focusTrapEl,p=>{p&&(r.value=p)},{immediate:!0}),s.watch([r],([p],[g])=>{p&&(p.addEventListener("keydown",l),p.addEventListener("focusin",d),p.addEventListener("focusout",f)),g&&(g.removeEventListener("keydown",l),g.removeEventListener("focusin",d),g.removeEventListener("focusout",f))});const c=p=>{e(Ny,p)},u=p=>e(Iy,p),d=p=>{const g=s.unref(r);if(!g)return;const m=p.target,y=p.relatedTarget,b=m&&g.contains(m);t.trapped||y&&g.contains(y)||(n=y),b&&e("focusin",p),!o.paused&&t.trapped&&(b?a=m:hn(a,!0))},f=p=>{const g=s.unref(r);if(!(o.paused||!g))if(t.trapped){const m=p.relatedTarget;!ln(m)&&!g.contains(m)&&setTimeout(()=>{if(!o.paused&&t.trapped){const y=ts({focusReason:i.value});e("focusout-prevented",y),y.defaultPrevented||hn(a,!0)}},0)}else{const m=p.target;m&&g.contains(m)||e("focusout",p)}};async function h(){await s.nextTick();const p=s.unref(r);if(p){Py.push(o);const g=p.contains(document.activeElement)?n:document.activeElement;if(n=g,!p.contains(g)){const y=new Event(cu,Ty);p.addEventListener(cu,c),p.dispatchEvent(y),y.defaultPrevented||s.nextTick(()=>{let b=t.focusStartEl;Nt(b)||(hn(b),document.activeElement!==b&&(b="first")),b==="first"&&EP(By(p),!0),(document.activeElement===g||b==="container")&&hn(p)})}}}function v(){const p=s.unref(r);if(p){p.removeEventListener(cu,c);const g=new CustomEvent(du,{...Ty,detail:{focusReason:i.value}});p.addEventListener(du,u),p.dispatchEvent(g),!g.defaultPrevented&&(i.value=="keyboard"||!xP()||p.contains(document.activeElement))&&hn(n??document.body),p.removeEventListener(du,u),Py.remove(o)}}return s.onMounted(()=>{t.trapped&&h(),s.watch(()=>t.trapped,p=>{p?h():v()})}),s.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 _P(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default",{handleKeydown:t.onKeydown})}var TP=Be(SP,[["render",_P],["__file","focus-trap.vue"]]);const NP=["fixed","absolute"],IP=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:Go,default:"bottom"},popperOptions:{type:ke(Object),default:()=>({})},strategy:{type:String,values:NP,default:"absolute"}}),Ry=Fe({...IP,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,...fn(["ariaLabel"])}),BP={mouseenter:t=>t instanceof MouseEvent,mouseleave:t=>t instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},DP=(t,e=[])=>{const{placement:r,strategy:n,popperOptions:a}=t,i={placement:r,strategy:n,...a,modifiers:[...PP(t),...e]};return AP(i,a==null?void 0:a.modifiers),i},OP=t=>{if(rt)return $r(t)};function PP(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 AP(t,e){e&&(t.modifiers=[...t.modifiers,...e??[]])}const RP=0,LP=t=>{const{popperInstanceRef:e,contentRef:r,triggerRef:n,role:a}=s.inject(lu,void 0),i=s.ref(),o=s.ref(),l=s.computed(()=>({name:"eventListeners",enabled:!!t.visible})),c=s.computed(()=>{var y;const b=s.unref(i),w=(y=s.unref(o))!=null?y:RP;return{name:"arrow",enabled:!HB(b),options:{element:b,padding:w}}}),u=s.computed(()=>({onFirstUpdate:()=>{p()},...DP(t,[s.unref(c),s.unref(l)])})),d=s.computed(()=>OP(t.referenceEl)||s.unref(n)),{attributes:f,state:h,styles:v,update:p,forceUpdate:g,instanceRef:m}=pO(d,r,u);return s.watch(m,y=>e.value=y),s.onMounted(()=>{s.watch(()=>{var y;return(y=s.unref(d))==null?void 0:y.getBoundingClientRect()},()=>{p()})}),{attributes:f,arrowRef:i,contentRef:r,instanceRef:m,state:h,styles:v,role:a,forceUpdate:g,update:p}},MP=(t,{attributes:e,styles:r,role:n})=>{const{nextZIndex:a}=py(),i=Oe("popper"),o=s.computed(()=>s.unref(e).popper),l=s.ref(wt(t.zIndex)?t.zIndex:a()),c=s.computed(()=>[i.b(),i.is("pure",t.pure),i.is(t.effect),t.popperClass]),u=s.computed(()=>[{zIndex:s.unref(l)},s.unref(r).popper,t.popperStyle||{}]),d=s.computed(()=>n.value==="dialog"?"false":void 0),f=s.computed(()=>s.unref(r).arrow||{});return{ariaModal:d,arrowStyle:f,contentAttrs:o,contentClass:c,contentStyle:u,contentZIndex:l,updateZIndex:()=>{l.value=wt(t.zIndex)?t.zIndex:a()}}},FP=(t,e)=>{const r=s.ref(!1),n=s.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")}}},$P=s.defineComponent({name:"ElPopperContent"}),VP=s.defineComponent({...$P,props:Ry,emits:BP,setup(t,{expose:e,emit:r}){const n=t,{focusStartRef:a,trapped:i,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=FP(n,r),{attributes:f,arrowRef:h,contentRef:v,styles:p,instanceRef:g,role:m,update:y}=LP(n),{ariaModal:b,arrowStyle:w,contentAttrs:C,contentClass:x,contentStyle:k,updateZIndex:E}=MP(n,{styles:p,attributes:f,role:m}),_=s.inject(Ni,void 0),S=s.ref();s.provide(Cy,{arrowStyle:w,arrowRef:h,arrowOffset:S}),_&&s.provide(Ni,{..._,addInputId:hi,removeInputId:hi});let T;const N=(O=!0)=>{y(),O&&E()},B=()=>{N(!1),n.visible&&n.focusOnShow?i.value=!0:n.visible===!1&&(i.value=!1)};return s.onMounted(()=>{s.watch(()=>n.triggerTargetEl,(O,D)=>{T==null||T(),T=void 0;const R=s.unref(O||v.value),P=s.unref(D||v.value);Vn(R)&&(T=s.watch([m,()=>n.ariaLabel,b,()=>n.id],L=>{["role","aria-label","aria-modal","id"].forEach((A,q)=>{ln(L[q])?R.removeAttribute(A):R.setAttribute(A,L[q])})},{immediate:!0})),P!==R&&Vn(P)&&["role","aria-label","aria-modal","id"].forEach(L=>{P.removeAttribute(L)})},{immediate:!0}),s.watch(()=>n.visible,B,{immediate:!0})}),s.onBeforeUnmount(()=>{T==null||T(),T=void 0}),e({popperContentRef:v,popperInstanceRef:g,updatePopper:N,contentStyle:k}),(O,D)=>(s.openBlock(),s.createElementBlock("div",s.mergeProps({ref_key:"contentRef",ref:v},s.unref(C),{style:s.unref(k),class:s.unref(x),tabindex:"-1",onMouseenter:R=>O.$emit("mouseenter",R),onMouseleave:R=>O.$emit("mouseleave",R)}),[s.createVNode(s.unref(TP),{trapped:s.unref(i),"trap-on-focus-in":!0,"focus-trap-el":s.unref(v),"focus-start-el":s.unref(a),onFocusAfterTrapped:s.unref(l),onFocusAfterReleased:s.unref(o),onFocusin:s.unref(c),onFocusoutPrevented:s.unref(u),onReleaseRequested:s.unref(d)},{default:s.withCtx(()=>[s.renderSlot(O.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var qP=Be(VP,[["__file","content.vue"]]);const zP=vt(sP),pu=Symbol("elTooltip"),zt=Fe({...wO,...Ry,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,...fn(["ariaLabel"])}),Oi=Fe({..._y,disabled:Boolean,trigger:{type:ke([String,Array]),default:"hover"},triggerKeys:{type:ke(Array),default:()=>[lt.enter,lt.space]}}),{useModelToggleProps:HP,useModelToggleEmits:KP,useModelToggle:GP}=dD("visible"),UP=Fe({...Ey,...HP,...zt,...Oi,...xy,showArrow:{type:Boolean,default:!0}}),jP=[...KP,"before-show","before-hide","show","hide","open","close"],WP=(t,e)=>$t(t)?t.includes(e):t===e,Ia=(t,e,r)=>n=>{WP(s.unref(t),e)&&r(n)},YP=s.defineComponent({name:"ElTooltipTrigger"}),ZP=s.defineComponent({...YP,props:Oi,setup(t,{expose:e}){const r=t,n=Oe("tooltip"),{controlled:a,id:i,open:o,onOpen:l,onClose:c,onToggle:u}=s.inject(pu,void 0),d=s.ref(null),f=()=>{if(s.unref(a)||r.disabled)return!0},h=s.toRef(r,"trigger"),v=Fr(f,Ia(h,"hover",l)),p=Fr(f,Ia(h,"hover",c)),g=Fr(f,Ia(h,"click",C=>{C.button===0&&u(C)})),m=Fr(f,Ia(h,"focus",l)),y=Fr(f,Ia(h,"focus",c)),b=Fr(f,Ia(h,"contextmenu",C=>{C.preventDefault(),u(C)})),w=Fr(f,C=>{const{code:x}=C;r.triggerKeys.includes(x)&&(C.preventDefault(),u(C))});return e({triggerRef:d}),(C,x)=>(s.openBlock(),s.createBlock(s.unref(pP),{id:s.unref(i),"virtual-ref":C.virtualRef,open:s.unref(o),"virtual-triggering":C.virtualTriggering,class:s.normalizeClass(s.unref(n).e("trigger")),onBlur:s.unref(y),onClick:s.unref(g),onContextmenu:s.unref(b),onFocus:s.unref(m),onMouseenter:s.unref(v),onMouseleave:s.unref(p),onKeydown:s.unref(w)},{default:s.withCtx(()=>[s.renderSlot(C.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var XP=Be(ZP,[["__file","trigger.vue"]]);const JP=Fe({to:{type:ke([String,Object]),required:!0},disabled:Boolean});var QP=Be(s.defineComponent({__name:"teleport",props:JP,setup(t){return(e,r)=>e.disabled?s.renderSlot(e.$slots,"default",{key:0}):(s.openBlock(),s.createBlock(s.Teleport,{key:1,to:e.to},[s.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const eA=vt(QP),tA=s.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),rA=s.defineComponent({...tA,props:zt,setup(t,{expose:e}){const r=t,{selector:n}=sy(),a=Oe("tooltip"),i=s.ref(null);let o;const{controlled:l,id:c,open:u,trigger:d,onClose:f,onOpen:h,onShow:v,onHide:p,onBeforeShow:g,onBeforeHide:m}=s.inject(pu,void 0),y=s.computed(()=>r.transition||`${a.namespace.value}-fade-in-linear`),b=s.computed(()=>process.env.NODE_ENV==="test"?!0:r.persistent);s.onBeforeUnmount(()=>{o==null||o()});const w=s.computed(()=>s.unref(b)?!0:s.unref(u)),C=s.computed(()=>r.disabled?!1:s.unref(u)),x=s.computed(()=>r.appendTo||n.value),k=s.computed(()=>{var P;return(P=r.style)!=null?P:{}}),E=s.ref(!0),_=()=>{p(),E.value=!0},S=()=>{if(s.unref(l))return!0},T=Fr(S,()=>{r.enterable&&s.unref(d)==="hover"&&h()}),N=Fr(S,()=>{s.unref(d)==="hover"&&f()}),B=()=>{var P,L;(L=(P=i.value)==null?void 0:P.updatePopper)==null||L.call(P),g==null||g()},O=()=>{m==null||m()},D=()=>{v(),o=M_(s.computed(()=>{var P;return(P=i.value)==null?void 0:P.popperContentRef}),()=>{if(s.unref(l))return;s.unref(d)!=="hover"&&f()})},R=()=>{r.virtualTriggering||f()};return s.watch(()=>s.unref(u),P=>{P?E.value=!1:o==null||o()},{flush:"post"}),s.watch(()=>r.content,()=>{var P,L;(L=(P=i.value)==null?void 0:P.updatePopper)==null||L.call(P)}),e({contentRef:i}),(P,L)=>(s.openBlock(),s.createBlock(s.unref(eA),{disabled:!P.teleported,to:s.unref(x)},{default:s.withCtx(()=>[s.createVNode(s.Transition,{name:s.unref(y),onAfterLeave:_,onBeforeEnter:B,onAfterEnter:D,onBeforeLeave:O},{default:s.withCtx(()=>[s.unref(w)?s.withDirectives((s.openBlock(),s.createBlock(s.unref(qP),s.mergeProps({key:0,id:s.unref(c),ref_key:"contentRef",ref:i},P.$attrs,{"aria-label":P.ariaLabel,"aria-hidden":E.value,"boundaries-padding":P.boundariesPadding,"fallback-placements":P.fallbackPlacements,"gpu-acceleration":P.gpuAcceleration,offset:P.offset,placement:P.placement,"popper-options":P.popperOptions,strategy:P.strategy,effect:P.effect,enterable:P.enterable,pure:P.pure,"popper-class":P.popperClass,"popper-style":[P.popperStyle,s.unref(k)],"reference-el":P.referenceEl,"trigger-target-el":P.triggerTargetEl,visible:s.unref(C),"z-index":P.zIndex,onMouseenter:s.unref(T),onMouseleave:s.unref(N),onBlur:R,onClose:s.unref(f)}),{default:s.withCtx(()=>[s.renderSlot(P.$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"])),[[s.vShow,s.unref(C)]]):s.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var nA=Be(rA,[["__file","content.vue"]]);const aA=s.defineComponent({name:"ElTooltip"}),iA=s.defineComponent({...aA,props:UP,emits:jP,setup(t,{expose:e,emit:r}){const n=t;bO();const a=Zo(),i=s.ref(),o=s.ref(),l=()=>{var y;const b=s.unref(i);b&&((y=b.popperInstanceRef)==null||y.update())},c=s.ref(!1),u=s.ref(),{show:d,hide:f,hasUpdateHandler:h}=GP({indicator:c,toggleReason:u}),{onOpen:v,onClose:p}=CO({showAfter:s.toRef(n,"showAfter"),hideAfter:s.toRef(n,"hideAfter"),autoClose:s.toRef(n,"autoClose"),open:d,close:f}),g=s.computed(()=>ya(n.visible)&&!h.value);s.provide(pu,{controlled:g,id:a,open:s.readonly(c),trigger:s.toRef(n,"trigger"),onOpen:y=>{v(y)},onClose:y=>{p(y)},onToggle:y=>{s.unref(c)?p(y):v(y)},onShow:()=>{r("show",u.value)},onHide:()=>{r("hide",u.value)},onBeforeShow:()=>{r("before-show",u.value)},onBeforeHide:()=>{r("before-hide",u.value)},updatePopper:l}),s.watch(()=>n.disabled,y=>{y&&c.value&&(c.value=!1)});const m=y=>{var b,w;const C=(w=(b=o.value)==null?void 0:b.contentRef)==null?void 0:w.popperContentRef,x=(y==null?void 0:y.relatedTarget)||document.activeElement;return C&&C.contains(x)};return s.onDeactivated(()=>c.value&&f()),e({popperRef:i,contentRef:o,isFocusInsideContent:m,updatePopper:l,onOpen:v,onClose:p,hide:f}),(y,b)=>(s.openBlock(),s.createBlock(s.unref(zP),{ref_key:"popperRef",ref:i,role:y.role},{default:s.withCtx(()=>[s.createVNode(XP,{disabled:y.disabled,trigger:y.trigger,"trigger-keys":y.triggerKeys,"virtual-ref":y.virtualRef,"virtual-triggering":y.virtualTriggering},{default:s.withCtx(()=>[y.$slots.default?s.renderSlot(y.$slots,"default",{key:0}):s.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),s.createVNode(nA,{ref_key:"contentRef",ref:o,"aria-label":y.ariaLabel,"boundaries-padding":y.boundariesPadding,content:y.content,disabled:y.disabled,effect:y.effect,enterable:y.enterable,"fallback-placements":y.fallbackPlacements,"hide-after":y.hideAfter,"gpu-acceleration":y.gpuAcceleration,offset:y.offset,persistent:y.persistent,"popper-class":y.popperClass,"popper-style":y.popperStyle,placement:y.placement,"popper-options":y.popperOptions,pure:y.pure,"raw-content":y.rawContent,"reference-el":y.referenceEl,"trigger-target-el":y.triggerTargetEl,"show-after":y.showAfter,strategy:y.strategy,teleported:y.teleported,transition:y.transition,"virtual-triggering":y.virtualTriggering,"z-index":y.zIndex,"append-to":y.appendTo},{default:s.withCtx(()=>[s.renderSlot(y.$slots,"content",{},()=>[y.rawContent?(s.openBlock(),s.createElementBlock("span",{key:0,innerHTML:y.content},null,8,["innerHTML"])):(s.openBlock(),s.createElementBlock("span",{key:1},s.toDisplayString(y.content),1))]),y.showArrow?(s.openBlock(),s.createBlock(s.unref(cP),{key:0,"arrow-offset":y.arrowOffset},null,8,["arrow-offset"])):s.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 oA=Be(iA,[["__file","tooltip.vue"]]);const Pi=vt(oA),Ly=Symbol("buttonGroupContextKey"),sA=(t,e)=>{Ho({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},s.computed(()=>t.type==="text"));const r=s.inject(Ly,void 0),n=au("button"),{form:a}=Gn(),i=Kn(s.computed(()=>r==null?void 0:r.size)),o=Ii(),l=s.ref(),c=s.useSlots(),u=s.computed(()=>t.type||(r==null?void 0:r.type)||""),d=s.computed(()=>{var p,g,m;return(m=(g=t.autoInsertSpace)!=null?g:(p=n.value)==null?void 0:p.autoInsertSpace)!=null?m:!1}),f=s.computed(()=>t.tag==="button"?{ariaDisabled:o.value||t.loading,disabled:o.value||t.loading,autofocus:t.autofocus,type:t.nativeType}:{}),h=s.computed(()=>{var p;const g=(p=c.default)==null?void 0:p.call(c);if(d.value&&(g==null?void 0:g.length)===1){const m=g[0];if((m==null?void 0:m.type)===s.Text){const y=m.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(y.trim())}}return!1});return{_disabled:o,_size:i,_type:u,_ref:l,_props:f,shouldAddSpace:h,handleClick:p=>{if(o.value||t.loading){p.stopPropagation();return}t.nativeType==="reset"&&(a==null||a.resetFields()),e("click",p)}}},vu=Fe({size:Ta,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:cn},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:cn,default:()=>Ne.Loading},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"}}),lA={click:t=>t instanceof MouseEvent};function Et(t,e){uA(t)&&(t="100%");var r=cA(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 rs(t){return Math.min(1,Math.max(0,t))}function uA(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function cA(t){return typeof t=="string"&&t.indexOf("%")!==-1}function My(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function ns(t){return t<=1?"".concat(Number(t)*100,"%"):t}function Un(t){return t.length===1?"0"+t:String(t)}function dA(t,e,r){return{r:Et(t,255)*255,g:Et(e,255)*255,b:Et(r,255)*255}}function Fy(t,e,r){t=Et(t,255),e=Et(e,255),r=Et(r,255);var n=Math.max(t,e,r),a=Math.min(t,e,r),i=0,o=0,l=(n+a)/2;if(n===a)o=0,i=0;else{var c=n-a;switch(o=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:o,l}}function gu(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 fA(t,e,r){var n,a,i;if(t=Et(t,360),e=Et(e,100),r=Et(r,100),e===0)a=r,i=r,n=r;else{var o=r<.5?r*(1+e):r+e-r*e,l=2*r-o;n=gu(l,o,t+1/3),a=gu(l,o,t),i=gu(l,o,t-1/3)}return{r:n*255,g:a*255,b:i*255}}function $y(t,e,r){t=Et(t,255),e=Et(e,255),r=Et(r,255);var n=Math.max(t,e,r),a=Math.min(t,e,r),i=0,o=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:o}}function hA(t,e,r){t=Et(t,360)*6,e=Et(e,100),r=Et(r,100);var n=Math.floor(t),a=t-n,i=r*(1-e),o=r*(1-a*e),l=r*(1-(1-a)*e),c=n%6,u=[r,o,i,i,l,r][c],d=[l,r,r,o,i,i][c],f=[i,i,l,r,r,o][c];return{r:u*255,g:d*255,b:f*255}}function Vy(t,e,r,n){var a=[Un(Math.round(t).toString(16)),Un(Math.round(e).toString(16)),Un(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 pA(t,e,r,n,a){var i=[Un(Math.round(t).toString(16)),Un(Math.round(e).toString(16)),Un(Math.round(r).toString(16)),Un(vA(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 vA(t){return Math.round(parseFloat(t)*255).toString(16)}function qy(t){return Wt(t)/255}function Wt(t){return parseInt(t,16)}function gA(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var mu={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 mA(t){var e={r:0,g:0,b:0},r=1,n=null,a=null,i=null,o=!1,l=!1;return typeof t=="string"&&(t=wA(t)),typeof t=="object"&&(jr(t.r)&&jr(t.g)&&jr(t.b)?(e=dA(t.r,t.g,t.b),o=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):jr(t.h)&&jr(t.s)&&jr(t.v)?(n=ns(t.s),a=ns(t.v),e=hA(t.h,n,a),o=!0,l="hsv"):jr(t.h)&&jr(t.s)&&jr(t.l)&&(n=ns(t.s),i=ns(t.l),e=fA(t.h,n,i),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(r=t.a)),r=My(r),{ok:o,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 yA="[-\\+]?\\d+%?",bA="[-\\+]?\\d*\\.\\d+%?",pn="(?:".concat(bA,")|(?:").concat(yA,")"),yu="[\\s|\\(]+(".concat(pn,")[,|\\s]+(").concat(pn,")[,|\\s]+(").concat(pn,")\\s*\\)?"),bu="[\\s|\\(]+(".concat(pn,")[,|\\s]+(").concat(pn,")[,|\\s]+(").concat(pn,")[,|\\s]+(").concat(pn,")\\s*\\)?"),pr={CSS_UNIT:new RegExp(pn),rgb:new RegExp("rgb"+yu),rgba:new RegExp("rgba"+bu),hsl:new RegExp("hsl"+yu),hsla:new RegExp("hsla"+bu),hsv:new RegExp("hsv"+yu),hsva:new RegExp("hsva"+bu),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 wA(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(mu[t])t=mu[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=pr.rgb.exec(t);return r?{r:r[1],g:r[2],b:r[3]}:(r=pr.rgba.exec(t),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=pr.hsl.exec(t),r?{h:r[1],s:r[2],l:r[3]}:(r=pr.hsla.exec(t),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=pr.hsv.exec(t),r?{h:r[1],s:r[2],v:r[3]}:(r=pr.hsva.exec(t),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=pr.hex8.exec(t),r?{r:Wt(r[1]),g:Wt(r[2]),b:Wt(r[3]),a:qy(r[4]),format:e?"name":"hex8"}:(r=pr.hex6.exec(t),r?{r:Wt(r[1]),g:Wt(r[2]),b:Wt(r[3]),format:e?"name":"hex"}:(r=pr.hex4.exec(t),r?{r:Wt(r[1]+r[1]),g:Wt(r[2]+r[2]),b:Wt(r[3]+r[3]),a:qy(r[4]+r[4]),format:e?"name":"hex8"}:(r=pr.hex3.exec(t),r?{r:Wt(r[1]+r[1]),g:Wt(r[2]+r[2]),b:Wt(r[3]+r[3]),format:e?"name":"hex"}:!1)))))))))}function jr(t){return!!pr.CSS_UNIT.exec(String(t))}var CA=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=gA(e)),this.originalInput=e;var a=mA(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,o=e.g/255,l=e.b/255;return i<=.03928?r=i/12.92:r=Math.pow((i+.055)/1.055,2.4),o<=.03928?n=o/12.92:n=Math.pow((o+.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=My(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=$y(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=$y(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=Fy(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=Fy(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),Vy(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),pA(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(Et(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(Et(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="#"+Vy(this.r,this.g,this.b,!1),r=0,n=Object.entries(mu);r<n.length;r++){var a=n[r],i=a[0],o=a[1];if(e===o)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=rs(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=rs(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=rs(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=rs(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,o={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(o)},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,o=[],l=1/e;e--;)o.push(new t({h:n,s:a,v:i})),i=(i+l)%1;return o},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,o=1;o<e;o++)a.push(new t({h:(n+o*i)%360,s:r.s,l:r.l}));return a},t.prototype.equals=function(e){return this.toRgbString()===new t(e).toRgbString()},t}();function vn(t,e=20){return t.mix("#141414",e).toString()}function EA(t){const e=Ii(),r=Oe("button");return s.computed(()=>{let n={},a=t.color;if(a){const i=a.match(/var\((.*?)\)/);i&&(a=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const o=new CA(a),l=t.dark?o.tint(20).toString():vn(o,20);if(t.plain)n=r.cssVarBlock({"bg-color":t.dark?vn(o,90):o.tint(90).toString(),"text-color":a,"border-color":t.dark?vn(o,50):o.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?vn(o,90):o.tint(90).toString(),n[r.cssVarBlockName("disabled-text-color")]=t.dark?vn(o,50):o.tint(50).toString(),n[r.cssVarBlockName("disabled-border-color")]=t.dark?vn(o,80):o.tint(80).toString());else{const c=t.dark?vn(o,30):o.tint(30).toString(),u=o.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?vn(o,50):o.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 xA=s.defineComponent({name:"ElButton"}),kA=s.defineComponent({...xA,props:vu,emits:lA,setup(t,{expose:e,emit:r}){const n=t,a=EA(n),i=Oe("button"),{_ref:o,_size:l,_type:c,_disabled:u,_props:d,shouldAddSpace:f,handleClick:h}=sA(n,r),v=s.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:o,size:l,type:c,disabled:u,shouldAddSpace:f}),(p,g)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(p.tag),s.mergeProps({ref_key:"_ref",ref:o},s.unref(d),{class:s.unref(v),style:s.unref(a),onClick:s.unref(h)}),{default:s.withCtx(()=>[p.loading?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[p.$slots.loading?s.renderSlot(p.$slots,"loading",{key:0}):(s.openBlock(),s.createBlock(s.unref(ut),{key:1,class:s.normalizeClass(s.unref(i).is("loading"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(p.loadingIcon)))]),_:1},8,["class"]))],64)):p.icon||p.$slots.icon?(s.openBlock(),s.createBlock(s.unref(ut),{key:1},{default:s.withCtx(()=>[p.icon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(p.icon),{key:0})):s.renderSlot(p.$slots,"icon",{key:1})]),_:3})):s.createCommentVNode("v-if",!0),p.$slots.default?(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass({[s.unref(i).em("text","expand")]:s.unref(f)})},[s.renderSlot(p.$slots,"default")],2)):s.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var SA=Be(kA,[["__file","button.vue"]]);const _A={size:vu.size,type:vu.type},TA=s.defineComponent({name:"ElButtonGroup"}),NA=s.defineComponent({...TA,props:_A,setup(t){const e=t;s.provide(Ly,s.reactive({size:s.toRef(e,"size"),type:s.toRef(e,"type")}));const r=Oe("button");return(n,a)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(s.unref(r).b("group"))},[s.renderSlot(n.$slots,"default")],2))}});var zy=Be(NA,[["__file","button-group.vue"]]);const Ht=vt(SA,{ButtonGroup:zy});Gr(zy);var Ai=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function IA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}const gn=new Map;if(rt){let t;document.addEventListener("mousedown",e=>t=e),document.addEventListener("mouseup",e=>{if(t){for(const r of gn.values())for(const{documentHandler:n}of r)n(e,t);t=void 0}})}function Hy(t,e){let r=[];return Array.isArray(e.arg)?r=e.arg:Vn(e.arg)&&r.push(e.arg),function(n,a){const i=e.instance.popperRef,o=n.target,l=a==null?void 0:a.target,c=!e||!e.instance,u=!o||!l,d=t.contains(o)||t.contains(l),f=t===o,h=r.length&&r.some(p=>p==null?void 0:p.contains(o))||r.length&&r.includes(l),v=i&&(i.contains(o)||i.contains(l));c||u||d||f||h||v||e.value(n,a)}}const Ky={beforeMount(t,e){gn.has(t)||gn.set(t,[]),gn.get(t).push({documentHandler:Hy(t,e),bindingFn:e.value})},updated(t,e){gn.has(t)||gn.set(t,[]);const r=gn.get(t),n=r.findIndex(i=>i.bindingFn===e.oldValue),a={documentHandler:Hy(t,e),bindingFn:e.value};n>=0?r.splice(n,1,a):r.push(a)},unmounted(t){gn.delete(t)}},BA=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"}}),DA=s.defineComponent({name:"ElCard"}),OA=s.defineComponent({...DA,props:BA,setup(t){const e=Oe("card");return(r,n)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([s.unref(e).b(),s.unref(e).is(`${r.shadow}-shadow`)])},[r.$slots.header||r.header?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(e).e("header"))},[s.renderSlot(r.$slots,"header",{},()=>[s.createTextVNode(s.toDisplayString(r.header),1)])],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass([s.unref(e).e("body"),r.bodyClass]),style:s.normalizeStyle(r.bodyStyle)},[s.renderSlot(r.$slots,"default")],6),r.$slots.footer||r.footer?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(s.unref(e).e("footer"))},[s.renderSlot(r.$slots,"footer",{},()=>[s.createTextVNode(s.toDisplayString(r.footer),1)])],2)):s.createCommentVNode("v-if",!0)],2))}});var PA=Be(OA,[["__file","card.vue"]]);const AA=vt(PA),Gy={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:Ta,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...fn(["ariaControls"])},Uy={[Ct]:t=>Nt(t)||wt(t)||ya(t),change:t=>Nt(t)||wt(t)||ya(t)},Ba=Symbol("checkboxGroupContextKey"),RA=({model:t,isChecked:e})=>{const r=s.inject(Ba,void 0),n=s.computed(()=>{var i,o;const l=(i=r==null?void 0:r.max)==null?void 0:i.value,c=(o=r==null?void 0:r.min)==null?void 0:o.value;return!un(l)&&t.value.length>=l&&!e.value||!un(c)&&t.value.length<=c&&e.value});return{isDisabled:Ii(s.computed(()=>(r==null?void 0:r.disabled.value)||n.value)),isLimitDisabled:n}},LA=(t,{model:e,isLimitExceeded:r,hasOwnLabel:n,isDisabled:a,isLabeledByFormItem:i})=>{const o=s.inject(Ba,void 0),{formItem:l}=Gn(),{emit:c}=s.getCurrentInstance();function u(p){var g,m,y,b;return[!0,t.trueValue,t.trueLabel].includes(p)?(m=(g=t.trueValue)!=null?g:t.trueLabel)!=null?m:!0:(b=(y=t.falseValue)!=null?y:t.falseLabel)!=null?b:!1}function d(p,g){c("change",u(p),g)}function f(p){if(r.value)return;const g=p.target;c("change",u(g.checked),p)}async function h(p){r.value||!n.value&&!a.value&&i.value&&(p.composedPath().some(y=>y.tagName==="LABEL")||(e.value=u([!1,t.falseValue,t.falseLabel].includes(e.value)),await s.nextTick(),d(e.value,p)))}const v=s.computed(()=>(o==null?void 0:o.validateEvent)||t.validateEvent);return s.watch(()=>t.modelValue,()=>{v.value&&(l==null||l.validate("change").catch(p=>nt(p)))}),{handleChange:f,onClickRoot:h}},MA=t=>{const e=s.ref(!1),{emit:r}=s.getCurrentInstance(),n=s.inject(Ba,void 0),a=s.computed(()=>un(n)===!1),i=s.ref(!1),o=s.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&&$t(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>o.value.length,i.value===!1&&((u=n==null?void 0:n.changeEvent)==null||u.call(n,l))):(r(Ct,l),e.value=l)}});return{model:o,isGroup:a,isLimitExceeded:i}},FA=(t,e,{model:r})=>{const n=s.inject(Ba,void 0),a=s.ref(!1),i=s.computed(()=>qo(t.value)?t.label:t.value),o=s.computed(()=>{const d=r.value;return ya(d)?d:$t(d)?bt(i.value)?d.map(s.toRaw).some(f=>Vo(f,i.value)):d.map(s.toRaw).includes(i.value):d!=null?d===t.trueValue||d===t.trueLabel:!!d}),l=Kn(s.computed(()=>{var d;return(d=n==null?void 0:n.size)==null?void 0:d.value}),{prop:!0}),c=Kn(s.computed(()=>{var d;return(d=n==null?void 0:n.size)==null?void 0:d.value})),u=s.computed(()=>!!e.default||!qo(i.value));return{checkboxButtonSize:l,isChecked:o,isFocused:a,checkboxSize:c,hasOwnLabel:u,actualValue:i}},jy=(t,e)=>{const{formItem:r}=Gn(),{model:n,isGroup:a,isLimitExceeded:i}=MA(t),{isFocused:o,isChecked:l,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,actualValue:f}=FA(t,e,{model:n}),{isDisabled:h}=RA({model:n,isChecked:l}),{inputId:v,isLabeledByFormItem:p}=Bi(t,{formItemContext:r,disableIdGeneration:d,disableIdManagement:a}),{handleChange:g,onClickRoot:m}=LA(t,{model:n,isLimitExceeded:i,hasOwnLabel:d,isDisabled:h,isLabeledByFormItem:p});return(()=>{function b(){var w,C;$t(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()})(),Ho({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>a.value&&qo(t.value))),Ho({from:"true-label",replacement:"true-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>!!t.trueLabel)),Ho({from:"false-label",replacement:"false-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>!!t.falseLabel)),{inputId:v,isLabeledByFormItem:p,isChecked:l,isDisabled:h,isFocused:o,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,model:n,actualValue:f,handleChange:g,onClickRoot:m}},$A=s.defineComponent({name:"ElCheckbox"}),VA=s.defineComponent({...$A,props:Gy,emits:Uy,setup(t){const e=t,r=s.useSlots(),{inputId:n,isLabeledByFormItem:a,isChecked:i,isDisabled:o,isFocused:l,checkboxSize:c,hasOwnLabel:u,model:d,actualValue:f,handleChange:h,onClickRoot:v}=jy(e,r),p=Oe("checkbox"),g=s.computed(()=>[p.b(),p.m(c.value),p.is("disabled",o.value),p.is("bordered",e.border),p.is("checked",i.value)]),m=s.computed(()=>[p.e("input"),p.is("disabled",o.value),p.is("checked",i.value),p.is("indeterminate",e.indeterminate),p.is("focus",l.value)]);return(y,b)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(!s.unref(u)&&s.unref(a)?"span":"label"),{class:s.normalizeClass(s.unref(g)),"aria-controls":y.indeterminate?y.ariaControls:null,onClick:s.unref(v)},{default:s.withCtx(()=>{var w,C,x,k;return[s.createElementVNode("span",{class:s.normalizeClass(s.unref(m))},[y.trueValue||y.falseValue||y.trueLabel||y.falseLabel?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,id:s.unref(n),"onUpdate:modelValue":E=>s.isRef(d)?d.value=E:null,class:s.normalizeClass(s.unref(p).e("original")),type:"checkbox",indeterminate:y.indeterminate,name:y.name,tabindex:y.tabindex,disabled:s.unref(o),"true-value":(C=(w=y.trueValue)!=null?w:y.trueLabel)!=null?C:!0,"false-value":(k=(x=y.falseValue)!=null?x:y.falseLabel)!=null?k:!1,onChange:s.unref(h),onFocus:E=>l.value=!0,onBlur:E=>l.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(d)]]):s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:1,id:s.unref(n),"onUpdate:modelValue":E=>s.isRef(d)?d.value=E:null,class:s.normalizeClass(s.unref(p).e("original")),type:"checkbox",indeterminate:y.indeterminate,disabled:s.unref(o),value:s.unref(f),name:y.name,tabindex:y.tabindex,onChange:s.unref(h),onFocus:E=>l.value=!0,onBlur:E=>l.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","disabled","value","name","tabindex","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(d)]]),s.createElementVNode("span",{class:s.normalizeClass(s.unref(p).e("inner"))},null,2)],2),s.unref(u)?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(p).e("label"))},[s.renderSlot(y.$slots,"default"),y.$slots.default?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(y.label),1)],64))],2)):s.createCommentVNode("v-if",!0)]}),_:3},8,["class","aria-controls","onClick"]))}});var qA=Be(VA,[["__file","checkbox.vue"]]);const zA=s.defineComponent({name:"ElCheckboxButton"}),HA=s.defineComponent({...zA,props:Gy,emits:Uy,setup(t){const e=t,r=s.useSlots(),{isFocused:n,isChecked:a,isDisabled:i,checkboxButtonSize:o,model:l,actualValue:c,handleChange:u}=jy(e,r),d=s.inject(Ba,void 0),f=Oe("checkbox"),h=s.computed(()=>{var p,g,m,y;const b=(g=(p=d==null?void 0:d.fill)==null?void 0:p.value)!=null?g:"";return{backgroundColor:b,borderColor:b,color:(y=(m=d==null?void 0:d.textColor)==null?void 0:m.value)!=null?y:"",boxShadow:b?`-1px 0 0 0 ${b}`:void 0}}),v=s.computed(()=>[f.b("button"),f.bm("button",o.value),f.is("disabled",i.value),f.is("checked",a.value),f.is("focus",n.value)]);return(p,g)=>{var m,y,b,w;return s.openBlock(),s.createElementBlock("label",{class:s.normalizeClass(s.unref(v))},[p.trueValue||p.falseValue||p.trueLabel||p.falseLabel?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,"onUpdate:modelValue":C=>s.isRef(l)?l.value=C:null,class:s.normalizeClass(s.unref(f).be("button","original")),type:"checkbox",name:p.name,tabindex:p.tabindex,disabled:s.unref(i),"true-value":(y=(m=p.trueValue)!=null?m:p.trueLabel)!=null?y:!0,"false-value":(w=(b=p.falseValue)!=null?b:p.falseLabel)!=null?w:!1,onChange:s.unref(u),onFocus:C=>n.value=!0,onBlur:C=>n.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(l)]]):s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:1,"onUpdate:modelValue":C=>s.isRef(l)?l.value=C:null,class:s.normalizeClass(s.unref(f).be("button","original")),type:"checkbox",name:p.name,tabindex:p.tabindex,disabled:s.unref(i),value:s.unref(c),onChange:s.unref(u),onFocus:C=>n.value=!0,onBlur:C=>n.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(l)]]),p.$slots.default||p.label?(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass(s.unref(f).be("button","inner")),style:s.normalizeStyle(s.unref(a)?s.unref(h):void 0)},[s.renderSlot(p.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(p.label),1)])],6)):s.createCommentVNode("v-if",!0)],2)}}});var Wy=Be(HA,[["__file","checkbox-button.vue"]]);const KA=Fe({modelValue:{type:ke(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:Ta,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...fn(["ariaLabel"])}),GA={[Ct]:t=>$t(t),change:t=>$t(t)},UA=s.defineComponent({name:"ElCheckboxGroup"}),jA=s.defineComponent({...UA,props:KA,emits:GA,setup(t,{emit:e}){const r=t,n=Oe("checkbox"),{formItem:a}=Gn(),{inputId:i,isLabeledByFormItem:o}=Bi(r,{formItemContext:a}),l=async u=>{e(Ct,u),await s.nextTick(),e("change",u)},c=s.computed({get(){return r.modelValue},set(u){l(u)}});return s.provide(Ba,{...Tm(s.toRefs(r),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:c,changeEvent:l}),s.watch(()=>r.modelValue,()=>{r.validateEvent&&(a==null||a.validate("change").catch(u=>nt(u)))}),(u,d)=>{var f;return s.openBlock(),s.createBlock(s.resolveDynamicComponent(u.tag),{id:s.unref(i),class:s.normalizeClass(s.unref(n).b("group")),role:"group","aria-label":s.unref(o)?void 0:u.ariaLabel||"checkbox-group","aria-labelledby":s.unref(o)?(f=s.unref(a))==null?void 0:f.labelId:void 0},{default:s.withCtx(()=>[s.renderSlot(u.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var Yy=Be(jA,[["__file","checkbox-group.vue"]]);const WA=vt(qA,{CheckboxButton:Wy,CheckboxGroup:Yy});Gr(Wy),Gr(Yy);const wu=Fe({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Pm},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),YA={close:t=>t instanceof MouseEvent,click:t=>t instanceof MouseEvent},ZA=s.defineComponent({name:"ElTag"}),XA=s.defineComponent({...ZA,props:wu,emits:YA,setup(t,{emit:e}){const r=t,n=Kn(),a=Oe("tag"),i=s.computed(()=>{const{type:u,hit:d,effect:f,closable:h,round:v}=r;return[a.b(),a.is("closable",h),a.m(u||"primary"),a.m(n.value),a.m(f),a.is("hit",d),a.is("round",v)]}),o=u=>{e("close",u)},l=u=>{e("click",u)},c=u=>{u.component.subTree.component.bum=null};return(u,d)=>u.disableTransitions?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(i)),style:s.normalizeStyle({backgroundColor:u.color}),onClick:l},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(a).e("content"))},[s.renderSlot(u.$slots,"default")],2),u.closable?(s.openBlock(),s.createBlock(s.unref(ut),{key:0,class:s.normalizeClass(s.unref(a).e("close")),onClick:s.withModifiers(o,["stop"])},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.Close))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0)],6)):(s.openBlock(),s.createBlock(s.Transition,{key:1,name:`${s.unref(a).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:c},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(s.unref(i)),style:s.normalizeStyle({backgroundColor:u.color}),onClick:l},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(a).e("content"))},[s.renderSlot(u.$slots,"default")],2),u.closable?(s.openBlock(),s.createBlock(s.unref(ut),{key:0,class:s.normalizeClass(s.unref(a).e("close")),onClick:s.withModifiers(o,["stop"])},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.Close))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var JA=Be(XA,[["__file","tag.vue"]]);const QA=vt(JA),Zy=Symbol("rowContextKey"),eR=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"]}}),tR=s.defineComponent({name:"ElRow"}),rR=s.defineComponent({...tR,props:eR,setup(t){const e=t,r=Oe("row"),n=s.computed(()=>e.gutter);s.provide(Zy,{gutter:n});const a=s.computed(()=>{const o={};return e.gutter&&(o.marginRight=o.marginLeft=`-${e.gutter/2}px`),o}),i=s.computed(()=>[r.b(),r.is(`justify-${e.justify}`,e.justify!=="start"),r.is(`align-${e.align}`,!!e.align)]);return(o,l)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o.tag),{class:s.normalizeClass(s.unref(i)),style:s.normalizeStyle(s.unref(a))},{default:s.withCtx(()=>[s.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var nR=Be(rR,[["__file","row.vue"]]);const as=vt(nR),aR=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:()=>wa({})},sm:{type:ke([Number,Object]),default:()=>wa({})},md:{type:ke([Number,Object]),default:()=>wa({})},lg:{type:ke([Number,Object]),default:()=>wa({})},xl:{type:ke([Number,Object]),default:()=>wa({})}}),iR=s.defineComponent({name:"ElCol"}),oR=s.defineComponent({...iR,props:aR,setup(t){const e=t,{gutter:r}=s.inject(Zy,{gutter:s.computed(()=>0)}),n=Oe("col"),a=s.computed(()=>{const o={};return r.value&&(o.paddingLeft=o.paddingRight=`${r.value/2}px`),o}),i=s.computed(()=>{const o=[];return["span","offset","pull","push"].forEach(u=>{const d=e[u];wt(d)&&(u==="span"?o.push(n.b(`${e[u]}`)):d>0&&o.push(n.b(`${u}-${e[u]}`)))}),["xs","sm","md","lg","xl"].forEach(u=>{wt(e[u])?o.push(n.b(`${u}-${e[u]}`)):bt(e[u])&&Object.entries(e[u]).forEach(([d,f])=>{o.push(d!=="span"?n.b(`${u}-${d}-${f}`):n.b(`${u}-${f}`))})}),r.value&&o.push(n.is("guttered")),[n.b(),o]});return(o,l)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o.tag),{class:s.normalizeClass(s.unref(i)),style:s.normalizeStyle(s.unref(a))},{default:s.withCtx(()=>[s.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var sR=Be(oR,[["__file","col.vue"]]);const Ri=vt(sR),lR=s.defineComponent({name:"ElCollapseTransition"}),uR=s.defineComponent({...lR,setup(t){const e=Oe("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)=>(s.openBlock(),s.createBlock(s.Transition,s.mergeProps({name:s.unref(e).b()},s.toHandlers(n)),{default:s.withCtx(()=>[s.renderSlot(a.$slots,"default")]),_:3},16,["name"]))}});var cR=Be(uR,[["__file","collapse-transition.vue"]]);const dR=vt(cR),fR=Fe({color:{type:ke(Object),required:!0},vertical:{type:Boolean,default:!1}});let Cu=!1;function Li(t,e){if(!rt)return;const r=function(i){var o;(o=e.drag)==null||o.call(e,i)},n=function(i){var o;document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",n),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",n),document.onselectstart=null,document.ondragstart=null,Cu=!1,(o=e.end)==null||o.call(e,i)},a=function(i){var o;Cu||(i.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",r),document.addEventListener("mouseup",n),document.addEventListener("touchmove",r),document.addEventListener("touchend",n),Cu=!0,(o=e.start)==null||o.call(e,i))};t.addEventListener("mousedown",a),t.addEventListener("touchstart",a,{passive:!1})}const hR=t=>{const e=s.getCurrentInstance(),{t:r}=wi(),n=s.shallowRef(),a=s.shallowRef(),i=s.computed(()=>t.color.get("alpha")),o=s.computed(()=>r("el.colorpicker.alphaLabel"));function l(f){var h;f.target!==n.value&&c(f),(h=n.value)==null||h.focus()}function c(f){if(!a.value||!n.value)return;const v=e.vnode.el.getBoundingClientRect(),{clientX:p,clientY:g}=_l(f);if(t.vertical){let m=g-v.top;m=Math.max(n.value.offsetHeight/2,m),m=Math.min(m,v.height-n.value.offsetHeight/2),t.color.set("alpha",Math.round((m-n.value.offsetHeight/2)/(v.height-n.value.offsetHeight)*100))}else{let m=p-v.left;m=Math.max(n.value.offsetWidth/2,m),m=Math.min(m,v.width-n.value.offsetWidth/2),t.color.set("alpha",Math.round((m-n.value.offsetWidth/2)/(v.width-n.value.offsetWidth)*100))}}function u(f){const{code:h,shiftKey:v}=f,p=v?10:1;switch(h){case lt.left:case lt.down:f.preventDefault(),f.stopPropagation(),d(-p);break;case lt.right:case lt.up:f.preventDefault(),f.stopPropagation(),d(p);break}}function d(f){let h=i.value+f;h=h<0?0:h>100?100:h,t.color.set("alpha",h)}return{thumb:n,bar:a,alpha:i,alphaLabel:o,handleDrag:c,handleClick:l,handleKeydown:u}},pR=(t,{bar:e,thumb:r,handleDrag:n})=>{const a=s.getCurrentInstance(),i=Oe("color-alpha-slider"),o=s.ref(0),l=s.ref(0),c=s.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 h(){o.value=u(),l.value=d(),c.value=f()}s.onMounted(()=>{if(!e.value||!r.value)return;const b={drag:w=>{n(w)},end:w=>{n(w)}};Li(e.value,b),Li(r.value,b),h()}),s.watch(()=>t.color.get("alpha"),()=>h()),s.watch(()=>t.color.value,()=>h());const v=s.computed(()=>[i.b(),i.is("vertical",t.vertical)]),p=s.computed(()=>i.e("bar")),g=s.computed(()=>i.e("thumb")),m=s.computed(()=>({background:c.value})),y=s.computed(()=>({left:ba(o.value),top:ba(l.value)}));return{rootKls:v,barKls:p,barStyle:m,thumbKls:g,thumbStyle:y,update:h}},vR=s.defineComponent({name:"ElColorAlphaSlider"}),gR=s.defineComponent({...vR,props:fR,setup(t,{expose:e}){const r=t,{alpha:n,alphaLabel:a,bar:i,thumb:o,handleDrag:l,handleClick:c,handleKeydown:u}=hR(r),{rootKls:d,barKls:f,barStyle:h,thumbKls:v,thumbStyle:p,update:g}=pR(r,{bar:i,thumb:o,handleDrag:l});return e({update:g,bar:i,thumb:o}),(m,y)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(s.unref(d))},[s.createElementVNode("div",{ref_key:"bar",ref:i,class:s.normalizeClass(s.unref(f)),style:s.normalizeStyle(s.unref(h)),onClick:s.unref(c)},null,14,["onClick"]),s.createElementVNode("div",{ref_key:"thumb",ref:o,class:s.normalizeClass(s.unref(v)),style:s.normalizeStyle(s.unref(p)),"aria-label":s.unref(a),"aria-valuenow":s.unref(n),"aria-orientation":m.vertical?"vertical":"horizontal","aria-valuemin":"0","aria-valuemax":"100",role:"slider",tabindex:"0",onKeydown:s.unref(u)},null,46,["aria-label","aria-valuenow","aria-orientation","onKeydown"])],2))}});var mR=Be(gR,[["__file","alpha-slider.vue"]]);const yR=s.defineComponent({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(t){const e=Oe("color-hue-slider"),r=s.getCurrentInstance(),n=s.ref(),a=s.ref(),i=s.ref(0),o=s.ref(0),l=s.computed(()=>t.color.get("hue"));s.watch(()=>l.value,()=>{h()});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:m,clientY:y}=_l(v);let b;if(t.vertical){let w=y-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=m-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 p=t.color.get("hue");return v?Math.round(p*(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 p=t.color.get("hue");return v?Math.round(p*(v.offsetHeight-n.value.offsetHeight/2)/360):0}function h(){i.value=d(),o.value=f()}return s.onMounted(()=>{if(!a.value||!n.value)return;const v={drag:p=>{u(p)},end:p=>{u(p)}};Li(a.value,v),Li(n.value,v),h()}),{bar:a,thumb:n,thumbLeft:i,thumbTop:o,hueValue:l,handleClick:c,update:h,ns:e}}});function bR(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([t.ns.b(),t.ns.is("vertical",t.vertical)])},[s.createElementVNode("div",{ref:"bar",class:s.normalizeClass(t.ns.e("bar")),onClick:t.handleClick},null,10,["onClick"]),s.createElementVNode("div",{ref:"thumb",class:s.normalizeClass(t.ns.e("thumb")),style:s.normalizeStyle({left:t.thumbLeft+"px",top:t.thumbTop+"px"})},null,6)],2)}var wR=Be(yR,[["render",bR],["__file","hue-slider.vue"]]);const CR=Fe({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:Ta,popperClass:{type:String,default:""},tabindex:{type:[String,Number],default:0},teleported:zt.teleported,predefine:{type:ke(Array)},validateEvent:{type:Boolean,default:!0},...fn(["ariaLabel"])}),ER={[Ct]:t=>Nt(t)||ln(t),[Gl]:t=>Nt(t)||ln(t),activeChange:t=>Nt(t)||ln(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent},Xy=Symbol("colorPickerContextKey"),Jy=function(t,e,r){return[t,e*r/((t=(2-e)*r)<1?t:2-t)||0,t/2]},xR=function(t){return typeof t=="string"&&t.includes(".")&&Number.parseFloat(t)===1},kR=function(t){return typeof t=="string"&&t.includes("%")},Da=function(t,e){xR(t)&&(t="100%");const r=kR(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)},Qy={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},is=t=>{t=Math.min(Math.round(t),255);const e=Math.floor(t/16),r=t%16;return`${Qy[e]||e}${Qy[r]||r}`},e0=function({r:t,g:e,b:r}){return Number.isNaN(+t)||Number.isNaN(+e)||Number.isNaN(+r)?"":`#${is(t)}${is(e)}${is(r)}`},Eu={A:10,B:11,C:12,D:13,E:14,F:15},jn=function(t){return t.length===2?(Eu[t[0].toUpperCase()]||+t[0])*16+(Eu[t[1].toUpperCase()]||+t[1]):Eu[t[1].toUpperCase()]||+t[1]},SR=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,o=r===0?2*n/(a+n):2*e/(r+e);return{h:t,s:o*100,v:i*100}},t0=(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 o=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:o*100}},Mi=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),o=r*(1-a*e),l=r*(1-(1-a)*e),c=n%6,u=[r,o,i,i,l,r][c],d=[l,r,r,o,i,i][c],f=[i,i,l,r,r,o][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)Ln(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)Ln(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 Mi(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:o}=SR(n[0],n[1],n[2]);r(a,i,o)}}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:o}=t0(n[0],n[1],n[2]);r(a,i,o)}}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,o;n.length===3?(a=jn(n[0]+n[0]),i=jn(n[1]+n[1]),o=jn(n[2]+n[2])):(n.length===6||n.length===8)&&(a=jn(n.slice(0,2)),i=jn(n.slice(2,4)),o=jn(n.slice(4,6))),n.length===8?this._alpha=jn(n.slice(6))/255*100:(n.length===3||n.length===6)&&(this._alpha=100);const{h:l,s:c,v:u}=t0(a,i,o);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 o=Jy(e,r/100,n/100);this.value=`hsla(${e}, ${Math.round(o[1]*100)}%, ${Math.round(o[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=`${e0(Mi(e,r,n))}${is(a*255/100)}`;break}default:{const{r:o,g:l,b:c}=Mi(e,r,n);this.value=`rgba(${o}, ${l}, ${c}, ${this.get("alpha")/100})`}}else switch(i){case"hsl":{const o=Jy(e,r/100,n/100);this.value=`hsl(${e}, ${Math.round(o[1]*100)}%, ${Math.round(o[2]*100)}%)`;break}case"hsv":{this.value=`hsv(${e}, ${Math.round(r)}%, ${Math.round(n)}%)`;break}case"rgb":{const{r:o,g:l,b:c}=Mi(e,r,n);this.value=`rgb(${o}, ${l}, ${c})`;break}default:this.value=e0(Mi(e,r,n))}}}const _R=s.defineComponent({props:{colors:{type:Array,required:!0},color:{type:Object,required:!0},enableAlpha:{type:Boolean,required:!0}},setup(t){const e=Oe("color-predefine"),{currentColor:r}=s.inject(Xy),n=s.ref(i(t.colors,t.color));s.watch(()=>r.value,o=>{const l=new Fi;l.fromString(o),n.value.forEach(c=>{c.selected=l.compare(c)})}),s.watchEffect(()=>{n.value=i(t.colors,t.color)});function a(o){t.color.fromString(t.colors[o])}function i(o,l){return o.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 TR(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(t.ns.b())},[s.createElementVNode("div",{class:s.normalizeClass(t.ns.e("colors"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.rgbaColors,(o,l)=>(s.openBlock(),s.createElementBlock("div",{key:t.colors[l],class:s.normalizeClass([t.ns.e("color-selector"),t.ns.is("alpha",o._alpha<100),{selected:o.selected}]),onClick:c=>t.handleSelect(l)},[s.createElementVNode("div",{style:s.normalizeStyle({backgroundColor:o.value})},null,4)],10,["onClick"]))),128))],2)],2)}var NR=Be(_R,[["render",TR],["__file","predefine.vue"]]);const IR=s.defineComponent({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(t){const e=Oe("color-svpanel"),r=s.getCurrentInstance(),n=s.ref(0),a=s.ref(0),i=s.ref("hsl(0, 100%, 50%)"),o=s.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:h,clientHeight:v}=f;a.value=u*h/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:h,clientY:v}=_l(u);let p=h-f.left,g=v-f.top;p=Math.max(0,p),p=Math.min(p,f.width),g=Math.max(0,g),g=Math.min(g,f.height),a.value=p,n.value=g,t.color.set({saturation:p/f.width*100,value:100-g/f.height*100})}return s.watch(()=>o.value,()=>{l()}),s.onMounted(()=>{Li(r.vnode.el,{drag:u=>{c(u)},end:u=>{c(u)}}),l()}),{cursorTop:n,cursorLeft:a,background:i,colorValue:o,handleDrag:c,update:l,ns:e}}});function BR(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(t.ns.b()),style:s.normalizeStyle({backgroundColor:t.background})},[s.createElementVNode("div",{class:s.normalizeClass(t.ns.e("white"))},null,2),s.createElementVNode("div",{class:s.normalizeClass(t.ns.e("black"))},null,2),s.createElementVNode("div",{class:s.normalizeClass(t.ns.e("cursor")),style:s.normalizeStyle({top:t.cursorTop+"px",left:t.cursorLeft+"px"})},[s.createElementVNode("div")],6)],6)}var DR=Be(IR,[["render",BR],["__file","sv-panel.vue"]]);const OR=s.defineComponent({name:"ElColorPicker"}),PR=s.defineComponent({...OR,props:CR,emits:ER,setup(t,{expose:e,emit:r}){const n=t,{t:a}=wi(),i=Oe("color"),{formItem:o}=Gn(),l=Kn(),c=Ii(),{inputId:u,isLabeledByFormItem:d}=Bi(n,{formItemContext:o}),f=s.ref(),h=s.ref(),v=s.ref(),p=s.ref(),g=s.ref(),m=s.ref(),{isFocused:y,handleFocus:b,handleBlur:w}=nu(g,{beforeFocus(){return c.value},beforeBlur(M){var W;return(W=p.value)==null?void 0:W.isFocusInsideContent(M)},afterBlur(){R(!1),q()}});let C=!0;const x=s.reactive(new Fi({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue})),k=s.ref(!1),E=s.ref(!1),_=s.ref(""),S=s.computed(()=>!n.modelValue&&!E.value?"transparent":D(x,n.showAlpha)),T=s.computed(()=>!n.modelValue&&!E.value?"":x.value),N=s.computed(()=>d.value?void 0:n.ariaLabel||a("el.colorpicker.defaultLabel")),B=s.computed(()=>d.value?o==null?void 0:o.labelId:void 0),O=s.computed(()=>[i.b("picker"),i.is("disabled",c.value),i.bm("picker",l.value),i.is("focused",y.value)]);function D(M,W){if(!(M instanceof Fi))throw new TypeError("color should be instance of _color Class");const{r:Y,g:se,b:ce}=M.toRgb();return W?`rgba(${Y}, ${se}, ${ce}, ${M.get("alpha")/100})`:`rgb(${Y}, ${se}, ${ce})`}function R(M){k.value=M}const P=_m(R,100,{leading:!0});function L(){c.value||R(!0)}function A(){P(!1),q()}function q(){s.nextTick(()=>{n.modelValue?x.fromString(n.modelValue):(x.value="",s.nextTick(()=>{E.value=!1}))})}function U(){c.value||P(!k.value)}function z(){x.fromString(_.value)}function H(){const M=x.value;r(Ct,M),r("change",M),n.validateEvent&&(o==null||o.validate("change").catch(W=>nt(W))),P(!1),s.nextTick(()=>{const W=new Fi({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue});x.compare(W)||q()})}function Q(){P(!1),r(Ct,null),r("change",null),n.modelValue!==null&&n.validateEvent&&(o==null||o.validate("change").catch(M=>nt(M))),q()}function F(){k.value&&(A(),y.value&&G())}function $(M){M.preventDefault(),M.stopPropagation(),R(!1),q()}function V(M){switch(M.code){case lt.enter:case lt.space:M.preventDefault(),M.stopPropagation(),L(),m.value.focus();break;case lt.esc:$(M);break}}function G(){g.value.focus()}function j(){g.value.blur()}return s.onMounted(()=>{n.modelValue&&(_.value=T.value)}),s.watch(()=>n.modelValue,M=>{M?M&&M!==x.value&&(C=!1,x.fromString(M)):E.value=!1}),s.watch(()=>[n.colorFormat,n.showAlpha],()=>{x.enableAlpha=n.showAlpha,x.format=n.colorFormat||x.format,x.doOnChange(),r(Ct,x.value)}),s.watch(()=>T.value,M=>{_.value=M,C&&r("activeChange",M),C=!0}),s.watch(()=>x.value,()=>{!n.modelValue&&!E.value&&(E.value=!0)}),s.watch(()=>k.value,()=>{s.nextTick(()=>{var M,W,Y;(M=f.value)==null||M.update(),(W=h.value)==null||W.update(),(Y=v.value)==null||Y.update()})}),s.provide(Xy,{currentColor:T}),e({color:x,show:L,hide:A,focus:G,blur:j}),(M,W)=>(s.openBlock(),s.createBlock(s.unref(Pi),{ref_key:"popper",ref:p,visible:k.value,"show-arrow":!1,"fallback-placements":["bottom","top","right","left"],offset:0,"gpu-acceleration":!1,"popper-class":[s.unref(i).be("picker","panel"),s.unref(i).b("dropdown"),M.popperClass],"stop-popper-mouse-event":!1,effect:"light",trigger:"click",teleported:M.teleported,transition:`${s.unref(i).namespace.value}-zoom-in-top`,persistent:"",onHide:Y=>R(!1)},{content:s.withCtx(()=>[s.withDirectives((s.openBlock(),s.createElementBlock("div",{onKeydown:s.withKeys($,["esc"])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(i).be("dropdown","main-wrapper"))},[s.createVNode(wR,{ref_key:"hue",ref:f,class:"hue-slider",color:s.unref(x),vertical:""},null,8,["color"]),s.createVNode(DR,{ref_key:"sv",ref:h,color:s.unref(x)},null,8,["color"])],2),M.showAlpha?(s.openBlock(),s.createBlock(mR,{key:0,ref_key:"alpha",ref:v,color:s.unref(x)},null,8,["color"])):s.createCommentVNode("v-if",!0),M.predefine?(s.openBlock(),s.createBlock(NR,{key:1,ref:"predefine","enable-alpha":M.showAlpha,color:s.unref(x),colors:M.predefine},null,8,["enable-alpha","color","colors"])):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(i).be("dropdown","btns"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(i).be("dropdown","value"))},[s.createVNode(s.unref(Di),{ref_key:"inputRef",ref:m,modelValue:_.value,"onUpdate:modelValue":Y=>_.value=Y,"validate-event":!1,size:"small",onKeyup:s.withKeys(z,["enter"]),onBlur:z},null,8,["modelValue","onUpdate:modelValue","onKeyup"])],2),s.createVNode(s.unref(Ht),{class:s.normalizeClass(s.unref(i).be("dropdown","link-btn")),text:"",size:"small",onClick:Q},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(a)("el.colorpicker.clear")),1)]),_:1},8,["class"]),s.createVNode(s.unref(Ht),{plain:"",size:"small",class:s.normalizeClass(s.unref(i).be("dropdown","btn")),onClick:H},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(a)("el.colorpicker.confirm")),1)]),_:1},8,["class"])],2)],40,["onKeydown"])),[[s.unref(Ky),F]])]),default:s.withCtx(()=>[s.createElementVNode("div",s.mergeProps({id:s.unref(u),ref_key:"triggerRef",ref:g},M.$attrs,{class:s.unref(O),role:"button","aria-label":s.unref(N),"aria-labelledby":s.unref(B),"aria-description":s.unref(a)("el.colorpicker.description",{color:M.modelValue||""}),"aria-disabled":s.unref(c),tabindex:s.unref(c)?-1:M.tabindex,onKeydown:V,onFocus:s.unref(b),onBlur:s.unref(w)}),[s.unref(c)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(i).be("picker","mask"))},null,2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(i).be("picker","trigger")),onClick:U},[s.createElementVNode("span",{class:s.normalizeClass([s.unref(i).be("picker","color"),s.unref(i).is("alpha",M.showAlpha)])},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(i).be("picker","color-inner")),style:s.normalizeStyle({backgroundColor:s.unref(S)})},[s.withDirectives(s.createVNode(s.unref(ut),{class:s.normalizeClass([s.unref(i).be("picker","icon"),s.unref(i).is("icon-arrow-down")])},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.ArrowDown))]),_:1},8,["class"]),[[s.vShow,M.modelValue||E.value]]),s.withDirectives(s.createVNode(s.unref(ut),{class:s.normalizeClass([s.unref(i).be("picker","empty"),s.unref(i).is("icon-close")])},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.Close))]),_:1},8,["class"]),[[s.vShow,!M.modelValue&&!E.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 AR=Be(PR,[["__file","color-picker.vue"]]);const RR=vt(AR),LR=s.defineComponent({name:"ElContainer"}),MR=s.defineComponent({...LR,props:{direction:{type:String}},setup(t){const e=t,r=s.useSlots(),n=Oe("container"),a=s.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:r&&r.default?r.default().some(o=>{const l=o.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(i,o)=>(s.openBlock(),s.createElementBlock("section",{class:s.normalizeClass([s.unref(n).b(),s.unref(n).is("vertical",s.unref(a))])},[s.renderSlot(i.$slots,"default")],2))}});var FR=Be(MR,[["__file","container.vue"]]);const $R=s.defineComponent({name:"ElAside"}),VR=s.defineComponent({...$R,props:{width:{type:String,default:null}},setup(t){const e=t,r=Oe("aside"),n=s.computed(()=>e.width?r.cssVarBlock({width:e.width}):{});return(a,i)=>(s.openBlock(),s.createElementBlock("aside",{class:s.normalizeClass(s.unref(r).b()),style:s.normalizeStyle(s.unref(n))},[s.renderSlot(a.$slots,"default")],6))}});var r0=Be(VR,[["__file","aside.vue"]]);const qR=s.defineComponent({name:"ElFooter"}),zR=s.defineComponent({...qR,props:{height:{type:String,default:null}},setup(t){const e=t,r=Oe("footer"),n=s.computed(()=>e.height?r.cssVarBlock({height:e.height}):{});return(a,i)=>(s.openBlock(),s.createElementBlock("footer",{class:s.normalizeClass(s.unref(r).b()),style:s.normalizeStyle(s.unref(n))},[s.renderSlot(a.$slots,"default")],6))}});var n0=Be(zR,[["__file","footer.vue"]]);const HR=s.defineComponent({name:"ElHeader"}),KR=s.defineComponent({...HR,props:{height:{type:String,default:null}},setup(t){const e=t,r=Oe("header"),n=s.computed(()=>e.height?r.cssVarBlock({height:e.height}):{});return(a,i)=>(s.openBlock(),s.createElementBlock("header",{class:s.normalizeClass(s.unref(r).b()),style:s.normalizeStyle(s.unref(n))},[s.renderSlot(a.$slots,"default")],6))}});var a0=Be(KR,[["__file","header.vue"]]);const GR=s.defineComponent({name:"ElMain"}),UR=s.defineComponent({...GR,setup(t){const e=Oe("main");return(r,n)=>(s.openBlock(),s.createElementBlock("main",{class:s.normalizeClass(s.unref(e).b())},[s.renderSlot(r.$slots,"default")],2))}});var i0=Be(UR,[["__file","main.vue"]]);const xu=vt(FR,{Aside:r0,Footer:n0,Header:a0,Main:i0});Gr(r0),Gr(n0);const o0=Gr(a0),ku=Gr(i0),jR=s.defineComponent({inheritAttrs:!1});function WR(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default")}var YR=Be(jR,[["render",WR],["__file","collection.vue"]]);const ZR=s.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function XR(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default")}var JR=Be(ZR,[["render",XR],["__file","collection-item.vue"]]);const QR="data-el-collection-item",eL=t=>{const e=`El${t}Collection`,r=`${e}Item`,n=Symbol(e),a=Symbol(r),i={...YR,name:e,setup(){const l=s.ref(null),c=new Map,u=()=>{const d=s.unref(l);if(!d)return[];const f=Array.from(d.querySelectorAll(`[${QR}]`));return[...c.values()].sort((v,p)=>f.indexOf(v.ref)-f.indexOf(p.ref))};s.provide(n,{itemMap:c,getItems:u,collectionRef:l})}},o={...JR,name:r,setup(l,{attrs:c}){const u=s.ref(null),d=s.inject(n,void 0);s.provide(a,{collectionItemRef:u}),s.onMounted(()=>{const f=s.unref(u);f&&d.itemMap.set(f,{ref:f,...c})}),s.onBeforeUnmount(()=>{const f=s.unref(u);d.itemMap.delete(f)})}};return{COLLECTION_INJECTION_KEY:n,COLLECTION_ITEM_INJECTION_KEY:a,ElCollection:i,ElCollectionItem:o}},Su=Fe({trigger:Oi.trigger,effect:{...zt.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:zt.teleported});Fe({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:cn}}),Fe({onKeydown:{type:ke(Function)}}),eL("Dropdown");const s0=Symbol("ElSelectGroup"),$i=Symbol("ElSelect");function tL(t,e){const r=s.inject($i),n=s.inject(s0,{disabled:!1}),a=s.computed(()=>d(on(r.props.modelValue),t.value)),i=s.computed(()=>{var v;if(r.props.multiple){const p=on((v=r.props.modelValue)!=null?v:[]);return!a.value&&p.length>=r.props.multipleLimit&&r.props.multipleLimit>0}else return!1}),o=s.computed(()=>t.label||(bt(t.value)?"":t.value)),l=s.computed(()=>t.value||t.label||""),c=s.computed(()=>t.disabled||e.groupDisabled||i.value),u=s.getCurrentInstance(),d=(v=[],p)=>{if(bt(t.value)){const g=r.props.valueKey;return v&&v.some(m=>s.toRaw(Hr(m,g))===Hr(p,g))}else return v&&v.includes(p)},f=()=>{!t.disabled&&!n.disabled&&(r.states.hoveringIndex=r.optionsArray.indexOf(u.proxy))},h=v=>{const p=new RegExp(WB(v),"i");e.visible=p.test(o.value)||t.created};return s.watch(()=>o.value,()=>{!t.created&&!r.props.remote&&r.setSelected()}),s.watch(()=>t.value,(v,p)=>{const{remote:g,valueKey:m}=r.props;if(v!==p&&(r.onOptionDestroy(p,u.proxy),r.onOptionCreate(u.proxy)),!t.created&&!g){if(m&&bt(v)&&bt(p)&&v[m]===p[m])return;r.setSelected()}}),s.watch(()=>n.disabled,()=>{e.groupDisabled=n.disabled},{immediate:!0}),{select:r,currentLabel:o,currentValue:l,itemSelected:a,isDisabled:c,hoverItem:f,updateOption:h}}const rL=s.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=Oe("select"),r=Zo(),n=s.computed(()=>[e.be("dropdown","item"),e.is("disabled",s.unref(l)),e.is("selected",s.unref(o)),e.is("hovering",s.unref(h))]),a=s.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:i,itemSelected:o,isDisabled:l,select:c,hoverItem:u,updateOption:d}=tL(t,a),{visible:f,hover:h}=s.toRefs(a),v=s.getCurrentInstance().proxy;c.onOptionCreate(v),s.onBeforeUnmount(()=>{const g=v.value,{selected:m}=c.states,b=(c.props.multiple?m:[m]).some(w=>w.value===v.value);s.nextTick(()=>{c.states.cachedOptions.get(g)===v&&!b&&c.states.cachedOptions.delete(g)}),c.onOptionDestroy(g,v)});function p(){l.value||c.handleOptionSelect(v)}return{ns:e,id:r,containerKls:n,currentLabel:i,itemSelected:o,isDisabled:l,select:c,hoverItem:u,updateOption:d,visible:f,hover:h,selectOptionClick:p,states:a}}});function nL(t,e,r,n,a,i){return s.withDirectives((s.openBlock(),s.createElementBlock("li",{id:t.id,class:s.normalizeClass(t.containerKls),role:"option","aria-disabled":t.isDisabled||void 0,"aria-selected":t.itemSelected,onMouseenter:t.hoverItem,onClick:s.withModifiers(t.selectOptionClick,["stop"])},[s.renderSlot(t.$slots,"default",{},()=>[s.createElementVNode("span",null,s.toDisplayString(t.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[s.vShow,t.visible]])}var _u=Be(rL,[["render",nL],["__file","option.vue"]]);const aL=s.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const t=s.inject($i),e=Oe("select"),r=s.computed(()=>t.props.popperClass),n=s.computed(()=>t.props.multiple),a=s.computed(()=>t.props.fitInputWidth),i=s.ref("");function o(){var l;i.value=`${(l=t.selectRef)==null?void 0:l.offsetWidth}px`}return s.onMounted(()=>{o(),Vr(t.selectRef,o)}),{ns:e,minWidth:i,popperClass:r,isMultiple:n,isFitInputWidth:a}}});function iL(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([t.ns.b("dropdown"),t.ns.is("multiple",t.isMultiple),t.popperClass]),style:s.normalizeStyle({[t.isFitInputWidth?"width":"minWidth"]:t.minWidth})},[t.$slots.header?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(t.ns.be("dropdown","header"))},[s.renderSlot(t.$slots,"header")],2)):s.createCommentVNode("v-if",!0),s.renderSlot(t.$slots,"default"),t.$slots.footer?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(t.ns.be("dropdown","footer"))},[s.renderSlot(t.$slots,"footer")],2)):s.createCommentVNode("v-if",!0)],6)}var oL=Be(aL,[["render",iL],["__file","select-dropdown.vue"]]);const sL=11,lL=(t,e)=>{const{t:r}=wi(),n=Zo(),a=Oe("select"),i=Oe("input"),o=s.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=s.ref(null),c=s.ref(null),u=s.ref(null),d=s.ref(null),f=s.ref(null),h=s.ref(null),v=s.ref(null),p=s.ref(null),g=s.ref(null),m=s.ref(null),y=s.ref(null),b=s.ref(null),{isComposing:w,handleCompositionStart:C,handleCompositionUpdate:x,handleCompositionEnd:k}=gy({afterComposition:J=>te(J)}),{wrapperRef:E,isFocused:_}=nu(f,{beforeFocus(){return P.value},afterFocus(){t.automaticDropdown&&!S.value&&(S.value=!0,o.menuVisibleOnFocus=!0)},beforeBlur(J){var he,Pe;return((he=u.value)==null?void 0:he.isFocusInsideContent(J))||((Pe=d.value)==null?void 0:Pe.isFocusInsideContent(J))},afterBlur(){S.value=!1,o.menuVisibleOnFocus=!1}}),S=s.ref(!1),T=s.ref(),{form:N,formItem:B}=Gn(),{inputId:O}=Bi(t,{formItemContext:B}),{valueOnClear:D,isEmptyValue:R}=BO(t),P=s.computed(()=>t.disabled||(N==null?void 0:N.disabled)),L=s.computed(()=>$t(t.modelValue)?t.modelValue.length>0:!R(t.modelValue)),A=s.computed(()=>t.clearable&&!P.value&&o.inputHovering&&L.value),q=s.computed(()=>t.remote&&t.filterable&&!t.remoteShowSuffix?"":t.suffixIcon),U=s.computed(()=>a.is("reverse",q.value&&S.value)),z=s.computed(()=>(B==null?void 0:B.validateState)||""),H=s.computed(()=>Om[z.value]),Q=s.computed(()=>t.remote?300:0),F=s.computed(()=>t.loading?t.loadingText||r("el.select.loading"):t.remote&&!o.inputValue&&o.options.size===0?!1:t.filterable&&o.inputValue&&o.options.size>0&&$.value===0?t.noMatchText||r("el.select.noMatch"):o.options.size===0?t.noDataText||r("el.select.noData"):null),$=s.computed(()=>V.value.filter(J=>J.visible).length),V=s.computed(()=>{const J=Array.from(o.options.values()),he=[];return o.optionValues.forEach(Pe=>{const He=J.findIndex(Mr=>Mr.value===Pe);He>-1&&he.push(J[He])}),he.length>=J.length?he:J}),G=s.computed(()=>Array.from(o.cachedOptions.values())),j=s.computed(()=>{const J=V.value.filter(he=>!he.created).some(he=>he.currentLabel===o.inputValue);return t.filterable&&t.allowCreate&&o.inputValue!==""&&!J}),M=()=>{t.filterable&&Mt(t.filterMethod)||t.filterable&&t.remote&&Mt(t.remoteMethod)||V.value.forEach(J=>{var he;(he=J.updateOption)==null||he.call(J,o.inputValue)})},W=Kn(),Y=s.computed(()=>["small"].includes(W.value)?"small":"default"),se=s.computed({get(){return S.value&&F.value!==!1},set(J){S.value=J}}),ce=s.computed(()=>{if(t.multiple&&!un(t.modelValue))return on(t.modelValue).length===0&&!o.inputValue;const J=$t(t.modelValue)?t.modelValue[0]:t.modelValue;return t.filterable||un(J)?!o.inputValue:!0}),ae=s.computed(()=>{var J;const he=(J=t.placeholder)!=null?J:r("el.select.placeholder");return t.multiple||!L.value?he:o.selectedLabel}),ne=s.computed(()=>Sl?null:"mouseenter");s.watch(()=>t.modelValue,(J,he)=>{t.multiple&&t.filterable&&!t.reserveKeyword&&(o.inputValue="",ue("")),fe(),!Vo(J,he)&&t.validateEvent&&(B==null||B.validate("change").catch(Pe=>nt(Pe)))},{flush:"post",deep:!0}),s.watch(()=>S.value,J=>{J?ue(o.inputValue):(o.inputValue="",o.previousQuery=null,o.isBeforeHide=!0),e("visible-change",J)}),s.watch(()=>o.options.entries(),()=>{var J;if(!rt)return;const he=((J=l.value)==null?void 0:J.querySelectorAll("input"))||[];(!t.filterable&&!t.defaultFirstOption&&!un(t.modelValue)||!Array.from(he).includes(document.activeElement))&&fe(),t.defaultFirstOption&&(t.filterable||t.remote)&&$.value&&ie()},{flush:"post"}),s.watch(()=>o.hoveringIndex,J=>{wt(J)&&J>-1?T.value=V.value[J]||{}:T.value={},V.value.forEach(he=>{he.hover=T.value===he})}),s.watchEffect(()=>{o.isBeforeHide||M()});const ue=J=>{o.previousQuery===J||w.value||(o.previousQuery=J,t.filterable&&Mt(t.filterMethod)?t.filterMethod(J):t.filterable&&t.remote&&Mt(t.remoteMethod)&&t.remoteMethod(J),t.defaultFirstOption&&(t.filterable||t.remote)&&$.value?s.nextTick(ie):s.nextTick(De))},ie=()=>{const J=V.value.filter(He=>He.visible&&!He.disabled&&!He.states.groupDisabled),he=J.find(He=>He.created),Pe=J[0];o.hoveringIndex=ye(V.value,he||Pe)},fe=()=>{if(t.multiple)o.selectedLabel="";else{const he=$t(t.modelValue)?t.modelValue[0]:t.modelValue,Pe=pe(he);o.selectedLabel=Pe.currentLabel,o.selected=[Pe];return}const J=[];un(t.modelValue)||on(t.modelValue).forEach(he=>{J.push(pe(he))}),o.selected=J},pe=J=>{let he;const Pe=Tl(J).toLowerCase()==="object",He=Tl(J).toLowerCase()==="null",Mr=Tl(J).toLowerCase()==="undefined";for(let nn=o.cachedOptions.size-1;nn>=0;nn--){const ur=G.value[nn];if(Pe?Hr(ur.value,t.valueKey)===Hr(J,t.valueKey):ur.value===J){he={value:J,currentLabel:ur.currentLabel,get isDisabled(){return ur.isDisabled}};break}}if(he)return he;const An=Pe?J.label:!He&&!Mr?J:"";return{value:J,currentLabel:An}},De=()=>{o.hoveringIndex=V.value.findIndex(J=>o.selected.some(he=>Rt(he)===Rt(J)))},Ie=()=>{o.selectionWidth=c.value.getBoundingClientRect().width},we=()=>{o.calculatorWidth=h.value.getBoundingClientRect().width},xe=()=>{o.collapseItemWidth=y.value.getBoundingClientRect().width},re=()=>{var J,he;(he=(J=u.value)==null?void 0:J.updatePopper)==null||he.call(J)},I=()=>{var J,he;(he=(J=d.value)==null?void 0:J.updatePopper)==null||he.call(J)},K=()=>{o.inputValue.length>0&&!S.value&&(S.value=!0),ue(o.inputValue)},te=J=>{if(o.inputValue=J.target.value,t.remote)Z();else return K()},Z=_m(()=>{K()},Q.value),X=J=>{Vo(t.modelValue,J)||e(Gl,J)},le=J=>zB(J,he=>!o.disabledOptions.has(he)),ee=J=>{if(t.multiple&&J.code!==lt.delete&&J.target.value.length<=0){const he=on(t.modelValue).slice(),Pe=le(he);if(Pe<0)return;const He=he[Pe];he.splice(Pe,1),e(Ct,he),X(he),e("remove-tag",He)}},oe=(J,he)=>{const Pe=o.selected.indexOf(he);if(Pe>-1&&!P.value){const He=on(t.modelValue).slice();He.splice(Pe,1),e(Ct,He),X(He),e("remove-tag",he.value)}J.stopPropagation(),it()},me=J=>{J.stopPropagation();const he=t.multiple?[]:D.value;if(t.multiple)for(const Pe of o.selected)Pe.isDisabled&&he.push(Pe.value);e(Ct,he),X(he),o.hoveringIndex=-1,S.value=!1,e("clear"),it()},be=J=>{var he;if(t.multiple){const Pe=on((he=t.modelValue)!=null?he:[]).slice(),He=ye(Pe,J.value);He>-1?Pe.splice(He,1):(t.multipleLimit<=0||Pe.length<t.multipleLimit)&&Pe.push(J.value),e(Ct,Pe),X(Pe),J.created&&ue(""),t.filterable&&!t.reserveKeyword&&(o.inputValue="")}else e(Ct,J.value),X(J.value),S.value=!1;it(),!S.value&&s.nextTick(()=>{_e(J)})},ye=(J=[],he)=>{if(!bt(he))return J.indexOf(he);const Pe=t.valueKey;let He=-1;return J.some((Mr,An)=>s.toRaw(Hr(Mr,Pe))===Hr(he,Pe)?(He=An,!0):!1),He},_e=J=>{var he,Pe,He,Mr,An;const fi=$t(J)?J[0]:J;let nn=null;if(fi!=null&&fi.value){const ur=V.value.filter(Rn=>Rn.value===fi.value);ur.length>0&&(nn=ur[0].$el)}if(u.value&&nn){const ur=(Mr=(He=(Pe=(he=u.value)==null?void 0:he.popperRef)==null?void 0:Pe.contentRef)==null?void 0:He.querySelector)==null?void 0:Mr.call(He,`.${a.be("dropdown","wrap")}`);ur&&XB(ur,nn)}(An=b.value)==null||An.handleScroll()},ge=J=>{o.options.set(J.value,J),o.cachedOptions.set(J.value,J),J.disabled&&o.disabledOptions.set(J.value,J)},Ce=(J,he)=>{o.options.get(J)===he&&o.options.delete(J)},je=s.computed(()=>{var J,he;return(he=(J=u.value)==null?void 0:J.popperRef)==null?void 0:he.contentRef}),qe=()=>{o.isBeforeHide=!1,s.nextTick(()=>_e(o.selected))},it=()=>{var J;(J=f.value)==null||J.focus()},ot=()=>{var J;(J=f.value)==null||J.blur()},et=J=>{me(J)},At=()=>{S.value=!1,_.value&&ot()},pt=()=>{o.inputValue.length>0?o.inputValue="":S.value=!1},mt=()=>{P.value||(Sl&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:S.value=!S.value)},Jt=()=>{S.value?V.value[o.hoveringIndex]&&be(V.value[o.hoveringIndex]):mt()},Rt=J=>bt(J.value)?Hr(J.value,t.valueKey):J.value,Lt=s.computed(()=>V.value.filter(J=>J.visible).every(J=>J.disabled)),lr=s.computed(()=>t.multiple?t.collapseTags?o.selected.slice(0,t.maxCollapseTags):o.selected:[]),Cr=s.computed(()=>t.multiple?t.collapseTags?o.selected.slice(t.maxCollapseTags):[]:[]),jt=J=>{if(!S.value){S.value=!0;return}if(!(o.options.size===0||o.filteredOptionsCount===0||w.value)&&!Lt.value){J==="next"?(o.hoveringIndex++,o.hoveringIndex===o.options.size&&(o.hoveringIndex=0)):J==="prev"&&(o.hoveringIndex--,o.hoveringIndex<0&&(o.hoveringIndex=o.options.size-1));const he=V.value[o.hoveringIndex];(he.disabled===!0||he.states.groupDisabled===!0||!he.visible)&&jt(J),s.nextTick(()=>_e(T.value))}},tt=()=>{if(!c.value)return 0;const J=window.getComputedStyle(c.value);return Number.parseFloat(J.gap||"6px")},st=s.computed(()=>{const J=tt();return{maxWidth:`${y.value&&t.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-J:o.selectionWidth}px`}}),yt=s.computed(()=>({maxWidth:`${o.selectionWidth}px`})),Pn=s.computed(()=>({width:`${Math.max(o.calculatorWidth,sL)}px`}));return Vr(c,Ie),Vr(h,we),Vr(g,re),Vr(E,re),Vr(m,I),Vr(y,xe),s.onMounted(()=>{fe()}),{inputId:O,contentId:n,nsSelect:a,nsInput:i,states:o,isFocused:_,expanded:S,optionsArray:V,hoverOption:T,selectSize:W,filteredOptionsCount:$,resetCalculatorWidth:we,updateTooltip:re,updateTagTooltip:I,debouncedOnInputChange:Z,onInput:te,deletePrevTag:ee,deleteTag:oe,deleteSelected:me,handleOptionSelect:be,scrollToOption:_e,hasModelValue:L,shouldShowPlaceholder:ce,currentPlaceholder:ae,mouseEnterEventName:ne,showClose:A,iconComponent:q,iconReverse:U,validateState:z,validateIcon:H,showNewOption:j,updateOptions:M,collapseTagSize:Y,setSelected:fe,selectDisabled:P,emptyText:F,handleCompositionStart:C,handleCompositionUpdate:x,handleCompositionEnd:k,onOptionCreate:ge,onOptionDestroy:Ce,handleMenuEnter:qe,focus:it,blur:ot,handleClearClick:et,handleClickOutside:At,handleEsc:pt,toggleMenu:mt,selectOption:Jt,getValueKey:Rt,navigateOptions:jt,dropdownMenuVisible:se,showTagList:lr,collapseTagList:Cr,tagStyle:st,collapseTagStyle:yt,inputStyle:Pn,popperRef:je,inputRef:f,tooltipRef:u,tagTooltipRef:d,calculatorRef:h,prefixRef:v,suffixRef:p,selectRef:l,wrapperRef:E,selectionRef:c,scrollbarRef:b,menuRef:g,tagMenuRef:m,collapseItemRef:y}};var uL=s.defineComponent({name:"ElOptions",setup(t,{slots:e}){const r=s.inject($i);let n=[];return()=>{var a,i;const o=(a=e.default)==null?void 0:a.call(e),l=[];function c(u){$t(u)&&u.forEach(d=>{var f,h,v,p;const g=(f=(d==null?void 0:d.type)||{})==null?void 0:f.name;g==="ElOptionGroup"?c(!Nt(d.children)&&!$t(d.children)&&Mt((h=d.children)==null?void 0:h.default)?(v=d.children)==null?void 0:v.default():d.children):g==="ElOption"?l.push((p=d.props)==null?void 0:p.value):$t(d.children)&&c(d.children)})}return o.length&&c((i=o[0])==null?void 0:i.children),Vo(l,n)||(n=l,r&&(r.states.optionValues=l)),o}}});const cL=Fe({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:Ta,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:zt.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:cn,default:Ne.CircleClose},fitInputWidth:Boolean,suffixIcon:{type:cn,default:Ne.ArrowDown},tagType:{...wu.type,default:"info"},tagEffect:{...wu.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:ke(String),values:Go,default:"bottom-start"},fallbackPlacements:{type:ke(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...IO,...fn(["ariaLabel"])}),l0="ElSelect",dL=s.defineComponent({name:l0,componentName:l0,components:{ElSelectMenu:oL,ElOption:_u,ElOptions:uL,ElTag:QA,ElScrollbar:aP,ElTooltip:Pi,ElIcon:ut},directives:{ClickOutside:Ky},props:cL,emits:[Ct,Gl,"remove-tag","clear","visible-change","focus","blur"],setup(t,{emit:e}){const r=s.computed(()=>{const{modelValue:i,multiple:o}=t,l=o?[]:void 0;return $t(i)?o?i:l:o?l:i}),n=s.reactive({...s.toRefs(t),modelValue:r}),a=lL(n,e);return s.provide($i,s.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 fL(t,e,r,n,a,i){const o=s.resolveComponent("el-tag"),l=s.resolveComponent("el-tooltip"),c=s.resolveComponent("el-icon"),u=s.resolveComponent("el-option"),d=s.resolveComponent("el-options"),f=s.resolveComponent("el-scrollbar"),h=s.resolveComponent("el-select-menu"),v=s.resolveDirective("click-outside");return s.withDirectives((s.openBlock(),s.createElementBlock("div",{ref:"selectRef",class:s.normalizeClass([t.nsSelect.b(),t.nsSelect.m(t.selectSize)]),[s.toHandlerKey(t.mouseEnterEventName)]:p=>t.states.inputHovering=!0,onMouseleave:p=>t.states.inputHovering=!1},[s.createVNode(l,{ref:"tooltipRef",visible:t.dropdownMenuVisible,placement:t.placement,teleported:t.teleported,"popper-class":[t.nsSelect.e("popper"),t.popperClass],"popper-options":t.popperOptions,"fallback-placements":t.fallbackPlacements,effect:t.effect,pure:"",trigger:"click",transition:`${t.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:t.persistent,"append-to":t.appendTo,onBeforeShow:t.handleMenuEnter,onHide:p=>t.states.isBeforeHide=!1},{default:s.withCtx(()=>{var p;return[s.createElementVNode("div",{ref:"wrapperRef",class:s.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:s.withModifiers(t.toggleMenu,["prevent"])},[t.$slots.prefix?(s.openBlock(),s.createElementBlock("div",{key:0,ref:"prefixRef",class:s.normalizeClass(t.nsSelect.e("prefix"))},[s.renderSlot(t.$slots,"prefix")],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{ref:"selectionRef",class:s.normalizeClass([t.nsSelect.e("selection"),t.nsSelect.is("near",t.multiple&&!t.$slots.prefix&&!!t.states.selected.length)])},[t.multiple?s.renderSlot(t.$slots,"tag",{key:0},()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.showTagList,g=>(s.openBlock(),s.createElementBlock("div",{key:t.getValueKey(g),class:s.normalizeClass(t.nsSelect.e("selected-item"))},[s.createVNode(o,{closable:!t.selectDisabled&&!g.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:s.normalizeStyle(t.tagStyle),onClose:m=>t.deleteTag(m,g)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(t.nsSelect.e("tags-text"))},[s.renderSlot(t.$slots,"label",{label:g.currentLabel,value:g.value},()=>[s.createTextVNode(s.toDisplayString(g.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),t.collapseTags&&t.states.selected.length>t.maxCollapseTags?(s.openBlock(),s.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:s.withCtx(()=>[s.createElementVNode("div",{ref:"collapseItemRef",class:s.normalizeClass(t.nsSelect.e("selected-item"))},[s.createVNode(o,{closable:!1,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:s.normalizeStyle(t.collapseTagStyle)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(t.nsSelect.e("tags-text"))}," + "+s.toDisplayString(t.states.selected.length-t.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:s.withCtx(()=>[s.createElementVNode("div",{ref:"tagMenuRef",class:s.normalizeClass(t.nsSelect.e("selection"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.collapseTagList,g=>(s.openBlock(),s.createElementBlock("div",{key:t.getValueKey(g),class:s.normalizeClass(t.nsSelect.e("selected-item"))},[s.createVNode(o,{class:"in-tooltip",closable:!t.selectDisabled&&!g.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",onClose:m=>t.deleteTag(m,g)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(t.nsSelect.e("tags-text"))},[s.renderSlot(t.$slots,"label",{label:g.currentLabel,value:g.value},()=>[s.createTextVNode(s.toDisplayString(g.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):s.createCommentVNode("v-if",!0)]):s.createCommentVNode("v-if",!0),t.selectDisabled?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass([t.nsSelect.e("selected-item"),t.nsSelect.e("input-wrapper"),t.nsSelect.is("hidden",!t.filterable)])},[s.withDirectives(s.createElementVNode("input",{id:t.inputId,ref:"inputRef","onUpdate:modelValue":g=>t.states.inputValue=g,type:"text",name:t.name,class:s.normalizeClass([t.nsSelect.e("input"),t.nsSelect.is(t.selectSize)]),disabled:t.selectDisabled,autocomplete:t.autocomplete,style:s.normalizeStyle(t.inputStyle),role:"combobox",readonly:!t.filterable,spellcheck:"false","aria-activedescendant":((p=t.hoverOption)==null?void 0:p.id)||"","aria-controls":t.contentId,"aria-expanded":t.dropdownMenuVisible,"aria-label":t.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[s.withKeys(s.withModifiers(g=>t.navigateOptions("next"),["stop","prevent"]),["down"]),s.withKeys(s.withModifiers(g=>t.navigateOptions("prev"),["stop","prevent"]),["up"]),s.withKeys(s.withModifiers(t.handleEsc,["stop","prevent"]),["esc"]),s.withKeys(s.withModifiers(t.selectOption,["stop","prevent"]),["enter"]),s.withKeys(s.withModifiers(t.deletePrevTag,["stop"]),["delete"])],onCompositionstart:t.handleCompositionStart,onCompositionupdate:t.handleCompositionUpdate,onCompositionend:t.handleCompositionEnd,onInput:t.onInput,onClick:s.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"]),[[s.vModelText,t.states.inputValue]]),t.filterable?(s.openBlock(),s.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:s.normalizeClass(t.nsSelect.e("input-calculator")),textContent:s.toDisplayString(t.states.inputValue)},null,10,["textContent"])):s.createCommentVNode("v-if",!0)],2)),t.shouldShowPlaceholder?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass([t.nsSelect.e("selected-item"),t.nsSelect.e("placeholder"),t.nsSelect.is("transparent",!t.hasModelValue||t.expanded&&!t.states.inputValue)])},[t.hasModelValue?s.renderSlot(t.$slots,"label",{key:0,label:t.currentPlaceholder,value:t.modelValue},()=>[s.createElementVNode("span",null,s.toDisplayString(t.currentPlaceholder),1)]):(s.openBlock(),s.createElementBlock("span",{key:1},s.toDisplayString(t.currentPlaceholder),1))],2)):s.createCommentVNode("v-if",!0)],2),s.createElementVNode("div",{ref:"suffixRef",class:s.normalizeClass(t.nsSelect.e("suffix"))},[t.iconComponent&&!t.showClose?(s.openBlock(),s.createBlock(c,{key:0,class:s.normalizeClass([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.iconReverse])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.iconComponent)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),t.showClose&&t.clearIcon?(s.openBlock(),s.createBlock(c,{key:1,class:s.normalizeClass([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.nsSelect.e("clear")]),onClick:t.handleClearClick},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.clearIcon)))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0),t.validateState&&t.validateIcon?(s.openBlock(),s.createBlock(c,{key:2,class:s.normalizeClass([t.nsInput.e("icon"),t.nsInput.e("validateIcon")])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.validateIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:s.withCtx(()=>[s.createVNode(h,{ref:"menuRef"},{default:s.withCtx(()=>[t.$slots.header?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(t.nsSelect.be("dropdown","header")),onClick:s.withModifiers(()=>{},["stop"])},[s.renderSlot(t.$slots,"header")],10,["onClick"])):s.createCommentVNode("v-if",!0),s.withDirectives(s.createVNode(f,{id:t.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":t.nsSelect.be("dropdown","wrap"),"view-class":t.nsSelect.be("dropdown","list"),class:s.normalizeClass([t.nsSelect.is("empty",t.filteredOptionsCount===0)]),role:"listbox","aria-label":t.ariaLabel,"aria-orientation":"vertical"},{default:s.withCtx(()=>[t.showNewOption?(s.openBlock(),s.createBlock(u,{key:0,value:t.states.inputValue,created:!0},null,8,["value"])):s.createCommentVNode("v-if",!0),s.createVNode(d,null,{default:s.withCtx(()=>[s.renderSlot(t.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[s.vShow,t.states.options.size>0&&!t.loading]]),t.$slots.loading&&t.loading?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(t.nsSelect.be("dropdown","loading"))},[s.renderSlot(t.$slots,"loading")],2)):t.loading||t.filteredOptionsCount===0?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(t.nsSelect.be("dropdown","empty"))},[s.renderSlot(t.$slots,"empty",{},()=>[s.createElementVNode("span",null,s.toDisplayString(t.emptyText),1)])],2)):s.createCommentVNode("v-if",!0),t.$slots.footer?(s.openBlock(),s.createElementBlock("div",{key:3,class:s.normalizeClass(t.nsSelect.be("dropdown","footer")),onClick:s.withModifiers(()=>{},["stop"])},[s.renderSlot(t.$slots,"footer")],10,["onClick"])):s.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 hL=Be(dL,[["render",fL],["__file","select.vue"]]);const pL=s.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(t){const e=Oe("select"),r=s.ref(null),n=s.getCurrentInstance(),a=s.ref([]);s.provide(s0,s.reactive({...s.toRefs(t)}));const i=s.computed(()=>a.value.some(u=>u.visible===!0)),o=u=>{var d,f;return((d=u.type)==null?void 0:d.name)==="ElOption"&&!!((f=u.component)!=null&&f.proxy)},l=u=>{const d=on(u),f=[];return d.forEach(h=>{var v,p;o(h)?f.push(h.component.proxy):(v=h.children)!=null&&v.length?f.push(...l(h.children)):(p=h.component)!=null&&p.subTree&&f.push(...l(h.component.subTree))}),f},c=()=>{a.value=l(n.subTree)};return s.onMounted(()=>{c()}),K_(r,c,{attributes:!0,subtree:!0,childList:!0}),{groupRef:r,visible:i,ns:e}}});function vL(t,e,r,n,a,i){return s.withDirectives((s.openBlock(),s.createElementBlock("ul",{ref:"groupRef",class:s.normalizeClass(t.ns.be("group","wrap"))},[s.createElementVNode("li",{class:s.normalizeClass(t.ns.be("group","title"))},s.toDisplayString(t.label),3),s.createElementVNode("li",null,[s.createElementVNode("ul",{class:s.normalizeClass(t.ns.b("group"))},[s.renderSlot(t.$slots,"default")],2)])],2)),[[s.vShow,t.visible]])}var u0=Be(pL,[["render",vL],["__file","option-group.vue"]]);const gL=vt(hL,{Option:_u,OptionGroup:u0}),mL=Gr(_u);Gr(u0);const yL=Fe({trigger:Oi.trigger,placement:Su.placement,disabled:Oi.disabled,visible:zt.visible,transition:zt.transition,popperOptions:Su.popperOptions,tabindex:Su.tabindex,content:zt.content,popperStyle:zt.popperStyle,popperClass:zt.popperClass,enterable:{...zt.enterable,default:!0},effect:{...zt.effect,default:"light"},teleported:zt.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}}),bL={"update:visible":t=>ya(t),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},wL="onUpdate:visible",CL=s.defineComponent({name:"ElPopover"}),EL=s.defineComponent({...CL,props:yL,emits:bL,setup(t,{expose:e,emit:r}){const n=t,a=s.computed(()=>n[wL]),i=Oe("popover"),o=s.ref(),l=s.computed(()=>{var m;return(m=s.unref(o))==null?void 0:m.popperRef}),c=s.computed(()=>[{width:ba(n.width)},n.popperStyle]),u=s.computed(()=>[i.b(),n.popperClass,{[i.m("plain")]:!!n.content}]),d=s.computed(()=>n.transition===`${i.namespace.value}-fade-in-linear`),f=()=>{var m;(m=o.value)==null||m.hide()},h=()=>{r("before-enter")},v=()=>{r("before-leave")},p=()=>{r("after-enter")},g=()=>{r("update:visible",!1),r("after-leave")};return e({popperRef:l,hide:f}),(m,y)=>(s.openBlock(),s.createBlock(s.unref(Pi),s.mergeProps({ref_key:"tooltipRef",ref:o},m.$attrs,{trigger:m.trigger,placement:m.placement,disabled:m.disabled,visible:m.visible,transition:m.transition,"popper-options":m.popperOptions,tabindex:m.tabindex,content:m.content,offset:m.offset,"show-after":m.showAfter,"hide-after":m.hideAfter,"auto-close":m.autoClose,"show-arrow":m.showArrow,"aria-label":m.title,effect:m.effect,enterable:m.enterable,"popper-class":s.unref(u),"popper-style":s.unref(c),teleported:m.teleported,persistent:m.persistent,"gpu-acceleration":s.unref(d),"onUpdate:visible":s.unref(a),onBeforeShow:h,onBeforeHide:v,onShow:p,onHide:g}),{content:s.withCtx(()=>[m.title?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(i).e("title")),role:"title"},s.toDisplayString(m.title),3)):s.createCommentVNode("v-if",!0),s.renderSlot(m.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(m.content),1)])]),default:s.withCtx(()=>[m.$slots.reference?s.renderSlot(m.$slots,"reference",{key:0}):s.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 xL=Be(EL,[["__file","popover.vue"]]);const c0=(t,e)=>{const r=e.arg||e.value,n=r==null?void 0:r.popperRef;n&&(n.triggerRef=t)};var kL={mounted(t,e){c0(t,e)},updated(t,e){c0(t,e)}};const SL=QB(kL,"popover"),Oa=vt(xL,{directive:SL}),Pa="$treeNodeId",d0=function(t,e){!e||e[Pa]||Object.defineProperty(e,Pa,{value:t.id,enumerable:!1,configurable:!1,writable:!1})},Tu=function(t,e){return t?e[t]:e[Pa]},Nu=(t,e,r)=>{const n=t.value.currentNode;r();const a=t.value.currentNode;n!==a&&e("current-change",a?a.data:null,a)},Iu=t=>{let e=!0,r=!0,n=!0;for(let a=0,i=t.length;a<i;a++){const o=t[a];(o.checked!==!0||o.indeterminate)&&(e=!1,o.disabled||(n=!1)),(o.checked!==!1||o.indeterminate)&&(r=!1)}return{all:e,none:r,allWithoutDisable:n,half:!e&&!r}},Vi=function(t){if(t.childNodes.length===0||t.loading)return;const{all:e,none:r,half:n}=Iu(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||Vi(a)},os=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 _L=0;class Wn{constructor(e){this.id=_L++,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)Ln(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=os(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)||d0(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)||d0(this,e),this.data=e,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=os(this,"children")||[];for(let n=0,a=r.length;n<a;n++)this.insertChild({data:r[n]})}get label(){return os(this,"label")}get key(){const e=this.store.key;return this.data?this.data[e]:null}get disabled(){return os(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 Wn)){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=s.reactive(new Wn(e)),e instanceof Wn&&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||Vi(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:o,allWithoutDisable:l}=Iu(this.childNodes);!this.isLeaf&&!o&&l&&(this.checked=!1,e=!1);const c=()=>{if(r){const u=this.childNodes;for(let h=0,v=u.length;h<v;h++){const p=u[h];a=a||e!==!1;const g=p.disabled?p.checked:a;p.setChecked(g,r,!0,a)}const{half:d,all:f}=Iu(u);f||(this.checked=f,this.indeterminate=d)}};if(this.shouldLoadData()){this.loadData(()=>{c(),Vi(this)},{checked:e!==!1});return}else c()}const i=this.parent;!i||i.level===0||n||Vi(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,o)=>{const l=i[Pa];!!l&&r.findIndex(u=>u[Pa]===l)>=0?n[l]={index:o,data:i}:a.push({index:o,data:i})}),this.store.lazy||r.forEach(i=>{n[i[Pa]]||this.removeChildByData(i)}),a.forEach(({index:i,data:o})=>{this.insertChild({data:o},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||Vi(this)}}class TL{constructor(e){this.currentNode=null,this.currentNodeKey=null;for(const r in e)Ln(e,r)&&(this[r]=e[r]);this.nodesMap={}}initialize(){if(this.root=new Wn({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 o=i.root?i.root.childNodes:i.childNodes;if(o.forEach(l=>{l.visible=r.call(l,e,l.data,l),a(l)}),!i.visible&&o.length){let l=!0;l=!o.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 Wn)return e;const r=bt(e)?Tu(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=qo(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)Ln(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 o=a[i];this.remove(o.data)}for(let i=0,o=r.length;i<o;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),o=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(!o.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(p){p.childNodes.forEach(m=>{m.isLeaf||m.setChecked(!1,!1),v(m)})};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 NL=s.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(t){const e=Oe("tree"),r=s.inject("NodeInstance"),n=s.inject("RootTree");return()=>{const a=t.node,{data:i,store:o}=a;return t.renderContent?t.renderContent(s.h,{_self:r,node:a,data:i,store:o}):s.renderSlot(n.ctx.slots,"default",{node:a,data:i},()=>[s.h("span",{class:e.be("node","label")},[a.label])])}}});var IL=Be(NL,[["__file","tree-node-content.vue"]]);function f0(t){const e=s.inject("TreeNodeMap",null),r={treeNodeExpand:n=>{t.node!==n&&t.node.collapse()},children:[]};return e&&e.children.push(r),s.provide("TreeNodeMap",r),{broadcastExpanded:n=>{if(t.accordion)for(const a of r.children)a.treeNodeExpand(n)}}}const h0=Symbol("dragEvents");function BL({props:t,ctx:e,el$:r,dropIndicator$:n,store:a}){const i=Oe("tree"),o=s.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{}o.value.draggingNode=f,e.emit("node-drag-start",f.node,d)},c=({event:d,treeNode:f})=>{const h=f,v=o.value.dropNode;v&&v.node.id!==h.node.id&&qn(v.$el,i.is("drop-inner"));const p=o.value.draggingNode;if(!p||!h)return;let g=!0,m=!0,y=!0,b=!0;typeof t.allowDrop=="function"&&(g=t.allowDrop(p.node,h.node,"prev"),b=m=t.allowDrop(p.node,h.node,"inner"),y=t.allowDrop(p.node,h.node,"next")),d.dataTransfer.dropEffect=m||g||y?"move":"none",(g||m||y)&&(v==null?void 0:v.node.id)!==h.node.id&&(v&&e.emit("node-drag-leave",p.node,v.node,d),e.emit("node-drag-enter",p.node,h.node,d)),g||m||y?o.value.dropNode=h:o.value.dropNode=null,h.node.nextSibling===p.node&&(y=!1),h.node.previousSibling===p.node&&(g=!1),h.node.contains(p.node,!1)&&(m=!1),(p.node===h.node||p.node.contains(h.node))&&(g=!1,m=!1,y=!1);const w=h.$el.querySelector(`.${i.be("node","content")}`).getBoundingClientRect(),C=r.value.getBoundingClientRect();let x;const k=g?m?.25:y?.45:1:-1,E=y?m?.75:g?.55:0:1;let _=-9999;const S=d.clientY-w.top;S<w.height*k?x="before":S>w.height*E?x="after":m?x="inner":x="none";const T=h.$el.querySelector(`.${i.be("node","expand-icon")}`).getBoundingClientRect(),N=n.value;x==="before"?_=T.top-C.top:x==="after"&&(_=T.bottom-C.top),N.style.top=`${_}px`,N.style.left=`${T.right-C.left}px`,x==="inner"?Kl(h.$el,i.is("drop-inner")):qn(h.$el,i.is("drop-inner")),o.value.showDropIndicator=x==="before"||x==="after",o.value.allowDrop=o.value.showDropIndicator||b,o.value.dropType=x,e.emit("node-drag-over",p.node,h.node,d)},u=d=>{const{draggingNode:f,dropType:h,dropNode:v}=o.value;if(d.preventDefault(),d.dataTransfer&&(d.dataTransfer.dropEffect="move"),f&&v){const p={data:f.node.data};h!=="none"&&f.node.remove(),h==="before"?v.node.parent.insertBefore(p,v.node):h==="after"?v.node.parent.insertAfter(p,v.node):h==="inner"&&v.node.insertChild(p),h!=="none"&&(a.value.registerNode(p),a.value.key&&f.node.eachNode(g=>{var m;(m=a.value.nodesMap[g.data[a.value.key]])==null||m.setChecked(g.checked,!a.value.checkStrictly)})),qn(v.$el,i.is("drop-inner")),e.emit("node-drag-end",f.node,v.node,h,d),h!=="none"&&e.emit("node-drop",f.node,v.node,h,d)}f&&!v&&e.emit("node-drag-end",f.node,null,h,d),o.value.showDropIndicator=!1,o.value.draggingNode=null,o.value.dropNode=null,o.value.allowDrop=!0};return s.provide(h0,{treeNodeDragStart:l,treeNodeDragOver:c,treeNodeDragEnd:u}),{dragState:o}}const DL=s.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:dR,ElCheckbox:WA,NodeContent:IL,ElIcon:ut,Loading:Ne.Loading},props:{node:{type:Wn,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(t,e){const r=Oe("tree"),{broadcastExpanded:n}=f0(t),a=s.inject("RootTree"),i=s.ref(!1),o=s.ref(!1),l=s.ref(null),c=s.ref(null),u=s.ref(null),d=s.inject(h0),f=s.getCurrentInstance();s.provide("NodeInstance",f),a||nt("Tree","Can not find node's tree."),t.node.expanded&&(i.value=!0,o.value=!0);const h=a.props.props.children||"children";s.watch(()=>{const S=t.node.data[h];return S&&[...S]},()=>{t.node.updateChildren()}),s.watch(()=>t.node.indeterminate,S=>{g(t.node.checked,S)}),s.watch(()=>t.node.checked,S=>{g(S,t.node.indeterminate)}),s.watch(()=>t.node.childNodes.length,()=>t.node.reInitChecked()),s.watch(()=>t.node.expanded,S=>{s.nextTick(()=>i.value=S),S&&(o.value=!0)});const v=S=>Tu(a.props.nodeKey,S.data),p=S=>{const T=t.props.class;if(!T)return{};let N;if(Mt(T)){const{data:B}=S;N=T(B,S)}else N=T;return Nt(N)?{[N]:!0}:N},g=(S,T)=>{(l.value!==S||c.value!==T)&&a.ctx.emit("check-change",t.node.data,S,T),l.value=S,c.value=T},m=S=>{Nu(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)},y=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,T)=>{t.node.setChecked(T.target.checked,!a.props.checkStrictly),s.nextTick(()=>{const N=a.store.value;a.ctx.emit("check",t.node.data,{checkedNodes:N.getCheckedNodes(),checkedKeys:N.getCheckedKeys(),halfCheckedNodes:N.getHalfCheckedNodes(),halfCheckedKeys:N.getHalfCheckedKeys()})})};return{ns:r,node$:u,tree:a,expanded:i,childNodeRendered:o,oldChecked:l,oldIndeterminate:c,getNodeKey:v,getNodeClass:p,handleSelectChange:g,handleClick:m,handleContextMenu:y,handleExpandIconClick:b,handleCheckChange:w,handleChildNodeExpand:(S,T,N)=>{n(T),a.ctx.emit("node-expand",S,T,N)},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:Ne.CaretRight}}});function OL(t,e,r,n,a,i){const o=s.resolveComponent("el-icon"),l=s.resolveComponent("el-checkbox"),c=s.resolveComponent("loading"),u=s.resolveComponent("node-content"),d=s.resolveComponent("el-tree-node"),f=s.resolveComponent("el-collapse-transition");return s.withDirectives((s.openBlock(),s.createElementBlock("div",{ref:"node$",class:s.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:s.withModifiers(t.handleClick,["stop"]),onContextmenu:t.handleContextMenu,onDragstart:s.withModifiers(t.handleDragStart,["stop"]),onDragover:s.withModifiers(t.handleDragOver,["stop"]),onDragend:s.withModifiers(t.handleDragEnd,["stop"]),onDrop:s.withModifiers(t.handleDrop,["stop"])},[s.createElementVNode("div",{class:s.normalizeClass(t.ns.be("node","content")),style:s.normalizeStyle({paddingLeft:(t.node.level-1)*t.tree.props.indent+"px"})},[t.tree.props.icon||t.CaretRight?(s.openBlock(),s.createBlock(o,{key:0,class:s.normalizeClass([t.ns.be("node","expand-icon"),t.ns.is("leaf",t.node.isLeaf),{expanded:!t.node.isLeaf&&t.expanded}]),onClick:s.withModifiers(t.handleExpandIconClick,["stop"])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.tree.props.icon||t.CaretRight)))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0),t.showCheckbox?(s.openBlock(),s.createBlock(l,{key:1,"model-value":t.node.checked,indeterminate:t.node.indeterminate,disabled:!!t.node.disabled,onClick:s.withModifiers(()=>{},["stop"]),onChange:t.handleCheckChange},null,8,["model-value","indeterminate","disabled","onClick","onChange"])):s.createCommentVNode("v-if",!0),t.node.loading?(s.openBlock(),s.createBlock(o,{key:2,class:s.normalizeClass([t.ns.be("node","loading-icon"),t.ns.is("loading")])},{default:s.withCtx(()=>[s.createVNode(c)]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),s.createVNode(u,{node:t.node,"render-content":t.renderContent},null,8,["node","render-content"])],6),s.createVNode(f,null,{default:s.withCtx(()=>[!t.renderAfterExpand||t.childNodeRendered?s.withDirectives((s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(t.ns.be("node","children")),role:"group","aria-expanded":t.expanded},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.node.childNodes,h=>(s.openBlock(),s.createBlock(d,{key:t.getNodeKey(h),"render-content":t.renderContent,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,node:h,accordion:t.accordion,props:t.props,onNodeExpand:t.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,["aria-expanded"])),[[s.vShow,t.expanded]]):s.createCommentVNode("v-if",!0)]),_:1})],42,["aria-expanded","aria-disabled","aria-checked","draggable","data-key","onClick","onContextmenu","onDragstart","onDragover","onDragend","onDrop"])),[[s.vShow,t.node.visible]])}var PL=Be(DL,[["render",OL],["__file","tree-node.vue"]]);function AL({el$:t},e){const r=Oe("tree"),n=s.shallowRef([]),a=s.shallowRef([]);s.onMounted(()=>{o()}),s.onUpdated(()=>{n.value=Array.from(t.value.querySelectorAll("[role=treeitem]")),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"))}),s.watch(a,l=>{l.forEach(c=>{c.setAttribute("tabindex","-1")})}),Qt(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([lt.up,lt.down].includes(u)){if(l.preventDefault(),u===lt.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()}[lt.left,lt.right].includes(u)&&(l.preventDefault(),c.click());const h=c.querySelector('[type="checkbox"]');[lt.enter,lt.space].includes(u)&&h&&(l.preventDefault(),h.click())});const o=()=>{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 RL=s.defineComponent({name:"ElTree",components:{ElTreeNode:PL},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:cn}},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}=wi(),n=Oe("tree"),a=s.inject($i,null),i=s.ref(new TL({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 o=s.ref(i.value.root),l=s.ref(null),c=s.ref(null),u=s.ref(null),{broadcastExpanded:d}=f0(t),{dragState:f}=BL({props:t,ctx:e,el$:c,dropIndicator$:u,store:i});AL({el$:c},i);const h=s.computed(()=>{const{childNodes:A}=o.value,q=a?a.hasFilteredOptions!==0:!1;return(!A||A.length===0||A.every(({visible:U})=>!U))&&!q});s.watch(()=>t.currentNodeKey,A=>{i.value.setCurrentNodeKey(A)}),s.watch(()=>t.defaultCheckedKeys,A=>{i.value.setDefaultCheckedKey(A)}),s.watch(()=>t.defaultExpandedKeys,A=>{i.value.setDefaultExpandedKeys(A)}),s.watch(()=>t.data,A=>{i.value.setData(A)},{deep:!0}),s.watch(()=>t.checkStrictly,A=>{i.value.checkStrictly=A});const v=A=>{if(!t.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");i.value.filter(A)},p=A=>Tu(t.nodeKey,A.data),g=A=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const q=i.value.getNode(A);if(!q)return[];const U=[q.data];let z=q.parent;for(;z&&z!==o.value;)U.push(z.data),z=z.parent;return U.reverse()},m=(A,q)=>i.value.getCheckedNodes(A,q),y=A=>i.value.getCheckedKeys(A),b=()=>{const A=i.value.getCurrentNode();return A?A.data:null},w=()=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const A=b();return A?A[t.nodeKey]:null},C=(A,q)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");i.value.setCheckedNodes(A,q)},x=(A,q)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");i.value.setCheckedKeys(A,q)},k=(A,q,U)=>{i.value.setChecked(A,q,U)},E=()=>i.value.getHalfCheckedNodes(),_=()=>i.value.getHalfCheckedKeys(),S=(A,q=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");Nu(i,e.emit,()=>{d(A),i.value.setUserCurrentNode(A,q)})},T=(A,q=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");Nu(i,e.emit,()=>{d(),i.value.setCurrentNodeKey(A,q)})},N=A=>i.value.getNode(A),B=A=>{i.value.remove(A)},O=(A,q)=>{i.value.append(A,q)},D=(A,q)=>{i.value.insertBefore(A,q)},R=(A,q)=>{i.value.insertAfter(A,q)},P=(A,q,U)=>{d(q),e.emit("node-expand",A,q,U)},L=(A,q)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");i.value.updateChildren(A,q)};return s.provide("RootTree",{ctx:e,props:t,store:i,root:o,currentNode:l,instance:s.getCurrentInstance()}),s.provide(Ni,void 0),{ns:n,store:i,root:o,currentNode:l,dragState:f,el$:c,dropIndicator$:u,isEmpty:h,filter:v,getNodeKey:p,getNodePath:g,getCheckedNodes:m,getCheckedKeys:y,getCurrentNode:b,getCurrentKey:w,setCheckedNodes:C,setCheckedKeys:x,setChecked:k,getHalfCheckedNodes:E,getHalfCheckedKeys:_,setCurrentNode:S,setCurrentKey:T,t:r,getNode:N,remove:B,append:O,insertBefore:D,insertAfter:R,handleNodeExpand:P,updateKeyChildren:L}}});function LL(t,e,r,n,a,i){const o=s.resolveComponent("el-tree-node");return s.openBlock(),s.createElementBlock("div",{ref:"el$",class:s.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"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.root.childNodes,l=>(s.openBlock(),s.createBlock(o,{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?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(t.ns.e("empty-block"))},[s.renderSlot(t.$slots,"empty",{},()=>{var l;return[s.createElementVNode("span",{class:s.normalizeClass(t.ns.e("empty-text"))},s.toDisplayString((l=t.emptyText)!=null?l:t.t("el.tree.emptyText")),3)]})],2)):s.createCommentVNode("v-if",!0),s.withDirectives(s.createElementVNode("div",{ref:"dropIndicator$",class:s.normalizeClass(t.ns.e("drop-indicator"))},null,2),[[s.vShow,t.dragState.showDropIndicator]])],2)}var ML=Be(RL,[["render",LL],["__file","tree.vue"]]);const FL=vt(ML);function $L(t){let e;const r=s.ref(!1),n=s.reactive({...t,originalPosition:"",originalOverflow:"",visible:!1});function a(h){n.text=h}function i(){const h=n.parent,v=f.ns;if(!h.vLoadingAddClassList){let p=h.getAttribute("loading-number");p=Number.parseInt(p)-1,p?h.setAttribute("loading-number",p.toString()):(qn(h,v.bm("parent","relative")),h.removeAttribute("loading-number")),qn(h,v.bm("parent","hidden"))}o(),d.unmount()}function o(){var h,v;(v=(h=f.$el)==null?void 0:h.parentNode)==null||v.removeChild(f.$el)}function l(){var h;t.beforeClose&&!t.beforeClose()||(r.value=!0,clearTimeout(e),e=setTimeout(c,400),n.visible=!1,(h=t.closed)==null||h.call(t))}function c(){if(!r.value)return;const h=n.parent;r.value=!1,h.vLoadingAddClassList=void 0,i()}const u=s.defineComponent({name:"ElLoading",setup(h,{expose:v}){const{ns:p,zIndex:g}=OO("loading");return v({ns:p,zIndex:g}),()=>{const m=n.spinner||n.svg,y=s.h("svg",{class:"circular",viewBox:n.svgViewBox?n.svgViewBox:"0 0 50 50",...m?{innerHTML:m}:{}},[s.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),b=n.text?s.h("p",{class:p.b("text")},[n.text]):void 0;return s.h(s.Transition,{name:p.b("fade"),onAfterLeave:c},{default:s.withCtx(()=>[s.withDirectives(s.createVNode("div",{style:{backgroundColor:n.background||""},class:[p.b("mask"),n.customClass,n.fullscreen?"is-fullscreen":""]},[s.h("div",{class:p.b("spinner")},[y,b])]),[[s.vShow,n.visible]])])})}}}),d=s.createApp(u),f=d.mount(document.createElement("div"));return{...s.toRefs(n),setText:a,removeElLoadingChild:o,close:l,handleAfterLeave:c,vm:f,get $el(){return f.$el}}}let ss;const VL=function(t={}){if(!rt)return;const e=qL(t);if(e.fullscreen&&ss)return ss;const r=$L({...e,closed:()=>{var a;(a=e.closed)==null||a.call(e),e.fullscreen&&(ss=void 0)}});zL(e,e.parent,r),p0(e,e.parent,r),e.parent.vLoadingAddClassList=()=>p0(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),s.nextTick(()=>r.visible.value=e.visible),e.fullscreen&&(ss=r),r},qL=t=>{var e,r,n,a;let i;return Nt(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}},zL=async(t,e,r)=>{const{nextZIndex:n}=r.vm.zIndex||r.vm._.exposed.zIndex,a={};if(t.fullscreen)r.originalPosition.value=bi(document.body,"position"),r.originalOverflow.value=bi(document.body,"overflow"),a.zIndex=n();else if(t.parent===document.body){r.originalPosition.value=bi(document.body,"position"),await s.nextTick();for(const i of["top","left"]){const o=i==="top"?"scrollTop":"scrollLeft";a[i]=`${t.target.getBoundingClientRect()[i]+document.body[o]+document.documentElement[o]-Number.parseInt(bi(document.body,`margin-${i}`),10)}px`}for(const i of["height","width"])a[i]=`${t.target.getBoundingClientRect()[i]}px`}else r.originalPosition.value=bi(e,"position");for(const[i,o]of Object.entries(a))r.$el.style[i]=o},p0=(t,e,r)=>{const n=r.vm.ns||r.vm._.exposed.ns;["absolute","fixed","sticky"].includes(r.originalPosition.value)?qn(e,n.bm("parent","relative")):Kl(e,n.bm("parent","relative")),t.fullscreen&&t.lock?Kl(e,n.bm("parent","hidden")):qn(e,n.bm("parent","hidden"))},ls=Symbol("ElLoading"),v0=(t,e)=>{var r,n,a,i;const o=e.instance,l=h=>bt(e.value)?e.value[h]:void 0,c=h=>{const v=Nt(h)&&(o==null?void 0:o[h])||h;return v&&s.ref(v)},u=h=>c(l(h)||t.getAttribute(`element-loading-${rT(h)}`)),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[ls]={options:f,instance:VL(f)}},HL=(t,e)=>{for(const r of Object.keys(e))s.isRef(e[r])&&(e[r].value=t[r])},Bu={mounted(t,e){e.value&&v0(t,e)},updated(t,e){const r=t[ls];e.oldValue!==e.value&&(e.value&&!e.oldValue?v0(t,e):e.value&&e.oldValue?bt(e.value)&&HL(e.value,r.options):r==null||r.instance.close())},unmounted(t){var e;(e=t[ls])==null||e.instance.close(),t[ls]=null}},Yt=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},KL="Copy to clipboard",GL="Copied!",UL={name:"CopyToClipboard",props:{content:{type:String,default:""},label:{type:String,default:KL},theme:{type:String,default:""}},data:function(){return{textLabel:this.label,autoHideTimeout:0,tooltipContainer:null}},mounted(){const t=document.querySelector(".mapcontent");t?this.tooltipContainer=t:this.tooltipContainer=document.body},methods:{copyToClipboard:async function(){let t=!0;this.autoHideTimeout=600;try{const e=this.content.replaceAll(`
21
- `,""),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"}),o=new ClipboardItem({"text/html":a,"text/plain":i});await navigator.clipboard.write([o])}catch(e){console.error("Error when trying to use navigator.clipboard.write()",e),t=!1}t?(this.textLabel=GL,this.$emit("copied",{status:"success"})):(this.textLabel="Error trying to copy to clipboard!",this.$emit("copied",{status:"error"}))},resetSettings:function(){this.autoHideTimeout=0,this.textLabel=this.label}}},jL={class:"visually-hidden"};function WL(t,e,r,n,a,i){const o=Ne.CopyDocument,l=ut,c=Ht,u=Pi;return s.openBlock(),s.createBlock(u,{content:t.textLabel,placement:"bottom","hide-after":t.autoHideTimeout,effect:"clipboard-tooltip",onHide:i.resetSettings,teleported:!0,"append-to":t.tooltipContainer},{default:s.withCtx(()=>[s.createVNode(c,{class:s.normalizeClass(["copy-clipboard-button",r.theme]),size:"small",onClick:i.copyToClipboard,disabled:!r.content},{default:s.withCtx(()=>[s.createVNode(l,{color:r.content?"#8300bf":"#dab3ec"},{default:s.withCtx(()=>[s.createVNode(o)]),_:1},8,["color"]),s.createElementVNode("span",jL,s.toDisplayString(t.textLabel),1)]),_:1},8,["class","onClick","disabled"])]),_:1},8,["content","hide-after","onHide","append-to"])}const us=Yt(UL,[["render",WL],["__scopeId","data-v-c791b9aa"]]),YL={name:"AnnotationPopup",props:{annotationEntry:{type:Array}},inject:["$annotator","userApiKey"],data:function(){return{displayPair:{"Feature ID":"featureId",Label:"label",Ontology:"models",Name:"name",Resource:"resourceId"},editing:!1,evidencePrefixes:[{value:"DOI:",label:"DOI:"},{value:"PMID:",label:"PMID:"},{value:"",label:"Other:"}],evidencePrefix:"DOI:",evidence:[],authenticated:!1,newEvidence:"",comment:"",prevSubs:[],showSubmissions:!0,errorMessage:"",creator:void 0,copyContent:"",entryIndex:0}},computed:{entry:function(){return this.annotationEntry[this.entryIndex]},previousLabel:function(){var t;return this.entryIndex===0?"This is the first item. Click 'Next' to see more information.":(t=this.annotationEntry[this.entryIndex-1])==null?void 0:t.label},nextLabel:function(){var t;return this.entryIndex===this.annotationEntry.length-1?"This is the last item. Click 'Previous' to see more information.":(t=this.annotationEntry[this.entryIndex+1])==null?void 0:t.label},isEditable:function(){return this.entry.resourceId&&this.entry.featureId},isPositionUpdated:function(){return this.entry.resourceId&&this.entry.type==="updated"&&this.entry.positionUpdated},isDeleted:function(){return this.entry.resourceId&&this.entry.type==="deleted"},ontologyLink:function(){const t=this.entry.models;if(t&&t.startsWith("UBERON"))return`http://purl.obolibrary.org/obo/${this.entry.models.replace(":","_")}`},updatedCopyContent:function(){return this.getUpdateCopyContent()},offlineAnnotationEnabled:function(){return this.entry?this.entry.offline:!1}},methods:{previous:function(){if(this.entryIndex!==0){this.entryIndex=this.entryIndex-1,this.emitActiveItemChange();const t=this.annotationEntry[this.entryIndex],e={event_name:"portal_maps_annotation_previous",category:String((t==null?void 0:t.featureId)||"")};this.trackEvent(e)}},next:function(){if(this.entryIndex!==this.annotationEntry.length-1){this.entryIndex=this.entryIndex+1,this.emitActiveItemChange();const t=this.annotationEntry[this.entryIndex],e={event_name:"portal_maps_annotation_next",category:String((t==null?void 0:t.featureId)||"")};this.trackEvent(e)}},emitActiveItemChange:function(){const t={tabType:"annotation"},e=this.annotationEntry[this.entryIndex],r={...t,...e};this.$emit("hover-changed",r)},processEvidences:function(t){var r;const e=[];return(r=t==null?void 0:t.body)!=null&&r.evidence&&t.body.evidence.forEach(n=>{if(typeof n=="object")e.push(n);else{const a={};if(n.includes("https://doi.org/")){const i=n.replace("https://doi.org/","DOI:");a[i]=n}else if(n.includes("https://pubmed.ncbi.nlm.nih.gov/")){const i=n.replace("https://pubmed.ncbi.nlm.nih.gov/","PMID:");a[i]=n}Object.keys(a).length>0?e.push(a):e.push(n)}}),e},evidenceEntered:function(t){t&&(this.evidence.push(this.evidencePrefix+t),this.newEvidence="")},formatTime:function(t){const e={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"};return new Date(t).toLocaleDateString(void 0,e)},updatePrevSubmissions:function(){var t;if(this.offlineAnnotationEnabled){const e=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[];this.prevSubs=e.filter(r=>r.resource===this.entry.resourceId&&r.item.id===this.entry.featureId)}else this.$annotator&&this.authenticated&&this.entry.resourceId&&this.entry.featureId&&((t=this.$annotator)==null||t.itemAnnotations(this.userApiKey,this.entry.resourceId,this.entry.featureId).then(e=>{this.prevSubs=e}).catch(e=>{console.log(e)}))},submit:function(){var t;if(this.entry.type==="updated"&&this.entry.positionUpdated?this.comment=this.comment?`Position Updated: ${this.comment}`:"Position Updated":this.entry.type==="deleted"&&(this.comment=this.comment?`Feature Deleted: ${this.comment}`:"Feature Deleted"),(this.evidence.length>0||this.comment)&&this.entry.resourceId&&this.entry.featureId){const e=[];this.evidence.forEach(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.entry.resourceId,item:Object.assign({id:this.entry.featureId},Object.fromEntries(Object.entries(this.entry).filter(([n])=>["label","models"].includes(n)))),body:{evidence:e,comment:this.comment},feature:this.entry.feature};Object.assign(r.body,this.entry.body),this.entry.type==="deleted"&&(r.feature=void 0),this.creator&&(r.creator=this.creator),(t=this.$annotator)==null||t.addAnnotation(this.userApiKey,r).then(()=>{this.errorMessage="",this.resetSubmission(),this.updatePrevSubmissions()}).catch(()=>{this.errorMessage="There is a problem with the submission, please try again later"}),this.$emit("annotation",r)}},removeEvidence:function(t){this.evidence.splice(t,1)},resetSubmission:function(){this.editing=!1,this.evidence=[],this.newFeature="",this.comment=""},getUpdateCopyContent:function(){if(!this.entry)return"";const t=[];if(this.entry.featureId&&t.push(`<div><strong>Feature ID:</strong>${this.entry.featureId}</div>`),this.entry.label&&t.push(`<div><strong>Label:</strong>${this.entry.label}</div>`),this.entry.models&&(t.push(`<div><strong>Ontology:</strong>${this.entry.models}</div>`),this.ontologyLink&&t.push(`<div><strong>Ontology Link:</strong>${this.ontologyLink}</div>`)),this.entry.resourceId&&t.push(`<div><strong>Resource:</strong>${this.entry.resourceId}</div>`),this.prevSubs.length){let e=`<div><strong>Annotations:</strong></div>
20
+ `,KP=["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 GP(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:KP.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:n,borderSize:a,boxSizing:r}}function xy(t,e=1,r){var n;hr||(hr=document.createElement("textarea"),document.body.appendChild(hr));const{paddingSize:a,borderSize:i,boxSizing:o,contextStyle:l}=GP(t);hr.setAttribute("style",`${l};${HP}`),hr.value=t.value||t.placeholder||"";let c=hr.scrollHeight;const u={};o==="border-box"?c=c+i:o==="content-box"&&(c=c-a),hr.value="";const d=hr.scrollHeight-a;if(xt(e)){let f=d*e;o==="border-box"&&(f=f+a+i),c=Math.max(f,c),u.minHeight=`${f}px`}if(xt(r)){let f=d*r;o==="border-box"&&(f=f+a+i),c=Math.min(f,c)}return u.height=`${c}px`,(n=hr.parentNode)==null||n.removeChild(hr),hr=void 0,u}const UP=Me({id:{type:String,default:void 0},size:Na,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:dn},prefixIcon:{type:dn},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:ke([Object,Array,String]),default:()=>Ca({})},autofocus:Boolean,rows:{type:Number,default:2},...jr(["ariaLabel"])}),jP={[et]:t=>ct(t),input:t=>ct(t),change:t=>ct(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},WP=s.defineComponent({name:"ElInput",inheritAttrs:!1}),YP=s.defineComponent({...WP,props:UP,emits:jP,setup(t,{expose:e,emit:r}){const n=t,a=s.useAttrs(),i=s.useSlots(),o=s.computed(()=>{const I={};return n.containerRole==="combobox"&&(I["aria-haspopup"]=a["aria-haspopup"],I["aria-owns"]=a["aria-owns"],I["aria-expanded"]=a["aria-expanded"]),I}),l=s.computed(()=>[n.type==="textarea"?y.b():g.b(),g.m(v.value),g.is("disabled",p.value),g.is("exceed",X.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")]:z.value&&j.value,[g.b("hidden")]:n.type==="hidden"},a.class]),c=s.computed(()=>[g.e("wrapper"),g.is("focus",S.value)]),u=Fm({excludeKeys:s.computed(()=>Object.keys(o.value))}),{form:d,formItem:f}=Gn(),{inputId:h}=Oi(n,{formItemContext:f}),v=Kn(),p=Ia(),g=De("input"),y=De("textarea"),m=s.shallowRef(),b=s.shallowRef(),w=s.ref(!1),C=s.ref(!1),x=s.ref(),k=s.shallowRef(n.inputStyle),E=s.computed(()=>m.value||b.value),{wrapperRef:_,isFocused:S,handleFocus:T,handleBlur:N}=iu(E,{beforeFocus(){return p.value},afterBlur(){var I;n.validateEvent&&((I=f==null?void 0:f.validate)==null||I.call(f,"blur").catch(U=>at(U)))}}),B=s.computed(()=>{var I;return(I=d==null?void 0:d.statusIcon)!=null?I:!1}),P=s.computed(()=>(f==null?void 0:f.validateState)||""),D=s.computed(()=>P.value&&Rm[P.value]),R=s.computed(()=>C.value?Ne.View:Ne.Hide),O=s.computed(()=>[a.style]),F=s.computed(()=>[n.inputStyle,k.value,{resize:n.resize}]),A=s.computed(()=>un(n.modelValue)?"":String(n.modelValue)),z=s.computed(()=>n.clearable&&!p.value&&!n.readonly&&!!A.value&&(S.value||w.value)),j=s.computed(()=>n.showPassword&&!p.value&&!n.readonly&&!!A.value&&(!!A.value||S.value)),H=s.computed(()=>n.showWordLimit&&!!n.maxlength&&(n.type==="text"||n.type==="textarea")&&!p.value&&!n.readonly&&!n.showPassword),G=s.computed(()=>A.value.length),X=s.computed(()=>!!H.value&&G.value>Number(n.maxlength)),M=s.computed(()=>!!i.suffix||!!n.suffixIcon||z.value||n.showPassword||H.value||!!P.value&&B.value),[V,q]=NP(m);Vr(b,I=>{if(L(),!H.value||n.resize!=="both")return;const U=I[0],{width:te}=U.contentRect;x.value={right:`calc(100% - ${te+15+6}px)`}});const $=()=>{const{type:I,autosize:U}=n;if(!(!nt||I!=="textarea"||!b.value))if(U){const te=yt(U)?U.minRows:void 0,Z=yt(U)?U.maxRows:void 0,J=xy(b.value,te,Z);k.value={overflowY:"hidden",...J},s.nextTick(()=>{b.value.offsetHeight,k.value=J})}else k.value={minHeight:xy(b.value).minHeight}},L=(I=>{let U=!1;return()=>{var te;if(U||!n.autosize)return;((te=b.value)==null?void 0:te.offsetParent)===null||(I(),U=!0)}})($),W=()=>{const I=E.value,U=n.formatter?n.formatter(A.value):A.value;!I||I.value===U||(I.value=U)},Y=async I=>{V();let{value:U}=I.target;if(n.formatter&&(U=n.parser?n.parser(U):U),!ue.value){if(U===A.value){W();return}r(et,U),r("input",U),await s.nextTick(),W(),q()}},se=I=>{r("change",I.target.value)},{isComposing:ue,handleCompositionStart:ae,handleCompositionUpdate:ne,handleCompositionEnd:ce}=wy({emit:r,afterComposition:Y}),ie=()=>{C.value=!C.value,fe()},fe=async()=>{var I;await s.nextTick(),(I=E.value)==null||I.focus()},pe=()=>{var I;return(I=E.value)==null?void 0:I.blur()},Pe=I=>{w.value=!1,r("mouseleave",I)},Ie=I=>{w.value=!0,r("mouseenter",I)},we=I=>{r("keydown",I)},xe=()=>{var I;(I=E.value)==null||I.select()},re=()=>{r(et,""),r("change",""),r("clear"),r("input","")};return s.watch(()=>n.modelValue,()=>{var I;s.nextTick(()=>$()),n.validateEvent&&((I=f==null?void 0:f.validate)==null||I.call(f,"change").catch(U=>at(U)))}),s.watch(A,()=>W()),s.watch(()=>n.type,async()=>{await s.nextTick(),W(),$()}),s.onMounted(()=>{!n.formatter&&n.parser&&at("ElInput","If you set the parser, you also need to set the formatter."),W(),s.nextTick($)}),e({input:m,textarea:b,ref:E,textareaStyle:F,autosize:s.toRef(n,"autosize"),isComposing:ue,focus:fe,blur:pe,select:xe,clear:re,resizeTextarea:$}),(I,U)=>(s.openBlock(),s.createElementBlock("div",s.mergeProps(s.unref(o),{class:[s.unref(l),{[s.unref(g).bm("group","append")]:I.$slots.append,[s.unref(g).bm("group","prepend")]:I.$slots.prepend}],style:s.unref(O),role:I.containerRole,onMouseenter:Ie,onMouseleave:Pe}),[s.createCommentVNode(" input "),I.type!=="textarea"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createCommentVNode(" prepend slot "),I.$slots.prepend?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(g).be("group","prepend"))},[s.renderSlot(I.$slots,"prepend")],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{ref_key:"wrapperRef",ref:_,class:s.normalizeClass(s.unref(c))},[s.createCommentVNode(" prefix slot "),I.$slots.prefix||I.prefixIcon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(g).e("prefix"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(g).e("prefix-inner"))},[s.renderSlot(I.$slots,"prefix"),I.prefixIcon?(s.openBlock(),s.createBlock(s.unref(it),{key:0,class:s.normalizeClass(s.unref(g).e("icon"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(I.prefixIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("input",s.mergeProps({id:s.unref(h),ref_key:"input",ref:m,class:s.unref(g).e("inner")},s.unref(u),{minlength:I.minlength,maxlength:I.maxlength,type:I.showPassword?C.value?"text":"password":I.type,disabled:s.unref(p),readonly:I.readonly,autocomplete:I.autocomplete,tabindex:I.tabindex,"aria-label":I.ariaLabel,placeholder:I.placeholder,style:I.inputStyle,form:I.form,autofocus:I.autofocus,onCompositionstart:s.unref(ae),onCompositionupdate:s.unref(ne),onCompositionend:s.unref(ce),onInput:Y,onChange:se,onKeydown:we}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),s.createCommentVNode(" suffix slot "),s.unref(M)?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(s.unref(g).e("suffix"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(g).e("suffix-inner"))},[!s.unref(z)||!s.unref(j)||!s.unref(H)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.renderSlot(I.$slots,"suffix"),I.suffixIcon?(s.openBlock(),s.createBlock(s.unref(it),{key:0,class:s.normalizeClass(s.unref(g).e("icon"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(I.suffixIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],64)):s.createCommentVNode("v-if",!0),s.unref(z)?(s.openBlock(),s.createBlock(s.unref(it),{key:1,class:s.normalizeClass([s.unref(g).e("icon"),s.unref(g).e("clear")]),onMousedown:s.withModifiers(s.unref(ga),["prevent"]),onClick:re},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.CircleClose))]),_:1},8,["class","onMousedown"])):s.createCommentVNode("v-if",!0),s.unref(j)?(s.openBlock(),s.createBlock(s.unref(it),{key:2,class:s.normalizeClass([s.unref(g).e("icon"),s.unref(g).e("password")]),onClick:ie},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(R))))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),s.unref(H)?(s.openBlock(),s.createElementBlock("span",{key:3,class:s.normalizeClass(s.unref(g).e("count"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(g).e("count-inner"))},s.toDisplayString(s.unref(G))+" / "+s.toDisplayString(I.maxlength),3)],2)):s.createCommentVNode("v-if",!0),s.unref(P)&&s.unref(D)&&s.unref(B)?(s.openBlock(),s.createBlock(s.unref(it),{key:4,class:s.normalizeClass([s.unref(g).e("icon"),s.unref(g).e("validateIcon"),s.unref(g).is("loading",s.unref(P)==="validating")])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(D))))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],2)):s.createCommentVNode("v-if",!0)],2),s.createCommentVNode(" append slot "),I.$slots.append?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(s.unref(g).be("group","append"))},[s.renderSlot(I.$slots,"append")],2)):s.createCommentVNode("v-if",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createCommentVNode(" textarea "),s.createElementVNode("textarea",s.mergeProps({id:s.unref(h),ref_key:"textarea",ref:b,class:[s.unref(y).e("inner"),s.unref(g).is("focus",s.unref(S))]},s.unref(u),{minlength:I.minlength,maxlength:I.maxlength,tabindex:I.tabindex,disabled:s.unref(p),readonly:I.readonly,autocomplete:I.autocomplete,style:s.unref(F),"aria-label":I.ariaLabel,placeholder:I.placeholder,form:I.form,autofocus:I.autofocus,rows:I.rows,onCompositionstart:s.unref(ae),onCompositionupdate:s.unref(ne),onCompositionend:s.unref(ce),onInput:Y,onFocus:s.unref(T),onBlur:s.unref(N),onChange:se,onKeydown:we}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),s.unref(H)?(s.openBlock(),s.createElementBlock("span",{key:0,style:s.normalizeStyle(x.value),class:s.normalizeClass(s.unref(g).e("count"))},s.toDisplayString(s.unref(G))+" / "+s.toDisplayString(I.maxlength),7)):s.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var ZP=Be(YP,[["__file","input.vue"]]);const Ai=dt(ZP),Ba=4,XP={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"}},JP=({move:t,size:e,bar:r})=>({[r.size]:e,transform:`translate${r.axis}(${t}%)`}),lu=Symbol("scrollbarContextKey"),QP=Me({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),eO="Thumb";var ky=Be(s.defineComponent({__name:"thumb",props:QP,setup(t){const e=t,r=s.inject(lu),n=De("scrollbar");r||Pm(eO,"can not inject scrollbar context");const a=s.ref(),i=s.ref(),o=s.ref({}),l=s.ref(!1);let c=!1,u=!1,d=nt?document.onselectstart:null;const f=s.computed(()=>XP[e.vertical?"vertical":"horizontal"]),h=s.computed(()=>JP({size:e.size,move:e.move,bar:f.value})),v=s.computed(()=>a.value[f.value.offset]**2/r.wrapElement[f.value.scrollSize]/e.ratio/i.value[f.value.offset]),p=k=>{var E;if(k.stopPropagation(),k.ctrlKey||[1,2].includes(k.button))return;(E=window.getSelection())==null||E.removeAllRanges(),y(k);const _=k.currentTarget;_&&(o.value[f.value.axis]=_[f.value.offset]-(k[f.value.client]-_.getBoundingClientRect()[f.value.direction]))},g=k=>{if(!i.value||!a.value||!r.wrapElement)return;const E=Math.abs(k.target.getBoundingClientRect()[f.value.direction]-k[f.value.client]),_=i.value[f.value.offset]/2,S=(E-_)*100*v.value/a.value[f.value.offset];r.wrapElement[f.value.scroll]=S*r.wrapElement[f.value.scrollSize]/100},y=k=>{k.stopImmediatePropagation(),c=!0,document.addEventListener("mousemove",m),document.addEventListener("mouseup",b),d=document.onselectstart,document.onselectstart=()=>!1},m=k=>{if(!a.value||!i.value||c===!1)return;const E=o.value[f.value.axis];if(!E)return;const _=(a.value.getBoundingClientRect()[f.value.direction]-k[f.value.client])*-1,S=i.value[f.value.offset]-E,T=(_-S)*100*v.value/a.value[f.value.offset];r.wrapElement[f.value.scroll]=T*r.wrapElement[f.value.scrollSize]/100},b=()=>{c=!1,o.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};s.onBeforeUnmount(()=>{x(),document.removeEventListener("mouseup",b)});const x=()=>{document.onselectstart!==d&&(document.onselectstart=d)};return Qt(s.toRef(r,"scrollbarElement"),"mousemove",w),Qt(s.toRef(r,"scrollbarElement"),"mouseleave",C),(k,E)=>(s.openBlock(),s.createBlock(s.Transition,{name:s.unref(n).b("fade"),persisted:""},{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{ref_key:"instance",ref:a,class:s.normalizeClass([s.unref(n).e("bar"),s.unref(n).is(s.unref(f).key)]),onMousedown:g},[s.createElementVNode("div",{ref_key:"thumb",ref:i,class:s.normalizeClass(s.unref(n).e("thumb")),style:s.normalizeStyle(s.unref(h)),onMousedown:p},null,38)],34),[[s.vShow,k.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const tO=Me({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var rO=Be(s.defineComponent({__name:"bar",props:tO,setup(t,{expose:e}){const r=t,n=s.inject(lu),a=s.ref(0),i=s.ref(0),o=s.ref(""),l=s.ref(""),c=s.ref(1),u=s.ref(1);return e({handleScroll:h=>{if(h){const v=h.offsetHeight-Ba,p=h.offsetWidth-Ba;i.value=h.scrollTop*100/v*c.value,a.value=h.scrollLeft*100/p*u.value}},update:()=>{const h=n==null?void 0:n.wrapElement;if(!h)return;const v=h.offsetHeight-Ba,p=h.offsetWidth-Ba,g=v**2/h.scrollHeight,y=p**2/h.scrollWidth,m=Math.max(g,r.minSize),b=Math.max(y,r.minSize);c.value=g/(v-g)/(m/(v-m)),u.value=y/(p-y)/(b/(p-b)),l.value=m+Ba<v?`${m}px`:"",o.value=b+Ba<p?`${b}px`:""}}),(h,v)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(ky,{move:a.value,ratio:u.value,size:o.value,always:h.always},null,8,["move","ratio","size","always"]),s.createVNode(ky,{move:i.value,ratio:c.value,size:l.value,vertical:"",always:h.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const nO=Me({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,...jr(["ariaLabel","ariaOrientation"])}),aO={scroll:({scrollTop:t,scrollLeft:e})=>[t,e].every(xt)},uu="ElScrollbar",iO=s.defineComponent({name:uu}),oO=s.defineComponent({...iO,props:nO,emits:aO,setup(t,{expose:e,emit:r}){const n=t,a=De("scrollbar");let i,o,l=0,c=0;const u=s.ref(),d=s.ref(),f=s.ref(),h=s.ref(),v=s.computed(()=>{const x={};return n.height&&(x.height=wa(n.height)),n.maxHeight&&(x.maxHeight=wa(n.maxHeight)),[n.wrapStyle,x]}),p=s.computed(()=>[n.wrapClass,a.e("wrap"),{[a.em("wrap","hidden-default")]:!n.native}]),g=s.computed(()=>[a.e("view"),n.viewClass]),y=()=>{var x;d.value&&((x=h.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,k){yt(x)?d.value.scrollTo(x):xt(x)&&xt(k)&&d.value.scrollTo(x,k)}const b=x=>{if(!xt(x)){at(uu,"value must be a number");return}d.value.scrollTop=x},w=x=>{if(!xt(x)){at(uu,"value must be a number");return}d.value.scrollLeft=x},C=()=>{var x;(x=h.value)==null||x.update()};return s.watch(()=>n.noresize,x=>{x?(i==null||i(),o==null||o()):({stop:i}=Vr(f,C),o=Qt("resize",C))},{immediate:!0}),s.watch(()=>[n.maxHeight,n.height],()=>{n.native||s.nextTick(()=>{var x;C(),d.value&&((x=h.value)==null||x.handleScroll(d.value))})}),s.provide(lu,s.reactive({scrollbarElement:u,wrapElement:d})),s.onActivated(()=>{d.value&&(d.value.scrollTop=l,d.value.scrollLeft=c)}),s.onMounted(()=>{n.native||s.nextTick(()=>{C()})}),s.onUpdated(()=>C()),e({wrapRef:d,update:C,scrollTo:m,setScrollTop:b,setScrollLeft:w,handleScroll:y}),(x,k)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"scrollbarRef",ref:u,class:s.normalizeClass(s.unref(a).b())},[s.createElementVNode("div",{ref_key:"wrapRef",ref:d,class:s.normalizeClass(s.unref(p)),style:s.normalizeStyle(s.unref(v)),tabindex:x.tabindex,onScroll:y},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(x.tag),{id:x.id,ref_key:"resizeRef",ref:f,class:s.normalizeClass(s.unref(g)),style:s.normalizeStyle(x.viewStyle),role:x.role,"aria-label":x.ariaLabel,"aria-orientation":x.ariaOrientation},{default:s.withCtx(()=>[s.renderSlot(x.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),x.native?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createBlock(rO,{key:0,ref_key:"barRef",ref:h,always:x.always,"min-size":x.minSize},null,8,["always","min-size"]))],2))}});var sO=Be(oO,[["__file","scrollbar.vue"]]);const Sy=dt(sO),cu=Symbol("popper"),_y=Symbol("popperContent"),Ty=Me({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),lO=s.defineComponent({name:"ElPopper",inheritAttrs:!1}),uO=s.defineComponent({...lO,props:Ty,setup(t,{expose:e}){const r=t,n=s.ref(),a=s.ref(),i=s.ref(),o=s.ref(),l=s.computed(()=>r.role),c={triggerRef:n,popperInstanceRef:a,contentRef:i,referenceRef:o,role:l};return e(c),s.provide(cu,c),(u,d)=>s.renderSlot(u.$slots,"default")}});var cO=Be(uO,[["__file","popper.vue"]]);const Ny=Me({arrowOffset:{type:Number,default:5}}),dO=s.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),fO=s.defineComponent({...dO,props:Ny,setup(t,{expose:e}){const r=t,n=De("popper"),{arrowOffset:a,arrowRef:i,arrowStyle:o}=s.inject(_y,void 0);return s.watch(()=>r.arrowOffset,l=>{a.value=l}),s.onBeforeUnmount(()=>{i.value=void 0}),e({arrowRef:i}),(l,c)=>(s.openBlock(),s.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:s.normalizeClass(s.unref(n).e("arrow")),style:s.normalizeStyle(s.unref(o)),"data-popper-arrow":""},null,6))}});var hO=Be(fO,[["__file","arrow.vue"]]);const du="ElOnlyChild",pO=s.defineComponent({name:du,setup(t,{slots:e,attrs:r}){var n;const a=s.inject(fy),i=TP((n=a==null?void 0:a.setForwardRef)!=null?n:ga);return()=>{var o;const l=(o=e.default)==null?void 0:o.call(e,r);if(!l)return null;if(l.length>1)return at(du,"requires exact only one valid child."),null;const c=Iy(l);return c?s.withDirectives(s.cloneVNode(c,r),[[i]]):(at(du,"no valid child node found"),null)}}});function Iy(t){if(!t)return null;const e=t;for(const r of e){if(yt(r))switch(r.type){case s.Comment:continue;case s.Text:case"svg":return By(r);case s.Fragment:return Iy(r.children);default:return r}return By(r)}return null}function By(t){const e=De("only-child");return s.createVNode("span",{class:e.e("content")},[t])}const Dy=Me({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}),vO=s.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),gO=s.defineComponent({...vO,props:Dy,setup(t,{expose:e}){const r=t,{role:n,triggerRef:a}=s.inject(cu,void 0);_P(a);const i=s.computed(()=>l.value?r.id:void 0),o=s.computed(()=>{if(n&&n.value==="tooltip")return r.open&&r.id?r.id:void 0}),l=s.computed(()=>{if(n&&n.value!=="tooltip")return n.value}),c=s.computed(()=>l.value?`${r.open}`:void 0);let u;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return s.onMounted(()=>{s.watch(()=>r.virtualRef,f=>{f&&(a.value=$r(f))},{immediate:!0}),s.watch(a,(f,h)=>{u==null||u(),u=void 0,Vn(f)&&(d.forEach(v=>{var p;const g=r[v];g&&(f.addEventListener(v.slice(2).toLowerCase(),g),(p=h==null?void 0:h.removeEventListener)==null||p.call(h,v.slice(2).toLowerCase(),g))}),u=s.watch([i,o,l,c],v=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((p,g)=>{un(v[g])?f.removeAttribute(p):f.setAttribute(p,v[g])})},{immediate:!0})),Vn(h)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(v=>h.removeAttribute(v))},{immediate:!0})}),s.onBeforeUnmount(()=>{if(u==null||u(),u=void 0,a.value&&Vn(a.value)){const f=a.value;d.forEach(h=>{const v=r[h];v&&f.removeEventListener(h.slice(2).toLowerCase(),v)}),a.value=void 0}}),e({triggerRef:a}),(f,h)=>f.virtualTriggering?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createBlock(s.unref(pO),s.mergeProps({key:0},f.$attrs,{"aria-controls":s.unref(i),"aria-describedby":s.unref(o),"aria-expanded":s.unref(c),"aria-haspopup":s.unref(l)}),{default:s.withCtx(()=>[s.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var mO=Be(gO,[["__file","trigger.vue"]]);const fu="focus-trap.focus-after-trapped",hu="focus-trap.focus-after-released",yO="focus-trap.focusout-prevented",Py={cancelable:!0,bubbles:!1},bO={cancelable:!0,bubbles:!1},Oy="focusAfterTrapped",Ay="focusAfterReleased",wO=Symbol("elFocusTrap"),pu=s.ref(),Qo=s.ref(0),vu=s.ref(0);let es=0;const Ry=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},Ly=(t,e)=>{for(const r of t)if(!CO(r,e))return r},CO=(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},EO=t=>{const e=Ry(t),r=Ly(e,t),n=Ly(e.reverse(),t);return[r,n]},xO=t=>t instanceof HTMLInputElement&&"select"in t,hn=(t,e)=>{if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),vu.value=window.performance.now(),t!==r&&xO(t)&&e&&t.select()}};function Fy(t,e){const r=[...t],n=t.indexOf(e);return n!==-1&&r.splice(n,1),r}const kO=()=>{let t=[];return{push:n=>{const a=t[0];a&&n!==a&&a.pause(),t=Fy(t,n),t.unshift(n)},remove:n=>{var a,i;t=Fy(t,n),(i=(a=t[0])==null?void 0:a.resume)==null||i.call(a)}}},SO=(t,e=!1)=>{const r=document.activeElement;for(const n of t)if(hn(n,e),document.activeElement!==r)return},My=kO(),_O=()=>Qo.value>vu.value,ts=()=>{pu.value="pointer",Qo.value=window.performance.now()},$y=()=>{pu.value="keyboard",Qo.value=window.performance.now()},TO=()=>(s.onMounted(()=>{es===0&&(document.addEventListener("mousedown",ts),document.addEventListener("touchstart",ts),document.addEventListener("keydown",$y)),es++}),s.onBeforeUnmount(()=>{es--,es<=0&&(document.removeEventListener("mousedown",ts),document.removeEventListener("touchstart",ts),document.removeEventListener("keydown",$y))}),{focusReason:pu,lastUserFocusTimestamp:Qo,lastAutomatedFocusTimestamp:vu}),rs=t=>new CustomEvent(yO,{...bO,detail:t}),NO=s.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Oy,Ay,"focusin","focusout","focusout-prevented","release-requested"],setup(t,{emit:e}){const r=s.ref();let n,a;const{focusReason:i}=TO();CP(p=>{t.trapped&&!o.paused&&e("release-requested",p)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=p=>{if(!t.loop&&!t.trapped||o.paused)return;const{key:g,altKey:y,ctrlKey:m,metaKey:b,currentTarget:w,shiftKey:C}=p,{loop:x}=t,k=g===ft.tab&&!y&&!m&&!b,E=document.activeElement;if(k&&E){const _=w,[S,T]=EO(_);if(S&&T){if(!C&&E===T){const B=rs({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||(p.preventDefault(),x&&hn(S,!0))}else if(C&&[S,_].includes(E)){const B=rs({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||(p.preventDefault(),x&&hn(T,!0))}}else if(E===_){const B=rs({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||p.preventDefault()}}};s.provide(wO,{focusTrapRef:r,onKeydown:l}),s.watch(()=>t.focusTrapEl,p=>{p&&(r.value=p)},{immediate:!0}),s.watch([r],([p],[g])=>{p&&(p.addEventListener("keydown",l),p.addEventListener("focusin",d),p.addEventListener("focusout",f)),g&&(g.removeEventListener("keydown",l),g.removeEventListener("focusin",d),g.removeEventListener("focusout",f))});const c=p=>{e(Oy,p)},u=p=>e(Ay,p),d=p=>{const g=s.unref(r);if(!g)return;const y=p.target,m=p.relatedTarget,b=y&&g.contains(y);t.trapped||m&&g.contains(m)||(n=m),b&&e("focusin",p),!o.paused&&t.trapped&&(b?a=y:hn(a,!0))},f=p=>{const g=s.unref(r);if(!(o.paused||!g))if(t.trapped){const y=p.relatedTarget;!un(y)&&!g.contains(y)&&setTimeout(()=>{if(!o.paused&&t.trapped){const m=rs({focusReason:i.value});e("focusout-prevented",m),m.defaultPrevented||hn(a,!0)}},0)}else{const y=p.target;y&&g.contains(y)||e("focusout",p)}};async function h(){await s.nextTick();const p=s.unref(r);if(p){My.push(o);const g=p.contains(document.activeElement)?n:document.activeElement;if(n=g,!p.contains(g)){const m=new Event(fu,Py);p.addEventListener(fu,c),p.dispatchEvent(m),m.defaultPrevented||s.nextTick(()=>{let b=t.focusStartEl;ct(b)||(hn(b),document.activeElement!==b&&(b="first")),b==="first"&&SO(Ry(p),!0),(document.activeElement===g||b==="container")&&hn(p)})}}}function v(){const p=s.unref(r);if(p){p.removeEventListener(fu,c);const g=new CustomEvent(hu,{...Py,detail:{focusReason:i.value}});p.addEventListener(hu,u),p.dispatchEvent(g),!g.defaultPrevented&&(i.value=="keyboard"||!_O()||p.contains(document.activeElement))&&hn(n??document.body),p.removeEventListener(hu,u),My.remove(o)}}return s.onMounted(()=>{t.trapped&&h(),s.watch(()=>t.trapped,p=>{p?h():v()})}),s.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 IO(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default",{handleKeydown:t.onKeydown})}var BO=Be(NO,[["render",IO],["__file","focus-trap.vue"]]);const DO=["fixed","absolute"],PO=Me({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:jo,default:"bottom"},popperOptions:{type:ke(Object),default:()=>({})},strategy:{type:String,values:DO,default:"absolute"}}),Vy=Me({...PO,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,...jr(["ariaLabel"])}),OO={mouseenter:t=>t instanceof MouseEvent,mouseleave:t=>t instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},AO=(t,e=[])=>{const{placement:r,strategy:n,popperOptions:a}=t,i={placement:r,strategy:n,...a,modifiers:[...LO(t),...e]};return FO(i,a==null?void 0:a.modifiers),i},RO=t=>{if(nt)return $r(t)};function LO(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 FO(t,e){e&&(t.modifiers=[...t.modifiers,...e??[]])}const MO=0,$O=t=>{const{popperInstanceRef:e,contentRef:r,triggerRef:n,role:a}=s.inject(cu,void 0),i=s.ref(),o=s.ref(),l=s.computed(()=>({name:"eventListeners",enabled:!!t.visible})),c=s.computed(()=>{var m;const b=s.unref(i),w=(m=s.unref(o))!=null?m:MO;return{name:"arrow",enabled:!YB(b),options:{element:b,padding:w}}}),u=s.computed(()=>({onFirstUpdate:()=>{p()},...AO(t,[s.unref(c),s.unref(l)])})),d=s.computed(()=>RO(t.referenceEl)||s.unref(n)),{attributes:f,state:h,styles:v,update:p,forceUpdate:g,instanceRef:y}=yP(d,r,u);return s.watch(y,m=>e.value=m),s.onMounted(()=>{s.watch(()=>{var m;return(m=s.unref(d))==null?void 0:m.getBoundingClientRect()},()=>{p()})}),{attributes:f,arrowRef:i,contentRef:r,instanceRef:y,state:h,styles:v,role:a,forceUpdate:g,update:p}},VO=(t,{attributes:e,styles:r,role:n})=>{const{nextZIndex:a}=yy(),i=De("popper"),o=s.computed(()=>s.unref(e).popper),l=s.ref(xt(t.zIndex)?t.zIndex:a()),c=s.computed(()=>[i.b(),i.is("pure",t.pure),i.is(t.effect),t.popperClass]),u=s.computed(()=>[{zIndex:s.unref(l)},s.unref(r).popper,t.popperStyle||{}]),d=s.computed(()=>n.value==="dialog"?"false":void 0),f=s.computed(()=>s.unref(r).arrow||{});return{ariaModal:d,arrowStyle:f,contentAttrs:o,contentClass:c,contentStyle:u,contentZIndex:l,updateZIndex:()=>{l.value=xt(t.zIndex)?t.zIndex:a()}}},qO=(t,e)=>{const r=s.ref(!1),n=s.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")}}},zO=s.defineComponent({name:"ElPopperContent"}),HO=s.defineComponent({...zO,props:Vy,emits:OO,setup(t,{expose:e,emit:r}){const n=t,{focusStartRef:a,trapped:i,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=qO(n,r),{attributes:f,arrowRef:h,contentRef:v,styles:p,instanceRef:g,role:y,update:m}=$O(n),{ariaModal:b,arrowStyle:w,contentAttrs:C,contentClass:x,contentStyle:k,updateZIndex:E}=VO(n,{styles:p,attributes:f,role:y}),_=s.inject(Pi,void 0),S=s.ref();s.provide(_y,{arrowStyle:w,arrowRef:h,arrowOffset:S}),_&&s.provide(Pi,{..._,addInputId:ga,removeInputId:ga});let T;const N=(P=!0)=>{m(),P&&E()},B=()=>{N(!1),n.visible&&n.focusOnShow?i.value=!0:n.visible===!1&&(i.value=!1)};return s.onMounted(()=>{s.watch(()=>n.triggerTargetEl,(P,D)=>{T==null||T(),T=void 0;const R=s.unref(P||v.value),O=s.unref(D||v.value);Vn(R)&&(T=s.watch([y,()=>n.ariaLabel,b,()=>n.id],F=>{["role","aria-label","aria-modal","id"].forEach((A,z)=>{un(F[z])?R.removeAttribute(A):R.setAttribute(A,F[z])})},{immediate:!0})),O!==R&&Vn(O)&&["role","aria-label","aria-modal","id"].forEach(F=>{O.removeAttribute(F)})},{immediate:!0}),s.watch(()=>n.visible,B,{immediate:!0})}),s.onBeforeUnmount(()=>{T==null||T(),T=void 0}),e({popperContentRef:v,popperInstanceRef:g,updatePopper:N,contentStyle:k}),(P,D)=>(s.openBlock(),s.createElementBlock("div",s.mergeProps({ref_key:"contentRef",ref:v},s.unref(C),{style:s.unref(k),class:s.unref(x),tabindex:"-1",onMouseenter:R=>P.$emit("mouseenter",R),onMouseleave:R=>P.$emit("mouseleave",R)}),[s.createVNode(s.unref(BO),{trapped:s.unref(i),"trap-on-focus-in":!0,"focus-trap-el":s.unref(v),"focus-start-el":s.unref(a),onFocusAfterTrapped:s.unref(l),onFocusAfterReleased:s.unref(o),onFocusin:s.unref(c),onFocusoutPrevented:s.unref(u),onReleaseRequested:s.unref(d)},{default:s.withCtx(()=>[s.renderSlot(P.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var KO=Be(HO,[["__file","content.vue"]]);const GO=dt(cO),gu=Symbol("elTooltip"),$t=Me({...kP,...Vy,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,...jr(["ariaLabel"])}),Ri=Me({...Dy,disabled:Boolean,trigger:{type:ke([String,Array]),default:"hover"},triggerKeys:{type:ke(Array),default:()=>[ft.enter,ft.space]}}),{useModelToggleProps:UO,useModelToggleEmits:jO,useModelToggle:WO}=vD("visible"),YO=Me({...Ty,...UO,...$t,...Ri,...Ny,showArrow:{type:Boolean,default:!0}}),ZO=[...jO,"before-show","before-hide","show","hide","open","close"],XO=(t,e)=>Et(t)?t.includes(e):t===e,Da=(t,e,r)=>n=>{XO(s.unref(t),e)&&r(n)},JO=s.defineComponent({name:"ElTooltipTrigger"}),QO=s.defineComponent({...JO,props:Ri,setup(t,{expose:e}){const r=t,n=De("tooltip"),{controlled:a,id:i,open:o,onOpen:l,onClose:c,onToggle:u}=s.inject(gu,void 0),d=s.ref(null),f=()=>{if(s.unref(a)||r.disabled)return!0},h=s.toRef(r,"trigger"),v=Mr(f,Da(h,"hover",l)),p=Mr(f,Da(h,"hover",c)),g=Mr(f,Da(h,"click",C=>{C.button===0&&u(C)})),y=Mr(f,Da(h,"focus",l)),m=Mr(f,Da(h,"focus",c)),b=Mr(f,Da(h,"contextmenu",C=>{C.preventDefault(),u(C)})),w=Mr(f,C=>{const{code:x}=C;r.triggerKeys.includes(x)&&(C.preventDefault(),u(C))});return e({triggerRef:d}),(C,x)=>(s.openBlock(),s.createBlock(s.unref(mO),{id:s.unref(i),"virtual-ref":C.virtualRef,open:s.unref(o),"virtual-triggering":C.virtualTriggering,class:s.normalizeClass(s.unref(n).e("trigger")),onBlur:s.unref(m),onClick:s.unref(g),onContextmenu:s.unref(b),onFocus:s.unref(y),onMouseenter:s.unref(v),onMouseleave:s.unref(p),onKeydown:s.unref(w)},{default:s.withCtx(()=>[s.renderSlot(C.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var eA=Be(QO,[["__file","trigger.vue"]]);const tA=Me({to:{type:ke([String,Object]),required:!0},disabled:Boolean});var rA=Be(s.defineComponent({__name:"teleport",props:tA,setup(t){return(e,r)=>e.disabled?s.renderSlot(e.$slots,"default",{key:0}):(s.openBlock(),s.createBlock(s.Teleport,{key:1,to:e.to},[s.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const nA=dt(rA),aA=s.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),iA=s.defineComponent({...aA,props:$t,setup(t,{expose:e}){const r=t,{selector:n}=dy(),a=De("tooltip"),i=s.ref(null);let o;const{controlled:l,id:c,open:u,trigger:d,onClose:f,onOpen:h,onShow:v,onHide:p,onBeforeShow:g,onBeforeHide:y}=s.inject(gu,void 0),m=s.computed(()=>r.transition||`${a.namespace.value}-fade-in-linear`),b=s.computed(()=>process.env.NODE_ENV==="test"?!0:r.persistent);s.onBeforeUnmount(()=>{o==null||o()});const w=s.computed(()=>s.unref(b)?!0:s.unref(u)),C=s.computed(()=>r.disabled?!1:s.unref(u)),x=s.computed(()=>r.appendTo||n.value),k=s.computed(()=>{var O;return(O=r.style)!=null?O:{}}),E=s.ref(!0),_=()=>{p(),E.value=!0},S=()=>{if(s.unref(l))return!0},T=Mr(S,()=>{r.enterable&&s.unref(d)==="hover"&&h()}),N=Mr(S,()=>{s.unref(d)==="hover"&&f()}),B=()=>{var O,F;(F=(O=i.value)==null?void 0:O.updatePopper)==null||F.call(O),g==null||g()},P=()=>{y==null||y()},D=()=>{v(),o=Og(s.computed(()=>{var O;return(O=i.value)==null?void 0:O.popperContentRef}),()=>{if(s.unref(l))return;s.unref(d)!=="hover"&&f()})},R=()=>{r.virtualTriggering||f()};return s.watch(()=>s.unref(u),O=>{O?E.value=!1:o==null||o()},{flush:"post"}),s.watch(()=>r.content,()=>{var O,F;(F=(O=i.value)==null?void 0:O.updatePopper)==null||F.call(O)}),e({contentRef:i}),(O,F)=>(s.openBlock(),s.createBlock(s.unref(nA),{disabled:!O.teleported,to:s.unref(x)},{default:s.withCtx(()=>[s.createVNode(s.Transition,{name:s.unref(m),onAfterLeave:_,onBeforeEnter:B,onAfterEnter:D,onBeforeLeave:P},{default:s.withCtx(()=>[s.unref(w)?s.withDirectives((s.openBlock(),s.createBlock(s.unref(KO),s.mergeProps({key:0,id:s.unref(c),ref_key:"contentRef",ref:i},O.$attrs,{"aria-label":O.ariaLabel,"aria-hidden":E.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,s.unref(k)],"reference-el":O.referenceEl,"trigger-target-el":O.triggerTargetEl,visible:s.unref(C),"z-index":O.zIndex,onMouseenter:s.unref(T),onMouseleave:s.unref(N),onBlur:R,onClose:s.unref(f)}),{default:s.withCtx(()=>[s.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"])),[[s.vShow,s.unref(C)]]):s.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var oA=Be(iA,[["__file","content.vue"]]);const sA=s.defineComponent({name:"ElTooltip"}),lA=s.defineComponent({...sA,props:YO,emits:ZO,setup(t,{expose:e,emit:r}){const n=t;xP();const a=Di(),i=s.ref(),o=s.ref(),l=()=>{var m;const b=s.unref(i);b&&((m=b.popperInstanceRef)==null||m.update())},c=s.ref(!1),u=s.ref(),{show:d,hide:f,hasUpdateHandler:h}=WO({indicator:c,toggleReason:u}),{onOpen:v,onClose:p}=SP({showAfter:s.toRef(n,"showAfter"),hideAfter:s.toRef(n,"hideAfter"),autoClose:s.toRef(n,"autoClose"),open:d,close:f}),g=s.computed(()=>ba(n.visible)&&!h.value);s.provide(gu,{controlled:g,id:a,open:s.readonly(c),trigger:s.toRef(n,"trigger"),onOpen:m=>{v(m)},onClose:m=>{p(m)},onToggle:m=>{s.unref(c)?p(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}),s.watch(()=>n.disabled,m=>{m&&c.value&&(c.value=!1)});const y=m=>{var b,w;const C=(w=(b=o.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 s.onDeactivated(()=>c.value&&f()),e({popperRef:i,contentRef:o,isFocusInsideContent:y,updatePopper:l,onOpen:v,onClose:p,hide:f}),(m,b)=>(s.openBlock(),s.createBlock(s.unref(GO),{ref_key:"popperRef",ref:i,role:m.role},{default:s.withCtx(()=>[s.createVNode(eA,{disabled:m.disabled,trigger:m.trigger,"trigger-keys":m.triggerKeys,"virtual-ref":m.virtualRef,"virtual-triggering":m.virtualTriggering},{default:s.withCtx(()=>[m.$slots.default?s.renderSlot(m.$slots,"default",{key:0}):s.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),s.createVNode(oA,{ref_key:"contentRef",ref:o,"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:s.withCtx(()=>[s.renderSlot(m.$slots,"content",{},()=>[m.rawContent?(s.openBlock(),s.createElementBlock("span",{key:0,innerHTML:m.content},null,8,["innerHTML"])):(s.openBlock(),s.createElementBlock("span",{key:1},s.toDisplayString(m.content),1))]),m.showArrow?(s.openBlock(),s.createBlock(s.unref(hO),{key:0,"arrow-offset":m.arrowOffset},null,8,["arrow-offset"])):s.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 uA=Be(lA,[["__file","tooltip.vue"]]);const Pa=dt(uA),cA=Me({valueKey:{type:String,default:"value"},modelValue:{type:[String,Number],default:""},debounce:{type:Number,default:300},placement:{type:ke(String),values:["top","top-start","top-end","bottom","bottom-start","bottom-end"],default:"bottom-start"},fetchSuggestions:{type:ke([Function,Array]),default:ga},popperClass:{type:String,default:""},triggerOnFocus:{type:Boolean,default:!0},selectWhenUnmatched:{type:Boolean,default:!1},hideLoading:{type:Boolean,default:!1},teleported:$t.teleported,highlightFirstItem:{type:Boolean,default:!1},fitInputWidth:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},name:String,...jr(["ariaLabel"])}),dA={[et]:t=>ct(t),[jl]:t=>ct(t),[Ei]:t=>ct(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,select:t=>yt(t)},qy="ElAutocomplete",fA=s.defineComponent({name:qy,inheritAttrs:!1}),hA=s.defineComponent({...fA,props:cA,emits:dA,setup(t,{expose:e,emit:r}){const n=t,a=Fm(),i=s.useAttrs(),o=Ia(),l=De("autocomplete"),c=s.ref(),u=s.ref(),d=s.ref(),f=s.ref();let h=!1,v=!1;const p=s.ref([]),g=s.ref(-1),y=s.ref(""),m=s.ref(!1),b=s.ref(!1),w=s.ref(!1),C=Di(),x=s.computed(()=>i.style),k=s.computed(()=>(p.value.length>0||w.value)&&m.value),E=s.computed(()=>!n.hideLoading&&w.value),_=s.computed(()=>c.value?Array.from(c.value.$el.querySelectorAll("input")):[]),S=()=>{k.value&&(y.value=`${c.value.$el.offsetWidth}px`)},T=()=>{g.value=-1},N=async $=>{if(b.value)return;const K=L=>{w.value=!1,!b.value&&(Et(L)?(p.value=L,g.value=n.highlightFirstItem?0:-1):Pm(qy,"autocomplete suggestions must be an array"))};if(w.value=!0,Et(n.fetchSuggestions))K(n.fetchSuggestions);else{const L=await n.fetchSuggestions($,K);Et(L)&&K(L)}},B=Gl(N,n.debounce),P=$=>{const K=!!$;if(r(jl,$),r(et,$),b.value=!1,m.value||(m.value=K),!n.triggerOnFocus&&!$){b.value=!0,p.value=[];return}B($)},D=$=>{var K;o.value||(((K=$.target)==null?void 0:K.tagName)!=="INPUT"||_.value.includes(document.activeElement))&&(m.value=!0)},R=$=>{r(Ei,$)},O=$=>{v?v=!1:(m.value=!0,r("focus",$),n.triggerOnFocus&&!h&&B(String(n.modelValue)))},F=$=>{setTimeout(()=>{var K;if((K=d.value)!=null&&K.isFocusInsideContent()){v=!0;return}m.value&&H(),r("blur",$)})},A=()=>{m.value=!1,r(et,""),r("clear")},z=async()=>{k.value&&g.value>=0&&g.value<p.value.length?M(p.value[g.value]):n.selectWhenUnmatched&&(r("select",{value:n.modelValue}),p.value=[],g.value=-1)},j=$=>{k.value&&($.preventDefault(),$.stopPropagation(),H())},H=()=>{m.value=!1},G=()=>{var $;($=c.value)==null||$.focus()},X=()=>{var $;($=c.value)==null||$.blur()},M=async $=>{r(jl,$[n.valueKey]),r(et,$[n.valueKey]),r("select",$),p.value=[],g.value=-1},V=$=>{if(!k.value||w.value)return;if($<0){g.value=-1;return}$>=p.value.length&&($=p.value.length-1);const K=u.value.querySelector(`.${l.be("suggestion","wrap")}`),W=K.querySelectorAll(`.${l.be("suggestion","list")} li`)[$],Y=K.scrollTop,{offsetTop:se,scrollHeight:ue}=W;se+ue>Y+K.clientHeight&&(K.scrollTop+=ue),se<Y&&(K.scrollTop-=ue),g.value=$,c.value.ref.setAttribute("aria-activedescendant",`${C.value}-item-${g.value}`)},q=Og(f,()=>{k.value&&H()});return s.onBeforeUnmount(()=>{q==null||q()}),s.onMounted(()=>{c.value.ref.setAttribute("role","textbox"),c.value.ref.setAttribute("aria-autocomplete","list"),c.value.ref.setAttribute("aria-controls","id"),c.value.ref.setAttribute("aria-activedescendant",`${C.value}-item-${g.value}`),h=c.value.ref.hasAttribute("readonly")}),e({highlightedIndex:g,activated:m,loading:w,inputRef:c,popperRef:d,suggestions:p,handleSelect:M,handleKeyEnter:z,focus:G,blur:X,close:H,highlight:V,getData:N}),($,K)=>(s.openBlock(),s.createBlock(s.unref(Pa),{ref_key:"popperRef",ref:d,visible:s.unref(k),placement:$.placement,"fallback-placements":["bottom-start","top-start"],"popper-class":[s.unref(l).e("popper"),$.popperClass],teleported:$.teleported,"gpu-acceleration":!1,pure:"","manual-mode":"",effect:"light",trigger:"click",transition:`${s.unref(l).namespace.value}-zoom-in-top`,persistent:"",role:"listbox",onBeforeShow:S,onHide:T},{content:s.withCtx(()=>[s.createElementVNode("div",{ref_key:"regionRef",ref:u,class:s.normalizeClass([s.unref(l).b("suggestion"),s.unref(l).is("loading",s.unref(E))]),style:s.normalizeStyle({[$.fitInputWidth?"width":"minWidth"]:y.value,outline:"none"}),role:"region"},[s.createVNode(s.unref(Sy),{id:s.unref(C),tag:"ul","wrap-class":s.unref(l).be("suggestion","wrap"),"view-class":s.unref(l).be("suggestion","list"),role:"listbox"},{default:s.withCtx(()=>[s.unref(E)?(s.openBlock(),s.createElementBlock("li",{key:0},[s.renderSlot($.$slots,"loading",{},()=>[s.createVNode(s.unref(it),{class:s.normalizeClass(s.unref(l).is("loading"))},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.Loading))]),_:1},8,["class"])])])):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(p.value,(L,W)=>(s.openBlock(),s.createElementBlock("li",{id:`${s.unref(C)}-item-${W}`,key:W,class:s.normalizeClass({highlighted:g.value===W}),role:"option","aria-selected":g.value===W,onClick:Y=>M(L)},[s.renderSlot($.$slots,"default",{item:L},()=>[s.createTextVNode(s.toDisplayString(L[$.valueKey]),1)])],10,["id","aria-selected","onClick"]))),128))]),_:3},8,["id","wrap-class","view-class"])],6)]),default:s.withCtx(()=>[s.createElementVNode("div",{ref_key:"listboxRef",ref:f,class:s.normalizeClass([s.unref(l).b(),$.$attrs.class]),style:s.normalizeStyle(s.unref(x)),role:"combobox","aria-haspopup":"listbox","aria-expanded":s.unref(k),"aria-owns":s.unref(C)},[s.createVNode(s.unref(Ai),s.mergeProps({ref_key:"inputRef",ref:c},s.unref(a),{clearable:$.clearable,disabled:s.unref(o),name:$.name,"model-value":$.modelValue,"aria-label":$.ariaLabel,onInput:P,onChange:R,onFocus:O,onBlur:F,onClear:A,onKeydown:[s.withKeys(s.withModifiers(L=>V(g.value-1),["prevent"]),["up"]),s.withKeys(s.withModifiers(L=>V(g.value+1),["prevent"]),["down"]),s.withKeys(z,["enter"]),s.withKeys(H,["tab"]),s.withKeys(j,["esc"])],onMousedown:D}),s.createSlots({_:2},[$.$slots.prepend?{name:"prepend",fn:s.withCtx(()=>[s.renderSlot($.$slots,"prepend")])}:void 0,$.$slots.append?{name:"append",fn:s.withCtx(()=>[s.renderSlot($.$slots,"append")])}:void 0,$.$slots.prefix?{name:"prefix",fn:s.withCtx(()=>[s.renderSlot($.$slots,"prefix")])}:void 0,$.$slots.suffix?{name:"suffix",fn:s.withCtx(()=>[s.renderSlot($.$slots,"suffix")])}:void 0]),1040,["clearable","disabled","name","model-value","aria-label","onKeydown"])],14,["aria-expanded","aria-owns"])]),_:3},8,["visible","placement","popper-class","teleported","transition"]))}});var pA=Be(hA,[["__file","autocomplete.vue"]]);const zy=dt(pA),Hy=Symbol("buttonGroupContextKey"),vA=(t,e)=>{Go({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},s.computed(()=>t.type==="text"));const r=s.inject(Hy,void 0),n=ou("button"),{form:a}=Gn(),i=Kn(s.computed(()=>r==null?void 0:r.size)),o=Ia(),l=s.ref(),c=s.useSlots(),u=s.computed(()=>t.type||(r==null?void 0:r.type)||""),d=s.computed(()=>{var p,g,y;return(y=(g=t.autoInsertSpace)!=null?g:(p=n.value)==null?void 0:p.autoInsertSpace)!=null?y:!1}),f=s.computed(()=>t.tag==="button"?{ariaDisabled:o.value||t.loading,disabled:o.value||t.loading,autofocus:t.autofocus,type:t.nativeType}:{}),h=s.computed(()=>{var p;const g=(p=c.default)==null?void 0:p.call(c);if(d.value&&(g==null?void 0:g.length)===1){const y=g[0];if((y==null?void 0:y.type)===s.Text){const m=y.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(m.trim())}}return!1});return{_disabled:o,_size:i,_type:u,_ref:l,_props:f,shouldAddSpace:h,handleClick:p=>{if(o.value||t.loading){p.stopPropagation();return}t.nativeType==="reset"&&(a==null||a.resetFields()),e("click",p)}}},mu=Me({size:Na,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:dn},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:dn,default:()=>Ne.Loading},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"}}),gA={click:t=>t instanceof MouseEvent};function kt(t,e){mA(t)&&(t="100%");var r=yA(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 ns(t){return Math.min(1,Math.max(0,t))}function mA(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function yA(t){return typeof t=="string"&&t.indexOf("%")!==-1}function Ky(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function as(t){return t<=1?"".concat(Number(t)*100,"%"):t}function Un(t){return t.length===1?"0"+t:String(t)}function bA(t,e,r){return{r:kt(t,255)*255,g:kt(e,255)*255,b:kt(r,255)*255}}function Gy(t,e,r){t=kt(t,255),e=kt(e,255),r=kt(r,255);var n=Math.max(t,e,r),a=Math.min(t,e,r),i=0,o=0,l=(n+a)/2;if(n===a)o=0,i=0;else{var c=n-a;switch(o=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:o,l}}function yu(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 wA(t,e,r){var n,a,i;if(t=kt(t,360),e=kt(e,100),r=kt(r,100),e===0)a=r,i=r,n=r;else{var o=r<.5?r*(1+e):r+e-r*e,l=2*r-o;n=yu(l,o,t+1/3),a=yu(l,o,t),i=yu(l,o,t-1/3)}return{r:n*255,g:a*255,b:i*255}}function Uy(t,e,r){t=kt(t,255),e=kt(e,255),r=kt(r,255);var n=Math.max(t,e,r),a=Math.min(t,e,r),i=0,o=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:o}}function CA(t,e,r){t=kt(t,360)*6,e=kt(e,100),r=kt(r,100);var n=Math.floor(t),a=t-n,i=r*(1-e),o=r*(1-a*e),l=r*(1-(1-a)*e),c=n%6,u=[r,o,i,i,l,r][c],d=[l,r,r,o,i,i][c],f=[i,i,l,r,r,o][c];return{r:u*255,g:d*255,b:f*255}}function jy(t,e,r,n){var a=[Un(Math.round(t).toString(16)),Un(Math.round(e).toString(16)),Un(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 EA(t,e,r,n,a){var i=[Un(Math.round(t).toString(16)),Un(Math.round(e).toString(16)),Un(Math.round(r).toString(16)),Un(xA(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 xA(t){return Math.round(parseFloat(t)*255).toString(16)}function Wy(t){return Wt(t)/255}function Wt(t){return parseInt(t,16)}function kA(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var bu={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 SA(t){var e={r:0,g:0,b:0},r=1,n=null,a=null,i=null,o=!1,l=!1;return typeof t=="string"&&(t=NA(t)),typeof t=="object"&&(Wr(t.r)&&Wr(t.g)&&Wr(t.b)?(e=bA(t.r,t.g,t.b),o=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Wr(t.h)&&Wr(t.s)&&Wr(t.v)?(n=as(t.s),a=as(t.v),e=CA(t.h,n,a),o=!0,l="hsv"):Wr(t.h)&&Wr(t.s)&&Wr(t.l)&&(n=as(t.s),i=as(t.l),e=wA(t.h,n,i),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(r=t.a)),r=Ky(r),{ok:o,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 _A="[-\\+]?\\d+%?",TA="[-\\+]?\\d*\\.\\d+%?",pn="(?:".concat(TA,")|(?:").concat(_A,")"),wu="[\\s|\\(]+(".concat(pn,")[,|\\s]+(").concat(pn,")[,|\\s]+(").concat(pn,")\\s*\\)?"),Cu="[\\s|\\(]+(".concat(pn,")[,|\\s]+(").concat(pn,")[,|\\s]+(").concat(pn,")[,|\\s]+(").concat(pn,")\\s*\\)?"),pr={CSS_UNIT:new RegExp(pn),rgb:new RegExp("rgb"+wu),rgba:new RegExp("rgba"+Cu),hsl:new RegExp("hsl"+wu),hsla:new RegExp("hsla"+Cu),hsv:new RegExp("hsv"+wu),hsva:new RegExp("hsva"+Cu),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 NA(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(bu[t])t=bu[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=pr.rgb.exec(t);return r?{r:r[1],g:r[2],b:r[3]}:(r=pr.rgba.exec(t),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=pr.hsl.exec(t),r?{h:r[1],s:r[2],l:r[3]}:(r=pr.hsla.exec(t),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=pr.hsv.exec(t),r?{h:r[1],s:r[2],v:r[3]}:(r=pr.hsva.exec(t),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=pr.hex8.exec(t),r?{r:Wt(r[1]),g:Wt(r[2]),b:Wt(r[3]),a:Wy(r[4]),format:e?"name":"hex8"}:(r=pr.hex6.exec(t),r?{r:Wt(r[1]),g:Wt(r[2]),b:Wt(r[3]),format:e?"name":"hex"}:(r=pr.hex4.exec(t),r?{r:Wt(r[1]+r[1]),g:Wt(r[2]+r[2]),b:Wt(r[3]+r[3]),a:Wy(r[4]+r[4]),format:e?"name":"hex8"}:(r=pr.hex3.exec(t),r?{r:Wt(r[1]+r[1]),g:Wt(r[2]+r[2]),b:Wt(r[3]+r[3]),format:e?"name":"hex"}:!1)))))))))}function Wr(t){return!!pr.CSS_UNIT.exec(String(t))}var IA=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=kA(e)),this.originalInput=e;var a=SA(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,o=e.g/255,l=e.b/255;return i<=.03928?r=i/12.92:r=Math.pow((i+.055)/1.055,2.4),o<=.03928?n=o/12.92:n=Math.pow((o+.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=Ky(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=Uy(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=Uy(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=Gy(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=Gy(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),jy(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),EA(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(kt(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(kt(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="#"+jy(this.r,this.g,this.b,!1),r=0,n=Object.entries(bu);r<n.length;r++){var a=n[r],i=a[0],o=a[1];if(e===o)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=ns(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=ns(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=ns(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=ns(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,o={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(o)},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,o=[],l=1/e;e--;)o.push(new t({h:n,s:a,v:i})),i=(i+l)%1;return o},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,o=1;o<e;o++)a.push(new t({h:(n+o*i)%360,s:r.s,l:r.l}));return a},t.prototype.equals=function(e){return this.toRgbString()===new t(e).toRgbString()},t}();function vn(t,e=20){return t.mix("#141414",e).toString()}function BA(t){const e=Ia(),r=De("button");return s.computed(()=>{let n={},a=t.color;if(a){const i=a.match(/var\((.*?)\)/);i&&(a=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const o=new IA(a),l=t.dark?o.tint(20).toString():vn(o,20);if(t.plain)n=r.cssVarBlock({"bg-color":t.dark?vn(o,90):o.tint(90).toString(),"text-color":a,"border-color":t.dark?vn(o,50):o.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?vn(o,90):o.tint(90).toString(),n[r.cssVarBlockName("disabled-text-color")]=t.dark?vn(o,50):o.tint(50).toString(),n[r.cssVarBlockName("disabled-border-color")]=t.dark?vn(o,80):o.tint(80).toString());else{const c=t.dark?vn(o,30):o.tint(30).toString(),u=o.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?vn(o,50):o.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 DA=s.defineComponent({name:"ElButton"}),PA=s.defineComponent({...DA,props:mu,emits:gA,setup(t,{expose:e,emit:r}){const n=t,a=BA(n),i=De("button"),{_ref:o,_size:l,_type:c,_disabled:u,_props:d,shouldAddSpace:f,handleClick:h}=vA(n,r),v=s.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:o,size:l,type:c,disabled:u,shouldAddSpace:f}),(p,g)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(p.tag),s.mergeProps({ref_key:"_ref",ref:o},s.unref(d),{class:s.unref(v),style:s.unref(a),onClick:s.unref(h)}),{default:s.withCtx(()=>[p.loading?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[p.$slots.loading?s.renderSlot(p.$slots,"loading",{key:0}):(s.openBlock(),s.createBlock(s.unref(it),{key:1,class:s.normalizeClass(s.unref(i).is("loading"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(p.loadingIcon)))]),_:1},8,["class"]))],64)):p.icon||p.$slots.icon?(s.openBlock(),s.createBlock(s.unref(it),{key:1},{default:s.withCtx(()=>[p.icon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(p.icon),{key:0})):s.renderSlot(p.$slots,"icon",{key:1})]),_:3})):s.createCommentVNode("v-if",!0),p.$slots.default?(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass({[s.unref(i).em("text","expand")]:s.unref(f)})},[s.renderSlot(p.$slots,"default")],2)):s.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var OA=Be(PA,[["__file","button.vue"]]);const AA={size:mu.size,type:mu.type},RA=s.defineComponent({name:"ElButtonGroup"}),LA=s.defineComponent({...RA,props:AA,setup(t){const e=t;s.provide(Hy,s.reactive({size:s.toRef(e,"size"),type:s.toRef(e,"type")}));const r=De("button");return(n,a)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(s.unref(r).b("group"))},[s.renderSlot(n.$slots,"default")],2))}});var Yy=Be(LA,[["__file","button-group.vue"]]);const Ht=dt(OA,{ButtonGroup:Yy});Gr(Yy);var Li=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function FA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}const gn=new Map;if(nt){let t;document.addEventListener("mousedown",e=>t=e),document.addEventListener("mouseup",e=>{if(t){for(const r of gn.values())for(const{documentHandler:n}of r)n(e,t);t=void 0}})}function Zy(t,e){let r=[];return Array.isArray(e.arg)?r=e.arg:Vn(e.arg)&&r.push(e.arg),function(n,a){const i=e.instance.popperRef,o=n.target,l=a==null?void 0:a.target,c=!e||!e.instance,u=!o||!l,d=t.contains(o)||t.contains(l),f=t===o,h=r.length&&r.some(p=>p==null?void 0:p.contains(o))||r.length&&r.includes(l),v=i&&(i.contains(o)||i.contains(l));c||u||d||f||h||v||e.value(n,a)}}const Xy={beforeMount(t,e){gn.has(t)||gn.set(t,[]),gn.get(t).push({documentHandler:Zy(t,e),bindingFn:e.value})},updated(t,e){gn.has(t)||gn.set(t,[]);const r=gn.get(t),n=r.findIndex(i=>i.bindingFn===e.oldValue),a={documentHandler:Zy(t,e),bindingFn:e.value};n>=0?r.splice(n,1,a):r.push(a)},unmounted(t){gn.delete(t)}},MA=Me({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"}}),$A=s.defineComponent({name:"ElCard"}),VA=s.defineComponent({...$A,props:MA,setup(t){const e=De("card");return(r,n)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([s.unref(e).b(),s.unref(e).is(`${r.shadow}-shadow`)])},[r.$slots.header||r.header?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(e).e("header"))},[s.renderSlot(r.$slots,"header",{},()=>[s.createTextVNode(s.toDisplayString(r.header),1)])],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass([s.unref(e).e("body"),r.bodyClass]),style:s.normalizeStyle(r.bodyStyle)},[s.renderSlot(r.$slots,"default")],6),r.$slots.footer||r.footer?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(s.unref(e).e("footer"))},[s.renderSlot(r.$slots,"footer",{},()=>[s.createTextVNode(s.toDisplayString(r.footer),1)])],2)):s.createCommentVNode("v-if",!0)],2))}});var qA=Be(VA,[["__file","card.vue"]]);const zA=dt(qA),Jy={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:Na,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...jr(["ariaControls"])},Qy={[et]:t=>ct(t)||xt(t)||ba(t),change:t=>ct(t)||xt(t)||ba(t)},Oa=Symbol("checkboxGroupContextKey"),HA=({model:t,isChecked:e})=>{const r=s.inject(Oa,void 0),n=s.computed(()=>{var i,o;const l=(i=r==null?void 0:r.max)==null?void 0:i.value,c=(o=r==null?void 0:r.min)==null?void 0:o.value;return!cn(l)&&t.value.length>=l&&!e.value||!cn(c)&&t.value.length<=c&&e.value});return{isDisabled:Ia(s.computed(()=>(r==null?void 0:r.disabled.value)||n.value)),isLimitDisabled:n}},KA=(t,{model:e,isLimitExceeded:r,hasOwnLabel:n,isDisabled:a,isLabeledByFormItem:i})=>{const o=s.inject(Oa,void 0),{formItem:l}=Gn(),{emit:c}=s.getCurrentInstance();function u(p){var g,y,m,b;return[!0,t.trueValue,t.trueLabel].includes(p)?(y=(g=t.trueValue)!=null?g:t.trueLabel)!=null?y:!0:(b=(m=t.falseValue)!=null?m:t.falseLabel)!=null?b:!1}function d(p,g){c("change",u(p),g)}function f(p){if(r.value)return;const g=p.target;c("change",u(g.checked),p)}async function h(p){r.value||!n.value&&!a.value&&i.value&&(p.composedPath().some(m=>m.tagName==="LABEL")||(e.value=u([!1,t.falseValue,t.falseLabel].includes(e.value)),await s.nextTick(),d(e.value,p)))}const v=s.computed(()=>(o==null?void 0:o.validateEvent)||t.validateEvent);return s.watch(()=>t.modelValue,()=>{v.value&&(l==null||l.validate("change").catch(p=>at(p)))}),{handleChange:f,onClickRoot:h}},GA=t=>{const e=s.ref(!1),{emit:r}=s.getCurrentInstance(),n=s.inject(Oa,void 0),a=s.computed(()=>cn(n)===!1),i=s.ref(!1),o=s.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&&Et(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>o.value.length,i.value===!1&&((u=n==null?void 0:n.changeEvent)==null||u.call(n,l))):(r(et,l),e.value=l)}});return{model:o,isGroup:a,isLimitExceeded:i}},UA=(t,e,{model:r})=>{const n=s.inject(Oa,void 0),a=s.ref(!1),i=s.computed(()=>Ho(t.value)?t.label:t.value),o=s.computed(()=>{const d=r.value;return ba(d)?d:Et(d)?yt(i.value)?d.map(s.toRaw).some(f=>zo(f,i.value)):d.map(s.toRaw).includes(i.value):d!=null?d===t.trueValue||d===t.trueLabel:!!d}),l=Kn(s.computed(()=>{var d;return(d=n==null?void 0:n.size)==null?void 0:d.value}),{prop:!0}),c=Kn(s.computed(()=>{var d;return(d=n==null?void 0:n.size)==null?void 0:d.value})),u=s.computed(()=>!!e.default||!Ho(i.value));return{checkboxButtonSize:l,isChecked:o,isFocused:a,checkboxSize:c,hasOwnLabel:u,actualValue:i}},e0=(t,e)=>{const{formItem:r}=Gn(),{model:n,isGroup:a,isLimitExceeded:i}=GA(t),{isFocused:o,isChecked:l,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,actualValue:f}=UA(t,e,{model:n}),{isDisabled:h}=HA({model:n,isChecked:l}),{inputId:v,isLabeledByFormItem:p}=Oi(t,{formItemContext:r,disableIdGeneration:d,disableIdManagement:a}),{handleChange:g,onClickRoot:y}=KA(t,{model:n,isLimitExceeded:i,hasOwnLabel:d,isDisabled:h,isLabeledByFormItem:p});return(()=>{function b(){var w,C;Et(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()})(),Go({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>a.value&&Ho(t.value))),Go({from:"true-label",replacement:"true-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>!!t.trueLabel)),Go({from:"false-label",replacement:"false-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>!!t.falseLabel)),{inputId:v,isLabeledByFormItem:p,isChecked:l,isDisabled:h,isFocused:o,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,model:n,actualValue:f,handleChange:g,onClickRoot:y}},jA=s.defineComponent({name:"ElCheckbox"}),WA=s.defineComponent({...jA,props:Jy,emits:Qy,setup(t){const e=t,r=s.useSlots(),{inputId:n,isLabeledByFormItem:a,isChecked:i,isDisabled:o,isFocused:l,checkboxSize:c,hasOwnLabel:u,model:d,actualValue:f,handleChange:h,onClickRoot:v}=e0(e,r),p=De("checkbox"),g=s.computed(()=>[p.b(),p.m(c.value),p.is("disabled",o.value),p.is("bordered",e.border),p.is("checked",i.value)]),y=s.computed(()=>[p.e("input"),p.is("disabled",o.value),p.is("checked",i.value),p.is("indeterminate",e.indeterminate),p.is("focus",l.value)]);return(m,b)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(!s.unref(u)&&s.unref(a)?"span":"label"),{class:s.normalizeClass(s.unref(g)),"aria-controls":m.indeterminate?m.ariaControls:null,onClick:s.unref(v)},{default:s.withCtx(()=>{var w,C,x,k;return[s.createElementVNode("span",{class:s.normalizeClass(s.unref(y))},[m.trueValue||m.falseValue||m.trueLabel||m.falseLabel?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,id:s.unref(n),"onUpdate:modelValue":E=>s.isRef(d)?d.value=E:null,class:s.normalizeClass(s.unref(p).e("original")),type:"checkbox",indeterminate:m.indeterminate,name:m.name,tabindex:m.tabindex,disabled:s.unref(o),"true-value":(C=(w=m.trueValue)!=null?w:m.trueLabel)!=null?C:!0,"false-value":(k=(x=m.falseValue)!=null?x:m.falseLabel)!=null?k:!1,onChange:s.unref(h),onFocus:E=>l.value=!0,onBlur:E=>l.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(d)]]):s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:1,id:s.unref(n),"onUpdate:modelValue":E=>s.isRef(d)?d.value=E:null,class:s.normalizeClass(s.unref(p).e("original")),type:"checkbox",indeterminate:m.indeterminate,disabled:s.unref(o),value:s.unref(f),name:m.name,tabindex:m.tabindex,onChange:s.unref(h),onFocus:E=>l.value=!0,onBlur:E=>l.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","disabled","value","name","tabindex","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(d)]]),s.createElementVNode("span",{class:s.normalizeClass(s.unref(p).e("inner"))},null,2)],2),s.unref(u)?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(p).e("label"))},[s.renderSlot(m.$slots,"default"),m.$slots.default?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(m.label),1)],64))],2)):s.createCommentVNode("v-if",!0)]}),_:3},8,["class","aria-controls","onClick"]))}});var YA=Be(WA,[["__file","checkbox.vue"]]);const ZA=s.defineComponent({name:"ElCheckboxButton"}),XA=s.defineComponent({...ZA,props:Jy,emits:Qy,setup(t){const e=t,r=s.useSlots(),{isFocused:n,isChecked:a,isDisabled:i,checkboxButtonSize:o,model:l,actualValue:c,handleChange:u}=e0(e,r),d=s.inject(Oa,void 0),f=De("checkbox"),h=s.computed(()=>{var p,g,y,m;const b=(g=(p=d==null?void 0:d.fill)==null?void 0:p.value)!=null?g:"";return{backgroundColor:b,borderColor:b,color:(m=(y=d==null?void 0:d.textColor)==null?void 0:y.value)!=null?m:"",boxShadow:b?`-1px 0 0 0 ${b}`:void 0}}),v=s.computed(()=>[f.b("button"),f.bm("button",o.value),f.is("disabled",i.value),f.is("checked",a.value),f.is("focus",n.value)]);return(p,g)=>{var y,m,b,w;return s.openBlock(),s.createElementBlock("label",{class:s.normalizeClass(s.unref(v))},[p.trueValue||p.falseValue||p.trueLabel||p.falseLabel?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,"onUpdate:modelValue":C=>s.isRef(l)?l.value=C:null,class:s.normalizeClass(s.unref(f).be("button","original")),type:"checkbox",name:p.name,tabindex:p.tabindex,disabled:s.unref(i),"true-value":(m=(y=p.trueValue)!=null?y:p.trueLabel)!=null?m:!0,"false-value":(w=(b=p.falseValue)!=null?b:p.falseLabel)!=null?w:!1,onChange:s.unref(u),onFocus:C=>n.value=!0,onBlur:C=>n.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(l)]]):s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:1,"onUpdate:modelValue":C=>s.isRef(l)?l.value=C:null,class:s.normalizeClass(s.unref(f).be("button","original")),type:"checkbox",name:p.name,tabindex:p.tabindex,disabled:s.unref(i),value:s.unref(c),onChange:s.unref(u),onFocus:C=>n.value=!0,onBlur:C=>n.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(l)]]),p.$slots.default||p.label?(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass(s.unref(f).be("button","inner")),style:s.normalizeStyle(s.unref(a)?s.unref(h):void 0)},[s.renderSlot(p.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(p.label),1)])],6)):s.createCommentVNode("v-if",!0)],2)}}});var t0=Be(XA,[["__file","checkbox-button.vue"]]);const JA=Me({modelValue:{type:ke(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:Na,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...jr(["ariaLabel"])}),QA={[et]:t=>Et(t),change:t=>Et(t)},eR=s.defineComponent({name:"ElCheckboxGroup"}),tR=s.defineComponent({...eR,props:JA,emits:QA,setup(t,{emit:e}){const r=t,n=De("checkbox"),{formItem:a}=Gn(),{inputId:i,isLabeledByFormItem:o}=Oi(r,{formItemContext:a}),l=async u=>{e(et,u),await s.nextTick(),e("change",u)},c=s.computed({get(){return r.modelValue},set(u){l(u)}});return s.provide(Oa,{...Im(s.toRefs(r),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:c,changeEvent:l}),s.watch(()=>r.modelValue,()=>{r.validateEvent&&(a==null||a.validate("change").catch(u=>at(u)))}),(u,d)=>{var f;return s.openBlock(),s.createBlock(s.resolveDynamicComponent(u.tag),{id:s.unref(i),class:s.normalizeClass(s.unref(n).b("group")),role:"group","aria-label":s.unref(o)?void 0:u.ariaLabel||"checkbox-group","aria-labelledby":s.unref(o)?(f=s.unref(a))==null?void 0:f.labelId:void 0},{default:s.withCtx(()=>[s.renderSlot(u.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var r0=Be(tR,[["__file","checkbox-group.vue"]]);const rR=dt(YA,{CheckboxButton:t0,CheckboxGroup:r0});Gr(t0),Gr(r0);const Eu=Me({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Lm},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),nR={close:t=>t instanceof MouseEvent,click:t=>t instanceof MouseEvent},aR=s.defineComponent({name:"ElTag"}),iR=s.defineComponent({...aR,props:Eu,emits:nR,setup(t,{emit:e}){const r=t,n=Kn(),a=De("tag"),i=s.computed(()=>{const{type:u,hit:d,effect:f,closable:h,round:v}=r;return[a.b(),a.is("closable",h),a.m(u||"primary"),a.m(n.value),a.m(f),a.is("hit",d),a.is("round",v)]}),o=u=>{e("close",u)},l=u=>{e("click",u)},c=u=>{u.component.subTree.component.bum=null};return(u,d)=>u.disableTransitions?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(i)),style:s.normalizeStyle({backgroundColor:u.color}),onClick:l},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(a).e("content"))},[s.renderSlot(u.$slots,"default")],2),u.closable?(s.openBlock(),s.createBlock(s.unref(it),{key:0,class:s.normalizeClass(s.unref(a).e("close")),onClick:s.withModifiers(o,["stop"])},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.Close))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0)],6)):(s.openBlock(),s.createBlock(s.Transition,{key:1,name:`${s.unref(a).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:c},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(s.unref(i)),style:s.normalizeStyle({backgroundColor:u.color}),onClick:l},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(a).e("content"))},[s.renderSlot(u.$slots,"default")],2),u.closable?(s.openBlock(),s.createBlock(s.unref(it),{key:0,class:s.normalizeClass(s.unref(a).e("close")),onClick:s.withModifiers(o,["stop"])},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.Close))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var oR=Be(iR,[["__file","tag.vue"]]);const sR=dt(oR),n0=Symbol("rowContextKey"),lR=Me({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"]}}),uR=s.defineComponent({name:"ElRow"}),cR=s.defineComponent({...uR,props:lR,setup(t){const e=t,r=De("row"),n=s.computed(()=>e.gutter);s.provide(n0,{gutter:n});const a=s.computed(()=>{const o={};return e.gutter&&(o.marginRight=o.marginLeft=`-${e.gutter/2}px`),o}),i=s.computed(()=>[r.b(),r.is(`justify-${e.justify}`,e.justify!=="start"),r.is(`align-${e.align}`,!!e.align)]);return(o,l)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o.tag),{class:s.normalizeClass(s.unref(i)),style:s.normalizeStyle(s.unref(a))},{default:s.withCtx(()=>[s.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var dR=Be(cR,[["__file","row.vue"]]);const is=dt(dR),fR=Me({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:()=>Ca({})},sm:{type:ke([Number,Object]),default:()=>Ca({})},md:{type:ke([Number,Object]),default:()=>Ca({})},lg:{type:ke([Number,Object]),default:()=>Ca({})},xl:{type:ke([Number,Object]),default:()=>Ca({})}}),hR=s.defineComponent({name:"ElCol"}),pR=s.defineComponent({...hR,props:fR,setup(t){const e=t,{gutter:r}=s.inject(n0,{gutter:s.computed(()=>0)}),n=De("col"),a=s.computed(()=>{const o={};return r.value&&(o.paddingLeft=o.paddingRight=`${r.value/2}px`),o}),i=s.computed(()=>{const o=[];return["span","offset","pull","push"].forEach(u=>{const d=e[u];xt(d)&&(u==="span"?o.push(n.b(`${e[u]}`)):d>0&&o.push(n.b(`${u}-${e[u]}`)))}),["xs","sm","md","lg","xl"].forEach(u=>{xt(e[u])?o.push(n.b(`${u}-${e[u]}`)):yt(e[u])&&Object.entries(e[u]).forEach(([d,f])=>{o.push(d!=="span"?n.b(`${u}-${d}-${f}`):n.b(`${u}-${f}`))})}),r.value&&o.push(n.is("guttered")),[n.b(),o]});return(o,l)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o.tag),{class:s.normalizeClass(s.unref(i)),style:s.normalizeStyle(s.unref(a))},{default:s.withCtx(()=>[s.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var vR=Be(pR,[["__file","col.vue"]]);const Fi=dt(vR),gR=s.defineComponent({name:"ElCollapseTransition"}),mR=s.defineComponent({...gR,setup(t){const e=De("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)=>(s.openBlock(),s.createBlock(s.Transition,s.mergeProps({name:s.unref(e).b()},s.toHandlers(n)),{default:s.withCtx(()=>[s.renderSlot(a.$slots,"default")]),_:3},16,["name"]))}});var yR=Be(mR,[["__file","collapse-transition.vue"]]);const bR=dt(yR),wR=Me({color:{type:ke(Object),required:!0},vertical:{type:Boolean,default:!1}});let xu=!1;function Mi(t,e){if(!nt)return;const r=function(i){var o;(o=e.drag)==null||o.call(e,i)},n=function(i){var o;document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",n),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",n),document.onselectstart=null,document.ondragstart=null,xu=!1,(o=e.end)==null||o.call(e,i)},a=function(i){var o;xu||(i.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",r),document.addEventListener("mouseup",n),document.addEventListener("touchmove",r),document.addEventListener("touchend",n),xu=!0,(o=e.start)==null||o.call(e,i))};t.addEventListener("mousedown",a),t.addEventListener("touchstart",a,{passive:!1})}const CR=t=>{const e=s.getCurrentInstance(),{t:r}=xi(),n=s.shallowRef(),a=s.shallowRef(),i=s.computed(()=>t.color.get("alpha")),o=s.computed(()=>r("el.colorpicker.alphaLabel"));function l(f){var h;f.target!==n.value&&c(f),(h=n.value)==null||h.focus()}function c(f){if(!a.value||!n.value)return;const v=e.vnode.el.getBoundingClientRect(),{clientX:p,clientY:g}=Tl(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=p-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:h,shiftKey:v}=f,p=v?10:1;switch(h){case ft.left:case ft.down:f.preventDefault(),f.stopPropagation(),d(-p);break;case ft.right:case ft.up:f.preventDefault(),f.stopPropagation(),d(p);break}}function d(f){let h=i.value+f;h=h<0?0:h>100?100:h,t.color.set("alpha",h)}return{thumb:n,bar:a,alpha:i,alphaLabel:o,handleDrag:c,handleClick:l,handleKeydown:u}},ER=(t,{bar:e,thumb:r,handleDrag:n})=>{const a=s.getCurrentInstance(),i=De("color-alpha-slider"),o=s.ref(0),l=s.ref(0),c=s.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 h(){o.value=u(),l.value=d(),c.value=f()}s.onMounted(()=>{if(!e.value||!r.value)return;const b={drag:w=>{n(w)},end:w=>{n(w)}};Mi(e.value,b),Mi(r.value,b),h()}),s.watch(()=>t.color.get("alpha"),()=>h()),s.watch(()=>t.color.value,()=>h());const v=s.computed(()=>[i.b(),i.is("vertical",t.vertical)]),p=s.computed(()=>i.e("bar")),g=s.computed(()=>i.e("thumb")),y=s.computed(()=>({background:c.value})),m=s.computed(()=>({left:wa(o.value),top:wa(l.value)}));return{rootKls:v,barKls:p,barStyle:y,thumbKls:g,thumbStyle:m,update:h}},xR=s.defineComponent({name:"ElColorAlphaSlider"}),kR=s.defineComponent({...xR,props:wR,setup(t,{expose:e}){const r=t,{alpha:n,alphaLabel:a,bar:i,thumb:o,handleDrag:l,handleClick:c,handleKeydown:u}=CR(r),{rootKls:d,barKls:f,barStyle:h,thumbKls:v,thumbStyle:p,update:g}=ER(r,{bar:i,thumb:o,handleDrag:l});return e({update:g,bar:i,thumb:o}),(y,m)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(s.unref(d))},[s.createElementVNode("div",{ref_key:"bar",ref:i,class:s.normalizeClass(s.unref(f)),style:s.normalizeStyle(s.unref(h)),onClick:s.unref(c)},null,14,["onClick"]),s.createElementVNode("div",{ref_key:"thumb",ref:o,class:s.normalizeClass(s.unref(v)),style:s.normalizeStyle(s.unref(p)),"aria-label":s.unref(a),"aria-valuenow":s.unref(n),"aria-orientation":y.vertical?"vertical":"horizontal","aria-valuemin":"0","aria-valuemax":"100",role:"slider",tabindex:"0",onKeydown:s.unref(u)},null,46,["aria-label","aria-valuenow","aria-orientation","onKeydown"])],2))}});var SR=Be(kR,[["__file","alpha-slider.vue"]]);const _R=s.defineComponent({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(t){const e=De("color-hue-slider"),r=s.getCurrentInstance(),n=s.ref(),a=s.ref(),i=s.ref(0),o=s.ref(0),l=s.computed(()=>t.color.get("hue"));s.watch(()=>l.value,()=>{h()});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}=Tl(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 p=t.color.get("hue");return v?Math.round(p*(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 p=t.color.get("hue");return v?Math.round(p*(v.offsetHeight-n.value.offsetHeight/2)/360):0}function h(){i.value=d(),o.value=f()}return s.onMounted(()=>{if(!a.value||!n.value)return;const v={drag:p=>{u(p)},end:p=>{u(p)}};Mi(a.value,v),Mi(n.value,v),h()}),{bar:a,thumb:n,thumbLeft:i,thumbTop:o,hueValue:l,handleClick:c,update:h,ns:e}}});function TR(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([t.ns.b(),t.ns.is("vertical",t.vertical)])},[s.createElementVNode("div",{ref:"bar",class:s.normalizeClass(t.ns.e("bar")),onClick:t.handleClick},null,10,["onClick"]),s.createElementVNode("div",{ref:"thumb",class:s.normalizeClass(t.ns.e("thumb")),style:s.normalizeStyle({left:t.thumbLeft+"px",top:t.thumbTop+"px"})},null,6)],2)}var NR=Be(_R,[["render",TR],["__file","hue-slider.vue"]]);const IR=Me({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:Na,popperClass:{type:String,default:""},tabindex:{type:[String,Number],default:0},teleported:$t.teleported,predefine:{type:ke(Array)},validateEvent:{type:Boolean,default:!0},...jr(["ariaLabel"])}),BR={[et]:t=>ct(t)||un(t),[Ei]:t=>ct(t)||un(t),activeChange:t=>ct(t)||un(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent},a0=Symbol("colorPickerContextKey"),i0=function(t,e,r){return[t,e*r/((t=(2-e)*r)<1?t:2-t)||0,t/2]},DR=function(t){return typeof t=="string"&&t.includes(".")&&Number.parseFloat(t)===1},PR=function(t){return typeof t=="string"&&t.includes("%")},Aa=function(t,e){DR(t)&&(t="100%");const r=PR(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)},o0={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},os=t=>{t=Math.min(Math.round(t),255);const e=Math.floor(t/16),r=t%16;return`${o0[e]||e}${o0[r]||r}`},s0=function({r:t,g:e,b:r}){return Number.isNaN(+t)||Number.isNaN(+e)||Number.isNaN(+r)?"":`#${os(t)}${os(e)}${os(r)}`},ku={A:10,B:11,C:12,D:13,E:14,F:15},jn=function(t){return t.length===2?(ku[t[0].toUpperCase()]||+t[0])*16+(ku[t[1].toUpperCase()]||+t[1]):ku[t[1].toUpperCase()]||+t[1]},OR=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,o=r===0?2*n/(a+n):2*e/(r+e);return{h:t,s:o*100,v:i*100}},l0=(t,e,r)=>{t=Aa(t,255),e=Aa(e,255),r=Aa(r,255);const n=Math.max(t,e,r),a=Math.min(t,e,r);let i;const o=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:o*100}},$i=function(t,e,r){t=Aa(t,360)*6,e=Aa(e,100),r=Aa(r,100);const n=Math.floor(t),a=t-n,i=r*(1-e),o=r*(1-a*e),l=r*(1-(1-a)*e),c=n%6,u=[r,o,i,i,l,r][c],d=[l,r,r,o,i,i][c],f=[i,i,l,r,r,o][c];return{r:Math.round(u*255),g:Math.round(d*255),b:Math.round(f*255)}};class Vi{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)Ln(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)Ln(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 $i(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:o}=OR(n[0],n[1],n[2]);r(a,i,o)}}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:o}=l0(n[0],n[1],n[2]);r(a,i,o)}}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,o;n.length===3?(a=jn(n[0]+n[0]),i=jn(n[1]+n[1]),o=jn(n[2]+n[2])):(n.length===6||n.length===8)&&(a=jn(n.slice(0,2)),i=jn(n.slice(2,4)),o=jn(n.slice(4,6))),n.length===8?this._alpha=jn(n.slice(6))/255*100:(n.length===3||n.length===6)&&(this._alpha=100);const{h:l,s:c,v:u}=l0(a,i,o);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 o=i0(e,r/100,n/100);this.value=`hsla(${e}, ${Math.round(o[1]*100)}%, ${Math.round(o[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=`${s0($i(e,r,n))}${os(a*255/100)}`;break}default:{const{r:o,g:l,b:c}=$i(e,r,n);this.value=`rgba(${o}, ${l}, ${c}, ${this.get("alpha")/100})`}}else switch(i){case"hsl":{const o=i0(e,r/100,n/100);this.value=`hsl(${e}, ${Math.round(o[1]*100)}%, ${Math.round(o[2]*100)}%)`;break}case"hsv":{this.value=`hsv(${e}, ${Math.round(r)}%, ${Math.round(n)}%)`;break}case"rgb":{const{r:o,g:l,b:c}=$i(e,r,n);this.value=`rgb(${o}, ${l}, ${c})`;break}default:this.value=s0($i(e,r,n))}}}const AR=s.defineComponent({props:{colors:{type:Array,required:!0},color:{type:Object,required:!0},enableAlpha:{type:Boolean,required:!0}},setup(t){const e=De("color-predefine"),{currentColor:r}=s.inject(a0),n=s.ref(i(t.colors,t.color));s.watch(()=>r.value,o=>{const l=new Vi;l.fromString(o),n.value.forEach(c=>{c.selected=l.compare(c)})}),s.watchEffect(()=>{n.value=i(t.colors,t.color)});function a(o){t.color.fromString(t.colors[o])}function i(o,l){return o.map(c=>{const u=new Vi;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 RR(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(t.ns.b())},[s.createElementVNode("div",{class:s.normalizeClass(t.ns.e("colors"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.rgbaColors,(o,l)=>(s.openBlock(),s.createElementBlock("div",{key:t.colors[l],class:s.normalizeClass([t.ns.e("color-selector"),t.ns.is("alpha",o._alpha<100),{selected:o.selected}]),onClick:c=>t.handleSelect(l)},[s.createElementVNode("div",{style:s.normalizeStyle({backgroundColor:o.value})},null,4)],10,["onClick"]))),128))],2)],2)}var LR=Be(AR,[["render",RR],["__file","predefine.vue"]]);const FR=s.defineComponent({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(t){const e=De("color-svpanel"),r=s.getCurrentInstance(),n=s.ref(0),a=s.ref(0),i=s.ref("hsl(0, 100%, 50%)"),o=s.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:h,clientHeight:v}=f;a.value=u*h/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:h,clientY:v}=Tl(u);let p=h-f.left,g=v-f.top;p=Math.max(0,p),p=Math.min(p,f.width),g=Math.max(0,g),g=Math.min(g,f.height),a.value=p,n.value=g,t.color.set({saturation:p/f.width*100,value:100-g/f.height*100})}return s.watch(()=>o.value,()=>{l()}),s.onMounted(()=>{Mi(r.vnode.el,{drag:u=>{c(u)},end:u=>{c(u)}}),l()}),{cursorTop:n,cursorLeft:a,background:i,colorValue:o,handleDrag:c,update:l,ns:e}}});function MR(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(t.ns.b()),style:s.normalizeStyle({backgroundColor:t.background})},[s.createElementVNode("div",{class:s.normalizeClass(t.ns.e("white"))},null,2),s.createElementVNode("div",{class:s.normalizeClass(t.ns.e("black"))},null,2),s.createElementVNode("div",{class:s.normalizeClass(t.ns.e("cursor")),style:s.normalizeStyle({top:t.cursorTop+"px",left:t.cursorLeft+"px"})},[s.createElementVNode("div")],6)],6)}var $R=Be(FR,[["render",MR],["__file","sv-panel.vue"]]);const VR=s.defineComponent({name:"ElColorPicker"}),qR=s.defineComponent({...VR,props:IR,emits:BR,setup(t,{expose:e,emit:r}){const n=t,{t:a}=xi(),i=De("color"),{formItem:o}=Gn(),l=Kn(),c=Ia(),{inputId:u,isLabeledByFormItem:d}=Oi(n,{formItemContext:o}),f=s.ref(),h=s.ref(),v=s.ref(),p=s.ref(),g=s.ref(),y=s.ref(),{isFocused:m,handleFocus:b,handleBlur:w}=iu(g,{beforeFocus(){return c.value},beforeBlur(L){var W;return(W=p.value)==null?void 0:W.isFocusInsideContent(L)},afterBlur(){R(!1),z()}});let C=!0;const x=s.reactive(new Vi({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue})),k=s.ref(!1),E=s.ref(!1),_=s.ref(""),S=s.computed(()=>!n.modelValue&&!E.value?"transparent":D(x,n.showAlpha)),T=s.computed(()=>!n.modelValue&&!E.value?"":x.value),N=s.computed(()=>d.value?void 0:n.ariaLabel||a("el.colorpicker.defaultLabel")),B=s.computed(()=>d.value?o==null?void 0:o.labelId:void 0),P=s.computed(()=>[i.b("picker"),i.is("disabled",c.value),i.bm("picker",l.value),i.is("focused",m.value)]);function D(L,W){if(!(L instanceof Vi))throw new TypeError("color should be instance of _color Class");const{r:Y,g:se,b:ue}=L.toRgb();return W?`rgba(${Y}, ${se}, ${ue}, ${L.get("alpha")/100})`:`rgb(${Y}, ${se}, ${ue})`}function R(L){k.value=L}const O=Gl(R,100,{leading:!0});function F(){c.value||R(!0)}function A(){O(!1),z()}function z(){s.nextTick(()=>{n.modelValue?x.fromString(n.modelValue):(x.value="",s.nextTick(()=>{E.value=!1}))})}function j(){c.value||O(!k.value)}function H(){x.fromString(_.value)}function G(){const L=x.value;r(et,L),r("change",L),n.validateEvent&&(o==null||o.validate("change").catch(W=>at(W))),O(!1),s.nextTick(()=>{const W=new Vi({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue});x.compare(W)||z()})}function X(){O(!1),r(et,null),r("change",null),n.modelValue!==null&&n.validateEvent&&(o==null||o.validate("change").catch(L=>at(L))),z()}function M(){k.value&&(A(),m.value&&$())}function V(L){L.preventDefault(),L.stopPropagation(),R(!1),z()}function q(L){switch(L.code){case ft.enter:case ft.space:L.preventDefault(),L.stopPropagation(),F(),y.value.focus();break;case ft.esc:V(L);break}}function $(){g.value.focus()}function K(){g.value.blur()}return s.onMounted(()=>{n.modelValue&&(_.value=T.value)}),s.watch(()=>n.modelValue,L=>{L?L&&L!==x.value&&(C=!1,x.fromString(L)):E.value=!1}),s.watch(()=>[n.colorFormat,n.showAlpha],()=>{x.enableAlpha=n.showAlpha,x.format=n.colorFormat||x.format,x.doOnChange(),r(et,x.value)}),s.watch(()=>T.value,L=>{_.value=L,C&&r("activeChange",L),C=!0}),s.watch(()=>x.value,()=>{!n.modelValue&&!E.value&&(E.value=!0)}),s.watch(()=>k.value,()=>{s.nextTick(()=>{var L,W,Y;(L=f.value)==null||L.update(),(W=h.value)==null||W.update(),(Y=v.value)==null||Y.update()})}),s.provide(a0,{currentColor:T}),e({color:x,show:F,hide:A,focus:$,blur:K}),(L,W)=>(s.openBlock(),s.createBlock(s.unref(Pa),{ref_key:"popper",ref:p,visible:k.value,"show-arrow":!1,"fallback-placements":["bottom","top","right","left"],offset:0,"gpu-acceleration":!1,"popper-class":[s.unref(i).be("picker","panel"),s.unref(i).b("dropdown"),L.popperClass],"stop-popper-mouse-event":!1,effect:"light",trigger:"click",teleported:L.teleported,transition:`${s.unref(i).namespace.value}-zoom-in-top`,persistent:"",onHide:Y=>R(!1)},{content:s.withCtx(()=>[s.withDirectives((s.openBlock(),s.createElementBlock("div",{onKeydown:s.withKeys(V,["esc"])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(i).be("dropdown","main-wrapper"))},[s.createVNode(NR,{ref_key:"hue",ref:f,class:"hue-slider",color:s.unref(x),vertical:""},null,8,["color"]),s.createVNode($R,{ref_key:"sv",ref:h,color:s.unref(x)},null,8,["color"])],2),L.showAlpha?(s.openBlock(),s.createBlock(SR,{key:0,ref_key:"alpha",ref:v,color:s.unref(x)},null,8,["color"])):s.createCommentVNode("v-if",!0),L.predefine?(s.openBlock(),s.createBlock(LR,{key:1,ref:"predefine","enable-alpha":L.showAlpha,color:s.unref(x),colors:L.predefine},null,8,["enable-alpha","color","colors"])):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(i).be("dropdown","btns"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(i).be("dropdown","value"))},[s.createVNode(s.unref(Ai),{ref_key:"inputRef",ref:y,modelValue:_.value,"onUpdate:modelValue":Y=>_.value=Y,"validate-event":!1,size:"small",onKeyup:s.withKeys(H,["enter"]),onBlur:H},null,8,["modelValue","onUpdate:modelValue","onKeyup"])],2),s.createVNode(s.unref(Ht),{class:s.normalizeClass(s.unref(i).be("dropdown","link-btn")),text:"",size:"small",onClick:X},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(a)("el.colorpicker.clear")),1)]),_:1},8,["class"]),s.createVNode(s.unref(Ht),{plain:"",size:"small",class:s.normalizeClass(s.unref(i).be("dropdown","btn")),onClick:G},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(a)("el.colorpicker.confirm")),1)]),_:1},8,["class"])],2)],40,["onKeydown"])),[[s.unref(Xy),M]])]),default:s.withCtx(()=>[s.createElementVNode("div",s.mergeProps({id:s.unref(u),ref_key:"triggerRef",ref:g},L.$attrs,{class:s.unref(P),role:"button","aria-label":s.unref(N),"aria-labelledby":s.unref(B),"aria-description":s.unref(a)("el.colorpicker.description",{color:L.modelValue||""}),"aria-disabled":s.unref(c),tabindex:s.unref(c)?-1:L.tabindex,onKeydown:q,onFocus:s.unref(b),onBlur:s.unref(w)}),[s.unref(c)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(i).be("picker","mask"))},null,2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(i).be("picker","trigger")),onClick:j},[s.createElementVNode("span",{class:s.normalizeClass([s.unref(i).be("picker","color"),s.unref(i).is("alpha",L.showAlpha)])},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(i).be("picker","color-inner")),style:s.normalizeStyle({backgroundColor:s.unref(S)})},[s.withDirectives(s.createVNode(s.unref(it),{class:s.normalizeClass([s.unref(i).be("picker","icon"),s.unref(i).is("icon-arrow-down")])},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.ArrowDown))]),_:1},8,["class"]),[[s.vShow,L.modelValue||E.value]]),s.withDirectives(s.createVNode(s.unref(it),{class:s.normalizeClass([s.unref(i).be("picker","empty"),s.unref(i).is("icon-close")])},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.Close))]),_:1},8,["class"]),[[s.vShow,!L.modelValue&&!E.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 zR=Be(qR,[["__file","color-picker.vue"]]);const HR=dt(zR),KR=s.defineComponent({name:"ElContainer"}),GR=s.defineComponent({...KR,props:{direction:{type:String}},setup(t){const e=t,r=s.useSlots(),n=De("container"),a=s.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:r&&r.default?r.default().some(o=>{const l=o.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(i,o)=>(s.openBlock(),s.createElementBlock("section",{class:s.normalizeClass([s.unref(n).b(),s.unref(n).is("vertical",s.unref(a))])},[s.renderSlot(i.$slots,"default")],2))}});var UR=Be(GR,[["__file","container.vue"]]);const jR=s.defineComponent({name:"ElAside"}),WR=s.defineComponent({...jR,props:{width:{type:String,default:null}},setup(t){const e=t,r=De("aside"),n=s.computed(()=>e.width?r.cssVarBlock({width:e.width}):{});return(a,i)=>(s.openBlock(),s.createElementBlock("aside",{class:s.normalizeClass(s.unref(r).b()),style:s.normalizeStyle(s.unref(n))},[s.renderSlot(a.$slots,"default")],6))}});var u0=Be(WR,[["__file","aside.vue"]]);const YR=s.defineComponent({name:"ElFooter"}),ZR=s.defineComponent({...YR,props:{height:{type:String,default:null}},setup(t){const e=t,r=De("footer"),n=s.computed(()=>e.height?r.cssVarBlock({height:e.height}):{});return(a,i)=>(s.openBlock(),s.createElementBlock("footer",{class:s.normalizeClass(s.unref(r).b()),style:s.normalizeStyle(s.unref(n))},[s.renderSlot(a.$slots,"default")],6))}});var c0=Be(ZR,[["__file","footer.vue"]]);const XR=s.defineComponent({name:"ElHeader"}),JR=s.defineComponent({...XR,props:{height:{type:String,default:null}},setup(t){const e=t,r=De("header"),n=s.computed(()=>e.height?r.cssVarBlock({height:e.height}):{});return(a,i)=>(s.openBlock(),s.createElementBlock("header",{class:s.normalizeClass(s.unref(r).b()),style:s.normalizeStyle(s.unref(n))},[s.renderSlot(a.$slots,"default")],6))}});var d0=Be(JR,[["__file","header.vue"]]);const QR=s.defineComponent({name:"ElMain"}),eL=s.defineComponent({...QR,setup(t){const e=De("main");return(r,n)=>(s.openBlock(),s.createElementBlock("main",{class:s.normalizeClass(s.unref(e).b())},[s.renderSlot(r.$slots,"default")],2))}});var f0=Be(eL,[["__file","main.vue"]]);const Su=dt(UR,{Aside:u0,Footer:c0,Header:d0,Main:f0});Gr(u0),Gr(c0);const h0=Gr(d0),_u=Gr(f0),tL=s.defineComponent({inheritAttrs:!1});function rL(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default")}var nL=Be(tL,[["render",rL],["__file","collection.vue"]]);const aL=s.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function iL(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default")}var oL=Be(aL,[["render",iL],["__file","collection-item.vue"]]);const sL="data-el-collection-item",lL=t=>{const e=`El${t}Collection`,r=`${e}Item`,n=Symbol(e),a=Symbol(r),i={...nL,name:e,setup(){const l=s.ref(null),c=new Map,u=()=>{const d=s.unref(l);if(!d)return[];const f=Array.from(d.querySelectorAll(`[${sL}]`));return[...c.values()].sort((v,p)=>f.indexOf(v.ref)-f.indexOf(p.ref))};s.provide(n,{itemMap:c,getItems:u,collectionRef:l})}},o={...oL,name:r,setup(l,{attrs:c}){const u=s.ref(null),d=s.inject(n,void 0);s.provide(a,{collectionItemRef:u}),s.onMounted(()=>{const f=s.unref(u);f&&d.itemMap.set(f,{ref:f,...c})}),s.onBeforeUnmount(()=>{const f=s.unref(u);d.itemMap.delete(f)})}};return{COLLECTION_INJECTION_KEY:n,COLLECTION_ITEM_INJECTION_KEY:a,ElCollection:i,ElCollectionItem:o}},Tu=Me({trigger:Ri.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});Me({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:dn}}),Me({onKeydown:{type:ke(Function)}}),lL("Dropdown");const p0=Symbol("ElSelectGroup"),qi=Symbol("ElSelect");function uL(t,e){const r=s.inject(qi),n=s.inject(p0,{disabled:!1}),a=s.computed(()=>d(sn(r.props.modelValue),t.value)),i=s.computed(()=>{var v;if(r.props.multiple){const p=sn((v=r.props.modelValue)!=null?v:[]);return!a.value&&p.length>=r.props.multipleLimit&&r.props.multipleLimit>0}else return!1}),o=s.computed(()=>t.label||(yt(t.value)?"":t.value)),l=s.computed(()=>t.value||t.label||""),c=s.computed(()=>t.disabled||e.groupDisabled||i.value),u=s.getCurrentInstance(),d=(v=[],p)=>{if(yt(t.value)){const g=r.props.valueKey;return v&&v.some(y=>s.toRaw(Hr(y,g))===Hr(p,g))}else return v&&v.includes(p)},f=()=>{!t.disabled&&!n.disabled&&(r.states.hoveringIndex=r.optionsArray.indexOf(u.proxy))},h=v=>{const p=new RegExp(eD(v),"i");e.visible=p.test(o.value)||t.created};return s.watch(()=>o.value,()=>{!t.created&&!r.props.remote&&r.setSelected()}),s.watch(()=>t.value,(v,p)=>{const{remote:g,valueKey:y}=r.props;if(v!==p&&(r.onOptionDestroy(p,u.proxy),r.onOptionCreate(u.proxy)),!t.created&&!g){if(y&&yt(v)&&yt(p)&&v[y]===p[y])return;r.setSelected()}}),s.watch(()=>n.disabled,()=>{e.groupDisabled=n.disabled},{immediate:!0}),{select:r,currentLabel:o,currentValue:l,itemSelected:a,isDisabled:c,hoverItem:f,updateOption:h}}const cL=s.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=De("select"),r=Di(),n=s.computed(()=>[e.be("dropdown","item"),e.is("disabled",s.unref(l)),e.is("selected",s.unref(o)),e.is("hovering",s.unref(h))]),a=s.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:i,itemSelected:o,isDisabled:l,select:c,hoverItem:u,updateOption:d}=uL(t,a),{visible:f,hover:h}=s.toRefs(a),v=s.getCurrentInstance().proxy;c.onOptionCreate(v),s.onBeforeUnmount(()=>{const g=v.value,{selected:y}=c.states,b=(c.props.multiple?y:[y]).some(w=>w.value===v.value);s.nextTick(()=>{c.states.cachedOptions.get(g)===v&&!b&&c.states.cachedOptions.delete(g)}),c.onOptionDestroy(g,v)});function p(){l.value||c.handleOptionSelect(v)}return{ns:e,id:r,containerKls:n,currentLabel:i,itemSelected:o,isDisabled:l,select:c,hoverItem:u,updateOption:d,visible:f,hover:h,selectOptionClick:p,states:a}}});function dL(t,e,r,n,a,i){return s.withDirectives((s.openBlock(),s.createElementBlock("li",{id:t.id,class:s.normalizeClass(t.containerKls),role:"option","aria-disabled":t.isDisabled||void 0,"aria-selected":t.itemSelected,onMouseenter:t.hoverItem,onClick:s.withModifiers(t.selectOptionClick,["stop"])},[s.renderSlot(t.$slots,"default",{},()=>[s.createElementVNode("span",null,s.toDisplayString(t.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[s.vShow,t.visible]])}var Nu=Be(cL,[["render",dL],["__file","option.vue"]]);const fL=s.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const t=s.inject(qi),e=De("select"),r=s.computed(()=>t.props.popperClass),n=s.computed(()=>t.props.multiple),a=s.computed(()=>t.props.fitInputWidth),i=s.ref("");function o(){var l;i.value=`${(l=t.selectRef)==null?void 0:l.offsetWidth}px`}return s.onMounted(()=>{o(),Vr(t.selectRef,o)}),{ns:e,minWidth:i,popperClass:r,isMultiple:n,isFitInputWidth:a}}});function hL(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([t.ns.b("dropdown"),t.ns.is("multiple",t.isMultiple),t.popperClass]),style:s.normalizeStyle({[t.isFitInputWidth?"width":"minWidth"]:t.minWidth})},[t.$slots.header?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(t.ns.be("dropdown","header"))},[s.renderSlot(t.$slots,"header")],2)):s.createCommentVNode("v-if",!0),s.renderSlot(t.$slots,"default"),t.$slots.footer?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(t.ns.be("dropdown","footer"))},[s.renderSlot(t.$slots,"footer")],2)):s.createCommentVNode("v-if",!0)],6)}var pL=Be(fL,[["render",hL],["__file","select-dropdown.vue"]]);const vL=11,gL=(t,e)=>{const{t:r}=xi(),n=Di(),a=De("select"),i=De("input"),o=s.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=s.ref(null),c=s.ref(null),u=s.ref(null),d=s.ref(null),f=s.ref(null),h=s.ref(null),v=s.ref(null),p=s.ref(null),g=s.ref(null),y=s.ref(null),m=s.ref(null),b=s.ref(null),{isComposing:w,handleCompositionStart:C,handleCompositionUpdate:x,handleCompositionEnd:k}=wy({afterComposition:Q=>te(Q)}),{wrapperRef:E,isFocused:_}=iu(f,{beforeFocus(){return O.value},afterFocus(){t.automaticDropdown&&!S.value&&(S.value=!0,o.menuVisibleOnFocus=!0)},beforeBlur(Q){var he,Oe;return((he=u.value)==null?void 0:he.isFocusInsideContent(Q))||((Oe=d.value)==null?void 0:Oe.isFocusInsideContent(Q))},afterBlur(){S.value=!1,o.menuVisibleOnFocus=!1}}),S=s.ref(!1),T=s.ref(),{form:N,formItem:B}=Gn(),{inputId:P}=Oi(t,{formItemContext:B}),{valueOnClear:D,isEmptyValue:R}=AP(t),O=s.computed(()=>t.disabled||(N==null?void 0:N.disabled)),F=s.computed(()=>Et(t.modelValue)?t.modelValue.length>0:!R(t.modelValue)),A=s.computed(()=>t.clearable&&!O.value&&o.inputHovering&&F.value),z=s.computed(()=>t.remote&&t.filterable&&!t.remoteShowSuffix?"":t.suffixIcon),j=s.computed(()=>a.is("reverse",z.value&&S.value)),H=s.computed(()=>(B==null?void 0:B.validateState)||""),G=s.computed(()=>Rm[H.value]),X=s.computed(()=>t.remote?300:0),M=s.computed(()=>t.loading?t.loadingText||r("el.select.loading"):t.remote&&!o.inputValue&&o.options.size===0?!1:t.filterable&&o.inputValue&&o.options.size>0&&V.value===0?t.noMatchText||r("el.select.noMatch"):o.options.size===0?t.noDataText||r("el.select.noData"):null),V=s.computed(()=>q.value.filter(Q=>Q.visible).length),q=s.computed(()=>{const Q=Array.from(o.options.values()),he=[];return o.optionValues.forEach(Oe=>{const He=Q.findIndex(Fr=>Fr.value===Oe);He>-1&&he.push(Q[He])}),he.length>=Q.length?he:Q}),$=s.computed(()=>Array.from(o.cachedOptions.values())),K=s.computed(()=>{const Q=q.value.filter(he=>!he.created).some(he=>he.currentLabel===o.inputValue);return t.filterable&&t.allowCreate&&o.inputValue!==""&&!Q}),L=()=>{t.filterable&&Mt(t.filterMethod)||t.filterable&&t.remote&&Mt(t.remoteMethod)||q.value.forEach(Q=>{var he;(he=Q.updateOption)==null||he.call(Q,o.inputValue)})},W=Kn(),Y=s.computed(()=>["small"].includes(W.value)?"small":"default"),se=s.computed({get(){return S.value&&M.value!==!1},set(Q){S.value=Q}}),ue=s.computed(()=>{if(t.multiple&&!cn(t.modelValue))return sn(t.modelValue).length===0&&!o.inputValue;const Q=Et(t.modelValue)?t.modelValue[0]:t.modelValue;return t.filterable||cn(Q)?!o.inputValue:!0}),ae=s.computed(()=>{var Q;const he=(Q=t.placeholder)!=null?Q:r("el.select.placeholder");return t.multiple||!F.value?he:o.selectedLabel}),ne=s.computed(()=>_l?null:"mouseenter");s.watch(()=>t.modelValue,(Q,he)=>{t.multiple&&t.filterable&&!t.reserveKeyword&&(o.inputValue="",ce("")),fe(),!zo(Q,he)&&t.validateEvent&&(B==null||B.validate("change").catch(Oe=>at(Oe)))},{flush:"post",deep:!0}),s.watch(()=>S.value,Q=>{Q?ce(o.inputValue):(o.inputValue="",o.previousQuery=null,o.isBeforeHide=!0),e("visible-change",Q)}),s.watch(()=>o.options.entries(),()=>{var Q;if(!nt)return;const he=((Q=l.value)==null?void 0:Q.querySelectorAll("input"))||[];(!t.filterable&&!t.defaultFirstOption&&!cn(t.modelValue)||!Array.from(he).includes(document.activeElement))&&fe(),t.defaultFirstOption&&(t.filterable||t.remote)&&V.value&&ie()},{flush:"post"}),s.watch(()=>o.hoveringIndex,Q=>{xt(Q)&&Q>-1?T.value=q.value[Q]||{}:T.value={},q.value.forEach(he=>{he.hover=T.value===he})}),s.watchEffect(()=>{o.isBeforeHide||L()});const ce=Q=>{o.previousQuery===Q||w.value||(o.previousQuery=Q,t.filterable&&Mt(t.filterMethod)?t.filterMethod(Q):t.filterable&&t.remote&&Mt(t.remoteMethod)&&t.remoteMethod(Q),t.defaultFirstOption&&(t.filterable||t.remote)&&V.value?s.nextTick(ie):s.nextTick(Pe))},ie=()=>{const Q=q.value.filter(He=>He.visible&&!He.disabled&&!He.states.groupDisabled),he=Q.find(He=>He.created),Oe=Q[0];o.hoveringIndex=ye(q.value,he||Oe)},fe=()=>{if(t.multiple)o.selectedLabel="";else{const he=Et(t.modelValue)?t.modelValue[0]:t.modelValue,Oe=pe(he);o.selectedLabel=Oe.currentLabel,o.selected=[Oe];return}const Q=[];cn(t.modelValue)||sn(t.modelValue).forEach(he=>{Q.push(pe(he))}),o.selected=Q},pe=Q=>{let he;const Oe=Nl(Q).toLowerCase()==="object",He=Nl(Q).toLowerCase()==="null",Fr=Nl(Q).toLowerCase()==="undefined";for(let an=o.cachedOptions.size-1;an>=0;an--){const ur=$.value[an];if(Oe?Hr(ur.value,t.valueKey)===Hr(Q,t.valueKey):ur.value===Q){he={value:Q,currentLabel:ur.currentLabel,get isDisabled(){return ur.isDisabled}};break}}if(he)return he;const An=Oe?Q.label:!He&&!Fr?Q:"";return{value:Q,currentLabel:An}},Pe=()=>{o.hoveringIndex=q.value.findIndex(Q=>o.selected.some(he=>Lt(he)===Lt(Q)))},Ie=()=>{o.selectionWidth=c.value.getBoundingClientRect().width},we=()=>{o.calculatorWidth=h.value.getBoundingClientRect().width},xe=()=>{o.collapseItemWidth=m.value.getBoundingClientRect().width},re=()=>{var Q,he;(he=(Q=u.value)==null?void 0:Q.updatePopper)==null||he.call(Q)},I=()=>{var Q,he;(he=(Q=d.value)==null?void 0:Q.updatePopper)==null||he.call(Q)},U=()=>{o.inputValue.length>0&&!S.value&&(S.value=!0),ce(o.inputValue)},te=Q=>{if(o.inputValue=Q.target.value,t.remote)Z();else return U()},Z=Gl(()=>{U()},X.value),J=Q=>{zo(t.modelValue,Q)||e(Ei,Q)},le=Q=>WB(Q,he=>!o.disabledOptions.has(he)),ee=Q=>{if(t.multiple&&Q.code!==ft.delete&&Q.target.value.length<=0){const he=sn(t.modelValue).slice(),Oe=le(he);if(Oe<0)return;const He=he[Oe];he.splice(Oe,1),e(et,he),J(he),e("remove-tag",He)}},oe=(Q,he)=>{const Oe=o.selected.indexOf(he);if(Oe>-1&&!O.value){const He=sn(t.modelValue).slice();He.splice(Oe,1),e(et,He),J(He),e("remove-tag",he.value)}Q.stopPropagation(),st()},me=Q=>{Q.stopPropagation();const he=t.multiple?[]:D.value;if(t.multiple)for(const Oe of o.selected)Oe.isDisabled&&he.push(Oe.value);e(et,he),J(he),o.hoveringIndex=-1,S.value=!1,e("clear"),st()},be=Q=>{var he;if(t.multiple){const Oe=sn((he=t.modelValue)!=null?he:[]).slice(),He=ye(Oe,Q.value);He>-1?Oe.splice(He,1):(t.multipleLimit<=0||Oe.length<t.multipleLimit)&&Oe.push(Q.value),e(et,Oe),J(Oe),Q.created&&ce(""),t.filterable&&!t.reserveKeyword&&(o.inputValue="")}else e(et,Q.value),J(Q.value),S.value=!1;st(),!S.value&&s.nextTick(()=>{_e(Q)})},ye=(Q=[],he)=>{if(!yt(he))return Q.indexOf(he);const Oe=t.valueKey;let He=-1;return Q.some((Fr,An)=>s.toRaw(Hr(Fr,Oe))===Hr(he,Oe)?(He=An,!0):!1),He},_e=Q=>{var he,Oe,He,Fr,An;const vi=Et(Q)?Q[0]:Q;let an=null;if(vi!=null&&vi.value){const ur=q.value.filter(Rn=>Rn.value===vi.value);ur.length>0&&(an=ur[0].$el)}if(u.value&&an){const ur=(Fr=(He=(Oe=(he=u.value)==null?void 0:he.popperRef)==null?void 0:Oe.contentRef)==null?void 0:He.querySelector)==null?void 0:Fr.call(He,`.${a.be("dropdown","wrap")}`);ur&&rD(ur,an)}(An=b.value)==null||An.handleScroll()},ge=Q=>{o.options.set(Q.value,Q),o.cachedOptions.set(Q.value,Q),Q.disabled&&o.disabledOptions.set(Q.value,Q)},Ce=(Q,he)=>{o.options.get(Q)===he&&o.options.delete(Q)},je=s.computed(()=>{var Q,he;return(he=(Q=u.value)==null?void 0:Q.popperRef)==null?void 0:he.contentRef}),qe=()=>{o.isBeforeHide=!1,s.nextTick(()=>_e(o.selected))},st=()=>{var Q;(Q=f.value)==null||Q.focus()},lt=()=>{var Q;(Q=f.value)==null||Q.blur()},tt=Q=>{me(Q)},Rt=()=>{S.value=!1,_.value&&lt()},mt=()=>{o.inputValue.length>0?o.inputValue="":S.value=!1},wt=()=>{O.value||(_l&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:S.value=!S.value)},Jt=()=>{S.value?q.value[o.hoveringIndex]&&be(q.value[o.hoveringIndex]):wt()},Lt=Q=>yt(Q.value)?Hr(Q.value,t.valueKey):Q.value,Ft=s.computed(()=>q.value.filter(Q=>Q.visible).every(Q=>Q.disabled)),lr=s.computed(()=>t.multiple?t.collapseTags?o.selected.slice(0,t.maxCollapseTags):o.selected:[]),Cr=s.computed(()=>t.multiple?t.collapseTags?o.selected.slice(t.maxCollapseTags):[]:[]),jt=Q=>{if(!S.value){S.value=!0;return}if(!(o.options.size===0||o.filteredOptionsCount===0||w.value)&&!Ft.value){Q==="next"?(o.hoveringIndex++,o.hoveringIndex===o.options.size&&(o.hoveringIndex=0)):Q==="prev"&&(o.hoveringIndex--,o.hoveringIndex<0&&(o.hoveringIndex=o.options.size-1));const he=q.value[o.hoveringIndex];(he.disabled===!0||he.states.groupDisabled===!0||!he.visible)&&jt(Q),s.nextTick(()=>_e(T.value))}},rt=()=>{if(!c.value)return 0;const Q=window.getComputedStyle(c.value);return Number.parseFloat(Q.gap||"6px")},ut=s.computed(()=>{const Q=rt();return{maxWidth:`${m.value&&t.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-Q:o.selectionWidth}px`}}),Ct=s.computed(()=>({maxWidth:`${o.selectionWidth}px`})),On=s.computed(()=>({width:`${Math.max(o.calculatorWidth,vL)}px`}));return Vr(c,Ie),Vr(h,we),Vr(g,re),Vr(E,re),Vr(y,I),Vr(m,xe),s.onMounted(()=>{fe()}),{inputId:P,contentId:n,nsSelect:a,nsInput:i,states:o,isFocused:_,expanded:S,optionsArray:q,hoverOption:T,selectSize:W,filteredOptionsCount:V,resetCalculatorWidth:we,updateTooltip:re,updateTagTooltip:I,debouncedOnInputChange:Z,onInput:te,deletePrevTag:ee,deleteTag:oe,deleteSelected:me,handleOptionSelect:be,scrollToOption:_e,hasModelValue:F,shouldShowPlaceholder:ue,currentPlaceholder:ae,mouseEnterEventName:ne,showClose:A,iconComponent:z,iconReverse:j,validateState:H,validateIcon:G,showNewOption:K,updateOptions:L,collapseTagSize:Y,setSelected:fe,selectDisabled:O,emptyText:M,handleCompositionStart:C,handleCompositionUpdate:x,handleCompositionEnd:k,onOptionCreate:ge,onOptionDestroy:Ce,handleMenuEnter:qe,focus:st,blur:lt,handleClearClick:tt,handleClickOutside:Rt,handleEsc:mt,toggleMenu:wt,selectOption:Jt,getValueKey:Lt,navigateOptions:jt,dropdownMenuVisible:se,showTagList:lr,collapseTagList:Cr,tagStyle:ut,collapseTagStyle:Ct,inputStyle:On,popperRef:je,inputRef:f,tooltipRef:u,tagTooltipRef:d,calculatorRef:h,prefixRef:v,suffixRef:p,selectRef:l,wrapperRef:E,selectionRef:c,scrollbarRef:b,menuRef:g,tagMenuRef:y,collapseItemRef:m}};var mL=s.defineComponent({name:"ElOptions",setup(t,{slots:e}){const r=s.inject(qi);let n=[];return()=>{var a,i;const o=(a=e.default)==null?void 0:a.call(e),l=[];function c(u){Et(u)&&u.forEach(d=>{var f,h,v,p;const g=(f=(d==null?void 0:d.type)||{})==null?void 0:f.name;g==="ElOptionGroup"?c(!ct(d.children)&&!Et(d.children)&&Mt((h=d.children)==null?void 0:h.default)?(v=d.children)==null?void 0:v.default():d.children):g==="ElOption"?l.push((p=d.props)==null?void 0:p.value):Et(d.children)&&c(d.children)})}return o.length&&c((i=o[0])==null?void 0:i.children),zo(l,n)||(n=l,r&&(r.states.optionValues=l)),o}}});const yL=Me({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:Na,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:dn,default:Ne.CircleClose},fitInputWidth:Boolean,suffixIcon:{type:dn,default:Ne.ArrowDown},tagType:{...Eu.type,default:"info"},tagEffect:{...Eu.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:ke(String),values:jo,default:"bottom-start"},fallbackPlacements:{type:ke(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...OP,...jr(["ariaLabel"])}),v0="ElSelect",bL=s.defineComponent({name:v0,componentName:v0,components:{ElSelectMenu:pL,ElOption:Nu,ElOptions:mL,ElTag:sR,ElScrollbar:Sy,ElTooltip:Pa,ElIcon:it},directives:{ClickOutside:Xy},props:yL,emits:[et,Ei,"remove-tag","clear","visible-change","focus","blur"],setup(t,{emit:e}){const r=s.computed(()=>{const{modelValue:i,multiple:o}=t,l=o?[]:void 0;return Et(i)?o?i:l:o?l:i}),n=s.reactive({...s.toRefs(t),modelValue:r}),a=gL(n,e);return s.provide(qi,s.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 wL(t,e,r,n,a,i){const o=s.resolveComponent("el-tag"),l=s.resolveComponent("el-tooltip"),c=s.resolveComponent("el-icon"),u=s.resolveComponent("el-option"),d=s.resolveComponent("el-options"),f=s.resolveComponent("el-scrollbar"),h=s.resolveComponent("el-select-menu"),v=s.resolveDirective("click-outside");return s.withDirectives((s.openBlock(),s.createElementBlock("div",{ref:"selectRef",class:s.normalizeClass([t.nsSelect.b(),t.nsSelect.m(t.selectSize)]),[s.toHandlerKey(t.mouseEnterEventName)]:p=>t.states.inputHovering=!0,onMouseleave:p=>t.states.inputHovering=!1},[s.createVNode(l,{ref:"tooltipRef",visible:t.dropdownMenuVisible,placement:t.placement,teleported:t.teleported,"popper-class":[t.nsSelect.e("popper"),t.popperClass],"popper-options":t.popperOptions,"fallback-placements":t.fallbackPlacements,effect:t.effect,pure:"",trigger:"click",transition:`${t.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:t.persistent,"append-to":t.appendTo,onBeforeShow:t.handleMenuEnter,onHide:p=>t.states.isBeforeHide=!1},{default:s.withCtx(()=>{var p;return[s.createElementVNode("div",{ref:"wrapperRef",class:s.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:s.withModifiers(t.toggleMenu,["prevent"])},[t.$slots.prefix?(s.openBlock(),s.createElementBlock("div",{key:0,ref:"prefixRef",class:s.normalizeClass(t.nsSelect.e("prefix"))},[s.renderSlot(t.$slots,"prefix")],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{ref:"selectionRef",class:s.normalizeClass([t.nsSelect.e("selection"),t.nsSelect.is("near",t.multiple&&!t.$slots.prefix&&!!t.states.selected.length)])},[t.multiple?s.renderSlot(t.$slots,"tag",{key:0},()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.showTagList,g=>(s.openBlock(),s.createElementBlock("div",{key:t.getValueKey(g),class:s.normalizeClass(t.nsSelect.e("selected-item"))},[s.createVNode(o,{closable:!t.selectDisabled&&!g.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:s.normalizeStyle(t.tagStyle),onClose:y=>t.deleteTag(y,g)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(t.nsSelect.e("tags-text"))},[s.renderSlot(t.$slots,"label",{label:g.currentLabel,value:g.value},()=>[s.createTextVNode(s.toDisplayString(g.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),t.collapseTags&&t.states.selected.length>t.maxCollapseTags?(s.openBlock(),s.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:s.withCtx(()=>[s.createElementVNode("div",{ref:"collapseItemRef",class:s.normalizeClass(t.nsSelect.e("selected-item"))},[s.createVNode(o,{closable:!1,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:s.normalizeStyle(t.collapseTagStyle)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(t.nsSelect.e("tags-text"))}," + "+s.toDisplayString(t.states.selected.length-t.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:s.withCtx(()=>[s.createElementVNode("div",{ref:"tagMenuRef",class:s.normalizeClass(t.nsSelect.e("selection"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.collapseTagList,g=>(s.openBlock(),s.createElementBlock("div",{key:t.getValueKey(g),class:s.normalizeClass(t.nsSelect.e("selected-item"))},[s.createVNode(o,{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:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(t.nsSelect.e("tags-text"))},[s.renderSlot(t.$slots,"label",{label:g.currentLabel,value:g.value},()=>[s.createTextVNode(s.toDisplayString(g.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):s.createCommentVNode("v-if",!0)]):s.createCommentVNode("v-if",!0),t.selectDisabled?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass([t.nsSelect.e("selected-item"),t.nsSelect.e("input-wrapper"),t.nsSelect.is("hidden",!t.filterable)])},[s.withDirectives(s.createElementVNode("input",{id:t.inputId,ref:"inputRef","onUpdate:modelValue":g=>t.states.inputValue=g,type:"text",name:t.name,class:s.normalizeClass([t.nsSelect.e("input"),t.nsSelect.is(t.selectSize)]),disabled:t.selectDisabled,autocomplete:t.autocomplete,style:s.normalizeStyle(t.inputStyle),role:"combobox",readonly:!t.filterable,spellcheck:"false","aria-activedescendant":((p=t.hoverOption)==null?void 0:p.id)||"","aria-controls":t.contentId,"aria-expanded":t.dropdownMenuVisible,"aria-label":t.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[s.withKeys(s.withModifiers(g=>t.navigateOptions("next"),["stop","prevent"]),["down"]),s.withKeys(s.withModifiers(g=>t.navigateOptions("prev"),["stop","prevent"]),["up"]),s.withKeys(s.withModifiers(t.handleEsc,["stop","prevent"]),["esc"]),s.withKeys(s.withModifiers(t.selectOption,["stop","prevent"]),["enter"]),s.withKeys(s.withModifiers(t.deletePrevTag,["stop"]),["delete"])],onCompositionstart:t.handleCompositionStart,onCompositionupdate:t.handleCompositionUpdate,onCompositionend:t.handleCompositionEnd,onInput:t.onInput,onClick:s.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"]),[[s.vModelText,t.states.inputValue]]),t.filterable?(s.openBlock(),s.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:s.normalizeClass(t.nsSelect.e("input-calculator")),textContent:s.toDisplayString(t.states.inputValue)},null,10,["textContent"])):s.createCommentVNode("v-if",!0)],2)),t.shouldShowPlaceholder?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass([t.nsSelect.e("selected-item"),t.nsSelect.e("placeholder"),t.nsSelect.is("transparent",!t.hasModelValue||t.expanded&&!t.states.inputValue)])},[t.hasModelValue?s.renderSlot(t.$slots,"label",{key:0,label:t.currentPlaceholder,value:t.modelValue},()=>[s.createElementVNode("span",null,s.toDisplayString(t.currentPlaceholder),1)]):(s.openBlock(),s.createElementBlock("span",{key:1},s.toDisplayString(t.currentPlaceholder),1))],2)):s.createCommentVNode("v-if",!0)],2),s.createElementVNode("div",{ref:"suffixRef",class:s.normalizeClass(t.nsSelect.e("suffix"))},[t.iconComponent&&!t.showClose?(s.openBlock(),s.createBlock(c,{key:0,class:s.normalizeClass([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.iconReverse])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.iconComponent)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),t.showClose&&t.clearIcon?(s.openBlock(),s.createBlock(c,{key:1,class:s.normalizeClass([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.nsSelect.e("clear")]),onClick:t.handleClearClick},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.clearIcon)))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0),t.validateState&&t.validateIcon?(s.openBlock(),s.createBlock(c,{key:2,class:s.normalizeClass([t.nsInput.e("icon"),t.nsInput.e("validateIcon")])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.validateIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:s.withCtx(()=>[s.createVNode(h,{ref:"menuRef"},{default:s.withCtx(()=>[t.$slots.header?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(t.nsSelect.be("dropdown","header")),onClick:s.withModifiers(()=>{},["stop"])},[s.renderSlot(t.$slots,"header")],10,["onClick"])):s.createCommentVNode("v-if",!0),s.withDirectives(s.createVNode(f,{id:t.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":t.nsSelect.be("dropdown","wrap"),"view-class":t.nsSelect.be("dropdown","list"),class:s.normalizeClass([t.nsSelect.is("empty",t.filteredOptionsCount===0)]),role:"listbox","aria-label":t.ariaLabel,"aria-orientation":"vertical"},{default:s.withCtx(()=>[t.showNewOption?(s.openBlock(),s.createBlock(u,{key:0,value:t.states.inputValue,created:!0},null,8,["value"])):s.createCommentVNode("v-if",!0),s.createVNode(d,null,{default:s.withCtx(()=>[s.renderSlot(t.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[s.vShow,t.states.options.size>0&&!t.loading]]),t.$slots.loading&&t.loading?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(t.nsSelect.be("dropdown","loading"))},[s.renderSlot(t.$slots,"loading")],2)):t.loading||t.filteredOptionsCount===0?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(t.nsSelect.be("dropdown","empty"))},[s.renderSlot(t.$slots,"empty",{},()=>[s.createElementVNode("span",null,s.toDisplayString(t.emptyText),1)])],2)):s.createCommentVNode("v-if",!0),t.$slots.footer?(s.openBlock(),s.createElementBlock("div",{key:3,class:s.normalizeClass(t.nsSelect.be("dropdown","footer")),onClick:s.withModifiers(()=>{},["stop"])},[s.renderSlot(t.$slots,"footer")],10,["onClick"])):s.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 CL=Be(bL,[["render",wL],["__file","select.vue"]]);const EL=s.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(t){const e=De("select"),r=s.ref(null),n=s.getCurrentInstance(),a=s.ref([]);s.provide(p0,s.reactive({...s.toRefs(t)}));const i=s.computed(()=>a.value.some(u=>u.visible===!0)),o=u=>{var d,f;return((d=u.type)==null?void 0:d.name)==="ElOption"&&!!((f=u.component)!=null&&f.proxy)},l=u=>{const d=sn(u),f=[];return d.forEach(h=>{var v,p;o(h)?f.push(h.component.proxy):(v=h.children)!=null&&v.length?f.push(...l(h.children)):(p=h.component)!=null&&p.subTree&&f.push(...l(h.component.subTree))}),f},c=()=>{a.value=l(n.subTree)};return s.onMounted(()=>{c()}),Z_(r,c,{attributes:!0,subtree:!0,childList:!0}),{groupRef:r,visible:i,ns:e}}});function xL(t,e,r,n,a,i){return s.withDirectives((s.openBlock(),s.createElementBlock("ul",{ref:"groupRef",class:s.normalizeClass(t.ns.be("group","wrap"))},[s.createElementVNode("li",{class:s.normalizeClass(t.ns.be("group","title"))},s.toDisplayString(t.label),3),s.createElementVNode("li",null,[s.createElementVNode("ul",{class:s.normalizeClass(t.ns.b("group"))},[s.renderSlot(t.$slots,"default")],2)])],2)),[[s.vShow,t.visible]])}var g0=Be(EL,[["render",xL],["__file","option-group.vue"]]);const kL=dt(CL,{Option:Nu,OptionGroup:g0}),SL=Gr(Nu);Gr(g0);const _L=Me({trigger:Ri.trigger,placement:Tu.placement,disabled:Ri.disabled,visible:$t.visible,transition:$t.transition,popperOptions:Tu.popperOptions,tabindex:Tu.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}}),TL={"update:visible":t=>ba(t),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},NL="onUpdate:visible",IL=s.defineComponent({name:"ElPopover"}),BL=s.defineComponent({...IL,props:_L,emits:TL,setup(t,{expose:e,emit:r}){const n=t,a=s.computed(()=>n[NL]),i=De("popover"),o=s.ref(),l=s.computed(()=>{var y;return(y=s.unref(o))==null?void 0:y.popperRef}),c=s.computed(()=>[{width:wa(n.width)},n.popperStyle]),u=s.computed(()=>[i.b(),n.popperClass,{[i.m("plain")]:!!n.content}]),d=s.computed(()=>n.transition===`${i.namespace.value}-fade-in-linear`),f=()=>{var y;(y=o.value)==null||y.hide()},h=()=>{r("before-enter")},v=()=>{r("before-leave")},p=()=>{r("after-enter")},g=()=>{r("update:visible",!1),r("after-leave")};return e({popperRef:l,hide:f}),(y,m)=>(s.openBlock(),s.createBlock(s.unref(Pa),s.mergeProps({ref_key:"tooltipRef",ref:o},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":s.unref(u),"popper-style":s.unref(c),teleported:y.teleported,persistent:y.persistent,"gpu-acceleration":s.unref(d),"onUpdate:visible":s.unref(a),onBeforeShow:h,onBeforeHide:v,onShow:p,onHide:g}),{content:s.withCtx(()=>[y.title?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(i).e("title")),role:"title"},s.toDisplayString(y.title),3)):s.createCommentVNode("v-if",!0),s.renderSlot(y.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(y.content),1)])]),default:s.withCtx(()=>[y.$slots.reference?s.renderSlot(y.$slots,"reference",{key:0}):s.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 DL=Be(BL,[["__file","popover.vue"]]);const m0=(t,e)=>{const r=e.arg||e.value,n=r==null?void 0:r.popperRef;n&&(n.triggerRef=t)};var PL={mounted(t,e){m0(t,e)},updated(t,e){m0(t,e)}};const OL=aD(PL,"popover"),Ra=dt(DL,{directive:OL}),La="$treeNodeId",y0=function(t,e){!e||e[La]||Object.defineProperty(e,La,{value:t.id,enumerable:!1,configurable:!1,writable:!1})},Iu=function(t,e){return t?e[t]:e[La]},Bu=(t,e,r)=>{const n=t.value.currentNode;r();const a=t.value.currentNode;n!==a&&e("current-change",a?a.data:null,a)},Du=t=>{let e=!0,r=!0,n=!0;for(let a=0,i=t.length;a<i;a++){const o=t[a];(o.checked!==!0||o.indeterminate)&&(e=!1,o.disabled||(n=!1)),(o.checked!==!1||o.indeterminate)&&(r=!1)}return{all:e,none:r,allWithoutDisable:n,half:!e&&!r}},zi=function(t){if(t.childNodes.length===0||t.loading)return;const{all:e,none:r,half:n}=Du(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||zi(a)},ss=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 AL=0;class Wn{constructor(e){this.id=AL++,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)Ln(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=ss(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)||y0(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)||y0(this,e),this.data=e,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=ss(this,"children")||[];for(let n=0,a=r.length;n<a;n++)this.insertChild({data:r[n]})}get label(){return ss(this,"label")}get key(){const e=this.store.key;return this.data?this.data[e]:null}get disabled(){return ss(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 Wn)){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=s.reactive(new Wn(e)),e instanceof Wn&&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||zi(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:o,allWithoutDisable:l}=Du(this.childNodes);!this.isLeaf&&!o&&l&&(this.checked=!1,e=!1);const c=()=>{if(r){const u=this.childNodes;for(let h=0,v=u.length;h<v;h++){const p=u[h];a=a||e!==!1;const g=p.disabled?p.checked:a;p.setChecked(g,r,!0,a)}const{half:d,all:f}=Du(u);f||(this.checked=f,this.indeterminate=d)}};if(this.shouldLoadData()){this.loadData(()=>{c(),zi(this)},{checked:e!==!1});return}else c()}const i=this.parent;!i||i.level===0||n||zi(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,o)=>{const l=i[La];!!l&&r.findIndex(u=>u[La]===l)>=0?n[l]={index:o,data:i}:a.push({index:o,data:i})}),this.store.lazy||r.forEach(i=>{n[i[La]]||this.removeChildByData(i)}),a.forEach(({index:i,data:o})=>{this.insertChild({data:o},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||zi(this)}}class RL{constructor(e){this.currentNode=null,this.currentNodeKey=null;for(const r in e)Ln(e,r)&&(this[r]=e[r]);this.nodesMap={}}initialize(){if(this.root=new Wn({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 o=i.root?i.root.childNodes:i.childNodes;if(o.forEach(l=>{l.visible=r.call(l,e,l.data,l),a(l)}),!i.visible&&o.length){let l=!0;l=!o.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 Wn)return e;const r=yt(e)?Iu(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=Ho(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)Ln(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 o=a[i];this.remove(o.data)}for(let i=0,o=r.length;i<o;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),o=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(!o.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(p){p.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 LL=s.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(t){const e=De("tree"),r=s.inject("NodeInstance"),n=s.inject("RootTree");return()=>{const a=t.node,{data:i,store:o}=a;return t.renderContent?t.renderContent(s.h,{_self:r,node:a,data:i,store:o}):s.renderSlot(n.ctx.slots,"default",{node:a,data:i},()=>[s.h("span",{class:e.be("node","label")},[a.label])])}}});var FL=Be(LL,[["__file","tree-node-content.vue"]]);function b0(t){const e=s.inject("TreeNodeMap",null),r={treeNodeExpand:n=>{t.node!==n&&t.node.collapse()},children:[]};return e&&e.children.push(r),s.provide("TreeNodeMap",r),{broadcastExpanded:n=>{if(t.accordion)for(const a of r.children)a.treeNodeExpand(n)}}}const w0=Symbol("dragEvents");function ML({props:t,ctx:e,el$:r,dropIndicator$:n,store:a}){const i=De("tree"),o=s.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{}o.value.draggingNode=f,e.emit("node-drag-start",f.node,d)},c=({event:d,treeNode:f})=>{const h=f,v=o.value.dropNode;v&&v.node.id!==h.node.id&&qn(v.$el,i.is("drop-inner"));const p=o.value.draggingNode;if(!p||!h)return;let g=!0,y=!0,m=!0,b=!0;typeof t.allowDrop=="function"&&(g=t.allowDrop(p.node,h.node,"prev"),b=y=t.allowDrop(p.node,h.node,"inner"),m=t.allowDrop(p.node,h.node,"next")),d.dataTransfer.dropEffect=y||g||m?"move":"none",(g||y||m)&&(v==null?void 0:v.node.id)!==h.node.id&&(v&&e.emit("node-drag-leave",p.node,v.node,d),e.emit("node-drag-enter",p.node,h.node,d)),g||y||m?o.value.dropNode=h:o.value.dropNode=null,h.node.nextSibling===p.node&&(m=!1),h.node.previousSibling===p.node&&(g=!1),h.node.contains(p.node,!1)&&(y=!1),(p.node===h.node||p.node.contains(h.node))&&(g=!1,y=!1,m=!1);const w=h.$el.querySelector(`.${i.be("node","content")}`).getBoundingClientRect(),C=r.value.getBoundingClientRect();let x;const k=g?y?.25:m?.45:1:-1,E=m?y?.75:g?.55:0:1;let _=-9999;const S=d.clientY-w.top;S<w.height*k?x="before":S>w.height*E?x="after":y?x="inner":x="none";const T=h.$el.querySelector(`.${i.be("node","expand-icon")}`).getBoundingClientRect(),N=n.value;x==="before"?_=T.top-C.top:x==="after"&&(_=T.bottom-C.top),N.style.top=`${_}px`,N.style.left=`${T.right-C.left}px`,x==="inner"?Ul(h.$el,i.is("drop-inner")):qn(h.$el,i.is("drop-inner")),o.value.showDropIndicator=x==="before"||x==="after",o.value.allowDrop=o.value.showDropIndicator||b,o.value.dropType=x,e.emit("node-drag-over",p.node,h.node,d)},u=d=>{const{draggingNode:f,dropType:h,dropNode:v}=o.value;if(d.preventDefault(),d.dataTransfer&&(d.dataTransfer.dropEffect="move"),f&&v){const p={data:f.node.data};h!=="none"&&f.node.remove(),h==="before"?v.node.parent.insertBefore(p,v.node):h==="after"?v.node.parent.insertAfter(p,v.node):h==="inner"&&v.node.insertChild(p),h!=="none"&&(a.value.registerNode(p),a.value.key&&f.node.eachNode(g=>{var y;(y=a.value.nodesMap[g.data[a.value.key]])==null||y.setChecked(g.checked,!a.value.checkStrictly)})),qn(v.$el,i.is("drop-inner")),e.emit("node-drag-end",f.node,v.node,h,d),h!=="none"&&e.emit("node-drop",f.node,v.node,h,d)}f&&!v&&e.emit("node-drag-end",f.node,null,h,d),o.value.showDropIndicator=!1,o.value.draggingNode=null,o.value.dropNode=null,o.value.allowDrop=!0};return s.provide(w0,{treeNodeDragStart:l,treeNodeDragOver:c,treeNodeDragEnd:u}),{dragState:o}}const $L=s.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:bR,ElCheckbox:rR,NodeContent:FL,ElIcon:it,Loading:Ne.Loading},props:{node:{type:Wn,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(t,e){const r=De("tree"),{broadcastExpanded:n}=b0(t),a=s.inject("RootTree"),i=s.ref(!1),o=s.ref(!1),l=s.ref(null),c=s.ref(null),u=s.ref(null),d=s.inject(w0),f=s.getCurrentInstance();s.provide("NodeInstance",f),a||at("Tree","Can not find node's tree."),t.node.expanded&&(i.value=!0,o.value=!0);const h=a.props.props.children||"children";s.watch(()=>{const S=t.node.data[h];return S&&[...S]},()=>{t.node.updateChildren()}),s.watch(()=>t.node.indeterminate,S=>{g(t.node.checked,S)}),s.watch(()=>t.node.checked,S=>{g(S,t.node.indeterminate)}),s.watch(()=>t.node.childNodes.length,()=>t.node.reInitChecked()),s.watch(()=>t.node.expanded,S=>{s.nextTick(()=>i.value=S),S&&(o.value=!0)});const v=S=>Iu(a.props.nodeKey,S.data),p=S=>{const T=t.props.class;if(!T)return{};let N;if(Mt(T)){const{data:B}=S;N=T(B,S)}else N=T;return ct(N)?{[N]:!0}:N},g=(S,T)=>{(l.value!==S||c.value!==T)&&a.ctx.emit("check-change",t.node.data,S,T),l.value=S,c.value=T},y=S=>{Bu(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,T)=>{t.node.setChecked(T.target.checked,!a.props.checkStrictly),s.nextTick(()=>{const N=a.store.value;a.ctx.emit("check",t.node.data,{checkedNodes:N.getCheckedNodes(),checkedKeys:N.getCheckedKeys(),halfCheckedNodes:N.getHalfCheckedNodes(),halfCheckedKeys:N.getHalfCheckedKeys()})})};return{ns:r,node$:u,tree:a,expanded:i,childNodeRendered:o,oldChecked:l,oldIndeterminate:c,getNodeKey:v,getNodeClass:p,handleSelectChange:g,handleClick:y,handleContextMenu:m,handleExpandIconClick:b,handleCheckChange:w,handleChildNodeExpand:(S,T,N)=>{n(T),a.ctx.emit("node-expand",S,T,N)},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:Ne.CaretRight}}});function VL(t,e,r,n,a,i){const o=s.resolveComponent("el-icon"),l=s.resolveComponent("el-checkbox"),c=s.resolveComponent("loading"),u=s.resolveComponent("node-content"),d=s.resolveComponent("el-tree-node"),f=s.resolveComponent("el-collapse-transition");return s.withDirectives((s.openBlock(),s.createElementBlock("div",{ref:"node$",class:s.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:s.withModifiers(t.handleClick,["stop"]),onContextmenu:t.handleContextMenu,onDragstart:s.withModifiers(t.handleDragStart,["stop"]),onDragover:s.withModifiers(t.handleDragOver,["stop"]),onDragend:s.withModifiers(t.handleDragEnd,["stop"]),onDrop:s.withModifiers(t.handleDrop,["stop"])},[s.createElementVNode("div",{class:s.normalizeClass(t.ns.be("node","content")),style:s.normalizeStyle({paddingLeft:(t.node.level-1)*t.tree.props.indent+"px"})},[t.tree.props.icon||t.CaretRight?(s.openBlock(),s.createBlock(o,{key:0,class:s.normalizeClass([t.ns.be("node","expand-icon"),t.ns.is("leaf",t.node.isLeaf),{expanded:!t.node.isLeaf&&t.expanded}]),onClick:s.withModifiers(t.handleExpandIconClick,["stop"])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.tree.props.icon||t.CaretRight)))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0),t.showCheckbox?(s.openBlock(),s.createBlock(l,{key:1,"model-value":t.node.checked,indeterminate:t.node.indeterminate,disabled:!!t.node.disabled,onClick:s.withModifiers(()=>{},["stop"]),onChange:t.handleCheckChange},null,8,["model-value","indeterminate","disabled","onClick","onChange"])):s.createCommentVNode("v-if",!0),t.node.loading?(s.openBlock(),s.createBlock(o,{key:2,class:s.normalizeClass([t.ns.be("node","loading-icon"),t.ns.is("loading")])},{default:s.withCtx(()=>[s.createVNode(c)]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),s.createVNode(u,{node:t.node,"render-content":t.renderContent},null,8,["node","render-content"])],6),s.createVNode(f,null,{default:s.withCtx(()=>[!t.renderAfterExpand||t.childNodeRendered?s.withDirectives((s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(t.ns.be("node","children")),role:"group","aria-expanded":t.expanded},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.node.childNodes,h=>(s.openBlock(),s.createBlock(d,{key:t.getNodeKey(h),"render-content":t.renderContent,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,node:h,accordion:t.accordion,props:t.props,onNodeExpand:t.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,["aria-expanded"])),[[s.vShow,t.expanded]]):s.createCommentVNode("v-if",!0)]),_:1})],42,["aria-expanded","aria-disabled","aria-checked","draggable","data-key","onClick","onContextmenu","onDragstart","onDragover","onDragend","onDrop"])),[[s.vShow,t.node.visible]])}var qL=Be($L,[["render",VL],["__file","tree-node.vue"]]);function zL({el$:t},e){const r=De("tree"),n=s.shallowRef([]),a=s.shallowRef([]);s.onMounted(()=>{o()}),s.onUpdated(()=>{n.value=Array.from(t.value.querySelectorAll("[role=treeitem]")),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"))}),s.watch(a,l=>{l.forEach(c=>{c.setAttribute("tabindex","-1")})}),Qt(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([ft.up,ft.down].includes(u)){if(l.preventDefault(),u===ft.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()}[ft.left,ft.right].includes(u)&&(l.preventDefault(),c.click());const h=c.querySelector('[type="checkbox"]');[ft.enter,ft.space].includes(u)&&h&&(l.preventDefault(),h.click())});const o=()=>{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 HL=s.defineComponent({name:"ElTree",components:{ElTreeNode:qL},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:dn}},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}=xi(),n=De("tree"),a=s.inject(qi,null),i=s.ref(new RL({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 o=s.ref(i.value.root),l=s.ref(null),c=s.ref(null),u=s.ref(null),{broadcastExpanded:d}=b0(t),{dragState:f}=ML({props:t,ctx:e,el$:c,dropIndicator$:u,store:i});zL({el$:c},i);const h=s.computed(()=>{const{childNodes:A}=o.value,z=a?a.hasFilteredOptions!==0:!1;return(!A||A.length===0||A.every(({visible:j})=>!j))&&!z});s.watch(()=>t.currentNodeKey,A=>{i.value.setCurrentNodeKey(A)}),s.watch(()=>t.defaultCheckedKeys,A=>{i.value.setDefaultCheckedKey(A)}),s.watch(()=>t.defaultExpandedKeys,A=>{i.value.setDefaultExpandedKeys(A)}),s.watch(()=>t.data,A=>{i.value.setData(A)},{deep:!0}),s.watch(()=>t.checkStrictly,A=>{i.value.checkStrictly=A});const v=A=>{if(!t.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");i.value.filter(A)},p=A=>Iu(t.nodeKey,A.data),g=A=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const z=i.value.getNode(A);if(!z)return[];const j=[z.data];let H=z.parent;for(;H&&H!==o.value;)j.push(H.data),H=H.parent;return j.reverse()},y=(A,z)=>i.value.getCheckedNodes(A,z),m=A=>i.value.getCheckedKeys(A),b=()=>{const A=i.value.getCurrentNode();return A?A.data:null},w=()=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const A=b();return A?A[t.nodeKey]:null},C=(A,z)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");i.value.setCheckedNodes(A,z)},x=(A,z)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");i.value.setCheckedKeys(A,z)},k=(A,z,j)=>{i.value.setChecked(A,z,j)},E=()=>i.value.getHalfCheckedNodes(),_=()=>i.value.getHalfCheckedKeys(),S=(A,z=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");Bu(i,e.emit,()=>{d(A),i.value.setUserCurrentNode(A,z)})},T=(A,z=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");Bu(i,e.emit,()=>{d(),i.value.setCurrentNodeKey(A,z)})},N=A=>i.value.getNode(A),B=A=>{i.value.remove(A)},P=(A,z)=>{i.value.append(A,z)},D=(A,z)=>{i.value.insertBefore(A,z)},R=(A,z)=>{i.value.insertAfter(A,z)},O=(A,z,j)=>{d(z),e.emit("node-expand",A,z,j)},F=(A,z)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");i.value.updateChildren(A,z)};return s.provide("RootTree",{ctx:e,props:t,store:i,root:o,currentNode:l,instance:s.getCurrentInstance()}),s.provide(Pi,void 0),{ns:n,store:i,root:o,currentNode:l,dragState:f,el$:c,dropIndicator$:u,isEmpty:h,filter:v,getNodeKey:p,getNodePath:g,getCheckedNodes:y,getCheckedKeys:m,getCurrentNode:b,getCurrentKey:w,setCheckedNodes:C,setCheckedKeys:x,setChecked:k,getHalfCheckedNodes:E,getHalfCheckedKeys:_,setCurrentNode:S,setCurrentKey:T,t:r,getNode:N,remove:B,append:P,insertBefore:D,insertAfter:R,handleNodeExpand:O,updateKeyChildren:F}}});function KL(t,e,r,n,a,i){const o=s.resolveComponent("el-tree-node");return s.openBlock(),s.createElementBlock("div",{ref:"el$",class:s.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"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.root.childNodes,l=>(s.openBlock(),s.createBlock(o,{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?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(t.ns.e("empty-block"))},[s.renderSlot(t.$slots,"empty",{},()=>{var l;return[s.createElementVNode("span",{class:s.normalizeClass(t.ns.e("empty-text"))},s.toDisplayString((l=t.emptyText)!=null?l:t.t("el.tree.emptyText")),3)]})],2)):s.createCommentVNode("v-if",!0),s.withDirectives(s.createElementVNode("div",{ref:"dropIndicator$",class:s.normalizeClass(t.ns.e("drop-indicator"))},null,2),[[s.vShow,t.dragState.showDropIndicator]])],2)}var GL=Be(HL,[["render",KL],["__file","tree.vue"]]);const UL=dt(GL);function jL(t){let e;const r=s.ref(!1),n=s.reactive({...t,originalPosition:"",originalOverflow:"",visible:!1});function a(h){n.text=h}function i(){const h=n.parent,v=f.ns;if(!h.vLoadingAddClassList){let p=h.getAttribute("loading-number");p=Number.parseInt(p)-1,p?h.setAttribute("loading-number",p.toString()):(qn(h,v.bm("parent","relative")),h.removeAttribute("loading-number")),qn(h,v.bm("parent","hidden"))}o(),d.unmount()}function o(){var h,v;(v=(h=f.$el)==null?void 0:h.parentNode)==null||v.removeChild(f.$el)}function l(){var h;t.beforeClose&&!t.beforeClose()||(r.value=!0,clearTimeout(e),e=setTimeout(c,400),n.visible=!1,(h=t.closed)==null||h.call(t))}function c(){if(!r.value)return;const h=n.parent;r.value=!1,h.vLoadingAddClassList=void 0,i()}const u=s.defineComponent({name:"ElLoading",setup(h,{expose:v}){const{ns:p,zIndex:g}=LP("loading");return v({ns:p,zIndex:g}),()=>{const y=n.spinner||n.svg,m=s.h("svg",{class:"circular",viewBox:n.svgViewBox?n.svgViewBox:"0 0 50 50",...y?{innerHTML:y}:{}},[s.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),b=n.text?s.h("p",{class:p.b("text")},[n.text]):void 0;return s.h(s.Transition,{name:p.b("fade"),onAfterLeave:c},{default:s.withCtx(()=>[s.withDirectives(s.createVNode("div",{style:{backgroundColor:n.background||""},class:[p.b("mask"),n.customClass,n.fullscreen?"is-fullscreen":""]},[s.h("div",{class:p.b("spinner")},[m,b])]),[[s.vShow,n.visible]])])})}}}),d=s.createApp(u),f=d.mount(document.createElement("div"));return{...s.toRefs(n),setText:a,removeElLoadingChild:o,close:l,handleAfterLeave:c,vm:f,get $el(){return f.$el}}}let ls;const WL=function(t={}){if(!nt)return;const e=YL(t);if(e.fullscreen&&ls)return ls;const r=jL({...e,closed:()=>{var a;(a=e.closed)==null||a.call(e),e.fullscreen&&(ls=void 0)}});ZL(e,e.parent,r),C0(e,e.parent,r),e.parent.vLoadingAddClassList=()=>C0(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),s.nextTick(()=>r.visible.value=e.visible),e.fullscreen&&(ls=r),r},YL=t=>{var e,r,n,a;let i;return ct(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}},ZL=async(t,e,r)=>{const{nextZIndex:n}=r.vm.zIndex||r.vm._.exposed.zIndex,a={};if(t.fullscreen)r.originalPosition.value=Ci(document.body,"position"),r.originalOverflow.value=Ci(document.body,"overflow"),a.zIndex=n();else if(t.parent===document.body){r.originalPosition.value=Ci(document.body,"position"),await s.nextTick();for(const i of["top","left"]){const o=i==="top"?"scrollTop":"scrollLeft";a[i]=`${t.target.getBoundingClientRect()[i]+document.body[o]+document.documentElement[o]-Number.parseInt(Ci(document.body,`margin-${i}`),10)}px`}for(const i of["height","width"])a[i]=`${t.target.getBoundingClientRect()[i]}px`}else r.originalPosition.value=Ci(e,"position");for(const[i,o]of Object.entries(a))r.$el.style[i]=o},C0=(t,e,r)=>{const n=r.vm.ns||r.vm._.exposed.ns;["absolute","fixed","sticky"].includes(r.originalPosition.value)?qn(e,n.bm("parent","relative")):Ul(e,n.bm("parent","relative")),t.fullscreen&&t.lock?Ul(e,n.bm("parent","hidden")):qn(e,n.bm("parent","hidden"))},us=Symbol("ElLoading"),E0=(t,e)=>{var r,n,a,i;const o=e.instance,l=h=>yt(e.value)?e.value[h]:void 0,c=h=>{const v=ct(h)&&(o==null?void 0:o[h])||h;return v&&s.ref(v)},u=h=>c(l(h)||t.getAttribute(`element-loading-${lT(h)}`)),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[us]={options:f,instance:WL(f)}},XL=(t,e)=>{for(const r of Object.keys(e))s.isRef(e[r])&&(e[r].value=t[r])},Pu={mounted(t,e){e.value&&E0(t,e)},updated(t,e){const r=t[us];e.oldValue!==e.value&&(e.value&&!e.oldValue?E0(t,e):e.value&&e.oldValue?yt(e.value)&&XL(e.value,r.options):r==null||r.instance.close())},unmounted(t){var e;(e=t[us])==null||e.instance.close(),t[us]=null}},Yt=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},JL="Copy to clipboard",QL="Copied!",eF={name:"CopyToClipboard",props:{content:{type:String,default:""},label:{type:String,default:JL},theme:{type:String,default:""}},data:function(){return{textLabel:this.label,autoHideTimeout:0,tooltipContainer:null}},mounted(){const t=document.querySelector(".mapcontent");t?this.tooltipContainer=t:this.tooltipContainer=document.body},methods:{copyToClipboard:async function(){let t=!0;this.autoHideTimeout=600;try{const e=this.content.replaceAll(`
21
+ `,""),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"}),o=new ClipboardItem({"text/html":a,"text/plain":i});await navigator.clipboard.write([o])}catch(e){console.error("Error when trying to use navigator.clipboard.write()",e),t=!1}t?(this.textLabel=QL,this.$emit("copied",{status:"success"})):(this.textLabel="Error trying to copy to clipboard!",this.$emit("copied",{status:"error"}))},resetSettings:function(){this.autoHideTimeout=0,this.textLabel=this.label}}},tF={class:"visually-hidden"};function rF(t,e,r,n,a,i){const o=Ne.CopyDocument,l=it,c=Ht,u=Pa;return s.openBlock(),s.createBlock(u,{content:t.textLabel,placement:"bottom","hide-after":t.autoHideTimeout,effect:"clipboard-tooltip",onHide:i.resetSettings,teleported:!0,"append-to":t.tooltipContainer},{default:s.withCtx(()=>[s.createVNode(c,{class:s.normalizeClass(["copy-clipboard-button",r.theme]),size:"small",onClick:i.copyToClipboard,disabled:!r.content},{default:s.withCtx(()=>[s.createVNode(l,{color:r.content?"#8300bf":"#dab3ec"},{default:s.withCtx(()=>[s.createVNode(o)]),_:1},8,["color"]),s.createElementVNode("span",tF,s.toDisplayString(t.textLabel),1)]),_:1},8,["class","onClick","disabled"])]),_:1},8,["content","hide-after","onHide","append-to"])}const cs=Yt(eF,[["render",rF],["__scopeId","data-v-c791b9aa"]]),nF={name:"AnnotationPopup",props:{annotationEntry:{type:Array}},inject:["$annotator","userApiKey"],data:function(){return{displayPair:{"Feature ID":"featureId",Label:"label",Ontology:"models",Name:"name",Resource:"resourceId"},editing:!1,evidencePrefixes:[{value:"DOI:",label:"DOI:"},{value:"PMID:",label:"PMID:"},{value:"",label:"Other:"}],evidencePrefix:"DOI:",evidence:[],authenticated:!1,newEvidence:"",comment:"",prevSubs:[],showSubmissions:!0,errorMessage:"",creator:void 0,copyContent:"",entryIndex:0}},computed:{entry:function(){return this.annotationEntry[this.entryIndex]},previousLabel:function(){var t;return this.entryIndex===0?"This is the first item. Click 'Next' to see more information.":(t=this.annotationEntry[this.entryIndex-1])==null?void 0:t.label},nextLabel:function(){var t;return this.entryIndex===this.annotationEntry.length-1?"This is the last item. Click 'Previous' to see more information.":(t=this.annotationEntry[this.entryIndex+1])==null?void 0:t.label},isEditable:function(){return this.entry.resourceId&&this.entry.featureId},isPositionUpdated:function(){return this.entry.resourceId&&this.entry.type==="updated"&&this.entry.positionUpdated},isDeleted:function(){return this.entry.resourceId&&this.entry.type==="deleted"},ontologyLink:function(){const t=this.entry.models;if(t&&t.startsWith("UBERON"))return`http://purl.obolibrary.org/obo/${this.entry.models.replace(":","_")}`},updatedCopyContent:function(){return this.getUpdateCopyContent()},offlineAnnotationEnabled:function(){return this.entry?this.entry.offline:!1}},methods:{previous:function(){if(this.entryIndex!==0){this.entryIndex=this.entryIndex-1,this.emitActiveItemChange();const t=this.annotationEntry[this.entryIndex],e={event_name:"portal_maps_annotation_previous",category:String((t==null?void 0:t.featureId)||"")};this.trackEvent(e)}},next:function(){if(this.entryIndex!==this.annotationEntry.length-1){this.entryIndex=this.entryIndex+1,this.emitActiveItemChange();const t=this.annotationEntry[this.entryIndex],e={event_name:"portal_maps_annotation_next",category:String((t==null?void 0:t.featureId)||"")};this.trackEvent(e)}},emitActiveItemChange:function(){const t={tabType:"annotation"},e=this.annotationEntry[this.entryIndex],r={...t,...e};this.$emit("hover-changed",r)},processEvidences:function(t){var r;const e=[];return(r=t==null?void 0:t.body)!=null&&r.evidence&&t.body.evidence.forEach(n=>{if(typeof n=="object")e.push(n);else{const a={};if(n.includes("https://doi.org/")){const i=n.replace("https://doi.org/","DOI:");a[i]=n}else if(n.includes("https://pubmed.ncbi.nlm.nih.gov/")){const i=n.replace("https://pubmed.ncbi.nlm.nih.gov/","PMID:");a[i]=n}Object.keys(a).length>0?e.push(a):e.push(n)}}),e},evidenceEntered:function(t){t&&(this.evidence.push(this.evidencePrefix+t),this.newEvidence="")},formatTime:function(t){const e={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"};return new Date(t).toLocaleDateString(void 0,e)},updatePrevSubmissions:function(){var t;if(this.offlineAnnotationEnabled){const e=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[];this.prevSubs=e.filter(r=>r.resource===this.entry.resourceId&&r.item.id===this.entry.featureId)}else this.$annotator&&this.authenticated&&this.entry.resourceId&&this.entry.featureId&&((t=this.$annotator)==null||t.itemAnnotations(this.userApiKey,this.entry.resourceId,this.entry.featureId).then(e=>{this.prevSubs=e}).catch(e=>{console.log(e)}))},submit:function(){var t;if(this.entry.type==="updated"&&this.entry.positionUpdated?this.comment=this.comment?`Position Updated: ${this.comment}`:"Position Updated":this.entry.type==="deleted"&&(this.comment=this.comment?`Feature Deleted: ${this.comment}`:"Feature Deleted"),(this.evidence.length>0||this.comment)&&this.entry.resourceId&&this.entry.featureId){const e=[];this.evidence.forEach(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.entry.resourceId,item:Object.assign({id:this.entry.featureId},Object.fromEntries(Object.entries(this.entry).filter(([n])=>["label","models"].includes(n)))),body:{evidence:e,comment:this.comment},feature:this.entry.feature};Object.assign(r.body,this.entry.body),this.entry.type==="deleted"&&(r.feature=void 0),this.creator&&(r.creator=this.creator),(t=this.$annotator)==null||t.addAnnotation(this.userApiKey,r).then(()=>{this.errorMessage="",this.resetSubmission(),this.updatePrevSubmissions()}).catch(()=>{this.errorMessage="There is a problem with the submission, please try again later"}),this.$emit("annotation",r)}},removeEvidence:function(t){this.evidence.splice(t,1)},resetSubmission:function(){this.editing=!1,this.evidence=[],this.newFeature="",this.comment=""},getUpdateCopyContent:function(){if(!this.entry)return"";const t=[];if(this.entry.featureId&&t.push(`<div><strong>Feature ID:</strong>${this.entry.featureId}</div>`),this.entry.label&&t.push(`<div><strong>Label:</strong>${this.entry.label}</div>`),this.entry.models&&(t.push(`<div><strong>Ontology:</strong>${this.entry.models}</div>`),this.ontologyLink&&t.push(`<div><strong>Ontology Link:</strong>${this.ontologyLink}</div>`)),this.entry.resourceId&&t.push(`<div><strong>Resource:</strong>${this.entry.resourceId}</div>`),this.prevSubs.length){let e=`<div><strong>Annotations:</strong></div>
22
22
  <br>`;this.prevSubs.map((r,n)=>{if(r.creator&&(e+=`<div><strong>Created:</strong>${this.formatTime(r.created)}</div>
23
23
  <br>`,e+=`<div><strong>Creator:</strong>${r.creator.name}</div>
24
24
  <br>`,e+=`<div><strong>Email:</strong>${r.creator.email}</div>
@@ -26,33 +26,33 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:n,curr
26
26
  <br>`}e+=`<div><strong>Comment:</strong>${r.body.comment}</div>
27
27
  <br>`}),t.push(`<div>${e}</div>`)}return t.join(`
28
28
 
29
- <br>`)},onCopied:function(){const t=this.annotationEntry[this.entryIndex],e={event_name:"portal_maps_annotation_copy_content",category:String((t==null?void 0:t.featureId)||"")};this.trackEvent(e)},trackEvent:function(t){const e={event:"interaction_event",location:"map_annotation",...t};this.$emit("trackEvent",e)}},watch:{annotationEntry:{deep:!0,immediate:!0,handler:function(t,e){t!==e&&(this.entryIndex=0,t!=null&&t.length&&this.emitActiveItemChange())}},entry:{deep:!0,immediate:!0,handler:function(t,e){t&&t!==e&&(this.resetSubmission(),this.updatePrevSubmissions())}}},mounted:function(){var t;(t=this.$annotator)==null||t.authenticate(this.userApiKey).then(e=>{e.name&&e.email&&e.canUpdate?(this.creator=e,e.orcid||(this.creator.orcid="0000-0000-0000-0000"),this.authenticated=!0):this.errorMessage="",this.updatePrevSubmissions()})}},Yn=t=>(s.pushScopeId("data-v-2a2f8754"),t=t(),s.popScopeId(),t),ZL={key:0,class:"toggle-button"},XL={class:"block"},JL=Yn(()=>s.createElementVNode("div",{class:"title"},"Feature Annotations",-1)),QL={class:"title-buttons"},eM={key:0},tM=["href"],rM=Yn(()=>s.createElementVNode("strong",{class:"sub-title"},"Previous submissions:",-1)),nM=Yn(()=>s.createElementVNode("strong",null,"Evidence:  ",-1)),aM=["href"],iM={key:1},oM={key:2},sM=Yn(()=>s.createElementVNode("strong",null,"Comment:  ",-1)),lM=Yn(()=>s.createElementVNode("strong",{class:"sub-title"},"Suggest changes:",-1)),uM=Yn(()=>s.createElementVNode("strong",null,"Evidence:",-1)),cM=Yn(()=>s.createElementVNode("strong",null,"Comment:",-1)),dM={class:"sub-title"};function fM(t,e,r,n,a,i){const o=Ht,l=Oa,c=us,u=as,d=Ne.ArrowUp,f=ut,h=Ne.ArrowDown,v=Ne.Edit,p=Ne.Delete,g=Ne.Finished,m=Ri,y=Ne.Close,b=mL,w=gL,C=Di,x=ku;return s.openBlock(),s.createBlock(x,{class:"main"},{default:s.withCtx(()=>[r.annotationEntry.length>1?(s.openBlock(),s.createElementBlock("div",ZL,[s.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:s.withCtx(()=>[s.createVNode(o,{class:"button",onClick:i.previous,disabled:this.entryIndex===0},{default:s.withCtx(()=>[s.createTextVNode(" Previous ")]),_:1},8,["onClick","disabled"])]),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(i.previousLabel),1)]),_:1}),s.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:s.withCtx(()=>[s.createVNode(o,{class:"button",onClick:i.next,disabled:this.entryIndex===this.annotationEntry.length-1},{default:s.withCtx(()=>[s.createTextVNode(" Next ")]),_:1},8,["onClick","disabled"])]),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(i.nextLabel),1)]),_:1})])):s.createCommentVNode("",!0),s.createElementVNode("div",XL,[s.createVNode(u,{class:"info-field"},{default:s.withCtx(()=>[JL,s.createElementVNode("div",QL,[s.createVNode(c,{onCopied:i.onCopied,content:i.updatedCopyContent},null,8,["onCopied","content"])])]),_:1}),i.entry?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.displayPair,(k,E)=>s.withDirectives((s.openBlock(),s.createBlock(u,{class:"dialog-text",key:k},{default:s.withCtx(()=>[s.createElementVNode("strong",null,s.toDisplayString(E)+": ",1),s.createTextVNode("  "),E!=="Ontology"?(s.openBlock(),s.createElementBlock("span",eM,s.toDisplayString(i.entry[k]),1)):(s.openBlock(),s.createElementBlock("a",{key:1,href:i.ontologyLink,target:"_blank"},s.toDisplayString(i.entry[k]),9,tM))]),_:2},1024)),[[s.vShow,i.entry[k]]])),128)),t.prevSubs.length>0?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.withDirectives(s.createElementVNode("div",{class:"hide",onClick:e[0]||(e[0]=k=>t.showSubmissions=!1)},[s.createTextVNode(" Hide previous submissions "),s.createVNode(f,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})],512),[[s.vShow,t.showSubmissions]]),s.withDirectives(s.createElementVNode("div",{class:"hide",onClick:e[1]||(e[1]=k=>t.showSubmissions=!0)},[s.createTextVNode(" Show previous "+s.toDisplayString(t.prevSubs.length)+" submission(s) ",1),s.createVNode(f,null,{default:s.withCtx(()=>[s.createVNode(h)]),_:1})],512),[[s.vShow,!t.showSubmissions]]),t.showSubmissions?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(u,{class:"dialog-spacer"}),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[rM]),_:1}),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.prevSubs,(k,E)=>(s.openBlock(),s.createElementBlock("div",{class:"entry",key:E},[k.creator?(s.openBlock(),s.createBlock(u,{key:0,class:"dialog-text"},{default:s.withCtx(()=>[s.createElementVNode("strong",null,s.toDisplayString(i.formatTime(k.created)),1),s.createTextVNode(" "+s.toDisplayString(k.creator.name),1)]),_:2},1024)):s.createCommentVNode("",!0),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[nM,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.processEvidences(k),(_,S)=>(s.openBlock(),s.createBlock(u,{key:_,class:"dialog-text"},{default:s.withCtx(()=>[typeof _=="object"?(s.openBlock(),s.createElementBlock("a",{key:0,href:Object.values(_)[0],target:"_blank"},s.toDisplayString(Object.keys(_)[0]),9,aM)):(s.openBlock(),s.createElementBlock("span",iM,s.toDisplayString(_),1)),S!==k.body.evidence.length-1?(s.openBlock(),s.createElementBlock("span",oM,", ")):s.createCommentVNode("",!0)]),_:2},1024))),128))]),_:2},1024),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[sM,s.createTextVNode(" "+s.toDisplayString(k.body.comment),1)]),_:2},1024)]))),128))],64)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0),t.authenticated||i.offlineAnnotationEnabled?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[i.isEditable?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(u,{class:"dialog-spacer"}),t.editing?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[lM]),_:1}),i.isDeleted?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[uM]),_:1}),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.evidence,(k,E)=>(s.openBlock(),s.createBlock(u,{key:k},{default:s.withCtx(()=>[s.createVNode(m,{span:20},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(t.evidence[E]),1)]),_:2},1024),s.createVNode(m,{span:4},{default:s.withCtx(()=>[s.createVNode(f,{class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(y,{onClick:_=>i.removeEvidence(E)},null,8,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),s.createVNode(u,null,{default:s.withCtx(()=>[s.createVNode(C,{size:"small",placeholder:"Enter",modelValue:t.newEvidence,"onUpdate:modelValue":e[4]||(e[4]=k=>t.newEvidence=k),onChange:e[5]||(e[5]=k=>i.evidenceEntered(k))},{prepend:s.withCtx(()=>[s.createVNode(w,{teleported:!1,modelValue:t.evidencePrefix,"onUpdate:modelValue":e[3]||(e[3]=k=>t.evidencePrefix=k),placeholder:"Other:",class:"select-box","popper-class":"flatmap_dropdown"},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.evidencePrefixes,k=>(s.openBlock(),s.createBlock(b,{key:k.label,value:k.value},{default:s.withCtx(()=>[s.createVNode(u,null,{default:s.withCtx(()=>[s.createVNode(m,{span:12},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(k.label),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1})],64)),s.createVNode(u,null,{default:s.withCtx(()=>[cM]),_:1}),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[s.createVNode(C,{type:"textarea",autosize:{minRows:2,maxRows:4},placeholder:"Enter",modelValue:t.comment,"onUpdate:modelValue":e[6]||(e[6]=k=>t.comment=k)},null,8,["modelValue"])]),_:1}),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[s.createVNode(o,{class:"button",type:"primary",plain:"",onClick:i.submit},{default:s.withCtx(()=>[s.createTextVNode(" Submit ")]),_:1},8,["onClick"])]),_:1})],64)):(s.openBlock(),s.createBlock(u,{key:0},{default:s.withCtx(()=>[s.createVNode(f,{class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(v,{onClick:e[2]||(e[2]=k=>t.editing=!0)})]),_:1}),i.isDeleted?(s.openBlock(),s.createBlock(f,{key:0,class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(p,{onClick:i.submit},null,8,["onClick"])]),_:1})):i.isPositionUpdated?(s.openBlock(),s.createBlock(f,{key:1,class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(g,{onClick:i.submit},null,8,["onClick"])]),_:1})):s.createCommentVNode("",!0)]),_:1})),t.errorMessage?(s.openBlock(),s.createBlock(u,{key:2,class:"dialog-text"},{default:s.withCtx(()=>[s.createElementVNode("strong",dM,s.toDisplayString(t.errorMessage),1)]),_:1})):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)])]),_:1})}const g0=Yt(YL,[["render",fM],["__scopeId","data-v-2a2f8754"]]),hM={name:"CreateTooltipContent",components:{Button:Ht,Col:Ri,Container:xu,Header:o0,Input:Di,Main:ku},props:{createData:{type:Object}},watch:{"createData.shape":{handler:function(t,e){this.group=this.createData.tempGroupName?this.createData.tempGroupName:t,e!==void 0&&this.$emit("cancel-create")},immediate:!0},"createData.tempGroupName":{handler:function(t,e){this.group=t||this.createData.shape},immediate:!0}},computed:{confirmText:function(){return this.createData.editingIndex>-1?"Edit":"Confirm"},dialogTitle:function(){return this.createData.editingIndex>-1?`Edit ${this.createData.shape}`:`Create ${this.createData.shape}`}},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")}}},pM={key:0,class:"create-text"};function vM(t,e,r,n,a,i){const o=o0,l=Ri,c=as,u=Di,d=Ht,f=ku,h=xu;return s.openBlock(),s.createBlock(h,{class:"create-container"},{default:s.withCtx(()=>[s.createVNode(o,{height:"30px",class:"header"},{default:s.withCtx(()=>[s.createElementVNode("div",null,s.toDisplayString(i.dialogTitle),1)]),_:1}),s.createVNode(f,{class:"slides-block"},{default:s.withCtx(()=>[r.createData.editingIndex===-1?(s.openBlock(),s.createElementBlock("span",pM," Primitives will be created in the __annotation region ")):s.createCommentVNode("",!0),s.withDirectives(s.createVNode(c,{class:"row"},{default:s.withCtx(()=>[s.createVNode(l,{offset:0,span:8},{default:s.withCtx(()=>[s.createTextVNode(" Position: ")]),_:1}),s.createVNode(l,{offset:0,span:16},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.createData.points,({value:v,i:p})=>(s.openBlock(),s.createBlock(c,{key:p,class:"value"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(p),1)]),_:2},1024))),128))]),_:1})]),_:1},512),[[s.vShow,t.showPoint]]),s.createVNode(c,{class:"row"},{default:s.withCtx(()=>[s.createVNode(l,{offset:0,span:8},{default:s.withCtx(()=>[s.createTextVNode(" Region: ")]),_:1}),s.createVNode(l,{offset:0,span:16},{default:s.withCtx(()=>[s.createVNode(u,{modelValue:t.region,"onUpdate:modelValue":e[0]||(e[0]=v=>t.region=v),placeholder:"__annotation",size:"small"},null,8,["modelValue"])]),_:1})]),_:1}),s.createVNode(c,{class:"row"},{default:s.withCtx(()=>[s.createVNode(l,{offset:0,span:8},{default:s.withCtx(()=>[s.createTextVNode(" Group: ")]),_:1}),s.createVNode(l,{offset:0,span:16},{default:s.withCtx(()=>[s.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}),s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(l,{offset:0,span:12},{default:s.withCtx(()=>[s.createVNode(d,{type:"primary",plain:"",onClick:i.confirm},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.confirmText),1)]),_:1},8,["onClick"])]),_:1}),s.createVNode(l,{offset:0,span:12},{default:s.withCtx(()=>[s.createVNode(d,{type:"primary",plain:"",onClick:i.cancel},{default:s.withCtx(()=>[s.createTextVNode(" Cancel ")]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1})]),_:1})}const gM=Yt(hM,[["render",vM],["__scopeId","data-v-e1fc3071"]]);function ct(t){"@babel/helpers - typeof";return ct=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},ct(t)}function Du(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mM(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 Ou(t,e,r){return e&&mM(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function m0(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vr(t,e){return yM(t)||bM(t,e)||y0(t,e)||wM()}function yM(t){if(Array.isArray(t))return t}function bM(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],a=!0,i=!1,o,l;try{for(r=r.call(t);!(a=(o=r.next()).done)&&(n.push(o.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 y0(t,e){if(t){if(typeof t=="string")return b0(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 b0(t,e)}}function b0(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 wM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
30
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w0(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=y0(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.
31
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,l;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return i=c.done,c},e:function(c){o=!0,l=c},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(o)throw l}}}}var dt=typeof window>"u"?null:window,C0=dt?dt.navigator:null;dt&&dt.document;var CM=ct(""),E0=ct({}),EM=ct(function(){}),xM=typeof HTMLElement>"u"?"undefined":ct(HTMLElement),qi=function(e){return e&&e.instanceString&&Xe(e.instanceString)?e.instanceString():null},Ee=function(e){return e!=null&&ct(e)==CM},Xe=function(e){return e!=null&&ct(e)===EM},Ke=function(e){return!Zt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Ae=function(e){return e!=null&&ct(e)===E0&&!Ke(e)&&e.constructor===Object},kM=function(e){return e!=null&&ct(e)===E0},de=function(e){return e!=null&&ct(e)===ct(1)&&!isNaN(e)},SM=function(e){return de(e)&&Math.floor(e)===e},cs=function(e){if(xM!=="undefined")return e!=null&&e instanceof HTMLElement},Zt=function(e){return zi(e)||x0(e)},zi=function(e){return qi(e)==="collection"&&e._private.single},x0=function(e){return qi(e)==="collection"&&!e._private.single},Pu=function(e){return qi(e)==="core"},k0=function(e){return qi(e)==="stylesheet"},_M=function(e){return qi(e)==="event"},mn=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},TM=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},NM=function(e){return Ae(e)&&de(e.x1)&&de(e.x2)&&de(e.y1)&&de(e.y2)},IM=function(e){return kM(e)&&Xe(e.then)},BM=function(){return C0&&C0.userAgent.match(/msie|trident|edge/i)},Hi=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")});var n=function a(){var i=this,o=arguments,l,c=r.apply(i,o),u=a.cache;return(l=u[c])||(l=u[c]=e.apply(i,o)),l};return n.cache={},n},Au=Hi(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),ds=Hi(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),S0=Hi(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),_0=function(e){return mn(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},ft="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",DM="rgb[a]?\\(("+ft+"[%]?)\\s*,\\s*("+ft+"[%]?)\\s*,\\s*("+ft+"[%]?)(?:\\s*,\\s*("+ft+"))?\\)",OM="rgb[a]?\\((?:"+ft+"[%]?)\\s*,\\s*(?:"+ft+"[%]?)\\s*,\\s*(?:"+ft+"[%]?)(?:\\s*,\\s*(?:"+ft+"))?\\)",PM="hsl[a]?\\(("+ft+")\\s*,\\s*("+ft+"[%])\\s*,\\s*("+ft+"[%])(?:\\s*,\\s*("+ft+"))?\\)",AM="hsl[a]?\\((?:"+ft+")\\s*,\\s*(?:"+ft+"[%])\\s*,\\s*(?:"+ft+"[%])(?:\\s*,\\s*(?:"+ft+"))?\\)",RM="\\#[0-9a-fA-F]{3}",LM="\\#[0-9a-fA-F]{6}",T0=function(e,r){return e<r?-1:e>r?1:0},MM=function(e,r){return-1*T0(e,r)},Se=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 o=a[i];t[o]=n[o]}}return t},FM=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,n,a,i,o=16;return r?(n=parseInt(e[1]+e[1],o),a=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(n=parseInt(e[1]+e[2],o),a=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[n,a,i]}},$M=function(e){var r,n,a,i,o,l,c,u;function d(p,g,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?p+(g-p)*6*m:m<1/2?g:m<2/3?p+(g-p)*(2/3-m)*6:p}var f=new RegExp("^"+PM+"$").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,o=f[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(a===0)l=c=u=Math.round(i*255);else{var h=i<.5?i*(1+a):i+a-i*a,v=2*i-h;l=Math.round(255*d(v,h,n+1/3)),c=Math.round(255*d(v,h,n)),u=Math.round(255*d(v,h,n-1/3))}r=[l,c,u,o]}return r},VM=function(e){var r,n=new RegExp("^"+DM+"$").exec(e);if(n){r=[];for(var a=[],i=1;i<=3;i++){var o=n[i];if(o[o.length-1]==="%"&&(a[i]=!0),o=parseFloat(o),a[i]&&(o=o/100*255),o<0||o>255)return;r.push(Math.floor(o))}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},qM=function(e){return HM[e.toLowerCase()]},zM=function(e){return(Ke(e)?e:null)||qM(e)||FM(e)||VM(e)||$M(e)},HM={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]},N0=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(Ae(o))throw Error("Tried to set map with object key");i<n.length-1?(r[o]==null&&(r[o]={}),r=r[o]):r[o]=e.value}},I0=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(Ae(o))throw Error("Tried to get map with object key");if(r=r[o],r==null)return r}return r};function KM(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Zn=KM,Ki=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function GM(t,e){return e={exports:{}},t(e,e.exports),e.exports}var UM=typeof Ki=="object"&&Ki&&Ki.Object===Object&&Ki,jM=UM,WM=typeof self=="object"&&self&&self.Object===Object&&self,YM=jM||WM||Function("return this")(),fs=YM,ZM=function(){return fs.Date.now()},Ru=ZM,XM=/\s/;function JM(t){for(var e=t.length;e--&&XM.test(t.charAt(e)););return e}var QM=JM,eF=/^\s+/;function tF(t){return t&&t.slice(0,QM(t)+1).replace(eF,"")}var rF=tF,nF=fs.Symbol,Aa=nF,B0=Object.prototype,aF=B0.hasOwnProperty,iF=B0.toString,Gi=Aa?Aa.toStringTag:void 0;function oF(t){var e=aF.call(t,Gi),r=t[Gi];try{t[Gi]=void 0;var n=!0}catch{}var a=iF.call(t);return n&&(e?t[Gi]=r:delete t[Gi]),a}var sF=oF,lF=Object.prototype,uF=lF.toString;function cF(t){return uF.call(t)}var dF=cF,fF="[object Null]",hF="[object Undefined]",D0=Aa?Aa.toStringTag:void 0;function pF(t){return t==null?t===void 0?hF:fF:D0&&D0 in Object(t)?sF(t):dF(t)}var O0=pF;function vF(t){return t!=null&&typeof t=="object"}var gF=vF,mF="[object Symbol]";function yF(t){return typeof t=="symbol"||gF(t)&&O0(t)==mF}var Ui=yF,P0=NaN,bF=/^[-+]0x[0-9a-f]+$/i,wF=/^0b[01]+$/i,CF=/^0o[0-7]+$/i,EF=parseInt;function xF(t){if(typeof t=="number")return t;if(Ui(t))return P0;if(Zn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Zn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=rF(t);var r=wF.test(t);return r||CF.test(t)?EF(t.slice(2),r?2:8):bF.test(t)?P0:+t}var A0=xF,kF="Expected a function",SF=Math.max,_F=Math.min;function TF(t,e,r){var n,a,i,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(kF);e=A0(e)||0,Zn(r)&&(d=!!r.leading,f="maxWait"in r,i=f?SF(A0(r.maxWait)||0,e):i,h="trailing"in r?!!r.trailing:h);function v(k){var E=n,_=a;return n=a=void 0,u=k,o=t.apply(_,E),o}function p(k){return u=k,l=setTimeout(y,e),d?v(k):o}function g(k){var E=k-c,_=k-u,S=e-E;return f?_F(S,i-_):S}function m(k){var E=k-c,_=k-u;return c===void 0||E>=e||E<0||f&&_>=i}function y(){var k=Ru();if(m(k))return b(k);l=setTimeout(y,g(k))}function b(k){return l=void 0,h&&n?v(k):(n=a=void 0,o)}function w(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function C(){return l===void 0?o:b(Ru())}function x(){var k=Ru(),E=m(k);if(n=arguments,a=this,c=k,E){if(l===void 0)return p(c);if(f)return clearTimeout(l),l=setTimeout(y,e),v(c)}return l===void 0&&(l=setTimeout(y,e)),o}return x.cancel=w,x.flush=C,x}var hs=TF,Lu=dt?dt.performance:null,R0=Lu&&Lu.now?function(){return Lu.now()}:function(){return Date.now()},NF=function(){if(dt){if(dt.requestAnimationFrame)return function(t){dt.requestAnimationFrame(t)};if(dt.mozRequestAnimationFrame)return function(t){dt.mozRequestAnimationFrame(t)};if(dt.webkitRequestAnimationFrame)return function(t){dt.webkitRequestAnimationFrame(t)};if(dt.msRequestAnimationFrame)return function(t){dt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(R0())},1e3/60)}}(),ps=function(e){return NF(e)},Wr=R0,Ra=9261,L0=65599,ji=5381,M0=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ra,n=r,a;a=e.next(),!a.done;)n=n*L0+a.value|0;return n},Wi=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ra;return r*L0+e|0},Yi=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ji;return(r<<5)+r+e|0},IF=function(e,r){return e*2097152+r},yn=function(e){return e[0]*2097152+e[1]},vs=function(e,r){return[Wi(e[0],r[0]),Yi(e[1],r[1])]},BF=function(e,r){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e[a++]:n.done=!0,n}};return M0(o,r)},Xn=function(e,r){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}};return M0(o,r)},F0=function(){return DF(arguments)},DF=function(e){for(var r,n=0;n<e.length;n++){var a=e[n];n===0?r=Xn(a):r=Xn(a,r)}return r},$0=!0,OF=console.warn!=null,PF=console.trace!=null,Mu=Number.MAX_SAFE_INTEGER||9007199254740991,V0=function(){return!0},gs=function(){return!1},q0=function(){return 0},Fu=function(){},Je=function(e){throw new Error(e)},z0=function(e){if(e!==void 0)$0=!!e;else return $0},$e=function(e){z0()&&(OF?console.warn(e):(console.log(e),PF&&console.trace()))},AF=function(e){return Se({},e)},Nr=function(e){return e==null?e:Ke(e)?e.slice():Ae(e)?AF(e):e},RF=function(e){return e.slice()},H0=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},LF={},K0=function(){return LF},xt=function(e){var r=Object.keys(e);return function(n){for(var a={},i=0;i<r.length;i++){var o=r[i],l=n==null?void 0:n[o];a[o]=l===void 0?e[o]:l}return a}},bn=function(e,r,n){for(var a=e.length-1;a>=0;a--)e[a]===r&&e.splice(a,1)},$u=function(e){e.splice(0,e.length)},MF=function(e,r){for(var n=0;n<r.length;n++){var a=r[n];e.push(a)}},gr=function(e,r,n){return n&&(r=S0(n,r)),e[r]},wn=function(e,r,n,a){n&&(r=S0(n,r)),e[r]=a},FF=function(){function t(){Du(this,t),this._obj={}}return Ou(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}(),Ir=typeof Map<"u"?Map:FF,$F="undefined",VF=function(){function t(e){if(Du(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 Ou(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}(),La=(typeof Set>"u"?"undefined":ct(Set))!==$F?Set:VF,ms=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Pu(e)){Je("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"){Je("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 La,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 o=r.renderedPosition,l=e.pan(),c=e.zoom();i.position={x:(o.x-l.x)/c,y:(o.y-l.y)/c}}var u=[];Ke(r.classes)?u=r.classes:Ee(r.classes)&&(u=r.classes.split(/\s+/));for(var d=0,f=u.length;d<f;d++){var h=u[d];!h||h===""||i.classes.add(h)}this.createEmitter();var v=r.style||r.css;v&&($e("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()},G0=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var o;Ae(n)&&!Zt(n)&&(o=n,n=o.roots||o.root,a=o.visit,i=o.directed),i=arguments.length===2&&!Xe(a)?a:i,a=Xe(a)?a:function(){};for(var l=this._private.cy,c=n=Ee(n)?this.filter(n):n,u=[],d=[],f={},h={},v={},p=0,g,m=this.byGroup(),y=m.nodes,b=m.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)),h[x]=0)}for(var k=function(){var O=e.bfs?u.shift():u.pop(),D=O.id();if(e.dfs){if(v[D])return"continue";v[D]=!0,d.push(O)}var R=h[D],P=f[D],L=P!=null?P.source():null,A=P!=null?P.target():null,q=P==null?void 0:O.same(L)?A[0]:L[0],U=void 0;if(U=a(O,P,q,p++,R),U===!0)return g=O,"break";if(U===!1)return"break";for(var z=O.connectedEdges().filter(function(V){return(!i||V.source().same(O))&&b.has(V)}),H=0;H<z.length;H++){var Q=z[H],F=Q.connectedNodes().filter(function(V){return!V.same(O)&&y.has(V)}),$=F.id();F.length!==0&&!v[$]&&(F=F[0],u.push(F),e.bfs&&(v[$]=!0,d.push(F)),f[$]=Q,h[$]=h[D]+1)}};u.length!==0;){var E=k();if(E!=="continue"&&E==="break")break}for(var _=l.collection(),S=0;S<d.length;S++){var T=d[S],N=f[T.id()];N!=null&&_.push(N),_.push(T)}return{path:l.collection(_),found:l.collection(g)}}},Zi={breadthFirstSearch:G0({bfs:!0}),depthFirstSearch:G0({dfs:!0})};Zi.bfs=Zi.breadthFirstSearch,Zi.dfs=Zi.depthFirstSearch;var qF=GM(function(t,e){(function(){var r,n,a,i,o,l,c,u,d,f,h,v,p,g,m;a=Math.floor,f=Math.min,n=function(y,b){return y<b?-1:y>b?1:0},d=function(y,b,w,C,x){var k;if(w==null&&(w=0),x==null&&(x=n),w<0)throw new Error("lo must be non-negative");for(C==null&&(C=y.length);w<C;)k=a((w+C)/2),x(b,y[k])<0?C=k:w=k+1;return[].splice.apply(y,[w,w-w].concat(b)),b},l=function(y,b,w){return w==null&&(w=n),y.push(b),g(y,0,y.length-1,w)},o=function(y,b){var w,C;return b==null&&(b=n),w=y.pop(),y.length?(C=y[0],y[0]=w,m(y,0,b)):C=w,C},u=function(y,b,w){var C;return w==null&&(w=n),C=y[0],y[0]=b,m(y,0,w),C},c=function(y,b,w){var C;return w==null&&(w=n),y.length&&w(y[0],b)<0&&(C=[y[0],b],b=C[0],y[0]=C[1],m(y,0,w)),b},i=function(y,b){var w,C,x,k,E,_;for(b==null&&(b=n),k=(function(){_=[];for(var S=0,T=a(y.length/2);0<=T?S<T:S>T;0<=T?S++:S--)_.push(S);return _}).apply(this).reverse(),E=[],C=0,x=k.length;C<x;C++)w=k[C],E.push(m(y,w,b));return E},p=function(y,b,w){var C;if(w==null&&(w=n),C=y.indexOf(b),C!==-1)return g(y,0,C,w),m(y,C,w)},h=function(y,b,w){var C,x,k,E,_;if(w==null&&(w=n),x=y.slice(0,b),!x.length)return x;for(i(x,w),_=y.slice(b),k=0,E=_.length;k<E;k++)C=_[k],c(x,C,w);return x.sort(w).reverse()},v=function(y,b,w){var C,x,k,E,_,S,T,N,B;if(w==null&&(w=n),b*10<=y.length){if(k=y.slice(0,b).sort(w),!k.length)return k;for(x=k[k.length-1],T=y.slice(b),E=0,S=T.length;E<S;E++)C=T[E],w(C,x)<0&&(d(k,C,0,null,w),k.pop(),x=k[k.length-1]);return k}for(i(y,w),B=[],_=0,N=f(b,y.length);0<=N?_<N:_>N;0<=N?++_:--_)B.push(o(y,w));return B},g=function(y,b,w,C){var x,k,E;for(C==null&&(C=n),x=y[w];w>b;){if(E=w-1>>1,k=y[E],C(x,k)<0){y[w]=k,w=E;continue}break}return y[w]=x},m=function(y,b,w){var C,x,k,E,_;for(w==null&&(w=n),x=y.length,_=b,k=y[b],C=2*b+1;C<x;)E=C+1,E<x&&!(w(y[C],y[E])<0)&&(C=E),y[b]=y[C],b=C,C=2*b+1;return y[b]=k,g(y,_,b,w)},r=function(){y.push=l,y.pop=o,y.replace=u,y.pushpop=c,y.heapify=i,y.updateItem=p,y.nlargest=h,y.nsmallest=v;function y(b){this.cmp=b??n,this.nodes=[]}return y.prototype.push=function(b){return l(this.nodes,b,this.cmp)},y.prototype.pop=function(){return o(this.nodes,this.cmp)},y.prototype.peek=function(){return this.nodes[0]},y.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},y.prototype.replace=function(b){return u(this.nodes,b,this.cmp)},y.prototype.pushpop=function(b){return c(this.nodes,b,this.cmp)},y.prototype.heapify=function(){return i(this.nodes,this.cmp)},y.prototype.updateItem=function(b){return p(this.nodes,b,this.cmp)},y.prototype.clear=function(){return this.nodes=[]},y.prototype.empty=function(){return this.nodes.length===0},y.prototype.size=function(){return this.nodes.length},y.prototype.clone=function(){var b;return b=new y,b.nodes=this.nodes.slice(0),b},y.prototype.toArray=function(){return this.nodes.slice(0)},y.prototype.insert=y.prototype.push,y.prototype.top=y.prototype.peek,y.prototype.front=y.prototype.peek,y.prototype.has=y.prototype.contains,y.prototype.copy=y.prototype.clone,y}(),function(y,b){return t.exports=b()}(this,function(){return r})}).call(Ki)}),Xi=qF,zF=xt({root:null,weight:function(e){return 1},directed:!1}),HF={dijkstra:function(e){if(!Ae(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var n=zF(e),a=n.root,i=n.weight,o=n.directed,l=this,c=i,u=Ee(a)?this.filter(a)[0]:a[0],d={},f={},h={},v=this.byGroup(),p=v.nodes,g=v.edges;g.unmergeBy(function(R){return R.isLoop()});for(var m=function(P){return d[P.id()]},y=function(P,L){d[P.id()]=L,b.updateItem(P)},b=new Xi(function(R,P){return m(R)-m(P)}),w=0;w<p.length;w++){var C=p[w];d[C.id()]=C.same(u)?0:1/0,b.push(C)}for(var x=function(P,L){for(var A=(o?P.edgesTo(L):P.edgesWith(L)).intersect(g),q=1/0,U,z=0;z<A.length;z++){var H=A[z],Q=c(H);(Q<q||!U)&&(q=Q,U=H)}return{edge:U,dist:q}};b.size()>0;){var k=b.pop(),E=m(k),_=k.id();if(h[_]=E,E!==1/0)for(var S=k.neighborhood().intersect(p),T=0;T<S.length;T++){var N=S[T],B=N.id(),O=x(k,N),D=E+O.dist;D<m(N)&&(y(N,D),f[B]={node:k,edge:O.edge})}}return{distanceTo:function(P){var L=Ee(P)?p.filter(P)[0]:P[0];return h[L.id()]},pathTo:function(P){var L=Ee(P)?p.filter(P)[0]:P[0],A=[],q=L,U=q.id();if(L.length>0)for(A.unshift(L);f[U];){var z=f[U];A.unshift(z.edge),A.unshift(z.node),q=z.node,U=q.id()}return l.spawn(A)}}}},KF={kruskal:function(e){e=e||function(w){return 1};for(var r=this.byGroup(),n=r.nodes,a=r.edges,i=n.length,o=new Array(i),l=n,c=function(C){for(var x=0;x<o.length;x++){var k=o[x];if(k.has(C))return x}},u=0;u<i;u++)o[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 h=d[f],v=h.source()[0],p=h.target()[0],g=c(v),m=c(p),y=o[g],b=o[m];g!==m&&(l.merge(h),y.merge(b),o.splice(m,1))}return l}},GF=xt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),UF={aStar:function(e){var r=this.cy(),n=GF(e),a=n.root,i=n.goal,o=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={},h={},v={},p=new Xi(function(U,z){return h[U.id()]-h[z.id()]}),g=new La,m={},y={},b=function(z,H){p.push(z),g.add(H)},w,C,x=function(){w=p.pop(),C=w.id(),g.delete(C)},k=function(z){return g.has(z)};b(a,u),f[u]=0,h[u]=o(a);for(var E=0;p.size()>0;){if(x(),E++,C===d){for(var _=[],S=i,T=d,N=y[T];_.unshift(S),N!=null&&_.unshift(N),S=m[T],S!=null;)T=S.id(),N=y[T];return{found:!0,distance:f[C],path:this.spawn(_),steps:E}}v[C]=!0;for(var B=w._private.edges,O=0;O<B.length;O++){var D=B[O];if(this.hasElementWithId(D.id())&&!(l&&D.data("source")!==C)){var R=D.source(),P=D.target(),L=R.id()!==C?R:P,A=L.id();if(this.hasElementWithId(A)&&!v[A]){var q=f[C]+c(D);if(!k(A)){f[A]=q,h[A]=q+o(L),b(L,A),m[A]=w,y[A]=D;continue}q<f[A]&&(f[A]=q,h[A]=q+o(L),m[A]=w,y[A]=D)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},jF=xt({weight:function(e){return 1},directed:!1}),WF={floydWarshall:function(e){for(var r=this.cy(),n=jF(e),a=n.weight,i=n.directed,o=a,l=this.byGroup(),c=l.nodes,u=l.edges,d=c.length,f=d*d,h=function(Q){return c.indexOf(Q)},v=function(Q){return c[Q]},p=new Array(f),g=0;g<f;g++){var m=g%d,y=(g-m)/d;y===m?p[g]=0:p[g]=1/0}for(var b=new Array(f),w=new Array(f),C=0;C<u.length;C++){var x=u[C],k=x.source()[0],E=x.target()[0];if(k!==E){var _=h(k),S=h(E),T=_*d+S,N=o(x);if(p[T]>N&&(p[T]=N,b[T]=S,w[T]=x),!i){var B=S*d+_;!i&&p[B]>N&&(p[B]=N,b[B]=_,w[B]=x)}}}for(var O=0;O<d;O++)for(var D=0;D<d;D++)for(var R=D*d+O,P=0;P<d;P++){var L=D*d+P,A=O*d+P;p[R]+p[A]<p[L]&&(p[L]=p[R]+p[A],b[L]=b[R])}var q=function(Q){return(Ee(Q)?r.filter(Q):Q)[0]},U=function(Q){return h(q(Q))},z={distance:function(Q,F){var $=U(Q),V=U(F);return p[$*d+V]},path:function(Q,F){var $=U(Q),V=U(F),G=v($);if($===V)return G.collection();if(b[$*d+V]==null)return r.collection();var j=r.collection(),M=$,W;for(j.merge(G);$!==V;)M=$,$=b[$*d+V],W=w[M*d+$],j.merge(W),j.merge(v($));return j}};return z}},YF=xt({weight:function(e){return 1},directed:!1,root:null}),ZF={bellmanFord:function(e){var r=this,n=YF(e),a=n.weight,i=n.directed,o=n.root,l=a,c=this,u=this.cy(),d=this.byGroup(),f=d.edges,h=d.nodes,v=h.length,p=new Ir,g=!1,m=[];o=u.collection(o)[0],f.unmergeBy(function(ie){return ie.isLoop()});for(var y=f.length,b=function(fe){var pe=p.get(fe.id());return pe||(pe={},p.set(fe.id(),pe)),pe},w=function(fe){return(Ee(fe)?u.$(fe):fe)[0]},C=function(fe){return b(w(fe)).dist},x=function(fe){for(var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,De=w(fe),Ie=[],we=De;;){if(we==null)return r.spawn();var xe=b(we),re=xe.edge,I=xe.pred;if(Ie.unshift(we[0]),we.same(pe)&&Ie.length>0)break;re!=null&&Ie.unshift(re),we=I}return c.spawn(Ie)},k=0;k<v;k++){var E=h[k],_=b(E);E.same(o)?_.dist=0:_.dist=1/0,_.pred=null,_.edge=null}for(var S=!1,T=function(fe,pe,De,Ie,we,xe){var re=Ie.dist+xe;re<we.dist&&!De.same(Ie.edge)&&(we.dist=re,we.pred=fe,we.edge=De,S=!0)},N=1;N<v;N++){S=!1;for(var B=0;B<y;B++){var O=f[B],D=O.source(),R=O.target(),P=l(O),L=b(D),A=b(R);T(D,R,O,L,A,P),i||T(R,D,O,A,L,P)}if(!S)break}if(S)for(var q=[],U=0;U<y;U++){var z=f[U],H=z.source(),Q=z.target(),F=l(z),$=b(H).dist,V=b(Q).dist;if($+F<V||!i&&V+F<$)if(g||($e("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),e.findNegativeWeightCycles!==!1){var G=[];$+F<V&&G.push(H),!i&&V+F<$&&G.push(Q);for(var j=G.length,M=0;M<j;M++){var W=G[M],Y=[W];Y.push(b(W).edge);for(var se=b(W).pred;Y.indexOf(se)===-1;)Y.push(se),Y.push(b(se).edge),se=b(se).pred;Y=Y.slice(Y.indexOf(se));for(var ce=Y[0].id(),ae=0,ne=2;ne<Y.length;ne+=2)Y[ne].id()<ce&&(ce=Y[ne].id(),ae=ne);Y=Y.slice(ae).concat(Y.slice(0,ae)),Y.push(Y[0]);var ue=Y.map(function(ie){return ie.id()}).join(",");q.indexOf(ue)===-1&&(m.push(c.spawn(Y)),q.push(ue))}}else break}return{distanceTo:C,pathTo:x,hasNegativeWeightCycle:g,negativeWeightCycles:m}}},XF=Math.sqrt(2),JF=function(e,r,n){n.length===0&&Je("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],i=a[1],o=a[2],l=r[i],c=r[o],u=n,d=u.length-1;d>=0;d--){var f=u[d],h=f[1],v=f[2];(r[h]===l&&r[v]===c||r[h]===c&&r[v]===l)&&u.splice(d,1)}for(var p=0;p<u.length;p++){var g=u[p];g[1]===c?(u[p]=g.slice(),u[p][1]=l):g[2]===c&&(u[p]=g.slice(),u[p][2]=l)}for(var m=0;m<r.length;m++)r[m]===c&&(r[m]=l);return u},Vu=function(e,r,n,a){for(;n>a;){var i=Math.floor(Math.random()*r.length);r=JF(i,e,r),n--}return r},QF={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,a=r.edges;a.unmergeBy(function(A){return A.isLoop()});var i=n.length,o=a.length,l=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),c=Math.floor(i/XF);if(i<2){Je("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],d=0;d<o;d++){var f=a[d];u.push([d,n.indexOf(f.source()),n.indexOf(f.target())])}for(var h=1/0,v=[],p=new Array(i),g=new Array(i),m=new Array(i),y=function(q,U){for(var z=0;z<i;z++)U[z]=q[z]},b=0;b<=l;b++){for(var w=0;w<i;w++)g[w]=w;var C=Vu(g,u.slice(),i,c),x=C.slice();y(g,m);var k=Vu(g,C,c,2),E=Vu(m,x,c,2);k.length<=E.length&&k.length<h?(h=k.length,v=k,y(g,p)):E.length<=k.length&&E.length<h&&(h=E.length,v=E,y(m,p))}for(var _=this.spawn(v.map(function(A){return a[A[0]]})),S=this.spawn(),T=this.spawn(),N=p[0],B=0;B<p.length;B++){var O=p[B],D=n[B];O===N?S.merge(D):T.merge(D)}var R=function(q){var U=e.spawn();return q.forEach(function(z){U.merge(z),z.connectedEdges().forEach(function(H){e.contains(H)&&!_.contains(H)&&U.merge(H)})}),U},P=[R(S),R(T)],L={cut:_,components:P,partition1:S,partition2:T};return L}},e5=function(e){return{x:e.x,y:e.y}},ys=function(e,r,n){return{x:e.x*r+n.x,y:e.y*r+n.y}},U0=function(e,r,n){return{x:(e.x-n.x)/r,y:(e.y-n.y)/r}},Ma=function(e){return{x:e[0],y:e[1]}},t5=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 o=e[i];isFinite(o)&&(a=Math.min(o,a))}return a},r5=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 o=e[i];isFinite(o)&&(a=Math.max(o,a))}return a},n5=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,o=r;o<n;o++){var l=e[o];isFinite(l)&&(a+=l,i++)}return a/i},a5=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,o=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];o?isFinite(u)||(e[c]=-1/0,l++):e.splice(c,1)}i&&e.sort(function(h,v){return h-v});var d=e.length,f=Math.floor(d/2);return d%2!==0?e[f+1+l]:(e[f-1+l]+e[f+l])/2},i5=function(e){return Math.PI*e/180},bs=function(e,r){return Math.atan2(r,e)-Math.PI/2},qu=Math.log2||function(t){return Math.log(t)/Math.log(2)},j0=function(e){return e>0?1:e<0?-1:0},Jn=function(e,r){return Math.sqrt(Qn(e,r))},Qn=function(e,r){var n=r.x-e.x,a=r.y-e.y;return n*n+a*a},o5=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},gt=function(e,r,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*r+a*a*n},Fa=function(e,r,n,a){return{x:gt(e.x,r.x,n.x,a),y:gt(e.y,r.y,n.y,a)}},s5=function(e,r,n,a){var i={x:r.x-e.x,y:r.y-e.y},o=Jn(e,r),l={x:i.x/o,y:i.y/o};return n=n??0,a=a??n*o,{x:e.x+l.x*a,y:e.y+l.y*a}},Ji=function(e,r,n){return Math.max(e,Math.min(n,r))},Kt=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}}},l5=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},u5=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},c5=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}},W0=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},d5=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},ws=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},Cs=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,a,i,o;if(r.length===1)n=a=i=o=r[0];else if(r.length===2)n=i=r[0],o=a=r[1];else if(r.length===4){var l=vr(r,4);n=l[0],a=l[1],i=l[2],o=l[3]}return e.x1-=o,e.x2+=a,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Y0=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},zu=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)},$a=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},f5=function(e,r){return $a(e,r.x,r.y)},Z0=function(e,r){return $a(e,r.x1,r.y1)&&$a(e,r.x2,r.y2)},X0=function(e,r,n,a,i,o,l){var c=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=c==="auto"?ta(i,o):c,d=i/2,f=o/2;u=Math.min(u,d,f);var h=u!==d,v=u!==f,p;if(h){var g=n-d+u-l,m=a-f-l,y=n+d-u+l,b=m;if(p=Cn(e,r,n,a,g,m,y,b,!1),p.length>0)return p}if(v){var w=n+d+l,C=a-f+u-l,x=w,k=a+f-u+l;if(p=Cn(e,r,n,a,w,C,x,k,!1),p.length>0)return p}if(h){var E=n-d+u-l,_=a+f+l,S=n+d-u+l,T=_;if(p=Cn(e,r,n,a,E,_,S,T,!1),p.length>0)return p}if(v){var N=n-d-l,B=a-f+u-l,O=N,D=a+f-u+l;if(p=Cn(e,r,n,a,N,B,O,D,!1),p.length>0)return p}var R;{var P=n-d+u,L=a-f+u;if(R=Qi(e,r,n,a,P,L,u+l),R.length>0&&R[0]<=P&&R[1]<=L)return[R[0],R[1]]}{var A=n+d-u,q=a-f+u;if(R=Qi(e,r,n,a,A,q,u+l),R.length>0&&R[0]>=A&&R[1]<=q)return[R[0],R[1]]}{var U=n+d-u,z=a+f-u;if(R=Qi(e,r,n,a,U,z,u+l),R.length>0&&R[0]>=U&&R[1]>=z)return[R[0],R[1]]}{var H=n-d+u,Q=a+f-u;if(R=Qi(e,r,n,a,H,Q,u+l),R.length>0&&R[0]<=H&&R[1]>=Q)return[R[0],R[1]]}return[]},h5=function(e,r,n,a,i,o,l){var c=l,u=Math.min(n,i),d=Math.max(n,i),f=Math.min(a,o),h=Math.max(a,o);return u-c<=e&&e<=d+c&&f-c<=r&&r<=h+c},p5=function(e,r,n,a,i,o,l,c,u){var d={x1:Math.min(n,l,i)-u,x2:Math.max(n,l,i)+u,y1:Math.min(a,c,o)-u,y2:Math.max(a,c,o)+u};return!(e<d.x1||e>d.x2||r<d.y1||r>d.y2)},v5=function(e,r,n,a){n-=a;var i=r*r-4*e*n;if(i<0)return[];var o=Math.sqrt(i),l=2*e,c=(-r+o)/l,u=(-r-o)/l;return[c,u]},g5=function(e,r,n,a,i){var o=1e-5;e===0&&(e=o),r/=e,n/=e,a/=e;var l,c,u,d,f,h,v,p;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),h=u-Math.sqrt(l),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-v+f+h,v+=(f+h)/2,i[4]=i[2]=-v,v=Math.sqrt(3)*(-h+f)/2,i[3]=v,i[5]=-v;return}if(i[5]=i[3]=0,l===0){p=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-v+2*p,i[4]=i[2]=-(p+v);return}c=-c,d=c*c*c,d=Math.acos(u/Math.sqrt(d)),p=2*Math.sqrt(c),i[0]=-v+p*Math.cos(d/3),i[2]=-v+p*Math.cos((d+2*Math.PI)/3),i[4]=-v+p*Math.cos((d+4*Math.PI)/3)},m5=function(e,r,n,a,i,o,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*o+2*a*c+4*o*o-4*o*c+c*c,d=1*9*n*i-3*n*n-3*n*l-6*i*i+3*i*l+9*a*o-3*a*a-3*a*c-6*o*o+3*o*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*o+a*c-a*r+2*o*o+2*o*r-c*r,h=1*n*i-n*n+n*e-i*e+a*o-a*a+a*r-o*r,v=[];g5(u,d,f,h,v);for(var p=1e-7,g=[],m=0;m<6;m+=2)Math.abs(v[m+1])<p&&v[m]>=0&&v[m]<=1&&g.push(v[m]);g.push(1),g.push(0);for(var y=-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]*o+g[x]*g[x]*c,C=Math.pow(b-e,2)+Math.pow(w-r,2),y>=0?C<y&&(y=C):y=C;return y},y5=function(e,r,n,a,i,o){var l=[e-n,r-a],c=[i-n,o-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],h=f*f/u;return f<0?d:h>u?(e-i)*(e-i)+(r-o)*(r-o):d-h},Gt=function(e,r,n){for(var a,i,o,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?(o=n[(d+1)*2],l=n[(d+1)*2+1]):(o=n[(d+1-n.length/2)*2],l=n[(d+1-n.length/2)*2+1]),!(a==e&&o==e))if(a>=e&&e>=o||a<=e&&e<=o)c=(e-a)/(o-a)*(l-i)+i,c>r&&u++;else continue;return u%2!==0},Yr=function(e,r,n,a,i,o,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 h=Math.cos(-f),v=Math.sin(-f),p=0;p<d.length/2;p++)d[p*2]=o/2*(n[p*2]*h-n[p*2+1]*v),d[p*2+1]=l/2*(n[p*2+1]*h+n[p*2]*v),d[p*2]+=a,d[p*2+1]+=i;var g;if(u>0){var m=xs(d,-u);g=Es(m)}else g=d;return Gt(e,r,g)},b5=function(e,r,n,a,i,o,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 h=Math.pow(f.cx-e,2)+Math.pow(f.cy-r,2);if(h<=Math.pow(f.radius,2))return!0}return Gt(e,r,u)},Es=function(e){for(var r=new Array(e.length/2),n,a,i,o,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],o=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 h=Cn(n,a,i,o,l,c,u,d,!0);r[f*2]=h[0],r[f*2+1]=h[1]}return r},xs=function(e,r){for(var n=new Array(e.length*2),a,i,o,l,c=0;c<e.length/2;c++){a=e[c*2],i=e[c*2+1],c<e.length/2-1?(o=e[(c+1)*2],l=e[(c+1)*2+1]):(o=e[0],l=e[1]);var u=l-i,d=-(o-a),f=Math.sqrt(u*u+d*d),h=u/f,v=d/f;n[c*4]=a+h*r,n[c*4+1]=i+v*r,n[c*4+2]=o+h*r,n[c*4+3]=l+v*r}return n},w5=function(e,r,n,a,i,o){var l=n-e,c=a-r;l/=i,c/=o;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]},ea=function(e,r,n,a,i,o,l){return e-=i,r-=o,e/=n/2+l,r/=a/2+l,e*e+r*r<=1},Qi=function(e,r,n,a,i,o,l){var c=[n-e,a-r],u=[e-i,r-o],d=c[0]*c[0]+c[1]*c[1],f=2*(u[0]*c[0]+u[1]*c[1]),h=u[0]*u[0]+u[1]*u[1]-l*l,v=f*f-4*d*h;if(v<0)return[];var p=(-f+Math.sqrt(v))/(2*d),g=(-f-Math.sqrt(v))/(2*d),m=Math.min(p,g),y=Math.max(p,g),b=[];if(m>=0&&m<=1&&b.push(m),y>=0&&y<=1&&b.push(y),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,k=b[1]*c[1]+r;return[w,C,x,k]}else return[w,C]},Hu=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Cn=function(e,r,n,a,i,o,l,c,u){var d=e-i,f=n-e,h=l-i,v=r-o,p=a-r,g=c-o,m=h*v-g*d,y=f*v-p*d,b=g*f-h*p;if(b!==0){var w=m/b,C=y/b,x=.001,k=0-x,E=1+x;return k<=w&&w<=E&&k<=C&&C<=E?[e+w*f,r+w*p]:u?[e+w*f,r+w*p]:[]}else return m===0||y===0?Hu(e,n,l)===l?[l,c]:Hu(e,n,i)===i?[i,o]:Hu(i,l,n)===n?[n,a]:[]:[]},eo=function(e,r,n,a,i,o,l,c){var u=[],d,f=new Array(n.length),h=!0;o==null&&(h=!1);var v;if(h){for(var p=0;p<f.length/2;p++)f[p*2]=n[p*2]*o+a,f[p*2+1]=n[p*2+1]*l+i;if(c>0){var g=xs(f,-c);v=Es(g)}else v=f}else v=n;for(var m,y,b,w,C=0;C<v.length/2;C++)m=v[C*2],y=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=Cn(e,r,a,i,m,y,b,w),d.length!==0&&u.push(d[0],d[1]);return u},C5=function(e,r,n,a,i,o,l,c,u){var d=[],f,h=new Array(n.length*2);u.forEach(function(b,w){w===0?(h[h.length-2]=b.startX,h[h.length-1]=b.startY):(h[w*4-2]=b.startX,h[w*4-1]=b.startY),h[w*4]=b.stopX,h[w*4+1]=b.stopY,f=Qi(e,r,a,i,b.cx,b.cy,b.radius),f.length!==0&&d.push(f[0],f[1])});for(var v=0;v<h.length/4;v++)f=Cn(e,r,a,i,h[v*4],h[v*4+1],h[v*4+2],h[v*4+3],!1),f.length!==0&&d.push(f[0],f[1]);if(d.length>2){for(var p=[d[0],d[1]],g=Math.pow(p[0]-e,2)+Math.pow(p[1]-r,2),m=1;m<d.length/2;m++){var y=Math.pow(d[m*2]-e,2)+Math.pow(d[m*2+1]-r,2);y<=g&&(p[0]=d[m*2],p[1]=d[m*2+1],g=y)}return p}return d},ks=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]),o=(i-n)/i;return o<0&&(o=1e-5),[r[0]+o*a[0],r[1]+o*a[1]]},Ft=function(e,r){var n=Ku(e,r);return n=J0(n),n},J0=function(e){for(var r,n,a=e.length/2,i=1/0,o=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),o=Math.min(o,n),c=Math.max(c,n);for(var d=2/(l-i),f=2/(c-o),h=0;h<a;h++)r=e[2*h]=e[2*h]*d,n=e[2*h+1]=e[2*h+1]*f,i=Math.min(i,r),l=Math.max(l,r),o=Math.min(o,n),c=Math.max(c,n);if(o<-1)for(var v=0;v<a;v++)n=e[2*v+1]=e[2*v+1]+(-1-o);return e},Ku=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),o,l=0;l<e;l++)o=l*n+a,i[2*l]=Math.cos(o),i[2*l+1]=Math.sin(-o);return i},ta=function(e,r){return Math.min(e/4,r/4,8)},Q0=function(e,r){return Math.min(e/10,r/10,8)},Gu=function(){return 8},E5=function(e,r,n){return[e-2*r+n,2*(r-e),e]},Uu=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},x5=xt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),k5={pageRank:function(e){for(var r=x5(e),n=r.dampingFactor,a=r.precision,i=r.iterations,o=r.weight,l=this._private.cy,c=this.byGroup(),u=c.nodes,d=c.edges,f=u.length,h=f*f,v=d.length,p=new Array(h),g=new Array(f),m=(1-n)/f,y=0;y<f;y++){for(var b=0;b<f;b++){var w=y*f+b;p[w]=0}g[y]=0}for(var C=0;C<v;C++){var x=d[C],k=x.data("source"),E=x.data("target");if(k!==E){var _=u.indexOfId(k),S=u.indexOfId(E),T=o(x),N=S*f+_;p[N]+=T,g[_]+=T}}for(var B=1/f+m,O=0;O<f;O++)if(g[O]===0)for(var D=0;D<f;D++){var R=D*f+O;p[R]=B}else for(var P=0;P<f;P++){var L=P*f+O;p[L]=p[L]/g[O]+m}for(var A=new Array(f),q=new Array(f),U,z=0;z<f;z++)A[z]=1;for(var H=0;H<i;H++){for(var Q=0;Q<f;Q++)q[Q]=0;for(var F=0;F<f;F++)for(var $=0;$<f;$++){var V=F*f+$;q[F]+=p[V]*A[$]}o5(q),U=A,A=q,q=U;for(var G=0,j=0;j<f;j++){var M=U[j]-A[j];G+=M*M}if(G<a)break}var W={rank:function(se){return se=l.collection(se)[0],A[u.indexOf(se)]}};return W}},eb=xt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Va={degreeCentralityNormalized:function(e){e=eb(e);var r=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var d={},f={},h=0,v=0,p=0;p<a;p++){var g=n[p],m=g.id();e.root=g;var y=this.degreeCentrality(e);h<y.indegree&&(h=y.indegree),v<y.outdegree&&(v=y.outdegree),d[m]=y.indegree,f[m]=y.outdegree}return{indegree:function(w){return h==0?0:(Ee(w)&&(w=r.filter(w)),d[w.id()]/h)},outdegree:function(w){return v===0?0:(Ee(w)&&(w=r.filter(w)),f[w.id()]/v)}}}else{for(var i={},o=0,l=0;l<a;l++){var c=n[l];e.root=c;var u=this.degreeCentrality(e);o<u.degree&&(o=u.degree),i[c.id()]=u.degree}return{degree:function(w){return o===0?0:(Ee(w)&&(w=r.filter(w)),i[w.id()]/o)}}}},degreeCentrality:function(e){e=eb(e);var r=this.cy(),n=this,a=e,i=a.root,o=a.weight,l=a.directed,c=a.alpha;if(i=r.collection(i)[0],l){for(var v=i.connectedEdges(),p=v.filter(function(k){return k.target().same(i)&&n.has(k)}),g=v.filter(function(k){return k.source().same(i)&&n.has(k)}),m=p.length,y=g.length,b=0,w=0,C=0;C<p.length;C++)b+=o(p[C]);for(var x=0;x<g.length;x++)w+=o(g[x]);return{indegree:Math.pow(m,1-c)*Math.pow(b,c),outdegree:Math.pow(y,1-c)*Math.pow(w,c)}}else{for(var u=i.connectedEdges().intersection(n),d=u.length,f=0,h=0;h<u.length;h++)f+=o(u[h]);return{degree:Math.pow(d,1-c)*Math.pow(f,c)}}}};Va.dc=Va.degreeCentrality,Va.dcn=Va.degreeCentralityNormalised=Va.degreeCentralityNormalized;var tb=xt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),qa={closenessCentralityNormalized:function(e){for(var r=tb(e),n=r.harmonic,a=r.weight,i=r.directed,o=this.cy(),l={},c=0,u=this.nodes(),d=this.floydWarshall({weight:a,directed:i}),f=0;f<u.length;f++){for(var h=0,v=u[f],p=0;p<u.length;p++)if(f!==p){var g=d.distance(v,u[p]);n?h+=1/g:h+=g}n||(h=1/h),c<h&&(c=h),l[v.id()]=h}return{closeness:function(y){return c==0?0:(Ee(y)?y=o.filter(y)[0].id():y=y.id(),l[y]/c)}}},closenessCentrality:function(e){var r=tb(e),n=r.root,a=r.weight,i=r.directed,o=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 h=l.distanceTo(f);o?c+=1/h:c+=h}}return o?c:1/c}};qa.cc=qa.closenessCentrality,qa.ccn=qa.closenessCentralityNormalised=qa.closenessCentralityNormalized;var S5=xt({weight:null,directed:!1}),ju={betweennessCentrality:function(e){for(var r=S5(e),n=r.directed,a=r.weight,i=a!=null,o=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]}},h=0;h<l.length;h++){var v=l[h],p=v.id();n?c[p]=v.outgoers().nodes():c[p]=v.openNeighborhood().nodes(),f.set(p,0)}for(var g=function(w){for(var C=l[w].id(),x=[],k={},E={},_={},S=new Xi(function($,V){return _[$]-_[V]}),T=0;T<l.length;T++){var N=l[T].id();k[N]=[],E[N]=0,_[N]=1/0}for(E[C]=1,_[C]=0,S.push(C);!S.empty();){var B=S.pop();if(x.push(B),i)for(var O=0;O<c[B].length;O++){var D=c[B][O],R=o.getElementById(B),P=void 0;R.edgesTo(D).length>0?P=R.edgesTo(D)[0]:P=D.edgesTo(R)[0];var L=a(P);D=D.id(),_[D]>_[B]+L&&(_[D]=_[B]+L,S.nodes.indexOf(D)<0?S.push(D):S.updateItem(D),E[D]=0,k[D]=[]),_[D]==_[B]+L&&(E[D]=E[D]+E[B],k[D].push(B))}else for(var A=0;A<c[B].length;A++){var q=c[B][A].id();_[q]==1/0&&(S.push(q),_[q]=_[B]+1),_[q]==_[B]+1&&(E[q]=E[q]+E[B],k[q].push(B))}}for(var U={},z=0;z<l.length;z++)U[l[z].id()]=0;for(;x.length>0;){for(var H=x.pop(),Q=0;Q<k[H].length;Q++){var F=k[H][Q];U[F]=U[F]+E[F]/E[H]*(1+U[H])}H!=l[w].id()&&f.set(H,f.get(H)+U[H])}},m=0;m<l.length;m++)g(m);var y={betweenness:function(w){var C=o.collection(w).id();return f.get(C)},betweennessNormalized:function(w){if(d==0)return 0;var C=o.collection(w).id();return f.get(C)/d}};return y.betweennessNormalised=y.betweennessNormalized,y}};ju.bc=ju.betweennessCentrality;var _5=xt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),T5=function(e){return _5(e)},N5=function(e,r){for(var n=0,a=0;a<r.length;a++)n+=r[a](e);return n},I5=function(e,r,n){for(var a=0;a<r;a++)e[a*r+a]=n},rb=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 o=0;o<r;o++)e[o*r+a]=e[o*r+a]/n}},B5=function(e,r,n){for(var a=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)a[i*n+o]=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},D5=function(e,r,n){for(var a=e.slice(0),i=1;i<n;i++)e=B5(e,a,r);return e},O5=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 rb(a,r),a},P5=function(e,r,n,a){for(var i=0;i<n;i++){var o=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(o!==l)return!1}return!0},A5=function(e,r,n,a){for(var i=[],o=0;o<r;o++){for(var l=[],c=0;c<r;c++)Math.round(e[o*r+c]*1e3)/1e3>0&&l.push(n[c]);l.length!==0&&i.push(a.collection(l))}return i},R5=function(e,r){for(var n=0;n<e.length;n++)if(!r[n]||e[n].id()!==r[n].id())return!1;return!0},L5=function(e){for(var r=0;r<e.length;r++)for(var n=0;n<e.length;n++)r!=n&&R5(e[r],e[n])&&e.splice(n,1);return e},nb=function(e){for(var r=this.nodes(),n=this.edges(),a=this.cy(),i=T5(e),o={},l=0;l<r.length;l++)o[r[l].id()]=l;for(var c=r.length,u=c*c,d=new Array(u),f,h=0;h<u;h++)d[h]=0;for(var v=0;v<n.length;v++){var p=n[v],g=o[p.source().id()],m=o[p.target().id()],y=N5(p,i.attributes);d[g*c+m]+=y,d[m*c+g]+=y}I5(d,c,i.multFactor),rb(d,c);for(var b=!0,w=0;b&&w<i.maxIterations;)b=!1,f=D5(d,c,i.expandFactor),d=O5(f,c,i.inflateFactor),P5(d,f,u,4)||(b=!0),w++;var C=A5(d,c,r,a);return C=L5(C),C},M5={markovClustering:nb,mcl:nb},F5=function(e){return e},ab=function(e,r){return Math.abs(r-e)},ib=function(e,r,n){return e+ab(r,n)},ob=function(e,r,n){return e+Math.pow(n-r,2)},$5=function(e){return Math.sqrt(e)},V5=function(e,r,n){return Math.max(e,ab(r,n))},to=function(e,r,n,a,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:F5,l=a,c,u,d=0;d<e;d++)c=r(d),u=n(d),l=i(l,c,u);return o(l)},za={euclidean:function(e,r,n){return e>=2?to(e,r,n,0,ob,$5):to(e,r,n,0,ib)},squaredEuclidean:function(e,r,n){return to(e,r,n,0,ob)},manhattan:function(e,r,n){return to(e,r,n,0,ib)},max:function(e,r,n){return to(e,r,n,-1/0,V5)}};za["squared-euclidean"]=za.squaredEuclidean,za.squaredeuclidean=za.squaredEuclidean;function Ss(t,e,r,n,a,i){var o;return Xe(t)?o=t:o=za[t]||za.euclidean,e===0&&Xe(t)?o(a,i):o(e,r,n,a,i)}var q5=xt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Wu=function(e){return q5(e)},_s=function(e,r,n,a,i){var o=i!=="kMedoids",l=o?function(f){return n[f]}:function(f){return a[f](n)},c=function(h){return a[h](r)},u=n,d=r;return Ss(e,a.length,l,c,u,d)},Yu=function(e,r,n){for(var a=n.length,i=new Array(a),o=new Array(a),l=new Array(r),c=null,u=0;u<a;u++)i[u]=e.min(n[u]).value,o[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()*(o[f]-i[f])+i[f];l[d]=c}return l},sb=function(e,r,n,a,i){for(var o=1/0,l=0,c=0;c<r.length;c++){var u=_s(n,e,r[c],a,i);u<o&&(o=u,l=c)}return l},lb=function(e,r,n){for(var a=[],i=null,o=0;o<r.length;o++)i=r[o],n[i.id()]===e&&a.push(i);return a},z5=function(e,r,n){return Math.abs(r-e)<=n},H5=function(e,r,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var o=Math.abs(e[a][i]-r[a][i]);if(o>n)return!1}return!0},K5=function(e,r,n){for(var a=0;a<n;a++)if(e===r[a])return!0;return!1},ub=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)];K5(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var o=0;o<r;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},cb=function(e,r,n){for(var a=0,i=0;i<r.length;i++)a+=_s("manhattan",r[i],e,n,"kMedoids");return a},G5=function(e){var r=this.cy(),n=this.nodes(),a=null,i=Wu(e),o=new Array(i.k),l={},c;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,c=Yu(n,i.k,i.attributes)):ct(i.testCentroids)==="object"?c=i.testCentroids:c=Yu(n,i.k,i.attributes):c=Yu(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()]=sb(a,c,i.distance,i.attributes,"kMeans");u=!1;for(var h=0;h<i.k;h++){var v=lb(h,n,l);if(v.length!==0){for(var p=i.attributes.length,g=c[h],m=new Array(p),y=new Array(p),b=0;b<p;b++){y[b]=0;for(var w=0;w<v.length;w++)a=v[w],y[b]+=i.attributes[b](a);m[b]=y[b]/v.length,z5(m[b],g[b],i.sensitivityThreshold)||(u=!0)}c[h]=m,o[h]=r.collection(v)}}d++}return o},U5=function(e){var r=this.cy(),n=this.nodes(),a=null,i=Wu(e),o=new Array(i.k),l,c={},u,d=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(ct(i.testCentroids)==="object"?l=i.testCentroids:l=ub(n,i.k)):l=ub(n,i.k);for(var f=!0,h=0;f&&h<i.maxIterations;){for(var v=0;v<n.length;v++)a=n[v],c[a.id()]=sb(a,l,i.distance,i.attributes,"kMedoids");f=!1;for(var p=0;p<l.length;p++){var g=lb(p,n,c);if(g.length!==0){d[p]=cb(l[p],g,i.attributes);for(var m=0;m<g.length;m++)u=cb(g[m],g,i.attributes),u<d[p]&&(d[p]=u,l[p]=g[m],f=!0);o[p]=r.collection(g)}}h++}return o},j5=function(e,r,n,a,i){for(var o,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++){o=0,l=0;for(var h=0;h<r.length;h++)o+=a[h][d]*i.attributes[f](r[h]),l+=a[h][d];e[d][f]=o/l}},W5=function(e,r,n,a,i){for(var o=0;o<e.length;o++)r[o]=e[o].slice();for(var l,c,u,d=2/(i.m-1),f=0;f<n.length;f++)for(var h=0;h<a.length;h++){l=0;for(var v=0;v<n.length;v++)c=_s(i.distance,a[h],n[f],i.attributes,"cmeans"),u=_s(i.distance,a[h],n[v],i.attributes,"cmeans"),l+=Math.pow(c/u,d);e[h][f]=1/l}},Y5=function(e,r,n,a){for(var i=new Array(n.k),o=0;o<i.length;o++)i[o]=[];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},db=function(e){var r=this.cy(),n=this.nodes(),a=Wu(e),i,o,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 h=0;h<n.length;h++){for(var v=0,p=0;p<a.k;p++)l[h][p]=Math.random(),v+=l[h][p];for(var g=0;g<a.k;g++)l[h][g]=l[h][g]/v}o=new Array(a.k);for(var m=0;m<a.k;m++)o[m]=new Array(a.attributes.length);u=new Array(n.length);for(var y=0;y<n.length;y++)u[y]=new Array(a.k);for(var b=!0,w=0;b&&w<a.maxIterations;)b=!1,j5(o,n,l,u,a),W5(l,c,o,n,a),H5(l,c,a.sensitivityThreshold)||(b=!0),w++;return i=Y5(n,l,a,r),{clusters:i,degreeOfMembership:l}},Z5={kMeans:G5,kMedoids:U5,fuzzyCMeans:db,fcm:db},X5=xt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),J5={single:"min",complete:"max"},Q5=function(e){var r=X5(e),n=J5[r.linkage];return n!=null&&(r.linkage=n),r},fb=function(e,r,n,a,i){for(var o=0,l=1/0,c,u=i.attributes,d=function(S,T){return Ss(i.distance,u.length,function(N){return u[N](S)},function(N){return u[N](T)},S,T)},f=0;f<e.length;f++){var h=e[f].key,v=n[h][a[h]];v<l&&(o=h,l=v)}if(i.mode==="threshold"&&l>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var p=r[o],g=r[a[o]],m;i.mode==="dendrogram"?m={left:p,right:g,key:p.key}:m={value:p.value.concat(g.value),key:p.key},e[p.index]=m,e.splice(g.index,1),r[p.key]=m;for(var y=0;y<e.length;y++){var b=e[y];p.key===b.key?c=1/0:i.linkage==="min"?(c=n[p.key][b.key],n[p.key][b.key]>n[g.key][b.key]&&(c=n[g.key][b.key])):i.linkage==="max"?(c=n[p.key][b.key],n[p.key][b.key]<n[g.key][b.key]&&(c=n[g.key][b.key])):i.linkage==="mean"?c=(n[p.key][b.key]*p.size+n[g.key][b.key]*g.size)/(p.size+g.size):i.mode==="dendrogram"?c=d(b.value,p.value):c=d(b.value[0],p.value[0]),n[p.key][b.key]=n[b.key][p.key]=c}for(var w=0;w<e.length;w++){var C=e[w].key;if(a[C]===p.key||a[C]===g.key){for(var x=C,k=0;k<e.length;k++){var E=e[k].key;n[C][E]<n[C][x]&&(x=E)}a[C]=x}e[w].index=w}return p.key=g.key=p.index=g.index=null,!0},Ts=function t(e,r,n){e&&(e.value?r.push(e.value):(e.left&&t(e.left,r),e.right&&t(e.right,r)))},e$=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()},t$=function t(e,r,n){if(!e)return[];var a=[],i=[],o=[];return r===0?(e.left&&Ts(e.left,a),e.right&&Ts(e.right,i),o=a.concat(i),[n.collection(o)]):r===1?e.value?[n.collection(e.value)]:(e.left&&Ts(e.left,a),e.right&&Ts(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))},hb=function(e){for(var r=this.cy(),n=this.nodes(),a=Q5(e),i=a.attributes,o=function(w,C){return Ss(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 h={value:a.mode==="dendrogram"?n[f]:[n[f]],key:f,index:f};l[f]=h,d[f]=h,c[f]=[],u[f]=0}for(var v=0;v<l.length;v++)for(var p=0;p<=v;p++){var g=void 0;a.mode==="dendrogram"?g=v===p?1/0:o(l[v].value,l[p].value):g=v===p?1/0:o(l[v].value[0],l[p].value[0]),c[v][p]=g,c[p][v]=g,g<c[v][u[v]]&&(u[v]=p)}for(var m=fb(l,d,c,u,a);m;)m=fb(l,d,c,u,a);var y;return a.mode==="dendrogram"?(y=t$(l[0],a.dendrogramDepth,r),a.addDendrogram&&e$(l[0],r)):(y=new Array(l.length),l.forEach(function(b,w){b.key=b.index=null,y[w]=r.collection(b.value)})),y},r$={hierarchicalClustering:hb,hca:hb},n$=xt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),a$=function(e){var r=e.damping,n=e.preference;.5<=r&&r<1||Je("Damping must range on [0.5, 1). Got: ".concat(r));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||de(n)||Je("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),n$(e)},i$=function(e,r,n,a){var i=function(l,c){return a[c](l)};return-Ss(e,a.length,function(o){return i(r,o)},function(o){return i(n,o)},r,n)},o$=function(e,r){var n=null;return r==="median"?n=a5(e):r==="mean"?n=n5(e):r==="min"?n=t5(e):r==="max"?n=r5(e):n=r,n},s$=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},pb=function(e,r,n){for(var a=[],i=0;i<e;i++){for(var o=-1,l=-1/0,c=0;c<n.length;c++){var u=n[c];r[i*e+u]>l&&(o=u,l=r[i*e+u])}o>0&&a.push(o)}for(var d=0;d<n.length;d++)a[n[d]]=n[d];return a},l$=function(e,r,n){for(var a=pb(e,r,n),i=0;i<n.length;i++){for(var o=[],l=0;l<a.length;l++)a[l]===n[i]&&o.push(l);for(var c=-1,u=-1/0,d=0;d<o.length;d++){for(var f=0,h=0;h<o.length;h++)f+=r[o[h]*e+o[d]];f>u&&(c=d,u=f)}n[i]=o[c]}return a=pb(e,r,n),a},vb=function(e){for(var r=this.cy(),n=this.nodes(),a=a$(e),i={},o=0;o<n.length;o++)i[n[o].id()]=o;var l,c,u,d,f,h;l=n.length,c=l*l,u=new Array(c);for(var v=0;v<c;v++)u[v]=-1/0;for(var p=0;p<l;p++)for(var g=0;g<l;g++)p!==g&&(u[p*l+g]=i$(a.distance,n[p],n[g],a.attributes));d=o$(u,a.preference);for(var m=0;m<l;m++)u[m*l+m]=d;f=new Array(c);for(var y=0;y<c;y++)f[y]=0;h=new Array(c);for(var b=0;b<c;b++)h[b]=0;for(var w=new Array(l),C=new Array(l),x=new Array(l),k=0;k<l;k++)w[k]=0,C[k]=0,x[k]=0;for(var E=new Array(l*a.minIterations),_=0;_<E.length;_++)E[_]=0;var S;for(S=0;S<a.maxIterations;S++){for(var T=0;T<l;T++){for(var N=-1/0,B=-1/0,O=-1,D=0,R=0;R<l;R++)w[R]=f[T*l+R],D=h[T*l+R]+u[T*l+R],D>=N?(B=N,N=D,O=R):D>B&&(B=D);for(var P=0;P<l;P++)f[T*l+P]=(1-a.damping)*(u[T*l+P]-N)+a.damping*w[P];f[T*l+O]=(1-a.damping)*(u[T*l+O]-B)+a.damping*w[O]}for(var L=0;L<l;L++){for(var A=0,q=0;q<l;q++)w[q]=h[q*l+L],C[q]=Math.max(0,f[q*l+L]),A+=C[q];A-=C[L],C[L]=f[L*l+L],A+=C[L];for(var U=0;U<l;U++)h[U*l+L]=(1-a.damping)*Math.min(0,A-C[U])+a.damping*w[U];h[L*l+L]=(1-a.damping)*(A-C[L])+a.damping*w[L]}for(var z=0,H=0;H<l;H++){var Q=h[H*l+H]+f[H*l+H]>0?1:0;E[S%a.minIterations*l+H]=Q,z+=Q}if(z>0&&(S>=a.minIterations-1||S==a.maxIterations-1)){for(var F=0,$=0;$<l;$++){x[$]=0;for(var V=0;V<a.minIterations;V++)x[$]+=E[V*l+$];(x[$]===0||x[$]===a.minIterations)&&F++}if(F===l)break}}for(var G=s$(l,f,h),j=l$(l,u,G),M={},W=0;W<G.length;W++)M[G[W]]=[];for(var Y=0;Y<n.length;Y++){var se=i[n[Y].id()],ce=j[se];ce!=null&&M[ce].push(n[Y])}for(var ae=new Array(G.length),ne=0;ne<G.length;ne++)ae[ne]=r.collection(M[G[ne]]);return ae},u$={affinityPropagation:vb,ap:vb},c$=xt({root:void 0,directed:!1}),d$={hierholzer:function(e){if(!Ae(e)){var r=arguments;e={root:r[0],directed:r[1]}}var n=c$(e),a=n.root,i=n.directed,o=this,l=!1,c,u,d;a&&(d=Ee(a)?this.filter(a)[0].id():a[0].id());var f={},h={};i?o.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.indegree(!0),x=b.outdegree(!0),k=C-x,E=x-C;k==1?c?l=!0:c=w:E==1?u?l=!0:u=w:(E>1||k>1)&&(l=!0),f[w]=[],b.outgoers().forEach(function(_){_.isEdge()&&f[w].push(_.id())})}else h[w]=[void 0,b.target().id()]}):o.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 h[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=o[0].id());var p=function(w){for(var C=w,x=[w],k,E,_;f[C].length;)k=f[C].shift(),E=h[k][0],_=h[k][1],C!=_?(f[_]=f[_].filter(function(S){return S!=k}),C=_):!i&&C!=E&&(f[E]=f[E].filter(function(S){return S!=k}),C=E),x.unshift(k),x.unshift(C);return x},g=[],m=[];for(m=p(d);m.length!=1;)f[m[0]].length==0?(g.unshift(o.getElementById(m.shift())),g.unshift(o.getElementById(m.shift()))):m=p(m.shift()).concat(m);g.unshift(o.getElementById(m.shift()));for(var y in f)if(f[y].length)return v;return v.found=!0,v.trail=this.spawn(g,!0),v}},Ns=function(){var e=this,r={},n=0,a=0,i=[],o=[],l={},c=function(h,v){for(var p=o.length-1,g=[],m=e.spawn();o[p].x!=h||o[p].y!=v;)g.push(o.pop().edge),p--;g.push(o.pop().edge),g.forEach(function(y){var b=y.connectedNodes().intersection(e);m.merge(y),b.forEach(function(w){var C=w.id(),x=w.connectedEdges().intersection(e);m.merge(w),r[C].cutVertex?m.merge(x.filter(function(k){return k.isLoop()})):m.merge(x)})}),i.push(m)},u=function f(h,v,p){h===p&&(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 m,y,b,w;g.forEach(function(C){m=C.source().id(),y=C.target().id(),b=m===v?y:m,b!==p&&(w=C.id(),l[w]||(l[w]=!0,o.push({x:v,y:b,edge:C})),b in r?r[v].low=Math.min(r[v].low,r[b].id):(f(h,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 h=f.id();h in r||(a=0,u(h,h),r[h].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}},f$={hopcroftTarjanBiconnected:Ns,htbc:Ns,htb:Ns,hopcroftTarjanBiconnectedComponents:Ns},Is=function(){var e=this,r={},n=0,a=[],i=[],o=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 m=g.target().id();m!==u&&(m in r||c(m),r[m].explored||(r[u].low=Math.min(r[u].low,r[m].low)))}),r[u].index===r[u].low){for(var f=e.spawn();;){var h=i.pop();if(f.merge(e.getElementById(h)),r[h].low=r[u].index,r[h].explored=!0,h===u)break}var v=f.edgesWith(f),p=f.merge(v);a.push(p),o=o.difference(p)}};return e.forEach(function(c){if(c.isNode()){var u=c.id();u in r||l(u)}}),{cut:o,components:a}},h$={tarjanStronglyConnected:Is,tsc:Is,tscc:Is,tarjanStronglyConnectedComponents:Is},gb={};[Zi,HF,KF,UF,WF,ZF,QF,k5,Va,qa,ju,M5,Z5,r$,u$,d$,f$,h$].forEach(function(t){Se(gb,t)});/*!
29
+ <br>`)},onCopied:function(){const t=this.annotationEntry[this.entryIndex],e={event_name:"portal_maps_annotation_copy_content",category:String((t==null?void 0:t.featureId)||"")};this.trackEvent(e)},trackEvent:function(t){const e={event:"interaction_event",location:"map_annotation",...t};this.$emit("trackEvent",e)}},watch:{annotationEntry:{deep:!0,immediate:!0,handler:function(t,e){t!==e&&(this.entryIndex=0,t!=null&&t.length&&this.emitActiveItemChange())}},entry:{deep:!0,immediate:!0,handler:function(t,e){t&&t!==e&&(this.resetSubmission(),this.updatePrevSubmissions())}}},mounted:function(){var t;(t=this.$annotator)==null||t.authenticate(this.userApiKey).then(e=>{e.name&&e.email&&e.canUpdate?(this.creator=e,e.orcid||(this.creator.orcid="0000-0000-0000-0000"),this.authenticated=!0):this.errorMessage="",this.updatePrevSubmissions()})}},Yn=t=>(s.pushScopeId("data-v-2a2f8754"),t=t(),s.popScopeId(),t),aF={key:0,class:"toggle-button"},iF={class:"block"},oF=Yn(()=>s.createElementVNode("div",{class:"title"},"Feature Annotations",-1)),sF={class:"title-buttons"},lF={key:0},uF=["href"],cF=Yn(()=>s.createElementVNode("strong",{class:"sub-title"},"Previous submissions:",-1)),dF=Yn(()=>s.createElementVNode("strong",null,"Evidence:  ",-1)),fF=["href"],hF={key:1},pF={key:2},vF=Yn(()=>s.createElementVNode("strong",null,"Comment:  ",-1)),gF=Yn(()=>s.createElementVNode("strong",{class:"sub-title"},"Suggest changes:",-1)),mF=Yn(()=>s.createElementVNode("strong",null,"Evidence:",-1)),yF=Yn(()=>s.createElementVNode("strong",null,"Comment:",-1)),bF={class:"sub-title"};function wF(t,e,r,n,a,i){const o=Ht,l=Ra,c=cs,u=is,d=Ne.ArrowUp,f=it,h=Ne.ArrowDown,v=Ne.Edit,p=Ne.Delete,g=Ne.Finished,y=Fi,m=Ne.Close,b=SL,w=kL,C=Ai,x=_u;return s.openBlock(),s.createBlock(x,{class:"main"},{default:s.withCtx(()=>[r.annotationEntry.length>1?(s.openBlock(),s.createElementBlock("div",aF,[s.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:s.withCtx(()=>[s.createVNode(o,{class:"button",onClick:i.previous,disabled:this.entryIndex===0},{default:s.withCtx(()=>[s.createTextVNode(" Previous ")]),_:1},8,["onClick","disabled"])]),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(i.previousLabel),1)]),_:1}),s.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:s.withCtx(()=>[s.createVNode(o,{class:"button",onClick:i.next,disabled:this.entryIndex===this.annotationEntry.length-1},{default:s.withCtx(()=>[s.createTextVNode(" Next ")]),_:1},8,["onClick","disabled"])]),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(i.nextLabel),1)]),_:1})])):s.createCommentVNode("",!0),s.createElementVNode("div",iF,[s.createVNode(u,{class:"info-field"},{default:s.withCtx(()=>[oF,s.createElementVNode("div",sF,[s.createVNode(c,{onCopied:i.onCopied,content:i.updatedCopyContent},null,8,["onCopied","content"])])]),_:1}),i.entry?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.displayPair,(k,E)=>s.withDirectives((s.openBlock(),s.createBlock(u,{class:"dialog-text",key:k},{default:s.withCtx(()=>[s.createElementVNode("strong",null,s.toDisplayString(E)+": ",1),s.createTextVNode("  "),E!=="Ontology"?(s.openBlock(),s.createElementBlock("span",lF,s.toDisplayString(i.entry[k]),1)):(s.openBlock(),s.createElementBlock("a",{key:1,href:i.ontologyLink,target:"_blank"},s.toDisplayString(i.entry[k]),9,uF))]),_:2},1024)),[[s.vShow,i.entry[k]]])),128)),t.prevSubs.length>0?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.withDirectives(s.createElementVNode("div",{class:"hide",onClick:e[0]||(e[0]=k=>t.showSubmissions=!1)},[s.createTextVNode(" Hide previous submissions "),s.createVNode(f,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})],512),[[s.vShow,t.showSubmissions]]),s.withDirectives(s.createElementVNode("div",{class:"hide",onClick:e[1]||(e[1]=k=>t.showSubmissions=!0)},[s.createTextVNode(" Show previous "+s.toDisplayString(t.prevSubs.length)+" submission(s) ",1),s.createVNode(f,null,{default:s.withCtx(()=>[s.createVNode(h)]),_:1})],512),[[s.vShow,!t.showSubmissions]]),t.showSubmissions?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(u,{class:"dialog-spacer"}),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[cF]),_:1}),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.prevSubs,(k,E)=>(s.openBlock(),s.createElementBlock("div",{class:"entry",key:E},[k.creator?(s.openBlock(),s.createBlock(u,{key:0,class:"dialog-text"},{default:s.withCtx(()=>[s.createElementVNode("strong",null,s.toDisplayString(i.formatTime(k.created)),1),s.createTextVNode(" "+s.toDisplayString(k.creator.name),1)]),_:2},1024)):s.createCommentVNode("",!0),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[dF,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.processEvidences(k),(_,S)=>(s.openBlock(),s.createBlock(u,{key:_,class:"dialog-text"},{default:s.withCtx(()=>[typeof _=="object"?(s.openBlock(),s.createElementBlock("a",{key:0,href:Object.values(_)[0],target:"_blank"},s.toDisplayString(Object.keys(_)[0]),9,fF)):(s.openBlock(),s.createElementBlock("span",hF,s.toDisplayString(_),1)),S!==k.body.evidence.length-1?(s.openBlock(),s.createElementBlock("span",pF,", ")):s.createCommentVNode("",!0)]),_:2},1024))),128))]),_:2},1024),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[vF,s.createTextVNode(" "+s.toDisplayString(k.body.comment),1)]),_:2},1024)]))),128))],64)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0),t.authenticated||i.offlineAnnotationEnabled?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[i.isEditable?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(u,{class:"dialog-spacer"}),t.editing?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[gF]),_:1}),i.isDeleted?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[mF]),_:1}),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.evidence,(k,E)=>(s.openBlock(),s.createBlock(u,{key:k},{default:s.withCtx(()=>[s.createVNode(y,{span:20},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(t.evidence[E]),1)]),_:2},1024),s.createVNode(y,{span:4},{default:s.withCtx(()=>[s.createVNode(f,{class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(m,{onClick:_=>i.removeEvidence(E)},null,8,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),s.createVNode(u,null,{default:s.withCtx(()=>[s.createVNode(C,{size:"small",placeholder:"Enter",modelValue:t.newEvidence,"onUpdate:modelValue":e[4]||(e[4]=k=>t.newEvidence=k),onChange:e[5]||(e[5]=k=>i.evidenceEntered(k))},{prepend:s.withCtx(()=>[s.createVNode(w,{teleported:!1,modelValue:t.evidencePrefix,"onUpdate:modelValue":e[3]||(e[3]=k=>t.evidencePrefix=k),placeholder:"Other:",class:"select-box","popper-class":"flatmap_dropdown"},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.evidencePrefixes,k=>(s.openBlock(),s.createBlock(b,{key:k.label,value:k.value},{default:s.withCtx(()=>[s.createVNode(u,null,{default:s.withCtx(()=>[s.createVNode(y,{span:12},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(k.label),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1})],64)),s.createVNode(u,null,{default:s.withCtx(()=>[yF]),_:1}),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[s.createVNode(C,{type:"textarea",autosize:{minRows:2,maxRows:4},placeholder:"Enter",modelValue:t.comment,"onUpdate:modelValue":e[6]||(e[6]=k=>t.comment=k)},null,8,["modelValue"])]),_:1}),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[s.createVNode(o,{class:"button",type:"primary",plain:"",onClick:i.submit},{default:s.withCtx(()=>[s.createTextVNode(" Submit ")]),_:1},8,["onClick"])]),_:1})],64)):(s.openBlock(),s.createBlock(u,{key:0},{default:s.withCtx(()=>[s.createVNode(f,{class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(v,{onClick:e[2]||(e[2]=k=>t.editing=!0)})]),_:1}),i.isDeleted?(s.openBlock(),s.createBlock(f,{key:0,class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(p,{onClick:i.submit},null,8,["onClick"])]),_:1})):i.isPositionUpdated?(s.openBlock(),s.createBlock(f,{key:1,class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(g,{onClick:i.submit},null,8,["onClick"])]),_:1})):s.createCommentVNode("",!0)]),_:1})),t.errorMessage?(s.openBlock(),s.createBlock(u,{key:2,class:"dialog-text"},{default:s.withCtx(()=>[s.createElementVNode("strong",bF,s.toDisplayString(t.errorMessage),1)]),_:1})):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)])]),_:1})}const x0=Yt(nF,[["render",wF],["__scopeId","data-v-2a2f8754"]]),CF={name:"CreateTooltipContent",components:{Autocomplete:zy,Button:Ht,Col:Fi,Container:Su,Header:h0,Input:Ai,Main:_u},props:{createData:{type:Object}},watch:{"createData.shape":{handler:function(t,e){this.group=this.createData.tempGroupName?this.createData.tempGroupName:t,e!==void 0&&this.$emit("cancel-create")},immediate:!0},"createData.tempGroupName":{handler:function(t,e){this.group=t||this.createData.shape},immediate:!0}},computed:{confirmText:function(){return this.createData.editingIndex>-1?"Edit":"Confirm"},dialogTitle:function(){return this.createData.editingIndex>-1?`Edit ${this.createData.shape}`:`Create ${this.createData.shape}`},targetRegion:function(){return"regionPrefix"in this.createData?this.createData.regionPrefix:""}},data:function(){return{group:"default",region:"",showPoint:!1}},methods:{confirm:function(){this.$emit("confirm-create",{region:this.targetRegion+this.region,group:this.group,shape:this.createData.shape,editingIndex:this.createData.editingIndex}),this.group=this.createData.shape},cancel:function(){this.$emit("cancel-create")},fetchRegionSuggestions:function(t,e){e([]),this.$emit("create-region-suggestions",{term:t,cb:e})},fetchGroupSuggestions:function(t,e){e([]),this.$emit("create-group-suggestions",{term:t,cb:e,region:this.region})}}},EF={key:0,class:"create-text"},xF={class:"suggested-value"},kF={class:"suggested-value"};function SF(t,e,r,n,a,i){const o=h0,l=Fi,c=is,u=zy,d=Ht,f=_u,h=Su;return s.openBlock(),s.createBlock(h,{class:"create-container"},{default:s.withCtx(()=>[s.createVNode(o,{height:"30px",class:"header"},{default:s.withCtx(()=>[s.createElementVNode("div",null,s.toDisplayString(i.dialogTitle),1)]),_:1}),s.createVNode(f,{class:"slides-block"},{default:s.withCtx(()=>[r.createData.editingIndex===-1&&i.targetRegion?(s.openBlock(),s.createElementBlock("span",EF,s.toDisplayString(`Primitives will be created in the ${i.targetRegion} region`),1)):s.createCommentVNode("",!0),s.withDirectives(s.createVNode(c,{class:"row"},{default:s.withCtx(()=>[s.createVNode(l,{offset:0,span:8},{default:s.withCtx(()=>[s.createTextVNode(" Position: ")]),_:1}),s.createVNode(l,{offset:0,span:16},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.createData.points,({value:v,i:p})=>(s.openBlock(),s.createBlock(c,{key:p,class:"value"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(p),1)]),_:2},1024))),128))]),_:1})]),_:1},512),[[s.vShow,t.showPoint]]),s.createVNode(c,{class:"row"},{default:s.withCtx(()=>[s.createVNode(l,{offset:0,span:8},{default:s.withCtx(()=>[s.createTextVNode(" Region: ")]),_:1}),s.createVNode(l,{offset:0,span:16},{default:s.withCtx(()=>[s.createVNode(u,{class:"autocomplete-box","fit-input-width":!0,modelValue:t.region,"onUpdate:modelValue":e[0]||(e[0]=v=>t.region=v),placeholder:i.targetRegion,"fetch-suggestions":i.fetchRegionSuggestions,teleported:!0,"popper-class":"autocomplete-popper"},{default:s.withCtx(({item:v})=>[s.createElementVNode("div",xF,s.toDisplayString(v.value),1)]),_:1},8,["modelValue","placeholder","fetch-suggestions"])]),_:1})]),_:1}),s.createVNode(c,{class:"row"},{default:s.withCtx(()=>[s.createVNode(l,{offset:0,span:8},{default:s.withCtx(()=>[s.createTextVNode(" Group: ")]),_:1}),s.createVNode(l,{offset:0,span:16},{default:s.withCtx(()=>[s.createVNode(u,{class:"autocomplete-box","fit-input-width":!0,modelValue:t.group,"onUpdate:modelValue":e[1]||(e[1]=v=>t.group=v),placeholder:r.createData.shape,"fetch-suggestions":i.fetchGroupSuggestions,teleported:!0,"popper-class":"autocomplete-popper"},{default:s.withCtx(({item:v})=>[s.createElementVNode("div",kF,s.toDisplayString(v.value),1)]),_:1},8,["modelValue","placeholder","fetch-suggestions"])]),_:1})]),_:1}),s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(l,{offset:0,span:12},{default:s.withCtx(()=>[s.createVNode(d,{type:"primary",plain:"",onClick:i.confirm},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.confirmText),1)]),_:1},8,["onClick"])]),_:1}),s.createVNode(l,{offset:0,span:12},{default:s.withCtx(()=>[s.createVNode(d,{type:"primary",plain:"",onClick:i.cancel},{default:s.withCtx(()=>[s.createTextVNode(" Cancel ")]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1})]),_:1})}const _F=Yt(CF,[["render",SF],["__scopeId","data-v-3873e5c6"]]);function ht(t){"@babel/helpers - typeof";return ht=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},ht(t)}function Ou(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function TF(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 Au(t,e,r){return e&&TF(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function k0(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vr(t,e){return NF(t)||IF(t,e)||S0(t,e)||BF()}function NF(t){if(Array.isArray(t))return t}function IF(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],a=!0,i=!1,o,l;try{for(r=r.call(t);!(a=(o=r.next()).done)&&(n.push(o.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 S0(t,e){if(t){if(typeof t=="string")return _0(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 _0(t,e)}}function _0(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 BF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
30
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T0(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=S0(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.
31
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,l;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return i=c.done,c},e:function(c){o=!0,l=c},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(o)throw l}}}}var pt=typeof window>"u"?null:window,N0=pt?pt.navigator:null;pt&&pt.document;var DF=ht(""),I0=ht({}),PF=ht(function(){}),OF=typeof HTMLElement>"u"?"undefined":ht(HTMLElement),Hi=function(e){return e&&e.instanceString&&Xe(e.instanceString)?e.instanceString():null},Ee=function(e){return e!=null&&ht(e)==DF},Xe=function(e){return e!=null&&ht(e)===PF},Ke=function(e){return!Zt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Ae=function(e){return e!=null&&ht(e)===I0&&!Ke(e)&&e.constructor===Object},AF=function(e){return e!=null&&ht(e)===I0},de=function(e){return e!=null&&ht(e)===ht(1)&&!isNaN(e)},RF=function(e){return de(e)&&Math.floor(e)===e},ds=function(e){if(OF!=="undefined")return e!=null&&e instanceof HTMLElement},Zt=function(e){return Ki(e)||B0(e)},Ki=function(e){return Hi(e)==="collection"&&e._private.single},B0=function(e){return Hi(e)==="collection"&&!e._private.single},Ru=function(e){return Hi(e)==="core"},D0=function(e){return Hi(e)==="stylesheet"},LF=function(e){return Hi(e)==="event"},mn=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},FF=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},MF=function(e){return Ae(e)&&de(e.x1)&&de(e.x2)&&de(e.y1)&&de(e.y2)},$F=function(e){return AF(e)&&Xe(e.then)},VF=function(){return N0&&N0.userAgent.match(/msie|trident|edge/i)},Gi=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")});var n=function a(){var i=this,o=arguments,l,c=r.apply(i,o),u=a.cache;return(l=u[c])||(l=u[c]=e.apply(i,o)),l};return n.cache={},n},Lu=Gi(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),fs=Gi(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),P0=Gi(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),O0=function(e){return mn(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},vt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",qF="rgb[a]?\\(("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)(?:\\s*,\\s*("+vt+"))?\\)",zF="rgb[a]?\\((?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)(?:\\s*,\\s*(?:"+vt+"))?\\)",HF="hsl[a]?\\(("+vt+")\\s*,\\s*("+vt+"[%])\\s*,\\s*("+vt+"[%])(?:\\s*,\\s*("+vt+"))?\\)",KF="hsl[a]?\\((?:"+vt+")\\s*,\\s*(?:"+vt+"[%])\\s*,\\s*(?:"+vt+"[%])(?:\\s*,\\s*(?:"+vt+"))?\\)",GF="\\#[0-9a-fA-F]{3}",UF="\\#[0-9a-fA-F]{6}",A0=function(e,r){return e<r?-1:e>r?1:0},jF=function(e,r){return-1*A0(e,r)},Se=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 o=a[i];t[o]=n[o]}}return t},WF=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,n,a,i,o=16;return r?(n=parseInt(e[1]+e[1],o),a=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(n=parseInt(e[1]+e[2],o),a=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[n,a,i]}},YF=function(e){var r,n,a,i,o,l,c,u;function d(p,g,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?p+(g-p)*6*y:y<1/2?g:y<2/3?p+(g-p)*(2/3-y)*6:p}var f=new RegExp("^"+HF+"$").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,o=f[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(a===0)l=c=u=Math.round(i*255);else{var h=i<.5?i*(1+a):i+a-i*a,v=2*i-h;l=Math.round(255*d(v,h,n+1/3)),c=Math.round(255*d(v,h,n)),u=Math.round(255*d(v,h,n-1/3))}r=[l,c,u,o]}return r},ZF=function(e){var r,n=new RegExp("^"+qF+"$").exec(e);if(n){r=[];for(var a=[],i=1;i<=3;i++){var o=n[i];if(o[o.length-1]==="%"&&(a[i]=!0),o=parseFloat(o),a[i]&&(o=o/100*255),o<0||o>255)return;r.push(Math.floor(o))}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},XF=function(e){return QF[e.toLowerCase()]},JF=function(e){return(Ke(e)?e:null)||XF(e)||WF(e)||ZF(e)||YF(e)},QF={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]},R0=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(Ae(o))throw Error("Tried to set map with object key");i<n.length-1?(r[o]==null&&(r[o]={}),r=r[o]):r[o]=e.value}},L0=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(Ae(o))throw Error("Tried to get map with object key");if(r=r[o],r==null)return r}return r};function eM(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Zn=eM,Ui=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tM(t,e){return e={exports:{}},t(e,e.exports),e.exports}var rM=typeof Ui=="object"&&Ui&&Ui.Object===Object&&Ui,nM=rM,aM=typeof self=="object"&&self&&self.Object===Object&&self,iM=nM||aM||Function("return this")(),hs=iM,oM=function(){return hs.Date.now()},Fu=oM,sM=/\s/;function lM(t){for(var e=t.length;e--&&sM.test(t.charAt(e)););return e}var uM=lM,cM=/^\s+/;function dM(t){return t&&t.slice(0,uM(t)+1).replace(cM,"")}var fM=dM,hM=hs.Symbol,Fa=hM,F0=Object.prototype,pM=F0.hasOwnProperty,vM=F0.toString,ji=Fa?Fa.toStringTag:void 0;function gM(t){var e=pM.call(t,ji),r=t[ji];try{t[ji]=void 0;var n=!0}catch{}var a=vM.call(t);return n&&(e?t[ji]=r:delete t[ji]),a}var mM=gM,yM=Object.prototype,bM=yM.toString;function wM(t){return bM.call(t)}var CM=wM,EM="[object Null]",xM="[object Undefined]",M0=Fa?Fa.toStringTag:void 0;function kM(t){return t==null?t===void 0?xM:EM:M0&&M0 in Object(t)?mM(t):CM(t)}var $0=kM;function SM(t){return t!=null&&typeof t=="object"}var _M=SM,TM="[object Symbol]";function NM(t){return typeof t=="symbol"||_M(t)&&$0(t)==TM}var Wi=NM,V0=NaN,IM=/^[-+]0x[0-9a-f]+$/i,BM=/^0b[01]+$/i,DM=/^0o[0-7]+$/i,PM=parseInt;function OM(t){if(typeof t=="number")return t;if(Wi(t))return V0;if(Zn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Zn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=fM(t);var r=BM.test(t);return r||DM.test(t)?PM(t.slice(2),r?2:8):IM.test(t)?V0:+t}var q0=OM,AM="Expected a function",RM=Math.max,LM=Math.min;function FM(t,e,r){var n,a,i,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(AM);e=q0(e)||0,Zn(r)&&(d=!!r.leading,f="maxWait"in r,i=f?RM(q0(r.maxWait)||0,e):i,h="trailing"in r?!!r.trailing:h);function v(k){var E=n,_=a;return n=a=void 0,u=k,o=t.apply(_,E),o}function p(k){return u=k,l=setTimeout(m,e),d?v(k):o}function g(k){var E=k-c,_=k-u,S=e-E;return f?LM(S,i-_):S}function y(k){var E=k-c,_=k-u;return c===void 0||E>=e||E<0||f&&_>=i}function m(){var k=Fu();if(y(k))return b(k);l=setTimeout(m,g(k))}function b(k){return l=void 0,h&&n?v(k):(n=a=void 0,o)}function w(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function C(){return l===void 0?o:b(Fu())}function x(){var k=Fu(),E=y(k);if(n=arguments,a=this,c=k,E){if(l===void 0)return p(c);if(f)return clearTimeout(l),l=setTimeout(m,e),v(c)}return l===void 0&&(l=setTimeout(m,e)),o}return x.cancel=w,x.flush=C,x}var ps=FM,Mu=pt?pt.performance:null,z0=Mu&&Mu.now?function(){return Mu.now()}:function(){return Date.now()},MM=function(){if(pt){if(pt.requestAnimationFrame)return function(t){pt.requestAnimationFrame(t)};if(pt.mozRequestAnimationFrame)return function(t){pt.mozRequestAnimationFrame(t)};if(pt.webkitRequestAnimationFrame)return function(t){pt.webkitRequestAnimationFrame(t)};if(pt.msRequestAnimationFrame)return function(t){pt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(z0())},1e3/60)}}(),vs=function(e){return MM(e)},Yr=z0,Ma=9261,H0=65599,Yi=5381,K0=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ma,n=r,a;a=e.next(),!a.done;)n=n*H0+a.value|0;return n},Zi=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ma;return r*H0+e|0},Xi=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Yi;return(r<<5)+r+e|0},$M=function(e,r){return e*2097152+r},yn=function(e){return e[0]*2097152+e[1]},gs=function(e,r){return[Zi(e[0],r[0]),Xi(e[1],r[1])]},VM=function(e,r){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e[a++]:n.done=!0,n}};return K0(o,r)},Xn=function(e,r){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}};return K0(o,r)},G0=function(){return qM(arguments)},qM=function(e){for(var r,n=0;n<e.length;n++){var a=e[n];n===0?r=Xn(a):r=Xn(a,r)}return r},U0=!0,zM=console.warn!=null,HM=console.trace!=null,$u=Number.MAX_SAFE_INTEGER||9007199254740991,j0=function(){return!0},ms=function(){return!1},W0=function(){return 0},Vu=function(){},Je=function(e){throw new Error(e)},Y0=function(e){if(e!==void 0)U0=!!e;else return U0},$e=function(e){Y0()&&(zM?console.warn(e):(console.log(e),HM&&console.trace()))},KM=function(e){return Se({},e)},Nr=function(e){return e==null?e:Ke(e)?e.slice():Ae(e)?KM(e):e},GM=function(e){return e.slice()},Z0=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},UM={},X0=function(){return UM},St=function(e){var r=Object.keys(e);return function(n){for(var a={},i=0;i<r.length;i++){var o=r[i],l=n==null?void 0:n[o];a[o]=l===void 0?e[o]:l}return a}},bn=function(e,r,n){for(var a=e.length-1;a>=0;a--)e[a]===r&&e.splice(a,1)},qu=function(e){e.splice(0,e.length)},jM=function(e,r){for(var n=0;n<r.length;n++){var a=r[n];e.push(a)}},gr=function(e,r,n){return n&&(r=P0(n,r)),e[r]},wn=function(e,r,n,a){n&&(r=P0(n,r)),e[r]=a},WM=function(){function t(){Ou(this,t),this._obj={}}return Au(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}(),Ir=typeof Map<"u"?Map:WM,YM="undefined",ZM=function(){function t(e){if(Ou(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 Au(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}(),$a=(typeof Set>"u"?"undefined":ht(Set))!==YM?Set:ZM,ys=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Ru(e)){Je("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"){Je("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 $a,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 o=r.renderedPosition,l=e.pan(),c=e.zoom();i.position={x:(o.x-l.x)/c,y:(o.y-l.y)/c}}var u=[];Ke(r.classes)?u=r.classes:Ee(r.classes)&&(u=r.classes.split(/\s+/));for(var d=0,f=u.length;d<f;d++){var h=u[d];!h||h===""||i.classes.add(h)}this.createEmitter();var v=r.style||r.css;v&&($e("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()},J0=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var o;Ae(n)&&!Zt(n)&&(o=n,n=o.roots||o.root,a=o.visit,i=o.directed),i=arguments.length===2&&!Xe(a)?a:i,a=Xe(a)?a:function(){};for(var l=this._private.cy,c=n=Ee(n)?this.filter(n):n,u=[],d=[],f={},h={},v={},p=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)),h[x]=0)}for(var k=function(){var P=e.bfs?u.shift():u.pop(),D=P.id();if(e.dfs){if(v[D])return"continue";v[D]=!0,d.push(P)}var R=h[D],O=f[D],F=O!=null?O.source():null,A=O!=null?O.target():null,z=O==null?void 0:P.same(F)?A[0]:F[0],j=void 0;if(j=a(P,O,z,p++,R),j===!0)return g=P,"break";if(j===!1)return"break";for(var H=P.connectedEdges().filter(function(q){return(!i||q.source().same(P))&&b.has(q)}),G=0;G<H.length;G++){var X=H[G],M=X.connectedNodes().filter(function(q){return!q.same(P)&&m.has(q)}),V=M.id();M.length!==0&&!v[V]&&(M=M[0],u.push(M),e.bfs&&(v[V]=!0,d.push(M)),f[V]=X,h[V]=h[D]+1)}};u.length!==0;){var E=k();if(E!=="continue"&&E==="break")break}for(var _=l.collection(),S=0;S<d.length;S++){var T=d[S],N=f[T.id()];N!=null&&_.push(N),_.push(T)}return{path:l.collection(_),found:l.collection(g)}}},Ji={breadthFirstSearch:J0({bfs:!0}),depthFirstSearch:J0({dfs:!0})};Ji.bfs=Ji.breadthFirstSearch,Ji.dfs=Ji.depthFirstSearch;var XM=tM(function(t,e){(function(){var r,n,a,i,o,l,c,u,d,f,h,v,p,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 k;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;)k=a((w+C)/2),x(b,m[k])<0?C=k:w=k+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)},o=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,k,E,_;for(b==null&&(b=n),k=(function(){_=[];for(var S=0,T=a(m.length/2);0<=T?S<T:S>T;0<=T?S++:S--)_.push(S);return _}).apply(this).reverse(),E=[],C=0,x=k.length;C<x;C++)w=k[C],E.push(y(m,w,b));return E},p=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)},h=function(m,b,w){var C,x,k,E,_;if(w==null&&(w=n),x=m.slice(0,b),!x.length)return x;for(i(x,w),_=m.slice(b),k=0,E=_.length;k<E;k++)C=_[k],c(x,C,w);return x.sort(w).reverse()},v=function(m,b,w){var C,x,k,E,_,S,T,N,B;if(w==null&&(w=n),b*10<=m.length){if(k=m.slice(0,b).sort(w),!k.length)return k;for(x=k[k.length-1],T=m.slice(b),E=0,S=T.length;E<S;E++)C=T[E],w(C,x)<0&&(d(k,C,0,null,w),k.pop(),x=k[k.length-1]);return k}for(i(m,w),B=[],_=0,N=f(b,m.length);0<=N?_<N:_>N;0<=N?++_:--_)B.push(o(m,w));return B},g=function(m,b,w,C){var x,k,E;for(C==null&&(C=n),x=m[w];w>b;){if(E=w-1>>1,k=m[E],C(x,k)<0){m[w]=k,w=E;continue}break}return m[w]=x},y=function(m,b,w){var C,x,k,E,_;for(w==null&&(w=n),x=m.length,_=b,k=m[b],C=2*b+1;C<x;)E=C+1,E<x&&!(w(m[C],m[E])<0)&&(C=E),m[b]=m[C],b=C,C=2*b+1;return m[b]=k,g(m,_,b,w)},r=function(){m.push=l,m.pop=o,m.replace=u,m.pushpop=c,m.heapify=i,m.updateItem=p,m.nlargest=h,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 o(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 p(this.nodes,b,this.cmp)},m.prototype.clear=function(){return this.nodes=[]},m.prototype.empty=function(){return this.nodes.length===0},m.prototype.size=function(){return this.nodes.length},m.prototype.clone=function(){var b;return b=new m,b.nodes=this.nodes.slice(0),b},m.prototype.toArray=function(){return this.nodes.slice(0)},m.prototype.insert=m.prototype.push,m.prototype.top=m.prototype.peek,m.prototype.front=m.prototype.peek,m.prototype.has=m.prototype.contains,m.prototype.copy=m.prototype.clone,m}(),function(m,b){return t.exports=b()}(this,function(){return r})}).call(Ui)}),Qi=XM,JM=St({root:null,weight:function(e){return 1},directed:!1}),QM={dijkstra:function(e){if(!Ae(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var n=JM(e),a=n.root,i=n.weight,o=n.directed,l=this,c=i,u=Ee(a)?this.filter(a)[0]:a[0],d={},f={},h={},v=this.byGroup(),p=v.nodes,g=v.edges;g.unmergeBy(function(R){return R.isLoop()});for(var y=function(O){return d[O.id()]},m=function(O,F){d[O.id()]=F,b.updateItem(O)},b=new Qi(function(R,O){return y(R)-y(O)}),w=0;w<p.length;w++){var C=p[w];d[C.id()]=C.same(u)?0:1/0,b.push(C)}for(var x=function(O,F){for(var A=(o?O.edgesTo(F):O.edgesWith(F)).intersect(g),z=1/0,j,H=0;H<A.length;H++){var G=A[H],X=c(G);(X<z||!j)&&(z=X,j=G)}return{edge:j,dist:z}};b.size()>0;){var k=b.pop(),E=y(k),_=k.id();if(h[_]=E,E!==1/0)for(var S=k.neighborhood().intersect(p),T=0;T<S.length;T++){var N=S[T],B=N.id(),P=x(k,N),D=E+P.dist;D<y(N)&&(m(N,D),f[B]={node:k,edge:P.edge})}}return{distanceTo:function(O){var F=Ee(O)?p.filter(O)[0]:O[0];return h[F.id()]},pathTo:function(O){var F=Ee(O)?p.filter(O)[0]:O[0],A=[],z=F,j=z.id();if(F.length>0)for(A.unshift(F);f[j];){var H=f[j];A.unshift(H.edge),A.unshift(H.node),z=H.node,j=z.id()}return l.spawn(A)}}}},e5={kruskal:function(e){e=e||function(w){return 1};for(var r=this.byGroup(),n=r.nodes,a=r.edges,i=n.length,o=new Array(i),l=n,c=function(C){for(var x=0;x<o.length;x++){var k=o[x];if(k.has(C))return x}},u=0;u<i;u++)o[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 h=d[f],v=h.source()[0],p=h.target()[0],g=c(v),y=c(p),m=o[g],b=o[y];g!==y&&(l.merge(h),m.merge(b),o.splice(y,1))}return l}},t5=St({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),r5={aStar:function(e){var r=this.cy(),n=t5(e),a=n.root,i=n.goal,o=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={},h={},v={},p=new Qi(function(j,H){return h[j.id()]-h[H.id()]}),g=new $a,y={},m={},b=function(H,G){p.push(H),g.add(G)},w,C,x=function(){w=p.pop(),C=w.id(),g.delete(C)},k=function(H){return g.has(H)};b(a,u),f[u]=0,h[u]=o(a);for(var E=0;p.size()>0;){if(x(),E++,C===d){for(var _=[],S=i,T=d,N=m[T];_.unshift(S),N!=null&&_.unshift(N),S=y[T],S!=null;)T=S.id(),N=m[T];return{found:!0,distance:f[C],path:this.spawn(_),steps:E}}v[C]=!0;for(var B=w._private.edges,P=0;P<B.length;P++){var D=B[P];if(this.hasElementWithId(D.id())&&!(l&&D.data("source")!==C)){var R=D.source(),O=D.target(),F=R.id()!==C?R:O,A=F.id();if(this.hasElementWithId(A)&&!v[A]){var z=f[C]+c(D);if(!k(A)){f[A]=z,h[A]=z+o(F),b(F,A),y[A]=w,m[A]=D;continue}z<f[A]&&(f[A]=z,h[A]=z+o(F),y[A]=w,m[A]=D)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},n5=St({weight:function(e){return 1},directed:!1}),a5={floydWarshall:function(e){for(var r=this.cy(),n=n5(e),a=n.weight,i=n.directed,o=a,l=this.byGroup(),c=l.nodes,u=l.edges,d=c.length,f=d*d,h=function(X){return c.indexOf(X)},v=function(X){return c[X]},p=new Array(f),g=0;g<f;g++){var y=g%d,m=(g-y)/d;m===y?p[g]=0:p[g]=1/0}for(var b=new Array(f),w=new Array(f),C=0;C<u.length;C++){var x=u[C],k=x.source()[0],E=x.target()[0];if(k!==E){var _=h(k),S=h(E),T=_*d+S,N=o(x);if(p[T]>N&&(p[T]=N,b[T]=S,w[T]=x),!i){var B=S*d+_;!i&&p[B]>N&&(p[B]=N,b[B]=_,w[B]=x)}}}for(var P=0;P<d;P++)for(var D=0;D<d;D++)for(var R=D*d+P,O=0;O<d;O++){var F=D*d+O,A=P*d+O;p[R]+p[A]<p[F]&&(p[F]=p[R]+p[A],b[F]=b[R])}var z=function(X){return(Ee(X)?r.filter(X):X)[0]},j=function(X){return h(z(X))},H={distance:function(X,M){var V=j(X),q=j(M);return p[V*d+q]},path:function(X,M){var V=j(X),q=j(M),$=v(V);if(V===q)return $.collection();if(b[V*d+q]==null)return r.collection();var K=r.collection(),L=V,W;for(K.merge($);V!==q;)L=V,V=b[V*d+q],W=w[L*d+V],K.merge(W),K.merge(v(V));return K}};return H}},i5=St({weight:function(e){return 1},directed:!1,root:null}),o5={bellmanFord:function(e){var r=this,n=i5(e),a=n.weight,i=n.directed,o=n.root,l=a,c=this,u=this.cy(),d=this.byGroup(),f=d.edges,h=d.nodes,v=h.length,p=new Ir,g=!1,y=[];o=u.collection(o)[0],f.unmergeBy(function(ie){return ie.isLoop()});for(var m=f.length,b=function(fe){var pe=p.get(fe.id());return pe||(pe={},p.set(fe.id(),pe)),pe},w=function(fe){return(Ee(fe)?u.$(fe):fe)[0]},C=function(fe){return b(w(fe)).dist},x=function(fe){for(var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,Pe=w(fe),Ie=[],we=Pe;;){if(we==null)return r.spawn();var xe=b(we),re=xe.edge,I=xe.pred;if(Ie.unshift(we[0]),we.same(pe)&&Ie.length>0)break;re!=null&&Ie.unshift(re),we=I}return c.spawn(Ie)},k=0;k<v;k++){var E=h[k],_=b(E);E.same(o)?_.dist=0:_.dist=1/0,_.pred=null,_.edge=null}for(var S=!1,T=function(fe,pe,Pe,Ie,we,xe){var re=Ie.dist+xe;re<we.dist&&!Pe.same(Ie.edge)&&(we.dist=re,we.pred=fe,we.edge=Pe,S=!0)},N=1;N<v;N++){S=!1;for(var B=0;B<m;B++){var P=f[B],D=P.source(),R=P.target(),O=l(P),F=b(D),A=b(R);T(D,R,P,F,A,O),i||T(R,D,P,A,F,O)}if(!S)break}if(S)for(var z=[],j=0;j<m;j++){var H=f[j],G=H.source(),X=H.target(),M=l(H),V=b(G).dist,q=b(X).dist;if(V+M<q||!i&&q+M<V)if(g||($e("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),e.findNegativeWeightCycles!==!1){var $=[];V+M<q&&$.push(G),!i&&q+M<V&&$.push(X);for(var K=$.length,L=0;L<K;L++){var W=$[L],Y=[W];Y.push(b(W).edge);for(var se=b(W).pred;Y.indexOf(se)===-1;)Y.push(se),Y.push(b(se).edge),se=b(se).pred;Y=Y.slice(Y.indexOf(se));for(var ue=Y[0].id(),ae=0,ne=2;ne<Y.length;ne+=2)Y[ne].id()<ue&&(ue=Y[ne].id(),ae=ne);Y=Y.slice(ae).concat(Y.slice(0,ae)),Y.push(Y[0]);var ce=Y.map(function(ie){return ie.id()}).join(",");z.indexOf(ce)===-1&&(y.push(c.spawn(Y)),z.push(ce))}}else break}return{distanceTo:C,pathTo:x,hasNegativeWeightCycle:g,negativeWeightCycles:y}}},s5=Math.sqrt(2),l5=function(e,r,n){n.length===0&&Je("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],i=a[1],o=a[2],l=r[i],c=r[o],u=n,d=u.length-1;d>=0;d--){var f=u[d],h=f[1],v=f[2];(r[h]===l&&r[v]===c||r[h]===c&&r[v]===l)&&u.splice(d,1)}for(var p=0;p<u.length;p++){var g=u[p];g[1]===c?(u[p]=g.slice(),u[p][1]=l):g[2]===c&&(u[p]=g.slice(),u[p][2]=l)}for(var y=0;y<r.length;y++)r[y]===c&&(r[y]=l);return u},zu=function(e,r,n,a){for(;n>a;){var i=Math.floor(Math.random()*r.length);r=l5(i,e,r),n--}return r},u5={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,a=r.edges;a.unmergeBy(function(A){return A.isLoop()});var i=n.length,o=a.length,l=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),c=Math.floor(i/s5);if(i<2){Je("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],d=0;d<o;d++){var f=a[d];u.push([d,n.indexOf(f.source()),n.indexOf(f.target())])}for(var h=1/0,v=[],p=new Array(i),g=new Array(i),y=new Array(i),m=function(z,j){for(var H=0;H<i;H++)j[H]=z[H]},b=0;b<=l;b++){for(var w=0;w<i;w++)g[w]=w;var C=zu(g,u.slice(),i,c),x=C.slice();m(g,y);var k=zu(g,C,c,2),E=zu(y,x,c,2);k.length<=E.length&&k.length<h?(h=k.length,v=k,m(g,p)):E.length<=k.length&&E.length<h&&(h=E.length,v=E,m(y,p))}for(var _=this.spawn(v.map(function(A){return a[A[0]]})),S=this.spawn(),T=this.spawn(),N=p[0],B=0;B<p.length;B++){var P=p[B],D=n[B];P===N?S.merge(D):T.merge(D)}var R=function(z){var j=e.spawn();return z.forEach(function(H){j.merge(H),H.connectedEdges().forEach(function(G){e.contains(G)&&!_.contains(G)&&j.merge(G)})}),j},O=[R(S),R(T)],F={cut:_,components:O,partition1:S,partition2:T};return F}},c5=function(e){return{x:e.x,y:e.y}},bs=function(e,r,n){return{x:e.x*r+n.x,y:e.y*r+n.y}},Q0=function(e,r,n){return{x:(e.x-n.x)/r,y:(e.y-n.y)/r}},Va=function(e){return{x:e[0],y:e[1]}},d5=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 o=e[i];isFinite(o)&&(a=Math.min(o,a))}return a},f5=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 o=e[i];isFinite(o)&&(a=Math.max(o,a))}return a},h5=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,o=r;o<n;o++){var l=e[o];isFinite(l)&&(a+=l,i++)}return a/i},p5=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,o=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];o?isFinite(u)||(e[c]=-1/0,l++):e.splice(c,1)}i&&e.sort(function(h,v){return h-v});var d=e.length,f=Math.floor(d/2);return d%2!==0?e[f+1+l]:(e[f-1+l]+e[f+l])/2},v5=function(e){return Math.PI*e/180},ws=function(e,r){return Math.atan2(r,e)-Math.PI/2},Hu=Math.log2||function(t){return Math.log(t)/Math.log(2)},eb=function(e){return e>0?1:e<0?-1:0},Jn=function(e,r){return Math.sqrt(Qn(e,r))},Qn=function(e,r){var n=r.x-e.x,a=r.y-e.y;return n*n+a*a},g5=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},bt=function(e,r,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*r+a*a*n},qa=function(e,r,n,a){return{x:bt(e.x,r.x,n.x,a),y:bt(e.y,r.y,n.y,a)}},m5=function(e,r,n,a){var i={x:r.x-e.x,y:r.y-e.y},o=Jn(e,r),l={x:i.x/o,y:i.y/o};return n=n??0,a=a??n*o,{x:e.x+l.x*a,y:e.y+l.y*a}},eo=function(e,r,n){return Math.max(e,Math.min(n,r))},Kt=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}}},y5=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},b5=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},w5=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}},tb=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},C5=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},Cs=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},Es=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,a,i,o;if(r.length===1)n=a=i=o=r[0];else if(r.length===2)n=i=r[0],o=a=r[1];else if(r.length===4){var l=vr(r,4);n=l[0],a=l[1],i=l[2],o=l[3]}return e.x1-=o,e.x2+=a,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},rb=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},Ku=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)},za=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},E5=function(e,r){return za(e,r.x,r.y)},nb=function(e,r){return za(e,r.x1,r.y1)&&za(e,r.x2,r.y2)},ab=function(e,r,n,a,i,o,l){var c=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=c==="auto"?ta(i,o):c,d=i/2,f=o/2;u=Math.min(u,d,f);var h=u!==d,v=u!==f,p;if(h){var g=n-d+u-l,y=a-f-l,m=n+d-u+l,b=y;if(p=Cn(e,r,n,a,g,y,m,b,!1),p.length>0)return p}if(v){var w=n+d+l,C=a-f+u-l,x=w,k=a+f-u+l;if(p=Cn(e,r,n,a,w,C,x,k,!1),p.length>0)return p}if(h){var E=n-d+u-l,_=a+f+l,S=n+d-u+l,T=_;if(p=Cn(e,r,n,a,E,_,S,T,!1),p.length>0)return p}if(v){var N=n-d-l,B=a-f+u-l,P=N,D=a+f-u+l;if(p=Cn(e,r,n,a,N,B,P,D,!1),p.length>0)return p}var R;{var O=n-d+u,F=a-f+u;if(R=to(e,r,n,a,O,F,u+l),R.length>0&&R[0]<=O&&R[1]<=F)return[R[0],R[1]]}{var A=n+d-u,z=a-f+u;if(R=to(e,r,n,a,A,z,u+l),R.length>0&&R[0]>=A&&R[1]<=z)return[R[0],R[1]]}{var j=n+d-u,H=a+f-u;if(R=to(e,r,n,a,j,H,u+l),R.length>0&&R[0]>=j&&R[1]>=H)return[R[0],R[1]]}{var G=n-d+u,X=a+f-u;if(R=to(e,r,n,a,G,X,u+l),R.length>0&&R[0]<=G&&R[1]>=X)return[R[0],R[1]]}return[]},x5=function(e,r,n,a,i,o,l){var c=l,u=Math.min(n,i),d=Math.max(n,i),f=Math.min(a,o),h=Math.max(a,o);return u-c<=e&&e<=d+c&&f-c<=r&&r<=h+c},k5=function(e,r,n,a,i,o,l,c,u){var d={x1:Math.min(n,l,i)-u,x2:Math.max(n,l,i)+u,y1:Math.min(a,c,o)-u,y2:Math.max(a,c,o)+u};return!(e<d.x1||e>d.x2||r<d.y1||r>d.y2)},S5=function(e,r,n,a){n-=a;var i=r*r-4*e*n;if(i<0)return[];var o=Math.sqrt(i),l=2*e,c=(-r+o)/l,u=(-r-o)/l;return[c,u]},_5=function(e,r,n,a,i){var o=1e-5;e===0&&(e=o),r/=e,n/=e,a/=e;var l,c,u,d,f,h,v,p;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),h=u-Math.sqrt(l),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-v+f+h,v+=(f+h)/2,i[4]=i[2]=-v,v=Math.sqrt(3)*(-h+f)/2,i[3]=v,i[5]=-v;return}if(i[5]=i[3]=0,l===0){p=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-v+2*p,i[4]=i[2]=-(p+v);return}c=-c,d=c*c*c,d=Math.acos(u/Math.sqrt(d)),p=2*Math.sqrt(c),i[0]=-v+p*Math.cos(d/3),i[2]=-v+p*Math.cos((d+2*Math.PI)/3),i[4]=-v+p*Math.cos((d+4*Math.PI)/3)},T5=function(e,r,n,a,i,o,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*o+2*a*c+4*o*o-4*o*c+c*c,d=1*9*n*i-3*n*n-3*n*l-6*i*i+3*i*l+9*a*o-3*a*a-3*a*c-6*o*o+3*o*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*o+a*c-a*r+2*o*o+2*o*r-c*r,h=1*n*i-n*n+n*e-i*e+a*o-a*a+a*r-o*r,v=[];_5(u,d,f,h,v);for(var p=1e-7,g=[],y=0;y<6;y+=2)Math.abs(v[y+1])<p&&v[y]>=0&&v[y]<=1&&g.push(v[y]);g.push(1),g.push(0);for(var m=-1,b,w,C,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]*o+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},N5=function(e,r,n,a,i,o){var l=[e-n,r-a],c=[i-n,o-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],h=f*f/u;return f<0?d:h>u?(e-i)*(e-i)+(r-o)*(r-o):d-h},Gt=function(e,r,n){for(var a,i,o,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?(o=n[(d+1)*2],l=n[(d+1)*2+1]):(o=n[(d+1-n.length/2)*2],l=n[(d+1-n.length/2)*2+1]),!(a==e&&o==e))if(a>=e&&e>=o||a<=e&&e<=o)c=(e-a)/(o-a)*(l-i)+i,c>r&&u++;else continue;return u%2!==0},Zr=function(e,r,n,a,i,o,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 h=Math.cos(-f),v=Math.sin(-f),p=0;p<d.length/2;p++)d[p*2]=o/2*(n[p*2]*h-n[p*2+1]*v),d[p*2+1]=l/2*(n[p*2+1]*h+n[p*2]*v),d[p*2]+=a,d[p*2+1]+=i;var g;if(u>0){var y=ks(d,-u);g=xs(y)}else g=d;return Gt(e,r,g)},I5=function(e,r,n,a,i,o,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 h=Math.pow(f.cx-e,2)+Math.pow(f.cy-r,2);if(h<=Math.pow(f.radius,2))return!0}return Gt(e,r,u)},xs=function(e){for(var r=new Array(e.length/2),n,a,i,o,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],o=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 h=Cn(n,a,i,o,l,c,u,d,!0);r[f*2]=h[0],r[f*2+1]=h[1]}return r},ks=function(e,r){for(var n=new Array(e.length*2),a,i,o,l,c=0;c<e.length/2;c++){a=e[c*2],i=e[c*2+1],c<e.length/2-1?(o=e[(c+1)*2],l=e[(c+1)*2+1]):(o=e[0],l=e[1]);var u=l-i,d=-(o-a),f=Math.sqrt(u*u+d*d),h=u/f,v=d/f;n[c*4]=a+h*r,n[c*4+1]=i+v*r,n[c*4+2]=o+h*r,n[c*4+3]=l+v*r}return n},B5=function(e,r,n,a,i,o){var l=n-e,c=a-r;l/=i,c/=o;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]},ea=function(e,r,n,a,i,o,l){return e-=i,r-=o,e/=n/2+l,r/=a/2+l,e*e+r*r<=1},to=function(e,r,n,a,i,o,l){var c=[n-e,a-r],u=[e-i,r-o],d=c[0]*c[0]+c[1]*c[1],f=2*(u[0]*c[0]+u[1]*c[1]),h=u[0]*u[0]+u[1]*u[1]-l*l,v=f*f-4*d*h;if(v<0)return[];var p=(-f+Math.sqrt(v))/(2*d),g=(-f-Math.sqrt(v))/(2*d),y=Math.min(p,g),m=Math.max(p,g),b=[];if(y>=0&&y<=1&&b.push(y),m>=0&&m<=1&&b.push(m),b.length===0)return[];var w=b[0]*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,k=b[1]*c[1]+r;return[w,C,x,k]}else return[w,C]},Gu=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Cn=function(e,r,n,a,i,o,l,c,u){var d=e-i,f=n-e,h=l-i,v=r-o,p=a-r,g=c-o,y=h*v-g*d,m=f*v-p*d,b=g*f-h*p;if(b!==0){var w=y/b,C=m/b,x=.001,k=0-x,E=1+x;return k<=w&&w<=E&&k<=C&&C<=E?[e+w*f,r+w*p]:u?[e+w*f,r+w*p]:[]}else return y===0||m===0?Gu(e,n,l)===l?[l,c]:Gu(e,n,i)===i?[i,o]:Gu(i,l,n)===n?[n,a]:[]:[]},ro=function(e,r,n,a,i,o,l,c){var u=[],d,f=new Array(n.length),h=!0;o==null&&(h=!1);var v;if(h){for(var p=0;p<f.length/2;p++)f[p*2]=n[p*2]*o+a,f[p*2+1]=n[p*2+1]*l+i;if(c>0){var g=ks(f,-c);v=xs(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=Cn(e,r,a,i,y,m,b,w),d.length!==0&&u.push(d[0],d[1]);return u},D5=function(e,r,n,a,i,o,l,c,u){var d=[],f,h=new Array(n.length*2);u.forEach(function(b,w){w===0?(h[h.length-2]=b.startX,h[h.length-1]=b.startY):(h[w*4-2]=b.startX,h[w*4-1]=b.startY),h[w*4]=b.stopX,h[w*4+1]=b.stopY,f=to(e,r,a,i,b.cx,b.cy,b.radius),f.length!==0&&d.push(f[0],f[1])});for(var v=0;v<h.length/4;v++)f=Cn(e,r,a,i,h[v*4],h[v*4+1],h[v*4+2],h[v*4+3],!1),f.length!==0&&d.push(f[0],f[1]);if(d.length>2){for(var p=[d[0],d[1]],g=Math.pow(p[0]-e,2)+Math.pow(p[1]-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&&(p[0]=d[y*2],p[1]=d[y*2+1],g=m)}return p}return d},Ss=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]),o=(i-n)/i;return o<0&&(o=1e-5),[r[0]+o*a[0],r[1]+o*a[1]]},Vt=function(e,r){var n=Uu(e,r);return n=ib(n),n},ib=function(e){for(var r,n,a=e.length/2,i=1/0,o=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),o=Math.min(o,n),c=Math.max(c,n);for(var d=2/(l-i),f=2/(c-o),h=0;h<a;h++)r=e[2*h]=e[2*h]*d,n=e[2*h+1]=e[2*h+1]*f,i=Math.min(i,r),l=Math.max(l,r),o=Math.min(o,n),c=Math.max(c,n);if(o<-1)for(var v=0;v<a;v++)n=e[2*v+1]=e[2*v+1]+(-1-o);return e},Uu=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),o,l=0;l<e;l++)o=l*n+a,i[2*l]=Math.cos(o),i[2*l+1]=Math.sin(-o);return i},ta=function(e,r){return Math.min(e/4,r/4,8)},ob=function(e,r){return Math.min(e/10,r/10,8)},ju=function(){return 8},P5=function(e,r,n){return[e-2*r+n,2*(r-e),e]},Wu=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},O5=St({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),A5={pageRank:function(e){for(var r=O5(e),n=r.dampingFactor,a=r.precision,i=r.iterations,o=r.weight,l=this._private.cy,c=this.byGroup(),u=c.nodes,d=c.edges,f=u.length,h=f*f,v=d.length,p=new Array(h),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;p[w]=0}g[m]=0}for(var C=0;C<v;C++){var x=d[C],k=x.data("source"),E=x.data("target");if(k!==E){var _=u.indexOfId(k),S=u.indexOfId(E),T=o(x),N=S*f+_;p[N]+=T,g[_]+=T}}for(var B=1/f+y,P=0;P<f;P++)if(g[P]===0)for(var D=0;D<f;D++){var R=D*f+P;p[R]=B}else for(var O=0;O<f;O++){var F=O*f+P;p[F]=p[F]/g[P]+y}for(var A=new Array(f),z=new Array(f),j,H=0;H<f;H++)A[H]=1;for(var G=0;G<i;G++){for(var X=0;X<f;X++)z[X]=0;for(var M=0;M<f;M++)for(var V=0;V<f;V++){var q=M*f+V;z[M]+=p[q]*A[V]}g5(z),j=A,A=z,z=j;for(var $=0,K=0;K<f;K++){var L=j[K]-A[K];$+=L*L}if($<a)break}var W={rank:function(se){return se=l.collection(se)[0],A[u.indexOf(se)]}};return W}},sb=St({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Ha={degreeCentralityNormalized:function(e){e=sb(e);var r=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var d={},f={},h=0,v=0,p=0;p<a;p++){var g=n[p],y=g.id();e.root=g;var m=this.degreeCentrality(e);h<m.indegree&&(h=m.indegree),v<m.outdegree&&(v=m.outdegree),d[y]=m.indegree,f[y]=m.outdegree}return{indegree:function(w){return h==0?0:(Ee(w)&&(w=r.filter(w)),d[w.id()]/h)},outdegree:function(w){return v===0?0:(Ee(w)&&(w=r.filter(w)),f[w.id()]/v)}}}else{for(var i={},o=0,l=0;l<a;l++){var c=n[l];e.root=c;var u=this.degreeCentrality(e);o<u.degree&&(o=u.degree),i[c.id()]=u.degree}return{degree:function(w){return o===0?0:(Ee(w)&&(w=r.filter(w)),i[w.id()]/o)}}}},degreeCentrality:function(e){e=sb(e);var r=this.cy(),n=this,a=e,i=a.root,o=a.weight,l=a.directed,c=a.alpha;if(i=r.collection(i)[0],l){for(var v=i.connectedEdges(),p=v.filter(function(k){return k.target().same(i)&&n.has(k)}),g=v.filter(function(k){return k.source().same(i)&&n.has(k)}),y=p.length,m=g.length,b=0,w=0,C=0;C<p.length;C++)b+=o(p[C]);for(var x=0;x<g.length;x++)w+=o(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,h=0;h<u.length;h++)f+=o(u[h]);return{degree:Math.pow(d,1-c)*Math.pow(f,c)}}}};Ha.dc=Ha.degreeCentrality,Ha.dcn=Ha.degreeCentralityNormalised=Ha.degreeCentralityNormalized;var lb=St({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Ka={closenessCentralityNormalized:function(e){for(var r=lb(e),n=r.harmonic,a=r.weight,i=r.directed,o=this.cy(),l={},c=0,u=this.nodes(),d=this.floydWarshall({weight:a,directed:i}),f=0;f<u.length;f++){for(var h=0,v=u[f],p=0;p<u.length;p++)if(f!==p){var g=d.distance(v,u[p]);n?h+=1/g:h+=g}n||(h=1/h),c<h&&(c=h),l[v.id()]=h}return{closeness:function(m){return c==0?0:(Ee(m)?m=o.filter(m)[0].id():m=m.id(),l[m]/c)}}},closenessCentrality:function(e){var r=lb(e),n=r.root,a=r.weight,i=r.directed,o=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 h=l.distanceTo(f);o?c+=1/h:c+=h}}return o?c:1/c}};Ka.cc=Ka.closenessCentrality,Ka.ccn=Ka.closenessCentralityNormalised=Ka.closenessCentralityNormalized;var R5=St({weight:null,directed:!1}),Yu={betweennessCentrality:function(e){for(var r=R5(e),n=r.directed,a=r.weight,i=a!=null,o=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]}},h=0;h<l.length;h++){var v=l[h],p=v.id();n?c[p]=v.outgoers().nodes():c[p]=v.openNeighborhood().nodes(),f.set(p,0)}for(var g=function(w){for(var C=l[w].id(),x=[],k={},E={},_={},S=new Qi(function(V,q){return _[V]-_[q]}),T=0;T<l.length;T++){var N=l[T].id();k[N]=[],E[N]=0,_[N]=1/0}for(E[C]=1,_[C]=0,S.push(C);!S.empty();){var B=S.pop();if(x.push(B),i)for(var P=0;P<c[B].length;P++){var D=c[B][P],R=o.getElementById(B),O=void 0;R.edgesTo(D).length>0?O=R.edgesTo(D)[0]:O=D.edgesTo(R)[0];var F=a(O);D=D.id(),_[D]>_[B]+F&&(_[D]=_[B]+F,S.nodes.indexOf(D)<0?S.push(D):S.updateItem(D),E[D]=0,k[D]=[]),_[D]==_[B]+F&&(E[D]=E[D]+E[B],k[D].push(B))}else for(var A=0;A<c[B].length;A++){var z=c[B][A].id();_[z]==1/0&&(S.push(z),_[z]=_[B]+1),_[z]==_[B]+1&&(E[z]=E[z]+E[B],k[z].push(B))}}for(var j={},H=0;H<l.length;H++)j[l[H].id()]=0;for(;x.length>0;){for(var G=x.pop(),X=0;X<k[G].length;X++){var M=k[G][X];j[M]=j[M]+E[M]/E[G]*(1+j[G])}G!=l[w].id()&&f.set(G,f.get(G)+j[G])}},y=0;y<l.length;y++)g(y);var m={betweenness:function(w){var C=o.collection(w).id();return f.get(C)},betweennessNormalized:function(w){if(d==0)return 0;var C=o.collection(w).id();return f.get(C)/d}};return m.betweennessNormalised=m.betweennessNormalized,m}};Yu.bc=Yu.betweennessCentrality;var L5=St({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),F5=function(e){return L5(e)},M5=function(e,r){for(var n=0,a=0;a<r.length;a++)n+=r[a](e);return n},$5=function(e,r,n){for(var a=0;a<r;a++)e[a*r+a]=n},ub=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 o=0;o<r;o++)e[o*r+a]=e[o*r+a]/n}},V5=function(e,r,n){for(var a=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)a[i*n+o]=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},q5=function(e,r,n){for(var a=e.slice(0),i=1;i<n;i++)e=V5(e,a,r);return e},z5=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 ub(a,r),a},H5=function(e,r,n,a){for(var i=0;i<n;i++){var o=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(o!==l)return!1}return!0},K5=function(e,r,n,a){for(var i=[],o=0;o<r;o++){for(var l=[],c=0;c<r;c++)Math.round(e[o*r+c]*1e3)/1e3>0&&l.push(n[c]);l.length!==0&&i.push(a.collection(l))}return i},G5=function(e,r){for(var n=0;n<e.length;n++)if(!r[n]||e[n].id()!==r[n].id())return!1;return!0},U5=function(e){for(var r=0;r<e.length;r++)for(var n=0;n<e.length;n++)r!=n&&G5(e[r],e[n])&&e.splice(n,1);return e},cb=function(e){for(var r=this.nodes(),n=this.edges(),a=this.cy(),i=F5(e),o={},l=0;l<r.length;l++)o[r[l].id()]=l;for(var c=r.length,u=c*c,d=new Array(u),f,h=0;h<u;h++)d[h]=0;for(var v=0;v<n.length;v++){var p=n[v],g=o[p.source().id()],y=o[p.target().id()],m=M5(p,i.attributes);d[g*c+y]+=m,d[y*c+g]+=m}$5(d,c,i.multFactor),ub(d,c);for(var b=!0,w=0;b&&w<i.maxIterations;)b=!1,f=q5(d,c,i.expandFactor),d=z5(f,c,i.inflateFactor),H5(d,f,u,4)||(b=!0),w++;var C=K5(d,c,r,a);return C=U5(C),C},j5={markovClustering:cb,mcl:cb},W5=function(e){return e},db=function(e,r){return Math.abs(r-e)},fb=function(e,r,n){return e+db(r,n)},hb=function(e,r,n){return e+Math.pow(n-r,2)},Y5=function(e){return Math.sqrt(e)},Z5=function(e,r,n){return Math.max(e,db(r,n))},no=function(e,r,n,a,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:W5,l=a,c,u,d=0;d<e;d++)c=r(d),u=n(d),l=i(l,c,u);return o(l)},Ga={euclidean:function(e,r,n){return e>=2?no(e,r,n,0,hb,Y5):no(e,r,n,0,fb)},squaredEuclidean:function(e,r,n){return no(e,r,n,0,hb)},manhattan:function(e,r,n){return no(e,r,n,0,fb)},max:function(e,r,n){return no(e,r,n,-1/0,Z5)}};Ga["squared-euclidean"]=Ga.squaredEuclidean,Ga.squaredeuclidean=Ga.squaredEuclidean;function _s(t,e,r,n,a,i){var o;return Xe(t)?o=t:o=Ga[t]||Ga.euclidean,e===0&&Xe(t)?o(a,i):o(e,r,n,a,i)}var X5=St({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Zu=function(e){return X5(e)},Ts=function(e,r,n,a,i){var o=i!=="kMedoids",l=o?function(f){return n[f]}:function(f){return a[f](n)},c=function(h){return a[h](r)},u=n,d=r;return _s(e,a.length,l,c,u,d)},Xu=function(e,r,n){for(var a=n.length,i=new Array(a),o=new Array(a),l=new Array(r),c=null,u=0;u<a;u++)i[u]=e.min(n[u]).value,o[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()*(o[f]-i[f])+i[f];l[d]=c}return l},pb=function(e,r,n,a,i){for(var o=1/0,l=0,c=0;c<r.length;c++){var u=Ts(n,e,r[c],a,i);u<o&&(o=u,l=c)}return l},vb=function(e,r,n){for(var a=[],i=null,o=0;o<r.length;o++)i=r[o],n[i.id()]===e&&a.push(i);return a},J5=function(e,r,n){return Math.abs(r-e)<=n},Q5=function(e,r,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var o=Math.abs(e[a][i]-r[a][i]);if(o>n)return!1}return!0},e$=function(e,r,n){for(var a=0;a<n;a++)if(e===r[a])return!0;return!1},gb=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)];e$(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var o=0;o<r;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},mb=function(e,r,n){for(var a=0,i=0;i<r.length;i++)a+=Ts("manhattan",r[i],e,n,"kMedoids");return a},t$=function(e){var r=this.cy(),n=this.nodes(),a=null,i=Zu(e),o=new Array(i.k),l={},c;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,c=Xu(n,i.k,i.attributes)):ht(i.testCentroids)==="object"?c=i.testCentroids:c=Xu(n,i.k,i.attributes):c=Xu(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()]=pb(a,c,i.distance,i.attributes,"kMeans");u=!1;for(var h=0;h<i.k;h++){var v=vb(h,n,l);if(v.length!==0){for(var p=i.attributes.length,g=c[h],y=new Array(p),m=new Array(p),b=0;b<p;b++){m[b]=0;for(var w=0;w<v.length;w++)a=v[w],m[b]+=i.attributes[b](a);y[b]=m[b]/v.length,J5(y[b],g[b],i.sensitivityThreshold)||(u=!0)}c[h]=y,o[h]=r.collection(v)}}d++}return o},r$=function(e){var r=this.cy(),n=this.nodes(),a=null,i=Zu(e),o=new Array(i.k),l,c={},u,d=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(ht(i.testCentroids)==="object"?l=i.testCentroids:l=gb(n,i.k)):l=gb(n,i.k);for(var f=!0,h=0;f&&h<i.maxIterations;){for(var v=0;v<n.length;v++)a=n[v],c[a.id()]=pb(a,l,i.distance,i.attributes,"kMedoids");f=!1;for(var p=0;p<l.length;p++){var g=vb(p,n,c);if(g.length!==0){d[p]=mb(l[p],g,i.attributes);for(var y=0;y<g.length;y++)u=mb(g[y],g,i.attributes),u<d[p]&&(d[p]=u,l[p]=g[y],f=!0);o[p]=r.collection(g)}}h++}return o},n$=function(e,r,n,a,i){for(var o,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++){o=0,l=0;for(var h=0;h<r.length;h++)o+=a[h][d]*i.attributes[f](r[h]),l+=a[h][d];e[d][f]=o/l}},a$=function(e,r,n,a,i){for(var o=0;o<e.length;o++)r[o]=e[o].slice();for(var l,c,u,d=2/(i.m-1),f=0;f<n.length;f++)for(var h=0;h<a.length;h++){l=0;for(var v=0;v<n.length;v++)c=Ts(i.distance,a[h],n[f],i.attributes,"cmeans"),u=Ts(i.distance,a[h],n[v],i.attributes,"cmeans"),l+=Math.pow(c/u,d);e[h][f]=1/l}},i$=function(e,r,n,a){for(var i=new Array(n.k),o=0;o<i.length;o++)i[o]=[];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},yb=function(e){var r=this.cy(),n=this.nodes(),a=Zu(e),i,o,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 h=0;h<n.length;h++){for(var v=0,p=0;p<a.k;p++)l[h][p]=Math.random(),v+=l[h][p];for(var g=0;g<a.k;g++)l[h][g]=l[h][g]/v}o=new Array(a.k);for(var y=0;y<a.k;y++)o[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,n$(o,n,l,u,a),a$(l,c,o,n,a),Q5(l,c,a.sensitivityThreshold)||(b=!0),w++;return i=i$(n,l,a,r),{clusters:i,degreeOfMembership:l}},o$={kMeans:t$,kMedoids:r$,fuzzyCMeans:yb,fcm:yb},s$=St({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),l$={single:"min",complete:"max"},u$=function(e){var r=s$(e),n=l$[r.linkage];return n!=null&&(r.linkage=n),r},bb=function(e,r,n,a,i){for(var o=0,l=1/0,c,u=i.attributes,d=function(S,T){return _s(i.distance,u.length,function(N){return u[N](S)},function(N){return u[N](T)},S,T)},f=0;f<e.length;f++){var h=e[f].key,v=n[h][a[h]];v<l&&(o=h,l=v)}if(i.mode==="threshold"&&l>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var p=r[o],g=r[a[o]],y;i.mode==="dendrogram"?y={left:p,right:g,key:p.key}:y={value:p.value.concat(g.value),key:p.key},e[p.index]=y,e.splice(g.index,1),r[p.key]=y;for(var m=0;m<e.length;m++){var b=e[m];p.key===b.key?c=1/0:i.linkage==="min"?(c=n[p.key][b.key],n[p.key][b.key]>n[g.key][b.key]&&(c=n[g.key][b.key])):i.linkage==="max"?(c=n[p.key][b.key],n[p.key][b.key]<n[g.key][b.key]&&(c=n[g.key][b.key])):i.linkage==="mean"?c=(n[p.key][b.key]*p.size+n[g.key][b.key]*g.size)/(p.size+g.size):i.mode==="dendrogram"?c=d(b.value,p.value):c=d(b.value[0],p.value[0]),n[p.key][b.key]=n[b.key][p.key]=c}for(var w=0;w<e.length;w++){var C=e[w].key;if(a[C]===p.key||a[C]===g.key){for(var x=C,k=0;k<e.length;k++){var E=e[k].key;n[C][E]<n[C][x]&&(x=E)}a[C]=x}e[w].index=w}return p.key=g.key=p.index=g.index=null,!0},Ns=function t(e,r,n){e&&(e.value?r.push(e.value):(e.left&&t(e.left,r),e.right&&t(e.right,r)))},c$=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()},d$=function t(e,r,n){if(!e)return[];var a=[],i=[],o=[];return r===0?(e.left&&Ns(e.left,a),e.right&&Ns(e.right,i),o=a.concat(i),[n.collection(o)]):r===1?e.value?[n.collection(e.value)]:(e.left&&Ns(e.left,a),e.right&&Ns(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))},wb=function(e){for(var r=this.cy(),n=this.nodes(),a=u$(e),i=a.attributes,o=function(w,C){return _s(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 h={value:a.mode==="dendrogram"?n[f]:[n[f]],key:f,index:f};l[f]=h,d[f]=h,c[f]=[],u[f]=0}for(var v=0;v<l.length;v++)for(var p=0;p<=v;p++){var g=void 0;a.mode==="dendrogram"?g=v===p?1/0:o(l[v].value,l[p].value):g=v===p?1/0:o(l[v].value[0],l[p].value[0]),c[v][p]=g,c[p][v]=g,g<c[v][u[v]]&&(u[v]=p)}for(var y=bb(l,d,c,u,a);y;)y=bb(l,d,c,u,a);var m;return a.mode==="dendrogram"?(m=d$(l[0],a.dendrogramDepth,r),a.addDendrogram&&c$(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},f$={hierarchicalClustering:wb,hca:wb},h$=St({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),p$=function(e){var r=e.damping,n=e.preference;.5<=r&&r<1||Je("Damping must range on [0.5, 1). Got: ".concat(r));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||de(n)||Je("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),h$(e)},v$=function(e,r,n,a){var i=function(l,c){return a[c](l)};return-_s(e,a.length,function(o){return i(r,o)},function(o){return i(n,o)},r,n)},g$=function(e,r){var n=null;return r==="median"?n=p5(e):r==="mean"?n=h5(e):r==="min"?n=d5(e):r==="max"?n=f5(e):n=r,n},m$=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},Cb=function(e,r,n){for(var a=[],i=0;i<e;i++){for(var o=-1,l=-1/0,c=0;c<n.length;c++){var u=n[c];r[i*e+u]>l&&(o=u,l=r[i*e+u])}o>0&&a.push(o)}for(var d=0;d<n.length;d++)a[n[d]]=n[d];return a},y$=function(e,r,n){for(var a=Cb(e,r,n),i=0;i<n.length;i++){for(var o=[],l=0;l<a.length;l++)a[l]===n[i]&&o.push(l);for(var c=-1,u=-1/0,d=0;d<o.length;d++){for(var f=0,h=0;h<o.length;h++)f+=r[o[h]*e+o[d]];f>u&&(c=d,u=f)}n[i]=o[c]}return a=Cb(e,r,n),a},Eb=function(e){for(var r=this.cy(),n=this.nodes(),a=p$(e),i={},o=0;o<n.length;o++)i[n[o].id()]=o;var l,c,u,d,f,h;l=n.length,c=l*l,u=new Array(c);for(var v=0;v<c;v++)u[v]=-1/0;for(var p=0;p<l;p++)for(var g=0;g<l;g++)p!==g&&(u[p*l+g]=v$(a.distance,n[p],n[g],a.attributes));d=g$(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;h=new Array(c);for(var b=0;b<c;b++)h[b]=0;for(var w=new Array(l),C=new Array(l),x=new Array(l),k=0;k<l;k++)w[k]=0,C[k]=0,x[k]=0;for(var E=new Array(l*a.minIterations),_=0;_<E.length;_++)E[_]=0;var S;for(S=0;S<a.maxIterations;S++){for(var T=0;T<l;T++){for(var N=-1/0,B=-1/0,P=-1,D=0,R=0;R<l;R++)w[R]=f[T*l+R],D=h[T*l+R]+u[T*l+R],D>=N?(B=N,N=D,P=R):D>B&&(B=D);for(var O=0;O<l;O++)f[T*l+O]=(1-a.damping)*(u[T*l+O]-N)+a.damping*w[O];f[T*l+P]=(1-a.damping)*(u[T*l+P]-B)+a.damping*w[P]}for(var F=0;F<l;F++){for(var A=0,z=0;z<l;z++)w[z]=h[z*l+F],C[z]=Math.max(0,f[z*l+F]),A+=C[z];A-=C[F],C[F]=f[F*l+F],A+=C[F];for(var j=0;j<l;j++)h[j*l+F]=(1-a.damping)*Math.min(0,A-C[j])+a.damping*w[j];h[F*l+F]=(1-a.damping)*(A-C[F])+a.damping*w[F]}for(var H=0,G=0;G<l;G++){var X=h[G*l+G]+f[G*l+G]>0?1:0;E[S%a.minIterations*l+G]=X,H+=X}if(H>0&&(S>=a.minIterations-1||S==a.maxIterations-1)){for(var M=0,V=0;V<l;V++){x[V]=0;for(var q=0;q<a.minIterations;q++)x[V]+=E[q*l+V];(x[V]===0||x[V]===a.minIterations)&&M++}if(M===l)break}}for(var $=m$(l,f,h),K=y$(l,u,$),L={},W=0;W<$.length;W++)L[$[W]]=[];for(var Y=0;Y<n.length;Y++){var se=i[n[Y].id()],ue=K[se];ue!=null&&L[ue].push(n[Y])}for(var ae=new Array($.length),ne=0;ne<$.length;ne++)ae[ne]=r.collection(L[$[ne]]);return ae},b$={affinityPropagation:Eb,ap:Eb},w$=St({root:void 0,directed:!1}),C$={hierholzer:function(e){if(!Ae(e)){var r=arguments;e={root:r[0],directed:r[1]}}var n=w$(e),a=n.root,i=n.directed,o=this,l=!1,c,u,d;a&&(d=Ee(a)?this.filter(a)[0].id():a[0].id());var f={},h={};i?o.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.indegree(!0),x=b.outdegree(!0),k=C-x,E=x-C;k==1?c?l=!0:c=w:E==1?u?l=!0:u=w:(E>1||k>1)&&(l=!0),f[w]=[],b.outgoers().forEach(function(_){_.isEdge()&&f[w].push(_.id())})}else h[w]=[void 0,b.target().id()]}):o.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 h[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=o[0].id());var p=function(w){for(var C=w,x=[w],k,E,_;f[C].length;)k=f[C].shift(),E=h[k][0],_=h[k][1],C!=_?(f[_]=f[_].filter(function(S){return S!=k}),C=_):!i&&C!=E&&(f[E]=f[E].filter(function(S){return S!=k}),C=E),x.unshift(k),x.unshift(C);return x},g=[],y=[];for(y=p(d);y.length!=1;)f[y[0]].length==0?(g.unshift(o.getElementById(y.shift())),g.unshift(o.getElementById(y.shift()))):y=p(y.shift()).concat(y);g.unshift(o.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}},Is=function(){var e=this,r={},n=0,a=0,i=[],o=[],l={},c=function(h,v){for(var p=o.length-1,g=[],y=e.spawn();o[p].x!=h||o[p].y!=v;)g.push(o.pop().edge),p--;g.push(o.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(k){return k.isLoop()})):y.merge(x)})}),i.push(y)},u=function f(h,v,p){h===p&&(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!==p&&(w=C.id(),l[w]||(l[w]=!0,o.push({x:v,y:b,edge:C})),b in r?r[v].low=Math.min(r[v].low,r[b].id):(f(h,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 h=f.id();h in r||(a=0,u(h,h),r[h].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}},E$={hopcroftTarjanBiconnected:Is,htbc:Is,htb:Is,hopcroftTarjanBiconnectedComponents:Is},Bs=function(){var e=this,r={},n=0,a=[],i=[],o=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 h=i.pop();if(f.merge(e.getElementById(h)),r[h].low=r[u].index,r[h].explored=!0,h===u)break}var v=f.edgesWith(f),p=f.merge(v);a.push(p),o=o.difference(p)}};return e.forEach(function(c){if(c.isNode()){var u=c.id();u in r||l(u)}}),{cut:o,components:a}},x$={tarjanStronglyConnected:Bs,tsc:Bs,tscc:Bs,tarjanStronglyConnectedComponents:Bs},xb={};[Ji,QM,e5,r5,a5,o5,u5,A5,Ha,Ka,Yu,j5,o$,f$,b$,C$,E$,x$].forEach(function(t){Se(xb,t)});/*!
32
32
  Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
33
33
  Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
34
34
  Licensed under The MIT License (http://opensource.org/licenses/MIT)
35
- */var mb=0,yb=1,bb=2,Zr=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=mb,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))};Zr.prototype={fulfill:function(e){return wb(this,yb,"fulfillValue",e)},reject:function(e){return wb(this,bb,"rejectReason",e)},then:function(e,r){var n=this,a=new Zr;return n.onFulfilled.push(xb(e,a,"fulfill")),n.onRejected.push(xb(r,a,"reject")),Cb(n),a.proxy}};var wb=function(e,r,n,a){return e.state===mb&&(e.state=r,e[n]=a,Cb(e)),e},Cb=function(e){e.state===yb?Eb(e,"onFulfilled",e.fulfillValue):e.state===bb&&Eb(e,"onRejected",e.rejectReason)},Eb=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)}},xb=function(e,r,n){return function(a){if(typeof e!="function")r[n].call(r,a);else{var i;try{i=e(a)}catch(o){r.reject(o);return}p$(r,i)}}},p$=function t(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(ct(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)};Zr.all=function(t){return new Zr(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)},o=0;o<t.length;o++)(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)}})(o)})},Zr.resolve=function(t){return new Zr(function(e,r){e(t)})},Zr.reject=function(t){return new Zr(function(e,r){r(t)})};var Ha=typeof Promise<"u"?Promise:Zr,Zu=function(e,r,n){var a=Pu(e),i=!a,o=this._private=Se({duration:1e3},r,n);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&Xe(o.complete)&&o.completes.push(o.complete),i){var l=e.position();o.startPosition=o.startPosition||{x:l.x,y:l.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(a){var c=e.pan();o.startPan={x:c.x,y:c.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},ra=Zu.prototype;Se(ra,{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),Zt(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],o=i.name,l=e.startStyle[o];e.startStyle[o]=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 Ha(function(a,i){n.push(function(){a()})})}}),ra.complete=ra.completed,ra.run=ra.play,ra.running=ra.playing;var v$={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 o=a[0];if(o)return o._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 o=0;o<a.length;o++){var l=a[o];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,o=i?a:[a],l=this._private.cy||this,c=!i,u=!c;if(!l.styleEnabled())return this;var d=l.style();r=Se({},r,n);var f=Object.keys(r).length===0;if(f)return new Zu(o[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 h=r.renderedPosition,v=l.pan(),p=l.zoom();r.position=U0(h,p,v)}if(c&&r.panBy!=null){var g=r.panBy,m=l.pan();r.pan={x:m.x+g.x,y:m.y+g.y}}var y=r.center||r.centre;if(c&&y!=null){var b=l.getCenterPan(y.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&&Ae(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 Zu(o[0],r)}},animate:function(){return function(r,n){var a=this,i=a.length!==void 0,o=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;n&&(r=Se({},r,n));for(var c=0;c<o.length;c++){var u=o[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,o=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;for(var c=0;c<o.length;c++){for(var u=o[c],d=u._private,f=d.animation.current,h=0;h<f.length;h++){var v=f[h],p=v._private;n&&(p.duration=0)}r&&(d.animation.queue=[]),n||(d.animation.current=[])}return l.notify("draw"),this}}},g$=Array.isArray,Bs=g$,m$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,y$=/^\w*$/;function b$(t,e){if(Bs(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Ui(t)?!0:y$.test(t)||!m$.test(t)||e!=null&&t in Object(e)}var w$=b$,C$="[object AsyncFunction]",E$="[object Function]",x$="[object GeneratorFunction]",k$="[object Proxy]";function S$(t){if(!Zn(t))return!1;var e=O0(t);return e==E$||e==x$||e==C$||e==k$}var _$=S$,T$=fs["__core-js_shared__"],Xu=T$,kb=function(){var t=/[^.]+$/.exec(Xu&&Xu.keys&&Xu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function N$(t){return!!kb&&kb in t}var I$=N$,B$=Function.prototype,D$=B$.toString;function O$(t){if(t!=null){try{return D$.call(t)}catch{}try{return t+""}catch{}}return""}var P$=O$,A$=/[\\^$.*+?()[\]{}|]/g,R$=/^\[object .+?Constructor\]$/,L$=Function.prototype,M$=Object.prototype,F$=L$.toString,$$=M$.hasOwnProperty,V$=RegExp("^"+F$.call($$).replace(A$,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function q$(t){if(!Zn(t)||I$(t))return!1;var e=_$(t)?V$:R$;return e.test(P$(t))}var z$=q$;function H$(t,e){return t==null?void 0:t[e]}var K$=H$;function G$(t,e){var r=K$(t,e);return z$(r)?r:void 0}var Ju=G$,U$=Ju(Object,"create"),ro=U$;function j$(){this.__data__=ro?ro(null):{},this.size=0}var W$=j$;function Y$(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Z$=Y$,X$="__lodash_hash_undefined__",J$=Object.prototype,Q$=J$.hasOwnProperty;function eV(t){var e=this.__data__;if(ro){var r=e[t];return r===X$?void 0:r}return Q$.call(e,t)?e[t]:void 0}var tV=eV,rV=Object.prototype,nV=rV.hasOwnProperty;function aV(t){var e=this.__data__;return ro?e[t]!==void 0:nV.call(e,t)}var iV=aV,oV="__lodash_hash_undefined__";function sV(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ro&&e===void 0?oV:e,this}var lV=sV;function Ka(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])}}Ka.prototype.clear=W$,Ka.prototype.delete=Z$,Ka.prototype.get=tV,Ka.prototype.has=iV,Ka.prototype.set=lV;var Sb=Ka;function uV(){this.__data__=[],this.size=0}var cV=uV;function dV(t,e){return t===e||t!==t&&e!==e}var _b=dV;function fV(t,e){for(var r=t.length;r--;)if(_b(t[r][0],e))return r;return-1}var Ds=fV,hV=Array.prototype,pV=hV.splice;function vV(t){var e=this.__data__,r=Ds(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():pV.call(e,r,1),--this.size,!0}var gV=vV;function mV(t){var e=this.__data__,r=Ds(e,t);return r<0?void 0:e[r][1]}var yV=mV;function bV(t){return Ds(this.__data__,t)>-1}var wV=bV;function CV(t,e){var r=this.__data__,n=Ds(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var EV=CV;function Ga(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])}}Ga.prototype.clear=cV,Ga.prototype.delete=gV,Ga.prototype.get=yV,Ga.prototype.has=wV,Ga.prototype.set=EV;var xV=Ga,kV=Ju(fs,"Map"),SV=kV;function _V(){this.size=0,this.__data__={hash:new Sb,map:new(SV||xV),string:new Sb}}var TV=_V;function NV(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var IV=NV;function BV(t,e){var r=t.__data__;return IV(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Os=BV;function DV(t){var e=Os(this,t).delete(t);return this.size-=e?1:0,e}var OV=DV;function PV(t){return Os(this,t).get(t)}var AV=PV;function RV(t){return Os(this,t).has(t)}var LV=RV;function MV(t,e){var r=Os(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var FV=MV;function Ua(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])}}Ua.prototype.clear=TV,Ua.prototype.delete=OV,Ua.prototype.get=AV,Ua.prototype.has=LV,Ua.prototype.set=FV;var Tb=Ua,$V="Expected a function";function Qu(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError($V);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 o=t.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(Qu.Cache||Tb),r}Qu.Cache=Tb;var VV=Qu,qV=500;function zV(t){var e=VV(t,function(n){return r.size===qV&&r.clear(),n}),r=e.cache;return e}var HV=zV,KV=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,GV=/\\(\\)?/g,UV=HV(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(KV,function(r,n,a,i){e.push(a?i.replace(GV,"$1"):n||r)}),e}),Nb=UV;function jV(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 Ib=jV,WV=1/0,Bb=Aa?Aa.prototype:void 0,Db=Bb?Bb.toString:void 0;function Ob(t){if(typeof t=="string")return t;if(Bs(t))return Ib(t,Ob)+"";if(Ui(t))return Db?Db.call(t):"";var e=t+"";return e=="0"&&1/t==-WV?"-0":e}var YV=Ob;function ZV(t){return t==null?"":YV(t)}var Pb=ZV;function XV(t,e){return Bs(t)?t:w$(t,e)?[t]:Nb(Pb(t))}var Ab=XV,JV=1/0;function QV(t){if(typeof t=="string"||Ui(t))return t;var e=t+"";return e=="0"&&1/t==-JV?"-0":e}var ec=QV;function eq(t,e){e=Ab(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[ec(e[r++])];return r&&r==n?t:void 0}var tq=eq;function rq(t,e,r){var n=t==null?void 0:tq(t,e);return n===void 0?r:n}var nq=rq,aq=function(){try{var t=Ju(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Rb=aq;function iq(t,e,r){e=="__proto__"&&Rb?Rb(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var oq=iq,sq=Object.prototype,lq=sq.hasOwnProperty;function uq(t,e,r){var n=t[e];(!(lq.call(t,e)&&_b(n,r))||r===void 0&&!(e in t))&&oq(t,e,r)}var cq=uq,dq=9007199254740991,fq=/^(?:0|[1-9]\d*)$/;function hq(t,e){var r=typeof t;return e=e??dq,!!e&&(r=="number"||r!="symbol"&&fq.test(t))&&t>-1&&t%1==0&&t<e}var pq=hq;function vq(t,e,r,n){if(!Zn(t))return t;e=Ab(e,t);for(var a=-1,i=e.length,o=i-1,l=t;l!=null&&++a<i;){var c=ec(e[a]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(a!=o){var d=l[c];u=n?n(d,c,l):void 0,u===void 0&&(u=Zn(d)?d:pq(e[a+1])?[]:{})}cq(l,c,u),l=l[c]}return t}var gq=vq;function mq(t,e,r){return t==null?t:gq(t,e,r)}var yq=mq;function bq(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var wq=bq;function Cq(t){return Bs(t)?Ib(t,ec):Ui(t)?[t]:wq(Nb(Pb(t)))}var Eq=Cq,xq={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=Se({},r,e),function(a,i){var o=e,l=this,c=l.length!==void 0,u=c?l:[l],d=c?l[0]:l;if(Ee(a)){var f=a.indexOf(".")!==-1,h=f&&Eq(a);if(o.allowGetting&&i===void 0){var v;return d&&(o.beforeGet(d),h&&d._private[o.field][a]===void 0?v=nq(d._private[o.field],h):v=d._private[o.field][a]),v}else if(o.allowSetting&&i!==void 0){var p=!o.immutableKeys[a];if(p){var g=m0({},a,i);o.beforeSet(l,g);for(var m=0,y=u.length;m<y;m++){var b=u[m];o.canSet(b)&&(h&&d._private[o.field][a]===void 0?yq(b._private[o.field],h,i):b._private[o.field][a]=i)}o.updateStyle&&l.updateStyle(),o.onSet(l),o.settingTriggersEvent&&l[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&Ae(a)){var w=a,C,x,k=Object.keys(w);o.beforeSet(l,w);for(var E=0;E<k.length;E++){C=k[E],x=w[C];var _=!o.immutableKeys[C];if(_)for(var S=0;S<u.length;S++){var T=u[S];o.canSet(T)&&(T._private[o.field][C]=x)}}o.updateStyle&&l.updateStyle(),o.onSet(l),o.settingTriggersEvent&&l[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&Xe(a)){var N=a;l.on(o.bindingEvent,N)}else if(o.allowGetting&&a===void 0){var B;return d&&(o.beforeGet(d),B=d._private[o.field]),B}return l}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Se({},r,e),function(a){var i=e,o=this,l=o.length!==void 0,c=l?o:[o];if(Ee(a)){for(var u=a.split(/\s+/),d=u.length,f=0;f<d;f++){var h=u[f];if(!mn(h)){var v=!i.immutableKeys[h];if(v)for(var p=0,g=c.length;p<g;p++)c[p]._private[i.field][h]=void 0}}i.triggerEvent&&o[i.triggerFnName](i.event)}else if(a===void 0){for(var m=0,y=c.length;m<y;m++)for(var b=c[m]._private[i.field],w=Object.keys(b),C=0;C<w.length;C++){var x=w[C],k=!i.immutableKeys[x];k&&(b[x]=void 0)}i.triggerEvent&&o[i.triggerFnName](i.event)}return o}}},kq={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,o=Array.prototype.slice.call(arguments,0);return new Ha(function(l,c){var u=function(v){i.off.apply(i,f),l(v)},d=o.concat([u]),f=d.concat([]);i.on.apply(i,d)})}}},Ve={};[v$,xq,kq].forEach(function(t){Se(Ve,t)});var Sq={animate:Ve.animate(),animation:Ve.animation(),animated:Ve.animated(),clearQueue:Ve.clearQueue(),delay:Ve.delay(),delayAnimation:Ve.delayAnimation(),stop:Ve.stop()},Ps={classes:function(e){var r=this;if(e===void 0){var n=[];return r[0]._private.classes.forEach(function(p){return n.push(p)}),n}else Ke(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new La(e),o=0;o<r.length;o++){for(var l=r[o],c=l._private,u=c.classes,d=!1,f=0;f<e.length;f++){var h=e[f],v=u.has(h);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=[],o=0,l=n.length;o<l;o++)for(var c=n[o],u=c._private.classes,d=!1,f=0;f<e.length;f++){var h=e[f],v=u.has(h),p=!1;r||a&&!v?(u.add(h),p=!0):(!r||a&&v)&&(u.delete(h),p=!0),!d&&p&&(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}};Ps.className=Ps.classNames=Ps.classes;var Re={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:ft,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Re.variable="(?:[\\w-.]|(?:\\\\"+Re.metaChar+"))+",Re.className="(?:[\\w-]|(?:\\\\"+Re.metaChar+"))+",Re.value=Re.string+"|"+Re.number,Re.id=Re.variable,function(){var t,e,r;for(t=Re.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],Re.comparatorOp+="|@"+e;for(t=Re.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(Re.comparatorOp+="|\\!"+e)}();var ze=function(){return{checks:[]}},ve={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},tc=[{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 MM(t.selector,e.selector)}),_q=function(){for(var t={},e,r=0;r<tc.length;r++)e=tc[r],t[e.selector]=e.matches;return t}(),Tq=function(e,r){return _q[e](r)},Nq="("+tc.map(function(t){return t.selector}).join("|")+")",ja=function(e){return e.replace(new RegExp("\\\\("+Re.metaChar+")","g"),function(r,n){return n})},En=function(e,r,n){e[e.length-1]=n},rc=[{name:"group",query:!0,regex:"("+Re.group+")",populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:Nq,populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Re.id+")",populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.ID,value:ja(i)})}},{name:"className",query:!0,regex:"\\.("+Re.className+")",populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.CLASS,value:ja(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Re.variable+")\\s*\\]",populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.DATA_EXIST,field:ja(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Re.variable+")\\s*("+Re.comparatorOp+")\\s*("+Re.value+")\\s*\\]",populate:function(e,r,n){var a=vr(n,3),i=a[0],o=a[1],l=a[2],c=new RegExp("^"+Re.string+"$").exec(l)!=null;c?l=l.substring(1,l.length-1):l=parseFloat(l),r.checks.push({type:ve.DATA_COMPARE,field:ja(i),operator:o,value:l})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Re.boolOp+")\\s*("+Re.variable+")\\s*\\]",populate:function(e,r,n){var a=vr(n,2),i=a[0],o=a[1];r.checks.push({type:ve.DATA_BOOL,field:ja(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Re.meta+")\\s*("+Re.comparatorOp+")\\s*("+Re.number+")\\s*\\]\\]",populate:function(e,r,n){var a=vr(n,3),i=a[0],o=a[1],l=a[2];r.checks.push({type:ve.META_COMPARE,field:ja(i),operator:o,value:parseFloat(l)})}},{name:"nextQuery",separator:!0,regex:Re.separator,populate:function(e,r){var n=e.currentSubject,a=e.edgeCount,i=e.compoundCount,o=e[e.length-1];n!=null&&(o.subject=n,e.currentSubject=null),o.edgeCount=a,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var l=e[e.length++]=ze();return l}},{name:"directedEdge",separator:!0,regex:Re.directedEdge,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=r,i=ze();return n.checks.push({type:ve.DIRECTED_EDGE,source:a,target:i}),En(e,r,n),e.edgeCount++,i}else{var o=ze(),l=r,c=ze();return o.checks.push({type:ve.NODE_SOURCE,source:l,target:c}),En(e,r,o),e.edgeCount++,c}}},{name:"undirectedEdge",separator:!0,regex:Re.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=r,i=ze();return n.checks.push({type:ve.UNDIRECTED_EDGE,nodes:[a,i]}),En(e,r,n),e.edgeCount++,i}else{var o=ze(),l=r,c=ze();return o.checks.push({type:ve.NODE_NEIGHBOR,node:l,neighbor:c}),En(e,r,o),c}}},{name:"child",separator:!0,regex:Re.child,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=ze(),i=e[e.length-1];return n.checks.push({type:ve.CHILD,parent:i,child:a}),En(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var o=ze(),l=e[e.length-1],c=ze(),u=ze(),d=ze(),f=ze();return o.checks.push({type:ve.COMPOUND_SPLIT,left:l,right:c,subject:u}),u.checks=r.checks,r.checks=[{type:ve.TRUE}],f.checks.push({type:ve.TRUE}),c.checks.push({type:ve.PARENT,parent:f,child:d}),En(e,l,o),e.currentSubject=u,e.compoundCount++,d}else{var h=ze(),v=ze(),p=[{type:ve.PARENT,parent:h,child:v}];return h.checks=r.checks,r.checks=p,e.compoundCount++,v}}},{name:"descendant",separator:!0,regex:Re.descendant,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=ze(),i=e[e.length-1];return n.checks.push({type:ve.DESCENDANT,ancestor:i,descendant:a}),En(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var o=ze(),l=e[e.length-1],c=ze(),u=ze(),d=ze(),f=ze();return o.checks.push({type:ve.COMPOUND_SPLIT,left:l,right:c,subject:u}),u.checks=r.checks,r.checks=[{type:ve.TRUE}],f.checks.push({type:ve.TRUE}),c.checks.push({type:ve.ANCESTOR,ancestor:f,descendant:d}),En(e,l,o),e.currentSubject=u,e.compoundCount++,d}else{var h=ze(),v=ze(),p=[{type:ve.ANCESTOR,ancestor:h,descendant:v}];return h.checks=r.checks,r.checks=p,e.compoundCount++,v}}},{name:"subject",modifier:!0,regex:Re.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return $e("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===ve.DIRECTED_EDGE?a.type=ve.NODE_TARGET:i===ve.UNDIRECTED_EDGE&&(a.type=ve.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];rc.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var Iq=function(e){for(var r,n,a,i=0;i<rc.length;i++){var o=rc[i],l=o.name,c=e.match(o.regexObj);if(c!=null){n=c,r=o,a=l;var u=c[0];e=e.substring(u.length);break}}return{expr:r,match:n,name:a,remaining:e}},Bq=function(e){var r=e.match(/^\s+/);if(r){var n=r[0];e=e.substring(n.length)}return e},Dq=function(e){var r=this,n=r.inputText=e,a=r[0]=ze();for(r.length=1,n=Bq(n);;){var i=Iq(n);if(i.expr==null)return $e("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),l=i.expr.populate(r,a,o);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 $e("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(d.edgeCount>1)return $e("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;d.edgeCount===1&&$e("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},Oq=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(d){return d??""},r=function(d){return Ee(d)?'"'+d+'"':e(d)},n=function(d){return" "+d+" "},a=function(d,f){var h=d.type,v=d.value;switch(h){case ve.GROUP:{var p=e(v);return p.substring(0,p.length-1)}case ve.DATA_COMPARE:{var g=d.field,m=d.operator;return"["+g+n(e(m))+r(v)+"]"}case ve.DATA_BOOL:{var y=d.operator,b=d.field;return"["+e(y)+b+"]"}case ve.DATA_EXIST:{var w=d.field;return"["+w+"]"}case ve.META_COMPARE:{var C=d.operator,x=d.field;return"[["+x+n(e(C))+r(v)+"]]"}case ve.STATE:return v;case ve.ID:return"#"+v;case ve.CLASS:return"."+v;case ve.PARENT:case ve.CHILD:return i(d.parent,f)+n(">")+i(d.child,f);case ve.ANCESTOR:case ve.DESCENDANT:return i(d.ancestor,f)+" "+i(d.descendant,f);case ve.COMPOUND_SPLIT:{var k=i(d.left,f),E=i(d.subject,f),_=i(d.right,f);return k+(k.length>0?" ":"")+E+_}case ve.TRUE:return""}},i=function(d,f){return d.checks.reduce(function(h,v,p){return h+(f===d&&p===0?"$":"")+a(v,f)},"")},o="",l=0;l<this.length;l++){var c=this[l];o+=i(c,c.subject),this.length>1&&l<this.length-1&&(o+=", ")}return this.toStringCache=o,o},Pq={parse:Dq,toString:Oq},Lb=function(e,r,n){var a,i=Ee(e),o=de(e),l=Ee(n),c,u,d=!1,f=!1,h=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),f=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),d=!0),(i||l||d)&&(c=!i&&!o?"":""+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">":h=!0,a=e>n;break;case">=":h=!0,a=e>=n;break;case"<":h=!0,a=e<n;break;case"<=":h=!0,a=e<=n;break;default:a=!1;break}return f&&(e!=null||!h)&&(a=!a),a},Aq=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},Rq=function(e){return e!==void 0},nc=function(e,r){return e.data(r)},Lq=function(e,r){return e[r]()},Qe=[],Ye=function(e,r){return e.checks.every(function(n){return Qe[n.type](n,r)})};Qe[ve.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()},Qe[ve.STATE]=function(t,e){var r=t.value;return Tq(r,e)},Qe[ve.ID]=function(t,e){var r=t.value;return e.id()===r},Qe[ve.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)},Qe[ve.META_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return Lb(Lq(e,r),n,a)},Qe[ve.DATA_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return Lb(nc(e,r),n,a)},Qe[ve.DATA_BOOL]=function(t,e){var r=t.field,n=t.operator;return Aq(nc(e,r),n)},Qe[ve.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,Rq(nc(e,r))},Qe[ve.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],n=t.nodes[1],a=e.source(),i=e.target();return Ye(r,a)&&Ye(n,i)||Ye(n,a)&&Ye(r,i)},Qe[ve.NODE_NEIGHBOR]=function(t,e){return Ye(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&Ye(t.neighbor,r)})},Qe[ve.DIRECTED_EDGE]=function(t,e){return Ye(t.source,e.source())&&Ye(t.target,e.target())},Qe[ve.NODE_SOURCE]=function(t,e){return Ye(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&Ye(t.target,r)})},Qe[ve.NODE_TARGET]=function(t,e){return Ye(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&Ye(t.source,r)})},Qe[ve.CHILD]=function(t,e){return Ye(t.child,e)&&Ye(t.parent,e.parent())},Qe[ve.PARENT]=function(t,e){return Ye(t.parent,e)&&e.children().some(function(r){return Ye(t.child,r)})},Qe[ve.DESCENDANT]=function(t,e){return Ye(t.descendant,e)&&e.ancestors().some(function(r){return Ye(t.ancestor,r)})},Qe[ve.ANCESTOR]=function(t,e){return Ye(t.ancestor,e)&&e.descendants().some(function(r){return Ye(t.descendant,r)})},Qe[ve.COMPOUND_SPLIT]=function(t,e){return Ye(t.subject,e)&&Ye(t.left,e)&&Ye(t.right,e)},Qe[ve.TRUE]=function(){return!0},Qe[ve.COLLECTION]=function(t,e){var r=t.value;return r.has(e)},Qe[ve.FILTER]=function(t,e){var r=t.value;return r(e)};var Mq=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===ve.ID)return e.getElementById(r[0].checks[0].value).collection();var n=function(i){for(var o=0;o<r.length;o++){var l=r[o];if(Ye(l,i))return!0}return!1};return r.text()==null&&(n=function(){return!0}),e.filter(n)},Fq=function(e){for(var r=this,n=0;n<r.length;n++){var a=r[n];if(Ye(a,e))return!0}return!1},$q={matches:Fq,filter:Mq},xn=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Ee(e)&&e.match(/^\s*$/)||(Zt(e)?this.addQuery({checks:[{type:ve.COLLECTION,value:e.collection()}]}):Xe(e)?this.addQuery({checks:[{type:ve.FILTER,value:e}]}):Ee(e)?this.parse(e)||(this.invalid=!0):Je("A selector must be created from a string; found "))},kn=xn.prototype;[Pq,$q].forEach(function(t){return Se(kn,t)}),kn.text=function(){return this.inputText},kn.size=function(){return this.length},kn.eq=function(t){return this[t]},kn.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()},kn.addQuery=function(t){this[this.length++]=t},kn.selector=kn.toString;var Sn={allAre:function(e){var r=new xn(e);return this.every(function(n){return r.matches(n)})},is:function(e){var r=new xn(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())})}};Sn.allAreNeighbours=Sn.allAreNeighbors,Sn.has=Sn.contains,Sn.equal=Sn.equals=Sn.same;var nr=function(e,r){return function(a,i,o,l){var c=a,u=this,d;if(c==null?d="":Zt(c)&&c.length===1&&(d=c.id()),u.length===1&&d){var f=u[0]._private,h=f.traversalCache=f.traversalCache||{},v=h[r]=h[r]||[],p=Xn(d),g=v[p];return g||(v[p]=e.call(u,a,i,o,l))}else return e.call(u,a,i,o,l)}},Wa={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],o=i._private.parent;o&&r.push(o)}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:nr(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 o=a[i];r.push(o),o.children().nonempty()&&n(o.children())}}return n(this.children()),this.spawn(r,!0).filter(e)}};function ac(t,e,r,n){for(var a=[],i=new La,o=t.cy(),l=o.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 Mb(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)}}Wa.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ac(this,t,e,Mb)};function Fb(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}Wa.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ac(this,t,e,Fb)};function Vq(t,e,r){Fb(t,e,r),Mb(t,e,r)}Wa.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ac(this,t,e,Vq)},Wa.ancestors=Wa.parents;var no,$b;no=$b={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}},no.attr=no.data,no.removeAttr=no.removeData;var qq=$b,As={};function ic(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,o=0;o<i.length;o++){var l=i[o];!e&&l.isLoop()||(n+=t(a,l))}return n}else return}}Se(As,{degree:ic(function(t,e){return e.source().same(e.target())?2:1}),indegree:ic(function(t,e){return e.target().same(t)?1:0}),outdegree:ic(function(t,e){return e.source().same(t)?1:0})});function Ya(t,e){return function(r){for(var n,a=this.nodes(),i=0;i<a.length;i++){var o=a[i],l=o[t](r);l!==void 0&&(n===void 0||e(l,n))&&(n=l)}return n}}Se(As,{minDegree:Ya("degree",function(t,e){return t<e}),maxDegree:Ya("degree",function(t,e){return t>e}),minIndegree:Ya("indegree",function(t,e){return t<e}),maxIndegree:Ya("indegree",function(t,e){return t>e}),minOutdegree:Ya("outdegree",function(t,e){return t<e}),maxOutdegree:Ya("outdegree",function(t,e){return t>e})}),Se(As,{totalDegree:function(e){for(var r=0,n=this.nodes(),a=0;a<n.length;a++)r+=n[a].degree(e);return r}});var mr,Vb,qb=function(e,r,n){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var o=i._private.position,l={x:r.x!=null?r.x-o.x:0,y:r.y!=null?r.y-o.y:0};i.isParent()&&!(l.x===0&&l.y===0)&&i.children().shift(l,n),i.dirtyBoundingBoxCache()}}},zb={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){qb(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};mr=Vb={position:Ve.data(zb),silentPosition:Ve.data(Se({},zb,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){qb(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(Ae(e))r?this.silentPosition(e):this.position(e);else if(Xe(e)){var n=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var o=this[i],l=void 0;(l=n(o,i))&&(r?o.silentPosition(l):o.position(l))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,n){var a;if(Ae(e)?(a={x:de(e.x)?e.x:0,y:de(e.y)?e.y:0},n=r):Ee(e)&&de(r)&&(a={x:0,y:0},a[e]=r),a!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var l=this[o];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 Ae(e)?this.shift(e,!0):Ee(e)&&de(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var n=this[0],a=this.cy(),i=a.zoom(),o=a.pan(),l=Ae(e)?e:void 0,c=l!==void 0||r!==void 0&&Ee(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-o[e])/i):l!==void 0&&d.position(U0(l,i,o))}else{var f=n.position();return l=ys(f,i,o),e===void 0?l:l[e]}else if(!c)return;return this},relativePosition:function(e,r){var n=this[0],a=this.cy(),i=Ae(e)?e:void 0,o=i!==void 0||r!==void 0&&Ee(e),l=a.hasCompoundNodes();if(n&&n.isNode())if(o)for(var c=0;c<this.length;c++){var u=this[c],d=l?u.parent():null,f=d&&d.length>0,h=f;f&&(d=d[0]);var v=h?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 p=n.position(),g=l?n.parent():null,m=g&&g.length>0,y=m;m&&(g=g[0]);var b=y?g.position():{x:0,y:0};return i={x:p.x-b.x,y:p.y-b.y},e===void 0?i:i[e]}else if(!o)return;return this}},mr.modelPosition=mr.point=mr.position,mr.modelPositions=mr.points=mr.positions,mr.renderedPoint=mr.renderedPosition,mr.relativePoint=mr.relativePosition;var zq=Vb,Za,_n;Za=_n={},_n.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),a=r.pan(),i=e.x1*n+a.x,o=e.x2*n+a.x,l=e.y1*n+a.y,c=e.y2*n+a.y;return{x1:i,x2:o,y1:l,y2:c,w:o-i,h:c-l}},_n.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)},_n.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(o){if(!o.isParent())return;var l=o._private,c=o.children(),u=o.pstyle("compound-sizing-wrt-labels").value==="include",d={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},f=c.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),h=l.position;(f.w===0||f.h===0)&&(f={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},f.x1=h.x-f.w/2,f.x2=h.x+f.w/2,f.y1=h.y-f.h/2,f.y2=h.y+f.h/2);function v(S,T,N){var B=0,O=0,D=T+N;return S>0&&D>0&&(B=T/D*S,O=N/D*S),{biasDiff:B,biasComplementDiff:O}}function p(S,T,N,B){if(N.units==="%")switch(B){case"width":return S>0?N.pfValue*S:0;case"height":return T>0?N.pfValue*T:0;case"average":return S>0&&T>0?N.pfValue*(S+T)/2:0;case"min":return S>0&&T>0?S>T?N.pfValue*T:N.pfValue*S:0;case"max":return S>0&&T>0?S>T?N.pfValue*S:N.pfValue*T:0;default:return 0}else return N.units==="px"?N.pfValue:0}var g=d.width.left.value;d.width.left.units==="px"&&d.width.val>0&&(g=g*100/d.width.val);var m=d.width.right.value;d.width.right.units==="px"&&d.width.val>0&&(m=m*100/d.width.val);var y=d.height.top.value;d.height.top.units==="px"&&d.height.val>0&&(y=y*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,m),C=w.biasDiff,x=w.biasComplementDiff,k=v(d.height.val-f.h,y,b),E=k.biasDiff,_=k.biasComplementDiff;l.autoPadding=p(f.w,f.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),l.autoWidth=Math.max(f.w,d.width.val),h.x=(-C+f.x1+f.x2+x)/2,l.autoHeight=Math.max(f.h,d.height.val),h.y=(-E+f.y1+f.y2+_)/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 ar=function(e){return e===1/0||e===-1/0?0:e},yr=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)},na=function(e,r){return r==null?e:yr(e,r.x1,r.y1,r.x2,r.y2)},ao=function(e,r,n){return gr(e,r,n)},Rs=function(e,r,n){if(!r.cy().headless()){var a=r._private,i=a.rstyle,o=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-o,f.y1=u-o,f.x2=c+o,f.y2=u+o,f.w=f.x2-f.x1,f.h=f.y2-f.y1,ws(f,1),yr(e,f.x1,f.y1,f.x2,f.y2)}}},oc=function(e,r,n){if(!r.cy().headless()){var a;n?a=n+"-":a="";var i=r._private,o=i.rstyle,l=r.pstyle(a+"label").strValue;if(l){var c=r.pstyle("text-halign"),u=r.pstyle("text-valign"),d=ao(o,"labelWidth",n),f=ao(o,"labelHeight",n),h=ao(o,"labelX",n),v=ao(o,"labelY",n),p=r.pstyle(a+"text-margin-x").pfValue,g=r.pstyle(a+"text-margin-y").pfValue,m=r.isEdge(),y=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,k=2,E=f,_=d,S=_/2,T=E/2,N,B,O,D;if(m)N=h-S,B=h+S,O=v-T,D=v+T;else{switch(c.value){case"left":N=h-_,B=h;break;case"center":N=h-S,B=h+S;break;case"right":N=h,B=h+_;break}switch(u.value){case"top":O=v-E,D=v;break;case"center":O=v-T,D=v+T;break;case"bottom":O=v,D=v+E;break}}N+=p-Math.max(b,C)-x-k,B+=p+Math.max(b,C)+x+k,O+=g-Math.max(b,C)-x-k,D+=g+Math.max(b,C)+x+k;var R=n||"main",P=i.labelBounds,L=P[R]=P[R]||{};L.x1=N,L.y1=O,L.x2=B,L.y2=D,L.w=B-N,L.h=D-O;var A=m&&y.strValue==="autorotate",q=y.pfValue!=null&&y.pfValue!==0;if(A||q){var U=A?ao(i.rstyle,"labelAngle",n):y.pfValue,z=Math.cos(U),H=Math.sin(U),Q=(N+B)/2,F=(O+D)/2;if(!m){switch(c.value){case"left":Q=B;break;case"right":Q=N;break}switch(u.value){case"top":F=D;break;case"bottom":F=O;break}}var $=function(ce,ae){return ce=ce-Q,ae=ae-F,{x:ce*z-ae*H+Q,y:ce*H+ae*z+F}},V=$(N,O),G=$(N,D),j=$(B,O),M=$(B,D);N=Math.min(V.x,G.x,j.x,M.x),B=Math.max(V.x,G.x,j.x,M.x),O=Math.min(V.y,G.y,j.y,M.y),D=Math.max(V.y,G.y,j.y,M.y)}var W=R+"Rot",Y=P[W]=P[W]||{};Y.x1=N,Y.y1=O,Y.x2=B,Y.y2=D,Y.w=B-N,Y.h=D-O,yr(e,N,O,B,D),yr(i.labelBounds.all,N,O,B,D)}return e}},Hq=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,o=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(o)?(c=(e.w+l*2.4)/e.w,f=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(o)?c=(e.w+l*2.4)/e.w:o==="star"?(c=(e.w+l*2.8)/e.w,u=(e.h+l*2.6)/e.h,f=-l/3.8):o==="triangle"?(c=(e.w+l*2.8)/e.w,u=(e.h+l*2.4)/e.h,f=-l/1.4):o==="vee"&&(c=(e.w+l*4.4)/e.w,u=(e.h+l*3.8)/e.h,f=-l*.5);var h=e.h*u-e.h,v=e.w*c-e.w;if(Cs(e,[Math.ceil(h/2),Math.ceil(v/2)]),d!=0||f!==0){var p=c5(e,d,f);W0(e,p)}}}},Kq=function(e,r){var n=e._private.cy,a=n.styleEnabled(),i=n.headless(),o=Kt(),l=e._private,c=e.isNode(),u=e.isEdge(),d,f,h,v,p,g,m=l.rstyle,y=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 k=0,E=0;a&&r.includeUnderlays&&(k=e.pstyle("underlay-opacity").value,k!==0&&(E=e.pstyle("underlay-padding").value));var _=Math.max(x,E),S=0,T=0;if(a&&(S=e.pstyle("width").pfValue,T=S/2),c&&r.includeNodes){var N=e.position();p=N.x,g=N.y;var B=e.outerWidth(),O=B/2,D=e.outerHeight(),R=D/2;d=p-O,f=p+O,h=g-R,v=g+R,yr(o,d,h,f,v),a&&r.includeOutlines&&Hq(o,e)}else if(u&&r.includeEdges)if(a&&!i){var P=e.pstyle("curve-style").strValue;if(d=Math.min(m.srcX,m.midX,m.tgtX),f=Math.max(m.srcX,m.midX,m.tgtX),h=Math.min(m.srcY,m.midY,m.tgtY),v=Math.max(m.srcY,m.midY,m.tgtY),d-=T,f+=T,h-=T,v+=T,yr(o,d,h,f,v),P==="haystack"){var L=m.haystackPts;if(L&&L.length===2){if(d=L[0].x,h=L[0].y,f=L[1].x,v=L[1].y,d>f){var A=d;d=f,f=A}if(h>v){var q=h;h=v,v=q}yr(o,d-T,h-T,f+T,v+T)}}else if(P==="bezier"||P==="unbundled-bezier"||P.endsWith("segments")||P.endsWith("taxi")){var U;switch(P){case"bezier":case"unbundled-bezier":U=m.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":U=m.linePts;break}if(U!=null)for(var z=0;z<U.length;z++){var H=U[z];d=H.x-T,f=H.x+T,h=H.y-T,v=H.y+T,yr(o,d,h,f,v)}}}else{var Q=e.source(),F=Q.position(),$=e.target(),V=$.position();if(d=F.x,f=V.x,h=F.y,v=V.y,d>f){var G=d;d=f,f=G}if(h>v){var j=h;h=v,v=j}d-=T,f+=T,h-=T,v+=T,yr(o,d,h,f,v)}if(a&&r.includeEdges&&u&&(Rs(o,e,"mid-source"),Rs(o,e,"mid-target"),Rs(o,e,"source"),Rs(o,e,"target")),a){var M=e.pstyle("ghost").value==="yes";if(M){var W=e.pstyle("ghost-offset-x").pfValue,Y=e.pstyle("ghost-offset-y").pfValue;yr(o,o.x1+W,o.y1+Y,o.x2+W,o.y2+Y)}}var se=l.bodyBounds=l.bodyBounds||{};Y0(se,o),Cs(se,y),ws(se,1),a&&(d=o.x1,f=o.x2,h=o.y1,v=o.y2,yr(o,d-_,h-_,f+_,v+_));var ce=l.overlayBounds=l.overlayBounds||{};Y0(ce,o),Cs(ce,y),ws(ce,1);var ae=l.labelBounds=l.labelBounds||{};ae.all!=null?u5(ae.all):ae.all=Kt(),a&&r.includeLabels&&(r.includeMainLabels&&oc(o,e,null),u&&(r.includeSourceLabels&&oc(o,e,"source"),r.includeTargetLabels&&oc(o,e,"target")))}return o.x1=ar(o.x1),o.y1=ar(o.y1),o.x2=ar(o.x2),o.y2=ar(o.y2),o.w=ar(o.x2-o.x1),o.h=ar(o.y2-o.y1),o.w>0&&o.h>0&&w&&(Cs(o,y),ws(o,1)),o},Hb=function(e){var r=0,n=function(o){return(o?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},Kb=function(e){if(e.isEdge()){var r=e.source().position(),n=e.target().position(),a=function(o){return Math.round(o)};return BF([a(r.x),a(r.y),a(n.x),a(n.y)])}else return 0},Gb=function(e,r){var n=e._private,a,i=e.isEdge(),o=r==null?Ub:Hb(r),l=o===Ub,c=Kb(e),u=n.bbCachePosKey===c,d=r.useCache&&u,f=function(g){return g._private.bbCache==null||g._private.styleDirty},h=!d||f(e)||i&&f(e.source())||f(e.target());if(h?(u||e.recalculateRenderedStyle(d),a=Kq(e,io),n.bbCache=a,n.bbCachePosKey=c):a=n.bbCache,!l){var v=e.isNode();a=Kt(),(r.includeNodes&&v||r.includeEdges&&!v)&&(r.includeOverlays?na(a,n.overlayBounds):na(a,n.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?na(a,n.labelBounds.all):(r.includeMainLabels&&na(a,n.labelBounds.mainRot),r.includeSourceLabels&&na(a,n.labelBounds.sourceRot),r.includeTargetLabels&&na(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},io={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Ub=Hb(io),jb=xt(io);_n.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=io:t=jb(t),e=Gb(this[0],t);else{e=Kt(),t=t||io;var r=jb(t),n=this,a=n.cy(),i=a.styleEnabled();if(i)for(var o=0;o<n.length;o++){var l=n[o],c=l._private,u=Kb(l),d=c.bbCachePosKey===u,f=r.useCache&&d&&!c.styleDirty;l.recalculateRenderedStyle(f)}this.updateCompoundBounds(!t.useCache);for(var h=0;h<n.length;h++){var v=n[h];na(e,Gb(v,r))}}return e.x1=ar(e.x1),e.y1=ar(e.y1),e.x2=ar(e.x2),e.y2=ar(e.y2),e.w=ar(e.x2-e.x1),e.h=ar(e.y2-e.y1),e},_n.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},_n.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)),Ae(t)){var i=t;t=function(){return i}}var o=function(d,f){return d._private.bbAtOldPos=t(d,f)},l=function(d){return d._private.bbAtOldPos};r.startBatch(),e.forEach(o).silentPositions(t),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var c=l5(this.boundingBox({useCache:!1}));return e.silentPositions(l),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),r.endBatch(),c},Za.boundingbox=Za.bb=Za.boundingBox,Za.renderedBoundingbox=Za.renderedBoundingBox;var Gq=_n,oo,so;oo=so={};var Wb=function(e){e.uppercaseName=_0(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=_0(e.outerName),oo[e.name]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){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},oo["outer"+e.uppercaseName]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){var l=n[e.name](),c=n.pstyle("border-width").pfValue,u=2*n.padding();return l+c+u}else return 1},oo["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},oo["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};Wb({name:"width"}),Wb({name:"height"}),so.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},so.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()},so.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var Uq=so,jq=function(e,r){if(e.isEdge())return r(e)},Wq=function(e,r){if(e.isEdge()){var n=e.cy();return ys(r(e),n.zoom(),n.pan())}},Yq=function(e,r){if(e.isEdge()){var n=e.cy(),a=n.pan(),i=n.zoom();return r(e).map(function(o){return ys(o,i,a)})}},Zq=function(e){return e.renderer().getControlPoints(e)},Xq=function(e){return e.renderer().getSegmentPoints(e)},Jq=function(e){return e.renderer().getSourceEndpoint(e)},Qq=function(e){return e.renderer().getTargetEndpoint(e)},ez=function(e){return e.renderer().getEdgeMidpoint(e)},Yb={controlPoints:{get:Zq,mult:!0},segmentPoints:{get:Xq,mult:!0},sourceEndpoint:{get:Jq},targetEndpoint:{get:Qq},midpoint:{get:ez}},tz=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},rz=Object.keys(Yb).reduce(function(t,e){var r=Yb[e],n=tz(e);return t[e]=function(){return jq(this,r.get)},r.mult?t[n]=function(){return Yq(this,r.get)}:t[n]=function(){return Wq(this,r.get)},t},{}),nz=Se({},zq,Gq,Uq,rz);/*!
35
+ */var kb=0,Sb=1,_b=2,Xr=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=kb,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))};Xr.prototype={fulfill:function(e){return Tb(this,Sb,"fulfillValue",e)},reject:function(e){return Tb(this,_b,"rejectReason",e)},then:function(e,r){var n=this,a=new Xr;return n.onFulfilled.push(Bb(e,a,"fulfill")),n.onRejected.push(Bb(r,a,"reject")),Nb(n),a.proxy}};var Tb=function(e,r,n,a){return e.state===kb&&(e.state=r,e[n]=a,Nb(e)),e},Nb=function(e){e.state===Sb?Ib(e,"onFulfilled",e.fulfillValue):e.state===_b&&Ib(e,"onRejected",e.rejectReason)},Ib=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)}},Bb=function(e,r,n){return function(a){if(typeof e!="function")r[n].call(r,a);else{var i;try{i=e(a)}catch(o){r.reject(o);return}k$(r,i)}}},k$=function t(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(ht(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)};Xr.all=function(t){return new Xr(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)},o=0;o<t.length;o++)(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)}})(o)})},Xr.resolve=function(t){return new Xr(function(e,r){e(t)})},Xr.reject=function(t){return new Xr(function(e,r){r(t)})};var Ua=typeof Promise<"u"?Promise:Xr,Ju=function(e,r,n){var a=Ru(e),i=!a,o=this._private=Se({duration:1e3},r,n);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&Xe(o.complete)&&o.completes.push(o.complete),i){var l=e.position();o.startPosition=o.startPosition||{x:l.x,y:l.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(a){var c=e.pan();o.startPan={x:c.x,y:c.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},ra=Ju.prototype;Se(ra,{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),Zt(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],o=i.name,l=e.startStyle[o];e.startStyle[o]=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 Ua(function(a,i){n.push(function(){a()})})}}),ra.complete=ra.completed,ra.run=ra.play,ra.running=ra.playing;var S$={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 o=a[0];if(o)return o._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 o=0;o<a.length;o++){var l=a[o];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,o=i?a:[a],l=this._private.cy||this,c=!i,u=!c;if(!l.styleEnabled())return this;var d=l.style();r=Se({},r,n);var f=Object.keys(r).length===0;if(f)return new Ju(o[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 h=r.renderedPosition,v=l.pan(),p=l.zoom();r.position=Q0(h,p,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&&Ae(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 Ju(o[0],r)}},animate:function(){return function(r,n){var a=this,i=a.length!==void 0,o=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;n&&(r=Se({},r,n));for(var c=0;c<o.length;c++){var u=o[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,o=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;for(var c=0;c<o.length;c++){for(var u=o[c],d=u._private,f=d.animation.current,h=0;h<f.length;h++){var v=f[h],p=v._private;n&&(p.duration=0)}r&&(d.animation.queue=[]),n||(d.animation.current=[])}return l.notify("draw"),this}}},_$=Array.isArray,Ds=_$,T$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,N$=/^\w*$/;function I$(t,e){if(Ds(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Wi(t)?!0:N$.test(t)||!T$.test(t)||e!=null&&t in Object(e)}var B$=I$,D$="[object AsyncFunction]",P$="[object Function]",O$="[object GeneratorFunction]",A$="[object Proxy]";function R$(t){if(!Zn(t))return!1;var e=$0(t);return e==P$||e==O$||e==D$||e==A$}var L$=R$,F$=hs["__core-js_shared__"],Qu=F$,Db=function(){var t=/[^.]+$/.exec(Qu&&Qu.keys&&Qu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function M$(t){return!!Db&&Db in t}var $$=M$,V$=Function.prototype,q$=V$.toString;function z$(t){if(t!=null){try{return q$.call(t)}catch{}try{return t+""}catch{}}return""}var H$=z$,K$=/[\\^$.*+?()[\]{}|]/g,G$=/^\[object .+?Constructor\]$/,U$=Function.prototype,j$=Object.prototype,W$=U$.toString,Y$=j$.hasOwnProperty,Z$=RegExp("^"+W$.call(Y$).replace(K$,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function X$(t){if(!Zn(t)||$$(t))return!1;var e=L$(t)?Z$:G$;return e.test(H$(t))}var J$=X$;function Q$(t,e){return t==null?void 0:t[e]}var eV=Q$;function tV(t,e){var r=eV(t,e);return J$(r)?r:void 0}var ec=tV,rV=ec(Object,"create"),ao=rV;function nV(){this.__data__=ao?ao(null):{},this.size=0}var aV=nV;function iV(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var oV=iV,sV="__lodash_hash_undefined__",lV=Object.prototype,uV=lV.hasOwnProperty;function cV(t){var e=this.__data__;if(ao){var r=e[t];return r===sV?void 0:r}return uV.call(e,t)?e[t]:void 0}var dV=cV,fV=Object.prototype,hV=fV.hasOwnProperty;function pV(t){var e=this.__data__;return ao?e[t]!==void 0:hV.call(e,t)}var vV=pV,gV="__lodash_hash_undefined__";function mV(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ao&&e===void 0?gV:e,this}var yV=mV;function ja(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])}}ja.prototype.clear=aV,ja.prototype.delete=oV,ja.prototype.get=dV,ja.prototype.has=vV,ja.prototype.set=yV;var Pb=ja;function bV(){this.__data__=[],this.size=0}var wV=bV;function CV(t,e){return t===e||t!==t&&e!==e}var Ob=CV;function EV(t,e){for(var r=t.length;r--;)if(Ob(t[r][0],e))return r;return-1}var Ps=EV,xV=Array.prototype,kV=xV.splice;function SV(t){var e=this.__data__,r=Ps(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():kV.call(e,r,1),--this.size,!0}var _V=SV;function TV(t){var e=this.__data__,r=Ps(e,t);return r<0?void 0:e[r][1]}var NV=TV;function IV(t){return Ps(this.__data__,t)>-1}var BV=IV;function DV(t,e){var r=this.__data__,n=Ps(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var PV=DV;function Wa(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])}}Wa.prototype.clear=wV,Wa.prototype.delete=_V,Wa.prototype.get=NV,Wa.prototype.has=BV,Wa.prototype.set=PV;var OV=Wa,AV=ec(hs,"Map"),RV=AV;function LV(){this.size=0,this.__data__={hash:new Pb,map:new(RV||OV),string:new Pb}}var FV=LV;function MV(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var $V=MV;function VV(t,e){var r=t.__data__;return $V(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Os=VV;function qV(t){var e=Os(this,t).delete(t);return this.size-=e?1:0,e}var zV=qV;function HV(t){return Os(this,t).get(t)}var KV=HV;function GV(t){return Os(this,t).has(t)}var UV=GV;function jV(t,e){var r=Os(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var WV=jV;function Ya(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])}}Ya.prototype.clear=FV,Ya.prototype.delete=zV,Ya.prototype.get=KV,Ya.prototype.has=UV,Ya.prototype.set=WV;var Ab=Ya,YV="Expected a function";function tc(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(YV);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 o=t.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(tc.Cache||Ab),r}tc.Cache=Ab;var ZV=tc,XV=500;function JV(t){var e=ZV(t,function(n){return r.size===XV&&r.clear(),n}),r=e.cache;return e}var QV=JV,eq=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tq=/\\(\\)?/g,rq=QV(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(eq,function(r,n,a,i){e.push(a?i.replace(tq,"$1"):n||r)}),e}),Rb=rq;function nq(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 Lb=nq,aq=1/0,Fb=Fa?Fa.prototype:void 0,Mb=Fb?Fb.toString:void 0;function $b(t){if(typeof t=="string")return t;if(Ds(t))return Lb(t,$b)+"";if(Wi(t))return Mb?Mb.call(t):"";var e=t+"";return e=="0"&&1/t==-aq?"-0":e}var iq=$b;function oq(t){return t==null?"":iq(t)}var Vb=oq;function sq(t,e){return Ds(t)?t:B$(t,e)?[t]:Rb(Vb(t))}var qb=sq,lq=1/0;function uq(t){if(typeof t=="string"||Wi(t))return t;var e=t+"";return e=="0"&&1/t==-lq?"-0":e}var rc=uq;function cq(t,e){e=qb(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[rc(e[r++])];return r&&r==n?t:void 0}var dq=cq;function fq(t,e,r){var n=t==null?void 0:dq(t,e);return n===void 0?r:n}var hq=fq,pq=function(){try{var t=ec(Object,"defineProperty");return t({},"",{}),t}catch{}}(),zb=pq;function vq(t,e,r){e=="__proto__"&&zb?zb(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var gq=vq,mq=Object.prototype,yq=mq.hasOwnProperty;function bq(t,e,r){var n=t[e];(!(yq.call(t,e)&&Ob(n,r))||r===void 0&&!(e in t))&&gq(t,e,r)}var wq=bq,Cq=9007199254740991,Eq=/^(?:0|[1-9]\d*)$/;function xq(t,e){var r=typeof t;return e=e??Cq,!!e&&(r=="number"||r!="symbol"&&Eq.test(t))&&t>-1&&t%1==0&&t<e}var kq=xq;function Sq(t,e,r,n){if(!Zn(t))return t;e=qb(e,t);for(var a=-1,i=e.length,o=i-1,l=t;l!=null&&++a<i;){var c=rc(e[a]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(a!=o){var d=l[c];u=n?n(d,c,l):void 0,u===void 0&&(u=Zn(d)?d:kq(e[a+1])?[]:{})}wq(l,c,u),l=l[c]}return t}var _q=Sq;function Tq(t,e,r){return t==null?t:_q(t,e,r)}var Nq=Tq;function Iq(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Bq=Iq;function Dq(t){return Ds(t)?Lb(t,rc):Wi(t)?[t]:Bq(Rb(Vb(t)))}var Pq=Dq,Oq={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=Se({},r,e),function(a,i){var o=e,l=this,c=l.length!==void 0,u=c?l:[l],d=c?l[0]:l;if(Ee(a)){var f=a.indexOf(".")!==-1,h=f&&Pq(a);if(o.allowGetting&&i===void 0){var v;return d&&(o.beforeGet(d),h&&d._private[o.field][a]===void 0?v=hq(d._private[o.field],h):v=d._private[o.field][a]),v}else if(o.allowSetting&&i!==void 0){var p=!o.immutableKeys[a];if(p){var g=k0({},a,i);o.beforeSet(l,g);for(var y=0,m=u.length;y<m;y++){var b=u[y];o.canSet(b)&&(h&&d._private[o.field][a]===void 0?Nq(b._private[o.field],h,i):b._private[o.field][a]=i)}o.updateStyle&&l.updateStyle(),o.onSet(l),o.settingTriggersEvent&&l[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&Ae(a)){var w=a,C,x,k=Object.keys(w);o.beforeSet(l,w);for(var E=0;E<k.length;E++){C=k[E],x=w[C];var _=!o.immutableKeys[C];if(_)for(var S=0;S<u.length;S++){var T=u[S];o.canSet(T)&&(T._private[o.field][C]=x)}}o.updateStyle&&l.updateStyle(),o.onSet(l),o.settingTriggersEvent&&l[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&Xe(a)){var N=a;l.on(o.bindingEvent,N)}else if(o.allowGetting&&a===void 0){var B;return d&&(o.beforeGet(d),B=d._private[o.field]),B}return l}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Se({},r,e),function(a){var i=e,o=this,l=o.length!==void 0,c=l?o:[o];if(Ee(a)){for(var u=a.split(/\s+/),d=u.length,f=0;f<d;f++){var h=u[f];if(!mn(h)){var v=!i.immutableKeys[h];if(v)for(var p=0,g=c.length;p<g;p++)c[p]._private[i.field][h]=void 0}}i.triggerEvent&&o[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],k=!i.immutableKeys[x];k&&(b[x]=void 0)}i.triggerEvent&&o[i.triggerFnName](i.event)}return o}}},Aq={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,o=Array.prototype.slice.call(arguments,0);return new Ua(function(l,c){var u=function(v){i.off.apply(i,f),l(v)},d=o.concat([u]),f=d.concat([]);i.on.apply(i,d)})}}},Ve={};[S$,Oq,Aq].forEach(function(t){Se(Ve,t)});var Rq={animate:Ve.animate(),animation:Ve.animation(),animated:Ve.animated(),clearQueue:Ve.clearQueue(),delay:Ve.delay(),delayAnimation:Ve.delayAnimation(),stop:Ve.stop()},As={classes:function(e){var r=this;if(e===void 0){var n=[];return r[0]._private.classes.forEach(function(p){return n.push(p)}),n}else Ke(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new $a(e),o=0;o<r.length;o++){for(var l=r[o],c=l._private,u=c.classes,d=!1,f=0;f<e.length;f++){var h=e[f],v=u.has(h);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=[],o=0,l=n.length;o<l;o++)for(var c=n[o],u=c._private.classes,d=!1,f=0;f<e.length;f++){var h=e[f],v=u.has(h),p=!1;r||a&&!v?(u.add(h),p=!0):(!r||a&&v)&&(u.delete(h),p=!0),!d&&p&&(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}};As.className=As.classNames=As.classes;var Re={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:vt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Re.variable="(?:[\\w-.]|(?:\\\\"+Re.metaChar+"))+",Re.className="(?:[\\w-]|(?:\\\\"+Re.metaChar+"))+",Re.value=Re.string+"|"+Re.number,Re.id=Re.variable,function(){var t,e,r;for(t=Re.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],Re.comparatorOp+="|@"+e;for(t=Re.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(Re.comparatorOp+="|\\!"+e)}();var ze=function(){return{checks:[]}},ve={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},nc=[{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 jF(t.selector,e.selector)}),Lq=function(){for(var t={},e,r=0;r<nc.length;r++)e=nc[r],t[e.selector]=e.matches;return t}(),Fq=function(e,r){return Lq[e](r)},Mq="("+nc.map(function(t){return t.selector}).join("|")+")",Za=function(e){return e.replace(new RegExp("\\\\("+Re.metaChar+")","g"),function(r,n){return n})},En=function(e,r,n){e[e.length-1]=n},ac=[{name:"group",query:!0,regex:"("+Re.group+")",populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:Mq,populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Re.id+")",populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.ID,value:Za(i)})}},{name:"className",query:!0,regex:"\\.("+Re.className+")",populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.CLASS,value:Za(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Re.variable+")\\s*\\]",populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.DATA_EXIST,field:Za(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Re.variable+")\\s*("+Re.comparatorOp+")\\s*("+Re.value+")\\s*\\]",populate:function(e,r,n){var a=vr(n,3),i=a[0],o=a[1],l=a[2],c=new RegExp("^"+Re.string+"$").exec(l)!=null;c?l=l.substring(1,l.length-1):l=parseFloat(l),r.checks.push({type:ve.DATA_COMPARE,field:Za(i),operator:o,value:l})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Re.boolOp+")\\s*("+Re.variable+")\\s*\\]",populate:function(e,r,n){var a=vr(n,2),i=a[0],o=a[1];r.checks.push({type:ve.DATA_BOOL,field:Za(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Re.meta+")\\s*("+Re.comparatorOp+")\\s*("+Re.number+")\\s*\\]\\]",populate:function(e,r,n){var a=vr(n,3),i=a[0],o=a[1],l=a[2];r.checks.push({type:ve.META_COMPARE,field:Za(i),operator:o,value:parseFloat(l)})}},{name:"nextQuery",separator:!0,regex:Re.separator,populate:function(e,r){var n=e.currentSubject,a=e.edgeCount,i=e.compoundCount,o=e[e.length-1];n!=null&&(o.subject=n,e.currentSubject=null),o.edgeCount=a,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var l=e[e.length++]=ze();return l}},{name:"directedEdge",separator:!0,regex:Re.directedEdge,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=r,i=ze();return n.checks.push({type:ve.DIRECTED_EDGE,source:a,target:i}),En(e,r,n),e.edgeCount++,i}else{var o=ze(),l=r,c=ze();return o.checks.push({type:ve.NODE_SOURCE,source:l,target:c}),En(e,r,o),e.edgeCount++,c}}},{name:"undirectedEdge",separator:!0,regex:Re.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=r,i=ze();return n.checks.push({type:ve.UNDIRECTED_EDGE,nodes:[a,i]}),En(e,r,n),e.edgeCount++,i}else{var o=ze(),l=r,c=ze();return o.checks.push({type:ve.NODE_NEIGHBOR,node:l,neighbor:c}),En(e,r,o),c}}},{name:"child",separator:!0,regex:Re.child,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=ze(),i=e[e.length-1];return n.checks.push({type:ve.CHILD,parent:i,child:a}),En(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var o=ze(),l=e[e.length-1],c=ze(),u=ze(),d=ze(),f=ze();return o.checks.push({type:ve.COMPOUND_SPLIT,left:l,right:c,subject:u}),u.checks=r.checks,r.checks=[{type:ve.TRUE}],f.checks.push({type:ve.TRUE}),c.checks.push({type:ve.PARENT,parent:f,child:d}),En(e,l,o),e.currentSubject=u,e.compoundCount++,d}else{var h=ze(),v=ze(),p=[{type:ve.PARENT,parent:h,child:v}];return h.checks=r.checks,r.checks=p,e.compoundCount++,v}}},{name:"descendant",separator:!0,regex:Re.descendant,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=ze(),i=e[e.length-1];return n.checks.push({type:ve.DESCENDANT,ancestor:i,descendant:a}),En(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var o=ze(),l=e[e.length-1],c=ze(),u=ze(),d=ze(),f=ze();return o.checks.push({type:ve.COMPOUND_SPLIT,left:l,right:c,subject:u}),u.checks=r.checks,r.checks=[{type:ve.TRUE}],f.checks.push({type:ve.TRUE}),c.checks.push({type:ve.ANCESTOR,ancestor:f,descendant:d}),En(e,l,o),e.currentSubject=u,e.compoundCount++,d}else{var h=ze(),v=ze(),p=[{type:ve.ANCESTOR,ancestor:h,descendant:v}];return h.checks=r.checks,r.checks=p,e.compoundCount++,v}}},{name:"subject",modifier:!0,regex:Re.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return $e("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===ve.DIRECTED_EDGE?a.type=ve.NODE_TARGET:i===ve.UNDIRECTED_EDGE&&(a.type=ve.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];ac.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var $q=function(e){for(var r,n,a,i=0;i<ac.length;i++){var o=ac[i],l=o.name,c=e.match(o.regexObj);if(c!=null){n=c,r=o,a=l;var u=c[0];e=e.substring(u.length);break}}return{expr:r,match:n,name:a,remaining:e}},Vq=function(e){var r=e.match(/^\s+/);if(r){var n=r[0];e=e.substring(n.length)}return e},qq=function(e){var r=this,n=r.inputText=e,a=r[0]=ze();for(r.length=1,n=Vq(n);;){var i=$q(n);if(i.expr==null)return $e("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),l=i.expr.populate(r,a,o);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 $e("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(d.edgeCount>1)return $e("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;d.edgeCount===1&&$e("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},zq=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(d){return d??""},r=function(d){return Ee(d)?'"'+d+'"':e(d)},n=function(d){return" "+d+" "},a=function(d,f){var h=d.type,v=d.value;switch(h){case ve.GROUP:{var p=e(v);return p.substring(0,p.length-1)}case ve.DATA_COMPARE:{var g=d.field,y=d.operator;return"["+g+n(e(y))+r(v)+"]"}case ve.DATA_BOOL:{var m=d.operator,b=d.field;return"["+e(m)+b+"]"}case ve.DATA_EXIST:{var w=d.field;return"["+w+"]"}case ve.META_COMPARE:{var C=d.operator,x=d.field;return"[["+x+n(e(C))+r(v)+"]]"}case ve.STATE:return v;case ve.ID:return"#"+v;case ve.CLASS:return"."+v;case ve.PARENT:case ve.CHILD:return i(d.parent,f)+n(">")+i(d.child,f);case ve.ANCESTOR:case ve.DESCENDANT:return i(d.ancestor,f)+" "+i(d.descendant,f);case ve.COMPOUND_SPLIT:{var k=i(d.left,f),E=i(d.subject,f),_=i(d.right,f);return k+(k.length>0?" ":"")+E+_}case ve.TRUE:return""}},i=function(d,f){return d.checks.reduce(function(h,v,p){return h+(f===d&&p===0?"$":"")+a(v,f)},"")},o="",l=0;l<this.length;l++){var c=this[l];o+=i(c,c.subject),this.length>1&&l<this.length-1&&(o+=", ")}return this.toStringCache=o,o},Hq={parse:qq,toString:zq},Hb=function(e,r,n){var a,i=Ee(e),o=de(e),l=Ee(n),c,u,d=!1,f=!1,h=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),f=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),d=!0),(i||l||d)&&(c=!i&&!o?"":""+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">":h=!0,a=e>n;break;case">=":h=!0,a=e>=n;break;case"<":h=!0,a=e<n;break;case"<=":h=!0,a=e<=n;break;default:a=!1;break}return f&&(e!=null||!h)&&(a=!a),a},Kq=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},Gq=function(e){return e!==void 0},ic=function(e,r){return e.data(r)},Uq=function(e,r){return e[r]()},Qe=[],Ye=function(e,r){return e.checks.every(function(n){return Qe[n.type](n,r)})};Qe[ve.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()},Qe[ve.STATE]=function(t,e){var r=t.value;return Fq(r,e)},Qe[ve.ID]=function(t,e){var r=t.value;return e.id()===r},Qe[ve.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)},Qe[ve.META_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return Hb(Uq(e,r),n,a)},Qe[ve.DATA_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return Hb(ic(e,r),n,a)},Qe[ve.DATA_BOOL]=function(t,e){var r=t.field,n=t.operator;return Kq(ic(e,r),n)},Qe[ve.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,Gq(ic(e,r))},Qe[ve.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],n=t.nodes[1],a=e.source(),i=e.target();return Ye(r,a)&&Ye(n,i)||Ye(n,a)&&Ye(r,i)},Qe[ve.NODE_NEIGHBOR]=function(t,e){return Ye(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&Ye(t.neighbor,r)})},Qe[ve.DIRECTED_EDGE]=function(t,e){return Ye(t.source,e.source())&&Ye(t.target,e.target())},Qe[ve.NODE_SOURCE]=function(t,e){return Ye(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&Ye(t.target,r)})},Qe[ve.NODE_TARGET]=function(t,e){return Ye(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&Ye(t.source,r)})},Qe[ve.CHILD]=function(t,e){return Ye(t.child,e)&&Ye(t.parent,e.parent())},Qe[ve.PARENT]=function(t,e){return Ye(t.parent,e)&&e.children().some(function(r){return Ye(t.child,r)})},Qe[ve.DESCENDANT]=function(t,e){return Ye(t.descendant,e)&&e.ancestors().some(function(r){return Ye(t.ancestor,r)})},Qe[ve.ANCESTOR]=function(t,e){return Ye(t.ancestor,e)&&e.descendants().some(function(r){return Ye(t.descendant,r)})},Qe[ve.COMPOUND_SPLIT]=function(t,e){return Ye(t.subject,e)&&Ye(t.left,e)&&Ye(t.right,e)},Qe[ve.TRUE]=function(){return!0},Qe[ve.COLLECTION]=function(t,e){var r=t.value;return r.has(e)},Qe[ve.FILTER]=function(t,e){var r=t.value;return r(e)};var jq=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===ve.ID)return e.getElementById(r[0].checks[0].value).collection();var n=function(i){for(var o=0;o<r.length;o++){var l=r[o];if(Ye(l,i))return!0}return!1};return r.text()==null&&(n=function(){return!0}),e.filter(n)},Wq=function(e){for(var r=this,n=0;n<r.length;n++){var a=r[n];if(Ye(a,e))return!0}return!1},Yq={matches:Wq,filter:jq},xn=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Ee(e)&&e.match(/^\s*$/)||(Zt(e)?this.addQuery({checks:[{type:ve.COLLECTION,value:e.collection()}]}):Xe(e)?this.addQuery({checks:[{type:ve.FILTER,value:e}]}):Ee(e)?this.parse(e)||(this.invalid=!0):Je("A selector must be created from a string; found "))},kn=xn.prototype;[Hq,Yq].forEach(function(t){return Se(kn,t)}),kn.text=function(){return this.inputText},kn.size=function(){return this.length},kn.eq=function(t){return this[t]},kn.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()},kn.addQuery=function(t){this[this.length++]=t},kn.selector=kn.toString;var Sn={allAre:function(e){var r=new xn(e);return this.every(function(n){return r.matches(n)})},is:function(e){var r=new xn(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())})}};Sn.allAreNeighbours=Sn.allAreNeighbors,Sn.has=Sn.contains,Sn.equal=Sn.equals=Sn.same;var nr=function(e,r){return function(a,i,o,l){var c=a,u=this,d;if(c==null?d="":Zt(c)&&c.length===1&&(d=c.id()),u.length===1&&d){var f=u[0]._private,h=f.traversalCache=f.traversalCache||{},v=h[r]=h[r]||[],p=Xn(d),g=v[p];return g||(v[p]=e.call(u,a,i,o,l))}else return e.call(u,a,i,o,l)}},Xa={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],o=i._private.parent;o&&r.push(o)}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:nr(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 o=a[i];r.push(o),o.children().nonempty()&&n(o.children())}}return n(this.children()),this.spawn(r,!0).filter(e)}};function oc(t,e,r,n){for(var a=[],i=new $a,o=t.cy(),l=o.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 Kb(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)}}Xa.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return oc(this,t,e,Kb)};function Gb(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}Xa.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return oc(this,t,e,Gb)};function Zq(t,e,r){Gb(t,e,r),Kb(t,e,r)}Xa.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return oc(this,t,e,Zq)},Xa.ancestors=Xa.parents;var io,Ub;io=Ub={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}},io.attr=io.data,io.removeAttr=io.removeData;var Xq=Ub,Rs={};function sc(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,o=0;o<i.length;o++){var l=i[o];!e&&l.isLoop()||(n+=t(a,l))}return n}else return}}Se(Rs,{degree:sc(function(t,e){return e.source().same(e.target())?2:1}),indegree:sc(function(t,e){return e.target().same(t)?1:0}),outdegree:sc(function(t,e){return e.source().same(t)?1:0})});function Ja(t,e){return function(r){for(var n,a=this.nodes(),i=0;i<a.length;i++){var o=a[i],l=o[t](r);l!==void 0&&(n===void 0||e(l,n))&&(n=l)}return n}}Se(Rs,{minDegree:Ja("degree",function(t,e){return t<e}),maxDegree:Ja("degree",function(t,e){return t>e}),minIndegree:Ja("indegree",function(t,e){return t<e}),maxIndegree:Ja("indegree",function(t,e){return t>e}),minOutdegree:Ja("outdegree",function(t,e){return t<e}),maxOutdegree:Ja("outdegree",function(t,e){return t>e})}),Se(Rs,{totalDegree:function(e){for(var r=0,n=this.nodes(),a=0;a<n.length;a++)r+=n[a].degree(e);return r}});var mr,jb,Wb=function(e,r,n){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var o=i._private.position,l={x:r.x!=null?r.x-o.x:0,y:r.y!=null?r.y-o.y:0};i.isParent()&&!(l.x===0&&l.y===0)&&i.children().shift(l,n),i.dirtyBoundingBoxCache()}}},Yb={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){Wb(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};mr=jb={position:Ve.data(Yb),silentPosition:Ve.data(Se({},Yb,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){Wb(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(Ae(e))r?this.silentPosition(e):this.position(e);else if(Xe(e)){var n=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var o=this[i],l=void 0;(l=n(o,i))&&(r?o.silentPosition(l):o.position(l))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,n){var a;if(Ae(e)?(a={x:de(e.x)?e.x:0,y:de(e.y)?e.y:0},n=r):Ee(e)&&de(r)&&(a={x:0,y:0},a[e]=r),a!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var l=this[o];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 Ae(e)?this.shift(e,!0):Ee(e)&&de(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var n=this[0],a=this.cy(),i=a.zoom(),o=a.pan(),l=Ae(e)?e:void 0,c=l!==void 0||r!==void 0&&Ee(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-o[e])/i):l!==void 0&&d.position(Q0(l,i,o))}else{var f=n.position();return l=bs(f,i,o),e===void 0?l:l[e]}else if(!c)return;return this},relativePosition:function(e,r){var n=this[0],a=this.cy(),i=Ae(e)?e:void 0,o=i!==void 0||r!==void 0&&Ee(e),l=a.hasCompoundNodes();if(n&&n.isNode())if(o)for(var c=0;c<this.length;c++){var u=this[c],d=l?u.parent():null,f=d&&d.length>0,h=f;f&&(d=d[0]);var v=h?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 p=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:p.x-b.x,y:p.y-b.y},e===void 0?i:i[e]}else if(!o)return;return this}},mr.modelPosition=mr.point=mr.position,mr.modelPositions=mr.points=mr.positions,mr.renderedPoint=mr.renderedPosition,mr.relativePoint=mr.relativePosition;var Jq=jb,Qa,_n;Qa=_n={},_n.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),a=r.pan(),i=e.x1*n+a.x,o=e.x2*n+a.x,l=e.y1*n+a.y,c=e.y2*n+a.y;return{x1:i,x2:o,y1:l,y2:c,w:o-i,h:c-l}},_n.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)},_n.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(o){if(!o.isParent())return;var l=o._private,c=o.children(),u=o.pstyle("compound-sizing-wrt-labels").value==="include",d={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},f=c.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),h=l.position;(f.w===0||f.h===0)&&(f={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},f.x1=h.x-f.w/2,f.x2=h.x+f.w/2,f.y1=h.y-f.h/2,f.y2=h.y+f.h/2);function v(S,T,N){var B=0,P=0,D=T+N;return S>0&&D>0&&(B=T/D*S,P=N/D*S),{biasDiff:B,biasComplementDiff:P}}function p(S,T,N,B){if(N.units==="%")switch(B){case"width":return S>0?N.pfValue*S:0;case"height":return T>0?N.pfValue*T:0;case"average":return S>0&&T>0?N.pfValue*(S+T)/2:0;case"min":return S>0&&T>0?S>T?N.pfValue*T:N.pfValue*S:0;case"max":return S>0&&T>0?S>T?N.pfValue*S:N.pfValue*T:0;default:return 0}else return N.units==="px"?N.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,k=v(d.height.val-f.h,m,b),E=k.biasDiff,_=k.biasComplementDiff;l.autoPadding=p(f.w,f.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),l.autoWidth=Math.max(f.w,d.width.val),h.x=(-C+f.x1+f.x2+x)/2,l.autoHeight=Math.max(f.h,d.height.val),h.y=(-E+f.y1+f.y2+_)/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 ar=function(e){return e===1/0||e===-1/0?0:e},yr=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)},na=function(e,r){return r==null?e:yr(e,r.x1,r.y1,r.x2,r.y2)},oo=function(e,r,n){return gr(e,r,n)},Ls=function(e,r,n){if(!r.cy().headless()){var a=r._private,i=a.rstyle,o=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-o,f.y1=u-o,f.x2=c+o,f.y2=u+o,f.w=f.x2-f.x1,f.h=f.y2-f.y1,Cs(f,1),yr(e,f.x1,f.y1,f.x2,f.y2)}}},lc=function(e,r,n){if(!r.cy().headless()){var a;n?a=n+"-":a="";var i=r._private,o=i.rstyle,l=r.pstyle(a+"label").strValue;if(l){var c=r.pstyle("text-halign"),u=r.pstyle("text-valign"),d=oo(o,"labelWidth",n),f=oo(o,"labelHeight",n),h=oo(o,"labelX",n),v=oo(o,"labelY",n),p=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,k=2,E=f,_=d,S=_/2,T=E/2,N,B,P,D;if(y)N=h-S,B=h+S,P=v-T,D=v+T;else{switch(c.value){case"left":N=h-_,B=h;break;case"center":N=h-S,B=h+S;break;case"right":N=h,B=h+_;break}switch(u.value){case"top":P=v-E,D=v;break;case"center":P=v-T,D=v+T;break;case"bottom":P=v,D=v+E;break}}N+=p-Math.max(b,C)-x-k,B+=p+Math.max(b,C)+x+k,P+=g-Math.max(b,C)-x-k,D+=g+Math.max(b,C)+x+k;var R=n||"main",O=i.labelBounds,F=O[R]=O[R]||{};F.x1=N,F.y1=P,F.x2=B,F.y2=D,F.w=B-N,F.h=D-P;var A=y&&m.strValue==="autorotate",z=m.pfValue!=null&&m.pfValue!==0;if(A||z){var j=A?oo(i.rstyle,"labelAngle",n):m.pfValue,H=Math.cos(j),G=Math.sin(j),X=(N+B)/2,M=(P+D)/2;if(!y){switch(c.value){case"left":X=B;break;case"right":X=N;break}switch(u.value){case"top":M=D;break;case"bottom":M=P;break}}var V=function(ue,ae){return ue=ue-X,ae=ae-M,{x:ue*H-ae*G+X,y:ue*G+ae*H+M}},q=V(N,P),$=V(N,D),K=V(B,P),L=V(B,D);N=Math.min(q.x,$.x,K.x,L.x),B=Math.max(q.x,$.x,K.x,L.x),P=Math.min(q.y,$.y,K.y,L.y),D=Math.max(q.y,$.y,K.y,L.y)}var W=R+"Rot",Y=O[W]=O[W]||{};Y.x1=N,Y.y1=P,Y.x2=B,Y.y2=D,Y.w=B-N,Y.h=D-P,yr(e,N,P,B,D),yr(i.labelBounds.all,N,P,B,D)}return e}},Qq=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,o=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(o)?(c=(e.w+l*2.4)/e.w,f=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(o)?c=(e.w+l*2.4)/e.w:o==="star"?(c=(e.w+l*2.8)/e.w,u=(e.h+l*2.6)/e.h,f=-l/3.8):o==="triangle"?(c=(e.w+l*2.8)/e.w,u=(e.h+l*2.4)/e.h,f=-l/1.4):o==="vee"&&(c=(e.w+l*4.4)/e.w,u=(e.h+l*3.8)/e.h,f=-l*.5);var h=e.h*u-e.h,v=e.w*c-e.w;if(Es(e,[Math.ceil(h/2),Math.ceil(v/2)]),d!=0||f!==0){var p=w5(e,d,f);tb(e,p)}}}},ez=function(e,r){var n=e._private.cy,a=n.styleEnabled(),i=n.headless(),o=Kt(),l=e._private,c=e.isNode(),u=e.isEdge(),d,f,h,v,p,g,y=l.rstyle,m=c&&a?e.pstyle("bounds-expansion").pfValue:[0],b=function(ce){return ce.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 k=0,E=0;a&&r.includeUnderlays&&(k=e.pstyle("underlay-opacity").value,k!==0&&(E=e.pstyle("underlay-padding").value));var _=Math.max(x,E),S=0,T=0;if(a&&(S=e.pstyle("width").pfValue,T=S/2),c&&r.includeNodes){var N=e.position();p=N.x,g=N.y;var B=e.outerWidth(),P=B/2,D=e.outerHeight(),R=D/2;d=p-P,f=p+P,h=g-R,v=g+R,yr(o,d,h,f,v),a&&r.includeOutlines&&Qq(o,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),h=Math.min(y.srcY,y.midY,y.tgtY),v=Math.max(y.srcY,y.midY,y.tgtY),d-=T,f+=T,h-=T,v+=T,yr(o,d,h,f,v),O==="haystack"){var F=y.haystackPts;if(F&&F.length===2){if(d=F[0].x,h=F[0].y,f=F[1].x,v=F[1].y,d>f){var A=d;d=f,f=A}if(h>v){var z=h;h=v,v=z}yr(o,d-T,h-T,f+T,v+T)}}else if(O==="bezier"||O==="unbundled-bezier"||O.endsWith("segments")||O.endsWith("taxi")){var j;switch(O){case"bezier":case"unbundled-bezier":j=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":j=y.linePts;break}if(j!=null)for(var H=0;H<j.length;H++){var G=j[H];d=G.x-T,f=G.x+T,h=G.y-T,v=G.y+T,yr(o,d,h,f,v)}}}else{var X=e.source(),M=X.position(),V=e.target(),q=V.position();if(d=M.x,f=q.x,h=M.y,v=q.y,d>f){var $=d;d=f,f=$}if(h>v){var K=h;h=v,v=K}d-=T,f+=T,h-=T,v+=T,yr(o,d,h,f,v)}if(a&&r.includeEdges&&u&&(Ls(o,e,"mid-source"),Ls(o,e,"mid-target"),Ls(o,e,"source"),Ls(o,e,"target")),a){var L=e.pstyle("ghost").value==="yes";if(L){var W=e.pstyle("ghost-offset-x").pfValue,Y=e.pstyle("ghost-offset-y").pfValue;yr(o,o.x1+W,o.y1+Y,o.x2+W,o.y2+Y)}}var se=l.bodyBounds=l.bodyBounds||{};rb(se,o),Es(se,m),Cs(se,1),a&&(d=o.x1,f=o.x2,h=o.y1,v=o.y2,yr(o,d-_,h-_,f+_,v+_));var ue=l.overlayBounds=l.overlayBounds||{};rb(ue,o),Es(ue,m),Cs(ue,1);var ae=l.labelBounds=l.labelBounds||{};ae.all!=null?b5(ae.all):ae.all=Kt(),a&&r.includeLabels&&(r.includeMainLabels&&lc(o,e,null),u&&(r.includeSourceLabels&&lc(o,e,"source"),r.includeTargetLabels&&lc(o,e,"target")))}return o.x1=ar(o.x1),o.y1=ar(o.y1),o.x2=ar(o.x2),o.y2=ar(o.y2),o.w=ar(o.x2-o.x1),o.h=ar(o.y2-o.y1),o.w>0&&o.h>0&&w&&(Es(o,m),Cs(o,1)),o},Zb=function(e){var r=0,n=function(o){return(o?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},Xb=function(e){if(e.isEdge()){var r=e.source().position(),n=e.target().position(),a=function(o){return Math.round(o)};return VM([a(r.x),a(r.y),a(n.x),a(n.y)])}else return 0},Jb=function(e,r){var n=e._private,a,i=e.isEdge(),o=r==null?Qb:Zb(r),l=o===Qb,c=Xb(e),u=n.bbCachePosKey===c,d=r.useCache&&u,f=function(g){return g._private.bbCache==null||g._private.styleDirty},h=!d||f(e)||i&&f(e.source())||f(e.target());if(h?(u||e.recalculateRenderedStyle(d),a=ez(e,so),n.bbCache=a,n.bbCachePosKey=c):a=n.bbCache,!l){var v=e.isNode();a=Kt(),(r.includeNodes&&v||r.includeEdges&&!v)&&(r.includeOverlays?na(a,n.overlayBounds):na(a,n.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?na(a,n.labelBounds.all):(r.includeMainLabels&&na(a,n.labelBounds.mainRot),r.includeSourceLabels&&na(a,n.labelBounds.sourceRot),r.includeTargetLabels&&na(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},so={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Qb=Zb(so),e1=St(so);_n.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=so:t=e1(t),e=Jb(this[0],t);else{e=Kt(),t=t||so;var r=e1(t),n=this,a=n.cy(),i=a.styleEnabled();if(i)for(var o=0;o<n.length;o++){var l=n[o],c=l._private,u=Xb(l),d=c.bbCachePosKey===u,f=r.useCache&&d&&!c.styleDirty;l.recalculateRenderedStyle(f)}this.updateCompoundBounds(!t.useCache);for(var h=0;h<n.length;h++){var v=n[h];na(e,Jb(v,r))}}return e.x1=ar(e.x1),e.y1=ar(e.y1),e.x2=ar(e.x2),e.y2=ar(e.y2),e.w=ar(e.x2-e.x1),e.h=ar(e.y2-e.y1),e},_n.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},_n.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)),Ae(t)){var i=t;t=function(){return i}}var o=function(d,f){return d._private.bbAtOldPos=t(d,f)},l=function(d){return d._private.bbAtOldPos};r.startBatch(),e.forEach(o).silentPositions(t),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var c=y5(this.boundingBox({useCache:!1}));return e.silentPositions(l),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),r.endBatch(),c},Qa.boundingbox=Qa.bb=Qa.boundingBox,Qa.renderedBoundingbox=Qa.renderedBoundingBox;var tz=_n,lo,uo;lo=uo={};var t1=function(e){e.uppercaseName=O0(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=O0(e.outerName),lo[e.name]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){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},lo["outer"+e.uppercaseName]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){var l=n[e.name](),c=n.pstyle("border-width").pfValue,u=2*n.padding();return l+c+u}else return 1},lo["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},lo["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};t1({name:"width"}),t1({name:"height"}),uo.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},uo.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()},uo.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var rz=uo,nz=function(e,r){if(e.isEdge())return r(e)},az=function(e,r){if(e.isEdge()){var n=e.cy();return bs(r(e),n.zoom(),n.pan())}},iz=function(e,r){if(e.isEdge()){var n=e.cy(),a=n.pan(),i=n.zoom();return r(e).map(function(o){return bs(o,i,a)})}},oz=function(e){return e.renderer().getControlPoints(e)},sz=function(e){return e.renderer().getSegmentPoints(e)},lz=function(e){return e.renderer().getSourceEndpoint(e)},uz=function(e){return e.renderer().getTargetEndpoint(e)},cz=function(e){return e.renderer().getEdgeMidpoint(e)},r1={controlPoints:{get:oz,mult:!0},segmentPoints:{get:sz,mult:!0},sourceEndpoint:{get:lz},targetEndpoint:{get:uz},midpoint:{get:cz}},dz=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},fz=Object.keys(r1).reduce(function(t,e){var r=r1[e],n=dz(e);return t[e]=function(){return nz(this,r.get)},r.mult?t[n]=function(){return iz(this,r.get)}:t[n]=function(){return az(this,r.get)},t},{}),hz=Se({},Jq,tz,rz,fz);/*!
36
36
  Event object based on jQuery events, MIT license
37
37
 
38
38
  https://jquery.org/license/
39
39
  https://tldrlegal.com/license/mit-license
40
40
  https://github.com/jquery/jquery/blob/master/src/event.js
41
- */var Zb=function(e,r){this.recycle(e,r)};function lo(){return!1}function Ls(){return!0}Zb.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=lo,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Ls:lo):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=Ls;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Ls;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Ls,this.stopPropagation()},isDefaultPrevented:lo,isPropagationStopped:lo,isImmediatePropagationStopped:lo};var Xb=/^([^.]+)(\.(?:[^.]+))?$/,az=".*",Jb={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},Qb=Object.keys(Jb),iz={};function Ms(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:iz,e=arguments.length>1?arguments[1]:void 0,r=0;r<Qb.length;r++){var n=Qb[r];this[n]=t[n]||Jb[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Tn=Ms.prototype,e1=function(e,r,n,a,i,o,l){Xe(a)&&(i=a,a=null),l&&(o==null?o=l:o=Se({},o,l));for(var c=Ke(n)?n:n.split(/\s+/),u=0;u<c.length;u++){var d=c[u];if(!mn(d)){var f=d.match(Xb);if(f){var h=f[1],v=f[2]?f[2]:null,p=r(e,d,h,v,a,i,o);if(p===!1)break}}}},t1=function(e,r){return e.addEventFields(e.context,r),new Zb(r.type,r)},oz=function(e,r,n){if(_M(n)){r(e,n);return}else if(Ae(n)){r(e,t1(e,n));return}for(var a=Ke(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var o=a[i];if(!mn(o)){var l=o.match(Xb);if(l){var c=l[1],u=l[2]?l[2]:null,d=t1(e,{type:c,namespace:u,target:e.context});r(e,d)}}}};Tn.on=Tn.addListener=function(t,e,r,n,a){return e1(this,function(i,o,l,c,u,d,f){Xe(d)&&i.listeners.push({event:o,callback:d,type:l,namespace:c,qualifier:u,conf:f})},t,e,r,n,a),this},Tn.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})},Tn.removeListener=Tn.off=function(t,e,r,n){var a=this;this.emitting!==0&&(this.listeners=RF(this.listeners));for(var i=this.listeners,o=function(u){var d=i[u];e1(a,function(f,h,v,p,g,m){if((d.type===v||t==="*")&&(!p&&d.namespace!==".*"||d.namespace===p)&&(!g||f.qualifierCompare(d.qualifier,g))&&(!m||d.callback===m))return i.splice(u,1),!1},t,e,r,n)},l=i.length-1;l>=0;l--)o(l);return this},Tn.removeAllListeners=function(){return this.removeListener("*")},Tn.emit=Tn.trigger=function(t,e,r){var n=this.listeners,a=n.length;return this.emitting++,Ke(e)||(e=[e]),oz(this,function(i,o){r!=null&&(n=[{event:o.event,type:o.type,namespace:o.namespace,callback:r}],a=n.length);for(var l=function(d){var f=n[d];if(f.type===o.type&&(!f.namespace||f.namespace===o.namespace||f.namespace===az)&&i.eventMatches(i.context,f,o)){var h=[o];e!=null&&MF(h,e),i.beforeEmit(i.context,f,o),f.conf&&f.conf.one&&(i.listeners=i.listeners.filter(function(g){return g!==f}));var v=i.callbackContext(i.context,f,o),p=f.callback.apply(v,h);i.afterEmit(i.context,f,o),p===!1&&(o.stopPropagation(),o.preventDefault())}},c=0;c<a;c++)l(c);i.bubble(i.context)&&!o.isPropagationStopped()&&i.parent(i.context).emit(o,e)},t),this.emitting--,this};var sz={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&&zi(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()}},Fs=function(e){return Ee(e)?new xn(e):e},r1={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],n=r._private;n.emitter||(n.emitter=new Ms(sz,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,n){for(var a=Fs(r),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,a,n)}return this},removeListener:function(e,r,n){for(var a=Fs(r),i=0;i<this.length;i++){var o=this[i];o.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=Fs(r),i=0;i<this.length;i++){var o=this[i];o.emitter().one(e,a,n)}return this},once:function(e,r,n){for(var a=Fs(r),i=0;i<this.length;i++){var o=this[i];o.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(r1);var n1={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(Ee(e)||Zt(e))return new xn(e).filter(this);if(Xe(e)){for(var n=this.spawn(),a=this,i=0;i<a.length;i++){var o=a[i],l=r?e.apply(r,[o,i,a]):e(o,i,a);l&&n.push(o)}return n}return this.spawn()},not:function(e){if(e){Ee(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(Ee(e)){var r=e;return this.filter(r)}for(var n=this.spawn(),a=this,i=e,o=this.length<e.length,l=o?a:i,c=o?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;Ee(e)&&(e=r.$(e));var n=this.spawn(),a=this,i=e,o=function(c,u){for(var d=0;d<c.length;d++){var f=c[d],h=f._private.data.id,v=u.hasElementWithId(h);v||n.push(f)}};return o(a,i),o(i,a),n},diff:function(e){var r=this._private.cy;Ee(e)&&(e=r.$(e));var n=this.spawn(),a=this.spawn(),i=this.spawn(),o=this,l=e,c=function(d,f,h){for(var v=0;v<d.length;v++){var p=d[v],g=p._private.data.id,m=f.hasElementWithId(g);m?i.merge(p):h.push(p)}};return c(o,l,n),c(l,o,a),{left:n,right:a,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(Ee(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],l=!this.has(o);l&&a.push(o)}return a},merge:function(e){var r=this._private,n=r.cy;if(!e)return this;if(e&&Ee(e)){var a=e;e=n.mutableElements().filter(a)}for(var i=r.map,o=0;o<e.length;o++){var l=e[o],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 o=e===this.length-1;if(this.length>1&&!o){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 o=i.index;return this.unmergeAt(o),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Ee(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 o=a[i],l=r?e.apply(r,[o,i,a]):e(o,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,o=0;o<i.length;o++){var l=i[o],c=r?e.apply(r,[l,o,i]):e(l,o,i);c>n&&(n=c,a=l)}return{value:n,ele:a}},min:function(e,r){for(var n=1/0,a,i=this,o=0;o<i.length;o++){var l=i[o],c=r?e.apply(r,[l,o,i]):e(l,o,i);c<n&&(n=c,a=l)}return{value:n,ele:a}}},Le=n1;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 lz={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}},a1=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"?Mu:0}var o=i(e)-i(r);if(o!==0)return o;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()},$s={forEach:function(e,r){if(Xe(e))for(var n=this.length,a=0;a<n;a++){var i=this[a],o=r?e.apply(r,[i,a,this]):e(i,a,this);if(o===!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(!Xe(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(a1)},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:Mu-1}else{var i=r.source,o=r.target,l=i.zDepth(),c=o.zDepth();return Math.max(l,c,0)}}}};$s.each=$s.forEach;var uz=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":ct(Symbol))!=e&&ct(Symbol.iterator)!=e;r&&($s[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,o=this.length;return m0({next:function(){return i<o?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};uz();var cz=xt({nodeDimensionsIncludeLabels:!1}),Vs={layoutDimensions:function(e){e=cz(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(),o=r.eles,l=function(k){return k.id()},c=Hi(n,l);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(k,E,_){var S={x:E.x1+E.w/2,y:E.y1+E.h/2},T={x:(_.x-S.x)*k,y:(_.y-S.y)*k};return{x:S.x+T.x,y:S.y+T.y}},d=r.spacingFactor&&r.spacingFactor!==1,f=function(){if(!d)return null;for(var k=Kt(),E=0;E<a.length;E++){var _=a[E],S=c(_,E);d5(k,S.x,S.y)}return k},h=f(),v=Hi(function(x,k){var E=c(x,k);if(d){var _=Math.abs(r.spacingFactor);E=u(_,h,E)}return r.transform!=null&&(E=r.transform(x,E)),E},l);if(r.animate){for(var p=0;p<a.length;p++){var g=a[p],m=v(g,p),y=r.animateFilter==null||r.animateFilter(g,p);if(y){var b=g.animation({position:m,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else g.position(m)}if(r.fit){var w=i.animation({fit:{boundingBox:o.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}),Ha.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(Se({},e,{eles:this}))}};Vs.createLayout=Vs.makeLayout=Vs.layout;function i1(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 qs(t,e){return t=Xn(t),function(n){return i1(t,e,n)}}function zs(t,e){t=Xn(t);var r=function(a){return e.call(a)};return function(){var a=this[0];if(a)return i1(t,r,a)}}var kt={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 o=i;return e?o.emitAndNotify("style"):o.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(Ae(e)){var o=e;i.applyBypass(this,o,a),this.emitAndNotify("style")}else if(Ee(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 o=0;o<i.length;o++){var l=i[o];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 o=a.data.parent?n.parents():null;if(o)for(var l=0;l<o.length;l++){var c=o[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 sc(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 lc(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],o=a.hasCompoundNodes();if(i){var l=i._private;if(!e(i))return!1;if(i.isNode())return!o||sc(i,n);var c=l.source,u=l.target;return r(c)&&(!o||sc(c,r))&&(c===u||r(u)&&(!o||sc(u,r)))}}}var Xa=qs("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});kt.takesUpSpace=zs("takesUpSpace",lc({ok:Xa}));var dz=qs("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Xa(t)}),fz=qs("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Xa(t)});kt.interactive=zs("interactive",lc({ok:dz,parentOk:fz,edgeOkViaNode:Xa})),kt.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var hz=qs("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Xa(t)}),pz=Xa;kt.visible=zs("visible",lc({ok:hz,edgeOkViaNode:pz})),kt.hidden=function(){var t=this[0];if(t)return!t.visible()},kt.isBundledBezier=zs("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),kt.bypass=kt.css=kt.style,kt.renderedCss=kt.renderedStyle,kt.removeBypass=kt.removeCss=kt.removeStyle,kt.pstyle=kt.parsedStyle;var Nn={};function o1(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&&Xe(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&Ke(e[0])){for(var o=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 h=this.spawn(r);h.updateStyle(),h.emit(t.event),o&&h.emit(o)}return this}}function Ja(t){Nn[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]}},Nn[t.on]=o1({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Nn[t.off]=o1({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Ja({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),Ja({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),Ja({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),Ja({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),Nn.deselect=Nn.unselect,Nn.grabbed=function(){var t=this[0];if(t)return t._private.grabbed},Ja({field:"active",on:"activate",off:"unactivate"}),Ja({field:"pannable",on:"panify",off:"unpanify"}),Nn.inactive=function(){var t=this[0];if(t)return!t._private.active};var It={},s1=function(e){return function(n){for(var a=this,i=[],o=0;o<a.length;o++){var l=a[o];if(l.isNode()){for(var c=!1,u=l.connectedEdges(),d=0;d<u.length;d++){var f=u[d],h=f.source(),v=f.target();if(e.noIncomingEdges&&v===l&&h!==l||e.noOutgoingEdges&&h===l&&v!==l){c=!0;break}}c||i.push(l)}}return this.spawn(i,!0).filter(n)}},l1=function(e){return function(r){for(var n=this,a=[],i=0;i<n.length;i++){var o=n[i];if(o.isNode())for(var l=o.connectedEdges(),c=0;c<l.length;c++){var u=l[c],d=u.source(),f=u.target();e.outgoing&&d===o?(a.push(u),a.push(f)):e.incoming&&f===o&&(a.push(u),a.push(d))}}return this.spawn(a,!0).filter(r)}},u1=function(e){return function(r){for(var n=this,a=[],i={};;){var o=e.outgoing?n.outgoers():n.incomers();if(o.length===0)break;for(var l=!1,c=0;c<o.length;c++){var u=o[c],d=u.id();i[d]||(i[d]=!0,a.push(u),l=!0)}if(!l)break;n=o}return this.spawn(a,!0).filter(r)}};It.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null},Se(It,{roots:s1({noIncomingEdges:!0}),leaves:s1({noOutgoingEdges:!0}),outgoers:nr(l1({outgoing:!0}),"outgoers"),successors:u1({outgoing:!0}),incomers:nr(l1({incoming:!0}),"incomers"),predecessors:u1({incoming:!0})}),Se(It,{neighborhood:nr(function(t){for(var e=[],r=this.nodes(),n=0;n<r.length;n++)for(var a=r[n],i=a.connectedEdges(),o=0;o<i.length;o++){var l=i[o],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)}}),It.neighbourhood=It.neighborhood,It.closedNeighbourhood=It.closedNeighborhood,It.openNeighbourhood=It.openNeighborhood,Se(It,{source:nr(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:nr(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:c1({attr:"source"}),targets:c1({attr:"target"})});function c1(t){return function(r){for(var n=[],a=0;a<this.length;a++){var i=this[a],o=i._private[t.attr];o&&n.push(o)}return this.spawn(n,!0).filter(r)}}Se(It,{edgesWith:nr(d1(),"edgesWith"),edgesTo:nr(d1({thisIsSrc:!0}),"edgesTo")});function d1(t){return function(r){var n=[],a=this._private.cy,i=t||{};Ee(r)&&(r=a.$(r));for(var o=0;o<r.length;o++)for(var l=r[o]._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),h=r.hasElementWithId(d.source)&&this.hasElementWithId(d.target),v=f||h;v&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!f||i.thisIsTgt&&!h)||n.push(u))}return this.spawn(n,!0)}}Se(It,{connectedEdges:nr(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,o=0;o<i.length;o++){var l=i[o];e.push(l)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:nr(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:nr(f1(),"parallelEdges"),codirectedEdges:nr(f1({codirected:!0}),"codirectedEdges")});function f1(t){var e={codirected:!1};return t=Se({},e,t),function(n){for(var a=[],i=this.edges(),o=t,l=0;l<i.length;l++)for(var c=i[l],u=c._private,d=u.source,f=d._private.data.id,h=u.data.target,v=d._private.edges,p=0;p<v.length;p++){var g=v[p],m=g._private.data,y=m.target,b=m.source,w=y===h&&b===f,C=f===y&&h===b;(o.codirected&&w||!o.codirected&&(w||C))&&a.push(g)}return this.spawn(a,!0).filter(n)}}Se(It,{components:function(e){var r=this,n=r.cy(),a=n.collection(),i=e==null?r.nodes():e.nodes(),o=[];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();o.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(h){h.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 o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),It.componentsOf=It.components;var St=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){Je("A collection must have a reference to the core");return}var i=new Ir,o=!1;if(!r)r=[];else if(r.length>0&&Ae(r[0])&&!zi(r[0])){o=!0;for(var l=[],c=new La,u=0,d=r.length;u<d;u++){var f=r[u];f.data==null&&(f.data={});var h=f.data;if(h.id==null)h.id=H0();else if(e.hasElementWithId(h.id)||c.has(h.id))continue;var v=new ms(e,f,!1);l.push(v),c.add(h.id)}r=l}this.length=0;for(var p=0,g=r.length;p<g;p++){var m=r[p][0];if(m!=null){var y=m._private.data.id;(!n||!i.has(y))&&(n&&i.set(y,{index:this.length,ele:m}),this[this.length]=m,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 Ir,C=this.eles,x=0;x<C.length;x++){var k=C[x];w.set(k.id(),{index:x,ele:k})}}},n&&(this._private.map=i),o&&!a&&this.restore()},Ge=ms.prototype=St.prototype=Object.create(Array.prototype);Ge.instanceString=function(){return"collection"},Ge.spawn=function(t,e){return new St(this.cy(),t,e)},Ge.spawnSelf=function(){return this.spawn(this)},Ge.cy=function(){return this._private.cy},Ge.renderer=function(){return this._private.cy.renderer()},Ge.element=function(){return this[0]},Ge.collection=function(){return x0(this)?this:new St(this._private.cy,[this])},Ge.unique=function(){return new St(this._private.cy,this,!0)},Ge.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)},Ge.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new St(e)},Ge.$id=Ge.getElementById,Ge.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index},Ge.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index},Ge.indexOfId=function(t){return t=""+t,this._private.map.get(t).index},Ge.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var n=e._private;if(Ae(t)){if(r.startBatch(),t.data){e.data(t.data);var a=n.data;if(e.isEdge()){var i=!1,o={},l=t.data.source,c=t.data.target;l!=null&&l!=a.source&&(o.source=""+l,i=!0),c!=null&&c!=a.target&&(o.target=""+c,i=!0),i&&(e=e.move(o))}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,m,y){var b=t[g];b!=null&&b!==n[g]&&(b?e[m]():e[y]())};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 h={data:Nr(n.data),position:Nr(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};h.classes="";var v=0;return n.classes.forEach(function(p){return h.classes+=v++===0?p:" "+p}),h}}},Ge.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],n=r.json();t.push(n)}return t},Ge.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var n=this[r],a=n.json(),i=new ms(t,a,!1);e.push(i)}return new St(t,e)},Ge.copy=Ge.clone,Ge.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=[],o=[],l,c=0,u=r.length;c<u;c++){var d=r[c];e&&!d.removed()||(d.isNode()?i.push(d):o.push(d))}l=i.concat(o);var f,h=function(){l.splice(f,1),f--};for(f=0;f<l.length;f++){var v=l[f],p=v._private,g=p.data;if(v.clearTraversalCache(),!(!e&&!p.removed)){if(g.id===void 0)g.id=H0();else if(de(g.id))g.id=""+g.id;else if(mn(g.id)||!Ee(g.id)){Je("Can not create element with invalid string ID `"+g.id+"`"),h();continue}else if(n.hasElementWithId(g.id)){Je("Can not create second element with ID `"+g.id+"`"),h();continue}}var m=g.id;if(v.isNode()){var y=p.position;y.x==null&&(y.x=0),y.y==null&&(y.y=0)}if(v.isEdge()){for(var b=v,w=["source","target"],C=w.length,x=!1,k=0;k<C;k++){var E=w[k],_=g[E];de(_)&&(_=g[E]=""+g[E]),_==null||_===""?(Je("Can not create edge `"+m+"` with unspecified "+E),x=!0):n.hasElementWithId(_)||(Je("Can not create edge `"+m+"` with nonexistant "+E+" `"+_+"`"),x=!0)}if(x){h();continue}var S=n.getElementById(g.source),T=n.getElementById(g.target);S.same(T)?S._private.edges.push(b):(S._private.edges.push(b),T._private.edges.push(b)),b._private.source=S,b._private.target=T}p.map=new Ir,p.map.set(m,{ele:v,index:0}),p.removed=!1,e&&n.addToPool(v)}for(var N=0;N<i.length;N++){var B=i[N],O=B._private.data;de(O.parent)&&(O.parent=""+O.parent);var D=O.parent,R=D!=null;if(R||B._private.parent){var P=B._private.parent?n.collection().merge(B._private.parent):n.getElementById(D);if(P.empty())O.parent=void 0;else if(P[0].removed())$e("Node added with missing parent, reference to parent removed"),O.parent=void 0,B._private.parent=null;else{for(var L=!1,A=P;!A.empty();){if(B.same(A)){L=!0,O.parent=void 0;break}A=A.parent()}L||(P[0]._private.children.push(B),B._private.parent=P[0],a.hasCompoundNodes=!0)}}}if(l.length>0){for(var q=l.length===r.length?r:new St(n,l),U=0;U<q.length;U++){var z=q[U];z.isNode()||(z.parallelEdges().clearTraversalCache(),z.source().clearTraversalCache(),z.target().clearTraversalCache())}var H;a.hasCompoundNodes?H=n.collection().merge(q).merge(q.connectedNodes()).merge(q.parent()):H=q,H.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?q.emitAndNotify("add"):e&&q.emit("add")}return r},Ge.removed=function(){var t=this[0];return t&&t._private.removed},Ge.inside=function(){var t=this[0];return t&&!t._private.removed},Ge.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 o(D){for(var R=D._private.edges,P=0;P<R.length;P++)c(R[P])}function l(D){for(var R=D._private.children,P=0;P<R.length;P++)c(R[P])}function c(D){var R=a[D.id()];e&&D.removed()||R||(a[D.id()]=!0,D.isNode()?(n.push(D),o(D),l(D)):n.unshift(D))}for(var u=0,d=r.length;u<d;u++){var f=r[u];c(f)}function h(D,R){var P=D._private.edges;bn(P,R),D.clearTraversalCache()}function v(D){D.clearTraversalCache()}var p=[];p.ids={};function g(D,R){R=R[0],D=D[0];var P=D._private.children,L=D.id();bn(P,R),R._private.parent=null,p.ids[L]||(p.ids[L]=!0,p.push(D))}r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var m=0;m<n.length;m++){var y=n[m];if(y.isEdge()){var b=y.source()[0],w=y.target()[0];h(b,y),h(w,y);for(var C=y.parallelEdges(),x=0;x<C.length;x++){var k=C[x];v(k),k.isBundledBezier()&&k.dirtyBoundingBoxCache()}}else{var E=y.parent();E.length!==0&&g(E,y)}e&&(y._private.removed=!0)}var _=i._private.elements;i._private.hasCompoundNodes=!1;for(var S=0;S<_.length;S++){var T=_[S];if(T.isParent()){i._private.hasCompoundNodes=!0;break}}var N=new St(this.cy(),n);N.size()>0&&(t?N.emitAndNotify("remove"):e&&N.emit("remove"));for(var B=0;B<p.length;B++){var O=p[B];(!e||!O.removed())&&O.updateStyle()}return N},Ge.move=function(t){var e=this._private.cy,r=this,n=!1,a=!1,i=function(p){return p==null?p:""+p};if(t.source!==void 0||t.target!==void 0){var o=i(t.source),l=i(t.target),c=o!=null&&e.hasElementWithId(o),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 p=r[v],g=p._private.data;p.isEdge()&&(c&&(g.source=o),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 h=d===null?void 0:d;e.batch(function(){var v=r.remove(n,a);v.emitAndNotify("moveout");for(var p=0;p<r.length;p++){var g=r[p],m=g._private.data;g.isNode()&&(m.parent=h)}v.restore(n,a)}),r.emitAndNotify("move")}}return this},[gb,Sq,Ps,Sn,Wa,qq,As,nz,r1,n1,lz,$s,Vs,kt,Nn,It].forEach(function(t){Se(Ge,t)});var vz={add:function(e){var r,n=this;if(Zt(e)){var a=e;if(a._private.cy===n)r=a.restore();else{for(var i=[],o=0;o<a.length;o++){var l=a[o];i.push(l.json())}r=new St(n,i)}}else if(Ke(e)){var c=e;r=new St(n,c)}else if(Ae(e)&&(Ke(e.nodes)||Ke(e.edges))){for(var u=e,d=[],f=["nodes","edges"],h=0,v=f.length;h<v;h++){var p=f[h],g=u[p];if(Ke(g))for(var m=0,y=g.length;m<y;m++){var b=Se({group:p},g[m]);d.push(b)}}r=new St(n,d)}else{var w=e;r=new ms(n,w).collection()}return r},remove:function(e){if(!Zt(e)){if(Ee(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 gz(t,e,r,n){var a=4,i=.001,o=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 h=d?new Float32Array(c):new Array(c);function v(T,N){return 1-3*N+3*T}function p(T,N){return 3*N-6*T}function g(T){return 3*T}function m(T,N,B){return((v(N,B)*T+p(N,B))*T+g(N))*T}function y(T,N,B){return 3*v(N,B)*T*T+2*p(N,B)*T+g(N)}function b(T,N){for(var B=0;B<a;++B){var O=y(N,t,r);if(O===0)return N;var D=m(N,t,r)-T;N-=D/O}return N}function w(){for(var T=0;T<c;++T)h[T]=m(T*u,t,r)}function C(T,N,B){var O,D,R=0;do D=N+(B-N)/2,O=m(D,t,r)-T,O>0?B=D:N=D;while(Math.abs(O)>o&&++R<l);return D}function x(T){for(var N=0,B=1,O=c-1;B!==O&&h[B]<=T;++B)N+=u;--B;var D=(T-h[B])/(h[B+1]-h[B]),R=N+D*u,P=y(R,t,r);return P>=i?b(T,R):P===0?R:C(T,N,N+u)}var k=!1;function E(){k=!0,(t!==e||r!==n)&&w()}var _=function(N){return k||E(),t===e&&r===n?N:N===0?0:N===1?1:m(x(N),e,n)};_.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var S="generateBezier("+[t,e,r,n]+")";return _.toString=function(){return S},_}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var mz=function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,a,i){var o={x:n.x+i.dx*a,v:n.v+i.dv*a,tension:n.tension,friction:n.friction};return{dx:o.v,dv:t(o)}}function r(n,a){var i={dx:n.v,dv:t(n)},o=e(n,a*.5,i),l=e(n,a*.5,o),c=e(n,a,l),u=1/6*(i.dx+2*(o.dx+l.dx)+c.dx),d=1/6*(i.dv+2*(o.dv+l.dv)+c.dv);return n.x=n.x+u*a,n.v=n.v+d*a,n}return function n(a,i,o){var l={x:-1,v:0,tension:null,friction:null},c=[0],u=0,d=1/1e4,f=16/1e3,h,v,p;for(a=parseFloat(a)||500,i=parseFloat(i)||20,o=o||null,l.tension=a,l.friction=i,h=o!==null,h?(u=n(a,i),v=u/o*f):v=f;p=r(p||l,v),c.push(1+p.x),u+=16,Math.abs(p.x)>d&&Math.abs(p.v)>d;);return h?function(g){return c[g*(c.length-1)|0]}:u}}(),Ue=function(e,r,n,a){var i=gz(e,r,n,a);return function(o,l,c){return o+(l-o)*i(c)}},Hs={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 Hs.linear;var a=mz(e,r,n);return function(i,o,l){return i+(o-i)*a(l)}},"cubic-bezier":Ue};function h1(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 p1(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Qa(t,e,r,n,a){var i=a!=null?a.type:null;r<0?r=0:r>1&&(r=1);var o=p1(t,a),l=p1(e,a);if(de(o)&&de(l))return h1(i,o,l,r,n);if(Ke(o)&&Ke(l)){for(var c=[],u=0;u<l.length;u++){var d=o[u],f=l[u];if(d!=null&&f!=null){var h=h1(i,d,f,r,n);c.push(h)}else c.push(f)}return c}}function yz(t,e,r,n){var a=!n,i=t._private,o=e._private,l=o.easing,c=o.startTime,u=n?t:t.cy(),d=u.style();if(!o.easingImpl)if(l==null)o.easingImpl=Hs.linear;else{var f;if(Ee(l)){var h=d.parse("transition-timing-function",l);f=h.value}else f=l;var v,p;Ee(f)?(v=f,p=[]):(v=f[1],p=f.slice(2).map(function(q){return+q})),p.length>0?(v==="spring"&&p.push(o.duration),o.easingImpl=Hs[v].apply(null,p)):o.easingImpl=Hs[v]}var g=o.easingImpl,m;if(o.duration===0?m=1:m=(r-c)/o.duration,o.applying&&(m=o.progress),m<0?m=0:m>1&&(m=1),o.delay==null){var y=o.startPosition,b=o.position;if(b&&a&&!t.locked()){var w={};uo(y.x,b.x)&&(w.x=Qa(y.x,b.x,m,g)),uo(y.y,b.y)&&(w.y=Qa(y.y,b.y,m,g)),t.position(w)}var C=o.startPan,x=o.pan,k=i.pan,E=x!=null&&n;E&&(uo(C.x,x.x)&&(k.x=Qa(C.x,x.x,m,g)),uo(C.y,x.y)&&(k.y=Qa(C.y,x.y,m,g)),t.emit("pan"));var _=o.startZoom,S=o.zoom,T=S!=null&&n;T&&(uo(_,S)&&(i.zoom=Ji(i.minZoom,Qa(_,S,m,g),i.maxZoom)),t.emit("zoom")),(E||T)&&t.emit("viewport");var N=o.style;if(N&&N.length>0&&a){for(var B=0;B<N.length;B++){var O=N[B],D=O.name,R=O,P=o.startStyle[D],L=d.properties[P.name],A=Qa(P,R,m,g,L);d.overrideBypass(t,D,A)}t.emit("style")}}return o.progress=m,m}function uo(t,e){return t==null||e==null?!1:de(t)&&de(e)?!0:!!(t&&e)}function bz(t,e,r,n){var a=e._private;a.started=!0,a.startTime=r-a.progress*a.duration}function v1(t,e){var r=e._private.aniEles,n=[];function a(d,f){var h=d._private,v=h.animation.current,p=h.animation.queue,g=!1;if(v.length===0){var m=p.shift();m&&v.push(m)}for(var y=function(k){for(var E=k.length-1;E>=0;E--){var _=k[E];_()}k.splice(0,k.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,y(C.frames);continue}!C.playing&&!C.applying||(C.playing&&C.applying&&(C.applying=!1),C.started||bz(d,w,t),yz(d,w,t,f),C.applying&&(C.applying=!1),y(C.frames),C.step!=null&&C.step(t),w.completed()&&(v.splice(b,1),C.hooked=!1,C.playing=!1,C.started=!1,y(C.completes)),g=!0)}return!f&&v.length===0&&p.length===0&&n.push(d),g}for(var i=!1,o=0;o<r.length;o++){var l=r[o],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 wz={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&&ps(function(i){v1(i,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,o){v1(o,e)},n.beforeRenderPriorities.animations):r()}},Cz={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&&zi(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}},Ks=function(e){return Ee(e)?new xn(e):e},g1={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Ms(Cz,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,Ks(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,Ks(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,Ks(r),n),this},once:function(e,r,n){return this.emitter().one(e,Ks(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(g1);var uc={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)}};uc.jpeg=uc.jpg;var Gs={layout:function(e){var r=this;if(e==null){Je("Layout options must be specified to make a layout");return}if(e.name==null){Je("A `name` must be specified to make a layout");return}var n=e.name,a=r.extension("layout",n);if(a==null){Je("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;Ee(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var o=new a(Se({},e,{cy:r,eles:i}));return o}};Gs.createLayout=Gs.makeLayout=Gs.layout;var Ez={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],o=e[i],l=r.getElementById(i);l.data(o)}})}},xz=xt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),cc={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){Je("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&&$e("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=xz(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)}};cc.invalidateDimensions=cc.resize;var Us={collection:function(e,r){return Ee(e)?this.$(e):Zt(e)?e.collection():Ke(e)?(r||(r={}),new St(this,e,r.unique,r.removed)):new St(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}};Us.elements=Us.filter=Us.$;var Bt={},co="t",kz="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 o=t[i],l=e.getContextMeta(o);if(!l.empty){var c=e.getContextStyle(l),u=e.applyContextStyle(l,c,o);o._private.appliedInitStyle?e.updateTransitions(o,u.diffProps):o._private.appliedInitStyle=!0;var d=e.updateStyleHints(o);d&&a.push(o)}}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 o=[],l={},c=0;c<r.length;c++){var u=r[c],d=t[c]===co,f=e[c]===co,h=d!==f,v=u.mappedProperties.length>0;if(h||f&&v){var p=void 0;h&&v||h?p=u.properties:v&&(p=u.mappedProperties);for(var g=0;g<p.length;g++){for(var m=p[g],y=m.name,b=!1,w=c+1;w<r.length;w++){var C=r[w],x=e[w]===co;if(x&&(b=C.properties[m.name]!=null,b))break}!l[y]&&!b&&(l[y]=!0,o.push(y))}}}return n[a]=o,o},Bt.getContextMeta=function(t){for(var e=this,r="",n,a=t._private.styleCxtKey||"",i=0;i<e.length;i++){var o=e[i],l=o.selector&&o.selector.matches(t);l?r+=co:r+=kz}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 o=r[i],l=e[i]===co;if(l)for(var c=0;c<o.properties.length;c++){var u=o.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={},o=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===o.fn&&d!=null&&d.mapping!=null&&d.mapping.value===u.value){var f=d.mapping,h=f.fnValue=u.value(r);if(h===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(Y,se,ce){return r.getPropertiesHash(Y,se,ce)},o=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]=[Ra,ji]}for(var f=function(Y,se){return e.styleKeys[se][0]=Wi(Y,e.styleKeys[se][0])},h=function(Y,se){return e.styleKeys[se][1]=Yi(Y,e.styleKeys[se][1])},v=function(Y,se){f(Y,se),h(Y,se)},p=function(Y,se){for(var ce=0;ce<Y.length;ce++){var ae=Y.charCodeAt(ce);f(ae,se),h(ae,se)}},g=2e9,m=function(Y){return-128<Y&&Y<128&&Math.floor(Y)!==Y?g-(Y*1024|0):Y},y=0;y<n.length;y++){var b=n[y],w=c[b];if(w!=null){var C=this.properties[b],x=C.type,k=C.groupKey,E=void 0;C.hashOverride!=null?E=C.hashOverride(t,w):w.pfValue!=null&&(E=w.pfValue);var _=C.enums==null?w.value:null,S=E!=null,T=_!=null,N=S||T,B=w.units;if(x.number&&N&&!x.multiple){var O=S?E:_;v(m(O),k),!S&&B!=null&&p(B,k)}else p(w.strValue,k)}}for(var D=[Ra,ji],R=0;R<a.length;R++){var P=a[R],L=e.styleKeys[P];D[0]=Wi(L[0],D[0]),D[1]=Yi(L[1],D[1])}e.styleKey=IF(D[0],D[1]);var A=e.styleKeys;e.labelDimsKey=yn(A.labelDimensions);var q=i(t,["label"],A.labelDimensions);if(e.labelKey=yn(q),e.labelStyleKey=yn(vs(A.commonLabel,q)),!l){var U=i(t,["source-label"],A.labelDimensions);e.sourceLabelKey=yn(U),e.sourceLabelStyleKey=yn(vs(A.commonLabel,U));var z=i(t,["target-label"],A.labelDimensions);e.targetLabelKey=yn(z),e.targetLabelStyleKey=yn(vs(A.commonLabel,z))}if(l){var H=e.styleKeys,Q=H.nodeBody,F=H.nodeBorder,$=H.nodeOutline,V=H.backgroundImage,G=H.compound,j=H.pie,M=[Q,F,$,V,G,j].filter(function(W){return W!=null}).reduce(vs,[Ra,ji]);e.nodeKey=yn(M),e.hasPie=j!=null&&j[0]!==Ra&&j[1]!==ji}return o!==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,o=r.types,l=r.properties[n.name].type,c=n.bypass,u=a[n.name],d=u&&u.bypass,f=t._private,h="mapping",v=function(Q){return Q==null?null:Q.pfValue!=null?Q.pfValue:Q.value},p=function(){var Q=v(u),F=v(n);r.checkTriggers(t,n.name,Q,F)};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,p(),!0;if(n.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,p(),!0):!1:(p(),!0);if(n.deleteBypass)return u?u.bypass?(a[n.name]=u.bypassed,p(),!0):!1:(p(),!0);var g=function(){$e("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 o.mapData:{for(var m=n.field.split("."),y=f.data,b=0;b<m.length&&y;b++){var w=m[b];y=y[w]}if(y==null)return g(),!1;var C;if(de(y)){var x=n.fieldMax-n.fieldMin;x===0?C=0:C=(y-n.fieldMin)/x}else return $e("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+y+"` for `"+t.id()+"` is non-numeric)"),!1;if(C<0?C=0:C>1&&(C=1),l.color){var k=n.valueMin[0],E=n.valueMax[0],_=n.valueMin[1],S=n.valueMax[1],T=n.valueMin[2],N=n.valueMax[2],B=n.valueMin[3]==null?1:n.valueMin[3],O=n.valueMax[3]==null?1:n.valueMax[3],D=[Math.round(k+(E-k)*C),Math.round(_+(S-_)*C),Math.round(T+(N-T)*C),Math.round(B+(O-B)*C)];i={bypass:n.bypass,name:n.name,value:D,strValue:"rgb("+D[0]+", "+D[1]+", "+D[2]+")"}}else if(l.number){var R=n.valueMin+(n.valueMax-n.valueMin)*C;i=this.parse(n.name,R,n.bypass,h)}else return!1;if(!i)return g(),!1;i.mapping=n,n=i;break}case o.data:{for(var P=n.field.split("."),L=f.data,A=0;A<P.length&&L;A++){var q=P[A];L=L[q]}if(L!=null&&(i=this.parse(n.name,L,n.bypass,h)),!i)return g(),!1;i.mapping=n,n=i;break}case o.fn:{var U=n.value,z=n.fnValue!=null?n.fnValue:U(t);if(n.prevFnValue=z,z==null)return $e("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(n.name,z,n.bypass,h),!i)return $e("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=Nr(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,p(),!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),o=0;o<i.length;o++){var l=i[o],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,o=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),h=e[d];if(h){var v=h.prev,p=v,g=h.next!=null?h.next:f,m=!1,y=void 0,b=1e-6;p&&(de(p.pfValue)&&de(g.pfValue)?(m=g.pfValue-p.pfValue,y=p.pfValue+b*m):de(p.value)&&de(g.value)?(m=g.value-p.value,y=p.value+b*m):Ke(p.value)&&Ke(g.value)&&(m=p.value[0]!==g.value[0]||p.value[1]!==g.value[1]||p.value[2]!==g.value[2],y=p.strValue),m&&(l[d]=g.strValue,this.applyBypass(t,d,y),c=!0))}}if(!c)return;n.transitioning=!0,new Ha(function(w){o>0?t.delayAnimation(o).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 o=this.properties[e],l=a(o);l!=null&&l(r,n)&&i(o)},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 fo={};fo.applyBypass=function(t,e,r,n){var a=this,i=[],o=!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(Ee(e)){var f=this.parse(e,r,!0);f&&i.push(f)}else if(Ae(e)){var h=e;n=r;for(var v=Object.keys(h),p=0;p<v.length;p++){var g=v[p],m=h[g];if(m===void 0&&(m=h[ds(g)]),m!==void 0){var y=this.parse(g,m,!0);y&&i.push(y)}}}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={},k=void 0,E=0;E<i.length;E++){var _=i[E];if(n){var S=C.pstyle(_.name);k=x[_.name]={prev:S}}b=this.applyParsedProperty(C,Nr(_))||b,n&&(k.next=C.pstyle(_.name))}b&&this.updateStyleHints(C),n&&this.updateTransitions(C,x,o)}return b},fo.overrideBypass=function(t,e,r){e=Au(e);for(var n=0;n<t.length;n++){var a=t[n],i=a._private.style[e],o=this.properties[e].type,l=o.color,c=o.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)}},fo.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)},fo.removeBypasses=function(t,e,r){for(var n=!0,a=0;a<t.length;a++){for(var i=t[a],o={},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="",h=this.parse(c,f,!0),v=o[u.name]={prev:d};this.applyParsedProperty(i,h),v.next=i.pstyle(u.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,o,n)}};var dc={};dc.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1},dc.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 Br={};Br.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)},Br.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],o=r.getStylePropertyValue(t,i.name,e);o!=null&&(n[i.name]=o,n[ds(i.name)]=o)}return n}},Br.getIndexedStyle=function(t,e,r,n){var a=t.pstyle(e)[r][n];return a??t.cy().style().getDefaultProperty(e)[r][0]},Br.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,o=t.pstyle(a.name);if(o){var l=o.value,c=o.units,u=o.strValue;if(r&&i.number&&l!=null&&de(l)){var d=t.cy().zoom(),f=function(m){return m*d},h=function(m,y){return f(m)+y},v=Ke(l),p=v?c.every(function(g){return g!=null}):c!=null;return p?v?l.map(function(g,m){return h(g,c[m])}).join(" "):h(l,c):v?l.map(function(g){return Ee(g)?g:""+f(g)}).join(" "):""+f(l)}else if(u!=null)return u}return null}},Br.getAnimationStartStyle=function(t,e){for(var r={},n=0;n<e.length;n++){var a=e[n],i=a.name,o=t.pstyle(i);o!==void 0&&(Ae(o)?o=this.parse(i,o.strValue):o=this.parse(i,o)),o&&(r[i]=o)}return r},Br.getPropsList=function(t){var e=this,r=[],n=t,a=e.properties;if(n)for(var i=Object.keys(n),o=0;o<i.length;o++){var l=i[o],c=n[l],u=a[l]||a[Au(l)],d=this.parse(u.name,c);d&&r.push(d)}return r},Br.getNonDefaultPropertiesHash=function(t,e,r){var n=r.slice(),a,i,o,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]=Wi(l,n[0]),n[1]=Yi(l,n[1]);else for(o=i.strValue,u=0;u<o.length;u++)l=o.charCodeAt(u),n[0]=Wi(l,n[0]),n[1]=Yi(l,n[1]);return n},Br.getPropertiesHash=Br.getNonDefaultPropertiesHash;var js={};js.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,o=Object.keys(i);e.selector(a);for(var l=0;l<o.length;l++){var c=o[l],u=i[c];e.css(c,u)}}return e},js.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e},js.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],n=r.selector,a=r.properties,i={},o=0;o<a.length;o++){var l=a[o];i[l.name]=l.strValue}t.push({selector:n?n.toString():"core",style:i})}return t};var fc={};fc.appendFromString=function(t){var e=this,r=this,n=""+t,a,i,o;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function l(){n.length>a.length?n=n.substr(a.length):n=""}function c(){i.length>o.length?i=i.substr(o.length):i=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var d=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){$e("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 h=new xn(f);if(h.invalid){$e("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),l();continue}}var v=d[2],p=!1;i=v;for(var g=[];;){var m=i.match(/^\s*$/);if(m)break;var y=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!y){$e("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+v),p=!0;break}o=y[0];var b=y[1],w=y[2],C=e.properties[b];if(!C){$e("Skipping property: Invalid property name in: "+o),c();continue}var x=r.parse(b,w);if(!x){$e("Skipping property: Invalid property definition in: "+o),c();continue}g.push({name:b,val:w}),c()}if(p){l();break}r.selector(f);for(var k=0;k<g.length;k++){var E=g[k];r.css(E.name,E.val)}l()}return r},fc.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var _t={};(function(){var t=ft,e=OM,r=AM,n=RM,a=LM,i=function(M){return"^"+M+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(M){var W=t+"|\\w+|"+e+"|"+r+"|"+n+"|"+a;return"^"+M+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+W+")\\s*\\,\\s*("+W+")\\)$"},l=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];_t.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:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("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(M,W){switch(M.length){case 2:return W[0]!=="deg"&&W[0]!=="rad"&&W[1]!=="deg"&&W[1]!=="rad";case 1:return Ee(M[0])||W[0]==="deg"||W[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(M){var W=M.length;return W===1||W===2||W===4}}};var c={zeroNonZero:function(M,W){return(M==null||W==null)&&M!==W||M==0&&W!=0?!0:M!=0&&W==0},any:function(M,W){return M!=W},emptyNonEmpty:function(M,W){var Y=mn(M),se=mn(W);return Y&&!se||!Y&&se}},u=_t.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}],h=[{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}],p=[{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}],m=[{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}],y=[{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(M,W){return W.value==="label"?-M.poolIndex():W.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}],k=[{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}],E=[{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}],_=[{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}],T=[{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}],N=[{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}],B=[{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}],O=[];_t.pieBackgroundN=16,O.push({name:"pie-size",type:u.sizeMaybePercent});for(var D=1;D<=_t.pieBackgroundN;D++)O.push({name:"pie-"+D+"-background-color",type:u.color}),O.push({name:"pie-"+D+"-background-size",type:u.percent}),O.push({name:"pie-"+D+"-background-opacity",type:u.zeroOneNumber});var R=[],P=_t.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(j){P.forEach(function(M){var W=M+"-"+j.name,Y=j.type,se=j.triggersBounds;R.push({name:W,type:Y,triggersBounds:se})})},{});var L=_t.properties=[].concat(g,w,m,y,b,N,p,v,d,f,h,x,k,E,_,O,S,T,R,B),A=_t.propertyGroups={behavior:g,transition:w,visibility:m,overlay:y,underlay:b,ghost:N,commonLabel:p,labelDimensions:v,mainLabel:d,sourceLabel:f,targetLabel:h,nodeBody:x,nodeBorder:k,nodeOutline:E,backgroundImage:_,pie:O,compound:S,edgeLine:T,edgeArrow:R,core:B},q=_t.propertyGroupNames={},U=_t.propertyGroupKeys=Object.keys(A);U.forEach(function(j){q[j]=A[j].map(function(M){return M.name}),A[j].forEach(function(M){return M.groupKey=j})});var z=_t.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"}];_t.propertyNames=L.map(function(j){return j.name});for(var H=0;H<L.length;H++){var Q=L[H];L[Q.name]=Q}for(var F=0;F<z.length;F++){var $=z[F],V=L[$.pointsTo],G={name:$.name,alias:!0,pointsTo:V};L.push(G),L[$.name]=G}})(),_t.getDefaultProperty=function(t){return this.getDefaultProperties()[t]},_t.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=Se({"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<=_t.pieBackgroundN;d++){var f=u.name.replace("{{i}}",d),h=u.value;c[f]=h}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 _t.arrowPrefixes.forEach(function(d){var f=d+"-"+u.name,h=u.value;c[f]=h}),c},{})),r={},n=0;n<this.properties.length;n++){var a=this.properties[n];if(!a.pointsTo){var i=a.name,o=e[i],l=this.parse(i,o);r[i]=l}}return t.defaultProperties=r,t.defaultProperties},_t.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 Ws={};Ws.parse=function(t,e,r,n){var a=this;if(Xe(e))return a.parseImplWarn(t,e,r,n);var i=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,o=r?"t":"f",l=""+e,c=F0(t,l,o,i),u=a.propCache=a.propCache||[],d;return(d=u[c])||(d=u[c]=a.parseImplWarn(t,e,r,n)),(r||n==="mapping")&&(d=Nr(d),d&&(d.value=Nr(d.value))),d},Ws.parseImplWarn=function(t,e,r,n){var a=this.parseImpl(t,e,r,n);return!a&&e!=null&&$e("The style property `".concat(t,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&$e("The style value of `label` is deprecated for `"+a.name+"`"),a},Ws.parseImpl=function(t,e,r,n){var a=this;t=Au(t);var i=a.properties[t],o=e,l=a.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var c=Ee(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(Xe(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 h=l.data;return{name:t,value:d,strValue:""+e,mapped:h,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 p=this.parse(t,f[4]);if(!p||p.mapped)return!1;var g=this.parse(t,f[5]);if(!g||g.mapped)return!1;if(p.pfValue===g.pfValue||p.strValue===g.strValue)return $e("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+p.strValue+"`"),this.parse(t,p.strValue);if(u.color){var m=p.value,y=g.value,b=m[0]===y[0]&&m[1]===y[1]&&m[2]===y[2]&&(m[3]===y[3]||(m[3]==null||m[3]===1)&&(y[3]==null||y[3]===1));if(b)return!1}return{name:t,value:f,strValue:""+e,mapped:v,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:p.value,valueMax:g.value,bypass: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=[],k=[],E="",_=!1,S=0;S<w.length;S++){var T=a.parse(t,w[S],r,"multiple");_=_||Ee(T.value),C.push(T.value),k.push(T.pfValue!=null?T.pfValue:T.value),x.push(T.units),E+=(S>0?" ":"")+T.strValue}return u.validate&&!u.validate(C,x)?null:u.singleEnum&&_?C.length===1&&Ee(C[0])?{name:t,value:C[0],strValue:C[0],bypass:r}:null:{name:t,value:C,pfValue:k,strValue:E,bypass:r,units:x}}var N=function(){for(var M=0;M<u.enums.length;M++){var W=u.enums[M];if(W===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(u.number){var B,O="px";if(u.units&&(B=u.units),u.implicitUnits&&(O=u.implicitUnits),!u.unitless)if(c){var D="px|em"+(u.allowPercent?"|\\%":"");B&&(D=B);var R=e.match("^("+ft+")("+D+")?$");R&&(e=R[1],B=R[2]||O)}else(!B||u.implicitUnits)&&(B=O);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=o,N();if(u.integer&&!SM(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 P={name:t,value:e,strValue:""+e+(B||""),units:B,bypass:r};return u.unitless||B!=="px"&&B!=="em"?P.pfValue=e:P.pfValue=B==="px"||!B?e:this.getEmSizeInPixels()*e,(B==="ms"||B==="s")&&(P.pfValue=B==="ms"?e:1e3*e),(B==="deg"||B==="rad")&&(P.pfValue=B==="rad"?e:i5(e)),B==="%"&&(P.pfValue=e/100),P}else if(u.propList){var L=[],A=""+e;if(A!=="none"){for(var q=A.split(/\s*,\s*|\s+/),U=0;U<q.length;U++){var z=q[U].trim();a.properties[z]?L.push(z):$e("`"+z+"` is not a valid property name")}if(L.length===0)return null}return{name:t,value:L,strValue:L.length===0?"none":L.join(" "),bypass:r}}else if(u.color){var H=zM(e);return H?{name:t,value:H,pfValue:H,strValue:"rgb("+H[0]+","+H[1]+","+H[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var Q=N();if(Q)return Q}for(var F=u.regexes?u.regexes:[u.regex],$=0;$<F.length;$++){var V=new RegExp(F[$]),G=V.exec(e);if(G)return{name:t,value:u.singleRegexMatchValue?G[1]:G,strValue:""+e,bypass:r}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:r}:u.enums?N():null};var Dt=function t(e){if(!(this instanceof t))return new t(e);if(!Pu(e)){Je("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Ot=Dt.prototype;Ot.instanceString=function(){return"style"},Ot.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},Ot.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},Ot.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)},Ot.selector=function(t){var e=t==="core"?null:new xn(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this},Ot.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[ds(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this},Ot.style=Ot.css,Ot.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},Ot.append=function(t){return k0(t)?t.appendToStyle(this):Ke(t)?this.appendFromJson(t):Ee(t)&&this.appendFromString(t),this},Dt.fromJson=function(t,e){var r=new Dt(t);return r.fromJson(e),r},Dt.fromString=function(t,e){return new Dt(t).fromString(e)},[Bt,fo,dc,Br,js,fc,_t,Ws].forEach(function(t){Se(Ot,t)}),Dt.types=Ot.types,Dt.properties=Ot.properties,Dt.propertyGroups=Ot.propertyGroups,Dt.propertyGroupNames=Ot.propertyGroupNames,Dt.propertyGroupKeys=Ot.propertyGroupKeys;var Sz={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return k0(e)?r.style=e.generateStyle(this):Ke(e)?r.style=Dt.fromJson(this,e):Ee(e)?r.style=Dt.fromString(this,e):r.style=Dt(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},_z="single",aa={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=_z),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,o,l;switch(e.length){case 0:return r;case 1:if(Ee(e[0]))return n=e[0],r[n];if(Ae(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,l=i.y,de(o)&&(r.x=o),de(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")&&de(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,o,l,c,u;if(!this._private.panningEnabled)return this;switch(n.length){case 1:Ae(e)&&(l=n[0],c=l.x,u=l.y,de(c)&&(a.x+=c),de(u)&&(a.y+=u),this.emit("pan viewport"));break;case 2:i=e,o=r,(i==="x"||i==="y")&&de(o)&&(a[i]+=o),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(de(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(Ee(e)){var a=e;e=this.$(a)}else if(NM(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 Zt(e)||(e=this.mutableElements());if(!(Zt(e)&&e.empty())){n=n||e.boundingBox();var o=this.width(),l=this.height(),c;if(r=de(r)?r:0,!isNaN(o)&&!isNaN(l)&&o>0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){c=Math.min((o-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:(o-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 de(e)&&de(r)&&e<=r?(n.minZoom=e,n.maxZoom=r):de(e)&&r===void 0&&e<=n.maxZoom?n.minZoom=e:de(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,o,l=!1;if(r.zoomingEnabled||(l=!0),de(e)?o=e:Ae(e)&&(o=e.level,e.position!=null?i=ys(e.position,a,n):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(l=!0)),o=o>r.maxZoom?r.maxZoom:o,o=o<r.minZoom?r.minZoom:o,l||!de(o)||o===a||i!=null&&(!de(i.x)||!de(i.y)))return null;if(i!=null){var c=n,u=a,d=o,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:o,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=[],o=!1,l=!1;if(!e)return this;if(de(e.zoom)||(n=!1),Ae(e.pan)||(a=!1),!n&&!a)return this;if(n){var c=e.zoom;c<r.minZoom||c>r.maxZoom||!r.zoomingEnabled?o=!0:(r.zoom=c,i.push("zoom"))}if(a&&(!o||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;de(u.x)&&(r.pan.x=u.x,l=!1),de(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(Ee(e)){var n=e;e=this.mutableElements().filter(n)}else Zt(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),o=this.height();r=r===void 0?this._private.zoom:r;var l={x:(i-r*(a.x1+a.x2))/2,y:(o-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}};aa.centre=aa.center,aa.autolockNodes=aa.autolock,aa.autoungrabifyNodes=aa.autoungrabify;var ho={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})};ho.attr=ho.data,ho.removeAttr=ho.removeData;var po=function(e){var r=this;e=Se({},e);var n=e.container;n&&!cs(n)&&cs(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 o=dt!==void 0&&n!==void 0&&!e.headless,l=e;l.layout=Se({name:o?"grid":"null"},l.layout),l.renderer=Se({name:o?"canvas":"null"},l.renderer);var c=function(p,g,m){return g!==void 0?g:m!==void 0?m:p},u=this._private={container:n,ready:!1,options:l,elements:new St(this),listeners:[],aniEles:new St(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?o:l.styleEnabled,zoom:de(l.zoom)?l.zoom:1,pan:{x:Ae(l.pan)&&de(l.pan.x)?l.pan.x:0,y:Ae(l.pan)&&de(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(p,g){var m=p.some(IM);if(m)return Ha.all(p).then(g);g(p)};u.styleEnabled&&r.setStyle([]);var f=Se({},l,l.renderer);r.initRenderer(f);var h=function(p,g,m){r.notifications(!1);var y=r.mutableElements();y.length>0&&y.remove(),p!=null&&(Ae(p)||Ke(p))&&r.add(p),r.one("layoutready",function(w){r.notifications(!0),r.emit(w),r.one("load",g),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",m),r.emit("done")});var b=Se({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};d([l.style,l.elements],function(v){var p=v[0],g=v[1];u.styleEnabled&&r.style().append(p),h(g,function(){r.startAnimationLoop(),u.ready=!0,Xe(l.ready)&&r.on("ready",l.ready);for(var m=0;m<i.length;m++){var y=i[m];r.on("ready",y)}a&&(a.readies=[]),r.emit("ready")},l.done)})},Ys=po.prototype;Se(Ys,{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 dt;var r=this._private.container.ownerDocument;return r===void 0||r==null?dt:r.defaultView||dt},mount:function(e){if(e!=null){var r=this,n=r._private,a=n.options;return!cs(e)&&cs(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),n.container=e,n.styleEnabled=!0,r.invalidateSize(),r.initRenderer(Se({},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 Nr(this._private.options)},json:function(e){var r=this,n=r._private,a=r.mutableElements(),i=function(C){return r.getElementById(C.id())};if(Ae(e)){if(r.startBatch(),e.elements){var o={},l=function(C,x){for(var k=[],E=[],_=0;_<C.length;_++){var S=C[_];if(!S.data.id){$e("cy.json() cannot handle elements without an ID attribute");continue}var T=""+S.data.id,N=r.getElementById(T);o[T]=!0,N.length!==0?E.push({ele:N,json:S}):(x&&(S.group=x),k.push(S))}r.add(k);for(var B=0;B<E.length;B++){var O=E[B],D=O.ele,R=O.json;D.json(R)}};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 h=r.collection();a.filter(function(w){return!o[w.id()]}).forEach(function(w){w.isParent()?h.merge(w):w.remove()}),h.forEach(function(w){return w.children().move({parent:null})}),h.forEach(function(w){return i(w).remove()})}e.style&&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"],p=0;p<v.length;p++){var g=v[p];e[g]!=null&&r[g](e[g])}return r.endBatch(),this}else{var m=!!e,y={};m?y.elements=this.elements().map(function(w){return w.json()}):(y.elements={},a.forEach(function(w){var C=w.group();y.elements[C]||(y.elements[C]=[]),y.elements[C].push(w.json())})),this._private.styleEnabled&&(y.style=r.style().json()),y.data=Nr(r.data());var b=n.options;return y.zoomingEnabled=n.zoomingEnabled,y.userZoomingEnabled=n.userZoomingEnabled,y.zoom=n.zoom,y.minZoom=n.minZoom,y.maxZoom=n.maxZoom,y.panningEnabled=n.panningEnabled,y.userPanningEnabled=n.userPanningEnabled,y.pan=Nr(n.pan),y.boxSelectionEnabled=n.boxSelectionEnabled,y.renderer=Nr(b.renderer),y.hideEdgesOnViewport=b.hideEdgesOnViewport,y.textureOnViewport=b.textureOnViewport,y.wheelSensitivity=b.wheelSensitivity,y.motionBlur=b.motionBlur,y.multiClickDebounceTime=b.multiClickDebounceTime,y}}}),Ys.$id=Ys.getElementById,[vz,wz,g1,uc,Gs,Ez,cc,Us,Sz,aa,ho].forEach(function(t){Se(Ys,t)});var Tz={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}},Nz={maximal:!1,acyclic:!1},ei=function(e){return e.scratch("breadthfirst")},m1=function(e,r){return e.scratch("breadthfirst",r)};function y1(t){this.options=Se({},Tz,Nz,t)}y1.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=n.nodes().filter(function(ae){return!ae.isParent()}),i=n,o=e.directed,l=e.acyclic||e.maximal||e.maximalAdjustments>0,c=Kt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),u;if(Zt(e.roots))u=e.roots;else if(Ke(e.roots)){for(var d=[],f=0;f<e.roots.length;f++){var h=e.roots[f],v=r.getElementById(h);d.push(v)}u=r.collection(d)}else if(Ee(e.roots))u=r.$(e.roots);else if(o)u=a.roots();else{var p=n.components();u=r.collection();for(var g=function(ne){var ue=p[ne],ie=ue.maxDegree(!1),fe=ue.filter(function(pe){return pe.degree(!1)===ie});u=u.add(fe)},m=0;m<p.length;m++)g(m)}var y=[],b={},w=function(ne,ue){y[ue]==null&&(y[ue]=[]);var ie=y[ue].length;y[ue].push(ne),m1(ne,{index:ie,depth:ue})},C=function(ne,ue){var ie=ei(ne),fe=ie.depth,pe=ie.index;y[fe][pe]=null,w(ne,ue)};i.bfs({roots:u,directed:e.directed,visit:function(ne,ue,ie,fe,pe){var De=ne[0],Ie=De.id();w(De,pe),b[Ie]=!0}});for(var x=[],k=0;k<a.length;k++){var E=a[k];b[E.id()]||x.push(E)}var _=function(ne){for(var ue=y[ne],ie=0;ie<ue.length;ie++){var fe=ue[ie];if(fe==null){ue.splice(ie,1),ie--;continue}m1(fe,{depth:ne,index:ie})}},S=function(){for(var ne=0;ne<y.length;ne++)_(ne)},T=function(ne,ue){for(var ie=ei(ne),fe=ne.incomers().filter(function(I){return I.isNode()&&n.has(I)}),pe=-1,De=ne.id(),Ie=0;Ie<fe.length;Ie++){var we=fe[Ie],xe=ei(we);pe=Math.max(pe,xe.depth)}if(ie.depth<=pe){if(!e.acyclic&&ue[De])return null;var re=pe+1;return C(ne,re),ue[De]=re,!0}return!1};if(o&&l){var N=[],B={},O=function(ne){return N.push(ne)},D=function(){return N.shift()};for(a.forEach(function(ae){return N.push(ae)});N.length>0;){var R=D(),P=T(R,B);if(P)R.outgoers().filter(function(ae){return ae.isNode()&&n.has(ae)}).forEach(O);else if(P===null){$e("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}S();var L=0;if(e.avoidOverlap)for(var A=0;A<a.length;A++){var q=a[A],U=q.layoutDimensions(e),z=U.w,H=U.h;L=Math.max(L,z,H)}var Q={},F=function(ne){if(Q[ne.id()])return Q[ne.id()];for(var ue=ei(ne).depth,ie=ne.neighborhood(),fe=0,pe=0,De=0;De<ie.length;De++){var Ie=ie[De];if(!(Ie.isEdge()||Ie.isParent()||!a.has(Ie))){var we=ei(Ie);if(we!=null){var xe=we.index,re=we.depth;if(!(xe==null||re==null)){var I=y[re].length;re<ue&&(fe+=xe/I,pe++)}}}}return pe=Math.max(1,pe),fe=fe/pe,pe===0&&(fe=0),Q[ne.id()]=fe,fe},$=function(ne,ue){var ie=F(ne),fe=F(ue),pe=ie-fe;return pe===0?T0(ne.id(),ue.id()):pe};e.depthSort!==void 0&&($=e.depthSort);for(var V=0;V<y.length;V++)y[V].sort($),_(V);for(var G=[],j=0;j<x.length;j++)G.push(x[j]);y.unshift(G),S();for(var M=0,W=0;W<y.length;W++)M=Math.max(y[W].length,M);var Y={x:c.x1+c.w/2,y:c.x1+c.h/2},se=y.reduce(function(ae,ne){return Math.max(ae,ne.length)},0),ce=function(ne){var ue=ei(ne),ie=ue.depth,fe=ue.index,pe=y[ie].length,De=Math.max(c.w/((e.grid?se:pe)+1),L),Ie=Math.max(c.h/(y.length+1),L),we=Math.min(c.w/2/y.length,c.h/2/y.length);if(we=Math.max(we,L),e.circle){var re=we*ie+we-(y.length>0&&y[0].length<=3?we/2:0),I=2*Math.PI/y[ie].length*fe;return ie===0&&y[0].length===1&&(re=1),{x:Y.x+re*Math.cos(I),y:Y.y+re*Math.sin(I)}}else{var xe={x:Y.x+(fe+1-(pe+1)/2)*De,y:(ie+1)*Ie};return xe}};return n.nodes().layoutPositions(this,e,ce),this};var Iz={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 b1(t){this.options=Se({},Iz,t)}b1.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 o=Kt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l={x:o.x1+o.w/2,y:o.y1+o.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,h=0;h<i.length;h++){var v=i[h],p=v.layoutDimensions(e),g=p.w,m=p.h;f=Math.max(f,g,m)}if(de(e.radius)?d=e.radius:i.length<=1?d=0:d=Math.min(o.h,o.w)/2-f,i.length>1&&e.avoidOverlap){f*=1.75;var y=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),w=Math.sqrt(f*f/(y*y+b*b));d=Math.max(w,d)}var C=function(k,E){var _=e.startAngle+E*u*(a?1:-1),S=d*Math.cos(_),T=d*Math.sin(_),N={x:l.x+S,y:l.y+T};return N};return n.nodes().layoutPositions(this,e,C),this};var Bz={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 w1(t){this.options=Se({},Bz,t)}w1.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"),o=Kt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l={x:o.x1+o.w/2,y:o.y1+o.h/2},c=[],u=0,d=0;d<i.length;d++){var f=i[d],h=void 0;h=e.concentric(f),c.push({value:h,node:f}),f._private.scratch.concentric=h}i.updateStyle();for(var v=0;v<i.length;v++){var p=i[v],g=p.layoutDimensions(e);u=Math.max(u,g.w,g.h)}c.sort(function(ae,ne){return ne.value-ae.value});for(var m=e.levelWidth(i),y=[[]],b=y[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>=m&&(b=[],y.push(b))}b.push(C)}var k=u+e.minNodeSpacing;if(!e.avoidOverlap){var E=y.length>0&&y[0].length>1,_=Math.min(o.w,o.h)/2-k,S=_/(y.length+E?1:0);k=Math.min(k,S)}for(var T=0,N=0;N<y.length;N++){var B=y[N],O=e.sweep===void 0?2*Math.PI-2*Math.PI/B.length:e.sweep,D=B.dTheta=O/Math.max(1,B.length-1);if(B.length>1&&e.avoidOverlap){var R=Math.cos(D)-Math.cos(0),P=Math.sin(D)-Math.sin(0),L=Math.sqrt(k*k/(R*R+P*P));T=Math.max(L,T)}B.r=T,T+=k}if(e.equidistant){for(var A=0,q=0,U=0;U<y.length;U++){var z=y[U],H=z.r-q;A=Math.max(A,H)}q=0;for(var Q=0;Q<y.length;Q++){var F=y[Q];Q===0&&(q=F.r),F.r=q,q+=A}}for(var $={},V=0;V<y.length;V++)for(var G=y[V],j=G.dTheta,M=G.r,W=0;W<G.length;W++){var Y=G[W],se=e.startAngle+(r?1:-1)*j*W,ce={x:l.x+M*Math.cos(se),y:l.y+M*Math.sin(se)};$[Y.node.id()]=ce}return a.nodes().layoutPositions(this,e,function(ae){var ne=ae.id();return $[ne]}),this};var hc,Dz={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 Zs(t){this.options=Se({},Dz,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"),o=a.target().data("id"),l=e.some(function(u){return u.data("id")===i}),c=e.some(function(u){return u.data("id")===o});return!l||!c});this.options.eles=this.options.eles.not(n)}Zs.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?hc=!0:hc=!1;var n=Oz(e,r,t);hc&&Rz(n),t.randomize&&Lz(n);var a=Wr(),i=function(){Mz(n,e,t),t.fit===!0&&e.fit(t.padding)},o=function(h){return!(r.stopped||h>=t.numIter||(Fz(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 h=t.eles.nodes(),v=C1(n,t,h);h.layoutPositions(r,t,v)}},c=0,u=!0;if(t.animate===!0){var d=function f(){for(var h=0;u&&h<t.refresh;)u=o(c),c++,h++;if(!u)x1(n,t),l();else{var v=Wr();v-a>=t.animationThreshold&&i(),ps(f)}};d()}else{for(;u;)u=o(c),c++;x1(n,t),l()}return this},Zs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},Zs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Oz=function(e,r,n){for(var a=n.eles.edges(),i=n.eles.nodes(),o=Kt(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:o.w,clientHeight:o.h,boundingBox:o},c=n.eles.components(),u={},d=0;d<c.length;d++)for(var f=c[d],h=0;h<f.length;h++){var v=f[h];u[v.id()]=d}for(var d=0;d<l.nodeSize;d++){var p=i[d],g=p.layoutDimensions(n),m={};m.isLocked=p.locked(),m.id=p.data("id"),m.parentId=p.data("parent"),m.cmptId=u[p.id()],m.children=[],m.positionX=p.position("x"),m.positionY=p.position("y"),m.offsetX=0,m.offsetY=0,m.height=g.w,m.width=g.h,m.maxX=m.positionX+m.width/2,m.minX=m.positionX-m.width/2,m.maxY=m.positionY+m.height/2,m.minY=m.positionY-m.height/2,m.padLeft=parseFloat(p.style("padding")),m.padRight=parseFloat(p.style("padding")),m.padTop=parseFloat(p.style("padding")),m.padBottom=parseFloat(p.style("padding")),m.nodeRepulsion=Xe(n.nodeRepulsion)?n.nodeRepulsion(p):n.nodeRepulsion,l.layoutNodes.push(m),l.idToIndex[m.id]=d}for(var y=[],b=0,w=-1,C=[],d=0;d<l.nodeSize;d++){var p=l.layoutNodes[d],x=p.parentId;x!=null?l.layoutNodes[l.idToIndex[x]].children.push(p.id):(y[++w]=p.id,C.push(p.id))}for(l.graphSet.push(C);b<=w;){var k=y[b++],E=l.idToIndex[k],v=l.layoutNodes[E],_=v.children;if(_.length>0){l.graphSet.push(_);for(var d=0;d<_.length;d++)y[++w]=_[d]}}for(var d=0;d<l.graphSet.length;d++)for(var S=l.graphSet[d],h=0;h<S.length;h++){var T=l.idToIndex[S[h]];l.indexToGraph[T]=d}for(var d=0;d<l.edgeSize;d++){var N=a[d],B={};B.id=N.data("id"),B.sourceId=N.data("source"),B.targetId=N.data("target");var O=Xe(n.idealEdgeLength)?n.idealEdgeLength(N):n.idealEdgeLength,D=Xe(n.edgeElasticity)?n.edgeElasticity(N):n.edgeElasticity,R=l.idToIndex[B.sourceId],P=l.idToIndex[B.targetId],L=l.indexToGraph[R],A=l.indexToGraph[P];if(L!=A){for(var q=Pz(B.sourceId,B.targetId,l),U=l.graphSet[q],z=0,m=l.layoutNodes[R];U.indexOf(m.id)===-1;)m=l.layoutNodes[l.idToIndex[m.parentId]],z++;for(m=l.layoutNodes[P];U.indexOf(m.id)===-1;)m=l.layoutNodes[l.idToIndex[m.parentId]],z++;O*=z*n.nestingFactor}B.idealLength=O,B.elasticity=D,l.layoutEdges.push(B)}return l},Pz=function(e,r,n){var a=Az(e,r,0,n);return 2>a.count?0:a.graph},Az=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 o=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]]],h=t(e,r,f,a);if(h.count!==0)if(h.count===1){if(o++,o===2)break}else return h}}return{count:o,graph:n}},Rz,Lz=function(e,r){for(var n=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*n,o.positionY=Math.random()*a)}},C1=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(o){var l=e.layoutNodes[e.idToIndex[o.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(o,l){var c=e.layoutNodes[e.idToIndex[o.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}}},Mz=function(e,r,n){var a=n.layout,i=n.eles.nodes(),o=C1(e,n,i);i.positions(o),e.ready!==!0&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},Fz=function(e,r,n){$z(e,r),zz(e),Hz(e,r),Kz(e),Gz(e)},$z=function(e,r){for(var n=0;n<e.graphSet.length;n++)for(var a=e.graphSet[n],i=a.length,o=0;o<i;o++)for(var l=e.layoutNodes[e.idToIndex[a[o]]],c=o+1;c<i;c++){var u=e.layoutNodes[e.idToIndex[a[c]]];Vz(l,u,e,r)}},E1=function(e){return-e+2*e*Math.random()},Vz=function(e,r,n,a){var i=e.cmptId,o=r.cmptId;if(!(i!==o&&!n.isCompound)){var l=r.positionX-e.positionX,c=r.positionY-e.positionY,u=1;l===0&&c===0&&(l=E1(u),c=E1(u));var d=qz(e,r,l,c);if(d>0)var f=a.nodeOverlap*d,h=Math.sqrt(l*l+c*c),v=f*l/h,p=f*c/h;else var g=Xs(e,l,c),m=Xs(r,-1*l,-1*c),y=m.x-g.x,b=m.y-g.y,w=y*y+b*b,h=Math.sqrt(w),f=(e.nodeRepulsion+r.nodeRepulsion)/w,v=f*y/h,p=f*b/h;e.isLocked||(e.offsetX-=v,e.offsetY-=p),r.isLocked||(r.offsetX+=v,r.offsetY+=p)}},qz=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 o=e.maxY-r.minY;else var o=r.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Xs=function(e,r,n){var a=e.positionX,i=e.positionY,o=e.height||1,l=e.width||1,c=n/r,u=o/l,d={};return r===0&&0<n||r===0&&0>n?(d.x=a,d.y=i+o/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+o*r/2/n,d.y=i+o/2,d):(0>n&&(c<=-1*u||c>=u)&&(d.x=a-o*r/2/n,d.y=i-o/2),d)},zz=function(e,r){for(var n=0;n<e.edgeSize;n++){var a=e.layoutEdges[n],i=e.idToIndex[a.sourceId],o=e.layoutNodes[i],l=e.idToIndex[a.targetId],c=e.layoutNodes[l],u=c.positionX-o.positionX,d=c.positionY-o.positionY;if(!(u===0&&d===0)){var f=Xs(o,u,d),h=Xs(c,-1*u,-1*d),v=h.x-f.x,p=h.y-f.y,g=Math.sqrt(v*v+p*p),m=Math.pow(a.idealLength-g,2)/a.elasticity;if(g!==0)var y=m*v/g,b=m*p/g;else var y=0,b=0;o.isLocked||(o.offsetX+=y,o.offsetY+=b),c.isLocked||(c.offsetX-=y,c.offsetY-=b)}}},Hz=function(e,r){if(r.gravity!==0)for(var n=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],o=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<o;f++){var h=e.layoutNodes[e.idToIndex[i[f]]];if(!h.isLocked){var v=l-h.positionX,p=c-h.positionY,g=Math.sqrt(v*v+p*p);if(g>n){var m=r.gravity*v/g,y=r.gravity*p/g;h.offsetX+=m,h.offsetY+=y}}}}},Kz=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 o=n[a++],l=e.idToIndex[o],c=e.layoutNodes[l],u=c.children;if(0<u.length&&!c.isLocked){for(var d=c.offsetX,f=c.offsetY,h=0;h<u.length;h++){var v=e.layoutNodes[e.idToIndex[u[h]]];v.offsetX+=d,v.offsetY+=f,n[++i]=u[h]}c.offsetX=0,c.offsetY=0}}},Gz=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=Uz(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,jz(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)}},Uz=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},jz=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)}},x1=function(e,r){for(var n=e.layoutNodes,a=[],i=0;i<n.length;i++){var o=n[i],l=o.cmptId,c=a[l]=a[l]||[];c.push(o)}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 h=d[f];d.x1=Math.min(d.x1,h.positionX-h.width/2),d.x2=Math.max(d.x2,h.positionX+h.width/2),d.y1=Math.min(d.y1,h.positionY-h.height/2),d.y2=Math.max(d.y2,h.positionY+h.height/2)}d.w=d.x2-d.x1,d.h=d.y2-d.y1,u+=d.w*d.h}}a.sort(function(b,w){return w.w*w.h-b.w*b.h});for(var v=0,p=0,g=0,m=0,y=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 h=d[f];h.isLocked||(h.positionX+=v-d.x1,h.positionY+=p-d.y1)}v+=d.w+r.componentSpacing,g+=d.w+r.componentSpacing,m=Math.max(m,d.h),g>y&&(p+=m+r.componentSpacing,v=0,g=0,m=0)}}},Wz={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 k1(t){this.options=Se({},Wz,t)}k1.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=Kt(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(Q){return{x:i.x1,y:i.y1}});else{var o=a.size(),l=Math.sqrt(o*i.h/i.w),c=Math.round(l),u=Math.round(i.w/i.h*l),d=function(F){if(F==null)return Math.min(c,u);var $=Math.min(c,u);$==c?c=F:u=F},f=function(F){if(F==null)return Math.max(c,u);var $=Math.max(c,u);$==c?c=F:u=F},h=e.rows,v=e.cols!=null?e.cols:e.columns;if(h!=null&&v!=null)c=h,u=v;else if(h!=null&&v==null)c=h,u=Math.ceil(o/c);else if(h==null&&v!=null)u=v,c=Math.ceil(o/u);else if(u*c>o){var p=d(),g=f();(p-1)*g>=o?d(p-1):(g-1)*p>=o&&f(g-1)}else for(;u*c<o;){var m=d(),y=f();(y+1)*m>=o?f(y+1):d(m+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],k=x._private.position;(k.x==null||k.y==null)&&(k.x=0,k.y=0);var E=x.layoutDimensions(e),_=e.avoidOverlapPadding,S=E.w+_,T=E.h+_;b=Math.max(b,S),w=Math.max(w,T)}for(var N={},B=function(F,$){return!!N["c-"+F+"-"+$]},O=function(F,$){N["c-"+F+"-"+$]=!0},D=0,R=0,P=function(){R++,R>=u&&(R=0,D++)},L={},A=0;A<a.length;A++){var q=a[A],U=e.position(q);if(U&&(U.row!==void 0||U.col!==void 0)){var z={row:U.row,col:U.col};if(z.col===void 0)for(z.col=0;B(z.row,z.col);)z.col++;else if(z.row===void 0)for(z.row=0;B(z.row,z.col);)z.row++;L[q.id()]=z,O(z.row,z.col)}}var H=function(F,$){var V,G;if(F.locked()||F.isParent())return!1;var j=L[F.id()];if(j)V=j.col*b+b/2+i.x1,G=j.row*w+w/2+i.y1;else{for(;B(D,R);)P();V=R*b+b/2+i.x1,G=D*w+w/2+i.y1,O(D,R),P()}return{x:V,y:G}};a.layoutPositions(this,e,H)}return this};var Yz={ready:function(){},stop:function(){}};function pc(t){this.options=Se({},Yz,t)}pc.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},pc.prototype.stop=function(){return this};var Zz={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 S1(t){this.options=Se({},Zz,t)}S1.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),n=Xe(t.positions);function a(i){if(t.positions==null)return e5(i.position());if(n)return t.positions(i);var o=t.positions[i._private.data.id];return o??null}return r.layoutPositions(this,t,function(i,o){var l=a(i);return i.locked()||l==null?!1:l}),this};var Xz={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 _1(t){this.options=Se({},Xz,t)}_1.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=Kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(o,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 Jz=[{name:"breadthfirst",impl:y1},{name:"circle",impl:b1},{name:"concentric",impl:w1},{name:"cose",impl:Zs},{name:"grid",impl:k1},{name:"null",impl:pc},{name:"preset",impl:S1},{name:"random",impl:_1}];function T1(t){this.options=t,this.notifications=0}var N1=function(){},I1=function(){throw new Error("A headless instance can not render images")};T1.prototype={recalculateRenderedStyle:N1,notify:function(){this.notifications++},init:N1,isHeadless:function(){return!0},png:I1,jpg:I1};var vc={};vc.arrowShapeWidth=.3,vc.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,d,f,h,v,p,g){var m=v.x-f/2-g,y=v.x+f/2+g,b=v.y-f/2-g,w=v.y+f/2+g,C=m<=u&&u<=y&&b<=d&&d<=w;return C},n=function(u,d,f,h,v){var p=u*Math.cos(h)-d*Math.sin(h),g=u*Math.sin(h)+d*Math.cos(h),m=p*f,y=g*f,b=m+v.x,w=y+v.y;return{x:b,y:w}},a=function(u,d,f,h){for(var v=[],p=0;p<u.length;p+=2){var g=u[p],m=u[p+1];v.push(n(g,m,d,f,h))}return v},i=function(u){for(var d=[],f=0;f<u.length;f++){var h=u[f];d.push(h.x,h.y)}return d},o=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},l=function(u,d){Ee(d)&&(d=t[d]),t[u]=Se({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(h,v,p,g,m,y){var b=i(a(this.points,p+2*y,g,m)),w=Gt(h,v,b);return w},roughCollide:r,draw:function(h,v,p,g){var m=a(this.points,v,p,g);e.arrowShapeImpl("polygon")(h,m)},spacing:function(h){return 0},gap:o},d)};l("none",{collide:gs,roughCollide:gs,draw:Fu,spacing:q0,gap:q0}),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,h,v){var p=a(this.points,d,f,h),g=this.controlPoint,m=n(g[0],g[1],d,f,h);e.arrowShapeImpl(this.name)(u,p,m)},gap:function(u){return o(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,h,v,p,g){var m=i(a(this.points,f+2*g,h,v)),y=i(a(this.pointsTee,f+2*g,h,v)),b=Gt(u,d,m)||Gt(u,d,y);return b},draw:function(u,d,f,h,v){var p=a(this.points,d,f,h),g=a(this.pointsTee,d,f,h);e.arrowShapeImpl(this.name)(u,p,g)}}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,d,f,h,v,p,g){var m=v,y=Math.pow(m.x-u,2)+Math.pow(m.y-d,2)<=Math.pow((f+2*g)*this.radius,2),b=i(a(this.points,f+2*g,h,v));return Gt(u,d,b)||y},draw:function(u,d,f,h,v){var p=a(this.pointsTr,d,f,h);e.arrowShapeImpl(this.name)(u,p,h.x,h.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(),h=d/u,v=3,p=5;return f[v]=f[v]-h,f[p]=f[p]-h,f},collide:function(u,d,f,h,v,p,g){var m=i(a(this.points,f+2*g,h,v)),y=i(a(this.crossLinePts(f,p),f+2*g,h,v)),b=Gt(u,d,m)||Gt(u,d,y);return b},draw:function(u,d,f,h,v){var p=a(this.points,d,f,h),g=a(this.crossLinePts(d,v),d,f,h);e.arrowShapeImpl(this.name)(u,p,g)}}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return o(u)*.525}}),l("circle",{radius:.15,collide:function(u,d,f,h,v,p,g){var m=v,y=Math.pow(m.x-u,2)+Math.pow(m.y-d,2)<=Math.pow((f+2*g)*this.radius,2);return y},draw:function(u,d,f,h,v){e.arrowShapeImpl(this.name)(u,h.x,h.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 ia={};ia.projectIntoViewport=function(t,e){var r=this.cy,n=this.findContainerClientCoords(),a=n[0],i=n[1],o=n[4],l=r.pan(),c=r.zoom(),u=((t-a)/o-l.x)/c,d=((e-i)/o-l.y)/c;return[u,d]},ia.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),n=function(y){return parseFloat(r.getPropertyValue(y))},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")},o=t.clientWidth,l=t.clientHeight,c=a.left+a.right,u=a.top+a.bottom,d=i.left+i.right,f=e.width/(o+d),h=o-c,v=l-u,p=e.left+a.left+i.left,g=e.top+a.top+i.top;return this.containerBB=[p,g,h,v,f]},ia.invalidateContainerClientCoordsCache=function(){this.containerBB=null},ia.findNearestElement=function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]},ia.findNearestElements=function(t,e,r,n){var a=this,i=this,o=i.getCachedZSortedEles(),l=[],c=i.cy.zoom(),u=i.cy.hasCompoundNodes(),d=(n?24:8)/c,f=(n?8:2)/c,h=(n?8:2)/c,v=1/0,p,g;r&&(o=o.interactive);function m(E,_){if(E.isNode()){if(g)return;g=E,l.push(E)}if(E.isEdge()&&(_==null||_<v))if(p){if(p.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value&&p.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value){for(var S=0;S<l.length;S++)if(l[S].isEdge()){l[S]=E,p=E,v=_??v;break}}}else l.push(E),p=E,v=_??v}function y(E){var _=E.outerWidth()+2*f,S=E.outerHeight()+2*f,T=_/2,N=S/2,B=E.position(),O=E.pstyle("corner-radius").value==="auto"?"auto":E.pstyle("corner-radius").pfValue,D=E._private.rscratch;if(B.x-T<=t&&t<=B.x+T&&B.y-N<=e&&e<=B.y+N){var R=i.nodeShapes[a.getNodeShape(E)];if(R.checkPoint(t,e,0,_,S,B.x,B.y,O,D))return m(E,0),!0}}function b(E){var _=E._private,S=_.rscratch,T=E.pstyle("width").pfValue,N=E.pstyle("arrow-scale").value,B=T/2+d,O=B*B,D=B*2,A=_.source,q=_.target,R;if(S.edgeType==="segments"||S.edgeType==="straight"||S.edgeType==="haystack"){for(var P=S.allpts,L=0;L+3<P.length;L+=2)if(h5(t,e,P[L],P[L+1],P[L+2],P[L+3],D)&&O>(R=y5(t,e,P[L],P[L+1],P[L+2],P[L+3])))return m(E,R),!0}else if(S.edgeType==="bezier"||S.edgeType==="multibezier"||S.edgeType==="self"||S.edgeType==="compound"){for(var P=S.allpts,L=0;L+5<S.allpts.length;L+=4)if(p5(t,e,P[L],P[L+1],P[L+2],P[L+3],P[L+4],P[L+5],D)&&O>(R=m5(t,e,P[L],P[L+1],P[L+2],P[L+3],P[L+4],P[L+5])))return m(E,R),!0}for(var A=A||_.source,q=q||_.target,U=a.getArrowWidth(T,N),z=[{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}],L=0;L<z.length;L++){var H=z[L],Q=i.arrowShapes[E.pstyle(H.name+"-arrow-shape").value],F=E.pstyle("width").pfValue;if(Q.roughCollide(t,e,U,H.angle,{x:H.x,y:H.y},F,d)&&Q.collide(t,e,U,H.angle,{x:H.x,y:H.y},F,d))return m(E),!0}u&&l.length>0&&(y(A),y(q))}function w(E,_,S){return gr(E,_,S)}function C(E,_){var S=E._private,T=h,N;_?N=_+"-":N="",E.boundingBox();var B=S.labelBounds[_||"main"],O=E.pstyle(N+"label").value,D=E.pstyle("text-events").strValue==="yes";if(!(!D||!O)){var R=w(S.rscratch,"labelX",_),P=w(S.rscratch,"labelY",_),L=w(S.rscratch,"labelAngle",_),A=E.pstyle(N+"text-margin-x").pfValue,q=E.pstyle(N+"text-margin-y").pfValue,U=B.x1-T-A,z=B.x2+T-A,H=B.y1-T-q,Q=B.y2+T-q;if(L){var F=Math.cos(L),$=Math.sin(L),V=function(ce,ae){return ce=ce-R,ae=ae-P,{x:ce*F-ae*$+R,y:ce*$+ae*F+P}},G=V(U,H),j=V(U,Q),M=V(z,H),W=V(z,Q),Y=[G.x+A,G.y+q,M.x+A,M.y+q,W.x+A,W.y+q,j.x+A,j.y+q];if(Gt(t,e,Y))return m(E),!0}else if($a(B,t,e))return m(E),!0}}for(var x=o.length-1;x>=0;x--){var k=o[x];k.isNode()?y(k)||C(k):b(k)||C(k)||C(k,"source")||C(k,"target")}return l},ia.getAllInBox=function(t,e,r,n){var a=this.getCachedZSortedEles().interactive,i=[],o=Math.min(t,r),l=Math.max(t,r),c=Math.min(e,n),u=Math.max(e,n);t=o,r=l,e=c,n=u;for(var d=Kt({x1:t,y1:e,x2:r,y2:n}),f=0;f<a.length;f++){var h=a[f];if(h.isNode()){var v=h,p=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});zu(d,p)&&!Z0(p,d)&&i.push(v)}else{var g=h,m=g._private,y=m.rscratch;if(y.startX!=null&&y.startY!=null&&!$a(d,y.startX,y.startY)||y.endX!=null&&y.endY!=null&&!$a(d,y.endX,y.endY))continue;if(y.edgeType==="bezier"||y.edgeType==="multibezier"||y.edgeType==="self"||y.edgeType==="compound"||y.edgeType==="segments"||y.edgeType==="haystack"){for(var b=m.rstyle.bezierPts||m.rstyle.linePts||m.rstyle.haystackPts,w=!0,C=0;C<b.length;C++)if(!f5(d,b[C])){w=!1;break}w&&i.push(g)}else(y.edgeType==="haystack"||y.edgeType==="straight")&&i.push(g)}}return i};var Js={};Js.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",n=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",o=e.edgeType==="compound",l=e.edgeType==="self",c,u,d,f,h,v,y,b;if(r?(d=e.haystackPts[0],f=e.haystackPts[1],h=e.haystackPts[2],v=e.haystackPts[3]):(d=e.arrowStartX,f=e.arrowStartY,h=e.arrowEndX,v=e.arrowEndY),y=e.midX,b=e.midY,i)c=d-e.segpts[0],u=f-e.segpts[1];else if(a||o||l||n){var p=e.allpts,g=gt(p[0],p[2],p[4],.1),m=gt(p[1],p[3],p[5],.1);c=d-g,u=f-m}else c=d-y,u=f-b;e.srcArrowAngle=bs(c,u);var y=e.midX,b=e.midY;if(r&&(y=(d+h)/2,b=(f+v)/2),c=h-d,u=v-f,i){var p=e.allpts;if(p.length/2%2===0){var w=p.length/2,C=w-2;c=p[w]-p[C],u=p[w+1]-p[C+1]}else if(e.isRound)c=e.midVector[1],u=-e.midVector[0];else{var w=p.length/2-1,C=w-2;c=p[w]-p[C],u=p[w+1]-p[C+1]}}else if(a||o||l){var p=e.allpts,x=e.ctrlpts,k,E,_,S;if(x.length/2%2===0){var T=p.length/2-1,N=T+2,B=N+2;k=gt(p[T],p[N],p[B],0),E=gt(p[T+1],p[N+1],p[B+1],0),_=gt(p[T],p[N],p[B],1e-4),S=gt(p[T+1],p[N+1],p[B+1],1e-4)}else{var N=p.length/2-1,T=N-2,B=N+2;k=gt(p[T],p[N],p[B],.4999),E=gt(p[T+1],p[N+1],p[B+1],.4999),_=gt(p[T],p[N],p[B],.5),S=gt(p[T+1],p[N+1],p[B+1],.5)}c=_-k,u=S-E}if(e.midtgtArrowAngle=bs(c,u),e.midDispX=c,e.midDispY=u,c*=-1,u*=-1,i){var p=e.allpts;if(p.length/2%2!==0){if(!e.isRound){var w=p.length/2-1,O=w+2;c=-(p[O]-p[w]),u=-(p[O+1]-p[w+1])}}}if(e.midsrcArrowAngle=bs(c,u),i)c=h-e.segpts[e.segpts.length-2],u=v-e.segpts[e.segpts.length-1];else if(a||o||l||n){var p=e.allpts,D=p.length,g=gt(p[D-6],p[D-4],p[D-2],.9),m=gt(p[D-5],p[D-3],p[D-1],.9);c=h-g,u=v-m}else c=h-y,u=v-b;e.tgtArrowAngle=bs(c,u)},Js.getArrowWidth=Js.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 gc,mc,Dr={},ir={},B1,D1,oa,Qs,Xr,sa,la,Or,ti,el,O1,P1,yc,bc,A1,R1=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)},Qz=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},e3=function(e,r,n,a,i){if(e!==A1?R1(r,e,Dr):Qz(ir,Dr),R1(r,n,ir),B1=Dr.nx*ir.ny-Dr.ny*ir.nx,D1=Dr.nx*ir.nx-Dr.ny*-ir.ny,Xr=Math.asin(Math.max(-1,Math.min(1,B1))),Math.abs(Xr)<1e-6){gc=r.x,mc=r.y,la=ti=0;return}oa=1,Qs=!1,D1<0?Xr<0?Xr=Math.PI+Xr:(Xr=Math.PI-Xr,oa=-1,Qs=!0):Xr>0&&(oa=-1,Qs=!0),r.radius!==void 0?ti=r.radius:ti=a,sa=Xr/2,el=Math.min(Dr.len/2,ir.len/2),i?(Or=Math.abs(Math.cos(sa)*ti/Math.sin(sa)),Or>el?(Or=el,la=Math.abs(Or*Math.sin(sa)/Math.cos(sa))):la=ti):(Or=Math.min(el,ti),la=Math.abs(Or*Math.sin(sa)/Math.cos(sa))),yc=r.x+ir.nx*Or,bc=r.y+ir.ny*Or,gc=yc-ir.ny*la*oa,mc=bc+ir.nx*la*oa,O1=r.x+Dr.nx*Or,P1=r.y+Dr.ny*Or,A1=r};function L1(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 wc(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}:(e3(t,e,r,n,a),{cx:gc,cy:mc,radius:la,startX:O1,startY:P1,stopX:yc,stopY:bc,startAngle:Dr.ang+Math.PI/2*oa,endAngle:ir.ang-Math.PI/2*oa,counterClockwise:Qs})}var Pt={};Pt.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,i,o=t.pstyle("source-endpoint"),l=t.pstyle("target-endpoint"),c=o.units!=null&&l.units!=null,u=function(x,k,E,_){var S=_-k,T=E-x,N=Math.sqrt(T*T+S*S);return{x:-S/N,y:T/N}},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],o),h=vr(f,2),v=h[0],p=h[1],g=this.manualEndptToPx(t.target()[0],l),m=vr(g,2),y=m[0],b=m[1],w={x1:v,y1:p,x2:y,y2:b};a=u(v,p,y,b),i=w}else $e("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 o=n.source,l=n.target,c=o.position(),u=l.position(),d=o.width(),f=l.width(),h=o.height(),v=l.height(),p=r.pstyle("haystack-radius").value,g=p/2;a.haystackPts=a.allpts=[a.source.x*d*g+c.x,a.source.y*h*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"),o=t.pstyle("radius-type"),l=Math.min(n.pfValue.length,a.pfValue.length),c=i.pfValue[i.pfValue.length-1],u=o.pfValue[o.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var d=0;d<l;d++){var f=n.pfValue[d],h=a.pfValue[d],v=1-f,p=f,g=this.findMidptPtsEtc(t,e),m=g.midptPts,y=g.vectorNormInverse,b={x:m.x1*v+m.x2*p,y:m.y1*v+m.y2*p};r.segpts.push(b.x+y.x*h,b.y+y.y*h),r.radii.push(i.pfValue[d]!==void 0?i.pfValue[d]:c),r.isArcRadius.push((o.pfValue[d]!==void 0?o.pfValue[d]:u)==="arc-radius")}},Pt.findLoopPoints=function(t,e,r,n){var a=t._private.rscratch,i=e.dirCounts,o=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 h=r,v=f;n&&(h=0,v=c);var p=u-Math.PI/2,g=p-d/2,m=p+d/2,y=u+"_"+d;h=i[y]===void 0?i[y]=0:++i[y],a.ctrlpts=[o.x+Math.cos(g)*1.4*v*(h/3+1),o.y+Math.sin(g)*1.4*v*(h/3+1),o.x+Math.cos(m)*1.4*v*(h/3+1),o.y+Math.sin(m)*1.4*v*(h/3+1)]},Pt.findCompoundLoopPoints=function(t,e,r,n){var a=t._private.rscratch;a.edgeType="compound";var i=e.srcPos,o=e.tgtPos,l=e.srcW,c=e.srcH,u=e.tgtW,d=e.tgtH,f=t.pstyle("control-point-step-size").pfValue,h=t.pstyle("control-point-distances"),v=h?h.pfValue[0]:void 0,p=r,g=f;n&&(p=0,g=v);var m=50,y={x:i.x-l/2,y:i.y-c/2},b={x:o.x-u/2,y:o.y-d/2},w={x:Math.min(y.x,b.x),y:Math.min(y.y,b.y)},C=.5,x=Math.max(C,Math.log(l*.01)),k=Math.max(C,Math.log(u*.01));a.ctrlpts=[w.x,w.y-(1+Math.pow(m,1.12)/100)*g*(p/3+1)*x,w.x-(1+Math.pow(m,1.12)/100)*g*(p/3+1)*k,w.y]},Pt.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"},Pt.findBezierPoints=function(t,e,r,n,a){var i=t._private.rscratch,o=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],h=n;i.edgeType=h?"multibezier":"bezier",i.ctrlpts=[];for(var v=0;v<u;v++){var p=(.5-e.eles.length/2+r)*o*(a?-1:1),g=void 0,m=j0(p);h&&(d=l?l.pfValue[v]:o,f=c.value[v]),n?g=d:g=d!==void 0?m*d:void 0;var y=g!==void 0?g:p,b=1-f,w=f,C=this.findMidptPtsEtc(t,e),x=C.midptPts,k=C.vectorNormInverse,E={x:x.x1*b+x.x2*w,y:x.y1*b+x.y2*w};i.ctrlpts.push(E.x+k.x*y,E.y+k.y*y)}},Pt.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var n="vertical",a="horizontal",i="leftward",o="rightward",l="downward",c="upward",u="auto",d=e.posPts,f=e.srcW,h=e.srcH,v=e.tgtW,p=e.tgtH,g=t.pstyle("edge-distances").value,m=g!=="node-position",y=t.pstyle("taxi-direction").value,b=y,w=t.pstyle("taxi-turn"),C=w.units==="%",x=w.pfValue,k=x<0,E=t.pstyle("taxi-turn-min-distance").pfValue,_=m?(f+v)/2:0,S=m?(h+p)/2:0,T=d.x2-d.x1,N=d.y2-d.y1,B=function(me,be){return me>0?Math.max(me-be,0):Math.min(me+be,0)},O=B(T,_),D=B(N,S),R=!1;b===u?y=Math.abs(O)>Math.abs(D)?a:n:b===c||b===l?(y=n,R=!0):(b===i||b===o)&&(y=a,R=!0);var P=y===n,L=P?D:O,A=P?N:T,q=j0(A),U=!1;!(R&&(C||k))&&(b===l&&A<0||b===c&&A>0||b===i&&A>0||b===o&&A<0)&&(q*=-1,L=q*Math.abs(L),U=!0);var z;if(C){var H=x<0?1+x:x;z=H*L}else{var Q=x<0?L:0;z=Q+x*q}var F=function(me){return Math.abs(me)<E||Math.abs(me)>=Math.abs(L)},$=F(z),V=F(Math.abs(L)-Math.abs(z)),G=$||V;if(G&&!U)if(P){var j=Math.abs(A)<=h/2,M=Math.abs(T)<=v/2;if(j){var W=(d.x1+d.x2)/2,Y=d.y1,se=d.y2;r.segpts=[W,Y,W,se]}else if(M){var ce=(d.y1+d.y2)/2,ae=d.x1,ne=d.x2;r.segpts=[ae,ce,ne,ce]}else r.segpts=[d.x1,d.y2]}else{var ue=Math.abs(A)<=f/2,ie=Math.abs(N)<=p/2;if(ue){var fe=(d.y1+d.y2)/2,pe=d.x1,De=d.x2;r.segpts=[pe,fe,De,fe]}else if(ie){var Ie=(d.x1+d.x2)/2,we=d.y1,xe=d.y2;r.segpts=[Ie,we,Ie,xe]}else r.segpts=[d.x2,d.y1]}else if(P){var re=d.y1+z+(m?h/2*q:0),I=d.x1,K=d.x2;r.segpts=[I,re,K,re]}else{var te=d.x1+z+(m?f/2*q:0),Z=d.y1,X=d.y2;r.segpts=[te,Z,te,X]}if(r.isRound){var le=t.pstyle("taxi-radius").value,ee=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(le),r.isArcRadius=new Array(r.segpts.length/2).fill(ee)}},Pt.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,a=e.tgtPos,i=e.srcW,o=e.srcH,l=e.tgtW,c=e.tgtH,u=e.srcShape,d=e.tgtShape,f=e.srcCornerRadius,h=e.tgtCornerRadius,v=e.srcRs,p=e.tgtRs,g=!de(r.startX)||!de(r.startY),m=!de(r.arrowStartX)||!de(r.arrowStartY),y=!de(r.endX)||!de(r.endY),b=!de(r.arrowEndX)||!de(r.arrowEndY),w=3,C=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,x=w*C,k=Jn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),E=k<x,_=Jn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),S=_<x,T=!1;if(g||m||E){T=!0;var N={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},B=Math.sqrt(N.x*N.x+N.y*N.y),O={x:N.x/B,y:N.y/B},D=Math.max(i,o),R={x:r.ctrlpts[0]+O.x*2*D,y:r.ctrlpts[1]+O.y*2*D},P=u.intersectLine(n.x,n.y,i,o,R.x,R.y,0,f,v);E?(r.ctrlpts[0]=r.ctrlpts[0]+O.x*(x-k),r.ctrlpts[1]=r.ctrlpts[1]+O.y*(x-k)):(r.ctrlpts[0]=P[0]+O.x*x,r.ctrlpts[1]=P[1]+O.y*x)}if(y||b||S){T=!0;var L={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},A=Math.sqrt(L.x*L.x+L.y*L.y),q={x:L.x/A,y:L.y/A},U=Math.max(i,o),z={x:r.ctrlpts[0]+q.x*2*U,y:r.ctrlpts[1]+q.y*2*U},H=d.intersectLine(a.x,a.y,l,c,z.x,z.y,0,h,p);S?(r.ctrlpts[0]=r.ctrlpts[0]+q.x*(x-_),r.ctrlpts[1]=r.ctrlpts[1]+q.y*(x-_)):(r.ctrlpts[0]=H[0]+q.x*x,r.ctrlpts[1]=H[1]+q.y*x)}T&&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=gt(e.allpts[n],e.allpts[n+2],e.allpts[n+4],a),e.midY=gt(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 o=e.radii[i/2-1],l=e.isArcRadius[i/2-1];e.roundCorners.push(wc({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:o},{x:e.allpts[i+2],y:e.allpts[i+3]},o,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]},h=e.roundCorners[d/2],v=[f.x-h.cx,f.y-h.cy],p=h.radius/Math.sqrt(Math.pow(v[0],2)+Math.pow(v[1],2));v=v.map(function(g){return g*p}),e.midX=h.cx+v[0],e.midY=h.cy+v[1],e.midVector=v}}}},Pt.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||de(e.startX)&&de(e.startY)&&de(e.endX)&&de(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,$e("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 Ir,get:function(E){var _=this.map.get(E[0]);return _!=null?_.get(E[1]):null},set:function(E,_){var S=this.map.get(E[0]);S==null&&(S=new Ir,this.map.set(E[0],S)),S.set(E[1],_)}},o=[],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 h=f==="unbundled-bezier"||f.endsWith("segments")||f==="straight"||f==="straight-triangle"||f.endsWith("taxi"),v=f==="unbundled-bezier"||f==="bezier",p=d.source,g=d.target,m=p.poolIndex(),y=g.poolIndex(),b=[m,y].sort(),w=i.get(b);w==null&&(w={eles:[]},i.set(b,w),o.push(b)),w.eles.push(u),h&&(w.hasUnbundled=!0),v&&(w.hasBezier=!0)}}for(var C=function(E){var _=o[E],S=i.get(_),T=void 0;if(!S.hasUnbundled){var N=S.eles[0].parallelEdges().filter(function(te){return te.isBundledBezier()});$u(S.eles),N.forEach(function(te){return S.eles.push(te)}),S.eles.sort(function(te,Z){return te.poolIndex()-Z.poolIndex()})}var B=S.eles[0],O=B.source(),D=B.target();if(O.poolIndex()>D.poolIndex()){var R=O;O=D,D=R}var P=S.srcPos=O.position(),L=S.tgtPos=D.position(),A=S.srcW=O.outerWidth(),q=S.srcH=O.outerHeight(),U=S.tgtW=D.outerWidth(),z=S.tgtH=D.outerHeight(),H=S.srcShape=r.nodeShapes[e.getNodeShape(O)],Q=S.tgtShape=r.nodeShapes[e.getNodeShape(D)],F=S.srcCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,$=S.tgtCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,V=S.tgtRs=D._private.rscratch,G=S.srcRs=O._private.rscratch;S.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var j=0;j<S.eles.length;j++){var M=S.eles[j],W=M[0]._private.rscratch,Y=M.pstyle("curve-style").value,se=Y==="unbundled-bezier"||Y.endsWith("segments")||Y.endsWith("taxi"),ce=!O.same(M.source());if(!S.calculatedIntersection&&O!==D&&(S.hasBezier||S.hasUnbundled)){S.calculatedIntersection=!0;var ae=H.intersectLine(P.x,P.y,A,q,L.x,L.y,0,F,G),ne=S.srcIntn=ae,ue=Q.intersectLine(L.x,L.y,U,z,P.x,P.y,0,$,V),ie=S.tgtIntn=ue,fe=S.intersectionPts={x1:ae[0],x2:ue[0],y1:ae[1],y2:ue[1]},pe=S.posPts={x1:P.x,x2:L.x,y1:P.y,y2:L.y},De=ue[1]-ae[1],Ie=ue[0]-ae[0],we=Math.sqrt(Ie*Ie+De*De),xe=S.vector={x:Ie,y:De},re=S.vectorNorm={x:xe.x/we,y:xe.y/we},I={x:-re.y,y:re.x};S.nodesOverlap=!de(we)||Q.checkPoint(ae[0],ae[1],0,U,z,L.x,L.y,$,V)||H.checkPoint(ue[0],ue[1],0,A,q,P.x,P.y,F,G),S.vectorNormInverse=I,T={nodesOverlap:S.nodesOverlap,dirCounts:S.dirCounts,calculatedIntersection:!0,hasBezier:S.hasBezier,hasUnbundled:S.hasUnbundled,eles:S.eles,srcPos:L,tgtPos:P,srcW:U,srcH:z,tgtW:A,tgtH:q,srcIntn:ie,tgtIntn:ne,srcShape:Q,tgtShape:H,posPts:{x1:pe.x2,y1:pe.y2,x2:pe.x1,y2:pe.y1},intersectionPts:{x1:fe.x2,y1:fe.y2,x2:fe.x1,y2:fe.y1},vector:{x:-xe.x,y:-xe.y},vectorNorm:{x:-re.x,y:-re.y},vectorNormInverse:{x:-I.x,y:-I.y}}}var K=ce?T:S;W.nodesOverlap=K.nodesOverlap,W.srcIntn=K.srcIntn,W.tgtIntn=K.tgtIntn,W.isRound=Y.startsWith("round"),a&&(O.isParent()||O.isChild()||D.isParent()||D.isChild())&&(O.parents().anySame(D)||D.parents().anySame(O)||O.same(D)&&O.isParent())?e.findCompoundLoopPoints(M,K,j,se):O===D?e.findLoopPoints(M,K,j,se):Y.endsWith("segments")?e.findSegmentsPoints(M,K):Y.endsWith("taxi")?e.findTaxiPoints(M,K):Y==="straight"||!se&&S.eles.length%2===1&&j===Math.floor(S.eles.length/2)?e.findStraightEdgePoints(M):e.findBezierPoints(M,K,j,se,ce),e.findEndpoints(M),e.tryToCorrectInvalidPoints(M,K),e.checkForInvalidEdgeWarning(M),e.storeAllpts(M),e.storeEdgeProjections(M),e.calculateArrowAngles(M),e.recalculateEdgeLabelProjections(M),e.calculateLabelAngles(M)}},x=0;x<o.length;x++)C(x);this.findHaystackPoints(l)}};function M1(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),M1(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),M1(e.ctrlpts)},Pt.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var vo={};vo.manualEndptToPx=function(t,e){var r=this,n=t.position(),a=t.outerWidth(),i=t.outerHeight(),o=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,o)}},vo.findEndpoints=function(t){var e=this,r,n=t.source()[0],a=t.target()[0],i=n.position(),o=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,h=a._private.rscratch,v=t.pstyle("curve-style").value,p=t._private.rscratch,g=p.edgeType,m=v==="taxi",y=g==="self"||g==="compound",b=g==="bezier"||g==="multibezier"||y,w=g!=="bezier",C=g==="straight"||g==="segments",x=g==="segments",k=b||w||C,E=y||m,_=t.pstyle("source-endpoint"),S=E?"outside-to-node":_.value,T=n.pstyle("corner-radius").value==="auto"?"auto":n.pstyle("corner-radius").pfValue,N=t.pstyle("target-endpoint"),B=E?"outside-to-node":N.value,O=a.pstyle("corner-radius").value==="auto"?"auto":a.pstyle("corner-radius").pfValue;p.srcManEndpt=_,p.tgtManEndpt=N;var D,R,P,L;if(b){var A=[p.ctrlpts[0],p.ctrlpts[1]],q=w?[p.ctrlpts[p.ctrlpts.length-2],p.ctrlpts[p.ctrlpts.length-1]]:A;D=q,R=A}else if(C){var U=x?p.segpts.slice(0,2):[o.x,o.y],z=x?p.segpts.slice(p.segpts.length-2):[i.x,i.y];D=z,R=U}if(B==="inside-to-node")r=[o.x,o.y];else if(N.units)r=this.manualEndptToPx(a,N);else if(B==="outside-to-line")r=p.tgtIntn;else if(B==="outside-to-node"||B==="outside-to-node-or-label"?P=D:(B==="outside-to-line"||B==="outside-to-line-or-label")&&(P=[i.x,i.y]),r=e.nodeShapes[this.getNodeShape(a)].intersectLine(o.x,o.y,a.outerWidth(),a.outerHeight(),P[0],P[1],0,O,h),B==="outside-to-node-or-label"||B==="outside-to-line-or-label"){var H=a._private.rscratch,Q=H.labelWidth,F=H.labelHeight,$=H.labelX,V=H.labelY,G=Q/2,j=F/2,M=a.pstyle("text-valign").value;M==="top"?V-=j:M==="bottom"&&(V+=j);var W=a.pstyle("text-halign").value;W==="left"?$-=G:W==="right"&&($+=G);var Y=eo(P[0],P[1],[$-G,V-j,$+G,V-j,$+G,V+j,$-G,V+j],o.x,o.y);if(Y.length>0){var se=i,ce=Qn(se,Ma(r)),ae=Qn(se,Ma(Y)),ne=ce;if(ae<ce&&(r=Y,ne=ae),Y.length>2){var ue=Qn(se,{x:Y[2],y:Y[3]});ue<ne&&(r=[Y[2],Y[3]])}}}var ie=ks(r,D,e.arrowShapes[l].spacing(t)+u),fe=ks(r,D,e.arrowShapes[l].gap(t)+u);if(p.endX=fe[0],p.endY=fe[1],p.arrowEndX=ie[0],p.arrowEndY=ie[1],S==="inside-to-node")r=[i.x,i.y];else if(_.units)r=this.manualEndptToPx(n,_);else if(S==="outside-to-line")r=p.srcIntn;else if(S==="outside-to-node"||S==="outside-to-node-or-label"?L=R:(S==="outside-to-line"||S==="outside-to-line-or-label")&&(L=[o.x,o.y]),r=e.nodeShapes[this.getNodeShape(n)].intersectLine(i.x,i.y,n.outerWidth(),n.outerHeight(),L[0],L[1],0,T,f),S==="outside-to-node-or-label"||S==="outside-to-line-or-label"){var pe=n._private.rscratch,De=pe.labelWidth,Ie=pe.labelHeight,we=pe.labelX,xe=pe.labelY,re=De/2,I=Ie/2,K=n.pstyle("text-valign").value;K==="top"?xe-=I:K==="bottom"&&(xe+=I);var te=n.pstyle("text-halign").value;te==="left"?we-=re:te==="right"&&(we+=re);var Z=eo(L[0],L[1],[we-re,xe-I,we+re,xe-I,we+re,xe+I,we-re,xe+I],i.x,i.y);if(Z.length>0){var X=o,le=Qn(X,Ma(r)),ee=Qn(X,Ma(Z)),oe=le;if(ee<le&&(r=[Z[0],Z[1]],oe=ee),Z.length>2){var me=Qn(X,{x:Z[2],y:Z[3]});me<oe&&(r=[Z[2],Z[3]])}}}var be=ks(r,R,e.arrowShapes[c].spacing(t)+d),ye=ks(r,R,e.arrowShapes[c].gap(t)+d);p.startX=ye[0],p.startY=ye[1],p.arrowStartX=be[0],p.arrowStartY=be[1],k&&(!de(p.startX)||!de(p.startY)||!de(p.endX)||!de(p.endY)?p.badLine=!0:p.badLine=!1)},vo.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}}},vo.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 Cc={};function t3(t,e,r){for(var n=function(u,d,f,h){return gt(u,d,f,h)},a=e._private,i=a.rstyle.bezierPts,o=0;o<t.bezierProjPcts.length;o++){var l=t.bezierProjPcts[o];i.push({x:n(r[0],r[2],r[4],l),y:n(r[1],r[3],r[5],l)})}}Cc.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)t3(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 o=r.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth},Cc.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var Pr={};Pr.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!mn(e)){var r,n,a=t._private,i=t.width(),o=t.height(),l=t.padding(),c=t.position(),u=t.pstyle("text-halign").strValue,d=t.pstyle("text-valign").strValue,f=a.rscratch,h=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-o/2-l;break;case"bottom":n=c.y+o/2+l;break;default:n=c.y}f.labelX=r,f.labelY=n,h.labelX=r,h.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var F1=function(e,r){var n=Math.atan(r/e);return e===0&&n<0&&(n=n*-1),n},$1=function(e,r){var n=r.x-e.x,a=r.y-e.y;return F1(n,a)},r3=function(e,r,n,a){var i=Ji(0,a-.001,1),o=Ji(0,a+.001,1),l=Fa(e,r,n,i),c=Fa(e,r,n,o);return $1(l,c)};Pr.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 o=function(f,h,v){wn(r.rscratch,f,h,v),wn(r.rstyle,f,h,v)};o("labelX",null,e.x),o("labelY",null,e.y);var l=F1(n.midDispX,n.midDispY);o("labelAutoAngle",null,l);var c=function d(){if(d.cache)return d.cache;for(var f=[],h=0;h+5<n.allpts.length;h+=4){var v={x:n.allpts[h],y:n.allpts[h+1]},p={x:n.allpts[h+2],y:n.allpts[h+3]},g={x:n.allpts[h+4],y:n.allpts[h+5]};f.push({p0:v,p1:p,p2:g,startDist:0,length:0,segments:[]})}var m=r.rstyle.bezierPts,y=a.bezierProjPcts.length;function b(E,_,S,T,N){var B=Jn(_,S),O=E.segments[E.segments.length-1],D={p0:_,p1:S,t0:T,t1:N,startDist:O?O.startDist+O.length:0,length:B};E.segments.push(D),E.length+=B}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,m[w*y],0,a.bezierProjPcts[0]);for(var k=0;k<y-1;k++)b(C,m[w*y+k],m[w*y+k+1],a.bezierProjPcts[k],a.bezierProjPcts[k+1]);b(C,m[w*y+y-1],C.p2,a.bezierProjPcts[y-1],1)}return d.cache=f},u=function(f){var h,v=f==="source";if(i[f]){var p=t.pstyle(f+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var g=c(),m,y=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 k=C.segments[v?x:C.segments.length-1-x],E=w===g.length-1&&x===C.segments.length-1;if(y=b,b+=k.length,b>=p||E){m={cp:C,segment:k};break}}if(m)break}var _=m.cp,S=m.segment,T=(p-y)/S.length,N=S.t1-S.t0,B=v?S.t0+N*T:S.t1-N*T;B=Ji(0,B,1),e=Fa(_.p0,_.p1,_.p2,B),h=r3(_.p0,_.p1,_.p2,B);break}case"straight":case"segments":case"haystack":{for(var O=0,D,R,P,L,A=n.allpts.length,q=0;q+3<A&&(v?(P={x:n.allpts[q],y:n.allpts[q+1]},L={x:n.allpts[q+2],y:n.allpts[q+3]}):(P={x:n.allpts[A-2-q],y:n.allpts[A-1-q]},L={x:n.allpts[A-4-q],y:n.allpts[A-3-q]}),D=Jn(P,L),R=O,O+=D,!(O>=p));q+=2);var U=p-R,z=U/D;z=Ji(0,z,1),e=s5(P,L,z),h=$1(P,L);break}}o("labelX",f,e.x),o("labelY",f,e.y),o("labelAutoAngle",f,h)}};u("source"),u("target"),this.applyLabelDimensions(t)}},Pr.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},Pr.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),a=this.calculateLabelDimensions(t,n),i=t.pstyle("line-height").pfValue,o=t.pstyle("text-wrap").strValue,l=gr(r.rscratch,"labelWrapCachedLines",e)||[],c=o!=="wrap"?1:Math.max(l.length,1),u=a.height/c,d=u*i,f=a.width,h=a.height+(c-1)*(i-1)*u;wn(r.rstyle,"labelWidth",e,f),wn(r.rscratch,"labelWidth",e,f),wn(r.rstyle,"labelHeight",e,h),wn(r.rscratch,"labelHeight",e,h),wn(r.rscratch,"labelLineHeight",e,d)},Pr.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",a=t.pstyle(n+"label").strValue,i=t.pstyle("text-transform").value,o=function(Q,F){return F?(wn(r.rscratch,Q,e,F),F):gr(r.rscratch,Q,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=o("labelKey");if(c!=null&&o("labelWrapKey")===c)return o("labelWrapCachedText");for(var u="​",d=a.split(`
42
- `),f=t.pstyle("text-max-width").pfValue,h=t.pstyle("text-overflow-wrap").value,v=h==="anywhere",p=[],g=/[\s\u200b]+|$/g,m=0;m<d.length;m++){var y=d[m],b=this.calculateLabelDimensions(t,y),w=b.width;if(v){var C=y.split("").join(u);y=C}if(w>f){var x=y.matchAll(g),k="",E=0,_=w0(x),S;try{for(_.s();!(S=_.n()).done;){var T=S.value,N=T[0],B=y.substring(E,T.index);E=T.index+N.length;var O=k.length===0?B:k+B+N,D=this.calculateLabelDimensions(t,O),R=D.width;R<=f?k+=B+N:(k&&p.push(k),k=B+N)}}catch(H){_.e(H)}finally{_.f()}k.match(/^[\s\u200b]+$/)||p.push(k)}else p.push(y)}o("labelWrapCachedLines",p),a=o("labelWrapCachedText",p.join(`
43
- `)),o("labelWrapKey",c)}else if(l==="ellipsis"){var P=t.pstyle("text-max-width").pfValue,L="",A="…",q=!1;if(this.calculateLabelDimensions(t,a).width<P)return a;for(var U=0;U<a.length;U++){var z=this.calculateLabelDimensions(t,L+a[U]+A).width;if(z>P)break;L+=a[U],U===a.length-1&&(q=!0)}return q||(L+=A),L}return a},Pr.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},Pr.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),a=n.document,i=Xn(e,t._private.labelDimsKey),o=r.labelDimCache||(r.labelDimCache=[]),l=o[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,h=t.pstyle("font-weight").strValue,v=this.labelCalcCanvas,p=this.labelCalcCanvasContext;if(!v){v=this.labelCalcCanvas=a.createElement("canvas"),p=this.labelCalcCanvasContext=v.getContext("2d");var g=v.style;g.position="absolute",g.left="-9999px",g.top="-9999px",g.zIndex="-1",g.visibility="hidden",g.pointerEvents="none"}p.font="".concat(u," ").concat(h," ").concat(d,"px ").concat(f);for(var m=0,y=0,b=e.split(`
44
- `),w=0;w<b.length;w++){var C=b[w],x=p.measureText(C),k=Math.ceil(x.width),E=d;m=Math.max(k,m),y+=E}return m+=c,y+=c,o[i]={width:m,height:y}},Pr.calculateLabelAngle=function(t,e){var r=t._private,n=r.rscratch,a=t.isEdge(),i=e?e+"-":"",o=t.pstyle(i+"text-rotation"),l=o.strValue;return l==="none"?0:a&&l==="autorotate"?n.labelAutoAngle:l==="autorotate"?0:o.pfValue},Pr.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 V1={},q1=28,z1=!1;V1.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<q1||t.height()<q1))return z1||($e("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),z1=!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 tl={};tl.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,n=function(o){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),l)for(var c=0;c<o.length;c++){var u=o[c],d=u._private,f=d.rstyle;f.clean=!1,f.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(o){var l=o.target;n(l)}).on("style.* background.*",function(o){var l=o.target;n(l,!1)});var a=function(o){if(o){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 h=l[f];h(o,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){a(!0)},r.beforeRender(a,r.beforeRenderPriorities.eleCalcs)},tl.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)},tl.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 o=t[i],l=o._private,c=l.rstyle;o.isEdge()&&(!r(o.source())||!r(o.target()))&&(c.clean=!1),!(e&&c.clean||o.removed())&&o.pstyle("display").value!=="none"&&(l.group==="nodes"?a.push(o):n.push(o),c.clean=!0)}for(var u=0;u<a.length;u++){var d=a[u],f=d._private,h=f.rstyle,v=d.position();this.recalculateNodeLabelProjection(d),h.nodeX=v.x,h.nodeY=v.y,h.nodeW=d.pstyle("width").pfValue,h.nodeH=d.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var p=0;p<n.length;p++){var g=n[p],m=g._private,y=m.rstyle,b=m.rscratch;y.srcX=b.arrowStartX,y.srcY=b.arrowStartY,y.tgtX=b.arrowEndX,y.tgtY=b.arrowEndY,y.midX=b.midX,y.midY=b.midY,y.labelAngle=b.labelAngle,y.sourceLabelAngle=b.sourceLabelAngle,y.targetLabelAngle=b.targetLabelAngle}}};var rl={};rl.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)}}},rl.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},rl.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(a1),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var H1={};[ia,Js,Pt,vo,Cc,Pr,V1,tl,rl].forEach(function(t){Se(H1,t)});var K1={};K1.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 o=i.image=new Image;o.addEventListener("load",r),o.addEventListener("error",function(){o.error=!0});var l="data:",c=t.substring(0,l.length).toLowerCase()===l;return c||(e=e==="null"?null:e,o.crossOrigin=e),o.src=t,o};var ri={};ri.registerBinding=function(t,e,r,n){var a=Array.prototype.slice.apply(arguments,[1]),i=this.binder(t);return i.on.apply(i,a)},ri.binder=function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||TM(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 o=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:o,addEventListener:o,addListener:o,bind:o}},ri.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()},ri.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()},ri.load=function(){var t=this,e=t.cy.window(),r=function(I){return I.selected()},n=function(I,K,te,Z){I==null&&(I=t.cy);for(var X=0;X<K.length;X++){var le=K[X];I.emit({originalEvent:te,type:le,position:Z})}},a=function(I){return I.shiftKey||I.metaKey||I.ctrlKey},i=function(I,K){var te=!0;if(t.cy.hasCompoundNodes()&&I&&I.pannable())for(var Z=0;K&&Z<K.length;Z++){var I=K[Z];if(I.isNode()&&I.isParent()&&!I.pannable()){te=!1;break}}else te=!0;return te},o=function(I){I[0]._private.grabbed=!0},l=function(I){I[0]._private.grabbed=!1},c=function(I){I[0]._private.rscratch.inDragLayer=!0},u=function(I){I[0]._private.rscratch.inDragLayer=!1},d=function(I){I[0]._private.rscratch.isGrabTarget=!0},f=function(I){I[0]._private.rscratch.isGrabTarget=!1},h=function(I,K){var te=K.addToList,Z=te.has(I);!Z&&I.grabbable()&&!I.locked()&&(te.merge(I),o(I))},v=function(I,K){if(I.cy().hasCompoundNodes()&&!(K.inDragLayer==null&&K.addToList==null)){var te=I.descendants();K.inDragLayer&&(te.forEach(c),te.connectedEdges().forEach(c)),K.addToList&&h(te,K)}},p=function(I,K){K=K||{};var te=I.cy().hasCompoundNodes();K.inDragLayer&&(I.forEach(c),I.neighborhood().stdFilter(function(Z){return!te||Z.isEdge()}).forEach(c)),K.addToList&&I.forEach(function(Z){h(Z,K)}),v(I,K),y(I,{inDragLayer:K.inDragLayer}),t.updateCachedGrabbedEles()},g=p,m=function(I){I&&(t.getCachedZSortedEles().forEach(function(K){l(K),u(K),f(K)}),t.updateCachedGrabbedEles())},y=function(I,K){if(!(K.inDragLayer==null&&K.addToList==null)&&I.cy().hasCompoundNodes()){var te=I.ancestors().orphans();if(!te.same(I)){var Z=te.descendants().spawnSelf().merge(te).unmerge(I).unmerge(I.descendants()),X=Z.connectedEdges();K.inDragLayer&&(X.forEach(c),Z.forEach(c)),K.addToList&&Z.forEach(function(le){h(le,K)})}}},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(re){for(var I=0;I<re.length;I++){var K=re[I],te=K.removedNodes;if(te)for(var Z=0;Z<te.length;Z++){var X=te[Z];if(X===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(re){t.destroy()});var x=hs(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 k=function(I,K){for(;I!=null;)K(I),I=I.parentNode},E=function(){t.invalidateContainerClientCoordsCache()};k(t.container,function(re){t.registerBinding(re,"transitionend",E),t.registerBinding(re,"animationend",E),t.registerBinding(re,"scroll",E)}),t.registerBinding(t.container,"contextmenu",function(re){re.preventDefault()});var _=function(){return t.selection[4]!==0},S=function(I){for(var K=t.findContainerClientCoords(),te=K[0],Z=K[1],X=K[2],le=K[3],ee=I.touches?I.touches:[I],oe=!1,me=0;me<ee.length;me++){var be=ee[me];if(te<=be.clientX&&be.clientX<=te+X&&Z<=be.clientY&&be.clientY<=Z+le){oe=!0;break}}if(!oe)return!1;for(var ye=t.container,_e=I.target,ge=_e.parentNode,Ce=!1;ge;){if(ge===ye){Ce=!0;break}ge=ge.parentNode}return!!Ce};t.registerBinding(t.container,"mousedown",function(I){if(S(I)&&!(t.hoverData.which===1&&I.which!==1)){I.preventDefault(),b(),t.hoverData.capture=!0,t.hoverData.which=I.which;var K=t.cy,te=[I.clientX,I.clientY],Z=t.projectIntoViewport(te[0],te[1]),X=t.selection,le=t.findNearestElements(Z[0],Z[1],!0,!1),ee=le[0],oe=t.dragData.possibleDragElements;t.hoverData.mdownPos=Z,t.hoverData.mdownGPos=te;var me=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var je=t.hoverData.down;je?je.emit({originalEvent:I,type:"taphold",position:{x:Z[0],y:Z[1]}}):K.emit({originalEvent:I,type:"taphold",position:{x:Z[0],y:Z[1]}})}},t.tapholdDuration)};if(I.which==3){t.hoverData.cxtStarted=!0;var be={originalEvent:I,type:"cxttapstart",position:{x:Z[0],y:Z[1]}};ee?(ee.activate(),ee.emit(be),t.hoverData.down=ee):K.emit(be),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(I.which==1){ee&&ee.activate();{if(ee!=null&&t.nodeIsGrabbable(ee)){var ye=function(je){return{originalEvent:I,type:je,position:{x:Z[0],y:Z[1]}}},_e=function(je){je.emit(ye("grab"))};if(d(ee),!ee.selected())oe=t.dragData.possibleDragElements=K.collection(),g(ee,{addToList:oe}),ee.emit(ye("grabon")).emit(ye("grab"));else{oe=t.dragData.possibleDragElements=K.collection();var ge=K.$(function(Ce){return Ce.isNode()&&Ce.selected()&&t.nodeIsGrabbable(Ce)});p(ge,{addToList:oe}),ee.emit(ye("grabon")),ge.forEach(_e)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=ee,t.hoverData.downs=le,t.hoverData.downTime=new Date().getTime()}n(ee,["mousedown","tapstart","vmousedown"],I,{x:Z[0],y:Z[1]}),ee==null?(X[4]=1,t.data.bgActivePosistion={x:Z[0],y:Z[1]},t.redrawHint("select",!0),t.redraw()):ee.pannable()&&(X[4]=1),me()}X[0]=X[2]=Z[0],X[1]=X[3]=Z[1]}},!1),t.registerBinding(e,"mousemove",function(I){var K=t.hoverData.capture;if(!(!K&&!S(I))){var te=!1,Z=t.cy,X=Z.zoom(),le=[I.clientX,I.clientY],ee=t.projectIntoViewport(le[0],le[1]),oe=t.hoverData.mdownPos,me=t.hoverData.mdownGPos,be=t.selection,ye=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(ye=t.findNearestElement(ee[0],ee[1],!0,!1));var _e=t.hoverData.last,ge=t.hoverData.down,Ce=[ee[0]-be[2],ee[1]-be[3]],je=t.dragData.possibleDragElements,qe;if(me){var it=le[0]-me[0],ot=it*it,et=le[1]-me[1],At=et*et,pt=ot+At;t.hoverData.isOverThresholdDrag=qe=pt>=t.desktopTapThreshold2}var mt=a(I);qe&&(t.hoverData.tapholdCancelled=!0);var Jt=function(){var J=t.hoverData.dragDelta=t.hoverData.dragDelta||[];J.length===0?(J.push(Ce[0]),J.push(Ce[1])):(J[0]+=Ce[0],J[1]+=Ce[1])};te=!0,n(ye,["mousemove","vmousemove","tapdrag"],I,{x:ee[0],y:ee[1]});var Rt=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||Z.emit({originalEvent:I,type:"boxstart",position:{x:ee[0],y:ee[1]}}),be[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(qe){var Lt={originalEvent:I,type:"cxtdrag",position:{x:ee[0],y:ee[1]}};ge?ge.emit(Lt):Z.emit(Lt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||ye!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:I,type:"cxtdragout",position:{x:ee[0],y:ee[1]}}),t.hoverData.cxtOver=ye,ye&&ye.emit({originalEvent:I,type:"cxtdragover",position:{x:ee[0],y:ee[1]}}))}}else if(t.hoverData.dragging){if(te=!0,Z.panningEnabled()&&Z.userPanningEnabled()){var lr;if(t.hoverData.justStartedPan){var Cr=t.hoverData.mdownPos;lr={x:(ee[0]-Cr[0])*X,y:(ee[1]-Cr[1])*X},t.hoverData.justStartedPan=!1}else lr={x:Ce[0]*X,y:Ce[1]*X};Z.panBy(lr),Z.emit("dragpan"),t.hoverData.dragged=!0}ee=t.projectIntoViewport(I.clientX,I.clientY)}else if(be[4]==1&&(ge==null||ge.pannable())){if(qe){if(!t.hoverData.dragging&&Z.boxSelectionEnabled()&&(mt||!Z.panningEnabled()||!Z.userPanningEnabled()))Rt();else if(!t.hoverData.selecting&&Z.panningEnabled()&&Z.userPanningEnabled()){var jt=i(ge,t.hoverData.downs);jt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,be[4]=0,t.data.bgActivePosistion=Ma(oe),t.redrawHint("select",!0),t.redraw())}ge&&ge.pannable()&&ge.active()&&ge.unactivate()}}else{if(ge&&ge.pannable()&&ge.active()&&ge.unactivate(),(!ge||!ge.grabbed())&&ye!=_e&&(_e&&n(_e,["mouseout","tapdragout"],I,{x:ee[0],y:ee[1]}),ye&&n(ye,["mouseover","tapdragover"],I,{x:ee[0],y:ee[1]}),t.hoverData.last=ye),ge)if(qe){if(Z.boxSelectionEnabled()&&mt)ge&&ge.grabbed()&&(m(je),ge.emit("freeon"),je.emit("free"),t.dragData.didDrag&&(ge.emit("dragfreeon"),je.emit("dragfree"))),Rt();else if(ge&&ge.grabbed()&&t.nodeIsDraggable(ge)){var tt=!t.dragData.didDrag;tt&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(je,{inDragLayer:!0});var st={x:0,y:0};if(de(Ce[0])&&de(Ce[1])&&(st.x+=Ce[0],st.y+=Ce[1],tt)){var yt=t.hoverData.dragDelta;yt&&de(yt[0])&&de(yt[1])&&(st.x+=yt[0],st.y+=yt[1])}t.hoverData.draggingEles=!0,je.silentShift(st).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else Jt();te=!0}if(be[2]=ee[0],be[3]=ee[1],te)return I.stopPropagation&&I.stopPropagation(),I.preventDefault&&I.preventDefault(),!1}},!1);var T,N,B;t.registerBinding(e,"mouseup",function(I){if(!(t.hoverData.which===1&&I.which!==1&&t.hoverData.capture)){var K=t.hoverData.capture;if(K){t.hoverData.capture=!1;var te=t.cy,Z=t.projectIntoViewport(I.clientX,I.clientY),X=t.selection,le=t.findNearestElement(Z[0],Z[1],!0,!1),ee=t.dragData.possibleDragElements,oe=t.hoverData.down,me=a(I);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,oe&&oe.unactivate(),t.hoverData.which===3){var be={originalEvent:I,type:"cxttapend",position:{x:Z[0],y:Z[1]}};if(oe?oe.emit(be):te.emit(be),!t.hoverData.cxtDragged){var ye={originalEvent:I,type:"cxttap",position:{x:Z[0],y:Z[1]}};oe?oe.emit(ye):te.emit(ye)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(n(le,["mouseup","tapend","vmouseup"],I,{x:Z[0],y:Z[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(n(oe,["click","tap","vclick"],I,{x:Z[0],y:Z[1]}),N=!1,I.timeStamp-B<=te.multiClickDebounceTime()?(T&&clearTimeout(T),N=!0,B=null,n(oe,["dblclick","dbltap","vdblclick"],I,{x:Z[0],y:Z[1]})):(T=setTimeout(function(){N||n(oe,["oneclick","onetap","voneclick"],I,{x:Z[0],y:Z[1]})},te.multiClickDebounceTime()),B=I.timeStamp)),oe==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(I)&&(te.$(r).unselect(["tapunselect"]),ee.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=ee=te.collection()),le==oe&&!t.dragData.didDrag&&!t.hoverData.selecting&&le!=null&&le._private.selectable&&(t.hoverData.dragging||(te.selectionType()==="additive"||me?le.selected()?le.unselect(["tapunselect"]):le.select(["tapselect"]):me||(te.$(r).unmerge(le).unselect(["tapunselect"]),le.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var _e=te.collection(t.getAllInBox(X[0],X[1],X[2],X[3]));t.redrawHint("select",!0),_e.length>0&&t.redrawHint("eles",!0),te.emit({type:"boxend",originalEvent:I,position:{x:Z[0],y:Z[1]}});var ge=function(qe){return qe.selectable()&&!qe.selected()};te.selectionType()==="additive"||me||te.$(r).unmerge(_e).unselect(),_e.emit("box").stdFilter(ge).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!X[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Ce=oe&&oe.grabbed();m(ee),Ce&&(oe.emit("freeon"),ee.emit("free"),t.dragData.didDrag&&(oe.emit("dragfreeon"),ee.emit("dragfree")))}}X[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var O=function(I){if(!t.scrollingPage){var K=t.cy,te=K.zoom(),Z=K.pan(),X=t.projectIntoViewport(I.clientX,I.clientY),le=[X[0]*te+Z.x,X[1]*te+Z.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||_()){I.preventDefault();return}if(K.panningEnabled()&&K.userPanningEnabled()&&K.zoomingEnabled()&&K.userZoomingEnabled()){I.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 ee;I.deltaY!=null?ee=I.deltaY/-250:I.wheelDeltaY!=null?ee=I.wheelDeltaY/1e3:ee=I.wheelDelta/1e3,ee=ee*t.wheelSensitivity;var oe=I.deltaMode===1;oe&&(ee*=33);var me=K.zoom()*Math.pow(10,ee);I.type==="gesturechange"&&(me=t.gestureStartZoom*I.scale),K.zoom({level:me,renderedPosition:{x:le[0],y:le[1]}}),K.emit(I.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",O,!0),t.registerBinding(e,"scroll",function(I){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(I){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||I.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(re){t.hasTouchStarted||O(re)},!0),t.registerBinding(t.container,"mouseout",function(I){var K=t.projectIntoViewport(I.clientX,I.clientY);t.cy.emit({originalEvent:I,type:"mouseout",position:{x:K[0],y:K[1]}})},!1),t.registerBinding(t.container,"mouseover",function(I){var K=t.projectIntoViewport(I.clientX,I.clientY);t.cy.emit({originalEvent:I,type:"mouseover",position:{x:K[0],y:K[1]}})},!1);var D,R,P,L,A,q,U,z,H,Q,F,$,V,G=function(I,K,te,Z){return Math.sqrt((te-I)*(te-I)+(Z-K)*(Z-K))},j=function(I,K,te,Z){return(te-I)*(te-I)+(Z-K)*(Z-K)},M;t.registerBinding(t.container,"touchstart",M=function(I){if(t.hasTouchStarted=!0,!!S(I)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var K=t.cy,te=t.touchData.now,Z=t.touchData.earlier;if(I.touches[0]){var X=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);te[0]=X[0],te[1]=X[1]}if(I.touches[1]){var X=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);te[2]=X[0],te[3]=X[1]}if(I.touches[2]){var X=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);te[4]=X[0],te[5]=X[1]}if(I.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var le=t.findContainerClientCoords();H=le[0],Q=le[1],F=le[2],$=le[3],D=I.touches[0].clientX-H,R=I.touches[0].clientY-Q,P=I.touches[1].clientX-H,L=I.touches[1].clientY-Q,V=0<=D&&D<=F&&0<=P&&P<=F&&0<=R&&R<=$&&0<=L&&L<=$;var ee=K.pan(),oe=K.zoom();A=G(D,R,P,L),q=j(D,R,P,L),U=[(D+P)/2,(R+L)/2],z=[(U[0]-ee.x)/oe,(U[1]-ee.y)/oe];var me=200,be=me*me;if(q<be&&!I.touches[2]){var ye=t.findNearestElement(te[0],te[1],!0,!0),_e=t.findNearestElement(te[2],te[3],!0,!0);ye&&ye.isNode()?(ye.activate().emit({originalEvent:I,type:"cxttapstart",position:{x:te[0],y:te[1]}}),t.touchData.start=ye):_e&&_e.isNode()?(_e.activate().emit({originalEvent:I,type:"cxttapstart",position:{x:te[0],y:te[1]}}),t.touchData.start=_e):K.emit({originalEvent:I,type:"cxttapstart",position:{x:te[0],y:te[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(I.touches[2])K.boxSelectionEnabled()&&I.preventDefault();else if(!I.touches[1]){if(I.touches[0]){var ge=t.findNearestElements(te[0],te[1],!0,!0),Ce=ge[0];if(Ce!=null&&(Ce.activate(),t.touchData.start=Ce,t.touchData.starts=ge,t.nodeIsGrabbable(Ce))){var je=t.dragData.touchDragEles=K.collection(),qe=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),Ce.selected()?(qe=K.$(function(pt){return pt.selected()&&t.nodeIsGrabbable(pt)}),p(qe,{addToList:je})):g(Ce,{addToList:je}),d(Ce);var it=function(mt){return{originalEvent:I,type:mt,position:{x:te[0],y:te[1]}}};Ce.emit(it("grabon")),qe?qe.forEach(function(pt){pt.emit(it("grab"))}):Ce.emit(it("grab"))}n(Ce,["touchstart","tapstart","vmousedown"],I,{x:te[0],y:te[1]}),Ce==null&&(t.data.bgActivePosistion={x:X[0],y:X[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"],I,{x:te[0],y:te[1]})},t.tapholdDuration)}}if(I.touches.length>=1){for(var ot=t.touchData.startPosition=[null,null,null,null,null,null],et=0;et<te.length;et++)ot[et]=Z[et]=te[et];var At=I.touches[0];t.touchData.startGPosition=[At.clientX,At.clientY]}}},!1);var W;t.registerBinding(e,"touchmove",W=function(I){var K=t.touchData.capture;if(!(!K&&!S(I))){var te=t.selection,Z=t.cy,X=t.touchData.now,le=t.touchData.earlier,ee=Z.zoom();if(I.touches[0]){var oe=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);X[0]=oe[0],X[1]=oe[1]}if(I.touches[1]){var oe=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);X[2]=oe[0],X[3]=oe[1]}if(I.touches[2]){var oe=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);X[4]=oe[0],X[5]=oe[1]}var me=t.touchData.startGPosition,be;if(K&&I.touches[0]&&me){for(var ye=[],_e=0;_e<X.length;_e++)ye[_e]=X[_e]-le[_e];var ge=I.touches[0].clientX-me[0],Ce=ge*ge,je=I.touches[0].clientY-me[1],qe=je*je,it=Ce+qe;be=it>=t.touchTapThreshold2}if(K&&t.touchData.cxt){I.preventDefault();var ot=I.touches[0].clientX-H,et=I.touches[0].clientY-Q,At=I.touches[1].clientX-H,pt=I.touches[1].clientY-Q,mt=j(ot,et,At,pt),Jt=mt/q,Rt=150,Lt=Rt*Rt,lr=1.5,Cr=lr*lr;if(Jt>=Cr||mt>=Lt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var jt={originalEvent:I,type:"cxttapend",position:{x:X[0],y:X[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(jt),t.touchData.start=null):Z.emit(jt)}}if(K&&t.touchData.cxt){var jt={originalEvent:I,type:"cxtdrag",position:{x:X[0],y:X[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(jt):Z.emit(jt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var tt=t.findNearestElement(X[0],X[1],!0,!0);(!t.touchData.cxtOver||tt!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:I,type:"cxtdragout",position:{x:X[0],y:X[1]}}),t.touchData.cxtOver=tt,tt&&tt.emit({originalEvent:I,type:"cxtdragover",position:{x:X[0],y:X[1]}}))}else if(K&&I.touches[2]&&Z.boxSelectionEnabled())I.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||Z.emit({originalEvent:I,type:"boxstart",position:{x:X[0],y:X[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,te[4]=1,!te||te.length===0||te[0]===void 0?(te[0]=(X[0]+X[2]+X[4])/3,te[1]=(X[1]+X[3]+X[5])/3,te[2]=(X[0]+X[2]+X[4])/3+1,te[3]=(X[1]+X[3]+X[5])/3+1):(te[2]=(X[0]+X[2]+X[4])/3,te[3]=(X[1]+X[3]+X[5])/3),t.redrawHint("select",!0),t.redraw();else if(K&&I.touches[1]&&!t.touchData.didSelect&&Z.zoomingEnabled()&&Z.panningEnabled()&&Z.userZoomingEnabled()&&Z.userPanningEnabled()){I.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var st=t.dragData.touchDragEles;if(st){t.redrawHint("drag",!0);for(var yt=0;yt<st.length;yt++){var Pn=st[yt]._private;Pn.grabbed=!1,Pn.rscratch.inDragLayer=!1}}var J=t.touchData.start,ot=I.touches[0].clientX-H,et=I.touches[0].clientY-Q,At=I.touches[1].clientX-H,pt=I.touches[1].clientY-Q,he=G(ot,et,At,pt),Pe=he/A;if(V){var He=ot-D,Mr=et-R,An=At-P,fi=pt-L,nn=(He+An)/2,ur=(Mr+fi)/2,Rn=Z.zoom(),Sg=Rn*Pe,kl=Z.pan(),D_=z[0]*Rn+kl.x,O_=z[1]*Rn+kl.y,rG={x:-Sg/Rn*(D_-kl.x-nn)+D_,y:-Sg/Rn*(O_-kl.y-ur)+O_};if(J&&J.active()){var st=t.dragData.touchDragEles;m(st),t.redrawHint("drag",!0),t.redrawHint("eles",!0),J.unactivate().emit("freeon"),st.emit("free"),t.dragData.didDrag&&(J.emit("dragfreeon"),st.emit("dragfree"))}Z.viewport({zoom:Sg,pan:rG,cancelOnFailedZoom:!0}),Z.emit("pinchzoom"),A=he,D=ot,R=et,P=At,L=pt,t.pinching=!0}if(I.touches[0]){var oe=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);X[0]=oe[0],X[1]=oe[1]}if(I.touches[1]){var oe=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);X[2]=oe[0],X[3]=oe[1]}if(I.touches[2]){var oe=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);X[4]=oe[0],X[5]=oe[1]}}else if(I.touches[0]&&!t.touchData.didSelect){var Er=t.touchData.start,_g=t.touchData.last,tt;if(!t.hoverData.draggingEles&&!t.swipePanning&&(tt=t.findNearestElement(X[0],X[1],!0,!0)),K&&Er!=null&&I.preventDefault(),K&&Er!=null&&t.nodeIsDraggable(Er))if(be){var st=t.dragData.touchDragEles,P_=!t.dragData.didDrag;P_&&p(st,{inDragLayer:!0}),t.dragData.didDrag=!0;var No={x:0,y:0};if(de(ye[0])&&de(ye[1])&&(No.x+=ye[0],No.y+=ye[1],P_)){t.redrawHint("eles",!0);var xr=t.touchData.dragDelta;xr&&de(xr[0])&&de(xr[1])&&(No.x+=xr[0],No.y+=xr[1])}t.hoverData.draggingEles=!0,st.silentShift(No).emit("position drag"),t.redrawHint("drag",!0),t.touchData.startPosition[0]==le[0]&&t.touchData.startPosition[1]==le[1]&&t.redrawHint("eles",!0),t.redraw()}else{var xr=t.touchData.dragDelta=t.touchData.dragDelta||[];xr.length===0?(xr.push(ye[0]),xr.push(ye[1])):(xr[0]+=ye[0],xr[1]+=ye[1])}if(n(Er||tt,["touchmove","tapdrag","vmousemove"],I,{x:X[0],y:X[1]}),(!Er||!Er.grabbed())&&tt!=_g&&(_g&&_g.emit({originalEvent:I,type:"tapdragout",position:{x:X[0],y:X[1]}}),tt&&tt.emit({originalEvent:I,type:"tapdragover",position:{x:X[0],y:X[1]}})),t.touchData.last=tt,K)for(var yt=0;yt<X.length;yt++)X[yt]&&t.touchData.startPosition[yt]&&be&&(t.touchData.singleTouchMoved=!0);if(K&&(Er==null||Er.pannable())&&Z.panningEnabled()&&Z.userPanningEnabled()){var nG=i(Er,t.touchData.starts);nG&&(I.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=Ma(t.touchData.startPosition)),t.swipePanning?(Z.panBy({x:ye[0]*ee,y:ye[1]*ee}),Z.emit("dragpan")):be&&(t.swipePanning=!0,Z.panBy({x:ge*ee,y:je*ee}),Z.emit("dragpan"),Er&&(Er.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var oe=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);X[0]=oe[0],X[1]=oe[1]}}for(var _e=0;_e<X.length;_e++)le[_e]=X[_e];K&&I.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 Y;t.registerBinding(e,"touchcancel",Y=function(I){var K=t.touchData.start;t.touchData.capture=!1,K&&K.unactivate()});var se,ce,ae,ne;if(t.registerBinding(e,"touchend",se=function(I){var K=t.touchData.start,te=t.touchData.capture;if(te)I.touches.length===0&&(t.touchData.capture=!1),I.preventDefault();else return;var Z=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var X=t.cy,le=X.zoom(),ee=t.touchData.now,oe=t.touchData.earlier;if(I.touches[0]){var me=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);ee[0]=me[0],ee[1]=me[1]}if(I.touches[1]){var me=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);ee[2]=me[0],ee[3]=me[1]}if(I.touches[2]){var me=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);ee[4]=me[0],ee[5]=me[1]}K&&K.unactivate();var be;if(t.touchData.cxt){if(be={originalEvent:I,type:"cxttapend",position:{x:ee[0],y:ee[1]}},K?K.emit(be):X.emit(be),!t.touchData.cxtDragged){var ye={originalEvent:I,type:"cxttap",position:{x:ee[0],y:ee[1]}};K?K.emit(ye):X.emit(ye)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!I.touches[2]&&X.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var _e=X.collection(t.getAllInBox(Z[0],Z[1],Z[2],Z[3]));Z[0]=void 0,Z[1]=void 0,Z[2]=void 0,Z[3]=void 0,Z[4]=0,t.redrawHint("select",!0),X.emit({type:"boxend",originalEvent:I,position:{x:ee[0],y:ee[1]}});var ge=function(Lt){return Lt.selectable()&&!Lt.selected()};_e.emit("box").stdFilter(ge).select().emit("boxselect"),_e.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(K!=null&&K.unactivate(),I.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!I.touches[1]){if(!I.touches[0]){if(!I.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ce=t.dragData.touchDragEles;if(K!=null){var je=K._private.grabbed;m(Ce),t.redrawHint("drag",!0),t.redrawHint("eles",!0),je&&(K.emit("freeon"),Ce.emit("free"),t.dragData.didDrag&&(K.emit("dragfreeon"),Ce.emit("dragfree"))),n(K,["touchend","tapend","vmouseup","tapdragout"],I,{x:ee[0],y:ee[1]}),K.unactivate(),t.touchData.start=null}else{var qe=t.findNearestElement(ee[0],ee[1],!0,!0);n(qe,["touchend","tapend","vmouseup","tapdragout"],I,{x:ee[0],y:ee[1]})}var it=t.touchData.startPosition[0]-ee[0],ot=it*it,et=t.touchData.startPosition[1]-ee[1],At=et*et,pt=ot+At,mt=pt*le*le;t.touchData.singleTouchMoved||(K||X.$(":selected").unselect(["tapunselect"]),n(K,["tap","vclick"],I,{x:ee[0],y:ee[1]}),ce=!1,I.timeStamp-ne<=X.multiClickDebounceTime()?(ae&&clearTimeout(ae),ce=!0,ne=null,n(K,["dbltap","vdblclick"],I,{x:ee[0],y:ee[1]})):(ae=setTimeout(function(){ce||n(K,["onetap","voneclick"],I,{x:ee[0],y:ee[1]})},X.multiClickDebounceTime()),ne=I.timeStamp)),K!=null&&!t.dragData.didDrag&&K._private.selectable&&mt<t.touchTapThreshold2&&!t.pinching&&(X.selectionType()==="single"?(X.$(r).unmerge(K).unselect(["tapunselect"]),K.select(["tapselect"])):K.selected()?K.unselect(["tapunselect"]):K.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var Jt=0;Jt<ee.length;Jt++)oe[Jt]=ee[Jt];t.dragData.didDrag=!1,I.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),I.touches.length<2&&(I.touches.length===1&&(t.touchData.startGPosition=[I.touches[0].clientX,I.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var ue=[],ie=function(I){return{clientX:I.clientX,clientY:I.clientY,force:1,identifier:I.pointerId,pageX:I.pageX,pageY:I.pageY,radiusX:I.width/2,radiusY:I.height/2,screenX:I.screenX,screenY:I.screenY,target:I.target}},fe=function(I){return{event:I,touch:ie(I)}},pe=function(I){ue.push(fe(I))},De=function(I){for(var K=0;K<ue.length;K++){var te=ue[K];if(te.event.pointerId===I.pointerId){ue.splice(K,1);return}}},Ie=function(I){var K=ue.filter(function(te){return te.event.pointerId===I.pointerId})[0];K.event=I,K.touch=ie(I)},we=function(I){I.touches=ue.map(function(K){return K.touch})},xe=function(I){return I.pointerType==="mouse"||I.pointerType===4};t.registerBinding(t.container,"pointerdown",function(re){xe(re)||(re.preventDefault(),pe(re),we(re),M(re))}),t.registerBinding(t.container,"pointerup",function(re){xe(re)||(De(re),we(re),se(re))}),t.registerBinding(t.container,"pointercancel",function(re){xe(re)||(De(re),we(re),Y(re))}),t.registerBinding(t.container,"pointermove",function(re){xe(re)||(re.preventDefault(),Ie(re),we(re),W(re))})}};var Jr={};Jr.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,a,i,o,l,c){this.renderer.nodeShapeImpl("polygon",n,a,i,o,l,this.points)},intersectLine:function(n,a,i,o,l,c,u,d){return eo(l,c,this.points,n,a,i/2,o/2,u)},checkPoint:function(n,a,i,o,l,c,u,d){return Yr(n,a,this.points,c,u,o,l,[0,-1],i)}}},Jr.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,o,l,c){return w5(i,o,e,r,n/2+l,a/2+l)},checkPoint:function(e,r,n,a,i,o,l,c){return ea(e,r,a,i,o,l,n)}}},Jr.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,a,i,o,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=o/2;l=l==="auto"?Q0(i,o):l;for(var h=new Array(e.length/2),v=0;v<e.length/2;v++)h[v]={x:n+d*e[v*2],y:a+f*e[v*2+1]};var p,g,m,y,b=h.length;for(g=h[b-1],p=0;p<b;p++)m=h[p%b],y=h[(p+1)%b],c[u][p]=wc(g,m,y,l),g=m,m=y;return c[u]},draw:function(n,a,i,o,l,c,u){this.renderer.nodeShapeImpl("round-polygon",n,a,i,o,l,this.points,this.getOrCreateCorners(a,i,o,l,c,u,"drawCorners"))},intersectLine:function(n,a,i,o,l,c,u,d,f){return C5(l,c,this.points,n,a,i,o,u,this.getOrCreateCorners(n,a,i,o,d,f,"corners"))},checkPoint:function(n,a,i,o,l,c,u,d,f){return b5(n,a,this.points,c,u,o,l,this.getOrCreateCorners(c,u,o,l,d,f,"corners"))}}},Jr.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Ft(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,o)},intersectLine:function(e,r,n,a,i,o,l,c){return X0(i,o,e,r,n,a,l,c)},checkPoint:function(e,r,n,a,i,o,l,c){var u=a/2,d=i/2;c=c==="auto"?ta(a,i):c,c=Math.min(u,d,c);var f=c*2;return!!(Yr(e,r,this.points,o,l,a,i-f,[0,-1],n)||Yr(e,r,this.points,o,l,a-f,i,[0,-1],n)||ea(e,r,f,f,o-u+c,l-d+c,n)||ea(e,r,f,f,o+u-c,l-d+c,n)||ea(e,r,f,f,o+u-c,l+d-c,n)||ea(e,r,f,f,o-u+c,l+d-c,n))}}},Jr.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Gu(),points:Ft(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,null,o)},generateCutTrianglePts:function(e,r,n,a,i){var o=i==="auto"?this.cornerLength:i,l=r/2,c=e/2,u=n-c,d=n+c,f=a-l,h=a+l;return{topLeft:[u,f+o,u+o,f,u+o,f+o],topRight:[d-o,f,d,f+o,d-o,f+o],bottomRight:[d,h-o,d-o,h,d-o,h-o],bottomLeft:[u+o,h,u,h-o,u+o,h-o]}},intersectLine:function(e,r,n,a,i,o,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 eo(i,o,d,e,r)},checkPoint:function(e,r,n,a,i,o,l,c){var u=c==="auto"?this.cornerLength:c;if(Yr(e,r,this.points,o,l,a,i-2*u,[0,-1],n)||Yr(e,r,this.points,o,l,a-2*u,i,[0,-1],n))return!0;var d=this.generateCutTrianglePts(a,i,o,l);return Gt(e,r,d.topLeft)||Gt(e,r,d.topRight)||Gt(e,r,d.bottomRight)||Gt(e,r,d.bottomLeft)}}},Jr.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Ft(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,o,l,c){var u=.15,d=.5,f=.85,h=this.generateBarrelBezierPts(n+2*l,a+2*l,e,r),v=function(m){var y=Fa({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},u),b=Fa({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},d),w=Fa({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},f);return[m[0],m[1],y.x,y.y,b.x,b.y,w.x,w.y,m[4],m[5]]},p=[].concat(v(h.topLeft),v(h.topRight),v(h.bottomRight),v(h.bottomLeft));return eo(i,o,p,e,r)},generateBarrelBezierPts:function(e,r,n,a){var i=r/2,o=e/2,l=n-o,c=n+o,u=a-i,d=a+i,f=Uu(e,r),h=f.heightOffset,v=f.widthOffset,p=f.ctrlPtOffsetPct*e,g={topLeft:[l,u+h,l+p,u,l+v,u],topRight:[c-v,u,c-p,u,c,u+h],bottomRight:[c,d-h,c-p,d,c-v,d],bottomLeft:[l+v,d,l+p,d,l,d-h]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g},checkPoint:function(e,r,n,a,i,o,l,c){var u=Uu(a,i),d=u.heightOffset,f=u.widthOffset;if(Yr(e,r,this.points,o,l,a,i-2*d,[0,-1],n)||Yr(e,r,this.points,o,l,a-2*f,i,[0,-1],n))return!0;for(var h=this.generateBarrelBezierPts(a,i,o,l),v=function(_,S,T){var N=T[4],B=T[2],O=T[0],D=T[5],R=T[1],P=Math.min(N,O),L=Math.max(N,O),A=Math.min(D,R),q=Math.max(D,R);if(P<=_&&_<=L&&A<=S&&S<=q){var U=E5(N,B,O),z=v5(U[0],U[1],U[2],_),H=z.filter(function(Q){return 0<=Q&&Q<=1});if(H.length>0)return H[0]}return null},p=Object.keys(h),g=0;g<p.length;g++){var m=p[g],y=h[m],b=v(e,r,y);if(b!=null){var w=y[5],C=y[3],x=y[1],k=gt(w,C,x,b);if(y.isTop&&k<=r||y.isBottom&&r<=k)return!0}}return!1}}},Jr.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Ft(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,o)},intersectLine:function(e,r,n,a,i,o,l,c){var u=e-(n/2+l),d=r-(a/2+l),f=d,h=e+(n/2+l),v=Cn(i,o,e,r,u,d,h,f,!1);return v.length>0?v:X0(i,o,e,r,n,a,l,c)},checkPoint:function(e,r,n,a,i,o,l,c){c=c==="auto"?ta(a,i):c;var u=2*c;if(Yr(e,r,this.points,o,l,a,i-u,[0,-1],n)||Yr(e,r,this.points,o,l,a-u,i,[0,-1],n))return!0;var d=a/2+2*n,f=i/2+2*n,h=[o-d,l-f,o-d,l,o+d,l,o+d,l-f];return!!(Gt(e,r,h)||ea(e,r,u,u,o+a/2-c,l+i/2-c,n)||ea(e,r,u,u,o-a/2+c,l+i/2-c,n))}}},Jr.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Ft(3,0)),this.generateRoundPolygon("round-triangle",Ft(3,0)),this.generatePolygon("rectangle",Ft(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",Ft(5,0)),this.generateRoundPolygon("round-pentagon",Ft(5,0)),this.generatePolygon("hexagon",Ft(6,0)),this.generateRoundPolygon("round-hexagon",Ft(6,0)),this.generatePolygon("heptagon",Ft(7,0)),this.generateRoundPolygon("round-heptagon",Ft(7,0)),this.generatePolygon("octagon",Ft(8,0)),this.generateRoundPolygon("round-octagon",Ft(8,0));var n=new Array(20);{var a=Ku(5,0),i=Ku(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var l=0;l<i.length/2;l++)i[l*2]*=o,i[l*2+1]*=o;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=J0(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,h;return(h=this[f])?h:e.generatePolygon(f,u)}};var go={};go.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},go.redraw=function(t){t=t||K0();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},go.beforeRender=function(t,e){if(!this.destroyed){e==null&&Je("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 G1=function(e,r,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(r,n)};go.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){G1(t,!0,a);var i=Wr();t.render(t.renderOptions);var o=t.lastDrawTime=Wr();t.averageRedrawTime===void 0&&(t.averageRedrawTime=o-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var l=o-i;t.redrawTotalTime+=l,t.lastRedrawTime=l,t.averageRedrawTime=t.averageRedrawTime/2+l/2,t.requestedFrame=!1}else G1(t,!1,a);t.skipFrame=!1,ps(n)}};ps(r)}};var n3=function(e){this.init(e)},U1=n3,ni=U1.prototype;ni.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],ni.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,o="__________cytoscape_stylesheet",l="__________cytoscape_container",c=a.getElementById(o)!=null;if(r.className.indexOf(l)<0&&(r.className=(r.className||"")+" "+l),!c){var u=a.createElement("style");u.id=o,u.textContent="."+l+" { position: relative; }",i.insertBefore(u,i.children[0])}var d=n.getComputedStyle(r),f=d.getPropertyValue("position");f==="static"&&$e("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=de(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()},ni.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()}},ni.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{}},ni.isHeadless=function(){return!1},[vc,H1,K1,ri,Jr,go].forEach(function(t){Se(ni,t)});var Ec=1e3/60,j1={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=hs(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),o=function(u,d){var f=Wr(),h=a.averageRedrawTime,v=a.lastRedrawTime,p=[],g=a.cy.extent(),m=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var y=Wr(),b=y-f,w=y-d;if(v<Ec){var C=Ec-(u?h:0);if(w>=e.deqFastCost*C)break}else if(u){if(b>=e.deqCost*v||b>=e.deqAvgCost*h)break}else if(w>=e.deqNoDrawCost*Ec)break;var x=e.deq(n,m,g);if(x.length>0)for(var k=0;k<x.length;k++)p.push(x[k]);else break}p.length>0&&(e.onDeqd(n,p),!u&&e.shouldRedraw(n,p,m,g)&&i())},l=e.priority||Fu;a.beforeRender(o,l(n))}}}},a3=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:gs;Du(this,t),this.idsByKey=new Ir,this.keyForId=new Ir,this.cachesByLvl=new Ir,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Ou(t,[{key:"getIdsFor",value:function(r){r==null&&Je("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(r);return a||(a=new La,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 Ir,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}(),W1=25,nl=50,al=-4,xc=3,i3=7.99,o3=8,s3=1024,l3=1024,u3=1024,c3=.2,d3=.8,f3=10,h3=.15,p3=.1,v3=.9,g3=.9,m3=100,y3=1,ai={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},b3=xt({getKey:null,doesEleInvalidateKey:gs,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:V0,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),mo=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var a=b3(r);Se(n,a),n.lookup=new a3(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},ht=mo.prototype;ht.reasons=ai,ht.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},ht.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},ht.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Xi(function(r,n){return n.reqs-r.reqs});return e},ht.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},ht.getElement=function(t,e,r,n,a){var i=this,o=this.renderer,l=o.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(qu(l*r))),n<al)n=al;else if(l>=i3||n>xc)return null;var u=Math.pow(2,n),d=e.h*u,f=e.w*u,h=o.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,h))return null;var v=c.get(t,n);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;var p;if(d<=W1?p=W1:d<=nl?p=nl:p=Math.ceil(d/nl)*nl,d>u3||f>l3)return null;var g=i.getTextureQueue(p),m=g[g.length-2],y=function(){return i.recycleTexture(p,f)||i.addTexture(p,f)};m||(m=g[g.length-1]),m||(m=y()),m.width-m.usedWidth<f&&(m=y());for(var b=function(P){return P&&P.scaledLabelShown===h},w=a&&a===ai.dequeue,C=a&&a===ai.highQuality,x=a&&a===ai.downscale,k,E=n+1;E<=xc;E++){var _=c.get(t,E);if(_){k=_;break}}var S=k&&k.level===n+1?k:null,T=function(){m.context.drawImage(S.texture.canvas,S.x,0,S.width,S.height,m.usedWidth,0,f,d)};if(m.context.setTransform(1,0,0,1,0,0),m.context.clearRect(m.usedWidth,0,f,p),b(S))T();else if(b(k))if(C){for(var N=k.level;N>n;N--)S=i.getElement(t,e,r,N,ai.downscale);T()}else return i.queueElement(t,k.level-1),k;else{var B;if(!w&&!C&&!x)for(var O=n-1;O>=al;O--){var D=c.get(t,O);if(D){B=D;break}}if(b(B))return i.queueElement(t,n),B;m.context.translate(m.usedWidth,0),m.context.scale(u,u),this.drawElement(m.context,t,e,h,!1),m.context.scale(1/u,1/u),m.context.translate(-m.usedWidth,0)}return v={x:m.usedWidth,texture:m,level:n,scale:u,width:f,height:d,scaledLabelShown:h},m.usedWidth+=Math.ceil(f+o3),m.eleCaches.push(v),c.set(t,n,v),i.checkTextureFullness(m),v},ht.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])},ht.invalidateElement=function(t){var e=this,r=e.lookup,n=[],a=r.isInvalid(t);if(a){for(var i=al;i<=xc;i++){var o=r.getForCachedKey(t,i);o&&n.push(o)}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)}},ht.checkTextureUtility=function(t){t.invalidatedWidth>=c3*t.width&&this.retireTexture(t)},ht.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>d3&&t.fullnessChecks>=f3?bn(r,t):t.fullnessChecks++},ht.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),a=this.lookup;bn(n,t),t.retired=!0;for(var i=t.eleCaches,o=0;o<i.length;o++){var l=i[o];a.deleteCache(l.key,l.level)}$u(i);var c=e.getRetiredTextureQueue(r);c.push(t)},ht.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(s3,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},ht.recycleTexture=function(t,e){for(var r=this,n=r.getTextureQueue(t),a=r.getRetiredTextureQueue(t),i=0;i<a.length;i++){var o=a[i];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,$u(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),bn(a,o),n.push(o),o}},ht.queueElement=function(t,e){var r=this,n=r.getElementQueue(),a=r.getElementKeyToQueue(),i=this.getKey(t),o=a[i];if(o)o.level=Math.max(o.level,e),o.eles.merge(t),o.reqs++,n.updateItem(o);else{var l={eles:t.spawn().merge(t),level:e,reqs:1,key:i};n.push(l),a[i]=l}},ht.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,o=0;o<y3&&r.size()>0;o++){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,ai.dequeue)}return a},ht.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=Mu,r.updateItem(i),r.pop(),n[a]=null):i.eles.unmerge(t))},ht.onDequeue=function(t){this.onDequeues.push(t)},ht.offDequeue=function(t){bn(this.onDequeues,t)},ht.setupDequeueing=j1.setupDequeueing({deqRedrawThreshold:m3,deqCost:h3,deqAvgCost:p3,deqNoDrawCost:v3,deqFastCost:g3,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 o=r[i].eles,l=0;l<o.length;l++){var c=o[l].boundingBox();if(zu(c,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var w3=1,yo=-4,il=2,C3=3.99,E3=50,x3=50,k3=.15,S3=.1,_3=.9,T3=.9,N3=1,Y1=250,I3=4e3*4e3,B3=!0,Z1=function(e){var r=this,n=r.renderer=e,a=n.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Wr()-2*Y1,r.skipping=!1,r.eleTxrDeqs=a.collection(),r.scheduleElementRefinement=hs(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},x3),n.beforeRender(function(o,l){l-r.lastInvalidationTime<=Y1?r.skipping=!0:r.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(l,c){return c.reqs-l.reqs};r.layersQueue=new Xi(i),r.setupDequeueing()},Tt=Z1.prototype,X1=0,D3=Math.pow(2,53)-1;Tt.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),o={id:X1=++X1%D3,bb:t,level:e,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},l=o.context,c=-o.bb.x1,u=-o.bb.y1;return l.scale(r,r),l.translate(c,u),o},Tt.getLayers=function(t,e,r){var n=this,a=n.renderer,i=a.cy,o=i.zoom(),l=n.firstGet;if(n.firstGet=!1,r==null){if(r=Math.ceil(qu(o*e)),r<yo)r=yo;else if(o>=C3||r>il)return null}n.validateLayersElesOrdering(r,t);var c=n.layersByLevel,u=Math.pow(2,r),d=c[r]=c[r]||[],f,h=n.levelIsComplete(r,t),v,p=function(){var T=function(R){if(n.validateLayersElesOrdering(R,t),n.levelIsComplete(R,t))return v=c[R],!0},N=function(R){if(!v)for(var P=r+R;yo<=P&&P<=il&&!T(P);P+=R);};N(1),N(-1);for(var B=d.length-1;B>=0;B--){var O=d[B];O.invalid&&bn(d,O)}};if(!h)p();else return d;var g=function(){if(!f){f=Kt();for(var T=0;T<t.length;T++)W0(f,t[T].boundingBox())}return f},m=function(T){T=T||{};var N=T.after;g();var B=f.w*u*(f.h*u);if(B>I3)return null;var O=n.makeLayer(f,r);if(N!=null){var D=d.indexOf(N)+1;d.splice(D,0,O)}else(T.insert===void 0||T.insert)&&d.unshift(O);return O};if(n.skipping&&!l)return null;for(var y=null,b=t.length/w3,w=!l,C=0;C<t.length;C++){var x=t[C],k=x._private.rscratch,E=k.imgLayerCaches=k.imgLayerCaches||{},_=E[r];if(_){y=_;continue}if((!y||y.eles.length>=b||!Z0(y.bb,x.boundingBox()))&&(y=m({insert:!0,after:y}),!y))return null;v||w?n.queueLayer(y,x):n.drawEleInLayer(y,x,r,e),y.eles.push(x),E[r]=y}return v||(w?null:d)},Tt.getEleLevelForLayerLevel=function(t,e){return t},Tt.drawEleInLayer=function(t,e,r,n){var a=this,i=this.renderer,o=t.context,l=e.boundingBox();l.w===0||l.h===0||!e.visible()||(r=a.getEleLevelForLayerLevel(r,n),i.setImgSmoothing(o,!1),i.drawCachedElement(o,e,null,null,r,B3),i.setImgSmoothing(o,!0))},Tt.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 o=n[i];if(o.reqs>0||o.invalid)return!1;a+=o.eles.length}return a===e.length},Tt.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,o=0;o<e.length;o++)if(a.eles[0]===e[o]){i=o;break}if(i<0){this.invalidateLayer(a);continue}for(var l=i,o=0;o<a.eles.length;o++)if(a.eles[o]!==e[l+o]){this.invalidateLayer(a);break}}},Tt.updateElementsInLayers=function(t,e){for(var r=this,n=zi(t[0]),a=0;a<t.length;a++)for(var i=n?null:t[a],o=n?t[a]:t[a].ele,l=o._private.rscratch,c=l.imgLayerCaches=l.imgLayerCaches||{},u=yo;u<=il;u++){var d=c[u];d&&(i&&r.getEleLevelForLayerLevel(d.level)!==i.level||e(d,o,i))}},Tt.haveLayers=function(){for(var t=this,e=!1,r=yo;r<=il;r++){var n=t.layersByLevel[r];if(n&&n.length>0){e=!0;break}}return e},Tt.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Wr(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,a,i){e.invalidateLayer(n)}))},Tt.invalidateLayer=function(t){if(this.lastInvalidationTime=Wr(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];bn(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)}}},Tt.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(n,a,i){var o=n.replacement;if(o||(o=n.replacement=e.makeLayer(n.bb,n.level),o.replaces=n,o.eles=n.eles),!o.reqs)for(var l=0;l<o.eles.length;l++)e.queueLayer(o,o.eles[l])})},Tt.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()},Tt.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))}},Tt.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],a=0;a<N3&&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 o=i.elesQueue.shift();o&&(e.drawEleInLayer(i,o,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},Tt.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 o=t.eles[i]._private,l=o.imgLayerCaches=o.imgLayerCaches||{};l&&(l[t.level]=t)}e.requestRedraw()}},Tt.requestRedraw=hs(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100),Tt.setupDequeueing=j1.setupDequeueing({deqRedrawThreshold:E3,deqCost:k3,deqAvgCost:S3,deqNoDrawCost:_3,deqFastCost:T3,deq:function(e,r){return e.dequeue(r)},onDeqd:Fu,shouldRedraw:V0,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var J1={},Q1;function O3(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function P3(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 ew(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 o=r,l=r[0];t.moveTo(l.x,l.y);for(var a=1;a<o.length;a++){var i=o[a];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}function A3(t,e,r,n,a){t.beginPath&&t.beginPath(),t.arc(r,n,a,0,Math.PI*2,!1);var i=e,o=i[0];t.moveTo(o.x,o.y);for(var l=0;l<i.length;l++){var c=i[l];t.lineTo(c.x,c.y)}t.closePath&&t.closePath()}function R3(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}J1.arrowShapeImpl=function(t){return(Q1||(Q1={polygon:O3,"triangle-backcurve":P3,"triangle-tee":ew,"circle-triangle":A3,"triangle-cross":ew,circle:R3}))[t]};var Ar={};Ar.drawElement=function(t,e,r,n,a,i){var o=this;e.isNode()?o.drawNode(t,e,r,n,a,i):o.drawEdge(t,e,r,n,a,i)},Ar.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)},Ar.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)},Ar.drawCachedElementPortion=function(t,e,r,n,a,i,o,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 h=o(c,e),v=u.x1,p=u.y1,g=u.w,m=u.h,y,b,w,C,x;if(h!==0){var k=r.getRotationPoint(e);w=k.x,C=k.y,t.translate(w,C),t.rotate(h),x=c.getImgSmoothing(t),x||c.setImgSmoothing(t,!0);var E=r.getRotationOffset(e);y=E.x,b=E.y}else y=v,b=p;var _;f!==1&&(_=t.globalAlpha,t.globalAlpha=_*f),t.drawImage(d.texture.canvas,d.x,0,d.width,d.height,y,b,g,m),f!==1&&(t.globalAlpha=_),h!==0&&(t.rotate(-h),t.translate(-w,-C),x||c.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var L3=function(){return 0},M3=function(e,r){return e.getTextAngle(r,null)},F3=function(e,r){return e.getTextAngle(r,"source")},$3=function(e,r){return e.getTextAngle(r,"target")},V3=function(e,r){return r.effectiveOpacity()},kc=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};Ar.drawCachedElement=function(t,e,r,n,a,i){var o=this,l=o.data,c=l.eleTxrCache,u=l.lblTxrCache,d=l.slbTxrCache,f=l.tlbTxrCache,h=e.boundingBox(),v=i===!0?c.reasons.highQuality:null;if(!(h.w===0||h.h===0||!e.visible())&&(!n||zu(h,n))){var p=e.isEdge(),g=e.element()._private.rscratch.badLine;o.drawElementUnderlay(t,e),o.drawCachedElementPortion(t,e,c,r,a,v,L3,V3),(!p||!g)&&o.drawCachedElementPortion(t,e,u,r,a,v,M3,kc),p&&!g&&(o.drawCachedElementPortion(t,e,d,r,a,v,F3,kc),o.drawCachedElementPortion(t,e,f,r,a,v,$3,kc)),o.drawElementOverlay(t,e)}},Ar.drawElements=function(t,e){for(var r=this,n=0;n<e.length;n++){var a=e[n];r.drawElement(t,a)}},Ar.drawCachedElements=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];a.drawCachedElement(t,o,r,n)}},Ar.drawCachedNodes=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];o.isNode()&&a.drawCachedElement(t,o,r,n)}},Ar.drawLayeredElements=function(t,e,r,n){var a=this,i=a.data.lyrTxrCache.getLayers(e,r);if(i)for(var o=0;o<i.length;o++){var l=i[o],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 Qr={};Qr.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,o=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,h=e.pstyle("line-style").value,v=e.pstyle("width").pfValue,p=e.pstyle("line-cap").value,g=e.pstyle("line-outline-width").value,m=e.pstyle("line-outline-color").value,y=u*d,b=u*d,w=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;f==="straight-triangle"?(o.eleStrokeStyle(t,e,R),o.drawEdgeTrianglePath(e,t,l.allpts)):(t.lineWidth=v,t.lineCap=p,o.eleStrokeStyle(t,e,R),o.drawEdgePath(e,t,l.allpts,h),t.lineCap="butt")},C=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;if(t.lineWidth=v+g,t.lineCap=p,g>0)o.colorStrokeStyle(t,m[0],m[1],m[2],R);else{t.lineCap="butt";return}f==="straight-triangle"?o.drawEdgeTrianglePath(e,t,l.allpts):(o.drawEdgePath(e,t,l.allpts,h),t.lineCap="butt")},x=function(){a&&o.drawEdgeOverlay(t,e)},k=function(){a&&o.drawEdgeUnderlay(t,e)},E=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;o.drawArrowheads(t,e,R)},_=function(){o.drawElementText(t,e,null,n)};t.lineJoin="round";var S=e.pstyle("ghost").value==="yes";if(S){var T=e.pstyle("ghost-offset-x").pfValue,N=e.pstyle("ghost-offset-y").pfValue,B=e.pstyle("ghost-opacity").value,O=y*B;t.translate(T,N),w(O),E(O),t.translate(-T,-N)}else C();k(),w(),E(),x(),_(),r&&t.translate(c.x1,c.y1)}};var tw=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,o=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"&&!o?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,d[0],d[1],d[2],a),i.drawEdgePath(n,r,l.allpts,"solid")}}}};Qr.drawEdgeOverlay=tw("overlay"),Qr.drawEdgeUnderlay=tw("underlay"),Qr.drawEdgePath=function(t,e,r,n){var a=t._private.rscratch,i=e,o,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("$"),h=a.pathCacheKey&&a.pathCacheKey===f;h?(o=e=a.pathCache,l=!0):(o=e=new Path2D,a.pathCacheKey=f,a.pathCache=o)}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 p=2;p+1<r.length;p+=2)e.lineTo(r[p],r[p+1]);break;case"segments":if(a.isRound){var g=w0(a.roundCorners),m;try{for(g.s();!(m=g.n()).done;){var y=m.value;L1(e,y)}}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(o):e.stroke(),e.setLineDash&&e.setLineDash([])},Qr.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]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),l=[i[1]/o,-i[0]/o],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()}},Qr.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)},Qr.drawArrowhead=function(t,e,r,n,a,i,o){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,h=e.pstyle(r+"-arrow-width"),v=h.value==="match-line"?f:h.pfValue;h.units==="%"&&(v*=f);var p=e.pstyle("opacity").value;o===void 0&&(o=p);var g=t.globalCompositeOperation;(o!==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 m=e.pstyle(r+"-arrow-color").value;l.colorFillStyle(t,m[0],m[1],m[2],o),l.colorStrokeStyle(t,m[0],m[1],m[2],o),l.drawArrowShape(e,t,d,f,c,v,n,a,i)}}},Qr.drawArrowShape=function(t,e,r,n,a,i,o,l,c){var u=this,d=this.usePaths()&&a!=="triangle-cross",f=!1,h,v=e,p={x:o,y:l},g=t.pstyle("arrow-scale").value,m=this.getArrowWidth(n,g),y=u.arrowShapes[a];if(d){var b=u.arrowPathCache=u.arrowPathCache||[],w=Xn(a),C=b[w];C!=null?(h=e=C,f=!0):(h=e=new Path2D,b[w]=h)}f||(e.beginPath&&e.beginPath(),d?y.draw(e,1,0,{x:0,y:0},1):y.draw(e,m,c,p,n),e.closePath&&e.closePath()),e=v,d&&(e.translate(o,l),e.rotate(c),e.scale(m,m)),(r==="filled"||r==="both")&&(d?e.fill(h):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=i/(d?m:1),e.lineJoin="miter",d?e.stroke(h):e.stroke()),d&&(e.scale(1/m,1/m),e.rotate(-c),e.translate(-o,-l))};var Sc={};Sc.safeDrawImage=function(t,e,r,n,a,i,o,l,c,u){if(!(a<=0||i<=0||c<=0||u<=0))try{t.drawImage(e,r,n,a,i,o,l,c,u)}catch(d){$e(d)}},Sc.drawInscribedImage=function(t,e,r,n,a){var i=this,o=r.position(),l=o.x,c=o.y,u=r.cy().style(),d=u.getIndexedStyle.bind(u),f=d(r,"background-fit","value",n),h=d(r,"background-repeat","value",n),v=r.width(),p=r.height(),g=r.padding()*2,m=v+(d(r,"background-width-relative-to","value",n)==="inner"?0:g),y=p+(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,k=d(r,"background-image-smoothing","value",n),E=r.pstyle("corner-radius").value;E!=="auto"&&(E=r.pstyle("corner-radius").pfValue);var _=e.width||e.cachedW,S=e.height||e.cachedH;(_==null||S==null)&&(document.body.appendChild(e),_=e.cachedW=e.width||e.offsetWidth,S=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var T=_,N=S;if(d(r,"background-width","value",n)!=="auto"&&(d(r,"background-width","units",n)==="%"?T=d(r,"background-width","pfValue",n)*m:T=d(r,"background-width","pfValue",n)),d(r,"background-height","value",n)!=="auto"&&(d(r,"background-height","units",n)==="%"?N=d(r,"background-height","pfValue",n)*y:N=d(r,"background-height","pfValue",n)),!(T===0||N===0)){if(f==="contain"){var B=Math.min(m/T,y/N);T*=B,N*=B}else if(f==="cover"){var B=Math.max(m/T,y/N);T*=B,N*=B}var O=l-m/2,D=d(r,"background-position-x","units",n),R=d(r,"background-position-x","pfValue",n);D==="%"?O+=(m-T)*R:O+=R;var P=d(r,"background-offset-x","units",n),L=d(r,"background-offset-x","pfValue",n);P==="%"?O+=(m-T)*L:O+=L;var A=c-y/2,q=d(r,"background-position-y","units",n),U=d(r,"background-position-y","pfValue",n);q==="%"?A+=(y-N)*U:A+=U;var z=d(r,"background-offset-y","units",n),H=d(r,"background-offset-y","pfValue",n);z==="%"?A+=(y-N)*H:A+=H,b.pathCache&&(O-=l,A-=c,l=0,c=0);var Q=t.globalAlpha;t.globalAlpha=x;var F=i.getImgSmoothing(t),$=!1;if(k==="no"&&F?(i.setImgSmoothing(t,!1),$=!0):k==="yes"&&!F&&(i.setImgSmoothing(t,!0),$=!0),h==="no-repeat")C&&(t.save(),b.pathCache?t.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,l,c,m,y,E,b),t.clip())),i.safeDrawImage(t,e,0,0,_,S,O,A,T,N),C&&t.restore();else{var V=t.createPattern(e,h);t.fillStyle=V,i.nodeShapes[i.getNodeShape(r)].draw(t,l,c,m,y,E,b),t.translate(O,A),t.fill(),t.translate(-O,-A)}t.globalAlpha=Q,$&&i.setImgSmoothing(t,F)}};var ua={};ua.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(qu(r*n));e=Math.pow(2,a)}var i=t.pstyle("font-size").pfValue*e,o=t.pstyle("min-zoomed-font-size").pfValue;return!(i<o)},ua.drawElementText=function(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(n==null){if(i&&!o.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var l=e.pstyle("label");if(!l||!l.value)return;var c=o.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"),h=e.pstyle("target-label");if(u||(!d||!d.value)&&(!f||!f.value)&&(!h||!h.value))return;t.textAlign="center",t.textBaseline="bottom"}var v=!r,p;r&&(p=r,t.translate(-p.x1,-p.y1)),a==null?(o.drawText(t,e,null,v,i),e.isEdge()&&(o.drawText(t,e,"source",v,i),o.drawText(t,e,"target",v,i))):o.drawText(t,e,a,v,i),r&&t.translate(p.x1,p.y1)},ua.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},ua.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,o=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+" "+o+" "+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 _c(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=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(),o?t.stroke():t.fill()}ua.getTextAngle=function(t,e){var r,n=t._private,a=n.rscratch,i=e?e+"-":"",o=t.pstyle(i+"text-rotation"),l=gr(a,"labelAngle",e);return o.strValue==="autorotate"?r=t.isEdge()?l:0:o.strValue==="none"?r=0:r=o.pfValue,r},ua.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,o=i.rscratch,l=a?e.effectiveOpacity():1;if(!(a&&(l===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var c=gr(o,"labelX",r),u=gr(o,"labelY",r),d,f,h=this.getLabelText(e,r);if(h!=null&&h!==""&&!isNaN(c)&&!isNaN(u)){this.setupTextStyle(t,e,a);var v=r?r+"-":"",p=gr(o,"labelWidth",r),g=gr(o,"labelHeight",r),m=e.pstyle(v+"text-margin-x").pfValue,y=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+=m,u+=y;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 k=e.pstyle("text-background-opacity").value,E=e.pstyle("text-border-opacity").value,_=e.pstyle("text-border-width").pfValue,S=e.pstyle("text-background-padding").pfValue,T=e.pstyle("text-background-shape").strValue,N=T.indexOf("round")===0,B=2;if(k>0||_>0&&E>0){var O=c-S;switch(w){case"left":O-=p;break;case"center":O-=p/2;break}var D=u-g-S,R=p+2*S,P=g+2*S;if(k>0){var L=t.fillStyle,A=e.pstyle("text-background-color").value;t.fillStyle="rgba("+A[0]+","+A[1]+","+A[2]+","+k*l+")",N?_c(t,O,D,R,P,B):t.fillRect(O,D,R,P),t.fillStyle=L}if(_>0&&E>0){var q=t.strokeStyle,U=t.lineWidth,z=e.pstyle("text-border-color").value,H=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+z[0]+","+z[1]+","+z[2]+","+E*l+")",t.lineWidth=_,t.setLineDash)switch(H){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=_/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(N?_c(t,O,D,R,P,B,"stroke"):t.strokeRect(O,D,R,P),H==="double"){var Q=_/2;N?_c(t,O+Q,D+Q,R-Q*2,P-Q*2,B,"stroke"):t.strokeRect(O+Q,D+Q,R-Q*2,P-Q*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=U,t.strokeStyle=q}}var F=2*e.pstyle("text-outline-width").pfValue;if(F>0&&(t.lineWidth=F),e.pstyle("text-wrap").value==="wrap"){var $=gr(o,"labelWrapCachedLines",r),V=gr(o,"labelLineHeight",r),G=p/2,j=this.getLabelJustification(e);switch(j==="auto"||(w==="left"?j==="left"?c+=-p:j==="center"&&(c+=-G):w==="center"?j==="left"?c+=-G:j==="right"&&(c+=G):w==="right"&&(j==="center"?c+=G:j==="right"&&(c+=p))),C){case"top":u-=($.length-1)*V;break;case"center":case"bottom":u-=($.length-1)*V;break}for(var M=0;M<$.length;M++)F>0&&t.strokeText($[M],c,u),t.fillText($[M],c,u),u+=V}else F>0&&t.strokeText(h,c,u),t.fillText(h,c,u);x!==0&&(t.rotate(-x),t.translate(-d,-f))}}};var ii={};ii.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,o=this,l,c,u=e._private,d=u.rscratch,f=e.position();if(!(!de(f.x)||!de(f.y))&&!(i&&!e.visible())){var h=i?e.effectiveOpacity():1,v=o.usePaths(),p,g=!1,m=e.padding();l=e.width()+2*m,c=e.height()+2*m;var y;r&&(y=r,t.translate(-y.x1,-y.y1));for(var b=e.pstyle("background-image"),w=b.value,C=new Array(w.length),x=new Array(w.length),k=0,E=0;E<w.length;E++){var _=w[E],S=C[E]=_!=null&&_!=="none";if(S){var T=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",E);k++,x[E]=o.getCachedImage(_,T,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var N=e.pstyle("background-blacken").value,B=e.pstyle("border-width").pfValue,O=e.pstyle("background-opacity").value*h,D=e.pstyle("border-color").value,R=e.pstyle("border-style").value,P=e.pstyle("border-join").value,L=e.pstyle("border-cap").value,A=e.pstyle("border-position").value,q=e.pstyle("border-dash-pattern").pfValue,U=e.pstyle("border-dash-offset").pfValue,z=e.pstyle("border-opacity").value*h,H=e.pstyle("outline-width").pfValue,Q=e.pstyle("outline-color").value,F=e.pstyle("outline-style").value,$=e.pstyle("outline-opacity").value*h,V=e.pstyle("outline-offset").value,G=e.pstyle("corner-radius").value;G!=="auto"&&(G=e.pstyle("corner-radius").pfValue);var j=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:O;o.eleFillStyle(t,e,le)},M=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:z;o.colorStrokeStyle(t,D[0],D[1],D[2],le)},W=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$;o.colorStrokeStyle(t,Q[0],Q[1],Q[2],le)},Y=function(le,ee,oe,me){var be=o.nodePathCache=o.nodePathCache||[],ye=F0(oe==="polygon"?oe+","+me.join(","):oe,""+ee,""+le,""+G),_e=be[ye],ge,Ce=!1;return _e!=null?(ge=_e,Ce=!0,d.pathCache=ge):(ge=new Path2D,be[ye]=d.pathCache=ge),{path:ge,cacheHit:Ce}},se=e.pstyle("shape").strValue,ce=e.pstyle("shape-polygon-points").pfValue;if(v){t.translate(f.x,f.y);var ae=Y(l,c,se,ce);p=ae.path,g=ae.cacheHit}var ne=function(){if(!g){var le=f;v&&(le={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(p||t,le.x,le.y,l,c,G,d)}v?t.fill(p):t.fill()},ue=function(){for(var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,oe=u.backgrounding,me=0,be=0;be<x.length;be++){var ye=e.cy().style().getIndexedStyle(e,"background-image-containment","value",be);if(ee&&ye==="over"||!ee&&ye==="inside"){me++;continue}C[be]&&x[be].complete&&!x[be].error&&(me++,o.drawInscribedImage(t,x[be],e,be,le))}u.backgrounding=me!==k,oe!==u.backgrounding&&e.updateStyle(!1)},ie=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;o.hasPie(e)&&(o.drawPie(t,e,ee),le&&(v||o.nodeShapes[o.getNodeShape(e)].draw(t,f.x,f.y,l,c,G,d)))},fe=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ee=(N>0?N:-N)*le,oe=N>0?0:255;N!==0&&(o.colorFillStyle(t,oe,oe,oe,ee),v?t.fill(p):t.fill())},pe=function(){if(B>0){if(t.lineWidth=B,t.lineCap=L,t.lineJoin=P,t.setLineDash)switch(R){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(q),t.lineDashOffset=U;break;case"solid":case"double":t.setLineDash([]);break}if(A!=="center"){if(t.save(),t.lineWidth*=2,A==="inside")v?t.clip(p):t.clip();else{var le=new Path2D;le.rect(-l/2-B,-c/2-B,l+2*B,c+2*B),le.addPath(p),t.clip(le,"evenodd")}v?t.stroke(p):t.stroke(),t.restore()}else v?t.stroke(p):t.stroke();if(R==="double"){t.lineWidth=B/3;var ee=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(p):t.stroke(),t.globalCompositeOperation=ee}t.setLineDash&&t.setLineDash([])}},De=function(){if(H>0){if(t.lineWidth=H,t.lineCap="butt",t.setLineDash)switch(F){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var le=f;v&&(le={x:0,y:0});var ee=o.getNodeShape(e),oe=B;A==="inside"&&(oe=0),A==="outside"&&(oe*=2);var me=(l+oe+(H+V))/l,be=(c+oe+(H+V))/c,ye=l*me,_e=c*be,ge=o.nodeShapes[ee].points,Ce;if(v){var je=Y(ye,_e,ee,ge);Ce=je.path}if(ee==="ellipse")o.drawEllipsePath(Ce||t,le.x,le.y,ye,_e);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ee)){var qe=0,it=0,ot=0;ee==="round-diamond"?qe=(oe+V+H)*1.4:ee==="round-heptagon"?(qe=(oe+V+H)*1.075,ot=-(oe/2+V+H)/35):ee==="round-hexagon"?qe=(oe+V+H)*1.12:ee==="round-pentagon"?(qe=(oe+V+H)*1.13,ot=-(oe/2+V+H)/15):ee==="round-tag"?(qe=(oe+V+H)*1.12,it=(oe/2+H+V)*.07):ee==="round-triangle"&&(qe=(oe+V+H)*(Math.PI/2),ot=-(oe+V/2+H)/Math.PI),qe!==0&&(me=(l+qe)/l,ye=l*me,["round-hexagon","round-tag"].includes(ee)||(be=(c+qe)/c,_e=c*be)),G=G==="auto"?Q0(ye,_e):G;for(var et=ye/2,At=_e/2,pt=G+(oe+H+V)/2,mt=new Array(ge.length/2),Jt=new Array(ge.length/2),Rt=0;Rt<ge.length/2;Rt++)mt[Rt]={x:le.x+it+et*ge[Rt*2],y:le.y+ot+At*ge[Rt*2+1]};var Lt,lr,Cr,jt,tt=mt.length;for(lr=mt[tt-1],Lt=0;Lt<tt;Lt++)Cr=mt[Lt%tt],jt=mt[(Lt+1)%tt],Jt[Lt]=wc(lr,Cr,jt,pt),lr=Cr,Cr=jt;o.drawRoundPolygonPath(Ce||t,le.x+it,le.y+ot,l*me,c*be,ge,Jt)}else if(["roundrectangle","round-rectangle"].includes(ee))G=G==="auto"?ta(ye,_e):G,o.drawRoundRectanglePath(Ce||t,le.x,le.y,ye,_e,G+(oe+H+V)/2);else if(["cutrectangle","cut-rectangle"].includes(ee))G=G==="auto"?Gu():G,o.drawCutRectanglePath(Ce||t,le.x,le.y,ye,_e,null,G+(oe+H+V)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ee))G=G==="auto"?ta(ye,_e):G,o.drawBottomRoundRectanglePath(Ce||t,le.x,le.y,ye,_e,G+(oe+H+V)/2);else if(ee==="barrel")o.drawBarrelPath(Ce||t,le.x,le.y,ye,_e);else if(ee.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ee)){var st=(oe+H+V)/l;ge=Es(xs(ge,st)),o.drawPolygonPath(Ce||t,le.x,le.y,l,c,ge)}else{var yt=(oe+H+V)/l;ge=Es(xs(ge,-yt)),o.drawPolygonPath(Ce||t,le.x,le.y,l,c,ge)}if(v?t.stroke(Ce):t.stroke(),F==="double"){t.lineWidth=oe/3;var Pn=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(Ce):t.stroke(),t.globalCompositeOperation=Pn}t.setLineDash&&t.setLineDash([])}},Ie=function(){a&&o.drawNodeOverlay(t,e,f,l,c)},we=function(){a&&o.drawNodeUnderlay(t,e,f,l,c)},xe=function(){o.drawElementText(t,e,null,n)},re=e.pstyle("ghost").value==="yes";if(re){var I=e.pstyle("ghost-offset-x").pfValue,K=e.pstyle("ghost-offset-y").pfValue,te=e.pstyle("ghost-opacity").value,Z=te*h;t.translate(I,K),W(),De(),j(te*O),ne(),ue(Z,!0),M(te*z),pe(),ie(N!==0||B!==0),ue(Z,!1),fe(Z),t.translate(-I,-K)}v&&t.translate(-f.x,-f.y),we(),v&&t.translate(f.x,f.y),W(),De(),j(),ne(),ue(h,!0),M(),pe(),ie(N!==0||B!==0),ue(h,!1),fe(),v&&t.translate(-f.x,-f.y),xe(),Ie(),r&&t.translate(y.x1,y.y1)}};var rw=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n,a,i,o){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,h=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(a=a||n.position(),i==null||o==null){var v=n.padding();i=n.width()+2*v,o=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,o+c*2,h),r.fill()}}}};ii.drawNodeOverlay=rw("overlay"),ii.drawNodeUnderlay=rw("underlay"),ii.hasPie=function(t){return t=t[0],t._private.hasPie},ii.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),o=n.x,l=n.y,c=e.width(),u=e.height(),d=Math.min(c,u)/2,f=0,h=this.usePaths();h&&(o=0,l=0),i.units==="%"?d=d*i.pfValue:i.pfValue!==void 0&&(d=i.pfValue/2);for(var v=1;v<=a.pieBackgroundN;v++){var p=e.pstyle("pie-"+v+"-background-size").value,g=e.pstyle("pie-"+v+"-background-color").value,m=e.pstyle("pie-"+v+"-background-opacity").value*r,y=p/100;y+f>1&&(y=1-f);var b=1.5*Math.PI+2*Math.PI*f,w=2*Math.PI*y,C=b+w;p===0||f>=1||f+y>1||(t.beginPath(),t.moveTo(o,l),t.arc(o,l,d,b,C),t.closePath(),this.colorFillStyle(t,g[0],g[1],g[2],m),t.fill(),f+=y)}};var Xt={},q3=100;Xt.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},Xt.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},Xt.createGradientStyleFor=function(t,e,r,n,a){var i,o=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(),h=Jn(u,f),v=Jn(d,f);i=t.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(h,v))}else{var p=o?{x:0,y:0}:r.position(),g=r.paddedWidth(),m=r.paddedHeight();i=t.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(g,m))}else if(r.isEdge()){var y=r.sourceEndpoint(),b=r.targetEndpoint();i=t.createLinearGradient(y.x,y.y,b.x,b.y)}else{var w=o?{x:0,y:0}:r.position(),C=r.paddedWidth(),x=r.paddedHeight(),k=C/2,E=x/2,_=r.pstyle("background-gradient-direction").value;switch(_){case"to-bottom":i=t.createLinearGradient(w.x,w.y-E,w.x,w.y+E);break;case"to-top":i=t.createLinearGradient(w.x,w.y+E,w.x,w.y-E);break;case"to-left":i=t.createLinearGradient(w.x+k,w.y,w.x-k,w.y);break;case"to-right":i=t.createLinearGradient(w.x-k,w.y,w.x+k,w.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(w.x-k,w.y-E,w.x+k,w.y+E);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(w.x-k,w.y+E,w.x+k,w.y-E);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(w.x+k,w.y-E,w.x-k,w.y+E);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(w.x+k,w.y+E,w.x-k,w.y-E);break}}if(!i)return null;for(var S=c.length===l.length,T=l.length,N=0;N<T;N++)i.addColorStop(S?c[N]:N/(T-1),"rgba("+l[N][0]+","+l[N][1]+","+l[N][2]+","+a+")");return i},Xt.gradientFillStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"background",e,r,n);if(!a)return null;t.fillStyle=a},Xt.colorFillStyle=function(t,e,r,n,a){t.fillStyle="rgba("+e+","+r+","+n+","+a+")"},Xt.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)}},Xt.gradientStrokeStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"line",e,r,n);if(!a)return null;t.strokeStyle=a},Xt.colorStrokeStyle=function(t,e,r,n,a){t.strokeStyle="rgba("+e+","+r+","+n+","+a+")"},Xt.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)}},Xt.matchCanvasSize=function(t){var e=this,r=e.data,n=e.findContainerClientCoords(),a=n[2],i=n[3],o=e.getPixelRatio(),l=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=l);var c=a*o,u=i*o,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 h=0;h<e.CANVAS_LAYERS;h++)d=r.canvases[h],d.width=c,d.height=u,d.style.width=a+"px",d.style.height=i+"px";for(var h=0;h<e.BUFFER_COUNT;h++)d=r.bufferCanvases[h],d.width=c,d.height=u,d.style.width=a+"px",d.style.height=i+"px";e.textureMult=1,o<=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}},Xt.renderTo=function(t,e,r,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:n})},Xt.render=function(t){t=t||K0();var e=t.forcedContext,r=t.drawAllLayers,n=t.drawOnlyNodeLayer,a=t.forcedZoom,i=t.forcedPan,o=this,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,c=o.cy,u=o.data,d=u.canvasNeedsRedraw,f=o.textureOnViewport&&!e&&(o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming),h=t.motionBlur!==void 0?t.motionBlur:o.motionBlur,v=o.motionBlurPxRatio,p=c.hasCompoundNodes(),g=o.hoverData.draggingEles,m=!!(o.hoverData.selecting||o.touchData.selecting);h=h&&!e&&o.motionBlurEnabled&&!m;var y=h;e||(o.prevPxRatio!==l&&(o.invalidateContainerClientCoordsCache(),o.matchCanvasSize(o.container),o.redrawHint("eles",!0),o.redrawHint("drag",!0)),o.prevPxRatio=l),!e&&o.motionBlurTimeout&&clearTimeout(o.motionBlurTimeout),h&&(o.mbFrames==null&&(o.mbFrames=0),o.mbFrames++,o.mbFrames<3&&(y=!1),o.mbFrames>o.minMbLowQualFrames&&(o.motionBlurPxRatio=o.mbPxRBlurry)),o.clearingMotionBlur&&(o.motionBlurPxRatio=1),o.textureDrawLastFrame&&!f&&(d[o.NODE]=!0,d[o.SELECT_BOX]=!0);var b=c.style(),w=c.zoom(),C=a!==void 0?a:w,x=c.pan(),k={x:x.x,y:x.y},E={zoom:w,pan:{x:x.x,y:x.y}},_=o.prevViewport,S=_===void 0||E.zoom!==_.zoom||E.pan.x!==_.pan.x||E.pan.y!==_.pan.y;!S&&!(g&&!p)&&(o.motionBlurPxRatio=1),i&&(k=i),C*=l,k.x*=l,k.y*=l;var T=o.getCachedZSortedEles();function N(ae,ne,ue,ie,fe){var pe=ae.globalCompositeOperation;ae.globalCompositeOperation="destination-out",o.colorFillStyle(ae,255,255,255,o.motionBlurTransparency),ae.fillRect(ne,ue,ie,fe),ae.globalCompositeOperation=pe}function B(ae,ne){var ue,ie,fe,pe;!o.clearingMotionBlur&&(ae===u.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]||ae===u.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG])?(ue={x:x.x*v,y:x.y*v},ie=w*v,fe=o.canvasWidth*v,pe=o.canvasHeight*v):(ue=k,ie=C,fe=o.canvasWidth,pe=o.canvasHeight),ae.setTransform(1,0,0,1,0,0),ne==="motionBlur"?N(ae,0,0,fe,pe):!e&&(ne===void 0||ne)&&ae.clearRect(0,0,fe,pe),r||(ae.translate(ue.x,ue.y),ae.scale(ie,ie)),i&&ae.translate(i.x,i.y),a&&ae.scale(a,a)}if(f||(o.textureDrawLastFrame=!1),f){if(o.textureDrawLastFrame=!0,!o.textureCache){o.textureCache={},o.textureCache.bb=c.mutableElements().boundingBox(),o.textureCache.texture=o.data.bufferCanvases[o.TEXTURE_BUFFER];var O=o.data.bufferContexts[o.TEXTURE_BUFFER];O.setTransform(1,0,0,1,0,0),O.clearRect(0,0,o.canvasWidth*o.textureMult,o.canvasHeight*o.textureMult),o.render({forcedContext:O,drawOnlyNodeLayer:!0,forcedPxRatio:l*o.textureMult});var E=o.textureCache.viewport={zoom:c.zoom(),pan:c.pan(),width:o.canvasWidth,height:o.canvasHeight};E.mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}d[o.DRAG]=!1,d[o.NODE]=!1;var D=u.contexts[o.NODE],R=o.textureCache.texture,E=o.textureCache.viewport;D.setTransform(1,0,0,1,0,0),h?N(D,0,0,E.width,E.height):D.clearRect(0,0,E.width,E.height);var P=b.core("outside-texture-bg-color").value,L=b.core("outside-texture-bg-opacity").value;o.colorFillStyle(D,P[0],P[1],P[2],L),D.fillRect(0,0,E.width,E.height);var w=c.zoom();B(D,!1),D.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l),D.drawImage(R,E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l)}else o.textureOnViewport&&!e&&(o.textureCache=null);var A=c.extent(),q=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated(),U=o.hideEdgesOnViewport&&q,z=[];if(z[o.NODE]=!d[o.NODE]&&h&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur,z[o.NODE]&&(o.clearedForMotionBlur[o.NODE]=!0),z[o.DRAG]=!d[o.DRAG]&&h&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur,z[o.DRAG]&&(o.clearedForMotionBlur[o.DRAG]=!0),d[o.NODE]||r||n||z[o.NODE]){var H=h&&!z[o.NODE]&&v!==1,D=e||(H?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:u.contexts[o.NODE]),Q=h&&!H?"motionBlur":void 0;B(D,Q),U?o.drawCachedNodes(D,T.nondrag,l,A):o.drawLayeredElements(D,T.nondrag,l,A),o.debug&&o.drawDebugPoints(D,T.nondrag),!r&&!h&&(d[o.NODE]=!1)}if(!n&&(d[o.DRAG]||r||z[o.DRAG])){var H=h&&!z[o.DRAG]&&v!==1,D=e||(H?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:u.contexts[o.DRAG]);B(D,h&&!H?"motionBlur":void 0),U?o.drawCachedNodes(D,T.drag,l,A):o.drawCachedElements(D,T.drag,l,A),o.debug&&o.drawDebugPoints(D,T.drag),!r&&!h&&(d[o.DRAG]=!1)}if(o.showFps||!n&&d[o.SELECT_BOX]&&!r){var D=e||u.contexts[o.SELECT_BOX];if(B(D),o.selection[4]==1&&(o.hoverData.selecting||o.touchData.selecting)){var w=o.cy.zoom(),F=b.core("selection-box-border-width").value/w;D.lineWidth=F,D.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+")",D.fillRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]),F>0&&(D.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+")",D.strokeRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]))}if(u.bgActivePosistion&&!o.hoverData.selecting){var w=o.cy.zoom(),$=u.bgActivePosistion;D.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+")",D.beginPath(),D.arc($.x,$.y,b.core("active-bg-size").pfValue/w,0,2*Math.PI),D.fill()}var V=o.lastRedrawTime;if(o.showFps&&V){V=Math.round(V);var G=Math.round(1e3/V);D.setTransform(1,0,0,1,0,0),D.fillStyle="rgba(255, 0, 0, 0.75)",D.strokeStyle="rgba(255, 0, 0, 0.75)",D.lineWidth=1,D.fillText("1 frame = "+V+" ms = "+G+" fps",0,20);var j=60;D.strokeRect(0,30,250,20),D.fillRect(0,30,250*Math.min(G/j,1),20)}r||(d[o.SELECT_BOX]=!1)}if(h&&v!==1){var M=u.contexts[o.NODE],W=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE],Y=u.contexts[o.DRAG],se=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG],ce=function(ne,ue,ie){ne.setTransform(1,0,0,1,0,0),ie||!y?ne.clearRect(0,0,o.canvasWidth,o.canvasHeight):N(ne,0,0,o.canvasWidth,o.canvasHeight);var fe=v;ne.drawImage(ue,0,0,o.canvasWidth*fe,o.canvasHeight*fe,0,0,o.canvasWidth,o.canvasHeight)};(d[o.NODE]||z[o.NODE])&&(ce(M,W,z[o.NODE]),d[o.NODE]=!1),(d[o.DRAG]||z[o.DRAG])&&(ce(Y,se,z[o.DRAG]),d[o.DRAG]=!1)}o.prevViewport=E,o.clearingMotionBlur&&(o.clearingMotionBlur=!1,o.motionBlurCleared=!0,o.motionBlur=!0),h&&(o.motionBlurTimeout=setTimeout(function(){o.motionBlurTimeout=null,o.clearedForMotionBlur[o.NODE]=!1,o.clearedForMotionBlur[o.DRAG]=!1,o.motionBlur=!1,o.clearingMotionBlur=!f,o.mbFrames=0,d[o.NODE]=!0,d[o.DRAG]=!0,o.redraw()},q3)),e||c.emit("render")};var In={};In.drawPolygonPath=function(t,e,r,n,a,i){var o=n/2,l=a/2;t.beginPath&&t.beginPath(),t.moveTo(e+o*i[0],r+l*i[1]);for(var c=1;c<i.length/2;c++)t.lineTo(e+o*i[c*2],r+l*i[c*2+1]);t.closePath()},In.drawRoundPolygonPath=function(t,e,r,n,a,i,o){o.forEach(function(l){return L1(t,l)}),t.closePath()},In.drawRoundRectanglePath=function(t,e,r,n,a,i){var o=n/2,l=a/2,c=i==="auto"?ta(n,a):Math.min(i,l,o);t.beginPath&&t.beginPath(),t.moveTo(e,r-l),t.arcTo(e+o,r-l,e+o,r,c),t.arcTo(e+o,r+l,e,r+l,c),t.arcTo(e-o,r+l,e-o,r,c),t.arcTo(e-o,r-l,e,r-l,c),t.lineTo(e,r-l),t.closePath()},In.drawBottomRoundRectanglePath=function(t,e,r,n,a,i){var o=n/2,l=a/2,c=i==="auto"?ta(n,a):i;t.beginPath&&t.beginPath(),t.moveTo(e,r-l),t.lineTo(e+o,r-l),t.lineTo(e+o,r),t.arcTo(e+o,r+l,e,r+l,c),t.arcTo(e-o,r+l,e-o,r,c),t.lineTo(e-o,r-l),t.lineTo(e,r-l),t.closePath()},In.drawCutRectanglePath=function(t,e,r,n,a,i,o){var l=n/2,c=a/2,u=o==="auto"?Gu():o;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()},In.drawBarrelPath=function(t,e,r,n,a){var i=n/2,o=a/2,l=e-i,c=e+i,u=r-o,d=r+o,f=Uu(n,a),h=f.widthOffset,v=f.heightOffset,p=f.ctrlPtOffsetPct*h;t.beginPath&&t.beginPath(),t.moveTo(l,u+v),t.lineTo(l,d-v),t.quadraticCurveTo(l+p,d,l+h,d),t.lineTo(c-h,d),t.quadraticCurveTo(c-p,d,c,d-v),t.lineTo(c,u+v),t.quadraticCurveTo(c-p,u,c-h,u),t.lineTo(l+h,u),t.quadraticCurveTo(l+p,u,l,u+v),t.closePath()};for(var nw=Math.sin(0),aw=Math.cos(0),Tc={},Nc={},iw=Math.PI/40,oi=0*Math.PI;oi<2*Math.PI;oi+=iw)Tc[oi]=Math.sin(oi),Nc[oi]=Math.cos(oi);In.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,o,l=n/2,c=a/2,u=0*Math.PI;u<2*Math.PI;u+=iw)i=e-l*Tc[u]*nw+l*Nc[u]*aw,o=r+c*Nc[u]*nw+c*Tc[u]*aw,u===0?t.moveTo(i,o):t.lineTo(i,o);t.closePath()};var bo={};bo.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]},bo.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],o=t.full?Math.ceil(n.h):a[3],l=de(t.maxWidth)||de(t.maxHeight),c=this.getPixelRatio(),u=1;if(t.scale!==void 0)i*=t.scale,o*=t.scale,u=t.scale;else if(l){var d=1/0,f=1/0;de(t.maxWidth)&&(d=u*t.maxWidth/i),de(t.maxHeight)&&(f=u*t.maxHeight/o),u=Math.min(d,f),i*=u,o*=u}l||(i*=c,o*=c,u*=c);var h=document.createElement("canvas");h.width=i,h.height=o,h.style.width=i+"px",h.style.height=o+"px";var v=h.getContext("2d");if(i>0&&o>0){v.clearRect(0,0,i,o),v.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(t.full)v.translate(-n.x1*u,-n.y1*u),v.scale(u,u),this.drawElements(v,p),v.scale(1/u,1/u),v.translate(n.x1*u,n.y1*u);else{var g=e.pan(),m={x:g.x*u,y:g.y*u};u*=e.zoom(),v.translate(m.x,m.y),v.scale(u,u),this.drawElements(v,p),v.scale(1/u,1/u),v.translate(-m.x,-m.y)}t.bg&&(v.globalCompositeOperation="destination-over",v.fillStyle=t.bg,v.rect(0,0,i,o),v.fill())}return h};function z3(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 ow(t){var e=t.indexOf(",");return t.substr(e+1)}function sw(t,e,r){var n=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new Ha(function(a,i){try{e.toBlob(function(o){o!=null?a(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(o){i(o)}});case"blob":return z3(ow(n()),r);case"base64":return ow(n());case"base64uri":default:return n()}}bo.png=function(t){return sw(t,this.bufferCanvasImage(t),"image/png")},bo.jpg=function(t){return sw(t,this.bufferCanvasImage(t),"image/jpeg")};var lw={};lw.nodeShapeImpl=function(t,e,r,n,a,i,o,l){switch(t){case"ellipse":return this.drawEllipsePath(e,r,n,a,i);case"polygon":return this.drawPolygonPath(e,r,n,a,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,r,n,a,i,o,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,o,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 H3=uw,Me=uw.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 uw(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 o=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,o.position="relative",o.zIndex="0",o.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"};BM()&&(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(j){d.style[j]=c[j]}),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=Kt(),h=function(M){return{x:(M.x1+M.x2)/2,y:(M.y1+M.y2)/2}},v=function(M){return{x:-M.w/2,y:-M.h/2}},p=function(M){var W=M[0]._private,Y=W.oldBackgroundTimestamp===W.backgroundTimestamp;return!Y},g=function(M){return M[0]._private.nodeKey},m=function(M){return M[0]._private.labelStyleKey},y=function(M){return M[0]._private.sourceLabelStyleKey},b=function(M){return M[0]._private.targetLabelStyleKey},w=function(M,W,Y,se,ce){return e.drawElement(M,W,Y,!1,!1,ce)},C=function(M,W,Y,se,ce){return e.drawElementText(M,W,Y,se,"main",ce)},x=function(M,W,Y,se,ce){return e.drawElementText(M,W,Y,se,"source",ce)},k=function(M,W,Y,se,ce){return e.drawElementText(M,W,Y,se,"target",ce)},E=function(M){return M.boundingBox(),M[0]._private.bodyBounds},_=function(M){return M.boundingBox(),M[0]._private.labelBounds.main||f},S=function(M){return M.boundingBox(),M[0]._private.labelBounds.source||f},T=function(M){return M.boundingBox(),M[0]._private.labelBounds.target||f},N=function(M,W){return W},B=function(M){return h(E(M))},O=function(M,W,Y){var se=M?M+"-":"";return{x:W.x+Y.pstyle(se+"text-margin-x").pfValue,y:W.y+Y.pstyle(se+"text-margin-y").pfValue}},D=function(M,W,Y){var se=M[0]._private.rscratch;return{x:se[W],y:se[Y]}},R=function(M){return O("",D(M,"labelX","labelY"),M)},P=function(M){return O("source",D(M,"sourceLabelX","sourceLabelY"),M)},L=function(M){return O("target",D(M,"targetLabelX","targetLabelY"),M)},A=function(M){return v(E(M))},q=function(M){return v(S(M))},U=function(M){return v(T(M))},z=function(M){var W=_(M),Y=v(_(M));if(M.isNode()){switch(M.pstyle("text-halign").value){case"left":Y.x=-W.w;break;case"right":Y.x=0;break}switch(M.pstyle("text-valign").value){case"top":Y.y=-W.h;break;case"bottom":Y.y=0;break}}return Y},H=e.data.eleTxrCache=new mo(e,{getKey:g,doesEleInvalidateKey:p,drawElement:w,getBoundingBox:E,getRotationPoint:B,getRotationOffset:A,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),Q=e.data.lblTxrCache=new mo(e,{getKey:m,drawElement:C,getBoundingBox:_,getRotationPoint:R,getRotationOffset:z,isVisible:N}),F=e.data.slbTxrCache=new mo(e,{getKey:y,drawElement:x,getBoundingBox:S,getRotationPoint:P,getRotationOffset:q,isVisible:N}),$=e.data.tlbTxrCache=new mo(e,{getKey:b,drawElement:k,getBoundingBox:T,getRotationPoint:L,getRotationOffset:U,isVisible:N}),V=e.data.lyrTxrCache=new Z1(e);e.onUpdateEleCalcs(function(M,W){H.invalidateElements(W),Q.invalidateElements(W),F.invalidateElements(W),$.invalidateElements(W),V.invalidateElements(W);for(var Y=0;Y<W.length;Y++){var se=W[Y]._private;se.oldBackgroundTimestamp=se.backgroundTimestamp}});var G=function(M){for(var W=0;W<M.length;W++)V.enqueueElementRefinement(M[W].ele)};H.onDequeue(G),Q.onDequeue(G),F.onDequeue(G),$.onDequeue(G)}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 K3=typeof Path2D<"u";Me.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t},Me.usePaths=function(){return K3&&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":ct(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},[J1,Ar,Qr,Sc,ua,ii,Xt,In,bo,lw].forEach(function(t){Se(Me,t)});var G3=[{name:"null",impl:T1},{name:"base",impl:U1},{name:"canvas",impl:H3}],U3=[{type:"layout",extensions:Jz},{type:"renderer",extensions:G3}],cw={},dw={};function fw(t,e,r){var n=r,a=function(_){$e("Can not register `"+e+"` for `"+t+"` since `"+_+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(po.prototype[e])return a(e);po.prototype[e]=r}else if(t==="collection"){if(St.prototype[e])return a(e);St.prototype[e]=r}else if(t==="layout"){for(var i=function(_){this.options=_,r.call(this,_),Ae(this._private)||(this._private={}),this._private.cy=_.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(r.prototype),l=[],c=0;c<l.length;c++){var u=l[c];o[u]=o[u]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var d=r.prototype.stop;o.stop=function(){var E=this.options;if(E&&E.animate){var _=this.animations;if(_)for(var S=0;S<_.length;S++)_[S].stop()}return d?d.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var f=function(_){return _._private.cy},h={addEventFields:function(_,S){S.layout=_,S.cy=f(_),S.target=_},bubble:function(){return!0},parent:function(_){return f(_)}};Se(o,{createEmitter:function(){return this._private.emitter=new Ms(h,this),this},emitter:function(){return this._private.emitter},on:function(_,S){return this.emitter().on(_,S),this},one:function(_,S){return this.emitter().one(_,S),this},once:function(_,S){return this.emitter().one(_,S),this},removeListener:function(_,S){return this.emitter().removeListener(_,S),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(_,S){return this.emitter().emit(_,S),this}}),Ve.eventAliasesOn(o),n=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var v=hw("renderer","base"),p=v.prototype,g=r,m=r.prototype,y=function(){v.apply(this,arguments),g.apply(this,arguments)},b=y.prototype;for(var w in p){var C=p[w],x=m[w]!=null;if(x)return a(w);b[w]=C}for(var k in m)b[k]=m[k];p.clientFunctions.forEach(function(E){b[E]=b[E]||function(){Je("Renderer does not implement `renderer."+E+"()` on its prototype")}}),n=y}else if(t==="__proto__"||t==="constructor"||t==="prototype")return Je(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return N0({map:cw,keys:[t,e],value:n})}function hw(t,e){return I0({map:cw,keys:[t,e]})}function j3(t,e,r,n,a){return N0({map:dw,keys:[t,e,r,n],value:a})}function W3(t,e,r,n){return I0({map:dw,keys:[t,e,r,n]})}var Ic=function(){if(arguments.length===2)return hw.apply(null,arguments);if(arguments.length===3)return fw.apply(null,arguments);if(arguments.length===4)return W3.apply(null,arguments);if(arguments.length===5)return j3.apply(null,arguments);Je("Invalid extension access syntax")};po.prototype.extension=Ic,U3.forEach(function(t){t.extensions.forEach(function(e){fw(t.type,e.name,e.impl)})});var pw=function t(){if(!(this instanceof t))return new t;this.length=0},ca=pw.prototype;ca.instanceString=function(){return"stylesheet"},ca.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this},ca.css=function(t,e){var r=this.length-1;if(Ee(t))this[r].properties.push({name:t,value:e});else if(Ae(t))for(var n=t,a=Object.keys(n),i=0;i<a.length;i++){var o=a[i],l=n[o];if(l!=null){var c=Dt.properties[o]||Dt.properties[ds(o)];if(c!=null){var u=c.name,d=l;this[r].properties.push({name:u,value:d})}}}return this},ca.style=ca.css,ca.generateStyle=function(t){var e=new Dt(t);return this.appendToStyle(e)},ca.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 o=a[i];t.css(o.name,o.value)}}return t};var Y3="3.30.2",Bn=function(e){if(e===void 0&&(e={}),Ae(e))return new po(e);if(Ee(e))return Ic.apply(Ic,arguments)};Bn.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Bn),t.apply(null,e),this},Bn.warnings=function(t){return z0(t)},Bn.version=Y3,Bn.stylesheet=Bn.Stylesheet=pw;var vw={exports:{}};function Bc(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Dc,gw;function Z3(){if(gw)return Dc;gw=1;function t(){this.__data__=[],this.size=0}return Dc=t,Dc}var Oc,mw;function si(){if(mw)return Oc;mw=1;function t(e,r){return e===r||e!==e&&r!==r}return Oc=t,Oc}var Pc,yw;function ol(){if(yw)return Pc;yw=1;var t=si();function e(r,n){for(var a=r.length;a--;)if(t(r[a][0],n))return a;return-1}return Pc=e,Pc}var Ac,bw;function X3(){if(bw)return Ac;bw=1;var t=ol(),e=Array.prototype,r=e.splice;function n(a){var i=this.__data__,o=t(i,a);if(o<0)return!1;var l=i.length-1;return o==l?i.pop():r.call(i,o,1),--this.size,!0}return Ac=n,Ac}var Rc,ww;function J3(){if(ww)return Rc;ww=1;var t=ol();function e(r){var n=this.__data__,a=t(n,r);return a<0?void 0:n[a][1]}return Rc=e,Rc}var Lc,Cw;function Q3(){if(Cw)return Lc;Cw=1;var t=ol();function e(r){return t(this.__data__,r)>-1}return Lc=e,Lc}var Mc,Ew;function e4(){if(Ew)return Mc;Ew=1;var t=ol();function e(r,n){var a=this.__data__,i=t(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return Mc=e,Mc}var Fc,xw;function sl(){if(xw)return Fc;xw=1;var t=Z3(),e=X3(),r=J3(),n=Q3(),a=e4();function i(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Fc=i,Fc}var $c,kw;function t4(){if(kw)return $c;kw=1;var t=sl();function e(){this.__data__=new t,this.size=0}return $c=e,$c}var Vc,Sw;function r4(){if(Sw)return Vc;Sw=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return Vc=t,Vc}var qc,_w;function n4(){if(_w)return qc;_w=1;function t(e){return this.__data__.get(e)}return qc=t,qc}var zc,Tw;function a4(){if(Tw)return zc;Tw=1;function t(e){return this.__data__.has(e)}return zc=t,zc}var Hc,Nw;function Iw(){if(Nw)return Hc;Nw=1;var t=typeof Ai=="object"&&Ai&&Ai.Object===Object&&Ai;return Hc=t,Hc}var Kc,Bw;function br(){if(Bw)return Kc;Bw=1;var t=Iw(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Kc=r,Kc}var Gc,Dw;function li(){if(Dw)return Gc;Dw=1;var t=br(),e=t.Symbol;return Gc=e,Gc}var Uc,Ow;function i4(){if(Ow)return Uc;Ow=1;var t=li(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,a=t?t.toStringTag:void 0;function i(o){var l=r.call(o,a),c=o[a];try{o[a]=void 0;var u=!0}catch{}var d=n.call(o);return u&&(l?o[a]=c:delete o[a]),d}return Uc=i,Uc}var jc,Pw;function o4(){if(Pw)return jc;Pw=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return jc=r,jc}var Wc,Aw;function da(){if(Aw)return Wc;Aw=1;var t=li(),e=i4(),r=o4(),n="[object Null]",a="[object Undefined]",i=t?t.toStringTag:void 0;function o(l){return l==null?l===void 0?a:n:i&&i in Object(l)?e(l):r(l)}return Wc=o,Wc}var Yc,Rw;function or(){if(Rw)return Yc;Rw=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Yc=t,Yc}var Zc,Lw;function wo(){if(Lw)return Zc;Lw=1;var t=da(),e=or(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(l){if(!e(l))return!1;var c=t(l);return c==n||c==a||c==r||c==i}return Zc=o,Zc}var Xc,Mw;function s4(){if(Mw)return Xc;Mw=1;var t=br(),e=t["__core-js_shared__"];return Xc=e,Xc}var Jc,Fw;function l4(){if(Fw)return Jc;Fw=1;var t=s4(),e=function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!e&&e in n}return Jc=r,Jc}var Qc,$w;function Vw(){if($w)return Qc;$w=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return Qc=r,Qc}var ed,qw;function u4(){if(qw)return ed;qw=1;var t=wo(),e=l4(),r=or(),n=Vw(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,l=Object.prototype,c=o.toString,u=l.hasOwnProperty,d=RegExp("^"+c.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(h){if(!r(h)||e(h))return!1;var v=t(h)?d:i;return v.test(n(h))}return ed=f,ed}var td,zw;function c4(){if(zw)return td;zw=1;function t(e,r){return e==null?void 0:e[r]}return td=t,td}var rd,Hw;function fa(){if(Hw)return rd;Hw=1;var t=u4(),e=c4();function r(n,a){var i=e(n,a);return t(i)?i:void 0}return rd=r,rd}var nd,Kw;function ad(){if(Kw)return nd;Kw=1;var t=fa(),e=br(),r=t(e,"Map");return nd=r,nd}var id,Gw;function ll(){if(Gw)return id;Gw=1;var t=fa(),e=t(Object,"create");return id=e,id}var od,Uw;function d4(){if(Uw)return od;Uw=1;var t=ll();function e(){this.__data__=t?t(null):{},this.size=0}return od=e,od}var sd,jw;function f4(){if(jw)return sd;jw=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return sd=t,sd}var ld,Ww;function h4(){if(Ww)return ld;Ww=1;var t=ll(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(i){var o=this.__data__;if(t){var l=o[i];return l===e?void 0:l}return n.call(o,i)?o[i]:void 0}return ld=a,ld}var ud,Yw;function p4(){if(Yw)return ud;Yw=1;var t=ll(),e=Object.prototype,r=e.hasOwnProperty;function n(a){var i=this.__data__;return t?i[a]!==void 0:r.call(i,a)}return ud=n,ud}var cd,Zw;function v4(){if(Zw)return cd;Zw=1;var t=ll(),e="__lodash_hash_undefined__";function r(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=t&&a===void 0?e:a,this}return cd=r,cd}var dd,Xw;function g4(){if(Xw)return dd;Xw=1;var t=d4(),e=f4(),r=h4(),n=p4(),a=v4();function i(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,dd=i,dd}var fd,Jw;function m4(){if(Jw)return fd;Jw=1;var t=g4(),e=sl(),r=ad();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return fd=n,fd}var hd,Qw;function y4(){if(Qw)return hd;Qw=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return hd=t,hd}var pd,eC;function ul(){if(eC)return pd;eC=1;var t=y4();function e(r,n){var a=r.__data__;return t(n)?a[typeof n=="string"?"string":"hash"]:a.map}return pd=e,pd}var vd,tC;function b4(){if(tC)return vd;tC=1;var t=ul();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return vd=e,vd}var gd,rC;function w4(){if(rC)return gd;rC=1;var t=ul();function e(r){return t(this,r).get(r)}return gd=e,gd}var md,nC;function C4(){if(nC)return md;nC=1;var t=ul();function e(r){return t(this,r).has(r)}return md=e,md}var yd,aC;function E4(){if(aC)return yd;aC=1;var t=ul();function e(r,n){var a=t(this,r),i=a.size;return a.set(r,n),this.size+=a.size==i?0:1,this}return yd=e,yd}var bd,iC;function wd(){if(iC)return bd;iC=1;var t=m4(),e=b4(),r=w4(),n=C4(),a=E4();function i(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,bd=i,bd}var Cd,oC;function x4(){if(oC)return Cd;oC=1;var t=sl(),e=ad(),r=wd(),n=200;function a(i,o){var l=this.__data__;if(l instanceof t){var c=l.__data__;if(!e||c.length<n-1)return c.push([i,o]),this.size=++l.size,this;l=this.__data__=new r(c)}return l.set(i,o),this.size=l.size,this}return Cd=a,Cd}var Ed,sC;function cl(){if(sC)return Ed;sC=1;var t=sl(),e=t4(),r=r4(),n=n4(),a=a4(),i=x4();function o(l){var c=this.__data__=new t(l);this.size=c.size}return o.prototype.clear=e,o.prototype.delete=r,o.prototype.get=n,o.prototype.has=a,o.prototype.set=i,Ed=o,Ed}var xd,lC;function kd(){if(lC)return xd;lC=1;function t(e,r){for(var n=-1,a=e==null?0:e.length;++n<a&&r(e[n],n,e)!==!1;);return e}return xd=t,xd}var Sd,uC;function cC(){if(uC)return Sd;uC=1;var t=fa(),e=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}}();return Sd=e,Sd}var _d,dC;function dl(){if(dC)return _d;dC=1;var t=cC();function e(r,n,a){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return _d=e,_d}var Td,fC;function fl(){if(fC)return Td;fC=1;var t=dl(),e=si(),r=Object.prototype,n=r.hasOwnProperty;function a(i,o,l){var c=i[o];(!(n.call(i,o)&&e(c,l))||l===void 0&&!(o in i))&&t(i,o,l)}return Td=a,Td}var Nd,hC;function Co(){if(hC)return Nd;hC=1;var t=fl(),e=dl();function r(n,a,i,o){var l=!i;i||(i={});for(var c=-1,u=a.length;++c<u;){var d=a[c],f=o?o(i[d],n[d],d,i,n):void 0;f===void 0&&(f=n[d]),l?e(i,d,f):t(i,d,f)}return i}return Nd=r,Nd}var Id,pC;function k4(){if(pC)return Id;pC=1;function t(e,r){for(var n=-1,a=Array(e);++n<e;)a[n]=r(n);return a}return Id=t,Id}var Bd,vC;function Rr(){if(vC)return Bd;vC=1;function t(e){return e!=null&&typeof e=="object"}return Bd=t,Bd}var Dd,gC;function S4(){if(gC)return Dd;gC=1;var t=da(),e=Rr(),r="[object Arguments]";function n(a){return e(a)&&t(a)==r}return Dd=n,Dd}var Od,mC;function Eo(){if(mC)return Od;mC=1;var t=S4(),e=Rr(),r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,i=t(function(){return arguments}())?t:function(o){return e(o)&&n.call(o,"callee")&&!a.call(o,"callee")};return Od=i,Od}var Pd,yC;function at(){if(yC)return Pd;yC=1;var t=Array.isArray;return Pd=t,Pd}var xo={exports:{}},Ad,bC;function _4(){if(bC)return Ad;bC=1;function t(){return!1}return Ad=t,Ad}xo.exports;var wC;function ui(){return wC||(wC=1,function(t,e){var r=br(),n=_4(),a=e&&!e.nodeType&&e,i=a&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===a,l=o?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;t.exports=u}(xo,xo.exports)),xo.exports}var Rd,CC;function hl(){if(CC)return Rd;CC=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,a){var i=typeof n;return a=a??t,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return Rd=r,Rd}var Ld,EC;function Md(){if(EC)return Ld;EC=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return Ld=e,Ld}var Fd,xC;function T4(){if(xC)return Fd;xC=1;var t=da(),e=Md(),r=Rr(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",l="[object Error]",c="[object Function]",u="[object Map]",d="[object Number]",f="[object Object]",h="[object RegExp]",v="[object Set]",p="[object String]",g="[object WeakMap]",m="[object ArrayBuffer]",y="[object DataView]",b="[object Float32Array]",w="[object Float64Array]",C="[object Int8Array]",x="[object Int16Array]",k="[object Int32Array]",E="[object Uint8Array]",_="[object Uint8ClampedArray]",S="[object Uint16Array]",T="[object Uint32Array]",N={};N[b]=N[w]=N[C]=N[x]=N[k]=N[E]=N[_]=N[S]=N[T]=!0,N[n]=N[a]=N[m]=N[i]=N[y]=N[o]=N[l]=N[c]=N[u]=N[d]=N[f]=N[h]=N[v]=N[p]=N[g]=!1;function B(O){return r(O)&&e(O.length)&&!!N[t(O)]}return Fd=B,Fd}var $d,kC;function pl(){if(kC)return $d;kC=1;function t(e){return function(r){return e(r)}}return $d=t,$d}var ko={exports:{}};ko.exports;var SC;function Vd(){return SC||(SC=1,function(t,e){var r=Iw(),n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,i=a&&a.exports===n,o=i&&r.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();t.exports=l}(ko,ko.exports)),ko.exports}var qd,_C;function So(){if(_C)return qd;_C=1;var t=T4(),e=pl(),r=Vd(),n=r&&r.isTypedArray,a=n?e(n):t;return qd=a,qd}var zd,TC;function NC(){if(TC)return zd;TC=1;var t=k4(),e=Eo(),r=at(),n=ui(),a=hl(),i=So(),o=Object.prototype,l=o.hasOwnProperty;function c(u,d){var f=r(u),h=!f&&e(u),v=!f&&!h&&n(u),p=!f&&!h&&!v&&i(u),g=f||h||v||p,m=g?t(u.length,String):[],y=m.length;for(var b in u)(d||l.call(u,b))&&!(g&&(b=="length"||v&&(b=="offset"||b=="parent")||p&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||a(b,y)))&&m.push(b);return m}return zd=c,zd}var Hd,IC;function vl(){if(IC)return Hd;IC=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||t;return r===a}return Hd=e,Hd}var Kd,BC;function DC(){if(BC)return Kd;BC=1;function t(e,r){return function(n){return e(r(n))}}return Kd=t,Kd}var Gd,OC;function N4(){if(OC)return Gd;OC=1;var t=DC(),e=t(Object.keys,Object);return Gd=e,Gd}var Ud,PC;function jd(){if(PC)return Ud;PC=1;var t=vl(),e=N4(),r=Object.prototype,n=r.hasOwnProperty;function a(i){if(!t(i))return e(i);var o=[];for(var l in Object(i))n.call(i,l)&&l!="constructor"&&o.push(l);return o}return Ud=a,Ud}var Wd,AC;function en(){if(AC)return Wd;AC=1;var t=wo(),e=Md();function r(n){return n!=null&&e(n.length)&&!t(n)}return Wd=r,Wd}var Yd,RC;function Dn(){if(RC)return Yd;RC=1;var t=NC(),e=jd(),r=en();function n(a){return r(a)?t(a):e(a)}return Yd=n,Yd}var Zd,LC;function I4(){if(LC)return Zd;LC=1;var t=Co(),e=Dn();function r(n,a){return n&&t(a,e(a),n)}return Zd=r,Zd}var Xd,MC;function B4(){if(MC)return Xd;MC=1;function t(e){var r=[];if(e!=null)for(var n in Object(e))r.push(n);return r}return Xd=t,Xd}var Jd,FC;function D4(){if(FC)return Jd;FC=1;var t=or(),e=vl(),r=B4(),n=Object.prototype,a=n.hasOwnProperty;function i(o){if(!t(o))return r(o);var l=e(o),c=[];for(var u in o)u=="constructor"&&(l||!a.call(o,u))||c.push(u);return c}return Jd=i,Jd}var Qd,$C;function ha(){if($C)return Qd;$C=1;var t=NC(),e=D4(),r=en();function n(a){return r(a)?t(a,!0):e(a)}return Qd=n,Qd}var ef,VC;function O4(){if(VC)return ef;VC=1;var t=Co(),e=ha();function r(n,a){return n&&t(a,e(a),n)}return ef=r,ef}var _o={exports:{}};_o.exports;var qC;function zC(){return qC||(qC=1,function(t,e){var r=br(),n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,i=a&&a.exports===n,o=i?r.Buffer:void 0,l=o?o.allocUnsafe:void 0;function c(u,d){if(d)return u.slice();var f=u.length,h=l?l(f):new u.constructor(f);return u.copy(h),h}t.exports=c}(_o,_o.exports)),_o.exports}var tf,HC;function KC(){if(HC)return tf;HC=1;function t(e,r){var n=-1,a=e.length;for(r||(r=Array(a));++n<a;)r[n]=e[n];return r}return tf=t,tf}var rf,GC;function UC(){if(GC)return rf;GC=1;function t(e,r){for(var n=-1,a=e==null?0:e.length,i=0,o=[];++n<a;){var l=e[n];r(l,n,e)&&(o[i++]=l)}return o}return rf=t,rf}var nf,jC;function WC(){if(jC)return nf;jC=1;function t(){return[]}return nf=t,nf}var af,YC;function of(){if(YC)return af;YC=1;var t=UC(),e=WC(),r=Object.prototype,n=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(o){return o==null?[]:(o=Object(o),t(a(o),function(l){return n.call(o,l)}))}:e;return af=i,af}var sf,ZC;function P4(){if(ZC)return sf;ZC=1;var t=Co(),e=of();function r(n,a){return t(n,e(n),a)}return sf=r,sf}var lf,XC;function uf(){if(XC)return lf;XC=1;function t(e,r){for(var n=-1,a=r.length,i=e.length;++n<a;)e[i+n]=r[n];return e}return lf=t,lf}var cf,JC;function gl(){if(JC)return cf;JC=1;var t=DC(),e=t(Object.getPrototypeOf,Object);return cf=e,cf}var df,QC;function eE(){if(QC)return df;QC=1;var t=uf(),e=gl(),r=of(),n=WC(),a=Object.getOwnPropertySymbols,i=a?function(o){for(var l=[];o;)t(l,r(o)),o=e(o);return l}:n;return df=i,df}var ff,tE;function A4(){if(tE)return ff;tE=1;var t=Co(),e=eE();function r(n,a){return t(n,e(n),a)}return ff=r,ff}var hf,rE;function nE(){if(rE)return hf;rE=1;var t=uf(),e=at();function r(n,a,i){var o=a(n);return e(n)?o:t(o,i(n))}return hf=r,hf}var pf,aE;function iE(){if(aE)return pf;aE=1;var t=nE(),e=of(),r=Dn();function n(a){return t(a,r,e)}return pf=n,pf}var vf,oE;function R4(){if(oE)return vf;oE=1;var t=nE(),e=eE(),r=ha();function n(a){return t(a,r,e)}return vf=n,vf}var gf,sE;function L4(){if(sE)return gf;sE=1;var t=fa(),e=br(),r=t(e,"DataView");return gf=r,gf}var mf,lE;function M4(){if(lE)return mf;lE=1;var t=fa(),e=br(),r=t(e,"Promise");return mf=r,mf}var yf,uE;function cE(){if(uE)return yf;uE=1;var t=fa(),e=br(),r=t(e,"Set");return yf=r,yf}var bf,dE;function F4(){if(dE)return bf;dE=1;var t=fa(),e=br(),r=t(e,"WeakMap");return bf=r,bf}var wf,fE;function ci(){if(fE)return wf;fE=1;var t=L4(),e=ad(),r=M4(),n=cE(),a=F4(),i=da(),o=Vw(),l="[object Map]",c="[object Object]",u="[object Promise]",d="[object Set]",f="[object WeakMap]",h="[object DataView]",v=o(t),p=o(e),g=o(r),m=o(n),y=o(a),b=i;return(t&&b(new t(new ArrayBuffer(1)))!=h||e&&b(new e)!=l||r&&b(r.resolve())!=u||n&&b(new n)!=d||a&&b(new a)!=f)&&(b=function(w){var C=i(w),x=C==c?w.constructor:void 0,k=x?o(x):"";if(k)switch(k){case v:return h;case p:return l;case g:return u;case m:return d;case y:return f}return C}),wf=b,wf}var Cf,hE;function $4(){if(hE)return Cf;hE=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n){var a=n.length,i=new n.constructor(a);return a&&typeof n[0]=="string"&&e.call(n,"index")&&(i.index=n.index,i.input=n.input),i}return Cf=r,Cf}var Ef,pE;function vE(){if(pE)return Ef;pE=1;var t=br(),e=t.Uint8Array;return Ef=e,Ef}var xf,gE;function kf(){if(gE)return xf;gE=1;var t=vE();function e(r){var n=new r.constructor(r.byteLength);return new t(n).set(new t(r)),n}return xf=e,xf}var Sf,mE;function V4(){if(mE)return Sf;mE=1;var t=kf();function e(r,n){var a=n?t(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}return Sf=e,Sf}var _f,yE;function q4(){if(yE)return _f;yE=1;var t=/\w*$/;function e(r){var n=new r.constructor(r.source,t.exec(r));return n.lastIndex=r.lastIndex,n}return _f=e,_f}var Tf,bE;function z4(){if(bE)return Tf;bE=1;var t=li(),e=t?t.prototype:void 0,r=e?e.valueOf:void 0;function n(a){return r?Object(r.call(a)):{}}return Tf=n,Tf}var Nf,wE;function CE(){if(wE)return Nf;wE=1;var t=kf();function e(r,n){var a=n?t(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}return Nf=e,Nf}var If,EE;function H4(){if(EE)return If;EE=1;var t=kf(),e=V4(),r=q4(),n=z4(),a=CE(),i="[object Boolean]",o="[object Date]",l="[object Map]",c="[object Number]",u="[object RegExp]",d="[object Set]",f="[object String]",h="[object Symbol]",v="[object ArrayBuffer]",p="[object DataView]",g="[object Float32Array]",m="[object Float64Array]",y="[object Int8Array]",b="[object Int16Array]",w="[object Int32Array]",C="[object Uint8Array]",x="[object Uint8ClampedArray]",k="[object Uint16Array]",E="[object Uint32Array]";function _(S,T,N){var B=S.constructor;switch(T){case v:return t(S);case i:case o:return new B(+S);case p:return e(S,N);case g:case m:case y:case b:case w:case C:case x:case k:case E:return a(S,N);case l:return new B;case c:case f:return new B(S);case u:return r(S);case d:return new B;case h:return n(S)}}return If=_,If}var Bf,xE;function kE(){if(xE)return Bf;xE=1;var t=or(),e=Object.create,r=function(){function n(){}return function(a){if(!t(a))return{};if(e)return e(a);n.prototype=a;var i=new n;return n.prototype=void 0,i}}();return Bf=r,Bf}var Df,SE;function _E(){if(SE)return Df;SE=1;var t=kE(),e=gl(),r=vl();function n(a){return typeof a.constructor=="function"&&!r(a)?t(e(a)):{}}return Df=n,Df}var Of,TE;function K4(){if(TE)return Of;TE=1;var t=ci(),e=Rr(),r="[object Map]";function n(a){return e(a)&&t(a)==r}return Of=n,Of}var Pf,NE;function G4(){if(NE)return Pf;NE=1;var t=K4(),e=pl(),r=Vd(),n=r&&r.isMap,a=n?e(n):t;return Pf=a,Pf}var Af,IE;function U4(){if(IE)return Af;IE=1;var t=ci(),e=Rr(),r="[object Set]";function n(a){return e(a)&&t(a)==r}return Af=n,Af}var Rf,BE;function j4(){if(BE)return Rf;BE=1;var t=U4(),e=pl(),r=Vd(),n=r&&r.isSet,a=n?e(n):t;return Rf=a,Rf}var Lf,DE;function OE(){if(DE)return Lf;DE=1;var t=cl(),e=kd(),r=fl(),n=I4(),a=O4(),i=zC(),o=KC(),l=P4(),c=A4(),u=iE(),d=R4(),f=ci(),h=$4(),v=H4(),p=_E(),g=at(),m=ui(),y=G4(),b=or(),w=j4(),C=Dn(),x=ha(),k=1,E=2,_=4,S="[object Arguments]",T="[object Array]",N="[object Boolean]",B="[object Date]",O="[object Error]",D="[object Function]",R="[object GeneratorFunction]",P="[object Map]",L="[object Number]",A="[object Object]",q="[object RegExp]",U="[object Set]",z="[object String]",H="[object Symbol]",Q="[object WeakMap]",F="[object ArrayBuffer]",$="[object DataView]",V="[object Float32Array]",G="[object Float64Array]",j="[object Int8Array]",M="[object Int16Array]",W="[object Int32Array]",Y="[object Uint8Array]",se="[object Uint8ClampedArray]",ce="[object Uint16Array]",ae="[object Uint32Array]",ne={};ne[S]=ne[T]=ne[F]=ne[$]=ne[N]=ne[B]=ne[V]=ne[G]=ne[j]=ne[M]=ne[W]=ne[P]=ne[L]=ne[A]=ne[q]=ne[U]=ne[z]=ne[H]=ne[Y]=ne[se]=ne[ce]=ne[ae]=!0,ne[O]=ne[D]=ne[Q]=!1;function ue(ie,fe,pe,De,Ie,we){var xe,re=fe&k,I=fe&E,K=fe&_;if(pe&&(xe=Ie?pe(ie,De,Ie,we):pe(ie)),xe!==void 0)return xe;if(!b(ie))return ie;var te=g(ie);if(te){if(xe=h(ie),!re)return o(ie,xe)}else{var Z=f(ie),X=Z==D||Z==R;if(m(ie))return i(ie,re);if(Z==A||Z==S||X&&!Ie){if(xe=I||X?{}:p(ie),!re)return I?c(ie,a(xe,ie)):l(ie,n(xe,ie))}else{if(!ne[Z])return Ie?ie:{};xe=v(ie,Z,re)}}we||(we=new t);var le=we.get(ie);if(le)return le;we.set(ie,xe),w(ie)?ie.forEach(function(me){xe.add(ue(me,fe,pe,me,ie,we))}):y(ie)&&ie.forEach(function(me,be){xe.set(be,ue(me,fe,pe,be,ie,we))});var ee=K?I?d:u:I?x:C,oe=te?void 0:ee(ie);return e(oe||ie,function(me,be){oe&&(be=me,me=ie[be]),r(xe,be,ue(me,fe,pe,be,ie,we))}),xe}return Lf=ue,Lf}var Mf,PE;function W4(){if(PE)return Mf;PE=1;var t=OE(),e=4;function r(n){return t(n,e)}return Mf=r,Mf}var Ff,AE;function $f(){if(AE)return Ff;AE=1;function t(e){return function(){return e}}return Ff=t,Ff}var Vf,RE;function Y4(){if(RE)return Vf;RE=1;function t(e){return function(r,n,a){for(var i=-1,o=Object(r),l=a(r),c=l.length;c--;){var u=l[e?c:++i];if(n(o[u],u,o)===!1)break}return r}}return Vf=t,Vf}var qf,LE;function zf(){if(LE)return qf;LE=1;var t=Y4(),e=t();return qf=e,qf}var Hf,ME;function Kf(){if(ME)return Hf;ME=1;var t=zf(),e=Dn();function r(n,a){return n&&t(n,a,e)}return Hf=r,Hf}var Gf,FE;function Z4(){if(FE)return Gf;FE=1;var t=en();function e(r,n){return function(a,i){if(a==null)return a;if(!t(a))return r(a,i);for(var o=a.length,l=n?o:-1,c=Object(a);(n?l--:++l<o)&&i(c[l],l,c)!==!1;);return a}}return Gf=e,Gf}var Uf,$E;function ml(){if($E)return Uf;$E=1;var t=Kf(),e=Z4(),r=e(t);return Uf=r,Uf}var jf,VE;function pa(){if(VE)return jf;VE=1;function t(e){return e}return jf=t,jf}var Wf,qE;function zE(){if(qE)return Wf;qE=1;var t=pa();function e(r){return typeof r=="function"?r:t}return Wf=e,Wf}var Yf,HE;function KE(){if(HE)return Yf;HE=1;var t=kd(),e=ml(),r=zE(),n=at();function a(i,o){var l=n(i)?t:e;return l(i,r(o))}return Yf=a,Yf}var Zf,GE;function UE(){return GE||(GE=1,Zf=KE()),Zf}var Xf,jE;function X4(){if(jE)return Xf;jE=1;var t=ml();function e(r,n){var a=[];return t(r,function(i,o,l){n(i,o,l)&&a.push(i)}),a}return Xf=e,Xf}var Jf,WE;function J4(){if(WE)return Jf;WE=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return Jf=e,Jf}var Qf,YE;function Q4(){if(YE)return Qf;YE=1;function t(e){return this.__data__.has(e)}return Qf=t,Qf}var eh,ZE;function XE(){if(ZE)return eh;ZE=1;var t=wd(),e=J4(),r=Q4();function n(a){var i=-1,o=a==null?0:a.length;for(this.__data__=new t;++i<o;)this.add(a[i])}return n.prototype.add=n.prototype.push=e,n.prototype.has=r,eh=n,eh}var th,JE;function e8(){if(JE)return th;JE=1;function t(e,r){for(var n=-1,a=e==null?0:e.length;++n<a;)if(r(e[n],n,e))return!0;return!1}return th=t,th}var rh,QE;function ex(){if(QE)return rh;QE=1;function t(e,r){return e.has(r)}return rh=t,rh}var nh,tx;function rx(){if(tx)return nh;tx=1;var t=XE(),e=e8(),r=ex(),n=1,a=2;function i(o,l,c,u,d,f){var h=c&n,v=o.length,p=l.length;if(v!=p&&!(h&&p>v))return!1;var g=f.get(o),m=f.get(l);if(g&&m)return g==l&&m==o;var y=-1,b=!0,w=c&a?new t:void 0;for(f.set(o,l),f.set(l,o);++y<v;){var C=o[y],x=l[y];if(u)var k=h?u(x,C,y,l,o,f):u(C,x,y,o,l,f);if(k!==void 0){if(k)continue;b=!1;break}if(w){if(!e(l,function(E,_){if(!r(w,_)&&(C===E||d(C,E,c,u,f)))return w.push(_)})){b=!1;break}}else if(!(C===x||d(C,x,c,u,f))){b=!1;break}}return f.delete(o),f.delete(l),b}return nh=i,nh}var ah,nx;function t8(){if(nx)return ah;nx=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a,i){n[++r]=[i,a]}),n}return ah=t,ah}var ih,ax;function oh(){if(ax)return ih;ax=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a){n[++r]=a}),n}return ih=t,ih}var sh,ix;function r8(){if(ix)return sh;ix=1;var t=li(),e=vE(),r=si(),n=rx(),a=t8(),i=oh(),o=1,l=2,c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Map]",h="[object Number]",v="[object RegExp]",p="[object Set]",g="[object String]",m="[object Symbol]",y="[object ArrayBuffer]",b="[object DataView]",w=t?t.prototype:void 0,C=w?w.valueOf:void 0;function x(k,E,_,S,T,N,B){switch(_){case b:if(k.byteLength!=E.byteLength||k.byteOffset!=E.byteOffset)return!1;k=k.buffer,E=E.buffer;case y:return!(k.byteLength!=E.byteLength||!N(new e(k),new e(E)));case c:case u:case h:return r(+k,+E);case d:return k.name==E.name&&k.message==E.message;case v:case g:return k==E+"";case f:var O=a;case p:var D=S&o;if(O||(O=i),k.size!=E.size&&!D)return!1;var R=B.get(k);if(R)return R==E;S|=l,B.set(k,E);var P=n(O(k),O(E),S,T,N,B);return B.delete(k),P;case m:if(C)return C.call(k)==C.call(E)}return!1}return sh=x,sh}var lh,ox;function n8(){if(ox)return lh;ox=1;var t=iE(),e=1,r=Object.prototype,n=r.hasOwnProperty;function a(i,o,l,c,u,d){var f=l&e,h=t(i),v=h.length,p=t(o),g=p.length;if(v!=g&&!f)return!1;for(var m=v;m--;){var y=h[m];if(!(f?y in o:n.call(o,y)))return!1}var b=d.get(i),w=d.get(o);if(b&&w)return b==o&&w==i;var C=!0;d.set(i,o),d.set(o,i);for(var x=f;++m<v;){y=h[m];var k=i[y],E=o[y];if(c)var _=f?c(E,k,y,o,i,d):c(k,E,y,i,o,d);if(!(_===void 0?k===E||u(k,E,l,c,d):_)){C=!1;break}x||(x=y=="constructor")}if(C&&!x){var S=i.constructor,T=o.constructor;S!=T&&"constructor"in i&&"constructor"in o&&!(typeof S=="function"&&S instanceof S&&typeof T=="function"&&T instanceof T)&&(C=!1)}return d.delete(i),d.delete(o),C}return lh=a,lh}var uh,sx;function a8(){if(sx)return uh;sx=1;var t=cl(),e=rx(),r=r8(),n=n8(),a=ci(),i=at(),o=ui(),l=So(),c=1,u="[object Arguments]",d="[object Array]",f="[object Object]",h=Object.prototype,v=h.hasOwnProperty;function p(g,m,y,b,w,C){var x=i(g),k=i(m),E=x?d:a(g),_=k?d:a(m);E=E==u?f:E,_=_==u?f:_;var S=E==f,T=_==f,N=E==_;if(N&&o(g)){if(!o(m))return!1;x=!0,S=!1}if(N&&!S)return C||(C=new t),x||l(g)?e(g,m,y,b,w,C):r(g,m,E,y,b,w,C);if(!(y&c)){var B=S&&v.call(g,"__wrapped__"),O=T&&v.call(m,"__wrapped__");if(B||O){var D=B?g.value():g,R=O?m.value():m;return C||(C=new t),w(D,R,y,b,C)}}return N?(C||(C=new t),n(g,m,y,b,w,C)):!1}return uh=p,uh}var ch,lx;function ux(){if(lx)return ch;lx=1;var t=a8(),e=Rr();function r(n,a,i,o,l){return n===a?!0:n==null||a==null||!e(n)&&!e(a)?n!==n&&a!==a:t(n,a,i,o,r,l)}return ch=r,ch}var dh,cx;function i8(){if(cx)return dh;cx=1;var t=cl(),e=ux(),r=1,n=2;function a(i,o,l,c){var u=l.length,d=u,f=!c;if(i==null)return!d;for(i=Object(i);u--;){var h=l[u];if(f&&h[2]?h[1]!==i[h[0]]:!(h[0]in i))return!1}for(;++u<d;){h=l[u];var v=h[0],p=i[v],g=h[1];if(f&&h[2]){if(p===void 0&&!(v in i))return!1}else{var m=new t;if(c)var y=c(p,g,v,i,o,m);if(!(y===void 0?e(g,p,r|n,c,m):y))return!1}}return!0}return dh=a,dh}var fh,dx;function fx(){if(dx)return fh;dx=1;var t=or();function e(r){return r===r&&!t(r)}return fh=e,fh}var hh,hx;function o8(){if(hx)return hh;hx=1;var t=fx(),e=Dn();function r(n){for(var a=e(n),i=a.length;i--;){var o=a[i],l=n[o];a[i]=[o,l,t(l)]}return a}return hh=r,hh}var ph,px;function vx(){if(px)return ph;px=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return ph=t,ph}var vh,gx;function s8(){if(gx)return vh;gx=1;var t=i8(),e=o8(),r=vx();function n(a){var i=e(a);return i.length==1&&i[0][2]?r(i[0][0],i[0][1]):function(o){return o===a||t(o,a,i)}}return vh=n,vh}var gh,mx;function di(){if(mx)return gh;mx=1;var t=da(),e=Rr(),r="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&t(a)==r}return gh=n,gh}var mh,yx;function yh(){if(yx)return mh;yx=1;var t=at(),e=di(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(t(i))return!1;var l=typeof i;return l=="number"||l=="symbol"||l=="boolean"||i==null||e(i)?!0:n.test(i)||!r.test(i)||o!=null&&i in Object(o)}return mh=a,mh}var bh,bx;function l8(){if(bx)return bh;bx=1;var t=wd(),e="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var o=arguments,l=a?a.apply(this,o):o[0],c=i.cache;if(c.has(l))return c.get(l);var u=n.apply(this,o);return i.cache=c.set(l,u)||c,u};return i.cache=new(r.Cache||t),i}return r.Cache=t,bh=r,bh}var wh,wx;function u8(){if(wx)return wh;wx=1;var t=l8(),e=500;function r(n){var a=t(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return wh=r,wh}var Ch,Cx;function c8(){if(Cx)return Ch;Cx=1;var t=u8(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(o,l,c,u){i.push(c?u.replace(r,"$1"):l||o)}),i});return Ch=n,Ch}var Eh,Ex;function yl(){if(Ex)return Eh;Ex=1;function t(e,r){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=r(e[n],n,e);return i}return Eh=t,Eh}var xh,xx;function d8(){if(xx)return xh;xx=1;var t=li(),e=yl(),r=at(),n=di(),a=1/0,i=t?t.prototype:void 0,o=i?i.toString:void 0;function l(c){if(typeof c=="string")return c;if(r(c))return e(c,l)+"";if(n(c))return o?o.call(c):"";var u=c+"";return u=="0"&&1/c==-a?"-0":u}return xh=l,xh}var kh,kx;function Sx(){if(kx)return kh;kx=1;var t=d8();function e(r){return r==null?"":t(r)}return kh=e,kh}var Sh,_x;function bl(){if(_x)return Sh;_x=1;var t=at(),e=yh(),r=c8(),n=Sx();function a(i,o){return t(i)?i:e(i,o)?[i]:r(n(i))}return Sh=a,Sh}var _h,Tx;function To(){if(Tx)return _h;Tx=1;var t=di(),e=1/0;function r(n){if(typeof n=="string"||t(n))return n;var a=n+"";return a=="0"&&1/n==-e?"-0":a}return _h=r,_h}var Th,Nx;function wl(){if(Nx)return Th;Nx=1;var t=bl(),e=To();function r(n,a){a=t(a,n);for(var i=0,o=a.length;n!=null&&i<o;)n=n[e(a[i++])];return i&&i==o?n:void 0}return Th=r,Th}var Nh,Ix;function f8(){if(Ix)return Nh;Ix=1;var t=wl();function e(r,n,a){var i=r==null?void 0:t(r,n);return i===void 0?a:i}return Nh=e,Nh}var Ih,Bx;function h8(){if(Bx)return Ih;Bx=1;function t(e,r){return e!=null&&r in Object(e)}return Ih=t,Ih}var Bh,Dx;function Ox(){if(Dx)return Bh;Dx=1;var t=bl(),e=Eo(),r=at(),n=hl(),a=Md(),i=To();function o(l,c,u){c=t(c,l);for(var d=-1,f=c.length,h=!1;++d<f;){var v=i(c[d]);if(!(h=l!=null&&u(l,v)))break;l=l[v]}return h||++d!=f?h:(f=l==null?0:l.length,!!f&&a(f)&&n(v,f)&&(r(l)||e(l)))}return Bh=o,Bh}var Dh,Px;function Ax(){if(Px)return Dh;Px=1;var t=h8(),e=Ox();function r(n,a){return n!=null&&e(n,a,t)}return Dh=r,Dh}var Oh,Rx;function p8(){if(Rx)return Oh;Rx=1;var t=ux(),e=f8(),r=Ax(),n=yh(),a=fx(),i=vx(),o=To(),l=1,c=2;function u(d,f){return n(d)&&a(f)?i(o(d),f):function(h){var v=e(h,d);return v===void 0&&v===f?r(h,d):t(f,v,l|c)}}return Oh=u,Oh}var Ph,Lx;function Mx(){if(Lx)return Ph;Lx=1;function t(e){return function(r){return r==null?void 0:r[e]}}return Ph=t,Ph}var Ah,Fx;function v8(){if(Fx)return Ah;Fx=1;var t=wl();function e(r){return function(n){return t(n,r)}}return Ah=e,Ah}var Rh,$x;function g8(){if($x)return Rh;$x=1;var t=Mx(),e=v8(),r=yh(),n=To();function a(i){return r(i)?t(n(i)):e(i)}return Rh=a,Rh}var Lh,Vx;function tn(){if(Vx)return Lh;Vx=1;var t=s8(),e=p8(),r=pa(),n=at(),a=g8();function i(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?n(o)?e(o[0],o[1]):t(o):a(o)}return Lh=i,Lh}var Mh,qx;function zx(){if(qx)return Mh;qx=1;var t=UC(),e=X4(),r=tn(),n=at();function a(i,o){var l=n(i)?t:e;return l(i,r(o,3))}return Mh=a,Mh}var Fh,Hx;function m8(){if(Hx)return Fh;Hx=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n,a){return n!=null&&e.call(n,a)}return Fh=r,Fh}var $h,Kx;function Gx(){if(Kx)return $h;Kx=1;var t=m8(),e=Ox();function r(n,a){return n!=null&&e(n,a,t)}return $h=r,$h}var Vh,Ux;function y8(){if(Ux)return Vh;Ux=1;var t=jd(),e=ci(),r=Eo(),n=at(),a=en(),i=ui(),o=vl(),l=So(),c="[object Map]",u="[object Set]",d=Object.prototype,f=d.hasOwnProperty;function h(v){if(v==null)return!0;if(a(v)&&(n(v)||typeof v=="string"||typeof v.splice=="function"||i(v)||l(v)||r(v)))return!v.length;var p=e(v);if(p==c||p==u)return!v.size;if(o(v))return!t(v).length;for(var g in v)if(f.call(v,g))return!1;return!0}return Vh=h,Vh}var qh,jx;function Wx(){if(jx)return qh;jx=1;function t(e){return e===void 0}return qh=t,qh}var zh,Yx;function Zx(){if(Yx)return zh;Yx=1;var t=ml(),e=en();function r(n,a){var i=-1,o=e(n)?Array(n.length):[];return t(n,function(l,c,u){o[++i]=a(l,c,u)}),o}return zh=r,zh}var Hh,Xx;function Jx(){if(Xx)return Hh;Xx=1;var t=yl(),e=tn(),r=Zx(),n=at();function a(i,o){var l=n(i)?t:r;return l(i,e(o,3))}return Hh=a,Hh}var Kh,Qx;function b8(){if(Qx)return Kh;Qx=1;function t(e,r,n,a){var i=-1,o=e==null?0:e.length;for(a&&o&&(n=e[++i]);++i<o;)n=r(n,e[i],i,e);return n}return Kh=t,Kh}var Gh,ek;function w8(){if(ek)return Gh;ek=1;function t(e,r,n,a,i){return i(e,function(o,l,c){n=a?(a=!1,o):r(n,o,l,c)}),n}return Gh=t,Gh}var Uh,tk;function rk(){if(tk)return Uh;tk=1;var t=b8(),e=ml(),r=tn(),n=w8(),a=at();function i(o,l,c){var u=a(o)?t:n,d=arguments.length<3;return u(o,r(l,4),c,d,e)}return Uh=i,Uh}var jh,nk;function C8(){if(nk)return jh;nk=1;var t=da(),e=at(),r=Rr(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&r(i)&&t(i)==n}return jh=a,jh}var Wh,ak;function E8(){if(ak)return Wh;ak=1;var t=Mx(),e=t("length");return Wh=e,Wh}var Yh,ik;function x8(){if(ik)return Yh;ik=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+r+n,i="\\ufe0e\\ufe0f",o="\\u200d",l=RegExp("["+o+t+a+i+"]");function c(u){return l.test(u)}return Yh=c,Yh}var Zh,ok;function k8(){if(ok)return Zh;ok=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+r+n,i="\\ufe0e\\ufe0f",o="["+t+"]",l="["+a+"]",c="\\ud83c[\\udffb-\\udfff]",u="(?:"+l+"|"+c+")",d="[^"+t+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",p=u+"?",g="["+i+"]?",m="(?:"+v+"(?:"+[d,f,h].join("|")+")"+g+p+")*",y=g+p+m,b="(?:"+[d+l+"?",l,f,h,o].join("|")+")",w=RegExp(c+"(?="+c+")|"+b+y,"g");function C(x){for(var k=w.lastIndex=0;w.test(x);)++k;return k}return Zh=C,Zh}var Xh,sk;function S8(){if(sk)return Xh;sk=1;var t=E8(),e=x8(),r=k8();function n(a){return e(a)?r(a):t(a)}return Xh=n,Xh}var Jh,lk;function _8(){if(lk)return Jh;lk=1;var t=jd(),e=ci(),r=en(),n=C8(),a=S8(),i="[object Map]",o="[object Set]";function l(c){if(c==null)return 0;if(r(c))return n(c)?a(c):c.length;var u=e(c);return u==i||u==o?c.size:t(c).length}return Jh=l,Jh}var Qh,uk;function T8(){if(uk)return Qh;uk=1;var t=kd(),e=kE(),r=Kf(),n=tn(),a=gl(),i=at(),o=ui(),l=wo(),c=or(),u=So();function d(f,h,v){var p=i(f),g=p||o(f)||u(f);if(h=n(h,4),v==null){var m=f&&f.constructor;g?v=p?new m:[]:c(f)?v=l(m)?e(a(f)):{}:v={}}return(g?t:r)(f,function(y,b,w){return h(v,y,b,w)}),v}return Qh=d,Qh}var ep,ck;function N8(){if(ck)return ep;ck=1;var t=li(),e=Eo(),r=at(),n=t?t.isConcatSpreadable:void 0;function a(i){return r(i)||e(i)||!!(n&&i&&i[n])}return ep=a,ep}var tp,dk;function rp(){if(dk)return tp;dk=1;var t=uf(),e=N8();function r(n,a,i,o,l){var c=-1,u=n.length;for(i||(i=e),l||(l=[]);++c<u;){var d=n[c];a>0&&i(d)?a>1?r(d,a-1,i,o,l):t(l,d):o||(l[l.length]=d)}return l}return tp=r,tp}var np,fk;function I8(){if(fk)return np;fk=1;function t(e,r,n){switch(n.length){case 0:return e.call(r);case 1:return e.call(r,n[0]);case 2:return e.call(r,n[0],n[1]);case 3:return e.call(r,n[0],n[1],n[2])}return e.apply(r,n)}return np=t,np}var ap,hk;function pk(){if(hk)return ap;hk=1;var t=I8(),e=Math.max;function r(n,a,i){return a=e(a===void 0?n.length-1:a,0),function(){for(var o=arguments,l=-1,c=e(o.length-a,0),u=Array(c);++l<c;)u[l]=o[a+l];l=-1;for(var d=Array(a+1);++l<a;)d[l]=o[l];return d[a]=i(u),t(n,this,d)}}return ap=r,ap}var ip,vk;function B8(){if(vk)return ip;vk=1;var t=$f(),e=cC(),r=pa(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:t(i),writable:!0})}:r;return ip=n,ip}var op,gk;function D8(){if(gk)return op;gk=1;var t=800,e=16,r=Date.now;function n(a){var i=0,o=0;return function(){var l=r(),c=e-(l-o);if(o=l,c>0){if(++i>=t)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return op=n,op}var sp,mk;function yk(){if(mk)return sp;mk=1;var t=B8(),e=D8(),r=e(t);return sp=r,sp}var lp,bk;function Cl(){if(bk)return lp;bk=1;var t=pa(),e=pk(),r=yk();function n(a,i){return r(e(a,i,t),a+"")}return lp=n,lp}var up,wk;function Ck(){if(wk)return up;wk=1;function t(e,r,n,a){for(var i=e.length,o=n+(a?1:-1);a?o--:++o<i;)if(r(e[o],o,e))return o;return-1}return up=t,up}var cp,Ek;function O8(){if(Ek)return cp;Ek=1;function t(e){return e!==e}return cp=t,cp}var dp,xk;function P8(){if(xk)return dp;xk=1;function t(e,r,n){for(var a=n-1,i=e.length;++a<i;)if(e[a]===r)return a;return-1}return dp=t,dp}var fp,kk;function A8(){if(kk)return fp;kk=1;var t=Ck(),e=O8(),r=P8();function n(a,i,o){return i===i?r(a,i,o):t(a,e,o)}return fp=n,fp}var hp,Sk;function R8(){if(Sk)return hp;Sk=1;var t=A8();function e(r,n){var a=r==null?0:r.length;return!!a&&t(r,n,0)>-1}return hp=e,hp}var pp,_k;function L8(){if(_k)return pp;_k=1;function t(e,r,n){for(var a=-1,i=e==null?0:e.length;++a<i;)if(n(r,e[a]))return!0;return!1}return pp=t,pp}var vp,Tk;function M8(){if(Tk)return vp;Tk=1;function t(){}return vp=t,vp}var gp,Nk;function F8(){if(Nk)return gp;Nk=1;var t=cE(),e=M8(),r=oh(),n=1/0,a=t&&1/r(new t([,-0]))[1]==n?function(i){return new t(i)}:e;return gp=a,gp}var mp,Ik;function $8(){if(Ik)return mp;Ik=1;var t=XE(),e=R8(),r=L8(),n=ex(),a=F8(),i=oh(),o=200;function l(c,u,d){var f=-1,h=e,v=c.length,p=!0,g=[],m=g;if(d)p=!1,h=r;else if(v>=o){var y=u?null:a(c);if(y)return i(y);p=!1,h=n,m=new t}else m=u?[]:g;e:for(;++f<v;){var b=c[f],w=u?u(b):b;if(b=d||b!==0?b:0,p&&w===w){for(var C=m.length;C--;)if(m[C]===w)continue e;u&&m.push(w),g.push(b)}else h(m,w,d)||(m!==g&&m.push(w),g.push(b))}return g}return mp=l,mp}var yp,Bk;function Dk(){if(Bk)return yp;Bk=1;var t=en(),e=Rr();function r(n){return e(n)&&t(n)}return yp=r,yp}var bp,Ok;function V8(){if(Ok)return bp;Ok=1;var t=rp(),e=Cl(),r=$8(),n=Dk(),a=e(function(i){return r(t(i,1,n,!0))});return bp=a,bp}var wp,Pk;function q8(){if(Pk)return wp;Pk=1;var t=yl();function e(r,n){return t(n,function(a){return r[a]})}return wp=e,wp}var Cp,Ak;function Rk(){if(Ak)return Cp;Ak=1;var t=q8(),e=Dn();function r(n){return n==null?[]:t(n,e(n))}return Cp=r,Cp}var Ep,Lk;function sr(){if(Lk)return Ep;Lk=1;var t;if(typeof Bc=="function")try{t={clone:W4(),constant:$f(),each:UE(),filter:zx(),has:Gx(),isArray:at(),isEmpty:y8(),isFunction:wo(),isUndefined:Wx(),keys:Dn(),map:Jx(),reduce:rk(),size:_8(),transform:T8(),union:V8(),values:Rk()}}catch{}return t||(t=window._),Ep=t,Ep}var xp,Mk;function kp(){if(Mk)return xp;Mk=1;var t=sr();xp=a;var e="\0",r="\0",n="";function a(d){this._isDirected=t.has(d,"directed")?d.directed:!0,this._isMultigraph=t.has(d,"multigraph")?d.multigraph:!1,this._isCompound=t.has(d,"compound")?d.compound:!1,this._label=void 0,this._defaultNodeLabelFn=t.constant(void 0),this._defaultEdgeLabelFn=t.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(d){return this._label=d,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(d){return t.isFunction(d)||(d=t.constant(d)),this._defaultNodeLabelFn=d,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return t.keys(this._nodes)},a.prototype.sources=function(){var d=this;return t.filter(this.nodes(),function(f){return t.isEmpty(d._in[f])})},a.prototype.sinks=function(){var d=this;return t.filter(this.nodes(),function(f){return t.isEmpty(d._out[f])})},a.prototype.setNodes=function(d,f){var h=arguments,v=this;return t.each(d,function(p){h.length>1?v.setNode(p,f):v.setNode(p)}),this},a.prototype.setNode=function(d,f){return t.has(this._nodes,d)?(arguments.length>1&&(this._nodes[d]=f),this):(this._nodes[d]=arguments.length>1?f:this._defaultNodeLabelFn(d),this._isCompound&&(this._parent[d]=r,this._children[d]={},this._children[r][d]=!0),this._in[d]={},this._preds[d]={},this._out[d]={},this._sucs[d]={},++this._nodeCount,this)},a.prototype.node=function(d){return this._nodes[d]},a.prototype.hasNode=function(d){return t.has(this._nodes,d)},a.prototype.removeNode=function(d){var f=this;if(t.has(this._nodes,d)){var h=function(v){f.removeEdge(f._edgeObjs[v])};delete this._nodes[d],this._isCompound&&(this._removeFromParentsChildList(d),delete this._parent[d],t.each(this.children(d),function(v){f.setParent(v)}),delete this._children[d]),t.each(t.keys(this._in[d]),h),delete this._in[d],delete this._preds[d],t.each(t.keys(this._out[d]),h),delete this._out[d],delete this._sucs[d],--this._nodeCount}return this},a.prototype.setParent=function(d,f){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t.isUndefined(f))f=r;else{f+="";for(var h=f;!t.isUndefined(h);h=this.parent(h))if(h===d)throw new Error("Setting "+f+" as parent of "+d+" would create a cycle");this.setNode(f)}return this.setNode(d),this._removeFromParentsChildList(d),this._parent[d]=f,this._children[f][d]=!0,this},a.prototype._removeFromParentsChildList=function(d){delete this._children[this._parent[d]][d]},a.prototype.parent=function(d){if(this._isCompound){var f=this._parent[d];if(f!==r)return f}},a.prototype.children=function(d){if(t.isUndefined(d)&&(d=r),this._isCompound){var f=this._children[d];if(f)return t.keys(f)}else{if(d===r)return this.nodes();if(this.hasNode(d))return[]}},a.prototype.predecessors=function(d){var f=this._preds[d];if(f)return t.keys(f)},a.prototype.successors=function(d){var f=this._sucs[d];if(f)return t.keys(f)},a.prototype.neighbors=function(d){var f=this.predecessors(d);if(f)return t.union(f,this.successors(d))},a.prototype.isLeaf=function(d){var f;return this.isDirected()?f=this.successors(d):f=this.neighbors(d),f.length===0},a.prototype.filterNodes=function(d){var f=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});f.setGraph(this.graph());var h=this;t.each(this._nodes,function(g,m){d(m)&&f.setNode(m,g)}),t.each(this._edgeObjs,function(g){f.hasNode(g.v)&&f.hasNode(g.w)&&f.setEdge(g,h.edge(g))});var v={};function p(g){var m=h.parent(g);return m===void 0||f.hasNode(m)?(v[g]=m,m):m in v?v[m]:p(m)}return this._isCompound&&t.each(f.nodes(),function(g){f.setParent(g,p(g))}),f},a.prototype.setDefaultEdgeLabel=function(d){return t.isFunction(d)||(d=t.constant(d)),this._defaultEdgeLabelFn=d,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return t.values(this._edgeObjs)},a.prototype.setPath=function(d,f){var h=this,v=arguments;return t.reduce(d,function(p,g){return v.length>1?h.setEdge(p,g,f):h.setEdge(p,g),g}),this},a.prototype.setEdge=function(){var d,f,h,v,p=!1,g=arguments[0];typeof g=="object"&&g!==null&&"v"in g?(d=g.v,f=g.w,h=g.name,arguments.length===2&&(v=arguments[1],p=!0)):(d=g,f=arguments[1],h=arguments[3],arguments.length>2&&(v=arguments[2],p=!0)),d=""+d,f=""+f,t.isUndefined(h)||(h=""+h);var m=l(this._isDirected,d,f,h);if(t.has(this._edgeLabels,m))return p&&(this._edgeLabels[m]=v),this;if(!t.isUndefined(h)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(d),this.setNode(f),this._edgeLabels[m]=p?v:this._defaultEdgeLabelFn(d,f,h);var y=c(this._isDirected,d,f,h);return d=y.v,f=y.w,Object.freeze(y),this._edgeObjs[m]=y,i(this._preds[f],d),i(this._sucs[d],f),this._in[f][m]=y,this._out[d][m]=y,this._edgeCount++,this},a.prototype.edge=function(d,f,h){var v=arguments.length===1?u(this._isDirected,arguments[0]):l(this._isDirected,d,f,h);return this._edgeLabels[v]},a.prototype.hasEdge=function(d,f,h){var v=arguments.length===1?u(this._isDirected,arguments[0]):l(this._isDirected,d,f,h);return t.has(this._edgeLabels,v)},a.prototype.removeEdge=function(d,f,h){var v=arguments.length===1?u(this._isDirected,arguments[0]):l(this._isDirected,d,f,h),p=this._edgeObjs[v];return p&&(d=p.v,f=p.w,delete this._edgeLabels[v],delete this._edgeObjs[v],o(this._preds[f],d),o(this._sucs[d],f),delete this._in[f][v],delete this._out[d][v],this._edgeCount--),this},a.prototype.inEdges=function(d,f){var h=this._in[d];if(h){var v=t.values(h);return f?t.filter(v,function(p){return p.v===f}):v}},a.prototype.outEdges=function(d,f){var h=this._out[d];if(h){var v=t.values(h);return f?t.filter(v,function(p){return p.w===f}):v}},a.prototype.nodeEdges=function(d,f){var h=this.inEdges(d,f);if(h)return h.concat(this.outEdges(d,f))};function i(d,f){d[f]?d[f]++:d[f]=1}function o(d,f){--d[f]||delete d[f]}function l(d,f,h,v){var p=""+f,g=""+h;if(!d&&p>g){var m=p;p=g,g=m}return p+n+g+n+(t.isUndefined(v)?e:v)}function c(d,f,h,v){var p=""+f,g=""+h;if(!d&&p>g){var m=p;p=g,g=m}var y={v:p,w:g};return v&&(y.name=v),y}function u(d,f){return l(d,f.v,f.w,f.name)}return xp}var Sp,Fk;function z8(){return Fk||(Fk=1,Sp="2.1.8"),Sp}var _p,$k;function H8(){return $k||($k=1,_p={Graph:kp(),version:z8()}),_p}var Tp,Vk;function K8(){if(Vk)return Tp;Vk=1;var t=sr(),e=kp();Tp={write:r,read:i};function r(o){var l={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:n(o),edges:a(o)};return t.isUndefined(o.graph())||(l.value=t.clone(o.graph())),l}function n(o){return t.map(o.nodes(),function(l){var c=o.node(l),u=o.parent(l),d={v:l};return t.isUndefined(c)||(d.value=c),t.isUndefined(u)||(d.parent=u),d})}function a(o){return t.map(o.edges(),function(l){var c=o.edge(l),u={v:l.v,w:l.w};return t.isUndefined(l.name)||(u.name=l.name),t.isUndefined(c)||(u.value=c),u})}function i(o){var l=new e(o.options).setGraph(o.value);return t.each(o.nodes,function(c){l.setNode(c.v,c.value),c.parent&&l.setParent(c.v,c.parent)}),t.each(o.edges,function(c){l.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),l}return Tp}var Np,qk;function G8(){if(qk)return Np;qk=1;var t=sr();Np=e;function e(r){var n={},a=[],i;function o(l){t.has(n,l)||(n[l]=!0,i.push(l),t.each(r.successors(l),o),t.each(r.predecessors(l),o))}return t.each(r.nodes(),function(l){i=[],o(l),i.length&&a.push(i)}),a}return Np}var Ip,zk;function Hk(){if(zk)return Ip;zk=1;var t=sr();Ip=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(r){return r.key})},e.prototype.has=function(r){return t.has(this._keyIndices,r)},e.prototype.priority=function(r){var n=this._keyIndices[r];if(n!==void 0)return this._arr[n].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(r,n){var a=this._keyIndices;if(r=String(r),!t.has(a,r)){var i=this._arr,o=i.length;return a[r]=o,i.push({key:r,priority:n}),this._decrease(o),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},e.prototype.decrease=function(r,n){var a=this._keyIndices[r];if(n>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[a].priority+" New: "+n);this._arr[a].priority=n,this._decrease(a)},e.prototype._heapify=function(r){var n=this._arr,a=2*r,i=a+1,o=r;a<n.length&&(o=n[a].priority<n[o].priority?a:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==r&&(this._swap(r,o),this._heapify(o)))},e.prototype._decrease=function(r){for(var n=this._arr,a=n[r].priority,i;r!==0&&(i=r>>1,!(n[i].priority<a));)this._swap(r,i),r=i},e.prototype._swap=function(r,n){var a=this._arr,i=this._keyIndices,o=a[r],l=a[n];a[r]=l,a[n]=o,i[l.key]=r,i[o.key]=n},Ip}var Bp,Kk;function Gk(){if(Kk)return Bp;Kk=1;var t=sr(),e=Hk();Bp=n;var r=t.constant(1);function n(i,o,l,c){return a(i,String(o),l||r,c||function(u){return i.outEdges(u)})}function a(i,o,l,c){var u={},d=new e,f,h,v=function(p){var g=p.v!==f?p.v:p.w,m=u[g],y=l(p),b=h.distance+y;if(y<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+y);b<m.distance&&(m.distance=b,m.predecessor=f,d.decrease(g,b))};for(i.nodes().forEach(function(p){var g=p===o?0:Number.POSITIVE_INFINITY;u[p]={distance:g},d.add(p,g)});d.size()>0&&(f=d.removeMin(),h=u[f],h.distance!==Number.POSITIVE_INFINITY);)c(f).forEach(v);return u}return Bp}var Dp,Uk;function U8(){if(Uk)return Dp;Uk=1;var t=Gk(),e=sr();Dp=r;function r(n,a,i){return e.transform(n.nodes(),function(o,l){o[l]=t(n,l,a,i)},{})}return Dp}var Op,jk;function Wk(){if(jk)return Op;jk=1;var t=sr();Op=e;function e(r){var n=0,a=[],i={},o=[];function l(c){var u=i[c]={onStack:!0,lowlink:n,index:n++};if(a.push(c),r.successors(c).forEach(function(h){t.has(i,h)?i[h].onStack&&(u.lowlink=Math.min(u.lowlink,i[h].index)):(l(h),u.lowlink=Math.min(u.lowlink,i[h].lowlink))}),u.lowlink===u.index){var d=[],f;do f=a.pop(),i[f].onStack=!1,d.push(f);while(c!==f);o.push(d)}}return r.nodes().forEach(function(c){t.has(i,c)||l(c)}),o}return Op}var Pp,Yk;function j8(){if(Yk)return Pp;Yk=1;var t=sr(),e=Wk();Pp=r;function r(n){return t.filter(e(n),function(a){return a.length>1||a.length===1&&n.hasEdge(a[0],a[0])})}return Pp}var Ap,Zk;function W8(){if(Zk)return Ap;Zk=1;var t=sr();Ap=r;var e=t.constant(1);function r(a,i,o){return n(a,i||e,o||function(l){return a.outEdges(l)})}function n(a,i,o){var l={},c=a.nodes();return c.forEach(function(u){l[u]={},l[u][u]={distance:0},c.forEach(function(d){u!==d&&(l[u][d]={distance:Number.POSITIVE_INFINITY})}),o(u).forEach(function(d){var f=d.v===u?d.w:d.v,h=i(d);l[u][f]={distance:h,predecessor:u}})}),c.forEach(function(u){var d=l[u];c.forEach(function(f){var h=l[f];c.forEach(function(v){var p=h[u],g=d[v],m=h[v],y=p.distance+g.distance;y<m.distance&&(m.distance=y,m.predecessor=g.predecessor)})})}),l}return Ap}var Rp,Xk;function Jk(){if(Xk)return Rp;Xk=1;var t=sr();Rp=e,e.CycleException=r;function e(n){var a={},i={},o=[];function l(c){if(t.has(i,c))throw new r;t.has(a,c)||(i[c]=!0,a[c]=!0,t.each(n.predecessors(c),l),delete i[c],o.push(c))}if(t.each(n.sinks(),l),t.size(a)!==n.nodeCount())throw new r;return o}function r(){}return r.prototype=new Error,Rp}var Lp,Qk;function Y8(){if(Qk)return Lp;Qk=1;var t=Jk();Lp=e;function e(r){try{t(r)}catch(n){if(n instanceof t.CycleException)return!1;throw n}return!0}return Lp}var Mp,e2;function t2(){if(e2)return Mp;e2=1;var t=sr();Mp=e;function e(n,a,i){t.isArray(a)||(a=[a]);var o=(n.isDirected()?n.successors:n.neighbors).bind(n),l=[],c={};return t.each(a,function(u){if(!n.hasNode(u))throw new Error("Graph does not have node: "+u);r(n,u,i==="post",c,o,l)}),l}function r(n,a,i,o,l,c){t.has(o,a)||(o[a]=!0,i||c.push(a),t.each(l(a),function(u){r(n,u,i,o,l,c)}),i&&c.push(a))}return Mp}var Fp,r2;function Z8(){if(r2)return Fp;r2=1;var t=t2();Fp=e;function e(r,n){return t(r,n,"post")}return Fp}var $p,n2;function X8(){if(n2)return $p;n2=1;var t=t2();$p=e;function e(r,n){return t(r,n,"pre")}return $p}var Vp,a2;function J8(){if(a2)return Vp;a2=1;var t=sr(),e=kp(),r=Hk();Vp=n;function n(a,i){var o=new e,l={},c=new r,u;function d(h){var v=h.v===u?h.w:h.v,p=c.priority(v);if(p!==void 0){var g=i(h);g<p&&(l[v]=u,c.decrease(v,g))}}if(a.nodeCount()===0)return o;t.each(a.nodes(),function(h){c.add(h,Number.POSITIVE_INFINITY),o.setNode(h)}),c.decrease(a.nodes()[0],0);for(var f=!1;c.size()>0;){if(u=c.removeMin(),t.has(l,u))o.setEdge(u,l[u]);else{if(f)throw new Error("Input graph is not connected: "+a);f=!0}a.nodeEdges(u).forEach(d)}return o}return Vp}var qp,i2;function Q8(){return i2||(i2=1,qp={components:G8(),dijkstra:Gk(),dijkstraAll:U8(),findCycles:j8(),floydWarshall:W8(),isAcyclic:Y8(),postorder:Z8(),preorder:X8(),prim:J8(),tarjan:Wk(),topsort:Jk()}),qp}var zp,o2;function e9(){if(o2)return zp;o2=1;var t=H8();return zp={Graph:t.Graph,json:K8(),alg:Q8(),version:t.version},zp}var Hp,s2;function wr(){if(s2)return Hp;s2=1;var t;if(typeof Bc=="function")try{t=e9()}catch{}return t||(t=window.graphlib),Hp=t,Hp}var Kp,l2;function t9(){if(l2)return Kp;l2=1;var t=OE(),e=1,r=4;function n(a){return t(a,e|r)}return Kp=n,Kp}var Gp,u2;function El(){if(u2)return Gp;u2=1;var t=si(),e=en(),r=hl(),n=or();function a(i,o,l){if(!n(l))return!1;var c=typeof o;return(c=="number"?e(l)&&r(o,l.length):c=="string"&&o in l)?t(l[o],i):!1}return Gp=a,Gp}var Up,c2;function r9(){if(c2)return Up;c2=1;var t=Cl(),e=si(),r=El(),n=ha(),a=Object.prototype,i=a.hasOwnProperty,o=t(function(l,c){l=Object(l);var u=-1,d=c.length,f=d>2?c[2]:void 0;for(f&&r(c[0],c[1],f)&&(d=1);++u<d;)for(var h=c[u],v=n(h),p=-1,g=v.length;++p<g;){var m=v[p],y=l[m];(y===void 0||e(y,a[m])&&!i.call(l,m))&&(l[m]=h[m])}return l});return Up=o,Up}var jp,d2;function n9(){if(d2)return jp;d2=1;var t=tn(),e=en(),r=Dn();function n(a){return function(i,o,l){var c=Object(i);if(!e(i)){var u=t(o,3);i=r(i),o=function(f){return u(c[f],f,c)}}var d=a(i,o,l);return d>-1?c[u?i[d]:d]:void 0}}return jp=n,jp}var Wp,f2;function a9(){if(f2)return Wp;f2=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return Wp=e,Wp}var Yp,h2;function i9(){if(h2)return Yp;h2=1;var t=a9(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return Yp=r,Yp}var Zp,p2;function o9(){if(p2)return Zp;p2=1;var t=i9(),e=or(),r=di(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt;function c(u){if(typeof u=="number")return u;if(r(u))return n;if(e(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=e(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=t(u);var f=i.test(u);return f||o.test(u)?l(u.slice(2),f?2:8):a.test(u)?n:+u}return Zp=c,Zp}var Xp,v2;function g2(){if(v2)return Xp;v2=1;var t=o9(),e=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=t(a),a===e||a===-e){var i=a<0?-1:1;return i*r}return a===a?a:0}return Xp=n,Xp}var Jp,m2;function s9(){if(m2)return Jp;m2=1;var t=g2();function e(r){var n=t(r),a=n%1;return n===n?a?n-a:n:0}return Jp=e,Jp}var Qp,y2;function l9(){if(y2)return Qp;y2=1;var t=Ck(),e=tn(),r=s9(),n=Math.max;function a(i,o,l){var c=i==null?0:i.length;if(!c)return-1;var u=l==null?0:r(l);return u<0&&(u=n(c+u,0)),t(i,e(o,3),u)}return Qp=a,Qp}var ev,b2;function u9(){if(b2)return ev;b2=1;var t=n9(),e=l9(),r=t(e);return ev=r,ev}var tv,w2;function C2(){if(w2)return tv;w2=1;var t=rp();function e(r){var n=r==null?0:r.length;return n?t(r,1):[]}return tv=e,tv}var rv,E2;function c9(){if(E2)return rv;E2=1;var t=zf(),e=zE(),r=ha();function n(a,i){return a==null?a:t(a,e(i),r)}return rv=n,rv}var nv,x2;function d9(){if(x2)return nv;x2=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return nv=t,nv}var av,k2;function f9(){if(k2)return av;k2=1;var t=dl(),e=Kf(),r=tn();function n(a,i){var o={};return i=r(i,3),e(a,function(l,c,u){t(o,c,i(l,c,u))}),o}return av=n,av}var iv,S2;function ov(){if(S2)return iv;S2=1;var t=di();function e(r,n,a){for(var i=-1,o=r.length;++i<o;){var l=r[i],c=n(l);if(c!=null&&(u===void 0?c===c&&!t(c):a(c,u)))var u=c,d=l}return d}return iv=e,iv}var sv,_2;function h9(){if(_2)return sv;_2=1;function t(e,r){return e>r}return sv=t,sv}var lv,T2;function p9(){if(T2)return lv;T2=1;var t=ov(),e=h9(),r=pa();function n(a){return a&&a.length?t(a,r,e):void 0}return lv=n,lv}var uv,N2;function I2(){if(N2)return uv;N2=1;var t=dl(),e=si();function r(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&t(n,a,i)}return uv=r,uv}var cv,B2;function v9(){if(B2)return cv;B2=1;var t=da(),e=gl(),r=Rr(),n="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,l=i.hasOwnProperty,c=o.call(Object);function u(d){if(!r(d)||t(d)!=n)return!1;var f=e(d);if(f===null)return!0;var h=l.call(f,"constructor")&&f.constructor;return typeof h=="function"&&h instanceof h&&o.call(h)==c}return cv=u,cv}var dv,D2;function O2(){if(D2)return dv;D2=1;function t(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}return dv=t,dv}var fv,P2;function g9(){if(P2)return fv;P2=1;var t=Co(),e=ha();function r(n){return t(n,e(n))}return fv=r,fv}var hv,A2;function m9(){if(A2)return hv;A2=1;var t=I2(),e=zC(),r=CE(),n=KC(),a=_E(),i=Eo(),o=at(),l=Dk(),c=ui(),u=wo(),d=or(),f=v9(),h=So(),v=O2(),p=g9();function g(m,y,b,w,C,x,k){var E=v(m,b),_=v(y,b),S=k.get(_);if(S){t(m,b,S);return}var T=x?x(E,_,b+"",m,y,k):void 0,N=T===void 0;if(N){var B=o(_),O=!B&&c(_),D=!B&&!O&&h(_);T=_,B||O||D?o(E)?T=E:l(E)?T=n(E):O?(N=!1,T=e(_,!0)):D?(N=!1,T=r(_,!0)):T=[]:f(_)||i(_)?(T=E,i(E)?T=p(E):(!d(E)||u(E))&&(T=a(_))):N=!1}N&&(k.set(_,T),C(T,_,w,x,k),k.delete(_)),t(m,b,T)}return hv=g,hv}var pv,R2;function y9(){if(R2)return pv;R2=1;var t=cl(),e=I2(),r=zf(),n=m9(),a=or(),i=ha(),o=O2();function l(c,u,d,f,h){c!==u&&r(u,function(v,p){if(h||(h=new t),a(v))n(c,u,p,d,l,f,h);else{var g=f?f(o(c,p),v,p+"",c,u,h):void 0;g===void 0&&(g=v),e(c,p,g)}},i)}return pv=l,pv}var vv,L2;function b9(){if(L2)return vv;L2=1;var t=Cl(),e=El();function r(n){return t(function(a,i){var o=-1,l=i.length,c=l>1?i[l-1]:void 0,u=l>2?i[2]:void 0;for(c=n.length>3&&typeof c=="function"?(l--,c):void 0,u&&e(i[0],i[1],u)&&(c=l<3?void 0:c,l=1),a=Object(a);++o<l;){var d=i[o];d&&n(a,d,o,c)}return a})}return vv=r,vv}var gv,M2;function w9(){if(M2)return gv;M2=1;var t=y9(),e=b9(),r=e(function(n,a,i){t(n,a,i)});return gv=r,gv}var mv,F2;function $2(){if(F2)return mv;F2=1;function t(e,r){return e<r}return mv=t,mv}var yv,V2;function C9(){if(V2)return yv;V2=1;var t=ov(),e=$2(),r=pa();function n(a){return a&&a.length?t(a,r,e):void 0}return yv=n,yv}var bv,q2;function E9(){if(q2)return bv;q2=1;var t=ov(),e=tn(),r=$2();function n(a,i){return a&&a.length?t(a,e(i,2),r):void 0}return bv=n,bv}var wv,z2;function x9(){if(z2)return wv;z2=1;var t=br(),e=function(){return t.Date.now()};return wv=e,wv}var Cv,H2;function k9(){if(H2)return Cv;H2=1;var t=fl(),e=bl(),r=hl(),n=or(),a=To();function i(o,l,c,u){if(!n(o))return o;l=e(l,o);for(var d=-1,f=l.length,h=f-1,v=o;v!=null&&++d<f;){var p=a(l[d]),g=c;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(d!=h){var m=v[p];g=u?u(m,p,v):void 0,g===void 0&&(g=n(m)?m:r(l[d+1])?[]:{})}t(v,p,g),v=v[p]}return o}return Cv=i,Cv}var Ev,K2;function S9(){if(K2)return Ev;K2=1;var t=wl(),e=k9(),r=bl();function n(a,i,o){for(var l=-1,c=i.length,u={};++l<c;){var d=i[l],f=t(a,d);o(f,d)&&e(u,r(d,a),f)}return u}return Ev=n,Ev}var xv,G2;function _9(){if(G2)return xv;G2=1;var t=S9(),e=Ax();function r(n,a){return t(n,a,function(i,o){return e(n,o)})}return xv=r,xv}var kv,U2;function T9(){if(U2)return kv;U2=1;var t=C2(),e=pk(),r=yk();function n(a){return r(e(a,void 0,t),a+"")}return kv=n,kv}var Sv,j2;function N9(){if(j2)return Sv;j2=1;var t=_9(),e=T9(),r=e(function(n,a){return n==null?{}:t(n,a)});return Sv=r,Sv}var _v,W2;function I9(){if(W2)return _v;W2=1;var t=Math.ceil,e=Math.max;function r(n,a,i,o){for(var l=-1,c=e(t((a-n)/(i||1)),0),u=Array(c);c--;)u[o?c:++l]=n,n+=i;return u}return _v=r,_v}var Tv,Y2;function B9(){if(Y2)return Tv;Y2=1;var t=I9(),e=El(),r=g2();function n(a){return function(i,o,l){return l&&typeof l!="number"&&e(i,o,l)&&(o=l=void 0),i=r(i),o===void 0?(o=i,i=0):o=r(o),l=l===void 0?i<o?1:-1:r(l),t(i,o,l,a)}}return Tv=n,Tv}var Nv,Z2;function D9(){if(Z2)return Nv;Z2=1;var t=B9(),e=t();return Nv=e,Nv}var Iv,X2;function O9(){if(X2)return Iv;X2=1;function t(e,r){var n=e.length;for(e.sort(r);n--;)e[n]=e[n].value;return e}return Iv=t,Iv}var Bv,J2;function P9(){if(J2)return Bv;J2=1;var t=di();function e(r,n){if(r!==n){var a=r!==void 0,i=r===null,o=r===r,l=t(r),c=n!==void 0,u=n===null,d=n===n,f=t(n);if(!u&&!f&&!l&&r>n||l&&c&&d&&!u&&!f||i&&c&&d||!a&&d||!o)return 1;if(!i&&!l&&!f&&r<n||f&&a&&o&&!i&&!l||u&&a&&o||!c&&o||!d)return-1}return 0}return Bv=e,Bv}var Dv,Q2;function A9(){if(Q2)return Dv;Q2=1;var t=P9();function e(r,n,a){for(var i=-1,o=r.criteria,l=n.criteria,c=o.length,u=a.length;++i<c;){var d=t(o[i],l[i]);if(d){if(i>=u)return d;var f=a[i];return d*(f=="desc"?-1:1)}}return r.index-n.index}return Dv=e,Dv}var Ov,eS;function R9(){if(eS)return Ov;eS=1;var t=yl(),e=wl(),r=tn(),n=Zx(),a=O9(),i=pl(),o=A9(),l=pa(),c=at();function u(d,f,h){f.length?f=t(f,function(g){return c(g)?function(m){return e(m,g.length===1?g[0]:g)}:g}):f=[l];var v=-1;f=t(f,i(r));var p=n(d,function(g,m,y){var b=t(f,function(w){return w(g)});return{criteria:b,index:++v,value:g}});return a(p,function(g,m){return o(g,m,h)})}return Ov=u,Ov}var Pv,tS;function L9(){if(tS)return Pv;tS=1;var t=rp(),e=R9(),r=Cl(),n=El(),a=r(function(i,o){if(i==null)return[];var l=o.length;return l>1&&n(i,o[0],o[1])?o=[]:l>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),e(i,t(o,1),[])});return Pv=a,Pv}var Av,rS;function M9(){if(rS)return Av;rS=1;var t=Sx(),e=0;function r(n){var a=++e;return t(n)+a}return Av=r,Av}var Rv,nS;function F9(){if(nS)return Rv;nS=1;function t(e,r,n){for(var a=-1,i=e.length,o=r.length,l={};++a<i;){var c=a<o?r[a]:void 0;n(l,e[a],c)}return l}return Rv=t,Rv}var Lv,aS;function $9(){if(aS)return Lv;aS=1;var t=fl(),e=F9();function r(n,a){return e(n||[],a||[],t)}return Lv=r,Lv}var Mv,iS;function Ze(){if(iS)return Mv;iS=1;var t;if(typeof Bc=="function")try{t={cloneDeep:t9(),constant:$f(),defaults:r9(),each:UE(),filter:zx(),find:u9(),flatten:C2(),forEach:KE(),forIn:c9(),has:Gx(),isUndefined:Wx(),last:d9(),map:Jx(),mapValues:f9(),max:p9(),merge:w9(),min:C9(),minBy:E9(),now:x9(),pick:N9(),range:D9(),reduce:rk(),sortBy:L9(),uniqueId:M9(),values:Rk(),zipObject:$9()}}catch{}return t||(t=window._),Mv=t,Mv}var Fv,oS;function V9(){if(oS)return Fv;oS=1,Fv=t;function t(){var n={};n._next=n._prev=n,this._sentinel=n}t.prototype.dequeue=function(){var n=this._sentinel,a=n._prev;if(a!==n)return e(a),a},t.prototype.enqueue=function(n){var a=this._sentinel;n._prev&&n._next&&e(n),n._next=a._next,a._next._prev=n,a._next=n,n._prev=a},t.prototype.toString=function(){for(var n=[],a=this._sentinel,i=a._prev;i!==a;)n.push(JSON.stringify(i,r)),i=i._prev;return"["+n.join(", ")+"]"};function e(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function r(n,a){if(n!=="_next"&&n!=="_prev")return a}return Fv}var $v,sS;function q9(){if(sS)return $v;sS=1;var t=Ze(),e=wr().Graph,r=V9();$v=a;var n=t.constant(1);function a(u,d){if(u.nodeCount()<=1)return[];var f=l(u,d||n),h=i(f.graph,f.buckets,f.zeroIdx);return t.flatten(t.map(h,function(v){return u.outEdges(v.v,v.w)}),!0)}function i(u,d,f){for(var h=[],v=d[d.length-1],p=d[0],g;u.nodeCount();){for(;g=p.dequeue();)o(u,d,f,g);for(;g=v.dequeue();)o(u,d,f,g);if(u.nodeCount()){for(var m=d.length-2;m>0;--m)if(g=d[m].dequeue(),g){h=h.concat(o(u,d,f,g,!0));break}}}return h}function o(u,d,f,h,v){var p=v?[]:void 0;return t.forEach(u.inEdges(h.v),function(g){var m=u.edge(g),y=u.node(g.v);v&&p.push({v:g.v,w:g.w}),y.out-=m,c(d,f,y)}),t.forEach(u.outEdges(h.v),function(g){var m=u.edge(g),y=g.w,b=u.node(y);b.in-=m,c(d,f,b)}),u.removeNode(h.v),p}function l(u,d){var f=new e,h=0,v=0;t.forEach(u.nodes(),function(m){f.setNode(m,{v:m,in:0,out:0})}),t.forEach(u.edges(),function(m){var y=f.edge(m.v,m.w)||0,b=d(m),w=y+b;f.setEdge(m.v,m.w,w),v=Math.max(v,f.node(m.v).out+=b),h=Math.max(h,f.node(m.w).in+=b)});var p=t.range(v+h+3).map(function(){return new r}),g=h+1;return t.forEach(f.nodes(),function(m){c(p,g,f.node(m))}),{graph:f,buckets:p,zeroIdx:g}}function c(u,d,f){f.out?f.in?u[f.out-f.in+d].enqueue(f):u[u.length-1].enqueue(f):u[0].enqueue(f)}return $v}var Vv,lS;function z9(){if(lS)return Vv;lS=1;var t=Ze(),e=q9();Vv={run:r,undo:a};function r(i){var o=i.graph().acyclicer==="greedy"?e(i,l(i)):n(i);t.forEach(o,function(c){var u=i.edge(c);i.removeEdge(c),u.forwardName=c.name,u.reversed=!0,i.setEdge(c.w,c.v,u,t.uniqueId("rev"))});function l(c){return function(u){return c.edge(u).weight}}}function n(i){var o=[],l={},c={};function u(d){t.has(c,d)||(c[d]=!0,l[d]=!0,t.forEach(i.outEdges(d),function(f){t.has(l,f.w)?o.push(f):u(f.w)}),delete l[d])}return t.forEach(i.nodes(),u),o}function a(i){t.forEach(i.edges(),function(o){var l=i.edge(o);if(l.reversed){i.removeEdge(o);var c=l.forwardName;delete l.reversed,delete l.forwardName,i.setEdge(o.w,o.v,l,c)}})}return Vv}var qv,uS;function Ut(){if(uS)return qv;uS=1;var t=Ze(),e=wr().Graph;qv={addDummyNode:r,simplify:n,asNonCompoundGraph:a,successorWeights:i,predecessorWeights:o,intersectRect:l,buildLayerMatrix:c,normalizeRanks:u,removeEmptyRanks:d,addBorderNode:f,maxRank:h,partition:v,time:p,notime:g};function r(m,y,b,w){var C;do C=t.uniqueId(w);while(m.hasNode(C));return b.dummy=y,m.setNode(C,b),C}function n(m){var y=new e().setGraph(m.graph());return t.forEach(m.nodes(),function(b){y.setNode(b,m.node(b))}),t.forEach(m.edges(),function(b){var w=y.edge(b.v,b.w)||{weight:0,minlen:1},C=m.edge(b);y.setEdge(b.v,b.w,{weight:w.weight+C.weight,minlen:Math.max(w.minlen,C.minlen)})}),y}function a(m){var y=new e({multigraph:m.isMultigraph()}).setGraph(m.graph());return t.forEach(m.nodes(),function(b){m.children(b).length||y.setNode(b,m.node(b))}),t.forEach(m.edges(),function(b){y.setEdge(b,m.edge(b))}),y}function i(m){var y=t.map(m.nodes(),function(b){var w={};return t.forEach(m.outEdges(b),function(C){w[C.w]=(w[C.w]||0)+m.edge(C).weight}),w});return t.zipObject(m.nodes(),y)}function o(m){var y=t.map(m.nodes(),function(b){var w={};return t.forEach(m.inEdges(b),function(C){w[C.v]=(w[C.v]||0)+m.edge(C).weight}),w});return t.zipObject(m.nodes(),y)}function l(m,y){var b=m.x,w=m.y,C=y.x-b,x=y.y-w,k=m.width/2,E=m.height/2;if(!C&&!x)throw new Error("Not possible to find intersection inside of the rectangle");var _,S;return Math.abs(x)*k>Math.abs(C)*E?(x<0&&(E=-E),_=E*C/x,S=E):(C<0&&(k=-k),_=k,S=k*x/C),{x:b+_,y:w+S}}function c(m){var y=t.map(t.range(h(m)+1),function(){return[]});return t.forEach(m.nodes(),function(b){var w=m.node(b),C=w.rank;t.isUndefined(C)||(y[C][w.order]=b)}),y}function u(m){var y=t.min(t.map(m.nodes(),function(b){return m.node(b).rank}));t.forEach(m.nodes(),function(b){var w=m.node(b);t.has(w,"rank")&&(w.rank-=y)})}function d(m){var y=t.min(t.map(m.nodes(),function(x){return m.node(x).rank})),b=[];t.forEach(m.nodes(),function(x){var k=m.node(x).rank-y;b[k]||(b[k]=[]),b[k].push(x)});var w=0,C=m.graph().nodeRankFactor;t.forEach(b,function(x,k){t.isUndefined(x)&&k%C!==0?--w:w&&t.forEach(x,function(E){m.node(E).rank+=w})})}function f(m,y,b,w){var C={width:0,height:0};return arguments.length>=4&&(C.rank=b,C.order=w),r(m,"border",C,y)}function h(m){return t.max(t.map(m.nodes(),function(y){var b=m.node(y).rank;if(!t.isUndefined(b))return b}))}function v(m,y){var b={lhs:[],rhs:[]};return t.forEach(m,function(w){y(w)?b.lhs.push(w):b.rhs.push(w)}),b}function p(m,y){var b=t.now();try{return y()}finally{console.log(m+" time: "+(t.now()-b)+"ms")}}function g(m,y){return y()}return qv}var zv,cS;function H9(){if(cS)return zv;cS=1;var t=Ze(),e=Ut();zv={run:r,undo:a};function r(i){i.graph().dummyChains=[],t.forEach(i.edges(),function(o){n(i,o)})}function n(i,o){var l=o.v,c=i.node(l).rank,u=o.w,d=i.node(u).rank,f=o.name,h=i.edge(o),v=h.labelRank;if(d!==c+1){i.removeEdge(o);var p,g,m;for(m=0,++c;c<d;++m,++c)h.points=[],g={width:0,height:0,edgeLabel:h,edgeObj:o,rank:c},p=e.addDummyNode(i,"edge",g,"_d"),c===v&&(g.width=h.width,g.height=h.height,g.dummy="edge-label",g.labelpos=h.labelpos),i.setEdge(l,p,{weight:h.weight},f),m===0&&i.graph().dummyChains.push(p),l=p;i.setEdge(l,u,{weight:h.weight},f)}}function a(i){t.forEach(i.graph().dummyChains,function(o){var l=i.node(o),c=l.edgeLabel,u;for(i.setEdge(l.edgeObj,c);l.dummy;)u=i.successors(o)[0],i.removeNode(o),c.points.push({x:l.x,y:l.y}),l.dummy==="edge-label"&&(c.x=l.x,c.y=l.y,c.width=l.width,c.height=l.height),o=u,l=i.node(o)})}return zv}var Hv,dS;function xl(){if(dS)return Hv;dS=1;var t=Ze();Hv={longestPath:e,slack:r};function e(n){var a={};function i(o){var l=n.node(o);if(t.has(a,o))return l.rank;a[o]=!0;var c=t.min(t.map(n.outEdges(o),function(u){return i(u.w)-n.edge(u).minlen}));return(c===Number.POSITIVE_INFINITY||c===void 0||c===null)&&(c=0),l.rank=c}t.forEach(n.sources(),i)}function r(n,a){return n.node(a.w).rank-n.node(a.v).rank-n.edge(a).minlen}return Hv}var Kv,fS;function hS(){if(fS)return Kv;fS=1;var t=Ze(),e=wr().Graph,r=xl().slack;Kv=n;function n(l){var c=new e({directed:!1}),u=l.nodes()[0],d=l.nodeCount();c.setNode(u,{});for(var f,h;a(c,l)<d;)f=i(c,l),h=c.hasNode(f.v)?r(l,f):-r(l,f),o(c,l,h);return c}function a(l,c){function u(d){t.forEach(c.nodeEdges(d),function(f){var h=f.v,v=d===h?f.w:h;!l.hasNode(v)&&!r(c,f)&&(l.setNode(v,{}),l.setEdge(d,v,{}),u(v))})}return t.forEach(l.nodes(),u),l.nodeCount()}function i(l,c){return t.minBy(c.edges(),function(u){if(l.hasNode(u.v)!==l.hasNode(u.w))return r(c,u)})}function o(l,c,u){t.forEach(l.nodes(),function(d){c.node(d).rank+=u})}return Kv}var Gv,pS;function K9(){if(pS)return Gv;pS=1;var t=Ze(),e=hS(),r=xl().slack,n=xl().longestPath,a=wr().alg.preorder,i=wr().alg.postorder,o=Ut().simplify;Gv=l,l.initLowLimValues=f,l.initCutValues=c,l.calcCutValue=d,l.leaveEdge=v,l.enterEdge=p,l.exchangeEdges=g;function l(w){w=o(w),n(w);var C=e(w);f(C),c(C,w);for(var x,k;x=v(C);)k=p(C,w,x),g(C,w,x,k)}function c(w,C){var x=i(w,w.nodes());x=x.slice(0,x.length-1),t.forEach(x,function(k){u(w,C,k)})}function u(w,C,x){var k=w.node(x),E=k.parent;w.edge(x,E).cutvalue=d(w,C,x)}function d(w,C,x){var k=w.node(x),E=k.parent,_=!0,S=C.edge(x,E),T=0;return S||(_=!1,S=C.edge(E,x)),T=S.weight,t.forEach(C.nodeEdges(x),function(N){var B=N.v===x,O=B?N.w:N.v;if(O!==E){var D=B===_,R=C.edge(N).weight;if(T+=D?R:-R,y(w,x,O)){var P=w.edge(x,O).cutvalue;T+=D?-P:P}}}),T}function f(w,C){arguments.length<2&&(C=w.nodes()[0]),h(w,{},1,C)}function h(w,C,x,k,E){var _=x,S=w.node(k);return C[k]=!0,t.forEach(w.neighbors(k),function(T){t.has(C,T)||(x=h(w,C,x,T,k))}),S.low=_,S.lim=x++,E?S.parent=E:delete S.parent,x}function v(w){return t.find(w.edges(),function(C){return w.edge(C).cutvalue<0})}function p(w,C,x){var k=x.v,E=x.w;C.hasEdge(k,E)||(k=x.w,E=x.v);var _=w.node(k),S=w.node(E),T=_,N=!1;_.lim>S.lim&&(T=S,N=!0);var B=t.filter(C.edges(),function(O){return N===b(w,w.node(O.v),T)&&N!==b(w,w.node(O.w),T)});return t.minBy(B,function(O){return r(C,O)})}function g(w,C,x,k){var E=x.v,_=x.w;w.removeEdge(E,_),w.setEdge(k.v,k.w,{}),f(w),c(w,C),m(w,C)}function m(w,C){var x=t.find(w.nodes(),function(E){return!C.node(E).parent}),k=a(w,x);k=k.slice(1),t.forEach(k,function(E){var _=w.node(E).parent,S=C.edge(E,_),T=!1;S||(S=C.edge(_,E),T=!0),C.node(E).rank=C.node(_).rank+(T?S.minlen:-S.minlen)})}function y(w,C,x){return w.hasEdge(C,x)}function b(w,C,x){return x.low<=C.lim&&C.lim<=x.lim}return Gv}var Uv,vS;function G9(){if(vS)return Uv;vS=1;var t=xl(),e=t.longestPath,r=hS(),n=K9();Uv=a;function a(c){switch(c.graph().ranker){case"network-simplex":l(c);break;case"tight-tree":o(c);break;case"longest-path":i(c);break;default:l(c)}}var i=e;function o(c){e(c),r(c)}function l(c){n(c)}return Uv}var jv,gS;function U9(){if(gS)return jv;gS=1;var t=Ze();jv=e;function e(a){var i=n(a);t.forEach(a.graph().dummyChains,function(o){for(var l=a.node(o),c=l.edgeObj,u=r(a,i,c.v,c.w),d=u.path,f=u.lca,h=0,v=d[h],p=!0;o!==c.w;){if(l=a.node(o),p){for(;(v=d[h])!==f&&a.node(v).maxRank<l.rank;)h++;v===f&&(p=!1)}if(!p){for(;h<d.length-1&&a.node(v=d[h+1]).minRank<=l.rank;)h++;v=d[h]}a.setParent(o,v),o=a.successors(o)[0]}})}function r(a,i,o,l){var c=[],u=[],d=Math.min(i[o].low,i[l].low),f=Math.max(i[o].lim,i[l].lim),h,v;h=o;do h=a.parent(h),c.push(h);while(h&&(i[h].low>d||f>i[h].lim));for(v=h,h=l;(h=a.parent(h))!==v;)u.push(h);return{path:c.concat(u.reverse()),lca:v}}function n(a){var i={},o=0;function l(c){var u=o;t.forEach(a.children(c),l),i[c]={low:u,lim:o++}}return t.forEach(a.children(),l),i}return jv}var Wv,mS;function j9(){if(mS)return Wv;mS=1;var t=Ze(),e=Ut();Wv={run:r,cleanup:o};function r(l){var c=e.addDummyNode(l,"root",{},"_root"),u=a(l),d=t.max(t.values(u))-1,f=2*d+1;l.graph().nestingRoot=c,t.forEach(l.edges(),function(v){l.edge(v).minlen*=f});var h=i(l)+1;t.forEach(l.children(),function(v){n(l,c,f,h,d,u,v)}),l.graph().nodeRankFactor=f}function n(l,c,u,d,f,h,v){var p=l.children(v);if(!p.length){v!==c&&l.setEdge(c,v,{weight:0,minlen:u});return}var g=e.addBorderNode(l,"_bt"),m=e.addBorderNode(l,"_bb"),y=l.node(v);l.setParent(g,v),y.borderTop=g,l.setParent(m,v),y.borderBottom=m,t.forEach(p,function(b){n(l,c,u,d,f,h,b);var w=l.node(b),C=w.borderTop?w.borderTop:b,x=w.borderBottom?w.borderBottom:b,k=w.borderTop?d:2*d,E=C!==x?1:f-h[v]+1;l.setEdge(g,C,{weight:k,minlen:E,nestingEdge:!0}),l.setEdge(x,m,{weight:k,minlen:E,nestingEdge:!0})}),l.parent(v)||l.setEdge(c,g,{weight:0,minlen:f+h[v]})}function a(l){var c={};function u(d,f){var h=l.children(d);h&&h.length&&t.forEach(h,function(v){u(v,f+1)}),c[d]=f}return t.forEach(l.children(),function(d){u(d,1)}),c}function i(l){return t.reduce(l.edges(),function(c,u){return c+l.edge(u).weight},0)}function o(l){var c=l.graph();l.removeNode(c.nestingRoot),delete c.nestingRoot,t.forEach(l.edges(),function(u){var d=l.edge(u);d.nestingEdge&&l.removeEdge(u)})}return Wv}var Yv,yS;function W9(){if(yS)return Yv;yS=1;var t=Ze(),e=Ut();Yv=r;function r(a){function i(o){var l=a.children(o),c=a.node(o);if(l.length&&t.forEach(l,i),t.has(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(var u=c.minRank,d=c.maxRank+1;u<d;++u)n(a,"borderLeft","_bl",o,c,u),n(a,"borderRight","_br",o,c,u)}}t.forEach(a.children(),i)}function n(a,i,o,l,c,u){var d={width:0,height:0,rank:u,borderType:i},f=c[i][u-1],h=e.addDummyNode(a,"border",d,o);c[i][u]=h,a.setParent(h,l),f&&a.setEdge(f,h,{weight:1})}return Yv}var Zv,bS;function Y9(){if(bS)return Zv;bS=1;var t=Ze();Zv={adjust:e,undo:r};function e(u){var d=u.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&n(u)}function r(u){var d=u.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&i(u),(d==="lr"||d==="rl")&&(l(u),n(u))}function n(u){t.forEach(u.nodes(),function(d){a(u.node(d))}),t.forEach(u.edges(),function(d){a(u.edge(d))})}function a(u){var d=u.width;u.width=u.height,u.height=d}function i(u){t.forEach(u.nodes(),function(d){o(u.node(d))}),t.forEach(u.edges(),function(d){var f=u.edge(d);t.forEach(f.points,o),t.has(f,"y")&&o(f)})}function o(u){u.y=-u.y}function l(u){t.forEach(u.nodes(),function(d){c(u.node(d))}),t.forEach(u.edges(),function(d){var f=u.edge(d);t.forEach(f.points,c),t.has(f,"x")&&c(f)})}function c(u){var d=u.x;u.x=u.y,u.y=d}return Zv}var Xv,wS;function Z9(){if(wS)return Xv;wS=1;var t=Ze();Xv=e;function e(r){var n={},a=t.filter(r.nodes(),function(u){return!r.children(u).length}),i=t.max(t.map(a,function(u){return r.node(u).rank})),o=t.map(t.range(i+1),function(){return[]});function l(u){if(!t.has(n,u)){n[u]=!0;var d=r.node(u);o[d.rank].push(u),t.forEach(r.successors(u),l)}}var c=t.sortBy(a,function(u){return r.node(u).rank});return t.forEach(c,l),o}return Xv}var Jv,CS;function X9(){if(CS)return Jv;CS=1;var t=Ze();Jv=e;function e(n,a){for(var i=0,o=1;o<a.length;++o)i+=r(n,a[o-1],a[o]);return i}function r(n,a,i){for(var o=t.zipObject(i,t.map(i,function(h,v){return v})),l=t.flatten(t.map(a,function(h){return t.sortBy(t.map(n.outEdges(h),function(v){return{pos:o[v.w],weight:n.edge(v).weight}}),"pos")}),!0),c=1;c<i.length;)c<<=1;var u=2*c-1;c-=1;var d=t.map(new Array(u),function(){return 0}),f=0;return t.forEach(l.forEach(function(h){var v=h.pos+c;d[v]+=h.weight;for(var p=0;v>0;)v%2&&(p+=d[v+1]),v=v-1>>1,d[v]+=h.weight;f+=h.weight*p})),f}return Jv}var Qv,ES;function J9(){if(ES)return Qv;ES=1;var t=Ze();Qv=e;function e(r,n){return t.map(n,function(a){var i=r.inEdges(a);if(i.length){var o=t.reduce(i,function(l,c){var u=r.edge(c),d=r.node(c.v);return{sum:l.sum+u.weight*d.order,weight:l.weight+u.weight}},{sum:0,weight:0});return{v:a,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:a}})}return Qv}var eg,xS;function Q9(){if(xS)return eg;xS=1;var t=Ze();eg=e;function e(a,i){var o={};t.forEach(a,function(c,u){var d=o[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:u};t.isUndefined(c.barycenter)||(d.barycenter=c.barycenter,d.weight=c.weight)}),t.forEach(i.edges(),function(c){var u=o[c.v],d=o[c.w];!t.isUndefined(u)&&!t.isUndefined(d)&&(d.indegree++,u.out.push(o[c.w]))});var l=t.filter(o,function(c){return!c.indegree});return r(l)}function r(a){var i=[];function o(u){return function(d){d.merged||(t.isUndefined(d.barycenter)||t.isUndefined(u.barycenter)||d.barycenter>=u.barycenter)&&n(u,d)}}function l(u){return function(d){d.in.push(u),--d.indegree===0&&a.push(d)}}for(;a.length;){var c=a.pop();i.push(c),t.forEach(c.in.reverse(),o(c)),t.forEach(c.out,l(c))}return t.map(t.filter(i,function(u){return!u.merged}),function(u){return t.pick(u,["vs","i","barycenter","weight"])})}function n(a,i){var o=0,l=0;a.weight&&(o+=a.barycenter*a.weight,l+=a.weight),i.weight&&(o+=i.barycenter*i.weight,l+=i.weight),a.vs=i.vs.concat(a.vs),a.barycenter=o/l,a.weight=l,a.i=Math.min(i.i,a.i),i.merged=!0}return eg}var tg,kS;function e6(){if(kS)return tg;kS=1;var t=Ze(),e=Ut();tg=r;function r(i,o){var l=e.partition(i,function(g){return t.has(g,"barycenter")}),c=l.lhs,u=t.sortBy(l.rhs,function(g){return-g.i}),d=[],f=0,h=0,v=0;c.sort(a(!!o)),v=n(d,u,v),t.forEach(c,function(g){v+=g.vs.length,d.push(g.vs),f+=g.barycenter*g.weight,h+=g.weight,v=n(d,u,v)});var p={vs:t.flatten(d,!0)};return h&&(p.barycenter=f/h,p.weight=h),p}function n(i,o,l){for(var c;o.length&&(c=t.last(o)).i<=l;)o.pop(),i.push(c.vs),l++;return l}function a(i){return function(o,l){return o.barycenter<l.barycenter?-1:o.barycenter>l.barycenter?1:i?l.i-o.i:o.i-l.i}}return tg}var rg,SS;function t6(){if(SS)return rg;SS=1;var t=Ze(),e=J9(),r=Q9(),n=e6();rg=a;function a(l,c,u,d){var f=l.children(c),h=l.node(c),v=h?h.borderLeft:void 0,p=h?h.borderRight:void 0,g={};v&&(f=t.filter(f,function(x){return x!==v&&x!==p}));var m=e(l,f);t.forEach(m,function(x){if(l.children(x.v).length){var k=a(l,x.v,u,d);g[x.v]=k,t.has(k,"barycenter")&&o(x,k)}});var y=r(m,u);i(y,g);var b=n(y,d);if(v&&(b.vs=t.flatten([v,b.vs,p],!0),l.predecessors(v).length)){var w=l.node(l.predecessors(v)[0]),C=l.node(l.predecessors(p)[0]);t.has(b,"barycenter")||(b.barycenter=0,b.weight=0),b.barycenter=(b.barycenter*b.weight+w.order+C.order)/(b.weight+2),b.weight+=2}return b}function i(l,c){t.forEach(l,function(u){u.vs=t.flatten(u.vs.map(function(d){return c[d]?c[d].vs:d}),!0)})}function o(l,c){t.isUndefined(l.barycenter)?(l.barycenter=c.barycenter,l.weight=c.weight):(l.barycenter=(l.barycenter*l.weight+c.barycenter*c.weight)/(l.weight+c.weight),l.weight+=c.weight)}return rg}var ng,_S;function r6(){if(_S)return ng;_S=1;var t=Ze(),e=wr().Graph;ng=r;function r(a,i,o){var l=n(a),c=new e({compound:!0}).setGraph({root:l}).setDefaultNodeLabel(function(u){return a.node(u)});return t.forEach(a.nodes(),function(u){var d=a.node(u),f=a.parent(u);(d.rank===i||d.minRank<=i&&i<=d.maxRank)&&(c.setNode(u),c.setParent(u,f||l),t.forEach(a[o](u),function(h){var v=h.v===u?h.w:h.v,p=c.edge(v,u),g=t.isUndefined(p)?0:p.weight;c.setEdge(v,u,{weight:a.edge(h).weight+g})}),t.has(d,"minRank")&&c.setNode(u,{borderLeft:d.borderLeft[i],borderRight:d.borderRight[i]}))}),c}function n(a){for(var i;a.hasNode(i=t.uniqueId("_root")););return i}return ng}var ag,TS;function n6(){if(TS)return ag;TS=1;var t=Ze();ag=e;function e(r,n,a){var i={},o;t.forEach(a,function(l){for(var c=r.parent(l),u,d;c;){if(u=r.parent(c),u?(d=i[u],i[u]=c):(d=o,o=c),d&&d!==c){n.setEdge(d,c);return}c=u}})}return ag}var ig,NS;function a6(){if(NS)return ig;NS=1;var t=Ze(),e=Z9(),r=X9(),n=t6(),a=r6(),i=n6(),o=wr().Graph,l=Ut();ig=c;function c(h){var v=l.maxRank(h),p=u(h,t.range(1,v+1),"inEdges"),g=u(h,t.range(v-1,-1,-1),"outEdges"),m=e(h);f(h,m);for(var y=Number.POSITIVE_INFINITY,b,w=0,C=0;C<4;++w,++C){d(w%2?p:g,w%4>=2),m=l.buildLayerMatrix(h);var x=r(h,m);x<y&&(C=0,b=t.cloneDeep(m),y=x)}f(h,b)}function u(h,v,p){return t.map(v,function(g){return a(h,g,p)})}function d(h,v){var p=new o;t.forEach(h,function(g){var m=g.graph().root,y=n(g,m,p,v);t.forEach(y.vs,function(b,w){g.node(b).order=w}),i(g,p,y.vs)})}function f(h,v){t.forEach(v,function(p){t.forEach(p,function(g,m){h.node(g).order=m})})}return ig}var og,IS;function i6(){if(IS)return og;IS=1;var t=Ze(),e=wr().Graph,r=Ut();og={positionX:p,findType1Conflicts:n,findType2Conflicts:a,addConflict:o,hasConflict:l,verticalAlignment:c,horizontalCompaction:u,alignCoordinates:h,findSmallestWidthAlignment:f,balance:v};function n(y,b){var w={};function C(x,k){var E=0,_=0,S=x.length,T=t.last(k);return t.forEach(k,function(N,B){var O=i(y,N),D=O?y.node(O).order:S;(O||N===T)&&(t.forEach(k.slice(_,B+1),function(R){t.forEach(y.predecessors(R),function(P){var L=y.node(P),A=L.order;(A<E||D<A)&&!(L.dummy&&y.node(R).dummy)&&o(w,P,R)})}),_=B+1,E=D)}),k}return t.reduce(b,C),w}function a(y,b){var w={};function C(k,E,_,S,T){var N;t.forEach(t.range(E,_),function(B){N=k[B],y.node(N).dummy&&t.forEach(y.predecessors(N),function(O){var D=y.node(O);D.dummy&&(D.order<S||D.order>T)&&o(w,O,N)})})}function x(k,E){var _=-1,S,T=0;return t.forEach(E,function(N,B){if(y.node(N).dummy==="border"){var O=y.predecessors(N);O.length&&(S=y.node(O[0]).order,C(E,T,B,_,S),T=B,_=S)}C(E,T,E.length,S,k.length)}),E}return t.reduce(b,x),w}function i(y,b){if(y.node(b).dummy)return t.find(y.predecessors(b),function(w){return y.node(w).dummy})}function o(y,b,w){if(b>w){var C=b;b=w,w=C}var x=y[b];x||(y[b]=x={}),x[w]=!0}function l(y,b,w){if(b>w){var C=b;b=w,w=C}return t.has(y[b],w)}function c(y,b,w,C){var x={},k={},E={};return t.forEach(b,function(_){t.forEach(_,function(S,T){x[S]=S,k[S]=S,E[S]=T})}),t.forEach(b,function(_){var S=-1;t.forEach(_,function(T){var N=C(T);if(N.length){N=t.sortBy(N,function(P){return E[P]});for(var B=(N.length-1)/2,O=Math.floor(B),D=Math.ceil(B);O<=D;++O){var R=N[O];k[T]===T&&S<E[R]&&!l(w,T,R)&&(k[R]=T,k[T]=x[T]=x[R],S=E[R])}}})}),{root:x,align:k}}function u(y,b,w,C,x){var k={},E=d(y,b,w,x),_=x?"borderLeft":"borderRight";function S(B,O){for(var D=E.nodes(),R=D.pop(),P={};R;)P[R]?B(R):(P[R]=!0,D.push(R),D=D.concat(O(R))),R=D.pop()}function T(B){k[B]=E.inEdges(B).reduce(function(O,D){return Math.max(O,k[D.v]+E.edge(D))},0)}function N(B){var O=E.outEdges(B).reduce(function(R,P){return Math.min(R,k[P.w]-E.edge(P))},Number.POSITIVE_INFINITY),D=y.node(B);O!==Number.POSITIVE_INFINITY&&D.borderType!==_&&(k[B]=Math.max(k[B],O))}return S(T,E.predecessors.bind(E)),S(N,E.successors.bind(E)),t.forEach(C,function(B){k[B]=k[w[B]]}),k}function d(y,b,w,C){var x=new e,k=y.graph(),E=g(k.nodesep,k.edgesep,C);return t.forEach(b,function(_){var S;t.forEach(_,function(T){var N=w[T];if(x.setNode(N),S){var B=w[S],O=x.edge(B,N);x.setEdge(B,N,Math.max(E(y,T,S),O||0))}S=T})}),x}function f(y,b){return t.minBy(t.values(b),function(w){var C=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY;return t.forIn(w,function(k,E){var _=m(y,E)/2;C=Math.max(k+_,C),x=Math.min(k-_,x)}),C-x})}function h(y,b){var w=t.values(b),C=t.min(w),x=t.max(w);t.forEach(["u","d"],function(k){t.forEach(["l","r"],function(E){var _=k+E,S=y[_],T;if(S!==b){var N=t.values(S);T=E==="l"?C-t.min(N):x-t.max(N),T&&(y[_]=t.mapValues(S,function(B){return B+T}))}})})}function v(y,b){return t.mapValues(y.ul,function(w,C){if(b)return y[b.toLowerCase()][C];var x=t.sortBy(t.map(y,C));return(x[1]+x[2])/2})}function p(y){var b=r.buildLayerMatrix(y),w=t.merge(n(y,b),a(y,b)),C={},x;t.forEach(["u","d"],function(E){x=E==="u"?b:t.values(b).reverse(),t.forEach(["l","r"],function(_){_==="r"&&(x=t.map(x,function(B){return t.values(B).reverse()}));var S=(E==="u"?y.predecessors:y.successors).bind(y),T=c(y,x,w,S),N=u(y,x,T.root,T.align,_==="r");_==="r"&&(N=t.mapValues(N,function(B){return-B})),C[E+_]=N})});var k=f(y,C);return h(C,k),v(C,y.graph().align)}function g(y,b,w){return function(C,x,k){var E=C.node(x),_=C.node(k),S=0,T;if(S+=E.width/2,t.has(E,"labelpos"))switch(E.labelpos.toLowerCase()){case"l":T=-E.width/2;break;case"r":T=E.width/2;break}if(T&&(S+=w?T:-T),T=0,S+=(E.dummy?b:y)/2,S+=(_.dummy?b:y)/2,S+=_.width/2,t.has(_,"labelpos"))switch(_.labelpos.toLowerCase()){case"l":T=_.width/2;break;case"r":T=-_.width/2;break}return T&&(S+=w?T:-T),T=0,S}}function m(y,b){return y.node(b).width}return og}var sg,BS;function o6(){if(BS)return sg;BS=1;var t=Ze(),e=Ut(),r=i6().positionX;sg=n;function n(i){i=e.asNonCompoundGraph(i),a(i),t.forEach(r(i),function(o,l){i.node(l).x=o})}function a(i){var o=e.buildLayerMatrix(i),l=i.graph().ranksep,c=0;t.forEach(o,function(u){var d=t.max(t.map(u,function(f){return i.node(f).height}));t.forEach(u,function(f){i.node(f).y=c+d/2}),c+=d+l})}return sg}var lg,DS;function s6(){if(DS)return lg;DS=1;var t=Ze(),e=z9(),r=H9(),n=G9(),a=Ut().normalizeRanks,i=U9(),o=Ut().removeEmptyRanks,l=j9(),c=W9(),u=Y9(),d=a6(),f=o6(),h=Ut(),v=wr().Graph;lg=p;function p(F,$){var V=$&&$.debugTiming?h.time:h.notime;V("layout",function(){var G=V(" buildLayoutGraph",function(){return S(F)});V(" runLayout",function(){g(G,V)}),V(" updateInputGraph",function(){m(F,G)})})}function g(F,$){$(" makeSpaceForEdgeLabels",function(){T(F)}),$(" removeSelfEdges",function(){q(F)}),$(" acyclic",function(){e.run(F)}),$(" nestingGraph.run",function(){l.run(F)}),$(" rank",function(){n(h.asNonCompoundGraph(F))}),$(" injectEdgeLabelProxies",function(){N(F)}),$(" removeEmptyRanks",function(){o(F)}),$(" nestingGraph.cleanup",function(){l.cleanup(F)}),$(" normalizeRanks",function(){a(F)}),$(" assignRankMinMax",function(){B(F)}),$(" removeEdgeLabelProxies",function(){O(F)}),$(" normalize.run",function(){r.run(F)}),$(" parentDummyChains",function(){i(F)}),$(" addBorderSegments",function(){c(F)}),$(" order",function(){d(F)}),$(" insertSelfEdges",function(){U(F)}),$(" adjustCoordinateSystem",function(){u.adjust(F)}),$(" position",function(){f(F)}),$(" positionSelfEdges",function(){z(F)}),$(" removeBorderNodes",function(){A(F)}),$(" normalize.undo",function(){r.undo(F)}),$(" fixupEdgeLabelCoords",function(){P(F)}),$(" undoCoordinateSystem",function(){u.undo(F)}),$(" translateGraph",function(){D(F)}),$(" assignNodeIntersects",function(){R(F)}),$(" reversePoints",function(){L(F)}),$(" acyclic.undo",function(){e.undo(F)})}function m(F,$){t.forEach(F.nodes(),function(V){var G=F.node(V),j=$.node(V);G&&(G.x=j.x,G.y=j.y,$.children(V).length&&(G.width=j.width,G.height=j.height))}),t.forEach(F.edges(),function(V){var G=F.edge(V),j=$.edge(V);G.points=j.points,t.has(j,"x")&&(G.x=j.x,G.y=j.y)}),F.graph().width=$.graph().width,F.graph().height=$.graph().height}var y=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},w=["acyclicer","ranker","rankdir","align"],C=["width","height"],x={width:0,height:0},k=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},_=["labelpos"];function S(F){var $=new v({multigraph:!0,compound:!0}),V=Q(F.graph());return $.setGraph(t.merge({},b,H(V,y),t.pick(V,w))),t.forEach(F.nodes(),function(G){var j=Q(F.node(G));$.setNode(G,t.defaults(H(j,C),x)),$.setParent(G,F.parent(G))}),t.forEach(F.edges(),function(G){var j=Q(F.edge(G));$.setEdge(G,t.merge({},E,H(j,k),t.pick(j,_)))}),$}function T(F){var $=F.graph();$.ranksep/=2,t.forEach(F.edges(),function(V){var G=F.edge(V);G.minlen*=2,G.labelpos.toLowerCase()!=="c"&&($.rankdir==="TB"||$.rankdir==="BT"?G.width+=G.labeloffset:G.height+=G.labeloffset)})}function N(F){t.forEach(F.edges(),function($){var V=F.edge($);if(V.width&&V.height){var G=F.node($.v),j=F.node($.w),M={rank:(j.rank-G.rank)/2+G.rank,e:$};h.addDummyNode(F,"edge-proxy",M,"_ep")}})}function B(F){var $=0;t.forEach(F.nodes(),function(V){var G=F.node(V);G.borderTop&&(G.minRank=F.node(G.borderTop).rank,G.maxRank=F.node(G.borderBottom).rank,$=t.max($,G.maxRank))}),F.graph().maxRank=$}function O(F){t.forEach(F.nodes(),function($){var V=F.node($);V.dummy==="edge-proxy"&&(F.edge(V.e).labelRank=V.rank,F.removeNode($))})}function D(F){var $=Number.POSITIVE_INFINITY,V=0,G=Number.POSITIVE_INFINITY,j=0,M=F.graph(),W=M.marginx||0,Y=M.marginy||0;function se(ce){var ae=ce.x,ne=ce.y,ue=ce.width,ie=ce.height;$=Math.min($,ae-ue/2),V=Math.max(V,ae+ue/2),G=Math.min(G,ne-ie/2),j=Math.max(j,ne+ie/2)}t.forEach(F.nodes(),function(ce){se(F.node(ce))}),t.forEach(F.edges(),function(ce){var ae=F.edge(ce);t.has(ae,"x")&&se(ae)}),$-=W,G-=Y,t.forEach(F.nodes(),function(ce){var ae=F.node(ce);ae.x-=$,ae.y-=G}),t.forEach(F.edges(),function(ce){var ae=F.edge(ce);t.forEach(ae.points,function(ne){ne.x-=$,ne.y-=G}),t.has(ae,"x")&&(ae.x-=$),t.has(ae,"y")&&(ae.y-=G)}),M.width=V-$+W,M.height=j-G+Y}function R(F){t.forEach(F.edges(),function($){var V=F.edge($),G=F.node($.v),j=F.node($.w),M,W;V.points?(M=V.points[0],W=V.points[V.points.length-1]):(V.points=[],M=j,W=G),V.points.unshift(h.intersectRect(G,M)),V.points.push(h.intersectRect(j,W))})}function P(F){t.forEach(F.edges(),function($){var V=F.edge($);if(t.has(V,"x"))switch((V.labelpos==="l"||V.labelpos==="r")&&(V.width-=V.labeloffset),V.labelpos){case"l":V.x-=V.width/2+V.labeloffset;break;case"r":V.x+=V.width/2+V.labeloffset;break}})}function L(F){t.forEach(F.edges(),function($){var V=F.edge($);V.reversed&&V.points.reverse()})}function A(F){t.forEach(F.nodes(),function($){if(F.children($).length){var V=F.node($),G=F.node(V.borderTop),j=F.node(V.borderBottom),M=F.node(t.last(V.borderLeft)),W=F.node(t.last(V.borderRight));V.width=Math.abs(W.x-M.x),V.height=Math.abs(j.y-G.y),V.x=M.x+V.width/2,V.y=G.y+V.height/2}}),t.forEach(F.nodes(),function($){F.node($).dummy==="border"&&F.removeNode($)})}function q(F){t.forEach(F.edges(),function($){if($.v===$.w){var V=F.node($.v);V.selfEdges||(V.selfEdges=[]),V.selfEdges.push({e:$,label:F.edge($)}),F.removeEdge($)}})}function U(F){var $=h.buildLayerMatrix(F);t.forEach($,function(V){var G=0;t.forEach(V,function(j,M){var W=F.node(j);W.order=M+G,t.forEach(W.selfEdges,function(Y){h.addDummyNode(F,"selfedge",{width:Y.label.width,height:Y.label.height,rank:W.rank,order:M+ ++G,e:Y.e,label:Y.label},"_se")}),delete W.selfEdges})})}function z(F){t.forEach(F.nodes(),function($){var V=F.node($);if(V.dummy==="selfedge"){var G=F.node(V.e.v),j=G.x+G.width/2,M=G.y,W=V.x-j,Y=G.height/2;F.setEdge(V.e,V.label),F.removeNode($),V.label.points=[{x:j+2*W/3,y:M-Y},{x:j+5*W/6,y:M-Y},{x:j+W,y:M},{x:j+5*W/6,y:M+Y},{x:j+2*W/3,y:M+Y}],V.label.x=V.x,V.label.y=V.y}})}function H(F,$){return t.mapValues(t.pick(F,$),Number)}function Q(F){var $={};return t.forEach(F,function(V,G){$[G.toLowerCase()]=V}),$}return lg}var ug,OS;function l6(){if(OS)return ug;OS=1;var t=Ze(),e=Ut(),r=wr().Graph;ug={debugOrdering:n};function n(a){var i=e.buildLayerMatrix(a),o=new r({compound:!0,multigraph:!0}).setGraph({});return t.forEach(a.nodes(),function(l){o.setNode(l,{label:l}),o.setParent(l,"layer"+a.node(l).rank)}),t.forEach(a.edges(),function(l){o.setEdge(l.v,l.w,{},l.name)}),t.forEach(i,function(l,c){var u="layer"+c;o.setNode(u,{rank:"same"}),t.reduce(l,function(d,f){return o.setEdge(d,f,{style:"invis"}),f})}),o}return ug}var cg,PS;function u6(){return PS||(PS=1,cg="0.8.5"),cg}var dg,AS;function c6(){return AS||(AS=1,dg={graphlib:wr(),layout:s6(),debug:l6(),util:{time:Ut().time,notime:Ut().notime},version:u6()}),dg}(function(t,e){(function(n,a){t.exports=a(c6())})(Ai,function(r){return function(n){var a={};function i(o){if(a[o])return a[o].exports;var l=a[o]={i:o,l:!1,exports:{}};return n[o].call(l.exports,l,l.exports,i),l.l=!0,l.exports}return i.m=n,i.c=a,i.d=function(o,l,c){i.o(o,l)||Object.defineProperty(o,l,{enumerable:!0,get:c})},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,l){if(l&1&&(o=i(o)),l&8||l&4&&typeof o=="object"&&o&&o.__esModule)return o;var c=Object.create(null);if(i.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:o}),l&2&&typeof o!="string")for(var u in o)i.d(c,u,(function(d){return o[d]}).bind(null,u));return c},i.n=function(o){var l=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(l,"a",l),l},i.o=function(o,l){return Object.prototype.hasOwnProperty.call(o,l)},i.p="",i(i.s=0)}([function(n,a,i){var o=i(1),l=function(u){u&&u("layout","dagre",o)};typeof cytoscape<"u"&&l(cytoscape),n.exports=l},function(n,a,i){function o(h){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(p){return typeof p}:o=function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},o(h)}var l=function(v){return typeof v=="function"},c=i(2),u=i(3),d=i(4);function f(h){this.options=u({},c,h)}f.prototype.run=function(){var h=this.options,v=this,p=h.cy,g=h.eles,m=function(z,H){return l(H)?H.apply(z,[z]):H},y=h.boundingBox||{x1:0,y1:0,w:p.width(),h:p.height()};y.x2===void 0&&(y.x2=y.x1+y.w),y.w===void 0&&(y.w=y.x2-y.x1),y.y2===void 0&&(y.y2=y.y1+y.h),y.h===void 0&&(y.h=y.y2-y.y1);var b=new d.graphlib.Graph({multigraph:!0,compound:!0}),w={},C=function(z,H){H!=null&&(w[z]=H)};C("nodesep",h.nodeSep),C("edgesep",h.edgeSep),C("ranksep",h.rankSep),C("rankdir",h.rankDir),C("align",h.align),C("ranker",h.ranker),C("acyclicer",h.acyclicer),b.setGraph(w),b.setDefaultEdgeLabel(function(){return{}}),b.setDefaultNodeLabel(function(){return{}});var x=g.nodes();l(h.sort)&&(x=x.sort(h.sort));for(var k=0;k<x.length;k++){var E=x[k],_=E.layoutDimensions(h);b.setNode(E.id(),{width:_.w,height:_.h,name:E.id()})}for(var S=0;S<x.length;S++){var T=x[S];T.isChild()&&b.setParent(T.id(),T.parent().id())}var N=g.edges().stdFilter(function(U){return!U.source().isParent()&&!U.target().isParent()});l(h.sort)&&(N=N.sort(h.sort));for(var B=0;B<N.length;B++){var O=N[B];b.setEdge(O.source().id(),O.target().id(),{minlen:m(O,h.minLen),weight:m(O,h.edgeWeight),name:O.id()},O.id())}d.layout(b);for(var D=b.nodes(),R=0;R<D.length;R++){var P=D[R],L=b.node(P);p.getElementById(P).scratch().dagre=L}var A;h.boundingBox?(A={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},x.forEach(function(U){var z=U.scratch().dagre;A.x1=Math.min(A.x1,z.x),A.x2=Math.max(A.x2,z.x),A.y1=Math.min(A.y1,z.y),A.y2=Math.max(A.y2,z.y)}),A.w=A.x2-A.x1,A.h=A.y2-A.y1):A=y;var q=function(z){if(h.boundingBox){var H=A.w===0?0:(z.x-A.x1)/A.w,Q=A.h===0?0:(z.y-A.y1)/A.h;return{x:y.x1+H*y.w,y:y.y1+Q*y.h}}else return z};return x.layoutPositions(v,h,function(U){U=o(U)==="object"?U:this;var z=U.scratch().dagre;return q({x:z.x,y:z.y})}),this},n.exports=f},function(n,a){var i={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(l){return 1},edgeWeight:function(l){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(l,c){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(l,c){return c},ready:function(){},sort:void 0,stop:function(){}};n.exports=i},function(n,a){n.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var o=arguments.length,l=new Array(o>1?o-1:0),c=1;c<o;c++)l[c-1]=arguments[c];return l.forEach(function(u){Object.keys(u).forEach(function(d){return i[d]=u[d]})}),i}},function(n,a){n.exports=r}])})})(vw);var d6=vw.exports;const f6=IA(d6);Bn.use(f6);const RS=function(t,e){if(!t||!e)return!1;let r=JSON.stringify(t),n=JSON.stringify(e);return r.indexOf(n)!==-1},h6=function(t){return t?[...new Set(t.map(e=>JSON.stringify(e)))].map(e=>JSON.parse(e)):[]},p6=function(t,e,r){let n=t.connectivity.flat(),a=h6(n),i=[],o=!1;return a.forEach(l=>{o=!1,RS(e,l)&&(o=!0),RS(r,l)&&(o=!0),o||i.push(l)}),i};let v6=class extends EventTarget{constructor(r,n){super();cr(this,"cyg",null);cr(this,"nodes",[]);cr(this,"edges",[]);cr(this,"axons",[]);cr(this,"dendrites",[]);cr(this,"somas",[]);cr(this,"labelCache",new Map);cr(this,"graphCanvas",null);cr(this,"hasPhenotypes",!1);this.labelCache=r,this.graphCanvas=n}async addConnectivity(r){var n;if(r&&r["node-phenotypes"]){const a=["ilxtr:hasSomaLocatedIn"],i=["ilxtr:hasAxonPresynapticElementIn","ilxtr:hasAxonSensorySubcellularElementIn"],o=[],l=[];a.forEach(u=>{o.push(...r["node-phenotypes"][u])}),i.forEach(u=>{l.push(...r["node-phenotypes"][u])});const c=p6(r,o,l);this.dendrites=o.map(u=>JSON.stringify(u)),this.axons=l.map(u=>JSON.stringify(u)),c!=null&&c.length&&(this.somas=c.map(u=>JSON.stringify(u))),this.hasPhenotypes=!0}else 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))),this.hasPhenotypes=!1;if(r.connectivity.length)for(const a of r.connectivity){const i=await this.graphNode(a[0]),o=await this.graphNode(a[1]);this.nodes.push(i),this.nodes.push(o),this.edges.push({id:`${i.id}_${o.id}`,source:i.id,target:o.id})}else this.nodes.push({id:"MISSING",label:"NO PATHS"})}showConnectivity(r){this.cyg=new b6(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 o=i.data("label"),l=fg(o);y6(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(),o=this.cyg.cy.height(),l={x:i/2,y:o/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.hasPhenotypes?[...this.dendrites]:[...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 o={id:n,label:a.join(`
45
- `)};return this.hasPhenotypes?this.axons.includes(n)?o.axon=!0:this.dendrites.includes(n)?o.dendrite=!0:o.somas=!0:this.axons.includes(n)?this.dendrites.includes(n)||this.somas.includes(n)?o.somas=!0:o.axon=!0:(this.dendrites.includes(n)||this.somas.includes(n))&&(o.dendrite=!0),o}on(r,n){this.addEventListener(r,n)}};const g6=[{selector:"node",style:{label:function(t){return m6(t.data("label"))},"background-color":"transparent","background-opacity":"0","text-valign":"center","text-wrap":"wrap",width:"80px",height:"80px","text-max-width":"80px","font-size":"6px",shape:"round-rectangle","border-width":1,"border-style":"solid","border-color":"gray"}},{selector:"node[axon]",style:{shape:"round-diamond",width:"100px",height:"100px"}},{selector:"node[dendrite]",style:{shape:"ellipse"}},{selector:"node[somas]",style:{shape:"round-rectangle"}},{selector:"edge",style:{width:1,"line-color":"dimgray","curve-style":"bezier"}},{selector:"node.active",style:{"border-color":"#8300bf","background-color":"#f3ecf6","background-opacity":.75}}];function m6(t){const e=t.split(`
46
- `),r=e.length/2,n=e.slice(r);return LS(n.join(`
47
- `))}function LS(t){return t.split(`
41
+ */var n1=function(e,r){this.recycle(e,r)};function co(){return!1}function Fs(){return!0}n1.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=co,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Fs:co):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=Fs;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Fs;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Fs,this.stopPropagation()},isDefaultPrevented:co,isPropagationStopped:co,isImmediatePropagationStopped:co};var a1=/^([^.]+)(\.(?:[^.]+))?$/,pz=".*",i1={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},o1=Object.keys(i1),vz={};function Ms(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:vz,e=arguments.length>1?arguments[1]:void 0,r=0;r<o1.length;r++){var n=o1[r];this[n]=t[n]||i1[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Tn=Ms.prototype,s1=function(e,r,n,a,i,o,l){Xe(a)&&(i=a,a=null),l&&(o==null?o=l:o=Se({},o,l));for(var c=Ke(n)?n:n.split(/\s+/),u=0;u<c.length;u++){var d=c[u];if(!mn(d)){var f=d.match(a1);if(f){var h=f[1],v=f[2]?f[2]:null,p=r(e,d,h,v,a,i,o);if(p===!1)break}}}},l1=function(e,r){return e.addEventFields(e.context,r),new n1(r.type,r)},gz=function(e,r,n){if(LF(n)){r(e,n);return}else if(Ae(n)){r(e,l1(e,n));return}for(var a=Ke(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var o=a[i];if(!mn(o)){var l=o.match(a1);if(l){var c=l[1],u=l[2]?l[2]:null,d=l1(e,{type:c,namespace:u,target:e.context});r(e,d)}}}};Tn.on=Tn.addListener=function(t,e,r,n,a){return s1(this,function(i,o,l,c,u,d,f){Xe(d)&&i.listeners.push({event:o,callback:d,type:l,namespace:c,qualifier:u,conf:f})},t,e,r,n,a),this},Tn.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})},Tn.removeListener=Tn.off=function(t,e,r,n){var a=this;this.emitting!==0&&(this.listeners=GM(this.listeners));for(var i=this.listeners,o=function(u){var d=i[u];s1(a,function(f,h,v,p,g,y){if((d.type===v||t==="*")&&(!p&&d.namespace!==".*"||d.namespace===p)&&(!g||f.qualifierCompare(d.qualifier,g))&&(!y||d.callback===y))return i.splice(u,1),!1},t,e,r,n)},l=i.length-1;l>=0;l--)o(l);return this},Tn.removeAllListeners=function(){return this.removeListener("*")},Tn.emit=Tn.trigger=function(t,e,r){var n=this.listeners,a=n.length;return this.emitting++,Ke(e)||(e=[e]),gz(this,function(i,o){r!=null&&(n=[{event:o.event,type:o.type,namespace:o.namespace,callback:r}],a=n.length);for(var l=function(d){var f=n[d];if(f.type===o.type&&(!f.namespace||f.namespace===o.namespace||f.namespace===pz)&&i.eventMatches(i.context,f,o)){var h=[o];e!=null&&jM(h,e),i.beforeEmit(i.context,f,o),f.conf&&f.conf.one&&(i.listeners=i.listeners.filter(function(g){return g!==f}));var v=i.callbackContext(i.context,f,o),p=f.callback.apply(v,h);i.afterEmit(i.context,f,o),p===!1&&(o.stopPropagation(),o.preventDefault())}},c=0;c<a;c++)l(c);i.bubble(i.context)&&!o.isPropagationStopped()&&i.parent(i.context).emit(o,e)},t),this.emitting--,this};var mz={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&&Ki(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()}},$s=function(e){return Ee(e)?new xn(e):e},u1={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],n=r._private;n.emitter||(n.emitter=new Ms(mz,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,n){for(var a=$s(r),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,a,n)}return this},removeListener:function(e,r,n){for(var a=$s(r),i=0;i<this.length;i++){var o=this[i];o.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=$s(r),i=0;i<this.length;i++){var o=this[i];o.emitter().one(e,a,n)}return this},once:function(e,r,n){for(var a=$s(r),i=0;i<this.length;i++){var o=this[i];o.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(u1);var c1={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(Ee(e)||Zt(e))return new xn(e).filter(this);if(Xe(e)){for(var n=this.spawn(),a=this,i=0;i<a.length;i++){var o=a[i],l=r?e.apply(r,[o,i,a]):e(o,i,a);l&&n.push(o)}return n}return this.spawn()},not:function(e){if(e){Ee(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(Ee(e)){var r=e;return this.filter(r)}for(var n=this.spawn(),a=this,i=e,o=this.length<e.length,l=o?a:i,c=o?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;Ee(e)&&(e=r.$(e));var n=this.spawn(),a=this,i=e,o=function(c,u){for(var d=0;d<c.length;d++){var f=c[d],h=f._private.data.id,v=u.hasElementWithId(h);v||n.push(f)}};return o(a,i),o(i,a),n},diff:function(e){var r=this._private.cy;Ee(e)&&(e=r.$(e));var n=this.spawn(),a=this.spawn(),i=this.spawn(),o=this,l=e,c=function(d,f,h){for(var v=0;v<d.length;v++){var p=d[v],g=p._private.data.id,y=f.hasElementWithId(g);y?i.merge(p):h.push(p)}};return c(o,l,n),c(l,o,a),{left:n,right:a,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(Ee(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],l=!this.has(o);l&&a.push(o)}return a},merge:function(e){var r=this._private,n=r.cy;if(!e)return this;if(e&&Ee(e)){var a=e;e=n.mutableElements().filter(a)}for(var i=r.map,o=0;o<e.length;o++){var l=e[o],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 o=e===this.length-1;if(this.length>1&&!o){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 o=i.index;return this.unmergeAt(o),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Ee(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 o=a[i],l=r?e.apply(r,[o,i,a]):e(o,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,o=0;o<i.length;o++){var l=i[o],c=r?e.apply(r,[l,o,i]):e(l,o,i);c>n&&(n=c,a=l)}return{value:n,ele:a}},min:function(e,r){for(var n=1/0,a,i=this,o=0;o<i.length;o++){var l=i[o],c=r?e.apply(r,[l,o,i]):e(l,o,i);c<n&&(n=c,a=l)}return{value:n,ele:a}}},Le=c1;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 yz={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}},d1=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"?$u:0}var o=i(e)-i(r);if(o!==0)return o;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()},Vs={forEach:function(e,r){if(Xe(e))for(var n=this.length,a=0;a<n;a++){var i=this[a],o=r?e.apply(r,[i,a,this]):e(i,a,this);if(o===!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(!Xe(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(d1)},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:$u-1}else{var i=r.source,o=r.target,l=i.zDepth(),c=o.zDepth();return Math.max(l,c,0)}}}};Vs.each=Vs.forEach;var bz=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":ht(Symbol))!=e&&ht(Symbol.iterator)!=e;r&&(Vs[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,o=this.length;return k0({next:function(){return i<o?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};bz();var wz=St({nodeDimensionsIncludeLabels:!1}),qs={layoutDimensions:function(e){e=wz(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(),o=r.eles,l=function(k){return k.id()},c=Gi(n,l);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(k,E,_){var S={x:E.x1+E.w/2,y:E.y1+E.h/2},T={x:(_.x-S.x)*k,y:(_.y-S.y)*k};return{x:S.x+T.x,y:S.y+T.y}},d=r.spacingFactor&&r.spacingFactor!==1,f=function(){if(!d)return null;for(var k=Kt(),E=0;E<a.length;E++){var _=a[E],S=c(_,E);C5(k,S.x,S.y)}return k},h=f(),v=Gi(function(x,k){var E=c(x,k);if(d){var _=Math.abs(r.spacingFactor);E=u(_,h,E)}return r.transform!=null&&(E=r.transform(x,E)),E},l);if(r.animate){for(var p=0;p<a.length;p++){var g=a[p],y=v(g,p),m=r.animateFilter==null||r.animateFilter(g,p);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:o.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}),Ua.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(Se({},e,{eles:this}))}};qs.createLayout=qs.makeLayout=qs.layout;function f1(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 zs(t,e){return t=Xn(t),function(n){return f1(t,e,n)}}function Hs(t,e){t=Xn(t);var r=function(a){return e.call(a)};return function(){var a=this[0];if(a)return f1(t,r,a)}}var _t={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 o=i;return e?o.emitAndNotify("style"):o.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(Ae(e)){var o=e;i.applyBypass(this,o,a),this.emitAndNotify("style")}else if(Ee(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 o=0;o<i.length;o++){var l=i[o];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 o=a.data.parent?n.parents():null;if(o)for(var l=0;l<o.length;l++){var c=o[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 uc(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 cc(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],o=a.hasCompoundNodes();if(i){var l=i._private;if(!e(i))return!1;if(i.isNode())return!o||uc(i,n);var c=l.source,u=l.target;return r(c)&&(!o||uc(c,r))&&(c===u||r(u)&&(!o||uc(u,r)))}}}var ei=zs("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});_t.takesUpSpace=Hs("takesUpSpace",cc({ok:ei}));var Cz=zs("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&ei(t)}),Ez=zs("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&ei(t)});_t.interactive=Hs("interactive",cc({ok:Cz,parentOk:Ez,edgeOkViaNode:ei})),_t.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var xz=zs("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&ei(t)}),kz=ei;_t.visible=Hs("visible",cc({ok:xz,edgeOkViaNode:kz})),_t.hidden=function(){var t=this[0];if(t)return!t.visible()},_t.isBundledBezier=Hs("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),_t.bypass=_t.css=_t.style,_t.renderedCss=_t.renderedStyle,_t.removeBypass=_t.removeCss=_t.removeStyle,_t.pstyle=_t.parsedStyle;var Nn={};function h1(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&&Xe(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&Ke(e[0])){for(var o=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 h=this.spawn(r);h.updateStyle(),h.emit(t.event),o&&h.emit(o)}return this}}function ti(t){Nn[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]}},Nn[t.on]=h1({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Nn[t.off]=h1({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}ti({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),ti({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),ti({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),ti({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),Nn.deselect=Nn.unselect,Nn.grabbed=function(){var t=this[0];if(t)return t._private.grabbed},ti({field:"active",on:"activate",off:"unactivate"}),ti({field:"pannable",on:"panify",off:"unpanify"}),Nn.inactive=function(){var t=this[0];if(t)return!t._private.active};var Bt={},p1=function(e){return function(n){for(var a=this,i=[],o=0;o<a.length;o++){var l=a[o];if(l.isNode()){for(var c=!1,u=l.connectedEdges(),d=0;d<u.length;d++){var f=u[d],h=f.source(),v=f.target();if(e.noIncomingEdges&&v===l&&h!==l||e.noOutgoingEdges&&h===l&&v!==l){c=!0;break}}c||i.push(l)}}return this.spawn(i,!0).filter(n)}},v1=function(e){return function(r){for(var n=this,a=[],i=0;i<n.length;i++){var o=n[i];if(o.isNode())for(var l=o.connectedEdges(),c=0;c<l.length;c++){var u=l[c],d=u.source(),f=u.target();e.outgoing&&d===o?(a.push(u),a.push(f)):e.incoming&&f===o&&(a.push(u),a.push(d))}}return this.spawn(a,!0).filter(r)}},g1=function(e){return function(r){for(var n=this,a=[],i={};;){var o=e.outgoing?n.outgoers():n.incomers();if(o.length===0)break;for(var l=!1,c=0;c<o.length;c++){var u=o[c],d=u.id();i[d]||(i[d]=!0,a.push(u),l=!0)}if(!l)break;n=o}return this.spawn(a,!0).filter(r)}};Bt.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null},Se(Bt,{roots:p1({noIncomingEdges:!0}),leaves:p1({noOutgoingEdges:!0}),outgoers:nr(v1({outgoing:!0}),"outgoers"),successors:g1({outgoing:!0}),incomers:nr(v1({incoming:!0}),"incomers"),predecessors:g1({incoming:!0})}),Se(Bt,{neighborhood:nr(function(t){for(var e=[],r=this.nodes(),n=0;n<r.length;n++)for(var a=r[n],i=a.connectedEdges(),o=0;o<i.length;o++){var l=i[o],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)}}),Bt.neighbourhood=Bt.neighborhood,Bt.closedNeighbourhood=Bt.closedNeighborhood,Bt.openNeighbourhood=Bt.openNeighborhood,Se(Bt,{source:nr(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:nr(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:m1({attr:"source"}),targets:m1({attr:"target"})});function m1(t){return function(r){for(var n=[],a=0;a<this.length;a++){var i=this[a],o=i._private[t.attr];o&&n.push(o)}return this.spawn(n,!0).filter(r)}}Se(Bt,{edgesWith:nr(y1(),"edgesWith"),edgesTo:nr(y1({thisIsSrc:!0}),"edgesTo")});function y1(t){return function(r){var n=[],a=this._private.cy,i=t||{};Ee(r)&&(r=a.$(r));for(var o=0;o<r.length;o++)for(var l=r[o]._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),h=r.hasElementWithId(d.source)&&this.hasElementWithId(d.target),v=f||h;v&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!f||i.thisIsTgt&&!h)||n.push(u))}return this.spawn(n,!0)}}Se(Bt,{connectedEdges:nr(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,o=0;o<i.length;o++){var l=i[o];e.push(l)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:nr(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:nr(b1(),"parallelEdges"),codirectedEdges:nr(b1({codirected:!0}),"codirectedEdges")});function b1(t){var e={codirected:!1};return t=Se({},e,t),function(n){for(var a=[],i=this.edges(),o=t,l=0;l<i.length;l++)for(var c=i[l],u=c._private,d=u.source,f=d._private.data.id,h=u.data.target,v=d._private.edges,p=0;p<v.length;p++){var g=v[p],y=g._private.data,m=y.target,b=y.source,w=m===h&&b===f,C=f===m&&h===b;(o.codirected&&w||!o.codirected&&(w||C))&&a.push(g)}return this.spawn(a,!0).filter(n)}}Se(Bt,{components:function(e){var r=this,n=r.cy(),a=n.collection(),i=e==null?r.nodes():e.nodes(),o=[];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();o.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(h){h.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 o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Bt.componentsOf=Bt.components;var Tt=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){Je("A collection must have a reference to the core");return}var i=new Ir,o=!1;if(!r)r=[];else if(r.length>0&&Ae(r[0])&&!Ki(r[0])){o=!0;for(var l=[],c=new $a,u=0,d=r.length;u<d;u++){var f=r[u];f.data==null&&(f.data={});var h=f.data;if(h.id==null)h.id=Z0();else if(e.hasElementWithId(h.id)||c.has(h.id))continue;var v=new ys(e,f,!1);l.push(v),c.add(h.id)}r=l}this.length=0;for(var p=0,g=r.length;p<g;p++){var y=r[p][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 Ir,C=this.eles,x=0;x<C.length;x++){var k=C[x];w.set(k.id(),{index:x,ele:k})}}},n&&(this._private.map=i),o&&!a&&this.restore()},Ge=ys.prototype=Tt.prototype=Object.create(Array.prototype);Ge.instanceString=function(){return"collection"},Ge.spawn=function(t,e){return new Tt(this.cy(),t,e)},Ge.spawnSelf=function(){return this.spawn(this)},Ge.cy=function(){return this._private.cy},Ge.renderer=function(){return this._private.cy.renderer()},Ge.element=function(){return this[0]},Ge.collection=function(){return B0(this)?this:new Tt(this._private.cy,[this])},Ge.unique=function(){return new Tt(this._private.cy,this,!0)},Ge.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)},Ge.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new Tt(e)},Ge.$id=Ge.getElementById,Ge.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index},Ge.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index},Ge.indexOfId=function(t){return t=""+t,this._private.map.get(t).index},Ge.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var n=e._private;if(Ae(t)){if(r.startBatch(),t.data){e.data(t.data);var a=n.data;if(e.isEdge()){var i=!1,o={},l=t.data.source,c=t.data.target;l!=null&&l!=a.source&&(o.source=""+l,i=!0),c!=null&&c!=a.target&&(o.target=""+c,i=!0),i&&(e=e.move(o))}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 h={data:Nr(n.data),position:Nr(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};h.classes="";var v=0;return n.classes.forEach(function(p){return h.classes+=v++===0?p:" "+p}),h}}},Ge.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],n=r.json();t.push(n)}return t},Ge.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var n=this[r],a=n.json(),i=new ys(t,a,!1);e.push(i)}return new Tt(t,e)},Ge.copy=Ge.clone,Ge.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=[],o=[],l,c=0,u=r.length;c<u;c++){var d=r[c];e&&!d.removed()||(d.isNode()?i.push(d):o.push(d))}l=i.concat(o);var f,h=function(){l.splice(f,1),f--};for(f=0;f<l.length;f++){var v=l[f],p=v._private,g=p.data;if(v.clearTraversalCache(),!(!e&&!p.removed)){if(g.id===void 0)g.id=Z0();else if(de(g.id))g.id=""+g.id;else if(mn(g.id)||!Ee(g.id)){Je("Can not create element with invalid string ID `"+g.id+"`"),h();continue}else if(n.hasElementWithId(g.id)){Je("Can not create second element with ID `"+g.id+"`"),h();continue}}var y=g.id;if(v.isNode()){var m=p.position;m.x==null&&(m.x=0),m.y==null&&(m.y=0)}if(v.isEdge()){for(var b=v,w=["source","target"],C=w.length,x=!1,k=0;k<C;k++){var E=w[k],_=g[E];de(_)&&(_=g[E]=""+g[E]),_==null||_===""?(Je("Can not create edge `"+y+"` with unspecified "+E),x=!0):n.hasElementWithId(_)||(Je("Can not create edge `"+y+"` with nonexistant "+E+" `"+_+"`"),x=!0)}if(x){h();continue}var S=n.getElementById(g.source),T=n.getElementById(g.target);S.same(T)?S._private.edges.push(b):(S._private.edges.push(b),T._private.edges.push(b)),b._private.source=S,b._private.target=T}p.map=new Ir,p.map.set(y,{ele:v,index:0}),p.removed=!1,e&&n.addToPool(v)}for(var N=0;N<i.length;N++){var B=i[N],P=B._private.data;de(P.parent)&&(P.parent=""+P.parent);var D=P.parent,R=D!=null;if(R||B._private.parent){var O=B._private.parent?n.collection().merge(B._private.parent):n.getElementById(D);if(O.empty())P.parent=void 0;else if(O[0].removed())$e("Node added with missing parent, reference to parent removed"),P.parent=void 0,B._private.parent=null;else{for(var F=!1,A=O;!A.empty();){if(B.same(A)){F=!0,P.parent=void 0;break}A=A.parent()}F||(O[0]._private.children.push(B),B._private.parent=O[0],a.hasCompoundNodes=!0)}}}if(l.length>0){for(var z=l.length===r.length?r:new Tt(n,l),j=0;j<z.length;j++){var H=z[j];H.isNode()||(H.parallelEdges().clearTraversalCache(),H.source().clearTraversalCache(),H.target().clearTraversalCache())}var G;a.hasCompoundNodes?G=n.collection().merge(z).merge(z.connectedNodes()).merge(z.parent()):G=z,G.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?z.emitAndNotify("add"):e&&z.emit("add")}return r},Ge.removed=function(){var t=this[0];return t&&t._private.removed},Ge.inside=function(){var t=this[0];return t&&!t._private.removed},Ge.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 o(D){for(var R=D._private.edges,O=0;O<R.length;O++)c(R[O])}function l(D){for(var R=D._private.children,O=0;O<R.length;O++)c(R[O])}function c(D){var R=a[D.id()];e&&D.removed()||R||(a[D.id()]=!0,D.isNode()?(n.push(D),o(D),l(D)):n.unshift(D))}for(var u=0,d=r.length;u<d;u++){var f=r[u];c(f)}function h(D,R){var O=D._private.edges;bn(O,R),D.clearTraversalCache()}function v(D){D.clearTraversalCache()}var p=[];p.ids={};function g(D,R){R=R[0],D=D[0];var O=D._private.children,F=D.id();bn(O,R),R._private.parent=null,p.ids[F]||(p.ids[F]=!0,p.push(D))}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];h(b,m),h(w,m);for(var C=m.parallelEdges(),x=0;x<C.length;x++){var k=C[x];v(k),k.isBundledBezier()&&k.dirtyBoundingBoxCache()}}else{var E=m.parent();E.length!==0&&g(E,m)}e&&(m._private.removed=!0)}var _=i._private.elements;i._private.hasCompoundNodes=!1;for(var S=0;S<_.length;S++){var T=_[S];if(T.isParent()){i._private.hasCompoundNodes=!0;break}}var N=new Tt(this.cy(),n);N.size()>0&&(t?N.emitAndNotify("remove"):e&&N.emit("remove"));for(var B=0;B<p.length;B++){var P=p[B];(!e||!P.removed())&&P.updateStyle()}return N},Ge.move=function(t){var e=this._private.cy,r=this,n=!1,a=!1,i=function(p){return p==null?p:""+p};if(t.source!==void 0||t.target!==void 0){var o=i(t.source),l=i(t.target),c=o!=null&&e.hasElementWithId(o),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 p=r[v],g=p._private.data;p.isEdge()&&(c&&(g.source=o),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 h=d===null?void 0:d;e.batch(function(){var v=r.remove(n,a);v.emitAndNotify("moveout");for(var p=0;p<r.length;p++){var g=r[p],y=g._private.data;g.isNode()&&(y.parent=h)}v.restore(n,a)}),r.emitAndNotify("move")}}return this},[xb,Rq,As,Sn,Xa,Xq,Rs,hz,u1,c1,yz,Vs,qs,_t,Nn,Bt].forEach(function(t){Se(Ge,t)});var Sz={add:function(e){var r,n=this;if(Zt(e)){var a=e;if(a._private.cy===n)r=a.restore();else{for(var i=[],o=0;o<a.length;o++){var l=a[o];i.push(l.json())}r=new Tt(n,i)}}else if(Ke(e)){var c=e;r=new Tt(n,c)}else if(Ae(e)&&(Ke(e.nodes)||Ke(e.edges))){for(var u=e,d=[],f=["nodes","edges"],h=0,v=f.length;h<v;h++){var p=f[h],g=u[p];if(Ke(g))for(var y=0,m=g.length;y<m;y++){var b=Se({group:p},g[y]);d.push(b)}}r=new Tt(n,d)}else{var w=e;r=new ys(n,w).collection()}return r},remove:function(e){if(!Zt(e)){if(Ee(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 _z(t,e,r,n){var a=4,i=.001,o=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 h=d?new Float32Array(c):new Array(c);function v(T,N){return 1-3*N+3*T}function p(T,N){return 3*N-6*T}function g(T){return 3*T}function y(T,N,B){return((v(N,B)*T+p(N,B))*T+g(N))*T}function m(T,N,B){return 3*v(N,B)*T*T+2*p(N,B)*T+g(N)}function b(T,N){for(var B=0;B<a;++B){var P=m(N,t,r);if(P===0)return N;var D=y(N,t,r)-T;N-=D/P}return N}function w(){for(var T=0;T<c;++T)h[T]=y(T*u,t,r)}function C(T,N,B){var P,D,R=0;do D=N+(B-N)/2,P=y(D,t,r)-T,P>0?B=D:N=D;while(Math.abs(P)>o&&++R<l);return D}function x(T){for(var N=0,B=1,P=c-1;B!==P&&h[B]<=T;++B)N+=u;--B;var D=(T-h[B])/(h[B+1]-h[B]),R=N+D*u,O=m(R,t,r);return O>=i?b(T,R):O===0?R:C(T,N,N+u)}var k=!1;function E(){k=!0,(t!==e||r!==n)&&w()}var _=function(N){return k||E(),t===e&&r===n?N:N===0?0:N===1?1:y(x(N),e,n)};_.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var S="generateBezier("+[t,e,r,n]+")";return _.toString=function(){return S},_}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var Tz=function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,a,i){var o={x:n.x+i.dx*a,v:n.v+i.dv*a,tension:n.tension,friction:n.friction};return{dx:o.v,dv:t(o)}}function r(n,a){var i={dx:n.v,dv:t(n)},o=e(n,a*.5,i),l=e(n,a*.5,o),c=e(n,a,l),u=1/6*(i.dx+2*(o.dx+l.dx)+c.dx),d=1/6*(i.dv+2*(o.dv+l.dv)+c.dv);return n.x=n.x+u*a,n.v=n.v+d*a,n}return function n(a,i,o){var l={x:-1,v:0,tension:null,friction:null},c=[0],u=0,d=1/1e4,f=16/1e3,h,v,p;for(a=parseFloat(a)||500,i=parseFloat(i)||20,o=o||null,l.tension=a,l.friction=i,h=o!==null,h?(u=n(a,i),v=u/o*f):v=f;p=r(p||l,v),c.push(1+p.x),u+=16,Math.abs(p.x)>d&&Math.abs(p.v)>d;);return h?function(g){return c[g*(c.length-1)|0]}:u}}(),Ue=function(e,r,n,a){var i=_z(e,r,n,a);return function(o,l,c){return o+(l-o)*i(c)}},Ks={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 Ks.linear;var a=Tz(e,r,n);return function(i,o,l){return i+(o-i)*a(l)}},"cubic-bezier":Ue};function w1(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 C1(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function ri(t,e,r,n,a){var i=a!=null?a.type:null;r<0?r=0:r>1&&(r=1);var o=C1(t,a),l=C1(e,a);if(de(o)&&de(l))return w1(i,o,l,r,n);if(Ke(o)&&Ke(l)){for(var c=[],u=0;u<l.length;u++){var d=o[u],f=l[u];if(d!=null&&f!=null){var h=w1(i,d,f,r,n);c.push(h)}else c.push(f)}return c}}function Nz(t,e,r,n){var a=!n,i=t._private,o=e._private,l=o.easing,c=o.startTime,u=n?t:t.cy(),d=u.style();if(!o.easingImpl)if(l==null)o.easingImpl=Ks.linear;else{var f;if(Ee(l)){var h=d.parse("transition-timing-function",l);f=h.value}else f=l;var v,p;Ee(f)?(v=f,p=[]):(v=f[1],p=f.slice(2).map(function(z){return+z})),p.length>0?(v==="spring"&&p.push(o.duration),o.easingImpl=Ks[v].apply(null,p)):o.easingImpl=Ks[v]}var g=o.easingImpl,y;if(o.duration===0?y=1:y=(r-c)/o.duration,o.applying&&(y=o.progress),y<0?y=0:y>1&&(y=1),o.delay==null){var m=o.startPosition,b=o.position;if(b&&a&&!t.locked()){var w={};fo(m.x,b.x)&&(w.x=ri(m.x,b.x,y,g)),fo(m.y,b.y)&&(w.y=ri(m.y,b.y,y,g)),t.position(w)}var C=o.startPan,x=o.pan,k=i.pan,E=x!=null&&n;E&&(fo(C.x,x.x)&&(k.x=ri(C.x,x.x,y,g)),fo(C.y,x.y)&&(k.y=ri(C.y,x.y,y,g)),t.emit("pan"));var _=o.startZoom,S=o.zoom,T=S!=null&&n;T&&(fo(_,S)&&(i.zoom=eo(i.minZoom,ri(_,S,y,g),i.maxZoom)),t.emit("zoom")),(E||T)&&t.emit("viewport");var N=o.style;if(N&&N.length>0&&a){for(var B=0;B<N.length;B++){var P=N[B],D=P.name,R=P,O=o.startStyle[D],F=d.properties[O.name],A=ri(O,R,y,g,F);d.overrideBypass(t,D,A)}t.emit("style")}}return o.progress=y,y}function fo(t,e){return t==null||e==null?!1:de(t)&&de(e)?!0:!!(t&&e)}function Iz(t,e,r,n){var a=e._private;a.started=!0,a.startTime=r-a.progress*a.duration}function E1(t,e){var r=e._private.aniEles,n=[];function a(d,f){var h=d._private,v=h.animation.current,p=h.animation.queue,g=!1;if(v.length===0){var y=p.shift();y&&v.push(y)}for(var m=function(k){for(var E=k.length-1;E>=0;E--){var _=k[E];_()}k.splice(0,k.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||Iz(d,w,t),Nz(d,w,t,f),C.applying&&(C.applying=!1),m(C.frames),C.step!=null&&C.step(t),w.completed()&&(v.splice(b,1),C.hooked=!1,C.playing=!1,C.started=!1,m(C.completes)),g=!0)}return!f&&v.length===0&&p.length===0&&n.push(d),g}for(var i=!1,o=0;o<r.length;o++){var l=r[o],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 Bz={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&&vs(function(i){E1(i,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,o){E1(o,e)},n.beforeRenderPriorities.animations):r()}},Dz={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&&Ki(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}},Gs=function(e){return Ee(e)?new xn(e):e},x1={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Ms(Dz,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,Gs(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,Gs(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,Gs(r),n),this},once:function(e,r,n){return this.emitter().one(e,Gs(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(x1);var dc={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)}};dc.jpeg=dc.jpg;var Us={layout:function(e){var r=this;if(e==null){Je("Layout options must be specified to make a layout");return}if(e.name==null){Je("A `name` must be specified to make a layout");return}var n=e.name,a=r.extension("layout",n);if(a==null){Je("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;Ee(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var o=new a(Se({},e,{cy:r,eles:i}));return o}};Us.createLayout=Us.makeLayout=Us.layout;var Pz={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],o=e[i],l=r.getElementById(i);l.data(o)}})}},Oz=St({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),fc={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){Je("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&&$e("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=Oz(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)}};fc.invalidateDimensions=fc.resize;var js={collection:function(e,r){return Ee(e)?this.$(e):Zt(e)?e.collection():Ke(e)?(r||(r={}),new Tt(this,e,r.unique,r.removed)):new Tt(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}};js.elements=js.filter=js.$;var Dt={},ho="t",Az="f";Dt.apply=function(t){for(var e=this,r=e._private,n=r.cy,a=n.collection(),i=0;i<t.length;i++){var o=t[i],l=e.getContextMeta(o);if(!l.empty){var c=e.getContextStyle(l),u=e.applyContextStyle(l,c,o);o._private.appliedInitStyle?e.updateTransitions(o,u.diffProps):o._private.appliedInitStyle=!0;var d=e.updateStyleHints(o);d&&a.push(o)}}return a},Dt.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 o=[],l={},c=0;c<r.length;c++){var u=r[c],d=t[c]===ho,f=e[c]===ho,h=d!==f,v=u.mappedProperties.length>0;if(h||f&&v){var p=void 0;h&&v||h?p=u.properties:v&&(p=u.mappedProperties);for(var g=0;g<p.length;g++){for(var y=p[g],m=y.name,b=!1,w=c+1;w<r.length;w++){var C=r[w],x=e[w]===ho;if(x&&(b=C.properties[y.name]!=null,b))break}!l[m]&&!b&&(l[m]=!0,o.push(m))}}}return n[a]=o,o},Dt.getContextMeta=function(t){for(var e=this,r="",n,a=t._private.styleCxtKey||"",i=0;i<e.length;i++){var o=e[i],l=o.selector&&o.selector.matches(t);l?r+=ho:r+=Az}return n=e.getPropertiesDiff(a,r),t._private.styleCxtKey=r,{key:r,diffPropNames:n,empty:n.length===0}},Dt.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 o=r[i],l=e[i]===ho;if(l)for(var c=0;c<o.properties.length;c++){var u=o.properties[c];a[u.name]=u}}return n[e]=a,a},Dt.applyContextStyle=function(t,e,r){for(var n=this,a=t.diffPropNames,i={},o=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===o.fn&&d!=null&&d.mapping!=null&&d.mapping.value===u.value){var f=d.mapping,h=f.fnValue=u.value(r);if(h===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}},Dt.updateStyleHints=function(t){var e=t._private,r=this,n=r.propertyGroupNames,a=r.propertyGroupKeys,i=function(Y,se,ue){return r.getPropertiesHash(Y,se,ue)},o=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]=[Ma,Yi]}for(var f=function(Y,se){return e.styleKeys[se][0]=Zi(Y,e.styleKeys[se][0])},h=function(Y,se){return e.styleKeys[se][1]=Xi(Y,e.styleKeys[se][1])},v=function(Y,se){f(Y,se),h(Y,se)},p=function(Y,se){for(var ue=0;ue<Y.length;ue++){var ae=Y.charCodeAt(ue);f(ae,se),h(ae,se)}},g=2e9,y=function(Y){return-128<Y&&Y<128&&Math.floor(Y)!==Y?g-(Y*1024|0):Y},m=0;m<n.length;m++){var b=n[m],w=c[b];if(w!=null){var C=this.properties[b],x=C.type,k=C.groupKey,E=void 0;C.hashOverride!=null?E=C.hashOverride(t,w):w.pfValue!=null&&(E=w.pfValue);var _=C.enums==null?w.value:null,S=E!=null,T=_!=null,N=S||T,B=w.units;if(x.number&&N&&!x.multiple){var P=S?E:_;v(y(P),k),!S&&B!=null&&p(B,k)}else p(w.strValue,k)}}for(var D=[Ma,Yi],R=0;R<a.length;R++){var O=a[R],F=e.styleKeys[O];D[0]=Zi(F[0],D[0]),D[1]=Xi(F[1],D[1])}e.styleKey=$M(D[0],D[1]);var A=e.styleKeys;e.labelDimsKey=yn(A.labelDimensions);var z=i(t,["label"],A.labelDimensions);if(e.labelKey=yn(z),e.labelStyleKey=yn(gs(A.commonLabel,z)),!l){var j=i(t,["source-label"],A.labelDimensions);e.sourceLabelKey=yn(j),e.sourceLabelStyleKey=yn(gs(A.commonLabel,j));var H=i(t,["target-label"],A.labelDimensions);e.targetLabelKey=yn(H),e.targetLabelStyleKey=yn(gs(A.commonLabel,H))}if(l){var G=e.styleKeys,X=G.nodeBody,M=G.nodeBorder,V=G.nodeOutline,q=G.backgroundImage,$=G.compound,K=G.pie,L=[X,M,V,q,$,K].filter(function(W){return W!=null}).reduce(gs,[Ma,Yi]);e.nodeKey=yn(L),e.hasPie=K!=null&&K[0]!==Ma&&K[1]!==Yi}return o!==e.styleKey},Dt.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},Dt.applyParsedProperty=function(t,e){var r=this,n=e,a=t._private.style,i,o=r.types,l=r.properties[n.name].type,c=n.bypass,u=a[n.name],d=u&&u.bypass,f=t._private,h="mapping",v=function(X){return X==null?null:X.pfValue!=null?X.pfValue:X.value},p=function(){var X=v(u),M=v(n);r.checkTriggers(t,n.name,X,M)};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,p(),!0;if(n.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,p(),!0):!1:(p(),!0);if(n.deleteBypass)return u?u.bypass?(a[n.name]=u.bypassed,p(),!0):!1:(p(),!0);var g=function(){$e("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 o.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(de(m)){var x=n.fieldMax-n.fieldMin;x===0?C=0:C=(m-n.fieldMin)/x}else return $e("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 k=n.valueMin[0],E=n.valueMax[0],_=n.valueMin[1],S=n.valueMax[1],T=n.valueMin[2],N=n.valueMax[2],B=n.valueMin[3]==null?1:n.valueMin[3],P=n.valueMax[3]==null?1:n.valueMax[3],D=[Math.round(k+(E-k)*C),Math.round(_+(S-_)*C),Math.round(T+(N-T)*C),Math.round(B+(P-B)*C)];i={bypass:n.bypass,name:n.name,value:D,strValue:"rgb("+D[0]+", "+D[1]+", "+D[2]+")"}}else if(l.number){var R=n.valueMin+(n.valueMax-n.valueMin)*C;i=this.parse(n.name,R,n.bypass,h)}else return!1;if(!i)return g(),!1;i.mapping=n,n=i;break}case o.data:{for(var O=n.field.split("."),F=f.data,A=0;A<O.length&&F;A++){var z=O[A];F=F[z]}if(F!=null&&(i=this.parse(n.name,F,n.bypass,h)),!i)return g(),!1;i.mapping=n,n=i;break}case o.fn:{var j=n.value,H=n.fnValue!=null?n.fnValue:j(t);if(n.prevFnValue=H,H==null)return $e("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(n.name,H,n.bypass,h),!i)return $e("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=Nr(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,p(),!0},Dt.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),o=0;o<i.length;o++){var l=i[o],c=a[l];c!=null&&(c.bypass?c.bypassed=null:a[l]=null)}}},Dt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()},Dt.updateTransitions=function(t,e){var r=this,n=t._private,a=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,o=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),h=e[d];if(h){var v=h.prev,p=v,g=h.next!=null?h.next:f,y=!1,m=void 0,b=1e-6;p&&(de(p.pfValue)&&de(g.pfValue)?(y=g.pfValue-p.pfValue,m=p.pfValue+b*y):de(p.value)&&de(g.value)?(y=g.value-p.value,m=p.value+b*y):Ke(p.value)&&Ke(g.value)&&(y=p.value[0]!==g.value[0]||p.value[1]!==g.value[1]||p.value[2]!==g.value[2],m=p.strValue),y&&(l[d]=g.strValue,this.applyBypass(t,d,m),c=!0))}}if(!c)return;n.transitioning=!0,new Ua(function(w){o>0?t.delayAnimation(o).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)},Dt.checkTrigger=function(t,e,r,n,a,i){var o=this.properties[e],l=a(o);l!=null&&l(r,n)&&i(o)},Dt.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)})},Dt.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()})})},Dt.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n)};var po={};po.applyBypass=function(t,e,r,n){var a=this,i=[],o=!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(Ee(e)){var f=this.parse(e,r,!0);f&&i.push(f)}else if(Ae(e)){var h=e;n=r;for(var v=Object.keys(h),p=0;p<v.length;p++){var g=v[p],y=h[g];if(y===void 0&&(y=h[fs(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={},k=void 0,E=0;E<i.length;E++){var _=i[E];if(n){var S=C.pstyle(_.name);k=x[_.name]={prev:S}}b=this.applyParsedProperty(C,Nr(_))||b,n&&(k.next=C.pstyle(_.name))}b&&this.updateStyleHints(C),n&&this.updateTransitions(C,x,o)}return b},po.overrideBypass=function(t,e,r){e=Lu(e);for(var n=0;n<t.length;n++){var a=t[n],i=a._private.style[e],o=this.properties[e].type,l=o.color,c=o.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)}},po.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)},po.removeBypasses=function(t,e,r){for(var n=!0,a=0;a<t.length;a++){for(var i=t[a],o={},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="",h=this.parse(c,f,!0),v=o[u.name]={prev:d};this.applyParsedProperty(i,h),v.next=i.pstyle(u.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,o,n)}};var hc={};hc.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1},hc.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 Br={};Br.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)},Br.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],o=r.getStylePropertyValue(t,i.name,e);o!=null&&(n[i.name]=o,n[fs(i.name)]=o)}return n}},Br.getIndexedStyle=function(t,e,r,n){var a=t.pstyle(e)[r][n];return a??t.cy().style().getDefaultProperty(e)[r][0]},Br.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,o=t.pstyle(a.name);if(o){var l=o.value,c=o.units,u=o.strValue;if(r&&i.number&&l!=null&&de(l)){var d=t.cy().zoom(),f=function(y){return y*d},h=function(y,m){return f(y)+m},v=Ke(l),p=v?c.every(function(g){return g!=null}):c!=null;return p?v?l.map(function(g,y){return h(g,c[y])}).join(" "):h(l,c):v?l.map(function(g){return Ee(g)?g:""+f(g)}).join(" "):""+f(l)}else if(u!=null)return u}return null}},Br.getAnimationStartStyle=function(t,e){for(var r={},n=0;n<e.length;n++){var a=e[n],i=a.name,o=t.pstyle(i);o!==void 0&&(Ae(o)?o=this.parse(i,o.strValue):o=this.parse(i,o)),o&&(r[i]=o)}return r},Br.getPropsList=function(t){var e=this,r=[],n=t,a=e.properties;if(n)for(var i=Object.keys(n),o=0;o<i.length;o++){var l=i[o],c=n[l],u=a[l]||a[Lu(l)],d=this.parse(u.name,c);d&&r.push(d)}return r},Br.getNonDefaultPropertiesHash=function(t,e,r){var n=r.slice(),a,i,o,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]=Zi(l,n[0]),n[1]=Xi(l,n[1]);else for(o=i.strValue,u=0;u<o.length;u++)l=o.charCodeAt(u),n[0]=Zi(l,n[0]),n[1]=Xi(l,n[1]);return n},Br.getPropertiesHash=Br.getNonDefaultPropertiesHash;var Ws={};Ws.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,o=Object.keys(i);e.selector(a);for(var l=0;l<o.length;l++){var c=o[l],u=i[c];e.css(c,u)}}return e},Ws.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e},Ws.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],n=r.selector,a=r.properties,i={},o=0;o<a.length;o++){var l=a[o];i[l.name]=l.strValue}t.push({selector:n?n.toString():"core",style:i})}return t};var pc={};pc.appendFromString=function(t){var e=this,r=this,n=""+t,a,i,o;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function l(){n.length>a.length?n=n.substr(a.length):n=""}function c(){i.length>o.length?i=i.substr(o.length):i=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var d=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){$e("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 h=new xn(f);if(h.invalid){$e("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),l();continue}}var v=d[2],p=!1;i=v;for(var g=[];;){var y=i.match(/^\s*$/);if(y)break;var m=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!m){$e("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+v),p=!0;break}o=m[0];var b=m[1],w=m[2],C=e.properties[b];if(!C){$e("Skipping property: Invalid property name in: "+o),c();continue}var x=r.parse(b,w);if(!x){$e("Skipping property: Invalid property definition in: "+o),c();continue}g.push({name:b,val:w}),c()}if(p){l();break}r.selector(f);for(var k=0;k<g.length;k++){var E=g[k];r.css(E.name,E.val)}l()}return r},pc.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var Nt={};(function(){var t=vt,e=zF,r=KF,n=GF,a=UF,i=function(L){return"^"+L+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(L){var W=t+"|\\w+|"+e+"|"+r+"|"+n+"|"+a;return"^"+L+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+W+")\\s*\\,\\s*("+W+")\\)$"},l=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Nt.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:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("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(L,W){switch(L.length){case 2:return W[0]!=="deg"&&W[0]!=="rad"&&W[1]!=="deg"&&W[1]!=="rad";case 1:return Ee(L[0])||W[0]==="deg"||W[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(L){var W=L.length;return W===1||W===2||W===4}}};var c={zeroNonZero:function(L,W){return(L==null||W==null)&&L!==W||L==0&&W!=0?!0:L!=0&&W==0},any:function(L,W){return L!=W},emptyNonEmpty:function(L,W){var Y=mn(L),se=mn(W);return Y&&!se||!Y&&se}},u=Nt.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}],h=[{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}],p=[{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(L,W){return W.value==="label"?-L.poolIndex():W.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}],k=[{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}],E=[{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}],_=[{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}],T=[{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}],N=[{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}],B=[{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}],P=[];Nt.pieBackgroundN=16,P.push({name:"pie-size",type:u.sizeMaybePercent});for(var D=1;D<=Nt.pieBackgroundN;D++)P.push({name:"pie-"+D+"-background-color",type:u.color}),P.push({name:"pie-"+D+"-background-size",type:u.percent}),P.push({name:"pie-"+D+"-background-opacity",type:u.zeroOneNumber});var R=[],O=Nt.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(K){O.forEach(function(L){var W=L+"-"+K.name,Y=K.type,se=K.triggersBounds;R.push({name:W,type:Y,triggersBounds:se})})},{});var F=Nt.properties=[].concat(g,w,y,m,b,N,p,v,d,f,h,x,k,E,_,P,S,T,R,B),A=Nt.propertyGroups={behavior:g,transition:w,visibility:y,overlay:m,underlay:b,ghost:N,commonLabel:p,labelDimensions:v,mainLabel:d,sourceLabel:f,targetLabel:h,nodeBody:x,nodeBorder:k,nodeOutline:E,backgroundImage:_,pie:P,compound:S,edgeLine:T,edgeArrow:R,core:B},z=Nt.propertyGroupNames={},j=Nt.propertyGroupKeys=Object.keys(A);j.forEach(function(K){z[K]=A[K].map(function(L){return L.name}),A[K].forEach(function(L){return L.groupKey=K})});var H=Nt.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"}];Nt.propertyNames=F.map(function(K){return K.name});for(var G=0;G<F.length;G++){var X=F[G];F[X.name]=X}for(var M=0;M<H.length;M++){var V=H[M],q=F[V.pointsTo],$={name:V.name,alias:!0,pointsTo:q};F.push($),F[V.name]=$}})(),Nt.getDefaultProperty=function(t){return this.getDefaultProperties()[t]},Nt.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=Se({"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<=Nt.pieBackgroundN;d++){var f=u.name.replace("{{i}}",d),h=u.value;c[f]=h}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 Nt.arrowPrefixes.forEach(function(d){var f=d+"-"+u.name,h=u.value;c[f]=h}),c},{})),r={},n=0;n<this.properties.length;n++){var a=this.properties[n];if(!a.pointsTo){var i=a.name,o=e[i],l=this.parse(i,o);r[i]=l}}return t.defaultProperties=r,t.defaultProperties},Nt.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var Ys={};Ys.parse=function(t,e,r,n){var a=this;if(Xe(e))return a.parseImplWarn(t,e,r,n);var i=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,o=r?"t":"f",l=""+e,c=G0(t,l,o,i),u=a.propCache=a.propCache||[],d;return(d=u[c])||(d=u[c]=a.parseImplWarn(t,e,r,n)),(r||n==="mapping")&&(d=Nr(d),d&&(d.value=Nr(d.value))),d},Ys.parseImplWarn=function(t,e,r,n){var a=this.parseImpl(t,e,r,n);return!a&&e!=null&&$e("The style property `".concat(t,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&$e("The style value of `label` is deprecated for `"+a.name+"`"),a},Ys.parseImpl=function(t,e,r,n){var a=this;t=Lu(t);var i=a.properties[t],o=e,l=a.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var c=Ee(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(Xe(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 h=l.data;return{name:t,value:d,strValue:""+e,mapped:h,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 p=this.parse(t,f[4]);if(!p||p.mapped)return!1;var g=this.parse(t,f[5]);if(!g||g.mapped)return!1;if(p.pfValue===g.pfValue||p.strValue===g.strValue)return $e("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+p.strValue+"`"),this.parse(t,p.strValue);if(u.color){var y=p.value,m=g.value,b=y[0]===m[0]&&y[1]===m[1]&&y[2]===m[2]&&(y[3]===m[3]||(y[3]==null||y[3]===1)&&(m[3]==null||m[3]===1));if(b)return!1}return{name:t,value:f,strValue:""+e,mapped:v,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:p.value,valueMax:g.value,bypass: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=[],k=[],E="",_=!1,S=0;S<w.length;S++){var T=a.parse(t,w[S],r,"multiple");_=_||Ee(T.value),C.push(T.value),k.push(T.pfValue!=null?T.pfValue:T.value),x.push(T.units),E+=(S>0?" ":"")+T.strValue}return u.validate&&!u.validate(C,x)?null:u.singleEnum&&_?C.length===1&&Ee(C[0])?{name:t,value:C[0],strValue:C[0],bypass:r}:null:{name:t,value:C,pfValue:k,strValue:E,bypass:r,units:x}}var N=function(){for(var L=0;L<u.enums.length;L++){var W=u.enums[L];if(W===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(u.number){var B,P="px";if(u.units&&(B=u.units),u.implicitUnits&&(P=u.implicitUnits),!u.unitless)if(c){var D="px|em"+(u.allowPercent?"|\\%":"");B&&(D=B);var R=e.match("^("+vt+")("+D+")?$");R&&(e=R[1],B=R[2]||P)}else(!B||u.implicitUnits)&&(B=P);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=o,N();if(u.integer&&!RF(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+(B||""),units:B,bypass:r};return u.unitless||B!=="px"&&B!=="em"?O.pfValue=e:O.pfValue=B==="px"||!B?e:this.getEmSizeInPixels()*e,(B==="ms"||B==="s")&&(O.pfValue=B==="ms"?e:1e3*e),(B==="deg"||B==="rad")&&(O.pfValue=B==="rad"?e:v5(e)),B==="%"&&(O.pfValue=e/100),O}else if(u.propList){var F=[],A=""+e;if(A!=="none"){for(var z=A.split(/\s*,\s*|\s+/),j=0;j<z.length;j++){var H=z[j].trim();a.properties[H]?F.push(H):$e("`"+H+"` is not a valid property name")}if(F.length===0)return null}return{name:t,value:F,strValue:F.length===0?"none":F.join(" "),bypass:r}}else if(u.color){var G=JF(e);return G?{name:t,value:G,pfValue:G,strValue:"rgb("+G[0]+","+G[1]+","+G[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var X=N();if(X)return X}for(var M=u.regexes?u.regexes:[u.regex],V=0;V<M.length;V++){var q=new RegExp(M[V]),$=q.exec(e);if($)return{name:t,value:u.singleRegexMatchValue?$[1]:$,strValue:""+e,bypass:r}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:r}:u.enums?N():null};var Pt=function t(e){if(!(this instanceof t))return new t(e);if(!Ru(e)){Je("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Ot=Pt.prototype;Ot.instanceString=function(){return"style"},Ot.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},Ot.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},Ot.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)},Ot.selector=function(t){var e=t==="core"?null:new xn(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this},Ot.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[fs(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this},Ot.style=Ot.css,Ot.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},Ot.append=function(t){return D0(t)?t.appendToStyle(this):Ke(t)?this.appendFromJson(t):Ee(t)&&this.appendFromString(t),this},Pt.fromJson=function(t,e){var r=new Pt(t);return r.fromJson(e),r},Pt.fromString=function(t,e){return new Pt(t).fromString(e)},[Dt,po,hc,Br,Ws,pc,Nt,Ys].forEach(function(t){Se(Ot,t)}),Pt.types=Ot.types,Pt.properties=Ot.properties,Pt.propertyGroups=Ot.propertyGroups,Pt.propertyGroupNames=Ot.propertyGroupNames,Pt.propertyGroupKeys=Ot.propertyGroupKeys;var Rz={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return D0(e)?r.style=e.generateStyle(this):Ke(e)?r.style=Pt.fromJson(this,e):Ee(e)?r.style=Pt.fromString(this,e):r.style=Pt(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},Lz="single",aa={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=Lz),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,o,l;switch(e.length){case 0:return r;case 1:if(Ee(e[0]))return n=e[0],r[n];if(Ae(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,l=i.y,de(o)&&(r.x=o),de(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")&&de(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,o,l,c,u;if(!this._private.panningEnabled)return this;switch(n.length){case 1:Ae(e)&&(l=n[0],c=l.x,u=l.y,de(c)&&(a.x+=c),de(u)&&(a.y+=u),this.emit("pan viewport"));break;case 2:i=e,o=r,(i==="x"||i==="y")&&de(o)&&(a[i]+=o),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(de(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(Ee(e)){var a=e;e=this.$(a)}else if(MF(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 Zt(e)||(e=this.mutableElements());if(!(Zt(e)&&e.empty())){n=n||e.boundingBox();var o=this.width(),l=this.height(),c;if(r=de(r)?r:0,!isNaN(o)&&!isNaN(l)&&o>0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){c=Math.min((o-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:(o-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 de(e)&&de(r)&&e<=r?(n.minZoom=e,n.maxZoom=r):de(e)&&r===void 0&&e<=n.maxZoom?n.minZoom=e:de(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,o,l=!1;if(r.zoomingEnabled||(l=!0),de(e)?o=e:Ae(e)&&(o=e.level,e.position!=null?i=bs(e.position,a,n):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(l=!0)),o=o>r.maxZoom?r.maxZoom:o,o=o<r.minZoom?r.minZoom:o,l||!de(o)||o===a||i!=null&&(!de(i.x)||!de(i.y)))return null;if(i!=null){var c=n,u=a,d=o,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:o,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=[],o=!1,l=!1;if(!e)return this;if(de(e.zoom)||(n=!1),Ae(e.pan)||(a=!1),!n&&!a)return this;if(n){var c=e.zoom;c<r.minZoom||c>r.maxZoom||!r.zoomingEnabled?o=!0:(r.zoom=c,i.push("zoom"))}if(a&&(!o||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;de(u.x)&&(r.pan.x=u.x,l=!1),de(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(Ee(e)){var n=e;e=this.mutableElements().filter(n)}else Zt(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),o=this.height();r=r===void 0?this._private.zoom:r;var l={x:(i-r*(a.x1+a.x2))/2,y:(o-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}};aa.centre=aa.center,aa.autolockNodes=aa.autolock,aa.autoungrabifyNodes=aa.autoungrabify;var vo={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})};vo.attr=vo.data,vo.removeAttr=vo.removeData;var go=function(e){var r=this;e=Se({},e);var n=e.container;n&&!ds(n)&&ds(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 o=pt!==void 0&&n!==void 0&&!e.headless,l=e;l.layout=Se({name:o?"grid":"null"},l.layout),l.renderer=Se({name:o?"canvas":"null"},l.renderer);var c=function(p,g,y){return g!==void 0?g:y!==void 0?y:p},u=this._private={container:n,ready:!1,options:l,elements:new Tt(this),listeners:[],aniEles:new Tt(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?o:l.styleEnabled,zoom:de(l.zoom)?l.zoom:1,pan:{x:Ae(l.pan)&&de(l.pan.x)?l.pan.x:0,y:Ae(l.pan)&&de(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(p,g){var y=p.some($F);if(y)return Ua.all(p).then(g);g(p)};u.styleEnabled&&r.setStyle([]);var f=Se({},l,l.renderer);r.initRenderer(f);var h=function(p,g,y){r.notifications(!1);var m=r.mutableElements();m.length>0&&m.remove(),p!=null&&(Ae(p)||Ke(p))&&r.add(p),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=Se({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};d([l.style,l.elements],function(v){var p=v[0],g=v[1];u.styleEnabled&&r.style().append(p),h(g,function(){r.startAnimationLoop(),u.ready=!0,Xe(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)})},Zs=go.prototype;Se(Zs,{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 pt;var r=this._private.container.ownerDocument;return r===void 0||r==null?pt:r.defaultView||pt},mount:function(e){if(e!=null){var r=this,n=r._private,a=n.options;return!ds(e)&&ds(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),n.container=e,n.styleEnabled=!0,r.invalidateSize(),r.initRenderer(Se({},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 Nr(this._private.options)},json:function(e){var r=this,n=r._private,a=r.mutableElements(),i=function(C){return r.getElementById(C.id())};if(Ae(e)){if(r.startBatch(),e.elements){var o={},l=function(C,x){for(var k=[],E=[],_=0;_<C.length;_++){var S=C[_];if(!S.data.id){$e("cy.json() cannot handle elements without an ID attribute");continue}var T=""+S.data.id,N=r.getElementById(T);o[T]=!0,N.length!==0?E.push({ele:N,json:S}):(x&&(S.group=x),k.push(S))}r.add(k);for(var B=0;B<E.length;B++){var P=E[B],D=P.ele,R=P.json;D.json(R)}};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 h=r.collection();a.filter(function(w){return!o[w.id()]}).forEach(function(w){w.isParent()?h.merge(w):w.remove()}),h.forEach(function(w){return w.children().move({parent:null})}),h.forEach(function(w){return i(w).remove()})}e.style&&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"],p=0;p<v.length;p++){var g=v[p];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=Nr(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=Nr(n.pan),m.boxSelectionEnabled=n.boxSelectionEnabled,m.renderer=Nr(b.renderer),m.hideEdgesOnViewport=b.hideEdgesOnViewport,m.textureOnViewport=b.textureOnViewport,m.wheelSensitivity=b.wheelSensitivity,m.motionBlur=b.motionBlur,m.multiClickDebounceTime=b.multiClickDebounceTime,m}}}),Zs.$id=Zs.getElementById,[Sz,Bz,x1,dc,Us,Pz,fc,js,Rz,aa,vo].forEach(function(t){Se(Zs,t)});var Fz={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}},Mz={maximal:!1,acyclic:!1},ni=function(e){return e.scratch("breadthfirst")},k1=function(e,r){return e.scratch("breadthfirst",r)};function S1(t){this.options=Se({},Fz,Mz,t)}S1.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=n.nodes().filter(function(ae){return!ae.isParent()}),i=n,o=e.directed,l=e.acyclic||e.maximal||e.maximalAdjustments>0,c=Kt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),u;if(Zt(e.roots))u=e.roots;else if(Ke(e.roots)){for(var d=[],f=0;f<e.roots.length;f++){var h=e.roots[f],v=r.getElementById(h);d.push(v)}u=r.collection(d)}else if(Ee(e.roots))u=r.$(e.roots);else if(o)u=a.roots();else{var p=n.components();u=r.collection();for(var g=function(ne){var ce=p[ne],ie=ce.maxDegree(!1),fe=ce.filter(function(pe){return pe.degree(!1)===ie});u=u.add(fe)},y=0;y<p.length;y++)g(y)}var m=[],b={},w=function(ne,ce){m[ce]==null&&(m[ce]=[]);var ie=m[ce].length;m[ce].push(ne),k1(ne,{index:ie,depth:ce})},C=function(ne,ce){var ie=ni(ne),fe=ie.depth,pe=ie.index;m[fe][pe]=null,w(ne,ce)};i.bfs({roots:u,directed:e.directed,visit:function(ne,ce,ie,fe,pe){var Pe=ne[0],Ie=Pe.id();w(Pe,pe),b[Ie]=!0}});for(var x=[],k=0;k<a.length;k++){var E=a[k];b[E.id()]||x.push(E)}var _=function(ne){for(var ce=m[ne],ie=0;ie<ce.length;ie++){var fe=ce[ie];if(fe==null){ce.splice(ie,1),ie--;continue}k1(fe,{depth:ne,index:ie})}},S=function(){for(var ne=0;ne<m.length;ne++)_(ne)},T=function(ne,ce){for(var ie=ni(ne),fe=ne.incomers().filter(function(I){return I.isNode()&&n.has(I)}),pe=-1,Pe=ne.id(),Ie=0;Ie<fe.length;Ie++){var we=fe[Ie],xe=ni(we);pe=Math.max(pe,xe.depth)}if(ie.depth<=pe){if(!e.acyclic&&ce[Pe])return null;var re=pe+1;return C(ne,re),ce[Pe]=re,!0}return!1};if(o&&l){var N=[],B={},P=function(ne){return N.push(ne)},D=function(){return N.shift()};for(a.forEach(function(ae){return N.push(ae)});N.length>0;){var R=D(),O=T(R,B);if(O)R.outgoers().filter(function(ae){return ae.isNode()&&n.has(ae)}).forEach(P);else if(O===null){$e("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}S();var F=0;if(e.avoidOverlap)for(var A=0;A<a.length;A++){var z=a[A],j=z.layoutDimensions(e),H=j.w,G=j.h;F=Math.max(F,H,G)}var X={},M=function(ne){if(X[ne.id()])return X[ne.id()];for(var ce=ni(ne).depth,ie=ne.neighborhood(),fe=0,pe=0,Pe=0;Pe<ie.length;Pe++){var Ie=ie[Pe];if(!(Ie.isEdge()||Ie.isParent()||!a.has(Ie))){var we=ni(Ie);if(we!=null){var xe=we.index,re=we.depth;if(!(xe==null||re==null)){var I=m[re].length;re<ce&&(fe+=xe/I,pe++)}}}}return pe=Math.max(1,pe),fe=fe/pe,pe===0&&(fe=0),X[ne.id()]=fe,fe},V=function(ne,ce){var ie=M(ne),fe=M(ce),pe=ie-fe;return pe===0?A0(ne.id(),ce.id()):pe};e.depthSort!==void 0&&(V=e.depthSort);for(var q=0;q<m.length;q++)m[q].sort(V),_(q);for(var $=[],K=0;K<x.length;K++)$.push(x[K]);m.unshift($),S();for(var L=0,W=0;W<m.length;W++)L=Math.max(m[W].length,L);var Y={x:c.x1+c.w/2,y:c.x1+c.h/2},se=m.reduce(function(ae,ne){return Math.max(ae,ne.length)},0),ue=function(ne){var ce=ni(ne),ie=ce.depth,fe=ce.index,pe=m[ie].length,Pe=Math.max(c.w/((e.grid?se:pe)+1),F),Ie=Math.max(c.h/(m.length+1),F),we=Math.min(c.w/2/m.length,c.h/2/m.length);if(we=Math.max(we,F),e.circle){var re=we*ie+we-(m.length>0&&m[0].length<=3?we/2:0),I=2*Math.PI/m[ie].length*fe;return ie===0&&m[0].length===1&&(re=1),{x:Y.x+re*Math.cos(I),y:Y.y+re*Math.sin(I)}}else{var xe={x:Y.x+(fe+1-(pe+1)/2)*Pe,y:(ie+1)*Ie};return xe}};return n.nodes().layoutPositions(this,e,ue),this};var $z={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 _1(t){this.options=Se({},$z,t)}_1.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 o=Kt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l={x:o.x1+o.w/2,y:o.y1+o.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,h=0;h<i.length;h++){var v=i[h],p=v.layoutDimensions(e),g=p.w,y=p.h;f=Math.max(f,g,y)}if(de(e.radius)?d=e.radius:i.length<=1?d=0:d=Math.min(o.h,o.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(k,E){var _=e.startAngle+E*u*(a?1:-1),S=d*Math.cos(_),T=d*Math.sin(_),N={x:l.x+S,y:l.y+T};return N};return n.nodes().layoutPositions(this,e,C),this};var Vz={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 T1(t){this.options=Se({},Vz,t)}T1.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"),o=Kt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l={x:o.x1+o.w/2,y:o.y1+o.h/2},c=[],u=0,d=0;d<i.length;d++){var f=i[d],h=void 0;h=e.concentric(f),c.push({value:h,node:f}),f._private.scratch.concentric=h}i.updateStyle();for(var v=0;v<i.length;v++){var p=i[v],g=p.layoutDimensions(e);u=Math.max(u,g.w,g.h)}c.sort(function(ae,ne){return ne.value-ae.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 k=u+e.minNodeSpacing;if(!e.avoidOverlap){var E=m.length>0&&m[0].length>1,_=Math.min(o.w,o.h)/2-k,S=_/(m.length+E?1:0);k=Math.min(k,S)}for(var T=0,N=0;N<m.length;N++){var B=m[N],P=e.sweep===void 0?2*Math.PI-2*Math.PI/B.length:e.sweep,D=B.dTheta=P/Math.max(1,B.length-1);if(B.length>1&&e.avoidOverlap){var R=Math.cos(D)-Math.cos(0),O=Math.sin(D)-Math.sin(0),F=Math.sqrt(k*k/(R*R+O*O));T=Math.max(F,T)}B.r=T,T+=k}if(e.equidistant){for(var A=0,z=0,j=0;j<m.length;j++){var H=m[j],G=H.r-z;A=Math.max(A,G)}z=0;for(var X=0;X<m.length;X++){var M=m[X];X===0&&(z=M.r),M.r=z,z+=A}}for(var V={},q=0;q<m.length;q++)for(var $=m[q],K=$.dTheta,L=$.r,W=0;W<$.length;W++){var Y=$[W],se=e.startAngle+(r?1:-1)*K*W,ue={x:l.x+L*Math.cos(se),y:l.y+L*Math.sin(se)};V[Y.node.id()]=ue}return a.nodes().layoutPositions(this,e,function(ae){var ne=ae.id();return V[ne]}),this};var vc,qz={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 Xs(t){this.options=Se({},qz,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"),o=a.target().data("id"),l=e.some(function(u){return u.data("id")===i}),c=e.some(function(u){return u.data("id")===o});return!l||!c});this.options.eles=this.options.eles.not(n)}Xs.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?vc=!0:vc=!1;var n=zz(e,r,t);vc&&Gz(n),t.randomize&&Uz(n);var a=Yr(),i=function(){jz(n,e,t),t.fit===!0&&e.fit(t.padding)},o=function(h){return!(r.stopped||h>=t.numIter||(Wz(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 h=t.eles.nodes(),v=N1(n,t,h);h.layoutPositions(r,t,v)}},c=0,u=!0;if(t.animate===!0){var d=function f(){for(var h=0;u&&h<t.refresh;)u=o(c),c++,h++;if(!u)B1(n,t),l();else{var v=Yr();v-a>=t.animationThreshold&&i(),vs(f)}};d()}else{for(;u;)u=o(c),c++;B1(n,t),l()}return this},Xs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},Xs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var zz=function(e,r,n){for(var a=n.eles.edges(),i=n.eles.nodes(),o=Kt(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:o.w,clientHeight:o.h,boundingBox:o},c=n.eles.components(),u={},d=0;d<c.length;d++)for(var f=c[d],h=0;h<f.length;h++){var v=f[h];u[v.id()]=d}for(var d=0;d<l.nodeSize;d++){var p=i[d],g=p.layoutDimensions(n),y={};y.isLocked=p.locked(),y.id=p.data("id"),y.parentId=p.data("parent"),y.cmptId=u[p.id()],y.children=[],y.positionX=p.position("x"),y.positionY=p.position("y"),y.offsetX=0,y.offsetY=0,y.height=g.w,y.width=g.h,y.maxX=y.positionX+y.width/2,y.minX=y.positionX-y.width/2,y.maxY=y.positionY+y.height/2,y.minY=y.positionY-y.height/2,y.padLeft=parseFloat(p.style("padding")),y.padRight=parseFloat(p.style("padding")),y.padTop=parseFloat(p.style("padding")),y.padBottom=parseFloat(p.style("padding")),y.nodeRepulsion=Xe(n.nodeRepulsion)?n.nodeRepulsion(p):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 p=l.layoutNodes[d],x=p.parentId;x!=null?l.layoutNodes[l.idToIndex[x]].children.push(p.id):(m[++w]=p.id,C.push(p.id))}for(l.graphSet.push(C);b<=w;){var k=m[b++],E=l.idToIndex[k],v=l.layoutNodes[E],_=v.children;if(_.length>0){l.graphSet.push(_);for(var d=0;d<_.length;d++)m[++w]=_[d]}}for(var d=0;d<l.graphSet.length;d++)for(var S=l.graphSet[d],h=0;h<S.length;h++){var T=l.idToIndex[S[h]];l.indexToGraph[T]=d}for(var d=0;d<l.edgeSize;d++){var N=a[d],B={};B.id=N.data("id"),B.sourceId=N.data("source"),B.targetId=N.data("target");var P=Xe(n.idealEdgeLength)?n.idealEdgeLength(N):n.idealEdgeLength,D=Xe(n.edgeElasticity)?n.edgeElasticity(N):n.edgeElasticity,R=l.idToIndex[B.sourceId],O=l.idToIndex[B.targetId],F=l.indexToGraph[R],A=l.indexToGraph[O];if(F!=A){for(var z=Hz(B.sourceId,B.targetId,l),j=l.graphSet[z],H=0,y=l.layoutNodes[R];j.indexOf(y.id)===-1;)y=l.layoutNodes[l.idToIndex[y.parentId]],H++;for(y=l.layoutNodes[O];j.indexOf(y.id)===-1;)y=l.layoutNodes[l.idToIndex[y.parentId]],H++;P*=H*n.nestingFactor}B.idealLength=P,B.elasticity=D,l.layoutEdges.push(B)}return l},Hz=function(e,r,n){var a=Kz(e,r,0,n);return 2>a.count?0:a.graph},Kz=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 o=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]]],h=t(e,r,f,a);if(h.count!==0)if(h.count===1){if(o++,o===2)break}else return h}}return{count:o,graph:n}},Gz,Uz=function(e,r){for(var n=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*n,o.positionY=Math.random()*a)}},N1=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(o){var l=e.layoutNodes[e.idToIndex[o.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(o,l){var c=e.layoutNodes[e.idToIndex[o.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}}},jz=function(e,r,n){var a=n.layout,i=n.eles.nodes(),o=N1(e,n,i);i.positions(o),e.ready!==!0&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},Wz=function(e,r,n){Yz(e,r),Jz(e),Qz(e,r),e3(e),t3(e)},Yz=function(e,r){for(var n=0;n<e.graphSet.length;n++)for(var a=e.graphSet[n],i=a.length,o=0;o<i;o++)for(var l=e.layoutNodes[e.idToIndex[a[o]]],c=o+1;c<i;c++){var u=e.layoutNodes[e.idToIndex[a[c]]];Zz(l,u,e,r)}},I1=function(e){return-e+2*e*Math.random()},Zz=function(e,r,n,a){var i=e.cmptId,o=r.cmptId;if(!(i!==o&&!n.isCompound)){var l=r.positionX-e.positionX,c=r.positionY-e.positionY,u=1;l===0&&c===0&&(l=I1(u),c=I1(u));var d=Xz(e,r,l,c);if(d>0)var f=a.nodeOverlap*d,h=Math.sqrt(l*l+c*c),v=f*l/h,p=f*c/h;else var g=Js(e,l,c),y=Js(r,-1*l,-1*c),m=y.x-g.x,b=y.y-g.y,w=m*m+b*b,h=Math.sqrt(w),f=(e.nodeRepulsion+r.nodeRepulsion)/w,v=f*m/h,p=f*b/h;e.isLocked||(e.offsetX-=v,e.offsetY-=p),r.isLocked||(r.offsetX+=v,r.offsetY+=p)}},Xz=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 o=e.maxY-r.minY;else var o=r.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Js=function(e,r,n){var a=e.positionX,i=e.positionY,o=e.height||1,l=e.width||1,c=n/r,u=o/l,d={};return r===0&&0<n||r===0&&0>n?(d.x=a,d.y=i+o/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+o*r/2/n,d.y=i+o/2,d):(0>n&&(c<=-1*u||c>=u)&&(d.x=a-o*r/2/n,d.y=i-o/2),d)},Jz=function(e,r){for(var n=0;n<e.edgeSize;n++){var a=e.layoutEdges[n],i=e.idToIndex[a.sourceId],o=e.layoutNodes[i],l=e.idToIndex[a.targetId],c=e.layoutNodes[l],u=c.positionX-o.positionX,d=c.positionY-o.positionY;if(!(u===0&&d===0)){var f=Js(o,u,d),h=Js(c,-1*u,-1*d),v=h.x-f.x,p=h.y-f.y,g=Math.sqrt(v*v+p*p),y=Math.pow(a.idealLength-g,2)/a.elasticity;if(g!==0)var m=y*v/g,b=y*p/g;else var m=0,b=0;o.isLocked||(o.offsetX+=m,o.offsetY+=b),c.isLocked||(c.offsetX-=m,c.offsetY-=b)}}},Qz=function(e,r){if(r.gravity!==0)for(var n=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],o=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<o;f++){var h=e.layoutNodes[e.idToIndex[i[f]]];if(!h.isLocked){var v=l-h.positionX,p=c-h.positionY,g=Math.sqrt(v*v+p*p);if(g>n){var y=r.gravity*v/g,m=r.gravity*p/g;h.offsetX+=y,h.offsetY+=m}}}}},e3=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 o=n[a++],l=e.idToIndex[o],c=e.layoutNodes[l],u=c.children;if(0<u.length&&!c.isLocked){for(var d=c.offsetX,f=c.offsetY,h=0;h<u.length;h++){var v=e.layoutNodes[e.idToIndex[u[h]]];v.offsetX+=d,v.offsetY+=f,n[++i]=u[h]}c.offsetX=0,c.offsetY=0}}},t3=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=r3(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,n3(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)}},r3=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},n3=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)}},B1=function(e,r){for(var n=e.layoutNodes,a=[],i=0;i<n.length;i++){var o=n[i],l=o.cmptId,c=a[l]=a[l]||[];c.push(o)}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 h=d[f];d.x1=Math.min(d.x1,h.positionX-h.width/2),d.x2=Math.max(d.x2,h.positionX+h.width/2),d.y1=Math.min(d.y1,h.positionY-h.height/2),d.y2=Math.max(d.y2,h.positionY+h.height/2)}d.w=d.x2-d.x1,d.h=d.y2-d.y1,u+=d.w*d.h}}a.sort(function(b,w){return w.w*w.h-b.w*b.h});for(var v=0,p=0,g=0,y=0,m=Math.sqrt(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 h=d[f];h.isLocked||(h.positionX+=v-d.x1,h.positionY+=p-d.y1)}v+=d.w+r.componentSpacing,g+=d.w+r.componentSpacing,y=Math.max(y,d.h),g>m&&(p+=y+r.componentSpacing,v=0,g=0,y=0)}}},a3={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 D1(t){this.options=Se({},a3,t)}D1.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=Kt(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(X){return{x:i.x1,y:i.y1}});else{var o=a.size(),l=Math.sqrt(o*i.h/i.w),c=Math.round(l),u=Math.round(i.w/i.h*l),d=function(M){if(M==null)return Math.min(c,u);var V=Math.min(c,u);V==c?c=M:u=M},f=function(M){if(M==null)return Math.max(c,u);var V=Math.max(c,u);V==c?c=M:u=M},h=e.rows,v=e.cols!=null?e.cols:e.columns;if(h!=null&&v!=null)c=h,u=v;else if(h!=null&&v==null)c=h,u=Math.ceil(o/c);else if(h==null&&v!=null)u=v,c=Math.ceil(o/u);else if(u*c>o){var p=d(),g=f();(p-1)*g>=o?d(p-1):(g-1)*p>=o&&f(g-1)}else for(;u*c<o;){var y=d(),m=f();(m+1)*y>=o?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],k=x._private.position;(k.x==null||k.y==null)&&(k.x=0,k.y=0);var E=x.layoutDimensions(e),_=e.avoidOverlapPadding,S=E.w+_,T=E.h+_;b=Math.max(b,S),w=Math.max(w,T)}for(var N={},B=function(M,V){return!!N["c-"+M+"-"+V]},P=function(M,V){N["c-"+M+"-"+V]=!0},D=0,R=0,O=function(){R++,R>=u&&(R=0,D++)},F={},A=0;A<a.length;A++){var z=a[A],j=e.position(z);if(j&&(j.row!==void 0||j.col!==void 0)){var H={row:j.row,col:j.col};if(H.col===void 0)for(H.col=0;B(H.row,H.col);)H.col++;else if(H.row===void 0)for(H.row=0;B(H.row,H.col);)H.row++;F[z.id()]=H,P(H.row,H.col)}}var G=function(M,V){var q,$;if(M.locked()||M.isParent())return!1;var K=F[M.id()];if(K)q=K.col*b+b/2+i.x1,$=K.row*w+w/2+i.y1;else{for(;B(D,R);)O();q=R*b+b/2+i.x1,$=D*w+w/2+i.y1,P(D,R),O()}return{x:q,y:$}};a.layoutPositions(this,e,G)}return this};var i3={ready:function(){},stop:function(){}};function gc(t){this.options=Se({},i3,t)}gc.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},gc.prototype.stop=function(){return this};var o3={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 P1(t){this.options=Se({},o3,t)}P1.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),n=Xe(t.positions);function a(i){if(t.positions==null)return c5(i.position());if(n)return t.positions(i);var o=t.positions[i._private.data.id];return o??null}return r.layoutPositions(this,t,function(i,o){var l=a(i);return i.locked()||l==null?!1:l}),this};var s3={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 O1(t){this.options=Se({},s3,t)}O1.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=Kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(o,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 l3=[{name:"breadthfirst",impl:S1},{name:"circle",impl:_1},{name:"concentric",impl:T1},{name:"cose",impl:Xs},{name:"grid",impl:D1},{name:"null",impl:gc},{name:"preset",impl:P1},{name:"random",impl:O1}];function A1(t){this.options=t,this.notifications=0}var R1=function(){},L1=function(){throw new Error("A headless instance can not render images")};A1.prototype={recalculateRenderedStyle:R1,notify:function(){this.notifications++},init:R1,isHeadless:function(){return!0},png:L1,jpg:L1};var mc={};mc.arrowShapeWidth=.3,mc.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,d,f,h,v,p,g){var y=v.x-f/2-g,m=v.x+f/2+g,b=v.y-f/2-g,w=v.y+f/2+g,C=y<=u&&u<=m&&b<=d&&d<=w;return C},n=function(u,d,f,h,v){var p=u*Math.cos(h)-d*Math.sin(h),g=u*Math.sin(h)+d*Math.cos(h),y=p*f,m=g*f,b=y+v.x,w=m+v.y;return{x:b,y:w}},a=function(u,d,f,h){for(var v=[],p=0;p<u.length;p+=2){var g=u[p],y=u[p+1];v.push(n(g,y,d,f,h))}return v},i=function(u){for(var d=[],f=0;f<u.length;f++){var h=u[f];d.push(h.x,h.y)}return d},o=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},l=function(u,d){Ee(d)&&(d=t[d]),t[u]=Se({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(h,v,p,g,y,m){var b=i(a(this.points,p+2*m,g,y)),w=Gt(h,v,b);return w},roughCollide:r,draw:function(h,v,p,g){var y=a(this.points,v,p,g);e.arrowShapeImpl("polygon")(h,y)},spacing:function(h){return 0},gap:o},d)};l("none",{collide:ms,roughCollide:ms,draw:Vu,spacing:W0,gap:W0}),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,h,v){var p=a(this.points,d,f,h),g=this.controlPoint,y=n(g[0],g[1],d,f,h);e.arrowShapeImpl(this.name)(u,p,y)},gap:function(u){return o(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,h,v,p,g){var y=i(a(this.points,f+2*g,h,v)),m=i(a(this.pointsTee,f+2*g,h,v)),b=Gt(u,d,y)||Gt(u,d,m);return b},draw:function(u,d,f,h,v){var p=a(this.points,d,f,h),g=a(this.pointsTee,d,f,h);e.arrowShapeImpl(this.name)(u,p,g)}}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,d,f,h,v,p,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,h,v));return Gt(u,d,b)||m},draw:function(u,d,f,h,v){var p=a(this.pointsTr,d,f,h);e.arrowShapeImpl(this.name)(u,p,h.x,h.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(),h=d/u,v=3,p=5;return f[v]=f[v]-h,f[p]=f[p]-h,f},collide:function(u,d,f,h,v,p,g){var y=i(a(this.points,f+2*g,h,v)),m=i(a(this.crossLinePts(f,p),f+2*g,h,v)),b=Gt(u,d,y)||Gt(u,d,m);return b},draw:function(u,d,f,h,v){var p=a(this.points,d,f,h),g=a(this.crossLinePts(d,v),d,f,h);e.arrowShapeImpl(this.name)(u,p,g)}}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return o(u)*.525}}),l("circle",{radius:.15,collide:function(u,d,f,h,v,p,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,h,v){e.arrowShapeImpl(this.name)(u,h.x,h.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 ia={};ia.projectIntoViewport=function(t,e){var r=this.cy,n=this.findContainerClientCoords(),a=n[0],i=n[1],o=n[4],l=r.pan(),c=r.zoom(),u=((t-a)/o-l.x)/c,d=((e-i)/o-l.y)/c;return[u,d]},ia.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")},o=t.clientWidth,l=t.clientHeight,c=a.left+a.right,u=a.top+a.bottom,d=i.left+i.right,f=e.width/(o+d),h=o-c,v=l-u,p=e.left+a.left+i.left,g=e.top+a.top+i.top;return this.containerBB=[p,g,h,v,f]},ia.invalidateContainerClientCoordsCache=function(){this.containerBB=null},ia.findNearestElement=function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]},ia.findNearestElements=function(t,e,r,n){var a=this,i=this,o=i.getCachedZSortedEles(),l=[],c=i.cy.zoom(),u=i.cy.hasCompoundNodes(),d=(n?24:8)/c,f=(n?8:2)/c,h=(n?8:2)/c,v=1/0,p,g;r&&(o=o.interactive);function y(E,_){if(E.isNode()){if(g)return;g=E,l.push(E)}if(E.isEdge()&&(_==null||_<v))if(p){if(p.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value&&p.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value){for(var S=0;S<l.length;S++)if(l[S].isEdge()){l[S]=E,p=E,v=_??v;break}}}else l.push(E),p=E,v=_??v}function m(E){var _=E.outerWidth()+2*f,S=E.outerHeight()+2*f,T=_/2,N=S/2,B=E.position(),P=E.pstyle("corner-radius").value==="auto"?"auto":E.pstyle("corner-radius").pfValue,D=E._private.rscratch;if(B.x-T<=t&&t<=B.x+T&&B.y-N<=e&&e<=B.y+N){var R=i.nodeShapes[a.getNodeShape(E)];if(R.checkPoint(t,e,0,_,S,B.x,B.y,P,D))return y(E,0),!0}}function b(E){var _=E._private,S=_.rscratch,T=E.pstyle("width").pfValue,N=E.pstyle("arrow-scale").value,B=T/2+d,P=B*B,D=B*2,A=_.source,z=_.target,R;if(S.edgeType==="segments"||S.edgeType==="straight"||S.edgeType==="haystack"){for(var O=S.allpts,F=0;F+3<O.length;F+=2)if(x5(t,e,O[F],O[F+1],O[F+2],O[F+3],D)&&P>(R=N5(t,e,O[F],O[F+1],O[F+2],O[F+3])))return y(E,R),!0}else if(S.edgeType==="bezier"||S.edgeType==="multibezier"||S.edgeType==="self"||S.edgeType==="compound"){for(var O=S.allpts,F=0;F+5<S.allpts.length;F+=4)if(k5(t,e,O[F],O[F+1],O[F+2],O[F+3],O[F+4],O[F+5],D)&&P>(R=T5(t,e,O[F],O[F+1],O[F+2],O[F+3],O[F+4],O[F+5])))return y(E,R),!0}for(var A=A||_.source,z=z||_.target,j=a.getArrowWidth(T,N),H=[{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}],F=0;F<H.length;F++){var G=H[F],X=i.arrowShapes[E.pstyle(G.name+"-arrow-shape").value],M=E.pstyle("width").pfValue;if(X.roughCollide(t,e,j,G.angle,{x:G.x,y:G.y},M,d)&&X.collide(t,e,j,G.angle,{x:G.x,y:G.y},M,d))return y(E),!0}u&&l.length>0&&(m(A),m(z))}function w(E,_,S){return gr(E,_,S)}function C(E,_){var S=E._private,T=h,N;_?N=_+"-":N="",E.boundingBox();var B=S.labelBounds[_||"main"],P=E.pstyle(N+"label").value,D=E.pstyle("text-events").strValue==="yes";if(!(!D||!P)){var R=w(S.rscratch,"labelX",_),O=w(S.rscratch,"labelY",_),F=w(S.rscratch,"labelAngle",_),A=E.pstyle(N+"text-margin-x").pfValue,z=E.pstyle(N+"text-margin-y").pfValue,j=B.x1-T-A,H=B.x2+T-A,G=B.y1-T-z,X=B.y2+T-z;if(F){var M=Math.cos(F),V=Math.sin(F),q=function(ue,ae){return ue=ue-R,ae=ae-O,{x:ue*M-ae*V+R,y:ue*V+ae*M+O}},$=q(j,G),K=q(j,X),L=q(H,G),W=q(H,X),Y=[$.x+A,$.y+z,L.x+A,L.y+z,W.x+A,W.y+z,K.x+A,K.y+z];if(Gt(t,e,Y))return y(E),!0}else if(za(B,t,e))return y(E),!0}}for(var x=o.length-1;x>=0;x--){var k=o[x];k.isNode()?m(k)||C(k):b(k)||C(k)||C(k,"source")||C(k,"target")}return l},ia.getAllInBox=function(t,e,r,n){var a=this.getCachedZSortedEles().interactive,i=[],o=Math.min(t,r),l=Math.max(t,r),c=Math.min(e,n),u=Math.max(e,n);t=o,r=l,e=c,n=u;for(var d=Kt({x1:t,y1:e,x2:r,y2:n}),f=0;f<a.length;f++){var h=a[f];if(h.isNode()){var v=h,p=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});Ku(d,p)&&!nb(p,d)&&i.push(v)}else{var g=h,y=g._private,m=y.rscratch;if(m.startX!=null&&m.startY!=null&&!za(d,m.startX,m.startY)||m.endX!=null&&m.endY!=null&&!za(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(!E5(d,b[C])){w=!1;break}w&&i.push(g)}else(m.edgeType==="haystack"||m.edgeType==="straight")&&i.push(g)}}return i};var Qs={};Qs.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",n=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",o=e.edgeType==="compound",l=e.edgeType==="self",c,u,d,f,h,v,m,b;if(r?(d=e.haystackPts[0],f=e.haystackPts[1],h=e.haystackPts[2],v=e.haystackPts[3]):(d=e.arrowStartX,f=e.arrowStartY,h=e.arrowEndX,v=e.arrowEndY),m=e.midX,b=e.midY,i)c=d-e.segpts[0],u=f-e.segpts[1];else if(a||o||l||n){var p=e.allpts,g=bt(p[0],p[2],p[4],.1),y=bt(p[1],p[3],p[5],.1);c=d-g,u=f-y}else c=d-m,u=f-b;e.srcArrowAngle=ws(c,u);var m=e.midX,b=e.midY;if(r&&(m=(d+h)/2,b=(f+v)/2),c=h-d,u=v-f,i){var p=e.allpts;if(p.length/2%2===0){var w=p.length/2,C=w-2;c=p[w]-p[C],u=p[w+1]-p[C+1]}else if(e.isRound)c=e.midVector[1],u=-e.midVector[0];else{var w=p.length/2-1,C=w-2;c=p[w]-p[C],u=p[w+1]-p[C+1]}}else if(a||o||l){var p=e.allpts,x=e.ctrlpts,k,E,_,S;if(x.length/2%2===0){var T=p.length/2-1,N=T+2,B=N+2;k=bt(p[T],p[N],p[B],0),E=bt(p[T+1],p[N+1],p[B+1],0),_=bt(p[T],p[N],p[B],1e-4),S=bt(p[T+1],p[N+1],p[B+1],1e-4)}else{var N=p.length/2-1,T=N-2,B=N+2;k=bt(p[T],p[N],p[B],.4999),E=bt(p[T+1],p[N+1],p[B+1],.4999),_=bt(p[T],p[N],p[B],.5),S=bt(p[T+1],p[N+1],p[B+1],.5)}c=_-k,u=S-E}if(e.midtgtArrowAngle=ws(c,u),e.midDispX=c,e.midDispY=u,c*=-1,u*=-1,i){var p=e.allpts;if(p.length/2%2!==0){if(!e.isRound){var w=p.length/2-1,P=w+2;c=-(p[P]-p[w]),u=-(p[P+1]-p[w+1])}}}if(e.midsrcArrowAngle=ws(c,u),i)c=h-e.segpts[e.segpts.length-2],u=v-e.segpts[e.segpts.length-1];else if(a||o||l||n){var p=e.allpts,D=p.length,g=bt(p[D-6],p[D-4],p[D-2],.9),y=bt(p[D-5],p[D-3],p[D-1],.9);c=h-g,u=v-y}else c=h-m,u=v-b;e.tgtArrowAngle=ws(c,u)},Qs.getArrowWidth=Qs.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 yc,bc,Dr={},ir={},F1,M1,oa,el,Jr,sa,la,Pr,ai,tl,$1,V1,wc,Cc,q1,z1=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)},u3=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},c3=function(e,r,n,a,i){if(e!==q1?z1(r,e,Dr):u3(ir,Dr),z1(r,n,ir),F1=Dr.nx*ir.ny-Dr.ny*ir.nx,M1=Dr.nx*ir.nx-Dr.ny*-ir.ny,Jr=Math.asin(Math.max(-1,Math.min(1,F1))),Math.abs(Jr)<1e-6){yc=r.x,bc=r.y,la=ai=0;return}oa=1,el=!1,M1<0?Jr<0?Jr=Math.PI+Jr:(Jr=Math.PI-Jr,oa=-1,el=!0):Jr>0&&(oa=-1,el=!0),r.radius!==void 0?ai=r.radius:ai=a,sa=Jr/2,tl=Math.min(Dr.len/2,ir.len/2),i?(Pr=Math.abs(Math.cos(sa)*ai/Math.sin(sa)),Pr>tl?(Pr=tl,la=Math.abs(Pr*Math.sin(sa)/Math.cos(sa))):la=ai):(Pr=Math.min(tl,ai),la=Math.abs(Pr*Math.sin(sa)/Math.cos(sa))),wc=r.x+ir.nx*Pr,Cc=r.y+ir.ny*Pr,yc=wc-ir.ny*la*oa,bc=Cc+ir.nx*la*oa,$1=r.x+Dr.nx*Pr,V1=r.y+Dr.ny*Pr,q1=r};function H1(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 Ec(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}:(c3(t,e,r,n,a),{cx:yc,cy:bc,radius:la,startX:$1,startY:V1,stopX:wc,stopY:Cc,startAngle:Dr.ang+Math.PI/2*oa,endAngle:ir.ang-Math.PI/2*oa,counterClockwise:el})}var At={};At.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,i,o=t.pstyle("source-endpoint"),l=t.pstyle("target-endpoint"),c=o.units!=null&&l.units!=null,u=function(x,k,E,_){var S=_-k,T=E-x,N=Math.sqrt(T*T+S*S);return{x:-S/N,y:T/N}},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],o),h=vr(f,2),v=h[0],p=h[1],g=this.manualEndptToPx(t.target()[0],l),y=vr(g,2),m=y[0],b=y[1],w={x1:v,y1:p,x2:m,y2:b};a=u(v,p,m,b),i=w}else $e("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}},At.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 o=n.source,l=n.target,c=o.position(),u=l.position(),d=o.width(),f=l.width(),h=o.height(),v=l.height(),p=r.pstyle("haystack-radius").value,g=p/2;a.haystackPts=a.allpts=[a.source.x*d*g+c.x,a.source.y*h*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)}},At.findSegmentsPoints=function(t,e){var r=t._private.rscratch,n=t.pstyle("segment-weights"),a=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),o=t.pstyle("radius-type"),l=Math.min(n.pfValue.length,a.pfValue.length),c=i.pfValue[i.pfValue.length-1],u=o.pfValue[o.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var d=0;d<l;d++){var f=n.pfValue[d],h=a.pfValue[d],v=1-f,p=f,g=this.findMidptPtsEtc(t,e),y=g.midptPts,m=g.vectorNormInverse,b={x:y.x1*v+y.x2*p,y:y.y1*v+y.y2*p};r.segpts.push(b.x+m.x*h,b.y+m.y*h),r.radii.push(i.pfValue[d]!==void 0?i.pfValue[d]:c),r.isArcRadius.push((o.pfValue[d]!==void 0?o.pfValue[d]:u)==="arc-radius")}},At.findLoopPoints=function(t,e,r,n){var a=t._private.rscratch,i=e.dirCounts,o=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 h=r,v=f;n&&(h=0,v=c);var p=u-Math.PI/2,g=p-d/2,y=p+d/2,m=u+"_"+d;h=i[m]===void 0?i[m]=0:++i[m],a.ctrlpts=[o.x+Math.cos(g)*1.4*v*(h/3+1),o.y+Math.sin(g)*1.4*v*(h/3+1),o.x+Math.cos(y)*1.4*v*(h/3+1),o.y+Math.sin(y)*1.4*v*(h/3+1)]},At.findCompoundLoopPoints=function(t,e,r,n){var a=t._private.rscratch;a.edgeType="compound";var i=e.srcPos,o=e.tgtPos,l=e.srcW,c=e.srcH,u=e.tgtW,d=e.tgtH,f=t.pstyle("control-point-step-size").pfValue,h=t.pstyle("control-point-distances"),v=h?h.pfValue[0]:void 0,p=r,g=f;n&&(p=0,g=v);var y=50,m={x:i.x-l/2,y:i.y-c/2},b={x:o.x-u/2,y:o.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)),k=Math.max(C,Math.log(u*.01));a.ctrlpts=[w.x,w.y-(1+Math.pow(y,1.12)/100)*g*(p/3+1)*x,w.x-(1+Math.pow(y,1.12)/100)*g*(p/3+1)*k,w.y]},At.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"},At.findBezierPoints=function(t,e,r,n,a){var i=t._private.rscratch,o=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],h=n;i.edgeType=h?"multibezier":"bezier",i.ctrlpts=[];for(var v=0;v<u;v++){var p=(.5-e.eles.length/2+r)*o*(a?-1:1),g=void 0,y=eb(p);h&&(d=l?l.pfValue[v]:o,f=c.value[v]),n?g=d:g=d!==void 0?y*d:void 0;var m=g!==void 0?g:p,b=1-f,w=f,C=this.findMidptPtsEtc(t,e),x=C.midptPts,k=C.vectorNormInverse,E={x:x.x1*b+x.x2*w,y:x.y1*b+x.y2*w};i.ctrlpts.push(E.x+k.x*m,E.y+k.y*m)}},At.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var n="vertical",a="horizontal",i="leftward",o="rightward",l="downward",c="upward",u="auto",d=e.posPts,f=e.srcW,h=e.srcH,v=e.tgtW,p=e.tgtH,g=t.pstyle("edge-distances").value,y=g!=="node-position",m=t.pstyle("taxi-direction").value,b=m,w=t.pstyle("taxi-turn"),C=w.units==="%",x=w.pfValue,k=x<0,E=t.pstyle("taxi-turn-min-distance").pfValue,_=y?(f+v)/2:0,S=y?(h+p)/2:0,T=d.x2-d.x1,N=d.y2-d.y1,B=function(me,be){return me>0?Math.max(me-be,0):Math.min(me+be,0)},P=B(T,_),D=B(N,S),R=!1;b===u?m=Math.abs(P)>Math.abs(D)?a:n:b===c||b===l?(m=n,R=!0):(b===i||b===o)&&(m=a,R=!0);var O=m===n,F=O?D:P,A=O?N:T,z=eb(A),j=!1;!(R&&(C||k))&&(b===l&&A<0||b===c&&A>0||b===i&&A>0||b===o&&A<0)&&(z*=-1,F=z*Math.abs(F),j=!0);var H;if(C){var G=x<0?1+x:x;H=G*F}else{var X=x<0?F:0;H=X+x*z}var M=function(me){return Math.abs(me)<E||Math.abs(me)>=Math.abs(F)},V=M(H),q=M(Math.abs(F)-Math.abs(H)),$=V||q;if($&&!j)if(O){var K=Math.abs(A)<=h/2,L=Math.abs(T)<=v/2;if(K){var W=(d.x1+d.x2)/2,Y=d.y1,se=d.y2;r.segpts=[W,Y,W,se]}else if(L){var ue=(d.y1+d.y2)/2,ae=d.x1,ne=d.x2;r.segpts=[ae,ue,ne,ue]}else r.segpts=[d.x1,d.y2]}else{var ce=Math.abs(A)<=f/2,ie=Math.abs(N)<=p/2;if(ce){var fe=(d.y1+d.y2)/2,pe=d.x1,Pe=d.x2;r.segpts=[pe,fe,Pe,fe]}else if(ie){var Ie=(d.x1+d.x2)/2,we=d.y1,xe=d.y2;r.segpts=[Ie,we,Ie,xe]}else r.segpts=[d.x2,d.y1]}else if(O){var re=d.y1+H+(y?h/2*z:0),I=d.x1,U=d.x2;r.segpts=[I,re,U,re]}else{var te=d.x1+H+(y?f/2*z:0),Z=d.y1,J=d.y2;r.segpts=[te,Z,te,J]}if(r.isRound){var le=t.pstyle("taxi-radius").value,ee=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(le),r.isArcRadius=new Array(r.segpts.length/2).fill(ee)}},At.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,a=e.tgtPos,i=e.srcW,o=e.srcH,l=e.tgtW,c=e.tgtH,u=e.srcShape,d=e.tgtShape,f=e.srcCornerRadius,h=e.tgtCornerRadius,v=e.srcRs,p=e.tgtRs,g=!de(r.startX)||!de(r.startY),y=!de(r.arrowStartX)||!de(r.arrowStartY),m=!de(r.endX)||!de(r.endY),b=!de(r.arrowEndX)||!de(r.arrowEndY),w=3,C=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,x=w*C,k=Jn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),E=k<x,_=Jn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),S=_<x,T=!1;if(g||y||E){T=!0;var N={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},B=Math.sqrt(N.x*N.x+N.y*N.y),P={x:N.x/B,y:N.y/B},D=Math.max(i,o),R={x:r.ctrlpts[0]+P.x*2*D,y:r.ctrlpts[1]+P.y*2*D},O=u.intersectLine(n.x,n.y,i,o,R.x,R.y,0,f,v);E?(r.ctrlpts[0]=r.ctrlpts[0]+P.x*(x-k),r.ctrlpts[1]=r.ctrlpts[1]+P.y*(x-k)):(r.ctrlpts[0]=O[0]+P.x*x,r.ctrlpts[1]=O[1]+P.y*x)}if(m||b||S){T=!0;var F={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},A=Math.sqrt(F.x*F.x+F.y*F.y),z={x:F.x/A,y:F.y/A},j=Math.max(i,o),H={x:r.ctrlpts[0]+z.x*2*j,y:r.ctrlpts[1]+z.y*2*j},G=d.intersectLine(a.x,a.y,l,c,H.x,H.y,0,h,p);S?(r.ctrlpts[0]=r.ctrlpts[0]+z.x*(x-_),r.ctrlpts[1]=r.ctrlpts[1]+z.y*(x-_)):(r.ctrlpts[0]=G[0]+z.x*x,r.ctrlpts[1]=G[1]+z.y*x)}T&&this.findEndpoints(t)}},At.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=bt(e.allpts[n],e.allpts[n+2],e.allpts[n+4],a),e.midY=bt(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 o=e.radii[i/2-1],l=e.isArcRadius[i/2-1];e.roundCorners.push(Ec({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:o},{x:e.allpts[i+2],y:e.allpts[i+3]},o,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]},h=e.roundCorners[d/2],v=[f.x-h.cx,f.y-h.cy],p=h.radius/Math.sqrt(Math.pow(v[0],2)+Math.pow(v[1],2));v=v.map(function(g){return g*p}),e.midX=h.cx+v[0],e.midY=h.cy+v[1],e.midVector=v}}}},At.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||de(e.startX)&&de(e.startY)&&de(e.endX)&&de(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,$e("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."))},At.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,n=r.cy,a=n.hasCompoundNodes(),i={map:new Ir,get:function(E){var _=this.map.get(E[0]);return _!=null?_.get(E[1]):null},set:function(E,_){var S=this.map.get(E[0]);S==null&&(S=new Ir,this.map.set(E[0],S)),S.set(E[1],_)}},o=[],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 h=f==="unbundled-bezier"||f.endsWith("segments")||f==="straight"||f==="straight-triangle"||f.endsWith("taxi"),v=f==="unbundled-bezier"||f==="bezier",p=d.source,g=d.target,y=p.poolIndex(),m=g.poolIndex(),b=[y,m].sort(),w=i.get(b);w==null&&(w={eles:[]},i.set(b,w),o.push(b)),w.eles.push(u),h&&(w.hasUnbundled=!0),v&&(w.hasBezier=!0)}}for(var C=function(E){var _=o[E],S=i.get(_),T=void 0;if(!S.hasUnbundled){var N=S.eles[0].parallelEdges().filter(function(te){return te.isBundledBezier()});qu(S.eles),N.forEach(function(te){return S.eles.push(te)}),S.eles.sort(function(te,Z){return te.poolIndex()-Z.poolIndex()})}var B=S.eles[0],P=B.source(),D=B.target();if(P.poolIndex()>D.poolIndex()){var R=P;P=D,D=R}var O=S.srcPos=P.position(),F=S.tgtPos=D.position(),A=S.srcW=P.outerWidth(),z=S.srcH=P.outerHeight(),j=S.tgtW=D.outerWidth(),H=S.tgtH=D.outerHeight(),G=S.srcShape=r.nodeShapes[e.getNodeShape(P)],X=S.tgtShape=r.nodeShapes[e.getNodeShape(D)],M=S.srcCornerRadius=P.pstyle("corner-radius").value==="auto"?"auto":P.pstyle("corner-radius").pfValue,V=S.tgtCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,q=S.tgtRs=D._private.rscratch,$=S.srcRs=P._private.rscratch;S.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var K=0;K<S.eles.length;K++){var L=S.eles[K],W=L[0]._private.rscratch,Y=L.pstyle("curve-style").value,se=Y==="unbundled-bezier"||Y.endsWith("segments")||Y.endsWith("taxi"),ue=!P.same(L.source());if(!S.calculatedIntersection&&P!==D&&(S.hasBezier||S.hasUnbundled)){S.calculatedIntersection=!0;var ae=G.intersectLine(O.x,O.y,A,z,F.x,F.y,0,M,$),ne=S.srcIntn=ae,ce=X.intersectLine(F.x,F.y,j,H,O.x,O.y,0,V,q),ie=S.tgtIntn=ce,fe=S.intersectionPts={x1:ae[0],x2:ce[0],y1:ae[1],y2:ce[1]},pe=S.posPts={x1:O.x,x2:F.x,y1:O.y,y2:F.y},Pe=ce[1]-ae[1],Ie=ce[0]-ae[0],we=Math.sqrt(Ie*Ie+Pe*Pe),xe=S.vector={x:Ie,y:Pe},re=S.vectorNorm={x:xe.x/we,y:xe.y/we},I={x:-re.y,y:re.x};S.nodesOverlap=!de(we)||X.checkPoint(ae[0],ae[1],0,j,H,F.x,F.y,V,q)||G.checkPoint(ce[0],ce[1],0,A,z,O.x,O.y,M,$),S.vectorNormInverse=I,T={nodesOverlap:S.nodesOverlap,dirCounts:S.dirCounts,calculatedIntersection:!0,hasBezier:S.hasBezier,hasUnbundled:S.hasUnbundled,eles:S.eles,srcPos:F,tgtPos:O,srcW:j,srcH:H,tgtW:A,tgtH:z,srcIntn:ie,tgtIntn:ne,srcShape:X,tgtShape:G,posPts:{x1:pe.x2,y1:pe.y2,x2:pe.x1,y2:pe.y1},intersectionPts:{x1:fe.x2,y1:fe.y2,x2:fe.x1,y2:fe.y1},vector:{x:-xe.x,y:-xe.y},vectorNorm:{x:-re.x,y:-re.y},vectorNormInverse:{x:-I.x,y:-I.y}}}var U=ue?T:S;W.nodesOverlap=U.nodesOverlap,W.srcIntn=U.srcIntn,W.tgtIntn=U.tgtIntn,W.isRound=Y.startsWith("round"),a&&(P.isParent()||P.isChild()||D.isParent()||D.isChild())&&(P.parents().anySame(D)||D.parents().anySame(P)||P.same(D)&&P.isParent())?e.findCompoundLoopPoints(L,U,K,se):P===D?e.findLoopPoints(L,U,K,se):Y.endsWith("segments")?e.findSegmentsPoints(L,U):Y.endsWith("taxi")?e.findTaxiPoints(L,U):Y==="straight"||!se&&S.eles.length%2===1&&K===Math.floor(S.eles.length/2)?e.findStraightEdgePoints(L):e.findBezierPoints(L,U,K,se,ue),e.findEndpoints(L),e.tryToCorrectInvalidPoints(L,U),e.checkForInvalidEdgeWarning(L),e.storeAllpts(L),e.storeEdgeProjections(L),e.calculateArrowAngles(L),e.recalculateEdgeLabelProjections(L),e.calculateLabelAngles(L)}},x=0;x<o.length;x++)C(x);this.findHaystackPoints(l)}};function K1(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}}At.getSegmentPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="segments")return this.recalculateRenderedStyle(t),K1(e.segpts)},At.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),K1(e.ctrlpts)},At.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var mo={};mo.manualEndptToPx=function(t,e){var r=this,n=t.position(),a=t.outerWidth(),i=t.outerHeight(),o=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,o)}},mo.findEndpoints=function(t){var e=this,r,n=t.source()[0],a=t.target()[0],i=n.position(),o=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,h=a._private.rscratch,v=t.pstyle("curve-style").value,p=t._private.rscratch,g=p.edgeType,y=v==="taxi",m=g==="self"||g==="compound",b=g==="bezier"||g==="multibezier"||m,w=g!=="bezier",C=g==="straight"||g==="segments",x=g==="segments",k=b||w||C,E=m||y,_=t.pstyle("source-endpoint"),S=E?"outside-to-node":_.value,T=n.pstyle("corner-radius").value==="auto"?"auto":n.pstyle("corner-radius").pfValue,N=t.pstyle("target-endpoint"),B=E?"outside-to-node":N.value,P=a.pstyle("corner-radius").value==="auto"?"auto":a.pstyle("corner-radius").pfValue;p.srcManEndpt=_,p.tgtManEndpt=N;var D,R,O,F;if(b){var A=[p.ctrlpts[0],p.ctrlpts[1]],z=w?[p.ctrlpts[p.ctrlpts.length-2],p.ctrlpts[p.ctrlpts.length-1]]:A;D=z,R=A}else if(C){var j=x?p.segpts.slice(0,2):[o.x,o.y],H=x?p.segpts.slice(p.segpts.length-2):[i.x,i.y];D=H,R=j}if(B==="inside-to-node")r=[o.x,o.y];else if(N.units)r=this.manualEndptToPx(a,N);else if(B==="outside-to-line")r=p.tgtIntn;else if(B==="outside-to-node"||B==="outside-to-node-or-label"?O=D:(B==="outside-to-line"||B==="outside-to-line-or-label")&&(O=[i.x,i.y]),r=e.nodeShapes[this.getNodeShape(a)].intersectLine(o.x,o.y,a.outerWidth(),a.outerHeight(),O[0],O[1],0,P,h),B==="outside-to-node-or-label"||B==="outside-to-line-or-label"){var G=a._private.rscratch,X=G.labelWidth,M=G.labelHeight,V=G.labelX,q=G.labelY,$=X/2,K=M/2,L=a.pstyle("text-valign").value;L==="top"?q-=K:L==="bottom"&&(q+=K);var W=a.pstyle("text-halign").value;W==="left"?V-=$:W==="right"&&(V+=$);var Y=ro(O[0],O[1],[V-$,q-K,V+$,q-K,V+$,q+K,V-$,q+K],o.x,o.y);if(Y.length>0){var se=i,ue=Qn(se,Va(r)),ae=Qn(se,Va(Y)),ne=ue;if(ae<ue&&(r=Y,ne=ae),Y.length>2){var ce=Qn(se,{x:Y[2],y:Y[3]});ce<ne&&(r=[Y[2],Y[3]])}}}var ie=Ss(r,D,e.arrowShapes[l].spacing(t)+u),fe=Ss(r,D,e.arrowShapes[l].gap(t)+u);if(p.endX=fe[0],p.endY=fe[1],p.arrowEndX=ie[0],p.arrowEndY=ie[1],S==="inside-to-node")r=[i.x,i.y];else if(_.units)r=this.manualEndptToPx(n,_);else if(S==="outside-to-line")r=p.srcIntn;else if(S==="outside-to-node"||S==="outside-to-node-or-label"?F=R:(S==="outside-to-line"||S==="outside-to-line-or-label")&&(F=[o.x,o.y]),r=e.nodeShapes[this.getNodeShape(n)].intersectLine(i.x,i.y,n.outerWidth(),n.outerHeight(),F[0],F[1],0,T,f),S==="outside-to-node-or-label"||S==="outside-to-line-or-label"){var pe=n._private.rscratch,Pe=pe.labelWidth,Ie=pe.labelHeight,we=pe.labelX,xe=pe.labelY,re=Pe/2,I=Ie/2,U=n.pstyle("text-valign").value;U==="top"?xe-=I:U==="bottom"&&(xe+=I);var te=n.pstyle("text-halign").value;te==="left"?we-=re:te==="right"&&(we+=re);var Z=ro(F[0],F[1],[we-re,xe-I,we+re,xe-I,we+re,xe+I,we-re,xe+I],i.x,i.y);if(Z.length>0){var J=o,le=Qn(J,Va(r)),ee=Qn(J,Va(Z)),oe=le;if(ee<le&&(r=[Z[0],Z[1]],oe=ee),Z.length>2){var me=Qn(J,{x:Z[2],y:Z[3]});me<oe&&(r=[Z[2],Z[3]])}}}var be=Ss(r,R,e.arrowShapes[c].spacing(t)+d),ye=Ss(r,R,e.arrowShapes[c].gap(t)+d);p.startX=ye[0],p.startY=ye[1],p.arrowStartX=be[0],p.arrowStartY=be[1],k&&(!de(p.startX)||!de(p.startY)||!de(p.endX)||!de(p.endY)?p.badLine=!0:p.badLine=!1)},mo.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}}},mo.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 xc={};function d3(t,e,r){for(var n=function(u,d,f,h){return bt(u,d,f,h)},a=e._private,i=a.rstyle.bezierPts,o=0;o<t.bezierProjPcts.length;o++){var l=t.bezierProjPcts[o];i.push({x:n(r[0],r[2],r[4],l),y:n(r[1],r[3],r[5],l)})}}xc.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)d3(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 o=r.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth},xc.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var Or={};Or.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!mn(e)){var r,n,a=t._private,i=t.width(),o=t.height(),l=t.padding(),c=t.position(),u=t.pstyle("text-halign").strValue,d=t.pstyle("text-valign").strValue,f=a.rscratch,h=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-o/2-l;break;case"bottom":n=c.y+o/2+l;break;default:n=c.y}f.labelX=r,f.labelY=n,h.labelX=r,h.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var G1=function(e,r){var n=Math.atan(r/e);return e===0&&n<0&&(n=n*-1),n},U1=function(e,r){var n=r.x-e.x,a=r.y-e.y;return G1(n,a)},f3=function(e,r,n,a){var i=eo(0,a-.001,1),o=eo(0,a+.001,1),l=qa(e,r,n,i),c=qa(e,r,n,o);return U1(l,c)};Or.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 o=function(f,h,v){wn(r.rscratch,f,h,v),wn(r.rstyle,f,h,v)};o("labelX",null,e.x),o("labelY",null,e.y);var l=G1(n.midDispX,n.midDispY);o("labelAutoAngle",null,l);var c=function d(){if(d.cache)return d.cache;for(var f=[],h=0;h+5<n.allpts.length;h+=4){var v={x:n.allpts[h],y:n.allpts[h+1]},p={x:n.allpts[h+2],y:n.allpts[h+3]},g={x:n.allpts[h+4],y:n.allpts[h+5]};f.push({p0:v,p1:p,p2:g,startDist:0,length:0,segments:[]})}var y=r.rstyle.bezierPts,m=a.bezierProjPcts.length;function b(E,_,S,T,N){var B=Jn(_,S),P=E.segments[E.segments.length-1],D={p0:_,p1:S,t0:T,t1:N,startDist:P?P.startDist+P.length:0,length:B};E.segments.push(D),E.length+=B}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 k=0;k<m-1;k++)b(C,y[w*m+k],y[w*m+k+1],a.bezierProjPcts[k],a.bezierProjPcts[k+1]);b(C,y[w*m+m-1],C.p2,a.bezierProjPcts[m-1],1)}return d.cache=f},u=function(f){var h,v=f==="source";if(i[f]){var p=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 k=C.segments[v?x:C.segments.length-1-x],E=w===g.length-1&&x===C.segments.length-1;if(m=b,b+=k.length,b>=p||E){y={cp:C,segment:k};break}}if(y)break}var _=y.cp,S=y.segment,T=(p-m)/S.length,N=S.t1-S.t0,B=v?S.t0+N*T:S.t1-N*T;B=eo(0,B,1),e=qa(_.p0,_.p1,_.p2,B),h=f3(_.p0,_.p1,_.p2,B);break}case"straight":case"segments":case"haystack":{for(var P=0,D,R,O,F,A=n.allpts.length,z=0;z+3<A&&(v?(O={x:n.allpts[z],y:n.allpts[z+1]},F={x:n.allpts[z+2],y:n.allpts[z+3]}):(O={x:n.allpts[A-2-z],y:n.allpts[A-1-z]},F={x:n.allpts[A-4-z],y:n.allpts[A-3-z]}),D=Jn(O,F),R=P,P+=D,!(P>=p));z+=2);var j=p-R,H=j/D;H=eo(0,H,1),e=m5(O,F,H),h=U1(O,F);break}}o("labelX",f,e.x),o("labelY",f,e.y),o("labelAutoAngle",f,h)}};u("source"),u("target"),this.applyLabelDimensions(t)}},Or.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},Or.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),a=this.calculateLabelDimensions(t,n),i=t.pstyle("line-height").pfValue,o=t.pstyle("text-wrap").strValue,l=gr(r.rscratch,"labelWrapCachedLines",e)||[],c=o!=="wrap"?1:Math.max(l.length,1),u=a.height/c,d=u*i,f=a.width,h=a.height+(c-1)*(i-1)*u;wn(r.rstyle,"labelWidth",e,f),wn(r.rscratch,"labelWidth",e,f),wn(r.rstyle,"labelHeight",e,h),wn(r.rscratch,"labelHeight",e,h),wn(r.rscratch,"labelLineHeight",e,d)},Or.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",a=t.pstyle(n+"label").strValue,i=t.pstyle("text-transform").value,o=function(X,M){return M?(wn(r.rscratch,X,e,M),M):gr(r.rscratch,X,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=o("labelKey");if(c!=null&&o("labelWrapKey")===c)return o("labelWrapCachedText");for(var u="​",d=a.split(`
42
+ `),f=t.pstyle("text-max-width").pfValue,h=t.pstyle("text-overflow-wrap").value,v=h==="anywhere",p=[],g=/[\s\u200b]+|$/g,y=0;y<d.length;y++){var m=d[y],b=this.calculateLabelDimensions(t,m),w=b.width;if(v){var C=m.split("").join(u);m=C}if(w>f){var x=m.matchAll(g),k="",E=0,_=T0(x),S;try{for(_.s();!(S=_.n()).done;){var T=S.value,N=T[0],B=m.substring(E,T.index);E=T.index+N.length;var P=k.length===0?B:k+B+N,D=this.calculateLabelDimensions(t,P),R=D.width;R<=f?k+=B+N:(k&&p.push(k),k=B+N)}}catch(G){_.e(G)}finally{_.f()}k.match(/^[\s\u200b]+$/)||p.push(k)}else p.push(m)}o("labelWrapCachedLines",p),a=o("labelWrapCachedText",p.join(`
43
+ `)),o("labelWrapKey",c)}else if(l==="ellipsis"){var O=t.pstyle("text-max-width").pfValue,F="",A="…",z=!1;if(this.calculateLabelDimensions(t,a).width<O)return a;for(var j=0;j<a.length;j++){var H=this.calculateLabelDimensions(t,F+a[j]+A).width;if(H>O)break;F+=a[j],j===a.length-1&&(z=!0)}return z||(F+=A),F}return a},Or.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},Or.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),a=n.document,i=Xn(e,t._private.labelDimsKey),o=r.labelDimCache||(r.labelDimCache=[]),l=o[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,h=t.pstyle("font-weight").strValue,v=this.labelCalcCanvas,p=this.labelCalcCanvasContext;if(!v){v=this.labelCalcCanvas=a.createElement("canvas"),p=this.labelCalcCanvasContext=v.getContext("2d");var g=v.style;g.position="absolute",g.left="-9999px",g.top="-9999px",g.zIndex="-1",g.visibility="hidden",g.pointerEvents="none"}p.font="".concat(u," ").concat(h," ").concat(d,"px ").concat(f);for(var y=0,m=0,b=e.split(`
44
+ `),w=0;w<b.length;w++){var C=b[w],x=p.measureText(C),k=Math.ceil(x.width),E=d;y=Math.max(k,y),m+=E}return y+=c,m+=c,o[i]={width:y,height:m}},Or.calculateLabelAngle=function(t,e){var r=t._private,n=r.rscratch,a=t.isEdge(),i=e?e+"-":"",o=t.pstyle(i+"text-rotation"),l=o.strValue;return l==="none"?0:a&&l==="autorotate"?n.labelAutoAngle:l==="autorotate"?0:o.pfValue},Or.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 j1={},W1=28,Y1=!1;j1.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<W1||t.height()<W1))return Y1||($e("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Y1=!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 rl={};rl.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,n=function(o){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),l)for(var c=0;c<o.length;c++){var u=o[c],d=u._private,f=d.rstyle;f.clean=!1,f.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(o){var l=o.target;n(l)}).on("style.* background.*",function(o){var l=o.target;n(l,!1)});var a=function(o){if(o){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 h=l[f];h(o,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){a(!0)},r.beforeRender(a,r.beforeRenderPriorities.eleCalcs)},rl.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)},rl.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 o=t[i],l=o._private,c=l.rstyle;o.isEdge()&&(!r(o.source())||!r(o.target()))&&(c.clean=!1),!(e&&c.clean||o.removed())&&o.pstyle("display").value!=="none"&&(l.group==="nodes"?a.push(o):n.push(o),c.clean=!0)}for(var u=0;u<a.length;u++){var d=a[u],f=d._private,h=f.rstyle,v=d.position();this.recalculateNodeLabelProjection(d),h.nodeX=v.x,h.nodeY=v.y,h.nodeW=d.pstyle("width").pfValue,h.nodeH=d.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var p=0;p<n.length;p++){var g=n[p],y=g._private,m=y.rstyle,b=y.rscratch;m.srcX=b.arrowStartX,m.srcY=b.arrowStartY,m.tgtX=b.arrowEndX,m.tgtY=b.arrowEndY,m.midX=b.midX,m.midY=b.midY,m.labelAngle=b.labelAngle,m.sourceLabelAngle=b.sourceLabelAngle,m.targetLabelAngle=b.targetLabelAngle}}};var nl={};nl.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)}}},nl.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},nl.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(d1),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var Z1={};[ia,Qs,At,mo,xc,Or,j1,rl,nl].forEach(function(t){Se(Z1,t)});var X1={};X1.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 o=i.image=new Image;o.addEventListener("load",r),o.addEventListener("error",function(){o.error=!0});var l="data:",c=t.substring(0,l.length).toLowerCase()===l;return c||(e=e==="null"?null:e,o.crossOrigin=e),o.src=t,o};var ii={};ii.registerBinding=function(t,e,r,n){var a=Array.prototype.slice.apply(arguments,[1]),i=this.binder(t);return i.on.apply(i,a)},ii.binder=function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||FF(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 o=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:o,addEventListener:o,addListener:o,bind:o}},ii.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()},ii.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()},ii.load=function(){var t=this,e=t.cy.window(),r=function(I){return I.selected()},n=function(I,U,te,Z){I==null&&(I=t.cy);for(var J=0;J<U.length;J++){var le=U[J];I.emit({originalEvent:te,type:le,position:Z})}},a=function(I){return I.shiftKey||I.metaKey||I.ctrlKey},i=function(I,U){var te=!0;if(t.cy.hasCompoundNodes()&&I&&I.pannable())for(var Z=0;U&&Z<U.length;Z++){var I=U[Z];if(I.isNode()&&I.isParent()&&!I.pannable()){te=!1;break}}else te=!0;return te},o=function(I){I[0]._private.grabbed=!0},l=function(I){I[0]._private.grabbed=!1},c=function(I){I[0]._private.rscratch.inDragLayer=!0},u=function(I){I[0]._private.rscratch.inDragLayer=!1},d=function(I){I[0]._private.rscratch.isGrabTarget=!0},f=function(I){I[0]._private.rscratch.isGrabTarget=!1},h=function(I,U){var te=U.addToList,Z=te.has(I);!Z&&I.grabbable()&&!I.locked()&&(te.merge(I),o(I))},v=function(I,U){if(I.cy().hasCompoundNodes()&&!(U.inDragLayer==null&&U.addToList==null)){var te=I.descendants();U.inDragLayer&&(te.forEach(c),te.connectedEdges().forEach(c)),U.addToList&&h(te,U)}},p=function(I,U){U=U||{};var te=I.cy().hasCompoundNodes();U.inDragLayer&&(I.forEach(c),I.neighborhood().stdFilter(function(Z){return!te||Z.isEdge()}).forEach(c)),U.addToList&&I.forEach(function(Z){h(Z,U)}),v(I,U),m(I,{inDragLayer:U.inDragLayer}),t.updateCachedGrabbedEles()},g=p,y=function(I){I&&(t.getCachedZSortedEles().forEach(function(U){l(U),u(U),f(U)}),t.updateCachedGrabbedEles())},m=function(I,U){if(!(U.inDragLayer==null&&U.addToList==null)&&I.cy().hasCompoundNodes()){var te=I.ancestors().orphans();if(!te.same(I)){var Z=te.descendants().spawnSelf().merge(te).unmerge(I).unmerge(I.descendants()),J=Z.connectedEdges();U.inDragLayer&&(J.forEach(c),Z.forEach(c)),U.addToList&&Z.forEach(function(le){h(le,U)})}}},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(re){for(var I=0;I<re.length;I++){var U=re[I],te=U.removedNodes;if(te)for(var Z=0;Z<te.length;Z++){var J=te[Z];if(J===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(re){t.destroy()});var x=ps(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 k=function(I,U){for(;I!=null;)U(I),I=I.parentNode},E=function(){t.invalidateContainerClientCoordsCache()};k(t.container,function(re){t.registerBinding(re,"transitionend",E),t.registerBinding(re,"animationend",E),t.registerBinding(re,"scroll",E)}),t.registerBinding(t.container,"contextmenu",function(re){re.preventDefault()});var _=function(){return t.selection[4]!==0},S=function(I){for(var U=t.findContainerClientCoords(),te=U[0],Z=U[1],J=U[2],le=U[3],ee=I.touches?I.touches:[I],oe=!1,me=0;me<ee.length;me++){var be=ee[me];if(te<=be.clientX&&be.clientX<=te+J&&Z<=be.clientY&&be.clientY<=Z+le){oe=!0;break}}if(!oe)return!1;for(var ye=t.container,_e=I.target,ge=_e.parentNode,Ce=!1;ge;){if(ge===ye){Ce=!0;break}ge=ge.parentNode}return!!Ce};t.registerBinding(t.container,"mousedown",function(I){if(S(I)&&!(t.hoverData.which===1&&I.which!==1)){I.preventDefault(),b(),t.hoverData.capture=!0,t.hoverData.which=I.which;var U=t.cy,te=[I.clientX,I.clientY],Z=t.projectIntoViewport(te[0],te[1]),J=t.selection,le=t.findNearestElements(Z[0],Z[1],!0,!1),ee=le[0],oe=t.dragData.possibleDragElements;t.hoverData.mdownPos=Z,t.hoverData.mdownGPos=te;var me=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var je=t.hoverData.down;je?je.emit({originalEvent:I,type:"taphold",position:{x:Z[0],y:Z[1]}}):U.emit({originalEvent:I,type:"taphold",position:{x:Z[0],y:Z[1]}})}},t.tapholdDuration)};if(I.which==3){t.hoverData.cxtStarted=!0;var be={originalEvent:I,type:"cxttapstart",position:{x:Z[0],y:Z[1]}};ee?(ee.activate(),ee.emit(be),t.hoverData.down=ee):U.emit(be),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(I.which==1){ee&&ee.activate();{if(ee!=null&&t.nodeIsGrabbable(ee)){var ye=function(je){return{originalEvent:I,type:je,position:{x:Z[0],y:Z[1]}}},_e=function(je){je.emit(ye("grab"))};if(d(ee),!ee.selected())oe=t.dragData.possibleDragElements=U.collection(),g(ee,{addToList:oe}),ee.emit(ye("grabon")).emit(ye("grab"));else{oe=t.dragData.possibleDragElements=U.collection();var ge=U.$(function(Ce){return Ce.isNode()&&Ce.selected()&&t.nodeIsGrabbable(Ce)});p(ge,{addToList:oe}),ee.emit(ye("grabon")),ge.forEach(_e)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=ee,t.hoverData.downs=le,t.hoverData.downTime=new Date().getTime()}n(ee,["mousedown","tapstart","vmousedown"],I,{x:Z[0],y:Z[1]}),ee==null?(J[4]=1,t.data.bgActivePosistion={x:Z[0],y:Z[1]},t.redrawHint("select",!0),t.redraw()):ee.pannable()&&(J[4]=1),me()}J[0]=J[2]=Z[0],J[1]=J[3]=Z[1]}},!1),t.registerBinding(e,"mousemove",function(I){var U=t.hoverData.capture;if(!(!U&&!S(I))){var te=!1,Z=t.cy,J=Z.zoom(),le=[I.clientX,I.clientY],ee=t.projectIntoViewport(le[0],le[1]),oe=t.hoverData.mdownPos,me=t.hoverData.mdownGPos,be=t.selection,ye=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(ye=t.findNearestElement(ee[0],ee[1],!0,!1));var _e=t.hoverData.last,ge=t.hoverData.down,Ce=[ee[0]-be[2],ee[1]-be[3]],je=t.dragData.possibleDragElements,qe;if(me){var st=le[0]-me[0],lt=st*st,tt=le[1]-me[1],Rt=tt*tt,mt=lt+Rt;t.hoverData.isOverThresholdDrag=qe=mt>=t.desktopTapThreshold2}var wt=a(I);qe&&(t.hoverData.tapholdCancelled=!0);var Jt=function(){var Q=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Q.length===0?(Q.push(Ce[0]),Q.push(Ce[1])):(Q[0]+=Ce[0],Q[1]+=Ce[1])};te=!0,n(ye,["mousemove","vmousemove","tapdrag"],I,{x:ee[0],y:ee[1]});var Lt=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||Z.emit({originalEvent:I,type:"boxstart",position:{x:ee[0],y:ee[1]}}),be[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(qe){var Ft={originalEvent:I,type:"cxtdrag",position:{x:ee[0],y:ee[1]}};ge?ge.emit(Ft):Z.emit(Ft),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||ye!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:I,type:"cxtdragout",position:{x:ee[0],y:ee[1]}}),t.hoverData.cxtOver=ye,ye&&ye.emit({originalEvent:I,type:"cxtdragover",position:{x:ee[0],y:ee[1]}}))}}else if(t.hoverData.dragging){if(te=!0,Z.panningEnabled()&&Z.userPanningEnabled()){var lr;if(t.hoverData.justStartedPan){var Cr=t.hoverData.mdownPos;lr={x:(ee[0]-Cr[0])*J,y:(ee[1]-Cr[1])*J},t.hoverData.justStartedPan=!1}else lr={x:Ce[0]*J,y:Ce[1]*J};Z.panBy(lr),Z.emit("dragpan"),t.hoverData.dragged=!0}ee=t.projectIntoViewport(I.clientX,I.clientY)}else if(be[4]==1&&(ge==null||ge.pannable())){if(qe){if(!t.hoverData.dragging&&Z.boxSelectionEnabled()&&(wt||!Z.panningEnabled()||!Z.userPanningEnabled()))Lt();else if(!t.hoverData.selecting&&Z.panningEnabled()&&Z.userPanningEnabled()){var jt=i(ge,t.hoverData.downs);jt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,be[4]=0,t.data.bgActivePosistion=Va(oe),t.redrawHint("select",!0),t.redraw())}ge&&ge.pannable()&&ge.active()&&ge.unactivate()}}else{if(ge&&ge.pannable()&&ge.active()&&ge.unactivate(),(!ge||!ge.grabbed())&&ye!=_e&&(_e&&n(_e,["mouseout","tapdragout"],I,{x:ee[0],y:ee[1]}),ye&&n(ye,["mouseover","tapdragover"],I,{x:ee[0],y:ee[1]}),t.hoverData.last=ye),ge)if(qe){if(Z.boxSelectionEnabled()&&wt)ge&&ge.grabbed()&&(y(je),ge.emit("freeon"),je.emit("free"),t.dragData.didDrag&&(ge.emit("dragfreeon"),je.emit("dragfree"))),Lt();else if(ge&&ge.grabbed()&&t.nodeIsDraggable(ge)){var rt=!t.dragData.didDrag;rt&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(je,{inDragLayer:!0});var ut={x:0,y:0};if(de(Ce[0])&&de(Ce[1])&&(ut.x+=Ce[0],ut.y+=Ce[1],rt)){var Ct=t.hoverData.dragDelta;Ct&&de(Ct[0])&&de(Ct[1])&&(ut.x+=Ct[0],ut.y+=Ct[1])}t.hoverData.draggingEles=!0,je.silentShift(ut).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else Jt();te=!0}if(be[2]=ee[0],be[3]=ee[1],te)return I.stopPropagation&&I.stopPropagation(),I.preventDefault&&I.preventDefault(),!1}},!1);var T,N,B;t.registerBinding(e,"mouseup",function(I){if(!(t.hoverData.which===1&&I.which!==1&&t.hoverData.capture)){var U=t.hoverData.capture;if(U){t.hoverData.capture=!1;var te=t.cy,Z=t.projectIntoViewport(I.clientX,I.clientY),J=t.selection,le=t.findNearestElement(Z[0],Z[1],!0,!1),ee=t.dragData.possibleDragElements,oe=t.hoverData.down,me=a(I);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,oe&&oe.unactivate(),t.hoverData.which===3){var be={originalEvent:I,type:"cxttapend",position:{x:Z[0],y:Z[1]}};if(oe?oe.emit(be):te.emit(be),!t.hoverData.cxtDragged){var ye={originalEvent:I,type:"cxttap",position:{x:Z[0],y:Z[1]}};oe?oe.emit(ye):te.emit(ye)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(n(le,["mouseup","tapend","vmouseup"],I,{x:Z[0],y:Z[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(n(oe,["click","tap","vclick"],I,{x:Z[0],y:Z[1]}),N=!1,I.timeStamp-B<=te.multiClickDebounceTime()?(T&&clearTimeout(T),N=!0,B=null,n(oe,["dblclick","dbltap","vdblclick"],I,{x:Z[0],y:Z[1]})):(T=setTimeout(function(){N||n(oe,["oneclick","onetap","voneclick"],I,{x:Z[0],y:Z[1]})},te.multiClickDebounceTime()),B=I.timeStamp)),oe==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(I)&&(te.$(r).unselect(["tapunselect"]),ee.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=ee=te.collection()),le==oe&&!t.dragData.didDrag&&!t.hoverData.selecting&&le!=null&&le._private.selectable&&(t.hoverData.dragging||(te.selectionType()==="additive"||me?le.selected()?le.unselect(["tapunselect"]):le.select(["tapselect"]):me||(te.$(r).unmerge(le).unselect(["tapunselect"]),le.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var _e=te.collection(t.getAllInBox(J[0],J[1],J[2],J[3]));t.redrawHint("select",!0),_e.length>0&&t.redrawHint("eles",!0),te.emit({type:"boxend",originalEvent:I,position:{x:Z[0],y:Z[1]}});var ge=function(qe){return qe.selectable()&&!qe.selected()};te.selectionType()==="additive"||me||te.$(r).unmerge(_e).unselect(),_e.emit("box").stdFilter(ge).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!J[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Ce=oe&&oe.grabbed();y(ee),Ce&&(oe.emit("freeon"),ee.emit("free"),t.dragData.didDrag&&(oe.emit("dragfreeon"),ee.emit("dragfree")))}}J[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 P=function(I){if(!t.scrollingPage){var U=t.cy,te=U.zoom(),Z=U.pan(),J=t.projectIntoViewport(I.clientX,I.clientY),le=[J[0]*te+Z.x,J[1]*te+Z.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||_()){I.preventDefault();return}if(U.panningEnabled()&&U.userPanningEnabled()&&U.zoomingEnabled()&&U.userZoomingEnabled()){I.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 ee;I.deltaY!=null?ee=I.deltaY/-250:I.wheelDeltaY!=null?ee=I.wheelDeltaY/1e3:ee=I.wheelDelta/1e3,ee=ee*t.wheelSensitivity;var oe=I.deltaMode===1;oe&&(ee*=33);var me=U.zoom()*Math.pow(10,ee);I.type==="gesturechange"&&(me=t.gestureStartZoom*I.scale),U.zoom({level:me,renderedPosition:{x:le[0],y:le[1]}}),U.emit(I.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",P,!0),t.registerBinding(e,"scroll",function(I){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(I){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||I.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(re){t.hasTouchStarted||P(re)},!0),t.registerBinding(t.container,"mouseout",function(I){var U=t.projectIntoViewport(I.clientX,I.clientY);t.cy.emit({originalEvent:I,type:"mouseout",position:{x:U[0],y:U[1]}})},!1),t.registerBinding(t.container,"mouseover",function(I){var U=t.projectIntoViewport(I.clientX,I.clientY);t.cy.emit({originalEvent:I,type:"mouseover",position:{x:U[0],y:U[1]}})},!1);var D,R,O,F,A,z,j,H,G,X,M,V,q,$=function(I,U,te,Z){return Math.sqrt((te-I)*(te-I)+(Z-U)*(Z-U))},K=function(I,U,te,Z){return(te-I)*(te-I)+(Z-U)*(Z-U)},L;t.registerBinding(t.container,"touchstart",L=function(I){if(t.hasTouchStarted=!0,!!S(I)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var U=t.cy,te=t.touchData.now,Z=t.touchData.earlier;if(I.touches[0]){var J=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);te[0]=J[0],te[1]=J[1]}if(I.touches[1]){var J=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);te[2]=J[0],te[3]=J[1]}if(I.touches[2]){var J=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);te[4]=J[0],te[5]=J[1]}if(I.touches[1]){t.touchData.singleTouchMoved=!0,y(t.dragData.touchDragEles);var le=t.findContainerClientCoords();G=le[0],X=le[1],M=le[2],V=le[3],D=I.touches[0].clientX-G,R=I.touches[0].clientY-X,O=I.touches[1].clientX-G,F=I.touches[1].clientY-X,q=0<=D&&D<=M&&0<=O&&O<=M&&0<=R&&R<=V&&0<=F&&F<=V;var ee=U.pan(),oe=U.zoom();A=$(D,R,O,F),z=K(D,R,O,F),j=[(D+O)/2,(R+F)/2],H=[(j[0]-ee.x)/oe,(j[1]-ee.y)/oe];var me=200,be=me*me;if(z<be&&!I.touches[2]){var ye=t.findNearestElement(te[0],te[1],!0,!0),_e=t.findNearestElement(te[2],te[3],!0,!0);ye&&ye.isNode()?(ye.activate().emit({originalEvent:I,type:"cxttapstart",position:{x:te[0],y:te[1]}}),t.touchData.start=ye):_e&&_e.isNode()?(_e.activate().emit({originalEvent:I,type:"cxttapstart",position:{x:te[0],y:te[1]}}),t.touchData.start=_e):U.emit({originalEvent:I,type:"cxttapstart",position:{x:te[0],y:te[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(I.touches[2])U.boxSelectionEnabled()&&I.preventDefault();else if(!I.touches[1]){if(I.touches[0]){var ge=t.findNearestElements(te[0],te[1],!0,!0),Ce=ge[0];if(Ce!=null&&(Ce.activate(),t.touchData.start=Ce,t.touchData.starts=ge,t.nodeIsGrabbable(Ce))){var je=t.dragData.touchDragEles=U.collection(),qe=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),Ce.selected()?(qe=U.$(function(mt){return mt.selected()&&t.nodeIsGrabbable(mt)}),p(qe,{addToList:je})):g(Ce,{addToList:je}),d(Ce);var st=function(wt){return{originalEvent:I,type:wt,position:{x:te[0],y:te[1]}}};Ce.emit(st("grabon")),qe?qe.forEach(function(mt){mt.emit(st("grab"))}):Ce.emit(st("grab"))}n(Ce,["touchstart","tapstart","vmousedown"],I,{x:te[0],y:te[1]}),Ce==null&&(t.data.bgActivePosistion={x:J[0],y:J[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"],I,{x:te[0],y:te[1]})},t.tapholdDuration)}}if(I.touches.length>=1){for(var lt=t.touchData.startPosition=[null,null,null,null,null,null],tt=0;tt<te.length;tt++)lt[tt]=Z[tt]=te[tt];var Rt=I.touches[0];t.touchData.startGPosition=[Rt.clientX,Rt.clientY]}}},!1);var W;t.registerBinding(e,"touchmove",W=function(I){var U=t.touchData.capture;if(!(!U&&!S(I))){var te=t.selection,Z=t.cy,J=t.touchData.now,le=t.touchData.earlier,ee=Z.zoom();if(I.touches[0]){var oe=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);J[0]=oe[0],J[1]=oe[1]}if(I.touches[1]){var oe=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);J[2]=oe[0],J[3]=oe[1]}if(I.touches[2]){var oe=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);J[4]=oe[0],J[5]=oe[1]}var me=t.touchData.startGPosition,be;if(U&&I.touches[0]&&me){for(var ye=[],_e=0;_e<J.length;_e++)ye[_e]=J[_e]-le[_e];var ge=I.touches[0].clientX-me[0],Ce=ge*ge,je=I.touches[0].clientY-me[1],qe=je*je,st=Ce+qe;be=st>=t.touchTapThreshold2}if(U&&t.touchData.cxt){I.preventDefault();var lt=I.touches[0].clientX-G,tt=I.touches[0].clientY-X,Rt=I.touches[1].clientX-G,mt=I.touches[1].clientY-X,wt=K(lt,tt,Rt,mt),Jt=wt/z,Lt=150,Ft=Lt*Lt,lr=1.5,Cr=lr*lr;if(Jt>=Cr||wt>=Ft){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var jt={originalEvent:I,type:"cxttapend",position:{x:J[0],y:J[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(jt),t.touchData.start=null):Z.emit(jt)}}if(U&&t.touchData.cxt){var jt={originalEvent:I,type:"cxtdrag",position:{x:J[0],y:J[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(jt):Z.emit(jt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var rt=t.findNearestElement(J[0],J[1],!0,!0);(!t.touchData.cxtOver||rt!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:I,type:"cxtdragout",position:{x:J[0],y:J[1]}}),t.touchData.cxtOver=rt,rt&&rt.emit({originalEvent:I,type:"cxtdragover",position:{x:J[0],y:J[1]}}))}else if(U&&I.touches[2]&&Z.boxSelectionEnabled())I.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||Z.emit({originalEvent:I,type:"boxstart",position:{x:J[0],y:J[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,te[4]=1,!te||te.length===0||te[0]===void 0?(te[0]=(J[0]+J[2]+J[4])/3,te[1]=(J[1]+J[3]+J[5])/3,te[2]=(J[0]+J[2]+J[4])/3+1,te[3]=(J[1]+J[3]+J[5])/3+1):(te[2]=(J[0]+J[2]+J[4])/3,te[3]=(J[1]+J[3]+J[5])/3),t.redrawHint("select",!0),t.redraw();else if(U&&I.touches[1]&&!t.touchData.didSelect&&Z.zoomingEnabled()&&Z.panningEnabled()&&Z.userZoomingEnabled()&&Z.userPanningEnabled()){I.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var ut=t.dragData.touchDragEles;if(ut){t.redrawHint("drag",!0);for(var Ct=0;Ct<ut.length;Ct++){var On=ut[Ct]._private;On.grabbed=!1,On.rscratch.inDragLayer=!1}}var Q=t.touchData.start,lt=I.touches[0].clientX-G,tt=I.touches[0].clientY-X,Rt=I.touches[1].clientX-G,mt=I.touches[1].clientY-X,he=$(lt,tt,Rt,mt),Oe=he/A;if(q){var He=lt-D,Fr=tt-R,An=Rt-O,vi=mt-F,an=(He+An)/2,ur=(Fr+vi)/2,Rn=Z.zoom(),Tg=Rn*Oe,Sl=Z.pan(),M_=H[0]*Rn+Sl.x,$_=H[1]*Rn+Sl.y,fG={x:-Tg/Rn*(M_-Sl.x-an)+M_,y:-Tg/Rn*($_-Sl.y-ur)+$_};if(Q&&Q.active()){var ut=t.dragData.touchDragEles;y(ut),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Q.unactivate().emit("freeon"),ut.emit("free"),t.dragData.didDrag&&(Q.emit("dragfreeon"),ut.emit("dragfree"))}Z.viewport({zoom:Tg,pan:fG,cancelOnFailedZoom:!0}),Z.emit("pinchzoom"),A=he,D=lt,R=tt,O=Rt,F=mt,t.pinching=!0}if(I.touches[0]){var oe=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);J[0]=oe[0],J[1]=oe[1]}if(I.touches[1]){var oe=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);J[2]=oe[0],J[3]=oe[1]}if(I.touches[2]){var oe=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);J[4]=oe[0],J[5]=oe[1]}}else if(I.touches[0]&&!t.touchData.didSelect){var Er=t.touchData.start,Ng=t.touchData.last,rt;if(!t.hoverData.draggingEles&&!t.swipePanning&&(rt=t.findNearestElement(J[0],J[1],!0,!0)),U&&Er!=null&&I.preventDefault(),U&&Er!=null&&t.nodeIsDraggable(Er))if(be){var ut=t.dragData.touchDragEles,V_=!t.dragData.didDrag;V_&&p(ut,{inDragLayer:!0}),t.dragData.didDrag=!0;var Bo={x:0,y:0};if(de(ye[0])&&de(ye[1])&&(Bo.x+=ye[0],Bo.y+=ye[1],V_)){t.redrawHint("eles",!0);var xr=t.touchData.dragDelta;xr&&de(xr[0])&&de(xr[1])&&(Bo.x+=xr[0],Bo.y+=xr[1])}t.hoverData.draggingEles=!0,ut.silentShift(Bo).emit("position drag"),t.redrawHint("drag",!0),t.touchData.startPosition[0]==le[0]&&t.touchData.startPosition[1]==le[1]&&t.redrawHint("eles",!0),t.redraw()}else{var xr=t.touchData.dragDelta=t.touchData.dragDelta||[];xr.length===0?(xr.push(ye[0]),xr.push(ye[1])):(xr[0]+=ye[0],xr[1]+=ye[1])}if(n(Er||rt,["touchmove","tapdrag","vmousemove"],I,{x:J[0],y:J[1]}),(!Er||!Er.grabbed())&&rt!=Ng&&(Ng&&Ng.emit({originalEvent:I,type:"tapdragout",position:{x:J[0],y:J[1]}}),rt&&rt.emit({originalEvent:I,type:"tapdragover",position:{x:J[0],y:J[1]}})),t.touchData.last=rt,U)for(var Ct=0;Ct<J.length;Ct++)J[Ct]&&t.touchData.startPosition[Ct]&&be&&(t.touchData.singleTouchMoved=!0);if(U&&(Er==null||Er.pannable())&&Z.panningEnabled()&&Z.userPanningEnabled()){var hG=i(Er,t.touchData.starts);hG&&(I.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=Va(t.touchData.startPosition)),t.swipePanning?(Z.panBy({x:ye[0]*ee,y:ye[1]*ee}),Z.emit("dragpan")):be&&(t.swipePanning=!0,Z.panBy({x:ge*ee,y:je*ee}),Z.emit("dragpan"),Er&&(Er.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var oe=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);J[0]=oe[0],J[1]=oe[1]}}for(var _e=0;_e<J.length;_e++)le[_e]=J[_e];U&&I.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 Y;t.registerBinding(e,"touchcancel",Y=function(I){var U=t.touchData.start;t.touchData.capture=!1,U&&U.unactivate()});var se,ue,ae,ne;if(t.registerBinding(e,"touchend",se=function(I){var U=t.touchData.start,te=t.touchData.capture;if(te)I.touches.length===0&&(t.touchData.capture=!1),I.preventDefault();else return;var Z=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var J=t.cy,le=J.zoom(),ee=t.touchData.now,oe=t.touchData.earlier;if(I.touches[0]){var me=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);ee[0]=me[0],ee[1]=me[1]}if(I.touches[1]){var me=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);ee[2]=me[0],ee[3]=me[1]}if(I.touches[2]){var me=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);ee[4]=me[0],ee[5]=me[1]}U&&U.unactivate();var be;if(t.touchData.cxt){if(be={originalEvent:I,type:"cxttapend",position:{x:ee[0],y:ee[1]}},U?U.emit(be):J.emit(be),!t.touchData.cxtDragged){var ye={originalEvent:I,type:"cxttap",position:{x:ee[0],y:ee[1]}};U?U.emit(ye):J.emit(ye)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!I.touches[2]&&J.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var _e=J.collection(t.getAllInBox(Z[0],Z[1],Z[2],Z[3]));Z[0]=void 0,Z[1]=void 0,Z[2]=void 0,Z[3]=void 0,Z[4]=0,t.redrawHint("select",!0),J.emit({type:"boxend",originalEvent:I,position:{x:ee[0],y:ee[1]}});var ge=function(Ft){return Ft.selectable()&&!Ft.selected()};_e.emit("box").stdFilter(ge).select().emit("boxselect"),_e.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(U!=null&&U.unactivate(),I.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!I.touches[1]){if(!I.touches[0]){if(!I.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ce=t.dragData.touchDragEles;if(U!=null){var je=U._private.grabbed;y(Ce),t.redrawHint("drag",!0),t.redrawHint("eles",!0),je&&(U.emit("freeon"),Ce.emit("free"),t.dragData.didDrag&&(U.emit("dragfreeon"),Ce.emit("dragfree"))),n(U,["touchend","tapend","vmouseup","tapdragout"],I,{x:ee[0],y:ee[1]}),U.unactivate(),t.touchData.start=null}else{var qe=t.findNearestElement(ee[0],ee[1],!0,!0);n(qe,["touchend","tapend","vmouseup","tapdragout"],I,{x:ee[0],y:ee[1]})}var st=t.touchData.startPosition[0]-ee[0],lt=st*st,tt=t.touchData.startPosition[1]-ee[1],Rt=tt*tt,mt=lt+Rt,wt=mt*le*le;t.touchData.singleTouchMoved||(U||J.$(":selected").unselect(["tapunselect"]),n(U,["tap","vclick"],I,{x:ee[0],y:ee[1]}),ue=!1,I.timeStamp-ne<=J.multiClickDebounceTime()?(ae&&clearTimeout(ae),ue=!0,ne=null,n(U,["dbltap","vdblclick"],I,{x:ee[0],y:ee[1]})):(ae=setTimeout(function(){ue||n(U,["onetap","voneclick"],I,{x:ee[0],y:ee[1]})},J.multiClickDebounceTime()),ne=I.timeStamp)),U!=null&&!t.dragData.didDrag&&U._private.selectable&&wt<t.touchTapThreshold2&&!t.pinching&&(J.selectionType()==="single"?(J.$(r).unmerge(U).unselect(["tapunselect"]),U.select(["tapselect"])):U.selected()?U.unselect(["tapunselect"]):U.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var Jt=0;Jt<ee.length;Jt++)oe[Jt]=ee[Jt];t.dragData.didDrag=!1,I.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),I.touches.length<2&&(I.touches.length===1&&(t.touchData.startGPosition=[I.touches[0].clientX,I.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var ce=[],ie=function(I){return{clientX:I.clientX,clientY:I.clientY,force:1,identifier:I.pointerId,pageX:I.pageX,pageY:I.pageY,radiusX:I.width/2,radiusY:I.height/2,screenX:I.screenX,screenY:I.screenY,target:I.target}},fe=function(I){return{event:I,touch:ie(I)}},pe=function(I){ce.push(fe(I))},Pe=function(I){for(var U=0;U<ce.length;U++){var te=ce[U];if(te.event.pointerId===I.pointerId){ce.splice(U,1);return}}},Ie=function(I){var U=ce.filter(function(te){return te.event.pointerId===I.pointerId})[0];U.event=I,U.touch=ie(I)},we=function(I){I.touches=ce.map(function(U){return U.touch})},xe=function(I){return I.pointerType==="mouse"||I.pointerType===4};t.registerBinding(t.container,"pointerdown",function(re){xe(re)||(re.preventDefault(),pe(re),we(re),L(re))}),t.registerBinding(t.container,"pointerup",function(re){xe(re)||(Pe(re),we(re),se(re))}),t.registerBinding(t.container,"pointercancel",function(re){xe(re)||(Pe(re),we(re),Y(re))}),t.registerBinding(t.container,"pointermove",function(re){xe(re)||(re.preventDefault(),Ie(re),we(re),W(re))})}};var Qr={};Qr.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,a,i,o,l,c){this.renderer.nodeShapeImpl("polygon",n,a,i,o,l,this.points)},intersectLine:function(n,a,i,o,l,c,u,d){return ro(l,c,this.points,n,a,i/2,o/2,u)},checkPoint:function(n,a,i,o,l,c,u,d){return Zr(n,a,this.points,c,u,o,l,[0,-1],i)}}},Qr.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,o,l,c){return B5(i,o,e,r,n/2+l,a/2+l)},checkPoint:function(e,r,n,a,i,o,l,c){return ea(e,r,a,i,o,l,n)}}},Qr.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,a,i,o,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=o/2;l=l==="auto"?ob(i,o):l;for(var h=new Array(e.length/2),v=0;v<e.length/2;v++)h[v]={x:n+d*e[v*2],y:a+f*e[v*2+1]};var p,g,y,m,b=h.length;for(g=h[b-1],p=0;p<b;p++)y=h[p%b],m=h[(p+1)%b],c[u][p]=Ec(g,y,m,l),g=y,y=m;return c[u]},draw:function(n,a,i,o,l,c,u){this.renderer.nodeShapeImpl("round-polygon",n,a,i,o,l,this.points,this.getOrCreateCorners(a,i,o,l,c,u,"drawCorners"))},intersectLine:function(n,a,i,o,l,c,u,d,f){return D5(l,c,this.points,n,a,i,o,u,this.getOrCreateCorners(n,a,i,o,d,f,"corners"))},checkPoint:function(n,a,i,o,l,c,u,d,f){return I5(n,a,this.points,c,u,o,l,this.getOrCreateCorners(c,u,o,l,d,f,"corners"))}}},Qr.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Vt(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,o)},intersectLine:function(e,r,n,a,i,o,l,c){return ab(i,o,e,r,n,a,l,c)},checkPoint:function(e,r,n,a,i,o,l,c){var u=a/2,d=i/2;c=c==="auto"?ta(a,i):c,c=Math.min(u,d,c);var f=c*2;return!!(Zr(e,r,this.points,o,l,a,i-f,[0,-1],n)||Zr(e,r,this.points,o,l,a-f,i,[0,-1],n)||ea(e,r,f,f,o-u+c,l-d+c,n)||ea(e,r,f,f,o+u-c,l-d+c,n)||ea(e,r,f,f,o+u-c,l+d-c,n)||ea(e,r,f,f,o-u+c,l+d-c,n))}}},Qr.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:ju(),points:Vt(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,null,o)},generateCutTrianglePts:function(e,r,n,a,i){var o=i==="auto"?this.cornerLength:i,l=r/2,c=e/2,u=n-c,d=n+c,f=a-l,h=a+l;return{topLeft:[u,f+o,u+o,f,u+o,f+o],topRight:[d-o,f,d,f+o,d-o,f+o],bottomRight:[d,h-o,d-o,h,d-o,h-o],bottomLeft:[u+o,h,u,h-o,u+o,h-o]}},intersectLine:function(e,r,n,a,i,o,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 ro(i,o,d,e,r)},checkPoint:function(e,r,n,a,i,o,l,c){var u=c==="auto"?this.cornerLength:c;if(Zr(e,r,this.points,o,l,a,i-2*u,[0,-1],n)||Zr(e,r,this.points,o,l,a-2*u,i,[0,-1],n))return!0;var d=this.generateCutTrianglePts(a,i,o,l);return Gt(e,r,d.topLeft)||Gt(e,r,d.topRight)||Gt(e,r,d.bottomRight)||Gt(e,r,d.bottomLeft)}}},Qr.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Vt(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,o,l,c){var u=.15,d=.5,f=.85,h=this.generateBarrelBezierPts(n+2*l,a+2*l,e,r),v=function(y){var m=qa({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},u),b=qa({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},d),w=qa({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},f);return[y[0],y[1],m.x,m.y,b.x,b.y,w.x,w.y,y[4],y[5]]},p=[].concat(v(h.topLeft),v(h.topRight),v(h.bottomRight),v(h.bottomLeft));return ro(i,o,p,e,r)},generateBarrelBezierPts:function(e,r,n,a){var i=r/2,o=e/2,l=n-o,c=n+o,u=a-i,d=a+i,f=Wu(e,r),h=f.heightOffset,v=f.widthOffset,p=f.ctrlPtOffsetPct*e,g={topLeft:[l,u+h,l+p,u,l+v,u],topRight:[c-v,u,c-p,u,c,u+h],bottomRight:[c,d-h,c-p,d,c-v,d],bottomLeft:[l+v,d,l+p,d,l,d-h]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g},checkPoint:function(e,r,n,a,i,o,l,c){var u=Wu(a,i),d=u.heightOffset,f=u.widthOffset;if(Zr(e,r,this.points,o,l,a,i-2*d,[0,-1],n)||Zr(e,r,this.points,o,l,a-2*f,i,[0,-1],n))return!0;for(var h=this.generateBarrelBezierPts(a,i,o,l),v=function(_,S,T){var N=T[4],B=T[2],P=T[0],D=T[5],R=T[1],O=Math.min(N,P),F=Math.max(N,P),A=Math.min(D,R),z=Math.max(D,R);if(O<=_&&_<=F&&A<=S&&S<=z){var j=P5(N,B,P),H=S5(j[0],j[1],j[2],_),G=H.filter(function(X){return 0<=X&&X<=1});if(G.length>0)return G[0]}return null},p=Object.keys(h),g=0;g<p.length;g++){var y=p[g],m=h[y],b=v(e,r,m);if(b!=null){var w=m[5],C=m[3],x=m[1],k=bt(w,C,x,b);if(m.isTop&&k<=r||m.isBottom&&r<=k)return!0}}return!1}}},Qr.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Vt(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,o)},intersectLine:function(e,r,n,a,i,o,l,c){var u=e-(n/2+l),d=r-(a/2+l),f=d,h=e+(n/2+l),v=Cn(i,o,e,r,u,d,h,f,!1);return v.length>0?v:ab(i,o,e,r,n,a,l,c)},checkPoint:function(e,r,n,a,i,o,l,c){c=c==="auto"?ta(a,i):c;var u=2*c;if(Zr(e,r,this.points,o,l,a,i-u,[0,-1],n)||Zr(e,r,this.points,o,l,a-u,i,[0,-1],n))return!0;var d=a/2+2*n,f=i/2+2*n,h=[o-d,l-f,o-d,l,o+d,l,o+d,l-f];return!!(Gt(e,r,h)||ea(e,r,u,u,o+a/2-c,l+i/2-c,n)||ea(e,r,u,u,o-a/2+c,l+i/2-c,n))}}},Qr.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Vt(3,0)),this.generateRoundPolygon("round-triangle",Vt(3,0)),this.generatePolygon("rectangle",Vt(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",Vt(5,0)),this.generateRoundPolygon("round-pentagon",Vt(5,0)),this.generatePolygon("hexagon",Vt(6,0)),this.generateRoundPolygon("round-hexagon",Vt(6,0)),this.generatePolygon("heptagon",Vt(7,0)),this.generateRoundPolygon("round-heptagon",Vt(7,0)),this.generatePolygon("octagon",Vt(8,0)),this.generateRoundPolygon("round-octagon",Vt(8,0));var n=new Array(20);{var a=Uu(5,0),i=Uu(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var l=0;l<i.length/2;l++)i[l*2]*=o,i[l*2+1]*=o;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=ib(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,h;return(h=this[f])?h:e.generatePolygon(f,u)}};var yo={};yo.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},yo.redraw=function(t){t=t||X0();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},yo.beforeRender=function(t,e){if(!this.destroyed){e==null&&Je("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 J1=function(e,r,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(r,n)};yo.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){J1(t,!0,a);var i=Yr();t.render(t.renderOptions);var o=t.lastDrawTime=Yr();t.averageRedrawTime===void 0&&(t.averageRedrawTime=o-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var l=o-i;t.redrawTotalTime+=l,t.lastRedrawTime=l,t.averageRedrawTime=t.averageRedrawTime/2+l/2,t.requestedFrame=!1}else J1(t,!1,a);t.skipFrame=!1,vs(n)}};vs(r)}};var h3=function(e){this.init(e)},Q1=h3,oi=Q1.prototype;oi.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],oi.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,o="__________cytoscape_stylesheet",l="__________cytoscape_container",c=a.getElementById(o)!=null;if(r.className.indexOf(l)<0&&(r.className=(r.className||"")+" "+l),!c){var u=a.createElement("style");u.id=o,u.textContent="."+l+" { position: relative; }",i.insertBefore(u,i.children[0])}var d=n.getComputedStyle(r),f=d.getPropertyValue("position");f==="static"&&$e("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=de(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()},oi.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()}},oi.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{}},oi.isHeadless=function(){return!1},[mc,Z1,X1,ii,Qr,yo].forEach(function(t){Se(oi,t)});var kc=1e3/60,ew={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=ps(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),o=function(u,d){var f=Yr(),h=a.averageRedrawTime,v=a.lastRedrawTime,p=[],g=a.cy.extent(),y=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var m=Yr(),b=m-f,w=m-d;if(v<kc){var C=kc-(u?h:0);if(w>=e.deqFastCost*C)break}else if(u){if(b>=e.deqCost*v||b>=e.deqAvgCost*h)break}else if(w>=e.deqNoDrawCost*kc)break;var x=e.deq(n,y,g);if(x.length>0)for(var k=0;k<x.length;k++)p.push(x[k]);else break}p.length>0&&(e.onDeqd(n,p),!u&&e.shouldRedraw(n,p,y,g)&&i())},l=e.priority||Vu;a.beforeRender(o,l(n))}}}},p3=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ms;Ou(this,t),this.idsByKey=new Ir,this.keyForId=new Ir,this.cachesByLvl=new Ir,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Au(t,[{key:"getIdsFor",value:function(r){r==null&&Je("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(r);return a||(a=new $a,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 Ir,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}(),tw=25,al=50,il=-4,Sc=3,v3=7.99,g3=8,m3=1024,y3=1024,b3=1024,w3=.2,C3=.8,E3=10,x3=.15,k3=.1,S3=.9,_3=.9,T3=100,N3=1,si={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},I3=St({getKey:null,doesEleInvalidateKey:ms,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:j0,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),bo=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var a=I3(r);Se(n,a),n.lookup=new p3(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},gt=bo.prototype;gt.reasons=si,gt.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},gt.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},gt.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Qi(function(r,n){return n.reqs-r.reqs});return e},gt.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},gt.getElement=function(t,e,r,n,a){var i=this,o=this.renderer,l=o.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(Hu(l*r))),n<il)n=il;else if(l>=v3||n>Sc)return null;var u=Math.pow(2,n),d=e.h*u,f=e.w*u,h=o.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,h))return null;var v=c.get(t,n);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;var p;if(d<=tw?p=tw:d<=al?p=al:p=Math.ceil(d/al)*al,d>b3||f>y3)return null;var g=i.getTextureQueue(p),y=g[g.length-2],m=function(){return i.recycleTexture(p,f)||i.addTexture(p,f)};y||(y=g[g.length-1]),y||(y=m()),y.width-y.usedWidth<f&&(y=m());for(var b=function(O){return O&&O.scaledLabelShown===h},w=a&&a===si.dequeue,C=a&&a===si.highQuality,x=a&&a===si.downscale,k,E=n+1;E<=Sc;E++){var _=c.get(t,E);if(_){k=_;break}}var S=k&&k.level===n+1?k:null,T=function(){y.context.drawImage(S.texture.canvas,S.x,0,S.width,S.height,y.usedWidth,0,f,d)};if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,f,p),b(S))T();else if(b(k))if(C){for(var N=k.level;N>n;N--)S=i.getElement(t,e,r,N,si.downscale);T()}else return i.queueElement(t,k.level-1),k;else{var B;if(!w&&!C&&!x)for(var P=n-1;P>=il;P--){var D=c.get(t,P);if(D){B=D;break}}if(b(B))return i.queueElement(t,n),B;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,h,!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:h},y.usedWidth+=Math.ceil(f+g3),y.eleCaches.push(v),c.set(t,n,v),i.checkTextureFullness(y),v},gt.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])},gt.invalidateElement=function(t){var e=this,r=e.lookup,n=[],a=r.isInvalid(t);if(a){for(var i=il;i<=Sc;i++){var o=r.getForCachedKey(t,i);o&&n.push(o)}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)}},gt.checkTextureUtility=function(t){t.invalidatedWidth>=w3*t.width&&this.retireTexture(t)},gt.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>C3&&t.fullnessChecks>=E3?bn(r,t):t.fullnessChecks++},gt.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),a=this.lookup;bn(n,t),t.retired=!0;for(var i=t.eleCaches,o=0;o<i.length;o++){var l=i[o];a.deleteCache(l.key,l.level)}qu(i);var c=e.getRetiredTextureQueue(r);c.push(t)},gt.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(m3,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},gt.recycleTexture=function(t,e){for(var r=this,n=r.getTextureQueue(t),a=r.getRetiredTextureQueue(t),i=0;i<a.length;i++){var o=a[i];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,qu(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),bn(a,o),n.push(o),o}},gt.queueElement=function(t,e){var r=this,n=r.getElementQueue(),a=r.getElementKeyToQueue(),i=this.getKey(t),o=a[i];if(o)o.level=Math.max(o.level,e),o.eles.merge(t),o.reqs++,n.updateItem(o);else{var l={eles:t.spawn().merge(t),level:e,reqs:1,key:i};n.push(l),a[i]=l}},gt.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,o=0;o<N3&&r.size()>0;o++){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,si.dequeue)}return a},gt.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=$u,r.updateItem(i),r.pop(),n[a]=null):i.eles.unmerge(t))},gt.onDequeue=function(t){this.onDequeues.push(t)},gt.offDequeue=function(t){bn(this.onDequeues,t)},gt.setupDequeueing=ew.setupDequeueing({deqRedrawThreshold:T3,deqCost:x3,deqAvgCost:k3,deqNoDrawCost:S3,deqFastCost:_3,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 o=r[i].eles,l=0;l<o.length;l++){var c=o[l].boundingBox();if(Ku(c,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var B3=1,wo=-4,ol=2,D3=3.99,P3=50,O3=50,A3=.15,R3=.1,L3=.9,F3=.9,M3=1,rw=250,$3=4e3*4e3,V3=!0,nw=function(e){var r=this,n=r.renderer=e,a=n.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Yr()-2*rw,r.skipping=!1,r.eleTxrDeqs=a.collection(),r.scheduleElementRefinement=ps(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},O3),n.beforeRender(function(o,l){l-r.lastInvalidationTime<=rw?r.skipping=!0:r.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(l,c){return c.reqs-l.reqs};r.layersQueue=new Qi(i),r.setupDequeueing()},It=nw.prototype,aw=0,q3=Math.pow(2,53)-1;It.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),o={id:aw=++aw%q3,bb:t,level:e,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},l=o.context,c=-o.bb.x1,u=-o.bb.y1;return l.scale(r,r),l.translate(c,u),o},It.getLayers=function(t,e,r){var n=this,a=n.renderer,i=a.cy,o=i.zoom(),l=n.firstGet;if(n.firstGet=!1,r==null){if(r=Math.ceil(Hu(o*e)),r<wo)r=wo;else if(o>=D3||r>ol)return null}n.validateLayersElesOrdering(r,t);var c=n.layersByLevel,u=Math.pow(2,r),d=c[r]=c[r]||[],f,h=n.levelIsComplete(r,t),v,p=function(){var T=function(R){if(n.validateLayersElesOrdering(R,t),n.levelIsComplete(R,t))return v=c[R],!0},N=function(R){if(!v)for(var O=r+R;wo<=O&&O<=ol&&!T(O);O+=R);};N(1),N(-1);for(var B=d.length-1;B>=0;B--){var P=d[B];P.invalid&&bn(d,P)}};if(!h)p();else return d;var g=function(){if(!f){f=Kt();for(var T=0;T<t.length;T++)tb(f,t[T].boundingBox())}return f},y=function(T){T=T||{};var N=T.after;g();var B=f.w*u*(f.h*u);if(B>$3)return null;var P=n.makeLayer(f,r);if(N!=null){var D=d.indexOf(N)+1;d.splice(D,0,P)}else(T.insert===void 0||T.insert)&&d.unshift(P);return P};if(n.skipping&&!l)return null;for(var m=null,b=t.length/B3,w=!l,C=0;C<t.length;C++){var x=t[C],k=x._private.rscratch,E=k.imgLayerCaches=k.imgLayerCaches||{},_=E[r];if(_){m=_;continue}if((!m||m.eles.length>=b||!nb(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),E[r]=m}return v||(w?null:d)},It.getEleLevelForLayerLevel=function(t,e){return t},It.drawEleInLayer=function(t,e,r,n){var a=this,i=this.renderer,o=t.context,l=e.boundingBox();l.w===0||l.h===0||!e.visible()||(r=a.getEleLevelForLayerLevel(r,n),i.setImgSmoothing(o,!1),i.drawCachedElement(o,e,null,null,r,V3),i.setImgSmoothing(o,!0))},It.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 o=n[i];if(o.reqs>0||o.invalid)return!1;a+=o.eles.length}return a===e.length},It.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,o=0;o<e.length;o++)if(a.eles[0]===e[o]){i=o;break}if(i<0){this.invalidateLayer(a);continue}for(var l=i,o=0;o<a.eles.length;o++)if(a.eles[o]!==e[l+o]){this.invalidateLayer(a);break}}},It.updateElementsInLayers=function(t,e){for(var r=this,n=Ki(t[0]),a=0;a<t.length;a++)for(var i=n?null:t[a],o=n?t[a]:t[a].ele,l=o._private.rscratch,c=l.imgLayerCaches=l.imgLayerCaches||{},u=wo;u<=ol;u++){var d=c[u];d&&(i&&r.getEleLevelForLayerLevel(d.level)!==i.level||e(d,o,i))}},It.haveLayers=function(){for(var t=this,e=!1,r=wo;r<=ol;r++){var n=t.layersByLevel[r];if(n&&n.length>0){e=!0;break}}return e},It.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Yr(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,a,i){e.invalidateLayer(n)}))},It.invalidateLayer=function(t){if(this.lastInvalidationTime=Yr(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];bn(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)}}},It.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(n,a,i){var o=n.replacement;if(o||(o=n.replacement=e.makeLayer(n.bb,n.level),o.replaces=n,o.eles=n.eles),!o.reqs)for(var l=0;l<o.eles.length;l++)e.queueLayer(o,o.eles[l])})},It.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()},It.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))}},It.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],a=0;a<M3&&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 o=i.elesQueue.shift();o&&(e.drawEleInLayer(i,o,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},It.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 o=t.eles[i]._private,l=o.imgLayerCaches=o.imgLayerCaches||{};l&&(l[t.level]=t)}e.requestRedraw()}},It.requestRedraw=ps(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100),It.setupDequeueing=ew.setupDequeueing({deqRedrawThreshold:P3,deqCost:A3,deqAvgCost:R3,deqNoDrawCost:L3,deqFastCost:F3,deq:function(e,r){return e.dequeue(r)},onDeqd:Vu,shouldRedraw:j0,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var iw={},ow;function z3(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function H3(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 sw(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 o=r,l=r[0];t.moveTo(l.x,l.y);for(var a=1;a<o.length;a++){var i=o[a];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}function K3(t,e,r,n,a){t.beginPath&&t.beginPath(),t.arc(r,n,a,0,Math.PI*2,!1);var i=e,o=i[0];t.moveTo(o.x,o.y);for(var l=0;l<i.length;l++){var c=i[l];t.lineTo(c.x,c.y)}t.closePath&&t.closePath()}function G3(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}iw.arrowShapeImpl=function(t){return(ow||(ow={polygon:z3,"triangle-backcurve":H3,"triangle-tee":sw,"circle-triangle":K3,"triangle-cross":sw,circle:G3}))[t]};var Ar={};Ar.drawElement=function(t,e,r,n,a,i){var o=this;e.isNode()?o.drawNode(t,e,r,n,a,i):o.drawEdge(t,e,r,n,a,i)},Ar.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)},Ar.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)},Ar.drawCachedElementPortion=function(t,e,r,n,a,i,o,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 h=o(c,e),v=u.x1,p=u.y1,g=u.w,y=u.h,m,b,w,C,x;if(h!==0){var k=r.getRotationPoint(e);w=k.x,C=k.y,t.translate(w,C),t.rotate(h),x=c.getImgSmoothing(t),x||c.setImgSmoothing(t,!0);var E=r.getRotationOffset(e);m=E.x,b=E.y}else m=v,b=p;var _;f!==1&&(_=t.globalAlpha,t.globalAlpha=_*f),t.drawImage(d.texture.canvas,d.x,0,d.width,d.height,m,b,g,y),f!==1&&(t.globalAlpha=_),h!==0&&(t.rotate(-h),t.translate(-w,-C),x||c.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var U3=function(){return 0},j3=function(e,r){return e.getTextAngle(r,null)},W3=function(e,r){return e.getTextAngle(r,"source")},Y3=function(e,r){return e.getTextAngle(r,"target")},Z3=function(e,r){return r.effectiveOpacity()},_c=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};Ar.drawCachedElement=function(t,e,r,n,a,i){var o=this,l=o.data,c=l.eleTxrCache,u=l.lblTxrCache,d=l.slbTxrCache,f=l.tlbTxrCache,h=e.boundingBox(),v=i===!0?c.reasons.highQuality:null;if(!(h.w===0||h.h===0||!e.visible())&&(!n||Ku(h,n))){var p=e.isEdge(),g=e.element()._private.rscratch.badLine;o.drawElementUnderlay(t,e),o.drawCachedElementPortion(t,e,c,r,a,v,U3,Z3),(!p||!g)&&o.drawCachedElementPortion(t,e,u,r,a,v,j3,_c),p&&!g&&(o.drawCachedElementPortion(t,e,d,r,a,v,W3,_c),o.drawCachedElementPortion(t,e,f,r,a,v,Y3,_c)),o.drawElementOverlay(t,e)}},Ar.drawElements=function(t,e){for(var r=this,n=0;n<e.length;n++){var a=e[n];r.drawElement(t,a)}},Ar.drawCachedElements=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];a.drawCachedElement(t,o,r,n)}},Ar.drawCachedNodes=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];o.isNode()&&a.drawCachedElement(t,o,r,n)}},Ar.drawLayeredElements=function(t,e,r,n){var a=this,i=a.data.lyrTxrCache.getLayers(e,r);if(i)for(var o=0;o<i.length;o++){var l=i[o],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 en={};en.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,o=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,h=e.pstyle("line-style").value,v=e.pstyle("width").pfValue,p=e.pstyle("line-cap").value,g=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,m=u*d,b=u*d,w=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;f==="straight-triangle"?(o.eleStrokeStyle(t,e,R),o.drawEdgeTrianglePath(e,t,l.allpts)):(t.lineWidth=v,t.lineCap=p,o.eleStrokeStyle(t,e,R),o.drawEdgePath(e,t,l.allpts,h),t.lineCap="butt")},C=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;if(t.lineWidth=v+g,t.lineCap=p,g>0)o.colorStrokeStyle(t,y[0],y[1],y[2],R);else{t.lineCap="butt";return}f==="straight-triangle"?o.drawEdgeTrianglePath(e,t,l.allpts):(o.drawEdgePath(e,t,l.allpts,h),t.lineCap="butt")},x=function(){a&&o.drawEdgeOverlay(t,e)},k=function(){a&&o.drawEdgeUnderlay(t,e)},E=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;o.drawArrowheads(t,e,R)},_=function(){o.drawElementText(t,e,null,n)};t.lineJoin="round";var S=e.pstyle("ghost").value==="yes";if(S){var T=e.pstyle("ghost-offset-x").pfValue,N=e.pstyle("ghost-offset-y").pfValue,B=e.pstyle("ghost-opacity").value,P=m*B;t.translate(T,N),w(P),E(P),t.translate(-T,-N)}else C();k(),w(),E(),x(),_(),r&&t.translate(c.x1,c.y1)}};var lw=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,o=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"&&!o?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,d[0],d[1],d[2],a),i.drawEdgePath(n,r,l.allpts,"solid")}}}};en.drawEdgeOverlay=lw("overlay"),en.drawEdgeUnderlay=lw("underlay"),en.drawEdgePath=function(t,e,r,n){var a=t._private.rscratch,i=e,o,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("$"),h=a.pathCacheKey&&a.pathCacheKey===f;h?(o=e=a.pathCache,l=!0):(o=e=new Path2D,a.pathCacheKey=f,a.pathCache=o)}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 p=2;p+1<r.length;p+=2)e.lineTo(r[p],r[p+1]);break;case"segments":if(a.isRound){var g=T0(a.roundCorners),y;try{for(g.s();!(y=g.n()).done;){var m=y.value;H1(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(o):e.stroke(),e.setLineDash&&e.setLineDash([])},en.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]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),l=[i[1]/o,-i[0]/o],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()}},en.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)},en.drawArrowhead=function(t,e,r,n,a,i,o){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,h=e.pstyle(r+"-arrow-width"),v=h.value==="match-line"?f:h.pfValue;h.units==="%"&&(v*=f);var p=e.pstyle("opacity").value;o===void 0&&(o=p);var g=t.globalCompositeOperation;(o!==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],o),l.colorStrokeStyle(t,y[0],y[1],y[2],o),l.drawArrowShape(e,t,d,f,c,v,n,a,i)}}},en.drawArrowShape=function(t,e,r,n,a,i,o,l,c){var u=this,d=this.usePaths()&&a!=="triangle-cross",f=!1,h,v=e,p={x:o,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=Xn(a),C=b[w];C!=null?(h=e=C,f=!0):(h=e=new Path2D,b[w]=h)}f||(e.beginPath&&e.beginPath(),d?m.draw(e,1,0,{x:0,y:0},1):m.draw(e,y,c,p,n),e.closePath&&e.closePath()),e=v,d&&(e.translate(o,l),e.rotate(c),e.scale(y,y)),(r==="filled"||r==="both")&&(d?e.fill(h):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=i/(d?y:1),e.lineJoin="miter",d?e.stroke(h):e.stroke()),d&&(e.scale(1/y,1/y),e.rotate(-c),e.translate(-o,-l))};var Tc={};Tc.safeDrawImage=function(t,e,r,n,a,i,o,l,c,u){if(!(a<=0||i<=0||c<=0||u<=0))try{t.drawImage(e,r,n,a,i,o,l,c,u)}catch(d){$e(d)}},Tc.drawInscribedImage=function(t,e,r,n,a){var i=this,o=r.position(),l=o.x,c=o.y,u=r.cy().style(),d=u.getIndexedStyle.bind(u),f=d(r,"background-fit","value",n),h=d(r,"background-repeat","value",n),v=r.width(),p=r.height(),g=r.padding()*2,y=v+(d(r,"background-width-relative-to","value",n)==="inner"?0:g),m=p+(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,k=d(r,"background-image-smoothing","value",n),E=r.pstyle("corner-radius").value;E!=="auto"&&(E=r.pstyle("corner-radius").pfValue);var _=e.width||e.cachedW,S=e.height||e.cachedH;(_==null||S==null)&&(document.body.appendChild(e),_=e.cachedW=e.width||e.offsetWidth,S=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var T=_,N=S;if(d(r,"background-width","value",n)!=="auto"&&(d(r,"background-width","units",n)==="%"?T=d(r,"background-width","pfValue",n)*y:T=d(r,"background-width","pfValue",n)),d(r,"background-height","value",n)!=="auto"&&(d(r,"background-height","units",n)==="%"?N=d(r,"background-height","pfValue",n)*m:N=d(r,"background-height","pfValue",n)),!(T===0||N===0)){if(f==="contain"){var B=Math.min(y/T,m/N);T*=B,N*=B}else if(f==="cover"){var B=Math.max(y/T,m/N);T*=B,N*=B}var P=l-y/2,D=d(r,"background-position-x","units",n),R=d(r,"background-position-x","pfValue",n);D==="%"?P+=(y-T)*R:P+=R;var O=d(r,"background-offset-x","units",n),F=d(r,"background-offset-x","pfValue",n);O==="%"?P+=(y-T)*F:P+=F;var A=c-m/2,z=d(r,"background-position-y","units",n),j=d(r,"background-position-y","pfValue",n);z==="%"?A+=(m-N)*j:A+=j;var H=d(r,"background-offset-y","units",n),G=d(r,"background-offset-y","pfValue",n);H==="%"?A+=(m-N)*G:A+=G,b.pathCache&&(P-=l,A-=c,l=0,c=0);var X=t.globalAlpha;t.globalAlpha=x;var M=i.getImgSmoothing(t),V=!1;if(k==="no"&&M?(i.setImgSmoothing(t,!1),V=!0):k==="yes"&&!M&&(i.setImgSmoothing(t,!0),V=!0),h==="no-repeat")C&&(t.save(),b.pathCache?t.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,l,c,y,m,E,b),t.clip())),i.safeDrawImage(t,e,0,0,_,S,P,A,T,N),C&&t.restore();else{var q=t.createPattern(e,h);t.fillStyle=q,i.nodeShapes[i.getNodeShape(r)].draw(t,l,c,y,m,E,b),t.translate(P,A),t.fill(),t.translate(-P,-A)}t.globalAlpha=X,V&&i.setImgSmoothing(t,M)}};var ua={};ua.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(Hu(r*n));e=Math.pow(2,a)}var i=t.pstyle("font-size").pfValue*e,o=t.pstyle("min-zoomed-font-size").pfValue;return!(i<o)},ua.drawElementText=function(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(n==null){if(i&&!o.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var l=e.pstyle("label");if(!l||!l.value)return;var c=o.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"),h=e.pstyle("target-label");if(u||(!d||!d.value)&&(!f||!f.value)&&(!h||!h.value))return;t.textAlign="center",t.textBaseline="bottom"}var v=!r,p;r&&(p=r,t.translate(-p.x1,-p.y1)),a==null?(o.drawText(t,e,null,v,i),e.isEdge()&&(o.drawText(t,e,"source",v,i),o.drawText(t,e,"target",v,i))):o.drawText(t,e,a,v,i),r&&t.translate(p.x1,p.y1)},ua.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},ua.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,o=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+" "+o+" "+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 Nc(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=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(),o?t.stroke():t.fill()}ua.getTextAngle=function(t,e){var r,n=t._private,a=n.rscratch,i=e?e+"-":"",o=t.pstyle(i+"text-rotation"),l=gr(a,"labelAngle",e);return o.strValue==="autorotate"?r=t.isEdge()?l:0:o.strValue==="none"?r=0:r=o.pfValue,r},ua.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,o=i.rscratch,l=a?e.effectiveOpacity():1;if(!(a&&(l===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var c=gr(o,"labelX",r),u=gr(o,"labelY",r),d,f,h=this.getLabelText(e,r);if(h!=null&&h!==""&&!isNaN(c)&&!isNaN(u)){this.setupTextStyle(t,e,a);var v=r?r+"-":"",p=gr(o,"labelWidth",r),g=gr(o,"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 k=e.pstyle("text-background-opacity").value,E=e.pstyle("text-border-opacity").value,_=e.pstyle("text-border-width").pfValue,S=e.pstyle("text-background-padding").pfValue,T=e.pstyle("text-background-shape").strValue,N=T.indexOf("round")===0,B=2;if(k>0||_>0&&E>0){var P=c-S;switch(w){case"left":P-=p;break;case"center":P-=p/2;break}var D=u-g-S,R=p+2*S,O=g+2*S;if(k>0){var F=t.fillStyle,A=e.pstyle("text-background-color").value;t.fillStyle="rgba("+A[0]+","+A[1]+","+A[2]+","+k*l+")",N?Nc(t,P,D,R,O,B):t.fillRect(P,D,R,O),t.fillStyle=F}if(_>0&&E>0){var z=t.strokeStyle,j=t.lineWidth,H=e.pstyle("text-border-color").value,G=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+H[0]+","+H[1]+","+H[2]+","+E*l+")",t.lineWidth=_,t.setLineDash)switch(G){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=_/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(N?Nc(t,P,D,R,O,B,"stroke"):t.strokeRect(P,D,R,O),G==="double"){var X=_/2;N?Nc(t,P+X,D+X,R-X*2,O-X*2,B,"stroke"):t.strokeRect(P+X,D+X,R-X*2,O-X*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=j,t.strokeStyle=z}}var M=2*e.pstyle("text-outline-width").pfValue;if(M>0&&(t.lineWidth=M),e.pstyle("text-wrap").value==="wrap"){var V=gr(o,"labelWrapCachedLines",r),q=gr(o,"labelLineHeight",r),$=p/2,K=this.getLabelJustification(e);switch(K==="auto"||(w==="left"?K==="left"?c+=-p:K==="center"&&(c+=-$):w==="center"?K==="left"?c+=-$:K==="right"&&(c+=$):w==="right"&&(K==="center"?c+=$:K==="right"&&(c+=p))),C){case"top":u-=(V.length-1)*q;break;case"center":case"bottom":u-=(V.length-1)*q;break}for(var L=0;L<V.length;L++)M>0&&t.strokeText(V[L],c,u),t.fillText(V[L],c,u),u+=q}else M>0&&t.strokeText(h,c,u),t.fillText(h,c,u);x!==0&&(t.rotate(-x),t.translate(-d,-f))}}};var li={};li.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,o=this,l,c,u=e._private,d=u.rscratch,f=e.position();if(!(!de(f.x)||!de(f.y))&&!(i&&!e.visible())){var h=i?e.effectiveOpacity():1,v=o.usePaths(),p,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),k=0,E=0;E<w.length;E++){var _=w[E],S=C[E]=_!=null&&_!=="none";if(S){var T=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",E);k++,x[E]=o.getCachedImage(_,T,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var N=e.pstyle("background-blacken").value,B=e.pstyle("border-width").pfValue,P=e.pstyle("background-opacity").value*h,D=e.pstyle("border-color").value,R=e.pstyle("border-style").value,O=e.pstyle("border-join").value,F=e.pstyle("border-cap").value,A=e.pstyle("border-position").value,z=e.pstyle("border-dash-pattern").pfValue,j=e.pstyle("border-dash-offset").pfValue,H=e.pstyle("border-opacity").value*h,G=e.pstyle("outline-width").pfValue,X=e.pstyle("outline-color").value,M=e.pstyle("outline-style").value,V=e.pstyle("outline-opacity").value*h,q=e.pstyle("outline-offset").value,$=e.pstyle("corner-radius").value;$!=="auto"&&($=e.pstyle("corner-radius").pfValue);var K=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P;o.eleFillStyle(t,e,le)},L=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H;o.colorStrokeStyle(t,D[0],D[1],D[2],le)},W=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;o.colorStrokeStyle(t,X[0],X[1],X[2],le)},Y=function(le,ee,oe,me){var be=o.nodePathCache=o.nodePathCache||[],ye=G0(oe==="polygon"?oe+","+me.join(","):oe,""+ee,""+le,""+$),_e=be[ye],ge,Ce=!1;return _e!=null?(ge=_e,Ce=!0,d.pathCache=ge):(ge=new Path2D,be[ye]=d.pathCache=ge),{path:ge,cacheHit:Ce}},se=e.pstyle("shape").strValue,ue=e.pstyle("shape-polygon-points").pfValue;if(v){t.translate(f.x,f.y);var ae=Y(l,c,se,ue);p=ae.path,g=ae.cacheHit}var ne=function(){if(!g){var le=f;v&&(le={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(p||t,le.x,le.y,l,c,$,d)}v?t.fill(p):t.fill()},ce=function(){for(var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,oe=u.backgrounding,me=0,be=0;be<x.length;be++){var ye=e.cy().style().getIndexedStyle(e,"background-image-containment","value",be);if(ee&&ye==="over"||!ee&&ye==="inside"){me++;continue}C[be]&&x[be].complete&&!x[be].error&&(me++,o.drawInscribedImage(t,x[be],e,be,le))}u.backgrounding=me!==k,oe!==u.backgrounding&&e.updateStyle(!1)},ie=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;o.hasPie(e)&&(o.drawPie(t,e,ee),le&&(v||o.nodeShapes[o.getNodeShape(e)].draw(t,f.x,f.y,l,c,$,d)))},fe=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ee=(N>0?N:-N)*le,oe=N>0?0:255;N!==0&&(o.colorFillStyle(t,oe,oe,oe,ee),v?t.fill(p):t.fill())},pe=function(){if(B>0){if(t.lineWidth=B,t.lineCap=F,t.lineJoin=O,t.setLineDash)switch(R){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(z),t.lineDashOffset=j;break;case"solid":case"double":t.setLineDash([]);break}if(A!=="center"){if(t.save(),t.lineWidth*=2,A==="inside")v?t.clip(p):t.clip();else{var le=new Path2D;le.rect(-l/2-B,-c/2-B,l+2*B,c+2*B),le.addPath(p),t.clip(le,"evenodd")}v?t.stroke(p):t.stroke(),t.restore()}else v?t.stroke(p):t.stroke();if(R==="double"){t.lineWidth=B/3;var ee=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(p):t.stroke(),t.globalCompositeOperation=ee}t.setLineDash&&t.setLineDash([])}},Pe=function(){if(G>0){if(t.lineWidth=G,t.lineCap="butt",t.setLineDash)switch(M){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var le=f;v&&(le={x:0,y:0});var ee=o.getNodeShape(e),oe=B;A==="inside"&&(oe=0),A==="outside"&&(oe*=2);var me=(l+oe+(G+q))/l,be=(c+oe+(G+q))/c,ye=l*me,_e=c*be,ge=o.nodeShapes[ee].points,Ce;if(v){var je=Y(ye,_e,ee,ge);Ce=je.path}if(ee==="ellipse")o.drawEllipsePath(Ce||t,le.x,le.y,ye,_e);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ee)){var qe=0,st=0,lt=0;ee==="round-diamond"?qe=(oe+q+G)*1.4:ee==="round-heptagon"?(qe=(oe+q+G)*1.075,lt=-(oe/2+q+G)/35):ee==="round-hexagon"?qe=(oe+q+G)*1.12:ee==="round-pentagon"?(qe=(oe+q+G)*1.13,lt=-(oe/2+q+G)/15):ee==="round-tag"?(qe=(oe+q+G)*1.12,st=(oe/2+G+q)*.07):ee==="round-triangle"&&(qe=(oe+q+G)*(Math.PI/2),lt=-(oe+q/2+G)/Math.PI),qe!==0&&(me=(l+qe)/l,ye=l*me,["round-hexagon","round-tag"].includes(ee)||(be=(c+qe)/c,_e=c*be)),$=$==="auto"?ob(ye,_e):$;for(var tt=ye/2,Rt=_e/2,mt=$+(oe+G+q)/2,wt=new Array(ge.length/2),Jt=new Array(ge.length/2),Lt=0;Lt<ge.length/2;Lt++)wt[Lt]={x:le.x+st+tt*ge[Lt*2],y:le.y+lt+Rt*ge[Lt*2+1]};var Ft,lr,Cr,jt,rt=wt.length;for(lr=wt[rt-1],Ft=0;Ft<rt;Ft++)Cr=wt[Ft%rt],jt=wt[(Ft+1)%rt],Jt[Ft]=Ec(lr,Cr,jt,mt),lr=Cr,Cr=jt;o.drawRoundPolygonPath(Ce||t,le.x+st,le.y+lt,l*me,c*be,ge,Jt)}else if(["roundrectangle","round-rectangle"].includes(ee))$=$==="auto"?ta(ye,_e):$,o.drawRoundRectanglePath(Ce||t,le.x,le.y,ye,_e,$+(oe+G+q)/2);else if(["cutrectangle","cut-rectangle"].includes(ee))$=$==="auto"?ju():$,o.drawCutRectanglePath(Ce||t,le.x,le.y,ye,_e,null,$+(oe+G+q)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ee))$=$==="auto"?ta(ye,_e):$,o.drawBottomRoundRectanglePath(Ce||t,le.x,le.y,ye,_e,$+(oe+G+q)/2);else if(ee==="barrel")o.drawBarrelPath(Ce||t,le.x,le.y,ye,_e);else if(ee.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ee)){var ut=(oe+G+q)/l;ge=xs(ks(ge,ut)),o.drawPolygonPath(Ce||t,le.x,le.y,l,c,ge)}else{var Ct=(oe+G+q)/l;ge=xs(ks(ge,-Ct)),o.drawPolygonPath(Ce||t,le.x,le.y,l,c,ge)}if(v?t.stroke(Ce):t.stroke(),M==="double"){t.lineWidth=oe/3;var On=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(Ce):t.stroke(),t.globalCompositeOperation=On}t.setLineDash&&t.setLineDash([])}},Ie=function(){a&&o.drawNodeOverlay(t,e,f,l,c)},we=function(){a&&o.drawNodeUnderlay(t,e,f,l,c)},xe=function(){o.drawElementText(t,e,null,n)},re=e.pstyle("ghost").value==="yes";if(re){var I=e.pstyle("ghost-offset-x").pfValue,U=e.pstyle("ghost-offset-y").pfValue,te=e.pstyle("ghost-opacity").value,Z=te*h;t.translate(I,U),W(),Pe(),K(te*P),ne(),ce(Z,!0),L(te*H),pe(),ie(N!==0||B!==0),ce(Z,!1),fe(Z),t.translate(-I,-U)}v&&t.translate(-f.x,-f.y),we(),v&&t.translate(f.x,f.y),W(),Pe(),K(),ne(),ce(h,!0),L(),pe(),ie(N!==0||B!==0),ce(h,!1),fe(),v&&t.translate(-f.x,-f.y),xe(),Ie(),r&&t.translate(m.x1,m.y1)}};var uw=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n,a,i,o){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,h=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(a=a||n.position(),i==null||o==null){var v=n.padding();i=n.width()+2*v,o=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,o+c*2,h),r.fill()}}}};li.drawNodeOverlay=uw("overlay"),li.drawNodeUnderlay=uw("underlay"),li.hasPie=function(t){return t=t[0],t._private.hasPie},li.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),o=n.x,l=n.y,c=e.width(),u=e.height(),d=Math.min(c,u)/2,f=0,h=this.usePaths();h&&(o=0,l=0),i.units==="%"?d=d*i.pfValue:i.pfValue!==void 0&&(d=i.pfValue/2);for(var v=1;v<=a.pieBackgroundN;v++){var p=e.pstyle("pie-"+v+"-background-size").value,g=e.pstyle("pie-"+v+"-background-color").value,y=e.pstyle("pie-"+v+"-background-opacity").value*r,m=p/100;m+f>1&&(m=1-f);var b=1.5*Math.PI+2*Math.PI*f,w=2*Math.PI*m,C=b+w;p===0||f>=1||f+m>1||(t.beginPath(),t.moveTo(o,l),t.arc(o,l,d,b,C),t.closePath(),this.colorFillStyle(t,g[0],g[1],g[2],y),t.fill(),f+=m)}};var Xt={},X3=100;Xt.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},Xt.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},Xt.createGradientStyleFor=function(t,e,r,n,a){var i,o=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(),h=Jn(u,f),v=Jn(d,f);i=t.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(h,v))}else{var p=o?{x:0,y:0}:r.position(),g=r.paddedWidth(),y=r.paddedHeight();i=t.createRadialGradient(p.x,p.y,0,p.x,p.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=o?{x:0,y:0}:r.position(),C=r.paddedWidth(),x=r.paddedHeight(),k=C/2,E=x/2,_=r.pstyle("background-gradient-direction").value;switch(_){case"to-bottom":i=t.createLinearGradient(w.x,w.y-E,w.x,w.y+E);break;case"to-top":i=t.createLinearGradient(w.x,w.y+E,w.x,w.y-E);break;case"to-left":i=t.createLinearGradient(w.x+k,w.y,w.x-k,w.y);break;case"to-right":i=t.createLinearGradient(w.x-k,w.y,w.x+k,w.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(w.x-k,w.y-E,w.x+k,w.y+E);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(w.x-k,w.y+E,w.x+k,w.y-E);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(w.x+k,w.y-E,w.x-k,w.y+E);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(w.x+k,w.y+E,w.x-k,w.y-E);break}}if(!i)return null;for(var S=c.length===l.length,T=l.length,N=0;N<T;N++)i.addColorStop(S?c[N]:N/(T-1),"rgba("+l[N][0]+","+l[N][1]+","+l[N][2]+","+a+")");return i},Xt.gradientFillStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"background",e,r,n);if(!a)return null;t.fillStyle=a},Xt.colorFillStyle=function(t,e,r,n,a){t.fillStyle="rgba("+e+","+r+","+n+","+a+")"},Xt.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)}},Xt.gradientStrokeStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"line",e,r,n);if(!a)return null;t.strokeStyle=a},Xt.colorStrokeStyle=function(t,e,r,n,a){t.strokeStyle="rgba("+e+","+r+","+n+","+a+")"},Xt.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)}},Xt.matchCanvasSize=function(t){var e=this,r=e.data,n=e.findContainerClientCoords(),a=n[2],i=n[3],o=e.getPixelRatio(),l=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=l);var c=a*o,u=i*o,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 h=0;h<e.CANVAS_LAYERS;h++)d=r.canvases[h],d.width=c,d.height=u,d.style.width=a+"px",d.style.height=i+"px";for(var h=0;h<e.BUFFER_COUNT;h++)d=r.bufferCanvases[h],d.width=c,d.height=u,d.style.width=a+"px",d.style.height=i+"px";e.textureMult=1,o<=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}},Xt.renderTo=function(t,e,r,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:n})},Xt.render=function(t){t=t||X0();var e=t.forcedContext,r=t.drawAllLayers,n=t.drawOnlyNodeLayer,a=t.forcedZoom,i=t.forcedPan,o=this,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,c=o.cy,u=o.data,d=u.canvasNeedsRedraw,f=o.textureOnViewport&&!e&&(o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming),h=t.motionBlur!==void 0?t.motionBlur:o.motionBlur,v=o.motionBlurPxRatio,p=c.hasCompoundNodes(),g=o.hoverData.draggingEles,y=!!(o.hoverData.selecting||o.touchData.selecting);h=h&&!e&&o.motionBlurEnabled&&!y;var m=h;e||(o.prevPxRatio!==l&&(o.invalidateContainerClientCoordsCache(),o.matchCanvasSize(o.container),o.redrawHint("eles",!0),o.redrawHint("drag",!0)),o.prevPxRatio=l),!e&&o.motionBlurTimeout&&clearTimeout(o.motionBlurTimeout),h&&(o.mbFrames==null&&(o.mbFrames=0),o.mbFrames++,o.mbFrames<3&&(m=!1),o.mbFrames>o.minMbLowQualFrames&&(o.motionBlurPxRatio=o.mbPxRBlurry)),o.clearingMotionBlur&&(o.motionBlurPxRatio=1),o.textureDrawLastFrame&&!f&&(d[o.NODE]=!0,d[o.SELECT_BOX]=!0);var b=c.style(),w=c.zoom(),C=a!==void 0?a:w,x=c.pan(),k={x:x.x,y:x.y},E={zoom:w,pan:{x:x.x,y:x.y}},_=o.prevViewport,S=_===void 0||E.zoom!==_.zoom||E.pan.x!==_.pan.x||E.pan.y!==_.pan.y;!S&&!(g&&!p)&&(o.motionBlurPxRatio=1),i&&(k=i),C*=l,k.x*=l,k.y*=l;var T=o.getCachedZSortedEles();function N(ae,ne,ce,ie,fe){var pe=ae.globalCompositeOperation;ae.globalCompositeOperation="destination-out",o.colorFillStyle(ae,255,255,255,o.motionBlurTransparency),ae.fillRect(ne,ce,ie,fe),ae.globalCompositeOperation=pe}function B(ae,ne){var ce,ie,fe,pe;!o.clearingMotionBlur&&(ae===u.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]||ae===u.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG])?(ce={x:x.x*v,y:x.y*v},ie=w*v,fe=o.canvasWidth*v,pe=o.canvasHeight*v):(ce=k,ie=C,fe=o.canvasWidth,pe=o.canvasHeight),ae.setTransform(1,0,0,1,0,0),ne==="motionBlur"?N(ae,0,0,fe,pe):!e&&(ne===void 0||ne)&&ae.clearRect(0,0,fe,pe),r||(ae.translate(ce.x,ce.y),ae.scale(ie,ie)),i&&ae.translate(i.x,i.y),a&&ae.scale(a,a)}if(f||(o.textureDrawLastFrame=!1),f){if(o.textureDrawLastFrame=!0,!o.textureCache){o.textureCache={},o.textureCache.bb=c.mutableElements().boundingBox(),o.textureCache.texture=o.data.bufferCanvases[o.TEXTURE_BUFFER];var P=o.data.bufferContexts[o.TEXTURE_BUFFER];P.setTransform(1,0,0,1,0,0),P.clearRect(0,0,o.canvasWidth*o.textureMult,o.canvasHeight*o.textureMult),o.render({forcedContext:P,drawOnlyNodeLayer:!0,forcedPxRatio:l*o.textureMult});var E=o.textureCache.viewport={zoom:c.zoom(),pan:c.pan(),width:o.canvasWidth,height:o.canvasHeight};E.mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}d[o.DRAG]=!1,d[o.NODE]=!1;var D=u.contexts[o.NODE],R=o.textureCache.texture,E=o.textureCache.viewport;D.setTransform(1,0,0,1,0,0),h?N(D,0,0,E.width,E.height):D.clearRect(0,0,E.width,E.height);var O=b.core("outside-texture-bg-color").value,F=b.core("outside-texture-bg-opacity").value;o.colorFillStyle(D,O[0],O[1],O[2],F),D.fillRect(0,0,E.width,E.height);var w=c.zoom();B(D,!1),D.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l),D.drawImage(R,E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l)}else o.textureOnViewport&&!e&&(o.textureCache=null);var A=c.extent(),z=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated(),j=o.hideEdgesOnViewport&&z,H=[];if(H[o.NODE]=!d[o.NODE]&&h&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur,H[o.NODE]&&(o.clearedForMotionBlur[o.NODE]=!0),H[o.DRAG]=!d[o.DRAG]&&h&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur,H[o.DRAG]&&(o.clearedForMotionBlur[o.DRAG]=!0),d[o.NODE]||r||n||H[o.NODE]){var G=h&&!H[o.NODE]&&v!==1,D=e||(G?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:u.contexts[o.NODE]),X=h&&!G?"motionBlur":void 0;B(D,X),j?o.drawCachedNodes(D,T.nondrag,l,A):o.drawLayeredElements(D,T.nondrag,l,A),o.debug&&o.drawDebugPoints(D,T.nondrag),!r&&!h&&(d[o.NODE]=!1)}if(!n&&(d[o.DRAG]||r||H[o.DRAG])){var G=h&&!H[o.DRAG]&&v!==1,D=e||(G?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:u.contexts[o.DRAG]);B(D,h&&!G?"motionBlur":void 0),j?o.drawCachedNodes(D,T.drag,l,A):o.drawCachedElements(D,T.drag,l,A),o.debug&&o.drawDebugPoints(D,T.drag),!r&&!h&&(d[o.DRAG]=!1)}if(o.showFps||!n&&d[o.SELECT_BOX]&&!r){var D=e||u.contexts[o.SELECT_BOX];if(B(D),o.selection[4]==1&&(o.hoverData.selecting||o.touchData.selecting)){var w=o.cy.zoom(),M=b.core("selection-box-border-width").value/w;D.lineWidth=M,D.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+")",D.fillRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]),M>0&&(D.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+")",D.strokeRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]))}if(u.bgActivePosistion&&!o.hoverData.selecting){var w=o.cy.zoom(),V=u.bgActivePosistion;D.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+")",D.beginPath(),D.arc(V.x,V.y,b.core("active-bg-size").pfValue/w,0,2*Math.PI),D.fill()}var q=o.lastRedrawTime;if(o.showFps&&q){q=Math.round(q);var $=Math.round(1e3/q);D.setTransform(1,0,0,1,0,0),D.fillStyle="rgba(255, 0, 0, 0.75)",D.strokeStyle="rgba(255, 0, 0, 0.75)",D.lineWidth=1,D.fillText("1 frame = "+q+" ms = "+$+" fps",0,20);var K=60;D.strokeRect(0,30,250,20),D.fillRect(0,30,250*Math.min($/K,1),20)}r||(d[o.SELECT_BOX]=!1)}if(h&&v!==1){var L=u.contexts[o.NODE],W=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE],Y=u.contexts[o.DRAG],se=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG],ue=function(ne,ce,ie){ne.setTransform(1,0,0,1,0,0),ie||!m?ne.clearRect(0,0,o.canvasWidth,o.canvasHeight):N(ne,0,0,o.canvasWidth,o.canvasHeight);var fe=v;ne.drawImage(ce,0,0,o.canvasWidth*fe,o.canvasHeight*fe,0,0,o.canvasWidth,o.canvasHeight)};(d[o.NODE]||H[o.NODE])&&(ue(L,W,H[o.NODE]),d[o.NODE]=!1),(d[o.DRAG]||H[o.DRAG])&&(ue(Y,se,H[o.DRAG]),d[o.DRAG]=!1)}o.prevViewport=E,o.clearingMotionBlur&&(o.clearingMotionBlur=!1,o.motionBlurCleared=!0,o.motionBlur=!0),h&&(o.motionBlurTimeout=setTimeout(function(){o.motionBlurTimeout=null,o.clearedForMotionBlur[o.NODE]=!1,o.clearedForMotionBlur[o.DRAG]=!1,o.motionBlur=!1,o.clearingMotionBlur=!f,o.mbFrames=0,d[o.NODE]=!0,d[o.DRAG]=!0,o.redraw()},X3)),e||c.emit("render")};var In={};In.drawPolygonPath=function(t,e,r,n,a,i){var o=n/2,l=a/2;t.beginPath&&t.beginPath(),t.moveTo(e+o*i[0],r+l*i[1]);for(var c=1;c<i.length/2;c++)t.lineTo(e+o*i[c*2],r+l*i[c*2+1]);t.closePath()},In.drawRoundPolygonPath=function(t,e,r,n,a,i,o){o.forEach(function(l){return H1(t,l)}),t.closePath()},In.drawRoundRectanglePath=function(t,e,r,n,a,i){var o=n/2,l=a/2,c=i==="auto"?ta(n,a):Math.min(i,l,o);t.beginPath&&t.beginPath(),t.moveTo(e,r-l),t.arcTo(e+o,r-l,e+o,r,c),t.arcTo(e+o,r+l,e,r+l,c),t.arcTo(e-o,r+l,e-o,r,c),t.arcTo(e-o,r-l,e,r-l,c),t.lineTo(e,r-l),t.closePath()},In.drawBottomRoundRectanglePath=function(t,e,r,n,a,i){var o=n/2,l=a/2,c=i==="auto"?ta(n,a):i;t.beginPath&&t.beginPath(),t.moveTo(e,r-l),t.lineTo(e+o,r-l),t.lineTo(e+o,r),t.arcTo(e+o,r+l,e,r+l,c),t.arcTo(e-o,r+l,e-o,r,c),t.lineTo(e-o,r-l),t.lineTo(e,r-l),t.closePath()},In.drawCutRectanglePath=function(t,e,r,n,a,i,o){var l=n/2,c=a/2,u=o==="auto"?ju():o;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()},In.drawBarrelPath=function(t,e,r,n,a){var i=n/2,o=a/2,l=e-i,c=e+i,u=r-o,d=r+o,f=Wu(n,a),h=f.widthOffset,v=f.heightOffset,p=f.ctrlPtOffsetPct*h;t.beginPath&&t.beginPath(),t.moveTo(l,u+v),t.lineTo(l,d-v),t.quadraticCurveTo(l+p,d,l+h,d),t.lineTo(c-h,d),t.quadraticCurveTo(c-p,d,c,d-v),t.lineTo(c,u+v),t.quadraticCurveTo(c-p,u,c-h,u),t.lineTo(l+h,u),t.quadraticCurveTo(l+p,u,l,u+v),t.closePath()};for(var cw=Math.sin(0),dw=Math.cos(0),Ic={},Bc={},fw=Math.PI/40,ui=0*Math.PI;ui<2*Math.PI;ui+=fw)Ic[ui]=Math.sin(ui),Bc[ui]=Math.cos(ui);In.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,o,l=n/2,c=a/2,u=0*Math.PI;u<2*Math.PI;u+=fw)i=e-l*Ic[u]*cw+l*Bc[u]*dw,o=r+c*Bc[u]*cw+c*Ic[u]*dw,u===0?t.moveTo(i,o):t.lineTo(i,o);t.closePath()};var Co={};Co.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]},Co.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],o=t.full?Math.ceil(n.h):a[3],l=de(t.maxWidth)||de(t.maxHeight),c=this.getPixelRatio(),u=1;if(t.scale!==void 0)i*=t.scale,o*=t.scale,u=t.scale;else if(l){var d=1/0,f=1/0;de(t.maxWidth)&&(d=u*t.maxWidth/i),de(t.maxHeight)&&(f=u*t.maxHeight/o),u=Math.min(d,f),i*=u,o*=u}l||(i*=c,o*=c,u*=c);var h=document.createElement("canvas");h.width=i,h.height=o,h.style.width=i+"px",h.style.height=o+"px";var v=h.getContext("2d");if(i>0&&o>0){v.clearRect(0,0,i,o),v.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(t.full)v.translate(-n.x1*u,-n.y1*u),v.scale(u,u),this.drawElements(v,p),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,p),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,o),v.fill())}return h};function J3(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 hw(t){var e=t.indexOf(",");return t.substr(e+1)}function pw(t,e,r){var n=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new Ua(function(a,i){try{e.toBlob(function(o){o!=null?a(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(o){i(o)}});case"blob":return J3(hw(n()),r);case"base64":return hw(n());case"base64uri":default:return n()}}Co.png=function(t){return pw(t,this.bufferCanvasImage(t),"image/png")},Co.jpg=function(t){return pw(t,this.bufferCanvasImage(t),"image/jpeg")};var vw={};vw.nodeShapeImpl=function(t,e,r,n,a,i,o,l){switch(t){case"ellipse":return this.drawEllipsePath(e,r,n,a,i);case"polygon":return this.drawPolygonPath(e,r,n,a,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,r,n,a,i,o,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,o,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 Q3=gw,Fe=gw.prototype;Fe.CANVAS_LAYERS=3,Fe.SELECT_BOX=0,Fe.DRAG=1,Fe.NODE=2,Fe.BUFFER_COUNT=3,Fe.TEXTURE_BUFFER=0,Fe.MOTIONBLUR_BUFFER_NODE=1,Fe.MOTIONBLUR_BUFFER_DRAG=2;function gw(t){var e=this,r=e.cy.window(),n=r.document;e.data={canvases:new Array(Fe.CANVAS_LAYERS),contexts:new Array(Fe.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Fe.CANVAS_LAYERS),bufferCanvases:new Array(Fe.BUFFER_COUNT),bufferContexts:new Array(Fe.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var o=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,o.position="relative",o.zIndex="0",o.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"};VF()&&(c["-ms-touch-action"]="none",c["touch-action"]="none");for(var u=0;u<Fe.CANVAS_LAYERS;u++){var d=e.data.canvases[u]=n.createElement("canvas");e.data.contexts[u]=d.getContext("2d"),Object.keys(c).forEach(function(K){d.style[K]=c[K]}),d.style.position="absolute",d.setAttribute("data-id","layer"+u),d.style.zIndex=String(Fe.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(d),e.data.canvasNeedsRedraw[u]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Fe.NODE].setAttribute("data-id","layer"+Fe.NODE+"-node"),e.data.canvases[Fe.SELECT_BOX].setAttribute("data-id","layer"+Fe.SELECT_BOX+"-selectbox"),e.data.canvases[Fe.DRAG].setAttribute("data-id","layer"+Fe.DRAG+"-drag");for(var u=0;u<Fe.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=Kt(),h=function(L){return{x:(L.x1+L.x2)/2,y:(L.y1+L.y2)/2}},v=function(L){return{x:-L.w/2,y:-L.h/2}},p=function(L){var W=L[0]._private,Y=W.oldBackgroundTimestamp===W.backgroundTimestamp;return!Y},g=function(L){return L[0]._private.nodeKey},y=function(L){return L[0]._private.labelStyleKey},m=function(L){return L[0]._private.sourceLabelStyleKey},b=function(L){return L[0]._private.targetLabelStyleKey},w=function(L,W,Y,se,ue){return e.drawElement(L,W,Y,!1,!1,ue)},C=function(L,W,Y,se,ue){return e.drawElementText(L,W,Y,se,"main",ue)},x=function(L,W,Y,se,ue){return e.drawElementText(L,W,Y,se,"source",ue)},k=function(L,W,Y,se,ue){return e.drawElementText(L,W,Y,se,"target",ue)},E=function(L){return L.boundingBox(),L[0]._private.bodyBounds},_=function(L){return L.boundingBox(),L[0]._private.labelBounds.main||f},S=function(L){return L.boundingBox(),L[0]._private.labelBounds.source||f},T=function(L){return L.boundingBox(),L[0]._private.labelBounds.target||f},N=function(L,W){return W},B=function(L){return h(E(L))},P=function(L,W,Y){var se=L?L+"-":"";return{x:W.x+Y.pstyle(se+"text-margin-x").pfValue,y:W.y+Y.pstyle(se+"text-margin-y").pfValue}},D=function(L,W,Y){var se=L[0]._private.rscratch;return{x:se[W],y:se[Y]}},R=function(L){return P("",D(L,"labelX","labelY"),L)},O=function(L){return P("source",D(L,"sourceLabelX","sourceLabelY"),L)},F=function(L){return P("target",D(L,"targetLabelX","targetLabelY"),L)},A=function(L){return v(E(L))},z=function(L){return v(S(L))},j=function(L){return v(T(L))},H=function(L){var W=_(L),Y=v(_(L));if(L.isNode()){switch(L.pstyle("text-halign").value){case"left":Y.x=-W.w;break;case"right":Y.x=0;break}switch(L.pstyle("text-valign").value){case"top":Y.y=-W.h;break;case"bottom":Y.y=0;break}}return Y},G=e.data.eleTxrCache=new bo(e,{getKey:g,doesEleInvalidateKey:p,drawElement:w,getBoundingBox:E,getRotationPoint:B,getRotationOffset:A,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),X=e.data.lblTxrCache=new bo(e,{getKey:y,drawElement:C,getBoundingBox:_,getRotationPoint:R,getRotationOffset:H,isVisible:N}),M=e.data.slbTxrCache=new bo(e,{getKey:m,drawElement:x,getBoundingBox:S,getRotationPoint:O,getRotationOffset:z,isVisible:N}),V=e.data.tlbTxrCache=new bo(e,{getKey:b,drawElement:k,getBoundingBox:T,getRotationPoint:F,getRotationOffset:j,isVisible:N}),q=e.data.lyrTxrCache=new nw(e);e.onUpdateEleCalcs(function(L,W){G.invalidateElements(W),X.invalidateElements(W),M.invalidateElements(W),V.invalidateElements(W),q.invalidateElements(W);for(var Y=0;Y<W.length;Y++){var se=W[Y]._private;se.oldBackgroundTimestamp=se.backgroundTimestamp}});var $=function(L){for(var W=0;W<L.length;W++)q.enqueueElementRefinement(L[W].ele)};G.onDequeue($),X.onDequeue($),M.onDequeue($),V.onDequeue($)}Fe.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[Fe.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[Fe.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[Fe.SELECT_BOX]=e;break}};var e4=typeof Path2D<"u";Fe.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t},Fe.usePaths=function(){return e4&&this.pathsEnabled},Fe.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)},Fe.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled},Fe.makeOffscreenCanvas=function(t,e){var r;if((typeof OffscreenCanvas>"u"?"undefined":ht(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},[iw,Ar,en,Tc,ua,li,Xt,In,Co,vw].forEach(function(t){Se(Fe,t)});var t4=[{name:"null",impl:A1},{name:"base",impl:Q1},{name:"canvas",impl:Q3}],r4=[{type:"layout",extensions:l3},{type:"renderer",extensions:t4}],mw={},yw={};function bw(t,e,r){var n=r,a=function(_){$e("Can not register `"+e+"` for `"+t+"` since `"+_+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(go.prototype[e])return a(e);go.prototype[e]=r}else if(t==="collection"){if(Tt.prototype[e])return a(e);Tt.prototype[e]=r}else if(t==="layout"){for(var i=function(_){this.options=_,r.call(this,_),Ae(this._private)||(this._private={}),this._private.cy=_.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(r.prototype),l=[],c=0;c<l.length;c++){var u=l[c];o[u]=o[u]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var d=r.prototype.stop;o.stop=function(){var E=this.options;if(E&&E.animate){var _=this.animations;if(_)for(var S=0;S<_.length;S++)_[S].stop()}return d?d.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var f=function(_){return _._private.cy},h={addEventFields:function(_,S){S.layout=_,S.cy=f(_),S.target=_},bubble:function(){return!0},parent:function(_){return f(_)}};Se(o,{createEmitter:function(){return this._private.emitter=new Ms(h,this),this},emitter:function(){return this._private.emitter},on:function(_,S){return this.emitter().on(_,S),this},one:function(_,S){return this.emitter().one(_,S),this},once:function(_,S){return this.emitter().one(_,S),this},removeListener:function(_,S){return this.emitter().removeListener(_,S),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(_,S){return this.emitter().emit(_,S),this}}),Ve.eventAliasesOn(o),n=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var v=ww("renderer","base"),p=v.prototype,g=r,y=r.prototype,m=function(){v.apply(this,arguments),g.apply(this,arguments)},b=m.prototype;for(var w in p){var C=p[w],x=y[w]!=null;if(x)return a(w);b[w]=C}for(var k in y)b[k]=y[k];p.clientFunctions.forEach(function(E){b[E]=b[E]||function(){Je("Renderer does not implement `renderer."+E+"()` on its prototype")}}),n=m}else if(t==="__proto__"||t==="constructor"||t==="prototype")return Je(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return R0({map:mw,keys:[t,e],value:n})}function ww(t,e){return L0({map:mw,keys:[t,e]})}function n4(t,e,r,n,a){return R0({map:yw,keys:[t,e,r,n],value:a})}function a4(t,e,r,n){return L0({map:yw,keys:[t,e,r,n]})}var Dc=function(){if(arguments.length===2)return ww.apply(null,arguments);if(arguments.length===3)return bw.apply(null,arguments);if(arguments.length===4)return a4.apply(null,arguments);if(arguments.length===5)return n4.apply(null,arguments);Je("Invalid extension access syntax")};go.prototype.extension=Dc,r4.forEach(function(t){t.extensions.forEach(function(e){bw(t.type,e.name,e.impl)})});var Cw=function t(){if(!(this instanceof t))return new t;this.length=0},ca=Cw.prototype;ca.instanceString=function(){return"stylesheet"},ca.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this},ca.css=function(t,e){var r=this.length-1;if(Ee(t))this[r].properties.push({name:t,value:e});else if(Ae(t))for(var n=t,a=Object.keys(n),i=0;i<a.length;i++){var o=a[i],l=n[o];if(l!=null){var c=Pt.properties[o]||Pt.properties[fs(o)];if(c!=null){var u=c.name,d=l;this[r].properties.push({name:u,value:d})}}}return this},ca.style=ca.css,ca.generateStyle=function(t){var e=new Pt(t);return this.appendToStyle(e)},ca.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 o=a[i];t.css(o.name,o.value)}}return t};var i4="3.30.2",Bn=function(e){if(e===void 0&&(e={}),Ae(e))return new go(e);if(Ee(e))return Dc.apply(Dc,arguments)};Bn.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Bn),t.apply(null,e),this},Bn.warnings=function(t){return Y0(t)},Bn.version=i4,Bn.stylesheet=Bn.Stylesheet=Cw;var Ew={exports:{}};function Pc(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Oc,xw;function o4(){if(xw)return Oc;xw=1;function t(){this.__data__=[],this.size=0}return Oc=t,Oc}var Ac,kw;function ci(){if(kw)return Ac;kw=1;function t(e,r){return e===r||e!==e&&r!==r}return Ac=t,Ac}var Rc,Sw;function sl(){if(Sw)return Rc;Sw=1;var t=ci();function e(r,n){for(var a=r.length;a--;)if(t(r[a][0],n))return a;return-1}return Rc=e,Rc}var Lc,_w;function s4(){if(_w)return Lc;_w=1;var t=sl(),e=Array.prototype,r=e.splice;function n(a){var i=this.__data__,o=t(i,a);if(o<0)return!1;var l=i.length-1;return o==l?i.pop():r.call(i,o,1),--this.size,!0}return Lc=n,Lc}var Fc,Tw;function l4(){if(Tw)return Fc;Tw=1;var t=sl();function e(r){var n=this.__data__,a=t(n,r);return a<0?void 0:n[a][1]}return Fc=e,Fc}var Mc,Nw;function u4(){if(Nw)return Mc;Nw=1;var t=sl();function e(r){return t(this.__data__,r)>-1}return Mc=e,Mc}var $c,Iw;function c4(){if(Iw)return $c;Iw=1;var t=sl();function e(r,n){var a=this.__data__,i=t(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return $c=e,$c}var Vc,Bw;function ll(){if(Bw)return Vc;Bw=1;var t=o4(),e=s4(),r=l4(),n=u4(),a=c4();function i(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Vc=i,Vc}var qc,Dw;function d4(){if(Dw)return qc;Dw=1;var t=ll();function e(){this.__data__=new t,this.size=0}return qc=e,qc}var zc,Pw;function f4(){if(Pw)return zc;Pw=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return zc=t,zc}var Hc,Ow;function h4(){if(Ow)return Hc;Ow=1;function t(e){return this.__data__.get(e)}return Hc=t,Hc}var Kc,Aw;function p4(){if(Aw)return Kc;Aw=1;function t(e){return this.__data__.has(e)}return Kc=t,Kc}var Gc,Rw;function Lw(){if(Rw)return Gc;Rw=1;var t=typeof Li=="object"&&Li&&Li.Object===Object&&Li;return Gc=t,Gc}var Uc,Fw;function br(){if(Fw)return Uc;Fw=1;var t=Lw(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Uc=r,Uc}var jc,Mw;function di(){if(Mw)return jc;Mw=1;var t=br(),e=t.Symbol;return jc=e,jc}var Wc,$w;function v4(){if($w)return Wc;$w=1;var t=di(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,a=t?t.toStringTag:void 0;function i(o){var l=r.call(o,a),c=o[a];try{o[a]=void 0;var u=!0}catch{}var d=n.call(o);return u&&(l?o[a]=c:delete o[a]),d}return Wc=i,Wc}var Yc,Vw;function g4(){if(Vw)return Yc;Vw=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return Yc=r,Yc}var Zc,qw;function da(){if(qw)return Zc;qw=1;var t=di(),e=v4(),r=g4(),n="[object Null]",a="[object Undefined]",i=t?t.toStringTag:void 0;function o(l){return l==null?l===void 0?a:n:i&&i in Object(l)?e(l):r(l)}return Zc=o,Zc}var Xc,zw;function or(){if(zw)return Xc;zw=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Xc=t,Xc}var Jc,Hw;function Eo(){if(Hw)return Jc;Hw=1;var t=da(),e=or(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(l){if(!e(l))return!1;var c=t(l);return c==n||c==a||c==r||c==i}return Jc=o,Jc}var Qc,Kw;function m4(){if(Kw)return Qc;Kw=1;var t=br(),e=t["__core-js_shared__"];return Qc=e,Qc}var ed,Gw;function y4(){if(Gw)return ed;Gw=1;var t=m4(),e=function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!e&&e in n}return ed=r,ed}var td,Uw;function jw(){if(Uw)return td;Uw=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return td=r,td}var rd,Ww;function b4(){if(Ww)return rd;Ww=1;var t=Eo(),e=y4(),r=or(),n=jw(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,l=Object.prototype,c=o.toString,u=l.hasOwnProperty,d=RegExp("^"+c.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(h){if(!r(h)||e(h))return!1;var v=t(h)?d:i;return v.test(n(h))}return rd=f,rd}var nd,Yw;function w4(){if(Yw)return nd;Yw=1;function t(e,r){return e==null?void 0:e[r]}return nd=t,nd}var ad,Zw;function fa(){if(Zw)return ad;Zw=1;var t=b4(),e=w4();function r(n,a){var i=e(n,a);return t(i)?i:void 0}return ad=r,ad}var id,Xw;function od(){if(Xw)return id;Xw=1;var t=fa(),e=br(),r=t(e,"Map");return id=r,id}var sd,Jw;function ul(){if(Jw)return sd;Jw=1;var t=fa(),e=t(Object,"create");return sd=e,sd}var ld,Qw;function C4(){if(Qw)return ld;Qw=1;var t=ul();function e(){this.__data__=t?t(null):{},this.size=0}return ld=e,ld}var ud,eC;function E4(){if(eC)return ud;eC=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return ud=t,ud}var cd,tC;function x4(){if(tC)return cd;tC=1;var t=ul(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(i){var o=this.__data__;if(t){var l=o[i];return l===e?void 0:l}return n.call(o,i)?o[i]:void 0}return cd=a,cd}var dd,rC;function k4(){if(rC)return dd;rC=1;var t=ul(),e=Object.prototype,r=e.hasOwnProperty;function n(a){var i=this.__data__;return t?i[a]!==void 0:r.call(i,a)}return dd=n,dd}var fd,nC;function S4(){if(nC)return fd;nC=1;var t=ul(),e="__lodash_hash_undefined__";function r(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=t&&a===void 0?e:a,this}return fd=r,fd}var hd,aC;function _4(){if(aC)return hd;aC=1;var t=C4(),e=E4(),r=x4(),n=k4(),a=S4();function i(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,hd=i,hd}var pd,iC;function T4(){if(iC)return pd;iC=1;var t=_4(),e=ll(),r=od();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return pd=n,pd}var vd,oC;function N4(){if(oC)return vd;oC=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return vd=t,vd}var gd,sC;function cl(){if(sC)return gd;sC=1;var t=N4();function e(r,n){var a=r.__data__;return t(n)?a[typeof n=="string"?"string":"hash"]:a.map}return gd=e,gd}var md,lC;function I4(){if(lC)return md;lC=1;var t=cl();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return md=e,md}var yd,uC;function B4(){if(uC)return yd;uC=1;var t=cl();function e(r){return t(this,r).get(r)}return yd=e,yd}var bd,cC;function D4(){if(cC)return bd;cC=1;var t=cl();function e(r){return t(this,r).has(r)}return bd=e,bd}var wd,dC;function P4(){if(dC)return wd;dC=1;var t=cl();function e(r,n){var a=t(this,r),i=a.size;return a.set(r,n),this.size+=a.size==i?0:1,this}return wd=e,wd}var Cd,fC;function Ed(){if(fC)return Cd;fC=1;var t=T4(),e=I4(),r=B4(),n=D4(),a=P4();function i(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Cd=i,Cd}var xd,hC;function O4(){if(hC)return xd;hC=1;var t=ll(),e=od(),r=Ed(),n=200;function a(i,o){var l=this.__data__;if(l instanceof t){var c=l.__data__;if(!e||c.length<n-1)return c.push([i,o]),this.size=++l.size,this;l=this.__data__=new r(c)}return l.set(i,o),this.size=l.size,this}return xd=a,xd}var kd,pC;function dl(){if(pC)return kd;pC=1;var t=ll(),e=d4(),r=f4(),n=h4(),a=p4(),i=O4();function o(l){var c=this.__data__=new t(l);this.size=c.size}return o.prototype.clear=e,o.prototype.delete=r,o.prototype.get=n,o.prototype.has=a,o.prototype.set=i,kd=o,kd}var Sd,vC;function _d(){if(vC)return Sd;vC=1;function t(e,r){for(var n=-1,a=e==null?0:e.length;++n<a&&r(e[n],n,e)!==!1;);return e}return Sd=t,Sd}var Td,gC;function mC(){if(gC)return Td;gC=1;var t=fa(),e=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}}();return Td=e,Td}var Nd,yC;function fl(){if(yC)return Nd;yC=1;var t=mC();function e(r,n,a){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return Nd=e,Nd}var Id,bC;function hl(){if(bC)return Id;bC=1;var t=fl(),e=ci(),r=Object.prototype,n=r.hasOwnProperty;function a(i,o,l){var c=i[o];(!(n.call(i,o)&&e(c,l))||l===void 0&&!(o in i))&&t(i,o,l)}return Id=a,Id}var Bd,wC;function xo(){if(wC)return Bd;wC=1;var t=hl(),e=fl();function r(n,a,i,o){var l=!i;i||(i={});for(var c=-1,u=a.length;++c<u;){var d=a[c],f=o?o(i[d],n[d],d,i,n):void 0;f===void 0&&(f=n[d]),l?e(i,d,f):t(i,d,f)}return i}return Bd=r,Bd}var Dd,CC;function A4(){if(CC)return Dd;CC=1;function t(e,r){for(var n=-1,a=Array(e);++n<e;)a[n]=r(n);return a}return Dd=t,Dd}var Pd,EC;function Rr(){if(EC)return Pd;EC=1;function t(e){return e!=null&&typeof e=="object"}return Pd=t,Pd}var Od,xC;function R4(){if(xC)return Od;xC=1;var t=da(),e=Rr(),r="[object Arguments]";function n(a){return e(a)&&t(a)==r}return Od=n,Od}var Ad,kC;function ko(){if(kC)return Ad;kC=1;var t=R4(),e=Rr(),r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,i=t(function(){return arguments}())?t:function(o){return e(o)&&n.call(o,"callee")&&!a.call(o,"callee")};return Ad=i,Ad}var Rd,SC;function ot(){if(SC)return Rd;SC=1;var t=Array.isArray;return Rd=t,Rd}var So={exports:{}},Ld,_C;function L4(){if(_C)return Ld;_C=1;function t(){return!1}return Ld=t,Ld}So.exports;var TC;function fi(){return TC||(TC=1,function(t,e){var r=br(),n=L4(),a=e&&!e.nodeType&&e,i=a&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===a,l=o?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;t.exports=u}(So,So.exports)),So.exports}var Fd,NC;function pl(){if(NC)return Fd;NC=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,a){var i=typeof n;return a=a??t,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return Fd=r,Fd}var Md,IC;function $d(){if(IC)return Md;IC=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return Md=e,Md}var Vd,BC;function F4(){if(BC)return Vd;BC=1;var t=da(),e=$d(),r=Rr(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",l="[object Error]",c="[object Function]",u="[object Map]",d="[object Number]",f="[object Object]",h="[object RegExp]",v="[object Set]",p="[object String]",g="[object WeakMap]",y="[object ArrayBuffer]",m="[object DataView]",b="[object Float32Array]",w="[object Float64Array]",C="[object Int8Array]",x="[object Int16Array]",k="[object Int32Array]",E="[object Uint8Array]",_="[object Uint8ClampedArray]",S="[object Uint16Array]",T="[object Uint32Array]",N={};N[b]=N[w]=N[C]=N[x]=N[k]=N[E]=N[_]=N[S]=N[T]=!0,N[n]=N[a]=N[y]=N[i]=N[m]=N[o]=N[l]=N[c]=N[u]=N[d]=N[f]=N[h]=N[v]=N[p]=N[g]=!1;function B(P){return r(P)&&e(P.length)&&!!N[t(P)]}return Vd=B,Vd}var qd,DC;function vl(){if(DC)return qd;DC=1;function t(e){return function(r){return e(r)}}return qd=t,qd}var _o={exports:{}};_o.exports;var PC;function zd(){return PC||(PC=1,function(t,e){var r=Lw(),n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,i=a&&a.exports===n,o=i&&r.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();t.exports=l}(_o,_o.exports)),_o.exports}var Hd,OC;function To(){if(OC)return Hd;OC=1;var t=F4(),e=vl(),r=zd(),n=r&&r.isTypedArray,a=n?e(n):t;return Hd=a,Hd}var Kd,AC;function RC(){if(AC)return Kd;AC=1;var t=A4(),e=ko(),r=ot(),n=fi(),a=pl(),i=To(),o=Object.prototype,l=o.hasOwnProperty;function c(u,d){var f=r(u),h=!f&&e(u),v=!f&&!h&&n(u),p=!f&&!h&&!v&&i(u),g=f||h||v||p,y=g?t(u.length,String):[],m=y.length;for(var b in u)(d||l.call(u,b))&&!(g&&(b=="length"||v&&(b=="offset"||b=="parent")||p&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||a(b,m)))&&y.push(b);return y}return Kd=c,Kd}var Gd,LC;function gl(){if(LC)return Gd;LC=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||t;return r===a}return Gd=e,Gd}var Ud,FC;function MC(){if(FC)return Ud;FC=1;function t(e,r){return function(n){return e(r(n))}}return Ud=t,Ud}var jd,$C;function M4(){if($C)return jd;$C=1;var t=MC(),e=t(Object.keys,Object);return jd=e,jd}var Wd,VC;function Yd(){if(VC)return Wd;VC=1;var t=gl(),e=M4(),r=Object.prototype,n=r.hasOwnProperty;function a(i){if(!t(i))return e(i);var o=[];for(var l in Object(i))n.call(i,l)&&l!="constructor"&&o.push(l);return o}return Wd=a,Wd}var Zd,qC;function tn(){if(qC)return Zd;qC=1;var t=Eo(),e=$d();function r(n){return n!=null&&e(n.length)&&!t(n)}return Zd=r,Zd}var Xd,zC;function Dn(){if(zC)return Xd;zC=1;var t=RC(),e=Yd(),r=tn();function n(a){return r(a)?t(a):e(a)}return Xd=n,Xd}var Jd,HC;function $4(){if(HC)return Jd;HC=1;var t=xo(),e=Dn();function r(n,a){return n&&t(a,e(a),n)}return Jd=r,Jd}var Qd,KC;function V4(){if(KC)return Qd;KC=1;function t(e){var r=[];if(e!=null)for(var n in Object(e))r.push(n);return r}return Qd=t,Qd}var ef,GC;function q4(){if(GC)return ef;GC=1;var t=or(),e=gl(),r=V4(),n=Object.prototype,a=n.hasOwnProperty;function i(o){if(!t(o))return r(o);var l=e(o),c=[];for(var u in o)u=="constructor"&&(l||!a.call(o,u))||c.push(u);return c}return ef=i,ef}var tf,UC;function ha(){if(UC)return tf;UC=1;var t=RC(),e=q4(),r=tn();function n(a){return r(a)?t(a,!0):e(a)}return tf=n,tf}var rf,jC;function z4(){if(jC)return rf;jC=1;var t=xo(),e=ha();function r(n,a){return n&&t(a,e(a),n)}return rf=r,rf}var No={exports:{}};No.exports;var WC;function YC(){return WC||(WC=1,function(t,e){var r=br(),n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,i=a&&a.exports===n,o=i?r.Buffer:void 0,l=o?o.allocUnsafe:void 0;function c(u,d){if(d)return u.slice();var f=u.length,h=l?l(f):new u.constructor(f);return u.copy(h),h}t.exports=c}(No,No.exports)),No.exports}var nf,ZC;function XC(){if(ZC)return nf;ZC=1;function t(e,r){var n=-1,a=e.length;for(r||(r=Array(a));++n<a;)r[n]=e[n];return r}return nf=t,nf}var af,JC;function QC(){if(JC)return af;JC=1;function t(e,r){for(var n=-1,a=e==null?0:e.length,i=0,o=[];++n<a;){var l=e[n];r(l,n,e)&&(o[i++]=l)}return o}return af=t,af}var of,eE;function tE(){if(eE)return of;eE=1;function t(){return[]}return of=t,of}var sf,rE;function lf(){if(rE)return sf;rE=1;var t=QC(),e=tE(),r=Object.prototype,n=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(o){return o==null?[]:(o=Object(o),t(a(o),function(l){return n.call(o,l)}))}:e;return sf=i,sf}var uf,nE;function H4(){if(nE)return uf;nE=1;var t=xo(),e=lf();function r(n,a){return t(n,e(n),a)}return uf=r,uf}var cf,aE;function df(){if(aE)return cf;aE=1;function t(e,r){for(var n=-1,a=r.length,i=e.length;++n<a;)e[i+n]=r[n];return e}return cf=t,cf}var ff,iE;function ml(){if(iE)return ff;iE=1;var t=MC(),e=t(Object.getPrototypeOf,Object);return ff=e,ff}var hf,oE;function sE(){if(oE)return hf;oE=1;var t=df(),e=ml(),r=lf(),n=tE(),a=Object.getOwnPropertySymbols,i=a?function(o){for(var l=[];o;)t(l,r(o)),o=e(o);return l}:n;return hf=i,hf}var pf,lE;function K4(){if(lE)return pf;lE=1;var t=xo(),e=sE();function r(n,a){return t(n,e(n),a)}return pf=r,pf}var vf,uE;function cE(){if(uE)return vf;uE=1;var t=df(),e=ot();function r(n,a,i){var o=a(n);return e(n)?o:t(o,i(n))}return vf=r,vf}var gf,dE;function fE(){if(dE)return gf;dE=1;var t=cE(),e=lf(),r=Dn();function n(a){return t(a,r,e)}return gf=n,gf}var mf,hE;function G4(){if(hE)return mf;hE=1;var t=cE(),e=sE(),r=ha();function n(a){return t(a,r,e)}return mf=n,mf}var yf,pE;function U4(){if(pE)return yf;pE=1;var t=fa(),e=br(),r=t(e,"DataView");return yf=r,yf}var bf,vE;function j4(){if(vE)return bf;vE=1;var t=fa(),e=br(),r=t(e,"Promise");return bf=r,bf}var wf,gE;function mE(){if(gE)return wf;gE=1;var t=fa(),e=br(),r=t(e,"Set");return wf=r,wf}var Cf,yE;function W4(){if(yE)return Cf;yE=1;var t=fa(),e=br(),r=t(e,"WeakMap");return Cf=r,Cf}var Ef,bE;function hi(){if(bE)return Ef;bE=1;var t=U4(),e=od(),r=j4(),n=mE(),a=W4(),i=da(),o=jw(),l="[object Map]",c="[object Object]",u="[object Promise]",d="[object Set]",f="[object WeakMap]",h="[object DataView]",v=o(t),p=o(e),g=o(r),y=o(n),m=o(a),b=i;return(t&&b(new t(new ArrayBuffer(1)))!=h||e&&b(new e)!=l||r&&b(r.resolve())!=u||n&&b(new n)!=d||a&&b(new a)!=f)&&(b=function(w){var C=i(w),x=C==c?w.constructor:void 0,k=x?o(x):"";if(k)switch(k){case v:return h;case p:return l;case g:return u;case y:return d;case m:return f}return C}),Ef=b,Ef}var xf,wE;function Y4(){if(wE)return xf;wE=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n){var a=n.length,i=new n.constructor(a);return a&&typeof n[0]=="string"&&e.call(n,"index")&&(i.index=n.index,i.input=n.input),i}return xf=r,xf}var kf,CE;function EE(){if(CE)return kf;CE=1;var t=br(),e=t.Uint8Array;return kf=e,kf}var Sf,xE;function _f(){if(xE)return Sf;xE=1;var t=EE();function e(r){var n=new r.constructor(r.byteLength);return new t(n).set(new t(r)),n}return Sf=e,Sf}var Tf,kE;function Z4(){if(kE)return Tf;kE=1;var t=_f();function e(r,n){var a=n?t(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}return Tf=e,Tf}var Nf,SE;function X4(){if(SE)return Nf;SE=1;var t=/\w*$/;function e(r){var n=new r.constructor(r.source,t.exec(r));return n.lastIndex=r.lastIndex,n}return Nf=e,Nf}var If,_E;function J4(){if(_E)return If;_E=1;var t=di(),e=t?t.prototype:void 0,r=e?e.valueOf:void 0;function n(a){return r?Object(r.call(a)):{}}return If=n,If}var Bf,TE;function NE(){if(TE)return Bf;TE=1;var t=_f();function e(r,n){var a=n?t(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}return Bf=e,Bf}var Df,IE;function Q4(){if(IE)return Df;IE=1;var t=_f(),e=Z4(),r=X4(),n=J4(),a=NE(),i="[object Boolean]",o="[object Date]",l="[object Map]",c="[object Number]",u="[object RegExp]",d="[object Set]",f="[object String]",h="[object Symbol]",v="[object ArrayBuffer]",p="[object DataView]",g="[object Float32Array]",y="[object Float64Array]",m="[object Int8Array]",b="[object Int16Array]",w="[object Int32Array]",C="[object Uint8Array]",x="[object Uint8ClampedArray]",k="[object Uint16Array]",E="[object Uint32Array]";function _(S,T,N){var B=S.constructor;switch(T){case v:return t(S);case i:case o:return new B(+S);case p:return e(S,N);case g:case y:case m:case b:case w:case C:case x:case k:case E:return a(S,N);case l:return new B;case c:case f:return new B(S);case u:return r(S);case d:return new B;case h:return n(S)}}return Df=_,Df}var Pf,BE;function DE(){if(BE)return Pf;BE=1;var t=or(),e=Object.create,r=function(){function n(){}return function(a){if(!t(a))return{};if(e)return e(a);n.prototype=a;var i=new n;return n.prototype=void 0,i}}();return Pf=r,Pf}var Of,PE;function OE(){if(PE)return Of;PE=1;var t=DE(),e=ml(),r=gl();function n(a){return typeof a.constructor=="function"&&!r(a)?t(e(a)):{}}return Of=n,Of}var Af,AE;function e8(){if(AE)return Af;AE=1;var t=hi(),e=Rr(),r="[object Map]";function n(a){return e(a)&&t(a)==r}return Af=n,Af}var Rf,RE;function t8(){if(RE)return Rf;RE=1;var t=e8(),e=vl(),r=zd(),n=r&&r.isMap,a=n?e(n):t;return Rf=a,Rf}var Lf,LE;function r8(){if(LE)return Lf;LE=1;var t=hi(),e=Rr(),r="[object Set]";function n(a){return e(a)&&t(a)==r}return Lf=n,Lf}var Ff,FE;function n8(){if(FE)return Ff;FE=1;var t=r8(),e=vl(),r=zd(),n=r&&r.isSet,a=n?e(n):t;return Ff=a,Ff}var Mf,ME;function $E(){if(ME)return Mf;ME=1;var t=dl(),e=_d(),r=hl(),n=$4(),a=z4(),i=YC(),o=XC(),l=H4(),c=K4(),u=fE(),d=G4(),f=hi(),h=Y4(),v=Q4(),p=OE(),g=ot(),y=fi(),m=t8(),b=or(),w=n8(),C=Dn(),x=ha(),k=1,E=2,_=4,S="[object Arguments]",T="[object Array]",N="[object Boolean]",B="[object Date]",P="[object Error]",D="[object Function]",R="[object GeneratorFunction]",O="[object Map]",F="[object Number]",A="[object Object]",z="[object RegExp]",j="[object Set]",H="[object String]",G="[object Symbol]",X="[object WeakMap]",M="[object ArrayBuffer]",V="[object DataView]",q="[object Float32Array]",$="[object Float64Array]",K="[object Int8Array]",L="[object Int16Array]",W="[object Int32Array]",Y="[object Uint8Array]",se="[object Uint8ClampedArray]",ue="[object Uint16Array]",ae="[object Uint32Array]",ne={};ne[S]=ne[T]=ne[M]=ne[V]=ne[N]=ne[B]=ne[q]=ne[$]=ne[K]=ne[L]=ne[W]=ne[O]=ne[F]=ne[A]=ne[z]=ne[j]=ne[H]=ne[G]=ne[Y]=ne[se]=ne[ue]=ne[ae]=!0,ne[P]=ne[D]=ne[X]=!1;function ce(ie,fe,pe,Pe,Ie,we){var xe,re=fe&k,I=fe&E,U=fe&_;if(pe&&(xe=Ie?pe(ie,Pe,Ie,we):pe(ie)),xe!==void 0)return xe;if(!b(ie))return ie;var te=g(ie);if(te){if(xe=h(ie),!re)return o(ie,xe)}else{var Z=f(ie),J=Z==D||Z==R;if(y(ie))return i(ie,re);if(Z==A||Z==S||J&&!Ie){if(xe=I||J?{}:p(ie),!re)return I?c(ie,a(xe,ie)):l(ie,n(xe,ie))}else{if(!ne[Z])return Ie?ie:{};xe=v(ie,Z,re)}}we||(we=new t);var le=we.get(ie);if(le)return le;we.set(ie,xe),w(ie)?ie.forEach(function(me){xe.add(ce(me,fe,pe,me,ie,we))}):m(ie)&&ie.forEach(function(me,be){xe.set(be,ce(me,fe,pe,be,ie,we))});var ee=U?I?d:u:I?x:C,oe=te?void 0:ee(ie);return e(oe||ie,function(me,be){oe&&(be=me,me=ie[be]),r(xe,be,ce(me,fe,pe,be,ie,we))}),xe}return Mf=ce,Mf}var $f,VE;function a8(){if(VE)return $f;VE=1;var t=$E(),e=4;function r(n){return t(n,e)}return $f=r,$f}var Vf,qE;function qf(){if(qE)return Vf;qE=1;function t(e){return function(){return e}}return Vf=t,Vf}var zf,zE;function i8(){if(zE)return zf;zE=1;function t(e){return function(r,n,a){for(var i=-1,o=Object(r),l=a(r),c=l.length;c--;){var u=l[e?c:++i];if(n(o[u],u,o)===!1)break}return r}}return zf=t,zf}var Hf,HE;function Kf(){if(HE)return Hf;HE=1;var t=i8(),e=t();return Hf=e,Hf}var Gf,KE;function Uf(){if(KE)return Gf;KE=1;var t=Kf(),e=Dn();function r(n,a){return n&&t(n,a,e)}return Gf=r,Gf}var jf,GE;function o8(){if(GE)return jf;GE=1;var t=tn();function e(r,n){return function(a,i){if(a==null)return a;if(!t(a))return r(a,i);for(var o=a.length,l=n?o:-1,c=Object(a);(n?l--:++l<o)&&i(c[l],l,c)!==!1;);return a}}return jf=e,jf}var Wf,UE;function yl(){if(UE)return Wf;UE=1;var t=Uf(),e=o8(),r=e(t);return Wf=r,Wf}var Yf,jE;function pa(){if(jE)return Yf;jE=1;function t(e){return e}return Yf=t,Yf}var Zf,WE;function YE(){if(WE)return Zf;WE=1;var t=pa();function e(r){return typeof r=="function"?r:t}return Zf=e,Zf}var Xf,ZE;function XE(){if(ZE)return Xf;ZE=1;var t=_d(),e=yl(),r=YE(),n=ot();function a(i,o){var l=n(i)?t:e;return l(i,r(o))}return Xf=a,Xf}var Jf,JE;function QE(){return JE||(JE=1,Jf=XE()),Jf}var Qf,ex;function s8(){if(ex)return Qf;ex=1;var t=yl();function e(r,n){var a=[];return t(r,function(i,o,l){n(i,o,l)&&a.push(i)}),a}return Qf=e,Qf}var eh,tx;function l8(){if(tx)return eh;tx=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return eh=e,eh}var th,rx;function u8(){if(rx)return th;rx=1;function t(e){return this.__data__.has(e)}return th=t,th}var rh,nx;function ax(){if(nx)return rh;nx=1;var t=Ed(),e=l8(),r=u8();function n(a){var i=-1,o=a==null?0:a.length;for(this.__data__=new t;++i<o;)this.add(a[i])}return n.prototype.add=n.prototype.push=e,n.prototype.has=r,rh=n,rh}var nh,ix;function c8(){if(ix)return nh;ix=1;function t(e,r){for(var n=-1,a=e==null?0:e.length;++n<a;)if(r(e[n],n,e))return!0;return!1}return nh=t,nh}var ah,ox;function sx(){if(ox)return ah;ox=1;function t(e,r){return e.has(r)}return ah=t,ah}var ih,lx;function ux(){if(lx)return ih;lx=1;var t=ax(),e=c8(),r=sx(),n=1,a=2;function i(o,l,c,u,d,f){var h=c&n,v=o.length,p=l.length;if(v!=p&&!(h&&p>v))return!1;var g=f.get(o),y=f.get(l);if(g&&y)return g==l&&y==o;var m=-1,b=!0,w=c&a?new t:void 0;for(f.set(o,l),f.set(l,o);++m<v;){var C=o[m],x=l[m];if(u)var k=h?u(x,C,m,l,o,f):u(C,x,m,o,l,f);if(k!==void 0){if(k)continue;b=!1;break}if(w){if(!e(l,function(E,_){if(!r(w,_)&&(C===E||d(C,E,c,u,f)))return w.push(_)})){b=!1;break}}else if(!(C===x||d(C,x,c,u,f))){b=!1;break}}return f.delete(o),f.delete(l),b}return ih=i,ih}var oh,cx;function d8(){if(cx)return oh;cx=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a,i){n[++r]=[i,a]}),n}return oh=t,oh}var sh,dx;function lh(){if(dx)return sh;dx=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a){n[++r]=a}),n}return sh=t,sh}var uh,fx;function f8(){if(fx)return uh;fx=1;var t=di(),e=EE(),r=ci(),n=ux(),a=d8(),i=lh(),o=1,l=2,c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Map]",h="[object Number]",v="[object RegExp]",p="[object Set]",g="[object String]",y="[object Symbol]",m="[object ArrayBuffer]",b="[object DataView]",w=t?t.prototype:void 0,C=w?w.valueOf:void 0;function x(k,E,_,S,T,N,B){switch(_){case b:if(k.byteLength!=E.byteLength||k.byteOffset!=E.byteOffset)return!1;k=k.buffer,E=E.buffer;case m:return!(k.byteLength!=E.byteLength||!N(new e(k),new e(E)));case c:case u:case h:return r(+k,+E);case d:return k.name==E.name&&k.message==E.message;case v:case g:return k==E+"";case f:var P=a;case p:var D=S&o;if(P||(P=i),k.size!=E.size&&!D)return!1;var R=B.get(k);if(R)return R==E;S|=l,B.set(k,E);var O=n(P(k),P(E),S,T,N,B);return B.delete(k),O;case y:if(C)return C.call(k)==C.call(E)}return!1}return uh=x,uh}var ch,hx;function h8(){if(hx)return ch;hx=1;var t=fE(),e=1,r=Object.prototype,n=r.hasOwnProperty;function a(i,o,l,c,u,d){var f=l&e,h=t(i),v=h.length,p=t(o),g=p.length;if(v!=g&&!f)return!1;for(var y=v;y--;){var m=h[y];if(!(f?m in o:n.call(o,m)))return!1}var b=d.get(i),w=d.get(o);if(b&&w)return b==o&&w==i;var C=!0;d.set(i,o),d.set(o,i);for(var x=f;++y<v;){m=h[y];var k=i[m],E=o[m];if(c)var _=f?c(E,k,m,o,i,d):c(k,E,m,i,o,d);if(!(_===void 0?k===E||u(k,E,l,c,d):_)){C=!1;break}x||(x=m=="constructor")}if(C&&!x){var S=i.constructor,T=o.constructor;S!=T&&"constructor"in i&&"constructor"in o&&!(typeof S=="function"&&S instanceof S&&typeof T=="function"&&T instanceof T)&&(C=!1)}return d.delete(i),d.delete(o),C}return ch=a,ch}var dh,px;function p8(){if(px)return dh;px=1;var t=dl(),e=ux(),r=f8(),n=h8(),a=hi(),i=ot(),o=fi(),l=To(),c=1,u="[object Arguments]",d="[object Array]",f="[object Object]",h=Object.prototype,v=h.hasOwnProperty;function p(g,y,m,b,w,C){var x=i(g),k=i(y),E=x?d:a(g),_=k?d:a(y);E=E==u?f:E,_=_==u?f:_;var S=E==f,T=_==f,N=E==_;if(N&&o(g)){if(!o(y))return!1;x=!0,S=!1}if(N&&!S)return C||(C=new t),x||l(g)?e(g,y,m,b,w,C):r(g,y,E,m,b,w,C);if(!(m&c)){var B=S&&v.call(g,"__wrapped__"),P=T&&v.call(y,"__wrapped__");if(B||P){var D=B?g.value():g,R=P?y.value():y;return C||(C=new t),w(D,R,m,b,C)}}return N?(C||(C=new t),n(g,y,m,b,w,C)):!1}return dh=p,dh}var fh,vx;function gx(){if(vx)return fh;vx=1;var t=p8(),e=Rr();function r(n,a,i,o,l){return n===a?!0:n==null||a==null||!e(n)&&!e(a)?n!==n&&a!==a:t(n,a,i,o,r,l)}return fh=r,fh}var hh,mx;function v8(){if(mx)return hh;mx=1;var t=dl(),e=gx(),r=1,n=2;function a(i,o,l,c){var u=l.length,d=u,f=!c;if(i==null)return!d;for(i=Object(i);u--;){var h=l[u];if(f&&h[2]?h[1]!==i[h[0]]:!(h[0]in i))return!1}for(;++u<d;){h=l[u];var v=h[0],p=i[v],g=h[1];if(f&&h[2]){if(p===void 0&&!(v in i))return!1}else{var y=new t;if(c)var m=c(p,g,v,i,o,y);if(!(m===void 0?e(g,p,r|n,c,y):m))return!1}}return!0}return hh=a,hh}var ph,yx;function bx(){if(yx)return ph;yx=1;var t=or();function e(r){return r===r&&!t(r)}return ph=e,ph}var vh,wx;function g8(){if(wx)return vh;wx=1;var t=bx(),e=Dn();function r(n){for(var a=e(n),i=a.length;i--;){var o=a[i],l=n[o];a[i]=[o,l,t(l)]}return a}return vh=r,vh}var gh,Cx;function Ex(){if(Cx)return gh;Cx=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return gh=t,gh}var mh,xx;function m8(){if(xx)return mh;xx=1;var t=v8(),e=g8(),r=Ex();function n(a){var i=e(a);return i.length==1&&i[0][2]?r(i[0][0],i[0][1]):function(o){return o===a||t(o,a,i)}}return mh=n,mh}var yh,kx;function pi(){if(kx)return yh;kx=1;var t=da(),e=Rr(),r="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&t(a)==r}return yh=n,yh}var bh,Sx;function wh(){if(Sx)return bh;Sx=1;var t=ot(),e=pi(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(t(i))return!1;var l=typeof i;return l=="number"||l=="symbol"||l=="boolean"||i==null||e(i)?!0:n.test(i)||!r.test(i)||o!=null&&i in Object(o)}return bh=a,bh}var Ch,_x;function y8(){if(_x)return Ch;_x=1;var t=Ed(),e="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var o=arguments,l=a?a.apply(this,o):o[0],c=i.cache;if(c.has(l))return c.get(l);var u=n.apply(this,o);return i.cache=c.set(l,u)||c,u};return i.cache=new(r.Cache||t),i}return r.Cache=t,Ch=r,Ch}var Eh,Tx;function b8(){if(Tx)return Eh;Tx=1;var t=y8(),e=500;function r(n){var a=t(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return Eh=r,Eh}var xh,Nx;function w8(){if(Nx)return xh;Nx=1;var t=b8(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(o,l,c,u){i.push(c?u.replace(r,"$1"):l||o)}),i});return xh=n,xh}var kh,Ix;function bl(){if(Ix)return kh;Ix=1;function t(e,r){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=r(e[n],n,e);return i}return kh=t,kh}var Sh,Bx;function C8(){if(Bx)return Sh;Bx=1;var t=di(),e=bl(),r=ot(),n=pi(),a=1/0,i=t?t.prototype:void 0,o=i?i.toString:void 0;function l(c){if(typeof c=="string")return c;if(r(c))return e(c,l)+"";if(n(c))return o?o.call(c):"";var u=c+"";return u=="0"&&1/c==-a?"-0":u}return Sh=l,Sh}var _h,Dx;function Px(){if(Dx)return _h;Dx=1;var t=C8();function e(r){return r==null?"":t(r)}return _h=e,_h}var Th,Ox;function wl(){if(Ox)return Th;Ox=1;var t=ot(),e=wh(),r=w8(),n=Px();function a(i,o){return t(i)?i:e(i,o)?[i]:r(n(i))}return Th=a,Th}var Nh,Ax;function Io(){if(Ax)return Nh;Ax=1;var t=pi(),e=1/0;function r(n){if(typeof n=="string"||t(n))return n;var a=n+"";return a=="0"&&1/n==-e?"-0":a}return Nh=r,Nh}var Ih,Rx;function Cl(){if(Rx)return Ih;Rx=1;var t=wl(),e=Io();function r(n,a){a=t(a,n);for(var i=0,o=a.length;n!=null&&i<o;)n=n[e(a[i++])];return i&&i==o?n:void 0}return Ih=r,Ih}var Bh,Lx;function E8(){if(Lx)return Bh;Lx=1;var t=Cl();function e(r,n,a){var i=r==null?void 0:t(r,n);return i===void 0?a:i}return Bh=e,Bh}var Dh,Fx;function x8(){if(Fx)return Dh;Fx=1;function t(e,r){return e!=null&&r in Object(e)}return Dh=t,Dh}var Ph,Mx;function $x(){if(Mx)return Ph;Mx=1;var t=wl(),e=ko(),r=ot(),n=pl(),a=$d(),i=Io();function o(l,c,u){c=t(c,l);for(var d=-1,f=c.length,h=!1;++d<f;){var v=i(c[d]);if(!(h=l!=null&&u(l,v)))break;l=l[v]}return h||++d!=f?h:(f=l==null?0:l.length,!!f&&a(f)&&n(v,f)&&(r(l)||e(l)))}return Ph=o,Ph}var Oh,Vx;function qx(){if(Vx)return Oh;Vx=1;var t=x8(),e=$x();function r(n,a){return n!=null&&e(n,a,t)}return Oh=r,Oh}var Ah,zx;function k8(){if(zx)return Ah;zx=1;var t=gx(),e=E8(),r=qx(),n=wh(),a=bx(),i=Ex(),o=Io(),l=1,c=2;function u(d,f){return n(d)&&a(f)?i(o(d),f):function(h){var v=e(h,d);return v===void 0&&v===f?r(h,d):t(f,v,l|c)}}return Ah=u,Ah}var Rh,Hx;function Kx(){if(Hx)return Rh;Hx=1;function t(e){return function(r){return r==null?void 0:r[e]}}return Rh=t,Rh}var Lh,Gx;function S8(){if(Gx)return Lh;Gx=1;var t=Cl();function e(r){return function(n){return t(n,r)}}return Lh=e,Lh}var Fh,Ux;function _8(){if(Ux)return Fh;Ux=1;var t=Kx(),e=S8(),r=wh(),n=Io();function a(i){return r(i)?t(n(i)):e(i)}return Fh=a,Fh}var Mh,jx;function rn(){if(jx)return Mh;jx=1;var t=m8(),e=k8(),r=pa(),n=ot(),a=_8();function i(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?n(o)?e(o[0],o[1]):t(o):a(o)}return Mh=i,Mh}var $h,Wx;function Yx(){if(Wx)return $h;Wx=1;var t=QC(),e=s8(),r=rn(),n=ot();function a(i,o){var l=n(i)?t:e;return l(i,r(o,3))}return $h=a,$h}var Vh,Zx;function T8(){if(Zx)return Vh;Zx=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n,a){return n!=null&&e.call(n,a)}return Vh=r,Vh}var qh,Xx;function Jx(){if(Xx)return qh;Xx=1;var t=T8(),e=$x();function r(n,a){return n!=null&&e(n,a,t)}return qh=r,qh}var zh,Qx;function N8(){if(Qx)return zh;Qx=1;var t=Yd(),e=hi(),r=ko(),n=ot(),a=tn(),i=fi(),o=gl(),l=To(),c="[object Map]",u="[object Set]",d=Object.prototype,f=d.hasOwnProperty;function h(v){if(v==null)return!0;if(a(v)&&(n(v)||typeof v=="string"||typeof v.splice=="function"||i(v)||l(v)||r(v)))return!v.length;var p=e(v);if(p==c||p==u)return!v.size;if(o(v))return!t(v).length;for(var g in v)if(f.call(v,g))return!1;return!0}return zh=h,zh}var Hh,ek;function tk(){if(ek)return Hh;ek=1;function t(e){return e===void 0}return Hh=t,Hh}var Kh,rk;function nk(){if(rk)return Kh;rk=1;var t=yl(),e=tn();function r(n,a){var i=-1,o=e(n)?Array(n.length):[];return t(n,function(l,c,u){o[++i]=a(l,c,u)}),o}return Kh=r,Kh}var Gh,ak;function ik(){if(ak)return Gh;ak=1;var t=bl(),e=rn(),r=nk(),n=ot();function a(i,o){var l=n(i)?t:r;return l(i,e(o,3))}return Gh=a,Gh}var Uh,ok;function I8(){if(ok)return Uh;ok=1;function t(e,r,n,a){var i=-1,o=e==null?0:e.length;for(a&&o&&(n=e[++i]);++i<o;)n=r(n,e[i],i,e);return n}return Uh=t,Uh}var jh,sk;function B8(){if(sk)return jh;sk=1;function t(e,r,n,a,i){return i(e,function(o,l,c){n=a?(a=!1,o):r(n,o,l,c)}),n}return jh=t,jh}var Wh,lk;function uk(){if(lk)return Wh;lk=1;var t=I8(),e=yl(),r=rn(),n=B8(),a=ot();function i(o,l,c){var u=a(o)?t:n,d=arguments.length<3;return u(o,r(l,4),c,d,e)}return Wh=i,Wh}var Yh,ck;function D8(){if(ck)return Yh;ck=1;var t=da(),e=ot(),r=Rr(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&r(i)&&t(i)==n}return Yh=a,Yh}var Zh,dk;function P8(){if(dk)return Zh;dk=1;var t=Kx(),e=t("length");return Zh=e,Zh}var Xh,fk;function O8(){if(fk)return Xh;fk=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+r+n,i="\\ufe0e\\ufe0f",o="\\u200d",l=RegExp("["+o+t+a+i+"]");function c(u){return l.test(u)}return Xh=c,Xh}var Jh,hk;function A8(){if(hk)return Jh;hk=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+r+n,i="\\ufe0e\\ufe0f",o="["+t+"]",l="["+a+"]",c="\\ud83c[\\udffb-\\udfff]",u="(?:"+l+"|"+c+")",d="[^"+t+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",p=u+"?",g="["+i+"]?",y="(?:"+v+"(?:"+[d,f,h].join("|")+")"+g+p+")*",m=g+p+y,b="(?:"+[d+l+"?",l,f,h,o].join("|")+")",w=RegExp(c+"(?="+c+")|"+b+m,"g");function C(x){for(var k=w.lastIndex=0;w.test(x);)++k;return k}return Jh=C,Jh}var Qh,pk;function R8(){if(pk)return Qh;pk=1;var t=P8(),e=O8(),r=A8();function n(a){return e(a)?r(a):t(a)}return Qh=n,Qh}var ep,vk;function L8(){if(vk)return ep;vk=1;var t=Yd(),e=hi(),r=tn(),n=D8(),a=R8(),i="[object Map]",o="[object Set]";function l(c){if(c==null)return 0;if(r(c))return n(c)?a(c):c.length;var u=e(c);return u==i||u==o?c.size:t(c).length}return ep=l,ep}var tp,gk;function F8(){if(gk)return tp;gk=1;var t=_d(),e=DE(),r=Uf(),n=rn(),a=ml(),i=ot(),o=fi(),l=Eo(),c=or(),u=To();function d(f,h,v){var p=i(f),g=p||o(f)||u(f);if(h=n(h,4),v==null){var y=f&&f.constructor;g?v=p?new y:[]:c(f)?v=l(y)?e(a(f)):{}:v={}}return(g?t:r)(f,function(m,b,w){return h(v,m,b,w)}),v}return tp=d,tp}var rp,mk;function M8(){if(mk)return rp;mk=1;var t=di(),e=ko(),r=ot(),n=t?t.isConcatSpreadable:void 0;function a(i){return r(i)||e(i)||!!(n&&i&&i[n])}return rp=a,rp}var np,yk;function ap(){if(yk)return np;yk=1;var t=df(),e=M8();function r(n,a,i,o,l){var c=-1,u=n.length;for(i||(i=e),l||(l=[]);++c<u;){var d=n[c];a>0&&i(d)?a>1?r(d,a-1,i,o,l):t(l,d):o||(l[l.length]=d)}return l}return np=r,np}var ip,bk;function $8(){if(bk)return ip;bk=1;function t(e,r,n){switch(n.length){case 0:return e.call(r);case 1:return e.call(r,n[0]);case 2:return e.call(r,n[0],n[1]);case 3:return e.call(r,n[0],n[1],n[2])}return e.apply(r,n)}return ip=t,ip}var op,wk;function Ck(){if(wk)return op;wk=1;var t=$8(),e=Math.max;function r(n,a,i){return a=e(a===void 0?n.length-1:a,0),function(){for(var o=arguments,l=-1,c=e(o.length-a,0),u=Array(c);++l<c;)u[l]=o[a+l];l=-1;for(var d=Array(a+1);++l<a;)d[l]=o[l];return d[a]=i(u),t(n,this,d)}}return op=r,op}var sp,Ek;function V8(){if(Ek)return sp;Ek=1;var t=qf(),e=mC(),r=pa(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:t(i),writable:!0})}:r;return sp=n,sp}var lp,xk;function q8(){if(xk)return lp;xk=1;var t=800,e=16,r=Date.now;function n(a){var i=0,o=0;return function(){var l=r(),c=e-(l-o);if(o=l,c>0){if(++i>=t)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return lp=n,lp}var up,kk;function Sk(){if(kk)return up;kk=1;var t=V8(),e=q8(),r=e(t);return up=r,up}var cp,_k;function El(){if(_k)return cp;_k=1;var t=pa(),e=Ck(),r=Sk();function n(a,i){return r(e(a,i,t),a+"")}return cp=n,cp}var dp,Tk;function Nk(){if(Tk)return dp;Tk=1;function t(e,r,n,a){for(var i=e.length,o=n+(a?1:-1);a?o--:++o<i;)if(r(e[o],o,e))return o;return-1}return dp=t,dp}var fp,Ik;function z8(){if(Ik)return fp;Ik=1;function t(e){return e!==e}return fp=t,fp}var hp,Bk;function H8(){if(Bk)return hp;Bk=1;function t(e,r,n){for(var a=n-1,i=e.length;++a<i;)if(e[a]===r)return a;return-1}return hp=t,hp}var pp,Dk;function K8(){if(Dk)return pp;Dk=1;var t=Nk(),e=z8(),r=H8();function n(a,i,o){return i===i?r(a,i,o):t(a,e,o)}return pp=n,pp}var vp,Pk;function G8(){if(Pk)return vp;Pk=1;var t=K8();function e(r,n){var a=r==null?0:r.length;return!!a&&t(r,n,0)>-1}return vp=e,vp}var gp,Ok;function U8(){if(Ok)return gp;Ok=1;function t(e,r,n){for(var a=-1,i=e==null?0:e.length;++a<i;)if(n(r,e[a]))return!0;return!1}return gp=t,gp}var mp,Ak;function j8(){if(Ak)return mp;Ak=1;function t(){}return mp=t,mp}var yp,Rk;function W8(){if(Rk)return yp;Rk=1;var t=mE(),e=j8(),r=lh(),n=1/0,a=t&&1/r(new t([,-0]))[1]==n?function(i){return new t(i)}:e;return yp=a,yp}var bp,Lk;function Y8(){if(Lk)return bp;Lk=1;var t=ax(),e=G8(),r=U8(),n=sx(),a=W8(),i=lh(),o=200;function l(c,u,d){var f=-1,h=e,v=c.length,p=!0,g=[],y=g;if(d)p=!1,h=r;else if(v>=o){var m=u?null:a(c);if(m)return i(m);p=!1,h=n,y=new t}else y=u?[]:g;e:for(;++f<v;){var b=c[f],w=u?u(b):b;if(b=d||b!==0?b:0,p&&w===w){for(var C=y.length;C--;)if(y[C]===w)continue e;u&&y.push(w),g.push(b)}else h(y,w,d)||(y!==g&&y.push(w),g.push(b))}return g}return bp=l,bp}var wp,Fk;function Mk(){if(Fk)return wp;Fk=1;var t=tn(),e=Rr();function r(n){return e(n)&&t(n)}return wp=r,wp}var Cp,$k;function Z8(){if($k)return Cp;$k=1;var t=ap(),e=El(),r=Y8(),n=Mk(),a=e(function(i){return r(t(i,1,n,!0))});return Cp=a,Cp}var Ep,Vk;function X8(){if(Vk)return Ep;Vk=1;var t=bl();function e(r,n){return t(n,function(a){return r[a]})}return Ep=e,Ep}var xp,qk;function zk(){if(qk)return xp;qk=1;var t=X8(),e=Dn();function r(n){return n==null?[]:t(n,e(n))}return xp=r,xp}var kp,Hk;function sr(){if(Hk)return kp;Hk=1;var t;if(typeof Pc=="function")try{t={clone:a8(),constant:qf(),each:QE(),filter:Yx(),has:Jx(),isArray:ot(),isEmpty:N8(),isFunction:Eo(),isUndefined:tk(),keys:Dn(),map:ik(),reduce:uk(),size:L8(),transform:F8(),union:Z8(),values:zk()}}catch{}return t||(t=window._),kp=t,kp}var Sp,Kk;function _p(){if(Kk)return Sp;Kk=1;var t=sr();Sp=a;var e="\0",r="\0",n="";function a(d){this._isDirected=t.has(d,"directed")?d.directed:!0,this._isMultigraph=t.has(d,"multigraph")?d.multigraph:!1,this._isCompound=t.has(d,"compound")?d.compound:!1,this._label=void 0,this._defaultNodeLabelFn=t.constant(void 0),this._defaultEdgeLabelFn=t.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(d){return this._label=d,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(d){return t.isFunction(d)||(d=t.constant(d)),this._defaultNodeLabelFn=d,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return t.keys(this._nodes)},a.prototype.sources=function(){var d=this;return t.filter(this.nodes(),function(f){return t.isEmpty(d._in[f])})},a.prototype.sinks=function(){var d=this;return t.filter(this.nodes(),function(f){return t.isEmpty(d._out[f])})},a.prototype.setNodes=function(d,f){var h=arguments,v=this;return t.each(d,function(p){h.length>1?v.setNode(p,f):v.setNode(p)}),this},a.prototype.setNode=function(d,f){return t.has(this._nodes,d)?(arguments.length>1&&(this._nodes[d]=f),this):(this._nodes[d]=arguments.length>1?f:this._defaultNodeLabelFn(d),this._isCompound&&(this._parent[d]=r,this._children[d]={},this._children[r][d]=!0),this._in[d]={},this._preds[d]={},this._out[d]={},this._sucs[d]={},++this._nodeCount,this)},a.prototype.node=function(d){return this._nodes[d]},a.prototype.hasNode=function(d){return t.has(this._nodes,d)},a.prototype.removeNode=function(d){var f=this;if(t.has(this._nodes,d)){var h=function(v){f.removeEdge(f._edgeObjs[v])};delete this._nodes[d],this._isCompound&&(this._removeFromParentsChildList(d),delete this._parent[d],t.each(this.children(d),function(v){f.setParent(v)}),delete this._children[d]),t.each(t.keys(this._in[d]),h),delete this._in[d],delete this._preds[d],t.each(t.keys(this._out[d]),h),delete this._out[d],delete this._sucs[d],--this._nodeCount}return this},a.prototype.setParent=function(d,f){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t.isUndefined(f))f=r;else{f+="";for(var h=f;!t.isUndefined(h);h=this.parent(h))if(h===d)throw new Error("Setting "+f+" as parent of "+d+" would create a cycle");this.setNode(f)}return this.setNode(d),this._removeFromParentsChildList(d),this._parent[d]=f,this._children[f][d]=!0,this},a.prototype._removeFromParentsChildList=function(d){delete this._children[this._parent[d]][d]},a.prototype.parent=function(d){if(this._isCompound){var f=this._parent[d];if(f!==r)return f}},a.prototype.children=function(d){if(t.isUndefined(d)&&(d=r),this._isCompound){var f=this._children[d];if(f)return t.keys(f)}else{if(d===r)return this.nodes();if(this.hasNode(d))return[]}},a.prototype.predecessors=function(d){var f=this._preds[d];if(f)return t.keys(f)},a.prototype.successors=function(d){var f=this._sucs[d];if(f)return t.keys(f)},a.prototype.neighbors=function(d){var f=this.predecessors(d);if(f)return t.union(f,this.successors(d))},a.prototype.isLeaf=function(d){var f;return this.isDirected()?f=this.successors(d):f=this.neighbors(d),f.length===0},a.prototype.filterNodes=function(d){var f=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});f.setGraph(this.graph());var h=this;t.each(this._nodes,function(g,y){d(y)&&f.setNode(y,g)}),t.each(this._edgeObjs,function(g){f.hasNode(g.v)&&f.hasNode(g.w)&&f.setEdge(g,h.edge(g))});var v={};function p(g){var y=h.parent(g);return y===void 0||f.hasNode(y)?(v[g]=y,y):y in v?v[y]:p(y)}return this._isCompound&&t.each(f.nodes(),function(g){f.setParent(g,p(g))}),f},a.prototype.setDefaultEdgeLabel=function(d){return t.isFunction(d)||(d=t.constant(d)),this._defaultEdgeLabelFn=d,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return t.values(this._edgeObjs)},a.prototype.setPath=function(d,f){var h=this,v=arguments;return t.reduce(d,function(p,g){return v.length>1?h.setEdge(p,g,f):h.setEdge(p,g),g}),this},a.prototype.setEdge=function(){var d,f,h,v,p=!1,g=arguments[0];typeof g=="object"&&g!==null&&"v"in g?(d=g.v,f=g.w,h=g.name,arguments.length===2&&(v=arguments[1],p=!0)):(d=g,f=arguments[1],h=arguments[3],arguments.length>2&&(v=arguments[2],p=!0)),d=""+d,f=""+f,t.isUndefined(h)||(h=""+h);var y=l(this._isDirected,d,f,h);if(t.has(this._edgeLabels,y))return p&&(this._edgeLabels[y]=v),this;if(!t.isUndefined(h)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(d),this.setNode(f),this._edgeLabels[y]=p?v:this._defaultEdgeLabelFn(d,f,h);var m=c(this._isDirected,d,f,h);return d=m.v,f=m.w,Object.freeze(m),this._edgeObjs[y]=m,i(this._preds[f],d),i(this._sucs[d],f),this._in[f][y]=m,this._out[d][y]=m,this._edgeCount++,this},a.prototype.edge=function(d,f,h){var v=arguments.length===1?u(this._isDirected,arguments[0]):l(this._isDirected,d,f,h);return this._edgeLabels[v]},a.prototype.hasEdge=function(d,f,h){var v=arguments.length===1?u(this._isDirected,arguments[0]):l(this._isDirected,d,f,h);return t.has(this._edgeLabels,v)},a.prototype.removeEdge=function(d,f,h){var v=arguments.length===1?u(this._isDirected,arguments[0]):l(this._isDirected,d,f,h),p=this._edgeObjs[v];return p&&(d=p.v,f=p.w,delete this._edgeLabels[v],delete this._edgeObjs[v],o(this._preds[f],d),o(this._sucs[d],f),delete this._in[f][v],delete this._out[d][v],this._edgeCount--),this},a.prototype.inEdges=function(d,f){var h=this._in[d];if(h){var v=t.values(h);return f?t.filter(v,function(p){return p.v===f}):v}},a.prototype.outEdges=function(d,f){var h=this._out[d];if(h){var v=t.values(h);return f?t.filter(v,function(p){return p.w===f}):v}},a.prototype.nodeEdges=function(d,f){var h=this.inEdges(d,f);if(h)return h.concat(this.outEdges(d,f))};function i(d,f){d[f]?d[f]++:d[f]=1}function o(d,f){--d[f]||delete d[f]}function l(d,f,h,v){var p=""+f,g=""+h;if(!d&&p>g){var y=p;p=g,g=y}return p+n+g+n+(t.isUndefined(v)?e:v)}function c(d,f,h,v){var p=""+f,g=""+h;if(!d&&p>g){var y=p;p=g,g=y}var m={v:p,w:g};return v&&(m.name=v),m}function u(d,f){return l(d,f.v,f.w,f.name)}return Sp}var Tp,Gk;function J8(){return Gk||(Gk=1,Tp="2.1.8"),Tp}var Np,Uk;function Q8(){return Uk||(Uk=1,Np={Graph:_p(),version:J8()}),Np}var Ip,jk;function e6(){if(jk)return Ip;jk=1;var t=sr(),e=_p();Ip={write:r,read:i};function r(o){var l={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:n(o),edges:a(o)};return t.isUndefined(o.graph())||(l.value=t.clone(o.graph())),l}function n(o){return t.map(o.nodes(),function(l){var c=o.node(l),u=o.parent(l),d={v:l};return t.isUndefined(c)||(d.value=c),t.isUndefined(u)||(d.parent=u),d})}function a(o){return t.map(o.edges(),function(l){var c=o.edge(l),u={v:l.v,w:l.w};return t.isUndefined(l.name)||(u.name=l.name),t.isUndefined(c)||(u.value=c),u})}function i(o){var l=new e(o.options).setGraph(o.value);return t.each(o.nodes,function(c){l.setNode(c.v,c.value),c.parent&&l.setParent(c.v,c.parent)}),t.each(o.edges,function(c){l.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),l}return Ip}var Bp,Wk;function t6(){if(Wk)return Bp;Wk=1;var t=sr();Bp=e;function e(r){var n={},a=[],i;function o(l){t.has(n,l)||(n[l]=!0,i.push(l),t.each(r.successors(l),o),t.each(r.predecessors(l),o))}return t.each(r.nodes(),function(l){i=[],o(l),i.length&&a.push(i)}),a}return Bp}var Dp,Yk;function Zk(){if(Yk)return Dp;Yk=1;var t=sr();Dp=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(r){return r.key})},e.prototype.has=function(r){return t.has(this._keyIndices,r)},e.prototype.priority=function(r){var n=this._keyIndices[r];if(n!==void 0)return this._arr[n].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(r,n){var a=this._keyIndices;if(r=String(r),!t.has(a,r)){var i=this._arr,o=i.length;return a[r]=o,i.push({key:r,priority:n}),this._decrease(o),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},e.prototype.decrease=function(r,n){var a=this._keyIndices[r];if(n>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[a].priority+" New: "+n);this._arr[a].priority=n,this._decrease(a)},e.prototype._heapify=function(r){var n=this._arr,a=2*r,i=a+1,o=r;a<n.length&&(o=n[a].priority<n[o].priority?a:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==r&&(this._swap(r,o),this._heapify(o)))},e.prototype._decrease=function(r){for(var n=this._arr,a=n[r].priority,i;r!==0&&(i=r>>1,!(n[i].priority<a));)this._swap(r,i),r=i},e.prototype._swap=function(r,n){var a=this._arr,i=this._keyIndices,o=a[r],l=a[n];a[r]=l,a[n]=o,i[l.key]=r,i[o.key]=n},Dp}var Pp,Xk;function Jk(){if(Xk)return Pp;Xk=1;var t=sr(),e=Zk();Pp=n;var r=t.constant(1);function n(i,o,l,c){return a(i,String(o),l||r,c||function(u){return i.outEdges(u)})}function a(i,o,l,c){var u={},d=new e,f,h,v=function(p){var g=p.v!==f?p.v:p.w,y=u[g],m=l(p),b=h.distance+m;if(m<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+m);b<y.distance&&(y.distance=b,y.predecessor=f,d.decrease(g,b))};for(i.nodes().forEach(function(p){var g=p===o?0:Number.POSITIVE_INFINITY;u[p]={distance:g},d.add(p,g)});d.size()>0&&(f=d.removeMin(),h=u[f],h.distance!==Number.POSITIVE_INFINITY);)c(f).forEach(v);return u}return Pp}var Op,Qk;function r6(){if(Qk)return Op;Qk=1;var t=Jk(),e=sr();Op=r;function r(n,a,i){return e.transform(n.nodes(),function(o,l){o[l]=t(n,l,a,i)},{})}return Op}var Ap,eS;function tS(){if(eS)return Ap;eS=1;var t=sr();Ap=e;function e(r){var n=0,a=[],i={},o=[];function l(c){var u=i[c]={onStack:!0,lowlink:n,index:n++};if(a.push(c),r.successors(c).forEach(function(h){t.has(i,h)?i[h].onStack&&(u.lowlink=Math.min(u.lowlink,i[h].index)):(l(h),u.lowlink=Math.min(u.lowlink,i[h].lowlink))}),u.lowlink===u.index){var d=[],f;do f=a.pop(),i[f].onStack=!1,d.push(f);while(c!==f);o.push(d)}}return r.nodes().forEach(function(c){t.has(i,c)||l(c)}),o}return Ap}var Rp,rS;function n6(){if(rS)return Rp;rS=1;var t=sr(),e=tS();Rp=r;function r(n){return t.filter(e(n),function(a){return a.length>1||a.length===1&&n.hasEdge(a[0],a[0])})}return Rp}var Lp,nS;function a6(){if(nS)return Lp;nS=1;var t=sr();Lp=r;var e=t.constant(1);function r(a,i,o){return n(a,i||e,o||function(l){return a.outEdges(l)})}function n(a,i,o){var l={},c=a.nodes();return c.forEach(function(u){l[u]={},l[u][u]={distance:0},c.forEach(function(d){u!==d&&(l[u][d]={distance:Number.POSITIVE_INFINITY})}),o(u).forEach(function(d){var f=d.v===u?d.w:d.v,h=i(d);l[u][f]={distance:h,predecessor:u}})}),c.forEach(function(u){var d=l[u];c.forEach(function(f){var h=l[f];c.forEach(function(v){var p=h[u],g=d[v],y=h[v],m=p.distance+g.distance;m<y.distance&&(y.distance=m,y.predecessor=g.predecessor)})})}),l}return Lp}var Fp,aS;function iS(){if(aS)return Fp;aS=1;var t=sr();Fp=e,e.CycleException=r;function e(n){var a={},i={},o=[];function l(c){if(t.has(i,c))throw new r;t.has(a,c)||(i[c]=!0,a[c]=!0,t.each(n.predecessors(c),l),delete i[c],o.push(c))}if(t.each(n.sinks(),l),t.size(a)!==n.nodeCount())throw new r;return o}function r(){}return r.prototype=new Error,Fp}var Mp,oS;function i6(){if(oS)return Mp;oS=1;var t=iS();Mp=e;function e(r){try{t(r)}catch(n){if(n instanceof t.CycleException)return!1;throw n}return!0}return Mp}var $p,sS;function lS(){if(sS)return $p;sS=1;var t=sr();$p=e;function e(n,a,i){t.isArray(a)||(a=[a]);var o=(n.isDirected()?n.successors:n.neighbors).bind(n),l=[],c={};return t.each(a,function(u){if(!n.hasNode(u))throw new Error("Graph does not have node: "+u);r(n,u,i==="post",c,o,l)}),l}function r(n,a,i,o,l,c){t.has(o,a)||(o[a]=!0,i||c.push(a),t.each(l(a),function(u){r(n,u,i,o,l,c)}),i&&c.push(a))}return $p}var Vp,uS;function o6(){if(uS)return Vp;uS=1;var t=lS();Vp=e;function e(r,n){return t(r,n,"post")}return Vp}var qp,cS;function s6(){if(cS)return qp;cS=1;var t=lS();qp=e;function e(r,n){return t(r,n,"pre")}return qp}var zp,dS;function l6(){if(dS)return zp;dS=1;var t=sr(),e=_p(),r=Zk();zp=n;function n(a,i){var o=new e,l={},c=new r,u;function d(h){var v=h.v===u?h.w:h.v,p=c.priority(v);if(p!==void 0){var g=i(h);g<p&&(l[v]=u,c.decrease(v,g))}}if(a.nodeCount()===0)return o;t.each(a.nodes(),function(h){c.add(h,Number.POSITIVE_INFINITY),o.setNode(h)}),c.decrease(a.nodes()[0],0);for(var f=!1;c.size()>0;){if(u=c.removeMin(),t.has(l,u))o.setEdge(u,l[u]);else{if(f)throw new Error("Input graph is not connected: "+a);f=!0}a.nodeEdges(u).forEach(d)}return o}return zp}var Hp,fS;function u6(){return fS||(fS=1,Hp={components:t6(),dijkstra:Jk(),dijkstraAll:r6(),findCycles:n6(),floydWarshall:a6(),isAcyclic:i6(),postorder:o6(),preorder:s6(),prim:l6(),tarjan:tS(),topsort:iS()}),Hp}var Kp,hS;function c6(){if(hS)return Kp;hS=1;var t=Q8();return Kp={Graph:t.Graph,json:e6(),alg:u6(),version:t.version},Kp}var Gp,pS;function wr(){if(pS)return Gp;pS=1;var t;if(typeof Pc=="function")try{t=c6()}catch{}return t||(t=window.graphlib),Gp=t,Gp}var Up,vS;function d6(){if(vS)return Up;vS=1;var t=$E(),e=1,r=4;function n(a){return t(a,e|r)}return Up=n,Up}var jp,gS;function xl(){if(gS)return jp;gS=1;var t=ci(),e=tn(),r=pl(),n=or();function a(i,o,l){if(!n(l))return!1;var c=typeof o;return(c=="number"?e(l)&&r(o,l.length):c=="string"&&o in l)?t(l[o],i):!1}return jp=a,jp}var Wp,mS;function f6(){if(mS)return Wp;mS=1;var t=El(),e=ci(),r=xl(),n=ha(),a=Object.prototype,i=a.hasOwnProperty,o=t(function(l,c){l=Object(l);var u=-1,d=c.length,f=d>2?c[2]:void 0;for(f&&r(c[0],c[1],f)&&(d=1);++u<d;)for(var h=c[u],v=n(h),p=-1,g=v.length;++p<g;){var y=v[p],m=l[y];(m===void 0||e(m,a[y])&&!i.call(l,y))&&(l[y]=h[y])}return l});return Wp=o,Wp}var Yp,yS;function h6(){if(yS)return Yp;yS=1;var t=rn(),e=tn(),r=Dn();function n(a){return function(i,o,l){var c=Object(i);if(!e(i)){var u=t(o,3);i=r(i),o=function(f){return u(c[f],f,c)}}var d=a(i,o,l);return d>-1?c[u?i[d]:d]:void 0}}return Yp=n,Yp}var Zp,bS;function p6(){if(bS)return Zp;bS=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return Zp=e,Zp}var Xp,wS;function v6(){if(wS)return Xp;wS=1;var t=p6(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return Xp=r,Xp}var Jp,CS;function g6(){if(CS)return Jp;CS=1;var t=v6(),e=or(),r=pi(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt;function c(u){if(typeof u=="number")return u;if(r(u))return n;if(e(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=e(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=t(u);var f=i.test(u);return f||o.test(u)?l(u.slice(2),f?2:8):a.test(u)?n:+u}return Jp=c,Jp}var Qp,ES;function xS(){if(ES)return Qp;ES=1;var t=g6(),e=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=t(a),a===e||a===-e){var i=a<0?-1:1;return i*r}return a===a?a:0}return Qp=n,Qp}var ev,kS;function m6(){if(kS)return ev;kS=1;var t=xS();function e(r){var n=t(r),a=n%1;return n===n?a?n-a:n:0}return ev=e,ev}var tv,SS;function y6(){if(SS)return tv;SS=1;var t=Nk(),e=rn(),r=m6(),n=Math.max;function a(i,o,l){var c=i==null?0:i.length;if(!c)return-1;var u=l==null?0:r(l);return u<0&&(u=n(c+u,0)),t(i,e(o,3),u)}return tv=a,tv}var rv,_S;function b6(){if(_S)return rv;_S=1;var t=h6(),e=y6(),r=t(e);return rv=r,rv}var nv,TS;function NS(){if(TS)return nv;TS=1;var t=ap();function e(r){var n=r==null?0:r.length;return n?t(r,1):[]}return nv=e,nv}var av,IS;function w6(){if(IS)return av;IS=1;var t=Kf(),e=YE(),r=ha();function n(a,i){return a==null?a:t(a,e(i),r)}return av=n,av}var iv,BS;function C6(){if(BS)return iv;BS=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return iv=t,iv}var ov,DS;function E6(){if(DS)return ov;DS=1;var t=fl(),e=Uf(),r=rn();function n(a,i){var o={};return i=r(i,3),e(a,function(l,c,u){t(o,c,i(l,c,u))}),o}return ov=n,ov}var sv,PS;function lv(){if(PS)return sv;PS=1;var t=pi();function e(r,n,a){for(var i=-1,o=r.length;++i<o;){var l=r[i],c=n(l);if(c!=null&&(u===void 0?c===c&&!t(c):a(c,u)))var u=c,d=l}return d}return sv=e,sv}var uv,OS;function x6(){if(OS)return uv;OS=1;function t(e,r){return e>r}return uv=t,uv}var cv,AS;function k6(){if(AS)return cv;AS=1;var t=lv(),e=x6(),r=pa();function n(a){return a&&a.length?t(a,r,e):void 0}return cv=n,cv}var dv,RS;function LS(){if(RS)return dv;RS=1;var t=fl(),e=ci();function r(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&t(n,a,i)}return dv=r,dv}var fv,FS;function S6(){if(FS)return fv;FS=1;var t=da(),e=ml(),r=Rr(),n="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,l=i.hasOwnProperty,c=o.call(Object);function u(d){if(!r(d)||t(d)!=n)return!1;var f=e(d);if(f===null)return!0;var h=l.call(f,"constructor")&&f.constructor;return typeof h=="function"&&h instanceof h&&o.call(h)==c}return fv=u,fv}var hv,MS;function $S(){if(MS)return hv;MS=1;function t(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}return hv=t,hv}var pv,VS;function _6(){if(VS)return pv;VS=1;var t=xo(),e=ha();function r(n){return t(n,e(n))}return pv=r,pv}var vv,qS;function T6(){if(qS)return vv;qS=1;var t=LS(),e=YC(),r=NE(),n=XC(),a=OE(),i=ko(),o=ot(),l=Mk(),c=fi(),u=Eo(),d=or(),f=S6(),h=To(),v=$S(),p=_6();function g(y,m,b,w,C,x,k){var E=v(y,b),_=v(m,b),S=k.get(_);if(S){t(y,b,S);return}var T=x?x(E,_,b+"",y,m,k):void 0,N=T===void 0;if(N){var B=o(_),P=!B&&c(_),D=!B&&!P&&h(_);T=_,B||P||D?o(E)?T=E:l(E)?T=n(E):P?(N=!1,T=e(_,!0)):D?(N=!1,T=r(_,!0)):T=[]:f(_)||i(_)?(T=E,i(E)?T=p(E):(!d(E)||u(E))&&(T=a(_))):N=!1}N&&(k.set(_,T),C(T,_,w,x,k),k.delete(_)),t(y,b,T)}return vv=g,vv}var gv,zS;function N6(){if(zS)return gv;zS=1;var t=dl(),e=LS(),r=Kf(),n=T6(),a=or(),i=ha(),o=$S();function l(c,u,d,f,h){c!==u&&r(u,function(v,p){if(h||(h=new t),a(v))n(c,u,p,d,l,f,h);else{var g=f?f(o(c,p),v,p+"",c,u,h):void 0;g===void 0&&(g=v),e(c,p,g)}},i)}return gv=l,gv}var mv,HS;function I6(){if(HS)return mv;HS=1;var t=El(),e=xl();function r(n){return t(function(a,i){var o=-1,l=i.length,c=l>1?i[l-1]:void 0,u=l>2?i[2]:void 0;for(c=n.length>3&&typeof c=="function"?(l--,c):void 0,u&&e(i[0],i[1],u)&&(c=l<3?void 0:c,l=1),a=Object(a);++o<l;){var d=i[o];d&&n(a,d,o,c)}return a})}return mv=r,mv}var yv,KS;function B6(){if(KS)return yv;KS=1;var t=N6(),e=I6(),r=e(function(n,a,i){t(n,a,i)});return yv=r,yv}var bv,GS;function US(){if(GS)return bv;GS=1;function t(e,r){return e<r}return bv=t,bv}var wv,jS;function D6(){if(jS)return wv;jS=1;var t=lv(),e=US(),r=pa();function n(a){return a&&a.length?t(a,r,e):void 0}return wv=n,wv}var Cv,WS;function P6(){if(WS)return Cv;WS=1;var t=lv(),e=rn(),r=US();function n(a,i){return a&&a.length?t(a,e(i,2),r):void 0}return Cv=n,Cv}var Ev,YS;function O6(){if(YS)return Ev;YS=1;var t=br(),e=function(){return t.Date.now()};return Ev=e,Ev}var xv,ZS;function A6(){if(ZS)return xv;ZS=1;var t=hl(),e=wl(),r=pl(),n=or(),a=Io();function i(o,l,c,u){if(!n(o))return o;l=e(l,o);for(var d=-1,f=l.length,h=f-1,v=o;v!=null&&++d<f;){var p=a(l[d]),g=c;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(d!=h){var y=v[p];g=u?u(y,p,v):void 0,g===void 0&&(g=n(y)?y:r(l[d+1])?[]:{})}t(v,p,g),v=v[p]}return o}return xv=i,xv}var kv,XS;function R6(){if(XS)return kv;XS=1;var t=Cl(),e=A6(),r=wl();function n(a,i,o){for(var l=-1,c=i.length,u={};++l<c;){var d=i[l],f=t(a,d);o(f,d)&&e(u,r(d,a),f)}return u}return kv=n,kv}var Sv,JS;function L6(){if(JS)return Sv;JS=1;var t=R6(),e=qx();function r(n,a){return t(n,a,function(i,o){return e(n,o)})}return Sv=r,Sv}var _v,QS;function F6(){if(QS)return _v;QS=1;var t=NS(),e=Ck(),r=Sk();function n(a){return r(e(a,void 0,t),a+"")}return _v=n,_v}var Tv,e2;function M6(){if(e2)return Tv;e2=1;var t=L6(),e=F6(),r=e(function(n,a){return n==null?{}:t(n,a)});return Tv=r,Tv}var Nv,t2;function $6(){if(t2)return Nv;t2=1;var t=Math.ceil,e=Math.max;function r(n,a,i,o){for(var l=-1,c=e(t((a-n)/(i||1)),0),u=Array(c);c--;)u[o?c:++l]=n,n+=i;return u}return Nv=r,Nv}var Iv,r2;function V6(){if(r2)return Iv;r2=1;var t=$6(),e=xl(),r=xS();function n(a){return function(i,o,l){return l&&typeof l!="number"&&e(i,o,l)&&(o=l=void 0),i=r(i),o===void 0?(o=i,i=0):o=r(o),l=l===void 0?i<o?1:-1:r(l),t(i,o,l,a)}}return Iv=n,Iv}var Bv,n2;function q6(){if(n2)return Bv;n2=1;var t=V6(),e=t();return Bv=e,Bv}var Dv,a2;function z6(){if(a2)return Dv;a2=1;function t(e,r){var n=e.length;for(e.sort(r);n--;)e[n]=e[n].value;return e}return Dv=t,Dv}var Pv,i2;function H6(){if(i2)return Pv;i2=1;var t=pi();function e(r,n){if(r!==n){var a=r!==void 0,i=r===null,o=r===r,l=t(r),c=n!==void 0,u=n===null,d=n===n,f=t(n);if(!u&&!f&&!l&&r>n||l&&c&&d&&!u&&!f||i&&c&&d||!a&&d||!o)return 1;if(!i&&!l&&!f&&r<n||f&&a&&o&&!i&&!l||u&&a&&o||!c&&o||!d)return-1}return 0}return Pv=e,Pv}var Ov,o2;function K6(){if(o2)return Ov;o2=1;var t=H6();function e(r,n,a){for(var i=-1,o=r.criteria,l=n.criteria,c=o.length,u=a.length;++i<c;){var d=t(o[i],l[i]);if(d){if(i>=u)return d;var f=a[i];return d*(f=="desc"?-1:1)}}return r.index-n.index}return Ov=e,Ov}var Av,s2;function G6(){if(s2)return Av;s2=1;var t=bl(),e=Cl(),r=rn(),n=nk(),a=z6(),i=vl(),o=K6(),l=pa(),c=ot();function u(d,f,h){f.length?f=t(f,function(g){return c(g)?function(y){return e(y,g.length===1?g[0]:g)}:g}):f=[l];var v=-1;f=t(f,i(r));var p=n(d,function(g,y,m){var b=t(f,function(w){return w(g)});return{criteria:b,index:++v,value:g}});return a(p,function(g,y){return o(g,y,h)})}return Av=u,Av}var Rv,l2;function U6(){if(l2)return Rv;l2=1;var t=ap(),e=G6(),r=El(),n=xl(),a=r(function(i,o){if(i==null)return[];var l=o.length;return l>1&&n(i,o[0],o[1])?o=[]:l>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),e(i,t(o,1),[])});return Rv=a,Rv}var Lv,u2;function j6(){if(u2)return Lv;u2=1;var t=Px(),e=0;function r(n){var a=++e;return t(n)+a}return Lv=r,Lv}var Fv,c2;function W6(){if(c2)return Fv;c2=1;function t(e,r,n){for(var a=-1,i=e.length,o=r.length,l={};++a<i;){var c=a<o?r[a]:void 0;n(l,e[a],c)}return l}return Fv=t,Fv}var Mv,d2;function Y6(){if(d2)return Mv;d2=1;var t=hl(),e=W6();function r(n,a){return e(n||[],a||[],t)}return Mv=r,Mv}var $v,f2;function Ze(){if(f2)return $v;f2=1;var t;if(typeof Pc=="function")try{t={cloneDeep:d6(),constant:qf(),defaults:f6(),each:QE(),filter:Yx(),find:b6(),flatten:NS(),forEach:XE(),forIn:w6(),has:Jx(),isUndefined:tk(),last:C6(),map:ik(),mapValues:E6(),max:k6(),merge:B6(),min:D6(),minBy:P6(),now:O6(),pick:M6(),range:q6(),reduce:uk(),sortBy:U6(),uniqueId:j6(),values:zk(),zipObject:Y6()}}catch{}return t||(t=window._),$v=t,$v}var Vv,h2;function Z6(){if(h2)return Vv;h2=1,Vv=t;function t(){var n={};n._next=n._prev=n,this._sentinel=n}t.prototype.dequeue=function(){var n=this._sentinel,a=n._prev;if(a!==n)return e(a),a},t.prototype.enqueue=function(n){var a=this._sentinel;n._prev&&n._next&&e(n),n._next=a._next,a._next._prev=n,a._next=n,n._prev=a},t.prototype.toString=function(){for(var n=[],a=this._sentinel,i=a._prev;i!==a;)n.push(JSON.stringify(i,r)),i=i._prev;return"["+n.join(", ")+"]"};function e(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function r(n,a){if(n!=="_next"&&n!=="_prev")return a}return Vv}var qv,p2;function X6(){if(p2)return qv;p2=1;var t=Ze(),e=wr().Graph,r=Z6();qv=a;var n=t.constant(1);function a(u,d){if(u.nodeCount()<=1)return[];var f=l(u,d||n),h=i(f.graph,f.buckets,f.zeroIdx);return t.flatten(t.map(h,function(v){return u.outEdges(v.v,v.w)}),!0)}function i(u,d,f){for(var h=[],v=d[d.length-1],p=d[0],g;u.nodeCount();){for(;g=p.dequeue();)o(u,d,f,g);for(;g=v.dequeue();)o(u,d,f,g);if(u.nodeCount()){for(var y=d.length-2;y>0;--y)if(g=d[y].dequeue(),g){h=h.concat(o(u,d,f,g,!0));break}}}return h}function o(u,d,f,h,v){var p=v?[]:void 0;return t.forEach(u.inEdges(h.v),function(g){var y=u.edge(g),m=u.node(g.v);v&&p.push({v:g.v,w:g.w}),m.out-=y,c(d,f,m)}),t.forEach(u.outEdges(h.v),function(g){var y=u.edge(g),m=g.w,b=u.node(m);b.in-=y,c(d,f,b)}),u.removeNode(h.v),p}function l(u,d){var f=new e,h=0,v=0;t.forEach(u.nodes(),function(y){f.setNode(y,{v:y,in:0,out:0})}),t.forEach(u.edges(),function(y){var m=f.edge(y.v,y.w)||0,b=d(y),w=m+b;f.setEdge(y.v,y.w,w),v=Math.max(v,f.node(y.v).out+=b),h=Math.max(h,f.node(y.w).in+=b)});var p=t.range(v+h+3).map(function(){return new r}),g=h+1;return t.forEach(f.nodes(),function(y){c(p,g,f.node(y))}),{graph:f,buckets:p,zeroIdx:g}}function c(u,d,f){f.out?f.in?u[f.out-f.in+d].enqueue(f):u[u.length-1].enqueue(f):u[0].enqueue(f)}return qv}var zv,v2;function J6(){if(v2)return zv;v2=1;var t=Ze(),e=X6();zv={run:r,undo:a};function r(i){var o=i.graph().acyclicer==="greedy"?e(i,l(i)):n(i);t.forEach(o,function(c){var u=i.edge(c);i.removeEdge(c),u.forwardName=c.name,u.reversed=!0,i.setEdge(c.w,c.v,u,t.uniqueId("rev"))});function l(c){return function(u){return c.edge(u).weight}}}function n(i){var o=[],l={},c={};function u(d){t.has(c,d)||(c[d]=!0,l[d]=!0,t.forEach(i.outEdges(d),function(f){t.has(l,f.w)?o.push(f):u(f.w)}),delete l[d])}return t.forEach(i.nodes(),u),o}function a(i){t.forEach(i.edges(),function(o){var l=i.edge(o);if(l.reversed){i.removeEdge(o);var c=l.forwardName;delete l.reversed,delete l.forwardName,i.setEdge(o.w,o.v,l,c)}})}return zv}var Hv,g2;function Ut(){if(g2)return Hv;g2=1;var t=Ze(),e=wr().Graph;Hv={addDummyNode:r,simplify:n,asNonCompoundGraph:a,successorWeights:i,predecessorWeights:o,intersectRect:l,buildLayerMatrix:c,normalizeRanks:u,removeEmptyRanks:d,addBorderNode:f,maxRank:h,partition:v,time:p,notime:g};function r(y,m,b,w){var C;do C=t.uniqueId(w);while(y.hasNode(C));return b.dummy=m,y.setNode(C,b),C}function n(y){var m=new e().setGraph(y.graph());return t.forEach(y.nodes(),function(b){m.setNode(b,y.node(b))}),t.forEach(y.edges(),function(b){var w=m.edge(b.v,b.w)||{weight:0,minlen:1},C=y.edge(b);m.setEdge(b.v,b.w,{weight:w.weight+C.weight,minlen:Math.max(w.minlen,C.minlen)})}),m}function a(y){var m=new e({multigraph:y.isMultigraph()}).setGraph(y.graph());return t.forEach(y.nodes(),function(b){y.children(b).length||m.setNode(b,y.node(b))}),t.forEach(y.edges(),function(b){m.setEdge(b,y.edge(b))}),m}function i(y){var m=t.map(y.nodes(),function(b){var w={};return t.forEach(y.outEdges(b),function(C){w[C.w]=(w[C.w]||0)+y.edge(C).weight}),w});return t.zipObject(y.nodes(),m)}function o(y){var m=t.map(y.nodes(),function(b){var w={};return t.forEach(y.inEdges(b),function(C){w[C.v]=(w[C.v]||0)+y.edge(C).weight}),w});return t.zipObject(y.nodes(),m)}function l(y,m){var b=y.x,w=y.y,C=m.x-b,x=m.y-w,k=y.width/2,E=y.height/2;if(!C&&!x)throw new Error("Not possible to find intersection inside of the rectangle");var _,S;return Math.abs(x)*k>Math.abs(C)*E?(x<0&&(E=-E),_=E*C/x,S=E):(C<0&&(k=-k),_=k,S=k*x/C),{x:b+_,y:w+S}}function c(y){var m=t.map(t.range(h(y)+1),function(){return[]});return t.forEach(y.nodes(),function(b){var w=y.node(b),C=w.rank;t.isUndefined(C)||(m[C][w.order]=b)}),m}function u(y){var m=t.min(t.map(y.nodes(),function(b){return y.node(b).rank}));t.forEach(y.nodes(),function(b){var w=y.node(b);t.has(w,"rank")&&(w.rank-=m)})}function d(y){var m=t.min(t.map(y.nodes(),function(x){return y.node(x).rank})),b=[];t.forEach(y.nodes(),function(x){var k=y.node(x).rank-m;b[k]||(b[k]=[]),b[k].push(x)});var w=0,C=y.graph().nodeRankFactor;t.forEach(b,function(x,k){t.isUndefined(x)&&k%C!==0?--w:w&&t.forEach(x,function(E){y.node(E).rank+=w})})}function f(y,m,b,w){var C={width:0,height:0};return arguments.length>=4&&(C.rank=b,C.order=w),r(y,"border",C,m)}function h(y){return t.max(t.map(y.nodes(),function(m){var b=y.node(m).rank;if(!t.isUndefined(b))return b}))}function v(y,m){var b={lhs:[],rhs:[]};return t.forEach(y,function(w){m(w)?b.lhs.push(w):b.rhs.push(w)}),b}function p(y,m){var b=t.now();try{return m()}finally{console.log(y+" time: "+(t.now()-b)+"ms")}}function g(y,m){return m()}return Hv}var Kv,m2;function Q6(){if(m2)return Kv;m2=1;var t=Ze(),e=Ut();Kv={run:r,undo:a};function r(i){i.graph().dummyChains=[],t.forEach(i.edges(),function(o){n(i,o)})}function n(i,o){var l=o.v,c=i.node(l).rank,u=o.w,d=i.node(u).rank,f=o.name,h=i.edge(o),v=h.labelRank;if(d!==c+1){i.removeEdge(o);var p,g,y;for(y=0,++c;c<d;++y,++c)h.points=[],g={width:0,height:0,edgeLabel:h,edgeObj:o,rank:c},p=e.addDummyNode(i,"edge",g,"_d"),c===v&&(g.width=h.width,g.height=h.height,g.dummy="edge-label",g.labelpos=h.labelpos),i.setEdge(l,p,{weight:h.weight},f),y===0&&i.graph().dummyChains.push(p),l=p;i.setEdge(l,u,{weight:h.weight},f)}}function a(i){t.forEach(i.graph().dummyChains,function(o){var l=i.node(o),c=l.edgeLabel,u;for(i.setEdge(l.edgeObj,c);l.dummy;)u=i.successors(o)[0],i.removeNode(o),c.points.push({x:l.x,y:l.y}),l.dummy==="edge-label"&&(c.x=l.x,c.y=l.y,c.width=l.width,c.height=l.height),o=u,l=i.node(o)})}return Kv}var Gv,y2;function kl(){if(y2)return Gv;y2=1;var t=Ze();Gv={longestPath:e,slack:r};function e(n){var a={};function i(o){var l=n.node(o);if(t.has(a,o))return l.rank;a[o]=!0;var c=t.min(t.map(n.outEdges(o),function(u){return i(u.w)-n.edge(u).minlen}));return(c===Number.POSITIVE_INFINITY||c===void 0||c===null)&&(c=0),l.rank=c}t.forEach(n.sources(),i)}function r(n,a){return n.node(a.w).rank-n.node(a.v).rank-n.edge(a).minlen}return Gv}var Uv,b2;function w2(){if(b2)return Uv;b2=1;var t=Ze(),e=wr().Graph,r=kl().slack;Uv=n;function n(l){var c=new e({directed:!1}),u=l.nodes()[0],d=l.nodeCount();c.setNode(u,{});for(var f,h;a(c,l)<d;)f=i(c,l),h=c.hasNode(f.v)?r(l,f):-r(l,f),o(c,l,h);return c}function a(l,c){function u(d){t.forEach(c.nodeEdges(d),function(f){var h=f.v,v=d===h?f.w:h;!l.hasNode(v)&&!r(c,f)&&(l.setNode(v,{}),l.setEdge(d,v,{}),u(v))})}return t.forEach(l.nodes(),u),l.nodeCount()}function i(l,c){return t.minBy(c.edges(),function(u){if(l.hasNode(u.v)!==l.hasNode(u.w))return r(c,u)})}function o(l,c,u){t.forEach(l.nodes(),function(d){c.node(d).rank+=u})}return Uv}var jv,C2;function e9(){if(C2)return jv;C2=1;var t=Ze(),e=w2(),r=kl().slack,n=kl().longestPath,a=wr().alg.preorder,i=wr().alg.postorder,o=Ut().simplify;jv=l,l.initLowLimValues=f,l.initCutValues=c,l.calcCutValue=d,l.leaveEdge=v,l.enterEdge=p,l.exchangeEdges=g;function l(w){w=o(w),n(w);var C=e(w);f(C),c(C,w);for(var x,k;x=v(C);)k=p(C,w,x),g(C,w,x,k)}function c(w,C){var x=i(w,w.nodes());x=x.slice(0,x.length-1),t.forEach(x,function(k){u(w,C,k)})}function u(w,C,x){var k=w.node(x),E=k.parent;w.edge(x,E).cutvalue=d(w,C,x)}function d(w,C,x){var k=w.node(x),E=k.parent,_=!0,S=C.edge(x,E),T=0;return S||(_=!1,S=C.edge(E,x)),T=S.weight,t.forEach(C.nodeEdges(x),function(N){var B=N.v===x,P=B?N.w:N.v;if(P!==E){var D=B===_,R=C.edge(N).weight;if(T+=D?R:-R,m(w,x,P)){var O=w.edge(x,P).cutvalue;T+=D?-O:O}}}),T}function f(w,C){arguments.length<2&&(C=w.nodes()[0]),h(w,{},1,C)}function h(w,C,x,k,E){var _=x,S=w.node(k);return C[k]=!0,t.forEach(w.neighbors(k),function(T){t.has(C,T)||(x=h(w,C,x,T,k))}),S.low=_,S.lim=x++,E?S.parent=E:delete S.parent,x}function v(w){return t.find(w.edges(),function(C){return w.edge(C).cutvalue<0})}function p(w,C,x){var k=x.v,E=x.w;C.hasEdge(k,E)||(k=x.w,E=x.v);var _=w.node(k),S=w.node(E),T=_,N=!1;_.lim>S.lim&&(T=S,N=!0);var B=t.filter(C.edges(),function(P){return N===b(w,w.node(P.v),T)&&N!==b(w,w.node(P.w),T)});return t.minBy(B,function(P){return r(C,P)})}function g(w,C,x,k){var E=x.v,_=x.w;w.removeEdge(E,_),w.setEdge(k.v,k.w,{}),f(w),c(w,C),y(w,C)}function y(w,C){var x=t.find(w.nodes(),function(E){return!C.node(E).parent}),k=a(w,x);k=k.slice(1),t.forEach(k,function(E){var _=w.node(E).parent,S=C.edge(E,_),T=!1;S||(S=C.edge(_,E),T=!0),C.node(E).rank=C.node(_).rank+(T?S.minlen:-S.minlen)})}function m(w,C,x){return w.hasEdge(C,x)}function b(w,C,x){return x.low<=C.lim&&C.lim<=x.lim}return jv}var Wv,E2;function t9(){if(E2)return Wv;E2=1;var t=kl(),e=t.longestPath,r=w2(),n=e9();Wv=a;function a(c){switch(c.graph().ranker){case"network-simplex":l(c);break;case"tight-tree":o(c);break;case"longest-path":i(c);break;default:l(c)}}var i=e;function o(c){e(c),r(c)}function l(c){n(c)}return Wv}var Yv,x2;function r9(){if(x2)return Yv;x2=1;var t=Ze();Yv=e;function e(a){var i=n(a);t.forEach(a.graph().dummyChains,function(o){for(var l=a.node(o),c=l.edgeObj,u=r(a,i,c.v,c.w),d=u.path,f=u.lca,h=0,v=d[h],p=!0;o!==c.w;){if(l=a.node(o),p){for(;(v=d[h])!==f&&a.node(v).maxRank<l.rank;)h++;v===f&&(p=!1)}if(!p){for(;h<d.length-1&&a.node(v=d[h+1]).minRank<=l.rank;)h++;v=d[h]}a.setParent(o,v),o=a.successors(o)[0]}})}function r(a,i,o,l){var c=[],u=[],d=Math.min(i[o].low,i[l].low),f=Math.max(i[o].lim,i[l].lim),h,v;h=o;do h=a.parent(h),c.push(h);while(h&&(i[h].low>d||f>i[h].lim));for(v=h,h=l;(h=a.parent(h))!==v;)u.push(h);return{path:c.concat(u.reverse()),lca:v}}function n(a){var i={},o=0;function l(c){var u=o;t.forEach(a.children(c),l),i[c]={low:u,lim:o++}}return t.forEach(a.children(),l),i}return Yv}var Zv,k2;function n9(){if(k2)return Zv;k2=1;var t=Ze(),e=Ut();Zv={run:r,cleanup:o};function r(l){var c=e.addDummyNode(l,"root",{},"_root"),u=a(l),d=t.max(t.values(u))-1,f=2*d+1;l.graph().nestingRoot=c,t.forEach(l.edges(),function(v){l.edge(v).minlen*=f});var h=i(l)+1;t.forEach(l.children(),function(v){n(l,c,f,h,d,u,v)}),l.graph().nodeRankFactor=f}function n(l,c,u,d,f,h,v){var p=l.children(v);if(!p.length){v!==c&&l.setEdge(c,v,{weight:0,minlen:u});return}var g=e.addBorderNode(l,"_bt"),y=e.addBorderNode(l,"_bb"),m=l.node(v);l.setParent(g,v),m.borderTop=g,l.setParent(y,v),m.borderBottom=y,t.forEach(p,function(b){n(l,c,u,d,f,h,b);var w=l.node(b),C=w.borderTop?w.borderTop:b,x=w.borderBottom?w.borderBottom:b,k=w.borderTop?d:2*d,E=C!==x?1:f-h[v]+1;l.setEdge(g,C,{weight:k,minlen:E,nestingEdge:!0}),l.setEdge(x,y,{weight:k,minlen:E,nestingEdge:!0})}),l.parent(v)||l.setEdge(c,g,{weight:0,minlen:f+h[v]})}function a(l){var c={};function u(d,f){var h=l.children(d);h&&h.length&&t.forEach(h,function(v){u(v,f+1)}),c[d]=f}return t.forEach(l.children(),function(d){u(d,1)}),c}function i(l){return t.reduce(l.edges(),function(c,u){return c+l.edge(u).weight},0)}function o(l){var c=l.graph();l.removeNode(c.nestingRoot),delete c.nestingRoot,t.forEach(l.edges(),function(u){var d=l.edge(u);d.nestingEdge&&l.removeEdge(u)})}return Zv}var Xv,S2;function a9(){if(S2)return Xv;S2=1;var t=Ze(),e=Ut();Xv=r;function r(a){function i(o){var l=a.children(o),c=a.node(o);if(l.length&&t.forEach(l,i),t.has(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(var u=c.minRank,d=c.maxRank+1;u<d;++u)n(a,"borderLeft","_bl",o,c,u),n(a,"borderRight","_br",o,c,u)}}t.forEach(a.children(),i)}function n(a,i,o,l,c,u){var d={width:0,height:0,rank:u,borderType:i},f=c[i][u-1],h=e.addDummyNode(a,"border",d,o);c[i][u]=h,a.setParent(h,l),f&&a.setEdge(f,h,{weight:1})}return Xv}var Jv,_2;function i9(){if(_2)return Jv;_2=1;var t=Ze();Jv={adjust:e,undo:r};function e(u){var d=u.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&n(u)}function r(u){var d=u.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&i(u),(d==="lr"||d==="rl")&&(l(u),n(u))}function n(u){t.forEach(u.nodes(),function(d){a(u.node(d))}),t.forEach(u.edges(),function(d){a(u.edge(d))})}function a(u){var d=u.width;u.width=u.height,u.height=d}function i(u){t.forEach(u.nodes(),function(d){o(u.node(d))}),t.forEach(u.edges(),function(d){var f=u.edge(d);t.forEach(f.points,o),t.has(f,"y")&&o(f)})}function o(u){u.y=-u.y}function l(u){t.forEach(u.nodes(),function(d){c(u.node(d))}),t.forEach(u.edges(),function(d){var f=u.edge(d);t.forEach(f.points,c),t.has(f,"x")&&c(f)})}function c(u){var d=u.x;u.x=u.y,u.y=d}return Jv}var Qv,T2;function o9(){if(T2)return Qv;T2=1;var t=Ze();Qv=e;function e(r){var n={},a=t.filter(r.nodes(),function(u){return!r.children(u).length}),i=t.max(t.map(a,function(u){return r.node(u).rank})),o=t.map(t.range(i+1),function(){return[]});function l(u){if(!t.has(n,u)){n[u]=!0;var d=r.node(u);o[d.rank].push(u),t.forEach(r.successors(u),l)}}var c=t.sortBy(a,function(u){return r.node(u).rank});return t.forEach(c,l),o}return Qv}var eg,N2;function s9(){if(N2)return eg;N2=1;var t=Ze();eg=e;function e(n,a){for(var i=0,o=1;o<a.length;++o)i+=r(n,a[o-1],a[o]);return i}function r(n,a,i){for(var o=t.zipObject(i,t.map(i,function(h,v){return v})),l=t.flatten(t.map(a,function(h){return t.sortBy(t.map(n.outEdges(h),function(v){return{pos:o[v.w],weight:n.edge(v).weight}}),"pos")}),!0),c=1;c<i.length;)c<<=1;var u=2*c-1;c-=1;var d=t.map(new Array(u),function(){return 0}),f=0;return t.forEach(l.forEach(function(h){var v=h.pos+c;d[v]+=h.weight;for(var p=0;v>0;)v%2&&(p+=d[v+1]),v=v-1>>1,d[v]+=h.weight;f+=h.weight*p})),f}return eg}var tg,I2;function l9(){if(I2)return tg;I2=1;var t=Ze();tg=e;function e(r,n){return t.map(n,function(a){var i=r.inEdges(a);if(i.length){var o=t.reduce(i,function(l,c){var u=r.edge(c),d=r.node(c.v);return{sum:l.sum+u.weight*d.order,weight:l.weight+u.weight}},{sum:0,weight:0});return{v:a,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:a}})}return tg}var rg,B2;function u9(){if(B2)return rg;B2=1;var t=Ze();rg=e;function e(a,i){var o={};t.forEach(a,function(c,u){var d=o[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:u};t.isUndefined(c.barycenter)||(d.barycenter=c.barycenter,d.weight=c.weight)}),t.forEach(i.edges(),function(c){var u=o[c.v],d=o[c.w];!t.isUndefined(u)&&!t.isUndefined(d)&&(d.indegree++,u.out.push(o[c.w]))});var l=t.filter(o,function(c){return!c.indegree});return r(l)}function r(a){var i=[];function o(u){return function(d){d.merged||(t.isUndefined(d.barycenter)||t.isUndefined(u.barycenter)||d.barycenter>=u.barycenter)&&n(u,d)}}function l(u){return function(d){d.in.push(u),--d.indegree===0&&a.push(d)}}for(;a.length;){var c=a.pop();i.push(c),t.forEach(c.in.reverse(),o(c)),t.forEach(c.out,l(c))}return t.map(t.filter(i,function(u){return!u.merged}),function(u){return t.pick(u,["vs","i","barycenter","weight"])})}function n(a,i){var o=0,l=0;a.weight&&(o+=a.barycenter*a.weight,l+=a.weight),i.weight&&(o+=i.barycenter*i.weight,l+=i.weight),a.vs=i.vs.concat(a.vs),a.barycenter=o/l,a.weight=l,a.i=Math.min(i.i,a.i),i.merged=!0}return rg}var ng,D2;function c9(){if(D2)return ng;D2=1;var t=Ze(),e=Ut();ng=r;function r(i,o){var l=e.partition(i,function(g){return t.has(g,"barycenter")}),c=l.lhs,u=t.sortBy(l.rhs,function(g){return-g.i}),d=[],f=0,h=0,v=0;c.sort(a(!!o)),v=n(d,u,v),t.forEach(c,function(g){v+=g.vs.length,d.push(g.vs),f+=g.barycenter*g.weight,h+=g.weight,v=n(d,u,v)});var p={vs:t.flatten(d,!0)};return h&&(p.barycenter=f/h,p.weight=h),p}function n(i,o,l){for(var c;o.length&&(c=t.last(o)).i<=l;)o.pop(),i.push(c.vs),l++;return l}function a(i){return function(o,l){return o.barycenter<l.barycenter?-1:o.barycenter>l.barycenter?1:i?l.i-o.i:o.i-l.i}}return ng}var ag,P2;function d9(){if(P2)return ag;P2=1;var t=Ze(),e=l9(),r=u9(),n=c9();ag=a;function a(l,c,u,d){var f=l.children(c),h=l.node(c),v=h?h.borderLeft:void 0,p=h?h.borderRight:void 0,g={};v&&(f=t.filter(f,function(x){return x!==v&&x!==p}));var y=e(l,f);t.forEach(y,function(x){if(l.children(x.v).length){var k=a(l,x.v,u,d);g[x.v]=k,t.has(k,"barycenter")&&o(x,k)}});var m=r(y,u);i(m,g);var b=n(m,d);if(v&&(b.vs=t.flatten([v,b.vs,p],!0),l.predecessors(v).length)){var w=l.node(l.predecessors(v)[0]),C=l.node(l.predecessors(p)[0]);t.has(b,"barycenter")||(b.barycenter=0,b.weight=0),b.barycenter=(b.barycenter*b.weight+w.order+C.order)/(b.weight+2),b.weight+=2}return b}function i(l,c){t.forEach(l,function(u){u.vs=t.flatten(u.vs.map(function(d){return c[d]?c[d].vs:d}),!0)})}function o(l,c){t.isUndefined(l.barycenter)?(l.barycenter=c.barycenter,l.weight=c.weight):(l.barycenter=(l.barycenter*l.weight+c.barycenter*c.weight)/(l.weight+c.weight),l.weight+=c.weight)}return ag}var ig,O2;function f9(){if(O2)return ig;O2=1;var t=Ze(),e=wr().Graph;ig=r;function r(a,i,o){var l=n(a),c=new e({compound:!0}).setGraph({root:l}).setDefaultNodeLabel(function(u){return a.node(u)});return t.forEach(a.nodes(),function(u){var d=a.node(u),f=a.parent(u);(d.rank===i||d.minRank<=i&&i<=d.maxRank)&&(c.setNode(u),c.setParent(u,f||l),t.forEach(a[o](u),function(h){var v=h.v===u?h.w:h.v,p=c.edge(v,u),g=t.isUndefined(p)?0:p.weight;c.setEdge(v,u,{weight:a.edge(h).weight+g})}),t.has(d,"minRank")&&c.setNode(u,{borderLeft:d.borderLeft[i],borderRight:d.borderRight[i]}))}),c}function n(a){for(var i;a.hasNode(i=t.uniqueId("_root")););return i}return ig}var og,A2;function h9(){if(A2)return og;A2=1;var t=Ze();og=e;function e(r,n,a){var i={},o;t.forEach(a,function(l){for(var c=r.parent(l),u,d;c;){if(u=r.parent(c),u?(d=i[u],i[u]=c):(d=o,o=c),d&&d!==c){n.setEdge(d,c);return}c=u}})}return og}var sg,R2;function p9(){if(R2)return sg;R2=1;var t=Ze(),e=o9(),r=s9(),n=d9(),a=f9(),i=h9(),o=wr().Graph,l=Ut();sg=c;function c(h){var v=l.maxRank(h),p=u(h,t.range(1,v+1),"inEdges"),g=u(h,t.range(v-1,-1,-1),"outEdges"),y=e(h);f(h,y);for(var m=Number.POSITIVE_INFINITY,b,w=0,C=0;C<4;++w,++C){d(w%2?p:g,w%4>=2),y=l.buildLayerMatrix(h);var x=r(h,y);x<m&&(C=0,b=t.cloneDeep(y),m=x)}f(h,b)}function u(h,v,p){return t.map(v,function(g){return a(h,g,p)})}function d(h,v){var p=new o;t.forEach(h,function(g){var y=g.graph().root,m=n(g,y,p,v);t.forEach(m.vs,function(b,w){g.node(b).order=w}),i(g,p,m.vs)})}function f(h,v){t.forEach(v,function(p){t.forEach(p,function(g,y){h.node(g).order=y})})}return sg}var lg,L2;function v9(){if(L2)return lg;L2=1;var t=Ze(),e=wr().Graph,r=Ut();lg={positionX:p,findType1Conflicts:n,findType2Conflicts:a,addConflict:o,hasConflict:l,verticalAlignment:c,horizontalCompaction:u,alignCoordinates:h,findSmallestWidthAlignment:f,balance:v};function n(m,b){var w={};function C(x,k){var E=0,_=0,S=x.length,T=t.last(k);return t.forEach(k,function(N,B){var P=i(m,N),D=P?m.node(P).order:S;(P||N===T)&&(t.forEach(k.slice(_,B+1),function(R){t.forEach(m.predecessors(R),function(O){var F=m.node(O),A=F.order;(A<E||D<A)&&!(F.dummy&&m.node(R).dummy)&&o(w,O,R)})}),_=B+1,E=D)}),k}return t.reduce(b,C),w}function a(m,b){var w={};function C(k,E,_,S,T){var N;t.forEach(t.range(E,_),function(B){N=k[B],m.node(N).dummy&&t.forEach(m.predecessors(N),function(P){var D=m.node(P);D.dummy&&(D.order<S||D.order>T)&&o(w,P,N)})})}function x(k,E){var _=-1,S,T=0;return t.forEach(E,function(N,B){if(m.node(N).dummy==="border"){var P=m.predecessors(N);P.length&&(S=m.node(P[0]).order,C(E,T,B,_,S),T=B,_=S)}C(E,T,E.length,S,k.length)}),E}return t.reduce(b,x),w}function i(m,b){if(m.node(b).dummy)return t.find(m.predecessors(b),function(w){return m.node(w).dummy})}function o(m,b,w){if(b>w){var C=b;b=w,w=C}var x=m[b];x||(m[b]=x={}),x[w]=!0}function l(m,b,w){if(b>w){var C=b;b=w,w=C}return t.has(m[b],w)}function c(m,b,w,C){var x={},k={},E={};return t.forEach(b,function(_){t.forEach(_,function(S,T){x[S]=S,k[S]=S,E[S]=T})}),t.forEach(b,function(_){var S=-1;t.forEach(_,function(T){var N=C(T);if(N.length){N=t.sortBy(N,function(O){return E[O]});for(var B=(N.length-1)/2,P=Math.floor(B),D=Math.ceil(B);P<=D;++P){var R=N[P];k[T]===T&&S<E[R]&&!l(w,T,R)&&(k[R]=T,k[T]=x[T]=x[R],S=E[R])}}})}),{root:x,align:k}}function u(m,b,w,C,x){var k={},E=d(m,b,w,x),_=x?"borderLeft":"borderRight";function S(B,P){for(var D=E.nodes(),R=D.pop(),O={};R;)O[R]?B(R):(O[R]=!0,D.push(R),D=D.concat(P(R))),R=D.pop()}function T(B){k[B]=E.inEdges(B).reduce(function(P,D){return Math.max(P,k[D.v]+E.edge(D))},0)}function N(B){var P=E.outEdges(B).reduce(function(R,O){return Math.min(R,k[O.w]-E.edge(O))},Number.POSITIVE_INFINITY),D=m.node(B);P!==Number.POSITIVE_INFINITY&&D.borderType!==_&&(k[B]=Math.max(k[B],P))}return S(T,E.predecessors.bind(E)),S(N,E.successors.bind(E)),t.forEach(C,function(B){k[B]=k[w[B]]}),k}function d(m,b,w,C){var x=new e,k=m.graph(),E=g(k.nodesep,k.edgesep,C);return t.forEach(b,function(_){var S;t.forEach(_,function(T){var N=w[T];if(x.setNode(N),S){var B=w[S],P=x.edge(B,N);x.setEdge(B,N,Math.max(E(m,T,S),P||0))}S=T})}),x}function f(m,b){return t.minBy(t.values(b),function(w){var C=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY;return t.forIn(w,function(k,E){var _=y(m,E)/2;C=Math.max(k+_,C),x=Math.min(k-_,x)}),C-x})}function h(m,b){var w=t.values(b),C=t.min(w),x=t.max(w);t.forEach(["u","d"],function(k){t.forEach(["l","r"],function(E){var _=k+E,S=m[_],T;if(S!==b){var N=t.values(S);T=E==="l"?C-t.min(N):x-t.max(N),T&&(m[_]=t.mapValues(S,function(B){return B+T}))}})})}function v(m,b){return t.mapValues(m.ul,function(w,C){if(b)return m[b.toLowerCase()][C];var x=t.sortBy(t.map(m,C));return(x[1]+x[2])/2})}function p(m){var b=r.buildLayerMatrix(m),w=t.merge(n(m,b),a(m,b)),C={},x;t.forEach(["u","d"],function(E){x=E==="u"?b:t.values(b).reverse(),t.forEach(["l","r"],function(_){_==="r"&&(x=t.map(x,function(B){return t.values(B).reverse()}));var S=(E==="u"?m.predecessors:m.successors).bind(m),T=c(m,x,w,S),N=u(m,x,T.root,T.align,_==="r");_==="r"&&(N=t.mapValues(N,function(B){return-B})),C[E+_]=N})});var k=f(m,C);return h(C,k),v(C,m.graph().align)}function g(m,b,w){return function(C,x,k){var E=C.node(x),_=C.node(k),S=0,T;if(S+=E.width/2,t.has(E,"labelpos"))switch(E.labelpos.toLowerCase()){case"l":T=-E.width/2;break;case"r":T=E.width/2;break}if(T&&(S+=w?T:-T),T=0,S+=(E.dummy?b:m)/2,S+=(_.dummy?b:m)/2,S+=_.width/2,t.has(_,"labelpos"))switch(_.labelpos.toLowerCase()){case"l":T=_.width/2;break;case"r":T=-_.width/2;break}return T&&(S+=w?T:-T),T=0,S}}function y(m,b){return m.node(b).width}return lg}var ug,F2;function g9(){if(F2)return ug;F2=1;var t=Ze(),e=Ut(),r=v9().positionX;ug=n;function n(i){i=e.asNonCompoundGraph(i),a(i),t.forEach(r(i),function(o,l){i.node(l).x=o})}function a(i){var o=e.buildLayerMatrix(i),l=i.graph().ranksep,c=0;t.forEach(o,function(u){var d=t.max(t.map(u,function(f){return i.node(f).height}));t.forEach(u,function(f){i.node(f).y=c+d/2}),c+=d+l})}return ug}var cg,M2;function m9(){if(M2)return cg;M2=1;var t=Ze(),e=J6(),r=Q6(),n=t9(),a=Ut().normalizeRanks,i=r9(),o=Ut().removeEmptyRanks,l=n9(),c=a9(),u=i9(),d=p9(),f=g9(),h=Ut(),v=wr().Graph;cg=p;function p(M,V){var q=V&&V.debugTiming?h.time:h.notime;q("layout",function(){var $=q(" buildLayoutGraph",function(){return S(M)});q(" runLayout",function(){g($,q)}),q(" updateInputGraph",function(){y(M,$)})})}function g(M,V){V(" makeSpaceForEdgeLabels",function(){T(M)}),V(" removeSelfEdges",function(){z(M)}),V(" acyclic",function(){e.run(M)}),V(" nestingGraph.run",function(){l.run(M)}),V(" rank",function(){n(h.asNonCompoundGraph(M))}),V(" injectEdgeLabelProxies",function(){N(M)}),V(" removeEmptyRanks",function(){o(M)}),V(" nestingGraph.cleanup",function(){l.cleanup(M)}),V(" normalizeRanks",function(){a(M)}),V(" assignRankMinMax",function(){B(M)}),V(" removeEdgeLabelProxies",function(){P(M)}),V(" normalize.run",function(){r.run(M)}),V(" parentDummyChains",function(){i(M)}),V(" addBorderSegments",function(){c(M)}),V(" order",function(){d(M)}),V(" insertSelfEdges",function(){j(M)}),V(" adjustCoordinateSystem",function(){u.adjust(M)}),V(" position",function(){f(M)}),V(" positionSelfEdges",function(){H(M)}),V(" removeBorderNodes",function(){A(M)}),V(" normalize.undo",function(){r.undo(M)}),V(" fixupEdgeLabelCoords",function(){O(M)}),V(" undoCoordinateSystem",function(){u.undo(M)}),V(" translateGraph",function(){D(M)}),V(" assignNodeIntersects",function(){R(M)}),V(" reversePoints",function(){F(M)}),V(" acyclic.undo",function(){e.undo(M)})}function y(M,V){t.forEach(M.nodes(),function(q){var $=M.node(q),K=V.node(q);$&&($.x=K.x,$.y=K.y,V.children(q).length&&($.width=K.width,$.height=K.height))}),t.forEach(M.edges(),function(q){var $=M.edge(q),K=V.edge(q);$.points=K.points,t.has(K,"x")&&($.x=K.x,$.y=K.y)}),M.graph().width=V.graph().width,M.graph().height=V.graph().height}var m=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},w=["acyclicer","ranker","rankdir","align"],C=["width","height"],x={width:0,height:0},k=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},_=["labelpos"];function S(M){var V=new v({multigraph:!0,compound:!0}),q=X(M.graph());return V.setGraph(t.merge({},b,G(q,m),t.pick(q,w))),t.forEach(M.nodes(),function($){var K=X(M.node($));V.setNode($,t.defaults(G(K,C),x)),V.setParent($,M.parent($))}),t.forEach(M.edges(),function($){var K=X(M.edge($));V.setEdge($,t.merge({},E,G(K,k),t.pick(K,_)))}),V}function T(M){var V=M.graph();V.ranksep/=2,t.forEach(M.edges(),function(q){var $=M.edge(q);$.minlen*=2,$.labelpos.toLowerCase()!=="c"&&(V.rankdir==="TB"||V.rankdir==="BT"?$.width+=$.labeloffset:$.height+=$.labeloffset)})}function N(M){t.forEach(M.edges(),function(V){var q=M.edge(V);if(q.width&&q.height){var $=M.node(V.v),K=M.node(V.w),L={rank:(K.rank-$.rank)/2+$.rank,e:V};h.addDummyNode(M,"edge-proxy",L,"_ep")}})}function B(M){var V=0;t.forEach(M.nodes(),function(q){var $=M.node(q);$.borderTop&&($.minRank=M.node($.borderTop).rank,$.maxRank=M.node($.borderBottom).rank,V=t.max(V,$.maxRank))}),M.graph().maxRank=V}function P(M){t.forEach(M.nodes(),function(V){var q=M.node(V);q.dummy==="edge-proxy"&&(M.edge(q.e).labelRank=q.rank,M.removeNode(V))})}function D(M){var V=Number.POSITIVE_INFINITY,q=0,$=Number.POSITIVE_INFINITY,K=0,L=M.graph(),W=L.marginx||0,Y=L.marginy||0;function se(ue){var ae=ue.x,ne=ue.y,ce=ue.width,ie=ue.height;V=Math.min(V,ae-ce/2),q=Math.max(q,ae+ce/2),$=Math.min($,ne-ie/2),K=Math.max(K,ne+ie/2)}t.forEach(M.nodes(),function(ue){se(M.node(ue))}),t.forEach(M.edges(),function(ue){var ae=M.edge(ue);t.has(ae,"x")&&se(ae)}),V-=W,$-=Y,t.forEach(M.nodes(),function(ue){var ae=M.node(ue);ae.x-=V,ae.y-=$}),t.forEach(M.edges(),function(ue){var ae=M.edge(ue);t.forEach(ae.points,function(ne){ne.x-=V,ne.y-=$}),t.has(ae,"x")&&(ae.x-=V),t.has(ae,"y")&&(ae.y-=$)}),L.width=q-V+W,L.height=K-$+Y}function R(M){t.forEach(M.edges(),function(V){var q=M.edge(V),$=M.node(V.v),K=M.node(V.w),L,W;q.points?(L=q.points[0],W=q.points[q.points.length-1]):(q.points=[],L=K,W=$),q.points.unshift(h.intersectRect($,L)),q.points.push(h.intersectRect(K,W))})}function O(M){t.forEach(M.edges(),function(V){var q=M.edge(V);if(t.has(q,"x"))switch((q.labelpos==="l"||q.labelpos==="r")&&(q.width-=q.labeloffset),q.labelpos){case"l":q.x-=q.width/2+q.labeloffset;break;case"r":q.x+=q.width/2+q.labeloffset;break}})}function F(M){t.forEach(M.edges(),function(V){var q=M.edge(V);q.reversed&&q.points.reverse()})}function A(M){t.forEach(M.nodes(),function(V){if(M.children(V).length){var q=M.node(V),$=M.node(q.borderTop),K=M.node(q.borderBottom),L=M.node(t.last(q.borderLeft)),W=M.node(t.last(q.borderRight));q.width=Math.abs(W.x-L.x),q.height=Math.abs(K.y-$.y),q.x=L.x+q.width/2,q.y=$.y+q.height/2}}),t.forEach(M.nodes(),function(V){M.node(V).dummy==="border"&&M.removeNode(V)})}function z(M){t.forEach(M.edges(),function(V){if(V.v===V.w){var q=M.node(V.v);q.selfEdges||(q.selfEdges=[]),q.selfEdges.push({e:V,label:M.edge(V)}),M.removeEdge(V)}})}function j(M){var V=h.buildLayerMatrix(M);t.forEach(V,function(q){var $=0;t.forEach(q,function(K,L){var W=M.node(K);W.order=L+$,t.forEach(W.selfEdges,function(Y){h.addDummyNode(M,"selfedge",{width:Y.label.width,height:Y.label.height,rank:W.rank,order:L+ ++$,e:Y.e,label:Y.label},"_se")}),delete W.selfEdges})})}function H(M){t.forEach(M.nodes(),function(V){var q=M.node(V);if(q.dummy==="selfedge"){var $=M.node(q.e.v),K=$.x+$.width/2,L=$.y,W=q.x-K,Y=$.height/2;M.setEdge(q.e,q.label),M.removeNode(V),q.label.points=[{x:K+2*W/3,y:L-Y},{x:K+5*W/6,y:L-Y},{x:K+W,y:L},{x:K+5*W/6,y:L+Y},{x:K+2*W/3,y:L+Y}],q.label.x=q.x,q.label.y=q.y}})}function G(M,V){return t.mapValues(t.pick(M,V),Number)}function X(M){var V={};return t.forEach(M,function(q,$){V[$.toLowerCase()]=q}),V}return cg}var dg,$2;function y9(){if($2)return dg;$2=1;var t=Ze(),e=Ut(),r=wr().Graph;dg={debugOrdering:n};function n(a){var i=e.buildLayerMatrix(a),o=new r({compound:!0,multigraph:!0}).setGraph({});return t.forEach(a.nodes(),function(l){o.setNode(l,{label:l}),o.setParent(l,"layer"+a.node(l).rank)}),t.forEach(a.edges(),function(l){o.setEdge(l.v,l.w,{},l.name)}),t.forEach(i,function(l,c){var u="layer"+c;o.setNode(u,{rank:"same"}),t.reduce(l,function(d,f){return o.setEdge(d,f,{style:"invis"}),f})}),o}return dg}var fg,V2;function b9(){return V2||(V2=1,fg="0.8.5"),fg}var hg,q2;function w9(){return q2||(q2=1,hg={graphlib:wr(),layout:m9(),debug:y9(),util:{time:Ut().time,notime:Ut().notime},version:b9()}),hg}(function(t,e){(function(n,a){t.exports=a(w9())})(Li,function(r){return function(n){var a={};function i(o){if(a[o])return a[o].exports;var l=a[o]={i:o,l:!1,exports:{}};return n[o].call(l.exports,l,l.exports,i),l.l=!0,l.exports}return i.m=n,i.c=a,i.d=function(o,l,c){i.o(o,l)||Object.defineProperty(o,l,{enumerable:!0,get:c})},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,l){if(l&1&&(o=i(o)),l&8||l&4&&typeof o=="object"&&o&&o.__esModule)return o;var c=Object.create(null);if(i.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:o}),l&2&&typeof o!="string")for(var u in o)i.d(c,u,(function(d){return o[d]}).bind(null,u));return c},i.n=function(o){var l=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(l,"a",l),l},i.o=function(o,l){return Object.prototype.hasOwnProperty.call(o,l)},i.p="",i(i.s=0)}([function(n,a,i){var o=i(1),l=function(u){u&&u("layout","dagre",o)};typeof cytoscape<"u"&&l(cytoscape),n.exports=l},function(n,a,i){function o(h){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(p){return typeof p}:o=function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},o(h)}var l=function(v){return typeof v=="function"},c=i(2),u=i(3),d=i(4);function f(h){this.options=u({},c,h)}f.prototype.run=function(){var h=this.options,v=this,p=h.cy,g=h.eles,y=function(H,G){return l(G)?G.apply(H,[H]):G},m=h.boundingBox||{x1:0,y1:0,w:p.width(),h:p.height()};m.x2===void 0&&(m.x2=m.x1+m.w),m.w===void 0&&(m.w=m.x2-m.x1),m.y2===void 0&&(m.y2=m.y1+m.h),m.h===void 0&&(m.h=m.y2-m.y1);var b=new d.graphlib.Graph({multigraph:!0,compound:!0}),w={},C=function(H,G){G!=null&&(w[H]=G)};C("nodesep",h.nodeSep),C("edgesep",h.edgeSep),C("ranksep",h.rankSep),C("rankdir",h.rankDir),C("align",h.align),C("ranker",h.ranker),C("acyclicer",h.acyclicer),b.setGraph(w),b.setDefaultEdgeLabel(function(){return{}}),b.setDefaultNodeLabel(function(){return{}});var x=g.nodes();l(h.sort)&&(x=x.sort(h.sort));for(var k=0;k<x.length;k++){var E=x[k],_=E.layoutDimensions(h);b.setNode(E.id(),{width:_.w,height:_.h,name:E.id()})}for(var S=0;S<x.length;S++){var T=x[S];T.isChild()&&b.setParent(T.id(),T.parent().id())}var N=g.edges().stdFilter(function(j){return!j.source().isParent()&&!j.target().isParent()});l(h.sort)&&(N=N.sort(h.sort));for(var B=0;B<N.length;B++){var P=N[B];b.setEdge(P.source().id(),P.target().id(),{minlen:y(P,h.minLen),weight:y(P,h.edgeWeight),name:P.id()},P.id())}d.layout(b);for(var D=b.nodes(),R=0;R<D.length;R++){var O=D[R],F=b.node(O);p.getElementById(O).scratch().dagre=F}var A;h.boundingBox?(A={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},x.forEach(function(j){var H=j.scratch().dagre;A.x1=Math.min(A.x1,H.x),A.x2=Math.max(A.x2,H.x),A.y1=Math.min(A.y1,H.y),A.y2=Math.max(A.y2,H.y)}),A.w=A.x2-A.x1,A.h=A.y2-A.y1):A=m;var z=function(H){if(h.boundingBox){var G=A.w===0?0:(H.x-A.x1)/A.w,X=A.h===0?0:(H.y-A.y1)/A.h;return{x:m.x1+G*m.w,y:m.y1+X*m.h}}else return H};return x.layoutPositions(v,h,function(j){j=o(j)==="object"?j:this;var H=j.scratch().dagre;return z({x:H.x,y:H.y})}),this},n.exports=f},function(n,a){var i={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(l){return 1},edgeWeight:function(l){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(l,c){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(l,c){return c},ready:function(){},sort:void 0,stop:function(){}};n.exports=i},function(n,a){n.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var o=arguments.length,l=new Array(o>1?o-1:0),c=1;c<o;c++)l[c-1]=arguments[c];return l.forEach(function(u){Object.keys(u).forEach(function(d){return i[d]=u[d]})}),i}},function(n,a){n.exports=r}])})})(Ew);var C9=Ew.exports;const E9=FA(C9);Bn.use(E9);const z2=function(t,e){if(!t||!e)return!1;let r=JSON.stringify(t),n=JSON.stringify(e);return r.indexOf(n)!==-1},x9=function(t){return t?[...new Set(t.map(e=>JSON.stringify(e)))].map(e=>JSON.parse(e)):[]},k9=function(t,e,r){let n=t.connectivity.flat(),a=x9(n),i=[],o=!1;return a.forEach(l=>{o=!1,z2(e,l)&&(o=!0),z2(r,l)&&(o=!0),o||i.push(l)}),i};let S9=class extends EventTarget{constructor(r,n){super();cr(this,"cyg",null);cr(this,"nodes",[]);cr(this,"edges",[]);cr(this,"axons",[]);cr(this,"dendrites",[]);cr(this,"somas",[]);cr(this,"labelCache",new Map);cr(this,"graphCanvas",null);cr(this,"hasPhenotypes",!1);this.labelCache=r,this.graphCanvas=n}async addConnectivity(r){var n;if(r&&r["node-phenotypes"]){const a=["ilxtr:hasSomaLocatedIn"],i=["ilxtr:hasAxonPresynapticElementIn","ilxtr:hasAxonSensorySubcellularElementIn"],o=[],l=[];a.forEach(u=>{o.push(...r["node-phenotypes"][u])}),i.forEach(u=>{l.push(...r["node-phenotypes"][u])});const c=k9(r,o,l);this.dendrites=o.map(u=>JSON.stringify(u)),this.axons=l.map(u=>JSON.stringify(u)),c!=null&&c.length&&(this.somas=c.map(u=>JSON.stringify(u))),this.hasPhenotypes=!0}else 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))),this.hasPhenotypes=!1;if(r.connectivity.length)for(const a of r.connectivity){const i=await this.graphNode(a[0]),o=await this.graphNode(a[1]);this.nodes.push(i),this.nodes.push(o),this.edges.push({id:`${i.id}_${o.id}`,source:i.id,target:o.id})}else this.nodes.push({id:"MISSING",label:"NO PATHS"})}showConnectivity(r){this.cyg=new I9(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 o=i.data("label"),l=pg(o);N9(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(),o=this.cyg.cy.height(),l={x:i/2,y:o/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.hasPhenotypes?[...this.dendrites]:[...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 o={id:n,label:a.join(`
45
+ `)};return this.hasPhenotypes?this.axons.includes(n)?o.axon=!0:this.dendrites.includes(n)?o.dendrite=!0:o.somas=!0:this.axons.includes(n)?this.dendrites.includes(n)||this.somas.includes(n)?o.somas=!0:o.axon=!0:(this.dendrites.includes(n)||this.somas.includes(n))&&(o.dendrite=!0),o}on(r,n){this.addEventListener(r,n)}};const _9=[{selector:"node",style:{label:function(t){return T9(t.data("label"))},"background-color":"transparent","background-opacity":"0","text-valign":"center","text-wrap":"wrap",width:"80px",height:"80px","text-max-width":"80px","font-size":"6px",shape:"round-rectangle","border-width":1,"border-style":"solid","border-color":"gray"}},{selector:"node[axon]",style:{shape:"round-diamond",width:"100px",height:"100px"}},{selector:"node[dendrite]",style:{shape:"ellipse"}},{selector:"node[somas]",style:{shape:"round-rectangle"}},{selector:"edge",style:{width:1,"line-color":"dimgray","curve-style":"bezier"}},{selector:"node.active",style:{"border-color":"#8300bf","background-color":"#f3ecf6","background-opacity":.75}}];function T9(t){const e=t.split(`
46
+ `),r=e.length/2,n=e.slice(r);return H2(n.join(`
47
+ `))}function H2(t){return t.split(`
48
48
  `).map(e=>e&&e[0]>="a"&&e[0]<="z"?e.charAt(0).toUpperCase()+e.slice(1):e).join(`
49
- `)}function fg(t){const e=t?t.split(`
50
- `):[],r=[];for(let n=0;n<e.length/2;n++)r.push({id:e[n],label:e[n+e.length/2]});return r}function y6(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 b6 extends EventTarget{constructor(r,n){var a;super();cr(this,"cy");cr(this,"tooltip");this.cy=Bn({container:n,elements:r.elements,layout:{name:"dagre",nodeSep:150,edgeSep:50,rankSep:100,rankDir:"TB",roots:r.roots.length?r.roots:void 0},style:g6,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=fg(i).map(c=>c.label+" ("+c.id+")");this.tooltip.innerText=LS(l.join(`
51
- `)),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:o}=i;n?a.addClass("active"):(a.removeClass("active"),o="",setTimeout(()=>{a.unselect()}));const l=fg(o),c=new CustomEvent("tap-node",{detail:l});this.dispatchEvent(c)}on(r,n){this.addEventListener(r,n)}}const w6=1.3,C6=24*60*60*1e3,E6="Reset position",MS="Lock zoom",x6="Unlock zoom",k6="Zoom in",S6="Zoom out",FS=.25,_6="#8300bf",T6={name:"ConnectivityGraph",props:{entry:{type:String,default:""},mapServer:{type:String,default:""},sckanVersion:{type:String,default:""},selectedConnectivityData:{type:Array,default:[]},connectivityFromMap:{type:Object,default:()=>null},connectivityError:{type:Object,default:()=>{}}},data:function(){return{loading:!0,loadingError:"",connectivityGraph:null,selectedSource:"",availableSources:[],pathList:[],schemaVersion:"",knowledgeByPath:new Map,labelledTerms:new Set,labelCache:new Map,resetLabel:E6,zoomLockLabel:MS,zoomInLabel:k6,zoomOutLabel:S6,iconColor:_6,zoomEnabled:!1,connectivityGraphContainer:null}},watch:{connectivityFromMap:function(t,e){t!=e&&(this.showSpinner(),this.start())}},mounted(){this.showSpinner(),this.updateTooltipContainer(),this.refreshCache(),this.loadCacheData(),this.start()},methods:{updateTooltipContainer:function(){this.connectivityGraphContainer=this.$refs.connectivityGraphRef},loadCacheData:function(){const t=sessionStorage.getItem("connectivity-graph-sources"),e=sessionStorage.getItem("connectivity-graph-labels"),r=sessionStorage.getItem("connectivity-graph-pathlist"),n=sessionStorage.getItem("connectivity-graph-schema-version");if(this.sckanVersion&&(this.selectedSource=this.sckanVersion),sessionStorage.setItem("connectivity-graph-selected-source",this.selectedSource),this.updateCacheExpiry(),t&&(this.availableSources=JSON.parse(t)),r&&(this.pathList=JSON.parse(r)),e){const a=JSON.parse(e);this.labelCache=new Map(Object.entries(a))}n&&(this.schemaVersion=n)},isValidKnowledgeSource:function(){const t=sessionStorage.getItem("connectivity-graph-selected-source");return!(this.sckanVersion&&this.sckanVersion!==t)},removeAllCacheData:function(){["connectivity-graph-expiry","connectivity-graph-selected-source","connectivity-graph-source","connectivity-graph-sources","connectivity-graph-labels","connectivity-graph-pathlist","connectivity-graph-schema-version"].forEach(e=>{sessionStorage.removeItem(e)})},refreshCache:function(){const t=sessionStorage.getItem("connectivity-graph-expiry"),e=new Date,r=this.isValidKnowledgeSource();(e.getTime()>t||!r)&&this.removeAllCacheData()},updateCacheExpiry:function(){const e=new Date().getTime()+C6;sessionStorage.setItem("connectivity-graph-expiry",e)},start:function(){this.run().then(t=>{t!=null&&t.success?this.showGraph(this.entry):t!=null&&t.error?(this.loadingError=t.error,this.hideSpinner()):(this.loadingError="Loading error!",this.hideSpinner())}).catch(t=>{this.loadingError="Loading error!",this.hideSpinner()})},run:async function(){return this.schemaVersion||(this.schemaVersion=await this.getSchemaVersion(),sessionStorage.setItem("connectivity-graph-schema-version",this.schemaVersion),this.updateCacheExpiry()),this.schemaVersion<w6?{error:`No server available for schema-version ${this.schemaVersion}.`}:(this.availableSources.length||(this.availableSources=await this.loadAvailableSources()),!this.connectivityFromMap&&!this.isSCKANVersionAvailable()?{error:`No data available for SCKAN version ${this.selectedSource}.`}:(await this.setPathList(this.selectedSource),{success:!0}))},showGraph:async function(t){const e=this.$refs.graphCanvas;this.connectivityFromMap&&(this.cacheLabels(this.connectivityFromMap),await this.getCachedTermLabels()),this.connectivityGraph=new v6(this.labelCache,e);const r=this.knowledgeByPath.get(t);this.connectivityFromMap&&(r.axons=this.connectivityFromMap.axons,r.connectivity=this.connectivityFromMap.connectivity,r.dendrites=this.connectivityFromMap.dendrites,r.somas=this.connectivityFromMap.somas),await this.connectivityGraph.addConnectivity(r),this.connectivityGraph.showConnectivity(e),this.selectedConnectivityData.length&&this.connectivityGraph.selectConnectivity(this.selectedConnectivityData),this.connectivityGraph.on("tap-node",n=>{const a=n.detail;this.$emit("tap-node",a)}),this.hideSpinner()},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:[]}}},isSCKANVersionAvailable:function(){return this.availableSources.includes(this.selectedSource)},loadAvailableSources:async function(){const t=await this.getJsonData(`${this.mapServer}knowledge/sources`),r=(t?t.sources||[]:[]).filter(n=>n);return sessionStorage.setItem("connectivity-graph-sources",JSON.stringify(r)),this.updateCacheExpiry(),r},loadPathData:async function(t){const e=await this.query(`select entity, knowledge from knowledge
49
+ `)}function pg(t){const e=t?t.split(`
50
+ `):[],r=[];for(let n=0;n<e.length/2;n++)r.push({id:e[n],label:e[n+e.length/2]});return r}function N9(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 I9 extends EventTarget{constructor(r,n){var a;super();cr(this,"cy");cr(this,"tooltip");this.cy=Bn({container:n,elements:r.elements,layout:{name:"dagre",nodeSep:150,edgeSep:50,rankSep:100,rankDir:"TB",roots:r.roots.length?r.roots:void 0},style:_9,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=pg(i).map(c=>c.label+" ("+c.id+")");this.tooltip.innerText=H2(l.join(`
51
+ `)),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:o}=i;n?a.addClass("active"):(a.removeClass("active"),o="",setTimeout(()=>{a.unselect()}));const l=pg(o),c=new CustomEvent("tap-node",{detail:l});this.dispatchEvent(c)}on(r,n){this.addEventListener(r,n)}}const B9=1.3,D9=24*60*60*1e3,P9="Reset position",K2="Lock zoom",O9="Unlock zoom",A9="Zoom in",R9="Zoom out",G2=.25,L9="#8300bf",F9={name:"ConnectivityGraph",props:{entry:{type:String,default:""},mapServer:{type:String,default:""},sckanVersion:{type:String,default:""},selectedConnectivityData:{type:Array,default:[]},connectivityFromMap:{type:Object,default:()=>null},connectivityError:{type:Object,default:()=>{}}},data:function(){return{loading:!0,loadingError:"",connectivityGraph:null,selectedSource:"",availableSources:[],pathList:[],schemaVersion:"",knowledgeByPath:new Map,labelledTerms:new Set,labelCache:new Map,resetLabel:P9,zoomLockLabel:K2,zoomInLabel:A9,zoomOutLabel:R9,iconColor:L9,zoomEnabled:!1,connectivityGraphContainer:null}},watch:{connectivityFromMap:function(t,e){t!=e&&(this.showSpinner(),this.start())}},mounted(){this.showSpinner(),this.updateTooltipContainer(),this.refreshCache(),this.loadCacheData(),this.start()},methods:{updateTooltipContainer:function(){this.connectivityGraphContainer=this.$refs.connectivityGraphRef},loadCacheData:function(){const t=sessionStorage.getItem("connectivity-graph-sources"),e=sessionStorage.getItem("connectivity-graph-labels"),r=sessionStorage.getItem("connectivity-graph-pathlist"),n=sessionStorage.getItem("connectivity-graph-schema-version");if(this.sckanVersion&&(this.selectedSource=this.sckanVersion),sessionStorage.setItem("connectivity-graph-selected-source",this.selectedSource),this.updateCacheExpiry(),t&&(this.availableSources=JSON.parse(t)),r&&(this.pathList=JSON.parse(r)),e){const a=JSON.parse(e);this.labelCache=new Map(Object.entries(a))}n&&(this.schemaVersion=n)},isValidKnowledgeSource:function(){const t=sessionStorage.getItem("connectivity-graph-selected-source");return!(this.sckanVersion&&this.sckanVersion!==t)},removeAllCacheData:function(){["connectivity-graph-expiry","connectivity-graph-selected-source","connectivity-graph-source","connectivity-graph-sources","connectivity-graph-labels","connectivity-graph-pathlist","connectivity-graph-schema-version"].forEach(e=>{sessionStorage.removeItem(e)})},refreshCache:function(){const t=sessionStorage.getItem("connectivity-graph-expiry"),e=new Date,r=this.isValidKnowledgeSource();(e.getTime()>t||!r)&&this.removeAllCacheData()},updateCacheExpiry:function(){const e=new Date().getTime()+D9;sessionStorage.setItem("connectivity-graph-expiry",e)},start:function(){this.run().then(t=>{t!=null&&t.success?this.showGraph(this.entry):t!=null&&t.error?(this.loadingError=t.error,this.hideSpinner()):(this.loadingError="Loading error!",this.hideSpinner())}).catch(t=>{this.loadingError="Loading error!",this.hideSpinner()})},run:async function(){return this.schemaVersion||(this.schemaVersion=await this.getSchemaVersion(),sessionStorage.setItem("connectivity-graph-schema-version",this.schemaVersion),this.updateCacheExpiry()),this.schemaVersion<B9?{error:`No server available for schema-version ${this.schemaVersion}.`}:(this.availableSources.length||(this.availableSources=await this.loadAvailableSources()),!this.connectivityFromMap&&!this.isSCKANVersionAvailable()?{error:`No data available for SCKAN version ${this.selectedSource}.`}:(await this.setPathList(this.selectedSource),{success:!0}))},showGraph:async function(t){const e=this.$refs.graphCanvas;this.connectivityFromMap&&(this.cacheLabels(this.connectivityFromMap),await this.getCachedTermLabels()),this.connectivityGraph=new S9(this.labelCache,e);const r=this.knowledgeByPath.get(t);this.connectivityFromMap&&(r.axons=this.connectivityFromMap.axons,r.connectivity=this.connectivityFromMap.connectivity,r.dendrites=this.connectivityFromMap.dendrites,r.somas=this.connectivityFromMap.somas),await this.connectivityGraph.addConnectivity(r),this.connectivityGraph.showConnectivity(e),this.selectedConnectivityData.length&&this.connectivityGraph.selectConnectivity(this.selectedConnectivityData),this.connectivityGraph.on("tap-node",n=>{const a=n.detail;this.$emit("tap-node",a)}),this.hideSpinner()},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:[]}}},isSCKANVersionAvailable:function(){return this.availableSources.includes(this.selectedSource)},loadAvailableSources:async function(){const t=await this.getJsonData(`${this.mapServer}knowledge/sources`),r=(t?t.sources||[]:[]).filter(n=>n);return sessionStorage.setItem("connectivity-graph-sources",JSON.stringify(r)),this.updateCacheExpiry(),r},loadPathData:async function(t){const e=await this.query(`select entity, knowledge from knowledge
52
52
  where entity like 'ilxtr:%' and source=?
53
53
  order by entity`,[t]);return e?e.values:[]},setPathList:async function(t){this.pathList.length||(this.pathList=await this.loadPathData(t),sessionStorage.setItem("connectivity-graph-pathlist",JSON.stringify(this.pathList)),this.updateCacheExpiry()),this.knowledgeByPath.clear(),this.labelledTerms=new Set;for(const[e,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
54
54
  where entity in (?${", ?".repeat(this.labelledTerms.size-1)})
55
- 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(FS)},zoomOut:function(){this.connectivityGraph.zoom(-FS)},toggleZoom:function(){this.zoomEnabled=!this.zoomEnabled,this.zoomLockLabel=this.zoomEnabled?x6:MS,this.connectivityGraph.enableZoom(!this.zoomEnabled)}}},N6={class:"connectivity-graph",ref:"connectivityGraphRef"},I6={ref:"graphCanvas",class:"graph-canvas"},B6={class:"control-panel control-panel-tools"},D6={class:"visually-hidden"},O6={class:"visually-hidden"},P6={class:"visually-hidden"},A6={class:"visually-hidden"},R6=s.createStaticVNode('<div class="control-panel control-panel-nodes" data-v-95331209><div class="node-key" data-v-95331209><div class="key-box-container" data-v-95331209><div class="key-box key-box-dendrite" data-v-95331209> Origin </div><div class="key-box key-box-node" data-v-95331209> Components </div><div class="key-box key-box-axon" data-v-95331209> Destination </div></div></div></div>',1),L6={class:"connectivity-graph-error"},M6={key:0,class:"loading-error"};function F6(t,e,r,n,a,i){const o=Ne.Aim,l=ut,c=Ht,u=Pi,d=Ne.Lock,f=Ne.Unlock,h=Ne.ZoomIn,v=Ne.ZoomOut,p=Bu;return s.withDirectives((s.openBlock(),s.createElementBlock("div",N6,[s.createElementVNode("div",I6,null,512),s.createElementVNode("div",B6,[s.createElementVNode("div",{class:s.normalizeClass(["tools",{"zoom-locked":t.zoomEnabled}])},[s.createVNode(u,{content:t.resetLabel,placement:"top",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:s.withCtx(()=>[s.createVNode(c,{class:"control-button",size:"small",onClick:i.reset},{default:s.withCtx(()=>[s.createVNode(l,{color:"white"},{default:s.withCtx(()=>[s.createVNode(o)]),_:1}),s.createElementVNode("span",D6,s.toDisplayString(t.resetLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),s.createVNode(u,{content:t.zoomLockLabel,placement:"top",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:s.withCtx(()=>[s.createVNode(c,{class:"control-button",size:"small",onClick:i.toggleZoom},{default:s.withCtx(()=>[s.createVNode(l,{color:"white"},{default:s.withCtx(()=>[t.zoomEnabled?(s.openBlock(),s.createBlock(d,{key:0})):(s.openBlock(),s.createBlock(f,{key:1}))]),_:1}),s.createElementVNode("span",O6,s.toDisplayString(t.zoomLockLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),s.createVNode(u,{content:t.zoomInLabel,placement:"left",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:s.withCtx(()=>[s.createVNode(c,{class:"control-button",size:"small",onClick:i.zoomIn},{default:s.withCtx(()=>[s.createVNode(l,{color:"white"},{default:s.withCtx(()=>[s.createVNode(h)]),_:1}),s.createElementVNode("span",P6,s.toDisplayString(t.zoomInLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),s.createVNode(u,{content:t.zoomOutLabel,placement:"left",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:s.withCtx(()=>[s.createVNode(c,{class:"control-button",size:"small",onClick:i.zoomOut},{default:s.withCtx(()=>[s.createVNode(l,{color:"white"},{default:s.withCtx(()=>[s.createVNode(v)]),_:1}),s.createElementVNode("span",A6,s.toDisplayString(t.zoomOutLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"])],2)]),R6,s.withDirectives(s.createElementVNode("div",L6,[s.createElementVNode("strong",null,s.toDisplayString(r.connectivityError.errorConnectivities),1),s.createTextVNode(" "+s.toDisplayString(r.connectivityError.errorMessage),1)],512),[[s.vShow,r.connectivityError.errorConnectivities]]),t.loadingError?(s.openBlock(),s.createElementBlock("div",M6,s.toDisplayString(t.loadingError),1)):s.createCommentVNode("",!0)])),[[p,t.loading]])}const $6=Yt(T6,[["render",F6],["__scopeId","data-v-95331209"]]),$S=t=>t&&t.charAt(0).toUpperCase()+t.slice(1),V6=t=>t.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()),q6=t=>new Promise(e=>setTimeout(e,t)),z6={name:"ConnectivityList",components:{Button:Ht,Container:xu,Icon:ut,ElIconWarning:Ne.Warning,ElIconSearch:Ne.Search},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0,featuresAlert:void 0})},origins:{type:Array,default:()=>[]},components:{type:Array,default:()=>[]},destinations:{type:Array,default:()=>[]},originsWithDatasets:{type:Array,default:()=>[]},componentsWithDatasets:{type:Array,default:()=>[]},destinationsWithDatasets:{type:Array,default:()=>[]},availableAnatomyFacets:{type:Array,default:()=>[]},connectivityError:{type:Object,default:()=>{}}},data:function(){return{alertTop:0,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},facetList:[]}},watch:{availableAnatomyFacets:{handler:function(t){this.convertFacetsToList(t)},immediate:!0,deep:!0}},computed:{originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory}},methods:{capitalise:function(t){return $S(t)},onConnectivityHovered:function(t,e){this.$emit("connectivity-hovered",t),e&&(this.alertTop=e.srcElement.offsetParent.offsetTop+e.srcElement.offsetTop)},onConnectivityClicked:function(t){const e=this.connectivityError.errorConnectivities,r=e?t.replace(new RegExp(`\\s*,?\\s*${e}\\s*,?\\s*`,"gi"),"").trim():t;this.$emit("connectivity-clicked",r)},shouldShowMagnifyGlass:function(t){const e=this.connectivityError.errorConnectivities;return(e==null?void 0:e.toLowerCase())!==t.toLowerCase()},shouldShowExploreButton:function(t){if(!this.facetList.length)return!0;for(let e=0;e<t.length;e++)if(this.facetList.includes(t[e].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(t){t.forEach(e=>{e.children?this.convertFacetsToList(e.children):this.facetList.push(e.label.toLowerCase())})},openAll:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.componentsWithDatasets.map(t=>t.name.toLowerCase())})},openAxons:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.destinationsWithDatasets.map(t=>t.name.toLowerCase())})},openDendrites:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.originsWithDatasets.map(t=>t.name.toLowerCase())})}}},On=t=>(s.pushScopeId("data-v-81bbd5ff"),t=t(),s.popScopeId(),t),H6={ref:"connectivityList",class:"connectivity-list"},K6={key:0,class:"block"},G6={class:"attribute-title-container"},U6=On(()=>s.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),j6={style:{"word-break":"keep-all"}},W6=On(()=>s.createElementVNode("i",null,"Origin",-1)),Y6=["origin-item-label","onMouseenter"],Z6=On(()=>s.createElementVNode("span",null,"Search connectivity",-1)),X6={key:1,class:"block"},J6=On(()=>s.createElementVNode("div",{class:"attribute-title-container"},[s.createElementVNode("span",{class:"attribute-title"},"Components")],-1)),Q6=["component-item-label","onMouseenter"],eH=On(()=>s.createElementVNode("span",null,"Search connectivity",-1)),tH={key:2,class:"block"},rH={class:"attribute-title-container"},nH=On(()=>s.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),aH=On(()=>s.createElementVNode("span",{style:{"word-break":"keep-all"}},[s.createElementVNode("i",null,"Destination"),s.createTextVNode(" is where the axons terminate ")],-1)),iH=["destination-item-label","onMouseenter"],oH=On(()=>s.createElementVNode("span",null,"Search connectivity",-1)),sH={class:"block"};function lH(t,e,r,n,a,i){const o=Oa,l=Ne.Warning,c=ut,u=Ne.Search,d=Ht;return s.openBlock(),s.createElementBlock("div",H6,[s.createVNode(o,{width:"250","show-arrow":!1,trigger:"manual",teleported:!1,placement:"left-start",visible:!!r.connectivityError.errorConnectivities,"popper-class":"connectivity-error-container"},{reference:s.withCtx(()=>[s.createElementVNode("div",{class:"connectivity-alert",style:s.normalizeStyle({top:t.alertTop+"px"})},null,4)]),default:s.withCtx(()=>[s.createElementVNode("strong",null,s.toDisplayString(r.connectivityError.errorConnectivities),1),s.createTextVNode(" "+s.toDisplayString(r.connectivityError.errorMessage),1)]),_:1},8,["visible"]),s.createTextVNode(" "+s.toDisplayString(r.entry.paths)+" ",1),r.origins&&r.origins.length>0?(s.openBlock(),s.createElementBlock("div",K6,[s.createElementVNode("div",G6,[U6,s.createVNode(o,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(c,{class:"info"},{default:s.withCtx(()=>[s.createVNode(l)]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("span",j6,[W6,s.createTextVNode(" "+s.toDisplayString(i.originDescription),1)])]),_:1})]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.origins,(f,h)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","origin-item-label":f,key:f,onMouseenter:v=>i.onConnectivityHovered(f,v),onMouseleave:e[0]||(e[0]=v=>i.onConnectivityHovered())},[s.createVNode(o,{width:"150",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.withDirectives(s.createVNode(c,{class:"magnify-glass",onClick:v=>i.onConnectivityClicked(f)},{default:s.withCtx(()=>[s.createVNode(u)]),_:2},1032,["onClick"]),[[s.vShow,i.shouldShowMagnifyGlass(f)]])]),default:s.withCtx(()=>[Z6]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,Y6))),128)),s.withDirectives(s.createVNode(d,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:s.withCtx(()=>[s.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[s.vShow,r.originsWithDatasets&&r.originsWithDatasets.length>0&&i.shouldShowExploreButton(r.originsWithDatasets)]])])):s.createCommentVNode("",!0),r.components&&r.components.length>0?(s.openBlock(),s.createElementBlock("div",X6,[J6,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.components,(f,h)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","component-item-label":f,key:f,onMouseenter:v=>i.onConnectivityHovered(f,v),onMouseleave:e[1]||(e[1]=v=>i.onConnectivityHovered())},[s.createVNode(o,{width:"150",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.withDirectives(s.createVNode(c,{class:"magnify-glass",onClick:v=>i.onConnectivityClicked(f)},{default:s.withCtx(()=>[s.createVNode(u)]),_:2},1032,["onClick"]),[[s.vShow,i.shouldShowMagnifyGlass(f)]])]),default:s.withCtx(()=>[eH]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,Q6))),128))])):s.createCommentVNode("",!0),r.destinations&&r.destinations.length>0?(s.openBlock(),s.createElementBlock("div",tH,[s.createElementVNode("div",rH,[nH,s.createVNode(o,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(c,{class:"info"},{default:s.withCtx(()=>[s.createVNode(l)]),_:1})]),default:s.withCtx(()=>[aH]),_:1})]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.destinations,(f,h)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","destination-item-label":f,key:f,onMouseenter:v=>i.onConnectivityHovered(f,v),onMouseleave:e[2]||(e[2]=v=>i.onConnectivityHovered())},[s.createVNode(o,{width:"150",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.withDirectives(s.createVNode(c,{class:"magnify-glass",onClick:v=>i.onConnectivityClicked(f)},{default:s.withCtx(()=>[s.createVNode(u)]),_:2},1032,["onClick"]),[[s.vShow,i.shouldShowMagnifyGlass(f)]])]),default:s.withCtx(()=>[oH]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,iH))),128)),s.withDirectives(s.createVNode(d,{class:"button",onClick:i.openAxons},{default:s.withCtx(()=>[s.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[s.vShow,r.destinationsWithDatasets&&r.destinationsWithDatasets.length>0&&i.shouldShowExploreButton(r.destinationsWithDatasets)]])])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",sH,[s.createVNode(d,{class:"button",onClick:i.openAll},{default:s.withCtx(()=>[s.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"])],512),[[s.vShow,r.componentsWithDatasets&&r.componentsWithDatasets.length>0&&i.shouldShowExploreButton(r.componentsWithDatasets)]])],512)}const hg=Yt(z6,[["render",lH],["__scopeId","data-v-81bbd5ff"]]),uH=function(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},cH={name:"ConnectionDialog",props:{connectionEntry:{type:Object,default:{}},inDrawing:{type:Boolean,default:!1},connectionExist:{type:Boolean,default:!1}},data:function(){return{tooltipId:void 0}},methods:{shadowDisplay:function(t){return this.tooltipId===t?"always":"hover"},capitalize:function(t){return uH(t)},handleTooltip:function(t){this.tooltipId=this.tooltipId===t?void 0:t,this.$emit("featureTooltip",this.tooltipId)}}},pg=t=>(s.pushScopeId("data-v-1ddab772"),t=t(),s.popScopeId(),t),dH={class:"dialog-container"},fH=pg(()=>s.createElementVNode("span",{class:"dialog-title"},"Finalize drawing",-1)),hH=pg(()=>s.createElementVNode("span",{class:"dialog-title"},"Visualize connection",-1)),pH=pg(()=>s.createElementVNode("b",null,[s.createElementVNode("span",null,"Related Features")],-1)),vH={class:"connection-label"};function gH(t,e,r,n,a,i){const o=Ht,l=as,c=Ri,u=Oa,d=AA;return s.openBlock(),s.createElementBlock("div",dH,[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[r.inDrawing?(s.openBlock(),s.createBlock(l,{key:0},{default:s.withCtx(()=>[fH,s.createVNode(o,{type:"primary",plain:"",onClick:e[0]||(e[0]=f=>t.$emit("confirmDrawn",!0))},{default:s.withCtx(()=>[s.createTextVNode(" Confirm ")]),_:1}),s.createVNode(o,{type:"primary",plain:"",onClick:e[1]||(e[1]=f=>t.$emit("cancelDrawn",!0))},{default:s.withCtx(()=>[s.createTextVNode(" Cancel ")]),_:1})]),_:1})):(s.openBlock(),s.createBlock(l,{key:1},{default:s.withCtx(()=>[hH,s.createVNode(o,{type:"primary",plain:"",onClick:e[2]||(e[2]=f=>t.$emit("dialogDisplay",!1))},{default:s.withCtx(()=>[s.createTextVNode(" Close ")]),_:1})]),_:1}))]),_:1})]),_:1}),r.connectionExist?(s.openBlock(),s.createBlock(l,{key:0},{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[pH,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.connectionEntry,(f,h)=>(s.openBlock(),s.createBlock(l,{key:h},{default:s.withCtx(()=>[s.createVNode(d,{shadow:i.shadowDisplay(h),onClick:v=>i.handleTooltip(h)},{default:s.withCtx(()=>[s.createVNode(u,{trigger:"hover",disabled:f.label.length<20,width:200,content:i.capitalize(f.label)},{reference:s.withCtx(()=>[s.createElementVNode("span",vH,s.toDisplayString(i.capitalize(f.label)),1)]),_:2},1032,["disabled","content"])]),_:2},1032,["shadow","onClick"])]),_:2},1024))),128))]),_:1})]),_:1})):s.createCommentVNode("",!0)])}const mH=Yt(cH,[["render",gH],["__scopeId","data-v-1ddab772"]]),VS=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},yH=["xlink:href"],bH={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(t){return(e,r)=>(s.openBlock(),s.createElementBlock("svg",{class:s.normalizeClass(["map-icon",{"map-icon-spin":t.spin}])},[s.createElementVNode("use",{"xlink:href":`#${t.icon}`},null,8,yH)],2))}},wH=VS(bH,[["__scopeId","data-v-e172d5ff"]]),qS=`<?xml version="1.0" encoding="UTF-8"?>
55
+ 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(G2)},zoomOut:function(){this.connectivityGraph.zoom(-G2)},toggleZoom:function(){this.zoomEnabled=!this.zoomEnabled,this.zoomLockLabel=this.zoomEnabled?O9:K2,this.connectivityGraph.enableZoom(!this.zoomEnabled)}}},M9={class:"connectivity-graph",ref:"connectivityGraphRef"},$9={ref:"graphCanvas",class:"graph-canvas"},V9={class:"control-panel control-panel-tools"},q9={class:"visually-hidden"},z9={class:"visually-hidden"},H9={class:"visually-hidden"},K9={class:"visually-hidden"},G9=s.createStaticVNode('<div class="control-panel control-panel-nodes" data-v-95331209><div class="node-key" data-v-95331209><div class="key-box-container" data-v-95331209><div class="key-box key-box-dendrite" data-v-95331209> Origin </div><div class="key-box key-box-node" data-v-95331209> Components </div><div class="key-box key-box-axon" data-v-95331209> Destination </div></div></div></div>',1),U9={class:"connectivity-graph-error"},j9={key:0,class:"loading-error"};function W9(t,e,r,n,a,i){const o=Ne.Aim,l=it,c=Ht,u=Pa,d=Ne.Lock,f=Ne.Unlock,h=Ne.ZoomIn,v=Ne.ZoomOut,p=Pu;return s.withDirectives((s.openBlock(),s.createElementBlock("div",M9,[s.createElementVNode("div",$9,null,512),s.createElementVNode("div",V9,[s.createElementVNode("div",{class:s.normalizeClass(["tools",{"zoom-locked":t.zoomEnabled}])},[s.createVNode(u,{content:t.resetLabel,placement:"top",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:s.withCtx(()=>[s.createVNode(c,{class:"control-button",size:"small",onClick:i.reset},{default:s.withCtx(()=>[s.createVNode(l,{color:"white"},{default:s.withCtx(()=>[s.createVNode(o)]),_:1}),s.createElementVNode("span",q9,s.toDisplayString(t.resetLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),s.createVNode(u,{content:t.zoomLockLabel,placement:"top",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:s.withCtx(()=>[s.createVNode(c,{class:"control-button",size:"small",onClick:i.toggleZoom},{default:s.withCtx(()=>[s.createVNode(l,{color:"white"},{default:s.withCtx(()=>[t.zoomEnabled?(s.openBlock(),s.createBlock(d,{key:0})):(s.openBlock(),s.createBlock(f,{key:1}))]),_:1}),s.createElementVNode("span",z9,s.toDisplayString(t.zoomLockLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),s.createVNode(u,{content:t.zoomInLabel,placement:"left",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:s.withCtx(()=>[s.createVNode(c,{class:"control-button",size:"small",onClick:i.zoomIn},{default:s.withCtx(()=>[s.createVNode(l,{color:"white"},{default:s.withCtx(()=>[s.createVNode(h)]),_:1}),s.createElementVNode("span",H9,s.toDisplayString(t.zoomInLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),s.createVNode(u,{content:t.zoomOutLabel,placement:"left",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:s.withCtx(()=>[s.createVNode(c,{class:"control-button",size:"small",onClick:i.zoomOut},{default:s.withCtx(()=>[s.createVNode(l,{color:"white"},{default:s.withCtx(()=>[s.createVNode(v)]),_:1}),s.createElementVNode("span",K9,s.toDisplayString(t.zoomOutLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"])],2)]),G9,s.withDirectives(s.createElementVNode("div",U9,[s.createElementVNode("strong",null,s.toDisplayString(r.connectivityError.errorConnectivities),1),s.createTextVNode(" "+s.toDisplayString(r.connectivityError.errorMessage),1)],512),[[s.vShow,r.connectivityError.errorConnectivities]]),t.loadingError?(s.openBlock(),s.createElementBlock("div",j9,s.toDisplayString(t.loadingError),1)):s.createCommentVNode("",!0)])),[[p,t.loading]])}const Y9=Yt(F9,[["render",W9],["__scopeId","data-v-95331209"]]),U2=t=>t&&t.charAt(0).toUpperCase()+t.slice(1),Z9=t=>t.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()),X9=t=>new Promise(e=>setTimeout(e,t)),J9={name:"ConnectivityList",components:{Button:Ht,Container:Su,Icon:it,ElIconWarning:Ne.Warning,ElIconSearch:Ne.Search},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0,featuresAlert:void 0})},origins:{type:Array,default:()=>[]},components:{type:Array,default:()=>[]},destinations:{type:Array,default:()=>[]},originsWithDatasets:{type:Array,default:()=>[]},componentsWithDatasets:{type:Array,default:()=>[]},destinationsWithDatasets:{type:Array,default:()=>[]},availableAnatomyFacets:{type:Array,default:()=>[]},connectivityError:{type:Object,default:()=>{}}},data:function(){return{alertTop:0,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},facetList:[]}},watch:{availableAnatomyFacets:{handler:function(t){this.convertFacetsToList(t)},immediate:!0,deep:!0}},computed:{originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory}},methods:{capitalise:function(t){return U2(t)},onConnectivityHovered:function(t,e){this.$emit("connectivity-hovered",t),e&&(this.alertTop=e.srcElement.offsetParent.offsetTop+e.srcElement.offsetTop)},onConnectivityClicked:function(t){const e=this.connectivityError.errorConnectivities,r=e?t.replace(new RegExp(`\\s*,?\\s*${e}\\s*,?\\s*`,"gi"),"").trim():t;this.$emit("connectivity-clicked",r)},shouldShowMagnifyGlass:function(t){const e=this.connectivityError.errorConnectivities;return(e==null?void 0:e.toLowerCase())!==t.toLowerCase()},shouldShowExploreButton:function(t){if(!this.facetList.length)return!0;for(let e=0;e<t.length;e++)if(this.facetList.includes(t[e].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(t){t.forEach(e=>{e.children?this.convertFacetsToList(e.children):this.facetList.push(e.label.toLowerCase())})},openAll:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.componentsWithDatasets.map(t=>t.name.toLowerCase())})},openAxons:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.destinationsWithDatasets.map(t=>t.name.toLowerCase())})},openDendrites:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.originsWithDatasets.map(t=>t.name.toLowerCase())})}}},Pn=t=>(s.pushScopeId("data-v-81bbd5ff"),t=t(),s.popScopeId(),t),Q9={ref:"connectivityList",class:"connectivity-list"},eH={key:0,class:"block"},tH={class:"attribute-title-container"},rH=Pn(()=>s.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),nH={style:{"word-break":"keep-all"}},aH=Pn(()=>s.createElementVNode("i",null,"Origin",-1)),iH=["origin-item-label","onMouseenter"],oH=Pn(()=>s.createElementVNode("span",null,"Search connectivity",-1)),sH={key:1,class:"block"},lH=Pn(()=>s.createElementVNode("div",{class:"attribute-title-container"},[s.createElementVNode("span",{class:"attribute-title"},"Components")],-1)),uH=["component-item-label","onMouseenter"],cH=Pn(()=>s.createElementVNode("span",null,"Search connectivity",-1)),dH={key:2,class:"block"},fH={class:"attribute-title-container"},hH=Pn(()=>s.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),pH=Pn(()=>s.createElementVNode("span",{style:{"word-break":"keep-all"}},[s.createElementVNode("i",null,"Destination"),s.createTextVNode(" is where the axons terminate ")],-1)),vH=["destination-item-label","onMouseenter"],gH=Pn(()=>s.createElementVNode("span",null,"Search connectivity",-1)),mH={class:"block"};function yH(t,e,r,n,a,i){const o=Ra,l=Ne.Warning,c=it,u=Ne.Search,d=Ht;return s.openBlock(),s.createElementBlock("div",Q9,[s.createVNode(o,{width:"250","show-arrow":!1,trigger:"manual",teleported:!1,placement:"left-start",visible:!!r.connectivityError.errorConnectivities,"popper-class":"connectivity-error-container"},{reference:s.withCtx(()=>[s.createElementVNode("div",{class:"connectivity-alert",style:s.normalizeStyle({top:t.alertTop+"px"})},null,4)]),default:s.withCtx(()=>[s.createElementVNode("strong",null,s.toDisplayString(r.connectivityError.errorConnectivities),1),s.createTextVNode(" "+s.toDisplayString(r.connectivityError.errorMessage),1)]),_:1},8,["visible"]),s.createTextVNode(" "+s.toDisplayString(r.entry.paths)+" ",1),r.origins&&r.origins.length>0?(s.openBlock(),s.createElementBlock("div",eH,[s.createElementVNode("div",tH,[rH,s.createVNode(o,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(c,{class:"info"},{default:s.withCtx(()=>[s.createVNode(l)]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("span",nH,[aH,s.createTextVNode(" "+s.toDisplayString(i.originDescription),1)])]),_:1})]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.origins,(f,h)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","origin-item-label":f,key:f,onMouseenter:v=>i.onConnectivityHovered(f,v),onMouseleave:e[0]||(e[0]=v=>i.onConnectivityHovered())},[s.createVNode(o,{width:"150",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.withDirectives(s.createVNode(c,{class:"magnify-glass",onClick:v=>i.onConnectivityClicked(f)},{default:s.withCtx(()=>[s.createVNode(u)]),_:2},1032,["onClick"]),[[s.vShow,i.shouldShowMagnifyGlass(f)]])]),default:s.withCtx(()=>[oH]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,iH))),128)),s.withDirectives(s.createVNode(d,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:s.withCtx(()=>[s.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[s.vShow,r.originsWithDatasets&&r.originsWithDatasets.length>0&&i.shouldShowExploreButton(r.originsWithDatasets)]])])):s.createCommentVNode("",!0),r.components&&r.components.length>0?(s.openBlock(),s.createElementBlock("div",sH,[lH,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.components,(f,h)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","component-item-label":f,key:f,onMouseenter:v=>i.onConnectivityHovered(f,v),onMouseleave:e[1]||(e[1]=v=>i.onConnectivityHovered())},[s.createVNode(o,{width:"150",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.withDirectives(s.createVNode(c,{class:"magnify-glass",onClick:v=>i.onConnectivityClicked(f)},{default:s.withCtx(()=>[s.createVNode(u)]),_:2},1032,["onClick"]),[[s.vShow,i.shouldShowMagnifyGlass(f)]])]),default:s.withCtx(()=>[cH]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,uH))),128))])):s.createCommentVNode("",!0),r.destinations&&r.destinations.length>0?(s.openBlock(),s.createElementBlock("div",dH,[s.createElementVNode("div",fH,[hH,s.createVNode(o,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(c,{class:"info"},{default:s.withCtx(()=>[s.createVNode(l)]),_:1})]),default:s.withCtx(()=>[pH]),_:1})]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.destinations,(f,h)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","destination-item-label":f,key:f,onMouseenter:v=>i.onConnectivityHovered(f,v),onMouseleave:e[2]||(e[2]=v=>i.onConnectivityHovered())},[s.createVNode(o,{width:"150",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.withDirectives(s.createVNode(c,{class:"magnify-glass",onClick:v=>i.onConnectivityClicked(f)},{default:s.withCtx(()=>[s.createVNode(u)]),_:2},1032,["onClick"]),[[s.vShow,i.shouldShowMagnifyGlass(f)]])]),default:s.withCtx(()=>[gH]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,vH))),128)),s.withDirectives(s.createVNode(d,{class:"button",onClick:i.openAxons},{default:s.withCtx(()=>[s.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[s.vShow,r.destinationsWithDatasets&&r.destinationsWithDatasets.length>0&&i.shouldShowExploreButton(r.destinationsWithDatasets)]])])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",mH,[s.createVNode(d,{class:"button",onClick:i.openAll},{default:s.withCtx(()=>[s.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"])],512),[[s.vShow,r.componentsWithDatasets&&r.componentsWithDatasets.length>0&&i.shouldShowExploreButton(r.componentsWithDatasets)]])],512)}const vg=Yt(J9,[["render",yH],["__scopeId","data-v-81bbd5ff"]]),bH=function(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},wH={name:"ConnectionDialog",props:{connectionEntry:{type:Object,default:{}},inDrawing:{type:Boolean,default:!1},connectionExist:{type:Boolean,default:!1}},data:function(){return{tooltipId:void 0}},methods:{shadowDisplay:function(t){return this.tooltipId===t?"always":"hover"},capitalize:function(t){return bH(t)},handleTooltip:function(t){this.tooltipId=this.tooltipId===t?void 0:t,this.$emit("featureTooltip",this.tooltipId)}}},gg=t=>(s.pushScopeId("data-v-1ddab772"),t=t(),s.popScopeId(),t),CH={class:"dialog-container"},EH=gg(()=>s.createElementVNode("span",{class:"dialog-title"},"Finalize drawing",-1)),xH=gg(()=>s.createElementVNode("span",{class:"dialog-title"},"Visualize connection",-1)),kH=gg(()=>s.createElementVNode("b",null,[s.createElementVNode("span",null,"Related Features")],-1)),SH={class:"connection-label"};function _H(t,e,r,n,a,i){const o=Ht,l=is,c=Fi,u=Ra,d=zA;return s.openBlock(),s.createElementBlock("div",CH,[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[r.inDrawing?(s.openBlock(),s.createBlock(l,{key:0},{default:s.withCtx(()=>[EH,s.createVNode(o,{type:"primary",plain:"",onClick:e[0]||(e[0]=f=>t.$emit("confirmDrawn",!0))},{default:s.withCtx(()=>[s.createTextVNode(" Confirm ")]),_:1}),s.createVNode(o,{type:"primary",plain:"",onClick:e[1]||(e[1]=f=>t.$emit("cancelDrawn",!0))},{default:s.withCtx(()=>[s.createTextVNode(" Cancel ")]),_:1})]),_:1})):(s.openBlock(),s.createBlock(l,{key:1},{default:s.withCtx(()=>[xH,s.createVNode(o,{type:"primary",plain:"",onClick:e[2]||(e[2]=f=>t.$emit("dialogDisplay",!1))},{default:s.withCtx(()=>[s.createTextVNode(" Close ")]),_:1})]),_:1}))]),_:1})]),_:1}),r.connectionExist?(s.openBlock(),s.createBlock(l,{key:0},{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[kH,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.connectionEntry,(f,h)=>(s.openBlock(),s.createBlock(l,{key:h},{default:s.withCtx(()=>[s.createVNode(d,{shadow:i.shadowDisplay(h),onClick:v=>i.handleTooltip(h)},{default:s.withCtx(()=>[s.createVNode(u,{trigger:"hover",disabled:f.label.length<20,width:200,content:i.capitalize(f.label)},{reference:s.withCtx(()=>[s.createElementVNode("span",SH,s.toDisplayString(i.capitalize(f.label)),1)]),_:2},1032,["disabled","content"])]),_:2},1032,["shadow","onClick"])]),_:2},1024))),128))]),_:1})]),_:1})):s.createCommentVNode("",!0)])}const TH=Yt(wH,[["render",_H],["__scopeId","data-v-1ddab772"]]),j2=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},NH=["xlink:href"],IH={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(t){return(e,r)=>(s.openBlock(),s.createElementBlock("svg",{class:s.normalizeClass(["map-icon",{"map-icon-spin":t.spin}])},[s.createElementVNode("use",{"xlink:href":`#${t.icon}`},null,8,NH)],2))}},BH=j2(IH,[["__scopeId","data-v-e172d5ff"]]),W2=`<?xml version="1.0" encoding="UTF-8"?>
56
56
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
57
57
  <title>2horpanel</title>
58
58
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -67,7 +67,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
67
67
  <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
68
68
  </g>
69
69
  </g>
70
- </svg>`,zS=`<?xml version="1.0" encoding="UTF-8"?>
70
+ </svg>`,Y2=`<?xml version="1.0" encoding="UTF-8"?>
71
71
  <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">
72
72
  <title>2vertpanel</title>
73
73
  <g id="2vertpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -82,7 +82,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
82
82
  <line x1="12" y1="7.5" x2="12" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
83
83
  </g>
84
84
  </g>
85
- </svg>`,HS=`<?xml version="1.0" encoding="UTF-8"?>
85
+ </svg>`,Z2=`<?xml version="1.0" encoding="UTF-8"?>
86
86
  <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">
87
87
  <title>3panel</title>
88
88
  <g id="3panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -98,7 +98,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
98
98
  <line x1="18.5" y1="11.5" x2="11.5" y2="11.5" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
99
99
  </g>
100
100
  </g>
101
- </svg>`,KS=`<?xml version="1.0" encoding="UTF-8"?>
101
+ </svg>`,X2=`<?xml version="1.0" encoding="UTF-8"?>
102
102
  <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">
103
103
  <title>4panel</title>
104
104
  <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -114,7 +114,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
114
114
  <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
115
115
  </g>
116
116
  </g>
117
- </svg>`,GS=`<?xml version="1.0" encoding="UTF-8"?>
117
+ </svg>`,J2=`<?xml version="1.0" encoding="UTF-8"?>
118
118
  <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">
119
119
  <title>2horpanel</title>
120
120
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -132,7 +132,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
132
132
  <line x1="9.5" y1="12" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
133
133
  </g>
134
134
  </g>
135
- </svg>`,US=`<?xml version="1.0" encoding="UTF-8"?>
135
+ </svg>`,Q2=`<?xml version="1.0" encoding="UTF-8"?>
136
136
  <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">
137
137
  <title>2horpanel</title>
138
138
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -149,7 +149,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
149
149
  <line x1="9.5" y1="16" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
150
150
  </g>
151
151
  </g>
152
- </svg>`,jS=`<?xml version="1.0" encoding="UTF-8"?>
152
+ </svg>`,e_=`<?xml version="1.0" encoding="UTF-8"?>
153
153
  <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">
154
154
  <title>4panel</title>
155
155
  <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -166,7 +166,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
166
166
  <line x1="18.5" y1="13.8" x2="5.5" y2="13.8" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
167
167
  </g>
168
168
  </g>
169
- </svg>`,WS=`<?xml version="1.0" encoding="UTF-8"?>
169
+ </svg>`,t_=`<?xml version="1.0" encoding="UTF-8"?>
170
170
  <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">
171
171
  <title>changeBckgd</title>
172
172
  <g id="changeBckgd" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -177,7 +177,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
177
177
  <line x1="7" y1="16.5" x2="17" y2="16.5" id="Line" stroke="#FFFFFF" stroke-linecap="square"></line>
178
178
  </g>
179
179
  </g>
180
- </svg>`,YS=`<?xml version="1.0" encoding="UTF-8"?>
180
+ </svg>`,r_=`<?xml version="1.0" encoding="UTF-8"?>
181
181
  <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">
182
182
  <title>close no bk</title>
183
183
  <g id="close-no-bk" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="square">
@@ -186,7 +186,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
186
186
  <line x1="7" y1="0" x2="7" y2="14" id="Line-9"></line>
187
187
  </g>
188
188
  </g>
189
- </svg>`,ZS=`<?xml version="1.0" encoding="UTF-8"?>
189
+ </svg>`,n_=`<?xml version="1.0" encoding="UTF-8"?>
190
190
  <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">
191
191
  <title>close</title>
192
192
  <g id="close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -200,7 +200,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
200
200
  </g>
201
201
  </g>
202
202
  </g>
203
- </svg>`,XS=`<?xml version="1.0" encoding="UTF-8"?>
203
+ </svg>`,a_=`<?xml version="1.0" encoding="UTF-8"?>
204
204
  <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">
205
205
  <title>closeFullScreen</title>
206
206
  <g id="closeFullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -212,7 +212,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
212
212
  <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>
213
213
  </g>
214
214
  </g>
215
- </svg>`,JS=`<?xml version="1.0" encoding="UTF-8"?>
215
+ </svg>`,i_=`<?xml version="1.0" encoding="UTF-8"?>
216
216
  <svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
217
217
  xmlns:xlink="http://www.w3.org/1999/xlink">
218
218
  <title>Comment</title>
@@ -221,7 +221,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
221
221
  <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(165, 215)"
222
222
  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" />
223
223
  </g>
224
- </svg>`,QS=`<?xml version="1.0" encoding="UTF-8"?>
224
+ </svg>`,o_=`<?xml version="1.0" encoding="UTF-8"?>
225
225
  <svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
226
226
  xmlns:xlink="http://www.w3.org/1999/xlink">
227
227
  <title>Connection</title>
@@ -232,7 +232,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
232
232
  <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(175, 175)"
233
233
  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" />
234
234
  </g>
235
- </svg>`,e_=`<?xml version="1.0" encoding="UTF-8"?>
235
+ </svg>`,s_=`<?xml version="1.0" encoding="UTF-8"?>
236
236
  <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">
237
237
  <title>dock</title>
238
238
  <g id="dock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -252,35 +252,35 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
252
252
  </g>
253
253
  </g>
254
254
  </g>
255
- </svg>`,t_=`<?xml version="1.0" encoding="UTF-8"?>
255
+ </svg>`,l_=`<?xml version="1.0" encoding="UTF-8"?>
256
256
  <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">
257
257
  <title>drawLine</title>
258
258
  <g id="drawLine" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
259
259
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
260
260
  <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" />
261
261
  </g>
262
- </svg>`,r_=`<?xml version="1.0" encoding="UTF-8"?>
262
+ </svg>`,u_=`<?xml version="1.0" encoding="UTF-8"?>
263
263
  <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">
264
264
  <title>drawPoint</title>
265
265
  <g id="drawPoint" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
266
266
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
267
267
  <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" />
268
268
  </g>
269
- </svg>`,n_=`<?xml version="1.0" encoding="UTF-8"?>
269
+ </svg>`,c_=`<?xml version="1.0" encoding="UTF-8"?>
270
270
  <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">
271
271
  <title>drawPolygon</title>
272
272
  <g id="drawPolygon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
273
273
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
274
274
  <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" />
275
275
  </g>
276
- </svg>`,a_=`<?xml version="1.0" encoding="UTF-8"?>
276
+ </svg>`,d_=`<?xml version="1.0" encoding="UTF-8"?>
277
277
  <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">
278
278
  <title>drawTrash</title>
279
279
  <g id="drawTrash" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
280
280
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
281
281
  <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" />
282
282
  </g>
283
- </svg>`,i_=`<?xml version="1.0" encoding="UTF-8"?>
283
+ </svg>`,f_=`<?xml version="1.0" encoding="UTF-8"?>
284
284
  <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">
285
285
  <title>fitWindow</title>
286
286
  <g id="fitWindow" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -299,7 +299,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
299
299
  </g>
300
300
  </g>
301
301
  </g>
302
- </svg>`,o_=`<?xml version="1.0" encoding="UTF-8"?>
302
+ </svg>`,h_=`<?xml version="1.0" encoding="UTF-8"?>
303
303
  <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">
304
304
  <title>fullScreen</title>
305
305
  <g id="fullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -313,7 +313,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
313
313
  </g>
314
314
  </g>
315
315
  </g>
316
- </svg>`,s_='<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>',l_=`<?xml version="1.0" encoding="UTF-8"?>
316
+ </svg>`,p_='<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>',v_=`<?xml version="1.0" encoding="UTF-8"?>
317
317
  <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">
318
318
  <title>magnifyingGlass</title>
319
319
  <g id="magnifyingGlass" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -327,7 +327,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
327
327
  </g>
328
328
  </g>
329
329
  </g>
330
- </svg>`,u_=`<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>`,c_=`<?xml version="1.0" encoding="UTF-8"?>
330
+ </svg>`,g_=`<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>`,m_=`<?xml version="1.0" encoding="UTF-8"?>
331
331
  <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">
332
332
  <title>openMap</title>
333
333
  <g id="openMap" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -337,7 +337,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
337
337
  <rect id="Rectangle" stroke="#FFFFFF" x="5" y="10" width="10" height="7"></rect>
338
338
  <rect id="Rectangle-Copy" stroke="#FFFFFF" x="9" y="6" width="10" height="7"></rect>
339
339
  </g>
340
- </svg>`,d_=`<?xml version="1.0" encoding="UTF-8"?>
340
+ </svg>`,y_=`<?xml version="1.0" encoding="UTF-8"?>
341
341
  <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">
342
342
  <title>Artboard Copy 6</title>
343
343
  <g id="Artboard-Copy-6" 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="9" y1="8" x2="9" y2="16" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
348
348
  <line x1="15" y1="8" x2="15" y2="16" id="Line-6-Copy-3" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
349
349
  </g>
350
- </svg>`,f_=`<?xml version="1.0" encoding="UTF-8"?>
350
+ </svg>`,b_=`<?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>permalink</title>
353
353
  <g id="permalink" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -355,7 +355,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
355
355
  <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>
356
356
  <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>
357
357
  </g>
358
- </svg>`,h_=`<?xml version="1.0" encoding="UTF-8"?>
358
+ </svg>`,w_=`<?xml version="1.0" encoding="UTF-8"?>
359
359
  <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">
360
360
  <title>play</title>
361
361
  <g id="play" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -366,7 +366,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
366
366
  <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>
367
367
  </g>
368
368
  </g>
369
- </svg>`,p_=`<?xml version="1.0" encoding="UTF-8"?>
369
+ </svg>`,C_=`<?xml version="1.0" encoding="UTF-8"?>
370
370
  <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">
371
371
  <title>resetZoom</title>
372
372
  <g id="resetZoom" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -384,7 +384,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
384
384
  </g>
385
385
  </g>
386
386
  </g>
387
- </svg>`,v_=`<?xml version="1.0" encoding="UTF-8"?>
387
+ </svg>`,E_=`<?xml version="1.0" encoding="UTF-8"?>
388
388
  <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">
389
389
  <title>singlepanel</title>
390
390
  <g id="singlepanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -398,7 +398,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
398
398
  <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
399
399
  </g>
400
400
  </g>
401
- </svg>`,g_=`<?xml version="1.0" encoding="UTF-8"?>
401
+ </svg>`,x_=`<?xml version="1.0" encoding="UTF-8"?>
402
402
  <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">
403
403
  <title>tooltips</title>
404
404
  <g id="tooltips" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -410,7 +410,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
410
410
  </text>
411
411
  </g>
412
412
  </g>
413
- </svg>`,m_=`<?xml version="1.0" encoding="UTF-8"?>
413
+ </svg>`,k_=`<?xml version="1.0" encoding="UTF-8"?>
414
414
  <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">
415
415
  <title>undock</title>
416
416
  <g id="undock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -430,7 +430,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
430
430
  </g>
431
431
  </g>
432
432
  </g>
433
- </svg>`,y_=`<?xml version="1.0" encoding="UTF-8"?>
433
+ </svg>`,S_=`<?xml version="1.0" encoding="UTF-8"?>
434
434
  <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">
435
435
  <title>zoomIn</title>
436
436
  <g id="zoomIn" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -446,7 +446,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
446
446
  <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>
447
447
  </g>
448
448
  </g>
449
- </svg>`,b_=`<?xml version="1.0" encoding="UTF-8"?>
449
+ </svg>`,__=`<?xml version="1.0" encoding="UTF-8"?>
450
450
  <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">
451
451
  <title>zoomOut</title>
452
452
  <g id="zoomOut" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -461,10 +461,10 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
461
461
  <line x1="9" y1="9.5" x2="12" y2="9.5" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
462
462
  </g>
463
463
  </g>
464
- </svg>`,w_=(t,e,r,n)=>{const a=["title","desc","defs","style"],i=["width","height"],o=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&&o.map(u=>{Object.values(l.querySelectorAll(`[${u}]`)).map(d=>{d.removeAttribute(u)})});const c=l.innerHTML;return l=null,c},C_=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(),CH=!0,EH=!0,xH=["fill"],vg=Object.assign({"/assets/icons/2horpanel.svg":qS,"/assets/icons/2vertpanel.svg":zS,"/assets/icons/3panel.svg":HS,"/assets/icons/4panel.svg":KS,"/assets/icons/5panel.svg":GS,"/assets/icons/6panel.svg":US,"/assets/icons/6panelVertical.svg":jS,"/assets/icons/changeBckgd.svg":WS,"/assets/icons/close-no-bk.svg":YS,"/assets/icons/close.svg":ZS,"/assets/icons/closeFullScreen.svg":XS,"/assets/icons/comment.svg":JS,"/assets/icons/connection.svg":QS,"/assets/icons/dock.svg":e_,"/assets/icons/drawLine.svg":t_,"/assets/icons/drawPoint.svg":r_,"/assets/icons/drawPolygon.svg":n_,"/assets/icons/drawTrash.svg":a_,"/assets/icons/fitWindow.svg":i_,"/assets/icons/fullScreen.svg":o_,"/assets/icons/help.svg":s_,"/assets/icons/magnifyingGlass.svg":l_,"/assets/icons/noun-filter.svg":u_,"/assets/icons/openMap.svg":c_,"/assets/icons/pause.svg":d_,"/assets/icons/permalink.svg":f_,"/assets/icons/play.svg":h_,"/assets/icons/resetZoom.svg":p_,"/assets/icons/singlepanel.svg":v_,"/assets/icons/tooltips.svg":g_,"/assets/icons/undock.svg":m_,"/assets/icons/zoomIn.svg":y_,"/assets/icons/zoomOut.svg":b_});Object.keys(vg).map(t=>{const e=w_(vg[t],CH,EH,xH),r=t.replace(/^.+\/(\w+).svg$/,"$1");return C_(e).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}).join(`
465
- `);const gg=Object.assign({"/assets/icons/2horpanel.svg":qS,"/assets/icons/2vertpanel.svg":zS,"/assets/icons/3panel.svg":HS,"/assets/icons/4panel.svg":KS,"/assets/icons/5panel.svg":GS,"/assets/icons/6panel.svg":US,"/assets/icons/6panelVertical.svg":jS,"/assets/icons/changeBckgd.svg":WS,"/assets/icons/close-no-bk.svg":YS,"/assets/icons/close.svg":ZS,"/assets/icons/closeFullScreen.svg":XS,"/assets/icons/comment.svg":JS,"/assets/icons/connection.svg":QS,"/assets/icons/dock.svg":e_,"/assets/icons/drawLine.svg":t_,"/assets/icons/drawPoint.svg":r_,"/assets/icons/drawPolygon.svg":n_,"/assets/icons/drawTrash.svg":a_,"/assets/icons/fitWindow.svg":i_,"/assets/icons/fullScreen.svg":o_,"/assets/icons/help.svg":s_,"/assets/icons/magnifyingGlass.svg":l_,"/assets/icons/noun-filter.svg":u_,"/assets/icons/openMap.svg":c_,"/assets/icons/pause.svg":d_,"/assets/icons/permalink.svg":f_,"/assets/icons/play.svg":h_,"/assets/icons/resetZoom.svg":p_,"/assets/icons/singlepanel.svg":v_,"/assets/icons/tooltips.svg":g_,"/assets/icons/undock.svg":m_,"/assets/icons/zoomIn.svg":y_,"/assets/icons/zoomOut.svg":b_}),kH=Object.keys(gg).map(t=>{const e=w_(gg[t]),r=t.replace(/^.+\/(\w+).svg$/,"$1");return C_(e).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}),SH={name:"MapSvgSpriteColor",svgContext:gg,svgSprite:kH.join(`
466
- `)},_H=["innerHTML"];function TH(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:t.$options.svgSprite},null,8,_H)}const NH=VS(SH,[["render",TH]]),IH=(t,e)=>{let r,n,a,i,o,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(),o=r-(a-u.clientX),l=n-(i-u.clientY),e.style.left=`${o}px`,e.style.top=`${l}px`}},BH={name:"DrawToolbar",components:{MapSvgIcon:wH,MapSvgSpriteColor:NH},props:{mapCanvas:{type:Object,default:void 0},toolbarOptions:{type:Array,default:["Edit","Delete","Point","LineString","Polygon","Connection"]},drawnType:{type:String,default:"All tools"},activeDrawTool:{required:!0},activeDrawMode:{required:!0},newlyDrawnEntry:{type:Object,default:{}},connectionEntry:{type:Object,default:{}},hoverVisibilities:{type:Array,required:!0,default:[{value:!1,ref:"editPopover"},{value:!1,ref:"deletePopover"},{value:!1,ref:"pointPopover"},{value:!1,ref:"lineStringPopover"},{value:!1,ref:"polygonPopover"},{value:!1,ref:"connectionPopover"}]}},data:function(){return{toolbarIcons:[{name:"Edit",active:!1,disabled:!1,type:"mode"},{name:"Delete",active:!1,disabled:!1,type:"mode"},{name:"Point",active:!1,disabled:!1,type:"tool"},{name:"LineString",active:!1,disabled:!1,type:"tool"},{name:"Polygon",active:!1,disabled:!1,type:"tool"},{name:"Connection",active:!1,disabled:!0,type:"conn"}],connectionDisplay:!1,dialogPosition:{offsetX:0,offsetY:0,x:void 0,y:void 0}}},computed:{showAllToolIcons:function(){return this.drawnType==="All tools"||this.drawnType==="None"},showEditModeIcon:function(){return this.toolbarOptions.includes("Edit")},showDeleteModeIcon:function(){return this.toolbarOptions.includes("Delete")},showDrawPointIcon:function(){return this.toolbarOptions.includes("Point")&&(this.showAllToolIcons||this.drawnType==="Point")},showDrawLineStringIcon:function(){return this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},showDrawPolygonIcon:function(){return this.toolbarOptions.includes("Polygon")&&(this.showAllToolIcons||this.drawnType==="Polygon")},showConnectionIcon:function(){return this.toolbarOptions.includes("Connection")&&this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},inDrawing:function(){return this.activeDrawTool!==void 0},newlyDrawnExist:function(){return Object.keys(this.newlyDrawnEntry).length>0},connectionExist:function(){return Object.keys(this.connectionEntry).length>0}},watch:{drawnType:function(){this.disabledToolbarConnectionIcon(!0)},activeDrawMode:function(t){this.updateToolbarIcons(t,"mode"),t==="Delete"&&(this.connectionDisplay=!1)},activeDrawTool:function(t){this.updateToolbarIcons(t,"tool"),t||(this.connectionDisplay=!1)},newlyDrawnExist:function(t){t&&(this.connectionDisplay=!0)},connectionExist:function(t){this.disabledToolbarConnectionIcon(!t),t||(this.connectionDisplay=!1)},connectionDisplay:function(t){this.activeToolbarConnectionIcon(t),t?this.dialogCssHacks():this.$emit("featureTooltip",void 0)},dialogPosition:{handler:function(){const t=this.$el.getBoundingClientRect();this.dialogPosition.offsetX=t.x,this.dialogPosition.offsetY=t.y},deep:!0,once:!0}},methods:{iconDisabled:function(t){return this.toolbarIcons.filter(e=>e.name===t)[0].disabled},modeClickEvent:function(t){if(!this.iconDisabled(t)){const e=this.activeDrawMode===t?void 0:t;this.$emit("clickToolbar","mode",e)}},toolClickEvent:function(t){if(!this.iconDisabled(t)){const e=this.activeDrawTool===t?void 0:t;this.$emit("clickToolbar","tool",e)}},connectionClickEvent:function(){!this.iconDisabled("Connection")&&!this.newlyDrawnExist&&(this.connectionDisplay=!this.connectionDisplay)},updateToolbarIcons:function(t,e){this.toolbarIcons.map(r=>{r.name===t?r.active=!0:r.active=!1}),this.toolbarIcons.filter(r=>r.type!=="conn").filter(r=>r.type!==e).map(r=>{t?r.disabled=!0:r.disabled=!1}),this.toolbarCssHacks()},disabledToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.type==="conn").map(e=>{t?e.disabled=!0:e.disabled=!1,this.activeDrawMode==="Delete"&&(e.disabled=!0)}),this.toolbarCssHacks()},activeToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.type==="conn").map(e=>{t?e.active=!0:e.active=!1}),this.toolbarCssHacks()},toolbarCssHacks:function(){this.$nextTick(()=>{this.toolbarIcons.map(t=>{const e=this.$el.querySelector(`.draw${t.name}`);e&&(t.active?e.classList.add("active"):e.classList.remove("active"),t.disabled?e.classList.add("disabled"):e.classList.remove("disabled"))})})},dialogCssHacks:function(){this.$nextTick(()=>{const t=this.$el.querySelector(".connection-dialog");IH(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)}},DH={class:"toolbar-container"},OH={class:"toolbar-icons"};function PH(t,e,r,n,a,i){const o=s.resolveComponent("map-svg-sprite-color"),l=s.resolveComponent("map-svg-icon"),c=Oa,u=mH;return s.openBlock(),s.createElementBlock("div",DH,[s.createVNode(o),s.createElementVNode("div",OH,[i.showEditModeIcon?(s.openBlock(),s.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:s.withCtx(()=>[s.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"])):s.createCommentVNode("",!0),i.showDeleteModeIcon?(s.openBlock(),s.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:s.withCtx(()=>[s.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"])):s.createCommentVNode("",!0),i.showDrawPointIcon?(s.openBlock(),s.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:s.withCtx(()=>[s.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"])):s.createCommentVNode("",!0),i.showDrawLineStringIcon?(s.openBlock(),s.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:s.withCtx(()=>[s.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"])):s.createCommentVNode("",!0),i.showDrawPolygonIcon?(s.openBlock(),s.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:s.withCtx(()=>[s.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"])):s.createCommentVNode("",!0),i.showConnectionIcon?(s.openBlock(),s.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:s.withCtx(()=>[s.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"])):s.createCommentVNode("",!0)]),r.mapCanvas?s.withDirectives((s.openBlock(),s.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"])),[[s.vShow,t.connectionDisplay]]):s.createCommentVNode("",!0)])}const AH=Yt(BH,[["render",PH],["__scopeId","data-v-21e6f6bd"]]),RH={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(o=>{const l=o.style.transform;this.extractMarkerPosition(l)===a&&o.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):""}}},mg=t=>(s.pushScopeId("data-v-3efb89fb"),t=t(),s.popScopeId(),t),LH=mg(()=>s.createElementVNode("h4",null,"Help Mode",-1)),MH=mg(()=>s.createElementVNode("p",null,[s.createTextVNode(" All caught up! "),s.createElementVNode("br"),s.createTextVNode(" Click 'Help' to restart. ")],-1)),FH=mg(()=>s.createElementVNode("p",null,'Click "Next" to see the next item.',-1));function $H(t,e,r,n,a,i){const o=Ht;return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["help-mode-dialog",{finish:r.lastItem}])},[LH,r.lastItem?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[MH,s.createElementVNode("div",null,[s.createVNode(o,{class:"button",onClick:i.finishHelpMode},{default:s.withCtx(()=>[s.createTextVNode(" Finish ")]),_:1},8,["onClick"])])],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[FH,s.createElementVNode("div",null,[s.createVNode(o,{class:"button",onClick:i.showNext},{default:s.withCtx(()=>[s.createTextVNode(" Next ")]),_:1},8,["onClick"]),s.createVNode(o,{class:"button secondary",onClick:i.finishHelpMode},{default:s.withCtx(()=>[s.createTextVNode(" Exit Help Mode ")]),_:1},8,["onClick"])])],64))],2)}const VH=Yt(RH,[["render",$H],["__scopeId","data-v-3efb89fb"]]),qH={name:"RelatedConnectivitiesButton",props:{resource:{type:String,required:!0}}},zH={class:"reference-button-container"};function HH(t,e,r,n,a,i){const o=Ht;return s.openBlock(),s.createElementBlock("div",zH,[s.createVNode(o,{class:"reference-icon-button",size:"small",onClick:e[0]||(e[0]=l=>t.$emit("show-related-connectivities",r.resource))},{default:s.withCtx(()=>[s.createTextVNode(" Show related connectivities ")]),_:1})])}const E_=Yt(qH,[["render",HH],["__scopeId","data-v-2f3dd1db"]]),KH="https://citation.doi.org",GH=[{label:"APA",value:"apa"},{label:"Chicago",value:"chicago-author-date"},{label:"IEEE",value:"ieee"},{label:"Bibtex",value:"bibtex"}],yg="apa",UH=600,jH={name:"ExternalResourceCard",components:{CopyToClipboard:us,RelatedConnectivitiesButton:E_},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubMedReferences:[],openLibReferences:[],isbnDBReferences:[],referecesListContent:"",citationOptions:GH,citationType:yg,crosscite_host:KH}},watch:{resources:function(t){this.formatReferences([...t]),this.getCitationText(yg)}},computed:{referencesWithDOI:function(){return this.pubMedReferences.filter(e=>e.type==="doi"||e.doi).length}},mounted:function(){this.formatReferences([...this.resources]),this.getCitationText(yg)},methods:{showRelatedConnectivities:function(t){this.$emit("show-reference-connectivities",t);const e={event:"interaction_event",event_name:"portal_maps_show_related_connectivities",category:t,location:"map_connectivity_references"};this.$emit("trackEvent",e)},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 o=i.esearchresult.idlist||[];n.id=o[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=[],r=t.filter(u=>u.indexOf("isbn")!==-1),n=r.map(u=>"ISBN:"+u.split("/").pop()),a=n.join(","),i=n.slice(),o=u=>r.find(d=>d.includes(u)),l=`https://openlibrary.org/api/books?bibkeys=${a}&format=json`,c=await this.fetchData(l);for(const u in c){const d=i.indexOf(u);i.splice(d,1);const f=c[u].info_url,h=f.split("/"),v=h.indexOf("books"),p=h[v+1],g=u.split(":")[1],m=o(g);e.push({id:g,type:"openlib",url:f,bookId:p,resource:m})}return i.forEach(u=>{const d=u.split(":")[1],f=`https://isbndb.com/book/${d}`,h=o(d);e.push({id:d,url:f,type:"isbndb",resource:h})}),e},extractPublicationIdFromURLString:function(t){if(!t)return;const e=decodeURIComponent(t);let r={id:"",type:"",citation:{},resource:t};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)},generateCitationText:function(t,e){const{id:r,type:n,doi:a}=t;if(!(t.citation&&t.citation[e])&&r)if(t.citation[e]="",t.citation.error=null,n==="doi"||a){const i=n==="doi"?r:a;this.getCitationTextByDOI(i).then(o=>{const l=this.replaceLinkInText(o);t.citation[e]=l,this.updateCopyContents()}).catch(o=>{t.citation.error={type:e,ref:"doi"}})}else n==="pmid"&&this.getDOIFromPubMedID(r).then(i=>{if(i!=null&&i.result){const o=i.result[r],c=((o==null?void 0:o.articleids)||[]).find(d=>d.idtype==="doi"),u=c==null?void 0:c.value;if(u)t.doi=u,this.getCitationTextByDOI(u).then(d=>{const f=this.replaceLinkInText(d);t.citation[e]=f,this.updateCopyContents()}).catch(d=>{t.citation.error={type:e,ref:"doi"}});else{const{title:d,pubdate:f,authors:h}=o,v=h?h.map(g=>g.name):[],p=this.formatCopyReference({title:d||"",date:f||"",authors:v,url:`https://pubmed.ncbi.nlm.nih.gov/${r}`});t.citation[e]=p,this.updateCopyContents()}}}).catch(i=>{t.citation.error={type:e,ref:"pubmed"}})},getCitationText:function(t){async function e(r){for(let n=0;n<r.pubMedReferences.length;n++)r.generateCitationText(r.pubMedReferences[n],t),r.pubMedReferences.length>3&&n<r.pubMedReferences.length-1&&await q6(UH)}e(this)},reloadCitation:function(t){this.generateCitationText(t,this.citationType)},isCitationLoading:function(t){return t&&!t[this.citationType]&&!t.error},isCitationError:function(t){return t&&t.error&&t.error.type===this.citationType},updateCopyContents:function(){const t=this.citationOptions.find(n=>n.value===this.citationType);let e="";const r=[];if(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)}),r.length){const a=`<ul>${r.map(o=>`<li>${o}</li>`).join(`
464
+ </svg>`,T_=(t,e,r,n)=>{const a=["title","desc","defs","style"],i=["width","height"],o=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&&o.map(u=>{Object.values(l.querySelectorAll(`[${u}]`)).map(d=>{d.removeAttribute(u)})});const c=l.innerHTML;return l=null,c},N_=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(),DH=!0,PH=!0,OH=["fill"],mg=Object.assign({"/assets/icons/2horpanel.svg":W2,"/assets/icons/2vertpanel.svg":Y2,"/assets/icons/3panel.svg":Z2,"/assets/icons/4panel.svg":X2,"/assets/icons/5panel.svg":J2,"/assets/icons/6panel.svg":Q2,"/assets/icons/6panelVertical.svg":e_,"/assets/icons/changeBckgd.svg":t_,"/assets/icons/close-no-bk.svg":r_,"/assets/icons/close.svg":n_,"/assets/icons/closeFullScreen.svg":a_,"/assets/icons/comment.svg":i_,"/assets/icons/connection.svg":o_,"/assets/icons/dock.svg":s_,"/assets/icons/drawLine.svg":l_,"/assets/icons/drawPoint.svg":u_,"/assets/icons/drawPolygon.svg":c_,"/assets/icons/drawTrash.svg":d_,"/assets/icons/fitWindow.svg":f_,"/assets/icons/fullScreen.svg":h_,"/assets/icons/help.svg":p_,"/assets/icons/magnifyingGlass.svg":v_,"/assets/icons/noun-filter.svg":g_,"/assets/icons/openMap.svg":m_,"/assets/icons/pause.svg":y_,"/assets/icons/permalink.svg":b_,"/assets/icons/play.svg":w_,"/assets/icons/resetZoom.svg":C_,"/assets/icons/singlepanel.svg":E_,"/assets/icons/tooltips.svg":x_,"/assets/icons/undock.svg":k_,"/assets/icons/zoomIn.svg":S_,"/assets/icons/zoomOut.svg":__});Object.keys(mg).map(t=>{const e=T_(mg[t],DH,PH,OH),r=t.replace(/^.+\/(\w+).svg$/,"$1");return N_(e).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}).join(`
465
+ `);const yg=Object.assign({"/assets/icons/2horpanel.svg":W2,"/assets/icons/2vertpanel.svg":Y2,"/assets/icons/3panel.svg":Z2,"/assets/icons/4panel.svg":X2,"/assets/icons/5panel.svg":J2,"/assets/icons/6panel.svg":Q2,"/assets/icons/6panelVertical.svg":e_,"/assets/icons/changeBckgd.svg":t_,"/assets/icons/close-no-bk.svg":r_,"/assets/icons/close.svg":n_,"/assets/icons/closeFullScreen.svg":a_,"/assets/icons/comment.svg":i_,"/assets/icons/connection.svg":o_,"/assets/icons/dock.svg":s_,"/assets/icons/drawLine.svg":l_,"/assets/icons/drawPoint.svg":u_,"/assets/icons/drawPolygon.svg":c_,"/assets/icons/drawTrash.svg":d_,"/assets/icons/fitWindow.svg":f_,"/assets/icons/fullScreen.svg":h_,"/assets/icons/help.svg":p_,"/assets/icons/magnifyingGlass.svg":v_,"/assets/icons/noun-filter.svg":g_,"/assets/icons/openMap.svg":m_,"/assets/icons/pause.svg":y_,"/assets/icons/permalink.svg":b_,"/assets/icons/play.svg":w_,"/assets/icons/resetZoom.svg":C_,"/assets/icons/singlepanel.svg":E_,"/assets/icons/tooltips.svg":x_,"/assets/icons/undock.svg":k_,"/assets/icons/zoomIn.svg":S_,"/assets/icons/zoomOut.svg":__}),AH=Object.keys(yg).map(t=>{const e=T_(yg[t]),r=t.replace(/^.+\/(\w+).svg$/,"$1");return N_(e).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}),RH={name:"MapSvgSpriteColor",svgContext:yg,svgSprite:AH.join(`
466
+ `)},LH=["innerHTML"];function FH(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:t.$options.svgSprite},null,8,LH)}const MH=j2(RH,[["render",FH]]),$H=(t,e)=>{let r,n,a,i,o,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(),o=r-(a-u.clientX),l=n-(i-u.clientY),e.style.left=`${o}px`,e.style.top=`${l}px`}},VH={name:"DrawToolbar",components:{MapSvgIcon:BH,MapSvgSpriteColor:MH},props:{mapCanvas:{type:Object,default:void 0},toolbarOptions:{type:Array,default:["Edit","Delete","Point","LineString","Polygon","Connection"]},drawnType:{type:String,default:"All tools"},activeDrawTool:{required:!0},activeDrawMode:{required:!0},newlyDrawnEntry:{type:Object,default:{}},connectionEntry:{type:Object,default:{}},hoverVisibilities:{type:Array,required:!0,default:[{value:!1,ref:"editPopover"},{value:!1,ref:"deletePopover"},{value:!1,ref:"pointPopover"},{value:!1,ref:"lineStringPopover"},{value:!1,ref:"polygonPopover"},{value:!1,ref:"connectionPopover"}]}},data:function(){return{toolbarIcons:[{name:"Edit",active:!1,disabled:!1,type:"mode"},{name:"Delete",active:!1,disabled:!1,type:"mode"},{name:"Point",active:!1,disabled:!1,type:"tool"},{name:"LineString",active:!1,disabled:!1,type:"tool"},{name:"Polygon",active:!1,disabled:!1,type:"tool"},{name:"Connection",active:!1,disabled:!0,type:"conn"}],connectionDisplay:!1,dialogPosition:{offsetX:0,offsetY:0,x:void 0,y:void 0}}},computed:{showAllToolIcons:function(){return this.drawnType==="All tools"||this.drawnType==="None"},showEditModeIcon:function(){return this.toolbarOptions.includes("Edit")},showDeleteModeIcon:function(){return this.toolbarOptions.includes("Delete")},showDrawPointIcon:function(){return this.toolbarOptions.includes("Point")&&(this.showAllToolIcons||this.drawnType==="Point")},showDrawLineStringIcon:function(){return this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},showDrawPolygonIcon:function(){return this.toolbarOptions.includes("Polygon")&&(this.showAllToolIcons||this.drawnType==="Polygon")},showConnectionIcon:function(){return this.toolbarOptions.includes("Connection")&&this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},inDrawing:function(){return this.activeDrawTool!==void 0},newlyDrawnExist:function(){return Object.keys(this.newlyDrawnEntry).length>0},connectionExist:function(){return Object.keys(this.connectionEntry).length>0}},watch:{drawnType:function(){this.disabledToolbarConnectionIcon(!0)},activeDrawMode:function(t){this.updateToolbarIcons(t,"mode"),t==="Delete"&&(this.connectionDisplay=!1)},activeDrawTool:function(t){this.updateToolbarIcons(t,"tool"),t||(this.connectionDisplay=!1)},newlyDrawnExist:function(t){t&&(this.connectionDisplay=!0)},connectionExist:function(t){this.disabledToolbarConnectionIcon(!t),t||(this.connectionDisplay=!1)},connectionDisplay:function(t){this.activeToolbarConnectionIcon(t),t?this.dialogCssHacks():this.$emit("featureTooltip",void 0)},dialogPosition:{handler:function(){const t=this.$el.getBoundingClientRect();this.dialogPosition.offsetX=t.x,this.dialogPosition.offsetY=t.y},deep:!0,once:!0}},methods:{iconDisabled:function(t){return this.toolbarIcons.filter(e=>e.name===t)[0].disabled},modeClickEvent:function(t){if(!this.iconDisabled(t)){const e=this.activeDrawMode===t?void 0:t;this.$emit("clickToolbar","mode",e)}},toolClickEvent:function(t){if(!this.iconDisabled(t)){const e=this.activeDrawTool===t?void 0:t;this.$emit("clickToolbar","tool",e)}},connectionClickEvent:function(){!this.iconDisabled("Connection")&&!this.newlyDrawnExist&&(this.connectionDisplay=!this.connectionDisplay)},updateToolbarIcons:function(t,e){this.toolbarIcons.map(r=>{r.name===t?r.active=!0:r.active=!1}),this.toolbarIcons.filter(r=>r.type!=="conn").filter(r=>r.type!==e).map(r=>{t?r.disabled=!0:r.disabled=!1}),this.toolbarCssHacks()},disabledToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.type==="conn").map(e=>{t?e.disabled=!0:e.disabled=!1,this.activeDrawMode==="Delete"&&(e.disabled=!0)}),this.toolbarCssHacks()},activeToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.type==="conn").map(e=>{t?e.active=!0:e.active=!1}),this.toolbarCssHacks()},toolbarCssHacks:function(){this.$nextTick(()=>{this.toolbarIcons.map(t=>{const e=this.$el.querySelector(`.draw${t.name}`);e&&(t.active?e.classList.add("active"):e.classList.remove("active"),t.disabled?e.classList.add("disabled"):e.classList.remove("disabled"))})})},dialogCssHacks:function(){this.$nextTick(()=>{const t=this.$el.querySelector(".connection-dialog");$H(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)}},qH={class:"toolbar-container"},zH={class:"toolbar-icons"};function HH(t,e,r,n,a,i){const o=s.resolveComponent("map-svg-sprite-color"),l=s.resolveComponent("map-svg-icon"),c=Ra,u=TH;return s.openBlock(),s.createElementBlock("div",qH,[s.createVNode(o),s.createElementVNode("div",zH,[i.showEditModeIcon?(s.openBlock(),s.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:s.withCtx(()=>[s.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"])):s.createCommentVNode("",!0),i.showDeleteModeIcon?(s.openBlock(),s.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:s.withCtx(()=>[s.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"])):s.createCommentVNode("",!0),i.showDrawPointIcon?(s.openBlock(),s.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:s.withCtx(()=>[s.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"])):s.createCommentVNode("",!0),i.showDrawLineStringIcon?(s.openBlock(),s.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:s.withCtx(()=>[s.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"])):s.createCommentVNode("",!0),i.showDrawPolygonIcon?(s.openBlock(),s.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:s.withCtx(()=>[s.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"])):s.createCommentVNode("",!0),i.showConnectionIcon?(s.openBlock(),s.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:s.withCtx(()=>[s.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"])):s.createCommentVNode("",!0)]),r.mapCanvas?s.withDirectives((s.openBlock(),s.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"])),[[s.vShow,t.connectionDisplay]]):s.createCommentVNode("",!0)])}const KH=Yt(VH,[["render",HH],["__scopeId","data-v-21e6f6bd"]]),GH={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(o=>{const l=o.style.transform;this.extractMarkerPosition(l)===a&&o.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):""}}},bg=t=>(s.pushScopeId("data-v-3efb89fb"),t=t(),s.popScopeId(),t),UH=bg(()=>s.createElementVNode("h4",null,"Help Mode",-1)),jH=bg(()=>s.createElementVNode("p",null,[s.createTextVNode(" All caught up! "),s.createElementVNode("br"),s.createTextVNode(" Click 'Help' to restart. ")],-1)),WH=bg(()=>s.createElementVNode("p",null,'Click "Next" to see the next item.',-1));function YH(t,e,r,n,a,i){const o=Ht;return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["help-mode-dialog",{finish:r.lastItem}])},[UH,r.lastItem?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[jH,s.createElementVNode("div",null,[s.createVNode(o,{class:"button",onClick:i.finishHelpMode},{default:s.withCtx(()=>[s.createTextVNode(" Finish ")]),_:1},8,["onClick"])])],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[WH,s.createElementVNode("div",null,[s.createVNode(o,{class:"button",onClick:i.showNext},{default:s.withCtx(()=>[s.createTextVNode(" Next ")]),_:1},8,["onClick"]),s.createVNode(o,{class:"button secondary",onClick:i.finishHelpMode},{default:s.withCtx(()=>[s.createTextVNode(" Exit Help Mode ")]),_:1},8,["onClick"])])],64))],2)}const ZH=Yt(GH,[["render",YH],["__scopeId","data-v-3efb89fb"]]),XH={name:"RelatedConnectivitiesButton",props:{resource:{type:String,required:!0}}},JH={class:"reference-button-container"};function QH(t,e,r,n,a,i){const o=Ht;return s.openBlock(),s.createElementBlock("div",JH,[s.createVNode(o,{class:"reference-icon-button",size:"small",onClick:e[0]||(e[0]=l=>t.$emit("show-related-connectivities",r.resource))},{default:s.withCtx(()=>[s.createTextVNode(" Show related connectivities ")]),_:1})])}const I_=Yt(XH,[["render",QH],["__scopeId","data-v-2f3dd1db"]]),eK="https://citation.doi.org",tK=[{label:"APA",value:"apa"},{label:"Chicago",value:"chicago-author-date"},{label:"IEEE",value:"ieee"},{label:"Bibtex",value:"bibtex"}],wg="apa",rK=600,nK={name:"ExternalResourceCard",components:{CopyToClipboard:cs,RelatedConnectivitiesButton:I_},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubMedReferences:[],openLibReferences:[],isbnDBReferences:[],referecesListContent:"",citationOptions:tK,citationType:wg,crosscite_host:eK}},watch:{resources:function(t){this.formatReferences([...t]),this.getCitationText(wg)}},computed:{referencesWithDOI:function(){return this.pubMedReferences.filter(e=>e.type==="doi"||e.doi).length}},mounted:function(){this.formatReferences([...this.resources]),this.getCitationText(wg)},methods:{showRelatedConnectivities:function(t){this.$emit("show-reference-connectivities",t);const e={event:"interaction_event",event_name:"portal_maps_show_related_connectivities",category:t,location:"map_connectivity_references"};this.$emit("trackEvent",e)},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 o=i.esearchresult.idlist||[];n.id=o[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=[],r=t.filter(u=>u.indexOf("isbn")!==-1),n=r.map(u=>"ISBN:"+u.split("/").pop()),a=n.join(","),i=n.slice(),o=u=>r.find(d=>d.includes(u)),l=`https://openlibrary.org/api/books?bibkeys=${a}&format=json`,c=await this.fetchData(l);for(const u in c){const d=i.indexOf(u);i.splice(d,1);const f=c[u].info_url,h=f.split("/"),v=h.indexOf("books"),p=h[v+1],g=u.split(":")[1],y=o(g);e.push({id:g,type:"openlib",url:f,bookId:p,resource:y})}return i.forEach(u=>{const d=u.split(":")[1],f=`https://isbndb.com/book/${d}`,h=o(d);e.push({id:d,url:f,type:"isbndb",resource:h})}),e},extractPublicationIdFromURLString:function(t){if(!t)return;const e=decodeURIComponent(t);let r={id:"",type:"",citation:{},resource:t};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)},generateCitationText:function(t,e){const{id:r,type:n,doi:a}=t;if(!(t.citation&&t.citation[e])&&r)if(t.citation[e]="",t.citation.error=null,n==="doi"||a){const i=n==="doi"?r:a;this.getCitationTextByDOI(i).then(o=>{const l=this.replaceLinkInText(o);t.citation[e]=l,this.updateCopyContents()}).catch(o=>{t.citation.error={type:e,ref:"doi"}})}else n==="pmid"&&this.getDOIFromPubMedID(r).then(i=>{if(i!=null&&i.result){const o=i.result[r],c=((o==null?void 0:o.articleids)||[]).find(d=>d.idtype==="doi"),u=c==null?void 0:c.value;if(u)t.doi=u,this.getCitationTextByDOI(u).then(d=>{const f=this.replaceLinkInText(d);t.citation[e]=f,this.updateCopyContents()}).catch(d=>{t.citation.error={type:e,ref:"doi"}});else{const{title:d,pubdate:f,authors:h}=o,v=h?h.map(g=>g.name):[],p=this.formatCopyReference({title:d||"",date:f||"",authors:v,url:`https://pubmed.ncbi.nlm.nih.gov/${r}`});t.citation[e]=p,this.updateCopyContents()}}}).catch(i=>{t.citation.error={type:e,ref:"pubmed"}})},getCitationText:function(t){async function e(r){for(let n=0;n<r.pubMedReferences.length;n++)r.generateCitationText(r.pubMedReferences[n],t),r.pubMedReferences.length>3&&n<r.pubMedReferences.length-1&&await X9(rK)}e(this)},reloadCitation:function(t){this.generateCitationText(t,this.citationType)},isCitationLoading:function(t){return t&&!t[this.citationType]&&!t.error},isCitationError:function(t){return t&&t.error&&t.error.type===this.citationType},updateCopyContents:function(){const t=this.citationOptions.find(n=>n.value===this.citationType);let e="";const r=[];if(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)}),r.length){const a=`<ul>${r.map(o=>`<li>${o}</li>`).join(`
467
467
  `)}</ul>`,i="<div><strong>References</strong></div>";this.referecesListContent=i+`
468
- `+a}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=`${this.crosscite_host}/format?doi=${t}&style=${this.citationType}&lang=en-US`;return await this.fetchData(e,"text")},getDOIFromPubMedID:async function(t){const e=`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=${t}&format=json`;return await this.fetchData(e)},formatOpenLibReferences:function(){this.openLibReferences.forEach(t=>{const{bookId:e}=t;this.getBookData(e).then(r=>{const{title:n,authors:a,publish_date:i}=r;n&&(t.title=n),i&&(t.date=i),a&&(t.authors=[],a.forEach(o=>{this.getBookAuthor(o.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){throw new Error(r)}},onCopied:function(t,e){let r="Reference List",n="",a=this.citationType;e?(r=e.resource,n=e.type==="doi"?e.id:""):r=[...this.pubMedReferences,...this.openLibReferences,...this.isbnDBReferences].map(c=>c.type==="doi"?c.id:c.resource).join(", ");const i={event:"interaction_event",event_name:"portal_maps_copy_citation",category:r,doi:n,citation_type:a,location:"map_connectivity_references"};this.$emit("trackEvent",i)}}},va=t=>(s.pushScopeId("data-v-e4259096"),t=t(),s.popScopeId(),t),WH={class:"resource-container"},YH={class:"attribute-title-container"},ZH=va(()=>s.createElementVNode("div",{class:"attribute-title"},"References",-1)),XH={class:"copy-button"},JH={key:0,class:"citation-tabs"},QH={class:"citation-list"},eK=va(()=>s.createElementVNode("span",null,"Internal Server Error",-1)),tK=va(()=>s.createElementVNode("br",null,null,-1)),rK=va(()=>s.createElementVNode("br",null,null,-1)),nK=["href"],aK=va(()=>s.createElementVNode("br",null,null,-1)),iK=va(()=>s.createElementVNode("span",null,"Sorry, something went wrong.",-1)),oK=va(()=>s.createElementVNode("br",null,null,-1)),sK=["onClick"],lK=["innerHTML"],uK=["innerHTML"],cK=["href"];function dK(t,e,r,n,a,i){const o=us,l=Ht,c=E_;return s.openBlock(),s.createElementBlock("div",WH,[s.createElementVNode("div",YH,[ZH,s.createElementVNode("div",XH,[s.createVNode(o,{onCopied:e[0]||(e[0]=u=>i.onCopied(u,"")),label:"Copy list to clipboard",content:t.referecesListContent},null,8,["content"])])]),i.referencesWithDOI?(s.openBlock(),s.createElementBlock("div",JH,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.citationOptions,u=>(s.openBlock(),s.createBlock(l,{link:"",key:u.value,type:t.citationType===u.value?"primary":"",onClick:d=>i.onCitationFormatChange(u.value)},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(u.label),1)]),_:2},1032,["type","onClick"]))),128))])):s.createCommentVNode("",!0),s.createElementVNode("ul",QH,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.pubMedReferences,u=>{var d,f,h,v;return s.openBlock(),s.createElementBlock("li",{key:u.id,class:s.normalizeClass({loading:i.isCitationLoading(u.citation),error:i.isCitationError(u.citation)})},[u.citation?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[((d=u.citation.error)==null?void 0:d.ref)==="doi"&&((f=u.citation.error)==null?void 0:f.type)===t.citationType?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[eK,tK,s.createTextVNode(" Sorry, something went wrong."),rK,s.createTextVNode(" The dataset citation generator ("),s.createElementVNode("a",{href:t.crosscite_host,target:"_blank"},s.toDisplayString(t.crosscite_host),9,nK),s.createTextVNode(") encountered an internal error and was unable to complete your request."),aK,s.createTextVNode(" Please come back later. ")],64)):((h=u.citation.error)==null?void 0:h.ref)==="pubmed"&&((v=u.citation.error)==null?void 0:v.type)===t.citationType?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[iK,oK,s.createTextVNode(" Please try again. "),s.createElementVNode("span",{class:"reload-button",onClick:p=>i.reloadCitation(u)},"Reload",8,sK)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[s.createElementVNode("span",{innerHTML:u.citation[t.citationType]},null,8,lK),s.createVNode(c,{resource:u.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{onCopied:p=>i.onCopied(p,u),content:u.citation[t.citationType]},null,8,["onCopied","content"])],64))],64)):s.createCommentVNode("",!0)],2)}),128)),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.openLibReferences,u=>(s.openBlock(),s.createElementBlock("li",{key:u.id},[s.createElementVNode("div",{innerHTML:i.formatCopyReference(u)},null,8,uK),s.createVNode(c,{resource:u.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{onCopied:d=>i.onCopied(d,u),content:i.formatCopyReference(u)},null,8,["onCopied","content"])]))),128)),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.isbnDBReferences,u=>(s.openBlock(),s.createElementBlock("li",{key:u.id},[s.createElementVNode("a",{href:u.url,target:"_blank"},s.toDisplayString(u.url),9,cK),s.createVNode(c,{resource:u.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{onCopied:d=>i.onCopied(d,u),content:u.url},null,8,["onCopied","content"])]))),128))])])}const bg=Yt(jH,[["render",dK],["__scopeId","data-v-e4259096"]]);function fK(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 x_=new fK,hK={name:"ProvenancePopup",components:{ElIconArrowUp:Ne.ArrowUp,ElIconArrowDown:Ne.ArrowDown,ElIconWarning:Ne.Warning,ConnectivityList:hg,ExternalResourceCard:bg},props:{tooltipEntry:{type:Array,default:[]}},data:function(){return{loading:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},entryIndex:0,availableAnatomyFacets:[],connectivityError:{}}},computed:{entry:function(){return this.tooltipEntry[this.entryIndex]},previousLabel:function(){var t;return this.entryIndex===0?"This is the first item. Click 'Next' to see more information.":(t=this.tooltipEntry[this.entryIndex-1])==null?void 0:t.title},nextLabel:function(){var t;return this.entryIndex===this.tooltipEntry.length-1?"This is the last item. Click 'Previous' to see more information.":(t=this.tooltipEntry[this.entryIndex+1])==null?void 0:t.title},provSpeciesDescription:function(){let t="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(e=>{t+=` ${e},`}),t=t.slice(0,-1),t+=" species",t},origins:function(){return this.entry.origins},components:function(){return this.entry.components},destinations:function(){return this.entry.destinations},originsWithDatasets:function(){return this.entry.originsWithDatasets},componentsWithDatasets:function(){return this.entry.componentsWithDatasets},destinationsWithDatasets:function(){return this.entry.destinationsWithDatasets},resources:function(){return this.entry.hyperlinks||[]}},watch:{tooltipEntry:{deep:!0,immediate:!0,handler:function(t,e){t!==e&&(this.entryIndex=0)}}},mounted:function(){this.loadAvailableAnatomyFacets()},methods:{previous:function(){this.entryIndex!==0&&(this.entryIndex=this.entryIndex-1)},next:function(){this.entryIndex!==this.tooltipEntry.length-1&&(this.entryIndex=this.entryIndex+1)},titleCase:function(t){return V6(t)},capitalise:function(t){return $S(t)},onConnectivityActionClick:function(t){x_.emit("onActionClick",t)},loadAvailableAnatomyFacets:function(){const t=localStorage.getItem("available-anatomy-facets");t&&(this.availableAnatomyFacets=JSON.parse(t))}}},pK=t=>(s.pushScopeId("data-v-dc8d1ad3"),t=t(),s.popScopeId(),t),vK={key:0,class:"main"},gK={key:0,class:"toggle-button"},mK={key:1,class:"block"},yK={class:"title"},bK={key:0,class:"subtitle"},wK={key:2,class:"block"},CK={class:"title"},EK={key:3,class:"attribute-title-container"},xK=pK(()=>s.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),kK={style:{"word-break":"keep-all"}},SK={class:"content-container scrollbar"};function _K(t,e,r,n,a,i){const o=Ht,l=Oa,c=Ne.Warning,u=ut,d=Ne.ArrowUp,f=Ne.ArrowDown,h=hg,v=bg,p=Bu;return i.entry?s.withDirectives((s.openBlock(),s.createElementBlock("div",vK,[r.tooltipEntry.length>1?(s.openBlock(),s.createElementBlock("div",gK,[s.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:s.withCtx(()=>[s.createVNode(o,{class:"button",onClick:i.previous,disabled:this.entryIndex===0},{default:s.withCtx(()=>[s.createTextVNode(" Previous ")]),_:1},8,["onClick","disabled"])]),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(i.previousLabel),1)]),_:1}),s.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:s.withCtx(()=>[s.createVNode(o,{class:"button",onClick:i.next,disabled:this.entryIndex===this.tooltipEntry.length-1},{default:s.withCtx(()=>[s.createTextVNode(" Next ")]),_:1},8,["onClick","disabled"])]),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(i.nextLabel),1)]),_:1})])):s.createCommentVNode("",!0),i.entry.title?(s.openBlock(),s.createElementBlock("div",mK,[s.createElementVNode("div",yK,s.toDisplayString(i.capitalise(i.entry.title)),1),i.entry.provenanceTaxonomyLabel&&i.entry.provenanceTaxonomyLabel.length>0?(s.openBlock(),s.createElementBlock("div",bK,s.toDisplayString(i.provSpeciesDescription),1)):s.createCommentVNode("",!0)])):(s.openBlock(),s.createElementBlock("div",wK,[s.createElementVNode("div",CK,s.toDisplayString(i.entry.featureId),1)])),i.entry.featuresAlert?(s.openBlock(),s.createElementBlock("div",EK,[xK,s.createVNode(l,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(u,{class:"info"},{default:s.withCtx(()=>[s.createVNode(c)]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("span",kK,s.toDisplayString(i.entry.featuresAlert),1)]),_:1})])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",{class:"hide",id:"hide-path-info",onClick:e[0]||(e[0]=g=>t.showDetails=!1)},[s.createTextVNode(" Hide path information "),s.createVNode(u,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})],512),[[s.vShow,t.showDetails]]),s.withDirectives(s.createElementVNode("div",{class:"hide",id:"show-path-info",onClick:e[1]||(e[1]=g=>t.showDetails=!0)},[s.createTextVNode(" Show path information "),s.createVNode(u,null,{default:s.withCtx(()=>[s.createVNode(f)]),_:1})],512),[[s.vShow,!t.showDetails]]),s.createVNode(s.Transition,{name:"slide-fade"},{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",SK,[(s.openBlock(),s.createBlock(h,{key:i.entry.featureId[0],entry:i.entry,origins:i.origins,components:i.components,destinations:i.destinations,originsWithDatasets:i.originsWithDatasets,componentsWithDatasets:i.componentsWithDatasets,destinationsWithDatasets:i.destinationsWithDatasets,availableAnatomyFacets:t.availableAnatomyFacets,connectivityError:t.connectivityError,onConnectivityActionClick:i.onConnectivityActionClick},null,8,["entry","origins","components","destinations","originsWithDatasets","componentsWithDatasets","destinationsWithDatasets","availableAnatomyFacets","connectivityError","onConnectivityActionClick"])),i.resources.length?(s.openBlock(),s.createBlock(v,{key:0,resources:i.resources},null,8,["resources"])):s.createCommentVNode("",!0)],512),[[s.vShow,t.showDetails]])]),_:1})])),[[p,t.loading]]):s.createCommentVNode("",!0)}const TK=Yt(hK,[["render",_K],["__scopeId","data-v-dc8d1ad3"]]),NK={name:"Tooltip",props:{tooltipEntry:{type:Array},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Array}},mounted:function(){x_.on("onActionClick",t=>{this.$emit("onActionClick",t)})}},IK={class:"tooltip-container",id:"tooltip-container"};function BK(t,e,r,n,a,i){const o=g0,l=TK;return s.openBlock(),s.createElementBlock("div",IK,[r.annotationDisplay?(s.openBlock(),s.createBlock(o,{key:0,annotationEntry:r.annotationEntry,onAnnotation:e[0]||(e[0]=c=>t.$emit("annotation",c))},null,8,["annotationEntry"])):(s.openBlock(),s.createBlock(l,{key:1,tooltipEntry:r.tooltipEntry},null,8,["tooltipEntry"]))])}const DK=Yt(NK,[["render",BK],["__scopeId","data-v-d1e37cc2"]]),OK={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:"",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:{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,o=a.getBoundingClientRect().x,l=a.querySelector(".lastChildInItem");let c=0;if(l){const d=l.getBoundingClientRect();c=d.x+d.width-o}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)}},PK={class:"selections-container"},AK={class:"title-text"},RK={class:"tree-container",ref:"treeContainer"},LK={class:"tooltip-text"},MK=["onClick","onMouseover","onMouseenter"],FK=["onClick","onMouseover","onMouseenter"],$K={class:"lastChildInItem"},VK={key:0,class:"node-options"};function qK(t,e,r,n,a,i){const o=Ri,l=Di,c=as,u=Oa,d=RR,f=FL,h=Bu;return s.openBlock(),s.createElementBlock("div",PK,[r.title?(s.openBlock(),s.createBlock(c,{key:0},{default:s.withCtx(()=>[s.createVNode(o,{span:12},{default:s.withCtx(()=>[s.createElementVNode("div",AK,s.toDisplayString(r.title),1)]),_:1}),r.enableFilter?(s.openBlock(),s.createBlock(o,{key:0,span:12},{default:s.withCtx(()=>[s.createElementVNode("div",null,[s.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})):s.createCommentVNode("",!0)]),_:1})):s.createCommentVNode("",!0),s.createElementVNode("div",RK,[s.createElementVNode("div",{class:s.normalizeClass(["tree-tooltip",t.tooltipAtBottom?"bottom":""])},[s.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:s.withCtx(()=>[s.createElementVNode("div",LK,s.toDisplayString(t.tooltipLabel),1)]),_:1},8,["visible"])],2),s.withDirectives((s.openBlock(),s.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:s.normalizeClass([r.mapType==="flatmap"?"hide_grandchildren_checkbox":""])},{default:s.withCtx(({node:v,data:p})=>[r.mapType==="flatmap"?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["region-tree-node",{activeItem:i.nodeIsActive(p),hoverItem:i.nodeIsHover(p)}]),onClick:g=>i.changeActiveByNode(p),onMouseover:g=>i.changeHoverByNode(p,!1),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[1]||(e[1]=g=>i.displayTooltip("",!1,g))},[s.createElementVNode("div",{style:s.normalizeStyle(i.getBackgroundStyles(p)),class:"lastChildInItem"},s.toDisplayString(v.label),5)],42,MK)):r.mapType==="scaffold"?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(["region-tree-node",{activeItem:r.active.includes(p.id),hoverItem:r.hover.includes(p.id)}]),onClick:g=>i.changeActiveByNode(p,!0),onMouseover:g=>i.changeHoverByNode(p,!0,g),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[2]||(e[2]=g=>i.displayTooltip("",!1,g))},[p.isPrimitives?(s.openBlock(),s.createBlock(d,{key:0,class:s.normalizeClass({"show-picker":r.showColourPicker}),modelValue:p.activeColour,"onUpdate:modelValue":g=>p.activeColour=g,size:"small",onChange:g=>i.setColour(p,g)},null,8,["class","modelValue","onUpdate:modelValue","onChange"])):s.createCommentVNode("",!0),s.createElementVNode("div",$K,[s.createElementVNode("span",null,s.toDisplayString(v.label),1),p.isTextureSlides?(s.openBlock(),s.createElementBlock("span",VK," (Texture) ")):s.createCommentVNode("",!0)])],42,FK)):s.createCommentVNode("",!0)]),_:1},8,["node-key","data","default-expanded-keys","onCheck","filter-node-method","class"])),[[h,!r.isReady]])],512)])}const zK=Yt(OK,[["render",qK],["__scopeId","data-v-e1dbd1e9"]]);async function HK(t,e){try{const r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok)throw new Error(`API Error: ${r.status} ${r.statusText}`);return await r.json()}catch(r){throw console.error("Request failed:",r),r}}async function rn(t){const{flatmapAPI:e,knowledgeSource:r,queryId:n,parameters:a,orderId:i}=t,o=`${e}competency/query`,l=Array.isArray(a)?[...a]:[];l.push({column:"source_id",value:r});let c;if(typeof n=="number")c=n.toString();else if(typeof n=="string")c=n;else throw new TypeError("queryId must be a string or a number convertible to string.");const u={query_id:c,parameters:l};return i&&(u.order=[i]),HK(o,u)}async function KK(t,e,r){const n=Array.isArray(r)?r:[r],a=n.filter(h=>h.startsWith("ilxtr:")),i=n.filter(h=>!h.startsWith("ilxtr:")),o=[];a.length>0&&o.push(rn({flatmapAPI:t,knowledgeSource:e,queryId:23,parameters:[{column:"path_id",value:a}]})),i.length>0&&o.push(rn({flatmapAPI:t,knowledgeSource:e,queryId:1,parameters:[{column:"feature_id",value:i}]}));const l=await Promise.all(o);let c=[...a];l.forEach(h=>{var p,g;const v=((g=(p=h==null?void 0:h.results)==null?void 0:p.values)==null?void 0:g.map(m=>m[1]))||[];c.push(...v)});const u=[...new Set(c)];let d=[];return u.length&&(d=await Cg(t,e,u)),[...new Set([...u,...d])]}async function GK(t,e,r){var a;const n=await rn({flatmapAPI:t,knowledgeSource:e,queryId:1,parameters:[{column:"feature_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>o[1]);return[...new Set(i)]}return[]}async function UK(t,e,r){var a;const n=await rn({flatmapAPI:t,knowledgeSource:e,queryId:1,parameters:[{column:"feature_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>o[1]);return[...new Set(i)]}return[]}async function jK(t,e,r){var a;const n=await rn({flatmapAPI:t,knowledgeSource:e,queryId:2,parameters:[{column:"feature_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>o[1]);return[...new Set(i)]}return[]}function wg(t){const e=[];for(const r of t){const n=JSON.parse(r);Array.isArray(n)&&n.length>=2&&Array.isArray(n[1])&&n[1].length===0&&e.push(n[0])}return e}async function Cg(t,e,r){var a;const n=await rn({flatmapAPI:t,knowledgeSource:e,queryId:26,parameters:[{column:"path_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>o[2]);return[...new Set(i)]}return[]}async function WK({flatmapAPI:t,knowledgeSource:e,origins:r,destinations:n,vias:a}){var w,C,x,k;const i=wg(r),o=wg(n),l=wg(a),c=[{column:"source_feature_id",value:i},{column:"via_feature_id",value:l},{column:"dest_feature_id",value:o}],u=[{column:"source_node_id",value:r},{column:"via_node_id",value:a},{column:"dest_node_id",value:n}],d=c.some(E=>Array.isArray(E.value)&&E.value.length>0),f=[rn({flatmapAPI:t,knowledgeSource:e,queryId:24,parameters:u})];d&&f.push(rn({flatmapAPI:t,knowledgeSource:e,queryId:25,parameters:c}));const h=await Promise.all(f);let v=[],p;if(d){const E=h[0];p=h[1],v=((C=(w=E==null?void 0:E.results)==null?void 0:w.values)==null?void 0:C.map(_=>_[1]))||[]}else p=h[0];const g=((k=(x=p==null?void 0:p.results)==null?void 0:x.values)==null?void 0:k.map(E=>E[1]))||[],m=[...new Set([...v,...g])];let y=[];return m.length&&(y=await Cg(t,e,m)),[...new Set([...m,...y])]}const Eg=[];async function YK(t,e){const r=e.filter(i=>Eg.some(o=>o.taxon===i)),n=Eg.filter(i=>r.includes(i.taxon)),a=e.filter(i=>!r.includes(i));if(a.length){const i=await t.queryLabels(a);if(i.length)return i.forEach(o=>{let{entity:l,label:c}=o;c==="Mammalia"&&(c="Mammalia not otherwise specified");const u={taxon:l,label:c};n.push(u),Eg.push(u)}),n}else return n}async function ZK(t,e,r){const n=`${t}knowledge/query/`,a={sql:e,params:r};try{const i=await fetch(n,{method:"POST",headers:{Accept:"application/json; charset=utf-8","Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok)throw new Error(`Cannot access ${n}`);return await i.json()}catch{return{values:[]}}}async function k_(t,e){return e.length?await(await ZK(t,`select entity, knowledge from knowledge
468
+ `+a}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=`${this.crosscite_host}/format?doi=${t}&style=${this.citationType}&lang=en-US`;return await this.fetchData(e,"text")},getDOIFromPubMedID:async function(t){const e=`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=${t}&format=json`;return await this.fetchData(e)},formatOpenLibReferences:function(){this.openLibReferences.forEach(t=>{const{bookId:e}=t;this.getBookData(e).then(r=>{const{title:n,authors:a,publish_date:i}=r;n&&(t.title=n),i&&(t.date=i),a&&(t.authors=[],a.forEach(o=>{this.getBookAuthor(o.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){throw new Error(r)}},onCopied:function(t,e){let r="Reference List",n="",a=this.citationType;e?(r=e.resource,n=e.type==="doi"?e.id:""):r=[...this.pubMedReferences,...this.openLibReferences,...this.isbnDBReferences].map(c=>c.type==="doi"?c.id:c.resource).join(", ");const i={event:"interaction_event",event_name:"portal_maps_copy_citation",category:r,doi:n,citation_type:a,location:"map_connectivity_references"};this.$emit("trackEvent",i)}}},va=t=>(s.pushScopeId("data-v-e4259096"),t=t(),s.popScopeId(),t),aK={class:"resource-container"},iK={class:"attribute-title-container"},oK=va(()=>s.createElementVNode("div",{class:"attribute-title"},"References",-1)),sK={class:"copy-button"},lK={key:0,class:"citation-tabs"},uK={class:"citation-list"},cK=va(()=>s.createElementVNode("span",null,"Internal Server Error",-1)),dK=va(()=>s.createElementVNode("br",null,null,-1)),fK=va(()=>s.createElementVNode("br",null,null,-1)),hK=["href"],pK=va(()=>s.createElementVNode("br",null,null,-1)),vK=va(()=>s.createElementVNode("span",null,"Sorry, something went wrong.",-1)),gK=va(()=>s.createElementVNode("br",null,null,-1)),mK=["onClick"],yK=["innerHTML"],bK=["innerHTML"],wK=["href"];function CK(t,e,r,n,a,i){const o=cs,l=Ht,c=I_;return s.openBlock(),s.createElementBlock("div",aK,[s.createElementVNode("div",iK,[oK,s.createElementVNode("div",sK,[s.createVNode(o,{onCopied:e[0]||(e[0]=u=>i.onCopied(u,"")),label:"Copy list to clipboard",content:t.referecesListContent},null,8,["content"])])]),i.referencesWithDOI?(s.openBlock(),s.createElementBlock("div",lK,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.citationOptions,u=>(s.openBlock(),s.createBlock(l,{link:"",key:u.value,type:t.citationType===u.value?"primary":"",onClick:d=>i.onCitationFormatChange(u.value)},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(u.label),1)]),_:2},1032,["type","onClick"]))),128))])):s.createCommentVNode("",!0),s.createElementVNode("ul",uK,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.pubMedReferences,u=>{var d,f,h,v;return s.openBlock(),s.createElementBlock("li",{key:u.id,class:s.normalizeClass({loading:i.isCitationLoading(u.citation),error:i.isCitationError(u.citation)})},[u.citation?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[((d=u.citation.error)==null?void 0:d.ref)==="doi"&&((f=u.citation.error)==null?void 0:f.type)===t.citationType?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[cK,dK,s.createTextVNode(" Sorry, something went wrong."),fK,s.createTextVNode(" The dataset citation generator ("),s.createElementVNode("a",{href:t.crosscite_host,target:"_blank"},s.toDisplayString(t.crosscite_host),9,hK),s.createTextVNode(") encountered an internal error and was unable to complete your request."),pK,s.createTextVNode(" Please come back later. ")],64)):((h=u.citation.error)==null?void 0:h.ref)==="pubmed"&&((v=u.citation.error)==null?void 0:v.type)===t.citationType?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[vK,gK,s.createTextVNode(" Please try again. "),s.createElementVNode("span",{class:"reload-button",onClick:p=>i.reloadCitation(u)},"Reload",8,mK)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[s.createElementVNode("span",{innerHTML:u.citation[t.citationType]},null,8,yK),s.createVNode(c,{resource:u.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{onCopied:p=>i.onCopied(p,u),content:u.citation[t.citationType]},null,8,["onCopied","content"])],64))],64)):s.createCommentVNode("",!0)],2)}),128)),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.openLibReferences,u=>(s.openBlock(),s.createElementBlock("li",{key:u.id},[s.createElementVNode("div",{innerHTML:i.formatCopyReference(u)},null,8,bK),s.createVNode(c,{resource:u.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{onCopied:d=>i.onCopied(d,u),content:i.formatCopyReference(u)},null,8,["onCopied","content"])]))),128)),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.isbnDBReferences,u=>(s.openBlock(),s.createElementBlock("li",{key:u.id},[s.createElementVNode("a",{href:u.url,target:"_blank"},s.toDisplayString(u.url),9,wK),s.createVNode(c,{resource:u.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{onCopied:d=>i.onCopied(d,u),content:u.url},null,8,["onCopied","content"])]))),128))])])}const Cg=Yt(nK,[["render",CK],["__scopeId","data-v-e4259096"]]);function EK(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 B_=new EK,xK={name:"ProvenancePopup",components:{ElIconArrowUp:Ne.ArrowUp,ElIconArrowDown:Ne.ArrowDown,ElIconWarning:Ne.Warning,ConnectivityList:vg,ExternalResourceCard:Cg},props:{tooltipEntry:{type:Array,default:[]}},data:function(){return{loading:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},entryIndex:0,availableAnatomyFacets:[],connectivityError:{}}},computed:{entry:function(){return this.tooltipEntry[this.entryIndex]},previousLabel:function(){var t;return this.entryIndex===0?"This is the first item. Click 'Next' to see more information.":(t=this.tooltipEntry[this.entryIndex-1])==null?void 0:t.title},nextLabel:function(){var t;return this.entryIndex===this.tooltipEntry.length-1?"This is the last item. Click 'Previous' to see more information.":(t=this.tooltipEntry[this.entryIndex+1])==null?void 0:t.title},provSpeciesDescription:function(){let t="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(e=>{t+=` ${e},`}),t=t.slice(0,-1),t+=" species",t},origins:function(){return this.entry.origins},components:function(){return this.entry.components},destinations:function(){return this.entry.destinations},originsWithDatasets:function(){return this.entry.originsWithDatasets},componentsWithDatasets:function(){return this.entry.componentsWithDatasets},destinationsWithDatasets:function(){return this.entry.destinationsWithDatasets},resources:function(){return this.entry.hyperlinks||[]}},watch:{tooltipEntry:{deep:!0,immediate:!0,handler:function(t,e){t!==e&&(this.entryIndex=0)}}},mounted:function(){this.loadAvailableAnatomyFacets()},methods:{previous:function(){this.entryIndex!==0&&(this.entryIndex=this.entryIndex-1)},next:function(){this.entryIndex!==this.tooltipEntry.length-1&&(this.entryIndex=this.entryIndex+1)},titleCase:function(t){return Z9(t)},capitalise:function(t){return U2(t)},onConnectivityActionClick:function(t){B_.emit("onActionClick",t)},loadAvailableAnatomyFacets:function(){const t=localStorage.getItem("available-anatomy-facets");t&&(this.availableAnatomyFacets=JSON.parse(t))}}},kK=t=>(s.pushScopeId("data-v-dc8d1ad3"),t=t(),s.popScopeId(),t),SK={key:0,class:"main"},_K={key:0,class:"toggle-button"},TK={key:1,class:"block"},NK={class:"title"},IK={key:0,class:"subtitle"},BK={key:2,class:"block"},DK={class:"title"},PK={key:3,class:"attribute-title-container"},OK=kK(()=>s.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),AK={style:{"word-break":"keep-all"}},RK={class:"content-container scrollbar"};function LK(t,e,r,n,a,i){const o=Ht,l=Ra,c=Ne.Warning,u=it,d=Ne.ArrowUp,f=Ne.ArrowDown,h=vg,v=Cg,p=Pu;return i.entry?s.withDirectives((s.openBlock(),s.createElementBlock("div",SK,[r.tooltipEntry.length>1?(s.openBlock(),s.createElementBlock("div",_K,[s.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:s.withCtx(()=>[s.createVNode(o,{class:"button",onClick:i.previous,disabled:this.entryIndex===0},{default:s.withCtx(()=>[s.createTextVNode(" Previous ")]),_:1},8,["onClick","disabled"])]),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(i.previousLabel),1)]),_:1}),s.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:s.withCtx(()=>[s.createVNode(o,{class:"button",onClick:i.next,disabled:this.entryIndex===this.tooltipEntry.length-1},{default:s.withCtx(()=>[s.createTextVNode(" Next ")]),_:1},8,["onClick","disabled"])]),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(i.nextLabel),1)]),_:1})])):s.createCommentVNode("",!0),i.entry.title?(s.openBlock(),s.createElementBlock("div",TK,[s.createElementVNode("div",NK,s.toDisplayString(i.capitalise(i.entry.title)),1),i.entry.provenanceTaxonomyLabel&&i.entry.provenanceTaxonomyLabel.length>0?(s.openBlock(),s.createElementBlock("div",IK,s.toDisplayString(i.provSpeciesDescription),1)):s.createCommentVNode("",!0)])):(s.openBlock(),s.createElementBlock("div",BK,[s.createElementVNode("div",DK,s.toDisplayString(i.entry.featureId),1)])),i.entry.featuresAlert?(s.openBlock(),s.createElementBlock("div",PK,[OK,s.createVNode(l,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(u,{class:"info"},{default:s.withCtx(()=>[s.createVNode(c)]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("span",AK,s.toDisplayString(i.entry.featuresAlert),1)]),_:1})])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",{class:"hide",id:"hide-path-info",onClick:e[0]||(e[0]=g=>t.showDetails=!1)},[s.createTextVNode(" Hide path information "),s.createVNode(u,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})],512),[[s.vShow,t.showDetails]]),s.withDirectives(s.createElementVNode("div",{class:"hide",id:"show-path-info",onClick:e[1]||(e[1]=g=>t.showDetails=!0)},[s.createTextVNode(" Show path information "),s.createVNode(u,null,{default:s.withCtx(()=>[s.createVNode(f)]),_:1})],512),[[s.vShow,!t.showDetails]]),s.createVNode(s.Transition,{name:"slide-fade"},{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",RK,[(s.openBlock(),s.createBlock(h,{key:i.entry.featureId[0],entry:i.entry,origins:i.origins,components:i.components,destinations:i.destinations,originsWithDatasets:i.originsWithDatasets,componentsWithDatasets:i.componentsWithDatasets,destinationsWithDatasets:i.destinationsWithDatasets,availableAnatomyFacets:t.availableAnatomyFacets,connectivityError:t.connectivityError,onConnectivityActionClick:i.onConnectivityActionClick},null,8,["entry","origins","components","destinations","originsWithDatasets","componentsWithDatasets","destinationsWithDatasets","availableAnatomyFacets","connectivityError","onConnectivityActionClick"])),i.resources.length?(s.openBlock(),s.createBlock(v,{key:0,resources:i.resources},null,8,["resources"])):s.createCommentVNode("",!0)],512),[[s.vShow,t.showDetails]])]),_:1})])),[[p,t.loading]]):s.createCommentVNode("",!0)}const FK=Yt(xK,[["render",LK],["__scopeId","data-v-dc8d1ad3"]]),MK={name:"Tooltip",props:{tooltipEntry:{type:Array},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Array}},mounted:function(){B_.on("onActionClick",t=>{this.$emit("onActionClick",t)})}},$K={class:"tooltip-container",id:"tooltip-container"};function VK(t,e,r,n,a,i){const o=x0,l=FK;return s.openBlock(),s.createElementBlock("div",$K,[r.annotationDisplay?(s.openBlock(),s.createBlock(o,{key:0,annotationEntry:r.annotationEntry,onAnnotation:e[0]||(e[0]=c=>t.$emit("annotation",c))},null,8,["annotationEntry"])):(s.openBlock(),s.createBlock(l,{key:1,tooltipEntry:r.tooltipEntry},null,8,["tooltipEntry"]))])}const qK=Yt(MK,[["render",VK],["__scopeId","data-v-d1e37cc2"]]),zK={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:"",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:{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,o=a.getBoundingClientRect().x,l=a.querySelector(".lastChildInItem");let c=0;if(l){const d=l.getBoundingClientRect();c=d.x+d.width-o}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)}},HK={class:"selections-container"},KK={class:"title-text"},GK={class:"tree-container",ref:"treeContainer"},UK={class:"tooltip-text"},jK=["onClick","onMouseover","onMouseenter"],WK=["onClick","onMouseover","onMouseenter"],YK={class:"lastChildInItem"},ZK={key:0,class:"node-options"};function XK(t,e,r,n,a,i){const o=Fi,l=Ai,c=is,u=Ra,d=HR,f=UL,h=Pu;return s.openBlock(),s.createElementBlock("div",HK,[r.title?(s.openBlock(),s.createBlock(c,{key:0},{default:s.withCtx(()=>[s.createVNode(o,{span:12},{default:s.withCtx(()=>[s.createElementVNode("div",KK,s.toDisplayString(r.title),1)]),_:1}),r.enableFilter?(s.openBlock(),s.createBlock(o,{key:0,span:12},{default:s.withCtx(()=>[s.createElementVNode("div",null,[s.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})):s.createCommentVNode("",!0)]),_:1})):s.createCommentVNode("",!0),s.createElementVNode("div",GK,[s.createElementVNode("div",{class:s.normalizeClass(["tree-tooltip",t.tooltipAtBottom?"bottom":""])},[s.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:s.withCtx(()=>[s.createElementVNode("div",UK,s.toDisplayString(t.tooltipLabel),1)]),_:1},8,["visible"])],2),s.withDirectives((s.openBlock(),s.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:s.normalizeClass([r.mapType==="flatmap"?"hide_grandchildren_checkbox":""])},{default:s.withCtx(({node:v,data:p})=>[r.mapType==="flatmap"?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["region-tree-node",{activeItem:i.nodeIsActive(p),hoverItem:i.nodeIsHover(p)}]),onClick:g=>i.changeActiveByNode(p),onMouseover:g=>i.changeHoverByNode(p,!1),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[1]||(e[1]=g=>i.displayTooltip("",!1,g))},[s.createElementVNode("div",{style:s.normalizeStyle(i.getBackgroundStyles(p)),class:"lastChildInItem"},s.toDisplayString(v.label),5)],42,jK)):r.mapType==="scaffold"?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(["region-tree-node",{activeItem:r.active.includes(p.id),hoverItem:r.hover.includes(p.id)}]),onClick:g=>i.changeActiveByNode(p,!0),onMouseover:g=>i.changeHoverByNode(p,!0,g),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[2]||(e[2]=g=>i.displayTooltip("",!1,g))},[p.isPrimitives?(s.openBlock(),s.createBlock(d,{key:0,class:s.normalizeClass({"show-picker":r.showColourPicker}),modelValue:p.activeColour,"onUpdate:modelValue":g=>p.activeColour=g,size:"small",onChange:g=>i.setColour(p,g)},null,8,["class","modelValue","onUpdate:modelValue","onChange"])):s.createCommentVNode("",!0),s.createElementVNode("div",YK,[s.createElementVNode("span",null,s.toDisplayString(v.label),1),p.isTextureSlides?(s.openBlock(),s.createElementBlock("span",ZK," (Texture) ")):s.createCommentVNode("",!0)])],42,WK)):s.createCommentVNode("",!0)]),_:1},8,["node-key","data","default-expanded-keys","onCheck","filter-node-method","class"])),[[h,!r.isReady]])],512)])}const JK=Yt(zK,[["render",XK],["__scopeId","data-v-e1dbd1e9"]]);async function QK(t,e){try{const r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok)throw new Error(`API Error: ${r.status} ${r.statusText}`);return await r.json()}catch(r){throw console.error("Request failed:",r),r}}async function nn(t){const{flatmapAPI:e,knowledgeSource:r,queryId:n,parameters:a,orderId:i}=t,o=`${e}competency/query`,l=Array.isArray(a)?[...a]:[];l.push({column:"source_id",value:r});let c;if(typeof n=="number")c=n.toString();else if(typeof n=="string")c=n;else throw new TypeError("queryId must be a string or a number convertible to string.");const u={query_id:c,parameters:l};return i&&(u.order=[i]),QK(o,u)}async function eG(t,e,r){const n=Array.isArray(r)?r:[r],a=n.filter(h=>h.startsWith("ilxtr:")),i=n.filter(h=>!h.startsWith("ilxtr:")),o=[];a.length>0&&o.push(nn({flatmapAPI:t,knowledgeSource:e,queryId:23,parameters:[{column:"path_id",value:a}]})),i.length>0&&o.push(nn({flatmapAPI:t,knowledgeSource:e,queryId:1,parameters:[{column:"feature_id",value:i}]}));const l=await Promise.all(o);let c=[...a];l.forEach(h=>{var p,g;const v=((g=(p=h==null?void 0:h.results)==null?void 0:p.values)==null?void 0:g.map(y=>y[1]))||[];c.push(...v)});const u=[...new Set(c)];let d=[];return u.length&&(d=await xg(t,e,u)),[...new Set([...u,...d])]}async function tG(t,e,r){var a;const n=await nn({flatmapAPI:t,knowledgeSource:e,queryId:1,parameters:[{column:"feature_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>o[1]);return[...new Set(i)]}return[]}async function rG(t,e,r){var a;const n=await nn({flatmapAPI:t,knowledgeSource:e,queryId:1,parameters:[{column:"feature_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>o[1]);return[...new Set(i)]}return[]}async function nG(t,e,r){var a;const n=await nn({flatmapAPI:t,knowledgeSource:e,queryId:2,parameters:[{column:"feature_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>o[1]);return[...new Set(i)]}return[]}function Eg(t){const e=[];for(const r of t){const n=JSON.parse(r);Array.isArray(n)&&n.length>=2&&Array.isArray(n[1])&&n[1].length===0&&e.push(n[0])}return e}async function xg(t,e,r){var a;const n=await nn({flatmapAPI:t,knowledgeSource:e,queryId:26,parameters:[{column:"path_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>o[2]);return[...new Set(i)]}return[]}async function aG({flatmapAPI:t,knowledgeSource:e,origins:r,destinations:n,vias:a}){var w,C,x,k;const i=Eg(r),o=Eg(n),l=Eg(a),c=[{column:"source_feature_id",value:i},{column:"via_feature_id",value:l},{column:"dest_feature_id",value:o}],u=[{column:"source_node_id",value:r},{column:"via_node_id",value:a},{column:"dest_node_id",value:n}],d=c.some(E=>Array.isArray(E.value)&&E.value.length>0),f=[nn({flatmapAPI:t,knowledgeSource:e,queryId:24,parameters:u})];d&&f.push(nn({flatmapAPI:t,knowledgeSource:e,queryId:25,parameters:c}));const h=await Promise.all(f);let v=[],p;if(d){const E=h[0];p=h[1],v=((C=(w=E==null?void 0:E.results)==null?void 0:w.values)==null?void 0:C.map(_=>_[1]))||[]}else p=h[0];const g=((k=(x=p==null?void 0:p.results)==null?void 0:x.values)==null?void 0:k.map(E=>E[1]))||[],y=[...new Set([...v,...g])];let m=[];return y.length&&(m=await xg(t,e,y)),[...new Set([...y,...m])]}const kg=[];async function iG(t,e){const r=e.filter(i=>kg.some(o=>o.taxon===i)),n=kg.filter(i=>r.includes(i.taxon)),a=e.filter(i=>!r.includes(i));if(a.length){const i=await t.queryLabels(a);if(i.length)return i.forEach(o=>{let{entity:l,label:c}=o;c==="Mammalia"&&(c="Mammalia not otherwise specified");const u={taxon:l,label:c};n.push(u),kg.push(u)}),n}else return n}async function oG(t,e,r){const n=`${t}knowledge/query/`,a={sql:e,params:r};try{const i=await fetch(n,{method:"POST",headers:{Accept:"application/json; charset=utf-8","Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok)throw new Error(`Cannot access ${n}`);return await i.json()}catch{return{values:[]}}}async function D_(t,e){return e.length?await(await oG(t,`select entity, knowledge from knowledge
469
469
  where entity in (?${", ?".repeat(e.length-1)})
470
- order by source desc`,[...e])).values:[]}function XK(t){var r;const e=(r=t["node-phenotypes"])==null?void 0:r["ilxtr:hasSomaLocatedIn"];return Array.isArray(t.connectivity)&&t.connectivity.length>0&&Array.isArray(e)&&e.length>0}function JK(t){var a,i;const e=(a=t["node-phenotypes"])==null?void 0:a["ilxtr:hasAxonPresynapticElementIn"],r=(i=t["node-phenotypes"])==null?void 0:i["ilxtr:hasAxonSensorySubcellularElementIn"],n=Array.isArray(e)&&e.length>0||Array.isArray(r)&&r.length>0;return Array.isArray(t.connectivity)&&t.connectivity.length>0&&n}function QK(t){var n,a,i;if(!Array.isArray(t.connectivity)||t.connectivity.length===0)return!1;const e=new Set((((n=t["node-phenotypes"])==null?void 0:n["ilxtr:hasSomaLocatedIn"])||[]).map(o=>o[0])),r=new Set([...(((a=t["node-phenotypes"])==null?void 0:a["ilxtr:hasAxonPresynapticElementIn"])||[]).map(o=>o[0]),...(((i=t["node-phenotypes"])==null?void 0:i["ilxtr:hasAxonSensorySubcellularElementIn"])||[]).map(o=>o[0])]);return t.connectivity.some(o=>{const[l,c]=o,u=l[0],d=c[0];return!e.has(u)&&!r.has(d)})}function xg(t){if(!Array.isArray(t.connectivity))return[];const e=new Set;return t.connectivity.forEach(r=>{Array.isArray(r)&&r.length&&r.forEach(n=>{if(Array.isArray(n)&&typeof n[0]=="string"){const a=JSON.stringify(n);e.add(a)}})}),Array.from(e)}function Lr(t,e){var n;const r=(n=t["node-phenotypes"])==null?void 0:n[e];return Array.isArray(r)?r:[]}async function kg(t,e,r){const n=Array.from(new Map(r.map(f=>[JSON.stringify(f),f])).values()),a=n.flat(1/0),i=[...new Set(a)],l=(await k_(t,i)).reduce((f,h)=>{const v=h[0],p=JSON.parse(h[1]);return f.push({id:v,label:p.label,source:p.source}),f},[]);l.sort((f,h)=>f.id===h.id?f.source===e&&h.source!==e?-1:f.source!==e&&h.source===e?1:0:f.id.localeCompare(h.id));const c=[];return[...n.map(f=>{const h=f.flat(),v=[];for(let p=0;p<h.length;p++){const g=l.find(m=>m.id===h[p]);g&&(v.push(g.label),p>0&&c.push({key:[h[p],[]],label:g.label}))}return{key:f,label:v.join(", ")}}),...c].filter((f,h,v)=>h===v.findIndex(p=>p.label===f.label))}async function S_(t,e,r){const n=[];return r.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(xg(a));Lr(a,"ilxtr:hasSomaLocatedIn").forEach(o=>{const l=JSON.stringify(o);i.has(l)&&n.push(o)})}),await kg(t,e,n)}async function __(t,e,r){const n=[];return r.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(xg(a));[...Lr(a,"ilxtr:hasAxonPresynapticElementIn"),...Lr(a,"ilxtr:hasAxonSensorySubcellularElementIn")].forEach(o=>{const l=JSON.stringify(o);i.has(l)&&n.push(o)})}),await kg(t,e,n)}async function T_(t,e,r){const n=[];return r.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(xg(a));[...Lr(a,"ilxtr:hasAxonLeadingToSensorySubcellularElementIn"),...Lr(a,"ilxtr:hasAxonLocatedIn")].forEach(o=>{const l=JSON.stringify(o);i.has(l)&&n.push(o)})}),await kg(t,e,n)}function N_(t,e){return t.filter(r=>!Array.isArray(r.connectivity)||r.connectivity.length===0?!1:Lr(r,"ilxtr:hasSomaLocatedIn").some(a=>e.map(i=>JSON.stringify(i)).includes(JSON.stringify(a))))}function I_(t,e){return t.filter(r=>!Array.isArray(r.connectivity)||r.connectivity.length===0?!1:[...Lr(r,"ilxtr:hasAxonPresynapticElementIn"),...Lr(r,"ilxtr:hasAxonSensorySubcellularElementIn")].some(a=>e.map(i=>JSON.stringify(i)).includes(JSON.stringify(a))))}function B_(t,e){return t.filter(r=>!Array.isArray(r.connectivity)||r.connectivity.length===0?!1:[...Lr(r,"ilxtr:hasAxonLeadingToSensorySubcellularElementIn"),...Lr(r,"ilxtr:hasAxonLocatedIn")].some(a=>e.map(i=>JSON.stringify(i)).includes(JSON.stringify(a))))}async function eG({knowledge:t,origins:e,destinations:r,vias:n}){let a=t;return e.length&&(a=N_(a,e)),r.length&&(a=I_(a,r)),n.length&&(a=B_(a,n)),a}async function tG(t,e,r,n){let a=[];const i=[];if(e){if(e&&typeof e.featureFilterRanges=="function"){const v=e.featureFilterRanges();for(const[p,g]of Object.entries(v)){let m={key:`flatmap.connectivity.${p}`,label:"",children:[]},y=[];if(p==="kind"){m.label="Pathways";for(const b of g){const w=n.find(C=>C.type===b);w&&y.push({key:`${m.key}.${b}`,label:w.label,colour:w.colour,colourStyle:"line",dashed:w.dashed})}}else if(p==="taxons"){m.label="Studied in";const b=await YK(e,e.taxonIdentifiers);if(b.length)for(const w of g){const C=b.find(x=>x.taxon===w);C&&y.push({key:`${m.key}.${w}`,label:`${C.label} `})}}else if(p==="alert"){m.label="Alert";for(const b of["with","without"])y.push({key:`${m.key}.${b}`,label:`${b} alerts`})}m.children=y.sort((b,w)=>b.label.localeCompare(w.label)),m.label&&m.children.length&&a.push(m)}}const o=e.pathways.paths,l=[];for(const v of r){const p=v.id;if(p){const g=o[p];if(g&&g.connectivity&&g["node-phenotypes"]){const m=g.connectivity,y=g["node-phenotypes"],b={};for(let w in v["node-phenotypes"])y[w]&&(b[w]=[...y[w]]);l.push({...v,connectivity:[...m],"node-phenotypes":b})}}}const c=e.knowledgeSource,u=await S_(t,c,l),d=await T_(t,c,l),f=await __(t,c,l),h=(v,p)=>{const g=JSON.stringify(p.key);return{key:`flatmap.connectivity.source.${v}.${g}`,label:p.label||g}};for(const v of["origin","via","destination","all"]){let p=[];if(v==="origin")p=u.map(g=>h(v,g));else if(v==="via")p=d.map(g=>h(v,g));else if(v==="destination")p=f.map(g=>h(v,g));else{const g=[...u.map(y=>h(v,y)),...d.map(y=>h(v,y)),...f.map(y=>h(v,y))],m=new Set;p=g.filter(y=>m.has(y.key)?!1:(m.add(y.key),!0))}p=p.sort((g,m)=>{const y=C=>/^[a-zA-Z]/.test(C),b=y(g.label),w=y(m.label);return b&&!w?-1:!b&&w?1:g.label.localeCompare(m.label)}),p.length&&i.push({key:`flatmap.connectivity.source.${v}`,label:v,children:p})}i.length&&a.push(...i)}return a}Te.AnnotationPopup=g0,Te.ConnectivityGraph=$6,Te.ConnectivityList=hg,Te.CopyToClipboard=us,Te.CreateTooltipContent=gM,Te.DrawToolbar=AH,Te.ExternalResourceCard=bg,Te.HelpModeDialog=VH,Te.Tooltip=DK,Te.TreeControls=zK,Te.competencyQuery=rn,Te.extractDestinationItems=__,Te.extractOriginItems=S_,Te.extractViaItems=T_,Te.fetchLabels=k_,Te.filterDestinations=JK,Te.filterOrigins=XK,Te.filterViaLocations=QK,Te.findPathsByDestinationItem=I_,Te.findPathsByOriginItem=N_,Te.findPathsByViaItem=B_,Te.getFlatmapFilterOptions=tG,Te.queryAllConnectedPaths=KK,Te.queryForwardBackwardConnections=Cg,Te.queryPathsByDestination=jK,Te.queryPathsByOrigin=GK,Te.queryPathsByRoute=WK,Te.queryPathsByRouteFromKnowledge=eG,Te.queryPathsByViaLocation=UK,Object.defineProperty(Te,Symbol.toStringTag,{value:"Module"})});
470
+ order by source desc`,[...e])).values:[]}function sG(t){var r;const e=(r=t["node-phenotypes"])==null?void 0:r["ilxtr:hasSomaLocatedIn"];return Array.isArray(t.connectivity)&&t.connectivity.length>0&&Array.isArray(e)&&e.length>0}function lG(t){var a,i;const e=(a=t["node-phenotypes"])==null?void 0:a["ilxtr:hasAxonPresynapticElementIn"],r=(i=t["node-phenotypes"])==null?void 0:i["ilxtr:hasAxonSensorySubcellularElementIn"],n=Array.isArray(e)&&e.length>0||Array.isArray(r)&&r.length>0;return Array.isArray(t.connectivity)&&t.connectivity.length>0&&n}function uG(t){var n,a,i;if(!Array.isArray(t.connectivity)||t.connectivity.length===0)return!1;const e=new Set((((n=t["node-phenotypes"])==null?void 0:n["ilxtr:hasSomaLocatedIn"])||[]).map(o=>o[0])),r=new Set([...(((a=t["node-phenotypes"])==null?void 0:a["ilxtr:hasAxonPresynapticElementIn"])||[]).map(o=>o[0]),...(((i=t["node-phenotypes"])==null?void 0:i["ilxtr:hasAxonSensorySubcellularElementIn"])||[]).map(o=>o[0])]);return t.connectivity.some(o=>{const[l,c]=o,u=l[0],d=c[0];return!e.has(u)&&!r.has(d)})}function Sg(t){if(!Array.isArray(t.connectivity))return[];const e=new Set;return t.connectivity.forEach(r=>{Array.isArray(r)&&r.length&&r.forEach(n=>{if(Array.isArray(n)&&typeof n[0]=="string"){const a=JSON.stringify(n);e.add(a)}})}),Array.from(e)}function Lr(t,e){var n;const r=(n=t["node-phenotypes"])==null?void 0:n[e];return Array.isArray(r)?r:[]}async function _g(t,e,r){const n=Array.from(new Map(r.map(f=>[JSON.stringify(f),f])).values()),a=n.flat(1/0),i=[...new Set(a)],l=(await D_(t,i)).reduce((f,h)=>{const v=h[0],p=JSON.parse(h[1]);return f.push({id:v,label:p.label,source:p.source}),f},[]);l.sort((f,h)=>f.id===h.id?f.source===e&&h.source!==e?-1:f.source!==e&&h.source===e?1:0:f.id.localeCompare(h.id));const c=[];return[...n.map(f=>{const h=f.flat(),v=[];for(let p=0;p<h.length;p++){const g=l.find(y=>y.id===h[p]);g&&(v.push(g.label),p>0&&c.push({key:[h[p],[]],label:g.label}))}return{key:f,label:v.join(", ")}}),...c].filter((f,h,v)=>h===v.findIndex(p=>p.label===f.label))}async function P_(t,e,r){const n=[];return r.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(Sg(a));Lr(a,"ilxtr:hasSomaLocatedIn").forEach(o=>{const l=JSON.stringify(o);i.has(l)&&n.push(o)})}),await _g(t,e,n)}async function O_(t,e,r){const n=[];return r.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(Sg(a));[...Lr(a,"ilxtr:hasAxonPresynapticElementIn"),...Lr(a,"ilxtr:hasAxonSensorySubcellularElementIn")].forEach(o=>{const l=JSON.stringify(o);i.has(l)&&n.push(o)})}),await _g(t,e,n)}async function A_(t,e,r){const n=[];return r.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(Sg(a));[...Lr(a,"ilxtr:hasAxonLeadingToSensorySubcellularElementIn"),...Lr(a,"ilxtr:hasAxonLocatedIn")].forEach(o=>{const l=JSON.stringify(o);i.has(l)&&n.push(o)})}),await _g(t,e,n)}function R_(t,e){return t.filter(r=>!Array.isArray(r.connectivity)||r.connectivity.length===0?!1:Lr(r,"ilxtr:hasSomaLocatedIn").some(a=>e.map(i=>JSON.stringify(i)).includes(JSON.stringify(a))))}function L_(t,e){return t.filter(r=>!Array.isArray(r.connectivity)||r.connectivity.length===0?!1:[...Lr(r,"ilxtr:hasAxonPresynapticElementIn"),...Lr(r,"ilxtr:hasAxonSensorySubcellularElementIn")].some(a=>e.map(i=>JSON.stringify(i)).includes(JSON.stringify(a))))}function F_(t,e){return t.filter(r=>!Array.isArray(r.connectivity)||r.connectivity.length===0?!1:[...Lr(r,"ilxtr:hasAxonLeadingToSensorySubcellularElementIn"),...Lr(r,"ilxtr:hasAxonLocatedIn")].some(a=>e.map(i=>JSON.stringify(i)).includes(JSON.stringify(a))))}async function cG({knowledge:t,origins:e,destinations:r,vias:n}){let a=t;return e.length&&(a=R_(a,e)),r.length&&(a=L_(a,r)),n.length&&(a=F_(a,n)),a}async function dG(t,e,r,n){let a=[];const i=[];if(e){if(e&&typeof e.featureFilterRanges=="function"){const v=e.featureFilterRanges();for(const[p,g]of Object.entries(v)){let y={key:`flatmap.connectivity.${p}`,label:"",children:[]},m=[];if(p==="kind"){y.label="Pathways";for(const b of g){const w=n.find(C=>C.type===b);w&&m.push({key:`${y.key}.${b}`,label:w.label,colour:w.colour,colourStyle:"line",dashed:w.dashed})}}else if(p==="taxons"){y.label="Studied in";const b=await iG(e,e.taxonIdentifiers);if(b.length)for(const w of g){const C=b.find(x=>x.taxon===w);C&&m.push({key:`${y.key}.${w}`,label:`${C.label} `})}}else if(p==="alert"){y.label="Alert";for(const b of["with","without"])m.push({key:`${y.key}.${b}`,label:`${b} alerts`})}y.children=m.sort((b,w)=>b.label.localeCompare(w.label)),y.label&&y.children.length&&a.push(y)}}const o=e.pathways.paths,l=[];for(const v of r){const p=v.id;if(p){const g=o[p];if(g&&g.connectivity&&g["node-phenotypes"]){const y=g.connectivity,m=g["node-phenotypes"],b={};for(let w in v["node-phenotypes"])m[w]&&(b[w]=[...m[w]]);l.push({...v,connectivity:[...y],"node-phenotypes":b})}}}const c=e.knowledgeSource,u=await P_(t,c,l),d=await A_(t,c,l),f=await O_(t,c,l),h=(v,p)=>{const g=JSON.stringify(p.key);return{key:`flatmap.connectivity.source.${v}.${g}`,label:p.label||g}};for(const v of["origin","via","destination","all"]){let p=[];if(v==="origin")p=u.map(g=>h(v,g));else if(v==="via")p=d.map(g=>h(v,g));else if(v==="destination")p=f.map(g=>h(v,g));else{const g=[...u.map(m=>h(v,m)),...d.map(m=>h(v,m)),...f.map(m=>h(v,m))],y=new Set;p=g.filter(m=>y.has(m.key)?!1:(y.add(m.key),!0))}p=p.sort((g,y)=>{const m=C=>/^[a-zA-Z]/.test(C),b=m(g.label),w=m(y.label);return b&&!w?-1:!b&&w?1:g.label.localeCompare(y.label)}),p.length&&i.push({key:`flatmap.connectivity.source.${v}`,label:v,children:p})}i.length&&a.push(...i)}return a}Te.AnnotationPopup=x0,Te.ConnectivityGraph=Y9,Te.ConnectivityList=vg,Te.CopyToClipboard=cs,Te.CreateTooltipContent=_F,Te.DrawToolbar=KH,Te.ExternalResourceCard=Cg,Te.HelpModeDialog=ZH,Te.Tooltip=qK,Te.TreeControls=JK,Te.competencyQuery=nn,Te.extractDestinationItems=O_,Te.extractOriginItems=P_,Te.extractViaItems=A_,Te.fetchLabels=D_,Te.filterDestinations=lG,Te.filterOrigins=sG,Te.filterViaLocations=uG,Te.findPathsByDestinationItem=L_,Te.findPathsByOriginItem=R_,Te.findPathsByViaItem=F_,Te.getFlatmapFilterOptions=dG,Te.queryAllConnectedPaths=eG,Te.queryForwardBackwardConnections=xg,Te.queryPathsByDestination=nG,Te.queryPathsByOrigin=tG,Te.queryPathsByRoute=aG,Te.queryPathsByRouteFromKnowledge=cG,Te.queryPathsByViaLocation=rG,Object.defineProperty(Te,Symbol.toStringTag,{value:"Module"})});