@nocobase/plugin-graph-collection-manager 0.16.0-alpha.6 → 0.17.0-alpha.2

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,7 +1,7 @@
1
- (function(Q,L){typeof exports=="object"&&typeof module!="undefined"?L(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("react"),require("@ant-design/icons"),require("@formily/shared"),require("@formily/react"),require("@formily/reactive"),require("@nocobase/utils/client"),require("antd"),require("react-i18next"),require("@emotion/css"),require("lodash"),require("react-router-dom"),require("ahooks")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","react","@ant-design/icons","@formily/shared","@formily/react","@formily/reactive","@nocobase/utils/client","antd","react-i18next","@emotion/css","lodash","react-router-dom","ahooks"],L):(Q=typeof globalThis!="undefined"?globalThis:Q||self,L(Q["@nocobase/plugin-graph-collection-manager"]={},Q["@nocobase/client"],Q.jsxRuntime,Q.react,Q["@ant-design/icons"],Q["@formily/shared"],Q["@formily/react"],Q["@formily/reactive"],Q["@nocobase/utils"],Q.antd,Q["react-i18next"],Q["@emotion/css"],Q.lodash,Q["react-router-dom"],Q.ahooks))})(this,function(Q,L,_,H,_e,Ja,Ft,fo,pn,ce,Qa,Cr,Hu,Uy,zO){"use strict";var zY=Object.defineProperty,FY=Object.defineProperties;var VY=Object.getOwnPropertyDescriptors;var Gu=Object.getOwnPropertySymbols;var LO=Object.prototype.hasOwnProperty,RO=Object.prototype.propertyIsEnumerable;var IO=(Q,L,_)=>L in Q?zY(Q,L,{enumerable:!0,configurable:!0,writable:!0,value:_}):Q[L]=_,re=(Q,L)=>{for(var _ in L||(L={}))LO.call(L,_)&&IO(Q,_,L[_]);if(Gu)for(var _ of Gu(L))RO.call(L,_)&&IO(Q,_,L[_]);return Q},$e=(Q,L)=>FY(Q,VY(L));var Hy=(Q,L)=>{var _={};for(var H in Q)LO.call(Q,H)&&L.indexOf(H)<0&&(_[H]=Q[H]);if(Q!=null&&Gu)for(var H of Gu(Q))L.indexOf(H)<0&&RO.call(Q,H)&&(_[H]=Q[H]);return _};var Be=(Q,L,_)=>new Promise((H,_e)=>{var Ja=pn=>{try{fo(_.next(pn))}catch(ce){_e(ce)}},Ft=pn=>{try{fo(_.throw(pn))}catch(ce){_e(ce)}},fo=pn=>pn.done?H(pn.value):Promise.resolve(pn.value).then(Ja,Ft);fo((_=_.apply(Q,L)).next())});const Wy=H.memo(n=>{const e=H.useContext(L.PluginManagerContext);return _.jsx(L.PluginManagerContext.Provider,{value:{components:re({},e==null?void 0:e.components)},children:n.children})});Wy.displayName="GraphCollectionProvider";var Za=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Xy(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function FO(){this.__data__=[],this.size=0}var VO=FO;function qO(n,e){return n===e||n!==n&&e!==e}var Hi=qO,GO=Hi;function HO(n,e){for(var t=n.length;t--;)if(GO(n[t][0],e))return t;return-1}var el=HO,UO=el,WO=Array.prototype,XO=WO.splice;function YO(n){var e=this.__data__,t=UO(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():XO.call(e,t,1),--this.size,!0}var KO=YO,JO=el;function QO(n){var e=this.__data__,t=JO(e,n);return t<0?void 0:e[t][1]}var ZO=QO,eM=el;function tM(n){return eM(this.__data__,n)>-1}var nM=tM,rM=el;function iM(n,e){var t=this.__data__,r=rM(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}var sM=iM,oM=VO,aM=KO,lM=ZO,cM=nM,uM=sM;function Ui(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Ui.prototype.clear=oM,Ui.prototype.delete=aM,Ui.prototype.get=lM,Ui.prototype.has=cM,Ui.prototype.set=uM;var tl=Ui,hM=tl;function fM(){this.__data__=new hM,this.size=0}var dM=fM;function gM(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}var pM=gM;function mM(n){return this.__data__.get(n)}var yM=mM;function vM(n){return this.__data__.has(n)}var bM=vM,wM=typeof Za=="object"&&Za&&Za.Object===Object&&Za,Yy=wM,xM=Yy,CM=typeof self=="object"&&self&&self.Object===Object&&self,SM=xM||CM||Function("return this")(),mn=SM,PM=mn,EM=PM.Symbol,Wi=EM,Ky=Wi,Jy=Object.prototype,AM=Jy.hasOwnProperty,TM=Jy.toString,go=Ky?Ky.toStringTag:void 0;function OM(n){var e=AM.call(n,go),t=n[go];try{n[go]=void 0;var r=!0}catch(s){}var i=TM.call(n);return r&&(e?n[go]=t:delete n[go]),i}var MM=OM,_M=Object.prototype,NM=_M.toString;function kM(n){return NM.call(n)}var $M=kM,Qy=Wi,IM=MM,LM=$M,RM="[object Null]",jM="[object Undefined]",Zy=Qy?Qy.toStringTag:void 0;function DM(n){return n==null?n===void 0?jM:RM:Zy&&Zy in Object(n)?IM(n):LM(n)}var ui=DM;function BM(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Qt=BM,zM=ui,FM=Qt,VM="[object AsyncFunction]",qM="[object Function]",GM="[object GeneratorFunction]",HM="[object Proxy]";function UM(n){if(!FM(n))return!1;var e=zM(n);return e==qM||e==GM||e==VM||e==HM}var po=UM,WM=mn,XM=WM["__core-js_shared__"],YM=XM,Uu=YM,ev=function(){var n=/[^.]+$/.exec(Uu&&Uu.keys&&Uu.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function KM(n){return!!ev&&ev in n}var JM=KM,QM=Function.prototype,ZM=QM.toString;function e2(n){if(n!=null){try{return ZM.call(n)}catch(e){}try{return n+""}catch(e){}}return""}var tv=e2,t2=po,n2=JM,r2=Qt,i2=tv,s2=/[\\^$.*+?()[\]{}|]/g,o2=/^\[object .+?Constructor\]$/,a2=Function.prototype,l2=Object.prototype,c2=a2.toString,u2=l2.hasOwnProperty,h2=RegExp("^"+c2.call(u2).replace(s2,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f2(n){if(!r2(n)||n2(n))return!1;var e=t2(n)?h2:o2;return e.test(i2(n))}var d2=f2;function g2(n,e){return n==null?void 0:n[e]}var p2=g2,m2=d2,y2=p2;function v2(n,e){var t=y2(n,e);return m2(t)?t:void 0}var hi=v2,b2=hi,w2=mn,x2=b2(w2,"Map"),Wu=x2,C2=hi,S2=C2(Object,"create"),nl=S2,nv=nl;function P2(){this.__data__=nv?nv(null):{},this.size=0}var E2=P2;function A2(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var T2=A2,O2=nl,M2="__lodash_hash_undefined__",_2=Object.prototype,N2=_2.hasOwnProperty;function k2(n){var e=this.__data__;if(O2){var t=e[n];return t===M2?void 0:t}return N2.call(e,n)?e[n]:void 0}var $2=k2,I2=nl,L2=Object.prototype,R2=L2.hasOwnProperty;function j2(n){var e=this.__data__;return I2?e[n]!==void 0:R2.call(e,n)}var D2=j2,B2=nl,z2="__lodash_hash_undefined__";function F2(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=B2&&e===void 0?z2:e,this}var V2=F2,q2=E2,G2=T2,H2=$2,U2=D2,W2=V2;function Xi(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Xi.prototype.clear=q2,Xi.prototype.delete=G2,Xi.prototype.get=H2,Xi.prototype.has=U2,Xi.prototype.set=W2;var X2=Xi,rv=X2,Y2=tl,K2=Wu;function J2(){this.size=0,this.__data__={hash:new rv,map:new(K2||Y2),string:new rv}}var Q2=J2;function Z2(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}var e_=Z2,t_=e_;function n_(n,e){var t=n.__data__;return t_(e)?t[typeof e=="string"?"string":"hash"]:t.map}var rl=n_,r_=rl;function i_(n){var e=r_(this,n).delete(n);return this.size-=e?1:0,e}var s_=i_,o_=rl;function a_(n){return o_(this,n).get(n)}var l_=a_,c_=rl;function u_(n){return c_(this,n).has(n)}var h_=u_,f_=rl;function d_(n,e){var t=f_(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}var g_=d_,p_=Q2,m_=s_,y_=l_,v_=h_,b_=g_;function Yi(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Yi.prototype.clear=p_,Yi.prototype.delete=m_,Yi.prototype.get=y_,Yi.prototype.has=v_,Yi.prototype.set=b_;var Xu=Yi,w_=tl,x_=Wu,C_=Xu,S_=200;function P_(n,e){var t=this.__data__;if(t instanceof w_){var r=t.__data__;if(!x_||r.length<S_-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new C_(r)}return t.set(n,e),this.size=t.size,this}var E_=P_,A_=tl,T_=dM,O_=pM,M_=yM,__=bM,N_=E_;function Ki(n){var e=this.__data__=new A_(n);this.size=e.size}Ki.prototype.clear=T_,Ki.prototype.delete=O_,Ki.prototype.get=M_,Ki.prototype.has=__,Ki.prototype.set=N_;var il=Ki;function k_(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var Yu=k_,$_=hi,I_=function(){try{var n=$_(Object,"defineProperty");return n({},"",{}),n}catch(e){}}(),iv=I_,sv=iv;function L_(n,e,t){e=="__proto__"&&sv?sv(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}var sl=L_,R_=sl,j_=Hi,D_=Object.prototype,B_=D_.hasOwnProperty;function z_(n,e,t){var r=n[e];(!(B_.call(n,e)&&j_(r,t))||t===void 0&&!(e in n))&&R_(n,e,t)}var ol=z_,F_=ol,V_=sl;function q_(n,e,t,r){var i=!t;t||(t={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=r?r(t[a],n[a],a,t,n):void 0;l===void 0&&(l=n[a]),i?V_(t,a,l):F_(t,a,l)}return t}var mo=q_;function G_(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var H_=G_;function U_(n){return n!=null&&typeof n=="object"}var kn=U_,W_=ui,X_=kn,Y_="[object Arguments]";function K_(n){return X_(n)&&W_(n)==Y_}var J_=K_,ov=J_,Q_=kn,av=Object.prototype,Z_=av.hasOwnProperty,eN=av.propertyIsEnumerable,tN=ov(function(){return arguments}())?ov:function(n){return Q_(n)&&Z_.call(n,"callee")&&!eN.call(n,"callee")},yo=tN,nN=Array.isArray,Qe=nN,al={exports:{}};function rN(){return!1}var iN=rN;al.exports,function(n,e){var t=mn,r=iN,i=e&&!e.nodeType&&e,s=i&&!0&&n&&!n.nodeType&&n,o=s&&s.exports===i,a=o?t.Buffer:void 0,l=a?a.isBuffer:void 0,c=l||r;n.exports=c}(al,al.exports);var Ji=al.exports,sN=9007199254740991,oN=/^(?:0|[1-9]\d*)$/;function aN(n,e){var t=typeof n;return e=e==null?sN:e,!!e&&(t=="number"||t!="symbol"&&oN.test(n))&&n>-1&&n%1==0&&n<e}var ll=aN,lN=9007199254740991;function cN(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=lN}var Ku=cN,uN=ui,hN=Ku,fN=kn,dN="[object Arguments]",gN="[object Array]",pN="[object Boolean]",mN="[object Date]",yN="[object Error]",vN="[object Function]",bN="[object Map]",wN="[object Number]",xN="[object Object]",CN="[object RegExp]",SN="[object Set]",PN="[object String]",EN="[object WeakMap]",AN="[object ArrayBuffer]",TN="[object DataView]",ON="[object Float32Array]",MN="[object Float64Array]",_N="[object Int8Array]",NN="[object Int16Array]",kN="[object Int32Array]",$N="[object Uint8Array]",IN="[object Uint8ClampedArray]",LN="[object Uint16Array]",RN="[object Uint32Array]",Ae={};Ae[ON]=Ae[MN]=Ae[_N]=Ae[NN]=Ae[kN]=Ae[$N]=Ae[IN]=Ae[LN]=Ae[RN]=!0,Ae[dN]=Ae[gN]=Ae[AN]=Ae[pN]=Ae[TN]=Ae[mN]=Ae[yN]=Ae[vN]=Ae[bN]=Ae[wN]=Ae[xN]=Ae[CN]=Ae[SN]=Ae[PN]=Ae[EN]=!1;function jN(n){return fN(n)&&hN(n.length)&&!!Ae[uN(n)]}var DN=jN;function BN(n){return function(e){return n(e)}}var cl=BN,ul={exports:{}};ul.exports,function(n,e){var t=Yy,r=e&&!e.nodeType&&e,i=r&&!0&&n&&!n.nodeType&&n,s=i&&i.exports===r,o=s&&t.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch(c){}}();n.exports=a}(ul,ul.exports);var Ju=ul.exports,zN=DN,FN=cl,lv=Ju,cv=lv&&lv.isTypedArray,VN=cv?FN(cv):zN,vo=VN,qN=H_,GN=yo,HN=Qe,UN=Ji,WN=ll,XN=vo,YN=Object.prototype,KN=YN.hasOwnProperty;function JN(n,e){var t=HN(n),r=!t&&GN(n),i=!t&&!r&&UN(n),s=!t&&!r&&!i&&XN(n),o=t||r||i||s,a=o?qN(n.length,String):[],l=a.length;for(var c in n)(e||KN.call(n,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||WN(c,l)))&&a.push(c);return a}var uv=JN,QN=Object.prototype;function ZN(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||QN;return n===t}var hl=ZN;function ek(n,e){return function(t){return n(e(t))}}var hv=ek,tk=hv,nk=tk(Object.keys,Object),rk=nk,ik=hl,sk=rk,ok=Object.prototype,ak=ok.hasOwnProperty;function lk(n){if(!ik(n))return sk(n);var e=[];for(var t in Object(n))ak.call(n,t)&&t!="constructor"&&e.push(t);return e}var Qu=lk,ck=po,uk=Ku;function hk(n){return n!=null&&uk(n.length)&&!ck(n)}var Wn=hk,fk=uv,dk=Qu,gk=Wn;function pk(n){return gk(n)?fk(n):dk(n)}var Sr=pk,mk=mo,yk=Sr;function vk(n,e){return n&&mk(e,yk(e),n)}var bk=vk;function wk(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var xk=wk,Ck=Qt,Sk=hl,Pk=xk,Ek=Object.prototype,Ak=Ek.hasOwnProperty;function Tk(n){if(!Ck(n))return Pk(n);var e=Sk(n),t=[];for(var r in n)r=="constructor"&&(e||!Ak.call(n,r))||t.push(r);return t}var Ok=Tk,Mk=uv,_k=Ok,Nk=Wn;function kk(n){return Nk(n)?Mk(n,!0):_k(n)}var fi=kk,$k=mo,Ik=fi;function Lk(n,e){return n&&$k(e,Ik(e),n)}var Rk=Lk,fl={exports:{}};fl.exports,function(n,e){var t=mn,r=e&&!e.nodeType&&e,i=r&&!0&&n&&!n.nodeType&&n,s=i&&i.exports===r,o=s?t.Buffer:void 0,a=o?o.allocUnsafe:void 0;function l(c,u){if(u)return c.slice();var h=c.length,f=a?a(h):new c.constructor(h);return c.copy(f),f}n.exports=l}(fl,fl.exports);var fv=fl.exports;function jk(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var dv=jk;function Dk(n,e){for(var t=-1,r=n==null?0:n.length,i=0,s=[];++t<r;){var o=n[t];e(o,t,n)&&(s[i++]=o)}return s}var gv=Dk;function Bk(){return[]}var pv=Bk,zk=gv,Fk=pv,Vk=Object.prototype,qk=Vk.propertyIsEnumerable,mv=Object.getOwnPropertySymbols,Gk=mv?function(n){return n==null?[]:(n=Object(n),zk(mv(n),function(e){return qk.call(n,e)}))}:Fk,Zu=Gk,Hk=mo,Uk=Zu;function Wk(n,e){return Hk(n,Uk(n),e)}var Xk=Wk;function Yk(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}var eh=Yk,Kk=hv,Jk=Kk(Object.getPrototypeOf,Object),dl=Jk,Qk=eh,Zk=dl,e$=Zu,t$=pv,n$=Object.getOwnPropertySymbols,r$=n$?function(n){for(var e=[];n;)Qk(e,e$(n)),n=Zk(n);return e}:t$,yv=r$,i$=mo,s$=yv;function o$(n,e){return i$(n,s$(n),e)}var a$=o$,l$=eh,c$=Qe;function u$(n,e,t){var r=e(n);return c$(n)?r:l$(r,t(n))}var vv=u$,h$=vv,f$=Zu,d$=Sr;function g$(n){return h$(n,d$,f$)}var bv=g$,p$=vv,m$=yv,y$=fi;function v$(n){return p$(n,y$,m$)}var b$=v$,w$=hi,x$=mn,C$=w$(x$,"DataView"),S$=C$,P$=hi,E$=mn,A$=P$(E$,"Promise"),T$=A$,O$=hi,M$=mn,_$=O$(M$,"Set"),wv=_$,N$=hi,k$=mn,$$=N$(k$,"WeakMap"),I$=$$,th=S$,nh=Wu,rh=T$,ih=wv,sh=I$,xv=ui,Qi=tv,Cv="[object Map]",L$="[object Object]",Sv="[object Promise]",Pv="[object Set]",Ev="[object WeakMap]",Av="[object DataView]",R$=Qi(th),j$=Qi(nh),D$=Qi(rh),B$=Qi(ih),z$=Qi(sh),di=xv;(th&&di(new th(new ArrayBuffer(1)))!=Av||nh&&di(new nh)!=Cv||rh&&di(rh.resolve())!=Sv||ih&&di(new ih)!=Pv||sh&&di(new sh)!=Ev)&&(di=function(n){var e=xv(n),t=e==L$?n.constructor:void 0,r=t?Qi(t):"";if(r)switch(r){case R$:return Av;case j$:return Cv;case D$:return Sv;case B$:return Pv;case z$:return Ev}return e});var Zi=di,F$=Object.prototype,V$=F$.hasOwnProperty;function q$(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&V$.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var G$=q$,H$=mn,U$=H$.Uint8Array,Tv=U$,Ov=Tv;function W$(n){var e=new n.constructor(n.byteLength);return new Ov(e).set(new Ov(n)),e}var oh=W$,X$=oh;function Y$(n,e){var t=e?X$(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var K$=Y$,J$=/\w*$/;function Q$(n){var e=new n.constructor(n.source,J$.exec(n));return e.lastIndex=n.lastIndex,e}var Z$=Q$,Mv=Wi,_v=Mv?Mv.prototype:void 0,Nv=_v?_v.valueOf:void 0;function eI(n){return Nv?Object(Nv.call(n)):{}}var tI=eI,nI=oh;function rI(n,e){var t=e?nI(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var kv=rI,iI=oh,sI=K$,oI=Z$,aI=tI,lI=kv,cI="[object Boolean]",uI="[object Date]",hI="[object Map]",fI="[object Number]",dI="[object RegExp]",gI="[object Set]",pI="[object String]",mI="[object Symbol]",yI="[object ArrayBuffer]",vI="[object DataView]",bI="[object Float32Array]",wI="[object Float64Array]",xI="[object Int8Array]",CI="[object Int16Array]",SI="[object Int32Array]",PI="[object Uint8Array]",EI="[object Uint8ClampedArray]",AI="[object Uint16Array]",TI="[object Uint32Array]";function OI(n,e,t){var r=n.constructor;switch(e){case yI:return iI(n);case cI:case uI:return new r(+n);case vI:return sI(n,t);case bI:case wI:case xI:case CI:case SI:case PI:case EI:case AI:case TI:return lI(n,t);case hI:return new r;case fI:case pI:return new r(n);case dI:return oI(n);case gI:return new r;case mI:return aI(n)}}var MI=OI,_I=Qt,$v=Object.create,NI=function(){function n(){}return function(e){if(!_I(e))return{};if($v)return $v(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}(),Iv=NI,kI=Iv,$I=dl,II=hl;function LI(n){return typeof n.constructor=="function"&&!II(n)?kI($I(n)):{}}var Lv=LI,RI=Zi,jI=kn,DI="[object Map]";function BI(n){return jI(n)&&RI(n)==DI}var zI=BI,FI=zI,VI=cl,Rv=Ju,jv=Rv&&Rv.isMap,qI=jv?VI(jv):FI,GI=qI,HI=Zi,UI=kn,WI="[object Set]";function XI(n){return UI(n)&&HI(n)==WI}var YI=XI,KI=YI,JI=cl,Dv=Ju,Bv=Dv&&Dv.isSet,QI=Bv?JI(Bv):KI,ZI=QI,eL=il,tL=Yu,nL=ol,rL=bk,iL=Rk,sL=fv,oL=dv,aL=Xk,lL=a$,cL=bv,uL=b$,hL=Zi,fL=G$,dL=MI,gL=Lv,pL=Qe,mL=Ji,yL=GI,vL=Qt,bL=ZI,wL=Sr,xL=fi,CL=1,SL=2,PL=4,zv="[object Arguments]",EL="[object Array]",AL="[object Boolean]",TL="[object Date]",OL="[object Error]",Fv="[object Function]",ML="[object GeneratorFunction]",_L="[object Map]",NL="[object Number]",Vv="[object Object]",kL="[object RegExp]",$L="[object Set]",IL="[object String]",LL="[object Symbol]",RL="[object WeakMap]",jL="[object ArrayBuffer]",DL="[object DataView]",BL="[object Float32Array]",zL="[object Float64Array]",FL="[object Int8Array]",VL="[object Int16Array]",qL="[object Int32Array]",GL="[object Uint8Array]",HL="[object Uint8ClampedArray]",UL="[object Uint16Array]",WL="[object Uint32Array]",xe={};xe[zv]=xe[EL]=xe[jL]=xe[DL]=xe[AL]=xe[TL]=xe[BL]=xe[zL]=xe[FL]=xe[VL]=xe[qL]=xe[_L]=xe[NL]=xe[Vv]=xe[kL]=xe[$L]=xe[IL]=xe[LL]=xe[GL]=xe[HL]=xe[UL]=xe[WL]=!0,xe[OL]=xe[Fv]=xe[RL]=!1;function gl(n,e,t,r,i,s){var o,a=e&CL,l=e&SL,c=e&PL;if(t&&(o=i?t(n,r,i,s):t(n)),o!==void 0)return o;if(!vL(n))return n;var u=pL(n);if(u){if(o=fL(n),!a)return oL(n,o)}else{var h=hL(n),f=h==Fv||h==ML;if(mL(n))return sL(n,a);if(h==Vv||h==zv||f&&!i){if(o=l||f?{}:gL(n),!a)return l?lL(n,iL(o,n)):aL(n,rL(o,n))}else{if(!xe[h])return i?n:{};o=dL(n,h,a)}}s||(s=new eL);var d=s.get(n);if(d)return d;s.set(n,o),bL(n)?n.forEach(function(b){o.add(gl(b,e,t,b,n,s))}):yL(n)&&n.forEach(function(b,m){o.set(m,gl(b,e,t,m,n,s))});var g=c?l?uL:cL:l?xL:wL,p=u?void 0:g(n);return tL(p||n,function(b,m){p&&(m=b,b=n[m]),nL(o,m,gl(b,e,t,m,n,s))}),o}var qv=gl,XL=qv,YL=1,KL=4;function JL(n){return XL(n,YL|KL)}var Gv=JL;const QL=Xy(Gv),gi=H.createContext(null),Hv=n=>{const{record:e,setTargetNode:t,node:r,handelOpenPorts:i}=n;return _.jsx(gi.Provider,{value:{node:r,record:e,positionTargetNode:s=>{t(s||r)},openPorts:i},children:n.children})},ZL=(n,e)=>{const t=L.useRequest(()=>Promise.resolve({data:QL(e)}),$e(re({},n),{manual:!0})),r=L.useActionContext();return H.useEffect(()=>{r.visible&&t.run()},[r.visible]),t};Ft.observer(()=>{const{record:n}=H.useContext(gi),e=L.useCompile();return _.jsx("div",{children:_.jsx(ce.Select,{popupMatchSelectWidth:!1,disabled:!0,value:n.name,options:[{value:n.name,label:e(n.title)}]})})},{displayName:"SourceCollection"});const Xn=()=>{const n=Ft.useForm(),e=L.useActionContext();return{run(){return Be(this,null,function*(){e.setVisible(!1),n.reset()})}}},Uv=n=>{const e=Ft.useForm(),t=L.useAPIClient(),r=L.useActionContext(),{refreshCM:i}=L.useCollectionManager();return{run(){return Be(this,null,function*(){yield e.submit(),yield t.resource("collections").create({values:e.values}),r.setVisible(!1),yield e.reset(),n("last"),yield i()})}}},Wv=(n,e)=>{const t=Ft.useForm(),r=L.useAPIClient(),i=L.useActionContext(),{refreshCM:s}=L.useCollectionManager(),{positionTargetNode:o,openPorts:a}=H.useContext(gi),{getValues:l}=L.useCollectionFieldFormValues();return{run(){return Be(this,null,function*(){yield t.submit();const u=l(),h=pn.lodash.omit(u,["key","uiSchemaUid","collectionName","autoCreateReverseField","uiSchema.x-uid","reverseField.key","reverseField.uiSchemaUid"]),f=!["obo","oho","o2o","o2m","m2o","m2m","linkTo","id"].includes(u.interface),{data:{data:d}}=yield r.resource("collections.fields",n).create({values:h});e&&(yield r.resource("fields").move({sourceId:d.key,targetId:e,targetScope:n,method:"insertAfter"})),i.setVisible(!1),yield t.reset(),o(),f&&a&&a(),yield s()})}}},eR=({collectionName:n,name:e,key:t})=>{const{refreshCM:r}=L.useCollectionManager(),{t:i}=Qa.useTranslation(),s=Ft.useForm(),o=L.useActionContext(),a=L.useAPIClient(),{positionTargetNode:l,node:c}=H.useContext(gi);return{run(){return Be(this,null,function*(){var h;yield s.submit(),yield a.resource("collections.fields",n).update({filterByTk:e,values:s.values}),o.setVisible(!1),ce.message.success(i("Saved successfully")),l(),r(),c.setPortProp(t,"uiSchema",{title:(h=s.values)==null?void 0:h.uiSchema.title}),yield s.reset()})}}},pl=()=>{const{t:n}=Qa.useTranslation(),e=Ft.useForm(),t=L.useActionContext(),{name:r}=e.values,i=L.useAPIClient(),{refreshCM:s}=L.useCollectionManager(),{positionTargetNode:o}=H.useContext(gi);return{run(){return Be(this,null,function*(){yield e.submit(),yield i.resource("collections").update({filterByTk:r,values:re({},pn.lodash.omit(e.values,["fields"]))}),t.setVisible(!1),ce.message.success(n("Saved successfully")),yield e.reset(),o(),s()})}}},tR=n=>{const e=L.useAPIClient(),t=Ft.useForm(),{cascade:r}=(t==null?void 0:t.values)||{};return{run(){return Be(this,null,function*(){yield e.resource("collections").destroy({filterByTk:n,cascade:r}),yield e.resource("graphPositions").destroy({filter:{collectionName:n}})})}}},nR=n=>{const{name:e}=n,{run:t}=tR(e),{refreshCM:r}=L.useCollectionManager(),{positionTargetNode:i}=H.useContext(gi);return{run(){return Be(this,null,function*(){yield t(),i("destory"),yield r()})}}},rR=(n,e)=>{const t=L.useAPIClient(),{positionTargetNode:r}=H.useContext(gi);return{run(){return Be(this,null,function*(){yield t.resource("collections.fields",n).destroy({filterByTk:e}),r()})}}},iR=n=>{const{collectionName:e,name:t}=n,{refreshCM:r}=L.useCollectionManager(),{run:i}=rR(e,t);return{run(){return Be(this,null,function*(){yield i(),yield r()})}}},ah=n=>(e,{targetScope:t})=>{e.loading=!0,n(t).then(fo.action.bound(r=>{e.dataSource=r,e.loading=!1})).catch(r=>{pn.error(r)})};typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),function(n){n.forEach(e=>{Object.prototype.hasOwnProperty.call(e,"append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value(...t){const r=document.createDocumentFragment();t.forEach(i=>{const s=i instanceof Node;r.appendChild(s?i:document.createTextNode(String(i)))}),this.appendChild(r)}})})}([Element.prototype,Document.prototype,DocumentFragment.prototype]);class $n{get disposed(){return this._disposed===!0}dispose(){this._disposed=!0}}(function(n){function e(){return(t,r,i)=>{const s=i.value,o=t.__proto__;i.value=function(){this.disposed||(s.call(this),o.dispose.call(this))}}}n.dispose=e})($n||($n={}));class Xv{constructor(){this.isDisposed=!1,this.items=new Set}get disposed(){return this.isDisposed}dispose(){this.isDisposed||(this.isDisposed=!0,this.items.forEach(e=>{e.dispose()}),this.items.clear())}contains(e){return this.items.has(e)}add(e){this.items.add(e)}remove(e){this.items.delete(e)}clear(){this.items.clear()}}(function(n){function e(t){const r=new n;return t.forEach(i=>{r.add(i)}),r}n.from=e})(Xv||(Xv={}));var sR=typeof global=="object"&&global&&global.Object===Object&&global;const Yv=sR;var oR=typeof self=="object"&&self&&self.Object===Object&&self,aR=Yv||oR||Function("return this")();const yn=aR;var lR=yn.Symbol;const Zt=lR;var Kv=Object.prototype,cR=Kv.hasOwnProperty,uR=Kv.toString,bo=Zt?Zt.toStringTag:void 0;function hR(n){var e=cR.call(n,bo),t=n[bo];try{n[bo]=void 0;var r=!0}catch(s){}var i=uR.call(n);return r&&(e?n[bo]=t:delete n[bo]),i}var fR=Object.prototype,dR=fR.toString;function gR(n){return dR.call(n)}var pR="[object Null]",mR="[object Undefined]",Jv=Zt?Zt.toStringTag:void 0;function Pr(n){return n==null?n===void 0?mR:pR:Jv&&Jv in Object(n)?hR(n):gR(n)}function vn(n){return n!=null&&typeof n=="object"}var yR="[object Symbol]";function In(n){return typeof n=="symbol"||vn(n)&&Pr(n)==yR}function wo(n,e){for(var t=-1,r=n==null?0:n.length,i=Array(r);++t<r;)i[t]=e(n[t],t,n);return i}var vR=Array.isArray;const bt=vR;var bR=1/0,Qv=Zt?Zt.prototype:void 0,Zv=Qv?Qv.toString:void 0;function e0(n){if(typeof n=="string")return n;if(bt(n))return wo(n,e0)+"";if(In(n))return Zv?Zv.call(n):"";var e=n+"";return e=="0"&&1/n==-bR?"-0":e}var wR=/\s/;function xR(n){for(var e=n.length;e--&&wR.test(n.charAt(e)););return e}var CR=/^\s+/;function SR(n){return n&&n.slice(0,xR(n)+1).replace(CR,"")}function Ze(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var t0=0/0,PR=/^[-+]0x[0-9a-f]+$/i,ER=/^0b[01]+$/i,AR=/^0o[0-7]+$/i,TR=parseInt;function xo(n){if(typeof n=="number")return n;if(In(n))return t0;if(Ze(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Ze(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=SR(n);var t=ER.test(n);return t||AR.test(n)?TR(n.slice(2),t?2:8):PR.test(n)?t0:+n}function es(n){return n}var OR="[object AsyncFunction]",MR="[object Function]",_R="[object GeneratorFunction]",NR="[object Proxy]";function lh(n){if(!Ze(n))return!1;var e=Pr(n);return e==MR||e==_R||e==OR||e==NR}var kR=yn["__core-js_shared__"];const ch=kR;var n0=function(){var n=/[^.]+$/.exec(ch&&ch.keys&&ch.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function $R(n){return!!n0&&n0 in n}var IR=Function.prototype,LR=IR.toString;function pi(n){if(n!=null){try{return LR.call(n)}catch(e){}try{return n+""}catch(e){}}return""}var RR=/[\\^$.*+?()[\]{}|]/g,jR=/^\[object .+?Constructor\]$/,DR=Function.prototype,BR=Object.prototype,zR=DR.toString,FR=BR.hasOwnProperty,VR=RegExp("^"+zR.call(FR).replace(RR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qR(n){if(!Ze(n)||$R(n))return!1;var e=lh(n)?VR:jR;return e.test(pi(n))}function GR(n,e){return n==null?void 0:n[e]}function mi(n,e){var t=GR(n,e);return qR(t)?t:void 0}var HR=mi(yn,"WeakMap");const uh=HR;var r0=Object.create,UR=function(){function n(){}return function(e){if(!Ze(e))return{};if(r0)return r0(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();const WR=UR;function i0(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function XR(){}function s0(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var YR=800,KR=16,JR=Date.now;function QR(n){var e=0,t=0;return function(){var r=JR(),i=KR-(r-t);if(t=r,i>0){if(++e>=YR)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function ZR(n){return function(){return n}}var ej=function(){try{var n=mi(Object,"defineProperty");return n({},"",{}),n}catch(e){}}();const ml=ej;var tj=ml?function(n,e){return ml(n,"toString",{configurable:!0,enumerable:!1,value:ZR(e),writable:!0})}:es,nj=QR(tj);const rj=nj;function ij(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}function sj(n,e,t,r){for(var i=n.length,s=t+(r?1:-1);r?s--:++s<i;)if(e(n[s],s,n))return s;return-1}function oj(n){return n!==n}function aj(n,e,t){for(var r=t-1,i=n.length;++r<i;)if(n[r]===e)return r;return-1}function lj(n,e,t){return e===e?aj(n,e,t):sj(n,oj,t)}function o0(n,e){var t=n==null?0:n.length;return!!t&&lj(n,e,0)>-1}var cj=9007199254740991,uj=/^(?:0|[1-9]\d*)$/;function hh(n,e){var t=typeof n;return e=e==null?cj:e,!!e&&(t=="number"||t!="symbol"&&uj.test(n))&&n>-1&&n%1==0&&n<e}function yl(n,e,t){e=="__proto__"&&ml?ml(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function ts(n,e){return n===e||n!==n&&e!==e}var hj=Object.prototype,fj=hj.hasOwnProperty;function a0(n,e,t){var r=n[e];(!(fj.call(n,e)&&ts(r,t))||t===void 0&&!(e in n))&&yl(n,e,t)}function Co(n,e,t,r){var i=!t;t||(t={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=r?r(t[a],n[a],a,t,n):void 0;l===void 0&&(l=n[a]),i?yl(t,a,l):a0(t,a,l)}return t}var l0=Math.max;function dj(n,e,t){return e=l0(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,s=l0(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=t(o),i0(n,this,a)}}function ns(n,e){return rj(dj(n,e,es),n+"")}var gj=9007199254740991;function fh(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=gj}function yi(n){return n!=null&&fh(n.length)&&!lh(n)}function vl(n,e,t){if(!Ze(t))return!1;var r=typeof e;return(r=="number"?yi(t)&&hh(e,t.length):r=="string"&&e in t)?ts(t[e],n):!1}function c0(n){return ns(function(e,t){var r=-1,i=t.length,s=i>1?t[i-1]:void 0,o=i>2?t[2]:void 0;for(s=n.length>3&&typeof s=="function"?(i--,s):void 0,o&&vl(t[0],t[1],o)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var a=t[r];a&&n(e,a,r,s)}return e})}var pj=Object.prototype;function bl(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||pj;return n===t}function mj(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var yj="[object Arguments]";function u0(n){return vn(n)&&Pr(n)==yj}var h0=Object.prototype,vj=h0.hasOwnProperty,bj=h0.propertyIsEnumerable,wj=u0(function(){return arguments}())?u0:function(n){return vn(n)&&vj.call(n,"callee")&&!bj.call(n,"callee")};const rs=wj;function xj(){return!1}var f0=typeof Q=="object"&&Q&&!Q.nodeType&&Q,d0=f0&&typeof module=="object"&&module&&!module.nodeType&&module,Cj=d0&&d0.exports===f0,g0=Cj?yn.Buffer:void 0,Sj=g0?g0.isBuffer:void 0,Pj=Sj||xj;const is=Pj;var Ej="[object Arguments]",Aj="[object Array]",Tj="[object Boolean]",Oj="[object Date]",Mj="[object Error]",_j="[object Function]",Nj="[object Map]",kj="[object Number]",$j="[object Object]",Ij="[object RegExp]",Lj="[object Set]",Rj="[object String]",jj="[object WeakMap]",Dj="[object ArrayBuffer]",Bj="[object DataView]",zj="[object Float32Array]",Fj="[object Float64Array]",Vj="[object Int8Array]",qj="[object Int16Array]",Gj="[object Int32Array]",Hj="[object Uint8Array]",Uj="[object Uint8ClampedArray]",Wj="[object Uint16Array]",Xj="[object Uint32Array]",Te={};Te[zj]=Te[Fj]=Te[Vj]=Te[qj]=Te[Gj]=Te[Hj]=Te[Uj]=Te[Wj]=Te[Xj]=!0,Te[Ej]=Te[Aj]=Te[Dj]=Te[Tj]=Te[Bj]=Te[Oj]=Te[Mj]=Te[_j]=Te[Nj]=Te[kj]=Te[$j]=Te[Ij]=Te[Lj]=Te[Rj]=Te[jj]=!1;function Yj(n){return vn(n)&&fh(n.length)&&!!Te[Pr(n)]}function So(n){return function(e){return n(e)}}var p0=typeof Q=="object"&&Q&&!Q.nodeType&&Q,Po=p0&&typeof module=="object"&&module&&!module.nodeType&&module,Kj=Po&&Po.exports===p0,dh=Kj&&Yv.process,Jj=function(){try{var n=Po&&Po.require&&Po.require("util").types;return n||dh&&dh.binding&&dh.binding("util")}catch(e){}}();const ss=Jj;var m0=ss&&ss.isTypedArray,Qj=m0?So(m0):Yj;const wl=Qj;var Zj=Object.prototype,eD=Zj.hasOwnProperty;function y0(n,e){var t=bt(n),r=!t&&rs(n),i=!t&&!r&&is(n),s=!t&&!r&&!i&&wl(n),o=t||r||i||s,a=o?mj(n.length,String):[],l=a.length;for(var c in n)(e||eD.call(n,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||hh(c,l)))&&a.push(c);return a}function v0(n,e){return function(t){return n(e(t))}}var tD=v0(Object.keys,Object);const nD=tD;var rD=Object.prototype,iD=rD.hasOwnProperty;function b0(n){if(!bl(n))return nD(n);var e=[];for(var t in Object(n))iD.call(n,t)&&t!="constructor"&&e.push(t);return e}function Eo(n){return yi(n)?y0(n):b0(n)}function sD(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var oD=Object.prototype,aD=oD.hasOwnProperty;function lD(n){if(!Ze(n))return sD(n);var e=bl(n),t=[];for(var r in n)r=="constructor"&&(e||!aD.call(n,r))||t.push(r);return t}function os(n){return yi(n)?y0(n,!0):lD(n)}var cD=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uD=/^\w*$/;function gh(n,e){if(bt(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||In(n)?!0:uD.test(n)||!cD.test(n)||e!=null&&n in Object(e)}var hD=mi(Object,"create");const Ao=hD;function fD(){this.__data__=Ao?Ao(null):{},this.size=0}function dD(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var gD="__lodash_hash_undefined__",pD=Object.prototype,mD=pD.hasOwnProperty;function yD(n){var e=this.__data__;if(Ao){var t=e[n];return t===gD?void 0:t}return mD.call(e,n)?e[n]:void 0}var vD=Object.prototype,bD=vD.hasOwnProperty;function wD(n){var e=this.__data__;return Ao?e[n]!==void 0:bD.call(e,n)}var xD="__lodash_hash_undefined__";function CD(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Ao&&e===void 0?xD:e,this}function vi(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}vi.prototype.clear=fD,vi.prototype.delete=dD,vi.prototype.get=yD,vi.prototype.has=wD,vi.prototype.set=CD;function SD(){this.__data__=[],this.size=0}function xl(n,e){for(var t=n.length;t--;)if(ts(n[t][0],e))return t;return-1}var PD=Array.prototype,ED=PD.splice;function AD(n){var e=this.__data__,t=xl(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():ED.call(e,t,1),--this.size,!0}function TD(n){var e=this.__data__,t=xl(e,n);return t<0?void 0:e[t][1]}function OD(n){return xl(this.__data__,n)>-1}function MD(n,e){var t=this.__data__,r=xl(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function Yn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Yn.prototype.clear=SD,Yn.prototype.delete=AD,Yn.prototype.get=TD,Yn.prototype.has=OD,Yn.prototype.set=MD;var _D=mi(yn,"Map");const To=_D;function ND(){this.size=0,this.__data__={hash:new vi,map:new(To||Yn),string:new vi}}function kD(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Cl(n,e){var t=n.__data__;return kD(e)?t[typeof e=="string"?"string":"hash"]:t.map}function $D(n){var e=Cl(this,n).delete(n);return this.size-=e?1:0,e}function ID(n){return Cl(this,n).get(n)}function LD(n){return Cl(this,n).has(n)}function RD(n,e){var t=Cl(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function Kn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Kn.prototype.clear=ND,Kn.prototype.delete=$D,Kn.prototype.get=ID,Kn.prototype.has=LD,Kn.prototype.set=RD;var jD="Expected a function";function ph(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(jD);var t=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=t.cache;if(s.has(i))return s.get(i);var o=n.apply(this,r);return t.cache=s.set(i,o)||s,o};return t.cache=new(ph.Cache||Kn),t}ph.Cache=Kn;var DD=500;function BD(n){var e=ph(n,function(r){return t.size===DD&&t.clear(),r}),t=e.cache;return e}var zD=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,FD=/\\(\\)?/g,VD=BD(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(zD,function(t,r,i,s){e.push(i?s.replace(FD,"$1"):r||t)}),e});const qD=VD;function Oo(n){return n==null?"":e0(n)}function w0(n,e){return bt(n)?n:gh(n,e)?[n]:qD(Oo(n))}var GD=1/0;function Sl(n){if(typeof n=="string"||In(n))return n;var e=n+"";return e=="0"&&1/n==-GD?"-0":e}function mh(n,e){e=w0(e,n);for(var t=0,r=e.length;n!=null&&t<r;)n=n[Sl(e[t++])];return t&&t==r?n:void 0}function HD(n,e,t){var r=n==null?void 0:mh(n,e);return r===void 0?t:r}function yh(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}var x0=Zt?Zt.isConcatSpreadable:void 0;function UD(n){return bt(n)||rs(n)||!!(x0&&n&&n[x0])}function Pl(n,e,t,r,i){var s=-1,o=n.length;for(t||(t=UD),i||(i=[]);++s<o;){var a=n[s];e>0&&t(a)?e>1?Pl(a,e-1,t,r,i):yh(i,a):r||(i[i.length]=a)}return i}var WD=v0(Object.getPrototypeOf,Object);const vh=WD;var XD="[object Object]",YD=Function.prototype,KD=Object.prototype,C0=YD.toString,JD=KD.hasOwnProperty,QD=C0.call(Object);function Ln(n){if(!vn(n)||Pr(n)!=XD)return!1;var e=vh(n);if(e===null)return!0;var t=JD.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&C0.call(t)==QD}function ZD(n,e,t){var r=-1,i=n.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=n[r+e];return s}function eB(n,e,t){var r=n.length;return t=t===void 0?r:t,!e&&t>=r?n:ZD(n,e,t)}var tB="\\ud800-\\udfff",nB="\\u0300-\\u036f",rB="\\ufe20-\\ufe2f",iB="\\u20d0-\\u20ff",sB=nB+rB+iB,oB="\\ufe0e\\ufe0f",aB="\\u200d",lB=RegExp("["+aB+tB+sB+oB+"]");function S0(n){return lB.test(n)}function cB(n){return n.split("")}var P0="\\ud800-\\udfff",uB="\\u0300-\\u036f",hB="\\ufe20-\\ufe2f",fB="\\u20d0-\\u20ff",dB=uB+hB+fB,gB="\\ufe0e\\ufe0f",pB="["+P0+"]",bh="["+dB+"]",wh="\\ud83c[\\udffb-\\udfff]",mB="(?:"+bh+"|"+wh+")",E0="[^"+P0+"]",A0="(?:\\ud83c[\\udde6-\\uddff]){2}",T0="[\\ud800-\\udbff][\\udc00-\\udfff]",yB="\\u200d",O0=mB+"?",M0="["+gB+"]?",vB="(?:"+yB+"(?:"+[E0,A0,T0].join("|")+")"+M0+O0+")*",bB=M0+O0+vB,wB="(?:"+[E0+bh+"?",bh,A0,T0,pB].join("|")+")",xB=RegExp(wh+"(?="+wh+")|"+wB+bB,"g");function CB(n){return n.match(xB)||[]}function SB(n){return S0(n)?CB(n):cB(n)}function _0(n){return function(e){e=Oo(e);var t=S0(e)?SB(e):void 0,r=t?t[0]:e.charAt(0),i=t?eB(t,1).join(""):e.slice(1);return r[n]()+i}}var PB=_0("toUpperCase");const El=PB;function EB(n){return El(Oo(n).toLowerCase())}function AB(n,e,t,r){var i=-1,s=n==null?0:n.length;for(r&&s&&(t=n[++i]);++i<s;)t=e(t,n[i],i,n);return t}function TB(n){return function(e){return n==null?void 0:n[e]}}var OB={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},MB=TB(OB);const _B=MB;var NB=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,kB="\\u0300-\\u036f",$B="\\ufe20-\\ufe2f",IB="\\u20d0-\\u20ff",LB=kB+$B+IB,RB="["+LB+"]",jB=RegExp(RB,"g");function DB(n){return n=Oo(n),n&&n.replace(NB,_B).replace(jB,"")}var BB=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function zB(n){return n.match(BB)||[]}var FB=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function VB(n){return FB.test(n)}var N0="\\ud800-\\udfff",qB="\\u0300-\\u036f",GB="\\ufe20-\\ufe2f",HB="\\u20d0-\\u20ff",UB=qB+GB+HB,k0="\\u2700-\\u27bf",$0="a-z\\xdf-\\xf6\\xf8-\\xff",WB="\\xac\\xb1\\xd7\\xf7",XB="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",YB="\\u2000-\\u206f",KB=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",I0="A-Z\\xc0-\\xd6\\xd8-\\xde",JB="\\ufe0e\\ufe0f",L0=WB+XB+YB+KB,R0="['’]",j0="["+L0+"]",QB="["+UB+"]",D0="\\d+",ZB="["+k0+"]",B0="["+$0+"]",z0="[^"+N0+L0+D0+k0+$0+I0+"]",e3="\\ud83c[\\udffb-\\udfff]",t3="(?:"+QB+"|"+e3+")",n3="[^"+N0+"]",F0="(?:\\ud83c[\\udde6-\\uddff]){2}",V0="[\\ud800-\\udbff][\\udc00-\\udfff]",as="["+I0+"]",r3="\\u200d",q0="(?:"+B0+"|"+z0+")",i3="(?:"+as+"|"+z0+")",G0="(?:"+R0+"(?:d|ll|m|re|s|t|ve))?",H0="(?:"+R0+"(?:D|LL|M|RE|S|T|VE))?",U0=t3+"?",W0="["+JB+"]?",s3="(?:"+r3+"(?:"+[n3,F0,V0].join("|")+")"+W0+U0+")*",o3="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",a3="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",l3=W0+U0+s3,c3="(?:"+[ZB,F0,V0].join("|")+")"+l3,u3=RegExp([as+"?"+B0+"+"+G0+"(?="+[j0,as,"$"].join("|")+")",i3+"+"+H0+"(?="+[j0,as+q0,"$"].join("|")+")",as+"?"+q0+"+"+G0,as+"+"+H0,a3,o3,D0,c3].join("|"),"g");function h3(n){return n.match(u3)||[]}function f3(n,e,t){return n=Oo(n),e=t?void 0:e,e===void 0?VB(n)?h3(n):zB(n):n.match(e)||[]}var d3="['’]",g3=RegExp(d3,"g");function X0(n){return function(e){return AB(f3(DB(e).replace(g3,"")),n,"")}}var p3=X0(function(n,e,t){return e=e.toLowerCase(),n+(t?EB(e):e)});const Al=p3;function m3(n,e,t){return n===n&&(t!==void 0&&(n=n<=t?n:t),e!==void 0&&(n=n>=e?n:e)),n}function en(n,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=xo(t),t=t===t?t:0),e!==void 0&&(e=xo(e),e=e===e?e:0),m3(xo(n),e,t)}function y3(){this.__data__=new Yn,this.size=0}function v3(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function b3(n){return this.__data__.get(n)}function w3(n){return this.__data__.has(n)}var x3=200;function C3(n,e){var t=this.__data__;if(t instanceof Yn){var r=t.__data__;if(!To||r.length<x3-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new Kn(r)}return t.set(n,e),this.size=t.size,this}function bn(n){var e=this.__data__=new Yn(n);this.size=e.size}bn.prototype.clear=y3,bn.prototype.delete=v3,bn.prototype.get=b3,bn.prototype.has=w3,bn.prototype.set=C3;function S3(n,e){return n&&Co(e,Eo(e),n)}function P3(n,e){return n&&Co(e,os(e),n)}var Y0=typeof Q=="object"&&Q&&!Q.nodeType&&Q,K0=Y0&&typeof module=="object"&&module&&!module.nodeType&&module,E3=K0&&K0.exports===Y0,J0=E3?yn.Buffer:void 0,Q0=J0?J0.allocUnsafe:void 0;function Z0(n,e){if(e)return n.slice();var t=n.length,r=Q0?Q0(t):new n.constructor(t);return n.copy(r),r}function A3(n,e){for(var t=-1,r=n==null?0:n.length,i=0,s=[];++t<r;){var o=n[t];e(o,t,n)&&(s[i++]=o)}return s}function eb(){return[]}var T3=Object.prototype,O3=T3.propertyIsEnumerable,tb=Object.getOwnPropertySymbols,M3=tb?function(n){return n==null?[]:(n=Object(n),A3(tb(n),function(e){return O3.call(n,e)}))}:eb;const xh=M3;function _3(n,e){return Co(n,xh(n),e)}var N3=Object.getOwnPropertySymbols,k3=N3?function(n){for(var e=[];n;)yh(e,xh(n)),n=vh(n);return e}:eb;const nb=k3;function $3(n,e){return Co(n,nb(n),e)}function rb(n,e,t){var r=e(n);return bt(n)?r:yh(r,t(n))}function Ch(n){return rb(n,Eo,xh)}function I3(n){return rb(n,os,nb)}var L3=mi(yn,"DataView");const Sh=L3;var R3=mi(yn,"Promise");const Ph=R3;var j3=mi(yn,"Set");const ls=j3;var ib="[object Map]",D3="[object Object]",sb="[object Promise]",ob="[object Set]",ab="[object WeakMap]",lb="[object DataView]",B3=pi(Sh),z3=pi(To),F3=pi(Ph),V3=pi(ls),q3=pi(uh),bi=Pr;(Sh&&bi(new Sh(new ArrayBuffer(1)))!=lb||To&&bi(new To)!=ib||Ph&&bi(Ph.resolve())!=sb||ls&&bi(new ls)!=ob||uh&&bi(new uh)!=ab)&&(bi=function(n){var e=Pr(n),t=e==D3?n.constructor:void 0,r=t?pi(t):"";if(r)switch(r){case B3:return lb;case z3:return ib;case F3:return sb;case V3:return ob;case q3:return ab}return e});const cs=bi;var G3=Object.prototype,H3=G3.hasOwnProperty;function U3(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&H3.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var W3=yn.Uint8Array;const Tl=W3;function Eh(n){var e=new n.constructor(n.byteLength);return new Tl(e).set(new Tl(n)),e}function X3(n,e){var t=e?Eh(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var Y3=/\w*$/;function K3(n){var e=new n.constructor(n.source,Y3.exec(n));return e.lastIndex=n.lastIndex,e}var cb=Zt?Zt.prototype:void 0,ub=cb?cb.valueOf:void 0;function J3(n){return ub?Object(ub.call(n)):{}}function hb(n,e){var t=e?Eh(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var Q3="[object Boolean]",Z3="[object Date]",ez="[object Map]",tz="[object Number]",nz="[object RegExp]",rz="[object Set]",iz="[object String]",sz="[object Symbol]",oz="[object ArrayBuffer]",az="[object DataView]",lz="[object Float32Array]",cz="[object Float64Array]",uz="[object Int8Array]",hz="[object Int16Array]",fz="[object Int32Array]",dz="[object Uint8Array]",gz="[object Uint8ClampedArray]",pz="[object Uint16Array]",mz="[object Uint32Array]";function yz(n,e,t){var r=n.constructor;switch(e){case oz:return Eh(n);case Q3:case Z3:return new r(+n);case az:return X3(n,t);case lz:case cz:case uz:case hz:case fz:case dz:case gz:case pz:case mz:return hb(n,t);case ez:return new r;case tz:case iz:return new r(n);case nz:return K3(n);case rz:return new r;case sz:return J3(n)}}function fb(n){return typeof n.constructor=="function"&&!bl(n)?WR(vh(n)):{}}var vz="[object Map]";function bz(n){return vn(n)&&cs(n)==vz}var db=ss&&ss.isMap,wz=db?So(db):bz;const xz=wz;var Cz="[object Set]";function Sz(n){return vn(n)&&cs(n)==Cz}var gb=ss&&ss.isSet,Pz=gb?So(gb):Sz;const Ez=Pz;var Az=1,Tz=2,Oz=4,pb="[object Arguments]",Mz="[object Array]",_z="[object Boolean]",Nz="[object Date]",kz="[object Error]",mb="[object Function]",$z="[object GeneratorFunction]",Iz="[object Map]",Lz="[object Number]",yb="[object Object]",Rz="[object RegExp]",jz="[object Set]",Dz="[object String]",Bz="[object Symbol]",zz="[object WeakMap]",Fz="[object ArrayBuffer]",Vz="[object DataView]",qz="[object Float32Array]",Gz="[object Float64Array]",Hz="[object Int8Array]",Uz="[object Int16Array]",Wz="[object Int32Array]",Xz="[object Uint8Array]",Yz="[object Uint8ClampedArray]",Kz="[object Uint16Array]",Jz="[object Uint32Array]",Ce={};Ce[pb]=Ce[Mz]=Ce[Fz]=Ce[Vz]=Ce[_z]=Ce[Nz]=Ce[qz]=Ce[Gz]=Ce[Hz]=Ce[Uz]=Ce[Wz]=Ce[Iz]=Ce[Lz]=Ce[yb]=Ce[Rz]=Ce[jz]=Ce[Dz]=Ce[Bz]=Ce[Xz]=Ce[Yz]=Ce[Kz]=Ce[Jz]=!0,Ce[kz]=Ce[mb]=Ce[zz]=!1;function Mo(n,e,t,r,i,s){var o,a=e&Az,l=e&Tz,c=e&Oz;if(t&&(o=i?t(n,r,i,s):t(n)),o!==void 0)return o;if(!Ze(n))return n;var u=bt(n);if(u){if(o=U3(n),!a)return s0(n,o)}else{var h=cs(n),f=h==mb||h==$z;if(is(n))return Z0(n,a);if(h==yb||h==pb||f&&!i){if(o=l||f?{}:fb(n),!a)return l?$3(n,P3(o,n)):_3(n,S3(o,n))}else{if(!Ce[h])return i?n:{};o=yz(n,h,a)}}s||(s=new bn);var d=s.get(n);if(d)return d;s.set(n,o),Ez(n)?n.forEach(function(b){o.add(Mo(b,e,t,b,n,s))}):xz(n)&&n.forEach(function(b,m){o.set(m,Mo(b,e,t,m,n,s))});var g=c?l?I3:Ch:l?os:Eo,p=u?void 0:g(n);return ij(p||n,function(b,m){p&&(m=b,b=n[m]),a0(o,m,Mo(b,e,t,m,n,s))}),o}var Qz=4;function Ah(n){return Mo(n,Qz)}var Zz=1,eF=4;function ze(n){return Mo(n,Zz|eF)}var tF="__lodash_hash_undefined__";function nF(n){return this.__data__.set(n,tF),this}function rF(n){return this.__data__.has(n)}function us(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Kn;++e<t;)this.add(n[e])}us.prototype.add=us.prototype.push=nF,us.prototype.has=rF;function iF(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function Th(n,e){return n.has(e)}var sF=1,oF=2;function vb(n,e,t,r,i,s){var o=t&sF,a=n.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var c=s.get(n),u=s.get(e);if(c&&u)return c==e&&u==n;var h=-1,f=!0,d=t&oF?new us:void 0;for(s.set(n,e),s.set(e,n);++h<a;){var g=n[h],p=e[h];if(r)var b=o?r(p,g,h,e,n,s):r(g,p,h,n,e,s);if(b!==void 0){if(b)continue;f=!1;break}if(d){if(!iF(e,function(m,y){if(!Th(d,y)&&(g===m||i(g,m,t,r,s)))return d.push(y)})){f=!1;break}}else if(!(g===p||i(g,p,t,r,s))){f=!1;break}}return s.delete(n),s.delete(e),f}function aF(n){var e=-1,t=Array(n.size);return n.forEach(function(r,i){t[++e]=[i,r]}),t}function Oh(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var lF=1,cF=2,uF="[object Boolean]",hF="[object Date]",fF="[object Error]",dF="[object Map]",gF="[object Number]",pF="[object RegExp]",mF="[object Set]",yF="[object String]",vF="[object Symbol]",bF="[object ArrayBuffer]",wF="[object DataView]",bb=Zt?Zt.prototype:void 0,Mh=bb?bb.valueOf:void 0;function xF(n,e,t,r,i,s,o){switch(t){case wF:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case bF:return!(n.byteLength!=e.byteLength||!s(new Tl(n),new Tl(e)));case uF:case hF:case gF:return ts(+n,+e);case fF:return n.name==e.name&&n.message==e.message;case pF:case yF:return n==e+"";case dF:var a=aF;case mF:var l=r&lF;if(a||(a=Oh),n.size!=e.size&&!l)return!1;var c=o.get(n);if(c)return c==e;r|=cF,o.set(n,e);var u=vb(a(n),a(e),r,i,s,o);return o.delete(n),u;case vF:if(Mh)return Mh.call(n)==Mh.call(e)}return!1}var CF=1,SF=Object.prototype,PF=SF.hasOwnProperty;function EF(n,e,t,r,i,s){var o=t&CF,a=Ch(n),l=a.length,c=Ch(e),u=c.length;if(l!=u&&!o)return!1;for(var h=l;h--;){var f=a[h];if(!(o?f in e:PF.call(e,f)))return!1}var d=s.get(n),g=s.get(e);if(d&&g)return d==e&&g==n;var p=!0;s.set(n,e),s.set(e,n);for(var b=o;++h<l;){f=a[h];var m=n[f],y=e[f];if(r)var v=o?r(y,m,f,e,n,s):r(m,y,f,n,e,s);if(!(v===void 0?m===y||i(m,y,t,r,s):v)){p=!1;break}b||(b=f=="constructor")}if(p&&!b){var w=n.constructor,x=e.constructor;w!=x&&"constructor"in n&&"constructor"in e&&!(typeof w=="function"&&w instanceof w&&typeof x=="function"&&x instanceof x)&&(p=!1)}return s.delete(n),s.delete(e),p}var AF=1,wb="[object Arguments]",xb="[object Array]",Ol="[object Object]",TF=Object.prototype,Cb=TF.hasOwnProperty;function OF(n,e,t,r,i,s){var o=bt(n),a=bt(e),l=o?xb:cs(n),c=a?xb:cs(e);l=l==wb?Ol:l,c=c==wb?Ol:c;var u=l==Ol,h=c==Ol,f=l==c;if(f&&is(n)){if(!is(e))return!1;o=!0,u=!1}if(f&&!u)return s||(s=new bn),o||wl(n)?vb(n,e,t,r,i,s):xF(n,e,l,t,r,i,s);if(!(t&AF)){var d=u&&Cb.call(n,"__wrapped__"),g=h&&Cb.call(e,"__wrapped__");if(d||g){var p=d?n.value():n,b=g?e.value():e;return s||(s=new bn),i(p,b,t,r,s)}}return f?(s||(s=new bn),EF(n,e,t,r,i,s)):!1}function Ml(n,e,t,r,i){return n===e?!0:n==null||e==null||!vn(n)&&!vn(e)?n!==n&&e!==e:OF(n,e,t,r,Ml,i)}var MF=1,_F=2;function NF(n,e,t,r){var i=t.length,s=i,o=!r;if(n==null)return!s;for(n=Object(n);i--;){var a=t[i];if(o&&a[2]?a[1]!==n[a[0]]:!(a[0]in n))return!1}for(;++i<s;){a=t[i];var l=a[0],c=n[l],u=a[1];if(o&&a[2]){if(c===void 0&&!(l in n))return!1}else{var h=new bn;if(r)var f=r(c,u,l,n,e,h);if(!(f===void 0?Ml(u,c,MF|_F,r,h):f))return!1}}return!0}function Sb(n){return n===n&&!Ze(n)}function kF(n){for(var e=Eo(n),t=e.length;t--;){var r=e[t],i=n[r];e[t]=[r,i,Sb(i)]}return e}function Pb(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function $F(n){var e=kF(n);return e.length==1&&e[0][2]?Pb(e[0][0],e[0][1]):function(t){return t===n||NF(t,n,e)}}function IF(n,e){return n!=null&&e in Object(n)}function Eb(n,e,t){e=w0(e,n);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Sl(e[r]);if(!(s=n!=null&&t(n,o)))break;n=n[o]}return s||++r!=i?s:(i=n==null?0:n.length,!!i&&fh(i)&&hh(o,i)&&(bt(n)||rs(n)))}function LF(n,e){return n!=null&&Eb(n,e,IF)}var RF=1,jF=2;function DF(n,e){return gh(n)&&Sb(e)?Pb(Sl(n),e):function(t){var r=HD(t,n);return r===void 0&&r===e?LF(t,n):Ml(e,r,RF|jF)}}function BF(n){return function(e){return e==null?void 0:e[n]}}function zF(n){return function(e){return mh(e,n)}}function FF(n){return gh(n)?BF(Sl(n)):zF(n)}function _h(n){return typeof n=="function"?n:n==null?es:typeof n=="object"?bt(n)?DF(n[0],n[1]):$F(n):FF(n)}function VF(n,e,t,r){for(var i=-1,s=n==null?0:n.length;++i<s;){var o=n[i];e(r,o,t(o),n)}return r}function qF(n){return function(e,t,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var l=o[n?a:++i];if(t(s[l],l,s)===!1)break}return e}}var GF=qF();const Ab=GF;function HF(n,e){return n&&Ab(n,e,Eo)}function UF(n,e){return function(t,r){if(t==null)return t;if(!yi(t))return n(t,r);for(var i=t.length,s=e?i:-1,o=Object(t);(e?s--:++s<i)&&r(o[s],s,o)!==!1;);return t}}var WF=UF(HF);const Tb=WF;function XF(n,e,t,r){return Tb(n,function(i,s,o){e(r,i,t(i),o)}),r}function YF(n,e){return function(t,r){var i=bt(t)?VF:XF,s=e?e():{};return i(t,n,_h(r),s)}}var KF=function(){return yn.Date.now()};const Nh=KF;var JF="Expected a function",QF=Math.max,ZF=Math.min;function kh(n,e,t){var r,i,s,o,a,l,c=0,u=!1,h=!1,f=!0;if(typeof n!="function")throw new TypeError(JF);e=xo(e)||0,Ze(t)&&(u=!!t.leading,h="maxWait"in t,s=h?QF(xo(t.maxWait)||0,e):s,f="trailing"in t?!!t.trailing:f);function d(C){var S=r,E=i;return r=i=void 0,c=C,o=n.apply(E,S),o}function g(C){return c=C,a=setTimeout(m,e),u?d(C):o}function p(C){var S=C-l,E=C-c,A=e-S;return h?ZF(A,s-E):A}function b(C){var S=C-l,E=C-c;return l===void 0||S>=e||S<0||h&&E>=s}function m(){var C=Nh();if(b(C))return y(C);a=setTimeout(m,p(C))}function y(C){return a=void 0,f&&r?d(C):(r=i=void 0,o)}function v(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function w(){return a===void 0?o:y(Nh())}function x(){var C=Nh(),S=b(C);if(r=arguments,i=this,l=C,S){if(a===void 0)return g(l);if(h)return clearTimeout(a),a=setTimeout(m,e),d(l)}return a===void 0&&(a=setTimeout(m,e)),o}return x.cancel=v,x.flush=w,x}var Ob=Object.prototype,eV=Ob.hasOwnProperty,tV=ns(function(n,e){n=Object(n);var t=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&vl(e[0],e[1],i)&&(r=1);++t<r;)for(var s=e[t],o=os(s),a=-1,l=o.length;++a<l;){var c=o[a],u=n[c];(u===void 0||ts(u,Ob[c])&&!eV.call(n,c))&&(n[c]=s[c])}return n});const nV=tV;function $h(n,e,t){(t!==void 0&&!ts(n[e],t)||t===void 0&&!(e in n))&&yl(n,e,t)}function _l(n){return vn(n)&&yi(n)}function Ih(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function rV(n){return Co(n,os(n))}function iV(n,e,t,r,i,s,o){var a=Ih(n,t),l=Ih(e,t),c=o.get(l);if(c){$h(n,t,c);return}var u=s?s(a,l,t+"",n,e,o):void 0,h=u===void 0;if(h){var f=bt(l),d=!f&&is(l),g=!f&&!d&&wl(l);u=l,f||d||g?bt(a)?u=a:_l(a)?u=s0(a):d?(h=!1,u=Z0(l,!0)):g?(h=!1,u=hb(l,!0)):u=[]:Ln(l)||rs(l)?(u=a,rs(a)?u=rV(a):(!Ze(a)||lh(a))&&(u=fb(l))):h=!1}h&&(o.set(l,u),i(u,l,r,s,o),o.delete(l)),$h(n,t,u)}function Nl(n,e,t,r,i){n!==e&&Ab(e,function(s,o){if(i||(i=new bn),Ze(s))iV(n,e,o,t,Nl,r,i);else{var a=r?r(Ih(n,o),s,o+"",n,e,i):void 0;a===void 0&&(a=s),$h(n,o,a)}},os)}function Mb(n,e,t,r,i,s){return Ze(n)&&Ze(e)&&(s.set(e,n),Nl(n,e,void 0,Mb,s),s.delete(e)),n}var sV=c0(function(n,e,t,r){Nl(n,e,t,r)});const oV=sV;var aV=ns(function(n){return n.push(void 0,Mb),i0(oV,void 0,n)});const _b=aV;function Nb(n,e,t){for(var r=-1,i=n==null?0:n.length;++r<i;)if(t(e,n[r]))return!0;return!1}var lV=200;function cV(n,e,t,r){var i=-1,s=o0,o=!0,a=n.length,l=[],c=e.length;if(!a)return l;t&&(e=wo(e,So(t))),r?(s=Nb,o=!1):e.length>=lV&&(s=Th,o=!1,e=new us(e));e:for(;++i<a;){var u=n[i],h=t==null?u:t(u);if(u=r||u!==0?u:0,o&&h===h){for(var f=c;f--;)if(e[f]===h)continue e;l.push(u)}else s(e,h,r)||l.push(u)}return l}var uV=ns(function(n,e){return _l(n)?cV(n,Pl(e,1,_l,!0)):[]});const hV=uV;function fV(n,e){var t=-1,r=yi(n)?Array(n.length):[];return Tb(n,function(i,s,o){r[++t]=e(i,s,o)}),r}var dV=Object.prototype,gV=dV.hasOwnProperty,pV=YF(function(n,e,t){gV.call(n,t)?n[t].push(e):yl(n,t,[e])});const kb=pV;function mV(n,e){return n>e}var yV=Object.prototype,vV=yV.hasOwnProperty;function bV(n,e){return n!=null&&vV.call(n,e)}function kl(n,e){return n!=null&&Eb(n,e,bV)}var wV="[object Map]",xV="[object Set]",CV=Object.prototype,SV=CV.hasOwnProperty;function $b(n){if(n==null)return!0;if(yi(n)&&(bt(n)||typeof n=="string"||typeof n.splice=="function"||is(n)||wl(n)||rs(n)))return!n.length;var e=cs(n);if(e==wV||e==xV)return!n.size;if(bl(n))return!b0(n).length;for(var t in n)if(SV.call(n,t))return!1;return!0}function Jn(n,e){return Ml(n,e)}var PV="[object Number]";function Ib(n){return typeof n=="number"||vn(n)&&Pr(n)==PV}var EV=_0("toLowerCase");const AV=EV;function TV(n,e,t){for(var r=-1,i=n.length;++r<i;){var s=n[r],o=e(s);if(o!=null&&(a===void 0?o===o&&!In(o):t(o,a)))var a=o,l=s}return l}function OV(n){return n&&n.length?TV(n,es,mV):void 0}var MV=c0(function(n,e,t){Nl(n,e,t)});const Ie=MV;function _V(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}function NV(n,e){if(n!==e){var t=n!==void 0,r=n===null,i=n===n,s=In(n),o=e!==void 0,a=e===null,l=e===e,c=In(e);if(!a&&!c&&!s&&n>e||s&&o&&l&&!a&&!c||r&&o&&l||!t&&l||!i)return 1;if(!r&&!s&&!c&&n<e||c&&t&&i&&!r&&!s||a&&t&&i||!o&&i||!l)return-1}return 0}function kV(n,e,t){for(var r=-1,i=n.criteria,s=e.criteria,o=i.length,a=t.length;++r<o;){var l=NV(i[r],s[r]);if(l){if(r>=a)return l;var c=t[r];return l*(c=="desc"?-1:1)}}return n.index-e.index}function $V(n,e,t){e.length?e=wo(e,function(s){return bt(s)?function(o){return mh(o,s.length===1?s[0]:s)}:s}):e=[es];var r=-1;e=wo(e,So(_h));var i=fV(n,function(s,o,a){var l=wo(e,function(c){return c(s)});return{criteria:l,index:++r,value:s}});return _V(i,function(s,o){return kV(s,o,t)})}var IV=ns(function(n,e){if(n==null)return[];var t=e.length;return t>1&&vl(n,e[0],e[1])?e=[]:t>2&&vl(e[0],e[1],e[2])&&(e=[e[0]]),$V(n,Pl(e,1),[])});const Lb=IV;var LV=4294967295,RV=LV-1,jV=Math.floor,DV=Math.min;function Rb(n,e,t,r){var i=0,s=n==null?0:n.length;if(s===0)return 0;e=t(e);for(var o=e!==e,a=e===null,l=In(e),c=e===void 0;i<s;){var u=jV((i+s)/2),h=t(n[u]),f=h!==void 0,d=h===null,g=h===h,p=In(h);if(o)var b=r||g;else c?b=g&&(r||f):a?b=g&&f&&(r||!d):l?b=g&&f&&!d&&(r||!p):d||p?b=!1:b=r?h<=e:h<e;b?i=u+1:s=u}return DV(s,RV)}var BV=4294967295,zV=BV>>>1;function FV(n,e,t){var r=0,i=n==null?r:n.length;if(typeof e=="number"&&e===e&&i<=zV){for(;r<i;){var s=r+i>>>1,o=n[s];o!==null&&!In(o)&&(t?o<=e:o<e)?r=s+1:i=s}return i}return Rb(n,e,es,t)}function VV(n,e){return FV(n,e)}function qV(n,e,t){return Rb(n,e,_h(t))}var GV=X0(function(n,e,t){return n+(t?" ":"")+El(e)});const HV=GV;var UV="Expected a function";function WV(n,e,t){var r=!0,i=!0;if(typeof n!="function")throw new TypeError(UV);return Ze(t)&&(r="leading"in t?!!t.leading:r,i="trailing"in t?!!t.trailing:i),kh(n,e,{leading:r,maxWait:e,trailing:i})}var XV=1/0,YV=ls&&1/Oh(new ls([,-0]))[1]==XV?function(n){return new ls(n)}:XR;const KV=YV;var JV=200;function jb(n,e,t){var r=-1,i=o0,s=n.length,o=!0,a=[],l=a;if(t)o=!1,i=Nb;else if(s>=JV){var c=e?null:KV(n);if(c)return Oh(c);o=!1,i=Th,l=new us}else l=e?[]:a;e:for(;++r<s;){var u=n[r],h=e?e(u):u;if(u=t||u!==0?u:0,o&&h===h){for(var f=l.length;f--;)if(l[f]===h)continue e;e&&l.push(h),a.push(u)}else i(l,h,t)||(l!==a&&l.push(h),a.push(u))}return a}var QV=ns(function(n){return jb(Pl(n,1,_l,!0))});const Db=QV;function Bb(n){return n&&n.length?jb(n):[]}function zb(n,e,t){if(t)switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2]);case 4:return n.call(e,t[0],t[1],t[2],t[3]);case 5:return n.call(e,t[0],t[1],t[2],t[3],t[4]);case 6:return n.call(e,t[0],t[1],t[2],t[3],t[4],t[5]);default:return n.apply(e,t)}return n.call(e)}function K(n,e,...t){return zb(n,e,t)}function ZV(n){return typeof n=="object"&&n.then&&typeof n.then=="function"}function Fb(n){return n!=null&&(n instanceof Promise||ZV(n))}function Vb(...n){const e=[];if(n.forEach(r=>{Array.isArray(r)?e.push(...r):e.push(r)}),e.some(r=>Fb(r))){const r=e.map(i=>Fb(i)?i:Promise.resolve(i!==!1));return Promise.all(r).then(i=>i.reduce((s,o)=>o!==!1&&s,!0))}return e.every(r=>r!==!1)}function Lh(n,e){const t=[];for(let r=0;r<n.length;r+=2){const i=n[r],s=n[r+1],o=Array.isArray(e)?e:[e],a=zb(i,s,o);t.push(a)}return Vb(t)}class e4{constructor(){this.listeners={}}on(e,t,r){return t==null?this:(this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t,r),this)}once(e,t,r){const i=(...s)=>(this.off(e,i),Lh([t,r],s));return this.on(e,i,this)}off(e,t,r){if(!(e||t||r))return this.listeners={},this;const i=this.listeners;return(e?[e]:Object.keys(i)).forEach(o=>{const a=i[o];if(a){if(!(t||r)){delete i[o];return}for(let l=a.length-2;l>=0;l-=2)t&&a[l]!==t||r&&a[l+1]!==r||a.splice(l,2)}}),this}trigger(e,...t){let r=!0;if(e!=="*"){const s=this.listeners[e];s!=null&&(r=Lh([...s],t))}const i=this.listeners["*"];return i!=null?Vb([r,Lh([...i],[e,...t])]):r}emit(e,...t){return this.trigger(e,...t)}}function t4(n,...e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(r=>{r!=="constructor"&&Object.defineProperty(n.prototype,r,Object.getOwnPropertyDescriptor(t.prototype,r))})})}const n4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])};function r4(n,e){n4(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}let i4=class{};const s4=/^\s*class\s+/.test(`${i4}`)||/^\s*class\s*\{/.test(`${class{}}`);function Rh(n,e){let t;return s4?t=class extends e{}:(t=function(){return e.apply(this,arguments)},r4(t,e)),Object.defineProperty(t,"name",{value:n}),t}function qb(n){return n==="__proto__"}function jh(n,e,t="/"){let r;const i=Array.isArray(e)?e:e.split(t);if(i.length)for(r=n;i.length;){const s=i.shift();if(Object(r)===r&&s&&s in r)r=r[s];else return}return r}function hs(n,e,t,r="/"){const i=Array.isArray(e)?e:e.split(r),s=i.pop();if(s&&!qb(s)){let o=n;i.forEach(a=>{qb(a)||(o[a]==null&&(o[a]={}),o=o[a])}),o[s]=t}return n}function Gb(n,e,t="/"){const r=Array.isArray(e)?e.slice():e.split(t),i=r.pop();if(i)if(r.length>0){const s=jh(n,r);s&&delete s[i]}else delete n[i];return n}class wt extends e4{}(function(n){n.dispose=$n.dispose})(wt||(wt={})),t4(wt,$n);const Hb=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Ub=Hb(n=>n.replace(/\B([A-Z])/g,"-$1").toLowerCase()),Dh=Hb(n=>HV(Al(n)).replace(/ /g,""));function Bh(n){let e=2166136261,t=!1,r=n;for(let i=0,s=r.length;i<s;i+=1){let o=r.charCodeAt(i);o>127&&!t&&(r=unescape(encodeURIComponent(r)),o=r.charCodeAt(i),t=!0),e^=o,e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}return e>>>0}function zh(){let n="";const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let t=0,r=e.length;t<r;t+=1){const i=e[t],s=Math.random()*16|0,o=i==="x"?s:i==="y"?s&3|8:i;n+=o.toString(16)}return n}function o4(n,e,t){const r=Math.min(2,Math.floor(n.length*.34));let i=Math.floor(n.length*.4)+1,s,o=!1;const a=n.toLowerCase();for(const l of e){const c=t(l);if(c!==void 0&&Math.abs(c.length-a.length)<=r){const u=c.toLowerCase();if(u===a){if(c===n)continue;return l}if(o||c.length<3)continue;const h=a4(a,u,i-1);if(h===void 0)continue;h<3?(o=!0,s=l):(i=h,s=l)}}return s}function a4(n,e,t){let r=new Array(e.length+1),i=new Array(e.length+1);const s=t+1;for(let a=0;a<=e.length;a+=1)r[a]=a;for(let a=1;a<=n.length;a+=1){const l=n.charCodeAt(a-1),c=a>t?a-t:1,u=e.length>t+a?t+a:e.length;i[0]=a;let h=a;for(let d=1;d<c;d+=1)i[d]=s;for(let d=c;d<=u;d+=1){const g=l===e.charCodeAt(d-1)?r[d-1]:Math.min(r[d]+1,i[d-1]+1,r[d-1]+2);i[d]=g,h=Math.min(h,g)}for(let d=u+1;d<=e.length;d+=1)i[d]=s;if(h>t)return;const f=r;r=i,i=f}const o=r[e.length];return o>t?void 0:o}function Qn(n){return typeof n=="string"&&n.slice(-1)==="%"}function Vt(n,e){if(n==null)return 0;let t;if(typeof n=="string"){if(t=parseFloat(n),Qn(n)&&(t/=100,Number.isFinite(t)))return t*e}else t=n;return Number.isFinite(t)?t>0&&t<1?t*e:t:0}function Rn(n){if(typeof n=="object"){let t=0,r=0,i=0,s=0;return n.vertical!=null&&Number.isFinite(n.vertical)&&(r=s=n.vertical),n.horizontal!=null&&Number.isFinite(n.horizontal)&&(i=t=n.horizontal),n.left!=null&&Number.isFinite(n.left)&&(t=n.left),n.top!=null&&Number.isFinite(n.top)&&(r=n.top),n.right!=null&&Number.isFinite(n.right)&&(i=n.right),n.bottom!=null&&Number.isFinite(n.bottom)&&(s=n.bottom),{top:r,right:i,bottom:s,left:t}}let e=0;return n!=null&&Number.isFinite(n)&&(e=n),{top:e,right:e,bottom:e,left:e}}let Fh=!1,Wb=!1,Xb=!1,Yb=!1,Kb=!1,Jb=!1,Qb=!1,Zb=!1,e1=!1,t1=!1,n1=!1,r1=!1,i1=!1,s1=!1,o1=!1,a1=!1;if(typeof navigator=="object"){const n=navigator.userAgent;Fh=n.indexOf("Macintosh")>=0,Wb=!!n.match(/(iPad|iPhone|iPod)/g),Xb=n.indexOf("Windows")>=0,Yb=n.indexOf("MSIE")>=0,Kb=!!n.match(/Trident\/7\./),Jb=!!n.match(/Edge\//),Qb=n.indexOf("Mozilla/")>=0&&n.indexOf("MSIE")<0&&n.indexOf("Edge/")<0,e1=n.indexOf("Chrome/")>=0&&n.indexOf("Edge/")<0,t1=n.indexOf("Opera/")>=0||n.indexOf("OPR/")>=0,n1=n.indexOf("Firefox/")>=0,r1=n.indexOf("AppleWebKit/")>=0&&n.indexOf("Chrome/")<0&&n.indexOf("Edge/")<0,typeof document=="object"&&(a1=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||n.indexOf("Opera/")>=0)}if(typeof window=="object"&&(Zb=window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,s1=window.PointerEvent!=null&&!Fh),typeof document=="object"){i1="ontouchstart"in document.documentElement;try{const n=Object.defineProperty({},"passive",{get(){o1=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},n)}catch(n){}}var tn;(function(n){n.IS_MAC=Fh,n.IS_IOS=Wb,n.IS_WINDOWS=Xb,n.IS_IE=Yb,n.IS_IE11=Kb,n.IS_EDGE=Jb,n.IS_NETSCAPE=Qb,n.IS_CHROME_APP=Zb,n.IS_CHROME=e1,n.IS_OPERA=t1,n.IS_FIREFOX=n1,n.IS_SAFARI=r1,n.SUPPORT_TOUCH=i1,n.SUPPORT_POINTER=s1,n.SUPPORT_PASSIVE=o1,n.NO_FOREIGNOBJECT=a1,n.SUPPORT_FOREIGNOBJECT=!n.NO_FOREIGNOBJECT})(tn||(tn={})),function(n){function e(){const s=window.module;return s!=null&&s.hot!=null&&s.hot.status!=null?s.hot.status():"unkonwn"}n.getHMRStatus=e;function t(){return e()==="apply"}n.isApplyingHMR=t;const r={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function i(s){const o=document.createElement(r[s]||"div"),a=`on${s}`;let l=a in o;return l||(o.setAttribute(a,"return;"),l=typeof o[a]=="function"),l}n.isEventSupported=i}(tn||(tn={}));const Vh=/[\t\r\n\f]/g,qh=/\S+/g,fs=n=>` ${n} `;function ds(n){return n&&n.getAttribute&&n.getAttribute("class")||""}function gs(n,e){if(n==null||e==null)return!1;const t=fs(ds(n)),r=fs(e);return n.nodeType===1?t.replace(Vh," ").includes(r):!1}function J(n,e){if(!(n==null||e==null)){if(typeof e=="function")return J(n,e(ds(n)));if(typeof e=="string"&&n.nodeType===1){const t=e.match(qh)||[],r=fs(ds(n)).replace(Vh," ");let i=t.reduce((s,o)=>s.indexOf(fs(o))<0?`${s}${o} `:s,r);i=i.trim(),r!==i&&n.setAttribute("class",i)}}}function gt(n,e){if(n!=null){if(typeof e=="function")return gt(n,e(ds(n)));if((!e||typeof e=="string")&&n.nodeType===1){const t=(e||"").match(qh)||[],r=fs(ds(n)).replace(Vh," ");let i=t.reduce((s,o)=>{const a=fs(o);return s.indexOf(a)>-1?s.replace(a," "):s},r);i=e?i.trim():"",r!==i&&n.setAttribute("class",i)}}}function l1(n,e,t){if(!(n==null||e==null)){if(t!=null&&typeof e=="string"){t?J(n,e):gt(n,e);return}if(typeof e=="function")return l1(n,e(ds(n),t),t);typeof e=="string"&&(e.match(qh)||[]).forEach(i=>{gs(n,i)?gt(n,i):J(n,i)})}}let c1=0;function l4(){return c1+=1,`v${c1}`}function Gh(n){return(n.id==null||n.id==="")&&(n.id=l4()),n.id}function Er(n){return n==null?!1:typeof n.getScreenCTM=="function"&&n instanceof SVGElement}const lt={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},u1="1.1";function h1(n,e=document){return e.createElement(n)}function Hh(n,e=lt.xhtml,t=document){return t.createElementNS(e,n)}function Zn(n,e=document){return Hh(n,lt.svg,e)}function $l(n){if(n){const t=`<svg xmlns="${lt.svg}" xmlns:xlink="${lt.xlink}" version="${u1}">${n}</svg>`,{documentElement:r}=c4(t,{async:!1});return r}const e=document.createElementNS(lt.svg,"svg");return e.setAttributeNS(lt.xmlns,"xmlns:xlink",lt.xlink),e.setAttribute("version",u1),e}function c4(n,e={}){let t;try{const r=new DOMParser;if(e.async!=null){const i=r;i.async=e.async}t=r.parseFromString(n,e.mimeType||"text/xml")}catch(r){t=void 0}if(!t||t.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${n}`);return t}function u4(n,e=!0){const t=n.nodeName;return e?t.toLowerCase():t.toUpperCase()}function Uh(n){let e=0,t=n.previousSibling;for(;t;)t.nodeType===1&&(e+=1),t=t.previousSibling;return e}function h4(n,e){return n.querySelectorAll(e)}function f4(n,e){return n.querySelector(e)}function f1(n,e,t){const r=n.ownerSVGElement;let i=n.parentNode;for(;i&&i!==t&&i!==r;){if(gs(i,e))return i;i=i.parentNode}return null}function d1(n,e){const t=e&&e.parentNode;return n===t||!!(t&&t.nodeType===1&&n.compareDocumentPosition(t)&16)}function er(n){n&&(Array.isArray(n)?n:[n]).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}function _o(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function jn(n,e){(Array.isArray(e)?e:[e]).forEach(r=>{r!=null&&n.appendChild(r)})}function g1(n,e){const t=n.firstChild;return t?No(t,e):jn(n,e)}function No(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(i=>{i!=null&&t.insertBefore(i,n)})}function d4(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(i=>{i!=null&&t.insertBefore(i,n.nextSibling)})}function Ar(n,e){e!=null&&e.appendChild(n)}function g4(n){return!!n&&n.nodeType===1}function p1(n){try{return n instanceof HTMLElement}catch(e){return typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"}}function p4(n,e){const t=[];let r=n.firstChild;for(;r;r=r.nextSibling)r.nodeType===1&&(!e||gs(r,e))&&t.push(r);return t}const m1=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust"];function m4(n,e){return n.getAttribute(e)}function Wh(n,e){const t=v1(e);t.ns?n.hasAttributeNS(t.ns,t.local)&&n.removeAttributeNS(t.ns,t.local):n.hasAttribute(e)&&n.removeAttribute(e)}function Xh(n,e,t){if(t==null)return Wh(n,e);const r=v1(e);r.ns&&typeof t=="string"?n.setAttributeNS(r.ns,e,t):e==="id"?n.id=`${t}`:n.setAttribute(e,`${t}`)}function y1(n,e){Object.keys(e).forEach(t=>{Xh(n,t,e[t])})}function he(n,e,t){if(e==null){const r=n.attributes,i={};for(let s=0;s<r.length;s+=1)i[r[s].name]=r[s].value;return i}if(typeof e=="string"&&t===void 0)return n.getAttribute(e);typeof e=="object"?y1(n,e):Xh(n,e,t)}function v1(n){if(n.indexOf(":")!==-1){const e=n.split(":");return{ns:lt[e[0]],local:e[1]}}return{ns:null,local:n}}function ko(n){const e={};return Object.keys(n).forEach(t=>{const r=m1.includes(t)?t:Ub(t);e[r]=n[t]}),e}function Il(n){const e={};return n.split(";").forEach(r=>{const i=r.trim();if(i){const s=i.split("=");s.length&&(e[s[0].trim()]=s[1]?s[1].trim():"")}}),e}function Yh(n,e){return Object.keys(e).forEach(t=>{if(t==="class")n[t]=n[t]?`${n[t]} ${e[t]}`:e[t];else if(t==="style"){const r=typeof n[t]=="object",i=typeof e[t]=="object";let s,o;r&&i?(s=n[t],o=e[t]):r?(s=n[t],o=Il(e[t])):i?(s=Il(n[t]),o=e[t]):(s=Il(n[t]),o=Il(e[t])),n[t]=Yh(s,o)}else n[t]=e[t]}),n}function y4(n,e,t={}){const r=t.offset||0,i=[],s=[];let o,a,l=null;for(let c=0;c<n.length;c+=1){o=s[c]=n[c];for(let u=0,h=e.length;u<h;u+=1){const f=e[u],d=f.start+r,g=f.end+r;c>=d&&c<g&&(typeof o=="string"?o=s[c]={t:n[c],attrs:f.attrs}:o.attrs=Yh(Yh({},o.attrs),f.attrs),t.includeAnnotationIndices&&(o.annotations==null&&(o.annotations=[]),o.annotations.push(u)))}a=s[c-1],a?Ze(o)&&Ze(a)?(l=l,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?l.t+=o.t:(i.push(l),l=o)):Ze(o)||Ze(a)?(l=l,i.push(l),l=o):l=(l||"")+o:l=o}return l!=null&&i.push(l),i}function v4(n){return n.replace(/ /g," ")}var b1;(function(n){function e(c){const u="data:";return c.substr(0,u.length)===u}n.isDataUrl=e;function t(c,u){if(!c||e(c)){setTimeout(()=>u(null,c));return}const h=()=>{u(new Error(`Failed to load image: ${c}`))},f=window.FileReader?g=>{if(g.status===200){const p=new FileReader;p.onload=b=>{const m=b.target.result;u(null,m)},p.onerror=h,p.readAsDataURL(g.response)}else h()}:g=>{const p=b=>{const y=[];for(let v=0;v<b.length;v+=32768)y.push(String.fromCharCode.apply(null,b.subarray(v,v+32768)));return y.join("")};if(g.status===200){let b=c.split(".").pop()||"png";b==="svg"&&(b="svg+xml");const m=`data:image/${b};base64,`,y=new Uint8Array(g.response),v=m+btoa(p(y));u(null,v)}else h()},d=new XMLHttpRequest;d.responseType=window.FileReader?"blob":"arraybuffer",d.open("GET",c,!0),d.addEventListener("error",h),d.addEventListener("load",()=>f(d)),d.send()}n.imageToDataUri=t;function r(c){let u=c.replace(/\s/g,"");u=decodeURIComponent(u);const h=u.indexOf(","),f=u.slice(0,h),d=f.split(":")[1].split(";")[0],g=u.slice(h+1);let p;f.indexOf("base64")>=0?p=atob(g):p=unescape(encodeURIComponent(g));const b=new Uint8Array(p.length);for(let m=0;m<p.length;m+=1)b[m]=p.charCodeAt(m);return new Blob([b],{type:d})}n.dataUriToBlob=r;function i(c,u){const h=window.navigator.msSaveBlob;if(h)h(c,u);else{const f=window.URL.createObjectURL(c),d=document.createElement("a");d.href=f,d.download=u,document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(f)}}n.downloadBlob=i;function s(c,u){const h=r(c);i(h,u)}n.downloadDataUri=s;function o(c){const u=c.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return u&&u[2]?u[2].replace(/\s+/," ").split(" "):null}function a(c){const u=parseFloat(c);return Number.isNaN(u)?null:u}function l(c,u={}){let h=null;const f=v=>(h==null&&(h=o(c)),h!=null?a(h[v]):null),d=v=>{const w=c.match(v);return w&&w[2]?a(w[2]):null};let g=u.width;if(g==null&&(g=d(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),g==null&&(g=f(2)),g==null)throw new Error("Can not parse width from svg string");let p=u.height;if(p==null&&(p=d(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),p==null&&(p=f(3)),p==null)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(c).replace(/'/g,"%27").replace(/"/g,"%22")}`}n.svgToDataUrl=l})(b1||(b1={}));let wi;const b4={px(n){return n},mm(n){return wi*n},cm(n){return wi*n*10},in(n){return wi*n*25.4},pt(n){return wi*(25.4*n/72)},pc(n){return wi*(25.4*n/6)}};var w1;(function(n){function e(r,i,s){const o=document.createElement("div"),a=o.style;a.display="inline-block",a.position="absolute",a.left="-15000px",a.top="-15000px",a.width=r+(s||"px"),a.height=i+(s||"px"),document.body.appendChild(o);const l=o.getBoundingClientRect(),c={width:l.width||0,height:l.height||0};return document.body.removeChild(o),c}n.measure=e;function t(r,i){wi==null&&(wi=e("1","1","mm").width);const s=i?b4[i]:null;return s?s(r):r}n.toPx=t})(w1||(w1={}));const w4=/-(.)/g;function x4(n){return n.replace(w4,(e,t)=>t.toUpperCase())}const Kh={},x1=["webkit","ms","moz","o"],C1=document?document.createElement("div").style:{};function C4(n){for(let e=0;e<x1.length;e+=1){const t=x1[e]+n;if(t in C1)return t}return null}function S4(n){const e=x4(n);if(Kh[e]==null){const t=e.charAt(0).toUpperCase()+e.slice(1);Kh[e]=e in C1?e:C4(t)}return Kh[e]}function S1(n,e){const t=n.ownerDocument&&n.ownerDocument.defaultView&&n.ownerDocument.defaultView.opener?n.ownerDocument.defaultView.getComputedStyle(n,null):window.getComputedStyle(n,null);return t&&e?t.getPropertyValue(e)||t[e]:t}const P4={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function E4(n){return/^--/.test(n)}function Ll(n,e,t){const r=window.getComputedStyle(n,null);return t?r.getPropertyValue(e)||void 0:r[e]||n.style[e]}function Rl(n,e){return parseInt(Ll(n,e),10)||0}function A4(n,e){return!P4[n]&&typeof e=="number"?`${e}px`:e}function pe(n,e,t){if(typeof e=="string"){const r=E4(e);if(r||(e=S4(e)),t===void 0)return Ll(n,e,r);r||(t=A4(e,t));const i=n.style;r?i.setProperty(e,t):i[e]=t;return}for(const r in e)pe(n,r,e[r])}const jl=new WeakMap;function P1(n,e){const t=Al(e),r=jl.get(n);if(r)return r[t]}function T4(n,e,t){const r=Al(e),i=jl.get(n);i?i[r]=t:jl.set(n,{[r]:t})}function xi(n,e,t){if(!e){const r={};return Object.keys(jl).forEach(i=>{r[i]=P1(n,i)}),r}if(typeof e=="string"){if(t===void 0)return P1(n,e);T4(n,e,t);return}for(const r in e)xi(n,r,e[r])}const O4={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};function Jh(n,e,t){if(e){if(typeof e=="string"){if(e=O4[e]||e,arguments.length<3)return n[e];n[e]=t;return}for(const r in e)Jh(n,r,e[r])}}class ee{get[Symbol.toStringTag](){return ee.toStringTag}get type(){return this.node.nodeName}get id(){return this.node.id}set id(e){this.node.id=e}constructor(e,t,r){if(!e)throw new TypeError("Invalid element to create vector");let i;if(ee.isVector(e))i=e.node;else if(typeof e=="string")if(e.toLowerCase()==="svg")i=$l();else if(e[0]==="<"){const s=$l(e);i=document.importNode(s.firstChild,!0)}else i=document.createElementNS(lt.svg,e);else i=e;this.node=i,t&&this.setAttributes(t),r&&this.append(r)}transform(e,t){return e==null?ys(this.node):(ys(this.node,e,t),this)}translate(e,t=0,r={}){return e==null?$1(this.node):($1(this.node,e,t,r),this)}rotate(e,t,r,i={}){return e==null?ef(this.node):(ef(this.node,e,t,r,i),this)}scale(e,t){return e==null?tf(this.node):(tf(this.node,e,t),this)}getTransformToElement(e){const t=ee.toNode(e);return Lo(this.node,t)}removeAttribute(e){return Wh(this.node,e),this}getAttribute(e){return m4(this.node,e)}setAttribute(e,t){return Xh(this.node,e,t),this}setAttributes(e){return y1(this.node,e),this}attr(e,t){return e==null?he(this.node):typeof e=="string"&&t===void 0?he(this.node,e):(typeof e=="object"?he(this.node,e):he(this.node,e,t),this)}svg(){return this.node instanceof SVGSVGElement?this:ee.create(this.node.ownerSVGElement)}defs(){const e=this.svg()||this,t=e.node.getElementsByTagName("defs")[0];return t?ee.create(t):ee.create("defs").appendTo(e)}text(e,t={}){return T1(this.node,e,t),this}tagName(){return u4(this.node)}clone(){return ee.create(this.node.cloneNode(!0))}remove(){return er(this.node),this}empty(){return _o(this.node),this}append(e){return jn(this.node,ee.toNodes(e)),this}appendTo(e){return Ar(this.node,ee.isVector(e)?e.node:e),this}prepend(e){return g1(this.node,ee.toNodes(e)),this}before(e){return No(this.node,ee.toNodes(e)),this}replace(e){return this.node.parentNode&&this.node.parentNode.replaceChild(ee.toNode(e),this.node),ee.create(e)}first(){return this.node.firstChild?ee.create(this.node.firstChild):null}last(){return this.node.lastChild?ee.create(this.node.lastChild):null}get(e){const t=this.node.childNodes[e];return t?ee.create(t):null}indexOf(e){return Array.prototype.slice.call(this.node.childNodes).indexOf(ee.toNode(e))}find(e){const t=[],r=h4(this.node,e);if(r)for(let i=0,s=r.length;i<s;i+=1)t.push(ee.create(r[i]));return t}findOne(e){const t=f4(this.node,e);return t?ee.create(t):null}findParentByClass(e,t){const r=f1(this.node,e,t);return r?ee.create(r):null}matches(e){const t=this.node;this.node.matches;const r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector||null;return r&&r.call(t,e)}contains(e){return d1(this.node,ee.isVector(e)?e.node:e)}wrap(e){const t=ee.create(e),r=this.node.parentNode;return r!=null&&r.insertBefore(t.node,this.node),t.append(this)}parent(e){let t=this;if(t.node.parentNode==null)return null;if(t=ee.create(t.node.parentNode),e==null)return t;do if(typeof e=="string"?t.matches(e):t instanceof e)return t;while(t=ee.create(t.node.parentNode));return t}children(){const e=this.node.childNodes,t=[];for(let r=0;r<e.length;r+=1)e[r].nodeType===1&&t.push(ee.create(e[r]));return t}eachChild(e,t){const r=this.children();for(let i=0,s=r.length;i<s;i+=1)e.call(r[i],r[i],i,r),t&&r[i].eachChild(e,t);return this}index(){return Uh(this.node)}hasClass(e){return gs(this.node,e)}addClass(e){return J(this.node,e),this}removeClass(e){return gt(this.node,e),this}toggleClass(e,t){return l1(this.node,e,t),this}toLocalPoint(e,t){return Y4(this.node,e,t)}sample(e=1){return this.node instanceof SVGPathElement?$4(this.node,e):[]}toPath(){return ee.create(z4(this.node))}toPathData(){return N1(this.node)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(o){if(o==null)return!1;if(o instanceof n)return!0;const a=o[Symbol.toStringTag],l=o;return(a==null||a===n.toStringTag)&&l.node instanceof SVGElement&&typeof l.sample=="function"&&typeof l.toPath=="function"}n.isVector=e;function t(o,a,l){return new n(o,a,l)}n.create=t;function r(o){if(o[0]==="<"){const a=$l(o),l=[];for(let c=0,u=a.childNodes.length;c<u;c+=1){const h=a.childNodes[c];l.push(t(document.importNode(h,!0)))}return l}return[t(o)]}n.createVectors=r;function i(o){return e(o)?o.node:o}n.toNode=i;function s(o){return Array.isArray(o)?o.map(a=>i(a)):[i(o)]}n.toNodes=s})(ee||(ee={}));const E1=document.createElement("canvas").getContext("2d");function M4(n,e){const t=ee.create(e),r=ee.create("textPath"),i=n.d;if(i&&n["xlink:href"]===void 0){const s=ee.create("path").attr("d",i).appendTo(t.defs());r.attr("xlink:href",`#${s.id}`)}return typeof n=="object"&&r.attr(n),r.node}function _4(n,e,t){const r=t.eol,i=t.baseSize,s=t.lineHeight;let o=0,a;const l={},c=e.length-1;for(let u=0;u<=c;u+=1){let h=e[u],f=null;if(typeof h=="object"){const d=h.attrs,g=ee.create("tspan",d);a=g.node;let p=h.t;r&&u===c&&(p+=r),a.textContent=p;const b=d.class;b&&g.addClass(b),t.includeAnnotationIndices&&g.attr("annotations",h.annotations.join(",")),f=parseFloat(d["font-size"]),f===void 0&&(f=i),f&&f>o&&(o=f)}else r&&u===c&&(h+=r),a=document.createTextNode(h||" "),i&&i>o&&(o=i);n.appendChild(a)}return o&&(l.maxFontSize=o),s?l.lineHeight=s:o&&(l.lineHeight=o*1.2),l}const A1=/em$/;function Dl(n,e){const t=parseFloat(n);return A1.test(n)?t*e:t}function N4(n,e,t,r){if(!Array.isArray(e))return 0;const i=e.length;if(!i)return 0;let s=e[0];const o=Dl(s.maxFontSize,t)||t;let a=0;const l=Dl(r,t);for(let h=1;h<i;h+=1){s=e[h];const f=Dl(s.lineHeight,t)||l;a+=f}const c=Dl(s.maxFontSize,t)||t;let u;switch(n){case"middle":u=o/2-.15*c-a/2;break;case"bottom":u=-(.25*c)-a;break;case"top":default:u=.8*o;break}return u}function T1(n,e,t={}){e=v4(e);const r=t.eol;let i=t.textPath;const s=t.textVerticalAnchor,o=s==="middle"||s==="bottom"||s==="top";let a=t.x;a===void 0&&(a=n.getAttribute("x")||0);const l=t.includeAnnotationIndices;let c=t.annotations;c&&!Array.isArray(c)&&(c=[c]);const u=t.lineHeight,h=u==="auto",f=h?"1.5em":u||"1em";let d=!0;const g=n.childNodes;if(g.length===1){const A=g[0];A&&A.tagName.toUpperCase()==="TITLE"&&(d=!1)}d&&_o(n),he(n,{"xml:space":"preserve",display:e||t.displayEmpty?null:"none"});const p=he(n,"font-size");let b=parseFloat(p);b||(b=16,(o||c)&&!p&&he(n,"font-size",`${b}`));let m;i?(typeof i=="string"&&(i={d:i}),m=M4(i,n)):m=document.createDocumentFragment();let y,v=0,w;const x=e.split(`
2
- `),C=[],S=x.length-1;for(let A=0;A<=S;A+=1){y=f;let O="v-line";const T=Zn("tspan");let I,G=x[A];if(G)if(c){const Y=y4(G,c,{offset:-v,includeAnnotationIndices:l});I=_4(T,Y,{eol:A!==S&&r,baseSize:b,lineHeight:h?null:f,includeAnnotationIndices:l});const M=I.lineHeight;M&&h&&A!==0&&(y=M),A===0&&(w=I.maxFontSize*.8)}else r&&A!==S&&(G+=r),T.textContent=G;else{T.textContent="-",O+=" v-empty-line";const Y=T.style;Y.fillOpacity=0,Y.strokeOpacity=0,c&&(I={})}I&&C.push(I),A>0&&T.setAttribute("dy",y),(A>0||i)&&T.setAttribute("x",a),T.className.baseVal=O,m.appendChild(T),v+=G.length+1}if(o)if(c)y=N4(s,C,b,f);else if(s==="top")y="0.8em";else{let A;switch(S>0?(A=parseFloat(f)||1,A*=S,A1.test(f)||(A/=b)):A=0,s){case"middle":y=`${.3-A/2}em`;break;case"bottom":y=`${-A-.3}em`;break}}else s===0?y="0em":s?y=s:(y=0,n.getAttribute("y")==null&&n.setAttribute("y",`${w||"0.8em"}`));m.firstChild.setAttribute("dy",y),n.appendChild(m)}function $o(n,e={}){if(!n)return{width:0};const t=[],r=e["font-size"]?`${parseFloat(e["font-size"])}px`:"14px";return t.push(e["font-style"]||"normal"),t.push(e["font-variant"]||"normal"),t.push(e["font-weight"]||400),t.push(r),t.push(e["font-family"]||"sans-serif"),E1.font=t.join(" "),E1.measureText(n)}function O1(n,e,t,r={}){if(e>=t)return[n,""];const i=n.length,s={};let o=Math.round(e/t*i-1);for(o<0&&(o=0);o>=0&&o<i;){const a=n.slice(0,o),l=s[a]||$o(a,r).width,c=n.slice(0,o+1),u=s[c]||$o(c,r).width;if(s[a]=l,s[c]=u,l>e)o-=1;else if(u<=e)o+=1;else break}return[n.slice(0,o),n.slice(o)]}function k4(n,e,t={},r={}){const i=e.width,s=e.height,o=r.eol||`
3
- `,{width:a}=$o(n,t);if(a<i)return n;const l=[],c=t.fontSize||14,u=t.lineHeight?parseFloat(t.lineHeight):Math.ceil(c*1.4),h=Math.floor(s/u);let f=n,d=a,g=r.ellipsis,p=0;g&&(typeof g!="string"&&(g="…"),p=$o(g,t).width);for(let b=0;b<h;b+=1)if(d>i)if(b===h-1){const[y]=O1(f,i-p,d,t);l.push(g?`${y}${g}`:y)}else{const[y,v]=O1(f,i,d,t);l.push(y),f=v,d=$o(f,t).width}else{l.push(f);break}return l.join(o)}const Qh=.551784;function pt(n,e,t=NaN){const r=n.getAttribute(e);if(r==null)return t;const i=parseFloat(r);return Number.isNaN(i)?t:i}function $4(n,e=1){const t=n.getTotalLength(),r=[];let i=0,s;for(;i<t;)s=n.getPointAtLength(i),r.push({distance:i,x:s.x,y:s.y}),i+=e;return r}function I4(n){return["M",pt(n,"x1"),pt(n,"y1"),"L",pt(n,"x2"),pt(n,"y2")].join(" ")}function L4(n){const e=Bl(n);return e.length===0?null:`${M1(e)} Z`}function R4(n){const e=Bl(n);return e.length===0?null:M1(e)}function M1(n){return`M ${n.map(t=>`${t.x} ${t.y}`).join(" L")}`}function Bl(n){const e=[],t=n.points;if(t)for(let r=0,i=t.numberOfItems;r<i;r+=1)e.push(t.getItem(r));return e}function j4(n){const e=pt(n,"cx",0),t=pt(n,"cy",0),r=pt(n,"r"),i=r*Qh;return["M",e,t-r,"C",e+i,t-r,e+r,t-i,e+r,t,"C",e+r,t+i,e+i,t+r,e,t+r,"C",e-i,t+r,e-r,t+i,e-r,t,"C",e-r,t-i,e-i,t-r,e,t-r,"Z"].join(" ")}function D4(n){const e=pt(n,"cx",0),t=pt(n,"cy",0),r=pt(n,"rx"),i=pt(n,"ry")||r,s=r*Qh,o=i*Qh;return["M",e,t-i,"C",e+s,t-i,e+r,t-o,e+r,t,"C",e+r,t+o,e+s,t+i,e,t+i,"C",e-s,t+i,e-r,t+o,e-r,t,"C",e-r,t-o,e-s,t-i,e,t-i,"Z"].join(" ")}function B4(n){return _1({x:pt(n,"x",0),y:pt(n,"y",0),width:pt(n,"width",0),height:pt(n,"height",0),rx:pt(n,"rx",0),ry:pt(n,"ry",0)})}function _1(n){let e;const t=n.x,r=n.y,i=n.width,s=n.height,o=Math.min(n.rx||n["top-rx"]||0,i/2),a=Math.min(n.rx||n["bottom-rx"]||0,i/2),l=Math.min(n.ry||n["top-ry"]||0,s/2),c=Math.min(n.ry||n["bottom-ry"]||0,s/2);return o||a||l||c?e=["M",t,r+l,"v",s-l-c,"a",a,c,0,0,0,a,c,"h",i-2*a,"a",a,c,0,0,0,a,-c,"v",-(s-c-l),"a",o,l,0,0,0,-o,-l,"h",-(i-2*o),"a",o,l,0,0,0,-o,l,"Z"]:e=["M",t,r,"H",t+i,"V",r+s,"H",t,"V",r,"Z"],e.join(" ")}function z4(n){const e=Zn("path");he(e,he(n));const t=N1(n);return t&&e.setAttribute("d",t),e}function N1(n){const e=n.tagName.toLowerCase();switch(e){case"path":return n.getAttribute("d");case"line":return I4(n);case"polygon":return L4(n);case"polyline":return R4(n);case"ellipse":return D4(n);case"circle":return j4(n);case"rect":return B4(n)}throw new Error(`"${e}" cannot be converted to svg path element.`)}const zl=Zn("svg"),F4=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,k1=/[ ,]+/,V4=/^(\w+)\((.*)\)/;function q4(n,e){const t=zl.createSVGPoint();return t.x=n,t.y=e,t}function ct(n){const e=zl.createSVGMatrix();if(n!=null){const t=n,r=e;for(const i in t)r[i]=t[i]}return e}function Io(n){return n!=null?(n instanceof DOMMatrix||(n=ct(n)),zl.createSVGTransformFromMatrix(n)):zl.createSVGTransform()}function ps(n){let e=ct();const t=n!=null&&n.match(F4);if(!t)return e;for(let r=0,i=t.length;r<i;r+=1){const o=t[r].match(V4);if(o){let a,l,c,u,h,f=ct();const d=o[2].split(k1);switch(o[1].toLowerCase()){case"scale":a=parseFloat(d[0]),l=d[1]===void 0?a:parseFloat(d[1]),f=f.scaleNonUniform(a,l);break;case"translate":c=parseFloat(d[0]),u=parseFloat(d[1]),f=f.translate(c,u);break;case"rotate":h=parseFloat(d[0]),c=parseFloat(d[1])||0,u=parseFloat(d[2])||0,c!==0||u!==0?f=f.translate(c,u).rotate(h).translate(-c,-u):f=f.rotate(h);break;case"skewx":h=parseFloat(d[0]),f=f.skewX(h);break;case"skewy":h=parseFloat(d[0]),f=f.skewY(h);break;case"matrix":f.a=parseFloat(d[0]),f.b=parseFloat(d[1]),f.c=parseFloat(d[2]),f.d=parseFloat(d[3]),f.e=parseFloat(d[4]),f.f=parseFloat(d[5]);break;default:continue}e=e.multiply(f)}}return e}function ms(n){const e=n||{},t=e.a!=null?e.a:1,r=e.b!=null?e.b:0,i=e.c!=null?e.c:0,s=e.d!=null?e.d:1,o=e.e!=null?e.e:0,a=e.f!=null?e.f:0;return`matrix(${t},${r},${i},${s},${o},${a})`}function Fl(n){let e,t,r;if(n){const s=k1;if(n.trim().indexOf("matrix")>=0){const o=ps(n),a=G4(o);e=[a.translateX,a.translateY],t=[a.rotation],r=[a.scaleX,a.scaleY];const l=[];(e[0]!==0||e[1]!==0)&&l.push(`translate(${e.join(",")})`),(r[0]!==1||r[1]!==1)&&l.push(`scale(${r.join(",")})`),t[0]!==0&&l.push(`rotate(${t[0]})`),n=l.join(" ")}else{const o=n.match(/translate\((.*?)\)/);o&&(e=o[1].split(s));const a=n.match(/rotate\((.*?)\)/);a&&(t=a[1].split(s));const l=n.match(/scale\((.*?)\)/);l&&(r=l[1].split(s))}}const i=r&&r[0]?parseFloat(r[0]):1;return{raw:n||"",translation:{tx:e&&e[0]?parseInt(e[0],10):0,ty:e&&e[1]?parseInt(e[1],10):0},rotation:{angle:t&&t[0]?parseInt(t[0],10):0,cx:t&&t[1]?parseInt(t[1],10):void 0,cy:t&&t[2]?parseInt(t[2],10):void 0},scale:{sx:i,sy:r&&r[1]?parseFloat(r[1]):i}}}function Zh(n,e){const t=e.x*n.a+e.y*n.c+0,r=e.x*n.b+e.y*n.d+0;return{x:t,y:r}}function G4(n){const e=Zh(n,{x:0,y:1}),t=Zh(n,{x:1,y:0}),r=180/Math.PI*Math.atan2(e.y,e.x)-90,i=180/Math.PI*Math.atan2(t.y,t.x);return{skewX:r,skewY:i,translateX:n.e,translateY:n.f,scaleX:Math.sqrt(n.a*n.a+n.b*n.b),scaleY:Math.sqrt(n.c*n.c+n.d*n.d),rotation:r}}function H4(n){let e,t,r,i;return n?(e=n.a==null?1:n.a,i=n.d==null?1:n.d,t=n.b,r=n.c):e=i=1,{sx:t?Math.sqrt(e*e+t*t):e,sy:r?Math.sqrt(r*r+i*i):i}}function U4(n){let e={x:0,y:1};n&&(e=Zh(n,e));const t=180*Math.atan2(e.y,e.x)/Math.PI%360-90;return{angle:t%360+(t<0?360:0)}}function W4(n){return{tx:n&&n.e||0,ty:n&&n.f||0}}function ys(n,e,t={}){if(e==null)return ps(he(n,"transform"));if(t.absolute){n.setAttribute("transform",ms(e));return}const r=n.transform,i=Io(e);r.baseVal.appendItem(i)}function $1(n,e,t=0,r={}){let i=he(n,"transform");const s=Fl(i);if(e==null)return s.translation;i=s.raw,i=i.replace(/translate\([^)]*\)/g,"").trim();const o=r.absolute?e:s.translation.tx+e,a=r.absolute?t:s.translation.ty+t,l=`translate(${o},${a})`;n.setAttribute("transform",`${l} ${i}`.trim())}function ef(n,e,t,r,i={}){let s=he(n,"transform");const o=Fl(s);if(e==null)return o.rotation;s=o.raw,s=s.replace(/rotate\([^)]*\)/g,"").trim(),e%=360;const a=i.absolute?e:o.rotation.angle+e,l=t!=null&&r!=null?`,${t},${r}`:"",c=`rotate(${a}${l})`;n.setAttribute("transform",`${s} ${c}`.trim())}function tf(n,e,t){let r=he(n,"transform");const i=Fl(r);if(e==null)return i.scale;t=t==null?e:t,r=i.raw,r=r.replace(/scale\([^)]*\)/g,"").trim();const s=`scale(${e},${t})`;n.setAttribute("transform",`${r} ${s}`.trim())}function Lo(n,e){if(Er(e)&&Er(n)){const t=e.getScreenCTM(),r=n.getScreenCTM();if(t&&r)return t.inverse().multiply(r)}return ct()}function X4(n,e){let t=ct();if(Er(e)&&Er(n)){let r=n;const i=[];for(;r&&r!==e;){const s=r.getAttribute("transform")||null,o=ps(s);i.push(o),r=r.parentNode}i.reverse().forEach(s=>{t=t.multiply(s)})}return t}function Y4(n,e,t){const r=n instanceof SVGSVGElement?n:n.ownerSVGElement,i=r.createSVGPoint();i.x=e,i.y=t;try{const s=r.getScreenCTM(),o=i.matrixTransform(s.inverse()),a=Lo(n,r).inverse();return o.matrixTransform(a)}catch(s){return i}}var nn;(function(n){const e={};function t(s){return e[s]||{}}n.get=t;function r(s,o){e[s]=o}n.register=r;function i(s){delete e[s]}n.unregister=i})(nn||(nn={}));var Ci;(function(n){const e=new WeakMap;function t(s){return e.has(s)||e.set(s,{events:Object.create(null)}),e.get(s)}n.ensure=t;function r(s){return e.get(s)}n.get=r;function i(s){return e.delete(s)}n.remove=i})(Ci||(Ci={}));var ie;(function(n){n.returnTrue=()=>!0,n.returnFalse=()=>!1;function e(i){i.stopPropagation()}n.stopPropagationCallback=e;function t(i,s,o){i.addEventListener!=null&&i.addEventListener(s,o)}n.addEventListener=t;function r(i,s,o){i.removeEventListener!=null&&i.removeEventListener(s,o)}n.removeEventListener=r})(ie||(ie={})),function(n){const e=/[^\x20\t\r\n\f]+/g,t=/^([^.]*)(?:\.(.+)|)/;function r(a){return(a||"").match(e)||[""]}n.splitType=r;function i(a){const l=t.exec(a)||[];return{originType:l[1]?l[1].trim():l[1],namespaces:l[2]?l[2].split(".").map(c=>c.trim()).sort():[]}}n.normalizeType=i;function s(a){return a.nodeType===1||a.nodeType===9||!+a.nodeType}n.isValidTarget=s;function o(a,l){if(l){const c=a;return c.querySelector!=null&&c.querySelector(l)!=null}return!0}n.isValidSelector=o}(ie||(ie={})),function(n){let e=0;const t=new WeakMap;function r(a){return t.has(a)||(t.set(a,e),e+=1),t.get(a)}n.ensureHandlerId=r;function i(a){return t.get(a)}n.getHandlerId=i;function s(a){return t.delete(a)}n.removeHandlerId=s;function o(a,l){return t.set(a,l)}n.setHandlerId=o}(ie||(ie={})),function(n){function e(t,r){const i=[],s=Ci.get(t),o=s&&s.events&&s.events[r.type],a=o&&o.handlers||[],l=o?o.delegateCount:0;if(l>0&&!(r.type==="click"&&typeof r.button=="number"&&r.button>=1)){for(let c=r.target;c!==t;c=c.parentNode||t)if(c.nodeType===1&&!(r.type==="click"&&c.disabled===!0)){const u=[],h={};for(let f=0;f<l;f+=1){const d=a[f],g=d.selector;if(g!=null&&h[g]==null){const p=t,b=[];p.querySelectorAll(g).forEach(m=>{b.push(m)}),h[g]=b.includes(c)}h[g]&&u.push(d)}u.length&&i.push({elem:c,handlers:u})}}return l<a.length&&i.push({elem:t,handlers:a.slice(l)}),i}n.getHandlerQueue=e}(ie||(ie={})),function(n){function e(t){return t!=null&&t===t.window}n.isWindow=e}(ie||(ie={})),function(n){function e(t,r){const i=t.nodeType===9?t.documentElement:t,s=r&&r.parentNode;return t===s||!!(s&&s.nodeType===1&&(i.contains?i.contains(s):t.compareDocumentPosition&&t.compareDocumentPosition(s)&16))}n.contains=e}(ie||(ie={}));class Dn{constructor(e,t){this.isDefaultPrevented=ie.returnFalse,this.isPropagationStopped=ie.returnFalse,this.isImmediatePropagationStopped=ie.returnFalse,this.isSimulated=!1,this.preventDefault=()=>{const r=this.originalEvent;this.isDefaultPrevented=ie.returnTrue,r&&!this.isSimulated&&r.preventDefault()},this.stopPropagation=()=>{const r=this.originalEvent;this.isPropagationStopped=ie.returnTrue,r&&!this.isSimulated&&r.stopPropagation()},this.stopImmediatePropagation=()=>{const r=this.originalEvent;this.isImmediatePropagationStopped=ie.returnTrue,r&&!this.isSimulated&&r.stopImmediatePropagation(),this.stopPropagation()},typeof e=="string"?this.type=e:e.type&&(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?ie.returnTrue:ie.returnFalse,this.target=e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget,this.timeStamp=e.timeStamp),t&&Object.assign(this,t),this.timeStamp||(this.timeStamp=Date.now())}}(function(n){function e(t){return t instanceof n?t:new n(t)}n.create=e})(Dn||(Dn={})),function(n){function e(t,r){Object.defineProperty(n.prototype,t,{enumerable:!0,configurable:!0,get:typeof r=="function"?function(){if(this.originalEvent)return r(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set(i){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:i})}})}n.addProperty=e}(Dn||(Dn={})),function(n){const e={bubbles:!0,cancelable:!0,eventPhase:!0,detail:!0,view:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pageX:!0,pageY:!0,screenX:!0,screenY:!0,toElement:!0,pointerId:!0,pointerType:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,touches:!0,changedTouches:!0,targetTouches:!0,which:!0,altKey:!0,ctrlKey:!0,metaKey:!0,shiftKey:!0};Object.keys(e).forEach(t=>n.addProperty(t,e[t]))}(Dn||(Dn={})),function(n){nn.register("load",{noBubble:!0})}(),function(n){nn.register("beforeunload",{postDispatch(e,t){t.result!==void 0&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}})}(),function(n){nn.register("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(e,t){let r;const i=t.relatedTarget,s=t.handleObj;return(!i||i!==e&&!ie.contains(e,i))&&(t.type=s.originType,r=s.handler.call(e,t),t.type="mouseover"),r}}),nn.register("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(e,t){let r;const i=t.relatedTarget,s=t.handleObj;return(!i||i!==e&&!ie.contains(e,i))&&(t.type=s.originType,r=s.handler.call(e,t),t.type="mouseout"),r}})}();var K4=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},Ro;(function(n){let e;function t(o,a,l,c,u){if(!ie.isValidTarget(o))return;let h;if(typeof l!="function"){const{handler:p,selector:b}=l,m=K4(l,["handler","selector"]);l=p,u=b,h=m}const f=Ci.ensure(o);let d=f.handler;d==null&&(d=f.handler=function(p,...b){return e!==p.type?i(o,p,...b):void 0});const g=ie.ensureHandlerId(l);ie.splitType(a).forEach(p=>{const{originType:b,namespaces:m}=ie.normalizeType(p);if(!b)return;let y=b,v=nn.get(y);y=(u?v.delegateType:v.bindType)||y,v=nn.get(y);const w=Object.assign({type:y,originType:b,data:c,selector:u,guid:g,handler:l,namespace:m.join(".")},h),x=f.events;let C=x[y];C||(C=x[y]={handlers:[],delegateCount:0},(!v.setup||v.setup(o,c,m,d)===!1)&&ie.addEventListener(o,y,d)),v.add&&(ie.removeHandlerId(w.handler),v.add(o,w),ie.setHandlerId(w.handler,g)),u?(C.handlers.splice(C.delegateCount,0,w),C.delegateCount+=1):C.handlers.push(w)})}n.on=t;function r(o,a,l,c,u){const h=Ci.get(o);if(!h)return;const f=h.events;f&&(ie.splitType(a).forEach(d=>{const{originType:g,namespaces:p}=ie.normalizeType(d);if(!g){Object.keys(f).forEach(x=>{r(o,x+d,l,c,!0)});return}let b=g;const m=nn.get(b);b=(c?m.delegateType:m.bindType)||b;const y=f[b]||{},v=p.length>0?new RegExp(`(^|\\.)${p.join("\\.(?:.*\\.|)")}(\\.|$)`):null,w=y.handlers.length;for(let x=y.handlers.length-1;x>=0;x-=1){const C=y.handlers[x];(u||g===C.originType)&&(!l||ie.getHandlerId(l)===C.guid)&&(v==null||C.namespace&&v.test(C.namespace))&&(c==null||c===C.selector||c==="**"&&C.selector)&&(y.handlers.splice(x,1),C.selector&&(y.delegateCount-=1),m.remove&&m.remove(o,C))}w&&y.handlers.length===0&&((!m.teardown||m.teardown(o,p,h.handler)===!1)&&ie.removeEventListener(o,b,h.handler),delete f[b])}),Object.keys(f).length===0&&Ci.remove(o))}n.off=r;function i(o,a,...l){const c=Dn.create(a);c.delegateTarget=o;const u=nn.get(c.type);if(u.preDispatch&&u.preDispatch(o,c)===!1)return;const h=ie.getHandlerQueue(o,c);for(let f=0,d=h.length;f<d&&!c.isPropagationStopped();f+=1){const g=h[f];c.currentTarget=g.elem;for(let p=0,b=g.handlers.length;p<b&&!c.isImmediatePropagationStopped();p+=1){const m=g.handlers[p];if(c.rnamespace==null||m.namespace&&c.rnamespace.test(m.namespace)){c.handleObj=m,c.data=m.data;const y=nn.get(m.originType).handle,v=y?y(g.elem,c,...l):m.handler.call(g.elem,c,...l);v!==void 0&&(c.result=v,v===!1&&(c.preventDefault(),c.stopPropagation()))}}}return u.postDispatch&&u.postDispatch(o,c),c.result}n.dispatch=i;function s(o,a,l,c){let u=o,h=typeof o=="string"?o:o.type,f=typeof o=="string"||u.namespace==null?[]:u.namespace.split(".");const d=l;if(d.nodeType===3||d.nodeType===8)return;h.indexOf(".")>-1&&(f=h.split("."),h=f.shift(),f.sort());const g=h.indexOf(":")<0&&`on${h}`;u=o instanceof Dn?o:new Dn(h,typeof o=="object"?o:null),u.namespace=f.join("."),u.rnamespace=u.namespace?new RegExp(`(^|\\.)${f.join("\\.(?:.*\\.|)")}(\\.|$)`):null,u.result=void 0,u.target||(u.target=d);const p=[u];Array.isArray(a)?p.push(...a):p.push(a);const b=nn.get(h);if(!c&&b.trigger&&b.trigger(d,u,a)===!1)return;let m;const y=[d];if(!c&&!b.noBubble&&!ie.isWindow(d)){m=b.delegateType||h;let w=d,x=d.parentNode;for(;x!=null;)y.push(x),w=x,x=x.parentNode;const C=d.ownerDocument||document;if(w===C){const S=w.defaultView||w.parentWindow||window;y.push(S)}}let v=d;for(let w=0,x=y.length;w<x&&!u.isPropagationStopped();w+=1){const C=y[w];v=C,u.type=w>1?m:b.bindType||h;const S=Ci.get(C);S&&S.events[u.type]&&S.handler&&S.handler.call(C,...p);const E=g&&C[g]||null;E&&ie.isValidTarget(C)&&(u.result=E.call(C,...p),u.result===!1&&u.preventDefault())}if(u.type=h,!c&&!u.isDefaultPrevented()){const w=b.preventDefault;if((w==null||w(y.pop(),u,a)===!1)&&ie.isValidTarget(d)&&g&&typeof d[h]=="function"&&!ie.isWindow(d)){const x=d[g];x&&(d[g]=null),e=h,u.isPropagationStopped()&&v.addEventListener(h,ie.stopPropagationCallback),d[h](),u.isPropagationStopped()&&v.removeEventListener(h,ie.stopPropagationCallback),e=void 0,x&&(d[g]=x)}}return u.result}n.trigger=s})(Ro||(Ro={}));var Se;(function(n){function e(s,o,a,l,c){return jo.on(s,o,a,l,c),s}n.on=e;function t(s,o,a,l,c){return jo.on(s,o,a,l,c,!0),s}n.once=t;function r(s,o,a,l){return jo.off(s,o,a,l),s}n.off=r;function i(s,o,a,l){return Ro.trigger(o,a,s,l),s}n.trigger=i})(Se||(Se={}));var jo;(function(n){function e(r,i,s,o,a,l){if(typeof i=="object"){typeof s!="string"&&(o=o||s,s=void 0),Object.keys(i).forEach(c=>e(r,c,s,o,i[c],l));return}if(o==null&&a==null?(a=s,o=s=void 0):a==null&&(typeof s=="string"?(a=o,o=void 0):(a=o,o=s,s=void 0)),a===!1)a=ie.returnFalse;else if(!a)return;if(l){const c=a;a=function(u,...h){return n.off(r,u),c.call(this,u,...h)},ie.setHandlerId(a,ie.ensureHandlerId(c))}Ro.on(r,i,a,o,s)}n.on=e;function t(r,i,s,o){const a=i;if(a&&a.preventDefault!=null&&a.handleObj!=null){const l=a.handleObj;t(a.delegateTarget,l.namespace?`${l.originType}.${l.namespace}`:l.originType,l.selector,l.handler);return}if(typeof i=="object"){const l=i;Object.keys(l).forEach(c=>t(r,c,s,l[c]));return}(s===!1||typeof s=="function")&&(o=s,s=void 0),o===!1&&(o=ie.returnFalse),Ro.off(r,i,o,s)}n.off=t})(jo||(jo={}));class I1{constructor(e,t,r){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=tn.isEventSupported("wheel")?"wheel":"mousewheel",this.target=e,this.onWheelCallback=t,this.onWheelGuard=r,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){this.target.addEventListener(this.eventName,this.onWheel,{passive:!1})}disable(){this.target.removeEventListener(this.eventName,this.onWheel)}onWheel(e){if(this.onWheelGuard!=null&&!this.onWheelGuard(e))return;this.deltaX+=e.deltaX,this.deltaY+=e.deltaY,e.preventDefault();let t;(this.deltaX!==0||this.deltaY!==0)&&(e.stopPropagation(),t=!0),t===!0&&this.animationFrameId===0&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(e)}))}didWheel(e){this.animationFrameId=0,this.onWheelCallback(e,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function Do(n){const e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView;return{top:e.top+t.pageYOffset,left:e.left+t.pageXOffset}}function J4(n){return n.getBoundingClientRect().width}function Q4(n){return n.getBoundingClientRect().height}function Z4(n){const e=Ll(n,"position")==="fixed";let t;if(e){const r=n.getBoundingClientRect();t={left:r.left,top:r.top}}else t=Do(n);if(!e){const r=n.ownerDocument;let i=n.offsetParent||r.documentElement;for(;(i===r.body||i===r.documentElement)&&Ll(i,"position")==="static";)i=i.parentNode;if(i!==n&&g4(i)){const s=Do(i);t.top-=s.top+Rl(i,"borderTopWidth"),t.left-=s.left+Rl(i,"borderLeftWidth")}}return{top:t.top-Rl(n,"marginTop"),left:t.left-Rl(n,"marginLeft")}}function L1(n,e=60){let t=null;return(...r)=>{t&&clearTimeout(t),t=window.setTimeout(()=>{n.apply(this,r)},e)}}function e6(n){let e=null,t=[];const r=()=>{if(getComputedStyle(n).position==="static"){const c=n.style;c.position="relative"}const l=document.createElement("object");return l.onload=()=>{l.contentDocument.defaultView.addEventListener("resize",i),i()},l.style.display="block",l.style.position="absolute",l.style.top="0",l.style.left="0",l.style.height="100%",l.style.width="100%",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="-1",l.style.opacity="0",l.setAttribute("tabindex","-1"),l.type="text/html",n.appendChild(l),l.data="about:blank",l},i=L1(()=>{t.forEach(l=>l(n))}),s=l=>{e||(e=r()),t.indexOf(l)===-1&&t.push(l)},o=()=>{e&&e.parentNode&&(e.contentDocument&&e.contentDocument.defaultView.removeEventListener("resize",i),e.parentNode.removeChild(e),e=null,t=[])};return{element:n,bind:s,destroy:o,unbind:l=>{const c=t.indexOf(l);c!==-1&&t.splice(c,1),t.length===0&&e&&o()}}}function t6(n){let e=null,t=[];const r=L1(()=>{t.forEach(l=>{l(n)})}),i=()=>{const l=new ResizeObserver(r);return l.observe(n),r(),l},s=l=>{e||(e=i()),t.indexOf(l)===-1&&t.push(l)},o=()=>{e&&(e.disconnect(),t=[],e=null)};return{element:n,bind:s,destroy:o,unbind:l=>{const c=t.indexOf(l);c!==-1&&t.splice(c,1),t.length===0&&e&&o()}}}const n6=typeof ResizeObserver!="undefined"?t6:e6;var Vl;(function(n){const e=new WeakMap;function t(i){let s=e.get(i);return s||(s=n6(i),e.set(i,s),s)}function r(i){i.destroy(),e.delete(i.element)}n.bind=(i,s)=>{const o=t(i);return o.bind(s),()=>o.unbind(s)},n.clear=i=>{const s=t(i);r(s)}})(Vl||(Vl={}));class Bo{constructor(e={}){this.comparator=e.comparator||Bo.defaultComparator,this.index={},this.data=e.data||[],this.heapify()}isEmpty(){return this.data.length===0}insert(e,t,r){const i={priority:e,value:t},s=this.data.length;return r&&(i.id=r,this.index[r]=s),this.data.push(i),this.bubbleUp(s),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(e,t){const r=this.index[e];if(typeof r=="undefined")throw new Error(`Node with id '${e}' was not found in the heap.`);const i=this.data,s=i[r].priority,o=this.comparator(t,s);o<0?(i[r].priority=t,this.bubbleUp(r)):o>0&&(i[r].priority=t,this.bubbleDown(r))}remove(){const e=this.data,t=e[0],r=e.pop();return t.id&&delete this.index[t.id],e.length>0&&(e[0]=r,r.id&&(this.index[r.id]=0),this.bubbleDown(0)),t?t.value:null}heapify(){for(let e=0;e<this.data.length;e+=1)this.bubbleUp(e)}bubbleUp(e){const t=this.data;let r,i,s=e;for(;s>0&&(i=s-1>>>1,this.comparator(t[s].priority,t[i].priority)<0);){r=t[i],t[i]=t[s];let o=t[s].id;o!=null&&(this.index[o]=i),t[s]=r,o=t[s].id,o!=null&&(this.index[o]=s),s=i}}bubbleDown(e){const t=this.data,r=t.length-1;let i=e;for(;;){const s=(i<<1)+1,o=s+1;let a=i;if(s<=r&&this.comparator(t[s].priority,t[a].priority)<0&&(a=s),o<=r&&this.comparator(t[o].priority,t[a].priority)<0&&(a=o),a!==i){const l=t[a];t[a]=t[i];let c=t[i].id;c!=null&&(this.index[c]=a),t[i]=l,c=t[i].id,c!=null&&(this.index[c]=i),i=a}else break}}}(function(n){n.defaultComparator=(e,t)=>e-t})(Bo||(Bo={}));var nf;(function(n){function e(t,r,i=(s,o)=>1){const s={},o={},a={},l=new Bo;for(s[r]=0,Object.keys(t).forEach(c=>{c!==r&&(s[c]=1/0),l.insert(s[c],c,c)});!l.isEmpty();){const c=l.remove();a[c]=!0;const u=t[c]||[];for(let h=0;h<u.length;h+=1){const f=u[h];if(!a[f]){const d=s[c]+i(c,f);d<s[f]&&(s[f]=d,o[f]=c,l.updatePriority(f,d))}}}return o}n.run=e})(nf||(nf={}));class tr{constructor(e,t,r,i){if(e==null)return this.set(255,255,255,1);if(typeof e=="number")return this.set(e,t,r,i);if(typeof e=="string")return tr.fromString(e)||this;if(Array.isArray(e))return this.set(e);this.set(e.r,e.g,e.b,e.a==null?1:e.a)}blend(e,t,r){this.set(e.r+(t.r-e.r)*r,e.g+(t.g-e.g)*r,e.b+(t.b-e.b)*r,e.a+(t.a-e.a)*r)}lighten(e){const t=tr.lighten(this.toArray(),e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}darken(e){this.lighten(-e)}set(e,t,r,i){const s=Array.isArray(e)?e[0]:e,o=Array.isArray(e)?e[1]:t,a=Array.isArray(e)?e[2]:r,l=Array.isArray(e)?e[3]:i;return this.r=Math.round(en(s,0,255)),this.g=Math.round(en(o,0,255)),this.b=Math.round(en(a,0,255)),this.a=l==null?1:en(l,0,1),this}toHex(){return`#${["r","g","b"].map(t=>{const r=this[t].toString(16);return r.length<2?`0${r}`:r}).join("")}`}toRGBA(){return this.toArray()}toHSLA(){return tr.rgba2hsla(this.r,this.g,this.b,this.a)}toCSS(e){const t=`${this.r},${this.g},${this.b},`;return e?`rgb(${t})`:`rgba(${t},${this.a})`}toGrey(){return tr.makeGrey(Math.round((this.r+this.g+this.b)/3),this.a)}toArray(){return[this.r,this.g,this.b,this.a]}toString(){return this.toCSS()}}(function(n){function e(v){return new n(v)}n.fromArray=e;function t(v){return new n([...g(v),1])}n.fromHex=t;function r(v){const w=v.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(w){const x=w[1].split(/\s*,\s*/).map(C=>parseInt(C,10));return new n(x)}return null}n.fromRGBA=r;function i(v,w,x){x<0&&++x,x>1&&--x;const C=6*x;return C<1?v+(w-v)*C:2*x<1?w:3*x<2?v+(w-v)*(2/3-x)*6:v}function s(v){const w=v.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(w){const x=w[2].split(/\s*,\s*/),C=(parseFloat(x[0])%360+360)%360/360,S=parseFloat(x[1])/100,E=parseFloat(x[2])/100,A=x[3]==null?1:parseInt(x[3],10);return new n(c(C,S,E,A))}return null}n.fromHSLA=s;function o(v){if(v.startsWith("#"))return t(v);if(v.startsWith("rgb"))return r(v);const w=n.named[v];return w?t(w):s(v)}n.fromString=o;function a(v,w){return n.fromArray([v,v,v,w])}n.makeGrey=a;function l(v,w,x,C){const S=Array.isArray(v)?v[0]:v,E=Array.isArray(v)?v[1]:w,A=Array.isArray(v)?v[2]:x,O=Array.isArray(v)?v[3]:C,T=Math.max(S,E,A),I=Math.min(S,E,A),G=(T+I)/2;let Y=0,M=0;if(I!==T){const k=T-I;switch(M=G>.5?k/(2-T-I):k/(T+I),T){case S:Y=(E-A)/k+(E<A?6:0);break;case E:Y=(A-S)/k+2;break;case A:Y=(S-E)/k+4;break}Y/=6}return[Y,M,G,O==null?1:O]}n.rgba2hsla=l;function c(v,w,x,C){const S=Array.isArray(v)?v[0]:v,E=Array.isArray(v)?v[1]:w,A=Array.isArray(v)?v[2]:x,O=Array.isArray(v)?v[3]:C,T=A<=.5?A*(E+1):A+E-A*E,I=2*A-T;return[i(I,T,S+1/3)*256,i(I,T,S)*256,i(I,T,S-1/3)*256,O==null?1:O]}n.hsla2rgba=c;function u(v){return new n(Math.round(Math.random()*256),Math.round(Math.random()*256),Math.round(Math.random()*256),v?void 0:parseFloat(Math.random().toFixed(2)))}n.random=u;function h(){const v="0123456789ABCDEF";let w="#";for(let x=0;x<6;x+=1)w+=v[Math.floor(Math.random()*16)];return w}n.randomHex=h;function f(v){return u(v).toString()}n.randomRGBA=f;function d(v,w){if(typeof v=="string"){const A=v[0]==="#",[O,T,I]=g(v);return w?O*.299+T*.587+I*.114>186?"#000000":"#ffffff":`${A?"#":""}${p(255-O,255-T,255-I)}`}const x=v[0],C=v[1],S=v[2],E=v[3];return w?x*.299+C*.587+S*.114>186?[0,0,0,E]:[255,255,255,E]:[255-x,255-C,255-S,E]}n.invert=d;function g(v){const w=v.indexOf("#")===0?v:`#${v}`;let x=+`0x${w.substr(1)}`;if(!(w.length===4||w.length===7)||Number.isNaN(x))throw new Error("Invalid hex color.");const C=w.length===4?4:8,S=(1<<C)-1,E=["b","g","r"].map(()=>{const A=x&S;return x>>=C,C===4?17*A:A});return[E[2],E[1],E[0]]}function p(v,w,x){const C=S=>S.length<2?`0${S}`:S;return`${C(v.toString(16))}${C(w.toString(16))}${C(x.toString(16))}`}function b(v,w){return y(v,w)}n.lighten=b;function m(v,w){return y(v,-w)}n.darken=m;function y(v,w){if(typeof v=="string"){const S=v[0]==="#",E=parseInt(S?v.substr(1):v,16),A=en((E>>16)+w,0,255),O=en((E>>8&255)+w,0,255),T=en((E&255)+w,0,255);return`${S?"#":""}${(T|O<<8|A<<16).toString(16)}`}const x=p(v[0],v[1],v[2]),C=g(y(x,w));return[C[0],C[1],C[2],v[3]]}})(tr||(tr={})),function(n){n.named={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",burntsienna:"#ea7e5d",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",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",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"}}(tr||(tr={}));class rf{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(e){return this.map.has(e)}get(e){return this.map.get(e)}set(e,t){this.map.set(e,t),this.arr.push(e)}delete(e){const t=this.arr.indexOf(e);t>=0&&this.arr.splice(t,1);const r=this.map.get(e);return this.map.delete(e),r}each(e){this.arr.forEach(t=>{const r=this.map.get(t);e(r,t)})}dispose(){this.clear()}}var nr;(function(n){function e(i){const s=[],o=[];return Array.isArray(i)?s.push(...i):i.split("|").forEach(a=>{a.indexOf("&")===-1?s.push(a):o.push(...a.split("&"))}),{or:s,and:o}}n.parse=e;function t(i,s){if(i!=null&&s!=null){const o=e(i),a=e(s),l=o.or.sort(),c=a.or.sort(),u=o.and.sort(),h=a.and.sort(),f=(d,g)=>d.length===g.length&&(d.length===0||d.every((p,b)=>p===g[b]));return f(l,c)&&f(u,h)}return i==null&&s==null}n.equals=t;function r(i,s,o){if(s==null||Array.isArray(s)&&s.length===0)return o?i.altKey!==!0&&i.ctrlKey!==!0&&i.metaKey!==!0&&i.shiftKey!==!0:!0;const{or:a,and:l}=e(s),c=u=>{const h=`${u.toLowerCase()}Key`;return i[h]===!0};return a.some(u=>c(u))&&l.every(u=>c(u))}n.isMatch=r})(nr||(nr={}));var Si;(function(n){n.linear=e=>e,n.quad=e=>e*e,n.cubic=e=>e*e*e,n.inout=e=>{if(e<=0)return 0;if(e>=1)return 1;const t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)},n.exponential=e=>Math.pow(2,10*(e-1)),n.bounce=e=>{for(let t=0,r=1;;t+=r,r/=2)if(e>=(7-4*t)/11){const i=(11-6*t-11*e)/4;return-i*i+r*r}}})(Si||(Si={})),function(n){n.decorators={reverse(e){return t=>1-e(1-t)},reflect(e){return t=>.5*(t<.5?e(2*t):2-e(2-2*t))},clamp(e,t=0,r=1){return i=>{const s=e(i);return s<t?t:s>r?r:s}},back(e=1.70158){return t=>t*t*((e+1)*t-e)},elastic(e=1.5){return t=>Math.pow(2,10*(t-1))*Math.cos(20*Math.PI*e/3*t)}}}(Si||(Si={})),function(n){function e(M){return-1*Math.cos(M*(Math.PI/2))+1}n.easeInSine=e;function t(M){return Math.sin(M*(Math.PI/2))}n.easeOutSine=t;function r(M){return-.5*(Math.cos(Math.PI*M)-1)}n.easeInOutSine=r;function i(M){return M*M}n.easeInQuad=i;function s(M){return M*(2-M)}n.easeOutQuad=s;function o(M){return M<.5?2*M*M:-1+(4-2*M)*M}n.easeInOutQuad=o;function a(M){return M*M*M}n.easeInCubic=a;function l(M){const k=M-1;return k*k*k+1}n.easeOutCubic=l;function c(M){return M<.5?4*M*M*M:(M-1)*(2*M-2)*(2*M-2)+1}n.easeInOutCubic=c;function u(M){return M*M*M*M}n.easeInQuart=u;function h(M){const k=M-1;return 1-k*k*k*k}n.easeOutQuart=h;function f(M){const k=M-1;return M<.5?8*M*M*M*M:1-8*k*k*k*k}n.easeInOutQuart=f;function d(M){return M*M*M*M*M}n.easeInQuint=d;function g(M){const k=M-1;return 1+k*k*k*k*k}n.easeOutQuint=g;function p(M){const k=M-1;return M<.5?16*M*M*M*M*M:1+16*k*k*k*k*k}n.easeInOutQuint=p;function b(M){return M===0?0:Math.pow(2,10*(M-1))}n.easeInExpo=b;function m(M){return M===1?1:-Math.pow(2,-10*M)+1}n.easeOutExpo=m;function y(M){if(M===0||M===1)return M;const k=M*2,Z=k-1;return k<1?.5*Math.pow(2,10*Z):.5*(-Math.pow(2,-10*Z)+2)}n.easeInOutExpo=y;function v(M){const k=M/1;return-1*(Math.sqrt(1-k*M)-1)}n.easeInCirc=v;function w(M){const k=M-1;return Math.sqrt(1-k*k)}n.easeOutCirc=w;function x(M){const k=M*2,Z=k-2;return k<1?-.5*(Math.sqrt(1-k*k)-1):.5*(Math.sqrt(1-Z*Z)+1)}n.easeInOutCirc=x;function C(M,k=1.70158){return M*M*((k+1)*M-k)}n.easeInBack=C;function S(M,k=1.70158){const Z=M/1-1;return Z*Z*((k+1)*Z+k)+1}n.easeOutBack=S;function E(M,k=1.70158){const Z=M*2,R=Z-2,z=k*1.525;return Z<1?.5*Z*Z*((z+1)*Z-z):.5*(R*R*((z+1)*R+z)+2)}n.easeInOutBack=E;function A(M,k=.7){if(M===0||M===1)return M;const R=M/1-1,z=1-k,U=z/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*R)*Math.sin((R-U)*(2*Math.PI)/z))}n.easeInElastic=A;function O(M,k=.7){const Z=1-k,R=M*2;if(M===0||M===1)return M;const z=Z/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*R)*Math.sin((R-z)*(2*Math.PI)/Z)+1}n.easeOutElastic=O;function T(M,k=.65){const Z=1-k;if(M===0||M===1)return M;const R=M*2,z=R-1,U=Z/(2*Math.PI)*Math.asin(1);return R<1?-.5*(Math.pow(2,10*z)*Math.sin((z-U)*(2*Math.PI)/Z)):Math.pow(2,-10*z)*Math.sin((z-U)*(2*Math.PI)/Z)*.5+1}n.easeInOutElastic=T;function I(M){const k=M/1;if(k<1/2.75)return 7.5625*k*k;if(k<2/2.75){const Z=k-.5454545454545454;return 7.5625*Z*Z+.75}if(k<2.5/2.75){const Z=k-.8181818181818182;return 7.5625*Z*Z+.9375}{const Z=k-.9545454545454546;return 7.5625*Z*Z+.984375}}n.easeOutBounce=I;function G(M){return 1-I(1-M)}n.easeInBounce=G;function Y(M){return M<.5?G(M*2)*.5:I(M*2-1)*.5+.5}n.easeInOutBounce=Y}(Si||(Si={}));var Pi;(function(n){n.number=(e,t)=>{const r=t-e;return i=>e+r*i},n.object=(e,t)=>{const r=Object.keys(e);return i=>{const s={};for(let o=r.length-1;o!==-1;o-=1){const a=r[o];s[a]=e[a]+(t[a]-e[a])*i}return s}},n.unit=(e,t)=>{const r=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,i=r.exec(e),s=r.exec(t),o=s?s[1]:"",a=i?+i[1]:0,l=s?+s[1]:0,c=o.indexOf("."),u=c>0?o[1].length-c-1:0,h=l-a,f=i?i[2]:"";return d=>(a+h*d).toFixed(u)+f},n.color=(e,t)=>{const r=parseInt(e.slice(1),16),i=parseInt(t.slice(1),16),s=r&255,o=(i&255)-s,a=r&65280,l=(i&65280)-a,c=r&16711680,u=(i&16711680)-c;return h=>{const f=s+o*h&255,d=a+l*h&65280,g=c+u*h&16711680;return`#${(1<<24|f|d|g).toString(16).slice(1)}`}}})(Pi||(Pi={}));const zo=[];function Fo(n,e){const t=zo.find(r=>r.name===n);if(!(t&&(t.loadTimes+=1,t.loadTimes>1))&&!tn.isApplyingHMR()){const r=document.createElement("style");r.setAttribute("type","text/css"),r.textContent=e;const i=document.querySelector("head");i&&i.insertBefore(r,i.firstChild),zo.push({name:n,loadTimes:1,styleElement:r})}}function Vo(n){const e=zo.findIndex(t=>t.name===n);if(e>-1){const t=zo[e];if(t.loadTimes-=1,t.loadTimes>0)return;let r=t.styleElement;r&&r.parentNode&&r.parentNode.removeChild(r),r=null,zo.splice(e,1)}}var ye;(function(n){function e(r){return 180*r/Math.PI%360}n.toDeg=e,n.toRad=function(r,i=!1){return(i?r:r%360)*Math.PI/180};function t(r){return r%360+(r<0?360:0)}n.normalize=t})(ye||(ye={}));var be;(function(n){function e(a,l=0){return Number.isInteger(a)?a:+a.toFixed(l)}n.round=e;function t(a,l){let c,u;if(l==null?(u=a==null?1:a,c=0):(u=l,c=a==null?0:a),u<c){const h=c;c=u,u=h}return Math.floor(Math.random()*(u-c+1)+c)}n.random=t;function r(a,l,c){return Number.isNaN(a)?NaN:Number.isNaN(l)||Number.isNaN(c)?0:l<c?a<l?l:a>c?c:a:a<c?c:a>l?l:a}n.clamp=r;function i(a,l){return l*Math.round(a/l)}n.snapToGrid=i;function s(a,l){return l!=null&&a!=null&&l.x>=a.x&&l.x<=a.x+a.width&&l.y>=a.y&&l.y<=a.y+a.height}n.containsPoint=s;function o(a,l){const c=a.x-l.x,u=a.y-l.y;return c*c+u*u}n.squaredLength=o})(be||(be={}));class Tr{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class P extends Tr{constructor(e,t){super(),this.x=e==null?0:e,this.y=t==null?0:t}round(e=0){return this.x=be.round(this.x,e),this.y=be.round(this.y,e),this}add(e,t){const r=P.create(e,t);return this.x+=r.x,this.y+=r.y,this}update(e,t){const r=P.create(e,t);return this.x=r.x,this.y=r.y,this}translate(e,t){const r=P.create(e,t);return this.x+=r.x,this.y+=r.y,this}rotate(e,t){const r=P.rotate(this,e,t);return this.x=r.x,this.y=r.y,this}scale(e,t,r=new P){const i=P.create(r);return this.x=i.x+e*(this.x-i.x),this.y=i.y+t*(this.y-i.y),this}closest(e){if(e.length===1)return P.create(e[0]);let t=null,r=1/0;return e.forEach(i=>{const s=this.squaredDistance(i);s<r&&(t=i,r=s)}),t?P.create(t):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){const t=P.create(e),r=this.x-t.x,i=this.y-t.y;return r*r+i*i}manhattanDistance(e){const t=P.create(e);return Math.abs(t.x-this.x)+Math.abs(t.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(e=new P){const t=P.create(e),r=-(t.y-this.y),i=t.x-this.x;let s=Math.atan2(r,i);return s<0&&(s=2*Math.PI+s),180*s/Math.PI}angleBetween(e,t){if(this.equals(e)||this.equals(t))return NaN;let r=this.theta(t)-this.theta(e);return r<0&&(r+=360),r}vectorAngle(e){return new P(0,0).angleBetween(this,e)}toPolar(e){return this.update(P.toPolar(this,e)),this}changeInAngle(e,t,r=new P){return this.clone().translate(-e,-t).theta(r)-this.theta(r)}adhereToRect(e){return be.containsPoint(e,this)||(this.x=Math.min(Math.max(this.x,e.x),e.x+e.width),this.y=Math.min(Math.max(this.y,e.y),e.y+e.height)),this}bearing(e){const t=P.create(e),r=ye.toRad(this.y),i=ye.toRad(t.y),s=this.x,o=t.x,a=ye.toRad(o-s),l=Math.sin(a)*Math.cos(i),c=Math.cos(r)*Math.sin(i)-Math.sin(r)*Math.cos(i)*Math.cos(a),u=ye.toDeg(Math.atan2(l,c)),h=["NE","E","SE","S","SW","W","NW","N"];let f=u-22.5;return f<0&&(f+=360),f=parseInt(f/45,10),h[f]}cross(e,t){if(e!=null&&t!=null){const r=P.create(e),i=P.create(t);return(i.x-this.x)*(r.y-this.y)-(i.y-this.y)*(r.x-this.x)}return NaN}dot(e){const t=P.create(e);return this.x*t.x+this.y*t.y}diff(e,t){if(typeof e=="number")return new P(this.x-e,this.y-t);const r=P.create(e);return new P(this.x-r.x,this.y-r.y)}lerp(e,t){const r=P.create(e);return new P((1-t)*this.x+t*r.x,(1-t)*this.y+t*r.y)}normalize(e=1){const t=e/this.magnitude();return this.scale(t,t)}move(e,t){const r=P.create(e),i=ye.toRad(r.theta(this));return this.translate(Math.cos(i)*t,-Math.sin(i)*t)}reflection(e){return P.create(e).move(this,this.distance(e))}snapToGrid(e,t){return this.x=be.snapToGrid(this.x,e),this.y=be.snapToGrid(this.y,t==null?e:t),this}equals(e){const t=P.create(e);return t!=null&&t.x===this.x&&t.y===this.y}clone(){return P.clone(this)}toJSON(){return P.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPoint=e})(P||(P={})),function(n){function e(r){return r!=null&&typeof r=="object"&&typeof r.x=="number"&&typeof r.y=="number"}n.isPointLike=e;function t(r){return r!=null&&Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}n.isPointData=t}(P||(P={})),function(n){function e(h,f){return h==null||typeof h=="number"?new n(h,f):t(h)}n.create=e;function t(h){return n.isPoint(h)?new n(h.x,h.y):Array.isArray(h)?new n(h[0],h[1]):new n(h.x,h.y)}n.clone=t;function r(h){return n.isPoint(h)?{x:h.x,y:h.y}:Array.isArray(h)?{x:h[0],y:h[1]}:{x:h.x,y:h.y}}n.toJSON=r;function i(h,f,d=new n){let g=Math.abs(h*Math.cos(f)),p=Math.abs(h*Math.sin(f));const b=t(d),m=ye.normalize(ye.toDeg(f));return m<90?p=-p:m<180?(g=-g,p=-p):m<270&&(g=-g),new n(b.x+g,b.y+p)}n.fromPolar=i;function s(h,f=new n){const d=t(h),g=t(f),p=d.x-g.x,b=d.y-g.y;return new n(Math.sqrt(p*p+b*b),ye.toRad(g.theta(d)))}n.toPolar=s;function o(h,f){return h===f?!0:h!=null&&f!=null?h.x===f.x&&h.y===f.y:!1}n.equals=o;function a(h,f){if(h==null&&f!=null||h!=null&&f==null||h!=null&&f!=null&&h.length!==f.length)return!1;if(h!=null&&f!=null){for(let d=0,g=h.length;d<g;d+=1)if(!o(h[d],f[d]))return!1}return!0}n.equalPoints=a;function l(h,f,d,g){return new n(be.random(h,f),be.random(d,g))}n.random=l;function c(h,f,d){const g=ye.toRad(ye.normalize(-f)),p=Math.sin(g),b=Math.cos(g);return u(h,b,p,d)}n.rotate=c;function u(h,f,d,g=new n){const p=t(h),b=t(g),m=p.x-b.x,y=p.y-b.y,v=m*f-y*d,w=y*f+m*d;return new n(v+b.x,w+b.y)}n.rotateEx=u}(P||(P={}));class D extends Tr{get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new P(this.x,this.y)}get topLeft(){return new P(this.x,this.y)}get topCenter(){return new P(this.x+this.width/2,this.y)}get topRight(){return new P(this.x+this.width,this.y)}get center(){return new P(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new P(this.x,this.y+this.height)}get bottomCenter(){return new P(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new P(this.x+this.width,this.y+this.height)}get corner(){return new P(this.x+this.width,this.y+this.height)}get rightMiddle(){return new P(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new P(this.x,this.y+this.height/2)}get topLine(){return new F(this.topLeft,this.topRight)}get rightLine(){return new F(this.topRight,this.bottomRight)}get bottomLine(){return new F(this.bottomLeft,this.bottomRight)}get leftLine(){return new F(this.topLeft,this.bottomLeft)}constructor(e,t,r,i){super(),this.x=e==null?0:e,this.y=t==null?0:t,this.width=r==null?0:r,this.height=i==null?0:i}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(e){if(!e)return this.clone();const t=ye.toRad(e),r=Math.abs(Math.sin(t)),i=Math.abs(Math.cos(t)),s=this.width*i+this.height*r,o=this.width*r+this.height*i;return new D(this.x+(this.width-s)/2,this.y+(this.height-o)/2,s,o)}round(e=0){return this.x=be.round(this.x,e),this.y=be.round(this.y,e),this.width=be.round(this.width,e),this.height=be.round(this.height,e),this}add(e,t,r,i){const s=D.create(e,t,r,i),o=Math.min(this.x,s.x),a=Math.min(this.y,s.y),l=Math.max(this.x+this.width,s.x+s.width),c=Math.max(this.y+this.height,s.y+s.height);return this.x=o,this.y=a,this.width=l-o,this.height=c-a,this}update(e,t,r,i){const s=D.create(e,t,r,i);return this.x=s.x,this.y=s.y,this.width=s.width,this.height=s.height,this}inflate(e,t){const r=e,i=t!=null?t:e;return this.x-=r,this.y-=i,this.width+=2*r,this.height+=2*i,this}snapToGrid(e,t){const r=this.origin.snapToGrid(e,t),i=this.corner.snapToGrid(e,t);return this.x=r.x,this.y=r.y,this.width=i.x-r.x,this.height=i.y-r.y,this}translate(e,t){const r=P.create(e,t);return this.x+=r.x,this.y+=r.y,this}scale(e,t,r=new P){const i=this.origin.scale(e,t,r);return this.x=i.x,this.y=i.y,this.width*=e,this.height*=t,this}rotate(e,t=this.getCenter()){if(e!==0){const r=ye.toRad(e),i=Math.cos(r),s=Math.sin(r);let o=this.getOrigin(),a=this.getTopRight(),l=this.getBottomRight(),c=this.getBottomLeft();o=P.rotateEx(o,i,s,t),a=P.rotateEx(a,i,s,t),l=P.rotateEx(l,i,s,t),c=P.rotateEx(c,i,s,t);const u=new D(o.x,o.y,0,0);u.add(a.x,a.y,0,0),u.add(l.x,l.y,0,0),u.add(c.x,c.y,0,0),this.update(u)}return this}rotate90(){const e=(this.width-this.height)/2;this.x+=e,this.y-=e;const t=this.width;return this.width=this.height,this.height=t,this}moveAndExpand(e){const t=D.clone(e);return this.x+=t.x||0,this.y+=t.y||0,this.width+=t.width||0,this.height+=t.height||0,this}getMaxScaleToFit(e,t=this.center){const r=D.clone(e),i=t.x,s=t.y;let o=1/0,a=1/0,l=1/0,c=1/0,u=1/0,h=1/0,f=1/0,d=1/0;const g=r.topLeft;g.x<i&&(o=(this.x-i)/(g.x-i)),g.y<s&&(u=(this.y-s)/(g.y-s));const p=r.bottomRight;p.x>i&&(a=(this.x+this.width-i)/(p.x-i)),p.y>s&&(h=(this.y+this.height-s)/(p.y-s));const b=r.topRight;b.x>i&&(l=(this.x+this.width-i)/(b.x-i)),b.y<s&&(f=(this.y-s)/(b.y-s));const m=r.bottomLeft;return m.x<i&&(c=(this.x-i)/(m.x-i)),m.y>s&&(d=(this.y+this.height-s)/(m.y-s)),{sx:Math.min(o,a,l,c),sy:Math.min(u,h,f,d)}}getMaxUniformScaleToFit(e,t=this.center){const r=this.getMaxScaleToFit(e,t);return Math.min(r.sx,r.sy)}containsPoint(e,t){return be.containsPoint(this,P.create(e,t))}containsRect(e,t,r,i){const s=D.create(e,t,r,i),o=this.x,a=this.y,l=this.width,c=this.height,u=s.x,h=s.y,f=s.width,d=s.height;return l===0||c===0||f===0||d===0?!1:u>=o&&h>=a&&u+f<=o+l&&h+d<=a+c}intersectsWithLine(e){const t=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],r=[],i=[];return t.forEach(s=>{const o=e.intersectsWithLine(s);o!==null&&i.indexOf(o.toString())<0&&(r.push(o),i.push(o.toString()))}),r.length>0?r:null}intersectsWithLineFromCenterToPoint(e,t){const r=P.clone(e),i=this.center;let s=null;t!=null&&t!==0&&r.rotate(t,i);const o=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new F(i,r);for(let l=o.length-1;l>=0;l-=1){const c=o[l].intersectsWithLine(a);if(c!==null){s=c;break}}return s&&t!=null&&t!==0&&s.rotate(-t,i),s}intersectsWithRect(e,t,r,i){const s=D.create(e,t,r,i);if(!this.isIntersectWithRect(s))return null;const o=this.origin,a=this.corner,l=s.origin,c=s.corner,u=Math.max(o.x,l.x),h=Math.max(o.y,l.y);return new D(u,h,Math.min(a.x,c.x)-u,Math.min(a.y,c.y)-h)}isIntersectWithRect(e,t,r,i){const s=D.create(e,t,r,i),o=this.origin,a=this.corner,l=s.origin,c=s.corner;return!(c.x<=o.x||c.y<=o.y||l.x>=a.x||l.y>=a.y)}normalize(){let e=this.x,t=this.y,r=this.width,i=this.height;return this.width<0&&(e=this.x+this.width,r=-this.width),this.height<0&&(t=this.y+this.height,i=-this.height),this.x=e,this.y=t,this.width=r,this.height=i,this}union(e){const t=D.clone(e),r=this.origin,i=this.corner,s=t.origin,o=t.corner,a=Math.min(r.x,s.x),l=Math.min(r.y,s.y),c=Math.max(i.x,o.x),u=Math.max(i.y,o.y);return new D(a,l,c-a,u-l)}getNearestSideToPoint(e){const t=P.clone(e),r=t.x-this.x,i=this.x+this.width-t.x,s=t.y-this.y,o=this.y+this.height-t.y;let a=r,l="left";return i<a&&(a=i,l="right"),s<a&&(a=s,l="top"),o<a&&(l="bottom"),l}getNearestPointToPoint(e){const t=P.clone(e);if(this.containsPoint(t)){const r=this.getNearestSideToPoint(t);if(r==="left")return new P(this.x,t.y);if(r==="top")return new P(t.x,this.y);if(r==="right")return new P(this.x+this.width,t.y);if(r==="bottom")return new P(t.x,this.y+this.height)}return t.adhereToRect(this)}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}clone(){return new D(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isRectangle=e})(D||(D={})),function(n){function e(t){return t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number"&&typeof t.width=="number"&&typeof t.height=="number"}n.isRectangleLike=e}(D||(D={})),function(n){function e(o,a,l,c){return o==null||typeof o=="number"?new n(o,a,l,c):t(o)}n.create=e;function t(o){return n.isRectangle(o)?o.clone():Array.isArray(o)?new n(o[0],o[1],o[2],o[3]):new n(o.x,o.y,o.width,o.height)}n.clone=t;function r(o){return new n(o.x-o.a,o.y-o.b,2*o.a,2*o.b)}n.fromEllipse=r;function i(o){return new n(0,0,o.width,o.height)}n.fromSize=i;function s(o,a){return new n(o.x,o.y,a.width,a.height)}n.fromPositionAndSize=s}(D||(D={}));class F extends Tr{get center(){return new P((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(e,t,r,i){super(),typeof e=="number"&&typeof t=="number"?(this.start=new P(e,t),this.end=new P(r,i)):(this.start=P.create(e),this.end=P.create(t))}getCenter(){return this.center}round(e=0){return this.start.round(e),this.end.round(e),this}translate(e,t){return typeof e=="number"?(this.start.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.end.translate(e)),this}rotate(e,t){return this.start.rotate(e,t),this.end.rotate(e,t),this}scale(e,t,r){return this.start.scale(e,t,r),this.end.scale(e,t,r),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const e=this.start.x-this.end.x,t=this.start.y-this.end.y;return e*e+t*t}setLength(e){const t=this.length();if(!t)return this;const r=e/t;return this.scale(r,r,this.start)}parallel(e){const t=this.clone();if(!t.isDifferentiable())return t;const{start:r,end:i}=t,s=r.clone().rotate(270,i),o=i.clone().rotate(90,r);return r.move(o,e),i.move(s,e),t}vector(){return new P(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const e=new P(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,e)}bbox(){const e=Math.min(this.start.x,this.end.x),t=Math.min(this.start.y,this.end.y),r=Math.max(this.start.x,this.end.x),i=Math.max(this.start.y,this.end.y);return new D(e,t,r-e,i-t)}bearing(){return this.start.bearing(this.end)}closestPoint(e){return this.pointAt(this.closestPointNormalizedLength(e))}closestPointLength(e){return this.closestPointNormalizedLength(e)*this.length()}closestPointTangent(e){return this.tangentAt(this.closestPointNormalizedLength(e))}closestPointNormalizedLength(e){const t=this.vector().dot(new F(this.start,e).vector()),r=Math.min(1,Math.max(0,t/this.squaredLength()));return Number.isNaN(r)?0:r}pointAt(e){const t=this.start,r=this.end;return e<=0?t.clone():e>=1?r.clone():t.lerp(r,e)}pointAtLength(e){const t=this.start,r=this.end;let i=!0;e<0&&(i=!1,e=-e);const s=this.length();if(e>=s)return i?r.clone():t.clone();const o=(i?e:s-e)/s;return this.pointAt(o)}divideAt(e){const t=this.pointAt(e);return[new F(this.start,t),new F(t,this.end)]}divideAtLength(e){const t=this.pointAtLength(e);return[new F(this.start,t),new F(t,this.end)]}containsPoint(e){const t=this.start,r=this.end;if(t.cross(e,r)!==0)return!1;const i=this.length();return!(new F(t,e).length()>i||new F(e,r).length()>i)}intersect(e,t){const r=e.intersectsWithLine(this,t);return r?Array.isArray(r)?r:[r]:null}intersectsWithLine(e){const t=new P(this.end.x-this.start.x,this.end.y-this.start.y),r=new P(e.end.x-e.start.x,e.end.y-e.start.y),i=t.x*r.y-t.y*r.x,s=new P(e.start.x-this.start.x,e.start.y-this.start.y),o=s.x*r.y-s.y*r.x,a=s.x*t.y-s.y*t.x;if(i===0||o*i<0||a*i<0)return null;if(i>0){if(o>i||a>i)return null}else if(o<i||a<i)return null;return new P(this.start.x+o*t.x/i,this.start.y+o*t.y/i)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(e){const t=P.clone(e),r=this.start,i=this.end;return((i.x-r.x)*(t.y-r.y)-(i.y-r.y)*(t.x-r.x))/this.length()}pointSquaredDistance(e,t){const r=P.create(e,t);return this.closestPoint(r).squaredDistance(r)}pointDistance(e,t){const r=P.create(e,t);return this.closestPoint(r).distance(r)}tangentAt(e){if(!this.isDifferentiable())return null;const t=this.start,r=this.end,i=this.pointAt(e),s=new F(t,r);return s.translate(i.x-t.x,i.y-t.y),s}tangentAtLength(e){if(!this.isDifferentiable())return null;const t=this.start,r=this.end,i=this.pointAtLength(e),s=new F(t,r);return s.translate(i.x-t.x,i.y-t.y),s}relativeCcw(e,t){const r=P.create(e,t);let i=r.x-this.start.x,s=r.y-this.start.y;const o=this.end.x-this.start.x,a=this.end.y-this.start.y;let l=i*a-s*o;return l===0&&(l=i*o+s*a,l>0&&(i-=o,s-=a,l=i*o+s*a,l<0&&(l=0))),l<0?-1:l>0?1:0}equals(e){return e!=null&&this.start.x===e.start.x&&this.start.y===e.start.y&&this.end.x===e.end.x&&this.end.y===e.end.y}clone(){return new F(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isLine=e})(F||(F={}));class wn extends Tr{get center(){return new P(this.x,this.y)}constructor(e,t,r,i){super(),this.x=e==null?0:e,this.y=t==null?0:t,this.a=r==null?0:r,this.b=i==null?0:i}bbox(){return D.fromEllipse(this)}getCenter(){return this.center}inflate(e,t){const r=e,i=t!=null?t:e;return this.a+=2*r,this.b+=2*i,this}normalizedDistance(e,t){const r=P.create(e,t),i=r.x-this.x,s=r.y-this.y,o=this.a,a=this.b;return i*i/(o*o)+s*s/(a*a)}containsPoint(e,t){return this.normalizedDistance(e,t)<=1}intersectsWithLine(e){const t=[],r=this.a,i=this.b,s=e.start,o=e.end,a=e.vector(),l=s.diff(new P(this.x,this.y)),c=new P(a.x/(r*r),a.y/(i*i)),u=new P(l.x/(r*r),l.y/(i*i)),h=a.dot(c),f=a.dot(u),d=l.dot(u)-1,g=f*f-h*d;if(g<0)return null;if(g>0){const p=Math.sqrt(g),b=(-f-p)/h,m=(-f+p)/h;if((b<0||b>1)&&(m<0||m>1))return null;b>=0&&b<=1&&t.push(s.lerp(o,b)),m>=0&&m<=1&&t.push(s.lerp(o,m))}else{const p=-f/h;if(p>=0&&p<=1)t.push(s.lerp(o,p));else return null}return t}intersectsWithLineFromCenterToPoint(e,t=0){const r=P.clone(e);t&&r.rotate(t,this.getCenter());const i=r.x-this.x,s=r.y-this.y;let o;if(i===0)return o=this.bbox().getNearestPointToPoint(r),t?o.rotate(-t,this.getCenter()):o;const a=s/i,l=a*a,c=this.a*this.a,u=this.b*this.b;let h=Math.sqrt(1/(1/c+l/u));h=i<0?-h:h;const f=a*h;return o=new P(this.x+h,this.y+f),t?o.rotate(-t,this.getCenter()):o}tangentTheta(e){const t=P.clone(e),r=t.x,i=t.y,s=this.a,o=this.b,a=this.bbox().center,l=a.x,c=a.y,u=30,h=r>a.x+s/2,f=r<a.x-s/2;let d,g;return h||f?(g=r>a.x?i-u:i+u,d=s*s/(r-l)-s*s*(i-c)*(g-c)/(o*o*(r-l))+l):(d=i>a.y?r+u:r-u,g=o*o/(i-c)-o*o*(r-l)*(d-l)/(s*s*(i-c))+c),new P(d,g).theta(t)}scale(e,t){return this.a*=e,this.b*=t,this}rotate(e,t){const r=D.fromEllipse(this);r.rotate(e,t);const i=wn.fromRect(r);return this.a=i.a,this.b=i.b,this.x=i.x,this.y=i.y,this}translate(e,t){const r=P.create(e,t);return this.x+=r.x,this.y+=r.y,this}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.a===this.a&&e.b===this.b}clone(){return new wn(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isEllipse=e})(wn||(wn={})),function(n){function e(i,s,o,a){return i==null||typeof i=="number"?new n(i,s,o,a):t(i)}n.create=e;function t(i){return n.isEllipse(i)?i.clone():Array.isArray(i)?new n(i[0],i[1],i[2],i[3]):new n(i.x,i.y,i.a,i.b)}n.parse=t;function r(i){const s=i.center;return new n(s.x,s.y,i.width/2,i.height/2)}n.fromRect=r}(wn||(wn={}));const r6=new RegExp("^[\\s\\dLMCZz,.]*$");function i6(n){return typeof n!="string"?!1:r6.test(n)}function sf(n,e){return(n%e+e)%e}function s6(n,e,t,r,i){const s=[],o=n[n.length-1],a=e!=null&&e>0,l=e||0;if(r&&a){n=n.slice();const h=n[0],f=new P(o.x+(h.x-o.x)/2,o.y+(h.y-o.y)/2);n.splice(0,0,f)}let c=n[0],u=1;for(t?s.push("M",c.x,c.y):s.push("L",c.x,c.y);u<(r?n.length:n.length-1);){let h=n[sf(u,n.length)],f=c.x-h.x,d=c.y-h.y;if(a&&(f!==0||d!==0)&&(i==null||i.indexOf(u-1)<0)){let g=Math.sqrt(f*f+d*d);const p=f*Math.min(l,g/2)/g,b=d*Math.min(l,g/2)/g,m=h.x+p,y=h.y+b;s.push("L",m,y);let v=n[sf(u+1,n.length)];for(;u<n.length-2&&Math.round(v.x-h.x)===0&&Math.round(v.y-h.y)===0;)v=n[sf(u+2,n.length)],u+=1;f=v.x-h.x,d=v.y-h.y,g=Math.max(1,Math.sqrt(f*f+d*d));const w=f*Math.min(l,g/2)/g,x=d*Math.min(l,g/2)/g,C=h.x+w,S=h.y+x;s.push("Q",h.x,h.y,C,S),h=new P(C,S)}else s.push("L",h.x,h.y);c=h,u+=1}return r?s.push("Z"):s.push("L",o.x,o.y),s.map(h=>typeof h=="string"?h:+h.toFixed(3)).join(" ")}function R1(n,e={}){const t=[];return n&&n.length&&n.forEach(r=>{Array.isArray(r)?t.push({x:r[0],y:r[1]}):t.push({x:r.x,y:r.y})}),s6(t,e.round,e.initialMove==null||e.initialMove,e.close,e.exclude)}function ql(n,e,t,r,i=0,s=0,o=0,a,l){if(t===0||r===0)return[];a-=n,l-=e,t=Math.abs(t),r=Math.abs(r);const c=-a/2,u=-l/2,h=Math.cos(i*Math.PI/180),f=Math.sin(i*Math.PI/180),d=h*c+f*u,g=-1*f*c+h*u,p=d*d,b=g*g,m=t*t,y=r*r,v=p/m+b/y;let w;if(v>1)t=Math.sqrt(v)*t,r=Math.sqrt(v)*r,w=0;else{let At=1;s===o&&(At=-1),w=At*Math.sqrt((m*y-m*b-y*p)/(m*b+y*p))}const x=w*t*g/r,C=-1*w*r*d/t,S=h*x-f*C+a/2,E=f*x+h*C+l/2;let A=Math.atan2((g-C)/r,(d-x)/t)-Math.atan2(0,1),O=A>=0?A:2*Math.PI+A;A=Math.atan2((-g-C)/r,(-d-x)/t)-Math.atan2((g-C)/r,(d-x)/t);let T=A>=0?A:2*Math.PI+A;o===0&&T>0?T-=2*Math.PI:o!==0&&T<0&&(T+=2*Math.PI);const I=T*2/Math.PI,G=Math.ceil(I<0?-1*I:I),Y=T/G,M=8/3*Math.sin(Y/4)*Math.sin(Y/4)/Math.sin(Y/2),k=h*t,Z=h*r,R=f*t,z=f*r;let U=Math.cos(O),te=Math.sin(O),we=-M*(k*te+z*U),Kt=-M*(R*te-Z*U),Ye=0,gn=0;const Ke=[];for(let At=0;At<G;At+=1){O+=Y,U=Math.cos(O),te=Math.sin(O),Ye=k*U-z*te+S,gn=R*U+Z*te+E;const Fu=-M*(k*te+z*U),Vu=-M*(R*te-Z*U),ci=At*6;Ke[ci]=Number(we+n),Ke[ci+1]=Number(Kt+e),Ke[ci+2]=Number(Ye-Fu+n),Ke[ci+3]=Number(gn-Vu+e),Ke[ci+4]=Number(Ye+n),Ke[ci+5]=Number(gn+e),we=Ye+Fu,Kt=gn+Vu}return Ke.map(At=>+At.toFixed(2))}function o6(n,e,t,r,i=0,s=0,o=0,a,l){const c=[],u=ql(n,e,t,r,i,s,o,a,l);if(u!=null)for(let h=0,f=u.length;h<f;h+=6)c.push("C",u[h],u[h+1],u[h+2],u[h+3],u[h+4],u[h+5]);return c.join(" ")}class He extends Tr{get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(e){if(super(),e!=null){if(typeof e=="string")return He.parse(e);this.points=e.map(t=>P.create(t))}else this.points=[]}scale(e,t,r=new P){return this.points.forEach(i=>i.scale(e,t,r)),this}rotate(e,t){return this.points.forEach(r=>r.rotate(e,t)),this}translate(e,t){const r=P.create(e,t);return this.points.forEach(i=>i.translate(r.x,r.y)),this}round(e=0){return this.points.forEach(t=>t.round(e)),this}bbox(){if(this.points.length===0)return new D;let e=1/0,t=-1/0,r=1/0,i=-1/0;const s=this.points;for(let o=0,a=s.length;o<a;o+=1){const l=s[o],c=l.x,u=l.y;c<e&&(e=c),c>t&&(t=c),u<r&&(r=u),u>i&&(i=u)}return new D(e,r,t-e,i-r)}closestPoint(e){const t=this.closestPointLength(e);return this.pointAtLength(t)}closestPointLength(e){const t=this.points,r=t.length;if(r===0||r===1)return 0;let i=0,s=0,o=1/0;for(let a=0,l=r-1;a<l;a+=1){const c=new F(t[a],t[a+1]),u=c.length(),h=c.closestPointNormalizedLength(e),d=c.pointAt(h).squaredDistance(e);d<o&&(o=d,s=i+h*u),i+=u}return s}closestPointNormalizedLength(e){const t=this.length();return t===0?0:this.closestPointLength(e)/t}closestPointTangent(e){const t=this.closestPointLength(e);return this.tangentAtLength(t)}containsPoint(e){if(this.points.length===0)return!1;const t=P.clone(e),r=t.x,i=t.y,s=this.points,o=s.length;let a=o-1,l=0;for(let c=0;c<o;c+=1){const u=s[a],h=s[c];if(t.equals(u))return!0;const f=new F(u,h);if(f.containsPoint(e))return!0;if(i<=u.y&&i>h.y||i>u.y&&i<=h.y){const d=u.x-r>h.x-r?u.x-r:h.x-r;if(d>=0){const g=new P(r+d,i),p=new F(e,g);f.intersectsWithLine(p)&&(l+=1)}}a=c}return l%2===1}intersectsWithLine(e){const t=[];for(let r=0,i=this.points.length-1;r<i;r+=1){const s=this.points[r],o=this.points[r+1],a=e.intersectsWithLine(new F(s,o));a&&t.push(a)}return t.length>0?t:null}isDifferentiable(){for(let e=0,t=this.points.length-1;e<t;e+=1){const r=this.points[e],i=this.points[e+1];if(new F(r,i).isDifferentiable())return!0}return!1}length(){let e=0;for(let t=0,r=this.points.length-1;t<r;t+=1){const i=this.points[t],s=this.points[t+1];e+=i.distance(s)}return e}pointAt(e){const t=this.points,r=t.length;if(r===0)return null;if(r===1||e<=0)return t[0].clone();if(e>=1)return t[r-1].clone();const s=this.length()*e;return this.pointAtLength(s)}pointAtLength(e){const t=this.points,r=t.length;if(r===0)return null;if(r===1)return t[0].clone();let i=!0;e<0&&(i=!1,e=-e);let s=0;for(let a=0,l=r-1;a<l;a+=1){const c=i?a:l-1-a,u=t[c],h=t[c+1],f=new F(u,h),d=u.distance(h);if(e<=s+d)return f.pointAtLength((i?1:-1)*(e-s));s+=d}return(i?t[r-1]:t[0]).clone()}tangentAt(e){const r=this.points.length;if(r===0||r===1)return null;e<0&&(e=0),e>1&&(e=1);const s=this.length()*e;return this.tangentAtLength(s)}tangentAtLength(e){const t=this.points,r=t.length;if(r===0||r===1)return null;let i=!0;e<0&&(i=!1,e=-e);let s,o=0;for(let a=0,l=r-1;a<l;a+=1){const c=i?a:l-1-a,u=t[c],h=t[c+1],f=new F(u,h),d=u.distance(h);if(f.isDifferentiable()){if(e<=o+d)return f.tangentAtLength((i?1:-1)*(e-o));s=f}o+=d}if(s){const a=i?1:0;return s.tangentAt(a)}return null}simplify(e={}){const t=this.points;if(t.length<3)return this;const r=e.threshold||0;let i=0;for(;t[i+2];){const s=i,o=i+1,a=i+2,l=t[s],c=t[o],u=t[a];new F(l,u).closestPoint(c).distance(c)<=r?t.splice(o,1):i+=1}return this}toHull(){const e=this.points,t=e.length;if(t===0)return new He;let r=e[0];for(let f=1;f<t;f+=1)(e[f].y<r.y||e[f].y===r.y&&e[f].x>r.x)&&(r=e[f]);const i=[];for(let f=0;f<t;f+=1){let d=r.theta(e[f]);d===0&&(d=360),i.push([e[f],f,d])}if(i.sort((f,d)=>{let g=f[2]-d[2];return g===0&&(g=d[1]-f[1]),g}),i.length>2){const f=i[i.length-1];i.unshift(f)}const s={},o=[],a=f=>`${f[0].toString()}@${f[1]}`;for(;i.length!==0;){const f=i.pop(),d=f[0];if(s[a(f)])continue;let g=!1;for(;!g;)if(o.length<2)o.push(f),g=!0;else{const p=o.pop(),b=p[0],m=o.pop(),y=m[0],v=y.cross(b,d);if(v<0)o.push(m),o.push(p),o.push(f),g=!0;else if(v===0){const x=b.angleBetween(y,d);Math.abs(x-180)<1e-10||b.equals(d)||y.equals(b)?(s[a(p)]=b,o.push(m)):Math.abs((x+1)%360-1)<1e-10&&(o.push(m),i.push(p))}else s[a(p)]=b,o.push(m)}}o.length>2&&o.pop();let l,c=-1;for(let f=0,d=o.length;f<d;f+=1){const g=o[f][1];(l===void 0||g<l)&&(l=g,c=f)}let u=[];if(c>0){const f=o.slice(c),d=o.slice(0,c);u=f.concat(d)}else u=o;const h=[];for(let f=0,d=u.length;f<d;f+=1)h.push(u[f][0]);return new He(h)}equals(e){return e==null||e.points.length!==this.points.length?!1:e.points.every((t,r)=>t.equals(this.points[r]))}clone(){return new He(this.points.map(e=>e.clone()))}toJSON(){return this.points.map(e=>e.toJSON())}serialize(){return this.points.map(e=>`${e.serialize()}`).join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPolyline=e})(He||(He={})),function(n){function e(t){const r=t.trim();if(r==="")return new n;const i=[],s=r.split(/\s*,\s*|\s+/);for(let o=0,a=s.length;o<a;o+=2)i.push({x:+s[o],y:+s[o+1]});return new n(i)}n.parse=e}(He||(He={}));class Fe extends Tr{constructor(e,t,r,i){super(),this.PRECISION=3,this.start=P.create(e),this.controlPoint1=P.create(t),this.controlPoint2=P.create(r),this.end=P.create(i)}bbox(){const e=this.start,t=this.controlPoint1,r=this.controlPoint2,i=this.end,s=e.x,o=e.y,a=t.x,l=t.y,c=r.x,u=r.y,h=i.x,f=i.y,d=[],g=[[],[]];let p,b,m,y,v,w,x,C;for(let k=0;k<2;k+=1){if(k===0?(b=6*s-12*a+6*c,p=-3*s+9*a-9*c+3*h,m=3*a-3*s):(b=6*o-12*l+6*u,p=-3*o+9*l-9*u+3*f,m=3*l-3*o),Math.abs(p)<1e-12){if(Math.abs(b)<1e-12)continue;y=-m/b,y>0&&y<1&&d.push(y);continue}x=b*b-4*m*p,C=Math.sqrt(x),!(x<0)&&(v=(-b+C)/(2*p),v>0&&v<1&&d.push(v),w=(-b-C)/(2*p),w>0&&w<1&&d.push(w))}let S,E,A,O=d.length;const T=O;for(;O;)O-=1,y=d[O],A=1-y,S=A*A*A*s+3*A*A*y*a+3*A*y*y*c+y*y*y*h,g[0][O]=S,E=A*A*A*o+3*A*A*y*l+3*A*y*y*u+y*y*y*f,g[1][O]=E;d[T]=0,d[T+1]=1,g[0][T]=s,g[1][T]=o,g[0][T+1]=h,g[1][T+1]=f,d.length=T+2,g[0].length=T+2,g[1].length=T+2;const I=Math.min.apply(null,g[0]),G=Math.min.apply(null,g[1]),Y=Math.max.apply(null,g[0]),M=Math.max.apply(null,g[1]);return new D(I,G,Y-I,M-G)}closestPoint(e,t={}){return this.pointAtT(this.closestPointT(e,t))}closestPointLength(e,t={}){const r=this.getOptions(t);return this.lengthAtT(this.closestPointT(e,r),r)}closestPointNormalizedLength(e,t={}){const r=this.getOptions(t),i=this.closestPointLength(e,r);if(!i)return 0;const s=this.length(r);return s===0?0:i/s}closestPointT(e,t={}){const r=this.getPrecision(t),i=this.getDivisions(t),s=Math.pow(10,-r);let o=null,a=0,l=0,c=0,u=0,h=0,f=null;const d=i.length;let g=d>0?1/d:0;for(i.forEach((p,b)=>{const m=p.start.distance(e),y=p.end.distance(e),v=m+y;(f==null||v<f)&&(o=p,a=b*g,l=(b+1)*g,c=m,u=y,f=v,h=p.endpointDistance())});;){const p=c?Math.abs(c-u)/c:0,b=u!=null?Math.abs(c-u)/u:0,m=p<s||b<s,y=c?c<h*s:!0,v=u?u<h*s:!0;if(m||(y||v))return c<=u?a:l;const x=o.divide(.5);g/=2;const C=x[0].start.distance(e),S=x[0].end.distance(e),E=C+S,A=x[1].start.distance(e),O=x[1].end.distance(e),T=A+O;E<=T?(o=x[0],l-=g,c=C,u=S):(o=x[1],a+=g,c=A,u=O)}}closestPointTangent(e,t={}){return this.tangentAtT(this.closestPointT(e,t))}containsPoint(e,t={}){return this.toPolyline(t).containsPoint(e)}divideAt(e,t={}){if(e<=0)return this.divideAtT(0);if(e>=1)return this.divideAtT(1);const r=this.tAt(e,t);return this.divideAtT(r)}divideAtLength(e,t={}){const r=this.tAtLength(e,t);return this.divideAtT(r)}divide(e){return this.divideAtT(e)}divideAtT(e){const t=this.start,r=this.controlPoint1,i=this.controlPoint2,s=this.end;if(e<=0)return[new Fe(t,t,t,t),new Fe(t,r,i,s)];if(e>=1)return[new Fe(t,r,i,s),new Fe(s,s,s,s)];const o=this.getSkeletonPoints(e),a=o.startControlPoint1,l=o.startControlPoint2,c=o.divider,u=o.dividerControlPoint1,h=o.dividerControlPoint2;return[new Fe(t,a,l,c),new Fe(c,u,h,s)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(e){const t=this.start,r=this.controlPoint1,i=this.controlPoint2,s=this.end;if(e<=0)return{startControlPoint1:t.clone(),startControlPoint2:t.clone(),divider:t.clone(),dividerControlPoint1:r.clone(),dividerControlPoint2:i.clone()};if(e>=1)return{startControlPoint1:r.clone(),startControlPoint2:i.clone(),divider:s.clone(),dividerControlPoint1:s.clone(),dividerControlPoint2:s.clone()};const o=new F(t,r).pointAt(e),a=new F(r,i).pointAt(e),l=new F(i,s).pointAt(e),c=new F(o,a).pointAt(e),u=new F(a,l).pointAt(e),h=new F(c,u).pointAt(e);return{startControlPoint1:o,startControlPoint2:c,divider:h,dividerControlPoint1:u,dividerControlPoint2:l}}getSubdivisions(e={}){const t=this.getPrecision(e);let r=[new Fe(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(t===0)return r;let i=this.endpointDistance();const s=Math.pow(10,-t);let o=0;for(;;){o+=1;const a=[];r.forEach(u=>{const h=u.divide(.5);a.push(h[0],h[1])});const l=a.reduce((u,h)=>u+h.endpointDistance(),0),c=l!==0?(l-i)/l:0;if(o>1&&c<s)return a;r=a,i=l}}length(e={}){return this.getDivisions(e).reduce((r,i)=>r+i.endpointDistance(),0)}lengthAtT(e,t={}){if(e<=0)return 0;const r=t.precision===void 0?this.PRECISION:t.precision;return this.divide(e)[0].length({precision:r})}pointAt(e,t={}){if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const r=this.tAt(e,t);return this.pointAtT(r)}pointAtLength(e,t={}){const r=this.tAtLength(e,t);return this.pointAtT(r)}pointAtT(e){return e<=0?this.start.clone():e>=1?this.end.clone():this.getSkeletonPoints(e).divider}isDifferentiable(){const e=this.start,t=this.controlPoint1,r=this.controlPoint2,i=this.end;return!(e.equals(t)&&t.equals(r)&&r.equals(i))}tangentAt(e,t={}){if(!this.isDifferentiable())return null;e<0?e=0:e>1&&(e=1);const r=this.tAt(e,t);return this.tangentAtT(r)}tangentAtLength(e,t={}){if(!this.isDifferentiable())return null;const r=this.tAtLength(e,t);return this.tangentAtT(r)}tangentAtT(e){if(!this.isDifferentiable())return null;e<0&&(e=0),e>1&&(e=1);const t=this.getSkeletonPoints(e),r=t.startControlPoint2,i=t.dividerControlPoint1,s=t.divider,o=new F(r,i);return o.translate(s.x-r.x,s.y-r.y),o}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getDivisions(e={}){if(e.subdivisions!=null)return e.subdivisions;const t=this.getPrecision(e);return this.getSubdivisions({precision:t})}getOptions(e={}){const t=this.getPrecision(e),r=this.getDivisions(e);return{precision:t,subdivisions:r}}tAt(e,t={}){if(e<=0)return 0;if(e>=1)return 1;const r=this.getOptions(t),s=this.length(r)*e;return this.tAtLength(s,r)}tAtLength(e,t={}){let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),s=this.getDivisions(t),o={precision:i,subdivisions:s};let a=null,l,c,u=0,h=0,f=0;const d=s.length;let g=d>0?1/d:0;for(let m=0;m<d;m+=1){const y=r?m:d-1-m,v=s[m],w=v.endpointDistance();if(e<=f+w){a=v,l=y*g,c=(y+1)*g,u=r?e-f:w+f-e,h=r?w+f-e:e-f;break}f+=w}if(a==null)return r?1:0;const p=this.length(o),b=Math.pow(10,-i);for(;;){let m;if(m=p!==0?u/p:0,m<b)return l;if(m=p!==0?h/p:0,m<b)return c;let y,v;const w=a.divide(.5);g/=2;const x=w[0].endpointDistance(),C=w[1].endpointDistance();u<=x?(a=w[0],c-=g,y=u,v=x-y):(a=w[1],l+=g,y=u-x,v=C-y),u=y,h=v}}toPoints(e={}){const t=this.getDivisions(e),r=[t[0].start.clone()];return t.forEach(i=>r.push(i.end.clone())),r}toPolyline(e={}){return new He(this.toPoints(e))}scale(e,t,r){return this.start.scale(e,t,r),this.controlPoint1.scale(e,t,r),this.controlPoint2.scale(e,t,r),this.end.scale(e,t,r),this}rotate(e,t){return this.start.rotate(e,t),this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?(this.start.translate(e,t),this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return e!=null&&this.start.equals(e.start)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)&&this.end.equals(e.end)}clone(){return new Fe(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isCurve=e})(Fe||(Fe={})),function(n){function e(i){const s=i.length,o=[],a=[];let l=2;o[0]=i[0]/l;for(let c=1;c<s;c+=1)a[c]=1/l,l=(c<s-1?4:3.5)-a[c],o[c]=(i[c]-o[c-1])/l;for(let c=1;c<s;c+=1)o[s-c-1]-=a[s-c]*o[s-c];return o}function t(i){const s=i.map(f=>P.clone(f)),o=[],a=[],l=s.length-1;if(l===1)return o[0]=new P((2*s[0].x+s[1].x)/3,(2*s[0].y+s[1].y)/3),a[0]=new P(2*o[0].x-s[0].x,2*o[0].y-s[0].y),[o,a];const c=[];for(let f=1;f<l-1;f+=1)c[f]=4*s[f].x+2*s[f+1].x;c[0]=s[0].x+2*s[1].x,c[l-1]=(8*s[l-1].x+s[l].x)/2;const u=e(c);for(let f=1;f<l-1;f+=1)c[f]=4*s[f].y+2*s[f+1].y;c[0]=s[0].y+2*s[1].y,c[l-1]=(8*s[l-1].y+s[l].y)/2;const h=e(c);for(let f=0;f<l;f+=1)o.push(new P(u[f],h[f])),f<l-1?a.push(new P(2*s[f+1].x-u[f+1],2*s[f+1].y-h[f+1])):a.push(new P((s[l].x+u[l-1])/2,(s[l].y+h[l-1])/2));return[o,a]}function r(i){if(i==null||Array.isArray(i)&&i.length<2)throw new Error("At least 2 points are required");const s=t(i),o=[];for(let a=0,l=s[0].length;a<l;a+=1){const c=new P(s[0][a].x,s[0][a].y),u=new P(s[1][a].x,s[1][a].y);o.push(new n(i[a],c,u,i[a+1]))}return o}n.throughPoints=r}(Fe||(Fe={}));class Gl extends Tr{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(this.previousSegment==null)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(e,t){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(e);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(e,t){if(e<=0)return 0;const r=this.length();return e>=1?r:r*e}divideAtT(e){if(this.divideAt)return this.divideAt(e);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(e){if(this.pointAt)return this.pointAt(e);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(e){if(this.tangentAt)return this.tangentAt(e);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class xt extends Gl{constructor(e,t){super(),F.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=P.create(e,t).round(2)}get type(){return"L"}get line(){return new F(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const t=this.line.divideAt(e);return[new xt(t[0]),new xt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[new xt(t[0]),new xt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new xt(this.end)}scale(e,t,r){return this.end.scale(e,t,r),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?this.end.translate(e,t):this.end.translate(e),this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}(function(n){function e(...t){const r=t.length,i=t[0];if(F.isLine(i))return new n(i);if(P.isPointLike(i))return r===1?new n(i):t.map(o=>new n(o));if(r===2)return new n(+t[0],+t[1]);const s=[];for(let o=0;o<r;o+=2){const a=+t[o],l=+t[o+1];s.push(new n(a,l))}return s}n.create=e})(xt||(xt={}));class vs extends Gl{get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new F(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const t=this.line.divideAt(e);return[t[1].isDifferentiable()?new xt(t[0]):this.clone(),new xt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[t[1].isDifferentiable()?new xt(t[0]):this.clone(),new xt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}clone(){return new vs}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}(function(n){function e(){return new n}n.create=e})(vs||(vs={}));class bs extends Gl{constructor(e,t){super(),this.isVisible=!1,this.isSubpathStart=!0,F.isLine(e)||Fe.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=P.create(e,t).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(e,t,r){return this.end.scale(e,t,r),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?this.end.translate(e,t):this.end.translate(e),this}clone(){return new bs(this.end)}equals(e){return this.type===e.type&&this.end.equals(e.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}(function(n){function e(...t){const r=t.length,i=t[0];if(F.isLine(i))return new n(i);if(Fe.isCurve(i))return new n(i);if(P.isPointLike(i)){if(r===1)return new n(i);const o=[];for(let a=0;a<r;a+=1)a===0?o.push(new n(t[a])):o.push(new xt(t[a]));return o}if(r===2)return new n(+t[0],+t[1]);const s=[];for(let o=0;o<r;o+=2){const a=+t[o],l=+t[o+1];o===0?s.push(new n(a,l)):s.push(new xt(a,l))}return s}n.create=e})(bs||(bs={}));class rn extends Gl{constructor(e,t,r,i,s,o){super(),Fe.isCurve(e)?(this.controlPoint1=e.controlPoint1.clone().round(2),this.controlPoint2=e.controlPoint2.clone().round(2),this.endPoint=e.end.clone().round(2)):typeof e=="number"?(this.controlPoint1=new P(e,t).round(2),this.controlPoint2=new P(r,i).round(2),this.endPoint=new P(s,o).round(2)):(this.controlPoint1=P.create(e).round(2),this.controlPoint2=P.create(t).round(2),this.endPoint=P.create(r).round(2))}get type(){return"C"}get curve(){return new Fe(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(e){return this.curve.closestPoint(e)}closestPointLength(e){return this.curve.closestPointLength(e)}closestPointNormalizedLength(e){return this.curve.closestPointNormalizedLength(e)}closestPointTangent(e){return this.curve.closestPointTangent(e)}length(){return this.curve.length()}divideAt(e,t={}){const r=this.curve.divideAt(e,t);return[new rn(r[0]),new rn(r[1])]}divideAtLength(e,t={}){const r=this.curve.divideAtLength(e,t);return[new rn(r[0]),new rn(r[1])]}divideAtT(e){const t=this.curve.divideAtT(e);return[new rn(t[0]),new rn(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.curve.pointAt(e)}pointAtLength(e){return this.curve.pointAtLength(e)}tangentAt(e){return this.curve.tangentAt(e)}tangentAtLength(e){return this.curve.tangentAtLength(e)}isDifferentiable(){if(!this.previousSegment)return!1;const e=this.start,t=this.controlPoint1,r=this.controlPoint2,i=this.end;return!(e.equals(t)&&t.equals(r)&&r.equals(i))}scale(e,t,r){return this.controlPoint1.scale(e,t,r),this.controlPoint2.scale(e,t,r),this.end.scale(e,t,r),this}rotate(e,t){return this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?(this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)}clone(){return new rn(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.controlPoint1,t=this.controlPoint2,r=this.end;return[this.type,e.x,e.y,t.x,t.y,r.x,r.y].join(" ")}}(function(n){function e(...t){const r=t.length,i=t[0];if(Fe.isCurve(i))return new n(i);if(P.isPointLike(i)){if(r===3)return new n(t[0],t[1],t[2]);const o=[];for(let a=0;a<r;a+=3)o.push(new n(t[a],t[a+1],t[a+2]));return o}if(r===6)return new n(t[0],t[1],t[2],t[3],t[4],t[5]);const s=[];for(let o=0;o<r;o+=6)s.push(new n(t[o],t[o+1],t[o+2],t[o+3],t[o+4],t[o+5]));return s}n.create=e})(rn||(rn={}));function Hl(n,e,t){return{x:n*Math.cos(t)-e*Math.sin(t),y:n*Math.sin(t)+e*Math.cos(t)}}function j1(n,e,t,r,i,s){const o=.3333333333333333,a=2/3;return[o*n+a*t,o*e+a*r,o*i+a*t,o*s+a*r,i,s]}function D1(n,e,t,r,i,s,o,a,l,c){const u=Math.PI*120/180,h=Math.PI/180*(+i||0);let f=[],d,g,p,b,m;if(c)g=c[0],p=c[1],b=c[2],m=c[3];else{d=Hl(n,e,-h),n=d.x,e=d.y,d=Hl(a,l,-h),a=d.x,l=d.y;const Y=(n-a)/2,M=(e-l)/2;let k=Y*Y/(t*t)+M*M/(r*r);k>1&&(k=Math.sqrt(k),t=k*t,r=k*r);const Z=t*t,R=r*r,z=(s===o?-1:1)*Math.sqrt(Math.abs((Z*R-Z*M*M-R*Y*Y)/(Z*M*M+R*Y*Y)));b=z*t*M/r+(n+a)/2,m=z*-r*Y/t+(e+l)/2,g=Math.asin((e-m)/r),p=Math.asin((l-m)/r),g=n<b?Math.PI-g:g,p=a<b?Math.PI-p:p,g<0&&(g=Math.PI*2+g),p<0&&(p=Math.PI*2+p),o&&g>p&&(g-=Math.PI*2),!o&&p>g&&(p-=Math.PI*2)}let y=p-g;if(Math.abs(y)>u){const Y=p,M=a,k=l;p=g+u*(o&&p>g?1:-1),a=b+t*Math.cos(p),l=m+r*Math.sin(p),f=D1(a,l,t,r,i,0,o,M,k,[p,Y,b,m])}y=p-g;const v=Math.cos(g),w=Math.sin(g),x=Math.cos(p),C=Math.sin(p),S=Math.tan(y/4),E=4/3*(t*S),A=4/3*(r*S),O=[n,e],T=[n+E*w,e-A*v],I=[a+E*C,l-A*x],G=[a,l];if(T[0]=2*O[0]-T[0],T[1]=2*O[1]-T[1],c)return[T,I,G].concat(f);{f=[T,I,G].concat(f).join().split(",");const Y=[],M=f.length;for(let k=0;k<M;k+=1)Y[k]=k%2?Hl(+f[k-1],+f[k],h).y:Hl(+f[k],+f[k+1],h).x;return Y}}function a6(n){if(!n)return null;const e=`
4
- \v\f\r   ᠎              \u2028\u2029`,t=new RegExp(`([a-z])[${e},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${e}]*,?[${e}]*)+)`,"ig"),r=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${e}]*,?[${e}]*`,"ig"),i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},s=[];return n.replace(t,(o,a,l)=>{const c=[];let u=a.toLowerCase();l.replace(r,(f,d)=>(d&&c.push(+d),f)),u==="m"&&c.length>2&&(s.push([a,...c.splice(0,2)]),u="l",a=a==="m"?"l":"L");const h=i[u];for(;c.length>=h&&(s.push([a,...c.splice(0,h)]),!!h););return o}),s}function l6(n){const e=a6(n);if(!e||!e.length)return[["M",0,0]];let t=0,r=0,i=0,s=0;const o=[];for(let a=0,l=e.length;a<l;a+=1){const c=[];o.push(c);const u=e[a],h=u[0];if(h!==h.toUpperCase())switch(c[0]=h.toUpperCase(),c[0]){case"A":c[1]=u[1],c[2]=u[2],c[3]=u[3],c[4]=u[4],c[5]=u[5],c[6]=+u[6]+t,c[7]=+u[7]+r;break;case"V":c[1]=+u[1]+r;break;case"H":c[1]=+u[1]+t;break;case"M":i=+u[1]+t,s=+u[2]+r;for(let f=1,d=u.length;f<d;f+=1)c[f]=+u[f]+(f%2?t:r);break;default:for(let f=1,d=u.length;f<d;f+=1)c[f]=+u[f]+(f%2?t:r);break}else for(let f=0,d=u.length;f<d;f+=1)c[f]=u[f];switch(c[0]){case"Z":t=+i,r=+s;break;case"H":t=c[1];break;case"V":r=c[1];break;case"M":i=c[c.length-2],s=c[c.length-1],t=c[c.length-2],r=c[c.length-1];break;default:t=c[c.length-2],r=c[c.length-1];break}}return o}function c6(n){const e=l6(n),t={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function r(l,c,u){let h,f;if(!l)return["C",c.x,c.y,c.x,c.y,c.x,c.y];switch(l[0]in{T:1,Q:1}||(c.qx=null,c.qy=null),l[0]){case"M":c.X=l[1],c.Y=l[2];break;case"A":return parseFloat(l[1])===0||parseFloat(l[2])===0?["L",l[6],l[7]]:["C"].concat(D1.apply(0,[c.x,c.y].concat(l.slice(1))));case"S":return u==="C"||u==="S"?(h=c.x*2-c.bx,f=c.y*2-c.by):(h=c.x,f=c.y),["C",h,f].concat(l.slice(1));case"T":return u==="Q"||u==="T"?(c.qx=c.x*2-c.qx,c.qy=c.y*2-c.qy):(c.qx=c.x,c.qy=c.y),["C"].concat(j1(c.x,c.y,c.qx,c.qy,l[1],l[2]));case"Q":return c.qx=l[1],c.qy=l[2],["C"].concat(j1(c.x,c.y,l[1],l[2],l[3],l[4]));case"H":return["L"].concat(l[1],c.y);case"V":return["L"].concat(c.x,l[1])}return l}function i(l,c){if(l[c].length>7){l[c].shift();const u=l[c];for(;u.length;)s[c]="A",c+=1,l.splice(c,0,["C"].concat(u.splice(0,6)));l.splice(c,1),a=e.length}}const s=[];let o="",a=e.length;for(let l=0;l<a;l+=1){let c="";e[l]&&(c=e[l][0]),c!=="C"&&(s[l]=c,l>0&&(o=s[l-1])),e[l]=r(e[l],t,o),s[l]!=="A"&&c==="C"&&(s[l]="C"),i(e,l);const u=e[l],h=u.length;t.x=u[h-2],t.y=u[h-1],t.bx=parseFloat(u[h-4])||t.x,t.by=parseFloat(u[h-3])||t.y}return(!e[0][0]||e[0][0]!=="M")&&e.unshift(["M",0,0]),e}function u6(n){return c6(n).map(e=>e.map(t=>typeof t=="string"?t:be.round(t,2))).join(",").split(",").join(" ")}class X extends Tr{constructor(e){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(e))if(F.isLine(e[0])||Fe.isCurve(e[0])){let t=null;e.forEach((i,s)=>{s===0&&this.appendSegment(X.createSegment("M",i.start)),t!=null&&!t.end.equals(i.start)&&this.appendSegment(X.createSegment("M",i.start)),F.isLine(i)?this.appendSegment(X.createSegment("L",i.end)):Fe.isCurve(i)&&this.appendSegment(X.createSegment("C",i.controlPoint1,i.controlPoint2,i.end)),t=i})}else e.forEach(r=>{r.isSegment&&this.appendSegment(r)});else e!=null&&(F.isLine(e)?(this.appendSegment(X.createSegment("M",e.start)),this.appendSegment(X.createSegment("L",e.end))):Fe.isCurve(e)?(this.appendSegment(X.createSegment("M",e.start)),this.appendSegment(X.createSegment("C",e.controlPoint1,e.controlPoint2,e.end))):He.isPolyline(e)?e.points&&e.points.length&&e.points.forEach((t,r)=>{const i=r===0?X.createSegment("M",t):X.createSegment("L",t);this.appendSegment(i)}):e.isSegment&&this.appendSegment(e))}get start(){const e=this.segments,t=e.length;if(t===0)return null;for(let r=0;r<t;r+=1){const i=e[r];if(i.isVisible)return i.start}return e[t-1].end}get end(){const e=this.segments,t=e.length;if(t===0)return null;for(let r=t-1;r>=0;r-=1){const i=e[r];if(i.isVisible)return i.end}return e[t-1].end}moveTo(...e){return this.appendSegment(bs.create.call(null,...e))}lineTo(...e){return this.appendSegment(xt.create.call(null,...e))}curveTo(...e){return this.appendSegment(rn.create.call(null,...e))}arcTo(e,t,r,i,s,o,a){const l=this.end||new P,c=typeof o=="number"?ql(l.x,l.y,e,t,r,i,s,o,a):ql(l.x,l.y,e,t,r,i,s,o.x,o.y);if(c!=null)for(let u=0,h=c.length;u<h;u+=6)this.curveTo(c[u],c[u+1],c[u+2],c[u+3],c[u+4],c[u+5]);return this}quadTo(e,t,r,i){const s=this.end||new P,o=["M",s.x,s.y];if(typeof e=="number")o.push("Q",e,t,r,i);else{const l=t;o.push("Q",e.x,e.y,l.x,l.y)}const a=X.parse(o.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(vs.create())}drawPoints(e,t={}){const r=R1(e,t),i=X.parse(r);i&&i.segments&&this.appendSegment(i.segments)}bbox(){const e=this.segments,t=e.length;if(t===0)return null;let r;for(let s=0;s<t;s+=1){const o=e[s];if(o.isVisible){const a=o.bbox();a!=null&&(r=r?r.union(a):a)}}if(r!=null)return r;const i=e[t-1];return new D(i.end.x,i.end.y,0,0)}appendSegment(e){const t=this.segments.length;let r=t!==0?this.segments[t-1]:null,i;const s=null;if(Array.isArray(e))for(let o=0,a=e.length;o<a;o+=1){const l=e[o];i=this.prepareSegment(l,r,s),this.segments.push(i),r=i}else e!=null&&e.isSegment&&(i=this.prepareSegment(e,r,s),this.segments.push(i));return this}insertSegment(e,t){const r=this.segments.length;if(e<0&&(e=r+e+1),e>r||e<0)throw new Error("Index out of range.");let i,s=null,o=null;if(r!==0&&(e>=1?(s=this.segments[e-1],o=s.nextSegment):(s=null,o=this.segments[0])),!Array.isArray(t))i=this.prepareSegment(t,s,o),this.segments.splice(e,0,i);else for(let a=0,l=t.length;a<l;a+=1){const c=t[a];i=this.prepareSegment(c,s,o),this.segments.splice(e+a,0,i),s=i}return this}removeSegment(e){const t=this.fixIndex(e),r=this.segments.splice(t,1)[0],i=r.previousSegment,s=r.nextSegment;return i&&(i.nextSegment=s),s&&(s.previousSegment=i),r.isSubpathStart&&s&&this.updateSubpathStartSegment(s),r}replaceSegment(e,t){const r=this.fixIndex(e);let i;const s=this.segments[r];let o=s.previousSegment;const a=s.nextSegment;let l=s.isSubpathStart;if(!Array.isArray(t))i=this.prepareSegment(t,o,a),this.segments.splice(r,1,i),l&&i.isSubpathStart&&(l=!1);else{this.segments.splice(e,1);for(let c=0,u=t.length;c<u;c+=1){const h=t[c];i=this.prepareSegment(h,o,a),this.segments.splice(e+c,0,i),o=i,l&&i.isSubpathStart&&(l=!1)}}l&&a&&this.updateSubpathStartSegment(a)}getSegment(e){const t=this.fixIndex(e);return this.segments[t]}fixIndex(e){const t=this.segments.length;if(t===0)throw new Error("Path has no segments.");let r=e;for(;r<0;)r=t+r;if(r>=t||r<0)throw new Error("Index out of range.");return r}segmentAt(e,t={}){const r=this.segmentIndexAt(e,t);return r?this.getSegment(r):null}segmentAtLength(e,t={}){const r=this.segmentIndexAtLength(e,t);return r?this.getSegment(r):null}segmentIndexAt(e,t={}){if(this.segments.length===0)return null;const r=be.clamp(e,0,1),i=this.getOptions(t),o=this.length(i)*r;return this.segmentIndexAtLength(o,i)}segmentIndexAtLength(e,t={}){const r=this.segments.length;if(r===0)return null;let i=!0;e<0&&(i=!1,e=-e);const s=this.getPrecision(t),o=this.getSubdivisions(t);let a=0,l=null;for(let c=0;c<r;c+=1){const u=i?c:r-1-c,h=this.segments[u],f=o[u],d=h.length({precision:s,subdivisions:f});if(h.isVisible){if(e<=a+d)return u;l=u}a+=d}return l}getSegmentSubdivisions(e={}){const t=this.getPrecision(e),r=[];for(let i=0,s=this.segments.length;i<s;i+=1){const a=this.segments[i].getSubdivisions({precision:t});r.push(a)}return r}updateSubpathStartSegment(e){let t=e.previousSegment,r=e;for(;r&&!r.isSubpathStart;)t!=null?r.subpathStartSegment=t.subpathStartSegment:r.subpathStartSegment=null,t=r,r=r.nextSegment}prepareSegment(e,t,r){e.previousSegment=t,e.nextSegment=r,t!=null&&(t.nextSegment=e),r!=null&&(r.previousSegment=e);let i=e;return e.isSubpathStart&&(e.subpathStartSegment=e,i=r),i!=null&&this.updateSubpathStartSegment(i),e}closestPoint(e,t={}){const r=this.closestPointT(e,t);return r?this.pointAtT(r):null}closestPointLength(e,t={}){const r=this.getOptions(t),i=this.closestPointT(e,r);return i?this.lengthAtT(i,r):0}closestPointNormalizedLength(e,t={}){const r=this.getOptions(t),i=this.closestPointLength(e,r);if(i===0)return 0;const s=this.length(r);return s===0?0:i/s}closestPointT(e,t={}){if(this.segments.length===0)return null;const r=this.getPrecision(t),i=this.getSubdivisions(t);let s,o=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const c=this.segments[a],u=i[a];if(c.isVisible){const h=c.closestPointT(e,{precision:r,subdivisions:u}),f=c.pointAtT(h),d=be.squaredLength(f,e);d<o&&(s={segmentIndex:a,value:h},o=d)}}return s||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(e,t={}){if(this.segments.length===0)return null;const r=this.getPrecision(t),i=this.getSubdivisions(t);let s,o=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const c=this.segments[a],u=i[a];if(c.isDifferentiable()){const h=c.closestPointT(e,{precision:r,subdivisions:u}),f=c.pointAtT(h),d=be.squaredLength(f,e);d<o&&(s=c.tangentAtT(h),o=d)}}return s||null}containsPoint(e,t={}){const r=this.toPolylines(t);if(!r)return!1;let i=0;for(let s=0,o=r.length;s<o;s+=1)r[s].containsPoint(e)&&(i+=1);return i%2===1}pointAt(e,t={}){if(this.segments.length===0)return null;if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const r=this.getOptions(t),s=this.length(r)*e;return this.pointAtLength(s,r)}pointAtLength(e,t={}){if(this.segments.length===0)return null;if(e===0)return this.start.clone();let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),s=this.getSubdivisions(t);let o,a=0;for(let c=0,u=this.segments.length;c<u;c+=1){const h=r?c:u-1-c,f=this.segments[h],d=s[h],g=f.length({precision:i,subdivisions:d});if(f.isVisible){if(e<=a+g)return f.pointAtLength((r?1:-1)*(e-a),{precision:i,subdivisions:d});o=f}a+=g}return o?r?o.end:o.start:this.segments[this.segments.length-1].end.clone()}pointAtT(e){const t=this.segments,r=t.length;if(r===0)return null;const i=e.segmentIndex;if(i<0)return t[0].pointAtT(0);if(i>=r)return t[r-1].pointAtT(1);const s=be.clamp(e.value,0,1);return t[i].pointAtT(s)}divideAt(e,t={}){if(this.segments.length===0)return null;const r=be.clamp(e,0,1),i=this.getOptions(t),o=this.length(i)*r;return this.divideAtLength(o,i)}divideAtLength(e,t={}){if(this.segments.length===0)return null;let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),s=this.getSubdivisions(t);let o=0,a,l,c,u,h;for(let x=0,C=this.segments.length;x<C;x+=1){const S=r?x:C-1-x,E=this.getSegment(S),A=s[S],O={precision:i,subdivisions:A},T=E.length(O);if(E.isDifferentiable()&&(c=E,u=S,e<=o+T)){l=S,a=E.divideAtLength((r?1:-1)*(e-o),O);break}o+=T}if(!c)return null;a||(l=u,h=r?1:0,a=c.divideAtT(h));const f=this.clone(),d=l;f.replaceSegment(d,a);const g=d;let p=d+1,b=d+2;a[0].isDifferentiable()||(f.removeSegment(g),p-=1,b-=1);const m=f.getSegment(p).start;f.insertSegment(p,X.createSegment("M",m)),b+=1,a[1].isDifferentiable()||(f.removeSegment(b-1),b-=1);const y=b-g-1;for(let x=b,C=f.segments.length;x<C;x+=1){const S=this.getSegment(x-y),E=f.getSegment(x);if(E.type==="Z"&&!S.subpathStartSegment.end.equals(E.subpathStartSegment.end)){const A=X.createSegment("L",S.end);f.replaceSegment(x,A)}}const v=new X(f.segments.slice(0,p)),w=new X(f.segments.slice(p));return[v,w]}intersectsWithLine(e,t={}){const r=this.toPolylines(t);if(r==null)return null;let i=null;for(let s=0,o=r.length;s<o;s+=1){const a=r[s],l=e.intersect(a);l&&(i==null&&(i=[]),Array.isArray(l)?i.push(...l):i.push(l))}return i}isDifferentiable(){for(let e=0,t=this.segments.length;e<t;e+=1)if(this.segments[e].isDifferentiable())return!0;return!1}isValid(){const e=this.segments;return e.length===0||e[0].type==="M"}length(e={}){if(this.segments.length===0)return 0;const t=this.getSubdivisions(e);let r=0;for(let i=0,s=this.segments.length;i<s;i+=1){const o=this.segments[i],a=t[i];r+=o.length({subdivisions:a})}return r}lengthAtT(e,t={}){const r=this.segments.length;if(r===0)return 0;let i=e.segmentIndex;if(i<0)return 0;let s=be.clamp(e.value,0,1);i>=r&&(i=r-1,s=1);const o=this.getPrecision(t),a=this.getSubdivisions(t);let l=0;for(let h=0;h<i;h+=1){const f=this.segments[h],d=a[h];l+=f.length({precision:o,subdivisions:d})}const c=this.segments[i],u=a[i];return l+=c.lengthAtT(s,{precision:o,subdivisions:u}),l}tangentAt(e,t={}){if(this.segments.length===0)return null;const r=be.clamp(e,0,1),i=this.getOptions(t),o=this.length(i)*r;return this.tangentAtLength(o,i)}tangentAtLength(e,t={}){if(this.segments.length===0)return null;let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),s=this.getSubdivisions(t);let o,a=0;for(let l=0,c=this.segments.length;l<c;l+=1){const u=r?l:c-1-l,h=this.segments[u],f=s[u],d=h.length({precision:i,subdivisions:f});if(h.isDifferentiable()){if(e<=a+d)return h.tangentAtLength((r?1:-1)*(e-a),{precision:i,subdivisions:f});o=h}a+=d}if(o){const l=r?1:0;return o.tangentAtT(l)}return null}tangentAtT(e){const t=this.segments.length;if(t===0)return null;const r=e.segmentIndex;if(r<0)return this.segments[0].tangentAtT(0);if(r>=t)return this.segments[t-1].tangentAtT(1);const i=be.clamp(e.value,0,1);return this.segments[r].tangentAtT(i)}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getSubdivisions(e={}){if(e.segmentSubdivisions==null){const t=this.getPrecision(e);return this.getSegmentSubdivisions({precision:t})}return e.segmentSubdivisions}getOptions(e={}){const t=this.getPrecision(e),r=this.getSubdivisions(e);return{precision:t,segmentSubdivisions:r}}toPoints(e={}){const t=this.segments,r=t.length;if(r===0)return null;const i=this.getSubdivisions(e),s=[];let o=[];for(let a=0;a<r;a+=1){const l=t[a];if(l.isVisible){const c=i[a];c.length>0?c.forEach(u=>o.push(u.start)):o.push(l.start)}else o.length>0&&(o.push(t[a-1].end),s.push(o),o=[])}return o.length>0&&(o.push(this.end),s.push(o)),s}toPolylines(e={}){const t=this.toPoints(e);return t?t.map(r=>new He(r)):null}scale(e,t,r){return this.segments.forEach(i=>i.scale(e,t,r)),this}rotate(e,t){return this.segments.forEach(r=>r.rotate(e,t)),this}translate(e,t){return typeof e=="number"?this.segments.forEach(r=>r.translate(e,t)):this.segments.forEach(r=>r.translate(e)),this}clone(){const e=new X;return this.segments.forEach(t=>e.appendSegment(t.clone())),e}equals(e){if(e==null)return!1;const t=this.segments,r=e.segments,i=t.length;if(r.length!==i)return!1;for(let s=0;s<i;s+=1){const o=t[s],a=r[s];if(o.type!==a.type||!o.equals(a))return!1}return!0}toJSON(){return this.segments.map(e=>e.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(e=>e.serialize()).join(" ")}toString(){return this.serialize()}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPath=e})(X||(X={})),function(n){function e(r){if(!r)return new n;const i=new n,s=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,o=n.normalize(r).match(s);if(o!=null)for(let a=0,l=o.length;a<l;a+=1){const c=o[a],u=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,h=c.match(u);if(h!=null){const f=h[0],d=h.slice(1).map(p=>+p),g=t.call(null,f,...d);i.appendSegment(g)}}return i}n.parse=e;function t(r,...i){if(r==="M")return bs.create.call(null,...i);if(r==="L")return xt.create.call(null,...i);if(r==="C")return rn.create.call(null,...i);if(r==="z"||r==="Z")return vs.create();throw new Error(`Invalid path segment type "${r}"`)}n.createSegment=t}(X||(X={})),function(n){n.normalize=u6,n.isValid=i6,n.drawArc=o6,n.drawPoints=R1,n.arcToCurves=ql}(X||(X={}));class Ue{constructor(e){this.options=Object.assign({},e),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(e,t,r=!1){if(typeof e=="object"){Object.entries(e).forEach(([o,a])=>{this.register(o,a,t)});return}this.exist(e)&&!r&&!tn.isApplyingHMR()&&this.onDuplicated(e);const i=this.options.process,s=i?K(i,this,e,t):t;return this.data[e]=s,s}unregister(e){const t=e?this.data[e]:null;return delete this.data[e],t}get(e){return e?this.data[e]:null}exist(e){return e?this.data[e]!=null:!1}onDuplicated(e){try{throw this.options.onConflict&&K(this.options.onConflict,this,e),new Error(`${El(this.options.type)} with name '${e}' already registered.`)}catch(t){throw t}}onNotFound(e,t){throw new Error(this.getSpellingSuggestion(e,t))}getSpellingSuggestion(e,t){const r=this.getSpellingSuggestionForName(e),i=t?`${t} ${AV(this.options.type)}`:this.options.type;return`${El(i)} with name '${e}' does not exist.${r?` Did you mean '${r}'?`:""}`}getSpellingSuggestionForName(e){return o4(e,Object.keys(this.data),t=>t)}}(function(n){function e(t){return new n(t)}n.create=e})(Ue||(Ue={}));const h6=Object.freeze(Object.defineProperty({__proto__:null,dot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,e){const t=e.thickness*e.sx,r=e.thickness*e.sy;he(n,{width:t,height:r,rx:t,ry:r,fill:e.color})}},doubleMesh:[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,e){let t;const r=e.width,i=e.height,s=e.thickness;r-s>=0&&i-s>=0?t=["M",r,0,"H0 M0 0 V0",i].join(" "):t="M 0 0 0 0",he(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(n,e){let t;const r=e.factor||1,i=e.width*r,s=e.height*r,o=e.thickness;i-o>=0&&s-o>=0?t=["M",i,0,"H0 M0 0 V0",s].join(" "):t="M 0 0 0 0",e.width=i,e.height=s,he(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}],fixedDot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,e){const t=e.sx<=1?e.thickness*e.sx:e.thickness;he(n,{width:t,height:t,rx:t,ry:t,fill:e.color})}},mesh:{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,e){let t;const r=e.width,i=e.height,s=e.thickness;r-s>=0&&i-s>=0?t=["M",r,0,"H0 M0 0 V0",i].join(" "):t="M 0 0 0 0",he(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}},Symbol.toStringTag,{value:"Module"}));class Or{constructor(){this.patterns={},this.root=ee.create($l(),{width:"100%",height:"100%"},[Zn("defs")]).node}add(e,t){const r=this.root.childNodes[0];r&&r.appendChild(t),this.patterns[e]=t,ee.create("rect",{width:"100%",height:"100%",fill:`url(#${e})`}).appendTo(this.root)}get(e){return this.patterns[e]}has(e){return this.patterns[e]!=null}}(function(n){n.presets=h6,n.registry=Ue.create({type:"grid"}),n.registry.register(n.presets,!0)})(Or||(Or={}));const B1=function(n){const e=document.createElement("canvas"),t=n.width,r=n.height;e.width=t*2,e.height=r;const i=e.getContext("2d");return i.drawImage(n,0,0,t,r),i.translate(2*t,0),i.scale(-1,1),i.drawImage(n,0,0,t,r),e},z1=function(n){const e=document.createElement("canvas"),t=n.width,r=n.height;e.width=t,e.height=r*2;const i=e.getContext("2d");return i.drawImage(n,0,0,t,r),i.translate(0,2*r),i.scale(1,-1),i.drawImage(n,0,0,t,r),e},F1=function(n){const e=document.createElement("canvas"),t=n.width,r=n.height;e.width=2*t,e.height=2*r;const i=e.getContext("2d");return i.drawImage(n,0,0,t,r),i.setTransform(-1,0,0,-1,e.width,e.height),i.drawImage(n,0,0,t,r),i.setTransform(-1,0,0,1,e.width,0),i.drawImage(n,0,0,t,r),i.setTransform(1,0,0,-1,0,e.height),i.drawImage(n,0,0,t,r),e},f6=Object.freeze(Object.defineProperty({__proto__:null,flipX:B1,flipXY:F1,flipY:z1,watermark:function(n,e){const t=n.width,r=n.height,i=document.createElement("canvas");i.width=t*3,i.height=r*3;const s=i.getContext("2d"),o=e.angle!=null?-e.angle:-20,a=ye.toRad(o),l=i.width/4,c=i.height/4;for(let u=0;u<4;u+=1)for(let h=0;h<4;h+=1)(u+h)%2>0&&(s.setTransform(1,0,0,1,(2*u-1)*l,(2*h-1)*c),s.rotate(a),s.drawImage(n,-t/2,-r/2,t,r));return i}},Symbol.toStringTag,{value:"Module"}));var qo;(function(n){n.presets=Object.assign({},f6),n.presets["flip-x"]=B1,n.presets["flip-y"]=z1,n.presets["flip-xy"]=F1,n.registry=Ue.create({type:"background pattern"}),n.registry.register(n.presets,!0)})(qo||(qo={}));function of(n,e){return n!=null?n:e}function ut(n,e){return n!=null&&Number.isFinite(n)?n:e}function d6(n={}){const e=of(n.color,"blue"),t=ut(n.width,1),r=ut(n.margin,2),i=ut(n.opacity,1),s=r,o=r+t;return`
1
+ (function(J,L){typeof exports=="object"&&typeof module!="undefined"?L(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("@ant-design/icons"),require("@formily/shared"),require("react"),require("@formily/react"),require("@formily/reactive"),require("@nocobase/utils/client"),require("antd"),require("react-i18next"),require("@emotion/css"),require("lodash"),require("react-router-dom"),require("ahooks")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","@ant-design/icons","@formily/shared","react","@formily/react","@formily/reactive","@nocobase/utils/client","antd","react-i18next","@emotion/css","lodash","react-router-dom","ahooks"],L):(J=typeof globalThis!="undefined"?globalThis:J||self,L(J["@nocobase/plugin-graph-collection-manager"]={},J["@nocobase/client"],J.jsxRuntime,J["@ant-design/icons"],J["@formily/shared"],J.react,J["@formily/react"],J["@formily/reactive"],J["@nocobase/utils"],J.antd,J["react-i18next"],J["@emotion/css"],J.lodash,J["react-router-dom"],J.ahooks))})(this,function(J,L,_,ue,fo,Z,Ft,go,pn,ce,Qa,Cr,Hu,Uy,BO){"use strict";var BY=Object.defineProperty,zY=Object.defineProperties;var FY=Object.getOwnPropertyDescriptors;var Gu=Object.getOwnPropertySymbols;var IO=Object.prototype.hasOwnProperty,LO=Object.prototype.propertyIsEnumerable;var $O=(J,L,_)=>L in J?BY(J,L,{enumerable:!0,configurable:!0,writable:!0,value:_}):J[L]=_,re=(J,L)=>{for(var _ in L||(L={}))IO.call(L,_)&&$O(J,_,L[_]);if(Gu)for(var _ of Gu(L))LO.call(L,_)&&$O(J,_,L[_]);return J},$e=(J,L)=>zY(J,FY(L));var Hy=(J,L)=>{var _={};for(var ue in J)IO.call(J,ue)&&L.indexOf(ue)<0&&(_[ue]=J[ue]);if(J!=null&&Gu)for(var ue of Gu(J))L.indexOf(ue)<0&&LO.call(J,ue)&&(_[ue]=J[ue]);return _};var Be=(J,L,_)=>new Promise((ue,fo)=>{var Z=pn=>{try{go(_.next(pn))}catch(ce){fo(ce)}},Ft=pn=>{try{go(_.throw(pn))}catch(ce){fo(ce)}},go=pn=>pn.done?ue(pn.value):Promise.resolve(pn.value).then(Z,Ft);go((_=_.apply(J,L)).next())});var Za=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Wy(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function zO(){this.__data__=[],this.size=0}var FO=zO;function VO(n,e){return n===e||n!==n&&e!==e}var Hi=VO,qO=Hi;function GO(n,e){for(var t=n.length;t--;)if(qO(n[t][0],e))return t;return-1}var el=GO,HO=el,UO=Array.prototype,WO=UO.splice;function XO(n){var e=this.__data__,t=HO(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():WO.call(e,t,1),--this.size,!0}var YO=XO,KO=el;function JO(n){var e=this.__data__,t=KO(e,n);return t<0?void 0:e[t][1]}var QO=JO,ZO=el;function eM(n){return ZO(this.__data__,n)>-1}var tM=eM,nM=el;function rM(n,e){var t=this.__data__,r=nM(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}var iM=rM,sM=FO,oM=YO,aM=QO,lM=tM,cM=iM;function Ui(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Ui.prototype.clear=sM,Ui.prototype.delete=oM,Ui.prototype.get=aM,Ui.prototype.has=lM,Ui.prototype.set=cM;var tl=Ui,uM=tl;function hM(){this.__data__=new uM,this.size=0}var fM=hM;function dM(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}var gM=dM;function pM(n){return this.__data__.get(n)}var mM=pM;function yM(n){return this.__data__.has(n)}var vM=yM,bM=typeof Za=="object"&&Za&&Za.Object===Object&&Za,Xy=bM,wM=Xy,xM=typeof self=="object"&&self&&self.Object===Object&&self,CM=wM||xM||Function("return this")(),mn=CM,SM=mn,PM=SM.Symbol,Wi=PM,Yy=Wi,Ky=Object.prototype,EM=Ky.hasOwnProperty,AM=Ky.toString,po=Yy?Yy.toStringTag:void 0;function TM(n){var e=EM.call(n,po),t=n[po];try{n[po]=void 0;var r=!0}catch(s){}var i=AM.call(n);return r&&(e?n[po]=t:delete n[po]),i}var OM=TM,MM=Object.prototype,_M=MM.toString;function NM(n){return _M.call(n)}var kM=NM,Jy=Wi,$M=OM,IM=kM,LM="[object Null]",RM="[object Undefined]",Qy=Jy?Jy.toStringTag:void 0;function jM(n){return n==null?n===void 0?RM:LM:Qy&&Qy in Object(n)?$M(n):IM(n)}var ui=jM;function DM(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Qt=DM,BM=ui,zM=Qt,FM="[object AsyncFunction]",VM="[object Function]",qM="[object GeneratorFunction]",GM="[object Proxy]";function HM(n){if(!zM(n))return!1;var e=BM(n);return e==VM||e==qM||e==FM||e==GM}var mo=HM,UM=mn,WM=UM["__core-js_shared__"],XM=WM,Uu=XM,Zy=function(){var n=/[^.]+$/.exec(Uu&&Uu.keys&&Uu.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function YM(n){return!!Zy&&Zy in n}var KM=YM,JM=Function.prototype,QM=JM.toString;function ZM(n){if(n!=null){try{return QM.call(n)}catch(e){}try{return n+""}catch(e){}}return""}var ev=ZM,e2=mo,t2=KM,n2=Qt,r2=ev,i2=/[\\^$.*+?()[\]{}|]/g,s2=/^\[object .+?Constructor\]$/,o2=Function.prototype,a2=Object.prototype,l2=o2.toString,c2=a2.hasOwnProperty,u2=RegExp("^"+l2.call(c2).replace(i2,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h2(n){if(!n2(n)||t2(n))return!1;var e=e2(n)?u2:s2;return e.test(r2(n))}var f2=h2;function d2(n,e){return n==null?void 0:n[e]}var g2=d2,p2=f2,m2=g2;function y2(n,e){var t=m2(n,e);return p2(t)?t:void 0}var hi=y2,v2=hi,b2=mn,w2=v2(b2,"Map"),Wu=w2,x2=hi,C2=x2(Object,"create"),nl=C2,tv=nl;function S2(){this.__data__=tv?tv(null):{},this.size=0}var P2=S2;function E2(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var A2=E2,T2=nl,O2="__lodash_hash_undefined__",M2=Object.prototype,_2=M2.hasOwnProperty;function N2(n){var e=this.__data__;if(T2){var t=e[n];return t===O2?void 0:t}return _2.call(e,n)?e[n]:void 0}var k2=N2,$2=nl,I2=Object.prototype,L2=I2.hasOwnProperty;function R2(n){var e=this.__data__;return $2?e[n]!==void 0:L2.call(e,n)}var j2=R2,D2=nl,B2="__lodash_hash_undefined__";function z2(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=D2&&e===void 0?B2:e,this}var F2=z2,V2=P2,q2=A2,G2=k2,H2=j2,U2=F2;function Xi(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Xi.prototype.clear=V2,Xi.prototype.delete=q2,Xi.prototype.get=G2,Xi.prototype.has=H2,Xi.prototype.set=U2;var W2=Xi,nv=W2,X2=tl,Y2=Wu;function K2(){this.size=0,this.__data__={hash:new nv,map:new(Y2||X2),string:new nv}}var J2=K2;function Q2(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}var Z2=Q2,e_=Z2;function t_(n,e){var t=n.__data__;return e_(e)?t[typeof e=="string"?"string":"hash"]:t.map}var rl=t_,n_=rl;function r_(n){var e=n_(this,n).delete(n);return this.size-=e?1:0,e}var i_=r_,s_=rl;function o_(n){return s_(this,n).get(n)}var a_=o_,l_=rl;function c_(n){return l_(this,n).has(n)}var u_=c_,h_=rl;function f_(n,e){var t=h_(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}var d_=f_,g_=J2,p_=i_,m_=a_,y_=u_,v_=d_;function Yi(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Yi.prototype.clear=g_,Yi.prototype.delete=p_,Yi.prototype.get=m_,Yi.prototype.has=y_,Yi.prototype.set=v_;var Xu=Yi,b_=tl,w_=Wu,x_=Xu,C_=200;function S_(n,e){var t=this.__data__;if(t instanceof b_){var r=t.__data__;if(!w_||r.length<C_-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new x_(r)}return t.set(n,e),this.size=t.size,this}var P_=S_,E_=tl,A_=fM,T_=gM,O_=mM,M_=vM,__=P_;function Ki(n){var e=this.__data__=new E_(n);this.size=e.size}Ki.prototype.clear=A_,Ki.prototype.delete=T_,Ki.prototype.get=O_,Ki.prototype.has=M_,Ki.prototype.set=__;var il=Ki;function N_(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var Yu=N_,k_=hi,$_=function(){try{var n=k_(Object,"defineProperty");return n({},"",{}),n}catch(e){}}(),rv=$_,iv=rv;function I_(n,e,t){e=="__proto__"&&iv?iv(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}var sl=I_,L_=sl,R_=Hi,j_=Object.prototype,D_=j_.hasOwnProperty;function B_(n,e,t){var r=n[e];(!(D_.call(n,e)&&R_(r,t))||t===void 0&&!(e in n))&&L_(n,e,t)}var ol=B_,z_=ol,F_=sl;function V_(n,e,t,r){var i=!t;t||(t={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=r?r(t[a],n[a],a,t,n):void 0;l===void 0&&(l=n[a]),i?F_(t,a,l):z_(t,a,l)}return t}var yo=V_;function q_(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var G_=q_;function H_(n){return n!=null&&typeof n=="object"}var kn=H_,U_=ui,W_=kn,X_="[object Arguments]";function Y_(n){return W_(n)&&U_(n)==X_}var K_=Y_,sv=K_,J_=kn,ov=Object.prototype,Q_=ov.hasOwnProperty,Z_=ov.propertyIsEnumerable,eN=sv(function(){return arguments}())?sv:function(n){return J_(n)&&Q_.call(n,"callee")&&!Z_.call(n,"callee")},vo=eN,tN=Array.isArray,Qe=tN,al={exports:{}};function nN(){return!1}var rN=nN;al.exports,function(n,e){var t=mn,r=rN,i=e&&!e.nodeType&&e,s=i&&!0&&n&&!n.nodeType&&n,o=s&&s.exports===i,a=o?t.Buffer:void 0,l=a?a.isBuffer:void 0,c=l||r;n.exports=c}(al,al.exports);var Ji=al.exports,iN=9007199254740991,sN=/^(?:0|[1-9]\d*)$/;function oN(n,e){var t=typeof n;return e=e==null?iN:e,!!e&&(t=="number"||t!="symbol"&&sN.test(n))&&n>-1&&n%1==0&&n<e}var ll=oN,aN=9007199254740991;function lN(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=aN}var Ku=lN,cN=ui,uN=Ku,hN=kn,fN="[object Arguments]",dN="[object Array]",gN="[object Boolean]",pN="[object Date]",mN="[object Error]",yN="[object Function]",vN="[object Map]",bN="[object Number]",wN="[object Object]",xN="[object RegExp]",CN="[object Set]",SN="[object String]",PN="[object WeakMap]",EN="[object ArrayBuffer]",AN="[object DataView]",TN="[object Float32Array]",ON="[object Float64Array]",MN="[object Int8Array]",_N="[object Int16Array]",NN="[object Int32Array]",kN="[object Uint8Array]",$N="[object Uint8ClampedArray]",IN="[object Uint16Array]",LN="[object Uint32Array]",Te={};Te[TN]=Te[ON]=Te[MN]=Te[_N]=Te[NN]=Te[kN]=Te[$N]=Te[IN]=Te[LN]=!0,Te[fN]=Te[dN]=Te[EN]=Te[gN]=Te[AN]=Te[pN]=Te[mN]=Te[yN]=Te[vN]=Te[bN]=Te[wN]=Te[xN]=Te[CN]=Te[SN]=Te[PN]=!1;function RN(n){return hN(n)&&uN(n.length)&&!!Te[cN(n)]}var jN=RN;function DN(n){return function(e){return n(e)}}var cl=DN,ul={exports:{}};ul.exports,function(n,e){var t=Xy,r=e&&!e.nodeType&&e,i=r&&!0&&n&&!n.nodeType&&n,s=i&&i.exports===r,o=s&&t.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch(c){}}();n.exports=a}(ul,ul.exports);var Ju=ul.exports,BN=jN,zN=cl,av=Ju,lv=av&&av.isTypedArray,FN=lv?zN(lv):BN,bo=FN,VN=G_,qN=vo,GN=Qe,HN=Ji,UN=ll,WN=bo,XN=Object.prototype,YN=XN.hasOwnProperty;function KN(n,e){var t=GN(n),r=!t&&qN(n),i=!t&&!r&&HN(n),s=!t&&!r&&!i&&WN(n),o=t||r||i||s,a=o?VN(n.length,String):[],l=a.length;for(var c in n)(e||YN.call(n,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||UN(c,l)))&&a.push(c);return a}var cv=KN,JN=Object.prototype;function QN(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||JN;return n===t}var hl=QN;function ZN(n,e){return function(t){return n(e(t))}}var uv=ZN,ek=uv,tk=ek(Object.keys,Object),nk=tk,rk=hl,ik=nk,sk=Object.prototype,ok=sk.hasOwnProperty;function ak(n){if(!rk(n))return ik(n);var e=[];for(var t in Object(n))ok.call(n,t)&&t!="constructor"&&e.push(t);return e}var Qu=ak,lk=mo,ck=Ku;function uk(n){return n!=null&&ck(n.length)&&!lk(n)}var Wn=uk,hk=cv,fk=Qu,dk=Wn;function gk(n){return dk(n)?hk(n):fk(n)}var Sr=gk,pk=yo,mk=Sr;function yk(n,e){return n&&pk(e,mk(e),n)}var vk=yk;function bk(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var wk=bk,xk=Qt,Ck=hl,Sk=wk,Pk=Object.prototype,Ek=Pk.hasOwnProperty;function Ak(n){if(!xk(n))return Sk(n);var e=Ck(n),t=[];for(var r in n)r=="constructor"&&(e||!Ek.call(n,r))||t.push(r);return t}var Tk=Ak,Ok=cv,Mk=Tk,_k=Wn;function Nk(n){return _k(n)?Ok(n,!0):Mk(n)}var fi=Nk,kk=yo,$k=fi;function Ik(n,e){return n&&kk(e,$k(e),n)}var Lk=Ik,fl={exports:{}};fl.exports,function(n,e){var t=mn,r=e&&!e.nodeType&&e,i=r&&!0&&n&&!n.nodeType&&n,s=i&&i.exports===r,o=s?t.Buffer:void 0,a=o?o.allocUnsafe:void 0;function l(c,u){if(u)return c.slice();var h=c.length,f=a?a(h):new c.constructor(h);return c.copy(f),f}n.exports=l}(fl,fl.exports);var hv=fl.exports;function Rk(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var fv=Rk;function jk(n,e){for(var t=-1,r=n==null?0:n.length,i=0,s=[];++t<r;){var o=n[t];e(o,t,n)&&(s[i++]=o)}return s}var dv=jk;function Dk(){return[]}var gv=Dk,Bk=dv,zk=gv,Fk=Object.prototype,Vk=Fk.propertyIsEnumerable,pv=Object.getOwnPropertySymbols,qk=pv?function(n){return n==null?[]:(n=Object(n),Bk(pv(n),function(e){return Vk.call(n,e)}))}:zk,Zu=qk,Gk=yo,Hk=Zu;function Uk(n,e){return Gk(n,Hk(n),e)}var Wk=Uk;function Xk(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}var eh=Xk,Yk=uv,Kk=Yk(Object.getPrototypeOf,Object),dl=Kk,Jk=eh,Qk=dl,Zk=Zu,e$=gv,t$=Object.getOwnPropertySymbols,n$=t$?function(n){for(var e=[];n;)Jk(e,Zk(n)),n=Qk(n);return e}:e$,mv=n$,r$=yo,i$=mv;function s$(n,e){return r$(n,i$(n),e)}var o$=s$,a$=eh,l$=Qe;function c$(n,e,t){var r=e(n);return l$(n)?r:a$(r,t(n))}var yv=c$,u$=yv,h$=Zu,f$=Sr;function d$(n){return u$(n,f$,h$)}var vv=d$,g$=yv,p$=mv,m$=fi;function y$(n){return g$(n,m$,p$)}var v$=y$,b$=hi,w$=mn,x$=b$(w$,"DataView"),C$=x$,S$=hi,P$=mn,E$=S$(P$,"Promise"),A$=E$,T$=hi,O$=mn,M$=T$(O$,"Set"),bv=M$,_$=hi,N$=mn,k$=_$(N$,"WeakMap"),$$=k$,th=C$,nh=Wu,rh=A$,ih=bv,sh=$$,wv=ui,Qi=ev,xv="[object Map]",I$="[object Object]",Cv="[object Promise]",Sv="[object Set]",Pv="[object WeakMap]",Ev="[object DataView]",L$=Qi(th),R$=Qi(nh),j$=Qi(rh),D$=Qi(ih),B$=Qi(sh),di=wv;(th&&di(new th(new ArrayBuffer(1)))!=Ev||nh&&di(new nh)!=xv||rh&&di(rh.resolve())!=Cv||ih&&di(new ih)!=Sv||sh&&di(new sh)!=Pv)&&(di=function(n){var e=wv(n),t=e==I$?n.constructor:void 0,r=t?Qi(t):"";if(r)switch(r){case L$:return Ev;case R$:return xv;case j$:return Cv;case D$:return Sv;case B$:return Pv}return e});var Zi=di,z$=Object.prototype,F$=z$.hasOwnProperty;function V$(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&F$.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var q$=V$,G$=mn,H$=G$.Uint8Array,Av=H$,Tv=Av;function U$(n){var e=new n.constructor(n.byteLength);return new Tv(e).set(new Tv(n)),e}var oh=U$,W$=oh;function X$(n,e){var t=e?W$(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var Y$=X$,K$=/\w*$/;function J$(n){var e=new n.constructor(n.source,K$.exec(n));return e.lastIndex=n.lastIndex,e}var Q$=J$,Ov=Wi,Mv=Ov?Ov.prototype:void 0,_v=Mv?Mv.valueOf:void 0;function Z$(n){return _v?Object(_v.call(n)):{}}var eI=Z$,tI=oh;function nI(n,e){var t=e?tI(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var Nv=nI,rI=oh,iI=Y$,sI=Q$,oI=eI,aI=Nv,lI="[object Boolean]",cI="[object Date]",uI="[object Map]",hI="[object Number]",fI="[object RegExp]",dI="[object Set]",gI="[object String]",pI="[object Symbol]",mI="[object ArrayBuffer]",yI="[object DataView]",vI="[object Float32Array]",bI="[object Float64Array]",wI="[object Int8Array]",xI="[object Int16Array]",CI="[object Int32Array]",SI="[object Uint8Array]",PI="[object Uint8ClampedArray]",EI="[object Uint16Array]",AI="[object Uint32Array]";function TI(n,e,t){var r=n.constructor;switch(e){case mI:return rI(n);case lI:case cI:return new r(+n);case yI:return iI(n,t);case vI:case bI:case wI:case xI:case CI:case SI:case PI:case EI:case AI:return aI(n,t);case uI:return new r;case hI:case gI:return new r(n);case fI:return sI(n);case dI:return new r;case pI:return oI(n)}}var OI=TI,MI=Qt,kv=Object.create,_I=function(){function n(){}return function(e){if(!MI(e))return{};if(kv)return kv(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}(),$v=_I,NI=$v,kI=dl,$I=hl;function II(n){return typeof n.constructor=="function"&&!$I(n)?NI(kI(n)):{}}var Iv=II,LI=Zi,RI=kn,jI="[object Map]";function DI(n){return RI(n)&&LI(n)==jI}var BI=DI,zI=BI,FI=cl,Lv=Ju,Rv=Lv&&Lv.isMap,VI=Rv?FI(Rv):zI,qI=VI,GI=Zi,HI=kn,UI="[object Set]";function WI(n){return HI(n)&&GI(n)==UI}var XI=WI,YI=XI,KI=cl,jv=Ju,Dv=jv&&jv.isSet,JI=Dv?KI(Dv):YI,QI=JI,ZI=il,eL=Yu,tL=ol,nL=vk,rL=Lk,iL=hv,sL=fv,oL=Wk,aL=o$,lL=vv,cL=v$,uL=Zi,hL=q$,fL=OI,dL=Iv,gL=Qe,pL=Ji,mL=qI,yL=Qt,vL=QI,bL=Sr,wL=fi,xL=1,CL=2,SL=4,Bv="[object Arguments]",PL="[object Array]",EL="[object Boolean]",AL="[object Date]",TL="[object Error]",zv="[object Function]",OL="[object GeneratorFunction]",ML="[object Map]",_L="[object Number]",Fv="[object Object]",NL="[object RegExp]",kL="[object Set]",$L="[object String]",IL="[object Symbol]",LL="[object WeakMap]",RL="[object ArrayBuffer]",jL="[object DataView]",DL="[object Float32Array]",BL="[object Float64Array]",zL="[object Int8Array]",FL="[object Int16Array]",VL="[object Int32Array]",qL="[object Uint8Array]",GL="[object Uint8ClampedArray]",HL="[object Uint16Array]",UL="[object Uint32Array]",Ce={};Ce[Bv]=Ce[PL]=Ce[RL]=Ce[jL]=Ce[EL]=Ce[AL]=Ce[DL]=Ce[BL]=Ce[zL]=Ce[FL]=Ce[VL]=Ce[ML]=Ce[_L]=Ce[Fv]=Ce[NL]=Ce[kL]=Ce[$L]=Ce[IL]=Ce[qL]=Ce[GL]=Ce[HL]=Ce[UL]=!0,Ce[TL]=Ce[zv]=Ce[LL]=!1;function gl(n,e,t,r,i,s){var o,a=e&xL,l=e&CL,c=e&SL;if(t&&(o=i?t(n,r,i,s):t(n)),o!==void 0)return o;if(!yL(n))return n;var u=gL(n);if(u){if(o=hL(n),!a)return sL(n,o)}else{var h=uL(n),f=h==zv||h==OL;if(pL(n))return iL(n,a);if(h==Fv||h==Bv||f&&!i){if(o=l||f?{}:dL(n),!a)return l?aL(n,rL(o,n)):oL(n,nL(o,n))}else{if(!Ce[h])return i?n:{};o=fL(n,h,a)}}s||(s=new ZI);var d=s.get(n);if(d)return d;s.set(n,o),vL(n)?n.forEach(function(b){o.add(gl(b,e,t,b,n,s))}):mL(n)&&n.forEach(function(b,m){o.set(m,gl(b,e,t,m,n,s))});var g=c?l?cL:lL:l?wL:bL,p=u?void 0:g(n);return eL(p||n,function(b,m){p&&(m=b,b=n[m]),tL(o,m,gl(b,e,t,m,n,s))}),o}var Vv=gl,WL=Vv,XL=1,YL=4;function KL(n){return WL(n,XL|YL)}var qv=KL;const JL=Wy(qv),gi=Z.createContext(null),Gv=n=>{const{record:e,setTargetNode:t,node:r,handelOpenPorts:i}=n;return _.jsx(gi.Provider,{value:{node:r,record:e,positionTargetNode:s=>{t(s||r)},openPorts:i},children:n.children})},QL=(n,e)=>{const t=L.useRequest(()=>Promise.resolve({data:JL(e)}),$e(re({},n),{manual:!0})),r=L.useActionContext();return Z.useEffect(()=>{r.visible&&t.run()},[r.visible]),t};Ft.observer(()=>{const{record:n}=Z.useContext(gi),e=L.useCompile();return _.jsx("div",{children:_.jsx(ce.Select,{popupMatchSelectWidth:!1,disabled:!0,value:n.name,options:[{value:n.name,label:e(n.title)}]})})},{displayName:"SourceCollection"});const Xn=()=>{const n=Ft.useForm(),e=L.useActionContext();return{run(){return Be(this,null,function*(){e.setVisible(!1),n.reset()})}}},Hv=n=>{const e=Ft.useForm(),t=L.useAPIClient(),r=L.useActionContext(),{refreshCM:i}=L.useCollectionManager();return{run(){return Be(this,null,function*(){yield e.submit(),yield t.resource("collections").create({values:e.values}),r.setVisible(!1),yield e.reset(),n("last"),yield i()})}}},Uv=(n,e)=>{const t=Ft.useForm(),r=L.useAPIClient(),i=L.useActionContext(),{refreshCM:s}=L.useCollectionManager(),{positionTargetNode:o,openPorts:a}=Z.useContext(gi),{getValues:l}=L.useCollectionFieldFormValues();return{run(){return Be(this,null,function*(){yield t.submit();const u=l(),h=pn.lodash.omit(u,["key","uiSchemaUid","collectionName","autoCreateReverseField","uiSchema.x-uid","reverseField.key","reverseField.uiSchemaUid"]),f=!["obo","oho","o2o","o2m","m2o","m2m","linkTo","id"].includes(u.interface),{data:{data:d}}=yield r.resource("collections.fields",n).create({values:h});e&&(yield r.resource("fields").move({sourceId:d.key,targetId:e,targetScope:n,method:"insertAfter"})),i.setVisible(!1),yield t.reset(),o(),f&&a&&a(),yield s()})}}},ZL=({collectionName:n,name:e,key:t})=>{const{refreshCM:r}=L.useCollectionManager(),{t:i}=Qa.useTranslation(),s=Ft.useForm(),o=L.useActionContext(),a=L.useAPIClient(),{positionTargetNode:l,node:c}=Z.useContext(gi);return{run(){return Be(this,null,function*(){var h;yield s.submit(),yield a.resource("collections.fields",n).update({filterByTk:e,values:s.values}),o.setVisible(!1),ce.message.success(i("Saved successfully")),l(),r(),c.setPortProp(t,"uiSchema",{title:(h=s.values)==null?void 0:h.uiSchema.title}),yield s.reset()})}}},pl=()=>{const{t:n}=Qa.useTranslation(),e=Ft.useForm(),t=L.useActionContext(),{name:r}=e.values,i=L.useAPIClient(),{refreshCM:s}=L.useCollectionManager(),{positionTargetNode:o}=Z.useContext(gi);return{run(){return Be(this,null,function*(){yield e.submit(),yield i.resource("collections").update({filterByTk:r,values:re({},pn.lodash.omit(e.values,["fields"]))}),t.setVisible(!1),ce.message.success(n("Saved successfully")),yield e.reset(),o(),s()})}}},eR=n=>{const e=L.useAPIClient(),t=Ft.useForm(),{cascade:r}=(t==null?void 0:t.values)||{};return{run(){return Be(this,null,function*(){yield e.resource("collections").destroy({filterByTk:n,cascade:r}),yield e.resource("graphPositions").destroy({filter:{collectionName:n}})})}}},tR=n=>{const{name:e}=n,{run:t}=eR(e),{refreshCM:r}=L.useCollectionManager(),{positionTargetNode:i}=Z.useContext(gi);return{run(){return Be(this,null,function*(){yield t(),i("destory"),yield r()})}}},nR=(n,e)=>{const t=L.useAPIClient(),{positionTargetNode:r}=Z.useContext(gi);return{run(){return Be(this,null,function*(){yield t.resource("collections.fields",n).destroy({filterByTk:e}),r()})}}},rR=n=>{const{collectionName:e,name:t}=n,{refreshCM:r}=L.useCollectionManager(),{run:i}=nR(e,t);return{run(){return Be(this,null,function*(){yield i(),yield r()})}}},ah=n=>(e,{targetScope:t})=>{e.loading=!0,n(t).then(go.action.bound(r=>{e.dataSource=r,e.loading=!1})).catch(r=>{pn.error(r)})};typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),function(n){n.forEach(e=>{Object.prototype.hasOwnProperty.call(e,"append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value(...t){const r=document.createDocumentFragment();t.forEach(i=>{const s=i instanceof Node;r.appendChild(s?i:document.createTextNode(String(i)))}),this.appendChild(r)}})})}([Element.prototype,Document.prototype,DocumentFragment.prototype]);class $n{get disposed(){return this._disposed===!0}dispose(){this._disposed=!0}}(function(n){function e(){return(t,r,i)=>{const s=i.value,o=t.__proto__;i.value=function(){this.disposed||(s.call(this),o.dispose.call(this))}}}n.dispose=e})($n||($n={}));class Wv{constructor(){this.isDisposed=!1,this.items=new Set}get disposed(){return this.isDisposed}dispose(){this.isDisposed||(this.isDisposed=!0,this.items.forEach(e=>{e.dispose()}),this.items.clear())}contains(e){return this.items.has(e)}add(e){this.items.add(e)}remove(e){this.items.delete(e)}clear(){this.items.clear()}}(function(n){function e(t){const r=new n;return t.forEach(i=>{r.add(i)}),r}n.from=e})(Wv||(Wv={}));var iR=typeof global=="object"&&global&&global.Object===Object&&global;const Xv=iR;var sR=typeof self=="object"&&self&&self.Object===Object&&self,oR=Xv||sR||Function("return this")();const yn=oR;var aR=yn.Symbol;const Zt=aR;var Yv=Object.prototype,lR=Yv.hasOwnProperty,cR=Yv.toString,wo=Zt?Zt.toStringTag:void 0;function uR(n){var e=lR.call(n,wo),t=n[wo];try{n[wo]=void 0;var r=!0}catch(s){}var i=cR.call(n);return r&&(e?n[wo]=t:delete n[wo]),i}var hR=Object.prototype,fR=hR.toString;function dR(n){return fR.call(n)}var gR="[object Null]",pR="[object Undefined]",Kv=Zt?Zt.toStringTag:void 0;function Pr(n){return n==null?n===void 0?pR:gR:Kv&&Kv in Object(n)?uR(n):dR(n)}function vn(n){return n!=null&&typeof n=="object"}var mR="[object Symbol]";function In(n){return typeof n=="symbol"||vn(n)&&Pr(n)==mR}function xo(n,e){for(var t=-1,r=n==null?0:n.length,i=Array(r);++t<r;)i[t]=e(n[t],t,n);return i}var yR=Array.isArray;const bt=yR;var vR=1/0,Jv=Zt?Zt.prototype:void 0,Qv=Jv?Jv.toString:void 0;function Zv(n){if(typeof n=="string")return n;if(bt(n))return xo(n,Zv)+"";if(In(n))return Qv?Qv.call(n):"";var e=n+"";return e=="0"&&1/n==-vR?"-0":e}var bR=/\s/;function wR(n){for(var e=n.length;e--&&bR.test(n.charAt(e)););return e}var xR=/^\s+/;function CR(n){return n&&n.slice(0,wR(n)+1).replace(xR,"")}function Ze(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var e0=0/0,SR=/^[-+]0x[0-9a-f]+$/i,PR=/^0b[01]+$/i,ER=/^0o[0-7]+$/i,AR=parseInt;function Co(n){if(typeof n=="number")return n;if(In(n))return e0;if(Ze(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Ze(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=CR(n);var t=PR.test(n);return t||ER.test(n)?AR(n.slice(2),t?2:8):SR.test(n)?e0:+n}function es(n){return n}var TR="[object AsyncFunction]",OR="[object Function]",MR="[object GeneratorFunction]",_R="[object Proxy]";function lh(n){if(!Ze(n))return!1;var e=Pr(n);return e==OR||e==MR||e==TR||e==_R}var NR=yn["__core-js_shared__"];const ch=NR;var t0=function(){var n=/[^.]+$/.exec(ch&&ch.keys&&ch.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function kR(n){return!!t0&&t0 in n}var $R=Function.prototype,IR=$R.toString;function pi(n){if(n!=null){try{return IR.call(n)}catch(e){}try{return n+""}catch(e){}}return""}var LR=/[\\^$.*+?()[\]{}|]/g,RR=/^\[object .+?Constructor\]$/,jR=Function.prototype,DR=Object.prototype,BR=jR.toString,zR=DR.hasOwnProperty,FR=RegExp("^"+BR.call(zR).replace(LR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function VR(n){if(!Ze(n)||kR(n))return!1;var e=lh(n)?FR:RR;return e.test(pi(n))}function qR(n,e){return n==null?void 0:n[e]}function mi(n,e){var t=qR(n,e);return VR(t)?t:void 0}var GR=mi(yn,"WeakMap");const uh=GR;var n0=Object.create,HR=function(){function n(){}return function(e){if(!Ze(e))return{};if(n0)return n0(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();const UR=HR;function r0(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function WR(){}function i0(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var XR=800,YR=16,KR=Date.now;function JR(n){var e=0,t=0;return function(){var r=KR(),i=YR-(r-t);if(t=r,i>0){if(++e>=XR)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function QR(n){return function(){return n}}var ZR=function(){try{var n=mi(Object,"defineProperty");return n({},"",{}),n}catch(e){}}();const ml=ZR;var ej=ml?function(n,e){return ml(n,"toString",{configurable:!0,enumerable:!1,value:QR(e),writable:!0})}:es,tj=JR(ej);const nj=tj;function rj(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}function ij(n,e,t,r){for(var i=n.length,s=t+(r?1:-1);r?s--:++s<i;)if(e(n[s],s,n))return s;return-1}function sj(n){return n!==n}function oj(n,e,t){for(var r=t-1,i=n.length;++r<i;)if(n[r]===e)return r;return-1}function aj(n,e,t){return e===e?oj(n,e,t):ij(n,sj,t)}function s0(n,e){var t=n==null?0:n.length;return!!t&&aj(n,e,0)>-1}var lj=9007199254740991,cj=/^(?:0|[1-9]\d*)$/;function hh(n,e){var t=typeof n;return e=e==null?lj:e,!!e&&(t=="number"||t!="symbol"&&cj.test(n))&&n>-1&&n%1==0&&n<e}function yl(n,e,t){e=="__proto__"&&ml?ml(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function ts(n,e){return n===e||n!==n&&e!==e}var uj=Object.prototype,hj=uj.hasOwnProperty;function o0(n,e,t){var r=n[e];(!(hj.call(n,e)&&ts(r,t))||t===void 0&&!(e in n))&&yl(n,e,t)}function So(n,e,t,r){var i=!t;t||(t={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=r?r(t[a],n[a],a,t,n):void 0;l===void 0&&(l=n[a]),i?yl(t,a,l):o0(t,a,l)}return t}var a0=Math.max;function fj(n,e,t){return e=a0(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,s=a0(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=t(o),r0(n,this,a)}}function ns(n,e){return nj(fj(n,e,es),n+"")}var dj=9007199254740991;function fh(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=dj}function yi(n){return n!=null&&fh(n.length)&&!lh(n)}function vl(n,e,t){if(!Ze(t))return!1;var r=typeof e;return(r=="number"?yi(t)&&hh(e,t.length):r=="string"&&e in t)?ts(t[e],n):!1}function l0(n){return ns(function(e,t){var r=-1,i=t.length,s=i>1?t[i-1]:void 0,o=i>2?t[2]:void 0;for(s=n.length>3&&typeof s=="function"?(i--,s):void 0,o&&vl(t[0],t[1],o)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var a=t[r];a&&n(e,a,r,s)}return e})}var gj=Object.prototype;function bl(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||gj;return n===t}function pj(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var mj="[object Arguments]";function c0(n){return vn(n)&&Pr(n)==mj}var u0=Object.prototype,yj=u0.hasOwnProperty,vj=u0.propertyIsEnumerable,bj=c0(function(){return arguments}())?c0:function(n){return vn(n)&&yj.call(n,"callee")&&!vj.call(n,"callee")};const rs=bj;function wj(){return!1}var h0=typeof J=="object"&&J&&!J.nodeType&&J,f0=h0&&typeof module=="object"&&module&&!module.nodeType&&module,xj=f0&&f0.exports===h0,d0=xj?yn.Buffer:void 0,Cj=d0?d0.isBuffer:void 0,Sj=Cj||wj;const is=Sj;var Pj="[object Arguments]",Ej="[object Array]",Aj="[object Boolean]",Tj="[object Date]",Oj="[object Error]",Mj="[object Function]",_j="[object Map]",Nj="[object Number]",kj="[object Object]",$j="[object RegExp]",Ij="[object Set]",Lj="[object String]",Rj="[object WeakMap]",jj="[object ArrayBuffer]",Dj="[object DataView]",Bj="[object Float32Array]",zj="[object Float64Array]",Fj="[object Int8Array]",Vj="[object Int16Array]",qj="[object Int32Array]",Gj="[object Uint8Array]",Hj="[object Uint8ClampedArray]",Uj="[object Uint16Array]",Wj="[object Uint32Array]",Oe={};Oe[Bj]=Oe[zj]=Oe[Fj]=Oe[Vj]=Oe[qj]=Oe[Gj]=Oe[Hj]=Oe[Uj]=Oe[Wj]=!0,Oe[Pj]=Oe[Ej]=Oe[jj]=Oe[Aj]=Oe[Dj]=Oe[Tj]=Oe[Oj]=Oe[Mj]=Oe[_j]=Oe[Nj]=Oe[kj]=Oe[$j]=Oe[Ij]=Oe[Lj]=Oe[Rj]=!1;function Xj(n){return vn(n)&&fh(n.length)&&!!Oe[Pr(n)]}function Po(n){return function(e){return n(e)}}var g0=typeof J=="object"&&J&&!J.nodeType&&J,Eo=g0&&typeof module=="object"&&module&&!module.nodeType&&module,Yj=Eo&&Eo.exports===g0,dh=Yj&&Xv.process,Kj=function(){try{var n=Eo&&Eo.require&&Eo.require("util").types;return n||dh&&dh.binding&&dh.binding("util")}catch(e){}}();const ss=Kj;var p0=ss&&ss.isTypedArray,Jj=p0?Po(p0):Xj;const wl=Jj;var Qj=Object.prototype,Zj=Qj.hasOwnProperty;function m0(n,e){var t=bt(n),r=!t&&rs(n),i=!t&&!r&&is(n),s=!t&&!r&&!i&&wl(n),o=t||r||i||s,a=o?pj(n.length,String):[],l=a.length;for(var c in n)(e||Zj.call(n,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||hh(c,l)))&&a.push(c);return a}function y0(n,e){return function(t){return n(e(t))}}var eD=y0(Object.keys,Object);const tD=eD;var nD=Object.prototype,rD=nD.hasOwnProperty;function v0(n){if(!bl(n))return tD(n);var e=[];for(var t in Object(n))rD.call(n,t)&&t!="constructor"&&e.push(t);return e}function Ao(n){return yi(n)?m0(n):v0(n)}function iD(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var sD=Object.prototype,oD=sD.hasOwnProperty;function aD(n){if(!Ze(n))return iD(n);var e=bl(n),t=[];for(var r in n)r=="constructor"&&(e||!oD.call(n,r))||t.push(r);return t}function os(n){return yi(n)?m0(n,!0):aD(n)}var lD=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cD=/^\w*$/;function gh(n,e){if(bt(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||In(n)?!0:cD.test(n)||!lD.test(n)||e!=null&&n in Object(e)}var uD=mi(Object,"create");const To=uD;function hD(){this.__data__=To?To(null):{},this.size=0}function fD(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var dD="__lodash_hash_undefined__",gD=Object.prototype,pD=gD.hasOwnProperty;function mD(n){var e=this.__data__;if(To){var t=e[n];return t===dD?void 0:t}return pD.call(e,n)?e[n]:void 0}var yD=Object.prototype,vD=yD.hasOwnProperty;function bD(n){var e=this.__data__;return To?e[n]!==void 0:vD.call(e,n)}var wD="__lodash_hash_undefined__";function xD(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=To&&e===void 0?wD:e,this}function vi(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}vi.prototype.clear=hD,vi.prototype.delete=fD,vi.prototype.get=mD,vi.prototype.has=bD,vi.prototype.set=xD;function CD(){this.__data__=[],this.size=0}function xl(n,e){for(var t=n.length;t--;)if(ts(n[t][0],e))return t;return-1}var SD=Array.prototype,PD=SD.splice;function ED(n){var e=this.__data__,t=xl(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():PD.call(e,t,1),--this.size,!0}function AD(n){var e=this.__data__,t=xl(e,n);return t<0?void 0:e[t][1]}function TD(n){return xl(this.__data__,n)>-1}function OD(n,e){var t=this.__data__,r=xl(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function Yn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Yn.prototype.clear=CD,Yn.prototype.delete=ED,Yn.prototype.get=AD,Yn.prototype.has=TD,Yn.prototype.set=OD;var MD=mi(yn,"Map");const Oo=MD;function _D(){this.size=0,this.__data__={hash:new vi,map:new(Oo||Yn),string:new vi}}function ND(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Cl(n,e){var t=n.__data__;return ND(e)?t[typeof e=="string"?"string":"hash"]:t.map}function kD(n){var e=Cl(this,n).delete(n);return this.size-=e?1:0,e}function $D(n){return Cl(this,n).get(n)}function ID(n){return Cl(this,n).has(n)}function LD(n,e){var t=Cl(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function Kn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Kn.prototype.clear=_D,Kn.prototype.delete=kD,Kn.prototype.get=$D,Kn.prototype.has=ID,Kn.prototype.set=LD;var RD="Expected a function";function ph(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(RD);var t=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=t.cache;if(s.has(i))return s.get(i);var o=n.apply(this,r);return t.cache=s.set(i,o)||s,o};return t.cache=new(ph.Cache||Kn),t}ph.Cache=Kn;var jD=500;function DD(n){var e=ph(n,function(r){return t.size===jD&&t.clear(),r}),t=e.cache;return e}var BD=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zD=/\\(\\)?/g,FD=DD(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(BD,function(t,r,i,s){e.push(i?s.replace(zD,"$1"):r||t)}),e});const VD=FD;function Mo(n){return n==null?"":Zv(n)}function b0(n,e){return bt(n)?n:gh(n,e)?[n]:VD(Mo(n))}var qD=1/0;function Sl(n){if(typeof n=="string"||In(n))return n;var e=n+"";return e=="0"&&1/n==-qD?"-0":e}function mh(n,e){e=b0(e,n);for(var t=0,r=e.length;n!=null&&t<r;)n=n[Sl(e[t++])];return t&&t==r?n:void 0}function GD(n,e,t){var r=n==null?void 0:mh(n,e);return r===void 0?t:r}function yh(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}var w0=Zt?Zt.isConcatSpreadable:void 0;function HD(n){return bt(n)||rs(n)||!!(w0&&n&&n[w0])}function Pl(n,e,t,r,i){var s=-1,o=n.length;for(t||(t=HD),i||(i=[]);++s<o;){var a=n[s];e>0&&t(a)?e>1?Pl(a,e-1,t,r,i):yh(i,a):r||(i[i.length]=a)}return i}var UD=y0(Object.getPrototypeOf,Object);const vh=UD;var WD="[object Object]",XD=Function.prototype,YD=Object.prototype,x0=XD.toString,KD=YD.hasOwnProperty,JD=x0.call(Object);function Ln(n){if(!vn(n)||Pr(n)!=WD)return!1;var e=vh(n);if(e===null)return!0;var t=KD.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&x0.call(t)==JD}function QD(n,e,t){var r=-1,i=n.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=n[r+e];return s}function ZD(n,e,t){var r=n.length;return t=t===void 0?r:t,!e&&t>=r?n:QD(n,e,t)}var eB="\\ud800-\\udfff",tB="\\u0300-\\u036f",nB="\\ufe20-\\ufe2f",rB="\\u20d0-\\u20ff",iB=tB+nB+rB,sB="\\ufe0e\\ufe0f",oB="\\u200d",aB=RegExp("["+oB+eB+iB+sB+"]");function C0(n){return aB.test(n)}function lB(n){return n.split("")}var S0="\\ud800-\\udfff",cB="\\u0300-\\u036f",uB="\\ufe20-\\ufe2f",hB="\\u20d0-\\u20ff",fB=cB+uB+hB,dB="\\ufe0e\\ufe0f",gB="["+S0+"]",bh="["+fB+"]",wh="\\ud83c[\\udffb-\\udfff]",pB="(?:"+bh+"|"+wh+")",P0="[^"+S0+"]",E0="(?:\\ud83c[\\udde6-\\uddff]){2}",A0="[\\ud800-\\udbff][\\udc00-\\udfff]",mB="\\u200d",T0=pB+"?",O0="["+dB+"]?",yB="(?:"+mB+"(?:"+[P0,E0,A0].join("|")+")"+O0+T0+")*",vB=O0+T0+yB,bB="(?:"+[P0+bh+"?",bh,E0,A0,gB].join("|")+")",wB=RegExp(wh+"(?="+wh+")|"+bB+vB,"g");function xB(n){return n.match(wB)||[]}function CB(n){return C0(n)?xB(n):lB(n)}function M0(n){return function(e){e=Mo(e);var t=C0(e)?CB(e):void 0,r=t?t[0]:e.charAt(0),i=t?ZD(t,1).join(""):e.slice(1);return r[n]()+i}}var SB=M0("toUpperCase");const El=SB;function PB(n){return El(Mo(n).toLowerCase())}function EB(n,e,t,r){var i=-1,s=n==null?0:n.length;for(r&&s&&(t=n[++i]);++i<s;)t=e(t,n[i],i,n);return t}function AB(n){return function(e){return n==null?void 0:n[e]}}var TB={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},OB=AB(TB);const MB=OB;var _B=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,NB="\\u0300-\\u036f",kB="\\ufe20-\\ufe2f",$B="\\u20d0-\\u20ff",IB=NB+kB+$B,LB="["+IB+"]",RB=RegExp(LB,"g");function jB(n){return n=Mo(n),n&&n.replace(_B,MB).replace(RB,"")}var DB=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function BB(n){return n.match(DB)||[]}var zB=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function FB(n){return zB.test(n)}var _0="\\ud800-\\udfff",VB="\\u0300-\\u036f",qB="\\ufe20-\\ufe2f",GB="\\u20d0-\\u20ff",HB=VB+qB+GB,N0="\\u2700-\\u27bf",k0="a-z\\xdf-\\xf6\\xf8-\\xff",UB="\\xac\\xb1\\xd7\\xf7",WB="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",XB="\\u2000-\\u206f",YB=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$0="A-Z\\xc0-\\xd6\\xd8-\\xde",KB="\\ufe0e\\ufe0f",I0=UB+WB+XB+YB,L0="['’]",R0="["+I0+"]",JB="["+HB+"]",j0="\\d+",QB="["+N0+"]",D0="["+k0+"]",B0="[^"+_0+I0+j0+N0+k0+$0+"]",ZB="\\ud83c[\\udffb-\\udfff]",e3="(?:"+JB+"|"+ZB+")",t3="[^"+_0+"]",z0="(?:\\ud83c[\\udde6-\\uddff]){2}",F0="[\\ud800-\\udbff][\\udc00-\\udfff]",as="["+$0+"]",n3="\\u200d",V0="(?:"+D0+"|"+B0+")",r3="(?:"+as+"|"+B0+")",q0="(?:"+L0+"(?:d|ll|m|re|s|t|ve))?",G0="(?:"+L0+"(?:D|LL|M|RE|S|T|VE))?",H0=e3+"?",U0="["+KB+"]?",i3="(?:"+n3+"(?:"+[t3,z0,F0].join("|")+")"+U0+H0+")*",s3="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",o3="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",a3=U0+H0+i3,l3="(?:"+[QB,z0,F0].join("|")+")"+a3,c3=RegExp([as+"?"+D0+"+"+q0+"(?="+[R0,as,"$"].join("|")+")",r3+"+"+G0+"(?="+[R0,as+V0,"$"].join("|")+")",as+"?"+V0+"+"+q0,as+"+"+G0,o3,s3,j0,l3].join("|"),"g");function u3(n){return n.match(c3)||[]}function h3(n,e,t){return n=Mo(n),e=t?void 0:e,e===void 0?FB(n)?u3(n):BB(n):n.match(e)||[]}var f3="['’]",d3=RegExp(f3,"g");function W0(n){return function(e){return EB(h3(jB(e).replace(d3,"")),n,"")}}var g3=W0(function(n,e,t){return e=e.toLowerCase(),n+(t?PB(e):e)});const Al=g3;function p3(n,e,t){return n===n&&(t!==void 0&&(n=n<=t?n:t),e!==void 0&&(n=n>=e?n:e)),n}function en(n,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=Co(t),t=t===t?t:0),e!==void 0&&(e=Co(e),e=e===e?e:0),p3(Co(n),e,t)}function m3(){this.__data__=new Yn,this.size=0}function y3(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function v3(n){return this.__data__.get(n)}function b3(n){return this.__data__.has(n)}var w3=200;function x3(n,e){var t=this.__data__;if(t instanceof Yn){var r=t.__data__;if(!Oo||r.length<w3-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new Kn(r)}return t.set(n,e),this.size=t.size,this}function bn(n){var e=this.__data__=new Yn(n);this.size=e.size}bn.prototype.clear=m3,bn.prototype.delete=y3,bn.prototype.get=v3,bn.prototype.has=b3,bn.prototype.set=x3;function C3(n,e){return n&&So(e,Ao(e),n)}function S3(n,e){return n&&So(e,os(e),n)}var X0=typeof J=="object"&&J&&!J.nodeType&&J,Y0=X0&&typeof module=="object"&&module&&!module.nodeType&&module,P3=Y0&&Y0.exports===X0,K0=P3?yn.Buffer:void 0,J0=K0?K0.allocUnsafe:void 0;function Q0(n,e){if(e)return n.slice();var t=n.length,r=J0?J0(t):new n.constructor(t);return n.copy(r),r}function E3(n,e){for(var t=-1,r=n==null?0:n.length,i=0,s=[];++t<r;){var o=n[t];e(o,t,n)&&(s[i++]=o)}return s}function Z0(){return[]}var A3=Object.prototype,T3=A3.propertyIsEnumerable,eb=Object.getOwnPropertySymbols,O3=eb?function(n){return n==null?[]:(n=Object(n),E3(eb(n),function(e){return T3.call(n,e)}))}:Z0;const xh=O3;function M3(n,e){return So(n,xh(n),e)}var _3=Object.getOwnPropertySymbols,N3=_3?function(n){for(var e=[];n;)yh(e,xh(n)),n=vh(n);return e}:Z0;const tb=N3;function k3(n,e){return So(n,tb(n),e)}function nb(n,e,t){var r=e(n);return bt(n)?r:yh(r,t(n))}function Ch(n){return nb(n,Ao,xh)}function $3(n){return nb(n,os,tb)}var I3=mi(yn,"DataView");const Sh=I3;var L3=mi(yn,"Promise");const Ph=L3;var R3=mi(yn,"Set");const ls=R3;var rb="[object Map]",j3="[object Object]",ib="[object Promise]",sb="[object Set]",ob="[object WeakMap]",ab="[object DataView]",D3=pi(Sh),B3=pi(Oo),z3=pi(Ph),F3=pi(ls),V3=pi(uh),bi=Pr;(Sh&&bi(new Sh(new ArrayBuffer(1)))!=ab||Oo&&bi(new Oo)!=rb||Ph&&bi(Ph.resolve())!=ib||ls&&bi(new ls)!=sb||uh&&bi(new uh)!=ob)&&(bi=function(n){var e=Pr(n),t=e==j3?n.constructor:void 0,r=t?pi(t):"";if(r)switch(r){case D3:return ab;case B3:return rb;case z3:return ib;case F3:return sb;case V3:return ob}return e});const cs=bi;var q3=Object.prototype,G3=q3.hasOwnProperty;function H3(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&G3.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var U3=yn.Uint8Array;const Tl=U3;function Eh(n){var e=new n.constructor(n.byteLength);return new Tl(e).set(new Tl(n)),e}function W3(n,e){var t=e?Eh(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var X3=/\w*$/;function Y3(n){var e=new n.constructor(n.source,X3.exec(n));return e.lastIndex=n.lastIndex,e}var lb=Zt?Zt.prototype:void 0,cb=lb?lb.valueOf:void 0;function K3(n){return cb?Object(cb.call(n)):{}}function ub(n,e){var t=e?Eh(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var J3="[object Boolean]",Q3="[object Date]",Z3="[object Map]",ez="[object Number]",tz="[object RegExp]",nz="[object Set]",rz="[object String]",iz="[object Symbol]",sz="[object ArrayBuffer]",oz="[object DataView]",az="[object Float32Array]",lz="[object Float64Array]",cz="[object Int8Array]",uz="[object Int16Array]",hz="[object Int32Array]",fz="[object Uint8Array]",dz="[object Uint8ClampedArray]",gz="[object Uint16Array]",pz="[object Uint32Array]";function mz(n,e,t){var r=n.constructor;switch(e){case sz:return Eh(n);case J3:case Q3:return new r(+n);case oz:return W3(n,t);case az:case lz:case cz:case uz:case hz:case fz:case dz:case gz:case pz:return ub(n,t);case Z3:return new r;case ez:case rz:return new r(n);case tz:return Y3(n);case nz:return new r;case iz:return K3(n)}}function hb(n){return typeof n.constructor=="function"&&!bl(n)?UR(vh(n)):{}}var yz="[object Map]";function vz(n){return vn(n)&&cs(n)==yz}var fb=ss&&ss.isMap,bz=fb?Po(fb):vz;const wz=bz;var xz="[object Set]";function Cz(n){return vn(n)&&cs(n)==xz}var db=ss&&ss.isSet,Sz=db?Po(db):Cz;const Pz=Sz;var Ez=1,Az=2,Tz=4,gb="[object Arguments]",Oz="[object Array]",Mz="[object Boolean]",_z="[object Date]",Nz="[object Error]",pb="[object Function]",kz="[object GeneratorFunction]",$z="[object Map]",Iz="[object Number]",mb="[object Object]",Lz="[object RegExp]",Rz="[object Set]",jz="[object String]",Dz="[object Symbol]",Bz="[object WeakMap]",zz="[object ArrayBuffer]",Fz="[object DataView]",Vz="[object Float32Array]",qz="[object Float64Array]",Gz="[object Int8Array]",Hz="[object Int16Array]",Uz="[object Int32Array]",Wz="[object Uint8Array]",Xz="[object Uint8ClampedArray]",Yz="[object Uint16Array]",Kz="[object Uint32Array]",Se={};Se[gb]=Se[Oz]=Se[zz]=Se[Fz]=Se[Mz]=Se[_z]=Se[Vz]=Se[qz]=Se[Gz]=Se[Hz]=Se[Uz]=Se[$z]=Se[Iz]=Se[mb]=Se[Lz]=Se[Rz]=Se[jz]=Se[Dz]=Se[Wz]=Se[Xz]=Se[Yz]=Se[Kz]=!0,Se[Nz]=Se[pb]=Se[Bz]=!1;function _o(n,e,t,r,i,s){var o,a=e&Ez,l=e&Az,c=e&Tz;if(t&&(o=i?t(n,r,i,s):t(n)),o!==void 0)return o;if(!Ze(n))return n;var u=bt(n);if(u){if(o=H3(n),!a)return i0(n,o)}else{var h=cs(n),f=h==pb||h==kz;if(is(n))return Q0(n,a);if(h==mb||h==gb||f&&!i){if(o=l||f?{}:hb(n),!a)return l?k3(n,S3(o,n)):M3(n,C3(o,n))}else{if(!Se[h])return i?n:{};o=mz(n,h,a)}}s||(s=new bn);var d=s.get(n);if(d)return d;s.set(n,o),Pz(n)?n.forEach(function(b){o.add(_o(b,e,t,b,n,s))}):wz(n)&&n.forEach(function(b,m){o.set(m,_o(b,e,t,m,n,s))});var g=c?l?$3:Ch:l?os:Ao,p=u?void 0:g(n);return rj(p||n,function(b,m){p&&(m=b,b=n[m]),o0(o,m,_o(b,e,t,m,n,s))}),o}var Jz=4;function Ah(n){return _o(n,Jz)}var Qz=1,Zz=4;function ze(n){return _o(n,Qz|Zz)}var eF="__lodash_hash_undefined__";function tF(n){return this.__data__.set(n,eF),this}function nF(n){return this.__data__.has(n)}function us(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Kn;++e<t;)this.add(n[e])}us.prototype.add=us.prototype.push=tF,us.prototype.has=nF;function rF(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function Th(n,e){return n.has(e)}var iF=1,sF=2;function yb(n,e,t,r,i,s){var o=t&iF,a=n.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var c=s.get(n),u=s.get(e);if(c&&u)return c==e&&u==n;var h=-1,f=!0,d=t&sF?new us:void 0;for(s.set(n,e),s.set(e,n);++h<a;){var g=n[h],p=e[h];if(r)var b=o?r(p,g,h,e,n,s):r(g,p,h,n,e,s);if(b!==void 0){if(b)continue;f=!1;break}if(d){if(!rF(e,function(m,y){if(!Th(d,y)&&(g===m||i(g,m,t,r,s)))return d.push(y)})){f=!1;break}}else if(!(g===p||i(g,p,t,r,s))){f=!1;break}}return s.delete(n),s.delete(e),f}function oF(n){var e=-1,t=Array(n.size);return n.forEach(function(r,i){t[++e]=[i,r]}),t}function Oh(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var aF=1,lF=2,cF="[object Boolean]",uF="[object Date]",hF="[object Error]",fF="[object Map]",dF="[object Number]",gF="[object RegExp]",pF="[object Set]",mF="[object String]",yF="[object Symbol]",vF="[object ArrayBuffer]",bF="[object DataView]",vb=Zt?Zt.prototype:void 0,Mh=vb?vb.valueOf:void 0;function wF(n,e,t,r,i,s,o){switch(t){case bF:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case vF:return!(n.byteLength!=e.byteLength||!s(new Tl(n),new Tl(e)));case cF:case uF:case dF:return ts(+n,+e);case hF:return n.name==e.name&&n.message==e.message;case gF:case mF:return n==e+"";case fF:var a=oF;case pF:var l=r&aF;if(a||(a=Oh),n.size!=e.size&&!l)return!1;var c=o.get(n);if(c)return c==e;r|=lF,o.set(n,e);var u=yb(a(n),a(e),r,i,s,o);return o.delete(n),u;case yF:if(Mh)return Mh.call(n)==Mh.call(e)}return!1}var xF=1,CF=Object.prototype,SF=CF.hasOwnProperty;function PF(n,e,t,r,i,s){var o=t&xF,a=Ch(n),l=a.length,c=Ch(e),u=c.length;if(l!=u&&!o)return!1;for(var h=l;h--;){var f=a[h];if(!(o?f in e:SF.call(e,f)))return!1}var d=s.get(n),g=s.get(e);if(d&&g)return d==e&&g==n;var p=!0;s.set(n,e),s.set(e,n);for(var b=o;++h<l;){f=a[h];var m=n[f],y=e[f];if(r)var v=o?r(y,m,f,e,n,s):r(m,y,f,n,e,s);if(!(v===void 0?m===y||i(m,y,t,r,s):v)){p=!1;break}b||(b=f=="constructor")}if(p&&!b){var w=n.constructor,x=e.constructor;w!=x&&"constructor"in n&&"constructor"in e&&!(typeof w=="function"&&w instanceof w&&typeof x=="function"&&x instanceof x)&&(p=!1)}return s.delete(n),s.delete(e),p}var EF=1,bb="[object Arguments]",wb="[object Array]",Ol="[object Object]",AF=Object.prototype,xb=AF.hasOwnProperty;function TF(n,e,t,r,i,s){var o=bt(n),a=bt(e),l=o?wb:cs(n),c=a?wb:cs(e);l=l==bb?Ol:l,c=c==bb?Ol:c;var u=l==Ol,h=c==Ol,f=l==c;if(f&&is(n)){if(!is(e))return!1;o=!0,u=!1}if(f&&!u)return s||(s=new bn),o||wl(n)?yb(n,e,t,r,i,s):wF(n,e,l,t,r,i,s);if(!(t&EF)){var d=u&&xb.call(n,"__wrapped__"),g=h&&xb.call(e,"__wrapped__");if(d||g){var p=d?n.value():n,b=g?e.value():e;return s||(s=new bn),i(p,b,t,r,s)}}return f?(s||(s=new bn),PF(n,e,t,r,i,s)):!1}function Ml(n,e,t,r,i){return n===e?!0:n==null||e==null||!vn(n)&&!vn(e)?n!==n&&e!==e:TF(n,e,t,r,Ml,i)}var OF=1,MF=2;function _F(n,e,t,r){var i=t.length,s=i,o=!r;if(n==null)return!s;for(n=Object(n);i--;){var a=t[i];if(o&&a[2]?a[1]!==n[a[0]]:!(a[0]in n))return!1}for(;++i<s;){a=t[i];var l=a[0],c=n[l],u=a[1];if(o&&a[2]){if(c===void 0&&!(l in n))return!1}else{var h=new bn;if(r)var f=r(c,u,l,n,e,h);if(!(f===void 0?Ml(u,c,OF|MF,r,h):f))return!1}}return!0}function Cb(n){return n===n&&!Ze(n)}function NF(n){for(var e=Ao(n),t=e.length;t--;){var r=e[t],i=n[r];e[t]=[r,i,Cb(i)]}return e}function Sb(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function kF(n){var e=NF(n);return e.length==1&&e[0][2]?Sb(e[0][0],e[0][1]):function(t){return t===n||_F(t,n,e)}}function $F(n,e){return n!=null&&e in Object(n)}function Pb(n,e,t){e=b0(e,n);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Sl(e[r]);if(!(s=n!=null&&t(n,o)))break;n=n[o]}return s||++r!=i?s:(i=n==null?0:n.length,!!i&&fh(i)&&hh(o,i)&&(bt(n)||rs(n)))}function IF(n,e){return n!=null&&Pb(n,e,$F)}var LF=1,RF=2;function jF(n,e){return gh(n)&&Cb(e)?Sb(Sl(n),e):function(t){var r=GD(t,n);return r===void 0&&r===e?IF(t,n):Ml(e,r,LF|RF)}}function DF(n){return function(e){return e==null?void 0:e[n]}}function BF(n){return function(e){return mh(e,n)}}function zF(n){return gh(n)?DF(Sl(n)):BF(n)}function _h(n){return typeof n=="function"?n:n==null?es:typeof n=="object"?bt(n)?jF(n[0],n[1]):kF(n):zF(n)}function FF(n,e,t,r){for(var i=-1,s=n==null?0:n.length;++i<s;){var o=n[i];e(r,o,t(o),n)}return r}function VF(n){return function(e,t,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var l=o[n?a:++i];if(t(s[l],l,s)===!1)break}return e}}var qF=VF();const Eb=qF;function GF(n,e){return n&&Eb(n,e,Ao)}function HF(n,e){return function(t,r){if(t==null)return t;if(!yi(t))return n(t,r);for(var i=t.length,s=e?i:-1,o=Object(t);(e?s--:++s<i)&&r(o[s],s,o)!==!1;);return t}}var UF=HF(GF);const Ab=UF;function WF(n,e,t,r){return Ab(n,function(i,s,o){e(r,i,t(i),o)}),r}function XF(n,e){return function(t,r){var i=bt(t)?FF:WF,s=e?e():{};return i(t,n,_h(r),s)}}var YF=function(){return yn.Date.now()};const Nh=YF;var KF="Expected a function",JF=Math.max,QF=Math.min;function kh(n,e,t){var r,i,s,o,a,l,c=0,u=!1,h=!1,f=!0;if(typeof n!="function")throw new TypeError(KF);e=Co(e)||0,Ze(t)&&(u=!!t.leading,h="maxWait"in t,s=h?JF(Co(t.maxWait)||0,e):s,f="trailing"in t?!!t.trailing:f);function d(C){var S=r,E=i;return r=i=void 0,c=C,o=n.apply(E,S),o}function g(C){return c=C,a=setTimeout(m,e),u?d(C):o}function p(C){var S=C-l,E=C-c,A=e-S;return h?QF(A,s-E):A}function b(C){var S=C-l,E=C-c;return l===void 0||S>=e||S<0||h&&E>=s}function m(){var C=Nh();if(b(C))return y(C);a=setTimeout(m,p(C))}function y(C){return a=void 0,f&&r?d(C):(r=i=void 0,o)}function v(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function w(){return a===void 0?o:y(Nh())}function x(){var C=Nh(),S=b(C);if(r=arguments,i=this,l=C,S){if(a===void 0)return g(l);if(h)return clearTimeout(a),a=setTimeout(m,e),d(l)}return a===void 0&&(a=setTimeout(m,e)),o}return x.cancel=v,x.flush=w,x}var Tb=Object.prototype,ZF=Tb.hasOwnProperty,eV=ns(function(n,e){n=Object(n);var t=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&vl(e[0],e[1],i)&&(r=1);++t<r;)for(var s=e[t],o=os(s),a=-1,l=o.length;++a<l;){var c=o[a],u=n[c];(u===void 0||ts(u,Tb[c])&&!ZF.call(n,c))&&(n[c]=s[c])}return n});const tV=eV;function $h(n,e,t){(t!==void 0&&!ts(n[e],t)||t===void 0&&!(e in n))&&yl(n,e,t)}function _l(n){return vn(n)&&yi(n)}function Ih(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function nV(n){return So(n,os(n))}function rV(n,e,t,r,i,s,o){var a=Ih(n,t),l=Ih(e,t),c=o.get(l);if(c){$h(n,t,c);return}var u=s?s(a,l,t+"",n,e,o):void 0,h=u===void 0;if(h){var f=bt(l),d=!f&&is(l),g=!f&&!d&&wl(l);u=l,f||d||g?bt(a)?u=a:_l(a)?u=i0(a):d?(h=!1,u=Q0(l,!0)):g?(h=!1,u=ub(l,!0)):u=[]:Ln(l)||rs(l)?(u=a,rs(a)?u=nV(a):(!Ze(a)||lh(a))&&(u=hb(l))):h=!1}h&&(o.set(l,u),i(u,l,r,s,o),o.delete(l)),$h(n,t,u)}function Nl(n,e,t,r,i){n!==e&&Eb(e,function(s,o){if(i||(i=new bn),Ze(s))rV(n,e,o,t,Nl,r,i);else{var a=r?r(Ih(n,o),s,o+"",n,e,i):void 0;a===void 0&&(a=s),$h(n,o,a)}},os)}function Ob(n,e,t,r,i,s){return Ze(n)&&Ze(e)&&(s.set(e,n),Nl(n,e,void 0,Ob,s),s.delete(e)),n}var iV=l0(function(n,e,t,r){Nl(n,e,t,r)});const sV=iV;var oV=ns(function(n){return n.push(void 0,Ob),r0(sV,void 0,n)});const Mb=oV;function _b(n,e,t){for(var r=-1,i=n==null?0:n.length;++r<i;)if(t(e,n[r]))return!0;return!1}var aV=200;function lV(n,e,t,r){var i=-1,s=s0,o=!0,a=n.length,l=[],c=e.length;if(!a)return l;t&&(e=xo(e,Po(t))),r?(s=_b,o=!1):e.length>=aV&&(s=Th,o=!1,e=new us(e));e:for(;++i<a;){var u=n[i],h=t==null?u:t(u);if(u=r||u!==0?u:0,o&&h===h){for(var f=c;f--;)if(e[f]===h)continue e;l.push(u)}else s(e,h,r)||l.push(u)}return l}var cV=ns(function(n,e){return _l(n)?lV(n,Pl(e,1,_l,!0)):[]});const uV=cV;function hV(n,e){var t=-1,r=yi(n)?Array(n.length):[];return Ab(n,function(i,s,o){r[++t]=e(i,s,o)}),r}var fV=Object.prototype,dV=fV.hasOwnProperty,gV=XF(function(n,e,t){dV.call(n,t)?n[t].push(e):yl(n,t,[e])});const Nb=gV;function pV(n,e){return n>e}var mV=Object.prototype,yV=mV.hasOwnProperty;function vV(n,e){return n!=null&&yV.call(n,e)}function kl(n,e){return n!=null&&Pb(n,e,vV)}var bV="[object Map]",wV="[object Set]",xV=Object.prototype,CV=xV.hasOwnProperty;function kb(n){if(n==null)return!0;if(yi(n)&&(bt(n)||typeof n=="string"||typeof n.splice=="function"||is(n)||wl(n)||rs(n)))return!n.length;var e=cs(n);if(e==bV||e==wV)return!n.size;if(bl(n))return!v0(n).length;for(var t in n)if(CV.call(n,t))return!1;return!0}function Jn(n,e){return Ml(n,e)}var SV="[object Number]";function $b(n){return typeof n=="number"||vn(n)&&Pr(n)==SV}var PV=M0("toLowerCase");const EV=PV;function AV(n,e,t){for(var r=-1,i=n.length;++r<i;){var s=n[r],o=e(s);if(o!=null&&(a===void 0?o===o&&!In(o):t(o,a)))var a=o,l=s}return l}function TV(n){return n&&n.length?AV(n,es,pV):void 0}var OV=l0(function(n,e,t){Nl(n,e,t)});const Ie=OV;function MV(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}function _V(n,e){if(n!==e){var t=n!==void 0,r=n===null,i=n===n,s=In(n),o=e!==void 0,a=e===null,l=e===e,c=In(e);if(!a&&!c&&!s&&n>e||s&&o&&l&&!a&&!c||r&&o&&l||!t&&l||!i)return 1;if(!r&&!s&&!c&&n<e||c&&t&&i&&!r&&!s||a&&t&&i||!o&&i||!l)return-1}return 0}function NV(n,e,t){for(var r=-1,i=n.criteria,s=e.criteria,o=i.length,a=t.length;++r<o;){var l=_V(i[r],s[r]);if(l){if(r>=a)return l;var c=t[r];return l*(c=="desc"?-1:1)}}return n.index-e.index}function kV(n,e,t){e.length?e=xo(e,function(s){return bt(s)?function(o){return mh(o,s.length===1?s[0]:s)}:s}):e=[es];var r=-1;e=xo(e,Po(_h));var i=hV(n,function(s,o,a){var l=xo(e,function(c){return c(s)});return{criteria:l,index:++r,value:s}});return MV(i,function(s,o){return NV(s,o,t)})}var $V=ns(function(n,e){if(n==null)return[];var t=e.length;return t>1&&vl(n,e[0],e[1])?e=[]:t>2&&vl(e[0],e[1],e[2])&&(e=[e[0]]),kV(n,Pl(e,1),[])});const Ib=$V;var IV=4294967295,LV=IV-1,RV=Math.floor,jV=Math.min;function Lb(n,e,t,r){var i=0,s=n==null?0:n.length;if(s===0)return 0;e=t(e);for(var o=e!==e,a=e===null,l=In(e),c=e===void 0;i<s;){var u=RV((i+s)/2),h=t(n[u]),f=h!==void 0,d=h===null,g=h===h,p=In(h);if(o)var b=r||g;else c?b=g&&(r||f):a?b=g&&f&&(r||!d):l?b=g&&f&&!d&&(r||!p):d||p?b=!1:b=r?h<=e:h<e;b?i=u+1:s=u}return jV(s,LV)}var DV=4294967295,BV=DV>>>1;function zV(n,e,t){var r=0,i=n==null?r:n.length;if(typeof e=="number"&&e===e&&i<=BV){for(;r<i;){var s=r+i>>>1,o=n[s];o!==null&&!In(o)&&(t?o<=e:o<e)?r=s+1:i=s}return i}return Lb(n,e,es,t)}function FV(n,e){return zV(n,e)}function VV(n,e,t){return Lb(n,e,_h(t))}var qV=W0(function(n,e,t){return n+(t?" ":"")+El(e)});const GV=qV;var HV="Expected a function";function UV(n,e,t){var r=!0,i=!0;if(typeof n!="function")throw new TypeError(HV);return Ze(t)&&(r="leading"in t?!!t.leading:r,i="trailing"in t?!!t.trailing:i),kh(n,e,{leading:r,maxWait:e,trailing:i})}var WV=1/0,XV=ls&&1/Oh(new ls([,-0]))[1]==WV?function(n){return new ls(n)}:WR;const YV=XV;var KV=200;function Rb(n,e,t){var r=-1,i=s0,s=n.length,o=!0,a=[],l=a;if(t)o=!1,i=_b;else if(s>=KV){var c=e?null:YV(n);if(c)return Oh(c);o=!1,i=Th,l=new us}else l=e?[]:a;e:for(;++r<s;){var u=n[r],h=e?e(u):u;if(u=t||u!==0?u:0,o&&h===h){for(var f=l.length;f--;)if(l[f]===h)continue e;e&&l.push(h),a.push(u)}else i(l,h,t)||(l!==a&&l.push(h),a.push(u))}return a}var JV=ns(function(n){return Rb(Pl(n,1,_l,!0))});const jb=JV;function Db(n){return n&&n.length?Rb(n):[]}function Bb(n,e,t){if(t)switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2]);case 4:return n.call(e,t[0],t[1],t[2],t[3]);case 5:return n.call(e,t[0],t[1],t[2],t[3],t[4]);case 6:return n.call(e,t[0],t[1],t[2],t[3],t[4],t[5]);default:return n.apply(e,t)}return n.call(e)}function Y(n,e,...t){return Bb(n,e,t)}function QV(n){return typeof n=="object"&&n.then&&typeof n.then=="function"}function zb(n){return n!=null&&(n instanceof Promise||QV(n))}function Fb(...n){const e=[];if(n.forEach(r=>{Array.isArray(r)?e.push(...r):e.push(r)}),e.some(r=>zb(r))){const r=e.map(i=>zb(i)?i:Promise.resolve(i!==!1));return Promise.all(r).then(i=>i.reduce((s,o)=>o!==!1&&s,!0))}return e.every(r=>r!==!1)}function Lh(n,e){const t=[];for(let r=0;r<n.length;r+=2){const i=n[r],s=n[r+1],o=Array.isArray(e)?e:[e],a=Bb(i,s,o);t.push(a)}return Fb(t)}class ZV{constructor(){this.listeners={}}on(e,t,r){return t==null?this:(this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t,r),this)}once(e,t,r){const i=(...s)=>(this.off(e,i),Lh([t,r],s));return this.on(e,i,this)}off(e,t,r){if(!(e||t||r))return this.listeners={},this;const i=this.listeners;return(e?[e]:Object.keys(i)).forEach(o=>{const a=i[o];if(a){if(!(t||r)){delete i[o];return}for(let l=a.length-2;l>=0;l-=2)t&&a[l]!==t||r&&a[l+1]!==r||a.splice(l,2)}}),this}trigger(e,...t){let r=!0;if(e!=="*"){const s=this.listeners[e];s!=null&&(r=Lh([...s],t))}const i=this.listeners["*"];return i!=null?Fb([r,Lh([...i],[e,...t])]):r}emit(e,...t){return this.trigger(e,...t)}}function e4(n,...e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(r=>{r!=="constructor"&&Object.defineProperty(n.prototype,r,Object.getOwnPropertyDescriptor(t.prototype,r))})})}const t4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])};function n4(n,e){t4(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}let r4=class{};const i4=/^\s*class\s+/.test(`${r4}`)||/^\s*class\s*\{/.test(`${class{}}`);function Rh(n,e){let t;return i4?t=class extends e{}:(t=function(){return e.apply(this,arguments)},n4(t,e)),Object.defineProperty(t,"name",{value:n}),t}function Vb(n){return n==="__proto__"}function jh(n,e,t="/"){let r;const i=Array.isArray(e)?e:e.split(t);if(i.length)for(r=n;i.length;){const s=i.shift();if(Object(r)===r&&s&&s in r)r=r[s];else return}return r}function hs(n,e,t,r="/"){const i=Array.isArray(e)?e:e.split(r),s=i.pop();if(s&&!Vb(s)){let o=n;i.forEach(a=>{Vb(a)||(o[a]==null&&(o[a]={}),o=o[a])}),o[s]=t}return n}function qb(n,e,t="/"){const r=Array.isArray(e)?e.slice():e.split(t),i=r.pop();if(i)if(r.length>0){const s=jh(n,r);s&&delete s[i]}else delete n[i];return n}class wt extends ZV{}(function(n){n.dispose=$n.dispose})(wt||(wt={})),e4(wt,$n);const Gb=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Hb=Gb(n=>n.replace(/\B([A-Z])/g,"-$1").toLowerCase()),Dh=Gb(n=>GV(Al(n)).replace(/ /g,""));function Bh(n){let e=2166136261,t=!1,r=n;for(let i=0,s=r.length;i<s;i+=1){let o=r.charCodeAt(i);o>127&&!t&&(r=unescape(encodeURIComponent(r)),o=r.charCodeAt(i),t=!0),e^=o,e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}return e>>>0}function zh(){let n="";const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let t=0,r=e.length;t<r;t+=1){const i=e[t],s=Math.random()*16|0,o=i==="x"?s:i==="y"?s&3|8:i;n+=o.toString(16)}return n}function s4(n,e,t){const r=Math.min(2,Math.floor(n.length*.34));let i=Math.floor(n.length*.4)+1,s,o=!1;const a=n.toLowerCase();for(const l of e){const c=t(l);if(c!==void 0&&Math.abs(c.length-a.length)<=r){const u=c.toLowerCase();if(u===a){if(c===n)continue;return l}if(o||c.length<3)continue;const h=o4(a,u,i-1);if(h===void 0)continue;h<3?(o=!0,s=l):(i=h,s=l)}}return s}function o4(n,e,t){let r=new Array(e.length+1),i=new Array(e.length+1);const s=t+1;for(let a=0;a<=e.length;a+=1)r[a]=a;for(let a=1;a<=n.length;a+=1){const l=n.charCodeAt(a-1),c=a>t?a-t:1,u=e.length>t+a?t+a:e.length;i[0]=a;let h=a;for(let d=1;d<c;d+=1)i[d]=s;for(let d=c;d<=u;d+=1){const g=l===e.charCodeAt(d-1)?r[d-1]:Math.min(r[d]+1,i[d-1]+1,r[d-1]+2);i[d]=g,h=Math.min(h,g)}for(let d=u+1;d<=e.length;d+=1)i[d]=s;if(h>t)return;const f=r;r=i,i=f}const o=r[e.length];return o>t?void 0:o}function Qn(n){return typeof n=="string"&&n.slice(-1)==="%"}function Vt(n,e){if(n==null)return 0;let t;if(typeof n=="string"){if(t=parseFloat(n),Qn(n)&&(t/=100,Number.isFinite(t)))return t*e}else t=n;return Number.isFinite(t)?t>0&&t<1?t*e:t:0}function Rn(n){if(typeof n=="object"){let t=0,r=0,i=0,s=0;return n.vertical!=null&&Number.isFinite(n.vertical)&&(r=s=n.vertical),n.horizontal!=null&&Number.isFinite(n.horizontal)&&(i=t=n.horizontal),n.left!=null&&Number.isFinite(n.left)&&(t=n.left),n.top!=null&&Number.isFinite(n.top)&&(r=n.top),n.right!=null&&Number.isFinite(n.right)&&(i=n.right),n.bottom!=null&&Number.isFinite(n.bottom)&&(s=n.bottom),{top:r,right:i,bottom:s,left:t}}let e=0;return n!=null&&Number.isFinite(n)&&(e=n),{top:e,right:e,bottom:e,left:e}}let Fh=!1,Ub=!1,Wb=!1,Xb=!1,Yb=!1,Kb=!1,Jb=!1,Qb=!1,Zb=!1,e1=!1,t1=!1,n1=!1,r1=!1,i1=!1,s1=!1,o1=!1;if(typeof navigator=="object"){const n=navigator.userAgent;Fh=n.indexOf("Macintosh")>=0,Ub=!!n.match(/(iPad|iPhone|iPod)/g),Wb=n.indexOf("Windows")>=0,Xb=n.indexOf("MSIE")>=0,Yb=!!n.match(/Trident\/7\./),Kb=!!n.match(/Edge\//),Jb=n.indexOf("Mozilla/")>=0&&n.indexOf("MSIE")<0&&n.indexOf("Edge/")<0,Zb=n.indexOf("Chrome/")>=0&&n.indexOf("Edge/")<0,e1=n.indexOf("Opera/")>=0||n.indexOf("OPR/")>=0,t1=n.indexOf("Firefox/")>=0,n1=n.indexOf("AppleWebKit/")>=0&&n.indexOf("Chrome/")<0&&n.indexOf("Edge/")<0,typeof document=="object"&&(o1=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||n.indexOf("Opera/")>=0)}if(typeof window=="object"&&(Qb=window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,i1=window.PointerEvent!=null&&!Fh),typeof document=="object"){r1="ontouchstart"in document.documentElement;try{const n=Object.defineProperty({},"passive",{get(){s1=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},n)}catch(n){}}var tn;(function(n){n.IS_MAC=Fh,n.IS_IOS=Ub,n.IS_WINDOWS=Wb,n.IS_IE=Xb,n.IS_IE11=Yb,n.IS_EDGE=Kb,n.IS_NETSCAPE=Jb,n.IS_CHROME_APP=Qb,n.IS_CHROME=Zb,n.IS_OPERA=e1,n.IS_FIREFOX=t1,n.IS_SAFARI=n1,n.SUPPORT_TOUCH=r1,n.SUPPORT_POINTER=i1,n.SUPPORT_PASSIVE=s1,n.NO_FOREIGNOBJECT=o1,n.SUPPORT_FOREIGNOBJECT=!n.NO_FOREIGNOBJECT})(tn||(tn={})),function(n){function e(){const s=window.module;return s!=null&&s.hot!=null&&s.hot.status!=null?s.hot.status():"unkonwn"}n.getHMRStatus=e;function t(){return e()==="apply"}n.isApplyingHMR=t;const r={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function i(s){const o=document.createElement(r[s]||"div"),a=`on${s}`;let l=a in o;return l||(o.setAttribute(a,"return;"),l=typeof o[a]=="function"),l}n.isEventSupported=i}(tn||(tn={}));const Vh=/[\t\r\n\f]/g,qh=/\S+/g,fs=n=>` ${n} `;function ds(n){return n&&n.getAttribute&&n.getAttribute("class")||""}function gs(n,e){if(n==null||e==null)return!1;const t=fs(ds(n)),r=fs(e);return n.nodeType===1?t.replace(Vh," ").includes(r):!1}function K(n,e){if(!(n==null||e==null)){if(typeof e=="function")return K(n,e(ds(n)));if(typeof e=="string"&&n.nodeType===1){const t=e.match(qh)||[],r=fs(ds(n)).replace(Vh," ");let i=t.reduce((s,o)=>s.indexOf(fs(o))<0?`${s}${o} `:s,r);i=i.trim(),r!==i&&n.setAttribute("class",i)}}}function gt(n,e){if(n!=null){if(typeof e=="function")return gt(n,e(ds(n)));if((!e||typeof e=="string")&&n.nodeType===1){const t=(e||"").match(qh)||[],r=fs(ds(n)).replace(Vh," ");let i=t.reduce((s,o)=>{const a=fs(o);return s.indexOf(a)>-1?s.replace(a," "):s},r);i=e?i.trim():"",r!==i&&n.setAttribute("class",i)}}}function a1(n,e,t){if(!(n==null||e==null)){if(t!=null&&typeof e=="string"){t?K(n,e):gt(n,e);return}if(typeof e=="function")return a1(n,e(ds(n),t),t);typeof e=="string"&&(e.match(qh)||[]).forEach(i=>{gs(n,i)?gt(n,i):K(n,i)})}}let l1=0;function a4(){return l1+=1,`v${l1}`}function Gh(n){return(n.id==null||n.id==="")&&(n.id=a4()),n.id}function Er(n){return n==null?!1:typeof n.getScreenCTM=="function"&&n instanceof SVGElement}const lt={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},c1="1.1";function u1(n,e=document){return e.createElement(n)}function Hh(n,e=lt.xhtml,t=document){return t.createElementNS(e,n)}function Zn(n,e=document){return Hh(n,lt.svg,e)}function $l(n){if(n){const t=`<svg xmlns="${lt.svg}" xmlns:xlink="${lt.xlink}" version="${c1}">${n}</svg>`,{documentElement:r}=l4(t,{async:!1});return r}const e=document.createElementNS(lt.svg,"svg");return e.setAttributeNS(lt.xmlns,"xmlns:xlink",lt.xlink),e.setAttribute("version",c1),e}function l4(n,e={}){let t;try{const r=new DOMParser;if(e.async!=null){const i=r;i.async=e.async}t=r.parseFromString(n,e.mimeType||"text/xml")}catch(r){t=void 0}if(!t||t.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${n}`);return t}function c4(n,e=!0){const t=n.nodeName;return e?t.toLowerCase():t.toUpperCase()}function Uh(n){let e=0,t=n.previousSibling;for(;t;)t.nodeType===1&&(e+=1),t=t.previousSibling;return e}function u4(n,e){return n.querySelectorAll(e)}function h4(n,e){return n.querySelector(e)}function h1(n,e,t){const r=n.ownerSVGElement;let i=n.parentNode;for(;i&&i!==t&&i!==r;){if(gs(i,e))return i;i=i.parentNode}return null}function f1(n,e){const t=e&&e.parentNode;return n===t||!!(t&&t.nodeType===1&&n.compareDocumentPosition(t)&16)}function er(n){n&&(Array.isArray(n)?n:[n]).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}function No(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function jn(n,e){(Array.isArray(e)?e:[e]).forEach(r=>{r!=null&&n.appendChild(r)})}function d1(n,e){const t=n.firstChild;return t?ko(t,e):jn(n,e)}function ko(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(i=>{i!=null&&t.insertBefore(i,n)})}function f4(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(i=>{i!=null&&t.insertBefore(i,n.nextSibling)})}function Ar(n,e){e!=null&&e.appendChild(n)}function d4(n){return!!n&&n.nodeType===1}function g1(n){try{return n instanceof HTMLElement}catch(e){return typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"}}function g4(n,e){const t=[];let r=n.firstChild;for(;r;r=r.nextSibling)r.nodeType===1&&(!e||gs(r,e))&&t.push(r);return t}const p1=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust"];function p4(n,e){return n.getAttribute(e)}function Wh(n,e){const t=y1(e);t.ns?n.hasAttributeNS(t.ns,t.local)&&n.removeAttributeNS(t.ns,t.local):n.hasAttribute(e)&&n.removeAttribute(e)}function Xh(n,e,t){if(t==null)return Wh(n,e);const r=y1(e);r.ns&&typeof t=="string"?n.setAttributeNS(r.ns,e,t):e==="id"?n.id=`${t}`:n.setAttribute(e,`${t}`)}function m1(n,e){Object.keys(e).forEach(t=>{Xh(n,t,e[t])})}function fe(n,e,t){if(e==null){const r=n.attributes,i={};for(let s=0;s<r.length;s+=1)i[r[s].name]=r[s].value;return i}if(typeof e=="string"&&t===void 0)return n.getAttribute(e);typeof e=="object"?m1(n,e):Xh(n,e,t)}function y1(n){if(n.indexOf(":")!==-1){const e=n.split(":");return{ns:lt[e[0]],local:e[1]}}return{ns:null,local:n}}function $o(n){const e={};return Object.keys(n).forEach(t=>{const r=p1.includes(t)?t:Hb(t);e[r]=n[t]}),e}function Il(n){const e={};return n.split(";").forEach(r=>{const i=r.trim();if(i){const s=i.split("=");s.length&&(e[s[0].trim()]=s[1]?s[1].trim():"")}}),e}function Yh(n,e){return Object.keys(e).forEach(t=>{if(t==="class")n[t]=n[t]?`${n[t]} ${e[t]}`:e[t];else if(t==="style"){const r=typeof n[t]=="object",i=typeof e[t]=="object";let s,o;r&&i?(s=n[t],o=e[t]):r?(s=n[t],o=Il(e[t])):i?(s=Il(n[t]),o=e[t]):(s=Il(n[t]),o=Il(e[t])),n[t]=Yh(s,o)}else n[t]=e[t]}),n}function m4(n,e,t={}){const r=t.offset||0,i=[],s=[];let o,a,l=null;for(let c=0;c<n.length;c+=1){o=s[c]=n[c];for(let u=0,h=e.length;u<h;u+=1){const f=e[u],d=f.start+r,g=f.end+r;c>=d&&c<g&&(typeof o=="string"?o=s[c]={t:n[c],attrs:f.attrs}:o.attrs=Yh(Yh({},o.attrs),f.attrs),t.includeAnnotationIndices&&(o.annotations==null&&(o.annotations=[]),o.annotations.push(u)))}a=s[c-1],a?Ze(o)&&Ze(a)?(l=l,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?l.t+=o.t:(i.push(l),l=o)):Ze(o)||Ze(a)?(l=l,i.push(l),l=o):l=(l||"")+o:l=o}return l!=null&&i.push(l),i}function y4(n){return n.replace(/ /g," ")}var v1;(function(n){function e(c){const u="data:";return c.substr(0,u.length)===u}n.isDataUrl=e;function t(c,u){if(!c||e(c)){setTimeout(()=>u(null,c));return}const h=()=>{u(new Error(`Failed to load image: ${c}`))},f=window.FileReader?g=>{if(g.status===200){const p=new FileReader;p.onload=b=>{const m=b.target.result;u(null,m)},p.onerror=h,p.readAsDataURL(g.response)}else h()}:g=>{const p=b=>{const y=[];for(let v=0;v<b.length;v+=32768)y.push(String.fromCharCode.apply(null,b.subarray(v,v+32768)));return y.join("")};if(g.status===200){let b=c.split(".").pop()||"png";b==="svg"&&(b="svg+xml");const m=`data:image/${b};base64,`,y=new Uint8Array(g.response),v=m+btoa(p(y));u(null,v)}else h()},d=new XMLHttpRequest;d.responseType=window.FileReader?"blob":"arraybuffer",d.open("GET",c,!0),d.addEventListener("error",h),d.addEventListener("load",()=>f(d)),d.send()}n.imageToDataUri=t;function r(c){let u=c.replace(/\s/g,"");u=decodeURIComponent(u);const h=u.indexOf(","),f=u.slice(0,h),d=f.split(":")[1].split(";")[0],g=u.slice(h+1);let p;f.indexOf("base64")>=0?p=atob(g):p=unescape(encodeURIComponent(g));const b=new Uint8Array(p.length);for(let m=0;m<p.length;m+=1)b[m]=p.charCodeAt(m);return new Blob([b],{type:d})}n.dataUriToBlob=r;function i(c,u){const h=window.navigator.msSaveBlob;if(h)h(c,u);else{const f=window.URL.createObjectURL(c),d=document.createElement("a");d.href=f,d.download=u,document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(f)}}n.downloadBlob=i;function s(c,u){const h=r(c);i(h,u)}n.downloadDataUri=s;function o(c){const u=c.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return u&&u[2]?u[2].replace(/\s+/," ").split(" "):null}function a(c){const u=parseFloat(c);return Number.isNaN(u)?null:u}function l(c,u={}){let h=null;const f=v=>(h==null&&(h=o(c)),h!=null?a(h[v]):null),d=v=>{const w=c.match(v);return w&&w[2]?a(w[2]):null};let g=u.width;if(g==null&&(g=d(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),g==null&&(g=f(2)),g==null)throw new Error("Can not parse width from svg string");let p=u.height;if(p==null&&(p=d(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),p==null&&(p=f(3)),p==null)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(c).replace(/'/g,"%27").replace(/"/g,"%22")}`}n.svgToDataUrl=l})(v1||(v1={}));let wi;const v4={px(n){return n},mm(n){return wi*n},cm(n){return wi*n*10},in(n){return wi*n*25.4},pt(n){return wi*(25.4*n/72)},pc(n){return wi*(25.4*n/6)}};var b1;(function(n){function e(r,i,s){const o=document.createElement("div"),a=o.style;a.display="inline-block",a.position="absolute",a.left="-15000px",a.top="-15000px",a.width=r+(s||"px"),a.height=i+(s||"px"),document.body.appendChild(o);const l=o.getBoundingClientRect(),c={width:l.width||0,height:l.height||0};return document.body.removeChild(o),c}n.measure=e;function t(r,i){wi==null&&(wi=e("1","1","mm").width);const s=i?v4[i]:null;return s?s(r):r}n.toPx=t})(b1||(b1={}));const b4=/-(.)/g;function w4(n){return n.replace(b4,(e,t)=>t.toUpperCase())}const Kh={},w1=["webkit","ms","moz","o"],x1=document?document.createElement("div").style:{};function x4(n){for(let e=0;e<w1.length;e+=1){const t=w1[e]+n;if(t in x1)return t}return null}function C4(n){const e=w4(n);if(Kh[e]==null){const t=e.charAt(0).toUpperCase()+e.slice(1);Kh[e]=e in x1?e:x4(t)}return Kh[e]}function C1(n,e){const t=n.ownerDocument&&n.ownerDocument.defaultView&&n.ownerDocument.defaultView.opener?n.ownerDocument.defaultView.getComputedStyle(n,null):window.getComputedStyle(n,null);return t&&e?t.getPropertyValue(e)||t[e]:t}const S4={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function P4(n){return/^--/.test(n)}function Ll(n,e,t){const r=window.getComputedStyle(n,null);return t?r.getPropertyValue(e)||void 0:r[e]||n.style[e]}function Rl(n,e){return parseInt(Ll(n,e),10)||0}function E4(n,e){return!S4[n]&&typeof e=="number"?`${e}px`:e}function me(n,e,t){if(typeof e=="string"){const r=P4(e);if(r||(e=C4(e)),t===void 0)return Ll(n,e,r);r||(t=E4(e,t));const i=n.style;r?i.setProperty(e,t):i[e]=t;return}for(const r in e)me(n,r,e[r])}const jl=new WeakMap;function S1(n,e){const t=Al(e),r=jl.get(n);if(r)return r[t]}function A4(n,e,t){const r=Al(e),i=jl.get(n);i?i[r]=t:jl.set(n,{[r]:t})}function xi(n,e,t){if(!e){const r={};return Object.keys(jl).forEach(i=>{r[i]=S1(n,i)}),r}if(typeof e=="string"){if(t===void 0)return S1(n,e);A4(n,e,t);return}for(const r in e)xi(n,r,e[r])}const T4={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};function Jh(n,e,t){if(e){if(typeof e=="string"){if(e=T4[e]||e,arguments.length<3)return n[e];n[e]=t;return}for(const r in e)Jh(n,r,e[r])}}class ee{get[Symbol.toStringTag](){return ee.toStringTag}get type(){return this.node.nodeName}get id(){return this.node.id}set id(e){this.node.id=e}constructor(e,t,r){if(!e)throw new TypeError("Invalid element to create vector");let i;if(ee.isVector(e))i=e.node;else if(typeof e=="string")if(e.toLowerCase()==="svg")i=$l();else if(e[0]==="<"){const s=$l(e);i=document.importNode(s.firstChild,!0)}else i=document.createElementNS(lt.svg,e);else i=e;this.node=i,t&&this.setAttributes(t),r&&this.append(r)}transform(e,t){return e==null?ys(this.node):(ys(this.node,e,t),this)}translate(e,t=0,r={}){return e==null?k1(this.node):(k1(this.node,e,t,r),this)}rotate(e,t,r,i={}){return e==null?ef(this.node):(ef(this.node,e,t,r,i),this)}scale(e,t){return e==null?tf(this.node):(tf(this.node,e,t),this)}getTransformToElement(e){const t=ee.toNode(e);return Ro(this.node,t)}removeAttribute(e){return Wh(this.node,e),this}getAttribute(e){return p4(this.node,e)}setAttribute(e,t){return Xh(this.node,e,t),this}setAttributes(e){return m1(this.node,e),this}attr(e,t){return e==null?fe(this.node):typeof e=="string"&&t===void 0?fe(this.node,e):(typeof e=="object"?fe(this.node,e):fe(this.node,e,t),this)}svg(){return this.node instanceof SVGSVGElement?this:ee.create(this.node.ownerSVGElement)}defs(){const e=this.svg()||this,t=e.node.getElementsByTagName("defs")[0];return t?ee.create(t):ee.create("defs").appendTo(e)}text(e,t={}){return A1(this.node,e,t),this}tagName(){return c4(this.node)}clone(){return ee.create(this.node.cloneNode(!0))}remove(){return er(this.node),this}empty(){return No(this.node),this}append(e){return jn(this.node,ee.toNodes(e)),this}appendTo(e){return Ar(this.node,ee.isVector(e)?e.node:e),this}prepend(e){return d1(this.node,ee.toNodes(e)),this}before(e){return ko(this.node,ee.toNodes(e)),this}replace(e){return this.node.parentNode&&this.node.parentNode.replaceChild(ee.toNode(e),this.node),ee.create(e)}first(){return this.node.firstChild?ee.create(this.node.firstChild):null}last(){return this.node.lastChild?ee.create(this.node.lastChild):null}get(e){const t=this.node.childNodes[e];return t?ee.create(t):null}indexOf(e){return Array.prototype.slice.call(this.node.childNodes).indexOf(ee.toNode(e))}find(e){const t=[],r=u4(this.node,e);if(r)for(let i=0,s=r.length;i<s;i+=1)t.push(ee.create(r[i]));return t}findOne(e){const t=h4(this.node,e);return t?ee.create(t):null}findParentByClass(e,t){const r=h1(this.node,e,t);return r?ee.create(r):null}matches(e){const t=this.node;this.node.matches;const r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector||null;return r&&r.call(t,e)}contains(e){return f1(this.node,ee.isVector(e)?e.node:e)}wrap(e){const t=ee.create(e),r=this.node.parentNode;return r!=null&&r.insertBefore(t.node,this.node),t.append(this)}parent(e){let t=this;if(t.node.parentNode==null)return null;if(t=ee.create(t.node.parentNode),e==null)return t;do if(typeof e=="string"?t.matches(e):t instanceof e)return t;while(t=ee.create(t.node.parentNode));return t}children(){const e=this.node.childNodes,t=[];for(let r=0;r<e.length;r+=1)e[r].nodeType===1&&t.push(ee.create(e[r]));return t}eachChild(e,t){const r=this.children();for(let i=0,s=r.length;i<s;i+=1)e.call(r[i],r[i],i,r),t&&r[i].eachChild(e,t);return this}index(){return Uh(this.node)}hasClass(e){return gs(this.node,e)}addClass(e){return K(this.node,e),this}removeClass(e){return gt(this.node,e),this}toggleClass(e,t){return a1(this.node,e,t),this}toLocalPoint(e,t){return X4(this.node,e,t)}sample(e=1){return this.node instanceof SVGPathElement?k4(this.node,e):[]}toPath(){return ee.create(B4(this.node))}toPathData(){return _1(this.node)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(o){if(o==null)return!1;if(o instanceof n)return!0;const a=o[Symbol.toStringTag],l=o;return(a==null||a===n.toStringTag)&&l.node instanceof SVGElement&&typeof l.sample=="function"&&typeof l.toPath=="function"}n.isVector=e;function t(o,a,l){return new n(o,a,l)}n.create=t;function r(o){if(o[0]==="<"){const a=$l(o),l=[];for(let c=0,u=a.childNodes.length;c<u;c+=1){const h=a.childNodes[c];l.push(t(document.importNode(h,!0)))}return l}return[t(o)]}n.createVectors=r;function i(o){return e(o)?o.node:o}n.toNode=i;function s(o){return Array.isArray(o)?o.map(a=>i(a)):[i(o)]}n.toNodes=s})(ee||(ee={}));const P1=document.createElement("canvas").getContext("2d");function O4(n,e){const t=ee.create(e),r=ee.create("textPath"),i=n.d;if(i&&n["xlink:href"]===void 0){const s=ee.create("path").attr("d",i).appendTo(t.defs());r.attr("xlink:href",`#${s.id}`)}return typeof n=="object"&&r.attr(n),r.node}function M4(n,e,t){const r=t.eol,i=t.baseSize,s=t.lineHeight;let o=0,a;const l={},c=e.length-1;for(let u=0;u<=c;u+=1){let h=e[u],f=null;if(typeof h=="object"){const d=h.attrs,g=ee.create("tspan",d);a=g.node;let p=h.t;r&&u===c&&(p+=r),a.textContent=p;const b=d.class;b&&g.addClass(b),t.includeAnnotationIndices&&g.attr("annotations",h.annotations.join(",")),f=parseFloat(d["font-size"]),f===void 0&&(f=i),f&&f>o&&(o=f)}else r&&u===c&&(h+=r),a=document.createTextNode(h||" "),i&&i>o&&(o=i);n.appendChild(a)}return o&&(l.maxFontSize=o),s?l.lineHeight=s:o&&(l.lineHeight=o*1.2),l}const E1=/em$/;function Dl(n,e){const t=parseFloat(n);return E1.test(n)?t*e:t}function _4(n,e,t,r){if(!Array.isArray(e))return 0;const i=e.length;if(!i)return 0;let s=e[0];const o=Dl(s.maxFontSize,t)||t;let a=0;const l=Dl(r,t);for(let h=1;h<i;h+=1){s=e[h];const f=Dl(s.lineHeight,t)||l;a+=f}const c=Dl(s.maxFontSize,t)||t;let u;switch(n){case"middle":u=o/2-.15*c-a/2;break;case"bottom":u=-(.25*c)-a;break;case"top":default:u=.8*o;break}return u}function A1(n,e,t={}){e=y4(e);const r=t.eol;let i=t.textPath;const s=t.textVerticalAnchor,o=s==="middle"||s==="bottom"||s==="top";let a=t.x;a===void 0&&(a=n.getAttribute("x")||0);const l=t.includeAnnotationIndices;let c=t.annotations;c&&!Array.isArray(c)&&(c=[c]);const u=t.lineHeight,h=u==="auto",f=h?"1.5em":u||"1em";let d=!0;const g=n.childNodes;if(g.length===1){const A=g[0];A&&A.tagName.toUpperCase()==="TITLE"&&(d=!1)}d&&No(n),fe(n,{"xml:space":"preserve",display:e||t.displayEmpty?null:"none"});const p=fe(n,"font-size");let b=parseFloat(p);b||(b=16,(o||c)&&!p&&fe(n,"font-size",`${b}`));let m;i?(typeof i=="string"&&(i={d:i}),m=O4(i,n)):m=document.createDocumentFragment();let y,v=0,w;const x=e.split(`
2
+ `),C=[],S=x.length-1;for(let A=0;A<=S;A+=1){y=f;let O="v-line";const T=Zn("tspan");let I,G=x[A];if(G)if(c){const X=m4(G,c,{offset:-v,includeAnnotationIndices:l});I=M4(T,X,{eol:A!==S&&r,baseSize:b,lineHeight:h?null:f,includeAnnotationIndices:l});const M=I.lineHeight;M&&h&&A!==0&&(y=M),A===0&&(w=I.maxFontSize*.8)}else r&&A!==S&&(G+=r),T.textContent=G;else{T.textContent="-",O+=" v-empty-line";const X=T.style;X.fillOpacity=0,X.strokeOpacity=0,c&&(I={})}I&&C.push(I),A>0&&T.setAttribute("dy",y),(A>0||i)&&T.setAttribute("x",a),T.className.baseVal=O,m.appendChild(T),v+=G.length+1}if(o)if(c)y=_4(s,C,b,f);else if(s==="top")y="0.8em";else{let A;switch(S>0?(A=parseFloat(f)||1,A*=S,E1.test(f)||(A/=b)):A=0,s){case"middle":y=`${.3-A/2}em`;break;case"bottom":y=`${-A-.3}em`;break}}else s===0?y="0em":s?y=s:(y=0,n.getAttribute("y")==null&&n.setAttribute("y",`${w||"0.8em"}`));m.firstChild.setAttribute("dy",y),n.appendChild(m)}function Io(n,e={}){if(!n)return{width:0};const t=[],r=e["font-size"]?`${parseFloat(e["font-size"])}px`:"14px";return t.push(e["font-style"]||"normal"),t.push(e["font-variant"]||"normal"),t.push(e["font-weight"]||400),t.push(r),t.push(e["font-family"]||"sans-serif"),P1.font=t.join(" "),P1.measureText(n)}function T1(n,e,t,r={}){if(e>=t)return[n,""];const i=n.length,s={};let o=Math.round(e/t*i-1);for(o<0&&(o=0);o>=0&&o<i;){const a=n.slice(0,o),l=s[a]||Io(a,r).width,c=n.slice(0,o+1),u=s[c]||Io(c,r).width;if(s[a]=l,s[c]=u,l>e)o-=1;else if(u<=e)o+=1;else break}return[n.slice(0,o),n.slice(o)]}function N4(n,e,t={},r={}){const i=e.width,s=e.height,o=r.eol||`
3
+ `,{width:a}=Io(n,t);if(a<i)return n;const l=[],c=t.fontSize||14,u=t.lineHeight?parseFloat(t.lineHeight):Math.ceil(c*1.4),h=Math.floor(s/u);let f=n,d=a,g=r.ellipsis,p=0;g&&(typeof g!="string"&&(g="…"),p=Io(g,t).width);for(let b=0;b<h;b+=1)if(d>i)if(b===h-1){const[y]=T1(f,i-p,d,t);l.push(g?`${y}${g}`:y)}else{const[y,v]=T1(f,i,d,t);l.push(y),f=v,d=Io(f,t).width}else{l.push(f);break}return l.join(o)}const Qh=.551784;function pt(n,e,t=NaN){const r=n.getAttribute(e);if(r==null)return t;const i=parseFloat(r);return Number.isNaN(i)?t:i}function k4(n,e=1){const t=n.getTotalLength(),r=[];let i=0,s;for(;i<t;)s=n.getPointAtLength(i),r.push({distance:i,x:s.x,y:s.y}),i+=e;return r}function $4(n){return["M",pt(n,"x1"),pt(n,"y1"),"L",pt(n,"x2"),pt(n,"y2")].join(" ")}function I4(n){const e=Bl(n);return e.length===0?null:`${O1(e)} Z`}function L4(n){const e=Bl(n);return e.length===0?null:O1(e)}function O1(n){return`M ${n.map(t=>`${t.x} ${t.y}`).join(" L")}`}function Bl(n){const e=[],t=n.points;if(t)for(let r=0,i=t.numberOfItems;r<i;r+=1)e.push(t.getItem(r));return e}function R4(n){const e=pt(n,"cx",0),t=pt(n,"cy",0),r=pt(n,"r"),i=r*Qh;return["M",e,t-r,"C",e+i,t-r,e+r,t-i,e+r,t,"C",e+r,t+i,e+i,t+r,e,t+r,"C",e-i,t+r,e-r,t+i,e-r,t,"C",e-r,t-i,e-i,t-r,e,t-r,"Z"].join(" ")}function j4(n){const e=pt(n,"cx",0),t=pt(n,"cy",0),r=pt(n,"rx"),i=pt(n,"ry")||r,s=r*Qh,o=i*Qh;return["M",e,t-i,"C",e+s,t-i,e+r,t-o,e+r,t,"C",e+r,t+o,e+s,t+i,e,t+i,"C",e-s,t+i,e-r,t+o,e-r,t,"C",e-r,t-o,e-s,t-i,e,t-i,"Z"].join(" ")}function D4(n){return M1({x:pt(n,"x",0),y:pt(n,"y",0),width:pt(n,"width",0),height:pt(n,"height",0),rx:pt(n,"rx",0),ry:pt(n,"ry",0)})}function M1(n){let e;const t=n.x,r=n.y,i=n.width,s=n.height,o=Math.min(n.rx||n["top-rx"]||0,i/2),a=Math.min(n.rx||n["bottom-rx"]||0,i/2),l=Math.min(n.ry||n["top-ry"]||0,s/2),c=Math.min(n.ry||n["bottom-ry"]||0,s/2);return o||a||l||c?e=["M",t,r+l,"v",s-l-c,"a",a,c,0,0,0,a,c,"h",i-2*a,"a",a,c,0,0,0,a,-c,"v",-(s-c-l),"a",o,l,0,0,0,-o,-l,"h",-(i-2*o),"a",o,l,0,0,0,-o,l,"Z"]:e=["M",t,r,"H",t+i,"V",r+s,"H",t,"V",r,"Z"],e.join(" ")}function B4(n){const e=Zn("path");fe(e,fe(n));const t=_1(n);return t&&e.setAttribute("d",t),e}function _1(n){const e=n.tagName.toLowerCase();switch(e){case"path":return n.getAttribute("d");case"line":return $4(n);case"polygon":return I4(n);case"polyline":return L4(n);case"ellipse":return j4(n);case"circle":return R4(n);case"rect":return D4(n)}throw new Error(`"${e}" cannot be converted to svg path element.`)}const zl=Zn("svg"),z4=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,N1=/[ ,]+/,F4=/^(\w+)\((.*)\)/;function V4(n,e){const t=zl.createSVGPoint();return t.x=n,t.y=e,t}function ct(n){const e=zl.createSVGMatrix();if(n!=null){const t=n,r=e;for(const i in t)r[i]=t[i]}return e}function Lo(n){return n!=null?(n instanceof DOMMatrix||(n=ct(n)),zl.createSVGTransformFromMatrix(n)):zl.createSVGTransform()}function ps(n){let e=ct();const t=n!=null&&n.match(z4);if(!t)return e;for(let r=0,i=t.length;r<i;r+=1){const o=t[r].match(F4);if(o){let a,l,c,u,h,f=ct();const d=o[2].split(N1);switch(o[1].toLowerCase()){case"scale":a=parseFloat(d[0]),l=d[1]===void 0?a:parseFloat(d[1]),f=f.scaleNonUniform(a,l);break;case"translate":c=parseFloat(d[0]),u=parseFloat(d[1]),f=f.translate(c,u);break;case"rotate":h=parseFloat(d[0]),c=parseFloat(d[1])||0,u=parseFloat(d[2])||0,c!==0||u!==0?f=f.translate(c,u).rotate(h).translate(-c,-u):f=f.rotate(h);break;case"skewx":h=parseFloat(d[0]),f=f.skewX(h);break;case"skewy":h=parseFloat(d[0]),f=f.skewY(h);break;case"matrix":f.a=parseFloat(d[0]),f.b=parseFloat(d[1]),f.c=parseFloat(d[2]),f.d=parseFloat(d[3]),f.e=parseFloat(d[4]),f.f=parseFloat(d[5]);break;default:continue}e=e.multiply(f)}}return e}function ms(n){const e=n||{},t=e.a!=null?e.a:1,r=e.b!=null?e.b:0,i=e.c!=null?e.c:0,s=e.d!=null?e.d:1,o=e.e!=null?e.e:0,a=e.f!=null?e.f:0;return`matrix(${t},${r},${i},${s},${o},${a})`}function Fl(n){let e,t,r;if(n){const s=N1;if(n.trim().indexOf("matrix")>=0){const o=ps(n),a=q4(o);e=[a.translateX,a.translateY],t=[a.rotation],r=[a.scaleX,a.scaleY];const l=[];(e[0]!==0||e[1]!==0)&&l.push(`translate(${e.join(",")})`),(r[0]!==1||r[1]!==1)&&l.push(`scale(${r.join(",")})`),t[0]!==0&&l.push(`rotate(${t[0]})`),n=l.join(" ")}else{const o=n.match(/translate\((.*?)\)/);o&&(e=o[1].split(s));const a=n.match(/rotate\((.*?)\)/);a&&(t=a[1].split(s));const l=n.match(/scale\((.*?)\)/);l&&(r=l[1].split(s))}}const i=r&&r[0]?parseFloat(r[0]):1;return{raw:n||"",translation:{tx:e&&e[0]?parseInt(e[0],10):0,ty:e&&e[1]?parseInt(e[1],10):0},rotation:{angle:t&&t[0]?parseInt(t[0],10):0,cx:t&&t[1]?parseInt(t[1],10):void 0,cy:t&&t[2]?parseInt(t[2],10):void 0},scale:{sx:i,sy:r&&r[1]?parseFloat(r[1]):i}}}function Zh(n,e){const t=e.x*n.a+e.y*n.c+0,r=e.x*n.b+e.y*n.d+0;return{x:t,y:r}}function q4(n){const e=Zh(n,{x:0,y:1}),t=Zh(n,{x:1,y:0}),r=180/Math.PI*Math.atan2(e.y,e.x)-90,i=180/Math.PI*Math.atan2(t.y,t.x);return{skewX:r,skewY:i,translateX:n.e,translateY:n.f,scaleX:Math.sqrt(n.a*n.a+n.b*n.b),scaleY:Math.sqrt(n.c*n.c+n.d*n.d),rotation:r}}function G4(n){let e,t,r,i;return n?(e=n.a==null?1:n.a,i=n.d==null?1:n.d,t=n.b,r=n.c):e=i=1,{sx:t?Math.sqrt(e*e+t*t):e,sy:r?Math.sqrt(r*r+i*i):i}}function H4(n){let e={x:0,y:1};n&&(e=Zh(n,e));const t=180*Math.atan2(e.y,e.x)/Math.PI%360-90;return{angle:t%360+(t<0?360:0)}}function U4(n){return{tx:n&&n.e||0,ty:n&&n.f||0}}function ys(n,e,t={}){if(e==null)return ps(fe(n,"transform"));if(t.absolute){n.setAttribute("transform",ms(e));return}const r=n.transform,i=Lo(e);r.baseVal.appendItem(i)}function k1(n,e,t=0,r={}){let i=fe(n,"transform");const s=Fl(i);if(e==null)return s.translation;i=s.raw,i=i.replace(/translate\([^)]*\)/g,"").trim();const o=r.absolute?e:s.translation.tx+e,a=r.absolute?t:s.translation.ty+t,l=`translate(${o},${a})`;n.setAttribute("transform",`${l} ${i}`.trim())}function ef(n,e,t,r,i={}){let s=fe(n,"transform");const o=Fl(s);if(e==null)return o.rotation;s=o.raw,s=s.replace(/rotate\([^)]*\)/g,"").trim(),e%=360;const a=i.absolute?e:o.rotation.angle+e,l=t!=null&&r!=null?`,${t},${r}`:"",c=`rotate(${a}${l})`;n.setAttribute("transform",`${s} ${c}`.trim())}function tf(n,e,t){let r=fe(n,"transform");const i=Fl(r);if(e==null)return i.scale;t=t==null?e:t,r=i.raw,r=r.replace(/scale\([^)]*\)/g,"").trim();const s=`scale(${e},${t})`;n.setAttribute("transform",`${r} ${s}`.trim())}function Ro(n,e){if(Er(e)&&Er(n)){const t=e.getScreenCTM(),r=n.getScreenCTM();if(t&&r)return t.inverse().multiply(r)}return ct()}function W4(n,e){let t=ct();if(Er(e)&&Er(n)){let r=n;const i=[];for(;r&&r!==e;){const s=r.getAttribute("transform")||null,o=ps(s);i.push(o),r=r.parentNode}i.reverse().forEach(s=>{t=t.multiply(s)})}return t}function X4(n,e,t){const r=n instanceof SVGSVGElement?n:n.ownerSVGElement,i=r.createSVGPoint();i.x=e,i.y=t;try{const s=r.getScreenCTM(),o=i.matrixTransform(s.inverse()),a=Ro(n,r).inverse();return o.matrixTransform(a)}catch(s){return i}}var nn;(function(n){const e={};function t(s){return e[s]||{}}n.get=t;function r(s,o){e[s]=o}n.register=r;function i(s){delete e[s]}n.unregister=i})(nn||(nn={}));var Ci;(function(n){const e=new WeakMap;function t(s){return e.has(s)||e.set(s,{events:Object.create(null)}),e.get(s)}n.ensure=t;function r(s){return e.get(s)}n.get=r;function i(s){return e.delete(s)}n.remove=i})(Ci||(Ci={}));var ie;(function(n){n.returnTrue=()=>!0,n.returnFalse=()=>!1;function e(i){i.stopPropagation()}n.stopPropagationCallback=e;function t(i,s,o){i.addEventListener!=null&&i.addEventListener(s,o)}n.addEventListener=t;function r(i,s,o){i.removeEventListener!=null&&i.removeEventListener(s,o)}n.removeEventListener=r})(ie||(ie={})),function(n){const e=/[^\x20\t\r\n\f]+/g,t=/^([^.]*)(?:\.(.+)|)/;function r(a){return(a||"").match(e)||[""]}n.splitType=r;function i(a){const l=t.exec(a)||[];return{originType:l[1]?l[1].trim():l[1],namespaces:l[2]?l[2].split(".").map(c=>c.trim()).sort():[]}}n.normalizeType=i;function s(a){return a.nodeType===1||a.nodeType===9||!+a.nodeType}n.isValidTarget=s;function o(a,l){if(l){const c=a;return c.querySelector!=null&&c.querySelector(l)!=null}return!0}n.isValidSelector=o}(ie||(ie={})),function(n){let e=0;const t=new WeakMap;function r(a){return t.has(a)||(t.set(a,e),e+=1),t.get(a)}n.ensureHandlerId=r;function i(a){return t.get(a)}n.getHandlerId=i;function s(a){return t.delete(a)}n.removeHandlerId=s;function o(a,l){return t.set(a,l)}n.setHandlerId=o}(ie||(ie={})),function(n){function e(t,r){const i=[],s=Ci.get(t),o=s&&s.events&&s.events[r.type],a=o&&o.handlers||[],l=o?o.delegateCount:0;if(l>0&&!(r.type==="click"&&typeof r.button=="number"&&r.button>=1)){for(let c=r.target;c!==t;c=c.parentNode||t)if(c.nodeType===1&&!(r.type==="click"&&c.disabled===!0)){const u=[],h={};for(let f=0;f<l;f+=1){const d=a[f],g=d.selector;if(g!=null&&h[g]==null){const p=t,b=[];p.querySelectorAll(g).forEach(m=>{b.push(m)}),h[g]=b.includes(c)}h[g]&&u.push(d)}u.length&&i.push({elem:c,handlers:u})}}return l<a.length&&i.push({elem:t,handlers:a.slice(l)}),i}n.getHandlerQueue=e}(ie||(ie={})),function(n){function e(t){return t!=null&&t===t.window}n.isWindow=e}(ie||(ie={})),function(n){function e(t,r){const i=t.nodeType===9?t.documentElement:t,s=r&&r.parentNode;return t===s||!!(s&&s.nodeType===1&&(i.contains?i.contains(s):t.compareDocumentPosition&&t.compareDocumentPosition(s)&16))}n.contains=e}(ie||(ie={}));class Dn{constructor(e,t){this.isDefaultPrevented=ie.returnFalse,this.isPropagationStopped=ie.returnFalse,this.isImmediatePropagationStopped=ie.returnFalse,this.isSimulated=!1,this.preventDefault=()=>{const r=this.originalEvent;this.isDefaultPrevented=ie.returnTrue,r&&!this.isSimulated&&r.preventDefault()},this.stopPropagation=()=>{const r=this.originalEvent;this.isPropagationStopped=ie.returnTrue,r&&!this.isSimulated&&r.stopPropagation()},this.stopImmediatePropagation=()=>{const r=this.originalEvent;this.isImmediatePropagationStopped=ie.returnTrue,r&&!this.isSimulated&&r.stopImmediatePropagation(),this.stopPropagation()},typeof e=="string"?this.type=e:e.type&&(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?ie.returnTrue:ie.returnFalse,this.target=e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget,this.timeStamp=e.timeStamp),t&&Object.assign(this,t),this.timeStamp||(this.timeStamp=Date.now())}}(function(n){function e(t){return t instanceof n?t:new n(t)}n.create=e})(Dn||(Dn={})),function(n){function e(t,r){Object.defineProperty(n.prototype,t,{enumerable:!0,configurable:!0,get:typeof r=="function"?function(){if(this.originalEvent)return r(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set(i){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:i})}})}n.addProperty=e}(Dn||(Dn={})),function(n){const e={bubbles:!0,cancelable:!0,eventPhase:!0,detail:!0,view:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pageX:!0,pageY:!0,screenX:!0,screenY:!0,toElement:!0,pointerId:!0,pointerType:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,touches:!0,changedTouches:!0,targetTouches:!0,which:!0,altKey:!0,ctrlKey:!0,metaKey:!0,shiftKey:!0};Object.keys(e).forEach(t=>n.addProperty(t,e[t]))}(Dn||(Dn={})),function(n){nn.register("load",{noBubble:!0})}(),function(n){nn.register("beforeunload",{postDispatch(e,t){t.result!==void 0&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}})}(),function(n){nn.register("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(e,t){let r;const i=t.relatedTarget,s=t.handleObj;return(!i||i!==e&&!ie.contains(e,i))&&(t.type=s.originType,r=s.handler.call(e,t),t.type="mouseover"),r}}),nn.register("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(e,t){let r;const i=t.relatedTarget,s=t.handleObj;return(!i||i!==e&&!ie.contains(e,i))&&(t.type=s.originType,r=s.handler.call(e,t),t.type="mouseout"),r}})}();var Y4=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},jo;(function(n){let e;function t(o,a,l,c,u){if(!ie.isValidTarget(o))return;let h;if(typeof l!="function"){const{handler:p,selector:b}=l,m=Y4(l,["handler","selector"]);l=p,u=b,h=m}const f=Ci.ensure(o);let d=f.handler;d==null&&(d=f.handler=function(p,...b){return e!==p.type?i(o,p,...b):void 0});const g=ie.ensureHandlerId(l);ie.splitType(a).forEach(p=>{const{originType:b,namespaces:m}=ie.normalizeType(p);if(!b)return;let y=b,v=nn.get(y);y=(u?v.delegateType:v.bindType)||y,v=nn.get(y);const w=Object.assign({type:y,originType:b,data:c,selector:u,guid:g,handler:l,namespace:m.join(".")},h),x=f.events;let C=x[y];C||(C=x[y]={handlers:[],delegateCount:0},(!v.setup||v.setup(o,c,m,d)===!1)&&ie.addEventListener(o,y,d)),v.add&&(ie.removeHandlerId(w.handler),v.add(o,w),ie.setHandlerId(w.handler,g)),u?(C.handlers.splice(C.delegateCount,0,w),C.delegateCount+=1):C.handlers.push(w)})}n.on=t;function r(o,a,l,c,u){const h=Ci.get(o);if(!h)return;const f=h.events;f&&(ie.splitType(a).forEach(d=>{const{originType:g,namespaces:p}=ie.normalizeType(d);if(!g){Object.keys(f).forEach(x=>{r(o,x+d,l,c,!0)});return}let b=g;const m=nn.get(b);b=(c?m.delegateType:m.bindType)||b;const y=f[b]||{},v=p.length>0?new RegExp(`(^|\\.)${p.join("\\.(?:.*\\.|)")}(\\.|$)`):null,w=y.handlers.length;for(let x=y.handlers.length-1;x>=0;x-=1){const C=y.handlers[x];(u||g===C.originType)&&(!l||ie.getHandlerId(l)===C.guid)&&(v==null||C.namespace&&v.test(C.namespace))&&(c==null||c===C.selector||c==="**"&&C.selector)&&(y.handlers.splice(x,1),C.selector&&(y.delegateCount-=1),m.remove&&m.remove(o,C))}w&&y.handlers.length===0&&((!m.teardown||m.teardown(o,p,h.handler)===!1)&&ie.removeEventListener(o,b,h.handler),delete f[b])}),Object.keys(f).length===0&&Ci.remove(o))}n.off=r;function i(o,a,...l){const c=Dn.create(a);c.delegateTarget=o;const u=nn.get(c.type);if(u.preDispatch&&u.preDispatch(o,c)===!1)return;const h=ie.getHandlerQueue(o,c);for(let f=0,d=h.length;f<d&&!c.isPropagationStopped();f+=1){const g=h[f];c.currentTarget=g.elem;for(let p=0,b=g.handlers.length;p<b&&!c.isImmediatePropagationStopped();p+=1){const m=g.handlers[p];if(c.rnamespace==null||m.namespace&&c.rnamespace.test(m.namespace)){c.handleObj=m,c.data=m.data;const y=nn.get(m.originType).handle,v=y?y(g.elem,c,...l):m.handler.call(g.elem,c,...l);v!==void 0&&(c.result=v,v===!1&&(c.preventDefault(),c.stopPropagation()))}}}return u.postDispatch&&u.postDispatch(o,c),c.result}n.dispatch=i;function s(o,a,l,c){let u=o,h=typeof o=="string"?o:o.type,f=typeof o=="string"||u.namespace==null?[]:u.namespace.split(".");const d=l;if(d.nodeType===3||d.nodeType===8)return;h.indexOf(".")>-1&&(f=h.split("."),h=f.shift(),f.sort());const g=h.indexOf(":")<0&&`on${h}`;u=o instanceof Dn?o:new Dn(h,typeof o=="object"?o:null),u.namespace=f.join("."),u.rnamespace=u.namespace?new RegExp(`(^|\\.)${f.join("\\.(?:.*\\.|)")}(\\.|$)`):null,u.result=void 0,u.target||(u.target=d);const p=[u];Array.isArray(a)?p.push(...a):p.push(a);const b=nn.get(h);if(!c&&b.trigger&&b.trigger(d,u,a)===!1)return;let m;const y=[d];if(!c&&!b.noBubble&&!ie.isWindow(d)){m=b.delegateType||h;let w=d,x=d.parentNode;for(;x!=null;)y.push(x),w=x,x=x.parentNode;const C=d.ownerDocument||document;if(w===C){const S=w.defaultView||w.parentWindow||window;y.push(S)}}let v=d;for(let w=0,x=y.length;w<x&&!u.isPropagationStopped();w+=1){const C=y[w];v=C,u.type=w>1?m:b.bindType||h;const S=Ci.get(C);S&&S.events[u.type]&&S.handler&&S.handler.call(C,...p);const E=g&&C[g]||null;E&&ie.isValidTarget(C)&&(u.result=E.call(C,...p),u.result===!1&&u.preventDefault())}if(u.type=h,!c&&!u.isDefaultPrevented()){const w=b.preventDefault;if((w==null||w(y.pop(),u,a)===!1)&&ie.isValidTarget(d)&&g&&typeof d[h]=="function"&&!ie.isWindow(d)){const x=d[g];x&&(d[g]=null),e=h,u.isPropagationStopped()&&v.addEventListener(h,ie.stopPropagationCallback),d[h](),u.isPropagationStopped()&&v.removeEventListener(h,ie.stopPropagationCallback),e=void 0,x&&(d[g]=x)}}return u.result}n.trigger=s})(jo||(jo={}));var Pe;(function(n){function e(s,o,a,l,c){return Do.on(s,o,a,l,c),s}n.on=e;function t(s,o,a,l,c){return Do.on(s,o,a,l,c,!0),s}n.once=t;function r(s,o,a,l){return Do.off(s,o,a,l),s}n.off=r;function i(s,o,a,l){return jo.trigger(o,a,s,l),s}n.trigger=i})(Pe||(Pe={}));var Do;(function(n){function e(r,i,s,o,a,l){if(typeof i=="object"){typeof s!="string"&&(o=o||s,s=void 0),Object.keys(i).forEach(c=>e(r,c,s,o,i[c],l));return}if(o==null&&a==null?(a=s,o=s=void 0):a==null&&(typeof s=="string"?(a=o,o=void 0):(a=o,o=s,s=void 0)),a===!1)a=ie.returnFalse;else if(!a)return;if(l){const c=a;a=function(u,...h){return n.off(r,u),c.call(this,u,...h)},ie.setHandlerId(a,ie.ensureHandlerId(c))}jo.on(r,i,a,o,s)}n.on=e;function t(r,i,s,o){const a=i;if(a&&a.preventDefault!=null&&a.handleObj!=null){const l=a.handleObj;t(a.delegateTarget,l.namespace?`${l.originType}.${l.namespace}`:l.originType,l.selector,l.handler);return}if(typeof i=="object"){const l=i;Object.keys(l).forEach(c=>t(r,c,s,l[c]));return}(s===!1||typeof s=="function")&&(o=s,s=void 0),o===!1&&(o=ie.returnFalse),jo.off(r,i,o,s)}n.off=t})(Do||(Do={}));class $1{constructor(e,t,r){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=tn.isEventSupported("wheel")?"wheel":"mousewheel",this.target=e,this.onWheelCallback=t,this.onWheelGuard=r,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){this.target.addEventListener(this.eventName,this.onWheel,{passive:!1})}disable(){this.target.removeEventListener(this.eventName,this.onWheel)}onWheel(e){if(this.onWheelGuard!=null&&!this.onWheelGuard(e))return;this.deltaX+=e.deltaX,this.deltaY+=e.deltaY,e.preventDefault();let t;(this.deltaX!==0||this.deltaY!==0)&&(e.stopPropagation(),t=!0),t===!0&&this.animationFrameId===0&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(e)}))}didWheel(e){this.animationFrameId=0,this.onWheelCallback(e,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function Bo(n){const e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView;return{top:e.top+t.pageYOffset,left:e.left+t.pageXOffset}}function K4(n){return n.getBoundingClientRect().width}function J4(n){return n.getBoundingClientRect().height}function Q4(n){const e=Ll(n,"position")==="fixed";let t;if(e){const r=n.getBoundingClientRect();t={left:r.left,top:r.top}}else t=Bo(n);if(!e){const r=n.ownerDocument;let i=n.offsetParent||r.documentElement;for(;(i===r.body||i===r.documentElement)&&Ll(i,"position")==="static";)i=i.parentNode;if(i!==n&&d4(i)){const s=Bo(i);t.top-=s.top+Rl(i,"borderTopWidth"),t.left-=s.left+Rl(i,"borderLeftWidth")}}return{top:t.top-Rl(n,"marginTop"),left:t.left-Rl(n,"marginLeft")}}function I1(n,e=60){let t=null;return(...r)=>{t&&clearTimeout(t),t=window.setTimeout(()=>{n.apply(this,r)},e)}}function Z4(n){let e=null,t=[];const r=()=>{if(getComputedStyle(n).position==="static"){const c=n.style;c.position="relative"}const l=document.createElement("object");return l.onload=()=>{l.contentDocument.defaultView.addEventListener("resize",i),i()},l.style.display="block",l.style.position="absolute",l.style.top="0",l.style.left="0",l.style.height="100%",l.style.width="100%",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="-1",l.style.opacity="0",l.setAttribute("tabindex","-1"),l.type="text/html",n.appendChild(l),l.data="about:blank",l},i=I1(()=>{t.forEach(l=>l(n))}),s=l=>{e||(e=r()),t.indexOf(l)===-1&&t.push(l)},o=()=>{e&&e.parentNode&&(e.contentDocument&&e.contentDocument.defaultView.removeEventListener("resize",i),e.parentNode.removeChild(e),e=null,t=[])};return{element:n,bind:s,destroy:o,unbind:l=>{const c=t.indexOf(l);c!==-1&&t.splice(c,1),t.length===0&&e&&o()}}}function e6(n){let e=null,t=[];const r=I1(()=>{t.forEach(l=>{l(n)})}),i=()=>{const l=new ResizeObserver(r);return l.observe(n),r(),l},s=l=>{e||(e=i()),t.indexOf(l)===-1&&t.push(l)},o=()=>{e&&(e.disconnect(),t=[],e=null)};return{element:n,bind:s,destroy:o,unbind:l=>{const c=t.indexOf(l);c!==-1&&t.splice(c,1),t.length===0&&e&&o()}}}const t6=typeof ResizeObserver!="undefined"?e6:Z4;var Vl;(function(n){const e=new WeakMap;function t(i){let s=e.get(i);return s||(s=t6(i),e.set(i,s),s)}function r(i){i.destroy(),e.delete(i.element)}n.bind=(i,s)=>{const o=t(i);return o.bind(s),()=>o.unbind(s)},n.clear=i=>{const s=t(i);r(s)}})(Vl||(Vl={}));class zo{constructor(e={}){this.comparator=e.comparator||zo.defaultComparator,this.index={},this.data=e.data||[],this.heapify()}isEmpty(){return this.data.length===0}insert(e,t,r){const i={priority:e,value:t},s=this.data.length;return r&&(i.id=r,this.index[r]=s),this.data.push(i),this.bubbleUp(s),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(e,t){const r=this.index[e];if(typeof r=="undefined")throw new Error(`Node with id '${e}' was not found in the heap.`);const i=this.data,s=i[r].priority,o=this.comparator(t,s);o<0?(i[r].priority=t,this.bubbleUp(r)):o>0&&(i[r].priority=t,this.bubbleDown(r))}remove(){const e=this.data,t=e[0],r=e.pop();return t.id&&delete this.index[t.id],e.length>0&&(e[0]=r,r.id&&(this.index[r.id]=0),this.bubbleDown(0)),t?t.value:null}heapify(){for(let e=0;e<this.data.length;e+=1)this.bubbleUp(e)}bubbleUp(e){const t=this.data;let r,i,s=e;for(;s>0&&(i=s-1>>>1,this.comparator(t[s].priority,t[i].priority)<0);){r=t[i],t[i]=t[s];let o=t[s].id;o!=null&&(this.index[o]=i),t[s]=r,o=t[s].id,o!=null&&(this.index[o]=s),s=i}}bubbleDown(e){const t=this.data,r=t.length-1;let i=e;for(;;){const s=(i<<1)+1,o=s+1;let a=i;if(s<=r&&this.comparator(t[s].priority,t[a].priority)<0&&(a=s),o<=r&&this.comparator(t[o].priority,t[a].priority)<0&&(a=o),a!==i){const l=t[a];t[a]=t[i];let c=t[i].id;c!=null&&(this.index[c]=a),t[i]=l,c=t[i].id,c!=null&&(this.index[c]=i),i=a}else break}}}(function(n){n.defaultComparator=(e,t)=>e-t})(zo||(zo={}));var nf;(function(n){function e(t,r,i=(s,o)=>1){const s={},o={},a={},l=new zo;for(s[r]=0,Object.keys(t).forEach(c=>{c!==r&&(s[c]=1/0),l.insert(s[c],c,c)});!l.isEmpty();){const c=l.remove();a[c]=!0;const u=t[c]||[];for(let h=0;h<u.length;h+=1){const f=u[h];if(!a[f]){const d=s[c]+i(c,f);d<s[f]&&(s[f]=d,o[f]=c,l.updatePriority(f,d))}}}return o}n.run=e})(nf||(nf={}));class tr{constructor(e,t,r,i){if(e==null)return this.set(255,255,255,1);if(typeof e=="number")return this.set(e,t,r,i);if(typeof e=="string")return tr.fromString(e)||this;if(Array.isArray(e))return this.set(e);this.set(e.r,e.g,e.b,e.a==null?1:e.a)}blend(e,t,r){this.set(e.r+(t.r-e.r)*r,e.g+(t.g-e.g)*r,e.b+(t.b-e.b)*r,e.a+(t.a-e.a)*r)}lighten(e){const t=tr.lighten(this.toArray(),e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}darken(e){this.lighten(-e)}set(e,t,r,i){const s=Array.isArray(e)?e[0]:e,o=Array.isArray(e)?e[1]:t,a=Array.isArray(e)?e[2]:r,l=Array.isArray(e)?e[3]:i;return this.r=Math.round(en(s,0,255)),this.g=Math.round(en(o,0,255)),this.b=Math.round(en(a,0,255)),this.a=l==null?1:en(l,0,1),this}toHex(){return`#${["r","g","b"].map(t=>{const r=this[t].toString(16);return r.length<2?`0${r}`:r}).join("")}`}toRGBA(){return this.toArray()}toHSLA(){return tr.rgba2hsla(this.r,this.g,this.b,this.a)}toCSS(e){const t=`${this.r},${this.g},${this.b},`;return e?`rgb(${t})`:`rgba(${t},${this.a})`}toGrey(){return tr.makeGrey(Math.round((this.r+this.g+this.b)/3),this.a)}toArray(){return[this.r,this.g,this.b,this.a]}toString(){return this.toCSS()}}(function(n){function e(v){return new n(v)}n.fromArray=e;function t(v){return new n([...g(v),1])}n.fromHex=t;function r(v){const w=v.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(w){const x=w[1].split(/\s*,\s*/).map(C=>parseInt(C,10));return new n(x)}return null}n.fromRGBA=r;function i(v,w,x){x<0&&++x,x>1&&--x;const C=6*x;return C<1?v+(w-v)*C:2*x<1?w:3*x<2?v+(w-v)*(2/3-x)*6:v}function s(v){const w=v.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(w){const x=w[2].split(/\s*,\s*/),C=(parseFloat(x[0])%360+360)%360/360,S=parseFloat(x[1])/100,E=parseFloat(x[2])/100,A=x[3]==null?1:parseInt(x[3],10);return new n(c(C,S,E,A))}return null}n.fromHSLA=s;function o(v){if(v.startsWith("#"))return t(v);if(v.startsWith("rgb"))return r(v);const w=n.named[v];return w?t(w):s(v)}n.fromString=o;function a(v,w){return n.fromArray([v,v,v,w])}n.makeGrey=a;function l(v,w,x,C){const S=Array.isArray(v)?v[0]:v,E=Array.isArray(v)?v[1]:w,A=Array.isArray(v)?v[2]:x,O=Array.isArray(v)?v[3]:C,T=Math.max(S,E,A),I=Math.min(S,E,A),G=(T+I)/2;let X=0,M=0;if(I!==T){const k=T-I;switch(M=G>.5?k/(2-T-I):k/(T+I),T){case S:X=(E-A)/k+(E<A?6:0);break;case E:X=(A-S)/k+2;break;case A:X=(S-E)/k+4;break}X/=6}return[X,M,G,O==null?1:O]}n.rgba2hsla=l;function c(v,w,x,C){const S=Array.isArray(v)?v[0]:v,E=Array.isArray(v)?v[1]:w,A=Array.isArray(v)?v[2]:x,O=Array.isArray(v)?v[3]:C,T=A<=.5?A*(E+1):A+E-A*E,I=2*A-T;return[i(I,T,S+1/3)*256,i(I,T,S)*256,i(I,T,S-1/3)*256,O==null?1:O]}n.hsla2rgba=c;function u(v){return new n(Math.round(Math.random()*256),Math.round(Math.random()*256),Math.round(Math.random()*256),v?void 0:parseFloat(Math.random().toFixed(2)))}n.random=u;function h(){const v="0123456789ABCDEF";let w="#";for(let x=0;x<6;x+=1)w+=v[Math.floor(Math.random()*16)];return w}n.randomHex=h;function f(v){return u(v).toString()}n.randomRGBA=f;function d(v,w){if(typeof v=="string"){const A=v[0]==="#",[O,T,I]=g(v);return w?O*.299+T*.587+I*.114>186?"#000000":"#ffffff":`${A?"#":""}${p(255-O,255-T,255-I)}`}const x=v[0],C=v[1],S=v[2],E=v[3];return w?x*.299+C*.587+S*.114>186?[0,0,0,E]:[255,255,255,E]:[255-x,255-C,255-S,E]}n.invert=d;function g(v){const w=v.indexOf("#")===0?v:`#${v}`;let x=+`0x${w.substr(1)}`;if(!(w.length===4||w.length===7)||Number.isNaN(x))throw new Error("Invalid hex color.");const C=w.length===4?4:8,S=(1<<C)-1,E=["b","g","r"].map(()=>{const A=x&S;return x>>=C,C===4?17*A:A});return[E[2],E[1],E[0]]}function p(v,w,x){const C=S=>S.length<2?`0${S}`:S;return`${C(v.toString(16))}${C(w.toString(16))}${C(x.toString(16))}`}function b(v,w){return y(v,w)}n.lighten=b;function m(v,w){return y(v,-w)}n.darken=m;function y(v,w){if(typeof v=="string"){const S=v[0]==="#",E=parseInt(S?v.substr(1):v,16),A=en((E>>16)+w,0,255),O=en((E>>8&255)+w,0,255),T=en((E&255)+w,0,255);return`${S?"#":""}${(T|O<<8|A<<16).toString(16)}`}const x=p(v[0],v[1],v[2]),C=g(y(x,w));return[C[0],C[1],C[2],v[3]]}})(tr||(tr={})),function(n){n.named={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",burntsienna:"#ea7e5d",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",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",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"}}(tr||(tr={}));class rf{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(e){return this.map.has(e)}get(e){return this.map.get(e)}set(e,t){this.map.set(e,t),this.arr.push(e)}delete(e){const t=this.arr.indexOf(e);t>=0&&this.arr.splice(t,1);const r=this.map.get(e);return this.map.delete(e),r}each(e){this.arr.forEach(t=>{const r=this.map.get(t);e(r,t)})}dispose(){this.clear()}}var nr;(function(n){function e(i){const s=[],o=[];return Array.isArray(i)?s.push(...i):i.split("|").forEach(a=>{a.indexOf("&")===-1?s.push(a):o.push(...a.split("&"))}),{or:s,and:o}}n.parse=e;function t(i,s){if(i!=null&&s!=null){const o=e(i),a=e(s),l=o.or.sort(),c=a.or.sort(),u=o.and.sort(),h=a.and.sort(),f=(d,g)=>d.length===g.length&&(d.length===0||d.every((p,b)=>p===g[b]));return f(l,c)&&f(u,h)}return i==null&&s==null}n.equals=t;function r(i,s,o){if(s==null||Array.isArray(s)&&s.length===0)return o?i.altKey!==!0&&i.ctrlKey!==!0&&i.metaKey!==!0&&i.shiftKey!==!0:!0;const{or:a,and:l}=e(s),c=u=>{const h=`${u.toLowerCase()}Key`;return i[h]===!0};return a.some(u=>c(u))&&l.every(u=>c(u))}n.isMatch=r})(nr||(nr={}));var Si;(function(n){n.linear=e=>e,n.quad=e=>e*e,n.cubic=e=>e*e*e,n.inout=e=>{if(e<=0)return 0;if(e>=1)return 1;const t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)},n.exponential=e=>Math.pow(2,10*(e-1)),n.bounce=e=>{for(let t=0,r=1;;t+=r,r/=2)if(e>=(7-4*t)/11){const i=(11-6*t-11*e)/4;return-i*i+r*r}}})(Si||(Si={})),function(n){n.decorators={reverse(e){return t=>1-e(1-t)},reflect(e){return t=>.5*(t<.5?e(2*t):2-e(2-2*t))},clamp(e,t=0,r=1){return i=>{const s=e(i);return s<t?t:s>r?r:s}},back(e=1.70158){return t=>t*t*((e+1)*t-e)},elastic(e=1.5){return t=>Math.pow(2,10*(t-1))*Math.cos(20*Math.PI*e/3*t)}}}(Si||(Si={})),function(n){function e(M){return-1*Math.cos(M*(Math.PI/2))+1}n.easeInSine=e;function t(M){return Math.sin(M*(Math.PI/2))}n.easeOutSine=t;function r(M){return-.5*(Math.cos(Math.PI*M)-1)}n.easeInOutSine=r;function i(M){return M*M}n.easeInQuad=i;function s(M){return M*(2-M)}n.easeOutQuad=s;function o(M){return M<.5?2*M*M:-1+(4-2*M)*M}n.easeInOutQuad=o;function a(M){return M*M*M}n.easeInCubic=a;function l(M){const k=M-1;return k*k*k+1}n.easeOutCubic=l;function c(M){return M<.5?4*M*M*M:(M-1)*(2*M-2)*(2*M-2)+1}n.easeInOutCubic=c;function u(M){return M*M*M*M}n.easeInQuart=u;function h(M){const k=M-1;return 1-k*k*k*k}n.easeOutQuart=h;function f(M){const k=M-1;return M<.5?8*M*M*M*M:1-8*k*k*k*k}n.easeInOutQuart=f;function d(M){return M*M*M*M*M}n.easeInQuint=d;function g(M){const k=M-1;return 1+k*k*k*k*k}n.easeOutQuint=g;function p(M){const k=M-1;return M<.5?16*M*M*M*M*M:1+16*k*k*k*k*k}n.easeInOutQuint=p;function b(M){return M===0?0:Math.pow(2,10*(M-1))}n.easeInExpo=b;function m(M){return M===1?1:-Math.pow(2,-10*M)+1}n.easeOutExpo=m;function y(M){if(M===0||M===1)return M;const k=M*2,Q=k-1;return k<1?.5*Math.pow(2,10*Q):.5*(-Math.pow(2,-10*Q)+2)}n.easeInOutExpo=y;function v(M){const k=M/1;return-1*(Math.sqrt(1-k*M)-1)}n.easeInCirc=v;function w(M){const k=M-1;return Math.sqrt(1-k*k)}n.easeOutCirc=w;function x(M){const k=M*2,Q=k-2;return k<1?-.5*(Math.sqrt(1-k*k)-1):.5*(Math.sqrt(1-Q*Q)+1)}n.easeInOutCirc=x;function C(M,k=1.70158){return M*M*((k+1)*M-k)}n.easeInBack=C;function S(M,k=1.70158){const Q=M/1-1;return Q*Q*((k+1)*Q+k)+1}n.easeOutBack=S;function E(M,k=1.70158){const Q=M*2,R=Q-2,z=k*1.525;return Q<1?.5*Q*Q*((z+1)*Q-z):.5*(R*R*((z+1)*R+z)+2)}n.easeInOutBack=E;function A(M,k=.7){if(M===0||M===1)return M;const R=M/1-1,z=1-k,H=z/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*R)*Math.sin((R-H)*(2*Math.PI)/z))}n.easeInElastic=A;function O(M,k=.7){const Q=1-k,R=M*2;if(M===0||M===1)return M;const z=Q/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*R)*Math.sin((R-z)*(2*Math.PI)/Q)+1}n.easeOutElastic=O;function T(M,k=.65){const Q=1-k;if(M===0||M===1)return M;const R=M*2,z=R-1,H=Q/(2*Math.PI)*Math.asin(1);return R<1?-.5*(Math.pow(2,10*z)*Math.sin((z-H)*(2*Math.PI)/Q)):Math.pow(2,-10*z)*Math.sin((z-H)*(2*Math.PI)/Q)*.5+1}n.easeInOutElastic=T;function I(M){const k=M/1;if(k<1/2.75)return 7.5625*k*k;if(k<2/2.75){const Q=k-.5454545454545454;return 7.5625*Q*Q+.75}if(k<2.5/2.75){const Q=k-.8181818181818182;return 7.5625*Q*Q+.9375}{const Q=k-.9545454545454546;return 7.5625*Q*Q+.984375}}n.easeOutBounce=I;function G(M){return 1-I(1-M)}n.easeInBounce=G;function X(M){return M<.5?G(M*2)*.5:I(M*2-1)*.5+.5}n.easeInOutBounce=X}(Si||(Si={}));var Pi;(function(n){n.number=(e,t)=>{const r=t-e;return i=>e+r*i},n.object=(e,t)=>{const r=Object.keys(e);return i=>{const s={};for(let o=r.length-1;o!==-1;o-=1){const a=r[o];s[a]=e[a]+(t[a]-e[a])*i}return s}},n.unit=(e,t)=>{const r=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,i=r.exec(e),s=r.exec(t),o=s?s[1]:"",a=i?+i[1]:0,l=s?+s[1]:0,c=o.indexOf("."),u=c>0?o[1].length-c-1:0,h=l-a,f=i?i[2]:"";return d=>(a+h*d).toFixed(u)+f},n.color=(e,t)=>{const r=parseInt(e.slice(1),16),i=parseInt(t.slice(1),16),s=r&255,o=(i&255)-s,a=r&65280,l=(i&65280)-a,c=r&16711680,u=(i&16711680)-c;return h=>{const f=s+o*h&255,d=a+l*h&65280,g=c+u*h&16711680;return`#${(1<<24|f|d|g).toString(16).slice(1)}`}}})(Pi||(Pi={}));const Fo=[];function Vo(n,e){const t=Fo.find(r=>r.name===n);if(!(t&&(t.loadTimes+=1,t.loadTimes>1))&&!tn.isApplyingHMR()){const r=document.createElement("style");r.setAttribute("type","text/css"),r.textContent=e;const i=document.querySelector("head");i&&i.insertBefore(r,i.firstChild),Fo.push({name:n,loadTimes:1,styleElement:r})}}function qo(n){const e=Fo.findIndex(t=>t.name===n);if(e>-1){const t=Fo[e];if(t.loadTimes-=1,t.loadTimes>0)return;let r=t.styleElement;r&&r.parentNode&&r.parentNode.removeChild(r),r=null,Fo.splice(e,1)}}var ve;(function(n){function e(r){return 180*r/Math.PI%360}n.toDeg=e,n.toRad=function(r,i=!1){return(i?r:r%360)*Math.PI/180};function t(r){return r%360+(r<0?360:0)}n.normalize=t})(ve||(ve={}));var we;(function(n){function e(a,l=0){return Number.isInteger(a)?a:+a.toFixed(l)}n.round=e;function t(a,l){let c,u;if(l==null?(u=a==null?1:a,c=0):(u=l,c=a==null?0:a),u<c){const h=c;c=u,u=h}return Math.floor(Math.random()*(u-c+1)+c)}n.random=t;function r(a,l,c){return Number.isNaN(a)?NaN:Number.isNaN(l)||Number.isNaN(c)?0:l<c?a<l?l:a>c?c:a:a<c?c:a>l?l:a}n.clamp=r;function i(a,l){return l*Math.round(a/l)}n.snapToGrid=i;function s(a,l){return l!=null&&a!=null&&l.x>=a.x&&l.x<=a.x+a.width&&l.y>=a.y&&l.y<=a.y+a.height}n.containsPoint=s;function o(a,l){const c=a.x-l.x,u=a.y-l.y;return c*c+u*u}n.squaredLength=o})(we||(we={}));class Tr{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class P extends Tr{constructor(e,t){super(),this.x=e==null?0:e,this.y=t==null?0:t}round(e=0){return this.x=we.round(this.x,e),this.y=we.round(this.y,e),this}add(e,t){const r=P.create(e,t);return this.x+=r.x,this.y+=r.y,this}update(e,t){const r=P.create(e,t);return this.x=r.x,this.y=r.y,this}translate(e,t){const r=P.create(e,t);return this.x+=r.x,this.y+=r.y,this}rotate(e,t){const r=P.rotate(this,e,t);return this.x=r.x,this.y=r.y,this}scale(e,t,r=new P){const i=P.create(r);return this.x=i.x+e*(this.x-i.x),this.y=i.y+t*(this.y-i.y),this}closest(e){if(e.length===1)return P.create(e[0]);let t=null,r=1/0;return e.forEach(i=>{const s=this.squaredDistance(i);s<r&&(t=i,r=s)}),t?P.create(t):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){const t=P.create(e),r=this.x-t.x,i=this.y-t.y;return r*r+i*i}manhattanDistance(e){const t=P.create(e);return Math.abs(t.x-this.x)+Math.abs(t.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(e=new P){const t=P.create(e),r=-(t.y-this.y),i=t.x-this.x;let s=Math.atan2(r,i);return s<0&&(s=2*Math.PI+s),180*s/Math.PI}angleBetween(e,t){if(this.equals(e)||this.equals(t))return NaN;let r=this.theta(t)-this.theta(e);return r<0&&(r+=360),r}vectorAngle(e){return new P(0,0).angleBetween(this,e)}toPolar(e){return this.update(P.toPolar(this,e)),this}changeInAngle(e,t,r=new P){return this.clone().translate(-e,-t).theta(r)-this.theta(r)}adhereToRect(e){return we.containsPoint(e,this)||(this.x=Math.min(Math.max(this.x,e.x),e.x+e.width),this.y=Math.min(Math.max(this.y,e.y),e.y+e.height)),this}bearing(e){const t=P.create(e),r=ve.toRad(this.y),i=ve.toRad(t.y),s=this.x,o=t.x,a=ve.toRad(o-s),l=Math.sin(a)*Math.cos(i),c=Math.cos(r)*Math.sin(i)-Math.sin(r)*Math.cos(i)*Math.cos(a),u=ve.toDeg(Math.atan2(l,c)),h=["NE","E","SE","S","SW","W","NW","N"];let f=u-22.5;return f<0&&(f+=360),f=parseInt(f/45,10),h[f]}cross(e,t){if(e!=null&&t!=null){const r=P.create(e),i=P.create(t);return(i.x-this.x)*(r.y-this.y)-(i.y-this.y)*(r.x-this.x)}return NaN}dot(e){const t=P.create(e);return this.x*t.x+this.y*t.y}diff(e,t){if(typeof e=="number")return new P(this.x-e,this.y-t);const r=P.create(e);return new P(this.x-r.x,this.y-r.y)}lerp(e,t){const r=P.create(e);return new P((1-t)*this.x+t*r.x,(1-t)*this.y+t*r.y)}normalize(e=1){const t=e/this.magnitude();return this.scale(t,t)}move(e,t){const r=P.create(e),i=ve.toRad(r.theta(this));return this.translate(Math.cos(i)*t,-Math.sin(i)*t)}reflection(e){return P.create(e).move(this,this.distance(e))}snapToGrid(e,t){return this.x=we.snapToGrid(this.x,e),this.y=we.snapToGrid(this.y,t==null?e:t),this}equals(e){const t=P.create(e);return t!=null&&t.x===this.x&&t.y===this.y}clone(){return P.clone(this)}toJSON(){return P.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPoint=e})(P||(P={})),function(n){function e(r){return r!=null&&typeof r=="object"&&typeof r.x=="number"&&typeof r.y=="number"}n.isPointLike=e;function t(r){return r!=null&&Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}n.isPointData=t}(P||(P={})),function(n){function e(h,f){return h==null||typeof h=="number"?new n(h,f):t(h)}n.create=e;function t(h){return n.isPoint(h)?new n(h.x,h.y):Array.isArray(h)?new n(h[0],h[1]):new n(h.x,h.y)}n.clone=t;function r(h){return n.isPoint(h)?{x:h.x,y:h.y}:Array.isArray(h)?{x:h[0],y:h[1]}:{x:h.x,y:h.y}}n.toJSON=r;function i(h,f,d=new n){let g=Math.abs(h*Math.cos(f)),p=Math.abs(h*Math.sin(f));const b=t(d),m=ve.normalize(ve.toDeg(f));return m<90?p=-p:m<180?(g=-g,p=-p):m<270&&(g=-g),new n(b.x+g,b.y+p)}n.fromPolar=i;function s(h,f=new n){const d=t(h),g=t(f),p=d.x-g.x,b=d.y-g.y;return new n(Math.sqrt(p*p+b*b),ve.toRad(g.theta(d)))}n.toPolar=s;function o(h,f){return h===f?!0:h!=null&&f!=null?h.x===f.x&&h.y===f.y:!1}n.equals=o;function a(h,f){if(h==null&&f!=null||h!=null&&f==null||h!=null&&f!=null&&h.length!==f.length)return!1;if(h!=null&&f!=null){for(let d=0,g=h.length;d<g;d+=1)if(!o(h[d],f[d]))return!1}return!0}n.equalPoints=a;function l(h,f,d,g){return new n(we.random(h,f),we.random(d,g))}n.random=l;function c(h,f,d){const g=ve.toRad(ve.normalize(-f)),p=Math.sin(g),b=Math.cos(g);return u(h,b,p,d)}n.rotate=c;function u(h,f,d,g=new n){const p=t(h),b=t(g),m=p.x-b.x,y=p.y-b.y,v=m*f-y*d,w=y*f+m*d;return new n(v+b.x,w+b.y)}n.rotateEx=u}(P||(P={}));class D extends Tr{get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new P(this.x,this.y)}get topLeft(){return new P(this.x,this.y)}get topCenter(){return new P(this.x+this.width/2,this.y)}get topRight(){return new P(this.x+this.width,this.y)}get center(){return new P(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new P(this.x,this.y+this.height)}get bottomCenter(){return new P(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new P(this.x+this.width,this.y+this.height)}get corner(){return new P(this.x+this.width,this.y+this.height)}get rightMiddle(){return new P(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new P(this.x,this.y+this.height/2)}get topLine(){return new F(this.topLeft,this.topRight)}get rightLine(){return new F(this.topRight,this.bottomRight)}get bottomLine(){return new F(this.bottomLeft,this.bottomRight)}get leftLine(){return new F(this.topLeft,this.bottomLeft)}constructor(e,t,r,i){super(),this.x=e==null?0:e,this.y=t==null?0:t,this.width=r==null?0:r,this.height=i==null?0:i}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(e){if(!e)return this.clone();const t=ve.toRad(e),r=Math.abs(Math.sin(t)),i=Math.abs(Math.cos(t)),s=this.width*i+this.height*r,o=this.width*r+this.height*i;return new D(this.x+(this.width-s)/2,this.y+(this.height-o)/2,s,o)}round(e=0){return this.x=we.round(this.x,e),this.y=we.round(this.y,e),this.width=we.round(this.width,e),this.height=we.round(this.height,e),this}add(e,t,r,i){const s=D.create(e,t,r,i),o=Math.min(this.x,s.x),a=Math.min(this.y,s.y),l=Math.max(this.x+this.width,s.x+s.width),c=Math.max(this.y+this.height,s.y+s.height);return this.x=o,this.y=a,this.width=l-o,this.height=c-a,this}update(e,t,r,i){const s=D.create(e,t,r,i);return this.x=s.x,this.y=s.y,this.width=s.width,this.height=s.height,this}inflate(e,t){const r=e,i=t!=null?t:e;return this.x-=r,this.y-=i,this.width+=2*r,this.height+=2*i,this}snapToGrid(e,t){const r=this.origin.snapToGrid(e,t),i=this.corner.snapToGrid(e,t);return this.x=r.x,this.y=r.y,this.width=i.x-r.x,this.height=i.y-r.y,this}translate(e,t){const r=P.create(e,t);return this.x+=r.x,this.y+=r.y,this}scale(e,t,r=new P){const i=this.origin.scale(e,t,r);return this.x=i.x,this.y=i.y,this.width*=e,this.height*=t,this}rotate(e,t=this.getCenter()){if(e!==0){const r=ve.toRad(e),i=Math.cos(r),s=Math.sin(r);let o=this.getOrigin(),a=this.getTopRight(),l=this.getBottomRight(),c=this.getBottomLeft();o=P.rotateEx(o,i,s,t),a=P.rotateEx(a,i,s,t),l=P.rotateEx(l,i,s,t),c=P.rotateEx(c,i,s,t);const u=new D(o.x,o.y,0,0);u.add(a.x,a.y,0,0),u.add(l.x,l.y,0,0),u.add(c.x,c.y,0,0),this.update(u)}return this}rotate90(){const e=(this.width-this.height)/2;this.x+=e,this.y-=e;const t=this.width;return this.width=this.height,this.height=t,this}moveAndExpand(e){const t=D.clone(e);return this.x+=t.x||0,this.y+=t.y||0,this.width+=t.width||0,this.height+=t.height||0,this}getMaxScaleToFit(e,t=this.center){const r=D.clone(e),i=t.x,s=t.y;let o=1/0,a=1/0,l=1/0,c=1/0,u=1/0,h=1/0,f=1/0,d=1/0;const g=r.topLeft;g.x<i&&(o=(this.x-i)/(g.x-i)),g.y<s&&(u=(this.y-s)/(g.y-s));const p=r.bottomRight;p.x>i&&(a=(this.x+this.width-i)/(p.x-i)),p.y>s&&(h=(this.y+this.height-s)/(p.y-s));const b=r.topRight;b.x>i&&(l=(this.x+this.width-i)/(b.x-i)),b.y<s&&(f=(this.y-s)/(b.y-s));const m=r.bottomLeft;return m.x<i&&(c=(this.x-i)/(m.x-i)),m.y>s&&(d=(this.y+this.height-s)/(m.y-s)),{sx:Math.min(o,a,l,c),sy:Math.min(u,h,f,d)}}getMaxUniformScaleToFit(e,t=this.center){const r=this.getMaxScaleToFit(e,t);return Math.min(r.sx,r.sy)}containsPoint(e,t){return we.containsPoint(this,P.create(e,t))}containsRect(e,t,r,i){const s=D.create(e,t,r,i),o=this.x,a=this.y,l=this.width,c=this.height,u=s.x,h=s.y,f=s.width,d=s.height;return l===0||c===0||f===0||d===0?!1:u>=o&&h>=a&&u+f<=o+l&&h+d<=a+c}intersectsWithLine(e){const t=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],r=[],i=[];return t.forEach(s=>{const o=e.intersectsWithLine(s);o!==null&&i.indexOf(o.toString())<0&&(r.push(o),i.push(o.toString()))}),r.length>0?r:null}intersectsWithLineFromCenterToPoint(e,t){const r=P.clone(e),i=this.center;let s=null;t!=null&&t!==0&&r.rotate(t,i);const o=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new F(i,r);for(let l=o.length-1;l>=0;l-=1){const c=o[l].intersectsWithLine(a);if(c!==null){s=c;break}}return s&&t!=null&&t!==0&&s.rotate(-t,i),s}intersectsWithRect(e,t,r,i){const s=D.create(e,t,r,i);if(!this.isIntersectWithRect(s))return null;const o=this.origin,a=this.corner,l=s.origin,c=s.corner,u=Math.max(o.x,l.x),h=Math.max(o.y,l.y);return new D(u,h,Math.min(a.x,c.x)-u,Math.min(a.y,c.y)-h)}isIntersectWithRect(e,t,r,i){const s=D.create(e,t,r,i),o=this.origin,a=this.corner,l=s.origin,c=s.corner;return!(c.x<=o.x||c.y<=o.y||l.x>=a.x||l.y>=a.y)}normalize(){let e=this.x,t=this.y,r=this.width,i=this.height;return this.width<0&&(e=this.x+this.width,r=-this.width),this.height<0&&(t=this.y+this.height,i=-this.height),this.x=e,this.y=t,this.width=r,this.height=i,this}union(e){const t=D.clone(e),r=this.origin,i=this.corner,s=t.origin,o=t.corner,a=Math.min(r.x,s.x),l=Math.min(r.y,s.y),c=Math.max(i.x,o.x),u=Math.max(i.y,o.y);return new D(a,l,c-a,u-l)}getNearestSideToPoint(e){const t=P.clone(e),r=t.x-this.x,i=this.x+this.width-t.x,s=t.y-this.y,o=this.y+this.height-t.y;let a=r,l="left";return i<a&&(a=i,l="right"),s<a&&(a=s,l="top"),o<a&&(l="bottom"),l}getNearestPointToPoint(e){const t=P.clone(e);if(this.containsPoint(t)){const r=this.getNearestSideToPoint(t);if(r==="left")return new P(this.x,t.y);if(r==="top")return new P(t.x,this.y);if(r==="right")return new P(this.x+this.width,t.y);if(r==="bottom")return new P(t.x,this.y+this.height)}return t.adhereToRect(this)}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}clone(){return new D(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isRectangle=e})(D||(D={})),function(n){function e(t){return t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number"&&typeof t.width=="number"&&typeof t.height=="number"}n.isRectangleLike=e}(D||(D={})),function(n){function e(o,a,l,c){return o==null||typeof o=="number"?new n(o,a,l,c):t(o)}n.create=e;function t(o){return n.isRectangle(o)?o.clone():Array.isArray(o)?new n(o[0],o[1],o[2],o[3]):new n(o.x,o.y,o.width,o.height)}n.clone=t;function r(o){return new n(o.x-o.a,o.y-o.b,2*o.a,2*o.b)}n.fromEllipse=r;function i(o){return new n(0,0,o.width,o.height)}n.fromSize=i;function s(o,a){return new n(o.x,o.y,a.width,a.height)}n.fromPositionAndSize=s}(D||(D={}));class F extends Tr{get center(){return new P((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(e,t,r,i){super(),typeof e=="number"&&typeof t=="number"?(this.start=new P(e,t),this.end=new P(r,i)):(this.start=P.create(e),this.end=P.create(t))}getCenter(){return this.center}round(e=0){return this.start.round(e),this.end.round(e),this}translate(e,t){return typeof e=="number"?(this.start.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.end.translate(e)),this}rotate(e,t){return this.start.rotate(e,t),this.end.rotate(e,t),this}scale(e,t,r){return this.start.scale(e,t,r),this.end.scale(e,t,r),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const e=this.start.x-this.end.x,t=this.start.y-this.end.y;return e*e+t*t}setLength(e){const t=this.length();if(!t)return this;const r=e/t;return this.scale(r,r,this.start)}parallel(e){const t=this.clone();if(!t.isDifferentiable())return t;const{start:r,end:i}=t,s=r.clone().rotate(270,i),o=i.clone().rotate(90,r);return r.move(o,e),i.move(s,e),t}vector(){return new P(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const e=new P(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,e)}bbox(){const e=Math.min(this.start.x,this.end.x),t=Math.min(this.start.y,this.end.y),r=Math.max(this.start.x,this.end.x),i=Math.max(this.start.y,this.end.y);return new D(e,t,r-e,i-t)}bearing(){return this.start.bearing(this.end)}closestPoint(e){return this.pointAt(this.closestPointNormalizedLength(e))}closestPointLength(e){return this.closestPointNormalizedLength(e)*this.length()}closestPointTangent(e){return this.tangentAt(this.closestPointNormalizedLength(e))}closestPointNormalizedLength(e){const t=this.vector().dot(new F(this.start,e).vector()),r=Math.min(1,Math.max(0,t/this.squaredLength()));return Number.isNaN(r)?0:r}pointAt(e){const t=this.start,r=this.end;return e<=0?t.clone():e>=1?r.clone():t.lerp(r,e)}pointAtLength(e){const t=this.start,r=this.end;let i=!0;e<0&&(i=!1,e=-e);const s=this.length();if(e>=s)return i?r.clone():t.clone();const o=(i?e:s-e)/s;return this.pointAt(o)}divideAt(e){const t=this.pointAt(e);return[new F(this.start,t),new F(t,this.end)]}divideAtLength(e){const t=this.pointAtLength(e);return[new F(this.start,t),new F(t,this.end)]}containsPoint(e){const t=this.start,r=this.end;if(t.cross(e,r)!==0)return!1;const i=this.length();return!(new F(t,e).length()>i||new F(e,r).length()>i)}intersect(e,t){const r=e.intersectsWithLine(this,t);return r?Array.isArray(r)?r:[r]:null}intersectsWithLine(e){const t=new P(this.end.x-this.start.x,this.end.y-this.start.y),r=new P(e.end.x-e.start.x,e.end.y-e.start.y),i=t.x*r.y-t.y*r.x,s=new P(e.start.x-this.start.x,e.start.y-this.start.y),o=s.x*r.y-s.y*r.x,a=s.x*t.y-s.y*t.x;if(i===0||o*i<0||a*i<0)return null;if(i>0){if(o>i||a>i)return null}else if(o<i||a<i)return null;return new P(this.start.x+o*t.x/i,this.start.y+o*t.y/i)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(e){const t=P.clone(e),r=this.start,i=this.end;return((i.x-r.x)*(t.y-r.y)-(i.y-r.y)*(t.x-r.x))/this.length()}pointSquaredDistance(e,t){const r=P.create(e,t);return this.closestPoint(r).squaredDistance(r)}pointDistance(e,t){const r=P.create(e,t);return this.closestPoint(r).distance(r)}tangentAt(e){if(!this.isDifferentiable())return null;const t=this.start,r=this.end,i=this.pointAt(e),s=new F(t,r);return s.translate(i.x-t.x,i.y-t.y),s}tangentAtLength(e){if(!this.isDifferentiable())return null;const t=this.start,r=this.end,i=this.pointAtLength(e),s=new F(t,r);return s.translate(i.x-t.x,i.y-t.y),s}relativeCcw(e,t){const r=P.create(e,t);let i=r.x-this.start.x,s=r.y-this.start.y;const o=this.end.x-this.start.x,a=this.end.y-this.start.y;let l=i*a-s*o;return l===0&&(l=i*o+s*a,l>0&&(i-=o,s-=a,l=i*o+s*a,l<0&&(l=0))),l<0?-1:l>0?1:0}equals(e){return e!=null&&this.start.x===e.start.x&&this.start.y===e.start.y&&this.end.x===e.end.x&&this.end.y===e.end.y}clone(){return new F(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isLine=e})(F||(F={}));class wn extends Tr{get center(){return new P(this.x,this.y)}constructor(e,t,r,i){super(),this.x=e==null?0:e,this.y=t==null?0:t,this.a=r==null?0:r,this.b=i==null?0:i}bbox(){return D.fromEllipse(this)}getCenter(){return this.center}inflate(e,t){const r=e,i=t!=null?t:e;return this.a+=2*r,this.b+=2*i,this}normalizedDistance(e,t){const r=P.create(e,t),i=r.x-this.x,s=r.y-this.y,o=this.a,a=this.b;return i*i/(o*o)+s*s/(a*a)}containsPoint(e,t){return this.normalizedDistance(e,t)<=1}intersectsWithLine(e){const t=[],r=this.a,i=this.b,s=e.start,o=e.end,a=e.vector(),l=s.diff(new P(this.x,this.y)),c=new P(a.x/(r*r),a.y/(i*i)),u=new P(l.x/(r*r),l.y/(i*i)),h=a.dot(c),f=a.dot(u),d=l.dot(u)-1,g=f*f-h*d;if(g<0)return null;if(g>0){const p=Math.sqrt(g),b=(-f-p)/h,m=(-f+p)/h;if((b<0||b>1)&&(m<0||m>1))return null;b>=0&&b<=1&&t.push(s.lerp(o,b)),m>=0&&m<=1&&t.push(s.lerp(o,m))}else{const p=-f/h;if(p>=0&&p<=1)t.push(s.lerp(o,p));else return null}return t}intersectsWithLineFromCenterToPoint(e,t=0){const r=P.clone(e);t&&r.rotate(t,this.getCenter());const i=r.x-this.x,s=r.y-this.y;let o;if(i===0)return o=this.bbox().getNearestPointToPoint(r),t?o.rotate(-t,this.getCenter()):o;const a=s/i,l=a*a,c=this.a*this.a,u=this.b*this.b;let h=Math.sqrt(1/(1/c+l/u));h=i<0?-h:h;const f=a*h;return o=new P(this.x+h,this.y+f),t?o.rotate(-t,this.getCenter()):o}tangentTheta(e){const t=P.clone(e),r=t.x,i=t.y,s=this.a,o=this.b,a=this.bbox().center,l=a.x,c=a.y,u=30,h=r>a.x+s/2,f=r<a.x-s/2;let d,g;return h||f?(g=r>a.x?i-u:i+u,d=s*s/(r-l)-s*s*(i-c)*(g-c)/(o*o*(r-l))+l):(d=i>a.y?r+u:r-u,g=o*o/(i-c)-o*o*(r-l)*(d-l)/(s*s*(i-c))+c),new P(d,g).theta(t)}scale(e,t){return this.a*=e,this.b*=t,this}rotate(e,t){const r=D.fromEllipse(this);r.rotate(e,t);const i=wn.fromRect(r);return this.a=i.a,this.b=i.b,this.x=i.x,this.y=i.y,this}translate(e,t){const r=P.create(e,t);return this.x+=r.x,this.y+=r.y,this}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.a===this.a&&e.b===this.b}clone(){return new wn(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isEllipse=e})(wn||(wn={})),function(n){function e(i,s,o,a){return i==null||typeof i=="number"?new n(i,s,o,a):t(i)}n.create=e;function t(i){return n.isEllipse(i)?i.clone():Array.isArray(i)?new n(i[0],i[1],i[2],i[3]):new n(i.x,i.y,i.a,i.b)}n.parse=t;function r(i){const s=i.center;return new n(s.x,s.y,i.width/2,i.height/2)}n.fromRect=r}(wn||(wn={}));const n6=new RegExp("^[\\s\\dLMCZz,.]*$");function r6(n){return typeof n!="string"?!1:n6.test(n)}function sf(n,e){return(n%e+e)%e}function i6(n,e,t,r,i){const s=[],o=n[n.length-1],a=e!=null&&e>0,l=e||0;if(r&&a){n=n.slice();const h=n[0],f=new P(o.x+(h.x-o.x)/2,o.y+(h.y-o.y)/2);n.splice(0,0,f)}let c=n[0],u=1;for(t?s.push("M",c.x,c.y):s.push("L",c.x,c.y);u<(r?n.length:n.length-1);){let h=n[sf(u,n.length)],f=c.x-h.x,d=c.y-h.y;if(a&&(f!==0||d!==0)&&(i==null||i.indexOf(u-1)<0)){let g=Math.sqrt(f*f+d*d);const p=f*Math.min(l,g/2)/g,b=d*Math.min(l,g/2)/g,m=h.x+p,y=h.y+b;s.push("L",m,y);let v=n[sf(u+1,n.length)];for(;u<n.length-2&&Math.round(v.x-h.x)===0&&Math.round(v.y-h.y)===0;)v=n[sf(u+2,n.length)],u+=1;f=v.x-h.x,d=v.y-h.y,g=Math.max(1,Math.sqrt(f*f+d*d));const w=f*Math.min(l,g/2)/g,x=d*Math.min(l,g/2)/g,C=h.x+w,S=h.y+x;s.push("Q",h.x,h.y,C,S),h=new P(C,S)}else s.push("L",h.x,h.y);c=h,u+=1}return r?s.push("Z"):s.push("L",o.x,o.y),s.map(h=>typeof h=="string"?h:+h.toFixed(3)).join(" ")}function L1(n,e={}){const t=[];return n&&n.length&&n.forEach(r=>{Array.isArray(r)?t.push({x:r[0],y:r[1]}):t.push({x:r.x,y:r.y})}),i6(t,e.round,e.initialMove==null||e.initialMove,e.close,e.exclude)}function ql(n,e,t,r,i=0,s=0,o=0,a,l){if(t===0||r===0)return[];a-=n,l-=e,t=Math.abs(t),r=Math.abs(r);const c=-a/2,u=-l/2,h=Math.cos(i*Math.PI/180),f=Math.sin(i*Math.PI/180),d=h*c+f*u,g=-1*f*c+h*u,p=d*d,b=g*g,m=t*t,y=r*r,v=p/m+b/y;let w;if(v>1)t=Math.sqrt(v)*t,r=Math.sqrt(v)*r,w=0;else{let At=1;s===o&&(At=-1),w=At*Math.sqrt((m*y-m*b-y*p)/(m*b+y*p))}const x=w*t*g/r,C=-1*w*r*d/t,S=h*x-f*C+a/2,E=f*x+h*C+l/2;let A=Math.atan2((g-C)/r,(d-x)/t)-Math.atan2(0,1),O=A>=0?A:2*Math.PI+A;A=Math.atan2((-g-C)/r,(-d-x)/t)-Math.atan2((g-C)/r,(d-x)/t);let T=A>=0?A:2*Math.PI+A;o===0&&T>0?T-=2*Math.PI:o!==0&&T<0&&(T+=2*Math.PI);const I=T*2/Math.PI,G=Math.ceil(I<0?-1*I:I),X=T/G,M=8/3*Math.sin(X/4)*Math.sin(X/4)/Math.sin(X/2),k=h*t,Q=h*r,R=f*t,z=f*r;let H=Math.cos(O),te=Math.sin(O),xe=-M*(k*te+z*H),Kt=-M*(R*te-Q*H),Ye=0,gn=0;const Ke=[];for(let At=0;At<G;At+=1){O+=X,H=Math.cos(O),te=Math.sin(O),Ye=k*H-z*te+S,gn=R*H+Q*te+E;const Fu=-M*(k*te+z*H),Vu=-M*(R*te-Q*H),ci=At*6;Ke[ci]=Number(xe+n),Ke[ci+1]=Number(Kt+e),Ke[ci+2]=Number(Ye-Fu+n),Ke[ci+3]=Number(gn-Vu+e),Ke[ci+4]=Number(Ye+n),Ke[ci+5]=Number(gn+e),xe=Ye+Fu,Kt=gn+Vu}return Ke.map(At=>+At.toFixed(2))}function s6(n,e,t,r,i=0,s=0,o=0,a,l){const c=[],u=ql(n,e,t,r,i,s,o,a,l);if(u!=null)for(let h=0,f=u.length;h<f;h+=6)c.push("C",u[h],u[h+1],u[h+2],u[h+3],u[h+4],u[h+5]);return c.join(" ")}class He extends Tr{get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(e){if(super(),e!=null){if(typeof e=="string")return He.parse(e);this.points=e.map(t=>P.create(t))}else this.points=[]}scale(e,t,r=new P){return this.points.forEach(i=>i.scale(e,t,r)),this}rotate(e,t){return this.points.forEach(r=>r.rotate(e,t)),this}translate(e,t){const r=P.create(e,t);return this.points.forEach(i=>i.translate(r.x,r.y)),this}round(e=0){return this.points.forEach(t=>t.round(e)),this}bbox(){if(this.points.length===0)return new D;let e=1/0,t=-1/0,r=1/0,i=-1/0;const s=this.points;for(let o=0,a=s.length;o<a;o+=1){const l=s[o],c=l.x,u=l.y;c<e&&(e=c),c>t&&(t=c),u<r&&(r=u),u>i&&(i=u)}return new D(e,r,t-e,i-r)}closestPoint(e){const t=this.closestPointLength(e);return this.pointAtLength(t)}closestPointLength(e){const t=this.points,r=t.length;if(r===0||r===1)return 0;let i=0,s=0,o=1/0;for(let a=0,l=r-1;a<l;a+=1){const c=new F(t[a],t[a+1]),u=c.length(),h=c.closestPointNormalizedLength(e),d=c.pointAt(h).squaredDistance(e);d<o&&(o=d,s=i+h*u),i+=u}return s}closestPointNormalizedLength(e){const t=this.length();return t===0?0:this.closestPointLength(e)/t}closestPointTangent(e){const t=this.closestPointLength(e);return this.tangentAtLength(t)}containsPoint(e){if(this.points.length===0)return!1;const t=P.clone(e),r=t.x,i=t.y,s=this.points,o=s.length;let a=o-1,l=0;for(let c=0;c<o;c+=1){const u=s[a],h=s[c];if(t.equals(u))return!0;const f=new F(u,h);if(f.containsPoint(e))return!0;if(i<=u.y&&i>h.y||i>u.y&&i<=h.y){const d=u.x-r>h.x-r?u.x-r:h.x-r;if(d>=0){const g=new P(r+d,i),p=new F(e,g);f.intersectsWithLine(p)&&(l+=1)}}a=c}return l%2===1}intersectsWithLine(e){const t=[];for(let r=0,i=this.points.length-1;r<i;r+=1){const s=this.points[r],o=this.points[r+1],a=e.intersectsWithLine(new F(s,o));a&&t.push(a)}return t.length>0?t:null}isDifferentiable(){for(let e=0,t=this.points.length-1;e<t;e+=1){const r=this.points[e],i=this.points[e+1];if(new F(r,i).isDifferentiable())return!0}return!1}length(){let e=0;for(let t=0,r=this.points.length-1;t<r;t+=1){const i=this.points[t],s=this.points[t+1];e+=i.distance(s)}return e}pointAt(e){const t=this.points,r=t.length;if(r===0)return null;if(r===1||e<=0)return t[0].clone();if(e>=1)return t[r-1].clone();const s=this.length()*e;return this.pointAtLength(s)}pointAtLength(e){const t=this.points,r=t.length;if(r===0)return null;if(r===1)return t[0].clone();let i=!0;e<0&&(i=!1,e=-e);let s=0;for(let a=0,l=r-1;a<l;a+=1){const c=i?a:l-1-a,u=t[c],h=t[c+1],f=new F(u,h),d=u.distance(h);if(e<=s+d)return f.pointAtLength((i?1:-1)*(e-s));s+=d}return(i?t[r-1]:t[0]).clone()}tangentAt(e){const r=this.points.length;if(r===0||r===1)return null;e<0&&(e=0),e>1&&(e=1);const s=this.length()*e;return this.tangentAtLength(s)}tangentAtLength(e){const t=this.points,r=t.length;if(r===0||r===1)return null;let i=!0;e<0&&(i=!1,e=-e);let s,o=0;for(let a=0,l=r-1;a<l;a+=1){const c=i?a:l-1-a,u=t[c],h=t[c+1],f=new F(u,h),d=u.distance(h);if(f.isDifferentiable()){if(e<=o+d)return f.tangentAtLength((i?1:-1)*(e-o));s=f}o+=d}if(s){const a=i?1:0;return s.tangentAt(a)}return null}simplify(e={}){const t=this.points;if(t.length<3)return this;const r=e.threshold||0;let i=0;for(;t[i+2];){const s=i,o=i+1,a=i+2,l=t[s],c=t[o],u=t[a];new F(l,u).closestPoint(c).distance(c)<=r?t.splice(o,1):i+=1}return this}toHull(){const e=this.points,t=e.length;if(t===0)return new He;let r=e[0];for(let f=1;f<t;f+=1)(e[f].y<r.y||e[f].y===r.y&&e[f].x>r.x)&&(r=e[f]);const i=[];for(let f=0;f<t;f+=1){let d=r.theta(e[f]);d===0&&(d=360),i.push([e[f],f,d])}if(i.sort((f,d)=>{let g=f[2]-d[2];return g===0&&(g=d[1]-f[1]),g}),i.length>2){const f=i[i.length-1];i.unshift(f)}const s={},o=[],a=f=>`${f[0].toString()}@${f[1]}`;for(;i.length!==0;){const f=i.pop(),d=f[0];if(s[a(f)])continue;let g=!1;for(;!g;)if(o.length<2)o.push(f),g=!0;else{const p=o.pop(),b=p[0],m=o.pop(),y=m[0],v=y.cross(b,d);if(v<0)o.push(m),o.push(p),o.push(f),g=!0;else if(v===0){const x=b.angleBetween(y,d);Math.abs(x-180)<1e-10||b.equals(d)||y.equals(b)?(s[a(p)]=b,o.push(m)):Math.abs((x+1)%360-1)<1e-10&&(o.push(m),i.push(p))}else s[a(p)]=b,o.push(m)}}o.length>2&&o.pop();let l,c=-1;for(let f=0,d=o.length;f<d;f+=1){const g=o[f][1];(l===void 0||g<l)&&(l=g,c=f)}let u=[];if(c>0){const f=o.slice(c),d=o.slice(0,c);u=f.concat(d)}else u=o;const h=[];for(let f=0,d=u.length;f<d;f+=1)h.push(u[f][0]);return new He(h)}equals(e){return e==null||e.points.length!==this.points.length?!1:e.points.every((t,r)=>t.equals(this.points[r]))}clone(){return new He(this.points.map(e=>e.clone()))}toJSON(){return this.points.map(e=>e.toJSON())}serialize(){return this.points.map(e=>`${e.serialize()}`).join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPolyline=e})(He||(He={})),function(n){function e(t){const r=t.trim();if(r==="")return new n;const i=[],s=r.split(/\s*,\s*|\s+/);for(let o=0,a=s.length;o<a;o+=2)i.push({x:+s[o],y:+s[o+1]});return new n(i)}n.parse=e}(He||(He={}));class Fe extends Tr{constructor(e,t,r,i){super(),this.PRECISION=3,this.start=P.create(e),this.controlPoint1=P.create(t),this.controlPoint2=P.create(r),this.end=P.create(i)}bbox(){const e=this.start,t=this.controlPoint1,r=this.controlPoint2,i=this.end,s=e.x,o=e.y,a=t.x,l=t.y,c=r.x,u=r.y,h=i.x,f=i.y,d=[],g=[[],[]];let p,b,m,y,v,w,x,C;for(let k=0;k<2;k+=1){if(k===0?(b=6*s-12*a+6*c,p=-3*s+9*a-9*c+3*h,m=3*a-3*s):(b=6*o-12*l+6*u,p=-3*o+9*l-9*u+3*f,m=3*l-3*o),Math.abs(p)<1e-12){if(Math.abs(b)<1e-12)continue;y=-m/b,y>0&&y<1&&d.push(y);continue}x=b*b-4*m*p,C=Math.sqrt(x),!(x<0)&&(v=(-b+C)/(2*p),v>0&&v<1&&d.push(v),w=(-b-C)/(2*p),w>0&&w<1&&d.push(w))}let S,E,A,O=d.length;const T=O;for(;O;)O-=1,y=d[O],A=1-y,S=A*A*A*s+3*A*A*y*a+3*A*y*y*c+y*y*y*h,g[0][O]=S,E=A*A*A*o+3*A*A*y*l+3*A*y*y*u+y*y*y*f,g[1][O]=E;d[T]=0,d[T+1]=1,g[0][T]=s,g[1][T]=o,g[0][T+1]=h,g[1][T+1]=f,d.length=T+2,g[0].length=T+2,g[1].length=T+2;const I=Math.min.apply(null,g[0]),G=Math.min.apply(null,g[1]),X=Math.max.apply(null,g[0]),M=Math.max.apply(null,g[1]);return new D(I,G,X-I,M-G)}closestPoint(e,t={}){return this.pointAtT(this.closestPointT(e,t))}closestPointLength(e,t={}){const r=this.getOptions(t);return this.lengthAtT(this.closestPointT(e,r),r)}closestPointNormalizedLength(e,t={}){const r=this.getOptions(t),i=this.closestPointLength(e,r);if(!i)return 0;const s=this.length(r);return s===0?0:i/s}closestPointT(e,t={}){const r=this.getPrecision(t),i=this.getDivisions(t),s=Math.pow(10,-r);let o=null,a=0,l=0,c=0,u=0,h=0,f=null;const d=i.length;let g=d>0?1/d:0;for(i.forEach((p,b)=>{const m=p.start.distance(e),y=p.end.distance(e),v=m+y;(f==null||v<f)&&(o=p,a=b*g,l=(b+1)*g,c=m,u=y,f=v,h=p.endpointDistance())});;){const p=c?Math.abs(c-u)/c:0,b=u!=null?Math.abs(c-u)/u:0,m=p<s||b<s,y=c?c<h*s:!0,v=u?u<h*s:!0;if(m||(y||v))return c<=u?a:l;const x=o.divide(.5);g/=2;const C=x[0].start.distance(e),S=x[0].end.distance(e),E=C+S,A=x[1].start.distance(e),O=x[1].end.distance(e),T=A+O;E<=T?(o=x[0],l-=g,c=C,u=S):(o=x[1],a+=g,c=A,u=O)}}closestPointTangent(e,t={}){return this.tangentAtT(this.closestPointT(e,t))}containsPoint(e,t={}){return this.toPolyline(t).containsPoint(e)}divideAt(e,t={}){if(e<=0)return this.divideAtT(0);if(e>=1)return this.divideAtT(1);const r=this.tAt(e,t);return this.divideAtT(r)}divideAtLength(e,t={}){const r=this.tAtLength(e,t);return this.divideAtT(r)}divide(e){return this.divideAtT(e)}divideAtT(e){const t=this.start,r=this.controlPoint1,i=this.controlPoint2,s=this.end;if(e<=0)return[new Fe(t,t,t,t),new Fe(t,r,i,s)];if(e>=1)return[new Fe(t,r,i,s),new Fe(s,s,s,s)];const o=this.getSkeletonPoints(e),a=o.startControlPoint1,l=o.startControlPoint2,c=o.divider,u=o.dividerControlPoint1,h=o.dividerControlPoint2;return[new Fe(t,a,l,c),new Fe(c,u,h,s)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(e){const t=this.start,r=this.controlPoint1,i=this.controlPoint2,s=this.end;if(e<=0)return{startControlPoint1:t.clone(),startControlPoint2:t.clone(),divider:t.clone(),dividerControlPoint1:r.clone(),dividerControlPoint2:i.clone()};if(e>=1)return{startControlPoint1:r.clone(),startControlPoint2:i.clone(),divider:s.clone(),dividerControlPoint1:s.clone(),dividerControlPoint2:s.clone()};const o=new F(t,r).pointAt(e),a=new F(r,i).pointAt(e),l=new F(i,s).pointAt(e),c=new F(o,a).pointAt(e),u=new F(a,l).pointAt(e),h=new F(c,u).pointAt(e);return{startControlPoint1:o,startControlPoint2:c,divider:h,dividerControlPoint1:u,dividerControlPoint2:l}}getSubdivisions(e={}){const t=this.getPrecision(e);let r=[new Fe(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(t===0)return r;let i=this.endpointDistance();const s=Math.pow(10,-t);let o=0;for(;;){o+=1;const a=[];r.forEach(u=>{const h=u.divide(.5);a.push(h[0],h[1])});const l=a.reduce((u,h)=>u+h.endpointDistance(),0),c=l!==0?(l-i)/l:0;if(o>1&&c<s)return a;r=a,i=l}}length(e={}){return this.getDivisions(e).reduce((r,i)=>r+i.endpointDistance(),0)}lengthAtT(e,t={}){if(e<=0)return 0;const r=t.precision===void 0?this.PRECISION:t.precision;return this.divide(e)[0].length({precision:r})}pointAt(e,t={}){if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const r=this.tAt(e,t);return this.pointAtT(r)}pointAtLength(e,t={}){const r=this.tAtLength(e,t);return this.pointAtT(r)}pointAtT(e){return e<=0?this.start.clone():e>=1?this.end.clone():this.getSkeletonPoints(e).divider}isDifferentiable(){const e=this.start,t=this.controlPoint1,r=this.controlPoint2,i=this.end;return!(e.equals(t)&&t.equals(r)&&r.equals(i))}tangentAt(e,t={}){if(!this.isDifferentiable())return null;e<0?e=0:e>1&&(e=1);const r=this.tAt(e,t);return this.tangentAtT(r)}tangentAtLength(e,t={}){if(!this.isDifferentiable())return null;const r=this.tAtLength(e,t);return this.tangentAtT(r)}tangentAtT(e){if(!this.isDifferentiable())return null;e<0&&(e=0),e>1&&(e=1);const t=this.getSkeletonPoints(e),r=t.startControlPoint2,i=t.dividerControlPoint1,s=t.divider,o=new F(r,i);return o.translate(s.x-r.x,s.y-r.y),o}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getDivisions(e={}){if(e.subdivisions!=null)return e.subdivisions;const t=this.getPrecision(e);return this.getSubdivisions({precision:t})}getOptions(e={}){const t=this.getPrecision(e),r=this.getDivisions(e);return{precision:t,subdivisions:r}}tAt(e,t={}){if(e<=0)return 0;if(e>=1)return 1;const r=this.getOptions(t),s=this.length(r)*e;return this.tAtLength(s,r)}tAtLength(e,t={}){let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),s=this.getDivisions(t),o={precision:i,subdivisions:s};let a=null,l,c,u=0,h=0,f=0;const d=s.length;let g=d>0?1/d:0;for(let m=0;m<d;m+=1){const y=r?m:d-1-m,v=s[m],w=v.endpointDistance();if(e<=f+w){a=v,l=y*g,c=(y+1)*g,u=r?e-f:w+f-e,h=r?w+f-e:e-f;break}f+=w}if(a==null)return r?1:0;const p=this.length(o),b=Math.pow(10,-i);for(;;){let m;if(m=p!==0?u/p:0,m<b)return l;if(m=p!==0?h/p:0,m<b)return c;let y,v;const w=a.divide(.5);g/=2;const x=w[0].endpointDistance(),C=w[1].endpointDistance();u<=x?(a=w[0],c-=g,y=u,v=x-y):(a=w[1],l+=g,y=u-x,v=C-y),u=y,h=v}}toPoints(e={}){const t=this.getDivisions(e),r=[t[0].start.clone()];return t.forEach(i=>r.push(i.end.clone())),r}toPolyline(e={}){return new He(this.toPoints(e))}scale(e,t,r){return this.start.scale(e,t,r),this.controlPoint1.scale(e,t,r),this.controlPoint2.scale(e,t,r),this.end.scale(e,t,r),this}rotate(e,t){return this.start.rotate(e,t),this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?(this.start.translate(e,t),this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return e!=null&&this.start.equals(e.start)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)&&this.end.equals(e.end)}clone(){return new Fe(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isCurve=e})(Fe||(Fe={})),function(n){function e(i){const s=i.length,o=[],a=[];let l=2;o[0]=i[0]/l;for(let c=1;c<s;c+=1)a[c]=1/l,l=(c<s-1?4:3.5)-a[c],o[c]=(i[c]-o[c-1])/l;for(let c=1;c<s;c+=1)o[s-c-1]-=a[s-c]*o[s-c];return o}function t(i){const s=i.map(f=>P.clone(f)),o=[],a=[],l=s.length-1;if(l===1)return o[0]=new P((2*s[0].x+s[1].x)/3,(2*s[0].y+s[1].y)/3),a[0]=new P(2*o[0].x-s[0].x,2*o[0].y-s[0].y),[o,a];const c=[];for(let f=1;f<l-1;f+=1)c[f]=4*s[f].x+2*s[f+1].x;c[0]=s[0].x+2*s[1].x,c[l-1]=(8*s[l-1].x+s[l].x)/2;const u=e(c);for(let f=1;f<l-1;f+=1)c[f]=4*s[f].y+2*s[f+1].y;c[0]=s[0].y+2*s[1].y,c[l-1]=(8*s[l-1].y+s[l].y)/2;const h=e(c);for(let f=0;f<l;f+=1)o.push(new P(u[f],h[f])),f<l-1?a.push(new P(2*s[f+1].x-u[f+1],2*s[f+1].y-h[f+1])):a.push(new P((s[l].x+u[l-1])/2,(s[l].y+h[l-1])/2));return[o,a]}function r(i){if(i==null||Array.isArray(i)&&i.length<2)throw new Error("At least 2 points are required");const s=t(i),o=[];for(let a=0,l=s[0].length;a<l;a+=1){const c=new P(s[0][a].x,s[0][a].y),u=new P(s[1][a].x,s[1][a].y);o.push(new n(i[a],c,u,i[a+1]))}return o}n.throughPoints=r}(Fe||(Fe={}));class Gl extends Tr{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(this.previousSegment==null)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(e,t){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(e);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(e,t){if(e<=0)return 0;const r=this.length();return e>=1?r:r*e}divideAtT(e){if(this.divideAt)return this.divideAt(e);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(e){if(this.pointAt)return this.pointAt(e);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(e){if(this.tangentAt)return this.tangentAt(e);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class xt extends Gl{constructor(e,t){super(),F.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=P.create(e,t).round(2)}get type(){return"L"}get line(){return new F(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const t=this.line.divideAt(e);return[new xt(t[0]),new xt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[new xt(t[0]),new xt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new xt(this.end)}scale(e,t,r){return this.end.scale(e,t,r),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?this.end.translate(e,t):this.end.translate(e),this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}(function(n){function e(...t){const r=t.length,i=t[0];if(F.isLine(i))return new n(i);if(P.isPointLike(i))return r===1?new n(i):t.map(o=>new n(o));if(r===2)return new n(+t[0],+t[1]);const s=[];for(let o=0;o<r;o+=2){const a=+t[o],l=+t[o+1];s.push(new n(a,l))}return s}n.create=e})(xt||(xt={}));class vs extends Gl{get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new F(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const t=this.line.divideAt(e);return[t[1].isDifferentiable()?new xt(t[0]):this.clone(),new xt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[t[1].isDifferentiable()?new xt(t[0]):this.clone(),new xt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}clone(){return new vs}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}(function(n){function e(){return new n}n.create=e})(vs||(vs={}));class bs extends Gl{constructor(e,t){super(),this.isVisible=!1,this.isSubpathStart=!0,F.isLine(e)||Fe.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=P.create(e,t).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(e,t,r){return this.end.scale(e,t,r),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?this.end.translate(e,t):this.end.translate(e),this}clone(){return new bs(this.end)}equals(e){return this.type===e.type&&this.end.equals(e.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}(function(n){function e(...t){const r=t.length,i=t[0];if(F.isLine(i))return new n(i);if(Fe.isCurve(i))return new n(i);if(P.isPointLike(i)){if(r===1)return new n(i);const o=[];for(let a=0;a<r;a+=1)a===0?o.push(new n(t[a])):o.push(new xt(t[a]));return o}if(r===2)return new n(+t[0],+t[1]);const s=[];for(let o=0;o<r;o+=2){const a=+t[o],l=+t[o+1];o===0?s.push(new n(a,l)):s.push(new xt(a,l))}return s}n.create=e})(bs||(bs={}));class rn extends Gl{constructor(e,t,r,i,s,o){super(),Fe.isCurve(e)?(this.controlPoint1=e.controlPoint1.clone().round(2),this.controlPoint2=e.controlPoint2.clone().round(2),this.endPoint=e.end.clone().round(2)):typeof e=="number"?(this.controlPoint1=new P(e,t).round(2),this.controlPoint2=new P(r,i).round(2),this.endPoint=new P(s,o).round(2)):(this.controlPoint1=P.create(e).round(2),this.controlPoint2=P.create(t).round(2),this.endPoint=P.create(r).round(2))}get type(){return"C"}get curve(){return new Fe(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(e){return this.curve.closestPoint(e)}closestPointLength(e){return this.curve.closestPointLength(e)}closestPointNormalizedLength(e){return this.curve.closestPointNormalizedLength(e)}closestPointTangent(e){return this.curve.closestPointTangent(e)}length(){return this.curve.length()}divideAt(e,t={}){const r=this.curve.divideAt(e,t);return[new rn(r[0]),new rn(r[1])]}divideAtLength(e,t={}){const r=this.curve.divideAtLength(e,t);return[new rn(r[0]),new rn(r[1])]}divideAtT(e){const t=this.curve.divideAtT(e);return[new rn(t[0]),new rn(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.curve.pointAt(e)}pointAtLength(e){return this.curve.pointAtLength(e)}tangentAt(e){return this.curve.tangentAt(e)}tangentAtLength(e){return this.curve.tangentAtLength(e)}isDifferentiable(){if(!this.previousSegment)return!1;const e=this.start,t=this.controlPoint1,r=this.controlPoint2,i=this.end;return!(e.equals(t)&&t.equals(r)&&r.equals(i))}scale(e,t,r){return this.controlPoint1.scale(e,t,r),this.controlPoint2.scale(e,t,r),this.end.scale(e,t,r),this}rotate(e,t){return this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?(this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)}clone(){return new rn(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.controlPoint1,t=this.controlPoint2,r=this.end;return[this.type,e.x,e.y,t.x,t.y,r.x,r.y].join(" ")}}(function(n){function e(...t){const r=t.length,i=t[0];if(Fe.isCurve(i))return new n(i);if(P.isPointLike(i)){if(r===3)return new n(t[0],t[1],t[2]);const o=[];for(let a=0;a<r;a+=3)o.push(new n(t[a],t[a+1],t[a+2]));return o}if(r===6)return new n(t[0],t[1],t[2],t[3],t[4],t[5]);const s=[];for(let o=0;o<r;o+=6)s.push(new n(t[o],t[o+1],t[o+2],t[o+3],t[o+4],t[o+5]));return s}n.create=e})(rn||(rn={}));function Hl(n,e,t){return{x:n*Math.cos(t)-e*Math.sin(t),y:n*Math.sin(t)+e*Math.cos(t)}}function R1(n,e,t,r,i,s){const o=.3333333333333333,a=2/3;return[o*n+a*t,o*e+a*r,o*i+a*t,o*s+a*r,i,s]}function j1(n,e,t,r,i,s,o,a,l,c){const u=Math.PI*120/180,h=Math.PI/180*(+i||0);let f=[],d,g,p,b,m;if(c)g=c[0],p=c[1],b=c[2],m=c[3];else{d=Hl(n,e,-h),n=d.x,e=d.y,d=Hl(a,l,-h),a=d.x,l=d.y;const X=(n-a)/2,M=(e-l)/2;let k=X*X/(t*t)+M*M/(r*r);k>1&&(k=Math.sqrt(k),t=k*t,r=k*r);const Q=t*t,R=r*r,z=(s===o?-1:1)*Math.sqrt(Math.abs((Q*R-Q*M*M-R*X*X)/(Q*M*M+R*X*X)));b=z*t*M/r+(n+a)/2,m=z*-r*X/t+(e+l)/2,g=Math.asin((e-m)/r),p=Math.asin((l-m)/r),g=n<b?Math.PI-g:g,p=a<b?Math.PI-p:p,g<0&&(g=Math.PI*2+g),p<0&&(p=Math.PI*2+p),o&&g>p&&(g-=Math.PI*2),!o&&p>g&&(p-=Math.PI*2)}let y=p-g;if(Math.abs(y)>u){const X=p,M=a,k=l;p=g+u*(o&&p>g?1:-1),a=b+t*Math.cos(p),l=m+r*Math.sin(p),f=j1(a,l,t,r,i,0,o,M,k,[p,X,b,m])}y=p-g;const v=Math.cos(g),w=Math.sin(g),x=Math.cos(p),C=Math.sin(p),S=Math.tan(y/4),E=4/3*(t*S),A=4/3*(r*S),O=[n,e],T=[n+E*w,e-A*v],I=[a+E*C,l-A*x],G=[a,l];if(T[0]=2*O[0]-T[0],T[1]=2*O[1]-T[1],c)return[T,I,G].concat(f);{f=[T,I,G].concat(f).join().split(",");const X=[],M=f.length;for(let k=0;k<M;k+=1)X[k]=k%2?Hl(+f[k-1],+f[k],h).y:Hl(+f[k],+f[k+1],h).x;return X}}function o6(n){if(!n)return null;const e=`
4
+ \v\f\r   ᠎              \u2028\u2029`,t=new RegExp(`([a-z])[${e},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${e}]*,?[${e}]*)+)`,"ig"),r=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${e}]*,?[${e}]*`,"ig"),i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},s=[];return n.replace(t,(o,a,l)=>{const c=[];let u=a.toLowerCase();l.replace(r,(f,d)=>(d&&c.push(+d),f)),u==="m"&&c.length>2&&(s.push([a,...c.splice(0,2)]),u="l",a=a==="m"?"l":"L");const h=i[u];for(;c.length>=h&&(s.push([a,...c.splice(0,h)]),!!h););return o}),s}function a6(n){const e=o6(n);if(!e||!e.length)return[["M",0,0]];let t=0,r=0,i=0,s=0;const o=[];for(let a=0,l=e.length;a<l;a+=1){const c=[];o.push(c);const u=e[a],h=u[0];if(h!==h.toUpperCase())switch(c[0]=h.toUpperCase(),c[0]){case"A":c[1]=u[1],c[2]=u[2],c[3]=u[3],c[4]=u[4],c[5]=u[5],c[6]=+u[6]+t,c[7]=+u[7]+r;break;case"V":c[1]=+u[1]+r;break;case"H":c[1]=+u[1]+t;break;case"M":i=+u[1]+t,s=+u[2]+r;for(let f=1,d=u.length;f<d;f+=1)c[f]=+u[f]+(f%2?t:r);break;default:for(let f=1,d=u.length;f<d;f+=1)c[f]=+u[f]+(f%2?t:r);break}else for(let f=0,d=u.length;f<d;f+=1)c[f]=u[f];switch(c[0]){case"Z":t=+i,r=+s;break;case"H":t=c[1];break;case"V":r=c[1];break;case"M":i=c[c.length-2],s=c[c.length-1],t=c[c.length-2],r=c[c.length-1];break;default:t=c[c.length-2],r=c[c.length-1];break}}return o}function l6(n){const e=a6(n),t={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function r(l,c,u){let h,f;if(!l)return["C",c.x,c.y,c.x,c.y,c.x,c.y];switch(l[0]in{T:1,Q:1}||(c.qx=null,c.qy=null),l[0]){case"M":c.X=l[1],c.Y=l[2];break;case"A":return parseFloat(l[1])===0||parseFloat(l[2])===0?["L",l[6],l[7]]:["C"].concat(j1.apply(0,[c.x,c.y].concat(l.slice(1))));case"S":return u==="C"||u==="S"?(h=c.x*2-c.bx,f=c.y*2-c.by):(h=c.x,f=c.y),["C",h,f].concat(l.slice(1));case"T":return u==="Q"||u==="T"?(c.qx=c.x*2-c.qx,c.qy=c.y*2-c.qy):(c.qx=c.x,c.qy=c.y),["C"].concat(R1(c.x,c.y,c.qx,c.qy,l[1],l[2]));case"Q":return c.qx=l[1],c.qy=l[2],["C"].concat(R1(c.x,c.y,l[1],l[2],l[3],l[4]));case"H":return["L"].concat(l[1],c.y);case"V":return["L"].concat(c.x,l[1])}return l}function i(l,c){if(l[c].length>7){l[c].shift();const u=l[c];for(;u.length;)s[c]="A",c+=1,l.splice(c,0,["C"].concat(u.splice(0,6)));l.splice(c,1),a=e.length}}const s=[];let o="",a=e.length;for(let l=0;l<a;l+=1){let c="";e[l]&&(c=e[l][0]),c!=="C"&&(s[l]=c,l>0&&(o=s[l-1])),e[l]=r(e[l],t,o),s[l]!=="A"&&c==="C"&&(s[l]="C"),i(e,l);const u=e[l],h=u.length;t.x=u[h-2],t.y=u[h-1],t.bx=parseFloat(u[h-4])||t.x,t.by=parseFloat(u[h-3])||t.y}return(!e[0][0]||e[0][0]!=="M")&&e.unshift(["M",0,0]),e}function c6(n){return l6(n).map(e=>e.map(t=>typeof t=="string"?t:we.round(t,2))).join(",").split(",").join(" ")}class W extends Tr{constructor(e){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(e))if(F.isLine(e[0])||Fe.isCurve(e[0])){let t=null;e.forEach((i,s)=>{s===0&&this.appendSegment(W.createSegment("M",i.start)),t!=null&&!t.end.equals(i.start)&&this.appendSegment(W.createSegment("M",i.start)),F.isLine(i)?this.appendSegment(W.createSegment("L",i.end)):Fe.isCurve(i)&&this.appendSegment(W.createSegment("C",i.controlPoint1,i.controlPoint2,i.end)),t=i})}else e.forEach(r=>{r.isSegment&&this.appendSegment(r)});else e!=null&&(F.isLine(e)?(this.appendSegment(W.createSegment("M",e.start)),this.appendSegment(W.createSegment("L",e.end))):Fe.isCurve(e)?(this.appendSegment(W.createSegment("M",e.start)),this.appendSegment(W.createSegment("C",e.controlPoint1,e.controlPoint2,e.end))):He.isPolyline(e)?e.points&&e.points.length&&e.points.forEach((t,r)=>{const i=r===0?W.createSegment("M",t):W.createSegment("L",t);this.appendSegment(i)}):e.isSegment&&this.appendSegment(e))}get start(){const e=this.segments,t=e.length;if(t===0)return null;for(let r=0;r<t;r+=1){const i=e[r];if(i.isVisible)return i.start}return e[t-1].end}get end(){const e=this.segments,t=e.length;if(t===0)return null;for(let r=t-1;r>=0;r-=1){const i=e[r];if(i.isVisible)return i.end}return e[t-1].end}moveTo(...e){return this.appendSegment(bs.create.call(null,...e))}lineTo(...e){return this.appendSegment(xt.create.call(null,...e))}curveTo(...e){return this.appendSegment(rn.create.call(null,...e))}arcTo(e,t,r,i,s,o,a){const l=this.end||new P,c=typeof o=="number"?ql(l.x,l.y,e,t,r,i,s,o,a):ql(l.x,l.y,e,t,r,i,s,o.x,o.y);if(c!=null)for(let u=0,h=c.length;u<h;u+=6)this.curveTo(c[u],c[u+1],c[u+2],c[u+3],c[u+4],c[u+5]);return this}quadTo(e,t,r,i){const s=this.end||new P,o=["M",s.x,s.y];if(typeof e=="number")o.push("Q",e,t,r,i);else{const l=t;o.push("Q",e.x,e.y,l.x,l.y)}const a=W.parse(o.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(vs.create())}drawPoints(e,t={}){const r=L1(e,t),i=W.parse(r);i&&i.segments&&this.appendSegment(i.segments)}bbox(){const e=this.segments,t=e.length;if(t===0)return null;let r;for(let s=0;s<t;s+=1){const o=e[s];if(o.isVisible){const a=o.bbox();a!=null&&(r=r?r.union(a):a)}}if(r!=null)return r;const i=e[t-1];return new D(i.end.x,i.end.y,0,0)}appendSegment(e){const t=this.segments.length;let r=t!==0?this.segments[t-1]:null,i;const s=null;if(Array.isArray(e))for(let o=0,a=e.length;o<a;o+=1){const l=e[o];i=this.prepareSegment(l,r,s),this.segments.push(i),r=i}else e!=null&&e.isSegment&&(i=this.prepareSegment(e,r,s),this.segments.push(i));return this}insertSegment(e,t){const r=this.segments.length;if(e<0&&(e=r+e+1),e>r||e<0)throw new Error("Index out of range.");let i,s=null,o=null;if(r!==0&&(e>=1?(s=this.segments[e-1],o=s.nextSegment):(s=null,o=this.segments[0])),!Array.isArray(t))i=this.prepareSegment(t,s,o),this.segments.splice(e,0,i);else for(let a=0,l=t.length;a<l;a+=1){const c=t[a];i=this.prepareSegment(c,s,o),this.segments.splice(e+a,0,i),s=i}return this}removeSegment(e){const t=this.fixIndex(e),r=this.segments.splice(t,1)[0],i=r.previousSegment,s=r.nextSegment;return i&&(i.nextSegment=s),s&&(s.previousSegment=i),r.isSubpathStart&&s&&this.updateSubpathStartSegment(s),r}replaceSegment(e,t){const r=this.fixIndex(e);let i;const s=this.segments[r];let o=s.previousSegment;const a=s.nextSegment;let l=s.isSubpathStart;if(!Array.isArray(t))i=this.prepareSegment(t,o,a),this.segments.splice(r,1,i),l&&i.isSubpathStart&&(l=!1);else{this.segments.splice(e,1);for(let c=0,u=t.length;c<u;c+=1){const h=t[c];i=this.prepareSegment(h,o,a),this.segments.splice(e+c,0,i),o=i,l&&i.isSubpathStart&&(l=!1)}}l&&a&&this.updateSubpathStartSegment(a)}getSegment(e){const t=this.fixIndex(e);return this.segments[t]}fixIndex(e){const t=this.segments.length;if(t===0)throw new Error("Path has no segments.");let r=e;for(;r<0;)r=t+r;if(r>=t||r<0)throw new Error("Index out of range.");return r}segmentAt(e,t={}){const r=this.segmentIndexAt(e,t);return r?this.getSegment(r):null}segmentAtLength(e,t={}){const r=this.segmentIndexAtLength(e,t);return r?this.getSegment(r):null}segmentIndexAt(e,t={}){if(this.segments.length===0)return null;const r=we.clamp(e,0,1),i=this.getOptions(t),o=this.length(i)*r;return this.segmentIndexAtLength(o,i)}segmentIndexAtLength(e,t={}){const r=this.segments.length;if(r===0)return null;let i=!0;e<0&&(i=!1,e=-e);const s=this.getPrecision(t),o=this.getSubdivisions(t);let a=0,l=null;for(let c=0;c<r;c+=1){const u=i?c:r-1-c,h=this.segments[u],f=o[u],d=h.length({precision:s,subdivisions:f});if(h.isVisible){if(e<=a+d)return u;l=u}a+=d}return l}getSegmentSubdivisions(e={}){const t=this.getPrecision(e),r=[];for(let i=0,s=this.segments.length;i<s;i+=1){const a=this.segments[i].getSubdivisions({precision:t});r.push(a)}return r}updateSubpathStartSegment(e){let t=e.previousSegment,r=e;for(;r&&!r.isSubpathStart;)t!=null?r.subpathStartSegment=t.subpathStartSegment:r.subpathStartSegment=null,t=r,r=r.nextSegment}prepareSegment(e,t,r){e.previousSegment=t,e.nextSegment=r,t!=null&&(t.nextSegment=e),r!=null&&(r.previousSegment=e);let i=e;return e.isSubpathStart&&(e.subpathStartSegment=e,i=r),i!=null&&this.updateSubpathStartSegment(i),e}closestPoint(e,t={}){const r=this.closestPointT(e,t);return r?this.pointAtT(r):null}closestPointLength(e,t={}){const r=this.getOptions(t),i=this.closestPointT(e,r);return i?this.lengthAtT(i,r):0}closestPointNormalizedLength(e,t={}){const r=this.getOptions(t),i=this.closestPointLength(e,r);if(i===0)return 0;const s=this.length(r);return s===0?0:i/s}closestPointT(e,t={}){if(this.segments.length===0)return null;const r=this.getPrecision(t),i=this.getSubdivisions(t);let s,o=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const c=this.segments[a],u=i[a];if(c.isVisible){const h=c.closestPointT(e,{precision:r,subdivisions:u}),f=c.pointAtT(h),d=we.squaredLength(f,e);d<o&&(s={segmentIndex:a,value:h},o=d)}}return s||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(e,t={}){if(this.segments.length===0)return null;const r=this.getPrecision(t),i=this.getSubdivisions(t);let s,o=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const c=this.segments[a],u=i[a];if(c.isDifferentiable()){const h=c.closestPointT(e,{precision:r,subdivisions:u}),f=c.pointAtT(h),d=we.squaredLength(f,e);d<o&&(s=c.tangentAtT(h),o=d)}}return s||null}containsPoint(e,t={}){const r=this.toPolylines(t);if(!r)return!1;let i=0;for(let s=0,o=r.length;s<o;s+=1)r[s].containsPoint(e)&&(i+=1);return i%2===1}pointAt(e,t={}){if(this.segments.length===0)return null;if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const r=this.getOptions(t),s=this.length(r)*e;return this.pointAtLength(s,r)}pointAtLength(e,t={}){if(this.segments.length===0)return null;if(e===0)return this.start.clone();let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),s=this.getSubdivisions(t);let o,a=0;for(let c=0,u=this.segments.length;c<u;c+=1){const h=r?c:u-1-c,f=this.segments[h],d=s[h],g=f.length({precision:i,subdivisions:d});if(f.isVisible){if(e<=a+g)return f.pointAtLength((r?1:-1)*(e-a),{precision:i,subdivisions:d});o=f}a+=g}return o?r?o.end:o.start:this.segments[this.segments.length-1].end.clone()}pointAtT(e){const t=this.segments,r=t.length;if(r===0)return null;const i=e.segmentIndex;if(i<0)return t[0].pointAtT(0);if(i>=r)return t[r-1].pointAtT(1);const s=we.clamp(e.value,0,1);return t[i].pointAtT(s)}divideAt(e,t={}){if(this.segments.length===0)return null;const r=we.clamp(e,0,1),i=this.getOptions(t),o=this.length(i)*r;return this.divideAtLength(o,i)}divideAtLength(e,t={}){if(this.segments.length===0)return null;let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),s=this.getSubdivisions(t);let o=0,a,l,c,u,h;for(let x=0,C=this.segments.length;x<C;x+=1){const S=r?x:C-1-x,E=this.getSegment(S),A=s[S],O={precision:i,subdivisions:A},T=E.length(O);if(E.isDifferentiable()&&(c=E,u=S,e<=o+T)){l=S,a=E.divideAtLength((r?1:-1)*(e-o),O);break}o+=T}if(!c)return null;a||(l=u,h=r?1:0,a=c.divideAtT(h));const f=this.clone(),d=l;f.replaceSegment(d,a);const g=d;let p=d+1,b=d+2;a[0].isDifferentiable()||(f.removeSegment(g),p-=1,b-=1);const m=f.getSegment(p).start;f.insertSegment(p,W.createSegment("M",m)),b+=1,a[1].isDifferentiable()||(f.removeSegment(b-1),b-=1);const y=b-g-1;for(let x=b,C=f.segments.length;x<C;x+=1){const S=this.getSegment(x-y),E=f.getSegment(x);if(E.type==="Z"&&!S.subpathStartSegment.end.equals(E.subpathStartSegment.end)){const A=W.createSegment("L",S.end);f.replaceSegment(x,A)}}const v=new W(f.segments.slice(0,p)),w=new W(f.segments.slice(p));return[v,w]}intersectsWithLine(e,t={}){const r=this.toPolylines(t);if(r==null)return null;let i=null;for(let s=0,o=r.length;s<o;s+=1){const a=r[s],l=e.intersect(a);l&&(i==null&&(i=[]),Array.isArray(l)?i.push(...l):i.push(l))}return i}isDifferentiable(){for(let e=0,t=this.segments.length;e<t;e+=1)if(this.segments[e].isDifferentiable())return!0;return!1}isValid(){const e=this.segments;return e.length===0||e[0].type==="M"}length(e={}){if(this.segments.length===0)return 0;const t=this.getSubdivisions(e);let r=0;for(let i=0,s=this.segments.length;i<s;i+=1){const o=this.segments[i],a=t[i];r+=o.length({subdivisions:a})}return r}lengthAtT(e,t={}){const r=this.segments.length;if(r===0)return 0;let i=e.segmentIndex;if(i<0)return 0;let s=we.clamp(e.value,0,1);i>=r&&(i=r-1,s=1);const o=this.getPrecision(t),a=this.getSubdivisions(t);let l=0;for(let h=0;h<i;h+=1){const f=this.segments[h],d=a[h];l+=f.length({precision:o,subdivisions:d})}const c=this.segments[i],u=a[i];return l+=c.lengthAtT(s,{precision:o,subdivisions:u}),l}tangentAt(e,t={}){if(this.segments.length===0)return null;const r=we.clamp(e,0,1),i=this.getOptions(t),o=this.length(i)*r;return this.tangentAtLength(o,i)}tangentAtLength(e,t={}){if(this.segments.length===0)return null;let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),s=this.getSubdivisions(t);let o,a=0;for(let l=0,c=this.segments.length;l<c;l+=1){const u=r?l:c-1-l,h=this.segments[u],f=s[u],d=h.length({precision:i,subdivisions:f});if(h.isDifferentiable()){if(e<=a+d)return h.tangentAtLength((r?1:-1)*(e-a),{precision:i,subdivisions:f});o=h}a+=d}if(o){const l=r?1:0;return o.tangentAtT(l)}return null}tangentAtT(e){const t=this.segments.length;if(t===0)return null;const r=e.segmentIndex;if(r<0)return this.segments[0].tangentAtT(0);if(r>=t)return this.segments[t-1].tangentAtT(1);const i=we.clamp(e.value,0,1);return this.segments[r].tangentAtT(i)}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getSubdivisions(e={}){if(e.segmentSubdivisions==null){const t=this.getPrecision(e);return this.getSegmentSubdivisions({precision:t})}return e.segmentSubdivisions}getOptions(e={}){const t=this.getPrecision(e),r=this.getSubdivisions(e);return{precision:t,segmentSubdivisions:r}}toPoints(e={}){const t=this.segments,r=t.length;if(r===0)return null;const i=this.getSubdivisions(e),s=[];let o=[];for(let a=0;a<r;a+=1){const l=t[a];if(l.isVisible){const c=i[a];c.length>0?c.forEach(u=>o.push(u.start)):o.push(l.start)}else o.length>0&&(o.push(t[a-1].end),s.push(o),o=[])}return o.length>0&&(o.push(this.end),s.push(o)),s}toPolylines(e={}){const t=this.toPoints(e);return t?t.map(r=>new He(r)):null}scale(e,t,r){return this.segments.forEach(i=>i.scale(e,t,r)),this}rotate(e,t){return this.segments.forEach(r=>r.rotate(e,t)),this}translate(e,t){return typeof e=="number"?this.segments.forEach(r=>r.translate(e,t)):this.segments.forEach(r=>r.translate(e)),this}clone(){const e=new W;return this.segments.forEach(t=>e.appendSegment(t.clone())),e}equals(e){if(e==null)return!1;const t=this.segments,r=e.segments,i=t.length;if(r.length!==i)return!1;for(let s=0;s<i;s+=1){const o=t[s],a=r[s];if(o.type!==a.type||!o.equals(a))return!1}return!0}toJSON(){return this.segments.map(e=>e.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(e=>e.serialize()).join(" ")}toString(){return this.serialize()}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPath=e})(W||(W={})),function(n){function e(r){if(!r)return new n;const i=new n,s=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,o=n.normalize(r).match(s);if(o!=null)for(let a=0,l=o.length;a<l;a+=1){const c=o[a],u=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,h=c.match(u);if(h!=null){const f=h[0],d=h.slice(1).map(p=>+p),g=t.call(null,f,...d);i.appendSegment(g)}}return i}n.parse=e;function t(r,...i){if(r==="M")return bs.create.call(null,...i);if(r==="L")return xt.create.call(null,...i);if(r==="C")return rn.create.call(null,...i);if(r==="z"||r==="Z")return vs.create();throw new Error(`Invalid path segment type "${r}"`)}n.createSegment=t}(W||(W={})),function(n){n.normalize=c6,n.isValid=r6,n.drawArc=s6,n.drawPoints=L1,n.arcToCurves=ql}(W||(W={}));class Ue{constructor(e){this.options=Object.assign({},e),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(e,t,r=!1){if(typeof e=="object"){Object.entries(e).forEach(([o,a])=>{this.register(o,a,t)});return}this.exist(e)&&!r&&!tn.isApplyingHMR()&&this.onDuplicated(e);const i=this.options.process,s=i?Y(i,this,e,t):t;return this.data[e]=s,s}unregister(e){const t=e?this.data[e]:null;return delete this.data[e],t}get(e){return e?this.data[e]:null}exist(e){return e?this.data[e]!=null:!1}onDuplicated(e){try{throw this.options.onConflict&&Y(this.options.onConflict,this,e),new Error(`${El(this.options.type)} with name '${e}' already registered.`)}catch(t){throw t}}onNotFound(e,t){throw new Error(this.getSpellingSuggestion(e,t))}getSpellingSuggestion(e,t){const r=this.getSpellingSuggestionForName(e),i=t?`${t} ${EV(this.options.type)}`:this.options.type;return`${El(i)} with name '${e}' does not exist.${r?` Did you mean '${r}'?`:""}`}getSpellingSuggestionForName(e){return s4(e,Object.keys(this.data),t=>t)}}(function(n){function e(t){return new n(t)}n.create=e})(Ue||(Ue={}));const u6=Object.freeze(Object.defineProperty({__proto__:null,dot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,e){const t=e.thickness*e.sx,r=e.thickness*e.sy;fe(n,{width:t,height:r,rx:t,ry:r,fill:e.color})}},doubleMesh:[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,e){let t;const r=e.width,i=e.height,s=e.thickness;r-s>=0&&i-s>=0?t=["M",r,0,"H0 M0 0 V0",i].join(" "):t="M 0 0 0 0",fe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(n,e){let t;const r=e.factor||1,i=e.width*r,s=e.height*r,o=e.thickness;i-o>=0&&s-o>=0?t=["M",i,0,"H0 M0 0 V0",s].join(" "):t="M 0 0 0 0",e.width=i,e.height=s,fe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}],fixedDot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,e){const t=e.sx<=1?e.thickness*e.sx:e.thickness;fe(n,{width:t,height:t,rx:t,ry:t,fill:e.color})}},mesh:{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,e){let t;const r=e.width,i=e.height,s=e.thickness;r-s>=0&&i-s>=0?t=["M",r,0,"H0 M0 0 V0",i].join(" "):t="M 0 0 0 0",fe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}},Symbol.toStringTag,{value:"Module"}));class Or{constructor(){this.patterns={},this.root=ee.create($l(),{width:"100%",height:"100%"},[Zn("defs")]).node}add(e,t){const r=this.root.childNodes[0];r&&r.appendChild(t),this.patterns[e]=t,ee.create("rect",{width:"100%",height:"100%",fill:`url(#${e})`}).appendTo(this.root)}get(e){return this.patterns[e]}has(e){return this.patterns[e]!=null}}(function(n){n.presets=u6,n.registry=Ue.create({type:"grid"}),n.registry.register(n.presets,!0)})(Or||(Or={}));const D1=function(n){const e=document.createElement("canvas"),t=n.width,r=n.height;e.width=t*2,e.height=r;const i=e.getContext("2d");return i.drawImage(n,0,0,t,r),i.translate(2*t,0),i.scale(-1,1),i.drawImage(n,0,0,t,r),e},B1=function(n){const e=document.createElement("canvas"),t=n.width,r=n.height;e.width=t,e.height=r*2;const i=e.getContext("2d");return i.drawImage(n,0,0,t,r),i.translate(0,2*r),i.scale(1,-1),i.drawImage(n,0,0,t,r),e},z1=function(n){const e=document.createElement("canvas"),t=n.width,r=n.height;e.width=2*t,e.height=2*r;const i=e.getContext("2d");return i.drawImage(n,0,0,t,r),i.setTransform(-1,0,0,-1,e.width,e.height),i.drawImage(n,0,0,t,r),i.setTransform(-1,0,0,1,e.width,0),i.drawImage(n,0,0,t,r),i.setTransform(1,0,0,-1,0,e.height),i.drawImage(n,0,0,t,r),e},h6=Object.freeze(Object.defineProperty({__proto__:null,flipX:D1,flipXY:z1,flipY:B1,watermark:function(n,e){const t=n.width,r=n.height,i=document.createElement("canvas");i.width=t*3,i.height=r*3;const s=i.getContext("2d"),o=e.angle!=null?-e.angle:-20,a=ve.toRad(o),l=i.width/4,c=i.height/4;for(let u=0;u<4;u+=1)for(let h=0;h<4;h+=1)(u+h)%2>0&&(s.setTransform(1,0,0,1,(2*u-1)*l,(2*h-1)*c),s.rotate(a),s.drawImage(n,-t/2,-r/2,t,r));return i}},Symbol.toStringTag,{value:"Module"}));var Go;(function(n){n.presets=Object.assign({},h6),n.presets["flip-x"]=D1,n.presets["flip-y"]=B1,n.presets["flip-xy"]=z1,n.registry=Ue.create({type:"background pattern"}),n.registry.register(n.presets,!0)})(Go||(Go={}));function of(n,e){return n!=null?n:e}function ut(n,e){return n!=null&&Number.isFinite(n)?n:e}function f6(n={}){const e=of(n.color,"blue"),t=ut(n.width,1),r=ut(n.margin,2),i=ut(n.opacity,1),s=r,o=r+t;return`
5
5
  <filter>
6
6
  <feFlood flood-color="${e}" flood-opacity="${i}" result="colored"/>
7
7
  <feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="${o}" />
@@ -13,7 +13,7 @@
13
13
  <feMergeNode in="SourceGraphic"/>
14
14
  </feMerge>
15
15
  </filter>
16
- `.trim()}function g6(n={}){const e=of(n.color,"red"),t=ut(n.blur,0),r=ut(n.width,1),i=ut(n.opacity,1);return`
16
+ `.trim()}function d6(n={}){const e=of(n.color,"red"),t=ut(n.blur,0),r=ut(n.width,1),i=ut(n.opacity,1);return`
17
17
  <filter>
18
18
  <feFlood flood-color="${e}" flood-opacity="${i}" result="colored"/>
19
19
  <feMorphology result="morphed" in="SourceGraphic" operator="dilate" radius="${r}"/>
@@ -21,11 +21,11 @@
21
21
  <feGaussianBlur result="blured" in="composed" stdDeviation="${t}"/>
22
22
  <feBlend in="SourceGraphic" in2="blured" mode="normal"/>
23
23
  </filter>
24
- `.trim()}function p6(n={}){const e=ut(n.x,2);return`
24
+ `.trim()}function g6(n={}){const e=ut(n.x,2);return`
25
25
  <filter>
26
26
  <feGaussianBlur stdDeviation="${n.y!=null&&Number.isFinite(n.y)?[e,n.y]:e}"/>
27
27
  </filter>
28
- `.trim()}function m6(n={}){const e=ut(n.dx,0),t=ut(n.dy,0),r=of(n.color,"black"),i=ut(n.blur,4),s=ut(n.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>
28
+ `.trim()}function p6(n={}){const e=ut(n.dx,0),t=ut(n.dy,0),r=of(n.color,"black"),i=ut(n.blur,4),s=ut(n.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>
29
29
  <feDropShadow stdDeviation="${i}" dx="${e}" dy="${t}" flood-color="${r}" flood-opacity="${s}" />
30
30
  </filter>`.trim():`<filter>
31
31
  <feGaussianBlur in="SourceAlpha" stdDeviation="${i}" />
@@ -39,23 +39,23 @@
39
39
  <feMergeNode/>
40
40
  <feMergeNode in="SourceGraphic"/>
41
41
  </feMerge>
42
- </filter>`.trim()}function y6(n={}){const e=ut(n.amount,1),t=.2126+.7874*(1-e),r=.7152-.7152*(1-e),i=.0722-.0722*(1-e),s=.2126-.2126*(1-e),o=.7152+.2848*(1-e),a=.0722-.0722*(1-e),l=.2126-.2126*(1-e),c=.0722+.9278*(1-e);return`
42
+ </filter>`.trim()}function m6(n={}){const e=ut(n.amount,1),t=.2126+.7874*(1-e),r=.7152-.7152*(1-e),i=.0722-.0722*(1-e),s=.2126-.2126*(1-e),o=.7152+.2848*(1-e),a=.0722-.0722*(1-e),l=.2126-.2126*(1-e),c=.0722+.9278*(1-e);return`
43
43
  <filter>
44
44
  <feColorMatrix type="matrix" values="${t} ${r} ${i} 0 0 ${s} ${o} ${a} 0 0 ${l} ${r} ${c} 0 0 0 0 0 1 0"/>
45
45
  </filter>
46
- `.trim()}function v6(n={}){const e=ut(n.amount,1),t=.393+.607*(1-e),r=.769-.769*(1-e),i=.189-.189*(1-e),s=.349-.349*(1-e),o=.686+.314*(1-e),a=.168-.168*(1-e),l=.272-.272*(1-e),c=.534-.534*(1-e),u=.131+.869*(1-e);return`
46
+ `.trim()}function y6(n={}){const e=ut(n.amount,1),t=.393+.607*(1-e),r=.769-.769*(1-e),i=.189-.189*(1-e),s=.349-.349*(1-e),o=.686+.314*(1-e),a=.168-.168*(1-e),l=.272-.272*(1-e),c=.534-.534*(1-e),u=.131+.869*(1-e);return`
47
47
  <filter>
48
48
  <feColorMatrix type="matrix" values="${t} ${r} ${i} 0 0 ${s} ${o} ${a} 0 0 ${l} ${c} ${u} 0 0 0 0 0 1 0"/>
49
49
  </filter>
50
- `.trim()}function b6(n={}){return`
50
+ `.trim()}function v6(n={}){return`
51
51
  <filter>
52
52
  <feColorMatrix type="saturate" values="${1-ut(n.amount,1)}"/>
53
53
  </filter>
54
- `.trim()}function w6(n={}){return`
54
+ `.trim()}function b6(n={}){return`
55
55
  <filter>
56
56
  <feColorMatrix type="hueRotate" values="${ut(n.angle,0)}"/>
57
57
  </filter>
58
- `.trim()}function x6(n={}){const e=ut(n.amount,1),t=1-e;return`
58
+ `.trim()}function w6(n={}){const e=ut(n.amount,1),t=1-e;return`
59
59
  <filter>
60
60
  <feComponentTransfer>
61
61
  <feFuncR type="table" tableValues="${e} ${t}"/>
@@ -63,7 +63,7 @@
63
63
  <feFuncB type="table" tableValues="${e} ${t}"/>
64
64
  </feComponentTransfer>
65
65
  </filter>
66
- `.trim()}function C6(n={}){const e=ut(n.amount,1);return`
66
+ `.trim()}function x6(n={}){const e=ut(n.amount,1);return`
67
67
  <filter>
68
68
  <feComponentTransfer>
69
69
  <feFuncR type="linear" slope="${e}"/>
@@ -71,7 +71,7 @@
71
71
  <feFuncB type="linear" slope="${e}"/>
72
72
  </feComponentTransfer>
73
73
  </filter>
74
- `.trim()}function S6(n={}){const e=ut(n.amount,1),t=.5-e/2;return`
74
+ `.trim()}function C6(n={}){const e=ut(n.amount,1),t=.5-e/2;return`
75
75
  <filter>
76
76
  <feComponentTransfer>
77
77
  <feFuncR type="linear" slope="${e}" intercept="${t}"/>
@@ -79,11 +79,11 @@
79
79
  <feFuncB type="linear" slope="${e}" intercept="${t}"/>
80
80
  </feComponentTransfer>
81
81
  </filter>
82
- `.trim()}const P6=Object.freeze(Object.defineProperty({__proto__:null,blur:p6,brightness:C6,contrast:S6,dropShadow:m6,grayScale:y6,highlight:g6,hueRotate:w6,invert:x6,outline:d6,saturate:b6,sepia:v6},Symbol.toStringTag,{value:"Module"}));var ws;(function(n){n.presets=P6,n.registry=Ue.create({type:"filter"}),n.registry.register(n.presets,!0)})(ws||(ws={}));const E6={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"},A6={},V1={position:Ul("x","width","origin")},q1={position:Ul("y","height","origin")},T6={position:Ul("x","width","corner")},O6={position:Ul("y","height","corner")},G1={set:Mr("width","width")},H1={set:Mr("height","height")},M6={set:Mr("rx","width")},_6={set:Mr("ry","height")},U1={set:(n=>{const e=Mr(n,"width"),t=Mr(n,"height");return function(r,i){const s=i.refBBox,o=s.height>s.width?e:t;return K(o,this,r,i)}})("r")},N6={set(n,{refBBox:e}){let t=parseFloat(n);const r=Qn(n);r&&(t/=100);const i=Math.sqrt(e.height*e.height+e.width*e.width);let s;return Number.isFinite(t)&&(r||t>=0&&t<=1?s=t*i:s=Math.max(t+i,0)),{r:s}}},k6={set:Mr("cx","width")},$6={set:Mr("cy","height")},W1={set:K1({resetOffset:!0})},I6={set:K1({resetOffset:!1})},X1={set:J1({resetOffset:!0})},L6={set:J1({resetOffset:!1})},R6=U1,j6=W1,D6=X1,B6=V1,z6=q1,F6=G1,V6=H1;function Ul(n,e,t){return(r,{refBBox:i})=>{if(r==null)return null;let s=parseFloat(r);const o=Qn(r);o&&(s/=100);let a;if(Number.isFinite(s)){const c=i[t];o||s>0&&s<1?a=c[n]+i[e]*s:a=c[n]+s}const l=new P;return l[n]=a||0,l}}function Mr(n,e){return function(t,{refBBox:r}){let i=parseFloat(t);const s=Qn(t);s&&(i/=100);const o={};if(Number.isFinite(i)){const a=s||i>=0&&i<=1?i*r[e]:Math.max(i+r[e],0);o[n]=a}return o}}function Y1(n,e){const t="x6-shape",r=e&&e.resetOffset;return function(i,{elem:s,refBBox:o}){let a=xi(s,t);if(!a||a.value!==i){const p=n(i);a={value:i,shape:p,shapeBBox:p.bbox()},xi(s,t,a)}const l=a.shape.clone(),c=a.shapeBBox.clone(),u=c.getOrigin(),h=o.getOrigin();c.x=h.x,c.y=h.y;const f=o.getMaxScaleToFit(c,h),d=c.width===0||o.width===0?1:f.sx,g=c.height===0||o.height===0?1:f.sy;return l.scale(d,g,u),r&&l.translate(-u.x,-u.y),l}}function K1(n){function e(r){return X.parse(r)}const t=Y1(e,n);return(r,i)=>({d:t(r,i).serialize()})}function J1(n){const e=Y1(t=>new He(t),n);return(t,r)=>({points:e(t,r).serialize()})}const q6={qualify:Ln,set(n,{view:e}){return`url(#${e.graph.defineGradient(n)})`}},G6={qualify:Ln,set(n,{view:e}){const t=e.cell,r=Object.assign({},n);if(t.isEdge()&&r.type==="linearGradient"){const i=e,s=i.sourcePoint,o=i.targetPoint;r.id=`gradient-${r.type}-${t.id}`,r.attrs=Object.assign(Object.assign({},r.attrs),{x1:s.x,y1:s.y,x2:o.x,y2:o.y,gradientUnits:"userSpaceOnUse"}),e.graph.defs.remove(r.id)}return`url(#${e.graph.defineGradient(r)})`}},Q1={qualify(n,{attrs:e}){return e.textWrap==null||!Ln(e.textWrap)},set(n,{view:e,elem:t,attrs:r}){const i="x6-text",s=xi(t,i),o=u=>{try{return JSON.parse(u)}catch(h){return u}},a={x:r.x,eol:r.eol,annotations:o(r.annotations),textPath:o(r["text-path"]||r.textPath),textVerticalAnchor:r["text-vertical-anchor"]||r.textVerticalAnchor,displayEmpty:(r["display-empty"]||r.displayEmpty)==="true",lineHeight:r["line-height"]||r.lineHeight},l=r["font-size"]||r.fontSize,c=JSON.stringify([n,a]);if(l&&t.setAttribute("font-size",l),s==null||s!==c){const u=a.textPath;if(u!=null&&typeof u=="object"){const h=u.selector;if(typeof h=="string"){const f=e.find(h)[0];f instanceof SVGPathElement&&(Gh(f),a.textPath=Object.assign({"xlink:href":`#${f.id}`},u))}}T1(t,`${n}`,a),xi(t,i,c)}}},H6={qualify:Ln,set(n,{view:e,elem:t,attrs:r,refBBox:i}){const s=n,o=s.width||0;Qn(o)?i.width*=parseFloat(o)/100:o<=0?i.width+=o:i.width=o;const a=s.height||0;Qn(a)?i.height*=parseFloat(a)/100:a<=0?i.height+=a:i.height=a;let l,c=s.text;c==null&&(c=r.text),c!=null?l=k4(`${c}`,i,{"font-weight":r["font-weight"]||r.fontWeight,"font-size":r["font-size"]||r.fontSize,"font-family":r["font-family"]||r.fontFamily,lineHeight:r.lineHeight},{ellipsis:s.ellipsis}):l="",K(Q1.set,this,l,{view:e,elem:t,attrs:r,refBBox:i,cell:e.cell})}},xs=(n,{attrs:e})=>e.text!==void 0,U6={qualify:xs},W6={qualify:xs},X6={qualify:xs},Y6={qualify:xs},K6={qualify:xs},J6={qualify:xs},Q6={qualify(n,{elem:e}){return e instanceof SVGElement},set(n,{elem:e}){const t="x6-title",r=`${n}`,i=xi(e,t);if(i==null||i!==r){xi(e,t,r);const s=e.firstChild;if(s&&s.tagName.toUpperCase()==="TITLE"){const o=s;o.textContent=r}else{const o=document.createElementNS(e.namespaceURI,"title");o.textContent=r,e.insertBefore(o,s)}}}},Z6={offset:Z1("x","width","right")},eq={offset:Z1("y","height","bottom")},tq={offset(n,{refBBox:e}){return n?{x:-e.x,y:-e.y}:{x:0,y:0}}};function Z1(n,e,t){return(r,{refBBox:i})=>{const s=new P;let o;return r==="middle"?o=i[e]/2:r===t?o=i[e]:typeof r=="number"&&Number.isFinite(r)?o=r>-1&&r<1?-i[e]*r:-r:Qn(r)?o=i[e]*parseFloat(r)/100:o=0,s[n]=-(i[n]+o),s}}const nq={qualify:Ln,set(n,{elem:e}){pe(e,n)}},rq={set(n,{elem:e}){e.innerHTML=`${n}`}},iq={qualify:Ln,set(n,{view:e}){return`url(#${e.graph.defineFilter(n)})`}},sq={set(n){return n!=null&&typeof n=="object"&&n.id?n.id:n}};function _r(n,e,t){let r,i;typeof e=="object"?(r=e.x,i=e.y):(r=e,i=t);const s=X.parse(n),o=s.bbox();if(o){let a=-o.height/2-o.y,l=-o.width/2-o.x;typeof r=="number"&&(l-=r),typeof i=="number"&&(a-=i),s.translate(l,a)}return s.serialize()}var ew=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const oq=n=>{var{size:e,width:t,height:r,offset:i,open:s}=n,o=ew(n,["size","width","height","offset","open"]);return tw({size:e,width:t,height:r,offset:i},s===!0,!0,void 0,o)},aq=n=>{var{size:e,width:t,height:r,offset:i,factor:s}=n,o=ew(n,["size","width","height","offset","factor"]);return tw({size:e,width:t,height:r,offset:i},!1,!1,s,o)};function tw(n,e,t,r=3/4,i={}){const s=n.size||10,o=n.width||s,a=n.height||s,l=new X,c={};if(e)l.moveTo(o,0).lineTo(0,a/2).lineTo(o,a),c.fill="none";else{if(l.moveTo(0,a/2),l.lineTo(o,0),!t){const u=en(r,0,1);l.lineTo(o*u,a/2)}l.lineTo(o,a),l.close()}return Object.assign(Object.assign(Object.assign({},c),i),{tagName:"path",d:_r(l.serialize(),{x:n.offset!=null?n.offset:-o/2})})}var lq=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const cq=n=>{var{size:e,width:t,height:r,offset:i}=n,s=lq(n,["size","width","height","offset"]);const o=e||10,a=t||o,l=r||o,c=new X;return c.moveTo(0,l/2).lineTo(a/2,0).lineTo(a,l/2).lineTo(a/2,l).close(),Object.assign(Object.assign({},s),{tagName:"path",d:_r(c.serialize(),i==null?-a/2:i)})};var uq=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const hq=n=>{var{d:e,offsetX:t,offsetY:r}=n,i=uq(n,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},i),{tagName:"path",d:_r(e,t,r)})};var fq=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const dq=n=>{var{size:e,width:t,height:r,offset:i}=n,s=fq(n,["size","width","height","offset"]);const o=e||10,a=t||o,l=r||o,c=new X;return c.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},s),{tagName:"path",fill:"none",d:_r(c.serialize(),i||-a/2)})};var gq=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const pq=n=>{var{width:e,height:t,offset:r,open:i,flip:s}=n,o=gq(n,["width","height","offset","open","flip"]);let a=t||6;const l=e||10,c=i===!0,u=s===!0,h=Object.assign(Object.assign({},o),{tagName:"path"});u&&(a=-a);const f=new X;return f.moveTo(0,a).lineTo(l,0),c?h.fill="none":(f.lineTo(l,a),f.close()),h.d=_r(f.serialize(),{x:r||-l/2,y:a/2}),h};var nw=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const rw=n=>{var{r:e}=n,t=nw(n,["r"]);const r=e||5;return Object.assign(Object.assign({cx:r},t),{tagName:"circle",r})},mq=n=>{var{r:e}=n,t=nw(n,["r"]);const r=e||5,i=new X;return i.moveTo(r,0).lineTo(r,r*2),i.moveTo(0,r).lineTo(r*2,r),{children:[Object.assign(Object.assign({},rw({r})),{fill:"none"}),Object.assign(Object.assign({},t),{tagName:"path",d:_r(i.serialize(),-r)})]}};var yq=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const vq=Object.freeze(Object.defineProperty({__proto__:null,async:pq,block:oq,circle:rw,circlePlus:mq,classic:aq,cross:dq,diamond:cq,ellipse:n=>{var{rx:e,ry:t}=n,r=yq(n,["rx","ry"]);const i=e||5,s=t||5;return Object.assign(Object.assign({cx:i},r),{tagName:"ellipse",rx:i,ry:s})},path:hq},Symbol.toStringTag,{value:"Module"}));var Nr;(function(n){n.presets=vq,n.registry=Ue.create({type:"marker"}),n.registry.register(n.presets,!0)})(Nr||(Nr={})),function(n){n.normalize=_r}(Nr||(Nr={}));var bq=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};function af(n){return typeof n=="string"||Ln(n)}const wq={qualify:af,set(n,{view:e,attrs:t}){return lf("marker-start",n,e,t)}},xq={qualify:af,set(n,{view:e,attrs:t}){return lf("marker-end",n,e,t,{transform:"rotate(180)"})}},Cq={qualify:af,set(n,{view:e,attrs:t}){return lf("marker-mid",n,e,t)}};function lf(n,e,t,r,i={}){const s=typeof e=="string"?{name:e}:e,{name:o,args:a}=s,l=bq(s,["name","args"]);let c=l;if(o&&typeof o=="string"){const h=Nr.registry.get(o);if(h)c=h(Object.assign(Object.assign({},l),a));else return Nr.registry.onNotFound(o)}const u=Object.assign(Object.assign(Object.assign({},Sq(r,n)),i),c);return{[n]:`url(#${t.graph.defineMarker(u)})`}}function Sq(n,e){const t={},r=n.stroke;typeof r=="string"&&(t.stroke=r,t.fill=r);let i=n.strokeOpacity;if(i==null&&(i=n["stroke-opacity"]),i==null&&(i=n.opacity),i!=null&&(t["stroke-opacity"]=i,t["fill-opacity"]=i),e!=="marker-mid"){const s=parseFloat(n.strokeWidth||n["stroke-width"]);if(Number.isFinite(s)&&s>1){const o=Math.ceil(s/2);t.refX=e==="marker-start"?o:-o}}return t}const Go=(n,{view:e})=>e.cell.isEdge(),Pq={qualify:Go,set(n,e){var t,r,i,s;const o=e.view,a=n.reverse||!1,l=n.stubs||0;let c;if(Number.isFinite(l)&&l!==0)if(a){let u,h;const f=o.getConnectionLength()||0;l<0?(u=(f+l)/2,h=-l):(u=l,h=f-l*2);const d=o.getConnection();c=(s=(i=(r=(t=d==null?void 0:d.divideAtLength(u))===null||t===void 0?void 0:t[1])===null||r===void 0?void 0:r.divideAtLength(h))===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.serialize()}else{let u;l<0?u=((o.getConnectionLength()||0)+l)/2:u=l;const h=o.getConnection();if(h){const f=h.divideAtLength(u),d=h.divideAtLength(-u);f&&d&&(c=`${f[0].serialize()} ${d[1].serialize()}`)}}return{d:c||o.getConnectionPathData()}}},iw={qualify:Go,set:Wl("getTangentAtLength",{rotate:!0})},Eq={qualify:Go,set:Wl("getTangentAtLength",{rotate:!1})},sw={qualify:Go,set:Wl("getTangentAtRatio",{rotate:!0})},Aq={qualify:Go,set:Wl("getTangentAtRatio",{rotate:!1})},Tq=iw,Oq=sw;function Wl(n,e){const t={x:1,y:0};return(r,i)=>{let s,o;const a=i.view,l=a[n](Number(r));return l?(o=e.rotate?l.vector().vectorAngle(t):0,s=l.start):(s=a.path.start,o=0),o===0?{transform:`translate(${s.x},${s.y}')`}:{transform:`translate(${s.x},${s.y}') rotate(${o})`}}}const Mq=Object.freeze(Object.defineProperty({__proto__:null,annotations:Y6,atConnectionLength:Tq,atConnectionLengthIgnoreGradient:Eq,atConnectionLengthKeepGradient:iw,atConnectionRatio:Oq,atConnectionRatioIgnoreGradient:Aq,atConnectionRatioKeepGradient:sw,connection:Pq,displayEmpty:J6,eol:K6,fill:q6,filter:iq,html:rq,lineHeight:U6,port:sq,ref:A6,refCx:k6,refCy:$6,refD:j6,refDKeepOffset:I6,refDResetOffset:W1,refDx:T6,refDy:O6,refHeight:H1,refHeight2:V6,refPoints:D6,refPointsKeepOffset:L6,refPointsResetOffset:X1,refR:R6,refRCircumscribed:N6,refRInscribed:U1,refRx:M6,refRy:_6,refWidth:G1,refWidth2:F6,refX:V1,refX2:B6,refY:q1,refY2:z6,resetOffset:tq,sourceMarker:wq,stroke:G6,style:nq,targetMarker:xq,text:Q1,textPath:X6,textVerticalAnchor:W6,textWrap:H6,title:Q6,vertexMarker:Cq,xAlign:Z6,yAlign:eq},Symbol.toStringTag,{value:"Module"}));var Bn;(function(n){function e(t,r,i){return!!(t!=null&&(typeof t=="string"||typeof t.qualify!="function"||K(t.qualify,this,r,i)))}n.isValidDefinition=e})(Bn||(Bn={})),function(n){n.presets=Object.assign(Object.assign({},E6),Mq),n.registry=Ue.create({type:"attribute definition"}),n.registry.register(n.presets,!0)}(Bn||(Bn={}));const sn={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(n){return`${sn.prefixCls}-${n}`}},ow=sn.prefix("highlighted"),_q={highlight(n,e,t){const r=t&&t.className||ow;J(e,r)},unhighlight(n,e,t){const r=t&&t.className||ow;gt(e,r)}},aw=sn.prefix("highlight-opacity"),Nq={highlight(n,e){J(e,aw)},unhighlight(n,e){gt(e,aw)}};var fe;(function(n){const e=Zn("svg");n.normalizeMarker=_r;function t(d,g){const p=q4(d.x,d.y).matrixTransform(g);return new P(p.x,p.y)}n.transformPoint=t;function r(d,g){return new F(t(d.start,g),t(d.end,g))}n.transformLine=r;function i(d,g){let p=d instanceof He?d.points:d;return Array.isArray(p)||(p=[]),new He(p.map(b=>t(b,g)))}n.transformPolyline=i;function s(d,g){const p=e.createSVGPoint();p.x=d.x,p.y=d.y;const b=p.matrixTransform(g);p.x=d.x+d.width,p.y=d.y;const m=p.matrixTransform(g);p.x=d.x+d.width,p.y=d.y+d.height;const y=p.matrixTransform(g);p.x=d.x,p.y=d.y+d.height;const v=p.matrixTransform(g),w=Math.min(b.x,m.x,y.x,v.x),x=Math.max(b.x,m.x,y.x,v.x),C=Math.min(b.y,m.y,y.y,v.y),S=Math.max(b.y,m.y,y.y,v.y);return new D(w,C,x-w,S-C)}n.transformRectangle=s;function o(d,g,p){let b;const m=d.ownerSVGElement;if(!m)return new D(0,0,0,0);try{b=d.getBBox()}catch(v){b={x:d.clientLeft,y:d.clientTop,width:d.clientWidth,height:d.clientHeight}}if(g)return D.create(b);const y=Lo(d,p||m);return s(b,y)}n.bbox=o;function a(d,g={}){let p;if(!d.ownerSVGElement||!Er(d)){if(p1(d)){const{left:v,top:w,width:x,height:C}=l(d);return new D(v,w,x,C)}return new D(0,0,0,0)}let m=g.target;if(!g.recursive){try{p=d.getBBox()}catch(w){p={x:d.clientLeft,y:d.clientTop,width:d.clientWidth,height:d.clientHeight}}if(!m)return D.create(p);const v=Lo(d,m);return s(p,v)}{const v=d.childNodes,w=v.length;if(w===0)return a(d,{target:m});m||(m=d);for(let x=0;x<w;x+=1){const C=v[x];let S;C.childNodes.length===0?S=a(C,{target:m}):S=a(C,{target:m,recursive:!0}),p?p=p.union(S):p=S}return p}}n.getBBox=a;function l(d){let g=0,p=0,b=0,m=0;if(d){let y=d;for(;y;)g+=y.offsetLeft,p+=y.offsetTop,y=y.offsetParent,y&&(g+=parseInt(S1(y,"borderLeft"),10),p+=parseInt(S1(y,"borderTop"),10));b=d.offsetWidth,m=d.offsetHeight}return{left:g,top:p,width:b,height:m}}n.getBoundingOffsetRect=l;function c(d){const g=p=>{const b=d.getAttribute(p),m=b?parseFloat(b):0;return Number.isNaN(m)?0:m};switch(d instanceof SVGElement&&d.nodeName.toLowerCase()){case"rect":return new D(g("x"),g("y"),g("width"),g("height"));case"circle":return new wn(g("cx"),g("cy"),g("r"),g("r"));case"ellipse":return new wn(g("cx"),g("cy"),g("rx"),g("ry"));case"polyline":{const p=Bl(d);return new He(p)}case"polygon":{const p=Bl(d);return p.length>1&&p.push(p[0]),new He(p)}case"path":{let p=d.getAttribute("d");return X.isValid(p)||(p=X.normalize(p)),X.parse(p)}case"line":return new F(g("x1"),g("y1"),g("x2"),g("y2"))}return a(d)}n.toGeometryShape=c;function u(d,g,p,b){const m=P.create(g),y=P.create(p);b||(b=d instanceof SVGSVGElement?d:d.ownerSVGElement);const v=tf(d);d.setAttribute("transform","");const w=a(d,{target:b}).scale(v.sx,v.sy),x=Io();x.setTranslate(-w.x-w.width/2,-w.y-w.height/2);const C=Io(),S=m.angleBetween(y,m.clone().translate(1,0));S&&C.setRotate(S,0,0);const E=Io(),A=m.clone().move(y,w.width/2);E.setTranslate(2*m.x-A.x,2*m.y-A.y);const O=Lo(d,b),T=Io();T.setMatrix(E.matrix.multiply(C.matrix.multiply(x.matrix.multiply(O.scale(v.sx,v.sy))))),d.setAttribute("transform",ms(T.matrix))}n.translateAndAutoOrient=u;function h(d){if(d==null)return null;let g=d;do{let p=g.tagName;if(typeof p!="string")return null;if(p=p.toUpperCase(),gs(g,"x6-port"))g=g.nextElementSibling;else if(p==="G")g=g.firstElementChild;else if(p==="TITLE")g=g.nextElementSibling;else break}while(g);return g}n.findShapeNode=h;function f(d){const g=h(d);if(!Er(g)){if(p1(d)){const{left:y,top:v,width:w,height:x}=l(d);return new D(y,v,w,x)}return new D(0,0,0,0)}const b=c(g).bbox()||D.create(),m=g.getAttribute("transform");if(m){const y=ps(m);return s(b,y)}return b}n.getBBoxV2=f})(fe||(fe={}));const kq={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},$q={highlight(n,e,t){const r=kr.getHighlighterId(e,t);if(kr.hasCache(r))return;t=_b({},t,kq);const i=ee.create(e);let s,o;try{s=i.toPathData()}catch(u){o=fe.bbox(i.node,!0),s=_1(Object.assign(Object.assign({},t),o))}const a=Zn("path");if(he(a,Object.assign({d:s,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},t.attrs?ko(t.attrs):null)),n.isEdgeElement(e))he(a,"d",n.getConnectionPathData());else{let u=i.getTransformToElement(n.container);const h=t.padding;if(h){o==null&&(o=fe.bbox(i.node,!0));const f=o.x+o.width/2,d=o.y+o.height/2;o=fe.transformRectangle(o,u);const g=Math.max(o.width,1),p=Math.max(o.height,1),b=(g+h)/g,m=(p+h)/p,y=ct({a:b,b:0,c:0,d:m,e:f-b*f,f:d-m*d});u=u.multiply(y)}ys(a,u)}J(a,sn.prefix("highlight-stroke"));const l=n.cell,c=()=>kr.removeHighlighter(r);l.on("removed",c),l.model&&l.model.on("reseted",c),n.container.appendChild(a),kr.setCache(r,a)},unhighlight(n,e,t){kr.removeHighlighter(kr.getHighlighterId(e,t))}};var kr;(function(n){function e(o,a){return Gh(o),o.id+JSON.stringify(a)}n.getHighlighterId=e;const t={};function r(o,a){t[o]=a}n.setCache=r;function i(o){return t[o]!=null}n.hasCache=i;function s(o){const a=t[o];a&&(er(a),delete t[o])}n.removeHighlighter=s})(kr||(kr={}));const Iq=Object.freeze(Object.defineProperty({__proto__:null,className:_q,opacity:Nq,stroke:$q},Symbol.toStringTag,{value:"Module"}));var rr;(function(n){function e(t,r){if(typeof r.highlight!="function")throw new Error(`Highlighter '${t}' is missing required \`highlight()\` method`);if(typeof r.unhighlight!="function")throw new Error(`Highlighter '${t}' is missing required \`unhighlight()\` method`)}n.check=e})(rr||(rr={})),function(n){n.presets=Iq,n.registry=Ue.create({type:"highlighter"}),n.registry.register(n.presets,!0)}(rr||(rr={}));function cf(n,e={}){return new P(Vt(e.x,n.width),Vt(e.y,n.height))}function uf(n,e,t){return Object.assign({angle:e,position:n.toJSON()},t)}const Lq=(n,e)=>n.map(({x:t,y:r,angle:i})=>uf(cf(e,{x:t,y:r}),i||0)),Rq=(n,e,t)=>{const r=t.start||0,i=t.step||20;return lw(n,e,r,(s,o)=>(s+.5-o/2)*i)},jq=(n,e,t)=>{const r=t.start||0,i=t.step||360/n.length;return lw(n,e,r,s=>s*i)};function lw(n,e,t,r){const i=e.getCenter(),s=e.getTopCenter(),o=e.width/e.height,a=wn.fromRect(e),l=n.length;return n.map((c,u)=>{const h=t+r(u,l),f=s.clone().rotate(-h,i).scale(o,1,i),d=c.compensateRotate?-a.tangentTheta(f):0;return(c.dx||c.dy)&&f.translate(c.dx||0,c.dy||0),c.dr&&f.move(i,c.dr),uf(f.round(),d,c)})}var Dq=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const Bq=(n,e,t)=>{const r=cf(e,t.start||e.getOrigin()),i=cf(e,t.end||e.getCorner());return Ho(n,r,i,t)},zq=(n,e,t)=>Ho(n,e.getTopLeft(),e.getBottomLeft(),t),Fq=(n,e,t)=>Ho(n,e.getTopRight(),e.getBottomRight(),t),Vq=(n,e,t)=>Ho(n,e.getTopLeft(),e.getTopRight(),t),qq=(n,e,t)=>Ho(n,e.getBottomLeft(),e.getBottomRight(),t);function Ho(n,e,t,r){const i=new F(e,t),s=n.length;return n.map((o,a)=>{var{strict:l}=o,c=Dq(o,["strict"]);const u=l||r.strict?(a+1)/(s+1):(a+.5)/s,h=i.pointAt(u);return(c.dx||c.dy)&&h.translate(c.dx||0,c.dy||0),uf(h.round(),0,c)})}const Gq=Object.freeze(Object.defineProperty({__proto__:null,absolute:Lq,bottom:qq,ellipse:Rq,ellipseSpread:jq,left:zq,line:Bq,right:Fq,top:Vq},Symbol.toStringTag,{value:"Module"}));var Ei;(function(n){n.presets=Gq,n.registry=Ue.create({type:"port layout"}),n.registry.register(n.presets,!0)})(Ei||(Ei={}));const Hq={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function $r(n,e){const{x:t,y:r,angle:i,attrs:s}=e||{};return _b({},{angle:i,attrs:s,position:{x:t,y:r}},n,Hq)}const Uq=(n,e,t)=>$r({position:e.getTopLeft()},t),Wq=(n,e,t)=>$r({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},t),Xq=(n,e,t)=>$r({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},t),Yq=(n,e,t)=>$r({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},t),Kq=(n,e,t)=>$r({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},t),Jq=(n,e,t)=>cw(n,e,!1,t),Qq=(n,e,t)=>cw(n,e,!0,t),Zq=(n,e,t)=>uw(n,e,!1,t),e5=(n,e,t)=>uw(n,e,!0,t);function cw(n,e,t,r){const i=r.offset!=null?r.offset:15,s=e.getCenter().theta(n),o=hw(e);let a,l,c,u,h=0;return s<o[1]||s>o[2]?(a=".3em",l=i,c=0,u="start"):s<o[0]?(a="0",l=0,c=-i,t?(h=-90,u="start"):u="middle"):s<o[3]?(a=".3em",l=-i,c=0,u="end"):(a=".6em",l=0,c=i,t?(h=90,u="start"):u="middle"),$r({position:{x:Math.round(l),y:Math.round(c)},angle:h,attrs:{".":{y:a,"text-anchor":u}}},r)}function uw(n,e,t,r){const i=r.offset!=null?r.offset:15,s=e.getCenter().theta(n),o=hw(e);let a,l,c,u,h=0;return s<o[1]||s>o[2]?(a=".3em",l=-i,c=0,u="end"):s<o[0]?(a=".6em",l=0,c=i,t?(h=90,u="start"):u="middle"):s<o[3]?(a=".3em",l=i,c=0,u="start"):(a="0em",l=0,c=-i,t?(h=-90,u="start"):u="middle"),$r({position:{x:Math.round(l),y:Math.round(c)},angle:h,attrs:{".":{y:a,"text-anchor":u}}},r)}function hw(n){const e=n.getCenter(),t=e.theta(n.getTopLeft()),r=e.theta(n.getBottomLeft()),i=e.theta(n.getBottomRight()),s=e.theta(n.getTopRight());return[t,s,i,r]}const t5=(n,e,t)=>fw(n.diff(e.getCenter()),!1,t),n5=(n,e,t)=>fw(n.diff(e.getCenter()),!0,t);function fw(n,e,t){const r=t.offset!=null?t.offset:20,i=new P(0,0),s=-n.theta(i),o=n.clone().move(i,r).diff(n).round();let a=".3em",l,c=s;return(s+90)%180===0?(l=e?"end":"middle",!e&&s===-270&&(a="0em")):s>-270&&s<-90?(l="start",c=s-180):l="end",$r({position:o.round().toJSON(),angle:e?c:0,attrs:{".":{y:a,"text-anchor":l}}},t)}const r5=Object.freeze(Object.defineProperty({__proto__:null,bottom:Kq,inside:Zq,insideOriented:e5,left:Wq,manual:Uq,outside:Jq,outsideOriented:Qq,radial:t5,radialOriented:n5,right:Xq,top:Yq},Symbol.toStringTag,{value:"Module"}));var Cs;(function(n){n.presets=r5,n.registry=Ue.create({type:"port label layout"}),n.registry.register(n.presets,!0)})(Cs||(Cs={}));class de extends wt{get priority(){return 2}constructor(){super(),this.cid=hf.uniqueId(),de.views[this.cid]=this}confirmUpdate(e,t){return 0}empty(e=this.container){return _o(e),this}unmount(e=this.container){return er(e),this}remove(e=this.container){return e===this.container&&(this.removeEventListeners(document),this.onRemove(),delete de.views[this.cid]),this.unmount(e),this}onRemove(){}setClass(e,t=this.container){t.classList.value=Array.isArray(e)?e.join(" "):e}addClass(e,t=this.container){return J(t,Array.isArray(e)?e.join(" "):e),this}removeClass(e,t=this.container){return gt(t,Array.isArray(e)?e.join(" "):e),this}setStyle(e,t=this.container){return pe(t,e),this}setAttrs(e,t=this.container){return e!=null&&t!=null&&he(t,e),this}findAttr(e,t=this.container){let r=t;for(;r&&r.nodeType===1;){const i=r.getAttribute(e);if(i!=null)return i;if(r===this.container)return null;r=r.parentNode}return null}find(e,t=this.container,r=this.selectors){return de.find(e,t,r).elems}findOne(e,t=this.container,r=this.selectors){const i=this.find(e,t,r);return i.length>0?i[0]:null}findByAttr(e,t=this.container){let r=t;for(;r&&r.getAttribute;){const i=r.getAttribute(e);if((i!=null||r===this.container)&&i!=="false")return r;r=r.parentNode}return null}getSelector(e,t){let r;if(e===this.container)return typeof t=="string"&&(r=`> ${t}`),r;if(e){const i=Uh(e)+1;r=`${e.tagName.toLowerCase()}:nth-child(${i})`,t&&(r+=` > ${t}`),r=this.getSelector(e.parentNode,r)}return r}prefixClassName(e){return sn.prefix(e)}delegateEvents(e,t){if(e==null)return this;t||this.undelegateEvents();const r=/^(\S+)\s*(.*)$/;return Object.keys(e).forEach(i=>{const s=i.match(r);if(s==null)return;const o=this.getEventHandler(e[i]);typeof o=="function"&&this.delegateEvent(s[1],s[2],o)}),this}undelegateEvents(){return Se.off(this.container,this.getEventNamespace()),this}delegateDocumentEvents(e,t){return this.addEventListeners(document,e,t),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(e,t,r){return Se.on(this.container,e+this.getEventNamespace(),t,r),this}undelegateEvent(e,t,r){const i=e+this.getEventNamespace();return t==null?Se.off(this.container,i):typeof t=="string"?Se.off(this.container,i,t,r):Se.off(this.container,i,t),this}addEventListeners(e,t,r){if(t==null)return this;const i=this.getEventNamespace();return Object.keys(t).forEach(s=>{const o=this.getEventHandler(t[s]);typeof o=="function"&&Se.on(e,s+i,r,o)}),this}removeEventListeners(e){return e!=null&&Se.off(e,this.getEventNamespace()),this}getEventNamespace(){return`.${sn.prefixCls}-event-${this.cid}`}getEventHandler(e){let t;if(typeof e=="string"){const r=this[e];typeof r=="function"&&(t=(...i)=>r.call(this,...i))}else t=(...r)=>e.call(this,...r);return t}getEventTarget(e,t={}){const{target:r,type:i,clientX:s=0,clientY:o=0}=e;return t.fromPoint||i==="touchmove"||i==="touchend"?document.elementFromPoint(s,o):r}stopPropagation(e){return this.setEventData(e,{propagationStopped:!0}),this}isPropagationStopped(e){return this.getEventData(e).propagationStopped===!0}getEventData(e){return this.eventData(e)}setEventData(e,t){return this.eventData(e,t)}eventData(e,t){if(e==null)throw new TypeError("Event object required");let r=e.data;const i=`__${this.cid}__`;return t==null?r==null?{}:r[i]||{}:(r==null&&(r=e.data={}),r[i]==null?r[i]=Object.assign({},t):r[i]=Object.assign(Object.assign({},r[i]),t),r[i])}normalizeEvent(e){return de.normalizeEvent(e)}}(function(n){function e(i,s){return s?Zn(i||"g"):Hh(i||"div")}n.createElement=e;function t(i,s,o){if(!i||i===".")return{elems:[s]};if(o){const a=o[i];if(a)return{elems:Array.isArray(a)?a:[a]}}{const a=i.includes(">")?`:scope ${i}`:i;return{isCSSSelector:!0,elems:Array.prototype.slice.call(s.querySelectorAll(a))}}}n.find=t;function r(i){let s=i;const o=i.originalEvent,a=o&&o.changedTouches&&o.changedTouches[0];if(a){for(const l in i)a[l]===void 0&&(a[l]=i[l]);s=a}return s}n.normalizeEvent=r})(de||(de={})),function(n){n.views={};function e(t){return n.views[t]||null}n.getView=e}(de||(de={}));var hf;(function(n){let e=0;function t(){const r=`v${e}`;return e+=1,r}n.uniqueId=t})(hf||(hf={}));class i5{constructor(e){this.view=e,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new rf,this.pathCache={}}get(e){return this.elemCache.has(e)||this.elemCache.set(e,{}),this.elemCache.get(e)}getData(e){const t=this.get(e);return t.data||(t.data={}),t.data}getMatrix(e){const t=this.get(e);if(t.matrix==null){const r=this.view.container;t.matrix=X4(e,r)}return ct(t.matrix)}getShape(e){const t=this.get(e);return t.shape==null&&(t.shape=fe.toGeometryShape(e)),t.shape.clone()}getBoundingRect(e){const t=this.get(e);return t.boundingRect==null&&(t.boundingRect=fe.getBBoxV2(e)),t.boundingRect.clone()}}var Pe;(function(n){function e(c){return c!=null&&!t(c)}n.isJSONMarkup=e;function t(c){return c!=null&&typeof c=="string"}n.isStringMarkup=t;function r(c){return c==null||t(c)?c:ze(c)}n.clone=r;function i(c){return`${c}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}n.sanitize=i;function s(c,u={ns:lt.svg}){const h=document.createDocumentFragment(),f={},d={},g=[{markup:Array.isArray(c)?c:[c],parent:h,ns:u.ns}];for(;g.length>0;){const p=g.pop();let b=p.ns||lt.svg;const m=p.markup,y=p.parent;m.forEach(v=>{const w=v.tagName;if(!w)throw new TypeError("Invalid tagName");v.ns&&(b=v.ns);const x=b?Hh(w,b):h1(w),C=v.attrs;C&&he(x,ko(C));const S=v.style;S&&pe(x,S);const E=v.className;E!=null&&x.setAttribute("class",Array.isArray(E)?E.join(" "):E),v.textContent&&(x.textContent=v.textContent);const A=v.selector;if(A!=null){if(d[A])throw new TypeError("Selector must be unique");d[A]=x}if(v.groupSelector){let T=v.groupSelector;Array.isArray(T)||(T=[T]),T.forEach(I=>{f[I]||(f[I]=[]),f[I].push(x)})}y.appendChild(x);const O=v.children;Array.isArray(O)&&g.push({ns:b,markup:O,parent:x})})}return Object.keys(f).forEach(p=>{if(d[p])throw new Error("Ambiguous group selector");d[p]=f[p]}),{fragment:h,selectors:d,groups:f}}n.parseJSONMarkup=s;function o(c){return c instanceof SVGElement?Zn("g"):h1("div")}function a(c){if(t(c)){const d=ee.createVectors(c),g=d.length;if(g===1)return{elem:d[0].node};if(g>1){const p=o(d[0].node);return d.forEach(b=>{p.appendChild(b.node)}),{elem:p}}return{}}const u=s(c),h=u.fragment;let f=null;return h.childNodes.length>1?(f=o(h.firstChild),f.appendChild(h)):f=h.firstChild,{elem:f,selectors:u.selectors}}n.renderMarkup=a;function l(c){const u=ee.createVectors(c),h=document.createDocumentFragment();for(let f=0,d=u.length;f<d;f+=1){const g=u[f].node;h.appendChild(g)}return{fragment:h,selectors:{}}}n.parseLabelStringMarkup=l})(Pe||(Pe={})),function(n){function e(t,r,i){if(t!=null){let s;const o=t.tagName.toLowerCase();if(t===r)return typeof i=="string"?s=`> ${o} > ${i}`:s=`> ${o}`,s;const a=t.parentNode;if(a&&a.childNodes.length>1){const l=Uh(t)+1;s=`${o}:nth-child(${l})`}else s=o;return i&&(s+=` > ${i}`),e(t.parentNode,r,s)}return i}n.getSelector=e}(Pe||(Pe={})),function(n){function e(){return"g"}n.getPortContainerMarkup=e;function t(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}n.getPortMarkup=t;function r(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}n.getPortLabelMarkup=r}(Pe||(Pe={})),function(n){function e(){return[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}]}n.getEdgeMarkup=e}(Pe||(Pe={})),function(n){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:lt.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:lt.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}n.getForeignObjectMarkup=e}(Pe||(Pe={}));class dw{constructor(e){this.view=e}get cell(){return this.view.cell}getDefinition(e){return this.cell.getAttrDefinition(e)}processAttrs(e,t){let r,i,s,o;const a=[];return Object.keys(t).forEach(l=>{const c=t[l],u=this.getDefinition(l),h=K(Bn.isValidDefinition,this.view,u,c,{elem:e,attrs:t,cell:this.cell,view:this.view});if(u&&h)typeof u=="string"?(r==null&&(r={}),r[u]=c):c!==null&&a.push({name:l,definition:u});else{r==null&&(r={});const f=m1.includes(l)?l:Ub(l);r[f]=c}}),a.forEach(({name:l,definition:c})=>{const u=t[l];typeof c.set=="function"&&(i==null&&(i={}),i[l]=u),typeof c.offset=="function"&&(s==null&&(s={}),s[l]=u),typeof c.position=="function"&&(o==null&&(o={}),o[l]=u)}),{raw:t,normal:r,set:i,offset:s,position:o}}mergeProcessedAttrs(e,t){e.set=Object.assign(Object.assign({},e.set),t.set),e.position=Object.assign(Object.assign({},e.position),t.position),e.offset=Object.assign(Object.assign({},e.offset),t.offset);const r=e.normal&&e.normal.transform;r!=null&&t.normal&&(t.normal.transform=r),e.normal=t.normal}findAttrs(e,t,r,i){const s=[],o=new rf;return Object.keys(e).forEach(a=>{const l=e[a];if(!Ln(l))return;const{isCSSSelector:c,elems:u}=de.find(a,t,i);r[a]=u;for(let h=0,f=u.length;h<f;h+=1){const d=u[h],g=i&&i[a]===d,p=o.get(d);if(p){p.array||(s.push(d),p.array=!0,p.attrs=[p.attrs],p.priority=[p.priority]);const b=p.attrs,m=p.priority;if(g)b.unshift(l),m.unshift(-1);else{const y=VV(m,c?-1:f);b.splice(y,0,l),m.splice(y,0,f)}}else o.set(d,{elem:d,attrs:l,priority:g?-1:f,array:!1})}}),s.forEach(a=>{const l=o.get(a),c=l.attrs;l.attrs=c.reduceRight((u,h)=>Ie(u,h),{})}),o}updateRelativeAttrs(e,t,r){const i=t.raw||{};let s=t.normal||{};const o=t.set,a=t.position,l=t.offset,c=()=>({elem:e,cell:this.cell,view:this.view,attrs:i,refBBox:r.clone()});if(o!=null&&Object.keys(o).forEach(b=>{const m=o[b],y=this.getDefinition(b);if(y!=null){const v=K(y.set,this.view,m,c());typeof v=="object"?s=Object.assign(Object.assign({},s),v):v!=null&&(s[b]=v)}}),e instanceof HTMLElement){this.view.setAttrs(s,e);return}const u=s.transform,h=u?`${u}`:null,f=ps(h),d=new P(f.e,f.f);u&&(delete s.transform,f.e=0,f.f=0);let g=!1;a!=null&&Object.keys(a).forEach(b=>{const m=a[b],y=this.getDefinition(b);if(y!=null){const v=K(y.position,this.view,m,c());v!=null&&(g=!0,d.translate(P.create(v)))}}),this.view.setAttrs(s,e);let p=!1;if(l!=null){const b=this.view.getBoundingRectOfElement(e);if(b.width>0&&b.height>0){const m=fe.transformRectangle(b,f);Object.keys(l).forEach(y=>{const v=l[y],w=this.getDefinition(y);if(w!=null){const x=K(w.offset,this.view,v,{elem:e,cell:this.cell,view:this.view,attrs:i,refBBox:m});x!=null&&(p=!0,d.translate(P.create(x)))}})}}(u!=null||g||p)&&(d.round(1),f.e=d.x,f.f=d.y,e.setAttribute("transform",ms(f)))}update(e,t,r){const i={},s=this.findAttrs(r.attrs||t,e,i,r.selectors),o=r.attrs?this.findAttrs(t,e,i,r.selectors):s,a=[];s.each(u=>{const h=u.elem,f=u.attrs,d=this.processAttrs(h,f);if(d.set==null&&d.position==null&&d.offset==null)this.view.setAttrs(d.normal,h);else{const g=o.get(h),p=g?g.attrs:null,b=p&&f.ref==null?p.ref:f.ref;let m;if(b){if(m=(i[b]||this.view.find(b,e,r.selectors))[0],!m)throw new Error(`"${b}" reference does not exist.`)}else m=null;const y={node:h,refNode:m,attributes:p,processedAttributes:d},v=a.findIndex(w=>w.refNode===h);v>-1?a.splice(v,0,y):a.push(y)}});const l=new rf;let c;a.forEach(u=>{const h=u.node,f=u.refNode;let d;const g=f!=null&&r.rotatableNode!=null&&d1(r.rotatableNode,f);if(f&&(d=l.get(f)),!d){const m=g?r.rotatableNode:e;d=f?fe.getBBox(f,{target:m}):r.rootBBox,f&&l.set(f,d)}let p;r.attrs&&u.attributes?(p=this.processAttrs(h,u.attributes),this.mergeProcessedAttrs(p,u.processedAttributes)):p=u.processedAttributes;let b=d;g&&r.rotatableNode!=null&&!r.rotatableNode.contains(h)&&(c||(c=ps(he(r.rotatableNode,"transform"))),b=fe.transformRectangle(d,c)),this.updateRelativeAttrs(h,p,b)})}}class gw{get cell(){return this.view.cell}constructor(e,t,r=[]){this.view=e;const i={},s={};let o=0;Object.keys(t).forEach(l=>{let c=t[l];Array.isArray(c)||(c=[c]),c.forEach(u=>{let h=i[u];h||(o+=1,h=i[u]=1<<o),s[l]|=h})});let a=r;if(Array.isArray(a)||(a=[a]),a.forEach(l=>{i[l]||(o+=1,i[l]=1<<o)}),o>25)throw new Error("Maximum number of flags exceeded.");this.flags=i,this.attrs=s,this.bootstrap=r}getFlag(e){const t=this.flags;return t==null?0:Array.isArray(e)?e.reduce((r,i)=>r|t[i],0):t[e]|0}hasAction(e,t){return e&this.getFlag(t)}removeAction(e,t){return e^e&this.getFlag(t)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let e=0;return this.attrs&&Object.keys(this.attrs).forEach(t=>{this.cell.hasChanged(t)&&(e|=this.attrs[t])}),e}}var s5=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class rt extends de{static getDefaults(){return this.defaults}static config(e){this.defaults=this.getOptions(e)}static getOptions(e){const t=(c,u)=>u!=null?Bb([...Array.isArray(c)?c:[c],...Array.isArray(u)?u:[u]]):Array.isArray(c)?[...c]:[c],r=ze(this.getDefaults()),{bootstrap:i,actions:s,events:o,documentEvents:a}=e,l=s5(e,["bootstrap","actions","events","documentEvents"]);return i&&(r.bootstrap=t(r.bootstrap,i)),s&&Object.entries(s).forEach(([c,u])=>{const h=r.actions[c];u&&h?r.actions[c]=t(h,u):u&&(r.actions[c]=t(u))}),o&&(r.events=Object.assign(Object.assign({},r.events),o)),e.documentEvents&&(r.documentEvents=Object.assign(Object.assign({},r.documentEvents),a)),Ie(r,l)}get[Symbol.toStringTag](){return rt.toStringTag}constructor(e,t={}){super(),this.cell=e,this.options=this.ensureOptions(t),this.graph=this.options.graph,this.attr=new dw(this),this.flag=new gw(this,this.options.actions,this.options.bootstrap),this.cache=new i5(this),this.setContainer(this.ensureContainer()),this.setup(),this.init()}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(e){return this.getConstructor().getOptions(e)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return de.createElement(this.getContainerTagName(),this.options.isSvgElement)}setContainer(e){if(this.container!==e){this.undelegateEvents(),this.container=e,this.options.events!=null&&this.delegateEvents(this.options.events);const t=this.getContainerAttrs();t!=null&&this.setAttrs(t,e);const r=this.getContainerStyle();r!=null&&this.setStyle(r,e);const i=this.getContainerClassName();i!=null&&this.addClass(i,e)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(e,t={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(e){return this.flag.getFlag(e)}hasAction(e,t){return this.flag.hasAction(e,t)}removeAction(e,t){return this.flag.removeAction(e,t)}handleAction(e,t,r,i){if(this.hasAction(e,t)){r();const s=[t];return i&&(typeof i=="string"?s.push(i):s.push(...i)),this.removeAction(e,s)}return e}setup(){this.cell.on("changed",({options:e})=>this.onAttrsChange(e))}onAttrsChange(e){let t=this.flag.getChangedFlag();e.updated||!t||(e.dirty&&this.hasAction(t,"update")&&(t|=this.getFlag("render")),e.toolId&&(e.async=!1),this.graph!=null&&this.graph.renderer.requestViewUpdate(this,t,e))}parseJSONMarkup(e,t){const r=Pe.parseJSONMarkup(e),i=r.selectors,s=this.rootSelector;if(t&&s){if(i[s])throw new Error("Invalid root selector");i[s]=t}return r}can(e){let t=this.graph.options.interacting;if(typeof t=="function"&&(t=K(t,this.graph,this)),typeof t=="object"){let r=t[e];return typeof r=="function"&&(r=K(r,this.graph,this)),r!==!1}return typeof t=="boolean"?t:!1}cleanCache(){return this.cache.clean(),this}getCache(e){return this.cache.get(e)}getDataOfElement(e){return this.cache.getData(e)}getMatrixOfElement(e){return this.cache.getMatrix(e)}getShapeOfElement(e){return this.cache.getShape(e)}getBoundingRectOfElement(e){return this.cache.getBoundingRect(e)}getBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),r=this.getMatrixOfElement(e),i=this.getRootRotatedMatrix(),s=this.getRootTranslatedMatrix();return fe.transformRectangle(t,s.multiply(i).multiply(r))}getUnrotatedBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),r=this.getMatrixOfElement(e),i=this.getRootTranslatedMatrix();return fe.transformRectangle(t,i.multiply(r))}getBBox(e={}){let t;if(e.useCellGeometry){const r=this.cell,i=r.isNode()?r.getAngle():0;t=r.getBBox().bbox(i)}else t=this.getBBoxOfElement(this.container);return this.graph.coord.localToGraphRect(t)}getRootTranslatedMatrix(){const e=this.cell,t=e.isNode()?e.getPosition():{x:0,y:0};return ct().translate(t.x,t.y)}getRootRotatedMatrix(){let e=ct();const t=this.cell,r=t.isNode()?t.getAngle():0;if(r){const i=t.getBBox(),s=i.width/2,o=i.height/2;e=e.translate(s,o).rotate(r).translate(-s,-o)}return e}findMagnet(e=this.container){return this.findByAttr("magnet",e)}updateAttrs(e,t,r={}){r.rootBBox==null&&(r.rootBBox=new D),r.selectors==null&&(r.selectors=this.selectors),this.attr.update(e,t,r)}isEdgeElement(e){return this.cell.isEdge()&&(e==null||e===this.container)}prepareHighlight(e,t={}){const r=e||this.container;return t.partial=r===this.container,r}highlight(e,t={}){const r=this.prepareHighlight(e,t);return this.notify("cell:highlight",{magnet:r,options:t,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:r,options:t,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:r,options:t,view:this,node:this.cell,cell:this.cell}),this}unhighlight(e,t={}){const r=this.prepareHighlight(e,t);return this.notify("cell:unhighlight",{magnet:r,options:t,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:r,options:t,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:r,options:t,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(e,t){}getEdgeTerminal(e,t,r,i,s){const o=this.cell,a=this.findAttr("port",e),l=e.getAttribute("data-selector"),c={cell:o.id};return l!=null&&(c.magnet=l),a!=null?(c.port=a,o.isNode()&&!o.hasPort(a)&&l==null&&(c.selector=this.getSelector(e))):l==null&&this.container!==e&&(c.selector=this.getSelector(e)),c}getMagnetFromEdgeTerminal(e){const t=this.cell,r=this.container,i=e.port;let s=e.magnet,o;return i!=null&&t.isNode()&&t.hasPort(i)?o=this.findPortElem(i,s)||r:(s||(s=e.selector),!s&&i!=null&&(s=`[port="${i}"]`),o=this.findOne(s,r,this.selectors)),o}hasTools(e){const t=this.tools;return t==null?!1:e==null?!0:t.name===e}addTools(e){if(!this.can("toolsAddable"))return this;if(this.removeTools(),e){const t=et.isToolsView(e)?e:new et(e);this.tools=t,t.config({view:this}),t.mount()}return this}updateTools(e={}){return this.tools&&this.tools.update(e),this}removeTools(){return this.tools&&(this.tools.remove(),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){const e=this.cell.getTools();return this.addTools(e),this}notify(e,t){return this.trigger(e,t),this.graph.trigger(e,t),this}getEventArgs(e,t,r){const i=this,s=i.cell;return t==null||r==null?{e,view:i,cell:s}:{e,x:t,y:r,view:i,cell:s}}onClick(e,t,r){this.notify("cell:click",this.getEventArgs(e,t,r))}onDblClick(e,t,r){this.notify("cell:dblclick",this.getEventArgs(e,t,r))}onContextMenu(e,t,r){this.notify("cell:contextmenu",this.getEventArgs(e,t,r))}onMouseDown(e,t,r){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(e,t,r))}onMouseUp(e,t,r){this.notify("cell:mouseup",this.getEventArgs(e,t,r)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(e,t,r){this.notify("cell:mousemove",this.getEventArgs(e,t,r))}onMouseOver(e){this.notify("cell:mouseover",this.getEventArgs(e))}onMouseOut(e){this.notify("cell:mouseout",this.getEventArgs(e))}onMouseEnter(e){this.notify("cell:mouseenter",this.getEventArgs(e))}onMouseLeave(e){this.notify("cell:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,r,i){this.notify("cell:mousewheel",Object.assign({delta:i},this.getEventArgs(e,t,r)))}onCustomEvent(e,t,r,i){this.notify("cell:customevent",Object.assign({name:t},this.getEventArgs(e,r,i))),this.notify(t,Object.assign({},this.getEventArgs(e,r,i)))}onMagnetMouseDown(e,t,r,i){}onMagnetDblClick(e,t,r,i){}onMagnetContextMenu(e,t,r,i){}onLabelMouseDown(e,t,r){}checkMouseleave(e){const t=this.getEventTarget(e,{fromPoint:!0}),r=this.graph.findViewByElem(t);r!==this&&(this.onMouseLeave(e),r&&r.onMouseEnter(e))}}rt.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},function(n){n.Flag=gw,n.Attr=dw}(rt||(rt={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNodeView=="function"&&typeof i.isEdgeView=="function"&&typeof i.confirmUpdate=="function"}n.isCellView=e}(rt||(rt={})),function(n){function e(r){return function(i){i.config({priority:r})}}n.priority=e;function t(r){return function(i){i.config({bootstrap:r})}}n.bootstrap=t}(rt||(rt={})),function(n){n.registry=Ue.create({type:"view"})}(rt||(rt={}));class et extends de{get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return et.toStringTag}constructor(e={}){super(),this.svgContainer=this.createContainer(!0,e),this.htmlContainer=this.createContainer(!1,e),this.config(e)}createContainer(e,t){const r=e?de.createElement("g",!0):de.createElement("div",!1);return J(r,this.prefixClassName("cell-tools")),t.className&&J(r,t.className),r}config(e){if(this.options=Object.assign(Object.assign({},this.options),e),!rt.isCellView(e.view)||e.view===this.cellView)return this;this.cellView=e.view,this.cell.isEdge()?(J(this.svgContainer,this.prefixClassName("edge-tools")),J(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(J(this.svgContainer,this.prefixClassName("node-tools")),J(this.htmlContainer,this.prefixClassName("node-tools"))),this.svgContainer.setAttribute("data-cell-id",this.cell.id),this.htmlContainer.setAttribute("data-cell-id",this.cell.id),this.name&&(this.svgContainer.setAttribute("data-tools-name",this.name),this.htmlContainer.setAttribute("data-tools-name",this.name));const t=this.options.items;if(!Array.isArray(t))return this;this.tools=[];const r=[];t.forEach(i=>{et.ToolItem.isToolItem(i)?i.name==="vertices"?r.unshift(i):r.push(i):(typeof i=="object"?i.name:i)==="vertices"?r.unshift(i):r.push(i)});for(let i=0;i<r.length;i+=1){const s=r[i];let o;if(et.ToolItem.isToolItem(s))o=s;else{const a=typeof s=="object"?s.name:s,l=typeof s=="object"?s.args||{}:{};if(a){if(this.cell.isNode()){const c=Ps.registry.get(a);if(c)o=new c(l);else return Ps.registry.onNotFound(a)}else if(this.cell.isEdge()){const c=Es.registry.get(a);if(c)o=new c(l);else return Es.registry.onNotFound(a)}}}o&&(o.config(this.cellView,this),o.render(),(o.options.isSVGElement!==!1?this.svgContainer:this.htmlContainer).appendChild(o.container),this.tools.push(o))}return this}update(e={}){const t=this.tools;return t&&t.forEach(r=>{e.toolId!==r.cid&&r.isVisible()&&r.update()}),this}focus(e){const t=this.tools;return t&&t.forEach(r=>{e===r?r.show():r.hide()}),this}blur(e){const t=this.tools;return t&&t.forEach(r=>{r!==e&&!r.isVisible()&&(r.show(),r.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const e=this.tools;return e&&(e.forEach(t=>t.remove()),this.tools=null),er(this.svgContainer),er(this.htmlContainer),super.remove()}mount(){const e=this.tools,t=this.cellView;if(t&&e){const r=e.some(s=>s.options.isSVGElement!==!1),i=e.some(s=>s.options.isSVGElement===!1);r&&(this.options.local?t.container:t.graph.view.decorator).appendChild(this.svgContainer),i&&this.graph.container.appendChild(this.htmlContainer)}return this}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&i.graph!=null&&i.cell!=null&&typeof i.config=="function"&&typeof i.update=="function"&&typeof i.focus=="function"&&typeof i.blur=="function"&&typeof i.show=="function"&&typeof i.hide=="function"}n.isToolsView=e})(et||(et={})),function(n){class e extends de{static getDefaults(){return this.defaults}static config(r){this.defaults=this.getOptions(r)}static getOptions(r){return Ie(ze(this.getDefaults()),r)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return e.toStringTag}constructor(r={}){super(),this.visible=!0,this.options=this.getOptions(r),this.container=de.createElement(this.options.tagName||"g",this.options.isSVGElement!==!1),J(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&J(this.container,this.options.className),this.init()}init(){}getOptions(r){return this.constructor.getOptions(r)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(r,i){return this.cellView=r,this.parent=i,this.stamp(this.container),this.cell.isEdge()?J(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&J(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();const r=this.options.markup;if(r){const i=Pe.parseJSONMarkup(r);this.container.appendChild(i.fragment),this.childNodes=i.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(r){r&&r.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return this.visible}focus(){const r=this.options.focusOpacity;return r!=null&&Number.isFinite(r)&&(this.container.style.opacity=`${r}`),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(r){return this.graph==null||this.cellView==null?!0:this.graph.view.guard(r,this.cellView)}}e.defaults={isSVGElement:!0,tagName:"g"},n.ToolItem=e,function(t){let r=0;function i(o){return o?Dh(o):(r+=1,`CustomTool${r}`)}function s(o){const a=Rh(i(o.name),this);return a.config(o),a}t.define=s}(e=n.ToolItem||(n.ToolItem={})),function(t){t.toStringTag=`X6.${t.name}`;function r(i){if(i==null)return!1;if(i instanceof t)return!0;const s=i[Symbol.toStringTag],o=i;return(s==null||s===t.toStringTag)&&o.graph!=null&&o.cell!=null&&typeof o.config=="function"&&typeof o.update=="function"&&typeof o.focus=="function"&&typeof o.blur=="function"&&typeof o.show=="function"&&typeof o.hide=="function"&&typeof o.isVisible=="function"}t.isToolItem=r}(e=n.ToolItem||(n.ToolItem={}))}(et||(et={}));const o5=n=>n;function pw(n,e){return e===0?"0%":`${Math.round(n/e*100)}%`}function mw(n){return(t,r,i,s)=>r.isEdgeElement(i)?l5(n,t,r,i,s):a5(n,t,r,i,s)}function a5(n,e,t,r,i){const s=t.cell,o=s.getAngle(),a=t.getUnrotatedBBoxOfElement(r),l=s.getBBox().getCenter(),c=P.create(i).rotate(o,l);let u=c.x-a.x,h=c.y-a.y;return n&&(u=pw(u,a.width),h=pw(h,a.height)),e.anchor={name:"topLeft",args:{dx:u,dy:h,rotate:!0}},e}function l5(n,e,t,r,i){const s=t.getConnection();if(!s)return e;const o=s.closestPointLength(i);if(n){const a=s.length();e.anchor={name:"ratio",args:{ratio:o/a}}}else e.anchor={name:"length",args:{length:o}};return e}const c5=mw(!0),u5=mw(!1),h5=Object.freeze(Object.defineProperty({__proto__:null,noop:o5,pinAbsolute:u5,pinRelative:c5},Symbol.toStringTag,{value:"Module"}));var ff;(function(n){n.presets=h5,n.registry=Ue.create({type:"connection strategy"}),n.registry.register(n.presets,!0)})(ff||(ff={}));function yw(n,e,t,r){return K(ff.presets.pinRelative,this.graph,{},e,t,n,this.cell,r,{}).anchor}function vw(n,e){return e?n.cell.getBBox():n.cell.isEdge()?n.getConnection().bbox():n.getUnrotatedBBoxOfElement(n.container)}class Ir extends et.ToolItem{onRender(){J(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const t=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();ys(this.container,t,{absolute:!0})}getNodeMatrix(){const e=this.cellView,t=this.options;let{x:r=0,y:i=0}=t;const{offset:s,useCellGeometry:o,rotate:a}=t;let l=vw(e,o);const c=e.cell.getAngle();a||(l=l.bbox(c));let u=0,h=0;typeof s=="number"?(u=s,h=s):typeof s=="object"&&(u=s.x,h=s.y),r=Vt(r,l.width),i=Vt(i,l.height);let f=ct().translate(l.x+l.width/2,l.y+l.height/2);return a&&(f=f.rotate(c)),f=f.translate(r+u-l.width/2,i+h-l.height/2),f}getEdgeMatrix(){const e=this.cellView,t=this.options,{offset:r=0,distance:i=0,rotate:s}=t;let o,a,l;const c=Vt(i,1);c>=0&&c<=1?o=e.getTangentAtRatio(c):o=e.getTangentAtLength(c),o?(a=o.start,l=o.vector().vectorAngle(new P(1,0))||0):(a=e.getConnection().start,l=0);let u=ct().translate(a.x,a.y).rotate(l);return typeof r=="object"?u=u.translate(r.x||0,r.y||0):u=u.translate(0,r),s||(u=u.rotate(-l)),u}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();const t=this.options.onClick;typeof t=="function"&&K(t,this.cellView,{e,view:this.cellView,cell:this.cellView.cell,btn:this})}}(function(n){n.config({name:"button",useCellGeometry:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}})})(Ir||(Ir={})),function(n){n.Remove=n.define({name:"button-remove",markup:[{tagName:"circle",selector:"button",attrs:{r:7,fill:"#FF1D00",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -3 -3 3 3 M -3 3 3 -3",fill:"none",stroke:"#FFFFFF","stroke-width":2,"pointer-events":"none"}}],distance:60,offset:0,useCellGeometry:!0,onClick({view:e,btn:t}){t.parent.remove(),e.cell.remove({ui:!0,toolId:t.cid})}})}(Ir||(Ir={}));var f5=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class Xl extends et.ToolItem{onRender(){if(J(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const e=this.options.attrs,{class:t}=e,r=f5(e,["class"]);he(this.container,ko(r)),t&&J(this.container,t)}this.update()}update(){const e=this.cellView,t=this.options,{useCellGeometry:r,rotate:i}=t,s=Rn(t.padding);let o=vw(e,r).moveAndExpand({x:-s.left,y:-s.top,width:s.left+s.right,height:s.top+s.bottom});const a=e.cell;if(a.isNode()){const l=a.getAngle();if(l)if(i){const c=a.getBBox().getCenter();ef(this.container,l,c.x,c.y,{absolute:!0})}else o=o.bbox(l)}return he(this.container,o.toJSON()),this}}(function(n){n.config({name:"boundary",tagName:"rect",padding:10,useCellGeometry:!0,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}})})(Xl||(Xl={}));class Uo extends et.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){return this.vertices.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){const e=this.handles;this.handles=[],e&&e.forEach(t=>{this.stopHandleListening(t),t.remove()})}renderHandles(){const e=this.vertices;for(let t=0,r=e.length;t<r;t+=1){const i=e[t],s=this.options.createHandle,o=this.options.processHandle,a=s({index:t,graph:this.graph,guard:l=>this.guard(l),attrs:this.options.attrs||{}});o&&o(a),a.updatePosition(i.x,i.y),this.stamp(a.container),this.container.appendChild(a.container),this.handles.push(a),this.startHandleListening(a)}}updateHandles(){const e=this.vertices;for(let t=0,r=e.length;t<r;t+=1){const i=e[t],s=this.handles[t];s&&s.updatePosition(i.x,i.y)}}updatePath(){const e=this.childNodes.connection;e&&e.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(e){const t=this.cellView;t.can("vertexMovable")&&(e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.on("remove",this.onHandleRemove,this)}stopHandleListening(e){const t=this.cellView;t.can("vertexMovable")&&(e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.off("remove",this.onHandleRemove,this)}getNeighborPoints(e){const t=this.cellView,r=this.vertices,i=e>0?r[e-1]:t.sourceAnchor,s=e<r.length-1?r[e+1]:t.targetAnchor;return{prev:P.create(i),next:P.create(s)}}getMouseEventArgs(e){const t=this.normalizeEvent(e),{x:r,y:i}=this.graph.snapToGrid(t.clientX,t.clientY);return{e:t,x:r,y:i}}onHandleChange({e}){this.focus();const t=this.cellView;if(t.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:r,x:i,y:s}=this.getMouseEventArgs(e);t.notifyMouseDown(r,i,s)}}onHandleChanging({handle:e,e:t}){const r=this.cellView,i=e.options.index,{e:s,x:o,y:a}=this.getMouseEventArgs(t),l={x:o,y:a};this.snapVertex(l,i),r.cell.setVertexAt(i,l,{ui:!0,toolId:this.cid}),e.updatePosition(l.x,l.y),this.options.stopPropagation||r.notifyMouseMove(s,o,a)}stopBatch(e){this.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),e&&this.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid})}onHandleChanged({e}){const t=this.options,r=this.cellView;if(t.addable&&this.updatePath(),!t.removeRedundancies){this.stopBatch(this.eventData(e).vertexAdded);return}r.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&this.render(),this.blur(),this.stopBatch(this.eventData(e).vertexAdded);const{e:s,x:o,y:a}=this.getMouseEventArgs(e);this.options.stopPropagation||r.notifyMouseUp(s,o,a),r.checkMouseleave(s),t.onChanged&&t.onChanged({edge:r.cell,edgeView:r})}snapVertex(e,t){const r=this.options.snapRadius||0;if(r>0){const i=this.getNeighborPoints(t),s=i.prev,o=i.next;Math.abs(e.x-s.x)<r?e.x=s.x:Math.abs(e.x-o.x)<r&&(e.x=o.x),Math.abs(e.y-s.y)<r?e.y=i.prev.y:Math.abs(e.y-o.y)<r&&(e.y=o.y)}}onHandleRemove({handle:e,e:t}){if(this.options.removable){const r=e.options.index,i=this.cellView;i.cell.removeVertexAt(r,{ui:!0}),this.options.addable&&this.updatePath(),i.checkMouseleave(this.normalizeEvent(t))}}allowAddVertex(e){const t=this.guard(e),r=this.options.addable&&this.cellView.can("vertexAddable"),i=this.options.modifiers?nr.isMatch(e,this.options.modifiers):!0;return!t&&r&&i}onPathMouseDown(e){const t=this.cellView;if(!this.allowAddVertex(e))return;e.stopPropagation(),e.preventDefault();const r=this.normalizeEvent(e),i=this.graph.snapToGrid(r.clientX,r.clientY).toJSON();t.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const s=t.getVertexIndex(i.x,i.y);this.snapVertex(i,s),t.cell.insertVertex(i,s,{ui:!0,toolId:this.cid}),this.render();const o=this.handles[s];this.eventData(r,{vertexAdded:!0}),o.onMouseDown(r)}onRemove(){this.resetHandles()}}(function(n){class e extends de{get graph(){return this.options.graph}constructor(r){super(),this.options=r,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}render(){this.container=de.createElement("circle",!0);const r=this.options.attrs;if(typeof r=="function"){const i=n.getDefaults();this.setAttrs(Object.assign(Object.assign({},i.attrs),r(this)))}else this.setAttrs(r);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(r,i){this.setAttrs({cx:r,cy:i})}onMouseDown(r){this.options.guard(r)||(r.stopPropagation(),r.preventDefault(),this.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},r.data),this.emit("change",{e:r,handle:this}))}onMouseMove(r){this.emit("changing",{e:r,handle:this})}onMouseUp(r){this.emit("changed",{e:r,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(r){this.emit("remove",{e:r,handle:this})}}n.Handle=e})(Uo||(Uo={})),function(n){const e=sn.prefix("edge-tool-vertex-path");n.config({name:"vertices",snapRadius:20,addable:!0,removable:!0,removeRedundancies:!0,stopPropagation:!0,attrs:{r:6,fill:"#333",stroke:"#fff",cursor:"move","stroke-width":2},createHandle:t=>new n.Handle(t),markup:[{tagName:"path",selector:"connection",className:e,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${e}`]:"onPathMouseDown",[`touchstart .${e}`]:"onPathMouseDown"}})}(Uo||(Uo={}));class Wo extends et.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){J(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const e=this.cellView,t=[...this.vertices];t.unshift(e.sourcePoint),t.push(e.targetPoint);for(let r=0,i=t.length;r<i-1;r+=1){const s=t[r],o=t[r+1],a=this.renderHandle(s,o,r);this.stamp(a.container),this.handles.push(a)}return this}renderHandle(e,t,r){const i=this.options.createHandle({index:r,graph:this.graph,guard:s=>this.guard(s),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(i),this.updateHandle(i,e,t),this.container.appendChild(i.container),this.startHandleListening(i),i}startHandleListening(e){e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)}stopHandleListening(e){e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)}resetHandles(){const e=this.handles;this.handles=[],e&&e.forEach(t=>{this.stopHandleListening(t),t.remove()})}shiftHandleIndexes(e){const t=this.handles;for(let r=0,i=t.length;r<i;r+=1)t[r].options.index+=e}resetAnchor(e,t){const r=this.cellView.cell,i={ui:!0,toolId:this.cid};t?r.prop([e,"anchor"],t,i):r.removeProp([e,"anchor"],i)}snapHandle(e,t,r){const i=e.options.axis,s=e.options.index,l=this.cellView.cell.getVertices(),c=l[s-2]||r.sourceAnchor,u=l[s+1]||r.targetAnchor,h=this.options.snapRadius;return Math.abs(t[i]-c[i])<h?t[i]=c[i]:Math.abs(t[i]-u[i])<h&&(t[i]=u[i]),t}onHandleChanging({handle:e,e:t}){const r=this.graph,i=this.options,s=this.cellView,o=i.anchor,a=e.options.axis,l=e.options.index-1,c=this.getEventData(t),u=this.normalizeEvent(t),h=r.snapToGrid(u.clientX,u.clientY),f=this.snapHandle(e,h.clone(),c),d=ze(this.vertices);let g=d[l],p=d[l+1];const b=s.sourceView,m=s.sourceBBox;let y=!1,v=!1;if(g?l===0?m.containsPoint(g)?(d.shift(),this.shiftHandleIndexes(-1),y=!0):(g[a]=f[a],v=!0):g[a]=f[a]:(g=s.sourceAnchor.toJSON(),g[a]=f[a],m.containsPoint(g)?y=!0:(d.unshift(g),this.shiftHandleIndexes(1),v=!0)),typeof o=="function"&&b){if(y){const E=c.sourceAnchor.clone();E[a]=f[a];const A=K(o,s,E,b,s.sourceMagnet||b.container,"source",s,this);this.resetAnchor("source",A)}v&&this.resetAnchor("source",c.sourceAnchorDef)}const w=s.targetView,x=s.targetBBox;let C=!1,S=!1;if(p?l===d.length-2?x.containsPoint(p)?(d.pop(),C=!0):(p[a]=f[a],S=!0):p[a]=f[a]:(p=s.targetAnchor.toJSON(),p[a]=f[a],x.containsPoint(p)?C=!0:(d.push(p),S=!0)),typeof o=="function"&&w){if(C){const E=c.targetAnchor.clone();E[a]=f[a];const A=K(o,s,E,w,s.targetMagnet||w.container,"target",s,this);this.resetAnchor("target",A)}S&&this.resetAnchor("target",c.targetAnchorDef)}P.equalPoints(d,this.vertices)||this.cellView.cell.setVertices(d,{ui:!0,toolId:this.cid}),this.updateHandle(e,g,p,0),i.stopPropagation||s.notifyMouseMove(u,h.x,h.y)}onHandleChange({handle:e,e:t}){const r=this.options,i=this.handles,s=this.cellView,o=e.options.index;if(Array.isArray(i)){for(let a=0,l=i.length;a<l;a+=1)a!==o&&i[a].hide();if(this.focus(),this.setEventData(t,{sourceAnchor:s.sourceAnchor.clone(),targetAnchor:s.targetAnchor.clone(),sourceAnchorDef:ze(this.cell.prop(["source","anchor"])),targetAnchorDef:ze(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!r.stopPropagation){const a=this.normalizeEvent(t),l=this.graph.snapToGrid(a.clientX,a.clientY);s.notifyMouseDown(a,l.x,l.y)}}}onHandleChanged({e}){const t=this.options,r=this.cellView;t.removeRedundancies&&r.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const i=this.normalizeEvent(e),s=this.graph.snapToGrid(i.clientX,i.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),t.stopPropagation||r.notifyMouseUp(i,s.x,s.y),r.checkMouseleave(i),t.onChanged&&t.onChanged({edge:r.cell,edgeView:r})}updateHandle(e,t,r,i=0){const s=this.options.precision||0,o=Math.abs(t.x-r.x)<s,a=Math.abs(t.y-r.y)<s;if(o||a){const l=new F(t,r);if(l.length()<this.options.threshold)e.hide();else{const u=l.getCenter(),h=o?"x":"y";u[h]+=i||0;const f=l.vector().vectorAngle(new P(1,0));e.updatePosition(u.x,u.y,f,this.cellView),e.show(),e.options.axis=h}}else e.hide()}onRemove(){this.resetHandles()}}(function(n){class e extends de{constructor(r){super(),this.options=r,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=de.createElement("rect",!0);const r=this.options.attrs;if(typeof r=="function"){const i=n.getDefaults();this.setAttrs(Object.assign(Object.assign({},i.attrs),r(this)))}else this.setAttrs(r);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(r,i,s,o){const a=o.getClosestPoint(new P(r,i))||new P(r,i);let l=ct().translate(a.x,a.y);if(a.equals({x:r,y:i}))l=l.rotate(s);else{let u=new F(r,i,a.x,a.y).vector().vectorAngle(new P(1,0));u!==0&&(u+=90),l=l.rotate(u)}this.setAttrs({transform:ms(l),cursor:s%180===0?"row-resize":"col-resize"})}onMouseDown(r){this.options.guard(r)||(this.trigger("change",{e:r,handle:this}),r.stopPropagation(),r.preventDefault(),this.options.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},r.data))}onMouseMove(r){this.emit("changing",{e:r,handle:this})}onMouseUp(r){this.emit("changed",{e:r,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}}n.Handle=e})(Wo||(Wo={})),function(n){n.config({name:"segments",precision:.5,threshold:40,snapRadius:10,stopPropagation:!0,removeRedundancies:!0,attrs:{width:20,height:8,x:-10,y:-4,rx:4,ry:4,fill:"#333",stroke:"#fff","stroke-width":2},createHandle:e=>new n.Handle(e),anchor:yw})}(Wo||(Wo={}));class Yl extends et.ToolItem{get type(){return this.options.type}onRender(){J(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const e=this.type;return this.cellView.getTerminalView(e)?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const e=this.childNodes;if(!e)return;const t=e.anchor;if(!t)return;const r=this.type,i=this.cellView,s=this.options,o=i.getTerminalAnchor(r),a=i.cell.prop([r,"anchor"]);t.setAttribute("transform",`translate(${o.x}, ${o.y})`);const l=a?s.customAnchorAttrs:s.defaultAnchorAttrs;l&&Object.keys(l).forEach(c=>{t.setAttribute(c,l[c])})}updateArea(){const e=this.childNodes;if(!e)return;const t=e.area;if(!t)return;const r=this.type,i=this.cellView,s=i.getTerminalView(r);if(s){const o=s.cell,a=i.getTerminalMagnet(r);let l=this.options.areaPadding||0;Number.isFinite(l)||(l=0);let c,u,h;s.isEdgeElement(a)?(c=s.getBBox(),u=0,h=c.getCenter()):(c=s.getUnrotatedBBoxOfElement(a),u=o.getAngle(),h=c.getCenter(),u&&h.rotate(-u,o.getBBox().getCenter())),c.inflate(l),he(t,{x:-c.width/2,y:-c.height/2,width:c.width,height:c.height,transform:`translate(${h.x}, ${h.y}) rotate(${u})`})}}toggleArea(e){if(this.childNodes){const t=this.childNodes.area;t&&(t.style.display=e?"":"none")}}onMouseDown(e){this.guard(e)||(e.stopPropagation(),e.preventDefault(),this.graph.view.undelegateEvents(),this.options.documentEvents&&this.delegateDocumentEvents(this.options.documentEvents),this.focus(),this.toggleArea(this.options.restrictArea),this.cell.startBatch("move-anchor",{ui:!0,toolId:this.cid}))}resetAnchor(e){const t=this.type,r=this.cell;e?r.prop([t,"anchor"],e,{rewrite:!0,ui:!0,toolId:this.cid}):r.removeProp([t,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(e){const t=this.type,r=this.cellView,i=r.getTerminalView(t);if(i==null)return;const s=this.normalizeEvent(e),o=i.cell,a=r.getTerminalMagnet(t);let l=this.graph.coord.clientToLocalPoint(s.clientX,s.clientY);const c=this.options.snap;if(typeof c=="function"){const f=K(c,r,l,i,a,t,r,this);l=P.create(f)}if(this.options.restrictArea)if(i.isEdgeElement(a)){const f=i.getClosestPoint(l);f&&(l=f)}else{const f=i.getUnrotatedBBoxOfElement(a),d=o.getAngle(),g=o.getBBox().getCenter(),p=l.clone().rotate(d,g);f.containsPoint(p)||(l=f.getNearestPointToPoint(p).rotate(-d,g))}let u;const h=this.options.anchor;typeof h=="function"&&(u=K(h,r,l,i,a,t,r,this)),this.resetAnchor(u),this.update()}onMouseUp(e){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const t=this.cellView;this.options.removeRedundancies&&t.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const e=this.options.resetAnchor;e&&this.resetAnchor(e===!0?void 0:e),this.update()}}(function(n){n.config({tagName:"g",markup:[{tagName:"circle",selector:"anchor",attrs:{cursor:"pointer"}},{tagName:"rect",selector:"area",attrs:{"pointer-events":"none",fill:"none",stroke:"#33334F","stroke-dasharray":"2,4",rx:5,ry:5}}],events:{mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDblClick"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},customAnchorAttrs:{"stroke-width":4,stroke:"#33334F",fill:"#FFFFFF",r:5},defaultAnchorAttrs:{"stroke-width":2,stroke:"#FFFFFF",fill:"#33334F",r:6},areaPadding:6,snapRadius:10,resetAnchor:!0,restrictArea:!0,removeRedundancies:!0,anchor:yw,snap(e,t,r,i,s,o){const a=o.options.snapRadius||0,l=i==="source",c=l?0:-1,u=this.cell.getVertexAt(c)||this.getTerminalAnchor(l?"target":"source");return u&&(Math.abs(u.x-e.x)<a&&(e.x=u.x),Math.abs(u.y-e.y)<a&&(e.y=u.y)),e}})})(Yl||(Yl={}));const d5=Yl.define({name:"source-anchor",type:"source"}),g5=Yl.define({name:"target-anchor",type:"target"});var p5=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class Kl extends et.ToolItem{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const e=this.options.attrs,{class:t}=e,r=p5(e,["class"]);this.setAttrs(r,this.container),t&&J(this.container,t)}}onRender(){J(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const e=this.ratio,t=this.cellView,r=t.getTangentAtRatio(e),i=r?r.start:t.getPointAtRatio(e),s=r&&r.vector().vectorAngle(new P(1,0))||0;if(!i)return this;const o=ct().translate(i.x,i.y).rotate(s);return ys(this.container,o,{absolute:!0}),this}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();const t=this.cellView;if(t.can("arrowheadMovable")){t.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const r=this.graph.snapToGrid(e.clientX,e.clientY),i=t.prepareArrowheadDragging(this.type,{x:r.x,y:r.y,options:Object.assign(Object.assign({},this.options),{toolId:this.cid})});this.cellView.setEventData(e,i),this.delegateDocumentEvents(this.options.documentEvents,e.data),t.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(e){const t=this.normalizeEvent(e),r=this.graph.snapToGrid(t.clientX,t.clientY);this.cellView.onMouseMove(t,r.x,r.y),this.update()}onMouseUp(e){this.undelegateDocumentEvents();const t=this.normalizeEvent(e),r=this.cellView,i=this.graph.snapToGrid(t.clientX,t.clientY);r.onMouseUp(t,i.x,i.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",r.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}(function(n){n.config({tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}})})(Kl||(Kl={}));const m5=Kl.define({name:"source-arrowhead",type:"source",ratio:0,attrs:{d:"M 10 -8 -10 0 10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}}),y5=Kl.define({name:"target-arrowhead",type:"target",ratio:1,attrs:{d:"M -10 -8 10 0 -10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class Ss extends et.ToolItem{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5,this.dblClick=this.onCellDblClick.bind(this)}onRender(){const e=this.cellView;e&&e.on("cell:dblclick",this.dblClick)}createElement(){const e=[this.prefixClassName(`${this.cell.isEdge()?"edge":"node"}-tool-editor`),this.prefixClassName("cell-tool-editor")];this.editor=et.createElement("div",!1),this.addClass(e,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}removeElement(){this.undelegateDocumentEvents(),this.editor&&(this.container.removeChild(this.editor),this.editor=null)}updateEditor(){const{cell:e,editor:t}=this;if(!t)return;const{style:r}=t;e.isNode()?this.updateNodeEditorTransform():e.isEdge()&&this.updateEdgeEditorTransform();const{attrs:i}=this.options;r.fontSize=`${i.fontSize}px`,r.fontFamily=i.fontFamily,r.color=i.color,r.backgroundColor=i.backgroundColor;const s=this.getCellText()||"";return t.innerText=s,this.setCellText(""),this}updateNodeEditorTransform(){const{graph:e,cell:t,editor:r}=this;if(!r)return;let i=P.create(),s=20,o="",{x:a,y:l}=this.options;if(typeof a!="undefined"&&typeof l!="undefined"){const h=t.getBBox();a=Vt(a,h.width),l=Vt(l,h.height),i=h.topLeft.translate(a,l),s=h.width-a*2}else{const h=t.getBBox();i=h.center,s=h.width-4,o="translate(-50%, -50%)"}const c=e.scale(),{style:u}=r;i=e.localToGraph(i),u.left=`${i.x}px`,u.top=`${i.y}px`,u.transform=`scale(${c.sx}, ${c.sy}) ${o}`,u.minWidth=`${s}px`}updateEdgeEditorTransform(){if(!this.event)return;const{graph:e,editor:t}=this;if(!t)return;let r=P.create(),i=20;const{style:s}=t,o=this.event.target,a=o.parentElement;if(a&&gs(a,this.prefixClassName("edge-label"))){const u=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(u,10);const h=a.getAttribute("transform"),{translation:f}=Fl(h);r=new P(f.tx,f.ty),i=fe.getBBox(o).width}else{if(!this.options.labelAddable)return this;r=e.clientToLocal(P.create(this.event.clientX,this.event.clientY));const h=this.cellView.path.closestPointLength(r);this.distance=h,this.labelIndex=-1}r=e.localToGraph(r);const c=e.scale();s.left=`${r.x}px`,s.top=`${r.y}px`,s.minWidth=`${i}px`,s.transform=`scale(${c.sx}, ${c.sy}) translate(-50%, -50%)`}onDocumentMouseDown(e){if(this.editor&&e.target!==this.editor){const t=this.editor.innerText.replace(/\n$/,"")||"";this.setCellText(t!==""?t:null),this.removeElement()}}onCellDblClick({e}){e.stopPropagation(),this.removeElement(),this.event=e,this.createElement(),this.updateEditor(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents)}onMouseDown(e){e.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor&&(this.editor.focus(),this.selectText())})}selectText(){if(window.getSelection&&this.editor){const e=document.createRange(),t=window.getSelection();e.selectNodeContents(this.editor),t.removeAllRanges(),t.addRange(e)}}getCellText(){const{getText:e}=this.options;if(typeof e=="function")return K(e,this.cellView,{cell:this.cell,index:this.labelIndex});if(typeof e=="string"){if(this.cell.isNode())return this.cell.attr(e);if(this.cell.isEdge()&&this.labelIndex!==-1)return this.cell.prop(`labels/${this.labelIndex}/attrs/${e}`)}}setCellText(e){const t=this.options.setText;if(typeof t=="function"){K(t,this.cellView,{cell:this.cell,value:e,index:this.labelIndex,distance:this.distance});return}if(typeof t=="string"){if(this.cell.isNode()){e!==null&&this.cell.attr(t,e);return}if(this.cell.isEdge()){const r=this.cell;if(this.labelIndex===-1){if(e){const i={position:{distance:this.distance},attrs:{}};hs(i,`attrs/${t}`,e),r.appendLabel(i)}}else e!==null?r.prop(`labels/${this.labelIndex}/attrs/${t}`,e):typeof this.labelIndex=="number"&&r.removeLabelAt(this.labelIndex)}}}onRemove(){const e=this.cellView;e&&e.off("cell:dblclick",this.dblClick),this.removeElement()}}(function(n){n.config({tagName:"div",isSVGElement:!1,events:{mousedown:"onMouseDown"},documentEvents:{mousedown:"onDocumentMouseDown"}})})(Ss||(Ss={})),function(n){n.NodeEditor=n.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText:"text/text",setText:"text/text"}),n.EdgeEditor=n.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText:"label/text",setText:"label/text"})}(Ss||(Ss={}));var bw=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},Ps;(function(n){n.presets={boundary:Xl,button:Ir,"button-remove":Ir.Remove,"node-editor":Ss.NodeEditor},n.registry=Ue.create({type:"node tool",process(e,t){if(typeof t=="function")return t;let r=et.ToolItem;const{inherit:i}=t,s=bw(t,["inherit"]);if(i){const o=this.get(i);o==null?this.onNotFound(i,"inherited"):r=o}return s.name==null&&(s.name=e),r.define.call(r,s)}}),n.registry.register(n.presets,!0)})(Ps||(Ps={}));var Es;(function(n){n.presets={boundary:Xl,vertices:Uo,segments:Wo,button:Ir,"button-remove":Ir.Remove,"source-anchor":d5,"target-anchor":g5,"source-arrowhead":m5,"target-arrowhead":y5,"edge-editor":Ss.EdgeEditor},n.registry=Ue.create({type:"edge tool",process(e,t){if(typeof t=="function")return t;let r=et.ToolItem;const{inherit:i}=t,s=bw(t,["inherit"]);if(i){const o=this.get(i);o==null?this.onNotFound(i,"inherited"):r=o}return s.name==null&&(s.name=e),r.define.call(r,s)}}),n.registry.register(n.presets,!0)})(Es||(Es={}));const v5=ir("center"),b5=ir("topCenter"),w5=ir("bottomCenter"),x5=ir("leftMiddle"),C5=ir("rightMiddle"),S5=ir("topLeft"),P5=ir("topRight"),E5=ir("bottomLeft"),A5=ir("bottomRight");function ir(n){return function(e,t,r,i={}){const s=i.rotate?e.getUnrotatedBBoxOfElement(t):e.getBBoxOfElement(t),o=s[n];o.x+=Vt(i.dx,s.width),o.y+=Vt(i.dy,s.height);const a=e.cell;return i.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function Jl(n){return function(e,t,r,i){if(r instanceof Element){const s=this.graph.findViewByElem(r);let o;if(s)if(s.isEdgeElement(r)){const a=i.fixedAt!=null?i.fixedAt:"50%";o=ww(s,a)}else o=s.getBBoxOfElement(r).getCenter();else o=new P;return n.call(this,e,t,o,i)}return n.apply(this,arguments)}}function ww(n,e){const t=Qn(e),r=typeof e=="string"?parseFloat(e):e;return t?n.getPointAtRatio(r/100):n.getPointAtLength(r)}const T5=Jl(function(n,e,t,r){const i=n.cell.getAngle(),s=n.getBBoxOfElement(e),o=s.getCenter(),a=s.getTopLeft(),l=s.getBottomRight();let c=r.padding;if(Number.isFinite(c)||(c=0),a.y+c<=t.y&&t.y<=l.y-c){const u=t.y-o.y;o.x+=i===0||i===180?0:u*1/Math.tan(ye.toRad(i)),o.y+=u}else if(a.x+c<=t.x&&t.x<=l.x-c){const u=t.x-o.x;o.y+=i===90||i===270?0:u*Math.tan(ye.toRad(i)),o.x+=u}return o}),O5=function(n,e,t,r,i){const s=n.cell.getConnectionPoint(this.cell,i);return(r.dx||r.dy)&&s.translate(r.dx||0,r.dy||0),s},M5=Jl(function(n,e,t,r){let i,s=0,o;const a=n.cell;r.rotate?(i=n.getUnrotatedBBoxOfElement(e),o=a.getBBox().getCenter(),s=a.getAngle()):i=n.getBBoxOfElement(e);const l=r.padding;l!=null&&Number.isFinite(l)&&i.inflate(l),r.rotate&&t.rotate(s,o);const c=i.getNearestSideToPoint(t);let u;switch(c){case"left":u=i.getLeftMiddle();break;case"right":u=i.getRightMiddle();break;case"top":u=i.getTopCenter();break;case"bottom":u=i.getBottomCenter();break}const h=r.direction;return h==="H"?(c==="top"||c==="bottom")&&(t.x<=i.x+i.width?u=i.getLeftMiddle():u=i.getRightMiddle()):h==="V"&&(t.y<=i.y+i.height?u=i.getTopCenter():u=i.getBottomCenter()),r.rotate?u.rotate(-s,o):u}),_5=Object.freeze(Object.defineProperty({__proto__:null,bottom:w5,bottomLeft:E5,bottomRight:A5,center:v5,left:x5,midSide:M5,nodeCenter:O5,orth:T5,right:C5,top:b5,topLeft:S5,topRight:P5},Symbol.toStringTag,{value:"Module"}));var As;(function(n){n.presets=_5,n.registry=Ue.create({type:"node endpoint"}),n.registry.register(n.presets,!0)})(As||(As={}));const N5=function(n,e,t,r){let i=r.ratio!=null?r.ratio:.5;return i>1&&(i/=100),n.getPointAtRatio(i)},k5=function(n,e,t,r){const i=r.length!=null?r.length:20;return n.getPointAtLength(i)},xw=function(n,e,t,r){const i=n.getClosestPoint(t);return i!=null?i:new P},$5=Jl(xw),I5=Jl(function(n,e,t,r){const s=n.getConnection(),o=n.getConnectionSubdivisions(),a=new F(t.clone().translate(0,1e6),t.clone().translate(0,-1e6)),l=new F(t.clone().translate(1e6,0),t.clone().translate(-1e6,0)),c=a.intersect(s,{segmentSubdivisions:o}),u=l.intersect(s,{segmentSubdivisions:o}),h=[];return c&&h.push(...c),u&&h.push(...u),h.length>0?t.closest(h):r.fallbackAt!=null?ww(n,r.fallbackAt):K(xw,this,n,e,t,r)}),L5=Object.freeze(Object.defineProperty({__proto__:null,closest:$5,length:k5,orth:I5,ratio:N5},Symbol.toStringTag,{value:"Module"}));var Ts;(function(n){n.presets=L5,n.registry=Ue.create({type:"edge endpoint"}),n.registry.register(n.presets,!0)})(Ts||(Ts={}));function Ql(n,e,t){let r;if(typeof t=="object"){if(Number.isFinite(t.y)){const s=new F(e,n),{start:o,end:a}=s.parallel(t.y);e=o,n=a}r=t.x}else r=t;if(r==null||!Number.isFinite(r))return n;const i=n.distance(e);return r===0&&i>0?n:n.move(e,-Math.min(r,i-1))}function Zl(n){const e=n.getAttribute("stroke-width");return e===null?0:parseFloat(e)||0}function R5(n){if(n==null)return null;let e=n;do{let t=e.tagName;if(typeof t!="string")return null;if(t=t.toUpperCase(),t==="G")e=e.firstElementChild;else if(t==="TITLE")e=e.nextElementSibling;else break}while(e);return e}const Cw=function(n,e,t,r){const i=e.getBBoxOfElement(t);r.stroked&&i.inflate(Zl(t)/2);const s=n.intersect(i),o=s&&s.length?n.start.closest(s):n.end;return Ql(o,n.start,r.offset)},j5=function(n,e,t,r,i){const s=e.cell,o=s.isNode()?s.getAngle():0;if(o===0)return K(Cw,this,n,e,t,r,i);const a=e.getUnrotatedBBoxOfElement(t);r.stroked&&a.inflate(Zl(t)/2);const l=a.getCenter(),c=n.clone().rotate(o,l),u=c.setLength(1e6).intersect(a),h=u&&u.length?c.start.closest(u).rotate(-o,l):n.end;return Ql(h,n.start,r.offset)},D5=function(n,e,t,r){let i,s;const o=n.end,a=r.selector;if(typeof a=="string"?i=e.findOne(a):Array.isArray(a)?i=jh(t,a):i=R5(t),!Er(i)){if(i===t||!Er(t))return o;i=t}const l=e.getShapeOfElement(i),c=e.getMatrixOfElement(i),u=e.getRootTranslatedMatrix(),h=e.getRootRotatedMatrix(),f=u.multiply(h).multiply(c),d=f.inverse(),g=fe.transformLine(n,d),p=g.start.clone(),b=e.getDataOfElement(i);if(r.insideout===!1){b.shapeBBox==null&&(b.shapeBBox=l.bbox());const w=b.shapeBBox;if(w!=null&&w.containsPoint(p))return o}r.extrapolate===!0&&g.setLength(1e6);let m;if(X.isPath(l)){const w=r.precision||2;b.segmentSubdivisions==null&&(b.segmentSubdivisions=l.getSegmentSubdivisions({precision:w})),m={precision:w,segmentSubdivisions:b.segmentSubdivisions},s=g.intersect(l,m)}else s=g.intersect(l);s?Array.isArray(s)&&(s=p.closest(s)):r.sticky===!0&&(D.isRectangle(l)?s=l.getNearestPointToPoint(p):wn.isEllipse(l)?s=l.intersectsWithLineFromCenterToPoint(p):s=l.closestPoint(p,m));const y=s?fe.transformPoint(s,f):o;let v=r.offset||0;return r.stroked!==!1&&(typeof v=="object"?(v=Object.assign({},v),v.x==null&&(v.x=0),v.x+=Zl(i)/2):v+=Zl(i)/2),Ql(y,n.start,v)};function B5(n,e,t=0){const{start:r,end:i}=n;let s,o,a,l;switch(e){case"left":l="x",s=i,o=r,a=-1;break;case"right":l="x",s=r,o=i,a=1;break;case"top":l="y",s=i,o=r,a=-1;break;case"bottom":l="y",s=r,o=i,a=1;break;default:return}r[l]<i[l]?s[l]=o[l]:o[l]=s[l],Number.isFinite(t)&&(s[l]+=a*t,o[l]+=a*t)}const z5=Object.freeze(Object.defineProperty({__proto__:null,anchor:function(n,e,t,r){const{alignOffset:i,align:s}=r;return s&&B5(n,s,i),Ql(n.end,n.start,r.offset)},bbox:Cw,boundary:D5,rect:j5},Symbol.toStringTag,{value:"Module"}));var Os;(function(n){n.presets=z5,n.registry=Ue.create({type:"connection point"}),n.registry.register(n.presets,!0)})(Os||(Os={}));const F5=function(n){return[...n]},V5=function(n,e,t){const r=e.side||"bottom",i=Rn(e.padding||40),s=t.sourceBBox,o=t.targetBBox,a=s.getCenter(),l=o.getCenter();let c,u,h;switch(r){case"top":h=-1,c="y",u="height";break;case"left":h=-1,c="x",u="width";break;case"right":h=1,c="x",u="width";break;case"bottom":default:h=1,c="y",u="height";break}return a[c]+=h*(s[u]/2+i[r]),l[c]+=h*(o[u]/2+i[r]),h*(a[c]-l[c])>0?l[c]=a[c]:a[c]=l[c],[a.toJSON(),...n,l.toJSON()]};function ec(n){return new D(n.x,n.y,0,0)}function tc(n={}){const e=Rn(n.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function Sw(n,e={}){return n.sourceBBox.clone().moveAndExpand(tc(e))}function Pw(n,e={}){return n.targetBBox.clone().moveAndExpand(tc(e))}function q5(n,e={}){return n.sourceAnchor?n.sourceAnchor:Sw(n,e).getCenter()}function G5(n,e={}){return n.targetAnchor?n.targetAnchor:Pw(n,e).getCenter()}const Ew=function(n,e,t){let r=Sw(t,e),i=Pw(t,e);const s=q5(t,e),o=G5(t,e);r=r.union(ec(s)),i=i.union(ec(o));const a=n.map(u=>P.create(u));a.unshift(s),a.push(o);let l=null;const c=[];for(let u=0,h=a.length-1;u<h;u+=1){let f=null;const d=a[u],g=a[u+1],p=on.getBearing(d,g)!=null;if(u===0)u+1===h?r.intersectsWithRect(i.clone().inflate(1))?f=on.insideNode(d,g,r,i):p||(f=on.nodeToNode(d,g,r,i)):r.containsPoint(g)?f=on.insideNode(d,g,r,ec(g).moveAndExpand(tc(e))):p||(f=on.nodeToVertex(d,g,r));else if(u+1===h){const b=p&&on.getBearing(g,d)===l;i.containsPoint(d)||b?f=on.insideNode(d,g,ec(d).moveAndExpand(tc(e)),i,l):p||(f=on.vertexToNode(d,g,i,l))}else p||(f=on.vertexToVertex(d,g,l));f?(c.push(...f.points),l=f.direction):l=on.getBearing(d,g),u+1<h&&c.push(g)}return c};var on;(function(n){const e={N:"S",S:"N",E:"W",W:"E"},t={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function r(h,f,d){let g=new P(h.x,f.y);return d.containsPoint(g)&&(g=new P(f.x,h.y)),g}function i(h,f){return h[f==="W"||f==="E"?"width":"height"]}n.getBBoxSize=i;function s(h,f){return h.x===f.x?h.y>f.y?"N":"S":h.y===f.y?h.x>f.x?"W":"E":null}n.getBearing=s;function o(h,f,d){const g=new P(h.x,f.y),p=new P(f.x,h.y),b=s(h,g),m=s(h,p),y=d?e[d]:null,v=b===d||b!==y&&(m===y||m!==d)?g:p;return{points:[v],direction:s(v,f)}}n.vertexToVertex=o;function a(h,f,d){const g=r(h,f,d);return{points:[g],direction:s(g,f)}}n.nodeToVertex=a;function l(h,f,d,g){const p=[new P(h.x,f.y),new P(f.x,h.y)],b=p.filter(v=>!d.containsPoint(v)),m=b.filter(v=>s(v,h)!==g);let y;if(m.length>0)return y=m.filter(v=>s(h,v)===g).pop(),y=y||m[0],{points:[y],direction:s(y,f)};{y=hV(p,b)[0];const v=P.create(f).move(y,-i(d,g)/2);return{points:[r(v,h,d),v],direction:s(v,f)}}}n.vertexToNode=l;function c(h,f,d,g){let p=a(f,h,g);const b=p.points[0];if(d.containsPoint(b)){p=a(h,f,d);const m=p.points[0];if(g.containsPoint(m)){const y=P.create(h).move(m,-i(d,s(h,m))/2),v=P.create(f).move(b,-i(g,s(f,b))/2),w=new F(y,v).getCenter(),x=a(h,w,d),C=o(w,f,x.direction);p.points=[x.points[0],C.points[0]],p.direction=C.direction}}return p}n.nodeToNode=c;function u(h,f,d,g,p){const b=d.union(g).inflate(1),m=b.getCenter(),y=m.distance(f)>m.distance(h),v=y?f:h,w=y?h:f;let x,C,S;p?(x=P.fromPolar(b.width+b.height,t[p],v),x=b.getNearestPointToPoint(x).move(x,-1)):x=b.getNearestPointToPoint(v).move(v,1),C=r(x,w,b);let E;x.round().equals(C.round())?(C=P.fromPolar(b.width+b.height,ye.toRad(x.theta(v))+Math.PI/2,w),C=b.getNearestPointToPoint(C).move(w,1).round(),S=r(x,C,b),E=y?[C,S,x]:[x,S,C]):E=y?[C,x]:[x,C];const A=s(y?x:C,f);return{points:E,direction:A}}n.insideNode=u})(on||(on={}));const H5={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeNodes:[],excludeShapes:[],startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{top:{x:0,y:-1},right:{x:1,y:0},bottom:{x:0,y:1},left:{x:-1,y:0}},cost(){return Lr(this.step,this)},directions(){const n=Lr(this.step,this),e=Lr(this.cost,this);return[{cost:e,offsetX:n,offsetY:0},{cost:e,offsetX:-n,offsetY:0},{cost:e,offsetX:0,offsetY:n},{cost:e,offsetX:0,offsetY:-n}]},penalties(){const n=Lr(this.step,this);return{0:0,45:n/2,90:n/2}},paddingBox(){const n=Lr(this.step,this);return{x:-n,y:-n,width:2*n,height:2*n}},fallbackRouter:Ew,draggingRouter:null,snapToGrid:!0};function Lr(n,e){return typeof n=="function"?n.call(e):n}function U5(n){const e=Object.keys(n).reduce((t,r)=>{const i=t;return r==="fallbackRouter"||r==="draggingRouter"||r==="fallbackRoute"?i[r]=n[r]:i[r]=Lr(n[r],n),t},{});if(e.padding){const t=Rn(e.padding);e.paddingBox={x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}return e.directions.forEach(t=>{const r=new P(0,0),i=new P(t.offsetX,t.offsetY);t.angle=ye.normalize(r.theta(i))}),e}const Aw=1,Tw=2;class W5{constructor(){this.items=[],this.hash={},this.values={}}add(e,t){this.hash[e]?this.items.splice(this.items.indexOf(e),1):this.hash[e]=Aw,this.values[e]=t;const r=qV(this.items,e,i=>this.values[i]);this.items.splice(r,0,e)}pop(){const e=this.items.shift();return e&&(this.hash[e]=Tw),e}isOpen(e){return this.hash[e]===Aw}isClose(e){return this.hash[e]===Tw}isEmpty(){return this.items.length===0}}class X5{constructor(e){this.options=e,this.mapGridSize=100,this.map={}}build(e,t){const r=this.options,i=r.excludeTerminals.reduce((c,u)=>{const h=t[u];if(h){const f=e.getCell(h.cell);f&&c.push(f)}return c},[]);let s=[];const o=e.getCell(t.getSourceCellId());o&&(s=Db(s,o.getAncestors().map(c=>c.id)));const a=e.getCell(t.getTargetCellId());a&&(s=Db(s,a.getAncestors().map(c=>c.id)));const l=this.mapGridSize;return e.getNodes().reduce((c,u)=>{const h=i.some(b=>b.id===u.id),f=u.shape?r.excludeShapes.includes(u.shape):!1,d=r.excludeNodes.some(b=>typeof b=="string"?u.id===b:b===u),g=s.includes(u.id);if(!(f||h||d||g)){const b=u.getBBox().moveAndExpand(r.paddingBox),m=b.getOrigin().snapToGrid(l),y=b.getCorner().snapToGrid(l);for(let v=m.x;v<=y.x;v+=l)for(let w=m.y;w<=y.y;w+=l){const x=new P(v,w).toString();c[x]==null&&(c[x]=[]),c[x].push(b)}}return c},this.map),this}isAccessible(e){const t=e.clone().snapToGrid(this.mapGridSize).toString(),r=this.map[t];return r?r.every(i=>!i.containsPoint(e)):!0}}function Ow(n,e){const t=n.sourceBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function Mw(n,e){const t=n.targetBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function _w(n,e){return n.sourceAnchor?n.sourceAnchor:Ow(n,e).getCenter()}function Y5(n,e){return n.targetAnchor?n.targetAnchor:Mw(n,e).getCenter()}function df(n,e,t,r,i){const s=360/t,o=n.theta(K5(n,e,r,i)),a=ye.normalize(o+s/2);return s*Math.floor(a/s)}function K5(n,e,t,r){const i=r.step,s=e.x-n.x,o=e.y-n.y,a=s/t.x,l=o/t.y,c=a*i,u=l*i;return new P(n.x+c,n.y+u)}function Nw(n,e){const t=Math.abs(n-e);return t>180?360-t:t}function J5(n,e){const t=e.step;return e.directions.forEach(r=>{r.gridOffsetX=r.offsetX/t*n.x,r.gridOffsetY=r.offsetY/t*n.y}),e.directions}function Q5(n,e,t){return{source:e.clone(),x:kw(t.x-e.x,n),y:kw(t.y-e.y,n)}}function kw(n,e){if(!n)return e;const t=Math.abs(n),r=Math.round(t/e);if(!r)return t;const i=r*e,o=(t-i)/r;return e+o}function Z5(n,e){const t=e.source,r=be.snapToGrid(n.x-t.x,e.x)+t.x,i=be.snapToGrid(n.y-t.y,e.y)+t.y;return new P(r,i)}function Xo(n,e){return n.round(e)}function nc(n,e,t){return Xo(Z5(n.clone(),e),t)}function Yo(n){return n.toString()}function gf(n){return new P(n.x===0?0:Math.abs(n.x)/n.x,n.y===0?0:Math.abs(n.y)/n.y)}function $w(n,e){let t=1/0;for(let r=0,i=e.length;r<i;r+=1){const s=n.manhattanDistance(e[r]);s<t&&(t=s)}return t}function Iw(n,e,t,r,i){const s=i.precision,o=i.directionMap,a=n.diff(e.getCenter()),l=Object.keys(o).reduce((c,u)=>{if(t.includes(u)){const h=o[u],f=new P(n.x+h.x*(Math.abs(a.x)+e.width),n.y+h.y*(Math.abs(a.y)+e.height)),g=new F(n,f).intersect(e)||[];let p,b=null;for(let m=0;m<g.length;m+=1){const y=g[m],v=n.squaredDistance(y);(p==null||v>p)&&(p=v,b=y)}if(b){let m=nc(b,r,s);e.containsPoint(m)&&(m=nc(m.translate(h.x*r.x,h.y*r.y),r,s)),c.push(m)}}return c},[]);return e.containsPoint(n)||l.push(nc(n,r,s)),l}function eG(n,e,t,r,i){const s=[];let o=gf(i.diff(t)),a=Yo(t),l=n[a],c;for(;l;){c=e[a];const f=gf(c.diff(l));f.equals(o)||(s.unshift(c),o=f),a=Yo(l),l=n[a]}const u=e[a];return gf(u.diff(r)).equals(o)||s.unshift(u),s}function tG(n,e,t,r,i){const s=i.precision;let o,a;D.isRectangle(e)?o=Xo(_w(n,i).clone(),s):o=Xo(e.clone(),s),D.isRectangle(t)?a=Xo(Y5(n,i).clone(),s):a=Xo(t.clone(),s);const l=Q5(i.step,o,a),c=o,u=a;let h,f;if(D.isRectangle(e)?h=Iw(c,e,i.startDirections,l,i):h=[c],D.isRectangle(t)?f=Iw(a,t,i.endDirections,l,i):f=[u],h=h.filter(d=>r.isAccessible(d)),f=f.filter(d=>r.isAccessible(d)),h.length>0&&f.length>0){const d=new W5,g={},p={},b={};for(let O=0,T=h.length;O<T;O+=1){const I=h[O],G=Yo(I);d.add(G,$w(I,f)),g[G]=I,b[G]=0}const m=i.previousDirectionAngle,y=m===void 0;let v,w;const x=J5(l,i),C=x.length,S=f.reduce((O,T)=>{const I=Yo(T);return O.push(I),O},[]),E=P.equalPoints(h,f);let A=i.maxLoopCount;for(;!d.isEmpty()&&A>0;){const O=d.pop(),T=g[O],I=p[O],G=b[O],Y=T.equals(c),M=I==null;let k;if(M?y?Y?k=null:k=df(c,T,C,l,i):k=m:k=df(I,T,C,l,i),!(M&&E)&&S.indexOf(O)>=0)return i.previousDirectionAngle=k,eG(p,g,T,c,u);for(let R=0;R<C;R+=1){v=x[R];const z=v.angle;if(w=Nw(k,z),!(y&&Y)&&w>i.maxDirectionChange)continue;const U=nc(T.clone().translate(v.gridOffsetX||0,v.gridOffsetY||0),l,s),te=Yo(U);if(d.isClose(te)||!r.isAccessible(U))continue;if(S.indexOf(te)>=0&&!U.equals(u)){const Ke=df(U,u,C,l,i);if(Nw(z,Ke)>i.maxDirectionChange)continue}const we=v.cost,Kt=Y?0:i.penalties[w],Ye=G+we+Kt;(!d.isOpen(te)||Ye<b[te])&&(g[te]=U,p[te]=T,b[te]=Ye,d.add(te,Ye+$w(U,f)))}A-=1}}return i.fallbackRoute?K(i.fallbackRoute,this,c,u,i):null}function nG(n,e=10){if(n.length<=1)return n;for(let t=0,r=n.length;t<r-1;t+=1){const i=n[t],s=n[t+1];if(i.x===s.x){const o=e*Math.round(i.x/e);i.x!==o&&(i.x=o,s.x=o)}else if(i.y===s.y){const o=e*Math.round(i.y/e);i.y!==o&&(i.y=o,s.y=o)}}return n}const rG=function(n,e,t){const r=U5(e),i=Ow(t,r),s=Mw(t,r),o=_w(t,r),a=new X5(r).build(t.graph.model,t.cell),l=n.map(d=>P.create(d)),c=[];let u=o,h,f;for(let d=0,g=l.length;d<=g;d+=1){let p=null;if(h=f||i,f=l[d],f==null){f=s;const m=t.cell;if((m.getSourceCellId()==null||m.getTargetCellId()==null)&&typeof r.draggingRouter=="function"){const v=h===i?o:h,w=f.getOrigin();p=K(r.draggingRouter,t,v,w,r)}}if(p==null&&(p=tG(t,h,f,a,r)),p===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),K(r.fallbackRouter,this,n,r,t);const b=p[0];b&&b.equals(u)&&p.shift(),u=p[p.length-1]||u,c.push(...p)}return r.snapToGrid?nG(c,t.graph.grid.getGridSize()):c},Lw=function(n,e,t){return K(rG,this,n,Object.assign(Object.assign({},H5),e),t)},iG={maxDirectionChange:45,directions(){const n=Lr(this.step,this),e=Lr(this.cost,this),t=Math.ceil(Math.sqrt(n*n<<1));return[{cost:e,offsetX:n,offsetY:0},{cost:t,offsetX:n,offsetY:n},{cost:e,offsetX:0,offsetY:n},{cost:t,offsetX:-n,offsetY:n},{cost:e,offsetX:-n,offsetY:0},{cost:t,offsetX:-n,offsetY:-n},{cost:e,offsetX:0,offsetY:-n},{cost:t,offsetX:n,offsetY:-n}]},fallbackRoute(n,e,t){const r=n.theta(e),i=[];let s={x:e.x,y:n.y},o={x:n.x,y:e.y};if(r%180>90){const v=s;s=o,o=v}const a=r%90<45?s:o,l=new F(n,a),c=90*Math.ceil(r/90),u=P.fromPolar(l.squaredLength(),ye.toRad(c+135),a),h=new F(e,u),f=l.intersectsWithLine(h),d=f||e,g=f?d:n,p=360/t.directions.length,b=g.theta(e),m=ye.normalize(b+p/2),y=p*Math.floor(m/p);return t.previousDirectionAngle=y,d&&i.push(d.round()),i.push(e),i}},sG=function(n,e,t){return K(Lw,this,n,Object.assign(Object.assign({},iG),e),t)},oG=function(n,e,t){const r=e.offset||32,i=e.min==null?16:e.min;let s=0,o=e.direction;const a=t.sourceBBox,l=t.targetBBox,c=a.getCenter(),u=l.getCenter();if(typeof r=="number"&&(s=r),o==null){let m=l.left-a.right,y=l.top-a.bottom;m>=0&&y>=0?o=m>=y?"L":"T":m<=0&&y>=0?(m=a.left-l.right,m>=0?o=m>=y?"R":"T":o="T"):m>=0&&y<=0?(y=a.top-l.bottom,y>=0?o=m>=y?"L":"B":o="L"):(m=a.left-l.right,y=a.top-l.bottom,m>=0&&y>=0?o=m>=y?"R":"B":m<=0&&y>=0?o="B":m>=0&&y<=0?o="R":o=Math.abs(m)>Math.abs(y)?"R":"B")}o==="H"?o=u.x-c.x>=0?"L":"R":o==="V"&&(o=u.y-c.y>=0?"T":"B"),r==="center"&&(o==="L"?s=(l.left-a.right)/2:o==="R"?s=(a.left-l.right)/2:o==="T"?s=(l.top-a.bottom)/2:o==="B"&&(s=(a.top-l.bottom)/2));let h,f,d;const g=o==="L"||o==="R";if(g){if(u.y===c.y)return[...n];d=o==="L"?1:-1,h="x",f="width"}else{if(u.x===c.x)return[...n];d=o==="T"?1:-1,h="y",f="height"}const p=c.clone(),b=u.clone();if(p[h]+=d*(a[f]/2+s),b[h]-=d*(l[f]/2+s),g){const m=p.x,y=b.x,v=a.width/2+i,w=l.width/2+i;u.x>c.x?y<=m&&(p.x=Math.max(y,c.x+v),b.x=Math.min(m,u.x-w)):y>=m&&(p.x=Math.min(y,c.x-v),b.x=Math.max(m,u.x+w))}else{const m=p.y,y=b.y,v=a.height/2+i,w=l.height/2+i;u.y>c.y?y<=m&&(p.y=Math.max(y,c.y+v),b.y=Math.min(m,u.y-w)):y>=m&&(p.y=Math.min(y,c.y-v),b.y=Math.max(m,u.y+w))}return[p.toJSON(),...n,b.toJSON()]};function Ms(n,e){if(e!=null&&e!==!1){const t=typeof e=="boolean"?0:e;if(t>0){const r=P.create(n[1]).move(n[2],t),i=P.create(n[1]).move(n[0],t);return[r.toJSON(),...n,i.toJSON()]}{const r=n[1];return[Object.assign({},r),...n,Object.assign({},r)]}}return n}const aG=Object.freeze(Object.defineProperty({__proto__:null,er:oG,loop:function(n,e,t){const r=e.width||50,s=(e.height||80)/2,o=e.angle||"auto",a=t.sourceAnchor,l=t.targetAnchor,c=t.sourceBBox,u=t.targetBBox;if(a.equals(l)){const h=m=>{const y=ye.toRad(m),v=Math.sin(y),w=Math.cos(y),x=new P(a.x+w*r,a.y+v*r),C=new P(x.x-w*s,x.y-v*s),S=C.clone().rotate(-90,x),E=C.clone().rotate(90,x);return[S.toJSON(),x.toJSON(),E.toJSON()]},f=m=>{const y=a.clone().move(m,-1),v=new F(y,m);return!c.containsPoint(m)&&!c.intersectsWithLine(v)},d=[0,90,180,270,45,135,225,315];if(typeof o=="number")return Ms(h(o),e.merge);const g=c.getCenter();if(g.equals(a))return Ms(h(0),e.merge);const p=g.angleBetween(a,g.clone().translate(1,0));let b=h(p);if(f(b[1]))return Ms(b,e.merge);for(let m=1,y=d.length;m<y;m+=1)if(b=h(p+d[m]),f(b[1]))return Ms(b,e.merge);return Ms(b,e.merge)}{const h=new F(a,l);let f=h.parallel(-r),d=f.getCenter(),g=f.start.clone().move(f.end,s),p=f.end.clone().move(f.start,s);const b=h.parallel(-1),m=new F(b.start,d),y=new F(b.end,d);if((c.containsPoint(d)||u.containsPoint(d)||c.intersectsWithLine(m)||c.intersectsWithLine(y)||u.intersectsWithLine(m)||u.intersectsWithLine(y))&&(f=h.parallel(r),d=f.getCenter(),g=f.start.clone().move(f.end,s),p=f.end.clone().move(f.start,s)),e.merge){const v=new F(a,l),w=new F(d,v.center).setLength(Number.MAX_SAFE_INTEGER),x=c.intersectsWithLine(w),C=u.intersectsWithLine(w),S=x?Array.isArray(x)?x:[x]:[];C&&(Array.isArray(C)?S.push(...C):S.push(C));const E=v.center.closest(S);E?(t.sourceAnchor=E.clone(),t.targetAnchor=E.clone()):(t.sourceAnchor=v.center.clone(),t.targetAnchor=v.center.clone())}return Ms([g.toJSON(),d.toJSON(),p.toJSON()],e.merge)}},manhattan:Lw,metro:sG,normal:F5,oneSide:V5,orth:Ew},Symbol.toStringTag,{value:"Module"}));var Rr;(function(n){n.presets=aG,n.registry=Ue.create({type:"router"}),n.registry.register(n.presets,!0)})(Rr||(Rr={}));const lG=function(n,e,t,r={}){const i=[n,...t,e],s=new He(i),o=new X(s);return r.raw?o:o.serialize()},cG=function(n,e,t,r={}){const i=t.length===3?0:1,s=P.create(t[0+i]),o=P.create(t[2+i]),a=P.create(t[1+i]);if(!P.equals(n,e)){const c=new P((n.x+e.x)/2,(n.y+e.y)/2),u=c.angleBetween(P.create(n).rotate(90,c),a);u>1&&(s.rotate(180-u,c),o.rotate(180-u,c),a.rotate(180-u,c))}const l=`
82
+ `.trim()}const S6=Object.freeze(Object.defineProperty({__proto__:null,blur:g6,brightness:x6,contrast:C6,dropShadow:p6,grayScale:m6,highlight:d6,hueRotate:b6,invert:w6,outline:f6,saturate:v6,sepia:y6},Symbol.toStringTag,{value:"Module"}));var ws;(function(n){n.presets=S6,n.registry=Ue.create({type:"filter"}),n.registry.register(n.presets,!0)})(ws||(ws={}));const P6={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"},E6={},F1={position:Ul("x","width","origin")},V1={position:Ul("y","height","origin")},A6={position:Ul("x","width","corner")},T6={position:Ul("y","height","corner")},q1={set:Mr("width","width")},G1={set:Mr("height","height")},O6={set:Mr("rx","width")},M6={set:Mr("ry","height")},H1={set:(n=>{const e=Mr(n,"width"),t=Mr(n,"height");return function(r,i){const s=i.refBBox,o=s.height>s.width?e:t;return Y(o,this,r,i)}})("r")},_6={set(n,{refBBox:e}){let t=parseFloat(n);const r=Qn(n);r&&(t/=100);const i=Math.sqrt(e.height*e.height+e.width*e.width);let s;return Number.isFinite(t)&&(r||t>=0&&t<=1?s=t*i:s=Math.max(t+i,0)),{r:s}}},N6={set:Mr("cx","width")},k6={set:Mr("cy","height")},U1={set:Y1({resetOffset:!0})},$6={set:Y1({resetOffset:!1})},W1={set:K1({resetOffset:!0})},I6={set:K1({resetOffset:!1})},L6=H1,R6=U1,j6=W1,D6=F1,B6=V1,z6=q1,F6=G1;function Ul(n,e,t){return(r,{refBBox:i})=>{if(r==null)return null;let s=parseFloat(r);const o=Qn(r);o&&(s/=100);let a;if(Number.isFinite(s)){const c=i[t];o||s>0&&s<1?a=c[n]+i[e]*s:a=c[n]+s}const l=new P;return l[n]=a||0,l}}function Mr(n,e){return function(t,{refBBox:r}){let i=parseFloat(t);const s=Qn(t);s&&(i/=100);const o={};if(Number.isFinite(i)){const a=s||i>=0&&i<=1?i*r[e]:Math.max(i+r[e],0);o[n]=a}return o}}function X1(n,e){const t="x6-shape",r=e&&e.resetOffset;return function(i,{elem:s,refBBox:o}){let a=xi(s,t);if(!a||a.value!==i){const p=n(i);a={value:i,shape:p,shapeBBox:p.bbox()},xi(s,t,a)}const l=a.shape.clone(),c=a.shapeBBox.clone(),u=c.getOrigin(),h=o.getOrigin();c.x=h.x,c.y=h.y;const f=o.getMaxScaleToFit(c,h),d=c.width===0||o.width===0?1:f.sx,g=c.height===0||o.height===0?1:f.sy;return l.scale(d,g,u),r&&l.translate(-u.x,-u.y),l}}function Y1(n){function e(r){return W.parse(r)}const t=X1(e,n);return(r,i)=>({d:t(r,i).serialize()})}function K1(n){const e=X1(t=>new He(t),n);return(t,r)=>({points:e(t,r).serialize()})}const V6={qualify:Ln,set(n,{view:e}){return`url(#${e.graph.defineGradient(n)})`}},q6={qualify:Ln,set(n,{view:e}){const t=e.cell,r=Object.assign({},n);if(t.isEdge()&&r.type==="linearGradient"){const i=e,s=i.sourcePoint,o=i.targetPoint;r.id=`gradient-${r.type}-${t.id}`,r.attrs=Object.assign(Object.assign({},r.attrs),{x1:s.x,y1:s.y,x2:o.x,y2:o.y,gradientUnits:"userSpaceOnUse"}),e.graph.defs.remove(r.id)}return`url(#${e.graph.defineGradient(r)})`}},J1={qualify(n,{attrs:e}){return e.textWrap==null||!Ln(e.textWrap)},set(n,{view:e,elem:t,attrs:r}){const i="x6-text",s=xi(t,i),o=u=>{try{return JSON.parse(u)}catch(h){return u}},a={x:r.x,eol:r.eol,annotations:o(r.annotations),textPath:o(r["text-path"]||r.textPath),textVerticalAnchor:r["text-vertical-anchor"]||r.textVerticalAnchor,displayEmpty:(r["display-empty"]||r.displayEmpty)==="true",lineHeight:r["line-height"]||r.lineHeight},l=r["font-size"]||r.fontSize,c=JSON.stringify([n,a]);if(l&&t.setAttribute("font-size",l),s==null||s!==c){const u=a.textPath;if(u!=null&&typeof u=="object"){const h=u.selector;if(typeof h=="string"){const f=e.find(h)[0];f instanceof SVGPathElement&&(Gh(f),a.textPath=Object.assign({"xlink:href":`#${f.id}`},u))}}A1(t,`${n}`,a),xi(t,i,c)}}},G6={qualify:Ln,set(n,{view:e,elem:t,attrs:r,refBBox:i}){const s=n,o=s.width||0;Qn(o)?i.width*=parseFloat(o)/100:o<=0?i.width+=o:i.width=o;const a=s.height||0;Qn(a)?i.height*=parseFloat(a)/100:a<=0?i.height+=a:i.height=a;let l,c=s.text;c==null&&(c=r.text),c!=null?l=N4(`${c}`,i,{"font-weight":r["font-weight"]||r.fontWeight,"font-size":r["font-size"]||r.fontSize,"font-family":r["font-family"]||r.fontFamily,lineHeight:r.lineHeight},{ellipsis:s.ellipsis}):l="",Y(J1.set,this,l,{view:e,elem:t,attrs:r,refBBox:i,cell:e.cell})}},xs=(n,{attrs:e})=>e.text!==void 0,H6={qualify:xs},U6={qualify:xs},W6={qualify:xs},X6={qualify:xs},Y6={qualify:xs},K6={qualify:xs},J6={qualify(n,{elem:e}){return e instanceof SVGElement},set(n,{elem:e}){const t="x6-title",r=`${n}`,i=xi(e,t);if(i==null||i!==r){xi(e,t,r);const s=e.firstChild;if(s&&s.tagName.toUpperCase()==="TITLE"){const o=s;o.textContent=r}else{const o=document.createElementNS(e.namespaceURI,"title");o.textContent=r,e.insertBefore(o,s)}}}},Q6={offset:Q1("x","width","right")},Z6={offset:Q1("y","height","bottom")},eq={offset(n,{refBBox:e}){return n?{x:-e.x,y:-e.y}:{x:0,y:0}}};function Q1(n,e,t){return(r,{refBBox:i})=>{const s=new P;let o;return r==="middle"?o=i[e]/2:r===t?o=i[e]:typeof r=="number"&&Number.isFinite(r)?o=r>-1&&r<1?-i[e]*r:-r:Qn(r)?o=i[e]*parseFloat(r)/100:o=0,s[n]=-(i[n]+o),s}}const tq={qualify:Ln,set(n,{elem:e}){me(e,n)}},nq={set(n,{elem:e}){e.innerHTML=`${n}`}},rq={qualify:Ln,set(n,{view:e}){return`url(#${e.graph.defineFilter(n)})`}},iq={set(n){return n!=null&&typeof n=="object"&&n.id?n.id:n}};function _r(n,e,t){let r,i;typeof e=="object"?(r=e.x,i=e.y):(r=e,i=t);const s=W.parse(n),o=s.bbox();if(o){let a=-o.height/2-o.y,l=-o.width/2-o.x;typeof r=="number"&&(l-=r),typeof i=="number"&&(a-=i),s.translate(l,a)}return s.serialize()}var Z1=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const sq=n=>{var{size:e,width:t,height:r,offset:i,open:s}=n,o=Z1(n,["size","width","height","offset","open"]);return ew({size:e,width:t,height:r,offset:i},s===!0,!0,void 0,o)},oq=n=>{var{size:e,width:t,height:r,offset:i,factor:s}=n,o=Z1(n,["size","width","height","offset","factor"]);return ew({size:e,width:t,height:r,offset:i},!1,!1,s,o)};function ew(n,e,t,r=3/4,i={}){const s=n.size||10,o=n.width||s,a=n.height||s,l=new W,c={};if(e)l.moveTo(o,0).lineTo(0,a/2).lineTo(o,a),c.fill="none";else{if(l.moveTo(0,a/2),l.lineTo(o,0),!t){const u=en(r,0,1);l.lineTo(o*u,a/2)}l.lineTo(o,a),l.close()}return Object.assign(Object.assign(Object.assign({},c),i),{tagName:"path",d:_r(l.serialize(),{x:n.offset!=null?n.offset:-o/2})})}var aq=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const lq=n=>{var{size:e,width:t,height:r,offset:i}=n,s=aq(n,["size","width","height","offset"]);const o=e||10,a=t||o,l=r||o,c=new W;return c.moveTo(0,l/2).lineTo(a/2,0).lineTo(a,l/2).lineTo(a/2,l).close(),Object.assign(Object.assign({},s),{tagName:"path",d:_r(c.serialize(),i==null?-a/2:i)})};var cq=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const uq=n=>{var{d:e,offsetX:t,offsetY:r}=n,i=cq(n,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},i),{tagName:"path",d:_r(e,t,r)})};var hq=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const fq=n=>{var{size:e,width:t,height:r,offset:i}=n,s=hq(n,["size","width","height","offset"]);const o=e||10,a=t||o,l=r||o,c=new W;return c.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},s),{tagName:"path",fill:"none",d:_r(c.serialize(),i||-a/2)})};var dq=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const gq=n=>{var{width:e,height:t,offset:r,open:i,flip:s}=n,o=dq(n,["width","height","offset","open","flip"]);let a=t||6;const l=e||10,c=i===!0,u=s===!0,h=Object.assign(Object.assign({},o),{tagName:"path"});u&&(a=-a);const f=new W;return f.moveTo(0,a).lineTo(l,0),c?h.fill="none":(f.lineTo(l,a),f.close()),h.d=_r(f.serialize(),{x:r||-l/2,y:a/2}),h};var tw=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const nw=n=>{var{r:e}=n,t=tw(n,["r"]);const r=e||5;return Object.assign(Object.assign({cx:r},t),{tagName:"circle",r})},pq=n=>{var{r:e}=n,t=tw(n,["r"]);const r=e||5,i=new W;return i.moveTo(r,0).lineTo(r,r*2),i.moveTo(0,r).lineTo(r*2,r),{children:[Object.assign(Object.assign({},nw({r})),{fill:"none"}),Object.assign(Object.assign({},t),{tagName:"path",d:_r(i.serialize(),-r)})]}};var mq=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const yq=Object.freeze(Object.defineProperty({__proto__:null,async:gq,block:sq,circle:nw,circlePlus:pq,classic:oq,cross:fq,diamond:lq,ellipse:n=>{var{rx:e,ry:t}=n,r=mq(n,["rx","ry"]);const i=e||5,s=t||5;return Object.assign(Object.assign({cx:i},r),{tagName:"ellipse",rx:i,ry:s})},path:uq},Symbol.toStringTag,{value:"Module"}));var Nr;(function(n){n.presets=yq,n.registry=Ue.create({type:"marker"}),n.registry.register(n.presets,!0)})(Nr||(Nr={})),function(n){n.normalize=_r}(Nr||(Nr={}));var vq=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};function af(n){return typeof n=="string"||Ln(n)}const bq={qualify:af,set(n,{view:e,attrs:t}){return lf("marker-start",n,e,t)}},wq={qualify:af,set(n,{view:e,attrs:t}){return lf("marker-end",n,e,t,{transform:"rotate(180)"})}},xq={qualify:af,set(n,{view:e,attrs:t}){return lf("marker-mid",n,e,t)}};function lf(n,e,t,r,i={}){const s=typeof e=="string"?{name:e}:e,{name:o,args:a}=s,l=vq(s,["name","args"]);let c=l;if(o&&typeof o=="string"){const h=Nr.registry.get(o);if(h)c=h(Object.assign(Object.assign({},l),a));else return Nr.registry.onNotFound(o)}const u=Object.assign(Object.assign(Object.assign({},Cq(r,n)),i),c);return{[n]:`url(#${t.graph.defineMarker(u)})`}}function Cq(n,e){const t={},r=n.stroke;typeof r=="string"&&(t.stroke=r,t.fill=r);let i=n.strokeOpacity;if(i==null&&(i=n["stroke-opacity"]),i==null&&(i=n.opacity),i!=null&&(t["stroke-opacity"]=i,t["fill-opacity"]=i),e!=="marker-mid"){const s=parseFloat(n.strokeWidth||n["stroke-width"]);if(Number.isFinite(s)&&s>1){const o=Math.ceil(s/2);t.refX=e==="marker-start"?o:-o}}return t}const Ho=(n,{view:e})=>e.cell.isEdge(),Sq={qualify:Ho,set(n,e){var t,r,i,s;const o=e.view,a=n.reverse||!1,l=n.stubs||0;let c;if(Number.isFinite(l)&&l!==0)if(a){let u,h;const f=o.getConnectionLength()||0;l<0?(u=(f+l)/2,h=-l):(u=l,h=f-l*2);const d=o.getConnection();c=(s=(i=(r=(t=d==null?void 0:d.divideAtLength(u))===null||t===void 0?void 0:t[1])===null||r===void 0?void 0:r.divideAtLength(h))===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.serialize()}else{let u;l<0?u=((o.getConnectionLength()||0)+l)/2:u=l;const h=o.getConnection();if(h){const f=h.divideAtLength(u),d=h.divideAtLength(-u);f&&d&&(c=`${f[0].serialize()} ${d[1].serialize()}`)}}return{d:c||o.getConnectionPathData()}}},rw={qualify:Ho,set:Wl("getTangentAtLength",{rotate:!0})},Pq={qualify:Ho,set:Wl("getTangentAtLength",{rotate:!1})},iw={qualify:Ho,set:Wl("getTangentAtRatio",{rotate:!0})},Eq={qualify:Ho,set:Wl("getTangentAtRatio",{rotate:!1})},Aq=rw,Tq=iw;function Wl(n,e){const t={x:1,y:0};return(r,i)=>{let s,o;const a=i.view,l=a[n](Number(r));return l?(o=e.rotate?l.vector().vectorAngle(t):0,s=l.start):(s=a.path.start,o=0),o===0?{transform:`translate(${s.x},${s.y}')`}:{transform:`translate(${s.x},${s.y}') rotate(${o})`}}}const Oq=Object.freeze(Object.defineProperty({__proto__:null,annotations:X6,atConnectionLength:Aq,atConnectionLengthIgnoreGradient:Pq,atConnectionLengthKeepGradient:rw,atConnectionRatio:Tq,atConnectionRatioIgnoreGradient:Eq,atConnectionRatioKeepGradient:iw,connection:Sq,displayEmpty:K6,eol:Y6,fill:V6,filter:rq,html:nq,lineHeight:H6,port:iq,ref:E6,refCx:N6,refCy:k6,refD:R6,refDKeepOffset:$6,refDResetOffset:U1,refDx:A6,refDy:T6,refHeight:G1,refHeight2:F6,refPoints:j6,refPointsKeepOffset:I6,refPointsResetOffset:W1,refR:L6,refRCircumscribed:_6,refRInscribed:H1,refRx:O6,refRy:M6,refWidth:q1,refWidth2:z6,refX:F1,refX2:D6,refY:V1,refY2:B6,resetOffset:eq,sourceMarker:bq,stroke:q6,style:tq,targetMarker:wq,text:J1,textPath:W6,textVerticalAnchor:U6,textWrap:G6,title:J6,vertexMarker:xq,xAlign:Q6,yAlign:Z6},Symbol.toStringTag,{value:"Module"}));var Bn;(function(n){function e(t,r,i){return!!(t!=null&&(typeof t=="string"||typeof t.qualify!="function"||Y(t.qualify,this,r,i)))}n.isValidDefinition=e})(Bn||(Bn={})),function(n){n.presets=Object.assign(Object.assign({},P6),Oq),n.registry=Ue.create({type:"attribute definition"}),n.registry.register(n.presets,!0)}(Bn||(Bn={}));const sn={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(n){return`${sn.prefixCls}-${n}`}},sw=sn.prefix("highlighted"),Mq={highlight(n,e,t){const r=t&&t.className||sw;K(e,r)},unhighlight(n,e,t){const r=t&&t.className||sw;gt(e,r)}},ow=sn.prefix("highlight-opacity"),_q={highlight(n,e){K(e,ow)},unhighlight(n,e){gt(e,ow)}};var de;(function(n){const e=Zn("svg");n.normalizeMarker=_r;function t(d,g){const p=V4(d.x,d.y).matrixTransform(g);return new P(p.x,p.y)}n.transformPoint=t;function r(d,g){return new F(t(d.start,g),t(d.end,g))}n.transformLine=r;function i(d,g){let p=d instanceof He?d.points:d;return Array.isArray(p)||(p=[]),new He(p.map(b=>t(b,g)))}n.transformPolyline=i;function s(d,g){const p=e.createSVGPoint();p.x=d.x,p.y=d.y;const b=p.matrixTransform(g);p.x=d.x+d.width,p.y=d.y;const m=p.matrixTransform(g);p.x=d.x+d.width,p.y=d.y+d.height;const y=p.matrixTransform(g);p.x=d.x,p.y=d.y+d.height;const v=p.matrixTransform(g),w=Math.min(b.x,m.x,y.x,v.x),x=Math.max(b.x,m.x,y.x,v.x),C=Math.min(b.y,m.y,y.y,v.y),S=Math.max(b.y,m.y,y.y,v.y);return new D(w,C,x-w,S-C)}n.transformRectangle=s;function o(d,g,p){let b;const m=d.ownerSVGElement;if(!m)return new D(0,0,0,0);try{b=d.getBBox()}catch(v){b={x:d.clientLeft,y:d.clientTop,width:d.clientWidth,height:d.clientHeight}}if(g)return D.create(b);const y=Ro(d,p||m);return s(b,y)}n.bbox=o;function a(d,g={}){let p;if(!d.ownerSVGElement||!Er(d)){if(g1(d)){const{left:v,top:w,width:x,height:C}=l(d);return new D(v,w,x,C)}return new D(0,0,0,0)}let m=g.target;if(!g.recursive){try{p=d.getBBox()}catch(w){p={x:d.clientLeft,y:d.clientTop,width:d.clientWidth,height:d.clientHeight}}if(!m)return D.create(p);const v=Ro(d,m);return s(p,v)}{const v=d.childNodes,w=v.length;if(w===0)return a(d,{target:m});m||(m=d);for(let x=0;x<w;x+=1){const C=v[x];let S;C.childNodes.length===0?S=a(C,{target:m}):S=a(C,{target:m,recursive:!0}),p?p=p.union(S):p=S}return p}}n.getBBox=a;function l(d){let g=0,p=0,b=0,m=0;if(d){let y=d;for(;y;)g+=y.offsetLeft,p+=y.offsetTop,y=y.offsetParent,y&&(g+=parseInt(C1(y,"borderLeft"),10),p+=parseInt(C1(y,"borderTop"),10));b=d.offsetWidth,m=d.offsetHeight}return{left:g,top:p,width:b,height:m}}n.getBoundingOffsetRect=l;function c(d){const g=p=>{const b=d.getAttribute(p),m=b?parseFloat(b):0;return Number.isNaN(m)?0:m};switch(d instanceof SVGElement&&d.nodeName.toLowerCase()){case"rect":return new D(g("x"),g("y"),g("width"),g("height"));case"circle":return new wn(g("cx"),g("cy"),g("r"),g("r"));case"ellipse":return new wn(g("cx"),g("cy"),g("rx"),g("ry"));case"polyline":{const p=Bl(d);return new He(p)}case"polygon":{const p=Bl(d);return p.length>1&&p.push(p[0]),new He(p)}case"path":{let p=d.getAttribute("d");return W.isValid(p)||(p=W.normalize(p)),W.parse(p)}case"line":return new F(g("x1"),g("y1"),g("x2"),g("y2"))}return a(d)}n.toGeometryShape=c;function u(d,g,p,b){const m=P.create(g),y=P.create(p);b||(b=d instanceof SVGSVGElement?d:d.ownerSVGElement);const v=tf(d);d.setAttribute("transform","");const w=a(d,{target:b}).scale(v.sx,v.sy),x=Lo();x.setTranslate(-w.x-w.width/2,-w.y-w.height/2);const C=Lo(),S=m.angleBetween(y,m.clone().translate(1,0));S&&C.setRotate(S,0,0);const E=Lo(),A=m.clone().move(y,w.width/2);E.setTranslate(2*m.x-A.x,2*m.y-A.y);const O=Ro(d,b),T=Lo();T.setMatrix(E.matrix.multiply(C.matrix.multiply(x.matrix.multiply(O.scale(v.sx,v.sy))))),d.setAttribute("transform",ms(T.matrix))}n.translateAndAutoOrient=u;function h(d){if(d==null)return null;let g=d;do{let p=g.tagName;if(typeof p!="string")return null;if(p=p.toUpperCase(),gs(g,"x6-port"))g=g.nextElementSibling;else if(p==="G")g=g.firstElementChild;else if(p==="TITLE")g=g.nextElementSibling;else break}while(g);return g}n.findShapeNode=h;function f(d){const g=h(d);if(!Er(g)){if(g1(d)){const{left:y,top:v,width:w,height:x}=l(d);return new D(y,v,w,x)}return new D(0,0,0,0)}const b=c(g).bbox()||D.create(),m=g.getAttribute("transform");if(m){const y=ps(m);return s(b,y)}return b}n.getBBoxV2=f})(de||(de={}));const Nq={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},kq={highlight(n,e,t){const r=kr.getHighlighterId(e,t);if(kr.hasCache(r))return;t=Mb({},t,Nq);const i=ee.create(e);let s,o;try{s=i.toPathData()}catch(u){o=de.bbox(i.node,!0),s=M1(Object.assign(Object.assign({},t),o))}const a=Zn("path");if(fe(a,Object.assign({d:s,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},t.attrs?$o(t.attrs):null)),n.isEdgeElement(e))fe(a,"d",n.getConnectionPathData());else{let u=i.getTransformToElement(n.container);const h=t.padding;if(h){o==null&&(o=de.bbox(i.node,!0));const f=o.x+o.width/2,d=o.y+o.height/2;o=de.transformRectangle(o,u);const g=Math.max(o.width,1),p=Math.max(o.height,1),b=(g+h)/g,m=(p+h)/p,y=ct({a:b,b:0,c:0,d:m,e:f-b*f,f:d-m*d});u=u.multiply(y)}ys(a,u)}K(a,sn.prefix("highlight-stroke"));const l=n.cell,c=()=>kr.removeHighlighter(r);l.on("removed",c),l.model&&l.model.on("reseted",c),n.container.appendChild(a),kr.setCache(r,a)},unhighlight(n,e,t){kr.removeHighlighter(kr.getHighlighterId(e,t))}};var kr;(function(n){function e(o,a){return Gh(o),o.id+JSON.stringify(a)}n.getHighlighterId=e;const t={};function r(o,a){t[o]=a}n.setCache=r;function i(o){return t[o]!=null}n.hasCache=i;function s(o){const a=t[o];a&&(er(a),delete t[o])}n.removeHighlighter=s})(kr||(kr={}));const $q=Object.freeze(Object.defineProperty({__proto__:null,className:Mq,opacity:_q,stroke:kq},Symbol.toStringTag,{value:"Module"}));var rr;(function(n){function e(t,r){if(typeof r.highlight!="function")throw new Error(`Highlighter '${t}' is missing required \`highlight()\` method`);if(typeof r.unhighlight!="function")throw new Error(`Highlighter '${t}' is missing required \`unhighlight()\` method`)}n.check=e})(rr||(rr={})),function(n){n.presets=$q,n.registry=Ue.create({type:"highlighter"}),n.registry.register(n.presets,!0)}(rr||(rr={}));function cf(n,e={}){return new P(Vt(e.x,n.width),Vt(e.y,n.height))}function uf(n,e,t){return Object.assign({angle:e,position:n.toJSON()},t)}const Iq=(n,e)=>n.map(({x:t,y:r,angle:i})=>uf(cf(e,{x:t,y:r}),i||0)),Lq=(n,e,t)=>{const r=t.start||0,i=t.step||20;return aw(n,e,r,(s,o)=>(s+.5-o/2)*i)},Rq=(n,e,t)=>{const r=t.start||0,i=t.step||360/n.length;return aw(n,e,r,s=>s*i)};function aw(n,e,t,r){const i=e.getCenter(),s=e.getTopCenter(),o=e.width/e.height,a=wn.fromRect(e),l=n.length;return n.map((c,u)=>{const h=t+r(u,l),f=s.clone().rotate(-h,i).scale(o,1,i),d=c.compensateRotate?-a.tangentTheta(f):0;return(c.dx||c.dy)&&f.translate(c.dx||0,c.dy||0),c.dr&&f.move(i,c.dr),uf(f.round(),d,c)})}var jq=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const Dq=(n,e,t)=>{const r=cf(e,t.start||e.getOrigin()),i=cf(e,t.end||e.getCorner());return Uo(n,r,i,t)},Bq=(n,e,t)=>Uo(n,e.getTopLeft(),e.getBottomLeft(),t),zq=(n,e,t)=>Uo(n,e.getTopRight(),e.getBottomRight(),t),Fq=(n,e,t)=>Uo(n,e.getTopLeft(),e.getTopRight(),t),Vq=(n,e,t)=>Uo(n,e.getBottomLeft(),e.getBottomRight(),t);function Uo(n,e,t,r){const i=new F(e,t),s=n.length;return n.map((o,a)=>{var{strict:l}=o,c=jq(o,["strict"]);const u=l||r.strict?(a+1)/(s+1):(a+.5)/s,h=i.pointAt(u);return(c.dx||c.dy)&&h.translate(c.dx||0,c.dy||0),uf(h.round(),0,c)})}const qq=Object.freeze(Object.defineProperty({__proto__:null,absolute:Iq,bottom:Vq,ellipse:Lq,ellipseSpread:Rq,left:Bq,line:Dq,right:zq,top:Fq},Symbol.toStringTag,{value:"Module"}));var Ei;(function(n){n.presets=qq,n.registry=Ue.create({type:"port layout"}),n.registry.register(n.presets,!0)})(Ei||(Ei={}));const Gq={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function $r(n,e){const{x:t,y:r,angle:i,attrs:s}=e||{};return Mb({},{angle:i,attrs:s,position:{x:t,y:r}},n,Gq)}const Hq=(n,e,t)=>$r({position:e.getTopLeft()},t),Uq=(n,e,t)=>$r({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},t),Wq=(n,e,t)=>$r({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},t),Xq=(n,e,t)=>$r({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},t),Yq=(n,e,t)=>$r({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},t),Kq=(n,e,t)=>lw(n,e,!1,t),Jq=(n,e,t)=>lw(n,e,!0,t),Qq=(n,e,t)=>cw(n,e,!1,t),Zq=(n,e,t)=>cw(n,e,!0,t);function lw(n,e,t,r){const i=r.offset!=null?r.offset:15,s=e.getCenter().theta(n),o=uw(e);let a,l,c,u,h=0;return s<o[1]||s>o[2]?(a=".3em",l=i,c=0,u="start"):s<o[0]?(a="0",l=0,c=-i,t?(h=-90,u="start"):u="middle"):s<o[3]?(a=".3em",l=-i,c=0,u="end"):(a=".6em",l=0,c=i,t?(h=90,u="start"):u="middle"),$r({position:{x:Math.round(l),y:Math.round(c)},angle:h,attrs:{".":{y:a,"text-anchor":u}}},r)}function cw(n,e,t,r){const i=r.offset!=null?r.offset:15,s=e.getCenter().theta(n),o=uw(e);let a,l,c,u,h=0;return s<o[1]||s>o[2]?(a=".3em",l=-i,c=0,u="end"):s<o[0]?(a=".6em",l=0,c=i,t?(h=90,u="start"):u="middle"):s<o[3]?(a=".3em",l=i,c=0,u="start"):(a="0em",l=0,c=-i,t?(h=-90,u="start"):u="middle"),$r({position:{x:Math.round(l),y:Math.round(c)},angle:h,attrs:{".":{y:a,"text-anchor":u}}},r)}function uw(n){const e=n.getCenter(),t=e.theta(n.getTopLeft()),r=e.theta(n.getBottomLeft()),i=e.theta(n.getBottomRight()),s=e.theta(n.getTopRight());return[t,s,i,r]}const e5=(n,e,t)=>hw(n.diff(e.getCenter()),!1,t),t5=(n,e,t)=>hw(n.diff(e.getCenter()),!0,t);function hw(n,e,t){const r=t.offset!=null?t.offset:20,i=new P(0,0),s=-n.theta(i),o=n.clone().move(i,r).diff(n).round();let a=".3em",l,c=s;return(s+90)%180===0?(l=e?"end":"middle",!e&&s===-270&&(a="0em")):s>-270&&s<-90?(l="start",c=s-180):l="end",$r({position:o.round().toJSON(),angle:e?c:0,attrs:{".":{y:a,"text-anchor":l}}},t)}const n5=Object.freeze(Object.defineProperty({__proto__:null,bottom:Yq,inside:Qq,insideOriented:Zq,left:Uq,manual:Hq,outside:Kq,outsideOriented:Jq,radial:e5,radialOriented:t5,right:Wq,top:Xq},Symbol.toStringTag,{value:"Module"}));var Cs;(function(n){n.presets=n5,n.registry=Ue.create({type:"port label layout"}),n.registry.register(n.presets,!0)})(Cs||(Cs={}));class ge extends wt{get priority(){return 2}constructor(){super(),this.cid=hf.uniqueId(),ge.views[this.cid]=this}confirmUpdate(e,t){return 0}empty(e=this.container){return No(e),this}unmount(e=this.container){return er(e),this}remove(e=this.container){return e===this.container&&(this.removeEventListeners(document),this.onRemove(),delete ge.views[this.cid]),this.unmount(e),this}onRemove(){}setClass(e,t=this.container){t.classList.value=Array.isArray(e)?e.join(" "):e}addClass(e,t=this.container){return K(t,Array.isArray(e)?e.join(" "):e),this}removeClass(e,t=this.container){return gt(t,Array.isArray(e)?e.join(" "):e),this}setStyle(e,t=this.container){return me(t,e),this}setAttrs(e,t=this.container){return e!=null&&t!=null&&fe(t,e),this}findAttr(e,t=this.container){let r=t;for(;r&&r.nodeType===1;){const i=r.getAttribute(e);if(i!=null)return i;if(r===this.container)return null;r=r.parentNode}return null}find(e,t=this.container,r=this.selectors){return ge.find(e,t,r).elems}findOne(e,t=this.container,r=this.selectors){const i=this.find(e,t,r);return i.length>0?i[0]:null}findByAttr(e,t=this.container){let r=t;for(;r&&r.getAttribute;){const i=r.getAttribute(e);if((i!=null||r===this.container)&&i!=="false")return r;r=r.parentNode}return null}getSelector(e,t){let r;if(e===this.container)return typeof t=="string"&&(r=`> ${t}`),r;if(e){const i=Uh(e)+1;r=`${e.tagName.toLowerCase()}:nth-child(${i})`,t&&(r+=` > ${t}`),r=this.getSelector(e.parentNode,r)}return r}prefixClassName(e){return sn.prefix(e)}delegateEvents(e,t){if(e==null)return this;t||this.undelegateEvents();const r=/^(\S+)\s*(.*)$/;return Object.keys(e).forEach(i=>{const s=i.match(r);if(s==null)return;const o=this.getEventHandler(e[i]);typeof o=="function"&&this.delegateEvent(s[1],s[2],o)}),this}undelegateEvents(){return Pe.off(this.container,this.getEventNamespace()),this}delegateDocumentEvents(e,t){return this.addEventListeners(document,e,t),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(e,t,r){return Pe.on(this.container,e+this.getEventNamespace(),t,r),this}undelegateEvent(e,t,r){const i=e+this.getEventNamespace();return t==null?Pe.off(this.container,i):typeof t=="string"?Pe.off(this.container,i,t,r):Pe.off(this.container,i,t),this}addEventListeners(e,t,r){if(t==null)return this;const i=this.getEventNamespace();return Object.keys(t).forEach(s=>{const o=this.getEventHandler(t[s]);typeof o=="function"&&Pe.on(e,s+i,r,o)}),this}removeEventListeners(e){return e!=null&&Pe.off(e,this.getEventNamespace()),this}getEventNamespace(){return`.${sn.prefixCls}-event-${this.cid}`}getEventHandler(e){let t;if(typeof e=="string"){const r=this[e];typeof r=="function"&&(t=(...i)=>r.call(this,...i))}else t=(...r)=>e.call(this,...r);return t}getEventTarget(e,t={}){const{target:r,type:i,clientX:s=0,clientY:o=0}=e;return t.fromPoint||i==="touchmove"||i==="touchend"?document.elementFromPoint(s,o):r}stopPropagation(e){return this.setEventData(e,{propagationStopped:!0}),this}isPropagationStopped(e){return this.getEventData(e).propagationStopped===!0}getEventData(e){return this.eventData(e)}setEventData(e,t){return this.eventData(e,t)}eventData(e,t){if(e==null)throw new TypeError("Event object required");let r=e.data;const i=`__${this.cid}__`;return t==null?r==null?{}:r[i]||{}:(r==null&&(r=e.data={}),r[i]==null?r[i]=Object.assign({},t):r[i]=Object.assign(Object.assign({},r[i]),t),r[i])}normalizeEvent(e){return ge.normalizeEvent(e)}}(function(n){function e(i,s){return s?Zn(i||"g"):Hh(i||"div")}n.createElement=e;function t(i,s,o){if(!i||i===".")return{elems:[s]};if(o){const a=o[i];if(a)return{elems:Array.isArray(a)?a:[a]}}{const a=i.includes(">")?`:scope ${i}`:i;return{isCSSSelector:!0,elems:Array.prototype.slice.call(s.querySelectorAll(a))}}}n.find=t;function r(i){let s=i;const o=i.originalEvent,a=o&&o.changedTouches&&o.changedTouches[0];if(a){for(const l in i)a[l]===void 0&&(a[l]=i[l]);s=a}return s}n.normalizeEvent=r})(ge||(ge={})),function(n){n.views={};function e(t){return n.views[t]||null}n.getView=e}(ge||(ge={}));var hf;(function(n){let e=0;function t(){const r=`v${e}`;return e+=1,r}n.uniqueId=t})(hf||(hf={}));class r5{constructor(e){this.view=e,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new rf,this.pathCache={}}get(e){return this.elemCache.has(e)||this.elemCache.set(e,{}),this.elemCache.get(e)}getData(e){const t=this.get(e);return t.data||(t.data={}),t.data}getMatrix(e){const t=this.get(e);if(t.matrix==null){const r=this.view.container;t.matrix=W4(e,r)}return ct(t.matrix)}getShape(e){const t=this.get(e);return t.shape==null&&(t.shape=de.toGeometryShape(e)),t.shape.clone()}getBoundingRect(e){const t=this.get(e);return t.boundingRect==null&&(t.boundingRect=de.getBBoxV2(e)),t.boundingRect.clone()}}var Ee;(function(n){function e(c){return c!=null&&!t(c)}n.isJSONMarkup=e;function t(c){return c!=null&&typeof c=="string"}n.isStringMarkup=t;function r(c){return c==null||t(c)?c:ze(c)}n.clone=r;function i(c){return`${c}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}n.sanitize=i;function s(c,u={ns:lt.svg}){const h=document.createDocumentFragment(),f={},d={},g=[{markup:Array.isArray(c)?c:[c],parent:h,ns:u.ns}];for(;g.length>0;){const p=g.pop();let b=p.ns||lt.svg;const m=p.markup,y=p.parent;m.forEach(v=>{const w=v.tagName;if(!w)throw new TypeError("Invalid tagName");v.ns&&(b=v.ns);const x=b?Hh(w,b):u1(w),C=v.attrs;C&&fe(x,$o(C));const S=v.style;S&&me(x,S);const E=v.className;E!=null&&x.setAttribute("class",Array.isArray(E)?E.join(" "):E),v.textContent&&(x.textContent=v.textContent);const A=v.selector;if(A!=null){if(d[A])throw new TypeError("Selector must be unique");d[A]=x}if(v.groupSelector){let T=v.groupSelector;Array.isArray(T)||(T=[T]),T.forEach(I=>{f[I]||(f[I]=[]),f[I].push(x)})}y.appendChild(x);const O=v.children;Array.isArray(O)&&g.push({ns:b,markup:O,parent:x})})}return Object.keys(f).forEach(p=>{if(d[p])throw new Error("Ambiguous group selector");d[p]=f[p]}),{fragment:h,selectors:d,groups:f}}n.parseJSONMarkup=s;function o(c){return c instanceof SVGElement?Zn("g"):u1("div")}function a(c){if(t(c)){const d=ee.createVectors(c),g=d.length;if(g===1)return{elem:d[0].node};if(g>1){const p=o(d[0].node);return d.forEach(b=>{p.appendChild(b.node)}),{elem:p}}return{}}const u=s(c),h=u.fragment;let f=null;return h.childNodes.length>1?(f=o(h.firstChild),f.appendChild(h)):f=h.firstChild,{elem:f,selectors:u.selectors}}n.renderMarkup=a;function l(c){const u=ee.createVectors(c),h=document.createDocumentFragment();for(let f=0,d=u.length;f<d;f+=1){const g=u[f].node;h.appendChild(g)}return{fragment:h,selectors:{}}}n.parseLabelStringMarkup=l})(Ee||(Ee={})),function(n){function e(t,r,i){if(t!=null){let s;const o=t.tagName.toLowerCase();if(t===r)return typeof i=="string"?s=`> ${o} > ${i}`:s=`> ${o}`,s;const a=t.parentNode;if(a&&a.childNodes.length>1){const l=Uh(t)+1;s=`${o}:nth-child(${l})`}else s=o;return i&&(s+=` > ${i}`),e(t.parentNode,r,s)}return i}n.getSelector=e}(Ee||(Ee={})),function(n){function e(){return"g"}n.getPortContainerMarkup=e;function t(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}n.getPortMarkup=t;function r(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}n.getPortLabelMarkup=r}(Ee||(Ee={})),function(n){function e(){return[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}]}n.getEdgeMarkup=e}(Ee||(Ee={})),function(n){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:lt.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:lt.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}n.getForeignObjectMarkup=e}(Ee||(Ee={}));class fw{constructor(e){this.view=e}get cell(){return this.view.cell}getDefinition(e){return this.cell.getAttrDefinition(e)}processAttrs(e,t){let r,i,s,o;const a=[];return Object.keys(t).forEach(l=>{const c=t[l],u=this.getDefinition(l),h=Y(Bn.isValidDefinition,this.view,u,c,{elem:e,attrs:t,cell:this.cell,view:this.view});if(u&&h)typeof u=="string"?(r==null&&(r={}),r[u]=c):c!==null&&a.push({name:l,definition:u});else{r==null&&(r={});const f=p1.includes(l)?l:Hb(l);r[f]=c}}),a.forEach(({name:l,definition:c})=>{const u=t[l];typeof c.set=="function"&&(i==null&&(i={}),i[l]=u),typeof c.offset=="function"&&(s==null&&(s={}),s[l]=u),typeof c.position=="function"&&(o==null&&(o={}),o[l]=u)}),{raw:t,normal:r,set:i,offset:s,position:o}}mergeProcessedAttrs(e,t){e.set=Object.assign(Object.assign({},e.set),t.set),e.position=Object.assign(Object.assign({},e.position),t.position),e.offset=Object.assign(Object.assign({},e.offset),t.offset);const r=e.normal&&e.normal.transform;r!=null&&t.normal&&(t.normal.transform=r),e.normal=t.normal}findAttrs(e,t,r,i){const s=[],o=new rf;return Object.keys(e).forEach(a=>{const l=e[a];if(!Ln(l))return;const{isCSSSelector:c,elems:u}=ge.find(a,t,i);r[a]=u;for(let h=0,f=u.length;h<f;h+=1){const d=u[h],g=i&&i[a]===d,p=o.get(d);if(p){p.array||(s.push(d),p.array=!0,p.attrs=[p.attrs],p.priority=[p.priority]);const b=p.attrs,m=p.priority;if(g)b.unshift(l),m.unshift(-1);else{const y=FV(m,c?-1:f);b.splice(y,0,l),m.splice(y,0,f)}}else o.set(d,{elem:d,attrs:l,priority:g?-1:f,array:!1})}}),s.forEach(a=>{const l=o.get(a),c=l.attrs;l.attrs=c.reduceRight((u,h)=>Ie(u,h),{})}),o}updateRelativeAttrs(e,t,r){const i=t.raw||{};let s=t.normal||{};const o=t.set,a=t.position,l=t.offset,c=()=>({elem:e,cell:this.cell,view:this.view,attrs:i,refBBox:r.clone()});if(o!=null&&Object.keys(o).forEach(b=>{const m=o[b],y=this.getDefinition(b);if(y!=null){const v=Y(y.set,this.view,m,c());typeof v=="object"?s=Object.assign(Object.assign({},s),v):v!=null&&(s[b]=v)}}),e instanceof HTMLElement){this.view.setAttrs(s,e);return}const u=s.transform,h=u?`${u}`:null,f=ps(h),d=new P(f.e,f.f);u&&(delete s.transform,f.e=0,f.f=0);let g=!1;a!=null&&Object.keys(a).forEach(b=>{const m=a[b],y=this.getDefinition(b);if(y!=null){const v=Y(y.position,this.view,m,c());v!=null&&(g=!0,d.translate(P.create(v)))}}),this.view.setAttrs(s,e);let p=!1;if(l!=null){const b=this.view.getBoundingRectOfElement(e);if(b.width>0&&b.height>0){const m=de.transformRectangle(b,f);Object.keys(l).forEach(y=>{const v=l[y],w=this.getDefinition(y);if(w!=null){const x=Y(w.offset,this.view,v,{elem:e,cell:this.cell,view:this.view,attrs:i,refBBox:m});x!=null&&(p=!0,d.translate(P.create(x)))}})}}(u!=null||g||p)&&(d.round(1),f.e=d.x,f.f=d.y,e.setAttribute("transform",ms(f)))}update(e,t,r){const i={},s=this.findAttrs(r.attrs||t,e,i,r.selectors),o=r.attrs?this.findAttrs(t,e,i,r.selectors):s,a=[];s.each(u=>{const h=u.elem,f=u.attrs,d=this.processAttrs(h,f);if(d.set==null&&d.position==null&&d.offset==null)this.view.setAttrs(d.normal,h);else{const g=o.get(h),p=g?g.attrs:null,b=p&&f.ref==null?p.ref:f.ref;let m;if(b){if(m=(i[b]||this.view.find(b,e,r.selectors))[0],!m)throw new Error(`"${b}" reference does not exist.`)}else m=null;const y={node:h,refNode:m,attributes:p,processedAttributes:d},v=a.findIndex(w=>w.refNode===h);v>-1?a.splice(v,0,y):a.push(y)}});const l=new rf;let c;a.forEach(u=>{const h=u.node,f=u.refNode;let d;const g=f!=null&&r.rotatableNode!=null&&f1(r.rotatableNode,f);if(f&&(d=l.get(f)),!d){const m=g?r.rotatableNode:e;d=f?de.getBBox(f,{target:m}):r.rootBBox,f&&l.set(f,d)}let p;r.attrs&&u.attributes?(p=this.processAttrs(h,u.attributes),this.mergeProcessedAttrs(p,u.processedAttributes)):p=u.processedAttributes;let b=d;g&&r.rotatableNode!=null&&!r.rotatableNode.contains(h)&&(c||(c=ps(fe(r.rotatableNode,"transform"))),b=de.transformRectangle(d,c)),this.updateRelativeAttrs(h,p,b)})}}class dw{get cell(){return this.view.cell}constructor(e,t,r=[]){this.view=e;const i={},s={};let o=0;Object.keys(t).forEach(l=>{let c=t[l];Array.isArray(c)||(c=[c]),c.forEach(u=>{let h=i[u];h||(o+=1,h=i[u]=1<<o),s[l]|=h})});let a=r;if(Array.isArray(a)||(a=[a]),a.forEach(l=>{i[l]||(o+=1,i[l]=1<<o)}),o>25)throw new Error("Maximum number of flags exceeded.");this.flags=i,this.attrs=s,this.bootstrap=r}getFlag(e){const t=this.flags;return t==null?0:Array.isArray(e)?e.reduce((r,i)=>r|t[i],0):t[e]|0}hasAction(e,t){return e&this.getFlag(t)}removeAction(e,t){return e^e&this.getFlag(t)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let e=0;return this.attrs&&Object.keys(this.attrs).forEach(t=>{this.cell.hasChanged(t)&&(e|=this.attrs[t])}),e}}var i5=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class rt extends ge{static getDefaults(){return this.defaults}static config(e){this.defaults=this.getOptions(e)}static getOptions(e){const t=(c,u)=>u!=null?Db([...Array.isArray(c)?c:[c],...Array.isArray(u)?u:[u]]):Array.isArray(c)?[...c]:[c],r=ze(this.getDefaults()),{bootstrap:i,actions:s,events:o,documentEvents:a}=e,l=i5(e,["bootstrap","actions","events","documentEvents"]);return i&&(r.bootstrap=t(r.bootstrap,i)),s&&Object.entries(s).forEach(([c,u])=>{const h=r.actions[c];u&&h?r.actions[c]=t(h,u):u&&(r.actions[c]=t(u))}),o&&(r.events=Object.assign(Object.assign({},r.events),o)),e.documentEvents&&(r.documentEvents=Object.assign(Object.assign({},r.documentEvents),a)),Ie(r,l)}get[Symbol.toStringTag](){return rt.toStringTag}constructor(e,t={}){super(),this.cell=e,this.options=this.ensureOptions(t),this.graph=this.options.graph,this.attr=new fw(this),this.flag=new dw(this,this.options.actions,this.options.bootstrap),this.cache=new r5(this),this.setContainer(this.ensureContainer()),this.setup(),this.init()}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(e){return this.getConstructor().getOptions(e)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return ge.createElement(this.getContainerTagName(),this.options.isSvgElement)}setContainer(e){if(this.container!==e){this.undelegateEvents(),this.container=e,this.options.events!=null&&this.delegateEvents(this.options.events);const t=this.getContainerAttrs();t!=null&&this.setAttrs(t,e);const r=this.getContainerStyle();r!=null&&this.setStyle(r,e);const i=this.getContainerClassName();i!=null&&this.addClass(i,e)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(e,t={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(e){return this.flag.getFlag(e)}hasAction(e,t){return this.flag.hasAction(e,t)}removeAction(e,t){return this.flag.removeAction(e,t)}handleAction(e,t,r,i){if(this.hasAction(e,t)){r();const s=[t];return i&&(typeof i=="string"?s.push(i):s.push(...i)),this.removeAction(e,s)}return e}setup(){this.cell.on("changed",({options:e})=>this.onAttrsChange(e))}onAttrsChange(e){let t=this.flag.getChangedFlag();e.updated||!t||(e.dirty&&this.hasAction(t,"update")&&(t|=this.getFlag("render")),e.toolId&&(e.async=!1),this.graph!=null&&this.graph.renderer.requestViewUpdate(this,t,e))}parseJSONMarkup(e,t){const r=Ee.parseJSONMarkup(e),i=r.selectors,s=this.rootSelector;if(t&&s){if(i[s])throw new Error("Invalid root selector");i[s]=t}return r}can(e){let t=this.graph.options.interacting;if(typeof t=="function"&&(t=Y(t,this.graph,this)),typeof t=="object"){let r=t[e];return typeof r=="function"&&(r=Y(r,this.graph,this)),r!==!1}return typeof t=="boolean"?t:!1}cleanCache(){return this.cache.clean(),this}getCache(e){return this.cache.get(e)}getDataOfElement(e){return this.cache.getData(e)}getMatrixOfElement(e){return this.cache.getMatrix(e)}getShapeOfElement(e){return this.cache.getShape(e)}getBoundingRectOfElement(e){return this.cache.getBoundingRect(e)}getBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),r=this.getMatrixOfElement(e),i=this.getRootRotatedMatrix(),s=this.getRootTranslatedMatrix();return de.transformRectangle(t,s.multiply(i).multiply(r))}getUnrotatedBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),r=this.getMatrixOfElement(e),i=this.getRootTranslatedMatrix();return de.transformRectangle(t,i.multiply(r))}getBBox(e={}){let t;if(e.useCellGeometry){const r=this.cell,i=r.isNode()?r.getAngle():0;t=r.getBBox().bbox(i)}else t=this.getBBoxOfElement(this.container);return this.graph.coord.localToGraphRect(t)}getRootTranslatedMatrix(){const e=this.cell,t=e.isNode()?e.getPosition():{x:0,y:0};return ct().translate(t.x,t.y)}getRootRotatedMatrix(){let e=ct();const t=this.cell,r=t.isNode()?t.getAngle():0;if(r){const i=t.getBBox(),s=i.width/2,o=i.height/2;e=e.translate(s,o).rotate(r).translate(-s,-o)}return e}findMagnet(e=this.container){return this.findByAttr("magnet",e)}updateAttrs(e,t,r={}){r.rootBBox==null&&(r.rootBBox=new D),r.selectors==null&&(r.selectors=this.selectors),this.attr.update(e,t,r)}isEdgeElement(e){return this.cell.isEdge()&&(e==null||e===this.container)}prepareHighlight(e,t={}){const r=e||this.container;return t.partial=r===this.container,r}highlight(e,t={}){const r=this.prepareHighlight(e,t);return this.notify("cell:highlight",{magnet:r,options:t,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:r,options:t,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:r,options:t,view:this,node:this.cell,cell:this.cell}),this}unhighlight(e,t={}){const r=this.prepareHighlight(e,t);return this.notify("cell:unhighlight",{magnet:r,options:t,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:r,options:t,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:r,options:t,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(e,t){}getEdgeTerminal(e,t,r,i,s){const o=this.cell,a=this.findAttr("port",e),l=e.getAttribute("data-selector"),c={cell:o.id};return l!=null&&(c.magnet=l),a!=null?(c.port=a,o.isNode()&&!o.hasPort(a)&&l==null&&(c.selector=this.getSelector(e))):l==null&&this.container!==e&&(c.selector=this.getSelector(e)),c}getMagnetFromEdgeTerminal(e){const t=this.cell,r=this.container,i=e.port;let s=e.magnet,o;return i!=null&&t.isNode()&&t.hasPort(i)?o=this.findPortElem(i,s)||r:(s||(s=e.selector),!s&&i!=null&&(s=`[port="${i}"]`),o=this.findOne(s,r,this.selectors)),o}hasTools(e){const t=this.tools;return t==null?!1:e==null?!0:t.name===e}addTools(e){if(!this.can("toolsAddable"))return this;if(this.removeTools(),e){const t=et.isToolsView(e)?e:new et(e);this.tools=t,t.config({view:this}),t.mount()}return this}updateTools(e={}){return this.tools&&this.tools.update(e),this}removeTools(){return this.tools&&(this.tools.remove(),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){const e=this.cell.getTools();return this.addTools(e),this}notify(e,t){return this.trigger(e,t),this.graph.trigger(e,t),this}getEventArgs(e,t,r){const i=this,s=i.cell;return t==null||r==null?{e,view:i,cell:s}:{e,x:t,y:r,view:i,cell:s}}onClick(e,t,r){this.notify("cell:click",this.getEventArgs(e,t,r))}onDblClick(e,t,r){this.notify("cell:dblclick",this.getEventArgs(e,t,r))}onContextMenu(e,t,r){this.notify("cell:contextmenu",this.getEventArgs(e,t,r))}onMouseDown(e,t,r){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(e,t,r))}onMouseUp(e,t,r){this.notify("cell:mouseup",this.getEventArgs(e,t,r)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(e,t,r){this.notify("cell:mousemove",this.getEventArgs(e,t,r))}onMouseOver(e){this.notify("cell:mouseover",this.getEventArgs(e))}onMouseOut(e){this.notify("cell:mouseout",this.getEventArgs(e))}onMouseEnter(e){this.notify("cell:mouseenter",this.getEventArgs(e))}onMouseLeave(e){this.notify("cell:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,r,i){this.notify("cell:mousewheel",Object.assign({delta:i},this.getEventArgs(e,t,r)))}onCustomEvent(e,t,r,i){this.notify("cell:customevent",Object.assign({name:t},this.getEventArgs(e,r,i))),this.notify(t,Object.assign({},this.getEventArgs(e,r,i)))}onMagnetMouseDown(e,t,r,i){}onMagnetDblClick(e,t,r,i){}onMagnetContextMenu(e,t,r,i){}onLabelMouseDown(e,t,r){}checkMouseleave(e){const t=this.getEventTarget(e,{fromPoint:!0}),r=this.graph.findViewByElem(t);r!==this&&(this.onMouseLeave(e),r&&r.onMouseEnter(e))}}rt.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},function(n){n.Flag=dw,n.Attr=fw}(rt||(rt={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNodeView=="function"&&typeof i.isEdgeView=="function"&&typeof i.confirmUpdate=="function"}n.isCellView=e}(rt||(rt={})),function(n){function e(r){return function(i){i.config({priority:r})}}n.priority=e;function t(r){return function(i){i.config({bootstrap:r})}}n.bootstrap=t}(rt||(rt={})),function(n){n.registry=Ue.create({type:"view"})}(rt||(rt={}));class et extends ge{get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return et.toStringTag}constructor(e={}){super(),this.svgContainer=this.createContainer(!0,e),this.htmlContainer=this.createContainer(!1,e),this.config(e)}createContainer(e,t){const r=e?ge.createElement("g",!0):ge.createElement("div",!1);return K(r,this.prefixClassName("cell-tools")),t.className&&K(r,t.className),r}config(e){if(this.options=Object.assign(Object.assign({},this.options),e),!rt.isCellView(e.view)||e.view===this.cellView)return this;this.cellView=e.view,this.cell.isEdge()?(K(this.svgContainer,this.prefixClassName("edge-tools")),K(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(K(this.svgContainer,this.prefixClassName("node-tools")),K(this.htmlContainer,this.prefixClassName("node-tools"))),this.svgContainer.setAttribute("data-cell-id",this.cell.id),this.htmlContainer.setAttribute("data-cell-id",this.cell.id),this.name&&(this.svgContainer.setAttribute("data-tools-name",this.name),this.htmlContainer.setAttribute("data-tools-name",this.name));const t=this.options.items;if(!Array.isArray(t))return this;this.tools=[];const r=[];t.forEach(i=>{et.ToolItem.isToolItem(i)?i.name==="vertices"?r.unshift(i):r.push(i):(typeof i=="object"?i.name:i)==="vertices"?r.unshift(i):r.push(i)});for(let i=0;i<r.length;i+=1){const s=r[i];let o;if(et.ToolItem.isToolItem(s))o=s;else{const a=typeof s=="object"?s.name:s,l=typeof s=="object"?s.args||{}:{};if(a){if(this.cell.isNode()){const c=Ps.registry.get(a);if(c)o=new c(l);else return Ps.registry.onNotFound(a)}else if(this.cell.isEdge()){const c=Es.registry.get(a);if(c)o=new c(l);else return Es.registry.onNotFound(a)}}}o&&(o.config(this.cellView,this),o.render(),(o.options.isSVGElement!==!1?this.svgContainer:this.htmlContainer).appendChild(o.container),this.tools.push(o))}return this}update(e={}){const t=this.tools;return t&&t.forEach(r=>{e.toolId!==r.cid&&r.isVisible()&&r.update()}),this}focus(e){const t=this.tools;return t&&t.forEach(r=>{e===r?r.show():r.hide()}),this}blur(e){const t=this.tools;return t&&t.forEach(r=>{r!==e&&!r.isVisible()&&(r.show(),r.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const e=this.tools;return e&&(e.forEach(t=>t.remove()),this.tools=null),er(this.svgContainer),er(this.htmlContainer),super.remove()}mount(){const e=this.tools,t=this.cellView;if(t&&e){const r=e.some(s=>s.options.isSVGElement!==!1),i=e.some(s=>s.options.isSVGElement===!1);r&&(this.options.local?t.container:t.graph.view.decorator).appendChild(this.svgContainer),i&&this.graph.container.appendChild(this.htmlContainer)}return this}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&i.graph!=null&&i.cell!=null&&typeof i.config=="function"&&typeof i.update=="function"&&typeof i.focus=="function"&&typeof i.blur=="function"&&typeof i.show=="function"&&typeof i.hide=="function"}n.isToolsView=e})(et||(et={})),function(n){class e extends ge{static getDefaults(){return this.defaults}static config(r){this.defaults=this.getOptions(r)}static getOptions(r){return Ie(ze(this.getDefaults()),r)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return e.toStringTag}constructor(r={}){super(),this.visible=!0,this.options=this.getOptions(r),this.container=ge.createElement(this.options.tagName||"g",this.options.isSVGElement!==!1),K(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&K(this.container,this.options.className),this.init()}init(){}getOptions(r){return this.constructor.getOptions(r)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(r,i){return this.cellView=r,this.parent=i,this.stamp(this.container),this.cell.isEdge()?K(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&K(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();const r=this.options.markup;if(r){const i=Ee.parseJSONMarkup(r);this.container.appendChild(i.fragment),this.childNodes=i.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(r){r&&r.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return this.visible}focus(){const r=this.options.focusOpacity;return r!=null&&Number.isFinite(r)&&(this.container.style.opacity=`${r}`),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(r){return this.graph==null||this.cellView==null?!0:this.graph.view.guard(r,this.cellView)}}e.defaults={isSVGElement:!0,tagName:"g"},n.ToolItem=e,function(t){let r=0;function i(o){return o?Dh(o):(r+=1,`CustomTool${r}`)}function s(o){const a=Rh(i(o.name),this);return a.config(o),a}t.define=s}(e=n.ToolItem||(n.ToolItem={})),function(t){t.toStringTag=`X6.${t.name}`;function r(i){if(i==null)return!1;if(i instanceof t)return!0;const s=i[Symbol.toStringTag],o=i;return(s==null||s===t.toStringTag)&&o.graph!=null&&o.cell!=null&&typeof o.config=="function"&&typeof o.update=="function"&&typeof o.focus=="function"&&typeof o.blur=="function"&&typeof o.show=="function"&&typeof o.hide=="function"&&typeof o.isVisible=="function"}t.isToolItem=r}(e=n.ToolItem||(n.ToolItem={}))}(et||(et={}));const s5=n=>n;function gw(n,e){return e===0?"0%":`${Math.round(n/e*100)}%`}function pw(n){return(t,r,i,s)=>r.isEdgeElement(i)?a5(n,t,r,i,s):o5(n,t,r,i,s)}function o5(n,e,t,r,i){const s=t.cell,o=s.getAngle(),a=t.getUnrotatedBBoxOfElement(r),l=s.getBBox().getCenter(),c=P.create(i).rotate(o,l);let u=c.x-a.x,h=c.y-a.y;return n&&(u=gw(u,a.width),h=gw(h,a.height)),e.anchor={name:"topLeft",args:{dx:u,dy:h,rotate:!0}},e}function a5(n,e,t,r,i){const s=t.getConnection();if(!s)return e;const o=s.closestPointLength(i);if(n){const a=s.length();e.anchor={name:"ratio",args:{ratio:o/a}}}else e.anchor={name:"length",args:{length:o}};return e}const l5=pw(!0),c5=pw(!1),u5=Object.freeze(Object.defineProperty({__proto__:null,noop:s5,pinAbsolute:c5,pinRelative:l5},Symbol.toStringTag,{value:"Module"}));var ff;(function(n){n.presets=u5,n.registry=Ue.create({type:"connection strategy"}),n.registry.register(n.presets,!0)})(ff||(ff={}));function mw(n,e,t,r){return Y(ff.presets.pinRelative,this.graph,{},e,t,n,this.cell,r,{}).anchor}function yw(n,e){return e?n.cell.getBBox():n.cell.isEdge()?n.getConnection().bbox():n.getUnrotatedBBoxOfElement(n.container)}class Ir extends et.ToolItem{onRender(){K(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const t=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();ys(this.container,t,{absolute:!0})}getNodeMatrix(){const e=this.cellView,t=this.options;let{x:r=0,y:i=0}=t;const{offset:s,useCellGeometry:o,rotate:a}=t;let l=yw(e,o);const c=e.cell.getAngle();a||(l=l.bbox(c));let u=0,h=0;typeof s=="number"?(u=s,h=s):typeof s=="object"&&(u=s.x,h=s.y),r=Vt(r,l.width),i=Vt(i,l.height);let f=ct().translate(l.x+l.width/2,l.y+l.height/2);return a&&(f=f.rotate(c)),f=f.translate(r+u-l.width/2,i+h-l.height/2),f}getEdgeMatrix(){const e=this.cellView,t=this.options,{offset:r=0,distance:i=0,rotate:s}=t;let o,a,l;const c=Vt(i,1);c>=0&&c<=1?o=e.getTangentAtRatio(c):o=e.getTangentAtLength(c),o?(a=o.start,l=o.vector().vectorAngle(new P(1,0))||0):(a=e.getConnection().start,l=0);let u=ct().translate(a.x,a.y).rotate(l);return typeof r=="object"?u=u.translate(r.x||0,r.y||0):u=u.translate(0,r),s||(u=u.rotate(-l)),u}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();const t=this.options.onClick;typeof t=="function"&&Y(t,this.cellView,{e,view:this.cellView,cell:this.cellView.cell,btn:this})}}(function(n){n.config({name:"button",useCellGeometry:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}})})(Ir||(Ir={})),function(n){n.Remove=n.define({name:"button-remove",markup:[{tagName:"circle",selector:"button",attrs:{r:7,fill:"#FF1D00",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -3 -3 3 3 M -3 3 3 -3",fill:"none",stroke:"#FFFFFF","stroke-width":2,"pointer-events":"none"}}],distance:60,offset:0,useCellGeometry:!0,onClick({view:e,btn:t}){t.parent.remove(),e.cell.remove({ui:!0,toolId:t.cid})}})}(Ir||(Ir={}));var h5=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class Xl extends et.ToolItem{onRender(){if(K(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const e=this.options.attrs,{class:t}=e,r=h5(e,["class"]);fe(this.container,$o(r)),t&&K(this.container,t)}this.update()}update(){const e=this.cellView,t=this.options,{useCellGeometry:r,rotate:i}=t,s=Rn(t.padding);let o=yw(e,r).moveAndExpand({x:-s.left,y:-s.top,width:s.left+s.right,height:s.top+s.bottom});const a=e.cell;if(a.isNode()){const l=a.getAngle();if(l)if(i){const c=a.getBBox().getCenter();ef(this.container,l,c.x,c.y,{absolute:!0})}else o=o.bbox(l)}return fe(this.container,o.toJSON()),this}}(function(n){n.config({name:"boundary",tagName:"rect",padding:10,useCellGeometry:!0,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}})})(Xl||(Xl={}));class Wo extends et.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){return this.vertices.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){const e=this.handles;this.handles=[],e&&e.forEach(t=>{this.stopHandleListening(t),t.remove()})}renderHandles(){const e=this.vertices;for(let t=0,r=e.length;t<r;t+=1){const i=e[t],s=this.options.createHandle,o=this.options.processHandle,a=s({index:t,graph:this.graph,guard:l=>this.guard(l),attrs:this.options.attrs||{}});o&&o(a),a.updatePosition(i.x,i.y),this.stamp(a.container),this.container.appendChild(a.container),this.handles.push(a),this.startHandleListening(a)}}updateHandles(){const e=this.vertices;for(let t=0,r=e.length;t<r;t+=1){const i=e[t],s=this.handles[t];s&&s.updatePosition(i.x,i.y)}}updatePath(){const e=this.childNodes.connection;e&&e.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(e){const t=this.cellView;t.can("vertexMovable")&&(e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.on("remove",this.onHandleRemove,this)}stopHandleListening(e){const t=this.cellView;t.can("vertexMovable")&&(e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.off("remove",this.onHandleRemove,this)}getNeighborPoints(e){const t=this.cellView,r=this.vertices,i=e>0?r[e-1]:t.sourceAnchor,s=e<r.length-1?r[e+1]:t.targetAnchor;return{prev:P.create(i),next:P.create(s)}}getMouseEventArgs(e){const t=this.normalizeEvent(e),{x:r,y:i}=this.graph.snapToGrid(t.clientX,t.clientY);return{e:t,x:r,y:i}}onHandleChange({e}){this.focus();const t=this.cellView;if(t.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:r,x:i,y:s}=this.getMouseEventArgs(e);t.notifyMouseDown(r,i,s)}}onHandleChanging({handle:e,e:t}){const r=this.cellView,i=e.options.index,{e:s,x:o,y:a}=this.getMouseEventArgs(t),l={x:o,y:a};this.snapVertex(l,i),r.cell.setVertexAt(i,l,{ui:!0,toolId:this.cid}),e.updatePosition(l.x,l.y),this.options.stopPropagation||r.notifyMouseMove(s,o,a)}stopBatch(e){this.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),e&&this.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid})}onHandleChanged({e}){const t=this.options,r=this.cellView;if(t.addable&&this.updatePath(),!t.removeRedundancies){this.stopBatch(this.eventData(e).vertexAdded);return}r.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&this.render(),this.blur(),this.stopBatch(this.eventData(e).vertexAdded);const{e:s,x:o,y:a}=this.getMouseEventArgs(e);this.options.stopPropagation||r.notifyMouseUp(s,o,a),r.checkMouseleave(s),t.onChanged&&t.onChanged({edge:r.cell,edgeView:r})}snapVertex(e,t){const r=this.options.snapRadius||0;if(r>0){const i=this.getNeighborPoints(t),s=i.prev,o=i.next;Math.abs(e.x-s.x)<r?e.x=s.x:Math.abs(e.x-o.x)<r&&(e.x=o.x),Math.abs(e.y-s.y)<r?e.y=i.prev.y:Math.abs(e.y-o.y)<r&&(e.y=o.y)}}onHandleRemove({handle:e,e:t}){if(this.options.removable){const r=e.options.index,i=this.cellView;i.cell.removeVertexAt(r,{ui:!0}),this.options.addable&&this.updatePath(),i.checkMouseleave(this.normalizeEvent(t))}}allowAddVertex(e){const t=this.guard(e),r=this.options.addable&&this.cellView.can("vertexAddable"),i=this.options.modifiers?nr.isMatch(e,this.options.modifiers):!0;return!t&&r&&i}onPathMouseDown(e){const t=this.cellView;if(!this.allowAddVertex(e))return;e.stopPropagation(),e.preventDefault();const r=this.normalizeEvent(e),i=this.graph.snapToGrid(r.clientX,r.clientY).toJSON();t.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const s=t.getVertexIndex(i.x,i.y);this.snapVertex(i,s),t.cell.insertVertex(i,s,{ui:!0,toolId:this.cid}),this.render();const o=this.handles[s];this.eventData(r,{vertexAdded:!0}),o.onMouseDown(r)}onRemove(){this.resetHandles()}}(function(n){class e extends ge{get graph(){return this.options.graph}constructor(r){super(),this.options=r,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}render(){this.container=ge.createElement("circle",!0);const r=this.options.attrs;if(typeof r=="function"){const i=n.getDefaults();this.setAttrs(Object.assign(Object.assign({},i.attrs),r(this)))}else this.setAttrs(r);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(r,i){this.setAttrs({cx:r,cy:i})}onMouseDown(r){this.options.guard(r)||(r.stopPropagation(),r.preventDefault(),this.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},r.data),this.emit("change",{e:r,handle:this}))}onMouseMove(r){this.emit("changing",{e:r,handle:this})}onMouseUp(r){this.emit("changed",{e:r,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(r){this.emit("remove",{e:r,handle:this})}}n.Handle=e})(Wo||(Wo={})),function(n){const e=sn.prefix("edge-tool-vertex-path");n.config({name:"vertices",snapRadius:20,addable:!0,removable:!0,removeRedundancies:!0,stopPropagation:!0,attrs:{r:6,fill:"#333",stroke:"#fff",cursor:"move","stroke-width":2},createHandle:t=>new n.Handle(t),markup:[{tagName:"path",selector:"connection",className:e,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${e}`]:"onPathMouseDown",[`touchstart .${e}`]:"onPathMouseDown"}})}(Wo||(Wo={}));class Xo extends et.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){K(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const e=this.cellView,t=[...this.vertices];t.unshift(e.sourcePoint),t.push(e.targetPoint);for(let r=0,i=t.length;r<i-1;r+=1){const s=t[r],o=t[r+1],a=this.renderHandle(s,o,r);this.stamp(a.container),this.handles.push(a)}return this}renderHandle(e,t,r){const i=this.options.createHandle({index:r,graph:this.graph,guard:s=>this.guard(s),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(i),this.updateHandle(i,e,t),this.container.appendChild(i.container),this.startHandleListening(i),i}startHandleListening(e){e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)}stopHandleListening(e){e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)}resetHandles(){const e=this.handles;this.handles=[],e&&e.forEach(t=>{this.stopHandleListening(t),t.remove()})}shiftHandleIndexes(e){const t=this.handles;for(let r=0,i=t.length;r<i;r+=1)t[r].options.index+=e}resetAnchor(e,t){const r=this.cellView.cell,i={ui:!0,toolId:this.cid};t?r.prop([e,"anchor"],t,i):r.removeProp([e,"anchor"],i)}snapHandle(e,t,r){const i=e.options.axis,s=e.options.index,l=this.cellView.cell.getVertices(),c=l[s-2]||r.sourceAnchor,u=l[s+1]||r.targetAnchor,h=this.options.snapRadius;return Math.abs(t[i]-c[i])<h?t[i]=c[i]:Math.abs(t[i]-u[i])<h&&(t[i]=u[i]),t}onHandleChanging({handle:e,e:t}){const r=this.graph,i=this.options,s=this.cellView,o=i.anchor,a=e.options.axis,l=e.options.index-1,c=this.getEventData(t),u=this.normalizeEvent(t),h=r.snapToGrid(u.clientX,u.clientY),f=this.snapHandle(e,h.clone(),c),d=ze(this.vertices);let g=d[l],p=d[l+1];const b=s.sourceView,m=s.sourceBBox;let y=!1,v=!1;if(g?l===0?m.containsPoint(g)?(d.shift(),this.shiftHandleIndexes(-1),y=!0):(g[a]=f[a],v=!0):g[a]=f[a]:(g=s.sourceAnchor.toJSON(),g[a]=f[a],m.containsPoint(g)?y=!0:(d.unshift(g),this.shiftHandleIndexes(1),v=!0)),typeof o=="function"&&b){if(y){const E=c.sourceAnchor.clone();E[a]=f[a];const A=Y(o,s,E,b,s.sourceMagnet||b.container,"source",s,this);this.resetAnchor("source",A)}v&&this.resetAnchor("source",c.sourceAnchorDef)}const w=s.targetView,x=s.targetBBox;let C=!1,S=!1;if(p?l===d.length-2?x.containsPoint(p)?(d.pop(),C=!0):(p[a]=f[a],S=!0):p[a]=f[a]:(p=s.targetAnchor.toJSON(),p[a]=f[a],x.containsPoint(p)?C=!0:(d.push(p),S=!0)),typeof o=="function"&&w){if(C){const E=c.targetAnchor.clone();E[a]=f[a];const A=Y(o,s,E,w,s.targetMagnet||w.container,"target",s,this);this.resetAnchor("target",A)}S&&this.resetAnchor("target",c.targetAnchorDef)}P.equalPoints(d,this.vertices)||this.cellView.cell.setVertices(d,{ui:!0,toolId:this.cid}),this.updateHandle(e,g,p,0),i.stopPropagation||s.notifyMouseMove(u,h.x,h.y)}onHandleChange({handle:e,e:t}){const r=this.options,i=this.handles,s=this.cellView,o=e.options.index;if(Array.isArray(i)){for(let a=0,l=i.length;a<l;a+=1)a!==o&&i[a].hide();if(this.focus(),this.setEventData(t,{sourceAnchor:s.sourceAnchor.clone(),targetAnchor:s.targetAnchor.clone(),sourceAnchorDef:ze(this.cell.prop(["source","anchor"])),targetAnchorDef:ze(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!r.stopPropagation){const a=this.normalizeEvent(t),l=this.graph.snapToGrid(a.clientX,a.clientY);s.notifyMouseDown(a,l.x,l.y)}}}onHandleChanged({e}){const t=this.options,r=this.cellView;t.removeRedundancies&&r.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const i=this.normalizeEvent(e),s=this.graph.snapToGrid(i.clientX,i.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),t.stopPropagation||r.notifyMouseUp(i,s.x,s.y),r.checkMouseleave(i),t.onChanged&&t.onChanged({edge:r.cell,edgeView:r})}updateHandle(e,t,r,i=0){const s=this.options.precision||0,o=Math.abs(t.x-r.x)<s,a=Math.abs(t.y-r.y)<s;if(o||a){const l=new F(t,r);if(l.length()<this.options.threshold)e.hide();else{const u=l.getCenter(),h=o?"x":"y";u[h]+=i||0;const f=l.vector().vectorAngle(new P(1,0));e.updatePosition(u.x,u.y,f,this.cellView),e.show(),e.options.axis=h}}else e.hide()}onRemove(){this.resetHandles()}}(function(n){class e extends ge{constructor(r){super(),this.options=r,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=ge.createElement("rect",!0);const r=this.options.attrs;if(typeof r=="function"){const i=n.getDefaults();this.setAttrs(Object.assign(Object.assign({},i.attrs),r(this)))}else this.setAttrs(r);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(r,i,s,o){const a=o.getClosestPoint(new P(r,i))||new P(r,i);let l=ct().translate(a.x,a.y);if(a.equals({x:r,y:i}))l=l.rotate(s);else{let u=new F(r,i,a.x,a.y).vector().vectorAngle(new P(1,0));u!==0&&(u+=90),l=l.rotate(u)}this.setAttrs({transform:ms(l),cursor:s%180===0?"row-resize":"col-resize"})}onMouseDown(r){this.options.guard(r)||(this.trigger("change",{e:r,handle:this}),r.stopPropagation(),r.preventDefault(),this.options.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},r.data))}onMouseMove(r){this.emit("changing",{e:r,handle:this})}onMouseUp(r){this.emit("changed",{e:r,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}}n.Handle=e})(Xo||(Xo={})),function(n){n.config({name:"segments",precision:.5,threshold:40,snapRadius:10,stopPropagation:!0,removeRedundancies:!0,attrs:{width:20,height:8,x:-10,y:-4,rx:4,ry:4,fill:"#333",stroke:"#fff","stroke-width":2},createHandle:e=>new n.Handle(e),anchor:mw})}(Xo||(Xo={}));class Yl extends et.ToolItem{get type(){return this.options.type}onRender(){K(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const e=this.type;return this.cellView.getTerminalView(e)?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const e=this.childNodes;if(!e)return;const t=e.anchor;if(!t)return;const r=this.type,i=this.cellView,s=this.options,o=i.getTerminalAnchor(r),a=i.cell.prop([r,"anchor"]);t.setAttribute("transform",`translate(${o.x}, ${o.y})`);const l=a?s.customAnchorAttrs:s.defaultAnchorAttrs;l&&Object.keys(l).forEach(c=>{t.setAttribute(c,l[c])})}updateArea(){const e=this.childNodes;if(!e)return;const t=e.area;if(!t)return;const r=this.type,i=this.cellView,s=i.getTerminalView(r);if(s){const o=s.cell,a=i.getTerminalMagnet(r);let l=this.options.areaPadding||0;Number.isFinite(l)||(l=0);let c,u,h;s.isEdgeElement(a)?(c=s.getBBox(),u=0,h=c.getCenter()):(c=s.getUnrotatedBBoxOfElement(a),u=o.getAngle(),h=c.getCenter(),u&&h.rotate(-u,o.getBBox().getCenter())),c.inflate(l),fe(t,{x:-c.width/2,y:-c.height/2,width:c.width,height:c.height,transform:`translate(${h.x}, ${h.y}) rotate(${u})`})}}toggleArea(e){if(this.childNodes){const t=this.childNodes.area;t&&(t.style.display=e?"":"none")}}onMouseDown(e){this.guard(e)||(e.stopPropagation(),e.preventDefault(),this.graph.view.undelegateEvents(),this.options.documentEvents&&this.delegateDocumentEvents(this.options.documentEvents),this.focus(),this.toggleArea(this.options.restrictArea),this.cell.startBatch("move-anchor",{ui:!0,toolId:this.cid}))}resetAnchor(e){const t=this.type,r=this.cell;e?r.prop([t,"anchor"],e,{rewrite:!0,ui:!0,toolId:this.cid}):r.removeProp([t,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(e){const t=this.type,r=this.cellView,i=r.getTerminalView(t);if(i==null)return;const s=this.normalizeEvent(e),o=i.cell,a=r.getTerminalMagnet(t);let l=this.graph.coord.clientToLocalPoint(s.clientX,s.clientY);const c=this.options.snap;if(typeof c=="function"){const f=Y(c,r,l,i,a,t,r,this);l=P.create(f)}if(this.options.restrictArea)if(i.isEdgeElement(a)){const f=i.getClosestPoint(l);f&&(l=f)}else{const f=i.getUnrotatedBBoxOfElement(a),d=o.getAngle(),g=o.getBBox().getCenter(),p=l.clone().rotate(d,g);f.containsPoint(p)||(l=f.getNearestPointToPoint(p).rotate(-d,g))}let u;const h=this.options.anchor;typeof h=="function"&&(u=Y(h,r,l,i,a,t,r,this)),this.resetAnchor(u),this.update()}onMouseUp(e){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const t=this.cellView;this.options.removeRedundancies&&t.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const e=this.options.resetAnchor;e&&this.resetAnchor(e===!0?void 0:e),this.update()}}(function(n){n.config({tagName:"g",markup:[{tagName:"circle",selector:"anchor",attrs:{cursor:"pointer"}},{tagName:"rect",selector:"area",attrs:{"pointer-events":"none",fill:"none",stroke:"#33334F","stroke-dasharray":"2,4",rx:5,ry:5}}],events:{mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDblClick"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},customAnchorAttrs:{"stroke-width":4,stroke:"#33334F",fill:"#FFFFFF",r:5},defaultAnchorAttrs:{"stroke-width":2,stroke:"#FFFFFF",fill:"#33334F",r:6},areaPadding:6,snapRadius:10,resetAnchor:!0,restrictArea:!0,removeRedundancies:!0,anchor:mw,snap(e,t,r,i,s,o){const a=o.options.snapRadius||0,l=i==="source",c=l?0:-1,u=this.cell.getVertexAt(c)||this.getTerminalAnchor(l?"target":"source");return u&&(Math.abs(u.x-e.x)<a&&(e.x=u.x),Math.abs(u.y-e.y)<a&&(e.y=u.y)),e}})})(Yl||(Yl={}));const f5=Yl.define({name:"source-anchor",type:"source"}),d5=Yl.define({name:"target-anchor",type:"target"});var g5=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class Kl extends et.ToolItem{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const e=this.options.attrs,{class:t}=e,r=g5(e,["class"]);this.setAttrs(r,this.container),t&&K(this.container,t)}}onRender(){K(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const e=this.ratio,t=this.cellView,r=t.getTangentAtRatio(e),i=r?r.start:t.getPointAtRatio(e),s=r&&r.vector().vectorAngle(new P(1,0))||0;if(!i)return this;const o=ct().translate(i.x,i.y).rotate(s);return ys(this.container,o,{absolute:!0}),this}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();const t=this.cellView;if(t.can("arrowheadMovable")){t.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const r=this.graph.snapToGrid(e.clientX,e.clientY),i=t.prepareArrowheadDragging(this.type,{x:r.x,y:r.y,options:Object.assign(Object.assign({},this.options),{toolId:this.cid})});this.cellView.setEventData(e,i),this.delegateDocumentEvents(this.options.documentEvents,e.data),t.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(e){const t=this.normalizeEvent(e),r=this.graph.snapToGrid(t.clientX,t.clientY);this.cellView.onMouseMove(t,r.x,r.y),this.update()}onMouseUp(e){this.undelegateDocumentEvents();const t=this.normalizeEvent(e),r=this.cellView,i=this.graph.snapToGrid(t.clientX,t.clientY);r.onMouseUp(t,i.x,i.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",r.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}(function(n){n.config({tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}})})(Kl||(Kl={}));const p5=Kl.define({name:"source-arrowhead",type:"source",ratio:0,attrs:{d:"M 10 -8 -10 0 10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}}),m5=Kl.define({name:"target-arrowhead",type:"target",ratio:1,attrs:{d:"M -10 -8 10 0 -10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class Ss extends et.ToolItem{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5,this.dblClick=this.onCellDblClick.bind(this)}onRender(){const e=this.cellView;e&&e.on("cell:dblclick",this.dblClick)}createElement(){const e=[this.prefixClassName(`${this.cell.isEdge()?"edge":"node"}-tool-editor`),this.prefixClassName("cell-tool-editor")];this.editor=et.createElement("div",!1),this.addClass(e,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}removeElement(){this.undelegateDocumentEvents(),this.editor&&(this.container.removeChild(this.editor),this.editor=null)}updateEditor(){const{cell:e,editor:t}=this;if(!t)return;const{style:r}=t;e.isNode()?this.updateNodeEditorTransform():e.isEdge()&&this.updateEdgeEditorTransform();const{attrs:i}=this.options;r.fontSize=`${i.fontSize}px`,r.fontFamily=i.fontFamily,r.color=i.color,r.backgroundColor=i.backgroundColor;const s=this.getCellText()||"";return t.innerText=s,this.setCellText(""),this}updateNodeEditorTransform(){const{graph:e,cell:t,editor:r}=this;if(!r)return;let i=P.create(),s=20,o="",{x:a,y:l}=this.options;if(typeof a!="undefined"&&typeof l!="undefined"){const h=t.getBBox();a=Vt(a,h.width),l=Vt(l,h.height),i=h.topLeft.translate(a,l),s=h.width-a*2}else{const h=t.getBBox();i=h.center,s=h.width-4,o="translate(-50%, -50%)"}const c=e.scale(),{style:u}=r;i=e.localToGraph(i),u.left=`${i.x}px`,u.top=`${i.y}px`,u.transform=`scale(${c.sx}, ${c.sy}) ${o}`,u.minWidth=`${s}px`}updateEdgeEditorTransform(){if(!this.event)return;const{graph:e,editor:t}=this;if(!t)return;let r=P.create(),i=20;const{style:s}=t,o=this.event.target,a=o.parentElement;if(a&&gs(a,this.prefixClassName("edge-label"))){const u=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(u,10);const h=a.getAttribute("transform"),{translation:f}=Fl(h);r=new P(f.tx,f.ty),i=de.getBBox(o).width}else{if(!this.options.labelAddable)return this;r=e.clientToLocal(P.create(this.event.clientX,this.event.clientY));const h=this.cellView.path.closestPointLength(r);this.distance=h,this.labelIndex=-1}r=e.localToGraph(r);const c=e.scale();s.left=`${r.x}px`,s.top=`${r.y}px`,s.minWidth=`${i}px`,s.transform=`scale(${c.sx}, ${c.sy}) translate(-50%, -50%)`}onDocumentMouseDown(e){if(this.editor&&e.target!==this.editor){const t=this.editor.innerText.replace(/\n$/,"")||"";this.setCellText(t!==""?t:null),this.removeElement()}}onCellDblClick({e}){e.stopPropagation(),this.removeElement(),this.event=e,this.createElement(),this.updateEditor(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents)}onMouseDown(e){e.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor&&(this.editor.focus(),this.selectText())})}selectText(){if(window.getSelection&&this.editor){const e=document.createRange(),t=window.getSelection();e.selectNodeContents(this.editor),t.removeAllRanges(),t.addRange(e)}}getCellText(){const{getText:e}=this.options;if(typeof e=="function")return Y(e,this.cellView,{cell:this.cell,index:this.labelIndex});if(typeof e=="string"){if(this.cell.isNode())return this.cell.attr(e);if(this.cell.isEdge()&&this.labelIndex!==-1)return this.cell.prop(`labels/${this.labelIndex}/attrs/${e}`)}}setCellText(e){const t=this.options.setText;if(typeof t=="function"){Y(t,this.cellView,{cell:this.cell,value:e,index:this.labelIndex,distance:this.distance});return}if(typeof t=="string"){if(this.cell.isNode()){e!==null&&this.cell.attr(t,e);return}if(this.cell.isEdge()){const r=this.cell;if(this.labelIndex===-1){if(e){const i={position:{distance:this.distance},attrs:{}};hs(i,`attrs/${t}`,e),r.appendLabel(i)}}else e!==null?r.prop(`labels/${this.labelIndex}/attrs/${t}`,e):typeof this.labelIndex=="number"&&r.removeLabelAt(this.labelIndex)}}}onRemove(){const e=this.cellView;e&&e.off("cell:dblclick",this.dblClick),this.removeElement()}}(function(n){n.config({tagName:"div",isSVGElement:!1,events:{mousedown:"onMouseDown"},documentEvents:{mousedown:"onDocumentMouseDown"}})})(Ss||(Ss={})),function(n){n.NodeEditor=n.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText:"text/text",setText:"text/text"}),n.EdgeEditor=n.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText:"label/text",setText:"label/text"})}(Ss||(Ss={}));var vw=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},Ps;(function(n){n.presets={boundary:Xl,button:Ir,"button-remove":Ir.Remove,"node-editor":Ss.NodeEditor},n.registry=Ue.create({type:"node tool",process(e,t){if(typeof t=="function")return t;let r=et.ToolItem;const{inherit:i}=t,s=vw(t,["inherit"]);if(i){const o=this.get(i);o==null?this.onNotFound(i,"inherited"):r=o}return s.name==null&&(s.name=e),r.define.call(r,s)}}),n.registry.register(n.presets,!0)})(Ps||(Ps={}));var Es;(function(n){n.presets={boundary:Xl,vertices:Wo,segments:Xo,button:Ir,"button-remove":Ir.Remove,"source-anchor":f5,"target-anchor":d5,"source-arrowhead":p5,"target-arrowhead":m5,"edge-editor":Ss.EdgeEditor},n.registry=Ue.create({type:"edge tool",process(e,t){if(typeof t=="function")return t;let r=et.ToolItem;const{inherit:i}=t,s=vw(t,["inherit"]);if(i){const o=this.get(i);o==null?this.onNotFound(i,"inherited"):r=o}return s.name==null&&(s.name=e),r.define.call(r,s)}}),n.registry.register(n.presets,!0)})(Es||(Es={}));const y5=ir("center"),v5=ir("topCenter"),b5=ir("bottomCenter"),w5=ir("leftMiddle"),x5=ir("rightMiddle"),C5=ir("topLeft"),S5=ir("topRight"),P5=ir("bottomLeft"),E5=ir("bottomRight");function ir(n){return function(e,t,r,i={}){const s=i.rotate?e.getUnrotatedBBoxOfElement(t):e.getBBoxOfElement(t),o=s[n];o.x+=Vt(i.dx,s.width),o.y+=Vt(i.dy,s.height);const a=e.cell;return i.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function Jl(n){return function(e,t,r,i){if(r instanceof Element){const s=this.graph.findViewByElem(r);let o;if(s)if(s.isEdgeElement(r)){const a=i.fixedAt!=null?i.fixedAt:"50%";o=bw(s,a)}else o=s.getBBoxOfElement(r).getCenter();else o=new P;return n.call(this,e,t,o,i)}return n.apply(this,arguments)}}function bw(n,e){const t=Qn(e),r=typeof e=="string"?parseFloat(e):e;return t?n.getPointAtRatio(r/100):n.getPointAtLength(r)}const A5=Jl(function(n,e,t,r){const i=n.cell.getAngle(),s=n.getBBoxOfElement(e),o=s.getCenter(),a=s.getTopLeft(),l=s.getBottomRight();let c=r.padding;if(Number.isFinite(c)||(c=0),a.y+c<=t.y&&t.y<=l.y-c){const u=t.y-o.y;o.x+=i===0||i===180?0:u*1/Math.tan(ve.toRad(i)),o.y+=u}else if(a.x+c<=t.x&&t.x<=l.x-c){const u=t.x-o.x;o.y+=i===90||i===270?0:u*Math.tan(ve.toRad(i)),o.x+=u}return o}),T5=function(n,e,t,r,i){const s=n.cell.getConnectionPoint(this.cell,i);return(r.dx||r.dy)&&s.translate(r.dx||0,r.dy||0),s},O5=Jl(function(n,e,t,r){let i,s=0,o;const a=n.cell;r.rotate?(i=n.getUnrotatedBBoxOfElement(e),o=a.getBBox().getCenter(),s=a.getAngle()):i=n.getBBoxOfElement(e);const l=r.padding;l!=null&&Number.isFinite(l)&&i.inflate(l),r.rotate&&t.rotate(s,o);const c=i.getNearestSideToPoint(t);let u;switch(c){case"left":u=i.getLeftMiddle();break;case"right":u=i.getRightMiddle();break;case"top":u=i.getTopCenter();break;case"bottom":u=i.getBottomCenter();break}const h=r.direction;return h==="H"?(c==="top"||c==="bottom")&&(t.x<=i.x+i.width?u=i.getLeftMiddle():u=i.getRightMiddle()):h==="V"&&(t.y<=i.y+i.height?u=i.getTopCenter():u=i.getBottomCenter()),r.rotate?u.rotate(-s,o):u}),M5=Object.freeze(Object.defineProperty({__proto__:null,bottom:b5,bottomLeft:P5,bottomRight:E5,center:y5,left:w5,midSide:O5,nodeCenter:T5,orth:A5,right:x5,top:v5,topLeft:C5,topRight:S5},Symbol.toStringTag,{value:"Module"}));var As;(function(n){n.presets=M5,n.registry=Ue.create({type:"node endpoint"}),n.registry.register(n.presets,!0)})(As||(As={}));const _5=function(n,e,t,r){let i=r.ratio!=null?r.ratio:.5;return i>1&&(i/=100),n.getPointAtRatio(i)},N5=function(n,e,t,r){const i=r.length!=null?r.length:20;return n.getPointAtLength(i)},ww=function(n,e,t,r){const i=n.getClosestPoint(t);return i!=null?i:new P},k5=Jl(ww),$5=Jl(function(n,e,t,r){const s=n.getConnection(),o=n.getConnectionSubdivisions(),a=new F(t.clone().translate(0,1e6),t.clone().translate(0,-1e6)),l=new F(t.clone().translate(1e6,0),t.clone().translate(-1e6,0)),c=a.intersect(s,{segmentSubdivisions:o}),u=l.intersect(s,{segmentSubdivisions:o}),h=[];return c&&h.push(...c),u&&h.push(...u),h.length>0?t.closest(h):r.fallbackAt!=null?bw(n,r.fallbackAt):Y(ww,this,n,e,t,r)}),I5=Object.freeze(Object.defineProperty({__proto__:null,closest:k5,length:N5,orth:$5,ratio:_5},Symbol.toStringTag,{value:"Module"}));var Ts;(function(n){n.presets=I5,n.registry=Ue.create({type:"edge endpoint"}),n.registry.register(n.presets,!0)})(Ts||(Ts={}));function Ql(n,e,t){let r;if(typeof t=="object"){if(Number.isFinite(t.y)){const s=new F(e,n),{start:o,end:a}=s.parallel(t.y);e=o,n=a}r=t.x}else r=t;if(r==null||!Number.isFinite(r))return n;const i=n.distance(e);return r===0&&i>0?n:n.move(e,-Math.min(r,i-1))}function Zl(n){const e=n.getAttribute("stroke-width");return e===null?0:parseFloat(e)||0}function L5(n){if(n==null)return null;let e=n;do{let t=e.tagName;if(typeof t!="string")return null;if(t=t.toUpperCase(),t==="G")e=e.firstElementChild;else if(t==="TITLE")e=e.nextElementSibling;else break}while(e);return e}const xw=function(n,e,t,r){const i=e.getBBoxOfElement(t);r.stroked&&i.inflate(Zl(t)/2);const s=n.intersect(i),o=s&&s.length?n.start.closest(s):n.end;return Ql(o,n.start,r.offset)},R5=function(n,e,t,r,i){const s=e.cell,o=s.isNode()?s.getAngle():0;if(o===0)return Y(xw,this,n,e,t,r,i);const a=e.getUnrotatedBBoxOfElement(t);r.stroked&&a.inflate(Zl(t)/2);const l=a.getCenter(),c=n.clone().rotate(o,l),u=c.setLength(1e6).intersect(a),h=u&&u.length?c.start.closest(u).rotate(-o,l):n.end;return Ql(h,n.start,r.offset)},j5=function(n,e,t,r){let i,s;const o=n.end,a=r.selector;if(typeof a=="string"?i=e.findOne(a):Array.isArray(a)?i=jh(t,a):i=L5(t),!Er(i)){if(i===t||!Er(t))return o;i=t}const l=e.getShapeOfElement(i),c=e.getMatrixOfElement(i),u=e.getRootTranslatedMatrix(),h=e.getRootRotatedMatrix(),f=u.multiply(h).multiply(c),d=f.inverse(),g=de.transformLine(n,d),p=g.start.clone(),b=e.getDataOfElement(i);if(r.insideout===!1){b.shapeBBox==null&&(b.shapeBBox=l.bbox());const w=b.shapeBBox;if(w!=null&&w.containsPoint(p))return o}r.extrapolate===!0&&g.setLength(1e6);let m;if(W.isPath(l)){const w=r.precision||2;b.segmentSubdivisions==null&&(b.segmentSubdivisions=l.getSegmentSubdivisions({precision:w})),m={precision:w,segmentSubdivisions:b.segmentSubdivisions},s=g.intersect(l,m)}else s=g.intersect(l);s?Array.isArray(s)&&(s=p.closest(s)):r.sticky===!0&&(D.isRectangle(l)?s=l.getNearestPointToPoint(p):wn.isEllipse(l)?s=l.intersectsWithLineFromCenterToPoint(p):s=l.closestPoint(p,m));const y=s?de.transformPoint(s,f):o;let v=r.offset||0;return r.stroked!==!1&&(typeof v=="object"?(v=Object.assign({},v),v.x==null&&(v.x=0),v.x+=Zl(i)/2):v+=Zl(i)/2),Ql(y,n.start,v)};function D5(n,e,t=0){const{start:r,end:i}=n;let s,o,a,l;switch(e){case"left":l="x",s=i,o=r,a=-1;break;case"right":l="x",s=r,o=i,a=1;break;case"top":l="y",s=i,o=r,a=-1;break;case"bottom":l="y",s=r,o=i,a=1;break;default:return}r[l]<i[l]?s[l]=o[l]:o[l]=s[l],Number.isFinite(t)&&(s[l]+=a*t,o[l]+=a*t)}const B5=Object.freeze(Object.defineProperty({__proto__:null,anchor:function(n,e,t,r){const{alignOffset:i,align:s}=r;return s&&D5(n,s,i),Ql(n.end,n.start,r.offset)},bbox:xw,boundary:j5,rect:R5},Symbol.toStringTag,{value:"Module"}));var Os;(function(n){n.presets=B5,n.registry=Ue.create({type:"connection point"}),n.registry.register(n.presets,!0)})(Os||(Os={}));const z5=function(n){return[...n]},F5=function(n,e,t){const r=e.side||"bottom",i=Rn(e.padding||40),s=t.sourceBBox,o=t.targetBBox,a=s.getCenter(),l=o.getCenter();let c,u,h;switch(r){case"top":h=-1,c="y",u="height";break;case"left":h=-1,c="x",u="width";break;case"right":h=1,c="x",u="width";break;case"bottom":default:h=1,c="y",u="height";break}return a[c]+=h*(s[u]/2+i[r]),l[c]+=h*(o[u]/2+i[r]),h*(a[c]-l[c])>0?l[c]=a[c]:a[c]=l[c],[a.toJSON(),...n,l.toJSON()]};function ec(n){return new D(n.x,n.y,0,0)}function tc(n={}){const e=Rn(n.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function Cw(n,e={}){return n.sourceBBox.clone().moveAndExpand(tc(e))}function Sw(n,e={}){return n.targetBBox.clone().moveAndExpand(tc(e))}function V5(n,e={}){return n.sourceAnchor?n.sourceAnchor:Cw(n,e).getCenter()}function q5(n,e={}){return n.targetAnchor?n.targetAnchor:Sw(n,e).getCenter()}const Pw=function(n,e,t){let r=Cw(t,e),i=Sw(t,e);const s=V5(t,e),o=q5(t,e);r=r.union(ec(s)),i=i.union(ec(o));const a=n.map(u=>P.create(u));a.unshift(s),a.push(o);let l=null;const c=[];for(let u=0,h=a.length-1;u<h;u+=1){let f=null;const d=a[u],g=a[u+1],p=on.getBearing(d,g)!=null;if(u===0)u+1===h?r.intersectsWithRect(i.clone().inflate(1))?f=on.insideNode(d,g,r,i):p||(f=on.nodeToNode(d,g,r,i)):r.containsPoint(g)?f=on.insideNode(d,g,r,ec(g).moveAndExpand(tc(e))):p||(f=on.nodeToVertex(d,g,r));else if(u+1===h){const b=p&&on.getBearing(g,d)===l;i.containsPoint(d)||b?f=on.insideNode(d,g,ec(d).moveAndExpand(tc(e)),i,l):p||(f=on.vertexToNode(d,g,i,l))}else p||(f=on.vertexToVertex(d,g,l));f?(c.push(...f.points),l=f.direction):l=on.getBearing(d,g),u+1<h&&c.push(g)}return c};var on;(function(n){const e={N:"S",S:"N",E:"W",W:"E"},t={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function r(h,f,d){let g=new P(h.x,f.y);return d.containsPoint(g)&&(g=new P(f.x,h.y)),g}function i(h,f){return h[f==="W"||f==="E"?"width":"height"]}n.getBBoxSize=i;function s(h,f){return h.x===f.x?h.y>f.y?"N":"S":h.y===f.y?h.x>f.x?"W":"E":null}n.getBearing=s;function o(h,f,d){const g=new P(h.x,f.y),p=new P(f.x,h.y),b=s(h,g),m=s(h,p),y=d?e[d]:null,v=b===d||b!==y&&(m===y||m!==d)?g:p;return{points:[v],direction:s(v,f)}}n.vertexToVertex=o;function a(h,f,d){const g=r(h,f,d);return{points:[g],direction:s(g,f)}}n.nodeToVertex=a;function l(h,f,d,g){const p=[new P(h.x,f.y),new P(f.x,h.y)],b=p.filter(v=>!d.containsPoint(v)),m=b.filter(v=>s(v,h)!==g);let y;if(m.length>0)return y=m.filter(v=>s(h,v)===g).pop(),y=y||m[0],{points:[y],direction:s(y,f)};{y=uV(p,b)[0];const v=P.create(f).move(y,-i(d,g)/2);return{points:[r(v,h,d),v],direction:s(v,f)}}}n.vertexToNode=l;function c(h,f,d,g){let p=a(f,h,g);const b=p.points[0];if(d.containsPoint(b)){p=a(h,f,d);const m=p.points[0];if(g.containsPoint(m)){const y=P.create(h).move(m,-i(d,s(h,m))/2),v=P.create(f).move(b,-i(g,s(f,b))/2),w=new F(y,v).getCenter(),x=a(h,w,d),C=o(w,f,x.direction);p.points=[x.points[0],C.points[0]],p.direction=C.direction}}return p}n.nodeToNode=c;function u(h,f,d,g,p){const b=d.union(g).inflate(1),m=b.getCenter(),y=m.distance(f)>m.distance(h),v=y?f:h,w=y?h:f;let x,C,S;p?(x=P.fromPolar(b.width+b.height,t[p],v),x=b.getNearestPointToPoint(x).move(x,-1)):x=b.getNearestPointToPoint(v).move(v,1),C=r(x,w,b);let E;x.round().equals(C.round())?(C=P.fromPolar(b.width+b.height,ve.toRad(x.theta(v))+Math.PI/2,w),C=b.getNearestPointToPoint(C).move(w,1).round(),S=r(x,C,b),E=y?[C,S,x]:[x,S,C]):E=y?[C,x]:[x,C];const A=s(y?x:C,f);return{points:E,direction:A}}n.insideNode=u})(on||(on={}));const G5={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeNodes:[],excludeShapes:[],startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{top:{x:0,y:-1},right:{x:1,y:0},bottom:{x:0,y:1},left:{x:-1,y:0}},cost(){return Lr(this.step,this)},directions(){const n=Lr(this.step,this),e=Lr(this.cost,this);return[{cost:e,offsetX:n,offsetY:0},{cost:e,offsetX:-n,offsetY:0},{cost:e,offsetX:0,offsetY:n},{cost:e,offsetX:0,offsetY:-n}]},penalties(){const n=Lr(this.step,this);return{0:0,45:n/2,90:n/2}},paddingBox(){const n=Lr(this.step,this);return{x:-n,y:-n,width:2*n,height:2*n}},fallbackRouter:Pw,draggingRouter:null,snapToGrid:!0};function Lr(n,e){return typeof n=="function"?n.call(e):n}function H5(n){const e=Object.keys(n).reduce((t,r)=>{const i=t;return r==="fallbackRouter"||r==="draggingRouter"||r==="fallbackRoute"?i[r]=n[r]:i[r]=Lr(n[r],n),t},{});if(e.padding){const t=Rn(e.padding);e.paddingBox={x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}return e.directions.forEach(t=>{const r=new P(0,0),i=new P(t.offsetX,t.offsetY);t.angle=ve.normalize(r.theta(i))}),e}const Ew=1,Aw=2;class U5{constructor(){this.items=[],this.hash={},this.values={}}add(e,t){this.hash[e]?this.items.splice(this.items.indexOf(e),1):this.hash[e]=Ew,this.values[e]=t;const r=VV(this.items,e,i=>this.values[i]);this.items.splice(r,0,e)}pop(){const e=this.items.shift();return e&&(this.hash[e]=Aw),e}isOpen(e){return this.hash[e]===Ew}isClose(e){return this.hash[e]===Aw}isEmpty(){return this.items.length===0}}class W5{constructor(e){this.options=e,this.mapGridSize=100,this.map={}}build(e,t){const r=this.options,i=r.excludeTerminals.reduce((c,u)=>{const h=t[u];if(h){const f=e.getCell(h.cell);f&&c.push(f)}return c},[]);let s=[];const o=e.getCell(t.getSourceCellId());o&&(s=jb(s,o.getAncestors().map(c=>c.id)));const a=e.getCell(t.getTargetCellId());a&&(s=jb(s,a.getAncestors().map(c=>c.id)));const l=this.mapGridSize;return e.getNodes().reduce((c,u)=>{const h=i.some(b=>b.id===u.id),f=u.shape?r.excludeShapes.includes(u.shape):!1,d=r.excludeNodes.some(b=>typeof b=="string"?u.id===b:b===u),g=s.includes(u.id);if(!(f||h||d||g)){const b=u.getBBox().moveAndExpand(r.paddingBox),m=b.getOrigin().snapToGrid(l),y=b.getCorner().snapToGrid(l);for(let v=m.x;v<=y.x;v+=l)for(let w=m.y;w<=y.y;w+=l){const x=new P(v,w).toString();c[x]==null&&(c[x]=[]),c[x].push(b)}}return c},this.map),this}isAccessible(e){const t=e.clone().snapToGrid(this.mapGridSize).toString(),r=this.map[t];return r?r.every(i=>!i.containsPoint(e)):!0}}function Tw(n,e){const t=n.sourceBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function Ow(n,e){const t=n.targetBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function Mw(n,e){return n.sourceAnchor?n.sourceAnchor:Tw(n,e).getCenter()}function X5(n,e){return n.targetAnchor?n.targetAnchor:Ow(n,e).getCenter()}function df(n,e,t,r,i){const s=360/t,o=n.theta(Y5(n,e,r,i)),a=ve.normalize(o+s/2);return s*Math.floor(a/s)}function Y5(n,e,t,r){const i=r.step,s=e.x-n.x,o=e.y-n.y,a=s/t.x,l=o/t.y,c=a*i,u=l*i;return new P(n.x+c,n.y+u)}function _w(n,e){const t=Math.abs(n-e);return t>180?360-t:t}function K5(n,e){const t=e.step;return e.directions.forEach(r=>{r.gridOffsetX=r.offsetX/t*n.x,r.gridOffsetY=r.offsetY/t*n.y}),e.directions}function J5(n,e,t){return{source:e.clone(),x:Nw(t.x-e.x,n),y:Nw(t.y-e.y,n)}}function Nw(n,e){if(!n)return e;const t=Math.abs(n),r=Math.round(t/e);if(!r)return t;const i=r*e,o=(t-i)/r;return e+o}function Q5(n,e){const t=e.source,r=we.snapToGrid(n.x-t.x,e.x)+t.x,i=we.snapToGrid(n.y-t.y,e.y)+t.y;return new P(r,i)}function Yo(n,e){return n.round(e)}function nc(n,e,t){return Yo(Q5(n.clone(),e),t)}function Ko(n){return n.toString()}function gf(n){return new P(n.x===0?0:Math.abs(n.x)/n.x,n.y===0?0:Math.abs(n.y)/n.y)}function kw(n,e){let t=1/0;for(let r=0,i=e.length;r<i;r+=1){const s=n.manhattanDistance(e[r]);s<t&&(t=s)}return t}function $w(n,e,t,r,i){const s=i.precision,o=i.directionMap,a=n.diff(e.getCenter()),l=Object.keys(o).reduce((c,u)=>{if(t.includes(u)){const h=o[u],f=new P(n.x+h.x*(Math.abs(a.x)+e.width),n.y+h.y*(Math.abs(a.y)+e.height)),g=new F(n,f).intersect(e)||[];let p,b=null;for(let m=0;m<g.length;m+=1){const y=g[m],v=n.squaredDistance(y);(p==null||v>p)&&(p=v,b=y)}if(b){let m=nc(b,r,s);e.containsPoint(m)&&(m=nc(m.translate(h.x*r.x,h.y*r.y),r,s)),c.push(m)}}return c},[]);return e.containsPoint(n)||l.push(nc(n,r,s)),l}function Z5(n,e,t,r,i){const s=[];let o=gf(i.diff(t)),a=Ko(t),l=n[a],c;for(;l;){c=e[a];const f=gf(c.diff(l));f.equals(o)||(s.unshift(c),o=f),a=Ko(l),l=n[a]}const u=e[a];return gf(u.diff(r)).equals(o)||s.unshift(u),s}function eG(n,e,t,r,i){const s=i.precision;let o,a;D.isRectangle(e)?o=Yo(Mw(n,i).clone(),s):o=Yo(e.clone(),s),D.isRectangle(t)?a=Yo(X5(n,i).clone(),s):a=Yo(t.clone(),s);const l=J5(i.step,o,a),c=o,u=a;let h,f;if(D.isRectangle(e)?h=$w(c,e,i.startDirections,l,i):h=[c],D.isRectangle(t)?f=$w(a,t,i.endDirections,l,i):f=[u],h=h.filter(d=>r.isAccessible(d)),f=f.filter(d=>r.isAccessible(d)),h.length>0&&f.length>0){const d=new U5,g={},p={},b={};for(let O=0,T=h.length;O<T;O+=1){const I=h[O],G=Ko(I);d.add(G,kw(I,f)),g[G]=I,b[G]=0}const m=i.previousDirectionAngle,y=m===void 0;let v,w;const x=K5(l,i),C=x.length,S=f.reduce((O,T)=>{const I=Ko(T);return O.push(I),O},[]),E=P.equalPoints(h,f);let A=i.maxLoopCount;for(;!d.isEmpty()&&A>0;){const O=d.pop(),T=g[O],I=p[O],G=b[O],X=T.equals(c),M=I==null;let k;if(M?y?X?k=null:k=df(c,T,C,l,i):k=m:k=df(I,T,C,l,i),!(M&&E)&&S.indexOf(O)>=0)return i.previousDirectionAngle=k,Z5(p,g,T,c,u);for(let R=0;R<C;R+=1){v=x[R];const z=v.angle;if(w=_w(k,z),!(y&&X)&&w>i.maxDirectionChange)continue;const H=nc(T.clone().translate(v.gridOffsetX||0,v.gridOffsetY||0),l,s),te=Ko(H);if(d.isClose(te)||!r.isAccessible(H))continue;if(S.indexOf(te)>=0&&!H.equals(u)){const Ke=df(H,u,C,l,i);if(_w(z,Ke)>i.maxDirectionChange)continue}const xe=v.cost,Kt=X?0:i.penalties[w],Ye=G+xe+Kt;(!d.isOpen(te)||Ye<b[te])&&(g[te]=H,p[te]=T,b[te]=Ye,d.add(te,Ye+kw(H,f)))}A-=1}}return i.fallbackRoute?Y(i.fallbackRoute,this,c,u,i):null}function tG(n,e=10){if(n.length<=1)return n;for(let t=0,r=n.length;t<r-1;t+=1){const i=n[t],s=n[t+1];if(i.x===s.x){const o=e*Math.round(i.x/e);i.x!==o&&(i.x=o,s.x=o)}else if(i.y===s.y){const o=e*Math.round(i.y/e);i.y!==o&&(i.y=o,s.y=o)}}return n}const nG=function(n,e,t){const r=H5(e),i=Tw(t,r),s=Ow(t,r),o=Mw(t,r),a=new W5(r).build(t.graph.model,t.cell),l=n.map(d=>P.create(d)),c=[];let u=o,h,f;for(let d=0,g=l.length;d<=g;d+=1){let p=null;if(h=f||i,f=l[d],f==null){f=s;const m=t.cell;if((m.getSourceCellId()==null||m.getTargetCellId()==null)&&typeof r.draggingRouter=="function"){const v=h===i?o:h,w=f.getOrigin();p=Y(r.draggingRouter,t,v,w,r)}}if(p==null&&(p=eG(t,h,f,a,r)),p===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),Y(r.fallbackRouter,this,n,r,t);const b=p[0];b&&b.equals(u)&&p.shift(),u=p[p.length-1]||u,c.push(...p)}return r.snapToGrid?tG(c,t.graph.grid.getGridSize()):c},Iw=function(n,e,t){return Y(nG,this,n,Object.assign(Object.assign({},G5),e),t)},rG={maxDirectionChange:45,directions(){const n=Lr(this.step,this),e=Lr(this.cost,this),t=Math.ceil(Math.sqrt(n*n<<1));return[{cost:e,offsetX:n,offsetY:0},{cost:t,offsetX:n,offsetY:n},{cost:e,offsetX:0,offsetY:n},{cost:t,offsetX:-n,offsetY:n},{cost:e,offsetX:-n,offsetY:0},{cost:t,offsetX:-n,offsetY:-n},{cost:e,offsetX:0,offsetY:-n},{cost:t,offsetX:n,offsetY:-n}]},fallbackRoute(n,e,t){const r=n.theta(e),i=[];let s={x:e.x,y:n.y},o={x:n.x,y:e.y};if(r%180>90){const v=s;s=o,o=v}const a=r%90<45?s:o,l=new F(n,a),c=90*Math.ceil(r/90),u=P.fromPolar(l.squaredLength(),ve.toRad(c+135),a),h=new F(e,u),f=l.intersectsWithLine(h),d=f||e,g=f?d:n,p=360/t.directions.length,b=g.theta(e),m=ve.normalize(b+p/2),y=p*Math.floor(m/p);return t.previousDirectionAngle=y,d&&i.push(d.round()),i.push(e),i}},iG=function(n,e,t){return Y(Iw,this,n,Object.assign(Object.assign({},rG),e),t)},sG=function(n,e,t){const r=e.offset||32,i=e.min==null?16:e.min;let s=0,o=e.direction;const a=t.sourceBBox,l=t.targetBBox,c=a.getCenter(),u=l.getCenter();if(typeof r=="number"&&(s=r),o==null){let m=l.left-a.right,y=l.top-a.bottom;m>=0&&y>=0?o=m>=y?"L":"T":m<=0&&y>=0?(m=a.left-l.right,m>=0?o=m>=y?"R":"T":o="T"):m>=0&&y<=0?(y=a.top-l.bottom,y>=0?o=m>=y?"L":"B":o="L"):(m=a.left-l.right,y=a.top-l.bottom,m>=0&&y>=0?o=m>=y?"R":"B":m<=0&&y>=0?o="B":m>=0&&y<=0?o="R":o=Math.abs(m)>Math.abs(y)?"R":"B")}o==="H"?o=u.x-c.x>=0?"L":"R":o==="V"&&(o=u.y-c.y>=0?"T":"B"),r==="center"&&(o==="L"?s=(l.left-a.right)/2:o==="R"?s=(a.left-l.right)/2:o==="T"?s=(l.top-a.bottom)/2:o==="B"&&(s=(a.top-l.bottom)/2));let h,f,d;const g=o==="L"||o==="R";if(g){if(u.y===c.y)return[...n];d=o==="L"?1:-1,h="x",f="width"}else{if(u.x===c.x)return[...n];d=o==="T"?1:-1,h="y",f="height"}const p=c.clone(),b=u.clone();if(p[h]+=d*(a[f]/2+s),b[h]-=d*(l[f]/2+s),g){const m=p.x,y=b.x,v=a.width/2+i,w=l.width/2+i;u.x>c.x?y<=m&&(p.x=Math.max(y,c.x+v),b.x=Math.min(m,u.x-w)):y>=m&&(p.x=Math.min(y,c.x-v),b.x=Math.max(m,u.x+w))}else{const m=p.y,y=b.y,v=a.height/2+i,w=l.height/2+i;u.y>c.y?y<=m&&(p.y=Math.max(y,c.y+v),b.y=Math.min(m,u.y-w)):y>=m&&(p.y=Math.min(y,c.y-v),b.y=Math.max(m,u.y+w))}return[p.toJSON(),...n,b.toJSON()]};function Ms(n,e){if(e!=null&&e!==!1){const t=typeof e=="boolean"?0:e;if(t>0){const r=P.create(n[1]).move(n[2],t),i=P.create(n[1]).move(n[0],t);return[r.toJSON(),...n,i.toJSON()]}{const r=n[1];return[Object.assign({},r),...n,Object.assign({},r)]}}return n}const oG=Object.freeze(Object.defineProperty({__proto__:null,er:sG,loop:function(n,e,t){const r=e.width||50,s=(e.height||80)/2,o=e.angle||"auto",a=t.sourceAnchor,l=t.targetAnchor,c=t.sourceBBox,u=t.targetBBox;if(a.equals(l)){const h=m=>{const y=ve.toRad(m),v=Math.sin(y),w=Math.cos(y),x=new P(a.x+w*r,a.y+v*r),C=new P(x.x-w*s,x.y-v*s),S=C.clone().rotate(-90,x),E=C.clone().rotate(90,x);return[S.toJSON(),x.toJSON(),E.toJSON()]},f=m=>{const y=a.clone().move(m,-1),v=new F(y,m);return!c.containsPoint(m)&&!c.intersectsWithLine(v)},d=[0,90,180,270,45,135,225,315];if(typeof o=="number")return Ms(h(o),e.merge);const g=c.getCenter();if(g.equals(a))return Ms(h(0),e.merge);const p=g.angleBetween(a,g.clone().translate(1,0));let b=h(p);if(f(b[1]))return Ms(b,e.merge);for(let m=1,y=d.length;m<y;m+=1)if(b=h(p+d[m]),f(b[1]))return Ms(b,e.merge);return Ms(b,e.merge)}{const h=new F(a,l);let f=h.parallel(-r),d=f.getCenter(),g=f.start.clone().move(f.end,s),p=f.end.clone().move(f.start,s);const b=h.parallel(-1),m=new F(b.start,d),y=new F(b.end,d);if((c.containsPoint(d)||u.containsPoint(d)||c.intersectsWithLine(m)||c.intersectsWithLine(y)||u.intersectsWithLine(m)||u.intersectsWithLine(y))&&(f=h.parallel(r),d=f.getCenter(),g=f.start.clone().move(f.end,s),p=f.end.clone().move(f.start,s)),e.merge){const v=new F(a,l),w=new F(d,v.center).setLength(Number.MAX_SAFE_INTEGER),x=c.intersectsWithLine(w),C=u.intersectsWithLine(w),S=x?Array.isArray(x)?x:[x]:[];C&&(Array.isArray(C)?S.push(...C):S.push(C));const E=v.center.closest(S);E?(t.sourceAnchor=E.clone(),t.targetAnchor=E.clone()):(t.sourceAnchor=v.center.clone(),t.targetAnchor=v.center.clone())}return Ms([g.toJSON(),d.toJSON(),p.toJSON()],e.merge)}},manhattan:Iw,metro:iG,normal:z5,oneSide:F5,orth:Pw},Symbol.toStringTag,{value:"Module"}));var Rr;(function(n){n.presets=oG,n.registry=Ue.create({type:"router"}),n.registry.register(n.presets,!0)})(Rr||(Rr={}));const aG=function(n,e,t,r={}){const i=[n,...t,e],s=new He(i),o=new W(s);return r.raw?o:o.serialize()},lG=function(n,e,t,r={}){const i=t.length===3?0:1,s=P.create(t[0+i]),o=P.create(t[2+i]),a=P.create(t[1+i]);if(!P.equals(n,e)){const c=new P((n.x+e.x)/2,(n.y+e.y)/2),u=c.angleBetween(P.create(n).rotate(90,c),a);u>1&&(s.rotate(180-u,c),o.rotate(180-u,c),a.rotate(180-u,c))}const l=`
83
83
  M ${n.x} ${n.y}
84
84
  Q ${s.x} ${s.y} ${a.x} ${a.y}
85
85
  Q ${o.x} ${o.y} ${e.x} ${e.y}
86
- `;return r.raw?X.parse(l):l},uG=function(n,e,t,r={}){const i=new X;i.appendSegment(X.createSegment("M",n));const s=1/3,o=2/3,a=r.radius||10;let l,c;for(let u=0,h=t.length;u<h;u+=1){const f=P.create(t[u]),d=t[u-1]||n,g=t[u+1]||e;l=c||f.distance(d)/2,c=f.distance(g)/2;const p=-Math.min(a,l),b=-Math.min(a,c),m=f.clone().move(d,p).round(),y=f.clone().move(g,b).round(),v=new P(s*m.x+o*f.x,o*f.y+s*m.y),w=new P(s*y.x+o*f.x,o*f.y+s*y.y);i.appendSegment(X.createSegment("L",m)),i.appendSegment(X.createSegment("C",v,w,y))}return i.appendSegment(X.createSegment("L",e)),r.raw?i:i.serialize()},hG=function(n,e,t,r={}){let i,s=r.direction;if(t&&t.length!==0){const o=[n,...t,e],a=Fe.throughPoints(o);i=new X(a)}else if(i=new X,i.appendSegment(X.createSegment("M",n)),s||(s=Math.abs(n.x-e.x)>=Math.abs(n.y-e.y)?"H":"V"),s==="H"){const o=(n.x+e.x)/2;i.appendSegment(X.createSegment("C",o,n.y,o,e.y,e.x,e.y))}else{const o=(n.y+e.y)/2;i.appendSegment(X.createSegment("C",n.x,o,e.x,o,e.x,e.y))}return r.raw?i:i.serialize()},Rw=1,rc=1/3,ic=2/3;function fG(n){let e=n.graph._jumpOverUpdateList;if(e==null&&(e=n.graph._jumpOverUpdateList=[],n.graph.on("cell:mouseup",()=>{const t=n.graph._jumpOverUpdateList;setTimeout(()=>{for(let r=0;r<t.length;r+=1)t[r].update()})}),n.graph.on("model:reseted",()=>{e=n.graph._jumpOverUpdateList=[]})),e.indexOf(n)<0){e.push(n);const t=()=>e.splice(e.indexOf(n),1);n.cell.once("change:connector",t),n.cell.once("removed",t)}}function pf(n,e,t=[]){const r=[n,...t,e],i=[];return r.forEach((s,o)=>{const a=r[o+1];a!=null&&i.push(new F(s,a))}),i}function dG(n,e){const t=[];return e.forEach(r=>{const i=n.intersectsWithLine(r);i&&t.push(i)}),t}function jw(n,e){return new F(n,e).squaredLength()}function gG(n,e,t){return e.reduce((r,i,s)=>{if(sc.includes(i))return r;const o=r.pop()||n,a=P.create(i).move(o.start,-t);let l=P.create(i).move(o.start,+t);const c=e[s+1];if(c!=null){const f=l.distance(c);f<=t&&(l=c.move(o.start,f),sc.push(c))}else if(a.distance(o.end)<t*2+Rw)return r.push(o),r;if(l.distance(o.start)<t*2+Rw)return r.push(o),r;const h=new F(a,l);return Ko.push(h),r.push(new F(o.start,a),h,new F(l,o.end)),r},[])}function Dw(n,e,t,r){const i=new X;let s;return s=X.createSegment("M",n[0].start),i.appendSegment(s),n.forEach((o,a)=>{if(Ko.includes(o)){let l,c,u,h;if(t==="arc"){l=-90,c=o.start.diff(o.end),(c.x<0||c.x===0&&c.y<0)&&(l+=180);const d=o.getCenter(),g=new F(d,o.end).rotate(l,d);let p;p=new F(o.start,d),u=p.pointAt(2/3).rotate(l,o.start),h=g.pointAt(1/3).rotate(-l,g.end),s=X.createSegment("C",u,h,g.end),i.appendSegment(s),p=new F(d,o.end),u=g.pointAt(1/3).rotate(l,g.end),h=p.pointAt(1/3).rotate(-l,o.end),s=X.createSegment("C",u,h,o.end),i.appendSegment(s)}else if(t==="gap")s=X.createSegment("M",o.end),i.appendSegment(s);else if(t==="cubic"){l=o.start.theta(o.end);const f=e*.6;let d=e*1.35;c=o.start.diff(o.end),(c.x<0||c.x===0&&c.y<0)&&(d*=-1),u=new P(o.start.x+f,o.start.y+d).rotate(l,o.start),h=new P(o.end.x-f,o.end.y+d).rotate(l,o.end),s=X.createSegment("C",u,h,o.end),i.appendSegment(s)}}else{const l=n[a+1];r===0||!l||Ko.includes(l)?(s=X.createSegment("L",o.end),i.appendSegment(s)):pG(r,i,o.end,o.start,l.end)}}),i}function pG(n,e,t,r,i){const s=t.distance(r)/2,o=t.distance(i)/2,a=-Math.min(n,s),l=-Math.min(n,o),c=t.clone().move(r,a).round(),u=t.clone().move(i,l).round(),h=new P(rc*c.x+ic*t.x,ic*t.y+rc*c.y),f=new P(rc*u.x+ic*t.x,ic*t.y+rc*u.y);let d;d=X.createSegment("L",c),e.appendSegment(d),d=X.createSegment("C",h,f,u),e.appendSegment(d)}let Ko,sc;const mG=Object.freeze(Object.defineProperty({__proto__:null,jumpover:function(n,e,t,r={}){Ko=[],sc=[],fG(this);const i=r.size||5,s=r.type||"arc",o=r.radius||0,a=r.ignoreConnectors||["smooth"],l=this.graph,u=l.model.getEdges();if(u.length===1)return Dw(pf(n,e,t),i,s,o);const h=this.cell,f=u.indexOf(h),d=l.options.connecting.connector||{},g=u.filter((w,x)=>{const C=w.getConnector()||d;return a.includes(C.name)?!1:x>f?C.name!=="jumpover":!0}),p=g.map(w=>l.findViewByCell(w)),b=pf(n,e,t),m=p.map(w=>w==null?[]:w===this?b:pf(w.sourcePoint,w.targetPoint,w.routePoints)),y=[];b.forEach(w=>{const x=g.reduce((C,S,E)=>{if(S!==h){const A=dG(w,m[E]);C.push(...A)}return C},[]).sort((C,S)=>jw(w.start,C)-jw(w.start,S));x.length>0?y.push(...gG(w,x,i)):y.push(w)});const v=Dw(y,i,s,o);return Ko=[],sc=[],r.raw?v:v.serialize()},loop:cG,normal:lG,rounded:uG,smooth:hG},Symbol.toStringTag,{value:"Module"}));var Ai;(function(n){n.presets=mG,n.registry=Ue.create({type:"connector"}),n.registry.register(n.presets,!0)})(Ai||(Ai={}));var yG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Bw extends wt{constructor(e={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(ze(e)),this.changed={}}mutate(e,t={}){const r=t.unset===!0,i=t.silent===!0,s=[],o=this.changing;this.changing=!0,o||(this.previous=ze(this.data),this.changed={});const a=this.data,l=this.previous,c=this.changed;if(Object.keys(e).forEach(u=>{const h=u,f=e[h];Jn(a[h],f)||s.push(h),Jn(l[h],f)?delete c[h]:c[h]=f,r?delete a[h]:a[h]=f}),!i&&s.length>0&&(this.pending=!0,this.pendingOptions=t,s.forEach(u=>{this.emit("change:*",{key:u,options:t,store:this,current:a[u],previous:l[u]})})),o)return this;if(!i)for(;this.pending;)this.pending=!1,this.emit("changed",{current:a,previous:l,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(e,t){if(e==null)return this.data;const r=this.data[e];return r==null?t:r}getPrevious(e){if(this.previous){const t=this.previous[e];return t==null?void 0:t}}set(e,t,r){return e!=null&&(typeof e=="object"?this.mutate(e,t):this.mutate({[e]:t},r)),this}remove(e,t){const i={};let s;if(typeof e=="string")i[e]=void 0,s=t;else if(Array.isArray(e))e.forEach(o=>i[o]=void 0),s=t;else{for(const o in this.data)i[o]=void 0;s=e}return this.mutate(i,Object.assign(Object.assign({},s),{unset:!0})),this}getByPath(e){return jh(this.data,e,"/")}setByPath(e,t,r={}){const i="/",s=Array.isArray(e)?[...e]:e.split(i),o=Array.isArray(e)?e.join(i):e,a=s[0],l=s.length;if(r.propertyPath=o,r.propertyValue=t,r.propertyPathArray=s,l===1)this.set(a,t,r);else{const c={};let u=c,h=a;for(let g=1;g<l;g+=1){const p=s[g],b=Number.isFinite(Number(p));u=u[h]=b?[]:{},h=p}hs(c,s,t,i);const f=ze(this.data);r.rewrite&&Gb(f,e,i);const d=Ie(f,c);this.set(a,d[a],r)}return this}removeByPath(e,t){const r=Array.isArray(e)?e:e.split("/"),i=r[0];if(r.length===1)this.remove(i,t);else{const s=r.slice(1),o=ze(this.get(i));o&&Gb(o,s),this.set(i,o,t)}return this}hasChanged(e){return e==null?Object.keys(this.changed).length>0:e in this.changed}getChanges(e){if(e==null)return this.hasChanged()?ze(this.changed):null;const t=this.changing?this.previous:this.data,r={};let i;for(const s in e){const o=e[s];Jn(t[s],o)||(r[s]=o,i=!0)}return i?ze(r):null}toJSON(){return ze(this.data)}clone(){const e=this.constructor;return new e(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}yG([wt.dispose()],Bw.prototype,"dispose",null);class Jo{constructor(e){this.cell=e,this.ids={},this.cache={}}get(){return Object.keys(this.ids)}start(e,t,r={},i="/"){const s=this.cell.getPropByPath(e),o=nV(r,Jo.defaultOptions),a=this.getTiming(o.timing),l=this.getInterp(o.interp,s,t);let c=0;const u=Array.isArray(e)?e.join(i):e,h=Array.isArray(e)?e:e.split(i),f=()=>{const d=new Date().getTime();c===0&&(c=d);let p=(d-c)/o.duration;p<1?this.ids[u]=requestAnimationFrame(f):p=1;const b=l(a(p));this.cell.setPropByPath(h,b),r.progress&&r.progress(Object.assign({progress:p,currentValue:b},this.getArgs(u))),p===1&&(this.cell.notify("transition:complete",this.getArgs(u)),r.complete&&r.complete(this.getArgs(u)),this.cell.notify("transition:finish",this.getArgs(u)),r.finish&&r.finish(this.getArgs(u)),this.clean(u))};return setTimeout(()=>{this.stop(e,void 0,i),this.cache[u]={startValue:s,targetValue:t,options:o},this.ids[u]=requestAnimationFrame(f),this.cell.notify("transition:start",this.getArgs(u)),r.start&&r.start(this.getArgs(u))},r.delay),this.stop.bind(this,e,i,r)}stop(e,t={},r="/"){const i=Array.isArray(e)?e:e.split(r);return Object.keys(this.ids).filter(s=>Jn(i,s.split(r).slice(0,i.length))).forEach(s=>{cancelAnimationFrame(this.ids[s]);const o=this.cache[s],a=this.getArgs(s),l=Object.assign(Object.assign({},o.options),t),c=l.jumpedToEnd;c&&o.targetValue!=null&&(this.cell.setPropByPath(s,o.targetValue),this.cell.notify("transition:end",Object.assign({},a)),this.cell.notify("transition:complete",Object.assign({},a)),l.complete&&l.complete(Object.assign({},a)));const u=Object.assign({jumpedToEnd:c},a);this.cell.notify("transition:stop",Object.assign({},u)),l.stop&&l.stop(Object.assign({},u)),this.cell.notify("transition:finish",Object.assign({},a)),l.finish&&l.finish(Object.assign({},a)),this.clean(s)}),this}clean(e){delete this.ids[e],delete this.cache[e]}getTiming(e){return typeof e=="string"?Si[e]:e}getInterp(e,t,r){return e?e(t,r):typeof r=="number"?Pi.number(t,r):typeof r=="string"?r[0]==="#"?Pi.color(t,r):Pi.unit(t,r):Pi.object(t,r)}getArgs(e){const t=this.cache[e];return{path:e,startValue:t.startValue,targetValue:t.targetValue,cell:this.cell}}}(function(n){n.defaultOptions={delay:10,duration:100,timing:"linear"}})(Jo||(Jo={}));var vG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},zw=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class le extends wt{static config(e){const{markup:t,propHooks:r,attrHooks:i}=e,s=zw(e,["markup","propHooks","attrHooks"]);t!=null&&(this.markup=t),r&&(this.propHooks=this.propHooks.slice(),Array.isArray(r)?this.propHooks.push(...r):typeof r=="function"?this.propHooks.push(r):Object.values(r).forEach(o=>{typeof o=="function"&&this.propHooks.push(o)})),i&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),i)),this.defaults=Ie({},this.defaults,s)}static getMarkup(){return this.markup}static getDefaults(e){return e?this.defaults:ze(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(e,t){return this.propHooks.reduce((r,i)=>i?K(i,e,r):r,t)}get[Symbol.toStringTag](){return le.toStringTag}constructor(e={}){super();const r=this.constructor.getDefaults(!0),i=Ie({},this.preprocess(r),this.preprocess(e));this.id=i.id||zh(),this.store=new Bw(i),this.animation=new Jo(this),this.setup(),this.init(),this.postprocess(e)}init(){}get model(){return this._model}set model(e){this._model!==e&&(this._model=e)}preprocess(e,t){const r=e.id,s=this.constructor.applyPropHooks(this,e);return r==null&&t!==!0&&(s.id=zh()),s}postprocess(e){}setup(){this.store.on("change:*",e=>{const{key:t,current:r,previous:i,options:s}=e;this.notify("change:*",{key:t,options:s,current:r,previous:i,cell:this}),this.notify(`change:${t}`,{options:s,current:r,previous:i,cell:this});const o=t;(o==="source"||o==="target")&&this.notify("change:terminal",{type:o,current:r,previous:i,options:s,cell:this})}),this.store.on("changed",({options:e})=>this.notify("changed",{options:e,cell:this}))}notify(e,t){this.trigger(e,t);const r=this.model;return r&&(r.notify(`cell:${e}`,t),this.isNode()?r.notify(`node:${e}`,Object.assign(Object.assign({},t),{node:this})):this.isEdge()&&r.notify(`edge:${e}`,Object.assign(Object.assign({},t),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(e){return this.store===e.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(e,t){return e==null?this.store.get():this.store.get(e,t)}setProp(e,t,r){if(typeof e=="string")this.store.set(e,t,r);else{const i=this.preprocess(e,!0);this.store.set(Ie({},this.getProp(),i),t),this.postprocess(e)}return this}removeProp(e,t){return typeof e=="string"||Array.isArray(e)?this.store.removeByPath(e,t):this.store.remove(t),this}hasChanged(e){return e==null?this.store.hasChanged():this.store.hasChanged(e)}getPropByPath(e){return this.store.getByPath(e)}setPropByPath(e,t,r={}){return this.model&&(e==="children"?this._children=t?t.map(i=>this.model.getCell(i)).filter(i=>i!=null):null:e==="parent"&&(this._parent=t?this.model.getCell(t):null)),this.store.setByPath(e,t,r),this}removePropByPath(e,t={}){const r=Array.isArray(e)?e:e.split("/");return r[0]==="attrs"&&(t.dirty=!0),this.store.removeByPath(r,t),this}prop(e,t,r){return e==null?this.getProp():typeof e=="string"||Array.isArray(e)?arguments.length===1?this.getPropByPath(e):t==null?this.removePropByPath(e,r||{}):this.setPropByPath(e,t,r||{}):this.setProp(e,t||{})}previous(e){return this.store.getPrevious(e)}get zIndex(){return this.getZIndex()}set zIndex(e){e==null?this.removeZIndex():this.setZIndex(e)}getZIndex(){return this.store.get("zIndex")}setZIndex(e,t={}){return this.store.set("zIndex",e,t),this}removeZIndex(e={}){return this.store.remove("zIndex",e),this}toFront(e={}){const t=this.model;if(t){let r=t.getMaxZIndex(),i;e.deep?(i=this.getDescendants({deep:!0,breadthFirst:!0}),i.unshift(this)):i=[this],r=r-i.length+1;const s=t.total();let o=t.indexOf(this)!==s-i.length;o||(o=i.some((a,l)=>a.getZIndex()!==r+l)),o&&this.batchUpdate("to-front",()=>{r+=i.length,i.forEach((a,l)=>{a.setZIndex(r+l,e)})})}return this}toBack(e={}){const t=this.model;if(t){let r=t.getMinZIndex(),i;e.deep?(i=this.getDescendants({deep:!0,breadthFirst:!0}),i.unshift(this)):i=[this];let s=t.indexOf(this)!==0;s||(s=i.some((o,a)=>o.getZIndex()!==r+a)),s&&this.batchUpdate("to-back",()=>{r-=i.length,i.forEach((o,a)=>{o.setZIndex(r+a,e)})})}return this}get markup(){return this.getMarkup()}set markup(e){e==null?this.removeMarkup():this.setMarkup(e)}getMarkup(){let e=this.store.get("markup");return e==null&&(e=this.constructor.getMarkup()),e}setMarkup(e,t={}){return this.store.set("markup",e,t),this}removeMarkup(e={}){return this.store.remove("markup",e),this}get attrs(){return this.getAttrs()}set attrs(e){e==null?this.removeAttrs():this.setAttrs(e)}getAttrs(){const e=this.store.get("attrs");return e?Object.assign({},e):{}}setAttrs(e,t={}){if(e==null)this.removeAttrs(t);else{const r=i=>this.store.set("attrs",i,t);if(t.overwrite===!0)r(e);else{const i=this.getAttrs();t.deep===!1?r(Object.assign(Object.assign({},i),e)):r(Ie({},i,e))}}return this}replaceAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{deep:!1}))}removeAttrs(e={}){return this.store.remove("attrs",e),this}getAttrDefinition(e){if(!e)return null;const r=this.constructor.getAttrHooks()||{};let i=r[e]||Bn.registry.get(e);if(!i){const s=Al(e);i=r[s]||Bn.registry.get(s)}return i||null}getAttrByPath(e){return e==null||e===""?this.getAttrs():this.getPropByPath(this.prefixAttrPath(e))}setAttrByPath(e,t,r={}){return this.setPropByPath(this.prefixAttrPath(e),t,r),this}removeAttrByPath(e,t={}){return this.removePropByPath(this.prefixAttrPath(e),t),this}prefixAttrPath(e){return Array.isArray(e)?["attrs"].concat(e):`attrs/${e}`}attr(e,t,r){return e==null?this.getAttrByPath():typeof e=="string"||Array.isArray(e)?arguments.length===1?this.getAttrByPath(e):t==null?this.removeAttrByPath(e,r||{}):this.setAttrByPath(e,t,r||{}):this.setAttrs(e,t||{})}get visible(){return this.isVisible()}set visible(e){this.setVisible(e)}setVisible(e,t={}){return this.store.set("visible",e,t),this}isVisible(){return this.store.get("visible")!==!1}show(e={}){return this.isVisible()||this.setVisible(!0,e),this}hide(e={}){return this.isVisible()&&this.setVisible(!1,e),this}toggleVisible(e,t={}){const r=typeof e=="boolean"?e:!this.isVisible(),i=typeof e=="boolean"?t:e;return r?this.show(i):this.hide(i),this}get data(){return this.getData()}set data(e){this.setData(e)}getData(){return this.store.get("data")}setData(e,t={}){if(e==null)this.removeData(t);else{const r=i=>this.store.set("data",i,t);if(t.overwrite===!0)r(e);else{const i=this.getData();t.deep===!1?r(typeof e=="object"?Object.assign(Object.assign({},i),e):e):r(Ie({},i,e))}}return this}replaceData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{deep:!1}))}removeData(e={}){return this.store.remove("data",e),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const e=this.getParentId();if(e&&this.model){const t=this.model.getCell(e);return this._parent=t,t}return null}getChildren(){const e=this.store.get("children");if(e&&e.length&&this.model){const t=e.map(r=>{var i;return(i=this.model)===null||i===void 0?void 0:i.getCell(r)}).filter(r=>r!=null);return this._children=t,[...t]}return null}hasParent(){return this.parent!=null}isParentOf(e){return e!=null&&e.getParent()===this}isChildOf(e){return e!=null&&this.getParent()===e}eachChild(e,t){return this.children&&this.children.forEach(e,t),this}filterChild(e,t){return this.children?this.children.filter(e,t):[]}getChildCount(){return this.children==null?0:this.children.length}getChildIndex(e){return this.children==null?-1:this.children.indexOf(e)}getChildAt(e){return this.children!=null&&e>=0?this.children[e]:null}getAncestors(e={}){const t=[];let r=this.getParent();for(;r;)t.push(r),r=e.deep!==!1?r.getParent():null;return t}getDescendants(e={}){if(e.deep!==!1){if(e.breadthFirst){const t=[],r=this.getChildren()||[];for(;r.length>0;){const i=r.shift(),s=i.getChildren();t.push(i),s&&r.push(...s)}return t}{const t=this.getChildren()||[];return t.forEach(r=>{t.push(...r.getDescendants(e))}),t}}return this.getChildren()||[]}isDescendantOf(e,t={}){if(e==null)return!1;if(t.deep!==!1){let r=this.getParent();for(;r;){if(r===e)return!0;r=r.getParent()}return!1}return this.isChildOf(e)}isAncestorOf(e,t={}){return e==null?!1:e.isDescendantOf(this,t)}contains(e){return this.isAncestorOf(e)}getCommonAncestor(...e){return le.getCommonAncestor(this,...e)}setParent(e,t={}){return this._parent=e,e?this.store.set("parent",e.id,t):this.store.remove("parent",t),this}setChildren(e,t={}){return this._children=e,e!=null?this.store.set("children",e.map(r=>r.id),t):this.store.remove("children",t),this}unembed(e,t={}){const r=this.children;if(r!=null&&e!=null){const i=this.getChildIndex(e);i!==-1&&(r.splice(i,1),e.setParent(null,t),this.setChildren(r,t))}return this}embed(e,t={}){return e.addTo(this,t),this}addTo(e,t={}){return le.isCell(e)?e.addChild(this,t):e.addCell(this,t),this}insertTo(e,t,r={}){return e.insertChild(this,t,r),this}addChild(e,t={}){return this.insertChild(e,void 0,t)}insertChild(e,t,r={}){if(e!=null&&e!==this){const i=e.getParent(),s=this!==i;let o=t;if(o==null&&(o=this.getChildCount(),s||(o-=1)),i){const l=i.getChildren();if(l){const c=l.indexOf(e);c>=0&&(e.setParent(null,r),l.splice(c,1),i.setChildren(l,r))}}let a=this.children;if(a==null?(a=[],a.push(e)):a.splice(o,0,e),e.setParent(this,r),this.setChildren(a,r),s&&this.model){const l=this.model.getIncomingEdges(this),c=this.model.getOutgoingEdges(this);l&&l.forEach(u=>u.updateParent(r)),c&&c.forEach(u=>u.updateParent(r))}this.model&&this.model.addCell(e,r)}return this}removeFromParent(e={}){const t=this.getParent();if(t!=null){const r=t.getChildIndex(this);t.removeChildAt(r,e)}return this}removeChild(e,t={}){const r=this.getChildIndex(e);return this.removeChildAt(r,t)}removeChildAt(e,t={}){const r=this.getChildAt(e);return this.children!=null&&r!=null&&(this.unembed(r,t),r.remove(t)),r}remove(e={}){return this.batchUpdate("remove",()=>{const t=this.getParent();t&&t.removeChild(this,e),e.deep!==!1&&this.eachChild(r=>r.remove(e)),this.model&&this.model.removeCell(this,e)}),this}transition(e,t,r={},i="/"){return this.animation.start(e,t,r,i)}stopTransition(e,t,r="/"){return this.animation.stop(e,t,r),this}getTransitions(){return this.animation.get()}translate(e,t,r){return this}scale(e,t,r,i){return this}addTools(e,t,r){const i=Array.isArray(e)?e:[e],s=typeof t=="string"?t:null,o=typeof t=="object"?t:typeof r=="object"?r:{};if(o.reset)return this.setTools({name:s,items:i,local:o.local},o);let a=ze(this.getTools());if(a==null||s==null||a.name===s)return a==null&&(a={}),a.items||(a.items=[]),a.name=s,a.items=[...a.items,...i],this.setTools(Object.assign({},a),o)}setTools(e,t={}){return e==null?this.removeTools():this.store.set("tools",le.normalizeTools(e),t),this}getTools(){return this.store.get("tools")}removeTools(e={}){return this.store.remove("tools",e),this}hasTools(e){const t=this.getTools();return t==null?!1:e==null?!0:t.name===e}hasTool(e){const t=this.getTools();return t==null?!1:t.items.some(r=>typeof r=="string"?r===e:r.name===e)}removeTool(e,t={}){const r=ze(this.getTools());if(r){let i=!1;const s=r.items.slice(),o=a=>{s.splice(a,1),i=!0};if(typeof e=="number")o(e);else for(let a=s.length-1;a>=0;a-=1){const l=s[a];(typeof l=="string"?l===e:l.name===e)&&o(a)}i&&(r.items=s,this.setTools(r,t))}return this}getBBox(e){return new D}getConnectionPoint(e,t){return new P}toJSON(e={}){const t=Object.assign({},this.store.get()),r=Object.prototype.toString,i=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!t.shape){const g=this.constructor;throw new Error(`Unable to serialize ${i} missing "shape" prop, check the ${i} "${g.name||r.call(g)}"`)}const s=this.constructor,o=e.diff===!0,a=t.attrs||{},l=s.getDefaults(!0),c=o?this.preprocess(l,!0):l,u=c.attrs||{},h={};Object.entries(t).forEach(([g,p])=>{if(p!=null&&!Array.isArray(p)&&typeof p=="object"&&!Ln(p))throw new Error(`Can only serialize ${i} with plain-object props, but got a "${r.call(p)}" type of key "${g}" on ${i} "${this.id}"`);if(g!=="attrs"&&g!=="shape"&&o){const b=c[g];Jn(p,b)&&delete t[g]}}),Object.keys(a).forEach(g=>{const p=a[g],b=u[g];Object.keys(p).forEach(m=>{const y=p[m],v=b?b[m]:null;y!=null&&typeof y=="object"&&!Array.isArray(y)?Object.keys(y).forEach(w=>{const x=y[w];if(b==null||v==null||!Ze(v)||!Jn(v[w],x)){h[g]==null&&(h[g]={}),h[g][m]==null&&(h[g][m]={});const C=h[g][m];C[w]=x}}):(b==null||!Jn(v,y))&&(h[g]==null&&(h[g]={}),h[g][m]=y)})});const f=Object.assign(Object.assign({},t),{attrs:$b(h)?void 0:h});f.attrs==null&&delete f.attrs;const d=f;return d.angle===0&&delete d.angle,ze(d)}clone(e={}){if(!e.deep){const r=Object.assign({},this.store.get());e.keepId||delete r.id,delete r.parent,delete r.children;const i=this.constructor;return new i(r)}return le.deepClone(this)[this.id]}findView(e){return e.findViewByCell(this)}startBatch(e,t={},r=this.model){return this.notify("batch:start",{name:e,data:t,cell:this}),r&&r.startBatch(e,Object.assign(Object.assign({},t),{cell:this})),this}stopBatch(e,t={},r=this.model){return r&&r.stopBatch(e,Object.assign(Object.assign({},t),{cell:this})),this.notify("batch:stop",{name:e,data:t,cell:this}),this}batchUpdate(e,t,r){const i=this.model;this.startBatch(e,r,i);const s=t();return this.stopBatch(e,r,i),s}dispose(){this.removeFromParent(),this.store.dispose()}}le.defaults={},le.attrHooks={},le.propHooks=[],vG([wt.dispose()],le.prototype,"dispose",null),function(n){function e(t){return typeof t=="string"?{items:[t]}:Array.isArray(t)?{items:t}:t.items?t:{items:[t]}}n.normalizeTools=e}(le||(le={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNode=="function"&&typeof i.isEdge=="function"&&typeof i.prop=="function"&&typeof i.attr=="function"}n.isCell=e}(le||(le={})),function(n){function e(...s){const o=s.filter(l=>l!=null).map(l=>l.getAncestors()).sort((l,c)=>l.length-c.length);return o.shift().find(l=>o.every(c=>c.includes(l)))||null}n.getCommonAncestor=e;function t(s,o={}){let a=null;for(let l=0,c=s.length;l<c;l+=1){const u=s[l];let h=u.getBBox(o);if(h){if(u.isNode()){const f=u.getAngle();f!=null&&f!==0&&(h=h.bbox(f))}a=a==null?h:a.union(h)}}return a}n.getCellsBBox=t;function r(s){const o=[s,...s.getDescendants({deep:!0})];return n.cloneCells(o)}n.deepClone=r;function i(s){const o=Bb(s),a=o.reduce((l,c)=>(l[c.id]=c.clone(),l),{});return o.forEach(l=>{const c=a[l.id];if(c.isEdge()){const f=c.getSourceCellId(),d=c.getTargetCellId();f&&a[f]&&c.setSource(Object.assign(Object.assign({},c.getSource()),{cell:a[f].id})),d&&a[d]&&c.setTarget(Object.assign(Object.assign({},c.getTarget()),{cell:a[d].id}))}const u=l.getParent();u&&a[u.id]&&c.setParent(a[u.id]);const h=l.getChildren();if(h&&h.length){const f=h.reduce((d,g)=>(a[g.id]&&d.push(a[g.id]),d),[]);f.length>0&&c.setChildren(f)}}),a}n.cloneCells=i}(le||(le={})),function(n){n.config({propHooks(e){var{tools:t}=e,r=zw(e,["tools"]);return t&&(r.tools=n.normalizeTools(t)),r}})}(le||(le={}));var _s;(function(n){let e,t;function r(o,a){return a?e!=null&&e.exist(o):t!=null&&t.exist(o)}n.exist=r;function i(o){e=o}n.setEdgeRegistry=i;function s(o){t=o}n.setNodeRegistry=s})(_s||(_s={}));class bG{constructor(e){this.ports=[],this.groups={},this.init(ze(e))}getPorts(){return this.ports}getGroup(e){return e!=null?this.groups[e]:null}getPortsByGroup(e){return this.ports.filter(t=>t.group===e||t.group==null&&e==null)}getPortsLayoutByGroup(e,t){const r=this.getPortsByGroup(e),i=e?this.getGroup(e):null,s=i?i.position:null,o=s?s.name:null;let a;if(o!=null){const h=Ei.registry.get(o);if(h==null)return Ei.registry.onNotFound(o);a=h}else a=Ei.presets.left;const l=r.map(h=>h&&h.position&&h.position.args||{}),c=s&&s.args||{};return a(l,t,c).map((h,f)=>{const d=r[f];return{portLayout:h,portId:d.id,portSize:d.size,portAttrs:d.attrs,labelSize:d.label.size,labelLayout:this.getPortLabelLayout(d,P.create(h.position),t)}})}init(e){const{groups:t,items:r}=e;t!=null&&Object.keys(t).forEach(i=>{this.groups[i]=this.parseGroup(t[i])}),Array.isArray(r)&&r.forEach(i=>{this.ports.push(this.parsePort(i))})}parseGroup(e){return Object.assign(Object.assign({},e),{label:this.getLabel(e,!0),position:this.getPortPosition(e.position,!0)})}parsePort(e){const t=Object.assign({},e),r=this.getGroup(e.group)||{};return t.markup=t.markup||r.markup,t.attrs=Ie({},r.attrs,t.attrs),t.position=this.createPosition(r,t),t.label=Ie({},r.label,this.getLabel(t)),t.zIndex=this.getZIndex(r,t),t.size=Object.assign(Object.assign({},r.size),t.size),t}getZIndex(e,t){return typeof t.zIndex=="number"?t.zIndex:typeof e.zIndex=="number"||e.zIndex==="auto"?e.zIndex:"auto"}createPosition(e,t){return Ie({name:"left",args:{}},e.position,{args:t.args})}getPortPosition(e,t=!1){if(e==null){if(t)return{name:"left",args:{}}}else{if(typeof e=="string")return{name:e,args:{}};if(Array.isArray(e))return{name:"absolute",args:{x:e[0],y:e[1]}};if(typeof e=="object")return e}return{args:{}}}getPortLabelPosition(e,t=!1){if(e==null){if(t)return{name:"left",args:{}}}else{if(typeof e=="string")return{name:e,args:{}};if(typeof e=="object")return e}return{args:{}}}getLabel(e,t=!1){const r=e.label||{};return r.position=this.getPortLabelPosition(r.position,t),r}getPortLabelLayout(e,t,r){const i=e.label.position.name||"left",s=e.label.position.args||{},o=Cs.registry.get(i)||Cs.presets.left;return o?o(t,r,s):null}}var oc=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};let We=class jO extends le{get[Symbol.toStringTag](){return jO.toStringTag}constructor(e={}){super(e),this.initPorts()}preprocess(e,t){const{x:r,y:i,width:s,height:o}=e,a=oc(e,["x","y","width","height"]);if(r!=null||i!=null){const l=a.position;a.position=Object.assign(Object.assign({},l),{x:r!=null?r:l?l.x:0,y:i!=null?i:l?l.y:0})}if(s!=null||o!=null){const l=a.size;a.size=Object.assign(Object.assign({},l),{width:s!=null?s:l?l.width:0,height:o!=null?o:l?l.height:0})}return super.preprocess(a,t)}isNode(){return!0}size(e,t,r){return e===void 0?this.getSize():typeof e=="number"?this.setSize(e,t,r):this.setSize(e,t)}getSize(){const e=this.store.get("size");return e?Object.assign({},e):{width:1,height:1}}setSize(e,t,r){return typeof e=="object"?this.resize(e.width,e.height,t):this.resize(e,t,r),this}resize(e,t,r={}){this.startBatch("resize",r);const i=r.direction;if(i){const s=this.getSize();switch(i){case"left":case"right":t=s.height;break;case"top":case"bottom":e=s.width;break}let a={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3}[i];const l=ye.normalize(this.getAngle()||0);r.absolute&&(a+=Math.floor((l+45)/90),a%=4);const c=this.getBBox();let u;a===0?u=c.getBottomLeft():a===1?u=c.getCorner():a===2?u=c.getTopRight():u=c.getOrigin();const h=u.clone().rotate(-l,c.getCenter()),f=Math.sqrt(e*e+t*t)/2;let d=a*Math.PI/2;d+=Math.atan(a%2===0?t/e:e/t),d-=ye.toRad(l);const p=P.fromPolar(f,d,h).clone().translate(e/-2,t/-2);this.store.set("size",{width:e,height:t},r),this.setPosition(p.x,p.y,r)}else this.store.set("size",{width:e,height:t},r);return this.stopBatch("resize",r),this}scale(e,t,r,i={}){const s=this.getBBox().scale(e,t,r==null?void 0:r);return this.startBatch("scale",i),this.setPosition(s.x,s.y,i),this.resize(s.width,s.height,i),this.stopBatch("scale"),this}position(e,t,r){return typeof e=="number"?this.setPosition(e,t,r):this.getPosition(e)}getPosition(e={}){if(e.relative){const r=this.getParent();if(r!=null&&r.isNode()){const i=this.getPosition(),s=r.getPosition();return{x:i.x-s.x,y:i.y-s.y}}}const t=this.store.get("position");return t?Object.assign({},t):{x:0,y:0}}setPosition(e,t,r={}){let i,s,o;if(typeof e=="object"?(i=e.x,s=e.y,o=t||{}):(i=e,s=t,o=r||{}),o.relative){const a=this.getParent();if(a!=null&&a.isNode()){const l=a.getPosition();i+=l.x,s+=l.y}}if(o.deep){const a=this.getPosition();this.translate(i-a.x,s-a.y,o)}else this.store.set("position",{x:i,y:s},o);return this}translate(e=0,t=0,r={}){if(e===0&&t===0)return this;r.translateBy=r.translateBy||this.id;const i=this.getPosition();if(r.restrict!=null&&r.translateBy===this.id){const o=this.getBBox({deep:!0}),a=r.restrict,l=i.x-o.x,c=i.y-o.y,u=Math.max(a.x+l,Math.min(a.x+a.width+l-o.width,i.x+e)),h=Math.max(a.y+c,Math.min(a.y+a.height+c-o.height,i.y+t));e=u-i.x,t=h-i.y}const s={x:i.x+e,y:i.y+t};return r.tx=e,r.ty=t,r.transition?(typeof r.transition!="object"&&(r.transition={}),this.transition("position",s,Object.assign(Object.assign({},r.transition),{interp:Pi.object})),this.eachChild(o=>{var a;((a=r.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(e,t,r)})):(this.startBatch("translate",r),this.store.set("position",s,r),this.eachChild(o=>{var a;((a=r.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(e,t,r)}),this.stopBatch("translate",r)),this}angle(e,t){return e==null?this.getAngle():this.rotate(e,t)}getAngle(){return this.store.get("angle",0)}rotate(e,t={}){const r=this.getAngle();if(t.center){const i=this.getSize(),s=this.getPosition(),o=this.getBBox().getCenter();o.rotate(r-e,t.center);const a=o.x-i.width/2-s.x,l=o.y-i.height/2-s.y;this.startBatch("rotate",{angle:e,options:t}),this.setPosition(s.x+a,s.y+l,t),this.rotate(e,Object.assign(Object.assign({},t),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",t.absolute?e:(r+e)%360,t);return this}getBBox(e={}){if(e.deep){const t=this.getDescendants({deep:!0,breadthFirst:!0});return t.push(this),le.getCellsBBox(t)}return D.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(e,t){const r=this.getBBox(),i=r.getCenter(),s=e.getTerminal(t);if(s==null)return i;const o=s.port;if(!o||!this.hasPort(o))return i;const a=this.getPort(o);if(!a||!a.group)return i;const c=this.getPortsPosition(a.group)[o].position,u=P.create(c).translate(r.getOrigin()),h=this.getAngle();return h&&u.rotate(-h,i),u}fit(e={}){const r=(this.getChildren()||[]).filter(c=>c.isNode());if(r.length===0)return this;this.startBatch("fit-embeds",e),e.deep&&r.forEach(c=>c.fit(e));let{x:i,y:s,width:o,height:a}=le.getCellsBBox(r);const l=Rn(e.padding);return i-=l.left,s-=l.top,o+=l.left+l.right,a+=l.bottom+l.top,this.store.set({position:{x:i,y:s},size:{width:o,height:a}},e),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(e){this.setPortContainerMarkup(e)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||Pe.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(e,t={}){return this.store.set("portContainerMarkup",Pe.clone(e),t),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(e){this.setPortMarkup(e)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||Pe.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(e,t={}){return this.store.set("portMarkup",Pe.clone(e),t),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(e){this.setPortLabelMarkup(e)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||Pe.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(e,t={}){return this.store.set("portLabelMarkup",Pe.clone(e),t),this}get ports(){const e=this.store.get("ports",{items:[]});return e.items==null&&(e.items=[]),e}getPorts(){return ze(this.ports.items)}getPortsByGroup(e){return this.getPorts().filter(t=>t.group===e)}getPort(e){return ze(this.ports.items.find(t=>t.id&&t.id===e))}getPortAt(e){return this.ports.items[e]||null}hasPorts(){return this.ports.items.length>0}hasPort(e){return this.getPortIndex(e)!==-1}getPortIndex(e){const t=typeof e=="string"?e:e.id;return t!=null?this.ports.items.findIndex(r=>r.id===t):-1}getPortsPosition(e){const t=this.getSize();return this.port.getPortsLayoutByGroup(e,new D(0,0,t.width,t.height)).reduce((i,s)=>{const o=s.portLayout;return i[s.portId]={position:Object.assign({},o.position),angle:o.angle||0},i},{})}getPortProp(e,t){return this.getPropByPath(this.prefixPortPath(e,t))}setPortProp(e,t,r,i){if(typeof t=="string"||Array.isArray(t)){const a=this.prefixPortPath(e,t),l=r;return this.setPropByPath(a,l,i)}const s=this.prefixPortPath(e),o=t;return this.setPropByPath(s,o,r)}removePortProp(e,t,r){return typeof t=="string"||Array.isArray(t)?this.removePropByPath(this.prefixPortPath(e,t),r):this.removePropByPath(this.prefixPortPath(e),t)}portProp(e,t,r,i){return t==null?this.getPortProp(e):typeof t=="string"||Array.isArray(t)?arguments.length===2?this.getPortProp(e,t):r==null?this.removePortProp(e,t,i):this.setPortProp(e,t,r,i):this.setPortProp(e,t,r)}prefixPortPath(e,t){const r=this.getPortIndex(e);if(r===-1)throw new Error(`Unable to find port with id: "${e}"`);return t==null||t===""?["ports","items",`${r}`]:Array.isArray(t)?["ports","items",`${r}`,...t]:`ports/items/${r}/${t}`}addPort(e,t){const r=[...this.ports.items];return r.push(e),this.setPropByPath("ports/items",r,t),this}addPorts(e,t){return this.setPropByPath("ports/items",[...this.ports.items,...e],t),this}insertPort(e,t,r){const i=[...this.ports.items];return i.splice(e,0,t),this.setPropByPath("ports/items",i,r),this}removePort(e,t={}){return this.removePortAt(this.getPortIndex(e),t)}removePortAt(e,t={}){if(e>=0){const r=[...this.ports.items];r.splice(e,1),t.rewrite=!0,this.setPropByPath("ports/items",r,t)}return this}removePorts(e,t){let r;if(Array.isArray(e)){if(r=t||{},e.length){r.rewrite=!0;const s=[...this.ports.items].filter(o=>!e.some(a=>{const l=typeof a=="string"?a:a.id;return o.id===l}));this.setPropByPath("ports/items",s,r)}}else r=e||{},r.rewrite=!0,this.setPropByPath("ports/items",[],r);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(e,t){return this.port.getPortsLayoutByGroup(e,t)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){const e=this.ports,t={};e.items.forEach(o=>{o.id&&(t[o.id]=!0)});const r={};(this.store.getPrevious("ports")||{items:[]}).items.forEach(o=>{o.id&&!t[o.id]&&(r[o.id]=!0)});const s=this.model;s&&!$b(r)&&(s.getConnectedEdges(this,{incoming:!0}).forEach(l=>{const c=l.getTargetPortId();c&&r[c]&&l.remove()}),s.getConnectedEdges(this,{outgoing:!0}).forEach(l=>{const c=l.getSourcePortId();c&&r[c]&&l.remove()}))}validatePorts(){const e={},t=[];return this.ports.items.forEach(r=>{typeof r!="object"&&t.push(`Invalid port ${r}.`),r.id==null&&(r.id=this.generatePortId()),e[r.id]&&t.push("Duplicitied port id."),e[r.id]=!0}),t}generatePortId(){return zh()}updatePortData(){const e=this.validatePorts();if(e.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(e.join(" "));const t=this.port?this.port.getPorts():null;this.port=new bG(this.ports);const r=this.port.getPorts(),i=t?r.filter(o=>t.find(a=>a.id===o.id)?null:o):[...r],s=t?t.filter(o=>r.find(a=>a.id===o.id)?null:o):[];i.length>0&&this.notify("ports:added",{added:i,cell:this,node:this}),s.length>0&&this.notify("ports:removed",{removed:s,cell:this,node:this})}};We.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNode=="function"&&typeof i.isEdge=="function"&&typeof i.prop=="function"&&typeof i.attr=="function"&&typeof i.size=="function"&&typeof i.position=="function"}n.isNode=e}(We||(We={})),function(n){n.config({propHooks(e){var{ports:t}=e,r=oc(e,["ports"]);return t&&(r.ports=Array.isArray(t)?{items:t}:t),r}})}(We||(We={})),function(n){n.registry=Ue.create({type:"node",process(e,t){if(_s.exist(e,!0))throw new Error(`Node with name '${e}' was registered by anthor Edge`);if(typeof t=="function")return t.config({shape:e}),t;let r=n;const{inherit:i}=t,s=oc(t,["inherit"]);if(i)if(typeof i=="string"){const a=this.get(i);a==null?this.onNotFound(i,"inherited"):r=a}else r=i;s.constructorName==null&&(s.constructorName=e);const o=r.define.call(r,s);return o.config({shape:e}),o}}),_s.setNodeRegistry(n.registry)}(We||(We={})),function(n){let e=0;function t(s){return s?Dh(s):(e+=1,`CustomNode${e}`)}function r(s){const{constructorName:o,overwrite:a}=s,l=oc(s,["constructorName","overwrite"]),c=Rh(t(o||l.shape),this);return c.config(l),l.shape&&n.registry.register(l.shape,c,a),c}n.define=r;function i(s){const o=s.shape||"rect",a=n.registry.get(o);return a?new a(s):n.registry.onNotFound(o)}n.create=i}(We||(We={}));var ac=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};let Ve=class DO extends le{get[Symbol.toStringTag](){return DO.toStringTag}constructor(e={}){super(e)}preprocess(e,t){const{source:r,sourceCell:i,sourcePort:s,sourcePoint:o,target:a,targetCell:l,targetPort:c,targetPoint:u}=e,f=ac(e,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),d=g=>typeof g=="string"||typeof g=="number";if(r!=null)if(le.isCell(r))f.source={cell:r.id};else if(d(r))f.source={cell:r};else if(P.isPoint(r))f.source=r.toJSON();else if(Array.isArray(r))f.source={x:r[0],y:r[1]};else{const g=r.cell;le.isCell(g)?f.source=Object.assign(Object.assign({},r),{cell:g.id}):f.source=r}if(i!=null||s!=null){let g=f.source;if(i!=null){const p=d(i)?i:i.id;g?g.cell=p:g=f.source={cell:p}}s!=null&&g&&(g.port=s)}else o!=null&&(f.source=P.create(o).toJSON());if(a!=null)if(le.isCell(a))f.target={cell:a.id};else if(d(a))f.target={cell:a};else if(P.isPoint(a))f.target=a.toJSON();else if(Array.isArray(a))f.target={x:a[0],y:a[1]};else{const g=a.cell;le.isCell(g)?f.target=Object.assign(Object.assign({},a),{cell:g.id}):f.target=a}if(l!=null||c!=null){let g=f.target;if(l!=null){const p=d(l)?l:l.id;g?g.cell=p:g=f.target={cell:p}}c!=null&&g&&(g.port=c)}else u!=null&&(f.target=P.create(u).toJSON());return super.preprocess(f,t)}setup(){super.setup(),this.on("change:labels",e=>this.onLabelsChanged(e)),this.on("change:vertices",e=>this.onVertexsChanged(e))}isEdge(){return!0}disconnect(e={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},e),this}get source(){return this.getSource()}set source(e){this.setSource(e)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(e,t,r={}){return this.setTerminal("source",e,t,r)}get target(){return this.getTarget()}set target(e){this.setTarget(e)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(e,t,r={}){return this.setTerminal("target",e,t,r)}getTerminal(e){return Object.assign({},this.store.get(e))}setTerminal(e,t,r,i={}){if(le.isCell(t))return this.store.set(e,Ie({},r,{cell:t.id}),i),this;const s=t;return P.isPoint(t)||s.x!=null&&s.y!=null?(this.store.set(e,Ie({},r,{x:s.x,y:s.y}),i),this):(this.store.set(e,ze(t),i),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(e){const t=this[e];if(P.isPointLike(t))return P.create(t);const r=this.getTerminalCell(e);return r?r.getConnectionPoint(this,e):new P}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(e){if(this.model){const t=e==="source"?this.getSourceCellId():this.getTargetCellId();if(t)return this.model.getCell(t)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(e){let t=this;const r={};for(;t&&t.isEdge();){if(r[t.id])return null;r[t.id]=!0,t=t.getTerminalCell(e)}return t&&t.isNode()?t:null}get router(){return this.getRouter()}set router(e){e==null?this.removeRouter():this.setRouter(e)}getRouter(){return this.store.get("router")}setRouter(e,t,r){return typeof e=="object"?this.store.set("router",e,t):this.store.set("router",{name:e,args:t},r),this}removeRouter(e={}){return this.store.remove("router",e),this}get connector(){return this.getConnector()}set connector(e){e==null?this.removeConnector():this.setConnector(e)}getConnector(){return this.store.get("connector")}setConnector(e,t,r){return typeof e=="object"?this.store.set("connector",e,t):this.store.set("connector",{name:e,args:t},r),this}removeConnector(e={}){return this.store.remove("connector",e)}getDefaultLabel(){const e=this.constructor,t=this.store.get("defaultLabel")||e.defaultLabel||{};return ze(t)}get labels(){return this.getLabels()}set labels(e){this.setLabels(e)}getLabels(){return[...this.store.get("labels",[])].map(e=>this.parseLabel(e))}setLabels(e,t={}){return this.store.set("labels",Array.isArray(e)?e:[e],t),this}insertLabel(e,t,r={}){const i=this.getLabels(),s=i.length;let o=t!=null&&Number.isFinite(t)?t:s;return o<0&&(o=s+o+1),i.splice(o,0,this.parseLabel(e)),this.setLabels(i,r)}appendLabel(e,t={}){return this.insertLabel(e,-1,t)}getLabelAt(e){const t=this.getLabels();return e!=null&&Number.isFinite(e)?this.parseLabel(t[e]):null}setLabelAt(e,t,r={}){if(e!=null&&Number.isFinite(e)){const i=this.getLabels();i[e]=this.parseLabel(t),this.setLabels(i,r)}return this}removeLabelAt(e,t={}){const r=this.getLabels(),i=e!=null&&Number.isFinite(e)?e:-1,s=r.splice(i,1);return this.setLabels(r,t),s.length?s[0]:null}parseLabel(e){return typeof e=="string"?this.constructor.parseStringLabel(e):e}onLabelsChanged({previous:e,current:t}){const r=e&&t?t.filter(s=>e.find(o=>s===o||Jn(s,o))?null:s):t?[...t]:[],i=e&&t?e.filter(s=>t.find(o=>s===o||Jn(s,o))?null:s):e?[...e]:[];r.length>0&&this.notify("labels:added",{added:r,cell:this,edge:this}),i.length>0&&this.notify("labels:removed",{removed:i,cell:this,edge:this})}get vertices(){return this.getVertices()}set vertices(e){this.setVertices(e)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(e,t={}){const r=Array.isArray(e)?e:[e];return this.store.set("vertices",r.map(i=>P.toJSON(i)),t),this}insertVertex(e,t,r={}){const i=this.getVertices(),s=i.length;let o=t!=null&&Number.isFinite(t)?t:s;return o<0&&(o=s+o+1),i.splice(o,0,P.toJSON(e)),this.setVertices(i,r)}appendVertex(e,t={}){return this.insertVertex(e,-1,t)}getVertexAt(e){return e!=null&&Number.isFinite(e)?this.getVertices()[e]:null}setVertexAt(e,t,r={}){if(e!=null&&Number.isFinite(e)){const i=this.getVertices();i[e]=t,this.setVertices(i,r)}return this}removeVertexAt(e,t={}){const r=this.getVertices(),i=e!=null&&Number.isFinite(e)?e:-1;return r.splice(i,1),this.setVertices(r,t)}onVertexsChanged({previous:e,current:t}){const r=e&&t?t.filter(s=>e.find(o=>P.equals(s,o))?null:s):t?[...t]:[],i=e&&t?e.filter(s=>t.find(o=>P.equals(s,o))?null:s):e?[...e]:[];r.length>0&&this.notify("vertexs:added",{added:r,cell:this,edge:this}),i.length>0&&this.notify("vertexs:removed",{removed:i,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||Pe.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}translate(e,t,r={}){return r.translateBy=r.translateBy||this.id,r.tx=e,r.ty=t,this.applyToPoints(i=>({x:(i.x||0)+e,y:(i.y||0)+t}),r)}scale(e,t,r,i={}){return this.applyToPoints(s=>P.create(s).scale(e,t,r).toJSON(),i)}applyToPoints(e,t={}){const r={},i=this.getSource(),s=this.getTarget();P.isPointLike(i)&&(r.source=e(i)),P.isPointLike(s)&&(r.target=e(s));const o=this.getVertices();return o.length>0&&(r.vertices=o.map(e)),this.store.set(r,t),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const e=[this.getSourcePoint(),...this.getVertices().map(t=>P.create(t)),this.getTargetPoint()];return new He(e)}updateParent(e){let t=null;const r=this.getSourceCell(),i=this.getTargetCell(),s=this.getParent();return r&&i&&(r===i||r.isDescendantOf(i)?t=i:i.isDescendantOf(r)?t=r:t=le.getCommonAncestor(r,i)),s&&t&&t.id!==s.id&&s.unembed(this,e),t&&(!s||s.id!==t.id)&&t.embed(this,e),t}hasLoop(e={}){const t=this.getSource(),r=this.getTarget(),i=t.cell,s=r.cell;if(!i||!s)return!1;let o=i===s;if(!o&&e.deep&&this._model){const a=this.getSourceCell(),l=this.getTargetCell();a&&l&&(o=a.isAncestorOf(l,e)||l.isAncestorOf(a,e))}return o}getFragmentAncestor(){const e=[this,this.getSourceNode(),this.getTargetNode()].filter(t=>t!=null);return this.getCommonAncestor(...e)}isFragmentDescendantOf(e){const t=this.getFragmentAncestor();return!!t&&(t.id===e.id||t.isDescendantOf(e))}};Ve.defaults={},function(n){function e(t,r){const i=t,s=r;return i.cell===s.cell?i.port===s.port||i.port==null&&s.port==null:!1}n.equalTerminals=e}(Ve||(Ve={})),function(n){n.defaultLabel={markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{text:{fill:"#000",fontSize:14,textAnchor:"middle",textVerticalAnchor:"middle",pointerEvents:"none"},rect:{ref:"label",fill:"#fff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}};function e(t){return{attrs:{label:{text:t}}}}n.parseStringLabel=e}(Ve||(Ve={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNode=="function"&&typeof i.isEdge=="function"&&typeof i.prop=="function"&&typeof i.attr=="function"&&typeof i.disconnect=="function"&&typeof i.getSource=="function"&&typeof i.getTarget=="function"}n.isEdge=e}(Ve||(Ve={})),function(n){n.registry=Ue.create({type:"edge",process(e,t){if(_s.exist(e,!1))throw new Error(`Edge with name '${e}' was registered by anthor Node`);if(typeof t=="function")return t.config({shape:e}),t;let r=n;const{inherit:i="edge"}=t,s=ac(t,["inherit"]);if(typeof i=="string"){const a=this.get(i||"edge");a==null&&i?this.onNotFound(i,"inherited"):r=a}else r=i;s.constructorName==null&&(s.constructorName=e);const o=r.define.call(r,s);return o.config({shape:e}),o}}),_s.setEdgeRegistry(n.registry)}(Ve||(Ve={})),function(n){let e=0;function t(s){return s?Dh(s):(e+=1,`CustomEdge${e}`)}function r(s){const{constructorName:o,overwrite:a}=s,l=ac(s,["constructorName","overwrite"]),c=Rh(t(o||l.shape),this);return c.config(l),l.shape&&n.registry.register(l.shape,c,a),c}n.define=r;function i(s){const o=s.shape||"edge",a=n.registry.get(o);return a?new a(s):n.registry.onNotFound(o)}n.create=i}(Ve||(Ve={})),function(n){const e="basic.edge";n.config({shape:e,propHooks(t){const{label:r,vertices:i}=t,s=ac(t,["label","vertices"]);if(r){s.labels==null&&(s.labels=[]);const o=typeof r=="string"?n.parseStringLabel(r):r;s.labels.push(o)}return i&&Array.isArray(i)&&(s.vertices=i.map(o=>P.create(o).toJSON())),s}}),n.registry.register(e,n)}(Ve||(Ve={}));class Fw extends wt{constructor(e,t={}){super(),this.length=0,this.comparator=t.comparator||"zIndex",this.clean(),e&&this.reset(e,{silent:!0})}toJSON(){return this.cells.map(e=>e.toJSON())}add(e,t,r){let i,s;typeof t=="number"?(i=t,s=Object.assign({merge:!1},r)):(i=this.length,s=Object.assign({merge:!1},t)),i>this.length&&(i=this.length),i<0&&(i+=this.length+1);const o=Array.isArray(e)?e:[e],a=this.comparator&&typeof t!="number"&&s.sort!==!1,l=this.comparator||null;let c=!1;const u=[],h=[];return o.forEach(f=>{const d=this.get(f);d?s.merge&&!f.isSameStore(d)&&(d.setProp(f.getProp(),r),h.push(d),a&&!c&&(l==null||typeof l=="function"?c=d.hasChanged():typeof l=="string"?c=d.hasChanged(l):c=l.some(g=>d.hasChanged(g)))):(u.push(f),this.reference(f))}),u.length&&(a&&(c=!0),this.cells.splice(i,0,...u),this.length=this.cells.length),c&&this.sort({silent:!0}),s.silent||(u.forEach((f,d)=>{const g={cell:f,index:i+d,options:s};this.trigger("added",g),s.dryrun||f.notify("added",Object.assign({},g))}),c&&this.trigger("sorted"),(u.length||h.length)&&this.trigger("updated",{added:u,merged:h,removed:[],options:s})),this}remove(e,t={}){const r=Array.isArray(e)?e:[e],i=this.removeCells(r,t);return!t.silent&&i.length>0&&this.trigger("updated",{options:t,removed:i,added:[],merged:[]}),Array.isArray(e)?i:i[0]}removeCells(e,t){const r=[];for(let i=0;i<e.length;i+=1){const s=this.get(e[i]);if(s==null)continue;const o=this.cells.indexOf(s);this.cells.splice(o,1),this.length-=1,delete this.map[s.id],r.push(s),this.unreference(s),t.dryrun||s.remove(),t.silent||(this.trigger("removed",{cell:s,index:o,options:t}),t.dryrun||s.notify("removed",{cell:s,index:o,options:t}))}return r}reset(e,t={}){const r=this.cells.slice();if(r.forEach(i=>this.unreference(i)),this.clean(),this.add(e,Object.assign({silent:!0},t)),!t.silent){const i=this.cells.slice();this.trigger("reseted",{options:t,previous:r,current:i});const s=[],o=[];i.forEach(a=>{r.some(c=>c.id===a.id)||s.push(a)}),r.forEach(a=>{i.some(c=>c.id===a.id)||o.push(a)}),this.trigger("updated",{options:t,added:s,removed:o,merged:[]})}return this}push(e,t){return this.add(e,this.length,t)}pop(e){const t=this.at(this.length-1);return this.remove(t,e)}unshift(e,t){return this.add(e,0,t)}shift(e){const t=this.at(0);return this.remove(t,e)}get(e){if(e==null)return null;const t=typeof e=="string"||typeof e=="number"?e:e.id;return this.map[t]||null}has(e){return this.get(e)!=null}at(e){return e<0&&(e+=this.length),this.cells[e]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(e){return this.cells.indexOf(e)}toArray(){return this.cells.slice()}sort(e={}){return this.comparator!=null&&(this.cells=Lb(this.cells,this.comparator),e.silent||this.trigger("sorted")),this}clone(){const e=this.constructor;return new e(this.cells.slice(),{comparator:this.comparator})}reference(e){this.map[e.id]=e,e.on("*",this.notifyCellEvent,this)}unreference(e){e.off("*",this.notifyCellEvent,this),delete this.map[e.id]}notifyCellEvent(e,t){const r=t.cell;this.trigger(`cell:${e}`,t),r&&(r.isNode()?this.trigger(`node:${e}`,Object.assign(Object.assign({},t),{node:r})):r.isEdge()&&this.trigger(`edge:${e}`,Object.assign(Object.assign({},t),{edge:r})))}clean(){this.length=0,this.cells=[],this.map={}}}class zn extends wt{get[Symbol.toStringTag](){return zn.toStringTag}constructor(e=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new Fw(e),this.setup()}notify(e,t){this.trigger(e,t);const r=this.graph;return r&&(e==="sorted"||e==="reseted"||e==="updated"?r.trigger(`model:${e}`,t):r.trigger(e,t)),this}setup(){const e=this.collection;e.on("sorted",()=>this.notify("sorted",null)),e.on("updated",t=>this.notify("updated",t)),e.on("cell:change:zIndex",()=>this.sortOnChangeZ()),e.on("added",({cell:t})=>{this.onCellAdded(t)}),e.on("removed",t=>{const r=t.cell;this.onCellRemoved(r,t.options),this.notify("cell:removed",t),r.isNode()?this.notify("node:removed",Object.assign(Object.assign({},t),{node:r})):r.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},t),{edge:r}))}),e.on("reseted",t=>{this.onReset(t.current),this.notify("reseted",t)}),e.on("edge:change:source",({edge:t})=>this.onEdgeTerminalChanged(t,"source")),e.on("edge:change:target",({edge:t})=>{this.onEdgeTerminalChanged(t,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(e){const t=e.id;e.isEdge()?(e.updateParent(),this.edges[t]=!0,this.onEdgeTerminalChanged(e,"source"),this.onEdgeTerminalChanged(e,"target")):this.nodes[t]=!0}onCellRemoved(e,t){const r=e.id;if(e.isEdge()){delete this.edges[r];const i=e.getSource(),s=e.getTarget();if(i&&i.cell){const o=this.outgoings[i.cell],a=o?o.indexOf(r):-1;a>=0&&(o.splice(a,1),o.length===0&&delete this.outgoings[i.cell])}if(s&&s.cell){const o=this.incomings[s.cell],a=o?o.indexOf(r):-1;a>=0&&(o.splice(a,1),o.length===0&&delete this.incomings[s.cell])}}else delete this.nodes[r];t.clear||(t.disconnectEdges?this.disconnectConnectedEdges(e,t):this.removeConnectedEdges(e,t)),e.model===this&&(e.model=null)}onReset(e){this.nodes={},this.edges={},this.outgoings={},this.incomings={},e.forEach(t=>this.onCellAdded(t))}onEdgeTerminalChanged(e,t){const r=t==="source"?this.outgoings:this.incomings,i=e.previous(t);if(i&&i.cell){const o=le.isCell(i.cell)?i.cell.id:i.cell,a=r[o],l=a?a.indexOf(e.id):-1;l>=0&&(a.splice(l,1),a.length===0&&delete r[o])}const s=e.getTerminal(t);if(s&&s.cell){const o=le.isCell(s.cell)?s.cell.id:s.cell,a=r[o]||[];a.indexOf(e.id)===-1&&a.push(e.id),r[o]=a}}prepareCell(e,t){return!e.model&&(!t||!t.dryrun)&&(e.model=this),e.zIndex==null&&e.setZIndex(this.getMaxZIndex()+1,{silent:!0}),e}resetCells(e,t={}){return e.map(r=>this.prepareCell(r,Object.assign(Object.assign({},t),{dryrun:!0}))),this.collection.reset(e,t),e.map(r=>this.prepareCell(r,{options:t})),this}clear(e={}){const t=this.getCells();if(t.length===0)return this;const r=Object.assign(Object.assign({},e),{clear:!0});return this.batchUpdate("clear",()=>{const i=t.sort((s,o)=>{const a=s.isEdge()?1:2,l=o.isEdge()?1:2;return a-l});for(;i.length>0;){const s=i.shift();s&&s.remove(r)}},r),this}addNode(e,t={}){const r=We.isNode(e)?e:this.createNode(e);return this.addCell(r,t),r}updateNode(e,t={}){const r=this.createNode(e),i=r.getProp();return r.dispose(),this.updateCell(i,t)}createNode(e){return We.create(e)}addEdge(e,t={}){const r=Ve.isEdge(e)?e:this.createEdge(e);return this.addCell(r,t),r}createEdge(e){return Ve.create(e)}updateEdge(e,t={}){const r=this.createEdge(e),i=r.getProp();return r.dispose(),this.updateCell(i,t)}addCell(e,t={}){return Array.isArray(e)?this.addCells(e,t):(!this.collection.has(e)&&!this.addings.has(e)&&(this.addings.set(e,!0),this.collection.add(this.prepareCell(e,t),t),e.eachChild(r=>this.addCell(r,t)),this.addings.delete(e)),this)}addCells(e,t={}){const r=e.length;if(r===0)return this;const i=Object.assign(Object.assign({},t),{position:r-1,maxPosition:r-1});return this.startBatch("add",Object.assign(Object.assign({},i),{cells:e})),e.forEach(s=>{this.addCell(s,i),i.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},i),{cells:e})),this}updateCell(e,t={}){const r=e.id&&this.getCell(e.id);return r?this.batchUpdate("update",()=>(Object.entries(e).forEach(([i,s])=>r.setProp(i,s,t)),!0),e):!1}removeCell(e,t={}){const r=typeof e=="string"?this.getCell(e):e;return r&&this.has(r)?this.collection.remove(r,t):null}updateCellId(e,t){this.startBatch("update",{id:t}),e.prop("id",t);const r=e.clone({keepId:!0});return this.addCell(r),this.getConnectedEdges(e).forEach(s=>{const o=s.getSourceCell(),a=s.getTargetCell();o===e&&s.setSource(Object.assign(Object.assign({},s.getSource()),{cell:t})),a===e&&s.setTarget(Object.assign(Object.assign({},s.getTarget()),{cell:t}))}),this.removeCell(e),this.stopBatch("update",{id:t}),r}removeCells(e,t={}){return e.length?this.batchUpdate("remove",()=>e.map(r=>this.removeCell(r,t))):[]}removeConnectedEdges(e,t={}){const r=this.getConnectedEdges(e);return r.forEach(i=>{i.remove(t)}),r}disconnectConnectedEdges(e,t={}){const r=typeof e=="string"?e:e.id;this.getConnectedEdges(e).forEach(i=>{const s=i.getSourceCellId(),o=i.getTargetCellId();s===r&&i.setSource({x:0,y:0},t),o===r&&i.setTarget({x:0,y:0},t)})}has(e){return this.collection.has(e)}total(){return this.collection.length}indexOf(e){return this.collection.indexOf(e)}getCell(e){return this.collection.get(e)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const e=this.collection.first();return e&&e.getZIndex()||0}getMaxZIndex(){const e=this.collection.last();return e&&e.getZIndex()||0}getCellsFromCache(e){return e?Object.keys(e).map(t=>this.getCell(t)).filter(t=>t!=null):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(e){const t=typeof e=="string"?e:e.id,r=this.outgoings[t];return r?r.map(i=>this.getCell(i)).filter(i=>i&&i.isEdge()):null}getIncomingEdges(e){const t=typeof e=="string"?e:e.id,r=this.incomings[t];return r?r.map(i=>this.getCell(i)).filter(i=>i&&i.isEdge()):null}getConnectedEdges(e,t={}){const r=[],i=typeof e=="string"?this.getCell(e):e;if(i==null)return r;const s={},o=t.indirect;let a=t.incoming,l=t.outgoing;a==null&&l==null&&(a=l=!0);const c=(u,h)=>{const f=h?this.getOutgoingEdges(u):this.getIncomingEdges(u);if(f!=null&&f.forEach(d=>{s[d.id]||(r.push(d),s[d.id]=!0,o&&(a&&c(d,!1),l&&c(d,!0)))}),o&&u.isEdge()){const d=h?u.getTargetCell():u.getSourceCell();d&&d.isEdge()&&(s[d.id]||(r.push(d),c(d,h)))}};if(l&&c(i,!0),a&&c(i,!1),t.deep){const u=i.getDescendants({deep:!0}),h={};u.forEach(d=>{d.isNode()&&(h[d.id]=!0)});const f=(d,g)=>{const p=g?this.getOutgoingEdges(d.id):this.getIncomingEdges(d.id);p!=null&&p.forEach(b=>{if(!s[b.id]){const m=b.getSourceCell(),y=b.getTargetCell();if(!t.enclosed&&m&&h[m.id]&&y&&h[y.id])return;r.push(b),s[b.id]=!0}})};u.forEach(d=>{d.isEdge()||(l&&f(d,!0),a&&f(d,!1))})}return r}isBoundary(e,t){const r=typeof e=="string"?this.getCell(e):e,i=t?this.getIncomingEdges(r):this.getOutgoingEdges(r);return i==null||i.length===0}getBoundaryNodes(e){const t=[];return Object.keys(this.nodes).forEach(r=>{if(this.isBoundary(r,e)){const i=this.getCell(r);i&&t.push(i)}}),t}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(e){return this.isBoundary(e,!0)}isLeaf(e){return this.isBoundary(e,!1)}getNeighbors(e,t={}){let r=t.incoming,i=t.outgoing;r==null&&i==null&&(r=i=!0);const o=this.getConnectedEdges(e,t).reduce((a,l)=>{const c=l.hasLoop(t),u=l.getSourceCell(),h=l.getTargetCell();return r&&u&&u.isNode()&&!a[u.id]&&(c||u!==e&&(!t.deep||!u.isDescendantOf(e)))&&(a[u.id]=u),i&&h&&h.isNode()&&!a[h.id]&&(c||h!==e&&(!t.deep||!h.isDescendantOf(e)))&&(a[h.id]=h),a},{});if(e.isEdge()){if(r){const a=e.getSourceCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}if(i){const a=e.getTargetCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}}return Object.keys(o).map(a=>o[a])}isNeighbor(e,t,r={}){let i=r.incoming,s=r.outgoing;return i==null&&s==null&&(i=s=!0),this.getConnectedEdges(e,r).some(o=>{const a=o.getSourceCell(),l=o.getTargetCell();return!!(i&&a&&a.id===t.id||s&&l&&l.id===t.id)})}getSuccessors(e,t={}){const r=[];return this.search(e,(i,s)=>{i!==e&&this.matchDistance(s,t.distance)&&r.push(i)},Object.assign(Object.assign({},t),{outgoing:!0})),r}isSuccessor(e,t,r={}){let i=!1;return this.search(e,(s,o)=>{if(s===t&&s!==e&&this.matchDistance(o,r.distance))return i=!0,!1},Object.assign(Object.assign({},r),{outgoing:!0})),i}getPredecessors(e,t={}){const r=[];return this.search(e,(i,s)=>{i!==e&&this.matchDistance(s,t.distance)&&r.push(i)},Object.assign(Object.assign({},t),{incoming:!0})),r}isPredecessor(e,t,r={}){let i=!1;return this.search(e,(s,o)=>{if(s===t&&s!==e&&this.matchDistance(o,r.distance))return i=!0,!1},Object.assign(Object.assign({},r),{incoming:!0})),i}matchDistance(e,t){return t==null?!0:typeof t=="function"?t(e):Array.isArray(t)&&t.includes(e)?!0:e===t}getCommonAncestor(...e){const t=[];return e.forEach(r=>{r&&(Array.isArray(r)?t.push(...r):t.push(r))}),le.getCommonAncestor(...t)}getSubGraph(e,t={}){const r=[],i={},s=[],o=[],a=l=>{i[l.id]||(r.push(l),i[l.id]=l,l.isEdge()&&o.push(l),l.isNode()&&s.push(l))};return e.forEach(l=>{a(l),t.deep&&l.getDescendants({deep:!0}).forEach(u=>a(u))}),o.forEach(l=>{const c=l.getSourceCell(),u=l.getTargetCell();c&&!i[c.id]&&(r.push(c),i[c.id]=c,c.isNode()&&s.push(c)),u&&!i[u.id]&&(r.push(u),i[u.id]=u,u.isNode()&&s.push(u))}),s.forEach(l=>{this.getConnectedEdges(l,t).forEach(u=>{const h=u.getSourceCell(),f=u.getTargetCell();!i[u.id]&&h&&i[h.id]&&f&&i[f.id]&&(r.push(u),i[u.id]=u)})}),r}cloneSubGraph(e,t={}){const r=this.getSubGraph(e,t);return this.cloneCells(r)}cloneCells(e){return le.cloneCells(e)}getNodesFromPoint(e,t){const r=typeof e=="number"?{x:e,y:t||0}:e;return this.getNodes().filter(i=>i.getBBox().containsPoint(r))}getNodesInArea(e,t,r,i,s){const o=typeof e=="number"?new D(e,t,r,i):D.create(e),a=typeof e=="number"?s:t,l=a&&a.strict;return this.getNodes().filter(c=>{const u=c.getBBox();return l?o.containsRect(u):o.isIntersectWithRect(u)})}getEdgesInArea(e,t,r,i,s){const o=typeof e=="number"?new D(e,t,r,i):D.create(e),a=typeof e=="number"?s:t,l=a&&a.strict;return this.getEdges().filter(c=>{const u=c.getBBox();return u.width===0?u.inflate(1,0):u.height===0&&u.inflate(0,1),l?o.containsRect(u):o.isIntersectWithRect(u)})}getNodesUnderNode(e,t={}){const r=e.getBBox();return(t.by==null||t.by==="bbox"?this.getNodesInArea(r):this.getNodesFromPoint(r[t.by])).filter(s=>e.id!==s.id&&!s.isDescendantOf(e))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(e,t={}){return le.getCellsBBox(e,t)}search(e,t,r={}){r.breadthFirst?this.breadthFirstSearch(e,t,r):this.depthFirstSearch(e,t,r)}breadthFirstSearch(e,t,r={}){const i=[],s={},o={};for(i.push(e),o[e.id]=0;i.length>0;){const a=i.shift();if(a==null||s[a.id]||(s[a.id]=!0,K(t,this,a,o[a.id])===!1))continue;this.getNeighbors(a,r).forEach(c=>{o[c.id]=o[a.id]+1,i.push(c)})}}depthFirstSearch(e,t,r={}){const i=[],s={},o={};for(i.push(e),o[e.id]=0;i.length>0;){const a=i.pop();if(a==null||s[a.id]||(s[a.id]=!0,K(t,this,a,o[a.id])===!1))continue;const l=this.getNeighbors(a,r),c=i.length;l.forEach(u=>{o[u.id]=o[a.id]+1,i.splice(c,0,u)})}}getShortestPath(e,t,r={}){const i={};this.getEdges().forEach(c=>{const u=c.getSourceCellId(),h=c.getTargetCellId();u&&h&&(i[u]||(i[u]=[]),i[h]||(i[h]=[]),i[u].push(h),r.directed||i[h].push(u))});const s=typeof e=="string"?e:e.id,o=nf.run(i,s,r.weight),a=[];let l=typeof t=="string"?t:t.id;for(o[l]&&a.push(l);l=o[l];)a.unshift(l);return a}translate(e,t,r){return this.getCells().filter(i=>!i.hasParent()).forEach(i=>i.translate(e,t,r)),this}resize(e,t,r){return this.resizeCells(e,t,this.getCells(),r)}resizeCells(e,t,r,i={}){const s=this.getCellsBBox(r);if(s){const o=Math.max(e/s.width,0),a=Math.max(t/s.height,0),l=s.getOrigin();r.forEach(c=>c.scale(o,a,l,i))}return this}toJSON(e={}){return zn.toJSON(this.getCells(),e)}parseJSON(e){return zn.fromJSON(e)}fromJSON(e,t={}){const r=this.parseJSON(e);return this.resetCells(r,t),this}startBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)+1,this.notify("batch:start",{name:e,data:t}),this}stopBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)-1,this.notify("batch:stop",{name:e,data:t}),this}batchUpdate(e,t,r={}){this.startBatch(e,r);const i=t();return this.stopBatch(e,r),i}hasActiveBatch(e=Object.keys(this.batches)){return(Array.isArray(e)?e:[e]).some(r=>this.batches[r]>0)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.addNode=="function"&&typeof i.addEdge=="function"&&i.collection!=null}n.isModel=e})(zn||(zn={})),function(n){function e(r,i={}){return{cells:r.map(s=>s.toJSON(i))}}n.toJSON=e;function t(r){const i=[];return Array.isArray(r)?i.push(...r):(r.cells&&i.push(...r.cells),r.nodes&&r.nodes.forEach(s=>{s.shape==null&&(s.shape="rect"),i.push(s)}),r.edges&&r.edges.forEach(s=>{s.shape==null&&(s.shape="edge"),i.push(s)})),i.map(s=>{const o=s.shape;if(o){if(We.registry.exist(o))return We.create(s);if(Ve.registry.exist(o))return Ve.create(s)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}n.fromJSON=t}(zn||(zn={}));var wG=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};let jr=class extends We{get label(){return this.getLabel()}set label(e){this.setLabel(e)}getLabel(){return this.getAttrByPath("text/text")}setLabel(e,t){return e==null?this.removeLabel():this.setAttrByPath("text/text",e,t),this}removeLabel(){return this.removeAttrByPath("text/text"),this}};(function(n){n.bodyAttr={fill:"#ffffff",stroke:"#333333",strokeWidth:2},n.labelAttr={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"},n.config({attrs:{text:Object.assign({},n.labelAttr)},propHooks(e){const{label:t}=e,r=wG(e,["label"]);return t&&hs(r,"attrs/text/text",t),r},visible:!0})})(jr||(jr={}));var xG=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};function CG(n,e="body"){return[{tagName:n,selector:e},{tagName:"text",selector:"label"}]}function SG(n="xlink:href"){return t=>{const{imageUrl:r,imageWidth:i,imageHeight:s}=t,o=xG(t,["imageUrl","imageWidth","imageHeight"]);if(r!=null||i!=null||s!=null){const a=()=>{if(o.attrs){const l=o.attrs.image;r!=null&&(l[n]=r),i!=null&&(l.width=i),s!=null&&(l.height=s),o.attrs.image=l}};o.attrs?(o.attrs.image==null&&(o.attrs.image={}),a()):(o.attrs={image:{}},a())}return o}}function Ns(n,e,t={}){const r={constructorName:n,markup:CG(n,t.selector),attrs:{[n]:Object.assign({},jr.bodyAttr)}};return(t.parent||jr).define(Ie(r,e,{shape:n}))}Ns("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});const PG=Ve.define({shape:"edge",markup:[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}],attrs:{lines:{connection:!0,strokeLinejoin:"round"},wrap:{strokeWidth:10},line:{stroke:"#333",strokeWidth:2,targetMarker:"classic"}}});Ns("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var EG=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class ks extends jr{get points(){return this.getPoints()}set points(e){this.setPoints(e)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(e,t){return e==null?this.removePoints():this.setAttrByPath("body/refPoints",ks.pointsToString(e),t),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}(function(n){function e(t){return typeof t=="string"?t:t.map(r=>Array.isArray(r)?r.join(","):P.isPointLike(r)?`${r.x}, ${r.y}`:"").join(" ")}n.pointsToString=e,n.config({propHooks(t){const{points:r}=t,i=EG(t,["points"]);if(r){const s=e(r);s&&hs(i,"attrs/body/refPoints",s)}return i}})})(ks||(ks={})),Ns("polygon",{},{parent:ks}),Ns("polyline",{},{parent:ks});var AG=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};jr.define({shape:"path",markup:[{tagName:"rect",selector:"bg"},{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}],attrs:{bg:{refWidth:"100%",refHeight:"100%",fill:"none",stroke:"none",pointerEvents:"all"},body:{fill:"none",stroke:"#000",strokeWidth:2}},propHooks(n){const{path:e}=n,t=AG(n,["path"]);return e&&hs(t,"attrs/body/refD",e),t}});var TG=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};jr.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},tn.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:lt.xhtml,selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]}:{tagName:"text",selector:"label",attrs:{textAnchor:"middle"}}],attrs:{body:Object.assign(Object.assign({},jr.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(n){const{text:e}=n,t=TG(n,["text"]);return e&&hs(t,"attrs/label/text",e),t},attrHooks:{text:{set(n,{cell:e,view:t,refBBox:r,elem:i,attrs:s}){if(i instanceof HTMLElement)i.textContent=n;else{const o=s.style||{},a={text:n,width:-5,height:"100%"},l=Object.assign({textVerticalAnchor:"middle"},o),c=Bn.presets.textWrap;return K(c.set,this,a,{cell:e,view:t,elem:i,refBBox:r,attrs:l}),{fill:o.color||null}}},position(n,{refBBox:e,elem:t}){if(t instanceof SVGElement)return e.getCenter()}}}}),Ns("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:SG()},{selector:"image"}),Ns("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});class kt extends rt{constructor(){super(...arguments),this.portsCache={}}get[Symbol.toStringTag](){return kt.toStringTag}getContainerClassName(){const e=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||e.push(this.prefixClassName("node-immovable")),e.join(" ")}updateClassName(e){const t=e.target;if(t.hasAttribute("magnet")){const r=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?gt(t,r):J(t,r)}else{const r=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(r):this.addClass(r)}}isNodeView(){return!0}confirmUpdate(e,t={}){let r=e;return this.hasAction(r,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(r,"render")?(this.render(),r=this.removeAction(r,["render","update","resize","translate","rotate","ports","tools"])):(r=this.handleAction(r,"resize",()=>this.resize(),"update"),r=this.handleAction(r,"update",()=>this.update(),"ports"),r=this.handleAction(r,"translate",()=>this.translate()),r=this.handleAction(r,"rotate",()=>this.rotate()),r=this.handleAction(r,"ports",()=>this.renderPorts()),r=this.handleAction(r,"tools",()=>{this.getFlag("tools")===e?this.renderTools():this.updateTools(t)})),r}update(e){this.cleanCache(),this.removePorts();const t=this.cell,r=t.getSize(),i=t.getAttrs();this.updateAttrs(this.container,i,{attrs:e===i?null:e,rootBBox:new D(0,0,r.width,r.height),selectors:this.selectors}),this.renderPorts()}renderMarkup(){const e=this.cell.markup;if(e){if(typeof e=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw new TypeError("Invalid node markup.")}renderJSONMarkup(e){const t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.appendChild(t.fragment)}render(){return this.empty(),this.renderMarkup(),this.resize(),this.updateTransform(),this.renderTools(),this}resize(){this.cell.getAngle()&&this.rotate(),this.update()}translate(){this.updateTransform()}rotate(){this.updateTransform()}getTranslationString(){const e=this.cell.getPosition();return`translate(${e.x},${e.y})`}getRotationString(){const e=this.cell.getAngle();if(e){const t=this.cell.getSize();return`rotate(${e},${t.width/2},${t.height/2})`}}updateTransform(){let e=this.getTranslationString();const t=this.getRotationString();t&&(e+=` ${t}`),this.container.setAttribute("transform",e)}findPortElem(e,t){const r=e?this.portsCache[e]:null;if(!r)return null;const i=r.portContentElement,s=r.portContentSelectors||{};return this.findOne(t,i,s)}cleanPortsCache(){this.portsCache={}}removePorts(){Object.values(this.portsCache).forEach(e=>{er(e.portElement)})}renderPorts(){const e=this.container,t=[];e.childNodes.forEach(o=>{t.push(o)});const r=this.cell.getParsedPorts(),i=kb(r,"zIndex"),s="auto";i[s]&&i[s].forEach(o=>{const a=this.getPortElement(o);e.append(a),t.push(a)}),Object.keys(i).forEach(o=>{if(o!==s){const a=parseInt(o,10);this.appendPorts(i[o],a,t)}}),this.updatePorts()}appendPorts(e,t,r){const i=e.map(s=>this.getPortElement(s));r[t]||t<0?No(r[Math.max(t,0)],i):jn(this.container,i)}getPortElement(e){const t=this.portsCache[e.id];return t?t.portElement:this.createPortElement(e)}createPortElement(e){let t=Pe.renderMarkup(this.cell.getPortContainerMarkup());const r=t.elem;if(r==null)throw new Error("Invalid port container markup.");t=Pe.renderMarkup(this.getPortMarkup(e));const i=t.elem,s=t.selectors;if(i==null)throw new Error("Invalid port markup.");this.setAttrs({port:e.id,"port-group":e.group},i);let o="x6-port";e.group&&(o+=` x6-port-${e.group}`),J(r,o),J(r,"x6-port"),J(i,"x6-port-body"),r.appendChild(i);let a=s,l,c;if(this.existPortLabel(e)){if(t=Pe.renderMarkup(this.getPortLabelMarkup(e.label)),l=t.elem,c=t.selectors,l==null)throw new Error("Invalid port label markup.");if(s&&c){for(const h in c)if(s[h]&&h!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},s),c)}J(l,"x6-port-label"),r.appendChild(l)}return this.portsCache[e.id]={portElement:r,portSelectors:a,portLabelElement:l,portLabelSelectors:c,portContentElement:i,portContentSelectors:s},this.graph.options.onPortRendered&&this.graph.options.onPortRendered({port:e,node:this.cell,container:r,selectors:a,labelContainer:l,labelSelectors:c,contentContainer:i,contentSelectors:s}),r}updatePorts(){const e=this.cell.getParsedGroups(),t=Object.keys(e);t.length===0?this.updatePortGroup():t.forEach(r=>this.updatePortGroup(r))}updatePortGroup(e){const t=D.fromSize(this.cell.getSize()),r=this.cell.getPortsLayoutByGroup(e,t);for(let i=0,s=r.length;i<s;i+=1){const o=r[i],a=o.portId,l=this.portsCache[a]||{},c=o.portLayout;if(this.applyPortTransform(l.portElement,c),o.portAttrs!=null){const h={selectors:l.portSelectors||{}};o.portSize&&(h.rootBBox=D.fromSize(o.portSize)),this.updateAttrs(l.portElement,o.portAttrs,h)}const u=o.labelLayout;if(u&&l.portLabelElement&&(this.applyPortTransform(l.portLabelElement,u,-(c.angle||0)),u.attrs)){const h={selectors:l.portLabelSelectors||{}};o.labelSize&&(h.rootBBox=D.fromSize(o.labelSize)),this.updateAttrs(l.portLabelElement,u.attrs,h)}}}applyPortTransform(e,t,r=0){const i=t.angle,s=t.position,o=ct().rotate(r).translate(s.x||0,s.y||0).rotate(i||0);ys(e,o,{absolute:!0})}getPortMarkup(e){return e.markup||this.cell.portMarkup}getPortLabelMarkup(e){return e.markup||this.cell.portLabelMarkup}existPortLabel(e){return e.attrs&&e.attrs.text}getEventArgs(e,t,r){const i=this,s=i.cell,o=s;return t==null||r==null?{e,view:i,node:s,cell:o}:{e,x:t,y:r,view:i,node:s,cell:o}}getPortEventArgs(e,t,r){const i=this,s=i.cell,o=s;return r?{e,x:r.x,y:r.y,view:i,node:s,cell:o,port:t}:{e,view:i,node:s,cell:o,port:t}}notifyMouseDown(e,t,r){super.onMouseDown(e,t,r),this.notify("node:mousedown",this.getEventArgs(e,t,r))}notifyMouseMove(e,t,r){super.onMouseMove(e,t,r),this.notify("node:mousemove",this.getEventArgs(e,t,r))}notifyMouseUp(e,t,r){super.onMouseUp(e,t,r),this.notify("node:mouseup",this.getEventArgs(e,t,r))}notifyPortEvent(e,t,r){const i=this.findAttr("port",t.target);if(i){const s=t.type;e==="node:port:mouseenter"?t.type="mouseenter":e==="node:port:mouseleave"&&(t.type="mouseleave"),this.notify(e,this.getPortEventArgs(t,i,r)),t.type=s}}onClick(e,t,r){super.onClick(e,t,r),this.notify("node:click",this.getEventArgs(e,t,r)),this.notifyPortEvent("node:port:click",e,{x:t,y:r})}onDblClick(e,t,r){super.onDblClick(e,t,r),this.notify("node:dblclick",this.getEventArgs(e,t,r)),this.notifyPortEvent("node:port:dblclick",e,{x:t,y:r})}onContextMenu(e,t,r){super.onContextMenu(e,t,r),this.notify("node:contextmenu",this.getEventArgs(e,t,r)),this.notifyPortEvent("node:port:contextmenu",e,{x:t,y:r})}onMouseDown(e,t,r){this.isPropagationStopped(e)||(this.notifyMouseDown(e,t,r),this.notifyPortEvent("node:port:mousedown",e,{x:t,y:r}),this.startNodeDragging(e,t,r))}onMouseMove(e,t,r){const i=this.getEventData(e),s=i.action;if(s==="magnet")this.dragMagnet(e,t,r);else{if(s==="move"){const a=i.targetView||this;a.dragNode(e,t,r),a.notify("node:moving",{e,x:t,y:r,view:a,cell:a.cell,node:a.cell})}this.notifyMouseMove(e,t,r),this.notifyPortEvent("node:port:mousemove",e,{x:t,y:r})}this.setEventData(e,i)}onMouseUp(e,t,r){const i=this.getEventData(e),s=i.action;s==="magnet"?this.stopMagnetDragging(e,t,r):(this.notifyMouseUp(e,t,r),this.notifyPortEvent("node:port:mouseup",e,{x:t,y:r}),s==="move"&&(i.targetView||this).stopNodeDragging(e,t,r));const o=i.targetMagnet;o&&this.onMagnetClick(e,o,t,r),this.checkMouseleave(e)}onMouseOver(e){super.onMouseOver(e),this.notify("node:mouseover",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseenter",e),this.notifyPortEvent("node:port:mouseover",e)}onMouseOut(e){super.onMouseOut(e),this.notify("node:mouseout",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseleave",e),this.notifyPortEvent("node:port:mouseout",e)}onMouseEnter(e){this.updateClassName(e),super.onMouseEnter(e),this.notify("node:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("node:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,r,i){super.onMouseWheel(e,t,r,i),this.notify("node:mousewheel",Object.assign({delta:i},this.getEventArgs(e,t,r)))}onMagnetClick(e,t,r,i){const s=this.graph;s.view.getMouseMovedCount(e)>s.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:t},this.getEventArgs(e,r,i)))}onMagnetDblClick(e,t,r,i){this.notify("node:magnet:dblclick",Object.assign({magnet:t},this.getEventArgs(e,r,i)))}onMagnetContextMenu(e,t,r,i){this.notify("node:magnet:contextmenu",Object.assign({magnet:t},this.getEventArgs(e,r,i)))}onMagnetMouseDown(e,t,r,i){this.startMagnetDragging(e,r,i)}onCustomEvent(e,t,r,i){this.notify("node:customevent",Object.assign({name:t},this.getEventArgs(e,r,i))),super.onCustomEvent(e,t,r,i)}prepareEmbedding(e){const t=this.graph,i=this.getEventData(e).cell||this.cell,s=t.findViewByCell(i),o=t.snapToGrid(e.clientX,e.clientY);this.notify("node:embed",{e,node:i,view:s,cell:i,x:o.x,y:o.y,currentParent:i.getParent()})}processEmbedding(e,t){const r=t.cell||this.cell,i=t.graph||this.graph,s=i.options.embedding,o=s.findParent;let a=typeof o=="function"?K(o,i,{view:this,node:this.cell}).filter(f=>le.isCell(f)&&this.cell.id!==f.id&&!f.isDescendantOf(this.cell)):i.model.getNodesUnderNode(r,{by:o});if(s.frontOnly&&a.length>0){const f=kb(a,"zIndex"),d=OV(Object.keys(f).map(g=>parseInt(g,10)));d&&(a=f[d])}a=a.filter(f=>f.visible);let l=null;const c=t.candidateEmbedView,u=s.validate;for(let f=a.length-1;f>=0;f-=1){const d=a[f];if(c&&c.cell.id===d.id){l=c;break}else{const g=d.findView(i);if(K(u,i,{child:this.cell,parent:g.cell,childView:this,parentView:g})){l=g;break}}}this.clearEmbedding(t),l&&l.highlight(null,{type:"embedding"}),t.candidateEmbedView=l;const h=i.snapToGrid(e.clientX,e.clientY);this.notify("node:embedding",{e,cell:r,node:r,view:i.findViewByCell(r),x:h.x,y:h.y,currentParent:r.getParent(),candidateParent:l?l.cell:null})}clearEmbedding(e){const t=e.candidateEmbedView;t&&(t.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null)}finalizeEmbedding(e,t){this.graph.startBatch("embedding");const r=t.cell||this.cell,i=t.graph||this.graph,s=i.findViewByCell(r),o=r.getParent(),a=t.candidateEmbedView;if(a?(a.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null,(o==null||o.id!==a.cell.id)&&a.cell.insertChild(r,void 0,{ui:!0})):o&&o.unembed(r,{ui:!0}),i.model.getConnectedEdges(r,{deep:!0}).forEach(l=>{l.updateParent({ui:!0})}),s&&a){const l=i.snapToGrid(e.clientX,e.clientY);s.notify("node:embedded",{e,cell:r,x:l.x,y:l.y,node:r,view:i.findViewByCell(r),previousParent:o,currentParent:r.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let e=this.cell,t=this;for(;t&&!e.isEdge();){if(!e.hasParent()||t.can("stopDelegateOnDragging"))return t;e=e.getParent(),t=this.graph.findViewByCell(e)}return null}validateMagnet(e,t,r){if(t.getAttribute("magnet")!=="passive"){const i=this.graph.options.connecting.validateMagnet;return i?K(i,this.graph,{e:r,magnet:t,view:e,cell:e.cell}):!0}return!1}startMagnetDragging(e,t,r){if(!this.can("magnetConnectable"))return;e.stopPropagation();const i=e.currentTarget,s=this.graph;this.setEventData(e,{targetMagnet:i}),this.validateMagnet(this,i,e)?(s.options.magnetThreshold<=0&&this.startConnectting(e,i,t,r),this.setEventData(e,{action:"magnet"}),this.stopPropagation(e)):this.onMouseDown(e,t,r),s.view.delegateDragEvents(e,this)}startConnectting(e,t,r,i){this.graph.model.startBatch("add-edge");const s=this.createEdgeFromMagnet(t,r,i);s.setEventData(e,s.prepareArrowheadDragging("target",{x:r,y:i,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(e,{edgeView:s}),s.notifyMouseDown(e,r,i)}getDefaultEdge(e,t){let r;const i=this.graph.options.connecting.createEdge;return i&&(r=K(i,this.graph,{sourceMagnet:t,sourceView:e,sourceCell:e.cell})),r}createEdgeFromMagnet(e,t,r){const i=this.graph,s=i.model,o=this.getDefaultEdge(this,e);return o.setSource(Object.assign(Object.assign({},o.getSource()),this.getEdgeTerminal(e,t,r,o,"source"))),o.setTarget(Object.assign(Object.assign({},o.getTarget()),{x:t,y:r})),o.addTo(s,{async:!1,ui:!0}),o.findView(i)}dragMagnet(e,t,r){const i=this.getEventData(e),s=i.edgeView;if(s)s.onMouseMove(e,t,r),this.autoScrollGraph(e.clientX,e.clientY);else{const o=this.graph,a=o.options.magnetThreshold,l=this.getEventTarget(e),c=i.targetMagnet;if(a==="onleave"){if(c===l||c.contains(l))return}else if(o.view.getMouseMovedCount(e)<=a)return;this.startConnectting(e,c,t,r)}}stopMagnetDragging(e,t,r){const s=this.eventData(e).edgeView;s&&(s.onMouseUp(e,t,r),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(e,t,r){this.notify("node:unhandled:mousedown",{e,x:t,y:r,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(e,t,r,i,s){let o=[s];const a=this.graph.getPlugin("selection");if(a&&a.isSelectionMovable()){const l=a.getSelectedCells();l.includes(s)&&(o=l.filter(c=>c.isNode()))}o.forEach(l=>{this.notify(e,{e:t,x:r,y:i,cell:l,node:l,view:l.findView(this.graph)})})}getRestrictArea(e){const t=this.graph.options.translating.restrict,r=typeof t=="function"?K(t,this.graph,e):t;return typeof r=="number"?this.graph.transform.getGraphArea().inflate(r):r===!0?this.graph.transform.getGraphArea():r||null}startNodeDragging(e,t,r){const i=this.getDelegatedView();if(i==null||!i.can("nodeMovable"))return this.notifyUnhandledMouseDown(e,t,r);this.setEventData(e,{targetView:i,action:"move"});const s=P.create(i.cell.getPosition());i.setEventData(e,{moving:!1,offset:s.diff(t,r),restrict:this.getRestrictArea(i)})}dragNode(e,t,r){const i=this.cell,s=this.graph,o=s.getGridSize(),a=this.getEventData(e),l=a.offset,c=a.restrict;a.moving||(a.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",e,t,r,this.cell)),this.autoScrollGraph(e.clientX,e.clientY);const u=be.snapToGrid(t+l.x,o),h=be.snapToGrid(r+l.y,o);i.setPosition(u,h,{restrict:c,deep:!0,ui:!0}),s.options.embedding.enabled&&(a.embedding||(this.prepareEmbedding(e),a.embedding=!0),this.processEmbedding(e,a))}stopNodeDragging(e,t,r){const i=this.getEventData(e);i.embedding&&this.finalizeEmbedding(e,i),i.moving&&(this.removeClass("node-moving"),this.notifyNodeMove("node:moved",e,t,r,this.cell)),i.moving=!1,i.embedding=!1}autoScrollGraph(e,t){const r=this.graph.getPlugin("scroller");r&&r.autoScroll(e,t)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNodeView=="function"&&typeof i.isEdgeView=="function"&&typeof i.confirmUpdate=="function"&&typeof i.update=="function"&&typeof i.findPortElem=="function"&&typeof i.resize=="function"&&typeof i.rotate=="function"&&typeof i.translate=="function"}n.isNodeView=e})(kt||(kt={})),kt.config({isSvgElement:!0,priority:0,bootstrap:["render"],actions:{view:["render"],markup:["render"],attrs:["update"],size:["resize","ports","tools"],angle:["rotate","tools"],position:["translate","tools"],ports:["ports"],tools:["tools"]}}),kt.registry.register("node",kt,!0);class sr extends rt{constructor(){super(...arguments),this.POINT_ROUNDING=2}get[Symbol.toStringTag](){return sr.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const e=this.sourceView;if(!e){const r=this.cell.getSource();return new D(r.x,r.y)}const t=this.sourceMagnet;return e.isEdgeElement(t)?new D(this.sourceAnchor.x,this.sourceAnchor.y):e.getBBoxOfElement(t||e.container)}get targetBBox(){const e=this.targetView;if(!e){const r=this.cell.getTarget();return new D(r.x,r.y)}const t=this.targetMagnet;return e.isEdgeElement(t)?new D(this.targetAnchor.x,this.targetAnchor.y):e.getBBoxOfElement(t||e.container)}isEdgeView(){return!0}confirmUpdate(e,t={}){let r=e;if(this.hasAction(r,"source")){if(!this.updateTerminalProperties("source"))return r;r=this.removeAction(r,"source")}if(this.hasAction(r,"target")){if(!this.updateTerminalProperties("target"))return r;r=this.removeAction(r,"target")}return this.hasAction(r,"render")?(this.render(),r=this.removeAction(r,["render","update","labels","tools"]),r):(r=this.handleAction(r,"update",()=>this.update(t)),r=this.handleAction(r,"labels",()=>this.onLabelsChange(t)),r=this.handleAction(r,"tools",()=>this.renderTools()),r)}render(){return this.empty(),this.renderMarkup(),this.labelContainer=null,this.renderLabels(),this.update(),this.renderTools(),this}renderMarkup(){const e=this.cell.markup;if(e){if(typeof e=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw new TypeError("Invalid edge markup.")}renderJSONMarkup(e){const t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.append(t.fragment)}customizeLabels(){if(this.labelContainer){const e=this.cell,t=e.labels;for(let r=0,i=t.length;r<i;r+=1){const s=t[r],o=this.labelCache[r],a=this.labelSelectors[r],l=this.graph.options.onEdgeLabelRendered;l&&l({edge:e,label:s,container:o,selectors:a})}}}renderLabels(){const e=this.cell,t=e.getLabels(),r=t.length;let i=this.labelContainer;if(this.labelCache={},this.labelSelectors={},r<=0)return i&&i.parentNode&&i.parentNode.removeChild(i),this;i?this.empty(i):(i=Zn("g"),this.addClass(this.prefixClassName("edge-labels"),i),this.labelContainer=i);for(let s=0,o=t.length;s<o;s+=1){const a=t[s],l=this.normalizeLabelMarkup(this.parseLabelMarkup(a.markup));let c,u;if(l)c=l.node,u=l.selectors;else{const f=e.getDefaultLabel(),d=this.normalizeLabelMarkup(this.parseLabelMarkup(f.markup));c=d.node,u=d.selectors}c.setAttribute("data-index",`${s}`),i.appendChild(c);const h=this.rootSelector;if(u[h])throw new Error("Ambiguous label root selector.");u[h]=c,this.labelCache[s]=c,this.labelSelectors[s]=u}return i.parentNode==null&&this.container.appendChild(i),this.updateLabels(),this.customizeLabels(),this}onLabelsChange(e={}){this.shouldRerenderLabels(e)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(e={}){const t=this.cell.previous("labels");if(t==null)return!0;if("propertyPathArray"in e&&"propertyValue"in e){const r=e.propertyPathArray||[],i=r.length;if(i>1){const s=r[1];if(t[s]){if(i===2)return typeof e.propertyValue=="object"&&kl(e.propertyValue,"markup");if(r[2]!=="markup")return!1}}}return!0}parseLabelMarkup(e){return e?typeof e=="string"?this.parseLabelStringMarkup(e):this.parseJSONMarkup(e):null}parseLabelStringMarkup(e){const t=ee.createVectors(e),r=document.createDocumentFragment();for(let i=0,s=t.length;i<s;i+=1){const o=t[i].node;r.appendChild(o)}return{fragment:r,selectors:{}}}normalizeLabelMarkup(e){if(e==null)return;const t=e.fragment;if(!(t instanceof DocumentFragment)||!t.hasChildNodes())throw new Error("Invalid label markup.");let r;const i=t.childNodes;return i.length>1||i[0].nodeName.toUpperCase()!=="G"?r=ee.create("g").append(t):r=ee.create(i[0]),r.addClass(this.prefixClassName("edge-label")),{node:r.node,selectors:e.selectors}}updateLabels(){if(this.labelContainer){const e=this.cell,t=e.labels,r=this.can("edgeLabelMovable"),i=e.getDefaultLabel();for(let s=0,o=t.length;s<o;s+=1){const a=this.labelCache[s],l=this.labelSelectors[s];a.setAttribute("cursor",r?"move":"default");const c=t[s],u=Ie({},i.attrs,c.attrs);this.updateAttrs(a,u,{selectors:l,rootBBox:c.size?D.fromSize(c.size):void 0})}}}renderTools(){const e=this.cell.getTools();return this.addTools(e),this}update(e={}){this.cleanCache(),this.updateConnection(e);const t=this.cell.getAttrs();return t!=null&&this.updateAttrs(this.container,t,{selectors:this.selectors}),this.updateLabelPositions(),this.updateTools(e),this}removeRedundantLinearVertices(e={}){const t=this.cell,r=t.getVertices(),i=[this.sourceAnchor,...r,this.targetAnchor],s=i.length,o=new He(i);o.simplify({threshold:.01});const a=o.points.map(c=>c.toJSON()),l=a.length;return s===l?0:(t.setVertices(a.slice(1,l-1),e),s-l)}getTerminalView(e){switch(e){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalAnchor(e){switch(e){case"source":return P.create(this.sourceAnchor);case"target":return P.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalConnectionPoint(e){switch(e){case"source":return P.create(this.sourcePoint);case"target":return P.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalMagnet(e,t={}){switch(e){case"source":{if(t.raw)return this.sourceMagnet;const r=this.sourceView;return r?this.sourceMagnet||r.container:null}case"target":{if(t.raw)return this.targetMagnet;const r=this.targetView;return r?this.targetMagnet||r.container:null}default:throw new Error(`Unknown terminal type '${e}'`)}}updateConnection(e={}){const t=this.cell;if(e.translateBy&&t.isFragmentDescendantOf(e.translateBy)){const r=e.tx||0,i=e.ty||0;this.routePoints=new He(this.routePoints).translate(r,i).points,this.translateConnectionPoints(r,i),this.path.translate(r,i)}else{const r=t.getVertices(),i=this.findAnchors(r);this.sourceAnchor=i.source,this.targetAnchor=i.target,this.routePoints=this.findRoutePoints(r);const s=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=s.source,this.targetPoint=s.target;const o=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,o.source||this.sourcePoint,o.target||this.targetPoint)}this.cleanCache()}findAnchors(e){const t=this.cell,r=t.source,i=t.target,s=e[0],o=e[e.length-1];return i.priority&&!r.priority?this.findAnchorsOrdered("target",o,"source",s):this.findAnchorsOrdered("source",s,"target",o)}findAnchorsOrdered(e,t,r,i){let s,o;const a=this.cell,l=a[e],c=a[r],u=this.getTerminalView(e),h=this.getTerminalView(r),f=this.getTerminalMagnet(e),d=this.getTerminalMagnet(r);if(u){let g;t?g=P.create(t):h?g=d:g=P.create(c),s=this.getAnchor(l.anchor,u,f,g,e)}else s=P.create(l);if(h){const g=P.create(i||s);o=this.getAnchor(c.anchor,h,d,g,r)}else o=P.isPointLike(c)?P.create(c):new P;return{[e]:s,[r]:o}}getAnchor(e,t,r,i,s){const o=t.isEdgeElement(r),a=this.graph.options.connecting;let l=typeof e=="string"?{name:e}:e;if(!l){const h=o?(s==="source"?a.sourceEdgeAnchor:a.targetEdgeAnchor)||a.edgeAnchor:(s==="source"?a.sourceAnchor:a.targetAnchor)||a.anchor;l=typeof h=="string"?{name:h}:h}if(!l)throw new Error("Anchor should be specified.");let c;const u=l.name;if(o){const h=Ts.registry.get(u);if(typeof h!="function")return Ts.registry.onNotFound(u);c=K(h,this,t,r,i,l.args||{},s)}else{const h=As.registry.get(u);if(typeof h!="function")return As.registry.onNotFound(u);c=K(h,this,t,r,i,l.args||{},s)}return c?c.round(this.POINT_ROUNDING):new P}findRoutePoints(e=[]){const t=this.graph.options.connecting.router||Rr.presets.normal,r=this.cell.getRouter()||t;let i;if(typeof r=="function")i=K(r,this,e,{},this);else{const s=typeof r=="string"?r:r.name,o=typeof r=="string"?{}:r.args||{},a=s?Rr.registry.get(s):Rr.presets.normal;if(typeof a!="function")return Rr.registry.onNotFound(s);i=K(a,this,e,o,this)}return i==null?e.map(s=>P.create(s)):i.map(s=>P.create(s))}findConnectionPoints(e,t,r){const i=this.cell,s=this.graph.options.connecting,o=i.getSource(),a=i.getTarget(),l=this.sourceView,c=this.targetView,u=e[0],h=e[e.length-1];let f;if(l&&!l.isEdgeElement(this.sourceMagnet)){const g=this.sourceMagnet||l.container,p=u||r,b=new F(p,t),m=o.connectionPoint||s.sourceConnectionPoint||s.connectionPoint;f=this.getConnectionPoint(m,l,g,b,"source")}else f=t;let d;if(c&&!c.isEdgeElement(this.targetMagnet)){const g=this.targetMagnet||c.container,p=a.connectionPoint||s.targetConnectionPoint||s.connectionPoint,b=h||t,m=new F(b,r);d=this.getConnectionPoint(p,c,g,m,"target")}else d=r;return{source:f,target:d}}getConnectionPoint(e,t,r,i,s){const o=i.end;if(e==null)return o;const a=typeof e=="string"?e:e.name,l=typeof e=="string"?{}:e.args,c=Os.registry.get(a);if(typeof c!="function")return Os.registry.onNotFound(a);const u=K(c,this,i,t,r,l||{},s);return u?u.round(this.POINT_ROUNDING):o}findMarkerPoints(e,t,r){const i=h=>{const f=this.cell.getAttrs(),d=Object.keys(f);for(let g=0,p=d.length;g<p;g+=1){const b=f[d[g]];if(b[`${h}Marker`]||b[`${h}-marker`]){const m=b.strokeWidth||b["stroke-width"];if(m)return parseFloat(m);break}}return null},s=e[0],o=e[e.length-1];let a,l;const c=i("source");c&&(a=t.clone().move(s||r,-c));const u=i("target");return u&&(l=r.clone().move(o||t,-u)),this.sourceMarkerPoint=a||t.clone(),this.targetMarkerPoint=l||r.clone(),{source:a,target:l}}findPath(e,t,r){const i=this.cell.getConnector()||this.graph.options.connecting.connector;let s,o,a;if(typeof i=="string"?s=i:(s=i.name,o=i.args),s){const c=Ai.registry.get(s);if(typeof c!="function")return Ai.registry.onNotFound(s);a=c}else a=Ai.presets.normal;const l=K(a,this,t,r,e,Object.assign(Object.assign({},o),{raw:!0}),this);return typeof l=="string"?X.parse(l):l}translateConnectionPoints(e,t){this.sourcePoint.translate(e,t),this.targetPoint.translate(e,t),this.sourceAnchor.translate(e,t),this.targetAnchor.translate(e,t),this.sourceMarkerPoint.translate(e,t),this.targetMarkerPoint.translate(e,t)}updateLabelPositions(){if(this.labelContainer==null)return this;if(!this.path)return this;const t=this.cell,r=t.getLabels();if(r.length===0)return this;const i=t.getDefaultLabel(),s=this.normalizeLabelPosition(i.position);for(let o=0,a=r.length;o<a;o+=1){const l=r[o],c=this.labelCache[o];if(!c)continue;const u=this.normalizeLabelPosition(l.position),h=Ie({},s,u),f=this.getLabelTransformationMatrix(h);c.setAttribute("transform",ms(f))}return this}updateTerminalProperties(e){const t=this.cell,r=this.graph,i=t[e],s=i&&i.cell,o=`${e}View`;if(!s)return this[o]=null,this.updateTerminalMagnet(e),!0;const a=r.getCellById(s);if(!a)throw new Error(`Edge's ${e} node with id "${s}" not exists`);const l=a.findView(r);return l?(this[o]=l,this.updateTerminalMagnet(e),!0):!1}updateTerminalMagnet(e){const t=`${e}Magnet`,r=this.getTerminalView(e);if(r){let i=r.getMagnetFromEdgeTerminal(this.cell[e]);i===r.container&&(i=null),this[t]=i}else this[t]=null}getLabelPositionAngle(e){const t=this.cell.getLabelAt(e);return t&&t.position&&typeof t.position=="object"&&t.position.angle||0}getLabelPositionArgs(e){const t=this.cell.getLabelAt(e);if(t&&t.position&&typeof t.position=="object")return t.position.options}getDefaultLabelPositionArgs(){const e=this.cell.getDefaultLabel();if(e&&e.position&&typeof e.position=="object")return e.position.options}mergeLabelPositionArgs(e,t){return e===null?null:e===void 0?t===null?null:t:Ie({},t,e)}getConnection(){return this.path!=null?this.path.clone():null}getConnectionPathData(){if(this.path==null)return"";const e=this.cache.pathCache;return kl(e,"data")||(e.data=this.path.serialize()),e.data||""}getConnectionSubdivisions(){if(this.path==null)return null;const e=this.cache.pathCache;return kl(e,"segmentSubdivisions")||(e.segmentSubdivisions=this.path.getSegmentSubdivisions()),e.segmentSubdivisions}getConnectionLength(){if(this.path==null)return 0;const e=this.cache.pathCache;return kl(e,"length")||(e.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),e.length}getPointAtLength(e){return this.path==null?null:this.path.pointAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(e){return this.path==null?null:(Qn(e)&&(e=parseFloat(e)/100),this.path.pointAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(e){return this.path==null?null:this.path.tangentAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(e){return this.path==null?null:this.path.tangentAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(e){return this.path==null?null:this.path.closestPoint(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(e){return this.path==null?null:this.path.closestPointLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(e){return this.path==null?null:this.path.closestPointNormalizedLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(e,t,r,i){const s={distance:0};let o=0,a;typeof r=="number"?(o=r,a=i):a=r,a!=null&&(s.options=a);const l=a&&a.absoluteOffset,c=!(a&&a.absoluteDistance),u=a&&a.absoluteDistance&&a.reverseDistance,h=this.path,f={segmentSubdivisions:this.getConnectionSubdivisions()},d=new P(e,t),g=h.closestPointT(d,f),p=this.getConnectionLength()||0;let b=h.lengthAtT(g,f);c&&(b=p>0?b/p:0),u&&(b=-1*(p-b)||1),s.distance=b;let m;l||(m=h.tangentAtT(g));let y;if(m)y=m.pointOffset(d);else{const v=h.pointAtT(g),w=d.diff(v);y={x:w.x,y:w.y}}return s.offset=y,s.angle=o,s}normalizeLabelPosition(e){return typeof e=="number"?{distance:e}:e}getLabelTransformationMatrix(e){const t=this.normalizeLabelPosition(e),r=t.options||{},i=t.angle||0,s=t.distance,o=s>0&&s<=1;let a=0;const l={x:0,y:0},c=t.offset;c&&(typeof c=="number"?a=c:(c.x!=null&&(l.x=c.x),c.y!=null&&(l.y=c.y)));const u=l.x!==0||l.y!==0||a===0,h=r.keepGradient,f=r.ensureLegibility,d=this.path,g={segmentSubdivisions:this.getConnectionSubdivisions()},p=o?s*this.getConnectionLength():s,b=d.tangentAtLength(p,g);let m,y=i;if(b){if(u)m=b.start,m.translate(l);else{const v=b.clone();v.rotate(-90,b.start),v.setLength(a),m=v.end}h&&(y=b.angle()+i,f&&(y=ye.normalize((y+90)%180-90)))}else m=d.start,u&&m.translate(l);return ct().translate(m.x,m.y).rotate(y)}getVertexIndex(e,t){const i=this.cell.getVertices(),s=this.getClosestPointLength(new P(e,t));let o=0;if(s!=null)for(const a=i.length;o<a;o+=1){const l=i[o],c=this.getClosestPointLength(l);if(c!=null&&s<c)break}return o}getEventArgs(e,t,r){const i=this,s=i.cell,o=s;return t==null||r==null?{e,view:i,edge:s,cell:o}:{e,x:t,y:r,view:i,edge:s,cell:o}}notifyUnhandledMouseDown(e,t,r){this.notify("edge:unhandled:mousedown",{e,x:t,y:r,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(e,t,r){super.onMouseDown(e,t,r),this.notify("edge:mousedown",this.getEventArgs(e,t,r))}notifyMouseMove(e,t,r){super.onMouseMove(e,t,r),this.notify("edge:mousemove",this.getEventArgs(e,t,r))}notifyMouseUp(e,t,r){super.onMouseUp(e,t,r),this.notify("edge:mouseup",this.getEventArgs(e,t,r))}onClick(e,t,r){super.onClick(e,t,r),this.notify("edge:click",this.getEventArgs(e,t,r))}onDblClick(e,t,r){super.onDblClick(e,t,r),this.notify("edge:dblclick",this.getEventArgs(e,t,r))}onContextMenu(e,t,r){super.onContextMenu(e,t,r),this.notify("edge:contextmenu",this.getEventArgs(e,t,r))}onMouseDown(e,t,r){this.notifyMouseDown(e,t,r),this.startEdgeDragging(e,t,r)}onMouseMove(e,t,r){const i=this.getEventData(e);switch(i.action){case"drag-label":{this.dragLabel(e,t,r);break}case"drag-arrowhead":{this.dragArrowhead(e,t,r);break}case"drag-edge":{this.dragEdge(e,t,r);break}}return this.notifyMouseMove(e,t,r),i}onMouseUp(e,t,r){const i=this.getEventData(e);switch(i.action){case"drag-label":{this.stopLabelDragging(e,t,r);break}case"drag-arrowhead":{this.stopArrowheadDragging(e,t,r);break}case"drag-edge":{this.stopEdgeDragging(e,t,r);break}}return this.notifyMouseUp(e,t,r),this.checkMouseleave(e),i}onMouseOver(e){super.onMouseOver(e),this.notify("edge:mouseover",this.getEventArgs(e))}onMouseOut(e){super.onMouseOut(e),this.notify("edge:mouseout",this.getEventArgs(e))}onMouseEnter(e){super.onMouseEnter(e),this.notify("edge:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("edge:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,r,i){super.onMouseWheel(e,t,r,i),this.notify("edge:mousewheel",Object.assign({delta:i},this.getEventArgs(e,t,r)))}onCustomEvent(e,t,r,i){if(f1(e.target,"edge-tool",this.container)){if(e.stopPropagation(),this.can("useEdgeTools")){if(t==="edge:remove"){this.cell.remove({ui:!0});return}this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,r,i)))}this.notifyMouseDown(e,r,i)}else this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,r,i))),super.onCustomEvent(e,t,r,i)}onLabelMouseDown(e,t,r){this.notifyMouseDown(e,t,r),this.startLabelDragging(e,t,r),this.getEventData(e).stopPropagation&&e.stopPropagation()}startEdgeDragging(e,t,r){if(!this.can("edgeMovable")){this.notifyUnhandledMouseDown(e,t,r);return}this.setEventData(e,{x:t,y:r,moving:!1,action:"drag-edge"})}dragEdge(e,t,r){const i=this.getEventData(e);i.moving||(i.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e,x:t,y:r,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(t-i.x,r-i.y,{ui:!0}),this.setEventData(e,{x:t,y:r}),this.notify("edge:moving",{e,x:t,y:r,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(e,t,r){const i=this.getEventData(e);i.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e,x:t,y:r,view:this,cell:this.cell,edge:this.cell})),i.moving=!1}prepareArrowheadDragging(e,t){const r=this.getTerminalMagnet(e),i={action:"drag-arrowhead",x:t.x,y:t.y,isNewEdge:t.isNewEdge===!0,terminalType:e,initialMagnet:r,initialTerminal:Ah(this.cell[e]),fallbackAction:t.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(e),options:t.options};return this.beforeArrowheadDragging(i),i}createValidateConnectionArgs(e){const t=[];t[4]=e,t[5]=this;let r,i=0,s=0;e==="source"?(i=2,r="target"):(s=2,r="source");const o=this.cell[r],a=o.cell;if(a){let l;const c=t[i]=this.graph.findViewByCell(a);c&&(l=c.getMagnetFromEdgeTerminal(o),l===c.container&&(l=void 0)),t[i+1]=l}return(l,c)=>(t[s]=l,t[s+1]=l.container===c?void 0:c,t)}beforeArrowheadDragging(e){e.zIndex=this.cell.zIndex,this.cell.toFront();const t=this.container.style;e.pointerEvents=t.pointerEvents,t.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(e)}afterArrowheadDragging(e){e.zIndex!=null&&(this.cell.setZIndex(e.zIndex,{ui:!0}),e.zIndex=null);const t=this.container;t.style.pointerEvents=e.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(e)}validateConnection(e,t,r,i,s,o,a){const l=this.graph.options.connecting,c=l.allowLoop,u=l.allowNode,h=l.allowEdge,f=l.allowPort,d=l.allowMulti,g=l.validateConnection,p=o?o.cell:null,b=s==="target"?r:e,m=s==="target"?i:t;let y=!0;const v=w=>{const x=s==="source"?a?a.port:null:p?p.getSourcePortId():null,C=s==="target"?a?a.port:null:p?p.getTargetPortId():null;return K(w,this.graph,{edge:p,edgeView:o,sourceView:e,targetView:r,sourcePort:x,targetPort:C,sourceMagnet:t,targetMagnet:i,sourceCell:e?e.cell:null,targetCell:r?r.cell:null,type:s})};if(c!=null&&(typeof c=="boolean"?!c&&e===r&&(y=!1):y=v(c)),y&&f!=null&&(typeof f=="boolean"?!f&&m&&(y=!1):y=v(f)),y&&h!=null&&(typeof h=="boolean"?!h&&sr.isEdgeView(b)&&(y=!1):y=v(h)),y&&u!=null&&m==null&&(typeof u=="boolean"?!u&&kt.isNodeView(b)&&(y=!1):y=v(u)),y&&d!=null&&o){const w=o.cell,x=s==="source"?a:w.getSource(),C=s==="target"?a:w.getTarget(),S=a?this.graph.getCellById(a.cell):null;if(x&&C&&x.cell&&C.cell&&S)if(typeof d=="function")y=v(d);else{const E=this.graph.model.getConnectedEdges(S,{outgoing:s==="source",incoming:s==="target"});E.length&&(d==="withPort"?E.some(O=>{const T=O.getSource(),I=O.getTarget();return T&&I&&T.cell===x.cell&&I.cell===C.cell&&T.port!=null&&T.port===x.port&&I.port!=null&&I.port===C.port})&&(y=!1):d||E.some(O=>{const T=O.getSource(),I=O.getTarget();return T&&I&&T.cell===x.cell&&I.cell===C.cell})&&(y=!1))}}return y&&g!=null&&(y=v(g)),y}allowConnectToBlank(e){const t=this.graph,i=t.options.connecting.allowBlank;if(typeof i!="function")return!!i;const s=t.findViewByCell(e),o=e.getSourceCell(),a=e.getTargetCell(),l=t.findViewByCell(o),c=t.findViewByCell(a);return K(i,t,{edge:e,edgeView:s,sourceCell:o,targetCell:a,sourceView:l,targetView:c,sourcePort:e.getSourcePortId(),targetPort:e.getTargetPortId(),sourceMagnet:s.sourceMagnet,targetMagnet:s.targetMagnet})}validateEdge(e,t,r){const i=this.graph;if(!this.allowConnectToBlank(e)){const o=e.getSourceCellId(),a=e.getTargetCellId();if(!(o&&a))return!1}const s=i.options.connecting.validateEdge;return s?K(s,i,{edge:e,type:t,previous:r}):!0}arrowheadDragging(e,t,r,i){i.x=t,i.y=r,i.currentTarget!==e&&(i.currentMagnet&&i.currentView&&i.currentView.unhighlight(i.currentMagnet,{type:"magnetAdsorbed"}),i.currentView=this.graph.findViewByElem(e),i.currentView?(i.currentMagnet=i.currentView.findMagnet(e),i.currentMagnet&&this.validateConnection(...i.getValidateConnectionArgs(i.currentView,i.currentMagnet),i.currentView.getEdgeTerminal(i.currentMagnet,t,r,this.cell,i.terminalType))?i.currentView.highlight(i.currentMagnet,{type:"magnetAdsorbed"}):i.currentMagnet=null):i.currentMagnet=null),i.currentTarget=e,this.cell.prop(i.terminalType,{x:t,y:r},Object.assign(Object.assign({},i.options),{ui:!0}))}arrowheadDragged(e,t,r){const i=e.currentView,s=e.currentMagnet;if(!s||!i)return;i.unhighlight(s,{type:"magnetAdsorbed"});const o=e.terminalType,a=i.getEdgeTerminal(s,t,r,this.cell,o);this.cell.setTerminal(o,a,{ui:!0})}snapArrowhead(e,t,r){const i=this.graph,{snap:s,allowEdge:o}=i.options.connecting,a=typeof s=="object"&&s.radius||50,l=i.renderer.findViewsInArea({x:e-a,y:t-a,width:2*a,height:2*a},{nodeOnly:!0});if(o){const v=i.renderer.findEdgeViewsFromPoint({x:e,y:t},a).filter(w=>w!==this);l.push(...v)}const c=r.closestView||null,u=r.closestMagnet||null;r.closestView=null,r.closestMagnet=null;let h,f=Number.MAX_SAFE_INTEGER;const d=new P(e,t);l.forEach(v=>{if(v.container.getAttribute("magnet")!=="false"){if(v.isNodeView())h=v.cell.getBBox().getCenter().distance(d);else if(v.isEdgeView()){const w=v.getClosestPoint(d);w?h=w.distance(d):h=Number.MAX_SAFE_INTEGER}h<a&&h<f&&(u===v.container||this.validateConnection(...r.getValidateConnectionArgs(v,null),v.getEdgeTerminal(v.container,e,t,this.cell,r.terminalType)))&&(f=h,r.closestView=v,r.closestMagnet=v.container)}v.container.querySelectorAll("[magnet]").forEach(w=>{if(w.getAttribute("magnet")!=="false"){const x=v.getBBoxOfElement(w);h=d.distance(x.getCenter()),h<a&&h<f&&(u===w||this.validateConnection(...r.getValidateConnectionArgs(v,w),v.getEdgeTerminal(w,e,t,this.cell,r.terminalType)))&&(f=h,r.closestView=v,r.closestMagnet=w)}})});let g;const p=r.terminalType,b=r.closestView,m=r.closestMagnet,y=u!==m;if(c&&y&&c.unhighlight(u,{type:"magnetAdsorbed"}),b){if(!y)return;b.highlight(m,{type:"magnetAdsorbed"}),g=b.getEdgeTerminal(m,e,t,this.cell,p)}else g={x:e,y:t};this.cell.setTerminal(p,g,{},Object.assign(Object.assign({},r.options),{ui:!0}))}snapArrowheadEnd(e){const t=e.closestView,r=e.closestMagnet;t&&r&&(t.unhighlight(r,{type:"magnetAdsorbed"}),e.currentMagnet=t.findMagnet(r)),e.closestView=null,e.closestMagnet=null}finishEmbedding(e){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(e.zIndex=null)}fallbackConnection(e){switch(e.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(e.terminalType,e.initialTerminal,{ui:!0});break}}notifyConnectionEvent(e,t){const r=e.terminalType,i=e.initialTerminal,s=this.cell[r];if(s&&!Ve.equalTerminals(i,s)){const a=this.graph,l=i,c=l.cell?a.getCellById(l.cell):null,u=l.port,h=c?a.findViewByCell(c):null,f=c||e.isNewEdge?null:P.create(i).toJSON(),d=s,g=d.cell?a.getCellById(d.cell):null,p=d.port,b=g?a.findViewByCell(g):null,m=g?null:P.create(s).toJSON();this.notify("edge:connected",{e:t,previousCell:c,previousPort:u,previousView:h,previousPoint:f,currentCell:g,currentView:b,currentPort:p,currentPoint:m,previousMagnet:e.initialMagnet,currentMagnet:e.currentMagnet,edge:this.cell,view:this,type:r,isNew:e.isNewEdge})}}highlightAvailableMagnets(e){const t=this.graph,r=t.model.getCells();e.marked={};for(let i=0,s=r.length;i<s;i+=1){const o=t.findViewByCell(r[i]);if(!o||o.cell.id===this.cell.id)continue;const a=Array.prototype.slice.call(o.container.querySelectorAll("[magnet]"));o.container.getAttribute("magnet")!=="false"&&a.push(o.container);const l=a.filter(c=>this.validateConnection(...e.getValidateConnectionArgs(o,c),o.getEdgeTerminal(c,e.x,e.y,this.cell,e.terminalType)));if(l.length>0){for(let c=0,u=l.length;c<u;c+=1)o.highlight(l[c],{type:"magnetAvailable"});o.highlight(null,{type:"nodeAvailable"}),e.marked[o.cell.id]=l}}}unhighlightAvailableMagnets(e){const t=e.marked||{};Object.keys(t).forEach(r=>{const i=this.graph.findViewByCell(r);i&&(t[r].forEach(o=>{i.unhighlight(o,{type:"magnetAvailable"})}),i.unhighlight(null,{type:"nodeAvailable"}))}),e.marked=null}startArrowheadDragging(e,t,r){if(!this.can("arrowheadMovable")){this.notifyUnhandledMouseDown(e,t,r);return}const s=e.target.getAttribute("data-terminal"),o=this.prepareArrowheadDragging(s,{x:t,y:r});this.setEventData(e,o)}dragArrowhead(e,t,r){const i=this.getEventData(e);this.graph.options.connecting.snap?this.snapArrowhead(t,r,i):this.arrowheadDragging(this.getEventTarget(e),t,r,i)}stopArrowheadDragging(e,t,r){const i=this.graph,s=this.getEventData(e);i.options.connecting.snap?this.snapArrowheadEnd(s):this.arrowheadDragged(s,t,r),this.validateEdge(this.cell,s.terminalType,s.initialTerminal)?(this.finishEmbedding(s),this.notifyConnectionEvent(s,e)):this.fallbackConnection(s),this.afterArrowheadDragging(s)}startLabelDragging(e,t,r){if(this.can("edgeLabelMovable")){const i=e.currentTarget,s=parseInt(i.getAttribute("data-index"),10),o=this.getLabelPositionAngle(s),a=this.getLabelPositionArgs(s),l=this.getDefaultLabelPositionArgs(),c=this.mergeLabelPositionArgs(a,l);this.setEventData(e,{index:s,positionAngle:o,positionArgs:c,stopPropagation:!0,action:"drag-label"})}else this.setEventData(e,{stopPropagation:!0});this.graph.view.delegateDragEvents(e,this)}dragLabel(e,t,r){const i=this.getEventData(e),s=this.cell.getLabelAt(i.index),o=Ie({},s,{position:this.getLabelPosition(t,r,i.positionAngle,i.positionArgs)});this.cell.setLabelAt(i.index,o)}stopLabelDragging(e,t,r){}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNodeView=="function"&&typeof i.isEdgeView=="function"&&typeof i.confirmUpdate=="function"&&typeof i.update=="function"&&typeof i.getConnection=="function"}n.isEdgeView=e})(sr||(sr={})),sr.config({isSvgElement:!0,priority:1,bootstrap:["render","source","target"],actions:{view:["render"],markup:["render"],attrs:["update"],source:["source","update"],target:["target","update"],router:["update"],connector:["update"],labels:["labels"],defaultLabel:["labels"],tools:["tools"],vertices:["vertices","update"]}}),sr.registry.register("edge",sr,!0);var OG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class xn extends de{get options(){return this.graph.options}constructor(e){super(),this.graph=e;const{selectors:t,fragment:r}=Pe.parseJSONMarkup(xn.markup);this.background=t.background,this.grid=t.grid,this.svg=t.svg,this.defs=t.defs,this.viewport=t.viewport,this.primer=t.primer,this.stage=t.stage,this.decorator=t.decorator,this.overlay=t.overlay,this.container=this.options.container,this.restore=xn.snapshoot(this.container),J(this.container,this.prefixClassName("graph")),jn(this.container,r),this.delegateEvents()}delegateEvents(){const e=this.constructor;return super.delegateEvents(e.events),this}guard(e,t){return e.type==="mousedown"&&e.button===2||this.options.guard&&this.options.guard(e,t)?!0:e.data&&e.data.guarded!==void 0?e.data.guarded:!(t&&t.cell&&le.isCell(t.cell)||this.svg===e.target||this.container===e.target||this.svg.contains(e.target))}findView(e){return this.graph.findViewByElem(e)}onDblClick(e){this.options.preventDefaultDblClick&&e.preventDefault();const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=this.graph.snapToGrid(t.clientX,t.clientY);r?r.onDblClick(t,i.x,i.y):this.graph.trigger("blank:dblclick",{e:t,x:i.x,y:i.y})}onClick(e){if(this.getMouseMovedCount(e)<=this.options.clickThreshold){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=this.graph.snapToGrid(t.clientX,t.clientY);r?r.onClick(t,i.x,i.y):this.graph.trigger("blank:click",{e:t,x:i.x,y:i.y})}}isPreventDefaultContextMenu(e){let t=this.options.preventDefaultContextMenu;return typeof t=="function"&&(t=K(t,this.graph,{view:e})),t}onContextMenu(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.isPreventDefaultContextMenu(r)&&e.preventDefault(),this.guard(t,r))return;const i=this.graph.snapToGrid(t.clientX,t.clientY);r?r.onContextMenu(t,i.x,i.y):this.graph.trigger("blank:contextmenu",{e:t,x:i.x,y:i.y})}delegateDragEvents(e,t){e.data==null&&(e.data={}),this.setEventData(e,{currentView:t||null,mouseMovedCount:0,startPosition:{x:e.clientX,y:e.clientY}});const r=this.constructor;this.delegateDocumentEvents(r.documentEvents,e.data),this.undelegateEvents()}getMouseMovedCount(e){return this.getEventData(e).mouseMovedCount||0}onMouseDown(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;this.options.preventDefaultMouseDown&&e.preventDefault();const i=this.graph.snapToGrid(t.clientX,t.clientY);r?r.onMouseDown(t,i.x,i.y):(this.options.preventDefaultBlankAction&&["touchstart"].includes(t.type)&&e.preventDefault(),this.graph.trigger("blank:mousedown",{e:t,x:i.x,y:i.y})),this.delegateDragEvents(t,r)}onMouseMove(e){const t=this.getEventData(e),r=t.startPosition;if(r&&r.x===e.clientX&&r.y===e.clientY||(t.mouseMovedCount==null&&(t.mouseMovedCount=0),t.mouseMovedCount+=1,t.mouseMovedCount<=this.options.moveThreshold))return;const s=this.normalizeEvent(e),o=this.graph.snapToGrid(s.clientX,s.clientY),a=t.currentView;a?a.onMouseMove(s,o.x,o.y):this.graph.trigger("blank:mousemove",{e:s,x:o.x,y:o.y}),this.setEventData(s,t)}onMouseUp(e){this.undelegateDocumentEvents();const t=this.normalizeEvent(e),r=this.graph.snapToGrid(t.clientX,t.clientY),s=this.getEventData(e).currentView;if(s?s.onMouseUp(t,r.x,r.y):this.graph.trigger("blank:mouseup",{e:t,x:r.x,y:r.y}),!e.isPropagationStopped()){const o=new Dn(e,{type:"click",data:e.data});this.onClick(o)}e.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(!this.guard(t,r))if(r)r.onMouseOver(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseover",{e:t})}}onMouseOut(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(!this.guard(t,r))if(r)r.onMouseOut(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseout",{e:t})}}onMouseEnter(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=this.graph.findViewByElem(t.relatedTarget);if(r){if(i===r)return;r.onMouseEnter(t)}else{if(i)return;this.graph.trigger("graph:mouseenter",{e:t})}}onMouseLeave(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=this.graph.findViewByElem(t.relatedTarget);if(r){if(i===r)return;r.onMouseLeave(t)}else{if(i)return;this.graph.trigger("graph:mouseleave",{e:t})}}onMouseWheel(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=t.originalEvent,s=this.graph.snapToGrid(i.clientX,i.clientY),o=Math.max(-1,Math.min(1,i.wheelDelta||-i.detail));r?r.onMouseWheel(t,s.x,s.y,o):this.graph.trigger("blank:mousewheel",{e:t,delta:o,x:s.x,y:s.y})}onCustomEvent(e){const t=e.currentTarget,r=t.getAttribute("event")||t.getAttribute("data-event");if(r){const i=this.findView(t);if(i){const s=this.normalizeEvent(e);if(this.guard(s,i))return;const o=this.graph.snapToGrid(s.clientX,s.clientY);i.onCustomEvent(s,r,o.x,o.y)}}}handleMagnetEvent(e,t){const r=e.currentTarget,i=r.getAttribute("magnet");if(i&&i.toLowerCase()!=="false"){const s=this.findView(r);if(s){const o=this.normalizeEvent(e);if(this.guard(o,s))return;const a=this.graph.snapToGrid(o.clientX,o.clientY);K(t,this.graph,s,o,r,a.x,a.y)}}}onMagnetMouseDown(e){this.handleMagnetEvent(e,(t,r,i,s,o)=>{t.onMagnetMouseDown(r,i,s,o)})}onMagnetDblClick(e){this.handleMagnetEvent(e,(t,r,i,s,o)=>{t.onMagnetDblClick(r,i,s,o)})}onMagnetContextMenu(e){const t=this.findView(e.target);this.isPreventDefaultContextMenu(t)&&e.preventDefault(),this.handleMagnetEvent(e,(r,i,s,o,a)=>{r.onMagnetContextMenu(i,s,o,a)})}onLabelMouseDown(e){const t=e.currentTarget,r=this.findView(t);if(r){const i=this.normalizeEvent(e);if(this.guard(i,r))return;const s=this.graph.snapToGrid(i.clientX,i.clientY);r.onLabelMouseDown(i,s.x,s.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}OG([de.dispose()],xn.prototype,"dispose",null),function(n){const e=`${sn.prefixCls}-graph`;n.markup=[{ns:lt.xhtml,tagName:"div",selector:"background",className:`${e}-background`},{ns:lt.xhtml,tagName:"div",selector:"grid",className:`${e}-grid`},{ns:lt.svg,tagName:"svg",selector:"svg",className:`${e}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":lt.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${e}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${e}-svg-primer`},{tagName:"g",selector:"stage",className:`${e}-svg-stage`},{tagName:"g",selector:"decorator",className:`${e}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${e}-svg-overlay`}]}]}];function t(r){const i=r.cloneNode();return r.childNodes.forEach(s=>i.appendChild(s)),()=>{for(_o(r);r.attributes.length>0;)r.removeAttribute(r.attributes[0].name);for(let s=0,o=i.attributes.length;s<o;s+=1){const a=i.attributes[s];r.setAttribute(a.name,a.value)}i.childNodes.forEach(s=>r.appendChild(s))}}n.snapshoot=t}(xn||(xn={})),function(n){const e=sn.prefixCls;n.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${e}-cell`]:"onMouseEnter",[`mouseleave .${e}-cell`]:"onMouseLeave",[`mouseenter .${e}-cell-tools`]:"onMouseEnter",[`mouseleave .${e}-cell-tools`]:"onMouseLeave",[`mousedown .${e}-cell [event]`]:"onCustomEvent",[`touchstart .${e}-cell [event]`]:"onCustomEvent",[`mousedown .${e}-cell [data-event]`]:"onCustomEvent",[`touchstart .${e}-cell [data-event]`]:"onCustomEvent",[`dblclick .${e}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${e}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${e}-cell image`]:"onImageDragStart",[`mousedown .${e}-edge .${e}-edge-label`]:"onLabelMouseDown",[`touchstart .${e}-edge .${e}-edge-label`]:"onLabelMouseDown"},n.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}}(xn||(xn={}));const MG=`.x6-graph {
86
+ `;return r.raw?W.parse(l):l},cG=function(n,e,t,r={}){const i=new W;i.appendSegment(W.createSegment("M",n));const s=1/3,o=2/3,a=r.radius||10;let l,c;for(let u=0,h=t.length;u<h;u+=1){const f=P.create(t[u]),d=t[u-1]||n,g=t[u+1]||e;l=c||f.distance(d)/2,c=f.distance(g)/2;const p=-Math.min(a,l),b=-Math.min(a,c),m=f.clone().move(d,p).round(),y=f.clone().move(g,b).round(),v=new P(s*m.x+o*f.x,o*f.y+s*m.y),w=new P(s*y.x+o*f.x,o*f.y+s*y.y);i.appendSegment(W.createSegment("L",m)),i.appendSegment(W.createSegment("C",v,w,y))}return i.appendSegment(W.createSegment("L",e)),r.raw?i:i.serialize()},uG=function(n,e,t,r={}){let i,s=r.direction;if(t&&t.length!==0){const o=[n,...t,e],a=Fe.throughPoints(o);i=new W(a)}else if(i=new W,i.appendSegment(W.createSegment("M",n)),s||(s=Math.abs(n.x-e.x)>=Math.abs(n.y-e.y)?"H":"V"),s==="H"){const o=(n.x+e.x)/2;i.appendSegment(W.createSegment("C",o,n.y,o,e.y,e.x,e.y))}else{const o=(n.y+e.y)/2;i.appendSegment(W.createSegment("C",n.x,o,e.x,o,e.x,e.y))}return r.raw?i:i.serialize()},Lw=1,rc=1/3,ic=2/3;function hG(n){let e=n.graph._jumpOverUpdateList;if(e==null&&(e=n.graph._jumpOverUpdateList=[],n.graph.on("cell:mouseup",()=>{const t=n.graph._jumpOverUpdateList;setTimeout(()=>{for(let r=0;r<t.length;r+=1)t[r].update()})}),n.graph.on("model:reseted",()=>{e=n.graph._jumpOverUpdateList=[]})),e.indexOf(n)<0){e.push(n);const t=()=>e.splice(e.indexOf(n),1);n.cell.once("change:connector",t),n.cell.once("removed",t)}}function pf(n,e,t=[]){const r=[n,...t,e],i=[];return r.forEach((s,o)=>{const a=r[o+1];a!=null&&i.push(new F(s,a))}),i}function fG(n,e){const t=[];return e.forEach(r=>{const i=n.intersectsWithLine(r);i&&t.push(i)}),t}function Rw(n,e){return new F(n,e).squaredLength()}function dG(n,e,t){return e.reduce((r,i,s)=>{if(sc.includes(i))return r;const o=r.pop()||n,a=P.create(i).move(o.start,-t);let l=P.create(i).move(o.start,+t);const c=e[s+1];if(c!=null){const f=l.distance(c);f<=t&&(l=c.move(o.start,f),sc.push(c))}else if(a.distance(o.end)<t*2+Lw)return r.push(o),r;if(l.distance(o.start)<t*2+Lw)return r.push(o),r;const h=new F(a,l);return Jo.push(h),r.push(new F(o.start,a),h,new F(l,o.end)),r},[])}function jw(n,e,t,r){const i=new W;let s;return s=W.createSegment("M",n[0].start),i.appendSegment(s),n.forEach((o,a)=>{if(Jo.includes(o)){let l,c,u,h;if(t==="arc"){l=-90,c=o.start.diff(o.end),(c.x<0||c.x===0&&c.y<0)&&(l+=180);const d=o.getCenter(),g=new F(d,o.end).rotate(l,d);let p;p=new F(o.start,d),u=p.pointAt(2/3).rotate(l,o.start),h=g.pointAt(1/3).rotate(-l,g.end),s=W.createSegment("C",u,h,g.end),i.appendSegment(s),p=new F(d,o.end),u=g.pointAt(1/3).rotate(l,g.end),h=p.pointAt(1/3).rotate(-l,o.end),s=W.createSegment("C",u,h,o.end),i.appendSegment(s)}else if(t==="gap")s=W.createSegment("M",o.end),i.appendSegment(s);else if(t==="cubic"){l=o.start.theta(o.end);const f=e*.6;let d=e*1.35;c=o.start.diff(o.end),(c.x<0||c.x===0&&c.y<0)&&(d*=-1),u=new P(o.start.x+f,o.start.y+d).rotate(l,o.start),h=new P(o.end.x-f,o.end.y+d).rotate(l,o.end),s=W.createSegment("C",u,h,o.end),i.appendSegment(s)}}else{const l=n[a+1];r===0||!l||Jo.includes(l)?(s=W.createSegment("L",o.end),i.appendSegment(s)):gG(r,i,o.end,o.start,l.end)}}),i}function gG(n,e,t,r,i){const s=t.distance(r)/2,o=t.distance(i)/2,a=-Math.min(n,s),l=-Math.min(n,o),c=t.clone().move(r,a).round(),u=t.clone().move(i,l).round(),h=new P(rc*c.x+ic*t.x,ic*t.y+rc*c.y),f=new P(rc*u.x+ic*t.x,ic*t.y+rc*u.y);let d;d=W.createSegment("L",c),e.appendSegment(d),d=W.createSegment("C",h,f,u),e.appendSegment(d)}let Jo,sc;const pG=Object.freeze(Object.defineProperty({__proto__:null,jumpover:function(n,e,t,r={}){Jo=[],sc=[],hG(this);const i=r.size||5,s=r.type||"arc",o=r.radius||0,a=r.ignoreConnectors||["smooth"],l=this.graph,u=l.model.getEdges();if(u.length===1)return jw(pf(n,e,t),i,s,o);const h=this.cell,f=u.indexOf(h),d=l.options.connecting.connector||{},g=u.filter((w,x)=>{const C=w.getConnector()||d;return a.includes(C.name)?!1:x>f?C.name!=="jumpover":!0}),p=g.map(w=>l.findViewByCell(w)),b=pf(n,e,t),m=p.map(w=>w==null?[]:w===this?b:pf(w.sourcePoint,w.targetPoint,w.routePoints)),y=[];b.forEach(w=>{const x=g.reduce((C,S,E)=>{if(S!==h){const A=fG(w,m[E]);C.push(...A)}return C},[]).sort((C,S)=>Rw(w.start,C)-Rw(w.start,S));x.length>0?y.push(...dG(w,x,i)):y.push(w)});const v=jw(y,i,s,o);return Jo=[],sc=[],r.raw?v:v.serialize()},loop:lG,normal:aG,rounded:cG,smooth:uG},Symbol.toStringTag,{value:"Module"}));var Ai;(function(n){n.presets=pG,n.registry=Ue.create({type:"connector"}),n.registry.register(n.presets,!0)})(Ai||(Ai={}));var mG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Dw extends wt{constructor(e={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(ze(e)),this.changed={}}mutate(e,t={}){const r=t.unset===!0,i=t.silent===!0,s=[],o=this.changing;this.changing=!0,o||(this.previous=ze(this.data),this.changed={});const a=this.data,l=this.previous,c=this.changed;if(Object.keys(e).forEach(u=>{const h=u,f=e[h];Jn(a[h],f)||s.push(h),Jn(l[h],f)?delete c[h]:c[h]=f,r?delete a[h]:a[h]=f}),!i&&s.length>0&&(this.pending=!0,this.pendingOptions=t,s.forEach(u=>{this.emit("change:*",{key:u,options:t,store:this,current:a[u],previous:l[u]})})),o)return this;if(!i)for(;this.pending;)this.pending=!1,this.emit("changed",{current:a,previous:l,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(e,t){if(e==null)return this.data;const r=this.data[e];return r==null?t:r}getPrevious(e){if(this.previous){const t=this.previous[e];return t==null?void 0:t}}set(e,t,r){return e!=null&&(typeof e=="object"?this.mutate(e,t):this.mutate({[e]:t},r)),this}remove(e,t){const i={};let s;if(typeof e=="string")i[e]=void 0,s=t;else if(Array.isArray(e))e.forEach(o=>i[o]=void 0),s=t;else{for(const o in this.data)i[o]=void 0;s=e}return this.mutate(i,Object.assign(Object.assign({},s),{unset:!0})),this}getByPath(e){return jh(this.data,e,"/")}setByPath(e,t,r={}){const i="/",s=Array.isArray(e)?[...e]:e.split(i),o=Array.isArray(e)?e.join(i):e,a=s[0],l=s.length;if(r.propertyPath=o,r.propertyValue=t,r.propertyPathArray=s,l===1)this.set(a,t,r);else{const c={};let u=c,h=a;for(let g=1;g<l;g+=1){const p=s[g],b=Number.isFinite(Number(p));u=u[h]=b?[]:{},h=p}hs(c,s,t,i);const f=ze(this.data);r.rewrite&&qb(f,e,i);const d=Ie(f,c);this.set(a,d[a],r)}return this}removeByPath(e,t){const r=Array.isArray(e)?e:e.split("/"),i=r[0];if(r.length===1)this.remove(i,t);else{const s=r.slice(1),o=ze(this.get(i));o&&qb(o,s),this.set(i,o,t)}return this}hasChanged(e){return e==null?Object.keys(this.changed).length>0:e in this.changed}getChanges(e){if(e==null)return this.hasChanged()?ze(this.changed):null;const t=this.changing?this.previous:this.data,r={};let i;for(const s in e){const o=e[s];Jn(t[s],o)||(r[s]=o,i=!0)}return i?ze(r):null}toJSON(){return ze(this.data)}clone(){const e=this.constructor;return new e(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}mG([wt.dispose()],Dw.prototype,"dispose",null);class Qo{constructor(e){this.cell=e,this.ids={},this.cache={}}get(){return Object.keys(this.ids)}start(e,t,r={},i="/"){const s=this.cell.getPropByPath(e),o=tV(r,Qo.defaultOptions),a=this.getTiming(o.timing),l=this.getInterp(o.interp,s,t);let c=0;const u=Array.isArray(e)?e.join(i):e,h=Array.isArray(e)?e:e.split(i),f=()=>{const d=new Date().getTime();c===0&&(c=d);let p=(d-c)/o.duration;p<1?this.ids[u]=requestAnimationFrame(f):p=1;const b=l(a(p));this.cell.setPropByPath(h,b),r.progress&&r.progress(Object.assign({progress:p,currentValue:b},this.getArgs(u))),p===1&&(this.cell.notify("transition:complete",this.getArgs(u)),r.complete&&r.complete(this.getArgs(u)),this.cell.notify("transition:finish",this.getArgs(u)),r.finish&&r.finish(this.getArgs(u)),this.clean(u))};return setTimeout(()=>{this.stop(e,void 0,i),this.cache[u]={startValue:s,targetValue:t,options:o},this.ids[u]=requestAnimationFrame(f),this.cell.notify("transition:start",this.getArgs(u)),r.start&&r.start(this.getArgs(u))},r.delay),this.stop.bind(this,e,i,r)}stop(e,t={},r="/"){const i=Array.isArray(e)?e:e.split(r);return Object.keys(this.ids).filter(s=>Jn(i,s.split(r).slice(0,i.length))).forEach(s=>{cancelAnimationFrame(this.ids[s]);const o=this.cache[s],a=this.getArgs(s),l=Object.assign(Object.assign({},o.options),t),c=l.jumpedToEnd;c&&o.targetValue!=null&&(this.cell.setPropByPath(s,o.targetValue),this.cell.notify("transition:end",Object.assign({},a)),this.cell.notify("transition:complete",Object.assign({},a)),l.complete&&l.complete(Object.assign({},a)));const u=Object.assign({jumpedToEnd:c},a);this.cell.notify("transition:stop",Object.assign({},u)),l.stop&&l.stop(Object.assign({},u)),this.cell.notify("transition:finish",Object.assign({},a)),l.finish&&l.finish(Object.assign({},a)),this.clean(s)}),this}clean(e){delete this.ids[e],delete this.cache[e]}getTiming(e){return typeof e=="string"?Si[e]:e}getInterp(e,t,r){return e?e(t,r):typeof r=="number"?Pi.number(t,r):typeof r=="string"?r[0]==="#"?Pi.color(t,r):Pi.unit(t,r):Pi.object(t,r)}getArgs(e){const t=this.cache[e];return{path:e,startValue:t.startValue,targetValue:t.targetValue,cell:this.cell}}}(function(n){n.defaultOptions={delay:10,duration:100,timing:"linear"}})(Qo||(Qo={}));var yG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Bw=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class le extends wt{static config(e){const{markup:t,propHooks:r,attrHooks:i}=e,s=Bw(e,["markup","propHooks","attrHooks"]);t!=null&&(this.markup=t),r&&(this.propHooks=this.propHooks.slice(),Array.isArray(r)?this.propHooks.push(...r):typeof r=="function"?this.propHooks.push(r):Object.values(r).forEach(o=>{typeof o=="function"&&this.propHooks.push(o)})),i&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),i)),this.defaults=Ie({},this.defaults,s)}static getMarkup(){return this.markup}static getDefaults(e){return e?this.defaults:ze(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(e,t){return this.propHooks.reduce((r,i)=>i?Y(i,e,r):r,t)}get[Symbol.toStringTag](){return le.toStringTag}constructor(e={}){super();const r=this.constructor.getDefaults(!0),i=Ie({},this.preprocess(r),this.preprocess(e));this.id=i.id||zh(),this.store=new Dw(i),this.animation=new Qo(this),this.setup(),this.init(),this.postprocess(e)}init(){}get model(){return this._model}set model(e){this._model!==e&&(this._model=e)}preprocess(e,t){const r=e.id,s=this.constructor.applyPropHooks(this,e);return r==null&&t!==!0&&(s.id=zh()),s}postprocess(e){}setup(){this.store.on("change:*",e=>{const{key:t,current:r,previous:i,options:s}=e;this.notify("change:*",{key:t,options:s,current:r,previous:i,cell:this}),this.notify(`change:${t}`,{options:s,current:r,previous:i,cell:this});const o=t;(o==="source"||o==="target")&&this.notify("change:terminal",{type:o,current:r,previous:i,options:s,cell:this})}),this.store.on("changed",({options:e})=>this.notify("changed",{options:e,cell:this}))}notify(e,t){this.trigger(e,t);const r=this.model;return r&&(r.notify(`cell:${e}`,t),this.isNode()?r.notify(`node:${e}`,Object.assign(Object.assign({},t),{node:this})):this.isEdge()&&r.notify(`edge:${e}`,Object.assign(Object.assign({},t),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(e){return this.store===e.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(e,t){return e==null?this.store.get():this.store.get(e,t)}setProp(e,t,r){if(typeof e=="string")this.store.set(e,t,r);else{const i=this.preprocess(e,!0);this.store.set(Ie({},this.getProp(),i),t),this.postprocess(e)}return this}removeProp(e,t){return typeof e=="string"||Array.isArray(e)?this.store.removeByPath(e,t):this.store.remove(t),this}hasChanged(e){return e==null?this.store.hasChanged():this.store.hasChanged(e)}getPropByPath(e){return this.store.getByPath(e)}setPropByPath(e,t,r={}){return this.model&&(e==="children"?this._children=t?t.map(i=>this.model.getCell(i)).filter(i=>i!=null):null:e==="parent"&&(this._parent=t?this.model.getCell(t):null)),this.store.setByPath(e,t,r),this}removePropByPath(e,t={}){const r=Array.isArray(e)?e:e.split("/");return r[0]==="attrs"&&(t.dirty=!0),this.store.removeByPath(r,t),this}prop(e,t,r){return e==null?this.getProp():typeof e=="string"||Array.isArray(e)?arguments.length===1?this.getPropByPath(e):t==null?this.removePropByPath(e,r||{}):this.setPropByPath(e,t,r||{}):this.setProp(e,t||{})}previous(e){return this.store.getPrevious(e)}get zIndex(){return this.getZIndex()}set zIndex(e){e==null?this.removeZIndex():this.setZIndex(e)}getZIndex(){return this.store.get("zIndex")}setZIndex(e,t={}){return this.store.set("zIndex",e,t),this}removeZIndex(e={}){return this.store.remove("zIndex",e),this}toFront(e={}){const t=this.model;if(t){let r=t.getMaxZIndex(),i;e.deep?(i=this.getDescendants({deep:!0,breadthFirst:!0}),i.unshift(this)):i=[this],r=r-i.length+1;const s=t.total();let o=t.indexOf(this)!==s-i.length;o||(o=i.some((a,l)=>a.getZIndex()!==r+l)),o&&this.batchUpdate("to-front",()=>{r+=i.length,i.forEach((a,l)=>{a.setZIndex(r+l,e)})})}return this}toBack(e={}){const t=this.model;if(t){let r=t.getMinZIndex(),i;e.deep?(i=this.getDescendants({deep:!0,breadthFirst:!0}),i.unshift(this)):i=[this];let s=t.indexOf(this)!==0;s||(s=i.some((o,a)=>o.getZIndex()!==r+a)),s&&this.batchUpdate("to-back",()=>{r-=i.length,i.forEach((o,a)=>{o.setZIndex(r+a,e)})})}return this}get markup(){return this.getMarkup()}set markup(e){e==null?this.removeMarkup():this.setMarkup(e)}getMarkup(){let e=this.store.get("markup");return e==null&&(e=this.constructor.getMarkup()),e}setMarkup(e,t={}){return this.store.set("markup",e,t),this}removeMarkup(e={}){return this.store.remove("markup",e),this}get attrs(){return this.getAttrs()}set attrs(e){e==null?this.removeAttrs():this.setAttrs(e)}getAttrs(){const e=this.store.get("attrs");return e?Object.assign({},e):{}}setAttrs(e,t={}){if(e==null)this.removeAttrs(t);else{const r=i=>this.store.set("attrs",i,t);if(t.overwrite===!0)r(e);else{const i=this.getAttrs();t.deep===!1?r(Object.assign(Object.assign({},i),e)):r(Ie({},i,e))}}return this}replaceAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{deep:!1}))}removeAttrs(e={}){return this.store.remove("attrs",e),this}getAttrDefinition(e){if(!e)return null;const r=this.constructor.getAttrHooks()||{};let i=r[e]||Bn.registry.get(e);if(!i){const s=Al(e);i=r[s]||Bn.registry.get(s)}return i||null}getAttrByPath(e){return e==null||e===""?this.getAttrs():this.getPropByPath(this.prefixAttrPath(e))}setAttrByPath(e,t,r={}){return this.setPropByPath(this.prefixAttrPath(e),t,r),this}removeAttrByPath(e,t={}){return this.removePropByPath(this.prefixAttrPath(e),t),this}prefixAttrPath(e){return Array.isArray(e)?["attrs"].concat(e):`attrs/${e}`}attr(e,t,r){return e==null?this.getAttrByPath():typeof e=="string"||Array.isArray(e)?arguments.length===1?this.getAttrByPath(e):t==null?this.removeAttrByPath(e,r||{}):this.setAttrByPath(e,t,r||{}):this.setAttrs(e,t||{})}get visible(){return this.isVisible()}set visible(e){this.setVisible(e)}setVisible(e,t={}){return this.store.set("visible",e,t),this}isVisible(){return this.store.get("visible")!==!1}show(e={}){return this.isVisible()||this.setVisible(!0,e),this}hide(e={}){return this.isVisible()&&this.setVisible(!1,e),this}toggleVisible(e,t={}){const r=typeof e=="boolean"?e:!this.isVisible(),i=typeof e=="boolean"?t:e;return r?this.show(i):this.hide(i),this}get data(){return this.getData()}set data(e){this.setData(e)}getData(){return this.store.get("data")}setData(e,t={}){if(e==null)this.removeData(t);else{const r=i=>this.store.set("data",i,t);if(t.overwrite===!0)r(e);else{const i=this.getData();t.deep===!1?r(typeof e=="object"?Object.assign(Object.assign({},i),e):e):r(Ie({},i,e))}}return this}replaceData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{deep:!1}))}removeData(e={}){return this.store.remove("data",e),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const e=this.getParentId();if(e&&this.model){const t=this.model.getCell(e);return this._parent=t,t}return null}getChildren(){const e=this.store.get("children");if(e&&e.length&&this.model){const t=e.map(r=>{var i;return(i=this.model)===null||i===void 0?void 0:i.getCell(r)}).filter(r=>r!=null);return this._children=t,[...t]}return null}hasParent(){return this.parent!=null}isParentOf(e){return e!=null&&e.getParent()===this}isChildOf(e){return e!=null&&this.getParent()===e}eachChild(e,t){return this.children&&this.children.forEach(e,t),this}filterChild(e,t){return this.children?this.children.filter(e,t):[]}getChildCount(){return this.children==null?0:this.children.length}getChildIndex(e){return this.children==null?-1:this.children.indexOf(e)}getChildAt(e){return this.children!=null&&e>=0?this.children[e]:null}getAncestors(e={}){const t=[];let r=this.getParent();for(;r;)t.push(r),r=e.deep!==!1?r.getParent():null;return t}getDescendants(e={}){if(e.deep!==!1){if(e.breadthFirst){const t=[],r=this.getChildren()||[];for(;r.length>0;){const i=r.shift(),s=i.getChildren();t.push(i),s&&r.push(...s)}return t}{const t=this.getChildren()||[];return t.forEach(r=>{t.push(...r.getDescendants(e))}),t}}return this.getChildren()||[]}isDescendantOf(e,t={}){if(e==null)return!1;if(t.deep!==!1){let r=this.getParent();for(;r;){if(r===e)return!0;r=r.getParent()}return!1}return this.isChildOf(e)}isAncestorOf(e,t={}){return e==null?!1:e.isDescendantOf(this,t)}contains(e){return this.isAncestorOf(e)}getCommonAncestor(...e){return le.getCommonAncestor(this,...e)}setParent(e,t={}){return this._parent=e,e?this.store.set("parent",e.id,t):this.store.remove("parent",t),this}setChildren(e,t={}){return this._children=e,e!=null?this.store.set("children",e.map(r=>r.id),t):this.store.remove("children",t),this}unembed(e,t={}){const r=this.children;if(r!=null&&e!=null){const i=this.getChildIndex(e);i!==-1&&(r.splice(i,1),e.setParent(null,t),this.setChildren(r,t))}return this}embed(e,t={}){return e.addTo(this,t),this}addTo(e,t={}){return le.isCell(e)?e.addChild(this,t):e.addCell(this,t),this}insertTo(e,t,r={}){return e.insertChild(this,t,r),this}addChild(e,t={}){return this.insertChild(e,void 0,t)}insertChild(e,t,r={}){if(e!=null&&e!==this){const i=e.getParent(),s=this!==i;let o=t;if(o==null&&(o=this.getChildCount(),s||(o-=1)),i){const l=i.getChildren();if(l){const c=l.indexOf(e);c>=0&&(e.setParent(null,r),l.splice(c,1),i.setChildren(l,r))}}let a=this.children;if(a==null?(a=[],a.push(e)):a.splice(o,0,e),e.setParent(this,r),this.setChildren(a,r),s&&this.model){const l=this.model.getIncomingEdges(this),c=this.model.getOutgoingEdges(this);l&&l.forEach(u=>u.updateParent(r)),c&&c.forEach(u=>u.updateParent(r))}this.model&&this.model.addCell(e,r)}return this}removeFromParent(e={}){const t=this.getParent();if(t!=null){const r=t.getChildIndex(this);t.removeChildAt(r,e)}return this}removeChild(e,t={}){const r=this.getChildIndex(e);return this.removeChildAt(r,t)}removeChildAt(e,t={}){const r=this.getChildAt(e);return this.children!=null&&r!=null&&(this.unembed(r,t),r.remove(t)),r}remove(e={}){return this.batchUpdate("remove",()=>{const t=this.getParent();t&&t.removeChild(this,e),e.deep!==!1&&this.eachChild(r=>r.remove(e)),this.model&&this.model.removeCell(this,e)}),this}transition(e,t,r={},i="/"){return this.animation.start(e,t,r,i)}stopTransition(e,t,r="/"){return this.animation.stop(e,t,r),this}getTransitions(){return this.animation.get()}translate(e,t,r){return this}scale(e,t,r,i){return this}addTools(e,t,r){const i=Array.isArray(e)?e:[e],s=typeof t=="string"?t:null,o=typeof t=="object"?t:typeof r=="object"?r:{};if(o.reset)return this.setTools({name:s,items:i,local:o.local},o);let a=ze(this.getTools());if(a==null||s==null||a.name===s)return a==null&&(a={}),a.items||(a.items=[]),a.name=s,a.items=[...a.items,...i],this.setTools(Object.assign({},a),o)}setTools(e,t={}){return e==null?this.removeTools():this.store.set("tools",le.normalizeTools(e),t),this}getTools(){return this.store.get("tools")}removeTools(e={}){return this.store.remove("tools",e),this}hasTools(e){const t=this.getTools();return t==null?!1:e==null?!0:t.name===e}hasTool(e){const t=this.getTools();return t==null?!1:t.items.some(r=>typeof r=="string"?r===e:r.name===e)}removeTool(e,t={}){const r=ze(this.getTools());if(r){let i=!1;const s=r.items.slice(),o=a=>{s.splice(a,1),i=!0};if(typeof e=="number")o(e);else for(let a=s.length-1;a>=0;a-=1){const l=s[a];(typeof l=="string"?l===e:l.name===e)&&o(a)}i&&(r.items=s,this.setTools(r,t))}return this}getBBox(e){return new D}getConnectionPoint(e,t){return new P}toJSON(e={}){const t=Object.assign({},this.store.get()),r=Object.prototype.toString,i=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!t.shape){const g=this.constructor;throw new Error(`Unable to serialize ${i} missing "shape" prop, check the ${i} "${g.name||r.call(g)}"`)}const s=this.constructor,o=e.diff===!0,a=t.attrs||{},l=s.getDefaults(!0),c=o?this.preprocess(l,!0):l,u=c.attrs||{},h={};Object.entries(t).forEach(([g,p])=>{if(p!=null&&!Array.isArray(p)&&typeof p=="object"&&!Ln(p))throw new Error(`Can only serialize ${i} with plain-object props, but got a "${r.call(p)}" type of key "${g}" on ${i} "${this.id}"`);if(g!=="attrs"&&g!=="shape"&&o){const b=c[g];Jn(p,b)&&delete t[g]}}),Object.keys(a).forEach(g=>{const p=a[g],b=u[g];Object.keys(p).forEach(m=>{const y=p[m],v=b?b[m]:null;y!=null&&typeof y=="object"&&!Array.isArray(y)?Object.keys(y).forEach(w=>{const x=y[w];if(b==null||v==null||!Ze(v)||!Jn(v[w],x)){h[g]==null&&(h[g]={}),h[g][m]==null&&(h[g][m]={});const C=h[g][m];C[w]=x}}):(b==null||!Jn(v,y))&&(h[g]==null&&(h[g]={}),h[g][m]=y)})});const f=Object.assign(Object.assign({},t),{attrs:kb(h)?void 0:h});f.attrs==null&&delete f.attrs;const d=f;return d.angle===0&&delete d.angle,ze(d)}clone(e={}){if(!e.deep){const r=Object.assign({},this.store.get());e.keepId||delete r.id,delete r.parent,delete r.children;const i=this.constructor;return new i(r)}return le.deepClone(this)[this.id]}findView(e){return e.findViewByCell(this)}startBatch(e,t={},r=this.model){return this.notify("batch:start",{name:e,data:t,cell:this}),r&&r.startBatch(e,Object.assign(Object.assign({},t),{cell:this})),this}stopBatch(e,t={},r=this.model){return r&&r.stopBatch(e,Object.assign(Object.assign({},t),{cell:this})),this.notify("batch:stop",{name:e,data:t,cell:this}),this}batchUpdate(e,t,r){const i=this.model;this.startBatch(e,r,i);const s=t();return this.stopBatch(e,r,i),s}dispose(){this.removeFromParent(),this.store.dispose()}}le.defaults={},le.attrHooks={},le.propHooks=[],yG([wt.dispose()],le.prototype,"dispose",null),function(n){function e(t){return typeof t=="string"?{items:[t]}:Array.isArray(t)?{items:t}:t.items?t:{items:[t]}}n.normalizeTools=e}(le||(le={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNode=="function"&&typeof i.isEdge=="function"&&typeof i.prop=="function"&&typeof i.attr=="function"}n.isCell=e}(le||(le={})),function(n){function e(...s){const o=s.filter(l=>l!=null).map(l=>l.getAncestors()).sort((l,c)=>l.length-c.length);return o.shift().find(l=>o.every(c=>c.includes(l)))||null}n.getCommonAncestor=e;function t(s,o={}){let a=null;for(let l=0,c=s.length;l<c;l+=1){const u=s[l];let h=u.getBBox(o);if(h){if(u.isNode()){const f=u.getAngle();f!=null&&f!==0&&(h=h.bbox(f))}a=a==null?h:a.union(h)}}return a}n.getCellsBBox=t;function r(s){const o=[s,...s.getDescendants({deep:!0})];return n.cloneCells(o)}n.deepClone=r;function i(s){const o=Db(s),a=o.reduce((l,c)=>(l[c.id]=c.clone(),l),{});return o.forEach(l=>{const c=a[l.id];if(c.isEdge()){const f=c.getSourceCellId(),d=c.getTargetCellId();f&&a[f]&&c.setSource(Object.assign(Object.assign({},c.getSource()),{cell:a[f].id})),d&&a[d]&&c.setTarget(Object.assign(Object.assign({},c.getTarget()),{cell:a[d].id}))}const u=l.getParent();u&&a[u.id]&&c.setParent(a[u.id]);const h=l.getChildren();if(h&&h.length){const f=h.reduce((d,g)=>(a[g.id]&&d.push(a[g.id]),d),[]);f.length>0&&c.setChildren(f)}}),a}n.cloneCells=i}(le||(le={})),function(n){n.config({propHooks(e){var{tools:t}=e,r=Bw(e,["tools"]);return t&&(r.tools=n.normalizeTools(t)),r}})}(le||(le={}));var _s;(function(n){let e,t;function r(o,a){return a?e!=null&&e.exist(o):t!=null&&t.exist(o)}n.exist=r;function i(o){e=o}n.setEdgeRegistry=i;function s(o){t=o}n.setNodeRegistry=s})(_s||(_s={}));class vG{constructor(e){this.ports=[],this.groups={},this.init(ze(e))}getPorts(){return this.ports}getGroup(e){return e!=null?this.groups[e]:null}getPortsByGroup(e){return this.ports.filter(t=>t.group===e||t.group==null&&e==null)}getPortsLayoutByGroup(e,t){const r=this.getPortsByGroup(e),i=e?this.getGroup(e):null,s=i?i.position:null,o=s?s.name:null;let a;if(o!=null){const h=Ei.registry.get(o);if(h==null)return Ei.registry.onNotFound(o);a=h}else a=Ei.presets.left;const l=r.map(h=>h&&h.position&&h.position.args||{}),c=s&&s.args||{};return a(l,t,c).map((h,f)=>{const d=r[f];return{portLayout:h,portId:d.id,portSize:d.size,portAttrs:d.attrs,labelSize:d.label.size,labelLayout:this.getPortLabelLayout(d,P.create(h.position),t)}})}init(e){const{groups:t,items:r}=e;t!=null&&Object.keys(t).forEach(i=>{this.groups[i]=this.parseGroup(t[i])}),Array.isArray(r)&&r.forEach(i=>{this.ports.push(this.parsePort(i))})}parseGroup(e){return Object.assign(Object.assign({},e),{label:this.getLabel(e,!0),position:this.getPortPosition(e.position,!0)})}parsePort(e){const t=Object.assign({},e),r=this.getGroup(e.group)||{};return t.markup=t.markup||r.markup,t.attrs=Ie({},r.attrs,t.attrs),t.position=this.createPosition(r,t),t.label=Ie({},r.label,this.getLabel(t)),t.zIndex=this.getZIndex(r,t),t.size=Object.assign(Object.assign({},r.size),t.size),t}getZIndex(e,t){return typeof t.zIndex=="number"?t.zIndex:typeof e.zIndex=="number"||e.zIndex==="auto"?e.zIndex:"auto"}createPosition(e,t){return Ie({name:"left",args:{}},e.position,{args:t.args})}getPortPosition(e,t=!1){if(e==null){if(t)return{name:"left",args:{}}}else{if(typeof e=="string")return{name:e,args:{}};if(Array.isArray(e))return{name:"absolute",args:{x:e[0],y:e[1]}};if(typeof e=="object")return e}return{args:{}}}getPortLabelPosition(e,t=!1){if(e==null){if(t)return{name:"left",args:{}}}else{if(typeof e=="string")return{name:e,args:{}};if(typeof e=="object")return e}return{args:{}}}getLabel(e,t=!1){const r=e.label||{};return r.position=this.getPortLabelPosition(r.position,t),r}getPortLabelLayout(e,t,r){const i=e.label.position.name||"left",s=e.label.position.args||{},o=Cs.registry.get(i)||Cs.presets.left;return o?o(t,r,s):null}}var oc=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};let We=class RO extends le{get[Symbol.toStringTag](){return RO.toStringTag}constructor(e={}){super(e),this.initPorts()}preprocess(e,t){const{x:r,y:i,width:s,height:o}=e,a=oc(e,["x","y","width","height"]);if(r!=null||i!=null){const l=a.position;a.position=Object.assign(Object.assign({},l),{x:r!=null?r:l?l.x:0,y:i!=null?i:l?l.y:0})}if(s!=null||o!=null){const l=a.size;a.size=Object.assign(Object.assign({},l),{width:s!=null?s:l?l.width:0,height:o!=null?o:l?l.height:0})}return super.preprocess(a,t)}isNode(){return!0}size(e,t,r){return e===void 0?this.getSize():typeof e=="number"?this.setSize(e,t,r):this.setSize(e,t)}getSize(){const e=this.store.get("size");return e?Object.assign({},e):{width:1,height:1}}setSize(e,t,r){return typeof e=="object"?this.resize(e.width,e.height,t):this.resize(e,t,r),this}resize(e,t,r={}){this.startBatch("resize",r);const i=r.direction;if(i){const s=this.getSize();switch(i){case"left":case"right":t=s.height;break;case"top":case"bottom":e=s.width;break}let a={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3}[i];const l=ve.normalize(this.getAngle()||0);r.absolute&&(a+=Math.floor((l+45)/90),a%=4);const c=this.getBBox();let u;a===0?u=c.getBottomLeft():a===1?u=c.getCorner():a===2?u=c.getTopRight():u=c.getOrigin();const h=u.clone().rotate(-l,c.getCenter()),f=Math.sqrt(e*e+t*t)/2;let d=a*Math.PI/2;d+=Math.atan(a%2===0?t/e:e/t),d-=ve.toRad(l);const p=P.fromPolar(f,d,h).clone().translate(e/-2,t/-2);this.store.set("size",{width:e,height:t},r),this.setPosition(p.x,p.y,r)}else this.store.set("size",{width:e,height:t},r);return this.stopBatch("resize",r),this}scale(e,t,r,i={}){const s=this.getBBox().scale(e,t,r==null?void 0:r);return this.startBatch("scale",i),this.setPosition(s.x,s.y,i),this.resize(s.width,s.height,i),this.stopBatch("scale"),this}position(e,t,r){return typeof e=="number"?this.setPosition(e,t,r):this.getPosition(e)}getPosition(e={}){if(e.relative){const r=this.getParent();if(r!=null&&r.isNode()){const i=this.getPosition(),s=r.getPosition();return{x:i.x-s.x,y:i.y-s.y}}}const t=this.store.get("position");return t?Object.assign({},t):{x:0,y:0}}setPosition(e,t,r={}){let i,s,o;if(typeof e=="object"?(i=e.x,s=e.y,o=t||{}):(i=e,s=t,o=r||{}),o.relative){const a=this.getParent();if(a!=null&&a.isNode()){const l=a.getPosition();i+=l.x,s+=l.y}}if(o.deep){const a=this.getPosition();this.translate(i-a.x,s-a.y,o)}else this.store.set("position",{x:i,y:s},o);return this}translate(e=0,t=0,r={}){if(e===0&&t===0)return this;r.translateBy=r.translateBy||this.id;const i=this.getPosition();if(r.restrict!=null&&r.translateBy===this.id){const o=this.getBBox({deep:!0}),a=r.restrict,l=i.x-o.x,c=i.y-o.y,u=Math.max(a.x+l,Math.min(a.x+a.width+l-o.width,i.x+e)),h=Math.max(a.y+c,Math.min(a.y+a.height+c-o.height,i.y+t));e=u-i.x,t=h-i.y}const s={x:i.x+e,y:i.y+t};return r.tx=e,r.ty=t,r.transition?(typeof r.transition!="object"&&(r.transition={}),this.transition("position",s,Object.assign(Object.assign({},r.transition),{interp:Pi.object})),this.eachChild(o=>{var a;((a=r.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(e,t,r)})):(this.startBatch("translate",r),this.store.set("position",s,r),this.eachChild(o=>{var a;((a=r.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(e,t,r)}),this.stopBatch("translate",r)),this}angle(e,t){return e==null?this.getAngle():this.rotate(e,t)}getAngle(){return this.store.get("angle",0)}rotate(e,t={}){const r=this.getAngle();if(t.center){const i=this.getSize(),s=this.getPosition(),o=this.getBBox().getCenter();o.rotate(r-e,t.center);const a=o.x-i.width/2-s.x,l=o.y-i.height/2-s.y;this.startBatch("rotate",{angle:e,options:t}),this.setPosition(s.x+a,s.y+l,t),this.rotate(e,Object.assign(Object.assign({},t),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",t.absolute?e:(r+e)%360,t);return this}getBBox(e={}){if(e.deep){const t=this.getDescendants({deep:!0,breadthFirst:!0});return t.push(this),le.getCellsBBox(t)}return D.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(e,t){const r=this.getBBox(),i=r.getCenter(),s=e.getTerminal(t);if(s==null)return i;const o=s.port;if(!o||!this.hasPort(o))return i;const a=this.getPort(o);if(!a||!a.group)return i;const c=this.getPortsPosition(a.group)[o].position,u=P.create(c).translate(r.getOrigin()),h=this.getAngle();return h&&u.rotate(-h,i),u}fit(e={}){const r=(this.getChildren()||[]).filter(c=>c.isNode());if(r.length===0)return this;this.startBatch("fit-embeds",e),e.deep&&r.forEach(c=>c.fit(e));let{x:i,y:s,width:o,height:a}=le.getCellsBBox(r);const l=Rn(e.padding);return i-=l.left,s-=l.top,o+=l.left+l.right,a+=l.bottom+l.top,this.store.set({position:{x:i,y:s},size:{width:o,height:a}},e),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(e){this.setPortContainerMarkup(e)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||Ee.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(e,t={}){return this.store.set("portContainerMarkup",Ee.clone(e),t),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(e){this.setPortMarkup(e)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||Ee.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(e,t={}){return this.store.set("portMarkup",Ee.clone(e),t),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(e){this.setPortLabelMarkup(e)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||Ee.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(e,t={}){return this.store.set("portLabelMarkup",Ee.clone(e),t),this}get ports(){const e=this.store.get("ports",{items:[]});return e.items==null&&(e.items=[]),e}getPorts(){return ze(this.ports.items)}getPortsByGroup(e){return this.getPorts().filter(t=>t.group===e)}getPort(e){return ze(this.ports.items.find(t=>t.id&&t.id===e))}getPortAt(e){return this.ports.items[e]||null}hasPorts(){return this.ports.items.length>0}hasPort(e){return this.getPortIndex(e)!==-1}getPortIndex(e){const t=typeof e=="string"?e:e.id;return t!=null?this.ports.items.findIndex(r=>r.id===t):-1}getPortsPosition(e){const t=this.getSize();return this.port.getPortsLayoutByGroup(e,new D(0,0,t.width,t.height)).reduce((i,s)=>{const o=s.portLayout;return i[s.portId]={position:Object.assign({},o.position),angle:o.angle||0},i},{})}getPortProp(e,t){return this.getPropByPath(this.prefixPortPath(e,t))}setPortProp(e,t,r,i){if(typeof t=="string"||Array.isArray(t)){const a=this.prefixPortPath(e,t),l=r;return this.setPropByPath(a,l,i)}const s=this.prefixPortPath(e),o=t;return this.setPropByPath(s,o,r)}removePortProp(e,t,r){return typeof t=="string"||Array.isArray(t)?this.removePropByPath(this.prefixPortPath(e,t),r):this.removePropByPath(this.prefixPortPath(e),t)}portProp(e,t,r,i){return t==null?this.getPortProp(e):typeof t=="string"||Array.isArray(t)?arguments.length===2?this.getPortProp(e,t):r==null?this.removePortProp(e,t,i):this.setPortProp(e,t,r,i):this.setPortProp(e,t,r)}prefixPortPath(e,t){const r=this.getPortIndex(e);if(r===-1)throw new Error(`Unable to find port with id: "${e}"`);return t==null||t===""?["ports","items",`${r}`]:Array.isArray(t)?["ports","items",`${r}`,...t]:`ports/items/${r}/${t}`}addPort(e,t){const r=[...this.ports.items];return r.push(e),this.setPropByPath("ports/items",r,t),this}addPorts(e,t){return this.setPropByPath("ports/items",[...this.ports.items,...e],t),this}insertPort(e,t,r){const i=[...this.ports.items];return i.splice(e,0,t),this.setPropByPath("ports/items",i,r),this}removePort(e,t={}){return this.removePortAt(this.getPortIndex(e),t)}removePortAt(e,t={}){if(e>=0){const r=[...this.ports.items];r.splice(e,1),t.rewrite=!0,this.setPropByPath("ports/items",r,t)}return this}removePorts(e,t){let r;if(Array.isArray(e)){if(r=t||{},e.length){r.rewrite=!0;const s=[...this.ports.items].filter(o=>!e.some(a=>{const l=typeof a=="string"?a:a.id;return o.id===l}));this.setPropByPath("ports/items",s,r)}}else r=e||{},r.rewrite=!0,this.setPropByPath("ports/items",[],r);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(e,t){return this.port.getPortsLayoutByGroup(e,t)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){const e=this.ports,t={};e.items.forEach(o=>{o.id&&(t[o.id]=!0)});const r={};(this.store.getPrevious("ports")||{items:[]}).items.forEach(o=>{o.id&&!t[o.id]&&(r[o.id]=!0)});const s=this.model;s&&!kb(r)&&(s.getConnectedEdges(this,{incoming:!0}).forEach(l=>{const c=l.getTargetPortId();c&&r[c]&&l.remove()}),s.getConnectedEdges(this,{outgoing:!0}).forEach(l=>{const c=l.getSourcePortId();c&&r[c]&&l.remove()}))}validatePorts(){const e={},t=[];return this.ports.items.forEach(r=>{typeof r!="object"&&t.push(`Invalid port ${r}.`),r.id==null&&(r.id=this.generatePortId()),e[r.id]&&t.push("Duplicitied port id."),e[r.id]=!0}),t}generatePortId(){return zh()}updatePortData(){const e=this.validatePorts();if(e.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(e.join(" "));const t=this.port?this.port.getPorts():null;this.port=new vG(this.ports);const r=this.port.getPorts(),i=t?r.filter(o=>t.find(a=>a.id===o.id)?null:o):[...r],s=t?t.filter(o=>r.find(a=>a.id===o.id)?null:o):[];i.length>0&&this.notify("ports:added",{added:i,cell:this,node:this}),s.length>0&&this.notify("ports:removed",{removed:s,cell:this,node:this})}};We.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNode=="function"&&typeof i.isEdge=="function"&&typeof i.prop=="function"&&typeof i.attr=="function"&&typeof i.size=="function"&&typeof i.position=="function"}n.isNode=e}(We||(We={})),function(n){n.config({propHooks(e){var{ports:t}=e,r=oc(e,["ports"]);return t&&(r.ports=Array.isArray(t)?{items:t}:t),r}})}(We||(We={})),function(n){n.registry=Ue.create({type:"node",process(e,t){if(_s.exist(e,!0))throw new Error(`Node with name '${e}' was registered by anthor Edge`);if(typeof t=="function")return t.config({shape:e}),t;let r=n;const{inherit:i}=t,s=oc(t,["inherit"]);if(i)if(typeof i=="string"){const a=this.get(i);a==null?this.onNotFound(i,"inherited"):r=a}else r=i;s.constructorName==null&&(s.constructorName=e);const o=r.define.call(r,s);return o.config({shape:e}),o}}),_s.setNodeRegistry(n.registry)}(We||(We={})),function(n){let e=0;function t(s){return s?Dh(s):(e+=1,`CustomNode${e}`)}function r(s){const{constructorName:o,overwrite:a}=s,l=oc(s,["constructorName","overwrite"]),c=Rh(t(o||l.shape),this);return c.config(l),l.shape&&n.registry.register(l.shape,c,a),c}n.define=r;function i(s){const o=s.shape||"rect",a=n.registry.get(o);return a?new a(s):n.registry.onNotFound(o)}n.create=i}(We||(We={}));var ac=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};let Ve=class jO extends le{get[Symbol.toStringTag](){return jO.toStringTag}constructor(e={}){super(e)}preprocess(e,t){const{source:r,sourceCell:i,sourcePort:s,sourcePoint:o,target:a,targetCell:l,targetPort:c,targetPoint:u}=e,f=ac(e,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),d=g=>typeof g=="string"||typeof g=="number";if(r!=null)if(le.isCell(r))f.source={cell:r.id};else if(d(r))f.source={cell:r};else if(P.isPoint(r))f.source=r.toJSON();else if(Array.isArray(r))f.source={x:r[0],y:r[1]};else{const g=r.cell;le.isCell(g)?f.source=Object.assign(Object.assign({},r),{cell:g.id}):f.source=r}if(i!=null||s!=null){let g=f.source;if(i!=null){const p=d(i)?i:i.id;g?g.cell=p:g=f.source={cell:p}}s!=null&&g&&(g.port=s)}else o!=null&&(f.source=P.create(o).toJSON());if(a!=null)if(le.isCell(a))f.target={cell:a.id};else if(d(a))f.target={cell:a};else if(P.isPoint(a))f.target=a.toJSON();else if(Array.isArray(a))f.target={x:a[0],y:a[1]};else{const g=a.cell;le.isCell(g)?f.target=Object.assign(Object.assign({},a),{cell:g.id}):f.target=a}if(l!=null||c!=null){let g=f.target;if(l!=null){const p=d(l)?l:l.id;g?g.cell=p:g=f.target={cell:p}}c!=null&&g&&(g.port=c)}else u!=null&&(f.target=P.create(u).toJSON());return super.preprocess(f,t)}setup(){super.setup(),this.on("change:labels",e=>this.onLabelsChanged(e)),this.on("change:vertices",e=>this.onVertexsChanged(e))}isEdge(){return!0}disconnect(e={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},e),this}get source(){return this.getSource()}set source(e){this.setSource(e)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(e,t,r={}){return this.setTerminal("source",e,t,r)}get target(){return this.getTarget()}set target(e){this.setTarget(e)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(e,t,r={}){return this.setTerminal("target",e,t,r)}getTerminal(e){return Object.assign({},this.store.get(e))}setTerminal(e,t,r,i={}){if(le.isCell(t))return this.store.set(e,Ie({},r,{cell:t.id}),i),this;const s=t;return P.isPoint(t)||s.x!=null&&s.y!=null?(this.store.set(e,Ie({},r,{x:s.x,y:s.y}),i),this):(this.store.set(e,ze(t),i),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(e){const t=this[e];if(P.isPointLike(t))return P.create(t);const r=this.getTerminalCell(e);return r?r.getConnectionPoint(this,e):new P}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(e){if(this.model){const t=e==="source"?this.getSourceCellId():this.getTargetCellId();if(t)return this.model.getCell(t)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(e){let t=this;const r={};for(;t&&t.isEdge();){if(r[t.id])return null;r[t.id]=!0,t=t.getTerminalCell(e)}return t&&t.isNode()?t:null}get router(){return this.getRouter()}set router(e){e==null?this.removeRouter():this.setRouter(e)}getRouter(){return this.store.get("router")}setRouter(e,t,r){return typeof e=="object"?this.store.set("router",e,t):this.store.set("router",{name:e,args:t},r),this}removeRouter(e={}){return this.store.remove("router",e),this}get connector(){return this.getConnector()}set connector(e){e==null?this.removeConnector():this.setConnector(e)}getConnector(){return this.store.get("connector")}setConnector(e,t,r){return typeof e=="object"?this.store.set("connector",e,t):this.store.set("connector",{name:e,args:t},r),this}removeConnector(e={}){return this.store.remove("connector",e)}getDefaultLabel(){const e=this.constructor,t=this.store.get("defaultLabel")||e.defaultLabel||{};return ze(t)}get labels(){return this.getLabels()}set labels(e){this.setLabels(e)}getLabels(){return[...this.store.get("labels",[])].map(e=>this.parseLabel(e))}setLabels(e,t={}){return this.store.set("labels",Array.isArray(e)?e:[e],t),this}insertLabel(e,t,r={}){const i=this.getLabels(),s=i.length;let o=t!=null&&Number.isFinite(t)?t:s;return o<0&&(o=s+o+1),i.splice(o,0,this.parseLabel(e)),this.setLabels(i,r)}appendLabel(e,t={}){return this.insertLabel(e,-1,t)}getLabelAt(e){const t=this.getLabels();return e!=null&&Number.isFinite(e)?this.parseLabel(t[e]):null}setLabelAt(e,t,r={}){if(e!=null&&Number.isFinite(e)){const i=this.getLabels();i[e]=this.parseLabel(t),this.setLabels(i,r)}return this}removeLabelAt(e,t={}){const r=this.getLabels(),i=e!=null&&Number.isFinite(e)?e:-1,s=r.splice(i,1);return this.setLabels(r,t),s.length?s[0]:null}parseLabel(e){return typeof e=="string"?this.constructor.parseStringLabel(e):e}onLabelsChanged({previous:e,current:t}){const r=e&&t?t.filter(s=>e.find(o=>s===o||Jn(s,o))?null:s):t?[...t]:[],i=e&&t?e.filter(s=>t.find(o=>s===o||Jn(s,o))?null:s):e?[...e]:[];r.length>0&&this.notify("labels:added",{added:r,cell:this,edge:this}),i.length>0&&this.notify("labels:removed",{removed:i,cell:this,edge:this})}get vertices(){return this.getVertices()}set vertices(e){this.setVertices(e)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(e,t={}){const r=Array.isArray(e)?e:[e];return this.store.set("vertices",r.map(i=>P.toJSON(i)),t),this}insertVertex(e,t,r={}){const i=this.getVertices(),s=i.length;let o=t!=null&&Number.isFinite(t)?t:s;return o<0&&(o=s+o+1),i.splice(o,0,P.toJSON(e)),this.setVertices(i,r)}appendVertex(e,t={}){return this.insertVertex(e,-1,t)}getVertexAt(e){return e!=null&&Number.isFinite(e)?this.getVertices()[e]:null}setVertexAt(e,t,r={}){if(e!=null&&Number.isFinite(e)){const i=this.getVertices();i[e]=t,this.setVertices(i,r)}return this}removeVertexAt(e,t={}){const r=this.getVertices(),i=e!=null&&Number.isFinite(e)?e:-1;return r.splice(i,1),this.setVertices(r,t)}onVertexsChanged({previous:e,current:t}){const r=e&&t?t.filter(s=>e.find(o=>P.equals(s,o))?null:s):t?[...t]:[],i=e&&t?e.filter(s=>t.find(o=>P.equals(s,o))?null:s):e?[...e]:[];r.length>0&&this.notify("vertexs:added",{added:r,cell:this,edge:this}),i.length>0&&this.notify("vertexs:removed",{removed:i,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||Ee.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}translate(e,t,r={}){return r.translateBy=r.translateBy||this.id,r.tx=e,r.ty=t,this.applyToPoints(i=>({x:(i.x||0)+e,y:(i.y||0)+t}),r)}scale(e,t,r,i={}){return this.applyToPoints(s=>P.create(s).scale(e,t,r).toJSON(),i)}applyToPoints(e,t={}){const r={},i=this.getSource(),s=this.getTarget();P.isPointLike(i)&&(r.source=e(i)),P.isPointLike(s)&&(r.target=e(s));const o=this.getVertices();return o.length>0&&(r.vertices=o.map(e)),this.store.set(r,t),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const e=[this.getSourcePoint(),...this.getVertices().map(t=>P.create(t)),this.getTargetPoint()];return new He(e)}updateParent(e){let t=null;const r=this.getSourceCell(),i=this.getTargetCell(),s=this.getParent();return r&&i&&(r===i||r.isDescendantOf(i)?t=i:i.isDescendantOf(r)?t=r:t=le.getCommonAncestor(r,i)),s&&t&&t.id!==s.id&&s.unembed(this,e),t&&(!s||s.id!==t.id)&&t.embed(this,e),t}hasLoop(e={}){const t=this.getSource(),r=this.getTarget(),i=t.cell,s=r.cell;if(!i||!s)return!1;let o=i===s;if(!o&&e.deep&&this._model){const a=this.getSourceCell(),l=this.getTargetCell();a&&l&&(o=a.isAncestorOf(l,e)||l.isAncestorOf(a,e))}return o}getFragmentAncestor(){const e=[this,this.getSourceNode(),this.getTargetNode()].filter(t=>t!=null);return this.getCommonAncestor(...e)}isFragmentDescendantOf(e){const t=this.getFragmentAncestor();return!!t&&(t.id===e.id||t.isDescendantOf(e))}};Ve.defaults={},function(n){function e(t,r){const i=t,s=r;return i.cell===s.cell?i.port===s.port||i.port==null&&s.port==null:!1}n.equalTerminals=e}(Ve||(Ve={})),function(n){n.defaultLabel={markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{text:{fill:"#000",fontSize:14,textAnchor:"middle",textVerticalAnchor:"middle",pointerEvents:"none"},rect:{ref:"label",fill:"#fff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}};function e(t){return{attrs:{label:{text:t}}}}n.parseStringLabel=e}(Ve||(Ve={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNode=="function"&&typeof i.isEdge=="function"&&typeof i.prop=="function"&&typeof i.attr=="function"&&typeof i.disconnect=="function"&&typeof i.getSource=="function"&&typeof i.getTarget=="function"}n.isEdge=e}(Ve||(Ve={})),function(n){n.registry=Ue.create({type:"edge",process(e,t){if(_s.exist(e,!1))throw new Error(`Edge with name '${e}' was registered by anthor Node`);if(typeof t=="function")return t.config({shape:e}),t;let r=n;const{inherit:i="edge"}=t,s=ac(t,["inherit"]);if(typeof i=="string"){const a=this.get(i||"edge");a==null&&i?this.onNotFound(i,"inherited"):r=a}else r=i;s.constructorName==null&&(s.constructorName=e);const o=r.define.call(r,s);return o.config({shape:e}),o}}),_s.setEdgeRegistry(n.registry)}(Ve||(Ve={})),function(n){let e=0;function t(s){return s?Dh(s):(e+=1,`CustomEdge${e}`)}function r(s){const{constructorName:o,overwrite:a}=s,l=ac(s,["constructorName","overwrite"]),c=Rh(t(o||l.shape),this);return c.config(l),l.shape&&n.registry.register(l.shape,c,a),c}n.define=r;function i(s){const o=s.shape||"edge",a=n.registry.get(o);return a?new a(s):n.registry.onNotFound(o)}n.create=i}(Ve||(Ve={})),function(n){const e="basic.edge";n.config({shape:e,propHooks(t){const{label:r,vertices:i}=t,s=ac(t,["label","vertices"]);if(r){s.labels==null&&(s.labels=[]);const o=typeof r=="string"?n.parseStringLabel(r):r;s.labels.push(o)}return i&&Array.isArray(i)&&(s.vertices=i.map(o=>P.create(o).toJSON())),s}}),n.registry.register(e,n)}(Ve||(Ve={}));class zw extends wt{constructor(e,t={}){super(),this.length=0,this.comparator=t.comparator||"zIndex",this.clean(),e&&this.reset(e,{silent:!0})}toJSON(){return this.cells.map(e=>e.toJSON())}add(e,t,r){let i,s;typeof t=="number"?(i=t,s=Object.assign({merge:!1},r)):(i=this.length,s=Object.assign({merge:!1},t)),i>this.length&&(i=this.length),i<0&&(i+=this.length+1);const o=Array.isArray(e)?e:[e],a=this.comparator&&typeof t!="number"&&s.sort!==!1,l=this.comparator||null;let c=!1;const u=[],h=[];return o.forEach(f=>{const d=this.get(f);d?s.merge&&!f.isSameStore(d)&&(d.setProp(f.getProp(),r),h.push(d),a&&!c&&(l==null||typeof l=="function"?c=d.hasChanged():typeof l=="string"?c=d.hasChanged(l):c=l.some(g=>d.hasChanged(g)))):(u.push(f),this.reference(f))}),u.length&&(a&&(c=!0),this.cells.splice(i,0,...u),this.length=this.cells.length),c&&this.sort({silent:!0}),s.silent||(u.forEach((f,d)=>{const g={cell:f,index:i+d,options:s};this.trigger("added",g),s.dryrun||f.notify("added",Object.assign({},g))}),c&&this.trigger("sorted"),(u.length||h.length)&&this.trigger("updated",{added:u,merged:h,removed:[],options:s})),this}remove(e,t={}){const r=Array.isArray(e)?e:[e],i=this.removeCells(r,t);return!t.silent&&i.length>0&&this.trigger("updated",{options:t,removed:i,added:[],merged:[]}),Array.isArray(e)?i:i[0]}removeCells(e,t){const r=[];for(let i=0;i<e.length;i+=1){const s=this.get(e[i]);if(s==null)continue;const o=this.cells.indexOf(s);this.cells.splice(o,1),this.length-=1,delete this.map[s.id],r.push(s),this.unreference(s),t.dryrun||s.remove(),t.silent||(this.trigger("removed",{cell:s,index:o,options:t}),t.dryrun||s.notify("removed",{cell:s,index:o,options:t}))}return r}reset(e,t={}){const r=this.cells.slice();if(r.forEach(i=>this.unreference(i)),this.clean(),this.add(e,Object.assign({silent:!0},t)),!t.silent){const i=this.cells.slice();this.trigger("reseted",{options:t,previous:r,current:i});const s=[],o=[];i.forEach(a=>{r.some(c=>c.id===a.id)||s.push(a)}),r.forEach(a=>{i.some(c=>c.id===a.id)||o.push(a)}),this.trigger("updated",{options:t,added:s,removed:o,merged:[]})}return this}push(e,t){return this.add(e,this.length,t)}pop(e){const t=this.at(this.length-1);return this.remove(t,e)}unshift(e,t){return this.add(e,0,t)}shift(e){const t=this.at(0);return this.remove(t,e)}get(e){if(e==null)return null;const t=typeof e=="string"||typeof e=="number"?e:e.id;return this.map[t]||null}has(e){return this.get(e)!=null}at(e){return e<0&&(e+=this.length),this.cells[e]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(e){return this.cells.indexOf(e)}toArray(){return this.cells.slice()}sort(e={}){return this.comparator!=null&&(this.cells=Ib(this.cells,this.comparator),e.silent||this.trigger("sorted")),this}clone(){const e=this.constructor;return new e(this.cells.slice(),{comparator:this.comparator})}reference(e){this.map[e.id]=e,e.on("*",this.notifyCellEvent,this)}unreference(e){e.off("*",this.notifyCellEvent,this),delete this.map[e.id]}notifyCellEvent(e,t){const r=t.cell;this.trigger(`cell:${e}`,t),r&&(r.isNode()?this.trigger(`node:${e}`,Object.assign(Object.assign({},t),{node:r})):r.isEdge()&&this.trigger(`edge:${e}`,Object.assign(Object.assign({},t),{edge:r})))}clean(){this.length=0,this.cells=[],this.map={}}}class zn extends wt{get[Symbol.toStringTag](){return zn.toStringTag}constructor(e=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new zw(e),this.setup()}notify(e,t){this.trigger(e,t);const r=this.graph;return r&&(e==="sorted"||e==="reseted"||e==="updated"?r.trigger(`model:${e}`,t):r.trigger(e,t)),this}setup(){const e=this.collection;e.on("sorted",()=>this.notify("sorted",null)),e.on("updated",t=>this.notify("updated",t)),e.on("cell:change:zIndex",()=>this.sortOnChangeZ()),e.on("added",({cell:t})=>{this.onCellAdded(t)}),e.on("removed",t=>{const r=t.cell;this.onCellRemoved(r,t.options),this.notify("cell:removed",t),r.isNode()?this.notify("node:removed",Object.assign(Object.assign({},t),{node:r})):r.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},t),{edge:r}))}),e.on("reseted",t=>{this.onReset(t.current),this.notify("reseted",t)}),e.on("edge:change:source",({edge:t})=>this.onEdgeTerminalChanged(t,"source")),e.on("edge:change:target",({edge:t})=>{this.onEdgeTerminalChanged(t,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(e){const t=e.id;e.isEdge()?(e.updateParent(),this.edges[t]=!0,this.onEdgeTerminalChanged(e,"source"),this.onEdgeTerminalChanged(e,"target")):this.nodes[t]=!0}onCellRemoved(e,t){const r=e.id;if(e.isEdge()){delete this.edges[r];const i=e.getSource(),s=e.getTarget();if(i&&i.cell){const o=this.outgoings[i.cell],a=o?o.indexOf(r):-1;a>=0&&(o.splice(a,1),o.length===0&&delete this.outgoings[i.cell])}if(s&&s.cell){const o=this.incomings[s.cell],a=o?o.indexOf(r):-1;a>=0&&(o.splice(a,1),o.length===0&&delete this.incomings[s.cell])}}else delete this.nodes[r];t.clear||(t.disconnectEdges?this.disconnectConnectedEdges(e,t):this.removeConnectedEdges(e,t)),e.model===this&&(e.model=null)}onReset(e){this.nodes={},this.edges={},this.outgoings={},this.incomings={},e.forEach(t=>this.onCellAdded(t))}onEdgeTerminalChanged(e,t){const r=t==="source"?this.outgoings:this.incomings,i=e.previous(t);if(i&&i.cell){const o=le.isCell(i.cell)?i.cell.id:i.cell,a=r[o],l=a?a.indexOf(e.id):-1;l>=0&&(a.splice(l,1),a.length===0&&delete r[o])}const s=e.getTerminal(t);if(s&&s.cell){const o=le.isCell(s.cell)?s.cell.id:s.cell,a=r[o]||[];a.indexOf(e.id)===-1&&a.push(e.id),r[o]=a}}prepareCell(e,t){return!e.model&&(!t||!t.dryrun)&&(e.model=this),e.zIndex==null&&e.setZIndex(this.getMaxZIndex()+1,{silent:!0}),e}resetCells(e,t={}){return e.map(r=>this.prepareCell(r,Object.assign(Object.assign({},t),{dryrun:!0}))),this.collection.reset(e,t),e.map(r=>this.prepareCell(r,{options:t})),this}clear(e={}){const t=this.getCells();if(t.length===0)return this;const r=Object.assign(Object.assign({},e),{clear:!0});return this.batchUpdate("clear",()=>{const i=t.sort((s,o)=>{const a=s.isEdge()?1:2,l=o.isEdge()?1:2;return a-l});for(;i.length>0;){const s=i.shift();s&&s.remove(r)}},r),this}addNode(e,t={}){const r=We.isNode(e)?e:this.createNode(e);return this.addCell(r,t),r}updateNode(e,t={}){const r=this.createNode(e),i=r.getProp();return r.dispose(),this.updateCell(i,t)}createNode(e){return We.create(e)}addEdge(e,t={}){const r=Ve.isEdge(e)?e:this.createEdge(e);return this.addCell(r,t),r}createEdge(e){return Ve.create(e)}updateEdge(e,t={}){const r=this.createEdge(e),i=r.getProp();return r.dispose(),this.updateCell(i,t)}addCell(e,t={}){return Array.isArray(e)?this.addCells(e,t):(!this.collection.has(e)&&!this.addings.has(e)&&(this.addings.set(e,!0),this.collection.add(this.prepareCell(e,t),t),e.eachChild(r=>this.addCell(r,t)),this.addings.delete(e)),this)}addCells(e,t={}){const r=e.length;if(r===0)return this;const i=Object.assign(Object.assign({},t),{position:r-1,maxPosition:r-1});return this.startBatch("add",Object.assign(Object.assign({},i),{cells:e})),e.forEach(s=>{this.addCell(s,i),i.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},i),{cells:e})),this}updateCell(e,t={}){const r=e.id&&this.getCell(e.id);return r?this.batchUpdate("update",()=>(Object.entries(e).forEach(([i,s])=>r.setProp(i,s,t)),!0),e):!1}removeCell(e,t={}){const r=typeof e=="string"?this.getCell(e):e;return r&&this.has(r)?this.collection.remove(r,t):null}updateCellId(e,t){this.startBatch("update",{id:t}),e.prop("id",t);const r=e.clone({keepId:!0});return this.addCell(r),this.getConnectedEdges(e).forEach(s=>{const o=s.getSourceCell(),a=s.getTargetCell();o===e&&s.setSource(Object.assign(Object.assign({},s.getSource()),{cell:t})),a===e&&s.setTarget(Object.assign(Object.assign({},s.getTarget()),{cell:t}))}),this.removeCell(e),this.stopBatch("update",{id:t}),r}removeCells(e,t={}){return e.length?this.batchUpdate("remove",()=>e.map(r=>this.removeCell(r,t))):[]}removeConnectedEdges(e,t={}){const r=this.getConnectedEdges(e);return r.forEach(i=>{i.remove(t)}),r}disconnectConnectedEdges(e,t={}){const r=typeof e=="string"?e:e.id;this.getConnectedEdges(e).forEach(i=>{const s=i.getSourceCellId(),o=i.getTargetCellId();s===r&&i.setSource({x:0,y:0},t),o===r&&i.setTarget({x:0,y:0},t)})}has(e){return this.collection.has(e)}total(){return this.collection.length}indexOf(e){return this.collection.indexOf(e)}getCell(e){return this.collection.get(e)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const e=this.collection.first();return e&&e.getZIndex()||0}getMaxZIndex(){const e=this.collection.last();return e&&e.getZIndex()||0}getCellsFromCache(e){return e?Object.keys(e).map(t=>this.getCell(t)).filter(t=>t!=null):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(e){const t=typeof e=="string"?e:e.id,r=this.outgoings[t];return r?r.map(i=>this.getCell(i)).filter(i=>i&&i.isEdge()):null}getIncomingEdges(e){const t=typeof e=="string"?e:e.id,r=this.incomings[t];return r?r.map(i=>this.getCell(i)).filter(i=>i&&i.isEdge()):null}getConnectedEdges(e,t={}){const r=[],i=typeof e=="string"?this.getCell(e):e;if(i==null)return r;const s={},o=t.indirect;let a=t.incoming,l=t.outgoing;a==null&&l==null&&(a=l=!0);const c=(u,h)=>{const f=h?this.getOutgoingEdges(u):this.getIncomingEdges(u);if(f!=null&&f.forEach(d=>{s[d.id]||(r.push(d),s[d.id]=!0,o&&(a&&c(d,!1),l&&c(d,!0)))}),o&&u.isEdge()){const d=h?u.getTargetCell():u.getSourceCell();d&&d.isEdge()&&(s[d.id]||(r.push(d),c(d,h)))}};if(l&&c(i,!0),a&&c(i,!1),t.deep){const u=i.getDescendants({deep:!0}),h={};u.forEach(d=>{d.isNode()&&(h[d.id]=!0)});const f=(d,g)=>{const p=g?this.getOutgoingEdges(d.id):this.getIncomingEdges(d.id);p!=null&&p.forEach(b=>{if(!s[b.id]){const m=b.getSourceCell(),y=b.getTargetCell();if(!t.enclosed&&m&&h[m.id]&&y&&h[y.id])return;r.push(b),s[b.id]=!0}})};u.forEach(d=>{d.isEdge()||(l&&f(d,!0),a&&f(d,!1))})}return r}isBoundary(e,t){const r=typeof e=="string"?this.getCell(e):e,i=t?this.getIncomingEdges(r):this.getOutgoingEdges(r);return i==null||i.length===0}getBoundaryNodes(e){const t=[];return Object.keys(this.nodes).forEach(r=>{if(this.isBoundary(r,e)){const i=this.getCell(r);i&&t.push(i)}}),t}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(e){return this.isBoundary(e,!0)}isLeaf(e){return this.isBoundary(e,!1)}getNeighbors(e,t={}){let r=t.incoming,i=t.outgoing;r==null&&i==null&&(r=i=!0);const o=this.getConnectedEdges(e,t).reduce((a,l)=>{const c=l.hasLoop(t),u=l.getSourceCell(),h=l.getTargetCell();return r&&u&&u.isNode()&&!a[u.id]&&(c||u!==e&&(!t.deep||!u.isDescendantOf(e)))&&(a[u.id]=u),i&&h&&h.isNode()&&!a[h.id]&&(c||h!==e&&(!t.deep||!h.isDescendantOf(e)))&&(a[h.id]=h),a},{});if(e.isEdge()){if(r){const a=e.getSourceCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}if(i){const a=e.getTargetCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}}return Object.keys(o).map(a=>o[a])}isNeighbor(e,t,r={}){let i=r.incoming,s=r.outgoing;return i==null&&s==null&&(i=s=!0),this.getConnectedEdges(e,r).some(o=>{const a=o.getSourceCell(),l=o.getTargetCell();return!!(i&&a&&a.id===t.id||s&&l&&l.id===t.id)})}getSuccessors(e,t={}){const r=[];return this.search(e,(i,s)=>{i!==e&&this.matchDistance(s,t.distance)&&r.push(i)},Object.assign(Object.assign({},t),{outgoing:!0})),r}isSuccessor(e,t,r={}){let i=!1;return this.search(e,(s,o)=>{if(s===t&&s!==e&&this.matchDistance(o,r.distance))return i=!0,!1},Object.assign(Object.assign({},r),{outgoing:!0})),i}getPredecessors(e,t={}){const r=[];return this.search(e,(i,s)=>{i!==e&&this.matchDistance(s,t.distance)&&r.push(i)},Object.assign(Object.assign({},t),{incoming:!0})),r}isPredecessor(e,t,r={}){let i=!1;return this.search(e,(s,o)=>{if(s===t&&s!==e&&this.matchDistance(o,r.distance))return i=!0,!1},Object.assign(Object.assign({},r),{incoming:!0})),i}matchDistance(e,t){return t==null?!0:typeof t=="function"?t(e):Array.isArray(t)&&t.includes(e)?!0:e===t}getCommonAncestor(...e){const t=[];return e.forEach(r=>{r&&(Array.isArray(r)?t.push(...r):t.push(r))}),le.getCommonAncestor(...t)}getSubGraph(e,t={}){const r=[],i={},s=[],o=[],a=l=>{i[l.id]||(r.push(l),i[l.id]=l,l.isEdge()&&o.push(l),l.isNode()&&s.push(l))};return e.forEach(l=>{a(l),t.deep&&l.getDescendants({deep:!0}).forEach(u=>a(u))}),o.forEach(l=>{const c=l.getSourceCell(),u=l.getTargetCell();c&&!i[c.id]&&(r.push(c),i[c.id]=c,c.isNode()&&s.push(c)),u&&!i[u.id]&&(r.push(u),i[u.id]=u,u.isNode()&&s.push(u))}),s.forEach(l=>{this.getConnectedEdges(l,t).forEach(u=>{const h=u.getSourceCell(),f=u.getTargetCell();!i[u.id]&&h&&i[h.id]&&f&&i[f.id]&&(r.push(u),i[u.id]=u)})}),r}cloneSubGraph(e,t={}){const r=this.getSubGraph(e,t);return this.cloneCells(r)}cloneCells(e){return le.cloneCells(e)}getNodesFromPoint(e,t){const r=typeof e=="number"?{x:e,y:t||0}:e;return this.getNodes().filter(i=>i.getBBox().containsPoint(r))}getNodesInArea(e,t,r,i,s){const o=typeof e=="number"?new D(e,t,r,i):D.create(e),a=typeof e=="number"?s:t,l=a&&a.strict;return this.getNodes().filter(c=>{const u=c.getBBox();return l?o.containsRect(u):o.isIntersectWithRect(u)})}getEdgesInArea(e,t,r,i,s){const o=typeof e=="number"?new D(e,t,r,i):D.create(e),a=typeof e=="number"?s:t,l=a&&a.strict;return this.getEdges().filter(c=>{const u=c.getBBox();return u.width===0?u.inflate(1,0):u.height===0&&u.inflate(0,1),l?o.containsRect(u):o.isIntersectWithRect(u)})}getNodesUnderNode(e,t={}){const r=e.getBBox();return(t.by==null||t.by==="bbox"?this.getNodesInArea(r):this.getNodesFromPoint(r[t.by])).filter(s=>e.id!==s.id&&!s.isDescendantOf(e))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(e,t={}){return le.getCellsBBox(e,t)}search(e,t,r={}){r.breadthFirst?this.breadthFirstSearch(e,t,r):this.depthFirstSearch(e,t,r)}breadthFirstSearch(e,t,r={}){const i=[],s={},o={};for(i.push(e),o[e.id]=0;i.length>0;){const a=i.shift();if(a==null||s[a.id]||(s[a.id]=!0,Y(t,this,a,o[a.id])===!1))continue;this.getNeighbors(a,r).forEach(c=>{o[c.id]=o[a.id]+1,i.push(c)})}}depthFirstSearch(e,t,r={}){const i=[],s={},o={};for(i.push(e),o[e.id]=0;i.length>0;){const a=i.pop();if(a==null||s[a.id]||(s[a.id]=!0,Y(t,this,a,o[a.id])===!1))continue;const l=this.getNeighbors(a,r),c=i.length;l.forEach(u=>{o[u.id]=o[a.id]+1,i.splice(c,0,u)})}}getShortestPath(e,t,r={}){const i={};this.getEdges().forEach(c=>{const u=c.getSourceCellId(),h=c.getTargetCellId();u&&h&&(i[u]||(i[u]=[]),i[h]||(i[h]=[]),i[u].push(h),r.directed||i[h].push(u))});const s=typeof e=="string"?e:e.id,o=nf.run(i,s,r.weight),a=[];let l=typeof t=="string"?t:t.id;for(o[l]&&a.push(l);l=o[l];)a.unshift(l);return a}translate(e,t,r){return this.getCells().filter(i=>!i.hasParent()).forEach(i=>i.translate(e,t,r)),this}resize(e,t,r){return this.resizeCells(e,t,this.getCells(),r)}resizeCells(e,t,r,i={}){const s=this.getCellsBBox(r);if(s){const o=Math.max(e/s.width,0),a=Math.max(t/s.height,0),l=s.getOrigin();r.forEach(c=>c.scale(o,a,l,i))}return this}toJSON(e={}){return zn.toJSON(this.getCells(),e)}parseJSON(e){return zn.fromJSON(e)}fromJSON(e,t={}){const r=this.parseJSON(e);return this.resetCells(r,t),this}startBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)+1,this.notify("batch:start",{name:e,data:t}),this}stopBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)-1,this.notify("batch:stop",{name:e,data:t}),this}batchUpdate(e,t,r={}){this.startBatch(e,r);const i=t();return this.stopBatch(e,r),i}hasActiveBatch(e=Object.keys(this.batches)){return(Array.isArray(e)?e:[e]).some(r=>this.batches[r]>0)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.addNode=="function"&&typeof i.addEdge=="function"&&i.collection!=null}n.isModel=e})(zn||(zn={})),function(n){function e(r,i={}){return{cells:r.map(s=>s.toJSON(i))}}n.toJSON=e;function t(r){const i=[];return Array.isArray(r)?i.push(...r):(r.cells&&i.push(...r.cells),r.nodes&&r.nodes.forEach(s=>{s.shape==null&&(s.shape="rect"),i.push(s)}),r.edges&&r.edges.forEach(s=>{s.shape==null&&(s.shape="edge"),i.push(s)})),i.map(s=>{const o=s.shape;if(o){if(We.registry.exist(o))return We.create(s);if(Ve.registry.exist(o))return Ve.create(s)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}n.fromJSON=t}(zn||(zn={}));var bG=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};let jr=class extends We{get label(){return this.getLabel()}set label(e){this.setLabel(e)}getLabel(){return this.getAttrByPath("text/text")}setLabel(e,t){return e==null?this.removeLabel():this.setAttrByPath("text/text",e,t),this}removeLabel(){return this.removeAttrByPath("text/text"),this}};(function(n){n.bodyAttr={fill:"#ffffff",stroke:"#333333",strokeWidth:2},n.labelAttr={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"},n.config({attrs:{text:Object.assign({},n.labelAttr)},propHooks(e){const{label:t}=e,r=bG(e,["label"]);return t&&hs(r,"attrs/text/text",t),r},visible:!0})})(jr||(jr={}));var wG=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};function xG(n,e="body"){return[{tagName:n,selector:e},{tagName:"text",selector:"label"}]}function CG(n="xlink:href"){return t=>{const{imageUrl:r,imageWidth:i,imageHeight:s}=t,o=wG(t,["imageUrl","imageWidth","imageHeight"]);if(r!=null||i!=null||s!=null){const a=()=>{if(o.attrs){const l=o.attrs.image;r!=null&&(l[n]=r),i!=null&&(l.width=i),s!=null&&(l.height=s),o.attrs.image=l}};o.attrs?(o.attrs.image==null&&(o.attrs.image={}),a()):(o.attrs={image:{}},a())}return o}}function Ns(n,e,t={}){const r={constructorName:n,markup:xG(n,t.selector),attrs:{[n]:Object.assign({},jr.bodyAttr)}};return(t.parent||jr).define(Ie(r,e,{shape:n}))}Ns("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});const SG=Ve.define({shape:"edge",markup:[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}],attrs:{lines:{connection:!0,strokeLinejoin:"round"},wrap:{strokeWidth:10},line:{stroke:"#333",strokeWidth:2,targetMarker:"classic"}}});Ns("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var PG=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class ks extends jr{get points(){return this.getPoints()}set points(e){this.setPoints(e)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(e,t){return e==null?this.removePoints():this.setAttrByPath("body/refPoints",ks.pointsToString(e),t),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}(function(n){function e(t){return typeof t=="string"?t:t.map(r=>Array.isArray(r)?r.join(","):P.isPointLike(r)?`${r.x}, ${r.y}`:"").join(" ")}n.pointsToString=e,n.config({propHooks(t){const{points:r}=t,i=PG(t,["points"]);if(r){const s=e(r);s&&hs(i,"attrs/body/refPoints",s)}return i}})})(ks||(ks={})),Ns("polygon",{},{parent:ks}),Ns("polyline",{},{parent:ks});var EG=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};jr.define({shape:"path",markup:[{tagName:"rect",selector:"bg"},{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}],attrs:{bg:{refWidth:"100%",refHeight:"100%",fill:"none",stroke:"none",pointerEvents:"all"},body:{fill:"none",stroke:"#000",strokeWidth:2}},propHooks(n){const{path:e}=n,t=EG(n,["path"]);return e&&hs(t,"attrs/body/refD",e),t}});var AG=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};jr.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},tn.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:lt.xhtml,selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]}:{tagName:"text",selector:"label",attrs:{textAnchor:"middle"}}],attrs:{body:Object.assign(Object.assign({},jr.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(n){const{text:e}=n,t=AG(n,["text"]);return e&&hs(t,"attrs/label/text",e),t},attrHooks:{text:{set(n,{cell:e,view:t,refBBox:r,elem:i,attrs:s}){if(i instanceof HTMLElement)i.textContent=n;else{const o=s.style||{},a={text:n,width:-5,height:"100%"},l=Object.assign({textVerticalAnchor:"middle"},o),c=Bn.presets.textWrap;return Y(c.set,this,a,{cell:e,view:t,elem:i,refBBox:r,attrs:l}),{fill:o.color||null}}},position(n,{refBBox:e,elem:t}){if(t instanceof SVGElement)return e.getCenter()}}}}),Ns("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:CG()},{selector:"image"}),Ns("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});class kt extends rt{constructor(){super(...arguments),this.portsCache={}}get[Symbol.toStringTag](){return kt.toStringTag}getContainerClassName(){const e=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||e.push(this.prefixClassName("node-immovable")),e.join(" ")}updateClassName(e){const t=e.target;if(t.hasAttribute("magnet")){const r=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?gt(t,r):K(t,r)}else{const r=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(r):this.addClass(r)}}isNodeView(){return!0}confirmUpdate(e,t={}){let r=e;return this.hasAction(r,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(r,"render")?(this.render(),r=this.removeAction(r,["render","update","resize","translate","rotate","ports","tools"])):(r=this.handleAction(r,"resize",()=>this.resize(),"update"),r=this.handleAction(r,"update",()=>this.update(),"ports"),r=this.handleAction(r,"translate",()=>this.translate()),r=this.handleAction(r,"rotate",()=>this.rotate()),r=this.handleAction(r,"ports",()=>this.renderPorts()),r=this.handleAction(r,"tools",()=>{this.getFlag("tools")===e?this.renderTools():this.updateTools(t)})),r}update(e){this.cleanCache(),this.removePorts();const t=this.cell,r=t.getSize(),i=t.getAttrs();this.updateAttrs(this.container,i,{attrs:e===i?null:e,rootBBox:new D(0,0,r.width,r.height),selectors:this.selectors}),this.renderPorts()}renderMarkup(){const e=this.cell.markup;if(e){if(typeof e=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw new TypeError("Invalid node markup.")}renderJSONMarkup(e){const t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.appendChild(t.fragment)}render(){return this.empty(),this.renderMarkup(),this.resize(),this.updateTransform(),this.renderTools(),this}resize(){this.cell.getAngle()&&this.rotate(),this.update()}translate(){this.updateTransform()}rotate(){this.updateTransform()}getTranslationString(){const e=this.cell.getPosition();return`translate(${e.x},${e.y})`}getRotationString(){const e=this.cell.getAngle();if(e){const t=this.cell.getSize();return`rotate(${e},${t.width/2},${t.height/2})`}}updateTransform(){let e=this.getTranslationString();const t=this.getRotationString();t&&(e+=` ${t}`),this.container.setAttribute("transform",e)}findPortElem(e,t){const r=e?this.portsCache[e]:null;if(!r)return null;const i=r.portContentElement,s=r.portContentSelectors||{};return this.findOne(t,i,s)}cleanPortsCache(){this.portsCache={}}removePorts(){Object.values(this.portsCache).forEach(e=>{er(e.portElement)})}renderPorts(){const e=this.container,t=[];e.childNodes.forEach(o=>{t.push(o)});const r=this.cell.getParsedPorts(),i=Nb(r,"zIndex"),s="auto";i[s]&&i[s].forEach(o=>{const a=this.getPortElement(o);e.append(a),t.push(a)}),Object.keys(i).forEach(o=>{if(o!==s){const a=parseInt(o,10);this.appendPorts(i[o],a,t)}}),this.updatePorts()}appendPorts(e,t,r){const i=e.map(s=>this.getPortElement(s));r[t]||t<0?ko(r[Math.max(t,0)],i):jn(this.container,i)}getPortElement(e){const t=this.portsCache[e.id];return t?t.portElement:this.createPortElement(e)}createPortElement(e){let t=Ee.renderMarkup(this.cell.getPortContainerMarkup());const r=t.elem;if(r==null)throw new Error("Invalid port container markup.");t=Ee.renderMarkup(this.getPortMarkup(e));const i=t.elem,s=t.selectors;if(i==null)throw new Error("Invalid port markup.");this.setAttrs({port:e.id,"port-group":e.group},i);let o="x6-port";e.group&&(o+=` x6-port-${e.group}`),K(r,o),K(r,"x6-port"),K(i,"x6-port-body"),r.appendChild(i);let a=s,l,c;if(this.existPortLabel(e)){if(t=Ee.renderMarkup(this.getPortLabelMarkup(e.label)),l=t.elem,c=t.selectors,l==null)throw new Error("Invalid port label markup.");if(s&&c){for(const h in c)if(s[h]&&h!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},s),c)}K(l,"x6-port-label"),r.appendChild(l)}return this.portsCache[e.id]={portElement:r,portSelectors:a,portLabelElement:l,portLabelSelectors:c,portContentElement:i,portContentSelectors:s},this.graph.options.onPortRendered&&this.graph.options.onPortRendered({port:e,node:this.cell,container:r,selectors:a,labelContainer:l,labelSelectors:c,contentContainer:i,contentSelectors:s}),r}updatePorts(){const e=this.cell.getParsedGroups(),t=Object.keys(e);t.length===0?this.updatePortGroup():t.forEach(r=>this.updatePortGroup(r))}updatePortGroup(e){const t=D.fromSize(this.cell.getSize()),r=this.cell.getPortsLayoutByGroup(e,t);for(let i=0,s=r.length;i<s;i+=1){const o=r[i],a=o.portId,l=this.portsCache[a]||{},c=o.portLayout;if(this.applyPortTransform(l.portElement,c),o.portAttrs!=null){const h={selectors:l.portSelectors||{}};o.portSize&&(h.rootBBox=D.fromSize(o.portSize)),this.updateAttrs(l.portElement,o.portAttrs,h)}const u=o.labelLayout;if(u&&l.portLabelElement&&(this.applyPortTransform(l.portLabelElement,u,-(c.angle||0)),u.attrs)){const h={selectors:l.portLabelSelectors||{}};o.labelSize&&(h.rootBBox=D.fromSize(o.labelSize)),this.updateAttrs(l.portLabelElement,u.attrs,h)}}}applyPortTransform(e,t,r=0){const i=t.angle,s=t.position,o=ct().rotate(r).translate(s.x||0,s.y||0).rotate(i||0);ys(e,o,{absolute:!0})}getPortMarkup(e){return e.markup||this.cell.portMarkup}getPortLabelMarkup(e){return e.markup||this.cell.portLabelMarkup}existPortLabel(e){return e.attrs&&e.attrs.text}getEventArgs(e,t,r){const i=this,s=i.cell,o=s;return t==null||r==null?{e,view:i,node:s,cell:o}:{e,x:t,y:r,view:i,node:s,cell:o}}getPortEventArgs(e,t,r){const i=this,s=i.cell,o=s;return r?{e,x:r.x,y:r.y,view:i,node:s,cell:o,port:t}:{e,view:i,node:s,cell:o,port:t}}notifyMouseDown(e,t,r){super.onMouseDown(e,t,r),this.notify("node:mousedown",this.getEventArgs(e,t,r))}notifyMouseMove(e,t,r){super.onMouseMove(e,t,r),this.notify("node:mousemove",this.getEventArgs(e,t,r))}notifyMouseUp(e,t,r){super.onMouseUp(e,t,r),this.notify("node:mouseup",this.getEventArgs(e,t,r))}notifyPortEvent(e,t,r){const i=this.findAttr("port",t.target);if(i){const s=t.type;e==="node:port:mouseenter"?t.type="mouseenter":e==="node:port:mouseleave"&&(t.type="mouseleave"),this.notify(e,this.getPortEventArgs(t,i,r)),t.type=s}}onClick(e,t,r){super.onClick(e,t,r),this.notify("node:click",this.getEventArgs(e,t,r)),this.notifyPortEvent("node:port:click",e,{x:t,y:r})}onDblClick(e,t,r){super.onDblClick(e,t,r),this.notify("node:dblclick",this.getEventArgs(e,t,r)),this.notifyPortEvent("node:port:dblclick",e,{x:t,y:r})}onContextMenu(e,t,r){super.onContextMenu(e,t,r),this.notify("node:contextmenu",this.getEventArgs(e,t,r)),this.notifyPortEvent("node:port:contextmenu",e,{x:t,y:r})}onMouseDown(e,t,r){this.isPropagationStopped(e)||(this.notifyMouseDown(e,t,r),this.notifyPortEvent("node:port:mousedown",e,{x:t,y:r}),this.startNodeDragging(e,t,r))}onMouseMove(e,t,r){const i=this.getEventData(e),s=i.action;if(s==="magnet")this.dragMagnet(e,t,r);else{if(s==="move"){const a=i.targetView||this;a.dragNode(e,t,r),a.notify("node:moving",{e,x:t,y:r,view:a,cell:a.cell,node:a.cell})}this.notifyMouseMove(e,t,r),this.notifyPortEvent("node:port:mousemove",e,{x:t,y:r})}this.setEventData(e,i)}onMouseUp(e,t,r){const i=this.getEventData(e),s=i.action;s==="magnet"?this.stopMagnetDragging(e,t,r):(this.notifyMouseUp(e,t,r),this.notifyPortEvent("node:port:mouseup",e,{x:t,y:r}),s==="move"&&(i.targetView||this).stopNodeDragging(e,t,r));const o=i.targetMagnet;o&&this.onMagnetClick(e,o,t,r),this.checkMouseleave(e)}onMouseOver(e){super.onMouseOver(e),this.notify("node:mouseover",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseenter",e),this.notifyPortEvent("node:port:mouseover",e)}onMouseOut(e){super.onMouseOut(e),this.notify("node:mouseout",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseleave",e),this.notifyPortEvent("node:port:mouseout",e)}onMouseEnter(e){this.updateClassName(e),super.onMouseEnter(e),this.notify("node:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("node:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,r,i){super.onMouseWheel(e,t,r,i),this.notify("node:mousewheel",Object.assign({delta:i},this.getEventArgs(e,t,r)))}onMagnetClick(e,t,r,i){const s=this.graph;s.view.getMouseMovedCount(e)>s.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:t},this.getEventArgs(e,r,i)))}onMagnetDblClick(e,t,r,i){this.notify("node:magnet:dblclick",Object.assign({magnet:t},this.getEventArgs(e,r,i)))}onMagnetContextMenu(e,t,r,i){this.notify("node:magnet:contextmenu",Object.assign({magnet:t},this.getEventArgs(e,r,i)))}onMagnetMouseDown(e,t,r,i){this.startMagnetDragging(e,r,i)}onCustomEvent(e,t,r,i){this.notify("node:customevent",Object.assign({name:t},this.getEventArgs(e,r,i))),super.onCustomEvent(e,t,r,i)}prepareEmbedding(e){const t=this.graph,i=this.getEventData(e).cell||this.cell,s=t.findViewByCell(i),o=t.snapToGrid(e.clientX,e.clientY);this.notify("node:embed",{e,node:i,view:s,cell:i,x:o.x,y:o.y,currentParent:i.getParent()})}processEmbedding(e,t){const r=t.cell||this.cell,i=t.graph||this.graph,s=i.options.embedding,o=s.findParent;let a=typeof o=="function"?Y(o,i,{view:this,node:this.cell}).filter(f=>le.isCell(f)&&this.cell.id!==f.id&&!f.isDescendantOf(this.cell)):i.model.getNodesUnderNode(r,{by:o});if(s.frontOnly&&a.length>0){const f=Nb(a,"zIndex"),d=TV(Object.keys(f).map(g=>parseInt(g,10)));d&&(a=f[d])}a=a.filter(f=>f.visible);let l=null;const c=t.candidateEmbedView,u=s.validate;for(let f=a.length-1;f>=0;f-=1){const d=a[f];if(c&&c.cell.id===d.id){l=c;break}else{const g=d.findView(i);if(Y(u,i,{child:this.cell,parent:g.cell,childView:this,parentView:g})){l=g;break}}}this.clearEmbedding(t),l&&l.highlight(null,{type:"embedding"}),t.candidateEmbedView=l;const h=i.snapToGrid(e.clientX,e.clientY);this.notify("node:embedding",{e,cell:r,node:r,view:i.findViewByCell(r),x:h.x,y:h.y,currentParent:r.getParent(),candidateParent:l?l.cell:null})}clearEmbedding(e){const t=e.candidateEmbedView;t&&(t.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null)}finalizeEmbedding(e,t){this.graph.startBatch("embedding");const r=t.cell||this.cell,i=t.graph||this.graph,s=i.findViewByCell(r),o=r.getParent(),a=t.candidateEmbedView;if(a?(a.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null,(o==null||o.id!==a.cell.id)&&a.cell.insertChild(r,void 0,{ui:!0})):o&&o.unembed(r,{ui:!0}),i.model.getConnectedEdges(r,{deep:!0}).forEach(l=>{l.updateParent({ui:!0})}),s&&a){const l=i.snapToGrid(e.clientX,e.clientY);s.notify("node:embedded",{e,cell:r,x:l.x,y:l.y,node:r,view:i.findViewByCell(r),previousParent:o,currentParent:r.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let e=this.cell,t=this;for(;t&&!e.isEdge();){if(!e.hasParent()||t.can("stopDelegateOnDragging"))return t;e=e.getParent(),t=this.graph.findViewByCell(e)}return null}validateMagnet(e,t,r){if(t.getAttribute("magnet")!=="passive"){const i=this.graph.options.connecting.validateMagnet;return i?Y(i,this.graph,{e:r,magnet:t,view:e,cell:e.cell}):!0}return!1}startMagnetDragging(e,t,r){if(!this.can("magnetConnectable"))return;e.stopPropagation();const i=e.currentTarget,s=this.graph;this.setEventData(e,{targetMagnet:i}),this.validateMagnet(this,i,e)?(s.options.magnetThreshold<=0&&this.startConnectting(e,i,t,r),this.setEventData(e,{action:"magnet"}),this.stopPropagation(e)):this.onMouseDown(e,t,r),s.view.delegateDragEvents(e,this)}startConnectting(e,t,r,i){this.graph.model.startBatch("add-edge");const s=this.createEdgeFromMagnet(t,r,i);s.setEventData(e,s.prepareArrowheadDragging("target",{x:r,y:i,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(e,{edgeView:s}),s.notifyMouseDown(e,r,i)}getDefaultEdge(e,t){let r;const i=this.graph.options.connecting.createEdge;return i&&(r=Y(i,this.graph,{sourceMagnet:t,sourceView:e,sourceCell:e.cell})),r}createEdgeFromMagnet(e,t,r){const i=this.graph,s=i.model,o=this.getDefaultEdge(this,e);return o.setSource(Object.assign(Object.assign({},o.getSource()),this.getEdgeTerminal(e,t,r,o,"source"))),o.setTarget(Object.assign(Object.assign({},o.getTarget()),{x:t,y:r})),o.addTo(s,{async:!1,ui:!0}),o.findView(i)}dragMagnet(e,t,r){const i=this.getEventData(e),s=i.edgeView;if(s)s.onMouseMove(e,t,r),this.autoScrollGraph(e.clientX,e.clientY);else{const o=this.graph,a=o.options.magnetThreshold,l=this.getEventTarget(e),c=i.targetMagnet;if(a==="onleave"){if(c===l||c.contains(l))return}else if(o.view.getMouseMovedCount(e)<=a)return;this.startConnectting(e,c,t,r)}}stopMagnetDragging(e,t,r){const s=this.eventData(e).edgeView;s&&(s.onMouseUp(e,t,r),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(e,t,r){this.notify("node:unhandled:mousedown",{e,x:t,y:r,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(e,t,r,i,s){let o=[s];const a=this.graph.getPlugin("selection");if(a&&a.isSelectionMovable()){const l=a.getSelectedCells();l.includes(s)&&(o=l.filter(c=>c.isNode()))}o.forEach(l=>{this.notify(e,{e:t,x:r,y:i,cell:l,node:l,view:l.findView(this.graph)})})}getRestrictArea(e){const t=this.graph.options.translating.restrict,r=typeof t=="function"?Y(t,this.graph,e):t;return typeof r=="number"?this.graph.transform.getGraphArea().inflate(r):r===!0?this.graph.transform.getGraphArea():r||null}startNodeDragging(e,t,r){const i=this.getDelegatedView();if(i==null||!i.can("nodeMovable"))return this.notifyUnhandledMouseDown(e,t,r);this.setEventData(e,{targetView:i,action:"move"});const s=P.create(i.cell.getPosition());i.setEventData(e,{moving:!1,offset:s.diff(t,r),restrict:this.getRestrictArea(i)})}dragNode(e,t,r){const i=this.cell,s=this.graph,o=s.getGridSize(),a=this.getEventData(e),l=a.offset,c=a.restrict;a.moving||(a.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",e,t,r,this.cell)),this.autoScrollGraph(e.clientX,e.clientY);const u=we.snapToGrid(t+l.x,o),h=we.snapToGrid(r+l.y,o);i.setPosition(u,h,{restrict:c,deep:!0,ui:!0}),s.options.embedding.enabled&&(a.embedding||(this.prepareEmbedding(e),a.embedding=!0),this.processEmbedding(e,a))}stopNodeDragging(e,t,r){const i=this.getEventData(e);i.embedding&&this.finalizeEmbedding(e,i),i.moving&&(this.removeClass("node-moving"),this.notifyNodeMove("node:moved",e,t,r,this.cell)),i.moving=!1,i.embedding=!1}autoScrollGraph(e,t){const r=this.graph.getPlugin("scroller");r&&r.autoScroll(e,t)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNodeView=="function"&&typeof i.isEdgeView=="function"&&typeof i.confirmUpdate=="function"&&typeof i.update=="function"&&typeof i.findPortElem=="function"&&typeof i.resize=="function"&&typeof i.rotate=="function"&&typeof i.translate=="function"}n.isNodeView=e})(kt||(kt={})),kt.config({isSvgElement:!0,priority:0,bootstrap:["render"],actions:{view:["render"],markup:["render"],attrs:["update"],size:["resize","ports","tools"],angle:["rotate","tools"],position:["translate","tools"],ports:["ports"],tools:["tools"]}}),kt.registry.register("node",kt,!0);class sr extends rt{constructor(){super(...arguments),this.POINT_ROUNDING=2}get[Symbol.toStringTag](){return sr.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const e=this.sourceView;if(!e){const r=this.cell.getSource();return new D(r.x,r.y)}const t=this.sourceMagnet;return e.isEdgeElement(t)?new D(this.sourceAnchor.x,this.sourceAnchor.y):e.getBBoxOfElement(t||e.container)}get targetBBox(){const e=this.targetView;if(!e){const r=this.cell.getTarget();return new D(r.x,r.y)}const t=this.targetMagnet;return e.isEdgeElement(t)?new D(this.targetAnchor.x,this.targetAnchor.y):e.getBBoxOfElement(t||e.container)}isEdgeView(){return!0}confirmUpdate(e,t={}){let r=e;if(this.hasAction(r,"source")){if(!this.updateTerminalProperties("source"))return r;r=this.removeAction(r,"source")}if(this.hasAction(r,"target")){if(!this.updateTerminalProperties("target"))return r;r=this.removeAction(r,"target")}return this.hasAction(r,"render")?(this.render(),r=this.removeAction(r,["render","update","labels","tools"]),r):(r=this.handleAction(r,"update",()=>this.update(t)),r=this.handleAction(r,"labels",()=>this.onLabelsChange(t)),r=this.handleAction(r,"tools",()=>this.renderTools()),r)}render(){return this.empty(),this.renderMarkup(),this.labelContainer=null,this.renderLabels(),this.update(),this.renderTools(),this}renderMarkup(){const e=this.cell.markup;if(e){if(typeof e=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw new TypeError("Invalid edge markup.")}renderJSONMarkup(e){const t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.append(t.fragment)}customizeLabels(){if(this.labelContainer){const e=this.cell,t=e.labels;for(let r=0,i=t.length;r<i;r+=1){const s=t[r],o=this.labelCache[r],a=this.labelSelectors[r],l=this.graph.options.onEdgeLabelRendered;l&&l({edge:e,label:s,container:o,selectors:a})}}}renderLabels(){const e=this.cell,t=e.getLabels(),r=t.length;let i=this.labelContainer;if(this.labelCache={},this.labelSelectors={},r<=0)return i&&i.parentNode&&i.parentNode.removeChild(i),this;i?this.empty(i):(i=Zn("g"),this.addClass(this.prefixClassName("edge-labels"),i),this.labelContainer=i);for(let s=0,o=t.length;s<o;s+=1){const a=t[s],l=this.normalizeLabelMarkup(this.parseLabelMarkup(a.markup));let c,u;if(l)c=l.node,u=l.selectors;else{const f=e.getDefaultLabel(),d=this.normalizeLabelMarkup(this.parseLabelMarkup(f.markup));c=d.node,u=d.selectors}c.setAttribute("data-index",`${s}`),i.appendChild(c);const h=this.rootSelector;if(u[h])throw new Error("Ambiguous label root selector.");u[h]=c,this.labelCache[s]=c,this.labelSelectors[s]=u}return i.parentNode==null&&this.container.appendChild(i),this.updateLabels(),this.customizeLabels(),this}onLabelsChange(e={}){this.shouldRerenderLabels(e)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(e={}){const t=this.cell.previous("labels");if(t==null)return!0;if("propertyPathArray"in e&&"propertyValue"in e){const r=e.propertyPathArray||[],i=r.length;if(i>1){const s=r[1];if(t[s]){if(i===2)return typeof e.propertyValue=="object"&&kl(e.propertyValue,"markup");if(r[2]!=="markup")return!1}}}return!0}parseLabelMarkup(e){return e?typeof e=="string"?this.parseLabelStringMarkup(e):this.parseJSONMarkup(e):null}parseLabelStringMarkup(e){const t=ee.createVectors(e),r=document.createDocumentFragment();for(let i=0,s=t.length;i<s;i+=1){const o=t[i].node;r.appendChild(o)}return{fragment:r,selectors:{}}}normalizeLabelMarkup(e){if(e==null)return;const t=e.fragment;if(!(t instanceof DocumentFragment)||!t.hasChildNodes())throw new Error("Invalid label markup.");let r;const i=t.childNodes;return i.length>1||i[0].nodeName.toUpperCase()!=="G"?r=ee.create("g").append(t):r=ee.create(i[0]),r.addClass(this.prefixClassName("edge-label")),{node:r.node,selectors:e.selectors}}updateLabels(){if(this.labelContainer){const e=this.cell,t=e.labels,r=this.can("edgeLabelMovable"),i=e.getDefaultLabel();for(let s=0,o=t.length;s<o;s+=1){const a=this.labelCache[s],l=this.labelSelectors[s];a.setAttribute("cursor",r?"move":"default");const c=t[s],u=Ie({},i.attrs,c.attrs);this.updateAttrs(a,u,{selectors:l,rootBBox:c.size?D.fromSize(c.size):void 0})}}}renderTools(){const e=this.cell.getTools();return this.addTools(e),this}update(e={}){this.cleanCache(),this.updateConnection(e);const t=this.cell.getAttrs();return t!=null&&this.updateAttrs(this.container,t,{selectors:this.selectors}),this.updateLabelPositions(),this.updateTools(e),this}removeRedundantLinearVertices(e={}){const t=this.cell,r=t.getVertices(),i=[this.sourceAnchor,...r,this.targetAnchor],s=i.length,o=new He(i);o.simplify({threshold:.01});const a=o.points.map(c=>c.toJSON()),l=a.length;return s===l?0:(t.setVertices(a.slice(1,l-1),e),s-l)}getTerminalView(e){switch(e){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalAnchor(e){switch(e){case"source":return P.create(this.sourceAnchor);case"target":return P.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalConnectionPoint(e){switch(e){case"source":return P.create(this.sourcePoint);case"target":return P.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalMagnet(e,t={}){switch(e){case"source":{if(t.raw)return this.sourceMagnet;const r=this.sourceView;return r?this.sourceMagnet||r.container:null}case"target":{if(t.raw)return this.targetMagnet;const r=this.targetView;return r?this.targetMagnet||r.container:null}default:throw new Error(`Unknown terminal type '${e}'`)}}updateConnection(e={}){const t=this.cell;if(e.translateBy&&t.isFragmentDescendantOf(e.translateBy)){const r=e.tx||0,i=e.ty||0;this.routePoints=new He(this.routePoints).translate(r,i).points,this.translateConnectionPoints(r,i),this.path.translate(r,i)}else{const r=t.getVertices(),i=this.findAnchors(r);this.sourceAnchor=i.source,this.targetAnchor=i.target,this.routePoints=this.findRoutePoints(r);const s=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=s.source,this.targetPoint=s.target;const o=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,o.source||this.sourcePoint,o.target||this.targetPoint)}this.cleanCache()}findAnchors(e){const t=this.cell,r=t.source,i=t.target,s=e[0],o=e[e.length-1];return i.priority&&!r.priority?this.findAnchorsOrdered("target",o,"source",s):this.findAnchorsOrdered("source",s,"target",o)}findAnchorsOrdered(e,t,r,i){let s,o;const a=this.cell,l=a[e],c=a[r],u=this.getTerminalView(e),h=this.getTerminalView(r),f=this.getTerminalMagnet(e),d=this.getTerminalMagnet(r);if(u){let g;t?g=P.create(t):h?g=d:g=P.create(c),s=this.getAnchor(l.anchor,u,f,g,e)}else s=P.create(l);if(h){const g=P.create(i||s);o=this.getAnchor(c.anchor,h,d,g,r)}else o=P.isPointLike(c)?P.create(c):new P;return{[e]:s,[r]:o}}getAnchor(e,t,r,i,s){const o=t.isEdgeElement(r),a=this.graph.options.connecting;let l=typeof e=="string"?{name:e}:e;if(!l){const h=o?(s==="source"?a.sourceEdgeAnchor:a.targetEdgeAnchor)||a.edgeAnchor:(s==="source"?a.sourceAnchor:a.targetAnchor)||a.anchor;l=typeof h=="string"?{name:h}:h}if(!l)throw new Error("Anchor should be specified.");let c;const u=l.name;if(o){const h=Ts.registry.get(u);if(typeof h!="function")return Ts.registry.onNotFound(u);c=Y(h,this,t,r,i,l.args||{},s)}else{const h=As.registry.get(u);if(typeof h!="function")return As.registry.onNotFound(u);c=Y(h,this,t,r,i,l.args||{},s)}return c?c.round(this.POINT_ROUNDING):new P}findRoutePoints(e=[]){const t=this.graph.options.connecting.router||Rr.presets.normal,r=this.cell.getRouter()||t;let i;if(typeof r=="function")i=Y(r,this,e,{},this);else{const s=typeof r=="string"?r:r.name,o=typeof r=="string"?{}:r.args||{},a=s?Rr.registry.get(s):Rr.presets.normal;if(typeof a!="function")return Rr.registry.onNotFound(s);i=Y(a,this,e,o,this)}return i==null?e.map(s=>P.create(s)):i.map(s=>P.create(s))}findConnectionPoints(e,t,r){const i=this.cell,s=this.graph.options.connecting,o=i.getSource(),a=i.getTarget(),l=this.sourceView,c=this.targetView,u=e[0],h=e[e.length-1];let f;if(l&&!l.isEdgeElement(this.sourceMagnet)){const g=this.sourceMagnet||l.container,p=u||r,b=new F(p,t),m=o.connectionPoint||s.sourceConnectionPoint||s.connectionPoint;f=this.getConnectionPoint(m,l,g,b,"source")}else f=t;let d;if(c&&!c.isEdgeElement(this.targetMagnet)){const g=this.targetMagnet||c.container,p=a.connectionPoint||s.targetConnectionPoint||s.connectionPoint,b=h||t,m=new F(b,r);d=this.getConnectionPoint(p,c,g,m,"target")}else d=r;return{source:f,target:d}}getConnectionPoint(e,t,r,i,s){const o=i.end;if(e==null)return o;const a=typeof e=="string"?e:e.name,l=typeof e=="string"?{}:e.args,c=Os.registry.get(a);if(typeof c!="function")return Os.registry.onNotFound(a);const u=Y(c,this,i,t,r,l||{},s);return u?u.round(this.POINT_ROUNDING):o}findMarkerPoints(e,t,r){const i=h=>{const f=this.cell.getAttrs(),d=Object.keys(f);for(let g=0,p=d.length;g<p;g+=1){const b=f[d[g]];if(b[`${h}Marker`]||b[`${h}-marker`]){const m=b.strokeWidth||b["stroke-width"];if(m)return parseFloat(m);break}}return null},s=e[0],o=e[e.length-1];let a,l;const c=i("source");c&&(a=t.clone().move(s||r,-c));const u=i("target");return u&&(l=r.clone().move(o||t,-u)),this.sourceMarkerPoint=a||t.clone(),this.targetMarkerPoint=l||r.clone(),{source:a,target:l}}findPath(e,t,r){const i=this.cell.getConnector()||this.graph.options.connecting.connector;let s,o,a;if(typeof i=="string"?s=i:(s=i.name,o=i.args),s){const c=Ai.registry.get(s);if(typeof c!="function")return Ai.registry.onNotFound(s);a=c}else a=Ai.presets.normal;const l=Y(a,this,t,r,e,Object.assign(Object.assign({},o),{raw:!0}),this);return typeof l=="string"?W.parse(l):l}translateConnectionPoints(e,t){this.sourcePoint.translate(e,t),this.targetPoint.translate(e,t),this.sourceAnchor.translate(e,t),this.targetAnchor.translate(e,t),this.sourceMarkerPoint.translate(e,t),this.targetMarkerPoint.translate(e,t)}updateLabelPositions(){if(this.labelContainer==null)return this;if(!this.path)return this;const t=this.cell,r=t.getLabels();if(r.length===0)return this;const i=t.getDefaultLabel(),s=this.normalizeLabelPosition(i.position);for(let o=0,a=r.length;o<a;o+=1){const l=r[o],c=this.labelCache[o];if(!c)continue;const u=this.normalizeLabelPosition(l.position),h=Ie({},s,u),f=this.getLabelTransformationMatrix(h);c.setAttribute("transform",ms(f))}return this}updateTerminalProperties(e){const t=this.cell,r=this.graph,i=t[e],s=i&&i.cell,o=`${e}View`;if(!s)return this[o]=null,this.updateTerminalMagnet(e),!0;const a=r.getCellById(s);if(!a)throw new Error(`Edge's ${e} node with id "${s}" not exists`);const l=a.findView(r);return l?(this[o]=l,this.updateTerminalMagnet(e),!0):!1}updateTerminalMagnet(e){const t=`${e}Magnet`,r=this.getTerminalView(e);if(r){let i=r.getMagnetFromEdgeTerminal(this.cell[e]);i===r.container&&(i=null),this[t]=i}else this[t]=null}getLabelPositionAngle(e){const t=this.cell.getLabelAt(e);return t&&t.position&&typeof t.position=="object"&&t.position.angle||0}getLabelPositionArgs(e){const t=this.cell.getLabelAt(e);if(t&&t.position&&typeof t.position=="object")return t.position.options}getDefaultLabelPositionArgs(){const e=this.cell.getDefaultLabel();if(e&&e.position&&typeof e.position=="object")return e.position.options}mergeLabelPositionArgs(e,t){return e===null?null:e===void 0?t===null?null:t:Ie({},t,e)}getConnection(){return this.path!=null?this.path.clone():null}getConnectionPathData(){if(this.path==null)return"";const e=this.cache.pathCache;return kl(e,"data")||(e.data=this.path.serialize()),e.data||""}getConnectionSubdivisions(){if(this.path==null)return null;const e=this.cache.pathCache;return kl(e,"segmentSubdivisions")||(e.segmentSubdivisions=this.path.getSegmentSubdivisions()),e.segmentSubdivisions}getConnectionLength(){if(this.path==null)return 0;const e=this.cache.pathCache;return kl(e,"length")||(e.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),e.length}getPointAtLength(e){return this.path==null?null:this.path.pointAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(e){return this.path==null?null:(Qn(e)&&(e=parseFloat(e)/100),this.path.pointAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(e){return this.path==null?null:this.path.tangentAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(e){return this.path==null?null:this.path.tangentAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(e){return this.path==null?null:this.path.closestPoint(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(e){return this.path==null?null:this.path.closestPointLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(e){return this.path==null?null:this.path.closestPointNormalizedLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(e,t,r,i){const s={distance:0};let o=0,a;typeof r=="number"?(o=r,a=i):a=r,a!=null&&(s.options=a);const l=a&&a.absoluteOffset,c=!(a&&a.absoluteDistance),u=a&&a.absoluteDistance&&a.reverseDistance,h=this.path,f={segmentSubdivisions:this.getConnectionSubdivisions()},d=new P(e,t),g=h.closestPointT(d,f),p=this.getConnectionLength()||0;let b=h.lengthAtT(g,f);c&&(b=p>0?b/p:0),u&&(b=-1*(p-b)||1),s.distance=b;let m;l||(m=h.tangentAtT(g));let y;if(m)y=m.pointOffset(d);else{const v=h.pointAtT(g),w=d.diff(v);y={x:w.x,y:w.y}}return s.offset=y,s.angle=o,s}normalizeLabelPosition(e){return typeof e=="number"?{distance:e}:e}getLabelTransformationMatrix(e){const t=this.normalizeLabelPosition(e),r=t.options||{},i=t.angle||0,s=t.distance,o=s>0&&s<=1;let a=0;const l={x:0,y:0},c=t.offset;c&&(typeof c=="number"?a=c:(c.x!=null&&(l.x=c.x),c.y!=null&&(l.y=c.y)));const u=l.x!==0||l.y!==0||a===0,h=r.keepGradient,f=r.ensureLegibility,d=this.path,g={segmentSubdivisions:this.getConnectionSubdivisions()},p=o?s*this.getConnectionLength():s,b=d.tangentAtLength(p,g);let m,y=i;if(b){if(u)m=b.start,m.translate(l);else{const v=b.clone();v.rotate(-90,b.start),v.setLength(a),m=v.end}h&&(y=b.angle()+i,f&&(y=ve.normalize((y+90)%180-90)))}else m=d.start,u&&m.translate(l);return ct().translate(m.x,m.y).rotate(y)}getVertexIndex(e,t){const i=this.cell.getVertices(),s=this.getClosestPointLength(new P(e,t));let o=0;if(s!=null)for(const a=i.length;o<a;o+=1){const l=i[o],c=this.getClosestPointLength(l);if(c!=null&&s<c)break}return o}getEventArgs(e,t,r){const i=this,s=i.cell,o=s;return t==null||r==null?{e,view:i,edge:s,cell:o}:{e,x:t,y:r,view:i,edge:s,cell:o}}notifyUnhandledMouseDown(e,t,r){this.notify("edge:unhandled:mousedown",{e,x:t,y:r,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(e,t,r){super.onMouseDown(e,t,r),this.notify("edge:mousedown",this.getEventArgs(e,t,r))}notifyMouseMove(e,t,r){super.onMouseMove(e,t,r),this.notify("edge:mousemove",this.getEventArgs(e,t,r))}notifyMouseUp(e,t,r){super.onMouseUp(e,t,r),this.notify("edge:mouseup",this.getEventArgs(e,t,r))}onClick(e,t,r){super.onClick(e,t,r),this.notify("edge:click",this.getEventArgs(e,t,r))}onDblClick(e,t,r){super.onDblClick(e,t,r),this.notify("edge:dblclick",this.getEventArgs(e,t,r))}onContextMenu(e,t,r){super.onContextMenu(e,t,r),this.notify("edge:contextmenu",this.getEventArgs(e,t,r))}onMouseDown(e,t,r){this.notifyMouseDown(e,t,r),this.startEdgeDragging(e,t,r)}onMouseMove(e,t,r){const i=this.getEventData(e);switch(i.action){case"drag-label":{this.dragLabel(e,t,r);break}case"drag-arrowhead":{this.dragArrowhead(e,t,r);break}case"drag-edge":{this.dragEdge(e,t,r);break}}return this.notifyMouseMove(e,t,r),i}onMouseUp(e,t,r){const i=this.getEventData(e);switch(i.action){case"drag-label":{this.stopLabelDragging(e,t,r);break}case"drag-arrowhead":{this.stopArrowheadDragging(e,t,r);break}case"drag-edge":{this.stopEdgeDragging(e,t,r);break}}return this.notifyMouseUp(e,t,r),this.checkMouseleave(e),i}onMouseOver(e){super.onMouseOver(e),this.notify("edge:mouseover",this.getEventArgs(e))}onMouseOut(e){super.onMouseOut(e),this.notify("edge:mouseout",this.getEventArgs(e))}onMouseEnter(e){super.onMouseEnter(e),this.notify("edge:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("edge:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,r,i){super.onMouseWheel(e,t,r,i),this.notify("edge:mousewheel",Object.assign({delta:i},this.getEventArgs(e,t,r)))}onCustomEvent(e,t,r,i){if(h1(e.target,"edge-tool",this.container)){if(e.stopPropagation(),this.can("useEdgeTools")){if(t==="edge:remove"){this.cell.remove({ui:!0});return}this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,r,i)))}this.notifyMouseDown(e,r,i)}else this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,r,i))),super.onCustomEvent(e,t,r,i)}onLabelMouseDown(e,t,r){this.notifyMouseDown(e,t,r),this.startLabelDragging(e,t,r),this.getEventData(e).stopPropagation&&e.stopPropagation()}startEdgeDragging(e,t,r){if(!this.can("edgeMovable")){this.notifyUnhandledMouseDown(e,t,r);return}this.setEventData(e,{x:t,y:r,moving:!1,action:"drag-edge"})}dragEdge(e,t,r){const i=this.getEventData(e);i.moving||(i.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e,x:t,y:r,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(t-i.x,r-i.y,{ui:!0}),this.setEventData(e,{x:t,y:r}),this.notify("edge:moving",{e,x:t,y:r,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(e,t,r){const i=this.getEventData(e);i.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e,x:t,y:r,view:this,cell:this.cell,edge:this.cell})),i.moving=!1}prepareArrowheadDragging(e,t){const r=this.getTerminalMagnet(e),i={action:"drag-arrowhead",x:t.x,y:t.y,isNewEdge:t.isNewEdge===!0,terminalType:e,initialMagnet:r,initialTerminal:Ah(this.cell[e]),fallbackAction:t.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(e),options:t.options};return this.beforeArrowheadDragging(i),i}createValidateConnectionArgs(e){const t=[];t[4]=e,t[5]=this;let r,i=0,s=0;e==="source"?(i=2,r="target"):(s=2,r="source");const o=this.cell[r],a=o.cell;if(a){let l;const c=t[i]=this.graph.findViewByCell(a);c&&(l=c.getMagnetFromEdgeTerminal(o),l===c.container&&(l=void 0)),t[i+1]=l}return(l,c)=>(t[s]=l,t[s+1]=l.container===c?void 0:c,t)}beforeArrowheadDragging(e){e.zIndex=this.cell.zIndex,this.cell.toFront();const t=this.container.style;e.pointerEvents=t.pointerEvents,t.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(e)}afterArrowheadDragging(e){e.zIndex!=null&&(this.cell.setZIndex(e.zIndex,{ui:!0}),e.zIndex=null);const t=this.container;t.style.pointerEvents=e.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(e)}validateConnection(e,t,r,i,s,o,a){const l=this.graph.options.connecting,c=l.allowLoop,u=l.allowNode,h=l.allowEdge,f=l.allowPort,d=l.allowMulti,g=l.validateConnection,p=o?o.cell:null,b=s==="target"?r:e,m=s==="target"?i:t;let y=!0;const v=w=>{const x=s==="source"?a?a.port:null:p?p.getSourcePortId():null,C=s==="target"?a?a.port:null:p?p.getTargetPortId():null;return Y(w,this.graph,{edge:p,edgeView:o,sourceView:e,targetView:r,sourcePort:x,targetPort:C,sourceMagnet:t,targetMagnet:i,sourceCell:e?e.cell:null,targetCell:r?r.cell:null,type:s})};if(c!=null&&(typeof c=="boolean"?!c&&e===r&&(y=!1):y=v(c)),y&&f!=null&&(typeof f=="boolean"?!f&&m&&(y=!1):y=v(f)),y&&h!=null&&(typeof h=="boolean"?!h&&sr.isEdgeView(b)&&(y=!1):y=v(h)),y&&u!=null&&m==null&&(typeof u=="boolean"?!u&&kt.isNodeView(b)&&(y=!1):y=v(u)),y&&d!=null&&o){const w=o.cell,x=s==="source"?a:w.getSource(),C=s==="target"?a:w.getTarget(),S=a?this.graph.getCellById(a.cell):null;if(x&&C&&x.cell&&C.cell&&S)if(typeof d=="function")y=v(d);else{const E=this.graph.model.getConnectedEdges(S,{outgoing:s==="source",incoming:s==="target"});E.length&&(d==="withPort"?E.some(O=>{const T=O.getSource(),I=O.getTarget();return T&&I&&T.cell===x.cell&&I.cell===C.cell&&T.port!=null&&T.port===x.port&&I.port!=null&&I.port===C.port})&&(y=!1):d||E.some(O=>{const T=O.getSource(),I=O.getTarget();return T&&I&&T.cell===x.cell&&I.cell===C.cell})&&(y=!1))}}return y&&g!=null&&(y=v(g)),y}allowConnectToBlank(e){const t=this.graph,i=t.options.connecting.allowBlank;if(typeof i!="function")return!!i;const s=t.findViewByCell(e),o=e.getSourceCell(),a=e.getTargetCell(),l=t.findViewByCell(o),c=t.findViewByCell(a);return Y(i,t,{edge:e,edgeView:s,sourceCell:o,targetCell:a,sourceView:l,targetView:c,sourcePort:e.getSourcePortId(),targetPort:e.getTargetPortId(),sourceMagnet:s.sourceMagnet,targetMagnet:s.targetMagnet})}validateEdge(e,t,r){const i=this.graph;if(!this.allowConnectToBlank(e)){const o=e.getSourceCellId(),a=e.getTargetCellId();if(!(o&&a))return!1}const s=i.options.connecting.validateEdge;return s?Y(s,i,{edge:e,type:t,previous:r}):!0}arrowheadDragging(e,t,r,i){i.x=t,i.y=r,i.currentTarget!==e&&(i.currentMagnet&&i.currentView&&i.currentView.unhighlight(i.currentMagnet,{type:"magnetAdsorbed"}),i.currentView=this.graph.findViewByElem(e),i.currentView?(i.currentMagnet=i.currentView.findMagnet(e),i.currentMagnet&&this.validateConnection(...i.getValidateConnectionArgs(i.currentView,i.currentMagnet),i.currentView.getEdgeTerminal(i.currentMagnet,t,r,this.cell,i.terminalType))?i.currentView.highlight(i.currentMagnet,{type:"magnetAdsorbed"}):i.currentMagnet=null):i.currentMagnet=null),i.currentTarget=e,this.cell.prop(i.terminalType,{x:t,y:r},Object.assign(Object.assign({},i.options),{ui:!0}))}arrowheadDragged(e,t,r){const i=e.currentView,s=e.currentMagnet;if(!s||!i)return;i.unhighlight(s,{type:"magnetAdsorbed"});const o=e.terminalType,a=i.getEdgeTerminal(s,t,r,this.cell,o);this.cell.setTerminal(o,a,{ui:!0})}snapArrowhead(e,t,r){const i=this.graph,{snap:s,allowEdge:o}=i.options.connecting,a=typeof s=="object"&&s.radius||50,l=i.renderer.findViewsInArea({x:e-a,y:t-a,width:2*a,height:2*a},{nodeOnly:!0});if(o){const v=i.renderer.findEdgeViewsFromPoint({x:e,y:t},a).filter(w=>w!==this);l.push(...v)}const c=r.closestView||null,u=r.closestMagnet||null;r.closestView=null,r.closestMagnet=null;let h,f=Number.MAX_SAFE_INTEGER;const d=new P(e,t);l.forEach(v=>{if(v.container.getAttribute("magnet")!=="false"){if(v.isNodeView())h=v.cell.getBBox().getCenter().distance(d);else if(v.isEdgeView()){const w=v.getClosestPoint(d);w?h=w.distance(d):h=Number.MAX_SAFE_INTEGER}h<a&&h<f&&(u===v.container||this.validateConnection(...r.getValidateConnectionArgs(v,null),v.getEdgeTerminal(v.container,e,t,this.cell,r.terminalType)))&&(f=h,r.closestView=v,r.closestMagnet=v.container)}v.container.querySelectorAll("[magnet]").forEach(w=>{if(w.getAttribute("magnet")!=="false"){const x=v.getBBoxOfElement(w);h=d.distance(x.getCenter()),h<a&&h<f&&(u===w||this.validateConnection(...r.getValidateConnectionArgs(v,w),v.getEdgeTerminal(w,e,t,this.cell,r.terminalType)))&&(f=h,r.closestView=v,r.closestMagnet=w)}})});let g;const p=r.terminalType,b=r.closestView,m=r.closestMagnet,y=u!==m;if(c&&y&&c.unhighlight(u,{type:"magnetAdsorbed"}),b){if(!y)return;b.highlight(m,{type:"magnetAdsorbed"}),g=b.getEdgeTerminal(m,e,t,this.cell,p)}else g={x:e,y:t};this.cell.setTerminal(p,g,{},Object.assign(Object.assign({},r.options),{ui:!0}))}snapArrowheadEnd(e){const t=e.closestView,r=e.closestMagnet;t&&r&&(t.unhighlight(r,{type:"magnetAdsorbed"}),e.currentMagnet=t.findMagnet(r)),e.closestView=null,e.closestMagnet=null}finishEmbedding(e){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(e.zIndex=null)}fallbackConnection(e){switch(e.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(e.terminalType,e.initialTerminal,{ui:!0});break}}notifyConnectionEvent(e,t){const r=e.terminalType,i=e.initialTerminal,s=this.cell[r];if(s&&!Ve.equalTerminals(i,s)){const a=this.graph,l=i,c=l.cell?a.getCellById(l.cell):null,u=l.port,h=c?a.findViewByCell(c):null,f=c||e.isNewEdge?null:P.create(i).toJSON(),d=s,g=d.cell?a.getCellById(d.cell):null,p=d.port,b=g?a.findViewByCell(g):null,m=g?null:P.create(s).toJSON();this.notify("edge:connected",{e:t,previousCell:c,previousPort:u,previousView:h,previousPoint:f,currentCell:g,currentView:b,currentPort:p,currentPoint:m,previousMagnet:e.initialMagnet,currentMagnet:e.currentMagnet,edge:this.cell,view:this,type:r,isNew:e.isNewEdge})}}highlightAvailableMagnets(e){const t=this.graph,r=t.model.getCells();e.marked={};for(let i=0,s=r.length;i<s;i+=1){const o=t.findViewByCell(r[i]);if(!o||o.cell.id===this.cell.id)continue;const a=Array.prototype.slice.call(o.container.querySelectorAll("[magnet]"));o.container.getAttribute("magnet")!=="false"&&a.push(o.container);const l=a.filter(c=>this.validateConnection(...e.getValidateConnectionArgs(o,c),o.getEdgeTerminal(c,e.x,e.y,this.cell,e.terminalType)));if(l.length>0){for(let c=0,u=l.length;c<u;c+=1)o.highlight(l[c],{type:"magnetAvailable"});o.highlight(null,{type:"nodeAvailable"}),e.marked[o.cell.id]=l}}}unhighlightAvailableMagnets(e){const t=e.marked||{};Object.keys(t).forEach(r=>{const i=this.graph.findViewByCell(r);i&&(t[r].forEach(o=>{i.unhighlight(o,{type:"magnetAvailable"})}),i.unhighlight(null,{type:"nodeAvailable"}))}),e.marked=null}startArrowheadDragging(e,t,r){if(!this.can("arrowheadMovable")){this.notifyUnhandledMouseDown(e,t,r);return}const s=e.target.getAttribute("data-terminal"),o=this.prepareArrowheadDragging(s,{x:t,y:r});this.setEventData(e,o)}dragArrowhead(e,t,r){const i=this.getEventData(e);this.graph.options.connecting.snap?this.snapArrowhead(t,r,i):this.arrowheadDragging(this.getEventTarget(e),t,r,i)}stopArrowheadDragging(e,t,r){const i=this.graph,s=this.getEventData(e);i.options.connecting.snap?this.snapArrowheadEnd(s):this.arrowheadDragged(s,t,r),this.validateEdge(this.cell,s.terminalType,s.initialTerminal)?(this.finishEmbedding(s),this.notifyConnectionEvent(s,e)):this.fallbackConnection(s),this.afterArrowheadDragging(s)}startLabelDragging(e,t,r){if(this.can("edgeLabelMovable")){const i=e.currentTarget,s=parseInt(i.getAttribute("data-index"),10),o=this.getLabelPositionAngle(s),a=this.getLabelPositionArgs(s),l=this.getDefaultLabelPositionArgs(),c=this.mergeLabelPositionArgs(a,l);this.setEventData(e,{index:s,positionAngle:o,positionArgs:c,stopPropagation:!0,action:"drag-label"})}else this.setEventData(e,{stopPropagation:!0});this.graph.view.delegateDragEvents(e,this)}dragLabel(e,t,r){const i=this.getEventData(e),s=this.cell.getLabelAt(i.index),o=Ie({},s,{position:this.getLabelPosition(t,r,i.positionAngle,i.positionArgs)});this.cell.setLabelAt(i.index,o)}stopLabelDragging(e,t,r){}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNodeView=="function"&&typeof i.isEdgeView=="function"&&typeof i.confirmUpdate=="function"&&typeof i.update=="function"&&typeof i.getConnection=="function"}n.isEdgeView=e})(sr||(sr={})),sr.config({isSvgElement:!0,priority:1,bootstrap:["render","source","target"],actions:{view:["render"],markup:["render"],attrs:["update"],source:["source","update"],target:["target","update"],router:["update"],connector:["update"],labels:["labels"],defaultLabel:["labels"],tools:["tools"],vertices:["vertices","update"]}}),sr.registry.register("edge",sr,!0);var TG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class xn extends ge{get options(){return this.graph.options}constructor(e){super(),this.graph=e;const{selectors:t,fragment:r}=Ee.parseJSONMarkup(xn.markup);this.background=t.background,this.grid=t.grid,this.svg=t.svg,this.defs=t.defs,this.viewport=t.viewport,this.primer=t.primer,this.stage=t.stage,this.decorator=t.decorator,this.overlay=t.overlay,this.container=this.options.container,this.restore=xn.snapshoot(this.container),K(this.container,this.prefixClassName("graph")),jn(this.container,r),this.delegateEvents()}delegateEvents(){const e=this.constructor;return super.delegateEvents(e.events),this}guard(e,t){return e.type==="mousedown"&&e.button===2||this.options.guard&&this.options.guard(e,t)?!0:e.data&&e.data.guarded!==void 0?e.data.guarded:!(t&&t.cell&&le.isCell(t.cell)||this.svg===e.target||this.container===e.target||this.svg.contains(e.target))}findView(e){return this.graph.findViewByElem(e)}onDblClick(e){this.options.preventDefaultDblClick&&e.preventDefault();const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=this.graph.snapToGrid(t.clientX,t.clientY);r?r.onDblClick(t,i.x,i.y):this.graph.trigger("blank:dblclick",{e:t,x:i.x,y:i.y})}onClick(e){if(this.getMouseMovedCount(e)<=this.options.clickThreshold){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=this.graph.snapToGrid(t.clientX,t.clientY);r?r.onClick(t,i.x,i.y):this.graph.trigger("blank:click",{e:t,x:i.x,y:i.y})}}isPreventDefaultContextMenu(e){let t=this.options.preventDefaultContextMenu;return typeof t=="function"&&(t=Y(t,this.graph,{view:e})),t}onContextMenu(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.isPreventDefaultContextMenu(r)&&e.preventDefault(),this.guard(t,r))return;const i=this.graph.snapToGrid(t.clientX,t.clientY);r?r.onContextMenu(t,i.x,i.y):this.graph.trigger("blank:contextmenu",{e:t,x:i.x,y:i.y})}delegateDragEvents(e,t){e.data==null&&(e.data={}),this.setEventData(e,{currentView:t||null,mouseMovedCount:0,startPosition:{x:e.clientX,y:e.clientY}});const r=this.constructor;this.delegateDocumentEvents(r.documentEvents,e.data),this.undelegateEvents()}getMouseMovedCount(e){return this.getEventData(e).mouseMovedCount||0}onMouseDown(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;this.options.preventDefaultMouseDown&&e.preventDefault();const i=this.graph.snapToGrid(t.clientX,t.clientY);r?r.onMouseDown(t,i.x,i.y):(this.options.preventDefaultBlankAction&&["touchstart"].includes(t.type)&&e.preventDefault(),this.graph.trigger("blank:mousedown",{e:t,x:i.x,y:i.y})),this.delegateDragEvents(t,r)}onMouseMove(e){const t=this.getEventData(e),r=t.startPosition;if(r&&r.x===e.clientX&&r.y===e.clientY||(t.mouseMovedCount==null&&(t.mouseMovedCount=0),t.mouseMovedCount+=1,t.mouseMovedCount<=this.options.moveThreshold))return;const s=this.normalizeEvent(e),o=this.graph.snapToGrid(s.clientX,s.clientY),a=t.currentView;a?a.onMouseMove(s,o.x,o.y):this.graph.trigger("blank:mousemove",{e:s,x:o.x,y:o.y}),this.setEventData(s,t)}onMouseUp(e){this.undelegateDocumentEvents();const t=this.normalizeEvent(e),r=this.graph.snapToGrid(t.clientX,t.clientY),s=this.getEventData(e).currentView;if(s?s.onMouseUp(t,r.x,r.y):this.graph.trigger("blank:mouseup",{e:t,x:r.x,y:r.y}),!e.isPropagationStopped()){const o=new Dn(e,{type:"click",data:e.data});this.onClick(o)}e.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(!this.guard(t,r))if(r)r.onMouseOver(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseover",{e:t})}}onMouseOut(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(!this.guard(t,r))if(r)r.onMouseOut(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseout",{e:t})}}onMouseEnter(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=this.graph.findViewByElem(t.relatedTarget);if(r){if(i===r)return;r.onMouseEnter(t)}else{if(i)return;this.graph.trigger("graph:mouseenter",{e:t})}}onMouseLeave(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=this.graph.findViewByElem(t.relatedTarget);if(r){if(i===r)return;r.onMouseLeave(t)}else{if(i)return;this.graph.trigger("graph:mouseleave",{e:t})}}onMouseWheel(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=t.originalEvent,s=this.graph.snapToGrid(i.clientX,i.clientY),o=Math.max(-1,Math.min(1,i.wheelDelta||-i.detail));r?r.onMouseWheel(t,s.x,s.y,o):this.graph.trigger("blank:mousewheel",{e:t,delta:o,x:s.x,y:s.y})}onCustomEvent(e){const t=e.currentTarget,r=t.getAttribute("event")||t.getAttribute("data-event");if(r){const i=this.findView(t);if(i){const s=this.normalizeEvent(e);if(this.guard(s,i))return;const o=this.graph.snapToGrid(s.clientX,s.clientY);i.onCustomEvent(s,r,o.x,o.y)}}}handleMagnetEvent(e,t){const r=e.currentTarget,i=r.getAttribute("magnet");if(i&&i.toLowerCase()!=="false"){const s=this.findView(r);if(s){const o=this.normalizeEvent(e);if(this.guard(o,s))return;const a=this.graph.snapToGrid(o.clientX,o.clientY);Y(t,this.graph,s,o,r,a.x,a.y)}}}onMagnetMouseDown(e){this.handleMagnetEvent(e,(t,r,i,s,o)=>{t.onMagnetMouseDown(r,i,s,o)})}onMagnetDblClick(e){this.handleMagnetEvent(e,(t,r,i,s,o)=>{t.onMagnetDblClick(r,i,s,o)})}onMagnetContextMenu(e){const t=this.findView(e.target);this.isPreventDefaultContextMenu(t)&&e.preventDefault(),this.handleMagnetEvent(e,(r,i,s,o,a)=>{r.onMagnetContextMenu(i,s,o,a)})}onLabelMouseDown(e){const t=e.currentTarget,r=this.findView(t);if(r){const i=this.normalizeEvent(e);if(this.guard(i,r))return;const s=this.graph.snapToGrid(i.clientX,i.clientY);r.onLabelMouseDown(i,s.x,s.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}TG([ge.dispose()],xn.prototype,"dispose",null),function(n){const e=`${sn.prefixCls}-graph`;n.markup=[{ns:lt.xhtml,tagName:"div",selector:"background",className:`${e}-background`},{ns:lt.xhtml,tagName:"div",selector:"grid",className:`${e}-grid`},{ns:lt.svg,tagName:"svg",selector:"svg",className:`${e}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":lt.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${e}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${e}-svg-primer`},{tagName:"g",selector:"stage",className:`${e}-svg-stage`},{tagName:"g",selector:"decorator",className:`${e}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${e}-svg-overlay`}]}]}];function t(r){const i=r.cloneNode();return r.childNodes.forEach(s=>i.appendChild(s)),()=>{for(No(r);r.attributes.length>0;)r.removeAttribute(r.attributes[0].name);for(let s=0,o=i.attributes.length;s<o;s+=1){const a=i.attributes[s];r.setAttribute(a.name,a.value)}i.childNodes.forEach(s=>r.appendChild(s))}}n.snapshoot=t}(xn||(xn={})),function(n){const e=sn.prefixCls;n.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${e}-cell`]:"onMouseEnter",[`mouseleave .${e}-cell`]:"onMouseLeave",[`mouseenter .${e}-cell-tools`]:"onMouseEnter",[`mouseleave .${e}-cell-tools`]:"onMouseLeave",[`mousedown .${e}-cell [event]`]:"onCustomEvent",[`touchstart .${e}-cell [event]`]:"onCustomEvent",[`mousedown .${e}-cell [data-event]`]:"onCustomEvent",[`touchstart .${e}-cell [data-event]`]:"onCustomEvent",[`dblclick .${e}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${e}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${e}-cell image`]:"onImageDragStart",[`mousedown .${e}-edge .${e}-edge-label`]:"onLabelMouseDown",[`touchstart .${e}-edge .${e}-edge-label`]:"onLabelMouseDown"},n.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}}(xn||(xn={}));const OG=`.x6-graph {
87
87
  position: relative;
88
88
  overflow: hidden;
89
89
  outline: none;
@@ -242,7 +242,7 @@
242
242
  border: 1px solid #275fc5;
243
243
  border-radius: 2px;
244
244
  }
245
- `;class ht extends $n{get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}constructor(e){super(),this.graph=e,this.init()}init(){}}var _G=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class mf extends ht{init(){Fo("core",MG)}dispose(){Vo("core")}}_G([mf.dispose()],mf.prototype,"dispose",null);var NG=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},Qo;(function(n){function e(t){const{grid:r,panning:i,mousewheel:s,embedding:o}=t,a=NG(t,["grid","panning","mousewheel","embedding"]),l=t.container;if(l!=null)a.width==null&&(a.width=l.clientWidth),a.height==null&&(a.height=l.clientHeight);else throw new Error("Ensure the container of the graph is specified and valid");const c=Ie({},n.defaults,a),u={size:10,visible:!1};return typeof r=="number"?c.grid={size:r,visible:!1}:typeof r=="boolean"?c.grid=Object.assign(Object.assign({},u),{visible:r}):c.grid=Object.assign(Object.assign({},u),r),["panning","mousewheel","embedding"].forEach(f=>{const d=t[f];typeof d=="boolean"?c[f].enabled=d:c[f]=Object.assign(Object.assign({},c[f]),d)}),c}n.get=e})(Qo||(Qo={})),function(n){n.defaults={x:0,y:0,scaling:{min:.01,max:16},grid:{size:10,visible:!1},background:!1,panning:{enabled:!1,eventTypes:["leftMouseDown"]},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:sn.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:sn.prefix("available-magnet")}}},connecting:{snap:!1,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,allowBlank:!0,allowMulti:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",router:"normal",connector:"normal",validateConnection({type:e,sourceView:t,targetView:r}){return(e==="target"?r:t)!=null},createEdge(){return new PG}},translating:{restrict:!1},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},async:!0,virtual:!1,guard:()=>!1}}(Qo||(Qo={}));var kG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},$G=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class yf extends ht{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(e){this.grid.visible!==e&&(this.grid.visible=e,this.update())}getGridSize(){return this.grid.size}setGridSize(e){this.grid.size=Math.max(e,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(e){this.clear(),this.instance=null,Object.assign(this.grid,e),this.patterns=this.resolveGrid(e),this.update()}update(e={}){const t=this.grid.size;if(t<=1||!this.grid.visible)return this.clear();const r=this.graph.matrix(),i=this.getInstance(),s=Array.isArray(e)?e:[e];this.patterns.forEach((l,c)=>{const u=`pattern_${c}`,h=r.a||1,f=r.d||1,{update:d,markup:g}=l,p=$G(l,["update","markup"]),b=Object.assign(Object.assign(Object.assign({},p),s[c]),{sx:h,sy:f,ox:r.e||0,oy:r.f||0,width:t*h,height:t*f});i.has(u)||i.add(u,ee.create("pattern",{id:u,patternUnits:"userSpaceOnUse"},ee.createVectors(g)).node);const m=i.get(u);typeof d=="function"&&d(m.childNodes[0],b);let y=b.ox%b.width;y<0&&(y+=b.width);let v=b.oy%b.height;v<0&&(v+=b.height),he(m,{x:y,y:v,width:b.width,height:b.height})});const o=new XMLSerializer().serializeToString(i.root),a=`url(data:image/svg+xml;base64,${btoa(o)})`;this.elem.style.backgroundImage=a}getInstance(){return this.instance||(this.instance=new Or),this.instance}resolveGrid(e){if(!e)return[];const t=e.type;if(t==null)return[Object.assign(Object.assign({},Or.presets.dot),e.args)];const r=Or.registry.get(t);if(r){let i=e.args||[];return Array.isArray(i)||(i=[i]),Array.isArray(r)?r.map((s,o)=>Object.assign(Object.assign({},s),i[o])):[Object.assign(Object.assign({},r),i[0])]}return Or.registry.onNotFound(t)}dispose(){this.stopListening(),this.clear()}}kG([ht.dispose()],yf.prototype,"dispose",null);class Vw extends ht{get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get stage(){return this.graph.view.stage}init(){this.resize()}getMatrix(){const e=this.viewport.getAttribute("transform");return e!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=e),ct(this.viewportMatrix)}setMatrix(e){const t=ct(e),r=ms(t);this.viewport.setAttribute("transform",r),this.viewportMatrix=t,this.viewportTransformString=r}resize(e,t){let r=e===void 0?this.options.width:e,i=t===void 0?this.options.height:t;this.options.width=r,this.options.height=i,typeof r=="number"&&(r=Math.round(r)),typeof i=="number"&&(i=Math.round(i)),this.container.style.width=r==null?"":`${r}px`,this.container.style.height=i==null?"":`${i}px`;const s=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},s)),this}getComputedSize(){let e=this.options.width,t=this.options.height;return Ib(e)||(e=this.container.clientWidth),Ib(t)||(t=this.container.clientHeight),{width:e,height:t}}getScale(){return H4(this.getMatrix())}scale(e,t=e,r=0,i=0){if(e=this.clampScale(e),t=this.clampScale(t),r||i){const o=this.getTranslation(),a=o.tx-r*(e-1),l=o.ty-i*(t-1);(a!==o.tx||l!==o.ty)&&this.translate(a,l)}const s=this.getMatrix();return s.a=e,s.d=t,this.setMatrix(s),this.graph.trigger("scale",{sx:e,sy:t,ox:r,oy:i}),this}clampScale(e){const t=this.graph.options.scaling;return en(e,t.min||.01,t.max||16)}getZoom(){return this.getScale().sx}zoom(e,t){t=t||{};let r=e,i=e;const s=this.getScale(),o=this.getComputedSize();let a=o.width/2,l=o.height/2;if(t.absolute||(r+=s.sx,i+=s.sy),t.scaleGrid&&(r=Math.round(r/t.scaleGrid)*t.scaleGrid,i=Math.round(i/t.scaleGrid)*t.scaleGrid),t.maxScale&&(r=Math.min(t.maxScale,r),i=Math.min(t.maxScale,i)),t.minScale&&(r=Math.max(t.minScale,r),i=Math.max(t.minScale,i)),t.center&&(a=t.center.x,l=t.center.y),r=this.clampScale(r),i=this.clampScale(i),a||l){const c=this.getTranslation(),u=a-(a-c.tx)*(r/s.sx),h=l-(l-c.ty)*(i/s.sy);(u!==c.tx||h!==c.ty)&&this.translate(u,h)}return this.scale(r,i),this}getRotation(){return U4(this.getMatrix())}rotate(e,t,r){if(t==null||r==null){const s=fe.getBBox(this.stage);t=s.width/2,r=s.height/2}const i=this.getMatrix().translate(t,r).rotate(e).translate(-t,-r);return this.setMatrix(i),this}getTranslation(){return W4(this.getMatrix())}translate(e,t){const r=this.getMatrix();r.e=e||0,r.f=t||0,this.setMatrix(r);const i=this.getTranslation();return this.options.x=i.tx,this.options.y=i.ty,this.graph.trigger("translate",Object.assign({},i)),this}setOrigin(e,t){return this.translate(e||0,t||0)}fitToContent(e,t,r,i){if(typeof e=="object"){const v=e;e=v.gridWidth||1,t=v.gridHeight||1,r=v.padding||0,i=v}else e=e||1,t=t||1,r=r||0,i==null&&(i={});const s=Rn(r),o=i.border||0,a=i.contentArea?D.create(i.contentArea):this.getContentArea(i);o>0&&a.inflate(o);const l=this.getScale(),c=this.getTranslation(),u=l.sx,h=l.sy;a.x*=u,a.y*=h,a.width*=u,a.height*=h;let f=Math.max(Math.ceil((a.width+a.x)/e),1)*e,d=Math.max(Math.ceil((a.height+a.y)/t),1)*t,g=0,p=0;(i.allowNewOrigin==="negative"&&a.x<0||i.allowNewOrigin==="positive"&&a.x>=0||i.allowNewOrigin==="any")&&(g=Math.ceil(-a.x/e)*e,g+=s.left,f+=g),(i.allowNewOrigin==="negative"&&a.y<0||i.allowNewOrigin==="positive"&&a.y>=0||i.allowNewOrigin==="any")&&(p=Math.ceil(-a.y/t)*t,p+=s.top,d+=p),f+=s.right,d+=s.bottom,f=Math.max(f,i.minWidth||0),d=Math.max(d,i.minHeight||0),f=Math.min(f,i.maxWidth||Number.MAX_SAFE_INTEGER),d=Math.min(d,i.maxHeight||Number.MAX_SAFE_INTEGER);const b=this.getComputedSize(),m=f!==b.width||d!==b.height;return(g!==c.tx||p!==c.ty)&&this.translate(g,p),m&&this.resize(f,d),new D(-g/u,-p/h,f/u,d/h)}scaleContentToFit(e={}){this.scaleContentToFitImpl(e)}scaleContentToFitImpl(e={},t=!0){let r,i;if(e.contentArea){const m=e.contentArea;r=this.graph.localToGraph(m),i=P.create(m)}else r=this.getContentBBox(e),i=this.graph.graphToLocal(r);if(!r.width||!r.height)return;const s=Rn(e.padding),o=e.minScale||0,a=e.maxScale||Number.MAX_SAFE_INTEGER,l=e.minScaleX||o,c=e.maxScaleX||a,u=e.minScaleY||o,h=e.maxScaleY||a;let f;if(e.viewportArea)f=e.viewportArea;else{const m=this.getComputedSize(),y=this.getTranslation();f={x:y.tx,y:y.ty,width:m.width,height:m.height}}f=D.create(f).moveAndExpand({x:s.left,y:s.top,width:-s.left-s.right,height:-s.top-s.bottom});const d=this.getScale();let g=f.width/r.width*d.sx,p=f.height/r.height*d.sy;e.preserveAspectRatio!==!1&&(g=p=Math.min(g,p));const b=e.scaleGrid;if(b&&(g=b*Math.floor(g/b),p=b*Math.floor(p/b)),g=en(g,l,c),p=en(p,u,h),this.scale(g,p),t){const m=this.options,y=f.x-i.x*g-m.x,v=f.y-i.y*p-m.y;this.translate(y,v)}}getContentArea(e={}){return e.useCellGeometry!==!1?this.model.getAllCellsBBox()||new D:fe.getBBox(this.stage)}getContentBBox(e={}){return this.graph.localToGraph(this.getContentArea(e))}getGraphArea(){const e=D.fromSize(this.getComputedSize());return this.graph.graphToLocal(e)}zoomToRect(e,t={}){const r=D.create(e),i=this.graph;t.contentArea=r,t.viewportArea==null&&(t.viewportArea={x:i.options.x,y:i.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(t,!1);const s=r.getCenter();return this.centerPoint(s.x,s.y),this}zoomToFit(e={}){return this.zoomToRect(this.getContentArea(e),e)}centerPoint(e,t){const r=this.getComputedSize(),i=this.getScale(),s=this.getTranslation(),o=r.width/2,a=r.height/2;e=typeof e=="number"?e:o,t=typeof t=="number"?t:a,e=o-e*i.sx,t=a-t*i.sy,(s.tx!==e||s.ty!==t)&&this.translate(e,t)}centerContent(e){const r=this.graph.getContentArea(e).getCenter();this.centerPoint(r.x,r.y)}centerCell(e){return this.positionCell(e,"center")}positionPoint(e,t,r){const i=this.getComputedSize();t=Vt(t,Math.max(0,i.width)),t<0&&(t=i.width+t),r=Vt(r,Math.max(0,i.height)),r<0&&(r=i.height+r);const s=this.getTranslation(),o=this.getScale(),a=t-e.x*o.sx,l=r-e.y*o.sy;(s.tx!==a||s.ty!==l)&&this.translate(a,l)}positionRect(e,t){const r=D.create(e);switch(t){case"center":return this.positionPoint(r.getCenter(),"50%","50%");case"top":return this.positionPoint(r.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(r.getTopRight(),"100%",0);case"right":return this.positionPoint(r.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(r.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(r.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(r.getBottomLeft(),0,"100%");case"left":return this.positionPoint(r.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(r.getTopLeft(),0,0);default:return this}}positionCell(e,t){const r=e.getBBox();return this.positionRect(r,t)}positionContent(e,t){const r=this.graph.getContentArea(t);return this.positionRect(r,e)}}var IG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class lc extends ht{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(e={}){let t=e.size||"auto auto",r=e.position||"center";const i=this.graph.transform.getScale(),s=this.graph.translate();if(typeof r=="object"){const o=s.tx+i.sx*(r.x||0),a=s.ty+i.sy*(r.y||0);r=`${o}px ${a}px`}typeof t=="object"&&(t=D.fromSize(t).scale(i.sx,i.sy),t=`${t.width}px ${t.height}px`),this.elem.style.backgroundSize=t,this.elem.style.backgroundPosition=r}drawBackgroundImage(e,t={}){if(!(e instanceof HTMLImageElement)){this.elem.style.backgroundImage="";return}const r=this.optionsCache;if(r&&r.image!==t.image)return;let i;const s=t.opacity,o=t.size;let a=t.repeat||"no-repeat";const l=qo.registry.get(a);if(typeof l=="function"){const u=t.quality||1;e.width*=u,e.height*=u;const h=l(e,t);if(!(h instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");i=h.toDataURL("image/png"),t.repeat&&a!==t.repeat?a=t.repeat:a="repeat",typeof o=="object"?(o.width*=h.width/e.width,o.height*=h.height/e.height):o===void 0&&(t.size={width:h.width/u,height:h.height/u})}else i=e.src,o===void 0&&(t.size={width:e.width,height:e.height});r!=null&&typeof t.size=="object"&&t.image===r.image&&t.repeat===r.repeat&&t.quality===r.quality&&(r.size=Ah(t.size));const c=this.elem.style;c.backgroundImage=`url(${i})`,c.backgroundRepeat=a,c.opacity=s==null||s>=1?"":`${s}`,this.updateBackgroundImage(t)}updateBackgroundColor(e){this.elem.style.backgroundColor=e||""}updateBackgroundOptions(e){this.graph.options.background=e}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(e){const t=e||{};if(this.updateBackgroundOptions(e),this.updateBackgroundColor(t.color),t.image){this.optionsCache=Ah(t);const r=document.createElement("img");r.onload=()=>this.drawBackgroundImage(r,e),r.setAttribute("crossorigin","anonymous"),r.src=t.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}IG([ht.dispose()],lc.prototype,"dispose",null);var LG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class qw extends ht{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&this.widgetOptions.enabled===!0}init(){this.startListening(),this.updateClassName()}startListening(){const e=this.widgetOptions.eventTypes;e&&(e.includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),e.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),Se.on(this.graph.container,"mousedown",this.onRightMouseDown)),e.includes("mouseWheel")&&(this.mousewheelHandle=new I1(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()))}stopListening(){const e=this.widgetOptions.eventTypes;e&&(e.includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),e.includes("rightMouseDown")&&Se.off(this.graph.container,"mousedown",this.onRightMouseDown),e.includes("mouseWheel")&&this.mousewheelHandle&&this.mousewheelHandle.disable())}preparePanning({e}){const t=this.graph.getPlugin("selection"),r=t&&t.allowRubberband(e,!0);(this.allowPanning(e,!0)||this.allowPanning(e)&&!r)&&this.startPanning(e)}allowPanning(e,t){return this.pannable&&nr.isMatch(e,this.widgetOptions.modifiers,t)}startPanning(e){const t=this.view.normalizeEvent(e);this.clientX=t.clientX,this.clientY=t.clientY,this.panning=!0,this.updateClassName(),Se.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),Se.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(e){const t=this.view.normalizeEvent(e),r=t.clientX-this.clientX,i=t.clientY-this.clientY;this.clientX=t.clientX,this.clientY=t.clientY,this.graph.translateBy(r,i)}stopPanning(e){this.panning=!1,this.updateClassName(),Se.off(document.body,".panning"),Se.off(window,".panning")}updateClassName(){const e=this.view.container,t=this.view.prefixClassName("graph-panning"),r=this.view.prefixClassName("graph-pannable");this.pannable?this.panning?(J(e,t),gt(e,r)):(gt(e,t),J(e,r)):(gt(e,t),gt(e,r))}onRightMouseDown(e){e.button===2&&this.allowPanning(e,!0)&&this.startPanning(e)}allowMouseWheel(e){return this.pannable&&!e.ctrlKey}onMouseWheel(e,t,r){e.ctrlKey||this.graph.translateBy(-t,-r)}autoPanning(e,t){const i=this.graph.getGraphArea();let s=0,o=0;e<=i.left+10&&(s=-10),t<=i.top+10&&(o=-10),e>=i.right-10&&(s=10),t>=i.bottom-10&&(o=10),(s!==0||o!==0)&&this.graph.translateBy(-s,-o)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}LG([ht.dispose()],qw.prototype,"dispose",null);var RG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class vf extends ht{constructor(){super(...arguments),this.cumulatedFactor=1}get widgetOptions(){return this.options.mousewheel}init(){this.container=this.graph.container,this.target=this.widgetOptions.global?document:this.container,this.mousewheelHandle=new I1(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.widgetOptions.enabled&&this.enable(!0)}get disabled(){return this.widgetOptions.enabled!==!0}enable(e){(this.disabled||e)&&(this.widgetOptions.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.widgetOptions.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(e){const t=this.widgetOptions.guard;return(t==null||t(e))&&nr.isMatch(e,this.widgetOptions.modifiers)}onMouseWheel(e){const t=this.widgetOptions.guard;if((t==null||t(e))&&nr.isMatch(e,this.widgetOptions.modifiers)){const r=this.widgetOptions.factor||1.2;this.currentScale==null&&(this.startPos={x:e.clientX,y:e.clientY},this.currentScale=this.graph.transform.getScale().sx),e.deltaY<0?this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*r*20)/20/this.currentScale,this.cumulatedFactor===1&&(this.cumulatedFactor=1.05)):this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*(1/r)*20)/20/this.currentScale,this.cumulatedFactor===1&&(this.cumulatedFactor=.95)),this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);const s=this.currentScale;let o=this.graph.transform.clampScale(s*this.cumulatedFactor);const a=this.widgetOptions.minScale||Number.MIN_SAFE_INTEGER,l=this.widgetOptions.maxScale||Number.MAX_SAFE_INTEGER;if(o=en(o,a,l),o!==s)if(this.widgetOptions.zoomAtMousePosition){const u=!!this.graph.getPlugin("scroller")?this.graph.clientToLocal(this.startPos):this.graph.clientToGraph(this.startPos);this.graph.zoom(o,{absolute:!0,center:u.clone()})}else this.graph.zoom(o,{absolute:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}RG([$n.dispose()],vf.prototype,"dispose",null);var jG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Gw extends ht{init(){this.resetRenderArea=WV(this.resetRenderArea,200,{leading:!0}),this.resetRenderArea(),this.startListening()}startListening(){this.graph.on("translate",this.resetRenderArea,this),this.graph.on("scale",this.resetRenderArea,this),this.graph.on("resize",this.resetRenderArea,this)}stopListening(){this.graph.off("translate",this.resetRenderArea,this),this.graph.off("scale",this.resetRenderArea,this),this.graph.off("resize",this.resetRenderArea,this)}enableVirtualRender(){this.options.virtual=!0,this.resetRenderArea()}disableVirtualRender(){this.options.virtual=!1,this.graph.renderer.setRenderArea(void 0)}resetRenderArea(){if(this.options.virtual){const e=this.graph.getGraphArea();this.graph.renderer.setRenderArea(e)}}dispose(){this.stopListening()}}jG([ht.dispose()],Gw.prototype,"dispose",null);class DG{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=33,this.initialTime=Date.now()}queueJob(e){if(e.priority&or.PRIOR)e.cb();else{const t=this.findInsertionIndex(e);t>=0&&this.queue.splice(t,0,e)}}queueFlush(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.scheduleJob())}queueFlushSync(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.flushJobsSync())}clearJobs(){this.queue.length=0,this.isFlushing=!1,this.isFlushPending=!1,this.cancelScheduleJob()}flushJobs(){this.isFlushPending=!1,this.isFlushing=!0;const e=this.getCurrentTime();let t;for(;(t=this.queue.shift())&&(t.cb(),!(this.getCurrentTime()-e>=this.frameInterval)););this.isFlushing=!1,this.queue.length&&this.queueFlush()}flushJobsSync(){this.isFlushPending=!1,this.isFlushing=!0;let e;for(;e=this.queue.shift();)try{e.cb()}catch(t){console.log(t)}this.isFlushing=!1}findInsertionIndex(e){let t=0,r=this.queue.length,i=r-1;const s=e.priority;for(;t<=i;){const o=(i-t>>1)+t;s<=this.queue[o].priority?t=o+1:(r=o,i=o-1)}return r}scheduleJob(){"requestIdleCallback"in window?(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.requestIdleCallback(this.flushJobs.bind(this),{timeout:100})):(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.setTimeout(this.flushJobs.bind(this)))}cancelScheduleJob(){"cancelIdleCallback"in window?(this.scheduleId&&window.cancelIdleCallback(this.scheduleId),this.scheduleId=0):(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduleId=0)}getCurrentTime(){return typeof performance=="object"&&typeof performance.now=="function"?performance.now():Date.now()-this.initialTime}}var or;(function(n){n[n.Update=2]="Update",n[n.RenderEdge=4]="RenderEdge",n[n.RenderNode=8]="RenderNode",n[n.PRIOR=1048576]="PRIOR"})(or||(or={}));var BG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class it extends $n{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(e){super(),this.views={},this.willRemoveViews={},this.queue=new DG,this.graph=e,this.init()}init(){this.startListening(),this.renderViews(this.model.getCells())}startListening(){this.model.on("reseted",this.onModelReseted,this),this.model.on("cell:added",this.onCellAdded,this),this.model.on("cell:removed",this.onCellRemoved,this),this.model.on("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.on("cell:change:visible",this.onCellVisibleChanged,this)}stopListening(){this.model.off("reseted",this.onModelReseted,this),this.model.off("cell:added",this.onCellAdded,this),this.model.off("cell:removed",this.onCellRemoved,this),this.model.off("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.off("cell:change:visible",this.onCellVisibleChanged,this)}onModelReseted({options:e}){this.queue.clearJobs(),this.removeZPivots(),this.resetViews(),this.renderViews(this.model.getCells(),e)}onCellAdded({cell:e,options:t}){this.renderViews([e],t)}onCellRemoved({cell:e}){this.removeViews([e])}onCellZIndexChanged({cell:e,options:t}){const r=this.views[e.id];r&&this.requestViewUpdate(r.view,it.FLAG_INSERT,t,or.Update,!0)}onCellVisibleChanged({cell:e,current:t}){this.toggleVisible(e,!!t)}requestViewUpdate(e,t,r={},i=or.Update,s=!0){const o=e.cell.id,a=this.views[o];if(!a)return;a.flag=t,a.options=r,(e.hasAction(t,["translate","resize","rotate"])||r.async===!1)&&(i=or.PRIOR,s=!1),this.queue.queueJob({id:o,priority:i,cb:()=>{this.renderViewInArea(e,t,r)}}),this.getEffectedEdges(e).forEach(u=>{this.requestViewUpdate(u.view,u.flag,r,i,!1)}),s&&this.flush()}setRenderArea(e){this.renderArea=e,this.flushWaitingViews()}isViewMounted(e){if(e==null)return!1;const t=this.views[e.cell.id];return t?t.state===it.ViewState.MOUNTED:!1}renderViews(e,t={}){e.sort((r,i)=>r.isNode()&&i.isEdge()?-1:0),e.forEach(r=>{const i=r.id,s=this.views;let o=0,a=s[i];if(a)o=it.FLAG_INSERT;else{const l=this.createCellView(r);l&&(l.graph=this.graph,o=it.FLAG_INSERT|l.getBootstrapFlag(),a={view:l,flag:o,options:t,state:it.ViewState.CREATED},this.views[i]=a)}a&&this.requestViewUpdate(a.view,o,t,this.getRenderPriority(a.view),!1)}),this.flush()}renderViewInArea(e,t,r={}){const i=e.cell,s=i.id,o=this.views[s];if(!o)return;let a=0;this.isUpdatable(e)?(a=this.updateView(e,t,r),o.flag=a):o.state===it.ViewState.MOUNTED?(a=this.updateView(e,t,r),o.flag=a):o.state=it.ViewState.WAITING,a&&i.isEdge()&&!(a&e.getFlag(["source","target"]))&&this.queue.queueJob({id:s,priority:or.RenderEdge,cb:()=>{this.updateView(e,t,r)}})}removeViews(e){e.forEach(t=>{const r=t.id,i=this.views[r];i&&(this.willRemoveViews[r]=i,delete this.views[r],this.queue.queueJob({id:r,priority:this.getRenderPriority(i.view),cb:()=>{this.removeView(i.view)}}))}),this.flush()}flush(){this.graph.options.async?this.queue.queueFlush():this.queue.queueFlushSync()}flushWaitingViews(){Object.values(this.views).forEach(e=>{if(e&&e.state===it.ViewState.WAITING){const{view:t,flag:r,options:i}=e;this.requestViewUpdate(t,r,i,this.getRenderPriority(t),!1)}}),this.flush()}updateView(e,t,r={}){if(e==null)return 0;if(rt.isCellView(e)){if(t&it.FLAG_REMOVE)return this.removeView(e.cell),0;t&it.FLAG_INSERT&&(this.insertView(e),t^=it.FLAG_INSERT)}return t?e.confirmUpdate(t,r):0}insertView(e){const t=this.views[e.cell.id];if(t){const r=e.cell.getZIndex(),i=this.addZPivot(r);this.container.insertBefore(e.container,i),e.cell.isVisible()||this.toggleVisible(e.cell,!1),t.state=it.ViewState.MOUNTED,this.graph.trigger("view:mounted",{view:e})}}resetViews(){this.willRemoveViews=Object.assign(Object.assign({},this.views),this.willRemoveViews),Object.values(this.willRemoveViews).forEach(e=>{e&&this.removeView(e.view)}),this.views={},this.willRemoveViews={}}removeView(e){const t=e.cell,r=this.willRemoveViews[t.id];r&&e&&(r.view.remove(),delete this.willRemoveViews[t.id],this.graph.trigger("view:unmounted",{view:e}))}toggleVisible(e,t){const r=this.model.getConnectedEdges(e);for(let s=0,o=r.length;s<o;s+=1){const a=r[s];if(t){const l=a.getSourceCell(),c=a.getTargetCell();if(l&&!l.isVisible()||c&&!c.isVisible())continue;this.toggleVisible(a,!0)}else this.toggleVisible(a,!1)}const i=this.views[e.id];i&&pe(i.view.container,{display:t?"unset":"none"})}addZPivot(e=0){this.zPivots==null&&(this.zPivots={});const t=this.zPivots;let r=t[e];if(r)return r;r=t[e]=document.createComment(`z-index:${e+1}`);let i=-1/0;for(const o in t){const a=+o;a<e&&a>i&&(i=a,e-1)}const s=this.container;if(i!==-1/0){const o=t[i];s.insertBefore(r,o.nextSibling)}else s.insertBefore(r,s.firstChild);return r}removeZPivots(){this.zPivots&&Object.values(this.zPivots).forEach(e=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),this.zPivots={}}createCellView(e){const t={graph:this.graph},r=this.graph.options.createCellView;if(r){const s=K(r,this.graph,e);if(s)return new s(e,t);if(s===null)return null}const i=e.view;if(i!=null&&typeof i=="string"){const s=rt.registry.get(i);return s?new s(e,t):rt.registry.onNotFound(i)}return e.isNode()?new kt(e,t):e.isEdge()?new sr(e,t):null}getEffectedEdges(e){const t=[],r=e.cell,i=this.model.getConnectedEdges(r);for(let s=0,o=i.length;s<o;s+=1){const a=i[s],l=this.views[a.id];if(!l)continue;const c=l.view;if(!this.isViewMounted(c))continue;const u=["update"];a.getTargetCell()===r&&u.push("target"),a.getSourceCell()===r&&u.push("source"),t.push({id:a.id,view:c,flag:c.getFlag(u)})}return t}isUpdatable(e){if(e.isNodeView())return this.renderArea?this.renderArea.isIntersectWithRect(e.cell.getBBox()):!0;if(e.isEdgeView()){const t=e.cell,r=t.getSourceCell(),i=t.getTargetCell();if(this.renderArea&&r&&i)return this.renderArea.isIntersectWithRect(r.getBBox())||this.renderArea.isIntersectWithRect(i.getBBox())}return!0}getRenderPriority(e){return e.cell.isNode()?or.RenderNode:or.RenderEdge}dispose(){this.stopListening()}}BG([$n.dispose()],it.prototype,"dispose",null),function(n){n.FLAG_INSERT=1<<30,n.FLAG_REMOVE=1<<29,n.FLAG_RENDER=(1<<26)-1}(it||(it={})),function(n){(function(e){e[e.CREATED=0]="CREATED",e[e.MOUNTED=1]="MOUNTED",e[e.WAITING=2]="WAITING"})(n.ViewState||(n.ViewState={}))}(it||(it={}));var zG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class bf extends ht{constructor(){super(...arguments),this.schedule=new it(this.graph)}requestViewUpdate(e,t,r={}){this.schedule.requestViewUpdate(e,t,r)}isViewMounted(e){return this.schedule.isViewMounted(e)}setRenderArea(e){this.schedule.setRenderArea(e)}findViewByElem(e){if(e==null)return null;const t=this.options.container,r=typeof e=="string"?t.querySelector(e):e instanceof Element?e:e[0];if(r){const i=this.graph.view.findAttr("data-cell-id",r);if(i){const s=this.schedule.views;if(s[i])return s[i].view}}return null}findViewByCell(e){if(e==null)return null;const t=le.isCell(e)?e.id:e,r=this.schedule.views;return r[t]?r[t].view:null}findViewsFromPoint(e){const t={x:e.x,y:e.y};return this.model.getCells().map(r=>this.findViewByCell(r)).filter(r=>r!=null?fe.getBBox(r.container,{target:this.view.stage}).containsPoint(t):!1)}findEdgeViewsFromPoint(e,t=5){return this.model.getEdges().map(r=>this.findViewByCell(r)).filter(r=>{if(r!=null){const i=r.getClosestPoint(e);if(i)return i.distance(e)<=t}return!1})}findViewsInArea(e,t={}){const r=D.create(e);return this.model.getCells().map(i=>this.findViewByCell(i)).filter(i=>{if(i){if(t.nodeOnly&&!i.isNodeView())return!1;const s=fe.getBBox(i.container,{target:this.view.stage});return s.width===0?s.inflate(1,0):s.height===0&&s.inflate(0,1),t.strict?r.containsRect(s):r.isIntersectWithRect(s)}return!1})}dispose(){this.schedule.dispose()}}zG([ht.dispose()],bf.prototype,"dispose",null);var Hw=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class Uw extends ht{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(e){return this.svg.getElementById(e)!=null}filter(e){let t=e.id;const r=e.name;if(t||(t=`filter-${r}-${this.cid}-${Bh(JSON.stringify(e))}`),!this.isDefined(t)){const i=ws.registry.get(r);if(i==null)return ws.registry.onNotFound(r);const s=i(e.args||{}),o=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},e.attrs),{id:t});ee.create(Pe.sanitize(s),o).appendTo(this.defs)}return t}gradient(e){let t=e.id;const r=e.type;if(t||(t=`gradient-${r}-${this.cid}-${Bh(JSON.stringify(e))}`),!this.isDefined(t)){const s=e.stops.map(l=>{const c=l.opacity!=null&&Number.isFinite(l.opacity)?l.opacity:1;return`<stop offset="${l.offset}" stop-color="${l.color}" stop-opacity="${c}"/>`}),o=`<${r}>${s.join("")}</${r}>`,a=Object.assign({id:t},e.attrs);ee.create(o,a).appendTo(this.defs)}return t}marker(e){const{id:t,refX:r,refY:i,markerUnits:s,markerOrient:o,tagName:a,children:l}=e,c=Hw(e,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let u=t;if(u||(u=`marker-${this.cid}-${Bh(JSON.stringify(e))}`),!this.isDefined(u)){a!=="path"&&delete c.d;const h=ee.create("marker",{refX:r,refY:i,id:u,overflow:"visible",orient:o!=null?o:"auto",markerUnits:s||"userSpaceOnUse"},l?l.map(f=>{var{tagName:d}=f,g=Hw(f,["tagName"]);return ee.create(`${d}`||"path",ko(Object.assign(Object.assign({},c),g)))}):[ee.create(a||"path",ko(c))]);this.defs.appendChild(h.node)}return u}remove(e){const t=this.svg.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}}class Ww extends ht{getClientMatrix(){return ct(this.view.stage.getScreenCTM())}getClientOffset(){const e=this.view.svg.getBoundingClientRect();return new P(e.left,e.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(e,t){return(typeof e=="number"?this.clientToLocalPoint(e,t):this.clientToLocalPoint(e.x,e.y)).snapToGrid(this.graph.getGridSize())}localToGraphPoint(e,t){const r=P.create(e,t);return fe.transformPoint(r,this.graph.matrix())}localToClientPoint(e,t){const r=P.create(e,t);return fe.transformPoint(r,this.getClientMatrix())}localToPagePoint(e,t){return(typeof e=="number"?this.localToGraphPoint(e,t):this.localToGraphPoint(e)).translate(this.getPageOffset())}localToGraphRect(e,t,r,i){const s=D.create(e,t,r,i);return fe.transformRectangle(s,this.graph.matrix())}localToClientRect(e,t,r,i){const s=D.create(e,t,r,i);return fe.transformRectangle(s,this.getClientMatrix())}localToPageRect(e,t,r,i){return(typeof e=="number"?this.localToGraphRect(e,t,r,i):this.localToGraphRect(e)).translate(this.getPageOffset())}graphToLocalPoint(e,t){const r=P.create(e,t);return fe.transformPoint(r,this.graph.matrix().inverse())}clientToLocalPoint(e,t){const r=P.create(e,t);return fe.transformPoint(r,this.getClientMatrix().inverse())}clientToGraphPoint(e,t){const r=P.create(e,t);return fe.transformPoint(r,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(e,t){const i=P.create(e,t).diff(this.getPageOffset());return this.graphToLocalPoint(i)}graphToLocalRect(e,t,r,i){const s=D.create(e,t,r,i);return fe.transformRectangle(s,this.graph.matrix().inverse())}clientToLocalRect(e,t,r,i){const s=D.create(e,t,r,i);return fe.transformRectangle(s,this.getClientMatrix().inverse())}clientToGraphRect(e,t,r,i){const s=D.create(e,t,r,i);return fe.transformRectangle(s,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(e,t,r,i){const s=D.create(e,t,r,i),o=this.getPageOffset();return s.x-=o.x,s.y-=o.y,this.graphToLocalRect(s)}}var FG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class cc extends ht{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:e,magnet:t,options:r={}}){const i=this.resolveHighlighter(r);if(!i)return;const s=this.getHighlighterId(t,i);if(!this.highlights[s]){const o=i.highlighter;o.highlight(e,t,Object.assign({},i.args)),this.highlights[s]={cellView:e,magnet:t,highlighter:o,args:i.args}}}onCellUnhighlight({magnet:e,options:t={}}){const r=this.resolveHighlighter(t);if(!r)return;const i=this.getHighlighterId(e,r);this.unhighlight(i)}resolveHighlighter(e){const t=this.options;let r=e.highlighter;if(r==null){const a=e.type;r=a&&t.highlighting[a]||t.highlighting.default}if(r==null)return null;const i=typeof r=="string"?{name:r}:r,s=i.name,o=rr.registry.get(s);return o==null?rr.registry.onNotFound(s):(rr.check(s,o),{name:s,highlighter:o,args:i.args||{}})}getHighlighterId(e,t){return Gh(e),t.name+e.id+JSON.stringify(t.args)}unhighlight(e){const t=this.highlights[e];t&&(t.highlighter.unhighlight(t.cellView,t.magnet,t.args),delete this.highlights[e])}dispose(){Object.keys(this.highlights).forEach(e=>this.unhighlight(e)),this.stopListening()}}FG([cc.dispose()],cc.prototype,"dispose",null);var VG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Xw extends ht{getScroller(){const e=this.graph.getPlugin("scroller");return e&&e.options.enabled?e:null}getContainer(){const e=this.getScroller();return e?e.container.parentElement:this.graph.container.parentElement}getSensorTarget(){const e=this.options.autoResize;if(e)return typeof e=="boolean"?this.getContainer():e}init(){if(this.options.autoResize){const t=this.getSensorTarget();t&&Vl.bind(t,()=>{const r=t.offsetWidth,i=t.offsetHeight;this.resize(r,i)})}}resize(e,t){const r=this.getScroller();r?r.resize(e,t):this.graph.transform.resize(e,t)}dispose(){Vl.clear(this.graph.container)}}VG([ht.dispose()],Xw.prototype,"dispose",null);var qG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let V=class BO extends wt{get container(){return this.options.container}get[Symbol.toStringTag](){return BO.toStringTag}constructor(e){super(),this.installedPlugins=new Set,this.options=Qo.get(e),this.css=new mf(this),this.view=new xn(this),this.defs=new Uw(this),this.coord=new Ww(this),this.transform=new Vw(this),this.highlight=new cc(this),this.grid=new yf(this),this.background=new lc(this),this.options.model?this.model=this.options.model:(this.model=new zn,this.model.graph=this),this.renderer=new bf(this),this.panning=new qw(this),this.mousewheel=new vf(this),this.virtualRender=new Gw(this),this.size=new Xw(this)}isNode(e){return e.isNode()}isEdge(e){return e.isEdge()}resetCells(e,t={}){return this.model.resetCells(e,t),this}clearCells(e={}){return this.model.clear(e),this}toJSON(e={}){return this.model.toJSON(e)}parseJSON(e){return this.model.parseJSON(e)}fromJSON(e,t={}){return this.model.fromJSON(e,t),this}getCellById(e){return this.model.getCell(e)}addNode(e,t={}){return this.model.addNode(e,t)}addNodes(e,t={}){return this.addCell(e.map(r=>We.isNode(r)?r:this.createNode(r)),t)}createNode(e){return this.model.createNode(e)}removeNode(e,t={}){return this.model.removeCell(e,t)}addEdge(e,t={}){return this.model.addEdge(e,t)}addEdges(e,t={}){return this.addCell(e.map(r=>Ve.isEdge(r)?r:this.createEdge(r)),t)}removeEdge(e,t={}){return this.model.removeCell(e,t)}createEdge(e){return this.model.createEdge(e)}addCell(e,t={}){return this.model.addCell(e,t),this}removeCell(e,t={}){return this.model.removeCell(e,t)}removeCells(e,t={}){return this.model.removeCells(e,t)}removeConnectedEdges(e,t={}){return this.model.removeConnectedEdges(e,t)}disconnectConnectedEdges(e,t={}){return this.model.disconnectConnectedEdges(e,t),this}hasCell(e){return this.model.has(e)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(e){return this.model.getOutgoingEdges(e)}getIncomingEdges(e){return this.model.getIncomingEdges(e)}getConnectedEdges(e,t={}){return this.model.getConnectedEdges(e,t)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(e){return this.model.isRoot(e)}isLeafNode(e){return this.model.isLeaf(e)}getNeighbors(e,t={}){return this.model.getNeighbors(e,t)}isNeighbor(e,t,r={}){return this.model.isNeighbor(e,t,r)}getSuccessors(e,t={}){return this.model.getSuccessors(e,t)}isSuccessor(e,t,r={}){return this.model.isSuccessor(e,t,r)}getPredecessors(e,t={}){return this.model.getPredecessors(e,t)}isPredecessor(e,t,r={}){return this.model.isPredecessor(e,t,r)}getCommonAncestor(...e){return this.model.getCommonAncestor(...e)}getSubGraph(e,t={}){return this.model.getSubGraph(e,t)}cloneSubGraph(e,t={}){return this.model.cloneSubGraph(e,t)}cloneCells(e){return this.model.cloneCells(e)}getNodesFromPoint(e,t){return this.model.getNodesFromPoint(e,t)}getNodesInArea(e,t,r,i,s){return this.model.getNodesInArea(e,t,r,i,s)}getNodesUnderNode(e,t={}){return this.model.getNodesUnderNode(e,t)}searchCell(e,t,r={}){return this.model.search(e,t,r),this}getShortestPath(e,t,r={}){return this.model.getShortestPath(e,t,r)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(e,t={}){return this.model.getCellsBBox(e,t)}startBatch(e,t={}){this.model.startBatch(e,t)}stopBatch(e,t={}){this.model.stopBatch(e,t)}batchUpdate(e,t,r){const i=typeof e=="string"?e:"update",s=typeof e=="string"?t:e,o=typeof t=="function"?r:t;this.startBatch(i,o);const a=s();return this.stopBatch(i,o),a}updateCellId(e,t){return this.model.updateCellId(e,t)}findView(e){return le.isCell(e)?this.findViewByCell(e):this.findViewByElem(e)}findViews(e){return D.isRectangleLike(e)?this.findViewsInArea(e):P.isPointLike(e)?this.findViewsFromPoint(e):[]}findViewByCell(e){return this.renderer.findViewByCell(e)}findViewByElem(e){return this.renderer.findViewByElem(e)}findViewsFromPoint(e,t){const r=typeof e=="number"?{x:e,y:t}:e;return this.renderer.findViewsFromPoint(r)}findViewsInArea(e,t,r,i,s){const o=typeof e=="number"?{x:e,y:t,width:r,height:i}:e,a=typeof e=="number"?s:t;return this.renderer.findViewsInArea(o,a)}matrix(e){return typeof e=="undefined"?this.transform.getMatrix():(this.transform.setMatrix(e),this)}resize(e,t){const r=this.getPlugin("scroller");return r?r.resize(e,t):this.transform.resize(e,t),this}scale(e,t=e,r=0,i=0){return typeof e=="undefined"?this.transform.getScale():(this.transform.scale(e,t,r,i),this)}zoom(e,t){const r=this.getPlugin("scroller");if(r){if(typeof e=="undefined")return r.zoom();r.zoom(e,t)}else{if(typeof e=="undefined")return this.transform.getZoom();this.transform.zoom(e,t)}return this}zoomTo(e,t={}){const r=this.getPlugin("scroller");return r?r.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})):this.transform.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})),this}zoomToRect(e,t={}){const r=this.getPlugin("scroller");return r?r.zoomToRect(e,t):this.transform.zoomToRect(e,t),this}zoomToFit(e={}){const t=this.getPlugin("scroller");return t?t.zoomToFit(e):this.transform.zoomToFit(e),this}rotate(e,t,r){return typeof e=="undefined"?this.transform.getRotation():(this.transform.rotate(e,t,r),this)}translate(e,t){return typeof e=="undefined"?this.transform.getTranslation():(this.transform.translate(e,t),this)}translateBy(e,t){const r=this.translate(),i=r.tx+e,s=r.ty+t;return this.translate(i,s)}getGraphArea(){return this.transform.getGraphArea()}getContentArea(e={}){return this.transform.getContentArea(e)}getContentBBox(e={}){return this.transform.getContentBBox(e)}fitToContent(e,t,r,i){return this.transform.fitToContent(e,t,r,i)}scaleContentToFit(e={}){return this.transform.scaleContentToFit(e),this}center(e){return this.centerPoint(e)}centerPoint(e,t,r){const i=this.getPlugin("scroller");return i?i.centerPoint(e,t,r):this.transform.centerPoint(e,t),this}centerContent(e){const t=this.getPlugin("scroller");return t?t.centerContent(e):this.transform.centerContent(e),this}centerCell(e,t){const r=this.getPlugin("scroller");return r?r.centerCell(e,t):this.transform.centerCell(e),this}positionPoint(e,t,r,i={}){const s=this.getPlugin("scroller");return s?s.positionPoint(e,t,r,i):this.transform.positionPoint(e,t,r),this}positionRect(e,t,r){const i=this.getPlugin("scroller");return i?i.positionRect(e,t,r):this.transform.positionRect(e,t),this}positionCell(e,t,r){const i=this.getPlugin("scroller");return i?i.positionCell(e,t,r):this.transform.positionCell(e,t),this}positionContent(e,t){const r=this.getPlugin("scroller");return r?r.positionContent(e,t):this.transform.positionContent(e,t),this}snapToGrid(e,t){return this.coord.snapToGrid(e,t)}pageToLocal(e,t,r,i){return D.isRectangleLike(e)?this.coord.pageToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.pageToLocalRect(e,t,r,i):this.coord.pageToLocalPoint(e,t)}localToPage(e,t,r,i){return D.isRectangleLike(e)?this.coord.localToPageRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.localToPageRect(e,t,r,i):this.coord.localToPagePoint(e,t)}clientToLocal(e,t,r,i){return D.isRectangleLike(e)?this.coord.clientToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.clientToLocalRect(e,t,r,i):this.coord.clientToLocalPoint(e,t)}localToClient(e,t,r,i){return D.isRectangleLike(e)?this.coord.localToClientRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.localToClientRect(e,t,r,i):this.coord.localToClientPoint(e,t)}localToGraph(e,t,r,i){return D.isRectangleLike(e)?this.coord.localToGraphRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.localToGraphRect(e,t,r,i):this.coord.localToGraphPoint(e,t)}graphToLocal(e,t,r,i){return D.isRectangleLike(e)?this.coord.graphToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.graphToLocalRect(e,t,r,i):this.coord.graphToLocalPoint(e,t)}clientToGraph(e,t,r,i){return D.isRectangleLike(e)?this.coord.clientToGraphRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.clientToGraphRect(e,t,r,i):this.coord.clientToGraphPoint(e,t)}defineFilter(e){return this.defs.filter(e)}defineGradient(e){return this.defs.gradient(e)}defineMarker(e){return this.defs.marker(e)}getGridSize(){return this.grid.getGridSize()}setGridSize(e){return this.grid.setGridSize(e),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(e){return this.grid.draw(e),this}updateBackground(){return this.background.update(),this}drawBackground(e,t){const r=this.getPlugin("scroller");return r!=null&&(this.options.background==null||!t)?r.drawBackground(e,t):this.background.draw(e),this}clearBackground(e){const t=this.getPlugin("scroller");return t!=null&&(this.options.background==null||!e)?t.clearBackground(e):this.background.clear(),this}enableVirtualRender(){return this.virtualRender.enableVirtualRender(),this}disableVirtualRender(){return this.virtualRender.disableVirtualRender(),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(e){return e==null?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():e?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const e=this.getPlugin("scroller");return e?e.isPannable():this.panning.pannable}enablePanning(){const e=this.getPlugin("scroller");return e?e.enablePanning():this.panning.enablePanning(),this}disablePanning(){const e=this.getPlugin("scroller");return e?e.disablePanning():this.panning.disablePanning(),this}togglePanning(e){return e==null?this.isPannable()?this.disablePanning():this.enablePanning():e!==this.isPannable()&&(e?this.enablePanning():this.disablePanning()),this}use(e,...t){return this.installedPlugins.has(e)||(this.installedPlugins.add(e),e.init(this,...t)),this}getPlugin(e){return Array.from(this.installedPlugins).find(t=>t.name===e)}getPlugins(e){return Array.from(this.installedPlugins).filter(t=>e.includes(t.name))}enablePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const r=this.getPlugins(t);return r==null||r.forEach(i=>{var s;(s=i==null?void 0:i.enable)===null||s===void 0||s.call(i)}),this}disablePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const r=this.getPlugins(t);return r==null||r.forEach(i=>{var s;(s=i==null?void 0:i.disable)===null||s===void 0||s.call(i)}),this}isPluginEnabled(e){var t;const r=this.getPlugin(e);return(t=r==null?void 0:r.isEnabled)===null||t===void 0?void 0:t.call(r)}disposePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const r=this.getPlugins(t);return r==null||r.forEach(i=>{i.dispose()}),this}dispose(){this.clearCells(),this.off(),this.css.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.highlight.dispose(),this.background.dispose(),this.mousewheel.dispose(),this.panning.dispose(),this.view.dispose(),this.renderer.dispose(),this.installedPlugins.forEach(e=>{e.dispose()})}};qG([wt.dispose()],V.prototype,"dispose",null),function(n){n.View=xn,n.Renderer=bf,n.MouseWheel=vf,n.DefsManager=Uw,n.GridManager=yf,n.CoordManager=Ww,n.TransformManager=Vw,n.HighlightManager=cc,n.BackgroundManager=lc}(V||(V={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag];return r==null||r===n.toStringTag}n.isGraph=e}(V||(V={})),function(n){function e(t,r){const i=t instanceof HTMLElement?new n({container:t}):new n(t);return r!=null&&i.fromJSON(r),i}n.render=e}(V||(V={})),function(n){n.registerNode=We.registry.register,n.registerEdge=Ve.registry.register,n.registerView=rt.registry.register,n.registerAttr=Bn.registry.register,n.registerGrid=Or.registry.register,n.registerFilter=ws.registry.register,n.registerNodeTool=Ps.registry.register,n.registerEdgeTool=Es.registry.register,n.registerBackground=qo.registry.register,n.registerHighlighter=rr.registry.register,n.registerPortLayout=Ei.registry.register,n.registerPortLabelLayout=Cs.registry.register,n.registerMarker=Nr.registry.register,n.registerRouter=Rr.registry.register,n.registerConnector=Ai.registry.register,n.registerAnchor=As.registry.register,n.registerEdgeAnchor=Ts.registry.register,n.registerConnectionPoint=Os.registry.register}(V||(V={})),function(n){n.unregisterNode=We.registry.unregister,n.unregisterEdge=Ve.registry.unregister,n.unregisterView=rt.registry.unregister,n.unregisterAttr=Bn.registry.unregister,n.unregisterGrid=Or.registry.unregister,n.unregisterFilter=ws.registry.unregister,n.unregisterNodeTool=Ps.registry.unregister,n.unregisterEdgeTool=Es.registry.unregister,n.unregisterBackground=qo.registry.unregister,n.unregisterHighlighter=rr.registry.unregister,n.unregisterPortLayout=Ei.registry.unregister,n.unregisterPortLabelLayout=Cs.registry.unregister,n.unregisterMarker=Nr.registry.unregister,n.unregisterRouter=Rr.registry.unregister,n.unregisterConnector=Ai.registry.unregister,n.unregisterAnchor=As.registry.unregister,n.unregisterEdgeAnchor=Ts.registry.unregister,n.unregisterConnectionPoint=Os.registry.unregister}(V||(V={}));var GG=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class $s extends We{}(function(n){class e extends kt{init(){super.init(),this.cell.on("change:*",({key:r})=>{const i=n.shapeMaps[this.cell.shape];if(i){const{effect:s}=i;(!s||s.includes(r))&&this.renderHTMLComponent()}})}confirmUpdate(r){const i=super.confirmUpdate(r);return this.handleAction(i,e.action,()=>this.renderHTMLComponent())}renderHTMLComponent(){const r=this.selectors&&this.selectors.foContent;if(r){_o(r);const i=n.shapeMaps[this.cell.shape];if(!i)return;let{html:s}=i;typeof s=="function"&&(s=s(this.cell)),s&&(typeof s=="string"?r.innerHTML=s:jn(r,s))}}}n.View=e,function(t){t.action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),kt.registry.register("html-view",t,!0)}(e=n.View||(n.View={}))})($s||($s={})),function(n){n.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},Pe.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),We.registry.register("html",n,!0)}($s||($s={})),function(n){n.shapeMaps={};function e(t){const{shape:r,html:i,effect:s,inherit:o}=t,a=GG(t,["shape","html","effect","inherit"]);if(!r)throw new Error("should specify shape in config");n.shapeMaps[r]={html:i,effect:s},V.registerNode(r,Object.assign({inherit:o||"html"},a),!0)}n.register=e}($s||($s={}));const HG=`.x6-widget-minimap {
245
+ `;class ht extends $n{get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}constructor(e){super(),this.graph=e,this.init()}init(){}}var MG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class mf extends ht{init(){Vo("core",OG)}dispose(){qo("core")}}MG([mf.dispose()],mf.prototype,"dispose",null);var _G=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},Zo;(function(n){function e(t){const{grid:r,panning:i,mousewheel:s,embedding:o}=t,a=_G(t,["grid","panning","mousewheel","embedding"]),l=t.container;if(l!=null)a.width==null&&(a.width=l.clientWidth),a.height==null&&(a.height=l.clientHeight);else throw new Error("Ensure the container of the graph is specified and valid");const c=Ie({},n.defaults,a),u={size:10,visible:!1};return typeof r=="number"?c.grid={size:r,visible:!1}:typeof r=="boolean"?c.grid=Object.assign(Object.assign({},u),{visible:r}):c.grid=Object.assign(Object.assign({},u),r),["panning","mousewheel","embedding"].forEach(f=>{const d=t[f];typeof d=="boolean"?c[f].enabled=d:c[f]=Object.assign(Object.assign({},c[f]),d)}),c}n.get=e})(Zo||(Zo={})),function(n){n.defaults={x:0,y:0,scaling:{min:.01,max:16},grid:{size:10,visible:!1},background:!1,panning:{enabled:!1,eventTypes:["leftMouseDown"]},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:sn.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:sn.prefix("available-magnet")}}},connecting:{snap:!1,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,allowBlank:!0,allowMulti:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",router:"normal",connector:"normal",validateConnection({type:e,sourceView:t,targetView:r}){return(e==="target"?r:t)!=null},createEdge(){return new SG}},translating:{restrict:!1},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},async:!0,virtual:!1,guard:()=>!1}}(Zo||(Zo={}));var NG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},kG=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class yf extends ht{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(e){this.grid.visible!==e&&(this.grid.visible=e,this.update())}getGridSize(){return this.grid.size}setGridSize(e){this.grid.size=Math.max(e,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(e){this.clear(),this.instance=null,Object.assign(this.grid,e),this.patterns=this.resolveGrid(e),this.update()}update(e={}){const t=this.grid.size;if(t<=1||!this.grid.visible)return this.clear();const r=this.graph.matrix(),i=this.getInstance(),s=Array.isArray(e)?e:[e];this.patterns.forEach((l,c)=>{const u=`pattern_${c}`,h=r.a||1,f=r.d||1,{update:d,markup:g}=l,p=kG(l,["update","markup"]),b=Object.assign(Object.assign(Object.assign({},p),s[c]),{sx:h,sy:f,ox:r.e||0,oy:r.f||0,width:t*h,height:t*f});i.has(u)||i.add(u,ee.create("pattern",{id:u,patternUnits:"userSpaceOnUse"},ee.createVectors(g)).node);const m=i.get(u);typeof d=="function"&&d(m.childNodes[0],b);let y=b.ox%b.width;y<0&&(y+=b.width);let v=b.oy%b.height;v<0&&(v+=b.height),fe(m,{x:y,y:v,width:b.width,height:b.height})});const o=new XMLSerializer().serializeToString(i.root),a=`url(data:image/svg+xml;base64,${btoa(o)})`;this.elem.style.backgroundImage=a}getInstance(){return this.instance||(this.instance=new Or),this.instance}resolveGrid(e){if(!e)return[];const t=e.type;if(t==null)return[Object.assign(Object.assign({},Or.presets.dot),e.args)];const r=Or.registry.get(t);if(r){let i=e.args||[];return Array.isArray(i)||(i=[i]),Array.isArray(r)?r.map((s,o)=>Object.assign(Object.assign({},s),i[o])):[Object.assign(Object.assign({},r),i[0])]}return Or.registry.onNotFound(t)}dispose(){this.stopListening(),this.clear()}}NG([ht.dispose()],yf.prototype,"dispose",null);class Fw extends ht{get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get stage(){return this.graph.view.stage}init(){this.resize()}getMatrix(){const e=this.viewport.getAttribute("transform");return e!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=e),ct(this.viewportMatrix)}setMatrix(e){const t=ct(e),r=ms(t);this.viewport.setAttribute("transform",r),this.viewportMatrix=t,this.viewportTransformString=r}resize(e,t){let r=e===void 0?this.options.width:e,i=t===void 0?this.options.height:t;this.options.width=r,this.options.height=i,typeof r=="number"&&(r=Math.round(r)),typeof i=="number"&&(i=Math.round(i)),this.container.style.width=r==null?"":`${r}px`,this.container.style.height=i==null?"":`${i}px`;const s=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},s)),this}getComputedSize(){let e=this.options.width,t=this.options.height;return $b(e)||(e=this.container.clientWidth),$b(t)||(t=this.container.clientHeight),{width:e,height:t}}getScale(){return G4(this.getMatrix())}scale(e,t=e,r=0,i=0){if(e=this.clampScale(e),t=this.clampScale(t),r||i){const o=this.getTranslation(),a=o.tx-r*(e-1),l=o.ty-i*(t-1);(a!==o.tx||l!==o.ty)&&this.translate(a,l)}const s=this.getMatrix();return s.a=e,s.d=t,this.setMatrix(s),this.graph.trigger("scale",{sx:e,sy:t,ox:r,oy:i}),this}clampScale(e){const t=this.graph.options.scaling;return en(e,t.min||.01,t.max||16)}getZoom(){return this.getScale().sx}zoom(e,t){t=t||{};let r=e,i=e;const s=this.getScale(),o=this.getComputedSize();let a=o.width/2,l=o.height/2;if(t.absolute||(r+=s.sx,i+=s.sy),t.scaleGrid&&(r=Math.round(r/t.scaleGrid)*t.scaleGrid,i=Math.round(i/t.scaleGrid)*t.scaleGrid),t.maxScale&&(r=Math.min(t.maxScale,r),i=Math.min(t.maxScale,i)),t.minScale&&(r=Math.max(t.minScale,r),i=Math.max(t.minScale,i)),t.center&&(a=t.center.x,l=t.center.y),r=this.clampScale(r),i=this.clampScale(i),a||l){const c=this.getTranslation(),u=a-(a-c.tx)*(r/s.sx),h=l-(l-c.ty)*(i/s.sy);(u!==c.tx||h!==c.ty)&&this.translate(u,h)}return this.scale(r,i),this}getRotation(){return H4(this.getMatrix())}rotate(e,t,r){if(t==null||r==null){const s=de.getBBox(this.stage);t=s.width/2,r=s.height/2}const i=this.getMatrix().translate(t,r).rotate(e).translate(-t,-r);return this.setMatrix(i),this}getTranslation(){return U4(this.getMatrix())}translate(e,t){const r=this.getMatrix();r.e=e||0,r.f=t||0,this.setMatrix(r);const i=this.getTranslation();return this.options.x=i.tx,this.options.y=i.ty,this.graph.trigger("translate",Object.assign({},i)),this}setOrigin(e,t){return this.translate(e||0,t||0)}fitToContent(e,t,r,i){if(typeof e=="object"){const v=e;e=v.gridWidth||1,t=v.gridHeight||1,r=v.padding||0,i=v}else e=e||1,t=t||1,r=r||0,i==null&&(i={});const s=Rn(r),o=i.border||0,a=i.contentArea?D.create(i.contentArea):this.getContentArea(i);o>0&&a.inflate(o);const l=this.getScale(),c=this.getTranslation(),u=l.sx,h=l.sy;a.x*=u,a.y*=h,a.width*=u,a.height*=h;let f=Math.max(Math.ceil((a.width+a.x)/e),1)*e,d=Math.max(Math.ceil((a.height+a.y)/t),1)*t,g=0,p=0;(i.allowNewOrigin==="negative"&&a.x<0||i.allowNewOrigin==="positive"&&a.x>=0||i.allowNewOrigin==="any")&&(g=Math.ceil(-a.x/e)*e,g+=s.left,f+=g),(i.allowNewOrigin==="negative"&&a.y<0||i.allowNewOrigin==="positive"&&a.y>=0||i.allowNewOrigin==="any")&&(p=Math.ceil(-a.y/t)*t,p+=s.top,d+=p),f+=s.right,d+=s.bottom,f=Math.max(f,i.minWidth||0),d=Math.max(d,i.minHeight||0),f=Math.min(f,i.maxWidth||Number.MAX_SAFE_INTEGER),d=Math.min(d,i.maxHeight||Number.MAX_SAFE_INTEGER);const b=this.getComputedSize(),m=f!==b.width||d!==b.height;return(g!==c.tx||p!==c.ty)&&this.translate(g,p),m&&this.resize(f,d),new D(-g/u,-p/h,f/u,d/h)}scaleContentToFit(e={}){this.scaleContentToFitImpl(e)}scaleContentToFitImpl(e={},t=!0){let r,i;if(e.contentArea){const m=e.contentArea;r=this.graph.localToGraph(m),i=P.create(m)}else r=this.getContentBBox(e),i=this.graph.graphToLocal(r);if(!r.width||!r.height)return;const s=Rn(e.padding),o=e.minScale||0,a=e.maxScale||Number.MAX_SAFE_INTEGER,l=e.minScaleX||o,c=e.maxScaleX||a,u=e.minScaleY||o,h=e.maxScaleY||a;let f;if(e.viewportArea)f=e.viewportArea;else{const m=this.getComputedSize(),y=this.getTranslation();f={x:y.tx,y:y.ty,width:m.width,height:m.height}}f=D.create(f).moveAndExpand({x:s.left,y:s.top,width:-s.left-s.right,height:-s.top-s.bottom});const d=this.getScale();let g=f.width/r.width*d.sx,p=f.height/r.height*d.sy;e.preserveAspectRatio!==!1&&(g=p=Math.min(g,p));const b=e.scaleGrid;if(b&&(g=b*Math.floor(g/b),p=b*Math.floor(p/b)),g=en(g,l,c),p=en(p,u,h),this.scale(g,p),t){const m=this.options,y=f.x-i.x*g-m.x,v=f.y-i.y*p-m.y;this.translate(y,v)}}getContentArea(e={}){return e.useCellGeometry!==!1?this.model.getAllCellsBBox()||new D:de.getBBox(this.stage)}getContentBBox(e={}){return this.graph.localToGraph(this.getContentArea(e))}getGraphArea(){const e=D.fromSize(this.getComputedSize());return this.graph.graphToLocal(e)}zoomToRect(e,t={}){const r=D.create(e),i=this.graph;t.contentArea=r,t.viewportArea==null&&(t.viewportArea={x:i.options.x,y:i.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(t,!1);const s=r.getCenter();return this.centerPoint(s.x,s.y),this}zoomToFit(e={}){return this.zoomToRect(this.getContentArea(e),e)}centerPoint(e,t){const r=this.getComputedSize(),i=this.getScale(),s=this.getTranslation(),o=r.width/2,a=r.height/2;e=typeof e=="number"?e:o,t=typeof t=="number"?t:a,e=o-e*i.sx,t=a-t*i.sy,(s.tx!==e||s.ty!==t)&&this.translate(e,t)}centerContent(e){const r=this.graph.getContentArea(e).getCenter();this.centerPoint(r.x,r.y)}centerCell(e){return this.positionCell(e,"center")}positionPoint(e,t,r){const i=this.getComputedSize();t=Vt(t,Math.max(0,i.width)),t<0&&(t=i.width+t),r=Vt(r,Math.max(0,i.height)),r<0&&(r=i.height+r);const s=this.getTranslation(),o=this.getScale(),a=t-e.x*o.sx,l=r-e.y*o.sy;(s.tx!==a||s.ty!==l)&&this.translate(a,l)}positionRect(e,t){const r=D.create(e);switch(t){case"center":return this.positionPoint(r.getCenter(),"50%","50%");case"top":return this.positionPoint(r.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(r.getTopRight(),"100%",0);case"right":return this.positionPoint(r.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(r.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(r.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(r.getBottomLeft(),0,"100%");case"left":return this.positionPoint(r.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(r.getTopLeft(),0,0);default:return this}}positionCell(e,t){const r=e.getBBox();return this.positionRect(r,t)}positionContent(e,t){const r=this.graph.getContentArea(t);return this.positionRect(r,e)}}var $G=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class lc extends ht{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(e={}){let t=e.size||"auto auto",r=e.position||"center";const i=this.graph.transform.getScale(),s=this.graph.translate();if(typeof r=="object"){const o=s.tx+i.sx*(r.x||0),a=s.ty+i.sy*(r.y||0);r=`${o}px ${a}px`}typeof t=="object"&&(t=D.fromSize(t).scale(i.sx,i.sy),t=`${t.width}px ${t.height}px`),this.elem.style.backgroundSize=t,this.elem.style.backgroundPosition=r}drawBackgroundImage(e,t={}){if(!(e instanceof HTMLImageElement)){this.elem.style.backgroundImage="";return}const r=this.optionsCache;if(r&&r.image!==t.image)return;let i;const s=t.opacity,o=t.size;let a=t.repeat||"no-repeat";const l=Go.registry.get(a);if(typeof l=="function"){const u=t.quality||1;e.width*=u,e.height*=u;const h=l(e,t);if(!(h instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");i=h.toDataURL("image/png"),t.repeat&&a!==t.repeat?a=t.repeat:a="repeat",typeof o=="object"?(o.width*=h.width/e.width,o.height*=h.height/e.height):o===void 0&&(t.size={width:h.width/u,height:h.height/u})}else i=e.src,o===void 0&&(t.size={width:e.width,height:e.height});r!=null&&typeof t.size=="object"&&t.image===r.image&&t.repeat===r.repeat&&t.quality===r.quality&&(r.size=Ah(t.size));const c=this.elem.style;c.backgroundImage=`url(${i})`,c.backgroundRepeat=a,c.opacity=s==null||s>=1?"":`${s}`,this.updateBackgroundImage(t)}updateBackgroundColor(e){this.elem.style.backgroundColor=e||""}updateBackgroundOptions(e){this.graph.options.background=e}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(e){const t=e||{};if(this.updateBackgroundOptions(e),this.updateBackgroundColor(t.color),t.image){this.optionsCache=Ah(t);const r=document.createElement("img");r.onload=()=>this.drawBackgroundImage(r,e),r.setAttribute("crossorigin","anonymous"),r.src=t.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}$G([ht.dispose()],lc.prototype,"dispose",null);var IG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Vw extends ht{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&this.widgetOptions.enabled===!0}init(){this.startListening(),this.updateClassName()}startListening(){const e=this.widgetOptions.eventTypes;e&&(e.includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),e.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),Pe.on(this.graph.container,"mousedown",this.onRightMouseDown)),e.includes("mouseWheel")&&(this.mousewheelHandle=new $1(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()))}stopListening(){const e=this.widgetOptions.eventTypes;e&&(e.includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),e.includes("rightMouseDown")&&Pe.off(this.graph.container,"mousedown",this.onRightMouseDown),e.includes("mouseWheel")&&this.mousewheelHandle&&this.mousewheelHandle.disable())}preparePanning({e}){const t=this.graph.getPlugin("selection"),r=t&&t.allowRubberband(e,!0);(this.allowPanning(e,!0)||this.allowPanning(e)&&!r)&&this.startPanning(e)}allowPanning(e,t){return this.pannable&&nr.isMatch(e,this.widgetOptions.modifiers,t)}startPanning(e){const t=this.view.normalizeEvent(e);this.clientX=t.clientX,this.clientY=t.clientY,this.panning=!0,this.updateClassName(),Pe.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),Pe.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(e){const t=this.view.normalizeEvent(e),r=t.clientX-this.clientX,i=t.clientY-this.clientY;this.clientX=t.clientX,this.clientY=t.clientY,this.graph.translateBy(r,i)}stopPanning(e){this.panning=!1,this.updateClassName(),Pe.off(document.body,".panning"),Pe.off(window,".panning")}updateClassName(){const e=this.view.container,t=this.view.prefixClassName("graph-panning"),r=this.view.prefixClassName("graph-pannable");this.pannable?this.panning?(K(e,t),gt(e,r)):(gt(e,t),K(e,r)):(gt(e,t),gt(e,r))}onRightMouseDown(e){e.button===2&&this.allowPanning(e,!0)&&this.startPanning(e)}allowMouseWheel(e){return this.pannable&&!e.ctrlKey}onMouseWheel(e,t,r){e.ctrlKey||this.graph.translateBy(-t,-r)}autoPanning(e,t){const i=this.graph.getGraphArea();let s=0,o=0;e<=i.left+10&&(s=-10),t<=i.top+10&&(o=-10),e>=i.right-10&&(s=10),t>=i.bottom-10&&(o=10),(s!==0||o!==0)&&this.graph.translateBy(-s,-o)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}IG([ht.dispose()],Vw.prototype,"dispose",null);var LG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class vf extends ht{constructor(){super(...arguments),this.cumulatedFactor=1}get widgetOptions(){return this.options.mousewheel}init(){this.container=this.graph.container,this.target=this.widgetOptions.global?document:this.container,this.mousewheelHandle=new $1(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.widgetOptions.enabled&&this.enable(!0)}get disabled(){return this.widgetOptions.enabled!==!0}enable(e){(this.disabled||e)&&(this.widgetOptions.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.widgetOptions.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(e){const t=this.widgetOptions.guard;return(t==null||t(e))&&nr.isMatch(e,this.widgetOptions.modifiers)}onMouseWheel(e){const t=this.widgetOptions.guard;if((t==null||t(e))&&nr.isMatch(e,this.widgetOptions.modifiers)){const r=this.widgetOptions.factor||1.2;this.currentScale==null&&(this.startPos={x:e.clientX,y:e.clientY},this.currentScale=this.graph.transform.getScale().sx),e.deltaY<0?this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*r*20)/20/this.currentScale,this.cumulatedFactor===1&&(this.cumulatedFactor=1.05)):this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*(1/r)*20)/20/this.currentScale,this.cumulatedFactor===1&&(this.cumulatedFactor=.95)),this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);const s=this.currentScale;let o=this.graph.transform.clampScale(s*this.cumulatedFactor);const a=this.widgetOptions.minScale||Number.MIN_SAFE_INTEGER,l=this.widgetOptions.maxScale||Number.MAX_SAFE_INTEGER;if(o=en(o,a,l),o!==s)if(this.widgetOptions.zoomAtMousePosition){const u=!!this.graph.getPlugin("scroller")?this.graph.clientToLocal(this.startPos):this.graph.clientToGraph(this.startPos);this.graph.zoom(o,{absolute:!0,center:u.clone()})}else this.graph.zoom(o,{absolute:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}LG([$n.dispose()],vf.prototype,"dispose",null);var RG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class qw extends ht{init(){this.resetRenderArea=UV(this.resetRenderArea,200,{leading:!0}),this.resetRenderArea(),this.startListening()}startListening(){this.graph.on("translate",this.resetRenderArea,this),this.graph.on("scale",this.resetRenderArea,this),this.graph.on("resize",this.resetRenderArea,this)}stopListening(){this.graph.off("translate",this.resetRenderArea,this),this.graph.off("scale",this.resetRenderArea,this),this.graph.off("resize",this.resetRenderArea,this)}enableVirtualRender(){this.options.virtual=!0,this.resetRenderArea()}disableVirtualRender(){this.options.virtual=!1,this.graph.renderer.setRenderArea(void 0)}resetRenderArea(){if(this.options.virtual){const e=this.graph.getGraphArea();this.graph.renderer.setRenderArea(e)}}dispose(){this.stopListening()}}RG([ht.dispose()],qw.prototype,"dispose",null);class jG{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=33,this.initialTime=Date.now()}queueJob(e){if(e.priority&or.PRIOR)e.cb();else{const t=this.findInsertionIndex(e);t>=0&&this.queue.splice(t,0,e)}}queueFlush(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.scheduleJob())}queueFlushSync(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.flushJobsSync())}clearJobs(){this.queue.length=0,this.isFlushing=!1,this.isFlushPending=!1,this.cancelScheduleJob()}flushJobs(){this.isFlushPending=!1,this.isFlushing=!0;const e=this.getCurrentTime();let t;for(;(t=this.queue.shift())&&(t.cb(),!(this.getCurrentTime()-e>=this.frameInterval)););this.isFlushing=!1,this.queue.length&&this.queueFlush()}flushJobsSync(){this.isFlushPending=!1,this.isFlushing=!0;let e;for(;e=this.queue.shift();)try{e.cb()}catch(t){console.log(t)}this.isFlushing=!1}findInsertionIndex(e){let t=0,r=this.queue.length,i=r-1;const s=e.priority;for(;t<=i;){const o=(i-t>>1)+t;s<=this.queue[o].priority?t=o+1:(r=o,i=o-1)}return r}scheduleJob(){"requestIdleCallback"in window?(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.requestIdleCallback(this.flushJobs.bind(this),{timeout:100})):(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.setTimeout(this.flushJobs.bind(this)))}cancelScheduleJob(){"cancelIdleCallback"in window?(this.scheduleId&&window.cancelIdleCallback(this.scheduleId),this.scheduleId=0):(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduleId=0)}getCurrentTime(){return typeof performance=="object"&&typeof performance.now=="function"?performance.now():Date.now()-this.initialTime}}var or;(function(n){n[n.Update=2]="Update",n[n.RenderEdge=4]="RenderEdge",n[n.RenderNode=8]="RenderNode",n[n.PRIOR=1048576]="PRIOR"})(or||(or={}));var DG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class it extends $n{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(e){super(),this.views={},this.willRemoveViews={},this.queue=new jG,this.graph=e,this.init()}init(){this.startListening(),this.renderViews(this.model.getCells())}startListening(){this.model.on("reseted",this.onModelReseted,this),this.model.on("cell:added",this.onCellAdded,this),this.model.on("cell:removed",this.onCellRemoved,this),this.model.on("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.on("cell:change:visible",this.onCellVisibleChanged,this)}stopListening(){this.model.off("reseted",this.onModelReseted,this),this.model.off("cell:added",this.onCellAdded,this),this.model.off("cell:removed",this.onCellRemoved,this),this.model.off("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.off("cell:change:visible",this.onCellVisibleChanged,this)}onModelReseted({options:e}){this.queue.clearJobs(),this.removeZPivots(),this.resetViews(),this.renderViews(this.model.getCells(),e)}onCellAdded({cell:e,options:t}){this.renderViews([e],t)}onCellRemoved({cell:e}){this.removeViews([e])}onCellZIndexChanged({cell:e,options:t}){const r=this.views[e.id];r&&this.requestViewUpdate(r.view,it.FLAG_INSERT,t,or.Update,!0)}onCellVisibleChanged({cell:e,current:t}){this.toggleVisible(e,!!t)}requestViewUpdate(e,t,r={},i=or.Update,s=!0){const o=e.cell.id,a=this.views[o];if(!a)return;a.flag=t,a.options=r,(e.hasAction(t,["translate","resize","rotate"])||r.async===!1)&&(i=or.PRIOR,s=!1),this.queue.queueJob({id:o,priority:i,cb:()=>{this.renderViewInArea(e,t,r)}}),this.getEffectedEdges(e).forEach(u=>{this.requestViewUpdate(u.view,u.flag,r,i,!1)}),s&&this.flush()}setRenderArea(e){this.renderArea=e,this.flushWaitingViews()}isViewMounted(e){if(e==null)return!1;const t=this.views[e.cell.id];return t?t.state===it.ViewState.MOUNTED:!1}renderViews(e,t={}){e.sort((r,i)=>r.isNode()&&i.isEdge()?-1:0),e.forEach(r=>{const i=r.id,s=this.views;let o=0,a=s[i];if(a)o=it.FLAG_INSERT;else{const l=this.createCellView(r);l&&(l.graph=this.graph,o=it.FLAG_INSERT|l.getBootstrapFlag(),a={view:l,flag:o,options:t,state:it.ViewState.CREATED},this.views[i]=a)}a&&this.requestViewUpdate(a.view,o,t,this.getRenderPriority(a.view),!1)}),this.flush()}renderViewInArea(e,t,r={}){const i=e.cell,s=i.id,o=this.views[s];if(!o)return;let a=0;this.isUpdatable(e)?(a=this.updateView(e,t,r),o.flag=a):o.state===it.ViewState.MOUNTED?(a=this.updateView(e,t,r),o.flag=a):o.state=it.ViewState.WAITING,a&&i.isEdge()&&!(a&e.getFlag(["source","target"]))&&this.queue.queueJob({id:s,priority:or.RenderEdge,cb:()=>{this.updateView(e,t,r)}})}removeViews(e){e.forEach(t=>{const r=t.id,i=this.views[r];i&&(this.willRemoveViews[r]=i,delete this.views[r],this.queue.queueJob({id:r,priority:this.getRenderPriority(i.view),cb:()=>{this.removeView(i.view)}}))}),this.flush()}flush(){this.graph.options.async?this.queue.queueFlush():this.queue.queueFlushSync()}flushWaitingViews(){Object.values(this.views).forEach(e=>{if(e&&e.state===it.ViewState.WAITING){const{view:t,flag:r,options:i}=e;this.requestViewUpdate(t,r,i,this.getRenderPriority(t),!1)}}),this.flush()}updateView(e,t,r={}){if(e==null)return 0;if(rt.isCellView(e)){if(t&it.FLAG_REMOVE)return this.removeView(e.cell),0;t&it.FLAG_INSERT&&(this.insertView(e),t^=it.FLAG_INSERT)}return t?e.confirmUpdate(t,r):0}insertView(e){const t=this.views[e.cell.id];if(t){const r=e.cell.getZIndex(),i=this.addZPivot(r);this.container.insertBefore(e.container,i),e.cell.isVisible()||this.toggleVisible(e.cell,!1),t.state=it.ViewState.MOUNTED,this.graph.trigger("view:mounted",{view:e})}}resetViews(){this.willRemoveViews=Object.assign(Object.assign({},this.views),this.willRemoveViews),Object.values(this.willRemoveViews).forEach(e=>{e&&this.removeView(e.view)}),this.views={},this.willRemoveViews={}}removeView(e){const t=e.cell,r=this.willRemoveViews[t.id];r&&e&&(r.view.remove(),delete this.willRemoveViews[t.id],this.graph.trigger("view:unmounted",{view:e}))}toggleVisible(e,t){const r=this.model.getConnectedEdges(e);for(let s=0,o=r.length;s<o;s+=1){const a=r[s];if(t){const l=a.getSourceCell(),c=a.getTargetCell();if(l&&!l.isVisible()||c&&!c.isVisible())continue;this.toggleVisible(a,!0)}else this.toggleVisible(a,!1)}const i=this.views[e.id];i&&me(i.view.container,{display:t?"unset":"none"})}addZPivot(e=0){this.zPivots==null&&(this.zPivots={});const t=this.zPivots;let r=t[e];if(r)return r;r=t[e]=document.createComment(`z-index:${e+1}`);let i=-1/0;for(const o in t){const a=+o;a<e&&a>i&&(i=a,e-1)}const s=this.container;if(i!==-1/0){const o=t[i];s.insertBefore(r,o.nextSibling)}else s.insertBefore(r,s.firstChild);return r}removeZPivots(){this.zPivots&&Object.values(this.zPivots).forEach(e=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),this.zPivots={}}createCellView(e){const t={graph:this.graph},r=this.graph.options.createCellView;if(r){const s=Y(r,this.graph,e);if(s)return new s(e,t);if(s===null)return null}const i=e.view;if(i!=null&&typeof i=="string"){const s=rt.registry.get(i);return s?new s(e,t):rt.registry.onNotFound(i)}return e.isNode()?new kt(e,t):e.isEdge()?new sr(e,t):null}getEffectedEdges(e){const t=[],r=e.cell,i=this.model.getConnectedEdges(r);for(let s=0,o=i.length;s<o;s+=1){const a=i[s],l=this.views[a.id];if(!l)continue;const c=l.view;if(!this.isViewMounted(c))continue;const u=["update"];a.getTargetCell()===r&&u.push("target"),a.getSourceCell()===r&&u.push("source"),t.push({id:a.id,view:c,flag:c.getFlag(u)})}return t}isUpdatable(e){if(e.isNodeView())return this.renderArea?this.renderArea.isIntersectWithRect(e.cell.getBBox()):!0;if(e.isEdgeView()){const t=e.cell,r=t.getSourceCell(),i=t.getTargetCell();if(this.renderArea&&r&&i)return this.renderArea.isIntersectWithRect(r.getBBox())||this.renderArea.isIntersectWithRect(i.getBBox())}return!0}getRenderPriority(e){return e.cell.isNode()?or.RenderNode:or.RenderEdge}dispose(){this.stopListening()}}DG([$n.dispose()],it.prototype,"dispose",null),function(n){n.FLAG_INSERT=1<<30,n.FLAG_REMOVE=1<<29,n.FLAG_RENDER=(1<<26)-1}(it||(it={})),function(n){(function(e){e[e.CREATED=0]="CREATED",e[e.MOUNTED=1]="MOUNTED",e[e.WAITING=2]="WAITING"})(n.ViewState||(n.ViewState={}))}(it||(it={}));var BG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class bf extends ht{constructor(){super(...arguments),this.schedule=new it(this.graph)}requestViewUpdate(e,t,r={}){this.schedule.requestViewUpdate(e,t,r)}isViewMounted(e){return this.schedule.isViewMounted(e)}setRenderArea(e){this.schedule.setRenderArea(e)}findViewByElem(e){if(e==null)return null;const t=this.options.container,r=typeof e=="string"?t.querySelector(e):e instanceof Element?e:e[0];if(r){const i=this.graph.view.findAttr("data-cell-id",r);if(i){const s=this.schedule.views;if(s[i])return s[i].view}}return null}findViewByCell(e){if(e==null)return null;const t=le.isCell(e)?e.id:e,r=this.schedule.views;return r[t]?r[t].view:null}findViewsFromPoint(e){const t={x:e.x,y:e.y};return this.model.getCells().map(r=>this.findViewByCell(r)).filter(r=>r!=null?de.getBBox(r.container,{target:this.view.stage}).containsPoint(t):!1)}findEdgeViewsFromPoint(e,t=5){return this.model.getEdges().map(r=>this.findViewByCell(r)).filter(r=>{if(r!=null){const i=r.getClosestPoint(e);if(i)return i.distance(e)<=t}return!1})}findViewsInArea(e,t={}){const r=D.create(e);return this.model.getCells().map(i=>this.findViewByCell(i)).filter(i=>{if(i){if(t.nodeOnly&&!i.isNodeView())return!1;const s=de.getBBox(i.container,{target:this.view.stage});return s.width===0?s.inflate(1,0):s.height===0&&s.inflate(0,1),t.strict?r.containsRect(s):r.isIntersectWithRect(s)}return!1})}dispose(){this.schedule.dispose()}}BG([ht.dispose()],bf.prototype,"dispose",null);var Gw=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class Hw extends ht{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(e){return this.svg.getElementById(e)!=null}filter(e){let t=e.id;const r=e.name;if(t||(t=`filter-${r}-${this.cid}-${Bh(JSON.stringify(e))}`),!this.isDefined(t)){const i=ws.registry.get(r);if(i==null)return ws.registry.onNotFound(r);const s=i(e.args||{}),o=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},e.attrs),{id:t});ee.create(Ee.sanitize(s),o).appendTo(this.defs)}return t}gradient(e){let t=e.id;const r=e.type;if(t||(t=`gradient-${r}-${this.cid}-${Bh(JSON.stringify(e))}`),!this.isDefined(t)){const s=e.stops.map(l=>{const c=l.opacity!=null&&Number.isFinite(l.opacity)?l.opacity:1;return`<stop offset="${l.offset}" stop-color="${l.color}" stop-opacity="${c}"/>`}),o=`<${r}>${s.join("")}</${r}>`,a=Object.assign({id:t},e.attrs);ee.create(o,a).appendTo(this.defs)}return t}marker(e){const{id:t,refX:r,refY:i,markerUnits:s,markerOrient:o,tagName:a,children:l}=e,c=Gw(e,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let u=t;if(u||(u=`marker-${this.cid}-${Bh(JSON.stringify(e))}`),!this.isDefined(u)){a!=="path"&&delete c.d;const h=ee.create("marker",{refX:r,refY:i,id:u,overflow:"visible",orient:o!=null?o:"auto",markerUnits:s||"userSpaceOnUse"},l?l.map(f=>{var{tagName:d}=f,g=Gw(f,["tagName"]);return ee.create(`${d}`||"path",$o(Object.assign(Object.assign({},c),g)))}):[ee.create(a||"path",$o(c))]);this.defs.appendChild(h.node)}return u}remove(e){const t=this.svg.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}}class Uw extends ht{getClientMatrix(){return ct(this.view.stage.getScreenCTM())}getClientOffset(){const e=this.view.svg.getBoundingClientRect();return new P(e.left,e.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(e,t){return(typeof e=="number"?this.clientToLocalPoint(e,t):this.clientToLocalPoint(e.x,e.y)).snapToGrid(this.graph.getGridSize())}localToGraphPoint(e,t){const r=P.create(e,t);return de.transformPoint(r,this.graph.matrix())}localToClientPoint(e,t){const r=P.create(e,t);return de.transformPoint(r,this.getClientMatrix())}localToPagePoint(e,t){return(typeof e=="number"?this.localToGraphPoint(e,t):this.localToGraphPoint(e)).translate(this.getPageOffset())}localToGraphRect(e,t,r,i){const s=D.create(e,t,r,i);return de.transformRectangle(s,this.graph.matrix())}localToClientRect(e,t,r,i){const s=D.create(e,t,r,i);return de.transformRectangle(s,this.getClientMatrix())}localToPageRect(e,t,r,i){return(typeof e=="number"?this.localToGraphRect(e,t,r,i):this.localToGraphRect(e)).translate(this.getPageOffset())}graphToLocalPoint(e,t){const r=P.create(e,t);return de.transformPoint(r,this.graph.matrix().inverse())}clientToLocalPoint(e,t){const r=P.create(e,t);return de.transformPoint(r,this.getClientMatrix().inverse())}clientToGraphPoint(e,t){const r=P.create(e,t);return de.transformPoint(r,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(e,t){const i=P.create(e,t).diff(this.getPageOffset());return this.graphToLocalPoint(i)}graphToLocalRect(e,t,r,i){const s=D.create(e,t,r,i);return de.transformRectangle(s,this.graph.matrix().inverse())}clientToLocalRect(e,t,r,i){const s=D.create(e,t,r,i);return de.transformRectangle(s,this.getClientMatrix().inverse())}clientToGraphRect(e,t,r,i){const s=D.create(e,t,r,i);return de.transformRectangle(s,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(e,t,r,i){const s=D.create(e,t,r,i),o=this.getPageOffset();return s.x-=o.x,s.y-=o.y,this.graphToLocalRect(s)}}var zG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class cc extends ht{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:e,magnet:t,options:r={}}){const i=this.resolveHighlighter(r);if(!i)return;const s=this.getHighlighterId(t,i);if(!this.highlights[s]){const o=i.highlighter;o.highlight(e,t,Object.assign({},i.args)),this.highlights[s]={cellView:e,magnet:t,highlighter:o,args:i.args}}}onCellUnhighlight({magnet:e,options:t={}}){const r=this.resolveHighlighter(t);if(!r)return;const i=this.getHighlighterId(e,r);this.unhighlight(i)}resolveHighlighter(e){const t=this.options;let r=e.highlighter;if(r==null){const a=e.type;r=a&&t.highlighting[a]||t.highlighting.default}if(r==null)return null;const i=typeof r=="string"?{name:r}:r,s=i.name,o=rr.registry.get(s);return o==null?rr.registry.onNotFound(s):(rr.check(s,o),{name:s,highlighter:o,args:i.args||{}})}getHighlighterId(e,t){return Gh(e),t.name+e.id+JSON.stringify(t.args)}unhighlight(e){const t=this.highlights[e];t&&(t.highlighter.unhighlight(t.cellView,t.magnet,t.args),delete this.highlights[e])}dispose(){Object.keys(this.highlights).forEach(e=>this.unhighlight(e)),this.stopListening()}}zG([cc.dispose()],cc.prototype,"dispose",null);var FG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Ww extends ht{getScroller(){const e=this.graph.getPlugin("scroller");return e&&e.options.enabled?e:null}getContainer(){const e=this.getScroller();return e?e.container.parentElement:this.graph.container.parentElement}getSensorTarget(){const e=this.options.autoResize;if(e)return typeof e=="boolean"?this.getContainer():e}init(){if(this.options.autoResize){const t=this.getSensorTarget();t&&Vl.bind(t,()=>{const r=t.offsetWidth,i=t.offsetHeight;this.resize(r,i)})}}resize(e,t){const r=this.getScroller();r?r.resize(e,t):this.graph.transform.resize(e,t)}dispose(){Vl.clear(this.graph.container)}}FG([ht.dispose()],Ww.prototype,"dispose",null);var VG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let V=class DO extends wt{get container(){return this.options.container}get[Symbol.toStringTag](){return DO.toStringTag}constructor(e){super(),this.installedPlugins=new Set,this.options=Zo.get(e),this.css=new mf(this),this.view=new xn(this),this.defs=new Hw(this),this.coord=new Uw(this),this.transform=new Fw(this),this.highlight=new cc(this),this.grid=new yf(this),this.background=new lc(this),this.options.model?this.model=this.options.model:(this.model=new zn,this.model.graph=this),this.renderer=new bf(this),this.panning=new Vw(this),this.mousewheel=new vf(this),this.virtualRender=new qw(this),this.size=new Ww(this)}isNode(e){return e.isNode()}isEdge(e){return e.isEdge()}resetCells(e,t={}){return this.model.resetCells(e,t),this}clearCells(e={}){return this.model.clear(e),this}toJSON(e={}){return this.model.toJSON(e)}parseJSON(e){return this.model.parseJSON(e)}fromJSON(e,t={}){return this.model.fromJSON(e,t),this}getCellById(e){return this.model.getCell(e)}addNode(e,t={}){return this.model.addNode(e,t)}addNodes(e,t={}){return this.addCell(e.map(r=>We.isNode(r)?r:this.createNode(r)),t)}createNode(e){return this.model.createNode(e)}removeNode(e,t={}){return this.model.removeCell(e,t)}addEdge(e,t={}){return this.model.addEdge(e,t)}addEdges(e,t={}){return this.addCell(e.map(r=>Ve.isEdge(r)?r:this.createEdge(r)),t)}removeEdge(e,t={}){return this.model.removeCell(e,t)}createEdge(e){return this.model.createEdge(e)}addCell(e,t={}){return this.model.addCell(e,t),this}removeCell(e,t={}){return this.model.removeCell(e,t)}removeCells(e,t={}){return this.model.removeCells(e,t)}removeConnectedEdges(e,t={}){return this.model.removeConnectedEdges(e,t)}disconnectConnectedEdges(e,t={}){return this.model.disconnectConnectedEdges(e,t),this}hasCell(e){return this.model.has(e)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(e){return this.model.getOutgoingEdges(e)}getIncomingEdges(e){return this.model.getIncomingEdges(e)}getConnectedEdges(e,t={}){return this.model.getConnectedEdges(e,t)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(e){return this.model.isRoot(e)}isLeafNode(e){return this.model.isLeaf(e)}getNeighbors(e,t={}){return this.model.getNeighbors(e,t)}isNeighbor(e,t,r={}){return this.model.isNeighbor(e,t,r)}getSuccessors(e,t={}){return this.model.getSuccessors(e,t)}isSuccessor(e,t,r={}){return this.model.isSuccessor(e,t,r)}getPredecessors(e,t={}){return this.model.getPredecessors(e,t)}isPredecessor(e,t,r={}){return this.model.isPredecessor(e,t,r)}getCommonAncestor(...e){return this.model.getCommonAncestor(...e)}getSubGraph(e,t={}){return this.model.getSubGraph(e,t)}cloneSubGraph(e,t={}){return this.model.cloneSubGraph(e,t)}cloneCells(e){return this.model.cloneCells(e)}getNodesFromPoint(e,t){return this.model.getNodesFromPoint(e,t)}getNodesInArea(e,t,r,i,s){return this.model.getNodesInArea(e,t,r,i,s)}getNodesUnderNode(e,t={}){return this.model.getNodesUnderNode(e,t)}searchCell(e,t,r={}){return this.model.search(e,t,r),this}getShortestPath(e,t,r={}){return this.model.getShortestPath(e,t,r)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(e,t={}){return this.model.getCellsBBox(e,t)}startBatch(e,t={}){this.model.startBatch(e,t)}stopBatch(e,t={}){this.model.stopBatch(e,t)}batchUpdate(e,t,r){const i=typeof e=="string"?e:"update",s=typeof e=="string"?t:e,o=typeof t=="function"?r:t;this.startBatch(i,o);const a=s();return this.stopBatch(i,o),a}updateCellId(e,t){return this.model.updateCellId(e,t)}findView(e){return le.isCell(e)?this.findViewByCell(e):this.findViewByElem(e)}findViews(e){return D.isRectangleLike(e)?this.findViewsInArea(e):P.isPointLike(e)?this.findViewsFromPoint(e):[]}findViewByCell(e){return this.renderer.findViewByCell(e)}findViewByElem(e){return this.renderer.findViewByElem(e)}findViewsFromPoint(e,t){const r=typeof e=="number"?{x:e,y:t}:e;return this.renderer.findViewsFromPoint(r)}findViewsInArea(e,t,r,i,s){const o=typeof e=="number"?{x:e,y:t,width:r,height:i}:e,a=typeof e=="number"?s:t;return this.renderer.findViewsInArea(o,a)}matrix(e){return typeof e=="undefined"?this.transform.getMatrix():(this.transform.setMatrix(e),this)}resize(e,t){const r=this.getPlugin("scroller");return r?r.resize(e,t):this.transform.resize(e,t),this}scale(e,t=e,r=0,i=0){return typeof e=="undefined"?this.transform.getScale():(this.transform.scale(e,t,r,i),this)}zoom(e,t){const r=this.getPlugin("scroller");if(r){if(typeof e=="undefined")return r.zoom();r.zoom(e,t)}else{if(typeof e=="undefined")return this.transform.getZoom();this.transform.zoom(e,t)}return this}zoomTo(e,t={}){const r=this.getPlugin("scroller");return r?r.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})):this.transform.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})),this}zoomToRect(e,t={}){const r=this.getPlugin("scroller");return r?r.zoomToRect(e,t):this.transform.zoomToRect(e,t),this}zoomToFit(e={}){const t=this.getPlugin("scroller");return t?t.zoomToFit(e):this.transform.zoomToFit(e),this}rotate(e,t,r){return typeof e=="undefined"?this.transform.getRotation():(this.transform.rotate(e,t,r),this)}translate(e,t){return typeof e=="undefined"?this.transform.getTranslation():(this.transform.translate(e,t),this)}translateBy(e,t){const r=this.translate(),i=r.tx+e,s=r.ty+t;return this.translate(i,s)}getGraphArea(){return this.transform.getGraphArea()}getContentArea(e={}){return this.transform.getContentArea(e)}getContentBBox(e={}){return this.transform.getContentBBox(e)}fitToContent(e,t,r,i){return this.transform.fitToContent(e,t,r,i)}scaleContentToFit(e={}){return this.transform.scaleContentToFit(e),this}center(e){return this.centerPoint(e)}centerPoint(e,t,r){const i=this.getPlugin("scroller");return i?i.centerPoint(e,t,r):this.transform.centerPoint(e,t),this}centerContent(e){const t=this.getPlugin("scroller");return t?t.centerContent(e):this.transform.centerContent(e),this}centerCell(e,t){const r=this.getPlugin("scroller");return r?r.centerCell(e,t):this.transform.centerCell(e),this}positionPoint(e,t,r,i={}){const s=this.getPlugin("scroller");return s?s.positionPoint(e,t,r,i):this.transform.positionPoint(e,t,r),this}positionRect(e,t,r){const i=this.getPlugin("scroller");return i?i.positionRect(e,t,r):this.transform.positionRect(e,t),this}positionCell(e,t,r){const i=this.getPlugin("scroller");return i?i.positionCell(e,t,r):this.transform.positionCell(e,t),this}positionContent(e,t){const r=this.getPlugin("scroller");return r?r.positionContent(e,t):this.transform.positionContent(e,t),this}snapToGrid(e,t){return this.coord.snapToGrid(e,t)}pageToLocal(e,t,r,i){return D.isRectangleLike(e)?this.coord.pageToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.pageToLocalRect(e,t,r,i):this.coord.pageToLocalPoint(e,t)}localToPage(e,t,r,i){return D.isRectangleLike(e)?this.coord.localToPageRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.localToPageRect(e,t,r,i):this.coord.localToPagePoint(e,t)}clientToLocal(e,t,r,i){return D.isRectangleLike(e)?this.coord.clientToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.clientToLocalRect(e,t,r,i):this.coord.clientToLocalPoint(e,t)}localToClient(e,t,r,i){return D.isRectangleLike(e)?this.coord.localToClientRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.localToClientRect(e,t,r,i):this.coord.localToClientPoint(e,t)}localToGraph(e,t,r,i){return D.isRectangleLike(e)?this.coord.localToGraphRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.localToGraphRect(e,t,r,i):this.coord.localToGraphPoint(e,t)}graphToLocal(e,t,r,i){return D.isRectangleLike(e)?this.coord.graphToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.graphToLocalRect(e,t,r,i):this.coord.graphToLocalPoint(e,t)}clientToGraph(e,t,r,i){return D.isRectangleLike(e)?this.coord.clientToGraphRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.clientToGraphRect(e,t,r,i):this.coord.clientToGraphPoint(e,t)}defineFilter(e){return this.defs.filter(e)}defineGradient(e){return this.defs.gradient(e)}defineMarker(e){return this.defs.marker(e)}getGridSize(){return this.grid.getGridSize()}setGridSize(e){return this.grid.setGridSize(e),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(e){return this.grid.draw(e),this}updateBackground(){return this.background.update(),this}drawBackground(e,t){const r=this.getPlugin("scroller");return r!=null&&(this.options.background==null||!t)?r.drawBackground(e,t):this.background.draw(e),this}clearBackground(e){const t=this.getPlugin("scroller");return t!=null&&(this.options.background==null||!e)?t.clearBackground(e):this.background.clear(),this}enableVirtualRender(){return this.virtualRender.enableVirtualRender(),this}disableVirtualRender(){return this.virtualRender.disableVirtualRender(),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(e){return e==null?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():e?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const e=this.getPlugin("scroller");return e?e.isPannable():this.panning.pannable}enablePanning(){const e=this.getPlugin("scroller");return e?e.enablePanning():this.panning.enablePanning(),this}disablePanning(){const e=this.getPlugin("scroller");return e?e.disablePanning():this.panning.disablePanning(),this}togglePanning(e){return e==null?this.isPannable()?this.disablePanning():this.enablePanning():e!==this.isPannable()&&(e?this.enablePanning():this.disablePanning()),this}use(e,...t){return this.installedPlugins.has(e)||(this.installedPlugins.add(e),e.init(this,...t)),this}getPlugin(e){return Array.from(this.installedPlugins).find(t=>t.name===e)}getPlugins(e){return Array.from(this.installedPlugins).filter(t=>e.includes(t.name))}enablePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const r=this.getPlugins(t);return r==null||r.forEach(i=>{var s;(s=i==null?void 0:i.enable)===null||s===void 0||s.call(i)}),this}disablePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const r=this.getPlugins(t);return r==null||r.forEach(i=>{var s;(s=i==null?void 0:i.disable)===null||s===void 0||s.call(i)}),this}isPluginEnabled(e){var t;const r=this.getPlugin(e);return(t=r==null?void 0:r.isEnabled)===null||t===void 0?void 0:t.call(r)}disposePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const r=this.getPlugins(t);return r==null||r.forEach(i=>{i.dispose()}),this}dispose(){this.clearCells(),this.off(),this.css.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.highlight.dispose(),this.background.dispose(),this.mousewheel.dispose(),this.panning.dispose(),this.view.dispose(),this.renderer.dispose(),this.installedPlugins.forEach(e=>{e.dispose()})}};VG([wt.dispose()],V.prototype,"dispose",null),function(n){n.View=xn,n.Renderer=bf,n.MouseWheel=vf,n.DefsManager=Hw,n.GridManager=yf,n.CoordManager=Uw,n.TransformManager=Fw,n.HighlightManager=cc,n.BackgroundManager=lc}(V||(V={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag];return r==null||r===n.toStringTag}n.isGraph=e}(V||(V={})),function(n){function e(t,r){const i=t instanceof HTMLElement?new n({container:t}):new n(t);return r!=null&&i.fromJSON(r),i}n.render=e}(V||(V={})),function(n){n.registerNode=We.registry.register,n.registerEdge=Ve.registry.register,n.registerView=rt.registry.register,n.registerAttr=Bn.registry.register,n.registerGrid=Or.registry.register,n.registerFilter=ws.registry.register,n.registerNodeTool=Ps.registry.register,n.registerEdgeTool=Es.registry.register,n.registerBackground=Go.registry.register,n.registerHighlighter=rr.registry.register,n.registerPortLayout=Ei.registry.register,n.registerPortLabelLayout=Cs.registry.register,n.registerMarker=Nr.registry.register,n.registerRouter=Rr.registry.register,n.registerConnector=Ai.registry.register,n.registerAnchor=As.registry.register,n.registerEdgeAnchor=Ts.registry.register,n.registerConnectionPoint=Os.registry.register}(V||(V={})),function(n){n.unregisterNode=We.registry.unregister,n.unregisterEdge=Ve.registry.unregister,n.unregisterView=rt.registry.unregister,n.unregisterAttr=Bn.registry.unregister,n.unregisterGrid=Or.registry.unregister,n.unregisterFilter=ws.registry.unregister,n.unregisterNodeTool=Ps.registry.unregister,n.unregisterEdgeTool=Es.registry.unregister,n.unregisterBackground=Go.registry.unregister,n.unregisterHighlighter=rr.registry.unregister,n.unregisterPortLayout=Ei.registry.unregister,n.unregisterPortLabelLayout=Cs.registry.unregister,n.unregisterMarker=Nr.registry.unregister,n.unregisterRouter=Rr.registry.unregister,n.unregisterConnector=Ai.registry.unregister,n.unregisterAnchor=As.registry.unregister,n.unregisterEdgeAnchor=Ts.registry.unregister,n.unregisterConnectionPoint=Os.registry.unregister}(V||(V={}));var qG=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class $s extends We{}(function(n){class e extends kt{init(){super.init(),this.cell.on("change:*",({key:r})=>{const i=n.shapeMaps[this.cell.shape];if(i){const{effect:s}=i;(!s||s.includes(r))&&this.renderHTMLComponent()}})}confirmUpdate(r){const i=super.confirmUpdate(r);return this.handleAction(i,e.action,()=>this.renderHTMLComponent())}renderHTMLComponent(){const r=this.selectors&&this.selectors.foContent;if(r){No(r);const i=n.shapeMaps[this.cell.shape];if(!i)return;let{html:s}=i;typeof s=="function"&&(s=s(this.cell)),s&&(typeof s=="string"?r.innerHTML=s:jn(r,s))}}}n.View=e,function(t){t.action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),kt.registry.register("html-view",t,!0)}(e=n.View||(n.View={}))})($s||($s={})),function(n){n.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},Ee.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),We.registry.register("html",n,!0)}($s||($s={})),function(n){n.shapeMaps={};function e(t){const{shape:r,html:i,effect:s,inherit:o}=t,a=qG(t,["shape","html","effect","inherit"]);if(!r)throw new Error("should specify shape in config");n.shapeMaps[r]={html:i,effect:s},V.registerNode(r,Object.assign({inherit:o||"html"},a),!0)}n.register=e}($s||($s={}));const GG=`.x6-widget-minimap {
246
246
  position: relative;
247
247
  display: table-cell;
248
248
  box-sizing: border-box;
@@ -285,7 +285,7 @@
285
285
  border-radius: 50%;
286
286
  cursor: nwse-resize;
287
287
  }
288
- `;var UG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Yw extends de{get scroller(){return this.graph.getPlugin("scroller")}get graphContainer(){return this.scroller?this.scroller.container:this.graph.container}constructor(e){super(),this.name="minimap",this.options=Object.assign(Object.assign({},uc.defaultOptions),e),Fo(this.name,HG)}init(e){this.graph=e,this.updateViewport=kh(this.updateViewport.bind(this),0),this.container=document.createElement("div"),J(this.container,this.prefixClassName(Zo.root));const t=document.createElement("div");this.container.appendChild(t),this.viewport=document.createElement("div"),J(this.viewport,this.prefixClassName(Zo.viewport)),this.options.scalable&&(this.zoomHandle=document.createElement("div"),J(this.zoomHandle,this.prefixClassName(Zo.zoom)),Ar(this.zoomHandle,this.viewport)),jn(this.container,this.viewport),pe(this.container,{width:this.options.width,height:this.options.height,padding:this.options.padding}),this.options.container&&this.options.container.appendChild(this.container),this.sourceGraph=this.graph;const r=Object.assign(Object.assign({},this.options.graphOptions),{container:t,model:this.sourceGraph.model,interacting:!1,grid:!1,background:!1,embedding:!1});this.targetGraph=this.options.createGraph?this.options.createGraph(r):new V(r),this.updatePaper(this.sourceGraph.options.width,this.sourceGraph.options.height),this.startListening()}startListening(){this.scroller?Se.on(this.graphContainer,`scroll${this.getEventNamespace()}`,this.updateViewport):(this.sourceGraph.on("translate",this.onTransform,this),this.sourceGraph.on("scale",this.onTransform,this),this.sourceGraph.on("model:updated",this.onModelUpdated,this)),this.sourceGraph.on("resize",this.updatePaper,this),this.delegateEvents({mousedown:"startAction",touchstart:"startAction",[`mousedown .${this.prefixClassName("graph")}`]:"scrollTo",[`touchstart .${this.prefixClassName("graph")}`]:"scrollTo"})}stopListening(){this.scroller?Se.off(this.graphContainer,this.getEventNamespace()):(this.sourceGraph.off("translate",this.onTransform,this),this.sourceGraph.off("scale",this.onTransform,this),this.sourceGraph.off("model:updated",this.onModelUpdated,this)),this.sourceGraph.off("resize",this.updatePaper,this),this.undelegateEvents()}onRemove(){this.stopListening(),this.targetGraph.model=new zn,this.targetGraph.dispose()}onTransform(e){(e.ui||this.targetGraphTransforming)&&this.updateViewport()}onModelUpdated(){this.targetGraph.zoomToFit()}updatePaper(e,t){let r,i;typeof e=="object"?(r=e.width,i=e.height):(r=e,i=t);const s=this.sourceGraph.options,o=this.sourceGraph.transform.getScale(),a=this.options.width-2*this.options.padding,l=this.options.height-2*this.options.padding;r/=o.sx,i/=o.sy,this.ratio=Math.min(a/r,l/i);const c=this.ratio,u=s.x*c/o.sx,h=s.y*c/o.sy;return r*=c,i*=c,this.targetGraph.resize(r,i),this.targetGraph.translate(u,h),this.scroller?this.targetGraph.scale(c,c):this.targetGraph.zoomToFit(),this.updateViewport(),this}updateViewport(){const e=this.sourceGraph.transform.getScale(),t=this.targetGraph.transform.getScale();let r=null;this.scroller?r=this.scroller.clientToLocalPoint(0,0):r=this.graph.graphToLocal(0,0);const i=Z4(this.targetGraph.container),s=this.targetGraph.translate();s.ty=s.ty||0,this.geometry={top:i.top+r.y*t.sy+s.ty,left:i.left+r.x*t.sx+s.tx,width:this.graphContainer.clientWidth*t.sx/e.sx,height:this.graphContainer.clientHeight*t.sy/e.sy},pe(this.viewport,this.geometry)}startAction(e){const t=this.normalizeEvent(e),r=t.target===this.zoomHandle?"zooming":"panning",{tx:i,ty:s}=this.sourceGraph.translate(),o={action:r,clientX:t.clientX,clientY:t.clientY,scrollLeft:this.graphContainer.scrollLeft,scrollTop:this.graphContainer.scrollTop,zoom:this.sourceGraph.zoom(),scale:this.sourceGraph.transform.getScale(),geometry:this.geometry,translateX:i,translateY:s};this.targetGraphTransforming=!0,this.delegateDocumentEvents(uc.documentEvents,o)}doAction(e){const t=this.normalizeEvent(e),r=t.clientX,i=t.clientY,s=t.data;switch(s.action){case"panning":{const o=this.sourceGraph.transform.getScale(),a=(r-s.clientX)*o.sx,l=(i-s.clientY)*o.sy;this.scroller?(this.graphContainer.scrollLeft=s.scrollLeft+a/this.ratio,this.graphContainer.scrollTop=s.scrollTop+l/this.ratio):this.sourceGraph.translate(s.translateX-a/this.ratio,s.translateY-l/this.ratio);break}case"zooming":{const o=s.scale,a=s.geometry,l=1+(s.clientX-r)/a.width/o.sx;s.frameId&&cancelAnimationFrame(s.frameId),s.frameId=requestAnimationFrame(()=>{this.sourceGraph.zoom(l*s.zoom,{absolute:!0,minScale:this.options.minScale,maxScale:this.options.maxScale})});break}}}stopAction(){this.undelegateDocumentEvents(),this.targetGraphTransforming=!1}scrollTo(e){const t=this.normalizeEvent(e);let r,i;const s=this.targetGraph.translate();if(s.ty=s.ty||0,t.offsetX==null){const l=Do(this.targetGraph.container);r=t.pageX-l.left,i=t.pageY-l.top}else r=t.offsetX,i=t.offsetY;const o=(r-s.tx)/this.ratio,a=(i-s.ty)/this.ratio;this.sourceGraph.centerPoint(o,a)}dispose(){this.remove(),Vo(this.name)}}UG([de.dispose()],Yw.prototype,"dispose",null);var Zo;(function(n){n.root="widget-minimap",n.viewport=`${n.root}-viewport`,n.zoom=`${n.viewport}-zoom`})(Zo||(Zo={}));var uc;(function(n){n.defaultOptions={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:e=>new V(e)},n.documentEvents={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"}})(uc||(uc={}));var WG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},XG=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class st extends de{get graph(){return this.options.graph}get model(){return this.graph.model}constructor(e){super(),this.padding={left:0,top:0,right:0,bottom:0},this.options=st.getOptions(e),this.onUpdate=kh(this.onUpdate,200);const t=this.graph.transform.getScale();this.sx=t.sx,this.sy=t.sy;const r=this.options.width||this.graph.options.width,i=this.options.height||this.graph.options.height;this.container=document.createElement("div"),J(this.container,this.prefixClassName(st.containerClass)),pe(this.container,{width:r,height:i}),this.options.pageVisible&&J(this.container,this.prefixClassName(st.pagedClass)),this.options.className&&J(this.container,this.options.className);const s=this.graph.container;s.parentNode&&No(s,this.container),this.content=document.createElement("div"),J(this.content,this.prefixClassName(st.contentClass)),pe(this.content,{width:this.graph.options.width,height:this.graph.options.height}),this.background=document.createElement("div"),J(this.background,this.prefixClassName(st.backgroundClass)),jn(this.content,this.background),this.options.pageVisible||jn(this.content,this.graph.view.grid),jn(this.content,s),Ar(this.content,this.container),this.startListening(),this.options.pageVisible||this.graph.grid.update(),this.backgroundManager=new st.Background(this),this.options.autoResize||this.update()}startListening(){const e=this.graph,t=this.model;e.on("scale",this.onScale,this),e.on("resize",this.onResize,this),e.on("before:print",this.storeScrollPosition,this),e.on("before:export",this.storeScrollPosition,this),e.on("after:print",this.restoreScrollPosition,this),e.on("after:export",this.restoreScrollPosition,this),t.on("reseted",this.onUpdate,this),t.on("cell:added",this.onUpdate,this),t.on("cell:removed",this.onUpdate,this),t.on("cell:changed",this.onUpdate,this),this.delegateBackgroundEvents()}stopListening(){const e=this.graph,t=this.model;e.off("scale",this.onScale,this),e.off("resize",this.onResize,this),e.off("beforeprint",this.storeScrollPosition,this),e.off("beforeexport",this.storeScrollPosition,this),e.off("afterprint",this.restoreScrollPosition,this),e.off("afterexport",this.restoreScrollPosition,this),t.off("reseted",this.onUpdate,this),t.off("cell:added",this.onUpdate,this),t.off("cell:removed",this.onUpdate,this),t.off("cell:changed",this.onUpdate,this),this.undelegateBackgroundEvents()}enableAutoResize(){this.options.autoResize=!0}disableAutoResize(){this.options.autoResize=!1}onUpdate(){this.options.autoResize&&this.update()}delegateBackgroundEvents(e){const t=e||xn.events;this.delegatedHandlers=Object.keys(t).reduce((r,i)=>{const s=t[i];if(i.indexOf(" ")===-1)if(typeof s=="function")r[i]=s;else{let o=this.graph.view[s];typeof o=="function"&&(o=o.bind(this.graph.view),r[i]=o)}return r},{}),this.onBackgroundEvent=this.onBackgroundEvent.bind(this),Object.keys(this.delegatedHandlers).forEach(r=>{this.delegateEvent(r,{guarded:!1},this.onBackgroundEvent)})}undelegateBackgroundEvents(){Object.keys(this.delegatedHandlers).forEach(e=>{this.undelegateEvent(e,this.onBackgroundEvent)})}onBackgroundEvent(e){let t=!1;const r=e.target;if(this.options.pageVisible)this.options.background?t=this.background===r:t=this.content===r;else{const i=this.graph.view;t=i.background===r||i.grid===r}if(t){const i=this.delegatedHandlers[e.type];typeof i=="function"&&i.apply(this.graph,arguments)}}onResize(){this.cachedCenterPoint&&(this.centerPoint(this.cachedCenterPoint.x,this.cachedCenterPoint.y),this.updatePageBreak())}onScale({sx:e,sy:t,ox:r,oy:i}){this.updateScale(e,t),(r||i)&&(this.centerPoint(r,i),this.updatePageBreak()),typeof this.options.autoResizeOptions=="function"&&this.update()}storeScrollPosition(){this.cachedScrollLeft=this.container.scrollLeft,this.cachedScrollTop=this.container.scrollTop}restoreScrollPosition(){this.container.scrollLeft=this.cachedScrollLeft,this.container.scrollTop=this.cachedScrollTop,this.cachedScrollLeft=null,this.cachedScrollTop=null}storeClientSize(){this.cachedClientSize={width:this.container.clientWidth,height:this.container.clientHeight}}restoreClientSize(){this.cachedClientSize=null}beforeManipulation(){(tn.IS_IE||tn.IS_EDGE)&&pe(this.container,{visibility:"hidden"})}afterManipulation(){(tn.IS_IE||tn.IS_EDGE)&&pe(this.container,{visibility:"visible"})}updatePageSize(e,t){e!=null&&(this.options.pageWidth=e),t!=null&&(this.options.pageHeight=t),this.updatePageBreak()}updatePageBreak(){if(this.pageBreak&&this.pageBreak.parentNode&&this.pageBreak.parentNode.removeChild(this.pageBreak),this.pageBreak=null,this.options.pageVisible&&this.options.pageBreak){const e=this.graph.options.width,t=this.graph.options.height,r=this.options.pageWidth*this.sx,i=this.options.pageHeight*this.sy;if(r===0||i===0)return;if(e>r||t>i){let s=!1;const o=document.createElement("div");for(let a=1,l=Math.floor(e/r);a<l;a+=1){const c=document.createElement("div");J(c,this.prefixClassName("graph-pagebreak-vertical")),pe(c,{left:a*r}),Ar(c,o),s=!0}for(let a=1,l=Math.floor(t/i);a<l;a+=1){const c=document.createElement("div");J(c,this.prefixClassName("graph-pagebreak-horizontal")),pe(c,{top:a*i}),Ar(c,o),s=!0}s&&(J(o,this.prefixClassName("graph-pagebreak")),d4(this.graph.view.grid,o),this.pageBreak=o)}}}update(){const e=this.getClientSize();this.cachedCenterPoint=this.clientToLocalPoint(e.width/2,e.height/2);let t=this.options.autoResizeOptions;typeof t=="function"&&(t=K(t,this,this));const r=Object.assign({gridWidth:this.options.pageWidth,gridHeight:this.options.pageHeight,allowNewOrigin:"negative"},t);this.graph.fitToContent(this.getFitToContentOptions(r))}getFitToContentOptions(e){const t=this.sx,r=this.sy;return e.gridWidth&&(e.gridWidth*=t),e.gridHeight&&(e.gridHeight*=r),e.minWidth&&(e.minWidth*=t),e.minHeight&&(e.minHeight*=r),typeof e.padding=="object"?e.padding={left:(e.padding.left||0)*t,right:(e.padding.right||0)*t,top:(e.padding.top||0)*r,bottom:(e.padding.bottom||0)*r}:typeof e.padding=="number"&&(e.padding*=t),this.options.autoResize||(e.contentArea=D.create()),e}updateScale(e,t){const r=this.graph.options,i=e/this.sx,s=t/this.sy;this.sx=e,this.sy=t,this.graph.translate(r.x*i,r.y*s),this.graph.transform.resize(r.width*i,r.height*s)}scrollbarPosition(e,t){if(e==null&&t==null)return{left:this.container.scrollLeft,top:this.container.scrollTop};const r={};return typeof e=="number"&&(r.scrollLeft=e),typeof t=="number"&&(r.scrollTop=t),Jh(this.container,r),this}scrollToPoint(e,t){const r=this.getClientSize(),i=this.graph.matrix(),s={};return typeof e=="number"&&(s.scrollLeft=e-r.width/2+i.e+(this.padding.left||0)),typeof t=="number"&&(s.scrollTop=t-r.height/2+i.f+(this.padding.top||0)),Jh(this.container,s),this}scrollToContent(){const e=this.sx,t=this.sy,r=this.graph.getContentArea().getCenter();return this.scrollToPoint(r.x*e,r.y*t)}scrollToCell(e){const t=this.sx,r=this.sy,i=e.getBBox().getCenter();return this.scrollToPoint(i.x*t,i.y*r)}center(e){return this.centerPoint(e)}centerPoint(e,t,r){const i=this.graph.matrix(),s=i.a,o=i.d,a=-i.e,l=-i.f,c=a+this.graph.options.width,u=l+this.graph.options.height;let h;if(this.storeClientSize(),typeof e=="number"||typeof t=="number"){h=r;const x=this.getVisibleArea().getCenter();typeof e=="number"?e*=s:e=x.x,typeof t=="number"?t*=o:t=x.y}else h=e,e=(a+c)/2,t=(l+u)/2;if(h&&h.padding)return this.positionPoint({x:e,y:t},"50%","50%",h);const f=this.getPadding(),d=this.getClientSize(),g=d.width/2,p=d.height/2,b=g-f.left-e+a,m=g-f.right+e-c,y=p-f.top-t+l,v=p-f.bottom+t-u;this.addPadding(Math.max(b,0),Math.max(m,0),Math.max(y,0),Math.max(v,0));const w=this.scrollToPoint(e,t);return this.restoreClientSize(),w}centerContent(e){return this.positionContent("center",e)}centerCell(e,t){return this.positionCell(e,"center",t)}positionContent(e,t){const r=this.graph.getContentArea(t);return this.positionRect(r,e,t)}positionCell(e,t,r){const i=e.getBBox();return this.positionRect(i,t,r)}positionRect(e,t,r){const i=D.create(e);switch(t){case"center":return this.positionPoint(i.getCenter(),"50%","50%",r);case"top":return this.positionPoint(i.getTopCenter(),"50%",0,r);case"top-right":return this.positionPoint(i.getTopRight(),"100%",0,r);case"right":return this.positionPoint(i.getRightMiddle(),"100%","50%",r);case"bottom-right":return this.positionPoint(i.getBottomRight(),"100%","100%",r);case"bottom":return this.positionPoint(i.getBottomCenter(),"50%","100%",r);case"bottom-left":return this.positionPoint(i.getBottomLeft(),0,"100%",r);case"left":return this.positionPoint(i.getLeftMiddle(),0,"50%",r);case"top-left":return this.positionPoint(i.getTopLeft(),0,0,r);default:return this}}positionPoint(e,t,r,i={}){const{padding:s}=i,o=XG(i,["padding"]),a=Rn(s),l=D.fromSize(this.getClientSize()),c=l.clone().moveAndExpand({x:a.left,y:a.top,width:-a.right-a.left,height:-a.top-a.bottom});t=Vt(t,Math.max(0,c.width)),t<0&&(t=c.width+t),r=Vt(r,Math.max(0,c.height)),r<0&&(r=c.height+r);const u=c.getTopLeft().translate(t,r),h=l.getCenter().diff(u),f=this.zoom(),d=h.scale(1/f,1/f),g=P.create(e).translate(d);return this.centerPoint(g.x,g.y,o)}zoom(e,t){if(e==null)return this.sx;t=t||{};let r,i;const s=this.getClientSize(),o=this.clientToLocalPoint(s.width/2,s.height/2);let a=e,l=e;if(t.absolute||(a+=this.sx,l+=this.sy),t.scaleGrid&&(a=Math.round(a/t.scaleGrid)*t.scaleGrid,l=Math.round(l/t.scaleGrid)*t.scaleGrid),t.maxScale&&(a=Math.min(t.maxScale,a),l=Math.min(t.maxScale,l)),t.minScale&&(a=Math.max(t.minScale,a),l=Math.max(t.minScale,l)),a=this.graph.transform.clampScale(a),l=this.graph.transform.clampScale(l),t.center){const c=a/this.sx,u=l/this.sy;r=t.center.x-(t.center.x-o.x)/c,i=t.center.y-(t.center.y-o.y)/u}else r=o.x,i=o.y;return this.beforeManipulation(),this.graph.transform.scale(a,l),this.centerPoint(r,i),this.afterManipulation(),this}zoomToRect(e,t={}){const r=D.create(e),i=this.graph;if(t.contentArea=r,t.viewportArea==null){const o=this.container.getBoundingClientRect();t.viewportArea={x:i.options.x,y:i.options.y,width:o.width,height:o.height}}this.beforeManipulation(),i.transform.scaleContentToFitImpl(t,!1);const s=r.getCenter();return this.centerPoint(s.x,s.y),this.afterManipulation(),this}zoomToFit(e={}){return this.zoomToRect(this.graph.getContentArea(e),e)}transitionToPoint(e,t,r){typeof e=="object"?(r=t,t=e.y,e=e.x):t=t,r==null&&(r={});let i,s;const o=this.sx,a=Math.max(r.scale||o,1e-6),l=this.getClientSize(),c=new P(e,t),u=this.clientToLocalPoint(l.width/2,l.height/2);if(o===a){const f=u.diff(c).scale(o,o).round();i=`translate(${f.x}px,${f.y}px)`}else{const f=a/(o-a)*c.distance(u),d=u.clone().move(c,f),g=this.localToBackgroundPoint(d).round();i=`scale(${a/o})`,s=`${g.x}px ${g.y}px`}const h=r.onTransitionEnd;return J(this.container,st.transitionClassName),Se.off(this.content,st.transitionEventName),Se.on(this.content,st.transitionEventName,f=>{this.syncTransition(a,{x:e,y:t}),typeof h=="function"&&K(h,this,f.originalEvent)}),pe(this.content,{transform:i,transformOrigin:s,transition:"transform",transitionDuration:r.duration||"1s",transitionDelay:r.delay,transitionTimingFunction:r.timing}),this}syncTransition(e,t){return this.beforeManipulation(),this.graph.scale(e),this.removeTransition(),this.centerPoint(t.x,t.y),this.afterManipulation(),this}removeTransition(){return gt(this.container,st.transitionClassName),Se.off(this.content,st.transitionEventName),pe(this.content,{transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(e,t={}){const r=D.create(e),i=t.maxScale||1/0,s=t.minScale||Number.MIN_VALUE,o=t.scaleGrid||null,a=t.visibility||1,l=t.center?P.create(t.center):r.getCenter(),c=this.getClientSize(),u=c.width*a,h=c.height*a;let f=new D(l.x-u/2,l.y-h/2,u,h).getMaxUniformScaleToFit(r,l);return f=Math.min(f,i),o&&(f=Math.floor(f/o)*o),f=Math.max(s,f),this.transitionToPoint(l,Object.assign({scale:f},t))}startPanning(e){const t=this.normalizeEvent(e);this.clientX=t.clientX,this.clientY=t.clientY,this.trigger("pan:start",{e:t}),Se.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),Se.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(e){const t=this.normalizeEvent(e),r=t.clientX-this.clientX,i=t.clientY-this.clientY;this.container.scrollTop-=i,this.container.scrollLeft-=r,this.clientX=t.clientX,this.clientY=t.clientY,this.trigger("panning",{e:t})}stopPanning(e){Se.off(document.body,".panning"),Se.off(window,".panning"),this.trigger("pan:stop",{e})}clientToLocalPoint(e,t){let r=typeof e=="object"?e.x:e,i=typeof e=="object"?e.y:t;const s=this.graph.matrix();return r+=this.container.scrollLeft-this.padding.left-s.e,i+=this.container.scrollTop-this.padding.top-s.f,new P(r/s.a,i/s.d)}localToBackgroundPoint(e,t){const r=typeof e=="object"?P.create(e):new P(e,t),i=this.graph.matrix(),s=this.padding;return fe.transformPoint(r,i).translate(s.left,s.top)}resize(e,t){let r=e!=null?e:this.container.offsetWidth,i=t!=null?t:this.container.offsetHeight;typeof r=="number"&&(r=Math.round(r)),typeof i=="number"&&(i=Math.round(i)),this.options.width=r,this.options.height=i,pe(this.container,{width:r,height:i}),this.update()}getClientSize(){return this.cachedClientSize?this.cachedClientSize:{width:this.container.clientWidth,height:this.container.clientHeight}}autoScroll(e,t){const i=this.container,s=i.getBoundingClientRect();let o=0,a=0;return e<=s.left+10&&(o=-10),t<=s.top+10&&(a=-10),e>=s.right-10&&(o=10),t>=s.bottom-10&&(a=10),o!==0&&(i.scrollLeft+=o),a!==0&&(i.scrollTop+=a),{scrollerX:o,scrollerY:a}}addPadding(e,t,r,i){let s=this.getPadding();this.padding={left:Math.round(s.left+(e||0)),top:Math.round(s.top+(r||0)),bottom:Math.round(s.bottom+(i||0)),right:Math.round(s.right+(t||0))},s=this.padding,pe(this.content,{width:s.left+this.graph.options.width+s.right,height:s.top+this.graph.options.height+s.bottom});const o=this.graph.container;return o.style.left=`${this.padding.left}px`,o.style.top=`${this.padding.top}px`,this}getPadding(){const e=this.options.padding;return Rn(typeof e=="function"?K(e,this,this):e)}getVisibleArea(){const e=this.graph.matrix(),t=this.getClientSize(),r={x:this.container.scrollLeft||0,y:this.container.scrollTop||0,width:t.width,height:t.height},i=fe.transformRectangle(r,e.inverse());return i.x-=(this.padding.left||0)/this.sx,i.y-=(this.padding.top||0)/this.sy,i}isCellVisible(e,t={}){const r=e.getBBox(),i=this.getVisibleArea();return t.strict?i.containsRect(r):i.isIntersectWithRect(r)}isPointVisible(e){return this.getVisibleArea().containsPoint(e)}lock(){return pe(this.container,{overflow:"hidden"}),this}unlock(){return pe(this.container,{overflow:"scroll"}),this}onRemove(){this.stopListening()}dispose(){No(this.container,this.graph.container),this.remove()}}WG([de.dispose()],st.prototype,"dispose",null),function(n){class e extends lc{get elem(){return this.scroller.background}constructor(r){super(r.graph),this.scroller=r,r.options.background&&this.draw(r.options.background)}init(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}updateBackgroundOptions(r){this.scroller.options.background=r}}n.Background=e}(st||(st={})),function(n){n.containerClass="graph-scroller",n.panningClass=`${n.containerClass}-panning`,n.pannableClass=`${n.containerClass}-pannable`,n.pagedClass=`${n.containerClass}-paged`,n.contentClass=`${n.containerClass}-content`,n.backgroundClass=`${n.containerClass}-background`,n.transitionClassName="transition-in-progress",n.transitionEventName="transitionend.graph-scroller-transition",n.defaultOptions={padding(){const t=this.getClientSize(),r=Math.max(this.options.minVisibleWidth||0,1)||1,i=Math.max(this.options.minVisibleHeight||0,1)||1,s=Math.max(t.width-r,0),o=Math.max(t.height-i,0);return{left:s,top:o,right:s,bottom:o}},minVisibleWidth:50,minVisibleHeight:50,pageVisible:!1,pageBreak:!1,autoResize:!0};function e(t){const r=Ie({},n.defaultOptions,t);r.pageWidth==null&&(r.pageWidth=t.graph.options.width),r.pageHeight==null&&(r.pageHeight=t.graph.options.height);const i=t.graph.options;return i.background&&r.enabled&&r.background==null&&(r.background=i.background,t.graph.background.clear()),r}n.getOptions=e}(st||(st={}));const YG=`.x6-graph-scroller {
288
+ `;var HG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Xw extends ge{get scroller(){return this.graph.getPlugin("scroller")}get graphContainer(){return this.scroller?this.scroller.container:this.graph.container}constructor(e){super(),this.name="minimap",this.options=Object.assign(Object.assign({},uc.defaultOptions),e),Vo(this.name,GG)}init(e){this.graph=e,this.updateViewport=kh(this.updateViewport.bind(this),0),this.container=document.createElement("div"),K(this.container,this.prefixClassName(ea.root));const t=document.createElement("div");this.container.appendChild(t),this.viewport=document.createElement("div"),K(this.viewport,this.prefixClassName(ea.viewport)),this.options.scalable&&(this.zoomHandle=document.createElement("div"),K(this.zoomHandle,this.prefixClassName(ea.zoom)),Ar(this.zoomHandle,this.viewport)),jn(this.container,this.viewport),me(this.container,{width:this.options.width,height:this.options.height,padding:this.options.padding}),this.options.container&&this.options.container.appendChild(this.container),this.sourceGraph=this.graph;const r=Object.assign(Object.assign({},this.options.graphOptions),{container:t,model:this.sourceGraph.model,interacting:!1,grid:!1,background:!1,embedding:!1});this.targetGraph=this.options.createGraph?this.options.createGraph(r):new V(r),this.updatePaper(this.sourceGraph.options.width,this.sourceGraph.options.height),this.startListening()}startListening(){this.scroller?Pe.on(this.graphContainer,`scroll${this.getEventNamespace()}`,this.updateViewport):(this.sourceGraph.on("translate",this.onTransform,this),this.sourceGraph.on("scale",this.onTransform,this),this.sourceGraph.on("model:updated",this.onModelUpdated,this)),this.sourceGraph.on("resize",this.updatePaper,this),this.delegateEvents({mousedown:"startAction",touchstart:"startAction",[`mousedown .${this.prefixClassName("graph")}`]:"scrollTo",[`touchstart .${this.prefixClassName("graph")}`]:"scrollTo"})}stopListening(){this.scroller?Pe.off(this.graphContainer,this.getEventNamespace()):(this.sourceGraph.off("translate",this.onTransform,this),this.sourceGraph.off("scale",this.onTransform,this),this.sourceGraph.off("model:updated",this.onModelUpdated,this)),this.sourceGraph.off("resize",this.updatePaper,this),this.undelegateEvents()}onRemove(){this.stopListening(),this.targetGraph.model=new zn,this.targetGraph.dispose()}onTransform(e){(e.ui||this.targetGraphTransforming)&&this.updateViewport()}onModelUpdated(){this.targetGraph.zoomToFit()}updatePaper(e,t){let r,i;typeof e=="object"?(r=e.width,i=e.height):(r=e,i=t);const s=this.sourceGraph.options,o=this.sourceGraph.transform.getScale(),a=this.options.width-2*this.options.padding,l=this.options.height-2*this.options.padding;r/=o.sx,i/=o.sy,this.ratio=Math.min(a/r,l/i);const c=this.ratio,u=s.x*c/o.sx,h=s.y*c/o.sy;return r*=c,i*=c,this.targetGraph.resize(r,i),this.targetGraph.translate(u,h),this.scroller?this.targetGraph.scale(c,c):this.targetGraph.zoomToFit(),this.updateViewport(),this}updateViewport(){const e=this.sourceGraph.transform.getScale(),t=this.targetGraph.transform.getScale();let r=null;this.scroller?r=this.scroller.clientToLocalPoint(0,0):r=this.graph.graphToLocal(0,0);const i=Q4(this.targetGraph.container),s=this.targetGraph.translate();s.ty=s.ty||0,this.geometry={top:i.top+r.y*t.sy+s.ty,left:i.left+r.x*t.sx+s.tx,width:this.graphContainer.clientWidth*t.sx/e.sx,height:this.graphContainer.clientHeight*t.sy/e.sy},me(this.viewport,this.geometry)}startAction(e){const t=this.normalizeEvent(e),r=t.target===this.zoomHandle?"zooming":"panning",{tx:i,ty:s}=this.sourceGraph.translate(),o={action:r,clientX:t.clientX,clientY:t.clientY,scrollLeft:this.graphContainer.scrollLeft,scrollTop:this.graphContainer.scrollTop,zoom:this.sourceGraph.zoom(),scale:this.sourceGraph.transform.getScale(),geometry:this.geometry,translateX:i,translateY:s};this.targetGraphTransforming=!0,this.delegateDocumentEvents(uc.documentEvents,o)}doAction(e){const t=this.normalizeEvent(e),r=t.clientX,i=t.clientY,s=t.data;switch(s.action){case"panning":{const o=this.sourceGraph.transform.getScale(),a=(r-s.clientX)*o.sx,l=(i-s.clientY)*o.sy;this.scroller?(this.graphContainer.scrollLeft=s.scrollLeft+a/this.ratio,this.graphContainer.scrollTop=s.scrollTop+l/this.ratio):this.sourceGraph.translate(s.translateX-a/this.ratio,s.translateY-l/this.ratio);break}case"zooming":{const o=s.scale,a=s.geometry,l=1+(s.clientX-r)/a.width/o.sx;s.frameId&&cancelAnimationFrame(s.frameId),s.frameId=requestAnimationFrame(()=>{this.sourceGraph.zoom(l*s.zoom,{absolute:!0,minScale:this.options.minScale,maxScale:this.options.maxScale})});break}}}stopAction(){this.undelegateDocumentEvents(),this.targetGraphTransforming=!1}scrollTo(e){const t=this.normalizeEvent(e);let r,i;const s=this.targetGraph.translate();if(s.ty=s.ty||0,t.offsetX==null){const l=Bo(this.targetGraph.container);r=t.pageX-l.left,i=t.pageY-l.top}else r=t.offsetX,i=t.offsetY;const o=(r-s.tx)/this.ratio,a=(i-s.ty)/this.ratio;this.sourceGraph.centerPoint(o,a)}dispose(){this.remove(),qo(this.name)}}HG([ge.dispose()],Xw.prototype,"dispose",null);var ea;(function(n){n.root="widget-minimap",n.viewport=`${n.root}-viewport`,n.zoom=`${n.viewport}-zoom`})(ea||(ea={}));var uc;(function(n){n.defaultOptions={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:e=>new V(e)},n.documentEvents={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"}})(uc||(uc={}));var UG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},WG=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class st extends ge{get graph(){return this.options.graph}get model(){return this.graph.model}constructor(e){super(),this.padding={left:0,top:0,right:0,bottom:0},this.options=st.getOptions(e),this.onUpdate=kh(this.onUpdate,200);const t=this.graph.transform.getScale();this.sx=t.sx,this.sy=t.sy;const r=this.options.width||this.graph.options.width,i=this.options.height||this.graph.options.height;this.container=document.createElement("div"),K(this.container,this.prefixClassName(st.containerClass)),me(this.container,{width:r,height:i}),this.options.pageVisible&&K(this.container,this.prefixClassName(st.pagedClass)),this.options.className&&K(this.container,this.options.className);const s=this.graph.container;s.parentNode&&ko(s,this.container),this.content=document.createElement("div"),K(this.content,this.prefixClassName(st.contentClass)),me(this.content,{width:this.graph.options.width,height:this.graph.options.height}),this.background=document.createElement("div"),K(this.background,this.prefixClassName(st.backgroundClass)),jn(this.content,this.background),this.options.pageVisible||jn(this.content,this.graph.view.grid),jn(this.content,s),Ar(this.content,this.container),this.startListening(),this.options.pageVisible||this.graph.grid.update(),this.backgroundManager=new st.Background(this),this.options.autoResize||this.update()}startListening(){const e=this.graph,t=this.model;e.on("scale",this.onScale,this),e.on("resize",this.onResize,this),e.on("before:print",this.storeScrollPosition,this),e.on("before:export",this.storeScrollPosition,this),e.on("after:print",this.restoreScrollPosition,this),e.on("after:export",this.restoreScrollPosition,this),t.on("reseted",this.onUpdate,this),t.on("cell:added",this.onUpdate,this),t.on("cell:removed",this.onUpdate,this),t.on("cell:changed",this.onUpdate,this),this.delegateBackgroundEvents()}stopListening(){const e=this.graph,t=this.model;e.off("scale",this.onScale,this),e.off("resize",this.onResize,this),e.off("beforeprint",this.storeScrollPosition,this),e.off("beforeexport",this.storeScrollPosition,this),e.off("afterprint",this.restoreScrollPosition,this),e.off("afterexport",this.restoreScrollPosition,this),t.off("reseted",this.onUpdate,this),t.off("cell:added",this.onUpdate,this),t.off("cell:removed",this.onUpdate,this),t.off("cell:changed",this.onUpdate,this),this.undelegateBackgroundEvents()}enableAutoResize(){this.options.autoResize=!0}disableAutoResize(){this.options.autoResize=!1}onUpdate(){this.options.autoResize&&this.update()}delegateBackgroundEvents(e){const t=e||xn.events;this.delegatedHandlers=Object.keys(t).reduce((r,i)=>{const s=t[i];if(i.indexOf(" ")===-1)if(typeof s=="function")r[i]=s;else{let o=this.graph.view[s];typeof o=="function"&&(o=o.bind(this.graph.view),r[i]=o)}return r},{}),this.onBackgroundEvent=this.onBackgroundEvent.bind(this),Object.keys(this.delegatedHandlers).forEach(r=>{this.delegateEvent(r,{guarded:!1},this.onBackgroundEvent)})}undelegateBackgroundEvents(){Object.keys(this.delegatedHandlers).forEach(e=>{this.undelegateEvent(e,this.onBackgroundEvent)})}onBackgroundEvent(e){let t=!1;const r=e.target;if(this.options.pageVisible)this.options.background?t=this.background===r:t=this.content===r;else{const i=this.graph.view;t=i.background===r||i.grid===r}if(t){const i=this.delegatedHandlers[e.type];typeof i=="function"&&i.apply(this.graph,arguments)}}onResize(){this.cachedCenterPoint&&(this.centerPoint(this.cachedCenterPoint.x,this.cachedCenterPoint.y),this.updatePageBreak())}onScale({sx:e,sy:t,ox:r,oy:i}){this.updateScale(e,t),(r||i)&&(this.centerPoint(r,i),this.updatePageBreak()),typeof this.options.autoResizeOptions=="function"&&this.update()}storeScrollPosition(){this.cachedScrollLeft=this.container.scrollLeft,this.cachedScrollTop=this.container.scrollTop}restoreScrollPosition(){this.container.scrollLeft=this.cachedScrollLeft,this.container.scrollTop=this.cachedScrollTop,this.cachedScrollLeft=null,this.cachedScrollTop=null}storeClientSize(){this.cachedClientSize={width:this.container.clientWidth,height:this.container.clientHeight}}restoreClientSize(){this.cachedClientSize=null}beforeManipulation(){(tn.IS_IE||tn.IS_EDGE)&&me(this.container,{visibility:"hidden"})}afterManipulation(){(tn.IS_IE||tn.IS_EDGE)&&me(this.container,{visibility:"visible"})}updatePageSize(e,t){e!=null&&(this.options.pageWidth=e),t!=null&&(this.options.pageHeight=t),this.updatePageBreak()}updatePageBreak(){if(this.pageBreak&&this.pageBreak.parentNode&&this.pageBreak.parentNode.removeChild(this.pageBreak),this.pageBreak=null,this.options.pageVisible&&this.options.pageBreak){const e=this.graph.options.width,t=this.graph.options.height,r=this.options.pageWidth*this.sx,i=this.options.pageHeight*this.sy;if(r===0||i===0)return;if(e>r||t>i){let s=!1;const o=document.createElement("div");for(let a=1,l=Math.floor(e/r);a<l;a+=1){const c=document.createElement("div");K(c,this.prefixClassName("graph-pagebreak-vertical")),me(c,{left:a*r}),Ar(c,o),s=!0}for(let a=1,l=Math.floor(t/i);a<l;a+=1){const c=document.createElement("div");K(c,this.prefixClassName("graph-pagebreak-horizontal")),me(c,{top:a*i}),Ar(c,o),s=!0}s&&(K(o,this.prefixClassName("graph-pagebreak")),f4(this.graph.view.grid,o),this.pageBreak=o)}}}update(){const e=this.getClientSize();this.cachedCenterPoint=this.clientToLocalPoint(e.width/2,e.height/2);let t=this.options.autoResizeOptions;typeof t=="function"&&(t=Y(t,this,this));const r=Object.assign({gridWidth:this.options.pageWidth,gridHeight:this.options.pageHeight,allowNewOrigin:"negative"},t);this.graph.fitToContent(this.getFitToContentOptions(r))}getFitToContentOptions(e){const t=this.sx,r=this.sy;return e.gridWidth&&(e.gridWidth*=t),e.gridHeight&&(e.gridHeight*=r),e.minWidth&&(e.minWidth*=t),e.minHeight&&(e.minHeight*=r),typeof e.padding=="object"?e.padding={left:(e.padding.left||0)*t,right:(e.padding.right||0)*t,top:(e.padding.top||0)*r,bottom:(e.padding.bottom||0)*r}:typeof e.padding=="number"&&(e.padding*=t),this.options.autoResize||(e.contentArea=D.create()),e}updateScale(e,t){const r=this.graph.options,i=e/this.sx,s=t/this.sy;this.sx=e,this.sy=t,this.graph.translate(r.x*i,r.y*s),this.graph.transform.resize(r.width*i,r.height*s)}scrollbarPosition(e,t){if(e==null&&t==null)return{left:this.container.scrollLeft,top:this.container.scrollTop};const r={};return typeof e=="number"&&(r.scrollLeft=e),typeof t=="number"&&(r.scrollTop=t),Jh(this.container,r),this}scrollToPoint(e,t){const r=this.getClientSize(),i=this.graph.matrix(),s={};return typeof e=="number"&&(s.scrollLeft=e-r.width/2+i.e+(this.padding.left||0)),typeof t=="number"&&(s.scrollTop=t-r.height/2+i.f+(this.padding.top||0)),Jh(this.container,s),this}scrollToContent(){const e=this.sx,t=this.sy,r=this.graph.getContentArea().getCenter();return this.scrollToPoint(r.x*e,r.y*t)}scrollToCell(e){const t=this.sx,r=this.sy,i=e.getBBox().getCenter();return this.scrollToPoint(i.x*t,i.y*r)}center(e){return this.centerPoint(e)}centerPoint(e,t,r){const i=this.graph.matrix(),s=i.a,o=i.d,a=-i.e,l=-i.f,c=a+this.graph.options.width,u=l+this.graph.options.height;let h;if(this.storeClientSize(),typeof e=="number"||typeof t=="number"){h=r;const x=this.getVisibleArea().getCenter();typeof e=="number"?e*=s:e=x.x,typeof t=="number"?t*=o:t=x.y}else h=e,e=(a+c)/2,t=(l+u)/2;if(h&&h.padding)return this.positionPoint({x:e,y:t},"50%","50%",h);const f=this.getPadding(),d=this.getClientSize(),g=d.width/2,p=d.height/2,b=g-f.left-e+a,m=g-f.right+e-c,y=p-f.top-t+l,v=p-f.bottom+t-u;this.addPadding(Math.max(b,0),Math.max(m,0),Math.max(y,0),Math.max(v,0));const w=this.scrollToPoint(e,t);return this.restoreClientSize(),w}centerContent(e){return this.positionContent("center",e)}centerCell(e,t){return this.positionCell(e,"center",t)}positionContent(e,t){const r=this.graph.getContentArea(t);return this.positionRect(r,e,t)}positionCell(e,t,r){const i=e.getBBox();return this.positionRect(i,t,r)}positionRect(e,t,r){const i=D.create(e);switch(t){case"center":return this.positionPoint(i.getCenter(),"50%","50%",r);case"top":return this.positionPoint(i.getTopCenter(),"50%",0,r);case"top-right":return this.positionPoint(i.getTopRight(),"100%",0,r);case"right":return this.positionPoint(i.getRightMiddle(),"100%","50%",r);case"bottom-right":return this.positionPoint(i.getBottomRight(),"100%","100%",r);case"bottom":return this.positionPoint(i.getBottomCenter(),"50%","100%",r);case"bottom-left":return this.positionPoint(i.getBottomLeft(),0,"100%",r);case"left":return this.positionPoint(i.getLeftMiddle(),0,"50%",r);case"top-left":return this.positionPoint(i.getTopLeft(),0,0,r);default:return this}}positionPoint(e,t,r,i={}){const{padding:s}=i,o=WG(i,["padding"]),a=Rn(s),l=D.fromSize(this.getClientSize()),c=l.clone().moveAndExpand({x:a.left,y:a.top,width:-a.right-a.left,height:-a.top-a.bottom});t=Vt(t,Math.max(0,c.width)),t<0&&(t=c.width+t),r=Vt(r,Math.max(0,c.height)),r<0&&(r=c.height+r);const u=c.getTopLeft().translate(t,r),h=l.getCenter().diff(u),f=this.zoom(),d=h.scale(1/f,1/f),g=P.create(e).translate(d);return this.centerPoint(g.x,g.y,o)}zoom(e,t){if(e==null)return this.sx;t=t||{};let r,i;const s=this.getClientSize(),o=this.clientToLocalPoint(s.width/2,s.height/2);let a=e,l=e;if(t.absolute||(a+=this.sx,l+=this.sy),t.scaleGrid&&(a=Math.round(a/t.scaleGrid)*t.scaleGrid,l=Math.round(l/t.scaleGrid)*t.scaleGrid),t.maxScale&&(a=Math.min(t.maxScale,a),l=Math.min(t.maxScale,l)),t.minScale&&(a=Math.max(t.minScale,a),l=Math.max(t.minScale,l)),a=this.graph.transform.clampScale(a),l=this.graph.transform.clampScale(l),t.center){const c=a/this.sx,u=l/this.sy;r=t.center.x-(t.center.x-o.x)/c,i=t.center.y-(t.center.y-o.y)/u}else r=o.x,i=o.y;return this.beforeManipulation(),this.graph.transform.scale(a,l),this.centerPoint(r,i),this.afterManipulation(),this}zoomToRect(e,t={}){const r=D.create(e),i=this.graph;if(t.contentArea=r,t.viewportArea==null){const o=this.container.getBoundingClientRect();t.viewportArea={x:i.options.x,y:i.options.y,width:o.width,height:o.height}}this.beforeManipulation(),i.transform.scaleContentToFitImpl(t,!1);const s=r.getCenter();return this.centerPoint(s.x,s.y),this.afterManipulation(),this}zoomToFit(e={}){return this.zoomToRect(this.graph.getContentArea(e),e)}transitionToPoint(e,t,r){typeof e=="object"?(r=t,t=e.y,e=e.x):t=t,r==null&&(r={});let i,s;const o=this.sx,a=Math.max(r.scale||o,1e-6),l=this.getClientSize(),c=new P(e,t),u=this.clientToLocalPoint(l.width/2,l.height/2);if(o===a){const f=u.diff(c).scale(o,o).round();i=`translate(${f.x}px,${f.y}px)`}else{const f=a/(o-a)*c.distance(u),d=u.clone().move(c,f),g=this.localToBackgroundPoint(d).round();i=`scale(${a/o})`,s=`${g.x}px ${g.y}px`}const h=r.onTransitionEnd;return K(this.container,st.transitionClassName),Pe.off(this.content,st.transitionEventName),Pe.on(this.content,st.transitionEventName,f=>{this.syncTransition(a,{x:e,y:t}),typeof h=="function"&&Y(h,this,f.originalEvent)}),me(this.content,{transform:i,transformOrigin:s,transition:"transform",transitionDuration:r.duration||"1s",transitionDelay:r.delay,transitionTimingFunction:r.timing}),this}syncTransition(e,t){return this.beforeManipulation(),this.graph.scale(e),this.removeTransition(),this.centerPoint(t.x,t.y),this.afterManipulation(),this}removeTransition(){return gt(this.container,st.transitionClassName),Pe.off(this.content,st.transitionEventName),me(this.content,{transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(e,t={}){const r=D.create(e),i=t.maxScale||1/0,s=t.minScale||Number.MIN_VALUE,o=t.scaleGrid||null,a=t.visibility||1,l=t.center?P.create(t.center):r.getCenter(),c=this.getClientSize(),u=c.width*a,h=c.height*a;let f=new D(l.x-u/2,l.y-h/2,u,h).getMaxUniformScaleToFit(r,l);return f=Math.min(f,i),o&&(f=Math.floor(f/o)*o),f=Math.max(s,f),this.transitionToPoint(l,Object.assign({scale:f},t))}startPanning(e){const t=this.normalizeEvent(e);this.clientX=t.clientX,this.clientY=t.clientY,this.trigger("pan:start",{e:t}),Pe.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),Pe.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(e){const t=this.normalizeEvent(e),r=t.clientX-this.clientX,i=t.clientY-this.clientY;this.container.scrollTop-=i,this.container.scrollLeft-=r,this.clientX=t.clientX,this.clientY=t.clientY,this.trigger("panning",{e:t})}stopPanning(e){Pe.off(document.body,".panning"),Pe.off(window,".panning"),this.trigger("pan:stop",{e})}clientToLocalPoint(e,t){let r=typeof e=="object"?e.x:e,i=typeof e=="object"?e.y:t;const s=this.graph.matrix();return r+=this.container.scrollLeft-this.padding.left-s.e,i+=this.container.scrollTop-this.padding.top-s.f,new P(r/s.a,i/s.d)}localToBackgroundPoint(e,t){const r=typeof e=="object"?P.create(e):new P(e,t),i=this.graph.matrix(),s=this.padding;return de.transformPoint(r,i).translate(s.left,s.top)}resize(e,t){let r=e!=null?e:this.container.offsetWidth,i=t!=null?t:this.container.offsetHeight;typeof r=="number"&&(r=Math.round(r)),typeof i=="number"&&(i=Math.round(i)),this.options.width=r,this.options.height=i,me(this.container,{width:r,height:i}),this.update()}getClientSize(){return this.cachedClientSize?this.cachedClientSize:{width:this.container.clientWidth,height:this.container.clientHeight}}autoScroll(e,t){const i=this.container,s=i.getBoundingClientRect();let o=0,a=0;return e<=s.left+10&&(o=-10),t<=s.top+10&&(a=-10),e>=s.right-10&&(o=10),t>=s.bottom-10&&(a=10),o!==0&&(i.scrollLeft+=o),a!==0&&(i.scrollTop+=a),{scrollerX:o,scrollerY:a}}addPadding(e,t,r,i){let s=this.getPadding();this.padding={left:Math.round(s.left+(e||0)),top:Math.round(s.top+(r||0)),bottom:Math.round(s.bottom+(i||0)),right:Math.round(s.right+(t||0))},s=this.padding,me(this.content,{width:s.left+this.graph.options.width+s.right,height:s.top+this.graph.options.height+s.bottom});const o=this.graph.container;return o.style.left=`${this.padding.left}px`,o.style.top=`${this.padding.top}px`,this}getPadding(){const e=this.options.padding;return Rn(typeof e=="function"?Y(e,this,this):e)}getVisibleArea(){const e=this.graph.matrix(),t=this.getClientSize(),r={x:this.container.scrollLeft||0,y:this.container.scrollTop||0,width:t.width,height:t.height},i=de.transformRectangle(r,e.inverse());return i.x-=(this.padding.left||0)/this.sx,i.y-=(this.padding.top||0)/this.sy,i}isCellVisible(e,t={}){const r=e.getBBox(),i=this.getVisibleArea();return t.strict?i.containsRect(r):i.isIntersectWithRect(r)}isPointVisible(e){return this.getVisibleArea().containsPoint(e)}lock(){return me(this.container,{overflow:"hidden"}),this}unlock(){return me(this.container,{overflow:"scroll"}),this}onRemove(){this.stopListening()}dispose(){ko(this.container,this.graph.container),this.remove()}}UG([ge.dispose()],st.prototype,"dispose",null),function(n){class e extends lc{get elem(){return this.scroller.background}constructor(r){super(r.graph),this.scroller=r,r.options.background&&this.draw(r.options.background)}init(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}updateBackgroundOptions(r){this.scroller.options.background=r}}n.Background=e}(st||(st={})),function(n){n.containerClass="graph-scroller",n.panningClass=`${n.containerClass}-panning`,n.pannableClass=`${n.containerClass}-pannable`,n.pagedClass=`${n.containerClass}-paged`,n.contentClass=`${n.containerClass}-content`,n.backgroundClass=`${n.containerClass}-background`,n.transitionClassName="transition-in-progress",n.transitionEventName="transitionend.graph-scroller-transition",n.defaultOptions={padding(){const t=this.getClientSize(),r=Math.max(this.options.minVisibleWidth||0,1)||1,i=Math.max(this.options.minVisibleHeight||0,1)||1,s=Math.max(t.width-r,0),o=Math.max(t.height-i,0);return{left:s,top:o,right:s,bottom:o}},minVisibleWidth:50,minVisibleHeight:50,pageVisible:!1,pageBreak:!1,autoResize:!0};function e(t){const r=Ie({},n.defaultOptions,t);r.pageWidth==null&&(r.pageWidth=t.graph.options.width),r.pageHeight==null&&(r.pageHeight=t.graph.options.height);const i=t.graph.options;return i.background&&r.enabled&&r.background==null&&(r.background=i.background,t.graph.background.clear()),r}n.getOptions=e}(st||(st={}));const XG=`.x6-graph-scroller {
289
289
  position: relative;
290
290
  box-sizing: border-box;
291
291
  overflow: scroll;
@@ -343,7 +343,7 @@
343
343
  height: 1px;
344
344
  border-top: 1px dashed #bdbdbd;
345
345
  }
346
- `;V.prototype.lockScroller=function(){const n=this.getPlugin("scroller");return n&&n.lockScroller(),this},V.prototype.unlockScroller=function(){const n=this.getPlugin("scroller");return n&&n.unlockScroller(),this},V.prototype.updateScroller=function(){const n=this.getPlugin("scroller");return n&&n.updateScroller(),this},V.prototype.getScrollbarPosition=function(){const n=this.getPlugin("scroller");return n?n.getScrollbarPosition():{left:0,top:0}},V.prototype.setScrollbarPosition=function(n,e){const t=this.getPlugin("scroller");return t&&t.setScrollbarPosition(n,e),this};var KG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Kw extends wt{get pannable(){return this.options?typeof this.options.pannable=="object"?this.options.pannable.enabled:!!this.options.pannable:!1}get container(){return this.scrollerImpl.container}constructor(e={}){super(),this.name="scroller",this.options=e,Fo(this.name,YG)}init(e){this.graph=e;const t=st.getOptions(Object.assign(Object.assign({enabled:!0},this.options),{graph:e}));this.options=t,this.scrollerImpl=new st(t),this.setup(),this.startListening(),this.updateClassName(),this.scrollerImpl.center()}resize(e,t){this.scrollerImpl.resize(e,t)}resizePage(e,t){this.scrollerImpl.updatePageSize(e,t)}zoom(e,t){return typeof e=="undefined"?this.scrollerImpl.zoom():(this.scrollerImpl.zoom(e,t),this)}zoomTo(e,t={}){return this.scrollerImpl.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})),this}zoomToRect(e,t={}){return this.scrollerImpl.zoomToRect(e,t),this}zoomToFit(e={}){return this.scrollerImpl.zoomToFit(e),this}center(e){return this.centerPoint(e)}centerPoint(e,t,r){return this.scrollerImpl.centerPoint(e,t,r),this}centerContent(e){return this.scrollerImpl.centerContent(e),this}centerCell(e,t){return this.scrollerImpl.centerCell(e,t),this}positionPoint(e,t,r,i={}){return this.scrollerImpl.positionPoint(e,t,r,i),this}positionRect(e,t,r){return this.scrollerImpl.positionRect(e,t,r),this}positionCell(e,t,r){return this.scrollerImpl.positionCell(e,t,r),this}positionContent(e,t){return this.scrollerImpl.positionContent(e,t),this}drawBackground(e,t){return(this.graph.options.background==null||!t)&&this.scrollerImpl.backgroundManager.draw(e),this}clearBackground(e){return(this.graph.options.background==null||!e)&&this.scrollerImpl.backgroundManager.clear(),this}isPannable(){return this.pannable}enablePanning(){this.pannable||(this.options.pannable=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.options.pannable=!1,this.updateClassName())}togglePanning(e){return e==null?this.isPannable()?this.disablePanning():this.enablePanning():e!==this.isPannable()&&(e?this.enablePanning():this.disablePanning()),this}lockScroller(){return this.scrollerImpl.lock(),this}unlockScroller(){return this.scrollerImpl.unlock(),this}updateScroller(){return this.scrollerImpl.update(),this}getScrollbarPosition(){return this.scrollerImpl.scrollbarPosition()}setScrollbarPosition(e,t){return this.scrollerImpl.scrollbarPosition(e,t),this}scrollToPoint(e,t){return this.scrollerImpl.scrollToPoint(e,t),this}scrollToContent(){return this.scrollerImpl.scrollToContent(),this}scrollToCell(e){return this.scrollerImpl.scrollToCell(e),this}transitionToPoint(e,t,r){return this.scrollerImpl.transitionToPoint(e,t,r),this}transitionToRect(e,t={}){return this.scrollerImpl.transitionToRect(e,t),this}enableAutoResize(){this.scrollerImpl.enableAutoResize()}disableAutoResize(){this.scrollerImpl.disableAutoResize()}autoScroll(e,t){return this.scrollerImpl.autoScroll(e,t)}clientToLocalPoint(e,t){return this.scrollerImpl.clientToLocalPoint(e,t)}setup(){this.scrollerImpl.on("*",(e,t)=>{this.trigger(e,t)})}startListening(){let e=[];const t=this.options.pannable;typeof t=="object"?e=t.eventTypes||[]:e=["leftMouseDown"],e.includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),e.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),Se.on(this.scrollerImpl.container,"mousedown",this.onRightMouseDown))}stopListening(){let e=[];const t=this.options.pannable;typeof t=="object"?e=t.eventTypes||[]:e=["leftMouseDown"],e.includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),e.includes("rightMouseDown")&&Se.off(this.scrollerImpl.container,"mousedown",this.onRightMouseDown)}onRightMouseDown(e){e.button===2&&this.allowPanning(e,!0)&&(this.updateClassName(!0),this.scrollerImpl.startPanning(e),this.scrollerImpl.once("pan:stop",()=>this.updateClassName(!1)))}preparePanning({e}){const t=this.allowPanning(e,!0),r=this.graph.getPlugin("selection"),i=r&&r.allowRubberband(e,!0);(t||this.allowPanning(e)&&!i)&&(this.updateClassName(!0),this.scrollerImpl.startPanning(e),this.scrollerImpl.once("pan:stop",()=>this.updateClassName(!1)))}allowPanning(e,t){return this.pannable&&nr.isMatch(e,this.options.modifiers,t)}updateClassName(e){const t=this.scrollerImpl.container,r=sn.prefix("graph-scroller-pannable");this.pannable?(J(t,r),t.dataset.panning=(!!e).toString()):gt(t,r)}dispose(){this.scrollerImpl.dispose(),this.stopListening(),this.off(),Vo(this.name)}}KG([wt.dispose()],Kw.prototype,"dispose",null);var JG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Jw extends de{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName($t.classNames.box)}get $boxes(){return p4(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(e){super(),this.options=e,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new Fw([],{comparator:$t.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.startListening()}startListening(){const e=this.graph,t=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown"},!0),e.on("scale",this.onGraphTransformed,this),e.on("translate",this.onGraphTransformed,this),e.model.on("updated",this.onModelUpdated,this),t.on("added",this.onCellAdded,this),t.on("removed",this.onCellRemoved,this),t.on("reseted",this.onReseted,this),t.on("updated",this.onCollectionUpdated,this),t.on("node:change:position",this.onNodePositionChanged,this),t.on("cell:changed",this.onCellChanged,this)}stopListening(){const e=this.graph,t=this.collection;this.undelegateEvents(),e.off("scale",this.onGraphTransformed,this),e.off("translate",this.onGraphTransformed,this),e.model.off("updated",this.onModelUpdated,this),t.off("added",this.onCellAdded,this),t.off("removed",this.onCellRemoved,this),t.off("reseted",this.onReseted,this),t.off("updated",this.onCollectionUpdated,this),t.off("node:change:position",this.onNodePositionChanged,this),t.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes()}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:e,options:t}){const{showNodeSelectionBox:r,pointerEvents:i}=this.options,{ui:s,selection:o,translateBy:a,snapped:l}=t,c=(r!==!0||i==="none")&&!this.translating&&!o,u=s&&a&&e.id===a;if(c&&(u||l)){this.translating=!0;const h=e.position(),f=e.previous("position"),d=h.x-f.x,g=h.y-f.y;(d!==0||g!==0)&&this.translateSelectedNodes(d,g,e,t),this.translating=!1}}onModelUpdated({removed:e}){e&&e.length&&this.unselect(e)}isEmpty(){return this.length<=0}isSelected(e){return this.collection.has(e)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(e,t={}){t.dryrun=!0;const r=this.filter(Array.isArray(e)?e:[e]);return this.collection.add(r,t),this}unselect(e,t={}){return t.dryrun=!0,this.collection.remove(Array.isArray(e)?e:[e],t),this}reset(e,t={}){if(e){if(t.batch){const c=this.filter(Array.isArray(e)?e:[e]);return this.collection.reset(c,Object.assign(Object.assign({},t),{ui:!0})),this}const r=this.cells,i=this.filter(Array.isArray(e)?e:[e]),s={},o={};r.forEach(c=>s[c.id]=c),i.forEach(c=>o[c.id]=c);const a=[],l=[];return i.forEach(c=>{s[c.id]||a.push(c)}),r.forEach(c=>{o[c.id]||l.push(c)}),l.length&&this.unselect(l,Object.assign(Object.assign({},t),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},t),{ui:!0})),l.length===0&&a.length===0&&this.updateContainer(),this}return this.clean(t)}clean(e={}){return this.length&&(e.batch===!1?this.unselect(this.cells,e):this.collection.reset([],Object.assign(Object.assign({},e),{ui:!0}))),this}setFilter(e){this.options.filter=e}setContent(e){this.options.content=e}startSelecting(e){e=this.normalizeEvent(e),this.clean();let t,r;const i=this.graph.container;if(e.offsetX!=null&&e.offsetY!=null&&i.contains(e.target))t=e.offsetX,r=e.offsetY;else{const s=Do(i),o=i.scrollLeft,a=i.scrollTop;t=e.clientX-s.left+window.pageXOffset+o,r=e.clientY-s.top+window.pageYOffset+a}pe(this.container,{top:r,left:t,width:1,height:1}),this.setEventData(e,{action:"selecting",clientX:e.clientX,clientY:e.clientY,offsetX:t,offsetY:r,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents($t.documentEvents,e.data)}filter(e){const t=this.options.filter;return e.filter(r=>Array.isArray(t)?t.some(i=>typeof i=="string"?r.shape===i:r.id===i.id):typeof t=="function"?K(t,this.graph,r):!0)}stopSelecting(e){const t=this.graph,r=this.getEventData(e);switch(r.action){case"selecting":{let s=J4(this.container),o=Q4(this.container);const a=Do(this.container),l=t.pageToLocal(a.left,a.top),c=t.transform.getScale();s/=c.sx,o/=c.sy;const u=new D(l.x,l.y,s,o),h=this.getCellViewsInArea(u).map(f=>f.cell);this.reset(h,{batch:!0}),this.hideRubberband();break}case"translating":{const s=t.snapToGrid(e.clientX,e.clientY);if(!this.options.following){const o=r;this.updateSelectedNodesPosition({dx:o.clientX-o.originX,dy:o.clientY-o.originY})}this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",e,s.x,s.y);break}default:{this.clean();break}}}onMouseUp(e){this.getEventData(e).action&&(this.stopSelecting(e),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(e){this.options.following||e.stopPropagation();const t=this.normalizeEvent(e);this.options.movable&&this.startTranslating(t);const r=this.getCellViewFromElem(t.target);this.setEventData(t,{activeView:r});const i=this.graph.snapToGrid(t.clientX,t.clientY);this.notifyBoxEvent("box:mousedown",t,i.x,i.y),this.delegateDocumentEvents($t.documentEvents,t.data)}startTranslating(e){this.graph.model.startBatch("move-selection");const t=this.graph.snapToGrid(e.clientX,e.clientY);this.setEventData(e,{action:"translating",clientX:t.x,clientY:t.y,originX:t.x,originY:t.y})}getRestrictArea(){const e=this.graph.options.translating.restrict,t=typeof e=="function"?K(e,this.graph,null):e;return typeof t=="number"?this.graph.transform.getGraphArea().inflate(t):t===!0?this.graph.transform.getGraphArea():t||null}getSelectionOffset(e,t){let r=e.x-t.clientX,i=e.y-t.clientY;const s=this.getRestrictArea();if(s){const o=this.collection.toArray(),a=le.getCellsBBox(o,{deep:!0})||D.create(),l=s.x-a.x,c=s.y-a.y,u=s.x+s.width-(a.x+a.width),h=s.y+s.height-(a.y+a.height);if(r<l&&(r=l),i<c&&(i=c),u<r&&(r=u),h<i&&(i=h),!this.options.following){const f=e.x-t.originX,d=e.y-t.originY;r=f<=l||f>=u?0:r,i=d<=c||d>=h?0:i}}return{dx:r,dy:i}}updateElementPosition(e,t,r){const i=pe(e,"left"),s=pe(e,"top"),o=i?parseFloat(i):0,a=s?parseFloat(s):0;pe(e,"left",o+t),pe(e,"top",a+r)}updateSelectedNodesPosition(e){const{dx:t,dy:r}=e;if(t||r)if(this.translateSelectedNodes(t,r),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{const i=this.graph.transform.getScale();for(let s=0,o=this.$boxes.length;s<o;s+=1)this.updateElementPosition(this.$boxes[s],t*i.sx,r*i.sy);this.updateElementPosition(this.selectionContainer,t*i.sx,r*i.sy)}}autoScrollGraph(e,t){const r=this.graph.getPlugin("scroller");return r?r.autoScroll(e,t):{scrollerX:0,scrollerY:0}}adjustSelection(e){const t=this.normalizeEvent(e),r=this.getEventData(t);switch(r.action){case"selecting":{const s=r;s.moving!==!0&&(Ar(this.container,this.graph.container),this.showRubberband(),s.moving=!0);const{scrollerX:o,scrollerY:a}=this.autoScrollGraph(t.clientX,t.clientY);s.scrollerX+=o,s.scrollerY+=a;const l=t.clientX-s.clientX+s.scrollerX,c=t.clientY-s.clientY+s.scrollerY,u=parseInt(pe(this.container,"left")||"0",10),h=parseInt(pe(this.container,"top")||"0",10);pe(this.container,{left:l<0?s.offsetX+l:u,top:c<0?s.offsetY+c:h,width:Math.abs(l),height:Math.abs(c)});break}case"translating":{const s=this.graph.snapToGrid(t.clientX,t.clientY),o=r,a=this.getSelectionOffset(s,o);this.options.following?this.updateSelectedNodesPosition(a):this.updateContainerPosition(a),a.dx&&(o.clientX=s.x),a.dy&&(o.clientY=s.y),this.notifyBoxEvent("box:mousemove",e,s.x,s.y);break}}this.boxesUpdated=!1}translateSelectedNodes(e,t,r,i){const s={},o=[];if(r&&(s[r.id]=!0),this.collection.toArray().forEach(a=>{a.getDescendants({deep:!0}).forEach(l=>{s[l.id]=!0})}),i&&i.translateBy){const a=this.graph.getCellById(i.translateBy);a&&(s[a.id]=!0,a.getDescendants({deep:!0}).forEach(l=>{s[l.id]=!0}),o.push(a))}this.collection.toArray().forEach(a=>{if(!s[a.id]){const l=Object.assign(Object.assign({},i),{selection:this.cid,exclude:o});a.translate(e,t,l),this.graph.model.getConnectedEdges(a).forEach(c=>{s[c.id]||(c.translate(e,t,l),s[c.id]=!0)})}})}getCellViewsInArea(e){const t=this.graph,r={strict:this.options.strict};let i=[];return this.options.rubberNode&&(i=i.concat(t.model.getNodesInArea(e,r).map(s=>t.renderer.findViewByCell(s)).filter(s=>s!=null))),this.options.rubberEdge&&(i=i.concat(t.model.getEdgesInArea(e,r).map(s=>t.renderer.findViewByCell(s)).filter(s=>s!=null))),i}notifyBoxEvent(e,t,r,i){const o=this.getEventData(t).activeView;this.trigger(e,{e:t,view:o,x:r,y:i,cell:o.cell})}getSelectedClassName(e){return this.prefixClassName(`${e.isNode()?"node":"edge"}-selected`)}addCellSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.addClass(this.getSelectedClassName(e))}removeCellUnSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.removeClass(this.getSelectedClassName(e))}destroySelectionBox(e){this.removeCellUnSelectedClassName(e),this.canShowSelectionBox(e)&&(er(this.container.querySelector(`[data-cell-id="${e.id}"]`)),this.$boxes.length===0&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(e){e.forEach(t=>this.removeCellUnSelectedClassName(t)),this.hide(),er(this.$boxes),this.boxCount=0}hide(){gt(this.container,this.prefixClassName($t.classNames.rubberband)),gt(this.container,this.prefixClassName($t.classNames.selected))}showRubberband(){J(this.container,this.prefixClassName($t.classNames.rubberband))}hideRubberband(){gt(this.container,this.prefixClassName($t.classNames.rubberband))}showSelected(){Wh(this.container,"style"),J(this.container,this.prefixClassName($t.classNames.selected))}createContainer(){this.container=document.createElement("div"),J(this.container,this.prefixClassName($t.classNames.root)),this.options.className&&J(this.container,this.options.className),this.selectionContainer=document.createElement("div"),J(this.selectionContainer,this.prefixClassName($t.classNames.inner)),this.selectionContent=document.createElement("div"),J(this.selectionContent,this.prefixClassName($t.classNames.content)),jn(this.selectionContainer,this.selectionContent),he(this.selectionContainer,"data-selection-length",this.collection.length),g1(this.container,this.selectionContainer)}updateContainerPosition(e){(e.dx||e.dy)&&this.updateElementPosition(this.selectionContainer,e.dx,e.dy)}updateContainer(){const e={x:1/0,y:1/0},t={x:0,y:0};this.collection.toArray().filter(s=>this.canShowSelectionBox(s)).forEach(s=>{const o=this.graph.renderer.findViewByCell(s);if(o){const a=o.getBBox({useCellGeometry:!0});e.x=Math.min(e.x,a.x),e.y=Math.min(e.y,a.y),t.x=Math.max(t.x,a.x+a.width),t.y=Math.max(t.y,a.y+a.height)}}),pe(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:t.x-e.x,height:t.y-e.y}),he(this.selectionContainer,"data-selection-length",this.collection.length);const i=this.options.content;if(i)if(typeof i=="function"){const s=K(i,this.graph,this,this.selectionContent);s&&(this.selectionContent.innerHTML=s)}else this.selectionContent.innerHTML=i;this.collection.length>0&&!this.container.parentNode?Ar(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(e){return e.isNode()&&this.options.showNodeSelectionBox===!0||e.isEdge()&&this.options.showEdgeSelectionBox===!0}createSelectionBox(e){if(this.addCellSelectedClassName(e),this.canShowSelectionBox(e)){const t=this.graph.renderer.findViewByCell(e);if(t){const r=t.getBBox({useCellGeometry:!0}),i=this.boxClassName,s=document.createElement("div");J(s,i),J(s,`${i}-${e.isNode()?"node":"edge"}`),he(s,"data-cell-id",e.id),pe(s,{position:"absolute",left:r.x,top:r.y,width:r.width,height:r.height,pointerEvents:this.options.pointerEvents||"auto"}),Ar(s,this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(){this.collection.length>0&&(this.boxesUpdated=!0,this.confirmUpdate())}confirmUpdate(){if(this.boxCount){this.hide();for(let e=0,t=this.$boxes.length;e<t;e+=1){const r=this.$boxes[e],i=he(r,"data-cell-id");er(r);const s=this.collection.get(i);s&&this.createSelectionBox(s)}this.updateContainer()}return 0}getCellViewFromElem(e){const t=e.getAttribute("data-cell-id");if(t){const r=this.collection.get(t);if(r)return this.graph.renderer.findViewByCell(r)}return null}onCellRemoved({cell:e}){this.destroySelectionBox(e),this.updateContainer()}onReseted({previous:e,current:t}){this.destroyAllSelectionBoxes(e),t.forEach(r=>{this.listenCellRemoveEvent(r),this.createSelectionBox(r)}),this.updateContainer()}onCellAdded({cell:e}){this.listenCellRemoveEvent(e),this.createSelectionBox(e),this.updateContainer()}listenCellRemoveEvent(e){e.off("removed",this.onCellRemoved,this),e.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:e,removed:t,options:r}){e.forEach(s=>{this.trigger("cell:selected",{cell:s,options:r}),s.isNode()?this.trigger("node:selected",{cell:s,options:r,node:s}):s.isEdge()&&this.trigger("edge:selected",{cell:s,options:r,edge:s})}),t.forEach(s=>{this.trigger("cell:unselected",{cell:s,options:r}),s.isNode()?this.trigger("node:unselected",{cell:s,options:r,node:s}):s.isEdge()&&this.trigger("edge:unselected",{cell:s,options:r,edge:s})});const i={added:e,removed:t,options:r,selected:this.cells.filter(s=>!!this.graph.getCellById(s.id))};this.trigger("selection:changed",i)}dispose(){this.clean(),this.remove(),this.off()}}JG([de.dispose()],Jw.prototype,"dispose",null);var $t;(function(n){const e="widget-selection";n.classNames={root:e,inner:`${e}-inner`,box:`${e}-box`,content:`${e}-content`,rubberband:`${e}-rubberband`,selected:`${e}-selected`},n.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"};function t(r){return r.getAncestors().length}n.depthComparator=t})($t||($t={}));const QG=`.x6-widget-selection {
346
+ `;V.prototype.lockScroller=function(){const n=this.getPlugin("scroller");return n&&n.lockScroller(),this},V.prototype.unlockScroller=function(){const n=this.getPlugin("scroller");return n&&n.unlockScroller(),this},V.prototype.updateScroller=function(){const n=this.getPlugin("scroller");return n&&n.updateScroller(),this},V.prototype.getScrollbarPosition=function(){const n=this.getPlugin("scroller");return n?n.getScrollbarPosition():{left:0,top:0}},V.prototype.setScrollbarPosition=function(n,e){const t=this.getPlugin("scroller");return t&&t.setScrollbarPosition(n,e),this};var YG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Yw extends wt{get pannable(){return this.options?typeof this.options.pannable=="object"?this.options.pannable.enabled:!!this.options.pannable:!1}get container(){return this.scrollerImpl.container}constructor(e={}){super(),this.name="scroller",this.options=e,Vo(this.name,XG)}init(e){this.graph=e;const t=st.getOptions(Object.assign(Object.assign({enabled:!0},this.options),{graph:e}));this.options=t,this.scrollerImpl=new st(t),this.setup(),this.startListening(),this.updateClassName(),this.scrollerImpl.center()}resize(e,t){this.scrollerImpl.resize(e,t)}resizePage(e,t){this.scrollerImpl.updatePageSize(e,t)}zoom(e,t){return typeof e=="undefined"?this.scrollerImpl.zoom():(this.scrollerImpl.zoom(e,t),this)}zoomTo(e,t={}){return this.scrollerImpl.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})),this}zoomToRect(e,t={}){return this.scrollerImpl.zoomToRect(e,t),this}zoomToFit(e={}){return this.scrollerImpl.zoomToFit(e),this}center(e){return this.centerPoint(e)}centerPoint(e,t,r){return this.scrollerImpl.centerPoint(e,t,r),this}centerContent(e){return this.scrollerImpl.centerContent(e),this}centerCell(e,t){return this.scrollerImpl.centerCell(e,t),this}positionPoint(e,t,r,i={}){return this.scrollerImpl.positionPoint(e,t,r,i),this}positionRect(e,t,r){return this.scrollerImpl.positionRect(e,t,r),this}positionCell(e,t,r){return this.scrollerImpl.positionCell(e,t,r),this}positionContent(e,t){return this.scrollerImpl.positionContent(e,t),this}drawBackground(e,t){return(this.graph.options.background==null||!t)&&this.scrollerImpl.backgroundManager.draw(e),this}clearBackground(e){return(this.graph.options.background==null||!e)&&this.scrollerImpl.backgroundManager.clear(),this}isPannable(){return this.pannable}enablePanning(){this.pannable||(this.options.pannable=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.options.pannable=!1,this.updateClassName())}togglePanning(e){return e==null?this.isPannable()?this.disablePanning():this.enablePanning():e!==this.isPannable()&&(e?this.enablePanning():this.disablePanning()),this}lockScroller(){return this.scrollerImpl.lock(),this}unlockScroller(){return this.scrollerImpl.unlock(),this}updateScroller(){return this.scrollerImpl.update(),this}getScrollbarPosition(){return this.scrollerImpl.scrollbarPosition()}setScrollbarPosition(e,t){return this.scrollerImpl.scrollbarPosition(e,t),this}scrollToPoint(e,t){return this.scrollerImpl.scrollToPoint(e,t),this}scrollToContent(){return this.scrollerImpl.scrollToContent(),this}scrollToCell(e){return this.scrollerImpl.scrollToCell(e),this}transitionToPoint(e,t,r){return this.scrollerImpl.transitionToPoint(e,t,r),this}transitionToRect(e,t={}){return this.scrollerImpl.transitionToRect(e,t),this}enableAutoResize(){this.scrollerImpl.enableAutoResize()}disableAutoResize(){this.scrollerImpl.disableAutoResize()}autoScroll(e,t){return this.scrollerImpl.autoScroll(e,t)}clientToLocalPoint(e,t){return this.scrollerImpl.clientToLocalPoint(e,t)}setup(){this.scrollerImpl.on("*",(e,t)=>{this.trigger(e,t)})}startListening(){let e=[];const t=this.options.pannable;typeof t=="object"?e=t.eventTypes||[]:e=["leftMouseDown"],e.includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),e.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),Pe.on(this.scrollerImpl.container,"mousedown",this.onRightMouseDown))}stopListening(){let e=[];const t=this.options.pannable;typeof t=="object"?e=t.eventTypes||[]:e=["leftMouseDown"],e.includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),e.includes("rightMouseDown")&&Pe.off(this.scrollerImpl.container,"mousedown",this.onRightMouseDown)}onRightMouseDown(e){e.button===2&&this.allowPanning(e,!0)&&(this.updateClassName(!0),this.scrollerImpl.startPanning(e),this.scrollerImpl.once("pan:stop",()=>this.updateClassName(!1)))}preparePanning({e}){const t=this.allowPanning(e,!0),r=this.graph.getPlugin("selection"),i=r&&r.allowRubberband(e,!0);(t||this.allowPanning(e)&&!i)&&(this.updateClassName(!0),this.scrollerImpl.startPanning(e),this.scrollerImpl.once("pan:stop",()=>this.updateClassName(!1)))}allowPanning(e,t){return this.pannable&&nr.isMatch(e,this.options.modifiers,t)}updateClassName(e){const t=this.scrollerImpl.container,r=sn.prefix("graph-scroller-pannable");this.pannable?(K(t,r),t.dataset.panning=(!!e).toString()):gt(t,r)}dispose(){this.scrollerImpl.dispose(),this.stopListening(),this.off(),qo(this.name)}}YG([wt.dispose()],Yw.prototype,"dispose",null);var KG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Kw extends ge{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName($t.classNames.box)}get $boxes(){return g4(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(e){super(),this.options=e,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new zw([],{comparator:$t.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.startListening()}startListening(){const e=this.graph,t=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown"},!0),e.on("scale",this.onGraphTransformed,this),e.on("translate",this.onGraphTransformed,this),e.model.on("updated",this.onModelUpdated,this),t.on("added",this.onCellAdded,this),t.on("removed",this.onCellRemoved,this),t.on("reseted",this.onReseted,this),t.on("updated",this.onCollectionUpdated,this),t.on("node:change:position",this.onNodePositionChanged,this),t.on("cell:changed",this.onCellChanged,this)}stopListening(){const e=this.graph,t=this.collection;this.undelegateEvents(),e.off("scale",this.onGraphTransformed,this),e.off("translate",this.onGraphTransformed,this),e.model.off("updated",this.onModelUpdated,this),t.off("added",this.onCellAdded,this),t.off("removed",this.onCellRemoved,this),t.off("reseted",this.onReseted,this),t.off("updated",this.onCollectionUpdated,this),t.off("node:change:position",this.onNodePositionChanged,this),t.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes()}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:e,options:t}){const{showNodeSelectionBox:r,pointerEvents:i}=this.options,{ui:s,selection:o,translateBy:a,snapped:l}=t,c=(r!==!0||i==="none")&&!this.translating&&!o,u=s&&a&&e.id===a;if(c&&(u||l)){this.translating=!0;const h=e.position(),f=e.previous("position"),d=h.x-f.x,g=h.y-f.y;(d!==0||g!==0)&&this.translateSelectedNodes(d,g,e,t),this.translating=!1}}onModelUpdated({removed:e}){e&&e.length&&this.unselect(e)}isEmpty(){return this.length<=0}isSelected(e){return this.collection.has(e)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(e,t={}){t.dryrun=!0;const r=this.filter(Array.isArray(e)?e:[e]);return this.collection.add(r,t),this}unselect(e,t={}){return t.dryrun=!0,this.collection.remove(Array.isArray(e)?e:[e],t),this}reset(e,t={}){if(e){if(t.batch){const c=this.filter(Array.isArray(e)?e:[e]);return this.collection.reset(c,Object.assign(Object.assign({},t),{ui:!0})),this}const r=this.cells,i=this.filter(Array.isArray(e)?e:[e]),s={},o={};r.forEach(c=>s[c.id]=c),i.forEach(c=>o[c.id]=c);const a=[],l=[];return i.forEach(c=>{s[c.id]||a.push(c)}),r.forEach(c=>{o[c.id]||l.push(c)}),l.length&&this.unselect(l,Object.assign(Object.assign({},t),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},t),{ui:!0})),l.length===0&&a.length===0&&this.updateContainer(),this}return this.clean(t)}clean(e={}){return this.length&&(e.batch===!1?this.unselect(this.cells,e):this.collection.reset([],Object.assign(Object.assign({},e),{ui:!0}))),this}setFilter(e){this.options.filter=e}setContent(e){this.options.content=e}startSelecting(e){e=this.normalizeEvent(e),this.clean();let t,r;const i=this.graph.container;if(e.offsetX!=null&&e.offsetY!=null&&i.contains(e.target))t=e.offsetX,r=e.offsetY;else{const s=Bo(i),o=i.scrollLeft,a=i.scrollTop;t=e.clientX-s.left+window.pageXOffset+o,r=e.clientY-s.top+window.pageYOffset+a}me(this.container,{top:r,left:t,width:1,height:1}),this.setEventData(e,{action:"selecting",clientX:e.clientX,clientY:e.clientY,offsetX:t,offsetY:r,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents($t.documentEvents,e.data)}filter(e){const t=this.options.filter;return e.filter(r=>Array.isArray(t)?t.some(i=>typeof i=="string"?r.shape===i:r.id===i.id):typeof t=="function"?Y(t,this.graph,r):!0)}stopSelecting(e){const t=this.graph,r=this.getEventData(e);switch(r.action){case"selecting":{let s=K4(this.container),o=J4(this.container);const a=Bo(this.container),l=t.pageToLocal(a.left,a.top),c=t.transform.getScale();s/=c.sx,o/=c.sy;const u=new D(l.x,l.y,s,o),h=this.getCellViewsInArea(u).map(f=>f.cell);this.reset(h,{batch:!0}),this.hideRubberband();break}case"translating":{const s=t.snapToGrid(e.clientX,e.clientY);if(!this.options.following){const o=r;this.updateSelectedNodesPosition({dx:o.clientX-o.originX,dy:o.clientY-o.originY})}this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",e,s.x,s.y);break}default:{this.clean();break}}}onMouseUp(e){this.getEventData(e).action&&(this.stopSelecting(e),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(e){this.options.following||e.stopPropagation();const t=this.normalizeEvent(e);this.options.movable&&this.startTranslating(t);const r=this.getCellViewFromElem(t.target);this.setEventData(t,{activeView:r});const i=this.graph.snapToGrid(t.clientX,t.clientY);this.notifyBoxEvent("box:mousedown",t,i.x,i.y),this.delegateDocumentEvents($t.documentEvents,t.data)}startTranslating(e){this.graph.model.startBatch("move-selection");const t=this.graph.snapToGrid(e.clientX,e.clientY);this.setEventData(e,{action:"translating",clientX:t.x,clientY:t.y,originX:t.x,originY:t.y})}getRestrictArea(){const e=this.graph.options.translating.restrict,t=typeof e=="function"?Y(e,this.graph,null):e;return typeof t=="number"?this.graph.transform.getGraphArea().inflate(t):t===!0?this.graph.transform.getGraphArea():t||null}getSelectionOffset(e,t){let r=e.x-t.clientX,i=e.y-t.clientY;const s=this.getRestrictArea();if(s){const o=this.collection.toArray(),a=le.getCellsBBox(o,{deep:!0})||D.create(),l=s.x-a.x,c=s.y-a.y,u=s.x+s.width-(a.x+a.width),h=s.y+s.height-(a.y+a.height);if(r<l&&(r=l),i<c&&(i=c),u<r&&(r=u),h<i&&(i=h),!this.options.following){const f=e.x-t.originX,d=e.y-t.originY;r=f<=l||f>=u?0:r,i=d<=c||d>=h?0:i}}return{dx:r,dy:i}}updateElementPosition(e,t,r){const i=me(e,"left"),s=me(e,"top"),o=i?parseFloat(i):0,a=s?parseFloat(s):0;me(e,"left",o+t),me(e,"top",a+r)}updateSelectedNodesPosition(e){const{dx:t,dy:r}=e;if(t||r)if(this.translateSelectedNodes(t,r),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{const i=this.graph.transform.getScale();for(let s=0,o=this.$boxes.length;s<o;s+=1)this.updateElementPosition(this.$boxes[s],t*i.sx,r*i.sy);this.updateElementPosition(this.selectionContainer,t*i.sx,r*i.sy)}}autoScrollGraph(e,t){const r=this.graph.getPlugin("scroller");return r?r.autoScroll(e,t):{scrollerX:0,scrollerY:0}}adjustSelection(e){const t=this.normalizeEvent(e),r=this.getEventData(t);switch(r.action){case"selecting":{const s=r;s.moving!==!0&&(Ar(this.container,this.graph.container),this.showRubberband(),s.moving=!0);const{scrollerX:o,scrollerY:a}=this.autoScrollGraph(t.clientX,t.clientY);s.scrollerX+=o,s.scrollerY+=a;const l=t.clientX-s.clientX+s.scrollerX,c=t.clientY-s.clientY+s.scrollerY,u=parseInt(me(this.container,"left")||"0",10),h=parseInt(me(this.container,"top")||"0",10);me(this.container,{left:l<0?s.offsetX+l:u,top:c<0?s.offsetY+c:h,width:Math.abs(l),height:Math.abs(c)});break}case"translating":{const s=this.graph.snapToGrid(t.clientX,t.clientY),o=r,a=this.getSelectionOffset(s,o);this.options.following?this.updateSelectedNodesPosition(a):this.updateContainerPosition(a),a.dx&&(o.clientX=s.x),a.dy&&(o.clientY=s.y),this.notifyBoxEvent("box:mousemove",e,s.x,s.y);break}}this.boxesUpdated=!1}translateSelectedNodes(e,t,r,i){const s={},o=[];if(r&&(s[r.id]=!0),this.collection.toArray().forEach(a=>{a.getDescendants({deep:!0}).forEach(l=>{s[l.id]=!0})}),i&&i.translateBy){const a=this.graph.getCellById(i.translateBy);a&&(s[a.id]=!0,a.getDescendants({deep:!0}).forEach(l=>{s[l.id]=!0}),o.push(a))}this.collection.toArray().forEach(a=>{if(!s[a.id]){const l=Object.assign(Object.assign({},i),{selection:this.cid,exclude:o});a.translate(e,t,l),this.graph.model.getConnectedEdges(a).forEach(c=>{s[c.id]||(c.translate(e,t,l),s[c.id]=!0)})}})}getCellViewsInArea(e){const t=this.graph,r={strict:this.options.strict};let i=[];return this.options.rubberNode&&(i=i.concat(t.model.getNodesInArea(e,r).map(s=>t.renderer.findViewByCell(s)).filter(s=>s!=null))),this.options.rubberEdge&&(i=i.concat(t.model.getEdgesInArea(e,r).map(s=>t.renderer.findViewByCell(s)).filter(s=>s!=null))),i}notifyBoxEvent(e,t,r,i){const o=this.getEventData(t).activeView;this.trigger(e,{e:t,view:o,x:r,y:i,cell:o.cell})}getSelectedClassName(e){return this.prefixClassName(`${e.isNode()?"node":"edge"}-selected`)}addCellSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.addClass(this.getSelectedClassName(e))}removeCellUnSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.removeClass(this.getSelectedClassName(e))}destroySelectionBox(e){this.removeCellUnSelectedClassName(e),this.canShowSelectionBox(e)&&(er(this.container.querySelector(`[data-cell-id="${e.id}"]`)),this.$boxes.length===0&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(e){e.forEach(t=>this.removeCellUnSelectedClassName(t)),this.hide(),er(this.$boxes),this.boxCount=0}hide(){gt(this.container,this.prefixClassName($t.classNames.rubberband)),gt(this.container,this.prefixClassName($t.classNames.selected))}showRubberband(){K(this.container,this.prefixClassName($t.classNames.rubberband))}hideRubberband(){gt(this.container,this.prefixClassName($t.classNames.rubberband))}showSelected(){Wh(this.container,"style"),K(this.container,this.prefixClassName($t.classNames.selected))}createContainer(){this.container=document.createElement("div"),K(this.container,this.prefixClassName($t.classNames.root)),this.options.className&&K(this.container,this.options.className),this.selectionContainer=document.createElement("div"),K(this.selectionContainer,this.prefixClassName($t.classNames.inner)),this.selectionContent=document.createElement("div"),K(this.selectionContent,this.prefixClassName($t.classNames.content)),jn(this.selectionContainer,this.selectionContent),fe(this.selectionContainer,"data-selection-length",this.collection.length),d1(this.container,this.selectionContainer)}updateContainerPosition(e){(e.dx||e.dy)&&this.updateElementPosition(this.selectionContainer,e.dx,e.dy)}updateContainer(){const e={x:1/0,y:1/0},t={x:0,y:0};this.collection.toArray().filter(s=>this.canShowSelectionBox(s)).forEach(s=>{const o=this.graph.renderer.findViewByCell(s);if(o){const a=o.getBBox({useCellGeometry:!0});e.x=Math.min(e.x,a.x),e.y=Math.min(e.y,a.y),t.x=Math.max(t.x,a.x+a.width),t.y=Math.max(t.y,a.y+a.height)}}),me(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:t.x-e.x,height:t.y-e.y}),fe(this.selectionContainer,"data-selection-length",this.collection.length);const i=this.options.content;if(i)if(typeof i=="function"){const s=Y(i,this.graph,this,this.selectionContent);s&&(this.selectionContent.innerHTML=s)}else this.selectionContent.innerHTML=i;this.collection.length>0&&!this.container.parentNode?Ar(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(e){return e.isNode()&&this.options.showNodeSelectionBox===!0||e.isEdge()&&this.options.showEdgeSelectionBox===!0}createSelectionBox(e){if(this.addCellSelectedClassName(e),this.canShowSelectionBox(e)){const t=this.graph.renderer.findViewByCell(e);if(t){const r=t.getBBox({useCellGeometry:!0}),i=this.boxClassName,s=document.createElement("div");K(s,i),K(s,`${i}-${e.isNode()?"node":"edge"}`),fe(s,"data-cell-id",e.id),me(s,{position:"absolute",left:r.x,top:r.y,width:r.width,height:r.height,pointerEvents:this.options.pointerEvents||"auto"}),Ar(s,this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(){this.collection.length>0&&(this.boxesUpdated=!0,this.confirmUpdate())}confirmUpdate(){if(this.boxCount){this.hide();for(let e=0,t=this.$boxes.length;e<t;e+=1){const r=this.$boxes[e],i=fe(r,"data-cell-id");er(r);const s=this.collection.get(i);s&&this.createSelectionBox(s)}this.updateContainer()}return 0}getCellViewFromElem(e){const t=e.getAttribute("data-cell-id");if(t){const r=this.collection.get(t);if(r)return this.graph.renderer.findViewByCell(r)}return null}onCellRemoved({cell:e}){this.destroySelectionBox(e),this.updateContainer()}onReseted({previous:e,current:t}){this.destroyAllSelectionBoxes(e),t.forEach(r=>{this.listenCellRemoveEvent(r),this.createSelectionBox(r)}),this.updateContainer()}onCellAdded({cell:e}){this.listenCellRemoveEvent(e),this.createSelectionBox(e),this.updateContainer()}listenCellRemoveEvent(e){e.off("removed",this.onCellRemoved,this),e.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:e,removed:t,options:r}){e.forEach(s=>{this.trigger("cell:selected",{cell:s,options:r}),s.isNode()?this.trigger("node:selected",{cell:s,options:r,node:s}):s.isEdge()&&this.trigger("edge:selected",{cell:s,options:r,edge:s})}),t.forEach(s=>{this.trigger("cell:unselected",{cell:s,options:r}),s.isNode()?this.trigger("node:unselected",{cell:s,options:r,node:s}):s.isEdge()&&this.trigger("edge:unselected",{cell:s,options:r,edge:s})});const i={added:e,removed:t,options:r,selected:this.cells.filter(s=>!!this.graph.getCellById(s.id))};this.trigger("selection:changed",i)}dispose(){this.clean(),this.remove(),this.off()}}KG([ge.dispose()],Kw.prototype,"dispose",null);var $t;(function(n){const e="widget-selection";n.classNames={root:e,inner:`${e}-inner`,box:`${e}-box`,content:`${e}-content`,rubberband:`${e}-rubberband`,selected:`${e}-selected`},n.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"};function t(r){return r.getAncestors().length}n.depthComparator=t})($t||($t={}));const JG=`.x6-widget-selection {
347
347
  position: absolute;
348
348
  top: 0;
349
349
  left: 0;
@@ -408,7 +408,7 @@
408
408
  font-size: 10px;
409
409
  background-color: #6a6b8a;
410
410
  }
411
- `;V.prototype.isSelectionEnabled=function(){const n=this.getPlugin("selection");return n?n.isEnabled():!1},V.prototype.enableSelection=function(){const n=this.getPlugin("selection");return n&&n.enable(),this},V.prototype.disableSelection=function(){const n=this.getPlugin("selection");return n&&n.disable(),this},V.prototype.toggleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleEnabled(n),this},V.prototype.isMultipleSelection=function(){const n=this.getPlugin("selection");return n?n.isMultipleSelection():!1},V.prototype.enableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.enableMultipleSelection(),this},V.prototype.disableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.disableMultipleSelection(),this},V.prototype.toggleMultipleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleMultipleSelection(n),this},V.prototype.isSelectionMovable=function(){const n=this.getPlugin("selection");return n?n.isSelectionMovable():!1},V.prototype.enableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.enableSelectionMovable(),this},V.prototype.disableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.disableSelectionMovable(),this},V.prototype.toggleSelectionMovable=function(n){const e=this.getPlugin("selection");return e&&e.toggleSelectionMovable(n),this},V.prototype.isRubberbandEnabled=function(){const n=this.getPlugin("selection");return n?n.isRubberbandEnabled():!1},V.prototype.enableRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableRubberband(),this},V.prototype.disableRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableRubberband(),this},V.prototype.toggleRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleRubberband(n),this},V.prototype.isStrictRubberband=function(){const n=this.getPlugin("selection");return n?n.isStrictRubberband():!1},V.prototype.enableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableStrictRubberband(),this},V.prototype.disableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableStrictRubberband(),this},V.prototype.toggleStrictRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleStrictRubberband(n),this},V.prototype.setRubberbandModifiers=function(n){const e=this.getPlugin("selection");return e&&e.setRubberbandModifiers(n),this},V.prototype.setSelectionFilter=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionFilter(n),this},V.prototype.setSelectionDisplayContent=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionDisplayContent(n),this},V.prototype.isSelectionEmpty=function(){const n=this.getPlugin("selection");return n?n.isEmpty():!0},V.prototype.cleanSelection=function(n){const e=this.getPlugin("selection");return e&&e.clean(n),this},V.prototype.resetSelection=function(n,e){const t=this.getPlugin("selection");return t&&t.reset(n,e),this},V.prototype.getSelectedCells=function(){const n=this.getPlugin("selection");return n?n.getSelectedCells():[]},V.prototype.getSelectedCellCount=function(){const n=this.getPlugin("selection");return n?n.getSelectedCellCount():0},V.prototype.isSelected=function(n){const e=this.getPlugin("selection");return e?e.isSelected(n):!1},V.prototype.select=function(n,e){const t=this.getPlugin("selection");return t&&t.select(n,e),this},V.prototype.unselect=function(n,e){const t=this.getPlugin("selection");return t?t.unselect(n,e):this};var ZG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Is extends wt{get rubberbandDisabled(){return this.options.enabled!==!0||this.options.rubberband!==!0}get disabled(){return this.options.enabled!==!0}get length(){return this.selectionImpl.length}get cells(){return this.selectionImpl.cells}constructor(e={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Ie({enabled:!0},Is.defaultOptions,e),Fo(this.name,QG)}init(e){this.graph=e,this.selectionImpl=new Jw(Object.assign(Object.assign({},this.options),{graph:e})),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isMultipleSelection(){return this.isMultiple()}enableMultipleSelection(){return this.enableMultiple(),this}disableMultipleSelection(){return this.disableMultiple(),this}toggleMultipleSelection(e){return e!=null?e!==this.isMultipleSelection()&&(e?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return this.options.movable!==!1}enableSelectionMovable(){return this.selectionImpl.options.movable=!0,this}disableSelectionMovable(){return this.selectionImpl.options.movable=!1,this}toggleSelectionMovable(e){return e!=null?e!==this.isSelectionMovable()&&(e?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.rubberbandDisabled}enableRubberband(){return this.rubberbandDisabled&&(this.options.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.options.rubberband=!1),this}toggleRubberband(e){return e!=null?e!==this.isRubberbandEnabled()&&(e?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return this.selectionImpl.options.strict===!0}enableStrictRubberband(){return this.selectionImpl.options.strict=!0,this}disableStrictRubberband(){return this.selectionImpl.options.strict=!1,this}toggleStrictRubberband(e){return e!=null?e!==this.isStrictRubberband()&&(e?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(e){this.setModifiers(e)}setSelectionFilter(e){return this.setFilter(e),this}setSelectionDisplayContent(e){return this.setContent(e),this}isEmpty(){return this.length<=0}clean(e={}){return this.selectionImpl.clean(e),this}reset(e,t={}){return this.selectionImpl.reset(e?this.getCells(e):[],t),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(e){return this.selectionImpl.isSelected(e)}select(e,t={}){const r=this.getCells(e);return r.length&&(this.isMultiple()?this.selectionImpl.select(r,t):this.reset(r.slice(0,1),t)),this}unselect(e,t={}){return this.selectionImpl.unselect(this.getCells(e),t),this}setup(){this.selectionImpl.on("*",(e,t)=>{this.trigger(e,t),this.graph.trigger(e,t)})}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e}){const t=this.graph.panning.allowPanning(e,!0),r=this.graph.getPlugin("scroller"),i=r&&r.allowPanning(e,!0);(this.allowRubberband(e,!0)||this.allowRubberband(e)&&!i&&!t)&&this.startRubberband(e)}onBlankClick(){this.clean()}allowRubberband(e,t){return!this.rubberbandDisabled&&nr.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&nr.isMatch(e,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:e}){this.movedMap.set(e,!0)}onCellMouseUp({e,cell:t}){const r=this.options;let i=this.disabled;!i&&this.movedMap.has(t)&&(i=r.selectCellOnMoved===!1,i||(i=r.selectNodeOnMoved===!1&&t.isNode()),i||(i=r.selectEdgeOnMoved===!1&&t.isEdge())),i||(this.allowMultipleSelection(e)?this.unselectMap.has(t)?this.unselectMap.delete(t):this.isSelected(t)?this.unselect(t):this.select(t):this.reset(t)),this.movedMap.delete(t)}onBoxMouseDown({e,cell:t}){this.disabled||this.allowMultipleSelection(e)&&(this.unselect(t),this.unselectMap.set(t,!0))}getCells(e){return(Array.isArray(e)?e:[e]).map(t=>typeof t=="string"?this.graph.getCellById(t):t).filter(t=>t!=null)}startRubberband(e){return this.rubberbandDisabled||this.selectionImpl.startSelecting(e),this}isMultiple(){return this.options.multiple!==!1}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(e){return this.options.modifiers=e,this}setContent(e){return this.selectionImpl.setContent(e),this}setFilter(e){return this.selectionImpl.setFilter(e),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),Vo(this.name)}}ZG([wt.dispose()],Is.prototype,"dispose",null),function(n){n.defaultOptions={rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,following:!0,content:null}}(Is||(Is={}));var e8=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},t8=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class Qw extends de{get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}constructor(e){super();const{graph:t}=e,r=t8(e,["graph"]);this.graph=t,this.options=Object.assign({},r),this.offset={x:0,y:0},this.render(),this.disabled||this.startListening()}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.stopListening())}setFilter(e){this.options.filter=e}render(){const e=this.containerWrapper=new ee("svg"),t=this.horizontal=new ee("line"),r=this.vertical=new ee("line");e.addClass(this.containerClassName),t.addClass(this.horizontalClassName),r.addClass(this.verticalClassName),e.setAttribute("width","100%"),e.setAttribute("height","100%"),t.setAttribute("display","none"),r.setAttribute("display","none"),e.append([t,r]),this.options.className&&e.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}onBatchStop({name:e,data:t}){e==="resize"&&this.snapOnResizing(t.cell,t)}captureCursorOffset({view:e,x:t,y:r}){const i=e.getDelegatedView();if(i&&this.isNodeMovable(i)){const s=e.cell.getPosition();this.offset={x:t-s.x,y:r-s.y}}}isNodeMovable(e){return e&&e.cell.isNode()&&e.can("nodeMovable")}getRestrictArea(e){const t=this.graph.options.translating.restrict,r=typeof t=="function"?K(t,this.graph,e):t;return typeof r=="number"?this.graph.transform.getGraphArea().inflate(r):r===!0?this.graph.transform.getGraphArea():r||null}snapOnResizing(e,t){if(this.options.resizing&&!t.snapped&&t.ui&&t.direction&&t.trueDirection){const r=this.graph.renderer.findViewByCell(e);if(r&&r.cell.isNode()){const i=e.getBBox(),s=i.bbox(e.getAngle()),o=s.getTopLeft(),a=s.getBottomRight(),l=ye.normalize(e.getAngle()),c=this.options.tolerance||0;let u,h,f,d,g,p;const b={vertical:0,horizontal:0},m=t.direction,y=t.trueDirection,v=t.relativeDirection;y.indexOf("right")!==-1?b.vertical=a.x:b.vertical=o.x,y.indexOf("bottom")!==-1?b.horizontal=a.y:b.horizontal=o.y,this.model.getNodes().some(I=>{if(this.isIgnored(e,I))return!1;const G=I.getBBox().bbox(I.getAngle()),Y=G.getTopLeft(),M=G.getBottomRight(),k={vertical:[Y.x,M.x],horizontal:[Y.y,M.y]},Z={};return Object.keys(k).forEach(R=>{const z=R,U=k[z].map(te=>({position:te,distance:Math.abs(te-b[z])})).filter(te=>te.distance<=c);Z[z]=Lb(U,te=>te.distance)}),u==null&&Z.vertical.length>0&&(u=Z.vertical[0].position,h=Math.min(s.y,G.y),f=Math.max(a.y,M.y)-h),d==null&&Z.horizontal.length>0&&(d=Z.horizontal[0].position,g=Math.min(s.x,G.x),p=Math.max(a.x,M.x)-g),u!=null&&d!=null}),this.hide();let w=0,x=0;(d!=null||u!=null)&&(u!=null&&(w=y.indexOf("right")!==-1?u-a.x:o.x-u),d!=null&&(x=y.indexOf("bottom")!==-1?d-a.y:o.y-d));let C=0,S=0;if(l%90===0)l===90||l===270?(C=x,S=w):(C=w,S=x);else{const I=l>=0&&l<90?1:l>=90&&l<180?4:l>=180&&l<270?3:2;d!=null&&u!=null&&(w<x?(x=0,d=void 0):(w=0,u=void 0));const G=ye.toRad(l%90);w&&(C=I===3?w/Math.cos(G):w/Math.sin(G)),x&&(S=I===3?x/Math.cos(G):x/Math.sin(G));const Y=I===1||I===3;switch(v){case"top":case"bottom":S=x?x/(Y?Math.cos(G):Math.sin(G)):w/(Y?Math.sin(G):Math.cos(G));break;case"left":case"right":C=w?w/(Y?Math.cos(G):Math.sin(G)):x/(Y?Math.sin(G):Math.cos(G));break}}switch(v){case"top":case"bottom":C=0;break;case"left":case"right":S=0;break}const E=this.graph.getGridSize();let A=Math.max(i.width+C,E),O=Math.max(i.height+S,E);t.minWidth&&t.minWidth>E&&(A=Math.max(A,t.minWidth)),t.minHeight&&t.minHeight>E&&(O=Math.max(O,t.minHeight)),t.maxWidth&&(A=Math.min(A,t.maxWidth)),t.maxHeight&&(O=Math.min(O,t.maxHeight)),t.preserveAspectRatio&&(S<C?O=A*(i.height/i.width):A=O*(i.width/i.height)),(A!==i.width||O!==i.height)&&(e.resize(A,O,{direction:m,relativeDirection:v,trueDirection:y,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(r)}),f&&(f+=O-i.height),p&&(p+=A-i.width));const T=e.getBBox().bbox(l);u&&Math.abs(T.x-u)>1&&Math.abs(T.width+T.x-u)>1&&(u=void 0),d&&Math.abs(T.y-d)>1&&Math.abs(T.height+T.y-d)>1&&(d=void 0),this.update({verticalLeft:u,verticalTop:h,verticalHeight:f,horizontalTop:d,horizontalLeft:g,horizontalWidth:p})}}}snapOnMoving({view:e,e:t,x:r,y:i}){const s=e.getEventData(t).delegatedView||e;if(!this.isNodeMovable(s))return;const o=s.cell,a=o.getSize(),l=o.getPosition(),c=new D(r-this.offset.x,i-this.offset.y,a.width,a.height),u=o.getAngle(),h=c.getCenter(),f=c.bbox(u),d=f.getTopLeft(),g=f.getBottomRight(),p=this.options.tolerance||0;let b,m,y,v,w,x,C=0,S=0;if(this.model.getNodes().some(E=>{if(this.isIgnored(o,E))return!1;const A=E.getBBox().bbox(E.getAngle()),O=A.getCenter(),T=A.getTopLeft(),I=A.getBottomRight();return b==null&&(Math.abs(O.x-h.x)<p?(b=O.x,C=.5):Math.abs(T.x-d.x)<p?(b=T.x,C=0):Math.abs(T.x-g.x)<p?(b=T.x,C=1):Math.abs(I.x-g.x)<p?(b=I.x,C=1):Math.abs(I.x-d.x)<p&&(b=I.x),b!=null&&(m=Math.min(f.y,A.y),y=Math.max(g.y,I.y)-m)),v==null&&(Math.abs(O.y-h.y)<p?(v=O.y,S=.5):Math.abs(T.y-d.y)<p?v=T.y:Math.abs(T.y-g.y)<p?(v=T.y,S=1):Math.abs(I.y-g.y)<p?(v=I.y,S=1):Math.abs(I.y-d.y)<p&&(v=I.y),v!=null&&(w=Math.min(f.x,A.x),x=Math.max(g.x,I.x)-w)),b!=null&&v!=null}),this.hide(),v!=null||b!=null){v!=null&&(f.y=v-S*f.height),b!=null&&(f.x=b-C*f.width);const E=f.getCenter(),A=E.x-c.width/2,O=E.y-c.height/2,T=A-l.x,I=O-l.y;(T!==0||I!==0)&&(o.translate(T,I,{snapped:!0,restrict:this.getRestrictArea(s)}),x&&(x+=T),y&&(y+=I)),this.update({verticalLeft:b,verticalTop:m,verticalHeight:y,horizontalTop:v,horizontalLeft:w,horizontalWidth:x})}}isIgnored(e,t){return t.id===e.id||t.isDescendantOf(e)||!this.filter(t)}filter(e){const t=this.options.filter;return Array.isArray(t)?t.some(r=>typeof r=="string"?e.shape===r:e.id===r.id):typeof t=="function"?K(t,this.graph,e):!0}update(e){if(e.horizontalTop){const t=this.graph.localToGraph(new P(e.horizontalLeft,e.horizontalTop)),r=this.graph.localToGraph(new P(e.horizontalLeft+e.horizontalWidth,e.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${t.x}`:"0",y1:`${t.y}`,x2:this.options.sharp?`${r.x}`:"100%",y2:`${r.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(e.verticalLeft){const t=this.graph.localToGraph(new P(e.verticalLeft,e.verticalTop)),r=this.graph.localToGraph(new P(e.verticalLeft,e.verticalTop+e.verticalHeight));this.vertical.setAttributes({x1:`${t.x}`,y1:this.options.sharp?`${t.y}`:"0",x2:`${r.x}`,y2:this.options.sharp?`${r.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),this.container.parentNode==null&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const e=this.options.clean,t=typeof e=="number"?e:e!==!1?3e3:0;return t>0&&(this.timer=window.setTimeout(()=>{this.container.parentNode!==null&&this.unmount()},t)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}e8([de.dispose()],Qw.prototype,"dispose",null);const n8=`.x6-widget-snapline {
411
+ `;V.prototype.isSelectionEnabled=function(){const n=this.getPlugin("selection");return n?n.isEnabled():!1},V.prototype.enableSelection=function(){const n=this.getPlugin("selection");return n&&n.enable(),this},V.prototype.disableSelection=function(){const n=this.getPlugin("selection");return n&&n.disable(),this},V.prototype.toggleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleEnabled(n),this},V.prototype.isMultipleSelection=function(){const n=this.getPlugin("selection");return n?n.isMultipleSelection():!1},V.prototype.enableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.enableMultipleSelection(),this},V.prototype.disableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.disableMultipleSelection(),this},V.prototype.toggleMultipleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleMultipleSelection(n),this},V.prototype.isSelectionMovable=function(){const n=this.getPlugin("selection");return n?n.isSelectionMovable():!1},V.prototype.enableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.enableSelectionMovable(),this},V.prototype.disableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.disableSelectionMovable(),this},V.prototype.toggleSelectionMovable=function(n){const e=this.getPlugin("selection");return e&&e.toggleSelectionMovable(n),this},V.prototype.isRubberbandEnabled=function(){const n=this.getPlugin("selection");return n?n.isRubberbandEnabled():!1},V.prototype.enableRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableRubberband(),this},V.prototype.disableRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableRubberband(),this},V.prototype.toggleRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleRubberband(n),this},V.prototype.isStrictRubberband=function(){const n=this.getPlugin("selection");return n?n.isStrictRubberband():!1},V.prototype.enableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableStrictRubberband(),this},V.prototype.disableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableStrictRubberband(),this},V.prototype.toggleStrictRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleStrictRubberband(n),this},V.prototype.setRubberbandModifiers=function(n){const e=this.getPlugin("selection");return e&&e.setRubberbandModifiers(n),this},V.prototype.setSelectionFilter=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionFilter(n),this},V.prototype.setSelectionDisplayContent=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionDisplayContent(n),this},V.prototype.isSelectionEmpty=function(){const n=this.getPlugin("selection");return n?n.isEmpty():!0},V.prototype.cleanSelection=function(n){const e=this.getPlugin("selection");return e&&e.clean(n),this},V.prototype.resetSelection=function(n,e){const t=this.getPlugin("selection");return t&&t.reset(n,e),this},V.prototype.getSelectedCells=function(){const n=this.getPlugin("selection");return n?n.getSelectedCells():[]},V.prototype.getSelectedCellCount=function(){const n=this.getPlugin("selection");return n?n.getSelectedCellCount():0},V.prototype.isSelected=function(n){const e=this.getPlugin("selection");return e?e.isSelected(n):!1},V.prototype.select=function(n,e){const t=this.getPlugin("selection");return t&&t.select(n,e),this},V.prototype.unselect=function(n,e){const t=this.getPlugin("selection");return t?t.unselect(n,e):this};var QG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Is extends wt{get rubberbandDisabled(){return this.options.enabled!==!0||this.options.rubberband!==!0}get disabled(){return this.options.enabled!==!0}get length(){return this.selectionImpl.length}get cells(){return this.selectionImpl.cells}constructor(e={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Ie({enabled:!0},Is.defaultOptions,e),Vo(this.name,JG)}init(e){this.graph=e,this.selectionImpl=new Kw(Object.assign(Object.assign({},this.options),{graph:e})),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isMultipleSelection(){return this.isMultiple()}enableMultipleSelection(){return this.enableMultiple(),this}disableMultipleSelection(){return this.disableMultiple(),this}toggleMultipleSelection(e){return e!=null?e!==this.isMultipleSelection()&&(e?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return this.options.movable!==!1}enableSelectionMovable(){return this.selectionImpl.options.movable=!0,this}disableSelectionMovable(){return this.selectionImpl.options.movable=!1,this}toggleSelectionMovable(e){return e!=null?e!==this.isSelectionMovable()&&(e?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.rubberbandDisabled}enableRubberband(){return this.rubberbandDisabled&&(this.options.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.options.rubberband=!1),this}toggleRubberband(e){return e!=null?e!==this.isRubberbandEnabled()&&(e?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return this.selectionImpl.options.strict===!0}enableStrictRubberband(){return this.selectionImpl.options.strict=!0,this}disableStrictRubberband(){return this.selectionImpl.options.strict=!1,this}toggleStrictRubberband(e){return e!=null?e!==this.isStrictRubberband()&&(e?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(e){this.setModifiers(e)}setSelectionFilter(e){return this.setFilter(e),this}setSelectionDisplayContent(e){return this.setContent(e),this}isEmpty(){return this.length<=0}clean(e={}){return this.selectionImpl.clean(e),this}reset(e,t={}){return this.selectionImpl.reset(e?this.getCells(e):[],t),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(e){return this.selectionImpl.isSelected(e)}select(e,t={}){const r=this.getCells(e);return r.length&&(this.isMultiple()?this.selectionImpl.select(r,t):this.reset(r.slice(0,1),t)),this}unselect(e,t={}){return this.selectionImpl.unselect(this.getCells(e),t),this}setup(){this.selectionImpl.on("*",(e,t)=>{this.trigger(e,t),this.graph.trigger(e,t)})}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e}){const t=this.graph.panning.allowPanning(e,!0),r=this.graph.getPlugin("scroller"),i=r&&r.allowPanning(e,!0);(this.allowRubberband(e,!0)||this.allowRubberband(e)&&!i&&!t)&&this.startRubberband(e)}onBlankClick(){this.clean()}allowRubberband(e,t){return!this.rubberbandDisabled&&nr.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&nr.isMatch(e,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:e}){this.movedMap.set(e,!0)}onCellMouseUp({e,cell:t}){const r=this.options;let i=this.disabled;!i&&this.movedMap.has(t)&&(i=r.selectCellOnMoved===!1,i||(i=r.selectNodeOnMoved===!1&&t.isNode()),i||(i=r.selectEdgeOnMoved===!1&&t.isEdge())),i||(this.allowMultipleSelection(e)?this.unselectMap.has(t)?this.unselectMap.delete(t):this.isSelected(t)?this.unselect(t):this.select(t):this.reset(t)),this.movedMap.delete(t)}onBoxMouseDown({e,cell:t}){this.disabled||this.allowMultipleSelection(e)&&(this.unselect(t),this.unselectMap.set(t,!0))}getCells(e){return(Array.isArray(e)?e:[e]).map(t=>typeof t=="string"?this.graph.getCellById(t):t).filter(t=>t!=null)}startRubberband(e){return this.rubberbandDisabled||this.selectionImpl.startSelecting(e),this}isMultiple(){return this.options.multiple!==!1}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(e){return this.options.modifiers=e,this}setContent(e){return this.selectionImpl.setContent(e),this}setFilter(e){return this.selectionImpl.setFilter(e),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),qo(this.name)}}QG([wt.dispose()],Is.prototype,"dispose",null),function(n){n.defaultOptions={rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,following:!0,content:null}}(Is||(Is={}));var ZG=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},e8=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class Jw extends ge{get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}constructor(e){super();const{graph:t}=e,r=e8(e,["graph"]);this.graph=t,this.options=Object.assign({},r),this.offset={x:0,y:0},this.render(),this.disabled||this.startListening()}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.stopListening())}setFilter(e){this.options.filter=e}render(){const e=this.containerWrapper=new ee("svg"),t=this.horizontal=new ee("line"),r=this.vertical=new ee("line");e.addClass(this.containerClassName),t.addClass(this.horizontalClassName),r.addClass(this.verticalClassName),e.setAttribute("width","100%"),e.setAttribute("height","100%"),t.setAttribute("display","none"),r.setAttribute("display","none"),e.append([t,r]),this.options.className&&e.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}onBatchStop({name:e,data:t}){e==="resize"&&this.snapOnResizing(t.cell,t)}captureCursorOffset({view:e,x:t,y:r}){const i=e.getDelegatedView();if(i&&this.isNodeMovable(i)){const s=e.cell.getPosition();this.offset={x:t-s.x,y:r-s.y}}}isNodeMovable(e){return e&&e.cell.isNode()&&e.can("nodeMovable")}getRestrictArea(e){const t=this.graph.options.translating.restrict,r=typeof t=="function"?Y(t,this.graph,e):t;return typeof r=="number"?this.graph.transform.getGraphArea().inflate(r):r===!0?this.graph.transform.getGraphArea():r||null}snapOnResizing(e,t){if(this.options.resizing&&!t.snapped&&t.ui&&t.direction&&t.trueDirection){const r=this.graph.renderer.findViewByCell(e);if(r&&r.cell.isNode()){const i=e.getBBox(),s=i.bbox(e.getAngle()),o=s.getTopLeft(),a=s.getBottomRight(),l=ve.normalize(e.getAngle()),c=this.options.tolerance||0;let u,h,f,d,g,p;const b={vertical:0,horizontal:0},m=t.direction,y=t.trueDirection,v=t.relativeDirection;y.indexOf("right")!==-1?b.vertical=a.x:b.vertical=o.x,y.indexOf("bottom")!==-1?b.horizontal=a.y:b.horizontal=o.y,this.model.getNodes().some(I=>{if(this.isIgnored(e,I))return!1;const G=I.getBBox().bbox(I.getAngle()),X=G.getTopLeft(),M=G.getBottomRight(),k={vertical:[X.x,M.x],horizontal:[X.y,M.y]},Q={};return Object.keys(k).forEach(R=>{const z=R,H=k[z].map(te=>({position:te,distance:Math.abs(te-b[z])})).filter(te=>te.distance<=c);Q[z]=Ib(H,te=>te.distance)}),u==null&&Q.vertical.length>0&&(u=Q.vertical[0].position,h=Math.min(s.y,G.y),f=Math.max(a.y,M.y)-h),d==null&&Q.horizontal.length>0&&(d=Q.horizontal[0].position,g=Math.min(s.x,G.x),p=Math.max(a.x,M.x)-g),u!=null&&d!=null}),this.hide();let w=0,x=0;(d!=null||u!=null)&&(u!=null&&(w=y.indexOf("right")!==-1?u-a.x:o.x-u),d!=null&&(x=y.indexOf("bottom")!==-1?d-a.y:o.y-d));let C=0,S=0;if(l%90===0)l===90||l===270?(C=x,S=w):(C=w,S=x);else{const I=l>=0&&l<90?1:l>=90&&l<180?4:l>=180&&l<270?3:2;d!=null&&u!=null&&(w<x?(x=0,d=void 0):(w=0,u=void 0));const G=ve.toRad(l%90);w&&(C=I===3?w/Math.cos(G):w/Math.sin(G)),x&&(S=I===3?x/Math.cos(G):x/Math.sin(G));const X=I===1||I===3;switch(v){case"top":case"bottom":S=x?x/(X?Math.cos(G):Math.sin(G)):w/(X?Math.sin(G):Math.cos(G));break;case"left":case"right":C=w?w/(X?Math.cos(G):Math.sin(G)):x/(X?Math.sin(G):Math.cos(G));break}}switch(v){case"top":case"bottom":C=0;break;case"left":case"right":S=0;break}const E=this.graph.getGridSize();let A=Math.max(i.width+C,E),O=Math.max(i.height+S,E);t.minWidth&&t.minWidth>E&&(A=Math.max(A,t.minWidth)),t.minHeight&&t.minHeight>E&&(O=Math.max(O,t.minHeight)),t.maxWidth&&(A=Math.min(A,t.maxWidth)),t.maxHeight&&(O=Math.min(O,t.maxHeight)),t.preserveAspectRatio&&(S<C?O=A*(i.height/i.width):A=O*(i.width/i.height)),(A!==i.width||O!==i.height)&&(e.resize(A,O,{direction:m,relativeDirection:v,trueDirection:y,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(r)}),f&&(f+=O-i.height),p&&(p+=A-i.width));const T=e.getBBox().bbox(l);u&&Math.abs(T.x-u)>1&&Math.abs(T.width+T.x-u)>1&&(u=void 0),d&&Math.abs(T.y-d)>1&&Math.abs(T.height+T.y-d)>1&&(d=void 0),this.update({verticalLeft:u,verticalTop:h,verticalHeight:f,horizontalTop:d,horizontalLeft:g,horizontalWidth:p})}}}snapOnMoving({view:e,e:t,x:r,y:i}){const s=e.getEventData(t).delegatedView||e;if(!this.isNodeMovable(s))return;const o=s.cell,a=o.getSize(),l=o.getPosition(),c=new D(r-this.offset.x,i-this.offset.y,a.width,a.height),u=o.getAngle(),h=c.getCenter(),f=c.bbox(u),d=f.getTopLeft(),g=f.getBottomRight(),p=this.options.tolerance||0;let b,m,y,v,w,x,C=0,S=0;if(this.model.getNodes().some(E=>{if(this.isIgnored(o,E))return!1;const A=E.getBBox().bbox(E.getAngle()),O=A.getCenter(),T=A.getTopLeft(),I=A.getBottomRight();return b==null&&(Math.abs(O.x-h.x)<p?(b=O.x,C=.5):Math.abs(T.x-d.x)<p?(b=T.x,C=0):Math.abs(T.x-g.x)<p?(b=T.x,C=1):Math.abs(I.x-g.x)<p?(b=I.x,C=1):Math.abs(I.x-d.x)<p&&(b=I.x),b!=null&&(m=Math.min(f.y,A.y),y=Math.max(g.y,I.y)-m)),v==null&&(Math.abs(O.y-h.y)<p?(v=O.y,S=.5):Math.abs(T.y-d.y)<p?v=T.y:Math.abs(T.y-g.y)<p?(v=T.y,S=1):Math.abs(I.y-g.y)<p?(v=I.y,S=1):Math.abs(I.y-d.y)<p&&(v=I.y),v!=null&&(w=Math.min(f.x,A.x),x=Math.max(g.x,I.x)-w)),b!=null&&v!=null}),this.hide(),v!=null||b!=null){v!=null&&(f.y=v-S*f.height),b!=null&&(f.x=b-C*f.width);const E=f.getCenter(),A=E.x-c.width/2,O=E.y-c.height/2,T=A-l.x,I=O-l.y;(T!==0||I!==0)&&(o.translate(T,I,{snapped:!0,restrict:this.getRestrictArea(s)}),x&&(x+=T),y&&(y+=I)),this.update({verticalLeft:b,verticalTop:m,verticalHeight:y,horizontalTop:v,horizontalLeft:w,horizontalWidth:x})}}isIgnored(e,t){return t.id===e.id||t.isDescendantOf(e)||!this.filter(t)}filter(e){const t=this.options.filter;return Array.isArray(t)?t.some(r=>typeof r=="string"?e.shape===r:e.id===r.id):typeof t=="function"?Y(t,this.graph,e):!0}update(e){if(e.horizontalTop){const t=this.graph.localToGraph(new P(e.horizontalLeft,e.horizontalTop)),r=this.graph.localToGraph(new P(e.horizontalLeft+e.horizontalWidth,e.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${t.x}`:"0",y1:`${t.y}`,x2:this.options.sharp?`${r.x}`:"100%",y2:`${r.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(e.verticalLeft){const t=this.graph.localToGraph(new P(e.verticalLeft,e.verticalTop)),r=this.graph.localToGraph(new P(e.verticalLeft,e.verticalTop+e.verticalHeight));this.vertical.setAttributes({x1:`${t.x}`,y1:this.options.sharp?`${t.y}`:"0",x2:`${r.x}`,y2:this.options.sharp?`${r.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),this.container.parentNode==null&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const e=this.options.clean,t=typeof e=="number"?e:e!==!1?3e3:0;return t>0&&(this.timer=window.setTimeout(()=>{this.container.parentNode!==null&&this.unmount()},t)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}ZG([ge.dispose()],Jw.prototype,"dispose",null);const t8=`.x6-widget-snapline {
412
412
  position: absolute;
413
413
  top: 0;
414
414
  right: 0;
@@ -421,7 +421,7 @@
421
421
  stroke: #2ecc71;
422
422
  stroke-width: 1px;
423
423
  }
424
- `;V.prototype.isSnaplineEnabled=function(){const n=this.getPlugin("snapline");return n?n.isEnabled():!1},V.prototype.enableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enable(),this},V.prototype.disableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disable(),this},V.prototype.toggleSnapline=function(){const n=this.getPlugin("snapline");return n&&n.toggleEnabled(),this},V.prototype.hideSnapline=function(){const n=this.getPlugin("snapline");return n&&n.hide(),this},V.prototype.setSnaplineFilter=function(n){const e=this.getPlugin("snapline");return e&&e.setFilter(n),this},V.prototype.isSnaplineOnResizingEnabled=function(){const n=this.getPlugin("snapline");return n?n.isOnResizingEnabled():!1},V.prototype.enableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.enableOnResizing(),this},V.prototype.disableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.disableOnResizing(),this},V.prototype.toggleSnaplineOnResizing=function(n){const e=this.getPlugin("snapline");return e&&e.toggleOnResizing(n),this},V.prototype.isSharpSnapline=function(){const n=this.getPlugin("snapline");return n?n.isSharp():!1},V.prototype.enableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enableSharp(),this},V.prototype.disableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disableSharp(),this},V.prototype.toggleSharpSnapline=function(n){const e=this.getPlugin("snapline");return e&&e.toggleSharp(n),this},V.prototype.getSnaplineTolerance=function(){const n=this.getPlugin("snapline");if(n)return n.getTolerance()},V.prototype.setSnaplineTolerance=function(n){const e=this.getPlugin("snapline");return e&&e.setTolerance(n),this};var r8=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Zw extends $n{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),Fo(this.name,n8)}init(e){this.snaplineImpl=new Qw(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(e){if(e!=null)e!==this.isEnabled()&&(e?this.enable():this.disable());else return this.isEnabled()?this.disable():this.enable(),this}hide(){return this.snaplineImpl.hide(),this}setFilter(e){return this.snaplineImpl.setFilter(e),this}isOnResizingEnabled(){return this.snaplineImpl.options.resizing===!0}enableOnResizing(){return this.snaplineImpl.options.resizing=!0,this}disableOnResizing(){return this.snaplineImpl.options.resizing=!1,this}toggleOnResizing(e){return e!=null?e!==this.isOnResizingEnabled()&&(e?this.enableOnResizing():this.disableOnResizing()):this.isOnResizingEnabled()?this.disableOnResizing():this.enableOnResizing(),this}isSharp(){return this.snaplineImpl.options.sharp===!0}enableSharp(){return this.snaplineImpl.options.sharp=!0,this}disableSharp(){return this.snaplineImpl.options.sharp=!1,this}toggleSharp(e){return e!=null?e!==this.isSharp()&&(e?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(e){return this.snaplineImpl.options.tolerance=e,this}captureCursorOffset(e){this.snaplineImpl.captureCursorOffset(e)}snapOnMoving(e){this.snaplineImpl.snapOnMoving(e)}dispose(){this.snaplineImpl.dispose(),Vo(this.name)}}r8([$n.dispose()],Zw.prototype,"dispose",null);class ex extends We{}(function(n){function e(t){const r=[],i=Pe.getForeignObjectMarkup();return t?r.push({tagName:t,selector:"body"},i):r.push(i),r}n.config({view:"react-shape-view",markup:e(),attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}},propHooks(t){if(t.markup==null){const r=t.primer;if(r){t.markup=e(r);let i={};switch(r){case"circle":i={refCx:"50%",refCy:"50%",refR:"50%"};break;case"ellipse":i={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"};break}t.attrs=Ie({},{body:Object.assign({refWidth:null,refHeight:null},i)},t.attrs||{})}}return t}}),We.registry.register("react-shape",n,!0)})(ex||(ex={}));var tx={exports:{}},qt={},nx={exports:{}},rx={};/**
424
+ `;V.prototype.isSnaplineEnabled=function(){const n=this.getPlugin("snapline");return n?n.isEnabled():!1},V.prototype.enableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enable(),this},V.prototype.disableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disable(),this},V.prototype.toggleSnapline=function(){const n=this.getPlugin("snapline");return n&&n.toggleEnabled(),this},V.prototype.hideSnapline=function(){const n=this.getPlugin("snapline");return n&&n.hide(),this},V.prototype.setSnaplineFilter=function(n){const e=this.getPlugin("snapline");return e&&e.setFilter(n),this},V.prototype.isSnaplineOnResizingEnabled=function(){const n=this.getPlugin("snapline");return n?n.isOnResizingEnabled():!1},V.prototype.enableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.enableOnResizing(),this},V.prototype.disableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.disableOnResizing(),this},V.prototype.toggleSnaplineOnResizing=function(n){const e=this.getPlugin("snapline");return e&&e.toggleOnResizing(n),this},V.prototype.isSharpSnapline=function(){const n=this.getPlugin("snapline");return n?n.isSharp():!1},V.prototype.enableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enableSharp(),this},V.prototype.disableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disableSharp(),this},V.prototype.toggleSharpSnapline=function(n){const e=this.getPlugin("snapline");return e&&e.toggleSharp(n),this},V.prototype.getSnaplineTolerance=function(){const n=this.getPlugin("snapline");if(n)return n.getTolerance()},V.prototype.setSnaplineTolerance=function(n){const e=this.getPlugin("snapline");return e&&e.setTolerance(n),this};var n8=globalThis&&globalThis.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Qw extends $n{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),Vo(this.name,t8)}init(e){this.snaplineImpl=new Jw(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(e){if(e!=null)e!==this.isEnabled()&&(e?this.enable():this.disable());else return this.isEnabled()?this.disable():this.enable(),this}hide(){return this.snaplineImpl.hide(),this}setFilter(e){return this.snaplineImpl.setFilter(e),this}isOnResizingEnabled(){return this.snaplineImpl.options.resizing===!0}enableOnResizing(){return this.snaplineImpl.options.resizing=!0,this}disableOnResizing(){return this.snaplineImpl.options.resizing=!1,this}toggleOnResizing(e){return e!=null?e!==this.isOnResizingEnabled()&&(e?this.enableOnResizing():this.disableOnResizing()):this.isOnResizingEnabled()?this.disableOnResizing():this.enableOnResizing(),this}isSharp(){return this.snaplineImpl.options.sharp===!0}enableSharp(){return this.snaplineImpl.options.sharp=!0,this}disableSharp(){return this.snaplineImpl.options.sharp=!1,this}toggleSharp(e){return e!=null?e!==this.isSharp()&&(e?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(e){return this.snaplineImpl.options.tolerance=e,this}captureCursorOffset(e){this.snaplineImpl.captureCursorOffset(e)}snapOnMoving(e){this.snaplineImpl.snapOnMoving(e)}dispose(){this.snaplineImpl.dispose(),qo(this.name)}}n8([$n.dispose()],Qw.prototype,"dispose",null);class Zw extends We{}(function(n){function e(t){const r=[],i=Ee.getForeignObjectMarkup();return t?r.push({tagName:t,selector:"body"},i):r.push(i),r}n.config({view:"react-shape-view",markup:e(),attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}},propHooks(t){if(t.markup==null){const r=t.primer;if(r){t.markup=e(r);let i={};switch(r){case"circle":i={refCx:"50%",refCy:"50%",refR:"50%"};break;case"ellipse":i={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"};break}t.attrs=Ie({},{body:Object.assign({refWidth:null,refHeight:null},i)},t.attrs||{})}}return t}}),We.registry.register("react-shape",n,!0)})(Zw||(Zw={}));var ex={exports:{}},qt={},tx={exports:{}},nx={};/**
425
425
  * @license React
426
426
  * scheduler.production.min.js
427
427
  *
@@ -429,7 +429,7 @@
429
429
  *
430
430
  * This source code is licensed under the MIT license found in the
431
431
  * LICENSE file in the root directory of this source tree.
432
- */(function(n){function e(R,z){var U=R.length;R.push(z);e:for(;0<U;){var te=U-1>>>1,we=R[te];if(0<i(we,z))R[te]=z,R[U]=we,U=te;else break e}}function t(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var z=R[0],U=R.pop();if(U!==z){R[0]=U;e:for(var te=0,we=R.length,Kt=we>>>1;te<Kt;){var Ye=2*(te+1)-1,gn=R[Ye],Ke=Ye+1,At=R[Ke];if(0>i(gn,U))Ke<we&&0>i(At,gn)?(R[te]=At,R[Ke]=U,te=Ke):(R[te]=gn,R[Ye]=U,te=Ye);else if(Ke<we&&0>i(At,U))R[te]=At,R[Ke]=U,te=Ke;else break e}}return z}function i(R,z){var U=R.sortIndex-z.sortIndex;return U!==0?U:R.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,h=null,f=3,d=!1,g=!1,p=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(R){for(var z=t(c);z!==null;){if(z.callback===null)r(c);else if(z.startTime<=R)r(c),z.sortIndex=z.expirationTime,e(l,z);else break;z=t(c)}}function w(R){if(p=!1,v(R),!g)if(t(l)!==null)g=!0,k(x);else{var z=t(c);z!==null&&Z(w,z.startTime-R)}}function x(R,z){g=!1,p&&(p=!1,m(E),E=-1),d=!0;var U=f;try{for(v(z),h=t(l);h!==null&&(!(h.expirationTime>z)||R&&!T());){var te=h.callback;if(typeof te=="function"){h.callback=null,f=h.priorityLevel;var we=te(h.expirationTime<=z);z=n.unstable_now(),typeof we=="function"?h.callback=we:h===t(l)&&r(l),v(z)}else r(l);h=t(l)}if(h!==null)var Kt=!0;else{var Ye=t(c);Ye!==null&&Z(w,Ye.startTime-z),Kt=!1}return Kt}finally{h=null,f=U,d=!1}}var C=!1,S=null,E=-1,A=5,O=-1;function T(){return!(n.unstable_now()-O<A)}function I(){if(S!==null){var R=n.unstable_now();O=R;var z=!0;try{z=S(!0,R)}finally{z?G():(C=!1,S=null)}}else C=!1}var G;if(typeof y=="function")G=function(){y(I)};else if(typeof MessageChannel!="undefined"){var Y=new MessageChannel,M=Y.port2;Y.port1.onmessage=I,G=function(){M.postMessage(null)}}else G=function(){b(I,0)};function k(R){S=R,C||(C=!0,G())}function Z(R,z){E=b(function(){R(n.unstable_now())},z)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(R){R.callback=null},n.unstable_continueExecution=function(){g||d||(g=!0,k(x))},n.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<R?Math.floor(1e3/R):5},n.unstable_getCurrentPriorityLevel=function(){return f},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(R){switch(f){case 1:case 2:case 3:var z=3;break;default:z=f}var U=f;f=z;try{return R()}finally{f=U}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(R,z){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var U=f;f=R;try{return z()}finally{f=U}},n.unstable_scheduleCallback=function(R,z,U){var te=n.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?te+U:te):U=te,R){case 1:var we=-1;break;case 2:we=250;break;case 5:we=1073741823;break;case 4:we=1e4;break;default:we=5e3}return we=U+we,R={id:u++,callback:z,priorityLevel:R,startTime:U,expirationTime:we,sortIndex:-1},U>te?(R.sortIndex=U,e(c,R),t(l)===null&&R===t(c)&&(p?(m(E),E=-1):p=!0,Z(w,U-te))):(R.sortIndex=we,e(l,R),g||d||(g=!0,k(x))),R},n.unstable_shouldYield=T,n.unstable_wrapCallback=function(R){var z=f;return function(){var U=f;f=z;try{return R.apply(this,arguments)}finally{f=U}}}})(rx),nx.exports=rx;var i8=nx.exports;/**
432
+ */(function(n){function e(R,z){var H=R.length;R.push(z);e:for(;0<H;){var te=H-1>>>1,xe=R[te];if(0<i(xe,z))R[te]=z,R[H]=xe,H=te;else break e}}function t(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var z=R[0],H=R.pop();if(H!==z){R[0]=H;e:for(var te=0,xe=R.length,Kt=xe>>>1;te<Kt;){var Ye=2*(te+1)-1,gn=R[Ye],Ke=Ye+1,At=R[Ke];if(0>i(gn,H))Ke<xe&&0>i(At,gn)?(R[te]=At,R[Ke]=H,te=Ke):(R[te]=gn,R[Ye]=H,te=Ye);else if(Ke<xe&&0>i(At,H))R[te]=At,R[Ke]=H,te=Ke;else break e}}return z}function i(R,z){var H=R.sortIndex-z.sortIndex;return H!==0?H:R.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,h=null,f=3,d=!1,g=!1,p=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(R){for(var z=t(c);z!==null;){if(z.callback===null)r(c);else if(z.startTime<=R)r(c),z.sortIndex=z.expirationTime,e(l,z);else break;z=t(c)}}function w(R){if(p=!1,v(R),!g)if(t(l)!==null)g=!0,k(x);else{var z=t(c);z!==null&&Q(w,z.startTime-R)}}function x(R,z){g=!1,p&&(p=!1,m(E),E=-1),d=!0;var H=f;try{for(v(z),h=t(l);h!==null&&(!(h.expirationTime>z)||R&&!T());){var te=h.callback;if(typeof te=="function"){h.callback=null,f=h.priorityLevel;var xe=te(h.expirationTime<=z);z=n.unstable_now(),typeof xe=="function"?h.callback=xe:h===t(l)&&r(l),v(z)}else r(l);h=t(l)}if(h!==null)var Kt=!0;else{var Ye=t(c);Ye!==null&&Q(w,Ye.startTime-z),Kt=!1}return Kt}finally{h=null,f=H,d=!1}}var C=!1,S=null,E=-1,A=5,O=-1;function T(){return!(n.unstable_now()-O<A)}function I(){if(S!==null){var R=n.unstable_now();O=R;var z=!0;try{z=S(!0,R)}finally{z?G():(C=!1,S=null)}}else C=!1}var G;if(typeof y=="function")G=function(){y(I)};else if(typeof MessageChannel!="undefined"){var X=new MessageChannel,M=X.port2;X.port1.onmessage=I,G=function(){M.postMessage(null)}}else G=function(){b(I,0)};function k(R){S=R,C||(C=!0,G())}function Q(R,z){E=b(function(){R(n.unstable_now())},z)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(R){R.callback=null},n.unstable_continueExecution=function(){g||d||(g=!0,k(x))},n.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<R?Math.floor(1e3/R):5},n.unstable_getCurrentPriorityLevel=function(){return f},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(R){switch(f){case 1:case 2:case 3:var z=3;break;default:z=f}var H=f;f=z;try{return R()}finally{f=H}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(R,z){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var H=f;f=R;try{return z()}finally{f=H}},n.unstable_scheduleCallback=function(R,z,H){var te=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?te+H:te):H=te,R){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=H+xe,R={id:u++,callback:z,priorityLevel:R,startTime:H,expirationTime:xe,sortIndex:-1},H>te?(R.sortIndex=H,e(c,R),t(l)===null&&R===t(c)&&(p?(m(E),E=-1):p=!0,Q(w,H-te))):(R.sortIndex=xe,e(l,R),g||d||(g=!0,k(x))),R},n.unstable_shouldYield=T,n.unstable_wrapCallback=function(R){var z=f;return function(){var H=f;f=z;try{return R.apply(this,arguments)}finally{f=H}}}})(nx),tx.exports=nx;var r8=tx.exports;/**
433
433
  * @license React
434
434
  * react-dom.production.min.js
435
435
  *
@@ -437,14 +437,14 @@
437
437
  *
438
438
  * This source code is licensed under the MIT license found in the
439
439
  * LICENSE file in the root directory of this source tree.
440
- */var ix=H,Gt=i8;function j(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+n+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var sx=new Set,ea={};function Ti(n,e){Ls(n,e),Ls(n+"Capture",e)}function Ls(n,e){for(ea[n]=e,n=0;n<e.length;n++)sx.add(e[n])}var ar=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),wf=Object.prototype.hasOwnProperty,s8=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ox={},ax={};function o8(n){return wf.call(ax,n)?!0:wf.call(ox,n)?!1:s8.test(n)?ax[n]=!0:(ox[n]=!0,!1)}function a8(n,e,t,r){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function l8(n,e,t,r){if(e===null||typeof e=="undefined"||a8(n,e,t,r))return!0;if(r)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Mt(n,e,t,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var mt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){mt[n]=new Mt(n,0,!1,n,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];mt[e]=new Mt(e,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){mt[n]=new Mt(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){mt[n]=new Mt(n,2,!1,n,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){mt[n]=new Mt(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){mt[n]=new Mt(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){mt[n]=new Mt(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){mt[n]=new Mt(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){mt[n]=new Mt(n,5,!1,n.toLowerCase(),null,!1,!1)});var xf=/[\-:]([a-z])/g;function Cf(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(xf,Cf);mt[e]=new Mt(e,1,!1,n,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(xf,Cf);mt[e]=new Mt(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(xf,Cf);mt[e]=new Mt(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){mt[n]=new Mt(n,1,!1,n.toLowerCase(),null,!1,!1)}),mt.xlinkHref=new Mt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){mt[n]=new Mt(n,1,!1,n.toLowerCase(),null,!0,!0)});function Sf(n,e,t,r){var i=mt.hasOwnProperty(e)?mt[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(l8(e,t,i,r)&&(t=null),r||i===null?o8(e)&&(t===null?n.removeAttribute(e):n.setAttribute(e,""+t)):i.mustUseProperty?n[i.propertyName]=t===null?i.type===3?!1:"":t:(e=i.attributeName,r=i.attributeNamespace,t===null?n.removeAttribute(e):(i=i.type,t=i===3||i===4&&t===!0?"":""+t,r?n.setAttributeNS(r,e,t):n.setAttribute(e,t))))}var lr=ix.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,hc=Symbol.for("react.element"),Rs=Symbol.for("react.portal"),js=Symbol.for("react.fragment"),Pf=Symbol.for("react.strict_mode"),Ef=Symbol.for("react.profiler"),lx=Symbol.for("react.provider"),cx=Symbol.for("react.context"),Af=Symbol.for("react.forward_ref"),Tf=Symbol.for("react.suspense"),Of=Symbol.for("react.suspense_list"),Mf=Symbol.for("react.memo"),Dr=Symbol.for("react.lazy"),ux=Symbol.for("react.offscreen"),hx=Symbol.iterator;function ta(n){return n===null||typeof n!="object"?null:(n=hx&&n[hx]||n["@@iterator"],typeof n=="function"?n:null)}var Le=Object.assign,_f;function na(n){if(_f===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);_f=e&&e[1]||""}return`
440
+ */var rx=Z,Gt=r8;function j(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+n+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ix=new Set,ta={};function Ti(n,e){Ls(n,e),Ls(n+"Capture",e)}function Ls(n,e){for(ta[n]=e,n=0;n<e.length;n++)ix.add(e[n])}var ar=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),wf=Object.prototype.hasOwnProperty,i8=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,sx={},ox={};function s8(n){return wf.call(ox,n)?!0:wf.call(sx,n)?!1:i8.test(n)?ox[n]=!0:(sx[n]=!0,!1)}function o8(n,e,t,r){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function a8(n,e,t,r){if(e===null||typeof e=="undefined"||o8(n,e,t,r))return!0;if(r)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Mt(n,e,t,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var mt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){mt[n]=new Mt(n,0,!1,n,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];mt[e]=new Mt(e,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){mt[n]=new Mt(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){mt[n]=new Mt(n,2,!1,n,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){mt[n]=new Mt(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){mt[n]=new Mt(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){mt[n]=new Mt(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){mt[n]=new Mt(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){mt[n]=new Mt(n,5,!1,n.toLowerCase(),null,!1,!1)});var xf=/[\-:]([a-z])/g;function Cf(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(xf,Cf);mt[e]=new Mt(e,1,!1,n,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(xf,Cf);mt[e]=new Mt(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(xf,Cf);mt[e]=new Mt(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){mt[n]=new Mt(n,1,!1,n.toLowerCase(),null,!1,!1)}),mt.xlinkHref=new Mt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){mt[n]=new Mt(n,1,!1,n.toLowerCase(),null,!0,!0)});function Sf(n,e,t,r){var i=mt.hasOwnProperty(e)?mt[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(a8(e,t,i,r)&&(t=null),r||i===null?s8(e)&&(t===null?n.removeAttribute(e):n.setAttribute(e,""+t)):i.mustUseProperty?n[i.propertyName]=t===null?i.type===3?!1:"":t:(e=i.attributeName,r=i.attributeNamespace,t===null?n.removeAttribute(e):(i=i.type,t=i===3||i===4&&t===!0?"":""+t,r?n.setAttributeNS(r,e,t):n.setAttribute(e,t))))}var lr=rx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,hc=Symbol.for("react.element"),Rs=Symbol.for("react.portal"),js=Symbol.for("react.fragment"),Pf=Symbol.for("react.strict_mode"),Ef=Symbol.for("react.profiler"),ax=Symbol.for("react.provider"),lx=Symbol.for("react.context"),Af=Symbol.for("react.forward_ref"),Tf=Symbol.for("react.suspense"),Of=Symbol.for("react.suspense_list"),Mf=Symbol.for("react.memo"),Dr=Symbol.for("react.lazy"),cx=Symbol.for("react.offscreen"),ux=Symbol.iterator;function na(n){return n===null||typeof n!="object"?null:(n=ux&&n[ux]||n["@@iterator"],typeof n=="function"?n:null)}var Le=Object.assign,_f;function ra(n){if(_f===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);_f=e&&e[1]||""}return`
441
441
  `+_f+n}var Nf=!1;function kf(n,e){if(!n||Nf)return"";Nf=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var r=c}Reflect.construct(n,[],e)}else{try{e.call()}catch(c){r=c}n.call(e.prototype)}else{try{throw Error()}catch(c){r=c}n()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
442
442
  `),s=r.stack.split(`
443
443
  `),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
444
- `+i[o].replace(" at new "," at ");return n.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{Nf=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?na(n):""}function c8(n){switch(n.tag){case 5:return na(n.type);case 16:return na("Lazy");case 13:return na("Suspense");case 19:return na("SuspenseList");case 0:case 2:case 15:return n=kf(n.type,!1),n;case 11:return n=kf(n.type.render,!1),n;case 1:return n=kf(n.type,!0),n;default:return""}}function $f(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case js:return"Fragment";case Rs:return"Portal";case Ef:return"Profiler";case Pf:return"StrictMode";case Tf:return"Suspense";case Of:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case cx:return(n.displayName||"Context")+".Consumer";case lx:return(n._context.displayName||"Context")+".Provider";case Af:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case Mf:return e=n.displayName||null,e!==null?e:$f(n.type)||"Memo";case Dr:e=n._payload,n=n._init;try{return $f(n(e))}catch(t){}}return null}function u8(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return $f(e);case 8:return e===Pf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Br(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function fx(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function h8(n){var e=fx(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),r=""+n[e];if(!n.hasOwnProperty(e)&&typeof t!="undefined"&&typeof t.get=="function"&&typeof t.set=="function"){var i=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function fc(n){n._valueTracker||(n._valueTracker=h8(n))}function dx(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),r="";return n&&(r=fx(n)?n.checked?"true":"false":n.value),n=r,n!==t?(e.setValue(n),!0):!1}function dc(n){if(n=n||(typeof document!="undefined"?document:void 0),typeof n=="undefined")return null;try{return n.activeElement||n.body}catch(e){return n.body}}function If(n,e){var t=e.checked;return Le({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t!=null?t:n._wrapperState.initialChecked})}function gx(n,e){var t=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;t=Br(e.value!=null?e.value:t),n._wrapperState={initialChecked:r,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function px(n,e){e=e.checked,e!=null&&Sf(n,"checked",e,!1)}function Lf(n,e){px(n,e);var t=Br(e.value),r=e.type;if(t!=null)r==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(r==="submit"||r==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?Rf(n,e.type,t):e.hasOwnProperty("defaultValue")&&Rf(n,e.type,Br(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function mx(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function Rf(n,e,t){(e!=="number"||dc(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var ra=Array.isArray;function Ds(n,e,t,r){if(n=n.options,e){e={};for(var i=0;i<t.length;i++)e["$"+t[i]]=!0;for(t=0;t<n.length;t++)i=e.hasOwnProperty("$"+n[t].value),n[t].selected!==i&&(n[t].selected=i),i&&r&&(n[t].defaultSelected=!0)}else{for(t=""+Br(t),e=null,i=0;i<n.length;i++){if(n[i].value===t){n[i].selected=!0,r&&(n[i].defaultSelected=!0);return}e!==null||n[i].disabled||(e=n[i])}e!==null&&(e.selected=!0)}}function jf(n,e){if(e.dangerouslySetInnerHTML!=null)throw Error(j(91));return Le({},e,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function yx(n,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(j(92));if(ra(t)){if(1<t.length)throw Error(j(93));t=t[0]}e=t}e==null&&(e=""),t=e}n._wrapperState={initialValue:Br(t)}}function vx(n,e){var t=Br(e.value),r=Br(e.defaultValue);t!=null&&(t=""+t,t!==n.value&&(n.value=t),e.defaultValue==null&&n.defaultValue!==t&&(n.defaultValue=t)),r!=null&&(n.defaultValue=""+r)}function bx(n){var e=n.textContent;e===n._wrapperState.initialValue&&e!==""&&e!==null&&(n.value=e)}function wx(n){switch(n){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Df(n,e){return n==null||n==="http://www.w3.org/1999/xhtml"?wx(e):n==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var gc,xx=function(n){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(e,t,r,i){MSApp.execUnsafeLocalFunction(function(){return n(e,t,r,i)})}:n}(function(n,e){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=e;else{for(gc=gc||document.createElement("div"),gc.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=gc.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function ia(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var sa={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},f8=["Webkit","ms","Moz","O"];Object.keys(sa).forEach(function(n){f8.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),sa[e]=sa[n]})});function Cx(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||sa.hasOwnProperty(n)&&sa[n]?(""+e).trim():e+"px"}function Sx(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var r=t.indexOf("--")===0,i=Cx(t,e[t],r);t==="float"&&(t="cssFloat"),r?n.setProperty(t,i):n[t]=i}}var d8=Le({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Bf(n,e){if(e){if(d8[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(j(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(j(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(j(61))}if(e.style!=null&&typeof e.style!="object")throw Error(j(62))}}function zf(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ff=null;function Vf(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var qf=null,Bs=null,zs=null;function Px(n){if(n=Ta(n)){if(typeof qf!="function")throw Error(j(280));var e=n.stateNode;e&&(e=jc(e),qf(n.stateNode,n.type,e))}}function Ex(n){Bs?zs?zs.push(n):zs=[n]:Bs=n}function Ax(){if(Bs){var n=Bs,e=zs;if(zs=Bs=null,Px(n),e)for(n=0;n<e.length;n++)Px(e[n])}}function Tx(n,e){return n(e)}function Ox(){}var Gf=!1;function Mx(n,e,t){if(Gf)return n(e,t);Gf=!0;try{return Tx(n,e,t)}finally{Gf=!1,(Bs!==null||zs!==null)&&(Ox(),Ax())}}function oa(n,e){var t=n.stateNode;if(t===null)return null;var r=jc(t);if(r===null)return null;t=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(n=n.type,r=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!r;break e;default:n=!1}if(n)return null;if(t&&typeof t!="function")throw Error(j(231,e,typeof t));return t}var Hf=!1;if(ar)try{var aa={};Object.defineProperty(aa,"passive",{get:function(){Hf=!0}}),window.addEventListener("test",aa,aa),window.removeEventListener("test",aa,aa)}catch(n){Hf=!1}function g8(n,e,t,r,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(t,c)}catch(u){this.onError(u)}}var la=!1,pc=null,mc=!1,Uf=null,p8={onError:function(n){la=!0,pc=n}};function m8(n,e,t,r,i,s,o,a,l){la=!1,pc=null,g8.apply(p8,arguments)}function y8(n,e,t,r,i,s,o,a,l){if(m8.apply(this,arguments),la){if(la){var c=pc;la=!1,pc=null}else throw Error(j(198));mc||(mc=!0,Uf=c)}}function Oi(n){var e=n,t=n;if(n.alternate)for(;e.return;)e=e.return;else{n=e;do e=n,e.flags&4098&&(t=e.return),n=e.return;while(n)}return e.tag===3?t:null}function _x(n){if(n.tag===13){var e=n.memoizedState;if(e===null&&(n=n.alternate,n!==null&&(e=n.memoizedState)),e!==null)return e.dehydrated}return null}function Nx(n){if(Oi(n)!==n)throw Error(j(188))}function v8(n){var e=n.alternate;if(!e){if(e=Oi(n),e===null)throw Error(j(188));return e!==n?null:n}for(var t=n,r=e;;){var i=t.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){t=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===t)return Nx(i),n;if(s===r)return Nx(i),e;s=s.sibling}throw Error(j(188))}if(t.return!==r.return)t=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===t){o=!0,t=i,r=s;break}if(a===r){o=!0,r=i,t=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===t){o=!0,t=s,r=i;break}if(a===r){o=!0,r=s,t=i;break}a=a.sibling}if(!o)throw Error(j(189))}}if(t.alternate!==r)throw Error(j(190))}if(t.tag!==3)throw Error(j(188));return t.stateNode.current===t?n:e}function kx(n){return n=v8(n),n!==null?$x(n):null}function $x(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var e=$x(n);if(e!==null)return e;n=n.sibling}return null}var Ix=Gt.unstable_scheduleCallback,Lx=Gt.unstable_cancelCallback,b8=Gt.unstable_shouldYield,w8=Gt.unstable_requestPaint,Xe=Gt.unstable_now,x8=Gt.unstable_getCurrentPriorityLevel,Wf=Gt.unstable_ImmediatePriority,Rx=Gt.unstable_UserBlockingPriority,yc=Gt.unstable_NormalPriority,C8=Gt.unstable_LowPriority,jx=Gt.unstable_IdlePriority,vc=null,Fn=null;function S8(n){if(Fn&&typeof Fn.onCommitFiberRoot=="function")try{Fn.onCommitFiberRoot(vc,n,void 0,(n.current.flags&128)===128)}catch(e){}}var Cn=Math.clz32?Math.clz32:A8,P8=Math.log,E8=Math.LN2;function A8(n){return n>>>=0,n===0?32:31-(P8(n)/E8|0)|0}var bc=64,wc=4194304;function ca(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function xc(n,e){var t=n.pendingLanes;if(t===0)return 0;var r=0,i=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~i;a!==0?r=ca(a):(s&=o,s!==0&&(r=ca(s)))}else o=t&~i,o!==0?r=ca(o):s!==0&&(r=ca(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=r;0<e;)t=31-Cn(e),i=1<<t,r|=n[t],e&=~i;return r}function T8(n,e){switch(n){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function O8(n,e){for(var t=n.suspendedLanes,r=n.pingedLanes,i=n.expirationTimes,s=n.pendingLanes;0<s;){var o=31-Cn(s),a=1<<o,l=i[o];l===-1?(!(a&t)||a&r)&&(i[o]=T8(a,e)):l<=e&&(n.expiredLanes|=a),s&=~a}}function Xf(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function Dx(){var n=bc;return bc<<=1,!(bc&4194240)&&(bc=64),n}function Yf(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function ua(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Cn(e),n[e]=t}function M8(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var r=n.eventTimes;for(n=n.expirationTimes;0<t;){var i=31-Cn(t),s=1<<i;e[i]=0,r[i]=-1,n[i]=-1,t&=~s}}function Kf(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var r=31-Cn(t),i=1<<r;i&e|n[r]&e&&(n[r]|=e),t&=~i}}var me=0;function Bx(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var zx,Jf,Fx,Vx,qx,Qf=!1,Cc=[],zr=null,Fr=null,Vr=null,ha=new Map,fa=new Map,qr=[],_8="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Gx(n,e){switch(n){case"focusin":case"focusout":zr=null;break;case"dragenter":case"dragleave":Fr=null;break;case"mouseover":case"mouseout":Vr=null;break;case"pointerover":case"pointerout":ha.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":fa.delete(e.pointerId)}}function da(n,e,t,r,i,s){return n===null||n.nativeEvent!==s?(n={blockedOn:e,domEventName:t,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=Ta(e),e!==null&&Jf(e)),n):(n.eventSystemFlags|=r,e=n.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),n)}function N8(n,e,t,r,i){switch(e){case"focusin":return zr=da(zr,n,e,t,r,i),!0;case"dragenter":return Fr=da(Fr,n,e,t,r,i),!0;case"mouseover":return Vr=da(Vr,n,e,t,r,i),!0;case"pointerover":var s=i.pointerId;return ha.set(s,da(ha.get(s)||null,n,e,t,r,i)),!0;case"gotpointercapture":return s=i.pointerId,fa.set(s,da(fa.get(s)||null,n,e,t,r,i)),!0}return!1}function Hx(n){var e=Mi(n.target);if(e!==null){var t=Oi(e);if(t!==null){if(e=t.tag,e===13){if(e=_x(t),e!==null){n.blockedOn=e,qx(n.priority,function(){Fx(t)});return}}else if(e===3&&t.stateNode.current.memoizedState.isDehydrated){n.blockedOn=t.tag===3?t.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Sc(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=ed(n.domEventName,n.eventSystemFlags,e[0],n.nativeEvent);if(t===null){t=n.nativeEvent;var r=new t.constructor(t.type,t);Ff=r,t.target.dispatchEvent(r),Ff=null}else return e=Ta(t),e!==null&&Jf(e),n.blockedOn=t,!1;e.shift()}return!0}function Ux(n,e,t){Sc(n)&&t.delete(e)}function k8(){Qf=!1,zr!==null&&Sc(zr)&&(zr=null),Fr!==null&&Sc(Fr)&&(Fr=null),Vr!==null&&Sc(Vr)&&(Vr=null),ha.forEach(Ux),fa.forEach(Ux)}function ga(n,e){n.blockedOn===e&&(n.blockedOn=null,Qf||(Qf=!0,Gt.unstable_scheduleCallback(Gt.unstable_NormalPriority,k8)))}function pa(n){function e(i){return ga(i,n)}if(0<Cc.length){ga(Cc[0],n);for(var t=1;t<Cc.length;t++){var r=Cc[t];r.blockedOn===n&&(r.blockedOn=null)}}for(zr!==null&&ga(zr,n),Fr!==null&&ga(Fr,n),Vr!==null&&ga(Vr,n),ha.forEach(e),fa.forEach(e),t=0;t<qr.length;t++)r=qr[t],r.blockedOn===n&&(r.blockedOn=null);for(;0<qr.length&&(t=qr[0],t.blockedOn===null);)Hx(t),t.blockedOn===null&&qr.shift()}var Fs=lr.ReactCurrentBatchConfig,Pc=!0;function $8(n,e,t,r){var i=me,s=Fs.transition;Fs.transition=null;try{me=1,Zf(n,e,t,r)}finally{me=i,Fs.transition=s}}function I8(n,e,t,r){var i=me,s=Fs.transition;Fs.transition=null;try{me=4,Zf(n,e,t,r)}finally{me=i,Fs.transition=s}}function Zf(n,e,t,r){if(Pc){var i=ed(n,e,t,r);if(i===null)yd(n,e,r,Ec,t),Gx(n,r);else if(N8(i,n,e,t,r))r.stopPropagation();else if(Gx(n,r),e&4&&-1<_8.indexOf(n)){for(;i!==null;){var s=Ta(i);if(s!==null&&zx(s),s=ed(n,e,t,r),s===null&&yd(n,e,r,Ec,t),s===i)break;i=s}i!==null&&r.stopPropagation()}else yd(n,e,r,null,t)}}var Ec=null;function ed(n,e,t,r){if(Ec=null,n=Vf(r),n=Mi(n),n!==null)if(e=Oi(n),e===null)n=null;else if(t=e.tag,t===13){if(n=_x(e),n!==null)return n;n=null}else if(t===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;n=null}else e!==n&&(n=null);return Ec=n,null}function Wx(n){switch(n){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(x8()){case Wf:return 1;case Rx:return 4;case yc:case C8:return 16;case jx:return 536870912;default:return 16}default:return 16}}var Gr=null,td=null,Ac=null;function Xx(){if(Ac)return Ac;var n,e=td,t=e.length,r,i="value"in Gr?Gr.value:Gr.textContent,s=i.length;for(n=0;n<t&&e[n]===i[n];n++);var o=t-n;for(r=1;r<=o&&e[t-r]===i[s-r];r++);return Ac=i.slice(n,1<r?1-r:void 0)}function Tc(n){var e=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&e===13&&(n=13)):n=e,n===10&&(n=13),32<=n||n===13?n:0}function Oc(){return!0}function Yx(){return!1}function Ht(n){function e(t,r,i,s,o){this._reactName=t,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in n)n.hasOwnProperty(a)&&(t=n[a],this[a]=t?t(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Oc:Yx,this.isPropagationStopped=Yx,this}return Le(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():typeof t.returnValue!="unknown"&&(t.returnValue=!1),this.isDefaultPrevented=Oc)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=Oc)},persist:function(){},isPersistent:Oc}),e}var Vs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nd=Ht(Vs),ma=Le({},Vs,{view:0,detail:0}),L8=Ht(ma),rd,id,ya,Mc=Le({},ma,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:od,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==ya&&(ya&&n.type==="mousemove"?(rd=n.screenX-ya.screenX,id=n.screenY-ya.screenY):id=rd=0,ya=n),rd)},movementY:function(n){return"movementY"in n?n.movementY:id}}),Kx=Ht(Mc),R8=Le({},Mc,{dataTransfer:0}),j8=Ht(R8),D8=Le({},ma,{relatedTarget:0}),sd=Ht(D8),B8=Le({},Vs,{animationName:0,elapsedTime:0,pseudoElement:0}),z8=Ht(B8),F8=Le({},Vs,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),V8=Ht(F8),q8=Le({},Vs,{data:0}),Jx=Ht(q8),G8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},H8={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},U8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function W8(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=U8[n])?!!e[n]:!1}function od(){return W8}var X8=Le({},ma,{key:function(n){if(n.key){var e=G8[n.key]||n.key;if(e!=="Unidentified")return e}return n.type==="keypress"?(n=Tc(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?H8[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:od,charCode:function(n){return n.type==="keypress"?Tc(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Tc(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),Y8=Ht(X8),K8=Le({},Mc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qx=Ht(K8),J8=Le({},ma,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:od}),Q8=Ht(J8),Z8=Le({},Vs,{propertyName:0,elapsedTime:0,pseudoElement:0}),eH=Ht(Z8),tH=Le({},Mc,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),nH=Ht(tH),rH=[9,13,27,32],ad=ar&&"CompositionEvent"in window,va=null;ar&&"documentMode"in document&&(va=document.documentMode);var iH=ar&&"TextEvent"in window&&!va,Zx=ar&&(!ad||va&&8<va&&11>=va),eC=String.fromCharCode(32),tC=!1;function nC(n,e){switch(n){case"keyup":return rH.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rC(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var qs=!1;function sH(n,e){switch(n){case"compositionend":return rC(e);case"keypress":return e.which!==32?null:(tC=!0,eC);case"textInput":return n=e.data,n===eC&&tC?null:n;default:return null}}function oH(n,e){if(qs)return n==="compositionend"||!ad&&nC(n,e)?(n=Xx(),Ac=td=Gr=null,qs=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Zx&&e.locale!=="ko"?null:e.data;default:return null}}var aH={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function iC(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!aH[n.type]:e==="textarea"}function sC(n,e,t,r){Ex(r),e=Ic(e,"onChange"),0<e.length&&(t=new nd("onChange","change",null,t,r),n.push({event:t,listeners:e}))}var ba=null,wa=null;function lH(n){SC(n,0)}function _c(n){var e=Xs(n);if(dx(e))return n}function cH(n,e){if(n==="change")return e}var oC=!1;if(ar){var ld;if(ar){var cd="oninput"in document;if(!cd){var aC=document.createElement("div");aC.setAttribute("oninput","return;"),cd=typeof aC.oninput=="function"}ld=cd}else ld=!1;oC=ld&&(!document.documentMode||9<document.documentMode)}function lC(){ba&&(ba.detachEvent("onpropertychange",cC),wa=ba=null)}function cC(n){if(n.propertyName==="value"&&_c(wa)){var e=[];sC(e,wa,n,Vf(n)),Mx(lH,e)}}function uH(n,e,t){n==="focusin"?(lC(),ba=e,wa=t,ba.attachEvent("onpropertychange",cC)):n==="focusout"&&lC()}function hH(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return _c(wa)}function fH(n,e){if(n==="click")return _c(e)}function dH(n,e){if(n==="input"||n==="change")return _c(e)}function gH(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Sn=typeof Object.is=="function"?Object.is:gH;function xa(n,e){if(Sn(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;var t=Object.keys(n),r=Object.keys(e);if(t.length!==r.length)return!1;for(r=0;r<t.length;r++){var i=t[r];if(!wf.call(e,i)||!Sn(n[i],e[i]))return!1}return!0}function uC(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function hC(n,e){var t=uC(n);n=0;for(var r;t;){if(t.nodeType===3){if(r=n+t.textContent.length,n<=e&&r>=e)return{node:t,offset:e-n};n=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=uC(t)}}function fC(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?fC(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function dC(){for(var n=window,e=dc();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch(r){t=!1}if(t)n=e.contentWindow;else break;e=dc(n.document)}return e}function ud(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function pH(n){var e=dC(),t=n.focusedElem,r=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&fC(t.ownerDocument.documentElement,t)){if(r!==null&&ud(t)){if(e=r.start,n=r.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var i=t.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!n.extend&&s>r&&(i=r,r=s,s=i),i=hC(t,s);var o=hC(t,r);i&&o&&(n.rangeCount!==1||n.anchorNode!==i.node||n.anchorOffset!==i.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),n.removeAllRanges(),s>r?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)n=e[t],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var mH=ar&&"documentMode"in document&&11>=document.documentMode,Gs=null,hd=null,Ca=null,fd=!1;function gC(n,e,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;fd||Gs==null||Gs!==dc(r)||(r=Gs,"selectionStart"in r&&ud(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ca&&xa(Ca,r)||(Ca=r,r=Ic(hd,"onSelect"),0<r.length&&(e=new nd("onSelect","select",null,e,t),n.push({event:e,listeners:r}),e.target=Gs)))}function Nc(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var Hs={animationend:Nc("Animation","AnimationEnd"),animationiteration:Nc("Animation","AnimationIteration"),animationstart:Nc("Animation","AnimationStart"),transitionend:Nc("Transition","TransitionEnd")},dd={},pC={};ar&&(pC=document.createElement("div").style,"AnimationEvent"in window||(delete Hs.animationend.animation,delete Hs.animationiteration.animation,delete Hs.animationstart.animation),"TransitionEvent"in window||delete Hs.transitionend.transition);function kc(n){if(dd[n])return dd[n];if(!Hs[n])return n;var e=Hs[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in pC)return dd[n]=e[t];return n}var mC=kc("animationend"),yC=kc("animationiteration"),vC=kc("animationstart"),bC=kc("transitionend"),wC=new Map,xC="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Hr(n,e){wC.set(n,e),Ti(e,[n])}for(var gd=0;gd<xC.length;gd++){var pd=xC[gd],yH=pd.toLowerCase(),vH=pd[0].toUpperCase()+pd.slice(1);Hr(yH,"on"+vH)}Hr(mC,"onAnimationEnd"),Hr(yC,"onAnimationIteration"),Hr(vC,"onAnimationStart"),Hr("dblclick","onDoubleClick"),Hr("focusin","onFocus"),Hr("focusout","onBlur"),Hr(bC,"onTransitionEnd"),Ls("onMouseEnter",["mouseout","mouseover"]),Ls("onMouseLeave",["mouseout","mouseover"]),Ls("onPointerEnter",["pointerout","pointerover"]),Ls("onPointerLeave",["pointerout","pointerover"]),Ti("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ti("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ti("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ti("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ti("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ti("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sa="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),bH=new Set("cancel close invalid load scroll toggle".split(" ").concat(Sa));function CC(n,e,t){var r=n.type||"unknown-event";n.currentTarget=t,y8(r,e,void 0,n),n.currentTarget=null}function SC(n,e){e=(e&4)!==0;for(var t=0;t<n.length;t++){var r=n[t],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;CC(i,a,c),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;CC(i,a,c),s=l}}}if(mc)throw n=Uf,mc=!1,Uf=null,n}function Oe(n,e){var t=e[Sd];t===void 0&&(t=e[Sd]=new Set);var r=n+"__bubble";t.has(r)||(PC(e,n,2,!1),t.add(r))}function md(n,e,t){var r=0;e&&(r|=4),PC(t,n,r,e)}var $c="_reactListening"+Math.random().toString(36).slice(2);function Pa(n){if(!n[$c]){n[$c]=!0,sx.forEach(function(t){t!=="selectionchange"&&(bH.has(t)||md(t,!1,n),md(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[$c]||(e[$c]=!0,md("selectionchange",!1,e))}}function PC(n,e,t,r){switch(Wx(e)){case 1:var i=$8;break;case 4:i=I8;break;default:i=Zf}t=i.bind(null,e,t,n),i=void 0,!Hf||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?n.addEventListener(e,t,{capture:!0,passive:i}):n.addEventListener(e,t,!0):i!==void 0?n.addEventListener(e,t,{passive:i}):n.addEventListener(e,t,!1)}function yd(n,e,t,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Mi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}Mx(function(){var c=s,u=Vf(t),h=[];e:{var f=wC.get(n);if(f!==void 0){var d=nd,g=n;switch(n){case"keypress":if(Tc(t)===0)break e;case"keydown":case"keyup":d=Y8;break;case"focusin":g="focus",d=sd;break;case"focusout":g="blur",d=sd;break;case"beforeblur":case"afterblur":d=sd;break;case"click":if(t.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=Kx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=j8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=Q8;break;case mC:case yC:case vC:d=z8;break;case bC:d=eH;break;case"scroll":d=L8;break;case"wheel":d=nH;break;case"copy":case"cut":case"paste":d=V8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=Qx}var p=(e&4)!==0,b=!p&&n==="scroll",m=p?f!==null?f+"Capture":null:f;p=[];for(var y=c,v;y!==null;){v=y;var w=v.stateNode;if(v.tag===5&&w!==null&&(v=w,m!==null&&(w=oa(y,m),w!=null&&p.push(Ea(y,w,v)))),b)break;y=y.return}0<p.length&&(f=new d(f,g,null,t,u),h.push({event:f,listeners:p}))}}if(!(e&7)){e:{if(f=n==="mouseover"||n==="pointerover",d=n==="mouseout"||n==="pointerout",f&&t!==Ff&&(g=t.relatedTarget||t.fromElement)&&(Mi(g)||g[cr]))break e;if((d||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,d?(g=t.relatedTarget||t.toElement,d=c,g=g?Mi(g):null,g!==null&&(b=Oi(g),g!==b||g.tag!==5&&g.tag!==6)&&(g=null)):(d=null,g=c),d!==g)){if(p=Kx,w="onMouseLeave",m="onMouseEnter",y="mouse",(n==="pointerout"||n==="pointerover")&&(p=Qx,w="onPointerLeave",m="onPointerEnter",y="pointer"),b=d==null?f:Xs(d),v=g==null?f:Xs(g),f=new p(w,y+"leave",d,t,u),f.target=b,f.relatedTarget=v,w=null,Mi(u)===c&&(p=new p(m,y+"enter",g,t,u),p.target=v,p.relatedTarget=b,w=p),b=w,d&&g)t:{for(p=d,m=g,y=0,v=p;v;v=Us(v))y++;for(v=0,w=m;w;w=Us(w))v++;for(;0<y-v;)p=Us(p),y--;for(;0<v-y;)m=Us(m),v--;for(;y--;){if(p===m||m!==null&&p===m.alternate)break t;p=Us(p),m=Us(m)}p=null}else p=null;d!==null&&EC(h,f,d,p,!1),g!==null&&b!==null&&EC(h,b,g,p,!0)}}e:{if(f=c?Xs(c):window,d=f.nodeName&&f.nodeName.toLowerCase(),d==="select"||d==="input"&&f.type==="file")var x=cH;else if(iC(f))if(oC)x=dH;else{x=hH;var C=uH}else(d=f.nodeName)&&d.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(x=fH);if(x&&(x=x(n,c))){sC(h,x,t,u);break e}C&&C(n,f,c),n==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&Rf(f,"number",f.value)}switch(C=c?Xs(c):window,n){case"focusin":(iC(C)||C.contentEditable==="true")&&(Gs=C,hd=c,Ca=null);break;case"focusout":Ca=hd=Gs=null;break;case"mousedown":fd=!0;break;case"contextmenu":case"mouseup":case"dragend":fd=!1,gC(h,t,u);break;case"selectionchange":if(mH)break;case"keydown":case"keyup":gC(h,t,u)}var S;if(ad)e:{switch(n){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else qs?nC(n,t)&&(E="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(E="onCompositionStart");E&&(Zx&&t.locale!=="ko"&&(qs||E!=="onCompositionStart"?E==="onCompositionEnd"&&qs&&(S=Xx()):(Gr=u,td="value"in Gr?Gr.value:Gr.textContent,qs=!0)),C=Ic(c,E),0<C.length&&(E=new Jx(E,n,null,t,u),h.push({event:E,listeners:C}),S?E.data=S:(S=rC(t),S!==null&&(E.data=S)))),(S=iH?sH(n,t):oH(n,t))&&(c=Ic(c,"onBeforeInput"),0<c.length&&(u=new Jx("onBeforeInput","beforeinput",null,t,u),h.push({event:u,listeners:c}),u.data=S))}SC(h,e)})}function Ea(n,e,t){return{instance:n,listener:e,currentTarget:t}}function Ic(n,e){for(var t=e+"Capture",r=[];n!==null;){var i=n,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=oa(n,t),s!=null&&r.unshift(Ea(n,s,i)),s=oa(n,e),s!=null&&r.push(Ea(n,s,i))),n=n.return}return r}function Us(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function EC(n,e,t,r,i){for(var s=e._reactName,o=[];t!==null&&t!==r;){var a=t,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=oa(t,s),l!=null&&o.unshift(Ea(t,l,a))):i||(l=oa(t,s),l!=null&&o.push(Ea(t,l,a)))),t=t.return}o.length!==0&&n.push({event:e,listeners:o})}var wH=/\r\n?/g,xH=/\u0000|\uFFFD/g;function AC(n){return(typeof n=="string"?n:""+n).replace(wH,`
445
- `).replace(xH,"")}function Lc(n,e,t){if(e=AC(e),AC(n)!==e&&t)throw Error(j(425))}function Rc(){}var vd=null,bd=null;function wd(n,e){return n==="textarea"||n==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var xd=typeof setTimeout=="function"?setTimeout:void 0,CH=typeof clearTimeout=="function"?clearTimeout:void 0,TC=typeof Promise=="function"?Promise:void 0,SH=typeof queueMicrotask=="function"?queueMicrotask:typeof TC!="undefined"?function(n){return TC.resolve(null).then(n).catch(PH)}:xd;function PH(n){setTimeout(function(){throw n})}function Cd(n,e){var t=e,r=0;do{var i=t.nextSibling;if(n.removeChild(t),i&&i.nodeType===8)if(t=i.data,t==="/$"){if(r===0){n.removeChild(i),pa(e);return}r--}else t!=="$"&&t!=="$?"&&t!=="$!"||r++;t=i}while(t);pa(e)}function Ur(n){for(;n!=null;n=n.nextSibling){var e=n.nodeType;if(e===1||e===3)break;if(e===8){if(e=n.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return n}function OC(n){n=n.previousSibling;for(var e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="$"||t==="$!"||t==="$?"){if(e===0)return n;e--}else t==="/$"&&e++}n=n.previousSibling}return null}var Ws=Math.random().toString(36).slice(2),Vn="__reactFiber$"+Ws,Aa="__reactProps$"+Ws,cr="__reactContainer$"+Ws,Sd="__reactEvents$"+Ws,EH="__reactListeners$"+Ws,AH="__reactHandles$"+Ws;function Mi(n){var e=n[Vn];if(e)return e;for(var t=n.parentNode;t;){if(e=t[cr]||t[Vn]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=OC(n);n!==null;){if(t=n[Vn])return t;n=OC(n)}return e}n=t,t=n.parentNode}return null}function Ta(n){return n=n[Vn]||n[cr],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function Xs(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(j(33))}function jc(n){return n[Aa]||null}var Pd=[],Ys=-1;function Wr(n){return{current:n}}function Me(n){0>Ys||(n.current=Pd[Ys],Pd[Ys]=null,Ys--)}function Ee(n,e){Ys++,Pd[Ys]=n.current,n.current=e}var Xr={},Ct=Wr(Xr),It=Wr(!1),_i=Xr;function Ks(n,e){var t=n.type.contextTypes;if(!t)return Xr;var r=n.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in t)i[s]=e[s];return r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=i),i}function Lt(n){return n=n.childContextTypes,n!=null}function Dc(){Me(It),Me(Ct)}function MC(n,e,t){if(Ct.current!==Xr)throw Error(j(168));Ee(Ct,e),Ee(It,t)}function _C(n,e,t){var r=n.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(j(108,u8(n)||"Unknown",i));return Le({},t,r)}function Bc(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Xr,_i=Ct.current,Ee(Ct,n),Ee(It,It.current),!0}function NC(n,e,t){var r=n.stateNode;if(!r)throw Error(j(169));t?(n=_C(n,e,_i),r.__reactInternalMemoizedMergedChildContext=n,Me(It),Me(Ct),Ee(Ct,n)):Me(It),Ee(It,t)}var ur=null,zc=!1,Ed=!1;function kC(n){ur===null?ur=[n]:ur.push(n)}function TH(n){zc=!0,kC(n)}function Yr(){if(!Ed&&ur!==null){Ed=!0;var n=0,e=me;try{var t=ur;for(me=1;n<t.length;n++){var r=t[n];do r=r(!0);while(r!==null)}ur=null,zc=!1}catch(i){throw ur!==null&&(ur=ur.slice(n+1)),Ix(Wf,Yr),i}finally{me=e,Ed=!1}}return null}var Js=[],Qs=0,Fc=null,Vc=0,an=[],ln=0,Ni=null,hr=1,fr="";function ki(n,e){Js[Qs++]=Vc,Js[Qs++]=Fc,Fc=n,Vc=e}function $C(n,e,t){an[ln++]=hr,an[ln++]=fr,an[ln++]=Ni,Ni=n;var r=hr;n=fr;var i=32-Cn(r)-1;r&=~(1<<i),t+=1;var s=32-Cn(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,hr=1<<32-Cn(e)+i|t<<i|r,fr=s+n}else hr=1<<s|t<<i|r,fr=n}function Ad(n){n.return!==null&&(ki(n,1),$C(n,1,0))}function Td(n){for(;n===Fc;)Fc=Js[--Qs],Js[Qs]=null,Vc=Js[--Qs],Js[Qs]=null;for(;n===Ni;)Ni=an[--ln],an[ln]=null,fr=an[--ln],an[ln]=null,hr=an[--ln],an[ln]=null}var Ut=null,Wt=null,Ne=!1,Pn=null;function IC(n,e){var t=fn(5,null,null,0);t.elementType="DELETED",t.stateNode=e,t.return=n,e=n.deletions,e===null?(n.deletions=[t],n.flags|=16):e.push(t)}function LC(n,e){switch(n.tag){case 5:var t=n.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(n.stateNode=e,Ut=n,Wt=Ur(e.firstChild),!0):!1;case 6:return e=n.pendingProps===""||e.nodeType!==3?null:e,e!==null?(n.stateNode=e,Ut=n,Wt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=Ni!==null?{id:hr,overflow:fr}:null,n.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=fn(18,null,null,0),t.stateNode=e,t.return=n,n.child=t,Ut=n,Wt=null,!0):!1;default:return!1}}function Od(n){return(n.mode&1)!==0&&(n.flags&128)===0}function Md(n){if(Ne){var e=Wt;if(e){var t=e;if(!LC(n,e)){if(Od(n))throw Error(j(418));e=Ur(t.nextSibling);var r=Ut;e&&LC(n,e)?IC(r,t):(n.flags=n.flags&-4097|2,Ne=!1,Ut=n)}}else{if(Od(n))throw Error(j(418));n.flags=n.flags&-4097|2,Ne=!1,Ut=n}}}function RC(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;Ut=n}function qc(n){if(n!==Ut)return!1;if(!Ne)return RC(n),Ne=!0,!1;var e;if((e=n.tag!==3)&&!(e=n.tag!==5)&&(e=n.type,e=e!=="head"&&e!=="body"&&!wd(n.type,n.memoizedProps)),e&&(e=Wt)){if(Od(n))throw jC(),Error(j(418));for(;e;)IC(n,e),e=Ur(e.nextSibling)}if(RC(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(j(317));e:{for(n=n.nextSibling,e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"){if(e===0){Wt=Ur(n.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}n=n.nextSibling}Wt=null}}else Wt=Ut?Ur(n.stateNode.nextSibling):null;return!0}function jC(){for(var n=Wt;n;)n=Ur(n.nextSibling)}function Zs(){Wt=Ut=null,Ne=!1}function _d(n){Pn===null?Pn=[n]:Pn.push(n)}var OH=lr.ReactCurrentBatchConfig;function En(n,e){if(n&&n.defaultProps){e=Le({},e),n=n.defaultProps;for(var t in n)e[t]===void 0&&(e[t]=n[t]);return e}return e}var Gc=Wr(null),Hc=null,eo=null,Nd=null;function kd(){Nd=eo=Hc=null}function $d(n){var e=Gc.current;Me(Gc),n._currentValue=e}function Id(n,e,t){for(;n!==null;){var r=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),n===t)break;n=n.return}}function to(n,e){Hc=n,Nd=eo=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(Rt=!0),n.firstContext=null)}function cn(n){var e=n._currentValue;if(Nd!==n)if(n={context:n,memoizedValue:e,next:null},eo===null){if(Hc===null)throw Error(j(308));eo=n,Hc.dependencies={lanes:0,firstContext:n}}else eo=eo.next=n;return e}var $i=null;function Ld(n){$i===null?$i=[n]:$i.push(n)}function DC(n,e,t,r){var i=e.interleaved;return i===null?(t.next=t,Ld(e)):(t.next=i.next,i.next=t),e.interleaved=t,dr(n,r)}function dr(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var Kr=!1;function Rd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function BC(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function gr(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function Jr(n,e,t){var r=n.updateQueue;if(r===null)return null;if(r=r.shared,ue&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,dr(n,t)}return i=r.interleaved,i===null?(e.next=e,Ld(r)):(e.next=i.next,i.next=e),r.interleaved=e,dr(n,t)}function Uc(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,Kf(n,t)}}function zC(n,e){var t=n.updateQueue,r=n.alternate;if(r!==null&&(r=r.updateQueue,t===r)){var i=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?i=s=o:s=s.next=o,t=t.next}while(t!==null);s===null?i=s=e:s=s.next=e}else i=s=e;t={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function Wc(n,e,t,r){var i=n.updateQueue;Kr=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var u=n.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(s!==null){var h=i.baseState;o=0,u=c=l=null,a=s;do{var f=a.lane,d=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:d,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=n,p=a;switch(f=e,d=t,p.tag){case 1:if(g=p.payload,typeof g=="function"){h=g.call(d,h,f);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=p.payload,f=typeof g=="function"?g.call(d,h,f):g,f==null)break e;h=Le({},h,f);break e;case 2:Kr=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else d={eventTime:d,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=d,l=h):u=u.next=d,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(l=h),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Ri|=o,n.lanes=o,n.memoizedState=h}}function FC(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;e<n.length;e++){var r=n[e],i=r.callback;if(i!==null){if(r.callback=null,r=t,typeof i!="function")throw Error(j(191,i));i.call(r)}}}var VC=new ix.Component().refs;function jd(n,e,t,r){e=n.memoizedState,t=t(r,e),t=t==null?e:Le({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var Xc={isMounted:function(n){return(n=n._reactInternals)?Oi(n)===n:!1},enqueueSetState:function(n,e,t){n=n._reactInternals;var r=Nt(),i=ti(n),s=gr(r,i);s.payload=e,t!=null&&(s.callback=t),e=Jr(n,s,i),e!==null&&(On(e,n,i,r),Uc(e,n,i))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var r=Nt(),i=ti(n),s=gr(r,i);s.tag=1,s.payload=e,t!=null&&(s.callback=t),e=Jr(n,s,i),e!==null&&(On(e,n,i,r),Uc(e,n,i))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=Nt(),r=ti(n),i=gr(t,r);i.tag=2,e!=null&&(i.callback=e),e=Jr(n,i,r),e!==null&&(On(e,n,r,t),Uc(e,n,r))}};function qC(n,e,t,r,i,s,o){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!xa(t,r)||!xa(i,s):!0}function GC(n,e,t){var r=!1,i=Xr,s=e.contextType;return typeof s=="object"&&s!==null?s=cn(s):(i=Lt(e)?_i:Ct.current,r=e.contextTypes,s=(r=r!=null)?Ks(n,i):Xr),e=new e(t,s),n.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Xc,n.stateNode=e,e._reactInternals=n,r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=i,n.__reactInternalMemoizedMaskedChildContext=s),e}function HC(n,e,t,r){n=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(t,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(t,r),e.state!==n&&Xc.enqueueReplaceState(e,e.state,null)}function Dd(n,e,t,r){var i=n.stateNode;i.props=t,i.state=n.memoizedState,i.refs=VC,Rd(n);var s=e.contextType;typeof s=="object"&&s!==null?i.context=cn(s):(s=Lt(e)?_i:Ct.current,i.context=Ks(n,s)),i.state=n.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(jd(n,e,s,t),i.state=n.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&Xc.enqueueReplaceState(i,i.state,null),Wc(n,t,i,r),i.state=n.memoizedState),typeof i.componentDidMount=="function"&&(n.flags|=4194308)}function Oa(n,e,t){if(n=t.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(t._owner){if(t=t._owner,t){if(t.tag!==1)throw Error(j(309));var r=t.stateNode}if(!r)throw Error(j(147,n));var i=r,s=""+n;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=i.refs;a===VC&&(a=i.refs={}),o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof n!="string")throw Error(j(284));if(!t._owner)throw Error(j(290,n))}return n}function Yc(n,e){throw n=Object.prototype.toString.call(e),Error(j(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n))}function UC(n){var e=n._init;return e(n._payload)}function WC(n){function e(m,y){if(n){var v=m.deletions;v===null?(m.deletions=[y],m.flags|=16):v.push(y)}}function t(m,y){if(!n)return null;for(;y!==null;)e(m,y),y=y.sibling;return null}function r(m,y){for(m=new Map;y!==null;)y.key!==null?m.set(y.key,y):m.set(y.index,y),y=y.sibling;return m}function i(m,y){return m=ri(m,y),m.index=0,m.sibling=null,m}function s(m,y,v){return m.index=v,n?(v=m.alternate,v!==null?(v=v.index,v<y?(m.flags|=2,y):v):(m.flags|=2,y)):(m.flags|=1048576,y)}function o(m){return n&&m.alternate===null&&(m.flags|=2),m}function a(m,y,v,w){return y===null||y.tag!==6?(y=xg(v,m.mode,w),y.return=m,y):(y=i(y,v),y.return=m,y)}function l(m,y,v,w){var x=v.type;return x===js?u(m,y,v.props.children,w,v.key):y!==null&&(y.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Dr&&UC(x)===y.type)?(w=i(y,v.props),w.ref=Oa(m,y,v),w.return=m,w):(w=gu(v.type,v.key,v.props,null,m.mode,w),w.ref=Oa(m,y,v),w.return=m,w)}function c(m,y,v,w){return y===null||y.tag!==4||y.stateNode.containerInfo!==v.containerInfo||y.stateNode.implementation!==v.implementation?(y=Cg(v,m.mode,w),y.return=m,y):(y=i(y,v.children||[]),y.return=m,y)}function u(m,y,v,w,x){return y===null||y.tag!==7?(y=zi(v,m.mode,w,x),y.return=m,y):(y=i(y,v),y.return=m,y)}function h(m,y,v){if(typeof y=="string"&&y!==""||typeof y=="number")return y=xg(""+y,m.mode,v),y.return=m,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case hc:return v=gu(y.type,y.key,y.props,null,m.mode,v),v.ref=Oa(m,null,y),v.return=m,v;case Rs:return y=Cg(y,m.mode,v),y.return=m,y;case Dr:var w=y._init;return h(m,w(y._payload),v)}if(ra(y)||ta(y))return y=zi(y,m.mode,v,null),y.return=m,y;Yc(m,y)}return null}function f(m,y,v,w){var x=y!==null?y.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return x!==null?null:a(m,y,""+v,w);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case hc:return v.key===x?l(m,y,v,w):null;case Rs:return v.key===x?c(m,y,v,w):null;case Dr:return x=v._init,f(m,y,x(v._payload),w)}if(ra(v)||ta(v))return x!==null?null:u(m,y,v,w,null);Yc(m,v)}return null}function d(m,y,v,w,x){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(v)||null,a(y,m,""+w,x);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case hc:return m=m.get(w.key===null?v:w.key)||null,l(y,m,w,x);case Rs:return m=m.get(w.key===null?v:w.key)||null,c(y,m,w,x);case Dr:var C=w._init;return d(m,y,v,C(w._payload),x)}if(ra(w)||ta(w))return m=m.get(v)||null,u(y,m,w,x,null);Yc(y,w)}return null}function g(m,y,v,w){for(var x=null,C=null,S=y,E=y=0,A=null;S!==null&&E<v.length;E++){S.index>E?(A=S,S=null):A=S.sibling;var O=f(m,S,v[E],w);if(O===null){S===null&&(S=A);break}n&&S&&O.alternate===null&&e(m,S),y=s(O,y,E),C===null?x=O:C.sibling=O,C=O,S=A}if(E===v.length)return t(m,S),Ne&&ki(m,E),x;if(S===null){for(;E<v.length;E++)S=h(m,v[E],w),S!==null&&(y=s(S,y,E),C===null?x=S:C.sibling=S,C=S);return Ne&&ki(m,E),x}for(S=r(m,S);E<v.length;E++)A=d(S,m,E,v[E],w),A!==null&&(n&&A.alternate!==null&&S.delete(A.key===null?E:A.key),y=s(A,y,E),C===null?x=A:C.sibling=A,C=A);return n&&S.forEach(function(T){return e(m,T)}),Ne&&ki(m,E),x}function p(m,y,v,w){var x=ta(v);if(typeof x!="function")throw Error(j(150));if(v=x.call(v),v==null)throw Error(j(151));for(var C=x=null,S=y,E=y=0,A=null,O=v.next();S!==null&&!O.done;E++,O=v.next()){S.index>E?(A=S,S=null):A=S.sibling;var T=f(m,S,O.value,w);if(T===null){S===null&&(S=A);break}n&&S&&T.alternate===null&&e(m,S),y=s(T,y,E),C===null?x=T:C.sibling=T,C=T,S=A}if(O.done)return t(m,S),Ne&&ki(m,E),x;if(S===null){for(;!O.done;E++,O=v.next())O=h(m,O.value,w),O!==null&&(y=s(O,y,E),C===null?x=O:C.sibling=O,C=O);return Ne&&ki(m,E),x}for(S=r(m,S);!O.done;E++,O=v.next())O=d(S,m,E,O.value,w),O!==null&&(n&&O.alternate!==null&&S.delete(O.key===null?E:O.key),y=s(O,y,E),C===null?x=O:C.sibling=O,C=O);return n&&S.forEach(function(I){return e(m,I)}),Ne&&ki(m,E),x}function b(m,y,v,w){if(typeof v=="object"&&v!==null&&v.type===js&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case hc:e:{for(var x=v.key,C=y;C!==null;){if(C.key===x){if(x=v.type,x===js){if(C.tag===7){t(m,C.sibling),y=i(C,v.props.children),y.return=m,m=y;break e}}else if(C.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Dr&&UC(x)===C.type){t(m,C.sibling),y=i(C,v.props),y.ref=Oa(m,C,v),y.return=m,m=y;break e}t(m,C);break}else e(m,C);C=C.sibling}v.type===js?(y=zi(v.props.children,m.mode,w,v.key),y.return=m,m=y):(w=gu(v.type,v.key,v.props,null,m.mode,w),w.ref=Oa(m,y,v),w.return=m,m=w)}return o(m);case Rs:e:{for(C=v.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){t(m,y.sibling),y=i(y,v.children||[]),y.return=m,m=y;break e}else{t(m,y);break}else e(m,y);y=y.sibling}y=Cg(v,m.mode,w),y.return=m,m=y}return o(m);case Dr:return C=v._init,b(m,y,C(v._payload),w)}if(ra(v))return g(m,y,v,w);if(ta(v))return p(m,y,v,w);Yc(m,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,y!==null&&y.tag===6?(t(m,y.sibling),y=i(y,v),y.return=m,m=y):(t(m,y),y=xg(v,m.mode,w),y.return=m,m=y),o(m)):t(m,y)}return b}var no=WC(!0),XC=WC(!1),Ma={},qn=Wr(Ma),_a=Wr(Ma),Na=Wr(Ma);function Ii(n){if(n===Ma)throw Error(j(174));return n}function Bd(n,e){switch(Ee(Na,e),Ee(_a,n),Ee(qn,Ma),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Df(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=Df(e,n)}Me(qn),Ee(qn,e)}function ro(){Me(qn),Me(_a),Me(Na)}function YC(n){Ii(Na.current);var e=Ii(qn.current),t=Df(e,n.type);e!==t&&(Ee(_a,n),Ee(qn,t))}function zd(n){_a.current===n&&(Me(qn),Me(_a))}var Re=Wr(0);function Kc(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Fd=[];function Vd(){for(var n=0;n<Fd.length;n++)Fd[n]._workInProgressVersionPrimary=null;Fd.length=0}var Jc=lr.ReactCurrentDispatcher,qd=lr.ReactCurrentBatchConfig,Li=0,je=null,ot=null,ft=null,Qc=!1,ka=!1,$a=0,MH=0;function St(){throw Error(j(321))}function Gd(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!Sn(n[t],e[t]))return!1;return!0}function Hd(n,e,t,r,i,s){if(Li=s,je=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Jc.current=n===null||n.memoizedState===null?$H:IH,n=t(r,i),ka){s=0;do{if(ka=!1,$a=0,25<=s)throw Error(j(301));s+=1,ft=ot=null,e.updateQueue=null,Jc.current=LH,n=t(r,i)}while(ka)}if(Jc.current=tu,e=ot!==null&&ot.next!==null,Li=0,ft=ot=je=null,Qc=!1,e)throw Error(j(300));return n}function Ud(){var n=$a!==0;return $a=0,n}function Gn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ft===null?je.memoizedState=ft=n:ft=ft.next=n,ft}function un(){if(ot===null){var n=je.alternate;n=n!==null?n.memoizedState:null}else n=ot.next;var e=ft===null?je.memoizedState:ft.next;if(e!==null)ft=e,ot=n;else{if(n===null)throw Error(j(310));ot=n,n={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},ft===null?je.memoizedState=ft=n:ft=ft.next=n}return ft}function Ia(n,e){return typeof e=="function"?e(n):e}function Wd(n){var e=un(),t=e.queue;if(t===null)throw Error(j(311));t.lastRenderedReducer=n;var r=ot,i=r.baseQueue,s=t.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,t.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,c=s;do{var u=c.lane;if((Li&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:n(r,c.action);else{var h={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=h,o=r):l=l.next=h,je.lanes|=u,Ri|=u}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,Sn(r,e.memoizedState)||(Rt=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=l,t.lastRenderedState=r}if(n=t.interleaved,n!==null){i=n;do s=i.lane,je.lanes|=s,Ri|=s,i=i.next;while(i!==n)}else i===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function Xd(n){var e=un(),t=e.queue;if(t===null)throw Error(j(311));t.lastRenderedReducer=n;var r=t.dispatch,i=t.pending,s=e.memoizedState;if(i!==null){t.pending=null;var o=i=i.next;do s=n(s,o.action),o=o.next;while(o!==i);Sn(s,e.memoizedState)||(Rt=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),t.lastRenderedState=s}return[s,r]}function KC(){}function JC(n,e){var t=je,r=un(),i=e(),s=!Sn(r.memoizedState,i);if(s&&(r.memoizedState=i,Rt=!0),r=r.queue,Yd(eS.bind(null,t,r,n),[n]),r.getSnapshot!==e||s||ft!==null&&ft.memoizedState.tag&1){if(t.flags|=2048,La(9,ZC.bind(null,t,r,i,e),void 0,null),dt===null)throw Error(j(349));Li&30||QC(t,e,i)}return i}function QC(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=je.updateQueue,e===null?(e={lastEffect:null,stores:null},je.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function ZC(n,e,t,r){e.value=t,e.getSnapshot=r,tS(e)&&nS(n)}function eS(n,e,t){return t(function(){tS(e)&&nS(n)})}function tS(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!Sn(n,t)}catch(r){return!0}}function nS(n){var e=dr(n,1);e!==null&&On(e,n,1,-1)}function rS(n){var e=Gn();return typeof n=="function"&&(n=n()),e.memoizedState=e.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:n},e.queue=n,n=n.dispatch=kH.bind(null,je,n),[e.memoizedState,n]}function La(n,e,t,r){return n={tag:n,create:e,destroy:t,deps:r,next:null},e=je.updateQueue,e===null?(e={lastEffect:null,stores:null},je.updateQueue=e,e.lastEffect=n.next=n):(t=e.lastEffect,t===null?e.lastEffect=n.next=n:(r=t.next,t.next=n,n.next=r,e.lastEffect=n)),n}function iS(){return un().memoizedState}function Zc(n,e,t,r){var i=Gn();je.flags|=n,i.memoizedState=La(1|e,t,void 0,r===void 0?null:r)}function eu(n,e,t,r){var i=un();r=r===void 0?null:r;var s=void 0;if(ot!==null){var o=ot.memoizedState;if(s=o.destroy,r!==null&&Gd(r,o.deps)){i.memoizedState=La(e,t,s,r);return}}je.flags|=n,i.memoizedState=La(1|e,t,s,r)}function sS(n,e){return Zc(8390656,8,n,e)}function Yd(n,e){return eu(2048,8,n,e)}function oS(n,e){return eu(4,2,n,e)}function aS(n,e){return eu(4,4,n,e)}function lS(n,e){if(typeof e=="function")return n=n(),e(n),function(){e(null)};if(e!=null)return n=n(),e.current=n,function(){e.current=null}}function cS(n,e,t){return t=t!=null?t.concat([n]):null,eu(4,4,lS.bind(null,e,n),t)}function Kd(){}function uS(n,e){var t=un();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&Gd(e,r[1])?r[0]:(t.memoizedState=[n,e],n)}function hS(n,e){var t=un();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&Gd(e,r[1])?r[0]:(n=n(),t.memoizedState=[n,e],n)}function fS(n,e,t){return Li&21?(Sn(t,e)||(t=Dx(),je.lanes|=t,Ri|=t,n.baseState=!0),e):(n.baseState&&(n.baseState=!1,Rt=!0),n.memoizedState=t)}function _H(n,e){var t=me;me=t!==0&&4>t?t:4,n(!0);var r=qd.transition;qd.transition={};try{n(!1),e()}finally{me=t,qd.transition=r}}function dS(){return un().memoizedState}function NH(n,e,t){var r=ti(n);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},gS(n))pS(e,t);else if(t=DC(n,e,t,r),t!==null){var i=Nt();On(t,n,r,i),mS(t,e,r)}}function kH(n,e,t){var r=ti(n),i={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(gS(n))pS(e,i);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(i.hasEagerState=!0,i.eagerState=a,Sn(a,o)){var l=e.interleaved;l===null?(i.next=i,Ld(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch(c){}finally{}t=DC(n,e,i,r),t!==null&&(i=Nt(),On(t,n,r,i),mS(t,e,r))}}function gS(n){var e=n.alternate;return n===je||e!==null&&e===je}function pS(n,e){ka=Qc=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function mS(n,e,t){if(t&4194240){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,Kf(n,t)}}var tu={readContext:cn,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useInsertionEffect:St,useLayoutEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useMutableSource:St,useSyncExternalStore:St,useId:St,unstable_isNewReconciler:!1},$H={readContext:cn,useCallback:function(n,e){return Gn().memoizedState=[n,e===void 0?null:e],n},useContext:cn,useEffect:sS,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Zc(4194308,4,lS.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Zc(4194308,4,n,e)},useInsertionEffect:function(n,e){return Zc(4,2,n,e)},useMemo:function(n,e){var t=Gn();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var r=Gn();return e=t!==void 0?t(e):e,r.memoizedState=r.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},r.queue=n,n=n.dispatch=NH.bind(null,je,n),[r.memoizedState,n]},useRef:function(n){var e=Gn();return n={current:n},e.memoizedState=n},useState:rS,useDebugValue:Kd,useDeferredValue:function(n){return Gn().memoizedState=n},useTransition:function(){var n=rS(!1),e=n[0];return n=_H.bind(null,n[1]),Gn().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var r=je,i=Gn();if(Ne){if(t===void 0)throw Error(j(407));t=t()}else{if(t=e(),dt===null)throw Error(j(349));Li&30||QC(r,e,t)}i.memoizedState=t;var s={value:t,getSnapshot:e};return i.queue=s,sS(eS.bind(null,r,s,n),[n]),r.flags|=2048,La(9,ZC.bind(null,r,s,t,e),void 0,null),t},useId:function(){var n=Gn(),e=dt.identifierPrefix;if(Ne){var t=fr,r=hr;t=(r&~(1<<32-Cn(r)-1)).toString(32)+t,e=":"+e+"R"+t,t=$a++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=MH++,e=":"+e+"r"+t.toString(32)+":";return n.memoizedState=e},unstable_isNewReconciler:!1},IH={readContext:cn,useCallback:uS,useContext:cn,useEffect:Yd,useImperativeHandle:cS,useInsertionEffect:oS,useLayoutEffect:aS,useMemo:hS,useReducer:Wd,useRef:iS,useState:function(){return Wd(Ia)},useDebugValue:Kd,useDeferredValue:function(n){var e=un();return fS(e,ot.memoizedState,n)},useTransition:function(){var n=Wd(Ia)[0],e=un().memoizedState;return[n,e]},useMutableSource:KC,useSyncExternalStore:JC,useId:dS,unstable_isNewReconciler:!1},LH={readContext:cn,useCallback:uS,useContext:cn,useEffect:Yd,useImperativeHandle:cS,useInsertionEffect:oS,useLayoutEffect:aS,useMemo:hS,useReducer:Xd,useRef:iS,useState:function(){return Xd(Ia)},useDebugValue:Kd,useDeferredValue:function(n){var e=un();return ot===null?e.memoizedState=n:fS(e,ot.memoizedState,n)},useTransition:function(){var n=Xd(Ia)[0],e=un().memoizedState;return[n,e]},useMutableSource:KC,useSyncExternalStore:JC,useId:dS,unstable_isNewReconciler:!1};function io(n,e){try{var t="",r=e;do t+=c8(r),r=r.return;while(r);var i=t}catch(s){i=`
444
+ `+i[o].replace(" at new "," at ");return n.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{Nf=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?ra(n):""}function l8(n){switch(n.tag){case 5:return ra(n.type);case 16:return ra("Lazy");case 13:return ra("Suspense");case 19:return ra("SuspenseList");case 0:case 2:case 15:return n=kf(n.type,!1),n;case 11:return n=kf(n.type.render,!1),n;case 1:return n=kf(n.type,!0),n;default:return""}}function $f(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case js:return"Fragment";case Rs:return"Portal";case Ef:return"Profiler";case Pf:return"StrictMode";case Tf:return"Suspense";case Of:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case lx:return(n.displayName||"Context")+".Consumer";case ax:return(n._context.displayName||"Context")+".Provider";case Af:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case Mf:return e=n.displayName||null,e!==null?e:$f(n.type)||"Memo";case Dr:e=n._payload,n=n._init;try{return $f(n(e))}catch(t){}}return null}function c8(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return $f(e);case 8:return e===Pf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Br(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function hx(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function u8(n){var e=hx(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),r=""+n[e];if(!n.hasOwnProperty(e)&&typeof t!="undefined"&&typeof t.get=="function"&&typeof t.set=="function"){var i=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function fc(n){n._valueTracker||(n._valueTracker=u8(n))}function fx(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),r="";return n&&(r=hx(n)?n.checked?"true":"false":n.value),n=r,n!==t?(e.setValue(n),!0):!1}function dc(n){if(n=n||(typeof document!="undefined"?document:void 0),typeof n=="undefined")return null;try{return n.activeElement||n.body}catch(e){return n.body}}function If(n,e){var t=e.checked;return Le({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t!=null?t:n._wrapperState.initialChecked})}function dx(n,e){var t=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;t=Br(e.value!=null?e.value:t),n._wrapperState={initialChecked:r,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function gx(n,e){e=e.checked,e!=null&&Sf(n,"checked",e,!1)}function Lf(n,e){gx(n,e);var t=Br(e.value),r=e.type;if(t!=null)r==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(r==="submit"||r==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?Rf(n,e.type,t):e.hasOwnProperty("defaultValue")&&Rf(n,e.type,Br(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function px(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function Rf(n,e,t){(e!=="number"||dc(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var ia=Array.isArray;function Ds(n,e,t,r){if(n=n.options,e){e={};for(var i=0;i<t.length;i++)e["$"+t[i]]=!0;for(t=0;t<n.length;t++)i=e.hasOwnProperty("$"+n[t].value),n[t].selected!==i&&(n[t].selected=i),i&&r&&(n[t].defaultSelected=!0)}else{for(t=""+Br(t),e=null,i=0;i<n.length;i++){if(n[i].value===t){n[i].selected=!0,r&&(n[i].defaultSelected=!0);return}e!==null||n[i].disabled||(e=n[i])}e!==null&&(e.selected=!0)}}function jf(n,e){if(e.dangerouslySetInnerHTML!=null)throw Error(j(91));return Le({},e,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function mx(n,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(j(92));if(ia(t)){if(1<t.length)throw Error(j(93));t=t[0]}e=t}e==null&&(e=""),t=e}n._wrapperState={initialValue:Br(t)}}function yx(n,e){var t=Br(e.value),r=Br(e.defaultValue);t!=null&&(t=""+t,t!==n.value&&(n.value=t),e.defaultValue==null&&n.defaultValue!==t&&(n.defaultValue=t)),r!=null&&(n.defaultValue=""+r)}function vx(n){var e=n.textContent;e===n._wrapperState.initialValue&&e!==""&&e!==null&&(n.value=e)}function bx(n){switch(n){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Df(n,e){return n==null||n==="http://www.w3.org/1999/xhtml"?bx(e):n==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var gc,wx=function(n){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(e,t,r,i){MSApp.execUnsafeLocalFunction(function(){return n(e,t,r,i)})}:n}(function(n,e){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=e;else{for(gc=gc||document.createElement("div"),gc.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=gc.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function sa(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var oa={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},h8=["Webkit","ms","Moz","O"];Object.keys(oa).forEach(function(n){h8.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),oa[e]=oa[n]})});function xx(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||oa.hasOwnProperty(n)&&oa[n]?(""+e).trim():e+"px"}function Cx(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var r=t.indexOf("--")===0,i=xx(t,e[t],r);t==="float"&&(t="cssFloat"),r?n.setProperty(t,i):n[t]=i}}var f8=Le({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Bf(n,e){if(e){if(f8[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(j(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(j(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(j(61))}if(e.style!=null&&typeof e.style!="object")throw Error(j(62))}}function zf(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ff=null;function Vf(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var qf=null,Bs=null,zs=null;function Sx(n){if(n=Oa(n)){if(typeof qf!="function")throw Error(j(280));var e=n.stateNode;e&&(e=jc(e),qf(n.stateNode,n.type,e))}}function Px(n){Bs?zs?zs.push(n):zs=[n]:Bs=n}function Ex(){if(Bs){var n=Bs,e=zs;if(zs=Bs=null,Sx(n),e)for(n=0;n<e.length;n++)Sx(e[n])}}function Ax(n,e){return n(e)}function Tx(){}var Gf=!1;function Ox(n,e,t){if(Gf)return n(e,t);Gf=!0;try{return Ax(n,e,t)}finally{Gf=!1,(Bs!==null||zs!==null)&&(Tx(),Ex())}}function aa(n,e){var t=n.stateNode;if(t===null)return null;var r=jc(t);if(r===null)return null;t=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(n=n.type,r=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!r;break e;default:n=!1}if(n)return null;if(t&&typeof t!="function")throw Error(j(231,e,typeof t));return t}var Hf=!1;if(ar)try{var la={};Object.defineProperty(la,"passive",{get:function(){Hf=!0}}),window.addEventListener("test",la,la),window.removeEventListener("test",la,la)}catch(n){Hf=!1}function d8(n,e,t,r,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(t,c)}catch(u){this.onError(u)}}var ca=!1,pc=null,mc=!1,Uf=null,g8={onError:function(n){ca=!0,pc=n}};function p8(n,e,t,r,i,s,o,a,l){ca=!1,pc=null,d8.apply(g8,arguments)}function m8(n,e,t,r,i,s,o,a,l){if(p8.apply(this,arguments),ca){if(ca){var c=pc;ca=!1,pc=null}else throw Error(j(198));mc||(mc=!0,Uf=c)}}function Oi(n){var e=n,t=n;if(n.alternate)for(;e.return;)e=e.return;else{n=e;do e=n,e.flags&4098&&(t=e.return),n=e.return;while(n)}return e.tag===3?t:null}function Mx(n){if(n.tag===13){var e=n.memoizedState;if(e===null&&(n=n.alternate,n!==null&&(e=n.memoizedState)),e!==null)return e.dehydrated}return null}function _x(n){if(Oi(n)!==n)throw Error(j(188))}function y8(n){var e=n.alternate;if(!e){if(e=Oi(n),e===null)throw Error(j(188));return e!==n?null:n}for(var t=n,r=e;;){var i=t.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){t=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===t)return _x(i),n;if(s===r)return _x(i),e;s=s.sibling}throw Error(j(188))}if(t.return!==r.return)t=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===t){o=!0,t=i,r=s;break}if(a===r){o=!0,r=i,t=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===t){o=!0,t=s,r=i;break}if(a===r){o=!0,r=s,t=i;break}a=a.sibling}if(!o)throw Error(j(189))}}if(t.alternate!==r)throw Error(j(190))}if(t.tag!==3)throw Error(j(188));return t.stateNode.current===t?n:e}function Nx(n){return n=y8(n),n!==null?kx(n):null}function kx(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var e=kx(n);if(e!==null)return e;n=n.sibling}return null}var $x=Gt.unstable_scheduleCallback,Ix=Gt.unstable_cancelCallback,v8=Gt.unstable_shouldYield,b8=Gt.unstable_requestPaint,Xe=Gt.unstable_now,w8=Gt.unstable_getCurrentPriorityLevel,Wf=Gt.unstable_ImmediatePriority,Lx=Gt.unstable_UserBlockingPriority,yc=Gt.unstable_NormalPriority,x8=Gt.unstable_LowPriority,Rx=Gt.unstable_IdlePriority,vc=null,Fn=null;function C8(n){if(Fn&&typeof Fn.onCommitFiberRoot=="function")try{Fn.onCommitFiberRoot(vc,n,void 0,(n.current.flags&128)===128)}catch(e){}}var Cn=Math.clz32?Math.clz32:E8,S8=Math.log,P8=Math.LN2;function E8(n){return n>>>=0,n===0?32:31-(S8(n)/P8|0)|0}var bc=64,wc=4194304;function ua(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function xc(n,e){var t=n.pendingLanes;if(t===0)return 0;var r=0,i=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~i;a!==0?r=ua(a):(s&=o,s!==0&&(r=ua(s)))}else o=t&~i,o!==0?r=ua(o):s!==0&&(r=ua(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=r;0<e;)t=31-Cn(e),i=1<<t,r|=n[t],e&=~i;return r}function A8(n,e){switch(n){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function T8(n,e){for(var t=n.suspendedLanes,r=n.pingedLanes,i=n.expirationTimes,s=n.pendingLanes;0<s;){var o=31-Cn(s),a=1<<o,l=i[o];l===-1?(!(a&t)||a&r)&&(i[o]=A8(a,e)):l<=e&&(n.expiredLanes|=a),s&=~a}}function Xf(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function jx(){var n=bc;return bc<<=1,!(bc&4194240)&&(bc=64),n}function Yf(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function ha(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Cn(e),n[e]=t}function O8(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var r=n.eventTimes;for(n=n.expirationTimes;0<t;){var i=31-Cn(t),s=1<<i;e[i]=0,r[i]=-1,n[i]=-1,t&=~s}}function Kf(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var r=31-Cn(t),i=1<<r;i&e|n[r]&e&&(n[r]|=e),t&=~i}}var ye=0;function Dx(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var Bx,Jf,zx,Fx,Vx,Qf=!1,Cc=[],zr=null,Fr=null,Vr=null,fa=new Map,da=new Map,qr=[],M8="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function qx(n,e){switch(n){case"focusin":case"focusout":zr=null;break;case"dragenter":case"dragleave":Fr=null;break;case"mouseover":case"mouseout":Vr=null;break;case"pointerover":case"pointerout":fa.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":da.delete(e.pointerId)}}function ga(n,e,t,r,i,s){return n===null||n.nativeEvent!==s?(n={blockedOn:e,domEventName:t,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=Oa(e),e!==null&&Jf(e)),n):(n.eventSystemFlags|=r,e=n.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),n)}function _8(n,e,t,r,i){switch(e){case"focusin":return zr=ga(zr,n,e,t,r,i),!0;case"dragenter":return Fr=ga(Fr,n,e,t,r,i),!0;case"mouseover":return Vr=ga(Vr,n,e,t,r,i),!0;case"pointerover":var s=i.pointerId;return fa.set(s,ga(fa.get(s)||null,n,e,t,r,i)),!0;case"gotpointercapture":return s=i.pointerId,da.set(s,ga(da.get(s)||null,n,e,t,r,i)),!0}return!1}function Gx(n){var e=Mi(n.target);if(e!==null){var t=Oi(e);if(t!==null){if(e=t.tag,e===13){if(e=Mx(t),e!==null){n.blockedOn=e,Vx(n.priority,function(){zx(t)});return}}else if(e===3&&t.stateNode.current.memoizedState.isDehydrated){n.blockedOn=t.tag===3?t.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Sc(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=ed(n.domEventName,n.eventSystemFlags,e[0],n.nativeEvent);if(t===null){t=n.nativeEvent;var r=new t.constructor(t.type,t);Ff=r,t.target.dispatchEvent(r),Ff=null}else return e=Oa(t),e!==null&&Jf(e),n.blockedOn=t,!1;e.shift()}return!0}function Hx(n,e,t){Sc(n)&&t.delete(e)}function N8(){Qf=!1,zr!==null&&Sc(zr)&&(zr=null),Fr!==null&&Sc(Fr)&&(Fr=null),Vr!==null&&Sc(Vr)&&(Vr=null),fa.forEach(Hx),da.forEach(Hx)}function pa(n,e){n.blockedOn===e&&(n.blockedOn=null,Qf||(Qf=!0,Gt.unstable_scheduleCallback(Gt.unstable_NormalPriority,N8)))}function ma(n){function e(i){return pa(i,n)}if(0<Cc.length){pa(Cc[0],n);for(var t=1;t<Cc.length;t++){var r=Cc[t];r.blockedOn===n&&(r.blockedOn=null)}}for(zr!==null&&pa(zr,n),Fr!==null&&pa(Fr,n),Vr!==null&&pa(Vr,n),fa.forEach(e),da.forEach(e),t=0;t<qr.length;t++)r=qr[t],r.blockedOn===n&&(r.blockedOn=null);for(;0<qr.length&&(t=qr[0],t.blockedOn===null);)Gx(t),t.blockedOn===null&&qr.shift()}var Fs=lr.ReactCurrentBatchConfig,Pc=!0;function k8(n,e,t,r){var i=ye,s=Fs.transition;Fs.transition=null;try{ye=1,Zf(n,e,t,r)}finally{ye=i,Fs.transition=s}}function $8(n,e,t,r){var i=ye,s=Fs.transition;Fs.transition=null;try{ye=4,Zf(n,e,t,r)}finally{ye=i,Fs.transition=s}}function Zf(n,e,t,r){if(Pc){var i=ed(n,e,t,r);if(i===null)yd(n,e,r,Ec,t),qx(n,r);else if(_8(i,n,e,t,r))r.stopPropagation();else if(qx(n,r),e&4&&-1<M8.indexOf(n)){for(;i!==null;){var s=Oa(i);if(s!==null&&Bx(s),s=ed(n,e,t,r),s===null&&yd(n,e,r,Ec,t),s===i)break;i=s}i!==null&&r.stopPropagation()}else yd(n,e,r,null,t)}}var Ec=null;function ed(n,e,t,r){if(Ec=null,n=Vf(r),n=Mi(n),n!==null)if(e=Oi(n),e===null)n=null;else if(t=e.tag,t===13){if(n=Mx(e),n!==null)return n;n=null}else if(t===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;n=null}else e!==n&&(n=null);return Ec=n,null}function Ux(n){switch(n){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(w8()){case Wf:return 1;case Lx:return 4;case yc:case x8:return 16;case Rx:return 536870912;default:return 16}default:return 16}}var Gr=null,td=null,Ac=null;function Wx(){if(Ac)return Ac;var n,e=td,t=e.length,r,i="value"in Gr?Gr.value:Gr.textContent,s=i.length;for(n=0;n<t&&e[n]===i[n];n++);var o=t-n;for(r=1;r<=o&&e[t-r]===i[s-r];r++);return Ac=i.slice(n,1<r?1-r:void 0)}function Tc(n){var e=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&e===13&&(n=13)):n=e,n===10&&(n=13),32<=n||n===13?n:0}function Oc(){return!0}function Xx(){return!1}function Ht(n){function e(t,r,i,s,o){this._reactName=t,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in n)n.hasOwnProperty(a)&&(t=n[a],this[a]=t?t(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Oc:Xx,this.isPropagationStopped=Xx,this}return Le(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():typeof t.returnValue!="unknown"&&(t.returnValue=!1),this.isDefaultPrevented=Oc)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=Oc)},persist:function(){},isPersistent:Oc}),e}var Vs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nd=Ht(Vs),ya=Le({},Vs,{view:0,detail:0}),I8=Ht(ya),rd,id,va,Mc=Le({},ya,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:od,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==va&&(va&&n.type==="mousemove"?(rd=n.screenX-va.screenX,id=n.screenY-va.screenY):id=rd=0,va=n),rd)},movementY:function(n){return"movementY"in n?n.movementY:id}}),Yx=Ht(Mc),L8=Le({},Mc,{dataTransfer:0}),R8=Ht(L8),j8=Le({},ya,{relatedTarget:0}),sd=Ht(j8),D8=Le({},Vs,{animationName:0,elapsedTime:0,pseudoElement:0}),B8=Ht(D8),z8=Le({},Vs,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),F8=Ht(z8),V8=Le({},Vs,{data:0}),Kx=Ht(V8),q8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},G8={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},H8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function U8(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=H8[n])?!!e[n]:!1}function od(){return U8}var W8=Le({},ya,{key:function(n){if(n.key){var e=q8[n.key]||n.key;if(e!=="Unidentified")return e}return n.type==="keypress"?(n=Tc(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?G8[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:od,charCode:function(n){return n.type==="keypress"?Tc(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Tc(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),X8=Ht(W8),Y8=Le({},Mc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jx=Ht(Y8),K8=Le({},ya,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:od}),J8=Ht(K8),Q8=Le({},Vs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Z8=Ht(Q8),eH=Le({},Mc,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),tH=Ht(eH),nH=[9,13,27,32],ad=ar&&"CompositionEvent"in window,ba=null;ar&&"documentMode"in document&&(ba=document.documentMode);var rH=ar&&"TextEvent"in window&&!ba,Qx=ar&&(!ad||ba&&8<ba&&11>=ba),Zx=String.fromCharCode(32),eC=!1;function tC(n,e){switch(n){case"keyup":return nH.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nC(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var qs=!1;function iH(n,e){switch(n){case"compositionend":return nC(e);case"keypress":return e.which!==32?null:(eC=!0,Zx);case"textInput":return n=e.data,n===Zx&&eC?null:n;default:return null}}function sH(n,e){if(qs)return n==="compositionend"||!ad&&tC(n,e)?(n=Wx(),Ac=td=Gr=null,qs=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Qx&&e.locale!=="ko"?null:e.data;default:return null}}var oH={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function rC(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!oH[n.type]:e==="textarea"}function iC(n,e,t,r){Px(r),e=Ic(e,"onChange"),0<e.length&&(t=new nd("onChange","change",null,t,r),n.push({event:t,listeners:e}))}var wa=null,xa=null;function aH(n){CC(n,0)}function _c(n){var e=Xs(n);if(fx(e))return n}function lH(n,e){if(n==="change")return e}var sC=!1;if(ar){var ld;if(ar){var cd="oninput"in document;if(!cd){var oC=document.createElement("div");oC.setAttribute("oninput","return;"),cd=typeof oC.oninput=="function"}ld=cd}else ld=!1;sC=ld&&(!document.documentMode||9<document.documentMode)}function aC(){wa&&(wa.detachEvent("onpropertychange",lC),xa=wa=null)}function lC(n){if(n.propertyName==="value"&&_c(xa)){var e=[];iC(e,xa,n,Vf(n)),Ox(aH,e)}}function cH(n,e,t){n==="focusin"?(aC(),wa=e,xa=t,wa.attachEvent("onpropertychange",lC)):n==="focusout"&&aC()}function uH(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return _c(xa)}function hH(n,e){if(n==="click")return _c(e)}function fH(n,e){if(n==="input"||n==="change")return _c(e)}function dH(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Sn=typeof Object.is=="function"?Object.is:dH;function Ca(n,e){if(Sn(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;var t=Object.keys(n),r=Object.keys(e);if(t.length!==r.length)return!1;for(r=0;r<t.length;r++){var i=t[r];if(!wf.call(e,i)||!Sn(n[i],e[i]))return!1}return!0}function cC(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function uC(n,e){var t=cC(n);n=0;for(var r;t;){if(t.nodeType===3){if(r=n+t.textContent.length,n<=e&&r>=e)return{node:t,offset:e-n};n=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=cC(t)}}function hC(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?hC(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function fC(){for(var n=window,e=dc();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch(r){t=!1}if(t)n=e.contentWindow;else break;e=dc(n.document)}return e}function ud(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function gH(n){var e=fC(),t=n.focusedElem,r=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&hC(t.ownerDocument.documentElement,t)){if(r!==null&&ud(t)){if(e=r.start,n=r.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var i=t.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!n.extend&&s>r&&(i=r,r=s,s=i),i=uC(t,s);var o=uC(t,r);i&&o&&(n.rangeCount!==1||n.anchorNode!==i.node||n.anchorOffset!==i.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),n.removeAllRanges(),s>r?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)n=e[t],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var pH=ar&&"documentMode"in document&&11>=document.documentMode,Gs=null,hd=null,Sa=null,fd=!1;function dC(n,e,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;fd||Gs==null||Gs!==dc(r)||(r=Gs,"selectionStart"in r&&ud(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Sa&&Ca(Sa,r)||(Sa=r,r=Ic(hd,"onSelect"),0<r.length&&(e=new nd("onSelect","select",null,e,t),n.push({event:e,listeners:r}),e.target=Gs)))}function Nc(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var Hs={animationend:Nc("Animation","AnimationEnd"),animationiteration:Nc("Animation","AnimationIteration"),animationstart:Nc("Animation","AnimationStart"),transitionend:Nc("Transition","TransitionEnd")},dd={},gC={};ar&&(gC=document.createElement("div").style,"AnimationEvent"in window||(delete Hs.animationend.animation,delete Hs.animationiteration.animation,delete Hs.animationstart.animation),"TransitionEvent"in window||delete Hs.transitionend.transition);function kc(n){if(dd[n])return dd[n];if(!Hs[n])return n;var e=Hs[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in gC)return dd[n]=e[t];return n}var pC=kc("animationend"),mC=kc("animationiteration"),yC=kc("animationstart"),vC=kc("transitionend"),bC=new Map,wC="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Hr(n,e){bC.set(n,e),Ti(e,[n])}for(var gd=0;gd<wC.length;gd++){var pd=wC[gd],mH=pd.toLowerCase(),yH=pd[0].toUpperCase()+pd.slice(1);Hr(mH,"on"+yH)}Hr(pC,"onAnimationEnd"),Hr(mC,"onAnimationIteration"),Hr(yC,"onAnimationStart"),Hr("dblclick","onDoubleClick"),Hr("focusin","onFocus"),Hr("focusout","onBlur"),Hr(vC,"onTransitionEnd"),Ls("onMouseEnter",["mouseout","mouseover"]),Ls("onMouseLeave",["mouseout","mouseover"]),Ls("onPointerEnter",["pointerout","pointerover"]),Ls("onPointerLeave",["pointerout","pointerover"]),Ti("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ti("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ti("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ti("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ti("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ti("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pa="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),vH=new Set("cancel close invalid load scroll toggle".split(" ").concat(Pa));function xC(n,e,t){var r=n.type||"unknown-event";n.currentTarget=t,m8(r,e,void 0,n),n.currentTarget=null}function CC(n,e){e=(e&4)!==0;for(var t=0;t<n.length;t++){var r=n[t],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;xC(i,a,c),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;xC(i,a,c),s=l}}}if(mc)throw n=Uf,mc=!1,Uf=null,n}function Me(n,e){var t=e[Sd];t===void 0&&(t=e[Sd]=new Set);var r=n+"__bubble";t.has(r)||(SC(e,n,2,!1),t.add(r))}function md(n,e,t){var r=0;e&&(r|=4),SC(t,n,r,e)}var $c="_reactListening"+Math.random().toString(36).slice(2);function Ea(n){if(!n[$c]){n[$c]=!0,ix.forEach(function(t){t!=="selectionchange"&&(vH.has(t)||md(t,!1,n),md(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[$c]||(e[$c]=!0,md("selectionchange",!1,e))}}function SC(n,e,t,r){switch(Ux(e)){case 1:var i=k8;break;case 4:i=$8;break;default:i=Zf}t=i.bind(null,e,t,n),i=void 0,!Hf||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?n.addEventListener(e,t,{capture:!0,passive:i}):n.addEventListener(e,t,!0):i!==void 0?n.addEventListener(e,t,{passive:i}):n.addEventListener(e,t,!1)}function yd(n,e,t,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Mi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}Ox(function(){var c=s,u=Vf(t),h=[];e:{var f=bC.get(n);if(f!==void 0){var d=nd,g=n;switch(n){case"keypress":if(Tc(t)===0)break e;case"keydown":case"keyup":d=X8;break;case"focusin":g="focus",d=sd;break;case"focusout":g="blur",d=sd;break;case"beforeblur":case"afterblur":d=sd;break;case"click":if(t.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=Yx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=R8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=J8;break;case pC:case mC:case yC:d=B8;break;case vC:d=Z8;break;case"scroll":d=I8;break;case"wheel":d=tH;break;case"copy":case"cut":case"paste":d=F8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=Jx}var p=(e&4)!==0,b=!p&&n==="scroll",m=p?f!==null?f+"Capture":null:f;p=[];for(var y=c,v;y!==null;){v=y;var w=v.stateNode;if(v.tag===5&&w!==null&&(v=w,m!==null&&(w=aa(y,m),w!=null&&p.push(Aa(y,w,v)))),b)break;y=y.return}0<p.length&&(f=new d(f,g,null,t,u),h.push({event:f,listeners:p}))}}if(!(e&7)){e:{if(f=n==="mouseover"||n==="pointerover",d=n==="mouseout"||n==="pointerout",f&&t!==Ff&&(g=t.relatedTarget||t.fromElement)&&(Mi(g)||g[cr]))break e;if((d||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,d?(g=t.relatedTarget||t.toElement,d=c,g=g?Mi(g):null,g!==null&&(b=Oi(g),g!==b||g.tag!==5&&g.tag!==6)&&(g=null)):(d=null,g=c),d!==g)){if(p=Yx,w="onMouseLeave",m="onMouseEnter",y="mouse",(n==="pointerout"||n==="pointerover")&&(p=Jx,w="onPointerLeave",m="onPointerEnter",y="pointer"),b=d==null?f:Xs(d),v=g==null?f:Xs(g),f=new p(w,y+"leave",d,t,u),f.target=b,f.relatedTarget=v,w=null,Mi(u)===c&&(p=new p(m,y+"enter",g,t,u),p.target=v,p.relatedTarget=b,w=p),b=w,d&&g)t:{for(p=d,m=g,y=0,v=p;v;v=Us(v))y++;for(v=0,w=m;w;w=Us(w))v++;for(;0<y-v;)p=Us(p),y--;for(;0<v-y;)m=Us(m),v--;for(;y--;){if(p===m||m!==null&&p===m.alternate)break t;p=Us(p),m=Us(m)}p=null}else p=null;d!==null&&PC(h,f,d,p,!1),g!==null&&b!==null&&PC(h,b,g,p,!0)}}e:{if(f=c?Xs(c):window,d=f.nodeName&&f.nodeName.toLowerCase(),d==="select"||d==="input"&&f.type==="file")var x=lH;else if(rC(f))if(sC)x=fH;else{x=uH;var C=cH}else(d=f.nodeName)&&d.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(x=hH);if(x&&(x=x(n,c))){iC(h,x,t,u);break e}C&&C(n,f,c),n==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&Rf(f,"number",f.value)}switch(C=c?Xs(c):window,n){case"focusin":(rC(C)||C.contentEditable==="true")&&(Gs=C,hd=c,Sa=null);break;case"focusout":Sa=hd=Gs=null;break;case"mousedown":fd=!0;break;case"contextmenu":case"mouseup":case"dragend":fd=!1,dC(h,t,u);break;case"selectionchange":if(pH)break;case"keydown":case"keyup":dC(h,t,u)}var S;if(ad)e:{switch(n){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else qs?tC(n,t)&&(E="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(E="onCompositionStart");E&&(Qx&&t.locale!=="ko"&&(qs||E!=="onCompositionStart"?E==="onCompositionEnd"&&qs&&(S=Wx()):(Gr=u,td="value"in Gr?Gr.value:Gr.textContent,qs=!0)),C=Ic(c,E),0<C.length&&(E=new Kx(E,n,null,t,u),h.push({event:E,listeners:C}),S?E.data=S:(S=nC(t),S!==null&&(E.data=S)))),(S=rH?iH(n,t):sH(n,t))&&(c=Ic(c,"onBeforeInput"),0<c.length&&(u=new Kx("onBeforeInput","beforeinput",null,t,u),h.push({event:u,listeners:c}),u.data=S))}CC(h,e)})}function Aa(n,e,t){return{instance:n,listener:e,currentTarget:t}}function Ic(n,e){for(var t=e+"Capture",r=[];n!==null;){var i=n,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=aa(n,t),s!=null&&r.unshift(Aa(n,s,i)),s=aa(n,e),s!=null&&r.push(Aa(n,s,i))),n=n.return}return r}function Us(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function PC(n,e,t,r,i){for(var s=e._reactName,o=[];t!==null&&t!==r;){var a=t,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=aa(t,s),l!=null&&o.unshift(Aa(t,l,a))):i||(l=aa(t,s),l!=null&&o.push(Aa(t,l,a)))),t=t.return}o.length!==0&&n.push({event:e,listeners:o})}var bH=/\r\n?/g,wH=/\u0000|\uFFFD/g;function EC(n){return(typeof n=="string"?n:""+n).replace(bH,`
445
+ `).replace(wH,"")}function Lc(n,e,t){if(e=EC(e),EC(n)!==e&&t)throw Error(j(425))}function Rc(){}var vd=null,bd=null;function wd(n,e){return n==="textarea"||n==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var xd=typeof setTimeout=="function"?setTimeout:void 0,xH=typeof clearTimeout=="function"?clearTimeout:void 0,AC=typeof Promise=="function"?Promise:void 0,CH=typeof queueMicrotask=="function"?queueMicrotask:typeof AC!="undefined"?function(n){return AC.resolve(null).then(n).catch(SH)}:xd;function SH(n){setTimeout(function(){throw n})}function Cd(n,e){var t=e,r=0;do{var i=t.nextSibling;if(n.removeChild(t),i&&i.nodeType===8)if(t=i.data,t==="/$"){if(r===0){n.removeChild(i),ma(e);return}r--}else t!=="$"&&t!=="$?"&&t!=="$!"||r++;t=i}while(t);ma(e)}function Ur(n){for(;n!=null;n=n.nextSibling){var e=n.nodeType;if(e===1||e===3)break;if(e===8){if(e=n.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return n}function TC(n){n=n.previousSibling;for(var e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="$"||t==="$!"||t==="$?"){if(e===0)return n;e--}else t==="/$"&&e++}n=n.previousSibling}return null}var Ws=Math.random().toString(36).slice(2),Vn="__reactFiber$"+Ws,Ta="__reactProps$"+Ws,cr="__reactContainer$"+Ws,Sd="__reactEvents$"+Ws,PH="__reactListeners$"+Ws,EH="__reactHandles$"+Ws;function Mi(n){var e=n[Vn];if(e)return e;for(var t=n.parentNode;t;){if(e=t[cr]||t[Vn]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=TC(n);n!==null;){if(t=n[Vn])return t;n=TC(n)}return e}n=t,t=n.parentNode}return null}function Oa(n){return n=n[Vn]||n[cr],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function Xs(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(j(33))}function jc(n){return n[Ta]||null}var Pd=[],Ys=-1;function Wr(n){return{current:n}}function _e(n){0>Ys||(n.current=Pd[Ys],Pd[Ys]=null,Ys--)}function Ae(n,e){Ys++,Pd[Ys]=n.current,n.current=e}var Xr={},Ct=Wr(Xr),It=Wr(!1),_i=Xr;function Ks(n,e){var t=n.type.contextTypes;if(!t)return Xr;var r=n.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in t)i[s]=e[s];return r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=i),i}function Lt(n){return n=n.childContextTypes,n!=null}function Dc(){_e(It),_e(Ct)}function OC(n,e,t){if(Ct.current!==Xr)throw Error(j(168));Ae(Ct,e),Ae(It,t)}function MC(n,e,t){var r=n.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(j(108,c8(n)||"Unknown",i));return Le({},t,r)}function Bc(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Xr,_i=Ct.current,Ae(Ct,n),Ae(It,It.current),!0}function _C(n,e,t){var r=n.stateNode;if(!r)throw Error(j(169));t?(n=MC(n,e,_i),r.__reactInternalMemoizedMergedChildContext=n,_e(It),_e(Ct),Ae(Ct,n)):_e(It),Ae(It,t)}var ur=null,zc=!1,Ed=!1;function NC(n){ur===null?ur=[n]:ur.push(n)}function AH(n){zc=!0,NC(n)}function Yr(){if(!Ed&&ur!==null){Ed=!0;var n=0,e=ye;try{var t=ur;for(ye=1;n<t.length;n++){var r=t[n];do r=r(!0);while(r!==null)}ur=null,zc=!1}catch(i){throw ur!==null&&(ur=ur.slice(n+1)),$x(Wf,Yr),i}finally{ye=e,Ed=!1}}return null}var Js=[],Qs=0,Fc=null,Vc=0,an=[],ln=0,Ni=null,hr=1,fr="";function ki(n,e){Js[Qs++]=Vc,Js[Qs++]=Fc,Fc=n,Vc=e}function kC(n,e,t){an[ln++]=hr,an[ln++]=fr,an[ln++]=Ni,Ni=n;var r=hr;n=fr;var i=32-Cn(r)-1;r&=~(1<<i),t+=1;var s=32-Cn(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,hr=1<<32-Cn(e)+i|t<<i|r,fr=s+n}else hr=1<<s|t<<i|r,fr=n}function Ad(n){n.return!==null&&(ki(n,1),kC(n,1,0))}function Td(n){for(;n===Fc;)Fc=Js[--Qs],Js[Qs]=null,Vc=Js[--Qs],Js[Qs]=null;for(;n===Ni;)Ni=an[--ln],an[ln]=null,fr=an[--ln],an[ln]=null,hr=an[--ln],an[ln]=null}var Ut=null,Wt=null,Ne=!1,Pn=null;function $C(n,e){var t=fn(5,null,null,0);t.elementType="DELETED",t.stateNode=e,t.return=n,e=n.deletions,e===null?(n.deletions=[t],n.flags|=16):e.push(t)}function IC(n,e){switch(n.tag){case 5:var t=n.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(n.stateNode=e,Ut=n,Wt=Ur(e.firstChild),!0):!1;case 6:return e=n.pendingProps===""||e.nodeType!==3?null:e,e!==null?(n.stateNode=e,Ut=n,Wt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=Ni!==null?{id:hr,overflow:fr}:null,n.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=fn(18,null,null,0),t.stateNode=e,t.return=n,n.child=t,Ut=n,Wt=null,!0):!1;default:return!1}}function Od(n){return(n.mode&1)!==0&&(n.flags&128)===0}function Md(n){if(Ne){var e=Wt;if(e){var t=e;if(!IC(n,e)){if(Od(n))throw Error(j(418));e=Ur(t.nextSibling);var r=Ut;e&&IC(n,e)?$C(r,t):(n.flags=n.flags&-4097|2,Ne=!1,Ut=n)}}else{if(Od(n))throw Error(j(418));n.flags=n.flags&-4097|2,Ne=!1,Ut=n}}}function LC(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;Ut=n}function qc(n){if(n!==Ut)return!1;if(!Ne)return LC(n),Ne=!0,!1;var e;if((e=n.tag!==3)&&!(e=n.tag!==5)&&(e=n.type,e=e!=="head"&&e!=="body"&&!wd(n.type,n.memoizedProps)),e&&(e=Wt)){if(Od(n))throw RC(),Error(j(418));for(;e;)$C(n,e),e=Ur(e.nextSibling)}if(LC(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(j(317));e:{for(n=n.nextSibling,e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"){if(e===0){Wt=Ur(n.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}n=n.nextSibling}Wt=null}}else Wt=Ut?Ur(n.stateNode.nextSibling):null;return!0}function RC(){for(var n=Wt;n;)n=Ur(n.nextSibling)}function Zs(){Wt=Ut=null,Ne=!1}function _d(n){Pn===null?Pn=[n]:Pn.push(n)}var TH=lr.ReactCurrentBatchConfig;function En(n,e){if(n&&n.defaultProps){e=Le({},e),n=n.defaultProps;for(var t in n)e[t]===void 0&&(e[t]=n[t]);return e}return e}var Gc=Wr(null),Hc=null,eo=null,Nd=null;function kd(){Nd=eo=Hc=null}function $d(n){var e=Gc.current;_e(Gc),n._currentValue=e}function Id(n,e,t){for(;n!==null;){var r=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),n===t)break;n=n.return}}function to(n,e){Hc=n,Nd=eo=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(Rt=!0),n.firstContext=null)}function cn(n){var e=n._currentValue;if(Nd!==n)if(n={context:n,memoizedValue:e,next:null},eo===null){if(Hc===null)throw Error(j(308));eo=n,Hc.dependencies={lanes:0,firstContext:n}}else eo=eo.next=n;return e}var $i=null;function Ld(n){$i===null?$i=[n]:$i.push(n)}function jC(n,e,t,r){var i=e.interleaved;return i===null?(t.next=t,Ld(e)):(t.next=i.next,i.next=t),e.interleaved=t,dr(n,r)}function dr(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var Kr=!1;function Rd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function DC(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function gr(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function Jr(n,e,t){var r=n.updateQueue;if(r===null)return null;if(r=r.shared,he&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,dr(n,t)}return i=r.interleaved,i===null?(e.next=e,Ld(r)):(e.next=i.next,i.next=e),r.interleaved=e,dr(n,t)}function Uc(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,Kf(n,t)}}function BC(n,e){var t=n.updateQueue,r=n.alternate;if(r!==null&&(r=r.updateQueue,t===r)){var i=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?i=s=o:s=s.next=o,t=t.next}while(t!==null);s===null?i=s=e:s=s.next=e}else i=s=e;t={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function Wc(n,e,t,r){var i=n.updateQueue;Kr=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var u=n.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(s!==null){var h=i.baseState;o=0,u=c=l=null,a=s;do{var f=a.lane,d=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:d,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=n,p=a;switch(f=e,d=t,p.tag){case 1:if(g=p.payload,typeof g=="function"){h=g.call(d,h,f);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=p.payload,f=typeof g=="function"?g.call(d,h,f):g,f==null)break e;h=Le({},h,f);break e;case 2:Kr=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else d={eventTime:d,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=d,l=h):u=u.next=d,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(l=h),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Ri|=o,n.lanes=o,n.memoizedState=h}}function zC(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;e<n.length;e++){var r=n[e],i=r.callback;if(i!==null){if(r.callback=null,r=t,typeof i!="function")throw Error(j(191,i));i.call(r)}}}var FC=new rx.Component().refs;function jd(n,e,t,r){e=n.memoizedState,t=t(r,e),t=t==null?e:Le({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var Xc={isMounted:function(n){return(n=n._reactInternals)?Oi(n)===n:!1},enqueueSetState:function(n,e,t){n=n._reactInternals;var r=Nt(),i=ti(n),s=gr(r,i);s.payload=e,t!=null&&(s.callback=t),e=Jr(n,s,i),e!==null&&(On(e,n,i,r),Uc(e,n,i))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var r=Nt(),i=ti(n),s=gr(r,i);s.tag=1,s.payload=e,t!=null&&(s.callback=t),e=Jr(n,s,i),e!==null&&(On(e,n,i,r),Uc(e,n,i))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=Nt(),r=ti(n),i=gr(t,r);i.tag=2,e!=null&&(i.callback=e),e=Jr(n,i,r),e!==null&&(On(e,n,r,t),Uc(e,n,r))}};function VC(n,e,t,r,i,s,o){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!Ca(t,r)||!Ca(i,s):!0}function qC(n,e,t){var r=!1,i=Xr,s=e.contextType;return typeof s=="object"&&s!==null?s=cn(s):(i=Lt(e)?_i:Ct.current,r=e.contextTypes,s=(r=r!=null)?Ks(n,i):Xr),e=new e(t,s),n.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Xc,n.stateNode=e,e._reactInternals=n,r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=i,n.__reactInternalMemoizedMaskedChildContext=s),e}function GC(n,e,t,r){n=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(t,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(t,r),e.state!==n&&Xc.enqueueReplaceState(e,e.state,null)}function Dd(n,e,t,r){var i=n.stateNode;i.props=t,i.state=n.memoizedState,i.refs=FC,Rd(n);var s=e.contextType;typeof s=="object"&&s!==null?i.context=cn(s):(s=Lt(e)?_i:Ct.current,i.context=Ks(n,s)),i.state=n.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(jd(n,e,s,t),i.state=n.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&Xc.enqueueReplaceState(i,i.state,null),Wc(n,t,i,r),i.state=n.memoizedState),typeof i.componentDidMount=="function"&&(n.flags|=4194308)}function Ma(n,e,t){if(n=t.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(t._owner){if(t=t._owner,t){if(t.tag!==1)throw Error(j(309));var r=t.stateNode}if(!r)throw Error(j(147,n));var i=r,s=""+n;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=i.refs;a===FC&&(a=i.refs={}),o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof n!="string")throw Error(j(284));if(!t._owner)throw Error(j(290,n))}return n}function Yc(n,e){throw n=Object.prototype.toString.call(e),Error(j(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n))}function HC(n){var e=n._init;return e(n._payload)}function UC(n){function e(m,y){if(n){var v=m.deletions;v===null?(m.deletions=[y],m.flags|=16):v.push(y)}}function t(m,y){if(!n)return null;for(;y!==null;)e(m,y),y=y.sibling;return null}function r(m,y){for(m=new Map;y!==null;)y.key!==null?m.set(y.key,y):m.set(y.index,y),y=y.sibling;return m}function i(m,y){return m=ri(m,y),m.index=0,m.sibling=null,m}function s(m,y,v){return m.index=v,n?(v=m.alternate,v!==null?(v=v.index,v<y?(m.flags|=2,y):v):(m.flags|=2,y)):(m.flags|=1048576,y)}function o(m){return n&&m.alternate===null&&(m.flags|=2),m}function a(m,y,v,w){return y===null||y.tag!==6?(y=xg(v,m.mode,w),y.return=m,y):(y=i(y,v),y.return=m,y)}function l(m,y,v,w){var x=v.type;return x===js?u(m,y,v.props.children,w,v.key):y!==null&&(y.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Dr&&HC(x)===y.type)?(w=i(y,v.props),w.ref=Ma(m,y,v),w.return=m,w):(w=gu(v.type,v.key,v.props,null,m.mode,w),w.ref=Ma(m,y,v),w.return=m,w)}function c(m,y,v,w){return y===null||y.tag!==4||y.stateNode.containerInfo!==v.containerInfo||y.stateNode.implementation!==v.implementation?(y=Cg(v,m.mode,w),y.return=m,y):(y=i(y,v.children||[]),y.return=m,y)}function u(m,y,v,w,x){return y===null||y.tag!==7?(y=zi(v,m.mode,w,x),y.return=m,y):(y=i(y,v),y.return=m,y)}function h(m,y,v){if(typeof y=="string"&&y!==""||typeof y=="number")return y=xg(""+y,m.mode,v),y.return=m,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case hc:return v=gu(y.type,y.key,y.props,null,m.mode,v),v.ref=Ma(m,null,y),v.return=m,v;case Rs:return y=Cg(y,m.mode,v),y.return=m,y;case Dr:var w=y._init;return h(m,w(y._payload),v)}if(ia(y)||na(y))return y=zi(y,m.mode,v,null),y.return=m,y;Yc(m,y)}return null}function f(m,y,v,w){var x=y!==null?y.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return x!==null?null:a(m,y,""+v,w);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case hc:return v.key===x?l(m,y,v,w):null;case Rs:return v.key===x?c(m,y,v,w):null;case Dr:return x=v._init,f(m,y,x(v._payload),w)}if(ia(v)||na(v))return x!==null?null:u(m,y,v,w,null);Yc(m,v)}return null}function d(m,y,v,w,x){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(v)||null,a(y,m,""+w,x);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case hc:return m=m.get(w.key===null?v:w.key)||null,l(y,m,w,x);case Rs:return m=m.get(w.key===null?v:w.key)||null,c(y,m,w,x);case Dr:var C=w._init;return d(m,y,v,C(w._payload),x)}if(ia(w)||na(w))return m=m.get(v)||null,u(y,m,w,x,null);Yc(y,w)}return null}function g(m,y,v,w){for(var x=null,C=null,S=y,E=y=0,A=null;S!==null&&E<v.length;E++){S.index>E?(A=S,S=null):A=S.sibling;var O=f(m,S,v[E],w);if(O===null){S===null&&(S=A);break}n&&S&&O.alternate===null&&e(m,S),y=s(O,y,E),C===null?x=O:C.sibling=O,C=O,S=A}if(E===v.length)return t(m,S),Ne&&ki(m,E),x;if(S===null){for(;E<v.length;E++)S=h(m,v[E],w),S!==null&&(y=s(S,y,E),C===null?x=S:C.sibling=S,C=S);return Ne&&ki(m,E),x}for(S=r(m,S);E<v.length;E++)A=d(S,m,E,v[E],w),A!==null&&(n&&A.alternate!==null&&S.delete(A.key===null?E:A.key),y=s(A,y,E),C===null?x=A:C.sibling=A,C=A);return n&&S.forEach(function(T){return e(m,T)}),Ne&&ki(m,E),x}function p(m,y,v,w){var x=na(v);if(typeof x!="function")throw Error(j(150));if(v=x.call(v),v==null)throw Error(j(151));for(var C=x=null,S=y,E=y=0,A=null,O=v.next();S!==null&&!O.done;E++,O=v.next()){S.index>E?(A=S,S=null):A=S.sibling;var T=f(m,S,O.value,w);if(T===null){S===null&&(S=A);break}n&&S&&T.alternate===null&&e(m,S),y=s(T,y,E),C===null?x=T:C.sibling=T,C=T,S=A}if(O.done)return t(m,S),Ne&&ki(m,E),x;if(S===null){for(;!O.done;E++,O=v.next())O=h(m,O.value,w),O!==null&&(y=s(O,y,E),C===null?x=O:C.sibling=O,C=O);return Ne&&ki(m,E),x}for(S=r(m,S);!O.done;E++,O=v.next())O=d(S,m,E,O.value,w),O!==null&&(n&&O.alternate!==null&&S.delete(O.key===null?E:O.key),y=s(O,y,E),C===null?x=O:C.sibling=O,C=O);return n&&S.forEach(function(I){return e(m,I)}),Ne&&ki(m,E),x}function b(m,y,v,w){if(typeof v=="object"&&v!==null&&v.type===js&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case hc:e:{for(var x=v.key,C=y;C!==null;){if(C.key===x){if(x=v.type,x===js){if(C.tag===7){t(m,C.sibling),y=i(C,v.props.children),y.return=m,m=y;break e}}else if(C.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Dr&&HC(x)===C.type){t(m,C.sibling),y=i(C,v.props),y.ref=Ma(m,C,v),y.return=m,m=y;break e}t(m,C);break}else e(m,C);C=C.sibling}v.type===js?(y=zi(v.props.children,m.mode,w,v.key),y.return=m,m=y):(w=gu(v.type,v.key,v.props,null,m.mode,w),w.ref=Ma(m,y,v),w.return=m,m=w)}return o(m);case Rs:e:{for(C=v.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){t(m,y.sibling),y=i(y,v.children||[]),y.return=m,m=y;break e}else{t(m,y);break}else e(m,y);y=y.sibling}y=Cg(v,m.mode,w),y.return=m,m=y}return o(m);case Dr:return C=v._init,b(m,y,C(v._payload),w)}if(ia(v))return g(m,y,v,w);if(na(v))return p(m,y,v,w);Yc(m,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,y!==null&&y.tag===6?(t(m,y.sibling),y=i(y,v),y.return=m,m=y):(t(m,y),y=xg(v,m.mode,w),y.return=m,m=y),o(m)):t(m,y)}return b}var no=UC(!0),WC=UC(!1),_a={},qn=Wr(_a),Na=Wr(_a),ka=Wr(_a);function Ii(n){if(n===_a)throw Error(j(174));return n}function Bd(n,e){switch(Ae(ka,e),Ae(Na,n),Ae(qn,_a),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Df(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=Df(e,n)}_e(qn),Ae(qn,e)}function ro(){_e(qn),_e(Na),_e(ka)}function XC(n){Ii(ka.current);var e=Ii(qn.current),t=Df(e,n.type);e!==t&&(Ae(Na,n),Ae(qn,t))}function zd(n){Na.current===n&&(_e(qn),_e(Na))}var Re=Wr(0);function Kc(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Fd=[];function Vd(){for(var n=0;n<Fd.length;n++)Fd[n]._workInProgressVersionPrimary=null;Fd.length=0}var Jc=lr.ReactCurrentDispatcher,qd=lr.ReactCurrentBatchConfig,Li=0,je=null,ot=null,ft=null,Qc=!1,$a=!1,Ia=0,OH=0;function St(){throw Error(j(321))}function Gd(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!Sn(n[t],e[t]))return!1;return!0}function Hd(n,e,t,r,i,s){if(Li=s,je=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Jc.current=n===null||n.memoizedState===null?kH:$H,n=t(r,i),$a){s=0;do{if($a=!1,Ia=0,25<=s)throw Error(j(301));s+=1,ft=ot=null,e.updateQueue=null,Jc.current=IH,n=t(r,i)}while($a)}if(Jc.current=tu,e=ot!==null&&ot.next!==null,Li=0,ft=ot=je=null,Qc=!1,e)throw Error(j(300));return n}function Ud(){var n=Ia!==0;return Ia=0,n}function Gn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ft===null?je.memoizedState=ft=n:ft=ft.next=n,ft}function un(){if(ot===null){var n=je.alternate;n=n!==null?n.memoizedState:null}else n=ot.next;var e=ft===null?je.memoizedState:ft.next;if(e!==null)ft=e,ot=n;else{if(n===null)throw Error(j(310));ot=n,n={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},ft===null?je.memoizedState=ft=n:ft=ft.next=n}return ft}function La(n,e){return typeof e=="function"?e(n):e}function Wd(n){var e=un(),t=e.queue;if(t===null)throw Error(j(311));t.lastRenderedReducer=n;var r=ot,i=r.baseQueue,s=t.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,t.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,c=s;do{var u=c.lane;if((Li&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:n(r,c.action);else{var h={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=h,o=r):l=l.next=h,je.lanes|=u,Ri|=u}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,Sn(r,e.memoizedState)||(Rt=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=l,t.lastRenderedState=r}if(n=t.interleaved,n!==null){i=n;do s=i.lane,je.lanes|=s,Ri|=s,i=i.next;while(i!==n)}else i===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function Xd(n){var e=un(),t=e.queue;if(t===null)throw Error(j(311));t.lastRenderedReducer=n;var r=t.dispatch,i=t.pending,s=e.memoizedState;if(i!==null){t.pending=null;var o=i=i.next;do s=n(s,o.action),o=o.next;while(o!==i);Sn(s,e.memoizedState)||(Rt=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),t.lastRenderedState=s}return[s,r]}function YC(){}function KC(n,e){var t=je,r=un(),i=e(),s=!Sn(r.memoizedState,i);if(s&&(r.memoizedState=i,Rt=!0),r=r.queue,Yd(ZC.bind(null,t,r,n),[n]),r.getSnapshot!==e||s||ft!==null&&ft.memoizedState.tag&1){if(t.flags|=2048,Ra(9,QC.bind(null,t,r,i,e),void 0,null),dt===null)throw Error(j(349));Li&30||JC(t,e,i)}return i}function JC(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=je.updateQueue,e===null?(e={lastEffect:null,stores:null},je.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function QC(n,e,t,r){e.value=t,e.getSnapshot=r,eS(e)&&tS(n)}function ZC(n,e,t){return t(function(){eS(e)&&tS(n)})}function eS(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!Sn(n,t)}catch(r){return!0}}function tS(n){var e=dr(n,1);e!==null&&On(e,n,1,-1)}function nS(n){var e=Gn();return typeof n=="function"&&(n=n()),e.memoizedState=e.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:n},e.queue=n,n=n.dispatch=NH.bind(null,je,n),[e.memoizedState,n]}function Ra(n,e,t,r){return n={tag:n,create:e,destroy:t,deps:r,next:null},e=je.updateQueue,e===null?(e={lastEffect:null,stores:null},je.updateQueue=e,e.lastEffect=n.next=n):(t=e.lastEffect,t===null?e.lastEffect=n.next=n:(r=t.next,t.next=n,n.next=r,e.lastEffect=n)),n}function rS(){return un().memoizedState}function Zc(n,e,t,r){var i=Gn();je.flags|=n,i.memoizedState=Ra(1|e,t,void 0,r===void 0?null:r)}function eu(n,e,t,r){var i=un();r=r===void 0?null:r;var s=void 0;if(ot!==null){var o=ot.memoizedState;if(s=o.destroy,r!==null&&Gd(r,o.deps)){i.memoizedState=Ra(e,t,s,r);return}}je.flags|=n,i.memoizedState=Ra(1|e,t,s,r)}function iS(n,e){return Zc(8390656,8,n,e)}function Yd(n,e){return eu(2048,8,n,e)}function sS(n,e){return eu(4,2,n,e)}function oS(n,e){return eu(4,4,n,e)}function aS(n,e){if(typeof e=="function")return n=n(),e(n),function(){e(null)};if(e!=null)return n=n(),e.current=n,function(){e.current=null}}function lS(n,e,t){return t=t!=null?t.concat([n]):null,eu(4,4,aS.bind(null,e,n),t)}function Kd(){}function cS(n,e){var t=un();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&Gd(e,r[1])?r[0]:(t.memoizedState=[n,e],n)}function uS(n,e){var t=un();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&Gd(e,r[1])?r[0]:(n=n(),t.memoizedState=[n,e],n)}function hS(n,e,t){return Li&21?(Sn(t,e)||(t=jx(),je.lanes|=t,Ri|=t,n.baseState=!0),e):(n.baseState&&(n.baseState=!1,Rt=!0),n.memoizedState=t)}function MH(n,e){var t=ye;ye=t!==0&&4>t?t:4,n(!0);var r=qd.transition;qd.transition={};try{n(!1),e()}finally{ye=t,qd.transition=r}}function fS(){return un().memoizedState}function _H(n,e,t){var r=ti(n);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},dS(n))gS(e,t);else if(t=jC(n,e,t,r),t!==null){var i=Nt();On(t,n,r,i),pS(t,e,r)}}function NH(n,e,t){var r=ti(n),i={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(dS(n))gS(e,i);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(i.hasEagerState=!0,i.eagerState=a,Sn(a,o)){var l=e.interleaved;l===null?(i.next=i,Ld(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch(c){}finally{}t=jC(n,e,i,r),t!==null&&(i=Nt(),On(t,n,r,i),pS(t,e,r))}}function dS(n){var e=n.alternate;return n===je||e!==null&&e===je}function gS(n,e){$a=Qc=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function pS(n,e,t){if(t&4194240){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,Kf(n,t)}}var tu={readContext:cn,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useInsertionEffect:St,useLayoutEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useMutableSource:St,useSyncExternalStore:St,useId:St,unstable_isNewReconciler:!1},kH={readContext:cn,useCallback:function(n,e){return Gn().memoizedState=[n,e===void 0?null:e],n},useContext:cn,useEffect:iS,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Zc(4194308,4,aS.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Zc(4194308,4,n,e)},useInsertionEffect:function(n,e){return Zc(4,2,n,e)},useMemo:function(n,e){var t=Gn();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var r=Gn();return e=t!==void 0?t(e):e,r.memoizedState=r.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},r.queue=n,n=n.dispatch=_H.bind(null,je,n),[r.memoizedState,n]},useRef:function(n){var e=Gn();return n={current:n},e.memoizedState=n},useState:nS,useDebugValue:Kd,useDeferredValue:function(n){return Gn().memoizedState=n},useTransition:function(){var n=nS(!1),e=n[0];return n=MH.bind(null,n[1]),Gn().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var r=je,i=Gn();if(Ne){if(t===void 0)throw Error(j(407));t=t()}else{if(t=e(),dt===null)throw Error(j(349));Li&30||JC(r,e,t)}i.memoizedState=t;var s={value:t,getSnapshot:e};return i.queue=s,iS(ZC.bind(null,r,s,n),[n]),r.flags|=2048,Ra(9,QC.bind(null,r,s,t,e),void 0,null),t},useId:function(){var n=Gn(),e=dt.identifierPrefix;if(Ne){var t=fr,r=hr;t=(r&~(1<<32-Cn(r)-1)).toString(32)+t,e=":"+e+"R"+t,t=Ia++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=OH++,e=":"+e+"r"+t.toString(32)+":";return n.memoizedState=e},unstable_isNewReconciler:!1},$H={readContext:cn,useCallback:cS,useContext:cn,useEffect:Yd,useImperativeHandle:lS,useInsertionEffect:sS,useLayoutEffect:oS,useMemo:uS,useReducer:Wd,useRef:rS,useState:function(){return Wd(La)},useDebugValue:Kd,useDeferredValue:function(n){var e=un();return hS(e,ot.memoizedState,n)},useTransition:function(){var n=Wd(La)[0],e=un().memoizedState;return[n,e]},useMutableSource:YC,useSyncExternalStore:KC,useId:fS,unstable_isNewReconciler:!1},IH={readContext:cn,useCallback:cS,useContext:cn,useEffect:Yd,useImperativeHandle:lS,useInsertionEffect:sS,useLayoutEffect:oS,useMemo:uS,useReducer:Xd,useRef:rS,useState:function(){return Xd(La)},useDebugValue:Kd,useDeferredValue:function(n){var e=un();return ot===null?e.memoizedState=n:hS(e,ot.memoizedState,n)},useTransition:function(){var n=Xd(La)[0],e=un().memoizedState;return[n,e]},useMutableSource:YC,useSyncExternalStore:KC,useId:fS,unstable_isNewReconciler:!1};function io(n,e){try{var t="",r=e;do t+=l8(r),r=r.return;while(r);var i=t}catch(s){i=`
446
446
  Error generating stack: `+s.message+`
447
- `+s.stack}return{value:n,source:e,stack:i,digest:null}}function Jd(n,e,t){return{value:n,source:null,stack:t!=null?t:null,digest:e!=null?e:null}}function Qd(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var RH=typeof WeakMap=="function"?WeakMap:Map;function yS(n,e,t){t=gr(-1,t),t.tag=3,t.payload={element:null};var r=e.value;return t.callback=function(){lu||(lu=!0,dg=r),Qd(n,e)},t}function vS(n,e,t){t=gr(-1,t),t.tag=3;var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;t.payload=function(){return r(i)},t.callback=function(){Qd(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){Qd(n,e),typeof r!="function"&&(Zr===null?Zr=new Set([this]):Zr.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function bS(n,e,t){var r=n.pingCache;if(r===null){r=n.pingCache=new RH;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(t)||(i.add(t),n=KH.bind(null,n,e,t),e.then(n,n))}function wS(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function xS(n,e,t,r,i){return n.mode&1?(n.flags|=65536,n.lanes=i,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=gr(-1,1),e.tag=2,Jr(t,e,1))),t.lanes|=1),n)}var jH=lr.ReactCurrentOwner,Rt=!1;function _t(n,e,t,r){e.child=n===null?XC(e,null,t,r):no(e,n.child,t,r)}function CS(n,e,t,r,i){t=t.render;var s=e.ref;return to(e,i),r=Hd(n,e,t,r,s,i),t=Ud(),n!==null&&!Rt?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,pr(n,e,i)):(Ne&&t&&Ad(e),e.flags|=1,_t(n,e,r,i),e.child)}function SS(n,e,t,r,i){if(n===null){var s=t.type;return typeof s=="function"&&!wg(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,PS(n,e,s,r,i)):(n=gu(t.type,null,r,e,e.mode,i),n.ref=e.ref,n.return=e,e.child=n)}if(s=n.child,!(n.lanes&i)){var o=s.memoizedProps;if(t=t.compare,t=t!==null?t:xa,t(o,r)&&n.ref===e.ref)return pr(n,e,i)}return e.flags|=1,n=ri(s,r),n.ref=e.ref,n.return=e,e.child=n}function PS(n,e,t,r,i){if(n!==null){var s=n.memoizedProps;if(xa(s,r)&&n.ref===e.ref)if(Rt=!1,e.pendingProps=r=s,(n.lanes&i)!==0)n.flags&131072&&(Rt=!0);else return e.lanes=n.lanes,pr(n,e,i)}return Zd(n,e,t,r,i)}function ES(n,e,t){var r=e.pendingProps,i=r.children,s=n!==null?n.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ee(oo,Xt),Xt|=t;else{if(!(t&1073741824))return n=s!==null?s.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,Ee(oo,Xt),Xt|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:t,Ee(oo,Xt),Xt|=r}else s!==null?(r=s.baseLanes|t,e.memoizedState=null):r=t,Ee(oo,Xt),Xt|=r;return _t(n,e,i,t),e.child}function AS(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function Zd(n,e,t,r,i){var s=Lt(t)?_i:Ct.current;return s=Ks(e,s),to(e,i),t=Hd(n,e,t,r,s,i),r=Ud(),n!==null&&!Rt?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,pr(n,e,i)):(Ne&&r&&Ad(e),e.flags|=1,_t(n,e,t,i),e.child)}function TS(n,e,t,r,i){if(Lt(t)){var s=!0;Bc(e)}else s=!1;if(to(e,i),e.stateNode===null)ru(n,e),GC(e,t,r),Dd(e,t,r,i),r=!0;else if(n===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,c=t.contextType;typeof c=="object"&&c!==null?c=cn(c):(c=Lt(t)?_i:Ct.current,c=Ks(e,c));var u=t.getDerivedStateFromProps,h=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&HC(e,o,r,c),Kr=!1;var f=e.memoizedState;o.state=f,Wc(e,r,o,i),l=e.memoizedState,a!==r||f!==l||It.current||Kr?(typeof u=="function"&&(jd(e,t,u,r),l=e.memoizedState),(a=Kr||qC(e,t,a,r,f,l,c))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,BC(n,e),a=e.memoizedProps,c=e.type===e.elementType?a:En(e.type,a),o.props=c,h=e.pendingProps,f=o.context,l=t.contextType,typeof l=="object"&&l!==null?l=cn(l):(l=Lt(t)?_i:Ct.current,l=Ks(e,l));var d=t.getDerivedStateFromProps;(u=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||f!==l)&&HC(e,o,r,l),Kr=!1,f=e.memoizedState,o.state=f,Wc(e,r,o,i);var g=e.memoizedState;a!==h||f!==g||It.current||Kr?(typeof d=="function"&&(jd(e,t,d,r),g=e.memoizedState),(c=Kr||qC(e,t,c,r,f,g,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&f===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&f===n.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=g),o.props=r,o.state=g,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&f===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&f===n.memoizedState||(e.flags|=1024),r=!1)}return eg(n,e,t,r,s,i)}function eg(n,e,t,r,i,s){AS(n,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&NC(e,t,!1),pr(n,e,s);r=e.stateNode,jH.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,n!==null&&o?(e.child=no(e,n.child,null,s),e.child=no(e,null,a,s)):_t(n,e,a,s),e.memoizedState=r.state,i&&NC(e,t,!0),e.child}function OS(n){var e=n.stateNode;e.pendingContext?MC(n,e.pendingContext,e.pendingContext!==e.context):e.context&&MC(n,e.context,!1),Bd(n,e.containerInfo)}function MS(n,e,t,r,i){return Zs(),_d(i),e.flags|=256,_t(n,e,t,r),e.child}var tg={dehydrated:null,treeContext:null,retryLane:0};function ng(n){return{baseLanes:n,cachePool:null,transitions:null}}function _S(n,e,t){var r=e.pendingProps,i=Re.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=n!==null&&n.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(i|=1),Ee(Re,i&1),n===null)return Md(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,n=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=pu(o,r,0,null),n=zi(n,r,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=ng(t),e.memoizedState=tg,n):rg(e,o));if(i=n.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return DH(n,e,o,r,a,i,t);if(s){s=r.fallback,o=e.mode,i=n.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=ri(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=ri(a,s):(s=zi(s,o,t,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=n.child.memoizedState,o=o===null?ng(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=n.childLanes&~t,e.memoizedState=tg,r}return s=n.child,n=s.sibling,r=ri(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=t),r.return=e,r.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=r,e.memoizedState=null,r}function rg(n,e){return e=pu({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function nu(n,e,t,r){return r!==null&&_d(r),no(e,n.child,null,t),n=rg(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function DH(n,e,t,r,i,s,o){if(t)return e.flags&256?(e.flags&=-257,r=Jd(Error(j(422))),nu(n,e,o,r)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=pu({mode:"visible",children:r.children},i,0,null),s=zi(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&no(e,n.child,null,o),e.child.memoizedState=ng(o),e.memoizedState=tg,s);if(!(e.mode&1))return nu(n,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(j(419)),r=Jd(s,r,void 0),nu(n,e,o,r)}if(a=(o&n.childLanes)!==0,Rt||a){if(r=dt,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,dr(n,i),On(r,n,i,-1))}return bg(),r=Jd(Error(j(421))),nu(n,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=n.child,e=JH.bind(null,n),i._reactRetry=e,null):(n=s.treeContext,Wt=Ur(i.nextSibling),Ut=e,Ne=!0,Pn=null,n!==null&&(an[ln++]=hr,an[ln++]=fr,an[ln++]=Ni,hr=n.id,fr=n.overflow,Ni=e),e=rg(e,r.children),e.flags|=4096,e)}function NS(n,e,t){n.lanes|=e;var r=n.alternate;r!==null&&(r.lanes|=e),Id(n.return,e,t)}function ig(n,e,t,r,i){var s=n.memoizedState;s===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:t,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=t,s.tailMode=i)}function kS(n,e,t){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(_t(n,e,r.children,t),r=Re.current,r&2)r=r&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&NS(n,t,e);else if(n.tag===19)NS(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}r&=1}if(Ee(Re,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(t=e.child,i=null;t!==null;)n=t.alternate,n!==null&&Kc(n)===null&&(i=t),t=t.sibling;t=i,t===null?(i=e.child,e.child=null):(i=t.sibling,t.sibling=null),ig(e,!1,i,t,s);break;case"backwards":for(t=null,i=e.child,e.child=null;i!==null;){if(n=i.alternate,n!==null&&Kc(n)===null){e.child=i;break}n=i.sibling,i.sibling=t,t=i,i=n}ig(e,!0,t,null,s);break;case"together":ig(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ru(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function pr(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),Ri|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(j(153));if(e.child!==null){for(n=e.child,t=ri(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=ri(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function BH(n,e,t){switch(e.tag){case 3:OS(e),Zs();break;case 5:YC(e);break;case 1:Lt(e.type)&&Bc(e);break;case 4:Bd(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;Ee(Gc,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Ee(Re,Re.current&1),e.flags|=128,null):t&e.child.childLanes?_S(n,e,t):(Ee(Re,Re.current&1),n=pr(n,e,t),n!==null?n.sibling:null);Ee(Re,Re.current&1);break;case 19:if(r=(t&e.childLanes)!==0,n.flags&128){if(r)return kS(n,e,t);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ee(Re,Re.current),r)break;return null;case 22:case 23:return e.lanes=0,ES(n,e,t)}return pr(n,e,t)}var $S,sg,IS,LS;$S=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}},sg=function(){},IS=function(n,e,t,r){var i=n.memoizedProps;if(i!==r){n=e.stateNode,Ii(qn.current);var s=null;switch(t){case"input":i=If(n,i),r=If(n,r),s=[];break;case"select":i=Le({},i,{value:void 0}),r=Le({},r,{value:void 0}),s=[];break;case"textarea":i=jf(n,i),r=jf(n,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(n.onclick=Rc)}Bf(t,r);var o;t=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(o in a)a.hasOwnProperty(o)&&(t||(t={}),t[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ea.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(t||(t={}),t[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(t||(t={}),t[o]=l[o])}else t||(s||(s=[]),s.push(c,t)),t=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ea.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Oe("scroll",n),s||a===l||(s=[])):(s=s||[]).push(c,l))}t&&(s=s||[]).push("style",t);var c=s;(e.updateQueue=c)&&(e.flags|=4)}},LS=function(n,e,t,r){t!==r&&(e.flags|=4)};function Ra(n,e){if(!Ne)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:r.sibling=null}}function Pt(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,r=0;if(e)for(var i=n.child;i!==null;)t|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=n,i=i.sibling;else for(i=n.child;i!==null;)t|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=n,i=i.sibling;return n.subtreeFlags|=r,n.childLanes=t,e}function zH(n,e,t){var r=e.pendingProps;switch(Td(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(e),null;case 1:return Lt(e.type)&&Dc(),Pt(e),null;case 3:return r=e.stateNode,ro(),Me(It),Me(Ct),Vd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(n===null||n.child===null)&&(qc(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Pn!==null&&(mg(Pn),Pn=null))),sg(n,e),Pt(e),null;case 5:zd(e);var i=Ii(Na.current);if(t=e.type,n!==null&&e.stateNode!=null)IS(n,e,t,r,i),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(j(166));return Pt(e),null}if(n=Ii(qn.current),qc(e)){r=e.stateNode,t=e.type;var s=e.memoizedProps;switch(r[Vn]=e,r[Aa]=s,n=(e.mode&1)!==0,t){case"dialog":Oe("cancel",r),Oe("close",r);break;case"iframe":case"object":case"embed":Oe("load",r);break;case"video":case"audio":for(i=0;i<Sa.length;i++)Oe(Sa[i],r);break;case"source":Oe("error",r);break;case"img":case"image":case"link":Oe("error",r),Oe("load",r);break;case"details":Oe("toggle",r);break;case"input":gx(r,s),Oe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Oe("invalid",r);break;case"textarea":yx(r,s),Oe("invalid",r)}Bf(t,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Lc(r.textContent,a,n),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Lc(r.textContent,a,n),i=["children",""+a]):ea.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Oe("scroll",r)}switch(t){case"input":fc(r),mx(r,s,!0);break;case"textarea":fc(r),bx(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Rc)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=wx(t)),n==="http://www.w3.org/1999/xhtml"?t==="script"?(n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof r.is=="string"?n=o.createElement(t,{is:r.is}):(n=o.createElement(t),t==="select"&&(o=n,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):n=o.createElementNS(n,t),n[Vn]=e,n[Aa]=r,$S(n,e,!1,!1),e.stateNode=n;e:{switch(o=zf(t,r),t){case"dialog":Oe("cancel",n),Oe("close",n),i=r;break;case"iframe":case"object":case"embed":Oe("load",n),i=r;break;case"video":case"audio":for(i=0;i<Sa.length;i++)Oe(Sa[i],n);i=r;break;case"source":Oe("error",n),i=r;break;case"img":case"image":case"link":Oe("error",n),Oe("load",n),i=r;break;case"details":Oe("toggle",n),i=r;break;case"input":gx(n,r),i=If(n,r),Oe("invalid",n);break;case"option":i=r;break;case"select":n._wrapperState={wasMultiple:!!r.multiple},i=Le({},r,{value:void 0}),Oe("invalid",n);break;case"textarea":yx(n,r),i=jf(n,r),Oe("invalid",n);break;default:i=r}Bf(t,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?Sx(n,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&xx(n,l)):s==="children"?typeof l=="string"?(t!=="textarea"||l!=="")&&ia(n,l):typeof l=="number"&&ia(n,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ea.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Oe("scroll",n):l!=null&&Sf(n,s,l,o))}switch(t){case"input":fc(n),mx(n,r,!1);break;case"textarea":fc(n),bx(n);break;case"option":r.value!=null&&n.setAttribute("value",""+Br(r.value));break;case"select":n.multiple=!!r.multiple,s=r.value,s!=null?Ds(n,!!r.multiple,s,!1):r.defaultValue!=null&&Ds(n,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(n.onclick=Rc)}switch(t){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Pt(e),null;case 6:if(n&&e.stateNode!=null)LS(n,e,n.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(j(166));if(t=Ii(Na.current),Ii(qn.current),qc(e)){if(r=e.stateNode,t=e.memoizedProps,r[Vn]=e,(s=r.nodeValue!==t)&&(n=Ut,n!==null))switch(n.tag){case 3:Lc(r.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&Lc(r.nodeValue,t,(n.mode&1)!==0)}s&&(e.flags|=4)}else r=(t.nodeType===9?t:t.ownerDocument).createTextNode(r),r[Vn]=e,e.stateNode=r}return Pt(e),null;case 13:if(Me(Re),r=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(Ne&&Wt!==null&&e.mode&1&&!(e.flags&128))jC(),Zs(),e.flags|=98560,s=!1;else if(s=qc(e),r!==null&&r.dehydrated!==null){if(n===null){if(!s)throw Error(j(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(j(317));s[Vn]=e}else Zs(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Pt(e),s=!1}else Pn!==null&&(mg(Pn),Pn=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=t,e):(r=r!==null,r!==(n!==null&&n.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(n===null||Re.current&1?at===0&&(at=3):bg())),e.updateQueue!==null&&(e.flags|=4),Pt(e),null);case 4:return ro(),sg(n,e),n===null&&Pa(e.stateNode.containerInfo),Pt(e),null;case 10:return $d(e.type._context),Pt(e),null;case 17:return Lt(e.type)&&Dc(),Pt(e),null;case 19:if(Me(Re),s=e.memoizedState,s===null)return Pt(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)Ra(s,!1);else{if(at!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(o=Kc(n),o!==null){for(e.flags|=128,Ra(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=t,t=e.child;t!==null;)s=t,n=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=n,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,n=o.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t=t.sibling;return Ee(Re,Re.current&1|2),e.child}n=n.sibling}s.tail!==null&&Xe()>ao&&(e.flags|=128,r=!0,Ra(s,!1),e.lanes=4194304)}else{if(!r)if(n=Kc(o),n!==null){if(e.flags|=128,r=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Ra(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ne)return Pt(e),null}else 2*Xe()-s.renderingStartTime>ao&&t!==1073741824&&(e.flags|=128,r=!0,Ra(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Xe(),e.sibling=null,t=Re.current,Ee(Re,r?t&1|2:t&1),e):(Pt(e),null);case 22:case 23:return vg(),r=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Xt&1073741824&&(Pt(e),e.subtreeFlags&6&&(e.flags|=8192)):Pt(e),null;case 24:return null;case 25:return null}throw Error(j(156,e.tag))}function FH(n,e){switch(Td(e),e.tag){case 1:return Lt(e.type)&&Dc(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return ro(),Me(It),Me(Ct),Vd(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return zd(e),null;case 13:if(Me(Re),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(j(340));Zs()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Me(Re),null;case 4:return ro(),null;case 10:return $d(e.type._context),null;case 22:case 23:return vg(),null;case 24:return null;default:return null}}var iu=!1,Et=!1,VH=typeof WeakSet=="function"?WeakSet:Set,q=null;function so(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){qe(n,e,r)}else t.current=null}function og(n,e,t){try{t()}catch(r){qe(n,e,r)}}var RS=!1;function qH(n,e){if(vd=Pc,n=dC(),ud(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{t.nodeType,s.nodeType}catch(w){t=null;break e}var o=0,a=-1,l=-1,c=0,u=0,h=n,f=null;t:for(;;){for(var d;h!==t||i!==0&&h.nodeType!==3||(a=o+i),h!==s||r!==0&&h.nodeType!==3||(l=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(d=h.firstChild)!==null;)f=h,h=d;for(;;){if(h===n)break t;if(f===t&&++c===i&&(a=o),f===s&&++u===r&&(l=o),(d=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=d}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(bd={focusedElem:n,selectionRange:t},Pc=!1,q=e;q!==null;)if(e=q,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,q=n;else for(;q!==null;){e=q;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,b=g.memoizedState,m=e.stateNode,y=m.getSnapshotBeforeUpdate(e.elementType===e.type?p:En(e.type,p),b);m.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var v=e.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(j(163))}}catch(w){qe(e,e.return,w)}if(n=e.sibling,n!==null){n.return=e.return,q=n;break}q=e.return}return g=RS,RS=!1,g}function ja(n,e,t){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&n)===n){var s=i.destroy;i.destroy=void 0,s!==void 0&&og(e,t,s)}i=i.next}while(i!==r)}}function su(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var r=t.create;t.destroy=r()}t=t.next}while(t!==e)}}function ag(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function jS(n){var e=n.alternate;e!==null&&(n.alternate=null,jS(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Vn],delete e[Aa],delete e[Sd],delete e[EH],delete e[AH])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function DS(n){return n.tag===5||n.tag===3||n.tag===4}function BS(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||DS(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function lg(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Rc));else if(r!==4&&(n=n.child,n!==null))for(lg(n,e,t),n=n.sibling;n!==null;)lg(n,e,t),n=n.sibling}function cg(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(r!==4&&(n=n.child,n!==null))for(cg(n,e,t),n=n.sibling;n!==null;)cg(n,e,t),n=n.sibling}var yt=null,An=!1;function Qr(n,e,t){for(t=t.child;t!==null;)zS(n,e,t),t=t.sibling}function zS(n,e,t){if(Fn&&typeof Fn.onCommitFiberUnmount=="function")try{Fn.onCommitFiberUnmount(vc,t)}catch(a){}switch(t.tag){case 5:Et||so(t,e);case 6:var r=yt,i=An;yt=null,Qr(n,e,t),yt=r,An=i,yt!==null&&(An?(n=yt,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):yt.removeChild(t.stateNode));break;case 18:yt!==null&&(An?(n=yt,t=t.stateNode,n.nodeType===8?Cd(n.parentNode,t):n.nodeType===1&&Cd(n,t),pa(n)):Cd(yt,t.stateNode));break;case 4:r=yt,i=An,yt=t.stateNode.containerInfo,An=!0,Qr(n,e,t),yt=r,An=i;break;case 0:case 11:case 14:case 15:if(!Et&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&og(t,e,o),i=i.next}while(i!==r)}Qr(n,e,t);break;case 1:if(!Et&&(so(t,e),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(a){qe(t,e,a)}Qr(n,e,t);break;case 21:Qr(n,e,t);break;case 22:t.mode&1?(Et=(r=Et)||t.memoizedState!==null,Qr(n,e,t),Et=r):Qr(n,e,t);break;default:Qr(n,e,t)}}function FS(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new VH),e.forEach(function(r){var i=QH.bind(null,n,r);t.has(r)||(t.add(r),r.then(i,i))})}}function Tn(n,e){var t=e.deletions;if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];try{var s=n,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:yt=a.stateNode,An=!1;break e;case 3:yt=a.stateNode.containerInfo,An=!0;break e;case 4:yt=a.stateNode.containerInfo,An=!0;break e}a=a.return}if(yt===null)throw Error(j(160));zS(s,o,i),yt=null,An=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){qe(i,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)VS(e,n),e=e.sibling}function VS(n,e){var t=n.alternate,r=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(Tn(e,n),Hn(n),r&4){try{ja(3,n,n.return),su(3,n)}catch(p){qe(n,n.return,p)}try{ja(5,n,n.return)}catch(p){qe(n,n.return,p)}}break;case 1:Tn(e,n),Hn(n),r&512&&t!==null&&so(t,t.return);break;case 5:if(Tn(e,n),Hn(n),r&512&&t!==null&&so(t,t.return),n.flags&32){var i=n.stateNode;try{ia(i,"")}catch(p){qe(n,n.return,p)}}if(r&4&&(i=n.stateNode,i!=null)){var s=n.memoizedProps,o=t!==null?t.memoizedProps:s,a=n.type,l=n.updateQueue;if(n.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&px(i,s),zf(a,o);var c=zf(a,s);for(o=0;o<l.length;o+=2){var u=l[o],h=l[o+1];u==="style"?Sx(i,h):u==="dangerouslySetInnerHTML"?xx(i,h):u==="children"?ia(i,h):Sf(i,u,h,c)}switch(a){case"input":Lf(i,s);break;case"textarea":vx(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var d=s.value;d!=null?Ds(i,!!s.multiple,d,!1):f!==!!s.multiple&&(s.defaultValue!=null?Ds(i,!!s.multiple,s.defaultValue,!0):Ds(i,!!s.multiple,s.multiple?[]:"",!1))}i[Aa]=s}catch(p){qe(n,n.return,p)}}break;case 6:if(Tn(e,n),Hn(n),r&4){if(n.stateNode===null)throw Error(j(162));i=n.stateNode,s=n.memoizedProps;try{i.nodeValue=s}catch(p){qe(n,n.return,p)}}break;case 3:if(Tn(e,n),Hn(n),r&4&&t!==null&&t.memoizedState.isDehydrated)try{pa(e.containerInfo)}catch(p){qe(n,n.return,p)}break;case 4:Tn(e,n),Hn(n);break;case 13:Tn(e,n),Hn(n),i=n.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(fg=Xe())),r&4&&FS(n);break;case 22:if(u=t!==null&&t.memoizedState!==null,n.mode&1?(Et=(c=Et)||u,Tn(e,n),Et=c):Tn(e,n),Hn(n),r&8192){if(c=n.memoizedState!==null,(n.stateNode.isHidden=c)&&!u&&n.mode&1)for(q=n,u=n.child;u!==null;){for(h=q=u;q!==null;){switch(f=q,d=f.child,f.tag){case 0:case 11:case 14:case 15:ja(4,f,f.return);break;case 1:so(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,t=f.return;try{e=r,g.props=e.memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(p){qe(r,t,p)}}break;case 5:so(f,f.return);break;case 22:if(f.memoizedState!==null){HS(h);continue}}d!==null?(d.return=f,q=d):HS(h)}u=u.sibling}e:for(u=null,h=n;;){if(h.tag===5){if(u===null){u=h;try{i=h.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=h.stateNode,l=h.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Cx("display",o))}catch(p){qe(n,n.return,p)}}}else if(h.tag===6){if(u===null)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(p){qe(n,n.return,p)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===n)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===n)break e;for(;h.sibling===null;){if(h.return===null||h.return===n)break e;u===h&&(u=null),h=h.return}u===h&&(u=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Tn(e,n),Hn(n),r&4&&FS(n);break;case 21:break;default:Tn(e,n),Hn(n)}}function Hn(n){var e=n.flags;if(e&2){try{e:{for(var t=n.return;t!==null;){if(DS(t)){var r=t;break e}t=t.return}throw Error(j(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ia(i,""),r.flags&=-33);var s=BS(n);cg(n,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=BS(n);lg(n,a,o);break;default:throw Error(j(161))}}catch(l){qe(n,n.return,l)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function GH(n,e,t){q=n,qS(n)}function qS(n,e,t){for(var r=(n.mode&1)!==0;q!==null;){var i=q,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||iu;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Et;a=iu;var c=Et;if(iu=o,(Et=l)&&!c)for(q=i;q!==null;)o=q,l=o.child,o.tag===22&&o.memoizedState!==null?US(i):l!==null?(l.return=o,q=l):US(i);for(;s!==null;)q=s,qS(s),s=s.sibling;q=i,iu=a,Et=c}GS(n)}else i.subtreeFlags&8772&&s!==null?(s.return=i,q=s):GS(n)}}function GS(n){for(;q!==null;){var e=q;if(e.flags&8772){var t=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Et||su(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Et)if(t===null)r.componentDidMount();else{var i=e.elementType===e.type?t.memoizedProps:En(e.type,t.memoizedProps);r.componentDidUpdate(i,t.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&FC(e,s,r);break;case 3:var o=e.updateQueue;if(o!==null){if(t=null,e.child!==null)switch(e.child.tag){case 5:t=e.child.stateNode;break;case 1:t=e.child.stateNode}FC(e,o,t)}break;case 5:var a=e.stateNode;if(t===null&&e.flags&4){t=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&t.focus();break;case"img":l.src&&(t.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var h=u.dehydrated;h!==null&&pa(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(j(163))}Et||e.flags&512&&ag(e)}catch(f){qe(e,e.return,f)}}if(e===n){q=null;break}if(t=e.sibling,t!==null){t.return=e.return,q=t;break}q=e.return}}function HS(n){for(;q!==null;){var e=q;if(e===n){q=null;break}var t=e.sibling;if(t!==null){t.return=e.return,q=t;break}q=e.return}}function US(n){for(;q!==null;){var e=q;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{su(4,e)}catch(l){qe(e,t,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){qe(e,i,l)}}var s=e.return;try{ag(e)}catch(l){qe(e,s,l)}break;case 5:var o=e.return;try{ag(e)}catch(l){qe(e,o,l)}}}catch(l){qe(e,e.return,l)}if(e===n){q=null;break}var a=e.sibling;if(a!==null){a.return=e.return,q=a;break}q=e.return}}var HH=Math.ceil,ou=lr.ReactCurrentDispatcher,ug=lr.ReactCurrentOwner,hn=lr.ReactCurrentBatchConfig,ue=0,dt=null,tt=null,vt=0,Xt=0,oo=Wr(0),at=0,Da=null,Ri=0,au=0,hg=0,Ba=null,jt=null,fg=0,ao=1/0,mr=null,lu=!1,dg=null,Zr=null,cu=!1,ei=null,uu=0,za=0,gg=null,hu=-1,fu=0;function Nt(){return ue&6?Xe():hu!==-1?hu:hu=Xe()}function ti(n){return n.mode&1?ue&2&&vt!==0?vt&-vt:OH.transition!==null?(fu===0&&(fu=Dx()),fu):(n=me,n!==0||(n=window.event,n=n===void 0?16:Wx(n.type)),n):1}function On(n,e,t,r){if(50<za)throw za=0,gg=null,Error(j(185));ua(n,t,r),(!(ue&2)||n!==dt)&&(n===dt&&(!(ue&2)&&(au|=t),at===4&&ni(n,vt)),Dt(n,r),t===1&&ue===0&&!(e.mode&1)&&(ao=Xe()+500,zc&&Yr()))}function Dt(n,e){var t=n.callbackNode;O8(n,e);var r=xc(n,n===dt?vt:0);if(r===0)t!==null&&Lx(t),n.callbackNode=null,n.callbackPriority=0;else if(e=r&-r,n.callbackPriority!==e){if(t!=null&&Lx(t),e===1)n.tag===0?TH(XS.bind(null,n)):kC(XS.bind(null,n)),SH(function(){!(ue&6)&&Yr()}),t=null;else{switch(Bx(r)){case 1:t=Wf;break;case 4:t=Rx;break;case 16:t=yc;break;case 536870912:t=jx;break;default:t=yc}t=nP(t,WS.bind(null,n))}n.callbackPriority=e,n.callbackNode=t}}function WS(n,e){if(hu=-1,fu=0,ue&6)throw Error(j(327));var t=n.callbackNode;if(lo()&&n.callbackNode!==t)return null;var r=xc(n,n===dt?vt:0);if(r===0)return null;if(r&30||r&n.expiredLanes||e)e=du(n,r);else{e=r;var i=ue;ue|=2;var s=KS();(dt!==n||vt!==e)&&(mr=null,ao=Xe()+500,Di(n,e));do try{XH();break}catch(a){YS(n,a)}while(1);kd(),ou.current=s,ue=i,tt!==null?e=0:(dt=null,vt=0,e=at)}if(e!==0){if(e===2&&(i=Xf(n),i!==0&&(r=i,e=pg(n,i))),e===1)throw t=Da,Di(n,0),ni(n,r),Dt(n,Xe()),t;if(e===6)ni(n,r);else{if(i=n.current.alternate,!(r&30)&&!UH(i)&&(e=du(n,r),e===2&&(s=Xf(n),s!==0&&(r=s,e=pg(n,s))),e===1))throw t=Da,Di(n,0),ni(n,r),Dt(n,Xe()),t;switch(n.finishedWork=i,n.finishedLanes=r,e){case 0:case 1:throw Error(j(345));case 2:Bi(n,jt,mr);break;case 3:if(ni(n,r),(r&130023424)===r&&(e=fg+500-Xe(),10<e)){if(xc(n,0)!==0)break;if(i=n.suspendedLanes,(i&r)!==r){Nt(),n.pingedLanes|=n.suspendedLanes&i;break}n.timeoutHandle=xd(Bi.bind(null,n,jt,mr),e);break}Bi(n,jt,mr);break;case 4:if(ni(n,r),(r&4194240)===r)break;for(e=n.eventTimes,i=-1;0<r;){var o=31-Cn(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=Xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*HH(r/1960))-r,10<r){n.timeoutHandle=xd(Bi.bind(null,n,jt,mr),r);break}Bi(n,jt,mr);break;case 5:Bi(n,jt,mr);break;default:throw Error(j(329))}}}return Dt(n,Xe()),n.callbackNode===t?WS.bind(null,n):null}function pg(n,e){var t=Ba;return n.current.memoizedState.isDehydrated&&(Di(n,e).flags|=256),n=du(n,e),n!==2&&(e=jt,jt=t,e!==null&&mg(e)),n}function mg(n){jt===null?jt=n:jt.push.apply(jt,n)}function UH(n){for(var e=n;;){if(e.flags&16384){var t=e.updateQueue;if(t!==null&&(t=t.stores,t!==null))for(var r=0;r<t.length;r++){var i=t[r],s=i.getSnapshot;i=i.value;try{if(!Sn(s(),i))return!1}catch(o){return!1}}}if(t=e.child,e.subtreeFlags&16384&&t!==null)t.return=e,e=t;else{if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ni(n,e){for(e&=~hg,e&=~au,n.suspendedLanes|=e,n.pingedLanes&=~e,n=n.expirationTimes;0<e;){var t=31-Cn(e),r=1<<t;n[t]=-1,e&=~r}}function XS(n){if(ue&6)throw Error(j(327));lo();var e=xc(n,0);if(!(e&1))return Dt(n,Xe()),null;var t=du(n,e);if(n.tag!==0&&t===2){var r=Xf(n);r!==0&&(e=r,t=pg(n,r))}if(t===1)throw t=Da,Di(n,0),ni(n,e),Dt(n,Xe()),t;if(t===6)throw Error(j(345));return n.finishedWork=n.current.alternate,n.finishedLanes=e,Bi(n,jt,mr),Dt(n,Xe()),null}function yg(n,e){var t=ue;ue|=1;try{return n(e)}finally{ue=t,ue===0&&(ao=Xe()+500,zc&&Yr())}}function ji(n){ei!==null&&ei.tag===0&&!(ue&6)&&lo();var e=ue;ue|=1;var t=hn.transition,r=me;try{if(hn.transition=null,me=1,n)return n()}finally{me=r,hn.transition=t,ue=e,!(ue&6)&&Yr()}}function vg(){Xt=oo.current,Me(oo)}function Di(n,e){n.finishedWork=null,n.finishedLanes=0;var t=n.timeoutHandle;if(t!==-1&&(n.timeoutHandle=-1,CH(t)),tt!==null)for(t=tt.return;t!==null;){var r=t;switch(Td(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Dc();break;case 3:ro(),Me(It),Me(Ct),Vd();break;case 5:zd(r);break;case 4:ro();break;case 13:Me(Re);break;case 19:Me(Re);break;case 10:$d(r.type._context);break;case 22:case 23:vg()}t=t.return}if(dt=n,tt=n=ri(n.current,null),vt=Xt=e,at=0,Da=null,hg=au=Ri=0,jt=Ba=null,$i!==null){for(e=0;e<$i.length;e++)if(t=$i[e],r=t.interleaved,r!==null){t.interleaved=null;var i=r.next,s=t.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}t.pending=r}$i=null}return n}function YS(n,e){do{var t=tt;try{if(kd(),Jc.current=tu,Qc){for(var r=je.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Qc=!1}if(Li=0,ft=ot=je=null,ka=!1,$a=0,ug.current=null,t===null||t.return===null){at=1,Da=e,tt=null;break}e:{var s=n,o=t.return,a=t,l=e;if(e=vt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,h=u.tag;if(!(u.mode&1)&&(h===0||h===11||h===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var d=wS(o);if(d!==null){d.flags&=-257,xS(d,o,a,s,e),d.mode&1&&bS(s,c,e),e=d,l=c;var g=e.updateQueue;if(g===null){var p=new Set;p.add(l),e.updateQueue=p}else g.add(l);break e}else{if(!(e&1)){bS(s,c,e),bg();break e}l=Error(j(426))}}else if(Ne&&a.mode&1){var b=wS(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),xS(b,o,a,s,e),_d(io(l,a));break e}}s=l=io(l,a),at!==4&&(at=2),Ba===null?Ba=[s]:Ba.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var m=yS(s,l,e);zC(s,m);break e;case 1:a=l;var y=s.type,v=s.stateNode;if(!(s.flags&128)&&(typeof y.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Zr===null||!Zr.has(v)))){s.flags|=65536,e&=-e,s.lanes|=e;var w=vS(s,a,e);zC(s,w);break e}}s=s.return}while(s!==null)}QS(t)}catch(x){e=x,tt===t&&t!==null&&(tt=t=t.return);continue}break}while(1)}function KS(){var n=ou.current;return ou.current=tu,n===null?tu:n}function bg(){(at===0||at===3||at===2)&&(at=4),dt===null||!(Ri&268435455)&&!(au&268435455)||ni(dt,vt)}function du(n,e){var t=ue;ue|=2;var r=KS();(dt!==n||vt!==e)&&(mr=null,Di(n,e));do try{WH();break}catch(i){YS(n,i)}while(1);if(kd(),ue=t,ou.current=r,tt!==null)throw Error(j(261));return dt=null,vt=0,at}function WH(){for(;tt!==null;)JS(tt)}function XH(){for(;tt!==null&&!b8();)JS(tt)}function JS(n){var e=tP(n.alternate,n,Xt);n.memoizedProps=n.pendingProps,e===null?QS(n):tt=e,ug.current=null}function QS(n){var e=n;do{var t=e.alternate;if(n=e.return,e.flags&32768){if(t=FH(t,e),t!==null){t.flags&=32767,tt=t;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{at=6,tt=null;return}}else if(t=zH(t,e,Xt),t!==null){tt=t;return}if(e=e.sibling,e!==null){tt=e;return}tt=e=n}while(e!==null);at===0&&(at=5)}function Bi(n,e,t){var r=me,i=hn.transition;try{hn.transition=null,me=1,YH(n,e,t,r)}finally{hn.transition=i,me=r}return null}function YH(n,e,t,r){do lo();while(ei!==null);if(ue&6)throw Error(j(327));t=n.finishedWork;var i=n.finishedLanes;if(t===null)return null;if(n.finishedWork=null,n.finishedLanes=0,t===n.current)throw Error(j(177));n.callbackNode=null,n.callbackPriority=0;var s=t.lanes|t.childLanes;if(M8(n,s),n===dt&&(tt=dt=null,vt=0),!(t.subtreeFlags&2064)&&!(t.flags&2064)||cu||(cu=!0,nP(yc,function(){return lo(),null})),s=(t.flags&15990)!==0,t.subtreeFlags&15990||s){s=hn.transition,hn.transition=null;var o=me;me=1;var a=ue;ue|=4,ug.current=null,qH(n,t),VS(t,n),pH(bd),Pc=!!vd,bd=vd=null,n.current=t,GH(t),w8(),ue=a,me=o,hn.transition=s}else n.current=t;if(cu&&(cu=!1,ei=n,uu=i),s=n.pendingLanes,s===0&&(Zr=null),S8(t.stateNode),Dt(n,Xe()),e!==null)for(r=n.onRecoverableError,t=0;t<e.length;t++)i=e[t],r(i.value,{componentStack:i.stack,digest:i.digest});if(lu)throw lu=!1,n=dg,dg=null,n;return uu&1&&n.tag!==0&&lo(),s=n.pendingLanes,s&1?n===gg?za++:(za=0,gg=n):za=0,Yr(),null}function lo(){if(ei!==null){var n=Bx(uu),e=hn.transition,t=me;try{if(hn.transition=null,me=16>n?16:n,ei===null)var r=!1;else{if(n=ei,ei=null,uu=0,ue&6)throw Error(j(331));var i=ue;for(ue|=4,q=n.current;q!==null;){var s=q,o=s.child;if(q.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(q=c;q!==null;){var u=q;switch(u.tag){case 0:case 11:case 15:ja(8,u,s)}var h=u.child;if(h!==null)h.return=u,q=h;else for(;q!==null;){u=q;var f=u.sibling,d=u.return;if(jS(u),u===c){q=null;break}if(f!==null){f.return=d,q=f;break}q=d}}}var g=s.alternate;if(g!==null){var p=g.child;if(p!==null){g.child=null;do{var b=p.sibling;p.sibling=null,p=b}while(p!==null)}}q=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,q=o;else e:for(;q!==null;){if(s=q,s.flags&2048)switch(s.tag){case 0:case 11:case 15:ja(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,q=m;break e}q=s.return}}var y=n.current;for(q=y;q!==null;){o=q;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,q=v;else e:for(o=y;q!==null;){if(a=q,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:su(9,a)}}catch(x){qe(a,a.return,x)}if(a===o){q=null;break e}var w=a.sibling;if(w!==null){w.return=a.return,q=w;break e}q=a.return}}if(ue=i,Yr(),Fn&&typeof Fn.onPostCommitFiberRoot=="function")try{Fn.onPostCommitFiberRoot(vc,n)}catch(x){}r=!0}return r}finally{me=t,hn.transition=e}}return!1}function ZS(n,e,t){e=io(t,e),e=yS(n,e,1),n=Jr(n,e,1),e=Nt(),n!==null&&(ua(n,1,e),Dt(n,e))}function qe(n,e,t){if(n.tag===3)ZS(n,n,t);else for(;e!==null;){if(e.tag===3){ZS(e,n,t);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Zr===null||!Zr.has(r))){n=io(t,n),n=vS(e,n,1),e=Jr(e,n,1),n=Nt(),e!==null&&(ua(e,1,n),Dt(e,n));break}}e=e.return}}function KH(n,e,t){var r=n.pingCache;r!==null&&r.delete(e),e=Nt(),n.pingedLanes|=n.suspendedLanes&t,dt===n&&(vt&t)===t&&(at===4||at===3&&(vt&130023424)===vt&&500>Xe()-fg?Di(n,0):hg|=t),Dt(n,e)}function eP(n,e){e===0&&(n.mode&1?(e=wc,wc<<=1,!(wc&130023424)&&(wc=4194304)):e=1);var t=Nt();n=dr(n,e),n!==null&&(ua(n,e,t),Dt(n,t))}function JH(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),eP(n,t)}function QH(n,e){var t=0;switch(n.tag){case 13:var r=n.stateNode,i=n.memoizedState;i!==null&&(t=i.retryLane);break;case 19:r=n.stateNode;break;default:throw Error(j(314))}r!==null&&r.delete(e),eP(n,t)}var tP;tP=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||It.current)Rt=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Rt=!1,BH(n,e,t);Rt=!!(n.flags&131072)}else Rt=!1,Ne&&e.flags&1048576&&$C(e,Vc,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;ru(n,e),n=e.pendingProps;var i=Ks(e,Ct.current);to(e,t),i=Hd(null,e,r,n,i,t);var s=Ud();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Lt(r)?(s=!0,Bc(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Rd(e),i.updater=Xc,e.stateNode=i,i._reactInternals=e,Dd(e,r,n,t),e=eg(null,e,r,!0,s,t)):(e.tag=0,Ne&&s&&Ad(e),_t(null,e,i,t),e=e.child),e;case 16:r=e.elementType;e:{switch(ru(n,e),n=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=eU(r),n=En(r,n),i){case 0:e=Zd(null,e,r,n,t);break e;case 1:e=TS(null,e,r,n,t);break e;case 11:e=CS(null,e,r,n,t);break e;case 14:e=SS(null,e,r,En(r.type,n),t);break e}throw Error(j(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:En(r,i),Zd(n,e,r,i,t);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:En(r,i),TS(n,e,r,i,t);case 3:e:{if(OS(e),n===null)throw Error(j(387));r=e.pendingProps,s=e.memoizedState,i=s.element,BC(n,e),Wc(e,r,null,t);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=io(Error(j(423)),e),e=MS(n,e,r,t,i);break e}else if(r!==i){i=io(Error(j(424)),e),e=MS(n,e,r,t,i);break e}else for(Wt=Ur(e.stateNode.containerInfo.firstChild),Ut=e,Ne=!0,Pn=null,t=XC(e,null,r,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Zs(),r===i){e=pr(n,e,t);break e}_t(n,e,r,t)}e=e.child}return e;case 5:return YC(e),n===null&&Md(e),r=e.type,i=e.pendingProps,s=n!==null?n.memoizedProps:null,o=i.children,wd(r,i)?o=null:s!==null&&wd(r,s)&&(e.flags|=32),AS(n,e),_t(n,e,o,t),e.child;case 6:return n===null&&Md(e),null;case 13:return _S(n,e,t);case 4:return Bd(e,e.stateNode.containerInfo),r=e.pendingProps,n===null?e.child=no(e,null,r,t):_t(n,e,r,t),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:En(r,i),CS(n,e,r,i,t);case 7:return _t(n,e,e.pendingProps,t),e.child;case 8:return _t(n,e,e.pendingProps.children,t),e.child;case 12:return _t(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,Ee(Gc,r._currentValue),r._currentValue=o,s!==null)if(Sn(s.value,o)){if(s.children===i.children&&!It.current){e=pr(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=gr(-1,t&-t),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),Id(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(j(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),Id(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}_t(n,e,i.children,t),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,to(e,t),i=cn(i),r=r(i),e.flags|=1,_t(n,e,r,t),e.child;case 14:return r=e.type,i=En(r,e.pendingProps),i=En(r.type,i),SS(n,e,r,i,t);case 15:return PS(n,e,e.type,e.pendingProps,t);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:En(r,i),ru(n,e),e.tag=1,Lt(r)?(n=!0,Bc(e)):n=!1,to(e,t),GC(e,r,i),Dd(e,r,i,t),eg(null,e,r,!0,n,t);case 19:return kS(n,e,t);case 22:return ES(n,e,t)}throw Error(j(156,e.tag))};function nP(n,e){return Ix(n,e)}function ZH(n,e,t,r){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(n,e,t,r){return new ZH(n,e,t,r)}function wg(n){return n=n.prototype,!(!n||!n.isReactComponent)}function eU(n){if(typeof n=="function")return wg(n)?1:0;if(n!=null){if(n=n.$$typeof,n===Af)return 11;if(n===Mf)return 14}return 2}function ri(n,e){var t=n.alternate;return t===null?(t=fn(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function gu(n,e,t,r,i,s){var o=2;if(r=n,typeof n=="function")wg(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case js:return zi(t.children,i,s,e);case Pf:o=8,i|=8;break;case Ef:return n=fn(12,t,e,i|2),n.elementType=Ef,n.lanes=s,n;case Tf:return n=fn(13,t,e,i),n.elementType=Tf,n.lanes=s,n;case Of:return n=fn(19,t,e,i),n.elementType=Of,n.lanes=s,n;case ux:return pu(t,i,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case lx:o=10;break e;case cx:o=9;break e;case Af:o=11;break e;case Mf:o=14;break e;case Dr:o=16,r=null;break e}throw Error(j(130,n==null?n:typeof n,""))}return e=fn(o,t,e,i),e.elementType=n,e.type=r,e.lanes=s,e}function zi(n,e,t,r){return n=fn(7,n,r,e),n.lanes=t,n}function pu(n,e,t,r){return n=fn(22,n,r,e),n.elementType=ux,n.lanes=t,n.stateNode={isHidden:!1},n}function xg(n,e,t){return n=fn(6,n,null,e),n.lanes=t,n}function Cg(n,e,t){return e=fn(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function tU(n,e,t,r,i){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yf(0),this.expirationTimes=Yf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yf(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Sg(n,e,t,r,i,s,o,a,l){return n=new tU(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=fn(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},Rd(s),n}function nU(n,e,t){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Rs,key:r==null?null:""+r,children:n,containerInfo:e,implementation:t}}function rP(n){if(!n)return Xr;n=n._reactInternals;e:{if(Oi(n)!==n||n.tag!==1)throw Error(j(170));var e=n;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Lt(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(j(171))}if(n.tag===1){var t=n.type;if(Lt(t))return _C(n,t,e)}return e}function iP(n,e,t,r,i,s,o,a,l){return n=Sg(t,r,!0,n,i,s,o,a,l),n.context=rP(null),t=n.current,r=Nt(),i=ti(t),s=gr(r,i),s.callback=e!=null?e:null,Jr(t,s,i),n.current.lanes=i,ua(n,i,r),Dt(n,r),n}function mu(n,e,t,r){var i=e.current,s=Nt(),o=ti(i);return t=rP(t),e.context===null?e.context=t:e.pendingContext=t,e=gr(s,o),e.payload={element:n},r=r===void 0?null:r,r!==null&&(e.callback=r),n=Jr(i,e,o),n!==null&&(On(n,i,o,s),Uc(n,i,o)),o}function yu(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function sP(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}function Pg(n,e){sP(n,e),(n=n.alternate)&&sP(n,e)}function rU(){return null}var oP=typeof reportError=="function"?reportError:function(n){console.error(n)};function Eg(n){this._internalRoot=n}vu.prototype.render=Eg.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(j(409));mu(n,e,null,null)},vu.prototype.unmount=Eg.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;ji(function(){mu(null,n,null,null)}),e[cr]=null}};function vu(n){this._internalRoot=n}vu.prototype.unstable_scheduleHydration=function(n){if(n){var e=Vx();n={blockedOn:null,target:n,priority:e};for(var t=0;t<qr.length&&e!==0&&e<qr[t].priority;t++);qr.splice(t,0,n),t===0&&Hx(n)}};function Ag(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function bu(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function aP(){}function iU(n,e,t,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=yu(o);s.call(c)}}var o=iP(e,r,n,0,null,!1,!1,"",aP);return n._reactRootContainer=o,n[cr]=o.current,Pa(n.nodeType===8?n.parentNode:n),ji(),o}for(;i=n.lastChild;)n.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=yu(l);a.call(c)}}var l=Sg(n,0,!1,null,null,!1,!1,"",aP);return n._reactRootContainer=l,n[cr]=l.current,Pa(n.nodeType===8?n.parentNode:n),ji(function(){mu(e,l,t,r)}),l}function wu(n,e,t,r,i){var s=t._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=yu(o);a.call(l)}}mu(e,o,n,i)}else o=iU(t,e,n,i,r);return yu(o)}zx=function(n){switch(n.tag){case 3:var e=n.stateNode;if(e.current.memoizedState.isDehydrated){var t=ca(e.pendingLanes);t!==0&&(Kf(e,t|1),Dt(e,Xe()),!(ue&6)&&(ao=Xe()+500,Yr()))}break;case 13:ji(function(){var r=dr(n,1);if(r!==null){var i=Nt();On(r,n,1,i)}}),Pg(n,1)}},Jf=function(n){if(n.tag===13){var e=dr(n,134217728);if(e!==null){var t=Nt();On(e,n,134217728,t)}Pg(n,134217728)}},Fx=function(n){if(n.tag===13){var e=ti(n),t=dr(n,e);if(t!==null){var r=Nt();On(t,n,e,r)}Pg(n,e)}},Vx=function(){return me},qx=function(n,e){var t=me;try{return me=n,e()}finally{me=t}},qf=function(n,e,t){switch(e){case"input":if(Lf(n,t),e=t.name,t.type==="radio"&&e!=null){for(t=n;t.parentNode;)t=t.parentNode;for(t=t.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<t.length;e++){var r=t[e];if(r!==n&&r.form===n.form){var i=jc(r);if(!i)throw Error(j(90));dx(r),Lf(r,i)}}}break;case"textarea":vx(n,t);break;case"select":e=t.value,e!=null&&Ds(n,!!t.multiple,e,!1)}},Tx=yg,Ox=ji;var sU={usingClientEntryPoint:!1,Events:[Ta,Xs,jc,Ex,Ax,yg]},Fa={findFiberByHostInstance:Mi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},oU={bundleType:Fa.bundleType,version:Fa.version,rendererPackageName:Fa.rendererPackageName,rendererConfig:Fa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:lr.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=kx(n),n===null?null:n.stateNode},findFiberByHostInstance:Fa.findFiberByHostInstance||rU,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"){var xu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xu.isDisabled&&xu.supportsFiber)try{vc=xu.inject(oU),Fn=xu}catch(n){}}qt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sU,qt.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ag(e))throw Error(j(200));return nU(n,e,null,t)},qt.createRoot=function(n,e){if(!Ag(n))throw Error(j(299));var t=!1,r="",i=oP;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Sg(n,1,!1,null,null,t,!1,r,i),n[cr]=e.current,Pa(n.nodeType===8?n.parentNode:n),new Eg(e)},qt.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var e=n._reactInternals;if(e===void 0)throw typeof n.render=="function"?Error(j(188)):(n=Object.keys(n).join(","),Error(j(268,n)));return n=kx(e),n=n===null?null:n.stateNode,n},qt.flushSync=function(n){return ji(n)},qt.hydrate=function(n,e,t){if(!bu(e))throw Error(j(200));return wu(null,n,e,!0,t)},qt.hydrateRoot=function(n,e,t){if(!Ag(n))throw Error(j(405));var r=t!=null&&t.hydratedSources||null,i=!1,s="",o=oP;if(t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),e=iP(e,null,n,1,t!=null?t:null,i,!1,s,o),n[cr]=e.current,Pa(n),r)for(n=0;n<r.length;n++)t=r[n],i=t._getVersion,i=i(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,i]:e.mutableSourceEagerHydrationData.push(t,i);return new vu(e)},qt.render=function(n,e,t){if(!bu(e))throw Error(j(200));return wu(null,n,e,!1,t)},qt.unmountComponentAtNode=function(n){if(!bu(n))throw Error(j(40));return n._reactRootContainer?(ji(function(){wu(null,null,n,!1,function(){n._reactRootContainer=null,n[cr]=null})}),!0):!1},qt.unstable_batchedUpdates=yg,qt.unstable_renderSubtreeIntoContainer=function(n,e,t,r){if(!bu(t))throw Error(j(200));if(n==null||n._reactInternals===void 0)throw Error(j(38));return wu(n,e,t,!1,r)},qt.version="18.2.0-next-9e3b772b8-20220608";function lP(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(lP)}catch(n){console.error(n)}}lP(),tx.exports=qt;var cP=tx.exports,uP,hP=cP;uP=hP.createRoot,hP.hydrateRoot;var co;(function(n){let e=!1,t;const r=(l,c)=>{const u=c.payload;switch(c.type){case"add":{const h=l.findIndex(f=>f.id===u.id);return h>=0?(l[h]=u,[...l]):[...l,u]}case"remove":{const h=l.findIndex(f=>f.id===u.id);if(h>=0){const f=[...l];return f.splice(h,1),f}break}}return l};function i(l,c){e&&t({type:"add",payload:{id:l,portal:c}})}n.connect=i;function s(l){e&&t({type:"remove",payload:{id:l}})}n.disconnect=s;function o(){return e}n.isActive=o;function a(){return()=>{e=!0;const[l,c]=H.useReducer(r,[]);return t=c,H.createElement(H.Fragment,{children:l.map(u=>u.portal)})}}n.getProvider=a})(co||(co={}));var aU=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const Tg={};function lU(n){const{shape:e,component:t,effect:r,inherit:i}=n,s=aU(n,["shape","component","effect","inherit"]);if(!e)throw new Error("should specify shape in config");Tg[e]={component:t,effect:r},V.registerNode(e,Object.assign({inherit:i||"react-shape"},s),!0)}class cU extends H.PureComponent{constructor(e){super(e),this.state={tick:0}}componentDidMount(){const{node:e}=this.props;e.on("change:*",({key:t})=>{const r=Tg[e.shape];if(r){const{effect:i}=r;(!i||i.includes(t))&&this.setState({tick:this.state.tick+1})}})}clone(e){const{node:t,graph:r}=this.props;return typeof e.type=="string"?H.cloneElement(e):H.cloneElement(e,{node:t,graph:r})}render(){const{node:e}=this.props,t=Tg[e.shape];if(!t)return null;const{component:r}=t;if(H.isValidElement(r))return this.clone(r);const i=r;return this.clone(H.createElement(i,null))}}class Cu extends kt{targetId(){return`${this.graph.view.cid}:${this.cell.id}`}getComponentContainer(){return this.selectors&&this.selectors.foContent}confirmUpdate(e){const t=super.confirmUpdate(e);return this.handleAction(t,Cu.action,()=>{this.renderReactComponent()})}renderReactComponent(){this.unmountReactComponent();const e=this.getComponentContainer(),t=this.cell;if(e){const r=H.createElement(cU,{node:t,graph:this.graph});if(co.isActive()){const i=cP.createPortal(r,e);co.connect(this.targetId(),i)}else this.root=uP(e),this.root.render(r)}}unmountReactComponent(){this.getComponentContainer()&&this.root&&(this.root.unmount(),this.root=void 0)}onMouseDown(e,t,r){const i=e.target;if(i.tagName.toLowerCase()==="input"){const o=i.getAttribute("type");if(o==null||["text","password","number","email","search","tel","url"].includes(o))return}super.onMouseDown(e,t,r)}unmount(){return co.isActive()&&co.disconnect(this.targetId()),this.unmountReactComponent(),super.unmount(),this}}(function(n){n.action="react",n.config({bootstrap:[n.action],actions:{component:n.action}}),kt.registry.register("react-shape-view",n,!0)})(Cu||(Cu={}));function Og(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Mg,fP;function uU(){if(fP)return Mg;fP=1;var n=qv,e=4;function t(r){return n(r,e)}return Mg=t,Mg}var _g,dP;function Ng(){if(dP)return _g;dP=1;function n(e){return function(){return e}}return _g=n,_g}var kg,gP;function hU(){if(gP)return kg;gP=1;function n(e){return function(t,r,i){for(var s=-1,o=Object(t),a=i(t),l=a.length;l--;){var c=a[e?l:++s];if(r(o[c],c,o)===!1)break}return t}}return kg=n,kg}var $g,pP;function Ig(){if(pP)return $g;pP=1;var n=hU(),e=n();return $g=e,$g}var Lg,mP;function Rg(){if(mP)return Lg;mP=1;var n=Ig(),e=Sr;function t(r,i){return r&&n(r,i,e)}return Lg=t,Lg}var jg,yP;function fU(){if(yP)return jg;yP=1;var n=Wn;function e(t,r){return function(i,s){if(i==null)return i;if(!n(i))return t(i,s);for(var o=i.length,a=r?o:-1,l=Object(i);(r?a--:++a<o)&&s(l[a],a,l)!==!1;);return i}}return jg=e,jg}var Dg,vP;function Su(){if(vP)return Dg;vP=1;var n=Rg(),e=fU(),t=e(n);return Dg=t,Dg}var Bg,bP;function Fi(){if(bP)return Bg;bP=1;function n(e){return e}return Bg=n,Bg}var zg,wP;function xP(){if(wP)return zg;wP=1;var n=Fi();function e(t){return typeof t=="function"?t:n}return zg=e,zg}var Fg,CP;function SP(){if(CP)return Fg;CP=1;var n=Yu,e=Su(),t=xP(),r=Qe;function i(s,o){var a=r(s)?n:e;return a(s,t(o))}return Fg=i,Fg}var Vg,PP;function EP(){return PP||(PP=1,Vg=SP()),Vg}var qg,AP;function dU(){if(AP)return qg;AP=1;var n=Su();function e(t,r){var i=[];return n(t,function(s,o,a){r(s,o,a)&&i.push(s)}),i}return qg=e,qg}var Gg,TP;function gU(){if(TP)return Gg;TP=1;var n="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,n),this}return Gg=e,Gg}var Hg,OP;function pU(){if(OP)return Hg;OP=1;function n(e){return this.__data__.has(e)}return Hg=n,Hg}var Ug,MP;function _P(){if(MP)return Ug;MP=1;var n=Xu,e=gU(),t=pU();function r(i){var s=-1,o=i==null?0:i.length;for(this.__data__=new n;++s<o;)this.add(i[s])}return r.prototype.add=r.prototype.push=e,r.prototype.has=t,Ug=r,Ug}var Wg,NP;function mU(){if(NP)return Wg;NP=1;function n(e,t){for(var r=-1,i=e==null?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}return Wg=n,Wg}var Xg,kP;function $P(){if(kP)return Xg;kP=1;function n(e,t){return e.has(t)}return Xg=n,Xg}var Yg,IP;function LP(){if(IP)return Yg;IP=1;var n=_P(),e=mU(),t=$P(),r=1,i=2;function s(o,a,l,c,u,h){var f=l&r,d=o.length,g=a.length;if(d!=g&&!(f&&g>d))return!1;var p=h.get(o),b=h.get(a);if(p&&b)return p==a&&b==o;var m=-1,y=!0,v=l&i?new n:void 0;for(h.set(o,a),h.set(a,o);++m<d;){var w=o[m],x=a[m];if(c)var C=f?c(x,w,m,a,o,h):c(w,x,m,o,a,h);if(C!==void 0){if(C)continue;y=!1;break}if(v){if(!e(a,function(S,E){if(!t(v,E)&&(w===S||u(w,S,l,c,h)))return v.push(E)})){y=!1;break}}else if(!(w===x||u(w,x,l,c,h))){y=!1;break}}return h.delete(o),h.delete(a),y}return Yg=s,Yg}var Kg,RP;function yU(){if(RP)return Kg;RP=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i,s){r[++t]=[s,i]}),r}return Kg=n,Kg}var Jg,jP;function Qg(){if(jP)return Jg;jP=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}return Jg=n,Jg}var Zg,DP;function vU(){if(DP)return Zg;DP=1;var n=Wi,e=Tv,t=Hi,r=LP(),i=yU(),s=Qg(),o=1,a=2,l="[object Boolean]",c="[object Date]",u="[object Error]",h="[object Map]",f="[object Number]",d="[object RegExp]",g="[object Set]",p="[object String]",b="[object Symbol]",m="[object ArrayBuffer]",y="[object DataView]",v=n?n.prototype:void 0,w=v?v.valueOf:void 0;function x(C,S,E,A,O,T,I){switch(E){case y:if(C.byteLength!=S.byteLength||C.byteOffset!=S.byteOffset)return!1;C=C.buffer,S=S.buffer;case m:return!(C.byteLength!=S.byteLength||!T(new e(C),new e(S)));case l:case c:case f:return t(+C,+S);case u:return C.name==S.name&&C.message==S.message;case d:case p:return C==S+"";case h:var G=i;case g:var Y=A&o;if(G||(G=s),C.size!=S.size&&!Y)return!1;var M=I.get(C);if(M)return M==S;A|=a,I.set(C,S);var k=r(G(C),G(S),A,O,T,I);return I.delete(C),k;case b:if(w)return w.call(C)==w.call(S)}return!1}return Zg=x,Zg}var ep,BP;function bU(){if(BP)return ep;BP=1;var n=bv,e=1,t=Object.prototype,r=t.hasOwnProperty;function i(s,o,a,l,c,u){var h=a&e,f=n(s),d=f.length,g=n(o),p=g.length;if(d!=p&&!h)return!1;for(var b=d;b--;){var m=f[b];if(!(h?m in o:r.call(o,m)))return!1}var y=u.get(s),v=u.get(o);if(y&&v)return y==o&&v==s;var w=!0;u.set(s,o),u.set(o,s);for(var x=h;++b<d;){m=f[b];var C=s[m],S=o[m];if(l)var E=h?l(S,C,m,o,s,u):l(C,S,m,s,o,u);if(!(E===void 0?C===S||c(C,S,a,l,u):E)){w=!1;break}x||(x=m=="constructor")}if(w&&!x){var A=s.constructor,O=o.constructor;A!=O&&"constructor"in s&&"constructor"in o&&!(typeof A=="function"&&A instanceof A&&typeof O=="function"&&O instanceof O)&&(w=!1)}return u.delete(s),u.delete(o),w}return ep=i,ep}var tp,zP;function wU(){if(zP)return tp;zP=1;var n=il,e=LP(),t=vU(),r=bU(),i=Zi,s=Qe,o=Ji,a=vo,l=1,c="[object Arguments]",u="[object Array]",h="[object Object]",f=Object.prototype,d=f.hasOwnProperty;function g(p,b,m,y,v,w){var x=s(p),C=s(b),S=x?u:i(p),E=C?u:i(b);S=S==c?h:S,E=E==c?h:E;var A=S==h,O=E==h,T=S==E;if(T&&o(p)){if(!o(b))return!1;x=!0,A=!1}if(T&&!A)return w||(w=new n),x||a(p)?e(p,b,m,y,v,w):t(p,b,S,m,y,v,w);if(!(m&l)){var I=A&&d.call(p,"__wrapped__"),G=O&&d.call(b,"__wrapped__");if(I||G){var Y=I?p.value():p,M=G?b.value():b;return w||(w=new n),v(Y,M,m,y,w)}}return T?(w||(w=new n),r(p,b,m,y,v,w)):!1}return tp=g,tp}var np,FP;function VP(){if(FP)return np;FP=1;var n=wU(),e=kn;function t(r,i,s,o,a){return r===i?!0:r==null||i==null||!e(r)&&!e(i)?r!==r&&i!==i:n(r,i,s,o,t,a)}return np=t,np}var rp,qP;function xU(){if(qP)return rp;qP=1;var n=il,e=VP(),t=1,r=2;function i(s,o,a,l){var c=a.length,u=c,h=!l;if(s==null)return!u;for(s=Object(s);c--;){var f=a[c];if(h&&f[2]?f[1]!==s[f[0]]:!(f[0]in s))return!1}for(;++c<u;){f=a[c];var d=f[0],g=s[d],p=f[1];if(h&&f[2]){if(g===void 0&&!(d in s))return!1}else{var b=new n;if(l)var m=l(g,p,d,s,o,b);if(!(m===void 0?e(p,g,t|r,l,b):m))return!1}}return!0}return rp=i,rp}var ip,GP;function HP(){if(GP)return ip;GP=1;var n=Qt;function e(t){return t===t&&!n(t)}return ip=e,ip}var sp,UP;function CU(){if(UP)return sp;UP=1;var n=HP(),e=Sr;function t(r){for(var i=e(r),s=i.length;s--;){var o=i[s],a=r[o];i[s]=[o,a,n(a)]}return i}return sp=t,sp}var op,WP;function XP(){if(WP)return op;WP=1;function n(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}return op=n,op}var ap,YP;function SU(){if(YP)return ap;YP=1;var n=xU(),e=CU(),t=XP();function r(i){var s=e(i);return s.length==1&&s[0][2]?t(s[0][0],s[0][1]):function(o){return o===i||n(o,i,s)}}return ap=r,ap}var lp,KP;function uo(){if(KP)return lp;KP=1;var n=ui,e=kn,t="[object Symbol]";function r(i){return typeof i=="symbol"||e(i)&&n(i)==t}return lp=r,lp}var cp,JP;function up(){if(JP)return cp;JP=1;var n=Qe,e=uo(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(s,o){if(n(s))return!1;var a=typeof s;return a=="number"||a=="symbol"||a=="boolean"||s==null||e(s)?!0:r.test(s)||!t.test(s)||o!=null&&s in Object(o)}return cp=i,cp}var hp,QP;function PU(){if(QP)return hp;QP=1;var n=Xu,e="Expected a function";function t(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var s=function(){var o=arguments,a=i?i.apply(this,o):o[0],l=s.cache;if(l.has(a))return l.get(a);var c=r.apply(this,o);return s.cache=l.set(a,c)||l,c};return s.cache=new(t.Cache||n),s}return t.Cache=n,hp=t,hp}var fp,ZP;function EU(){if(ZP)return fp;ZP=1;var n=PU(),e=500;function t(r){var i=n(r,function(o){return s.size===e&&s.clear(),o}),s=i.cache;return i}return fp=t,fp}var dp,eE;function AU(){if(eE)return dp;eE=1;var n=EU(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,r=n(function(i){var s=[];return i.charCodeAt(0)===46&&s.push(""),i.replace(e,function(o,a,l,c){s.push(l?c.replace(t,"$1"):a||o)}),s});return dp=r,dp}var gp,tE;function Pu(){if(tE)return gp;tE=1;function n(e,t){for(var r=-1,i=e==null?0:e.length,s=Array(i);++r<i;)s[r]=t(e[r],r,e);return s}return gp=n,gp}var pp,nE;function TU(){if(nE)return pp;nE=1;var n=Wi,e=Pu(),t=Qe,r=uo(),i=1/0,s=n?n.prototype:void 0,o=s?s.toString:void 0;function a(l){if(typeof l=="string")return l;if(t(l))return e(l,a)+"";if(r(l))return o?o.call(l):"";var c=l+"";return c=="0"&&1/l==-i?"-0":c}return pp=a,pp}var mp,rE;function iE(){if(rE)return mp;rE=1;var n=TU();function e(t){return t==null?"":n(t)}return mp=e,mp}var yp,sE;function Eu(){if(sE)return yp;sE=1;var n=Qe,e=up(),t=AU(),r=iE();function i(s,o){return n(s)?s:e(s,o)?[s]:t(r(s))}return yp=i,yp}var vp,oE;function Va(){if(oE)return vp;oE=1;var n=uo(),e=1/0;function t(r){if(typeof r=="string"||n(r))return r;var i=r+"";return i=="0"&&1/r==-e?"-0":i}return vp=t,vp}var bp,aE;function Au(){if(aE)return bp;aE=1;var n=Eu(),e=Va();function t(r,i){i=n(i,r);for(var s=0,o=i.length;r!=null&&s<o;)r=r[e(i[s++])];return s&&s==o?r:void 0}return bp=t,bp}var wp,lE;function OU(){if(lE)return wp;lE=1;var n=Au();function e(t,r,i){var s=t==null?void 0:n(t,r);return s===void 0?i:s}return wp=e,wp}var xp,cE;function MU(){if(cE)return xp;cE=1;function n(e,t){return e!=null&&t in Object(e)}return xp=n,xp}var Cp,uE;function hE(){if(uE)return Cp;uE=1;var n=Eu(),e=yo,t=Qe,r=ll,i=Ku,s=Va();function o(a,l,c){l=n(l,a);for(var u=-1,h=l.length,f=!1;++u<h;){var d=s(l[u]);if(!(f=a!=null&&c(a,d)))break;a=a[d]}return f||++u!=h?f:(h=a==null?0:a.length,!!h&&i(h)&&r(d,h)&&(t(a)||e(a)))}return Cp=o,Cp}var Sp,fE;function dE(){if(fE)return Sp;fE=1;var n=MU(),e=hE();function t(r,i){return r!=null&&e(r,i,n)}return Sp=t,Sp}var Pp,gE;function _U(){if(gE)return Pp;gE=1;var n=VP(),e=OU(),t=dE(),r=up(),i=HP(),s=XP(),o=Va(),a=1,l=2;function c(u,h){return r(u)&&i(h)?s(o(u),h):function(f){var d=e(f,u);return d===void 0&&d===h?t(f,u):n(h,d,a|l)}}return Pp=c,Pp}var Ep,pE;function mE(){if(pE)return Ep;pE=1;function n(e){return function(t){return t==null?void 0:t[e]}}return Ep=n,Ep}var Ap,yE;function NU(){if(yE)return Ap;yE=1;var n=Au();function e(t){return function(r){return n(r,t)}}return Ap=e,Ap}var Tp,vE;function kU(){if(vE)return Tp;vE=1;var n=mE(),e=NU(),t=up(),r=Va();function i(s){return t(s)?n(r(s)):e(s)}return Tp=i,Tp}var Op,bE;function yr(){if(bE)return Op;bE=1;var n=SU(),e=_U(),t=Fi(),r=Qe,i=kU();function s(o){return typeof o=="function"?o:o==null?t:typeof o=="object"?r(o)?e(o[0],o[1]):n(o):i(o)}return Op=s,Op}var Mp,wE;function xE(){if(wE)return Mp;wE=1;var n=gv,e=dU(),t=yr(),r=Qe;function i(s,o){var a=r(s)?n:e;return a(s,t(o,3))}return Mp=i,Mp}var _p,CE;function $U(){if(CE)return _p;CE=1;var n=Object.prototype,e=n.hasOwnProperty;function t(r,i){return r!=null&&e.call(r,i)}return _p=t,_p}var Np,SE;function PE(){if(SE)return Np;SE=1;var n=$U(),e=hE();function t(r,i){return r!=null&&e(r,i,n)}return Np=t,Np}var kp,EE;function IU(){if(EE)return kp;EE=1;var n=Qu,e=Zi,t=yo,r=Qe,i=Wn,s=Ji,o=hl,a=vo,l="[object Map]",c="[object Set]",u=Object.prototype,h=u.hasOwnProperty;function f(d){if(d==null)return!0;if(i(d)&&(r(d)||typeof d=="string"||typeof d.splice=="function"||s(d)||a(d)||t(d)))return!d.length;var g=e(d);if(g==l||g==c)return!d.size;if(o(d))return!n(d).length;for(var p in d)if(h.call(d,p))return!1;return!0}return kp=f,kp}var $p,AE;function TE(){if(AE)return $p;AE=1;function n(e){return e===void 0}return $p=n,$p}var Ip,OE;function ME(){if(OE)return Ip;OE=1;var n=Su(),e=Wn;function t(r,i){var s=-1,o=e(r)?Array(r.length):[];return n(r,function(a,l,c){o[++s]=i(a,l,c)}),o}return Ip=t,Ip}var Lp,_E;function NE(){if(_E)return Lp;_E=1;var n=Pu(),e=yr(),t=ME(),r=Qe;function i(s,o){var a=r(s)?n:t;return a(s,e(o,3))}return Lp=i,Lp}var Rp,kE;function LU(){if(kE)return Rp;kE=1;function n(e,t,r,i){var s=-1,o=e==null?0:e.length;for(i&&o&&(r=e[++s]);++s<o;)r=t(r,e[s],s,e);return r}return Rp=n,Rp}var jp,$E;function RU(){if($E)return jp;$E=1;function n(e,t,r,i,s){return s(e,function(o,a,l){r=i?(i=!1,o):t(r,o,a,l)}),r}return jp=n,jp}var Dp,IE;function LE(){if(IE)return Dp;IE=1;var n=LU(),e=Su(),t=yr(),r=RU(),i=Qe;function s(o,a,l){var c=i(o)?n:r,u=arguments.length<3;return c(o,t(a,4),l,u,e)}return Dp=s,Dp}var Bp,RE;function jU(){if(RE)return Bp;RE=1;var n=ui,e=Qe,t=kn,r="[object String]";function i(s){return typeof s=="string"||!e(s)&&t(s)&&n(s)==r}return Bp=i,Bp}var zp,jE;function DU(){if(jE)return zp;jE=1;var n=mE(),e=n("length");return zp=e,zp}var Fp,DE;function BU(){if(DE)return Fp;DE=1;var n="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=e+t+r,s="\\ufe0e\\ufe0f",o="\\u200d",a=RegExp("["+o+n+i+s+"]");function l(c){return a.test(c)}return Fp=l,Fp}var Vp,BE;function zU(){if(BE)return Vp;BE=1;var n="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=e+t+r,s="\\ufe0e\\ufe0f",o="["+n+"]",a="["+i+"]",l="\\ud83c[\\udffb-\\udfff]",c="(?:"+a+"|"+l+")",u="[^"+n+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",f="[\\ud800-\\udbff][\\udc00-\\udfff]",d="\\u200d",g=c+"?",p="["+s+"]?",b="(?:"+d+"(?:"+[u,h,f].join("|")+")"+p+g+")*",m=p+g+b,y="(?:"+[u+a+"?",a,h,f,o].join("|")+")",v=RegExp(l+"(?="+l+")|"+y+m,"g");function w(x){for(var C=v.lastIndex=0;v.test(x);)++C;return C}return Vp=w,Vp}var qp,zE;function FU(){if(zE)return qp;zE=1;var n=DU(),e=BU(),t=zU();function r(i){return e(i)?t(i):n(i)}return qp=r,qp}var Gp,FE;function VU(){if(FE)return Gp;FE=1;var n=Qu,e=Zi,t=Wn,r=jU(),i=FU(),s="[object Map]",o="[object Set]";function a(l){if(l==null)return 0;if(t(l))return r(l)?i(l):l.length;var c=e(l);return c==s||c==o?l.size:n(l).length}return Gp=a,Gp}var Hp,VE;function qU(){if(VE)return Hp;VE=1;var n=Yu,e=Iv,t=Rg(),r=yr(),i=dl,s=Qe,o=Ji,a=po,l=Qt,c=vo;function u(h,f,d){var g=s(h),p=g||o(h)||c(h);if(f=r(f,4),d==null){var b=h&&h.constructor;p?d=g?new b:[]:l(h)?d=a(b)?e(i(h)):{}:d={}}return(p?n:t)(h,function(m,y,v){return f(d,m,y,v)}),d}return Hp=u,Hp}var Up,qE;function GU(){if(qE)return Up;qE=1;var n=Wi,e=yo,t=Qe,r=n?n.isConcatSpreadable:void 0;function i(s){return t(s)||e(s)||!!(r&&s&&s[r])}return Up=i,Up}var Wp,GE;function Xp(){if(GE)return Wp;GE=1;var n=eh,e=GU();function t(r,i,s,o,a){var l=-1,c=r.length;for(s||(s=e),a||(a=[]);++l<c;){var u=r[l];i>0&&s(u)?i>1?t(u,i-1,s,o,a):n(a,u):o||(a[a.length]=u)}return a}return Wp=t,Wp}var Yp,HE;function HU(){if(HE)return Yp;HE=1;function n(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}return Yp=n,Yp}var Kp,UE;function WE(){if(UE)return Kp;UE=1;var n=HU(),e=Math.max;function t(r,i,s){return i=e(i===void 0?r.length-1:i,0),function(){for(var o=arguments,a=-1,l=e(o.length-i,0),c=Array(l);++a<l;)c[a]=o[i+a];a=-1;for(var u=Array(i+1);++a<i;)u[a]=o[a];return u[i]=s(c),n(r,this,u)}}return Kp=t,Kp}var Jp,XE;function UU(){if(XE)return Jp;XE=1;var n=Ng(),e=iv,t=Fi(),r=e?function(i,s){return e(i,"toString",{configurable:!0,enumerable:!1,value:n(s),writable:!0})}:t;return Jp=r,Jp}var Qp,YE;function WU(){if(YE)return Qp;YE=1;var n=800,e=16,t=Date.now;function r(i){var s=0,o=0;return function(){var a=t(),l=e-(a-o);if(o=a,l>0){if(++s>=n)return arguments[0]}else s=0;return i.apply(void 0,arguments)}}return Qp=r,Qp}var Zp,KE;function JE(){if(KE)return Zp;KE=1;var n=UU(),e=WU(),t=e(n);return Zp=t,Zp}var em,QE;function Tu(){if(QE)return em;QE=1;var n=Fi(),e=WE(),t=JE();function r(i,s){return t(e(i,s,n),i+"")}return em=r,em}var tm,ZE;function eA(){if(ZE)return tm;ZE=1;function n(e,t,r,i){for(var s=e.length,o=r+(i?1:-1);i?o--:++o<s;)if(t(e[o],o,e))return o;return-1}return tm=n,tm}var nm,tA;function XU(){if(tA)return nm;tA=1;function n(e){return e!==e}return nm=n,nm}var rm,nA;function YU(){if(nA)return rm;nA=1;function n(e,t,r){for(var i=r-1,s=e.length;++i<s;)if(e[i]===t)return i;return-1}return rm=n,rm}var im,rA;function KU(){if(rA)return im;rA=1;var n=eA(),e=XU(),t=YU();function r(i,s,o){return s===s?t(i,s,o):n(i,e,o)}return im=r,im}var sm,iA;function JU(){if(iA)return sm;iA=1;var n=KU();function e(t,r){var i=t==null?0:t.length;return!!i&&n(t,r,0)>-1}return sm=e,sm}var om,sA;function QU(){if(sA)return om;sA=1;function n(e,t,r){for(var i=-1,s=e==null?0:e.length;++i<s;)if(r(t,e[i]))return!0;return!1}return om=n,om}var am,oA;function ZU(){if(oA)return am;oA=1;function n(){}return am=n,am}var lm,aA;function eW(){if(aA)return lm;aA=1;var n=wv,e=ZU(),t=Qg(),r=1/0,i=n&&1/t(new n([,-0]))[1]==r?function(s){return new n(s)}:e;return lm=i,lm}var cm,lA;function tW(){if(lA)return cm;lA=1;var n=_P(),e=JU(),t=QU(),r=$P(),i=eW(),s=Qg(),o=200;function a(l,c,u){var h=-1,f=e,d=l.length,g=!0,p=[],b=p;if(u)g=!1,f=t;else if(d>=o){var m=c?null:i(l);if(m)return s(m);g=!1,f=r,b=new n}else b=c?[]:p;e:for(;++h<d;){var y=l[h],v=c?c(y):y;if(y=u||y!==0?y:0,g&&v===v){for(var w=b.length;w--;)if(b[w]===v)continue e;c&&b.push(v),p.push(y)}else f(b,v,u)||(b!==p&&b.push(v),p.push(y))}return p}return cm=a,cm}var um,cA;function uA(){if(cA)return um;cA=1;var n=Wn,e=kn;function t(r){return e(r)&&n(r)}return um=t,um}var hm,hA;function nW(){if(hA)return hm;hA=1;var n=Xp(),e=Tu(),t=tW(),r=uA(),i=e(function(s){return t(n(s,1,r,!0))});return hm=i,hm}var fm,fA;function rW(){if(fA)return fm;fA=1;var n=Pu();function e(t,r){return n(r,function(i){return t[i]})}return fm=e,fm}var dm,dA;function gA(){if(dA)return dm;dA=1;var n=rW(),e=Sr;function t(r){return r==null?[]:n(r,e(r))}return dm=t,dm}var gm,pA;function dn(){if(pA)return gm;pA=1;var n;if(typeof Og=="function")try{n={clone:uU(),constant:Ng(),each:EP(),filter:xE(),has:PE(),isArray:Qe,isEmpty:IU(),isFunction:po,isUndefined:TE(),keys:Sr,map:NE(),reduce:LE(),size:VU(),transform:qU(),union:nW(),values:gA()}}catch(e){}return n||(n=window._),gm=n,gm}var pm,mA;function mm(){if(mA)return pm;mA=1;var n=dn();pm=i;var e="\0",t="\0",r="";function i(u){this._isDirected=n.has(u,"directed")?u.directed:!0,this._isMultigraph=n.has(u,"multigraph")?u.multigraph:!1,this._isCompound=n.has(u,"compound")?u.compound:!1,this._label=void 0,this._defaultNodeLabelFn=n.constant(void 0),this._defaultEdgeLabelFn=n.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(u){return this._label=u,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(u){return n.isFunction(u)||(u=n.constant(u)),this._defaultNodeLabelFn=u,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return n.keys(this._nodes)},i.prototype.sources=function(){var u=this;return n.filter(this.nodes(),function(h){return n.isEmpty(u._in[h])})},i.prototype.sinks=function(){var u=this;return n.filter(this.nodes(),function(h){return n.isEmpty(u._out[h])})},i.prototype.setNodes=function(u,h){var f=arguments,d=this;return n.each(u,function(g){f.length>1?d.setNode(g,h):d.setNode(g)}),this},i.prototype.setNode=function(u,h){return n.has(this._nodes,u)?(arguments.length>1&&(this._nodes[u]=h),this):(this._nodes[u]=arguments.length>1?h:this._defaultNodeLabelFn(u),this._isCompound&&(this._parent[u]=t,this._children[u]={},this._children[t][u]=!0),this._in[u]={},this._preds[u]={},this._out[u]={},this._sucs[u]={},++this._nodeCount,this)},i.prototype.node=function(u){return this._nodes[u]},i.prototype.hasNode=function(u){return n.has(this._nodes,u)},i.prototype.removeNode=function(u){var h=this;if(n.has(this._nodes,u)){var f=function(d){h.removeEdge(h._edgeObjs[d])};delete this._nodes[u],this._isCompound&&(this._removeFromParentsChildList(u),delete this._parent[u],n.each(this.children(u),function(d){h.setParent(d)}),delete this._children[u]),n.each(n.keys(this._in[u]),f),delete this._in[u],delete this._preds[u],n.each(n.keys(this._out[u]),f),delete this._out[u],delete this._sucs[u],--this._nodeCount}return this},i.prototype.setParent=function(u,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n.isUndefined(h))h=t;else{h+="";for(var f=h;!n.isUndefined(f);f=this.parent(f))if(f===u)throw new Error("Setting "+h+" as parent of "+u+" would create a cycle");this.setNode(h)}return this.setNode(u),this._removeFromParentsChildList(u),this._parent[u]=h,this._children[h][u]=!0,this},i.prototype._removeFromParentsChildList=function(u){delete this._children[this._parent[u]][u]},i.prototype.parent=function(u){if(this._isCompound){var h=this._parent[u];if(h!==t)return h}},i.prototype.children=function(u){if(n.isUndefined(u)&&(u=t),this._isCompound){var h=this._children[u];if(h)return n.keys(h)}else{if(u===t)return this.nodes();if(this.hasNode(u))return[]}},i.prototype.predecessors=function(u){var h=this._preds[u];if(h)return n.keys(h)},i.prototype.successors=function(u){var h=this._sucs[u];if(h)return n.keys(h)},i.prototype.neighbors=function(u){var h=this.predecessors(u);if(h)return n.union(h,this.successors(u))},i.prototype.isLeaf=function(u){var h;return this.isDirected()?h=this.successors(u):h=this.neighbors(u),h.length===0},i.prototype.filterNodes=function(u){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var f=this;n.each(this._nodes,function(p,b){u(b)&&h.setNode(b,p)}),n.each(this._edgeObjs,function(p){h.hasNode(p.v)&&h.hasNode(p.w)&&h.setEdge(p,f.edge(p))});var d={};function g(p){var b=f.parent(p);return b===void 0||h.hasNode(b)?(d[p]=b,b):b in d?d[b]:g(b)}return this._isCompound&&n.each(h.nodes(),function(p){h.setParent(p,g(p))}),h},i.prototype.setDefaultEdgeLabel=function(u){return n.isFunction(u)||(u=n.constant(u)),this._defaultEdgeLabelFn=u,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return n.values(this._edgeObjs)},i.prototype.setPath=function(u,h){var f=this,d=arguments;return n.reduce(u,function(g,p){return d.length>1?f.setEdge(g,p,h):f.setEdge(g,p),p}),this},i.prototype.setEdge=function(){var u,h,f,d,g=!1,p=arguments[0];typeof p=="object"&&p!==null&&"v"in p?(u=p.v,h=p.w,f=p.name,arguments.length===2&&(d=arguments[1],g=!0)):(u=p,h=arguments[1],f=arguments[3],arguments.length>2&&(d=arguments[2],g=!0)),u=""+u,h=""+h,n.isUndefined(f)||(f=""+f);var b=a(this._isDirected,u,h,f);if(n.has(this._edgeLabels,b))return g&&(this._edgeLabels[b]=d),this;if(!n.isUndefined(f)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(u),this.setNode(h),this._edgeLabels[b]=g?d:this._defaultEdgeLabelFn(u,h,f);var m=l(this._isDirected,u,h,f);return u=m.v,h=m.w,Object.freeze(m),this._edgeObjs[b]=m,s(this._preds[h],u),s(this._sucs[u],h),this._in[h][b]=m,this._out[u][b]=m,this._edgeCount++,this},i.prototype.edge=function(u,h,f){var d=arguments.length===1?c(this._isDirected,arguments[0]):a(this._isDirected,u,h,f);return this._edgeLabels[d]},i.prototype.hasEdge=function(u,h,f){var d=arguments.length===1?c(this._isDirected,arguments[0]):a(this._isDirected,u,h,f);return n.has(this._edgeLabels,d)},i.prototype.removeEdge=function(u,h,f){var d=arguments.length===1?c(this._isDirected,arguments[0]):a(this._isDirected,u,h,f),g=this._edgeObjs[d];return g&&(u=g.v,h=g.w,delete this._edgeLabels[d],delete this._edgeObjs[d],o(this._preds[h],u),o(this._sucs[u],h),delete this._in[h][d],delete this._out[u][d],this._edgeCount--),this},i.prototype.inEdges=function(u,h){var f=this._in[u];if(f){var d=n.values(f);return h?n.filter(d,function(g){return g.v===h}):d}},i.prototype.outEdges=function(u,h){var f=this._out[u];if(f){var d=n.values(f);return h?n.filter(d,function(g){return g.w===h}):d}},i.prototype.nodeEdges=function(u,h){var f=this.inEdges(u,h);if(f)return f.concat(this.outEdges(u,h))};function s(u,h){u[h]?u[h]++:u[h]=1}function o(u,h){--u[h]||delete u[h]}function a(u,h,f,d){var g=""+h,p=""+f;if(!u&&g>p){var b=g;g=p,p=b}return g+r+p+r+(n.isUndefined(d)?e:d)}function l(u,h,f,d){var g=""+h,p=""+f;if(!u&&g>p){var b=g;g=p,p=b}var m={v:g,w:p};return d&&(m.name=d),m}function c(u,h){return a(u,h.v,h.w,h.name)}return pm}var ym,yA;function iW(){return yA||(yA=1,ym="2.1.8"),ym}var vm,vA;function sW(){return vA||(vA=1,vm={Graph:mm(),version:iW()}),vm}var bm,bA;function oW(){if(bA)return bm;bA=1;var n=dn(),e=mm();bm={write:t,read:s};function t(o){var a={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:r(o),edges:i(o)};return n.isUndefined(o.graph())||(a.value=n.clone(o.graph())),a}function r(o){return n.map(o.nodes(),function(a){var l=o.node(a),c=o.parent(a),u={v:a};return n.isUndefined(l)||(u.value=l),n.isUndefined(c)||(u.parent=c),u})}function i(o){return n.map(o.edges(),function(a){var l=o.edge(a),c={v:a.v,w:a.w};return n.isUndefined(a.name)||(c.name=a.name),n.isUndefined(l)||(c.value=l),c})}function s(o){var a=new e(o.options).setGraph(o.value);return n.each(o.nodes,function(l){a.setNode(l.v,l.value),l.parent&&a.setParent(l.v,l.parent)}),n.each(o.edges,function(l){a.setEdge({v:l.v,w:l.w,name:l.name},l.value)}),a}return bm}var wm,wA;function aW(){if(wA)return wm;wA=1;var n=dn();wm=e;function e(t){var r={},i=[],s;function o(a){n.has(r,a)||(r[a]=!0,s.push(a),n.each(t.successors(a),o),n.each(t.predecessors(a),o))}return n.each(t.nodes(),function(a){s=[],o(a),s.length&&i.push(s)}),i}return wm}var xm,xA;function CA(){if(xA)return xm;xA=1;var n=dn();xm=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(t){return t.key})},e.prototype.has=function(t){return n.has(this._keyIndices,t)},e.prototype.priority=function(t){var r=this._keyIndices[t];if(r!==void 0)return this._arr[r].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(t,r){var i=this._keyIndices;if(t=String(t),!n.has(i,t)){var s=this._arr,o=s.length;return i[t]=o,s.push({key:t,priority:r}),this._decrease(o),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},e.prototype.decrease=function(t,r){var i=this._keyIndices[t];if(r>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[i].priority+" New: "+r);this._arr[i].priority=r,this._decrease(i)},e.prototype._heapify=function(t){var r=this._arr,i=2*t,s=i+1,o=t;i<r.length&&(o=r[i].priority<r[o].priority?i:o,s<r.length&&(o=r[s].priority<r[o].priority?s:o),o!==t&&(this._swap(t,o),this._heapify(o)))},e.prototype._decrease=function(t){for(var r=this._arr,i=r[t].priority,s;t!==0&&(s=t>>1,!(r[s].priority<i));)this._swap(t,s),t=s},e.prototype._swap=function(t,r){var i=this._arr,s=this._keyIndices,o=i[t],a=i[r];i[t]=a,i[r]=o,s[a.key]=t,s[o.key]=r},xm}var Cm,SA;function PA(){if(SA)return Cm;SA=1;var n=dn(),e=CA();Cm=r;var t=n.constant(1);function r(s,o,a,l){return i(s,String(o),a||t,l||function(c){return s.outEdges(c)})}function i(s,o,a,l){var c={},u=new e,h,f,d=function(g){var p=g.v!==h?g.v:g.w,b=c[p],m=a(g),y=f.distance+m;if(m<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+g+" Weight: "+m);y<b.distance&&(b.distance=y,b.predecessor=h,u.decrease(p,y))};for(s.nodes().forEach(function(g){var p=g===o?0:Number.POSITIVE_INFINITY;c[g]={distance:p},u.add(g,p)});u.size()>0&&(h=u.removeMin(),f=c[h],f.distance!==Number.POSITIVE_INFINITY);)l(h).forEach(d);return c}return Cm}var Sm,EA;function lW(){if(EA)return Sm;EA=1;var n=PA(),e=dn();Sm=t;function t(r,i,s){return e.transform(r.nodes(),function(o,a){o[a]=n(r,a,i,s)},{})}return Sm}var Pm,AA;function TA(){if(AA)return Pm;AA=1;var n=dn();Pm=e;function e(t){var r=0,i=[],s={},o=[];function a(l){var c=s[l]={onStack:!0,lowlink:r,index:r++};if(i.push(l),t.successors(l).forEach(function(f){n.has(s,f)?s[f].onStack&&(c.lowlink=Math.min(c.lowlink,s[f].index)):(a(f),c.lowlink=Math.min(c.lowlink,s[f].lowlink))}),c.lowlink===c.index){var u=[],h;do h=i.pop(),s[h].onStack=!1,u.push(h);while(l!==h);o.push(u)}}return t.nodes().forEach(function(l){n.has(s,l)||a(l)}),o}return Pm}var Em,OA;function cW(){if(OA)return Em;OA=1;var n=dn(),e=TA();Em=t;function t(r){return n.filter(e(r),function(i){return i.length>1||i.length===1&&r.hasEdge(i[0],i[0])})}return Em}var Am,MA;function uW(){if(MA)return Am;MA=1;var n=dn();Am=t;var e=n.constant(1);function t(i,s,o){return r(i,s||e,o||function(a){return i.outEdges(a)})}function r(i,s,o){var a={},l=i.nodes();return l.forEach(function(c){a[c]={},a[c][c]={distance:0},l.forEach(function(u){c!==u&&(a[c][u]={distance:Number.POSITIVE_INFINITY})}),o(c).forEach(function(u){var h=u.v===c?u.w:u.v,f=s(u);a[c][h]={distance:f,predecessor:c}})}),l.forEach(function(c){var u=a[c];l.forEach(function(h){var f=a[h];l.forEach(function(d){var g=f[c],p=u[d],b=f[d],m=g.distance+p.distance;m<b.distance&&(b.distance=m,b.predecessor=p.predecessor)})})}),a}return Am}var Tm,_A;function NA(){if(_A)return Tm;_A=1;var n=dn();Tm=e,e.CycleException=t;function e(r){var i={},s={},o=[];function a(l){if(n.has(s,l))throw new t;n.has(i,l)||(s[l]=!0,i[l]=!0,n.each(r.predecessors(l),a),delete s[l],o.push(l))}if(n.each(r.sinks(),a),n.size(i)!==r.nodeCount())throw new t;return o}function t(){}return t.prototype=new Error,Tm}var Om,kA;function hW(){if(kA)return Om;kA=1;var n=NA();Om=e;function e(t){try{n(t)}catch(r){if(r instanceof n.CycleException)return!1;throw r}return!0}return Om}var Mm,$A;function IA(){if($A)return Mm;$A=1;var n=dn();Mm=e;function e(r,i,s){n.isArray(i)||(i=[i]);var o=(r.isDirected()?r.successors:r.neighbors).bind(r),a=[],l={};return n.each(i,function(c){if(!r.hasNode(c))throw new Error("Graph does not have node: "+c);t(r,c,s==="post",l,o,a)}),a}function t(r,i,s,o,a,l){n.has(o,i)||(o[i]=!0,s||l.push(i),n.each(a(i),function(c){t(r,c,s,o,a,l)}),s&&l.push(i))}return Mm}var _m,LA;function fW(){if(LA)return _m;LA=1;var n=IA();_m=e;function e(t,r){return n(t,r,"post")}return _m}var Nm,RA;function dW(){if(RA)return Nm;RA=1;var n=IA();Nm=e;function e(t,r){return n(t,r,"pre")}return Nm}var km,jA;function gW(){if(jA)return km;jA=1;var n=dn(),e=mm(),t=CA();km=r;function r(i,s){var o=new e,a={},l=new t,c;function u(f){var d=f.v===c?f.w:f.v,g=l.priority(d);if(g!==void 0){var p=s(f);p<g&&(a[d]=c,l.decrease(d,p))}}if(i.nodeCount()===0)return o;n.each(i.nodes(),function(f){l.add(f,Number.POSITIVE_INFINITY),o.setNode(f)}),l.decrease(i.nodes()[0],0);for(var h=!1;l.size()>0;){if(c=l.removeMin(),n.has(a,c))o.setEdge(c,a[c]);else{if(h)throw new Error("Input graph is not connected: "+i);h=!0}i.nodeEdges(c).forEach(u)}return o}return km}var $m,DA;function pW(){return DA||(DA=1,$m={components:aW(),dijkstra:PA(),dijkstraAll:lW(),findCycles:cW(),floydWarshall:uW(),isAcyclic:hW(),postorder:fW(),preorder:dW(),prim:gW(),tarjan:TA(),topsort:NA()}),$m}var Im,BA;function mW(){if(BA)return Im;BA=1;var n=sW();return Im={Graph:n.Graph,json:oW(),alg:pW(),version:n.version},Im}var Ou;if(typeof Og=="function")try{Ou=mW()}catch(n){}Ou||(Ou=window.graphlib);var Mn=Ou,Lm,zA;function Mu(){if(zA)return Lm;zA=1;var n=Hi,e=Wn,t=ll,r=Qt;function i(s,o,a){if(!r(a))return!1;var l=typeof o;return(l=="number"?e(a)&&t(o,a.length):l=="string"&&o in a)?n(a[o],s):!1}return Lm=i,Lm}var Rm,FA;function yW(){if(FA)return Rm;FA=1;var n=Tu(),e=Hi,t=Mu(),r=fi,i=Object.prototype,s=i.hasOwnProperty,o=n(function(a,l){a=Object(a);var c=-1,u=l.length,h=u>2?l[2]:void 0;for(h&&t(l[0],l[1],h)&&(u=1);++c<u;)for(var f=l[c],d=r(f),g=-1,p=d.length;++g<p;){var b=d[g],m=a[b];(m===void 0||e(m,i[b])&&!s.call(a,b))&&(a[b]=f[b])}return a});return Rm=o,Rm}var jm,VA;function vW(){if(VA)return jm;VA=1;var n=yr(),e=Wn,t=Sr;function r(i){return function(s,o,a){var l=Object(s);if(!e(s)){var c=n(o,3);s=t(s),o=function(h){return c(l[h],h,l)}}var u=i(s,o,a);return u>-1?l[c?s[u]:u]:void 0}}return jm=r,jm}var Dm,qA;function bW(){if(qA)return Dm;qA=1;var n=/\s/;function e(t){for(var r=t.length;r--&&n.test(t.charAt(r)););return r}return Dm=e,Dm}var Bm,GA;function wW(){if(GA)return Bm;GA=1;var n=bW(),e=/^\s+/;function t(r){return r&&r.slice(0,n(r)+1).replace(e,"")}return Bm=t,Bm}var zm,HA;function xW(){if(HA)return zm;HA=1;var n=wW(),e=Qt,t=uo(),r=0/0,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(t(c))return r;if(e(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=e(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=n(c);var h=s.test(c);return h||o.test(c)?a(c.slice(2),h?2:8):i.test(c)?r:+c}return zm=l,zm}var Fm,UA;function WA(){if(UA)return Fm;UA=1;var n=xW(),e=1/0,t=17976931348623157e292;function r(i){if(!i)return i===0?i:0;if(i=n(i),i===e||i===-e){var s=i<0?-1:1;return s*t}return i===i?i:0}return Fm=r,Fm}var Vm,XA;function CW(){if(XA)return Vm;XA=1;var n=WA();function e(t){var r=n(t),i=r%1;return r===r?i?r-i:r:0}return Vm=e,Vm}var qm,YA;function SW(){if(YA)return qm;YA=1;var n=eA(),e=yr(),t=CW(),r=Math.max;function i(s,o,a){var l=s==null?0:s.length;if(!l)return-1;var c=a==null?0:t(a);return c<0&&(c=r(l+c,0)),n(s,e(o,3),c)}return qm=i,qm}var Gm,KA;function PW(){if(KA)return Gm;KA=1;var n=vW(),e=SW(),t=n(e);return Gm=t,Gm}var Hm,JA;function QA(){if(JA)return Hm;JA=1;var n=Xp();function e(t){var r=t==null?0:t.length;return r?n(t,1):[]}return Hm=e,Hm}var Um,ZA;function EW(){if(ZA)return Um;ZA=1;var n=Ig(),e=xP(),t=fi;function r(i,s){return i==null?i:n(i,e(s),t)}return Um=r,Um}var Wm,eT;function AW(){if(eT)return Wm;eT=1;function n(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return Wm=n,Wm}var Xm,tT;function TW(){if(tT)return Xm;tT=1;var n=sl,e=Rg(),t=yr();function r(i,s){var o={};return s=t(s,3),e(i,function(a,l,c){n(o,l,s(a,l,c))}),o}return Xm=r,Xm}var Ym,nT;function Km(){if(nT)return Ym;nT=1;var n=uo();function e(t,r,i){for(var s=-1,o=t.length;++s<o;){var a=t[s],l=r(a);if(l!=null&&(c===void 0?l===l&&!n(l):i(l,c)))var c=l,u=a}return u}return Ym=e,Ym}var Jm,rT;function OW(){if(rT)return Jm;rT=1;function n(e,t){return e>t}return Jm=n,Jm}var Qm,iT;function MW(){if(iT)return Qm;iT=1;var n=Km(),e=OW(),t=Fi();function r(i){return i&&i.length?n(i,t,e):void 0}return Qm=r,Qm}var Zm,sT;function oT(){if(sT)return Zm;sT=1;var n=sl,e=Hi;function t(r,i,s){(s!==void 0&&!e(r[i],s)||s===void 0&&!(i in r))&&n(r,i,s)}return Zm=t,Zm}var ey,aT;function _W(){if(aT)return ey;aT=1;var n=ui,e=dl,t=kn,r="[object Object]",i=Function.prototype,s=Object.prototype,o=i.toString,a=s.hasOwnProperty,l=o.call(Object);function c(u){if(!t(u)||n(u)!=r)return!1;var h=e(u);if(h===null)return!0;var f=a.call(h,"constructor")&&h.constructor;return typeof f=="function"&&f instanceof f&&o.call(f)==l}return ey=c,ey}var ty,lT;function cT(){if(lT)return ty;lT=1;function n(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return ty=n,ty}var ny,uT;function NW(){if(uT)return ny;uT=1;var n=mo,e=fi;function t(r){return n(r,e(r))}return ny=t,ny}var ry,hT;function kW(){if(hT)return ry;hT=1;var n=oT(),e=fv,t=kv,r=dv,i=Lv,s=yo,o=Qe,a=uA(),l=Ji,c=po,u=Qt,h=_W(),f=vo,d=cT(),g=NW();function p(b,m,y,v,w,x,C){var S=d(b,y),E=d(m,y),A=C.get(E);if(A){n(b,y,A);return}var O=x?x(S,E,y+"",b,m,C):void 0,T=O===void 0;if(T){var I=o(E),G=!I&&l(E),Y=!I&&!G&&f(E);O=E,I||G||Y?o(S)?O=S:a(S)?O=r(S):G?(T=!1,O=e(E,!0)):Y?(T=!1,O=t(E,!0)):O=[]:h(E)||s(E)?(O=S,s(S)?O=g(S):(!u(S)||c(S))&&(O=i(E))):T=!1}T&&(C.set(E,O),w(O,E,v,x,C),C.delete(E)),n(b,y,O)}return ry=p,ry}var iy,fT;function $W(){if(fT)return iy;fT=1;var n=il,e=oT(),t=Ig(),r=kW(),i=Qt,s=fi,o=cT();function a(l,c,u,h,f){l!==c&&t(c,function(d,g){if(f||(f=new n),i(d))r(l,c,g,u,a,h,f);else{var p=h?h(o(l,g),d,g+"",l,c,f):void 0;p===void 0&&(p=d),e(l,g,p)}},s)}return iy=a,iy}var sy,dT;function IW(){if(dT)return sy;dT=1;var n=Tu(),e=Mu();function t(r){return n(function(i,s){var o=-1,a=s.length,l=a>1?s[a-1]:void 0,c=a>2?s[2]:void 0;for(l=r.length>3&&typeof l=="function"?(a--,l):void 0,c&&e(s[0],s[1],c)&&(l=a<3?void 0:l,a=1),i=Object(i);++o<a;){var u=s[o];u&&r(i,u,o,l)}return i})}return sy=t,sy}var oy,gT;function LW(){if(gT)return oy;gT=1;var n=$W(),e=IW(),t=e(function(r,i,s){n(r,i,s)});return oy=t,oy}var ay,pT;function mT(){if(pT)return ay;pT=1;function n(e,t){return e<t}return ay=n,ay}var ly,yT;function RW(){if(yT)return ly;yT=1;var n=Km(),e=mT(),t=Fi();function r(i){return i&&i.length?n(i,t,e):void 0}return ly=r,ly}var cy,vT;function jW(){if(vT)return cy;vT=1;var n=Km(),e=yr(),t=mT();function r(i,s){return i&&i.length?n(i,e(s,2),t):void 0}return cy=r,cy}var uy,bT;function DW(){if(bT)return uy;bT=1;var n=mn,e=function(){return n.Date.now()};return uy=e,uy}var hy,wT;function BW(){if(wT)return hy;wT=1;var n=ol,e=Eu(),t=ll,r=Qt,i=Va();function s(o,a,l,c){if(!r(o))return o;a=e(a,o);for(var u=-1,h=a.length,f=h-1,d=o;d!=null&&++u<h;){var g=i(a[u]),p=l;if(g==="__proto__"||g==="constructor"||g==="prototype")return o;if(u!=f){var b=d[g];p=c?c(b,g,d):void 0,p===void 0&&(p=r(b)?b:t(a[u+1])?[]:{})}n(d,g,p),d=d[g]}return o}return hy=s,hy}var fy,xT;function zW(){if(xT)return fy;xT=1;var n=Au(),e=BW(),t=Eu();function r(i,s,o){for(var a=-1,l=s.length,c={};++a<l;){var u=s[a],h=n(i,u);o(h,u)&&e(c,t(u,i),h)}return c}return fy=r,fy}var dy,CT;function FW(){if(CT)return dy;CT=1;var n=zW(),e=dE();function t(r,i){return n(r,i,function(s,o){return e(r,o)})}return dy=t,dy}var gy,ST;function VW(){if(ST)return gy;ST=1;var n=QA(),e=WE(),t=JE();function r(i){return t(e(i,void 0,n),i+"")}return gy=r,gy}var py,PT;function qW(){if(PT)return py;PT=1;var n=FW(),e=VW(),t=e(function(r,i){return r==null?{}:n(r,i)});return py=t,py}var my,ET;function GW(){if(ET)return my;ET=1;var n=Math.ceil,e=Math.max;function t(r,i,s,o){for(var a=-1,l=e(n((i-r)/(s||1)),0),c=Array(l);l--;)c[o?l:++a]=r,r+=s;return c}return my=t,my}var yy,AT;function HW(){if(AT)return yy;AT=1;var n=GW(),e=Mu(),t=WA();function r(i){return function(s,o,a){return a&&typeof a!="number"&&e(s,o,a)&&(o=a=void 0),s=t(s),o===void 0?(o=s,s=0):o=t(o),a=a===void 0?s<o?1:-1:t(a),n(s,o,a,i)}}return yy=r,yy}var vy,TT;function UW(){if(TT)return vy;TT=1;var n=HW(),e=n();return vy=e,vy}var by,OT;function WW(){if(OT)return by;OT=1;function n(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}return by=n,by}var wy,MT;function XW(){if(MT)return wy;MT=1;var n=uo();function e(t,r){if(t!==r){var i=t!==void 0,s=t===null,o=t===t,a=n(t),l=r!==void 0,c=r===null,u=r===r,h=n(r);if(!c&&!h&&!a&&t>r||a&&l&&u&&!c&&!h||s&&l&&u||!i&&u||!o)return 1;if(!s&&!a&&!h&&t<r||h&&i&&o&&!s&&!a||c&&i&&o||!l&&o||!u)return-1}return 0}return wy=e,wy}var xy,_T;function YW(){if(_T)return xy;_T=1;var n=XW();function e(t,r,i){for(var s=-1,o=t.criteria,a=r.criteria,l=o.length,c=i.length;++s<l;){var u=n(o[s],a[s]);if(u){if(s>=c)return u;var h=i[s];return u*(h=="desc"?-1:1)}}return t.index-r.index}return xy=e,xy}var Cy,NT;function KW(){if(NT)return Cy;NT=1;var n=Pu(),e=Au(),t=yr(),r=ME(),i=WW(),s=cl,o=YW(),a=Fi(),l=Qe;function c(u,h,f){h.length?h=n(h,function(p){return l(p)?function(b){return e(b,p.length===1?p[0]:p)}:p}):h=[a];var d=-1;h=n(h,s(t));var g=r(u,function(p,b,m){var y=n(h,function(v){return v(p)});return{criteria:y,index:++d,value:p}});return i(g,function(p,b){return o(p,b,f)})}return Cy=c,Cy}var Sy,kT;function JW(){if(kT)return Sy;kT=1;var n=Xp(),e=KW(),t=Tu(),r=Mu(),i=t(function(s,o){if(s==null)return[];var a=o.length;return a>1&&r(s,o[0],o[1])?o=[]:a>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),e(s,n(o,1),[])});return Sy=i,Sy}var Py,$T;function QW(){if($T)return Py;$T=1;var n=iE(),e=0;function t(r){var i=++e;return n(r)+i}return Py=t,Py}var Ey,IT;function ZW(){if(IT)return Ey;IT=1;function n(e,t,r){for(var i=-1,s=e.length,o=t.length,a={};++i<s;){var l=i<o?t[i]:void 0;r(a,e[i],l)}return a}return Ey=n,Ey}var Ay,LT;function e9(){if(LT)return Ay;LT=1;var n=ol,e=ZW();function t(r,i){return e(r||[],i||[],n)}return Ay=t,Ay}var _u;if(typeof Og=="function")try{_u={cloneDeep:Gv,constant:Ng(),defaults:yW(),each:EP(),filter:xE(),find:PW(),flatten:QA(),forEach:SP(),forIn:EW(),has:PE(),isUndefined:TE(),last:AW(),map:NE(),mapValues:TW(),max:MW(),merge:LW(),min:RW(),minBy:jW(),now:DW(),pick:qW(),range:UW(),reduce:LE(),sortBy:JW(),uniqueId:QW(),values:gA(),zipObject:e9()}}catch(n){}_u||(_u=window._);var ke=_u,t9=Nu;function Nu(){var n={};n._next=n._prev=n,this._sentinel=n}Nu.prototype.dequeue=function(){var n=this._sentinel,e=n._prev;if(e!==n)return RT(e),e},Nu.prototype.enqueue=function(n){var e=this._sentinel;n._prev&&n._next&&RT(n),n._next=e._next,e._next._prev=n,e._next=n,n._prev=e},Nu.prototype.toString=function(){for(var n=[],e=this._sentinel,t=e._prev;t!==e;)n.push(JSON.stringify(t,n9)),t=t._prev;return"["+n.join(", ")+"]"};function RT(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function n9(n,e){if(n!=="_next"&&n!=="_prev")return e}var vr=ke,r9=Mn.Graph,i9=t9,s9=a9,o9=vr.constant(1);function a9(n,e){if(n.nodeCount()<=1)return[];var t=c9(n,e||o9),r=l9(t.graph,t.buckets,t.zeroIdx);return vr.flatten(vr.map(r,function(i){return n.outEdges(i.v,i.w)}),!0)}function l9(n,e,t){for(var r=[],i=e[e.length-1],s=e[0],o;n.nodeCount();){for(;o=s.dequeue();)Ty(n,e,t,o);for(;o=i.dequeue();)Ty(n,e,t,o);if(n.nodeCount()){for(var a=e.length-2;a>0;--a)if(o=e[a].dequeue(),o){r=r.concat(Ty(n,e,t,o,!0));break}}}return r}function Ty(n,e,t,r,i){var s=i?[]:void 0;return vr.forEach(n.inEdges(r.v),function(o){var a=n.edge(o),l=n.node(o.v);i&&s.push({v:o.v,w:o.w}),l.out-=a,Oy(e,t,l)}),vr.forEach(n.outEdges(r.v),function(o){var a=n.edge(o),l=o.w,c=n.node(l);c.in-=a,Oy(e,t,c)}),n.removeNode(r.v),s}function c9(n,e){var t=new r9,r=0,i=0;vr.forEach(n.nodes(),function(a){t.setNode(a,{v:a,in:0,out:0})}),vr.forEach(n.edges(),function(a){var l=t.edge(a.v,a.w)||0,c=e(a),u=l+c;t.setEdge(a.v,a.w,u),i=Math.max(i,t.node(a.v).out+=c),r=Math.max(r,t.node(a.w).in+=c)});var s=vr.range(i+r+3).map(function(){return new i9}),o=r+1;return vr.forEach(t.nodes(),function(a){Oy(s,o,t.node(a))}),{graph:t,buckets:s,zeroIdx:o}}function Oy(n,e,t){t.out?t.in?n[t.out-t.in+e].enqueue(t):n[n.length-1].enqueue(t):n[0].enqueue(t)}var Vi=ke,u9=s9,h9={run:f9,undo:g9};function f9(n){var e=n.graph().acyclicer==="greedy"?u9(n,t(n)):d9(n);Vi.forEach(e,function(r){var i=n.edge(r);n.removeEdge(r),i.forwardName=r.name,i.reversed=!0,n.setEdge(r.w,r.v,i,Vi.uniqueId("rev"))});function t(r){return function(i){return r.edge(i).weight}}}function d9(n){var e=[],t={},r={};function i(s){Vi.has(r,s)||(r[s]=!0,t[s]=!0,Vi.forEach(n.outEdges(s),function(o){Vi.has(t,o.w)?e.push(o):i(o.w)}),delete t[s])}return Vi.forEach(n.nodes(),i),e}function g9(n){Vi.forEach(n.edges(),function(e){var t=n.edge(e);if(t.reversed){n.removeEdge(e);var r=t.forwardName;delete t.reversed,delete t.forwardName,n.setEdge(e.w,e.v,t,r)}})}var ge=ke,jT=Mn.Graph,Bt={addDummyNode:DT,simplify:p9,asNonCompoundGraph:m9,successorWeights:y9,predecessorWeights:v9,intersectRect:b9,buildLayerMatrix:w9,normalizeRanks:x9,removeEmptyRanks:C9,addBorderNode:S9,maxRank:BT,partition:P9,time:E9,notime:A9};function DT(n,e,t,r){var i;do i=ge.uniqueId(r);while(n.hasNode(i));return t.dummy=e,n.setNode(i,t),i}function p9(n){var e=new jT().setGraph(n.graph());return ge.forEach(n.nodes(),function(t){e.setNode(t,n.node(t))}),ge.forEach(n.edges(),function(t){var r=e.edge(t.v,t.w)||{weight:0,minlen:1},i=n.edge(t);e.setEdge(t.v,t.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),e}function m9(n){var e=new jT({multigraph:n.isMultigraph()}).setGraph(n.graph());return ge.forEach(n.nodes(),function(t){n.children(t).length||e.setNode(t,n.node(t))}),ge.forEach(n.edges(),function(t){e.setEdge(t,n.edge(t))}),e}function y9(n){var e=ge.map(n.nodes(),function(t){var r={};return ge.forEach(n.outEdges(t),function(i){r[i.w]=(r[i.w]||0)+n.edge(i).weight}),r});return ge.zipObject(n.nodes(),e)}function v9(n){var e=ge.map(n.nodes(),function(t){var r={};return ge.forEach(n.inEdges(t),function(i){r[i.v]=(r[i.v]||0)+n.edge(i).weight}),r});return ge.zipObject(n.nodes(),e)}function b9(n,e){var t=n.x,r=n.y,i=e.x-t,s=e.y-r,o=n.width/2,a=n.height/2;if(!i&&!s)throw new Error("Not possible to find intersection inside of the rectangle");var l,c;return Math.abs(s)*o>Math.abs(i)*a?(s<0&&(a=-a),l=a*i/s,c=a):(i<0&&(o=-o),l=o,c=o*s/i),{x:t+l,y:r+c}}function w9(n){var e=ge.map(ge.range(BT(n)+1),function(){return[]});return ge.forEach(n.nodes(),function(t){var r=n.node(t),i=r.rank;ge.isUndefined(i)||(e[i][r.order]=t)}),e}function x9(n){var e=ge.min(ge.map(n.nodes(),function(t){return n.node(t).rank}));ge.forEach(n.nodes(),function(t){var r=n.node(t);ge.has(r,"rank")&&(r.rank-=e)})}function C9(n){var e=ge.min(ge.map(n.nodes(),function(s){return n.node(s).rank})),t=[];ge.forEach(n.nodes(),function(s){var o=n.node(s).rank-e;t[o]||(t[o]=[]),t[o].push(s)});var r=0,i=n.graph().nodeRankFactor;ge.forEach(t,function(s,o){ge.isUndefined(s)&&o%i!==0?--r:r&&ge.forEach(s,function(a){n.node(a).rank+=r})})}function S9(n,e,t,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=t,i.order=r),DT(n,"border",i,e)}function BT(n){return ge.max(ge.map(n.nodes(),function(e){var t=n.node(e).rank;if(!ge.isUndefined(t))return t}))}function P9(n,e){var t={lhs:[],rhs:[]};return ge.forEach(n,function(r){e(r)?t.lhs.push(r):t.rhs.push(r)}),t}function E9(n,e){var t=ge.now();try{return e()}finally{console.log(n+" time: "+(ge.now()-t)+"ms")}}function A9(n,e){return e()}var zT=ke,T9=Bt,O9={run:M9,undo:N9};function M9(n){n.graph().dummyChains=[],zT.forEach(n.edges(),function(e){_9(n,e)})}function _9(n,e){var t=e.v,r=n.node(t).rank,i=e.w,s=n.node(i).rank,o=e.name,a=n.edge(e),l=a.labelRank;if(s!==r+1){n.removeEdge(e);var c,u,h;for(h=0,++r;r<s;++h,++r)a.points=[],u={width:0,height:0,edgeLabel:a,edgeObj:e,rank:r},c=T9.addDummyNode(n,"edge",u,"_d"),r===l&&(u.width=a.width,u.height=a.height,u.dummy="edge-label",u.labelpos=a.labelpos),n.setEdge(t,c,{weight:a.weight},o),h===0&&n.graph().dummyChains.push(c),t=c;n.setEdge(t,i,{weight:a.weight},o)}}function N9(n){zT.forEach(n.graph().dummyChains,function(e){var t=n.node(e),r=t.edgeLabel,i;for(n.setEdge(t.edgeObj,r);t.dummy;)i=n.successors(e)[0],n.removeNode(e),r.points.push({x:t.x,y:t.y}),t.dummy==="edge-label"&&(r.x=t.x,r.y=t.y,r.width=t.width,r.height=t.height),e=i,t=n.node(e)})}var ku=ke,$u={longestPath:k9,slack:$9};function k9(n){var e={};function t(r){var i=n.node(r);if(ku.has(e,r))return i.rank;e[r]=!0;var s=ku.min(ku.map(n.outEdges(r),function(o){return t(o.w)-n.edge(o).minlen}));return(s===Number.POSITIVE_INFINITY||s===void 0||s===null)&&(s=0),i.rank=s}ku.forEach(n.sources(),t)}function $9(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen}var Iu=ke,I9=Mn.Graph,Lu=$u.slack,FT=L9;function L9(n){var e=new I9({directed:!1}),t=n.nodes()[0],r=n.nodeCount();e.setNode(t,{});for(var i,s;R9(e,n)<r;)i=j9(e,n),s=e.hasNode(i.v)?Lu(n,i):-Lu(n,i),D9(e,n,s);return e}function R9(n,e){function t(r){Iu.forEach(e.nodeEdges(r),function(i){var s=i.v,o=r===s?i.w:s;!n.hasNode(o)&&!Lu(e,i)&&(n.setNode(o,{}),n.setEdge(r,o,{}),t(o))})}return Iu.forEach(n.nodes(),t),n.nodeCount()}function j9(n,e){return Iu.minBy(e.edges(),function(t){if(n.hasNode(t.v)!==n.hasNode(t.w))return Lu(e,t)})}function D9(n,e,t){Iu.forEach(n.nodes(),function(r){e.node(r).rank+=t})}var br=ke,B9=FT,z9=$u.slack,F9=$u.longestPath,V9=Mn.alg.preorder,q9=Mn.alg.postorder,G9=Bt.simplify,H9=qi;qi.initLowLimValues=_y,qi.initCutValues=My,qi.calcCutValue=VT,qi.leaveEdge=GT,qi.enterEdge=HT,qi.exchangeEdges=UT;function qi(n){n=G9(n),F9(n);var e=B9(n);_y(e),My(e,n);for(var t,r;t=GT(e);)r=HT(e,n,t),UT(e,n,t,r)}function My(n,e){var t=q9(n,n.nodes());t=t.slice(0,t.length-1),br.forEach(t,function(r){U9(n,e,r)})}function U9(n,e,t){var r=n.node(t),i=r.parent;n.edge(t,i).cutvalue=VT(n,e,t)}function VT(n,e,t){var r=n.node(t),i=r.parent,s=!0,o=e.edge(t,i),a=0;return o||(s=!1,o=e.edge(i,t)),a=o.weight,br.forEach(e.nodeEdges(t),function(l){var c=l.v===t,u=c?l.w:l.v;if(u!==i){var h=c===s,f=e.edge(l).weight;if(a+=h?f:-f,X9(n,t,u)){var d=n.edge(t,u).cutvalue;a+=h?-d:d}}}),a}function _y(n,e){arguments.length<2&&(e=n.nodes()[0]),qT(n,{},1,e)}function qT(n,e,t,r,i){var s=t,o=n.node(r);return e[r]=!0,br.forEach(n.neighbors(r),function(a){br.has(e,a)||(t=qT(n,e,t,a,r))}),o.low=s,o.lim=t++,i?o.parent=i:delete o.parent,t}function GT(n){return br.find(n.edges(),function(e){return n.edge(e).cutvalue<0})}function HT(n,e,t){var r=t.v,i=t.w;e.hasEdge(r,i)||(r=t.w,i=t.v);var s=n.node(r),o=n.node(i),a=s,l=!1;s.lim>o.lim&&(a=o,l=!0);var c=br.filter(e.edges(),function(u){return l===WT(n,n.node(u.v),a)&&l!==WT(n,n.node(u.w),a)});return br.minBy(c,function(u){return z9(e,u)})}function UT(n,e,t,r){var i=t.v,s=t.w;n.removeEdge(i,s),n.setEdge(r.v,r.w,{}),_y(n),My(n,e),W9(n,e)}function W9(n,e){var t=br.find(n.nodes(),function(i){return!e.node(i).parent}),r=V9(n,t);r=r.slice(1),br.forEach(r,function(i){var s=n.node(i).parent,o=e.edge(i,s),a=!1;o||(o=e.edge(s,i),a=!0),e.node(i).rank=e.node(s).rank+(a?o.minlen:-o.minlen)})}function X9(n,e,t){return n.hasEdge(e,t)}function WT(n,e,t){return t.low<=e.lim&&e.lim<=t.lim}var Y9=$u,XT=Y9.longestPath,K9=FT,J9=H9,Q9=Z9;function Z9(n){switch(n.graph().ranker){case"network-simplex":YT(n);break;case"tight-tree":t7(n);break;case"longest-path":e7(n);break;default:YT(n)}}var e7=XT;function t7(n){XT(n),K9(n)}function YT(n){J9(n)}var Ny=ke,n7=r7;function r7(n){var e=s7(n);Ny.forEach(n.graph().dummyChains,function(t){for(var r=n.node(t),i=r.edgeObj,s=i7(n,e,i.v,i.w),o=s.path,a=s.lca,l=0,c=o[l],u=!0;t!==i.w;){if(r=n.node(t),u){for(;(c=o[l])!==a&&n.node(c).maxRank<r.rank;)l++;c===a&&(u=!1)}if(!u){for(;l<o.length-1&&n.node(c=o[l+1]).minRank<=r.rank;)l++;c=o[l]}n.setParent(t,c),t=n.successors(t)[0]}})}function i7(n,e,t,r){var i=[],s=[],o=Math.min(e[t].low,e[r].low),a=Math.max(e[t].lim,e[r].lim),l,c;l=t;do l=n.parent(l),i.push(l);while(l&&(e[l].low>o||a>e[l].lim));for(c=l,l=r;(l=n.parent(l))!==c;)s.push(l);return{path:i.concat(s.reverse()),lca:c}}function s7(n){var e={},t=0;function r(i){var s=t;Ny.forEach(n.children(i),r),e[i]={low:s,lim:t++}}return Ny.forEach(n.children(),r),e}var wr=ke,ky=Bt,o7={run:a7,cleanup:u7};function a7(n){var e=ky.addDummyNode(n,"root",{},"_root"),t=l7(n),r=wr.max(wr.values(t))-1,i=2*r+1;n.graph().nestingRoot=e,wr.forEach(n.edges(),function(o){n.edge(o).minlen*=i});var s=c7(n)+1;wr.forEach(n.children(),function(o){KT(n,e,i,s,r,t,o)}),n.graph().nodeRankFactor=i}function KT(n,e,t,r,i,s,o){var a=n.children(o);if(!a.length){o!==e&&n.setEdge(e,o,{weight:0,minlen:t});return}var l=ky.addBorderNode(n,"_bt"),c=ky.addBorderNode(n,"_bb"),u=n.node(o);n.setParent(l,o),u.borderTop=l,n.setParent(c,o),u.borderBottom=c,wr.forEach(a,function(h){KT(n,e,t,r,i,s,h);var f=n.node(h),d=f.borderTop?f.borderTop:h,g=f.borderBottom?f.borderBottom:h,p=f.borderTop?r:2*r,b=d!==g?1:i-s[o]+1;n.setEdge(l,d,{weight:p,minlen:b,nestingEdge:!0}),n.setEdge(g,c,{weight:p,minlen:b,nestingEdge:!0})}),n.parent(o)||n.setEdge(e,l,{weight:0,minlen:i+s[o]})}function l7(n){var e={};function t(r,i){var s=n.children(r);s&&s.length&&wr.forEach(s,function(o){t(o,i+1)}),e[r]=i}return wr.forEach(n.children(),function(r){t(r,1)}),e}function c7(n){return wr.reduce(n.edges(),function(e,t){return e+n.edge(t).weight},0)}function u7(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,wr.forEach(n.edges(),function(t){var r=n.edge(t);r.nestingEdge&&n.removeEdge(t)})}var $y=ke,h7=Bt,f7=d7;function d7(n){function e(t){var r=n.children(t),i=n.node(t);if(r.length&&$y.forEach(r,e),$y.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var s=i.minRank,o=i.maxRank+1;s<o;++s)JT(n,"borderLeft","_bl",t,i,s),JT(n,"borderRight","_br",t,i,s)}}$y.forEach(n.children(),e)}function JT(n,e,t,r,i,s){var o={width:0,height:0,rank:s,borderType:e},a=i[e][s-1],l=h7.addDummyNode(n,"border",o,t);i[e][s]=l,n.setParent(l,r),a&&n.setEdge(a,l,{weight:1})}var Un=ke,g7={adjust:p7,undo:m7};function p7(n){var e=n.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&QT(n)}function m7(n){var e=n.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&y7(n),(e==="lr"||e==="rl")&&(v7(n),QT(n))}function QT(n){Un.forEach(n.nodes(),function(e){ZT(n.node(e))}),Un.forEach(n.edges(),function(e){ZT(n.edge(e))})}function ZT(n){var e=n.width;n.width=n.height,n.height=e}function y7(n){Un.forEach(n.nodes(),function(e){Iy(n.node(e))}),Un.forEach(n.edges(),function(e){var t=n.edge(e);Un.forEach(t.points,Iy),Un.has(t,"y")&&Iy(t)})}function Iy(n){n.y=-n.y}function v7(n){Un.forEach(n.nodes(),function(e){Ly(n.node(e))}),Un.forEach(n.edges(),function(e){var t=n.edge(e);Un.forEach(t.points,Ly),Un.has(t,"x")&&Ly(t)})}function Ly(n){var e=n.x;n.x=n.y,n.y=e}var xr=ke,b7=w7;function w7(n){var e={},t=xr.filter(n.nodes(),function(a){return!n.children(a).length}),r=xr.max(xr.map(t,function(a){return n.node(a).rank})),i=xr.map(xr.range(r+1),function(){return[]});function s(a){if(!xr.has(e,a)){e[a]=!0;var l=n.node(a);i[l.rank].push(a),xr.forEach(n.successors(a),s)}}var o=xr.sortBy(t,function(a){return n.node(a).rank});return xr.forEach(o,s),i}var ii=ke,x7=C7;function C7(n,e){for(var t=0,r=1;r<e.length;++r)t+=S7(n,e[r-1],e[r]);return t}function S7(n,e,t){for(var r=ii.zipObject(t,ii.map(t,function(c,u){return u})),i=ii.flatten(ii.map(e,function(c){return ii.sortBy(ii.map(n.outEdges(c),function(u){return{pos:r[u.w],weight:n.edge(u).weight}}),"pos")}),!0),s=1;s<t.length;)s<<=1;var o=2*s-1;s-=1;var a=ii.map(new Array(o),function(){return 0}),l=0;return ii.forEach(i.forEach(function(c){var u=c.pos+s;a[u]+=c.weight;for(var h=0;u>0;)u%2&&(h+=a[u+1]),u=u-1>>1,a[u]+=c.weight;l+=c.weight*h})),l}var eO=ke,P7=E7;function E7(n,e){return eO.map(e,function(t){var r=n.inEdges(t);if(r.length){var i=eO.reduce(r,function(s,o){var a=n.edge(o),l=n.node(o.v);return{sum:s.sum+a.weight*l.order,weight:s.weight+a.weight}},{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:t}})}var Yt=ke,A7=T7;function T7(n,e){var t={};Yt.forEach(n,function(i,s){var o=t[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:s};Yt.isUndefined(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),Yt.forEach(e.edges(),function(i){var s=t[i.v],o=t[i.w];!Yt.isUndefined(s)&&!Yt.isUndefined(o)&&(o.indegree++,s.out.push(t[i.w]))});var r=Yt.filter(t,function(i){return!i.indegree});return O7(r)}function O7(n){var e=[];function t(s){return function(o){o.merged||(Yt.isUndefined(o.barycenter)||Yt.isUndefined(s.barycenter)||o.barycenter>=s.barycenter)&&M7(s,o)}}function r(s){return function(o){o.in.push(s),--o.indegree===0&&n.push(o)}}for(;n.length;){var i=n.pop();e.push(i),Yt.forEach(i.in.reverse(),t(i)),Yt.forEach(i.out,r(i))}return Yt.map(Yt.filter(e,function(s){return!s.merged}),function(s){return Yt.pick(s,["vs","i","barycenter","weight"])})}function M7(n,e){var t=0,r=0;n.weight&&(t+=n.barycenter*n.weight,r+=n.weight),e.weight&&(t+=e.barycenter*e.weight,r+=e.weight),n.vs=e.vs.concat(n.vs),n.barycenter=t/r,n.weight=r,n.i=Math.min(e.i,n.i),e.merged=!0}var qa=ke,_7=Bt,N7=k7;function k7(n,e){var t=_7.partition(n,function(u){return qa.has(u,"barycenter")}),r=t.lhs,i=qa.sortBy(t.rhs,function(u){return-u.i}),s=[],o=0,a=0,l=0;r.sort($7(!!e)),l=tO(s,i,l),qa.forEach(r,function(u){l+=u.vs.length,s.push(u.vs),o+=u.barycenter*u.weight,a+=u.weight,l=tO(s,i,l)});var c={vs:qa.flatten(s,!0)};return a&&(c.barycenter=o/a,c.weight=a),c}function tO(n,e,t){for(var r;e.length&&(r=qa.last(e)).i<=t;)e.pop(),n.push(r.vs),t++;return t}function $7(n){return function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:n?t.i-e.i:e.i-t.i}}var si=ke,I7=P7,L7=A7,R7=N7,j7=nO;function nO(n,e,t,r){var i=n.children(e),s=n.node(e),o=s?s.borderLeft:void 0,a=s?s.borderRight:void 0,l={};o&&(i=si.filter(i,function(g){return g!==o&&g!==a}));var c=I7(n,i);si.forEach(c,function(g){if(n.children(g.v).length){var p=nO(n,g.v,t,r);l[g.v]=p,si.has(p,"barycenter")&&B7(g,p)}});var u=L7(c,t);D7(u,l);var h=R7(u,r);if(o&&(h.vs=si.flatten([o,h.vs,a],!0),n.predecessors(o).length)){var f=n.node(n.predecessors(o)[0]),d=n.node(n.predecessors(a)[0]);si.has(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+f.order+d.order)/(h.weight+2),h.weight+=2}return h}function D7(n,e){si.forEach(n,function(t){t.vs=si.flatten(t.vs.map(function(r){return e[r]?e[r].vs:r}),!0)})}function B7(n,e){si.isUndefined(n.barycenter)?(n.barycenter=e.barycenter,n.weight=e.weight):(n.barycenter=(n.barycenter*n.weight+e.barycenter*e.weight)/(n.weight+e.weight),n.weight+=e.weight)}var Ga=ke,z7=Mn.Graph,F7=V7;function V7(n,e,t){var r=q7(n),i=new z7({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(s){return n.node(s)});return Ga.forEach(n.nodes(),function(s){var o=n.node(s),a=n.parent(s);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(s),i.setParent(s,a||r),Ga.forEach(n[t](s),function(l){var c=l.v===s?l.w:l.v,u=i.edge(c,s),h=Ga.isUndefined(u)?0:u.weight;i.setEdge(c,s,{weight:n.edge(l).weight+h})}),Ga.has(o,"minRank")&&i.setNode(s,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),i}function q7(n){for(var e;n.hasNode(e=Ga.uniqueId("_root")););return e}var G7=ke,H7=U7;function U7(n,e,t){var r={},i;G7.forEach(t,function(s){for(var o=n.parent(s),a,l;o;){if(a=n.parent(o),a?(l=r[a],r[a]=o):(l=i,i=o),l&&l!==o){e.setEdge(l,o);return}o=a}})}var oi=ke,W7=b7,X7=x7,Y7=j7,K7=F7,J7=H7,Q7=Mn.Graph,rO=Bt,Z7=eX;function eX(n){var e=rO.maxRank(n),t=iO(n,oi.range(1,e+1),"inEdges"),r=iO(n,oi.range(e-1,-1,-1),"outEdges"),i=W7(n);sO(n,i);for(var s=Number.POSITIVE_INFINITY,o,a=0,l=0;l<4;++a,++l){tX(a%2?t:r,a%4>=2),i=rO.buildLayerMatrix(n);var c=X7(n,i);c<s&&(l=0,o=oi.cloneDeep(i),s=c)}sO(n,o)}function iO(n,e,t){return oi.map(e,function(r){return K7(n,r,t)})}function tX(n,e){var t=new Q7;oi.forEach(n,function(r){var i=r.graph().root,s=Y7(r,i,t,e);oi.forEach(s.vs,function(o,a){r.node(o).order=a}),J7(r,t,s.vs)})}function sO(n,e){oi.forEach(e,function(t){oi.forEach(t,function(r,i){n.node(r).order=i})})}var se=ke,nX=Mn.Graph,rX=Bt,iX={positionX:aX,findType1Conflicts:oO,findType2Conflicts:aO,addConflict:Ry,hasConflict:lO,verticalAlignment:cO,horizontalCompaction:uO,alignCoordinates:fO,findSmallestWidthAlignment:hO,balance:dO};function oO(n,e){var t={};function r(i,s){var o=0,a=0,l=i.length,c=se.last(s);return se.forEach(s,function(u,h){var f=sX(n,u),d=f?n.node(f).order:l;(f||u===c)&&(se.forEach(s.slice(a,h+1),function(g){se.forEach(n.predecessors(g),function(p){var b=n.node(p),m=b.order;(m<o||d<m)&&!(b.dummy&&n.node(g).dummy)&&Ry(t,p,g)})}),a=h+1,o=d)}),s}return se.reduce(e,r),t}function aO(n,e){var t={};function r(s,o,a,l,c){var u;se.forEach(se.range(o,a),function(h){u=s[h],n.node(u).dummy&&se.forEach(n.predecessors(u),function(f){var d=n.node(f);d.dummy&&(d.order<l||d.order>c)&&Ry(t,f,u)})})}function i(s,o){var a=-1,l,c=0;return se.forEach(o,function(u,h){if(n.node(u).dummy==="border"){var f=n.predecessors(u);f.length&&(l=n.node(f[0]).order,r(o,c,h,a,l),c=h,a=l)}r(o,c,o.length,l,s.length)}),o}return se.reduce(e,i),t}function sX(n,e){if(n.node(e).dummy)return se.find(n.predecessors(e),function(t){return n.node(t).dummy})}function Ry(n,e,t){if(e>t){var r=e;e=t,t=r}var i=n[e];i||(n[e]=i={}),i[t]=!0}function lO(n,e,t){if(e>t){var r=e;e=t,t=r}return se.has(n[e],t)}function cO(n,e,t,r){var i={},s={},o={};return se.forEach(e,function(a){se.forEach(a,function(l,c){i[l]=l,s[l]=l,o[l]=c})}),se.forEach(e,function(a){var l=-1;se.forEach(a,function(c){var u=r(c);if(u.length){u=se.sortBy(u,function(p){return o[p]});for(var h=(u.length-1)/2,f=Math.floor(h),d=Math.ceil(h);f<=d;++f){var g=u[f];s[c]===c&&l<o[g]&&!lO(t,c,g)&&(s[g]=c,s[c]=i[c]=i[g],l=o[g])}}})}),{root:i,align:s}}function uO(n,e,t,r,i){var s={},o=oX(n,e,t,i),a=i?"borderLeft":"borderRight";function l(h,f){for(var d=o.nodes(),g=d.pop(),p={};g;)p[g]?h(g):(p[g]=!0,d.push(g),d=d.concat(f(g))),g=d.pop()}function c(h){s[h]=o.inEdges(h).reduce(function(f,d){return Math.max(f,s[d.v]+o.edge(d))},0)}function u(h){var f=o.outEdges(h).reduce(function(g,p){return Math.min(g,s[p.w]-o.edge(p))},Number.POSITIVE_INFINITY),d=n.node(h);f!==Number.POSITIVE_INFINITY&&d.borderType!==a&&(s[h]=Math.max(s[h],f))}return l(c,o.predecessors.bind(o)),l(u,o.successors.bind(o)),se.forEach(r,function(h){s[h]=s[t[h]]}),s}function oX(n,e,t,r){var i=new nX,s=n.graph(),o=lX(s.nodesep,s.edgesep,r);return se.forEach(e,function(a){var l;se.forEach(a,function(c){var u=t[c];if(i.setNode(u),l){var h=t[l],f=i.edge(h,u);i.setEdge(h,u,Math.max(o(n,c,l),f||0))}l=c})}),i}function hO(n,e){return se.minBy(se.values(e),function(t){var r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return se.forIn(t,function(s,o){var a=cX(n,o)/2;r=Math.max(s+a,r),i=Math.min(s-a,i)}),r-i})}function fO(n,e){var t=se.values(e),r=se.min(t),i=se.max(t);se.forEach(["u","d"],function(s){se.forEach(["l","r"],function(o){var a=s+o,l=n[a],c;if(l!==e){var u=se.values(l);c=o==="l"?r-se.min(u):i-se.max(u),c&&(n[a]=se.mapValues(l,function(h){return h+c}))}})})}function dO(n,e){return se.mapValues(n.ul,function(t,r){if(e)return n[e.toLowerCase()][r];var i=se.sortBy(se.map(n,r));return(i[1]+i[2])/2})}function aX(n){var e=rX.buildLayerMatrix(n),t=se.merge(oO(n,e),aO(n,e)),r={},i;se.forEach(["u","d"],function(o){i=o==="u"?e:se.values(e).reverse(),se.forEach(["l","r"],function(a){a==="r"&&(i=se.map(i,function(h){return se.values(h).reverse()}));var l=(o==="u"?n.predecessors:n.successors).bind(n),c=cO(n,i,t,l),u=uO(n,i,c.root,c.align,a==="r");a==="r"&&(u=se.mapValues(u,function(h){return-h})),r[o+a]=u})});var s=hO(n,r);return fO(r,s),dO(r,n.graph().align)}function lX(n,e,t){return function(r,i,s){var o=r.node(i),a=r.node(s),l=0,c;if(l+=o.width/2,se.has(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":c=-o.width/2;break;case"r":c=o.width/2;break}if(c&&(l+=t?c:-c),c=0,l+=(o.dummy?e:n)/2,l+=(a.dummy?e:n)/2,l+=a.width/2,se.has(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":c=a.width/2;break;case"r":c=-a.width/2;break}return c&&(l+=t?c:-c),c=0,l}}function cX(n,e){return n.node(e).width}var Ha=ke,gO=Bt,uX=iX.positionX,hX=fX;function fX(n){n=gO.asNonCompoundGraph(n),dX(n),Ha.forEach(uX(n),function(e,t){n.node(t).x=e})}function dX(n){var e=gO.buildLayerMatrix(n),t=n.graph().ranksep,r=0;Ha.forEach(e,function(i){var s=Ha.max(Ha.map(i,function(o){return n.node(o).height}));Ha.forEach(i,function(o){n.node(o).y=r+s/2}),r+=s+t})}var ae=ke,pO=h9,mO=O9,gX=Q9,pX=Bt.normalizeRanks,mX=n7,yX=Bt.removeEmptyRanks,yO=o7,vX=f7,vO=g7,bX=Z7,wX=hX,ai=Bt,xX=Mn.Graph,CX=SX;function SX(n,e){var t=e&&e.debugTiming?ai.time:ai.notime;t("layout",function(){var r=t(" buildLayoutGraph",function(){return IX(n)});t(" runLayout",function(){PX(r,t)}),t(" updateInputGraph",function(){EX(n,r)})})}function PX(n,e){e(" makeSpaceForEdgeLabels",function(){LX(n)}),e(" removeSelfEdges",function(){GX(n)}),e(" acyclic",function(){pO.run(n)}),e(" nestingGraph.run",function(){yO.run(n)}),e(" rank",function(){gX(ai.asNonCompoundGraph(n))}),e(" injectEdgeLabelProxies",function(){RX(n)}),e(" removeEmptyRanks",function(){yX(n)}),e(" nestingGraph.cleanup",function(){yO.cleanup(n)}),e(" normalizeRanks",function(){pX(n)}),e(" assignRankMinMax",function(){jX(n)}),e(" removeEdgeLabelProxies",function(){DX(n)}),e(" normalize.run",function(){mO.run(n)}),e(" parentDummyChains",function(){mX(n)}),e(" addBorderSegments",function(){vX(n)}),e(" order",function(){bX(n)}),e(" insertSelfEdges",function(){HX(n)}),e(" adjustCoordinateSystem",function(){vO.adjust(n)}),e(" position",function(){wX(n)}),e(" positionSelfEdges",function(){UX(n)}),e(" removeBorderNodes",function(){qX(n)}),e(" normalize.undo",function(){mO.undo(n)}),e(" fixupEdgeLabelCoords",function(){FX(n)}),e(" undoCoordinateSystem",function(){vO.undo(n)}),e(" translateGraph",function(){BX(n)}),e(" assignNodeIntersects",function(){zX(n)}),e(" reversePoints",function(){VX(n)}),e(" acyclic.undo",function(){pO.undo(n)})}function EX(n,e){ae.forEach(n.nodes(),function(t){var r=n.node(t),i=e.node(t);r&&(r.x=i.x,r.y=i.y,e.children(t).length&&(r.width=i.width,r.height=i.height))}),ae.forEach(n.edges(),function(t){var r=n.edge(t),i=e.edge(t);r.points=i.points,ae.has(i,"x")&&(r.x=i.x,r.y=i.y)}),n.graph().width=e.graph().width,n.graph().height=e.graph().height}var AX=["nodesep","edgesep","ranksep","marginx","marginy"],TX={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},OX=["acyclicer","ranker","rankdir","align"],MX=["width","height"],_X={width:0,height:0},NX=["minlen","weight","width","height","labeloffset"],kX={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},$X=["labelpos"];function IX(n){var e=new xX({multigraph:!0,compound:!0}),t=Dy(n.graph());return e.setGraph(ae.merge({},TX,jy(t,AX),ae.pick(t,OX))),ae.forEach(n.nodes(),function(r){var i=Dy(n.node(r));e.setNode(r,ae.defaults(jy(i,MX),_X)),e.setParent(r,n.parent(r))}),ae.forEach(n.edges(),function(r){var i=Dy(n.edge(r));e.setEdge(r,ae.merge({},kX,jy(i,NX),ae.pick(i,$X)))}),e}function LX(n){var e=n.graph();e.ranksep/=2,ae.forEach(n.edges(),function(t){var r=n.edge(t);r.minlen*=2,r.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function RX(n){ae.forEach(n.edges(),function(e){var t=n.edge(e);if(t.width&&t.height){var r=n.node(e.v),i=n.node(e.w),s={rank:(i.rank-r.rank)/2+r.rank,e};ai.addDummyNode(n,"edge-proxy",s,"_ep")}})}function jX(n){var e=0;ae.forEach(n.nodes(),function(t){var r=n.node(t);r.borderTop&&(r.minRank=n.node(r.borderTop).rank,r.maxRank=n.node(r.borderBottom).rank,e=ae.max(e,r.maxRank))}),n.graph().maxRank=e}function DX(n){ae.forEach(n.nodes(),function(e){var t=n.node(e);t.dummy==="edge-proxy"&&(n.edge(t.e).labelRank=t.rank,n.removeNode(e))})}function BX(n){var e=Number.POSITIVE_INFINITY,t=0,r=Number.POSITIVE_INFINITY,i=0,s=n.graph(),o=s.marginx||0,a=s.marginy||0;function l(c){var u=c.x,h=c.y,f=c.width,d=c.height;e=Math.min(e,u-f/2),t=Math.max(t,u+f/2),r=Math.min(r,h-d/2),i=Math.max(i,h+d/2)}ae.forEach(n.nodes(),function(c){l(n.node(c))}),ae.forEach(n.edges(),function(c){var u=n.edge(c);ae.has(u,"x")&&l(u)}),e-=o,r-=a,ae.forEach(n.nodes(),function(c){var u=n.node(c);u.x-=e,u.y-=r}),ae.forEach(n.edges(),function(c){var u=n.edge(c);ae.forEach(u.points,function(h){h.x-=e,h.y-=r}),ae.has(u,"x")&&(u.x-=e),ae.has(u,"y")&&(u.y-=r)}),s.width=t-e+o,s.height=i-r+a}function zX(n){ae.forEach(n.edges(),function(e){var t=n.edge(e),r=n.node(e.v),i=n.node(e.w),s,o;t.points?(s=t.points[0],o=t.points[t.points.length-1]):(t.points=[],s=i,o=r),t.points.unshift(ai.intersectRect(r,s)),t.points.push(ai.intersectRect(i,o))})}function FX(n){ae.forEach(n.edges(),function(e){var t=n.edge(e);if(ae.has(t,"x"))switch((t.labelpos==="l"||t.labelpos==="r")&&(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset;break}})}function VX(n){ae.forEach(n.edges(),function(e){var t=n.edge(e);t.reversed&&t.points.reverse()})}function qX(n){ae.forEach(n.nodes(),function(e){if(n.children(e).length){var t=n.node(e),r=n.node(t.borderTop),i=n.node(t.borderBottom),s=n.node(ae.last(t.borderLeft)),o=n.node(ae.last(t.borderRight));t.width=Math.abs(o.x-s.x),t.height=Math.abs(i.y-r.y),t.x=s.x+t.width/2,t.y=r.y+t.height/2}}),ae.forEach(n.nodes(),function(e){n.node(e).dummy==="border"&&n.removeNode(e)})}function GX(n){ae.forEach(n.edges(),function(e){if(e.v===e.w){var t=n.node(e.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e,label:n.edge(e)}),n.removeEdge(e)}})}function HX(n){var e=ai.buildLayerMatrix(n);ae.forEach(e,function(t){var r=0;ae.forEach(t,function(i,s){var o=n.node(i);o.order=s+r,ae.forEach(o.selfEdges,function(a){ai.addDummyNode(n,"selfedge",{width:a.label.width,height:a.label.height,rank:o.rank,order:s+ ++r,e:a.e,label:a.label},"_se")}),delete o.selfEdges})})}function UX(n){ae.forEach(n.nodes(),function(e){var t=n.node(e);if(t.dummy==="selfedge"){var r=n.node(t.e.v),i=r.x+r.width/2,s=r.y,o=t.x-i,a=r.height/2;n.setEdge(t.e,t.label),n.removeNode(e),t.label.points=[{x:i+2*o/3,y:s-a},{x:i+5*o/6,y:s-a},{x:i+o,y:s},{x:i+5*o/6,y:s+a},{x:i+2*o/3,y:s+a}],t.label.x=t.x,t.label.y=t.y}})}function jy(n,e){return ae.mapValues(ae.pick(n,e),Number)}function Dy(n){var e={};return ae.forEach(n,function(t,r){e[r.toLowerCase()]=t}),e}var Ru=ke,WX=Bt,XX=Mn.Graph,YX={debugOrdering:KX};function KX(n){var e=WX.buildLayerMatrix(n),t=new XX({compound:!0,multigraph:!0}).setGraph({});return Ru.forEach(n.nodes(),function(r){t.setNode(r,{label:r}),t.setParent(r,"layer"+n.node(r).rank)}),Ru.forEach(n.edges(),function(r){t.setEdge(r.v,r.w,{},r.name)}),Ru.forEach(e,function(r,i){var s="layer"+i;t.setNode(s,{rank:"same"}),Ru.reduce(r,function(o,a){return t.setEdge(o,a,{style:"invis"}),a})}),t}var JX="0.8.5",QX={graphlib:Mn,layout:CX,debug:YX,util:{time:Bt.time,notime:Bt.notime},version:JX};const ju=Xy(QX),{groupBy:ZX,reduce:eY,uniq:tY,uniqBy:bO}=Hu,nY={ER:"er-rect",EDGE:"edge"},li=()=>Qa.useTranslation("graph-collection-manager"),wO=(n,e)=>{const t=[],r=i=>{const s=n==null?void 0:n.find(o=>o.name===i);if(s){const{inherits:o}=s;if(o)for(let a=0;a<o.length;a++){const l=o[a];t.push(l),r(l)}}return tY(t)};return r(e)},rY=(n,e)=>{const t=[],r=i=>(n.filter(o=>{var a;return(a=o.inherits)==null?void 0:a.includes(i)}).forEach(o=>{const a=o.name;return t.push(o),r(a)}),t);return r(e)},xO=n=>{const e=[],t=[],r=n.map((o,a)=>{const l=[],c=[...o.fields],u=wO(n,o.name),h=eY(u,(d,g)=>{var m;const p=d,b=(m=n.find(y=>y.name===g))==null?void 0:m.fields.map(y=>$e(re({},y),{sourceCollectionName:o.name}));return b?p.concat(b):p},[]);bO(c.concat(h),"name").forEach(d=>{d.uiSchema&&l.push(re({id:d.name,group:"list"},d)),["obo","oho","o2o","o2m","m2o","m2m","linkTo"].includes(d.interface)&&e.push(d)}),t.push(o.name);const f=iY(l);return{id:o.name,shape:nY.ER,name:o.name,title:o.title,width:250,ports:[...f.initPorts||[],...f.morePorts||[]],item:o}}),i=oY(e,t,r),s=sY(n);return{nodesData:r,edgesData:i,inheritEdges:s}},iY=n=>ZX(n,t=>t.isForeignKey||t.primaryKey||["obo","oho","o2o","o2m","m2o","m2m","linkTo","id"].includes(t.interface)?"initPorts":"morePorts"),sY=n=>{const e={attrs:{line:{strokeWidth:1,textAnchor:"middle",textVerticalAnchor:"middle",stroke:"#ddd",sourceMarker:null}},router:{name:"smooth",args:{direction:"H"}},labels:[{markup:[{tagName:"ellipse",selector:"labelBody",style:{cursor:"pointer"}},{tagName:"text",selector:"labelText",style:{cursor:"pointer"}}],attrs:{labelText:{text:"inherits",fill:"rgba(0, 0, 0, 0.3)",textAnchor:"middle",textVerticalAnchor:"middle"},labelBody:{ref:"labelText",refWidth:"100%",refHeight:"100%",fill:"var(--nb-box-bg)"}},position:{distance:.5,args:{keepGradient:!0,ensureLegibility:!0}}}]},t=[];return n.forEach(r=>{const i=r.inherits||[];i.length&&i.forEach(s=>{t.push(re({id:r.name+s,source:{cell:r.name,connectionPoint:"rect"},target:{cell:s,connectionPoint:"rect"},connector:{name:"normal",zIndex:1e3},connectionType:"inherited"},e))})}),t},oY=(n,e,t)=>{var i,s,o,a,l,c,u;const r=[];for(let h=0;h<n.length;h++)if(e.includes(n[h].target)){const f=t.find(b=>b.name===n[h].target),d=t.find(b=>b.name===(n[h].sourceCollectionName||n[h].collectionName)),g={attrs:{line:{strokeWidth:1,textAnchor:"middle",textVerticalAnchor:"middle",stroke:"#ddd",sourceMarker:null,targetMarker:null}},router:d.id===f.id?{name:"oneSide",args:{side:"left"}}:{name:"er",args:{direction:"H"}},labels:[{markup:[{tagName:"ellipse",selector:"labelBody",style:{cursor:"pointer"}},{tagName:"text",selector:"labelText",style:{cursor:"pointer"}}],attrs:{labelText:{text:CO(n[h].interface)[0],fill:"rgba(0, 0, 0, 0.3)",textAnchor:"middle",textVerticalAnchor:"middle"},labelBody:{ref:"labelText",refWidth:"100%",refHeight:"100%",stroke:"#ddd",fill:"var(--nb-box-bg)",strokeWidth:1,rx:10,ry:10}},position:{distance:.3,args:{keepGradient:!0,ensureLegibility:!0}}},{markup:[{tagName:"ellipse",selector:"labelBody",style:{cursor:"pointer"}},{tagName:"text",selector:"labelText",style:{cursor:"pointer"}}],attrs:{labelText:{text:CO(n[h].interface)[1],fill:"rgba(0, 0, 0, 0.3)",textAnchor:"middle",textVerticalAnchor:"middle"},labelBody:{ref:"labelText",refWidth:"100%",refHeight:"100%",stroke:"#ddd",fill:"var(--nb-box-bg)",rx:10,ry:10,strokeWidth:1}},position:{distance:.7,args:{keepGradient:!0,ensureLegibility:!0}}}],connector:{name:"normal",zIndex:1e3}},p=b=>{const m=r.find(y=>y.id===b);return m?(m.associated.push(n[h].name),!1):!0};if(["m2m","linkTo"].includes(n[h].interface)){const b=t.find(m=>m.name===n[h].through);if(b){const m=d.id,y=b.id,v=(i=d.ports.find(T=>T.name===n[h].sourceKey))==null?void 0:i.id,w=(s=b.ports.find(T=>T.name===n[h].foreignKey))==null?void 0:s.id,x=f.id,C=b.id,S=(o=f.ports.find(T=>T.name===n[h].targetKey))==null?void 0:o.id,E=(a=b.ports.find(T=>T.name===n[h].otherKey))==null?void 0:a.id,A=m+v+y+w,O=x+S+C+E;r.push(re({id:A,source:{cell:m,port:v,anchor:{name:"right"}},target:{cell:y,port:w,anchor:{name:"left"}},associated:[n[h].name],m2m:[A,O]},g)),r.push(re({id:O,source:{cell:x,port:S,anchor:{name:"right"}},target:{cell:C,port:E,anchor:{name:"left"}},associated:[n[h].name],m2m:[A,O]},g))}}else{const b=t.find(T=>T.name==(n[h].sourceCollectionName||n[h].collectionName)).ports.find(T=>T.name===n[h].foreignKey),m=d.id,y=f.id,v=b==null?void 0:b.id,w=(l=f.ports.find(T=>T.name===n[h].targetKey))==null?void 0:l.id,x=d.id,C=f.id,S=(c=d.ports.find(T=>T.name===n[h].sourceKey))==null?void 0:c.id,E=(u=f.ports.find(T=>T.name===n[h].foreignKey))==null?void 0:u.id,A=m+v+y+w,O=x+S+C+E;p(y+w+m+v)&&b&&w&&r.push(re({id:A,source:{cell:m,port:v,anchor:{name:"right"}},target:{cell:y,port:w,anchor:{name:"left"}},associated:[n[h].name]},g)),p(C+E+x+S)&&S&&E&&r.push(re({id:O,source:{cell:x,port:S,anchor:{name:"right"}},target:{cell:C,port:E,anchor:{name:"left"}},associated:[n[h].name]},g))}}return bO(r,"id")},CO=n=>{switch(n){case"m2m":case"linkTo":return["1","N"];case"o2m":return["1","N"];case"m2o":return["N","1"];case"obo":case"oho":return["1","1"];default:return[]}},aY=(n,e)=>{const t=[],r=n.length,i=e.length;for(let s=0;s<r;s++)if(!e.find(o=>o.id===n[s].id))t.push({status:"add",node:n[s]});else{const o=e.find(c=>c.id===n[s].id),a=o==null?void 0:o.ports.items,l=n[s].ports;if(o){for(let c=0;c<l.length;c++)a.find(u=>u.id===l[c].id)||t.push({status:"insertPort",node:n[s],port:{index:c,port:l[c]}});for(let c=0;c<a.length;c++)l.find(u=>u.id===a[c].id)||t.push({status:"deletePort",node:n[s],port:a[c]});o.title!==n[s].title&&t.push({status:"updateNode",node:n[s]})}}for(let s=0;s<i;s++)n.find(o=>o.id===e[s].id)||t.push({status:"delete",node:e[s]});return t},SO=(n,e)=>{const t=n.length,r=e==null?void 0:e.length,i=[];for(let s=0;s<t;s++)e.find(o=>o.id===n[s].id)||i.push({status:"add",edge:n[s]});for(let s=0;s<r;s++)n.find(o=>o.id===e[s].id)||i.push({status:"delete",edge:e[s]});return i};let Du;const nt=()=>Du||(Du=document.getElementById("graph_container")),lY=()=>{Du=null},cY=({item:n})=>_.jsx(L.AddCollection,{trigger:["click"],align:{overflow:{adjustY:!1}},item:n,scope:{useCancelAction:Xn},getContainer:nt,children:_.jsx(ce.Button,{type:"primary",children:_.jsx(_e.PlusOutlined,{})})}),uY=n=>{const{onClick:e}=n,{t}=li(),r=[{key:Xa.Both,label:"All relationships"},{key:Xa.Entity,label:"Entity relationship only"},{key:Xa.Inherit,label:"Inheritance relationship only"}],i=_.jsx("div",{children:_.jsx(ce.Menu,{defaultSelectedKeys:[Xa.Both],selectable:!0,className:Cr.css`
447
+ `+s.stack}return{value:n,source:e,stack:i,digest:null}}function Jd(n,e,t){return{value:n,source:null,stack:t!=null?t:null,digest:e!=null?e:null}}function Qd(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var LH=typeof WeakMap=="function"?WeakMap:Map;function mS(n,e,t){t=gr(-1,t),t.tag=3,t.payload={element:null};var r=e.value;return t.callback=function(){lu||(lu=!0,dg=r),Qd(n,e)},t}function yS(n,e,t){t=gr(-1,t),t.tag=3;var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;t.payload=function(){return r(i)},t.callback=function(){Qd(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){Qd(n,e),typeof r!="function"&&(Zr===null?Zr=new Set([this]):Zr.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function vS(n,e,t){var r=n.pingCache;if(r===null){r=n.pingCache=new LH;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(t)||(i.add(t),n=YH.bind(null,n,e,t),e.then(n,n))}function bS(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function wS(n,e,t,r,i){return n.mode&1?(n.flags|=65536,n.lanes=i,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=gr(-1,1),e.tag=2,Jr(t,e,1))),t.lanes|=1),n)}var RH=lr.ReactCurrentOwner,Rt=!1;function _t(n,e,t,r){e.child=n===null?WC(e,null,t,r):no(e,n.child,t,r)}function xS(n,e,t,r,i){t=t.render;var s=e.ref;return to(e,i),r=Hd(n,e,t,r,s,i),t=Ud(),n!==null&&!Rt?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,pr(n,e,i)):(Ne&&t&&Ad(e),e.flags|=1,_t(n,e,r,i),e.child)}function CS(n,e,t,r,i){if(n===null){var s=t.type;return typeof s=="function"&&!wg(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,SS(n,e,s,r,i)):(n=gu(t.type,null,r,e,e.mode,i),n.ref=e.ref,n.return=e,e.child=n)}if(s=n.child,!(n.lanes&i)){var o=s.memoizedProps;if(t=t.compare,t=t!==null?t:Ca,t(o,r)&&n.ref===e.ref)return pr(n,e,i)}return e.flags|=1,n=ri(s,r),n.ref=e.ref,n.return=e,e.child=n}function SS(n,e,t,r,i){if(n!==null){var s=n.memoizedProps;if(Ca(s,r)&&n.ref===e.ref)if(Rt=!1,e.pendingProps=r=s,(n.lanes&i)!==0)n.flags&131072&&(Rt=!0);else return e.lanes=n.lanes,pr(n,e,i)}return Zd(n,e,t,r,i)}function PS(n,e,t){var r=e.pendingProps,i=r.children,s=n!==null?n.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ae(oo,Xt),Xt|=t;else{if(!(t&1073741824))return n=s!==null?s.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,Ae(oo,Xt),Xt|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:t,Ae(oo,Xt),Xt|=r}else s!==null?(r=s.baseLanes|t,e.memoizedState=null):r=t,Ae(oo,Xt),Xt|=r;return _t(n,e,i,t),e.child}function ES(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function Zd(n,e,t,r,i){var s=Lt(t)?_i:Ct.current;return s=Ks(e,s),to(e,i),t=Hd(n,e,t,r,s,i),r=Ud(),n!==null&&!Rt?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,pr(n,e,i)):(Ne&&r&&Ad(e),e.flags|=1,_t(n,e,t,i),e.child)}function AS(n,e,t,r,i){if(Lt(t)){var s=!0;Bc(e)}else s=!1;if(to(e,i),e.stateNode===null)ru(n,e),qC(e,t,r),Dd(e,t,r,i),r=!0;else if(n===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,c=t.contextType;typeof c=="object"&&c!==null?c=cn(c):(c=Lt(t)?_i:Ct.current,c=Ks(e,c));var u=t.getDerivedStateFromProps,h=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&GC(e,o,r,c),Kr=!1;var f=e.memoizedState;o.state=f,Wc(e,r,o,i),l=e.memoizedState,a!==r||f!==l||It.current||Kr?(typeof u=="function"&&(jd(e,t,u,r),l=e.memoizedState),(a=Kr||VC(e,t,a,r,f,l,c))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,DC(n,e),a=e.memoizedProps,c=e.type===e.elementType?a:En(e.type,a),o.props=c,h=e.pendingProps,f=o.context,l=t.contextType,typeof l=="object"&&l!==null?l=cn(l):(l=Lt(t)?_i:Ct.current,l=Ks(e,l));var d=t.getDerivedStateFromProps;(u=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||f!==l)&&GC(e,o,r,l),Kr=!1,f=e.memoizedState,o.state=f,Wc(e,r,o,i);var g=e.memoizedState;a!==h||f!==g||It.current||Kr?(typeof d=="function"&&(jd(e,t,d,r),g=e.memoizedState),(c=Kr||VC(e,t,c,r,f,g,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&f===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&f===n.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=g),o.props=r,o.state=g,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&f===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&f===n.memoizedState||(e.flags|=1024),r=!1)}return eg(n,e,t,r,s,i)}function eg(n,e,t,r,i,s){ES(n,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&_C(e,t,!1),pr(n,e,s);r=e.stateNode,RH.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,n!==null&&o?(e.child=no(e,n.child,null,s),e.child=no(e,null,a,s)):_t(n,e,a,s),e.memoizedState=r.state,i&&_C(e,t,!0),e.child}function TS(n){var e=n.stateNode;e.pendingContext?OC(n,e.pendingContext,e.pendingContext!==e.context):e.context&&OC(n,e.context,!1),Bd(n,e.containerInfo)}function OS(n,e,t,r,i){return Zs(),_d(i),e.flags|=256,_t(n,e,t,r),e.child}var tg={dehydrated:null,treeContext:null,retryLane:0};function ng(n){return{baseLanes:n,cachePool:null,transitions:null}}function MS(n,e,t){var r=e.pendingProps,i=Re.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=n!==null&&n.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(i|=1),Ae(Re,i&1),n===null)return Md(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,n=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=pu(o,r,0,null),n=zi(n,r,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=ng(t),e.memoizedState=tg,n):rg(e,o));if(i=n.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return jH(n,e,o,r,a,i,t);if(s){s=r.fallback,o=e.mode,i=n.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=ri(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=ri(a,s):(s=zi(s,o,t,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=n.child.memoizedState,o=o===null?ng(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=n.childLanes&~t,e.memoizedState=tg,r}return s=n.child,n=s.sibling,r=ri(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=t),r.return=e,r.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=r,e.memoizedState=null,r}function rg(n,e){return e=pu({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function nu(n,e,t,r){return r!==null&&_d(r),no(e,n.child,null,t),n=rg(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function jH(n,e,t,r,i,s,o){if(t)return e.flags&256?(e.flags&=-257,r=Jd(Error(j(422))),nu(n,e,o,r)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=pu({mode:"visible",children:r.children},i,0,null),s=zi(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&no(e,n.child,null,o),e.child.memoizedState=ng(o),e.memoizedState=tg,s);if(!(e.mode&1))return nu(n,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(j(419)),r=Jd(s,r,void 0),nu(n,e,o,r)}if(a=(o&n.childLanes)!==0,Rt||a){if(r=dt,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,dr(n,i),On(r,n,i,-1))}return bg(),r=Jd(Error(j(421))),nu(n,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=n.child,e=KH.bind(null,n),i._reactRetry=e,null):(n=s.treeContext,Wt=Ur(i.nextSibling),Ut=e,Ne=!0,Pn=null,n!==null&&(an[ln++]=hr,an[ln++]=fr,an[ln++]=Ni,hr=n.id,fr=n.overflow,Ni=e),e=rg(e,r.children),e.flags|=4096,e)}function _S(n,e,t){n.lanes|=e;var r=n.alternate;r!==null&&(r.lanes|=e),Id(n.return,e,t)}function ig(n,e,t,r,i){var s=n.memoizedState;s===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:t,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=t,s.tailMode=i)}function NS(n,e,t){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(_t(n,e,r.children,t),r=Re.current,r&2)r=r&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&_S(n,t,e);else if(n.tag===19)_S(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}r&=1}if(Ae(Re,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(t=e.child,i=null;t!==null;)n=t.alternate,n!==null&&Kc(n)===null&&(i=t),t=t.sibling;t=i,t===null?(i=e.child,e.child=null):(i=t.sibling,t.sibling=null),ig(e,!1,i,t,s);break;case"backwards":for(t=null,i=e.child,e.child=null;i!==null;){if(n=i.alternate,n!==null&&Kc(n)===null){e.child=i;break}n=i.sibling,i.sibling=t,t=i,i=n}ig(e,!0,t,null,s);break;case"together":ig(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ru(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function pr(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),Ri|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(j(153));if(e.child!==null){for(n=e.child,t=ri(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=ri(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function DH(n,e,t){switch(e.tag){case 3:TS(e),Zs();break;case 5:XC(e);break;case 1:Lt(e.type)&&Bc(e);break;case 4:Bd(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;Ae(Gc,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Ae(Re,Re.current&1),e.flags|=128,null):t&e.child.childLanes?MS(n,e,t):(Ae(Re,Re.current&1),n=pr(n,e,t),n!==null?n.sibling:null);Ae(Re,Re.current&1);break;case 19:if(r=(t&e.childLanes)!==0,n.flags&128){if(r)return NS(n,e,t);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ae(Re,Re.current),r)break;return null;case 22:case 23:return e.lanes=0,PS(n,e,t)}return pr(n,e,t)}var kS,sg,$S,IS;kS=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}},sg=function(){},$S=function(n,e,t,r){var i=n.memoizedProps;if(i!==r){n=e.stateNode,Ii(qn.current);var s=null;switch(t){case"input":i=If(n,i),r=If(n,r),s=[];break;case"select":i=Le({},i,{value:void 0}),r=Le({},r,{value:void 0}),s=[];break;case"textarea":i=jf(n,i),r=jf(n,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(n.onclick=Rc)}Bf(t,r);var o;t=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(o in a)a.hasOwnProperty(o)&&(t||(t={}),t[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ta.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(t||(t={}),t[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(t||(t={}),t[o]=l[o])}else t||(s||(s=[]),s.push(c,t)),t=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ta.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Me("scroll",n),s||a===l||(s=[])):(s=s||[]).push(c,l))}t&&(s=s||[]).push("style",t);var c=s;(e.updateQueue=c)&&(e.flags|=4)}},IS=function(n,e,t,r){t!==r&&(e.flags|=4)};function ja(n,e){if(!Ne)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:r.sibling=null}}function Pt(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,r=0;if(e)for(var i=n.child;i!==null;)t|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=n,i=i.sibling;else for(i=n.child;i!==null;)t|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=n,i=i.sibling;return n.subtreeFlags|=r,n.childLanes=t,e}function BH(n,e,t){var r=e.pendingProps;switch(Td(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(e),null;case 1:return Lt(e.type)&&Dc(),Pt(e),null;case 3:return r=e.stateNode,ro(),_e(It),_e(Ct),Vd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(n===null||n.child===null)&&(qc(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Pn!==null&&(mg(Pn),Pn=null))),sg(n,e),Pt(e),null;case 5:zd(e);var i=Ii(ka.current);if(t=e.type,n!==null&&e.stateNode!=null)$S(n,e,t,r,i),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(j(166));return Pt(e),null}if(n=Ii(qn.current),qc(e)){r=e.stateNode,t=e.type;var s=e.memoizedProps;switch(r[Vn]=e,r[Ta]=s,n=(e.mode&1)!==0,t){case"dialog":Me("cancel",r),Me("close",r);break;case"iframe":case"object":case"embed":Me("load",r);break;case"video":case"audio":for(i=0;i<Pa.length;i++)Me(Pa[i],r);break;case"source":Me("error",r);break;case"img":case"image":case"link":Me("error",r),Me("load",r);break;case"details":Me("toggle",r);break;case"input":dx(r,s),Me("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Me("invalid",r);break;case"textarea":mx(r,s),Me("invalid",r)}Bf(t,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Lc(r.textContent,a,n),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Lc(r.textContent,a,n),i=["children",""+a]):ta.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Me("scroll",r)}switch(t){case"input":fc(r),px(r,s,!0);break;case"textarea":fc(r),vx(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Rc)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=bx(t)),n==="http://www.w3.org/1999/xhtml"?t==="script"?(n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof r.is=="string"?n=o.createElement(t,{is:r.is}):(n=o.createElement(t),t==="select"&&(o=n,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):n=o.createElementNS(n,t),n[Vn]=e,n[Ta]=r,kS(n,e,!1,!1),e.stateNode=n;e:{switch(o=zf(t,r),t){case"dialog":Me("cancel",n),Me("close",n),i=r;break;case"iframe":case"object":case"embed":Me("load",n),i=r;break;case"video":case"audio":for(i=0;i<Pa.length;i++)Me(Pa[i],n);i=r;break;case"source":Me("error",n),i=r;break;case"img":case"image":case"link":Me("error",n),Me("load",n),i=r;break;case"details":Me("toggle",n),i=r;break;case"input":dx(n,r),i=If(n,r),Me("invalid",n);break;case"option":i=r;break;case"select":n._wrapperState={wasMultiple:!!r.multiple},i=Le({},r,{value:void 0}),Me("invalid",n);break;case"textarea":mx(n,r),i=jf(n,r),Me("invalid",n);break;default:i=r}Bf(t,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?Cx(n,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&wx(n,l)):s==="children"?typeof l=="string"?(t!=="textarea"||l!=="")&&sa(n,l):typeof l=="number"&&sa(n,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ta.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Me("scroll",n):l!=null&&Sf(n,s,l,o))}switch(t){case"input":fc(n),px(n,r,!1);break;case"textarea":fc(n),vx(n);break;case"option":r.value!=null&&n.setAttribute("value",""+Br(r.value));break;case"select":n.multiple=!!r.multiple,s=r.value,s!=null?Ds(n,!!r.multiple,s,!1):r.defaultValue!=null&&Ds(n,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(n.onclick=Rc)}switch(t){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Pt(e),null;case 6:if(n&&e.stateNode!=null)IS(n,e,n.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(j(166));if(t=Ii(ka.current),Ii(qn.current),qc(e)){if(r=e.stateNode,t=e.memoizedProps,r[Vn]=e,(s=r.nodeValue!==t)&&(n=Ut,n!==null))switch(n.tag){case 3:Lc(r.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&Lc(r.nodeValue,t,(n.mode&1)!==0)}s&&(e.flags|=4)}else r=(t.nodeType===9?t:t.ownerDocument).createTextNode(r),r[Vn]=e,e.stateNode=r}return Pt(e),null;case 13:if(_e(Re),r=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(Ne&&Wt!==null&&e.mode&1&&!(e.flags&128))RC(),Zs(),e.flags|=98560,s=!1;else if(s=qc(e),r!==null&&r.dehydrated!==null){if(n===null){if(!s)throw Error(j(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(j(317));s[Vn]=e}else Zs(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Pt(e),s=!1}else Pn!==null&&(mg(Pn),Pn=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=t,e):(r=r!==null,r!==(n!==null&&n.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(n===null||Re.current&1?at===0&&(at=3):bg())),e.updateQueue!==null&&(e.flags|=4),Pt(e),null);case 4:return ro(),sg(n,e),n===null&&Ea(e.stateNode.containerInfo),Pt(e),null;case 10:return $d(e.type._context),Pt(e),null;case 17:return Lt(e.type)&&Dc(),Pt(e),null;case 19:if(_e(Re),s=e.memoizedState,s===null)return Pt(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)ja(s,!1);else{if(at!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(o=Kc(n),o!==null){for(e.flags|=128,ja(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=t,t=e.child;t!==null;)s=t,n=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=n,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,n=o.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t=t.sibling;return Ae(Re,Re.current&1|2),e.child}n=n.sibling}s.tail!==null&&Xe()>ao&&(e.flags|=128,r=!0,ja(s,!1),e.lanes=4194304)}else{if(!r)if(n=Kc(o),n!==null){if(e.flags|=128,r=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),ja(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ne)return Pt(e),null}else 2*Xe()-s.renderingStartTime>ao&&t!==1073741824&&(e.flags|=128,r=!0,ja(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Xe(),e.sibling=null,t=Re.current,Ae(Re,r?t&1|2:t&1),e):(Pt(e),null);case 22:case 23:return vg(),r=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Xt&1073741824&&(Pt(e),e.subtreeFlags&6&&(e.flags|=8192)):Pt(e),null;case 24:return null;case 25:return null}throw Error(j(156,e.tag))}function zH(n,e){switch(Td(e),e.tag){case 1:return Lt(e.type)&&Dc(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return ro(),_e(It),_e(Ct),Vd(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return zd(e),null;case 13:if(_e(Re),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(j(340));Zs()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return _e(Re),null;case 4:return ro(),null;case 10:return $d(e.type._context),null;case 22:case 23:return vg(),null;case 24:return null;default:return null}}var iu=!1,Et=!1,FH=typeof WeakSet=="function"?WeakSet:Set,q=null;function so(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){qe(n,e,r)}else t.current=null}function og(n,e,t){try{t()}catch(r){qe(n,e,r)}}var LS=!1;function VH(n,e){if(vd=Pc,n=fC(),ud(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{t.nodeType,s.nodeType}catch(w){t=null;break e}var o=0,a=-1,l=-1,c=0,u=0,h=n,f=null;t:for(;;){for(var d;h!==t||i!==0&&h.nodeType!==3||(a=o+i),h!==s||r!==0&&h.nodeType!==3||(l=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(d=h.firstChild)!==null;)f=h,h=d;for(;;){if(h===n)break t;if(f===t&&++c===i&&(a=o),f===s&&++u===r&&(l=o),(d=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=d}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(bd={focusedElem:n,selectionRange:t},Pc=!1,q=e;q!==null;)if(e=q,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,q=n;else for(;q!==null;){e=q;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,b=g.memoizedState,m=e.stateNode,y=m.getSnapshotBeforeUpdate(e.elementType===e.type?p:En(e.type,p),b);m.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var v=e.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(j(163))}}catch(w){qe(e,e.return,w)}if(n=e.sibling,n!==null){n.return=e.return,q=n;break}q=e.return}return g=LS,LS=!1,g}function Da(n,e,t){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&n)===n){var s=i.destroy;i.destroy=void 0,s!==void 0&&og(e,t,s)}i=i.next}while(i!==r)}}function su(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var r=t.create;t.destroy=r()}t=t.next}while(t!==e)}}function ag(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function RS(n){var e=n.alternate;e!==null&&(n.alternate=null,RS(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Vn],delete e[Ta],delete e[Sd],delete e[PH],delete e[EH])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function jS(n){return n.tag===5||n.tag===3||n.tag===4}function DS(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||jS(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function lg(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Rc));else if(r!==4&&(n=n.child,n!==null))for(lg(n,e,t),n=n.sibling;n!==null;)lg(n,e,t),n=n.sibling}function cg(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(r!==4&&(n=n.child,n!==null))for(cg(n,e,t),n=n.sibling;n!==null;)cg(n,e,t),n=n.sibling}var yt=null,An=!1;function Qr(n,e,t){for(t=t.child;t!==null;)BS(n,e,t),t=t.sibling}function BS(n,e,t){if(Fn&&typeof Fn.onCommitFiberUnmount=="function")try{Fn.onCommitFiberUnmount(vc,t)}catch(a){}switch(t.tag){case 5:Et||so(t,e);case 6:var r=yt,i=An;yt=null,Qr(n,e,t),yt=r,An=i,yt!==null&&(An?(n=yt,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):yt.removeChild(t.stateNode));break;case 18:yt!==null&&(An?(n=yt,t=t.stateNode,n.nodeType===8?Cd(n.parentNode,t):n.nodeType===1&&Cd(n,t),ma(n)):Cd(yt,t.stateNode));break;case 4:r=yt,i=An,yt=t.stateNode.containerInfo,An=!0,Qr(n,e,t),yt=r,An=i;break;case 0:case 11:case 14:case 15:if(!Et&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&og(t,e,o),i=i.next}while(i!==r)}Qr(n,e,t);break;case 1:if(!Et&&(so(t,e),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(a){qe(t,e,a)}Qr(n,e,t);break;case 21:Qr(n,e,t);break;case 22:t.mode&1?(Et=(r=Et)||t.memoizedState!==null,Qr(n,e,t),Et=r):Qr(n,e,t);break;default:Qr(n,e,t)}}function zS(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new FH),e.forEach(function(r){var i=JH.bind(null,n,r);t.has(r)||(t.add(r),r.then(i,i))})}}function Tn(n,e){var t=e.deletions;if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];try{var s=n,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:yt=a.stateNode,An=!1;break e;case 3:yt=a.stateNode.containerInfo,An=!0;break e;case 4:yt=a.stateNode.containerInfo,An=!0;break e}a=a.return}if(yt===null)throw Error(j(160));BS(s,o,i),yt=null,An=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){qe(i,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)FS(e,n),e=e.sibling}function FS(n,e){var t=n.alternate,r=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(Tn(e,n),Hn(n),r&4){try{Da(3,n,n.return),su(3,n)}catch(p){qe(n,n.return,p)}try{Da(5,n,n.return)}catch(p){qe(n,n.return,p)}}break;case 1:Tn(e,n),Hn(n),r&512&&t!==null&&so(t,t.return);break;case 5:if(Tn(e,n),Hn(n),r&512&&t!==null&&so(t,t.return),n.flags&32){var i=n.stateNode;try{sa(i,"")}catch(p){qe(n,n.return,p)}}if(r&4&&(i=n.stateNode,i!=null)){var s=n.memoizedProps,o=t!==null?t.memoizedProps:s,a=n.type,l=n.updateQueue;if(n.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&gx(i,s),zf(a,o);var c=zf(a,s);for(o=0;o<l.length;o+=2){var u=l[o],h=l[o+1];u==="style"?Cx(i,h):u==="dangerouslySetInnerHTML"?wx(i,h):u==="children"?sa(i,h):Sf(i,u,h,c)}switch(a){case"input":Lf(i,s);break;case"textarea":yx(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var d=s.value;d!=null?Ds(i,!!s.multiple,d,!1):f!==!!s.multiple&&(s.defaultValue!=null?Ds(i,!!s.multiple,s.defaultValue,!0):Ds(i,!!s.multiple,s.multiple?[]:"",!1))}i[Ta]=s}catch(p){qe(n,n.return,p)}}break;case 6:if(Tn(e,n),Hn(n),r&4){if(n.stateNode===null)throw Error(j(162));i=n.stateNode,s=n.memoizedProps;try{i.nodeValue=s}catch(p){qe(n,n.return,p)}}break;case 3:if(Tn(e,n),Hn(n),r&4&&t!==null&&t.memoizedState.isDehydrated)try{ma(e.containerInfo)}catch(p){qe(n,n.return,p)}break;case 4:Tn(e,n),Hn(n);break;case 13:Tn(e,n),Hn(n),i=n.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(fg=Xe())),r&4&&zS(n);break;case 22:if(u=t!==null&&t.memoizedState!==null,n.mode&1?(Et=(c=Et)||u,Tn(e,n),Et=c):Tn(e,n),Hn(n),r&8192){if(c=n.memoizedState!==null,(n.stateNode.isHidden=c)&&!u&&n.mode&1)for(q=n,u=n.child;u!==null;){for(h=q=u;q!==null;){switch(f=q,d=f.child,f.tag){case 0:case 11:case 14:case 15:Da(4,f,f.return);break;case 1:so(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,t=f.return;try{e=r,g.props=e.memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(p){qe(r,t,p)}}break;case 5:so(f,f.return);break;case 22:if(f.memoizedState!==null){GS(h);continue}}d!==null?(d.return=f,q=d):GS(h)}u=u.sibling}e:for(u=null,h=n;;){if(h.tag===5){if(u===null){u=h;try{i=h.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=h.stateNode,l=h.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=xx("display",o))}catch(p){qe(n,n.return,p)}}}else if(h.tag===6){if(u===null)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(p){qe(n,n.return,p)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===n)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===n)break e;for(;h.sibling===null;){if(h.return===null||h.return===n)break e;u===h&&(u=null),h=h.return}u===h&&(u=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Tn(e,n),Hn(n),r&4&&zS(n);break;case 21:break;default:Tn(e,n),Hn(n)}}function Hn(n){var e=n.flags;if(e&2){try{e:{for(var t=n.return;t!==null;){if(jS(t)){var r=t;break e}t=t.return}throw Error(j(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(sa(i,""),r.flags&=-33);var s=DS(n);cg(n,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=DS(n);lg(n,a,o);break;default:throw Error(j(161))}}catch(l){qe(n,n.return,l)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function qH(n,e,t){q=n,VS(n)}function VS(n,e,t){for(var r=(n.mode&1)!==0;q!==null;){var i=q,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||iu;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Et;a=iu;var c=Et;if(iu=o,(Et=l)&&!c)for(q=i;q!==null;)o=q,l=o.child,o.tag===22&&o.memoizedState!==null?HS(i):l!==null?(l.return=o,q=l):HS(i);for(;s!==null;)q=s,VS(s),s=s.sibling;q=i,iu=a,Et=c}qS(n)}else i.subtreeFlags&8772&&s!==null?(s.return=i,q=s):qS(n)}}function qS(n){for(;q!==null;){var e=q;if(e.flags&8772){var t=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Et||su(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Et)if(t===null)r.componentDidMount();else{var i=e.elementType===e.type?t.memoizedProps:En(e.type,t.memoizedProps);r.componentDidUpdate(i,t.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&zC(e,s,r);break;case 3:var o=e.updateQueue;if(o!==null){if(t=null,e.child!==null)switch(e.child.tag){case 5:t=e.child.stateNode;break;case 1:t=e.child.stateNode}zC(e,o,t)}break;case 5:var a=e.stateNode;if(t===null&&e.flags&4){t=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&t.focus();break;case"img":l.src&&(t.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var h=u.dehydrated;h!==null&&ma(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(j(163))}Et||e.flags&512&&ag(e)}catch(f){qe(e,e.return,f)}}if(e===n){q=null;break}if(t=e.sibling,t!==null){t.return=e.return,q=t;break}q=e.return}}function GS(n){for(;q!==null;){var e=q;if(e===n){q=null;break}var t=e.sibling;if(t!==null){t.return=e.return,q=t;break}q=e.return}}function HS(n){for(;q!==null;){var e=q;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{su(4,e)}catch(l){qe(e,t,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){qe(e,i,l)}}var s=e.return;try{ag(e)}catch(l){qe(e,s,l)}break;case 5:var o=e.return;try{ag(e)}catch(l){qe(e,o,l)}}}catch(l){qe(e,e.return,l)}if(e===n){q=null;break}var a=e.sibling;if(a!==null){a.return=e.return,q=a;break}q=e.return}}var GH=Math.ceil,ou=lr.ReactCurrentDispatcher,ug=lr.ReactCurrentOwner,hn=lr.ReactCurrentBatchConfig,he=0,dt=null,tt=null,vt=0,Xt=0,oo=Wr(0),at=0,Ba=null,Ri=0,au=0,hg=0,za=null,jt=null,fg=0,ao=1/0,mr=null,lu=!1,dg=null,Zr=null,cu=!1,ei=null,uu=0,Fa=0,gg=null,hu=-1,fu=0;function Nt(){return he&6?Xe():hu!==-1?hu:hu=Xe()}function ti(n){return n.mode&1?he&2&&vt!==0?vt&-vt:TH.transition!==null?(fu===0&&(fu=jx()),fu):(n=ye,n!==0||(n=window.event,n=n===void 0?16:Ux(n.type)),n):1}function On(n,e,t,r){if(50<Fa)throw Fa=0,gg=null,Error(j(185));ha(n,t,r),(!(he&2)||n!==dt)&&(n===dt&&(!(he&2)&&(au|=t),at===4&&ni(n,vt)),Dt(n,r),t===1&&he===0&&!(e.mode&1)&&(ao=Xe()+500,zc&&Yr()))}function Dt(n,e){var t=n.callbackNode;T8(n,e);var r=xc(n,n===dt?vt:0);if(r===0)t!==null&&Ix(t),n.callbackNode=null,n.callbackPriority=0;else if(e=r&-r,n.callbackPriority!==e){if(t!=null&&Ix(t),e===1)n.tag===0?AH(WS.bind(null,n)):NC(WS.bind(null,n)),CH(function(){!(he&6)&&Yr()}),t=null;else{switch(Dx(r)){case 1:t=Wf;break;case 4:t=Lx;break;case 16:t=yc;break;case 536870912:t=Rx;break;default:t=yc}t=tP(t,US.bind(null,n))}n.callbackPriority=e,n.callbackNode=t}}function US(n,e){if(hu=-1,fu=0,he&6)throw Error(j(327));var t=n.callbackNode;if(lo()&&n.callbackNode!==t)return null;var r=xc(n,n===dt?vt:0);if(r===0)return null;if(r&30||r&n.expiredLanes||e)e=du(n,r);else{e=r;var i=he;he|=2;var s=YS();(dt!==n||vt!==e)&&(mr=null,ao=Xe()+500,Di(n,e));do try{WH();break}catch(a){XS(n,a)}while(1);kd(),ou.current=s,he=i,tt!==null?e=0:(dt=null,vt=0,e=at)}if(e!==0){if(e===2&&(i=Xf(n),i!==0&&(r=i,e=pg(n,i))),e===1)throw t=Ba,Di(n,0),ni(n,r),Dt(n,Xe()),t;if(e===6)ni(n,r);else{if(i=n.current.alternate,!(r&30)&&!HH(i)&&(e=du(n,r),e===2&&(s=Xf(n),s!==0&&(r=s,e=pg(n,s))),e===1))throw t=Ba,Di(n,0),ni(n,r),Dt(n,Xe()),t;switch(n.finishedWork=i,n.finishedLanes=r,e){case 0:case 1:throw Error(j(345));case 2:Bi(n,jt,mr);break;case 3:if(ni(n,r),(r&130023424)===r&&(e=fg+500-Xe(),10<e)){if(xc(n,0)!==0)break;if(i=n.suspendedLanes,(i&r)!==r){Nt(),n.pingedLanes|=n.suspendedLanes&i;break}n.timeoutHandle=xd(Bi.bind(null,n,jt,mr),e);break}Bi(n,jt,mr);break;case 4:if(ni(n,r),(r&4194240)===r)break;for(e=n.eventTimes,i=-1;0<r;){var o=31-Cn(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=Xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*GH(r/1960))-r,10<r){n.timeoutHandle=xd(Bi.bind(null,n,jt,mr),r);break}Bi(n,jt,mr);break;case 5:Bi(n,jt,mr);break;default:throw Error(j(329))}}}return Dt(n,Xe()),n.callbackNode===t?US.bind(null,n):null}function pg(n,e){var t=za;return n.current.memoizedState.isDehydrated&&(Di(n,e).flags|=256),n=du(n,e),n!==2&&(e=jt,jt=t,e!==null&&mg(e)),n}function mg(n){jt===null?jt=n:jt.push.apply(jt,n)}function HH(n){for(var e=n;;){if(e.flags&16384){var t=e.updateQueue;if(t!==null&&(t=t.stores,t!==null))for(var r=0;r<t.length;r++){var i=t[r],s=i.getSnapshot;i=i.value;try{if(!Sn(s(),i))return!1}catch(o){return!1}}}if(t=e.child,e.subtreeFlags&16384&&t!==null)t.return=e,e=t;else{if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ni(n,e){for(e&=~hg,e&=~au,n.suspendedLanes|=e,n.pingedLanes&=~e,n=n.expirationTimes;0<e;){var t=31-Cn(e),r=1<<t;n[t]=-1,e&=~r}}function WS(n){if(he&6)throw Error(j(327));lo();var e=xc(n,0);if(!(e&1))return Dt(n,Xe()),null;var t=du(n,e);if(n.tag!==0&&t===2){var r=Xf(n);r!==0&&(e=r,t=pg(n,r))}if(t===1)throw t=Ba,Di(n,0),ni(n,e),Dt(n,Xe()),t;if(t===6)throw Error(j(345));return n.finishedWork=n.current.alternate,n.finishedLanes=e,Bi(n,jt,mr),Dt(n,Xe()),null}function yg(n,e){var t=he;he|=1;try{return n(e)}finally{he=t,he===0&&(ao=Xe()+500,zc&&Yr())}}function ji(n){ei!==null&&ei.tag===0&&!(he&6)&&lo();var e=he;he|=1;var t=hn.transition,r=ye;try{if(hn.transition=null,ye=1,n)return n()}finally{ye=r,hn.transition=t,he=e,!(he&6)&&Yr()}}function vg(){Xt=oo.current,_e(oo)}function Di(n,e){n.finishedWork=null,n.finishedLanes=0;var t=n.timeoutHandle;if(t!==-1&&(n.timeoutHandle=-1,xH(t)),tt!==null)for(t=tt.return;t!==null;){var r=t;switch(Td(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Dc();break;case 3:ro(),_e(It),_e(Ct),Vd();break;case 5:zd(r);break;case 4:ro();break;case 13:_e(Re);break;case 19:_e(Re);break;case 10:$d(r.type._context);break;case 22:case 23:vg()}t=t.return}if(dt=n,tt=n=ri(n.current,null),vt=Xt=e,at=0,Ba=null,hg=au=Ri=0,jt=za=null,$i!==null){for(e=0;e<$i.length;e++)if(t=$i[e],r=t.interleaved,r!==null){t.interleaved=null;var i=r.next,s=t.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}t.pending=r}$i=null}return n}function XS(n,e){do{var t=tt;try{if(kd(),Jc.current=tu,Qc){for(var r=je.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Qc=!1}if(Li=0,ft=ot=je=null,$a=!1,Ia=0,ug.current=null,t===null||t.return===null){at=1,Ba=e,tt=null;break}e:{var s=n,o=t.return,a=t,l=e;if(e=vt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,h=u.tag;if(!(u.mode&1)&&(h===0||h===11||h===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var d=bS(o);if(d!==null){d.flags&=-257,wS(d,o,a,s,e),d.mode&1&&vS(s,c,e),e=d,l=c;var g=e.updateQueue;if(g===null){var p=new Set;p.add(l),e.updateQueue=p}else g.add(l);break e}else{if(!(e&1)){vS(s,c,e),bg();break e}l=Error(j(426))}}else if(Ne&&a.mode&1){var b=bS(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),wS(b,o,a,s,e),_d(io(l,a));break e}}s=l=io(l,a),at!==4&&(at=2),za===null?za=[s]:za.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var m=mS(s,l,e);BC(s,m);break e;case 1:a=l;var y=s.type,v=s.stateNode;if(!(s.flags&128)&&(typeof y.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Zr===null||!Zr.has(v)))){s.flags|=65536,e&=-e,s.lanes|=e;var w=yS(s,a,e);BC(s,w);break e}}s=s.return}while(s!==null)}JS(t)}catch(x){e=x,tt===t&&t!==null&&(tt=t=t.return);continue}break}while(1)}function YS(){var n=ou.current;return ou.current=tu,n===null?tu:n}function bg(){(at===0||at===3||at===2)&&(at=4),dt===null||!(Ri&268435455)&&!(au&268435455)||ni(dt,vt)}function du(n,e){var t=he;he|=2;var r=YS();(dt!==n||vt!==e)&&(mr=null,Di(n,e));do try{UH();break}catch(i){XS(n,i)}while(1);if(kd(),he=t,ou.current=r,tt!==null)throw Error(j(261));return dt=null,vt=0,at}function UH(){for(;tt!==null;)KS(tt)}function WH(){for(;tt!==null&&!v8();)KS(tt)}function KS(n){var e=eP(n.alternate,n,Xt);n.memoizedProps=n.pendingProps,e===null?JS(n):tt=e,ug.current=null}function JS(n){var e=n;do{var t=e.alternate;if(n=e.return,e.flags&32768){if(t=zH(t,e),t!==null){t.flags&=32767,tt=t;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{at=6,tt=null;return}}else if(t=BH(t,e,Xt),t!==null){tt=t;return}if(e=e.sibling,e!==null){tt=e;return}tt=e=n}while(e!==null);at===0&&(at=5)}function Bi(n,e,t){var r=ye,i=hn.transition;try{hn.transition=null,ye=1,XH(n,e,t,r)}finally{hn.transition=i,ye=r}return null}function XH(n,e,t,r){do lo();while(ei!==null);if(he&6)throw Error(j(327));t=n.finishedWork;var i=n.finishedLanes;if(t===null)return null;if(n.finishedWork=null,n.finishedLanes=0,t===n.current)throw Error(j(177));n.callbackNode=null,n.callbackPriority=0;var s=t.lanes|t.childLanes;if(O8(n,s),n===dt&&(tt=dt=null,vt=0),!(t.subtreeFlags&2064)&&!(t.flags&2064)||cu||(cu=!0,tP(yc,function(){return lo(),null})),s=(t.flags&15990)!==0,t.subtreeFlags&15990||s){s=hn.transition,hn.transition=null;var o=ye;ye=1;var a=he;he|=4,ug.current=null,VH(n,t),FS(t,n),gH(bd),Pc=!!vd,bd=vd=null,n.current=t,qH(t),b8(),he=a,ye=o,hn.transition=s}else n.current=t;if(cu&&(cu=!1,ei=n,uu=i),s=n.pendingLanes,s===0&&(Zr=null),C8(t.stateNode),Dt(n,Xe()),e!==null)for(r=n.onRecoverableError,t=0;t<e.length;t++)i=e[t],r(i.value,{componentStack:i.stack,digest:i.digest});if(lu)throw lu=!1,n=dg,dg=null,n;return uu&1&&n.tag!==0&&lo(),s=n.pendingLanes,s&1?n===gg?Fa++:(Fa=0,gg=n):Fa=0,Yr(),null}function lo(){if(ei!==null){var n=Dx(uu),e=hn.transition,t=ye;try{if(hn.transition=null,ye=16>n?16:n,ei===null)var r=!1;else{if(n=ei,ei=null,uu=0,he&6)throw Error(j(331));var i=he;for(he|=4,q=n.current;q!==null;){var s=q,o=s.child;if(q.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(q=c;q!==null;){var u=q;switch(u.tag){case 0:case 11:case 15:Da(8,u,s)}var h=u.child;if(h!==null)h.return=u,q=h;else for(;q!==null;){u=q;var f=u.sibling,d=u.return;if(RS(u),u===c){q=null;break}if(f!==null){f.return=d,q=f;break}q=d}}}var g=s.alternate;if(g!==null){var p=g.child;if(p!==null){g.child=null;do{var b=p.sibling;p.sibling=null,p=b}while(p!==null)}}q=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,q=o;else e:for(;q!==null;){if(s=q,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Da(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,q=m;break e}q=s.return}}var y=n.current;for(q=y;q!==null;){o=q;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,q=v;else e:for(o=y;q!==null;){if(a=q,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:su(9,a)}}catch(x){qe(a,a.return,x)}if(a===o){q=null;break e}var w=a.sibling;if(w!==null){w.return=a.return,q=w;break e}q=a.return}}if(he=i,Yr(),Fn&&typeof Fn.onPostCommitFiberRoot=="function")try{Fn.onPostCommitFiberRoot(vc,n)}catch(x){}r=!0}return r}finally{ye=t,hn.transition=e}}return!1}function QS(n,e,t){e=io(t,e),e=mS(n,e,1),n=Jr(n,e,1),e=Nt(),n!==null&&(ha(n,1,e),Dt(n,e))}function qe(n,e,t){if(n.tag===3)QS(n,n,t);else for(;e!==null;){if(e.tag===3){QS(e,n,t);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Zr===null||!Zr.has(r))){n=io(t,n),n=yS(e,n,1),e=Jr(e,n,1),n=Nt(),e!==null&&(ha(e,1,n),Dt(e,n));break}}e=e.return}}function YH(n,e,t){var r=n.pingCache;r!==null&&r.delete(e),e=Nt(),n.pingedLanes|=n.suspendedLanes&t,dt===n&&(vt&t)===t&&(at===4||at===3&&(vt&130023424)===vt&&500>Xe()-fg?Di(n,0):hg|=t),Dt(n,e)}function ZS(n,e){e===0&&(n.mode&1?(e=wc,wc<<=1,!(wc&130023424)&&(wc=4194304)):e=1);var t=Nt();n=dr(n,e),n!==null&&(ha(n,e,t),Dt(n,t))}function KH(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),ZS(n,t)}function JH(n,e){var t=0;switch(n.tag){case 13:var r=n.stateNode,i=n.memoizedState;i!==null&&(t=i.retryLane);break;case 19:r=n.stateNode;break;default:throw Error(j(314))}r!==null&&r.delete(e),ZS(n,t)}var eP;eP=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||It.current)Rt=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Rt=!1,DH(n,e,t);Rt=!!(n.flags&131072)}else Rt=!1,Ne&&e.flags&1048576&&kC(e,Vc,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;ru(n,e),n=e.pendingProps;var i=Ks(e,Ct.current);to(e,t),i=Hd(null,e,r,n,i,t);var s=Ud();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Lt(r)?(s=!0,Bc(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Rd(e),i.updater=Xc,e.stateNode=i,i._reactInternals=e,Dd(e,r,n,t),e=eg(null,e,r,!0,s,t)):(e.tag=0,Ne&&s&&Ad(e),_t(null,e,i,t),e=e.child),e;case 16:r=e.elementType;e:{switch(ru(n,e),n=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=ZH(r),n=En(r,n),i){case 0:e=Zd(null,e,r,n,t);break e;case 1:e=AS(null,e,r,n,t);break e;case 11:e=xS(null,e,r,n,t);break e;case 14:e=CS(null,e,r,En(r.type,n),t);break e}throw Error(j(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:En(r,i),Zd(n,e,r,i,t);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:En(r,i),AS(n,e,r,i,t);case 3:e:{if(TS(e),n===null)throw Error(j(387));r=e.pendingProps,s=e.memoizedState,i=s.element,DC(n,e),Wc(e,r,null,t);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=io(Error(j(423)),e),e=OS(n,e,r,t,i);break e}else if(r!==i){i=io(Error(j(424)),e),e=OS(n,e,r,t,i);break e}else for(Wt=Ur(e.stateNode.containerInfo.firstChild),Ut=e,Ne=!0,Pn=null,t=WC(e,null,r,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Zs(),r===i){e=pr(n,e,t);break e}_t(n,e,r,t)}e=e.child}return e;case 5:return XC(e),n===null&&Md(e),r=e.type,i=e.pendingProps,s=n!==null?n.memoizedProps:null,o=i.children,wd(r,i)?o=null:s!==null&&wd(r,s)&&(e.flags|=32),ES(n,e),_t(n,e,o,t),e.child;case 6:return n===null&&Md(e),null;case 13:return MS(n,e,t);case 4:return Bd(e,e.stateNode.containerInfo),r=e.pendingProps,n===null?e.child=no(e,null,r,t):_t(n,e,r,t),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:En(r,i),xS(n,e,r,i,t);case 7:return _t(n,e,e.pendingProps,t),e.child;case 8:return _t(n,e,e.pendingProps.children,t),e.child;case 12:return _t(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,Ae(Gc,r._currentValue),r._currentValue=o,s!==null)if(Sn(s.value,o)){if(s.children===i.children&&!It.current){e=pr(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=gr(-1,t&-t),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),Id(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(j(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),Id(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}_t(n,e,i.children,t),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,to(e,t),i=cn(i),r=r(i),e.flags|=1,_t(n,e,r,t),e.child;case 14:return r=e.type,i=En(r,e.pendingProps),i=En(r.type,i),CS(n,e,r,i,t);case 15:return SS(n,e,e.type,e.pendingProps,t);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:En(r,i),ru(n,e),e.tag=1,Lt(r)?(n=!0,Bc(e)):n=!1,to(e,t),qC(e,r,i),Dd(e,r,i,t),eg(null,e,r,!0,n,t);case 19:return NS(n,e,t);case 22:return PS(n,e,t)}throw Error(j(156,e.tag))};function tP(n,e){return $x(n,e)}function QH(n,e,t,r){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(n,e,t,r){return new QH(n,e,t,r)}function wg(n){return n=n.prototype,!(!n||!n.isReactComponent)}function ZH(n){if(typeof n=="function")return wg(n)?1:0;if(n!=null){if(n=n.$$typeof,n===Af)return 11;if(n===Mf)return 14}return 2}function ri(n,e){var t=n.alternate;return t===null?(t=fn(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function gu(n,e,t,r,i,s){var o=2;if(r=n,typeof n=="function")wg(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case js:return zi(t.children,i,s,e);case Pf:o=8,i|=8;break;case Ef:return n=fn(12,t,e,i|2),n.elementType=Ef,n.lanes=s,n;case Tf:return n=fn(13,t,e,i),n.elementType=Tf,n.lanes=s,n;case Of:return n=fn(19,t,e,i),n.elementType=Of,n.lanes=s,n;case cx:return pu(t,i,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case ax:o=10;break e;case lx:o=9;break e;case Af:o=11;break e;case Mf:o=14;break e;case Dr:o=16,r=null;break e}throw Error(j(130,n==null?n:typeof n,""))}return e=fn(o,t,e,i),e.elementType=n,e.type=r,e.lanes=s,e}function zi(n,e,t,r){return n=fn(7,n,r,e),n.lanes=t,n}function pu(n,e,t,r){return n=fn(22,n,r,e),n.elementType=cx,n.lanes=t,n.stateNode={isHidden:!1},n}function xg(n,e,t){return n=fn(6,n,null,e),n.lanes=t,n}function Cg(n,e,t){return e=fn(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function eU(n,e,t,r,i){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yf(0),this.expirationTimes=Yf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yf(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Sg(n,e,t,r,i,s,o,a,l){return n=new eU(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=fn(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},Rd(s),n}function tU(n,e,t){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Rs,key:r==null?null:""+r,children:n,containerInfo:e,implementation:t}}function nP(n){if(!n)return Xr;n=n._reactInternals;e:{if(Oi(n)!==n||n.tag!==1)throw Error(j(170));var e=n;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Lt(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(j(171))}if(n.tag===1){var t=n.type;if(Lt(t))return MC(n,t,e)}return e}function rP(n,e,t,r,i,s,o,a,l){return n=Sg(t,r,!0,n,i,s,o,a,l),n.context=nP(null),t=n.current,r=Nt(),i=ti(t),s=gr(r,i),s.callback=e!=null?e:null,Jr(t,s,i),n.current.lanes=i,ha(n,i,r),Dt(n,r),n}function mu(n,e,t,r){var i=e.current,s=Nt(),o=ti(i);return t=nP(t),e.context===null?e.context=t:e.pendingContext=t,e=gr(s,o),e.payload={element:n},r=r===void 0?null:r,r!==null&&(e.callback=r),n=Jr(i,e,o),n!==null&&(On(n,i,o,s),Uc(n,i,o)),o}function yu(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function iP(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}function Pg(n,e){iP(n,e),(n=n.alternate)&&iP(n,e)}function nU(){return null}var sP=typeof reportError=="function"?reportError:function(n){console.error(n)};function Eg(n){this._internalRoot=n}vu.prototype.render=Eg.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(j(409));mu(n,e,null,null)},vu.prototype.unmount=Eg.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;ji(function(){mu(null,n,null,null)}),e[cr]=null}};function vu(n){this._internalRoot=n}vu.prototype.unstable_scheduleHydration=function(n){if(n){var e=Fx();n={blockedOn:null,target:n,priority:e};for(var t=0;t<qr.length&&e!==0&&e<qr[t].priority;t++);qr.splice(t,0,n),t===0&&Gx(n)}};function Ag(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function bu(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function oP(){}function rU(n,e,t,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=yu(o);s.call(c)}}var o=rP(e,r,n,0,null,!1,!1,"",oP);return n._reactRootContainer=o,n[cr]=o.current,Ea(n.nodeType===8?n.parentNode:n),ji(),o}for(;i=n.lastChild;)n.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=yu(l);a.call(c)}}var l=Sg(n,0,!1,null,null,!1,!1,"",oP);return n._reactRootContainer=l,n[cr]=l.current,Ea(n.nodeType===8?n.parentNode:n),ji(function(){mu(e,l,t,r)}),l}function wu(n,e,t,r,i){var s=t._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=yu(o);a.call(l)}}mu(e,o,n,i)}else o=rU(t,e,n,i,r);return yu(o)}Bx=function(n){switch(n.tag){case 3:var e=n.stateNode;if(e.current.memoizedState.isDehydrated){var t=ua(e.pendingLanes);t!==0&&(Kf(e,t|1),Dt(e,Xe()),!(he&6)&&(ao=Xe()+500,Yr()))}break;case 13:ji(function(){var r=dr(n,1);if(r!==null){var i=Nt();On(r,n,1,i)}}),Pg(n,1)}},Jf=function(n){if(n.tag===13){var e=dr(n,134217728);if(e!==null){var t=Nt();On(e,n,134217728,t)}Pg(n,134217728)}},zx=function(n){if(n.tag===13){var e=ti(n),t=dr(n,e);if(t!==null){var r=Nt();On(t,n,e,r)}Pg(n,e)}},Fx=function(){return ye},Vx=function(n,e){var t=ye;try{return ye=n,e()}finally{ye=t}},qf=function(n,e,t){switch(e){case"input":if(Lf(n,t),e=t.name,t.type==="radio"&&e!=null){for(t=n;t.parentNode;)t=t.parentNode;for(t=t.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<t.length;e++){var r=t[e];if(r!==n&&r.form===n.form){var i=jc(r);if(!i)throw Error(j(90));fx(r),Lf(r,i)}}}break;case"textarea":yx(n,t);break;case"select":e=t.value,e!=null&&Ds(n,!!t.multiple,e,!1)}},Ax=yg,Tx=ji;var iU={usingClientEntryPoint:!1,Events:[Oa,Xs,jc,Px,Ex,yg]},Va={findFiberByHostInstance:Mi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},sU={bundleType:Va.bundleType,version:Va.version,rendererPackageName:Va.rendererPackageName,rendererConfig:Va.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:lr.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=Nx(n),n===null?null:n.stateNode},findFiberByHostInstance:Va.findFiberByHostInstance||nU,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"){var xu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xu.isDisabled&&xu.supportsFiber)try{vc=xu.inject(sU),Fn=xu}catch(n){}}qt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=iU,qt.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ag(e))throw Error(j(200));return tU(n,e,null,t)},qt.createRoot=function(n,e){if(!Ag(n))throw Error(j(299));var t=!1,r="",i=sP;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Sg(n,1,!1,null,null,t,!1,r,i),n[cr]=e.current,Ea(n.nodeType===8?n.parentNode:n),new Eg(e)},qt.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var e=n._reactInternals;if(e===void 0)throw typeof n.render=="function"?Error(j(188)):(n=Object.keys(n).join(","),Error(j(268,n)));return n=Nx(e),n=n===null?null:n.stateNode,n},qt.flushSync=function(n){return ji(n)},qt.hydrate=function(n,e,t){if(!bu(e))throw Error(j(200));return wu(null,n,e,!0,t)},qt.hydrateRoot=function(n,e,t){if(!Ag(n))throw Error(j(405));var r=t!=null&&t.hydratedSources||null,i=!1,s="",o=sP;if(t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),e=rP(e,null,n,1,t!=null?t:null,i,!1,s,o),n[cr]=e.current,Ea(n),r)for(n=0;n<r.length;n++)t=r[n],i=t._getVersion,i=i(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,i]:e.mutableSourceEagerHydrationData.push(t,i);return new vu(e)},qt.render=function(n,e,t){if(!bu(e))throw Error(j(200));return wu(null,n,e,!1,t)},qt.unmountComponentAtNode=function(n){if(!bu(n))throw Error(j(40));return n._reactRootContainer?(ji(function(){wu(null,null,n,!1,function(){n._reactRootContainer=null,n[cr]=null})}),!0):!1},qt.unstable_batchedUpdates=yg,qt.unstable_renderSubtreeIntoContainer=function(n,e,t,r){if(!bu(t))throw Error(j(200));if(n==null||n._reactInternals===void 0)throw Error(j(38));return wu(n,e,t,!1,r)},qt.version="18.2.0-next-9e3b772b8-20220608";function aP(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aP)}catch(n){console.error(n)}}aP(),ex.exports=qt;var lP=ex.exports,cP,uP=lP;cP=uP.createRoot,uP.hydrateRoot;var co;(function(n){let e=!1,t;const r=(l,c)=>{const u=c.payload;switch(c.type){case"add":{const h=l.findIndex(f=>f.id===u.id);return h>=0?(l[h]=u,[...l]):[...l,u]}case"remove":{const h=l.findIndex(f=>f.id===u.id);if(h>=0){const f=[...l];return f.splice(h,1),f}break}}return l};function i(l,c){e&&t({type:"add",payload:{id:l,portal:c}})}n.connect=i;function s(l){e&&t({type:"remove",payload:{id:l}})}n.disconnect=s;function o(){return e}n.isActive=o;function a(){return()=>{e=!0;const[l,c]=Z.useReducer(r,[]);return t=c,Z.createElement(Z.Fragment,{children:l.map(u=>u.portal)})}}n.getProvider=a})(co||(co={}));var oU=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const Tg={};function aU(n){const{shape:e,component:t,effect:r,inherit:i}=n,s=oU(n,["shape","component","effect","inherit"]);if(!e)throw new Error("should specify shape in config");Tg[e]={component:t,effect:r},V.registerNode(e,Object.assign({inherit:i||"react-shape"},s),!0)}class lU extends Z.PureComponent{constructor(e){super(e),this.state={tick:0}}componentDidMount(){const{node:e}=this.props;e.on("change:*",({key:t})=>{const r=Tg[e.shape];if(r){const{effect:i}=r;(!i||i.includes(t))&&this.setState({tick:this.state.tick+1})}})}clone(e){const{node:t,graph:r}=this.props;return typeof e.type=="string"?Z.cloneElement(e):Z.cloneElement(e,{node:t,graph:r})}render(){const{node:e}=this.props,t=Tg[e.shape];if(!t)return null;const{component:r}=t;if(Z.isValidElement(r))return this.clone(r);const i=r;return this.clone(Z.createElement(i,null))}}class Cu extends kt{targetId(){return`${this.graph.view.cid}:${this.cell.id}`}getComponentContainer(){return this.selectors&&this.selectors.foContent}confirmUpdate(e){const t=super.confirmUpdate(e);return this.handleAction(t,Cu.action,()=>{this.renderReactComponent()})}renderReactComponent(){this.unmountReactComponent();const e=this.getComponentContainer(),t=this.cell;if(e){const r=Z.createElement(lU,{node:t,graph:this.graph});if(co.isActive()){const i=lP.createPortal(r,e);co.connect(this.targetId(),i)}else this.root=cP(e),this.root.render(r)}}unmountReactComponent(){this.getComponentContainer()&&this.root&&(this.root.unmount(),this.root=void 0)}onMouseDown(e,t,r){const i=e.target;if(i.tagName.toLowerCase()==="input"){const o=i.getAttribute("type");if(o==null||["text","password","number","email","search","tel","url"].includes(o))return}super.onMouseDown(e,t,r)}unmount(){return co.isActive()&&co.disconnect(this.targetId()),this.unmountReactComponent(),super.unmount(),this}}(function(n){n.action="react",n.config({bootstrap:[n.action],actions:{component:n.action}}),kt.registry.register("react-shape-view",n,!0)})(Cu||(Cu={}));function Og(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Mg,hP;function cU(){if(hP)return Mg;hP=1;var n=Vv,e=4;function t(r){return n(r,e)}return Mg=t,Mg}var _g,fP;function Ng(){if(fP)return _g;fP=1;function n(e){return function(){return e}}return _g=n,_g}var kg,dP;function uU(){if(dP)return kg;dP=1;function n(e){return function(t,r,i){for(var s=-1,o=Object(t),a=i(t),l=a.length;l--;){var c=a[e?l:++s];if(r(o[c],c,o)===!1)break}return t}}return kg=n,kg}var $g,gP;function Ig(){if(gP)return $g;gP=1;var n=uU(),e=n();return $g=e,$g}var Lg,pP;function Rg(){if(pP)return Lg;pP=1;var n=Ig(),e=Sr;function t(r,i){return r&&n(r,i,e)}return Lg=t,Lg}var jg,mP;function hU(){if(mP)return jg;mP=1;var n=Wn;function e(t,r){return function(i,s){if(i==null)return i;if(!n(i))return t(i,s);for(var o=i.length,a=r?o:-1,l=Object(i);(r?a--:++a<o)&&s(l[a],a,l)!==!1;);return i}}return jg=e,jg}var Dg,yP;function Su(){if(yP)return Dg;yP=1;var n=Rg(),e=hU(),t=e(n);return Dg=t,Dg}var Bg,vP;function Fi(){if(vP)return Bg;vP=1;function n(e){return e}return Bg=n,Bg}var zg,bP;function wP(){if(bP)return zg;bP=1;var n=Fi();function e(t){return typeof t=="function"?t:n}return zg=e,zg}var Fg,xP;function CP(){if(xP)return Fg;xP=1;var n=Yu,e=Su(),t=wP(),r=Qe;function i(s,o){var a=r(s)?n:e;return a(s,t(o))}return Fg=i,Fg}var Vg,SP;function PP(){return SP||(SP=1,Vg=CP()),Vg}var qg,EP;function fU(){if(EP)return qg;EP=1;var n=Su();function e(t,r){var i=[];return n(t,function(s,o,a){r(s,o,a)&&i.push(s)}),i}return qg=e,qg}var Gg,AP;function dU(){if(AP)return Gg;AP=1;var n="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,n),this}return Gg=e,Gg}var Hg,TP;function gU(){if(TP)return Hg;TP=1;function n(e){return this.__data__.has(e)}return Hg=n,Hg}var Ug,OP;function MP(){if(OP)return Ug;OP=1;var n=Xu,e=dU(),t=gU();function r(i){var s=-1,o=i==null?0:i.length;for(this.__data__=new n;++s<o;)this.add(i[s])}return r.prototype.add=r.prototype.push=e,r.prototype.has=t,Ug=r,Ug}var Wg,_P;function pU(){if(_P)return Wg;_P=1;function n(e,t){for(var r=-1,i=e==null?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}return Wg=n,Wg}var Xg,NP;function kP(){if(NP)return Xg;NP=1;function n(e,t){return e.has(t)}return Xg=n,Xg}var Yg,$P;function IP(){if($P)return Yg;$P=1;var n=MP(),e=pU(),t=kP(),r=1,i=2;function s(o,a,l,c,u,h){var f=l&r,d=o.length,g=a.length;if(d!=g&&!(f&&g>d))return!1;var p=h.get(o),b=h.get(a);if(p&&b)return p==a&&b==o;var m=-1,y=!0,v=l&i?new n:void 0;for(h.set(o,a),h.set(a,o);++m<d;){var w=o[m],x=a[m];if(c)var C=f?c(x,w,m,a,o,h):c(w,x,m,o,a,h);if(C!==void 0){if(C)continue;y=!1;break}if(v){if(!e(a,function(S,E){if(!t(v,E)&&(w===S||u(w,S,l,c,h)))return v.push(E)})){y=!1;break}}else if(!(w===x||u(w,x,l,c,h))){y=!1;break}}return h.delete(o),h.delete(a),y}return Yg=s,Yg}var Kg,LP;function mU(){if(LP)return Kg;LP=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i,s){r[++t]=[s,i]}),r}return Kg=n,Kg}var Jg,RP;function Qg(){if(RP)return Jg;RP=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}return Jg=n,Jg}var Zg,jP;function yU(){if(jP)return Zg;jP=1;var n=Wi,e=Av,t=Hi,r=IP(),i=mU(),s=Qg(),o=1,a=2,l="[object Boolean]",c="[object Date]",u="[object Error]",h="[object Map]",f="[object Number]",d="[object RegExp]",g="[object Set]",p="[object String]",b="[object Symbol]",m="[object ArrayBuffer]",y="[object DataView]",v=n?n.prototype:void 0,w=v?v.valueOf:void 0;function x(C,S,E,A,O,T,I){switch(E){case y:if(C.byteLength!=S.byteLength||C.byteOffset!=S.byteOffset)return!1;C=C.buffer,S=S.buffer;case m:return!(C.byteLength!=S.byteLength||!T(new e(C),new e(S)));case l:case c:case f:return t(+C,+S);case u:return C.name==S.name&&C.message==S.message;case d:case p:return C==S+"";case h:var G=i;case g:var X=A&o;if(G||(G=s),C.size!=S.size&&!X)return!1;var M=I.get(C);if(M)return M==S;A|=a,I.set(C,S);var k=r(G(C),G(S),A,O,T,I);return I.delete(C),k;case b:if(w)return w.call(C)==w.call(S)}return!1}return Zg=x,Zg}var ep,DP;function vU(){if(DP)return ep;DP=1;var n=vv,e=1,t=Object.prototype,r=t.hasOwnProperty;function i(s,o,a,l,c,u){var h=a&e,f=n(s),d=f.length,g=n(o),p=g.length;if(d!=p&&!h)return!1;for(var b=d;b--;){var m=f[b];if(!(h?m in o:r.call(o,m)))return!1}var y=u.get(s),v=u.get(o);if(y&&v)return y==o&&v==s;var w=!0;u.set(s,o),u.set(o,s);for(var x=h;++b<d;){m=f[b];var C=s[m],S=o[m];if(l)var E=h?l(S,C,m,o,s,u):l(C,S,m,s,o,u);if(!(E===void 0?C===S||c(C,S,a,l,u):E)){w=!1;break}x||(x=m=="constructor")}if(w&&!x){var A=s.constructor,O=o.constructor;A!=O&&"constructor"in s&&"constructor"in o&&!(typeof A=="function"&&A instanceof A&&typeof O=="function"&&O instanceof O)&&(w=!1)}return u.delete(s),u.delete(o),w}return ep=i,ep}var tp,BP;function bU(){if(BP)return tp;BP=1;var n=il,e=IP(),t=yU(),r=vU(),i=Zi,s=Qe,o=Ji,a=bo,l=1,c="[object Arguments]",u="[object Array]",h="[object Object]",f=Object.prototype,d=f.hasOwnProperty;function g(p,b,m,y,v,w){var x=s(p),C=s(b),S=x?u:i(p),E=C?u:i(b);S=S==c?h:S,E=E==c?h:E;var A=S==h,O=E==h,T=S==E;if(T&&o(p)){if(!o(b))return!1;x=!0,A=!1}if(T&&!A)return w||(w=new n),x||a(p)?e(p,b,m,y,v,w):t(p,b,S,m,y,v,w);if(!(m&l)){var I=A&&d.call(p,"__wrapped__"),G=O&&d.call(b,"__wrapped__");if(I||G){var X=I?p.value():p,M=G?b.value():b;return w||(w=new n),v(X,M,m,y,w)}}return T?(w||(w=new n),r(p,b,m,y,v,w)):!1}return tp=g,tp}var np,zP;function FP(){if(zP)return np;zP=1;var n=bU(),e=kn;function t(r,i,s,o,a){return r===i?!0:r==null||i==null||!e(r)&&!e(i)?r!==r&&i!==i:n(r,i,s,o,t,a)}return np=t,np}var rp,VP;function wU(){if(VP)return rp;VP=1;var n=il,e=FP(),t=1,r=2;function i(s,o,a,l){var c=a.length,u=c,h=!l;if(s==null)return!u;for(s=Object(s);c--;){var f=a[c];if(h&&f[2]?f[1]!==s[f[0]]:!(f[0]in s))return!1}for(;++c<u;){f=a[c];var d=f[0],g=s[d],p=f[1];if(h&&f[2]){if(g===void 0&&!(d in s))return!1}else{var b=new n;if(l)var m=l(g,p,d,s,o,b);if(!(m===void 0?e(p,g,t|r,l,b):m))return!1}}return!0}return rp=i,rp}var ip,qP;function GP(){if(qP)return ip;qP=1;var n=Qt;function e(t){return t===t&&!n(t)}return ip=e,ip}var sp,HP;function xU(){if(HP)return sp;HP=1;var n=GP(),e=Sr;function t(r){for(var i=e(r),s=i.length;s--;){var o=i[s],a=r[o];i[s]=[o,a,n(a)]}return i}return sp=t,sp}var op,UP;function WP(){if(UP)return op;UP=1;function n(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}return op=n,op}var ap,XP;function CU(){if(XP)return ap;XP=1;var n=wU(),e=xU(),t=WP();function r(i){var s=e(i);return s.length==1&&s[0][2]?t(s[0][0],s[0][1]):function(o){return o===i||n(o,i,s)}}return ap=r,ap}var lp,YP;function uo(){if(YP)return lp;YP=1;var n=ui,e=kn,t="[object Symbol]";function r(i){return typeof i=="symbol"||e(i)&&n(i)==t}return lp=r,lp}var cp,KP;function up(){if(KP)return cp;KP=1;var n=Qe,e=uo(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(s,o){if(n(s))return!1;var a=typeof s;return a=="number"||a=="symbol"||a=="boolean"||s==null||e(s)?!0:r.test(s)||!t.test(s)||o!=null&&s in Object(o)}return cp=i,cp}var hp,JP;function SU(){if(JP)return hp;JP=1;var n=Xu,e="Expected a function";function t(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var s=function(){var o=arguments,a=i?i.apply(this,o):o[0],l=s.cache;if(l.has(a))return l.get(a);var c=r.apply(this,o);return s.cache=l.set(a,c)||l,c};return s.cache=new(t.Cache||n),s}return t.Cache=n,hp=t,hp}var fp,QP;function PU(){if(QP)return fp;QP=1;var n=SU(),e=500;function t(r){var i=n(r,function(o){return s.size===e&&s.clear(),o}),s=i.cache;return i}return fp=t,fp}var dp,ZP;function EU(){if(ZP)return dp;ZP=1;var n=PU(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,r=n(function(i){var s=[];return i.charCodeAt(0)===46&&s.push(""),i.replace(e,function(o,a,l,c){s.push(l?c.replace(t,"$1"):a||o)}),s});return dp=r,dp}var gp,eE;function Pu(){if(eE)return gp;eE=1;function n(e,t){for(var r=-1,i=e==null?0:e.length,s=Array(i);++r<i;)s[r]=t(e[r],r,e);return s}return gp=n,gp}var pp,tE;function AU(){if(tE)return pp;tE=1;var n=Wi,e=Pu(),t=Qe,r=uo(),i=1/0,s=n?n.prototype:void 0,o=s?s.toString:void 0;function a(l){if(typeof l=="string")return l;if(t(l))return e(l,a)+"";if(r(l))return o?o.call(l):"";var c=l+"";return c=="0"&&1/l==-i?"-0":c}return pp=a,pp}var mp,nE;function rE(){if(nE)return mp;nE=1;var n=AU();function e(t){return t==null?"":n(t)}return mp=e,mp}var yp,iE;function Eu(){if(iE)return yp;iE=1;var n=Qe,e=up(),t=EU(),r=rE();function i(s,o){return n(s)?s:e(s,o)?[s]:t(r(s))}return yp=i,yp}var vp,sE;function qa(){if(sE)return vp;sE=1;var n=uo(),e=1/0;function t(r){if(typeof r=="string"||n(r))return r;var i=r+"";return i=="0"&&1/r==-e?"-0":i}return vp=t,vp}var bp,oE;function Au(){if(oE)return bp;oE=1;var n=Eu(),e=qa();function t(r,i){i=n(i,r);for(var s=0,o=i.length;r!=null&&s<o;)r=r[e(i[s++])];return s&&s==o?r:void 0}return bp=t,bp}var wp,aE;function TU(){if(aE)return wp;aE=1;var n=Au();function e(t,r,i){var s=t==null?void 0:n(t,r);return s===void 0?i:s}return wp=e,wp}var xp,lE;function OU(){if(lE)return xp;lE=1;function n(e,t){return e!=null&&t in Object(e)}return xp=n,xp}var Cp,cE;function uE(){if(cE)return Cp;cE=1;var n=Eu(),e=vo,t=Qe,r=ll,i=Ku,s=qa();function o(a,l,c){l=n(l,a);for(var u=-1,h=l.length,f=!1;++u<h;){var d=s(l[u]);if(!(f=a!=null&&c(a,d)))break;a=a[d]}return f||++u!=h?f:(h=a==null?0:a.length,!!h&&i(h)&&r(d,h)&&(t(a)||e(a)))}return Cp=o,Cp}var Sp,hE;function fE(){if(hE)return Sp;hE=1;var n=OU(),e=uE();function t(r,i){return r!=null&&e(r,i,n)}return Sp=t,Sp}var Pp,dE;function MU(){if(dE)return Pp;dE=1;var n=FP(),e=TU(),t=fE(),r=up(),i=GP(),s=WP(),o=qa(),a=1,l=2;function c(u,h){return r(u)&&i(h)?s(o(u),h):function(f){var d=e(f,u);return d===void 0&&d===h?t(f,u):n(h,d,a|l)}}return Pp=c,Pp}var Ep,gE;function pE(){if(gE)return Ep;gE=1;function n(e){return function(t){return t==null?void 0:t[e]}}return Ep=n,Ep}var Ap,mE;function _U(){if(mE)return Ap;mE=1;var n=Au();function e(t){return function(r){return n(r,t)}}return Ap=e,Ap}var Tp,yE;function NU(){if(yE)return Tp;yE=1;var n=pE(),e=_U(),t=up(),r=qa();function i(s){return t(s)?n(r(s)):e(s)}return Tp=i,Tp}var Op,vE;function yr(){if(vE)return Op;vE=1;var n=CU(),e=MU(),t=Fi(),r=Qe,i=NU();function s(o){return typeof o=="function"?o:o==null?t:typeof o=="object"?r(o)?e(o[0],o[1]):n(o):i(o)}return Op=s,Op}var Mp,bE;function wE(){if(bE)return Mp;bE=1;var n=dv,e=fU(),t=yr(),r=Qe;function i(s,o){var a=r(s)?n:e;return a(s,t(o,3))}return Mp=i,Mp}var _p,xE;function kU(){if(xE)return _p;xE=1;var n=Object.prototype,e=n.hasOwnProperty;function t(r,i){return r!=null&&e.call(r,i)}return _p=t,_p}var Np,CE;function SE(){if(CE)return Np;CE=1;var n=kU(),e=uE();function t(r,i){return r!=null&&e(r,i,n)}return Np=t,Np}var kp,PE;function $U(){if(PE)return kp;PE=1;var n=Qu,e=Zi,t=vo,r=Qe,i=Wn,s=Ji,o=hl,a=bo,l="[object Map]",c="[object Set]",u=Object.prototype,h=u.hasOwnProperty;function f(d){if(d==null)return!0;if(i(d)&&(r(d)||typeof d=="string"||typeof d.splice=="function"||s(d)||a(d)||t(d)))return!d.length;var g=e(d);if(g==l||g==c)return!d.size;if(o(d))return!n(d).length;for(var p in d)if(h.call(d,p))return!1;return!0}return kp=f,kp}var $p,EE;function AE(){if(EE)return $p;EE=1;function n(e){return e===void 0}return $p=n,$p}var Ip,TE;function OE(){if(TE)return Ip;TE=1;var n=Su(),e=Wn;function t(r,i){var s=-1,o=e(r)?Array(r.length):[];return n(r,function(a,l,c){o[++s]=i(a,l,c)}),o}return Ip=t,Ip}var Lp,ME;function _E(){if(ME)return Lp;ME=1;var n=Pu(),e=yr(),t=OE(),r=Qe;function i(s,o){var a=r(s)?n:t;return a(s,e(o,3))}return Lp=i,Lp}var Rp,NE;function IU(){if(NE)return Rp;NE=1;function n(e,t,r,i){var s=-1,o=e==null?0:e.length;for(i&&o&&(r=e[++s]);++s<o;)r=t(r,e[s],s,e);return r}return Rp=n,Rp}var jp,kE;function LU(){if(kE)return jp;kE=1;function n(e,t,r,i,s){return s(e,function(o,a,l){r=i?(i=!1,o):t(r,o,a,l)}),r}return jp=n,jp}var Dp,$E;function IE(){if($E)return Dp;$E=1;var n=IU(),e=Su(),t=yr(),r=LU(),i=Qe;function s(o,a,l){var c=i(o)?n:r,u=arguments.length<3;return c(o,t(a,4),l,u,e)}return Dp=s,Dp}var Bp,LE;function RU(){if(LE)return Bp;LE=1;var n=ui,e=Qe,t=kn,r="[object String]";function i(s){return typeof s=="string"||!e(s)&&t(s)&&n(s)==r}return Bp=i,Bp}var zp,RE;function jU(){if(RE)return zp;RE=1;var n=pE(),e=n("length");return zp=e,zp}var Fp,jE;function DU(){if(jE)return Fp;jE=1;var n="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=e+t+r,s="\\ufe0e\\ufe0f",o="\\u200d",a=RegExp("["+o+n+i+s+"]");function l(c){return a.test(c)}return Fp=l,Fp}var Vp,DE;function BU(){if(DE)return Vp;DE=1;var n="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=e+t+r,s="\\ufe0e\\ufe0f",o="["+n+"]",a="["+i+"]",l="\\ud83c[\\udffb-\\udfff]",c="(?:"+a+"|"+l+")",u="[^"+n+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",f="[\\ud800-\\udbff][\\udc00-\\udfff]",d="\\u200d",g=c+"?",p="["+s+"]?",b="(?:"+d+"(?:"+[u,h,f].join("|")+")"+p+g+")*",m=p+g+b,y="(?:"+[u+a+"?",a,h,f,o].join("|")+")",v=RegExp(l+"(?="+l+")|"+y+m,"g");function w(x){for(var C=v.lastIndex=0;v.test(x);)++C;return C}return Vp=w,Vp}var qp,BE;function zU(){if(BE)return qp;BE=1;var n=jU(),e=DU(),t=BU();function r(i){return e(i)?t(i):n(i)}return qp=r,qp}var Gp,zE;function FU(){if(zE)return Gp;zE=1;var n=Qu,e=Zi,t=Wn,r=RU(),i=zU(),s="[object Map]",o="[object Set]";function a(l){if(l==null)return 0;if(t(l))return r(l)?i(l):l.length;var c=e(l);return c==s||c==o?l.size:n(l).length}return Gp=a,Gp}var Hp,FE;function VU(){if(FE)return Hp;FE=1;var n=Yu,e=$v,t=Rg(),r=yr(),i=dl,s=Qe,o=Ji,a=mo,l=Qt,c=bo;function u(h,f,d){var g=s(h),p=g||o(h)||c(h);if(f=r(f,4),d==null){var b=h&&h.constructor;p?d=g?new b:[]:l(h)?d=a(b)?e(i(h)):{}:d={}}return(p?n:t)(h,function(m,y,v){return f(d,m,y,v)}),d}return Hp=u,Hp}var Up,VE;function qU(){if(VE)return Up;VE=1;var n=Wi,e=vo,t=Qe,r=n?n.isConcatSpreadable:void 0;function i(s){return t(s)||e(s)||!!(r&&s&&s[r])}return Up=i,Up}var Wp,qE;function Xp(){if(qE)return Wp;qE=1;var n=eh,e=qU();function t(r,i,s,o,a){var l=-1,c=r.length;for(s||(s=e),a||(a=[]);++l<c;){var u=r[l];i>0&&s(u)?i>1?t(u,i-1,s,o,a):n(a,u):o||(a[a.length]=u)}return a}return Wp=t,Wp}var Yp,GE;function GU(){if(GE)return Yp;GE=1;function n(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}return Yp=n,Yp}var Kp,HE;function UE(){if(HE)return Kp;HE=1;var n=GU(),e=Math.max;function t(r,i,s){return i=e(i===void 0?r.length-1:i,0),function(){for(var o=arguments,a=-1,l=e(o.length-i,0),c=Array(l);++a<l;)c[a]=o[i+a];a=-1;for(var u=Array(i+1);++a<i;)u[a]=o[a];return u[i]=s(c),n(r,this,u)}}return Kp=t,Kp}var Jp,WE;function HU(){if(WE)return Jp;WE=1;var n=Ng(),e=rv,t=Fi(),r=e?function(i,s){return e(i,"toString",{configurable:!0,enumerable:!1,value:n(s),writable:!0})}:t;return Jp=r,Jp}var Qp,XE;function UU(){if(XE)return Qp;XE=1;var n=800,e=16,t=Date.now;function r(i){var s=0,o=0;return function(){var a=t(),l=e-(a-o);if(o=a,l>0){if(++s>=n)return arguments[0]}else s=0;return i.apply(void 0,arguments)}}return Qp=r,Qp}var Zp,YE;function KE(){if(YE)return Zp;YE=1;var n=HU(),e=UU(),t=e(n);return Zp=t,Zp}var em,JE;function Tu(){if(JE)return em;JE=1;var n=Fi(),e=UE(),t=KE();function r(i,s){return t(e(i,s,n),i+"")}return em=r,em}var tm,QE;function ZE(){if(QE)return tm;QE=1;function n(e,t,r,i){for(var s=e.length,o=r+(i?1:-1);i?o--:++o<s;)if(t(e[o],o,e))return o;return-1}return tm=n,tm}var nm,eA;function WU(){if(eA)return nm;eA=1;function n(e){return e!==e}return nm=n,nm}var rm,tA;function XU(){if(tA)return rm;tA=1;function n(e,t,r){for(var i=r-1,s=e.length;++i<s;)if(e[i]===t)return i;return-1}return rm=n,rm}var im,nA;function YU(){if(nA)return im;nA=1;var n=ZE(),e=WU(),t=XU();function r(i,s,o){return s===s?t(i,s,o):n(i,e,o)}return im=r,im}var sm,rA;function KU(){if(rA)return sm;rA=1;var n=YU();function e(t,r){var i=t==null?0:t.length;return!!i&&n(t,r,0)>-1}return sm=e,sm}var om,iA;function JU(){if(iA)return om;iA=1;function n(e,t,r){for(var i=-1,s=e==null?0:e.length;++i<s;)if(r(t,e[i]))return!0;return!1}return om=n,om}var am,sA;function QU(){if(sA)return am;sA=1;function n(){}return am=n,am}var lm,oA;function ZU(){if(oA)return lm;oA=1;var n=bv,e=QU(),t=Qg(),r=1/0,i=n&&1/t(new n([,-0]))[1]==r?function(s){return new n(s)}:e;return lm=i,lm}var cm,aA;function eW(){if(aA)return cm;aA=1;var n=MP(),e=KU(),t=JU(),r=kP(),i=ZU(),s=Qg(),o=200;function a(l,c,u){var h=-1,f=e,d=l.length,g=!0,p=[],b=p;if(u)g=!1,f=t;else if(d>=o){var m=c?null:i(l);if(m)return s(m);g=!1,f=r,b=new n}else b=c?[]:p;e:for(;++h<d;){var y=l[h],v=c?c(y):y;if(y=u||y!==0?y:0,g&&v===v){for(var w=b.length;w--;)if(b[w]===v)continue e;c&&b.push(v),p.push(y)}else f(b,v,u)||(b!==p&&b.push(v),p.push(y))}return p}return cm=a,cm}var um,lA;function cA(){if(lA)return um;lA=1;var n=Wn,e=kn;function t(r){return e(r)&&n(r)}return um=t,um}var hm,uA;function tW(){if(uA)return hm;uA=1;var n=Xp(),e=Tu(),t=eW(),r=cA(),i=e(function(s){return t(n(s,1,r,!0))});return hm=i,hm}var fm,hA;function nW(){if(hA)return fm;hA=1;var n=Pu();function e(t,r){return n(r,function(i){return t[i]})}return fm=e,fm}var dm,fA;function dA(){if(fA)return dm;fA=1;var n=nW(),e=Sr;function t(r){return r==null?[]:n(r,e(r))}return dm=t,dm}var gm,gA;function dn(){if(gA)return gm;gA=1;var n;if(typeof Og=="function")try{n={clone:cU(),constant:Ng(),each:PP(),filter:wE(),has:SE(),isArray:Qe,isEmpty:$U(),isFunction:mo,isUndefined:AE(),keys:Sr,map:_E(),reduce:IE(),size:FU(),transform:VU(),union:tW(),values:dA()}}catch(e){}return n||(n=window._),gm=n,gm}var pm,pA;function mm(){if(pA)return pm;pA=1;var n=dn();pm=i;var e="\0",t="\0",r="";function i(u){this._isDirected=n.has(u,"directed")?u.directed:!0,this._isMultigraph=n.has(u,"multigraph")?u.multigraph:!1,this._isCompound=n.has(u,"compound")?u.compound:!1,this._label=void 0,this._defaultNodeLabelFn=n.constant(void 0),this._defaultEdgeLabelFn=n.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(u){return this._label=u,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(u){return n.isFunction(u)||(u=n.constant(u)),this._defaultNodeLabelFn=u,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return n.keys(this._nodes)},i.prototype.sources=function(){var u=this;return n.filter(this.nodes(),function(h){return n.isEmpty(u._in[h])})},i.prototype.sinks=function(){var u=this;return n.filter(this.nodes(),function(h){return n.isEmpty(u._out[h])})},i.prototype.setNodes=function(u,h){var f=arguments,d=this;return n.each(u,function(g){f.length>1?d.setNode(g,h):d.setNode(g)}),this},i.prototype.setNode=function(u,h){return n.has(this._nodes,u)?(arguments.length>1&&(this._nodes[u]=h),this):(this._nodes[u]=arguments.length>1?h:this._defaultNodeLabelFn(u),this._isCompound&&(this._parent[u]=t,this._children[u]={},this._children[t][u]=!0),this._in[u]={},this._preds[u]={},this._out[u]={},this._sucs[u]={},++this._nodeCount,this)},i.prototype.node=function(u){return this._nodes[u]},i.prototype.hasNode=function(u){return n.has(this._nodes,u)},i.prototype.removeNode=function(u){var h=this;if(n.has(this._nodes,u)){var f=function(d){h.removeEdge(h._edgeObjs[d])};delete this._nodes[u],this._isCompound&&(this._removeFromParentsChildList(u),delete this._parent[u],n.each(this.children(u),function(d){h.setParent(d)}),delete this._children[u]),n.each(n.keys(this._in[u]),f),delete this._in[u],delete this._preds[u],n.each(n.keys(this._out[u]),f),delete this._out[u],delete this._sucs[u],--this._nodeCount}return this},i.prototype.setParent=function(u,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n.isUndefined(h))h=t;else{h+="";for(var f=h;!n.isUndefined(f);f=this.parent(f))if(f===u)throw new Error("Setting "+h+" as parent of "+u+" would create a cycle");this.setNode(h)}return this.setNode(u),this._removeFromParentsChildList(u),this._parent[u]=h,this._children[h][u]=!0,this},i.prototype._removeFromParentsChildList=function(u){delete this._children[this._parent[u]][u]},i.prototype.parent=function(u){if(this._isCompound){var h=this._parent[u];if(h!==t)return h}},i.prototype.children=function(u){if(n.isUndefined(u)&&(u=t),this._isCompound){var h=this._children[u];if(h)return n.keys(h)}else{if(u===t)return this.nodes();if(this.hasNode(u))return[]}},i.prototype.predecessors=function(u){var h=this._preds[u];if(h)return n.keys(h)},i.prototype.successors=function(u){var h=this._sucs[u];if(h)return n.keys(h)},i.prototype.neighbors=function(u){var h=this.predecessors(u);if(h)return n.union(h,this.successors(u))},i.prototype.isLeaf=function(u){var h;return this.isDirected()?h=this.successors(u):h=this.neighbors(u),h.length===0},i.prototype.filterNodes=function(u){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var f=this;n.each(this._nodes,function(p,b){u(b)&&h.setNode(b,p)}),n.each(this._edgeObjs,function(p){h.hasNode(p.v)&&h.hasNode(p.w)&&h.setEdge(p,f.edge(p))});var d={};function g(p){var b=f.parent(p);return b===void 0||h.hasNode(b)?(d[p]=b,b):b in d?d[b]:g(b)}return this._isCompound&&n.each(h.nodes(),function(p){h.setParent(p,g(p))}),h},i.prototype.setDefaultEdgeLabel=function(u){return n.isFunction(u)||(u=n.constant(u)),this._defaultEdgeLabelFn=u,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return n.values(this._edgeObjs)},i.prototype.setPath=function(u,h){var f=this,d=arguments;return n.reduce(u,function(g,p){return d.length>1?f.setEdge(g,p,h):f.setEdge(g,p),p}),this},i.prototype.setEdge=function(){var u,h,f,d,g=!1,p=arguments[0];typeof p=="object"&&p!==null&&"v"in p?(u=p.v,h=p.w,f=p.name,arguments.length===2&&(d=arguments[1],g=!0)):(u=p,h=arguments[1],f=arguments[3],arguments.length>2&&(d=arguments[2],g=!0)),u=""+u,h=""+h,n.isUndefined(f)||(f=""+f);var b=a(this._isDirected,u,h,f);if(n.has(this._edgeLabels,b))return g&&(this._edgeLabels[b]=d),this;if(!n.isUndefined(f)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(u),this.setNode(h),this._edgeLabels[b]=g?d:this._defaultEdgeLabelFn(u,h,f);var m=l(this._isDirected,u,h,f);return u=m.v,h=m.w,Object.freeze(m),this._edgeObjs[b]=m,s(this._preds[h],u),s(this._sucs[u],h),this._in[h][b]=m,this._out[u][b]=m,this._edgeCount++,this},i.prototype.edge=function(u,h,f){var d=arguments.length===1?c(this._isDirected,arguments[0]):a(this._isDirected,u,h,f);return this._edgeLabels[d]},i.prototype.hasEdge=function(u,h,f){var d=arguments.length===1?c(this._isDirected,arguments[0]):a(this._isDirected,u,h,f);return n.has(this._edgeLabels,d)},i.prototype.removeEdge=function(u,h,f){var d=arguments.length===1?c(this._isDirected,arguments[0]):a(this._isDirected,u,h,f),g=this._edgeObjs[d];return g&&(u=g.v,h=g.w,delete this._edgeLabels[d],delete this._edgeObjs[d],o(this._preds[h],u),o(this._sucs[u],h),delete this._in[h][d],delete this._out[u][d],this._edgeCount--),this},i.prototype.inEdges=function(u,h){var f=this._in[u];if(f){var d=n.values(f);return h?n.filter(d,function(g){return g.v===h}):d}},i.prototype.outEdges=function(u,h){var f=this._out[u];if(f){var d=n.values(f);return h?n.filter(d,function(g){return g.w===h}):d}},i.prototype.nodeEdges=function(u,h){var f=this.inEdges(u,h);if(f)return f.concat(this.outEdges(u,h))};function s(u,h){u[h]?u[h]++:u[h]=1}function o(u,h){--u[h]||delete u[h]}function a(u,h,f,d){var g=""+h,p=""+f;if(!u&&g>p){var b=g;g=p,p=b}return g+r+p+r+(n.isUndefined(d)?e:d)}function l(u,h,f,d){var g=""+h,p=""+f;if(!u&&g>p){var b=g;g=p,p=b}var m={v:g,w:p};return d&&(m.name=d),m}function c(u,h){return a(u,h.v,h.w,h.name)}return pm}var ym,mA;function rW(){return mA||(mA=1,ym="2.1.8"),ym}var vm,yA;function iW(){return yA||(yA=1,vm={Graph:mm(),version:rW()}),vm}var bm,vA;function sW(){if(vA)return bm;vA=1;var n=dn(),e=mm();bm={write:t,read:s};function t(o){var a={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:r(o),edges:i(o)};return n.isUndefined(o.graph())||(a.value=n.clone(o.graph())),a}function r(o){return n.map(o.nodes(),function(a){var l=o.node(a),c=o.parent(a),u={v:a};return n.isUndefined(l)||(u.value=l),n.isUndefined(c)||(u.parent=c),u})}function i(o){return n.map(o.edges(),function(a){var l=o.edge(a),c={v:a.v,w:a.w};return n.isUndefined(a.name)||(c.name=a.name),n.isUndefined(l)||(c.value=l),c})}function s(o){var a=new e(o.options).setGraph(o.value);return n.each(o.nodes,function(l){a.setNode(l.v,l.value),l.parent&&a.setParent(l.v,l.parent)}),n.each(o.edges,function(l){a.setEdge({v:l.v,w:l.w,name:l.name},l.value)}),a}return bm}var wm,bA;function oW(){if(bA)return wm;bA=1;var n=dn();wm=e;function e(t){var r={},i=[],s;function o(a){n.has(r,a)||(r[a]=!0,s.push(a),n.each(t.successors(a),o),n.each(t.predecessors(a),o))}return n.each(t.nodes(),function(a){s=[],o(a),s.length&&i.push(s)}),i}return wm}var xm,wA;function xA(){if(wA)return xm;wA=1;var n=dn();xm=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(t){return t.key})},e.prototype.has=function(t){return n.has(this._keyIndices,t)},e.prototype.priority=function(t){var r=this._keyIndices[t];if(r!==void 0)return this._arr[r].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(t,r){var i=this._keyIndices;if(t=String(t),!n.has(i,t)){var s=this._arr,o=s.length;return i[t]=o,s.push({key:t,priority:r}),this._decrease(o),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},e.prototype.decrease=function(t,r){var i=this._keyIndices[t];if(r>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[i].priority+" New: "+r);this._arr[i].priority=r,this._decrease(i)},e.prototype._heapify=function(t){var r=this._arr,i=2*t,s=i+1,o=t;i<r.length&&(o=r[i].priority<r[o].priority?i:o,s<r.length&&(o=r[s].priority<r[o].priority?s:o),o!==t&&(this._swap(t,o),this._heapify(o)))},e.prototype._decrease=function(t){for(var r=this._arr,i=r[t].priority,s;t!==0&&(s=t>>1,!(r[s].priority<i));)this._swap(t,s),t=s},e.prototype._swap=function(t,r){var i=this._arr,s=this._keyIndices,o=i[t],a=i[r];i[t]=a,i[r]=o,s[a.key]=t,s[o.key]=r},xm}var Cm,CA;function SA(){if(CA)return Cm;CA=1;var n=dn(),e=xA();Cm=r;var t=n.constant(1);function r(s,o,a,l){return i(s,String(o),a||t,l||function(c){return s.outEdges(c)})}function i(s,o,a,l){var c={},u=new e,h,f,d=function(g){var p=g.v!==h?g.v:g.w,b=c[p],m=a(g),y=f.distance+m;if(m<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+g+" Weight: "+m);y<b.distance&&(b.distance=y,b.predecessor=h,u.decrease(p,y))};for(s.nodes().forEach(function(g){var p=g===o?0:Number.POSITIVE_INFINITY;c[g]={distance:p},u.add(g,p)});u.size()>0&&(h=u.removeMin(),f=c[h],f.distance!==Number.POSITIVE_INFINITY);)l(h).forEach(d);return c}return Cm}var Sm,PA;function aW(){if(PA)return Sm;PA=1;var n=SA(),e=dn();Sm=t;function t(r,i,s){return e.transform(r.nodes(),function(o,a){o[a]=n(r,a,i,s)},{})}return Sm}var Pm,EA;function AA(){if(EA)return Pm;EA=1;var n=dn();Pm=e;function e(t){var r=0,i=[],s={},o=[];function a(l){var c=s[l]={onStack:!0,lowlink:r,index:r++};if(i.push(l),t.successors(l).forEach(function(f){n.has(s,f)?s[f].onStack&&(c.lowlink=Math.min(c.lowlink,s[f].index)):(a(f),c.lowlink=Math.min(c.lowlink,s[f].lowlink))}),c.lowlink===c.index){var u=[],h;do h=i.pop(),s[h].onStack=!1,u.push(h);while(l!==h);o.push(u)}}return t.nodes().forEach(function(l){n.has(s,l)||a(l)}),o}return Pm}var Em,TA;function lW(){if(TA)return Em;TA=1;var n=dn(),e=AA();Em=t;function t(r){return n.filter(e(r),function(i){return i.length>1||i.length===1&&r.hasEdge(i[0],i[0])})}return Em}var Am,OA;function cW(){if(OA)return Am;OA=1;var n=dn();Am=t;var e=n.constant(1);function t(i,s,o){return r(i,s||e,o||function(a){return i.outEdges(a)})}function r(i,s,o){var a={},l=i.nodes();return l.forEach(function(c){a[c]={},a[c][c]={distance:0},l.forEach(function(u){c!==u&&(a[c][u]={distance:Number.POSITIVE_INFINITY})}),o(c).forEach(function(u){var h=u.v===c?u.w:u.v,f=s(u);a[c][h]={distance:f,predecessor:c}})}),l.forEach(function(c){var u=a[c];l.forEach(function(h){var f=a[h];l.forEach(function(d){var g=f[c],p=u[d],b=f[d],m=g.distance+p.distance;m<b.distance&&(b.distance=m,b.predecessor=p.predecessor)})})}),a}return Am}var Tm,MA;function _A(){if(MA)return Tm;MA=1;var n=dn();Tm=e,e.CycleException=t;function e(r){var i={},s={},o=[];function a(l){if(n.has(s,l))throw new t;n.has(i,l)||(s[l]=!0,i[l]=!0,n.each(r.predecessors(l),a),delete s[l],o.push(l))}if(n.each(r.sinks(),a),n.size(i)!==r.nodeCount())throw new t;return o}function t(){}return t.prototype=new Error,Tm}var Om,NA;function uW(){if(NA)return Om;NA=1;var n=_A();Om=e;function e(t){try{n(t)}catch(r){if(r instanceof n.CycleException)return!1;throw r}return!0}return Om}var Mm,kA;function $A(){if(kA)return Mm;kA=1;var n=dn();Mm=e;function e(r,i,s){n.isArray(i)||(i=[i]);var o=(r.isDirected()?r.successors:r.neighbors).bind(r),a=[],l={};return n.each(i,function(c){if(!r.hasNode(c))throw new Error("Graph does not have node: "+c);t(r,c,s==="post",l,o,a)}),a}function t(r,i,s,o,a,l){n.has(o,i)||(o[i]=!0,s||l.push(i),n.each(a(i),function(c){t(r,c,s,o,a,l)}),s&&l.push(i))}return Mm}var _m,IA;function hW(){if(IA)return _m;IA=1;var n=$A();_m=e;function e(t,r){return n(t,r,"post")}return _m}var Nm,LA;function fW(){if(LA)return Nm;LA=1;var n=$A();Nm=e;function e(t,r){return n(t,r,"pre")}return Nm}var km,RA;function dW(){if(RA)return km;RA=1;var n=dn(),e=mm(),t=xA();km=r;function r(i,s){var o=new e,a={},l=new t,c;function u(f){var d=f.v===c?f.w:f.v,g=l.priority(d);if(g!==void 0){var p=s(f);p<g&&(a[d]=c,l.decrease(d,p))}}if(i.nodeCount()===0)return o;n.each(i.nodes(),function(f){l.add(f,Number.POSITIVE_INFINITY),o.setNode(f)}),l.decrease(i.nodes()[0],0);for(var h=!1;l.size()>0;){if(c=l.removeMin(),n.has(a,c))o.setEdge(c,a[c]);else{if(h)throw new Error("Input graph is not connected: "+i);h=!0}i.nodeEdges(c).forEach(u)}return o}return km}var $m,jA;function gW(){return jA||(jA=1,$m={components:oW(),dijkstra:SA(),dijkstraAll:aW(),findCycles:lW(),floydWarshall:cW(),isAcyclic:uW(),postorder:hW(),preorder:fW(),prim:dW(),tarjan:AA(),topsort:_A()}),$m}var Im,DA;function pW(){if(DA)return Im;DA=1;var n=iW();return Im={Graph:n.Graph,json:sW(),alg:gW(),version:n.version},Im}var Ou;if(typeof Og=="function")try{Ou=pW()}catch(n){}Ou||(Ou=window.graphlib);var Mn=Ou,Lm,BA;function Mu(){if(BA)return Lm;BA=1;var n=Hi,e=Wn,t=ll,r=Qt;function i(s,o,a){if(!r(a))return!1;var l=typeof o;return(l=="number"?e(a)&&t(o,a.length):l=="string"&&o in a)?n(a[o],s):!1}return Lm=i,Lm}var Rm,zA;function mW(){if(zA)return Rm;zA=1;var n=Tu(),e=Hi,t=Mu(),r=fi,i=Object.prototype,s=i.hasOwnProperty,o=n(function(a,l){a=Object(a);var c=-1,u=l.length,h=u>2?l[2]:void 0;for(h&&t(l[0],l[1],h)&&(u=1);++c<u;)for(var f=l[c],d=r(f),g=-1,p=d.length;++g<p;){var b=d[g],m=a[b];(m===void 0||e(m,i[b])&&!s.call(a,b))&&(a[b]=f[b])}return a});return Rm=o,Rm}var jm,FA;function yW(){if(FA)return jm;FA=1;var n=yr(),e=Wn,t=Sr;function r(i){return function(s,o,a){var l=Object(s);if(!e(s)){var c=n(o,3);s=t(s),o=function(h){return c(l[h],h,l)}}var u=i(s,o,a);return u>-1?l[c?s[u]:u]:void 0}}return jm=r,jm}var Dm,VA;function vW(){if(VA)return Dm;VA=1;var n=/\s/;function e(t){for(var r=t.length;r--&&n.test(t.charAt(r)););return r}return Dm=e,Dm}var Bm,qA;function bW(){if(qA)return Bm;qA=1;var n=vW(),e=/^\s+/;function t(r){return r&&r.slice(0,n(r)+1).replace(e,"")}return Bm=t,Bm}var zm,GA;function wW(){if(GA)return zm;GA=1;var n=bW(),e=Qt,t=uo(),r=0/0,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(t(c))return r;if(e(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=e(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=n(c);var h=s.test(c);return h||o.test(c)?a(c.slice(2),h?2:8):i.test(c)?r:+c}return zm=l,zm}var Fm,HA;function UA(){if(HA)return Fm;HA=1;var n=wW(),e=1/0,t=17976931348623157e292;function r(i){if(!i)return i===0?i:0;if(i=n(i),i===e||i===-e){var s=i<0?-1:1;return s*t}return i===i?i:0}return Fm=r,Fm}var Vm,WA;function xW(){if(WA)return Vm;WA=1;var n=UA();function e(t){var r=n(t),i=r%1;return r===r?i?r-i:r:0}return Vm=e,Vm}var qm,XA;function CW(){if(XA)return qm;XA=1;var n=ZE(),e=yr(),t=xW(),r=Math.max;function i(s,o,a){var l=s==null?0:s.length;if(!l)return-1;var c=a==null?0:t(a);return c<0&&(c=r(l+c,0)),n(s,e(o,3),c)}return qm=i,qm}var Gm,YA;function SW(){if(YA)return Gm;YA=1;var n=yW(),e=CW(),t=n(e);return Gm=t,Gm}var Hm,KA;function JA(){if(KA)return Hm;KA=1;var n=Xp();function e(t){var r=t==null?0:t.length;return r?n(t,1):[]}return Hm=e,Hm}var Um,QA;function PW(){if(QA)return Um;QA=1;var n=Ig(),e=wP(),t=fi;function r(i,s){return i==null?i:n(i,e(s),t)}return Um=r,Um}var Wm,ZA;function EW(){if(ZA)return Wm;ZA=1;function n(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return Wm=n,Wm}var Xm,eT;function AW(){if(eT)return Xm;eT=1;var n=sl,e=Rg(),t=yr();function r(i,s){var o={};return s=t(s,3),e(i,function(a,l,c){n(o,l,s(a,l,c))}),o}return Xm=r,Xm}var Ym,tT;function Km(){if(tT)return Ym;tT=1;var n=uo();function e(t,r,i){for(var s=-1,o=t.length;++s<o;){var a=t[s],l=r(a);if(l!=null&&(c===void 0?l===l&&!n(l):i(l,c)))var c=l,u=a}return u}return Ym=e,Ym}var Jm,nT;function TW(){if(nT)return Jm;nT=1;function n(e,t){return e>t}return Jm=n,Jm}var Qm,rT;function OW(){if(rT)return Qm;rT=1;var n=Km(),e=TW(),t=Fi();function r(i){return i&&i.length?n(i,t,e):void 0}return Qm=r,Qm}var Zm,iT;function sT(){if(iT)return Zm;iT=1;var n=sl,e=Hi;function t(r,i,s){(s!==void 0&&!e(r[i],s)||s===void 0&&!(i in r))&&n(r,i,s)}return Zm=t,Zm}var ey,oT;function MW(){if(oT)return ey;oT=1;var n=ui,e=dl,t=kn,r="[object Object]",i=Function.prototype,s=Object.prototype,o=i.toString,a=s.hasOwnProperty,l=o.call(Object);function c(u){if(!t(u)||n(u)!=r)return!1;var h=e(u);if(h===null)return!0;var f=a.call(h,"constructor")&&h.constructor;return typeof f=="function"&&f instanceof f&&o.call(f)==l}return ey=c,ey}var ty,aT;function lT(){if(aT)return ty;aT=1;function n(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return ty=n,ty}var ny,cT;function _W(){if(cT)return ny;cT=1;var n=yo,e=fi;function t(r){return n(r,e(r))}return ny=t,ny}var ry,uT;function NW(){if(uT)return ry;uT=1;var n=sT(),e=hv,t=Nv,r=fv,i=Iv,s=vo,o=Qe,a=cA(),l=Ji,c=mo,u=Qt,h=MW(),f=bo,d=lT(),g=_W();function p(b,m,y,v,w,x,C){var S=d(b,y),E=d(m,y),A=C.get(E);if(A){n(b,y,A);return}var O=x?x(S,E,y+"",b,m,C):void 0,T=O===void 0;if(T){var I=o(E),G=!I&&l(E),X=!I&&!G&&f(E);O=E,I||G||X?o(S)?O=S:a(S)?O=r(S):G?(T=!1,O=e(E,!0)):X?(T=!1,O=t(E,!0)):O=[]:h(E)||s(E)?(O=S,s(S)?O=g(S):(!u(S)||c(S))&&(O=i(E))):T=!1}T&&(C.set(E,O),w(O,E,v,x,C),C.delete(E)),n(b,y,O)}return ry=p,ry}var iy,hT;function kW(){if(hT)return iy;hT=1;var n=il,e=sT(),t=Ig(),r=NW(),i=Qt,s=fi,o=lT();function a(l,c,u,h,f){l!==c&&t(c,function(d,g){if(f||(f=new n),i(d))r(l,c,g,u,a,h,f);else{var p=h?h(o(l,g),d,g+"",l,c,f):void 0;p===void 0&&(p=d),e(l,g,p)}},s)}return iy=a,iy}var sy,fT;function $W(){if(fT)return sy;fT=1;var n=Tu(),e=Mu();function t(r){return n(function(i,s){var o=-1,a=s.length,l=a>1?s[a-1]:void 0,c=a>2?s[2]:void 0;for(l=r.length>3&&typeof l=="function"?(a--,l):void 0,c&&e(s[0],s[1],c)&&(l=a<3?void 0:l,a=1),i=Object(i);++o<a;){var u=s[o];u&&r(i,u,o,l)}return i})}return sy=t,sy}var oy,dT;function IW(){if(dT)return oy;dT=1;var n=kW(),e=$W(),t=e(function(r,i,s){n(r,i,s)});return oy=t,oy}var ay,gT;function pT(){if(gT)return ay;gT=1;function n(e,t){return e<t}return ay=n,ay}var ly,mT;function LW(){if(mT)return ly;mT=1;var n=Km(),e=pT(),t=Fi();function r(i){return i&&i.length?n(i,t,e):void 0}return ly=r,ly}var cy,yT;function RW(){if(yT)return cy;yT=1;var n=Km(),e=yr(),t=pT();function r(i,s){return i&&i.length?n(i,e(s,2),t):void 0}return cy=r,cy}var uy,vT;function jW(){if(vT)return uy;vT=1;var n=mn,e=function(){return n.Date.now()};return uy=e,uy}var hy,bT;function DW(){if(bT)return hy;bT=1;var n=ol,e=Eu(),t=ll,r=Qt,i=qa();function s(o,a,l,c){if(!r(o))return o;a=e(a,o);for(var u=-1,h=a.length,f=h-1,d=o;d!=null&&++u<h;){var g=i(a[u]),p=l;if(g==="__proto__"||g==="constructor"||g==="prototype")return o;if(u!=f){var b=d[g];p=c?c(b,g,d):void 0,p===void 0&&(p=r(b)?b:t(a[u+1])?[]:{})}n(d,g,p),d=d[g]}return o}return hy=s,hy}var fy,wT;function BW(){if(wT)return fy;wT=1;var n=Au(),e=DW(),t=Eu();function r(i,s,o){for(var a=-1,l=s.length,c={};++a<l;){var u=s[a],h=n(i,u);o(h,u)&&e(c,t(u,i),h)}return c}return fy=r,fy}var dy,xT;function zW(){if(xT)return dy;xT=1;var n=BW(),e=fE();function t(r,i){return n(r,i,function(s,o){return e(r,o)})}return dy=t,dy}var gy,CT;function FW(){if(CT)return gy;CT=1;var n=JA(),e=UE(),t=KE();function r(i){return t(e(i,void 0,n),i+"")}return gy=r,gy}var py,ST;function VW(){if(ST)return py;ST=1;var n=zW(),e=FW(),t=e(function(r,i){return r==null?{}:n(r,i)});return py=t,py}var my,PT;function qW(){if(PT)return my;PT=1;var n=Math.ceil,e=Math.max;function t(r,i,s,o){for(var a=-1,l=e(n((i-r)/(s||1)),0),c=Array(l);l--;)c[o?l:++a]=r,r+=s;return c}return my=t,my}var yy,ET;function GW(){if(ET)return yy;ET=1;var n=qW(),e=Mu(),t=UA();function r(i){return function(s,o,a){return a&&typeof a!="number"&&e(s,o,a)&&(o=a=void 0),s=t(s),o===void 0?(o=s,s=0):o=t(o),a=a===void 0?s<o?1:-1:t(a),n(s,o,a,i)}}return yy=r,yy}var vy,AT;function HW(){if(AT)return vy;AT=1;var n=GW(),e=n();return vy=e,vy}var by,TT;function UW(){if(TT)return by;TT=1;function n(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}return by=n,by}var wy,OT;function WW(){if(OT)return wy;OT=1;var n=uo();function e(t,r){if(t!==r){var i=t!==void 0,s=t===null,o=t===t,a=n(t),l=r!==void 0,c=r===null,u=r===r,h=n(r);if(!c&&!h&&!a&&t>r||a&&l&&u&&!c&&!h||s&&l&&u||!i&&u||!o)return 1;if(!s&&!a&&!h&&t<r||h&&i&&o&&!s&&!a||c&&i&&o||!l&&o||!u)return-1}return 0}return wy=e,wy}var xy,MT;function XW(){if(MT)return xy;MT=1;var n=WW();function e(t,r,i){for(var s=-1,o=t.criteria,a=r.criteria,l=o.length,c=i.length;++s<l;){var u=n(o[s],a[s]);if(u){if(s>=c)return u;var h=i[s];return u*(h=="desc"?-1:1)}}return t.index-r.index}return xy=e,xy}var Cy,_T;function YW(){if(_T)return Cy;_T=1;var n=Pu(),e=Au(),t=yr(),r=OE(),i=UW(),s=cl,o=XW(),a=Fi(),l=Qe;function c(u,h,f){h.length?h=n(h,function(p){return l(p)?function(b){return e(b,p.length===1?p[0]:p)}:p}):h=[a];var d=-1;h=n(h,s(t));var g=r(u,function(p,b,m){var y=n(h,function(v){return v(p)});return{criteria:y,index:++d,value:p}});return i(g,function(p,b){return o(p,b,f)})}return Cy=c,Cy}var Sy,NT;function KW(){if(NT)return Sy;NT=1;var n=Xp(),e=YW(),t=Tu(),r=Mu(),i=t(function(s,o){if(s==null)return[];var a=o.length;return a>1&&r(s,o[0],o[1])?o=[]:a>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),e(s,n(o,1),[])});return Sy=i,Sy}var Py,kT;function JW(){if(kT)return Py;kT=1;var n=rE(),e=0;function t(r){var i=++e;return n(r)+i}return Py=t,Py}var Ey,$T;function QW(){if($T)return Ey;$T=1;function n(e,t,r){for(var i=-1,s=e.length,o=t.length,a={};++i<s;){var l=i<o?t[i]:void 0;r(a,e[i],l)}return a}return Ey=n,Ey}var Ay,IT;function ZW(){if(IT)return Ay;IT=1;var n=ol,e=QW();function t(r,i){return e(r||[],i||[],n)}return Ay=t,Ay}var _u;if(typeof Og=="function")try{_u={cloneDeep:qv,constant:Ng(),defaults:mW(),each:PP(),filter:wE(),find:SW(),flatten:JA(),forEach:CP(),forIn:PW(),has:SE(),isUndefined:AE(),last:EW(),map:_E(),mapValues:AW(),max:OW(),merge:IW(),min:LW(),minBy:RW(),now:jW(),pick:VW(),range:HW(),reduce:IE(),sortBy:KW(),uniqueId:JW(),values:dA(),zipObject:ZW()}}catch(n){}_u||(_u=window._);var ke=_u,e9=Nu;function Nu(){var n={};n._next=n._prev=n,this._sentinel=n}Nu.prototype.dequeue=function(){var n=this._sentinel,e=n._prev;if(e!==n)return LT(e),e},Nu.prototype.enqueue=function(n){var e=this._sentinel;n._prev&&n._next&&LT(n),n._next=e._next,e._next._prev=n,e._next=n,n._prev=e},Nu.prototype.toString=function(){for(var n=[],e=this._sentinel,t=e._prev;t!==e;)n.push(JSON.stringify(t,t9)),t=t._prev;return"["+n.join(", ")+"]"};function LT(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function t9(n,e){if(n!=="_next"&&n!=="_prev")return e}var vr=ke,n9=Mn.Graph,r9=e9,i9=o9,s9=vr.constant(1);function o9(n,e){if(n.nodeCount()<=1)return[];var t=l9(n,e||s9),r=a9(t.graph,t.buckets,t.zeroIdx);return vr.flatten(vr.map(r,function(i){return n.outEdges(i.v,i.w)}),!0)}function a9(n,e,t){for(var r=[],i=e[e.length-1],s=e[0],o;n.nodeCount();){for(;o=s.dequeue();)Ty(n,e,t,o);for(;o=i.dequeue();)Ty(n,e,t,o);if(n.nodeCount()){for(var a=e.length-2;a>0;--a)if(o=e[a].dequeue(),o){r=r.concat(Ty(n,e,t,o,!0));break}}}return r}function Ty(n,e,t,r,i){var s=i?[]:void 0;return vr.forEach(n.inEdges(r.v),function(o){var a=n.edge(o),l=n.node(o.v);i&&s.push({v:o.v,w:o.w}),l.out-=a,Oy(e,t,l)}),vr.forEach(n.outEdges(r.v),function(o){var a=n.edge(o),l=o.w,c=n.node(l);c.in-=a,Oy(e,t,c)}),n.removeNode(r.v),s}function l9(n,e){var t=new n9,r=0,i=0;vr.forEach(n.nodes(),function(a){t.setNode(a,{v:a,in:0,out:0})}),vr.forEach(n.edges(),function(a){var l=t.edge(a.v,a.w)||0,c=e(a),u=l+c;t.setEdge(a.v,a.w,u),i=Math.max(i,t.node(a.v).out+=c),r=Math.max(r,t.node(a.w).in+=c)});var s=vr.range(i+r+3).map(function(){return new r9}),o=r+1;return vr.forEach(t.nodes(),function(a){Oy(s,o,t.node(a))}),{graph:t,buckets:s,zeroIdx:o}}function Oy(n,e,t){t.out?t.in?n[t.out-t.in+e].enqueue(t):n[n.length-1].enqueue(t):n[0].enqueue(t)}var Vi=ke,c9=i9,u9={run:h9,undo:d9};function h9(n){var e=n.graph().acyclicer==="greedy"?c9(n,t(n)):f9(n);Vi.forEach(e,function(r){var i=n.edge(r);n.removeEdge(r),i.forwardName=r.name,i.reversed=!0,n.setEdge(r.w,r.v,i,Vi.uniqueId("rev"))});function t(r){return function(i){return r.edge(i).weight}}}function f9(n){var e=[],t={},r={};function i(s){Vi.has(r,s)||(r[s]=!0,t[s]=!0,Vi.forEach(n.outEdges(s),function(o){Vi.has(t,o.w)?e.push(o):i(o.w)}),delete t[s])}return Vi.forEach(n.nodes(),i),e}function d9(n){Vi.forEach(n.edges(),function(e){var t=n.edge(e);if(t.reversed){n.removeEdge(e);var r=t.forwardName;delete t.reversed,delete t.forwardName,n.setEdge(e.w,e.v,t,r)}})}var pe=ke,RT=Mn.Graph,Bt={addDummyNode:jT,simplify:g9,asNonCompoundGraph:p9,successorWeights:m9,predecessorWeights:y9,intersectRect:v9,buildLayerMatrix:b9,normalizeRanks:w9,removeEmptyRanks:x9,addBorderNode:C9,maxRank:DT,partition:S9,time:P9,notime:E9};function jT(n,e,t,r){var i;do i=pe.uniqueId(r);while(n.hasNode(i));return t.dummy=e,n.setNode(i,t),i}function g9(n){var e=new RT().setGraph(n.graph());return pe.forEach(n.nodes(),function(t){e.setNode(t,n.node(t))}),pe.forEach(n.edges(),function(t){var r=e.edge(t.v,t.w)||{weight:0,minlen:1},i=n.edge(t);e.setEdge(t.v,t.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),e}function p9(n){var e=new RT({multigraph:n.isMultigraph()}).setGraph(n.graph());return pe.forEach(n.nodes(),function(t){n.children(t).length||e.setNode(t,n.node(t))}),pe.forEach(n.edges(),function(t){e.setEdge(t,n.edge(t))}),e}function m9(n){var e=pe.map(n.nodes(),function(t){var r={};return pe.forEach(n.outEdges(t),function(i){r[i.w]=(r[i.w]||0)+n.edge(i).weight}),r});return pe.zipObject(n.nodes(),e)}function y9(n){var e=pe.map(n.nodes(),function(t){var r={};return pe.forEach(n.inEdges(t),function(i){r[i.v]=(r[i.v]||0)+n.edge(i).weight}),r});return pe.zipObject(n.nodes(),e)}function v9(n,e){var t=n.x,r=n.y,i=e.x-t,s=e.y-r,o=n.width/2,a=n.height/2;if(!i&&!s)throw new Error("Not possible to find intersection inside of the rectangle");var l,c;return Math.abs(s)*o>Math.abs(i)*a?(s<0&&(a=-a),l=a*i/s,c=a):(i<0&&(o=-o),l=o,c=o*s/i),{x:t+l,y:r+c}}function b9(n){var e=pe.map(pe.range(DT(n)+1),function(){return[]});return pe.forEach(n.nodes(),function(t){var r=n.node(t),i=r.rank;pe.isUndefined(i)||(e[i][r.order]=t)}),e}function w9(n){var e=pe.min(pe.map(n.nodes(),function(t){return n.node(t).rank}));pe.forEach(n.nodes(),function(t){var r=n.node(t);pe.has(r,"rank")&&(r.rank-=e)})}function x9(n){var e=pe.min(pe.map(n.nodes(),function(s){return n.node(s).rank})),t=[];pe.forEach(n.nodes(),function(s){var o=n.node(s).rank-e;t[o]||(t[o]=[]),t[o].push(s)});var r=0,i=n.graph().nodeRankFactor;pe.forEach(t,function(s,o){pe.isUndefined(s)&&o%i!==0?--r:r&&pe.forEach(s,function(a){n.node(a).rank+=r})})}function C9(n,e,t,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=t,i.order=r),jT(n,"border",i,e)}function DT(n){return pe.max(pe.map(n.nodes(),function(e){var t=n.node(e).rank;if(!pe.isUndefined(t))return t}))}function S9(n,e){var t={lhs:[],rhs:[]};return pe.forEach(n,function(r){e(r)?t.lhs.push(r):t.rhs.push(r)}),t}function P9(n,e){var t=pe.now();try{return e()}finally{console.log(n+" time: "+(pe.now()-t)+"ms")}}function E9(n,e){return e()}var BT=ke,A9=Bt,T9={run:O9,undo:_9};function O9(n){n.graph().dummyChains=[],BT.forEach(n.edges(),function(e){M9(n,e)})}function M9(n,e){var t=e.v,r=n.node(t).rank,i=e.w,s=n.node(i).rank,o=e.name,a=n.edge(e),l=a.labelRank;if(s!==r+1){n.removeEdge(e);var c,u,h;for(h=0,++r;r<s;++h,++r)a.points=[],u={width:0,height:0,edgeLabel:a,edgeObj:e,rank:r},c=A9.addDummyNode(n,"edge",u,"_d"),r===l&&(u.width=a.width,u.height=a.height,u.dummy="edge-label",u.labelpos=a.labelpos),n.setEdge(t,c,{weight:a.weight},o),h===0&&n.graph().dummyChains.push(c),t=c;n.setEdge(t,i,{weight:a.weight},o)}}function _9(n){BT.forEach(n.graph().dummyChains,function(e){var t=n.node(e),r=t.edgeLabel,i;for(n.setEdge(t.edgeObj,r);t.dummy;)i=n.successors(e)[0],n.removeNode(e),r.points.push({x:t.x,y:t.y}),t.dummy==="edge-label"&&(r.x=t.x,r.y=t.y,r.width=t.width,r.height=t.height),e=i,t=n.node(e)})}var ku=ke,$u={longestPath:N9,slack:k9};function N9(n){var e={};function t(r){var i=n.node(r);if(ku.has(e,r))return i.rank;e[r]=!0;var s=ku.min(ku.map(n.outEdges(r),function(o){return t(o.w)-n.edge(o).minlen}));return(s===Number.POSITIVE_INFINITY||s===void 0||s===null)&&(s=0),i.rank=s}ku.forEach(n.sources(),t)}function k9(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen}var Iu=ke,$9=Mn.Graph,Lu=$u.slack,zT=I9;function I9(n){var e=new $9({directed:!1}),t=n.nodes()[0],r=n.nodeCount();e.setNode(t,{});for(var i,s;L9(e,n)<r;)i=R9(e,n),s=e.hasNode(i.v)?Lu(n,i):-Lu(n,i),j9(e,n,s);return e}function L9(n,e){function t(r){Iu.forEach(e.nodeEdges(r),function(i){var s=i.v,o=r===s?i.w:s;!n.hasNode(o)&&!Lu(e,i)&&(n.setNode(o,{}),n.setEdge(r,o,{}),t(o))})}return Iu.forEach(n.nodes(),t),n.nodeCount()}function R9(n,e){return Iu.minBy(e.edges(),function(t){if(n.hasNode(t.v)!==n.hasNode(t.w))return Lu(e,t)})}function j9(n,e,t){Iu.forEach(n.nodes(),function(r){e.node(r).rank+=t})}var br=ke,D9=zT,B9=$u.slack,z9=$u.longestPath,F9=Mn.alg.preorder,V9=Mn.alg.postorder,q9=Bt.simplify,G9=qi;qi.initLowLimValues=_y,qi.initCutValues=My,qi.calcCutValue=FT,qi.leaveEdge=qT,qi.enterEdge=GT,qi.exchangeEdges=HT;function qi(n){n=q9(n),z9(n);var e=D9(n);_y(e),My(e,n);for(var t,r;t=qT(e);)r=GT(e,n,t),HT(e,n,t,r)}function My(n,e){var t=V9(n,n.nodes());t=t.slice(0,t.length-1),br.forEach(t,function(r){H9(n,e,r)})}function H9(n,e,t){var r=n.node(t),i=r.parent;n.edge(t,i).cutvalue=FT(n,e,t)}function FT(n,e,t){var r=n.node(t),i=r.parent,s=!0,o=e.edge(t,i),a=0;return o||(s=!1,o=e.edge(i,t)),a=o.weight,br.forEach(e.nodeEdges(t),function(l){var c=l.v===t,u=c?l.w:l.v;if(u!==i){var h=c===s,f=e.edge(l).weight;if(a+=h?f:-f,W9(n,t,u)){var d=n.edge(t,u).cutvalue;a+=h?-d:d}}}),a}function _y(n,e){arguments.length<2&&(e=n.nodes()[0]),VT(n,{},1,e)}function VT(n,e,t,r,i){var s=t,o=n.node(r);return e[r]=!0,br.forEach(n.neighbors(r),function(a){br.has(e,a)||(t=VT(n,e,t,a,r))}),o.low=s,o.lim=t++,i?o.parent=i:delete o.parent,t}function qT(n){return br.find(n.edges(),function(e){return n.edge(e).cutvalue<0})}function GT(n,e,t){var r=t.v,i=t.w;e.hasEdge(r,i)||(r=t.w,i=t.v);var s=n.node(r),o=n.node(i),a=s,l=!1;s.lim>o.lim&&(a=o,l=!0);var c=br.filter(e.edges(),function(u){return l===UT(n,n.node(u.v),a)&&l!==UT(n,n.node(u.w),a)});return br.minBy(c,function(u){return B9(e,u)})}function HT(n,e,t,r){var i=t.v,s=t.w;n.removeEdge(i,s),n.setEdge(r.v,r.w,{}),_y(n),My(n,e),U9(n,e)}function U9(n,e){var t=br.find(n.nodes(),function(i){return!e.node(i).parent}),r=F9(n,t);r=r.slice(1),br.forEach(r,function(i){var s=n.node(i).parent,o=e.edge(i,s),a=!1;o||(o=e.edge(s,i),a=!0),e.node(i).rank=e.node(s).rank+(a?o.minlen:-o.minlen)})}function W9(n,e,t){return n.hasEdge(e,t)}function UT(n,e,t){return t.low<=e.lim&&e.lim<=t.lim}var X9=$u,WT=X9.longestPath,Y9=zT,K9=G9,J9=Q9;function Q9(n){switch(n.graph().ranker){case"network-simplex":XT(n);break;case"tight-tree":e7(n);break;case"longest-path":Z9(n);break;default:XT(n)}}var Z9=WT;function e7(n){WT(n),Y9(n)}function XT(n){K9(n)}var Ny=ke,t7=n7;function n7(n){var e=i7(n);Ny.forEach(n.graph().dummyChains,function(t){for(var r=n.node(t),i=r.edgeObj,s=r7(n,e,i.v,i.w),o=s.path,a=s.lca,l=0,c=o[l],u=!0;t!==i.w;){if(r=n.node(t),u){for(;(c=o[l])!==a&&n.node(c).maxRank<r.rank;)l++;c===a&&(u=!1)}if(!u){for(;l<o.length-1&&n.node(c=o[l+1]).minRank<=r.rank;)l++;c=o[l]}n.setParent(t,c),t=n.successors(t)[0]}})}function r7(n,e,t,r){var i=[],s=[],o=Math.min(e[t].low,e[r].low),a=Math.max(e[t].lim,e[r].lim),l,c;l=t;do l=n.parent(l),i.push(l);while(l&&(e[l].low>o||a>e[l].lim));for(c=l,l=r;(l=n.parent(l))!==c;)s.push(l);return{path:i.concat(s.reverse()),lca:c}}function i7(n){var e={},t=0;function r(i){var s=t;Ny.forEach(n.children(i),r),e[i]={low:s,lim:t++}}return Ny.forEach(n.children(),r),e}var wr=ke,ky=Bt,s7={run:o7,cleanup:c7};function o7(n){var e=ky.addDummyNode(n,"root",{},"_root"),t=a7(n),r=wr.max(wr.values(t))-1,i=2*r+1;n.graph().nestingRoot=e,wr.forEach(n.edges(),function(o){n.edge(o).minlen*=i});var s=l7(n)+1;wr.forEach(n.children(),function(o){YT(n,e,i,s,r,t,o)}),n.graph().nodeRankFactor=i}function YT(n,e,t,r,i,s,o){var a=n.children(o);if(!a.length){o!==e&&n.setEdge(e,o,{weight:0,minlen:t});return}var l=ky.addBorderNode(n,"_bt"),c=ky.addBorderNode(n,"_bb"),u=n.node(o);n.setParent(l,o),u.borderTop=l,n.setParent(c,o),u.borderBottom=c,wr.forEach(a,function(h){YT(n,e,t,r,i,s,h);var f=n.node(h),d=f.borderTop?f.borderTop:h,g=f.borderBottom?f.borderBottom:h,p=f.borderTop?r:2*r,b=d!==g?1:i-s[o]+1;n.setEdge(l,d,{weight:p,minlen:b,nestingEdge:!0}),n.setEdge(g,c,{weight:p,minlen:b,nestingEdge:!0})}),n.parent(o)||n.setEdge(e,l,{weight:0,minlen:i+s[o]})}function a7(n){var e={};function t(r,i){var s=n.children(r);s&&s.length&&wr.forEach(s,function(o){t(o,i+1)}),e[r]=i}return wr.forEach(n.children(),function(r){t(r,1)}),e}function l7(n){return wr.reduce(n.edges(),function(e,t){return e+n.edge(t).weight},0)}function c7(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,wr.forEach(n.edges(),function(t){var r=n.edge(t);r.nestingEdge&&n.removeEdge(t)})}var $y=ke,u7=Bt,h7=f7;function f7(n){function e(t){var r=n.children(t),i=n.node(t);if(r.length&&$y.forEach(r,e),$y.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var s=i.minRank,o=i.maxRank+1;s<o;++s)KT(n,"borderLeft","_bl",t,i,s),KT(n,"borderRight","_br",t,i,s)}}$y.forEach(n.children(),e)}function KT(n,e,t,r,i,s){var o={width:0,height:0,rank:s,borderType:e},a=i[e][s-1],l=u7.addDummyNode(n,"border",o,t);i[e][s]=l,n.setParent(l,r),a&&n.setEdge(a,l,{weight:1})}var Un=ke,d7={adjust:g7,undo:p7};function g7(n){var e=n.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&JT(n)}function p7(n){var e=n.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&m7(n),(e==="lr"||e==="rl")&&(y7(n),JT(n))}function JT(n){Un.forEach(n.nodes(),function(e){QT(n.node(e))}),Un.forEach(n.edges(),function(e){QT(n.edge(e))})}function QT(n){var e=n.width;n.width=n.height,n.height=e}function m7(n){Un.forEach(n.nodes(),function(e){Iy(n.node(e))}),Un.forEach(n.edges(),function(e){var t=n.edge(e);Un.forEach(t.points,Iy),Un.has(t,"y")&&Iy(t)})}function Iy(n){n.y=-n.y}function y7(n){Un.forEach(n.nodes(),function(e){Ly(n.node(e))}),Un.forEach(n.edges(),function(e){var t=n.edge(e);Un.forEach(t.points,Ly),Un.has(t,"x")&&Ly(t)})}function Ly(n){var e=n.x;n.x=n.y,n.y=e}var xr=ke,v7=b7;function b7(n){var e={},t=xr.filter(n.nodes(),function(a){return!n.children(a).length}),r=xr.max(xr.map(t,function(a){return n.node(a).rank})),i=xr.map(xr.range(r+1),function(){return[]});function s(a){if(!xr.has(e,a)){e[a]=!0;var l=n.node(a);i[l.rank].push(a),xr.forEach(n.successors(a),s)}}var o=xr.sortBy(t,function(a){return n.node(a).rank});return xr.forEach(o,s),i}var ii=ke,w7=x7;function x7(n,e){for(var t=0,r=1;r<e.length;++r)t+=C7(n,e[r-1],e[r]);return t}function C7(n,e,t){for(var r=ii.zipObject(t,ii.map(t,function(c,u){return u})),i=ii.flatten(ii.map(e,function(c){return ii.sortBy(ii.map(n.outEdges(c),function(u){return{pos:r[u.w],weight:n.edge(u).weight}}),"pos")}),!0),s=1;s<t.length;)s<<=1;var o=2*s-1;s-=1;var a=ii.map(new Array(o),function(){return 0}),l=0;return ii.forEach(i.forEach(function(c){var u=c.pos+s;a[u]+=c.weight;for(var h=0;u>0;)u%2&&(h+=a[u+1]),u=u-1>>1,a[u]+=c.weight;l+=c.weight*h})),l}var ZT=ke,S7=P7;function P7(n,e){return ZT.map(e,function(t){var r=n.inEdges(t);if(r.length){var i=ZT.reduce(r,function(s,o){var a=n.edge(o),l=n.node(o.v);return{sum:s.sum+a.weight*l.order,weight:s.weight+a.weight}},{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:t}})}var Yt=ke,E7=A7;function A7(n,e){var t={};Yt.forEach(n,function(i,s){var o=t[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:s};Yt.isUndefined(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),Yt.forEach(e.edges(),function(i){var s=t[i.v],o=t[i.w];!Yt.isUndefined(s)&&!Yt.isUndefined(o)&&(o.indegree++,s.out.push(t[i.w]))});var r=Yt.filter(t,function(i){return!i.indegree});return T7(r)}function T7(n){var e=[];function t(s){return function(o){o.merged||(Yt.isUndefined(o.barycenter)||Yt.isUndefined(s.barycenter)||o.barycenter>=s.barycenter)&&O7(s,o)}}function r(s){return function(o){o.in.push(s),--o.indegree===0&&n.push(o)}}for(;n.length;){var i=n.pop();e.push(i),Yt.forEach(i.in.reverse(),t(i)),Yt.forEach(i.out,r(i))}return Yt.map(Yt.filter(e,function(s){return!s.merged}),function(s){return Yt.pick(s,["vs","i","barycenter","weight"])})}function O7(n,e){var t=0,r=0;n.weight&&(t+=n.barycenter*n.weight,r+=n.weight),e.weight&&(t+=e.barycenter*e.weight,r+=e.weight),n.vs=e.vs.concat(n.vs),n.barycenter=t/r,n.weight=r,n.i=Math.min(e.i,n.i),e.merged=!0}var Ga=ke,M7=Bt,_7=N7;function N7(n,e){var t=M7.partition(n,function(u){return Ga.has(u,"barycenter")}),r=t.lhs,i=Ga.sortBy(t.rhs,function(u){return-u.i}),s=[],o=0,a=0,l=0;r.sort(k7(!!e)),l=eO(s,i,l),Ga.forEach(r,function(u){l+=u.vs.length,s.push(u.vs),o+=u.barycenter*u.weight,a+=u.weight,l=eO(s,i,l)});var c={vs:Ga.flatten(s,!0)};return a&&(c.barycenter=o/a,c.weight=a),c}function eO(n,e,t){for(var r;e.length&&(r=Ga.last(e)).i<=t;)e.pop(),n.push(r.vs),t++;return t}function k7(n){return function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:n?t.i-e.i:e.i-t.i}}var si=ke,$7=S7,I7=E7,L7=_7,R7=tO;function tO(n,e,t,r){var i=n.children(e),s=n.node(e),o=s?s.borderLeft:void 0,a=s?s.borderRight:void 0,l={};o&&(i=si.filter(i,function(g){return g!==o&&g!==a}));var c=$7(n,i);si.forEach(c,function(g){if(n.children(g.v).length){var p=tO(n,g.v,t,r);l[g.v]=p,si.has(p,"barycenter")&&D7(g,p)}});var u=I7(c,t);j7(u,l);var h=L7(u,r);if(o&&(h.vs=si.flatten([o,h.vs,a],!0),n.predecessors(o).length)){var f=n.node(n.predecessors(o)[0]),d=n.node(n.predecessors(a)[0]);si.has(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+f.order+d.order)/(h.weight+2),h.weight+=2}return h}function j7(n,e){si.forEach(n,function(t){t.vs=si.flatten(t.vs.map(function(r){return e[r]?e[r].vs:r}),!0)})}function D7(n,e){si.isUndefined(n.barycenter)?(n.barycenter=e.barycenter,n.weight=e.weight):(n.barycenter=(n.barycenter*n.weight+e.barycenter*e.weight)/(n.weight+e.weight),n.weight+=e.weight)}var Ha=ke,B7=Mn.Graph,z7=F7;function F7(n,e,t){var r=V7(n),i=new B7({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(s){return n.node(s)});return Ha.forEach(n.nodes(),function(s){var o=n.node(s),a=n.parent(s);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(s),i.setParent(s,a||r),Ha.forEach(n[t](s),function(l){var c=l.v===s?l.w:l.v,u=i.edge(c,s),h=Ha.isUndefined(u)?0:u.weight;i.setEdge(c,s,{weight:n.edge(l).weight+h})}),Ha.has(o,"minRank")&&i.setNode(s,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),i}function V7(n){for(var e;n.hasNode(e=Ha.uniqueId("_root")););return e}var q7=ke,G7=H7;function H7(n,e,t){var r={},i;q7.forEach(t,function(s){for(var o=n.parent(s),a,l;o;){if(a=n.parent(o),a?(l=r[a],r[a]=o):(l=i,i=o),l&&l!==o){e.setEdge(l,o);return}o=a}})}var oi=ke,U7=v7,W7=w7,X7=R7,Y7=z7,K7=G7,J7=Mn.Graph,nO=Bt,Q7=Z7;function Z7(n){var e=nO.maxRank(n),t=rO(n,oi.range(1,e+1),"inEdges"),r=rO(n,oi.range(e-1,-1,-1),"outEdges"),i=U7(n);iO(n,i);for(var s=Number.POSITIVE_INFINITY,o,a=0,l=0;l<4;++a,++l){eX(a%2?t:r,a%4>=2),i=nO.buildLayerMatrix(n);var c=W7(n,i);c<s&&(l=0,o=oi.cloneDeep(i),s=c)}iO(n,o)}function rO(n,e,t){return oi.map(e,function(r){return Y7(n,r,t)})}function eX(n,e){var t=new J7;oi.forEach(n,function(r){var i=r.graph().root,s=X7(r,i,t,e);oi.forEach(s.vs,function(o,a){r.node(o).order=a}),K7(r,t,s.vs)})}function iO(n,e){oi.forEach(e,function(t){oi.forEach(t,function(r,i){n.node(r).order=i})})}var se=ke,tX=Mn.Graph,nX=Bt,rX={positionX:oX,findType1Conflicts:sO,findType2Conflicts:oO,addConflict:Ry,hasConflict:aO,verticalAlignment:lO,horizontalCompaction:cO,alignCoordinates:hO,findSmallestWidthAlignment:uO,balance:fO};function sO(n,e){var t={};function r(i,s){var o=0,a=0,l=i.length,c=se.last(s);return se.forEach(s,function(u,h){var f=iX(n,u),d=f?n.node(f).order:l;(f||u===c)&&(se.forEach(s.slice(a,h+1),function(g){se.forEach(n.predecessors(g),function(p){var b=n.node(p),m=b.order;(m<o||d<m)&&!(b.dummy&&n.node(g).dummy)&&Ry(t,p,g)})}),a=h+1,o=d)}),s}return se.reduce(e,r),t}function oO(n,e){var t={};function r(s,o,a,l,c){var u;se.forEach(se.range(o,a),function(h){u=s[h],n.node(u).dummy&&se.forEach(n.predecessors(u),function(f){var d=n.node(f);d.dummy&&(d.order<l||d.order>c)&&Ry(t,f,u)})})}function i(s,o){var a=-1,l,c=0;return se.forEach(o,function(u,h){if(n.node(u).dummy==="border"){var f=n.predecessors(u);f.length&&(l=n.node(f[0]).order,r(o,c,h,a,l),c=h,a=l)}r(o,c,o.length,l,s.length)}),o}return se.reduce(e,i),t}function iX(n,e){if(n.node(e).dummy)return se.find(n.predecessors(e),function(t){return n.node(t).dummy})}function Ry(n,e,t){if(e>t){var r=e;e=t,t=r}var i=n[e];i||(n[e]=i={}),i[t]=!0}function aO(n,e,t){if(e>t){var r=e;e=t,t=r}return se.has(n[e],t)}function lO(n,e,t,r){var i={},s={},o={};return se.forEach(e,function(a){se.forEach(a,function(l,c){i[l]=l,s[l]=l,o[l]=c})}),se.forEach(e,function(a){var l=-1;se.forEach(a,function(c){var u=r(c);if(u.length){u=se.sortBy(u,function(p){return o[p]});for(var h=(u.length-1)/2,f=Math.floor(h),d=Math.ceil(h);f<=d;++f){var g=u[f];s[c]===c&&l<o[g]&&!aO(t,c,g)&&(s[g]=c,s[c]=i[c]=i[g],l=o[g])}}})}),{root:i,align:s}}function cO(n,e,t,r,i){var s={},o=sX(n,e,t,i),a=i?"borderLeft":"borderRight";function l(h,f){for(var d=o.nodes(),g=d.pop(),p={};g;)p[g]?h(g):(p[g]=!0,d.push(g),d=d.concat(f(g))),g=d.pop()}function c(h){s[h]=o.inEdges(h).reduce(function(f,d){return Math.max(f,s[d.v]+o.edge(d))},0)}function u(h){var f=o.outEdges(h).reduce(function(g,p){return Math.min(g,s[p.w]-o.edge(p))},Number.POSITIVE_INFINITY),d=n.node(h);f!==Number.POSITIVE_INFINITY&&d.borderType!==a&&(s[h]=Math.max(s[h],f))}return l(c,o.predecessors.bind(o)),l(u,o.successors.bind(o)),se.forEach(r,function(h){s[h]=s[t[h]]}),s}function sX(n,e,t,r){var i=new tX,s=n.graph(),o=aX(s.nodesep,s.edgesep,r);return se.forEach(e,function(a){var l;se.forEach(a,function(c){var u=t[c];if(i.setNode(u),l){var h=t[l],f=i.edge(h,u);i.setEdge(h,u,Math.max(o(n,c,l),f||0))}l=c})}),i}function uO(n,e){return se.minBy(se.values(e),function(t){var r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return se.forIn(t,function(s,o){var a=lX(n,o)/2;r=Math.max(s+a,r),i=Math.min(s-a,i)}),r-i})}function hO(n,e){var t=se.values(e),r=se.min(t),i=se.max(t);se.forEach(["u","d"],function(s){se.forEach(["l","r"],function(o){var a=s+o,l=n[a],c;if(l!==e){var u=se.values(l);c=o==="l"?r-se.min(u):i-se.max(u),c&&(n[a]=se.mapValues(l,function(h){return h+c}))}})})}function fO(n,e){return se.mapValues(n.ul,function(t,r){if(e)return n[e.toLowerCase()][r];var i=se.sortBy(se.map(n,r));return(i[1]+i[2])/2})}function oX(n){var e=nX.buildLayerMatrix(n),t=se.merge(sO(n,e),oO(n,e)),r={},i;se.forEach(["u","d"],function(o){i=o==="u"?e:se.values(e).reverse(),se.forEach(["l","r"],function(a){a==="r"&&(i=se.map(i,function(h){return se.values(h).reverse()}));var l=(o==="u"?n.predecessors:n.successors).bind(n),c=lO(n,i,t,l),u=cO(n,i,c.root,c.align,a==="r");a==="r"&&(u=se.mapValues(u,function(h){return-h})),r[o+a]=u})});var s=uO(n,r);return hO(r,s),fO(r,n.graph().align)}function aX(n,e,t){return function(r,i,s){var o=r.node(i),a=r.node(s),l=0,c;if(l+=o.width/2,se.has(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":c=-o.width/2;break;case"r":c=o.width/2;break}if(c&&(l+=t?c:-c),c=0,l+=(o.dummy?e:n)/2,l+=(a.dummy?e:n)/2,l+=a.width/2,se.has(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":c=a.width/2;break;case"r":c=-a.width/2;break}return c&&(l+=t?c:-c),c=0,l}}function lX(n,e){return n.node(e).width}var Ua=ke,dO=Bt,cX=rX.positionX,uX=hX;function hX(n){n=dO.asNonCompoundGraph(n),fX(n),Ua.forEach(cX(n),function(e,t){n.node(t).x=e})}function fX(n){var e=dO.buildLayerMatrix(n),t=n.graph().ranksep,r=0;Ua.forEach(e,function(i){var s=Ua.max(Ua.map(i,function(o){return n.node(o).height}));Ua.forEach(i,function(o){n.node(o).y=r+s/2}),r+=s+t})}var ae=ke,gO=u9,pO=T9,dX=J9,gX=Bt.normalizeRanks,pX=t7,mX=Bt.removeEmptyRanks,mO=s7,yX=h7,yO=d7,vX=Q7,bX=uX,ai=Bt,wX=Mn.Graph,xX=CX;function CX(n,e){var t=e&&e.debugTiming?ai.time:ai.notime;t("layout",function(){var r=t(" buildLayoutGraph",function(){return $X(n)});t(" runLayout",function(){SX(r,t)}),t(" updateInputGraph",function(){PX(n,r)})})}function SX(n,e){e(" makeSpaceForEdgeLabels",function(){IX(n)}),e(" removeSelfEdges",function(){qX(n)}),e(" acyclic",function(){gO.run(n)}),e(" nestingGraph.run",function(){mO.run(n)}),e(" rank",function(){dX(ai.asNonCompoundGraph(n))}),e(" injectEdgeLabelProxies",function(){LX(n)}),e(" removeEmptyRanks",function(){mX(n)}),e(" nestingGraph.cleanup",function(){mO.cleanup(n)}),e(" normalizeRanks",function(){gX(n)}),e(" assignRankMinMax",function(){RX(n)}),e(" removeEdgeLabelProxies",function(){jX(n)}),e(" normalize.run",function(){pO.run(n)}),e(" parentDummyChains",function(){pX(n)}),e(" addBorderSegments",function(){yX(n)}),e(" order",function(){vX(n)}),e(" insertSelfEdges",function(){GX(n)}),e(" adjustCoordinateSystem",function(){yO.adjust(n)}),e(" position",function(){bX(n)}),e(" positionSelfEdges",function(){HX(n)}),e(" removeBorderNodes",function(){VX(n)}),e(" normalize.undo",function(){pO.undo(n)}),e(" fixupEdgeLabelCoords",function(){zX(n)}),e(" undoCoordinateSystem",function(){yO.undo(n)}),e(" translateGraph",function(){DX(n)}),e(" assignNodeIntersects",function(){BX(n)}),e(" reversePoints",function(){FX(n)}),e(" acyclic.undo",function(){gO.undo(n)})}function PX(n,e){ae.forEach(n.nodes(),function(t){var r=n.node(t),i=e.node(t);r&&(r.x=i.x,r.y=i.y,e.children(t).length&&(r.width=i.width,r.height=i.height))}),ae.forEach(n.edges(),function(t){var r=n.edge(t),i=e.edge(t);r.points=i.points,ae.has(i,"x")&&(r.x=i.x,r.y=i.y)}),n.graph().width=e.graph().width,n.graph().height=e.graph().height}var EX=["nodesep","edgesep","ranksep","marginx","marginy"],AX={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},TX=["acyclicer","ranker","rankdir","align"],OX=["width","height"],MX={width:0,height:0},_X=["minlen","weight","width","height","labeloffset"],NX={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},kX=["labelpos"];function $X(n){var e=new wX({multigraph:!0,compound:!0}),t=Dy(n.graph());return e.setGraph(ae.merge({},AX,jy(t,EX),ae.pick(t,TX))),ae.forEach(n.nodes(),function(r){var i=Dy(n.node(r));e.setNode(r,ae.defaults(jy(i,OX),MX)),e.setParent(r,n.parent(r))}),ae.forEach(n.edges(),function(r){var i=Dy(n.edge(r));e.setEdge(r,ae.merge({},NX,jy(i,_X),ae.pick(i,kX)))}),e}function IX(n){var e=n.graph();e.ranksep/=2,ae.forEach(n.edges(),function(t){var r=n.edge(t);r.minlen*=2,r.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function LX(n){ae.forEach(n.edges(),function(e){var t=n.edge(e);if(t.width&&t.height){var r=n.node(e.v),i=n.node(e.w),s={rank:(i.rank-r.rank)/2+r.rank,e};ai.addDummyNode(n,"edge-proxy",s,"_ep")}})}function RX(n){var e=0;ae.forEach(n.nodes(),function(t){var r=n.node(t);r.borderTop&&(r.minRank=n.node(r.borderTop).rank,r.maxRank=n.node(r.borderBottom).rank,e=ae.max(e,r.maxRank))}),n.graph().maxRank=e}function jX(n){ae.forEach(n.nodes(),function(e){var t=n.node(e);t.dummy==="edge-proxy"&&(n.edge(t.e).labelRank=t.rank,n.removeNode(e))})}function DX(n){var e=Number.POSITIVE_INFINITY,t=0,r=Number.POSITIVE_INFINITY,i=0,s=n.graph(),o=s.marginx||0,a=s.marginy||0;function l(c){var u=c.x,h=c.y,f=c.width,d=c.height;e=Math.min(e,u-f/2),t=Math.max(t,u+f/2),r=Math.min(r,h-d/2),i=Math.max(i,h+d/2)}ae.forEach(n.nodes(),function(c){l(n.node(c))}),ae.forEach(n.edges(),function(c){var u=n.edge(c);ae.has(u,"x")&&l(u)}),e-=o,r-=a,ae.forEach(n.nodes(),function(c){var u=n.node(c);u.x-=e,u.y-=r}),ae.forEach(n.edges(),function(c){var u=n.edge(c);ae.forEach(u.points,function(h){h.x-=e,h.y-=r}),ae.has(u,"x")&&(u.x-=e),ae.has(u,"y")&&(u.y-=r)}),s.width=t-e+o,s.height=i-r+a}function BX(n){ae.forEach(n.edges(),function(e){var t=n.edge(e),r=n.node(e.v),i=n.node(e.w),s,o;t.points?(s=t.points[0],o=t.points[t.points.length-1]):(t.points=[],s=i,o=r),t.points.unshift(ai.intersectRect(r,s)),t.points.push(ai.intersectRect(i,o))})}function zX(n){ae.forEach(n.edges(),function(e){var t=n.edge(e);if(ae.has(t,"x"))switch((t.labelpos==="l"||t.labelpos==="r")&&(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset;break}})}function FX(n){ae.forEach(n.edges(),function(e){var t=n.edge(e);t.reversed&&t.points.reverse()})}function VX(n){ae.forEach(n.nodes(),function(e){if(n.children(e).length){var t=n.node(e),r=n.node(t.borderTop),i=n.node(t.borderBottom),s=n.node(ae.last(t.borderLeft)),o=n.node(ae.last(t.borderRight));t.width=Math.abs(o.x-s.x),t.height=Math.abs(i.y-r.y),t.x=s.x+t.width/2,t.y=r.y+t.height/2}}),ae.forEach(n.nodes(),function(e){n.node(e).dummy==="border"&&n.removeNode(e)})}function qX(n){ae.forEach(n.edges(),function(e){if(e.v===e.w){var t=n.node(e.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e,label:n.edge(e)}),n.removeEdge(e)}})}function GX(n){var e=ai.buildLayerMatrix(n);ae.forEach(e,function(t){var r=0;ae.forEach(t,function(i,s){var o=n.node(i);o.order=s+r,ae.forEach(o.selfEdges,function(a){ai.addDummyNode(n,"selfedge",{width:a.label.width,height:a.label.height,rank:o.rank,order:s+ ++r,e:a.e,label:a.label},"_se")}),delete o.selfEdges})})}function HX(n){ae.forEach(n.nodes(),function(e){var t=n.node(e);if(t.dummy==="selfedge"){var r=n.node(t.e.v),i=r.x+r.width/2,s=r.y,o=t.x-i,a=r.height/2;n.setEdge(t.e,t.label),n.removeNode(e),t.label.points=[{x:i+2*o/3,y:s-a},{x:i+5*o/6,y:s-a},{x:i+o,y:s},{x:i+5*o/6,y:s+a},{x:i+2*o/3,y:s+a}],t.label.x=t.x,t.label.y=t.y}})}function jy(n,e){return ae.mapValues(ae.pick(n,e),Number)}function Dy(n){var e={};return ae.forEach(n,function(t,r){e[r.toLowerCase()]=t}),e}var Ru=ke,UX=Bt,WX=Mn.Graph,XX={debugOrdering:YX};function YX(n){var e=UX.buildLayerMatrix(n),t=new WX({compound:!0,multigraph:!0}).setGraph({});return Ru.forEach(n.nodes(),function(r){t.setNode(r,{label:r}),t.setParent(r,"layer"+n.node(r).rank)}),Ru.forEach(n.edges(),function(r){t.setEdge(r.v,r.w,{},r.name)}),Ru.forEach(e,function(r,i){var s="layer"+i;t.setNode(s,{rank:"same"}),Ru.reduce(r,function(o,a){return t.setEdge(o,a,{style:"invis"}),a})}),t}var KX="0.8.5",JX={graphlib:Mn,layout:xX,debug:XX,util:{time:Bt.time,notime:Bt.notime},version:KX};const ju=Wy(JX),{groupBy:QX,reduce:ZX,uniq:eY,uniqBy:vO}=Hu,tY={ER:"er-rect",EDGE:"edge"},li=()=>Qa.useTranslation("graph-collection-manager"),bO=(n,e)=>{const t=[],r=i=>{const s=n==null?void 0:n.find(o=>o.name===i);if(s){const{inherits:o}=s;if(o)for(let a=0;a<o.length;a++){const l=o[a];t.push(l),r(l)}}return eY(t)};return r(e)},nY=(n,e)=>{const t=[],r=i=>(n.filter(o=>{var a;return(a=o.inherits)==null?void 0:a.includes(i)}).forEach(o=>{const a=o.name;return t.push(o),r(a)}),t);return r(e)},wO=n=>{const e=[],t=[],r=n.map((o,a)=>{const l=[],c=[...o.fields],u=bO(n,o.name),h=ZX(u,(d,g)=>{var m;const p=d,b=(m=n.find(y=>y.name===g))==null?void 0:m.fields.map(y=>$e(re({},y),{sourceCollectionName:o.name}));return b?p.concat(b):p},[]);vO(c.concat(h),"name").forEach(d=>{d.uiSchema&&l.push(re({id:d.name,group:"list"},d)),["obo","oho","o2o","o2m","m2o","m2m","linkTo"].includes(d.interface)&&e.push(d)}),t.push(o.name);const f=rY(l);return{id:o.name,shape:tY.ER,name:o.name,title:o.title,width:250,ports:[...f.initPorts||[],...f.morePorts||[]],item:o}}),i=sY(e,t,r),s=iY(n);return{nodesData:r,edgesData:i,inheritEdges:s}},rY=n=>QX(n,t=>t.isForeignKey||t.primaryKey||["obo","oho","o2o","o2m","m2o","m2m","linkTo","id"].includes(t.interface)?"initPorts":"morePorts"),iY=n=>{const e={attrs:{line:{strokeWidth:1,textAnchor:"middle",textVerticalAnchor:"middle",stroke:"#ddd",sourceMarker:null}},router:{name:"smooth",args:{direction:"H"}},labels:[{markup:[{tagName:"ellipse",selector:"labelBody",style:{cursor:"pointer"}},{tagName:"text",selector:"labelText",style:{cursor:"pointer"}}],attrs:{labelText:{text:"inherits",fill:"rgba(0, 0, 0, 0.3)",textAnchor:"middle",textVerticalAnchor:"middle"},labelBody:{ref:"labelText",refWidth:"100%",refHeight:"100%",fill:"var(--nb-box-bg)"}},position:{distance:.5,args:{keepGradient:!0,ensureLegibility:!0}}}]},t=[];return n.forEach(r=>{const i=r.inherits||[];i.length&&i.forEach(s=>{t.push(re({id:r.name+s,source:{cell:r.name,connectionPoint:"rect"},target:{cell:s,connectionPoint:"rect"},connector:{name:"normal",zIndex:1e3},connectionType:"inherited"},e))})}),t},sY=(n,e,t)=>{var i,s,o,a,l,c,u;const r=[];for(let h=0;h<n.length;h++)if(e.includes(n[h].target)){const f=t.find(b=>b.name===n[h].target),d=t.find(b=>b.name===(n[h].sourceCollectionName||n[h].collectionName)),g={attrs:{line:{strokeWidth:1,textAnchor:"middle",textVerticalAnchor:"middle",stroke:"#ddd",sourceMarker:null,targetMarker:null}},router:d.id===f.id?{name:"oneSide",args:{side:"left"}}:{name:"er",args:{direction:"H"}},labels:[{markup:[{tagName:"ellipse",selector:"labelBody",style:{cursor:"pointer"}},{tagName:"text",selector:"labelText",style:{cursor:"pointer"}}],attrs:{labelText:{text:xO(n[h].interface)[0],fill:"rgba(0, 0, 0, 0.3)",textAnchor:"middle",textVerticalAnchor:"middle"},labelBody:{ref:"labelText",refWidth:"100%",refHeight:"100%",stroke:"#ddd",fill:"var(--nb-box-bg)",strokeWidth:1,rx:10,ry:10}},position:{distance:.3,args:{keepGradient:!0,ensureLegibility:!0}}},{markup:[{tagName:"ellipse",selector:"labelBody",style:{cursor:"pointer"}},{tagName:"text",selector:"labelText",style:{cursor:"pointer"}}],attrs:{labelText:{text:xO(n[h].interface)[1],fill:"rgba(0, 0, 0, 0.3)",textAnchor:"middle",textVerticalAnchor:"middle"},labelBody:{ref:"labelText",refWidth:"100%",refHeight:"100%",stroke:"#ddd",fill:"var(--nb-box-bg)",rx:10,ry:10,strokeWidth:1}},position:{distance:.7,args:{keepGradient:!0,ensureLegibility:!0}}}],connector:{name:"normal",zIndex:1e3}},p=b=>{const m=r.find(y=>y.id===b);return m?(m.associated.push(n[h].name),!1):!0};if(["m2m","linkTo"].includes(n[h].interface)){const b=t.find(m=>m.name===n[h].through);if(b){const m=d.id,y=b.id,v=(i=d.ports.find(T=>T.name===n[h].sourceKey))==null?void 0:i.id,w=(s=b.ports.find(T=>T.name===n[h].foreignKey))==null?void 0:s.id,x=f.id,C=b.id,S=(o=f.ports.find(T=>T.name===n[h].targetKey))==null?void 0:o.id,E=(a=b.ports.find(T=>T.name===n[h].otherKey))==null?void 0:a.id,A=m+v+y+w,O=x+S+C+E;r.push(re({id:A,source:{cell:m,port:v,anchor:{name:"right"}},target:{cell:y,port:w,anchor:{name:"left"}},associated:[n[h].name],m2m:[A,O]},g)),r.push(re({id:O,source:{cell:x,port:S,anchor:{name:"right"}},target:{cell:C,port:E,anchor:{name:"left"}},associated:[n[h].name],m2m:[A,O]},g))}}else{const b=t.find(T=>T.name==(n[h].sourceCollectionName||n[h].collectionName)).ports.find(T=>T.name===n[h].foreignKey),m=d.id,y=f.id,v=b==null?void 0:b.id,w=(l=f.ports.find(T=>T.name===n[h].targetKey))==null?void 0:l.id,x=d.id,C=f.id,S=(c=d.ports.find(T=>T.name===n[h].sourceKey))==null?void 0:c.id,E=(u=f.ports.find(T=>T.name===n[h].foreignKey))==null?void 0:u.id,A=m+v+y+w,O=x+S+C+E;p(y+w+m+v)&&b&&w&&r.push(re({id:A,source:{cell:m,port:v,anchor:{name:"right"}},target:{cell:y,port:w,anchor:{name:"left"}},associated:[n[h].name]},g)),p(C+E+x+S)&&S&&E&&r.push(re({id:O,source:{cell:x,port:S,anchor:{name:"right"}},target:{cell:C,port:E,anchor:{name:"left"}},associated:[n[h].name]},g))}}return vO(r,"id")},xO=n=>{switch(n){case"m2m":case"linkTo":return["1","N"];case"o2m":return["1","N"];case"m2o":return["N","1"];case"obo":case"oho":return["1","1"];default:return[]}},oY=(n,e)=>{const t=[],r=n.length,i=e.length;for(let s=0;s<r;s++)if(!e.find(o=>o.id===n[s].id))t.push({status:"add",node:n[s]});else{const o=e.find(c=>c.id===n[s].id),a=o==null?void 0:o.ports.items,l=n[s].ports;if(o){for(let c=0;c<l.length;c++)a.find(u=>u.id===l[c].id)||t.push({status:"insertPort",node:n[s],port:{index:c,port:l[c]}});for(let c=0;c<a.length;c++)l.find(u=>u.id===a[c].id)||t.push({status:"deletePort",node:n[s],port:a[c]});o.title!==n[s].title&&t.push({status:"updateNode",node:n[s]})}}for(let s=0;s<i;s++)n.find(o=>o.id===e[s].id)||t.push({status:"delete",node:e[s]});return t},CO=(n,e)=>{const t=n.length,r=e==null?void 0:e.length,i=[];for(let s=0;s<t;s++)e.find(o=>o.id===n[s].id)||i.push({status:"add",edge:n[s]});for(let s=0;s<r;s++)n.find(o=>o.id===e[s].id)||i.push({status:"delete",edge:e[s]});return i};let Du;const nt=()=>Du||(Du=document.getElementById("graph_container")),aY=()=>{Du=null},lY=({item:n})=>_.jsx(L.AddCollection,{trigger:["click"],align:{overflow:{adjustY:!1}},item:n,scope:{useCancelAction:Xn},getContainer:nt,children:_.jsx(ce.Button,{type:"primary",children:_.jsx(ue.PlusOutlined,{})})}),cY=n=>{const{onClick:e}=n,{t}=li(),r=[{key:Ya.Both,label:"All relationships"},{key:Ya.Entity,label:"Entity relationship only"},{key:Ya.Inherit,label:"Inheritance relationship only"}],i=_.jsx("div",{children:_.jsx(ce.Menu,{defaultSelectedKeys:[Ya.Both],selectable:!0,className:Cr.css`
448
448
  .ant-menu-item {
449
449
  height: 32px;
450
450
  line-height: 32px;
@@ -453,7 +453,7 @@ Error generating stack: `+s.message+`
453
453
  .ant-popover-inner-content {
454
454
  padding: 0;
455
455
  }
456
- `,children:_.jsx(ce.Button,{children:_.jsx(_e.ShareAltOutlined,{})})})},hY=n=>{const{onClick:e}=n,{t}=li(),r=[{key:Wa.Both,label:"All directions"},{key:Wa.Target,label:"Target index"},{key:Wa.Source,label:"Source index"}],i=_.jsx("div",{children:_.jsx(ce.Menu,{defaultSelectedKeys:[Wa.Target],selectable:!0,className:Cr.css`
456
+ `,children:_.jsx(ce.Button,{children:_.jsx(ue.ShareAltOutlined,{})})})},uY=n=>{const{onClick:e}=n,{t}=li(),r=[{key:Xa.Both,label:"All directions"},{key:Xa.Target,label:"Target index"},{key:Xa.Source,label:"Source index"}],i=_.jsx("div",{children:_.jsx(ce.Menu,{defaultSelectedKeys:[Xa.Target],selectable:!0,className:Cr.css`
457
457
  .ant-menu-item {
458
458
  height: 32px;
459
459
  line-height: 32px;
@@ -462,7 +462,7 @@ Error generating stack: `+s.message+`
462
462
  .ant-popover-inner-content {
463
463
  padding: 0;
464
464
  }
465
- `,children:_.jsx(ce.Button,{children:_.jsx(_e.LineHeightOutlined,{})})})},By=L.createStyles(({token:n,css:e})=>({graphMinimap:e`
465
+ `,children:_.jsx(ce.Button,{children:_.jsx(ue.LineHeightOutlined,{})})})},By=L.createStyles(({token:n,css:e})=>({graphMinimap:e`
466
466
  .x6-widget-minimap {
467
467
  background-color: ${n.colorBgContainer};
468
468
  }
@@ -702,21 +702,21 @@ Error generating stack: `+s.message+`
702
702
  height: calc(100vh) !important;
703
703
  width: calc(100vw) !important;
704
704
  }
705
- `})),fY=n=>{const e=n.collectionName,{run:t}=Wv(e,n.key);return{run(){return Be(this,null,function*(){yield t()})}}},dY=({item:n,database:e})=>_.jsx(L.AddFieldAction,{trigger:["click"],align:{overflow:{adjustY:!1}},item:n,database:e,scope:{useCancelAction:Xn,useCreateCollectionField:()=>fY(n)},getContainer:nt,children:_.jsx(_e.PlusOutlined,{className:"btn-add",id:"graph_btn_add_field"})}),gY=n=>{const{targetGraph:e,item:t}=n;return _.jsx(_e.BranchesOutlined,{className:"btn-assocition",onClick:()=>{e.onConnectionAssociation(t)}})},pY=n=>{const{targetGraph:e,item:t}=n,{t:r}=li(),{getChildrenCollections:i}=L.useCollectionManager(),s=i(t.name);return(s==null?void 0:s.some(({name:a})=>!e.hasCell(a)))?_.jsx(ce.Tooltip,{title:r("Show child"),getPopupContainer:nt,children:_.jsx(_e.FallOutlined,{className:"btn-inheriedChild",onClick:()=>{e.onConnectionChilds(s.map(a=>a.name))}})}):""},mY=n=>{const{targetGraph:e,item:t}=n,{t:r}=li(),{getInheritCollections:i}=L.useCollectionManager(),s=i(t.name);return(s==null?void 0:s.some(a=>!e.hasCell(a)))?_.jsx(ce.Tooltip,{title:r("Show parent"),getPopupContainer:nt,children:_.jsx(_e.RiseOutlined,{className:"btn-inheriedParent",onClick:()=>{e.onConnectionParents(s)}})}):""},yY=({item:n,className:e})=>_.jsx(L.EditCollection,{item:n,scope:{useCancelAction:Xn,useUpdateCollectionActionAndRefreshCM:pl,createOnly:!1},getContainer:nt,children:_.jsx(_e.EditOutlined,{className:e})}),vY=r=>{var i=r,{item:n,className:e}=i,t=Hy(i,["item","className"]);return _.jsx(L.DeleteCollection,$e(re({item:n,scope:{useCancelAction:Xn,useUpdateCollectionActionAndRefreshCM:pl,createOnly:!1},getContainer:nt},t),{children:_.jsx(_e.DeleteOutlined,{className:e})}))},bY=n=>{const e=n.collectionName,{run:t}=eR({collectionName:e,name:n.name,key:n.key});return{run(){return Be(this,null,function*(){yield t()})}}},wY=({item:n})=>_.jsx(L.EditFieldAction,{item:n,scope:{useCancelAction:Xn,useUpdateCollectionField:()=>bY(n)},getContainer:nt,children:_.jsx(_e.EditOutlined,{className:"btn-edit"})}),xY=Ft.observer(n=>{const{schemaKey:e}=n,{getInterface:t}=L.useCollectionManager(),r=L.useCompile(),{t:i}=Qa.useTranslation(),s=t(e);return s?_.jsxs("div",{className:L.css`
705
+ `})),hY=n=>{const e=n.collectionName,{run:t}=Uv(e,n.key);return{run(){return Be(this,null,function*(){yield t()})}}},fY=({item:n,database:e})=>_.jsx(L.AddFieldAction,{trigger:["click"],align:{overflow:{adjustY:!1}},item:n,database:e,scope:{useCancelAction:Xn,useCreateCollectionField:()=>hY(n)},getContainer:nt,children:_.jsx(ue.PlusOutlined,{className:"btn-add",id:"graph_btn_add_field"})}),dY=n=>{const{targetGraph:e,item:t}=n;return _.jsx(ue.BranchesOutlined,{className:"btn-assocition",onClick:()=>{e.onConnectionAssociation(t)}})},gY=n=>{const{targetGraph:e,item:t}=n,{t:r}=li(),{getChildrenCollections:i}=L.useCollectionManager(),s=i(t.name);return(s==null?void 0:s.some(({name:a})=>!e.hasCell(a)))?_.jsx(ce.Tooltip,{title:r("Show child"),getPopupContainer:nt,children:_.jsx(ue.FallOutlined,{className:"btn-inheriedChild",onClick:()=>{e.onConnectionChilds(s.map(a=>a.name))}})}):""},pY=n=>{const{targetGraph:e,item:t}=n,{t:r}=li(),{getInheritCollections:i}=L.useCollectionManager(),s=i(t.name);return(s==null?void 0:s.some(a=>!e.hasCell(a)))?_.jsx(ce.Tooltip,{title:r("Show parent"),getPopupContainer:nt,children:_.jsx(ue.RiseOutlined,{className:"btn-inheriedParent",onClick:()=>{e.onConnectionParents(s)}})}):""},mY=({item:n,className:e})=>_.jsx(L.EditCollection,{item:n,scope:{useCancelAction:Xn,useUpdateCollectionActionAndRefreshCM:pl,createOnly:!1},getContainer:nt,children:_.jsx(ue.EditOutlined,{className:e})}),yY=r=>{var i=r,{item:n,className:e}=i,t=Hy(i,["item","className"]);return _.jsx(L.DeleteCollection,$e(re({item:n,scope:{useCancelAction:Xn,useUpdateCollectionActionAndRefreshCM:pl,createOnly:!1},getContainer:nt},t),{children:_.jsx(ue.DeleteOutlined,{className:e})}))},vY=n=>{const e=n.collectionName,{run:t}=ZL({collectionName:e,name:n.name,key:n.key});return{run(){return Be(this,null,function*(){yield t()})}}},bY=({item:n})=>_.jsx(L.EditFieldAction,{item:n,scope:{useCancelAction:Xn,useUpdateCollectionField:()=>vY(n)},getContainer:nt,children:_.jsx(ue.EditOutlined,{className:"btn-edit"})}),wY=Ft.observer(n=>{const{schemaKey:e}=n,{getInterface:t}=L.useCollectionManager(),r=L.useCompile(),{t:i}=Qa.useTranslation(),s=t(e);return s?_.jsxs("div",{className:L.css`
706
706
  background: #f6f6f6;
707
707
  margin-bottom: 24px;
708
708
  padding: 16px;
709
709
  `,children:[_.jsxs("div",{className:L.css``,children:[i("Field interface"),": ",_.jsx(ce.Tag,{children:r(s.title)})]}),s.description?_.jsx("div",{className:L.css`
710
710
  margin-top: 8px;
711
711
  color: rgba(0, 0, 0, 0.45);
712
- `,children:r(s.description)}):null]}):null},{displayName:"FieldSummary"}),CY=n=>{const e=n.targetCollection,{run:t}=Wv(e);return{run(){return Be(this,null,function*(){yield t()})}}},SY=({item:n})=>_.jsx(L.OverridingFieldAction,{item:re({},n),scope:{useCancelAction:Xn,useOverridingCollectionField:()=>CY(n)},getContainer:nt,children:_.jsx(_e.CopyOutlined,{className:"btn-override"})}),PY=({item:n})=>_.jsx(L.ViewFieldAction,{item:re({},n),getContainer:nt,children:_.jsx(_e.EyeOutlined,{className:"btn-view"})}),EY=H.memo(n=>{const{property:e,loadCollections:t,collectionData:r,setTargetNode:i,node:s,handelOpenPorts:o,title:a,name:l,targetGraph:c}=n,u=e.collectionName===l,h=H.useContext(Ft.SchemaOptionsContext),d=["hasOne","hasMany","belongsTo","belongsToMany"].includes(e.type)&&!(e.through?c.hasCell(e.through):c.hasCell(e.target)),{data:{database:g}}=L.useCurrentAppInfo(),p=m=>`${m||""}${Ja.uid()}`,b=()=>{const m=L.useRecord(),{getCollectionFields:y}=L.useCollectionManager();return y(m.collectionName||m.name)};return _.jsx("div",{className:"field-operator",children:_.jsx(L.SchemaComponentProvider,{components:re({Select:m=>_.jsx(L.Select,$e(re({popupMatchSelectWidth:!1},m),{getPopupContainer:nt})),FieldSummary:xY,AddFieldAction:dY,OverrideFieldAction:SY,ViewFieldAction:PY,EditFieldAction:wY,ConnectAssociationAction:gY},h.components),scope:re({useAsyncDataSource:ah,loadCollections:t,useCancelAction:Xn,useNewId:p,useCurrentFields:b,useValuesFromRecord:ZL,useUpdateCollectionActionAndRefreshCM:pl,isInheritField:u,isShowAssocition:d},h.scope),children:_.jsx(Hv,{record:r.current,setTargetNode:i,node:s,handelOpenPorts:()=>o(!0),children:_.jsx(L.SchemaComponent,{scope:Xn,schema:{type:"object",properties:{create:{type:"void","x-action":"create","x-component":"AddFieldAction","x-visible":"{{isInheritField}}","x-component-props":{item:$e(re({},e),{title:a}),database:g}},update:{type:"void","x-action":"update","x-component":"EditFieldAction","x-visible":"{{isInheritField}}","x-component-props":{item:$e(re({},e),{title:a,__parent:r.current})}},delete:{type:"void","x-action":"destroy","x-component":"Action","x-visible":"{{isInheritField}}","x-component-props":{component:_e.DeleteOutlined,icon:"DeleteOutlined",className:"btn-del",confirm:{title:"{{t('Delete record')}}",getContainer:nt,collectionConten:"{{t('Are you sure you want to delete it?')}}"},useAction:()=>iR({collectionName:e.collectionName,name:e.name})}},override:{type:"void","x-action":"create","x-visible":"{{!isInheritField}}","x-component":"OverrideFieldAction","x-component-props":{icon:"ReconciliationOutlined",item:$e(re({},e),{title:a,__parent:r.current,targetCollection:l})}},view:{type:"void","x-action":"view","x-visible":"{{!isInheritField}}","x-component":"ViewFieldAction","x-component-props":{icon:"ReconciliationOutlined",item:$e(re({},e),{title:a,__parent:r.current})}},connectAssociation:{type:"void","x-action":"view","x-visible":"{{isShowAssocition}}","x-component":"ConnectAssociationAction","x-component-props":{item:$e(re({},e),{title:a,__parent:r.current}),targetGraph:c}}}}})})})})}),PO=H.forwardRef((n,e)=>{var v,w,x,C;const y=n,{property:t,node:r}=y,i=Hy(y,["property","node"]),{store:{data:{title:s,name:o,sourcePort:a,associated:l,targetPort:c}}}=r,u=L.useCompile(),{styles:h}=By(),{getInterface:f}=L.useCollectionManager(),[d,g]=H.useState(!1),p=H.useCallback(S=>{const{type:E,name:A,primaryKey:O,allowNull:T,autoIncrement:I}=S;return _.jsxs("div",{className:h.collectionPopoverClass,children:[_.jsxs("div",{className:"field-content",children:[_.jsxs("div",{children:[_.jsx("span",{children:"name"}),": ",_.jsx("span",{className:"field-type",children:A})]}),_.jsxs("div",{children:[_.jsx("span",{children:"type"}),": ",_.jsx("span",{className:"field-type",children:E})]})]}),_.jsxs("p",{children:[O&&_.jsx(ce.Tag,{color:"green",children:"PRIMARY"}),T&&_.jsx(ce.Tag,{color:"geekblue",children:"ALLOWNULL"}),I&&_.jsx(ce.Tag,{color:"purple",children:"AUTOINCREMENT"})]})]})},[]),b=re({title:s,name:o,node:r},i),m=S=>{if(S.isForeignKey||S.primaryKey||S.interface==="id")return"red";if(["obo","oho","o2o","o2m","m2o","m2m","linkTo"].includes(S.interface))return"orange"};return _.jsx("div",{children:_.jsxs("div",{className:"body-item",id:t.id,style:{background:c||a===t.id||l!=null&&l.includes(t.name)?"#e6f7ff":null},onMouseEnter:()=>{g(!0)},onMouseLeave:()=>g(!1),children:[_.jsx(L.PopoverWithStopPropagation,{content:p(t),getPopupContainer:nt,mouseLeaveDelay:0,title:_.jsxs("div",{children:[u((v=t.uiSchema)==null?void 0:v.title),_.jsx("span",{style:{color:"#ffa940",float:"right"},children:u((w=f(t.interface))==null?void 0:w.title)})]}),placement:"right",children:_.jsxs("div",{className:"name",children:[_.jsx(ce.Badge,{color:m(t)}),u((x=t.uiSchema)==null?void 0:x.title)]})},t.id),_.jsx("div",{className:"type field_type",children:u((C=f(t.interface))==null?void 0:C.title)}),d&&_.jsx(EY,re({property:t},b))]},t.id)})}),AY=H.memo(({targetGraph:n,collectionData:e,setTargetNode:t,node:r,loadCollections:i})=>{var p,b;const{store:{data:{item:s,ports:o,data:a}}}=r,[l,c]=H.useState(!1),{t:u}=li(),h=Hu.groupBy(o.items,m=>m.isForeignKey||m.primaryKey||["obo","oho","o2o","o2m","m2o","m2m","linkTo","id"].includes(m.interface)?"initPorts":"morePorts"),f=m=>{var v;(v=n.getCellById(s.name))==null||v.toFront(),c(m);const y=n.collapseNodes||[];y.push({[s.name]:m}),n.collapseNodes=y,n.getCellById(s.name).setData({collapse:!0})},d=l&&(a==null?void 0:a.collapse),g={collectionData:e,setTargetNode:t,loadCollections:i,handelOpenPorts:f,node:r,targetGraph:n};return _.jsxs("div",{className:"body",children:[(p=h.initPorts)==null?void 0:p.map(m=>m.uiSchema&&H.createElement(PO,$e(re({},g),{property:m,key:m.id}))),_.jsx("div",{className:"morePorts",children:d&&((b=h.morePorts)==null?void 0:b.map(m=>m.uiSchema&&H.createElement(PO,$e(re({},g),{property:m,key:m.id}))))}),_.jsx("a",{className:Cr.css`
712
+ `,children:r(s.description)}):null]}):null},{displayName:"FieldSummary"}),xY=n=>{const e=n.targetCollection,{run:t}=Uv(e);return{run(){return Be(this,null,function*(){yield t()})}}},CY=({item:n})=>_.jsx(L.OverridingFieldAction,{item:re({},n),scope:{useCancelAction:Xn,useOverridingCollectionField:()=>xY(n)},getContainer:nt,children:_.jsx(ue.CopyOutlined,{className:"btn-override"})}),SY=({item:n})=>_.jsx(L.ViewFieldAction,{item:re({},n),getContainer:nt,children:_.jsx(ue.EyeOutlined,{className:"btn-view"})}),PY=Z.memo(n=>{const{property:e,loadCollections:t,collectionData:r,setTargetNode:i,node:s,handelOpenPorts:o,title:a,name:l,targetGraph:c}=n,u=e.collectionName===l,h=Z.useContext(Ft.SchemaOptionsContext),d=["hasOne","hasMany","belongsTo","belongsToMany"].includes(e.type)&&!(e.through?c.hasCell(e.through):c.hasCell(e.target)),{data:{database:g}}=L.useCurrentAppInfo(),p=m=>`${m||""}${fo.uid()}`,b=()=>{const m=L.useRecord(),{getCollectionFields:y}=L.useCollectionManager();return y(m.collectionName||m.name)};return _.jsx("div",{className:"field-operator",children:_.jsx(L.SchemaComponentProvider,{components:re({Select:m=>_.jsx(L.Select,$e(re({popupMatchSelectWidth:!1},m),{getPopupContainer:nt})),FieldSummary:wY,AddFieldAction:fY,OverrideFieldAction:CY,ViewFieldAction:SY,EditFieldAction:bY,ConnectAssociationAction:dY},h.components),scope:re({useAsyncDataSource:ah,loadCollections:t,useCancelAction:Xn,useNewId:p,useCurrentFields:b,useValuesFromRecord:QL,useUpdateCollectionActionAndRefreshCM:pl,isInheritField:u,isShowAssocition:d},h.scope),children:_.jsx(Gv,{record:r.current,setTargetNode:i,node:s,handelOpenPorts:()=>o(!0),children:_.jsx(L.SchemaComponent,{scope:Xn,schema:{type:"object",properties:{create:{type:"void","x-action":"create","x-component":"AddFieldAction","x-visible":"{{isInheritField}}","x-component-props":{item:$e(re({},e),{title:a}),database:g}},update:{type:"void","x-action":"update","x-component":"EditFieldAction","x-visible":"{{isInheritField}}","x-component-props":{item:$e(re({},e),{title:a,__parent:r.current})}},delete:{type:"void","x-action":"destroy","x-component":"Action","x-visible":"{{isInheritField}}","x-component-props":{component:ue.DeleteOutlined,icon:"DeleteOutlined",className:"btn-del",confirm:{title:"{{t('Delete record')}}",getContainer:nt,collectionConten:"{{t('Are you sure you want to delete it?')}}"},useAction:()=>rR({collectionName:e.collectionName,name:e.name})}},override:{type:"void","x-action":"create","x-visible":"{{!isInheritField}}","x-component":"OverrideFieldAction","x-component-props":{icon:"ReconciliationOutlined",item:$e(re({},e),{title:a,__parent:r.current,targetCollection:l})}},view:{type:"void","x-action":"view","x-visible":"{{!isInheritField}}","x-component":"ViewFieldAction","x-component-props":{icon:"ReconciliationOutlined",item:$e(re({},e),{title:a,__parent:r.current})}},connectAssociation:{type:"void","x-action":"view","x-visible":"{{isShowAssocition}}","x-component":"ConnectAssociationAction","x-component-props":{item:$e(re({},e),{title:a,__parent:r.current}),targetGraph:c}}}}})})})})}),SO=Z.forwardRef((n,e)=>{var v,w,x,C;const y=n,{property:t,node:r}=y,i=Hy(y,["property","node"]),{store:{data:{title:s,name:o,sourcePort:a,associated:l,targetPort:c}}}=r,u=L.useCompile(),{styles:h}=By(),{getInterface:f}=L.useCollectionManager(),[d,g]=Z.useState(!1),p=Z.useCallback(S=>{const{type:E,name:A,primaryKey:O,allowNull:T,autoIncrement:I}=S;return _.jsxs("div",{className:h.collectionPopoverClass,children:[_.jsxs("div",{className:"field-content",children:[_.jsxs("div",{children:[_.jsx("span",{children:"name"}),": ",_.jsx("span",{className:"field-type",children:A})]}),_.jsxs("div",{children:[_.jsx("span",{children:"type"}),": ",_.jsx("span",{className:"field-type",children:E})]})]}),_.jsxs("p",{children:[O&&_.jsx(ce.Tag,{color:"green",children:"PRIMARY"}),T&&_.jsx(ce.Tag,{color:"geekblue",children:"ALLOWNULL"}),I&&_.jsx(ce.Tag,{color:"purple",children:"AUTOINCREMENT"})]})]})},[]),b=re({title:s,name:o,node:r},i),m=S=>{if(S.isForeignKey||S.primaryKey||S.interface==="id")return"red";if(["obo","oho","o2o","o2m","m2o","m2m","linkTo"].includes(S.interface))return"orange"};return _.jsx("div",{children:_.jsxs("div",{className:"body-item",id:t.id,style:{background:c||a===t.id||l!=null&&l.includes(t.name)?"#e6f7ff":null},onMouseEnter:()=>{g(!0)},onMouseLeave:()=>g(!1),children:[_.jsx(L.PopoverWithStopPropagation,{content:p(t),getPopupContainer:nt,mouseLeaveDelay:0,title:_.jsxs("div",{children:[u((v=t.uiSchema)==null?void 0:v.title),_.jsx("span",{style:{color:"#ffa940",float:"right"},children:u((w=f(t.interface))==null?void 0:w.title)})]}),placement:"right",children:_.jsxs("div",{className:"name",children:[_.jsx(ce.Badge,{color:m(t)}),u((x=t.uiSchema)==null?void 0:x.title)]})},t.id),_.jsx("div",{className:"type field_type",children:u((C=f(t.interface))==null?void 0:C.title)}),d&&_.jsx(PY,re({property:t},b))]},t.id)})}),EY=Z.memo(({targetGraph:n,collectionData:e,setTargetNode:t,node:r,loadCollections:i})=>{var p,b;const{store:{data:{item:s,ports:o,data:a}}}=r,[l,c]=Z.useState(!1),{t:u}=li(),h=Hu.groupBy(o.items,m=>m.isForeignKey||m.primaryKey||["obo","oho","o2o","o2m","m2o","m2m","linkTo","id"].includes(m.interface)?"initPorts":"morePorts"),f=m=>{var v;(v=n.getCellById(s.name))==null||v.toFront(),c(m);const y=n.collapseNodes||[];y.push({[s.name]:m}),n.collapseNodes=y,n.getCellById(s.name).setData({collapse:!0})},d=l&&(a==null?void 0:a.collapse),g={collectionData:e,setTargetNode:t,loadCollections:i,handelOpenPorts:f,node:r,targetGraph:n};return _.jsxs("div",{className:"body",children:[(p=h.initPorts)==null?void 0:p.map(m=>m.uiSchema&&Z.createElement(SO,$e(re({},g),{property:m,key:m.id}))),_.jsx("div",{className:"morePorts",children:d&&((b=h.morePorts)==null?void 0:b.map(m=>m.uiSchema&&Z.createElement(SO,$e(re({},g),{property:m,key:m.id}))))}),_.jsx("a",{className:Cr.css`
713
713
  display: block;
714
714
  color: #958f8f;
715
715
  padding: 10px 5px;
716
716
  &:hover {
717
717
  color: rgb(99 90 88);
718
718
  }
719
- `,onClick:()=>f(!d),children:d?[_.jsx(_e.UpOutlined,{style:{margin:"0px 8px 0px 5px"}},"icon"),_.jsx("span",{children:u("Association Fields")},"associate")]:[_.jsx(_e.DownOutlined,{style:{margin:"0px 8px 0px 5px"}},"icon"),_.jsx("span",{children:u("All Fields")},"all")]})]})}),TY=n=>{const{styles:e}=By(),t=H.useContext(Ft.SchemaOptionsContext),{node:r,setTargetNode:i,targetGraph:s}=n,{store:{data:{title:o,name:a,item:l,attrs:c,select:u,actived:h}},id:f}=r,{data:{database:d}}=L.useCurrentAppInfo(),g=H.useRef(),p=H.useContext(L.CollectionCategroriesContext);g.current=$e(re({},l),{title:o,inherits:l.inherits&&new Proxy(l.inherits,{})});const{category:b}=l,m=L.useCompile(),y=x=>Be(this,null,function*(){var C;return(C=s.collections)==null?void 0:C.map(S=>({label:m(S.title),value:S.name}))}),v=()=>Be(this,null,function*(){return p==null?void 0:p.data.map(x=>({label:m(x.name),value:x.id}))}),w={targetGraph:s,collectionData:g,setTargetNode:i,node:r,loadCollections:y};return _.jsxs("div",{className:e.entityContainer,style:{boxShadow:c==null?void 0:c.boxShadow,border:u?"2px dashed #f5a20a":0},children:[b.map((x,C)=>_.jsx(ce.Badge.Ribbon,{color:x.color,style:{width:"103%",height:"3px",marginTop:C*5-8,borderRadius:0},placement:"start"},C)),_.jsxs("div",{className:e.headClass,style:{background:c!=null&&c.hightLight?"#1890ff":null,paddingTop:b.length*3},children:[_.jsx("span",{className:e.tableNameClass,children:m(o)}),_.jsx("div",{className:e.tableBtnClass,children:_.jsx(L.SchemaComponentProvider,{children:_.jsx(Hv,{setTargetNode:i,node:r,children:_.jsx(L.CollectionProvider,{collection:L.collection,children:_.jsx(L.SchemaComponent,{scope:{useUpdateCollectionActionAndRefreshCM:pl,useCancelAction:Xn,loadCollections:y,loadCategories:v,useAsyncDataSource:ah,enableInherits:(d==null?void 0:d.dialect)==="postgres",actived:h===!0},components:re({EditOutlined:_e.EditOutlined,EditCollectionAction:yY,DeleteCollectionAction:vY,ConnectChildAction:pY,ConnectParentAction:mY},t.components),schema:{type:"object",name:r.id,properties:{connectParent:{type:"void","x-visible":"{{actived}}","x-component":"ConnectParentAction","x-component-props":{item:g.current,targetGraph:s}},connectChild:{type:"void","x-component":"ConnectChildAction","x-component-props":{item:g.current,targetGraph:s},"x-visible":"{{actived}}"},update:{type:"void",title:'{{ t("Edit") }}',"x-component":"EditCollectionAction","x-component-props":{type:"primary",item:g.current,className:"btn-edit-in-head"}},delete:{type:"void","x-action":"destroy","x-component":"DeleteCollectionAction","x-component-props":{className:"btn-del",getContainer:nt,item:g.current,useAction:()=>nR({name:a,id:f})}}}}})})})})})]}),_.jsx(AY,re({},w))]})},OY=H.forwardRef(()=>{const{t:n}=li(),[e,{toggleFullscreen:t}]=zO.useFullscreen(document.getElementById("graph_container"));return _.jsx(ce.Tooltip,{title:n("Full Screen"),getPopupContainer:nt,children:_.jsx(ce.Button,{onClick:()=>{t()},children:e?_.jsx(_e.FullscreenExitOutlined,{}):_.jsx(_e.FullscreenOutlined,{})})})}),MY=n=>{const{handleFiterCollections:e}=n,{handleSearchCollection:t,collectionList:r}=H.useContext(Gy),[i,s]=H.useState([]),{t:o}=li(),a=L.useCompile(),l=_.jsxs("div",{children:[_.jsx(ce.Input,{style:{margin:"4px 0"},bordered:!1,placeholder:o("Collection Search"),onChange:t}),_.jsx(ce.Menu,{selectedKeys:i,selectable:!0,className:Cr.css`
719
+ `,onClick:()=>f(!d),children:d?[_.jsx(ue.UpOutlined,{style:{margin:"0px 8px 0px 5px"}},"icon"),_.jsx("span",{children:u("Association Fields")},"associate")]:[_.jsx(ue.DownOutlined,{style:{margin:"0px 8px 0px 5px"}},"icon"),_.jsx("span",{children:u("All Fields")},"all")]})]})}),AY=n=>{const{styles:e}=By(),t=Z.useContext(Ft.SchemaOptionsContext),{node:r,setTargetNode:i,targetGraph:s}=n,{store:{data:{title:o,name:a,item:l,attrs:c,select:u,actived:h}},id:f}=r,{data:{database:d}}=L.useCurrentAppInfo(),g=Z.useRef(),p=Z.useContext(L.CollectionCategroriesContext);g.current=$e(re({},l),{title:o,inherits:l.inherits&&new Proxy(l.inherits,{})});const{category:b}=l,m=L.useCompile(),y=x=>Be(this,null,function*(){var C;return(C=s.collections)==null?void 0:C.map(S=>({label:m(S.title),value:S.name}))}),v=()=>Be(this,null,function*(){return p==null?void 0:p.data.map(x=>({label:m(x.name),value:x.id}))}),w={targetGraph:s,collectionData:g,setTargetNode:i,node:r,loadCollections:y};return _.jsxs("div",{className:e.entityContainer,style:{boxShadow:c==null?void 0:c.boxShadow,border:u?"2px dashed #f5a20a":0},children:[b.map((x,C)=>_.jsx(ce.Badge.Ribbon,{color:x.color,style:{width:"103%",height:"3px",marginTop:C*5-8,borderRadius:0},placement:"start"},C)),_.jsxs("div",{className:e.headClass,style:{background:c!=null&&c.hightLight?"#1890ff":null,paddingTop:b.length*3},children:[_.jsx("span",{className:e.tableNameClass,children:m(o)}),_.jsx("div",{className:e.tableBtnClass,children:_.jsx(L.SchemaComponentProvider,{children:_.jsx(Gv,{setTargetNode:i,node:r,children:_.jsx(L.CollectionProvider,{collection:L.collection,children:_.jsx(L.SchemaComponent,{scope:{useUpdateCollectionActionAndRefreshCM:pl,useCancelAction:Xn,loadCollections:y,loadCategories:v,useAsyncDataSource:ah,enableInherits:(d==null?void 0:d.dialect)==="postgres",actived:h===!0},components:re({EditOutlined:ue.EditOutlined,EditCollectionAction:mY,DeleteCollectionAction:yY,ConnectChildAction:gY,ConnectParentAction:pY},t.components),schema:{type:"object",name:r.id,properties:{connectParent:{type:"void","x-visible":"{{actived}}","x-component":"ConnectParentAction","x-component-props":{item:g.current,targetGraph:s}},connectChild:{type:"void","x-component":"ConnectChildAction","x-component-props":{item:g.current,targetGraph:s},"x-visible":"{{actived}}"},update:{type:"void",title:'{{ t("Edit") }}',"x-component":"EditCollectionAction","x-component-props":{type:"primary",item:g.current,className:"btn-edit-in-head"}},delete:{type:"void","x-action":"destroy","x-component":"DeleteCollectionAction","x-component-props":{className:"btn-del",getContainer:nt,item:g.current,useAction:()=>tR({name:a,id:f})}}}}})})})})})]}),_.jsx(EY,re({},w))]})},TY=Z.forwardRef(()=>{const{t:n}=li(),[e,{toggleFullscreen:t}]=BO.useFullscreen(document.getElementById("graph_container"));return _.jsx(ce.Tooltip,{title:n("Full Screen"),getPopupContainer:nt,children:_.jsx(ce.Button,{onClick:()=>{t()},children:e?_.jsx(ue.FullscreenExitOutlined,{}):_.jsx(ue.FullscreenOutlined,{})})})}),OY=n=>{const{handleFiterCollections:e}=n,{handleSearchCollection:t,collectionList:r}=Z.useContext(Gy),[i,s]=Z.useState([]),{t:o}=li(),a=L.useCompile(),l=_.jsxs("div",{children:[_.jsx(ce.Input,{style:{margin:"4px 0"},bordered:!1,placeholder:o("Collection Search"),onChange:t}),_.jsx(ce.Menu,{selectedKeys:i,selectable:!0,className:Cr.css`
720
720
  .ant-menu-item {
721
721
  height: 32px;
722
722
  line-height: 32px;
@@ -725,9 +725,9 @@ Error generating stack: `+s.message+`
725
725
  .ant-popover-inner-content {
726
726
  padding: 0;
727
727
  }
728
- `,children:_.jsx(ce.Button,{children:_.jsx(_e.MenuOutlined,{})})})},_Y=n=>{const{collectionList:e}=H.useContext(Gy),t=L.useCompile(),[r,i]=Uy.useSearchParams(),s=r.get("collections"),o=s==null?void 0:s.split(","),a=o==null?void 0:o.filter(u=>e.find(h=>h.name===u)),l=H.useMemo(()=>e.map(u=>({label:t(u.title),value:u.name})),[e]),c=u=>{i([["collections",u.toString()]])};return _.jsx(L.Select,{value:a,showSearch:!0,getPopupContainer:nt,mode:"multiple",allowClear:!0,options:l,onChange:c,style:{minWidth:200,position:"fixed",margin:"24px",zIndex:1e3,maxWidth:"60%"}})};class NY extends kt{renderMarkup(){return this.renderJSONMarkup({tagName:"rect",selector:"body"})}update(){const t=this.cell.getAttrs().hightLight?"#1890ff":"gray";super.update({body:{refWidth:"50px",refHeight:"100px",fill:t}})}}const{drop:EO,groupBy:AO,last:kY,maxBy:Ua,minBy:zy,take:TO,uniq:Fy}=Hu,Vy=40,qy=250;let N,_n;const $Y="TB";var Wa=(n=>(n.Both="both",n.Target="target",n.Source="source",n))(Wa||{}),Xa=(n=>(n.Both="both",n.Inherit="inherited",n.Entity="entity",n))(Xa||{});const Bu=(n,e)=>{const t=[];for(;(e==null?void 0:e.length)>0&&n;)t.push(e.splice(0,n));return t};function IY(n,e){return Be(this,null,function*(){const{positions:t}=N;let r=[];const i=N.getNodes(),s=N.getEdges(),o=new ju.graphlib.Graph;o.setGraph({rankdir:$Y,nodesep:50,edgesep:50,rankSep:50,align:"DL",controlPoints:!0}),o.setDefaultEdgeLabel(()=>({})),i.forEach((l,c)=>{const u=qy,h=l.getPorts().length*32+30;o.setNode(l.id,{width:u,height:h})}),ju.layout(o),Bu(15,o.nodes()).forEach((l,c)=>{l.forEach((u,h)=>{const f=N.getCellById(u),d=h%15;if(f){const g=t&&t.find(b=>b.collectionName===f.store.data.name)||{},p={x:d*325+50,y:c*400+100};f.position(g.x||p.x,g.y||p.y),t&&!t.find(b=>b.collectionName===f.store.data.name)&&r.push({collectionName:f.store.data.name,x:p.x,y:p.y})}})}),s.forEach(l=>{zu(l)}),_n?typeof _n=="string"?N.positionCell(kY(i),"top",{padding:100}):N.positionCell(_n,"top",{padding:100}):N.positionCell(i[0],"top-left",{padding:100}),r.length>0&&e&&(yield n(r),r=[])})}function zu(n){var u,h;const{store:{data:{connectionType:e}}}=n,t=n.getSource(),r=n.getTarget(),i=(u=N.getCellById(t.cell))==null?void 0:u.position().x,s=(h=N.getCellById(r.cell))==null?void 0:h.position().x,o=e?{name:"topLeft",args:{dy:20}}:{name:"left"},a=e?{name:"topRight",args:{dy:20}}:"right",l=e?"normal":"er";if(n.getVertices().forEach(()=>n.removeVertexAt(0)),i-100>s)n.setSource({cell:t.cell,port:t.port,anchor:o}),n.setTarget({cell:r.cell,port:r.port,anchor:a}),n.setRouter(l,{direction:"H"});else if(Math.abs(i-s)<100){const f=N.getCellById(t.cell),d=N.getCellById(r.cell);n.setSource({cell:t.cell,port:t.port,anchor:o}),n.setTarget({cell:r.cell,port:r.port,anchor:o}),e?(n.setVertices([{x:f.position().x-30,y:f.position().y+20},{x:d.position().x-30,y:d.position().y+20}]),n.setRouter("normal")):n.setRouter("oneSide",{side:"left"})}else n.setSource({cell:t.cell,port:t.port,anchor:a}),n.setTarget({cell:r.cell,port:r.port,anchor:o}),n.setRouter(l,{direction:"H"})}const Gy=H.createContext({}),LY=()=>{const n=[],e=N.getEdges(),t=N.getNodes();return e.forEach(i=>{n.push(i.getSourceCellId()),n.push(i.getTargetCellId())}),AO(t,i=>n.includes(i.id)?"linkNodes":"rawNodes")},OO=n=>{var y;const{linkNodes:e=[],rawNodes:t=[]}=LY(),{positions:r}=N,i=e.concat(t||[]),s=N.getEdges(),o=new ju.graphlib.Graph;let a,l,c,u,h;const f=[];o.setGraph({rankdir:"TB",nodesep:50,edgesep:50,rankSep:50,align:"DL",controlPoints:!0});const d=250,g=400;i.forEach(v=>{o.setNode(v.id,{width:d,height:g})}),s.forEach(v=>{const w=v.getSource(),x=v.getTarget();o.setEdge(w.cell,x.cell,{})}),ju.layout(o);const p=o.nodes(),b=TO(p,e.length),m=EO(p,e.length);if(b.forEach(v=>{var C;const w=N.getCellById(v),x=(C=r.find(S=>S.collectionName===w.id))==null?void 0:C.id;if(w){const S=o.node(v);f.push({id:x,x:S.x,y:S.y}),w.position(S==null?void 0:S.x,S==null?void 0:S.y)}}),b.length){h=N.getCellById(Ua(b,C=>N.getCellById(C).position().y)).position().y,u=N.getCellById(zy(b,C=>N.getCellById(C).position().x)).position().x;const v=N.getCellById(Ua(b,C=>N.getCellById(C).position().x)).position().x,w=b.filter(C=>Math.abs(N.getCellById(C).position().y-h)<50),x=(y=N.getCellById(Ua(w,C=>N.getCellById(C).position().x)))==null?void 0:y.position();if(c=Math.round(v/320)||1,a=Math.floor((4500-(v+100-x.x))/280),l=Bu(c,t),a>=1){const C=TO(m,a);l=Bu(c,EO(m,a)),C.forEach((S,E)=>{var O;const A=N.getCellById(S);if(A){const T={x:x.x+320*E+280,y:x.y};A.position(T.x,T.y);const I=(O=r.find(G=>G.collectionName===A.id))==null?void 0:O.id;f.push({id:I,x:T.x,y:T.y})}})}}else c=15,a=0,l=Bu(15,t),u=50,h=50;l.forEach((v,w)=>{v.forEach((x,C)=>{var A;const S=N.getCellById(x),E=C%c;if(S){const O={x:E*325+u,y:w*300+h+300};S.position(O.x,O.y);const T=(A=r.find(I=>I.collectionName===S.id))==null?void 0:A.id;f.push({id:T,x:O.x,y:O.y})}})}),s.forEach(v=>{zu(v)}),N.positionCell(i[0],"top-left",{padding:100}),n||N.updatePositionAction(f,!0)},MO=H.memo(()=>{const{theme:n}=L.useGlobalTheme(),{styles:e}=By(),[t,r]=Uy.useSearchParams(),i=t.get("collections"),s=H.useContext(Ft.SchemaOptionsContext),o=H.useContext(L.CollectionManagerContext),a=L.useAPIClient(),l=L.useCompile(),{t:c}=li(),[u,h]=H.useState([]),[f,d]=H.useState([]),[g,p]=H.useState(!1),{refreshCM:b,collections:m}=L.useCollectionManager(),y=L.useCurrentAppInfo(),{data:{database:v}}=y,w=H.useContext(L.CollectionCategroriesContext),x=re({},s==null?void 0:s.scope),C=re({},s==null?void 0:s.components),S=$=>Be(this,null,function*(){yield a.resource("graphPositions").create({values:$}),yield A()}),E=($,B=!1)=>Be(this,null,function*(){i||(B?yield a.resource("graphPositions").update({values:$}):yield a.resource("graphPositions").update({filter:{collectionName:$.collectionName},values:re({},$)}),yield A())}),A=()=>Be(this,null,function*(){const{data:$}=yield a.resource("graphPositions").list({paginate:!1});return N.positions=$.data,Promise.resolve()}),O=$=>{_n=$,$==="destory"&&A()},T=$=>Be(this,null,function*(){const B=($==null?void 0:$.length)>0?$:yield b();N.collections=B,N.updatePositionAction=E;const W=N.getNodes();h(B),d(B),W.length?z(B):i||R(B)}),I=()=>{N=new V({container:document.getElementById("container"),moveThreshold:0,virtual:!1,async:!0,connecting:{anchor:{name:"midSide"}},mousewheel:{enabled:!0,modifiers:["ctrl","meta"]},interacting:{magnetConnectable:!1},preventDefaultBlankAction:!0}),N.connectionType="both",N.direction="target",N.cacheCollection={},N.onConnectionAssociation=G,N.onConnectionChilds=Y,N.onConnectionParents=M,V.registerPortLayout("erPortPosition",$=>$.map((B,W)=>({position:{x:0,y:(W+1)*Vy},angle:0})),!0),lU({shape:"er-rect",width:qy,height:Vy,ports:{groups:{list:{markup:[{tagName:"rect",selector:"portBody"}],attrs:{portBody:{width:qy,height:Vy,strokeWidth:1,visibility:"hidden"}},position:"erPortPosition"}}},body:{refWidth:100,refHeight:100},component:H.forwardRef(($,B)=>_.jsx(L.CurrentAppInfoContext.Provider,{value:y,children:_.jsx(L.APIClientProvider,{apiClient:a,children:_.jsx(L.SchemaComponentOptions,{inherit:!0,scope:x,components:C,children:_.jsx(L.CollectionCategroriesProvider,$e(re({},w),{children:_.jsx(L.CollectionManagerProvider,{collections:N==null?void 0:N.collections,refreshCM:T,interfaces:o.interfaces,children:_.jsx(ce.ConfigProvider,{theme:n,children:_.jsx("div",{style:{height:"auto"},children:_.jsx(ce.App,{children:_.jsx(TY,$e(re({},$),{setTargetNode:O,targetGraph:N}))})})})})}))})})}))}),N.use(new Kw({autoResize:!0,enabled:!0,pannable:!0,pageVisible:!0,pageBreak:!1,padding:{top:10,left:500,right:300,bottom:300}})),N.use(new Yw({container:document.getElementById("graph-minimap"),width:300,height:200,padding:10,graphOptions:{async:!0,createCellView($){if($.isEdge())return null;if($.isNode())return NY}}})),N.use(new Is({enabled:!1,multiple:!0,rubberband:!0,movable:!0,className:"node-selecting",modifiers:"shift"})),N.use(new Zw({enabled:!0})),N.on("edge:mouseleave",({e:$,edge:B})=>{$.stopPropagation(),k(B)}),N.on("node:mouseleave",({e:$,node:B})=>{$.stopPropagation(),B.setProp({actived:!1})}),N.on("node:moved",({e:$,node:B})=>{$.stopPropagation();const W=N.getConnectedEdges(B),ne=B.position(),oe=N.positions.find(ve=>ve.collectionName===B.store.data.name);oe?(oe.x!==ne.x||oe.y!==ne.y)&&E(re({collectionName:B.store.data.name},ne)):S(re({collectionName:B.store.data.name},ne)),W.forEach(ve=>{zu(ve)})}),N.on("cell:mouseenter",({e:$,cell:B,edge:W,node:ne})=>{$.stopPropagation(),B.toFront(),ne&&B.setProp({actived:!0}),W&&Z(W)}),N.on("blank:click",$=>{var B;N!=null&&N.activeEdge&&k(N==null?void 0:N.activeEdge),(B=N.collapseNodes)==null||B.map(W=>{const ne=N.getCellById(Object.keys(W)[0]);Object.values(W)[0]&&(ne==null||ne.setData({collapse:!1}))}),N.cleanSelection()}),N.on("node:selected",({e:$,node:B})=>{B.setProp({select:!0})}),N.on("node:unselected",({e:$,node:B})=>{B.setProp({select:!1})})},G=({target:$,through:B})=>{var oe;const W=((oe=N.selectedCollections)==null?void 0:oe.split(","))||[];W.push($),B&&W.push(B);const ne=Fy(W).toString();r([["collections",ne]]),N.selectedCollections=ne},Y=$=>{let B=N.selectedCollections.split(",")||[];B=B.concat($);const W=Fy(B).toString();r([["collections",W]]),N.selectedCollections=W},M=$=>{let B=N.selectedCollections.split(",")||[];B=B.concat($);const W=Fy(B).toString();r([["collections",W]]),N.selectedCollections=W},k=$=>{var Tt,De;N.activeEdge=null;const{m2m:B,connectionType:W}=(De=(Tt=$.store)==null?void 0:Tt.data)!=null?De:{},ne=B==null?void 0:B.find(Je=>Je!==$.id),oe=N.getCellById(ne),ve=Je=>{const Ge=N.getCellById(Je.store.data.target.cell),zt=N.getCellById(Je.store.data.source.cell);Ge.setProp({targetPort:!1,associated:null}),zt.setProp({sourcePort:!1,associated:null}),Je.setAttrs({line:{stroke:"#ddd",targetMarker:W==="inherited"?{name:"classic",fill:"#ddd"}:null}}),Je.setLabels(Je.getLabels().map(Ot=>$e(re({},Ot),{attrs:{labelText:$e(re({},Ot.attrs.labelText),{fill:"rgba(0, 0, 0, 0.3)"}),labelBody:$e(re({},Ot.attrs.labelBody),{stroke:"#ddd"})}})))};ve($),oe&&ve(oe)},Z=$=>{var De,Je;N.activeEdge=$;const{associated:B,m2m:W,connectionType:ne}=(Je=(De=$.store)==null?void 0:De.data)!=null?Je:{},oe=W==null?void 0:W.find(Ge=>Ge!==$.id),ve=N.getCellById(oe),Tt=Ge=>{Ge.toFront(),Ge.setAttrs({line:{stroke:"#1890ff",strokeWidth:1,textAnchor:"middle",textVerticalAnchor:"middle",sourceMarker:null,targetMarker:ne==="inherited"?{name:"classic",fill:"#1890ff"}:null}}),Ge.setLabels(Ge.getLabels().map(Jt=>$e(re({},Jt),{attrs:{labelText:$e(re({},Jt.attrs.labelText),{fill:"#1890ff"}),labelBody:$e(re({},Jt.attrs.labelBody),{stroke:"#1890ff"})}})));const zt=N.getCellById(Ge.store.data.target.cell),Ot=N.getCellById(Ge.store.data.source.cell);zt.toFront(),Ot.toFront(),zt.setProp({targetPort:Ge.store.data.target.port,associated:B}),Ot.setProp({sourcePort:Ge.store.data.source.port,associated:B})};Tt($),ve&&Tt(ve)},R=($,B=!0)=>{N.clearCells();const{nodesData:W,edgesData:ne,inheritEdges:oe}=xO($);N.data={nodes:W,edges:ne},N.fromJSON({nodes:W}),N.addEdges(ne),N.addEdges(oe),IY(S,B)},z=$=>{var kO,$O;const{positions:B}=N,{nodesData:W,edgesData:ne,inheritEdges:oe}=xO($),ve=N.getNodes().map(Nn=>Nn.store.data),Tt=N.getEdges().map(Nn=>Nn.store.data),De=AO(Tt,Nn=>Nn.connectionType?"currentInheritEdges":"currentRelateEdges"),Je=aY(W,ve),Ge=SO(ne,De.currentRelateEdges||[]),zt=SO(oe,De.currentInheritEdges||[]),Ot=(kO=Ua(B,"y"))==null?void 0:kO.y,Jt=($O=zy(B,"x"))==null?void 0:$O.x,NO=B.filter(Nn=>Math.abs(Nn.y-Ot)<100);let Ya=Ua(NO,"x"),qu;Je.forEach(({status:Nn,node:Gi,port:ho})=>{const Ka=N.getCellById(Gi.id);switch(Nn){case"add":Ya.x>4500?(Ya=zy(NO,"x"),qu={x:Jt,y:Ya.y+400}):qu={x:Ya.x+350,y:Ya.y},_n=N.addNode($e(re({},Gi),{position:qu})),i||S(re({collectionName:Gi.name},qu)),N&&N.positionCell(_n,"top",{padding:200});break;case"insertPort":Ka.insertPort(ho.index,ho.port);break;case"deletePort":Ka.removePort(ho.id);break;case"updateNode":Ka.setProp({title:Gi.title});break;case"delete":N.removeCell(Gi.id);break;default:return null}});const BY=Nn=>{Nn.forEach(({status:Gi,edge:ho})=>{const Ka=N.addEdge(re({},ho));switch(Gi){case"add":zu(Ka);break;case"delete":N.removeCell(ho.id);break;default:return null}})};setTimeout(()=>{BY(Ge.concat(zt))},300)},U=$=>{const B=$.target.value.toLowerCase();if(B){const W=u.filter(ne=>l(ne.title).toLowerCase().includes(B));d(W)}else d(u)},te=($,B)=>{B==="target"?wO(N.collections,$).forEach(ne=>{var oe;(oe=N.getCellById(ne))==null||oe.setAttrs({hightLight:!0,direction:B,connectionType:"inherited"})}):rY(N.collections,$).forEach(ne=>{var oe;(oe=N.getCellById(ne.name))==null||oe.setAttrs({hightLight:!0,direction:B,connectionType:"inherited"})})},we=$=>{const B=N.getCellById($);N.cacheCollection[$]=!0,N.getConnectedEdges(B).filter(oe=>{var ve;return!((ve=oe.store.data)!=null&&ve.connectionType)&&oe.getTargetCellId()===$}).forEach(oe=>{var De;oe.store.data.m2m&&oe.store.data.m2m.forEach(Je=>{var zt;const Ge=N.getCellById(Je);if(Ge.getTargetCellId()===$){const Ot=Ge.getSourceCellId(),Jt=N.getCellById(Ot);(zt=Jt.store.data.attrs)!=null&&zt.hightLight||(Jt.setAttrs({hightLight:!0,direction:"target",connectionType:"entity"}),we(Ot))}});const ve=oe.getSourceCellId(),Tt=N.getCellById(ve);(De=Tt.store.data.attrs)!=null&&De.hightLight||(Tt.setAttrs({hightLight:!0,direction:"target",connectionType:"entity"}),we(ve))})},Kt=$=>{const B=N.getCellById($);N.getConnectedEdges(B).filter(oe=>{var ve;return!((ve=oe.store.data)!=null&&ve.connectionType)&&oe.getSourceCellId()===$}).forEach(oe=>{var De;oe.store.data.m2m&&oe.store.data.m2m.forEach(Je=>{var zt;const Ge=N.getCellById(Je);if(Ge.getSourceCellId()===$){const Ot=Ge.getTargetCellId(),Jt=N.getCellById(Ot);(zt=Jt.store.data.attrs)!=null&&zt.hightLight||(Jt.setAttrs({hightLight:!0,direction:"source",connectionType:"entity"}),Kt(Ot))}});const ve=oe.getTargetCellId(),Tt=N.getCellById(ve);(De=Tt.store.data.attrs)!=null&&De.hightLight||(Tt.setAttrs({hightLight:!0,direction:"source",connectionType:"entity"}),Kt(ve))})},Ye=($,B)=>{B==="target"?we($):Kt($)},gn=($,B,W)=>{var ve,Tt;const ne=N.getNodes().filter(De=>{var Je;return(Je=De.store.data.attrs)==null?void 0:Je.hightLight}),oe=ne.length;for(let De=0;De<oe;De++){const{direction:Je,connectionType:Ge}=ne[De].getAttrs(),zt=ne[De].id!==$,Ot=$&&((ve=N.filterConfig)==null?void 0:ve.key)===$?Je!==B:!0,Jt=$&&((Tt=N.filterConfig)==null?void 0:Tt.key)===$?Ge!==W:!0;ne[De].id!==$&&setTimeout(()=>{zt&&(Ot||Jt)&&ne[De].setAttrs({hightLight:!1})},0)}},Ke=$=>{const{connectionType:B,direction:W,filterConfig:ne}=N,oe=$===(ne==null?void 0:ne.key)&&W==="both",ve=$===(ne==null?void 0:ne.key)&&(B==="both"||B===ne.connectionType);$?((!oe||!ve)&&gn($,W,B),_n=N.getCellById($),N.positionCell(_n,"center",{padding:0}),_n.setAttrs({hightLight:!0,connectionType:B}),setTimeout(()=>{["entity","both"].includes(B)&&(W==="both"?(Ye($,"target"),Ye($,"source")):(W==="target"&&Ye($,W),W==="source"&&Ye($,W))),["inherited","both"].includes(B)&&(W==="both"?(te($,"target"),te($,"source")):te($,W)),N.filterConfig={key:$,direction:W,connectionType:B}},0)):(N.filterConfig=null,gn())},At=$=>{N.connectionType=$;const{filterConfig:B}=N;B&&Ke(B.key),Fu($)},Fu=$=>{_n=null,N.getEdges().forEach(W=>{const{store:{data:{connectionType:ne}}}=W;$==="entity"?ne?W.setVisible(!1):W.setVisible(!0):$==="inherited"?ne?W.setVisible(!0):W.setVisible(!1):W.setVisible(!0)})},Vu=$=>{N.direction=$;const{filterConfig:B}=N;B&&Ke(B.key)};H.useLayoutEffect(()=>(I(),()=>{N.off("cell:mouseenter"),N.off("edge:mouseleave"),N.off("node:moved"),N.off("blank:click"),N=null,_n=null}),[]),H.useEffect(()=>{p(!0),A().then(()=>Be(this,null,function*(){yield T(m),p(!1)})).catch($=>{throw p(!1),$})},[]),H.useEffect(()=>{if(i&&f.length){const $=i==null?void 0:i.split(","),B=f.filter(W=>$.includes(W.name));R(B,!1),OO(!0),N.selectedCollections=i}else!i&&R(m,!1);return()=>{lY()}},[t,f]);const ci=()=>Be(this,null,function*(){var $;return($=N.collections)==null?void 0:$.map(B=>({label:l(B.title),value:B.name}))});return _.jsx(ce.Layout,{children:_.jsx("div",{className:e.graphCollectionContainerClass,children:_.jsxs(ce.Spin,{spinning:g,children:[_.jsx(L.CollectionManagerProvider,{collections:N==null?void 0:N.collections,refreshCM:T,children:_.jsx(Gy.Provider,{value:{collectionList:f,handleSearchCollection:U},children:_.jsx("div",{className:Cr.cx(e.collectionListClass),children:_.jsx(L.SchemaComponent,{components:{Select:$=>_.jsx(L.Select,$e(re({popupMatchSelectWidth:!1},$),{getPopupContainer:nt})),AddCollectionAction:cY,LocateCollectionAction:MY,SelectCollectionsAction:_Y,DirectionAction:hY,ConnectorAction:uY,FullscreenAction:OY},schema:{type:"void",properties:{block1:{type:"void","x-collection":"collections","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:L.collection,request:{resource:"collections",action:"list",params:{pageSize:50,filter:{inherit:!1},sort:["sort"],appends:[]}}},properties:{selectCollections:{type:"array","x-component":"SelectCollectionsAction"},actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{fontSize:16}},properties:{create:{type:"void",title:'{{ t("Create collection") }}',"x-component":"AddCollectionAction","x-component-props":{type:"primary"}},fullScreen:{type:"void","x-component":"FullscreenAction"},locateCollection:{type:"void","x-component":"LocateCollectionAction","x-component-props":{handleFiterCollections:Ke,icon:"MenuOutlined",useAction:()=>({run(){}})}},autoLayout:{type:"void","x-component":"Action","x-component-props":{component:H.forwardRef(()=>_.jsx(ce.Tooltip,{title:c("Auto layout"),getPopupContainer:nt,children:_.jsx(ce.Button,{onClick:()=>{OO()},children:_.jsx(_e.ApartmentOutlined,{})})})),useAction:()=>({run(){}})}},connectionType:{type:"void","x-component":"ConnectorAction","x-component-props":{onClick:At,icon:"MenuOutlined",useAction:()=>({run(){}})}},direction:{type:"void","x-component":"DirectionAction","x-component-props":{onClick:Vu}},selectMode:{type:"void","x-component":()=>_.jsx(ce.Tooltip,{title:c("Selection"),children:_.jsx(ce.Switch,{onChange:$=>{N.toggleSelection()}})})}}}}}}},scope:{useAsyncDataSource:ah,loadCollections:ci,useCreateActionAndRefreshCM:()=>Uv(O),enableInherits:(v==null?void 0:v.dialect)==="postgres"}})})})}),_.jsx("div",{id:"container",style:{width:"100vw"}}),_.jsx("div",{id:"graph-minimap",className:e.graphMinimap,style:{width:"300px",height:"250px",right:"10px",bottom:"20px",position:"fixed"}})]})})})});MO.displayName="GraphDrawPage";const RY=n=>{const{visible:e}=L.useActionContext(),t=L.useRequest(()=>Promise.resolve({data:{name:`t_${Ja.uid()}`,createdBy:!0,updatedBy:!0,sortable:!0,logging:!0,fields:[{name:"id",type:"integer",autoIncrement:!0,primaryKey:!0,allowNull:!1,uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-read-pretty":!0},interface:"id"},{interface:"createdAt",type:"date",field:"createdAt",name:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{interface:"createdBy",type:"belongsTo",target:"users",foreignKey:"createdById",name:"createdBy",uiSchema:{type:"object",title:'{{t("Created by")}}',"x-component":"RecordPicker","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}},{type:"date",field:"updatedAt",name:"updatedAt",interface:"updatedAt",uiSchema:{type:"string",title:'{{t("Last updated at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{type:"belongsTo",target:"users",foreignKey:"updatedById",name:"updatedBy",interface:"updatedBy",uiSchema:{type:"object",title:'{{t("Last updated by")}}',"x-component":"RecordPicker","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}}]}}),$e(re({},n),{manual:!0}));return H.useEffect(()=>{e&&t.run()},[e]),t},jY=()=>_.jsx("div",{className:L.css`
728
+ `,children:_.jsx(ce.Button,{children:_.jsx(ue.MenuOutlined,{})})})},MY=n=>{const{collectionList:e}=Z.useContext(Gy),t=L.useCompile(),[r,i]=Uy.useSearchParams(),s=r.get("collections"),o=s==null?void 0:s.split(","),a=o==null?void 0:o.filter(u=>e.find(h=>h.name===u)),l=Z.useMemo(()=>e.map(u=>({label:t(u.title),value:u.name})),[e]),c=u=>{i([["collections",u.toString()]])};return _.jsx(L.Select,{value:a,showSearch:!0,getPopupContainer:nt,mode:"multiple",allowClear:!0,options:l,onChange:c,style:{minWidth:200,position:"fixed",margin:"24px",zIndex:1e3,maxWidth:"60%"}})};class _Y extends kt{renderMarkup(){return this.renderJSONMarkup({tagName:"rect",selector:"body"})}update(){const t=this.cell.getAttrs().hightLight?"#1890ff":"gray";super.update({body:{refWidth:"50px",refHeight:"100px",fill:t}})}}const{drop:PO,groupBy:EO,last:NY,maxBy:Wa,minBy:zy,take:AO,uniq:Fy}=Hu,Vy=40,qy=250;let N,_n;const kY="TB";var Xa=(n=>(n.Both="both",n.Target="target",n.Source="source",n))(Xa||{}),Ya=(n=>(n.Both="both",n.Inherit="inherited",n.Entity="entity",n))(Ya||{});const Bu=(n,e)=>{const t=[];for(;(e==null?void 0:e.length)>0&&n;)t.push(e.splice(0,n));return t};function $Y(n,e){return Be(this,null,function*(){const{positions:t}=N;let r=[];const i=N.getNodes(),s=N.getEdges(),o=new ju.graphlib.Graph;o.setGraph({rankdir:kY,nodesep:50,edgesep:50,rankSep:50,align:"DL",controlPoints:!0}),o.setDefaultEdgeLabel(()=>({})),i.forEach((l,c)=>{const u=qy,h=l.getPorts().length*32+30;o.setNode(l.id,{width:u,height:h})}),ju.layout(o),Bu(15,o.nodes()).forEach((l,c)=>{l.forEach((u,h)=>{const f=N.getCellById(u),d=h%15;if(f){const g=t&&t.find(b=>b.collectionName===f.store.data.name)||{},p={x:d*325+50,y:c*400+100};f.position(g.x||p.x,g.y||p.y),t&&!t.find(b=>b.collectionName===f.store.data.name)&&r.push({collectionName:f.store.data.name,x:p.x,y:p.y})}})}),s.forEach(l=>{zu(l)}),_n?typeof _n=="string"?N.positionCell(NY(i),"top",{padding:100}):N.positionCell(_n,"top",{padding:100}):N.positionCell(i[0],"top-left",{padding:100}),r.length>0&&e&&(yield n(r),r=[])})}function zu(n){var u,h;const{store:{data:{connectionType:e}}}=n,t=n.getSource(),r=n.getTarget(),i=(u=N.getCellById(t.cell))==null?void 0:u.position().x,s=(h=N.getCellById(r.cell))==null?void 0:h.position().x,o=e?{name:"topLeft",args:{dy:20}}:{name:"left"},a=e?{name:"topRight",args:{dy:20}}:"right",l=e?"normal":"er";if(n.getVertices().forEach(()=>n.removeVertexAt(0)),i-100>s)n.setSource({cell:t.cell,port:t.port,anchor:o}),n.setTarget({cell:r.cell,port:r.port,anchor:a}),n.setRouter(l,{direction:"H"});else if(Math.abs(i-s)<100){const f=N.getCellById(t.cell),d=N.getCellById(r.cell);n.setSource({cell:t.cell,port:t.port,anchor:o}),n.setTarget({cell:r.cell,port:r.port,anchor:o}),e?(n.setVertices([{x:f.position().x-30,y:f.position().y+20},{x:d.position().x-30,y:d.position().y+20}]),n.setRouter("normal")):n.setRouter("oneSide",{side:"left"})}else n.setSource({cell:t.cell,port:t.port,anchor:a}),n.setTarget({cell:r.cell,port:r.port,anchor:o}),n.setRouter(l,{direction:"H"})}const Gy=Z.createContext({}),IY=()=>{const n=[],e=N.getEdges(),t=N.getNodes();return e.forEach(i=>{n.push(i.getSourceCellId()),n.push(i.getTargetCellId())}),EO(t,i=>n.includes(i.id)?"linkNodes":"rawNodes")},TO=n=>{var y;const{linkNodes:e=[],rawNodes:t=[]}=IY(),{positions:r}=N,i=e.concat(t||[]),s=N.getEdges(),o=new ju.graphlib.Graph;let a,l,c,u,h;const f=[];o.setGraph({rankdir:"TB",nodesep:50,edgesep:50,rankSep:50,align:"DL",controlPoints:!0});const d=250,g=400;i.forEach(v=>{o.setNode(v.id,{width:d,height:g})}),s.forEach(v=>{const w=v.getSource(),x=v.getTarget();o.setEdge(w.cell,x.cell,{})}),ju.layout(o);const p=o.nodes(),b=AO(p,e.length),m=PO(p,e.length);if(b.forEach(v=>{var C;const w=N.getCellById(v),x=(C=r.find(S=>S.collectionName===w.id))==null?void 0:C.id;if(w){const S=o.node(v);f.push({id:x,x:S.x,y:S.y}),w.position(S==null?void 0:S.x,S==null?void 0:S.y)}}),b.length){h=N.getCellById(Wa(b,C=>N.getCellById(C).position().y)).position().y,u=N.getCellById(zy(b,C=>N.getCellById(C).position().x)).position().x;const v=N.getCellById(Wa(b,C=>N.getCellById(C).position().x)).position().x,w=b.filter(C=>Math.abs(N.getCellById(C).position().y-h)<50),x=(y=N.getCellById(Wa(w,C=>N.getCellById(C).position().x)))==null?void 0:y.position();if(c=Math.round(v/320)||1,a=Math.floor((4500-(v+100-x.x))/280),l=Bu(c,t),a>=1){const C=AO(m,a);l=Bu(c,PO(m,a)),C.forEach((S,E)=>{var O;const A=N.getCellById(S);if(A){const T={x:x.x+320*E+280,y:x.y};A.position(T.x,T.y);const I=(O=r.find(G=>G.collectionName===A.id))==null?void 0:O.id;f.push({id:I,x:T.x,y:T.y})}})}}else c=15,a=0,l=Bu(15,t),u=50,h=50;l.forEach((v,w)=>{v.forEach((x,C)=>{var A;const S=N.getCellById(x),E=C%c;if(S){const O={x:E*325+u,y:w*300+h+300};S.position(O.x,O.y);const T=(A=r.find(I=>I.collectionName===S.id))==null?void 0:A.id;f.push({id:T,x:O.x,y:O.y})}})}),s.forEach(v=>{zu(v)}),N.positionCell(i[0],"top-left",{padding:100}),n||N.updatePositionAction(f,!0)},OO=Z.memo(()=>{const{theme:n}=L.useGlobalTheme(),{styles:e}=By(),[t,r]=Uy.useSearchParams(),i=t.get("collections"),s=Z.useContext(Ft.SchemaOptionsContext),o=Z.useContext(L.CollectionManagerContext),a=L.useAPIClient(),l=L.useCompile(),{t:c}=li(),[u,h]=Z.useState([]),[f,d]=Z.useState([]),[g,p]=Z.useState(!1),{refreshCM:b,collections:m}=L.useCollectionManager(),y=L.useCurrentAppInfo(),{data:{database:v}}=y,w=Z.useContext(L.CollectionCategroriesContext),x=re({},s==null?void 0:s.scope),C=re({},s==null?void 0:s.components),S=$=>Be(this,null,function*(){yield a.resource("graphPositions").create({values:$}),yield A()}),E=($,B=!1)=>Be(this,null,function*(){i||(B?yield a.resource("graphPositions").update({values:$}):yield a.resource("graphPositions").update({filter:{collectionName:$.collectionName},values:re({},$)}),yield A())}),A=()=>Be(this,null,function*(){const{data:$}=yield a.resource("graphPositions").list({paginate:!1});return N.positions=$.data,Promise.resolve()}),O=$=>{_n=$,$==="destory"&&A()},T=$=>Be(this,null,function*(){const B=($==null?void 0:$.length)>0?$:yield b();N.collections=B,N.updatePositionAction=E;const U=N.getNodes();h(B),d(B),U.length?z(B):i||R(B)}),I=()=>{N=new V({container:document.getElementById("container"),moveThreshold:0,virtual:!1,async:!0,connecting:{anchor:{name:"midSide"}},mousewheel:{enabled:!0,modifiers:["ctrl","meta"]},interacting:{magnetConnectable:!1},preventDefaultBlankAction:!0}),N.connectionType="both",N.direction="target",N.cacheCollection={},N.onConnectionAssociation=G,N.onConnectionChilds=X,N.onConnectionParents=M,V.registerPortLayout("erPortPosition",$=>$.map((B,U)=>({position:{x:0,y:(U+1)*Vy},angle:0})),!0),aU({shape:"er-rect",width:qy,height:Vy,ports:{groups:{list:{markup:[{tagName:"rect",selector:"portBody"}],attrs:{portBody:{width:qy,height:Vy,strokeWidth:1,visibility:"hidden"}},position:"erPortPosition"}}},body:{refWidth:100,refHeight:100},component:Z.forwardRef(($,B)=>_.jsx(L.CurrentAppInfoContext.Provider,{value:y,children:_.jsx(L.APIClientProvider,{apiClient:a,children:_.jsx(L.SchemaComponentOptions,{inherit:!0,scope:x,components:C,children:_.jsx(L.CollectionCategroriesProvider,$e(re({},w),{children:_.jsx(L.CollectionManagerProvider,{collections:N==null?void 0:N.collections,refreshCM:T,interfaces:o.interfaces,children:_.jsx(ce.ConfigProvider,{theme:n,children:_.jsx("div",{style:{height:"auto"},children:_.jsx(ce.App,{children:_.jsx(AY,$e(re({},$),{setTargetNode:O,targetGraph:N}))})})})})}))})})}))}),N.use(new Yw({autoResize:!0,enabled:!0,pannable:!0,pageVisible:!0,pageBreak:!1,padding:{top:10,left:500,right:300,bottom:300}})),N.use(new Xw({container:document.getElementById("graph-minimap"),width:300,height:200,padding:10,graphOptions:{async:!0,createCellView($){if($.isEdge())return null;if($.isNode())return _Y}}})),N.use(new Is({enabled:!1,multiple:!0,rubberband:!0,movable:!0,className:"node-selecting",modifiers:"shift"})),N.use(new Qw({enabled:!0})),N.on("edge:mouseleave",({e:$,edge:B})=>{$.stopPropagation(),k(B)}),N.on("node:mouseleave",({e:$,node:B})=>{$.stopPropagation(),B.setProp({actived:!1})}),N.on("node:moved",({e:$,node:B})=>{$.stopPropagation();const U=N.getConnectedEdges(B),ne=B.position(),oe=N.positions.find(be=>be.collectionName===B.store.data.name);oe?(oe.x!==ne.x||oe.y!==ne.y)&&E(re({collectionName:B.store.data.name},ne)):S(re({collectionName:B.store.data.name},ne)),U.forEach(be=>{zu(be)})}),N.on("cell:mouseenter",({e:$,cell:B,edge:U,node:ne})=>{$.stopPropagation(),B.toFront(),ne&&B.setProp({actived:!0}),U&&Q(U)}),N.on("blank:click",$=>{var B;N!=null&&N.activeEdge&&k(N==null?void 0:N.activeEdge),(B=N.collapseNodes)==null||B.map(U=>{const ne=N.getCellById(Object.keys(U)[0]);Object.values(U)[0]&&(ne==null||ne.setData({collapse:!1}))}),N.cleanSelection()}),N.on("node:selected",({e:$,node:B})=>{B.setProp({select:!0})}),N.on("node:unselected",({e:$,node:B})=>{B.setProp({select:!1})})},G=({target:$,through:B})=>{var oe;const U=((oe=N.selectedCollections)==null?void 0:oe.split(","))||[];U.push($),B&&U.push(B);const ne=Fy(U).toString();r([["collections",ne]]),N.selectedCollections=ne},X=$=>{let B=N.selectedCollections.split(",")||[];B=B.concat($);const U=Fy(B).toString();r([["collections",U]]),N.selectedCollections=U},M=$=>{let B=N.selectedCollections.split(",")||[];B=B.concat($);const U=Fy(B).toString();r([["collections",U]]),N.selectedCollections=U},k=$=>{var Tt,De;N.activeEdge=null;const{m2m:B,connectionType:U}=(De=(Tt=$.store)==null?void 0:Tt.data)!=null?De:{},ne=B==null?void 0:B.find(Je=>Je!==$.id),oe=N.getCellById(ne),be=Je=>{const Ge=N.getCellById(Je.store.data.target.cell),zt=N.getCellById(Je.store.data.source.cell);Ge.setProp({targetPort:!1,associated:null}),zt.setProp({sourcePort:!1,associated:null}),Je.setAttrs({line:{stroke:"#ddd",targetMarker:U==="inherited"?{name:"classic",fill:"#ddd"}:null}}),Je.setLabels(Je.getLabels().map(Ot=>$e(re({},Ot),{attrs:{labelText:$e(re({},Ot.attrs.labelText),{fill:"rgba(0, 0, 0, 0.3)"}),labelBody:$e(re({},Ot.attrs.labelBody),{stroke:"#ddd"})}})))};be($),oe&&be(oe)},Q=$=>{var De,Je;N.activeEdge=$;const{associated:B,m2m:U,connectionType:ne}=(Je=(De=$.store)==null?void 0:De.data)!=null?Je:{},oe=U==null?void 0:U.find(Ge=>Ge!==$.id),be=N.getCellById(oe),Tt=Ge=>{Ge.toFront(),Ge.setAttrs({line:{stroke:"#1890ff",strokeWidth:1,textAnchor:"middle",textVerticalAnchor:"middle",sourceMarker:null,targetMarker:ne==="inherited"?{name:"classic",fill:"#1890ff"}:null}}),Ge.setLabels(Ge.getLabels().map(Jt=>$e(re({},Jt),{attrs:{labelText:$e(re({},Jt.attrs.labelText),{fill:"#1890ff"}),labelBody:$e(re({},Jt.attrs.labelBody),{stroke:"#1890ff"})}})));const zt=N.getCellById(Ge.store.data.target.cell),Ot=N.getCellById(Ge.store.data.source.cell);zt.toFront(),Ot.toFront(),zt.setProp({targetPort:Ge.store.data.target.port,associated:B}),Ot.setProp({sourcePort:Ge.store.data.source.port,associated:B})};Tt($),be&&Tt(be)},R=($,B=!0)=>{N.clearCells();const{nodesData:U,edgesData:ne,inheritEdges:oe}=wO($);N.data={nodes:U,edges:ne},N.fromJSON({nodes:U}),N.addEdges(ne),N.addEdges(oe),$Y(S,B)},z=$=>{var NO,kO;const{positions:B}=N,{nodesData:U,edgesData:ne,inheritEdges:oe}=wO($),be=N.getNodes().map(Nn=>Nn.store.data),Tt=N.getEdges().map(Nn=>Nn.store.data),De=EO(Tt,Nn=>Nn.connectionType?"currentInheritEdges":"currentRelateEdges"),Je=oY(U,be),Ge=CO(ne,De.currentRelateEdges||[]),zt=CO(oe,De.currentInheritEdges||[]),Ot=(NO=Wa(B,"y"))==null?void 0:NO.y,Jt=(kO=zy(B,"x"))==null?void 0:kO.x,_O=B.filter(Nn=>Math.abs(Nn.y-Ot)<100);let Ka=Wa(_O,"x"),qu;Je.forEach(({status:Nn,node:Gi,port:ho})=>{const Ja=N.getCellById(Gi.id);switch(Nn){case"add":Ka.x>4500?(Ka=zy(_O,"x"),qu={x:Jt,y:Ka.y+400}):qu={x:Ka.x+350,y:Ka.y},_n=N.addNode($e(re({},Gi),{position:qu})),i||S(re({collectionName:Gi.name},qu)),N&&N.positionCell(_n,"top",{padding:200});break;case"insertPort":Ja.insertPort(ho.index,ho.port);break;case"deletePort":Ja.removePort(ho.id);break;case"updateNode":Ja.setProp({title:Gi.title});break;case"delete":N.removeCell(Gi.id);break;default:return null}});const DY=Nn=>{Nn.forEach(({status:Gi,edge:ho})=>{const Ja=N.addEdge(re({},ho));switch(Gi){case"add":zu(Ja);break;case"delete":N.removeCell(ho.id);break;default:return null}})};setTimeout(()=>{DY(Ge.concat(zt))},300)},H=$=>{const B=$.target.value.toLowerCase();if(B){const U=u.filter(ne=>l(ne.title).toLowerCase().includes(B));d(U)}else d(u)},te=($,B)=>{B==="target"?bO(N.collections,$).forEach(ne=>{var oe;(oe=N.getCellById(ne))==null||oe.setAttrs({hightLight:!0,direction:B,connectionType:"inherited"})}):nY(N.collections,$).forEach(ne=>{var oe;(oe=N.getCellById(ne.name))==null||oe.setAttrs({hightLight:!0,direction:B,connectionType:"inherited"})})},xe=$=>{const B=N.getCellById($);N.cacheCollection[$]=!0,N.getConnectedEdges(B).filter(oe=>{var be;return!((be=oe.store.data)!=null&&be.connectionType)&&oe.getTargetCellId()===$}).forEach(oe=>{var De;oe.store.data.m2m&&oe.store.data.m2m.forEach(Je=>{var zt;const Ge=N.getCellById(Je);if(Ge.getTargetCellId()===$){const Ot=Ge.getSourceCellId(),Jt=N.getCellById(Ot);(zt=Jt.store.data.attrs)!=null&&zt.hightLight||(Jt.setAttrs({hightLight:!0,direction:"target",connectionType:"entity"}),xe(Ot))}});const be=oe.getSourceCellId(),Tt=N.getCellById(be);(De=Tt.store.data.attrs)!=null&&De.hightLight||(Tt.setAttrs({hightLight:!0,direction:"target",connectionType:"entity"}),xe(be))})},Kt=$=>{const B=N.getCellById($);N.getConnectedEdges(B).filter(oe=>{var be;return!((be=oe.store.data)!=null&&be.connectionType)&&oe.getSourceCellId()===$}).forEach(oe=>{var De;oe.store.data.m2m&&oe.store.data.m2m.forEach(Je=>{var zt;const Ge=N.getCellById(Je);if(Ge.getSourceCellId()===$){const Ot=Ge.getTargetCellId(),Jt=N.getCellById(Ot);(zt=Jt.store.data.attrs)!=null&&zt.hightLight||(Jt.setAttrs({hightLight:!0,direction:"source",connectionType:"entity"}),Kt(Ot))}});const be=oe.getTargetCellId(),Tt=N.getCellById(be);(De=Tt.store.data.attrs)!=null&&De.hightLight||(Tt.setAttrs({hightLight:!0,direction:"source",connectionType:"entity"}),Kt(be))})},Ye=($,B)=>{B==="target"?xe($):Kt($)},gn=($,B,U)=>{var be,Tt;const ne=N.getNodes().filter(De=>{var Je;return(Je=De.store.data.attrs)==null?void 0:Je.hightLight}),oe=ne.length;for(let De=0;De<oe;De++){const{direction:Je,connectionType:Ge}=ne[De].getAttrs(),zt=ne[De].id!==$,Ot=$&&((be=N.filterConfig)==null?void 0:be.key)===$?Je!==B:!0,Jt=$&&((Tt=N.filterConfig)==null?void 0:Tt.key)===$?Ge!==U:!0;ne[De].id!==$&&setTimeout(()=>{zt&&(Ot||Jt)&&ne[De].setAttrs({hightLight:!1})},0)}},Ke=$=>{const{connectionType:B,direction:U,filterConfig:ne}=N,oe=$===(ne==null?void 0:ne.key)&&U==="both",be=$===(ne==null?void 0:ne.key)&&(B==="both"||B===ne.connectionType);$?((!oe||!be)&&gn($,U,B),_n=N.getCellById($),N.positionCell(_n,"center",{padding:0}),_n.setAttrs({hightLight:!0,connectionType:B}),setTimeout(()=>{["entity","both"].includes(B)&&(U==="both"?(Ye($,"target"),Ye($,"source")):(U==="target"&&Ye($,U),U==="source"&&Ye($,U))),["inherited","both"].includes(B)&&(U==="both"?(te($,"target"),te($,"source")):te($,U)),N.filterConfig={key:$,direction:U,connectionType:B}},0)):(N.filterConfig=null,gn())},At=$=>{N.connectionType=$;const{filterConfig:B}=N;B&&Ke(B.key),Fu($)},Fu=$=>{_n=null,N.getEdges().forEach(U=>{const{store:{data:{connectionType:ne}}}=U;$==="entity"?ne?U.setVisible(!1):U.setVisible(!0):$==="inherited"?ne?U.setVisible(!0):U.setVisible(!1):U.setVisible(!0)})},Vu=$=>{N.direction=$;const{filterConfig:B}=N;B&&Ke(B.key)};Z.useLayoutEffect(()=>(I(),()=>{N.off("cell:mouseenter"),N.off("edge:mouseleave"),N.off("node:moved"),N.off("blank:click"),N=null,_n=null}),[]),Z.useEffect(()=>{p(!0),A().then(()=>Be(this,null,function*(){yield T(m),p(!1)})).catch($=>{throw p(!1),$})},[]),Z.useEffect(()=>{if(i&&f.length){const $=i==null?void 0:i.split(","),B=f.filter(U=>$.includes(U.name));R(B,!1),TO(!0),N.selectedCollections=i}else!i&&R(m,!1);return()=>{aY()}},[t,f]);const ci=()=>Be(this,null,function*(){var $;return($=N.collections)==null?void 0:$.map(B=>({label:l(B.title),value:B.name}))});return _.jsx(ce.Layout,{children:_.jsx("div",{className:e.graphCollectionContainerClass,children:_.jsxs(ce.Spin,{spinning:g,children:[_.jsx(L.CollectionManagerProvider,{collections:N==null?void 0:N.collections,refreshCM:T,children:_.jsx(Gy.Provider,{value:{collectionList:f,handleSearchCollection:H},children:_.jsx("div",{className:Cr.cx(e.collectionListClass),children:_.jsx(L.SchemaComponent,{components:{Select:$=>_.jsx(L.Select,$e(re({popupMatchSelectWidth:!1},$),{getPopupContainer:nt})),AddCollectionAction:lY,LocateCollectionAction:OY,SelectCollectionsAction:MY,DirectionAction:uY,ConnectorAction:cY,FullscreenAction:TY},schema:{type:"void",properties:{block1:{type:"void","x-collection":"collections","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:L.collection,request:{resource:"collections",action:"list",params:{pageSize:50,filter:{inherit:!1},sort:["sort"],appends:[]}}},properties:{selectCollections:{type:"array","x-component":"SelectCollectionsAction"},actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{fontSize:16}},properties:{create:{type:"void",title:'{{ t("Create collection") }}',"x-component":"AddCollectionAction","x-component-props":{type:"primary"}},fullScreen:{type:"void","x-component":"FullscreenAction"},locateCollection:{type:"void","x-component":"LocateCollectionAction","x-component-props":{handleFiterCollections:Ke,icon:"MenuOutlined",useAction:()=>({run(){}})}},autoLayout:{type:"void","x-component":"Action","x-component-props":{component:Z.forwardRef(()=>_.jsx(ce.Tooltip,{title:c("Auto layout"),getPopupContainer:nt,children:_.jsx(ce.Button,{onClick:()=>{TO()},children:_.jsx(ue.ApartmentOutlined,{})})})),useAction:()=>({run(){}})}},connectionType:{type:"void","x-component":"ConnectorAction","x-component-props":{onClick:At,icon:"MenuOutlined",useAction:()=>({run(){}})}},direction:{type:"void","x-component":"DirectionAction","x-component-props":{onClick:Vu}},selectMode:{type:"void","x-component":()=>_.jsx(ce.Tooltip,{title:c("Selection"),children:_.jsx(ce.Switch,{onChange:$=>{N.toggleSelection()}})})}}}}}}},scope:{useAsyncDataSource:ah,loadCollections:ci,useCreateActionAndRefreshCM:()=>Hv(O),enableInherits:(v==null?void 0:v.dialect)==="postgres"}})})})}),_.jsx("div",{id:"container",style:{width:"100vw"}}),_.jsx("div",{id:"graph-minimap",className:e.graphMinimap,style:{width:"300px",height:"250px",right:"10px",bottom:"20px",position:"fixed"}})]})})})});OO.displayName="GraphDrawPage";const LY=n=>{const{visible:e}=L.useActionContext(),t=L.useRequest(()=>Promise.resolve({data:{name:`t_${fo.uid()}`,createdBy:!0,updatedBy:!0,sortable:!0,logging:!0,fields:[{name:"id",type:"integer",autoIncrement:!0,primaryKey:!0,allowNull:!1,uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-read-pretty":!0},interface:"id"},{interface:"createdAt",type:"date",field:"createdAt",name:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{interface:"createdBy",type:"belongsTo",target:"users",foreignKey:"createdById",name:"createdBy",uiSchema:{type:"object",title:'{{t("Created by")}}',"x-component":"RecordPicker","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}},{type:"date",field:"updatedAt",name:"updatedAt",interface:"updatedAt",uiSchema:{type:"string",title:'{{t("Last updated at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{type:"belongsTo",target:"users",foreignKey:"updatedById",name:"updatedBy",interface:"updatedBy",uiSchema:{type:"object",title:'{{t("Last updated by")}}',"x-component":"RecordPicker","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}}]}}),$e(re({},n),{manual:!0}));return Z.useEffect(()=>{e&&t.run()},[e]),t},RY=()=>_.jsx("div",{className:L.css`
729
729
  height: calc(100vh - 160px);
730
730
  overflow: auto;
731
731
  margin: calc(var(--nb-spacing) * -1);
732
732
  position: relative;
733
- `,id:"graph_container",children:_.jsx(L.SchemaComponent,{schema:{type:"void","x-component":"div",properties:{editor:{type:"void","x-component":"GraphDrawPage"}}},components:{GraphDrawPage:MO,DeleteOutlined:_e.DeleteOutlined},scope:{useCollectionValues:RY,useCreateActionAndRefreshCM:Uv}})}),DY="graph-collection-manager";class _O extends L.Plugin{load(){return Be(this,null,function*(){this.app.use(Wy),this.app.pluginSettingsManager.add("collection-manager.graph",{title:`{{t("Graphical interface", { ns: "${DY}" })}}`,Component:jY,aclSnippet:"pm.collection-manager.graph"})})}}Q.GraphCollectionPlugin=_O,Q.default=_O,Object.defineProperties(Q,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
733
+ `,id:"graph_container",children:_.jsx(L.SchemaComponent,{schema:{type:"void","x-component":"div",properties:{editor:{type:"void","x-component":"GraphDrawPage"}}},components:{GraphDrawPage:OO,DeleteOutlined:ue.DeleteOutlined},scope:{useCollectionValues:LY,useCreateActionAndRefreshCM:Hv}})}),jY="graph-collection-manager";class MO extends L.Plugin{load(){return Be(this,null,function*(){this.app.pluginSettingsManager.add("collection-manager.graph",{title:`{{t("Graphical interface", { ns: "${jY}" })}}`,Component:RY,aclSnippet:"pm.collection-manager.graph"})})}}J.GraphCollectionPlugin=MO,J.default=MO,Object.defineProperties(J,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});