@nocobase/plugin-graph-collection-manager 0.13.0-alpha.5 → 0.13.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- (function(ee,j){typeof exports=="object"&&typeof module!="undefined"?j(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("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","ahooks"],j):(ee=typeof globalThis!="undefined"?globalThis:ee||self,j(ee["@nocobase/plugin-graph-collection-manager"]={},ee["@nocobase/client"],ee.jsxRuntime,ee.react,ee["@ant-design/icons"],ee["@formily/shared"],ee["@formily/react"],ee["@formily/reactive"],ee["@nocobase/utils"],ee.antd,ee["react-i18next"],ee["@emotion/css"],ee.lodash,ee.ahooks))})(this,function(ee,j,_,W,Ue,qa,Kt,so,gn,ue,Va,xr,Ou,D2){"use strict";var mW=Object.defineProperty,yW=Object.defineProperties;var vW=Object.getOwnPropertyDescriptors;var Tu=Object.getOwnPropertySymbols;var N2=Object.prototype.hasOwnProperty,k2=Object.prototype.propertyIsEnumerable;var _2=(ee,j,_)=>j in ee?mW(ee,j,{enumerable:!0,configurable:!0,writable:!0,value:_}):ee[j]=_,ie=(ee,j)=>{for(var _ in j||(j={}))N2.call(j,_)&&_2(ee,_,j[_]);if(Tu)for(var _ of Tu(j))k2.call(j,_)&&_2(ee,_,j[_]);return ee},He=(ee,j)=>yW(ee,vW(j));var I2=(ee,j)=>{var _={};for(var W in ee)N2.call(ee,W)&&j.indexOf(W)<0&&(_[W]=ee[W]);if(ee!=null&&Tu)for(var W of Tu(ee))j.indexOf(W)<0&&k2.call(ee,W)&&(_[W]=ee[W]);return _};var ze=(ee,j,_)=>new Promise((W,Ue)=>{var qa=gn=>{try{so(_.next(gn))}catch(ue){Ue(ue)}},Kt=gn=>{try{so(_.throw(gn))}catch(ue){Ue(ue)}},so=gn=>gn.done?W(gn.value):Promise.resolve(gn.value).then(qa,Kt);so((_=_.apply(ee,j)).next())});const ci=W.createContext(null),x0=n=>{const{record:e,setTargetNode:t,node:r,handelOpenPorts:i}=n;return _.jsx(ci.Provider,{value:{node:r,record:e,positionTargetNode:s=>{t(s||r)},openPorts:i},children:n.children})},B2=(n,e)=>{const t=j.useRequest(()=>Promise.resolve({data:e}),He(ie({},n),{manual:!0})),r=j.useActionContext();return W.useEffect(()=>{r.visible&&t.run()},[r.visible]),t};Kt.observer(()=>{const{record:n}=W.useContext(ci),e=j.useCompile();return _.jsx("div",{children:_.jsx(ue.Select,{popupMatchSelectWidth:!1,disabled:!0,value:n.name,options:[{value:n.name,label:e(n.title)}]})})},{displayName:"SourceCollection"});const Cr=()=>{const n=Kt.useForm(),e=j.useActionContext();return{run(){return ze(this,null,function*(){e.setVisible(!1),n.reset()})}}},C0=n=>{const e=Kt.useForm(),t=j.useAPIClient(),r=j.useActionContext(),{refreshCM:i}=j.useCollectionManager();return{run(){return ze(this,null,function*(){yield e.submit(),yield t.resource("collections").create({values:e.values}),r.setVisible(!1),yield e.reset(),n("last"),yield i()})}}},S0=(n,e)=>{const t=Kt.useForm(),r=j.useAPIClient(),i=j.useActionContext(),{refreshCM:s}=j.useCollectionManager(),{positionTargetNode:o,openPorts:a}=W.useContext(ci),{getValues:l}=j.useCollectionFieldFormValues();return{run(){return ze(this,null,function*(){yield t.submit();const u=l(),h=gn.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()})}}},$2=({collectionName:n,name:e,key:t})=>{const{refreshCM:r}=j.useCollectionManager(),{t:i}=Va.useTranslation(),s=Kt.useForm(),o=j.useActionContext(),a=j.useAPIClient(),{positionTargetNode:l,node:c}=W.useContext(ci);return{run(){return ze(this,null,function*(){var h;yield s.submit(),yield a.resource("collections.fields",n).update({filterByTk:e,values:s.values}),o.setVisible(!1),ue.message.success(i("Saved successfully")),l(),r(),c.setPortProp(t,"uiSchema",{title:(h=s.values)==null?void 0:h.uiSchema.title}),yield s.reset()})}}},Mu=()=>{const{t:n}=Va.useTranslation(),e=Kt.useForm(),t=j.useActionContext(),{name:r}=e.values,i=j.useAPIClient(),{refreshCM:s}=j.useCollectionManager(),{positionTargetNode:o}=W.useContext(ci);return{run(){return ze(this,null,function*(){yield e.submit(),yield i.resource("collections").update({filterByTk:r,values:ie({},gn.lodash.omit(e.values,["fields"]))}),t.setVisible(!1),ue.message.success(n("Saved successfully")),yield e.reset(),o(),s()})}}},z2=n=>{const e=j.useAPIClient();return{run(){return ze(this,null,function*(){yield e.resource("collections").destroy({filterByTk:n}),yield e.resource("graphPositions").destroy({filter:{collectionName:n}})})}}},F2=n=>{const{name:e}=n,{run:t}=z2(e),{refreshCM:r}=j.useCollectionManager(),{positionTargetNode:i}=W.useContext(ci);return{run(){return ze(this,null,function*(){yield t(),i("destory"),yield r()})}}},q2=(n,e)=>{const t=j.useAPIClient(),{positionTargetNode:r}=W.useContext(ci);return{run(){return ze(this,null,function*(){yield t.resource("collections.fields",n).destroy({filterByTk:e}),r()})}}},V2=n=>{const{collectionName:e,name:t}=n,{refreshCM:r}=j.useCollectionManager(),{run:i}=q2(e,t);return{run(){return ze(this,null,function*(){yield i(),yield r()})}}},_u=n=>(e,{targetScope:t})=>{e.loading=!0,n(t).then(so.action.bound(r=>{e.dataSource=r,e.loading=!1})).catch(r=>{gn.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 Nn{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})(Nn||(Nn={}));class P0{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})(P0||(P0={}));var G2=typeof global=="object"&&global&&global.Object===Object&&global;const E0=G2;var H2=typeof self=="object"&&self&&self.Object===Object&&self,U2=E0||H2||Function("return this")();const pn=U2;var W2=pn.Symbol;const Jt=W2;var A0=Object.prototype,X2=A0.hasOwnProperty,Y2=A0.toString,oo=Jt?Jt.toStringTag:void 0;function K2(n){var e=X2.call(n,oo),t=n[oo];try{n[oo]=void 0;var r=!0}catch(s){}var i=Y2.call(n);return r&&(e?n[oo]=t:delete n[oo]),i}var J2=Object.prototype,Q2=J2.toString;function Z2(n){return Q2.call(n)}var eN="[object Null]",tN="[object Undefined]",T0=Jt?Jt.toStringTag:void 0;function Sr(n){return n==null?n===void 0?tN:eN:T0&&T0 in Object(n)?K2(n):Z2(n)}function mn(n){return n!=null&&typeof n=="object"}var nN="[object Symbol]";function kn(n){return typeof n=="symbol"||mn(n)&&Sr(n)==nN}function ao(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 rN=Array.isArray;const bt=rN;var iN=1/0,O0=Jt?Jt.prototype:void 0,M0=O0?O0.toString:void 0;function _0(n){if(typeof n=="string")return n;if(bt(n))return ao(n,_0)+"";if(kn(n))return M0?M0.call(n):"";var e=n+"";return e=="0"&&1/n==-iN?"-0":e}var sN=/\s/;function oN(n){for(var e=n.length;e--&&sN.test(n.charAt(e)););return e}var aN=/^\s+/;function lN(n){return n&&n.slice(0,oN(n)+1).replace(aN,"")}function Qe(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var N0=0/0,cN=/^[-+]0x[0-9a-f]+$/i,uN=/^0b[01]+$/i,hN=/^0o[0-7]+$/i,fN=parseInt;function lo(n){if(typeof n=="number")return n;if(kn(n))return N0;if(Qe(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Qe(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=lN(n);var t=uN.test(n);return t||hN.test(n)?fN(n.slice(2),t?2:8):cN.test(n)?N0:+n}function Vi(n){return n}var dN="[object AsyncFunction]",gN="[object Function]",pN="[object GeneratorFunction]",mN="[object Proxy]";function Nu(n){if(!Qe(n))return!1;var e=Sr(n);return e==gN||e==pN||e==dN||e==mN}var yN=pn["__core-js_shared__"];const ku=yN;var k0=function(){var n=/[^.]+$/.exec(ku&&ku.keys&&ku.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function vN(n){return!!k0&&k0 in n}var bN=Function.prototype,wN=bN.toString;function ui(n){if(n!=null){try{return wN.call(n)}catch(e){}try{return n+""}catch(e){}}return""}var xN=/[\\^$.*+?()[\]{}|]/g,CN=/^\[object .+?Constructor\]$/,SN=Function.prototype,PN=Object.prototype,EN=SN.toString,AN=PN.hasOwnProperty,TN=RegExp("^"+EN.call(AN).replace(xN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ON(n){if(!Qe(n)||vN(n))return!1;var e=Nu(n)?TN:CN;return e.test(ui(n))}function MN(n,e){return n==null?void 0:n[e]}function hi(n,e){var t=MN(n,e);return ON(t)?t:void 0}var _N=hi(pn,"WeakMap");const Iu=_N;var I0=Object.create,NN=function(){function n(){}return function(e){if(!Qe(e))return{};if(I0)return I0(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();const kN=NN;function L0(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 IN(){}function R0(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var LN=800,RN=16,jN=Date.now;function DN(n){var e=0,t=0;return function(){var r=jN(),i=RN-(r-t);if(t=r,i>0){if(++e>=LN)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function BN(n){return function(){return n}}var $N=function(){try{var n=hi(Object,"defineProperty");return n({},"",{}),n}catch(e){}}();const Ga=$N;var zN=Ga?function(n,e){return Ga(n,"toString",{configurable:!0,enumerable:!1,value:BN(e),writable:!0})}:Vi,FN=DN(zN);const qN=FN;function VN(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}function GN(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 HN(n){return n!==n}function UN(n,e,t){for(var r=t-1,i=n.length;++r<i;)if(n[r]===e)return r;return-1}function WN(n,e,t){return e===e?UN(n,e,t):GN(n,HN,t)}function j0(n,e){var t=n==null?0:n.length;return!!t&&WN(n,e,0)>-1}var XN=9007199254740991,YN=/^(?:0|[1-9]\d*)$/;function Lu(n,e){var t=typeof n;return e=e==null?XN:e,!!e&&(t=="number"||t!="symbol"&&YN.test(n))&&n>-1&&n%1==0&&n<e}function Ha(n,e,t){e=="__proto__"&&Ga?Ga(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function Gi(n,e){return n===e||n!==n&&e!==e}var KN=Object.prototype,JN=KN.hasOwnProperty;function D0(n,e,t){var r=n[e];(!(JN.call(n,e)&&Gi(r,t))||t===void 0&&!(e in n))&&Ha(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?Ha(t,a,l):D0(t,a,l)}return t}var B0=Math.max;function QN(n,e,t){return e=B0(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,s=B0(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),L0(n,this,a)}}function Hi(n,e){return qN(QN(n,e,Vi),n+"")}var ZN=9007199254740991;function Ru(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=ZN}function fi(n){return n!=null&&Ru(n.length)&&!Nu(n)}function Ua(n,e,t){if(!Qe(t))return!1;var r=typeof e;return(r=="number"?fi(t)&&Lu(e,t.length):r=="string"&&e in t)?Gi(t[e],n):!1}function $0(n){return Hi(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&&Ua(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 ek=Object.prototype;function Wa(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||ek;return n===t}function tk(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var nk="[object Arguments]";function z0(n){return mn(n)&&Sr(n)==nk}var F0=Object.prototype,rk=F0.hasOwnProperty,ik=F0.propertyIsEnumerable,sk=z0(function(){return arguments}())?z0:function(n){return mn(n)&&rk.call(n,"callee")&&!ik.call(n,"callee")};const Ui=sk;function ok(){return!1}var q0=typeof ee=="object"&&ee&&!ee.nodeType&&ee,V0=q0&&typeof module=="object"&&module&&!module.nodeType&&module,ak=V0&&V0.exports===q0,G0=ak?pn.Buffer:void 0,lk=G0?G0.isBuffer:void 0,ck=lk||ok;const Wi=ck;var uk="[object Arguments]",hk="[object Array]",fk="[object Boolean]",dk="[object Date]",gk="[object Error]",pk="[object Function]",mk="[object Map]",yk="[object Number]",vk="[object Object]",bk="[object RegExp]",wk="[object Set]",xk="[object String]",Ck="[object WeakMap]",Sk="[object ArrayBuffer]",Pk="[object DataView]",Ek="[object Float32Array]",Ak="[object Float64Array]",Tk="[object Int8Array]",Ok="[object Int16Array]",Mk="[object Int32Array]",_k="[object Uint8Array]",Nk="[object Uint8ClampedArray]",kk="[object Uint16Array]",Ik="[object Uint32Array]",Me={};Me[Ek]=Me[Ak]=Me[Tk]=Me[Ok]=Me[Mk]=Me[_k]=Me[Nk]=Me[kk]=Me[Ik]=!0,Me[uk]=Me[hk]=Me[Sk]=Me[fk]=Me[Pk]=Me[dk]=Me[gk]=Me[pk]=Me[mk]=Me[yk]=Me[vk]=Me[bk]=Me[wk]=Me[xk]=Me[Ck]=!1;function Lk(n){return mn(n)&&Ru(n.length)&&!!Me[Sr(n)]}function uo(n){return function(e){return n(e)}}var H0=typeof ee=="object"&&ee&&!ee.nodeType&&ee,ho=H0&&typeof module=="object"&&module&&!module.nodeType&&module,Rk=ho&&ho.exports===H0,ju=Rk&&E0.process,jk=function(){try{var n=ho&&ho.require&&ho.require("util").types;return n||ju&&ju.binding&&ju.binding("util")}catch(e){}}();const Xi=jk;var U0=Xi&&Xi.isTypedArray,Dk=U0?uo(U0):Lk;const Xa=Dk;var Bk=Object.prototype,$k=Bk.hasOwnProperty;function W0(n,e){var t=bt(n),r=!t&&Ui(n),i=!t&&!r&&Wi(n),s=!t&&!r&&!i&&Xa(n),o=t||r||i||s,a=o?tk(n.length,String):[],l=a.length;for(var c in n)(e||$k.call(n,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Lu(c,l)))&&a.push(c);return a}function X0(n,e){return function(t){return n(e(t))}}var zk=X0(Object.keys,Object);const Fk=zk;var qk=Object.prototype,Vk=qk.hasOwnProperty;function Y0(n){if(!Wa(n))return Fk(n);var e=[];for(var t in Object(n))Vk.call(n,t)&&t!="constructor"&&e.push(t);return e}function fo(n){return fi(n)?W0(n):Y0(n)}function Gk(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var Hk=Object.prototype,Uk=Hk.hasOwnProperty;function Wk(n){if(!Qe(n))return Gk(n);var e=Wa(n),t=[];for(var r in n)r=="constructor"&&(e||!Uk.call(n,r))||t.push(r);return t}function Yi(n){return fi(n)?W0(n,!0):Wk(n)}var Xk=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Yk=/^\w*$/;function Du(n,e){if(bt(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||kn(n)?!0:Yk.test(n)||!Xk.test(n)||e!=null&&n in Object(e)}var Kk=hi(Object,"create");const go=Kk;function Jk(){this.__data__=go?go(null):{},this.size=0}function Qk(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var Zk="__lodash_hash_undefined__",eI=Object.prototype,tI=eI.hasOwnProperty;function nI(n){var e=this.__data__;if(go){var t=e[n];return t===Zk?void 0:t}return tI.call(e,n)?e[n]:void 0}var rI=Object.prototype,iI=rI.hasOwnProperty;function sI(n){var e=this.__data__;return go?e[n]!==void 0:iI.call(e,n)}var oI="__lodash_hash_undefined__";function aI(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=go&&e===void 0?oI:e,this}function di(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])}}di.prototype.clear=Jk,di.prototype.delete=Qk,di.prototype.get=nI,di.prototype.has=sI,di.prototype.set=aI;function lI(){this.__data__=[],this.size=0}function Ya(n,e){for(var t=n.length;t--;)if(Gi(n[t][0],e))return t;return-1}var cI=Array.prototype,uI=cI.splice;function hI(n){var e=this.__data__,t=Ya(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():uI.call(e,t,1),--this.size,!0}function fI(n){var e=this.__data__,t=Ya(e,n);return t<0?void 0:e[t][1]}function dI(n){return Ya(this.__data__,n)>-1}function gI(n,e){var t=this.__data__,r=Ya(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function Wn(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])}}Wn.prototype.clear=lI,Wn.prototype.delete=hI,Wn.prototype.get=fI,Wn.prototype.has=dI,Wn.prototype.set=gI;var pI=hi(pn,"Map");const po=pI;function mI(){this.size=0,this.__data__={hash:new di,map:new(po||Wn),string:new di}}function yI(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Ka(n,e){var t=n.__data__;return yI(e)?t[typeof e=="string"?"string":"hash"]:t.map}function vI(n){var e=Ka(this,n).delete(n);return this.size-=e?1:0,e}function bI(n){return Ka(this,n).get(n)}function wI(n){return Ka(this,n).has(n)}function xI(n,e){var t=Ka(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function Xn(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])}}Xn.prototype.clear=mI,Xn.prototype.delete=vI,Xn.prototype.get=bI,Xn.prototype.has=wI,Xn.prototype.set=xI;var CI="Expected a function";function Bu(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(CI);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(Bu.Cache||Xn),t}Bu.Cache=Xn;var SI=500;function PI(n){var e=Bu(n,function(r){return t.size===SI&&t.clear(),r}),t=e.cache;return e}var EI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,AI=/\\(\\)?/g,TI=PI(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(EI,function(t,r,i,s){e.push(i?s.replace(AI,"$1"):r||t)}),e});const OI=TI;function mo(n){return n==null?"":_0(n)}function K0(n,e){return bt(n)?n:Du(n,e)?[n]:OI(mo(n))}var MI=1/0;function Ja(n){if(typeof n=="string"||kn(n))return n;var e=n+"";return e=="0"&&1/n==-MI?"-0":e}function $u(n,e){e=K0(e,n);for(var t=0,r=e.length;n!=null&&t<r;)n=n[Ja(e[t++])];return t&&t==r?n:void 0}function _I(n,e,t){var r=n==null?void 0:$u(n,e);return r===void 0?t:r}function zu(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}var J0=Jt?Jt.isConcatSpreadable:void 0;function NI(n){return bt(n)||Ui(n)||!!(J0&&n&&n[J0])}function Qa(n,e,t,r,i){var s=-1,o=n.length;for(t||(t=NI),i||(i=[]);++s<o;){var a=n[s];e>0&&t(a)?e>1?Qa(a,e-1,t,r,i):zu(i,a):r||(i[i.length]=a)}return i}var kI=X0(Object.getPrototypeOf,Object);const Fu=kI;var II="[object Object]",LI=Function.prototype,RI=Object.prototype,Q0=LI.toString,jI=RI.hasOwnProperty,DI=Q0.call(Object);function In(n){if(!mn(n)||Sr(n)!=II)return!1;var e=Fu(n);if(e===null)return!0;var t=jI.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Q0.call(t)==DI}function BI(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 $I(n,e,t){var r=n.length;return t=t===void 0?r:t,!e&&t>=r?n:BI(n,e,t)}var zI="\\ud800-\\udfff",FI="\\u0300-\\u036f",qI="\\ufe20-\\ufe2f",VI="\\u20d0-\\u20ff",GI=FI+qI+VI,HI="\\ufe0e\\ufe0f",UI="\\u200d",WI=RegExp("["+UI+zI+GI+HI+"]");function Z0(n){return WI.test(n)}function XI(n){return n.split("")}var eb="\\ud800-\\udfff",YI="\\u0300-\\u036f",KI="\\ufe20-\\ufe2f",JI="\\u20d0-\\u20ff",QI=YI+KI+JI,ZI="\\ufe0e\\ufe0f",eL="["+eb+"]",qu="["+QI+"]",Vu="\\ud83c[\\udffb-\\udfff]",tL="(?:"+qu+"|"+Vu+")",tb="[^"+eb+"]",nb="(?:\\ud83c[\\udde6-\\uddff]){2}",rb="[\\ud800-\\udbff][\\udc00-\\udfff]",nL="\\u200d",ib=tL+"?",sb="["+ZI+"]?",rL="(?:"+nL+"(?:"+[tb,nb,rb].join("|")+")"+sb+ib+")*",iL=sb+ib+rL,sL="(?:"+[tb+qu+"?",qu,nb,rb,eL].join("|")+")",oL=RegExp(Vu+"(?="+Vu+")|"+sL+iL,"g");function aL(n){return n.match(oL)||[]}function lL(n){return Z0(n)?aL(n):XI(n)}function ob(n){return function(e){e=mo(e);var t=Z0(e)?lL(e):void 0,r=t?t[0]:e.charAt(0),i=t?$I(t,1).join(""):e.slice(1);return r[n]()+i}}var cL=ob("toUpperCase");const Za=cL;function uL(n){return Za(mo(n).toLowerCase())}function hL(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 fL(n){return function(e){return n==null?void 0:n[e]}}var dL={À:"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"},gL=fL(dL);const pL=gL;var mL=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yL="\\u0300-\\u036f",vL="\\ufe20-\\ufe2f",bL="\\u20d0-\\u20ff",wL=yL+vL+bL,xL="["+wL+"]",CL=RegExp(xL,"g");function SL(n){return n=mo(n),n&&n.replace(mL,pL).replace(CL,"")}var PL=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function EL(n){return n.match(PL)||[]}var AL=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function TL(n){return AL.test(n)}var ab="\\ud800-\\udfff",OL="\\u0300-\\u036f",ML="\\ufe20-\\ufe2f",_L="\\u20d0-\\u20ff",NL=OL+ML+_L,lb="\\u2700-\\u27bf",cb="a-z\\xdf-\\xf6\\xf8-\\xff",kL="\\xac\\xb1\\xd7\\xf7",IL="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",LL="\\u2000-\\u206f",RL=" \\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",ub="A-Z\\xc0-\\xd6\\xd8-\\xde",jL="\\ufe0e\\ufe0f",hb=kL+IL+LL+RL,fb="['’]",db="["+hb+"]",DL="["+NL+"]",gb="\\d+",BL="["+lb+"]",pb="["+cb+"]",mb="[^"+ab+hb+gb+lb+cb+ub+"]",$L="\\ud83c[\\udffb-\\udfff]",zL="(?:"+DL+"|"+$L+")",FL="[^"+ab+"]",yb="(?:\\ud83c[\\udde6-\\uddff]){2}",vb="[\\ud800-\\udbff][\\udc00-\\udfff]",Ki="["+ub+"]",qL="\\u200d",bb="(?:"+pb+"|"+mb+")",VL="(?:"+Ki+"|"+mb+")",wb="(?:"+fb+"(?:d|ll|m|re|s|t|ve))?",xb="(?:"+fb+"(?:D|LL|M|RE|S|T|VE))?",Cb=zL+"?",Sb="["+jL+"]?",GL="(?:"+qL+"(?:"+[FL,yb,vb].join("|")+")"+Sb+Cb+")*",HL="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",UL="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",WL=Sb+Cb+GL,XL="(?:"+[BL,yb,vb].join("|")+")"+WL,YL=RegExp([Ki+"?"+pb+"+"+wb+"(?="+[db,Ki,"$"].join("|")+")",VL+"+"+xb+"(?="+[db,Ki+bb,"$"].join("|")+")",Ki+"?"+bb+"+"+wb,Ki+"+"+xb,UL,HL,gb,XL].join("|"),"g");function KL(n){return n.match(YL)||[]}function JL(n,e,t){return n=mo(n),e=t?void 0:e,e===void 0?TL(n)?KL(n):EL(n):n.match(e)||[]}var QL="['’]",ZL=RegExp(QL,"g");function Pb(n){return function(e){return hL(JL(SL(e).replace(ZL,"")),n,"")}}var eR=Pb(function(n,e,t){return e=e.toLowerCase(),n+(t?uL(e):e)});const el=eR;function tR(n,e,t){return n===n&&(t!==void 0&&(n=n<=t?n:t),e!==void 0&&(n=n>=e?n:e)),n}function Qt(n,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=lo(t),t=t===t?t:0),e!==void 0&&(e=lo(e),e=e===e?e:0),tR(lo(n),e,t)}function nR(){this.__data__=new Wn,this.size=0}function rR(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function iR(n){return this.__data__.get(n)}function sR(n){return this.__data__.has(n)}var oR=200;function aR(n,e){var t=this.__data__;if(t instanceof Wn){var r=t.__data__;if(!po||r.length<oR-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new Xn(r)}return t.set(n,e),this.size=t.size,this}function yn(n){var e=this.__data__=new Wn(n);this.size=e.size}yn.prototype.clear=nR,yn.prototype.delete=rR,yn.prototype.get=iR,yn.prototype.has=sR,yn.prototype.set=aR;function lR(n,e){return n&&co(e,fo(e),n)}function cR(n,e){return n&&co(e,Yi(e),n)}var Eb=typeof ee=="object"&&ee&&!ee.nodeType&&ee,Ab=Eb&&typeof module=="object"&&module&&!module.nodeType&&module,uR=Ab&&Ab.exports===Eb,Tb=uR?pn.Buffer:void 0,Ob=Tb?Tb.allocUnsafe:void 0;function Mb(n,e){if(e)return n.slice();var t=n.length,r=Ob?Ob(t):new n.constructor(t);return n.copy(r),r}function hR(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 _b(){return[]}var fR=Object.prototype,dR=fR.propertyIsEnumerable,Nb=Object.getOwnPropertySymbols,gR=Nb?function(n){return n==null?[]:(n=Object(n),hR(Nb(n),function(e){return dR.call(n,e)}))}:_b;const Gu=gR;function pR(n,e){return co(n,Gu(n),e)}var mR=Object.getOwnPropertySymbols,yR=mR?function(n){for(var e=[];n;)zu(e,Gu(n)),n=Fu(n);return e}:_b;const kb=yR;function vR(n,e){return co(n,kb(n),e)}function Ib(n,e,t){var r=e(n);return bt(n)?r:zu(r,t(n))}function Hu(n){return Ib(n,fo,Gu)}function bR(n){return Ib(n,Yi,kb)}var wR=hi(pn,"DataView");const Uu=wR;var xR=hi(pn,"Promise");const Wu=xR;var CR=hi(pn,"Set");const Ji=CR;var Lb="[object Map]",SR="[object Object]",Rb="[object Promise]",jb="[object Set]",Db="[object WeakMap]",Bb="[object DataView]",PR=ui(Uu),ER=ui(po),AR=ui(Wu),TR=ui(Ji),OR=ui(Iu),gi=Sr;(Uu&&gi(new Uu(new ArrayBuffer(1)))!=Bb||po&&gi(new po)!=Lb||Wu&&gi(Wu.resolve())!=Rb||Ji&&gi(new Ji)!=jb||Iu&&gi(new Iu)!=Db)&&(gi=function(n){var e=Sr(n),t=e==SR?n.constructor:void 0,r=t?ui(t):"";if(r)switch(r){case PR:return Bb;case ER:return Lb;case AR:return Rb;case TR:return jb;case OR:return Db}return e});const Qi=gi;var MR=Object.prototype,_R=MR.hasOwnProperty;function NR(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&_R.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var kR=pn.Uint8Array;const tl=kR;function Xu(n){var e=new n.constructor(n.byteLength);return new tl(e).set(new tl(n)),e}function IR(n,e){var t=e?Xu(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var LR=/\w*$/;function RR(n){var e=new n.constructor(n.source,LR.exec(n));return e.lastIndex=n.lastIndex,e}var $b=Jt?Jt.prototype:void 0,zb=$b?$b.valueOf:void 0;function jR(n){return zb?Object(zb.call(n)):{}}function Fb(n,e){var t=e?Xu(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var DR="[object Boolean]",BR="[object Date]",$R="[object Map]",zR="[object Number]",FR="[object RegExp]",qR="[object Set]",VR="[object String]",GR="[object Symbol]",HR="[object ArrayBuffer]",UR="[object DataView]",WR="[object Float32Array]",XR="[object Float64Array]",YR="[object Int8Array]",KR="[object Int16Array]",JR="[object Int32Array]",QR="[object Uint8Array]",ZR="[object Uint8ClampedArray]",ej="[object Uint16Array]",tj="[object Uint32Array]";function nj(n,e,t){var r=n.constructor;switch(e){case HR:return Xu(n);case DR:case BR:return new r(+n);case UR:return IR(n,t);case WR:case XR:case YR:case KR:case JR:case QR:case ZR:case ej:case tj:return Fb(n,t);case $R:return new r;case zR:case VR:return new r(n);case FR:return RR(n);case qR:return new r;case GR:return jR(n)}}function qb(n){return typeof n.constructor=="function"&&!Wa(n)?kN(Fu(n)):{}}var rj="[object Map]";function ij(n){return mn(n)&&Qi(n)==rj}var Vb=Xi&&Xi.isMap,sj=Vb?uo(Vb):ij;const oj=sj;var aj="[object Set]";function lj(n){return mn(n)&&Qi(n)==aj}var Gb=Xi&&Xi.isSet,cj=Gb?uo(Gb):lj;const uj=cj;var hj=1,fj=2,dj=4,Hb="[object Arguments]",gj="[object Array]",pj="[object Boolean]",mj="[object Date]",yj="[object Error]",Ub="[object Function]",vj="[object GeneratorFunction]",bj="[object Map]",wj="[object Number]",Wb="[object Object]",xj="[object RegExp]",Cj="[object Set]",Sj="[object String]",Pj="[object Symbol]",Ej="[object WeakMap]",Aj="[object ArrayBuffer]",Tj="[object DataView]",Oj="[object Float32Array]",Mj="[object Float64Array]",_j="[object Int8Array]",Nj="[object Int16Array]",kj="[object Int32Array]",Ij="[object Uint8Array]",Lj="[object Uint8ClampedArray]",Rj="[object Uint16Array]",jj="[object Uint32Array]",Ee={};Ee[Hb]=Ee[gj]=Ee[Aj]=Ee[Tj]=Ee[pj]=Ee[mj]=Ee[Oj]=Ee[Mj]=Ee[_j]=Ee[Nj]=Ee[kj]=Ee[bj]=Ee[wj]=Ee[Wb]=Ee[xj]=Ee[Cj]=Ee[Sj]=Ee[Pj]=Ee[Ij]=Ee[Lj]=Ee[Rj]=Ee[jj]=!0,Ee[yj]=Ee[Ub]=Ee[Ej]=!1;function yo(n,e,t,r,i,s){var o,a=e&hj,l=e&fj,c=e&dj;if(t&&(o=i?t(n,r,i,s):t(n)),o!==void 0)return o;if(!Qe(n))return n;var u=bt(n);if(u){if(o=NR(n),!a)return R0(n,o)}else{var h=Qi(n),f=h==Ub||h==vj;if(Wi(n))return Mb(n,a);if(h==Wb||h==Hb||f&&!i){if(o=l||f?{}:qb(n),!a)return l?vR(n,cR(o,n)):pR(n,lR(o,n))}else{if(!Ee[h])return i?n:{};o=nj(n,h,a)}}s||(s=new yn);var d=s.get(n);if(d)return d;s.set(n,o),uj(n)?n.forEach(function(b){o.add(yo(b,e,t,b,n,s))}):oj(n)&&n.forEach(function(b,m){o.set(m,yo(b,e,t,m,n,s))});var g=c?l?bR:Hu:l?Yi:fo,p=u?void 0:g(n);return VN(p||n,function(b,m){p&&(m=b,b=n[m]),D0(o,m,yo(b,e,t,m,n,s))}),o}var Dj=4;function Yu(n){return yo(n,Dj)}var Bj=1,$j=4;function Fe(n){return yo(n,Bj|$j)}var zj="__lodash_hash_undefined__";function Fj(n){return this.__data__.set(n,zj),this}function qj(n){return this.__data__.has(n)}function Zi(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Xn;++e<t;)this.add(n[e])}Zi.prototype.add=Zi.prototype.push=Fj,Zi.prototype.has=qj;function Vj(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 Ku(n,e){return n.has(e)}var Gj=1,Hj=2;function Xb(n,e,t,r,i,s){var o=t&Gj,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&Hj?new Zi: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(!Vj(e,function(m,y){if(!Ku(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 Uj(n){var e=-1,t=Array(n.size);return n.forEach(function(r,i){t[++e]=[i,r]}),t}function Ju(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var Wj=1,Xj=2,Yj="[object Boolean]",Kj="[object Date]",Jj="[object Error]",Qj="[object Map]",Zj="[object Number]",eD="[object RegExp]",tD="[object Set]",nD="[object String]",rD="[object Symbol]",iD="[object ArrayBuffer]",sD="[object DataView]",Yb=Jt?Jt.prototype:void 0,Qu=Yb?Yb.valueOf:void 0;function oD(n,e,t,r,i,s,o){switch(t){case sD:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case iD:return!(n.byteLength!=e.byteLength||!s(new tl(n),new tl(e)));case Yj:case Kj:case Zj:return Gi(+n,+e);case Jj:return n.name==e.name&&n.message==e.message;case eD:case nD:return n==e+"";case Qj:var a=Uj;case tD:var l=r&Wj;if(a||(a=Ju),n.size!=e.size&&!l)return!1;var c=o.get(n);if(c)return c==e;r|=Xj,o.set(n,e);var u=Xb(a(n),a(e),r,i,s,o);return o.delete(n),u;case rD:if(Qu)return Qu.call(n)==Qu.call(e)}return!1}var aD=1,lD=Object.prototype,cD=lD.hasOwnProperty;function uD(n,e,t,r,i,s){var o=t&aD,a=Hu(n),l=a.length,c=Hu(e),u=c.length;if(l!=u&&!o)return!1;for(var h=l;h--;){var f=a[h];if(!(o?f in e:cD.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 hD=1,Kb="[object Arguments]",Jb="[object Array]",nl="[object Object]",fD=Object.prototype,Qb=fD.hasOwnProperty;function dD(n,e,t,r,i,s){var o=bt(n),a=bt(e),l=o?Jb:Qi(n),c=a?Jb:Qi(e);l=l==Kb?nl:l,c=c==Kb?nl:c;var u=l==nl,h=c==nl,f=l==c;if(f&&Wi(n)){if(!Wi(e))return!1;o=!0,u=!1}if(f&&!u)return s||(s=new yn),o||Xa(n)?Xb(n,e,t,r,i,s):oD(n,e,l,t,r,i,s);if(!(t&hD)){var d=u&&Qb.call(n,"__wrapped__"),g=h&&Qb.call(e,"__wrapped__");if(d||g){var p=d?n.value():n,b=g?e.value():e;return s||(s=new yn),i(p,b,t,r,s)}}return f?(s||(s=new yn),uD(n,e,t,r,i,s)):!1}function rl(n,e,t,r,i){return n===e?!0:n==null||e==null||!mn(n)&&!mn(e)?n!==n&&e!==e:dD(n,e,t,r,rl,i)}var gD=1,pD=2;function mD(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 yn;if(r)var f=r(c,u,l,n,e,h);if(!(f===void 0?rl(u,c,gD|pD,r,h):f))return!1}}return!0}function Zb(n){return n===n&&!Qe(n)}function yD(n){for(var e=fo(n),t=e.length;t--;){var r=e[t],i=n[r];e[t]=[r,i,Zb(i)]}return e}function e1(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function vD(n){var e=yD(n);return e.length==1&&e[0][2]?e1(e[0][0],e[0][1]):function(t){return t===n||mD(t,n,e)}}function bD(n,e){return n!=null&&e in Object(n)}function t1(n,e,t){e=K0(e,n);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Ja(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&&Ru(i)&&Lu(o,i)&&(bt(n)||Ui(n)))}function wD(n,e){return n!=null&&t1(n,e,bD)}var xD=1,CD=2;function SD(n,e){return Du(n)&&Zb(e)?e1(Ja(n),e):function(t){var r=_I(t,n);return r===void 0&&r===e?wD(t,n):rl(e,r,xD|CD)}}function PD(n){return function(e){return e==null?void 0:e[n]}}function ED(n){return function(e){return $u(e,n)}}function AD(n){return Du(n)?PD(Ja(n)):ED(n)}function Zu(n){return typeof n=="function"?n:n==null?Vi:typeof n=="object"?bt(n)?SD(n[0],n[1]):vD(n):AD(n)}function TD(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 OD(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 MD=OD();const n1=MD;function _D(n,e){return n&&n1(n,e,fo)}function ND(n,e){return function(t,r){if(t==null)return t;if(!fi(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 kD=ND(_D);const r1=kD;function ID(n,e,t,r){return r1(n,function(i,s,o){e(r,i,t(i),o)}),r}function LD(n,e){return function(t,r){var i=bt(t)?TD:ID,s=e?e():{};return i(t,n,Zu(r),s)}}var RD=function(){return pn.Date.now()};const eh=RD;var jD="Expected a function",DD=Math.max,BD=Math.min;function th(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(jD);e=lo(e)||0,Qe(t)&&(u=!!t.leading,h="maxWait"in t,s=h?DD(lo(t.maxWait)||0,e):s,f="trailing"in t?!!t.trailing:f);function d(C){var P=r,E=i;return r=i=void 0,c=C,o=n.apply(E,P),o}function g(C){return c=C,a=setTimeout(m,e),u?d(C):o}function p(C){var P=C-l,E=C-c,A=e-P;return h?BD(A,s-E):A}function b(C){var P=C-l,E=C-c;return l===void 0||P>=e||P<0||h&&E>=s}function m(){var C=eh();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(eh())}function x(){var C=eh(),P=b(C);if(r=arguments,i=this,l=C,P){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 i1=Object.prototype,$D=i1.hasOwnProperty,zD=Hi(function(n,e){n=Object(n);var t=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&Ua(e[0],e[1],i)&&(r=1);++t<r;)for(var s=e[t],o=Yi(s),a=-1,l=o.length;++a<l;){var c=o[a],u=n[c];(u===void 0||Gi(u,i1[c])&&!$D.call(n,c))&&(n[c]=s[c])}return n});const FD=zD;function nh(n,e,t){(t!==void 0&&!Gi(n[e],t)||t===void 0&&!(e in n))&&Ha(n,e,t)}function il(n){return mn(n)&&fi(n)}function rh(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function qD(n){return co(n,Yi(n))}function VD(n,e,t,r,i,s,o){var a=rh(n,t),l=rh(e,t),c=o.get(l);if(c){nh(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&&Wi(l),g=!f&&!d&&Xa(l);u=l,f||d||g?bt(a)?u=a:il(a)?u=R0(a):d?(h=!1,u=Mb(l,!0)):g?(h=!1,u=Fb(l,!0)):u=[]:In(l)||Ui(l)?(u=a,Ui(a)?u=qD(a):(!Qe(a)||Nu(a))&&(u=qb(l))):h=!1}h&&(o.set(l,u),i(u,l,r,s,o),o.delete(l)),nh(n,t,u)}function sl(n,e,t,r,i){n!==e&&n1(e,function(s,o){if(i||(i=new yn),Qe(s))VD(n,e,o,t,sl,r,i);else{var a=r?r(rh(n,o),s,o+"",n,e,i):void 0;a===void 0&&(a=s),nh(n,o,a)}},Yi)}function s1(n,e,t,r,i,s){return Qe(n)&&Qe(e)&&(s.set(e,n),sl(n,e,void 0,s1,s),s.delete(e)),n}var GD=$0(function(n,e,t,r){sl(n,e,t,r)});const HD=GD;var UD=Hi(function(n){return n.push(void 0,s1),L0(HD,void 0,n)});const o1=UD;function a1(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 WD=200;function XD(n,e,t,r){var i=-1,s=j0,o=!0,a=n.length,l=[],c=e.length;if(!a)return l;t&&(e=ao(e,uo(t))),r?(s=a1,o=!1):e.length>=WD&&(s=Ku,o=!1,e=new Zi(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 YD=Hi(function(n,e){return il(n)?XD(n,Qa(e,1,il,!0)):[]});const KD=YD;function JD(n,e){var t=-1,r=fi(n)?Array(n.length):[];return r1(n,function(i,s,o){r[++t]=e(i,s,o)}),r}var QD=Object.prototype,ZD=QD.hasOwnProperty,eB=LD(function(n,e,t){ZD.call(n,t)?n[t].push(e):Ha(n,t,[e])});const l1=eB;function tB(n,e){return n>e}var nB=Object.prototype,rB=nB.hasOwnProperty;function iB(n,e){return n!=null&&rB.call(n,e)}function ol(n,e){return n!=null&&t1(n,e,iB)}var sB="[object Map]",oB="[object Set]",aB=Object.prototype,lB=aB.hasOwnProperty;function c1(n){if(n==null)return!0;if(fi(n)&&(bt(n)||typeof n=="string"||typeof n.splice=="function"||Wi(n)||Xa(n)||Ui(n)))return!n.length;var e=Qi(n);if(e==sB||e==oB)return!n.size;if(Wa(n))return!Y0(n).length;for(var t in n)if(lB.call(n,t))return!1;return!0}function Yn(n,e){return rl(n,e)}var cB="[object Number]";function u1(n){return typeof n=="number"||mn(n)&&Sr(n)==cB}var uB=ob("toLowerCase");const hB=uB;function fB(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&&!kn(o):t(o,a)))var a=o,l=s}return l}function dB(n){return n&&n.length?fB(n,Vi,tB):void 0}var gB=$0(function(n,e,t){sl(n,e,t)});const Re=gB;function pB(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}function mB(n,e){if(n!==e){var t=n!==void 0,r=n===null,i=n===n,s=kn(n),o=e!==void 0,a=e===null,l=e===e,c=kn(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 yB(n,e,t){for(var r=-1,i=n.criteria,s=e.criteria,o=i.length,a=t.length;++r<o;){var l=mB(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 vB(n,e,t){e.length?e=ao(e,function(s){return bt(s)?function(o){return $u(o,s.length===1?s[0]:s)}:s}):e=[Vi];var r=-1;e=ao(e,uo(Zu));var i=JD(n,function(s,o,a){var l=ao(e,function(c){return c(s)});return{criteria:l,index:++r,value:s}});return pB(i,function(s,o){return yB(s,o,t)})}var bB=Hi(function(n,e){if(n==null)return[];var t=e.length;return t>1&&Ua(n,e[0],e[1])?e=[]:t>2&&Ua(e[0],e[1],e[2])&&(e=[e[0]]),vB(n,Qa(e,1),[])});const h1=bB;var wB=4294967295,xB=wB-1,CB=Math.floor,SB=Math.min;function f1(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=kn(e),c=e===void 0;i<s;){var u=CB((i+s)/2),h=t(n[u]),f=h!==void 0,d=h===null,g=h===h,p=kn(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 SB(s,xB)}var PB=4294967295,EB=PB>>>1;function AB(n,e,t){var r=0,i=n==null?r:n.length;if(typeof e=="number"&&e===e&&i<=EB){for(;r<i;){var s=r+i>>>1,o=n[s];o!==null&&!kn(o)&&(t?o<=e:o<e)?r=s+1:i=s}return i}return f1(n,e,Vi,t)}function TB(n,e){return AB(n,e)}function OB(n,e,t){return f1(n,e,Zu(t))}var MB=Pb(function(n,e,t){return n+(t?" ":"")+Za(e)});const _B=MB;var NB="Expected a function";function kB(n,e,t){var r=!0,i=!0;if(typeof n!="function")throw new TypeError(NB);return Qe(t)&&(r="leading"in t?!!t.leading:r,i="trailing"in t?!!t.trailing:i),th(n,e,{leading:r,maxWait:e,trailing:i})}var IB=1/0,LB=Ji&&1/Ju(new Ji([,-0]))[1]==IB?function(n){return new Ji(n)}:IN;const RB=LB;var jB=200;function d1(n,e,t){var r=-1,i=j0,s=n.length,o=!0,a=[],l=a;if(t)o=!1,i=a1;else if(s>=jB){var c=e?null:RB(n);if(c)return Ju(c);o=!1,i=Ku,l=new Zi}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 DB=Hi(function(n){return d1(Qa(n,1,il,!0))});const g1=DB;function p1(n){return n&&n.length?d1(n):[]}function m1(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 Q(n,e,...t){return m1(n,e,t)}function BB(n){return typeof n=="object"&&n.then&&typeof n.then=="function"}function y1(n){return n!=null&&(n instanceof Promise||BB(n))}function v1(...n){const e=[];if(n.forEach(r=>{Array.isArray(r)?e.push(...r):e.push(r)}),e.some(r=>y1(r))){const r=e.map(i=>y1(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 ih(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=m1(i,s,o);t.push(a)}return v1(t)}class $B{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),ih([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=ih([...s],t))}const i=this.listeners["*"];return i!=null?v1([r,ih([...i],[e,...t])]):r}emit(e,...t){return this.trigger(e,...t)}}function zB(n,...e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(r=>{r!=="constructor"&&Object.defineProperty(n.prototype,r,Object.getOwnPropertyDescriptor(t.prototype,r))})})}const FB=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 qB(n,e){FB(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}let VB=class{};const GB=/^\s*class\s+/.test(`${VB}`)||/^\s*class\s*\{/.test(`${class{}}`);function sh(n,e){let t;return GB?t=class extends e{}:(t=function(){return e.apply(this,arguments)},qB(t,e)),Object.defineProperty(t,"name",{value:n}),t}function b1(n){return n==="__proto__"}function oh(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 es(n,e,t,r="/"){const i=Array.isArray(e)?e:e.split(r),s=i.pop();if(s&&!b1(s)){let o=n;i.forEach(a=>{b1(a)||(o[a]==null&&(o[a]={}),o=o[a])}),o[s]=t}return n}function w1(n,e,t="/"){const r=Array.isArray(e)?e.slice():e.split(t),i=r.pop();if(i)if(r.length>0){const s=oh(n,r);s&&delete s[i]}else delete n[i];return n}class wt extends $B{}(function(n){n.dispose=Nn.dispose})(wt||(wt={})),zB(wt,Nn);const x1=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},C1=x1(n=>n.replace(/\B([A-Z])/g,"-$1").toLowerCase()),ah=x1(n=>_B(el(n)).replace(/ /g,""));function lh(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 ch(){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 HB(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=UB(a,u,i-1);if(h===void 0)continue;h<3?(o=!0,s=l):(i=h,s=l)}}return s}function UB(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 Kn(n){return typeof n=="string"&&n.slice(-1)==="%"}function Ft(n,e){if(n==null)return 0;let t;if(typeof n=="string"){if(t=parseFloat(n),Kn(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 Ln(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 uh=!1,S1=!1,P1=!1,E1=!1,A1=!1,T1=!1,O1=!1,M1=!1,_1=!1,N1=!1,k1=!1,I1=!1,L1=!1,R1=!1,j1=!1,D1=!1;if(typeof navigator=="object"){const n=navigator.userAgent;uh=n.indexOf("Macintosh")>=0,S1=!!n.match(/(iPad|iPhone|iPod)/g),P1=n.indexOf("Windows")>=0,E1=n.indexOf("MSIE")>=0,A1=!!n.match(/Trident\/7\./),T1=!!n.match(/Edge\//),O1=n.indexOf("Mozilla/")>=0&&n.indexOf("MSIE")<0&&n.indexOf("Edge/")<0,_1=n.indexOf("Chrome/")>=0&&n.indexOf("Edge/")<0,N1=n.indexOf("Opera/")>=0||n.indexOf("OPR/")>=0,k1=n.indexOf("Firefox/")>=0,I1=n.indexOf("AppleWebKit/")>=0&&n.indexOf("Chrome/")<0&&n.indexOf("Edge/")<0,typeof document=="object"&&(D1=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||n.indexOf("Opera/")>=0)}if(typeof window=="object"&&(M1=window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,R1=window.PointerEvent!=null&&!uh),typeof document=="object"){L1="ontouchstart"in document.documentElement;try{const n=Object.defineProperty({},"passive",{get(){j1=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},n)}catch(n){}}var Zt;(function(n){n.IS_MAC=uh,n.IS_IOS=S1,n.IS_WINDOWS=P1,n.IS_IE=E1,n.IS_IE11=A1,n.IS_EDGE=T1,n.IS_NETSCAPE=O1,n.IS_CHROME_APP=M1,n.IS_CHROME=_1,n.IS_OPERA=N1,n.IS_FIREFOX=k1,n.IS_SAFARI=I1,n.SUPPORT_TOUCH=L1,n.SUPPORT_POINTER=R1,n.SUPPORT_PASSIVE=j1,n.NO_FOREIGNOBJECT=D1,n.SUPPORT_FOREIGNOBJECT=!n.NO_FOREIGNOBJECT})(Zt||(Zt={})),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}(Zt||(Zt={}));const hh=/[\t\r\n\f]/g,fh=/\S+/g,ts=n=>` ${n} `;function ns(n){return n&&n.getAttribute&&n.getAttribute("class")||""}function rs(n,e){if(n==null||e==null)return!1;const t=ts(ns(n)),r=ts(e);return n.nodeType===1?t.replace(hh," ").includes(r):!1}function Z(n,e){if(!(n==null||e==null)){if(typeof e=="function")return Z(n,e(ns(n)));if(typeof e=="string"&&n.nodeType===1){const t=e.match(fh)||[],r=ts(ns(n)).replace(hh," ");let i=t.reduce((s,o)=>s.indexOf(ts(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(ns(n)));if((!e||typeof e=="string")&&n.nodeType===1){const t=(e||"").match(fh)||[],r=ts(ns(n)).replace(hh," ");let i=t.reduce((s,o)=>{const a=ts(o);return s.indexOf(a)>-1?s.replace(a," "):s},r);i=e?i.trim():"",r!==i&&n.setAttribute("class",i)}}}function B1(n,e,t){if(!(n==null||e==null)){if(t!=null&&typeof e=="string"){t?Z(n,e):gt(n,e);return}if(typeof e=="function")return B1(n,e(ns(n),t),t);typeof e=="string"&&(e.match(fh)||[]).forEach(i=>{rs(n,i)?gt(n,i):Z(n,i)})}}let $1=0;function WB(){return $1+=1,`v${$1}`}function dh(n){return(n.id==null||n.id==="")&&(n.id=WB()),n.id}function Pr(n){return n==null?!1:typeof n.getScreenCTM=="function"&&n instanceof SVGElement}const at={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"},z1="1.1";function F1(n,e=document){return e.createElement(n)}function gh(n,e=at.xhtml,t=document){return t.createElementNS(e,n)}function Jn(n,e=document){return gh(n,at.svg,e)}function al(n){if(n){const t=`<svg xmlns="${at.svg}" xmlns:xlink="${at.xlink}" version="${z1}">${n}</svg>`,{documentElement:r}=XB(t,{async:!1});return r}const e=document.createElementNS(at.svg,"svg");return e.setAttributeNS(at.xmlns,"xmlns:xlink",at.xlink),e.setAttribute("version",z1),e}function XB(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 YB(n,e=!0){const t=n.nodeName;return e?t.toLowerCase():t.toUpperCase()}function ph(n){let e=0,t=n.previousSibling;for(;t;)t.nodeType===1&&(e+=1),t=t.previousSibling;return e}function KB(n,e){return n.querySelectorAll(e)}function JB(n,e){return n.querySelector(e)}function q1(n,e,t){const r=n.ownerSVGElement;let i=n.parentNode;for(;i&&i!==t&&i!==r;){if(rs(i,e))return i;i=i.parentNode}return null}function V1(n,e){const t=e&&e.parentNode;return n===t||!!(t&&t.nodeType===1&&n.compareDocumentPosition(t)&16)}function Qn(n){n&&(Array.isArray(n)?n:[n]).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}function vo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Rn(n,e){(Array.isArray(e)?e:[e]).forEach(r=>{r!=null&&n.appendChild(r)})}function G1(n,e){const t=n.firstChild;return t?bo(t,e):Rn(n,e)}function bo(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(i=>{i!=null&&t.insertBefore(i,n)})}function QB(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(i=>{i!=null&&t.insertBefore(i,n.nextSibling)})}function Er(n,e){e!=null&&e.appendChild(n)}function ZB(n){return!!n&&n.nodeType===1}function H1(n){try{return n instanceof HTMLElement}catch(e){return typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"}}function e$(n,e){const t=[];let r=n.firstChild;for(;r;r=r.nextSibling)r.nodeType===1&&(!e||rs(r,e))&&t.push(r);return t}const U1=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust"];function t$(n,e){return n.getAttribute(e)}function mh(n,e){const t=X1(e);t.ns?n.hasAttributeNS(t.ns,t.local)&&n.removeAttributeNS(t.ns,t.local):n.hasAttribute(e)&&n.removeAttribute(e)}function yh(n,e,t){if(t==null)return mh(n,e);const r=X1(e);r.ns&&typeof t=="string"?n.setAttributeNS(r.ns,e,t):e==="id"?n.id=`${t}`:n.setAttribute(e,`${t}`)}function W1(n,e){Object.keys(e).forEach(t=>{yh(n,t,e[t])})}function ge(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"?W1(n,e):yh(n,e,t)}function X1(n){if(n.indexOf(":")!==-1){const e=n.split(":");return{ns:at[e[0]],local:e[1]}}return{ns:null,local:n}}function wo(n){const e={};return Object.keys(n).forEach(t=>{const r=U1.includes(t)?t:C1(t);e[r]=n[t]}),e}function ll(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 vh(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=ll(e[t])):i?(s=ll(n[t]),o=e[t]):(s=ll(n[t]),o=ll(e[t])),n[t]=vh(s,o)}else n[t]=e[t]}),n}function n$(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=vh(vh({},o.attrs),f.attrs),t.includeAnnotationIndices&&(o.annotations==null&&(o.annotations=[]),o.annotations.push(u)))}a=s[c-1],a?Qe(o)&&Qe(a)?(l=l,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?l.t+=o.t:(i.push(l),l=o)):Qe(o)||Qe(a)?(l=l,i.push(l),l=o):l=(l||"")+o:l=o}return l!=null&&i.push(l),i}function r$(n){return n.replace(/ /g," ")}var Y1;(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})(Y1||(Y1={}));let pi;const i$={px(n){return n},mm(n){return pi*n},cm(n){return pi*n*10},in(n){return pi*n*25.4},pt(n){return pi*(25.4*n/72)},pc(n){return pi*(25.4*n/6)}};var K1;(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){pi==null&&(pi=e("1","1","mm").width);const s=i?i$[i]:null;return s?s(r):r}n.toPx=t})(K1||(K1={}));const s$=/-(.)/g;function o$(n){return n.replace(s$,(e,t)=>t.toUpperCase())}const bh={},J1=["webkit","ms","moz","o"],Q1=document?document.createElement("div").style:{};function a$(n){for(let e=0;e<J1.length;e+=1){const t=J1[e]+n;if(t in Q1)return t}return null}function l$(n){const e=o$(n);if(bh[e]==null){const t=e.charAt(0).toUpperCase()+e.slice(1);bh[e]=e in Q1?e:a$(t)}return bh[e]}function Z1(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 c$={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 u$(n){return/^--/.test(n)}function cl(n,e,t){const r=window.getComputedStyle(n,null);return t?r.getPropertyValue(e)||void 0:r[e]||n.style[e]}function ul(n,e){return parseInt(cl(n,e),10)||0}function h$(n,e){return!c$[n]&&typeof e=="number"?`${e}px`:e}function ve(n,e,t){if(typeof e=="string"){const r=u$(e);if(r||(e=l$(e)),t===void 0)return cl(n,e,r);r||(t=h$(e,t));const i=n.style;r?i.setProperty(e,t):i[e]=t;return}for(const r in e)ve(n,r,e[r])}const hl=new WeakMap;function ew(n,e){const t=el(e),r=hl.get(n);if(r)return r[t]}function f$(n,e,t){const r=el(e),i=hl.get(n);i?i[r]=t:hl.set(n,{[r]:t})}function mi(n,e,t){if(!e){const r={};return Object.keys(hl).forEach(i=>{r[i]=ew(n,i)}),r}if(typeof e=="string"){if(t===void 0)return ew(n,e);f$(n,e,t);return}for(const r in e)mi(n,r,e[r])}const d$={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};function wh(n,e,t){if(e){if(typeof e=="string"){if(e=d$[e]||e,arguments.length<3)return n[e];n[e]=t;return}for(const r in e)wh(n,r,e[r])}}class te{get[Symbol.toStringTag](){return te.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(te.isVector(e))i=e.node;else if(typeof e=="string")if(e.toLowerCase()==="svg")i=al();else if(e[0]==="<"){const s=al(e);i=document.importNode(s.firstChild,!0)}else i=document.createElementNS(at.svg,e);else i=e;this.node=i,t&&this.setAttributes(t),r&&this.append(r)}transform(e,t){return e==null?os(this.node):(os(this.node,e,t),this)}translate(e,t=0,r={}){return e==null?cw(this.node):(cw(this.node,e,t,r),this)}rotate(e,t,r,i={}){return e==null?Sh(this.node):(Sh(this.node,e,t,r,i),this)}scale(e,t){return e==null?Ph(this.node):(Ph(this.node,e,t),this)}getTransformToElement(e){const t=te.toNode(e);return So(this.node,t)}removeAttribute(e){return mh(this.node,e),this}getAttribute(e){return t$(this.node,e)}setAttribute(e,t){return yh(this.node,e,t),this}setAttributes(e){return W1(this.node,e),this}attr(e,t){return e==null?ge(this.node):typeof e=="string"&&t===void 0?ge(this.node,e):(typeof e=="object"?ge(this.node,e):ge(this.node,e,t),this)}svg(){return this.node instanceof SVGSVGElement?this:te.create(this.node.ownerSVGElement)}defs(){const e=this.svg()||this,t=e.node.getElementsByTagName("defs")[0];return t?te.create(t):te.create("defs").appendTo(e)}text(e,t={}){return rw(this.node,e,t),this}tagName(){return YB(this.node)}clone(){return te.create(this.node.cloneNode(!0))}remove(){return Qn(this.node),this}empty(){return vo(this.node),this}append(e){return Rn(this.node,te.toNodes(e)),this}appendTo(e){return Er(this.node,te.isVector(e)?e.node:e),this}prepend(e){return G1(this.node,te.toNodes(e)),this}before(e){return bo(this.node,te.toNodes(e)),this}replace(e){return this.node.parentNode&&this.node.parentNode.replaceChild(te.toNode(e),this.node),te.create(e)}first(){return this.node.firstChild?te.create(this.node.firstChild):null}last(){return this.node.lastChild?te.create(this.node.lastChild):null}get(e){const t=this.node.childNodes[e];return t?te.create(t):null}indexOf(e){return Array.prototype.slice.call(this.node.childNodes).indexOf(te.toNode(e))}find(e){const t=[],r=KB(this.node,e);if(r)for(let i=0,s=r.length;i<s;i+=1)t.push(te.create(r[i]));return t}findOne(e){const t=JB(this.node,e);return t?te.create(t):null}findParentByClass(e,t){const r=q1(this.node,e,t);return r?te.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 V1(this.node,te.isVector(e)?e.node:e)}wrap(e){const t=te.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=te.create(t.node.parentNode),e==null)return t;do if(typeof e=="string"?t.matches(e):t instanceof e)return t;while(t=te.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(te.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 ph(this.node)}hasClass(e){return rs(this.node,e)}addClass(e){return Z(this.node,e),this}removeClass(e){return gt(this.node,e),this}toggleClass(e,t){return B1(this.node,e,t),this}toLocalPoint(e,t){return L$(this.node,e,t)}sample(e=1){return this.node instanceof SVGPathElement?v$(this.node,e):[]}toPath(){return te.create(E$(this.node))}toPathData(){return aw(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=al(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})(te||(te={}));const tw=document.createElement("canvas").getContext("2d");function g$(n,e){const t=te.create(e),r=te.create("textPath"),i=n.d;if(i&&n["xlink:href"]===void 0){const s=te.create("path").attr("d",i).appendTo(t.defs());r.attr("xlink:href",`#${s.id}`)}return typeof n=="object"&&r.attr(n),r.node}function p$(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=te.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 nw=/em$/;function fl(n,e){const t=parseFloat(n);return nw.test(n)?t*e:t}function m$(n,e,t,r){if(!Array.isArray(e))return 0;const i=e.length;if(!i)return 0;let s=e[0];const o=fl(s.maxFontSize,t)||t;let a=0;const l=fl(r,t);for(let h=1;h<i;h+=1){s=e[h];const f=fl(s.lineHeight,t)||l;a+=f}const c=fl(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 rw(n,e,t={}){e=r$(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&&vo(n),ge(n,{"xml:space":"preserve",display:e||t.displayEmpty?null:"none"});const p=ge(n,"font-size");let b=parseFloat(p);b||(b=16,(o||c)&&!p&&ge(n,"font-size",`${b}`));let m;i?(typeof i=="string"&&(i={d:i}),m=g$(i,n)):m=document.createDocumentFragment();let y,v=0,w;const x=e.split(`
1
+ (function(ee,R){typeof exports=="object"&&typeof module!="undefined"?R(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("ahooks"),require("lodash")):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","ahooks","lodash"],R):(ee=typeof globalThis!="undefined"?globalThis:ee||self,R(ee["@nocobase/plugin-graph-collection-manager"]={},ee["@nocobase/client"],ee.jsxRuntime,ee.react,ee["@ant-design/icons"],ee["@formily/shared"],ee["@formily/react"],ee["@formily/reactive"],ee["@nocobase/utils"],ee.antd,ee["react-i18next"],ee["@emotion/css"],ee.ahooks,ee.lodash))})(this,function(ee,R,_,W,Ue,qa,Kt,so,gn,de,Va,xr,D2,Ou){"use strict";var mW=Object.defineProperty,yW=Object.defineProperties;var vW=Object.getOwnPropertyDescriptors;var Tu=Object.getOwnPropertySymbols;var N2=Object.prototype.hasOwnProperty,k2=Object.prototype.propertyIsEnumerable;var _2=(ee,R,_)=>R in ee?mW(ee,R,{enumerable:!0,configurable:!0,writable:!0,value:_}):ee[R]=_,ie=(ee,R)=>{for(var _ in R||(R={}))N2.call(R,_)&&_2(ee,_,R[_]);if(Tu)for(var _ of Tu(R))k2.call(R,_)&&_2(ee,_,R[_]);return ee},He=(ee,R)=>yW(ee,vW(R));var I2=(ee,R)=>{var _={};for(var W in ee)N2.call(ee,W)&&R.indexOf(W)<0&&(_[W]=ee[W]);if(ee!=null&&Tu)for(var W of Tu(ee))R.indexOf(W)<0&&k2.call(ee,W)&&(_[W]=ee[W]);return _};var ze=(ee,R,_)=>new Promise((W,Ue)=>{var qa=gn=>{try{so(_.next(gn))}catch(de){Ue(de)}},Kt=gn=>{try{so(_.throw(gn))}catch(de){Ue(de)}},so=gn=>gn.done?W(gn.value):Promise.resolve(gn.value).then(qa,Kt);so((_=_.apply(ee,R)).next())});const ci=W.createContext(null),x0=n=>{const{record:e,setTargetNode:t,node:r,handelOpenPorts:i}=n;return _.jsx(ci.Provider,{value:{node:r,record:e,positionTargetNode:s=>{t(s||r)},openPorts:i},children:n.children})},B2=(n,e)=>{const t=R.useRequest(()=>Promise.resolve({data:e}),He(ie({},n),{manual:!0})),r=R.useActionContext();return W.useEffect(()=>{r.visible&&t.run()},[r.visible]),t};Kt.observer(()=>{const{record:n}=W.useContext(ci),e=R.useCompile();return _.jsx("div",{children:_.jsx(de.Select,{popupMatchSelectWidth:!1,disabled:!0,value:n.name,options:[{value:n.name,label:e(n.title)}]})})},{displayName:"SourceCollection"});const Cr=()=>{const n=Kt.useForm(),e=R.useActionContext();return{run(){return ze(this,null,function*(){e.setVisible(!1),n.reset()})}}},C0=n=>{const e=Kt.useForm(),t=R.useAPIClient(),r=R.useActionContext(),{refreshCM:i}=R.useCollectionManager();return{run(){return ze(this,null,function*(){yield e.submit(),yield t.resource("collections").create({values:e.values}),r.setVisible(!1),yield e.reset(),n("last"),yield i()})}}},S0=(n,e)=>{const t=Kt.useForm(),r=R.useAPIClient(),i=R.useActionContext(),{refreshCM:s}=R.useCollectionManager(),{positionTargetNode:o,openPorts:a}=W.useContext(ci),{getValues:l}=R.useCollectionFieldFormValues();return{run(){return ze(this,null,function*(){yield t.submit();const u=l(),h=gn.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()})}}},$2=({collectionName:n,name:e,key:t})=>{const{refreshCM:r}=R.useCollectionManager(),{t:i}=Va.useTranslation(),s=Kt.useForm(),o=R.useActionContext(),a=R.useAPIClient(),{positionTargetNode:l,node:c}=W.useContext(ci);return{run(){return ze(this,null,function*(){var h;yield s.submit(),yield a.resource("collections.fields",n).update({filterByTk:e,values:s.values}),o.setVisible(!1),de.message.success(i("Saved successfully")),l(),r(),c.setPortProp(t,"uiSchema",{title:(h=s.values)==null?void 0:h.uiSchema.title}),yield s.reset()})}}},Mu=()=>{const{t:n}=Va.useTranslation(),e=Kt.useForm(),t=R.useActionContext(),{name:r}=e.values,i=R.useAPIClient(),{refreshCM:s}=R.useCollectionManager(),{positionTargetNode:o}=W.useContext(ci);return{run(){return ze(this,null,function*(){yield e.submit(),yield i.resource("collections").update({filterByTk:r,values:ie({},gn.lodash.omit(e.values,["fields"]))}),t.setVisible(!1),de.message.success(n("Saved successfully")),yield e.reset(),o(),s()})}}},z2=n=>{const e=R.useAPIClient();return{run(){return ze(this,null,function*(){yield e.resource("collections").destroy({filterByTk:n}),yield e.resource("graphPositions").destroy({filter:{collectionName:n}})})}}},F2=n=>{const{name:e}=n,{run:t}=z2(e),{refreshCM:r}=R.useCollectionManager(),{positionTargetNode:i}=W.useContext(ci);return{run(){return ze(this,null,function*(){yield t(),i("destory"),yield r()})}}},q2=(n,e)=>{const t=R.useAPIClient(),{positionTargetNode:r}=W.useContext(ci);return{run(){return ze(this,null,function*(){yield t.resource("collections.fields",n).destroy({filterByTk:e}),r()})}}},V2=n=>{const{collectionName:e,name:t}=n,{refreshCM:r}=R.useCollectionManager(),{run:i}=q2(e,t);return{run(){return ze(this,null,function*(){yield i(),yield r()})}}},_u=n=>(e,{targetScope:t})=>{e.loading=!0,n(t).then(so.action.bound(r=>{e.dataSource=r,e.loading=!1})).catch(r=>{gn.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 Nn{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})(Nn||(Nn={}));class P0{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})(P0||(P0={}));var G2=typeof global=="object"&&global&&global.Object===Object&&global;const E0=G2;var H2=typeof self=="object"&&self&&self.Object===Object&&self,U2=E0||H2||Function("return this")();const pn=U2;var W2=pn.Symbol;const Jt=W2;var A0=Object.prototype,X2=A0.hasOwnProperty,Y2=A0.toString,oo=Jt?Jt.toStringTag:void 0;function K2(n){var e=X2.call(n,oo),t=n[oo];try{n[oo]=void 0;var r=!0}catch(s){}var i=Y2.call(n);return r&&(e?n[oo]=t:delete n[oo]),i}var J2=Object.prototype,Q2=J2.toString;function Z2(n){return Q2.call(n)}var eN="[object Null]",tN="[object Undefined]",T0=Jt?Jt.toStringTag:void 0;function Sr(n){return n==null?n===void 0?tN:eN:T0&&T0 in Object(n)?K2(n):Z2(n)}function mn(n){return n!=null&&typeof n=="object"}var nN="[object Symbol]";function kn(n){return typeof n=="symbol"||mn(n)&&Sr(n)==nN}function ao(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 rN=Array.isArray;const bt=rN;var iN=1/0,O0=Jt?Jt.prototype:void 0,M0=O0?O0.toString:void 0;function _0(n){if(typeof n=="string")return n;if(bt(n))return ao(n,_0)+"";if(kn(n))return M0?M0.call(n):"";var e=n+"";return e=="0"&&1/n==-iN?"-0":e}var sN=/\s/;function oN(n){for(var e=n.length;e--&&sN.test(n.charAt(e)););return e}var aN=/^\s+/;function lN(n){return n&&n.slice(0,oN(n)+1).replace(aN,"")}function Qe(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var N0=0/0,cN=/^[-+]0x[0-9a-f]+$/i,uN=/^0b[01]+$/i,hN=/^0o[0-7]+$/i,fN=parseInt;function lo(n){if(typeof n=="number")return n;if(kn(n))return N0;if(Qe(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Qe(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=lN(n);var t=uN.test(n);return t||hN.test(n)?fN(n.slice(2),t?2:8):cN.test(n)?N0:+n}function Vi(n){return n}var dN="[object AsyncFunction]",gN="[object Function]",pN="[object GeneratorFunction]",mN="[object Proxy]";function Nu(n){if(!Qe(n))return!1;var e=Sr(n);return e==gN||e==pN||e==dN||e==mN}var yN=pn["__core-js_shared__"];const ku=yN;var k0=function(){var n=/[^.]+$/.exec(ku&&ku.keys&&ku.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function vN(n){return!!k0&&k0 in n}var bN=Function.prototype,wN=bN.toString;function ui(n){if(n!=null){try{return wN.call(n)}catch(e){}try{return n+""}catch(e){}}return""}var xN=/[\\^$.*+?()[\]{}|]/g,CN=/^\[object .+?Constructor\]$/,SN=Function.prototype,PN=Object.prototype,EN=SN.toString,AN=PN.hasOwnProperty,TN=RegExp("^"+EN.call(AN).replace(xN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ON(n){if(!Qe(n)||vN(n))return!1;var e=Nu(n)?TN:CN;return e.test(ui(n))}function MN(n,e){return n==null?void 0:n[e]}function hi(n,e){var t=MN(n,e);return ON(t)?t:void 0}var _N=hi(pn,"WeakMap");const Iu=_N;var I0=Object.create,NN=function(){function n(){}return function(e){if(!Qe(e))return{};if(I0)return I0(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();const kN=NN;function L0(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 IN(){}function R0(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var LN=800,RN=16,jN=Date.now;function DN(n){var e=0,t=0;return function(){var r=jN(),i=RN-(r-t);if(t=r,i>0){if(++e>=LN)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function BN(n){return function(){return n}}var $N=function(){try{var n=hi(Object,"defineProperty");return n({},"",{}),n}catch(e){}}();const Ga=$N;var zN=Ga?function(n,e){return Ga(n,"toString",{configurable:!0,enumerable:!1,value:BN(e),writable:!0})}:Vi,FN=DN(zN);const qN=FN;function VN(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}function GN(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 HN(n){return n!==n}function UN(n,e,t){for(var r=t-1,i=n.length;++r<i;)if(n[r]===e)return r;return-1}function WN(n,e,t){return e===e?UN(n,e,t):GN(n,HN,t)}function j0(n,e){var t=n==null?0:n.length;return!!t&&WN(n,e,0)>-1}var XN=9007199254740991,YN=/^(?:0|[1-9]\d*)$/;function Lu(n,e){var t=typeof n;return e=e==null?XN:e,!!e&&(t=="number"||t!="symbol"&&YN.test(n))&&n>-1&&n%1==0&&n<e}function Ha(n,e,t){e=="__proto__"&&Ga?Ga(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function Gi(n,e){return n===e||n!==n&&e!==e}var KN=Object.prototype,JN=KN.hasOwnProperty;function D0(n,e,t){var r=n[e];(!(JN.call(n,e)&&Gi(r,t))||t===void 0&&!(e in n))&&Ha(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?Ha(t,a,l):D0(t,a,l)}return t}var B0=Math.max;function QN(n,e,t){return e=B0(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,s=B0(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),L0(n,this,a)}}function Hi(n,e){return qN(QN(n,e,Vi),n+"")}var ZN=9007199254740991;function Ru(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=ZN}function fi(n){return n!=null&&Ru(n.length)&&!Nu(n)}function Ua(n,e,t){if(!Qe(t))return!1;var r=typeof e;return(r=="number"?fi(t)&&Lu(e,t.length):r=="string"&&e in t)?Gi(t[e],n):!1}function $0(n){return Hi(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&&Ua(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 ek=Object.prototype;function Wa(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||ek;return n===t}function tk(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var nk="[object Arguments]";function z0(n){return mn(n)&&Sr(n)==nk}var F0=Object.prototype,rk=F0.hasOwnProperty,ik=F0.propertyIsEnumerable,sk=z0(function(){return arguments}())?z0:function(n){return mn(n)&&rk.call(n,"callee")&&!ik.call(n,"callee")};const Ui=sk;function ok(){return!1}var q0=typeof ee=="object"&&ee&&!ee.nodeType&&ee,V0=q0&&typeof module=="object"&&module&&!module.nodeType&&module,ak=V0&&V0.exports===q0,G0=ak?pn.Buffer:void 0,lk=G0?G0.isBuffer:void 0,ck=lk||ok;const Wi=ck;var uk="[object Arguments]",hk="[object Array]",fk="[object Boolean]",dk="[object Date]",gk="[object Error]",pk="[object Function]",mk="[object Map]",yk="[object Number]",vk="[object Object]",bk="[object RegExp]",wk="[object Set]",xk="[object String]",Ck="[object WeakMap]",Sk="[object ArrayBuffer]",Pk="[object DataView]",Ek="[object Float32Array]",Ak="[object Float64Array]",Tk="[object Int8Array]",Ok="[object Int16Array]",Mk="[object Int32Array]",_k="[object Uint8Array]",Nk="[object Uint8ClampedArray]",kk="[object Uint16Array]",Ik="[object Uint32Array]",Me={};Me[Ek]=Me[Ak]=Me[Tk]=Me[Ok]=Me[Mk]=Me[_k]=Me[Nk]=Me[kk]=Me[Ik]=!0,Me[uk]=Me[hk]=Me[Sk]=Me[fk]=Me[Pk]=Me[dk]=Me[gk]=Me[pk]=Me[mk]=Me[yk]=Me[vk]=Me[bk]=Me[wk]=Me[xk]=Me[Ck]=!1;function Lk(n){return mn(n)&&Ru(n.length)&&!!Me[Sr(n)]}function uo(n){return function(e){return n(e)}}var H0=typeof ee=="object"&&ee&&!ee.nodeType&&ee,ho=H0&&typeof module=="object"&&module&&!module.nodeType&&module,Rk=ho&&ho.exports===H0,ju=Rk&&E0.process,jk=function(){try{var n=ho&&ho.require&&ho.require("util").types;return n||ju&&ju.binding&&ju.binding("util")}catch(e){}}();const Xi=jk;var U0=Xi&&Xi.isTypedArray,Dk=U0?uo(U0):Lk;const Xa=Dk;var Bk=Object.prototype,$k=Bk.hasOwnProperty;function W0(n,e){var t=bt(n),r=!t&&Ui(n),i=!t&&!r&&Wi(n),s=!t&&!r&&!i&&Xa(n),o=t||r||i||s,a=o?tk(n.length,String):[],l=a.length;for(var c in n)(e||$k.call(n,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Lu(c,l)))&&a.push(c);return a}function X0(n,e){return function(t){return n(e(t))}}var zk=X0(Object.keys,Object);const Fk=zk;var qk=Object.prototype,Vk=qk.hasOwnProperty;function Y0(n){if(!Wa(n))return Fk(n);var e=[];for(var t in Object(n))Vk.call(n,t)&&t!="constructor"&&e.push(t);return e}function fo(n){return fi(n)?W0(n):Y0(n)}function Gk(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var Hk=Object.prototype,Uk=Hk.hasOwnProperty;function Wk(n){if(!Qe(n))return Gk(n);var e=Wa(n),t=[];for(var r in n)r=="constructor"&&(e||!Uk.call(n,r))||t.push(r);return t}function Yi(n){return fi(n)?W0(n,!0):Wk(n)}var Xk=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Yk=/^\w*$/;function Du(n,e){if(bt(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||kn(n)?!0:Yk.test(n)||!Xk.test(n)||e!=null&&n in Object(e)}var Kk=hi(Object,"create");const go=Kk;function Jk(){this.__data__=go?go(null):{},this.size=0}function Qk(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var Zk="__lodash_hash_undefined__",eI=Object.prototype,tI=eI.hasOwnProperty;function nI(n){var e=this.__data__;if(go){var t=e[n];return t===Zk?void 0:t}return tI.call(e,n)?e[n]:void 0}var rI=Object.prototype,iI=rI.hasOwnProperty;function sI(n){var e=this.__data__;return go?e[n]!==void 0:iI.call(e,n)}var oI="__lodash_hash_undefined__";function aI(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=go&&e===void 0?oI:e,this}function di(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])}}di.prototype.clear=Jk,di.prototype.delete=Qk,di.prototype.get=nI,di.prototype.has=sI,di.prototype.set=aI;function lI(){this.__data__=[],this.size=0}function Ya(n,e){for(var t=n.length;t--;)if(Gi(n[t][0],e))return t;return-1}var cI=Array.prototype,uI=cI.splice;function hI(n){var e=this.__data__,t=Ya(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():uI.call(e,t,1),--this.size,!0}function fI(n){var e=this.__data__,t=Ya(e,n);return t<0?void 0:e[t][1]}function dI(n){return Ya(this.__data__,n)>-1}function gI(n,e){var t=this.__data__,r=Ya(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function Wn(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])}}Wn.prototype.clear=lI,Wn.prototype.delete=hI,Wn.prototype.get=fI,Wn.prototype.has=dI,Wn.prototype.set=gI;var pI=hi(pn,"Map");const po=pI;function mI(){this.size=0,this.__data__={hash:new di,map:new(po||Wn),string:new di}}function yI(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Ka(n,e){var t=n.__data__;return yI(e)?t[typeof e=="string"?"string":"hash"]:t.map}function vI(n){var e=Ka(this,n).delete(n);return this.size-=e?1:0,e}function bI(n){return Ka(this,n).get(n)}function wI(n){return Ka(this,n).has(n)}function xI(n,e){var t=Ka(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function Xn(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])}}Xn.prototype.clear=mI,Xn.prototype.delete=vI,Xn.prototype.get=bI,Xn.prototype.has=wI,Xn.prototype.set=xI;var CI="Expected a function";function Bu(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(CI);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(Bu.Cache||Xn),t}Bu.Cache=Xn;var SI=500;function PI(n){var e=Bu(n,function(r){return t.size===SI&&t.clear(),r}),t=e.cache;return e}var EI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,AI=/\\(\\)?/g,TI=PI(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(EI,function(t,r,i,s){e.push(i?s.replace(AI,"$1"):r||t)}),e});const OI=TI;function mo(n){return n==null?"":_0(n)}function K0(n,e){return bt(n)?n:Du(n,e)?[n]:OI(mo(n))}var MI=1/0;function Ja(n){if(typeof n=="string"||kn(n))return n;var e=n+"";return e=="0"&&1/n==-MI?"-0":e}function $u(n,e){e=K0(e,n);for(var t=0,r=e.length;n!=null&&t<r;)n=n[Ja(e[t++])];return t&&t==r?n:void 0}function _I(n,e,t){var r=n==null?void 0:$u(n,e);return r===void 0?t:r}function zu(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}var J0=Jt?Jt.isConcatSpreadable:void 0;function NI(n){return bt(n)||Ui(n)||!!(J0&&n&&n[J0])}function Qa(n,e,t,r,i){var s=-1,o=n.length;for(t||(t=NI),i||(i=[]);++s<o;){var a=n[s];e>0&&t(a)?e>1?Qa(a,e-1,t,r,i):zu(i,a):r||(i[i.length]=a)}return i}var kI=X0(Object.getPrototypeOf,Object);const Fu=kI;var II="[object Object]",LI=Function.prototype,RI=Object.prototype,Q0=LI.toString,jI=RI.hasOwnProperty,DI=Q0.call(Object);function In(n){if(!mn(n)||Sr(n)!=II)return!1;var e=Fu(n);if(e===null)return!0;var t=jI.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Q0.call(t)==DI}function BI(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 $I(n,e,t){var r=n.length;return t=t===void 0?r:t,!e&&t>=r?n:BI(n,e,t)}var zI="\\ud800-\\udfff",FI="\\u0300-\\u036f",qI="\\ufe20-\\ufe2f",VI="\\u20d0-\\u20ff",GI=FI+qI+VI,HI="\\ufe0e\\ufe0f",UI="\\u200d",WI=RegExp("["+UI+zI+GI+HI+"]");function Z0(n){return WI.test(n)}function XI(n){return n.split("")}var eb="\\ud800-\\udfff",YI="\\u0300-\\u036f",KI="\\ufe20-\\ufe2f",JI="\\u20d0-\\u20ff",QI=YI+KI+JI,ZI="\\ufe0e\\ufe0f",eL="["+eb+"]",qu="["+QI+"]",Vu="\\ud83c[\\udffb-\\udfff]",tL="(?:"+qu+"|"+Vu+")",tb="[^"+eb+"]",nb="(?:\\ud83c[\\udde6-\\uddff]){2}",rb="[\\ud800-\\udbff][\\udc00-\\udfff]",nL="\\u200d",ib=tL+"?",sb="["+ZI+"]?",rL="(?:"+nL+"(?:"+[tb,nb,rb].join("|")+")"+sb+ib+")*",iL=sb+ib+rL,sL="(?:"+[tb+qu+"?",qu,nb,rb,eL].join("|")+")",oL=RegExp(Vu+"(?="+Vu+")|"+sL+iL,"g");function aL(n){return n.match(oL)||[]}function lL(n){return Z0(n)?aL(n):XI(n)}function ob(n){return function(e){e=mo(e);var t=Z0(e)?lL(e):void 0,r=t?t[0]:e.charAt(0),i=t?$I(t,1).join(""):e.slice(1);return r[n]()+i}}var cL=ob("toUpperCase");const Za=cL;function uL(n){return Za(mo(n).toLowerCase())}function hL(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 fL(n){return function(e){return n==null?void 0:n[e]}}var dL={À:"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"},gL=fL(dL);const pL=gL;var mL=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yL="\\u0300-\\u036f",vL="\\ufe20-\\ufe2f",bL="\\u20d0-\\u20ff",wL=yL+vL+bL,xL="["+wL+"]",CL=RegExp(xL,"g");function SL(n){return n=mo(n),n&&n.replace(mL,pL).replace(CL,"")}var PL=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function EL(n){return n.match(PL)||[]}var AL=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function TL(n){return AL.test(n)}var ab="\\ud800-\\udfff",OL="\\u0300-\\u036f",ML="\\ufe20-\\ufe2f",_L="\\u20d0-\\u20ff",NL=OL+ML+_L,lb="\\u2700-\\u27bf",cb="a-z\\xdf-\\xf6\\xf8-\\xff",kL="\\xac\\xb1\\xd7\\xf7",IL="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",LL="\\u2000-\\u206f",RL=" \\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",ub="A-Z\\xc0-\\xd6\\xd8-\\xde",jL="\\ufe0e\\ufe0f",hb=kL+IL+LL+RL,fb="['’]",db="["+hb+"]",DL="["+NL+"]",gb="\\d+",BL="["+lb+"]",pb="["+cb+"]",mb="[^"+ab+hb+gb+lb+cb+ub+"]",$L="\\ud83c[\\udffb-\\udfff]",zL="(?:"+DL+"|"+$L+")",FL="[^"+ab+"]",yb="(?:\\ud83c[\\udde6-\\uddff]){2}",vb="[\\ud800-\\udbff][\\udc00-\\udfff]",Ki="["+ub+"]",qL="\\u200d",bb="(?:"+pb+"|"+mb+")",VL="(?:"+Ki+"|"+mb+")",wb="(?:"+fb+"(?:d|ll|m|re|s|t|ve))?",xb="(?:"+fb+"(?:D|LL|M|RE|S|T|VE))?",Cb=zL+"?",Sb="["+jL+"]?",GL="(?:"+qL+"(?:"+[FL,yb,vb].join("|")+")"+Sb+Cb+")*",HL="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",UL="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",WL=Sb+Cb+GL,XL="(?:"+[BL,yb,vb].join("|")+")"+WL,YL=RegExp([Ki+"?"+pb+"+"+wb+"(?="+[db,Ki,"$"].join("|")+")",VL+"+"+xb+"(?="+[db,Ki+bb,"$"].join("|")+")",Ki+"?"+bb+"+"+wb,Ki+"+"+xb,UL,HL,gb,XL].join("|"),"g");function KL(n){return n.match(YL)||[]}function JL(n,e,t){return n=mo(n),e=t?void 0:e,e===void 0?TL(n)?KL(n):EL(n):n.match(e)||[]}var QL="['’]",ZL=RegExp(QL,"g");function Pb(n){return function(e){return hL(JL(SL(e).replace(ZL,"")),n,"")}}var eR=Pb(function(n,e,t){return e=e.toLowerCase(),n+(t?uL(e):e)});const el=eR;function tR(n,e,t){return n===n&&(t!==void 0&&(n=n<=t?n:t),e!==void 0&&(n=n>=e?n:e)),n}function Qt(n,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=lo(t),t=t===t?t:0),e!==void 0&&(e=lo(e),e=e===e?e:0),tR(lo(n),e,t)}function nR(){this.__data__=new Wn,this.size=0}function rR(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function iR(n){return this.__data__.get(n)}function sR(n){return this.__data__.has(n)}var oR=200;function aR(n,e){var t=this.__data__;if(t instanceof Wn){var r=t.__data__;if(!po||r.length<oR-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new Xn(r)}return t.set(n,e),this.size=t.size,this}function yn(n){var e=this.__data__=new Wn(n);this.size=e.size}yn.prototype.clear=nR,yn.prototype.delete=rR,yn.prototype.get=iR,yn.prototype.has=sR,yn.prototype.set=aR;function lR(n,e){return n&&co(e,fo(e),n)}function cR(n,e){return n&&co(e,Yi(e),n)}var Eb=typeof ee=="object"&&ee&&!ee.nodeType&&ee,Ab=Eb&&typeof module=="object"&&module&&!module.nodeType&&module,uR=Ab&&Ab.exports===Eb,Tb=uR?pn.Buffer:void 0,Ob=Tb?Tb.allocUnsafe:void 0;function Mb(n,e){if(e)return n.slice();var t=n.length,r=Ob?Ob(t):new n.constructor(t);return n.copy(r),r}function hR(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 _b(){return[]}var fR=Object.prototype,dR=fR.propertyIsEnumerable,Nb=Object.getOwnPropertySymbols,gR=Nb?function(n){return n==null?[]:(n=Object(n),hR(Nb(n),function(e){return dR.call(n,e)}))}:_b;const Gu=gR;function pR(n,e){return co(n,Gu(n),e)}var mR=Object.getOwnPropertySymbols,yR=mR?function(n){for(var e=[];n;)zu(e,Gu(n)),n=Fu(n);return e}:_b;const kb=yR;function vR(n,e){return co(n,kb(n),e)}function Ib(n,e,t){var r=e(n);return bt(n)?r:zu(r,t(n))}function Hu(n){return Ib(n,fo,Gu)}function bR(n){return Ib(n,Yi,kb)}var wR=hi(pn,"DataView");const Uu=wR;var xR=hi(pn,"Promise");const Wu=xR;var CR=hi(pn,"Set");const Ji=CR;var Lb="[object Map]",SR="[object Object]",Rb="[object Promise]",jb="[object Set]",Db="[object WeakMap]",Bb="[object DataView]",PR=ui(Uu),ER=ui(po),AR=ui(Wu),TR=ui(Ji),OR=ui(Iu),gi=Sr;(Uu&&gi(new Uu(new ArrayBuffer(1)))!=Bb||po&&gi(new po)!=Lb||Wu&&gi(Wu.resolve())!=Rb||Ji&&gi(new Ji)!=jb||Iu&&gi(new Iu)!=Db)&&(gi=function(n){var e=Sr(n),t=e==SR?n.constructor:void 0,r=t?ui(t):"";if(r)switch(r){case PR:return Bb;case ER:return Lb;case AR:return Rb;case TR:return jb;case OR:return Db}return e});const Qi=gi;var MR=Object.prototype,_R=MR.hasOwnProperty;function NR(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&_R.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var kR=pn.Uint8Array;const tl=kR;function Xu(n){var e=new n.constructor(n.byteLength);return new tl(e).set(new tl(n)),e}function IR(n,e){var t=e?Xu(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var LR=/\w*$/;function RR(n){var e=new n.constructor(n.source,LR.exec(n));return e.lastIndex=n.lastIndex,e}var $b=Jt?Jt.prototype:void 0,zb=$b?$b.valueOf:void 0;function jR(n){return zb?Object(zb.call(n)):{}}function Fb(n,e){var t=e?Xu(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var DR="[object Boolean]",BR="[object Date]",$R="[object Map]",zR="[object Number]",FR="[object RegExp]",qR="[object Set]",VR="[object String]",GR="[object Symbol]",HR="[object ArrayBuffer]",UR="[object DataView]",WR="[object Float32Array]",XR="[object Float64Array]",YR="[object Int8Array]",KR="[object Int16Array]",JR="[object Int32Array]",QR="[object Uint8Array]",ZR="[object Uint8ClampedArray]",ej="[object Uint16Array]",tj="[object Uint32Array]";function nj(n,e,t){var r=n.constructor;switch(e){case HR:return Xu(n);case DR:case BR:return new r(+n);case UR:return IR(n,t);case WR:case XR:case YR:case KR:case JR:case QR:case ZR:case ej:case tj:return Fb(n,t);case $R:return new r;case zR:case VR:return new r(n);case FR:return RR(n);case qR:return new r;case GR:return jR(n)}}function qb(n){return typeof n.constructor=="function"&&!Wa(n)?kN(Fu(n)):{}}var rj="[object Map]";function ij(n){return mn(n)&&Qi(n)==rj}var Vb=Xi&&Xi.isMap,sj=Vb?uo(Vb):ij;const oj=sj;var aj="[object Set]";function lj(n){return mn(n)&&Qi(n)==aj}var Gb=Xi&&Xi.isSet,cj=Gb?uo(Gb):lj;const uj=cj;var hj=1,fj=2,dj=4,Hb="[object Arguments]",gj="[object Array]",pj="[object Boolean]",mj="[object Date]",yj="[object Error]",Ub="[object Function]",vj="[object GeneratorFunction]",bj="[object Map]",wj="[object Number]",Wb="[object Object]",xj="[object RegExp]",Cj="[object Set]",Sj="[object String]",Pj="[object Symbol]",Ej="[object WeakMap]",Aj="[object ArrayBuffer]",Tj="[object DataView]",Oj="[object Float32Array]",Mj="[object Float64Array]",_j="[object Int8Array]",Nj="[object Int16Array]",kj="[object Int32Array]",Ij="[object Uint8Array]",Lj="[object Uint8ClampedArray]",Rj="[object Uint16Array]",jj="[object Uint32Array]",Ee={};Ee[Hb]=Ee[gj]=Ee[Aj]=Ee[Tj]=Ee[pj]=Ee[mj]=Ee[Oj]=Ee[Mj]=Ee[_j]=Ee[Nj]=Ee[kj]=Ee[bj]=Ee[wj]=Ee[Wb]=Ee[xj]=Ee[Cj]=Ee[Sj]=Ee[Pj]=Ee[Ij]=Ee[Lj]=Ee[Rj]=Ee[jj]=!0,Ee[yj]=Ee[Ub]=Ee[Ej]=!1;function yo(n,e,t,r,i,s){var o,a=e&hj,l=e&fj,c=e&dj;if(t&&(o=i?t(n,r,i,s):t(n)),o!==void 0)return o;if(!Qe(n))return n;var u=bt(n);if(u){if(o=NR(n),!a)return R0(n,o)}else{var h=Qi(n),f=h==Ub||h==vj;if(Wi(n))return Mb(n,a);if(h==Wb||h==Hb||f&&!i){if(o=l||f?{}:qb(n),!a)return l?vR(n,cR(o,n)):pR(n,lR(o,n))}else{if(!Ee[h])return i?n:{};o=nj(n,h,a)}}s||(s=new yn);var d=s.get(n);if(d)return d;s.set(n,o),uj(n)?n.forEach(function(b){o.add(yo(b,e,t,b,n,s))}):oj(n)&&n.forEach(function(b,m){o.set(m,yo(b,e,t,m,n,s))});var g=c?l?bR:Hu:l?Yi:fo,p=u?void 0:g(n);return VN(p||n,function(b,m){p&&(m=b,b=n[m]),D0(o,m,yo(b,e,t,m,n,s))}),o}var Dj=4;function Yu(n){return yo(n,Dj)}var Bj=1,$j=4;function Fe(n){return yo(n,Bj|$j)}var zj="__lodash_hash_undefined__";function Fj(n){return this.__data__.set(n,zj),this}function qj(n){return this.__data__.has(n)}function Zi(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Xn;++e<t;)this.add(n[e])}Zi.prototype.add=Zi.prototype.push=Fj,Zi.prototype.has=qj;function Vj(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 Ku(n,e){return n.has(e)}var Gj=1,Hj=2;function Xb(n,e,t,r,i,s){var o=t&Gj,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&Hj?new Zi: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(!Vj(e,function(m,y){if(!Ku(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 Uj(n){var e=-1,t=Array(n.size);return n.forEach(function(r,i){t[++e]=[i,r]}),t}function Ju(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var Wj=1,Xj=2,Yj="[object Boolean]",Kj="[object Date]",Jj="[object Error]",Qj="[object Map]",Zj="[object Number]",eD="[object RegExp]",tD="[object Set]",nD="[object String]",rD="[object Symbol]",iD="[object ArrayBuffer]",sD="[object DataView]",Yb=Jt?Jt.prototype:void 0,Qu=Yb?Yb.valueOf:void 0;function oD(n,e,t,r,i,s,o){switch(t){case sD:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case iD:return!(n.byteLength!=e.byteLength||!s(new tl(n),new tl(e)));case Yj:case Kj:case Zj:return Gi(+n,+e);case Jj:return n.name==e.name&&n.message==e.message;case eD:case nD:return n==e+"";case Qj:var a=Uj;case tD:var l=r&Wj;if(a||(a=Ju),n.size!=e.size&&!l)return!1;var c=o.get(n);if(c)return c==e;r|=Xj,o.set(n,e);var u=Xb(a(n),a(e),r,i,s,o);return o.delete(n),u;case rD:if(Qu)return Qu.call(n)==Qu.call(e)}return!1}var aD=1,lD=Object.prototype,cD=lD.hasOwnProperty;function uD(n,e,t,r,i,s){var o=t&aD,a=Hu(n),l=a.length,c=Hu(e),u=c.length;if(l!=u&&!o)return!1;for(var h=l;h--;){var f=a[h];if(!(o?f in e:cD.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 hD=1,Kb="[object Arguments]",Jb="[object Array]",nl="[object Object]",fD=Object.prototype,Qb=fD.hasOwnProperty;function dD(n,e,t,r,i,s){var o=bt(n),a=bt(e),l=o?Jb:Qi(n),c=a?Jb:Qi(e);l=l==Kb?nl:l,c=c==Kb?nl:c;var u=l==nl,h=c==nl,f=l==c;if(f&&Wi(n)){if(!Wi(e))return!1;o=!0,u=!1}if(f&&!u)return s||(s=new yn),o||Xa(n)?Xb(n,e,t,r,i,s):oD(n,e,l,t,r,i,s);if(!(t&hD)){var d=u&&Qb.call(n,"__wrapped__"),g=h&&Qb.call(e,"__wrapped__");if(d||g){var p=d?n.value():n,b=g?e.value():e;return s||(s=new yn),i(p,b,t,r,s)}}return f?(s||(s=new yn),uD(n,e,t,r,i,s)):!1}function rl(n,e,t,r,i){return n===e?!0:n==null||e==null||!mn(n)&&!mn(e)?n!==n&&e!==e:dD(n,e,t,r,rl,i)}var gD=1,pD=2;function mD(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 yn;if(r)var f=r(c,u,l,n,e,h);if(!(f===void 0?rl(u,c,gD|pD,r,h):f))return!1}}return!0}function Zb(n){return n===n&&!Qe(n)}function yD(n){for(var e=fo(n),t=e.length;t--;){var r=e[t],i=n[r];e[t]=[r,i,Zb(i)]}return e}function e1(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function vD(n){var e=yD(n);return e.length==1&&e[0][2]?e1(e[0][0],e[0][1]):function(t){return t===n||mD(t,n,e)}}function bD(n,e){return n!=null&&e in Object(n)}function t1(n,e,t){e=K0(e,n);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Ja(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&&Ru(i)&&Lu(o,i)&&(bt(n)||Ui(n)))}function wD(n,e){return n!=null&&t1(n,e,bD)}var xD=1,CD=2;function SD(n,e){return Du(n)&&Zb(e)?e1(Ja(n),e):function(t){var r=_I(t,n);return r===void 0&&r===e?wD(t,n):rl(e,r,xD|CD)}}function PD(n){return function(e){return e==null?void 0:e[n]}}function ED(n){return function(e){return $u(e,n)}}function AD(n){return Du(n)?PD(Ja(n)):ED(n)}function Zu(n){return typeof n=="function"?n:n==null?Vi:typeof n=="object"?bt(n)?SD(n[0],n[1]):vD(n):AD(n)}function TD(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 OD(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 MD=OD();const n1=MD;function _D(n,e){return n&&n1(n,e,fo)}function ND(n,e){return function(t,r){if(t==null)return t;if(!fi(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 kD=ND(_D);const r1=kD;function ID(n,e,t,r){return r1(n,function(i,s,o){e(r,i,t(i),o)}),r}function LD(n,e){return function(t,r){var i=bt(t)?TD:ID,s=e?e():{};return i(t,n,Zu(r),s)}}var RD=function(){return pn.Date.now()};const eh=RD;var jD="Expected a function",DD=Math.max,BD=Math.min;function th(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(jD);e=lo(e)||0,Qe(t)&&(u=!!t.leading,h="maxWait"in t,s=h?DD(lo(t.maxWait)||0,e):s,f="trailing"in t?!!t.trailing:f);function d(C){var P=r,E=i;return r=i=void 0,c=C,o=n.apply(E,P),o}function g(C){return c=C,a=setTimeout(m,e),u?d(C):o}function p(C){var P=C-l,E=C-c,A=e-P;return h?BD(A,s-E):A}function b(C){var P=C-l,E=C-c;return l===void 0||P>=e||P<0||h&&E>=s}function m(){var C=eh();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(eh())}function x(){var C=eh(),P=b(C);if(r=arguments,i=this,l=C,P){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 i1=Object.prototype,$D=i1.hasOwnProperty,zD=Hi(function(n,e){n=Object(n);var t=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&Ua(e[0],e[1],i)&&(r=1);++t<r;)for(var s=e[t],o=Yi(s),a=-1,l=o.length;++a<l;){var c=o[a],u=n[c];(u===void 0||Gi(u,i1[c])&&!$D.call(n,c))&&(n[c]=s[c])}return n});const FD=zD;function nh(n,e,t){(t!==void 0&&!Gi(n[e],t)||t===void 0&&!(e in n))&&Ha(n,e,t)}function il(n){return mn(n)&&fi(n)}function rh(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function qD(n){return co(n,Yi(n))}function VD(n,e,t,r,i,s,o){var a=rh(n,t),l=rh(e,t),c=o.get(l);if(c){nh(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&&Wi(l),g=!f&&!d&&Xa(l);u=l,f||d||g?bt(a)?u=a:il(a)?u=R0(a):d?(h=!1,u=Mb(l,!0)):g?(h=!1,u=Fb(l,!0)):u=[]:In(l)||Ui(l)?(u=a,Ui(a)?u=qD(a):(!Qe(a)||Nu(a))&&(u=qb(l))):h=!1}h&&(o.set(l,u),i(u,l,r,s,o),o.delete(l)),nh(n,t,u)}function sl(n,e,t,r,i){n!==e&&n1(e,function(s,o){if(i||(i=new yn),Qe(s))VD(n,e,o,t,sl,r,i);else{var a=r?r(rh(n,o),s,o+"",n,e,i):void 0;a===void 0&&(a=s),nh(n,o,a)}},Yi)}function s1(n,e,t,r,i,s){return Qe(n)&&Qe(e)&&(s.set(e,n),sl(n,e,void 0,s1,s),s.delete(e)),n}var GD=$0(function(n,e,t,r){sl(n,e,t,r)});const HD=GD;var UD=Hi(function(n){return n.push(void 0,s1),L0(HD,void 0,n)});const o1=UD;function a1(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 WD=200;function XD(n,e,t,r){var i=-1,s=j0,o=!0,a=n.length,l=[],c=e.length;if(!a)return l;t&&(e=ao(e,uo(t))),r?(s=a1,o=!1):e.length>=WD&&(s=Ku,o=!1,e=new Zi(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 YD=Hi(function(n,e){return il(n)?XD(n,Qa(e,1,il,!0)):[]});const KD=YD;function JD(n,e){var t=-1,r=fi(n)?Array(n.length):[];return r1(n,function(i,s,o){r[++t]=e(i,s,o)}),r}var QD=Object.prototype,ZD=QD.hasOwnProperty,eB=LD(function(n,e,t){ZD.call(n,t)?n[t].push(e):Ha(n,t,[e])});const l1=eB;function tB(n,e){return n>e}var nB=Object.prototype,rB=nB.hasOwnProperty;function iB(n,e){return n!=null&&rB.call(n,e)}function ol(n,e){return n!=null&&t1(n,e,iB)}var sB="[object Map]",oB="[object Set]",aB=Object.prototype,lB=aB.hasOwnProperty;function c1(n){if(n==null)return!0;if(fi(n)&&(bt(n)||typeof n=="string"||typeof n.splice=="function"||Wi(n)||Xa(n)||Ui(n)))return!n.length;var e=Qi(n);if(e==sB||e==oB)return!n.size;if(Wa(n))return!Y0(n).length;for(var t in n)if(lB.call(n,t))return!1;return!0}function Yn(n,e){return rl(n,e)}var cB="[object Number]";function u1(n){return typeof n=="number"||mn(n)&&Sr(n)==cB}var uB=ob("toLowerCase");const hB=uB;function fB(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&&!kn(o):t(o,a)))var a=o,l=s}return l}function dB(n){return n&&n.length?fB(n,Vi,tB):void 0}var gB=$0(function(n,e,t){sl(n,e,t)});const Re=gB;function pB(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}function mB(n,e){if(n!==e){var t=n!==void 0,r=n===null,i=n===n,s=kn(n),o=e!==void 0,a=e===null,l=e===e,c=kn(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 yB(n,e,t){for(var r=-1,i=n.criteria,s=e.criteria,o=i.length,a=t.length;++r<o;){var l=mB(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 vB(n,e,t){e.length?e=ao(e,function(s){return bt(s)?function(o){return $u(o,s.length===1?s[0]:s)}:s}):e=[Vi];var r=-1;e=ao(e,uo(Zu));var i=JD(n,function(s,o,a){var l=ao(e,function(c){return c(s)});return{criteria:l,index:++r,value:s}});return pB(i,function(s,o){return yB(s,o,t)})}var bB=Hi(function(n,e){if(n==null)return[];var t=e.length;return t>1&&Ua(n,e[0],e[1])?e=[]:t>2&&Ua(e[0],e[1],e[2])&&(e=[e[0]]),vB(n,Qa(e,1),[])});const h1=bB;var wB=4294967295,xB=wB-1,CB=Math.floor,SB=Math.min;function f1(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=kn(e),c=e===void 0;i<s;){var u=CB((i+s)/2),h=t(n[u]),f=h!==void 0,d=h===null,g=h===h,p=kn(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 SB(s,xB)}var PB=4294967295,EB=PB>>>1;function AB(n,e,t){var r=0,i=n==null?r:n.length;if(typeof e=="number"&&e===e&&i<=EB){for(;r<i;){var s=r+i>>>1,o=n[s];o!==null&&!kn(o)&&(t?o<=e:o<e)?r=s+1:i=s}return i}return f1(n,e,Vi,t)}function TB(n,e){return AB(n,e)}function OB(n,e,t){return f1(n,e,Zu(t))}var MB=Pb(function(n,e,t){return n+(t?" ":"")+Za(e)});const _B=MB;var NB="Expected a function";function kB(n,e,t){var r=!0,i=!0;if(typeof n!="function")throw new TypeError(NB);return Qe(t)&&(r="leading"in t?!!t.leading:r,i="trailing"in t?!!t.trailing:i),th(n,e,{leading:r,maxWait:e,trailing:i})}var IB=1/0,LB=Ji&&1/Ju(new Ji([,-0]))[1]==IB?function(n){return new Ji(n)}:IN;const RB=LB;var jB=200;function d1(n,e,t){var r=-1,i=j0,s=n.length,o=!0,a=[],l=a;if(t)o=!1,i=a1;else if(s>=jB){var c=e?null:RB(n);if(c)return Ju(c);o=!1,i=Ku,l=new Zi}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 DB=Hi(function(n){return d1(Qa(n,1,il,!0))});const g1=DB;function p1(n){return n&&n.length?d1(n):[]}function m1(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 Q(n,e,...t){return m1(n,e,t)}function BB(n){return typeof n=="object"&&n.then&&typeof n.then=="function"}function y1(n){return n!=null&&(n instanceof Promise||BB(n))}function v1(...n){const e=[];if(n.forEach(r=>{Array.isArray(r)?e.push(...r):e.push(r)}),e.some(r=>y1(r))){const r=e.map(i=>y1(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 ih(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=m1(i,s,o);t.push(a)}return v1(t)}class $B{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),ih([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=ih([...s],t))}const i=this.listeners["*"];return i!=null?v1([r,ih([...i],[e,...t])]):r}emit(e,...t){return this.trigger(e,...t)}}function zB(n,...e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(r=>{r!=="constructor"&&Object.defineProperty(n.prototype,r,Object.getOwnPropertyDescriptor(t.prototype,r))})})}const FB=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 qB(n,e){FB(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}let VB=class{};const GB=/^\s*class\s+/.test(`${VB}`)||/^\s*class\s*\{/.test(`${class{}}`);function sh(n,e){let t;return GB?t=class extends e{}:(t=function(){return e.apply(this,arguments)},qB(t,e)),Object.defineProperty(t,"name",{value:n}),t}function b1(n){return n==="__proto__"}function oh(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 es(n,e,t,r="/"){const i=Array.isArray(e)?e:e.split(r),s=i.pop();if(s&&!b1(s)){let o=n;i.forEach(a=>{b1(a)||(o[a]==null&&(o[a]={}),o=o[a])}),o[s]=t}return n}function w1(n,e,t="/"){const r=Array.isArray(e)?e.slice():e.split(t),i=r.pop();if(i)if(r.length>0){const s=oh(n,r);s&&delete s[i]}else delete n[i];return n}class wt extends $B{}(function(n){n.dispose=Nn.dispose})(wt||(wt={})),zB(wt,Nn);const x1=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},C1=x1(n=>n.replace(/\B([A-Z])/g,"-$1").toLowerCase()),ah=x1(n=>_B(el(n)).replace(/ /g,""));function lh(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 ch(){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 HB(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=UB(a,u,i-1);if(h===void 0)continue;h<3?(o=!0,s=l):(i=h,s=l)}}return s}function UB(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 Kn(n){return typeof n=="string"&&n.slice(-1)==="%"}function Ft(n,e){if(n==null)return 0;let t;if(typeof n=="string"){if(t=parseFloat(n),Kn(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 Ln(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 uh=!1,S1=!1,P1=!1,E1=!1,A1=!1,T1=!1,O1=!1,M1=!1,_1=!1,N1=!1,k1=!1,I1=!1,L1=!1,R1=!1,j1=!1,D1=!1;if(typeof navigator=="object"){const n=navigator.userAgent;uh=n.indexOf("Macintosh")>=0,S1=!!n.match(/(iPad|iPhone|iPod)/g),P1=n.indexOf("Windows")>=0,E1=n.indexOf("MSIE")>=0,A1=!!n.match(/Trident\/7\./),T1=!!n.match(/Edge\//),O1=n.indexOf("Mozilla/")>=0&&n.indexOf("MSIE")<0&&n.indexOf("Edge/")<0,_1=n.indexOf("Chrome/")>=0&&n.indexOf("Edge/")<0,N1=n.indexOf("Opera/")>=0||n.indexOf("OPR/")>=0,k1=n.indexOf("Firefox/")>=0,I1=n.indexOf("AppleWebKit/")>=0&&n.indexOf("Chrome/")<0&&n.indexOf("Edge/")<0,typeof document=="object"&&(D1=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||n.indexOf("Opera/")>=0)}if(typeof window=="object"&&(M1=window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,R1=window.PointerEvent!=null&&!uh),typeof document=="object"){L1="ontouchstart"in document.documentElement;try{const n=Object.defineProperty({},"passive",{get(){j1=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},n)}catch(n){}}var Zt;(function(n){n.IS_MAC=uh,n.IS_IOS=S1,n.IS_WINDOWS=P1,n.IS_IE=E1,n.IS_IE11=A1,n.IS_EDGE=T1,n.IS_NETSCAPE=O1,n.IS_CHROME_APP=M1,n.IS_CHROME=_1,n.IS_OPERA=N1,n.IS_FIREFOX=k1,n.IS_SAFARI=I1,n.SUPPORT_TOUCH=L1,n.SUPPORT_POINTER=R1,n.SUPPORT_PASSIVE=j1,n.NO_FOREIGNOBJECT=D1,n.SUPPORT_FOREIGNOBJECT=!n.NO_FOREIGNOBJECT})(Zt||(Zt={})),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}(Zt||(Zt={}));const hh=/[\t\r\n\f]/g,fh=/\S+/g,ts=n=>` ${n} `;function ns(n){return n&&n.getAttribute&&n.getAttribute("class")||""}function rs(n,e){if(n==null||e==null)return!1;const t=ts(ns(n)),r=ts(e);return n.nodeType===1?t.replace(hh," ").includes(r):!1}function Z(n,e){if(!(n==null||e==null)){if(typeof e=="function")return Z(n,e(ns(n)));if(typeof e=="string"&&n.nodeType===1){const t=e.match(fh)||[],r=ts(ns(n)).replace(hh," ");let i=t.reduce((s,o)=>s.indexOf(ts(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(ns(n)));if((!e||typeof e=="string")&&n.nodeType===1){const t=(e||"").match(fh)||[],r=ts(ns(n)).replace(hh," ");let i=t.reduce((s,o)=>{const a=ts(o);return s.indexOf(a)>-1?s.replace(a," "):s},r);i=e?i.trim():"",r!==i&&n.setAttribute("class",i)}}}function B1(n,e,t){if(!(n==null||e==null)){if(t!=null&&typeof e=="string"){t?Z(n,e):gt(n,e);return}if(typeof e=="function")return B1(n,e(ns(n),t),t);typeof e=="string"&&(e.match(fh)||[]).forEach(i=>{rs(n,i)?gt(n,i):Z(n,i)})}}let $1=0;function WB(){return $1+=1,`v${$1}`}function dh(n){return(n.id==null||n.id==="")&&(n.id=WB()),n.id}function Pr(n){return n==null?!1:typeof n.getScreenCTM=="function"&&n instanceof SVGElement}const at={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"},z1="1.1";function F1(n,e=document){return e.createElement(n)}function gh(n,e=at.xhtml,t=document){return t.createElementNS(e,n)}function Jn(n,e=document){return gh(n,at.svg,e)}function al(n){if(n){const t=`<svg xmlns="${at.svg}" xmlns:xlink="${at.xlink}" version="${z1}">${n}</svg>`,{documentElement:r}=XB(t,{async:!1});return r}const e=document.createElementNS(at.svg,"svg");return e.setAttributeNS(at.xmlns,"xmlns:xlink",at.xlink),e.setAttribute("version",z1),e}function XB(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 YB(n,e=!0){const t=n.nodeName;return e?t.toLowerCase():t.toUpperCase()}function ph(n){let e=0,t=n.previousSibling;for(;t;)t.nodeType===1&&(e+=1),t=t.previousSibling;return e}function KB(n,e){return n.querySelectorAll(e)}function JB(n,e){return n.querySelector(e)}function q1(n,e,t){const r=n.ownerSVGElement;let i=n.parentNode;for(;i&&i!==t&&i!==r;){if(rs(i,e))return i;i=i.parentNode}return null}function V1(n,e){const t=e&&e.parentNode;return n===t||!!(t&&t.nodeType===1&&n.compareDocumentPosition(t)&16)}function Qn(n){n&&(Array.isArray(n)?n:[n]).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}function vo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Rn(n,e){(Array.isArray(e)?e:[e]).forEach(r=>{r!=null&&n.appendChild(r)})}function G1(n,e){const t=n.firstChild;return t?bo(t,e):Rn(n,e)}function bo(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(i=>{i!=null&&t.insertBefore(i,n)})}function QB(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(i=>{i!=null&&t.insertBefore(i,n.nextSibling)})}function Er(n,e){e!=null&&e.appendChild(n)}function ZB(n){return!!n&&n.nodeType===1}function H1(n){try{return n instanceof HTMLElement}catch(e){return typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"}}function e$(n,e){const t=[];let r=n.firstChild;for(;r;r=r.nextSibling)r.nodeType===1&&(!e||rs(r,e))&&t.push(r);return t}const U1=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust"];function t$(n,e){return n.getAttribute(e)}function mh(n,e){const t=X1(e);t.ns?n.hasAttributeNS(t.ns,t.local)&&n.removeAttributeNS(t.ns,t.local):n.hasAttribute(e)&&n.removeAttribute(e)}function yh(n,e,t){if(t==null)return mh(n,e);const r=X1(e);r.ns&&typeof t=="string"?n.setAttributeNS(r.ns,e,t):e==="id"?n.id=`${t}`:n.setAttribute(e,`${t}`)}function W1(n,e){Object.keys(e).forEach(t=>{yh(n,t,e[t])})}function ge(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"?W1(n,e):yh(n,e,t)}function X1(n){if(n.indexOf(":")!==-1){const e=n.split(":");return{ns:at[e[0]],local:e[1]}}return{ns:null,local:n}}function wo(n){const e={};return Object.keys(n).forEach(t=>{const r=U1.includes(t)?t:C1(t);e[r]=n[t]}),e}function ll(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 vh(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=ll(e[t])):i?(s=ll(n[t]),o=e[t]):(s=ll(n[t]),o=ll(e[t])),n[t]=vh(s,o)}else n[t]=e[t]}),n}function n$(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=vh(vh({},o.attrs),f.attrs),t.includeAnnotationIndices&&(o.annotations==null&&(o.annotations=[]),o.annotations.push(u)))}a=s[c-1],a?Qe(o)&&Qe(a)?(l=l,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?l.t+=o.t:(i.push(l),l=o)):Qe(o)||Qe(a)?(l=l,i.push(l),l=o):l=(l||"")+o:l=o}return l!=null&&i.push(l),i}function r$(n){return n.replace(/ /g," ")}var Y1;(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})(Y1||(Y1={}));let pi;const i$={px(n){return n},mm(n){return pi*n},cm(n){return pi*n*10},in(n){return pi*n*25.4},pt(n){return pi*(25.4*n/72)},pc(n){return pi*(25.4*n/6)}};var K1;(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){pi==null&&(pi=e("1","1","mm").width);const s=i?i$[i]:null;return s?s(r):r}n.toPx=t})(K1||(K1={}));const s$=/-(.)/g;function o$(n){return n.replace(s$,(e,t)=>t.toUpperCase())}const bh={},J1=["webkit","ms","moz","o"],Q1=document?document.createElement("div").style:{};function a$(n){for(let e=0;e<J1.length;e+=1){const t=J1[e]+n;if(t in Q1)return t}return null}function l$(n){const e=o$(n);if(bh[e]==null){const t=e.charAt(0).toUpperCase()+e.slice(1);bh[e]=e in Q1?e:a$(t)}return bh[e]}function Z1(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 c$={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 u$(n){return/^--/.test(n)}function cl(n,e,t){const r=window.getComputedStyle(n,null);return t?r.getPropertyValue(e)||void 0:r[e]||n.style[e]}function ul(n,e){return parseInt(cl(n,e),10)||0}function h$(n,e){return!c$[n]&&typeof e=="number"?`${e}px`:e}function ve(n,e,t){if(typeof e=="string"){const r=u$(e);if(r||(e=l$(e)),t===void 0)return cl(n,e,r);r||(t=h$(e,t));const i=n.style;r?i.setProperty(e,t):i[e]=t;return}for(const r in e)ve(n,r,e[r])}const hl=new WeakMap;function ew(n,e){const t=el(e),r=hl.get(n);if(r)return r[t]}function f$(n,e,t){const r=el(e),i=hl.get(n);i?i[r]=t:hl.set(n,{[r]:t})}function mi(n,e,t){if(!e){const r={};return Object.keys(hl).forEach(i=>{r[i]=ew(n,i)}),r}if(typeof e=="string"){if(t===void 0)return ew(n,e);f$(n,e,t);return}for(const r in e)mi(n,r,e[r])}const d$={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};function wh(n,e,t){if(e){if(typeof e=="string"){if(e=d$[e]||e,arguments.length<3)return n[e];n[e]=t;return}for(const r in e)wh(n,r,e[r])}}class te{get[Symbol.toStringTag](){return te.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(te.isVector(e))i=e.node;else if(typeof e=="string")if(e.toLowerCase()==="svg")i=al();else if(e[0]==="<"){const s=al(e);i=document.importNode(s.firstChild,!0)}else i=document.createElementNS(at.svg,e);else i=e;this.node=i,t&&this.setAttributes(t),r&&this.append(r)}transform(e,t){return e==null?os(this.node):(os(this.node,e,t),this)}translate(e,t=0,r={}){return e==null?cw(this.node):(cw(this.node,e,t,r),this)}rotate(e,t,r,i={}){return e==null?Sh(this.node):(Sh(this.node,e,t,r,i),this)}scale(e,t){return e==null?Ph(this.node):(Ph(this.node,e,t),this)}getTransformToElement(e){const t=te.toNode(e);return So(this.node,t)}removeAttribute(e){return mh(this.node,e),this}getAttribute(e){return t$(this.node,e)}setAttribute(e,t){return yh(this.node,e,t),this}setAttributes(e){return W1(this.node,e),this}attr(e,t){return e==null?ge(this.node):typeof e=="string"&&t===void 0?ge(this.node,e):(typeof e=="object"?ge(this.node,e):ge(this.node,e,t),this)}svg(){return this.node instanceof SVGSVGElement?this:te.create(this.node.ownerSVGElement)}defs(){const e=this.svg()||this,t=e.node.getElementsByTagName("defs")[0];return t?te.create(t):te.create("defs").appendTo(e)}text(e,t={}){return rw(this.node,e,t),this}tagName(){return YB(this.node)}clone(){return te.create(this.node.cloneNode(!0))}remove(){return Qn(this.node),this}empty(){return vo(this.node),this}append(e){return Rn(this.node,te.toNodes(e)),this}appendTo(e){return Er(this.node,te.isVector(e)?e.node:e),this}prepend(e){return G1(this.node,te.toNodes(e)),this}before(e){return bo(this.node,te.toNodes(e)),this}replace(e){return this.node.parentNode&&this.node.parentNode.replaceChild(te.toNode(e),this.node),te.create(e)}first(){return this.node.firstChild?te.create(this.node.firstChild):null}last(){return this.node.lastChild?te.create(this.node.lastChild):null}get(e){const t=this.node.childNodes[e];return t?te.create(t):null}indexOf(e){return Array.prototype.slice.call(this.node.childNodes).indexOf(te.toNode(e))}find(e){const t=[],r=KB(this.node,e);if(r)for(let i=0,s=r.length;i<s;i+=1)t.push(te.create(r[i]));return t}findOne(e){const t=JB(this.node,e);return t?te.create(t):null}findParentByClass(e,t){const r=q1(this.node,e,t);return r?te.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 V1(this.node,te.isVector(e)?e.node:e)}wrap(e){const t=te.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=te.create(t.node.parentNode),e==null)return t;do if(typeof e=="string"?t.matches(e):t instanceof e)return t;while(t=te.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(te.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 ph(this.node)}hasClass(e){return rs(this.node,e)}addClass(e){return Z(this.node,e),this}removeClass(e){return gt(this.node,e),this}toggleClass(e,t){return B1(this.node,e,t),this}toLocalPoint(e,t){return L$(this.node,e,t)}sample(e=1){return this.node instanceof SVGPathElement?v$(this.node,e):[]}toPath(){return te.create(E$(this.node))}toPathData(){return aw(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=al(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})(te||(te={}));const tw=document.createElement("canvas").getContext("2d");function g$(n,e){const t=te.create(e),r=te.create("textPath"),i=n.d;if(i&&n["xlink:href"]===void 0){const s=te.create("path").attr("d",i).appendTo(t.defs());r.attr("xlink:href",`#${s.id}`)}return typeof n=="object"&&r.attr(n),r.node}function p$(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=te.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 nw=/em$/;function fl(n,e){const t=parseFloat(n);return nw.test(n)?t*e:t}function m$(n,e,t,r){if(!Array.isArray(e))return 0;const i=e.length;if(!i)return 0;let s=e[0];const o=fl(s.maxFontSize,t)||t;let a=0;const l=fl(r,t);for(let h=1;h<i;h+=1){s=e[h];const f=fl(s.lineHeight,t)||l;a+=f}const c=fl(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 rw(n,e,t={}){e=r$(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&&vo(n),ge(n,{"xml:space":"preserve",display:e||t.displayEmpty?null:"none"});const p=ge(n,"font-size");let b=parseFloat(p);b||(b=16,(o||c)&&!p&&ge(n,"font-size",`${b}`));let m;i?(typeof i=="string"&&(i={d:i}),m=g$(i,n)):m=document.createDocumentFragment();let y,v=0,w;const x=e.split(`
2
2
  `),C=[],P=x.length-1;for(let A=0;A<=P;A+=1){y=f;let O="v-line";const T=Jn("tspan");let L,V=x[A];if(V)if(c){const Y=n$(V,c,{offset:-v,includeAnnotationIndices:l});L=p$(T,Y,{eol:A!==P&&r,baseSize:b,lineHeight:h?null:f,includeAnnotationIndices:l});const M=L.lineHeight;M&&h&&A!==0&&(y=M),A===0&&(w=L.maxFontSize*.8)}else r&&A!==P&&(V+=r),T.textContent=V;else{T.textContent="-",O+=" v-empty-line";const Y=T.style;Y.fillOpacity=0,Y.strokeOpacity=0,c&&(L={})}L&&C.push(L),A>0&&T.setAttribute("dy",y),(A>0||i)&&T.setAttribute("x",a),T.className.baseVal=O,m.appendChild(T),v+=V.length+1}if(o)if(c)y=m$(s,C,b,f);else if(s==="top")y="0.8em";else{let A;switch(P>0?(A=parseFloat(f)||1,A*=P,nw.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 xo(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"),tw.font=t.join(" "),tw.measureText(n)}function iw(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]||xo(a,r).width,c=n.slice(0,o+1),u=s[c]||xo(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 y$(n,e,t={},r={}){const i=e.width,s=e.height,o=r.eol||`
3
- `,{width:a}=xo(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=xo(g,t).width);for(let b=0;b<h;b+=1)if(d>i)if(b===h-1){const[y]=iw(f,i-p,d,t);l.push(g?`${y}${g}`:y)}else{const[y,v]=iw(f,i,d,t);l.push(y),f=v,d=xo(f,t).width}else{l.push(f);break}return l.join(o)}const xh=.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 v$(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 b$(n){return["M",pt(n,"x1"),pt(n,"y1"),"L",pt(n,"x2"),pt(n,"y2")].join(" ")}function w$(n){const e=dl(n);return e.length===0?null:`${sw(e)} Z`}function x$(n){const e=dl(n);return e.length===0?null:sw(e)}function sw(n){return`M ${n.map(t=>`${t.x} ${t.y}`).join(" L")}`}function dl(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 C$(n){const e=pt(n,"cx",0),t=pt(n,"cy",0),r=pt(n,"r"),i=r*xh;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 S$(n){const e=pt(n,"cx",0),t=pt(n,"cy",0),r=pt(n,"rx"),i=pt(n,"ry")||r,s=r*xh,o=i*xh;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 P$(n){return ow({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 ow(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 E$(n){const e=Jn("path");ge(e,ge(n));const t=aw(n);return t&&e.setAttribute("d",t),e}function aw(n){const e=n.tagName.toLowerCase();switch(e){case"path":return n.getAttribute("d");case"line":return b$(n);case"polygon":return w$(n);case"polyline":return x$(n);case"ellipse":return S$(n);case"circle":return C$(n);case"rect":return P$(n)}throw new Error(`"${e}" cannot be converted to svg path element.`)}const gl=Jn("svg"),A$=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,lw=/[ ,]+/,T$=/^(\w+)\((.*)\)/;function O$(n,e){const t=gl.createSVGPoint();return t.x=n,t.y=e,t}function lt(n){const e=gl.createSVGMatrix();if(n!=null){const t=n,r=e;for(const i in t)r[i]=t[i]}return e}function Co(n){return n!=null?(n instanceof DOMMatrix||(n=lt(n)),gl.createSVGTransformFromMatrix(n)):gl.createSVGTransform()}function is(n){let e=lt();const t=n!=null&&n.match(A$);if(!t)return e;for(let r=0,i=t.length;r<i;r+=1){const o=t[r].match(T$);if(o){let a,l,c,u,h,f=lt();const d=o[2].split(lw);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 ss(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 pl(n){let e,t,r;if(n){const s=lw;if(n.trim().indexOf("matrix")>=0){const o=is(n),a=M$(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 Ch(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 M$(n){const e=Ch(n,{x:0,y:1}),t=Ch(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 _$(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 N$(n){let e={x:0,y:1};n&&(e=Ch(n,e));const t=180*Math.atan2(e.y,e.x)/Math.PI%360-90;return{angle:t%360+(t<0?360:0)}}function k$(n){return{tx:n&&n.e||0,ty:n&&n.f||0}}function os(n,e,t={}){if(e==null)return is(ge(n,"transform"));if(t.absolute){n.setAttribute("transform",ss(e));return}const r=n.transform,i=Co(e);r.baseVal.appendItem(i)}function cw(n,e,t=0,r={}){let i=ge(n,"transform");const s=pl(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 Sh(n,e,t,r,i={}){let s=ge(n,"transform");const o=pl(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 Ph(n,e,t){let r=ge(n,"transform");const i=pl(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 So(n,e){if(Pr(e)&&Pr(n)){const t=e.getScreenCTM(),r=n.getScreenCTM();if(t&&r)return t.inverse().multiply(r)}return lt()}function I$(n,e){let t=lt();if(Pr(e)&&Pr(n)){let r=n;const i=[];for(;r&&r!==e;){const s=r.getAttribute("transform")||null,o=is(s);i.push(o),r=r.parentNode}i.reverse().forEach(s=>{t=t.multiply(s)})}return t}function L$(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=So(n,r).inverse();return o.matrixTransform(a)}catch(s){return i}}var en;(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})(en||(en={}));var yi;(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})(yi||(yi={}));var se;(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})(se||(se={})),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}(se||(se={})),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}(se||(se={})),function(n){function e(t,r){const i=[],s=yi.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}(se||(se={})),function(n){function e(t){return t!=null&&t===t.window}n.isWindow=e}(se||(se={})),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}(se||(se={}));class jn{constructor(e,t){this.isDefaultPrevented=se.returnFalse,this.isPropagationStopped=se.returnFalse,this.isImmediatePropagationStopped=se.returnFalse,this.isSimulated=!1,this.preventDefault=()=>{const r=this.originalEvent;this.isDefaultPrevented=se.returnTrue,r&&!this.isSimulated&&r.preventDefault()},this.stopPropagation=()=>{const r=this.originalEvent;this.isPropagationStopped=se.returnTrue,r&&!this.isSimulated&&r.stopPropagation()},this.stopImmediatePropagation=()=>{const r=this.originalEvent;this.isImmediatePropagationStopped=se.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?se.returnTrue:se.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})(jn||(jn={})),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}(jn||(jn={})),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]))}(jn||(jn={})),function(n){en.register("load",{noBubble:!0})}(),function(n){en.register("beforeunload",{postDispatch(e,t){t.result!==void 0&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}})}(),function(n){en.register("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(e,t){let r;const i=t.relatedTarget,s=t.handleObj;return(!i||i!==e&&!se.contains(e,i))&&(t.type=s.originType,r=s.handler.call(e,t),t.type="mouseover"),r}}),en.register("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(e,t){let r;const i=t.relatedTarget,s=t.handleObj;return(!i||i!==e&&!se.contains(e,i))&&(t.type=s.originType,r=s.handler.call(e,t),t.type="mouseout"),r}})}();var R$=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},Po;(function(n){let e;function t(o,a,l,c,u){if(!se.isValidTarget(o))return;let h;if(typeof l!="function"){const{handler:p,selector:b}=l,m=R$(l,["handler","selector"]);l=p,u=b,h=m}const f=yi.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=se.ensureHandlerId(l);se.splitType(a).forEach(p=>{const{originType:b,namespaces:m}=se.normalizeType(p);if(!b)return;let y=b,v=en.get(y);y=(u?v.delegateType:v.bindType)||y,v=en.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)&&se.addEventListener(o,y,d)),v.add&&(se.removeHandlerId(w.handler),v.add(o,w),se.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=yi.get(o);if(!h)return;const f=h.events;f&&(se.splitType(a).forEach(d=>{const{originType:g,namespaces:p}=se.normalizeType(d);if(!g){Object.keys(f).forEach(x=>{r(o,x+d,l,c,!0)});return}let b=g;const m=en.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||se.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)&&se.removeEventListener(o,b,h.handler),delete f[b])}),Object.keys(f).length===0&&yi.remove(o))}n.off=r;function i(o,a,...l){const c=jn.create(a);c.delegateTarget=o;const u=en.get(c.type);if(u.preDispatch&&u.preDispatch(o,c)===!1)return;const h=se.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=en.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 jn?o:new jn(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=en.get(h);if(!c&&b.trigger&&b.trigger(d,u,a)===!1)return;let m;const y=[d];if(!c&&!b.noBubble&&!se.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 P=w.defaultView||w.parentWindow||window;y.push(P)}}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 P=yi.get(C);P&&P.events[u.type]&&P.handler&&P.handler.call(C,...p);const E=g&&C[g]||null;E&&se.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)&&se.isValidTarget(d)&&g&&typeof d[h]=="function"&&!se.isWindow(d)){const x=d[g];x&&(d[g]=null),e=h,u.isPropagationStopped()&&v.addEventListener(h,se.stopPropagationCallback),d[h](),u.isPropagationStopped()&&v.removeEventListener(h,se.stopPropagationCallback),e=void 0,x&&(d[g]=x)}}return u.result}n.trigger=s})(Po||(Po={}));var Ae;(function(n){function e(s,o,a,l,c){return Eo.on(s,o,a,l,c),s}n.on=e;function t(s,o,a,l,c){return Eo.on(s,o,a,l,c,!0),s}n.once=t;function r(s,o,a,l){return Eo.off(s,o,a,l),s}n.off=r;function i(s,o,a,l){return Po.trigger(o,a,s,l),s}n.trigger=i})(Ae||(Ae={}));var Eo;(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=se.returnFalse;else if(!a)return;if(l){const c=a;a=function(u,...h){return n.off(r,u),c.call(this,u,...h)},se.setHandlerId(a,se.ensureHandlerId(c))}Po.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=se.returnFalse),Po.off(r,i,o,s)}n.off=t})(Eo||(Eo={}));class uw{constructor(e,t,r){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=Zt.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 Ao(n){const e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView;return{top:e.top+t.pageYOffset,left:e.left+t.pageXOffset}}function j$(n){return n.getBoundingClientRect().width}function D$(n){return n.getBoundingClientRect().height}function B$(n){const e=cl(n,"position")==="fixed";let t;if(e){const r=n.getBoundingClientRect();t={left:r.left,top:r.top}}else t=Ao(n);if(!e){const r=n.ownerDocument;let i=n.offsetParent||r.documentElement;for(;(i===r.body||i===r.documentElement)&&cl(i,"position")==="static";)i=i.parentNode;if(i!==n&&ZB(i)){const s=Ao(i);t.top-=s.top+ul(i,"borderTopWidth"),t.left-=s.left+ul(i,"borderLeftWidth")}}return{top:t.top-ul(n,"marginTop"),left:t.left-ul(n,"marginLeft")}}function hw(n,e=60){let t=null;return(...r)=>{t&&clearTimeout(t),t=window.setTimeout(()=>{n.apply(this,r)},e)}}function $$(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=hw(()=>{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 z$(n){let e=null,t=[];const r=hw(()=>{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 F$=typeof ResizeObserver!="undefined"?z$:$$;var ml;(function(n){const e=new WeakMap;function t(i){let s=e.get(i);return s||(s=F$(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)}})(ml||(ml={}));class To{constructor(e={}){this.comparator=e.comparator||To.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})(To||(To={}));var Eh;(function(n){function e(t,r,i=(s,o)=>1){const s={},o={},a={},l=new To;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})(Eh||(Eh={}));class Zn{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 Zn.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=Zn.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(Qt(s,0,255)),this.g=Math.round(Qt(o,0,255)),this.b=Math.round(Qt(a,0,255)),this.a=l==null?1:Qt(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 Zn.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 Zn.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,P=parseFloat(x[1])/100,E=parseFloat(x[2])/100,A=x[3]==null?1:parseInt(x[3],10);return new n(c(C,P,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 P=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(P,E,A),L=Math.min(P,E,A),V=(T+L)/2;let Y=0,M=0;if(L!==T){const I=T-L;switch(M=V>.5?I/(2-T-L):I/(T+L),T){case P:Y=(E-A)/I+(E<A?6:0);break;case E:Y=(A-P)/I+2;break;case A:Y=(P-E)/I+4;break}Y/=6}return[Y,M,V,O==null?1:O]}n.rgba2hsla=l;function c(v,w,x,C){const P=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,L=2*A-T;return[i(L,T,P+1/3)*256,i(L,T,P)*256,i(L,T,P-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,L]=g(v);return w?O*.299+T*.587+L*.114>186?"#000000":"#ffffff":`${A?"#":""}${p(255-O,255-T,255-L)}`}const x=v[0],C=v[1],P=v[2],E=v[3];return w?x*.299+C*.587+P*.114>186?[0,0,0,E]:[255,255,255,E]:[255-x,255-C,255-P,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,P=(1<<C)-1,E=["b","g","r"].map(()=>{const A=x&P;return x>>=C,C===4?17*A:A});return[E[2],E[1],E[0]]}function p(v,w,x){const C=P=>P.length<2?`0${P}`:P;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 P=v[0]==="#",E=parseInt(P?v.substr(1):v,16),A=Qt((E>>16)+w,0,255),O=Qt((E>>8&255)+w,0,255),T=Qt((E&255)+w,0,255);return`${P?"#":""}${(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]]}})(Zn||(Zn={})),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"}}(Zn||(Zn={}));class Ah{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 er;(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})(er||(er={}));var vi;(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}}})(vi||(vi={})),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)}}}(vi||(vi={})),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 I=M-1;return I*I*I+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 I=M-1;return 1-I*I*I*I}n.easeOutQuart=h;function f(M){const I=M-1;return M<.5?8*M*M*M*M:1-8*I*I*I*I}n.easeInOutQuart=f;function d(M){return M*M*M*M*M}n.easeInQuint=d;function g(M){const I=M-1;return 1+I*I*I*I*I}n.easeOutQuint=g;function p(M){const I=M-1;return M<.5?16*M*M*M*M*M:1+16*I*I*I*I*I}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 I=M*2,J=I-1;return I<1?.5*Math.pow(2,10*J):.5*(-Math.pow(2,-10*J)+2)}n.easeInOutExpo=y;function v(M){const I=M/1;return-1*(Math.sqrt(1-I*M)-1)}n.easeInCirc=v;function w(M){const I=M-1;return Math.sqrt(1-I*I)}n.easeOutCirc=w;function x(M){const I=M*2,J=I-2;return I<1?-.5*(Math.sqrt(1-I*I)-1):.5*(Math.sqrt(1-J*J)+1)}n.easeInOutCirc=x;function C(M,I=1.70158){return M*M*((I+1)*M-I)}n.easeInBack=C;function P(M,I=1.70158){const J=M/1-1;return J*J*((I+1)*J+I)+1}n.easeOutBack=P;function E(M,I=1.70158){const J=M*2,R=J-2,F=I*1.525;return J<1?.5*J*J*((F+1)*J-F):.5*(R*R*((F+1)*R+F)+2)}n.easeInOutBack=E;function A(M,I=.7){if(M===0||M===1)return M;const R=M/1-1,F=1-I,H=F/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*R)*Math.sin((R-H)*(2*Math.PI)/F))}n.easeInElastic=A;function O(M,I=.7){const J=1-I,R=M*2;if(M===0||M===1)return M;const F=J/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*R)*Math.sin((R-F)*(2*Math.PI)/J)+1}n.easeOutElastic=O;function T(M,I=.65){const J=1-I;if(M===0||M===1)return M;const R=M*2,F=R-1,H=J/(2*Math.PI)*Math.asin(1);return R<1?-.5*(Math.pow(2,10*F)*Math.sin((F-H)*(2*Math.PI)/J)):Math.pow(2,-10*F)*Math.sin((F-H)*(2*Math.PI)/J)*.5+1}n.easeInOutElastic=T;function L(M){const I=M/1;if(I<1/2.75)return 7.5625*I*I;if(I<2/2.75){const J=I-.5454545454545454;return 7.5625*J*J+.75}if(I<2.5/2.75){const J=I-.8181818181818182;return 7.5625*J*J+.9375}{const J=I-.9545454545454546;return 7.5625*J*J+.984375}}n.easeOutBounce=L;function V(M){return 1-L(1-M)}n.easeInBounce=V;function Y(M){return M<.5?V(M*2)*.5:L(M*2-1)*.5+.5}n.easeInOutBounce=Y}(vi||(vi={}));var bi;(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)}`}}})(bi||(bi={}));const Oo=[];function Mo(n,e){const t=Oo.find(r=>r.name===n);if(!(t&&(t.loadTimes+=1,t.loadTimes>1))&&!Zt.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),Oo.push({name:n,loadTimes:1,styleElement:r})}}function _o(n){const e=Oo.findIndex(t=>t.name===n);if(e>-1){const t=Oo[e];if(t.loadTimes-=1,t.loadTimes>0)return;let r=t.styleElement;r&&r.parentNode&&r.parentNode.removeChild(r),r=null,Oo.splice(e,1)}}var xe;(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})(xe||(xe={}));var Se;(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})(Se||(Se={}));class Ar{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class S extends Ar{constructor(e,t){super(),this.x=e==null?0:e,this.y=t==null?0:t}round(e=0){return this.x=Se.round(this.x,e),this.y=Se.round(this.y,e),this}add(e,t){const r=S.create(e,t);return this.x+=r.x,this.y+=r.y,this}update(e,t){const r=S.create(e,t);return this.x=r.x,this.y=r.y,this}translate(e,t){const r=S.create(e,t);return this.x+=r.x,this.y+=r.y,this}rotate(e,t){const r=S.rotate(this,e,t);return this.x=r.x,this.y=r.y,this}scale(e,t,r=new S){const i=S.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 S.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?S.create(t):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){const t=S.create(e),r=this.x-t.x,i=this.y-t.y;return r*r+i*i}manhattanDistance(e){const t=S.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 S){const t=S.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 S(0,0).angleBetween(this,e)}toPolar(e){return this.update(S.toPolar(this,e)),this}changeInAngle(e,t,r=new S){return this.clone().translate(-e,-t).theta(r)-this.theta(r)}adhereToRect(e){return Se.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=S.create(e),r=xe.toRad(this.y),i=xe.toRad(t.y),s=this.x,o=t.x,a=xe.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=xe.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=S.create(e),i=S.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=S.create(e);return this.x*t.x+this.y*t.y}diff(e,t){if(typeof e=="number")return new S(this.x-e,this.y-t);const r=S.create(e);return new S(this.x-r.x,this.y-r.y)}lerp(e,t){const r=S.create(e);return new S((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=S.create(e),i=xe.toRad(r.theta(this));return this.translate(Math.cos(i)*t,-Math.sin(i)*t)}reflection(e){return S.create(e).move(this,this.distance(e))}snapToGrid(e,t){return this.x=Se.snapToGrid(this.x,e),this.y=Se.snapToGrid(this.y,t==null?e:t),this}equals(e){const t=S.create(e);return t!=null&&t.x===this.x&&t.y===this.y}clone(){return S.clone(this)}toJSON(){return S.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPoint=e})(S||(S={})),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}(S||(S={})),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=xe.normalize(xe.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),xe.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(Se.random(h,f),Se.random(d,g))}n.random=l;function c(h,f,d){const g=xe.toRad(xe.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}(S||(S={}));class B extends Ar{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 S(this.x,this.y)}get topLeft(){return new S(this.x,this.y)}get topCenter(){return new S(this.x+this.width/2,this.y)}get topRight(){return new S(this.x+this.width,this.y)}get center(){return new S(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new S(this.x,this.y+this.height)}get bottomCenter(){return new S(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new S(this.x+this.width,this.y+this.height)}get corner(){return new S(this.x+this.width,this.y+this.height)}get rightMiddle(){return new S(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new S(this.x,this.y+this.height/2)}get topLine(){return new q(this.topLeft,this.topRight)}get rightLine(){return new q(this.topRight,this.bottomRight)}get bottomLine(){return new q(this.bottomLeft,this.bottomRight)}get leftLine(){return new q(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=xe.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 B(this.x+(this.width-s)/2,this.y+(this.height-o)/2,s,o)}round(e=0){return this.x=Se.round(this.x,e),this.y=Se.round(this.y,e),this.width=Se.round(this.width,e),this.height=Se.round(this.height,e),this}add(e,t,r,i){const s=B.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=B.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=S.create(e,t);return this.x+=r.x,this.y+=r.y,this}scale(e,t,r=new S){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=xe.toRad(e),i=Math.cos(r),s=Math.sin(r);let o=this.getOrigin(),a=this.getTopRight(),l=this.getBottomRight(),c=this.getBottomLeft();o=S.rotateEx(o,i,s,t),a=S.rotateEx(a,i,s,t),l=S.rotateEx(l,i,s,t),c=S.rotateEx(c,i,s,t);const u=new B(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=B.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=B.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 Se.containsPoint(this,S.create(e,t))}containsRect(e,t,r,i){const s=B.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=S.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 q(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=B.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 B(u,h,Math.min(a.x,c.x)-u,Math.min(a.y,c.y)-h)}isIntersectWithRect(e,t,r,i){const s=B.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=B.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 B(a,l,c-a,u-l)}getNearestSideToPoint(e){const t=S.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=S.clone(e);if(this.containsPoint(t)){const r=this.getNearestSideToPoint(t);if(r==="left")return new S(this.x,t.y);if(r==="top")return new S(t.x,this.y);if(r==="right")return new S(this.x+this.width,t.y);if(r==="bottom")return new S(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 B(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})(B||(B={})),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}(B||(B={})),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}(B||(B={}));class q extends Ar{get center(){return new S((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 S(e,t),this.end=new S(r,i)):(this.start=S.create(e),this.end=S.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 S(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const e=new S(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 B(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 q(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 q(this.start,t),new q(t,this.end)]}divideAtLength(e){const t=this.pointAtLength(e);return[new q(this.start,t),new q(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 q(t,e).length()>i||new q(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 S(this.end.x-this.start.x,this.end.y-this.start.y),r=new S(e.end.x-e.start.x,e.end.y-e.start.y),i=t.x*r.y-t.y*r.x,s=new S(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 S(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=S.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=S.create(e,t);return this.closestPoint(r).squaredDistance(r)}pointDistance(e,t){const r=S.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 q(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 q(t,r);return s.translate(i.x-t.x,i.y-t.y),s}relativeCcw(e,t){const r=S.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 q(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})(q||(q={}));class vn extends Ar{get center(){return new S(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 B.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=S.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 S(this.x,this.y)),c=new S(a.x/(r*r),a.y/(i*i)),u=new S(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=S.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 S(this.x+h,this.y+f),t?o.rotate(-t,this.getCenter()):o}tangentTheta(e){const t=S.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 S(d,g).theta(t)}scale(e,t){return this.a*=e,this.b*=t,this}rotate(e,t){const r=B.fromEllipse(this);r.rotate(e,t);const i=vn.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=S.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 vn(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})(vn||(vn={})),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}(vn||(vn={}));const q$=new RegExp("^[\\s\\dLMCZz,.]*$");function V$(n){return typeof n!="string"?!1:q$.test(n)}function Th(n,e){return(n%e+e)%e}function G$(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 S(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[Th(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[Th(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[Th(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,P=h.y+x;s.push("Q",h.x,h.y,C,P),h=new S(C,P)}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 fw(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})}),G$(t,e.round,e.initialMove==null||e.initialMove,e.close,e.exclude)}function yl(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 X=1;s===o&&(X=-1),w=X*Math.sqrt((m*y-m*b-y*p)/(m*b+y*p))}const x=w*t*g/r,C=-1*w*r*d/t,P=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 L=T*2/Math.PI,V=Math.ceil(L<0?-1*L:L),Y=T/V,M=8/3*Math.sin(Y/4)*Math.sin(Y/4)/Math.sin(Y/2),I=h*t,J=h*r,R=f*t,F=f*r;let H=Math.cos(O),ne=Math.sin(O),Pe=-M*(I*ne+F*H),Yt=-M*(R*ne-J*H),N=0,$=0;const z=[];for(let X=0;X<V;X+=1){O+=Y,H=Math.cos(O),ne=Math.sin(O),N=I*H-F*ne+P,$=R*H+J*ne+E;const re=-M*(I*ne+F*H),he=-M*(R*ne-J*H),Ce=X*6;z[Ce]=Number(Pe+n),z[Ce+1]=Number(Yt+e),z[Ce+2]=Number(N-re+n),z[Ce+3]=Number($-he+e),z[Ce+4]=Number(N+n),z[Ce+5]=Number($+e),Pe=N+re,Yt=$+he}return z.map(X=>+X.toFixed(2))}function H$(n,e,t,r,i=0,s=0,o=0,a,l){const c=[],u=yl(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 We extends Ar{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 We.parse(e);this.points=e.map(t=>S.create(t))}else this.points=[]}scale(e,t,r=new S){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=S.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 B;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 B(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 q(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=S.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 q(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 S(r+d,i),p=new q(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 q(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 q(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 q(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 q(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 q(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 We;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 We(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 We(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})(We||(We={})),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}(We||(We={}));class qe extends Ar{constructor(e,t,r,i){super(),this.PRECISION=3,this.start=S.create(e),this.controlPoint1=S.create(t),this.controlPoint2=S.create(r),this.end=S.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 I=0;I<2;I+=1){if(I===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 P,E,A,O=d.length;const T=O;for(;O;)O-=1,y=d[O],A=1-y,P=A*A*A*s+3*A*A*y*a+3*A*y*y*c+y*y*y*h,g[0][O]=P,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 L=Math.min.apply(null,g[0]),V=Math.min.apply(null,g[1]),Y=Math.max.apply(null,g[0]),M=Math.max.apply(null,g[1]);return new B(L,V,Y-L,M-V)}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),P=x[0].end.distance(e),E=C+P,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=P):(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 qe(t,t,t,t),new qe(t,r,i,s)];if(e>=1)return[new qe(t,r,i,s),new qe(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 qe(t,a,l,c),new qe(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 q(t,r).pointAt(e),a=new q(r,i).pointAt(e),l=new q(i,s).pointAt(e),c=new q(o,a).pointAt(e),u=new q(a,l).pointAt(e),h=new q(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 qe(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 q(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 We(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 qe(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})(qe||(qe={})),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=>S.clone(f)),o=[],a=[],l=s.length-1;if(l===1)return o[0]=new S((2*s[0].x+s[1].x)/3,(2*s[0].y+s[1].y)/3),a[0]=new S(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 S(u[f],h[f])),f<l-1?a.push(new S(2*s[f+1].x-u[f+1],2*s[f+1].y-h[f+1])):a.push(new S((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 S(s[0][a].x,s[0][a].y),u=new S(s[1][a].x,s[1][a].y);o.push(new n(i[a],c,u,i[a+1]))}return o}n.throughPoints=r}(qe||(qe={}));class vl extends Ar{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 vl{constructor(e,t){super(),q.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=S.create(e,t).round(2)}get type(){return"L"}get line(){return new q(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(q.isLine(i))return new n(i);if(S.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 as extends vl{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 q(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 as}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})(as||(as={}));class ls extends vl{constructor(e,t){super(),this.isVisible=!1,this.isSubpathStart=!0,q.isLine(e)||qe.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=S.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 ls(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(q.isLine(i))return new n(i);if(qe.isCurve(i))return new n(i);if(S.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})(ls||(ls={}));class tn extends vl{constructor(e,t,r,i,s,o){super(),qe.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 S(e,t).round(2),this.controlPoint2=new S(r,i).round(2),this.endPoint=new S(s,o).round(2)):(this.controlPoint1=S.create(e).round(2),this.controlPoint2=S.create(t).round(2),this.endPoint=S.create(r).round(2))}get type(){return"C"}get curve(){return new qe(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 tn(r[0]),new tn(r[1])]}divideAtLength(e,t={}){const r=this.curve.divideAtLength(e,t);return[new tn(r[0]),new tn(r[1])]}divideAtT(e){const t=this.curve.divideAtT(e);return[new tn(t[0]),new tn(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 tn(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(qe.isCurve(i))return new n(i);if(S.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})(tn||(tn={}));function bl(n,e,t){return{x:n*Math.cos(t)-e*Math.sin(t),y:n*Math.sin(t)+e*Math.cos(t)}}function dw(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 gw(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=bl(n,e,-h),n=d.x,e=d.y,d=bl(a,l,-h),a=d.x,l=d.y;const Y=(n-a)/2,M=(e-l)/2;let I=Y*Y/(t*t)+M*M/(r*r);I>1&&(I=Math.sqrt(I),t=I*t,r=I*r);const J=t*t,R=r*r,F=(s===o?-1:1)*Math.sqrt(Math.abs((J*R-J*M*M-R*Y*Y)/(J*M*M+R*Y*Y)));b=F*t*M/r+(n+a)/2,m=F*-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,I=l;p=g+u*(o&&p>g?1:-1),a=b+t*Math.cos(p),l=m+r*Math.sin(p),f=gw(a,l,t,r,i,0,o,M,I,[p,Y,b,m])}y=p-g;const v=Math.cos(g),w=Math.sin(g),x=Math.cos(p),C=Math.sin(p),P=Math.tan(y/4),E=4/3*(t*P),A=4/3*(r*P),O=[n,e],T=[n+E*w,e-A*v],L=[a+E*C,l-A*x],V=[a,l];if(T[0]=2*O[0]-T[0],T[1]=2*O[1]-T[1],c)return[T,L,V].concat(f);{f=[T,L,V].concat(f).join().split(",");const Y=[],M=f.length;for(let I=0;I<M;I+=1)Y[I]=I%2?bl(+f[I-1],+f[I],h).y:bl(+f[I],+f[I+1],h).x;return Y}}function U$(n){if(!n)return null;const e=`
3
+ `,{width:a}=xo(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=xo(g,t).width);for(let b=0;b<h;b+=1)if(d>i)if(b===h-1){const[y]=iw(f,i-p,d,t);l.push(g?`${y}${g}`:y)}else{const[y,v]=iw(f,i,d,t);l.push(y),f=v,d=xo(f,t).width}else{l.push(f);break}return l.join(o)}const xh=.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 v$(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 b$(n){return["M",pt(n,"x1"),pt(n,"y1"),"L",pt(n,"x2"),pt(n,"y2")].join(" ")}function w$(n){const e=dl(n);return e.length===0?null:`${sw(e)} Z`}function x$(n){const e=dl(n);return e.length===0?null:sw(e)}function sw(n){return`M ${n.map(t=>`${t.x} ${t.y}`).join(" L")}`}function dl(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 C$(n){const e=pt(n,"cx",0),t=pt(n,"cy",0),r=pt(n,"r"),i=r*xh;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 S$(n){const e=pt(n,"cx",0),t=pt(n,"cy",0),r=pt(n,"rx"),i=pt(n,"ry")||r,s=r*xh,o=i*xh;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 P$(n){return ow({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 ow(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 E$(n){const e=Jn("path");ge(e,ge(n));const t=aw(n);return t&&e.setAttribute("d",t),e}function aw(n){const e=n.tagName.toLowerCase();switch(e){case"path":return n.getAttribute("d");case"line":return b$(n);case"polygon":return w$(n);case"polyline":return x$(n);case"ellipse":return S$(n);case"circle":return C$(n);case"rect":return P$(n)}throw new Error(`"${e}" cannot be converted to svg path element.`)}const gl=Jn("svg"),A$=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,lw=/[ ,]+/,T$=/^(\w+)\((.*)\)/;function O$(n,e){const t=gl.createSVGPoint();return t.x=n,t.y=e,t}function lt(n){const e=gl.createSVGMatrix();if(n!=null){const t=n,r=e;for(const i in t)r[i]=t[i]}return e}function Co(n){return n!=null?(n instanceof DOMMatrix||(n=lt(n)),gl.createSVGTransformFromMatrix(n)):gl.createSVGTransform()}function is(n){let e=lt();const t=n!=null&&n.match(A$);if(!t)return e;for(let r=0,i=t.length;r<i;r+=1){const o=t[r].match(T$);if(o){let a,l,c,u,h,f=lt();const d=o[2].split(lw);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 ss(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 pl(n){let e,t,r;if(n){const s=lw;if(n.trim().indexOf("matrix")>=0){const o=is(n),a=M$(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 Ch(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 M$(n){const e=Ch(n,{x:0,y:1}),t=Ch(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 _$(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 N$(n){let e={x:0,y:1};n&&(e=Ch(n,e));const t=180*Math.atan2(e.y,e.x)/Math.PI%360-90;return{angle:t%360+(t<0?360:0)}}function k$(n){return{tx:n&&n.e||0,ty:n&&n.f||0}}function os(n,e,t={}){if(e==null)return is(ge(n,"transform"));if(t.absolute){n.setAttribute("transform",ss(e));return}const r=n.transform,i=Co(e);r.baseVal.appendItem(i)}function cw(n,e,t=0,r={}){let i=ge(n,"transform");const s=pl(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 Sh(n,e,t,r,i={}){let s=ge(n,"transform");const o=pl(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 Ph(n,e,t){let r=ge(n,"transform");const i=pl(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 So(n,e){if(Pr(e)&&Pr(n)){const t=e.getScreenCTM(),r=n.getScreenCTM();if(t&&r)return t.inverse().multiply(r)}return lt()}function I$(n,e){let t=lt();if(Pr(e)&&Pr(n)){let r=n;const i=[];for(;r&&r!==e;){const s=r.getAttribute("transform")||null,o=is(s);i.push(o),r=r.parentNode}i.reverse().forEach(s=>{t=t.multiply(s)})}return t}function L$(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=So(n,r).inverse();return o.matrixTransform(a)}catch(s){return i}}var en;(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})(en||(en={}));var yi;(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})(yi||(yi={}));var se;(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})(se||(se={})),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}(se||(se={})),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}(se||(se={})),function(n){function e(t,r){const i=[],s=yi.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}(se||(se={})),function(n){function e(t){return t!=null&&t===t.window}n.isWindow=e}(se||(se={})),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}(se||(se={}));class jn{constructor(e,t){this.isDefaultPrevented=se.returnFalse,this.isPropagationStopped=se.returnFalse,this.isImmediatePropagationStopped=se.returnFalse,this.isSimulated=!1,this.preventDefault=()=>{const r=this.originalEvent;this.isDefaultPrevented=se.returnTrue,r&&!this.isSimulated&&r.preventDefault()},this.stopPropagation=()=>{const r=this.originalEvent;this.isPropagationStopped=se.returnTrue,r&&!this.isSimulated&&r.stopPropagation()},this.stopImmediatePropagation=()=>{const r=this.originalEvent;this.isImmediatePropagationStopped=se.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?se.returnTrue:se.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})(jn||(jn={})),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}(jn||(jn={})),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]))}(jn||(jn={})),function(n){en.register("load",{noBubble:!0})}(),function(n){en.register("beforeunload",{postDispatch(e,t){t.result!==void 0&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}})}(),function(n){en.register("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(e,t){let r;const i=t.relatedTarget,s=t.handleObj;return(!i||i!==e&&!se.contains(e,i))&&(t.type=s.originType,r=s.handler.call(e,t),t.type="mouseover"),r}}),en.register("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(e,t){let r;const i=t.relatedTarget,s=t.handleObj;return(!i||i!==e&&!se.contains(e,i))&&(t.type=s.originType,r=s.handler.call(e,t),t.type="mouseout"),r}})}();var R$=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},Po;(function(n){let e;function t(o,a,l,c,u){if(!se.isValidTarget(o))return;let h;if(typeof l!="function"){const{handler:p,selector:b}=l,m=R$(l,["handler","selector"]);l=p,u=b,h=m}const f=yi.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=se.ensureHandlerId(l);se.splitType(a).forEach(p=>{const{originType:b,namespaces:m}=se.normalizeType(p);if(!b)return;let y=b,v=en.get(y);y=(u?v.delegateType:v.bindType)||y,v=en.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)&&se.addEventListener(o,y,d)),v.add&&(se.removeHandlerId(w.handler),v.add(o,w),se.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=yi.get(o);if(!h)return;const f=h.events;f&&(se.splitType(a).forEach(d=>{const{originType:g,namespaces:p}=se.normalizeType(d);if(!g){Object.keys(f).forEach(x=>{r(o,x+d,l,c,!0)});return}let b=g;const m=en.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||se.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)&&se.removeEventListener(o,b,h.handler),delete f[b])}),Object.keys(f).length===0&&yi.remove(o))}n.off=r;function i(o,a,...l){const c=jn.create(a);c.delegateTarget=o;const u=en.get(c.type);if(u.preDispatch&&u.preDispatch(o,c)===!1)return;const h=se.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=en.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 jn?o:new jn(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=en.get(h);if(!c&&b.trigger&&b.trigger(d,u,a)===!1)return;let m;const y=[d];if(!c&&!b.noBubble&&!se.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 P=w.defaultView||w.parentWindow||window;y.push(P)}}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 P=yi.get(C);P&&P.events[u.type]&&P.handler&&P.handler.call(C,...p);const E=g&&C[g]||null;E&&se.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)&&se.isValidTarget(d)&&g&&typeof d[h]=="function"&&!se.isWindow(d)){const x=d[g];x&&(d[g]=null),e=h,u.isPropagationStopped()&&v.addEventListener(h,se.stopPropagationCallback),d[h](),u.isPropagationStopped()&&v.removeEventListener(h,se.stopPropagationCallback),e=void 0,x&&(d[g]=x)}}return u.result}n.trigger=s})(Po||(Po={}));var Ae;(function(n){function e(s,o,a,l,c){return Eo.on(s,o,a,l,c),s}n.on=e;function t(s,o,a,l,c){return Eo.on(s,o,a,l,c,!0),s}n.once=t;function r(s,o,a,l){return Eo.off(s,o,a,l),s}n.off=r;function i(s,o,a,l){return Po.trigger(o,a,s,l),s}n.trigger=i})(Ae||(Ae={}));var Eo;(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=se.returnFalse;else if(!a)return;if(l){const c=a;a=function(u,...h){return n.off(r,u),c.call(this,u,...h)},se.setHandlerId(a,se.ensureHandlerId(c))}Po.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=se.returnFalse),Po.off(r,i,o,s)}n.off=t})(Eo||(Eo={}));class uw{constructor(e,t,r){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=Zt.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 Ao(n){const e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView;return{top:e.top+t.pageYOffset,left:e.left+t.pageXOffset}}function j$(n){return n.getBoundingClientRect().width}function D$(n){return n.getBoundingClientRect().height}function B$(n){const e=cl(n,"position")==="fixed";let t;if(e){const r=n.getBoundingClientRect();t={left:r.left,top:r.top}}else t=Ao(n);if(!e){const r=n.ownerDocument;let i=n.offsetParent||r.documentElement;for(;(i===r.body||i===r.documentElement)&&cl(i,"position")==="static";)i=i.parentNode;if(i!==n&&ZB(i)){const s=Ao(i);t.top-=s.top+ul(i,"borderTopWidth"),t.left-=s.left+ul(i,"borderLeftWidth")}}return{top:t.top-ul(n,"marginTop"),left:t.left-ul(n,"marginLeft")}}function hw(n,e=60){let t=null;return(...r)=>{t&&clearTimeout(t),t=window.setTimeout(()=>{n.apply(this,r)},e)}}function $$(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=hw(()=>{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 z$(n){let e=null,t=[];const r=hw(()=>{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 F$=typeof ResizeObserver!="undefined"?z$:$$;var ml;(function(n){const e=new WeakMap;function t(i){let s=e.get(i);return s||(s=F$(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)}})(ml||(ml={}));class To{constructor(e={}){this.comparator=e.comparator||To.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})(To||(To={}));var Eh;(function(n){function e(t,r,i=(s,o)=>1){const s={},o={},a={},l=new To;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})(Eh||(Eh={}));class Zn{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 Zn.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=Zn.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(Qt(s,0,255)),this.g=Math.round(Qt(o,0,255)),this.b=Math.round(Qt(a,0,255)),this.a=l==null?1:Qt(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 Zn.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 Zn.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,P=parseFloat(x[1])/100,E=parseFloat(x[2])/100,A=x[3]==null?1:parseInt(x[3],10);return new n(c(C,P,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 P=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(P,E,A),L=Math.min(P,E,A),V=(T+L)/2;let Y=0,M=0;if(L!==T){const I=T-L;switch(M=V>.5?I/(2-T-L):I/(T+L),T){case P:Y=(E-A)/I+(E<A?6:0);break;case E:Y=(A-P)/I+2;break;case A:Y=(P-E)/I+4;break}Y/=6}return[Y,M,V,O==null?1:O]}n.rgba2hsla=l;function c(v,w,x,C){const P=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,L=2*A-T;return[i(L,T,P+1/3)*256,i(L,T,P)*256,i(L,T,P-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,L]=g(v);return w?O*.299+T*.587+L*.114>186?"#000000":"#ffffff":`${A?"#":""}${p(255-O,255-T,255-L)}`}const x=v[0],C=v[1],P=v[2],E=v[3];return w?x*.299+C*.587+P*.114>186?[0,0,0,E]:[255,255,255,E]:[255-x,255-C,255-P,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,P=(1<<C)-1,E=["b","g","r"].map(()=>{const A=x&P;return x>>=C,C===4?17*A:A});return[E[2],E[1],E[0]]}function p(v,w,x){const C=P=>P.length<2?`0${P}`:P;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 P=v[0]==="#",E=parseInt(P?v.substr(1):v,16),A=Qt((E>>16)+w,0,255),O=Qt((E>>8&255)+w,0,255),T=Qt((E&255)+w,0,255);return`${P?"#":""}${(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]]}})(Zn||(Zn={})),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"}}(Zn||(Zn={}));class Ah{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 er;(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})(er||(er={}));var vi;(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}}})(vi||(vi={})),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)}}}(vi||(vi={})),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 I=M-1;return I*I*I+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 I=M-1;return 1-I*I*I*I}n.easeOutQuart=h;function f(M){const I=M-1;return M<.5?8*M*M*M*M:1-8*I*I*I*I}n.easeInOutQuart=f;function d(M){return M*M*M*M*M}n.easeInQuint=d;function g(M){const I=M-1;return 1+I*I*I*I*I}n.easeOutQuint=g;function p(M){const I=M-1;return M<.5?16*M*M*M*M*M:1+16*I*I*I*I*I}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 I=M*2,J=I-1;return I<1?.5*Math.pow(2,10*J):.5*(-Math.pow(2,-10*J)+2)}n.easeInOutExpo=y;function v(M){const I=M/1;return-1*(Math.sqrt(1-I*M)-1)}n.easeInCirc=v;function w(M){const I=M-1;return Math.sqrt(1-I*I)}n.easeOutCirc=w;function x(M){const I=M*2,J=I-2;return I<1?-.5*(Math.sqrt(1-I*I)-1):.5*(Math.sqrt(1-J*J)+1)}n.easeInOutCirc=x;function C(M,I=1.70158){return M*M*((I+1)*M-I)}n.easeInBack=C;function P(M,I=1.70158){const J=M/1-1;return J*J*((I+1)*J+I)+1}n.easeOutBack=P;function E(M,I=1.70158){const J=M*2,j=J-2,F=I*1.525;return J<1?.5*J*J*((F+1)*J-F):.5*(j*j*((F+1)*j+F)+2)}n.easeInOutBack=E;function A(M,I=.7){if(M===0||M===1)return M;const j=M/1-1,F=1-I,H=F/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*j)*Math.sin((j-H)*(2*Math.PI)/F))}n.easeInElastic=A;function O(M,I=.7){const J=1-I,j=M*2;if(M===0||M===1)return M;const F=J/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*j)*Math.sin((j-F)*(2*Math.PI)/J)+1}n.easeOutElastic=O;function T(M,I=.65){const J=1-I;if(M===0||M===1)return M;const j=M*2,F=j-1,H=J/(2*Math.PI)*Math.asin(1);return j<1?-.5*(Math.pow(2,10*F)*Math.sin((F-H)*(2*Math.PI)/J)):Math.pow(2,-10*F)*Math.sin((F-H)*(2*Math.PI)/J)*.5+1}n.easeInOutElastic=T;function L(M){const I=M/1;if(I<1/2.75)return 7.5625*I*I;if(I<2/2.75){const J=I-.5454545454545454;return 7.5625*J*J+.75}if(I<2.5/2.75){const J=I-.8181818181818182;return 7.5625*J*J+.9375}{const J=I-.9545454545454546;return 7.5625*J*J+.984375}}n.easeOutBounce=L;function V(M){return 1-L(1-M)}n.easeInBounce=V;function Y(M){return M<.5?V(M*2)*.5:L(M*2-1)*.5+.5}n.easeInOutBounce=Y}(vi||(vi={}));var bi;(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)}`}}})(bi||(bi={}));const Oo=[];function Mo(n,e){const t=Oo.find(r=>r.name===n);if(!(t&&(t.loadTimes+=1,t.loadTimes>1))&&!Zt.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),Oo.push({name:n,loadTimes:1,styleElement:r})}}function _o(n){const e=Oo.findIndex(t=>t.name===n);if(e>-1){const t=Oo[e];if(t.loadTimes-=1,t.loadTimes>0)return;let r=t.styleElement;r&&r.parentNode&&r.parentNode.removeChild(r),r=null,Oo.splice(e,1)}}var xe;(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})(xe||(xe={}));var Se;(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})(Se||(Se={}));class Ar{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class S extends Ar{constructor(e,t){super(),this.x=e==null?0:e,this.y=t==null?0:t}round(e=0){return this.x=Se.round(this.x,e),this.y=Se.round(this.y,e),this}add(e,t){const r=S.create(e,t);return this.x+=r.x,this.y+=r.y,this}update(e,t){const r=S.create(e,t);return this.x=r.x,this.y=r.y,this}translate(e,t){const r=S.create(e,t);return this.x+=r.x,this.y+=r.y,this}rotate(e,t){const r=S.rotate(this,e,t);return this.x=r.x,this.y=r.y,this}scale(e,t,r=new S){const i=S.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 S.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?S.create(t):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){const t=S.create(e),r=this.x-t.x,i=this.y-t.y;return r*r+i*i}manhattanDistance(e){const t=S.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 S){const t=S.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 S(0,0).angleBetween(this,e)}toPolar(e){return this.update(S.toPolar(this,e)),this}changeInAngle(e,t,r=new S){return this.clone().translate(-e,-t).theta(r)-this.theta(r)}adhereToRect(e){return Se.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=S.create(e),r=xe.toRad(this.y),i=xe.toRad(t.y),s=this.x,o=t.x,a=xe.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=xe.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=S.create(e),i=S.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=S.create(e);return this.x*t.x+this.y*t.y}diff(e,t){if(typeof e=="number")return new S(this.x-e,this.y-t);const r=S.create(e);return new S(this.x-r.x,this.y-r.y)}lerp(e,t){const r=S.create(e);return new S((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=S.create(e),i=xe.toRad(r.theta(this));return this.translate(Math.cos(i)*t,-Math.sin(i)*t)}reflection(e){return S.create(e).move(this,this.distance(e))}snapToGrid(e,t){return this.x=Se.snapToGrid(this.x,e),this.y=Se.snapToGrid(this.y,t==null?e:t),this}equals(e){const t=S.create(e);return t!=null&&t.x===this.x&&t.y===this.y}clone(){return S.clone(this)}toJSON(){return S.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPoint=e})(S||(S={})),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}(S||(S={})),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=xe.normalize(xe.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),xe.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(Se.random(h,f),Se.random(d,g))}n.random=l;function c(h,f,d){const g=xe.toRad(xe.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}(S||(S={}));class B extends Ar{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 S(this.x,this.y)}get topLeft(){return new S(this.x,this.y)}get topCenter(){return new S(this.x+this.width/2,this.y)}get topRight(){return new S(this.x+this.width,this.y)}get center(){return new S(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new S(this.x,this.y+this.height)}get bottomCenter(){return new S(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new S(this.x+this.width,this.y+this.height)}get corner(){return new S(this.x+this.width,this.y+this.height)}get rightMiddle(){return new S(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new S(this.x,this.y+this.height/2)}get topLine(){return new q(this.topLeft,this.topRight)}get rightLine(){return new q(this.topRight,this.bottomRight)}get bottomLine(){return new q(this.bottomLeft,this.bottomRight)}get leftLine(){return new q(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=xe.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 B(this.x+(this.width-s)/2,this.y+(this.height-o)/2,s,o)}round(e=0){return this.x=Se.round(this.x,e),this.y=Se.round(this.y,e),this.width=Se.round(this.width,e),this.height=Se.round(this.height,e),this}add(e,t,r,i){const s=B.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=B.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=S.create(e,t);return this.x+=r.x,this.y+=r.y,this}scale(e,t,r=new S){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=xe.toRad(e),i=Math.cos(r),s=Math.sin(r);let o=this.getOrigin(),a=this.getTopRight(),l=this.getBottomRight(),c=this.getBottomLeft();o=S.rotateEx(o,i,s,t),a=S.rotateEx(a,i,s,t),l=S.rotateEx(l,i,s,t),c=S.rotateEx(c,i,s,t);const u=new B(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=B.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=B.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 Se.containsPoint(this,S.create(e,t))}containsRect(e,t,r,i){const s=B.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=S.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 q(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=B.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 B(u,h,Math.min(a.x,c.x)-u,Math.min(a.y,c.y)-h)}isIntersectWithRect(e,t,r,i){const s=B.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=B.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 B(a,l,c-a,u-l)}getNearestSideToPoint(e){const t=S.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=S.clone(e);if(this.containsPoint(t)){const r=this.getNearestSideToPoint(t);if(r==="left")return new S(this.x,t.y);if(r==="top")return new S(t.x,this.y);if(r==="right")return new S(this.x+this.width,t.y);if(r==="bottom")return new S(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 B(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})(B||(B={})),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}(B||(B={})),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}(B||(B={}));class q extends Ar{get center(){return new S((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 S(e,t),this.end=new S(r,i)):(this.start=S.create(e),this.end=S.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 S(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const e=new S(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 B(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 q(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 q(this.start,t),new q(t,this.end)]}divideAtLength(e){const t=this.pointAtLength(e);return[new q(this.start,t),new q(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 q(t,e).length()>i||new q(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 S(this.end.x-this.start.x,this.end.y-this.start.y),r=new S(e.end.x-e.start.x,e.end.y-e.start.y),i=t.x*r.y-t.y*r.x,s=new S(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 S(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=S.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=S.create(e,t);return this.closestPoint(r).squaredDistance(r)}pointDistance(e,t){const r=S.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 q(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 q(t,r);return s.translate(i.x-t.x,i.y-t.y),s}relativeCcw(e,t){const r=S.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 q(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})(q||(q={}));class vn extends Ar{get center(){return new S(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 B.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=S.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 S(this.x,this.y)),c=new S(a.x/(r*r),a.y/(i*i)),u=new S(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=S.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 S(this.x+h,this.y+f),t?o.rotate(-t,this.getCenter()):o}tangentTheta(e){const t=S.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 S(d,g).theta(t)}scale(e,t){return this.a*=e,this.b*=t,this}rotate(e,t){const r=B.fromEllipse(this);r.rotate(e,t);const i=vn.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=S.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 vn(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})(vn||(vn={})),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}(vn||(vn={}));const q$=new RegExp("^[\\s\\dLMCZz,.]*$");function V$(n){return typeof n!="string"?!1:q$.test(n)}function Th(n,e){return(n%e+e)%e}function G$(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 S(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[Th(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[Th(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[Th(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,P=h.y+x;s.push("Q",h.x,h.y,C,P),h=new S(C,P)}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 fw(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})}),G$(t,e.round,e.initialMove==null||e.initialMove,e.close,e.exclude)}function yl(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 X=1;s===o&&(X=-1),w=X*Math.sqrt((m*y-m*b-y*p)/(m*b+y*p))}const x=w*t*g/r,C=-1*w*r*d/t,P=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 L=T*2/Math.PI,V=Math.ceil(L<0?-1*L:L),Y=T/V,M=8/3*Math.sin(Y/4)*Math.sin(Y/4)/Math.sin(Y/2),I=h*t,J=h*r,j=f*t,F=f*r;let H=Math.cos(O),ne=Math.sin(O),Pe=-M*(I*ne+F*H),Yt=-M*(j*ne-J*H),N=0,$=0;const z=[];for(let X=0;X<V;X+=1){O+=Y,H=Math.cos(O),ne=Math.sin(O),N=I*H-F*ne+P,$=j*H+J*ne+E;const re=-M*(I*ne+F*H),ue=-M*(j*ne-J*H),Ce=X*6;z[Ce]=Number(Pe+n),z[Ce+1]=Number(Yt+e),z[Ce+2]=Number(N-re+n),z[Ce+3]=Number($-ue+e),z[Ce+4]=Number(N+n),z[Ce+5]=Number($+e),Pe=N+re,Yt=$+ue}return z.map(X=>+X.toFixed(2))}function H$(n,e,t,r,i=0,s=0,o=0,a,l){const c=[],u=yl(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 We extends Ar{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 We.parse(e);this.points=e.map(t=>S.create(t))}else this.points=[]}scale(e,t,r=new S){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=S.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 B;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 B(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 q(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=S.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 q(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 S(r+d,i),p=new q(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 q(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 q(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 q(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 q(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 q(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 We;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 We(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 We(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})(We||(We={})),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}(We||(We={}));class qe extends Ar{constructor(e,t,r,i){super(),this.PRECISION=3,this.start=S.create(e),this.controlPoint1=S.create(t),this.controlPoint2=S.create(r),this.end=S.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 I=0;I<2;I+=1){if(I===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 P,E,A,O=d.length;const T=O;for(;O;)O-=1,y=d[O],A=1-y,P=A*A*A*s+3*A*A*y*a+3*A*y*y*c+y*y*y*h,g[0][O]=P,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 L=Math.min.apply(null,g[0]),V=Math.min.apply(null,g[1]),Y=Math.max.apply(null,g[0]),M=Math.max.apply(null,g[1]);return new B(L,V,Y-L,M-V)}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),P=x[0].end.distance(e),E=C+P,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=P):(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 qe(t,t,t,t),new qe(t,r,i,s)];if(e>=1)return[new qe(t,r,i,s),new qe(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 qe(t,a,l,c),new qe(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 q(t,r).pointAt(e),a=new q(r,i).pointAt(e),l=new q(i,s).pointAt(e),c=new q(o,a).pointAt(e),u=new q(a,l).pointAt(e),h=new q(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 qe(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 q(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 We(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 qe(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})(qe||(qe={})),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=>S.clone(f)),o=[],a=[],l=s.length-1;if(l===1)return o[0]=new S((2*s[0].x+s[1].x)/3,(2*s[0].y+s[1].y)/3),a[0]=new S(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 S(u[f],h[f])),f<l-1?a.push(new S(2*s[f+1].x-u[f+1],2*s[f+1].y-h[f+1])):a.push(new S((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 S(s[0][a].x,s[0][a].y),u=new S(s[1][a].x,s[1][a].y);o.push(new n(i[a],c,u,i[a+1]))}return o}n.throughPoints=r}(qe||(qe={}));class vl extends Ar{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 vl{constructor(e,t){super(),q.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=S.create(e,t).round(2)}get type(){return"L"}get line(){return new q(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(q.isLine(i))return new n(i);if(S.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 as extends vl{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 q(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 as}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})(as||(as={}));class ls extends vl{constructor(e,t){super(),this.isVisible=!1,this.isSubpathStart=!0,q.isLine(e)||qe.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=S.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 ls(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(q.isLine(i))return new n(i);if(qe.isCurve(i))return new n(i);if(S.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})(ls||(ls={}));class tn extends vl{constructor(e,t,r,i,s,o){super(),qe.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 S(e,t).round(2),this.controlPoint2=new S(r,i).round(2),this.endPoint=new S(s,o).round(2)):(this.controlPoint1=S.create(e).round(2),this.controlPoint2=S.create(t).round(2),this.endPoint=S.create(r).round(2))}get type(){return"C"}get curve(){return new qe(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 tn(r[0]),new tn(r[1])]}divideAtLength(e,t={}){const r=this.curve.divideAtLength(e,t);return[new tn(r[0]),new tn(r[1])]}divideAtT(e){const t=this.curve.divideAtT(e);return[new tn(t[0]),new tn(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 tn(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(qe.isCurve(i))return new n(i);if(S.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})(tn||(tn={}));function bl(n,e,t){return{x:n*Math.cos(t)-e*Math.sin(t),y:n*Math.sin(t)+e*Math.cos(t)}}function dw(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 gw(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=bl(n,e,-h),n=d.x,e=d.y,d=bl(a,l,-h),a=d.x,l=d.y;const Y=(n-a)/2,M=(e-l)/2;let I=Y*Y/(t*t)+M*M/(r*r);I>1&&(I=Math.sqrt(I),t=I*t,r=I*r);const J=t*t,j=r*r,F=(s===o?-1:1)*Math.sqrt(Math.abs((J*j-J*M*M-j*Y*Y)/(J*M*M+j*Y*Y)));b=F*t*M/r+(n+a)/2,m=F*-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,I=l;p=g+u*(o&&p>g?1:-1),a=b+t*Math.cos(p),l=m+r*Math.sin(p),f=gw(a,l,t,r,i,0,o,M,I,[p,Y,b,m])}y=p-g;const v=Math.cos(g),w=Math.sin(g),x=Math.cos(p),C=Math.sin(p),P=Math.tan(y/4),E=4/3*(t*P),A=4/3*(r*P),O=[n,e],T=[n+E*w,e-A*v],L=[a+E*C,l-A*x],V=[a,l];if(T[0]=2*O[0]-T[0],T[1]=2*O[1]-T[1],c)return[T,L,V].concat(f);{f=[T,L,V].concat(f).join().split(",");const Y=[],M=f.length;for(let I=0;I<M;I+=1)Y[I]=I%2?bl(+f[I-1],+f[I],h).y:bl(+f[I],+f[I+1],h).x;return Y}}function U$(n){if(!n)return null;const e=`
4
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 W$(n){const e=U$(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 X$(n){const e=W$(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(gw.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(dw(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(dw(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 Y$(n){return X$(n).map(e=>e.map(t=>typeof t=="string"?t:Se.round(t,2))).join(",").split(",").join(" ")}class K extends Ar{constructor(e){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(e))if(q.isLine(e[0])||qe.isCurve(e[0])){let t=null;e.forEach((i,s)=>{s===0&&this.appendSegment(K.createSegment("M",i.start)),t!=null&&!t.end.equals(i.start)&&this.appendSegment(K.createSegment("M",i.start)),q.isLine(i)?this.appendSegment(K.createSegment("L",i.end)):qe.isCurve(i)&&this.appendSegment(K.createSegment("C",i.controlPoint1,i.controlPoint2,i.end)),t=i})}else e.forEach(r=>{r.isSegment&&this.appendSegment(r)});else e!=null&&(q.isLine(e)?(this.appendSegment(K.createSegment("M",e.start)),this.appendSegment(K.createSegment("L",e.end))):qe.isCurve(e)?(this.appendSegment(K.createSegment("M",e.start)),this.appendSegment(K.createSegment("C",e.controlPoint1,e.controlPoint2,e.end))):We.isPolyline(e)?e.points&&e.points.length&&e.points.forEach((t,r)=>{const i=r===0?K.createSegment("M",t):K.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(ls.create.call(null,...e))}lineTo(...e){return this.appendSegment(xt.create.call(null,...e))}curveTo(...e){return this.appendSegment(tn.create.call(null,...e))}arcTo(e,t,r,i,s,o,a){const l=this.end||new S,c=typeof o=="number"?yl(l.x,l.y,e,t,r,i,s,o,a):yl(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 S,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=K.parse(o.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(as.create())}drawPoints(e,t={}){const r=fw(e,t),i=K.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 B(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=Se.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=Se.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=Se.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=Se.clamp(e.value,0,1);return t[i].pointAtT(s)}divideAt(e,t={}){if(this.segments.length===0)return null;const r=Se.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 P=r?x:C-1-x,E=this.getSegment(P),A=s[P],O={precision:i,subdivisions:A},T=E.length(O);if(E.isDifferentiable()&&(c=E,u=P,e<=o+T)){l=P,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,K.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 P=this.getSegment(x-y),E=f.getSegment(x);if(E.type==="Z"&&!P.subpathStartSegment.end.equals(E.subpathStartSegment.end)){const A=K.createSegment("L",P.end);f.replaceSegment(x,A)}}const v=new K(f.segments.slice(0,p)),w=new K(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=Se.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=Se.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=Se.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 We(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 K;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})(K||(K={})),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 ls.create.call(null,...i);if(r==="L")return xt.create.call(null,...i);if(r==="C")return tn.create.call(null,...i);if(r==="z"||r==="Z")return as.create();throw new Error(`Invalid path segment type "${r}"`)}n.createSegment=t}(K||(K={})),function(n){n.normalize=Y$,n.isValid=V$,n.drawArc=H$,n.drawPoints=fw,n.arcToCurves=yl}(K||(K={}));class Xe{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&&!Zt.isApplyingHMR()&&this.onDuplicated(e);const i=this.options.process,s=i?Q(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&&Q(this.options.onConflict,this,e),new Error(`${Za(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} ${hB(this.options.type)}`:this.options.type;return`${Za(i)} with name '${e}' does not exist.${r?` Did you mean '${r}'?`:""}`}getSpellingSuggestionForName(e){return HB(e,Object.keys(this.data),t=>t)}}(function(n){function e(t){return new n(t)}n.create=e})(Xe||(Xe={}));const K$=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;ge(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",ge(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,ge(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;ge(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",ge(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}},Symbol.toStringTag,{value:"Module"}));class Tr{constructor(){this.patterns={},this.root=te.create(al(),{width:"100%",height:"100%"},[Jn("defs")]).node}add(e,t){const r=this.root.childNodes[0];r&&r.appendChild(t),this.patterns[e]=t,te.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=K$,n.registry=Xe.create({type:"grid"}),n.registry.register(n.presets,!0)})(Tr||(Tr={}));const pw=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},mw=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},yw=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},J$=Object.freeze(Object.defineProperty({__proto__:null,flipX:pw,flipXY:yw,flipY:mw,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=xe.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 No;(function(n){n.presets=Object.assign({},J$),n.presets["flip-x"]=pw,n.presets["flip-y"]=mw,n.presets["flip-xy"]=yw,n.registry=Xe.create({type:"background pattern"}),n.registry.register(n.presets,!0)})(No||(No={}));function Oh(n,e){return n!=null?n:e}function ct(n,e){return n!=null&&Number.isFinite(n)?n:e}function Q$(n={}){const e=Oh(n.color,"blue"),t=ct(n.width,1),r=ct(n.margin,2),i=ct(n.opacity,1),s=r,o=r+t;return`
5
5
  <filter>
6
6
  <feFlood flood-color="${e}" flood-opacity="${i}" result="colored"/>
@@ -79,7 +79,7 @@
79
79
  <feFuncB type="linear" slope="${e}" intercept="${t}"/>
80
80
  </feComponentTransfer>
81
81
  </filter>
82
- `.trim()}const cz=Object.freeze(Object.defineProperty({__proto__:null,blur:ez,brightness:az,contrast:lz,dropShadow:tz,grayScale:nz,highlight:Z$,hueRotate:sz,invert:oz,outline:Q$,saturate:iz,sepia:rz},Symbol.toStringTag,{value:"Module"}));var cs;(function(n){n.presets=cz,n.registry=Xe.create({type:"filter"}),n.registry.register(n.presets,!0)})(cs||(cs={}));const uz={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"},hz={},vw={position:wl("x","width","origin")},bw={position:wl("y","height","origin")},fz={position:wl("x","width","corner")},dz={position:wl("y","height","corner")},ww={set:Or("width","width")},xw={set:Or("height","height")},gz={set:Or("rx","width")},pz={set:Or("ry","height")},Cw={set:(n=>{const e=Or(n,"width"),t=Or(n,"height");return function(r,i){const s=i.refBBox,o=s.height>s.width?e:t;return Q(o,this,r,i)}})("r")},mz={set(n,{refBBox:e}){let t=parseFloat(n);const r=Kn(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}}},yz={set:Or("cx","width")},vz={set:Or("cy","height")},Sw={set:Aw({resetOffset:!0})},bz={set:Aw({resetOffset:!1})},Pw={set:Tw({resetOffset:!0})},wz={set:Tw({resetOffset:!1})},xz=Cw,Cz=Sw,Sz=Pw,Pz=vw,Ez=bw,Az=ww,Tz=xw;function wl(n,e,t){return(r,{refBBox:i})=>{if(r==null)return null;let s=parseFloat(r);const o=Kn(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 S;return l[n]=a||0,l}}function Or(n,e){return function(t,{refBBox:r}){let i=parseFloat(t);const s=Kn(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 Ew(n,e){const t="x6-shape",r=e&&e.resetOffset;return function(i,{elem:s,refBBox:o}){let a=mi(s,t);if(!a||a.value!==i){const p=n(i);a={value:i,shape:p,shapeBBox:p.bbox()},mi(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 Aw(n){function e(r){return K.parse(r)}const t=Ew(e,n);return(r,i)=>({d:t(r,i).serialize()})}function Tw(n){const e=Ew(t=>new We(t),n);return(t,r)=>({points:e(t,r).serialize()})}const Oz={qualify:In,set(n,{view:e}){return`url(#${e.graph.defineGradient(n)})`}},Mz={qualify:In,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)})`}},Ow={qualify(n,{attrs:e}){return e.textWrap==null||!In(e.textWrap)},set(n,{view:e,elem:t,attrs:r}){const i="x6-text",s=mi(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&&(dh(f),a.textPath=Object.assign({"xlink:href":`#${f.id}`},u))}}rw(t,`${n}`,a),mi(t,i,c)}}},_z={qualify:In,set(n,{view:e,elem:t,attrs:r,refBBox:i}){const s=n,o=s.width||0;Kn(o)?i.width*=parseFloat(o)/100:o<=0?i.width+=o:i.width=o;const a=s.height||0;Kn(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=y$(`${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="",Q(Ow.set,this,l,{view:e,elem:t,attrs:r,refBBox:i,cell:e.cell})}},us=(n,{attrs:e})=>e.text!==void 0,Nz={qualify:us},kz={qualify:us},Iz={qualify:us},Lz={qualify:us},Rz={qualify:us},jz={qualify:us},Dz={qualify(n,{elem:e}){return e instanceof SVGElement},set(n,{elem:e}){const t="x6-title",r=`${n}`,i=mi(e,t);if(i==null||i!==r){mi(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)}}}},Bz={offset:Mw("x","width","right")},$z={offset:Mw("y","height","bottom")},zz={offset(n,{refBBox:e}){return n?{x:-e.x,y:-e.y}:{x:0,y:0}}};function Mw(n,e,t){return(r,{refBBox:i})=>{const s=new S;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:Kn(r)?o=i[e]*parseFloat(r)/100:o=0,s[n]=-(i[n]+o),s}}const Fz={qualify:In,set(n,{elem:e}){ve(e,n)}},qz={set(n,{elem:e}){e.innerHTML=`${n}`}},Vz={qualify:In,set(n,{view:e}){return`url(#${e.graph.defineFilter(n)})`}},Gz={set(n){return n!=null&&typeof n=="object"&&n.id?n.id:n}};function Mr(n,e,t){let r,i;typeof e=="object"?(r=e.x,i=e.y):(r=e,i=t);const s=K.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 _w=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 Hz=n=>{var{size:e,width:t,height:r,offset:i,open:s}=n,o=_w(n,["size","width","height","offset","open"]);return Nw({size:e,width:t,height:r,offset:i},s===!0,!0,void 0,o)},Uz=n=>{var{size:e,width:t,height:r,offset:i,factor:s}=n,o=_w(n,["size","width","height","offset","factor"]);return Nw({size:e,width:t,height:r,offset:i},!1,!1,s,o)};function Nw(n,e,t,r=3/4,i={}){const s=n.size||10,o=n.width||s,a=n.height||s,l=new K,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=Qt(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:Mr(l.serialize(),{x:n.offset!=null?n.offset:-o/2})})}var Wz=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 Xz=n=>{var{size:e,width:t,height:r,offset:i}=n,s=Wz(n,["size","width","height","offset"]);const o=e||10,a=t||o,l=r||o,c=new K;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:Mr(c.serialize(),i==null?-a/2:i)})};var Yz=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 Kz=n=>{var{d:e,offsetX:t,offsetY:r}=n,i=Yz(n,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},i),{tagName:"path",d:Mr(e,t,r)})};var Jz=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 Qz=n=>{var{size:e,width:t,height:r,offset:i}=n,s=Jz(n,["size","width","height","offset"]);const o=e||10,a=t||o,l=r||o,c=new K;return c.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},s),{tagName:"path",fill:"none",d:Mr(c.serialize(),i||-a/2)})};var Zz=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 eF=n=>{var{width:e,height:t,offset:r,open:i,flip:s}=n,o=Zz(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 K;return f.moveTo(0,a).lineTo(l,0),c?h.fill="none":(f.lineTo(l,a),f.close()),h.d=Mr(f.serialize(),{x:r||-l/2,y:a/2}),h};var kw=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 Iw=n=>{var{r:e}=n,t=kw(n,["r"]);const r=e||5;return Object.assign(Object.assign({cx:r},t),{tagName:"circle",r})},tF=n=>{var{r:e}=n,t=kw(n,["r"]);const r=e||5,i=new K;return i.moveTo(r,0).lineTo(r,r*2),i.moveTo(0,r).lineTo(r*2,r),{children:[Object.assign(Object.assign({},Iw({r})),{fill:"none"}),Object.assign(Object.assign({},t),{tagName:"path",d:Mr(i.serialize(),-r)})]}};var nF=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 rF=Object.freeze(Object.defineProperty({__proto__:null,async:eF,block:Hz,circle:Iw,circlePlus:tF,classic:Uz,cross:Qz,diamond:Xz,ellipse:n=>{var{rx:e,ry:t}=n,r=nF(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:Kz},Symbol.toStringTag,{value:"Module"}));var _r;(function(n){n.presets=rF,n.registry=Xe.create({type:"marker"}),n.registry.register(n.presets,!0)})(_r||(_r={})),function(n){n.normalize=Mr}(_r||(_r={}));var iF=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 Mh(n){return typeof n=="string"||In(n)}const sF={qualify:Mh,set(n,{view:e,attrs:t}){return _h("marker-start",n,e,t)}},oF={qualify:Mh,set(n,{view:e,attrs:t}){return _h("marker-end",n,e,t,{transform:"rotate(180)"})}},aF={qualify:Mh,set(n,{view:e,attrs:t}){return _h("marker-mid",n,e,t)}};function _h(n,e,t,r,i={}){const s=typeof e=="string"?{name:e}:e,{name:o,args:a}=s,l=iF(s,["name","args"]);let c=l;if(o&&typeof o=="string"){const h=_r.registry.get(o);if(h)c=h(Object.assign(Object.assign({},l),a));else return _r.registry.onNotFound(o)}const u=Object.assign(Object.assign(Object.assign({},lF(r,n)),i),c);return{[n]:`url(#${t.graph.defineMarker(u)})`}}function lF(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 ko=(n,{view:e})=>e.cell.isEdge(),cF={qualify:ko,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()}}},Lw={qualify:ko,set:xl("getTangentAtLength",{rotate:!0})},uF={qualify:ko,set:xl("getTangentAtLength",{rotate:!1})},Rw={qualify:ko,set:xl("getTangentAtRatio",{rotate:!0})},hF={qualify:ko,set:xl("getTangentAtRatio",{rotate:!1})},fF=Lw,dF=Rw;function xl(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 gF=Object.freeze(Object.defineProperty({__proto__:null,annotations:Lz,atConnectionLength:fF,atConnectionLengthIgnoreGradient:uF,atConnectionLengthKeepGradient:Lw,atConnectionRatio:dF,atConnectionRatioIgnoreGradient:hF,atConnectionRatioKeepGradient:Rw,connection:cF,displayEmpty:jz,eol:Rz,fill:Oz,filter:Vz,html:qz,lineHeight:Nz,port:Gz,ref:hz,refCx:yz,refCy:vz,refD:Cz,refDKeepOffset:bz,refDResetOffset:Sw,refDx:fz,refDy:dz,refHeight:xw,refHeight2:Tz,refPoints:Sz,refPointsKeepOffset:wz,refPointsResetOffset:Pw,refR:xz,refRCircumscribed:mz,refRInscribed:Cw,refRx:gz,refRy:pz,refWidth:ww,refWidth2:Az,refX:vw,refX2:Pz,refY:bw,refY2:Ez,resetOffset:zz,sourceMarker:sF,stroke:Mz,style:Fz,targetMarker:oF,text:Ow,textPath:Iz,textVerticalAnchor:kz,textWrap:_z,title:Dz,vertexMarker:aF,xAlign:Bz,yAlign:$z},Symbol.toStringTag,{value:"Module"}));var Dn;(function(n){function e(t,r,i){return!!(t!=null&&(typeof t=="string"||typeof t.qualify!="function"||Q(t.qualify,this,r,i)))}n.isValidDefinition=e})(Dn||(Dn={})),function(n){n.presets=Object.assign(Object.assign({},uz),gF),n.registry=Xe.create({type:"attribute definition"}),n.registry.register(n.presets,!0)}(Dn||(Dn={}));const nn={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(n){return`${nn.prefixCls}-${n}`}},jw=nn.prefix("highlighted"),pF={highlight(n,e,t){const r=t&&t.className||jw;Z(e,r)},unhighlight(n,e,t){const r=t&&t.className||jw;gt(e,r)}},Dw=nn.prefix("highlight-opacity"),mF={highlight(n,e){Z(e,Dw)},unhighlight(n,e){gt(e,Dw)}};var pe;(function(n){const e=Jn("svg");n.normalizeMarker=Mr;function t(d,g){const p=O$(d.x,d.y).matrixTransform(g);return new S(p.x,p.y)}n.transformPoint=t;function r(d,g){return new q(t(d.start,g),t(d.end,g))}n.transformLine=r;function i(d,g){let p=d instanceof We?d.points:d;return Array.isArray(p)||(p=[]),new We(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),P=Math.max(b.y,m.y,y.y,v.y);return new B(w,C,x-w,P-C)}n.transformRectangle=s;function o(d,g,p){let b;const m=d.ownerSVGElement;if(!m)return new B(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 B.create(b);const y=So(d,p||m);return s(b,y)}n.bbox=o;function a(d,g={}){let p;if(!d.ownerSVGElement||!Pr(d)){if(H1(d)){const{left:v,top:w,width:x,height:C}=l(d);return new B(v,w,x,C)}return new B(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 B.create(p);const v=So(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 P;C.childNodes.length===0?P=a(C,{target:m}):P=a(C,{target:m,recursive:!0}),p?p=p.union(P):p=P}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(Z1(y,"borderLeft"),10),p+=parseInt(Z1(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 B(g("x"),g("y"),g("width"),g("height"));case"circle":return new vn(g("cx"),g("cy"),g("r"),g("r"));case"ellipse":return new vn(g("cx"),g("cy"),g("rx"),g("ry"));case"polyline":{const p=dl(d);return new We(p)}case"polygon":{const p=dl(d);return p.length>1&&p.push(p[0]),new We(p)}case"path":{let p=d.getAttribute("d");return K.isValid(p)||(p=K.normalize(p)),K.parse(p)}case"line":return new q(g("x1"),g("y1"),g("x2"),g("y2"))}return a(d)}n.toGeometryShape=c;function u(d,g,p,b){const m=S.create(g),y=S.create(p);b||(b=d instanceof SVGSVGElement?d:d.ownerSVGElement);const v=Ph(d);d.setAttribute("transform","");const w=a(d,{target:b}).scale(v.sx,v.sy),x=Co();x.setTranslate(-w.x-w.width/2,-w.y-w.height/2);const C=Co(),P=m.angleBetween(y,m.clone().translate(1,0));P&&C.setRotate(P,0,0);const E=Co(),A=m.clone().move(y,w.width/2);E.setTranslate(2*m.x-A.x,2*m.y-A.y);const O=So(d,b),T=Co();T.setMatrix(E.matrix.multiply(C.matrix.multiply(x.matrix.multiply(O.scale(v.sx,v.sy))))),d.setAttribute("transform",ss(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(),rs(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(!Pr(g)){if(H1(d)){const{left:y,top:v,width:w,height:x}=l(d);return new B(y,v,w,x)}return new B(0,0,0,0)}const b=c(g).bbox()||B.create(),m=g.getAttribute("transform");if(m){const y=is(m);return s(b,y)}return b}n.getBBoxV2=f})(pe||(pe={}));const yF={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},vF={highlight(n,e,t){const r=Nr.getHighlighterId(e,t);if(Nr.hasCache(r))return;t=o1({},t,yF);const i=te.create(e);let s,o;try{s=i.toPathData()}catch(u){o=pe.bbox(i.node,!0),s=ow(Object.assign(Object.assign({},t),o))}const a=Jn("path");if(ge(a,Object.assign({d:s,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},t.attrs?wo(t.attrs):null)),n.isEdgeElement(e))ge(a,"d",n.getConnectionPathData());else{let u=i.getTransformToElement(n.container);const h=t.padding;if(h){o==null&&(o=pe.bbox(i.node,!0));const f=o.x+o.width/2,d=o.y+o.height/2;o=pe.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=lt({a:b,b:0,c:0,d:m,e:f-b*f,f:d-m*d});u=u.multiply(y)}os(a,u)}Z(a,nn.prefix("highlight-stroke"));const l=n.cell,c=()=>Nr.removeHighlighter(r);l.on("removed",c),l.model&&l.model.on("reseted",c),n.container.appendChild(a),Nr.setCache(r,a)},unhighlight(n,e,t){Nr.removeHighlighter(Nr.getHighlighterId(e,t))}};var Nr;(function(n){function e(o,a){return dh(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&&(Qn(a),delete t[o])}n.removeHighlighter=s})(Nr||(Nr={}));const bF=Object.freeze(Object.defineProperty({__proto__:null,className:pF,opacity:mF,stroke:vF},Symbol.toStringTag,{value:"Module"}));var tr;(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})(tr||(tr={})),function(n){n.presets=bF,n.registry=Xe.create({type:"highlighter"}),n.registry.register(n.presets,!0)}(tr||(tr={}));function Nh(n,e={}){return new S(Ft(e.x,n.width),Ft(e.y,n.height))}function kh(n,e,t){return Object.assign({angle:e,position:n.toJSON()},t)}const wF=(n,e)=>n.map(({x:t,y:r,angle:i})=>kh(Nh(e,{x:t,y:r}),i||0)),xF=(n,e,t)=>{const r=t.start||0,i=t.step||20;return Bw(n,e,r,(s,o)=>(s+.5-o/2)*i)},CF=(n,e,t)=>{const r=t.start||0,i=t.step||360/n.length;return Bw(n,e,r,s=>s*i)};function Bw(n,e,t,r){const i=e.getCenter(),s=e.getTopCenter(),o=e.width/e.height,a=vn.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),kh(f.round(),d,c)})}var SF=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 PF=(n,e,t)=>{const r=Nh(e,t.start||e.getOrigin()),i=Nh(e,t.end||e.getCorner());return Io(n,r,i,t)},EF=(n,e,t)=>Io(n,e.getTopLeft(),e.getBottomLeft(),t),AF=(n,e,t)=>Io(n,e.getTopRight(),e.getBottomRight(),t),TF=(n,e,t)=>Io(n,e.getTopLeft(),e.getTopRight(),t),OF=(n,e,t)=>Io(n,e.getBottomLeft(),e.getBottomRight(),t);function Io(n,e,t,r){const i=new q(e,t),s=n.length;return n.map((o,a)=>{var{strict:l}=o,c=SF(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),kh(h.round(),0,c)})}const MF=Object.freeze(Object.defineProperty({__proto__:null,absolute:wF,bottom:OF,ellipse:xF,ellipseSpread:CF,left:EF,line:PF,right:AF,top:TF},Symbol.toStringTag,{value:"Module"}));var wi;(function(n){n.presets=MF,n.registry=Xe.create({type:"port layout"}),n.registry.register(n.presets,!0)})(wi||(wi={}));const _F={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function kr(n,e){const{x:t,y:r,angle:i,attrs:s}=e||{};return o1({},{angle:i,attrs:s,position:{x:t,y:r}},n,_F)}const NF=(n,e,t)=>kr({position:e.getTopLeft()},t),kF=(n,e,t)=>kr({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},t),IF=(n,e,t)=>kr({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},t),LF=(n,e,t)=>kr({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},t),RF=(n,e,t)=>kr({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},t),jF=(n,e,t)=>$w(n,e,!1,t),DF=(n,e,t)=>$w(n,e,!0,t),BF=(n,e,t)=>zw(n,e,!1,t),$F=(n,e,t)=>zw(n,e,!0,t);function $w(n,e,t,r){const i=r.offset!=null?r.offset:15,s=e.getCenter().theta(n),o=Fw(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"),kr({position:{x:Math.round(l),y:Math.round(c)},angle:h,attrs:{".":{y:a,"text-anchor":u}}},r)}function zw(n,e,t,r){const i=r.offset!=null?r.offset:15,s=e.getCenter().theta(n),o=Fw(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"),kr({position:{x:Math.round(l),y:Math.round(c)},angle:h,attrs:{".":{y:a,"text-anchor":u}}},r)}function Fw(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 zF=(n,e,t)=>qw(n.diff(e.getCenter()),!1,t),FF=(n,e,t)=>qw(n.diff(e.getCenter()),!0,t);function qw(n,e,t){const r=t.offset!=null?t.offset:20,i=new S(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",kr({position:o.round().toJSON(),angle:e?c:0,attrs:{".":{y:a,"text-anchor":l}}},t)}const qF=Object.freeze(Object.defineProperty({__proto__:null,bottom:RF,inside:BF,insideOriented:$F,left:kF,manual:NF,outside:jF,outsideOriented:DF,radial:zF,radialOriented:FF,right:IF,top:LF},Symbol.toStringTag,{value:"Module"}));var hs;(function(n){n.presets=qF,n.registry=Xe.create({type:"port label layout"}),n.registry.register(n.presets,!0)})(hs||(hs={}));class me extends wt{get priority(){return 2}constructor(){super(),this.cid=Ih.uniqueId(),me.views[this.cid]=this}confirmUpdate(e,t){return 0}empty(e=this.container){return vo(e),this}unmount(e=this.container){return Qn(e),this}remove(e=this.container){return e===this.container&&(this.removeEventListeners(document),this.onRemove(),delete me.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 Z(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 ve(t,e),this}setAttrs(e,t=this.container){return e!=null&&t!=null&&ge(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 me.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=ph(e)+1;r=`${e.tagName.toLowerCase()}:nth-child(${i})`,t&&(r+=` > ${t}`),r=this.getSelector(e.parentNode,r)}return r}prefixClassName(e){return nn.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 Ae.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 Ae.on(this.container,e+this.getEventNamespace(),t,r),this}undelegateEvent(e,t,r){const i=e+this.getEventNamespace();return t==null?Ae.off(this.container,i):typeof t=="string"?Ae.off(this.container,i,t,r):Ae.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"&&Ae.on(e,s+i,r,o)}),this}removeEventListeners(e){return e!=null&&Ae.off(e,this.getEventNamespace()),this}getEventNamespace(){return`.${nn.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 me.normalizeEvent(e)}}(function(n){function e(i,s){return s?Jn(i||"g"):gh(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})(me||(me={})),function(n){n.views={};function e(t){return n.views[t]||null}n.getView=e}(me||(me={}));var Ih;(function(n){let e=0;function t(){const r=`v${e}`;return e+=1,r}n.uniqueId=t})(Ih||(Ih={}));class VF{constructor(e){this.view=e,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new Ah,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=I$(e,r)}return lt(t.matrix)}getShape(e){const t=this.get(e);return t.shape==null&&(t.shape=pe.toGeometryShape(e)),t.shape.clone()}getBoundingRect(e){const t=this.get(e);return t.boundingRect==null&&(t.boundingRect=pe.getBBoxV2(e)),t.boundingRect.clone()}}var Te;(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:Fe(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:at.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||at.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?gh(w,b):F1(w),C=v.attrs;C&&ge(x,wo(C));const P=v.style;P&&ve(x,P);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(L=>{f[L]||(f[L]=[]),f[L].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?Jn("g"):F1("div")}function a(c){if(t(c)){const d=te.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=te.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})(Te||(Te={})),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=ph(t)+1;s=`${o}:nth-child(${l})`}else s=o;return i&&(s+=` > ${i}`),e(t.parentNode,r,s)}return i}n.getSelector=e}(Te||(Te={})),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}(Te||(Te={})),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}(Te||(Te={})),function(n){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:at.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:at.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}n.getForeignObjectMarkup=e}(Te||(Te={}));class Vw{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=Q(Dn.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=U1.includes(l)?l:C1(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 Ah;return Object.keys(e).forEach(a=>{const l=e[a];if(!In(l))return;const{isCSSSelector:c,elems:u}=me.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=TB(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)=>Re(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=Q(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=is(h),d=new S(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=Q(y.position,this.view,m,c());v!=null&&(g=!0,d.translate(S.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=pe.transformRectangle(b,f);Object.keys(l).forEach(y=>{const v=l[y],w=this.getDefinition(y);if(w!=null){const x=Q(w.offset,this.view,v,{elem:e,cell:this.cell,view:this.view,attrs:i,refBBox:m});x!=null&&(p=!0,d.translate(S.create(x)))}})}}(u!=null||g||p)&&(d.round(1),f.e=d.x,f.f=d.y,e.setAttribute("transform",ss(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 Ah;let c;a.forEach(u=>{const h=u.node,f=u.refNode;let d;const g=f!=null&&r.rotatableNode!=null&&V1(r.rotatableNode,f);if(f&&(d=l.get(f)),!d){const m=g?r.rotatableNode:e;d=f?pe.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=is(ge(r.rotatableNode,"transform"))),b=pe.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 GF=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 nt extends me{static getDefaults(){return this.defaults}static config(e){this.defaults=this.getOptions(e)}static getOptions(e){const t=(c,u)=>u!=null?p1([...Array.isArray(c)?c:[c],...Array.isArray(u)?u:[u]]):Array.isArray(c)?[...c]:[c],r=Fe(this.getDefaults()),{bootstrap:i,actions:s,events:o,documentEvents:a}=e,l=GF(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)),Re(r,l)}get[Symbol.toStringTag](){return nt.toStringTag}constructor(e,t={}){super(),this.cell=e,this.options=this.ensureOptions(t),this.graph=this.options.graph,this.attr=new Vw(this),this.flag=new Gw(this,this.options.actions,this.options.bootstrap),this.cache=new VF(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 me.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=Te.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=Q(t,this.graph,this)),typeof t=="object"){let r=t[e];return typeof r=="function"&&(r=Q(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 pe.transformRectangle(t,s.multiply(i).multiply(r))}getUnrotatedBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),r=this.getMatrixOfElement(e),i=this.getRootTranslatedMatrix();return pe.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 lt().translate(t.x,t.y)}getRootRotatedMatrix(){let e=lt();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 B),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=Ze.isToolsView(e)?e:new Ze(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))}}nt.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},function(n){n.Flag=Gw,n.Attr=Vw}(nt||(nt={})),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}(nt||(nt={})),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}(nt||(nt={})),function(n){n.registry=Xe.create({type:"view"})}(nt||(nt={}));class Ze extends me{get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return Ze.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?me.createElement("g",!0):me.createElement("div",!1);return Z(r,this.prefixClassName("cell-tools")),t.className&&Z(r,t.className),r}config(e){if(this.options=Object.assign(Object.assign({},this.options),e),!nt.isCellView(e.view)||e.view===this.cellView)return this;this.cellView=e.view,this.cell.isEdge()?(Z(this.svgContainer,this.prefixClassName("edge-tools")),Z(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(Z(this.svgContainer,this.prefixClassName("node-tools")),Z(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=>{Ze.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(Ze.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=ds.registry.get(a);if(c)o=new c(l);else return ds.registry.onNotFound(a)}else if(this.cell.isEdge()){const c=gs.registry.get(a);if(c)o=new c(l);else return gs.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),Qn(this.svgContainer),Qn(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})(Ze||(Ze={})),function(n){class e extends me{static getDefaults(){return this.defaults}static config(r){this.defaults=this.getOptions(r)}static getOptions(r){return Re(Fe(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=me.createElement(this.options.tagName||"g",this.options.isSVGElement!==!1),Z(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&Z(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()?Z(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&Z(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=Te.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?ah(o):(r+=1,`CustomTool${r}`)}function s(o){const a=sh(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={}))}(Ze||(Ze={}));const HF=n=>n;function Hw(n,e){return e===0?"0%":`${Math.round(n/e*100)}%`}function Uw(n){return(t,r,i,s)=>r.isEdgeElement(i)?WF(n,t,r,i,s):UF(n,t,r,i,s)}function UF(n,e,t,r,i){const s=t.cell,o=s.getAngle(),a=t.getUnrotatedBBoxOfElement(r),l=s.getBBox().getCenter(),c=S.create(i).rotate(o,l);let u=c.x-a.x,h=c.y-a.y;return n&&(u=Hw(u,a.width),h=Hw(h,a.height)),e.anchor={name:"topLeft",args:{dx:u,dy:h,rotate:!0}},e}function WF(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 XF=Uw(!0),YF=Uw(!1),KF=Object.freeze(Object.defineProperty({__proto__:null,noop:HF,pinAbsolute:YF,pinRelative:XF},Symbol.toStringTag,{value:"Module"}));var Lh;(function(n){n.presets=KF,n.registry=Xe.create({type:"connection strategy"}),n.registry.register(n.presets,!0)})(Lh||(Lh={}));function Ww(n,e,t,r){return Q(Lh.presets.pinRelative,this.graph,{},e,t,n,this.cell,r,{}).anchor}function Xw(n,e){return e?n.cell.getBBox():n.cell.isEdge()?n.getConnection().bbox():n.getUnrotatedBBoxOfElement(n.container)}class Ir extends Ze.ToolItem{onRender(){Z(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();os(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=Xw(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=Ft(r,l.width),i=Ft(i,l.height);let f=lt().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=Ft(i,1);c>=0&&c<=1?o=e.getTangentAtRatio(c):o=e.getTangentAtLength(c),o?(a=o.start,l=o.vector().vectorAngle(new S(1,0))||0):(a=e.getConnection().start,l=0);let u=lt().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"&&Q(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 JF=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 Cl extends Ze.ToolItem{onRender(){if(Z(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const e=this.options.attrs,{class:t}=e,r=JF(e,["class"]);ge(this.container,wo(r)),t&&Z(this.container,t)}this.update()}update(){const e=this.cellView,t=this.options,{useCellGeometry:r,rotate:i}=t,s=Ln(t.padding);let o=Xw(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();Sh(this.container,l,c.x,c.y,{absolute:!0})}else o=o.bbox(l)}return ge(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"}})})(Cl||(Cl={}));class Lo extends Ze.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:S.create(i),next:S.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?er.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 me{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=me.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})(Lo||(Lo={})),function(n){const e=nn.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"}})}(Lo||(Lo={}));class Ro extends Ze.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){Z(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=Fe(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=Q(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,P=!1;if(p?l===d.length-2?x.containsPoint(p)?(d.pop(),C=!0):(p[a]=f[a],P=!0):p[a]=f[a]:(p=s.targetAnchor.toJSON(),p[a]=f[a],x.containsPoint(p)?C=!0:(d.push(p),P=!0)),typeof o=="function"&&w){if(C){const E=c.targetAnchor.clone();E[a]=f[a];const A=Q(o,s,E,w,s.targetMagnet||w.container,"target",s,this);this.resetAnchor("target",A)}P&&this.resetAnchor("target",c.targetAnchorDef)}S.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:Fe(this.cell.prop(["source","anchor"])),targetAnchorDef:Fe(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 q(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 S(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 me{constructor(r){super(),this.options=r,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=me.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 S(r,i))||new S(r,i);let l=lt().translate(a.x,a.y);if(a.equals({x:r,y:i}))l=l.rotate(s);else{let u=new q(r,i,a.x,a.y).vector().vectorAngle(new S(1,0));u!==0&&(u+=90),l=l.rotate(u)}this.setAttrs({transform:ss(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})(Ro||(Ro={})),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:Ww})}(Ro||(Ro={}));class Sl extends Ze.ToolItem{get type(){return this.options.type}onRender(){Z(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),ge(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=Q(c,r,l,i,a,t,r,this);l=S.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=Q(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:Ww,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}})})(Sl||(Sl={}));const QF=Sl.define({name:"source-anchor",type:"source"}),ZF=Sl.define({name:"target-anchor",type:"target"});var e3=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 Pl extends Ze.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=e3(e,["class"]);this.setAttrs(r,this.container),t&&Z(this.container,t)}}onRender(){Z(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 S(1,0))||0;if(!i)return this;const o=lt().translate(i.x,i.y).rotate(s);return os(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"}})})(Pl||(Pl={}));const t3=Pl.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"}}),n3=Pl.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 fs extends Ze.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=Ze.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=S.create(),s=20,o="",{x:a,y:l}=this.options;if(typeof a!="undefined"&&typeof l!="undefined"){const h=t.getBBox();a=Ft(a,h.width),l=Ft(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=S.create(),i=20;const{style:s}=t,o=this.event.target,a=o.parentElement;if(a&&rs(a,this.prefixClassName("edge-label"))){const u=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(u,10);const h=a.getAttribute("transform"),{translation:f}=pl(h);r=new S(f.tx,f.ty),i=pe.getBBox(o).width}else{if(!this.options.labelAddable)return this;r=e.clientToLocal(S.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 Q(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"){Q(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:{}};es(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"}})})(fs||(fs={})),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"})}(fs||(fs={}));var Yw=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},ds;(function(n){n.presets={boundary:Cl,button:Ir,"button-remove":Ir.Remove,"node-editor":fs.NodeEditor},n.registry=Xe.create({type:"node tool",process(e,t){if(typeof t=="function")return t;let r=Ze.ToolItem;const{inherit:i}=t,s=Yw(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)})(ds||(ds={}));var gs;(function(n){n.presets={boundary:Cl,vertices:Lo,segments:Ro,button:Ir,"button-remove":Ir.Remove,"source-anchor":QF,"target-anchor":ZF,"source-arrowhead":t3,"target-arrowhead":n3,"edge-editor":fs.EdgeEditor},n.registry=Xe.create({type:"edge tool",process(e,t){if(typeof t=="function")return t;let r=Ze.ToolItem;const{inherit:i}=t,s=Yw(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)})(gs||(gs={}));const r3=nr("center"),i3=nr("topCenter"),s3=nr("bottomCenter"),o3=nr("leftMiddle"),a3=nr("rightMiddle"),l3=nr("topLeft"),c3=nr("topRight"),u3=nr("bottomLeft"),h3=nr("bottomRight");function nr(n){return function(e,t,r,i={}){const s=i.rotate?e.getUnrotatedBBoxOfElement(t):e.getBBoxOfElement(t),o=s[n];o.x+=Ft(i.dx,s.width),o.y+=Ft(i.dy,s.height);const a=e.cell;return i.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function El(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=Kw(s,a)}else o=s.getBBoxOfElement(r).getCenter();else o=new S;return n.call(this,e,t,o,i)}return n.apply(this,arguments)}}function Kw(n,e){const t=Kn(e),r=typeof e=="string"?parseFloat(e):e;return t?n.getPointAtRatio(r/100):n.getPointAtLength(r)}const f3=El(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(xe.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(xe.toRad(i)),o.x+=u}return o}),d3=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},g3=El(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}),p3=Object.freeze(Object.defineProperty({__proto__:null,bottom:s3,bottomLeft:u3,bottomRight:h3,center:r3,left:o3,midSide:g3,nodeCenter:d3,orth:f3,right:a3,top:i3,topLeft:l3,topRight:c3},Symbol.toStringTag,{value:"Module"}));var ps;(function(n){n.presets=p3,n.registry=Xe.create({type:"node endpoint"}),n.registry.register(n.presets,!0)})(ps||(ps={}));const m3=function(n,e,t,r){let i=r.ratio!=null?r.ratio:.5;return i>1&&(i/=100),n.getPointAtRatio(i)},y3=function(n,e,t,r){const i=r.length!=null?r.length:20;return n.getPointAtLength(i)},Jw=function(n,e,t,r){const i=n.getClosestPoint(t);return i!=null?i:new S},v3=El(Jw),b3=El(function(n,e,t,r){const s=n.getConnection(),o=n.getConnectionSubdivisions(),a=new q(t.clone().translate(0,1e6),t.clone().translate(0,-1e6)),l=new q(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?Kw(n,r.fallbackAt):Q(Jw,this,n,e,t,r)}),w3=Object.freeze(Object.defineProperty({__proto__:null,closest:v3,length:y3,orth:b3,ratio:m3},Symbol.toStringTag,{value:"Module"}));var ms;(function(n){n.presets=w3,n.registry=Xe.create({type:"edge endpoint"}),n.registry.register(n.presets,!0)})(ms||(ms={}));function Al(n,e,t){let r;if(typeof t=="object"){if(Number.isFinite(t.y)){const s=new q(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 Tl(n){const e=n.getAttribute("stroke-width");return e===null?0:parseFloat(e)||0}function x3(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 Qw=function(n,e,t,r){const i=e.getBBoxOfElement(t);r.stroked&&i.inflate(Tl(t)/2);const s=n.intersect(i),o=s&&s.length?n.start.closest(s):n.end;return Al(o,n.start,r.offset)},C3=function(n,e,t,r,i){const s=e.cell,o=s.isNode()?s.getAngle():0;if(o===0)return Q(Qw,this,n,e,t,r,i);const a=e.getUnrotatedBBoxOfElement(t);r.stroked&&a.inflate(Tl(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 Al(h,n.start,r.offset)},S3=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=oh(t,a):i=x3(t),!Pr(i)){if(i===t||!Pr(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=pe.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(K.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&&(B.isRectangle(l)?s=l.getNearestPointToPoint(p):vn.isEllipse(l)?s=l.intersectsWithLineFromCenterToPoint(p):s=l.closestPoint(p,m));const y=s?pe.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+=Tl(i)/2):v+=Tl(i)/2),Al(y,n.start,v)};function P3(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 E3=Object.freeze(Object.defineProperty({__proto__:null,anchor:function(n,e,t,r){const{alignOffset:i,align:s}=r;return s&&P3(n,s,i),Al(n.end,n.start,r.offset)},bbox:Qw,boundary:S3,rect:C3},Symbol.toStringTag,{value:"Module"}));var ys;(function(n){n.presets=E3,n.registry=Xe.create({type:"connection point"}),n.registry.register(n.presets,!0)})(ys||(ys={}));const A3=function(n){return[...n]},T3=function(n,e,t){const r=e.side||"bottom",i=Ln(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 Ol(n){return new B(n.x,n.y,0,0)}function Ml(n={}){const e=Ln(n.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function Zw(n,e={}){return n.sourceBBox.clone().moveAndExpand(Ml(e))}function ex(n,e={}){return n.targetBBox.clone().moveAndExpand(Ml(e))}function O3(n,e={}){return n.sourceAnchor?n.sourceAnchor:Zw(n,e).getCenter()}function M3(n,e={}){return n.targetAnchor?n.targetAnchor:ex(n,e).getCenter()}const tx=function(n,e,t){let r=Zw(t,e),i=ex(t,e);const s=O3(t,e),o=M3(t,e);r=r.union(Ol(s)),i=i.union(Ol(o));const a=n.map(u=>S.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=rn.getBearing(d,g)!=null;if(u===0)u+1===h?r.intersectsWithRect(i.clone().inflate(1))?f=rn.insideNode(d,g,r,i):p||(f=rn.nodeToNode(d,g,r,i)):r.containsPoint(g)?f=rn.insideNode(d,g,r,Ol(g).moveAndExpand(Ml(e))):p||(f=rn.nodeToVertex(d,g,r));else if(u+1===h){const b=p&&rn.getBearing(g,d)===l;i.containsPoint(d)||b?f=rn.insideNode(d,g,Ol(d).moveAndExpand(Ml(e)),i,l):p||(f=rn.vertexToNode(d,g,i,l))}else p||(f=rn.vertexToVertex(d,g,l));f?(c.push(...f.points),l=f.direction):l=rn.getBearing(d,g),u+1<h&&c.push(g)}return c};var rn;(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 S(h.x,f.y);return d.containsPoint(g)&&(g=new S(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 S(h.x,f.y),p=new S(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 S(h.x,f.y),new S(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=KD(p,b)[0];const v=S.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=S.create(h).move(m,-i(d,s(h,m))/2),v=S.create(f).move(b,-i(g,s(f,b))/2),w=new q(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,P;p?(x=S.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=S.fromPolar(b.width+b.height,xe.toRad(x.theta(v))+Math.PI/2,w),C=b.getNearestPointToPoint(C).move(w,1).round(),P=r(x,C,b),E=y?[C,P,x]:[x,P,C]):E=y?[C,x]:[x,C];const A=s(y?x:C,f);return{points:E,direction:A}}n.insideNode=u})(rn||(rn={}));const _3={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:tx,draggingRouter:null,snapToGrid:!0};function Lr(n,e){return typeof n=="function"?n.call(e):n}function N3(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=Ln(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 S(0,0),i=new S(t.offsetX,t.offsetY);t.angle=xe.normalize(r.theta(i))}),e}const nx=1,rx=2;class k3{constructor(){this.items=[],this.hash={},this.values={}}add(e,t){this.hash[e]?this.items.splice(this.items.indexOf(e),1):this.hash[e]=nx,this.values[e]=t;const r=OB(this.items,e,i=>this.values[i]);this.items.splice(r,0,e)}pop(){const e=this.items.shift();return e&&(this.hash[e]=rx),e}isOpen(e){return this.hash[e]===nx}isClose(e){return this.hash[e]===rx}isEmpty(){return this.items.length===0}}class I3{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=g1(s,o.getAncestors().map(c=>c.id)));const a=e.getCell(t.getTargetCellId());a&&(s=g1(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 S(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 ix(n,e){const t=n.sourceBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function sx(n,e){const t=n.targetBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function ox(n,e){return n.sourceAnchor?n.sourceAnchor:ix(n,e).getCenter()}function L3(n,e){return n.targetAnchor?n.targetAnchor:sx(n,e).getCenter()}function Rh(n,e,t,r,i){const s=360/t,o=n.theta(R3(n,e,r,i)),a=xe.normalize(o+s/2);return s*Math.floor(a/s)}function R3(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 S(n.x+c,n.y+u)}function ax(n,e){const t=Math.abs(n-e);return t>180?360-t:t}function j3(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 D3(n,e,t){return{source:e.clone(),x:lx(t.x-e.x,n),y:lx(t.y-e.y,n)}}function lx(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 B3(n,e){const t=e.source,r=Se.snapToGrid(n.x-t.x,e.x)+t.x,i=Se.snapToGrid(n.y-t.y,e.y)+t.y;return new S(r,i)}function jo(n,e){return n.round(e)}function _l(n,e,t){return jo(B3(n.clone(),e),t)}function Do(n){return n.toString()}function jh(n){return new S(n.x===0?0:Math.abs(n.x)/n.x,n.y===0?0:Math.abs(n.y)/n.y)}function cx(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 ux(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 S(n.x+h.x*(Math.abs(a.x)+e.width),n.y+h.y*(Math.abs(a.y)+e.height)),g=new q(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=_l(b,r,s);e.containsPoint(m)&&(m=_l(m.translate(h.x*r.x,h.y*r.y),r,s)),c.push(m)}}return c},[]);return e.containsPoint(n)||l.push(_l(n,r,s)),l}function $3(n,e,t,r,i){const s=[];let o=jh(i.diff(t)),a=Do(t),l=n[a],c;for(;l;){c=e[a];const f=jh(c.diff(l));f.equals(o)||(s.unshift(c),o=f),a=Do(l),l=n[a]}const u=e[a];return jh(u.diff(r)).equals(o)||s.unshift(u),s}function z3(n,e,t,r,i){const s=i.precision;let o,a;B.isRectangle(e)?o=jo(ox(n,i).clone(),s):o=jo(e.clone(),s),B.isRectangle(t)?a=jo(L3(n,i).clone(),s):a=jo(t.clone(),s);const l=D3(i.step,o,a),c=o,u=a;let h,f;if(B.isRectangle(e)?h=ux(c,e,i.startDirections,l,i):h=[c],B.isRectangle(t)?f=ux(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 k3,g={},p={},b={};for(let O=0,T=h.length;O<T;O+=1){const L=h[O],V=Do(L);d.add(V,cx(L,f)),g[V]=L,b[V]=0}const m=i.previousDirectionAngle,y=m===void 0;let v,w;const x=j3(l,i),C=x.length,P=f.reduce((O,T)=>{const L=Do(T);return O.push(L),O},[]),E=S.equalPoints(h,f);let A=i.maxLoopCount;for(;!d.isEmpty()&&A>0;){const O=d.pop(),T=g[O],L=p[O],V=b[O],Y=T.equals(c),M=L==null;let I;if(M?y?Y?I=null:I=Rh(c,T,C,l,i):I=m:I=Rh(L,T,C,l,i),!(M&&E)&&P.indexOf(O)>=0)return i.previousDirectionAngle=I,$3(p,g,T,c,u);for(let R=0;R<C;R+=1){v=x[R];const F=v.angle;if(w=ax(I,F),!(y&&Y)&&w>i.maxDirectionChange)continue;const H=_l(T.clone().translate(v.gridOffsetX||0,v.gridOffsetY||0),l,s),ne=Do(H);if(d.isClose(ne)||!r.isAccessible(H))continue;if(P.indexOf(ne)>=0&&!H.equals(u)){const z=Rh(H,u,C,l,i);if(ax(F,z)>i.maxDirectionChange)continue}const Pe=v.cost,Yt=Y?0:i.penalties[w],N=V+Pe+Yt;(!d.isOpen(ne)||N<b[ne])&&(g[ne]=H,p[ne]=T,b[ne]=N,d.add(ne,N+cx(H,f)))}A-=1}}return i.fallbackRoute?Q(i.fallbackRoute,this,c,u,i):null}function F3(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 q3=function(n,e,t){const r=N3(e),i=ix(t,r),s=sx(t,r),o=ox(t,r),a=new I3(r).build(t.graph.model,t.cell),l=n.map(d=>S.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=Q(r.draggingRouter,t,v,w,r)}}if(p==null&&(p=z3(t,h,f,a,r)),p===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),Q(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?F3(c,t.graph.grid.getGridSize()):c},hx=function(n,e,t){return Q(q3,this,n,Object.assign(Object.assign({},_3),e),t)},V3={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 q(n,a),c=90*Math.ceil(r/90),u=S.fromPolar(l.squaredLength(),xe.toRad(c+135),a),h=new q(e,u),f=l.intersectsWithLine(h),d=f||e,g=f?d:n,p=360/t.directions.length,b=g.theta(e),m=xe.normalize(b+p/2),y=p*Math.floor(m/p);return t.previousDirectionAngle=y,d&&i.push(d.round()),i.push(e),i}},G3=function(n,e,t){return Q(hx,this,n,Object.assign(Object.assign({},V3),e),t)},H3=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 vs(n,e){if(e!=null&&e!==!1){const t=typeof e=="boolean"?0:e;if(t>0){const r=S.create(n[1]).move(n[2],t),i=S.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 U3=Object.freeze(Object.defineProperty({__proto__:null,er:H3,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=xe.toRad(m),v=Math.sin(y),w=Math.cos(y),x=new S(a.x+w*r,a.y+v*r),C=new S(x.x-w*s,x.y-v*s),P=C.clone().rotate(-90,x),E=C.clone().rotate(90,x);return[P.toJSON(),x.toJSON(),E.toJSON()]},f=m=>{const y=a.clone().move(m,-1),v=new q(y,m);return!c.containsPoint(m)&&!c.intersectsWithLine(v)},d=[0,90,180,270,45,135,225,315];if(typeof o=="number")return vs(h(o),e.merge);const g=c.getCenter();if(g.equals(a))return vs(h(0),e.merge);const p=g.angleBetween(a,g.clone().translate(1,0));let b=h(p);if(f(b[1]))return vs(b,e.merge);for(let m=1,y=d.length;m<y;m+=1)if(b=h(p+d[m]),f(b[1]))return vs(b,e.merge);return vs(b,e.merge)}{const h=new q(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 q(b.start,d),y=new q(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 q(a,l),w=new q(d,v.center).setLength(Number.MAX_SAFE_INTEGER),x=c.intersectsWithLine(w),C=u.intersectsWithLine(w),P=x?Array.isArray(x)?x:[x]:[];C&&(Array.isArray(C)?P.push(...C):P.push(C));const E=v.center.closest(P);E?(t.sourceAnchor=E.clone(),t.targetAnchor=E.clone()):(t.sourceAnchor=v.center.clone(),t.targetAnchor=v.center.clone())}return vs([g.toJSON(),d.toJSON(),p.toJSON()],e.merge)}},manhattan:hx,metro:G3,normal:A3,oneSide:T3,orth:tx},Symbol.toStringTag,{value:"Module"}));var Rr;(function(n){n.presets=U3,n.registry=Xe.create({type:"router"}),n.registry.register(n.presets,!0)})(Rr||(Rr={}));const W3=function(n,e,t,r={}){const i=[n,...t,e],s=new We(i),o=new K(s);return r.raw?o:o.serialize()},X3=function(n,e,t,r={}){const i=t.length===3?0:1,s=S.create(t[0+i]),o=S.create(t[2+i]),a=S.create(t[1+i]);if(!S.equals(n,e)){const c=new S((n.x+e.x)/2,(n.y+e.y)/2),u=c.angleBetween(S.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 cz=Object.freeze(Object.defineProperty({__proto__:null,blur:ez,brightness:az,contrast:lz,dropShadow:tz,grayScale:nz,highlight:Z$,hueRotate:sz,invert:oz,outline:Q$,saturate:iz,sepia:rz},Symbol.toStringTag,{value:"Module"}));var cs;(function(n){n.presets=cz,n.registry=Xe.create({type:"filter"}),n.registry.register(n.presets,!0)})(cs||(cs={}));const uz={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"},hz={},vw={position:wl("x","width","origin")},bw={position:wl("y","height","origin")},fz={position:wl("x","width","corner")},dz={position:wl("y","height","corner")},ww={set:Or("width","width")},xw={set:Or("height","height")},gz={set:Or("rx","width")},pz={set:Or("ry","height")},Cw={set:(n=>{const e=Or(n,"width"),t=Or(n,"height");return function(r,i){const s=i.refBBox,o=s.height>s.width?e:t;return Q(o,this,r,i)}})("r")},mz={set(n,{refBBox:e}){let t=parseFloat(n);const r=Kn(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}}},yz={set:Or("cx","width")},vz={set:Or("cy","height")},Sw={set:Aw({resetOffset:!0})},bz={set:Aw({resetOffset:!1})},Pw={set:Tw({resetOffset:!0})},wz={set:Tw({resetOffset:!1})},xz=Cw,Cz=Sw,Sz=Pw,Pz=vw,Ez=bw,Az=ww,Tz=xw;function wl(n,e,t){return(r,{refBBox:i})=>{if(r==null)return null;let s=parseFloat(r);const o=Kn(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 S;return l[n]=a||0,l}}function Or(n,e){return function(t,{refBBox:r}){let i=parseFloat(t);const s=Kn(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 Ew(n,e){const t="x6-shape",r=e&&e.resetOffset;return function(i,{elem:s,refBBox:o}){let a=mi(s,t);if(!a||a.value!==i){const p=n(i);a={value:i,shape:p,shapeBBox:p.bbox()},mi(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 Aw(n){function e(r){return K.parse(r)}const t=Ew(e,n);return(r,i)=>({d:t(r,i).serialize()})}function Tw(n){const e=Ew(t=>new We(t),n);return(t,r)=>({points:e(t,r).serialize()})}const Oz={qualify:In,set(n,{view:e}){return`url(#${e.graph.defineGradient(n)})`}},Mz={qualify:In,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)})`}},Ow={qualify(n,{attrs:e}){return e.textWrap==null||!In(e.textWrap)},set(n,{view:e,elem:t,attrs:r}){const i="x6-text",s=mi(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&&(dh(f),a.textPath=Object.assign({"xlink:href":`#${f.id}`},u))}}rw(t,`${n}`,a),mi(t,i,c)}}},_z={qualify:In,set(n,{view:e,elem:t,attrs:r,refBBox:i}){const s=n,o=s.width||0;Kn(o)?i.width*=parseFloat(o)/100:o<=0?i.width+=o:i.width=o;const a=s.height||0;Kn(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=y$(`${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="",Q(Ow.set,this,l,{view:e,elem:t,attrs:r,refBBox:i,cell:e.cell})}},us=(n,{attrs:e})=>e.text!==void 0,Nz={qualify:us},kz={qualify:us},Iz={qualify:us},Lz={qualify:us},Rz={qualify:us},jz={qualify:us},Dz={qualify(n,{elem:e}){return e instanceof SVGElement},set(n,{elem:e}){const t="x6-title",r=`${n}`,i=mi(e,t);if(i==null||i!==r){mi(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)}}}},Bz={offset:Mw("x","width","right")},$z={offset:Mw("y","height","bottom")},zz={offset(n,{refBBox:e}){return n?{x:-e.x,y:-e.y}:{x:0,y:0}}};function Mw(n,e,t){return(r,{refBBox:i})=>{const s=new S;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:Kn(r)?o=i[e]*parseFloat(r)/100:o=0,s[n]=-(i[n]+o),s}}const Fz={qualify:In,set(n,{elem:e}){ve(e,n)}},qz={set(n,{elem:e}){e.innerHTML=`${n}`}},Vz={qualify:In,set(n,{view:e}){return`url(#${e.graph.defineFilter(n)})`}},Gz={set(n){return n!=null&&typeof n=="object"&&n.id?n.id:n}};function Mr(n,e,t){let r,i;typeof e=="object"?(r=e.x,i=e.y):(r=e,i=t);const s=K.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 _w=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 Hz=n=>{var{size:e,width:t,height:r,offset:i,open:s}=n,o=_w(n,["size","width","height","offset","open"]);return Nw({size:e,width:t,height:r,offset:i},s===!0,!0,void 0,o)},Uz=n=>{var{size:e,width:t,height:r,offset:i,factor:s}=n,o=_w(n,["size","width","height","offset","factor"]);return Nw({size:e,width:t,height:r,offset:i},!1,!1,s,o)};function Nw(n,e,t,r=3/4,i={}){const s=n.size||10,o=n.width||s,a=n.height||s,l=new K,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=Qt(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:Mr(l.serialize(),{x:n.offset!=null?n.offset:-o/2})})}var Wz=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 Xz=n=>{var{size:e,width:t,height:r,offset:i}=n,s=Wz(n,["size","width","height","offset"]);const o=e||10,a=t||o,l=r||o,c=new K;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:Mr(c.serialize(),i==null?-a/2:i)})};var Yz=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 Kz=n=>{var{d:e,offsetX:t,offsetY:r}=n,i=Yz(n,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},i),{tagName:"path",d:Mr(e,t,r)})};var Jz=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 Qz=n=>{var{size:e,width:t,height:r,offset:i}=n,s=Jz(n,["size","width","height","offset"]);const o=e||10,a=t||o,l=r||o,c=new K;return c.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},s),{tagName:"path",fill:"none",d:Mr(c.serialize(),i||-a/2)})};var Zz=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 eF=n=>{var{width:e,height:t,offset:r,open:i,flip:s}=n,o=Zz(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 K;return f.moveTo(0,a).lineTo(l,0),c?h.fill="none":(f.lineTo(l,a),f.close()),h.d=Mr(f.serialize(),{x:r||-l/2,y:a/2}),h};var kw=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 Iw=n=>{var{r:e}=n,t=kw(n,["r"]);const r=e||5;return Object.assign(Object.assign({cx:r},t),{tagName:"circle",r})},tF=n=>{var{r:e}=n,t=kw(n,["r"]);const r=e||5,i=new K;return i.moveTo(r,0).lineTo(r,r*2),i.moveTo(0,r).lineTo(r*2,r),{children:[Object.assign(Object.assign({},Iw({r})),{fill:"none"}),Object.assign(Object.assign({},t),{tagName:"path",d:Mr(i.serialize(),-r)})]}};var nF=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 rF=Object.freeze(Object.defineProperty({__proto__:null,async:eF,block:Hz,circle:Iw,circlePlus:tF,classic:Uz,cross:Qz,diamond:Xz,ellipse:n=>{var{rx:e,ry:t}=n,r=nF(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:Kz},Symbol.toStringTag,{value:"Module"}));var _r;(function(n){n.presets=rF,n.registry=Xe.create({type:"marker"}),n.registry.register(n.presets,!0)})(_r||(_r={})),function(n){n.normalize=Mr}(_r||(_r={}));var iF=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 Mh(n){return typeof n=="string"||In(n)}const sF={qualify:Mh,set(n,{view:e,attrs:t}){return _h("marker-start",n,e,t)}},oF={qualify:Mh,set(n,{view:e,attrs:t}){return _h("marker-end",n,e,t,{transform:"rotate(180)"})}},aF={qualify:Mh,set(n,{view:e,attrs:t}){return _h("marker-mid",n,e,t)}};function _h(n,e,t,r,i={}){const s=typeof e=="string"?{name:e}:e,{name:o,args:a}=s,l=iF(s,["name","args"]);let c=l;if(o&&typeof o=="string"){const h=_r.registry.get(o);if(h)c=h(Object.assign(Object.assign({},l),a));else return _r.registry.onNotFound(o)}const u=Object.assign(Object.assign(Object.assign({},lF(r,n)),i),c);return{[n]:`url(#${t.graph.defineMarker(u)})`}}function lF(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 ko=(n,{view:e})=>e.cell.isEdge(),cF={qualify:ko,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()}}},Lw={qualify:ko,set:xl("getTangentAtLength",{rotate:!0})},uF={qualify:ko,set:xl("getTangentAtLength",{rotate:!1})},Rw={qualify:ko,set:xl("getTangentAtRatio",{rotate:!0})},hF={qualify:ko,set:xl("getTangentAtRatio",{rotate:!1})},fF=Lw,dF=Rw;function xl(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 gF=Object.freeze(Object.defineProperty({__proto__:null,annotations:Lz,atConnectionLength:fF,atConnectionLengthIgnoreGradient:uF,atConnectionLengthKeepGradient:Lw,atConnectionRatio:dF,atConnectionRatioIgnoreGradient:hF,atConnectionRatioKeepGradient:Rw,connection:cF,displayEmpty:jz,eol:Rz,fill:Oz,filter:Vz,html:qz,lineHeight:Nz,port:Gz,ref:hz,refCx:yz,refCy:vz,refD:Cz,refDKeepOffset:bz,refDResetOffset:Sw,refDx:fz,refDy:dz,refHeight:xw,refHeight2:Tz,refPoints:Sz,refPointsKeepOffset:wz,refPointsResetOffset:Pw,refR:xz,refRCircumscribed:mz,refRInscribed:Cw,refRx:gz,refRy:pz,refWidth:ww,refWidth2:Az,refX:vw,refX2:Pz,refY:bw,refY2:Ez,resetOffset:zz,sourceMarker:sF,stroke:Mz,style:Fz,targetMarker:oF,text:Ow,textPath:Iz,textVerticalAnchor:kz,textWrap:_z,title:Dz,vertexMarker:aF,xAlign:Bz,yAlign:$z},Symbol.toStringTag,{value:"Module"}));var Dn;(function(n){function e(t,r,i){return!!(t!=null&&(typeof t=="string"||typeof t.qualify!="function"||Q(t.qualify,this,r,i)))}n.isValidDefinition=e})(Dn||(Dn={})),function(n){n.presets=Object.assign(Object.assign({},uz),gF),n.registry=Xe.create({type:"attribute definition"}),n.registry.register(n.presets,!0)}(Dn||(Dn={}));const nn={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(n){return`${nn.prefixCls}-${n}`}},jw=nn.prefix("highlighted"),pF={highlight(n,e,t){const r=t&&t.className||jw;Z(e,r)},unhighlight(n,e,t){const r=t&&t.className||jw;gt(e,r)}},Dw=nn.prefix("highlight-opacity"),mF={highlight(n,e){Z(e,Dw)},unhighlight(n,e){gt(e,Dw)}};var pe;(function(n){const e=Jn("svg");n.normalizeMarker=Mr;function t(d,g){const p=O$(d.x,d.y).matrixTransform(g);return new S(p.x,p.y)}n.transformPoint=t;function r(d,g){return new q(t(d.start,g),t(d.end,g))}n.transformLine=r;function i(d,g){let p=d instanceof We?d.points:d;return Array.isArray(p)||(p=[]),new We(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),P=Math.max(b.y,m.y,y.y,v.y);return new B(w,C,x-w,P-C)}n.transformRectangle=s;function o(d,g,p){let b;const m=d.ownerSVGElement;if(!m)return new B(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 B.create(b);const y=So(d,p||m);return s(b,y)}n.bbox=o;function a(d,g={}){let p;if(!d.ownerSVGElement||!Pr(d)){if(H1(d)){const{left:v,top:w,width:x,height:C}=l(d);return new B(v,w,x,C)}return new B(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 B.create(p);const v=So(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 P;C.childNodes.length===0?P=a(C,{target:m}):P=a(C,{target:m,recursive:!0}),p?p=p.union(P):p=P}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(Z1(y,"borderLeft"),10),p+=parseInt(Z1(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 B(g("x"),g("y"),g("width"),g("height"));case"circle":return new vn(g("cx"),g("cy"),g("r"),g("r"));case"ellipse":return new vn(g("cx"),g("cy"),g("rx"),g("ry"));case"polyline":{const p=dl(d);return new We(p)}case"polygon":{const p=dl(d);return p.length>1&&p.push(p[0]),new We(p)}case"path":{let p=d.getAttribute("d");return K.isValid(p)||(p=K.normalize(p)),K.parse(p)}case"line":return new q(g("x1"),g("y1"),g("x2"),g("y2"))}return a(d)}n.toGeometryShape=c;function u(d,g,p,b){const m=S.create(g),y=S.create(p);b||(b=d instanceof SVGSVGElement?d:d.ownerSVGElement);const v=Ph(d);d.setAttribute("transform","");const w=a(d,{target:b}).scale(v.sx,v.sy),x=Co();x.setTranslate(-w.x-w.width/2,-w.y-w.height/2);const C=Co(),P=m.angleBetween(y,m.clone().translate(1,0));P&&C.setRotate(P,0,0);const E=Co(),A=m.clone().move(y,w.width/2);E.setTranslate(2*m.x-A.x,2*m.y-A.y);const O=So(d,b),T=Co();T.setMatrix(E.matrix.multiply(C.matrix.multiply(x.matrix.multiply(O.scale(v.sx,v.sy))))),d.setAttribute("transform",ss(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(),rs(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(!Pr(g)){if(H1(d)){const{left:y,top:v,width:w,height:x}=l(d);return new B(y,v,w,x)}return new B(0,0,0,0)}const b=c(g).bbox()||B.create(),m=g.getAttribute("transform");if(m){const y=is(m);return s(b,y)}return b}n.getBBoxV2=f})(pe||(pe={}));const yF={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},vF={highlight(n,e,t){const r=Nr.getHighlighterId(e,t);if(Nr.hasCache(r))return;t=o1({},t,yF);const i=te.create(e);let s,o;try{s=i.toPathData()}catch(u){o=pe.bbox(i.node,!0),s=ow(Object.assign(Object.assign({},t),o))}const a=Jn("path");if(ge(a,Object.assign({d:s,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},t.attrs?wo(t.attrs):null)),n.isEdgeElement(e))ge(a,"d",n.getConnectionPathData());else{let u=i.getTransformToElement(n.container);const h=t.padding;if(h){o==null&&(o=pe.bbox(i.node,!0));const f=o.x+o.width/2,d=o.y+o.height/2;o=pe.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=lt({a:b,b:0,c:0,d:m,e:f-b*f,f:d-m*d});u=u.multiply(y)}os(a,u)}Z(a,nn.prefix("highlight-stroke"));const l=n.cell,c=()=>Nr.removeHighlighter(r);l.on("removed",c),l.model&&l.model.on("reseted",c),n.container.appendChild(a),Nr.setCache(r,a)},unhighlight(n,e,t){Nr.removeHighlighter(Nr.getHighlighterId(e,t))}};var Nr;(function(n){function e(o,a){return dh(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&&(Qn(a),delete t[o])}n.removeHighlighter=s})(Nr||(Nr={}));const bF=Object.freeze(Object.defineProperty({__proto__:null,className:pF,opacity:mF,stroke:vF},Symbol.toStringTag,{value:"Module"}));var tr;(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})(tr||(tr={})),function(n){n.presets=bF,n.registry=Xe.create({type:"highlighter"}),n.registry.register(n.presets,!0)}(tr||(tr={}));function Nh(n,e={}){return new S(Ft(e.x,n.width),Ft(e.y,n.height))}function kh(n,e,t){return Object.assign({angle:e,position:n.toJSON()},t)}const wF=(n,e)=>n.map(({x:t,y:r,angle:i})=>kh(Nh(e,{x:t,y:r}),i||0)),xF=(n,e,t)=>{const r=t.start||0,i=t.step||20;return Bw(n,e,r,(s,o)=>(s+.5-o/2)*i)},CF=(n,e,t)=>{const r=t.start||0,i=t.step||360/n.length;return Bw(n,e,r,s=>s*i)};function Bw(n,e,t,r){const i=e.getCenter(),s=e.getTopCenter(),o=e.width/e.height,a=vn.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),kh(f.round(),d,c)})}var SF=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 PF=(n,e,t)=>{const r=Nh(e,t.start||e.getOrigin()),i=Nh(e,t.end||e.getCorner());return Io(n,r,i,t)},EF=(n,e,t)=>Io(n,e.getTopLeft(),e.getBottomLeft(),t),AF=(n,e,t)=>Io(n,e.getTopRight(),e.getBottomRight(),t),TF=(n,e,t)=>Io(n,e.getTopLeft(),e.getTopRight(),t),OF=(n,e,t)=>Io(n,e.getBottomLeft(),e.getBottomRight(),t);function Io(n,e,t,r){const i=new q(e,t),s=n.length;return n.map((o,a)=>{var{strict:l}=o,c=SF(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),kh(h.round(),0,c)})}const MF=Object.freeze(Object.defineProperty({__proto__:null,absolute:wF,bottom:OF,ellipse:xF,ellipseSpread:CF,left:EF,line:PF,right:AF,top:TF},Symbol.toStringTag,{value:"Module"}));var wi;(function(n){n.presets=MF,n.registry=Xe.create({type:"port layout"}),n.registry.register(n.presets,!0)})(wi||(wi={}));const _F={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function kr(n,e){const{x:t,y:r,angle:i,attrs:s}=e||{};return o1({},{angle:i,attrs:s,position:{x:t,y:r}},n,_F)}const NF=(n,e,t)=>kr({position:e.getTopLeft()},t),kF=(n,e,t)=>kr({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},t),IF=(n,e,t)=>kr({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},t),LF=(n,e,t)=>kr({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},t),RF=(n,e,t)=>kr({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},t),jF=(n,e,t)=>$w(n,e,!1,t),DF=(n,e,t)=>$w(n,e,!0,t),BF=(n,e,t)=>zw(n,e,!1,t),$F=(n,e,t)=>zw(n,e,!0,t);function $w(n,e,t,r){const i=r.offset!=null?r.offset:15,s=e.getCenter().theta(n),o=Fw(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"),kr({position:{x:Math.round(l),y:Math.round(c)},angle:h,attrs:{".":{y:a,"text-anchor":u}}},r)}function zw(n,e,t,r){const i=r.offset!=null?r.offset:15,s=e.getCenter().theta(n),o=Fw(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"),kr({position:{x:Math.round(l),y:Math.round(c)},angle:h,attrs:{".":{y:a,"text-anchor":u}}},r)}function Fw(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 zF=(n,e,t)=>qw(n.diff(e.getCenter()),!1,t),FF=(n,e,t)=>qw(n.diff(e.getCenter()),!0,t);function qw(n,e,t){const r=t.offset!=null?t.offset:20,i=new S(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",kr({position:o.round().toJSON(),angle:e?c:0,attrs:{".":{y:a,"text-anchor":l}}},t)}const qF=Object.freeze(Object.defineProperty({__proto__:null,bottom:RF,inside:BF,insideOriented:$F,left:kF,manual:NF,outside:jF,outsideOriented:DF,radial:zF,radialOriented:FF,right:IF,top:LF},Symbol.toStringTag,{value:"Module"}));var hs;(function(n){n.presets=qF,n.registry=Xe.create({type:"port label layout"}),n.registry.register(n.presets,!0)})(hs||(hs={}));class me extends wt{get priority(){return 2}constructor(){super(),this.cid=Ih.uniqueId(),me.views[this.cid]=this}confirmUpdate(e,t){return 0}empty(e=this.container){return vo(e),this}unmount(e=this.container){return Qn(e),this}remove(e=this.container){return e===this.container&&(this.removeEventListeners(document),this.onRemove(),delete me.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 Z(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 ve(t,e),this}setAttrs(e,t=this.container){return e!=null&&t!=null&&ge(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 me.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=ph(e)+1;r=`${e.tagName.toLowerCase()}:nth-child(${i})`,t&&(r+=` > ${t}`),r=this.getSelector(e.parentNode,r)}return r}prefixClassName(e){return nn.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 Ae.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 Ae.on(this.container,e+this.getEventNamespace(),t,r),this}undelegateEvent(e,t,r){const i=e+this.getEventNamespace();return t==null?Ae.off(this.container,i):typeof t=="string"?Ae.off(this.container,i,t,r):Ae.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"&&Ae.on(e,s+i,r,o)}),this}removeEventListeners(e){return e!=null&&Ae.off(e,this.getEventNamespace()),this}getEventNamespace(){return`.${nn.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 me.normalizeEvent(e)}}(function(n){function e(i,s){return s?Jn(i||"g"):gh(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})(me||(me={})),function(n){n.views={};function e(t){return n.views[t]||null}n.getView=e}(me||(me={}));var Ih;(function(n){let e=0;function t(){const r=`v${e}`;return e+=1,r}n.uniqueId=t})(Ih||(Ih={}));class VF{constructor(e){this.view=e,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new Ah,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=I$(e,r)}return lt(t.matrix)}getShape(e){const t=this.get(e);return t.shape==null&&(t.shape=pe.toGeometryShape(e)),t.shape.clone()}getBoundingRect(e){const t=this.get(e);return t.boundingRect==null&&(t.boundingRect=pe.getBBoxV2(e)),t.boundingRect.clone()}}var Te;(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:Fe(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:at.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||at.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?gh(w,b):F1(w),C=v.attrs;C&&ge(x,wo(C));const P=v.style;P&&ve(x,P);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(L=>{f[L]||(f[L]=[]),f[L].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?Jn("g"):F1("div")}function a(c){if(t(c)){const d=te.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=te.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})(Te||(Te={})),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=ph(t)+1;s=`${o}:nth-child(${l})`}else s=o;return i&&(s+=` > ${i}`),e(t.parentNode,r,s)}return i}n.getSelector=e}(Te||(Te={})),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}(Te||(Te={})),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}(Te||(Te={})),function(n){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:at.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:at.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}n.getForeignObjectMarkup=e}(Te||(Te={}));class Vw{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=Q(Dn.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=U1.includes(l)?l:C1(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 Ah;return Object.keys(e).forEach(a=>{const l=e[a];if(!In(l))return;const{isCSSSelector:c,elems:u}=me.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=TB(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)=>Re(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=Q(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=is(h),d=new S(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=Q(y.position,this.view,m,c());v!=null&&(g=!0,d.translate(S.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=pe.transformRectangle(b,f);Object.keys(l).forEach(y=>{const v=l[y],w=this.getDefinition(y);if(w!=null){const x=Q(w.offset,this.view,v,{elem:e,cell:this.cell,view:this.view,attrs:i,refBBox:m});x!=null&&(p=!0,d.translate(S.create(x)))}})}}(u!=null||g||p)&&(d.round(1),f.e=d.x,f.f=d.y,e.setAttribute("transform",ss(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 Ah;let c;a.forEach(u=>{const h=u.node,f=u.refNode;let d;const g=f!=null&&r.rotatableNode!=null&&V1(r.rotatableNode,f);if(f&&(d=l.get(f)),!d){const m=g?r.rotatableNode:e;d=f?pe.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=is(ge(r.rotatableNode,"transform"))),b=pe.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 GF=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 nt extends me{static getDefaults(){return this.defaults}static config(e){this.defaults=this.getOptions(e)}static getOptions(e){const t=(c,u)=>u!=null?p1([...Array.isArray(c)?c:[c],...Array.isArray(u)?u:[u]]):Array.isArray(c)?[...c]:[c],r=Fe(this.getDefaults()),{bootstrap:i,actions:s,events:o,documentEvents:a}=e,l=GF(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)),Re(r,l)}get[Symbol.toStringTag](){return nt.toStringTag}constructor(e,t={}){super(),this.cell=e,this.options=this.ensureOptions(t),this.graph=this.options.graph,this.attr=new Vw(this),this.flag=new Gw(this,this.options.actions,this.options.bootstrap),this.cache=new VF(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 me.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=Te.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=Q(t,this.graph,this)),typeof t=="object"){let r=t[e];return typeof r=="function"&&(r=Q(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 pe.transformRectangle(t,s.multiply(i).multiply(r))}getUnrotatedBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),r=this.getMatrixOfElement(e),i=this.getRootTranslatedMatrix();return pe.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 lt().translate(t.x,t.y)}getRootRotatedMatrix(){let e=lt();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 B),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=Ze.isToolsView(e)?e:new Ze(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))}}nt.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},function(n){n.Flag=Gw,n.Attr=Vw}(nt||(nt={})),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}(nt||(nt={})),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}(nt||(nt={})),function(n){n.registry=Xe.create({type:"view"})}(nt||(nt={}));class Ze extends me{get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return Ze.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?me.createElement("g",!0):me.createElement("div",!1);return Z(r,this.prefixClassName("cell-tools")),t.className&&Z(r,t.className),r}config(e){if(this.options=Object.assign(Object.assign({},this.options),e),!nt.isCellView(e.view)||e.view===this.cellView)return this;this.cellView=e.view,this.cell.isEdge()?(Z(this.svgContainer,this.prefixClassName("edge-tools")),Z(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(Z(this.svgContainer,this.prefixClassName("node-tools")),Z(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=>{Ze.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(Ze.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=ds.registry.get(a);if(c)o=new c(l);else return ds.registry.onNotFound(a)}else if(this.cell.isEdge()){const c=gs.registry.get(a);if(c)o=new c(l);else return gs.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),Qn(this.svgContainer),Qn(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})(Ze||(Ze={})),function(n){class e extends me{static getDefaults(){return this.defaults}static config(r){this.defaults=this.getOptions(r)}static getOptions(r){return Re(Fe(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=me.createElement(this.options.tagName||"g",this.options.isSVGElement!==!1),Z(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&Z(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()?Z(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&Z(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=Te.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?ah(o):(r+=1,`CustomTool${r}`)}function s(o){const a=sh(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={}))}(Ze||(Ze={}));const HF=n=>n;function Hw(n,e){return e===0?"0%":`${Math.round(n/e*100)}%`}function Uw(n){return(t,r,i,s)=>r.isEdgeElement(i)?WF(n,t,r,i,s):UF(n,t,r,i,s)}function UF(n,e,t,r,i){const s=t.cell,o=s.getAngle(),a=t.getUnrotatedBBoxOfElement(r),l=s.getBBox().getCenter(),c=S.create(i).rotate(o,l);let u=c.x-a.x,h=c.y-a.y;return n&&(u=Hw(u,a.width),h=Hw(h,a.height)),e.anchor={name:"topLeft",args:{dx:u,dy:h,rotate:!0}},e}function WF(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 XF=Uw(!0),YF=Uw(!1),KF=Object.freeze(Object.defineProperty({__proto__:null,noop:HF,pinAbsolute:YF,pinRelative:XF},Symbol.toStringTag,{value:"Module"}));var Lh;(function(n){n.presets=KF,n.registry=Xe.create({type:"connection strategy"}),n.registry.register(n.presets,!0)})(Lh||(Lh={}));function Ww(n,e,t,r){return Q(Lh.presets.pinRelative,this.graph,{},e,t,n,this.cell,r,{}).anchor}function Xw(n,e){return e?n.cell.getBBox():n.cell.isEdge()?n.getConnection().bbox():n.getUnrotatedBBoxOfElement(n.container)}class Ir extends Ze.ToolItem{onRender(){Z(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();os(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=Xw(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=Ft(r,l.width),i=Ft(i,l.height);let f=lt().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=Ft(i,1);c>=0&&c<=1?o=e.getTangentAtRatio(c):o=e.getTangentAtLength(c),o?(a=o.start,l=o.vector().vectorAngle(new S(1,0))||0):(a=e.getConnection().start,l=0);let u=lt().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"&&Q(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 JF=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 Cl extends Ze.ToolItem{onRender(){if(Z(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const e=this.options.attrs,{class:t}=e,r=JF(e,["class"]);ge(this.container,wo(r)),t&&Z(this.container,t)}this.update()}update(){const e=this.cellView,t=this.options,{useCellGeometry:r,rotate:i}=t,s=Ln(t.padding);let o=Xw(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();Sh(this.container,l,c.x,c.y,{absolute:!0})}else o=o.bbox(l)}return ge(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"}})})(Cl||(Cl={}));class Lo extends Ze.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:S.create(i),next:S.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?er.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 me{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=me.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})(Lo||(Lo={})),function(n){const e=nn.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"}})}(Lo||(Lo={}));class Ro extends Ze.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){Z(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=Fe(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=Q(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,P=!1;if(p?l===d.length-2?x.containsPoint(p)?(d.pop(),C=!0):(p[a]=f[a],P=!0):p[a]=f[a]:(p=s.targetAnchor.toJSON(),p[a]=f[a],x.containsPoint(p)?C=!0:(d.push(p),P=!0)),typeof o=="function"&&w){if(C){const E=c.targetAnchor.clone();E[a]=f[a];const A=Q(o,s,E,w,s.targetMagnet||w.container,"target",s,this);this.resetAnchor("target",A)}P&&this.resetAnchor("target",c.targetAnchorDef)}S.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:Fe(this.cell.prop(["source","anchor"])),targetAnchorDef:Fe(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 q(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 S(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 me{constructor(r){super(),this.options=r,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=me.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 S(r,i))||new S(r,i);let l=lt().translate(a.x,a.y);if(a.equals({x:r,y:i}))l=l.rotate(s);else{let u=new q(r,i,a.x,a.y).vector().vectorAngle(new S(1,0));u!==0&&(u+=90),l=l.rotate(u)}this.setAttrs({transform:ss(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})(Ro||(Ro={})),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:Ww})}(Ro||(Ro={}));class Sl extends Ze.ToolItem{get type(){return this.options.type}onRender(){Z(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),ge(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=Q(c,r,l,i,a,t,r,this);l=S.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=Q(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:Ww,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}})})(Sl||(Sl={}));const QF=Sl.define({name:"source-anchor",type:"source"}),ZF=Sl.define({name:"target-anchor",type:"target"});var e3=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 Pl extends Ze.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=e3(e,["class"]);this.setAttrs(r,this.container),t&&Z(this.container,t)}}onRender(){Z(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 S(1,0))||0;if(!i)return this;const o=lt().translate(i.x,i.y).rotate(s);return os(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"}})})(Pl||(Pl={}));const t3=Pl.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"}}),n3=Pl.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 fs extends Ze.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=Ze.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=S.create(),s=20,o="",{x:a,y:l}=this.options;if(typeof a!="undefined"&&typeof l!="undefined"){const h=t.getBBox();a=Ft(a,h.width),l=Ft(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=S.create(),i=20;const{style:s}=t,o=this.event.target,a=o.parentElement;if(a&&rs(a,this.prefixClassName("edge-label"))){const u=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(u,10);const h=a.getAttribute("transform"),{translation:f}=pl(h);r=new S(f.tx,f.ty),i=pe.getBBox(o).width}else{if(!this.options.labelAddable)return this;r=e.clientToLocal(S.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 Q(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"){Q(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:{}};es(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"}})})(fs||(fs={})),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"})}(fs||(fs={}));var Yw=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},ds;(function(n){n.presets={boundary:Cl,button:Ir,"button-remove":Ir.Remove,"node-editor":fs.NodeEditor},n.registry=Xe.create({type:"node tool",process(e,t){if(typeof t=="function")return t;let r=Ze.ToolItem;const{inherit:i}=t,s=Yw(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)})(ds||(ds={}));var gs;(function(n){n.presets={boundary:Cl,vertices:Lo,segments:Ro,button:Ir,"button-remove":Ir.Remove,"source-anchor":QF,"target-anchor":ZF,"source-arrowhead":t3,"target-arrowhead":n3,"edge-editor":fs.EdgeEditor},n.registry=Xe.create({type:"edge tool",process(e,t){if(typeof t=="function")return t;let r=Ze.ToolItem;const{inherit:i}=t,s=Yw(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)})(gs||(gs={}));const r3=nr("center"),i3=nr("topCenter"),s3=nr("bottomCenter"),o3=nr("leftMiddle"),a3=nr("rightMiddle"),l3=nr("topLeft"),c3=nr("topRight"),u3=nr("bottomLeft"),h3=nr("bottomRight");function nr(n){return function(e,t,r,i={}){const s=i.rotate?e.getUnrotatedBBoxOfElement(t):e.getBBoxOfElement(t),o=s[n];o.x+=Ft(i.dx,s.width),o.y+=Ft(i.dy,s.height);const a=e.cell;return i.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function El(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=Kw(s,a)}else o=s.getBBoxOfElement(r).getCenter();else o=new S;return n.call(this,e,t,o,i)}return n.apply(this,arguments)}}function Kw(n,e){const t=Kn(e),r=typeof e=="string"?parseFloat(e):e;return t?n.getPointAtRatio(r/100):n.getPointAtLength(r)}const f3=El(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(xe.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(xe.toRad(i)),o.x+=u}return o}),d3=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},g3=El(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}),p3=Object.freeze(Object.defineProperty({__proto__:null,bottom:s3,bottomLeft:u3,bottomRight:h3,center:r3,left:o3,midSide:g3,nodeCenter:d3,orth:f3,right:a3,top:i3,topLeft:l3,topRight:c3},Symbol.toStringTag,{value:"Module"}));var ps;(function(n){n.presets=p3,n.registry=Xe.create({type:"node endpoint"}),n.registry.register(n.presets,!0)})(ps||(ps={}));const m3=function(n,e,t,r){let i=r.ratio!=null?r.ratio:.5;return i>1&&(i/=100),n.getPointAtRatio(i)},y3=function(n,e,t,r){const i=r.length!=null?r.length:20;return n.getPointAtLength(i)},Jw=function(n,e,t,r){const i=n.getClosestPoint(t);return i!=null?i:new S},v3=El(Jw),b3=El(function(n,e,t,r){const s=n.getConnection(),o=n.getConnectionSubdivisions(),a=new q(t.clone().translate(0,1e6),t.clone().translate(0,-1e6)),l=new q(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?Kw(n,r.fallbackAt):Q(Jw,this,n,e,t,r)}),w3=Object.freeze(Object.defineProperty({__proto__:null,closest:v3,length:y3,orth:b3,ratio:m3},Symbol.toStringTag,{value:"Module"}));var ms;(function(n){n.presets=w3,n.registry=Xe.create({type:"edge endpoint"}),n.registry.register(n.presets,!0)})(ms||(ms={}));function Al(n,e,t){let r;if(typeof t=="object"){if(Number.isFinite(t.y)){const s=new q(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 Tl(n){const e=n.getAttribute("stroke-width");return e===null?0:parseFloat(e)||0}function x3(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 Qw=function(n,e,t,r){const i=e.getBBoxOfElement(t);r.stroked&&i.inflate(Tl(t)/2);const s=n.intersect(i),o=s&&s.length?n.start.closest(s):n.end;return Al(o,n.start,r.offset)},C3=function(n,e,t,r,i){const s=e.cell,o=s.isNode()?s.getAngle():0;if(o===0)return Q(Qw,this,n,e,t,r,i);const a=e.getUnrotatedBBoxOfElement(t);r.stroked&&a.inflate(Tl(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 Al(h,n.start,r.offset)},S3=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=oh(t,a):i=x3(t),!Pr(i)){if(i===t||!Pr(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=pe.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(K.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&&(B.isRectangle(l)?s=l.getNearestPointToPoint(p):vn.isEllipse(l)?s=l.intersectsWithLineFromCenterToPoint(p):s=l.closestPoint(p,m));const y=s?pe.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+=Tl(i)/2):v+=Tl(i)/2),Al(y,n.start,v)};function P3(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 E3=Object.freeze(Object.defineProperty({__proto__:null,anchor:function(n,e,t,r){const{alignOffset:i,align:s}=r;return s&&P3(n,s,i),Al(n.end,n.start,r.offset)},bbox:Qw,boundary:S3,rect:C3},Symbol.toStringTag,{value:"Module"}));var ys;(function(n){n.presets=E3,n.registry=Xe.create({type:"connection point"}),n.registry.register(n.presets,!0)})(ys||(ys={}));const A3=function(n){return[...n]},T3=function(n,e,t){const r=e.side||"bottom",i=Ln(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 Ol(n){return new B(n.x,n.y,0,0)}function Ml(n={}){const e=Ln(n.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function Zw(n,e={}){return n.sourceBBox.clone().moveAndExpand(Ml(e))}function ex(n,e={}){return n.targetBBox.clone().moveAndExpand(Ml(e))}function O3(n,e={}){return n.sourceAnchor?n.sourceAnchor:Zw(n,e).getCenter()}function M3(n,e={}){return n.targetAnchor?n.targetAnchor:ex(n,e).getCenter()}const tx=function(n,e,t){let r=Zw(t,e),i=ex(t,e);const s=O3(t,e),o=M3(t,e);r=r.union(Ol(s)),i=i.union(Ol(o));const a=n.map(u=>S.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=rn.getBearing(d,g)!=null;if(u===0)u+1===h?r.intersectsWithRect(i.clone().inflate(1))?f=rn.insideNode(d,g,r,i):p||(f=rn.nodeToNode(d,g,r,i)):r.containsPoint(g)?f=rn.insideNode(d,g,r,Ol(g).moveAndExpand(Ml(e))):p||(f=rn.nodeToVertex(d,g,r));else if(u+1===h){const b=p&&rn.getBearing(g,d)===l;i.containsPoint(d)||b?f=rn.insideNode(d,g,Ol(d).moveAndExpand(Ml(e)),i,l):p||(f=rn.vertexToNode(d,g,i,l))}else p||(f=rn.vertexToVertex(d,g,l));f?(c.push(...f.points),l=f.direction):l=rn.getBearing(d,g),u+1<h&&c.push(g)}return c};var rn;(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 S(h.x,f.y);return d.containsPoint(g)&&(g=new S(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 S(h.x,f.y),p=new S(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 S(h.x,f.y),new S(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=KD(p,b)[0];const v=S.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=S.create(h).move(m,-i(d,s(h,m))/2),v=S.create(f).move(b,-i(g,s(f,b))/2),w=new q(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,P;p?(x=S.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=S.fromPolar(b.width+b.height,xe.toRad(x.theta(v))+Math.PI/2,w),C=b.getNearestPointToPoint(C).move(w,1).round(),P=r(x,C,b),E=y?[C,P,x]:[x,P,C]):E=y?[C,x]:[x,C];const A=s(y?x:C,f);return{points:E,direction:A}}n.insideNode=u})(rn||(rn={}));const _3={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:tx,draggingRouter:null,snapToGrid:!0};function Lr(n,e){return typeof n=="function"?n.call(e):n}function N3(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=Ln(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 S(0,0),i=new S(t.offsetX,t.offsetY);t.angle=xe.normalize(r.theta(i))}),e}const nx=1,rx=2;class k3{constructor(){this.items=[],this.hash={},this.values={}}add(e,t){this.hash[e]?this.items.splice(this.items.indexOf(e),1):this.hash[e]=nx,this.values[e]=t;const r=OB(this.items,e,i=>this.values[i]);this.items.splice(r,0,e)}pop(){const e=this.items.shift();return e&&(this.hash[e]=rx),e}isOpen(e){return this.hash[e]===nx}isClose(e){return this.hash[e]===rx}isEmpty(){return this.items.length===0}}class I3{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=g1(s,o.getAncestors().map(c=>c.id)));const a=e.getCell(t.getTargetCellId());a&&(s=g1(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 S(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 ix(n,e){const t=n.sourceBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function sx(n,e){const t=n.targetBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function ox(n,e){return n.sourceAnchor?n.sourceAnchor:ix(n,e).getCenter()}function L3(n,e){return n.targetAnchor?n.targetAnchor:sx(n,e).getCenter()}function Rh(n,e,t,r,i){const s=360/t,o=n.theta(R3(n,e,r,i)),a=xe.normalize(o+s/2);return s*Math.floor(a/s)}function R3(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 S(n.x+c,n.y+u)}function ax(n,e){const t=Math.abs(n-e);return t>180?360-t:t}function j3(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 D3(n,e,t){return{source:e.clone(),x:lx(t.x-e.x,n),y:lx(t.y-e.y,n)}}function lx(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 B3(n,e){const t=e.source,r=Se.snapToGrid(n.x-t.x,e.x)+t.x,i=Se.snapToGrid(n.y-t.y,e.y)+t.y;return new S(r,i)}function jo(n,e){return n.round(e)}function _l(n,e,t){return jo(B3(n.clone(),e),t)}function Do(n){return n.toString()}function jh(n){return new S(n.x===0?0:Math.abs(n.x)/n.x,n.y===0?0:Math.abs(n.y)/n.y)}function cx(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 ux(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 S(n.x+h.x*(Math.abs(a.x)+e.width),n.y+h.y*(Math.abs(a.y)+e.height)),g=new q(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=_l(b,r,s);e.containsPoint(m)&&(m=_l(m.translate(h.x*r.x,h.y*r.y),r,s)),c.push(m)}}return c},[]);return e.containsPoint(n)||l.push(_l(n,r,s)),l}function $3(n,e,t,r,i){const s=[];let o=jh(i.diff(t)),a=Do(t),l=n[a],c;for(;l;){c=e[a];const f=jh(c.diff(l));f.equals(o)||(s.unshift(c),o=f),a=Do(l),l=n[a]}const u=e[a];return jh(u.diff(r)).equals(o)||s.unshift(u),s}function z3(n,e,t,r,i){const s=i.precision;let o,a;B.isRectangle(e)?o=jo(ox(n,i).clone(),s):o=jo(e.clone(),s),B.isRectangle(t)?a=jo(L3(n,i).clone(),s):a=jo(t.clone(),s);const l=D3(i.step,o,a),c=o,u=a;let h,f;if(B.isRectangle(e)?h=ux(c,e,i.startDirections,l,i):h=[c],B.isRectangle(t)?f=ux(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 k3,g={},p={},b={};for(let O=0,T=h.length;O<T;O+=1){const L=h[O],V=Do(L);d.add(V,cx(L,f)),g[V]=L,b[V]=0}const m=i.previousDirectionAngle,y=m===void 0;let v,w;const x=j3(l,i),C=x.length,P=f.reduce((O,T)=>{const L=Do(T);return O.push(L),O},[]),E=S.equalPoints(h,f);let A=i.maxLoopCount;for(;!d.isEmpty()&&A>0;){const O=d.pop(),T=g[O],L=p[O],V=b[O],Y=T.equals(c),M=L==null;let I;if(M?y?Y?I=null:I=Rh(c,T,C,l,i):I=m:I=Rh(L,T,C,l,i),!(M&&E)&&P.indexOf(O)>=0)return i.previousDirectionAngle=I,$3(p,g,T,c,u);for(let j=0;j<C;j+=1){v=x[j];const F=v.angle;if(w=ax(I,F),!(y&&Y)&&w>i.maxDirectionChange)continue;const H=_l(T.clone().translate(v.gridOffsetX||0,v.gridOffsetY||0),l,s),ne=Do(H);if(d.isClose(ne)||!r.isAccessible(H))continue;if(P.indexOf(ne)>=0&&!H.equals(u)){const z=Rh(H,u,C,l,i);if(ax(F,z)>i.maxDirectionChange)continue}const Pe=v.cost,Yt=Y?0:i.penalties[w],N=V+Pe+Yt;(!d.isOpen(ne)||N<b[ne])&&(g[ne]=H,p[ne]=T,b[ne]=N,d.add(ne,N+cx(H,f)))}A-=1}}return i.fallbackRoute?Q(i.fallbackRoute,this,c,u,i):null}function F3(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 q3=function(n,e,t){const r=N3(e),i=ix(t,r),s=sx(t,r),o=ox(t,r),a=new I3(r).build(t.graph.model,t.cell),l=n.map(d=>S.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=Q(r.draggingRouter,t,v,w,r)}}if(p==null&&(p=z3(t,h,f,a,r)),p===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),Q(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?F3(c,t.graph.grid.getGridSize()):c},hx=function(n,e,t){return Q(q3,this,n,Object.assign(Object.assign({},_3),e),t)},V3={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 q(n,a),c=90*Math.ceil(r/90),u=S.fromPolar(l.squaredLength(),xe.toRad(c+135),a),h=new q(e,u),f=l.intersectsWithLine(h),d=f||e,g=f?d:n,p=360/t.directions.length,b=g.theta(e),m=xe.normalize(b+p/2),y=p*Math.floor(m/p);return t.previousDirectionAngle=y,d&&i.push(d.round()),i.push(e),i}},G3=function(n,e,t){return Q(hx,this,n,Object.assign(Object.assign({},V3),e),t)},H3=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 vs(n,e){if(e!=null&&e!==!1){const t=typeof e=="boolean"?0:e;if(t>0){const r=S.create(n[1]).move(n[2],t),i=S.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 U3=Object.freeze(Object.defineProperty({__proto__:null,er:H3,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=xe.toRad(m),v=Math.sin(y),w=Math.cos(y),x=new S(a.x+w*r,a.y+v*r),C=new S(x.x-w*s,x.y-v*s),P=C.clone().rotate(-90,x),E=C.clone().rotate(90,x);return[P.toJSON(),x.toJSON(),E.toJSON()]},f=m=>{const y=a.clone().move(m,-1),v=new q(y,m);return!c.containsPoint(m)&&!c.intersectsWithLine(v)},d=[0,90,180,270,45,135,225,315];if(typeof o=="number")return vs(h(o),e.merge);const g=c.getCenter();if(g.equals(a))return vs(h(0),e.merge);const p=g.angleBetween(a,g.clone().translate(1,0));let b=h(p);if(f(b[1]))return vs(b,e.merge);for(let m=1,y=d.length;m<y;m+=1)if(b=h(p+d[m]),f(b[1]))return vs(b,e.merge);return vs(b,e.merge)}{const h=new q(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 q(b.start,d),y=new q(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 q(a,l),w=new q(d,v.center).setLength(Number.MAX_SAFE_INTEGER),x=c.intersectsWithLine(w),C=u.intersectsWithLine(w),P=x?Array.isArray(x)?x:[x]:[];C&&(Array.isArray(C)?P.push(...C):P.push(C));const E=v.center.closest(P);E?(t.sourceAnchor=E.clone(),t.targetAnchor=E.clone()):(t.sourceAnchor=v.center.clone(),t.targetAnchor=v.center.clone())}return vs([g.toJSON(),d.toJSON(),p.toJSON()],e.merge)}},manhattan:hx,metro:G3,normal:A3,oneSide:T3,orth:tx},Symbol.toStringTag,{value:"Module"}));var Rr;(function(n){n.presets=U3,n.registry=Xe.create({type:"router"}),n.registry.register(n.presets,!0)})(Rr||(Rr={}));const W3=function(n,e,t,r={}){const i=[n,...t,e],s=new We(i),o=new K(s);return r.raw?o:o.serialize()},X3=function(n,e,t,r={}){const i=t.length===3?0:1,s=S.create(t[0+i]),o=S.create(t[2+i]),a=S.create(t[1+i]);if(!S.equals(n,e)){const c=new S((n.x+e.x)/2,(n.y+e.y)/2),u=c.angleBetween(S.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}
@@ -242,30 +242,50 @@
242
242
  border: 1px solid #275fc5;
243
243
  border-radius: 2px;
244
244
  }
245
- `;class ut extends Nn{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 pq=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 Bh extends ut{init(){Mo("core",gq)}dispose(){_o("core")}}pq([Bh.dispose()],Bh.prototype,"dispose",null);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},zo;(function(n){function e(t){const{grid:r,panning:i,mousewheel:s,embedding:o}=t,a=mq(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=Re({},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:nn.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:nn.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 cq}},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 yq=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},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};class $h extends ut{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=vq(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,te.create("pattern",{id:u,patternUnits:"userSpaceOnUse"},te.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),ge(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 Tr),this.instance}resolveGrid(e){if(!e)return[];const t=e.type;if(t==null)return[Object.assign(Object.assign({},Tr.presets.dot),e.args)];const r=Tr.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 Tr.registry.onNotFound(t)}dispose(){this.stopListening(),this.clear()}}yq([ut.dispose()],$h.prototype,"dispose",null);class vx extends ut{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),lt(this.viewportMatrix)}setMatrix(e){const t=lt(e),r=ss(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 u1(e)||(e=this.container.clientWidth),u1(t)||(t=this.container.clientHeight),{width:e,height:t}}getScale(){return _$(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 Qt(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 N$(this.getMatrix())}rotate(e,t,r){if(t==null||r==null){const s=pe.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 k$(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=Ln(r),o=i.border||0,a=i.contentArea?B.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 B(-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=S.create(m)}else r=this.getContentBBox(e),i=this.graph.graphToLocal(r);if(!r.width||!r.height)return;const s=Ln(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=B.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=Qt(g,l,c),p=Qt(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 B:pe.getBBox(this.stage)}getContentBBox(e={}){return this.graph.localToGraph(this.getContentArea(e))}getGraphArea(){const e=B.fromSize(this.getComputedSize());return this.graph.graphToLocal(e)}zoomToRect(e,t={}){const r=B.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=Ft(t,Math.max(0,i.width)),t<0&&(t=i.width+t),r=Ft(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=B.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 bq=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 jl extends ut{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=B.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=No.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=Yu(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=Yu(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()}}bq([ut.dispose()],jl.prototype,"dispose",null);var wq=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 bx extends ut{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),Ae.on(this.graph.container,"mousedown",this.onRightMouseDown)),e.includes("mouseWheel")&&(this.mousewheelHandle=new uw(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")&&Ae.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&&er.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(),Ae.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)}),Ae.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(),Ae.off(document.body,".panning"),Ae.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?(Z(e,t),gt(e,r)):(gt(e,t),Z(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()}}wq([ut.dispose()],bx.prototype,"dispose",null);var xq=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 zh extends ut{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 uw(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))&&er.isMatch(e,this.widgetOptions.modifiers)}onMouseWheel(e){const t=this.widgetOptions.guard;if((t==null||t(e))&&er.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=Qt(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()}}xq([Nn.dispose()],zh.prototype,"dispose",null);var Cq=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 wx extends ut{init(){this.resetRenderArea=kB(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()}}Cq([ut.dispose()],wx.prototype,"dispose",null);class Sq{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=33,this.initialTime=Date.now()}queueJob(e){if(e.priority&ir.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 ir;(function(n){n[n.Update=2]="Update",n[n.RenderEdge=4]="RenderEdge",n[n.RenderNode=8]="RenderNode",n[n.PRIOR=1048576]="PRIOR"})(ir||(ir={}));var Pq=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 rt extends Nn{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(e){super(),this.views={},this.willRemoveViews={},this.queue=new Sq,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,rt.FLAG_INSERT,t,ir.Update,!0)}onCellVisibleChanged({cell:e,current:t}){this.toggleVisible(e,!!t)}requestViewUpdate(e,t,r={},i=ir.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=ir.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===rt.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=rt.FLAG_INSERT;else{const l=this.createCellView(r);l&&(l.graph=this.graph,o=rt.FLAG_INSERT|l.getBootstrapFlag(),a={view:l,flag:o,options:t,state:rt.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===rt.ViewState.MOUNTED?(a=this.updateView(e,t,r),o.flag=a):o.state=rt.ViewState.WAITING,a&&i.isEdge()&&!(a&e.getFlag(["source","target"]))&&this.queue.queueJob({id:s,priority:ir.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===rt.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(nt.isCellView(e)){if(t&rt.FLAG_REMOVE)return this.removeView(e.cell),0;t&rt.FLAG_INSERT&&(this.insertView(e),t^=rt.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=rt.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&&ve(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=Q(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=nt.registry.get(i);return s?new s(e,t):nt.registry.onNotFound(i)}return e.isNode()?new It(e,t):e.isEdge()?new rr(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()?ir.RenderNode:ir.RenderEdge}dispose(){this.stopListening()}}Pq([Nn.dispose()],rt.prototype,"dispose",null),function(n){n.FLAG_INSERT=1<<30,n.FLAG_REMOVE=1<<29,n.FLAG_RENDER=(1<<26)-1}(rt||(rt={})),function(n){(function(e){e[e.CREATED=0]="CREATED",e[e.MOUNTED=1]="MOUNTED",e[e.WAITING=2]="WAITING"})(n.ViewState||(n.ViewState={}))}(rt||(rt={}));var Eq=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 Fh extends ut{constructor(){super(...arguments),this.schedule=new rt(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=ce.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?pe.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=B.create(e);return this.model.getCells().map(i=>this.findViewByCell(i)).filter(i=>{if(i){if(t.nodeOnly&&!i.isNodeView())return!1;const s=pe.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()}}Eq([ut.dispose()],Fh.prototype,"dispose",null);var xx=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 Cx extends ut{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}-${lh(JSON.stringify(e))}`),!this.isDefined(t)){const i=cs.registry.get(r);if(i==null)return cs.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});te.create(Te.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}-${lh(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);te.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=xx(e,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let u=t;if(u||(u=`marker-${this.cid}-${lh(JSON.stringify(e))}`),!this.isDefined(u)){a!=="path"&&delete c.d;const h=te.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=xx(f,["tagName"]);return te.create(`${d}`||"path",wo(Object.assign(Object.assign({},c),g)))}):[te.create(a||"path",wo(c))]);this.defs.appendChild(h.node)}return u}remove(e){const t=this.svg.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}}class Sx extends ut{getClientMatrix(){return lt(this.view.stage.getScreenCTM())}getClientOffset(){const e=this.view.svg.getBoundingClientRect();return new S(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=S.create(e,t);return pe.transformPoint(r,this.graph.matrix())}localToClientPoint(e,t){const r=S.create(e,t);return pe.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=B.create(e,t,r,i);return pe.transformRectangle(s,this.graph.matrix())}localToClientRect(e,t,r,i){const s=B.create(e,t,r,i);return pe.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=S.create(e,t);return pe.transformPoint(r,this.graph.matrix().inverse())}clientToLocalPoint(e,t){const r=S.create(e,t);return pe.transformPoint(r,this.getClientMatrix().inverse())}clientToGraphPoint(e,t){const r=S.create(e,t);return pe.transformPoint(r,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(e,t){const i=S.create(e,t).diff(this.getPageOffset());return this.graphToLocalPoint(i)}graphToLocalRect(e,t,r,i){const s=B.create(e,t,r,i);return pe.transformRectangle(s,this.graph.matrix().inverse())}clientToLocalRect(e,t,r,i){const s=B.create(e,t,r,i);return pe.transformRectangle(s,this.getClientMatrix().inverse())}clientToGraphRect(e,t,r,i){const s=B.create(e,t,r,i);return pe.transformRectangle(s,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(e,t,r,i){const s=B.create(e,t,r,i),o=this.getPageOffset();return s.x-=o.x,s.y-=o.y,this.graphToLocalRect(s)}}var Aq=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 Dl extends ut{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=tr.registry.get(s);return o==null?tr.registry.onNotFound(s):(tr.check(s,o),{name:s,highlighter:o,args:i.args||{}})}getHighlighterId(e,t){return dh(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()}}Aq([Dl.dispose()],Dl.prototype,"dispose",null);var Tq=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 Px extends ut{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&&ml.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(){ml.clear(this.graph.container)}}Tq([ut.dispose()],Px.prototype,"dispose",null);var Oq=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 G=class j2 extends wt{get container(){return this.options.container}get[Symbol.toStringTag](){return j2.toStringTag}constructor(e){super(),this.installedPlugins=new Set,this.options=zo.get(e),this.css=new Bh(this),this.view=new bn(this),this.defs=new Cx(this),this.coord=new Sx(this),this.transform=new vx(this),this.highlight=new Dl(this),this.grid=new $h(this),this.background=new jl(this),this.options.model?this.model=this.options.model:(this.model=new Bn,this.model.graph=this),this.renderer=new Fh(this),this.panning=new bx(this),this.mousewheel=new zh(this),this.virtualRender=new wx(this),this.size=new Px(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=>Ye.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 ce.isCell(e)?this.findViewByCell(e):this.findViewByElem(e)}findViews(e){return B.isRectangleLike(e)?this.findViewsInArea(e):S.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 B.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 B.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 B.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 B.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 B.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 B.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 B.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()})}};Oq([wt.dispose()],G.prototype,"dispose",null),function(n){n.View=bn,n.Renderer=Fh,n.MouseWheel=zh,n.DefsManager=Cx,n.GridManager=$h,n.CoordManager=Sx,n.TransformManager=vx,n.HighlightManager=Dl,n.BackgroundManager=jl}(G||(G={})),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}(G||(G={})),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}(G||(G={})),function(n){n.registerNode=Ye.registry.register,n.registerEdge=Ve.registry.register,n.registerView=nt.registry.register,n.registerAttr=Dn.registry.register,n.registerGrid=Tr.registry.register,n.registerFilter=cs.registry.register,n.registerNodeTool=ds.registry.register,n.registerEdgeTool=gs.registry.register,n.registerBackground=No.registry.register,n.registerHighlighter=tr.registry.register,n.registerPortLayout=wi.registry.register,n.registerPortLabelLayout=hs.registry.register,n.registerMarker=_r.registry.register,n.registerRouter=Rr.registry.register,n.registerConnector=xi.registry.register,n.registerAnchor=ps.registry.register,n.registerEdgeAnchor=ms.registry.register,n.registerConnectionPoint=ys.registry.register}(G||(G={})),function(n){n.unregisterNode=Ye.registry.unregister,n.unregisterEdge=Ve.registry.unregister,n.unregisterView=nt.registry.unregister,n.unregisterAttr=Dn.registry.unregister,n.unregisterGrid=Tr.registry.unregister,n.unregisterFilter=cs.registry.unregister,n.unregisterNodeTool=ds.registry.unregister,n.unregisterEdgeTool=gs.registry.unregister,n.unregisterBackground=No.registry.unregister,n.unregisterHighlighter=tr.registry.unregister,n.unregisterPortLayout=wi.registry.unregister,n.unregisterPortLabelLayout=hs.registry.unregister,n.unregisterMarker=_r.registry.unregister,n.unregisterRouter=Rr.registry.unregister,n.unregisterConnector=xi.registry.unregister,n.unregisterAnchor=ps.registry.unregister,n.unregisterEdgeAnchor=ms.registry.unregister,n.unregisterConnectionPoint=ys.registry.unregister}(G||(G={}));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};class Cs extends Ye{}(function(n){class e extends It{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){vo(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:Rn(r,s))}}}n.View=e,function(t){t.action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),It.registry.register("html-view",t,!0)}(e=n.View||(n.View={}))})(Cs||(Cs={})),function(n){n.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},Te.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),Ye.registry.register("html",n,!0)}(Cs||(Cs={})),function(n){n.shapeMaps={};function e(t){const{shape:r,html:i,effect:s,inherit:o}=t,a=Mq(t,["shape","html","effect","inherit"]);if(!r)throw new Error("should specify shape in config");n.shapeMaps[r]={html:i,effect:s},G.registerNode(r,Object.assign({inherit:o||"html"},a),!0)}n.register=e}(Cs||(Cs={}));class Ex extends Ye{}(function(n){function e(t){const r=[],i=Te.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=Re({},{body:Object.assign({refWidth:null,refHeight:null},i)},t.attrs||{})}}return t}}),Ye.registry.register("react-shape",n,!0)})(Ex||(Ex={}));var Bl=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function _q(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ax={exports:{}},qt={},Tx={exports:{}},Ox={};/**
246
- * @license React
247
- * scheduler.production.min.js
248
- *
249
- * Copyright (c) Facebook, Inc. and its affiliates.
250
- *
251
- * This source code is licensed under the MIT license found in the
252
- * LICENSE file in the root directory of this source tree.
253
- */(function(n){function e(R,F){var H=R.length;R.push(F);e:for(;0<H;){var ne=H-1>>>1,Pe=R[ne];if(0<i(Pe,F))R[ne]=F,R[H]=Pe,H=ne;else break e}}function t(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var F=R[0],H=R.pop();if(H!==F){R[0]=H;e:for(var ne=0,Pe=R.length,Yt=Pe>>>1;ne<Yt;){var N=2*(ne+1)-1,$=R[N],z=N+1,X=R[z];if(0>i($,H))z<Pe&&0>i(X,$)?(R[ne]=X,R[z]=H,ne=z):(R[ne]=$,R[N]=H,ne=N);else if(z<Pe&&0>i(X,H))R[ne]=X,R[z]=H,ne=z;else break e}}return F}function i(R,F){var H=R.sortIndex-F.sortIndex;return H!==0?H:R.id-F.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 F=t(c);F!==null;){if(F.callback===null)r(c);else if(F.startTime<=R)r(c),F.sortIndex=F.expirationTime,e(l,F);else break;F=t(c)}}function w(R){if(p=!1,v(R),!g)if(t(l)!==null)g=!0,I(x);else{var F=t(c);F!==null&&J(w,F.startTime-R)}}function x(R,F){g=!1,p&&(p=!1,m(E),E=-1),d=!0;var H=f;try{for(v(F),h=t(l);h!==null&&(!(h.expirationTime>F)||R&&!T());){var ne=h.callback;if(typeof ne=="function"){h.callback=null,f=h.priorityLevel;var Pe=ne(h.expirationTime<=F);F=n.unstable_now(),typeof Pe=="function"?h.callback=Pe:h===t(l)&&r(l),v(F)}else r(l);h=t(l)}if(h!==null)var Yt=!0;else{var N=t(c);N!==null&&J(w,N.startTime-F),Yt=!1}return Yt}finally{h=null,f=H,d=!1}}var C=!1,P=null,E=-1,A=5,O=-1;function T(){return!(n.unstable_now()-O<A)}function L(){if(P!==null){var R=n.unstable_now();O=R;var F=!0;try{F=P(!0,R)}finally{F?V():(C=!1,P=null)}}else C=!1}var V;if(typeof y=="function")V=function(){y(L)};else if(typeof MessageChannel!="undefined"){var Y=new MessageChannel,M=Y.port2;Y.port1.onmessage=L,V=function(){M.postMessage(null)}}else V=function(){b(L,0)};function I(R){P=R,C||(C=!0,V())}function J(R,F){E=b(function(){R(n.unstable_now())},F)}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,I(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 F=3;break;default:F=f}var H=f;f=F;try{return R()}finally{f=H}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(R,F){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var H=f;f=R;try{return F()}finally{f=H}},n.unstable_scheduleCallback=function(R,F,H){var ne=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?ne+H:ne):H=ne,R){case 1:var Pe=-1;break;case 2:Pe=250;break;case 5:Pe=1073741823;break;case 4:Pe=1e4;break;default:Pe=5e3}return Pe=H+Pe,R={id:u++,callback:F,priorityLevel:R,startTime:H,expirationTime:Pe,sortIndex:-1},H>ne?(R.sortIndex=H,e(c,R),t(l)===null&&R===t(c)&&(p?(m(E),E=-1):p=!0,J(w,H-ne))):(R.sortIndex=Pe,e(l,R),g||d||(g=!0,I(x))),R},n.unstable_shouldYield=T,n.unstable_wrapCallback=function(R){var F=f;return function(){var H=f;f=F;try{return R.apply(this,arguments)}finally{f=H}}}})(Ox),Tx.exports=Ox;var Nq=Tx.exports;/**
254
- * @license React
255
- * react-dom.production.min.js
256
- *
257
- * Copyright (c) Facebook, Inc. and its affiliates.
258
- *
259
- * This source code is licensed under the MIT license found in the
260
- * LICENSE file in the root directory of this source tree.
261
- */var Mx=W,Vt=Nq;function D(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 _x=new Set,Fo={};function Ci(n,e){Ss(n,e),Ss(n+"Capture",e)}function Ss(n,e){for(Fo[n]=e,n=0;n<e.length;n++)_x.add(e[n])}var sr=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),qh=Object.prototype.hasOwnProperty,kq=/^[: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]*$/,Nx={},kx={};function Iq(n){return qh.call(kx,n)?!0:qh.call(Nx,n)?!1:kq.test(n)?kx[n]=!0:(Nx[n]=!0,!1)}function Lq(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 Rq(n,e,t,r){if(e===null||typeof e=="undefined"||Lq(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 _t(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 _t(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 _t(e,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){mt[n]=new _t(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){mt[n]=new _t(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 _t(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){mt[n]=new _t(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){mt[n]=new _t(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){mt[n]=new _t(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){mt[n]=new _t(n,5,!1,n.toLowerCase(),null,!1,!1)});var Vh=/[\-:]([a-z])/g;function Gh(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(Vh,Gh);mt[e]=new _t(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(Vh,Gh);mt[e]=new _t(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(Vh,Gh);mt[e]=new _t(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){mt[n]=new _t(n,1,!1,n.toLowerCase(),null,!1,!1)}),mt.xlinkHref=new _t("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){mt[n]=new _t(n,1,!1,n.toLowerCase(),null,!0,!0)});function Hh(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")&&(Rq(e,t,i,r)&&(t=null),r||i===null?Iq(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 or=Mx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$l=Symbol.for("react.element"),Ps=Symbol.for("react.portal"),Es=Symbol.for("react.fragment"),Uh=Symbol.for("react.strict_mode"),Wh=Symbol.for("react.profiler"),Ix=Symbol.for("react.provider"),Lx=Symbol.for("react.context"),Xh=Symbol.for("react.forward_ref"),Yh=Symbol.for("react.suspense"),Kh=Symbol.for("react.suspense_list"),Jh=Symbol.for("react.memo"),Dr=Symbol.for("react.lazy"),Rx=Symbol.for("react.offscreen"),jx=Symbol.iterator;function qo(n){return n===null||typeof n!="object"?null:(n=jx&&n[jx]||n["@@iterator"],typeof n=="function"?n:null)}var je=Object.assign,Qh;function Vo(n){if(Qh===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);Qh=e&&e[1]||""}return`
262
- `+Qh+n}var Zh=!1;function ef(n,e){if(!n||Zh)return"";Zh=!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(`
263
- `),s=r.stack.split(`
264
- `),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=`
265
- `+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{Zh=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Vo(n):""}function jq(n){switch(n.tag){case 5:return Vo(n.type);case 16:return Vo("Lazy");case 13:return Vo("Suspense");case 19:return Vo("SuspenseList");case 0:case 2:case 15:return n=ef(n.type,!1),n;case 11:return n=ef(n.type.render,!1),n;case 1:return n=ef(n.type,!0),n;default:return""}}function tf(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 Es:return"Fragment";case Ps:return"Portal";case Wh:return"Profiler";case Uh:return"StrictMode";case Yh:return"Suspense";case Kh:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case Lx:return(n.displayName||"Context")+".Consumer";case Ix:return(n._context.displayName||"Context")+".Provider";case Xh:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case Jh:return e=n.displayName||null,e!==null?e:tf(n.type)||"Memo";case Dr:e=n._payload,n=n._init;try{return tf(n(e))}catch(t){}}return null}function Dq(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 tf(e);case 8:return e===Uh?"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 Dx(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Bq(n){var e=Dx(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 zl(n){n._valueTracker||(n._valueTracker=Bq(n))}function Bx(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),r="";return n&&(r=Dx(n)?n.checked?"true":"false":n.value),n=r,n!==t?(e.setValue(n),!0):!1}function Fl(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 nf(n,e){var t=e.checked;return je({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t!=null?t:n._wrapperState.initialChecked})}function $x(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 zx(n,e){e=e.checked,e!=null&&Hh(n,"checked",e,!1)}function rf(n,e){zx(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")?sf(n,e.type,t):e.hasOwnProperty("defaultValue")&&sf(n,e.type,Br(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function Fx(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 sf(n,e,t){(e!=="number"||Fl(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Go=Array.isArray;function As(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 of(n,e){if(e.dangerouslySetInnerHTML!=null)throw Error(D(91));return je({},e,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function qx(n,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(D(92));if(Go(t)){if(1<t.length)throw Error(D(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 Gx(n){var e=n.textContent;e===n._wrapperState.initialValue&&e!==""&&e!==null&&(n.value=e)}function Hx(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 af(n,e){return n==null||n==="http://www.w3.org/1999/xhtml"?Hx(e):n==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var ql,Ux=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(ql=ql||document.createElement("div"),ql.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=ql.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function Ho(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var Uo={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},$q=["Webkit","ms","Moz","O"];Object.keys(Uo).forEach(function(n){$q.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),Uo[e]=Uo[n]})});function Wx(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||Uo.hasOwnProperty(n)&&Uo[n]?(""+e).trim():e+"px"}function Xx(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var r=t.indexOf("--")===0,i=Wx(t,e[t],r);t==="float"&&(t="cssFloat"),r?n.setProperty(t,i):n[t]=i}}var zq=je({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 lf(n,e){if(e){if(zq[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(D(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(D(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(D(61))}if(e.style!=null&&typeof e.style!="object")throw Error(D(62))}}function cf(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 uf=null;function hf(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var ff=null,Ts=null,Os=null;function Yx(n){if(n=ga(n)){if(typeof ff!="function")throw Error(D(280));var e=n.stateNode;e&&(e=hc(e),ff(n.stateNode,n.type,e))}}function Kx(n){Ts?Os?Os.push(n):Os=[n]:Ts=n}function Jx(){if(Ts){var n=Ts,e=Os;if(Os=Ts=null,Yx(n),e)for(n=0;n<e.length;n++)Yx(e[n])}}function Qx(n,e){return n(e)}function Zx(){}var df=!1;function eC(n,e,t){if(df)return n(e,t);df=!0;try{return Qx(n,e,t)}finally{df=!1,(Ts!==null||Os!==null)&&(Zx(),Jx())}}function Wo(n,e){var t=n.stateNode;if(t===null)return null;var r=hc(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(D(231,e,typeof t));return t}var gf=!1;if(sr)try{var Xo={};Object.defineProperty(Xo,"passive",{get:function(){gf=!0}}),window.addEventListener("test",Xo,Xo),window.removeEventListener("test",Xo,Xo)}catch(n){gf=!1}function Fq(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 Yo=!1,Vl=null,Gl=!1,pf=null,qq={onError:function(n){Yo=!0,Vl=n}};function Vq(n,e,t,r,i,s,o,a,l){Yo=!1,Vl=null,Fq.apply(qq,arguments)}function Gq(n,e,t,r,i,s,o,a,l){if(Vq.apply(this,arguments),Yo){if(Yo){var c=Vl;Yo=!1,Vl=null}else throw Error(D(198));Gl||(Gl=!0,pf=c)}}function Si(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 tC(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 nC(n){if(Si(n)!==n)throw Error(D(188))}function Hq(n){var e=n.alternate;if(!e){if(e=Si(n),e===null)throw Error(D(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 nC(i),n;if(s===r)return nC(i),e;s=s.sibling}throw Error(D(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(D(189))}}if(t.alternate!==r)throw Error(D(190))}if(t.tag!==3)throw Error(D(188));return t.stateNode.current===t?n:e}function rC(n){return n=Hq(n),n!==null?iC(n):null}function iC(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var e=iC(n);if(e!==null)return e;n=n.sibling}return null}var sC=Vt.unstable_scheduleCallback,oC=Vt.unstable_cancelCallback,Uq=Vt.unstable_shouldYield,Wq=Vt.unstable_requestPaint,Ke=Vt.unstable_now,Xq=Vt.unstable_getCurrentPriorityLevel,mf=Vt.unstable_ImmediatePriority,aC=Vt.unstable_UserBlockingPriority,Hl=Vt.unstable_NormalPriority,Yq=Vt.unstable_LowPriority,lC=Vt.unstable_IdlePriority,Ul=null,$n=null;function Kq(n){if($n&&typeof $n.onCommitFiberRoot=="function")try{$n.onCommitFiberRoot(Ul,n,void 0,(n.current.flags&128)===128)}catch(e){}}var wn=Math.clz32?Math.clz32:Zq,Jq=Math.log,Qq=Math.LN2;function Zq(n){return n>>>=0,n===0?32:31-(Jq(n)/Qq|0)|0}var Wl=64,Xl=4194304;function Ko(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 Yl(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=Ko(a):(s&=o,s!==0&&(r=Ko(s)))}else o=t&~i,o!==0?r=Ko(o):s!==0&&(r=Ko(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-wn(e),i=1<<t,r|=n[t],e&=~i;return r}function eV(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 tV(n,e){for(var t=n.suspendedLanes,r=n.pingedLanes,i=n.expirationTimes,s=n.pendingLanes;0<s;){var o=31-wn(s),a=1<<o,l=i[o];l===-1?(!(a&t)||a&r)&&(i[o]=eV(a,e)):l<=e&&(n.expiredLanes|=a),s&=~a}}function yf(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function cC(){var n=Wl;return Wl<<=1,!(Wl&4194240)&&(Wl=64),n}function vf(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function Jo(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-wn(e),n[e]=t}function nV(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-wn(t),s=1<<i;e[i]=0,r[i]=-1,n[i]=-1,t&=~s}}function bf(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var r=31-wn(t),i=1<<r;i&e|n[r]&e&&(n[r]|=e),t&=~i}}var be=0;function uC(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var hC,wf,fC,dC,gC,xf=!1,Kl=[],$r=null,zr=null,Fr=null,Qo=new Map,Zo=new Map,qr=[],rV="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 pC(n,e){switch(n){case"focusin":case"focusout":$r=null;break;case"dragenter":case"dragleave":zr=null;break;case"mouseover":case"mouseout":Fr=null;break;case"pointerover":case"pointerout":Qo.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zo.delete(e.pointerId)}}function ea(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=ga(e),e!==null&&wf(e)),n):(n.eventSystemFlags|=r,e=n.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),n)}function iV(n,e,t,r,i){switch(e){case"focusin":return $r=ea($r,n,e,t,r,i),!0;case"dragenter":return zr=ea(zr,n,e,t,r,i),!0;case"mouseover":return Fr=ea(Fr,n,e,t,r,i),!0;case"pointerover":var s=i.pointerId;return Qo.set(s,ea(Qo.get(s)||null,n,e,t,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Zo.set(s,ea(Zo.get(s)||null,n,e,t,r,i)),!0}return!1}function mC(n){var e=Pi(n.target);if(e!==null){var t=Si(e);if(t!==null){if(e=t.tag,e===13){if(e=tC(t),e!==null){n.blockedOn=e,gC(n.priority,function(){fC(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 Jl(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=Sf(n.domEventName,n.eventSystemFlags,e[0],n.nativeEvent);if(t===null){t=n.nativeEvent;var r=new t.constructor(t.type,t);uf=r,t.target.dispatchEvent(r),uf=null}else return e=ga(t),e!==null&&wf(e),n.blockedOn=t,!1;e.shift()}return!0}function yC(n,e,t){Jl(n)&&t.delete(e)}function sV(){xf=!1,$r!==null&&Jl($r)&&($r=null),zr!==null&&Jl(zr)&&(zr=null),Fr!==null&&Jl(Fr)&&(Fr=null),Qo.forEach(yC),Zo.forEach(yC)}function ta(n,e){n.blockedOn===e&&(n.blockedOn=null,xf||(xf=!0,Vt.unstable_scheduleCallback(Vt.unstable_NormalPriority,sV)))}function na(n){function e(i){return ta(i,n)}if(0<Kl.length){ta(Kl[0],n);for(var t=1;t<Kl.length;t++){var r=Kl[t];r.blockedOn===n&&(r.blockedOn=null)}}for($r!==null&&ta($r,n),zr!==null&&ta(zr,n),Fr!==null&&ta(Fr,n),Qo.forEach(e),Zo.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);)mC(t),t.blockedOn===null&&qr.shift()}var Ms=or.ReactCurrentBatchConfig,Ql=!0;function oV(n,e,t,r){var i=be,s=Ms.transition;Ms.transition=null;try{be=1,Cf(n,e,t,r)}finally{be=i,Ms.transition=s}}function aV(n,e,t,r){var i=be,s=Ms.transition;Ms.transition=null;try{be=4,Cf(n,e,t,r)}finally{be=i,Ms.transition=s}}function Cf(n,e,t,r){if(Ql){var i=Sf(n,e,t,r);if(i===null)zf(n,e,r,Zl,t),pC(n,r);else if(iV(i,n,e,t,r))r.stopPropagation();else if(pC(n,r),e&4&&-1<rV.indexOf(n)){for(;i!==null;){var s=ga(i);if(s!==null&&hC(s),s=Sf(n,e,t,r),s===null&&zf(n,e,r,Zl,t),s===i)break;i=s}i!==null&&r.stopPropagation()}else zf(n,e,r,null,t)}}var Zl=null;function Sf(n,e,t,r){if(Zl=null,n=hf(r),n=Pi(n),n!==null)if(e=Si(n),e===null)n=null;else if(t=e.tag,t===13){if(n=tC(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 Zl=n,null}function vC(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(Xq()){case mf:return 1;case aC:return 4;case Hl:case Yq:return 16;case lC:return 536870912;default:return 16}default:return 16}}var Vr=null,Pf=null,ec=null;function bC(){if(ec)return ec;var n,e=Pf,t=e.length,r,i="value"in Vr?Vr.value:Vr.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 ec=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 nc(){return!0}function wC(){return!1}function Gt(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)?nc:wC,this.isPropagationStopped=wC,this}return je(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=nc)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=nc)},persist:function(){},isPersistent:nc}),e}var _s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ef=Gt(_s),ra=je({},_s,{view:0,detail:0}),lV=Gt(ra),Af,Tf,ia,rc=je({},ra,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mf,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!==ia&&(ia&&n.type==="mousemove"?(Af=n.screenX-ia.screenX,Tf=n.screenY-ia.screenY):Tf=Af=0,ia=n),Af)},movementY:function(n){return"movementY"in n?n.movementY:Tf}}),xC=Gt(rc),cV=je({},rc,{dataTransfer:0}),uV=Gt(cV),hV=je({},ra,{relatedTarget:0}),Of=Gt(hV),fV=je({},_s,{animationName:0,elapsedTime:0,pseudoElement:0}),dV=Gt(fV),gV=je({},_s,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),pV=Gt(gV),mV=je({},_s,{data:0}),CC=Gt(mV),yV={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vV={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"},bV={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wV(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=bV[n])?!!e[n]:!1}function Mf(){return wV}var xV=je({},ra,{key:function(n){if(n.key){var e=yV[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"?vV[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mf,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}}),CV=Gt(xV),SV=je({},rc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),SC=Gt(SV),PV=je({},ra,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mf}),EV=Gt(PV),AV=je({},_s,{propertyName:0,elapsedTime:0,pseudoElement:0}),TV=Gt(AV),OV=je({},rc,{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}),MV=Gt(OV),_V=[9,13,27,32],_f=sr&&"CompositionEvent"in window,sa=null;sr&&"documentMode"in document&&(sa=document.documentMode);var NV=sr&&"TextEvent"in window&&!sa,PC=sr&&(!_f||sa&&8<sa&&11>=sa),EC=String.fromCharCode(32),AC=!1;function TC(n,e){switch(n){case"keyup":return _V.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function OC(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ns=!1;function kV(n,e){switch(n){case"compositionend":return OC(e);case"keypress":return e.which!==32?null:(AC=!0,EC);case"textInput":return n=e.data,n===EC&&AC?null:n;default:return null}}function IV(n,e){if(Ns)return n==="compositionend"||!_f&&TC(n,e)?(n=bC(),ec=Pf=Vr=null,Ns=!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 PC&&e.locale!=="ko"?null:e.data;default:return null}}var LV={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 MC(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!LV[n.type]:e==="textarea"}function _C(n,e,t,r){Kx(r),e=lc(e,"onChange"),0<e.length&&(t=new Ef("onChange","change",null,t,r),n.push({event:t,listeners:e}))}var oa=null,aa=null;function RV(n){XC(n,0)}function ic(n){var e=js(n);if(Bx(e))return n}function jV(n,e){if(n==="change")return e}var NC=!1;if(sr){var Nf;if(sr){var kf="oninput"in document;if(!kf){var kC=document.createElement("div");kC.setAttribute("oninput","return;"),kf=typeof kC.oninput=="function"}Nf=kf}else Nf=!1;NC=Nf&&(!document.documentMode||9<document.documentMode)}function IC(){oa&&(oa.detachEvent("onpropertychange",LC),aa=oa=null)}function LC(n){if(n.propertyName==="value"&&ic(aa)){var e=[];_C(e,aa,n,hf(n)),eC(RV,e)}}function DV(n,e,t){n==="focusin"?(IC(),oa=e,aa=t,oa.attachEvent("onpropertychange",LC)):n==="focusout"&&IC()}function BV(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return ic(aa)}function $V(n,e){if(n==="click")return ic(e)}function zV(n,e){if(n==="input"||n==="change")return ic(e)}function FV(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var xn=typeof Object.is=="function"?Object.is:FV;function la(n,e){if(xn(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(!qh.call(e,i)||!xn(n[i],e[i]))return!1}return!0}function RC(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function jC(n,e){var t=RC(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=RC(t)}}function DC(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?DC(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function BC(){for(var n=window,e=Fl();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=Fl(n.document)}return e}function If(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 qV(n){var e=BC(),t=n.focusedElem,r=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&DC(t.ownerDocument.documentElement,t)){if(r!==null&&If(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=jC(t,s);var o=jC(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 VV=sr&&"documentMode"in document&&11>=document.documentMode,ks=null,Lf=null,ca=null,Rf=!1;function $C(n,e,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;Rf||ks==null||ks!==Fl(r)||(r=ks,"selectionStart"in r&&If(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&&la(ca,r)||(ca=r,r=lc(Lf,"onSelect"),0<r.length&&(e=new Ef("onSelect","select",null,e,t),n.push({event:e,listeners:r}),e.target=ks)))}function sc(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var Is={animationend:sc("Animation","AnimationEnd"),animationiteration:sc("Animation","AnimationIteration"),animationstart:sc("Animation","AnimationStart"),transitionend:sc("Transition","TransitionEnd")},jf={},zC={};sr&&(zC=document.createElement("div").style,"AnimationEvent"in window||(delete Is.animationend.animation,delete Is.animationiteration.animation,delete Is.animationstart.animation),"TransitionEvent"in window||delete Is.transitionend.transition);function oc(n){if(jf[n])return jf[n];if(!Is[n])return n;var e=Is[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in zC)return jf[n]=e[t];return n}var FC=oc("animationend"),qC=oc("animationiteration"),VC=oc("animationstart"),GC=oc("transitionend"),HC=new Map,UC="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 Gr(n,e){HC.set(n,e),Ci(e,[n])}for(var Df=0;Df<UC.length;Df++){var Bf=UC[Df],GV=Bf.toLowerCase(),HV=Bf[0].toUpperCase()+Bf.slice(1);Gr(GV,"on"+HV)}Gr(FC,"onAnimationEnd"),Gr(qC,"onAnimationIteration"),Gr(VC,"onAnimationStart"),Gr("dblclick","onDoubleClick"),Gr("focusin","onFocus"),Gr("focusout","onBlur"),Gr(GC,"onTransitionEnd"),Ss("onMouseEnter",["mouseout","mouseover"]),Ss("onMouseLeave",["mouseout","mouseover"]),Ss("onPointerEnter",["pointerout","pointerover"]),Ss("onPointerLeave",["pointerout","pointerover"]),Ci("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ci("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ci("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ci("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ci("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ci("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ua="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(" "),UV=new Set("cancel close invalid load scroll toggle".split(" ").concat(ua));function WC(n,e,t){var r=n.type||"unknown-event";n.currentTarget=t,Gq(r,e,void 0,n),n.currentTarget=null}function XC(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;WC(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;WC(i,a,c),s=l}}}if(Gl)throw n=pf,Gl=!1,pf=null,n}function _e(n,e){var t=e[Uf];t===void 0&&(t=e[Uf]=new Set);var r=n+"__bubble";t.has(r)||(YC(e,n,2,!1),t.add(r))}function $f(n,e,t){var r=0;e&&(r|=4),YC(t,n,r,e)}var ac="_reactListening"+Math.random().toString(36).slice(2);function ha(n){if(!n[ac]){n[ac]=!0,_x.forEach(function(t){t!=="selectionchange"&&(UV.has(t)||$f(t,!1,n),$f(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[ac]||(e[ac]=!0,$f("selectionchange",!1,e))}}function YC(n,e,t,r){switch(vC(e)){case 1:var i=oV;break;case 4:i=aV;break;default:i=Cf}t=i.bind(null,e,t,n),i=void 0,!gf||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 zf(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=Pi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}eC(function(){var c=s,u=hf(t),h=[];e:{var f=HC.get(n);if(f!==void 0){var d=Ef,g=n;switch(n){case"keypress":if(tc(t)===0)break e;case"keydown":case"keyup":d=CV;break;case"focusin":g="focus",d=Of;break;case"focusout":g="blur",d=Of;break;case"beforeblur":case"afterblur":d=Of;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=xC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=uV;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=EV;break;case FC:case qC:case VC:d=dV;break;case GC:d=TV;break;case"scroll":d=lV;break;case"wheel":d=MV;break;case"copy":case"cut":case"paste":d=pV;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=SC}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=Wo(y,m),w!=null&&p.push(fa(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!==uf&&(g=t.relatedTarget||t.fromElement)&&(Pi(g)||g[ar]))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?Pi(g):null,g!==null&&(b=Si(g),g!==b||g.tag!==5&&g.tag!==6)&&(g=null)):(d=null,g=c),d!==g)){if(p=xC,w="onMouseLeave",m="onMouseEnter",y="mouse",(n==="pointerout"||n==="pointerover")&&(p=SC,w="onPointerLeave",m="onPointerEnter",y="pointer"),b=d==null?f:js(d),v=g==null?f:js(g),f=new p(w,y+"leave",d,t,u),f.target=b,f.relatedTarget=v,w=null,Pi(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=Ls(v))y++;for(v=0,w=m;w;w=Ls(w))v++;for(;0<y-v;)p=Ls(p),y--;for(;0<v-y;)m=Ls(m),v--;for(;y--;){if(p===m||m!==null&&p===m.alternate)break t;p=Ls(p),m=Ls(m)}p=null}else p=null;d!==null&&KC(h,f,d,p,!1),g!==null&&b!==null&&KC(h,b,g,p,!0)}}e:{if(f=c?js(c):window,d=f.nodeName&&f.nodeName.toLowerCase(),d==="select"||d==="input"&&f.type==="file")var x=jV;else if(MC(f))if(NC)x=zV;else{x=BV;var C=DV}else(d=f.nodeName)&&d.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(x=$V);if(x&&(x=x(n,c))){_C(h,x,t,u);break e}C&&C(n,f,c),n==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&sf(f,"number",f.value)}switch(C=c?js(c):window,n){case"focusin":(MC(C)||C.contentEditable==="true")&&(ks=C,Lf=c,ca=null);break;case"focusout":ca=Lf=ks=null;break;case"mousedown":Rf=!0;break;case"contextmenu":case"mouseup":case"dragend":Rf=!1,$C(h,t,u);break;case"selectionchange":if(VV)break;case"keydown":case"keyup":$C(h,t,u)}var P;if(_f)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 Ns?TC(n,t)&&(E="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(E="onCompositionStart");E&&(PC&&t.locale!=="ko"&&(Ns||E!=="onCompositionStart"?E==="onCompositionEnd"&&Ns&&(P=bC()):(Vr=u,Pf="value"in Vr?Vr.value:Vr.textContent,Ns=!0)),C=lc(c,E),0<C.length&&(E=new CC(E,n,null,t,u),h.push({event:E,listeners:C}),P?E.data=P:(P=OC(t),P!==null&&(E.data=P)))),(P=NV?kV(n,t):IV(n,t))&&(c=lc(c,"onBeforeInput"),0<c.length&&(u=new CC("onBeforeInput","beforeinput",null,t,u),h.push({event:u,listeners:c}),u.data=P))}XC(h,e)})}function fa(n,e,t){return{instance:n,listener:e,currentTarget:t}}function lc(n,e){for(var t=e+"Capture",r=[];n!==null;){var i=n,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Wo(n,t),s!=null&&r.unshift(fa(n,s,i)),s=Wo(n,e),s!=null&&r.push(fa(n,s,i))),n=n.return}return r}function Ls(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function KC(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=Wo(t,s),l!=null&&o.unshift(fa(t,l,a))):i||(l=Wo(t,s),l!=null&&o.push(fa(t,l,a)))),t=t.return}o.length!==0&&n.push({event:e,listeners:o})}var WV=/\r\n?/g,XV=/\u0000|\uFFFD/g;function JC(n){return(typeof n=="string"?n:""+n).replace(WV,`
266
- `).replace(XV,"")}function cc(n,e,t){if(e=JC(e),JC(n)!==e&&t)throw Error(D(425))}function uc(){}var Ff=null,qf=null;function Vf(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 Gf=typeof setTimeout=="function"?setTimeout:void 0,YV=typeof clearTimeout=="function"?clearTimeout:void 0,QC=typeof Promise=="function"?Promise:void 0,KV=typeof queueMicrotask=="function"?queueMicrotask:typeof QC!="undefined"?function(n){return QC.resolve(null).then(n).catch(JV)}:Gf;function JV(n){setTimeout(function(){throw n})}function Hf(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),na(e);return}r--}else t!=="$"&&t!=="$?"&&t!=="$!"||r++;t=i}while(t);na(e)}function Hr(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 ZC(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 Rs=Math.random().toString(36).slice(2),zn="__reactFiber$"+Rs,da="__reactProps$"+Rs,ar="__reactContainer$"+Rs,Uf="__reactEvents$"+Rs,QV="__reactListeners$"+Rs,ZV="__reactHandles$"+Rs;function Pi(n){var e=n[zn];if(e)return e;for(var t=n.parentNode;t;){if(e=t[ar]||t[zn]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=ZC(n);n!==null;){if(t=n[zn])return t;n=ZC(n)}return e}n=t,t=n.parentNode}return null}function ga(n){return n=n[zn]||n[ar],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function js(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(D(33))}function hc(n){return n[da]||null}var Wf=[],Ds=-1;function Ur(n){return{current:n}}function Ne(n){0>Ds||(n.current=Wf[Ds],Wf[Ds]=null,Ds--)}function Oe(n,e){Ds++,Wf[Ds]=n.current,n.current=e}var Wr={},Ct=Ur(Wr),Lt=Ur(!1),Ei=Wr;function Bs(n,e){var t=n.type.contextTypes;if(!t)return Wr;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 Rt(n){return n=n.childContextTypes,n!=null}function fc(){Ne(Lt),Ne(Ct)}function eS(n,e,t){if(Ct.current!==Wr)throw Error(D(168));Oe(Ct,e),Oe(Lt,t)}function tS(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(D(108,Dq(n)||"Unknown",i));return je({},t,r)}function dc(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Wr,Ei=Ct.current,Oe(Ct,n),Oe(Lt,Lt.current),!0}function nS(n,e,t){var r=n.stateNode;if(!r)throw Error(D(169));t?(n=tS(n,e,Ei),r.__reactInternalMemoizedMergedChildContext=n,Ne(Lt),Ne(Ct),Oe(Ct,n)):Ne(Lt),Oe(Lt,t)}var lr=null,gc=!1,Xf=!1;function rS(n){lr===null?lr=[n]:lr.push(n)}function e6(n){gc=!0,rS(n)}function Xr(){if(!Xf&&lr!==null){Xf=!0;var n=0,e=be;try{var t=lr;for(be=1;n<t.length;n++){var r=t[n];do r=r(!0);while(r!==null)}lr=null,gc=!1}catch(i){throw lr!==null&&(lr=lr.slice(n+1)),sC(mf,Xr),i}finally{be=e,Xf=!1}}return null}var $s=[],zs=0,pc=null,mc=0,sn=[],on=0,Ai=null,cr=1,ur="";function Ti(n,e){$s[zs++]=mc,$s[zs++]=pc,pc=n,mc=e}function iS(n,e,t){sn[on++]=cr,sn[on++]=ur,sn[on++]=Ai,Ai=n;var r=cr;n=ur;var i=32-wn(r)-1;r&=~(1<<i),t+=1;var s=32-wn(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,cr=1<<32-wn(e)+i|t<<i|r,ur=s+n}else cr=1<<s|t<<i|r,ur=n}function Yf(n){n.return!==null&&(Ti(n,1),iS(n,1,0))}function Kf(n){for(;n===pc;)pc=$s[--zs],$s[zs]=null,mc=$s[--zs],$s[zs]=null;for(;n===Ai;)Ai=sn[--on],sn[on]=null,ur=sn[--on],sn[on]=null,cr=sn[--on],sn[on]=null}var Ht=null,Ut=null,ke=!1,Cn=null;function sS(n,e){var t=un(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 oS(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,Ht=n,Ut=Hr(e.firstChild),!0):!1;case 6:return e=n.pendingProps===""||e.nodeType!==3?null:e,e!==null?(n.stateNode=e,Ht=n,Ut=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=Ai!==null?{id:cr,overflow:ur}:null,n.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=un(18,null,null,0),t.stateNode=e,t.return=n,n.child=t,Ht=n,Ut=null,!0):!1;default:return!1}}function Jf(n){return(n.mode&1)!==0&&(n.flags&128)===0}function Qf(n){if(ke){var e=Ut;if(e){var t=e;if(!oS(n,e)){if(Jf(n))throw Error(D(418));e=Hr(t.nextSibling);var r=Ht;e&&oS(n,e)?sS(r,t):(n.flags=n.flags&-4097|2,ke=!1,Ht=n)}}else{if(Jf(n))throw Error(D(418));n.flags=n.flags&-4097|2,ke=!1,Ht=n}}}function aS(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;Ht=n}function yc(n){if(n!==Ht)return!1;if(!ke)return aS(n),ke=!0,!1;var e;if((e=n.tag!==3)&&!(e=n.tag!==5)&&(e=n.type,e=e!=="head"&&e!=="body"&&!Vf(n.type,n.memoizedProps)),e&&(e=Ut)){if(Jf(n))throw lS(),Error(D(418));for(;e;)sS(n,e),e=Hr(e.nextSibling)}if(aS(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(D(317));e:{for(n=n.nextSibling,e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"){if(e===0){Ut=Hr(n.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}n=n.nextSibling}Ut=null}}else Ut=Ht?Hr(n.stateNode.nextSibling):null;return!0}function lS(){for(var n=Ut;n;)n=Hr(n.nextSibling)}function Fs(){Ut=Ht=null,ke=!1}function Zf(n){Cn===null?Cn=[n]:Cn.push(n)}var t6=or.ReactCurrentBatchConfig;function Sn(n,e){if(n&&n.defaultProps){e=je({},e),n=n.defaultProps;for(var t in n)e[t]===void 0&&(e[t]=n[t]);return e}return e}var vc=Ur(null),bc=null,qs=null,ed=null;function td(){ed=qs=bc=null}function nd(n){var e=vc.current;Ne(vc),n._currentValue=e}function rd(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 Vs(n,e){bc=n,ed=qs=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(jt=!0),n.firstContext=null)}function an(n){var e=n._currentValue;if(ed!==n)if(n={context:n,memoizedValue:e,next:null},qs===null){if(bc===null)throw Error(D(308));qs=n,bc.dependencies={lanes:0,firstContext:n}}else qs=qs.next=n;return e}var Oi=null;function id(n){Oi===null?Oi=[n]:Oi.push(n)}function cS(n,e,t,r){var i=e.interleaved;return i===null?(t.next=t,id(e)):(t.next=i.next,i.next=t),e.interleaved=t,hr(n,r)}function hr(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 Yr=!1;function sd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uS(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 fr(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function Kr(n,e,t){var r=n.updateQueue;if(r===null)return null;if(r=r.shared,fe&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,hr(n,t)}return i=r.interleaved,i===null?(e.next=e,id(r)):(e.next=i.next,i.next=e),r.interleaved=e,hr(n,t)}function wc(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,bf(n,t)}}function hS(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 xc(n,e,t,r){var i=n.updateQueue;Yr=!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=je({},h,f);break e;case 2:Yr=!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);Ni|=o,n.lanes=o,n.memoizedState=h}}function fS(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(D(191,i));i.call(r)}}}var dS=new Mx.Component().refs;function od(n,e,t,r){e=n.memoizedState,t=t(r,e),t=t==null?e:je({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var Cc={isMounted:function(n){return(n=n._reactInternals)?Si(n)===n:!1},enqueueSetState:function(n,e,t){n=n._reactInternals;var r=kt(),i=ei(n),s=fr(r,i);s.payload=e,t!=null&&(s.callback=t),e=Kr(n,s,i),e!==null&&(An(e,n,i,r),wc(e,n,i))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var r=kt(),i=ei(n),s=fr(r,i);s.tag=1,s.payload=e,t!=null&&(s.callback=t),e=Kr(n,s,i),e!==null&&(An(e,n,i,r),wc(e,n,i))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=kt(),r=ei(n),i=fr(t,r);i.tag=2,e!=null&&(i.callback=e),e=Kr(n,i,r),e!==null&&(An(e,n,r,t),wc(e,n,r))}};function gS(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?!la(t,r)||!la(i,s):!0}function pS(n,e,t){var r=!1,i=Wr,s=e.contextType;return typeof s=="object"&&s!==null?s=an(s):(i=Rt(e)?Ei:Ct.current,r=e.contextTypes,s=(r=r!=null)?Bs(n,i):Wr),e=new e(t,s),n.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Cc,n.stateNode=e,e._reactInternals=n,r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=i,n.__reactInternalMemoizedMaskedChildContext=s),e}function mS(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&&Cc.enqueueReplaceState(e,e.state,null)}function ad(n,e,t,r){var i=n.stateNode;i.props=t,i.state=n.memoizedState,i.refs=dS,sd(n);var s=e.contextType;typeof s=="object"&&s!==null?i.context=an(s):(s=Rt(e)?Ei:Ct.current,i.context=Bs(n,s)),i.state=n.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(od(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&&Cc.enqueueReplaceState(i,i.state,null),xc(n,t,i,r),i.state=n.memoizedState),typeof i.componentDidMount=="function"&&(n.flags|=4194308)}function pa(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(D(309));var r=t.stateNode}if(!r)throw Error(D(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===dS&&(a=i.refs={}),o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof n!="string")throw Error(D(284));if(!t._owner)throw Error(D(290,n))}return n}function Sc(n,e){throw n=Object.prototype.toString.call(e),Error(D(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n))}function yS(n){var e=n._init;return e(n._payload)}function vS(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=ni(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=Gd(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===Es?u(m,y,v.props.children,w,v.key):y!==null&&(y.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Dr&&yS(x)===y.type)?(w=i(y,v.props),w.ref=pa(m,y,v),w.return=m,w):(w=qc(v.type,v.key,v.props,null,m.mode,w),w.ref=pa(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=Hd(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=Ri(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=Gd(""+y,m.mode,v),y.return=m,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case $l:return v=qc(y.type,y.key,y.props,null,m.mode,v),v.ref=pa(m,null,y),v.return=m,v;case Ps:return y=Hd(y,m.mode,v),y.return=m,y;case Dr:var w=y._init;return h(m,w(y._payload),v)}if(Go(y)||qo(y))return y=Ri(y,m.mode,v,null),y.return=m,y;Sc(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 $l:return v.key===x?l(m,y,v,w):null;case Ps:return v.key===x?c(m,y,v,w):null;case Dr:return x=v._init,f(m,y,x(v._payload),w)}if(Go(v)||qo(v))return x!==null?null:u(m,y,v,w,null);Sc(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 $l:return m=m.get(w.key===null?v:w.key)||null,l(y,m,w,x);case Ps: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(Go(w)||qo(w))return m=m.get(v)||null,u(y,m,w,x,null);Sc(y,w)}return null}function g(m,y,v,w){for(var x=null,C=null,P=y,E=y=0,A=null;P!==null&&E<v.length;E++){P.index>E?(A=P,P=null):A=P.sibling;var O=f(m,P,v[E],w);if(O===null){P===null&&(P=A);break}n&&P&&O.alternate===null&&e(m,P),y=s(O,y,E),C===null?x=O:C.sibling=O,C=O,P=A}if(E===v.length)return t(m,P),ke&&Ti(m,E),x;if(P===null){for(;E<v.length;E++)P=h(m,v[E],w),P!==null&&(y=s(P,y,E),C===null?x=P:C.sibling=P,C=P);return ke&&Ti(m,E),x}for(P=r(m,P);E<v.length;E++)A=d(P,m,E,v[E],w),A!==null&&(n&&A.alternate!==null&&P.delete(A.key===null?E:A.key),y=s(A,y,E),C===null?x=A:C.sibling=A,C=A);return n&&P.forEach(function(T){return e(m,T)}),ke&&Ti(m,E),x}function p(m,y,v,w){var x=qo(v);if(typeof x!="function")throw Error(D(150));if(v=x.call(v),v==null)throw Error(D(151));for(var C=x=null,P=y,E=y=0,A=null,O=v.next();P!==null&&!O.done;E++,O=v.next()){P.index>E?(A=P,P=null):A=P.sibling;var T=f(m,P,O.value,w);if(T===null){P===null&&(P=A);break}n&&P&&T.alternate===null&&e(m,P),y=s(T,y,E),C===null?x=T:C.sibling=T,C=T,P=A}if(O.done)return t(m,P),ke&&Ti(m,E),x;if(P===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 ke&&Ti(m,E),x}for(P=r(m,P);!O.done;E++,O=v.next())O=d(P,m,E,O.value,w),O!==null&&(n&&O.alternate!==null&&P.delete(O.key===null?E:O.key),y=s(O,y,E),C===null?x=O:C.sibling=O,C=O);return n&&P.forEach(function(L){return e(m,L)}),ke&&Ti(m,E),x}function b(m,y,v,w){if(typeof v=="object"&&v!==null&&v.type===Es&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case $l:e:{for(var x=v.key,C=y;C!==null;){if(C.key===x){if(x=v.type,x===Es){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&&yS(x)===C.type){t(m,C.sibling),y=i(C,v.props),y.ref=pa(m,C,v),y.return=m,m=y;break e}t(m,C);break}else e(m,C);C=C.sibling}v.type===Es?(y=Ri(v.props.children,m.mode,w,v.key),y.return=m,m=y):(w=qc(v.type,v.key,v.props,null,m.mode,w),w.ref=pa(m,y,v),w.return=m,m=w)}return o(m);case Ps: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=Hd(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(Go(v))return g(m,y,v,w);if(qo(v))return p(m,y,v,w);Sc(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=Gd(v,m.mode,w),y.return=m,m=y),o(m)):t(m,y)}return b}var Gs=vS(!0),bS=vS(!1),ma={},Fn=Ur(ma),ya=Ur(ma),va=Ur(ma);function Mi(n){if(n===ma)throw Error(D(174));return n}function ld(n,e){switch(Oe(va,e),Oe(ya,n),Oe(Fn,ma),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:af(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=af(e,n)}Ne(Fn),Oe(Fn,e)}function Hs(){Ne(Fn),Ne(ya),Ne(va)}function wS(n){Mi(va.current);var e=Mi(Fn.current),t=af(e,n.type);e!==t&&(Oe(ya,n),Oe(Fn,t))}function cd(n){ya.current===n&&(Ne(Fn),Ne(ya))}var De=Ur(0);function Pc(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 ud=[];function hd(){for(var n=0;n<ud.length;n++)ud[n]._workInProgressVersionPrimary=null;ud.length=0}var Ec=or.ReactCurrentDispatcher,fd=or.ReactCurrentBatchConfig,_i=0,Be=null,it=null,ht=null,Ac=!1,ba=!1,wa=0,n6=0;function St(){throw Error(D(321))}function dd(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!xn(n[t],e[t]))return!1;return!0}function gd(n,e,t,r,i,s){if(_i=s,Be=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Ec.current=n===null||n.memoizedState===null?o6:a6,n=t(r,i),ba){s=0;do{if(ba=!1,wa=0,25<=s)throw Error(D(301));s+=1,ht=it=null,e.updateQueue=null,Ec.current=l6,n=t(r,i)}while(ba)}if(Ec.current=Mc,e=it!==null&&it.next!==null,_i=0,ht=it=Be=null,Ac=!1,e)throw Error(D(300));return n}function pd(){var n=wa!==0;return wa=0,n}function qn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ht===null?Be.memoizedState=ht=n:ht=ht.next=n,ht}function ln(){if(it===null){var n=Be.alternate;n=n!==null?n.memoizedState:null}else n=it.next;var e=ht===null?Be.memoizedState:ht.next;if(e!==null)ht=e,it=n;else{if(n===null)throw Error(D(310));it=n,n={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},ht===null?Be.memoizedState=ht=n:ht=ht.next=n}return ht}function xa(n,e){return typeof e=="function"?e(n):e}function md(n){var e=ln(),t=e.queue;if(t===null)throw Error(D(311));t.lastRenderedReducer=n;var r=it,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((_i&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,Be.lanes|=u,Ni|=u}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,xn(r,e.memoizedState)||(jt=!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,Be.lanes|=s,Ni|=s,i=i.next;while(i!==n)}else i===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function yd(n){var e=ln(),t=e.queue;if(t===null)throw Error(D(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);xn(s,e.memoizedState)||(jt=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),t.lastRenderedState=s}return[s,r]}function xS(){}function CS(n,e){var t=Be,r=ln(),i=e(),s=!xn(r.memoizedState,i);if(s&&(r.memoizedState=i,jt=!0),r=r.queue,vd(ES.bind(null,t,r,n),[n]),r.getSnapshot!==e||s||ht!==null&&ht.memoizedState.tag&1){if(t.flags|=2048,Ca(9,PS.bind(null,t,r,i,e),void 0,null),ft===null)throw Error(D(349));_i&30||SS(t,e,i)}return i}function SS(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=Be.updateQueue,e===null?(e={lastEffect:null,stores:null},Be.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function PS(n,e,t,r){e.value=t,e.getSnapshot=r,AS(e)&&TS(n)}function ES(n,e,t){return t(function(){AS(e)&&TS(n)})}function AS(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!xn(n,t)}catch(r){return!0}}function TS(n){var e=hr(n,1);e!==null&&An(e,n,1,-1)}function OS(n){var e=qn();return typeof n=="function"&&(n=n()),e.memoizedState=e.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:n},e.queue=n,n=n.dispatch=s6.bind(null,Be,n),[e.memoizedState,n]}function Ca(n,e,t,r){return n={tag:n,create:e,destroy:t,deps:r,next:null},e=Be.updateQueue,e===null?(e={lastEffect:null,stores:null},Be.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 MS(){return ln().memoizedState}function Tc(n,e,t,r){var i=qn();Be.flags|=n,i.memoizedState=Ca(1|e,t,void 0,r===void 0?null:r)}function Oc(n,e,t,r){var i=ln();r=r===void 0?null:r;var s=void 0;if(it!==null){var o=it.memoizedState;if(s=o.destroy,r!==null&&dd(r,o.deps)){i.memoizedState=Ca(e,t,s,r);return}}Be.flags|=n,i.memoizedState=Ca(1|e,t,s,r)}function _S(n,e){return Tc(8390656,8,n,e)}function vd(n,e){return Oc(2048,8,n,e)}function NS(n,e){return Oc(4,2,n,e)}function kS(n,e){return Oc(4,4,n,e)}function IS(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,Oc(4,4,IS.bind(null,e,n),t)}function bd(){}function RS(n,e){var t=ln();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&dd(e,r[1])?r[0]:(t.memoizedState=[n,e],n)}function jS(n,e){var t=ln();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&dd(e,r[1])?r[0]:(n=n(),t.memoizedState=[n,e],n)}function DS(n,e,t){return _i&21?(xn(t,e)||(t=cC(),Be.lanes|=t,Ni|=t,n.baseState=!0),e):(n.baseState&&(n.baseState=!1,jt=!0),n.memoizedState=t)}function r6(n,e){var t=be;be=t!==0&&4>t?t:4,n(!0);var r=fd.transition;fd.transition={};try{n(!1),e()}finally{be=t,fd.transition=r}}function BS(){return ln().memoizedState}function i6(n,e,t){var r=ei(n);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},$S(n))zS(e,t);else if(t=cS(n,e,t,r),t!==null){var i=kt();An(t,n,r,i),FS(t,e,r)}}function s6(n,e,t){var r=ei(n),i={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if($S(n))zS(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,xn(a,o)){var l=e.interleaved;l===null?(i.next=i,id(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch(c){}finally{}t=cS(n,e,i,r),t!==null&&(i=kt(),An(t,n,r,i),FS(t,e,r))}}function $S(n){var e=n.alternate;return n===Be||e!==null&&e===Be}function zS(n,e){ba=Ac=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function FS(n,e,t){if(t&4194240){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,bf(n,t)}}var Mc={readContext:an,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},o6={readContext:an,useCallback:function(n,e){return qn().memoizedState=[n,e===void 0?null:e],n},useContext:an,useEffect:_S,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Tc(4194308,4,IS.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Tc(4194308,4,n,e)},useInsertionEffect:function(n,e){return Tc(4,2,n,e)},useMemo:function(n,e){var t=qn();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var r=qn();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=i6.bind(null,Be,n),[r.memoizedState,n]},useRef:function(n){var e=qn();return n={current:n},e.memoizedState=n},useState:OS,useDebugValue:bd,useDeferredValue:function(n){return qn().memoizedState=n},useTransition:function(){var n=OS(!1),e=n[0];return n=r6.bind(null,n[1]),qn().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var r=Be,i=qn();if(ke){if(t===void 0)throw Error(D(407));t=t()}else{if(t=e(),ft===null)throw Error(D(349));_i&30||SS(r,e,t)}i.memoizedState=t;var s={value:t,getSnapshot:e};return i.queue=s,_S(ES.bind(null,r,s,n),[n]),r.flags|=2048,Ca(9,PS.bind(null,r,s,t,e),void 0,null),t},useId:function(){var n=qn(),e=ft.identifierPrefix;if(ke){var t=ur,r=cr;t=(r&~(1<<32-wn(r)-1)).toString(32)+t,e=":"+e+"R"+t,t=wa++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=n6++,e=":"+e+"r"+t.toString(32)+":";return n.memoizedState=e},unstable_isNewReconciler:!1},a6={readContext:an,useCallback:RS,useContext:an,useEffect:vd,useImperativeHandle:LS,useInsertionEffect:NS,useLayoutEffect:kS,useMemo:jS,useReducer:md,useRef:MS,useState:function(){return md(xa)},useDebugValue:bd,useDeferredValue:function(n){var e=ln();return DS(e,it.memoizedState,n)},useTransition:function(){var n=md(xa)[0],e=ln().memoizedState;return[n,e]},useMutableSource:xS,useSyncExternalStore:CS,useId:BS,unstable_isNewReconciler:!1},l6={readContext:an,useCallback:RS,useContext:an,useEffect:vd,useImperativeHandle:LS,useInsertionEffect:NS,useLayoutEffect:kS,useMemo:jS,useReducer:yd,useRef:MS,useState:function(){return yd(xa)},useDebugValue:bd,useDeferredValue:function(n){var e=ln();return it===null?e.memoizedState=n:DS(e,it.memoizedState,n)},useTransition:function(){var n=yd(xa)[0],e=ln().memoizedState;return[n,e]},useMutableSource:xS,useSyncExternalStore:CS,useId:BS,unstable_isNewReconciler:!1};function Us(n,e){try{var t="",r=e;do t+=jq(r),r=r.return;while(r);var i=t}catch(s){i=`
267
- Error generating stack: `+s.message+`
268
- `+s.stack}return{value:n,source:e,stack:i,digest:null}}function wd(n,e,t){return{value:n,source:null,stack:t!=null?t:null,digest:e!=null?e:null}}function xd(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var c6=typeof WeakMap=="function"?WeakMap:Map;function qS(n,e,t){t=fr(-1,t),t.tag=3,t.payload={element:null};var r=e.value;return t.callback=function(){jc||(jc=!0,jd=r),xd(n,e)},t}function VS(n,e,t){t=fr(-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(){xd(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){xd(n,e),typeof r!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function GS(n,e,t){var r=n.pingCache;if(r===null){r=n.pingCache=new c6;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=S6.bind(null,n,e,t),e.then(n,n))}function HS(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 US(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=fr(-1,1),e.tag=2,Kr(t,e,1))),t.lanes|=1),n)}var u6=or.ReactCurrentOwner,jt=!1;function Nt(n,e,t,r){e.child=n===null?bS(e,null,t,r):Gs(e,n.child,t,r)}function WS(n,e,t,r,i){t=t.render;var s=e.ref;return Vs(e,i),r=gd(n,e,t,r,s,i),t=pd(),n!==null&&!jt?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,dr(n,e,i)):(ke&&t&&Yf(e),e.flags|=1,Nt(n,e,r,i),e.child)}function XS(n,e,t,r,i){if(n===null){var s=t.type;return typeof s=="function"&&!Vd(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,YS(n,e,s,r,i)):(n=qc(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:la,t(o,r)&&n.ref===e.ref)return dr(n,e,i)}return e.flags|=1,n=ni(s,r),n.ref=e.ref,n.return=e,e.child=n}function YS(n,e,t,r,i){if(n!==null){var s=n.memoizedProps;if(la(s,r)&&n.ref===e.ref)if(jt=!1,e.pendingProps=r=s,(n.lanes&i)!==0)n.flags&131072&&(jt=!0);else return e.lanes=n.lanes,dr(n,e,i)}return Cd(n,e,t,r,i)}function KS(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},Oe(Xs,Wt),Wt|=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,Oe(Xs,Wt),Wt|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:t,Oe(Xs,Wt),Wt|=r}else s!==null?(r=s.baseLanes|t,e.memoizedState=null):r=t,Oe(Xs,Wt),Wt|=r;return Nt(n,e,i,t),e.child}function JS(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function Cd(n,e,t,r,i){var s=Rt(t)?Ei:Ct.current;return s=Bs(e,s),Vs(e,i),t=gd(n,e,t,r,s,i),r=pd(),n!==null&&!jt?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,dr(n,e,i)):(ke&&r&&Yf(e),e.flags|=1,Nt(n,e,t,i),e.child)}function QS(n,e,t,r,i){if(Rt(t)){var s=!0;dc(e)}else s=!1;if(Vs(e,i),e.stateNode===null)Nc(n,e),pS(e,t,r),ad(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=an(c):(c=Rt(t)?Ei:Ct.current,c=Bs(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)&&mS(e,o,r,c),Yr=!1;var f=e.memoizedState;o.state=f,xc(e,r,o,i),l=e.memoizedState,a!==r||f!==l||Lt.current||Yr?(typeof u=="function"&&(od(e,t,u,r),l=e.memoizedState),(a=Yr||gS(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,uS(n,e),a=e.memoizedProps,c=e.type===e.elementType?a:Sn(e.type,a),o.props=c,h=e.pendingProps,f=o.context,l=t.contextType,typeof l=="object"&&l!==null?l=an(l):(l=Rt(t)?Ei:Ct.current,l=Bs(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)&&mS(e,o,r,l),Yr=!1,f=e.memoizedState,o.state=f,xc(e,r,o,i);var g=e.memoizedState;a!==h||f!==g||Lt.current||Yr?(typeof d=="function"&&(od(e,t,d,r),g=e.memoizedState),(c=Yr||gS(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 Sd(n,e,t,r,s,i)}function Sd(n,e,t,r,i,s){JS(n,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&nS(e,t,!1),dr(n,e,s);r=e.stateNode,u6.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,n!==null&&o?(e.child=Gs(e,n.child,null,s),e.child=Gs(e,null,a,s)):Nt(n,e,a,s),e.memoizedState=r.state,i&&nS(e,t,!0),e.child}function ZS(n){var e=n.stateNode;e.pendingContext?eS(n,e.pendingContext,e.pendingContext!==e.context):e.context&&eS(n,e.context,!1),ld(n,e.containerInfo)}function eP(n,e,t,r,i){return Fs(),Zf(i),e.flags|=256,Nt(n,e,t,r),e.child}var Pd={dehydrated:null,treeContext:null,retryLane:0};function Ed(n){return{baseLanes:n,cachePool:null,transitions:null}}function tP(n,e,t){var r=e.pendingProps,i=De.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),Oe(De,i&1),n===null)return Qf(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=Vc(o,r,0,null),n=Ri(n,r,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=Ed(t),e.memoizedState=Pd,n):Ad(e,o));if(i=n.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return h6(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=ni(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=ni(a,s):(s=Ri(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?Ed(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=n.childLanes&~t,e.memoizedState=Pd,r}return s=n.child,n=s.sibling,r=ni(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 Ad(n,e){return e=Vc({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function _c(n,e,t,r){return r!==null&&Zf(r),Gs(e,n.child,null,t),n=Ad(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function h6(n,e,t,r,i,s,o){if(t)return e.flags&256?(e.flags&=-257,r=wd(Error(D(422))),_c(n,e,o,r)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=Vc({mode:"visible",children:r.children},i,0,null),s=Ri(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&Gs(e,n.child,null,o),e.child.memoizedState=Ed(o),e.memoizedState=Pd,s);if(!(e.mode&1))return _c(n,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(D(419)),r=wd(s,r,void 0),_c(n,e,o,r)}if(a=(o&n.childLanes)!==0,jt||a){if(r=ft,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,hr(n,i),An(r,n,i,-1))}return qd(),r=wd(Error(D(421))),_c(n,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=n.child,e=P6.bind(null,n),i._reactRetry=e,null):(n=s.treeContext,Ut=Hr(i.nextSibling),Ht=e,ke=!0,Cn=null,n!==null&&(sn[on++]=cr,sn[on++]=ur,sn[on++]=Ai,cr=n.id,ur=n.overflow,Ai=e),e=Ad(e,r.children),e.flags|=4096,e)}function nP(n,e,t){n.lanes|=e;var r=n.alternate;r!==null&&(r.lanes|=e),rd(n.return,e,t)}function Td(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 rP(n,e,t){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(Nt(n,e,r.children,t),r=De.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&&nP(n,t,e);else if(n.tag===19)nP(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(Oe(De,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&&Pc(n)===null&&(i=t),t=t.sibling;t=i,t===null?(i=e.child,e.child=null):(i=t.sibling,t.sibling=null),Td(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&&Pc(n)===null){e.child=i;break}n=i.sibling,i.sibling=t,t=i,i=n}Td(e,!0,t,null,s);break;case"together":Td(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Nc(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function dr(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),Ni|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(D(153));if(e.child!==null){for(n=e.child,t=ni(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=ni(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function f6(n,e,t){switch(e.tag){case 3:ZS(e),Fs();break;case 5:wS(e);break;case 1:Rt(e.type)&&dc(e);break;case 4:ld(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;Oe(vc,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Oe(De,De.current&1),e.flags|=128,null):t&e.child.childLanes?tP(n,e,t):(Oe(De,De.current&1),n=dr(n,e,t),n!==null?n.sibling:null);Oe(De,De.current&1);break;case 19:if(r=(t&e.childLanes)!==0,n.flags&128){if(r)return rP(n,e,t);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Oe(De,De.current),r)break;return null;case 22:case 23:return e.lanes=0,KS(n,e,t)}return dr(n,e,t)}var iP,Od,sP,oP;iP=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}},Od=function(){},sP=function(n,e,t,r){var i=n.memoizedProps;if(i!==r){n=e.stateNode,Mi(Fn.current);var s=null;switch(t){case"input":i=nf(n,i),r=nf(n,r),s=[];break;case"select":i=je({},i,{value:void 0}),r=je({},r,{value:void 0}),s=[];break;case"textarea":i=of(n,i),r=of(n,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(n.onclick=uc)}lf(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"&&(Fo.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"&&(Fo.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&_e("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)}},oP=function(n,e,t,r){t!==r&&(e.flags|=4)};function Sa(n,e){if(!ke)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 d6(n,e,t){var r=e.pendingProps;switch(Kf(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 Rt(e.type)&&fc(),Pt(e),null;case 3:return r=e.stateNode,Hs(),Ne(Lt),Ne(Ct),hd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(n===null||n.child===null)&&(yc(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Cn!==null&&($d(Cn),Cn=null))),Od(n,e),Pt(e),null;case 5:cd(e);var i=Mi(va.current);if(t=e.type,n!==null&&e.stateNode!=null)sP(n,e,t,r,i),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(D(166));return Pt(e),null}if(n=Mi(Fn.current),yc(e)){r=e.stateNode,t=e.type;var s=e.memoizedProps;switch(r[zn]=e,r[da]=s,n=(e.mode&1)!==0,t){case"dialog":_e("cancel",r),_e("close",r);break;case"iframe":case"object":case"embed":_e("load",r);break;case"video":case"audio":for(i=0;i<ua.length;i++)_e(ua[i],r);break;case"source":_e("error",r);break;case"img":case"image":case"link":_e("error",r),_e("load",r);break;case"details":_e("toggle",r);break;case"input":$x(r,s),_e("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},_e("invalid",r);break;case"textarea":qx(r,s),_e("invalid",r)}lf(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&&cc(r.textContent,a,n),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&cc(r.textContent,a,n),i=["children",""+a]):Fo.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&_e("scroll",r)}switch(t){case"input":zl(r),Fx(r,s,!0);break;case"textarea":zl(r),Gx(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=uc)}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=Hx(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[zn]=e,n[da]=r,iP(n,e,!1,!1),e.stateNode=n;e:{switch(o=cf(t,r),t){case"dialog":_e("cancel",n),_e("close",n),i=r;break;case"iframe":case"object":case"embed":_e("load",n),i=r;break;case"video":case"audio":for(i=0;i<ua.length;i++)_e(ua[i],n);i=r;break;case"source":_e("error",n),i=r;break;case"img":case"image":case"link":_e("error",n),_e("load",n),i=r;break;case"details":_e("toggle",n),i=r;break;case"input":$x(n,r),i=nf(n,r),_e("invalid",n);break;case"option":i=r;break;case"select":n._wrapperState={wasMultiple:!!r.multiple},i=je({},r,{value:void 0}),_e("invalid",n);break;case"textarea":qx(n,r),i=of(n,r),_e("invalid",n);break;default:i=r}lf(t,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?Xx(n,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Ux(n,l)):s==="children"?typeof l=="string"?(t!=="textarea"||l!=="")&&Ho(n,l):typeof l=="number"&&Ho(n,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Fo.hasOwnProperty(s)?l!=null&&s==="onScroll"&&_e("scroll",n):l!=null&&Hh(n,s,l,o))}switch(t){case"input":zl(n),Fx(n,r,!1);break;case"textarea":zl(n),Gx(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?As(n,!!r.multiple,s,!1):r.defaultValue!=null&&As(n,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(n.onclick=uc)}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)oP(n,e,n.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(D(166));if(t=Mi(va.current),Mi(Fn.current),yc(e)){if(r=e.stateNode,t=e.memoizedProps,r[zn]=e,(s=r.nodeValue!==t)&&(n=Ht,n!==null))switch(n.tag){case 3:cc(r.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&cc(r.nodeValue,t,(n.mode&1)!==0)}s&&(e.flags|=4)}else r=(t.nodeType===9?t:t.ownerDocument).createTextNode(r),r[zn]=e,e.stateNode=r}return Pt(e),null;case 13:if(Ne(De),r=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(ke&&Ut!==null&&e.mode&1&&!(e.flags&128))lS(),Fs(),e.flags|=98560,s=!1;else if(s=yc(e),r!==null&&r.dehydrated!==null){if(n===null){if(!s)throw Error(D(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(D(317));s[zn]=e}else Fs(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Pt(e),s=!1}else Cn!==null&&($d(Cn),Cn=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||De.current&1?st===0&&(st=3):qd())),e.updateQueue!==null&&(e.flags|=4),Pt(e),null);case 4:return Hs(),Od(n,e),n===null&&ha(e.stateNode.containerInfo),Pt(e),null;case 10:return nd(e.type._context),Pt(e),null;case 17:return Rt(e.type)&&fc(),Pt(e),null;case 19:if(Ne(De),s=e.memoizedState,s===null)return Pt(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)Sa(s,!1);else{if(st!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(o=Pc(n),o!==null){for(e.flags|=128,Sa(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 Oe(De,De.current&1|2),e.child}n=n.sibling}s.tail!==null&&Ke()>Ys&&(e.flags|=128,r=!0,Sa(s,!1),e.lanes=4194304)}else{if(!r)if(n=Pc(o),n!==null){if(e.flags|=128,r=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Sa(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!ke)return Pt(e),null}else 2*Ke()-s.renderingStartTime>Ys&&t!==1073741824&&(e.flags|=128,r=!0,Sa(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=Ke(),e.sibling=null,t=De.current,Oe(De,r?t&1|2:t&1),e):(Pt(e),null);case 22:case 23:return Fd(),r=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Wt&1073741824&&(Pt(e),e.subtreeFlags&6&&(e.flags|=8192)):Pt(e),null;case 24:return null;case 25:return null}throw Error(D(156,e.tag))}function g6(n,e){switch(Kf(e),e.tag){case 1:return Rt(e.type)&&fc(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Hs(),Ne(Lt),Ne(Ct),hd(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return cd(e),null;case 13:if(Ne(De),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(D(340));Fs()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Ne(De),null;case 4:return Hs(),null;case 10:return nd(e.type._context),null;case 22:case 23:return Fd(),null;case 24:return null;default:return null}}var kc=!1,Et=!1,p6=typeof WeakSet=="function"?WeakSet:Set,U=null;function Ws(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){Ge(n,e,r)}else t.current=null}function Md(n,e,t){try{t()}catch(r){Ge(n,e,r)}}var aP=!1;function m6(n,e){if(Ff=Ql,n=BC(),If(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(qf={focusedElem:n,selectionRange:t},Ql=!1,U=e;U!==null;)if(e=U,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,U=n;else for(;U!==null;){e=U;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:Sn(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(D(163))}}catch(w){Ge(e,e.return,w)}if(n=e.sibling,n!==null){n.return=e.return,U=n;break}U=e.return}return g=aP,aP=!1,g}function Pa(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&&Md(e,t,s)}i=i.next}while(i!==r)}}function Ic(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 _d(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 lP(n){var e=n.alternate;e!==null&&(n.alternate=null,lP(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[zn],delete e[da],delete e[Uf],delete e[QV],delete e[ZV])),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 cP(n){return n.tag===5||n.tag===3||n.tag===4}function uP(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||cP(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 Nd(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=uc));else if(r!==4&&(n=n.child,n!==null))for(Nd(n,e,t),n=n.sibling;n!==null;)Nd(n,e,t),n=n.sibling}function kd(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(kd(n,e,t),n=n.sibling;n!==null;)kd(n,e,t),n=n.sibling}var yt=null,Pn=!1;function Jr(n,e,t){for(t=t.child;t!==null;)hP(n,e,t),t=t.sibling}function hP(n,e,t){if($n&&typeof $n.onCommitFiberUnmount=="function")try{$n.onCommitFiberUnmount(Ul,t)}catch(a){}switch(t.tag){case 5:Et||Ws(t,e);case 6:var r=yt,i=Pn;yt=null,Jr(n,e,t),yt=r,Pn=i,yt!==null&&(Pn?(n=yt,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):yt.removeChild(t.stateNode));break;case 18:yt!==null&&(Pn?(n=yt,t=t.stateNode,n.nodeType===8?Hf(n.parentNode,t):n.nodeType===1&&Hf(n,t),na(n)):Hf(yt,t.stateNode));break;case 4:r=yt,i=Pn,yt=t.stateNode.containerInfo,Pn=!0,Jr(n,e,t),yt=r,Pn=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)&&Md(t,e,o),i=i.next}while(i!==r)}Jr(n,e,t);break;case 1:if(!Et&&(Ws(t,e),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(a){Ge(t,e,a)}Jr(n,e,t);break;case 21:Jr(n,e,t);break;case 22:t.mode&1?(Et=(r=Et)||t.memoizedState!==null,Jr(n,e,t),Et=r):Jr(n,e,t);break;default:Jr(n,e,t)}}function fP(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new p6),e.forEach(function(r){var i=E6.bind(null,n,r);t.has(r)||(t.add(r),r.then(i,i))})}}function En(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,Pn=!1;break e;case 3:yt=a.stateNode.containerInfo,Pn=!0;break e;case 4:yt=a.stateNode.containerInfo,Pn=!0;break e}a=a.return}if(yt===null)throw Error(D(160));hP(s,o,i),yt=null,Pn=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Ge(i,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)dP(e,n),e=e.sibling}function dP(n,e){var t=n.alternate,r=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(En(e,n),Vn(n),r&4){try{Pa(3,n,n.return),Ic(3,n)}catch(p){Ge(n,n.return,p)}try{Pa(5,n,n.return)}catch(p){Ge(n,n.return,p)}}break;case 1:En(e,n),Vn(n),r&512&&t!==null&&Ws(t,t.return);break;case 5:if(En(e,n),Vn(n),r&512&&t!==null&&Ws(t,t.return),n.flags&32){var i=n.stateNode;try{Ho(i,"")}catch(p){Ge(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&&zx(i,s),cf(a,o);var c=cf(a,s);for(o=0;o<l.length;o+=2){var u=l[o],h=l[o+1];u==="style"?Xx(i,h):u==="dangerouslySetInnerHTML"?Ux(i,h):u==="children"?Ho(i,h):Hh(i,u,h,c)}switch(a){case"input":rf(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?As(i,!!s.multiple,d,!1):f!==!!s.multiple&&(s.defaultValue!=null?As(i,!!s.multiple,s.defaultValue,!0):As(i,!!s.multiple,s.multiple?[]:"",!1))}i[da]=s}catch(p){Ge(n,n.return,p)}}break;case 6:if(En(e,n),Vn(n),r&4){if(n.stateNode===null)throw Error(D(162));i=n.stateNode,s=n.memoizedProps;try{i.nodeValue=s}catch(p){Ge(n,n.return,p)}}break;case 3:if(En(e,n),Vn(n),r&4&&t!==null&&t.memoizedState.isDehydrated)try{na(e.containerInfo)}catch(p){Ge(n,n.return,p)}break;case 4:En(e,n),Vn(n);break;case 13:En(e,n),Vn(n),i=n.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Rd=Ke())),r&4&&fP(n);break;case 22:if(u=t!==null&&t.memoizedState!==null,n.mode&1?(Et=(c=Et)||u,En(e,n),Et=c):En(e,n),Vn(n),r&8192){if(c=n.memoizedState!==null,(n.stateNode.isHidden=c)&&!u&&n.mode&1)for(U=n,u=n.child;u!==null;){for(h=U=u;U!==null;){switch(f=U,d=f.child,f.tag){case 0:case 11:case 14:case 15:Pa(4,f,f.return);break;case 1:Ws(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){Ge(r,t,p)}}break;case 5:Ws(f,f.return);break;case 22:if(f.memoizedState!==null){mP(h);continue}}d!==null?(d.return=f,U=d):mP(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=Wx("display",o))}catch(p){Ge(n,n.return,p)}}}else if(h.tag===6){if(u===null)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(p){Ge(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:En(e,n),Vn(n),r&4&&fP(n);break;case 21:break;default:En(e,n),Vn(n)}}function Vn(n){var e=n.flags;if(e&2){try{e:{for(var t=n.return;t!==null;){if(cP(t)){var r=t;break e}t=t.return}throw Error(D(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ho(i,""),r.flags&=-33);var s=uP(n);kd(n,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=uP(n);Nd(n,a,o);break;default:throw Error(D(161))}}catch(l){Ge(n,n.return,l)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function y6(n,e,t){U=n,gP(n)}function gP(n,e,t){for(var r=(n.mode&1)!==0;U!==null;){var i=U,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||kc;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Et;a=kc;var c=Et;if(kc=o,(Et=l)&&!c)for(U=i;U!==null;)o=U,l=o.child,o.tag===22&&o.memoizedState!==null?yP(i):l!==null?(l.return=o,U=l):yP(i);for(;s!==null;)U=s,gP(s),s=s.sibling;U=i,kc=a,Et=c}pP(n)}else i.subtreeFlags&8772&&s!==null?(s.return=i,U=s):pP(n)}}function pP(n){for(;U!==null;){var e=U;if(e.flags&8772){var t=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Et||Ic(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:Sn(e.type,t.memoizedProps);r.componentDidUpdate(i,t.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&fS(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}fS(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&&na(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(D(163))}Et||e.flags&512&&_d(e)}catch(f){Ge(e,e.return,f)}}if(e===n){U=null;break}if(t=e.sibling,t!==null){t.return=e.return,U=t;break}U=e.return}}function mP(n){for(;U!==null;){var e=U;if(e===n){U=null;break}var t=e.sibling;if(t!==null){t.return=e.return,U=t;break}U=e.return}}function yP(n){for(;U!==null;){var e=U;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{Ic(4,e)}catch(l){Ge(e,t,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){Ge(e,i,l)}}var s=e.return;try{_d(e)}catch(l){Ge(e,s,l)}break;case 5:var o=e.return;try{_d(e)}catch(l){Ge(e,o,l)}}}catch(l){Ge(e,e.return,l)}if(e===n){U=null;break}var a=e.sibling;if(a!==null){a.return=e.return,U=a;break}U=e.return}}var v6=Math.ceil,Lc=or.ReactCurrentDispatcher,Id=or.ReactCurrentOwner,cn=or.ReactCurrentBatchConfig,fe=0,ft=null,et=null,vt=0,Wt=0,Xs=Ur(0),st=0,Ea=null,Ni=0,Rc=0,Ld=0,Aa=null,Dt=null,Rd=0,Ys=1/0,gr=null,jc=!1,jd=null,Qr=null,Dc=!1,Zr=null,Bc=0,Ta=0,Dd=null,$c=-1,zc=0;function kt(){return fe&6?Ke():$c!==-1?$c:$c=Ke()}function ei(n){return n.mode&1?fe&2&&vt!==0?vt&-vt:t6.transition!==null?(zc===0&&(zc=cC()),zc):(n=be,n!==0||(n=window.event,n=n===void 0?16:vC(n.type)),n):1}function An(n,e,t,r){if(50<Ta)throw Ta=0,Dd=null,Error(D(185));Jo(n,t,r),(!(fe&2)||n!==ft)&&(n===ft&&(!(fe&2)&&(Rc|=t),st===4&&ti(n,vt)),Bt(n,r),t===1&&fe===0&&!(e.mode&1)&&(Ys=Ke()+500,gc&&Xr()))}function Bt(n,e){var t=n.callbackNode;tV(n,e);var r=Yl(n,n===ft?vt:0);if(r===0)t!==null&&oC(t),n.callbackNode=null,n.callbackPriority=0;else if(e=r&-r,n.callbackPriority!==e){if(t!=null&&oC(t),e===1)n.tag===0?e6(bP.bind(null,n)):rS(bP.bind(null,n)),KV(function(){!(fe&6)&&Xr()}),t=null;else{switch(uC(r)){case 1:t=mf;break;case 4:t=aC;break;case 16:t=Hl;break;case 536870912:t=lC;break;default:t=Hl}t=TP(t,vP.bind(null,n))}n.callbackPriority=e,n.callbackNode=t}}function vP(n,e){if($c=-1,zc=0,fe&6)throw Error(D(327));var t=n.callbackNode;if(Ks()&&n.callbackNode!==t)return null;var r=Yl(n,n===ft?vt:0);if(r===0)return null;if(r&30||r&n.expiredLanes||e)e=Fc(n,r);else{e=r;var i=fe;fe|=2;var s=xP();(ft!==n||vt!==e)&&(gr=null,Ys=Ke()+500,Ii(n,e));do try{x6();break}catch(a){wP(n,a)}while(1);td(),Lc.current=s,fe=i,et!==null?e=0:(ft=null,vt=0,e=st)}if(e!==0){if(e===2&&(i=yf(n),i!==0&&(r=i,e=Bd(n,i))),e===1)throw t=Ea,Ii(n,0),ti(n,r),Bt(n,Ke()),t;if(e===6)ti(n,r);else{if(i=n.current.alternate,!(r&30)&&!b6(i)&&(e=Fc(n,r),e===2&&(s=yf(n),s!==0&&(r=s,e=Bd(n,s))),e===1))throw t=Ea,Ii(n,0),ti(n,r),Bt(n,Ke()),t;switch(n.finishedWork=i,n.finishedLanes=r,e){case 0:case 1:throw Error(D(345));case 2:Li(n,Dt,gr);break;case 3:if(ti(n,r),(r&130023424)===r&&(e=Rd+500-Ke(),10<e)){if(Yl(n,0)!==0)break;if(i=n.suspendedLanes,(i&r)!==r){kt(),n.pingedLanes|=n.suspendedLanes&i;break}n.timeoutHandle=Gf(Li.bind(null,n,Dt,gr),e);break}Li(n,Dt,gr);break;case 4:if(ti(n,r),(r&4194240)===r)break;for(e=n.eventTimes,i=-1;0<r;){var o=31-wn(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=Ke()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*v6(r/1960))-r,10<r){n.timeoutHandle=Gf(Li.bind(null,n,Dt,gr),r);break}Li(n,Dt,gr);break;case 5:Li(n,Dt,gr);break;default:throw Error(D(329))}}}return Bt(n,Ke()),n.callbackNode===t?vP.bind(null,n):null}function Bd(n,e){var t=Aa;return n.current.memoizedState.isDehydrated&&(Ii(n,e).flags|=256),n=Fc(n,e),n!==2&&(e=Dt,Dt=t,e!==null&&$d(e)),n}function $d(n){Dt===null?Dt=n:Dt.push.apply(Dt,n)}function b6(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(!xn(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 ti(n,e){for(e&=~Ld,e&=~Rc,n.suspendedLanes|=e,n.pingedLanes&=~e,n=n.expirationTimes;0<e;){var t=31-wn(e),r=1<<t;n[t]=-1,e&=~r}}function bP(n){if(fe&6)throw Error(D(327));Ks();var e=Yl(n,0);if(!(e&1))return Bt(n,Ke()),null;var t=Fc(n,e);if(n.tag!==0&&t===2){var r=yf(n);r!==0&&(e=r,t=Bd(n,r))}if(t===1)throw t=Ea,Ii(n,0),ti(n,e),Bt(n,Ke()),t;if(t===6)throw Error(D(345));return n.finishedWork=n.current.alternate,n.finishedLanes=e,Li(n,Dt,gr),Bt(n,Ke()),null}function zd(n,e){var t=fe;fe|=1;try{return n(e)}finally{fe=t,fe===0&&(Ys=Ke()+500,gc&&Xr())}}function ki(n){Zr!==null&&Zr.tag===0&&!(fe&6)&&Ks();var e=fe;fe|=1;var t=cn.transition,r=be;try{if(cn.transition=null,be=1,n)return n()}finally{be=r,cn.transition=t,fe=e,!(fe&6)&&Xr()}}function Fd(){Wt=Xs.current,Ne(Xs)}function Ii(n,e){n.finishedWork=null,n.finishedLanes=0;var t=n.timeoutHandle;if(t!==-1&&(n.timeoutHandle=-1,YV(t)),et!==null)for(t=et.return;t!==null;){var r=t;switch(Kf(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&fc();break;case 3:Hs(),Ne(Lt),Ne(Ct),hd();break;case 5:cd(r);break;case 4:Hs();break;case 13:Ne(De);break;case 19:Ne(De);break;case 10:nd(r.type._context);break;case 22:case 23:Fd()}t=t.return}if(ft=n,et=n=ni(n.current,null),vt=Wt=e,st=0,Ea=null,Ld=Rc=Ni=0,Dt=Aa=null,Oi!==null){for(e=0;e<Oi.length;e++)if(t=Oi[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}Oi=null}return n}function wP(n,e){do{var t=et;try{if(td(),Ec.current=Mc,Ac){for(var r=Be.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ac=!1}if(_i=0,ht=it=Be=null,ba=!1,wa=0,Id.current=null,t===null||t.return===null){st=1,Ea=e,et=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=HS(o);if(d!==null){d.flags&=-257,US(d,o,a,s,e),d.mode&1&&GS(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)){GS(s,c,e),qd();break e}l=Error(D(426))}}else if(ke&&a.mode&1){var b=HS(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),US(b,o,a,s,e),Zf(Us(l,a));break e}}s=l=Us(l,a),st!==4&&(st=2),Aa===null?Aa=[s]:Aa.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var m=qS(s,l,e);hS(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"&&(Qr===null||!Qr.has(v)))){s.flags|=65536,e&=-e,s.lanes|=e;var w=VS(s,a,e);hS(s,w);break e}}s=s.return}while(s!==null)}SP(t)}catch(x){e=x,et===t&&t!==null&&(et=t=t.return);continue}break}while(1)}function xP(){var n=Lc.current;return Lc.current=Mc,n===null?Mc:n}function qd(){(st===0||st===3||st===2)&&(st=4),ft===null||!(Ni&268435455)&&!(Rc&268435455)||ti(ft,vt)}function Fc(n,e){var t=fe;fe|=2;var r=xP();(ft!==n||vt!==e)&&(gr=null,Ii(n,e));do try{w6();break}catch(i){wP(n,i)}while(1);if(td(),fe=t,Lc.current=r,et!==null)throw Error(D(261));return ft=null,vt=0,st}function w6(){for(;et!==null;)CP(et)}function x6(){for(;et!==null&&!Uq();)CP(et)}function CP(n){var e=AP(n.alternate,n,Wt);n.memoizedProps=n.pendingProps,e===null?SP(n):et=e,Id.current=null}function SP(n){var e=n;do{var t=e.alternate;if(n=e.return,e.flags&32768){if(t=g6(t,e),t!==null){t.flags&=32767,et=t;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{st=6,et=null;return}}else if(t=d6(t,e,Wt),t!==null){et=t;return}if(e=e.sibling,e!==null){et=e;return}et=e=n}while(e!==null);st===0&&(st=5)}function Li(n,e,t){var r=be,i=cn.transition;try{cn.transition=null,be=1,C6(n,e,t,r)}finally{cn.transition=i,be=r}return null}function C6(n,e,t,r){do Ks();while(Zr!==null);if(fe&6)throw Error(D(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(D(177));n.callbackNode=null,n.callbackPriority=0;var s=t.lanes|t.childLanes;if(nV(n,s),n===ft&&(et=ft=null,vt=0),!(t.subtreeFlags&2064)&&!(t.flags&2064)||Dc||(Dc=!0,TP(Hl,function(){return Ks(),null})),s=(t.flags&15990)!==0,t.subtreeFlags&15990||s){s=cn.transition,cn.transition=null;var o=be;be=1;var a=fe;fe|=4,Id.current=null,m6(n,t),dP(t,n),qV(qf),Ql=!!Ff,qf=Ff=null,n.current=t,y6(t),Wq(),fe=a,be=o,cn.transition=s}else n.current=t;if(Dc&&(Dc=!1,Zr=n,Bc=i),s=n.pendingLanes,s===0&&(Qr=null),Kq(t.stateNode),Bt(n,Ke()),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(jc)throw jc=!1,n=jd,jd=null,n;return Bc&1&&n.tag!==0&&Ks(),s=n.pendingLanes,s&1?n===Dd?Ta++:(Ta=0,Dd=n):Ta=0,Xr(),null}function Ks(){if(Zr!==null){var n=uC(Bc),e=cn.transition,t=be;try{if(cn.transition=null,be=16>n?16:n,Zr===null)var r=!1;else{if(n=Zr,Zr=null,Bc=0,fe&6)throw Error(D(331));var i=fe;for(fe|=4,U=n.current;U!==null;){var s=U,o=s.child;if(U.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(U=c;U!==null;){var u=U;switch(u.tag){case 0:case 11:case 15:Pa(8,u,s)}var h=u.child;if(h!==null)h.return=u,U=h;else for(;U!==null;){u=U;var f=u.sibling,d=u.return;if(lP(u),u===c){U=null;break}if(f!==null){f.return=d,U=f;break}U=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)}}U=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,U=o;else e:for(;U!==null;){if(s=U,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Pa(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,U=m;break e}U=s.return}}var y=n.current;for(U=y;U!==null;){o=U;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,U=v;else e:for(o=y;U!==null;){if(a=U,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Ic(9,a)}}catch(x){Ge(a,a.return,x)}if(a===o){U=null;break e}var w=a.sibling;if(w!==null){w.return=a.return,U=w;break e}U=a.return}}if(fe=i,Xr(),$n&&typeof $n.onPostCommitFiberRoot=="function")try{$n.onPostCommitFiberRoot(Ul,n)}catch(x){}r=!0}return r}finally{be=t,cn.transition=e}}return!1}function PP(n,e,t){e=Us(t,e),e=qS(n,e,1),n=Kr(n,e,1),e=kt(),n!==null&&(Jo(n,1,e),Bt(n,e))}function Ge(n,e,t){if(n.tag===3)PP(n,n,t);else for(;e!==null;){if(e.tag===3){PP(e,n,t);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Qr===null||!Qr.has(r))){n=Us(t,n),n=VS(e,n,1),e=Kr(e,n,1),n=kt(),e!==null&&(Jo(e,1,n),Bt(e,n));break}}e=e.return}}function S6(n,e,t){var r=n.pingCache;r!==null&&r.delete(e),e=kt(),n.pingedLanes|=n.suspendedLanes&t,ft===n&&(vt&t)===t&&(st===4||st===3&&(vt&130023424)===vt&&500>Ke()-Rd?Ii(n,0):Ld|=t),Bt(n,e)}function EP(n,e){e===0&&(n.mode&1?(e=Xl,Xl<<=1,!(Xl&130023424)&&(Xl=4194304)):e=1);var t=kt();n=hr(n,e),n!==null&&(Jo(n,e,t),Bt(n,t))}function P6(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),EP(n,t)}function E6(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(D(314))}r!==null&&r.delete(e),EP(n,t)}var AP;AP=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Lt.current)jt=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return jt=!1,f6(n,e,t);jt=!!(n.flags&131072)}else jt=!1,ke&&e.flags&1048576&&iS(e,mc,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Nc(n,e),n=e.pendingProps;var i=Bs(e,Ct.current);Vs(e,t),i=gd(null,e,r,n,i,t);var s=pd();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,Rt(r)?(s=!0,dc(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,sd(e),i.updater=Cc,e.stateNode=i,i._reactInternals=e,ad(e,r,n,t),e=Sd(null,e,r,!0,s,t)):(e.tag=0,ke&&s&&Yf(e),Nt(null,e,i,t),e=e.child),e;case 16:r=e.elementType;e:{switch(Nc(n,e),n=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=T6(r),n=Sn(r,n),i){case 0:e=Cd(null,e,r,n,t);break e;case 1:e=QS(null,e,r,n,t);break e;case 11:e=WS(null,e,r,n,t);break e;case 14:e=XS(null,e,r,Sn(r.type,n),t);break e}throw Error(D(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Sn(r,i),Cd(n,e,r,i,t);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Sn(r,i),QS(n,e,r,i,t);case 3:e:{if(ZS(e),n===null)throw Error(D(387));r=e.pendingProps,s=e.memoizedState,i=s.element,uS(n,e),xc(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=Us(Error(D(423)),e),e=eP(n,e,r,t,i);break e}else if(r!==i){i=Us(Error(D(424)),e),e=eP(n,e,r,t,i);break e}else for(Ut=Hr(e.stateNode.containerInfo.firstChild),Ht=e,ke=!0,Cn=null,t=bS(e,null,r,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Fs(),r===i){e=dr(n,e,t);break e}Nt(n,e,r,t)}e=e.child}return e;case 5:return wS(e),n===null&&Qf(e),r=e.type,i=e.pendingProps,s=n!==null?n.memoizedProps:null,o=i.children,Vf(r,i)?o=null:s!==null&&Vf(r,s)&&(e.flags|=32),JS(n,e),Nt(n,e,o,t),e.child;case 6:return n===null&&Qf(e),null;case 13:return tP(n,e,t);case 4:return ld(e,e.stateNode.containerInfo),r=e.pendingProps,n===null?e.child=Gs(e,null,r,t):Nt(n,e,r,t),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Sn(r,i),WS(n,e,r,i,t);case 7:return Nt(n,e,e.pendingProps,t),e.child;case 8:return Nt(n,e,e.pendingProps.children,t),e.child;case 12:return Nt(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,Oe(vc,r._currentValue),r._currentValue=o,s!==null)if(xn(s.value,o)){if(s.children===i.children&&!Lt.current){e=dr(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=fr(-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),rd(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(D(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),rd(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}Nt(n,e,i.children,t),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Vs(e,t),i=an(i),r=r(i),e.flags|=1,Nt(n,e,r,t),e.child;case 14:return r=e.type,i=Sn(r,e.pendingProps),i=Sn(r.type,i),XS(n,e,r,i,t);case 15:return YS(n,e,e.type,e.pendingProps,t);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Sn(r,i),Nc(n,e),e.tag=1,Rt(r)?(n=!0,dc(e)):n=!1,Vs(e,t),pS(e,r,i),ad(e,r,i,t),Sd(null,e,r,!0,n,t);case 19:return rP(n,e,t);case 22:return KS(n,e,t)}throw Error(D(156,e.tag))};function TP(n,e){return sC(n,e)}function A6(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 un(n,e,t,r){return new A6(n,e,t,r)}function Vd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function T6(n){if(typeof n=="function")return Vd(n)?1:0;if(n!=null){if(n=n.$$typeof,n===Xh)return 11;if(n===Jh)return 14}return 2}function ni(n,e){var t=n.alternate;return t===null?(t=un(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 qc(n,e,t,r,i,s){var o=2;if(r=n,typeof n=="function")Vd(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Es:return Ri(t.children,i,s,e);case Uh:o=8,i|=8;break;case Wh:return n=un(12,t,e,i|2),n.elementType=Wh,n.lanes=s,n;case Yh:return n=un(13,t,e,i),n.elementType=Yh,n.lanes=s,n;case Kh:return n=un(19,t,e,i),n.elementType=Kh,n.lanes=s,n;case Rx:return Vc(t,i,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case Ix:o=10;break e;case Lx:o=9;break e;case Xh:o=11;break e;case Jh:o=14;break e;case Dr:o=16,r=null;break e}throw Error(D(130,n==null?n:typeof n,""))}return e=un(o,t,e,i),e.elementType=n,e.type=r,e.lanes=s,e}function Ri(n,e,t,r){return n=un(7,n,r,e),n.lanes=t,n}function Vc(n,e,t,r){return n=un(22,n,r,e),n.elementType=Rx,n.lanes=t,n.stateNode={isHidden:!1},n}function Gd(n,e,t){return n=un(6,n,null,e),n.lanes=t,n}function Hd(n,e,t){return e=un(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function O6(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=vf(0),this.expirationTimes=vf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vf(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ud(n,e,t,r,i,s,o,a,l){return n=new O6(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=un(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},sd(s),n}function M6(n,e,t){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ps,key:r==null?null:""+r,children:n,containerInfo:e,implementation:t}}function OP(n){if(!n)return Wr;n=n._reactInternals;e:{if(Si(n)!==n||n.tag!==1)throw Error(D(170));var e=n;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Rt(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(D(171))}if(n.tag===1){var t=n.type;if(Rt(t))return tS(n,t,e)}return e}function MP(n,e,t,r,i,s,o,a,l){return n=Ud(t,r,!0,n,i,s,o,a,l),n.context=OP(null),t=n.current,r=kt(),i=ei(t),s=fr(r,i),s.callback=e!=null?e:null,Kr(t,s,i),n.current.lanes=i,Jo(n,i,r),Bt(n,r),n}function Gc(n,e,t,r){var i=e.current,s=kt(),o=ei(i);return t=OP(t),e.context===null?e.context=t:e.pendingContext=t,e=fr(s,o),e.payload={element:n},r=r===void 0?null:r,r!==null&&(e.callback=r),n=Kr(i,e,o),n!==null&&(An(n,i,o,s),wc(n,i,o)),o}function Hc(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 _P(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}function Wd(n,e){_P(n,e),(n=n.alternate)&&_P(n,e)}function _6(){return null}var NP=typeof reportError=="function"?reportError:function(n){console.error(n)};function Xd(n){this._internalRoot=n}Uc.prototype.render=Xd.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(D(409));Gc(n,e,null,null)},Uc.prototype.unmount=Xd.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;ki(function(){Gc(null,n,null,null)}),e[ar]=null}};function Uc(n){this._internalRoot=n}Uc.prototype.unstable_scheduleHydration=function(n){if(n){var e=dC();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&&mC(n)}};function Yd(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function Wc(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function kP(){}function N6(n,e,t,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Hc(o);s.call(c)}}var o=MP(e,r,n,0,null,!1,!1,"",kP);return n._reactRootContainer=o,n[ar]=o.current,ha(n.nodeType===8?n.parentNode:n),ki(),o}for(;i=n.lastChild;)n.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=Hc(l);a.call(c)}}var l=Ud(n,0,!1,null,null,!1,!1,"",kP);return n._reactRootContainer=l,n[ar]=l.current,ha(n.nodeType===8?n.parentNode:n),ki(function(){Gc(e,l,t,r)}),l}function Xc(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=Hc(o);a.call(l)}}Gc(e,o,n,i)}else o=N6(t,e,n,i,r);return Hc(o)}hC=function(n){switch(n.tag){case 3:var e=n.stateNode;if(e.current.memoizedState.isDehydrated){var t=Ko(e.pendingLanes);t!==0&&(bf(e,t|1),Bt(e,Ke()),!(fe&6)&&(Ys=Ke()+500,Xr()))}break;case 13:ki(function(){var r=hr(n,1);if(r!==null){var i=kt();An(r,n,1,i)}}),Wd(n,1)}},wf=function(n){if(n.tag===13){var e=hr(n,134217728);if(e!==null){var t=kt();An(e,n,134217728,t)}Wd(n,134217728)}},fC=function(n){if(n.tag===13){var e=ei(n),t=hr(n,e);if(t!==null){var r=kt();An(t,n,e,r)}Wd(n,e)}},dC=function(){return be},gC=function(n,e){var t=be;try{return be=n,e()}finally{be=t}},ff=function(n,e,t){switch(e){case"input":if(rf(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=hc(r);if(!i)throw Error(D(90));Bx(r),rf(r,i)}}}break;case"textarea":Vx(n,t);break;case"select":e=t.value,e!=null&&As(n,!!t.multiple,e,!1)}},Qx=zd,Zx=ki;var k6={usingClientEntryPoint:!1,Events:[ga,js,hc,Kx,Jx,zd]},Oa={findFiberByHostInstance:Pi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},I6={bundleType:Oa.bundleType,version:Oa.version,rendererPackageName:Oa.rendererPackageName,rendererConfig:Oa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:or.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=rC(n),n===null?null:n.stateNode},findFiberByHostInstance:Oa.findFiberByHostInstance||_6,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 Yc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yc.isDisabled&&Yc.supportsFiber)try{Ul=Yc.inject(I6),$n=Yc}catch(n){}}qt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=k6,qt.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Yd(e))throw Error(D(200));return M6(n,e,null,t)},qt.createRoot=function(n,e){if(!Yd(n))throw Error(D(299));var t=!1,r="",i=NP;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Ud(n,1,!1,null,null,t,!1,r,i),n[ar]=e.current,ha(n.nodeType===8?n.parentNode:n),new Xd(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(D(188)):(n=Object.keys(n).join(","),Error(D(268,n)));return n=rC(e),n=n===null?null:n.stateNode,n},qt.flushSync=function(n){return ki(n)},qt.hydrate=function(n,e,t){if(!Wc(e))throw Error(D(200));return Xc(null,n,e,!0,t)},qt.hydrateRoot=function(n,e,t){if(!Yd(n))throw Error(D(405));var r=t!=null&&t.hydratedSources||null,i=!1,s="",o=NP;if(t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),e=MP(e,null,n,1,t!=null?t:null,i,!1,s,o),n[ar]=e.current,ha(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 Uc(e)},qt.render=function(n,e,t){if(!Wc(e))throw Error(D(200));return Xc(null,n,e,!1,t)},qt.unmountComponentAtNode=function(n){if(!Wc(n))throw Error(D(40));return n._reactRootContainer?(ki(function(){Xc(null,null,n,!1,function(){n._reactRootContainer=null,n[ar]=null})}),!0):!1},qt.unstable_batchedUpdates=zd,qt.unstable_renderSubtreeIntoContainer=function(n,e,t,r){if(!Wc(t))throw Error(D(200));if(n==null||n._reactInternals===void 0)throw Error(D(38));return Xc(n,e,t,!1,r)},qt.version="18.2.0-next-9e3b772b8-20220608";function IP(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(IP)}catch(n){console.error(n)}}IP(),Ax.exports=qt;var LP=Ax.exports,RP,jP=LP;RP=jP.createRoot,jP.hydrateRoot;var Js;(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]=W.useReducer(r,[]);return t=c,W.createElement(W.Fragment,{children:l.map(u=>u.portal)})}}n.getProvider=a})(Js||(Js={}));var L6=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 Kd={};function R6(n){const{shape:e,component:t,effect:r,inherit:i}=n,s=L6(n,["shape","component","effect","inherit"]);if(!e)throw new Error("should specify shape in config");Kd[e]={component:t,effect:r},G.registerNode(e,Object.assign({inherit:i||"react-shape"},s),!0)}class j6 extends W.PureComponent{constructor(e){super(e),this.state={tick:0}}componentDidMount(){const{node:e}=this.props;e.on("change:*",({key:t})=>{const r=Kd[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"?W.cloneElement(e):W.cloneElement(e,{node:t,graph:r})}render(){const{node:e}=this.props,t=Kd[e.shape];if(!t)return null;const{component:r}=t;if(W.isValidElement(r))return this.clone(r);const i=r;return this.clone(W.createElement(i,null))}}class Kc extends It{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,Kc.action,()=>{this.renderReactComponent()})}renderReactComponent(){this.unmountReactComponent();const e=this.getComponentContainer(),t=this.cell;if(e){const r=W.createElement(j6,{node:t,graph:this.graph});if(Js.isActive()){const i=LP.createPortal(r,e);Js.connect(this.targetId(),i)}else this.root=RP(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 Js.isActive()&&Js.disconnect(this.targetId()),this.unmountReactComponent(),super.unmount(),this}}(function(n){n.action="react",n.config({bootstrap:[n.action],actions:{component:n.action}}),It.registry.register("react-shape-view",n,!0)})(Kc||(Kc={}));var D6=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},B6=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 ot extends me{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=ot.getOptions(e),this.onUpdate=th(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"),Z(this.container,this.prefixClassName(ot.containerClass)),ve(this.container,{width:r,height:i}),this.options.pageVisible&&Z(this.container,this.prefixClassName(ot.pagedClass)),this.options.className&&Z(this.container,this.options.className);const s=this.graph.container;s.parentNode&&bo(s,this.container),this.content=document.createElement("div"),Z(this.content,this.prefixClassName(ot.contentClass)),ve(this.content,{width:this.graph.options.width,height:this.graph.options.height}),this.background=document.createElement("div"),Z(this.background,this.prefixClassName(ot.backgroundClass)),Rn(this.content,this.background),this.options.pageVisible||Rn(this.content,this.graph.view.grid),Rn(this.content,s),Er(this.content,this.container),this.startListening(),this.options.pageVisible||this.graph.grid.update(),this.backgroundManager=new ot.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||bn.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(){(Zt.IS_IE||Zt.IS_EDGE)&&ve(this.container,{visibility:"hidden"})}afterManipulation(){(Zt.IS_IE||Zt.IS_EDGE)&&ve(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");Z(c,this.prefixClassName("graph-pagebreak-vertical")),ve(c,{left:a*r}),Er(c,o),s=!0}for(let a=1,l=Math.floor(t/i);a<l;a+=1){const c=document.createElement("div");Z(c,this.prefixClassName("graph-pagebreak-horizontal")),ve(c,{top:a*i}),Er(c,o),s=!0}s&&(Z(o,this.prefixClassName("graph-pagebreak")),QB(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=Q(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=B.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),wh(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)),wh(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=B.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=B6(i,["padding"]),a=Ln(s),l=B.fromSize(this.getClientSize()),c=l.clone().moveAndExpand({x:a.left,y:a.top,width:-a.right-a.left,height:-a.top-a.bottom});t=Ft(t,Math.max(0,c.width)),t<0&&(t=c.width+t),r=Ft(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=S.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=B.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 S(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 Z(this.container,ot.transitionClassName),Ae.off(this.content,ot.transitionEventName),Ae.on(this.content,ot.transitionEventName,f=>{this.syncTransition(a,{x:e,y:t}),typeof h=="function"&&Q(h,this,f.originalEvent)}),ve(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,ot.transitionClassName),Ae.off(this.content,ot.transitionEventName),ve(this.content,{transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(e,t={}){const r=B.create(e),i=t.maxScale||1/0,s=t.minScale||Number.MIN_VALUE,o=t.scaleGrid||null,a=t.visibility||1,l=t.center?S.create(t.center):r.getCenter(),c=this.getClientSize(),u=c.width*a,h=c.height*a;let f=new B(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}),Ae.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)}),Ae.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){Ae.off(document.body,".panning"),Ae.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 S(r/s.a,i/s.d)}localToBackgroundPoint(e,t){const r=typeof e=="object"?S.create(e):new S(e,t),i=this.graph.matrix(),s=this.padding;return pe.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,ve(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,ve(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 Ln(typeof e=="function"?Q(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=pe.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 ve(this.container,{overflow:"hidden"}),this}unlock(){return ve(this.container,{overflow:"scroll"}),this}onRemove(){this.stopListening()}dispose(){bo(this.container,this.graph.container),this.remove()}}D6([me.dispose()],ot.prototype,"dispose",null),function(n){class e extends jl{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}(ot||(ot={})),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=Re({},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}(ot||(ot={}));const $6=`.x6-graph-scroller {
245
+ `;class ut extends Nn{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 pq=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 Bh extends ut{init(){Mo("core",gq)}dispose(){_o("core")}}pq([Bh.dispose()],Bh.prototype,"dispose",null);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},zo;(function(n){function e(t){const{grid:r,panning:i,mousewheel:s,embedding:o}=t,a=mq(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=Re({},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:nn.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:nn.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 cq}},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 yq=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},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};class $h extends ut{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=vq(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,te.create("pattern",{id:u,patternUnits:"userSpaceOnUse"},te.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),ge(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 Tr),this.instance}resolveGrid(e){if(!e)return[];const t=e.type;if(t==null)return[Object.assign(Object.assign({},Tr.presets.dot),e.args)];const r=Tr.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 Tr.registry.onNotFound(t)}dispose(){this.stopListening(),this.clear()}}yq([ut.dispose()],$h.prototype,"dispose",null);class vx extends ut{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),lt(this.viewportMatrix)}setMatrix(e){const t=lt(e),r=ss(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 u1(e)||(e=this.container.clientWidth),u1(t)||(t=this.container.clientHeight),{width:e,height:t}}getScale(){return _$(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 Qt(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 N$(this.getMatrix())}rotate(e,t,r){if(t==null||r==null){const s=pe.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 k$(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=Ln(r),o=i.border||0,a=i.contentArea?B.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 B(-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=S.create(m)}else r=this.getContentBBox(e),i=this.graph.graphToLocal(r);if(!r.width||!r.height)return;const s=Ln(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=B.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=Qt(g,l,c),p=Qt(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 B:pe.getBBox(this.stage)}getContentBBox(e={}){return this.graph.localToGraph(this.getContentArea(e))}getGraphArea(){const e=B.fromSize(this.getComputedSize());return this.graph.graphToLocal(e)}zoomToRect(e,t={}){const r=B.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=Ft(t,Math.max(0,i.width)),t<0&&(t=i.width+t),r=Ft(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=B.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 bq=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 jl extends ut{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=B.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=No.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=Yu(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=Yu(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()}}bq([ut.dispose()],jl.prototype,"dispose",null);var wq=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 bx extends ut{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),Ae.on(this.graph.container,"mousedown",this.onRightMouseDown)),e.includes("mouseWheel")&&(this.mousewheelHandle=new uw(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")&&Ae.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&&er.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(),Ae.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)}),Ae.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(),Ae.off(document.body,".panning"),Ae.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?(Z(e,t),gt(e,r)):(gt(e,t),Z(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()}}wq([ut.dispose()],bx.prototype,"dispose",null);var xq=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 zh extends ut{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 uw(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))&&er.isMatch(e,this.widgetOptions.modifiers)}onMouseWheel(e){const t=this.widgetOptions.guard;if((t==null||t(e))&&er.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=Qt(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()}}xq([Nn.dispose()],zh.prototype,"dispose",null);var Cq=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 wx extends ut{init(){this.resetRenderArea=kB(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()}}Cq([ut.dispose()],wx.prototype,"dispose",null);class Sq{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=33,this.initialTime=Date.now()}queueJob(e){if(e.priority&ir.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 ir;(function(n){n[n.Update=2]="Update",n[n.RenderEdge=4]="RenderEdge",n[n.RenderNode=8]="RenderNode",n[n.PRIOR=1048576]="PRIOR"})(ir||(ir={}));var Pq=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 rt extends Nn{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(e){super(),this.views={},this.willRemoveViews={},this.queue=new Sq,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,rt.FLAG_INSERT,t,ir.Update,!0)}onCellVisibleChanged({cell:e,current:t}){this.toggleVisible(e,!!t)}requestViewUpdate(e,t,r={},i=ir.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=ir.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===rt.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=rt.FLAG_INSERT;else{const l=this.createCellView(r);l&&(l.graph=this.graph,o=rt.FLAG_INSERT|l.getBootstrapFlag(),a={view:l,flag:o,options:t,state:rt.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===rt.ViewState.MOUNTED?(a=this.updateView(e,t,r),o.flag=a):o.state=rt.ViewState.WAITING,a&&i.isEdge()&&!(a&e.getFlag(["source","target"]))&&this.queue.queueJob({id:s,priority:ir.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===rt.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(nt.isCellView(e)){if(t&rt.FLAG_REMOVE)return this.removeView(e.cell),0;t&rt.FLAG_INSERT&&(this.insertView(e),t^=rt.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=rt.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&&ve(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=Q(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=nt.registry.get(i);return s?new s(e,t):nt.registry.onNotFound(i)}return e.isNode()?new It(e,t):e.isEdge()?new rr(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()?ir.RenderNode:ir.RenderEdge}dispose(){this.stopListening()}}Pq([Nn.dispose()],rt.prototype,"dispose",null),function(n){n.FLAG_INSERT=1<<30,n.FLAG_REMOVE=1<<29,n.FLAG_RENDER=(1<<26)-1}(rt||(rt={})),function(n){(function(e){e[e.CREATED=0]="CREATED",e[e.MOUNTED=1]="MOUNTED",e[e.WAITING=2]="WAITING"})(n.ViewState||(n.ViewState={}))}(rt||(rt={}));var Eq=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 Fh extends ut{constructor(){super(...arguments),this.schedule=new rt(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=ce.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?pe.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=B.create(e);return this.model.getCells().map(i=>this.findViewByCell(i)).filter(i=>{if(i){if(t.nodeOnly&&!i.isNodeView())return!1;const s=pe.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()}}Eq([ut.dispose()],Fh.prototype,"dispose",null);var xx=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 Cx extends ut{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}-${lh(JSON.stringify(e))}`),!this.isDefined(t)){const i=cs.registry.get(r);if(i==null)return cs.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});te.create(Te.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}-${lh(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);te.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=xx(e,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let u=t;if(u||(u=`marker-${this.cid}-${lh(JSON.stringify(e))}`),!this.isDefined(u)){a!=="path"&&delete c.d;const h=te.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=xx(f,["tagName"]);return te.create(`${d}`||"path",wo(Object.assign(Object.assign({},c),g)))}):[te.create(a||"path",wo(c))]);this.defs.appendChild(h.node)}return u}remove(e){const t=this.svg.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}}class Sx extends ut{getClientMatrix(){return lt(this.view.stage.getScreenCTM())}getClientOffset(){const e=this.view.svg.getBoundingClientRect();return new S(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=S.create(e,t);return pe.transformPoint(r,this.graph.matrix())}localToClientPoint(e,t){const r=S.create(e,t);return pe.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=B.create(e,t,r,i);return pe.transformRectangle(s,this.graph.matrix())}localToClientRect(e,t,r,i){const s=B.create(e,t,r,i);return pe.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=S.create(e,t);return pe.transformPoint(r,this.graph.matrix().inverse())}clientToLocalPoint(e,t){const r=S.create(e,t);return pe.transformPoint(r,this.getClientMatrix().inverse())}clientToGraphPoint(e,t){const r=S.create(e,t);return pe.transformPoint(r,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(e,t){const i=S.create(e,t).diff(this.getPageOffset());return this.graphToLocalPoint(i)}graphToLocalRect(e,t,r,i){const s=B.create(e,t,r,i);return pe.transformRectangle(s,this.graph.matrix().inverse())}clientToLocalRect(e,t,r,i){const s=B.create(e,t,r,i);return pe.transformRectangle(s,this.getClientMatrix().inverse())}clientToGraphRect(e,t,r,i){const s=B.create(e,t,r,i);return pe.transformRectangle(s,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(e,t,r,i){const s=B.create(e,t,r,i),o=this.getPageOffset();return s.x-=o.x,s.y-=o.y,this.graphToLocalRect(s)}}var Aq=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 Dl extends ut{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=tr.registry.get(s);return o==null?tr.registry.onNotFound(s):(tr.check(s,o),{name:s,highlighter:o,args:i.args||{}})}getHighlighterId(e,t){return dh(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()}}Aq([Dl.dispose()],Dl.prototype,"dispose",null);var Tq=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 Px extends ut{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&&ml.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(){ml.clear(this.graph.container)}}Tq([ut.dispose()],Px.prototype,"dispose",null);var Oq=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 G=class j2 extends wt{get container(){return this.options.container}get[Symbol.toStringTag](){return j2.toStringTag}constructor(e){super(),this.installedPlugins=new Set,this.options=zo.get(e),this.css=new Bh(this),this.view=new bn(this),this.defs=new Cx(this),this.coord=new Sx(this),this.transform=new vx(this),this.highlight=new Dl(this),this.grid=new $h(this),this.background=new jl(this),this.options.model?this.model=this.options.model:(this.model=new Bn,this.model.graph=this),this.renderer=new Fh(this),this.panning=new bx(this),this.mousewheel=new zh(this),this.virtualRender=new wx(this),this.size=new Px(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=>Ye.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 ce.isCell(e)?this.findViewByCell(e):this.findViewByElem(e)}findViews(e){return B.isRectangleLike(e)?this.findViewsInArea(e):S.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 B.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 B.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 B.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 B.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 B.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 B.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 B.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()})}};Oq([wt.dispose()],G.prototype,"dispose",null),function(n){n.View=bn,n.Renderer=Fh,n.MouseWheel=zh,n.DefsManager=Cx,n.GridManager=$h,n.CoordManager=Sx,n.TransformManager=vx,n.HighlightManager=Dl,n.BackgroundManager=jl}(G||(G={})),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}(G||(G={})),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}(G||(G={})),function(n){n.registerNode=Ye.registry.register,n.registerEdge=Ve.registry.register,n.registerView=nt.registry.register,n.registerAttr=Dn.registry.register,n.registerGrid=Tr.registry.register,n.registerFilter=cs.registry.register,n.registerNodeTool=ds.registry.register,n.registerEdgeTool=gs.registry.register,n.registerBackground=No.registry.register,n.registerHighlighter=tr.registry.register,n.registerPortLayout=wi.registry.register,n.registerPortLabelLayout=hs.registry.register,n.registerMarker=_r.registry.register,n.registerRouter=Rr.registry.register,n.registerConnector=xi.registry.register,n.registerAnchor=ps.registry.register,n.registerEdgeAnchor=ms.registry.register,n.registerConnectionPoint=ys.registry.register}(G||(G={})),function(n){n.unregisterNode=Ye.registry.unregister,n.unregisterEdge=Ve.registry.unregister,n.unregisterView=nt.registry.unregister,n.unregisterAttr=Dn.registry.unregister,n.unregisterGrid=Tr.registry.unregister,n.unregisterFilter=cs.registry.unregister,n.unregisterNodeTool=ds.registry.unregister,n.unregisterEdgeTool=gs.registry.unregister,n.unregisterBackground=No.registry.unregister,n.unregisterHighlighter=tr.registry.unregister,n.unregisterPortLayout=wi.registry.unregister,n.unregisterPortLabelLayout=hs.registry.unregister,n.unregisterMarker=_r.registry.unregister,n.unregisterRouter=Rr.registry.unregister,n.unregisterConnector=xi.registry.unregister,n.unregisterAnchor=ps.registry.unregister,n.unregisterEdgeAnchor=ms.registry.unregister,n.unregisterConnectionPoint=ys.registry.unregister}(G||(G={}));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};class Cs extends Ye{}(function(n){class e extends It{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){vo(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:Rn(r,s))}}}n.View=e,function(t){t.action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),It.registry.register("html-view",t,!0)}(e=n.View||(n.View={}))})(Cs||(Cs={})),function(n){n.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},Te.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),Ye.registry.register("html",n,!0)}(Cs||(Cs={})),function(n){n.shapeMaps={};function e(t){const{shape:r,html:i,effect:s,inherit:o}=t,a=Mq(t,["shape","html","effect","inherit"]);if(!r)throw new Error("should specify shape in config");n.shapeMaps[r]={html:i,effect:s},G.registerNode(r,Object.assign({inherit:o||"html"},a),!0)}n.register=e}(Cs||(Cs={}));const _q=`.x6-widget-minimap {
246
+ position: relative;
247
+ display: table-cell;
248
+ box-sizing: border-box;
249
+ overflow: hidden;
250
+ text-align: center;
251
+ vertical-align: middle;
252
+ background-color: #fff;
253
+ user-select: none;
254
+ }
255
+ .x6-widget-minimap .x6-graph {
256
+ display: inline-block;
257
+ box-shadow: 0 0 4px 0 #eee;
258
+ cursor: pointer;
259
+ }
260
+ .x6-widget-minimap .x6-graph > svg {
261
+ pointer-events: none;
262
+ shape-rendering: optimizespeed;
263
+ }
264
+ .x6-widget-minimap .x6-graph .x6-node * {
265
+ /* stylelint-disable-next-line */
266
+ vector-effect: initial;
267
+ }
268
+ .x6-widget-minimap-viewport {
269
+ position: absolute;
270
+ box-sizing: content-box !important;
271
+ margin: -2px 0 0 -2px;
272
+ border: 2px solid #31d0c6;
273
+ cursor: move;
274
+ }
275
+ .x6-widget-minimap-viewport-zoom {
276
+ position: absolute;
277
+ right: 0;
278
+ bottom: 0;
279
+ box-sizing: border-box;
280
+ width: 12px;
281
+ height: 12px;
282
+ margin: 0 -6px -6px 0;
283
+ background-color: #fff;
284
+ border: 2px solid #31d0c6;
285
+ border-radius: 50%;
286
+ cursor: nwse-resize;
287
+ }
288
+ `;var Nq=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 Ex extends me{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({},Bl.defaultOptions),e),Mo(this.name,_q)}init(e){this.graph=e,this.updateViewport=th(this.updateViewport.bind(this),0),this.container=document.createElement("div"),Z(this.container,this.prefixClassName(Fo.root));const t=document.createElement("div");this.container.appendChild(t),this.viewport=document.createElement("div"),Z(this.viewport,this.prefixClassName(Fo.viewport)),this.options.scalable&&(this.zoomHandle=document.createElement("div"),Z(this.zoomHandle,this.prefixClassName(Fo.zoom)),Er(this.zoomHandle,this.viewport)),Rn(this.container,this.viewport),ve(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 G(r),this.updatePaper(this.sourceGraph.options.width,this.sourceGraph.options.height),this.startListening()}startListening(){this.scroller?Ae.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?Ae.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 Bn,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=B$(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},ve(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(Bl.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=Ao(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(),_o(this.name)}}Nq([me.dispose()],Ex.prototype,"dispose",null);var Fo;(function(n){n.root="widget-minimap",n.viewport=`${n.root}-viewport`,n.zoom=`${n.viewport}-zoom`})(Fo||(Fo={}));var Bl;(function(n){n.defaultOptions={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:e=>new G(e)},n.documentEvents={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"}})(Bl||(Bl={}));var kq=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},Iq=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 it extends me{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=it.getOptions(e),this.onUpdate=th(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"),Z(this.container,this.prefixClassName(it.containerClass)),ve(this.container,{width:r,height:i}),this.options.pageVisible&&Z(this.container,this.prefixClassName(it.pagedClass)),this.options.className&&Z(this.container,this.options.className);const s=this.graph.container;s.parentNode&&bo(s,this.container),this.content=document.createElement("div"),Z(this.content,this.prefixClassName(it.contentClass)),ve(this.content,{width:this.graph.options.width,height:this.graph.options.height}),this.background=document.createElement("div"),Z(this.background,this.prefixClassName(it.backgroundClass)),Rn(this.content,this.background),this.options.pageVisible||Rn(this.content,this.graph.view.grid),Rn(this.content,s),Er(this.content,this.container),this.startListening(),this.options.pageVisible||this.graph.grid.update(),this.backgroundManager=new it.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||bn.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(){(Zt.IS_IE||Zt.IS_EDGE)&&ve(this.container,{visibility:"hidden"})}afterManipulation(){(Zt.IS_IE||Zt.IS_EDGE)&&ve(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");Z(c,this.prefixClassName("graph-pagebreak-vertical")),ve(c,{left:a*r}),Er(c,o),s=!0}for(let a=1,l=Math.floor(t/i);a<l;a+=1){const c=document.createElement("div");Z(c,this.prefixClassName("graph-pagebreak-horizontal")),ve(c,{top:a*i}),Er(c,o),s=!0}s&&(Z(o,this.prefixClassName("graph-pagebreak")),QB(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=Q(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=B.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),wh(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)),wh(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=B.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=Iq(i,["padding"]),a=Ln(s),l=B.fromSize(this.getClientSize()),c=l.clone().moveAndExpand({x:a.left,y:a.top,width:-a.right-a.left,height:-a.top-a.bottom});t=Ft(t,Math.max(0,c.width)),t<0&&(t=c.width+t),r=Ft(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=S.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=B.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 S(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 Z(this.container,it.transitionClassName),Ae.off(this.content,it.transitionEventName),Ae.on(this.content,it.transitionEventName,f=>{this.syncTransition(a,{x:e,y:t}),typeof h=="function"&&Q(h,this,f.originalEvent)}),ve(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,it.transitionClassName),Ae.off(this.content,it.transitionEventName),ve(this.content,{transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(e,t={}){const r=B.create(e),i=t.maxScale||1/0,s=t.minScale||Number.MIN_VALUE,o=t.scaleGrid||null,a=t.visibility||1,l=t.center?S.create(t.center):r.getCenter(),c=this.getClientSize(),u=c.width*a,h=c.height*a;let f=new B(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}),Ae.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)}),Ae.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){Ae.off(document.body,".panning"),Ae.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 S(r/s.a,i/s.d)}localToBackgroundPoint(e,t){const r=typeof e=="object"?S.create(e):new S(e,t),i=this.graph.matrix(),s=this.padding;return pe.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,ve(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,ve(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 Ln(typeof e=="function"?Q(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=pe.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 ve(this.container,{overflow:"hidden"}),this}unlock(){return ve(this.container,{overflow:"scroll"}),this}onRemove(){this.stopListening()}dispose(){bo(this.container,this.graph.container),this.remove()}}kq([me.dispose()],it.prototype,"dispose",null),function(n){class e extends jl{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}(it||(it={})),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=Re({},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}(it||(it={}));const Lq=`.x6-graph-scroller {
269
289
  position: relative;
270
290
  box-sizing: border-box;
271
291
  overflow: scroll;
@@ -323,50 +343,7 @@ Error generating stack: `+s.message+`
323
343
  height: 1px;
324
344
  border-top: 1px dashed #bdbdbd;
325
345
  }
326
- `;G.prototype.lockScroller=function(){const n=this.getPlugin("scroller");return n&&n.lockScroller(),this},G.prototype.unlockScroller=function(){const n=this.getPlugin("scroller");return n&&n.unlockScroller(),this},G.prototype.updateScroller=function(){const n=this.getPlugin("scroller");return n&&n.updateScroller(),this},G.prototype.getScrollbarPosition=function(){const n=this.getPlugin("scroller");return n?n.getScrollbarPosition():{left:0,top:0}},G.prototype.setScrollbarPosition=function(n,e){const t=this.getPlugin("scroller");return t&&t.setScrollbarPosition(n,e),this};var z6=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 DP 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,Mo(this.name,$6)}init(e){this.graph=e;const t=ot.getOptions(Object.assign(Object.assign({enabled:!0},this.options),{graph:e}));this.options=t,this.scrollerImpl=new ot(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),Ae.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")&&Ae.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&&er.isMatch(e,this.options.modifiers,t)}updateClassName(e){const t=this.scrollerImpl.container,r=nn.prefix("graph-scroller-pannable");this.pannable?(Z(t,r),t.dataset.panning=(!!e).toString()):gt(t,r)}dispose(){this.scrollerImpl.dispose(),this.stopListening(),this.off(),_o(this.name)}}z6([wt.dispose()],DP.prototype,"dispose",null);const F6=`.x6-widget-minimap {
327
- position: relative;
328
- display: table-cell;
329
- box-sizing: border-box;
330
- overflow: hidden;
331
- text-align: center;
332
- vertical-align: middle;
333
- background-color: #fff;
334
- user-select: none;
335
- }
336
- .x6-widget-minimap .x6-graph {
337
- display: inline-block;
338
- box-shadow: 0 0 4px 0 #eee;
339
- cursor: pointer;
340
- }
341
- .x6-widget-minimap .x6-graph > svg {
342
- pointer-events: none;
343
- shape-rendering: optimizespeed;
344
- }
345
- .x6-widget-minimap .x6-graph .x6-node * {
346
- /* stylelint-disable-next-line */
347
- vector-effect: initial;
348
- }
349
- .x6-widget-minimap-viewport {
350
- position: absolute;
351
- box-sizing: content-box !important;
352
- margin: -2px 0 0 -2px;
353
- border: 2px solid #31d0c6;
354
- cursor: move;
355
- }
356
- .x6-widget-minimap-viewport-zoom {
357
- position: absolute;
358
- right: 0;
359
- bottom: 0;
360
- box-sizing: border-box;
361
- width: 12px;
362
- height: 12px;
363
- margin: 0 -6px -6px 0;
364
- background-color: #fff;
365
- border: 2px solid #31d0c6;
366
- border-radius: 50%;
367
- cursor: nwse-resize;
368
- }
369
- `;var q6=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 BP extends me{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({},Jc.defaultOptions),e),Mo(this.name,F6)}init(e){this.graph=e,this.updateViewport=th(this.updateViewport.bind(this),0),this.container=document.createElement("div"),Z(this.container,this.prefixClassName(Ma.root));const t=document.createElement("div");this.container.appendChild(t),this.viewport=document.createElement("div"),Z(this.viewport,this.prefixClassName(Ma.viewport)),this.options.scalable&&(this.zoomHandle=document.createElement("div"),Z(this.zoomHandle,this.prefixClassName(Ma.zoom)),Er(this.zoomHandle,this.viewport)),Rn(this.container,this.viewport),ve(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 G(r),this.updatePaper(this.sourceGraph.options.width,this.sourceGraph.options.height),this.startListening()}startListening(){this.scroller?Ae.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?Ae.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 Bn,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=B$(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},ve(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(Jc.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=Ao(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(),_o(this.name)}}q6([me.dispose()],BP.prototype,"dispose",null);var Ma;(function(n){n.root="widget-minimap",n.viewport=`${n.root}-viewport`,n.zoom=`${n.viewport}-zoom`})(Ma||(Ma={}));var Jc;(function(n){n.defaultOptions={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:e=>new G(e)},n.documentEvents={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"}})(Jc||(Jc={}));var V6=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 $P extends me{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName($t.classNames.box)}get $boxes(){return e$(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 yx([],{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=Ao(i),o=i.scrollLeft,a=i.scrollTop;t=e.clientX-s.left+window.pageXOffset+o,r=e.clientY-s.top+window.pageYOffset+a}ve(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"?Q(t,this.graph,r):!0)}stopSelecting(e){const t=this.graph,r=this.getEventData(e);switch(r.action){case"selecting":{let s=j$(this.container),o=D$(this.container);const a=Ao(this.container),l=t.pageToLocal(a.left,a.top),c=t.transform.getScale();s/=c.sx,o/=c.sy;const u=new B(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"?Q(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=ce.getCellsBBox(o,{deep:!0})||B.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=ve(e,"left"),s=ve(e,"top"),o=i?parseFloat(i):0,a=s?parseFloat(s):0;ve(e,"left",o+t),ve(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&&(Er(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(ve(this.container,"left")||"0",10),h=parseInt(ve(this.container,"top")||"0",10);ve(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)&&(Qn(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(),Qn(this.$boxes),this.boxCount=0}hide(){gt(this.container,this.prefixClassName($t.classNames.rubberband)),gt(this.container,this.prefixClassName($t.classNames.selected))}showRubberband(){Z(this.container,this.prefixClassName($t.classNames.rubberband))}hideRubberband(){gt(this.container,this.prefixClassName($t.classNames.rubberband))}showSelected(){mh(this.container,"style"),Z(this.container,this.prefixClassName($t.classNames.selected))}createContainer(){this.container=document.createElement("div"),Z(this.container,this.prefixClassName($t.classNames.root)),this.options.className&&Z(this.container,this.options.className),this.selectionContainer=document.createElement("div"),Z(this.selectionContainer,this.prefixClassName($t.classNames.inner)),this.selectionContent=document.createElement("div"),Z(this.selectionContent,this.prefixClassName($t.classNames.content)),Rn(this.selectionContainer,this.selectionContent),ge(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)}}),ve(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:t.x-e.x,height:t.y-e.y}),ge(this.selectionContainer,"data-selection-length",this.collection.length);const i=this.options.content;if(i)if(typeof i=="function"){const s=Q(i,this.graph,this,this.selectionContent);s&&(this.selectionContent.innerHTML=s)}else this.selectionContent.innerHTML=i;this.collection.length>0&&!this.container.parentNode?Er(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");Z(s,i),Z(s,`${i}-${e.isNode()?"node":"edge"}`),ge(s,"data-cell-id",e.id),ve(s,{position:"absolute",left:r.x,top:r.y,width:r.width,height:r.height,pointerEvents:this.options.pointerEvents||"auto"}),Er(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=ge(r,"data-cell-id");Qn(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()}}V6([me.dispose()],$P.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 G6=`.x6-widget-selection {
346
+ `;G.prototype.lockScroller=function(){const n=this.getPlugin("scroller");return n&&n.lockScroller(),this},G.prototype.unlockScroller=function(){const n=this.getPlugin("scroller");return n&&n.unlockScroller(),this},G.prototype.updateScroller=function(){const n=this.getPlugin("scroller");return n&&n.updateScroller(),this},G.prototype.getScrollbarPosition=function(){const n=this.getPlugin("scroller");return n?n.getScrollbarPosition():{left:0,top:0}},G.prototype.setScrollbarPosition=function(n,e){const t=this.getPlugin("scroller");return t&&t.setScrollbarPosition(n,e),this};var Rq=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 Ax 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,Mo(this.name,Lq)}init(e){this.graph=e;const t=it.getOptions(Object.assign(Object.assign({enabled:!0},this.options),{graph:e}));this.options=t,this.scrollerImpl=new it(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),Ae.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")&&Ae.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&&er.isMatch(e,this.options.modifiers,t)}updateClassName(e){const t=this.scrollerImpl.container,r=nn.prefix("graph-scroller-pannable");this.pannable?(Z(t,r),t.dataset.panning=(!!e).toString()):gt(t,r)}dispose(){this.scrollerImpl.dispose(),this.stopListening(),this.off(),_o(this.name)}}Rq([wt.dispose()],Ax.prototype,"dispose",null);var jq=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 Tx extends me{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(Lt.classNames.box)}get $boxes(){return e$(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 yx([],{comparator:Lt.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=Ao(i),o=i.scrollLeft,a=i.scrollTop;t=e.clientX-s.left+window.pageXOffset+o,r=e.clientY-s.top+window.pageYOffset+a}ve(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(Lt.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"?Q(t,this.graph,r):!0)}stopSelecting(e){const t=this.graph,r=this.getEventData(e);switch(r.action){case"selecting":{let s=j$(this.container),o=D$(this.container);const a=Ao(this.container),l=t.pageToLocal(a.left,a.top),c=t.transform.getScale();s/=c.sx,o/=c.sy;const u=new B(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(Lt.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"?Q(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=ce.getCellsBBox(o,{deep:!0})||B.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=ve(e,"left"),s=ve(e,"top"),o=i?parseFloat(i):0,a=s?parseFloat(s):0;ve(e,"left",o+t),ve(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&&(Er(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(ve(this.container,"left")||"0",10),h=parseInt(ve(this.container,"top")||"0",10);ve(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)&&(Qn(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(),Qn(this.$boxes),this.boxCount=0}hide(){gt(this.container,this.prefixClassName(Lt.classNames.rubberband)),gt(this.container,this.prefixClassName(Lt.classNames.selected))}showRubberband(){Z(this.container,this.prefixClassName(Lt.classNames.rubberband))}hideRubberband(){gt(this.container,this.prefixClassName(Lt.classNames.rubberband))}showSelected(){mh(this.container,"style"),Z(this.container,this.prefixClassName(Lt.classNames.selected))}createContainer(){this.container=document.createElement("div"),Z(this.container,this.prefixClassName(Lt.classNames.root)),this.options.className&&Z(this.container,this.options.className),this.selectionContainer=document.createElement("div"),Z(this.selectionContainer,this.prefixClassName(Lt.classNames.inner)),this.selectionContent=document.createElement("div"),Z(this.selectionContent,this.prefixClassName(Lt.classNames.content)),Rn(this.selectionContainer,this.selectionContent),ge(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)}}),ve(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:t.x-e.x,height:t.y-e.y}),ge(this.selectionContainer,"data-selection-length",this.collection.length);const i=this.options.content;if(i)if(typeof i=="function"){const s=Q(i,this.graph,this,this.selectionContent);s&&(this.selectionContent.innerHTML=s)}else this.selectionContent.innerHTML=i;this.collection.length>0&&!this.container.parentNode?Er(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");Z(s,i),Z(s,`${i}-${e.isNode()?"node":"edge"}`),ge(s,"data-cell-id",e.id),ve(s,{position:"absolute",left:r.x,top:r.y,width:r.width,height:r.height,pointerEvents:this.options.pointerEvents||"auto"}),Er(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=ge(r,"data-cell-id");Qn(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()}}jq([me.dispose()],Tx.prototype,"dispose",null);var Lt;(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})(Lt||(Lt={}));const Dq=`.x6-widget-selection {
370
347
  position: absolute;
371
348
  top: 0;
372
349
  left: 0;
@@ -431,7 +408,7 @@ Error generating stack: `+s.message+`
431
408
  font-size: 10px;
432
409
  background-color: #6a6b8a;
433
410
  }
434
- `;G.prototype.isSelectionEnabled=function(){const n=this.getPlugin("selection");return n?n.isEnabled():!1},G.prototype.enableSelection=function(){const n=this.getPlugin("selection");return n&&n.enable(),this},G.prototype.disableSelection=function(){const n=this.getPlugin("selection");return n&&n.disable(),this},G.prototype.toggleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleEnabled(n),this},G.prototype.isMultipleSelection=function(){const n=this.getPlugin("selection");return n?n.isMultipleSelection():!1},G.prototype.enableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.enableMultipleSelection(),this},G.prototype.disableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.disableMultipleSelection(),this},G.prototype.toggleMultipleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleMultipleSelection(n),this},G.prototype.isSelectionMovable=function(){const n=this.getPlugin("selection");return n?n.isSelectionMovable():!1},G.prototype.enableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.enableSelectionMovable(),this},G.prototype.disableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.disableSelectionMovable(),this},G.prototype.toggleSelectionMovable=function(n){const e=this.getPlugin("selection");return e&&e.toggleSelectionMovable(n),this},G.prototype.isRubberbandEnabled=function(){const n=this.getPlugin("selection");return n?n.isRubberbandEnabled():!1},G.prototype.enableRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableRubberband(),this},G.prototype.disableRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableRubberband(),this},G.prototype.toggleRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleRubberband(n),this},G.prototype.isStrictRubberband=function(){const n=this.getPlugin("selection");return n?n.isStrictRubberband():!1},G.prototype.enableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableStrictRubberband(),this},G.prototype.disableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableStrictRubberband(),this},G.prototype.toggleStrictRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleStrictRubberband(n),this},G.prototype.setRubberbandModifiers=function(n){const e=this.getPlugin("selection");return e&&e.setRubberbandModifiers(n),this},G.prototype.setSelectionFilter=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionFilter(n),this},G.prototype.setSelectionDisplayContent=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionDisplayContent(n),this},G.prototype.isSelectionEmpty=function(){const n=this.getPlugin("selection");return n?n.isEmpty():!0},G.prototype.cleanSelection=function(n){const e=this.getPlugin("selection");return e&&e.clean(n),this},G.prototype.resetSelection=function(n,e){const t=this.getPlugin("selection");return t&&t.reset(n,e),this},G.prototype.getSelectedCells=function(){const n=this.getPlugin("selection");return n?n.getSelectedCells():[]},G.prototype.getSelectedCellCount=function(){const n=this.getPlugin("selection");return n?n.getSelectedCellCount():0},G.prototype.isSelected=function(n){const e=this.getPlugin("selection");return e?e.isSelected(n):!1},G.prototype.select=function(n,e){const t=this.getPlugin("selection");return t&&t.select(n,e),this},G.prototype.unselect=function(n,e){const t=this.getPlugin("selection");return t?t.unselect(n,e):this};var H6=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 Qs 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=Re({enabled:!0},Qs.defaultOptions,e),Mo(this.name,G6)}init(e){this.graph=e,this.selectionImpl=new $P(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&&er.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&er.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(),_o(this.name)}}H6([wt.dispose()],Qs.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}}(Qs||(Qs={}));var U6=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},W6=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 zP extends me{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=W6(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 te("svg"),t=this.horizontal=new te("line"),r=this.vertical=new te("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"?Q(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=xe.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(L=>{if(this.isIgnored(e,L))return!1;const V=L.getBBox().bbox(L.getAngle()),Y=V.getTopLeft(),M=V.getBottomRight(),I={vertical:[Y.x,M.x],horizontal:[Y.y,M.y]},J={};return Object.keys(I).forEach(R=>{const F=R,H=I[F].map(ne=>({position:ne,distance:Math.abs(ne-b[F])})).filter(ne=>ne.distance<=c);J[F]=h1(H,ne=>ne.distance)}),u==null&&J.vertical.length>0&&(u=J.vertical[0].position,h=Math.min(s.y,V.y),f=Math.max(a.y,M.y)-h),d==null&&J.horizontal.length>0&&(d=J.horizontal[0].position,g=Math.min(s.x,V.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,P=0;if(l%90===0)l===90||l===270?(C=x,P=w):(C=w,P=x);else{const L=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 V=xe.toRad(l%90);w&&(C=L===3?w/Math.cos(V):w/Math.sin(V)),x&&(P=L===3?x/Math.cos(V):x/Math.sin(V));const Y=L===1||L===3;switch(v){case"top":case"bottom":P=x?x/(Y?Math.cos(V):Math.sin(V)):w/(Y?Math.sin(V):Math.cos(V));break;case"left":case"right":C=w?w/(Y?Math.cos(V):Math.sin(V)):x/(Y?Math.sin(V):Math.cos(V));break}}switch(v){case"top":case"bottom":C=0;break;case"left":case"right":P=0;break}const E=this.graph.getGridSize();let A=Math.max(i.width+C,E),O=Math.max(i.height+P,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&&(P<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 B(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,P=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(),L=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(L.x-g.x)<p?(b=L.x,C=1):Math.abs(L.x-d.x)<p&&(b=L.x),b!=null&&(m=Math.min(f.y,A.y),y=Math.max(g.y,L.y)-m)),v==null&&(Math.abs(O.y-h.y)<p?(v=O.y,P=.5):Math.abs(T.y-d.y)<p?v=T.y:Math.abs(T.y-g.y)<p?(v=T.y,P=1):Math.abs(L.y-g.y)<p?(v=L.y,P=1):Math.abs(L.y-d.y)<p&&(v=L.y),v!=null&&(w=Math.min(f.x,A.x),x=Math.max(g.x,L.x)-w)),b!=null&&v!=null}),this.hide(),v!=null||b!=null){v!=null&&(f.y=v-P*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,L=O-l.y;(T!==0||L!==0)&&(o.translate(T,L,{snapped:!0,restrict:this.getRestrictArea(s)}),x&&(x+=T),y&&(y+=L)),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"?Q(t,this.graph,e):!0}update(e){if(e.horizontalTop){const t=this.graph.localToGraph(new S(e.horizontalLeft,e.horizontalTop)),r=this.graph.localToGraph(new S(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 S(e.verticalLeft,e.verticalTop)),r=this.graph.localToGraph(new S(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()}}U6([me.dispose()],zP.prototype,"dispose",null);const X6=`.x6-widget-snapline {
411
+ `;G.prototype.isSelectionEnabled=function(){const n=this.getPlugin("selection");return n?n.isEnabled():!1},G.prototype.enableSelection=function(){const n=this.getPlugin("selection");return n&&n.enable(),this},G.prototype.disableSelection=function(){const n=this.getPlugin("selection");return n&&n.disable(),this},G.prototype.toggleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleEnabled(n),this},G.prototype.isMultipleSelection=function(){const n=this.getPlugin("selection");return n?n.isMultipleSelection():!1},G.prototype.enableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.enableMultipleSelection(),this},G.prototype.disableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.disableMultipleSelection(),this},G.prototype.toggleMultipleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleMultipleSelection(n),this},G.prototype.isSelectionMovable=function(){const n=this.getPlugin("selection");return n?n.isSelectionMovable():!1},G.prototype.enableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.enableSelectionMovable(),this},G.prototype.disableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.disableSelectionMovable(),this},G.prototype.toggleSelectionMovable=function(n){const e=this.getPlugin("selection");return e&&e.toggleSelectionMovable(n),this},G.prototype.isRubberbandEnabled=function(){const n=this.getPlugin("selection");return n?n.isRubberbandEnabled():!1},G.prototype.enableRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableRubberband(),this},G.prototype.disableRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableRubberband(),this},G.prototype.toggleRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleRubberband(n),this},G.prototype.isStrictRubberband=function(){const n=this.getPlugin("selection");return n?n.isStrictRubberband():!1},G.prototype.enableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableStrictRubberband(),this},G.prototype.disableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableStrictRubberband(),this},G.prototype.toggleStrictRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleStrictRubberband(n),this},G.prototype.setRubberbandModifiers=function(n){const e=this.getPlugin("selection");return e&&e.setRubberbandModifiers(n),this},G.prototype.setSelectionFilter=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionFilter(n),this},G.prototype.setSelectionDisplayContent=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionDisplayContent(n),this},G.prototype.isSelectionEmpty=function(){const n=this.getPlugin("selection");return n?n.isEmpty():!0},G.prototype.cleanSelection=function(n){const e=this.getPlugin("selection");return e&&e.clean(n),this},G.prototype.resetSelection=function(n,e){const t=this.getPlugin("selection");return t&&t.reset(n,e),this},G.prototype.getSelectedCells=function(){const n=this.getPlugin("selection");return n?n.getSelectedCells():[]},G.prototype.getSelectedCellCount=function(){const n=this.getPlugin("selection");return n?n.getSelectedCellCount():0},G.prototype.isSelected=function(n){const e=this.getPlugin("selection");return e?e.isSelected(n):!1},G.prototype.select=function(n,e){const t=this.getPlugin("selection");return t&&t.select(n,e),this},G.prototype.unselect=function(n,e){const t=this.getPlugin("selection");return t?t.unselect(n,e):this};var Bq=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 Ss 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=Re({enabled:!0},Ss.defaultOptions,e),Mo(this.name,Dq)}init(e){this.graph=e,this.selectionImpl=new Tx(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&&er.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&er.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(),_o(this.name)}}Bq([wt.dispose()],Ss.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}}(Ss||(Ss={}));var $q=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},zq=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 Ox extends me{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=zq(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 te("svg"),t=this.horizontal=new te("line"),r=this.vertical=new te("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"?Q(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=xe.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(L=>{if(this.isIgnored(e,L))return!1;const V=L.getBBox().bbox(L.getAngle()),Y=V.getTopLeft(),M=V.getBottomRight(),I={vertical:[Y.x,M.x],horizontal:[Y.y,M.y]},J={};return Object.keys(I).forEach(j=>{const F=j,H=I[F].map(ne=>({position:ne,distance:Math.abs(ne-b[F])})).filter(ne=>ne.distance<=c);J[F]=h1(H,ne=>ne.distance)}),u==null&&J.vertical.length>0&&(u=J.vertical[0].position,h=Math.min(s.y,V.y),f=Math.max(a.y,M.y)-h),d==null&&J.horizontal.length>0&&(d=J.horizontal[0].position,g=Math.min(s.x,V.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,P=0;if(l%90===0)l===90||l===270?(C=x,P=w):(C=w,P=x);else{const L=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 V=xe.toRad(l%90);w&&(C=L===3?w/Math.cos(V):w/Math.sin(V)),x&&(P=L===3?x/Math.cos(V):x/Math.sin(V));const Y=L===1||L===3;switch(v){case"top":case"bottom":P=x?x/(Y?Math.cos(V):Math.sin(V)):w/(Y?Math.sin(V):Math.cos(V));break;case"left":case"right":C=w?w/(Y?Math.cos(V):Math.sin(V)):x/(Y?Math.sin(V):Math.cos(V));break}}switch(v){case"top":case"bottom":C=0;break;case"left":case"right":P=0;break}const E=this.graph.getGridSize();let A=Math.max(i.width+C,E),O=Math.max(i.height+P,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&&(P<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 B(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,P=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(),L=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(L.x-g.x)<p?(b=L.x,C=1):Math.abs(L.x-d.x)<p&&(b=L.x),b!=null&&(m=Math.min(f.y,A.y),y=Math.max(g.y,L.y)-m)),v==null&&(Math.abs(O.y-h.y)<p?(v=O.y,P=.5):Math.abs(T.y-d.y)<p?v=T.y:Math.abs(T.y-g.y)<p?(v=T.y,P=1):Math.abs(L.y-g.y)<p?(v=L.y,P=1):Math.abs(L.y-d.y)<p&&(v=L.y),v!=null&&(w=Math.min(f.x,A.x),x=Math.max(g.x,L.x)-w)),b!=null&&v!=null}),this.hide(),v!=null||b!=null){v!=null&&(f.y=v-P*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,L=O-l.y;(T!==0||L!==0)&&(o.translate(T,L,{snapped:!0,restrict:this.getRestrictArea(s)}),x&&(x+=T),y&&(y+=L)),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"?Q(t,this.graph,e):!0}update(e){if(e.horizontalTop){const t=this.graph.localToGraph(new S(e.horizontalLeft,e.horizontalTop)),r=this.graph.localToGraph(new S(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 S(e.verticalLeft,e.verticalTop)),r=this.graph.localToGraph(new S(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()}}$q([me.dispose()],Ox.prototype,"dispose",null);const Fq=`.x6-widget-snapline {
435
412
  position: absolute;
436
413
  top: 0;
437
414
  right: 0;
@@ -444,7 +421,30 @@ Error generating stack: `+s.message+`
444
421
  stroke: #2ecc71;
445
422
  stroke-width: 1px;
446
423
  }
447
- `;G.prototype.isSnaplineEnabled=function(){const n=this.getPlugin("snapline");return n?n.isEnabled():!1},G.prototype.enableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enable(),this},G.prototype.disableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disable(),this},G.prototype.toggleSnapline=function(){const n=this.getPlugin("snapline");return n&&n.toggleEnabled(),this},G.prototype.hideSnapline=function(){const n=this.getPlugin("snapline");return n&&n.hide(),this},G.prototype.setSnaplineFilter=function(n){const e=this.getPlugin("snapline");return e&&e.setFilter(n),this},G.prototype.isSnaplineOnResizingEnabled=function(){const n=this.getPlugin("snapline");return n?n.isOnResizingEnabled():!1},G.prototype.enableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.enableOnResizing(),this},G.prototype.disableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.disableOnResizing(),this},G.prototype.toggleSnaplineOnResizing=function(n){const e=this.getPlugin("snapline");return e&&e.toggleOnResizing(n),this},G.prototype.isSharpSnapline=function(){const n=this.getPlugin("snapline");return n?n.isSharp():!1},G.prototype.enableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enableSharp(),this},G.prototype.disableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disableSharp(),this},G.prototype.toggleSharpSnapline=function(n){const e=this.getPlugin("snapline");return e&&e.toggleSharp(n),this},G.prototype.getSnaplineTolerance=function(){const n=this.getPlugin("snapline");if(n)return n.getTolerance()},G.prototype.setSnaplineTolerance=function(n){const e=this.getPlugin("snapline");return e&&e.setTolerance(n),this};var Y6=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 FP extends Nn{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),Mo(this.name,X6)}init(e){this.snaplineImpl=new zP(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(),_o(this.name)}}Y6([Nn.dispose()],FP.prototype,"dispose",null);function Jd(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 Qd,qP;function K6(){if(qP)return Qd;qP=1;function n(){this.__data__=[],this.size=0}return Qd=n,Qd}var Zd,VP;function Zs(){if(VP)return Zd;VP=1;function n(e,t){return e===t||e!==e&&t!==t}return Zd=n,Zd}var eg,GP;function Qc(){if(GP)return eg;GP=1;var n=Zs();function e(t,r){for(var i=t.length;i--;)if(n(t[i][0],r))return i;return-1}return eg=e,eg}var tg,HP;function J6(){if(HP)return tg;HP=1;var n=Qc(),e=Array.prototype,t=e.splice;function r(i){var s=this.__data__,o=n(s,i);if(o<0)return!1;var a=s.length-1;return o==a?s.pop():t.call(s,o,1),--this.size,!0}return tg=r,tg}var ng,UP;function Q6(){if(UP)return ng;UP=1;var n=Qc();function e(t){var r=this.__data__,i=n(r,t);return i<0?void 0:r[i][1]}return ng=e,ng}var rg,WP;function Z6(){if(WP)return rg;WP=1;var n=Qc();function e(t){return n(this.__data__,t)>-1}return rg=e,rg}var ig,XP;function e4(){if(XP)return ig;XP=1;var n=Qc();function e(t,r){var i=this.__data__,s=n(i,t);return s<0?(++this.size,i.push([t,r])):i[s][1]=r,this}return ig=e,ig}var sg,YP;function Zc(){if(YP)return sg;YP=1;var n=K6(),e=J6(),t=Q6(),r=Z6(),i=e4();function s(o){var a=-1,l=o==null?0:o.length;for(this.clear();++a<l;){var c=o[a];this.set(c[0],c[1])}}return s.prototype.clear=n,s.prototype.delete=e,s.prototype.get=t,s.prototype.has=r,s.prototype.set=i,sg=s,sg}var og,KP;function t4(){if(KP)return og;KP=1;var n=Zc();function e(){this.__data__=new n,this.size=0}return og=e,og}var ag,JP;function n4(){if(JP)return ag;JP=1;function n(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}return ag=n,ag}var lg,QP;function r4(){if(QP)return lg;QP=1;function n(e){return this.__data__.get(e)}return lg=n,lg}var cg,ZP;function i4(){if(ZP)return cg;ZP=1;function n(e){return this.__data__.has(e)}return cg=n,cg}var ug,eE;function tE(){if(eE)return ug;eE=1;var n=typeof Bl=="object"&&Bl&&Bl.Object===Object&&Bl;return ug=n,ug}var hg,nE;function Tn(){if(nE)return hg;nE=1;var n=tE(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=n||e||Function("return this")();return hg=t,hg}var fg,rE;function eo(){if(rE)return fg;rE=1;var n=Tn(),e=n.Symbol;return fg=e,fg}var dg,iE;function s4(){if(iE)return dg;iE=1;var n=eo(),e=Object.prototype,t=e.hasOwnProperty,r=e.toString,i=n?n.toStringTag:void 0;function s(o){var a=t.call(o,i),l=o[i];try{o[i]=void 0;var c=!0}catch(h){}var u=r.call(o);return c&&(a?o[i]=l:delete o[i]),u}return dg=s,dg}var gg,sE;function o4(){if(sE)return gg;sE=1;var n=Object.prototype,e=n.toString;function t(r){return e.call(r)}return gg=t,gg}var pg,oE;function ji(){if(oE)return pg;oE=1;var n=eo(),e=s4(),t=o4(),r="[object Null]",i="[object Undefined]",s=n?n.toStringTag:void 0;function o(a){return a==null?a===void 0?i:r:s&&s in Object(a)?e(a):t(a)}return pg=o,pg}var mg,aE;function hn(){if(aE)return mg;aE=1;function n(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return mg=n,mg}var yg,lE;function _a(){if(lE)return yg;lE=1;var n=ji(),e=hn(),t="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",s="[object Proxy]";function o(a){if(!e(a))return!1;var l=n(a);return l==r||l==i||l==t||l==s}return yg=o,yg}var vg,cE;function a4(){if(cE)return vg;cE=1;var n=Tn(),e=n["__core-js_shared__"];return vg=e,vg}var bg,uE;function l4(){if(uE)return bg;uE=1;var n=a4(),e=function(){var r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function t(r){return!!e&&e in r}return bg=t,bg}var wg,hE;function fE(){if(hE)return wg;hE=1;var n=Function.prototype,e=n.toString;function t(r){if(r!=null){try{return e.call(r)}catch(i){}try{return r+""}catch(i){}}return""}return wg=t,wg}var xg,dE;function c4(){if(dE)return xg;dE=1;var n=_a(),e=l4(),t=hn(),r=fE(),i=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,o=Function.prototype,a=Object.prototype,l=o.toString,c=a.hasOwnProperty,u=RegExp("^"+l.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(f){if(!t(f)||e(f))return!1;var d=n(f)?u:s;return d.test(r(f))}return xg=h,xg}var Cg,gE;function u4(){if(gE)return Cg;gE=1;function n(e,t){return e==null?void 0:e[t]}return Cg=n,Cg}var Sg,pE;function Di(){if(pE)return Sg;pE=1;var n=c4(),e=u4();function t(r,i){var s=e(r,i);return n(s)?s:void 0}return Sg=t,Sg}var Pg,mE;function Eg(){if(mE)return Pg;mE=1;var n=Di(),e=Tn(),t=n(e,"Map");return Pg=t,Pg}var Ag,yE;function eu(){if(yE)return Ag;yE=1;var n=Di(),e=n(Object,"create");return Ag=e,Ag}var Tg,vE;function h4(){if(vE)return Tg;vE=1;var n=eu();function e(){this.__data__=n?n(null):{},this.size=0}return Tg=e,Tg}var Og,bE;function f4(){if(bE)return Og;bE=1;function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return Og=n,Og}var Mg,wE;function d4(){if(wE)return Mg;wE=1;var n=eu(),e="__lodash_hash_undefined__",t=Object.prototype,r=t.hasOwnProperty;function i(s){var o=this.__data__;if(n){var a=o[s];return a===e?void 0:a}return r.call(o,s)?o[s]:void 0}return Mg=i,Mg}var _g,xE;function g4(){if(xE)return _g;xE=1;var n=eu(),e=Object.prototype,t=e.hasOwnProperty;function r(i){var s=this.__data__;return n?s[i]!==void 0:t.call(s,i)}return _g=r,_g}var Ng,CE;function p4(){if(CE)return Ng;CE=1;var n=eu(),e="__lodash_hash_undefined__";function t(r,i){var s=this.__data__;return this.size+=this.has(r)?0:1,s[r]=n&&i===void 0?e:i,this}return Ng=t,Ng}var kg,SE;function m4(){if(SE)return kg;SE=1;var n=h4(),e=f4(),t=d4(),r=g4(),i=p4();function s(o){var a=-1,l=o==null?0:o.length;for(this.clear();++a<l;){var c=o[a];this.set(c[0],c[1])}}return s.prototype.clear=n,s.prototype.delete=e,s.prototype.get=t,s.prototype.has=r,s.prototype.set=i,kg=s,kg}var Ig,PE;function y4(){if(PE)return Ig;PE=1;var n=m4(),e=Zc(),t=Eg();function r(){this.size=0,this.__data__={hash:new n,map:new(t||e),string:new n}}return Ig=r,Ig}var Lg,EE;function v4(){if(EE)return Lg;EE=1;function n(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Lg=n,Lg}var Rg,AE;function tu(){if(AE)return Rg;AE=1;var n=v4();function e(t,r){var i=t.__data__;return n(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Rg=e,Rg}var jg,TE;function b4(){if(TE)return jg;TE=1;var n=tu();function e(t){var r=n(this,t).delete(t);return this.size-=r?1:0,r}return jg=e,jg}var Dg,OE;function w4(){if(OE)return Dg;OE=1;var n=tu();function e(t){return n(this,t).get(t)}return Dg=e,Dg}var Bg,ME;function x4(){if(ME)return Bg;ME=1;var n=tu();function e(t){return n(this,t).has(t)}return Bg=e,Bg}var $g,_E;function C4(){if(_E)return $g;_E=1;var n=tu();function e(t,r){var i=n(this,t),s=i.size;return i.set(t,r),this.size+=i.size==s?0:1,this}return $g=e,$g}var zg,NE;function Fg(){if(NE)return zg;NE=1;var n=y4(),e=b4(),t=w4(),r=x4(),i=C4();function s(o){var a=-1,l=o==null?0:o.length;for(this.clear();++a<l;){var c=o[a];this.set(c[0],c[1])}}return s.prototype.clear=n,s.prototype.delete=e,s.prototype.get=t,s.prototype.has=r,s.prototype.set=i,zg=s,zg}var qg,kE;function S4(){if(kE)return qg;kE=1;var n=Zc(),e=Eg(),t=Fg(),r=200;function i(s,o){var a=this.__data__;if(a instanceof n){var l=a.__data__;if(!e||l.length<r-1)return l.push([s,o]),this.size=++a.size,this;a=this.__data__=new t(l)}return a.set(s,o),this.size=a.size,this}return qg=i,qg}var Vg,IE;function nu(){if(IE)return Vg;IE=1;var n=Zc(),e=t4(),t=n4(),r=r4(),i=i4(),s=S4();function o(a){var l=this.__data__=new n(a);this.size=l.size}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=r,o.prototype.has=i,o.prototype.set=s,Vg=o,Vg}var Gg,LE;function Hg(){if(LE)return Gg;LE=1;function n(e,t){for(var r=-1,i=e==null?0:e.length;++r<i&&t(e[r],r,e)!==!1;);return e}return Gg=n,Gg}var Ug,RE;function jE(){if(RE)return Ug;RE=1;var n=Di(),e=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(r){}}();return Ug=e,Ug}var Wg,DE;function ru(){if(DE)return Wg;DE=1;var n=jE();function e(t,r,i){r=="__proto__"&&n?n(t,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[r]=i}return Wg=e,Wg}var Xg,BE;function iu(){if(BE)return Xg;BE=1;var n=ru(),e=Zs(),t=Object.prototype,r=t.hasOwnProperty;function i(s,o,a){var l=s[o];(!(r.call(s,o)&&e(l,a))||a===void 0&&!(o in s))&&n(s,o,a)}return Xg=i,Xg}var Yg,$E;function Na(){if($E)return Yg;$E=1;var n=iu(),e=ru();function t(r,i,s,o){var a=!s;s||(s={});for(var l=-1,c=i.length;++l<c;){var u=i[l],h=o?o(s[u],r[u],u,s,r):void 0;h===void 0&&(h=r[u]),a?e(s,u,h):n(s,u,h)}return s}return Yg=t,Yg}var Kg,zE;function P4(){if(zE)return Kg;zE=1;function n(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}return Kg=n,Kg}var Jg,FE;function Gn(){if(FE)return Jg;FE=1;function n(e){return e!=null&&typeof e=="object"}return Jg=n,Jg}var Qg,qE;function E4(){if(qE)return Qg;qE=1;var n=ji(),e=Gn(),t="[object Arguments]";function r(i){return e(i)&&n(i)==t}return Qg=r,Qg}var Zg,VE;function ka(){if(VE)return Zg;VE=1;var n=E4(),e=Gn(),t=Object.prototype,r=t.hasOwnProperty,i=t.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(o){return e(o)&&r.call(o,"callee")&&!i.call(o,"callee")};return Zg=s,Zg}var ep,GE;function tt(){if(GE)return ep;GE=1;var n=Array.isArray;return ep=n,ep}var Ia={exports:{}},tp,HE;function A4(){if(HE)return tp;HE=1;function n(){return!1}return tp=n,tp}Ia.exports;var UE;function to(){return UE||(UE=1,function(n,e){var t=Tn(),r=A4(),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}(Ia,Ia.exports)),Ia.exports}var np,WE;function su(){if(WE)return np;WE=1;var n=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(r,i){var s=typeof r;return i=i==null?n:i,!!i&&(s=="number"||s!="symbol"&&e.test(r))&&r>-1&&r%1==0&&r<i}return np=t,np}var rp,XE;function ip(){if(XE)return rp;XE=1;var n=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=n}return rp=e,rp}var sp,YE;function T4(){if(YE)return sp;YE=1;var n=ji(),e=ip(),t=Gn(),r="[object Arguments]",i="[object Array]",s="[object Boolean]",o="[object Date]",a="[object Error]",l="[object Function]",c="[object Map]",u="[object Number]",h="[object Object]",f="[object RegExp]",d="[object Set]",g="[object String]",p="[object WeakMap]",b="[object ArrayBuffer]",m="[object DataView]",y="[object Float32Array]",v="[object Float64Array]",w="[object Int8Array]",x="[object Int16Array]",C="[object Int32Array]",P="[object Uint8Array]",E="[object Uint8ClampedArray]",A="[object Uint16Array]",O="[object Uint32Array]",T={};T[y]=T[v]=T[w]=T[x]=T[C]=T[P]=T[E]=T[A]=T[O]=!0,T[r]=T[i]=T[b]=T[s]=T[m]=T[o]=T[a]=T[l]=T[c]=T[u]=T[h]=T[f]=T[d]=T[g]=T[p]=!1;function L(V){return t(V)&&e(V.length)&&!!T[n(V)]}return sp=L,sp}var op,KE;function ou(){if(KE)return op;KE=1;function n(e){return function(t){return e(t)}}return op=n,op}var La={exports:{}};La.exports;var JE;function ap(){return JE||(JE=1,function(n,e){var t=tE(),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}(La,La.exports)),La.exports}var lp,QE;function Ra(){if(QE)return lp;QE=1;var n=T4(),e=ou(),t=ap(),r=t&&t.isTypedArray,i=r?e(r):n;return lp=i,lp}var cp,ZE;function eA(){if(ZE)return cp;ZE=1;var n=P4(),e=ka(),t=tt(),r=to(),i=su(),s=Ra(),o=Object.prototype,a=o.hasOwnProperty;function l(c,u){var h=t(c),f=!h&&e(c),d=!h&&!f&&r(c),g=!h&&!f&&!d&&s(c),p=h||f||d||g,b=p?n(c.length,String):[],m=b.length;for(var y in c)(u||a.call(c,y))&&!(p&&(y=="length"||d&&(y=="offset"||y=="parent")||g&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||i(y,m)))&&b.push(y);return b}return cp=l,cp}var up,tA;function au(){if(tA)return up;tA=1;var n=Object.prototype;function e(t){var r=t&&t.constructor,i=typeof r=="function"&&r.prototype||n;return t===i}return up=e,up}var hp,nA;function rA(){if(nA)return hp;nA=1;function n(e,t){return function(r){return e(t(r))}}return hp=n,hp}var fp,iA;function O4(){if(iA)return fp;iA=1;var n=rA(),e=n(Object.keys,Object);return fp=e,fp}var dp,sA;function gp(){if(sA)return dp;sA=1;var n=au(),e=O4(),t=Object.prototype,r=t.hasOwnProperty;function i(s){if(!n(s))return e(s);var o=[];for(var a in Object(s))r.call(s,a)&&a!="constructor"&&o.push(a);return o}return dp=i,dp}var pp,oA;function pr(){if(oA)return pp;oA=1;var n=_a(),e=ip();function t(r){return r!=null&&e(r.length)&&!n(r)}return pp=t,pp}var mp,aA;function ri(){if(aA)return mp;aA=1;var n=eA(),e=gp(),t=pr();function r(i){return t(i)?n(i):e(i)}return mp=r,mp}var yp,lA;function M4(){if(lA)return yp;lA=1;var n=Na(),e=ri();function t(r,i){return r&&n(i,e(i),r)}return yp=t,yp}var vp,cA;function _4(){if(cA)return vp;cA=1;function n(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}return vp=n,vp}var bp,uA;function N4(){if(uA)return bp;uA=1;var n=hn(),e=au(),t=_4(),r=Object.prototype,i=r.hasOwnProperty;function s(o){if(!n(o))return t(o);var a=e(o),l=[];for(var c in o)c=="constructor"&&(a||!i.call(o,c))||l.push(c);return l}return bp=s,bp}var wp,hA;function Bi(){if(hA)return wp;hA=1;var n=eA(),e=N4(),t=pr();function r(i){return t(i)?n(i,!0):e(i)}return wp=r,wp}var xp,fA;function k4(){if(fA)return xp;fA=1;var n=Na(),e=Bi();function t(r,i){return r&&n(i,e(i),r)}return xp=t,xp}var ja={exports:{}};ja.exports;var dA;function gA(){return dA||(dA=1,function(n,e){var t=Tn(),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}(ja,ja.exports)),ja.exports}var Cp,pA;function mA(){if(pA)return Cp;pA=1;function n(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}return Cp=n,Cp}var Sp,yA;function vA(){if(yA)return Sp;yA=1;function n(e,t){for(var r=-1,i=e==null?0:e.length,s=0,o=[];++r<i;){var a=e[r];t(a,r,e)&&(o[s++]=a)}return o}return Sp=n,Sp}var Pp,bA;function wA(){if(bA)return Pp;bA=1;function n(){return[]}return Pp=n,Pp}var Ep,xA;function Ap(){if(xA)return Ep;xA=1;var n=vA(),e=wA(),t=Object.prototype,r=t.propertyIsEnumerable,i=Object.getOwnPropertySymbols,s=i?function(o){return o==null?[]:(o=Object(o),n(i(o),function(a){return r.call(o,a)}))}:e;return Ep=s,Ep}var Tp,CA;function I4(){if(CA)return Tp;CA=1;var n=Na(),e=Ap();function t(r,i){return n(r,e(r),i)}return Tp=t,Tp}var Op,SA;function Mp(){if(SA)return Op;SA=1;function n(e,t){for(var r=-1,i=t.length,s=e.length;++r<i;)e[s+r]=t[r];return e}return Op=n,Op}var _p,PA;function lu(){if(PA)return _p;PA=1;var n=rA(),e=n(Object.getPrototypeOf,Object);return _p=e,_p}var Np,EA;function AA(){if(EA)return Np;EA=1;var n=Mp(),e=lu(),t=Ap(),r=wA(),i=Object.getOwnPropertySymbols,s=i?function(o){for(var a=[];o;)n(a,t(o)),o=e(o);return a}:r;return Np=s,Np}var kp,TA;function L4(){if(TA)return kp;TA=1;var n=Na(),e=AA();function t(r,i){return n(r,e(r),i)}return kp=t,kp}var Ip,OA;function MA(){if(OA)return Ip;OA=1;var n=Mp(),e=tt();function t(r,i,s){var o=i(r);return e(r)?o:n(o,s(r))}return Ip=t,Ip}var Lp,_A;function NA(){if(_A)return Lp;_A=1;var n=MA(),e=Ap(),t=ri();function r(i){return n(i,t,e)}return Lp=r,Lp}var Rp,kA;function R4(){if(kA)return Rp;kA=1;var n=MA(),e=AA(),t=Bi();function r(i){return n(i,t,e)}return Rp=r,Rp}var jp,IA;function j4(){if(IA)return jp;IA=1;var n=Di(),e=Tn(),t=n(e,"DataView");return jp=t,jp}var Dp,LA;function D4(){if(LA)return Dp;LA=1;var n=Di(),e=Tn(),t=n(e,"Promise");return Dp=t,Dp}var Bp,RA;function jA(){if(RA)return Bp;RA=1;var n=Di(),e=Tn(),t=n(e,"Set");return Bp=t,Bp}var $p,DA;function B4(){if(DA)return $p;DA=1;var n=Di(),e=Tn(),t=n(e,"WeakMap");return $p=t,$p}var zp,BA;function no(){if(BA)return zp;BA=1;var n=j4(),e=Eg(),t=D4(),r=jA(),i=B4(),s=ji(),o=fE(),a="[object Map]",l="[object Object]",c="[object Promise]",u="[object Set]",h="[object WeakMap]",f="[object DataView]",d=o(n),g=o(e),p=o(t),b=o(r),m=o(i),y=s;return(n&&y(new n(new ArrayBuffer(1)))!=f||e&&y(new e)!=a||t&&y(t.resolve())!=c||r&&y(new r)!=u||i&&y(new i)!=h)&&(y=function(v){var w=s(v),x=w==l?v.constructor:void 0,C=x?o(x):"";if(C)switch(C){case d:return f;case g:return a;case p:return c;case b:return u;case m:return h}return w}),zp=y,zp}var Fp,$A;function $4(){if($A)return Fp;$A=1;var n=Object.prototype,e=n.hasOwnProperty;function t(r){var i=r.length,s=new r.constructor(i);return i&&typeof r[0]=="string"&&e.call(r,"index")&&(s.index=r.index,s.input=r.input),s}return Fp=t,Fp}var qp,zA;function FA(){if(zA)return qp;zA=1;var n=Tn(),e=n.Uint8Array;return qp=e,qp}var Vp,qA;function Gp(){if(qA)return Vp;qA=1;var n=FA();function e(t){var r=new t.constructor(t.byteLength);return new n(r).set(new n(t)),r}return Vp=e,Vp}var Hp,VA;function z4(){if(VA)return Hp;VA=1;var n=Gp();function e(t,r){var i=r?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}return Hp=e,Hp}var Up,GA;function F4(){if(GA)return Up;GA=1;var n=/\w*$/;function e(t){var r=new t.constructor(t.source,n.exec(t));return r.lastIndex=t.lastIndex,r}return Up=e,Up}var Wp,HA;function q4(){if(HA)return Wp;HA=1;var n=eo(),e=n?n.prototype:void 0,t=e?e.valueOf:void 0;function r(i){return t?Object(t.call(i)):{}}return Wp=r,Wp}var Xp,UA;function WA(){if(UA)return Xp;UA=1;var n=Gp();function e(t,r){var i=r?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}return Xp=e,Xp}var Yp,XA;function V4(){if(XA)return Yp;XA=1;var n=Gp(),e=z4(),t=F4(),r=q4(),i=WA(),s="[object Boolean]",o="[object Date]",a="[object Map]",l="[object Number]",c="[object RegExp]",u="[object Set]",h="[object String]",f="[object Symbol]",d="[object ArrayBuffer]",g="[object DataView]",p="[object Float32Array]",b="[object Float64Array]",m="[object Int8Array]",y="[object Int16Array]",v="[object Int32Array]",w="[object Uint8Array]",x="[object Uint8ClampedArray]",C="[object Uint16Array]",P="[object Uint32Array]";function E(A,O,T){var L=A.constructor;switch(O){case d:return n(A);case s:case o:return new L(+A);case g:return e(A,T);case p:case b:case m:case y:case v:case w:case x:case C:case P:return i(A,T);case a:return new L;case l:case h:return new L(A);case c:return t(A);case u:return new L;case f:return r(A)}}return Yp=E,Yp}var Kp,YA;function KA(){if(YA)return Kp;YA=1;var n=hn(),e=Object.create,t=function(){function r(){}return function(i){if(!n(i))return{};if(e)return e(i);r.prototype=i;var s=new r;return r.prototype=void 0,s}}();return Kp=t,Kp}var Jp,JA;function QA(){if(JA)return Jp;JA=1;var n=KA(),e=lu(),t=au();function r(i){return typeof i.constructor=="function"&&!t(i)?n(e(i)):{}}return Jp=r,Jp}var Qp,ZA;function G4(){if(ZA)return Qp;ZA=1;var n=no(),e=Gn(),t="[object Map]";function r(i){return e(i)&&n(i)==t}return Qp=r,Qp}var Zp,eT;function H4(){if(eT)return Zp;eT=1;var n=G4(),e=ou(),t=ap(),r=t&&t.isMap,i=r?e(r):n;return Zp=i,Zp}var em,tT;function U4(){if(tT)return em;tT=1;var n=no(),e=Gn(),t="[object Set]";function r(i){return e(i)&&n(i)==t}return em=r,em}var tm,nT;function W4(){if(nT)return tm;nT=1;var n=U4(),e=ou(),t=ap(),r=t&&t.isSet,i=r?e(r):n;return tm=i,tm}var nm,rT;function iT(){if(rT)return nm;rT=1;var n=nu(),e=Hg(),t=iu(),r=M4(),i=k4(),s=gA(),o=mA(),a=I4(),l=L4(),c=NA(),u=R4(),h=no(),f=$4(),d=V4(),g=QA(),p=tt(),b=to(),m=H4(),y=hn(),v=W4(),w=ri(),x=Bi(),C=1,P=2,E=4,A="[object Arguments]",O="[object Array]",T="[object Boolean]",L="[object Date]",V="[object Error]",Y="[object Function]",M="[object GeneratorFunction]",I="[object Map]",J="[object Number]",R="[object Object]",F="[object RegExp]",H="[object Set]",ne="[object String]",Pe="[object Symbol]",Yt="[object WeakMap]",N="[object ArrayBuffer]",$="[object DataView]",z="[object Float32Array]",X="[object Float64Array]",re="[object Int8Array]",he="[object Int16Array]",Ce="[object Int32Array]",we="[object Uint8Array]",$e="[object Uint8ClampedArray]",Le="[object Uint16Array]",Tt="[object Uint32Array]",ae={};ae[A]=ae[O]=ae[N]=ae[$]=ae[T]=ae[L]=ae[z]=ae[X]=ae[re]=ae[he]=ae[Ce]=ae[I]=ae[J]=ae[R]=ae[F]=ae[H]=ae[ne]=ae[Pe]=ae[we]=ae[$e]=ae[Le]=ae[Tt]=!0,ae[V]=ae[Y]=ae[Yt]=!1;function dt(de,dn,_n,w0,Ot,Mt){var Je,Un=dn&C,Au=dn&P,gW=dn&E;if(_n&&(Je=Ot?_n(de,w0,Ot,Mt):_n(de)),Je!==void 0)return Je;if(!y(de))return de;var A2=p(de);if(A2){if(Je=f(de),!Un)return o(de,Je)}else{var io=h(de),T2=io==Y||io==M;if(b(de))return s(de,Un);if(io==R||io==A||T2&&!Ot){if(Je=Au||T2?{}:g(de),!Un)return Au?l(de,i(Je,de)):a(de,r(Je,de))}else{if(!ae[io])return Ot?de:{};Je=d(de,io,Un)}}Mt||(Mt=new n);var O2=Mt.get(de);if(O2)return O2;Mt.set(de,Je),v(de)?de.forEach(function(li){Je.add(dt(li,dn,_n,li,de,Mt))}):m(de)&&de.forEach(function(li,qi){Je.set(qi,dt(li,dn,_n,qi,de,Mt))});var pW=gW?Au?u:c:Au?x:w,M2=A2?void 0:pW(de);return e(M2||de,function(li,qi){M2&&(qi=li,li=de[qi]),t(Je,qi,dt(li,dn,_n,qi,de,Mt))}),Je}return nm=dt,nm}var rm,sT;function X4(){if(sT)return rm;sT=1;var n=iT(),e=4;function t(r){return n(r,e)}return rm=t,rm}var im,oT;function sm(){if(oT)return im;oT=1;function n(e){return function(){return e}}return im=n,im}var om,aT;function Y4(){if(aT)return om;aT=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 om=n,om}var am,lT;function lm(){if(lT)return am;lT=1;var n=Y4(),e=n();return am=e,am}var cm,cT;function um(){if(cT)return cm;cT=1;var n=lm(),e=ri();function t(r,i){return r&&n(r,i,e)}return cm=t,cm}var hm,uT;function K4(){if(uT)return hm;uT=1;var n=pr();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 hm=e,hm}var fm,hT;function cu(){if(hT)return fm;hT=1;var n=um(),e=K4(),t=e(n);return fm=t,fm}var dm,fT;function $i(){if(fT)return dm;fT=1;function n(e){return e}return dm=n,dm}var gm,dT;function gT(){if(dT)return gm;dT=1;var n=$i();function e(t){return typeof t=="function"?t:n}return gm=e,gm}var pm,pT;function mT(){if(pT)return pm;pT=1;var n=Hg(),e=cu(),t=gT(),r=tt();function i(s,o){var a=r(s)?n:e;return a(s,t(o))}return pm=i,pm}var mm,yT;function vT(){return yT||(yT=1,mm=mT()),mm}var ym,bT;function J4(){if(bT)return ym;bT=1;var n=cu();function e(t,r){var i=[];return n(t,function(s,o,a){r(s,o,a)&&i.push(s)}),i}return ym=e,ym}var vm,wT;function Q4(){if(wT)return vm;wT=1;var n="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,n),this}return vm=e,vm}var bm,xT;function Z4(){if(xT)return bm;xT=1;function n(e){return this.__data__.has(e)}return bm=n,bm}var wm,CT;function ST(){if(CT)return wm;CT=1;var n=Fg(),e=Q4(),t=Z4();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,wm=r,wm}var xm,PT;function e5(){if(PT)return xm;PT=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 xm=n,xm}var Cm,ET;function AT(){if(ET)return Cm;ET=1;function n(e,t){return e.has(t)}return Cm=n,Cm}var Sm,TT;function OT(){if(TT)return Sm;TT=1;var n=ST(),e=e5(),t=AT(),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(P,E){if(!t(v,E)&&(w===P||u(w,P,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 Sm=s,Sm}var Pm,MT;function t5(){if(MT)return Pm;MT=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i,s){r[++t]=[s,i]}),r}return Pm=n,Pm}var Em,_T;function Am(){if(_T)return Em;_T=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}return Em=n,Em}var Tm,NT;function n5(){if(NT)return Tm;NT=1;var n=eo(),e=FA(),t=Zs(),r=OT(),i=t5(),s=Am(),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,P,E,A,O,T,L){switch(E){case y:if(C.byteLength!=P.byteLength||C.byteOffset!=P.byteOffset)return!1;C=C.buffer,P=P.buffer;case m:return!(C.byteLength!=P.byteLength||!T(new e(C),new e(P)));case l:case c:case f:return t(+C,+P);case u:return C.name==P.name&&C.message==P.message;case d:case p:return C==P+"";case h:var V=i;case g:var Y=A&o;if(V||(V=s),C.size!=P.size&&!Y)return!1;var M=L.get(C);if(M)return M==P;A|=a,L.set(C,P);var I=r(V(C),V(P),A,O,T,L);return L.delete(C),I;case b:if(w)return w.call(C)==w.call(P)}return!1}return Tm=x,Tm}var Om,kT;function r5(){if(kT)return Om;kT=1;var n=NA(),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],P=o[m];if(l)var E=h?l(P,C,m,o,s,u):l(C,P,m,s,o,u);if(!(E===void 0?C===P||c(C,P,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 Om=i,Om}var Mm,IT;function i5(){if(IT)return Mm;IT=1;var n=nu(),e=OT(),t=n5(),r=r5(),i=no(),s=tt(),o=to(),a=Ra(),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),P=x?u:i(p),E=C?u:i(b);P=P==c?h:P,E=E==c?h:E;var A=P==h,O=E==h,T=P==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,P,m,y,v,w);if(!(m&l)){var L=A&&d.call(p,"__wrapped__"),V=O&&d.call(b,"__wrapped__");if(L||V){var Y=L?p.value():p,M=V?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 Mm=g,Mm}var _m,LT;function RT(){if(LT)return _m;LT=1;var n=i5(),e=Gn();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 _m=t,_m}var Nm,jT;function s5(){if(jT)return Nm;jT=1;var n=nu(),e=RT(),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 Nm=i,Nm}var km,DT;function BT(){if(DT)return km;DT=1;var n=hn();function e(t){return t===t&&!n(t)}return km=e,km}var Im,$T;function o5(){if($T)return Im;$T=1;var n=BT(),e=ri();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 Im=t,Im}var Lm,zT;function FT(){if(zT)return Lm;zT=1;function n(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}return Lm=n,Lm}var Rm,qT;function a5(){if(qT)return Rm;qT=1;var n=s5(),e=o5(),t=FT();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 Rm=r,Rm}var jm,VT;function ro(){if(VT)return jm;VT=1;var n=ji(),e=Gn(),t="[object Symbol]";function r(i){return typeof i=="symbol"||e(i)&&n(i)==t}return jm=r,jm}var Dm,GT;function Bm(){if(GT)return Dm;GT=1;var n=tt(),e=ro(),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 Dm=i,Dm}var $m,HT;function l5(){if(HT)return $m;HT=1;var n=Fg(),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,$m=t,$m}var zm,UT;function c5(){if(UT)return zm;UT=1;var n=l5(),e=500;function t(r){var i=n(r,function(o){return s.size===e&&s.clear(),o}),s=i.cache;return i}return zm=t,zm}var Fm,WT;function u5(){if(WT)return Fm;WT=1;var n=c5(),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 Fm=r,Fm}var qm,XT;function uu(){if(XT)return qm;XT=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 qm=n,qm}var Vm,YT;function h5(){if(YT)return Vm;YT=1;var n=eo(),e=uu(),t=tt(),r=ro(),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 Vm=a,Vm}var Gm,KT;function JT(){if(KT)return Gm;KT=1;var n=h5();function e(t){return t==null?"":n(t)}return Gm=e,Gm}var Hm,QT;function hu(){if(QT)return Hm;QT=1;var n=tt(),e=Bm(),t=u5(),r=JT();function i(s,o){return n(s)?s:e(s,o)?[s]:t(r(s))}return Hm=i,Hm}var Um,ZT;function Da(){if(ZT)return Um;ZT=1;var n=ro(),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 Um=t,Um}var Wm,eO;function fu(){if(eO)return Wm;eO=1;var n=hu(),e=Da();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 Wm=t,Wm}var Xm,tO;function f5(){if(tO)return Xm;tO=1;var n=fu();function e(t,r,i){var s=t==null?void 0:n(t,r);return s===void 0?i:s}return Xm=e,Xm}var Ym,nO;function d5(){if(nO)return Ym;nO=1;function n(e,t){return e!=null&&t in Object(e)}return Ym=n,Ym}var Km,rO;function iO(){if(rO)return Km;rO=1;var n=hu(),e=ka(),t=tt(),r=su(),i=ip(),s=Da();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 Km=o,Km}var Jm,sO;function oO(){if(sO)return Jm;sO=1;var n=d5(),e=iO();function t(r,i){return r!=null&&e(r,i,n)}return Jm=t,Jm}var Qm,aO;function g5(){if(aO)return Qm;aO=1;var n=RT(),e=f5(),t=oO(),r=Bm(),i=BT(),s=FT(),o=Da(),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 Qm=c,Qm}var Zm,lO;function cO(){if(lO)return Zm;lO=1;function n(e){return function(t){return t==null?void 0:t[e]}}return Zm=n,Zm}var ey,uO;function p5(){if(uO)return ey;uO=1;var n=fu();function e(t){return function(r){return n(r,t)}}return ey=e,ey}var ty,hO;function m5(){if(hO)return ty;hO=1;var n=cO(),e=p5(),t=Bm(),r=Da();function i(s){return t(s)?n(r(s)):e(s)}return ty=i,ty}var ny,fO;function mr(){if(fO)return ny;fO=1;var n=a5(),e=g5(),t=$i(),r=tt(),i=m5();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 ny=s,ny}var ry,dO;function gO(){if(dO)return ry;dO=1;var n=vA(),e=J4(),t=mr(),r=tt();function i(s,o){var a=r(s)?n:e;return a(s,t(o,3))}return ry=i,ry}var iy,pO;function y5(){if(pO)return iy;pO=1;var n=Object.prototype,e=n.hasOwnProperty;function t(r,i){return r!=null&&e.call(r,i)}return iy=t,iy}var sy,mO;function yO(){if(mO)return sy;mO=1;var n=y5(),e=iO();function t(r,i){return r!=null&&e(r,i,n)}return sy=t,sy}var oy,vO;function v5(){if(vO)return oy;vO=1;var n=gp(),e=no(),t=ka(),r=tt(),i=pr(),s=to(),o=au(),a=Ra(),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 oy=f,oy}var ay,bO;function wO(){if(bO)return ay;bO=1;function n(e){return e===void 0}return ay=n,ay}var ly,xO;function CO(){if(xO)return ly;xO=1;var n=cu(),e=pr();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 ly=t,ly}var cy,SO;function PO(){if(SO)return cy;SO=1;var n=uu(),e=mr(),t=CO(),r=tt();function i(s,o){var a=r(s)?n:t;return a(s,e(o,3))}return cy=i,cy}var uy,EO;function b5(){if(EO)return uy;EO=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 uy=n,uy}var hy,AO;function w5(){if(AO)return hy;AO=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 hy=n,hy}var fy,TO;function OO(){if(TO)return fy;TO=1;var n=b5(),e=cu(),t=mr(),r=w5(),i=tt();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 fy=s,fy}var dy,MO;function x5(){if(MO)return dy;MO=1;var n=ji(),e=tt(),t=Gn(),r="[object String]";function i(s){return typeof s=="string"||!e(s)&&t(s)&&n(s)==r}return dy=i,dy}var gy,_O;function C5(){if(_O)return gy;_O=1;var n=cO(),e=n("length");return gy=e,gy}var py,NO;function S5(){if(NO)return py;NO=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 py=l,py}var my,kO;function P5(){if(kO)return my;kO=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 my=w,my}var yy,IO;function E5(){if(IO)return yy;IO=1;var n=C5(),e=S5(),t=P5();function r(i){return e(i)?t(i):n(i)}return yy=r,yy}var vy,LO;function A5(){if(LO)return vy;LO=1;var n=gp(),e=no(),t=pr(),r=x5(),i=E5(),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 vy=a,vy}var by,RO;function T5(){if(RO)return by;RO=1;var n=Hg(),e=KA(),t=um(),r=mr(),i=lu(),s=tt(),o=to(),a=_a(),l=hn(),c=Ra();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 by=u,by}var wy,jO;function O5(){if(jO)return wy;jO=1;var n=eo(),e=ka(),t=tt(),r=n?n.isConcatSpreadable:void 0;function i(s){return t(s)||e(s)||!!(r&&s&&s[r])}return wy=i,wy}var xy,DO;function Cy(){if(DO)return xy;DO=1;var n=Mp(),e=O5();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 xy=t,xy}var Sy,BO;function M5(){if(BO)return Sy;BO=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 Sy=n,Sy}var Py,$O;function zO(){if($O)return Py;$O=1;var n=M5(),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 Py=t,Py}var Ey,FO;function _5(){if(FO)return Ey;FO=1;var n=sm(),e=jE(),t=$i(),r=e?function(i,s){return e(i,"toString",{configurable:!0,enumerable:!1,value:n(s),writable:!0})}:t;return Ey=r,Ey}var Ay,qO;function N5(){if(qO)return Ay;qO=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 Ay=r,Ay}var Ty,VO;function GO(){if(VO)return Ty;VO=1;var n=_5(),e=N5(),t=e(n);return Ty=t,Ty}var Oy,HO;function du(){if(HO)return Oy;HO=1;var n=$i(),e=zO(),t=GO();function r(i,s){return t(e(i,s,n),i+"")}return Oy=r,Oy}var My,UO;function WO(){if(UO)return My;UO=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 My=n,My}var _y,XO;function k5(){if(XO)return _y;XO=1;function n(e){return e!==e}return _y=n,_y}var Ny,YO;function I5(){if(YO)return Ny;YO=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 Ny=n,Ny}var ky,KO;function L5(){if(KO)return ky;KO=1;var n=WO(),e=k5(),t=I5();function r(i,s,o){return s===s?t(i,s,o):n(i,e,o)}return ky=r,ky}var Iy,JO;function R5(){if(JO)return Iy;JO=1;var n=L5();function e(t,r){var i=t==null?0:t.length;return!!i&&n(t,r,0)>-1}return Iy=e,Iy}var Ly,QO;function j5(){if(QO)return Ly;QO=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 Ly=n,Ly}var Ry,ZO;function D5(){if(ZO)return Ry;ZO=1;function n(){}return Ry=n,Ry}var jy,eM;function B5(){if(eM)return jy;eM=1;var n=jA(),e=D5(),t=Am(),r=1/0,i=n&&1/t(new n([,-0]))[1]==r?function(s){return new n(s)}:e;return jy=i,jy}var Dy,tM;function $5(){if(tM)return Dy;tM=1;var n=ST(),e=R5(),t=j5(),r=AT(),i=B5(),s=Am(),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 Dy=a,Dy}var By,nM;function rM(){if(nM)return By;nM=1;var n=pr(),e=Gn();function t(r){return e(r)&&n(r)}return By=t,By}var $y,iM;function z5(){if(iM)return $y;iM=1;var n=Cy(),e=du(),t=$5(),r=rM(),i=e(function(s){return t(n(s,1,r,!0))});return $y=i,$y}var zy,sM;function F5(){if(sM)return zy;sM=1;var n=uu();function e(t,r){return n(r,function(i){return t[i]})}return zy=e,zy}var Fy,oM;function aM(){if(oM)return Fy;oM=1;var n=F5(),e=ri();function t(r){return r==null?[]:n(r,e(r))}return Fy=t,Fy}var qy,lM;function fn(){if(lM)return qy;lM=1;var n;if(typeof Jd=="function")try{n={clone:X4(),constant:sm(),each:vT(),filter:gO(),has:yO(),isArray:tt(),isEmpty:v5(),isFunction:_a(),isUndefined:wO(),keys:ri(),map:PO(),reduce:OO(),size:A5(),transform:T5(),union:z5(),values:aM()}}catch(e){}return n||(n=window._),qy=n,qy}var Vy,cM;function Gy(){if(cM)return Vy;cM=1;var n=fn();Vy=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 Vy}var Hy,uM;function q5(){return uM||(uM=1,Hy="2.1.8"),Hy}var Uy,hM;function V5(){return hM||(hM=1,Uy={Graph:Gy(),version:q5()}),Uy}var Wy,fM;function G5(){if(fM)return Wy;fM=1;var n=fn(),e=Gy();Wy={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 Wy}var Xy,dM;function H5(){if(dM)return Xy;dM=1;var n=fn();Xy=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 Xy}var Yy,gM;function pM(){if(gM)return Yy;gM=1;var n=fn();Yy=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},Yy}var Ky,mM;function yM(){if(mM)return Ky;mM=1;var n=fn(),e=pM();Ky=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 Ky}var Jy,vM;function U5(){if(vM)return Jy;vM=1;var n=yM(),e=fn();Jy=t;function t(r,i,s){return e.transform(r.nodes(),function(o,a){o[a]=n(r,a,i,s)},{})}return Jy}var Qy,bM;function wM(){if(bM)return Qy;bM=1;var n=fn();Qy=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 Qy}var Zy,xM;function W5(){if(xM)return Zy;xM=1;var n=fn(),e=wM();Zy=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 Zy}var ev,CM;function X5(){if(CM)return ev;CM=1;var n=fn();ev=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 ev}var tv,SM;function PM(){if(SM)return tv;SM=1;var n=fn();tv=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,tv}var nv,EM;function Y5(){if(EM)return nv;EM=1;var n=PM();nv=e;function e(t){try{n(t)}catch(r){if(r instanceof n.CycleException)return!1;throw r}return!0}return nv}var rv,AM;function TM(){if(AM)return rv;AM=1;var n=fn();rv=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 rv}var iv,OM;function K5(){if(OM)return iv;OM=1;var n=TM();iv=e;function e(t,r){return n(t,r,"post")}return iv}var sv,MM;function J5(){if(MM)return sv;MM=1;var n=TM();sv=e;function e(t,r){return n(t,r,"pre")}return sv}var ov,_M;function Q5(){if(_M)return ov;_M=1;var n=fn(),e=Gy(),t=pM();ov=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 ov}var av,NM;function Z5(){return NM||(NM=1,av={components:H5(),dijkstra:yM(),dijkstraAll:U5(),findCycles:W5(),floydWarshall:X5(),isAcyclic:Y5(),postorder:K5(),preorder:J5(),prim:Q5(),tarjan:wM(),topsort:PM()}),av}var lv,kM;function eG(){if(kM)return lv;kM=1;var n=V5();return lv={Graph:n.Graph,json:G5(),alg:Z5(),version:n.version},lv}var gu;if(typeof Jd=="function")try{gu=eG()}catch(n){}gu||(gu=window.graphlib);var On=gu,cv,IM;function tG(){if(IM)return cv;IM=1;var n=iT(),e=1,t=4;function r(i){return n(i,e|t)}return cv=r,cv}var uv,LM;function pu(){if(LM)return uv;LM=1;var n=Zs(),e=pr(),t=su(),r=hn();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 uv=i,uv}var hv,RM;function nG(){if(RM)return hv;RM=1;var n=du(),e=Zs(),t=pu(),r=Bi(),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 hv=o,hv}var fv,jM;function rG(){if(jM)return fv;jM=1;var n=mr(),e=pr(),t=ri();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 fv=r,fv}var dv,DM;function iG(){if(DM)return dv;DM=1;var n=/\s/;function e(t){for(var r=t.length;r--&&n.test(t.charAt(r)););return r}return dv=e,dv}var gv,BM;function sG(){if(BM)return gv;BM=1;var n=iG(),e=/^\s+/;function t(r){return r&&r.slice(0,n(r)+1).replace(e,"")}return gv=t,gv}var pv,$M;function oG(){if($M)return pv;$M=1;var n=sG(),e=hn(),t=ro(),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 pv=l,pv}var mv,zM;function FM(){if(zM)return mv;zM=1;var n=oG(),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 mv=r,mv}var yv,qM;function aG(){if(qM)return yv;qM=1;var n=FM();function e(t){var r=n(t),i=r%1;return r===r?i?r-i:r:0}return yv=e,yv}var vv,VM;function lG(){if(VM)return vv;VM=1;var n=WO(),e=mr(),t=aG(),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 vv=i,vv}var bv,GM;function cG(){if(GM)return bv;GM=1;var n=rG(),e=lG(),t=n(e);return bv=t,bv}var wv,HM;function UM(){if(HM)return wv;HM=1;var n=Cy();function e(t){var r=t==null?0:t.length;return r?n(t,1):[]}return wv=e,wv}var xv,WM;function uG(){if(WM)return xv;WM=1;var n=lm(),e=gT(),t=Bi();function r(i,s){return i==null?i:n(i,e(s),t)}return xv=r,xv}var Cv,XM;function hG(){if(XM)return Cv;XM=1;function n(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return Cv=n,Cv}var Sv,YM;function fG(){if(YM)return Sv;YM=1;var n=ru(),e=um(),t=mr();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 Sv=r,Sv}var Pv,KM;function Ev(){if(KM)return Pv;KM=1;var n=ro();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 Pv=e,Pv}var Av,JM;function dG(){if(JM)return Av;JM=1;function n(e,t){return e>t}return Av=n,Av}var Tv,QM;function gG(){if(QM)return Tv;QM=1;var n=Ev(),e=dG(),t=$i();function r(i){return i&&i.length?n(i,t,e):void 0}return Tv=r,Tv}var Ov,ZM;function e_(){if(ZM)return Ov;ZM=1;var n=ru(),e=Zs();function t(r,i,s){(s!==void 0&&!e(r[i],s)||s===void 0&&!(i in r))&&n(r,i,s)}return Ov=t,Ov}var Mv,t_;function pG(){if(t_)return Mv;t_=1;var n=ji(),e=lu(),t=Gn(),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 Mv=c,Mv}var _v,n_;function r_(){if(n_)return _v;n_=1;function n(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return _v=n,_v}var Nv,i_;function mG(){if(i_)return Nv;i_=1;var n=Na(),e=Bi();function t(r){return n(r,e(r))}return Nv=t,Nv}var kv,s_;function yG(){if(s_)return kv;s_=1;var n=e_(),e=gA(),t=WA(),r=mA(),i=QA(),s=ka(),o=tt(),a=rM(),l=to(),c=_a(),u=hn(),h=pG(),f=Ra(),d=r_(),g=mG();function p(b,m,y,v,w,x,C){var P=d(b,y),E=d(m,y),A=C.get(E);if(A){n(b,y,A);return}var O=x?x(P,E,y+"",b,m,C):void 0,T=O===void 0;if(T){var L=o(E),V=!L&&l(E),Y=!L&&!V&&f(E);O=E,L||V||Y?o(P)?O=P:a(P)?O=r(P):V?(T=!1,O=e(E,!0)):Y?(T=!1,O=t(E,!0)):O=[]:h(E)||s(E)?(O=P,s(P)?O=g(P):(!u(P)||c(P))&&(O=i(E))):T=!1}T&&(C.set(E,O),w(O,E,v,x,C),C.delete(E)),n(b,y,O)}return kv=p,kv}var Iv,o_;function vG(){if(o_)return Iv;o_=1;var n=nu(),e=e_(),t=lm(),r=yG(),i=hn(),s=Bi(),o=r_();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 Iv=a,Iv}var Lv,a_;function bG(){if(a_)return Lv;a_=1;var n=du(),e=pu();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 Lv=t,Lv}var Rv,l_;function wG(){if(l_)return Rv;l_=1;var n=vG(),e=bG(),t=e(function(r,i,s){n(r,i,s)});return Rv=t,Rv}var jv,c_;function u_(){if(c_)return jv;c_=1;function n(e,t){return e<t}return jv=n,jv}var Dv,h_;function xG(){if(h_)return Dv;h_=1;var n=Ev(),e=u_(),t=$i();function r(i){return i&&i.length?n(i,t,e):void 0}return Dv=r,Dv}var Bv,f_;function CG(){if(f_)return Bv;f_=1;var n=Ev(),e=mr(),t=u_();function r(i,s){return i&&i.length?n(i,e(s,2),t):void 0}return Bv=r,Bv}var $v,d_;function SG(){if(d_)return $v;d_=1;var n=Tn(),e=function(){return n.Date.now()};return $v=e,$v}var zv,g_;function PG(){if(g_)return zv;g_=1;var n=iu(),e=hu(),t=su(),r=hn(),i=Da();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 zv=s,zv}var Fv,p_;function EG(){if(p_)return Fv;p_=1;var n=fu(),e=PG(),t=hu();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 Fv=r,Fv}var qv,m_;function AG(){if(m_)return qv;m_=1;var n=EG(),e=oO();function t(r,i){return n(r,i,function(s,o){return e(r,o)})}return qv=t,qv}var Vv,y_;function TG(){if(y_)return Vv;y_=1;var n=UM(),e=zO(),t=GO();function r(i){return t(e(i,void 0,n),i+"")}return Vv=r,Vv}var Gv,v_;function OG(){if(v_)return Gv;v_=1;var n=AG(),e=TG(),t=e(function(r,i){return r==null?{}:n(r,i)});return Gv=t,Gv}var Hv,b_;function MG(){if(b_)return Hv;b_=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 Hv=t,Hv}var Uv,w_;function _G(){if(w_)return Uv;w_=1;var n=MG(),e=pu(),t=FM();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 Uv=r,Uv}var Wv,x_;function NG(){if(x_)return Wv;x_=1;var n=_G(),e=n();return Wv=e,Wv}var Xv,C_;function kG(){if(C_)return Xv;C_=1;function n(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}return Xv=n,Xv}var Yv,S_;function IG(){if(S_)return Yv;S_=1;var n=ro();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 Yv=e,Yv}var Kv,P_;function LG(){if(P_)return Kv;P_=1;var n=IG();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 Kv=e,Kv}var Jv,E_;function RG(){if(E_)return Jv;E_=1;var n=uu(),e=fu(),t=mr(),r=CO(),i=kG(),s=ou(),o=LG(),a=$i(),l=tt();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 Jv=c,Jv}var Qv,A_;function jG(){if(A_)return Qv;A_=1;var n=Cy(),e=RG(),t=du(),r=pu(),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 Qv=i,Qv}var Zv,T_;function DG(){if(T_)return Zv;T_=1;var n=JT(),e=0;function t(r){var i=++e;return n(r)+i}return Zv=t,Zv}var e0,O_;function BG(){if(O_)return e0;O_=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 e0=n,e0}var t0,M_;function $G(){if(M_)return t0;M_=1;var n=iu(),e=BG();function t(r,i){return e(r||[],i||[],n)}return t0=t,t0}var mu;if(typeof Jd=="function")try{mu={cloneDeep:tG(),constant:sm(),defaults:nG(),each:vT(),filter:gO(),find:cG(),flatten:UM(),forEach:mT(),forIn:uG(),has:yO(),isUndefined:wO(),last:hG(),map:PO(),mapValues:fG(),max:gG(),merge:wG(),min:xG(),minBy:CG(),now:SG(),pick:OG(),range:NG(),reduce:OO(),sortBy:jG(),uniqueId:DG(),values:aM(),zipObject:$G()}}catch(n){}mu||(mu=window._);var Ie=mu,zG=yu;function yu(){var n={};n._next=n._prev=n,this._sentinel=n}yu.prototype.dequeue=function(){var n=this._sentinel,e=n._prev;if(e!==n)return __(e),e},yu.prototype.enqueue=function(n){var e=this._sentinel;n._prev&&n._next&&__(n),n._next=e._next,e._next._prev=n,e._next=n,n._prev=e},yu.prototype.toString=function(){for(var n=[],e=this._sentinel,t=e._prev;t!==e;)n.push(JSON.stringify(t,FG)),t=t._prev;return"["+n.join(", ")+"]"};function __(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function FG(n,e){if(n!=="_next"&&n!=="_prev")return e}var yr=Ie,qG=On.Graph,VG=zG,GG=UG,HG=yr.constant(1);function UG(n,e){if(n.nodeCount()<=1)return[];var t=XG(n,e||HG),r=WG(t.graph,t.buckets,t.zeroIdx);return yr.flatten(yr.map(r,function(i){return n.outEdges(i.v,i.w)}),!0)}function WG(n,e,t){for(var r=[],i=e[e.length-1],s=e[0],o;n.nodeCount();){for(;o=s.dequeue();)n0(n,e,t,o);for(;o=i.dequeue();)n0(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(n0(n,e,t,o,!0));break}}}return r}function n0(n,e,t,r,i){var s=i?[]:void 0;return yr.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,r0(e,t,l)}),yr.forEach(n.outEdges(r.v),function(o){var a=n.edge(o),l=o.w,c=n.node(l);c.in-=a,r0(e,t,c)}),n.removeNode(r.v),s}function XG(n,e){var t=new qG,r=0,i=0;yr.forEach(n.nodes(),function(a){t.setNode(a,{v:a,in:0,out:0})}),yr.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=yr.range(i+r+3).map(function(){return new VG}),o=r+1;return yr.forEach(t.nodes(),function(a){r0(s,o,t.node(a))}),{graph:t,buckets:s,zeroIdx:o}}function r0(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 zi=Ie,YG=GG,KG={run:JG,undo:ZG};function JG(n){var e=n.graph().acyclicer==="greedy"?YG(n,t(n)):QG(n);zi.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,zi.uniqueId("rev"))});function t(r){return function(i){return r.edge(i).weight}}}function QG(n){var e=[],t={},r={};function i(s){zi.has(r,s)||(r[s]=!0,t[s]=!0,zi.forEach(n.outEdges(s),function(o){zi.has(t,o.w)?e.push(o):i(o.w)}),delete t[s])}return zi.forEach(n.nodes(),i),e}function ZG(n){zi.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 ye=Ie,N_=On.Graph,zt={addDummyNode:k_,simplify:eH,asNonCompoundGraph:tH,successorWeights:nH,predecessorWeights:rH,intersectRect:iH,buildLayerMatrix:sH,normalizeRanks:oH,removeEmptyRanks:aH,addBorderNode:lH,maxRank:I_,partition:cH,time:uH,notime:hH};function k_(n,e,t,r){var i;do i=ye.uniqueId(r);while(n.hasNode(i));return t.dummy=e,n.setNode(i,t),i}function eH(n){var e=new N_().setGraph(n.graph());return ye.forEach(n.nodes(),function(t){e.setNode(t,n.node(t))}),ye.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 tH(n){var e=new N_({multigraph:n.isMultigraph()}).setGraph(n.graph());return ye.forEach(n.nodes(),function(t){n.children(t).length||e.setNode(t,n.node(t))}),ye.forEach(n.edges(),function(t){e.setEdge(t,n.edge(t))}),e}function nH(n){var e=ye.map(n.nodes(),function(t){var r={};return ye.forEach(n.outEdges(t),function(i){r[i.w]=(r[i.w]||0)+n.edge(i).weight}),r});return ye.zipObject(n.nodes(),e)}function rH(n){var e=ye.map(n.nodes(),function(t){var r={};return ye.forEach(n.inEdges(t),function(i){r[i.v]=(r[i.v]||0)+n.edge(i).weight}),r});return ye.zipObject(n.nodes(),e)}function iH(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 sH(n){var e=ye.map(ye.range(I_(n)+1),function(){return[]});return ye.forEach(n.nodes(),function(t){var r=n.node(t),i=r.rank;ye.isUndefined(i)||(e[i][r.order]=t)}),e}function oH(n){var e=ye.min(ye.map(n.nodes(),function(t){return n.node(t).rank}));ye.forEach(n.nodes(),function(t){var r=n.node(t);ye.has(r,"rank")&&(r.rank-=e)})}function aH(n){var e=ye.min(ye.map(n.nodes(),function(s){return n.node(s).rank})),t=[];ye.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;ye.forEach(t,function(s,o){ye.isUndefined(s)&&o%i!==0?--r:r&&ye.forEach(s,function(a){n.node(a).rank+=r})})}function lH(n,e,t,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=t,i.order=r),k_(n,"border",i,e)}function I_(n){return ye.max(ye.map(n.nodes(),function(e){var t=n.node(e).rank;if(!ye.isUndefined(t))return t}))}function cH(n,e){var t={lhs:[],rhs:[]};return ye.forEach(n,function(r){e(r)?t.lhs.push(r):t.rhs.push(r)}),t}function uH(n,e){var t=ye.now();try{return e()}finally{console.log(n+" time: "+(ye.now()-t)+"ms")}}function hH(n,e){return e()}var L_=Ie,fH=zt,dH={run:gH,undo:mH};function gH(n){n.graph().dummyChains=[],L_.forEach(n.edges(),function(e){pH(n,e)})}function pH(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=fH.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 mH(n){L_.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 vu=Ie,bu={longestPath:yH,slack:vH};function yH(n){var e={};function t(r){var i=n.node(r);if(vu.has(e,r))return i.rank;e[r]=!0;var s=vu.min(vu.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}vu.forEach(n.sources(),t)}function vH(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen}var wu=Ie,bH=On.Graph,xu=bu.slack,R_=wH;function wH(n){var e=new bH({directed:!1}),t=n.nodes()[0],r=n.nodeCount();e.setNode(t,{});for(var i,s;xH(e,n)<r;)i=CH(e,n),s=e.hasNode(i.v)?xu(n,i):-xu(n,i),SH(e,n,s);return e}function xH(n,e){function t(r){wu.forEach(e.nodeEdges(r),function(i){var s=i.v,o=r===s?i.w:s;!n.hasNode(o)&&!xu(e,i)&&(n.setNode(o,{}),n.setEdge(r,o,{}),t(o))})}return wu.forEach(n.nodes(),t),n.nodeCount()}function CH(n,e){return wu.minBy(e.edges(),function(t){if(n.hasNode(t.v)!==n.hasNode(t.w))return xu(e,t)})}function SH(n,e,t){wu.forEach(n.nodes(),function(r){e.node(r).rank+=t})}var vr=Ie,PH=R_,EH=bu.slack,AH=bu.longestPath,TH=On.alg.preorder,OH=On.alg.postorder,MH=zt.simplify,_H=Fi;Fi.initLowLimValues=s0,Fi.initCutValues=i0,Fi.calcCutValue=j_,Fi.leaveEdge=B_,Fi.enterEdge=$_,Fi.exchangeEdges=z_;function Fi(n){n=MH(n),AH(n);var e=PH(n);s0(e),i0(e,n);for(var t,r;t=B_(e);)r=$_(e,n,t),z_(e,n,t,r)}function i0(n,e){var t=OH(n,n.nodes());t=t.slice(0,t.length-1),vr.forEach(t,function(r){NH(n,e,r)})}function NH(n,e,t){var r=n.node(t),i=r.parent;n.edge(t,i).cutvalue=j_(n,e,t)}function j_(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,vr.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,IH(n,t,u)){var d=n.edge(t,u).cutvalue;a+=h?-d:d}}}),a}function s0(n,e){arguments.length<2&&(e=n.nodes()[0]),D_(n,{},1,e)}function D_(n,e,t,r,i){var s=t,o=n.node(r);return e[r]=!0,vr.forEach(n.neighbors(r),function(a){vr.has(e,a)||(t=D_(n,e,t,a,r))}),o.low=s,o.lim=t++,i?o.parent=i:delete o.parent,t}function B_(n){return vr.find(n.edges(),function(e){return n.edge(e).cutvalue<0})}function $_(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=vr.filter(e.edges(),function(u){return l===F_(n,n.node(u.v),a)&&l!==F_(n,n.node(u.w),a)});return vr.minBy(c,function(u){return EH(e,u)})}function z_(n,e,t,r){var i=t.v,s=t.w;n.removeEdge(i,s),n.setEdge(r.v,r.w,{}),s0(n),i0(n,e),kH(n,e)}function kH(n,e){var t=vr.find(n.nodes(),function(i){return!e.node(i).parent}),r=TH(n,t);r=r.slice(1),vr.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 IH(n,e,t){return n.hasEdge(e,t)}function F_(n,e,t){return t.low<=e.lim&&e.lim<=t.lim}var LH=bu,q_=LH.longestPath,RH=R_,jH=_H,DH=BH;function BH(n){switch(n.graph().ranker){case"network-simplex":V_(n);break;case"tight-tree":zH(n);break;case"longest-path":$H(n);break;default:V_(n)}}var $H=q_;function zH(n){q_(n),RH(n)}function V_(n){jH(n)}var o0=Ie,FH=qH;function qH(n){var e=GH(n);o0.forEach(n.graph().dummyChains,function(t){for(var r=n.node(t),i=r.edgeObj,s=VH(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 VH(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 GH(n){var e={},t=0;function r(i){var s=t;o0.forEach(n.children(i),r),e[i]={low:s,lim:t++}}return o0.forEach(n.children(),r),e}var br=Ie,a0=zt,HH={run:UH,cleanup:YH};function UH(n){var e=a0.addDummyNode(n,"root",{},"_root"),t=WH(n),r=br.max(br.values(t))-1,i=2*r+1;n.graph().nestingRoot=e,br.forEach(n.edges(),function(o){n.edge(o).minlen*=i});var s=XH(n)+1;br.forEach(n.children(),function(o){G_(n,e,i,s,r,t,o)}),n.graph().nodeRankFactor=i}function G_(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=a0.addBorderNode(n,"_bt"),c=a0.addBorderNode(n,"_bb"),u=n.node(o);n.setParent(l,o),u.borderTop=l,n.setParent(c,o),u.borderBottom=c,br.forEach(a,function(h){G_(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 WH(n){var e={};function t(r,i){var s=n.children(r);s&&s.length&&br.forEach(s,function(o){t(o,i+1)}),e[r]=i}return br.forEach(n.children(),function(r){t(r,1)}),e}function XH(n){return br.reduce(n.edges(),function(e,t){return e+n.edge(t).weight},0)}function YH(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,br.forEach(n.edges(),function(t){var r=n.edge(t);r.nestingEdge&&n.removeEdge(t)})}var l0=Ie,KH=zt,JH=QH;function QH(n){function e(t){var r=n.children(t),i=n.node(t);if(r.length&&l0.forEach(r,e),l0.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var s=i.minRank,o=i.maxRank+1;s<o;++s)H_(n,"borderLeft","_bl",t,i,s),H_(n,"borderRight","_br",t,i,s)}}l0.forEach(n.children(),e)}function H_(n,e,t,r,i,s){var o={width:0,height:0,rank:s,borderType:e},a=i[e][s-1],l=KH.addDummyNode(n,"border",o,t);i[e][s]=l,n.setParent(l,r),a&&n.setEdge(a,l,{weight:1})}var Hn=Ie,ZH={adjust:e8,undo:t8};function e8(n){var e=n.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&U_(n)}function t8(n){var e=n.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&n8(n),(e==="lr"||e==="rl")&&(r8(n),U_(n))}function U_(n){Hn.forEach(n.nodes(),function(e){W_(n.node(e))}),Hn.forEach(n.edges(),function(e){W_(n.edge(e))})}function W_(n){var e=n.width;n.width=n.height,n.height=e}function n8(n){Hn.forEach(n.nodes(),function(e){c0(n.node(e))}),Hn.forEach(n.edges(),function(e){var t=n.edge(e);Hn.forEach(t.points,c0),Hn.has(t,"y")&&c0(t)})}function c0(n){n.y=-n.y}function r8(n){Hn.forEach(n.nodes(),function(e){u0(n.node(e))}),Hn.forEach(n.edges(),function(e){var t=n.edge(e);Hn.forEach(t.points,u0),Hn.has(t,"x")&&u0(t)})}function u0(n){var e=n.x;n.x=n.y,n.y=e}var wr=Ie,i8=s8;function s8(n){var e={},t=wr.filter(n.nodes(),function(a){return!n.children(a).length}),r=wr.max(wr.map(t,function(a){return n.node(a).rank})),i=wr.map(wr.range(r+1),function(){return[]});function s(a){if(!wr.has(e,a)){e[a]=!0;var l=n.node(a);i[l.rank].push(a),wr.forEach(n.successors(a),s)}}var o=wr.sortBy(t,function(a){return n.node(a).rank});return wr.forEach(o,s),i}var ii=Ie,o8=a8;function a8(n,e){for(var t=0,r=1;r<e.length;++r)t+=l8(n,e[r-1],e[r]);return t}function l8(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 X_=Ie,c8=u8;function u8(n,e){return X_.map(e,function(t){var r=n.inEdges(t);if(r.length){var i=X_.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 Xt=Ie,h8=f8;function f8(n,e){var t={};Xt.forEach(n,function(i,s){var o=t[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:s};Xt.isUndefined(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),Xt.forEach(e.edges(),function(i){var s=t[i.v],o=t[i.w];!Xt.isUndefined(s)&&!Xt.isUndefined(o)&&(o.indegree++,s.out.push(t[i.w]))});var r=Xt.filter(t,function(i){return!i.indegree});return d8(r)}function d8(n){var e=[];function t(s){return function(o){o.merged||(Xt.isUndefined(o.barycenter)||Xt.isUndefined(s.barycenter)||o.barycenter>=s.barycenter)&&g8(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),Xt.forEach(i.in.reverse(),t(i)),Xt.forEach(i.out,r(i))}return Xt.map(Xt.filter(e,function(s){return!s.merged}),function(s){return Xt.pick(s,["vs","i","barycenter","weight"])})}function g8(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 Ba=Ie,p8=zt,m8=y8;function y8(n,e){var t=p8.partition(n,function(u){return Ba.has(u,"barycenter")}),r=t.lhs,i=Ba.sortBy(t.rhs,function(u){return-u.i}),s=[],o=0,a=0,l=0;r.sort(v8(!!e)),l=Y_(s,i,l),Ba.forEach(r,function(u){l+=u.vs.length,s.push(u.vs),o+=u.barycenter*u.weight,a+=u.weight,l=Y_(s,i,l)});var c={vs:Ba.flatten(s,!0)};return a&&(c.barycenter=o/a,c.weight=a),c}function Y_(n,e,t){for(var r;e.length&&(r=Ba.last(e)).i<=t;)e.pop(),n.push(r.vs),t++;return t}function v8(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=Ie,b8=c8,w8=h8,x8=m8,C8=K_;function K_(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=b8(n,i);si.forEach(c,function(g){if(n.children(g.v).length){var p=K_(n,g.v,t,r);l[g.v]=p,si.has(p,"barycenter")&&P8(g,p)}});var u=w8(c,t);S8(u,l);var h=x8(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 S8(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 P8(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 $a=Ie,E8=On.Graph,A8=T8;function T8(n,e,t){var r=O8(n),i=new E8({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(s){return n.node(s)});return $a.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),$a.forEach(n[t](s),function(l){var c=l.v===s?l.w:l.v,u=i.edge(c,s),h=$a.isUndefined(u)?0:u.weight;i.setEdge(c,s,{weight:n.edge(l).weight+h})}),$a.has(o,"minRank")&&i.setNode(s,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),i}function O8(n){for(var e;n.hasNode(e=$a.uniqueId("_root")););return e}var M8=Ie,_8=N8;function N8(n,e,t){var r={},i;M8.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=Ie,k8=i8,I8=o8,L8=C8,R8=A8,j8=_8,D8=On.Graph,J_=zt,B8=$8;function $8(n){var e=J_.maxRank(n),t=Q_(n,oi.range(1,e+1),"inEdges"),r=Q_(n,oi.range(e-1,-1,-1),"outEdges"),i=k8(n);Z_(n,i);for(var s=Number.POSITIVE_INFINITY,o,a=0,l=0;l<4;++a,++l){z8(a%2?t:r,a%4>=2),i=J_.buildLayerMatrix(n);var c=I8(n,i);c<s&&(l=0,o=oi.cloneDeep(i),s=c)}Z_(n,o)}function Q_(n,e,t){return oi.map(e,function(r){return R8(n,r,t)})}function z8(n,e){var t=new D8;oi.forEach(n,function(r){var i=r.graph().root,s=L8(r,i,t,e);oi.forEach(s.vs,function(o,a){r.node(o).order=a}),j8(r,t,s.vs)})}function Z_(n,e){oi.forEach(e,function(t){oi.forEach(t,function(r,i){n.node(r).order=i})})}var oe=Ie,F8=On.Graph,q8=zt,V8={positionX:U8,findType1Conflicts:e2,findType2Conflicts:t2,addConflict:h0,hasConflict:n2,verticalAlignment:r2,horizontalCompaction:i2,alignCoordinates:o2,findSmallestWidthAlignment:s2,balance:a2};function e2(n,e){var t={};function r(i,s){var o=0,a=0,l=i.length,c=oe.last(s);return oe.forEach(s,function(u,h){var f=G8(n,u),d=f?n.node(f).order:l;(f||u===c)&&(oe.forEach(s.slice(a,h+1),function(g){oe.forEach(n.predecessors(g),function(p){var b=n.node(p),m=b.order;(m<o||d<m)&&!(b.dummy&&n.node(g).dummy)&&h0(t,p,g)})}),a=h+1,o=d)}),s}return oe.reduce(e,r),t}function t2(n,e){var t={};function r(s,o,a,l,c){var u;oe.forEach(oe.range(o,a),function(h){u=s[h],n.node(u).dummy&&oe.forEach(n.predecessors(u),function(f){var d=n.node(f);d.dummy&&(d.order<l||d.order>c)&&h0(t,f,u)})})}function i(s,o){var a=-1,l,c=0;return oe.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 oe.reduce(e,i),t}function G8(n,e){if(n.node(e).dummy)return oe.find(n.predecessors(e),function(t){return n.node(t).dummy})}function h0(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 n2(n,e,t){if(e>t){var r=e;e=t,t=r}return oe.has(n[e],t)}function r2(n,e,t,r){var i={},s={},o={};return oe.forEach(e,function(a){oe.forEach(a,function(l,c){i[l]=l,s[l]=l,o[l]=c})}),oe.forEach(e,function(a){var l=-1;oe.forEach(a,function(c){var u=r(c);if(u.length){u=oe.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]&&!n2(t,c,g)&&(s[g]=c,s[c]=i[c]=i[g],l=o[g])}}})}),{root:i,align:s}}function i2(n,e,t,r,i){var s={},o=H8(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)),oe.forEach(r,function(h){s[h]=s[t[h]]}),s}function H8(n,e,t,r){var i=new F8,s=n.graph(),o=W8(s.nodesep,s.edgesep,r);return oe.forEach(e,function(a){var l;oe.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 s2(n,e){return oe.minBy(oe.values(e),function(t){var r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return oe.forIn(t,function(s,o){var a=X8(n,o)/2;r=Math.max(s+a,r),i=Math.min(s-a,i)}),r-i})}function o2(n,e){var t=oe.values(e),r=oe.min(t),i=oe.max(t);oe.forEach(["u","d"],function(s){oe.forEach(["l","r"],function(o){var a=s+o,l=n[a],c;if(l!==e){var u=oe.values(l);c=o==="l"?r-oe.min(u):i-oe.max(u),c&&(n[a]=oe.mapValues(l,function(h){return h+c}))}})})}function a2(n,e){return oe.mapValues(n.ul,function(t,r){if(e)return n[e.toLowerCase()][r];var i=oe.sortBy(oe.map(n,r));return(i[1]+i[2])/2})}function U8(n){var e=q8.buildLayerMatrix(n),t=oe.merge(e2(n,e),t2(n,e)),r={},i;oe.forEach(["u","d"],function(o){i=o==="u"?e:oe.values(e).reverse(),oe.forEach(["l","r"],function(a){a==="r"&&(i=oe.map(i,function(h){return oe.values(h).reverse()}));var l=(o==="u"?n.predecessors:n.successors).bind(n),c=r2(n,i,t,l),u=i2(n,i,c.root,c.align,a==="r");a==="r"&&(u=oe.mapValues(u,function(h){return-h})),r[o+a]=u})});var s=s2(n,r);return o2(r,s),a2(r,n.graph().align)}function W8(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,oe.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,oe.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 X8(n,e){return n.node(e).width}var za=Ie,l2=zt,Y8=V8.positionX,K8=J8;function J8(n){n=l2.asNonCompoundGraph(n),Q8(n),za.forEach(Y8(n),function(e,t){n.node(t).x=e})}function Q8(n){var e=l2.buildLayerMatrix(n),t=n.graph().ranksep,r=0;za.forEach(e,function(i){var s=za.max(za.map(i,function(o){return n.node(o).height}));za.forEach(i,function(o){n.node(o).y=r+s/2}),r+=s+t})}var le=Ie,c2=KG,u2=dH,Z8=DH,eU=zt.normalizeRanks,tU=FH,nU=zt.removeEmptyRanks,h2=HH,rU=JH,f2=ZH,iU=B8,sU=K8,ai=zt,oU=On.Graph,aU=lU;function lU(n,e){var t=e&&e.debugTiming?ai.time:ai.notime;t("layout",function(){var r=t(" buildLayoutGraph",function(){return bU(n)});t(" runLayout",function(){cU(r,t)}),t(" updateInputGraph",function(){uU(n,r)})})}function cU(n,e){e(" makeSpaceForEdgeLabels",function(){wU(n)}),e(" removeSelfEdges",function(){MU(n)}),e(" acyclic",function(){c2.run(n)}),e(" nestingGraph.run",function(){h2.run(n)}),e(" rank",function(){Z8(ai.asNonCompoundGraph(n))}),e(" injectEdgeLabelProxies",function(){xU(n)}),e(" removeEmptyRanks",function(){nU(n)}),e(" nestingGraph.cleanup",function(){h2.cleanup(n)}),e(" normalizeRanks",function(){eU(n)}),e(" assignRankMinMax",function(){CU(n)}),e(" removeEdgeLabelProxies",function(){SU(n)}),e(" normalize.run",function(){u2.run(n)}),e(" parentDummyChains",function(){tU(n)}),e(" addBorderSegments",function(){rU(n)}),e(" order",function(){iU(n)}),e(" insertSelfEdges",function(){_U(n)}),e(" adjustCoordinateSystem",function(){f2.adjust(n)}),e(" position",function(){sU(n)}),e(" positionSelfEdges",function(){NU(n)}),e(" removeBorderNodes",function(){OU(n)}),e(" normalize.undo",function(){u2.undo(n)}),e(" fixupEdgeLabelCoords",function(){AU(n)}),e(" undoCoordinateSystem",function(){f2.undo(n)}),e(" translateGraph",function(){PU(n)}),e(" assignNodeIntersects",function(){EU(n)}),e(" reversePoints",function(){TU(n)}),e(" acyclic.undo",function(){c2.undo(n)})}function uU(n,e){le.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))}),le.forEach(n.edges(),function(t){var r=n.edge(t),i=e.edge(t);r.points=i.points,le.has(i,"x")&&(r.x=i.x,r.y=i.y)}),n.graph().width=e.graph().width,n.graph().height=e.graph().height}var hU=["nodesep","edgesep","ranksep","marginx","marginy"],fU={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},dU=["acyclicer","ranker","rankdir","align"],gU=["width","height"],pU={width:0,height:0},mU=["minlen","weight","width","height","labeloffset"],yU={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},vU=["labelpos"];function bU(n){var e=new oU({multigraph:!0,compound:!0}),t=d0(n.graph());return e.setGraph(le.merge({},fU,f0(t,hU),le.pick(t,dU))),le.forEach(n.nodes(),function(r){var i=d0(n.node(r));e.setNode(r,le.defaults(f0(i,gU),pU)),e.setParent(r,n.parent(r))}),le.forEach(n.edges(),function(r){var i=d0(n.edge(r));e.setEdge(r,le.merge({},yU,f0(i,mU),le.pick(i,vU)))}),e}function wU(n){var e=n.graph();e.ranksep/=2,le.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 xU(n){le.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 CU(n){var e=0;le.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=le.max(e,r.maxRank))}),n.graph().maxRank=e}function SU(n){le.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 PU(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)}le.forEach(n.nodes(),function(c){l(n.node(c))}),le.forEach(n.edges(),function(c){var u=n.edge(c);le.has(u,"x")&&l(u)}),e-=o,r-=a,le.forEach(n.nodes(),function(c){var u=n.node(c);u.x-=e,u.y-=r}),le.forEach(n.edges(),function(c){var u=n.edge(c);le.forEach(u.points,function(h){h.x-=e,h.y-=r}),le.has(u,"x")&&(u.x-=e),le.has(u,"y")&&(u.y-=r)}),s.width=t-e+o,s.height=i-r+a}function EU(n){le.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 AU(n){le.forEach(n.edges(),function(e){var t=n.edge(e);if(le.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 TU(n){le.forEach(n.edges(),function(e){var t=n.edge(e);t.reversed&&t.points.reverse()})}function OU(n){le.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(le.last(t.borderLeft)),o=n.node(le.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}}),le.forEach(n.nodes(),function(e){n.node(e).dummy==="border"&&n.removeNode(e)})}function MU(n){le.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 _U(n){var e=ai.buildLayerMatrix(n);le.forEach(e,function(t){var r=0;le.forEach(t,function(i,s){var o=n.node(i);o.order=s+r,le.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 NU(n){le.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 f0(n,e){return le.mapValues(le.pick(n,e),Number)}function d0(n){var e={};return le.forEach(n,function(t,r){e[r.toLowerCase()]=t}),e}var Cu=Ie,kU=zt,IU=On.Graph,LU={debugOrdering:RU};function RU(n){var e=kU.buildLayerMatrix(n),t=new IU({compound:!0,multigraph:!0}).setGraph({});return Cu.forEach(n.nodes(),function(r){t.setNode(r,{label:r}),t.setParent(r,"layer"+n.node(r).rank)}),Cu.forEach(n.edges(),function(r){t.setEdge(r.v,r.w,{},r.name)}),Cu.forEach(e,function(r,i){var s="layer"+i;t.setNode(s,{rank:"same"}),Cu.reduce(r,function(o,a){return t.setEdge(o,a,{style:"invis"}),a})}),t}var jU="0.8.5",DU={graphlib:On,layout:aU,debug:LU,util:{time:zt.time,notime:zt.notime},version:jU};const Su=_q(DU),{groupBy:BU,reduce:$U,uniq:zU,uniqBy:d2}=Ou,FU={ER:"er-rect",EDGE:"edge"},g0=()=>Va.useTranslation("graph-collection-manager"),g2=(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 zU(t)};return r(e)},qU=(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)},p2=n=>{const e=[],t=[],r=n.map((o,a)=>{const l=[],c=[...o.fields],u=g2(n,o.name),h=$U(u,(d,g)=>{var m;const p=d,b=(m=n.find(y=>y.name===g))==null?void 0:m.fields.map(y=>He(ie({},y),{sourceCollectionName:o.name}));return p.concat(b)},[]);d2(c.concat(h),"name").forEach(d=>{d.uiSchema&&l.push(ie({id:d.key,group:"list"},d)),["obo","oho","o2o","o2m","m2o","m2m","linkTo"].includes(d.interface)&&e.push(d)}),t.push(o.name);const f=VU(l);return{id:o.name,shape:FU.ER,name:o.name,title:o.title,width:250,ports:[...f.initPorts||[],...f.morePorts||[]],item:o}}),i=HU(e,t,r),s=GU(n);return{nodesData:r,edgesData:i,inheritEdges:s}},VU=n=>BU(n,t=>t.isForeignKey||t.primaryKey||["obo","oho","o2o","o2m","m2o","m2m","linkTo","id"].includes(t.interface)?"initPorts":"morePorts"),GU=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(ie({id:r.name+s,source:{cell:r.name,connectionPoint:"rect"},target:{cell:s,connectionPoint:"rect"},connector:{name:"normal",zIndex:1e3},connectionType:"inherited"},e))})}),t},HU=(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:m2(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:m2(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,P=(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+P+C+E;r.push(ie({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(ie({id:O,source:{cell:x,port:P,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,P=(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+P+C+E;p(y+w+m+v)&&b&&w&&r.push(ie({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+P)&&P&&E&&r.push(ie({id:O,source:{cell:x,port:P,anchor:{name:"right"}},target:{cell:C,port:E,anchor:{name:"left"}},associated:[n[h].name]},g))}}return d2(r,"id")},m2=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[]}},UU=(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},y2=(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 p0;const At=()=>p0||(p0=document.getElementById("graph_container")),WU=({item:n})=>_.jsx(j.AddCollection,{trigger:["click"],align:{overflow:{adjustY:!1}},item:n,scope:{useCancelAction:Cr},getContainer:At,children:_.jsx(ue.Button,{type:"primary",children:_.jsx(Ue.PlusOutlined,{})})}),m0=j.createStyles(({token:n,css:e})=>({graphMinimap:e`
424
+ `;G.prototype.isSnaplineEnabled=function(){const n=this.getPlugin("snapline");return n?n.isEnabled():!1},G.prototype.enableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enable(),this},G.prototype.disableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disable(),this},G.prototype.toggleSnapline=function(){const n=this.getPlugin("snapline");return n&&n.toggleEnabled(),this},G.prototype.hideSnapline=function(){const n=this.getPlugin("snapline");return n&&n.hide(),this},G.prototype.setSnaplineFilter=function(n){const e=this.getPlugin("snapline");return e&&e.setFilter(n),this},G.prototype.isSnaplineOnResizingEnabled=function(){const n=this.getPlugin("snapline");return n?n.isOnResizingEnabled():!1},G.prototype.enableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.enableOnResizing(),this},G.prototype.disableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.disableOnResizing(),this},G.prototype.toggleSnaplineOnResizing=function(n){const e=this.getPlugin("snapline");return e&&e.toggleOnResizing(n),this},G.prototype.isSharpSnapline=function(){const n=this.getPlugin("snapline");return n?n.isSharp():!1},G.prototype.enableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enableSharp(),this},G.prototype.disableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disableSharp(),this},G.prototype.toggleSharpSnapline=function(n){const e=this.getPlugin("snapline");return e&&e.toggleSharp(n),this},G.prototype.getSnaplineTolerance=function(){const n=this.getPlugin("snapline");if(n)return n.getTolerance()},G.prototype.setSnaplineTolerance=function(n){const e=this.getPlugin("snapline");return e&&e.setTolerance(n),this};var qq=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 Mx extends Nn{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),Mo(this.name,Fq)}init(e){this.snaplineImpl=new Ox(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(),_o(this.name)}}qq([Nn.dispose()],Mx.prototype,"dispose",null);class _x extends Ye{}(function(n){function e(t){const r=[],i=Te.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=Re({},{body:Object.assign({refWidth:null,refHeight:null},i)},t.attrs||{})}}return t}}),Ye.registry.register("react-shape",n,!0)})(_x||(_x={}));var $l=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Vq(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Nx={exports:{}},qt={},kx={exports:{}},Ix={};/**
425
+ * @license React
426
+ * scheduler.production.min.js
427
+ *
428
+ * Copyright (c) Facebook, Inc. and its affiliates.
429
+ *
430
+ * This source code is licensed under the MIT license found in the
431
+ * LICENSE file in the root directory of this source tree.
432
+ */(function(n){function e(j,F){var H=j.length;j.push(F);e:for(;0<H;){var ne=H-1>>>1,Pe=j[ne];if(0<i(Pe,F))j[ne]=F,j[H]=Pe,H=ne;else break e}}function t(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var F=j[0],H=j.pop();if(H!==F){j[0]=H;e:for(var ne=0,Pe=j.length,Yt=Pe>>>1;ne<Yt;){var N=2*(ne+1)-1,$=j[N],z=N+1,X=j[z];if(0>i($,H))z<Pe&&0>i(X,$)?(j[ne]=X,j[z]=H,ne=z):(j[ne]=$,j[N]=H,ne=N);else if(z<Pe&&0>i(X,H))j[ne]=X,j[z]=H,ne=z;else break e}}return F}function i(j,F){var H=j.sortIndex-F.sortIndex;return H!==0?H:j.id-F.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(j){for(var F=t(c);F!==null;){if(F.callback===null)r(c);else if(F.startTime<=j)r(c),F.sortIndex=F.expirationTime,e(l,F);else break;F=t(c)}}function w(j){if(p=!1,v(j),!g)if(t(l)!==null)g=!0,I(x);else{var F=t(c);F!==null&&J(w,F.startTime-j)}}function x(j,F){g=!1,p&&(p=!1,m(E),E=-1),d=!0;var H=f;try{for(v(F),h=t(l);h!==null&&(!(h.expirationTime>F)||j&&!T());){var ne=h.callback;if(typeof ne=="function"){h.callback=null,f=h.priorityLevel;var Pe=ne(h.expirationTime<=F);F=n.unstable_now(),typeof Pe=="function"?h.callback=Pe:h===t(l)&&r(l),v(F)}else r(l);h=t(l)}if(h!==null)var Yt=!0;else{var N=t(c);N!==null&&J(w,N.startTime-F),Yt=!1}return Yt}finally{h=null,f=H,d=!1}}var C=!1,P=null,E=-1,A=5,O=-1;function T(){return!(n.unstable_now()-O<A)}function L(){if(P!==null){var j=n.unstable_now();O=j;var F=!0;try{F=P(!0,j)}finally{F?V():(C=!1,P=null)}}else C=!1}var V;if(typeof y=="function")V=function(){y(L)};else if(typeof MessageChannel!="undefined"){var Y=new MessageChannel,M=Y.port2;Y.port1.onmessage=L,V=function(){M.postMessage(null)}}else V=function(){b(L,0)};function I(j){P=j,C||(C=!0,V())}function J(j,F){E=b(function(){j(n.unstable_now())},F)}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(j){j.callback=null},n.unstable_continueExecution=function(){g||d||(g=!0,I(x))},n.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<j?Math.floor(1e3/j):5},n.unstable_getCurrentPriorityLevel=function(){return f},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(j){switch(f){case 1:case 2:case 3:var F=3;break;default:F=f}var H=f;f=F;try{return j()}finally{f=H}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(j,F){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var H=f;f=j;try{return F()}finally{f=H}},n.unstable_scheduleCallback=function(j,F,H){var ne=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?ne+H:ne):H=ne,j){case 1:var Pe=-1;break;case 2:Pe=250;break;case 5:Pe=1073741823;break;case 4:Pe=1e4;break;default:Pe=5e3}return Pe=H+Pe,j={id:u++,callback:F,priorityLevel:j,startTime:H,expirationTime:Pe,sortIndex:-1},H>ne?(j.sortIndex=H,e(c,j),t(l)===null&&j===t(c)&&(p?(m(E),E=-1):p=!0,J(w,H-ne))):(j.sortIndex=Pe,e(l,j),g||d||(g=!0,I(x))),j},n.unstable_shouldYield=T,n.unstable_wrapCallback=function(j){var F=f;return function(){var H=f;f=F;try{return j.apply(this,arguments)}finally{f=H}}}})(Ix),kx.exports=Ix;var Gq=kx.exports;/**
433
+ * @license React
434
+ * react-dom.production.min.js
435
+ *
436
+ * Copyright (c) Facebook, Inc. and its affiliates.
437
+ *
438
+ * This source code is licensed under the MIT license found in the
439
+ * LICENSE file in the root directory of this source tree.
440
+ */var Lx=W,Vt=Gq;function D(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 Rx=new Set,qo={};function Ci(n,e){Ps(n,e),Ps(n+"Capture",e)}function Ps(n,e){for(qo[n]=e,n=0;n<e.length;n++)Rx.add(e[n])}var sr=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),qh=Object.prototype.hasOwnProperty,Hq=/^[: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]*$/,jx={},Dx={};function Uq(n){return qh.call(Dx,n)?!0:qh.call(jx,n)?!1:Hq.test(n)?Dx[n]=!0:(jx[n]=!0,!1)}function Wq(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 Xq(n,e,t,r){if(e===null||typeof e=="undefined"||Wq(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 _t(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 _t(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 _t(e,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){mt[n]=new _t(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){mt[n]=new _t(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 _t(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){mt[n]=new _t(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){mt[n]=new _t(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){mt[n]=new _t(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){mt[n]=new _t(n,5,!1,n.toLowerCase(),null,!1,!1)});var Vh=/[\-:]([a-z])/g;function Gh(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(Vh,Gh);mt[e]=new _t(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(Vh,Gh);mt[e]=new _t(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(Vh,Gh);mt[e]=new _t(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){mt[n]=new _t(n,1,!1,n.toLowerCase(),null,!1,!1)}),mt.xlinkHref=new _t("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){mt[n]=new _t(n,1,!1,n.toLowerCase(),null,!0,!0)});function Hh(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")&&(Xq(e,t,i,r)&&(t=null),r||i===null?Uq(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 or=Lx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,zl=Symbol.for("react.element"),Es=Symbol.for("react.portal"),As=Symbol.for("react.fragment"),Uh=Symbol.for("react.strict_mode"),Wh=Symbol.for("react.profiler"),Bx=Symbol.for("react.provider"),$x=Symbol.for("react.context"),Xh=Symbol.for("react.forward_ref"),Yh=Symbol.for("react.suspense"),Kh=Symbol.for("react.suspense_list"),Jh=Symbol.for("react.memo"),Dr=Symbol.for("react.lazy"),zx=Symbol.for("react.offscreen"),Fx=Symbol.iterator;function Vo(n){return n===null||typeof n!="object"?null:(n=Fx&&n[Fx]||n["@@iterator"],typeof n=="function"?n:null)}var je=Object.assign,Qh;function Go(n){if(Qh===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);Qh=e&&e[1]||""}return`
441
+ `+Qh+n}var Zh=!1;function ef(n,e){if(!n||Zh)return"";Zh=!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
+ `),s=r.stack.split(`
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{Zh=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Go(n):""}function Yq(n){switch(n.tag){case 5:return Go(n.type);case 16:return Go("Lazy");case 13:return Go("Suspense");case 19:return Go("SuspenseList");case 0:case 2:case 15:return n=ef(n.type,!1),n;case 11:return n=ef(n.type.render,!1),n;case 1:return n=ef(n.type,!0),n;default:return""}}function tf(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 As:return"Fragment";case Es:return"Portal";case Wh:return"Profiler";case Uh:return"StrictMode";case Yh:return"Suspense";case Kh:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case $x:return(n.displayName||"Context")+".Consumer";case Bx:return(n._context.displayName||"Context")+".Provider";case Xh:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case Jh:return e=n.displayName||null,e!==null?e:tf(n.type)||"Memo";case Dr:e=n._payload,n=n._init;try{return tf(n(e))}catch(t){}}return null}function Kq(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 tf(e);case 8:return e===Uh?"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 qx(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Jq(n){var e=qx(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 Fl(n){n._valueTracker||(n._valueTracker=Jq(n))}function Vx(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),r="";return n&&(r=qx(n)?n.checked?"true":"false":n.value),n=r,n!==t?(e.setValue(n),!0):!1}function ql(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 nf(n,e){var t=e.checked;return je({},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 Hx(n,e){e=e.checked,e!=null&&Hh(n,"checked",e,!1)}function rf(n,e){Hx(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")?sf(n,e.type,t):e.hasOwnProperty("defaultValue")&&sf(n,e.type,Br(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function Ux(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 sf(n,e,t){(e!=="number"||ql(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Ho=Array.isArray;function Ts(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 of(n,e){if(e.dangerouslySetInnerHTML!=null)throw Error(D(91));return je({},e,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function Wx(n,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(D(92));if(Ho(t)){if(1<t.length)throw Error(D(93));t=t[0]}e=t}e==null&&(e=""),t=e}n._wrapperState={initialValue:Br(t)}}function Xx(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 Yx(n){var e=n.textContent;e===n._wrapperState.initialValue&&e!==""&&e!==null&&(n.value=e)}function Kx(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 af(n,e){return n==null||n==="http://www.w3.org/1999/xhtml"?Kx(e):n==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var Vl,Jx=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(Vl=Vl||document.createElement("div"),Vl.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Vl.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function Uo(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var Wo={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},Qq=["Webkit","ms","Moz","O"];Object.keys(Wo).forEach(function(n){Qq.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),Wo[e]=Wo[n]})});function Qx(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||Wo.hasOwnProperty(n)&&Wo[n]?(""+e).trim():e+"px"}function Zx(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var r=t.indexOf("--")===0,i=Qx(t,e[t],r);t==="float"&&(t="cssFloat"),r?n.setProperty(t,i):n[t]=i}}var Zq=je({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 lf(n,e){if(e){if(Zq[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(D(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(D(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(D(61))}if(e.style!=null&&typeof e.style!="object")throw Error(D(62))}}function cf(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 uf=null;function hf(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var ff=null,Os=null,Ms=null;function eC(n){if(n=pa(n)){if(typeof ff!="function")throw Error(D(280));var e=n.stateNode;e&&(e=fc(e),ff(n.stateNode,n.type,e))}}function tC(n){Os?Ms?Ms.push(n):Ms=[n]:Os=n}function nC(){if(Os){var n=Os,e=Ms;if(Ms=Os=null,eC(n),e)for(n=0;n<e.length;n++)eC(e[n])}}function rC(n,e){return n(e)}function iC(){}var df=!1;function sC(n,e,t){if(df)return n(e,t);df=!0;try{return rC(n,e,t)}finally{df=!1,(Os!==null||Ms!==null)&&(iC(),nC())}}function Xo(n,e){var t=n.stateNode;if(t===null)return null;var r=fc(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(D(231,e,typeof t));return t}var gf=!1;if(sr)try{var Yo={};Object.defineProperty(Yo,"passive",{get:function(){gf=!0}}),window.addEventListener("test",Yo,Yo),window.removeEventListener("test",Yo,Yo)}catch(n){gf=!1}function eV(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 Ko=!1,Gl=null,Hl=!1,pf=null,tV={onError:function(n){Ko=!0,Gl=n}};function nV(n,e,t,r,i,s,o,a,l){Ko=!1,Gl=null,eV.apply(tV,arguments)}function rV(n,e,t,r,i,s,o,a,l){if(nV.apply(this,arguments),Ko){if(Ko){var c=Gl;Ko=!1,Gl=null}else throw Error(D(198));Hl||(Hl=!0,pf=c)}}function Si(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 oC(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 aC(n){if(Si(n)!==n)throw Error(D(188))}function iV(n){var e=n.alternate;if(!e){if(e=Si(n),e===null)throw Error(D(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 aC(i),n;if(s===r)return aC(i),e;s=s.sibling}throw Error(D(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(D(189))}}if(t.alternate!==r)throw Error(D(190))}if(t.tag!==3)throw Error(D(188));return t.stateNode.current===t?n:e}function lC(n){return n=iV(n),n!==null?cC(n):null}function cC(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var e=cC(n);if(e!==null)return e;n=n.sibling}return null}var uC=Vt.unstable_scheduleCallback,hC=Vt.unstable_cancelCallback,sV=Vt.unstable_shouldYield,oV=Vt.unstable_requestPaint,Ke=Vt.unstable_now,aV=Vt.unstable_getCurrentPriorityLevel,mf=Vt.unstable_ImmediatePriority,fC=Vt.unstable_UserBlockingPriority,Ul=Vt.unstable_NormalPriority,lV=Vt.unstable_LowPriority,dC=Vt.unstable_IdlePriority,Wl=null,$n=null;function cV(n){if($n&&typeof $n.onCommitFiberRoot=="function")try{$n.onCommitFiberRoot(Wl,n,void 0,(n.current.flags&128)===128)}catch(e){}}var wn=Math.clz32?Math.clz32:fV,uV=Math.log,hV=Math.LN2;function fV(n){return n>>>=0,n===0?32:31-(uV(n)/hV|0)|0}var Xl=64,Yl=4194304;function Jo(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 Kl(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=Jo(a):(s&=o,s!==0&&(r=Jo(s)))}else o=t&~i,o!==0?r=Jo(o):s!==0&&(r=Jo(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-wn(e),i=1<<t,r|=n[t],e&=~i;return r}function dV(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 gV(n,e){for(var t=n.suspendedLanes,r=n.pingedLanes,i=n.expirationTimes,s=n.pendingLanes;0<s;){var o=31-wn(s),a=1<<o,l=i[o];l===-1?(!(a&t)||a&r)&&(i[o]=dV(a,e)):l<=e&&(n.expiredLanes|=a),s&=~a}}function yf(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function gC(){var n=Xl;return Xl<<=1,!(Xl&4194240)&&(Xl=64),n}function vf(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function Qo(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-wn(e),n[e]=t}function pV(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-wn(t),s=1<<i;e[i]=0,r[i]=-1,n[i]=-1,t&=~s}}function bf(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var r=31-wn(t),i=1<<r;i&e|n[r]&e&&(n[r]|=e),t&=~i}}var be=0;function pC(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var mC,wf,yC,vC,bC,xf=!1,Jl=[],$r=null,zr=null,Fr=null,Zo=new Map,ea=new Map,qr=[],mV="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 wC(n,e){switch(n){case"focusin":case"focusout":$r=null;break;case"dragenter":case"dragleave":zr=null;break;case"mouseover":case"mouseout":Fr=null;break;case"pointerover":case"pointerout":Zo.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":ea.delete(e.pointerId)}}function ta(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=pa(e),e!==null&&wf(e)),n):(n.eventSystemFlags|=r,e=n.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),n)}function yV(n,e,t,r,i){switch(e){case"focusin":return $r=ta($r,n,e,t,r,i),!0;case"dragenter":return zr=ta(zr,n,e,t,r,i),!0;case"mouseover":return Fr=ta(Fr,n,e,t,r,i),!0;case"pointerover":var s=i.pointerId;return Zo.set(s,ta(Zo.get(s)||null,n,e,t,r,i)),!0;case"gotpointercapture":return s=i.pointerId,ea.set(s,ta(ea.get(s)||null,n,e,t,r,i)),!0}return!1}function xC(n){var e=Pi(n.target);if(e!==null){var t=Si(e);if(t!==null){if(e=t.tag,e===13){if(e=oC(t),e!==null){n.blockedOn=e,bC(n.priority,function(){yC(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 Ql(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=Sf(n.domEventName,n.eventSystemFlags,e[0],n.nativeEvent);if(t===null){t=n.nativeEvent;var r=new t.constructor(t.type,t);uf=r,t.target.dispatchEvent(r),uf=null}else return e=pa(t),e!==null&&wf(e),n.blockedOn=t,!1;e.shift()}return!0}function CC(n,e,t){Ql(n)&&t.delete(e)}function vV(){xf=!1,$r!==null&&Ql($r)&&($r=null),zr!==null&&Ql(zr)&&(zr=null),Fr!==null&&Ql(Fr)&&(Fr=null),Zo.forEach(CC),ea.forEach(CC)}function na(n,e){n.blockedOn===e&&(n.blockedOn=null,xf||(xf=!0,Vt.unstable_scheduleCallback(Vt.unstable_NormalPriority,vV)))}function ra(n){function e(i){return na(i,n)}if(0<Jl.length){na(Jl[0],n);for(var t=1;t<Jl.length;t++){var r=Jl[t];r.blockedOn===n&&(r.blockedOn=null)}}for($r!==null&&na($r,n),zr!==null&&na(zr,n),Fr!==null&&na(Fr,n),Zo.forEach(e),ea.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);)xC(t),t.blockedOn===null&&qr.shift()}var _s=or.ReactCurrentBatchConfig,Zl=!0;function bV(n,e,t,r){var i=be,s=_s.transition;_s.transition=null;try{be=1,Cf(n,e,t,r)}finally{be=i,_s.transition=s}}function wV(n,e,t,r){var i=be,s=_s.transition;_s.transition=null;try{be=4,Cf(n,e,t,r)}finally{be=i,_s.transition=s}}function Cf(n,e,t,r){if(Zl){var i=Sf(n,e,t,r);if(i===null)zf(n,e,r,ec,t),wC(n,r);else if(yV(i,n,e,t,r))r.stopPropagation();else if(wC(n,r),e&4&&-1<mV.indexOf(n)){for(;i!==null;){var s=pa(i);if(s!==null&&mC(s),s=Sf(n,e,t,r),s===null&&zf(n,e,r,ec,t),s===i)break;i=s}i!==null&&r.stopPropagation()}else zf(n,e,r,null,t)}}var ec=null;function Sf(n,e,t,r){if(ec=null,n=hf(r),n=Pi(n),n!==null)if(e=Si(n),e===null)n=null;else if(t=e.tag,t===13){if(n=oC(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 SC(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(aV()){case mf:return 1;case fC:return 4;case Ul:case lV:return 16;case dC:return 536870912;default:return 16}default:return 16}}var Vr=null,Pf=null,tc=null;function PC(){if(tc)return tc;var n,e=Pf,t=e.length,r,i="value"in Vr?Vr.value:Vr.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 tc=i.slice(n,1<r?1-r:void 0)}function nc(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 rc(){return!0}function EC(){return!1}function Gt(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)?rc:EC,this.isPropagationStopped=EC,this}return je(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=rc)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=rc)},persist:function(){},isPersistent:rc}),e}var Ns={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ef=Gt(Ns),ia=je({},Ns,{view:0,detail:0}),xV=Gt(ia),Af,Tf,sa,ic=je({},ia,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mf,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!==sa&&(sa&&n.type==="mousemove"?(Af=n.screenX-sa.screenX,Tf=n.screenY-sa.screenY):Tf=Af=0,sa=n),Af)},movementY:function(n){return"movementY"in n?n.movementY:Tf}}),AC=Gt(ic),CV=je({},ic,{dataTransfer:0}),SV=Gt(CV),PV=je({},ia,{relatedTarget:0}),Of=Gt(PV),EV=je({},Ns,{animationName:0,elapsedTime:0,pseudoElement:0}),AV=Gt(EV),TV=je({},Ns,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),OV=Gt(TV),MV=je({},Ns,{data:0}),TC=Gt(MV),_V={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NV={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"},kV={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function IV(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=kV[n])?!!e[n]:!1}function Mf(){return IV}var LV=je({},ia,{key:function(n){if(n.key){var e=_V[n.key]||n.key;if(e!=="Unidentified")return e}return n.type==="keypress"?(n=nc(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?NV[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mf,charCode:function(n){return n.type==="keypress"?nc(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?nc(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),RV=Gt(LV),jV=je({},ic,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),OC=Gt(jV),DV=je({},ia,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mf}),BV=Gt(DV),$V=je({},Ns,{propertyName:0,elapsedTime:0,pseudoElement:0}),zV=Gt($V),FV=je({},ic,{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}),qV=Gt(FV),VV=[9,13,27,32],_f=sr&&"CompositionEvent"in window,oa=null;sr&&"documentMode"in document&&(oa=document.documentMode);var GV=sr&&"TextEvent"in window&&!oa,MC=sr&&(!_f||oa&&8<oa&&11>=oa),_C=String.fromCharCode(32),NC=!1;function kC(n,e){switch(n){case"keyup":return VV.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function IC(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ks=!1;function HV(n,e){switch(n){case"compositionend":return IC(e);case"keypress":return e.which!==32?null:(NC=!0,_C);case"textInput":return n=e.data,n===_C&&NC?null:n;default:return null}}function UV(n,e){if(ks)return n==="compositionend"||!_f&&kC(n,e)?(n=PC(),tc=Pf=Vr=null,ks=!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 MC&&e.locale!=="ko"?null:e.data;default:return null}}var WV={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 LC(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!WV[n.type]:e==="textarea"}function RC(n,e,t,r){tC(r),e=cc(e,"onChange"),0<e.length&&(t=new Ef("onChange","change",null,t,r),n.push({event:t,listeners:e}))}var aa=null,la=null;function XV(n){ZC(n,0)}function sc(n){var e=Ds(n);if(Vx(e))return n}function YV(n,e){if(n==="change")return e}var jC=!1;if(sr){var Nf;if(sr){var kf="oninput"in document;if(!kf){var DC=document.createElement("div");DC.setAttribute("oninput","return;"),kf=typeof DC.oninput=="function"}Nf=kf}else Nf=!1;jC=Nf&&(!document.documentMode||9<document.documentMode)}function BC(){aa&&(aa.detachEvent("onpropertychange",$C),la=aa=null)}function $C(n){if(n.propertyName==="value"&&sc(la)){var e=[];RC(e,la,n,hf(n)),sC(XV,e)}}function KV(n,e,t){n==="focusin"?(BC(),aa=e,la=t,aa.attachEvent("onpropertychange",$C)):n==="focusout"&&BC()}function JV(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return sc(la)}function QV(n,e){if(n==="click")return sc(e)}function ZV(n,e){if(n==="input"||n==="change")return sc(e)}function e6(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var xn=typeof Object.is=="function"?Object.is:e6;function ca(n,e){if(xn(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(!qh.call(e,i)||!xn(n[i],e[i]))return!1}return!0}function zC(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function FC(n,e){var t=zC(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=zC(t)}}function qC(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?qC(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function VC(){for(var n=window,e=ql();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=ql(n.document)}return e}function If(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 t6(n){var e=VC(),t=n.focusedElem,r=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&qC(t.ownerDocument.documentElement,t)){if(r!==null&&If(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=FC(t,s);var o=FC(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 n6=sr&&"documentMode"in document&&11>=document.documentMode,Is=null,Lf=null,ua=null,Rf=!1;function GC(n,e,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;Rf||Is==null||Is!==ql(r)||(r=Is,"selectionStart"in r&&If(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}),ua&&ca(ua,r)||(ua=r,r=cc(Lf,"onSelect"),0<r.length&&(e=new Ef("onSelect","select",null,e,t),n.push({event:e,listeners:r}),e.target=Is)))}function oc(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var Ls={animationend:oc("Animation","AnimationEnd"),animationiteration:oc("Animation","AnimationIteration"),animationstart:oc("Animation","AnimationStart"),transitionend:oc("Transition","TransitionEnd")},jf={},HC={};sr&&(HC=document.createElement("div").style,"AnimationEvent"in window||(delete Ls.animationend.animation,delete Ls.animationiteration.animation,delete Ls.animationstart.animation),"TransitionEvent"in window||delete Ls.transitionend.transition);function ac(n){if(jf[n])return jf[n];if(!Ls[n])return n;var e=Ls[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in HC)return jf[n]=e[t];return n}var UC=ac("animationend"),WC=ac("animationiteration"),XC=ac("animationstart"),YC=ac("transitionend"),KC=new Map,JC="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 Gr(n,e){KC.set(n,e),Ci(e,[n])}for(var Df=0;Df<JC.length;Df++){var Bf=JC[Df],r6=Bf.toLowerCase(),i6=Bf[0].toUpperCase()+Bf.slice(1);Gr(r6,"on"+i6)}Gr(UC,"onAnimationEnd"),Gr(WC,"onAnimationIteration"),Gr(XC,"onAnimationStart"),Gr("dblclick","onDoubleClick"),Gr("focusin","onFocus"),Gr("focusout","onBlur"),Gr(YC,"onTransitionEnd"),Ps("onMouseEnter",["mouseout","mouseover"]),Ps("onMouseLeave",["mouseout","mouseover"]),Ps("onPointerEnter",["pointerout","pointerover"]),Ps("onPointerLeave",["pointerout","pointerover"]),Ci("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ci("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ci("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ci("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ci("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ci("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ha="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(" "),s6=new Set("cancel close invalid load scroll toggle".split(" ").concat(ha));function QC(n,e,t){var r=n.type||"unknown-event";n.currentTarget=t,rV(r,e,void 0,n),n.currentTarget=null}function ZC(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;QC(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;QC(i,a,c),s=l}}}if(Hl)throw n=pf,Hl=!1,pf=null,n}function _e(n,e){var t=e[Uf];t===void 0&&(t=e[Uf]=new Set);var r=n+"__bubble";t.has(r)||(eS(e,n,2,!1),t.add(r))}function $f(n,e,t){var r=0;e&&(r|=4),eS(t,n,r,e)}var lc="_reactListening"+Math.random().toString(36).slice(2);function fa(n){if(!n[lc]){n[lc]=!0,Rx.forEach(function(t){t!=="selectionchange"&&(s6.has(t)||$f(t,!1,n),$f(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[lc]||(e[lc]=!0,$f("selectionchange",!1,e))}}function eS(n,e,t,r){switch(SC(e)){case 1:var i=bV;break;case 4:i=wV;break;default:i=Cf}t=i.bind(null,e,t,n),i=void 0,!gf||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 zf(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=Pi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}sC(function(){var c=s,u=hf(t),h=[];e:{var f=KC.get(n);if(f!==void 0){var d=Ef,g=n;switch(n){case"keypress":if(nc(t)===0)break e;case"keydown":case"keyup":d=RV;break;case"focusin":g="focus",d=Of;break;case"focusout":g="blur",d=Of;break;case"beforeblur":case"afterblur":d=Of;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=AC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=SV;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=BV;break;case UC:case WC:case XC:d=AV;break;case YC:d=zV;break;case"scroll":d=xV;break;case"wheel":d=qV;break;case"copy":case"cut":case"paste":d=OV;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=OC}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=Xo(y,m),w!=null&&p.push(da(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!==uf&&(g=t.relatedTarget||t.fromElement)&&(Pi(g)||g[ar]))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?Pi(g):null,g!==null&&(b=Si(g),g!==b||g.tag!==5&&g.tag!==6)&&(g=null)):(d=null,g=c),d!==g)){if(p=AC,w="onMouseLeave",m="onMouseEnter",y="mouse",(n==="pointerout"||n==="pointerover")&&(p=OC,w="onPointerLeave",m="onPointerEnter",y="pointer"),b=d==null?f:Ds(d),v=g==null?f:Ds(g),f=new p(w,y+"leave",d,t,u),f.target=b,f.relatedTarget=v,w=null,Pi(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=Rs(v))y++;for(v=0,w=m;w;w=Rs(w))v++;for(;0<y-v;)p=Rs(p),y--;for(;0<v-y;)m=Rs(m),v--;for(;y--;){if(p===m||m!==null&&p===m.alternate)break t;p=Rs(p),m=Rs(m)}p=null}else p=null;d!==null&&tS(h,f,d,p,!1),g!==null&&b!==null&&tS(h,b,g,p,!0)}}e:{if(f=c?Ds(c):window,d=f.nodeName&&f.nodeName.toLowerCase(),d==="select"||d==="input"&&f.type==="file")var x=YV;else if(LC(f))if(jC)x=ZV;else{x=JV;var C=KV}else(d=f.nodeName)&&d.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(x=QV);if(x&&(x=x(n,c))){RC(h,x,t,u);break e}C&&C(n,f,c),n==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&sf(f,"number",f.value)}switch(C=c?Ds(c):window,n){case"focusin":(LC(C)||C.contentEditable==="true")&&(Is=C,Lf=c,ua=null);break;case"focusout":ua=Lf=Is=null;break;case"mousedown":Rf=!0;break;case"contextmenu":case"mouseup":case"dragend":Rf=!1,GC(h,t,u);break;case"selectionchange":if(n6)break;case"keydown":case"keyup":GC(h,t,u)}var P;if(_f)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 ks?kC(n,t)&&(E="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(E="onCompositionStart");E&&(MC&&t.locale!=="ko"&&(ks||E!=="onCompositionStart"?E==="onCompositionEnd"&&ks&&(P=PC()):(Vr=u,Pf="value"in Vr?Vr.value:Vr.textContent,ks=!0)),C=cc(c,E),0<C.length&&(E=new TC(E,n,null,t,u),h.push({event:E,listeners:C}),P?E.data=P:(P=IC(t),P!==null&&(E.data=P)))),(P=GV?HV(n,t):UV(n,t))&&(c=cc(c,"onBeforeInput"),0<c.length&&(u=new TC("onBeforeInput","beforeinput",null,t,u),h.push({event:u,listeners:c}),u.data=P))}ZC(h,e)})}function da(n,e,t){return{instance:n,listener:e,currentTarget:t}}function cc(n,e){for(var t=e+"Capture",r=[];n!==null;){var i=n,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Xo(n,t),s!=null&&r.unshift(da(n,s,i)),s=Xo(n,e),s!=null&&r.push(da(n,s,i))),n=n.return}return r}function Rs(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function tS(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=Xo(t,s),l!=null&&o.unshift(da(t,l,a))):i||(l=Xo(t,s),l!=null&&o.push(da(t,l,a)))),t=t.return}o.length!==0&&n.push({event:e,listeners:o})}var o6=/\r\n?/g,a6=/\u0000|\uFFFD/g;function nS(n){return(typeof n=="string"?n:""+n).replace(o6,`
445
+ `).replace(a6,"")}function uc(n,e,t){if(e=nS(e),nS(n)!==e&&t)throw Error(D(425))}function hc(){}var Ff=null,qf=null;function Vf(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 Gf=typeof setTimeout=="function"?setTimeout:void 0,l6=typeof clearTimeout=="function"?clearTimeout:void 0,rS=typeof Promise=="function"?Promise:void 0,c6=typeof queueMicrotask=="function"?queueMicrotask:typeof rS!="undefined"?function(n){return rS.resolve(null).then(n).catch(u6)}:Gf;function u6(n){setTimeout(function(){throw n})}function Hf(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),ra(e);return}r--}else t!=="$"&&t!=="$?"&&t!=="$!"||r++;t=i}while(t);ra(e)}function Hr(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 iS(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 js=Math.random().toString(36).slice(2),zn="__reactFiber$"+js,ga="__reactProps$"+js,ar="__reactContainer$"+js,Uf="__reactEvents$"+js,h6="__reactListeners$"+js,f6="__reactHandles$"+js;function Pi(n){var e=n[zn];if(e)return e;for(var t=n.parentNode;t;){if(e=t[ar]||t[zn]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=iS(n);n!==null;){if(t=n[zn])return t;n=iS(n)}return e}n=t,t=n.parentNode}return null}function pa(n){return n=n[zn]||n[ar],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function Ds(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(D(33))}function fc(n){return n[ga]||null}var Wf=[],Bs=-1;function Ur(n){return{current:n}}function Ne(n){0>Bs||(n.current=Wf[Bs],Wf[Bs]=null,Bs--)}function Oe(n,e){Bs++,Wf[Bs]=n.current,n.current=e}var Wr={},Ct=Ur(Wr),Rt=Ur(!1),Ei=Wr;function $s(n,e){var t=n.type.contextTypes;if(!t)return Wr;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 jt(n){return n=n.childContextTypes,n!=null}function dc(){Ne(Rt),Ne(Ct)}function sS(n,e,t){if(Ct.current!==Wr)throw Error(D(168));Oe(Ct,e),Oe(Rt,t)}function oS(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(D(108,Kq(n)||"Unknown",i));return je({},t,r)}function gc(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Wr,Ei=Ct.current,Oe(Ct,n),Oe(Rt,Rt.current),!0}function aS(n,e,t){var r=n.stateNode;if(!r)throw Error(D(169));t?(n=oS(n,e,Ei),r.__reactInternalMemoizedMergedChildContext=n,Ne(Rt),Ne(Ct),Oe(Ct,n)):Ne(Rt),Oe(Rt,t)}var lr=null,pc=!1,Xf=!1;function lS(n){lr===null?lr=[n]:lr.push(n)}function d6(n){pc=!0,lS(n)}function Xr(){if(!Xf&&lr!==null){Xf=!0;var n=0,e=be;try{var t=lr;for(be=1;n<t.length;n++){var r=t[n];do r=r(!0);while(r!==null)}lr=null,pc=!1}catch(i){throw lr!==null&&(lr=lr.slice(n+1)),uC(mf,Xr),i}finally{be=e,Xf=!1}}return null}var zs=[],Fs=0,mc=null,yc=0,sn=[],on=0,Ai=null,cr=1,ur="";function Ti(n,e){zs[Fs++]=yc,zs[Fs++]=mc,mc=n,yc=e}function cS(n,e,t){sn[on++]=cr,sn[on++]=ur,sn[on++]=Ai,Ai=n;var r=cr;n=ur;var i=32-wn(r)-1;r&=~(1<<i),t+=1;var s=32-wn(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,cr=1<<32-wn(e)+i|t<<i|r,ur=s+n}else cr=1<<s|t<<i|r,ur=n}function Yf(n){n.return!==null&&(Ti(n,1),cS(n,1,0))}function Kf(n){for(;n===mc;)mc=zs[--Fs],zs[Fs]=null,yc=zs[--Fs],zs[Fs]=null;for(;n===Ai;)Ai=sn[--on],sn[on]=null,ur=sn[--on],sn[on]=null,cr=sn[--on],sn[on]=null}var Ht=null,Ut=null,ke=!1,Cn=null;function uS(n,e){var t=un(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 hS(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,Ht=n,Ut=Hr(e.firstChild),!0):!1;case 6:return e=n.pendingProps===""||e.nodeType!==3?null:e,e!==null?(n.stateNode=e,Ht=n,Ut=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=Ai!==null?{id:cr,overflow:ur}:null,n.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=un(18,null,null,0),t.stateNode=e,t.return=n,n.child=t,Ht=n,Ut=null,!0):!1;default:return!1}}function Jf(n){return(n.mode&1)!==0&&(n.flags&128)===0}function Qf(n){if(ke){var e=Ut;if(e){var t=e;if(!hS(n,e)){if(Jf(n))throw Error(D(418));e=Hr(t.nextSibling);var r=Ht;e&&hS(n,e)?uS(r,t):(n.flags=n.flags&-4097|2,ke=!1,Ht=n)}}else{if(Jf(n))throw Error(D(418));n.flags=n.flags&-4097|2,ke=!1,Ht=n}}}function fS(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;Ht=n}function vc(n){if(n!==Ht)return!1;if(!ke)return fS(n),ke=!0,!1;var e;if((e=n.tag!==3)&&!(e=n.tag!==5)&&(e=n.type,e=e!=="head"&&e!=="body"&&!Vf(n.type,n.memoizedProps)),e&&(e=Ut)){if(Jf(n))throw dS(),Error(D(418));for(;e;)uS(n,e),e=Hr(e.nextSibling)}if(fS(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(D(317));e:{for(n=n.nextSibling,e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"){if(e===0){Ut=Hr(n.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}n=n.nextSibling}Ut=null}}else Ut=Ht?Hr(n.stateNode.nextSibling):null;return!0}function dS(){for(var n=Ut;n;)n=Hr(n.nextSibling)}function qs(){Ut=Ht=null,ke=!1}function Zf(n){Cn===null?Cn=[n]:Cn.push(n)}var g6=or.ReactCurrentBatchConfig;function Sn(n,e){if(n&&n.defaultProps){e=je({},e),n=n.defaultProps;for(var t in n)e[t]===void 0&&(e[t]=n[t]);return e}return e}var bc=Ur(null),wc=null,Vs=null,ed=null;function td(){ed=Vs=wc=null}function nd(n){var e=bc.current;Ne(bc),n._currentValue=e}function rd(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 Gs(n,e){wc=n,ed=Vs=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(Dt=!0),n.firstContext=null)}function an(n){var e=n._currentValue;if(ed!==n)if(n={context:n,memoizedValue:e,next:null},Vs===null){if(wc===null)throw Error(D(308));Vs=n,wc.dependencies={lanes:0,firstContext:n}}else Vs=Vs.next=n;return e}var Oi=null;function id(n){Oi===null?Oi=[n]:Oi.push(n)}function gS(n,e,t,r){var i=e.interleaved;return i===null?(t.next=t,id(e)):(t.next=i.next,i.next=t),e.interleaved=t,hr(n,r)}function hr(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 Yr=!1;function sd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function pS(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 fr(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function Kr(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,hr(n,t)}return i=r.interleaved,i===null?(e.next=e,id(r)):(e.next=i.next,i.next=e),r.interleaved=e,hr(n,t)}function xc(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,bf(n,t)}}function mS(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 Cc(n,e,t,r){var i=n.updateQueue;Yr=!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=je({},h,f);break e;case 2:Yr=!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);Ni|=o,n.lanes=o,n.memoizedState=h}}function yS(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(D(191,i));i.call(r)}}}var vS=new Lx.Component().refs;function od(n,e,t,r){e=n.memoizedState,t=t(r,e),t=t==null?e:je({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var Sc={isMounted:function(n){return(n=n._reactInternals)?Si(n)===n:!1},enqueueSetState:function(n,e,t){n=n._reactInternals;var r=kt(),i=ei(n),s=fr(r,i);s.payload=e,t!=null&&(s.callback=t),e=Kr(n,s,i),e!==null&&(An(e,n,i,r),xc(e,n,i))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var r=kt(),i=ei(n),s=fr(r,i);s.tag=1,s.payload=e,t!=null&&(s.callback=t),e=Kr(n,s,i),e!==null&&(An(e,n,i,r),xc(e,n,i))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=kt(),r=ei(n),i=fr(t,r);i.tag=2,e!=null&&(i.callback=e),e=Kr(n,i,r),e!==null&&(An(e,n,r,t),xc(e,n,r))}};function bS(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 wS(n,e,t){var r=!1,i=Wr,s=e.contextType;return typeof s=="object"&&s!==null?s=an(s):(i=jt(e)?Ei:Ct.current,r=e.contextTypes,s=(r=r!=null)?$s(n,i):Wr),e=new e(t,s),n.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Sc,n.stateNode=e,e._reactInternals=n,r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=i,n.__reactInternalMemoizedMaskedChildContext=s),e}function xS(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&&Sc.enqueueReplaceState(e,e.state,null)}function ad(n,e,t,r){var i=n.stateNode;i.props=t,i.state=n.memoizedState,i.refs=vS,sd(n);var s=e.contextType;typeof s=="object"&&s!==null?i.context=an(s):(s=jt(e)?Ei:Ct.current,i.context=$s(n,s)),i.state=n.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(od(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&&Sc.enqueueReplaceState(i,i.state,null),Cc(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(D(309));var r=t.stateNode}if(!r)throw Error(D(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===vS&&(a=i.refs={}),o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof n!="string")throw Error(D(284));if(!t._owner)throw Error(D(290,n))}return n}function Pc(n,e){throw n=Object.prototype.toString.call(e),Error(D(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n))}function CS(n){var e=n._init;return e(n._payload)}function SS(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=ni(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=Gd(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===As?u(m,y,v.props.children,w,v.key):y!==null&&(y.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Dr&&CS(x)===y.type)?(w=i(y,v.props),w.ref=ma(m,y,v),w.return=m,w):(w=Vc(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=Hd(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=Ri(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=Gd(""+y,m.mode,v),y.return=m,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case zl:return v=Vc(y.type,y.key,y.props,null,m.mode,v),v.ref=ma(m,null,y),v.return=m,v;case Es:return y=Hd(y,m.mode,v),y.return=m,y;case Dr:var w=y._init;return h(m,w(y._payload),v)}if(Ho(y)||Vo(y))return y=Ri(y,m.mode,v,null),y.return=m,y;Pc(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 zl:return v.key===x?l(m,y,v,w):null;case Es:return v.key===x?c(m,y,v,w):null;case Dr:return x=v._init,f(m,y,x(v._payload),w)}if(Ho(v)||Vo(v))return x!==null?null:u(m,y,v,w,null);Pc(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 zl:return m=m.get(w.key===null?v:w.key)||null,l(y,m,w,x);case Es: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(Ho(w)||Vo(w))return m=m.get(v)||null,u(y,m,w,x,null);Pc(y,w)}return null}function g(m,y,v,w){for(var x=null,C=null,P=y,E=y=0,A=null;P!==null&&E<v.length;E++){P.index>E?(A=P,P=null):A=P.sibling;var O=f(m,P,v[E],w);if(O===null){P===null&&(P=A);break}n&&P&&O.alternate===null&&e(m,P),y=s(O,y,E),C===null?x=O:C.sibling=O,C=O,P=A}if(E===v.length)return t(m,P),ke&&Ti(m,E),x;if(P===null){for(;E<v.length;E++)P=h(m,v[E],w),P!==null&&(y=s(P,y,E),C===null?x=P:C.sibling=P,C=P);return ke&&Ti(m,E),x}for(P=r(m,P);E<v.length;E++)A=d(P,m,E,v[E],w),A!==null&&(n&&A.alternate!==null&&P.delete(A.key===null?E:A.key),y=s(A,y,E),C===null?x=A:C.sibling=A,C=A);return n&&P.forEach(function(T){return e(m,T)}),ke&&Ti(m,E),x}function p(m,y,v,w){var x=Vo(v);if(typeof x!="function")throw Error(D(150));if(v=x.call(v),v==null)throw Error(D(151));for(var C=x=null,P=y,E=y=0,A=null,O=v.next();P!==null&&!O.done;E++,O=v.next()){P.index>E?(A=P,P=null):A=P.sibling;var T=f(m,P,O.value,w);if(T===null){P===null&&(P=A);break}n&&P&&T.alternate===null&&e(m,P),y=s(T,y,E),C===null?x=T:C.sibling=T,C=T,P=A}if(O.done)return t(m,P),ke&&Ti(m,E),x;if(P===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 ke&&Ti(m,E),x}for(P=r(m,P);!O.done;E++,O=v.next())O=d(P,m,E,O.value,w),O!==null&&(n&&O.alternate!==null&&P.delete(O.key===null?E:O.key),y=s(O,y,E),C===null?x=O:C.sibling=O,C=O);return n&&P.forEach(function(L){return e(m,L)}),ke&&Ti(m,E),x}function b(m,y,v,w){if(typeof v=="object"&&v!==null&&v.type===As&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case zl:e:{for(var x=v.key,C=y;C!==null;){if(C.key===x){if(x=v.type,x===As){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&&CS(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===As?(y=Ri(v.props.children,m.mode,w,v.key),y.return=m,m=y):(w=Vc(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 Es: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=Hd(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(Ho(v))return g(m,y,v,w);if(Vo(v))return p(m,y,v,w);Pc(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=Gd(v,m.mode,w),y.return=m,m=y),o(m)):t(m,y)}return b}var Hs=SS(!0),PS=SS(!1),ya={},Fn=Ur(ya),va=Ur(ya),ba=Ur(ya);function Mi(n){if(n===ya)throw Error(D(174));return n}function ld(n,e){switch(Oe(ba,e),Oe(va,n),Oe(Fn,ya),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:af(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=af(e,n)}Ne(Fn),Oe(Fn,e)}function Us(){Ne(Fn),Ne(va),Ne(ba)}function ES(n){Mi(ba.current);var e=Mi(Fn.current),t=af(e,n.type);e!==t&&(Oe(va,n),Oe(Fn,t))}function cd(n){va.current===n&&(Ne(Fn),Ne(va))}var De=Ur(0);function Ec(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 ud=[];function hd(){for(var n=0;n<ud.length;n++)ud[n]._workInProgressVersionPrimary=null;ud.length=0}var Ac=or.ReactCurrentDispatcher,fd=or.ReactCurrentBatchConfig,_i=0,Be=null,st=null,ht=null,Tc=!1,wa=!1,xa=0,p6=0;function St(){throw Error(D(321))}function dd(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!xn(n[t],e[t]))return!1;return!0}function gd(n,e,t,r,i,s){if(_i=s,Be=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Ac.current=n===null||n.memoizedState===null?b6:w6,n=t(r,i),wa){s=0;do{if(wa=!1,xa=0,25<=s)throw Error(D(301));s+=1,ht=st=null,e.updateQueue=null,Ac.current=x6,n=t(r,i)}while(wa)}if(Ac.current=_c,e=st!==null&&st.next!==null,_i=0,ht=st=Be=null,Tc=!1,e)throw Error(D(300));return n}function pd(){var n=xa!==0;return xa=0,n}function qn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ht===null?Be.memoizedState=ht=n:ht=ht.next=n,ht}function ln(){if(st===null){var n=Be.alternate;n=n!==null?n.memoizedState:null}else n=st.next;var e=ht===null?Be.memoizedState:ht.next;if(e!==null)ht=e,st=n;else{if(n===null)throw Error(D(310));st=n,n={memoizedState:st.memoizedState,baseState:st.baseState,baseQueue:st.baseQueue,queue:st.queue,next:null},ht===null?Be.memoizedState=ht=n:ht=ht.next=n}return ht}function Ca(n,e){return typeof e=="function"?e(n):e}function md(n){var e=ln(),t=e.queue;if(t===null)throw Error(D(311));t.lastRenderedReducer=n;var r=st,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((_i&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,Be.lanes|=u,Ni|=u}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,xn(r,e.memoizedState)||(Dt=!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,Be.lanes|=s,Ni|=s,i=i.next;while(i!==n)}else i===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function yd(n){var e=ln(),t=e.queue;if(t===null)throw Error(D(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);xn(s,e.memoizedState)||(Dt=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),t.lastRenderedState=s}return[s,r]}function AS(){}function TS(n,e){var t=Be,r=ln(),i=e(),s=!xn(r.memoizedState,i);if(s&&(r.memoizedState=i,Dt=!0),r=r.queue,vd(_S.bind(null,t,r,n),[n]),r.getSnapshot!==e||s||ht!==null&&ht.memoizedState.tag&1){if(t.flags|=2048,Sa(9,MS.bind(null,t,r,i,e),void 0,null),ft===null)throw Error(D(349));_i&30||OS(t,e,i)}return i}function OS(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=Be.updateQueue,e===null?(e={lastEffect:null,stores:null},Be.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function MS(n,e,t,r){e.value=t,e.getSnapshot=r,NS(e)&&kS(n)}function _S(n,e,t){return t(function(){NS(e)&&kS(n)})}function NS(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!xn(n,t)}catch(r){return!0}}function kS(n){var e=hr(n,1);e!==null&&An(e,n,1,-1)}function IS(n){var e=qn();return typeof n=="function"&&(n=n()),e.memoizedState=e.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ca,lastRenderedState:n},e.queue=n,n=n.dispatch=v6.bind(null,Be,n),[e.memoizedState,n]}function Sa(n,e,t,r){return n={tag:n,create:e,destroy:t,deps:r,next:null},e=Be.updateQueue,e===null?(e={lastEffect:null,stores:null},Be.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 LS(){return ln().memoizedState}function Oc(n,e,t,r){var i=qn();Be.flags|=n,i.memoizedState=Sa(1|e,t,void 0,r===void 0?null:r)}function Mc(n,e,t,r){var i=ln();r=r===void 0?null:r;var s=void 0;if(st!==null){var o=st.memoizedState;if(s=o.destroy,r!==null&&dd(r,o.deps)){i.memoizedState=Sa(e,t,s,r);return}}Be.flags|=n,i.memoizedState=Sa(1|e,t,s,r)}function RS(n,e){return Oc(8390656,8,n,e)}function vd(n,e){return Mc(2048,8,n,e)}function jS(n,e){return Mc(4,2,n,e)}function DS(n,e){return Mc(4,4,n,e)}function BS(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 $S(n,e,t){return t=t!=null?t.concat([n]):null,Mc(4,4,BS.bind(null,e,n),t)}function bd(){}function zS(n,e){var t=ln();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&dd(e,r[1])?r[0]:(t.memoizedState=[n,e],n)}function FS(n,e){var t=ln();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&dd(e,r[1])?r[0]:(n=n(),t.memoizedState=[n,e],n)}function qS(n,e,t){return _i&21?(xn(t,e)||(t=gC(),Be.lanes|=t,Ni|=t,n.baseState=!0),e):(n.baseState&&(n.baseState=!1,Dt=!0),n.memoizedState=t)}function m6(n,e){var t=be;be=t!==0&&4>t?t:4,n(!0);var r=fd.transition;fd.transition={};try{n(!1),e()}finally{be=t,fd.transition=r}}function VS(){return ln().memoizedState}function y6(n,e,t){var r=ei(n);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},GS(n))HS(e,t);else if(t=gS(n,e,t,r),t!==null){var i=kt();An(t,n,r,i),US(t,e,r)}}function v6(n,e,t){var r=ei(n),i={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(GS(n))HS(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,xn(a,o)){var l=e.interleaved;l===null?(i.next=i,id(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch(c){}finally{}t=gS(n,e,i,r),t!==null&&(i=kt(),An(t,n,r,i),US(t,e,r))}}function GS(n){var e=n.alternate;return n===Be||e!==null&&e===Be}function HS(n,e){wa=Tc=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function US(n,e,t){if(t&4194240){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,bf(n,t)}}var _c={readContext:an,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},b6={readContext:an,useCallback:function(n,e){return qn().memoizedState=[n,e===void 0?null:e],n},useContext:an,useEffect:RS,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Oc(4194308,4,BS.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Oc(4194308,4,n,e)},useInsertionEffect:function(n,e){return Oc(4,2,n,e)},useMemo:function(n,e){var t=qn();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var r=qn();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=y6.bind(null,Be,n),[r.memoizedState,n]},useRef:function(n){var e=qn();return n={current:n},e.memoizedState=n},useState:IS,useDebugValue:bd,useDeferredValue:function(n){return qn().memoizedState=n},useTransition:function(){var n=IS(!1),e=n[0];return n=m6.bind(null,n[1]),qn().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var r=Be,i=qn();if(ke){if(t===void 0)throw Error(D(407));t=t()}else{if(t=e(),ft===null)throw Error(D(349));_i&30||OS(r,e,t)}i.memoizedState=t;var s={value:t,getSnapshot:e};return i.queue=s,RS(_S.bind(null,r,s,n),[n]),r.flags|=2048,Sa(9,MS.bind(null,r,s,t,e),void 0,null),t},useId:function(){var n=qn(),e=ft.identifierPrefix;if(ke){var t=ur,r=cr;t=(r&~(1<<32-wn(r)-1)).toString(32)+t,e=":"+e+"R"+t,t=xa++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=p6++,e=":"+e+"r"+t.toString(32)+":";return n.memoizedState=e},unstable_isNewReconciler:!1},w6={readContext:an,useCallback:zS,useContext:an,useEffect:vd,useImperativeHandle:$S,useInsertionEffect:jS,useLayoutEffect:DS,useMemo:FS,useReducer:md,useRef:LS,useState:function(){return md(Ca)},useDebugValue:bd,useDeferredValue:function(n){var e=ln();return qS(e,st.memoizedState,n)},useTransition:function(){var n=md(Ca)[0],e=ln().memoizedState;return[n,e]},useMutableSource:AS,useSyncExternalStore:TS,useId:VS,unstable_isNewReconciler:!1},x6={readContext:an,useCallback:zS,useContext:an,useEffect:vd,useImperativeHandle:$S,useInsertionEffect:jS,useLayoutEffect:DS,useMemo:FS,useReducer:yd,useRef:LS,useState:function(){return yd(Ca)},useDebugValue:bd,useDeferredValue:function(n){var e=ln();return st===null?e.memoizedState=n:qS(e,st.memoizedState,n)},useTransition:function(){var n=yd(Ca)[0],e=ln().memoizedState;return[n,e]},useMutableSource:AS,useSyncExternalStore:TS,useId:VS,unstable_isNewReconciler:!1};function Ws(n,e){try{var t="",r=e;do t+=Yq(r),r=r.return;while(r);var i=t}catch(s){i=`
446
+ Error generating stack: `+s.message+`
447
+ `+s.stack}return{value:n,source:e,stack:i,digest:null}}function wd(n,e,t){return{value:n,source:null,stack:t!=null?t:null,digest:e!=null?e:null}}function xd(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var C6=typeof WeakMap=="function"?WeakMap:Map;function WS(n,e,t){t=fr(-1,t),t.tag=3,t.payload={element:null};var r=e.value;return t.callback=function(){Dc||(Dc=!0,jd=r),xd(n,e)},t}function XS(n,e,t){t=fr(-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(){xd(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){xd(n,e),typeof r!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function YS(n,e,t){var r=n.pingCache;if(r===null){r=n.pingCache=new C6;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=j6.bind(null,n,e,t),e.then(n,n))}function KS(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 JS(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=fr(-1,1),e.tag=2,Kr(t,e,1))),t.lanes|=1),n)}var S6=or.ReactCurrentOwner,Dt=!1;function Nt(n,e,t,r){e.child=n===null?PS(e,null,t,r):Hs(e,n.child,t,r)}function QS(n,e,t,r,i){t=t.render;var s=e.ref;return Gs(e,i),r=gd(n,e,t,r,s,i),t=pd(),n!==null&&!Dt?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,dr(n,e,i)):(ke&&t&&Yf(e),e.flags|=1,Nt(n,e,r,i),e.child)}function ZS(n,e,t,r,i){if(n===null){var s=t.type;return typeof s=="function"&&!Vd(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,eP(n,e,s,r,i)):(n=Vc(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 dr(n,e,i)}return e.flags|=1,n=ni(s,r),n.ref=e.ref,n.return=e,e.child=n}function eP(n,e,t,r,i){if(n!==null){var s=n.memoizedProps;if(ca(s,r)&&n.ref===e.ref)if(Dt=!1,e.pendingProps=r=s,(n.lanes&i)!==0)n.flags&131072&&(Dt=!0);else return e.lanes=n.lanes,dr(n,e,i)}return Cd(n,e,t,r,i)}function tP(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},Oe(Ys,Wt),Wt|=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,Oe(Ys,Wt),Wt|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:t,Oe(Ys,Wt),Wt|=r}else s!==null?(r=s.baseLanes|t,e.memoizedState=null):r=t,Oe(Ys,Wt),Wt|=r;return Nt(n,e,i,t),e.child}function nP(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function Cd(n,e,t,r,i){var s=jt(t)?Ei:Ct.current;return s=$s(e,s),Gs(e,i),t=gd(n,e,t,r,s,i),r=pd(),n!==null&&!Dt?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,dr(n,e,i)):(ke&&r&&Yf(e),e.flags|=1,Nt(n,e,t,i),e.child)}function rP(n,e,t,r,i){if(jt(t)){var s=!0;gc(e)}else s=!1;if(Gs(e,i),e.stateNode===null)kc(n,e),wS(e,t,r),ad(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=an(c):(c=jt(t)?Ei:Ct.current,c=$s(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)&&xS(e,o,r,c),Yr=!1;var f=e.memoizedState;o.state=f,Cc(e,r,o,i),l=e.memoizedState,a!==r||f!==l||Rt.current||Yr?(typeof u=="function"&&(od(e,t,u,r),l=e.memoizedState),(a=Yr||bS(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,pS(n,e),a=e.memoizedProps,c=e.type===e.elementType?a:Sn(e.type,a),o.props=c,h=e.pendingProps,f=o.context,l=t.contextType,typeof l=="object"&&l!==null?l=an(l):(l=jt(t)?Ei:Ct.current,l=$s(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)&&xS(e,o,r,l),Yr=!1,f=e.memoizedState,o.state=f,Cc(e,r,o,i);var g=e.memoizedState;a!==h||f!==g||Rt.current||Yr?(typeof d=="function"&&(od(e,t,d,r),g=e.memoizedState),(c=Yr||bS(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 Sd(n,e,t,r,s,i)}function Sd(n,e,t,r,i,s){nP(n,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&aS(e,t,!1),dr(n,e,s);r=e.stateNode,S6.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,n!==null&&o?(e.child=Hs(e,n.child,null,s),e.child=Hs(e,null,a,s)):Nt(n,e,a,s),e.memoizedState=r.state,i&&aS(e,t,!0),e.child}function iP(n){var e=n.stateNode;e.pendingContext?sS(n,e.pendingContext,e.pendingContext!==e.context):e.context&&sS(n,e.context,!1),ld(n,e.containerInfo)}function sP(n,e,t,r,i){return qs(),Zf(i),e.flags|=256,Nt(n,e,t,r),e.child}var Pd={dehydrated:null,treeContext:null,retryLane:0};function Ed(n){return{baseLanes:n,cachePool:null,transitions:null}}function oP(n,e,t){var r=e.pendingProps,i=De.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),Oe(De,i&1),n===null)return Qf(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=Gc(o,r,0,null),n=Ri(n,r,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=Ed(t),e.memoizedState=Pd,n):Ad(e,o));if(i=n.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return P6(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=ni(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=ni(a,s):(s=Ri(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?Ed(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=n.childLanes&~t,e.memoizedState=Pd,r}return s=n.child,n=s.sibling,r=ni(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 Ad(n,e){return e=Gc({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function Nc(n,e,t,r){return r!==null&&Zf(r),Hs(e,n.child,null,t),n=Ad(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function P6(n,e,t,r,i,s,o){if(t)return e.flags&256?(e.flags&=-257,r=wd(Error(D(422))),Nc(n,e,o,r)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=Gc({mode:"visible",children:r.children},i,0,null),s=Ri(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&Hs(e,n.child,null,o),e.child.memoizedState=Ed(o),e.memoizedState=Pd,s);if(!(e.mode&1))return Nc(n,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(D(419)),r=wd(s,r,void 0),Nc(n,e,o,r)}if(a=(o&n.childLanes)!==0,Dt||a){if(r=ft,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,hr(n,i),An(r,n,i,-1))}return qd(),r=wd(Error(D(421))),Nc(n,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=n.child,e=D6.bind(null,n),i._reactRetry=e,null):(n=s.treeContext,Ut=Hr(i.nextSibling),Ht=e,ke=!0,Cn=null,n!==null&&(sn[on++]=cr,sn[on++]=ur,sn[on++]=Ai,cr=n.id,ur=n.overflow,Ai=e),e=Ad(e,r.children),e.flags|=4096,e)}function aP(n,e,t){n.lanes|=e;var r=n.alternate;r!==null&&(r.lanes|=e),rd(n.return,e,t)}function Td(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 lP(n,e,t){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(Nt(n,e,r.children,t),r=De.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&&aP(n,t,e);else if(n.tag===19)aP(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(Oe(De,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&&Ec(n)===null&&(i=t),t=t.sibling;t=i,t===null?(i=e.child,e.child=null):(i=t.sibling,t.sibling=null),Td(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&&Ec(n)===null){e.child=i;break}n=i.sibling,i.sibling=t,t=i,i=n}Td(e,!0,t,null,s);break;case"together":Td(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function kc(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function dr(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),Ni|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(D(153));if(e.child!==null){for(n=e.child,t=ni(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=ni(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function E6(n,e,t){switch(e.tag){case 3:iP(e),qs();break;case 5:ES(e);break;case 1:jt(e.type)&&gc(e);break;case 4:ld(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;Oe(bc,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Oe(De,De.current&1),e.flags|=128,null):t&e.child.childLanes?oP(n,e,t):(Oe(De,De.current&1),n=dr(n,e,t),n!==null?n.sibling:null);Oe(De,De.current&1);break;case 19:if(r=(t&e.childLanes)!==0,n.flags&128){if(r)return lP(n,e,t);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Oe(De,De.current),r)break;return null;case 22:case 23:return e.lanes=0,tP(n,e,t)}return dr(n,e,t)}var cP,Od,uP,hP;cP=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}},Od=function(){},uP=function(n,e,t,r){var i=n.memoizedProps;if(i!==r){n=e.stateNode,Mi(Fn.current);var s=null;switch(t){case"input":i=nf(n,i),r=nf(n,r),s=[];break;case"select":i=je({},i,{value:void 0}),r=je({},r,{value:void 0}),s=[];break;case"textarea":i=of(n,i),r=of(n,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(n.onclick=hc)}lf(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"&&(qo.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"&&(qo.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&_e("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)}},hP=function(n,e,t,r){t!==r&&(e.flags|=4)};function Pa(n,e){if(!ke)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 A6(n,e,t){var r=e.pendingProps;switch(Kf(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 jt(e.type)&&dc(),Pt(e),null;case 3:return r=e.stateNode,Us(),Ne(Rt),Ne(Ct),hd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(n===null||n.child===null)&&(vc(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Cn!==null&&($d(Cn),Cn=null))),Od(n,e),Pt(e),null;case 5:cd(e);var i=Mi(ba.current);if(t=e.type,n!==null&&e.stateNode!=null)uP(n,e,t,r,i),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(D(166));return Pt(e),null}if(n=Mi(Fn.current),vc(e)){r=e.stateNode,t=e.type;var s=e.memoizedProps;switch(r[zn]=e,r[ga]=s,n=(e.mode&1)!==0,t){case"dialog":_e("cancel",r),_e("close",r);break;case"iframe":case"object":case"embed":_e("load",r);break;case"video":case"audio":for(i=0;i<ha.length;i++)_e(ha[i],r);break;case"source":_e("error",r);break;case"img":case"image":case"link":_e("error",r),_e("load",r);break;case"details":_e("toggle",r);break;case"input":Gx(r,s),_e("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},_e("invalid",r);break;case"textarea":Wx(r,s),_e("invalid",r)}lf(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&&uc(r.textContent,a,n),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&uc(r.textContent,a,n),i=["children",""+a]):qo.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&_e("scroll",r)}switch(t){case"input":Fl(r),Ux(r,s,!0);break;case"textarea":Fl(r),Yx(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=hc)}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=Kx(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[zn]=e,n[ga]=r,cP(n,e,!1,!1),e.stateNode=n;e:{switch(o=cf(t,r),t){case"dialog":_e("cancel",n),_e("close",n),i=r;break;case"iframe":case"object":case"embed":_e("load",n),i=r;break;case"video":case"audio":for(i=0;i<ha.length;i++)_e(ha[i],n);i=r;break;case"source":_e("error",n),i=r;break;case"img":case"image":case"link":_e("error",n),_e("load",n),i=r;break;case"details":_e("toggle",n),i=r;break;case"input":Gx(n,r),i=nf(n,r),_e("invalid",n);break;case"option":i=r;break;case"select":n._wrapperState={wasMultiple:!!r.multiple},i=je({},r,{value:void 0}),_e("invalid",n);break;case"textarea":Wx(n,r),i=of(n,r),_e("invalid",n);break;default:i=r}lf(t,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?Zx(n,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Jx(n,l)):s==="children"?typeof l=="string"?(t!=="textarea"||l!=="")&&Uo(n,l):typeof l=="number"&&Uo(n,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(qo.hasOwnProperty(s)?l!=null&&s==="onScroll"&&_e("scroll",n):l!=null&&Hh(n,s,l,o))}switch(t){case"input":Fl(n),Ux(n,r,!1);break;case"textarea":Fl(n),Yx(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?Ts(n,!!r.multiple,s,!1):r.defaultValue!=null&&Ts(n,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(n.onclick=hc)}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)hP(n,e,n.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(D(166));if(t=Mi(ba.current),Mi(Fn.current),vc(e)){if(r=e.stateNode,t=e.memoizedProps,r[zn]=e,(s=r.nodeValue!==t)&&(n=Ht,n!==null))switch(n.tag){case 3:uc(r.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&uc(r.nodeValue,t,(n.mode&1)!==0)}s&&(e.flags|=4)}else r=(t.nodeType===9?t:t.ownerDocument).createTextNode(r),r[zn]=e,e.stateNode=r}return Pt(e),null;case 13:if(Ne(De),r=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(ke&&Ut!==null&&e.mode&1&&!(e.flags&128))dS(),qs(),e.flags|=98560,s=!1;else if(s=vc(e),r!==null&&r.dehydrated!==null){if(n===null){if(!s)throw Error(D(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(D(317));s[zn]=e}else qs(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Pt(e),s=!1}else Cn!==null&&($d(Cn),Cn=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||De.current&1?ot===0&&(ot=3):qd())),e.updateQueue!==null&&(e.flags|=4),Pt(e),null);case 4:return Us(),Od(n,e),n===null&&fa(e.stateNode.containerInfo),Pt(e),null;case 10:return nd(e.type._context),Pt(e),null;case 17:return jt(e.type)&&dc(),Pt(e),null;case 19:if(Ne(De),s=e.memoizedState,s===null)return Pt(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)Pa(s,!1);else{if(ot!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(o=Ec(n),o!==null){for(e.flags|=128,Pa(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 Oe(De,De.current&1|2),e.child}n=n.sibling}s.tail!==null&&Ke()>Ks&&(e.flags|=128,r=!0,Pa(s,!1),e.lanes=4194304)}else{if(!r)if(n=Ec(o),n!==null){if(e.flags|=128,r=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Pa(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!ke)return Pt(e),null}else 2*Ke()-s.renderingStartTime>Ks&&t!==1073741824&&(e.flags|=128,r=!0,Pa(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=Ke(),e.sibling=null,t=De.current,Oe(De,r?t&1|2:t&1),e):(Pt(e),null);case 22:case 23:return Fd(),r=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Wt&1073741824&&(Pt(e),e.subtreeFlags&6&&(e.flags|=8192)):Pt(e),null;case 24:return null;case 25:return null}throw Error(D(156,e.tag))}function T6(n,e){switch(Kf(e),e.tag){case 1:return jt(e.type)&&dc(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Us(),Ne(Rt),Ne(Ct),hd(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return cd(e),null;case 13:if(Ne(De),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(D(340));qs()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Ne(De),null;case 4:return Us(),null;case 10:return nd(e.type._context),null;case 22:case 23:return Fd(),null;case 24:return null;default:return null}}var Ic=!1,Et=!1,O6=typeof WeakSet=="function"?WeakSet:Set,U=null;function Xs(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){Ge(n,e,r)}else t.current=null}function Md(n,e,t){try{t()}catch(r){Ge(n,e,r)}}var fP=!1;function M6(n,e){if(Ff=Zl,n=VC(),If(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(qf={focusedElem:n,selectionRange:t},Zl=!1,U=e;U!==null;)if(e=U,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,U=n;else for(;U!==null;){e=U;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:Sn(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(D(163))}}catch(w){Ge(e,e.return,w)}if(n=e.sibling,n!==null){n.return=e.return,U=n;break}U=e.return}return g=fP,fP=!1,g}function Ea(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&&Md(e,t,s)}i=i.next}while(i!==r)}}function Lc(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 _d(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 dP(n){var e=n.alternate;e!==null&&(n.alternate=null,dP(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[zn],delete e[ga],delete e[Uf],delete e[h6],delete e[f6])),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 gP(n){return n.tag===5||n.tag===3||n.tag===4}function pP(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||gP(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 Nd(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=hc));else if(r!==4&&(n=n.child,n!==null))for(Nd(n,e,t),n=n.sibling;n!==null;)Nd(n,e,t),n=n.sibling}function kd(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(kd(n,e,t),n=n.sibling;n!==null;)kd(n,e,t),n=n.sibling}var yt=null,Pn=!1;function Jr(n,e,t){for(t=t.child;t!==null;)mP(n,e,t),t=t.sibling}function mP(n,e,t){if($n&&typeof $n.onCommitFiberUnmount=="function")try{$n.onCommitFiberUnmount(Wl,t)}catch(a){}switch(t.tag){case 5:Et||Xs(t,e);case 6:var r=yt,i=Pn;yt=null,Jr(n,e,t),yt=r,Pn=i,yt!==null&&(Pn?(n=yt,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):yt.removeChild(t.stateNode));break;case 18:yt!==null&&(Pn?(n=yt,t=t.stateNode,n.nodeType===8?Hf(n.parentNode,t):n.nodeType===1&&Hf(n,t),ra(n)):Hf(yt,t.stateNode));break;case 4:r=yt,i=Pn,yt=t.stateNode.containerInfo,Pn=!0,Jr(n,e,t),yt=r,Pn=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)&&Md(t,e,o),i=i.next}while(i!==r)}Jr(n,e,t);break;case 1:if(!Et&&(Xs(t,e),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(a){Ge(t,e,a)}Jr(n,e,t);break;case 21:Jr(n,e,t);break;case 22:t.mode&1?(Et=(r=Et)||t.memoizedState!==null,Jr(n,e,t),Et=r):Jr(n,e,t);break;default:Jr(n,e,t)}}function yP(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new O6),e.forEach(function(r){var i=B6.bind(null,n,r);t.has(r)||(t.add(r),r.then(i,i))})}}function En(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,Pn=!1;break e;case 3:yt=a.stateNode.containerInfo,Pn=!0;break e;case 4:yt=a.stateNode.containerInfo,Pn=!0;break e}a=a.return}if(yt===null)throw Error(D(160));mP(s,o,i),yt=null,Pn=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Ge(i,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)vP(e,n),e=e.sibling}function vP(n,e){var t=n.alternate,r=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(En(e,n),Vn(n),r&4){try{Ea(3,n,n.return),Lc(3,n)}catch(p){Ge(n,n.return,p)}try{Ea(5,n,n.return)}catch(p){Ge(n,n.return,p)}}break;case 1:En(e,n),Vn(n),r&512&&t!==null&&Xs(t,t.return);break;case 5:if(En(e,n),Vn(n),r&512&&t!==null&&Xs(t,t.return),n.flags&32){var i=n.stateNode;try{Uo(i,"")}catch(p){Ge(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&&Hx(i,s),cf(a,o);var c=cf(a,s);for(o=0;o<l.length;o+=2){var u=l[o],h=l[o+1];u==="style"?Zx(i,h):u==="dangerouslySetInnerHTML"?Jx(i,h):u==="children"?Uo(i,h):Hh(i,u,h,c)}switch(a){case"input":rf(i,s);break;case"textarea":Xx(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var d=s.value;d!=null?Ts(i,!!s.multiple,d,!1):f!==!!s.multiple&&(s.defaultValue!=null?Ts(i,!!s.multiple,s.defaultValue,!0):Ts(i,!!s.multiple,s.multiple?[]:"",!1))}i[ga]=s}catch(p){Ge(n,n.return,p)}}break;case 6:if(En(e,n),Vn(n),r&4){if(n.stateNode===null)throw Error(D(162));i=n.stateNode,s=n.memoizedProps;try{i.nodeValue=s}catch(p){Ge(n,n.return,p)}}break;case 3:if(En(e,n),Vn(n),r&4&&t!==null&&t.memoizedState.isDehydrated)try{ra(e.containerInfo)}catch(p){Ge(n,n.return,p)}break;case 4:En(e,n),Vn(n);break;case 13:En(e,n),Vn(n),i=n.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Rd=Ke())),r&4&&yP(n);break;case 22:if(u=t!==null&&t.memoizedState!==null,n.mode&1?(Et=(c=Et)||u,En(e,n),Et=c):En(e,n),Vn(n),r&8192){if(c=n.memoizedState!==null,(n.stateNode.isHidden=c)&&!u&&n.mode&1)for(U=n,u=n.child;u!==null;){for(h=U=u;U!==null;){switch(f=U,d=f.child,f.tag){case 0:case 11:case 14:case 15:Ea(4,f,f.return);break;case 1:Xs(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){Ge(r,t,p)}}break;case 5:Xs(f,f.return);break;case 22:if(f.memoizedState!==null){xP(h);continue}}d!==null?(d.return=f,U=d):xP(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=Qx("display",o))}catch(p){Ge(n,n.return,p)}}}else if(h.tag===6){if(u===null)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(p){Ge(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:En(e,n),Vn(n),r&4&&yP(n);break;case 21:break;default:En(e,n),Vn(n)}}function Vn(n){var e=n.flags;if(e&2){try{e:{for(var t=n.return;t!==null;){if(gP(t)){var r=t;break e}t=t.return}throw Error(D(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Uo(i,""),r.flags&=-33);var s=pP(n);kd(n,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=pP(n);Nd(n,a,o);break;default:throw Error(D(161))}}catch(l){Ge(n,n.return,l)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function _6(n,e,t){U=n,bP(n)}function bP(n,e,t){for(var r=(n.mode&1)!==0;U!==null;){var i=U,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Ic;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Et;a=Ic;var c=Et;if(Ic=o,(Et=l)&&!c)for(U=i;U!==null;)o=U,l=o.child,o.tag===22&&o.memoizedState!==null?CP(i):l!==null?(l.return=o,U=l):CP(i);for(;s!==null;)U=s,bP(s),s=s.sibling;U=i,Ic=a,Et=c}wP(n)}else i.subtreeFlags&8772&&s!==null?(s.return=i,U=s):wP(n)}}function wP(n){for(;U!==null;){var e=U;if(e.flags&8772){var t=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Et||Lc(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:Sn(e.type,t.memoizedProps);r.componentDidUpdate(i,t.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&yS(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}yS(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&&ra(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(D(163))}Et||e.flags&512&&_d(e)}catch(f){Ge(e,e.return,f)}}if(e===n){U=null;break}if(t=e.sibling,t!==null){t.return=e.return,U=t;break}U=e.return}}function xP(n){for(;U!==null;){var e=U;if(e===n){U=null;break}var t=e.sibling;if(t!==null){t.return=e.return,U=t;break}U=e.return}}function CP(n){for(;U!==null;){var e=U;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{Lc(4,e)}catch(l){Ge(e,t,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){Ge(e,i,l)}}var s=e.return;try{_d(e)}catch(l){Ge(e,s,l)}break;case 5:var o=e.return;try{_d(e)}catch(l){Ge(e,o,l)}}}catch(l){Ge(e,e.return,l)}if(e===n){U=null;break}var a=e.sibling;if(a!==null){a.return=e.return,U=a;break}U=e.return}}var N6=Math.ceil,Rc=or.ReactCurrentDispatcher,Id=or.ReactCurrentOwner,cn=or.ReactCurrentBatchConfig,he=0,ft=null,et=null,vt=0,Wt=0,Ys=Ur(0),ot=0,Aa=null,Ni=0,jc=0,Ld=0,Ta=null,Bt=null,Rd=0,Ks=1/0,gr=null,Dc=!1,jd=null,Qr=null,Bc=!1,Zr=null,$c=0,Oa=0,Dd=null,zc=-1,Fc=0;function kt(){return he&6?Ke():zc!==-1?zc:zc=Ke()}function ei(n){return n.mode&1?he&2&&vt!==0?vt&-vt:g6.transition!==null?(Fc===0&&(Fc=gC()),Fc):(n=be,n!==0||(n=window.event,n=n===void 0?16:SC(n.type)),n):1}function An(n,e,t,r){if(50<Oa)throw Oa=0,Dd=null,Error(D(185));Qo(n,t,r),(!(he&2)||n!==ft)&&(n===ft&&(!(he&2)&&(jc|=t),ot===4&&ti(n,vt)),$t(n,r),t===1&&he===0&&!(e.mode&1)&&(Ks=Ke()+500,pc&&Xr()))}function $t(n,e){var t=n.callbackNode;gV(n,e);var r=Kl(n,n===ft?vt:0);if(r===0)t!==null&&hC(t),n.callbackNode=null,n.callbackPriority=0;else if(e=r&-r,n.callbackPriority!==e){if(t!=null&&hC(t),e===1)n.tag===0?d6(PP.bind(null,n)):lS(PP.bind(null,n)),c6(function(){!(he&6)&&Xr()}),t=null;else{switch(pC(r)){case 1:t=mf;break;case 4:t=fC;break;case 16:t=Ul;break;case 536870912:t=dC;break;default:t=Ul}t=kP(t,SP.bind(null,n))}n.callbackPriority=e,n.callbackNode=t}}function SP(n,e){if(zc=-1,Fc=0,he&6)throw Error(D(327));var t=n.callbackNode;if(Js()&&n.callbackNode!==t)return null;var r=Kl(n,n===ft?vt:0);if(r===0)return null;if(r&30||r&n.expiredLanes||e)e=qc(n,r);else{e=r;var i=he;he|=2;var s=AP();(ft!==n||vt!==e)&&(gr=null,Ks=Ke()+500,Ii(n,e));do try{L6();break}catch(a){EP(n,a)}while(1);td(),Rc.current=s,he=i,et!==null?e=0:(ft=null,vt=0,e=ot)}if(e!==0){if(e===2&&(i=yf(n),i!==0&&(r=i,e=Bd(n,i))),e===1)throw t=Aa,Ii(n,0),ti(n,r),$t(n,Ke()),t;if(e===6)ti(n,r);else{if(i=n.current.alternate,!(r&30)&&!k6(i)&&(e=qc(n,r),e===2&&(s=yf(n),s!==0&&(r=s,e=Bd(n,s))),e===1))throw t=Aa,Ii(n,0),ti(n,r),$t(n,Ke()),t;switch(n.finishedWork=i,n.finishedLanes=r,e){case 0:case 1:throw Error(D(345));case 2:Li(n,Bt,gr);break;case 3:if(ti(n,r),(r&130023424)===r&&(e=Rd+500-Ke(),10<e)){if(Kl(n,0)!==0)break;if(i=n.suspendedLanes,(i&r)!==r){kt(),n.pingedLanes|=n.suspendedLanes&i;break}n.timeoutHandle=Gf(Li.bind(null,n,Bt,gr),e);break}Li(n,Bt,gr);break;case 4:if(ti(n,r),(r&4194240)===r)break;for(e=n.eventTimes,i=-1;0<r;){var o=31-wn(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=Ke()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*N6(r/1960))-r,10<r){n.timeoutHandle=Gf(Li.bind(null,n,Bt,gr),r);break}Li(n,Bt,gr);break;case 5:Li(n,Bt,gr);break;default:throw Error(D(329))}}}return $t(n,Ke()),n.callbackNode===t?SP.bind(null,n):null}function Bd(n,e){var t=Ta;return n.current.memoizedState.isDehydrated&&(Ii(n,e).flags|=256),n=qc(n,e),n!==2&&(e=Bt,Bt=t,e!==null&&$d(e)),n}function $d(n){Bt===null?Bt=n:Bt.push.apply(Bt,n)}function k6(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(!xn(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 ti(n,e){for(e&=~Ld,e&=~jc,n.suspendedLanes|=e,n.pingedLanes&=~e,n=n.expirationTimes;0<e;){var t=31-wn(e),r=1<<t;n[t]=-1,e&=~r}}function PP(n){if(he&6)throw Error(D(327));Js();var e=Kl(n,0);if(!(e&1))return $t(n,Ke()),null;var t=qc(n,e);if(n.tag!==0&&t===2){var r=yf(n);r!==0&&(e=r,t=Bd(n,r))}if(t===1)throw t=Aa,Ii(n,0),ti(n,e),$t(n,Ke()),t;if(t===6)throw Error(D(345));return n.finishedWork=n.current.alternate,n.finishedLanes=e,Li(n,Bt,gr),$t(n,Ke()),null}function zd(n,e){var t=he;he|=1;try{return n(e)}finally{he=t,he===0&&(Ks=Ke()+500,pc&&Xr())}}function ki(n){Zr!==null&&Zr.tag===0&&!(he&6)&&Js();var e=he;he|=1;var t=cn.transition,r=be;try{if(cn.transition=null,be=1,n)return n()}finally{be=r,cn.transition=t,he=e,!(he&6)&&Xr()}}function Fd(){Wt=Ys.current,Ne(Ys)}function Ii(n,e){n.finishedWork=null,n.finishedLanes=0;var t=n.timeoutHandle;if(t!==-1&&(n.timeoutHandle=-1,l6(t)),et!==null)for(t=et.return;t!==null;){var r=t;switch(Kf(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&dc();break;case 3:Us(),Ne(Rt),Ne(Ct),hd();break;case 5:cd(r);break;case 4:Us();break;case 13:Ne(De);break;case 19:Ne(De);break;case 10:nd(r.type._context);break;case 22:case 23:Fd()}t=t.return}if(ft=n,et=n=ni(n.current,null),vt=Wt=e,ot=0,Aa=null,Ld=jc=Ni=0,Bt=Ta=null,Oi!==null){for(e=0;e<Oi.length;e++)if(t=Oi[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}Oi=null}return n}function EP(n,e){do{var t=et;try{if(td(),Ac.current=_c,Tc){for(var r=Be.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Tc=!1}if(_i=0,ht=st=Be=null,wa=!1,xa=0,Id.current=null,t===null||t.return===null){ot=1,Aa=e,et=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=KS(o);if(d!==null){d.flags&=-257,JS(d,o,a,s,e),d.mode&1&&YS(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)){YS(s,c,e),qd();break e}l=Error(D(426))}}else if(ke&&a.mode&1){var b=KS(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),JS(b,o,a,s,e),Zf(Ws(l,a));break e}}s=l=Ws(l,a),ot!==4&&(ot=2),Ta===null?Ta=[s]:Ta.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var m=WS(s,l,e);mS(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"&&(Qr===null||!Qr.has(v)))){s.flags|=65536,e&=-e,s.lanes|=e;var w=XS(s,a,e);mS(s,w);break e}}s=s.return}while(s!==null)}OP(t)}catch(x){e=x,et===t&&t!==null&&(et=t=t.return);continue}break}while(1)}function AP(){var n=Rc.current;return Rc.current=_c,n===null?_c:n}function qd(){(ot===0||ot===3||ot===2)&&(ot=4),ft===null||!(Ni&268435455)&&!(jc&268435455)||ti(ft,vt)}function qc(n,e){var t=he;he|=2;var r=AP();(ft!==n||vt!==e)&&(gr=null,Ii(n,e));do try{I6();break}catch(i){EP(n,i)}while(1);if(td(),he=t,Rc.current=r,et!==null)throw Error(D(261));return ft=null,vt=0,ot}function I6(){for(;et!==null;)TP(et)}function L6(){for(;et!==null&&!sV();)TP(et)}function TP(n){var e=NP(n.alternate,n,Wt);n.memoizedProps=n.pendingProps,e===null?OP(n):et=e,Id.current=null}function OP(n){var e=n;do{var t=e.alternate;if(n=e.return,e.flags&32768){if(t=T6(t,e),t!==null){t.flags&=32767,et=t;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{ot=6,et=null;return}}else if(t=A6(t,e,Wt),t!==null){et=t;return}if(e=e.sibling,e!==null){et=e;return}et=e=n}while(e!==null);ot===0&&(ot=5)}function Li(n,e,t){var r=be,i=cn.transition;try{cn.transition=null,be=1,R6(n,e,t,r)}finally{cn.transition=i,be=r}return null}function R6(n,e,t,r){do Js();while(Zr!==null);if(he&6)throw Error(D(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(D(177));n.callbackNode=null,n.callbackPriority=0;var s=t.lanes|t.childLanes;if(pV(n,s),n===ft&&(et=ft=null,vt=0),!(t.subtreeFlags&2064)&&!(t.flags&2064)||Bc||(Bc=!0,kP(Ul,function(){return Js(),null})),s=(t.flags&15990)!==0,t.subtreeFlags&15990||s){s=cn.transition,cn.transition=null;var o=be;be=1;var a=he;he|=4,Id.current=null,M6(n,t),vP(t,n),t6(qf),Zl=!!Ff,qf=Ff=null,n.current=t,_6(t),oV(),he=a,be=o,cn.transition=s}else n.current=t;if(Bc&&(Bc=!1,Zr=n,$c=i),s=n.pendingLanes,s===0&&(Qr=null),cV(t.stateNode),$t(n,Ke()),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(Dc)throw Dc=!1,n=jd,jd=null,n;return $c&1&&n.tag!==0&&Js(),s=n.pendingLanes,s&1?n===Dd?Oa++:(Oa=0,Dd=n):Oa=0,Xr(),null}function Js(){if(Zr!==null){var n=pC($c),e=cn.transition,t=be;try{if(cn.transition=null,be=16>n?16:n,Zr===null)var r=!1;else{if(n=Zr,Zr=null,$c=0,he&6)throw Error(D(331));var i=he;for(he|=4,U=n.current;U!==null;){var s=U,o=s.child;if(U.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(U=c;U!==null;){var u=U;switch(u.tag){case 0:case 11:case 15:Ea(8,u,s)}var h=u.child;if(h!==null)h.return=u,U=h;else for(;U!==null;){u=U;var f=u.sibling,d=u.return;if(dP(u),u===c){U=null;break}if(f!==null){f.return=d,U=f;break}U=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)}}U=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,U=o;else e:for(;U!==null;){if(s=U,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Ea(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,U=m;break e}U=s.return}}var y=n.current;for(U=y;U!==null;){o=U;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,U=v;else e:for(o=y;U!==null;){if(a=U,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Lc(9,a)}}catch(x){Ge(a,a.return,x)}if(a===o){U=null;break e}var w=a.sibling;if(w!==null){w.return=a.return,U=w;break e}U=a.return}}if(he=i,Xr(),$n&&typeof $n.onPostCommitFiberRoot=="function")try{$n.onPostCommitFiberRoot(Wl,n)}catch(x){}r=!0}return r}finally{be=t,cn.transition=e}}return!1}function MP(n,e,t){e=Ws(t,e),e=WS(n,e,1),n=Kr(n,e,1),e=kt(),n!==null&&(Qo(n,1,e),$t(n,e))}function Ge(n,e,t){if(n.tag===3)MP(n,n,t);else for(;e!==null;){if(e.tag===3){MP(e,n,t);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Qr===null||!Qr.has(r))){n=Ws(t,n),n=XS(e,n,1),e=Kr(e,n,1),n=kt(),e!==null&&(Qo(e,1,n),$t(e,n));break}}e=e.return}}function j6(n,e,t){var r=n.pingCache;r!==null&&r.delete(e),e=kt(),n.pingedLanes|=n.suspendedLanes&t,ft===n&&(vt&t)===t&&(ot===4||ot===3&&(vt&130023424)===vt&&500>Ke()-Rd?Ii(n,0):Ld|=t),$t(n,e)}function _P(n,e){e===0&&(n.mode&1?(e=Yl,Yl<<=1,!(Yl&130023424)&&(Yl=4194304)):e=1);var t=kt();n=hr(n,e),n!==null&&(Qo(n,e,t),$t(n,t))}function D6(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),_P(n,t)}function B6(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(D(314))}r!==null&&r.delete(e),_P(n,t)}var NP;NP=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Rt.current)Dt=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Dt=!1,E6(n,e,t);Dt=!!(n.flags&131072)}else Dt=!1,ke&&e.flags&1048576&&cS(e,yc,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;kc(n,e),n=e.pendingProps;var i=$s(e,Ct.current);Gs(e,t),i=gd(null,e,r,n,i,t);var s=pd();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,jt(r)?(s=!0,gc(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,sd(e),i.updater=Sc,e.stateNode=i,i._reactInternals=e,ad(e,r,n,t),e=Sd(null,e,r,!0,s,t)):(e.tag=0,ke&&s&&Yf(e),Nt(null,e,i,t),e=e.child),e;case 16:r=e.elementType;e:{switch(kc(n,e),n=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=z6(r),n=Sn(r,n),i){case 0:e=Cd(null,e,r,n,t);break e;case 1:e=rP(null,e,r,n,t);break e;case 11:e=QS(null,e,r,n,t);break e;case 14:e=ZS(null,e,r,Sn(r.type,n),t);break e}throw Error(D(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Sn(r,i),Cd(n,e,r,i,t);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Sn(r,i),rP(n,e,r,i,t);case 3:e:{if(iP(e),n===null)throw Error(D(387));r=e.pendingProps,s=e.memoizedState,i=s.element,pS(n,e),Cc(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=Ws(Error(D(423)),e),e=sP(n,e,r,t,i);break e}else if(r!==i){i=Ws(Error(D(424)),e),e=sP(n,e,r,t,i);break e}else for(Ut=Hr(e.stateNode.containerInfo.firstChild),Ht=e,ke=!0,Cn=null,t=PS(e,null,r,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(qs(),r===i){e=dr(n,e,t);break e}Nt(n,e,r,t)}e=e.child}return e;case 5:return ES(e),n===null&&Qf(e),r=e.type,i=e.pendingProps,s=n!==null?n.memoizedProps:null,o=i.children,Vf(r,i)?o=null:s!==null&&Vf(r,s)&&(e.flags|=32),nP(n,e),Nt(n,e,o,t),e.child;case 6:return n===null&&Qf(e),null;case 13:return oP(n,e,t);case 4:return ld(e,e.stateNode.containerInfo),r=e.pendingProps,n===null?e.child=Hs(e,null,r,t):Nt(n,e,r,t),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Sn(r,i),QS(n,e,r,i,t);case 7:return Nt(n,e,e.pendingProps,t),e.child;case 8:return Nt(n,e,e.pendingProps.children,t),e.child;case 12:return Nt(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,Oe(bc,r._currentValue),r._currentValue=o,s!==null)if(xn(s.value,o)){if(s.children===i.children&&!Rt.current){e=dr(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=fr(-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),rd(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(D(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),rd(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}Nt(n,e,i.children,t),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Gs(e,t),i=an(i),r=r(i),e.flags|=1,Nt(n,e,r,t),e.child;case 14:return r=e.type,i=Sn(r,e.pendingProps),i=Sn(r.type,i),ZS(n,e,r,i,t);case 15:return eP(n,e,e.type,e.pendingProps,t);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Sn(r,i),kc(n,e),e.tag=1,jt(r)?(n=!0,gc(e)):n=!1,Gs(e,t),wS(e,r,i),ad(e,r,i,t),Sd(null,e,r,!0,n,t);case 19:return lP(n,e,t);case 22:return tP(n,e,t)}throw Error(D(156,e.tag))};function kP(n,e){return uC(n,e)}function $6(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 un(n,e,t,r){return new $6(n,e,t,r)}function Vd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function z6(n){if(typeof n=="function")return Vd(n)?1:0;if(n!=null){if(n=n.$$typeof,n===Xh)return 11;if(n===Jh)return 14}return 2}function ni(n,e){var t=n.alternate;return t===null?(t=un(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 Vc(n,e,t,r,i,s){var o=2;if(r=n,typeof n=="function")Vd(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case As:return Ri(t.children,i,s,e);case Uh:o=8,i|=8;break;case Wh:return n=un(12,t,e,i|2),n.elementType=Wh,n.lanes=s,n;case Yh:return n=un(13,t,e,i),n.elementType=Yh,n.lanes=s,n;case Kh:return n=un(19,t,e,i),n.elementType=Kh,n.lanes=s,n;case zx:return Gc(t,i,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case Bx:o=10;break e;case $x:o=9;break e;case Xh:o=11;break e;case Jh:o=14;break e;case Dr:o=16,r=null;break e}throw Error(D(130,n==null?n:typeof n,""))}return e=un(o,t,e,i),e.elementType=n,e.type=r,e.lanes=s,e}function Ri(n,e,t,r){return n=un(7,n,r,e),n.lanes=t,n}function Gc(n,e,t,r){return n=un(22,n,r,e),n.elementType=zx,n.lanes=t,n.stateNode={isHidden:!1},n}function Gd(n,e,t){return n=un(6,n,null,e),n.lanes=t,n}function Hd(n,e,t){return e=un(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function F6(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=vf(0),this.expirationTimes=vf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vf(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ud(n,e,t,r,i,s,o,a,l){return n=new F6(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=un(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},sd(s),n}function q6(n,e,t){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Es,key:r==null?null:""+r,children:n,containerInfo:e,implementation:t}}function IP(n){if(!n)return Wr;n=n._reactInternals;e:{if(Si(n)!==n||n.tag!==1)throw Error(D(170));var e=n;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(jt(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(D(171))}if(n.tag===1){var t=n.type;if(jt(t))return oS(n,t,e)}return e}function LP(n,e,t,r,i,s,o,a,l){return n=Ud(t,r,!0,n,i,s,o,a,l),n.context=IP(null),t=n.current,r=kt(),i=ei(t),s=fr(r,i),s.callback=e!=null?e:null,Kr(t,s,i),n.current.lanes=i,Qo(n,i,r),$t(n,r),n}function Hc(n,e,t,r){var i=e.current,s=kt(),o=ei(i);return t=IP(t),e.context===null?e.context=t:e.pendingContext=t,e=fr(s,o),e.payload={element:n},r=r===void 0?null:r,r!==null&&(e.callback=r),n=Kr(i,e,o),n!==null&&(An(n,i,o,s),xc(n,i,o)),o}function Uc(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 RP(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}function Wd(n,e){RP(n,e),(n=n.alternate)&&RP(n,e)}function V6(){return null}var jP=typeof reportError=="function"?reportError:function(n){console.error(n)};function Xd(n){this._internalRoot=n}Wc.prototype.render=Xd.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(D(409));Hc(n,e,null,null)},Wc.prototype.unmount=Xd.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;ki(function(){Hc(null,n,null,null)}),e[ar]=null}};function Wc(n){this._internalRoot=n}Wc.prototype.unstable_scheduleHydration=function(n){if(n){var e=vC();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&&xC(n)}};function Yd(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function Xc(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function DP(){}function G6(n,e,t,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Uc(o);s.call(c)}}var o=LP(e,r,n,0,null,!1,!1,"",DP);return n._reactRootContainer=o,n[ar]=o.current,fa(n.nodeType===8?n.parentNode:n),ki(),o}for(;i=n.lastChild;)n.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=Uc(l);a.call(c)}}var l=Ud(n,0,!1,null,null,!1,!1,"",DP);return n._reactRootContainer=l,n[ar]=l.current,fa(n.nodeType===8?n.parentNode:n),ki(function(){Hc(e,l,t,r)}),l}function Yc(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=Uc(o);a.call(l)}}Hc(e,o,n,i)}else o=G6(t,e,n,i,r);return Uc(o)}mC=function(n){switch(n.tag){case 3:var e=n.stateNode;if(e.current.memoizedState.isDehydrated){var t=Jo(e.pendingLanes);t!==0&&(bf(e,t|1),$t(e,Ke()),!(he&6)&&(Ks=Ke()+500,Xr()))}break;case 13:ki(function(){var r=hr(n,1);if(r!==null){var i=kt();An(r,n,1,i)}}),Wd(n,1)}},wf=function(n){if(n.tag===13){var e=hr(n,134217728);if(e!==null){var t=kt();An(e,n,134217728,t)}Wd(n,134217728)}},yC=function(n){if(n.tag===13){var e=ei(n),t=hr(n,e);if(t!==null){var r=kt();An(t,n,e,r)}Wd(n,e)}},vC=function(){return be},bC=function(n,e){var t=be;try{return be=n,e()}finally{be=t}},ff=function(n,e,t){switch(e){case"input":if(rf(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=fc(r);if(!i)throw Error(D(90));Vx(r),rf(r,i)}}}break;case"textarea":Xx(n,t);break;case"select":e=t.value,e!=null&&Ts(n,!!t.multiple,e,!1)}},rC=zd,iC=ki;var H6={usingClientEntryPoint:!1,Events:[pa,Ds,fc,tC,nC,zd]},Ma={findFiberByHostInstance:Pi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},U6={bundleType:Ma.bundleType,version:Ma.version,rendererPackageName:Ma.rendererPackageName,rendererConfig:Ma.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:or.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=lC(n),n===null?null:n.stateNode},findFiberByHostInstance:Ma.findFiberByHostInstance||V6,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 Kc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kc.isDisabled&&Kc.supportsFiber)try{Wl=Kc.inject(U6),$n=Kc}catch(n){}}qt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H6,qt.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Yd(e))throw Error(D(200));return q6(n,e,null,t)},qt.createRoot=function(n,e){if(!Yd(n))throw Error(D(299));var t=!1,r="",i=jP;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Ud(n,1,!1,null,null,t,!1,r,i),n[ar]=e.current,fa(n.nodeType===8?n.parentNode:n),new Xd(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(D(188)):(n=Object.keys(n).join(","),Error(D(268,n)));return n=lC(e),n=n===null?null:n.stateNode,n},qt.flushSync=function(n){return ki(n)},qt.hydrate=function(n,e,t){if(!Xc(e))throw Error(D(200));return Yc(null,n,e,!0,t)},qt.hydrateRoot=function(n,e,t){if(!Yd(n))throw Error(D(405));var r=t!=null&&t.hydratedSources||null,i=!1,s="",o=jP;if(t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),e=LP(e,null,n,1,t!=null?t:null,i,!1,s,o),n[ar]=e.current,fa(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 Wc(e)},qt.render=function(n,e,t){if(!Xc(e))throw Error(D(200));return Yc(null,n,e,!1,t)},qt.unmountComponentAtNode=function(n){if(!Xc(n))throw Error(D(40));return n._reactRootContainer?(ki(function(){Yc(null,null,n,!1,function(){n._reactRootContainer=null,n[ar]=null})}),!0):!1},qt.unstable_batchedUpdates=zd,qt.unstable_renderSubtreeIntoContainer=function(n,e,t,r){if(!Xc(t))throw Error(D(200));if(n==null||n._reactInternals===void 0)throw Error(D(38));return Yc(n,e,t,!1,r)},qt.version="18.2.0-next-9e3b772b8-20220608";function BP(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(BP)}catch(n){console.error(n)}}BP(),Nx.exports=qt;var $P=Nx.exports,zP,FP=$P;zP=FP.createRoot,FP.hydrateRoot;var Qs;(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]=W.useReducer(r,[]);return t=c,W.createElement(W.Fragment,{children:l.map(u=>u.portal)})}}n.getProvider=a})(Qs||(Qs={}));var W6=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 Kd={};function X6(n){const{shape:e,component:t,effect:r,inherit:i}=n,s=W6(n,["shape","component","effect","inherit"]);if(!e)throw new Error("should specify shape in config");Kd[e]={component:t,effect:r},G.registerNode(e,Object.assign({inherit:i||"react-shape"},s),!0)}class Y6 extends W.PureComponent{constructor(e){super(e),this.state={tick:0}}componentDidMount(){const{node:e}=this.props;e.on("change:*",({key:t})=>{const r=Kd[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"?W.cloneElement(e):W.cloneElement(e,{node:t,graph:r})}render(){const{node:e}=this.props,t=Kd[e.shape];if(!t)return null;const{component:r}=t;if(W.isValidElement(r))return this.clone(r);const i=r;return this.clone(W.createElement(i,null))}}class Jc extends It{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,Jc.action,()=>{this.renderReactComponent()})}renderReactComponent(){this.unmountReactComponent();const e=this.getComponentContainer(),t=this.cell;if(e){const r=W.createElement(Y6,{node:t,graph:this.graph});if(Qs.isActive()){const i=$P.createPortal(r,e);Qs.connect(this.targetId(),i)}else this.root=zP(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 Qs.isActive()&&Qs.disconnect(this.targetId()),this.unmountReactComponent(),super.unmount(),this}}(function(n){n.action="react",n.config({bootstrap:[n.action],actions:{component:n.action}}),It.registry.register("react-shape-view",n,!0)})(Jc||(Jc={}));function Jd(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 Qd,qP;function K6(){if(qP)return Qd;qP=1;function n(){this.__data__=[],this.size=0}return Qd=n,Qd}var Zd,VP;function Zs(){if(VP)return Zd;VP=1;function n(e,t){return e===t||e!==e&&t!==t}return Zd=n,Zd}var eg,GP;function Qc(){if(GP)return eg;GP=1;var n=Zs();function e(t,r){for(var i=t.length;i--;)if(n(t[i][0],r))return i;return-1}return eg=e,eg}var tg,HP;function J6(){if(HP)return tg;HP=1;var n=Qc(),e=Array.prototype,t=e.splice;function r(i){var s=this.__data__,o=n(s,i);if(o<0)return!1;var a=s.length-1;return o==a?s.pop():t.call(s,o,1),--this.size,!0}return tg=r,tg}var ng,UP;function Q6(){if(UP)return ng;UP=1;var n=Qc();function e(t){var r=this.__data__,i=n(r,t);return i<0?void 0:r[i][1]}return ng=e,ng}var rg,WP;function Z6(){if(WP)return rg;WP=1;var n=Qc();function e(t){return n(this.__data__,t)>-1}return rg=e,rg}var ig,XP;function e4(){if(XP)return ig;XP=1;var n=Qc();function e(t,r){var i=this.__data__,s=n(i,t);return s<0?(++this.size,i.push([t,r])):i[s][1]=r,this}return ig=e,ig}var sg,YP;function Zc(){if(YP)return sg;YP=1;var n=K6(),e=J6(),t=Q6(),r=Z6(),i=e4();function s(o){var a=-1,l=o==null?0:o.length;for(this.clear();++a<l;){var c=o[a];this.set(c[0],c[1])}}return s.prototype.clear=n,s.prototype.delete=e,s.prototype.get=t,s.prototype.has=r,s.prototype.set=i,sg=s,sg}var og,KP;function t4(){if(KP)return og;KP=1;var n=Zc();function e(){this.__data__=new n,this.size=0}return og=e,og}var ag,JP;function n4(){if(JP)return ag;JP=1;function n(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}return ag=n,ag}var lg,QP;function r4(){if(QP)return lg;QP=1;function n(e){return this.__data__.get(e)}return lg=n,lg}var cg,ZP;function i4(){if(ZP)return cg;ZP=1;function n(e){return this.__data__.has(e)}return cg=n,cg}var ug,eE;function tE(){if(eE)return ug;eE=1;var n=typeof $l=="object"&&$l&&$l.Object===Object&&$l;return ug=n,ug}var hg,nE;function Tn(){if(nE)return hg;nE=1;var n=tE(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=n||e||Function("return this")();return hg=t,hg}var fg,rE;function eo(){if(rE)return fg;rE=1;var n=Tn(),e=n.Symbol;return fg=e,fg}var dg,iE;function s4(){if(iE)return dg;iE=1;var n=eo(),e=Object.prototype,t=e.hasOwnProperty,r=e.toString,i=n?n.toStringTag:void 0;function s(o){var a=t.call(o,i),l=o[i];try{o[i]=void 0;var c=!0}catch(h){}var u=r.call(o);return c&&(a?o[i]=l:delete o[i]),u}return dg=s,dg}var gg,sE;function o4(){if(sE)return gg;sE=1;var n=Object.prototype,e=n.toString;function t(r){return e.call(r)}return gg=t,gg}var pg,oE;function ji(){if(oE)return pg;oE=1;var n=eo(),e=s4(),t=o4(),r="[object Null]",i="[object Undefined]",s=n?n.toStringTag:void 0;function o(a){return a==null?a===void 0?i:r:s&&s in Object(a)?e(a):t(a)}return pg=o,pg}var mg,aE;function hn(){if(aE)return mg;aE=1;function n(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return mg=n,mg}var yg,lE;function _a(){if(lE)return yg;lE=1;var n=ji(),e=hn(),t="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",s="[object Proxy]";function o(a){if(!e(a))return!1;var l=n(a);return l==r||l==i||l==t||l==s}return yg=o,yg}var vg,cE;function a4(){if(cE)return vg;cE=1;var n=Tn(),e=n["__core-js_shared__"];return vg=e,vg}var bg,uE;function l4(){if(uE)return bg;uE=1;var n=a4(),e=function(){var r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function t(r){return!!e&&e in r}return bg=t,bg}var wg,hE;function fE(){if(hE)return wg;hE=1;var n=Function.prototype,e=n.toString;function t(r){if(r!=null){try{return e.call(r)}catch(i){}try{return r+""}catch(i){}}return""}return wg=t,wg}var xg,dE;function c4(){if(dE)return xg;dE=1;var n=_a(),e=l4(),t=hn(),r=fE(),i=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,o=Function.prototype,a=Object.prototype,l=o.toString,c=a.hasOwnProperty,u=RegExp("^"+l.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(f){if(!t(f)||e(f))return!1;var d=n(f)?u:s;return d.test(r(f))}return xg=h,xg}var Cg,gE;function u4(){if(gE)return Cg;gE=1;function n(e,t){return e==null?void 0:e[t]}return Cg=n,Cg}var Sg,pE;function Di(){if(pE)return Sg;pE=1;var n=c4(),e=u4();function t(r,i){var s=e(r,i);return n(s)?s:void 0}return Sg=t,Sg}var Pg,mE;function Eg(){if(mE)return Pg;mE=1;var n=Di(),e=Tn(),t=n(e,"Map");return Pg=t,Pg}var Ag,yE;function eu(){if(yE)return Ag;yE=1;var n=Di(),e=n(Object,"create");return Ag=e,Ag}var Tg,vE;function h4(){if(vE)return Tg;vE=1;var n=eu();function e(){this.__data__=n?n(null):{},this.size=0}return Tg=e,Tg}var Og,bE;function f4(){if(bE)return Og;bE=1;function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return Og=n,Og}var Mg,wE;function d4(){if(wE)return Mg;wE=1;var n=eu(),e="__lodash_hash_undefined__",t=Object.prototype,r=t.hasOwnProperty;function i(s){var o=this.__data__;if(n){var a=o[s];return a===e?void 0:a}return r.call(o,s)?o[s]:void 0}return Mg=i,Mg}var _g,xE;function g4(){if(xE)return _g;xE=1;var n=eu(),e=Object.prototype,t=e.hasOwnProperty;function r(i){var s=this.__data__;return n?s[i]!==void 0:t.call(s,i)}return _g=r,_g}var Ng,CE;function p4(){if(CE)return Ng;CE=1;var n=eu(),e="__lodash_hash_undefined__";function t(r,i){var s=this.__data__;return this.size+=this.has(r)?0:1,s[r]=n&&i===void 0?e:i,this}return Ng=t,Ng}var kg,SE;function m4(){if(SE)return kg;SE=1;var n=h4(),e=f4(),t=d4(),r=g4(),i=p4();function s(o){var a=-1,l=o==null?0:o.length;for(this.clear();++a<l;){var c=o[a];this.set(c[0],c[1])}}return s.prototype.clear=n,s.prototype.delete=e,s.prototype.get=t,s.prototype.has=r,s.prototype.set=i,kg=s,kg}var Ig,PE;function y4(){if(PE)return Ig;PE=1;var n=m4(),e=Zc(),t=Eg();function r(){this.size=0,this.__data__={hash:new n,map:new(t||e),string:new n}}return Ig=r,Ig}var Lg,EE;function v4(){if(EE)return Lg;EE=1;function n(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Lg=n,Lg}var Rg,AE;function tu(){if(AE)return Rg;AE=1;var n=v4();function e(t,r){var i=t.__data__;return n(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Rg=e,Rg}var jg,TE;function b4(){if(TE)return jg;TE=1;var n=tu();function e(t){var r=n(this,t).delete(t);return this.size-=r?1:0,r}return jg=e,jg}var Dg,OE;function w4(){if(OE)return Dg;OE=1;var n=tu();function e(t){return n(this,t).get(t)}return Dg=e,Dg}var Bg,ME;function x4(){if(ME)return Bg;ME=1;var n=tu();function e(t){return n(this,t).has(t)}return Bg=e,Bg}var $g,_E;function C4(){if(_E)return $g;_E=1;var n=tu();function e(t,r){var i=n(this,t),s=i.size;return i.set(t,r),this.size+=i.size==s?0:1,this}return $g=e,$g}var zg,NE;function Fg(){if(NE)return zg;NE=1;var n=y4(),e=b4(),t=w4(),r=x4(),i=C4();function s(o){var a=-1,l=o==null?0:o.length;for(this.clear();++a<l;){var c=o[a];this.set(c[0],c[1])}}return s.prototype.clear=n,s.prototype.delete=e,s.prototype.get=t,s.prototype.has=r,s.prototype.set=i,zg=s,zg}var qg,kE;function S4(){if(kE)return qg;kE=1;var n=Zc(),e=Eg(),t=Fg(),r=200;function i(s,o){var a=this.__data__;if(a instanceof n){var l=a.__data__;if(!e||l.length<r-1)return l.push([s,o]),this.size=++a.size,this;a=this.__data__=new t(l)}return a.set(s,o),this.size=a.size,this}return qg=i,qg}var Vg,IE;function nu(){if(IE)return Vg;IE=1;var n=Zc(),e=t4(),t=n4(),r=r4(),i=i4(),s=S4();function o(a){var l=this.__data__=new n(a);this.size=l.size}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=r,o.prototype.has=i,o.prototype.set=s,Vg=o,Vg}var Gg,LE;function Hg(){if(LE)return Gg;LE=1;function n(e,t){for(var r=-1,i=e==null?0:e.length;++r<i&&t(e[r],r,e)!==!1;);return e}return Gg=n,Gg}var Ug,RE;function jE(){if(RE)return Ug;RE=1;var n=Di(),e=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(r){}}();return Ug=e,Ug}var Wg,DE;function ru(){if(DE)return Wg;DE=1;var n=jE();function e(t,r,i){r=="__proto__"&&n?n(t,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[r]=i}return Wg=e,Wg}var Xg,BE;function iu(){if(BE)return Xg;BE=1;var n=ru(),e=Zs(),t=Object.prototype,r=t.hasOwnProperty;function i(s,o,a){var l=s[o];(!(r.call(s,o)&&e(l,a))||a===void 0&&!(o in s))&&n(s,o,a)}return Xg=i,Xg}var Yg,$E;function Na(){if($E)return Yg;$E=1;var n=iu(),e=ru();function t(r,i,s,o){var a=!s;s||(s={});for(var l=-1,c=i.length;++l<c;){var u=i[l],h=o?o(s[u],r[u],u,s,r):void 0;h===void 0&&(h=r[u]),a?e(s,u,h):n(s,u,h)}return s}return Yg=t,Yg}var Kg,zE;function P4(){if(zE)return Kg;zE=1;function n(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}return Kg=n,Kg}var Jg,FE;function Gn(){if(FE)return Jg;FE=1;function n(e){return e!=null&&typeof e=="object"}return Jg=n,Jg}var Qg,qE;function E4(){if(qE)return Qg;qE=1;var n=ji(),e=Gn(),t="[object Arguments]";function r(i){return e(i)&&n(i)==t}return Qg=r,Qg}var Zg,VE;function ka(){if(VE)return Zg;VE=1;var n=E4(),e=Gn(),t=Object.prototype,r=t.hasOwnProperty,i=t.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(o){return e(o)&&r.call(o,"callee")&&!i.call(o,"callee")};return Zg=s,Zg}var ep,GE;function tt(){if(GE)return ep;GE=1;var n=Array.isArray;return ep=n,ep}var Ia={exports:{}},tp,HE;function A4(){if(HE)return tp;HE=1;function n(){return!1}return tp=n,tp}Ia.exports;var UE;function to(){return UE||(UE=1,function(n,e){var t=Tn(),r=A4(),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}(Ia,Ia.exports)),Ia.exports}var np,WE;function su(){if(WE)return np;WE=1;var n=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(r,i){var s=typeof r;return i=i==null?n:i,!!i&&(s=="number"||s!="symbol"&&e.test(r))&&r>-1&&r%1==0&&r<i}return np=t,np}var rp,XE;function ip(){if(XE)return rp;XE=1;var n=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=n}return rp=e,rp}var sp,YE;function T4(){if(YE)return sp;YE=1;var n=ji(),e=ip(),t=Gn(),r="[object Arguments]",i="[object Array]",s="[object Boolean]",o="[object Date]",a="[object Error]",l="[object Function]",c="[object Map]",u="[object Number]",h="[object Object]",f="[object RegExp]",d="[object Set]",g="[object String]",p="[object WeakMap]",b="[object ArrayBuffer]",m="[object DataView]",y="[object Float32Array]",v="[object Float64Array]",w="[object Int8Array]",x="[object Int16Array]",C="[object Int32Array]",P="[object Uint8Array]",E="[object Uint8ClampedArray]",A="[object Uint16Array]",O="[object Uint32Array]",T={};T[y]=T[v]=T[w]=T[x]=T[C]=T[P]=T[E]=T[A]=T[O]=!0,T[r]=T[i]=T[b]=T[s]=T[m]=T[o]=T[a]=T[l]=T[c]=T[u]=T[h]=T[f]=T[d]=T[g]=T[p]=!1;function L(V){return t(V)&&e(V.length)&&!!T[n(V)]}return sp=L,sp}var op,KE;function ou(){if(KE)return op;KE=1;function n(e){return function(t){return e(t)}}return op=n,op}var La={exports:{}};La.exports;var JE;function ap(){return JE||(JE=1,function(n,e){var t=tE(),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}(La,La.exports)),La.exports}var lp,QE;function Ra(){if(QE)return lp;QE=1;var n=T4(),e=ou(),t=ap(),r=t&&t.isTypedArray,i=r?e(r):n;return lp=i,lp}var cp,ZE;function eA(){if(ZE)return cp;ZE=1;var n=P4(),e=ka(),t=tt(),r=to(),i=su(),s=Ra(),o=Object.prototype,a=o.hasOwnProperty;function l(c,u){var h=t(c),f=!h&&e(c),d=!h&&!f&&r(c),g=!h&&!f&&!d&&s(c),p=h||f||d||g,b=p?n(c.length,String):[],m=b.length;for(var y in c)(u||a.call(c,y))&&!(p&&(y=="length"||d&&(y=="offset"||y=="parent")||g&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||i(y,m)))&&b.push(y);return b}return cp=l,cp}var up,tA;function au(){if(tA)return up;tA=1;var n=Object.prototype;function e(t){var r=t&&t.constructor,i=typeof r=="function"&&r.prototype||n;return t===i}return up=e,up}var hp,nA;function rA(){if(nA)return hp;nA=1;function n(e,t){return function(r){return e(t(r))}}return hp=n,hp}var fp,iA;function O4(){if(iA)return fp;iA=1;var n=rA(),e=n(Object.keys,Object);return fp=e,fp}var dp,sA;function gp(){if(sA)return dp;sA=1;var n=au(),e=O4(),t=Object.prototype,r=t.hasOwnProperty;function i(s){if(!n(s))return e(s);var o=[];for(var a in Object(s))r.call(s,a)&&a!="constructor"&&o.push(a);return o}return dp=i,dp}var pp,oA;function pr(){if(oA)return pp;oA=1;var n=_a(),e=ip();function t(r){return r!=null&&e(r.length)&&!n(r)}return pp=t,pp}var mp,aA;function ri(){if(aA)return mp;aA=1;var n=eA(),e=gp(),t=pr();function r(i){return t(i)?n(i):e(i)}return mp=r,mp}var yp,lA;function M4(){if(lA)return yp;lA=1;var n=Na(),e=ri();function t(r,i){return r&&n(i,e(i),r)}return yp=t,yp}var vp,cA;function _4(){if(cA)return vp;cA=1;function n(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}return vp=n,vp}var bp,uA;function N4(){if(uA)return bp;uA=1;var n=hn(),e=au(),t=_4(),r=Object.prototype,i=r.hasOwnProperty;function s(o){if(!n(o))return t(o);var a=e(o),l=[];for(var c in o)c=="constructor"&&(a||!i.call(o,c))||l.push(c);return l}return bp=s,bp}var wp,hA;function Bi(){if(hA)return wp;hA=1;var n=eA(),e=N4(),t=pr();function r(i){return t(i)?n(i,!0):e(i)}return wp=r,wp}var xp,fA;function k4(){if(fA)return xp;fA=1;var n=Na(),e=Bi();function t(r,i){return r&&n(i,e(i),r)}return xp=t,xp}var ja={exports:{}};ja.exports;var dA;function gA(){return dA||(dA=1,function(n,e){var t=Tn(),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}(ja,ja.exports)),ja.exports}var Cp,pA;function mA(){if(pA)return Cp;pA=1;function n(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}return Cp=n,Cp}var Sp,yA;function vA(){if(yA)return Sp;yA=1;function n(e,t){for(var r=-1,i=e==null?0:e.length,s=0,o=[];++r<i;){var a=e[r];t(a,r,e)&&(o[s++]=a)}return o}return Sp=n,Sp}var Pp,bA;function wA(){if(bA)return Pp;bA=1;function n(){return[]}return Pp=n,Pp}var Ep,xA;function Ap(){if(xA)return Ep;xA=1;var n=vA(),e=wA(),t=Object.prototype,r=t.propertyIsEnumerable,i=Object.getOwnPropertySymbols,s=i?function(o){return o==null?[]:(o=Object(o),n(i(o),function(a){return r.call(o,a)}))}:e;return Ep=s,Ep}var Tp,CA;function I4(){if(CA)return Tp;CA=1;var n=Na(),e=Ap();function t(r,i){return n(r,e(r),i)}return Tp=t,Tp}var Op,SA;function Mp(){if(SA)return Op;SA=1;function n(e,t){for(var r=-1,i=t.length,s=e.length;++r<i;)e[s+r]=t[r];return e}return Op=n,Op}var _p,PA;function lu(){if(PA)return _p;PA=1;var n=rA(),e=n(Object.getPrototypeOf,Object);return _p=e,_p}var Np,EA;function AA(){if(EA)return Np;EA=1;var n=Mp(),e=lu(),t=Ap(),r=wA(),i=Object.getOwnPropertySymbols,s=i?function(o){for(var a=[];o;)n(a,t(o)),o=e(o);return a}:r;return Np=s,Np}var kp,TA;function L4(){if(TA)return kp;TA=1;var n=Na(),e=AA();function t(r,i){return n(r,e(r),i)}return kp=t,kp}var Ip,OA;function MA(){if(OA)return Ip;OA=1;var n=Mp(),e=tt();function t(r,i,s){var o=i(r);return e(r)?o:n(o,s(r))}return Ip=t,Ip}var Lp,_A;function NA(){if(_A)return Lp;_A=1;var n=MA(),e=Ap(),t=ri();function r(i){return n(i,t,e)}return Lp=r,Lp}var Rp,kA;function R4(){if(kA)return Rp;kA=1;var n=MA(),e=AA(),t=Bi();function r(i){return n(i,t,e)}return Rp=r,Rp}var jp,IA;function j4(){if(IA)return jp;IA=1;var n=Di(),e=Tn(),t=n(e,"DataView");return jp=t,jp}var Dp,LA;function D4(){if(LA)return Dp;LA=1;var n=Di(),e=Tn(),t=n(e,"Promise");return Dp=t,Dp}var Bp,RA;function jA(){if(RA)return Bp;RA=1;var n=Di(),e=Tn(),t=n(e,"Set");return Bp=t,Bp}var $p,DA;function B4(){if(DA)return $p;DA=1;var n=Di(),e=Tn(),t=n(e,"WeakMap");return $p=t,$p}var zp,BA;function no(){if(BA)return zp;BA=1;var n=j4(),e=Eg(),t=D4(),r=jA(),i=B4(),s=ji(),o=fE(),a="[object Map]",l="[object Object]",c="[object Promise]",u="[object Set]",h="[object WeakMap]",f="[object DataView]",d=o(n),g=o(e),p=o(t),b=o(r),m=o(i),y=s;return(n&&y(new n(new ArrayBuffer(1)))!=f||e&&y(new e)!=a||t&&y(t.resolve())!=c||r&&y(new r)!=u||i&&y(new i)!=h)&&(y=function(v){var w=s(v),x=w==l?v.constructor:void 0,C=x?o(x):"";if(C)switch(C){case d:return f;case g:return a;case p:return c;case b:return u;case m:return h}return w}),zp=y,zp}var Fp,$A;function $4(){if($A)return Fp;$A=1;var n=Object.prototype,e=n.hasOwnProperty;function t(r){var i=r.length,s=new r.constructor(i);return i&&typeof r[0]=="string"&&e.call(r,"index")&&(s.index=r.index,s.input=r.input),s}return Fp=t,Fp}var qp,zA;function FA(){if(zA)return qp;zA=1;var n=Tn(),e=n.Uint8Array;return qp=e,qp}var Vp,qA;function Gp(){if(qA)return Vp;qA=1;var n=FA();function e(t){var r=new t.constructor(t.byteLength);return new n(r).set(new n(t)),r}return Vp=e,Vp}var Hp,VA;function z4(){if(VA)return Hp;VA=1;var n=Gp();function e(t,r){var i=r?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}return Hp=e,Hp}var Up,GA;function F4(){if(GA)return Up;GA=1;var n=/\w*$/;function e(t){var r=new t.constructor(t.source,n.exec(t));return r.lastIndex=t.lastIndex,r}return Up=e,Up}var Wp,HA;function q4(){if(HA)return Wp;HA=1;var n=eo(),e=n?n.prototype:void 0,t=e?e.valueOf:void 0;function r(i){return t?Object(t.call(i)):{}}return Wp=r,Wp}var Xp,UA;function WA(){if(UA)return Xp;UA=1;var n=Gp();function e(t,r){var i=r?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}return Xp=e,Xp}var Yp,XA;function V4(){if(XA)return Yp;XA=1;var n=Gp(),e=z4(),t=F4(),r=q4(),i=WA(),s="[object Boolean]",o="[object Date]",a="[object Map]",l="[object Number]",c="[object RegExp]",u="[object Set]",h="[object String]",f="[object Symbol]",d="[object ArrayBuffer]",g="[object DataView]",p="[object Float32Array]",b="[object Float64Array]",m="[object Int8Array]",y="[object Int16Array]",v="[object Int32Array]",w="[object Uint8Array]",x="[object Uint8ClampedArray]",C="[object Uint16Array]",P="[object Uint32Array]";function E(A,O,T){var L=A.constructor;switch(O){case d:return n(A);case s:case o:return new L(+A);case g:return e(A,T);case p:case b:case m:case y:case v:case w:case x:case C:case P:return i(A,T);case a:return new L;case l:case h:return new L(A);case c:return t(A);case u:return new L;case f:return r(A)}}return Yp=E,Yp}var Kp,YA;function KA(){if(YA)return Kp;YA=1;var n=hn(),e=Object.create,t=function(){function r(){}return function(i){if(!n(i))return{};if(e)return e(i);r.prototype=i;var s=new r;return r.prototype=void 0,s}}();return Kp=t,Kp}var Jp,JA;function QA(){if(JA)return Jp;JA=1;var n=KA(),e=lu(),t=au();function r(i){return typeof i.constructor=="function"&&!t(i)?n(e(i)):{}}return Jp=r,Jp}var Qp,ZA;function G4(){if(ZA)return Qp;ZA=1;var n=no(),e=Gn(),t="[object Map]";function r(i){return e(i)&&n(i)==t}return Qp=r,Qp}var Zp,eT;function H4(){if(eT)return Zp;eT=1;var n=G4(),e=ou(),t=ap(),r=t&&t.isMap,i=r?e(r):n;return Zp=i,Zp}var em,tT;function U4(){if(tT)return em;tT=1;var n=no(),e=Gn(),t="[object Set]";function r(i){return e(i)&&n(i)==t}return em=r,em}var tm,nT;function W4(){if(nT)return tm;nT=1;var n=U4(),e=ou(),t=ap(),r=t&&t.isSet,i=r?e(r):n;return tm=i,tm}var nm,rT;function iT(){if(rT)return nm;rT=1;var n=nu(),e=Hg(),t=iu(),r=M4(),i=k4(),s=gA(),o=mA(),a=I4(),l=L4(),c=NA(),u=R4(),h=no(),f=$4(),d=V4(),g=QA(),p=tt(),b=to(),m=H4(),y=hn(),v=W4(),w=ri(),x=Bi(),C=1,P=2,E=4,A="[object Arguments]",O="[object Array]",T="[object Boolean]",L="[object Date]",V="[object Error]",Y="[object Function]",M="[object GeneratorFunction]",I="[object Map]",J="[object Number]",j="[object Object]",F="[object RegExp]",H="[object Set]",ne="[object String]",Pe="[object Symbol]",Yt="[object WeakMap]",N="[object ArrayBuffer]",$="[object DataView]",z="[object Float32Array]",X="[object Float64Array]",re="[object Int8Array]",ue="[object Int16Array]",Ce="[object Int32Array]",we="[object Uint8Array]",$e="[object Uint8ClampedArray]",Le="[object Uint16Array]",Tt="[object Uint32Array]",ae={};ae[A]=ae[O]=ae[N]=ae[$]=ae[T]=ae[L]=ae[z]=ae[X]=ae[re]=ae[ue]=ae[Ce]=ae[I]=ae[J]=ae[j]=ae[F]=ae[H]=ae[ne]=ae[Pe]=ae[we]=ae[$e]=ae[Le]=ae[Tt]=!0,ae[V]=ae[Y]=ae[Yt]=!1;function dt(fe,dn,_n,w0,Ot,Mt){var Je,Un=dn&C,Au=dn&P,gW=dn&E;if(_n&&(Je=Ot?_n(fe,w0,Ot,Mt):_n(fe)),Je!==void 0)return Je;if(!y(fe))return fe;var A2=p(fe);if(A2){if(Je=f(fe),!Un)return o(fe,Je)}else{var io=h(fe),T2=io==Y||io==M;if(b(fe))return s(fe,Un);if(io==j||io==A||T2&&!Ot){if(Je=Au||T2?{}:g(fe),!Un)return Au?l(fe,i(Je,fe)):a(fe,r(Je,fe))}else{if(!ae[io])return Ot?fe:{};Je=d(fe,io,Un)}}Mt||(Mt=new n);var O2=Mt.get(fe);if(O2)return O2;Mt.set(fe,Je),v(fe)?fe.forEach(function(li){Je.add(dt(li,dn,_n,li,fe,Mt))}):m(fe)&&fe.forEach(function(li,qi){Je.set(qi,dt(li,dn,_n,qi,fe,Mt))});var pW=gW?Au?u:c:Au?x:w,M2=A2?void 0:pW(fe);return e(M2||fe,function(li,qi){M2&&(qi=li,li=fe[qi]),t(Je,qi,dt(li,dn,_n,qi,fe,Mt))}),Je}return nm=dt,nm}var rm,sT;function X4(){if(sT)return rm;sT=1;var n=iT(),e=4;function t(r){return n(r,e)}return rm=t,rm}var im,oT;function sm(){if(oT)return im;oT=1;function n(e){return function(){return e}}return im=n,im}var om,aT;function Y4(){if(aT)return om;aT=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 om=n,om}var am,lT;function lm(){if(lT)return am;lT=1;var n=Y4(),e=n();return am=e,am}var cm,cT;function um(){if(cT)return cm;cT=1;var n=lm(),e=ri();function t(r,i){return r&&n(r,i,e)}return cm=t,cm}var hm,uT;function K4(){if(uT)return hm;uT=1;var n=pr();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 hm=e,hm}var fm,hT;function cu(){if(hT)return fm;hT=1;var n=um(),e=K4(),t=e(n);return fm=t,fm}var dm,fT;function $i(){if(fT)return dm;fT=1;function n(e){return e}return dm=n,dm}var gm,dT;function gT(){if(dT)return gm;dT=1;var n=$i();function e(t){return typeof t=="function"?t:n}return gm=e,gm}var pm,pT;function mT(){if(pT)return pm;pT=1;var n=Hg(),e=cu(),t=gT(),r=tt();function i(s,o){var a=r(s)?n:e;return a(s,t(o))}return pm=i,pm}var mm,yT;function vT(){return yT||(yT=1,mm=mT()),mm}var ym,bT;function J4(){if(bT)return ym;bT=1;var n=cu();function e(t,r){var i=[];return n(t,function(s,o,a){r(s,o,a)&&i.push(s)}),i}return ym=e,ym}var vm,wT;function Q4(){if(wT)return vm;wT=1;var n="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,n),this}return vm=e,vm}var bm,xT;function Z4(){if(xT)return bm;xT=1;function n(e){return this.__data__.has(e)}return bm=n,bm}var wm,CT;function ST(){if(CT)return wm;CT=1;var n=Fg(),e=Q4(),t=Z4();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,wm=r,wm}var xm,PT;function e5(){if(PT)return xm;PT=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 xm=n,xm}var Cm,ET;function AT(){if(ET)return Cm;ET=1;function n(e,t){return e.has(t)}return Cm=n,Cm}var Sm,TT;function OT(){if(TT)return Sm;TT=1;var n=ST(),e=e5(),t=AT(),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(P,E){if(!t(v,E)&&(w===P||u(w,P,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 Sm=s,Sm}var Pm,MT;function t5(){if(MT)return Pm;MT=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i,s){r[++t]=[s,i]}),r}return Pm=n,Pm}var Em,_T;function Am(){if(_T)return Em;_T=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}return Em=n,Em}var Tm,NT;function n5(){if(NT)return Tm;NT=1;var n=eo(),e=FA(),t=Zs(),r=OT(),i=t5(),s=Am(),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,P,E,A,O,T,L){switch(E){case y:if(C.byteLength!=P.byteLength||C.byteOffset!=P.byteOffset)return!1;C=C.buffer,P=P.buffer;case m:return!(C.byteLength!=P.byteLength||!T(new e(C),new e(P)));case l:case c:case f:return t(+C,+P);case u:return C.name==P.name&&C.message==P.message;case d:case p:return C==P+"";case h:var V=i;case g:var Y=A&o;if(V||(V=s),C.size!=P.size&&!Y)return!1;var M=L.get(C);if(M)return M==P;A|=a,L.set(C,P);var I=r(V(C),V(P),A,O,T,L);return L.delete(C),I;case b:if(w)return w.call(C)==w.call(P)}return!1}return Tm=x,Tm}var Om,kT;function r5(){if(kT)return Om;kT=1;var n=NA(),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],P=o[m];if(l)var E=h?l(P,C,m,o,s,u):l(C,P,m,s,o,u);if(!(E===void 0?C===P||c(C,P,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 Om=i,Om}var Mm,IT;function i5(){if(IT)return Mm;IT=1;var n=nu(),e=OT(),t=n5(),r=r5(),i=no(),s=tt(),o=to(),a=Ra(),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),P=x?u:i(p),E=C?u:i(b);P=P==c?h:P,E=E==c?h:E;var A=P==h,O=E==h,T=P==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,P,m,y,v,w);if(!(m&l)){var L=A&&d.call(p,"__wrapped__"),V=O&&d.call(b,"__wrapped__");if(L||V){var Y=L?p.value():p,M=V?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 Mm=g,Mm}var _m,LT;function RT(){if(LT)return _m;LT=1;var n=i5(),e=Gn();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 _m=t,_m}var Nm,jT;function s5(){if(jT)return Nm;jT=1;var n=nu(),e=RT(),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 Nm=i,Nm}var km,DT;function BT(){if(DT)return km;DT=1;var n=hn();function e(t){return t===t&&!n(t)}return km=e,km}var Im,$T;function o5(){if($T)return Im;$T=1;var n=BT(),e=ri();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 Im=t,Im}var Lm,zT;function FT(){if(zT)return Lm;zT=1;function n(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}return Lm=n,Lm}var Rm,qT;function a5(){if(qT)return Rm;qT=1;var n=s5(),e=o5(),t=FT();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 Rm=r,Rm}var jm,VT;function ro(){if(VT)return jm;VT=1;var n=ji(),e=Gn(),t="[object Symbol]";function r(i){return typeof i=="symbol"||e(i)&&n(i)==t}return jm=r,jm}var Dm,GT;function Bm(){if(GT)return Dm;GT=1;var n=tt(),e=ro(),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 Dm=i,Dm}var $m,HT;function l5(){if(HT)return $m;HT=1;var n=Fg(),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,$m=t,$m}var zm,UT;function c5(){if(UT)return zm;UT=1;var n=l5(),e=500;function t(r){var i=n(r,function(o){return s.size===e&&s.clear(),o}),s=i.cache;return i}return zm=t,zm}var Fm,WT;function u5(){if(WT)return Fm;WT=1;var n=c5(),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 Fm=r,Fm}var qm,XT;function uu(){if(XT)return qm;XT=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 qm=n,qm}var Vm,YT;function h5(){if(YT)return Vm;YT=1;var n=eo(),e=uu(),t=tt(),r=ro(),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 Vm=a,Vm}var Gm,KT;function JT(){if(KT)return Gm;KT=1;var n=h5();function e(t){return t==null?"":n(t)}return Gm=e,Gm}var Hm,QT;function hu(){if(QT)return Hm;QT=1;var n=tt(),e=Bm(),t=u5(),r=JT();function i(s,o){return n(s)?s:e(s,o)?[s]:t(r(s))}return Hm=i,Hm}var Um,ZT;function Da(){if(ZT)return Um;ZT=1;var n=ro(),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 Um=t,Um}var Wm,eO;function fu(){if(eO)return Wm;eO=1;var n=hu(),e=Da();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 Wm=t,Wm}var Xm,tO;function f5(){if(tO)return Xm;tO=1;var n=fu();function e(t,r,i){var s=t==null?void 0:n(t,r);return s===void 0?i:s}return Xm=e,Xm}var Ym,nO;function d5(){if(nO)return Ym;nO=1;function n(e,t){return e!=null&&t in Object(e)}return Ym=n,Ym}var Km,rO;function iO(){if(rO)return Km;rO=1;var n=hu(),e=ka(),t=tt(),r=su(),i=ip(),s=Da();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 Km=o,Km}var Jm,sO;function oO(){if(sO)return Jm;sO=1;var n=d5(),e=iO();function t(r,i){return r!=null&&e(r,i,n)}return Jm=t,Jm}var Qm,aO;function g5(){if(aO)return Qm;aO=1;var n=RT(),e=f5(),t=oO(),r=Bm(),i=BT(),s=FT(),o=Da(),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 Qm=c,Qm}var Zm,lO;function cO(){if(lO)return Zm;lO=1;function n(e){return function(t){return t==null?void 0:t[e]}}return Zm=n,Zm}var ey,uO;function p5(){if(uO)return ey;uO=1;var n=fu();function e(t){return function(r){return n(r,t)}}return ey=e,ey}var ty,hO;function m5(){if(hO)return ty;hO=1;var n=cO(),e=p5(),t=Bm(),r=Da();function i(s){return t(s)?n(r(s)):e(s)}return ty=i,ty}var ny,fO;function mr(){if(fO)return ny;fO=1;var n=a5(),e=g5(),t=$i(),r=tt(),i=m5();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 ny=s,ny}var ry,dO;function gO(){if(dO)return ry;dO=1;var n=vA(),e=J4(),t=mr(),r=tt();function i(s,o){var a=r(s)?n:e;return a(s,t(o,3))}return ry=i,ry}var iy,pO;function y5(){if(pO)return iy;pO=1;var n=Object.prototype,e=n.hasOwnProperty;function t(r,i){return r!=null&&e.call(r,i)}return iy=t,iy}var sy,mO;function yO(){if(mO)return sy;mO=1;var n=y5(),e=iO();function t(r,i){return r!=null&&e(r,i,n)}return sy=t,sy}var oy,vO;function v5(){if(vO)return oy;vO=1;var n=gp(),e=no(),t=ka(),r=tt(),i=pr(),s=to(),o=au(),a=Ra(),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 oy=f,oy}var ay,bO;function wO(){if(bO)return ay;bO=1;function n(e){return e===void 0}return ay=n,ay}var ly,xO;function CO(){if(xO)return ly;xO=1;var n=cu(),e=pr();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 ly=t,ly}var cy,SO;function PO(){if(SO)return cy;SO=1;var n=uu(),e=mr(),t=CO(),r=tt();function i(s,o){var a=r(s)?n:t;return a(s,e(o,3))}return cy=i,cy}var uy,EO;function b5(){if(EO)return uy;EO=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 uy=n,uy}var hy,AO;function w5(){if(AO)return hy;AO=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 hy=n,hy}var fy,TO;function OO(){if(TO)return fy;TO=1;var n=b5(),e=cu(),t=mr(),r=w5(),i=tt();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 fy=s,fy}var dy,MO;function x5(){if(MO)return dy;MO=1;var n=ji(),e=tt(),t=Gn(),r="[object String]";function i(s){return typeof s=="string"||!e(s)&&t(s)&&n(s)==r}return dy=i,dy}var gy,_O;function C5(){if(_O)return gy;_O=1;var n=cO(),e=n("length");return gy=e,gy}var py,NO;function S5(){if(NO)return py;NO=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 py=l,py}var my,kO;function P5(){if(kO)return my;kO=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 my=w,my}var yy,IO;function E5(){if(IO)return yy;IO=1;var n=C5(),e=S5(),t=P5();function r(i){return e(i)?t(i):n(i)}return yy=r,yy}var vy,LO;function A5(){if(LO)return vy;LO=1;var n=gp(),e=no(),t=pr(),r=x5(),i=E5(),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 vy=a,vy}var by,RO;function T5(){if(RO)return by;RO=1;var n=Hg(),e=KA(),t=um(),r=mr(),i=lu(),s=tt(),o=to(),a=_a(),l=hn(),c=Ra();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 by=u,by}var wy,jO;function O5(){if(jO)return wy;jO=1;var n=eo(),e=ka(),t=tt(),r=n?n.isConcatSpreadable:void 0;function i(s){return t(s)||e(s)||!!(r&&s&&s[r])}return wy=i,wy}var xy,DO;function Cy(){if(DO)return xy;DO=1;var n=Mp(),e=O5();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 xy=t,xy}var Sy,BO;function M5(){if(BO)return Sy;BO=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 Sy=n,Sy}var Py,$O;function zO(){if($O)return Py;$O=1;var n=M5(),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 Py=t,Py}var Ey,FO;function _5(){if(FO)return Ey;FO=1;var n=sm(),e=jE(),t=$i(),r=e?function(i,s){return e(i,"toString",{configurable:!0,enumerable:!1,value:n(s),writable:!0})}:t;return Ey=r,Ey}var Ay,qO;function N5(){if(qO)return Ay;qO=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 Ay=r,Ay}var Ty,VO;function GO(){if(VO)return Ty;VO=1;var n=_5(),e=N5(),t=e(n);return Ty=t,Ty}var Oy,HO;function du(){if(HO)return Oy;HO=1;var n=$i(),e=zO(),t=GO();function r(i,s){return t(e(i,s,n),i+"")}return Oy=r,Oy}var My,UO;function WO(){if(UO)return My;UO=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 My=n,My}var _y,XO;function k5(){if(XO)return _y;XO=1;function n(e){return e!==e}return _y=n,_y}var Ny,YO;function I5(){if(YO)return Ny;YO=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 Ny=n,Ny}var ky,KO;function L5(){if(KO)return ky;KO=1;var n=WO(),e=k5(),t=I5();function r(i,s,o){return s===s?t(i,s,o):n(i,e,o)}return ky=r,ky}var Iy,JO;function R5(){if(JO)return Iy;JO=1;var n=L5();function e(t,r){var i=t==null?0:t.length;return!!i&&n(t,r,0)>-1}return Iy=e,Iy}var Ly,QO;function j5(){if(QO)return Ly;QO=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 Ly=n,Ly}var Ry,ZO;function D5(){if(ZO)return Ry;ZO=1;function n(){}return Ry=n,Ry}var jy,eM;function B5(){if(eM)return jy;eM=1;var n=jA(),e=D5(),t=Am(),r=1/0,i=n&&1/t(new n([,-0]))[1]==r?function(s){return new n(s)}:e;return jy=i,jy}var Dy,tM;function $5(){if(tM)return Dy;tM=1;var n=ST(),e=R5(),t=j5(),r=AT(),i=B5(),s=Am(),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 Dy=a,Dy}var By,nM;function rM(){if(nM)return By;nM=1;var n=pr(),e=Gn();function t(r){return e(r)&&n(r)}return By=t,By}var $y,iM;function z5(){if(iM)return $y;iM=1;var n=Cy(),e=du(),t=$5(),r=rM(),i=e(function(s){return t(n(s,1,r,!0))});return $y=i,$y}var zy,sM;function F5(){if(sM)return zy;sM=1;var n=uu();function e(t,r){return n(r,function(i){return t[i]})}return zy=e,zy}var Fy,oM;function aM(){if(oM)return Fy;oM=1;var n=F5(),e=ri();function t(r){return r==null?[]:n(r,e(r))}return Fy=t,Fy}var qy,lM;function fn(){if(lM)return qy;lM=1;var n;if(typeof Jd=="function")try{n={clone:X4(),constant:sm(),each:vT(),filter:gO(),has:yO(),isArray:tt(),isEmpty:v5(),isFunction:_a(),isUndefined:wO(),keys:ri(),map:PO(),reduce:OO(),size:A5(),transform:T5(),union:z5(),values:aM()}}catch(e){}return n||(n=window._),qy=n,qy}var Vy,cM;function Gy(){if(cM)return Vy;cM=1;var n=fn();Vy=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 Vy}var Hy,uM;function q5(){return uM||(uM=1,Hy="2.1.8"),Hy}var Uy,hM;function V5(){return hM||(hM=1,Uy={Graph:Gy(),version:q5()}),Uy}var Wy,fM;function G5(){if(fM)return Wy;fM=1;var n=fn(),e=Gy();Wy={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 Wy}var Xy,dM;function H5(){if(dM)return Xy;dM=1;var n=fn();Xy=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 Xy}var Yy,gM;function pM(){if(gM)return Yy;gM=1;var n=fn();Yy=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},Yy}var Ky,mM;function yM(){if(mM)return Ky;mM=1;var n=fn(),e=pM();Ky=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 Ky}var Jy,vM;function U5(){if(vM)return Jy;vM=1;var n=yM(),e=fn();Jy=t;function t(r,i,s){return e.transform(r.nodes(),function(o,a){o[a]=n(r,a,i,s)},{})}return Jy}var Qy,bM;function wM(){if(bM)return Qy;bM=1;var n=fn();Qy=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 Qy}var Zy,xM;function W5(){if(xM)return Zy;xM=1;var n=fn(),e=wM();Zy=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 Zy}var ev,CM;function X5(){if(CM)return ev;CM=1;var n=fn();ev=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 ev}var tv,SM;function PM(){if(SM)return tv;SM=1;var n=fn();tv=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,tv}var nv,EM;function Y5(){if(EM)return nv;EM=1;var n=PM();nv=e;function e(t){try{n(t)}catch(r){if(r instanceof n.CycleException)return!1;throw r}return!0}return nv}var rv,AM;function TM(){if(AM)return rv;AM=1;var n=fn();rv=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 rv}var iv,OM;function K5(){if(OM)return iv;OM=1;var n=TM();iv=e;function e(t,r){return n(t,r,"post")}return iv}var sv,MM;function J5(){if(MM)return sv;MM=1;var n=TM();sv=e;function e(t,r){return n(t,r,"pre")}return sv}var ov,_M;function Q5(){if(_M)return ov;_M=1;var n=fn(),e=Gy(),t=pM();ov=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 ov}var av,NM;function Z5(){return NM||(NM=1,av={components:H5(),dijkstra:yM(),dijkstraAll:U5(),findCycles:W5(),floydWarshall:X5(),isAcyclic:Y5(),postorder:K5(),preorder:J5(),prim:Q5(),tarjan:wM(),topsort:PM()}),av}var lv,kM;function eG(){if(kM)return lv;kM=1;var n=V5();return lv={Graph:n.Graph,json:G5(),alg:Z5(),version:n.version},lv}var gu;if(typeof Jd=="function")try{gu=eG()}catch(n){}gu||(gu=window.graphlib);var On=gu,cv,IM;function tG(){if(IM)return cv;IM=1;var n=iT(),e=1,t=4;function r(i){return n(i,e|t)}return cv=r,cv}var uv,LM;function pu(){if(LM)return uv;LM=1;var n=Zs(),e=pr(),t=su(),r=hn();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 uv=i,uv}var hv,RM;function nG(){if(RM)return hv;RM=1;var n=du(),e=Zs(),t=pu(),r=Bi(),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 hv=o,hv}var fv,jM;function rG(){if(jM)return fv;jM=1;var n=mr(),e=pr(),t=ri();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 fv=r,fv}var dv,DM;function iG(){if(DM)return dv;DM=1;var n=/\s/;function e(t){for(var r=t.length;r--&&n.test(t.charAt(r)););return r}return dv=e,dv}var gv,BM;function sG(){if(BM)return gv;BM=1;var n=iG(),e=/^\s+/;function t(r){return r&&r.slice(0,n(r)+1).replace(e,"")}return gv=t,gv}var pv,$M;function oG(){if($M)return pv;$M=1;var n=sG(),e=hn(),t=ro(),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 pv=l,pv}var mv,zM;function FM(){if(zM)return mv;zM=1;var n=oG(),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 mv=r,mv}var yv,qM;function aG(){if(qM)return yv;qM=1;var n=FM();function e(t){var r=n(t),i=r%1;return r===r?i?r-i:r:0}return yv=e,yv}var vv,VM;function lG(){if(VM)return vv;VM=1;var n=WO(),e=mr(),t=aG(),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 vv=i,vv}var bv,GM;function cG(){if(GM)return bv;GM=1;var n=rG(),e=lG(),t=n(e);return bv=t,bv}var wv,HM;function UM(){if(HM)return wv;HM=1;var n=Cy();function e(t){var r=t==null?0:t.length;return r?n(t,1):[]}return wv=e,wv}var xv,WM;function uG(){if(WM)return xv;WM=1;var n=lm(),e=gT(),t=Bi();function r(i,s){return i==null?i:n(i,e(s),t)}return xv=r,xv}var Cv,XM;function hG(){if(XM)return Cv;XM=1;function n(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return Cv=n,Cv}var Sv,YM;function fG(){if(YM)return Sv;YM=1;var n=ru(),e=um(),t=mr();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 Sv=r,Sv}var Pv,KM;function Ev(){if(KM)return Pv;KM=1;var n=ro();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 Pv=e,Pv}var Av,JM;function dG(){if(JM)return Av;JM=1;function n(e,t){return e>t}return Av=n,Av}var Tv,QM;function gG(){if(QM)return Tv;QM=1;var n=Ev(),e=dG(),t=$i();function r(i){return i&&i.length?n(i,t,e):void 0}return Tv=r,Tv}var Ov,ZM;function e_(){if(ZM)return Ov;ZM=1;var n=ru(),e=Zs();function t(r,i,s){(s!==void 0&&!e(r[i],s)||s===void 0&&!(i in r))&&n(r,i,s)}return Ov=t,Ov}var Mv,t_;function pG(){if(t_)return Mv;t_=1;var n=ji(),e=lu(),t=Gn(),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 Mv=c,Mv}var _v,n_;function r_(){if(n_)return _v;n_=1;function n(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return _v=n,_v}var Nv,i_;function mG(){if(i_)return Nv;i_=1;var n=Na(),e=Bi();function t(r){return n(r,e(r))}return Nv=t,Nv}var kv,s_;function yG(){if(s_)return kv;s_=1;var n=e_(),e=gA(),t=WA(),r=mA(),i=QA(),s=ka(),o=tt(),a=rM(),l=to(),c=_a(),u=hn(),h=pG(),f=Ra(),d=r_(),g=mG();function p(b,m,y,v,w,x,C){var P=d(b,y),E=d(m,y),A=C.get(E);if(A){n(b,y,A);return}var O=x?x(P,E,y+"",b,m,C):void 0,T=O===void 0;if(T){var L=o(E),V=!L&&l(E),Y=!L&&!V&&f(E);O=E,L||V||Y?o(P)?O=P:a(P)?O=r(P):V?(T=!1,O=e(E,!0)):Y?(T=!1,O=t(E,!0)):O=[]:h(E)||s(E)?(O=P,s(P)?O=g(P):(!u(P)||c(P))&&(O=i(E))):T=!1}T&&(C.set(E,O),w(O,E,v,x,C),C.delete(E)),n(b,y,O)}return kv=p,kv}var Iv,o_;function vG(){if(o_)return Iv;o_=1;var n=nu(),e=e_(),t=lm(),r=yG(),i=hn(),s=Bi(),o=r_();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 Iv=a,Iv}var Lv,a_;function bG(){if(a_)return Lv;a_=1;var n=du(),e=pu();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 Lv=t,Lv}var Rv,l_;function wG(){if(l_)return Rv;l_=1;var n=vG(),e=bG(),t=e(function(r,i,s){n(r,i,s)});return Rv=t,Rv}var jv,c_;function u_(){if(c_)return jv;c_=1;function n(e,t){return e<t}return jv=n,jv}var Dv,h_;function xG(){if(h_)return Dv;h_=1;var n=Ev(),e=u_(),t=$i();function r(i){return i&&i.length?n(i,t,e):void 0}return Dv=r,Dv}var Bv,f_;function CG(){if(f_)return Bv;f_=1;var n=Ev(),e=mr(),t=u_();function r(i,s){return i&&i.length?n(i,e(s,2),t):void 0}return Bv=r,Bv}var $v,d_;function SG(){if(d_)return $v;d_=1;var n=Tn(),e=function(){return n.Date.now()};return $v=e,$v}var zv,g_;function PG(){if(g_)return zv;g_=1;var n=iu(),e=hu(),t=su(),r=hn(),i=Da();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 zv=s,zv}var Fv,p_;function EG(){if(p_)return Fv;p_=1;var n=fu(),e=PG(),t=hu();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 Fv=r,Fv}var qv,m_;function AG(){if(m_)return qv;m_=1;var n=EG(),e=oO();function t(r,i){return n(r,i,function(s,o){return e(r,o)})}return qv=t,qv}var Vv,y_;function TG(){if(y_)return Vv;y_=1;var n=UM(),e=zO(),t=GO();function r(i){return t(e(i,void 0,n),i+"")}return Vv=r,Vv}var Gv,v_;function OG(){if(v_)return Gv;v_=1;var n=AG(),e=TG(),t=e(function(r,i){return r==null?{}:n(r,i)});return Gv=t,Gv}var Hv,b_;function MG(){if(b_)return Hv;b_=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 Hv=t,Hv}var Uv,w_;function _G(){if(w_)return Uv;w_=1;var n=MG(),e=pu(),t=FM();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 Uv=r,Uv}var Wv,x_;function NG(){if(x_)return Wv;x_=1;var n=_G(),e=n();return Wv=e,Wv}var Xv,C_;function kG(){if(C_)return Xv;C_=1;function n(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}return Xv=n,Xv}var Yv,S_;function IG(){if(S_)return Yv;S_=1;var n=ro();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 Yv=e,Yv}var Kv,P_;function LG(){if(P_)return Kv;P_=1;var n=IG();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 Kv=e,Kv}var Jv,E_;function RG(){if(E_)return Jv;E_=1;var n=uu(),e=fu(),t=mr(),r=CO(),i=kG(),s=ou(),o=LG(),a=$i(),l=tt();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 Jv=c,Jv}var Qv,A_;function jG(){if(A_)return Qv;A_=1;var n=Cy(),e=RG(),t=du(),r=pu(),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 Qv=i,Qv}var Zv,T_;function DG(){if(T_)return Zv;T_=1;var n=JT(),e=0;function t(r){var i=++e;return n(r)+i}return Zv=t,Zv}var e0,O_;function BG(){if(O_)return e0;O_=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 e0=n,e0}var t0,M_;function $G(){if(M_)return t0;M_=1;var n=iu(),e=BG();function t(r,i){return e(r||[],i||[],n)}return t0=t,t0}var mu;if(typeof Jd=="function")try{mu={cloneDeep:tG(),constant:sm(),defaults:nG(),each:vT(),filter:gO(),find:cG(),flatten:UM(),forEach:mT(),forIn:uG(),has:yO(),isUndefined:wO(),last:hG(),map:PO(),mapValues:fG(),max:gG(),merge:wG(),min:xG(),minBy:CG(),now:SG(),pick:OG(),range:NG(),reduce:OO(),sortBy:jG(),uniqueId:DG(),values:aM(),zipObject:$G()}}catch(n){}mu||(mu=window._);var Ie=mu,zG=yu;function yu(){var n={};n._next=n._prev=n,this._sentinel=n}yu.prototype.dequeue=function(){var n=this._sentinel,e=n._prev;if(e!==n)return __(e),e},yu.prototype.enqueue=function(n){var e=this._sentinel;n._prev&&n._next&&__(n),n._next=e._next,e._next._prev=n,e._next=n,n._prev=e},yu.prototype.toString=function(){for(var n=[],e=this._sentinel,t=e._prev;t!==e;)n.push(JSON.stringify(t,FG)),t=t._prev;return"["+n.join(", ")+"]"};function __(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function FG(n,e){if(n!=="_next"&&n!=="_prev")return e}var yr=Ie,qG=On.Graph,VG=zG,GG=UG,HG=yr.constant(1);function UG(n,e){if(n.nodeCount()<=1)return[];var t=XG(n,e||HG),r=WG(t.graph,t.buckets,t.zeroIdx);return yr.flatten(yr.map(r,function(i){return n.outEdges(i.v,i.w)}),!0)}function WG(n,e,t){for(var r=[],i=e[e.length-1],s=e[0],o;n.nodeCount();){for(;o=s.dequeue();)n0(n,e,t,o);for(;o=i.dequeue();)n0(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(n0(n,e,t,o,!0));break}}}return r}function n0(n,e,t,r,i){var s=i?[]:void 0;return yr.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,r0(e,t,l)}),yr.forEach(n.outEdges(r.v),function(o){var a=n.edge(o),l=o.w,c=n.node(l);c.in-=a,r0(e,t,c)}),n.removeNode(r.v),s}function XG(n,e){var t=new qG,r=0,i=0;yr.forEach(n.nodes(),function(a){t.setNode(a,{v:a,in:0,out:0})}),yr.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=yr.range(i+r+3).map(function(){return new VG}),o=r+1;return yr.forEach(t.nodes(),function(a){r0(s,o,t.node(a))}),{graph:t,buckets:s,zeroIdx:o}}function r0(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 zi=Ie,YG=GG,KG={run:JG,undo:ZG};function JG(n){var e=n.graph().acyclicer==="greedy"?YG(n,t(n)):QG(n);zi.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,zi.uniqueId("rev"))});function t(r){return function(i){return r.edge(i).weight}}}function QG(n){var e=[],t={},r={};function i(s){zi.has(r,s)||(r[s]=!0,t[s]=!0,zi.forEach(n.outEdges(s),function(o){zi.has(t,o.w)?e.push(o):i(o.w)}),delete t[s])}return zi.forEach(n.nodes(),i),e}function ZG(n){zi.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 ye=Ie,N_=On.Graph,zt={addDummyNode:k_,simplify:eH,asNonCompoundGraph:tH,successorWeights:nH,predecessorWeights:rH,intersectRect:iH,buildLayerMatrix:sH,normalizeRanks:oH,removeEmptyRanks:aH,addBorderNode:lH,maxRank:I_,partition:cH,time:uH,notime:hH};function k_(n,e,t,r){var i;do i=ye.uniqueId(r);while(n.hasNode(i));return t.dummy=e,n.setNode(i,t),i}function eH(n){var e=new N_().setGraph(n.graph());return ye.forEach(n.nodes(),function(t){e.setNode(t,n.node(t))}),ye.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 tH(n){var e=new N_({multigraph:n.isMultigraph()}).setGraph(n.graph());return ye.forEach(n.nodes(),function(t){n.children(t).length||e.setNode(t,n.node(t))}),ye.forEach(n.edges(),function(t){e.setEdge(t,n.edge(t))}),e}function nH(n){var e=ye.map(n.nodes(),function(t){var r={};return ye.forEach(n.outEdges(t),function(i){r[i.w]=(r[i.w]||0)+n.edge(i).weight}),r});return ye.zipObject(n.nodes(),e)}function rH(n){var e=ye.map(n.nodes(),function(t){var r={};return ye.forEach(n.inEdges(t),function(i){r[i.v]=(r[i.v]||0)+n.edge(i).weight}),r});return ye.zipObject(n.nodes(),e)}function iH(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 sH(n){var e=ye.map(ye.range(I_(n)+1),function(){return[]});return ye.forEach(n.nodes(),function(t){var r=n.node(t),i=r.rank;ye.isUndefined(i)||(e[i][r.order]=t)}),e}function oH(n){var e=ye.min(ye.map(n.nodes(),function(t){return n.node(t).rank}));ye.forEach(n.nodes(),function(t){var r=n.node(t);ye.has(r,"rank")&&(r.rank-=e)})}function aH(n){var e=ye.min(ye.map(n.nodes(),function(s){return n.node(s).rank})),t=[];ye.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;ye.forEach(t,function(s,o){ye.isUndefined(s)&&o%i!==0?--r:r&&ye.forEach(s,function(a){n.node(a).rank+=r})})}function lH(n,e,t,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=t,i.order=r),k_(n,"border",i,e)}function I_(n){return ye.max(ye.map(n.nodes(),function(e){var t=n.node(e).rank;if(!ye.isUndefined(t))return t}))}function cH(n,e){var t={lhs:[],rhs:[]};return ye.forEach(n,function(r){e(r)?t.lhs.push(r):t.rhs.push(r)}),t}function uH(n,e){var t=ye.now();try{return e()}finally{console.log(n+" time: "+(ye.now()-t)+"ms")}}function hH(n,e){return e()}var L_=Ie,fH=zt,dH={run:gH,undo:mH};function gH(n){n.graph().dummyChains=[],L_.forEach(n.edges(),function(e){pH(n,e)})}function pH(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=fH.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 mH(n){L_.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 vu=Ie,bu={longestPath:yH,slack:vH};function yH(n){var e={};function t(r){var i=n.node(r);if(vu.has(e,r))return i.rank;e[r]=!0;var s=vu.min(vu.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}vu.forEach(n.sources(),t)}function vH(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen}var wu=Ie,bH=On.Graph,xu=bu.slack,R_=wH;function wH(n){var e=new bH({directed:!1}),t=n.nodes()[0],r=n.nodeCount();e.setNode(t,{});for(var i,s;xH(e,n)<r;)i=CH(e,n),s=e.hasNode(i.v)?xu(n,i):-xu(n,i),SH(e,n,s);return e}function xH(n,e){function t(r){wu.forEach(e.nodeEdges(r),function(i){var s=i.v,o=r===s?i.w:s;!n.hasNode(o)&&!xu(e,i)&&(n.setNode(o,{}),n.setEdge(r,o,{}),t(o))})}return wu.forEach(n.nodes(),t),n.nodeCount()}function CH(n,e){return wu.minBy(e.edges(),function(t){if(n.hasNode(t.v)!==n.hasNode(t.w))return xu(e,t)})}function SH(n,e,t){wu.forEach(n.nodes(),function(r){e.node(r).rank+=t})}var vr=Ie,PH=R_,EH=bu.slack,AH=bu.longestPath,TH=On.alg.preorder,OH=On.alg.postorder,MH=zt.simplify,_H=Fi;Fi.initLowLimValues=s0,Fi.initCutValues=i0,Fi.calcCutValue=j_,Fi.leaveEdge=B_,Fi.enterEdge=$_,Fi.exchangeEdges=z_;function Fi(n){n=MH(n),AH(n);var e=PH(n);s0(e),i0(e,n);for(var t,r;t=B_(e);)r=$_(e,n,t),z_(e,n,t,r)}function i0(n,e){var t=OH(n,n.nodes());t=t.slice(0,t.length-1),vr.forEach(t,function(r){NH(n,e,r)})}function NH(n,e,t){var r=n.node(t),i=r.parent;n.edge(t,i).cutvalue=j_(n,e,t)}function j_(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,vr.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,IH(n,t,u)){var d=n.edge(t,u).cutvalue;a+=h?-d:d}}}),a}function s0(n,e){arguments.length<2&&(e=n.nodes()[0]),D_(n,{},1,e)}function D_(n,e,t,r,i){var s=t,o=n.node(r);return e[r]=!0,vr.forEach(n.neighbors(r),function(a){vr.has(e,a)||(t=D_(n,e,t,a,r))}),o.low=s,o.lim=t++,i?o.parent=i:delete o.parent,t}function B_(n){return vr.find(n.edges(),function(e){return n.edge(e).cutvalue<0})}function $_(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=vr.filter(e.edges(),function(u){return l===F_(n,n.node(u.v),a)&&l!==F_(n,n.node(u.w),a)});return vr.minBy(c,function(u){return EH(e,u)})}function z_(n,e,t,r){var i=t.v,s=t.w;n.removeEdge(i,s),n.setEdge(r.v,r.w,{}),s0(n),i0(n,e),kH(n,e)}function kH(n,e){var t=vr.find(n.nodes(),function(i){return!e.node(i).parent}),r=TH(n,t);r=r.slice(1),vr.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 IH(n,e,t){return n.hasEdge(e,t)}function F_(n,e,t){return t.low<=e.lim&&e.lim<=t.lim}var LH=bu,q_=LH.longestPath,RH=R_,jH=_H,DH=BH;function BH(n){switch(n.graph().ranker){case"network-simplex":V_(n);break;case"tight-tree":zH(n);break;case"longest-path":$H(n);break;default:V_(n)}}var $H=q_;function zH(n){q_(n),RH(n)}function V_(n){jH(n)}var o0=Ie,FH=qH;function qH(n){var e=GH(n);o0.forEach(n.graph().dummyChains,function(t){for(var r=n.node(t),i=r.edgeObj,s=VH(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 VH(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 GH(n){var e={},t=0;function r(i){var s=t;o0.forEach(n.children(i),r),e[i]={low:s,lim:t++}}return o0.forEach(n.children(),r),e}var br=Ie,a0=zt,HH={run:UH,cleanup:YH};function UH(n){var e=a0.addDummyNode(n,"root",{},"_root"),t=WH(n),r=br.max(br.values(t))-1,i=2*r+1;n.graph().nestingRoot=e,br.forEach(n.edges(),function(o){n.edge(o).minlen*=i});var s=XH(n)+1;br.forEach(n.children(),function(o){G_(n,e,i,s,r,t,o)}),n.graph().nodeRankFactor=i}function G_(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=a0.addBorderNode(n,"_bt"),c=a0.addBorderNode(n,"_bb"),u=n.node(o);n.setParent(l,o),u.borderTop=l,n.setParent(c,o),u.borderBottom=c,br.forEach(a,function(h){G_(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 WH(n){var e={};function t(r,i){var s=n.children(r);s&&s.length&&br.forEach(s,function(o){t(o,i+1)}),e[r]=i}return br.forEach(n.children(),function(r){t(r,1)}),e}function XH(n){return br.reduce(n.edges(),function(e,t){return e+n.edge(t).weight},0)}function YH(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,br.forEach(n.edges(),function(t){var r=n.edge(t);r.nestingEdge&&n.removeEdge(t)})}var l0=Ie,KH=zt,JH=QH;function QH(n){function e(t){var r=n.children(t),i=n.node(t);if(r.length&&l0.forEach(r,e),l0.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var s=i.minRank,o=i.maxRank+1;s<o;++s)H_(n,"borderLeft","_bl",t,i,s),H_(n,"borderRight","_br",t,i,s)}}l0.forEach(n.children(),e)}function H_(n,e,t,r,i,s){var o={width:0,height:0,rank:s,borderType:e},a=i[e][s-1],l=KH.addDummyNode(n,"border",o,t);i[e][s]=l,n.setParent(l,r),a&&n.setEdge(a,l,{weight:1})}var Hn=Ie,ZH={adjust:e8,undo:t8};function e8(n){var e=n.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&U_(n)}function t8(n){var e=n.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&n8(n),(e==="lr"||e==="rl")&&(r8(n),U_(n))}function U_(n){Hn.forEach(n.nodes(),function(e){W_(n.node(e))}),Hn.forEach(n.edges(),function(e){W_(n.edge(e))})}function W_(n){var e=n.width;n.width=n.height,n.height=e}function n8(n){Hn.forEach(n.nodes(),function(e){c0(n.node(e))}),Hn.forEach(n.edges(),function(e){var t=n.edge(e);Hn.forEach(t.points,c0),Hn.has(t,"y")&&c0(t)})}function c0(n){n.y=-n.y}function r8(n){Hn.forEach(n.nodes(),function(e){u0(n.node(e))}),Hn.forEach(n.edges(),function(e){var t=n.edge(e);Hn.forEach(t.points,u0),Hn.has(t,"x")&&u0(t)})}function u0(n){var e=n.x;n.x=n.y,n.y=e}var wr=Ie,i8=s8;function s8(n){var e={},t=wr.filter(n.nodes(),function(a){return!n.children(a).length}),r=wr.max(wr.map(t,function(a){return n.node(a).rank})),i=wr.map(wr.range(r+1),function(){return[]});function s(a){if(!wr.has(e,a)){e[a]=!0;var l=n.node(a);i[l.rank].push(a),wr.forEach(n.successors(a),s)}}var o=wr.sortBy(t,function(a){return n.node(a).rank});return wr.forEach(o,s),i}var ii=Ie,o8=a8;function a8(n,e){for(var t=0,r=1;r<e.length;++r)t+=l8(n,e[r-1],e[r]);return t}function l8(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 X_=Ie,c8=u8;function u8(n,e){return X_.map(e,function(t){var r=n.inEdges(t);if(r.length){var i=X_.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 Xt=Ie,h8=f8;function f8(n,e){var t={};Xt.forEach(n,function(i,s){var o=t[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:s};Xt.isUndefined(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),Xt.forEach(e.edges(),function(i){var s=t[i.v],o=t[i.w];!Xt.isUndefined(s)&&!Xt.isUndefined(o)&&(o.indegree++,s.out.push(t[i.w]))});var r=Xt.filter(t,function(i){return!i.indegree});return d8(r)}function d8(n){var e=[];function t(s){return function(o){o.merged||(Xt.isUndefined(o.barycenter)||Xt.isUndefined(s.barycenter)||o.barycenter>=s.barycenter)&&g8(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),Xt.forEach(i.in.reverse(),t(i)),Xt.forEach(i.out,r(i))}return Xt.map(Xt.filter(e,function(s){return!s.merged}),function(s){return Xt.pick(s,["vs","i","barycenter","weight"])})}function g8(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 Ba=Ie,p8=zt,m8=y8;function y8(n,e){var t=p8.partition(n,function(u){return Ba.has(u,"barycenter")}),r=t.lhs,i=Ba.sortBy(t.rhs,function(u){return-u.i}),s=[],o=0,a=0,l=0;r.sort(v8(!!e)),l=Y_(s,i,l),Ba.forEach(r,function(u){l+=u.vs.length,s.push(u.vs),o+=u.barycenter*u.weight,a+=u.weight,l=Y_(s,i,l)});var c={vs:Ba.flatten(s,!0)};return a&&(c.barycenter=o/a,c.weight=a),c}function Y_(n,e,t){for(var r;e.length&&(r=Ba.last(e)).i<=t;)e.pop(),n.push(r.vs),t++;return t}function v8(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=Ie,b8=c8,w8=h8,x8=m8,C8=K_;function K_(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=b8(n,i);si.forEach(c,function(g){if(n.children(g.v).length){var p=K_(n,g.v,t,r);l[g.v]=p,si.has(p,"barycenter")&&P8(g,p)}});var u=w8(c,t);S8(u,l);var h=x8(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 S8(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 P8(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 $a=Ie,E8=On.Graph,A8=T8;function T8(n,e,t){var r=O8(n),i=new E8({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(s){return n.node(s)});return $a.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),$a.forEach(n[t](s),function(l){var c=l.v===s?l.w:l.v,u=i.edge(c,s),h=$a.isUndefined(u)?0:u.weight;i.setEdge(c,s,{weight:n.edge(l).weight+h})}),$a.has(o,"minRank")&&i.setNode(s,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),i}function O8(n){for(var e;n.hasNode(e=$a.uniqueId("_root")););return e}var M8=Ie,_8=N8;function N8(n,e,t){var r={},i;M8.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=Ie,k8=i8,I8=o8,L8=C8,R8=A8,j8=_8,D8=On.Graph,J_=zt,B8=$8;function $8(n){var e=J_.maxRank(n),t=Q_(n,oi.range(1,e+1),"inEdges"),r=Q_(n,oi.range(e-1,-1,-1),"outEdges"),i=k8(n);Z_(n,i);for(var s=Number.POSITIVE_INFINITY,o,a=0,l=0;l<4;++a,++l){z8(a%2?t:r,a%4>=2),i=J_.buildLayerMatrix(n);var c=I8(n,i);c<s&&(l=0,o=oi.cloneDeep(i),s=c)}Z_(n,o)}function Q_(n,e,t){return oi.map(e,function(r){return R8(n,r,t)})}function z8(n,e){var t=new D8;oi.forEach(n,function(r){var i=r.graph().root,s=L8(r,i,t,e);oi.forEach(s.vs,function(o,a){r.node(o).order=a}),j8(r,t,s.vs)})}function Z_(n,e){oi.forEach(e,function(t){oi.forEach(t,function(r,i){n.node(r).order=i})})}var oe=Ie,F8=On.Graph,q8=zt,V8={positionX:U8,findType1Conflicts:e2,findType2Conflicts:t2,addConflict:h0,hasConflict:n2,verticalAlignment:r2,horizontalCompaction:i2,alignCoordinates:o2,findSmallestWidthAlignment:s2,balance:a2};function e2(n,e){var t={};function r(i,s){var o=0,a=0,l=i.length,c=oe.last(s);return oe.forEach(s,function(u,h){var f=G8(n,u),d=f?n.node(f).order:l;(f||u===c)&&(oe.forEach(s.slice(a,h+1),function(g){oe.forEach(n.predecessors(g),function(p){var b=n.node(p),m=b.order;(m<o||d<m)&&!(b.dummy&&n.node(g).dummy)&&h0(t,p,g)})}),a=h+1,o=d)}),s}return oe.reduce(e,r),t}function t2(n,e){var t={};function r(s,o,a,l,c){var u;oe.forEach(oe.range(o,a),function(h){u=s[h],n.node(u).dummy&&oe.forEach(n.predecessors(u),function(f){var d=n.node(f);d.dummy&&(d.order<l||d.order>c)&&h0(t,f,u)})})}function i(s,o){var a=-1,l,c=0;return oe.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 oe.reduce(e,i),t}function G8(n,e){if(n.node(e).dummy)return oe.find(n.predecessors(e),function(t){return n.node(t).dummy})}function h0(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 n2(n,e,t){if(e>t){var r=e;e=t,t=r}return oe.has(n[e],t)}function r2(n,e,t,r){var i={},s={},o={};return oe.forEach(e,function(a){oe.forEach(a,function(l,c){i[l]=l,s[l]=l,o[l]=c})}),oe.forEach(e,function(a){var l=-1;oe.forEach(a,function(c){var u=r(c);if(u.length){u=oe.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]&&!n2(t,c,g)&&(s[g]=c,s[c]=i[c]=i[g],l=o[g])}}})}),{root:i,align:s}}function i2(n,e,t,r,i){var s={},o=H8(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)),oe.forEach(r,function(h){s[h]=s[t[h]]}),s}function H8(n,e,t,r){var i=new F8,s=n.graph(),o=W8(s.nodesep,s.edgesep,r);return oe.forEach(e,function(a){var l;oe.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 s2(n,e){return oe.minBy(oe.values(e),function(t){var r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return oe.forIn(t,function(s,o){var a=X8(n,o)/2;r=Math.max(s+a,r),i=Math.min(s-a,i)}),r-i})}function o2(n,e){var t=oe.values(e),r=oe.min(t),i=oe.max(t);oe.forEach(["u","d"],function(s){oe.forEach(["l","r"],function(o){var a=s+o,l=n[a],c;if(l!==e){var u=oe.values(l);c=o==="l"?r-oe.min(u):i-oe.max(u),c&&(n[a]=oe.mapValues(l,function(h){return h+c}))}})})}function a2(n,e){return oe.mapValues(n.ul,function(t,r){if(e)return n[e.toLowerCase()][r];var i=oe.sortBy(oe.map(n,r));return(i[1]+i[2])/2})}function U8(n){var e=q8.buildLayerMatrix(n),t=oe.merge(e2(n,e),t2(n,e)),r={},i;oe.forEach(["u","d"],function(o){i=o==="u"?e:oe.values(e).reverse(),oe.forEach(["l","r"],function(a){a==="r"&&(i=oe.map(i,function(h){return oe.values(h).reverse()}));var l=(o==="u"?n.predecessors:n.successors).bind(n),c=r2(n,i,t,l),u=i2(n,i,c.root,c.align,a==="r");a==="r"&&(u=oe.mapValues(u,function(h){return-h})),r[o+a]=u})});var s=s2(n,r);return o2(r,s),a2(r,n.graph().align)}function W8(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,oe.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,oe.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 X8(n,e){return n.node(e).width}var za=Ie,l2=zt,Y8=V8.positionX,K8=J8;function J8(n){n=l2.asNonCompoundGraph(n),Q8(n),za.forEach(Y8(n),function(e,t){n.node(t).x=e})}function Q8(n){var e=l2.buildLayerMatrix(n),t=n.graph().ranksep,r=0;za.forEach(e,function(i){var s=za.max(za.map(i,function(o){return n.node(o).height}));za.forEach(i,function(o){n.node(o).y=r+s/2}),r+=s+t})}var le=Ie,c2=KG,u2=dH,Z8=DH,eU=zt.normalizeRanks,tU=FH,nU=zt.removeEmptyRanks,h2=HH,rU=JH,f2=ZH,iU=B8,sU=K8,ai=zt,oU=On.Graph,aU=lU;function lU(n,e){var t=e&&e.debugTiming?ai.time:ai.notime;t("layout",function(){var r=t(" buildLayoutGraph",function(){return bU(n)});t(" runLayout",function(){cU(r,t)}),t(" updateInputGraph",function(){uU(n,r)})})}function cU(n,e){e(" makeSpaceForEdgeLabels",function(){wU(n)}),e(" removeSelfEdges",function(){MU(n)}),e(" acyclic",function(){c2.run(n)}),e(" nestingGraph.run",function(){h2.run(n)}),e(" rank",function(){Z8(ai.asNonCompoundGraph(n))}),e(" injectEdgeLabelProxies",function(){xU(n)}),e(" removeEmptyRanks",function(){nU(n)}),e(" nestingGraph.cleanup",function(){h2.cleanup(n)}),e(" normalizeRanks",function(){eU(n)}),e(" assignRankMinMax",function(){CU(n)}),e(" removeEdgeLabelProxies",function(){SU(n)}),e(" normalize.run",function(){u2.run(n)}),e(" parentDummyChains",function(){tU(n)}),e(" addBorderSegments",function(){rU(n)}),e(" order",function(){iU(n)}),e(" insertSelfEdges",function(){_U(n)}),e(" adjustCoordinateSystem",function(){f2.adjust(n)}),e(" position",function(){sU(n)}),e(" positionSelfEdges",function(){NU(n)}),e(" removeBorderNodes",function(){OU(n)}),e(" normalize.undo",function(){u2.undo(n)}),e(" fixupEdgeLabelCoords",function(){AU(n)}),e(" undoCoordinateSystem",function(){f2.undo(n)}),e(" translateGraph",function(){PU(n)}),e(" assignNodeIntersects",function(){EU(n)}),e(" reversePoints",function(){TU(n)}),e(" acyclic.undo",function(){c2.undo(n)})}function uU(n,e){le.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))}),le.forEach(n.edges(),function(t){var r=n.edge(t),i=e.edge(t);r.points=i.points,le.has(i,"x")&&(r.x=i.x,r.y=i.y)}),n.graph().width=e.graph().width,n.graph().height=e.graph().height}var hU=["nodesep","edgesep","ranksep","marginx","marginy"],fU={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},dU=["acyclicer","ranker","rankdir","align"],gU=["width","height"],pU={width:0,height:0},mU=["minlen","weight","width","height","labeloffset"],yU={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},vU=["labelpos"];function bU(n){var e=new oU({multigraph:!0,compound:!0}),t=d0(n.graph());return e.setGraph(le.merge({},fU,f0(t,hU),le.pick(t,dU))),le.forEach(n.nodes(),function(r){var i=d0(n.node(r));e.setNode(r,le.defaults(f0(i,gU),pU)),e.setParent(r,n.parent(r))}),le.forEach(n.edges(),function(r){var i=d0(n.edge(r));e.setEdge(r,le.merge({},yU,f0(i,mU),le.pick(i,vU)))}),e}function wU(n){var e=n.graph();e.ranksep/=2,le.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 xU(n){le.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 CU(n){var e=0;le.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=le.max(e,r.maxRank))}),n.graph().maxRank=e}function SU(n){le.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 PU(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)}le.forEach(n.nodes(),function(c){l(n.node(c))}),le.forEach(n.edges(),function(c){var u=n.edge(c);le.has(u,"x")&&l(u)}),e-=o,r-=a,le.forEach(n.nodes(),function(c){var u=n.node(c);u.x-=e,u.y-=r}),le.forEach(n.edges(),function(c){var u=n.edge(c);le.forEach(u.points,function(h){h.x-=e,h.y-=r}),le.has(u,"x")&&(u.x-=e),le.has(u,"y")&&(u.y-=r)}),s.width=t-e+o,s.height=i-r+a}function EU(n){le.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 AU(n){le.forEach(n.edges(),function(e){var t=n.edge(e);if(le.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 TU(n){le.forEach(n.edges(),function(e){var t=n.edge(e);t.reversed&&t.points.reverse()})}function OU(n){le.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(le.last(t.borderLeft)),o=n.node(le.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}}),le.forEach(n.nodes(),function(e){n.node(e).dummy==="border"&&n.removeNode(e)})}function MU(n){le.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 _U(n){var e=ai.buildLayerMatrix(n);le.forEach(e,function(t){var r=0;le.forEach(t,function(i,s){var o=n.node(i);o.order=s+r,le.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 NU(n){le.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 f0(n,e){return le.mapValues(le.pick(n,e),Number)}function d0(n){var e={};return le.forEach(n,function(t,r){e[r.toLowerCase()]=t}),e}var Cu=Ie,kU=zt,IU=On.Graph,LU={debugOrdering:RU};function RU(n){var e=kU.buildLayerMatrix(n),t=new IU({compound:!0,multigraph:!0}).setGraph({});return Cu.forEach(n.nodes(),function(r){t.setNode(r,{label:r}),t.setParent(r,"layer"+n.node(r).rank)}),Cu.forEach(n.edges(),function(r){t.setEdge(r.v,r.w,{},r.name)}),Cu.forEach(e,function(r,i){var s="layer"+i;t.setNode(s,{rank:"same"}),Cu.reduce(r,function(o,a){return t.setEdge(o,a,{style:"invis"}),a})}),t}var jU="0.8.5",DU={graphlib:On,layout:aU,debug:LU,util:{time:zt.time,notime:zt.notime},version:jU};const Su=Vq(DU),{groupBy:BU,reduce:$U,uniq:zU,uniqBy:d2}=Ou,FU={ER:"er-rect",EDGE:"edge"},g0=()=>Va.useTranslation("graph-collection-manager"),g2=(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 zU(t)};return r(e)},qU=(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)},p2=n=>{const e=[],t=[],r=n.map((o,a)=>{const l=[],c=[...o.fields],u=g2(n,o.name),h=$U(u,(d,g)=>{var m;const p=d,b=(m=n.find(y=>y.name===g))==null?void 0:m.fields.map(y=>He(ie({},y),{sourceCollectionName:o.name}));return p.concat(b)},[]);d2(c.concat(h),"name").forEach(d=>{d.uiSchema&&l.push(ie({id:d.key,group:"list"},d)),["obo","oho","o2o","o2m","m2o","m2m","linkTo"].includes(d.interface)&&e.push(d)}),t.push(o.name);const f=VU(l);return{id:o.name,shape:FU.ER,name:o.name,title:o.title,width:250,ports:[...f.initPorts||[],...f.morePorts||[]],item:o}}),i=HU(e,t,r),s=GU(n);return{nodesData:r,edgesData:i,inheritEdges:s}},VU=n=>BU(n,t=>t.isForeignKey||t.primaryKey||["obo","oho","o2o","o2m","m2o","m2m","linkTo","id"].includes(t.interface)?"initPorts":"morePorts"),GU=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(ie({id:r.name+s,source:{cell:r.name,connectionPoint:"rect"},target:{cell:s,connectionPoint:"rect"},connector:{name:"normal",zIndex:1e3},connectionType:"inherited"},e))})}),t},HU=(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:m2(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:m2(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,P=(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+P+C+E;r.push(ie({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(ie({id:O,source:{cell:x,port:P,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,P=(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+P+C+E;p(y+w+m+v)&&b&&w&&r.push(ie({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+P)&&P&&E&&r.push(ie({id:O,source:{cell:x,port:P,anchor:{name:"right"}},target:{cell:C,port:E,anchor:{name:"left"}},associated:[n[h].name]},g))}}return d2(r,"id")},m2=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[]}},UU=(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},y2=(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 p0;const At=()=>p0||(p0=document.getElementById("graph_container")),WU=({item:n})=>_.jsx(R.AddCollection,{trigger:["click"],align:{overflow:{adjustY:!1}},item:n,scope:{useCancelAction:Cr},getContainer:At,children:_.jsx(de.Button,{type:"primary",children:_.jsx(Ue.PlusOutlined,{})})}),m0=R.createStyles(({token:n,css:e})=>({graphMinimap:e`
448
448
  .x6-widget-minimap {
449
449
  background-color: ${n.colorBgContainer};
450
450
  }
@@ -645,50 +645,50 @@ Error generating stack: `+s.message+`
645
645
  height: calc(100vh) !important;
646
646
  width: calc(100vw) !important;
647
647
  }
648
- `})),XU=n=>{const e=n.collectionName,{run:t}=S0(e,n.key);return{run(){return ze(this,null,function*(){yield t()})}}},YU=({item:n,database:e})=>_.jsx(j.AddFieldAction,{trigger:["click"],align:{overflow:{adjustY:!1}},item:n,database:e,scope:{useCancelAction:Cr,useCreateCollectionField:()=>XU(n)},getContainer:At,children:_.jsx(Ue.PlusOutlined,{className:"btn-add",id:"graph_btn_add_field"})}),KU=({item:n,className:e})=>_.jsx(j.EditCollection,{item:n,scope:{useCancelAction:Cr,useUpdateCollectionActionAndRefreshCM:Mu,createOnly:!1},getContainer:At,children:_.jsx(Ue.EditOutlined,{className:e})}),JU=n=>{const e=n.collectionName,{run:t}=$2({collectionName:e,name:n.name,key:n.key});return{run(){return ze(this,null,function*(){yield t()})}}},QU=({item:n})=>_.jsx(j.EditFieldAction,{item:n,scope:{useCancelAction:Cr,useUpdateCollectionField:()=>JU(n)},getContainer:At,children:_.jsx(Ue.EditOutlined,{className:"btn-edit"})}),ZU=Kt.observer(n=>{const{schemaKey:e}=n,{getInterface:t}=j.useCollectionManager(),r=j.useCompile(),{t:i}=Va.useTranslation(),s=t(e);return s?_.jsxs("div",{className:j.css`
648
+ `})),XU=n=>{const e=n.collectionName,{run:t}=S0(e,n.key);return{run(){return ze(this,null,function*(){yield t()})}}},YU=({item:n,database:e})=>_.jsx(R.AddFieldAction,{trigger:["click"],align:{overflow:{adjustY:!1}},item:n,database:e,scope:{useCancelAction:Cr,useCreateCollectionField:()=>XU(n)},getContainer:At,children:_.jsx(Ue.PlusOutlined,{className:"btn-add",id:"graph_btn_add_field"})}),KU=({item:n,className:e})=>_.jsx(R.EditCollection,{item:n,scope:{useCancelAction:Cr,useUpdateCollectionActionAndRefreshCM:Mu,createOnly:!1},getContainer:At,children:_.jsx(Ue.EditOutlined,{className:e})}),JU=n=>{const e=n.collectionName,{run:t}=$2({collectionName:e,name:n.name,key:n.key});return{run(){return ze(this,null,function*(){yield t()})}}},QU=({item:n})=>_.jsx(R.EditFieldAction,{item:n,scope:{useCancelAction:Cr,useUpdateCollectionField:()=>JU(n)},getContainer:At,children:_.jsx(Ue.EditOutlined,{className:"btn-edit"})}),ZU=Kt.observer(n=>{const{schemaKey:e}=n,{getInterface:t}=R.useCollectionManager(),r=R.useCompile(),{t:i}=Va.useTranslation(),s=t(e);return s?_.jsxs("div",{className:R.css`
649
649
  background: #f6f6f6;
650
650
  margin-bottom: 24px;
651
651
  padding: 16px;
652
- `,children:[_.jsxs("div",{className:j.css``,children:[i("Field interface"),": ",_.jsx(ue.Tag,{children:r(s.title)})]}),s.description?_.jsx("div",{className:j.css`
652
+ `,children:[_.jsxs("div",{className:R.css``,children:[i("Field interface"),": ",_.jsx(de.Tag,{children:r(s.title)})]}),s.description?_.jsx("div",{className:R.css`
653
653
  margin-top: 8px;
654
654
  color: rgba(0, 0, 0, 0.45);
655
- `,children:r(s.description)}):null]}):null},{displayName:"FieldSummary"}),eW=n=>{const e=n.targetCollection,{run:t}=S0(e);return{run(){return ze(this,null,function*(){yield t()})}}},tW=({item:n})=>_.jsx(j.OverridingFieldAction,{item:ie({},n),scope:{useCancelAction:Cr,useOverridingCollectionField:()=>eW(n)},getContainer:At,children:_.jsx(Ue.CopyOutlined,{className:"btn-override"})}),nW=({item:n})=>_.jsx(j.ViewFieldAction,{item:ie({},n),getContainer:At,children:_.jsx(Ue.EyeOutlined,{className:"btn-view"})}),rW=W.memo(n=>{const{property:e,loadCollections:t,collectionData:r,setTargetNode:i,node:s,handelOpenPorts:o,title:a,name:l}=n,c=e.collectionName===l,u=W.useContext(Kt.SchemaOptionsContext),{data:{database:h}}=j.useCurrentAppInfo(),f=g=>`${g||""}${qa.uid()}`,d=()=>{const g=j.useRecord(),{getCollectionFields:p}=j.useCollectionManager();return p(g.collectionName||g.name)};return _.jsx("div",{className:"field-operator",children:_.jsx(j.SchemaComponentProvider,{components:ie({Select:g=>_.jsx(j.Select,He(ie({popupMatchSelectWidth:!1},g),{getPopupContainer:At})),FieldSummary:ZU,AddFieldAction:YU,OverrideFieldAction:tW,ViewFieldAction:nW,EditFieldAction:QU},u.components),scope:ie({useAsyncDataSource:_u,loadCollections:t,useCancelAction:Cr,useNewId:f,useCurrentFields:d,useValuesFromRecord:B2,useUpdateCollectionActionAndRefreshCM:Mu,isInheritField:c},u.scope),children:_.jsx(x0,{record:r.current,setTargetNode:i,node:s,handelOpenPorts:()=>o(!0),children:_.jsx(j.SchemaComponent,{scope:Cr,schema:{type:"object",properties:{create:{type:"void","x-action":"create","x-component":"AddFieldAction","x-visible":"{{isInheritField}}","x-component-props":{item:He(ie({},e),{title:a}),database:h}},update:{type:"void","x-action":"update","x-component":"EditFieldAction","x-visible":"{{isInheritField}}","x-component-props":{item:He(ie({},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:At,collectionConten:"{{t('Are you sure you want to delete it?')}}"},useAction:()=>V2({collectionName:e.collectionName,name:e.name})}},override:{type:"void","x-action":"create","x-visible":"{{!isInheritField}}","x-component":"OverrideFieldAction","x-component-props":{icon:"ReconciliationOutlined",item:He(ie({},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:He(ie({},e),{title:a,__parent:r.current})}}}}})})})})}),v2=W.memo(n=>{var y,v,w,x;const m=n,{property:e,node:t}=m,r=I2(m,["property","node"]),{store:{data:{title:i,name:s,sourcePort:o,associated:a,targetPort:l}}}=t,c=j.useCompile(),{styles:u}=m0(),{getInterface:h}=j.useCollectionManager(),[f,d]=W.useState(!1),g=W.useCallback(C=>{const{type:P,name:E,primaryKey:A,allowNull:O,autoIncrement:T}=C;return _.jsxs("div",{className:u.collectionPopoverClass,children:[_.jsxs("div",{className:"field-content",children:[_.jsxs("div",{children:[_.jsx("span",{children:"name"}),": ",_.jsx("span",{className:"field-type",children:E})]}),_.jsxs("div",{children:[_.jsx("span",{children:"type"}),": ",_.jsx("span",{className:"field-type",children:P})]})]}),_.jsxs("p",{children:[A&&_.jsx(ue.Tag,{color:"green",children:"PRIMARY"}),O&&_.jsx(ue.Tag,{color:"geekblue",children:"ALLOWNULL"}),T&&_.jsx(ue.Tag,{color:"purple",children:"AUTOINCREMENT"})]})]})},[]),p=ie({title:i,name:s,node:t},r),b=C=>{if(C.isForeignKey||C.primaryKey||C.interface==="id")return"red";if(["obo","oho","o2o","o2m","m2o","m2m","linkTo"].includes(C.interface))return"orange"};return _.jsx(ue.Popover,{content:g(e),getPopupContainer:At,mouseLeaveDelay:0,zIndex:100,title:_.jsxs("div",{children:[c((y=e.uiSchema)==null?void 0:y.title),_.jsx("span",{style:{color:"#ffa940",float:"right"},children:c((v=h(e.interface))==null?void 0:v.title)})]}),placement:"right",children:_.jsxs("div",{className:"body-item",id:e.id,style:{background:l||o===e.id||a!=null&&a.includes(e.name)?"#e6f7ff":null},onMouseEnter:()=>{d(!0)},onMouseLeave:()=>d(!1),children:[_.jsxs("div",{className:"name",children:[_.jsx(ue.Badge,{color:b(e)}),c((w=e.uiSchema)==null?void 0:w.title)]}),_.jsx("div",{className:"type field_type",children:c((x=h(e.interface))==null?void 0:x.title)}),f&&_.jsx(rW,ie({property:e},p))]},e.id)},e.id)}),iW=W.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]=W.useState(!1),{t:u}=g0(),h=Ou.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};return _.jsxs("div",{className:"body",children:[(p=h.initPorts)==null?void 0:p.map(m=>m.uiSchema&&W.createElement(v2,He(ie({},g),{property:m,key:m.id}))),_.jsx("div",{className:"morePorts",children:d&&((b=h.morePorts)==null?void 0:b.map(m=>m.uiSchema&&W.createElement(v2,He(ie({},g),{property:m,key:m.id}))))}),_.jsx("a",{className:xr.css`
655
+ `,children:r(s.description)}):null]}):null},{displayName:"FieldSummary"}),eW=n=>{const e=n.targetCollection,{run:t}=S0(e);return{run(){return ze(this,null,function*(){yield t()})}}},tW=({item:n})=>_.jsx(R.OverridingFieldAction,{item:ie({},n),scope:{useCancelAction:Cr,useOverridingCollectionField:()=>eW(n)},getContainer:At,children:_.jsx(Ue.CopyOutlined,{className:"btn-override"})}),nW=({item:n})=>_.jsx(R.ViewFieldAction,{item:ie({},n),getContainer:At,children:_.jsx(Ue.EyeOutlined,{className:"btn-view"})}),rW=W.memo(n=>{const{property:e,loadCollections:t,collectionData:r,setTargetNode:i,node:s,handelOpenPorts:o,title:a,name:l}=n,c=e.collectionName===l,u=W.useContext(Kt.SchemaOptionsContext),{data:{database:h}}=R.useCurrentAppInfo(),f=g=>`${g||""}${qa.uid()}`,d=()=>{const g=R.useRecord(),{getCollectionFields:p}=R.useCollectionManager();return p(g.collectionName||g.name)};return _.jsx("div",{className:"field-operator",children:_.jsx(R.SchemaComponentProvider,{components:ie({Select:g=>_.jsx(R.Select,He(ie({popupMatchSelectWidth:!1},g),{getPopupContainer:At})),FieldSummary:ZU,AddFieldAction:YU,OverrideFieldAction:tW,ViewFieldAction:nW,EditFieldAction:QU},u.components),scope:ie({useAsyncDataSource:_u,loadCollections:t,useCancelAction:Cr,useNewId:f,useCurrentFields:d,useValuesFromRecord:B2,useUpdateCollectionActionAndRefreshCM:Mu,isInheritField:c},u.scope),children:_.jsx(x0,{record:r.current,setTargetNode:i,node:s,handelOpenPorts:()=>o(!0),children:_.jsx(R.SchemaComponent,{scope:Cr,schema:{type:"object",properties:{create:{type:"void","x-action":"create","x-component":"AddFieldAction","x-visible":"{{isInheritField}}","x-component-props":{item:He(ie({},e),{title:a}),database:h}},update:{type:"void","x-action":"update","x-component":"EditFieldAction","x-visible":"{{isInheritField}}","x-component-props":{item:He(ie({},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:At,collectionConten:"{{t('Are you sure you want to delete it?')}}"},useAction:()=>V2({collectionName:e.collectionName,name:e.name})}},override:{type:"void","x-action":"create","x-visible":"{{!isInheritField}}","x-component":"OverrideFieldAction","x-component-props":{icon:"ReconciliationOutlined",item:He(ie({},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:He(ie({},e),{title:a,__parent:r.current})}}}}})})})})}),v2=W.memo(n=>{var y,v,w,x;const m=n,{property:e,node:t}=m,r=I2(m,["property","node"]),{store:{data:{title:i,name:s,sourcePort:o,associated:a,targetPort:l}}}=t,c=R.useCompile(),{styles:u}=m0(),{getInterface:h}=R.useCollectionManager(),[f,d]=W.useState(!1),g=W.useCallback(C=>{const{type:P,name:E,primaryKey:A,allowNull:O,autoIncrement:T}=C;return _.jsxs("div",{className:u.collectionPopoverClass,children:[_.jsxs("div",{className:"field-content",children:[_.jsxs("div",{children:[_.jsx("span",{children:"name"}),": ",_.jsx("span",{className:"field-type",children:E})]}),_.jsxs("div",{children:[_.jsx("span",{children:"type"}),": ",_.jsx("span",{className:"field-type",children:P})]})]}),_.jsxs("p",{children:[A&&_.jsx(de.Tag,{color:"green",children:"PRIMARY"}),O&&_.jsx(de.Tag,{color:"geekblue",children:"ALLOWNULL"}),T&&_.jsx(de.Tag,{color:"purple",children:"AUTOINCREMENT"})]})]})},[]),p=ie({title:i,name:s,node:t},r),b=C=>{if(C.isForeignKey||C.primaryKey||C.interface==="id")return"red";if(["obo","oho","o2o","o2m","m2o","m2m","linkTo"].includes(C.interface))return"orange"};return _.jsx(R.Popover,{content:g(e),getPopupContainer:At,mouseLeaveDelay:0,zIndex:100,title:_.jsxs("div",{children:[c((y=e.uiSchema)==null?void 0:y.title),_.jsx("span",{style:{color:"#ffa940",float:"right"},children:c((v=h(e.interface))==null?void 0:v.title)})]}),placement:"right",children:_.jsxs("div",{className:"body-item",id:e.id,style:{background:l||o===e.id||a!=null&&a.includes(e.name)?"#e6f7ff":null},onMouseEnter:()=>{d(!0)},onMouseLeave:()=>d(!1),children:[_.jsxs("div",{className:"name",children:[_.jsx(de.Badge,{color:b(e)}),c((w=e.uiSchema)==null?void 0:w.title)]}),_.jsx("div",{className:"type field_type",children:c((x=h(e.interface))==null?void 0:x.title)}),f&&_.jsx(rW,ie({property:e},p))]},e.id)},e.id)}),iW=W.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]=W.useState(!1),{t:u}=g0(),h=Ou.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};return _.jsxs("div",{className:"body",children:[(p=h.initPorts)==null?void 0:p.map(m=>m.uiSchema&&W.createElement(v2,He(ie({},g),{property:m,key:m.id}))),_.jsx("div",{className:"morePorts",children:d&&((b=h.morePorts)==null?void 0:b.map(m=>m.uiSchema&&W.createElement(v2,He(ie({},g),{property:m,key:m.id}))))}),_.jsx("a",{className:xr.css`
656
656
  display: block;
657
657
  color: #958f8f;
658
658
  padding: 10px 5px;
659
659
  &:hover {
660
660
  color: rgb(99 90 88);
661
661
  }
662
- `,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")]})]})}),sW=n=>{const{styles:e}=m0(),t=W.useContext(Kt.SchemaOptionsContext),{node:r,setTargetNode:i,targetGraph:s}=n,{store:{data:{title:o,name:a,item:l,attrs:c,select:u}},id:h}=r,{data:{database:f}}=j.useCurrentAppInfo(),d=W.useRef(),g=W.useContext(j.CollectionCategroriesContext);d.current=He(ie({},l),{title:o,inherits:l.inherits&&new Proxy(l.inherits,{})});const{category:p}=l,b=j.useCompile(),m=w=>ze(this,null,function*(){var x;return(x=s.collections)==null?void 0:x.map(C=>({label:b(C.title),value:C.name}))}),y=()=>ze(this,null,function*(){return g==null?void 0:g.data.map(w=>({label:b(w.name),value:w.id}))}),v={targetGraph:s,collectionData:d,setTargetNode:i,node:r,loadCollections:m};return _.jsxs("div",{className:e.entityContainer,style:{boxShadow:c==null?void 0:c.boxShadow,border:u?"2px dashed #f5a20a":0},children:[p.map((w,x)=>_.jsx(ue.Badge.Ribbon,{color:w.color,style:{width:"103%",height:"3px",marginTop:x*5-8,borderRadius:0},placement:"start"},x)),_.jsxs("div",{className:e.headClass,style:{background:c!=null&&c.hightLight?"#1890ff":null,paddingTop:p.length*3},children:[_.jsx("span",{className:e.tableNameClass,children:b(o)}),_.jsx("div",{className:e.tableBtnClass,children:_.jsx(j.SchemaComponentProvider,{children:_.jsx(x0,{setTargetNode:i,node:r,children:_.jsx(j.CollectionProvider,{collection:j.collection,children:_.jsx(j.SchemaComponent,{scope:{useUpdateCollectionActionAndRefreshCM:Mu,useCancelAction:Cr,loadCollections:m,loadCategories:y,useAsyncDataSource:_u,enableInherits:(f==null?void 0:f.dialect)==="postgres"},components:ie({EditOutlined:Ue.EditOutlined,EditCollectionAction:KU},t.components),schema:{type:"object",properties:{update:{type:"void",title:'{{ t("Edit") }}',"x-component":"EditCollectionAction","x-component-props":{type:"primary",item:d.current,className:"btn-edit-in-head"}},delete:{type:"void","x-action":"destroy","x-component":"Action","x-component-props":{component:Ue.DeleteOutlined,icon:"DeleteOutlined",className:"btn-del",confirm:{title:"{{t('Delete record')}}",getContainer:At,collectionConten:"{{t('Are you sure you want to delete it?')}}"},useAction:()=>F2({name:a,id:h})}}}}})})})})})]}),_.jsx(iW,ie({},v))]})};class oW extends It{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:b2,groupBy:w2,last:aW,maxBy:Fa,minBy:y0,take:x2}=Ou,v0=40,b0=250;let k,Mn;const lW="TB",Pu=(n,e)=>{const t=[];for(;e.length>0&&n;)t.push(e.splice(0,n));return t};function cW(n){return ze(this,null,function*(){const{positions:e}=k;let t=[];const r=k.getNodes(),i=k.getEdges(),s=new Su.graphlib.Graph;s.setGraph({rankdir:lW,nodesep:50,edgesep:50,rankSep:50,align:"DL",controlPoints:!0}),s.setDefaultEdgeLabel(()=>({})),r.forEach((a,l)=>{const c=b0,u=a.getPorts().length*32+30;s.setNode(a.id,{width:c,height:u})}),Su.layout(s),Pu(15,s.nodes()).forEach((a,l)=>{a.forEach((c,u)=>{const h=k.getCellById(c),f=u%15;if(h){const d=e&&e.find(p=>p.collectionName===h.store.data.name)||{},g={x:f*325+50,y:l*400+60};h.position(d.x||g.x,d.y||g.y),e&&!e.find(p=>p.collectionName===h.store.data.name)&&t.push({collectionName:h.store.data.name,x:g.x,y:g.y})}})}),i.forEach(a=>{Eu(a)}),Mn?typeof Mn=="string"?k.positionCell(aW(r),"top",{padding:100}):k.positionCell(Mn,"top",{padding:100}):k.positionCell(r[0],"top-left",{padding:100}),t.length>0&&(yield n(t),t=[])})}function Eu(n){const{store:{data:{connectionType:e}}}=n,t=n.getSource(),r=n.getTarget(),i=k.getCellById(t.cell).position().x,s=k.getCellById(r.cell).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 u=k.getCellById(t.cell),h=k.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:u.position().x-30,y:u.position().y+20},{x:h.position().x-30,y:h.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 C2=W.createContext({}),uW=()=>{const n=[],e=k.getEdges(),t=k.getNodes();return e.forEach(i=>{n.push(i.getSourceCellId()),n.push(i.getTargetCellId())}),w2(t,i=>n.includes(i.id)?"linkNodes":"rawNodes")},hW=()=>{var m;const{linkNodes:n=[],rawNodes:e}=uW(),{positions:t}=k,r=n.concat(e),i=k.getEdges(),s=new Su.graphlib.Graph;let o,a,l,c,u;const h=[];s.setGraph({rankdir:"TB",nodesep:50,edgesep:50,rankSep:50,align:"DL",controlPoints:!0});const f=250,d=400;r.forEach(y=>{s.setNode(y.id,{width:f,height:d})}),i.forEach(y=>{const v=y.getSource(),w=y.getTarget();s.setEdge(v.cell,w.cell,{})}),Su.layout(s);const g=s.nodes(),p=x2(g,n.length),b=b2(g,n.length);if(p.forEach(y=>{var x;const v=k.getCellById(y),w=(x=t.find(C=>C.collectionName===v.id))==null?void 0:x.id;if(v){const C=s.node(y);h.push({id:w,x:C.x,y:C.y}),v.position(C==null?void 0:C.x,C==null?void 0:C.y)}}),p.length){u=k.getCellById(Fa(p,x=>k.getCellById(x).position().y)).position().y,c=k.getCellById(y0(p,x=>k.getCellById(x).position().x)).position().x;const y=k.getCellById(Fa(p,x=>k.getCellById(x).position().x)).position().x,v=p.filter(x=>Math.abs(k.getCellById(x).position().y-u)<50),w=(m=k.getCellById(Fa(v,x=>k.getCellById(x).position().x)))==null?void 0:m.position();if(l=Math.round(y/320)||1,o=Math.floor((4500-(y+100-w.x))/280),a=Pu(l,e),o>=1){const x=x2(b,o);a=Pu(l,b2(b,o)),x.forEach((C,P)=>{var A;const E=k.getCellById(C);if(E){const O={x:w.x+320*P+280,y:w.y};E.position(O.x,O.y);const T=(A=t.find(L=>L.collectionName===E.id))==null?void 0:A.id;h.push({id:T,x:O.x,y:O.y})}})}}else l=15,o=0,a=Pu(15,e),c=50,u=50;a.forEach((y,v)=>{y.forEach((w,x)=>{var E;const C=k.getCellById(w),P=x%l;if(C){const A={x:P*325+c,y:v*300+u+300};C.position(A.x,A.y);const O=(E=t.find(T=>T.collectionName===C.id))==null?void 0:E.id;h.push({id:O,x:A.x,y:A.y})}})}),i.forEach(y=>{Eu(y)}),k.positionCell(r[0],"top-left",{padding:100}),k.updatePositionAction(h,!0)},S2=W.memo(()=>{const{theme:n}=j.useGlobalTheme(),{styles:e}=m0(),t=W.useContext(Kt.SchemaOptionsContext),r=W.useContext(j.CollectionManagerContext),i=j.useAPIClient(),s=j.useCompile(),{t:o}=g0(),[a,l]=W.useState([]),[c,u]=W.useState([]),[h,f]=W.useState(!1),{refreshCM:d,collections:g}=j.useCollectionManager(),p=j.useCurrentAppInfo(),{data:{database:b}}=p,m=W.useContext(j.CollectionCategroriesContext),y=ie({},t==null?void 0:t.scope),v=ie({},t==null?void 0:t.components),w=N=>ze(this,null,function*(){yield i.resource("graphPositions").create({values:N}),yield C()}),x=(N,$=!1)=>ze(this,null,function*(){$?yield i.resource("graphPositions").update({values:N}):yield i.resource("graphPositions").update({filter:{collectionName:N.collectionName},values:ie({},N)}),yield C()}),C=()=>ze(this,null,function*(){const{data:N}=yield i.resource("graphPositions").list({paginate:!1});return k.positions=N.data,Promise.resolve()}),P=N=>{Mn=N,N==="destory"&&C()},E=N=>ze(this,null,function*(){const $=(N==null?void 0:N.length)>0?N:yield d();k.collections=$,k.updatePositionAction=x;const z=k.getNodes();l($),u($),z.length?V($):L($)}),A=()=>{k=new G({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}),k.connectionType="both",k.direction="target",k.cacheCollection={},G.registerPortLayout("erPortPosition",N=>N.map(($,z)=>({position:{x:0,y:(z+1)*v0},angle:0})),!0),R6({shape:"er-rect",width:b0,height:v0,ports:{groups:{list:{markup:[{tagName:"rect",selector:"portBody"}],attrs:{portBody:{width:b0,height:v0,strokeWidth:1,visibility:"hidden"}},position:"erPortPosition"}}},body:{refWidth:100,refHeight:100},component:W.forwardRef((N,$)=>_.jsx(j.CurrentAppInfoContext.Provider,{value:p,children:_.jsx(j.APIClientProvider,{apiClient:i,children:_.jsx(j.SchemaComponentOptions,{inherit:!0,scope:y,components:v,children:_.jsx(j.CollectionCategroriesProvider,He(ie({},m),{children:_.jsx(j.CollectionManagerProvider,{collections:k==null?void 0:k.collections,refreshCM:E,interfaces:r.interfaces,children:_.jsx(ue.ConfigProvider,{theme:n,children:_.jsx("div",{style:{height:"auto"},children:_.jsx(ue.App,{children:_.jsx(sW,He(ie({},N),{setTargetNode:P,targetGraph:k}))})})})})}))})})}))}),k.use(new DP({enabled:!0,pannable:!0,padding:{top:0,left:500,right:300,bottom:400}})),k.use(new BP({container:document.getElementById("graph-minimap"),width:300,height:250,padding:10,graphOptions:{async:!0,createCellView(N){if(N.isEdge())return null;if(N.isNode())return oW}}})),k.use(new Qs({enabled:!1,multiple:!0,rubberband:!0,movable:!0,className:"node-selecting",modifiers:"shift"})),k.use(new FP({enabled:!0})),k.on("edge:mouseleave",({e:N,edge:$})=>{N.stopPropagation(),O($)}),k.on("node:moved",({e:N,node:$})=>{N.stopPropagation();const z=k.getConnectedEdges($),X=$.position(),re=k.positions.find(he=>he.collectionName===$.store.data.name);re?(re.x!==X.x||re.y!==X.y)&&x(ie({collectionName:$.store.data.name},X)):w(ie({collectionName:$.store.data.name},X)),z.forEach(he=>{Eu(he)})}),k.on("cell:mouseenter",({e:N,cell:$,edge:z})=>{N.stopPropagation(),$.toFront(),z&&T(z)}),k.on("blank:click",N=>{var $;k!=null&&k.activeEdge&&O(k==null?void 0:k.activeEdge),($=k.collapseNodes)==null||$.map(z=>{const X=k.getCellById(Object.keys(z)[0]);Object.values(z)[0]&&X.setData({collapse:!1})}),k.cleanSelection()}),k.on("node:selected",({e:N,node:$})=>{$.setProp({select:!0})}),k.on("node:unselected",({e:N,node:$})=>{$.setProp({select:!1})})},O=N=>{var Ce,we;k.activeEdge=null;const{m2m:$,connectionType:z}=(we=(Ce=N.store)==null?void 0:Ce.data)!=null?we:{},X=$==null?void 0:$.find($e=>$e!==N.id),re=k.getCellById(X),he=$e=>{const Le=k.getCellById($e.store.data.target.cell),Tt=k.getCellById($e.store.data.source.cell);Le.setProp({targetPort:!1,associated:null}),Tt.setProp({sourcePort:!1,associated:null}),$e.setAttrs({line:{stroke:"#ddd",targetMarker:z==="inherited"?{name:"classic",fill:"#ddd"}:null}}),$e.setLabels($e.getLabels().map(ae=>He(ie({},ae),{attrs:{labelText:He(ie({},ae.attrs.labelText),{fill:"rgba(0, 0, 0, 0.3)"}),labelBody:He(ie({},ae.attrs.labelBody),{stroke:"#ddd"})}})))};he(N),re&&he(re)},T=N=>{var we,$e;k.activeEdge=N;const{associated:$,m2m:z,connectionType:X}=($e=(we=N.store)==null?void 0:we.data)!=null?$e:{},re=z==null?void 0:z.find(Le=>Le!==N.id),he=k.getCellById(re),Ce=Le=>{Le.toFront(),Le.setAttrs({line:{stroke:"#1890ff",strokeWidth:1,textAnchor:"middle",textVerticalAnchor:"middle",sourceMarker:null,targetMarker:X==="inherited"?{name:"classic",fill:"#1890ff"}:null}}),Le.setLabels(Le.getLabels().map(dt=>He(ie({},dt),{attrs:{labelText:He(ie({},dt.attrs.labelText),{fill:"#1890ff"}),labelBody:He(ie({},dt.attrs.labelBody),{stroke:"#1890ff"})}})));const Tt=k.getCellById(Le.store.data.target.cell),ae=k.getCellById(Le.store.data.source.cell);Tt.toFront(),ae.toFront(),Tt.setProp({targetPort:Le.store.data.target.port,associated:$}),ae.setProp({sourcePort:Le.store.data.source.port,associated:$})};Ce(N),he&&Ce(he)},L=N=>{const{nodesData:$,edgesData:z,inheritEdges:X}=p2(N);k.data={nodes:$,edges:z},k.fromJSON({nodes:$,edges:X.concat(z)}),cW(w)},V=N=>{const{positions:$}=k,{nodesData:z,edgesData:X,inheritEdges:re}=p2(N),he=k.getNodes().map(Ot=>Ot.store.data),Ce=k.getEdges().map(Ot=>Ot.store.data),we=w2(Ce,Ot=>Ot.connectionType?"currentInheritEdges":"currentRelateEdges"),$e=UU(z,he),Le=y2(X,we.currentRelateEdges||[]),Tt=y2(re,we.currentInheritEdges||[]),ae=Fa($,"y").y,dt=y0($,"x").x,de=$.filter(Ot=>Math.abs(Ot.y-ae)<100);let dn=Fa(de,"x"),_n;$e.forEach(({status:Ot,node:Mt,port:Je})=>{const Un=k.getCellById(Mt.id);switch(Ot){case"add":dn.x>4500?(dn=y0(de,"x"),_n={x:dt,y:dn.y+400}):_n={x:dn.x+350,y:dn.y},Mn=k.addNode(He(ie({},Mt),{position:_n})),w(ie({collectionName:Mt.name},_n)),k&&k.positionCell(Mn,"top",{padding:200});break;case"insertPort":Un.insertPort(Je.index,Je.port);break;case"deletePort":Un.removePort(Je.id);break;case"updateNode":Un.setProp({title:Mt.title});break;case"delete":k.removeCell(Mt.id);break;default:return null}});const w0=Ot=>{Ot.forEach(({status:Mt,edge:Je})=>{const Un=k.addEdge(ie({},Je));switch(Mt){case"add":Eu(Un);break;case"delete":k.removeCell(Je.id);break;default:return null}})};setTimeout(()=>{w0(Le.concat(Tt))},300)},Y=N=>{const $=N.target.value.toLowerCase();if($){const z=a.filter(X=>s(X.title).toLowerCase().includes($));u(z)}else u(a)},M=(N,$)=>{$==="target"?g2(k.collections,N).forEach(X=>{var re;(re=k.getCellById(X))==null||re.setAttrs({hightLight:!0,direction:$,connectionType:"inherited"})}):qU(k.collections,N).forEach(X=>{var re;(re=k.getCellById(X.name))==null||re.setAttrs({hightLight:!0,direction:$,connectionType:"inherited"})})},I=N=>{const $=k.getCellById(N);k.cacheCollection[N]=!0,k.getConnectedEdges($).filter(re=>{var he;return!((he=re.store.data)!=null&&he.connectionType)&&re.getTargetCellId()===N}).forEach(re=>{var we;re.store.data.m2m&&re.store.data.m2m.forEach($e=>{var Tt;const Le=k.getCellById($e);if(Le.getTargetCellId()===N){const ae=Le.getSourceCellId(),dt=k.getCellById(ae);(Tt=dt.store.data.attrs)!=null&&Tt.hightLight||(dt.setAttrs({hightLight:!0,direction:"target",connectionType:"entity"}),I(ae))}});const he=re.getSourceCellId(),Ce=k.getCellById(he);(we=Ce.store.data.attrs)!=null&&we.hightLight||(Ce.setAttrs({hightLight:!0,direction:"target",connectionType:"entity"}),I(he))})},J=N=>{const $=k.getCellById(N);k.getConnectedEdges($).filter(re=>{var he;return!((he=re.store.data)!=null&&he.connectionType)&&re.getSourceCellId()===N}).forEach(re=>{var we;re.store.data.m2m&&re.store.data.m2m.forEach($e=>{var Tt;const Le=k.getCellById($e);if(Le.getSourceCellId()===N){const ae=Le.getTargetCellId(),dt=k.getCellById(ae);(Tt=dt.store.data.attrs)!=null&&Tt.hightLight||(dt.setAttrs({hightLight:!0,direction:"source",connectionType:"entity"}),J(ae))}});const he=re.getTargetCellId(),Ce=k.getCellById(he);(we=Ce.store.data.attrs)!=null&&we.hightLight||(Ce.setAttrs({hightLight:!0,direction:"source",connectionType:"entity"}),J(he))})},R=(N,$)=>{$==="target"?I(N):J(N)},F=(N,$,z)=>{var he,Ce;const X=k.getNodes().filter(we=>{var $e;return($e=we.store.data.attrs)==null?void 0:$e.hightLight}),re=X.length;for(let we=0;we<re;we++){const{direction:$e,connectionType:Le}=X[we].getAttrs(),Tt=X[we].id!==N,ae=N&&((he=k.filterConfig)==null?void 0:he.key)===N?$e!==$:!0,dt=N&&((Ce=k.filterConfig)==null?void 0:Ce.key)===N?Le!==z:!0;X[we].id!==N&&setTimeout(()=>{Tt&&(ae||dt)&&X[we].setAttrs({hightLight:!1})},0)}},H=N=>{const{connectionType:$,direction:z,filterConfig:X}=k,re=N===(X==null?void 0:X.key)&&z==="both",he=N===(X==null?void 0:X.key)&&($==="both"||$===X.connectionType);N?((!re||!he)&&F(N,z,$),Mn=k.getCellById(N),k.positionCell(Mn,"center",{padding:0}),Mn.setAttrs({hightLight:!0,connectionType:$}),setTimeout(()=>{["entity","both"].includes($)&&(z==="both"?(R(N,"target"),R(N,"source")):(z==="target"&&R(N,z),z==="source"&&R(N,z))),["inherited","both"].includes($)&&(z==="both"?(M(N,"target"),M(N,"source")):M(N,z)),k.filterConfig={key:N,direction:z,connectionType:$}},0)):F()},ne=N=>{Pe(N)},Pe=N=>{Mn=null,k.getEdges().forEach(z=>{const{store:{data:{connectionType:X}}}=z;N==="entity"?X?z.setVisible(!1):z.setVisible(!0):N==="inherited"?X?z.setVisible(!0):z.setVisible(!1):z.setVisible(!0)})};W.useLayoutEffect(()=>(A(),()=>{k.off("cell:mouseenter"),k.off("edge:mouseleave"),k.off("node:moved"),k.off("blank:click"),k=null,Mn=null}),[]),W.useEffect(()=>{f(!0),C().then(()=>ze(this,null,function*(){yield E(g),f(!1)})).catch(N=>{throw f(!1),N})},[]);const Yt=()=>ze(this,null,function*(){var N;return(N=k.collections)==null?void 0:N.map($=>({label:s($.title),value:$.name}))});return _.jsx(ue.Layout,{children:_.jsx("div",{className:e.graphCollectionContainerClass,children:_.jsxs(ue.Spin,{spinning:h,children:[_.jsx(j.CollectionManagerProvider,{collections:k==null?void 0:k.collections,refreshCM:E,children:_.jsx(C2.Provider,{value:{collectionList:c,handleSearchCollection:Y},children:_.jsx("div",{className:xr.cx(e.collectionListClass),children:_.jsx(j.SchemaComponent,{components:{Select:N=>_.jsx(j.Select,He(ie({popupMatchSelectWidth:!1},N),{getPopupContainer:At})),AddCollectionAction:WU},schema:{type:"void",properties:{block1:{type:"void","x-collection":"collections","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:j.collection,request:{resource:"collections",action:"list",params:{pageSize:50,filter:{inherit:!1},sort:["sort"],appends:[]}}},properties:{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":"Action","x-component-props":{component:W.forwardRef(()=>{const[N,{toggleFullscreen:$}]=D2.useFullscreen(document.getElementById("graph_container"));return _.jsx(ue.Tooltip,{title:o("Full Screen"),getPopupContainer:At,children:_.jsx(ue.Button,{onClick:()=>{$()},children:N?_.jsx(Ue.FullscreenExitOutlined,{}):_.jsx(Ue.FullscreenOutlined,{})})})}),useAction:()=>({run(){}})}},collectionList:{type:"void","x-component":function(){const{handleSearchCollection:$,collectionList:z}=W.useContext(C2),[X,re]=W.useState([]),he=_.jsxs("div",{children:[_.jsx(ue.Input,{style:{margin:"4px 0"},bordered:!1,placeholder:o("Collection Search"),onChange:$}),_.jsx(ue.Menu,{selectedKeys:X,selectable:!0,className:xr.css`
662
+ `,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")]})]})}),sW=n=>{const{styles:e}=m0(),t=W.useContext(Kt.SchemaOptionsContext),{node:r,setTargetNode:i,targetGraph:s}=n,{store:{data:{title:o,name:a,item:l,attrs:c,select:u}},id:h}=r,{data:{database:f}}=R.useCurrentAppInfo(),d=W.useRef(),g=W.useContext(R.CollectionCategroriesContext);d.current=He(ie({},l),{title:o,inherits:l.inherits&&new Proxy(l.inherits,{})});const{category:p}=l,b=R.useCompile(),m=w=>ze(this,null,function*(){var x;return(x=s.collections)==null?void 0:x.map(C=>({label:b(C.title),value:C.name}))}),y=()=>ze(this,null,function*(){return g==null?void 0:g.data.map(w=>({label:b(w.name),value:w.id}))}),v={targetGraph:s,collectionData:d,setTargetNode:i,node:r,loadCollections:m};return _.jsxs("div",{className:e.entityContainer,style:{boxShadow:c==null?void 0:c.boxShadow,border:u?"2px dashed #f5a20a":0},children:[p.map((w,x)=>_.jsx(de.Badge.Ribbon,{color:w.color,style:{width:"103%",height:"3px",marginTop:x*5-8,borderRadius:0},placement:"start"},x)),_.jsxs("div",{className:e.headClass,style:{background:c!=null&&c.hightLight?"#1890ff":null,paddingTop:p.length*3},children:[_.jsx("span",{className:e.tableNameClass,children:b(o)}),_.jsx("div",{className:e.tableBtnClass,children:_.jsx(R.SchemaComponentProvider,{children:_.jsx(x0,{setTargetNode:i,node:r,children:_.jsx(R.CollectionProvider,{collection:R.collection,children:_.jsx(R.SchemaComponent,{scope:{useUpdateCollectionActionAndRefreshCM:Mu,useCancelAction:Cr,loadCollections:m,loadCategories:y,useAsyncDataSource:_u,enableInherits:(f==null?void 0:f.dialect)==="postgres"},components:ie({EditOutlined:Ue.EditOutlined,EditCollectionAction:KU},t.components),schema:{type:"object",properties:{update:{type:"void",title:'{{ t("Edit") }}',"x-component":"EditCollectionAction","x-component-props":{type:"primary",item:d.current,className:"btn-edit-in-head"}},delete:{type:"void","x-action":"destroy","x-component":"Action","x-component-props":{component:Ue.DeleteOutlined,icon:"DeleteOutlined",className:"btn-del",confirm:{title:"{{t('Delete record')}}",getContainer:At,collectionConten:"{{t('Are you sure you want to delete it?')}}"},useAction:()=>F2({name:a,id:h})}}}}})})})})})]}),_.jsx(iW,ie({},v))]})};class oW extends It{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:b2,groupBy:w2,last:aW,maxBy:Fa,minBy:y0,take:x2}=Ou,v0=40,b0=250;let k,Mn;const lW="TB",Pu=(n,e)=>{const t=[];for(;e.length>0&&n;)t.push(e.splice(0,n));return t};function cW(n){return ze(this,null,function*(){const{positions:e}=k;let t=[];const r=k.getNodes(),i=k.getEdges(),s=new Su.graphlib.Graph;s.setGraph({rankdir:lW,nodesep:50,edgesep:50,rankSep:50,align:"DL",controlPoints:!0}),s.setDefaultEdgeLabel(()=>({})),r.forEach((a,l)=>{const c=b0,u=a.getPorts().length*32+30;s.setNode(a.id,{width:c,height:u})}),Su.layout(s),Pu(15,s.nodes()).forEach((a,l)=>{a.forEach((c,u)=>{const h=k.getCellById(c),f=u%15;if(h){const d=e&&e.find(p=>p.collectionName===h.store.data.name)||{},g={x:f*325+50,y:l*400+60};h.position(d.x||g.x,d.y||g.y),e&&!e.find(p=>p.collectionName===h.store.data.name)&&t.push({collectionName:h.store.data.name,x:g.x,y:g.y})}})}),i.forEach(a=>{Eu(a)}),Mn?typeof Mn=="string"?k.positionCell(aW(r),"top",{padding:100}):k.positionCell(Mn,"top",{padding:100}):k.positionCell(r[0],"top-left",{padding:100}),t.length>0&&(yield n(t),t=[])})}function Eu(n){const{store:{data:{connectionType:e}}}=n,t=n.getSource(),r=n.getTarget(),i=k.getCellById(t.cell).position().x,s=k.getCellById(r.cell).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 u=k.getCellById(t.cell),h=k.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:u.position().x-30,y:u.position().y+20},{x:h.position().x-30,y:h.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 C2=W.createContext({}),uW=()=>{const n=[],e=k.getEdges(),t=k.getNodes();return e.forEach(i=>{n.push(i.getSourceCellId()),n.push(i.getTargetCellId())}),w2(t,i=>n.includes(i.id)?"linkNodes":"rawNodes")},hW=()=>{var m;const{linkNodes:n=[],rawNodes:e}=uW(),{positions:t}=k,r=n.concat(e),i=k.getEdges(),s=new Su.graphlib.Graph;let o,a,l,c,u;const h=[];s.setGraph({rankdir:"TB",nodesep:50,edgesep:50,rankSep:50,align:"DL",controlPoints:!0});const f=250,d=400;r.forEach(y=>{s.setNode(y.id,{width:f,height:d})}),i.forEach(y=>{const v=y.getSource(),w=y.getTarget();s.setEdge(v.cell,w.cell,{})}),Su.layout(s);const g=s.nodes(),p=x2(g,n.length),b=b2(g,n.length);if(p.forEach(y=>{var x;const v=k.getCellById(y),w=(x=t.find(C=>C.collectionName===v.id))==null?void 0:x.id;if(v){const C=s.node(y);h.push({id:w,x:C.x,y:C.y}),v.position(C==null?void 0:C.x,C==null?void 0:C.y)}}),p.length){u=k.getCellById(Fa(p,x=>k.getCellById(x).position().y)).position().y,c=k.getCellById(y0(p,x=>k.getCellById(x).position().x)).position().x;const y=k.getCellById(Fa(p,x=>k.getCellById(x).position().x)).position().x,v=p.filter(x=>Math.abs(k.getCellById(x).position().y-u)<50),w=(m=k.getCellById(Fa(v,x=>k.getCellById(x).position().x)))==null?void 0:m.position();if(l=Math.round(y/320)||1,o=Math.floor((4500-(y+100-w.x))/280),a=Pu(l,e),o>=1){const x=x2(b,o);a=Pu(l,b2(b,o)),x.forEach((C,P)=>{var A;const E=k.getCellById(C);if(E){const O={x:w.x+320*P+280,y:w.y};E.position(O.x,O.y);const T=(A=t.find(L=>L.collectionName===E.id))==null?void 0:A.id;h.push({id:T,x:O.x,y:O.y})}})}}else l=15,o=0,a=Pu(15,e),c=50,u=50;a.forEach((y,v)=>{y.forEach((w,x)=>{var E;const C=k.getCellById(w),P=x%l;if(C){const A={x:P*325+c,y:v*300+u+300};C.position(A.x,A.y);const O=(E=t.find(T=>T.collectionName===C.id))==null?void 0:E.id;h.push({id:O,x:A.x,y:A.y})}})}),i.forEach(y=>{Eu(y)}),k.positionCell(r[0],"top-left",{padding:100}),k.updatePositionAction(h,!0)},S2=W.memo(()=>{const{theme:n}=R.useGlobalTheme(),{styles:e}=m0(),t=W.useContext(Kt.SchemaOptionsContext),r=W.useContext(R.CollectionManagerContext),i=R.useAPIClient(),s=R.useCompile(),{t:o}=g0(),[a,l]=W.useState([]),[c,u]=W.useState([]),[h,f]=W.useState(!1),{refreshCM:d,collections:g}=R.useCollectionManager(),p=R.useCurrentAppInfo(),{data:{database:b}}=p,m=W.useContext(R.CollectionCategroriesContext),y=ie({},t==null?void 0:t.scope),v=ie({},t==null?void 0:t.components),w=N=>ze(this,null,function*(){yield i.resource("graphPositions").create({values:N}),yield C()}),x=(N,$=!1)=>ze(this,null,function*(){$?yield i.resource("graphPositions").update({values:N}):yield i.resource("graphPositions").update({filter:{collectionName:N.collectionName},values:ie({},N)}),yield C()}),C=()=>ze(this,null,function*(){const{data:N}=yield i.resource("graphPositions").list({paginate:!1});return k.positions=N.data,Promise.resolve()}),P=N=>{Mn=N,N==="destory"&&C()},E=N=>ze(this,null,function*(){const $=(N==null?void 0:N.length)>0?N:yield d();k.collections=$,k.updatePositionAction=x;const z=k.getNodes();l($),u($),z.length?V($):L($)}),A=()=>{k=new G({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}),k.connectionType="both",k.direction="target",k.cacheCollection={},G.registerPortLayout("erPortPosition",N=>N.map(($,z)=>({position:{x:0,y:(z+1)*v0},angle:0})),!0),X6({shape:"er-rect",width:b0,height:v0,ports:{groups:{list:{markup:[{tagName:"rect",selector:"portBody"}],attrs:{portBody:{width:b0,height:v0,strokeWidth:1,visibility:"hidden"}},position:"erPortPosition"}}},body:{refWidth:100,refHeight:100},component:W.forwardRef((N,$)=>_.jsx(R.CurrentAppInfoContext.Provider,{value:p,children:_.jsx(R.APIClientProvider,{apiClient:i,children:_.jsx(R.SchemaComponentOptions,{inherit:!0,scope:y,components:v,children:_.jsx(R.CollectionCategroriesProvider,He(ie({},m),{children:_.jsx(R.CollectionManagerProvider,{collections:k==null?void 0:k.collections,refreshCM:E,interfaces:r.interfaces,children:_.jsx(de.ConfigProvider,{theme:n,children:_.jsx("div",{style:{height:"auto"},children:_.jsx(de.App,{children:_.jsx(sW,He(ie({},N),{setTargetNode:P,targetGraph:k}))})})})})}))})})}))}),k.use(new Ax({enabled:!0,pannable:!0,padding:{top:0,left:500,right:300,bottom:400}})),k.use(new Ex({container:document.getElementById("graph-minimap"),width:300,height:250,padding:10,graphOptions:{async:!0,createCellView(N){if(N.isEdge())return null;if(N.isNode())return oW}}})),k.use(new Ss({enabled:!1,multiple:!0,rubberband:!0,movable:!0,className:"node-selecting",modifiers:"shift"})),k.use(new Mx({enabled:!0})),k.on("edge:mouseleave",({e:N,edge:$})=>{N.stopPropagation(),O($)}),k.on("node:moved",({e:N,node:$})=>{N.stopPropagation();const z=k.getConnectedEdges($),X=$.position(),re=k.positions.find(ue=>ue.collectionName===$.store.data.name);re?(re.x!==X.x||re.y!==X.y)&&x(ie({collectionName:$.store.data.name},X)):w(ie({collectionName:$.store.data.name},X)),z.forEach(ue=>{Eu(ue)})}),k.on("cell:mouseenter",({e:N,cell:$,edge:z})=>{N.stopPropagation(),$.toFront(),z&&T(z)}),k.on("blank:click",N=>{var $;k!=null&&k.activeEdge&&O(k==null?void 0:k.activeEdge),($=k.collapseNodes)==null||$.map(z=>{const X=k.getCellById(Object.keys(z)[0]);Object.values(z)[0]&&X.setData({collapse:!1})}),k.cleanSelection()}),k.on("node:selected",({e:N,node:$})=>{$.setProp({select:!0})}),k.on("node:unselected",({e:N,node:$})=>{$.setProp({select:!1})})},O=N=>{var Ce,we;k.activeEdge=null;const{m2m:$,connectionType:z}=(we=(Ce=N.store)==null?void 0:Ce.data)!=null?we:{},X=$==null?void 0:$.find($e=>$e!==N.id),re=k.getCellById(X),ue=$e=>{const Le=k.getCellById($e.store.data.target.cell),Tt=k.getCellById($e.store.data.source.cell);Le.setProp({targetPort:!1,associated:null}),Tt.setProp({sourcePort:!1,associated:null}),$e.setAttrs({line:{stroke:"#ddd",targetMarker:z==="inherited"?{name:"classic",fill:"#ddd"}:null}}),$e.setLabels($e.getLabels().map(ae=>He(ie({},ae),{attrs:{labelText:He(ie({},ae.attrs.labelText),{fill:"rgba(0, 0, 0, 0.3)"}),labelBody:He(ie({},ae.attrs.labelBody),{stroke:"#ddd"})}})))};ue(N),re&&ue(re)},T=N=>{var we,$e;k.activeEdge=N;const{associated:$,m2m:z,connectionType:X}=($e=(we=N.store)==null?void 0:we.data)!=null?$e:{},re=z==null?void 0:z.find(Le=>Le!==N.id),ue=k.getCellById(re),Ce=Le=>{Le.toFront(),Le.setAttrs({line:{stroke:"#1890ff",strokeWidth:1,textAnchor:"middle",textVerticalAnchor:"middle",sourceMarker:null,targetMarker:X==="inherited"?{name:"classic",fill:"#1890ff"}:null}}),Le.setLabels(Le.getLabels().map(dt=>He(ie({},dt),{attrs:{labelText:He(ie({},dt.attrs.labelText),{fill:"#1890ff"}),labelBody:He(ie({},dt.attrs.labelBody),{stroke:"#1890ff"})}})));const Tt=k.getCellById(Le.store.data.target.cell),ae=k.getCellById(Le.store.data.source.cell);Tt.toFront(),ae.toFront(),Tt.setProp({targetPort:Le.store.data.target.port,associated:$}),ae.setProp({sourcePort:Le.store.data.source.port,associated:$})};Ce(N),ue&&Ce(ue)},L=N=>{const{nodesData:$,edgesData:z,inheritEdges:X}=p2(N);k.data={nodes:$,edges:z},k.fromJSON({nodes:$,edges:X.concat(z)}),cW(w)},V=N=>{const{positions:$}=k,{nodesData:z,edgesData:X,inheritEdges:re}=p2(N),ue=k.getNodes().map(Ot=>Ot.store.data),Ce=k.getEdges().map(Ot=>Ot.store.data),we=w2(Ce,Ot=>Ot.connectionType?"currentInheritEdges":"currentRelateEdges"),$e=UU(z,ue),Le=y2(X,we.currentRelateEdges||[]),Tt=y2(re,we.currentInheritEdges||[]),ae=Fa($,"y").y,dt=y0($,"x").x,fe=$.filter(Ot=>Math.abs(Ot.y-ae)<100);let dn=Fa(fe,"x"),_n;$e.forEach(({status:Ot,node:Mt,port:Je})=>{const Un=k.getCellById(Mt.id);switch(Ot){case"add":dn.x>4500?(dn=y0(fe,"x"),_n={x:dt,y:dn.y+400}):_n={x:dn.x+350,y:dn.y},Mn=k.addNode(He(ie({},Mt),{position:_n})),w(ie({collectionName:Mt.name},_n)),k&&k.positionCell(Mn,"top",{padding:200});break;case"insertPort":Un.insertPort(Je.index,Je.port);break;case"deletePort":Un.removePort(Je.id);break;case"updateNode":Un.setProp({title:Mt.title});break;case"delete":k.removeCell(Mt.id);break;default:return null}});const w0=Ot=>{Ot.forEach(({status:Mt,edge:Je})=>{const Un=k.addEdge(ie({},Je));switch(Mt){case"add":Eu(Un);break;case"delete":k.removeCell(Je.id);break;default:return null}})};setTimeout(()=>{w0(Le.concat(Tt))},300)},Y=N=>{const $=N.target.value.toLowerCase();if($){const z=a.filter(X=>s(X.title).toLowerCase().includes($));u(z)}else u(a)},M=(N,$)=>{$==="target"?g2(k.collections,N).forEach(X=>{var re;(re=k.getCellById(X))==null||re.setAttrs({hightLight:!0,direction:$,connectionType:"inherited"})}):qU(k.collections,N).forEach(X=>{var re;(re=k.getCellById(X.name))==null||re.setAttrs({hightLight:!0,direction:$,connectionType:"inherited"})})},I=N=>{const $=k.getCellById(N);k.cacheCollection[N]=!0,k.getConnectedEdges($).filter(re=>{var ue;return!((ue=re.store.data)!=null&&ue.connectionType)&&re.getTargetCellId()===N}).forEach(re=>{var we;re.store.data.m2m&&re.store.data.m2m.forEach($e=>{var Tt;const Le=k.getCellById($e);if(Le.getTargetCellId()===N){const ae=Le.getSourceCellId(),dt=k.getCellById(ae);(Tt=dt.store.data.attrs)!=null&&Tt.hightLight||(dt.setAttrs({hightLight:!0,direction:"target",connectionType:"entity"}),I(ae))}});const ue=re.getSourceCellId(),Ce=k.getCellById(ue);(we=Ce.store.data.attrs)!=null&&we.hightLight||(Ce.setAttrs({hightLight:!0,direction:"target",connectionType:"entity"}),I(ue))})},J=N=>{const $=k.getCellById(N);k.getConnectedEdges($).filter(re=>{var ue;return!((ue=re.store.data)!=null&&ue.connectionType)&&re.getSourceCellId()===N}).forEach(re=>{var we;re.store.data.m2m&&re.store.data.m2m.forEach($e=>{var Tt;const Le=k.getCellById($e);if(Le.getSourceCellId()===N){const ae=Le.getTargetCellId(),dt=k.getCellById(ae);(Tt=dt.store.data.attrs)!=null&&Tt.hightLight||(dt.setAttrs({hightLight:!0,direction:"source",connectionType:"entity"}),J(ae))}});const ue=re.getTargetCellId(),Ce=k.getCellById(ue);(we=Ce.store.data.attrs)!=null&&we.hightLight||(Ce.setAttrs({hightLight:!0,direction:"source",connectionType:"entity"}),J(ue))})},j=(N,$)=>{$==="target"?I(N):J(N)},F=(N,$,z)=>{var ue,Ce;const X=k.getNodes().filter(we=>{var $e;return($e=we.store.data.attrs)==null?void 0:$e.hightLight}),re=X.length;for(let we=0;we<re;we++){const{direction:$e,connectionType:Le}=X[we].getAttrs(),Tt=X[we].id!==N,ae=N&&((ue=k.filterConfig)==null?void 0:ue.key)===N?$e!==$:!0,dt=N&&((Ce=k.filterConfig)==null?void 0:Ce.key)===N?Le!==z:!0;X[we].id!==N&&setTimeout(()=>{Tt&&(ae||dt)&&X[we].setAttrs({hightLight:!1})},0)}},H=N=>{const{connectionType:$,direction:z,filterConfig:X}=k,re=N===(X==null?void 0:X.key)&&z==="both",ue=N===(X==null?void 0:X.key)&&($==="both"||$===X.connectionType);N?((!re||!ue)&&F(N,z,$),Mn=k.getCellById(N),k.positionCell(Mn,"center",{padding:0}),Mn.setAttrs({hightLight:!0,connectionType:$}),setTimeout(()=>{["entity","both"].includes($)&&(z==="both"?(j(N,"target"),j(N,"source")):(z==="target"&&j(N,z),z==="source"&&j(N,z))),["inherited","both"].includes($)&&(z==="both"?(M(N,"target"),M(N,"source")):M(N,z)),k.filterConfig={key:N,direction:z,connectionType:$}},0)):F()},ne=N=>{Pe(N)},Pe=N=>{Mn=null,k.getEdges().forEach(z=>{const{store:{data:{connectionType:X}}}=z;N==="entity"?X?z.setVisible(!1):z.setVisible(!0):N==="inherited"?X?z.setVisible(!0):z.setVisible(!1):z.setVisible(!0)})};W.useLayoutEffect(()=>(A(),()=>{k.off("cell:mouseenter"),k.off("edge:mouseleave"),k.off("node:moved"),k.off("blank:click"),k=null,Mn=null}),[]),W.useEffect(()=>{f(!0),C().then(()=>ze(this,null,function*(){yield E(g),f(!1)})).catch(N=>{throw f(!1),N})},[]);const Yt=()=>ze(this,null,function*(){var N;return(N=k.collections)==null?void 0:N.map($=>({label:s($.title),value:$.name}))});return _.jsx(de.Layout,{children:_.jsx("div",{className:e.graphCollectionContainerClass,children:_.jsxs(de.Spin,{spinning:h,children:[_.jsx(R.CollectionManagerProvider,{collections:k==null?void 0:k.collections,refreshCM:E,children:_.jsx(C2.Provider,{value:{collectionList:c,handleSearchCollection:Y},children:_.jsx("div",{className:xr.cx(e.collectionListClass),children:_.jsx(R.SchemaComponent,{components:{Select:N=>_.jsx(R.Select,He(ie({popupMatchSelectWidth:!1},N),{getPopupContainer:At})),AddCollectionAction:WU},schema:{type:"void",properties:{block1:{type:"void","x-collection":"collections","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:R.collection,request:{resource:"collections",action:"list",params:{pageSize:50,filter:{inherit:!1},sort:["sort"],appends:[]}}},properties:{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":"Action","x-component-props":{component:W.forwardRef(()=>{const[N,{toggleFullscreen:$}]=D2.useFullscreen(document.getElementById("graph_container"));return _.jsx(de.Tooltip,{title:o("Full Screen"),getPopupContainer:At,children:_.jsx(de.Button,{onClick:()=>{$()},children:N?_.jsx(Ue.FullscreenExitOutlined,{}):_.jsx(Ue.FullscreenOutlined,{})})})}),useAction:()=>({run(){}})}},collectionList:{type:"void","x-component":function(){const{handleSearchCollection:$,collectionList:z}=W.useContext(C2),[X,re]=W.useState([]),ue=_.jsxs("div",{children:[_.jsx(de.Input,{style:{margin:"4px 0"},bordered:!1,placeholder:o("Collection Search"),onChange:$}),_.jsx(de.Menu,{selectedKeys:X,selectable:!0,className:xr.css`
663
663
  .ant-menu-item {
664
664
  height: 32px;
665
665
  line-height: 32px;
666
666
  }
667
- `,style:{maxHeight:"70vh",overflowY:"auto",border:"none"},items:[{type:"divider"},...z.map(Ce=>({key:Ce.name,label:s(Ce.title),onClick:we=>{we.key!==X[0]?(re([we.key]),H(we.key)):(k.filterConfig=null,H(!1),re([]))}}))]})]});return _.jsx(ue.Popover,{content:he,autoAdjustOverflow:!0,placement:"bottomRight",trigger:["click"],getPopupContainer:At,overlayClassName:xr.css`
667
+ `,style:{maxHeight:"70vh",overflowY:"auto",border:"none"},items:[{type:"divider"},...z.map(Ce=>({key:Ce.name,label:s(Ce.title),onClick:we=>{we.key!==X[0]?(re([we.key]),H(we.key)):(k.filterConfig=null,H(!1),re([]))}}))]})]});return _.jsx(R.Popover,{content:ue,autoAdjustOverflow:!0,placement:"bottomRight",trigger:["click"],getPopupContainer:At,overlayClassName:xr.css`
668
668
  .ant-popover-inner-content {
669
669
  padding: 0;
670
670
  }
671
- `,children:_.jsx(ue.Button,{children:_.jsx(Ue.MenuOutlined,{})})})},"x-component-props":{icon:"MenuOutlined",useAction:()=>({run(){}})}},autoLayout:{type:"void","x-component":"Action","x-component-props":{component:W.forwardRef(()=>_.jsx(ue.Tooltip,{title:o("Auto layout"),getPopupContainer:At,children:_.jsx(ue.Button,{onClick:()=>{hW()},children:_.jsx(Ue.ApartmentOutlined,{})})})),useAction:()=>({run(){}})}},connectionType:{type:"void","x-component":()=>{const N=[{key:"both",label:"All relationships"},{key:"entity",label:"Entity relationship only"},{key:"inherited",label:"Inheritance relationship only"}],$=_.jsx("div",{children:_.jsx(ue.Menu,{defaultSelectedKeys:["both"],selectable:!0,className:xr.css`
671
+ `,children:_.jsx(de.Button,{children:_.jsx(Ue.MenuOutlined,{})})})},"x-component-props":{icon:"MenuOutlined",useAction:()=>({run(){}})}},autoLayout:{type:"void","x-component":"Action","x-component-props":{component:W.forwardRef(()=>_.jsx(de.Tooltip,{title:o("Auto layout"),getPopupContainer:At,children:_.jsx(de.Button,{onClick:()=>{hW()},children:_.jsx(Ue.ApartmentOutlined,{})})})),useAction:()=>({run(){}})}},connectionType:{type:"void","x-component":()=>{const N=[{key:"both",label:"All relationships"},{key:"entity",label:"Entity relationship only"},{key:"inherited",label:"Inheritance relationship only"}],$=_.jsx("div",{children:_.jsx(de.Menu,{defaultSelectedKeys:["both"],selectable:!0,className:xr.css`
672
672
  .ant-menu-item {
673
673
  height: 32px;
674
674
  line-height: 32px;
675
675
  }
676
- `,style:{maxHeight:"70vh",overflowY:"auto",border:"none"},items:[{type:"divider"},...N.map(z=>({key:z.key,label:o(z.label),onClick:X=>{k.connectionType=z.key;const{filterConfig:re}=k;re&&H(re.key),ne(z.key)}}))]})});return _.jsx(ue.Popover,{content:$,autoAdjustOverflow:!0,placement:"bottomRight",trigger:["click"],getPopupContainer:At,overlayClassName:xr.css`
676
+ `,style:{maxHeight:"70vh",overflowY:"auto",border:"none"},items:[{type:"divider"},...N.map(z=>({key:z.key,label:o(z.label),onClick:X=>{k.connectionType=z.key;const{filterConfig:re}=k;re&&H(re.key),ne(z.key)}}))]})});return _.jsx(R.Popover,{content:$,autoAdjustOverflow:!0,placement:"bottomRight",trigger:["click"],getPopupContainer:At,overlayClassName:xr.css`
677
677
  .ant-popover-inner-content {
678
678
  padding: 0;
679
679
  }
680
- `,children:_.jsx(ue.Button,{children:_.jsx(Ue.ShareAltOutlined,{})})})},"x-component-props":{icon:"MenuOutlined",useAction:()=>({run(){}})}},direction:{type:"void","x-component":()=>{const N=[{key:"both",label:"All directions"},{key:"target",label:"Target index"},{key:"source",label:"Source index"}],$=_.jsx("div",{children:_.jsx(ue.Menu,{defaultSelectedKeys:["target"],selectable:!0,className:xr.css`
680
+ `,children:_.jsx(de.Button,{children:_.jsx(Ue.ShareAltOutlined,{})})})},"x-component-props":{icon:"MenuOutlined",useAction:()=>({run(){}})}},direction:{type:"void","x-component":()=>{const N=[{key:"both",label:"All directions"},{key:"target",label:"Target index"},{key:"source",label:"Source index"}],$=_.jsx("div",{children:_.jsx(de.Menu,{defaultSelectedKeys:["target"],selectable:!0,className:xr.css`
681
681
  .ant-menu-item {
682
682
  height: 32px;
683
683
  line-height: 32px;
684
684
  }
685
- `,style:{maxHeight:"70vh",overflowY:"auto",border:"none"},items:[{type:"divider"},...N.map(z=>({key:z.key,label:o(z.label),onClick:X=>{k.direction=z.key;const{filterConfig:re}=k;re&&H(re.key)}}))]})});return _.jsx(ue.Popover,{content:$,autoAdjustOverflow:!0,placement:"bottomRight",trigger:["click"],getPopupContainer:At,overlayClassName:xr.css`
685
+ `,style:{maxHeight:"70vh",overflowY:"auto",border:"none"},items:[{type:"divider"},...N.map(z=>({key:z.key,label:o(z.label),onClick:X=>{k.direction=z.key;const{filterConfig:re}=k;re&&H(re.key)}}))]})});return _.jsx(R.Popover,{content:$,autoAdjustOverflow:!0,placement:"bottomRight",trigger:["click"],getPopupContainer:At,overlayClassName:xr.css`
686
686
  .ant-popover-inner-content {
687
687
  padding: 0;
688
688
  }
689
- `,children:_.jsx(ue.Button,{children:_.jsx(Ue.LineHeightOutlined,{})})})}},selectMode:{type:"void","x-component":()=>_.jsx(ue.Tooltip,{title:o("Selection"),children:_.jsx(ue.Switch,{onChange:N=>{k.toggleSelection()}})})}}}}}}},scope:{useAsyncDataSource:_u,loadCollections:Yt,useCreateActionAndRefreshCM:()=>C0(P),enableInherits:(b==null?void 0:b.dialect)==="postgres"}})})})}),_.jsx("div",{id:"container",style:{width:"100vw",height:"100vh"}}),_.jsx("div",{id:"graph-minimap",className:e.graphMinimap,style:{width:"300px",height:"250px",right:"10px",bottom:"20px",position:"fixed"}})]})})})});S2.displayName="GraphDrawPage";const fW=n=>{const{visible:e}=j.useActionContext(),t=j.useRequest(()=>Promise.resolve({data:{name:`t_${qa.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}}]}}),He(ie({},n),{manual:!0}));return W.useEffect(()=>{e&&t.run()},[e]),t},dW=()=>_.jsx("div",{className:j.css`
689
+ `,children:_.jsx(de.Button,{children:_.jsx(Ue.LineHeightOutlined,{})})})}},selectMode:{type:"void","x-component":()=>_.jsx(de.Tooltip,{title:o("Selection"),children:_.jsx(de.Switch,{onChange:N=>{k.toggleSelection()}})})}}}}}}},scope:{useAsyncDataSource:_u,loadCollections:Yt,useCreateActionAndRefreshCM:()=>C0(P),enableInherits:(b==null?void 0:b.dialect)==="postgres"}})})})}),_.jsx("div",{id:"container",style:{width:"100vw",height:"100vh"}}),_.jsx("div",{id:"graph-minimap",className:e.graphMinimap,style:{width:"300px",height:"250px",right:"10px",bottom:"20px",position:"fixed"}})]})})})});S2.displayName="GraphDrawPage";const fW=n=>{const{visible:e}=R.useActionContext(),t=R.useRequest(()=>Promise.resolve({data:{name:`t_${qa.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}}]}}),He(ie({},n),{manual:!0}));return W.useEffect(()=>{e&&t.run()},[e]),t},dW=()=>_.jsx("div",{className:R.css`
690
690
  height: calc(100vh - 160px);
691
691
  overflow: auto;
692
692
  margin: calc(var(--nb-spacing) * -1);
693
693
  position: relative;
694
- `,id:"graph_container",children:_.jsx(j.SchemaComponent,{schema:{type:"void","x-component":"div",properties:{editor:{type:"void","x-component":"GraphDrawPage"}}},components:{GraphDrawPage:S2,DeleteOutlined:Ue.DeleteOutlined},scope:{useCollectionValues:fW,useCreateActionAndRefreshCM:C0}})}),P2=W.memo(n=>{const e=W.useContext(j.PluginManagerContext),{t}=g0(),r=W.useContext(j.SettingsCenterContext);return r["collection-manager"].tabs.graph={title:t("Graphical interface"),component:dW},_.jsx(j.SettingsCenterProvider,{settings:r,children:_.jsx(j.PluginManagerContext.Provider,{value:{components:ie({},e==null?void 0:e.components)},children:n.children})})});P2.displayName="GraphCollectionProvider";class E2 extends j.Plugin{load(){return ze(this,null,function*(){this.app.use(P2)})}}ee.GraphCollectionPlugin=E2,ee.default=E2,Object.defineProperties(ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
694
+ `,id:"graph_container",children:_.jsx(R.SchemaComponent,{schema:{type:"void","x-component":"div",properties:{editor:{type:"void","x-component":"GraphDrawPage"}}},components:{GraphDrawPage:S2,DeleteOutlined:Ue.DeleteOutlined},scope:{useCollectionValues:fW,useCreateActionAndRefreshCM:C0}})}),P2=W.memo(n=>{const e=W.useContext(R.PluginManagerContext),{t}=g0(),r=W.useContext(R.SettingsCenterContext);return r["collection-manager"].tabs.graph={title:t("Graphical interface"),component:dW},_.jsx(R.SettingsCenterProvider,{settings:r,children:_.jsx(R.PluginManagerContext.Provider,{value:{components:ie({},e==null?void 0:e.components)},children:n.children})})});P2.displayName="GraphCollectionProvider";class E2 extends R.Plugin{load(){return ze(this,null,function*(){this.app.use(P2)})}}ee.GraphCollectionPlugin=E2,ee.default=E2,Object.defineProperties(ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});